From 97ee2a6ed11a5d7a11263758896f03cbe8472252 Mon Sep 17 00:00:00 2001 From: riddhybansal Date: Fri, 6 Sep 2024 13:13:11 +0530 Subject: [PATCH] fix: added typescript types to fluidTextArea and FluidTextAreaSkeleton --- .../FluidTextArea/FluidTextArea.Skeleton.js | 32 ----- .../FluidTextArea/FluidTextArea.Skeleton.tsx | 46 +++++++ .../{FluidTextArea.js => FluidTextArea.tsx} | 114 +++++++++++++++++- .../FluidTextArea/{index.js => index.tsx} | 9 +- 4 files changed, 165 insertions(+), 36 deletions(-) delete mode 100644 packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.js create mode 100644 packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.tsx rename packages/react/src/components/FluidTextArea/{FluidTextArea.js => FluidTextArea.tsx} (58%) rename packages/react/src/components/FluidTextArea/{index.js => index.tsx} (59%) diff --git a/packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.js b/packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.js deleted file mode 100644 index fbe7186ae1fd..000000000000 --- a/packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.js +++ /dev/null @@ -1,32 +0,0 @@ -import PropTypes from 'prop-types'; -import React from 'react'; -import classnames from 'classnames'; -import { usePrefix } from '../../internal/usePrefix'; -import { FormContext } from '../FluidForm/FormContext'; - -function FluidTextAreaSkeleton({ className, ...other }) { - const prefix = usePrefix(); - - return ( - -
- -
-
- - ); -} - -FluidTextAreaSkeleton.propTypes = { - /** - * Specify an optional className to be applied to the outer FluidForm wrapper - */ - className: PropTypes.string, -}; - -export default FluidTextAreaSkeleton; diff --git a/packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.tsx b/packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.tsx new file mode 100644 index 000000000000..e09eb4e1d929 --- /dev/null +++ b/packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.tsx @@ -0,0 +1,46 @@ +import PropTypes from 'prop-types'; +import React from 'react'; +import classnames from 'classnames'; +import { usePrefix } from '../../internal/usePrefix'; +import { FormContext } from '../FluidForm/FormContext'; + +export interface FluidTextAreaSkeletonProps { + /** + * Specify an optional className to be applied to the outer FluidForm wrapper + */ + className?: string; +} + +function FluidTextAreaSkeleton({ className, ...other }) { + const prefix = usePrefix(); + + const FluidTextAreaSkeleton: React.FC = ({ + className, + ...other + }) => { + const prefix = usePrefix(); + + return ( + +
+ +
+
+ + ); + }; +} + +FluidTextAreaSkeleton.propTypes = { + /** + * Specify an optional className to be applied to the outer FluidForm wrapper + */ + className: PropTypes.string, +}; + +export default FluidTextAreaSkeleton; diff --git a/packages/react/src/components/FluidTextArea/FluidTextArea.js b/packages/react/src/components/FluidTextArea/FluidTextArea.tsx similarity index 58% rename from packages/react/src/components/FluidTextArea/FluidTextArea.js rename to packages/react/src/components/FluidTextArea/FluidTextArea.tsx index 417fe6c4a977..78bce8a70e59 100644 --- a/packages/react/src/components/FluidTextArea/FluidTextArea.js +++ b/packages/react/src/components/FluidTextArea/FluidTextArea.tsx @@ -13,7 +13,117 @@ import deprecate from '../../prop-types/deprecate'; import { usePrefix } from '../../internal/usePrefix'; import { FormContext } from '../FluidForm/FormContext'; -function FluidTextArea({ className, ...other }) { +export interface FluidTextAreaProps { + /** + * Provide a custom className that is applied directly to the underlying + * `