From a6ff5eee45215effb3344cb5d631a27a7c0369aa Mon Sep 17 00:00:00 2001
From: Armand Philippot <git@armandphilippot.com>
Date: Fri, 22 Sep 2023 19:34:01 +0200
Subject: refactor(components): rewrite form components

---
 .../molecules/forms/labelled-boolean-field.tsx     | 85 ----------------------
 1 file changed, 85 deletions(-)
 delete mode 100644 src/components/molecules/forms/labelled-boolean-field.tsx

(limited to 'src/components/molecules/forms/labelled-boolean-field.tsx')

diff --git a/src/components/molecules/forms/labelled-boolean-field.tsx b/src/components/molecules/forms/labelled-boolean-field.tsx
deleted file mode 100644
index d110d45..0000000
--- a/src/components/molecules/forms/labelled-boolean-field.tsx
+++ /dev/null
@@ -1,85 +0,0 @@
-import { FC } from 'react';
-import {
-  BooleanField,
-  type BooleanFieldProps,
-  Label,
-  type LabelProps,
-} from '../../atoms';
-import styles from './labelled-boolean-field.module.scss';
-
-export type LabelledBooleanFieldProps = Omit<
-  BooleanFieldProps,
-  'aria-labelledby' | 'className'
-> & {
-  /**
-   * Set additional classnames to the labelled field wrapper.
-   */
-  className?: string;
-  /**
-   * Set additional classnames to the field.
-   */
-  fieldClassName?: LabelledBooleanFieldProps['className'];
-  /**
-   * The field label.
-   */
-  label: LabelProps['children'];
-  /**
-   * Set additional classnames to the label.
-   */
-  labelClassName?: LabelProps['className'];
-  /**
-   * The label position. Default: left.
-   */
-  labelPosition?: 'left' | 'right';
-  /**
-   * The label size.
-   */
-  labelSize?: LabelProps['size'];
-};
-
-/**
- * LabelledBooleanField component
- *
- * Render a checkbox or radio button with a label.
- */
-export const LabelledBooleanField: FC<LabelledBooleanFieldProps> = ({
-  className = '',
-  fieldClassName,
-  hidden,
-  id,
-  label,
-  labelClassName,
-  labelPosition = 'left',
-  labelSize,
-  ...props
-}) => {
-  const labelHiddenModifier = hidden ? 'label--hidden' : 'label--visible';
-  const labelPositionModifier = `label--${labelPosition}`;
-  const labelClass = `${styles[labelPositionModifier]} ${styles[labelHiddenModifier]} ${labelClassName}`;
-
-  return labelPosition === 'left' ? (
-    <span className={`${styles.wrapper} ${className}`}>
-      <Label className={labelClass} htmlFor={id} size={labelSize}>
-        {label}
-      </Label>
-      <BooleanField
-        {...props}
-        className={fieldClassName}
-        hidden={hidden}
-        id={id}
-      />
-    </span>
-  ) : (
-    <span className={`${styles.wrapper} ${className}`}>
-      <BooleanField
-        {...props}
-        className={fieldClassName}
-        hidden={hidden}
-        id={id}
-      />
-      <Label className={labelClass} htmlFor={id} size={labelSize}>
-        {label}
-      </Label>
-    </span>
-  );
-};
-- 
cgit v1.2.3

