From 50a62eafc77b52ed73ebf338374e90de1a364536 Mon Sep 17 00:00:00 2001 From: Joseph Schultz Date: Fri, 15 Mar 2024 22:19:25 -0500 Subject: [PATCH 1/2] feat: add types to `RadioTile` Changes: - Convert `RadioTile` to Typescript and add types. - Add export for new interface `RadioTileProps`. - Normalize PropType descriptions with similar components. --- .all-contributorsrc | 9 ++ README.md | 1 + .../RadioTile/{RadioTile.js => RadioTile.tsx} | 100 +++++++++++++++--- .../RadioTile/{index.js => index.ts} | 4 +- 4 files changed, 96 insertions(+), 18 deletions(-) rename packages/react/src/components/RadioTile/{RadioTile.js => RadioTile.tsx} (55%) rename packages/react/src/components/RadioTile/{index.js => index.ts} (71%) diff --git a/.all-contributorsrc b/.all-contributorsrc index 862fe8ead31f..d006f943b119 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1434,6 +1434,15 @@ "contributions": [ "doc" ] + }, + { + "login": "cuppajoey", + "name": "Joseph Schultz", + "avatar_url": "https://avatars.githubusercontent.com/u/14837881?v=4", + "profile": "https://cuppajoey.com/", + "contributions": [ + "code" + ] } ], "commitConvention": "none" diff --git a/README.md b/README.md index c4f64b34cfc4..1de1f5e7a86d 100644 --- a/README.md +++ b/README.md @@ -278,6 +278,7 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
Garrett Dawson

💻 📖
Daniel Adebonojo

📖 +
Joseph Schultz

💻 diff --git a/packages/react/src/components/RadioTile/RadioTile.js b/packages/react/src/components/RadioTile/RadioTile.tsx similarity index 55% rename from packages/react/src/components/RadioTile/RadioTile.js rename to packages/react/src/components/RadioTile/RadioTile.tsx index 9ea9a8a9b31a..c2eca494ca51 100644 --- a/packages/react/src/components/RadioTile/RadioTile.js +++ b/packages/react/src/components/RadioTile/RadioTile.tsx @@ -21,12 +21,73 @@ import { noopFn } from '../../internal/noopFn'; import { Text } from '../Text'; import { useFeatureFlag } from '../FeatureFlags'; +export interface RadioTileProps { + /** + * Specify whether the `RadioTile` should be checked. + */ + checked?: boolean; + + /** + * The `RadioTile` content. + */ + children?: React.ReactNode; + + /** + * Provide an optional `className` to be applied to the underlying `