From cff03e20e3cd75a59ba5805415ba0117d76c3608 Mon Sep 17 00:00:00 2001 From: Dave Steinberg Date: Wed, 8 Mar 2023 16:55:00 -0500 Subject: [PATCH] refactor(typescript): add TextInputSkeleton types --- .all-contributorsrc | 9 +++++++++ README.md | 1 + ...put.Skeleton.js => TextInput.Skeleton.tsx} | 19 ++++++++++++++++++- 3 files changed, 28 insertions(+), 1 deletion(-) rename packages/react/src/components/TextInput/{TextInput.Skeleton.js => TextInput.Skeleton.tsx} (70%) diff --git a/.all-contributorsrc b/.all-contributorsrc index 0c263b6a4675..e86f256bafff 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -1076,6 +1076,15 @@ "contributions": [ "code" ] + }, + { + "login": "davesteinberg", + "name": "Dave Steinberg", + "avatar_url": "https://avatars.githubusercontent.com/u/3935584?v=4", + "profile": "https://github.com/davesteinberg", + "contributions": [ + "code" + ] } ], "commitConvention": "none" diff --git a/README.md b/README.md index 508c4c7ff635..ccab38319e21 100644 --- a/README.md +++ b/README.md @@ -228,6 +228,7 @@ check out our [Contributing Guide](/.github/CONTRIBUTING.md) and our
Ashvin Warrier

💻
GalvinGao

💻
Bianca Sparxs

💻 +
Dave Steinberg

💻 diff --git a/packages/react/src/components/TextInput/TextInput.Skeleton.js b/packages/react/src/components/TextInput/TextInput.Skeleton.tsx similarity index 70% rename from packages/react/src/components/TextInput/TextInput.Skeleton.js rename to packages/react/src/components/TextInput/TextInput.Skeleton.tsx index 09090487ab11..17d24e3ed7a6 100644 --- a/packages/react/src/components/TextInput/TextInput.Skeleton.js +++ b/packages/react/src/components/TextInput/TextInput.Skeleton.tsx @@ -10,7 +10,24 @@ import React from 'react'; import cx from 'classnames'; import { usePrefix } from '../../internal/usePrefix'; -const TextInputSkeleton = ({ hideLabel, className, ...rest }) => { +export interface TextInputSkeletonProps + extends React.HTMLAttributes { + /** + * Specify an optional className to add to the form item wrapper. + */ + className?: string; + + /** + * Specify whether the label should be hidden or not. + */ + hideLabel?: boolean; +} + +const TextInputSkeleton = ({ + hideLabel, + className, + ...rest +}: TextInputSkeletonProps) => { const prefix = usePrefix(); return (