-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: added typescript types to fluidTextArea and FluidTextAreaSkeleton (
- Loading branch information
1 parent
c823177
commit 581aee8
Showing
4 changed files
with
165 additions
and
36 deletions.
There are no files selected for viewing
32 changes: 0 additions & 32 deletions
32
packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.js
This file was deleted.
Oops, something went wrong.
46 changes: 46 additions & 0 deletions
46
packages/react/src/components/FluidTextArea/FluidTextArea.Skeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<FluidTextAreaSkeletonProps> = ({ | ||
className, | ||
...other | ||
}) => { | ||
const prefix = usePrefix(); | ||
|
||
return ( | ||
<FormContext.Provider value={{ isFluid: true }}> | ||
<div | ||
className={classnames( | ||
`${prefix}--form-item ${prefix}--text-area--fluid__skeleton`, | ||
className | ||
)} | ||
{...other}> | ||
<span className={`${prefix}--label ${prefix}--skeleton`} /> | ||
<div className={`${prefix}--skeleton ${prefix}--text-area`} /> | ||
</div> | ||
</FormContext.Provider> | ||
); | ||
}; | ||
} | ||
|
||
FluidTextAreaSkeleton.propTypes = { | ||
/** | ||
* Specify an optional className to be applied to the outer FluidForm wrapper | ||
*/ | ||
className: PropTypes.string, | ||
}; | ||
|
||
export default FluidTextAreaSkeleton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters