diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-06-01 19:34:43 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-06-01 22:32:16 +0200 |
| commit | 6be20422494e3806fba3d1c5ad5c3e98bd6e67e5 (patch) | |
| tree | 7c679e54ba4bbadaf0a59bbde780f5742e3b875d /src/components/atoms/forms/fieldset.tsx | |
| parent | 8320b1d39ea6402c32e907dbb35082efc6af9f5a (diff) | |
chore: replace the Ackee select by a toggle component
Diffstat (limited to 'src/components/atoms/forms/fieldset.tsx')
| -rw-r--r-- | src/components/atoms/forms/fieldset.tsx | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/src/components/atoms/forms/fieldset.tsx b/src/components/atoms/forms/fieldset.tsx deleted file mode 100644 index 99d31e7..0000000 --- a/src/components/atoms/forms/fieldset.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import { FC, ReactNode } from 'react'; -import styles from './fieldset.module.scss'; - -export type FieldsetProps = { - /** - * The fieldset body. - */ - children: ReactNode | ReactNode[]; - /** - * Set additional classnames to the fieldset wrapper. - */ - className?: string; - /** - * The fieldset legend. - */ - legend: string; - /** - * Set additional classnames to the legend. - */ - legendClassName?: string; - /** - * The legend position. Default: stacked. - */ - legendPosition?: 'inline' | 'stacked'; - /** - * An accessible role. Default: group. - */ - role?: 'group' | 'radiogroup' | 'presentation' | 'none'; -}; - -/** - * Fieldset component - * - * Render a fieldset with a legend. - */ -const Fieldset: FC<FieldsetProps> = ({ - children, - className = '', - legend, - legendClassName = '', - legendPosition = 'stacked', - ...props -}) => { - const wrapperModifier = `wrapper--${legendPosition}`; - - return ( - <fieldset - className={`${styles.wrapper} ${styles[wrapperModifier]} ${className}`} - {...props} - > - <legend className={`${styles.legend} ${legendClassName}`}> - {legend} - </legend> - {children} - </fieldset> - ); -}; - -export default Fieldset; |
