diff options
| author | Armand Philippot <git@armandphilippot.com> | 2023-09-22 19:34:01 +0200 | 
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2023-10-24 12:23:48 +0200 | 
| commit | a6ff5eee45215effb3344cb5d631a27a7c0369aa (patch) | |
| tree | 5051747acf72318b4fc5c18d603e3757fbefdfdb /src/components/atoms/forms/boolean-field.tsx | |
| parent | 651ea4fc992e77d2f36b3c68f8e7a70644246067 (diff) | |
refactor(components): rewrite form components
Diffstat (limited to 'src/components/atoms/forms/boolean-field.tsx')
| -rw-r--r-- | src/components/atoms/forms/boolean-field.tsx | 44 | 
1 files changed, 0 insertions, 44 deletions
| diff --git a/src/components/atoms/forms/boolean-field.tsx b/src/components/atoms/forms/boolean-field.tsx deleted file mode 100644 index 8f33a42..0000000 --- a/src/components/atoms/forms/boolean-field.tsx +++ /dev/null @@ -1,44 +0,0 @@ -import { FC, InputHTMLAttributes } from 'react'; -import styles from './boolean-field.module.scss'; - -export type BooleanFieldProps = Omit< -  InputHTMLAttributes<HTMLInputElement>, -  'checked' | 'hidden' | 'name' | 'type' | 'value' -> & { -  /** -   * True if the field should be checked. -   */ -  checked: boolean; -  /** -   * True if the field should be visually hidden. Default: false. -   */ -  hidden?: boolean; -  /** -   * Field name attribute. -   */ -  name: string; -  /** -   * The input type. -   */ -  type: 'checkbox' | 'radio'; -  /** -   * Field name attribute. -   */ -  value: string; -}; - -/** - * BooleanField component - * - * Render a checkbox or a radio input type. - */ -export const BooleanField: FC<BooleanFieldProps> = ({ -  className = '', -  hidden = false, -  ...props -}) => { -  const modifier = hidden ? 'hidden' : ''; -  const inputClass = `${styles[modifier]} ${className}`; - -  return <input {...props} className={inputClass} />; -}; | 
