diff --git a/.all-contributorsrc b/.all-contributorsrc index ce6cac01955b..8a2859520cee 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1114,6 +1114,15 @@ "contributions": [ "code" ] + }, + { + "login": "gerzonc", + "name": "Gerzon", + "avatar_url": "https://avatars.githubusercontent.com/u/36211892?v=4", + "profile": "https://github.com/gerzonc", + "contributions": [ + "code" + ] } ], "commitConvention": "none" diff --git a/README.md b/README.md index fbd905c255bb..565226a1ce32 100644 --- a/README.md +++ b/README.md @@ -234,6 +234,7 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
Dave Steinberg

💻
Seong-Hyun Ryoo

💻
Pratik Karad

💻 ️️️️♿️ +
Gerzon

💻 diff --git a/packages/react/src/components/Toggle/Toggle.Skeleton.js b/packages/react/src/components/Toggle/Toggle.Skeleton.tsx similarity index 70% rename from packages/react/src/components/Toggle/Toggle.Skeleton.js rename to packages/react/src/components/Toggle/Toggle.Skeleton.tsx index 87e80f725acb..abbd2eeae475 100644 --- a/packages/react/src/components/Toggle/Toggle.Skeleton.js +++ b/packages/react/src/components/Toggle/Toggle.Skeleton.tsx @@ -10,7 +10,34 @@ import React from 'react'; import cx from 'classnames'; import { PrefixContext } from '../../internal/usePrefix'; -class ToggleSkeleton extends React.Component { +type ToggleSkeletonProps = { + 'aria-label': string; + + /** + * Specify an optional className to add to the form item wrapper. + */ + className?: string; + + /** + * Provide an id that unique represents the underlying `` + */ + id?: string; + + /** + * Provide the text that will be read by a screen reader when visiting this + * control + * `aria-label` is always required but will be null if `labelText` is also + * provided + */ + labelText?: string; + + /** + * Specify the size of the Toggle. Currently only supports 'sm' or 'md' (default) + */ + size?: 'sm' | 'md'; +} & React.HTMLAttributes; + +class ToggleSkeleton extends React.Component { static propTypes = { ['aria-label']: PropTypes.string.isRequired, @@ -26,7 +53,7 @@ class ToggleSkeleton extends React.Component { /** * Provide the text that will be read by a screen reader when visiting this * control - * `aria-label` is always required but will be null if `labelText` is also + * `aria-label` is always required but will be undefined if `labelText` is also * provided */ labelText: PropTypes.string, @@ -37,7 +64,7 @@ class ToggleSkeleton extends React.Component { size: PropTypes.oneOf(['sm', 'md']), }; - static defaultProps = { + static defaultProps: Partial = { ['aria-label']: 'Toggle is loading', size: 'md', }; @@ -66,7 +93,7 @@ class ToggleSkeleton extends React.Component {