@flipdish/ui-library 0.57.0 → 0.58.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/atoms/Checkbox/index.cjs +7 -61
- package/dist/components/atoms/Checkbox/index.cjs.map +1 -1
- package/dist/components/atoms/Checkbox/index.d.ts +15 -55
- package/dist/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/components/atoms/Checkbox/index.js +7 -61
- package/dist/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs +56 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts +25 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js +54 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.cjs +13 -0
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.cjs.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.d.ts +20 -0
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.d.ts.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.js +11 -0
- package/dist/components/atoms/Checkboxes/Checkbox/CheckboxBase.js.map +1 -0
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.cjs +23 -0
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.cjs.map +1 -0
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.d.ts +27 -0
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.js +21 -0
- package/dist/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/components/atoms/Checkboxes/index.cjs +12 -0
- package/dist/components/atoms/Checkboxes/index.cjs.map +1 -0
- package/dist/components/atoms/Checkboxes/index.d.ts +16 -0
- package/dist/components/atoms/Checkboxes/index.d.ts.map +1 -0
- package/dist/components/atoms/Checkboxes/index.js +4 -0
- package/dist/components/atoms/Checkboxes/index.js.map +1 -0
- package/dist/components/atoms/Checkboxes/providers/CheckboxGroup.context.cjs +9 -0
- package/dist/components/atoms/Checkboxes/providers/CheckboxGroup.context.cjs.map +1 -0
- package/dist/components/atoms/Checkboxes/providers/CheckboxGroup.context.d.ts +10 -0
- package/dist/components/atoms/Checkboxes/providers/CheckboxGroup.context.d.ts.map +1 -0
- package/dist/components/atoms/Checkboxes/providers/CheckboxGroup.context.js +7 -0
- package/dist/components/atoms/Checkboxes/providers/CheckboxGroup.context.js.map +1 -0
- package/dist/components/atoms/Divider/index.cjs +3 -15
- package/dist/components/atoms/Divider/index.cjs.map +1 -1
- package/dist/components/atoms/Divider/index.d.ts +7 -20
- package/dist/components/atoms/Divider/index.d.ts.map +1 -1
- package/dist/components/atoms/Divider/index.js +3 -15
- package/dist/components/atoms/Divider/index.js.map +1 -1
- package/dist/components/atoms/Dividers/ContentDivider/ContentDivider.cjs +24 -0
- package/dist/components/atoms/Dividers/ContentDivider/ContentDivider.cjs.map +1 -0
- package/dist/components/atoms/Dividers/ContentDivider/ContentDivider.d.ts +19 -0
- package/dist/components/atoms/Dividers/ContentDivider/ContentDivider.d.ts.map +1 -0
- package/dist/components/atoms/Dividers/ContentDivider/ContentDivider.js +22 -0
- package/dist/components/atoms/Dividers/ContentDivider/ContentDivider.js.map +1 -0
- package/dist/components/atoms/Dividers/Divider/Divider.cjs +21 -0
- package/dist/components/atoms/Dividers/Divider/Divider.cjs.map +1 -0
- package/dist/components/atoms/Dividers/Divider/Divider.d.ts +20 -0
- package/dist/components/atoms/Dividers/Divider/Divider.d.ts.map +1 -0
- package/dist/components/atoms/Dividers/Divider/Divider.js +19 -0
- package/dist/components/atoms/Dividers/Divider/Divider.js.map +1 -0
- package/dist/components/atoms/{Divider → Dividers/Divider}/Divider.styles.cjs +1 -1
- package/dist/components/atoms/Dividers/Divider/Divider.styles.cjs.map +1 -0
- package/dist/components/atoms/{Divider → Dividers/Divider}/Divider.styles.d.ts +1 -1
- package/dist/components/atoms/Dividers/Divider/Divider.styles.d.ts.map +1 -0
- package/dist/components/atoms/{Divider → Dividers/Divider}/Divider.styles.js +1 -1
- package/dist/components/atoms/Dividers/Divider/Divider.styles.js.map +1 -0
- package/dist/components/atoms/Dividers/index.cjs +10 -0
- package/dist/components/atoms/Dividers/index.cjs.map +1 -0
- package/dist/components/atoms/Dividers/index.d.ts +14 -0
- package/dist/components/atoms/Dividers/index.d.ts.map +1 -0
- package/dist/components/atoms/Dividers/index.js +3 -0
- package/dist/components/atoms/Dividers/index.js.map +1 -0
- package/dist/components/atoms/RadioButton/index.cjs +7 -34
- package/dist/components/atoms/RadioButton/index.cjs.map +1 -1
- package/dist/components/atoms/RadioButton/index.d.ts +16 -51
- package/dist/components/atoms/RadioButton/index.d.ts.map +1 -1
- package/dist/components/atoms/RadioButton/index.js +7 -34
- package/dist/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs +31 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButton.d.ts +25 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButton.d.ts.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButton.js +29 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButton.js.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.cjs +13 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.cjs.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.d.ts +18 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.d.ts.map +1 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.js +11 -0
- package/dist/components/atoms/Radios/RadioButton/RadioButtonBase.js.map +1 -0
- package/dist/components/atoms/Radios/RadioGroup/RadioGroup.cjs +22 -0
- package/dist/components/atoms/Radios/RadioGroup/RadioGroup.cjs.map +1 -0
- package/dist/components/atoms/Radios/RadioGroup/RadioGroup.d.ts +20 -0
- package/dist/components/atoms/Radios/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/components/atoms/Radios/RadioGroup/RadioGroup.js +20 -0
- package/dist/components/atoms/Radios/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/components/atoms/Radios/index.cjs +12 -0
- package/dist/components/atoms/Radios/index.cjs.map +1 -0
- package/dist/components/atoms/Radios/index.d.ts +16 -0
- package/dist/components/atoms/Radios/index.d.ts.map +1 -0
- package/dist/components/atoms/Radios/index.js +4 -0
- package/dist/components/atoms/Radios/index.js.map +1 -0
- package/dist/components/atoms/Radios/providers/RadioGroup.context.cjs +9 -0
- package/dist/components/atoms/Radios/providers/RadioGroup.context.cjs.map +1 -0
- package/dist/components/atoms/Radios/providers/RadioGroup.context.d.ts +8 -0
- package/dist/components/atoms/Radios/providers/RadioGroup.context.d.ts.map +1 -0
- package/dist/components/atoms/Radios/providers/RadioGroup.context.js +7 -0
- package/dist/components/atoms/Radios/providers/RadioGroup.context.js.map +1 -0
- package/dist/components/forms/FormSection/index.cjs +2 -2
- package/dist/components/forms/FormSection/index.cjs.map +1 -1
- package/dist/components/forms/FormSection/index.js +1 -1
- package/dist/components/forms/fields/FormCheckbox/index.cjs +2 -2
- package/dist/components/forms/fields/FormCheckbox/index.d.ts +1 -1
- package/dist/components/forms/fields/FormCheckbox/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormCheckbox/index.js +1 -1
- package/dist/components/forms/fields/FormCheckboxGroup/index.cjs +2 -2
- package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts +1 -1
- package/dist/components/forms/fields/FormCheckboxGroup/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormCheckboxGroup/index.js +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.cjs +2 -2
- package/dist/components/forms/fields/FormRadioGroup/index.d.ts +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.d.ts.map +1 -1
- package/dist/components/forms/fields/FormRadioGroup/index.js +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbAccountItem.cjs +2 -2
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbAccountItem.cjs.map +1 -1
- package/dist/components/molecules/Breadcrumbs/components/BreadcrumbAccountItem.js +1 -1
- package/dist/components/molecules/ContentDivider/index.cjs +5 -18
- package/dist/components/molecules/ContentDivider/index.cjs.map +1 -1
- package/dist/components/molecules/ContentDivider/index.d.ts +5 -18
- package/dist/components/molecules/ContentDivider/index.d.ts.map +1 -1
- package/dist/components/molecules/ContentDivider/index.js +5 -18
- package/dist/components/molecules/ContentDivider/index.js.map +1 -1
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.cjs +4 -4
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.cjs.map +1 -1
- package/dist/components/molecules/Dropdown/components/DropdownSelectionIndicator.js +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.cjs +3 -3
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatarCard.js +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.cjs +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupCheckbox.js +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.cjs +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconCard.js +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.cjs +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupIconSimple.js +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.cjs +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupPaymentIcon.js +1 -1
- package/dist/components/molecules/Selects/components/SelectItem.cjs +2 -2
- package/dist/components/molecules/Selects/components/SelectItem.cjs.map +1 -1
- package/dist/components/molecules/Selects/components/SelectItem.js +1 -1
- package/dist/components/organisms/HeaderNavigation/components/NavAccountCard.cjs +2 -2
- package/dist/components/organisms/HeaderNavigation/components/NavAccountCard.cjs.map +1 -1
- package/dist/components/organisms/HeaderNavigation/components/NavAccountCard.js +1 -1
- package/dist/components/organisms/PageHeader/index.cjs +2 -2
- package/dist/components/organisms/PageHeader/index.cjs.map +1 -1
- package/dist/components/organisms/PageHeader/index.js +1 -1
- package/dist/components/organisms/Table/index.cjs +3 -3
- package/dist/components/organisms/Table/index.cjs.map +1 -1
- package/dist/components/organisms/Table/index.js +1 -1
- package/dist/components/organisms/TreeView/index.cjs +2 -2
- package/dist/components/organisms/TreeView/index.cjs.map +1 -1
- package/dist/components/organisms/TreeView/index.js +1 -1
- package/dist/native/components/atoms/Checkbox/index.d.ts +9 -65
- package/dist/native/components/atoms/Checkbox/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Checkbox/index.js +9 -72
- package/dist/native/components/atoms/Checkbox/index.js.map +1 -1
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts +36 -0
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.js +51 -0
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.js.map +1 -0
- package/dist/native/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.d.ts +37 -0
- package/dist/native/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
- package/dist/native/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.js +41 -0
- package/dist/native/components/atoms/Checkboxes/CheckboxGroup/CheckboxGroup.js.map +1 -0
- package/dist/native/components/atoms/Checkboxes/index.d.ts +6 -0
- package/dist/native/components/atoms/Checkboxes/index.d.ts.map +1 -0
- package/dist/native/components/atoms/Checkboxes/index.js +3 -0
- package/dist/native/components/atoms/Checkboxes/index.js.map +1 -0
- package/dist/native/components/atoms/Checkboxes/providers/CheckboxGroup.context.d.ts +15 -0
- package/dist/native/components/atoms/Checkboxes/providers/CheckboxGroup.context.d.ts.map +1 -0
- package/dist/native/components/atoms/Checkboxes/providers/CheckboxGroup.context.js +7 -0
- package/dist/native/components/atoms/Checkboxes/providers/CheckboxGroup.context.js.map +1 -0
- package/dist/native/components/atoms/Divider/index.d.ts +7 -33
- package/dist/native/components/atoms/Divider/index.d.ts.map +1 -1
- package/dist/native/components/atoms/Divider/index.js +6 -21
- package/dist/native/components/atoms/Divider/index.js.map +1 -1
- package/dist/native/components/atoms/Dividers/Divider/Divider.d.ts +33 -0
- package/dist/native/components/atoms/Dividers/Divider/Divider.d.ts.map +1 -0
- package/dist/native/components/atoms/Dividers/Divider/Divider.js +25 -0
- package/dist/native/components/atoms/Dividers/Divider/Divider.js.map +1 -0
- package/dist/native/components/atoms/{Divider → Dividers/Divider}/Divider.styles.d.ts +1 -1
- package/dist/native/components/atoms/Dividers/Divider/Divider.styles.d.ts.map +1 -0
- package/dist/native/components/atoms/{Divider → Dividers/Divider}/Divider.styles.js +1 -1
- package/dist/native/components/atoms/Dividers/Divider/Divider.styles.js.map +1 -0
- package/dist/native/components/atoms/Dividers/index.d.ts +5 -0
- package/dist/native/components/atoms/Dividers/index.d.ts.map +1 -0
- package/dist/native/components/atoms/Dividers/index.js +2 -0
- package/dist/native/components/atoms/Dividers/index.js.map +1 -0
- package/dist/native/components/atoms/RadioButton/index.d.ts +9 -49
- package/dist/native/components/atoms/RadioButton/index.d.ts.map +1 -1
- package/dist/native/components/atoms/RadioButton/index.js +9 -39
- package/dist/native/components/atoms/RadioButton/index.js.map +1 -1
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.d.ts +28 -0
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.d.ts.map +1 -0
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.js +29 -0
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.js.map +1 -0
- package/dist/native/components/atoms/Radios/RadioGroup/RadioGroup.d.ts +29 -0
- package/dist/native/components/atoms/Radios/RadioGroup/RadioGroup.d.ts.map +1 -0
- package/dist/native/components/atoms/Radios/RadioGroup/RadioGroup.js +29 -0
- package/dist/native/components/atoms/Radios/RadioGroup/RadioGroup.js.map +1 -0
- package/dist/native/components/atoms/Radios/index.d.ts +6 -0
- package/dist/native/components/atoms/Radios/index.d.ts.map +1 -0
- package/dist/native/components/atoms/Radios/index.js +3 -0
- package/dist/native/components/atoms/Radios/index.js.map +1 -0
- package/dist/native/components/atoms/Radios/providers/RadioGroup.context.d.ts +11 -0
- package/dist/native/components/atoms/Radios/providers/RadioGroup.context.d.ts.map +1 -0
- package/dist/native/components/atoms/Radios/providers/RadioGroup.context.js +7 -0
- package/dist/native/components/atoms/Radios/providers/RadioGroup.context.js.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostApproval.cjs +43 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostApproval.cjs.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostApproval.d.ts +14 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostApproval.d.ts.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostApproval.js +41 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostApproval.js.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostGuardRegistration.cjs +57 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostGuardRegistration.cjs.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostGuardRegistration.d.ts +16 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostGuardRegistration.d.ts.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostGuardRegistration.js +55 -0
- package/dist/providers/UnsavedChangesGuardProvider/hooks/useHostGuardRegistration.js.map +1 -0
- package/dist/providers/UnsavedChangesGuardProvider/index.cjs +7 -61
- package/dist/providers/UnsavedChangesGuardProvider/index.cjs.map +1 -1
- package/dist/providers/UnsavedChangesGuardProvider/index.d.ts.map +1 -1
- package/dist/providers/UnsavedChangesGuardProvider/index.js +8 -62
- package/dist/providers/UnsavedChangesGuardProvider/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/components/atoms/Divider/Divider.styles.cjs.map +0 -1
- package/dist/components/atoms/Divider/Divider.styles.d.ts.map +0 -1
- package/dist/components/atoms/Divider/Divider.styles.js.map +0 -1
- package/dist/native/components/atoms/Divider/Divider.styles.d.ts.map +0 -1
- package/dist/native/components/atoms/Divider/Divider.styles.js.map +0 -1
|
@@ -1,56 +1,21 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
size
|
|
6
|
-
testIdPrefix?: string;
|
|
7
|
-
}
|
|
8
|
-
export interface RadioButtonBaseProps {
|
|
9
|
-
/** Sets the circle size: 16px at `sm`, 20px at `md`. */
|
|
10
|
-
size?: 'sm' | 'md';
|
|
11
|
-
/** Extra classes merged onto the circle element. */
|
|
12
|
-
className?: string;
|
|
13
|
-
/** Draws the keyboard focus ring around the circle. */
|
|
14
|
-
isFocusVisible?: boolean;
|
|
15
|
-
/** Fills the circle with the brand colour and shows the inner dot. */
|
|
16
|
-
isSelected?: boolean;
|
|
17
|
-
/** Dims the circle and shows a not-allowed cursor. */
|
|
18
|
-
isDisabled?: boolean;
|
|
19
|
-
}
|
|
20
|
-
/** Visual-only radio circle with no input behaviour, for building custom selectable controls; `RadioButton` renders it inside a react-aria `Radio`. */
|
|
21
|
-
export declare const RadioButtonBase: {
|
|
22
|
-
({ className, isFocusVisible, isSelected, isDisabled, size }: RadioButtonBaseProps): import("react").JSX.Element;
|
|
1
|
+
import { type RadioButtonBaseProps as RadioButtonBasePropsNext, type RadioButtonProps as RadioButtonPropsNext } from '@flipdish/ui-library/components/atoms/Radios';
|
|
2
|
+
import type { RadioGroupContextType as RadioGroupContextTypeNext } from '../Radios/providers/RadioGroup.context';
|
|
3
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
4
|
+
export declare const RadioButton: {
|
|
5
|
+
({ label, hint, className, size, "data-testid": dataTestId, ...ariaRadioProps }: RadioButtonPropsNext): import("react").JSX.Element;
|
|
23
6
|
displayName: string;
|
|
24
7
|
};
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
size
|
|
28
|
-
/** Text shown beside the circle; clicking it selects the option. */
|
|
29
|
-
label?: ReactNode;
|
|
30
|
-
/** Supporting text shown below the label. */
|
|
31
|
-
hint?: ReactNode;
|
|
32
|
-
/** Ref forwarded to the underlying `<label>`. */
|
|
33
|
-
ref?: Ref<HTMLLabelElement>;
|
|
34
|
-
/** Overrides the derived `data-testid` (defaults to `<group>--option-<value>` or `fd-radio-button`). */
|
|
35
|
-
'data-testid'?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* Single-select option rendered inside a `RadioGroup`. Enforces mutual exclusivity
|
|
39
|
-
* across all sibling radios and manages ARIA roles automatically via react-aria.
|
|
40
|
-
*
|
|
41
|
-
* @summary single-select option used within a mutually exclusive group
|
|
42
|
-
*/
|
|
43
|
-
export declare const RadioButton: {
|
|
44
|
-
({ label, hint, className, size, "data-testid": dataTestId, ...ariaRadioProps }: RadioButtonProps): import("react").JSX.Element;
|
|
8
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
9
|
+
export declare const RadioButtonBase: {
|
|
10
|
+
({ className, isFocusVisible, isSelected, isDisabled, size }: RadioButtonBasePropsNext): import("react").JSX.Element;
|
|
45
11
|
displayName: string;
|
|
46
12
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
export
|
|
55
|
-
export {};
|
|
13
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
14
|
+
export declare const RadioGroup: ({ children, className, size, "data-testid": dataTestId, ...props }: import("@flipdish/ui-library/components/atoms/Radios").RadioGroupProps) => import("react").JSX.Element;
|
|
15
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
16
|
+
export type RadioButtonProps = RadioButtonPropsNext;
|
|
17
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
18
|
+
export type RadioButtonBaseProps = RadioButtonBasePropsNext;
|
|
19
|
+
/** @deprecated Internal to the radios and not exported from `atoms/Radios`. Removed in the next major. */
|
|
20
|
+
export type RadioGroupContextType = RadioGroupContextTypeNext;
|
|
56
21
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,oBAAoB,IAAI,wBAAwB,EAErD,KAAK,gBAAgB,IAAI,oBAAoB,EAE9C,MAAM,8CAA8C,CAAC;AAEtD,OAAO,KAAK,EAAE,qBAAqB,IAAI,yBAAyB,EAAE,MAAM,wCAAwC,CAAC;AAEjH,yGAAyG;AACzG,eAAO,MAAM,WAAW;;;CAAkB,CAAC;AAC3C,yGAAyG;AACzG,eAAO,MAAM,eAAe;;;CAAsB,CAAC;AACnD,yGAAyG;AACzG,eAAO,MAAM,UAAU,6KAAiB,CAAC;AACzC,yGAAyG;AACzG,MAAM,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AACpD,yGAAyG;AACzG,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC;AAC5D,0GAA0G;AAC1G,MAAM,MAAM,qBAAqB,GAAG,yBAAyB,CAAC"}
|
|
@@ -1,38 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
-
import { useResolvedTestId, joinTestId, slugifyTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
|
-
import { createContext, useContext } from 'react';
|
|
5
|
-
import { Radio, RadioGroup as RadioGroup$1 } from 'react-aria-components';
|
|
6
|
-
import { selectionControlSizes } from '../../__internal__/selectionControl/selectionControl.styles.js';
|
|
1
|
+
import { RadioButton as RadioButton$1, RadioButtonBase as RadioButtonBase$1, RadioGroup as RadioGroup$1 } from '@flipdish/ui-library/components/atoms/Radios';
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Single-select option rendered inside a `RadioGroup`. Enforces mutual exclusivity
|
|
16
|
-
* across all sibling radios and manages ARIA roles automatically via react-aria.
|
|
17
|
-
*
|
|
18
|
-
* @summary single-select option used within a mutually exclusive group
|
|
19
|
-
*/
|
|
20
|
-
const RadioButton = ({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }) => {
|
|
21
|
-
const context = useContext(RadioGroupContext);
|
|
22
|
-
size = context?.size ?? size;
|
|
23
|
-
const fallbackTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-button', rootName: 'radio-button' });
|
|
24
|
-
const radioTestId = !dataTestId && context?.testIdPrefix ? joinTestId(context.testIdPrefix, `option-${slugifyTestId(String(ariaRadioProps.value))}`) : fallbackTestId;
|
|
25
|
-
return (jsx(Radio, { ...ariaRadioProps, "data-testid": radioTestId, className: (state) => cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', selectionControlSizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxs(Fragment, { children: [jsx(RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxs("div", { className: cx('inline-flex flex-col', selectionControlSizes[size].textWrapper), children: [label && jsx("p", { className: cx('text-secondary select-none', selectionControlSizes[size].label), children: label }), hint && (
|
|
26
|
-
// biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
|
|
27
|
-
// biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
|
|
28
|
-
jsx("span", { className: cx('text-tertiary', selectionControlSizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
|
|
29
|
-
};
|
|
30
|
-
RadioButton.displayName = 'RadioButton';
|
|
31
|
-
/** Wrapper around react-aria-components' `RadioGroup` that stacks its `RadioButton` children and passes them `size` and a derived `data-testid`. */
|
|
32
|
-
const RadioGroup = ({ children, className, size = 'sm', 'data-testid': dataTestId, ...props }) => {
|
|
33
|
-
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
34
|
-
return (jsx(RadioGroupContext.Provider, { value: { size, testIdPrefix: rootTestId }, children: jsx(RadioGroup$1, { ...props, "data-testid": rootTestId, className: cx('flex flex-col gap-4', className), children: children }) }));
|
|
35
|
-
};
|
|
3
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
4
|
+
const RadioButton = RadioButton$1;
|
|
5
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
6
|
+
const RadioButtonBase = RadioButtonBase$1;
|
|
7
|
+
/** @deprecated Import from `@flipdish/ui-library/components/atoms/Radios`. Removed in the next major. */
|
|
8
|
+
const RadioGroup = RadioGroup$1;
|
|
36
9
|
|
|
37
10
|
export { RadioButton, RadioButtonBase, RadioGroup };
|
|
38
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"sourcesContent":[null],"names":["
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/components/atoms/RadioButton/index.tsx"],"sourcesContent":[null],"names":["RadioButtonNext","RadioButtonBaseNext","RadioGroupNext"],"mappings":";;AAcA;AACO,MAAM,WAAW,GAAGA;AAC3B;AACO,MAAM,eAAe,GAAGC;AAC/B;AACO,MAAM,UAAU,GAAGC;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
|
+
var React = require('react');
|
|
7
|
+
var reactAriaComponents = require('react-aria-components');
|
|
8
|
+
var selectionControl_styles = require('../../../__internal__/selectionControl/selectionControl.styles.cjs');
|
|
9
|
+
var RadioGroup_context = require('../providers/RadioGroup.context.cjs');
|
|
10
|
+
var RadioButtonBase = require('./RadioButtonBase.cjs');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Single-select option rendered inside a `RadioGroup`. Enforces mutual exclusivity
|
|
14
|
+
* across all sibling radios and manages ARIA roles automatically via react-aria.
|
|
15
|
+
*
|
|
16
|
+
* @summary single-select option used within a mutually exclusive group
|
|
17
|
+
*/
|
|
18
|
+
const RadioButton = ({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }) => {
|
|
19
|
+
const context = React.useContext(RadioGroup_context.RadioGroupContext);
|
|
20
|
+
size = context?.size ?? size;
|
|
21
|
+
const fallbackTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-button', rootName: 'radio-button' });
|
|
22
|
+
const radioTestId = !dataTestId && context?.testIdPrefix ? testIdUtils.joinTestId(context.testIdPrefix, `option-${testIdUtils.slugifyTestId(String(ariaRadioProps.value))}`) : fallbackTestId;
|
|
23
|
+
return (jsxRuntime.jsx(reactAriaComponents.Radio, { ...ariaRadioProps, "data-testid": radioTestId, className: (state) => cx.cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', selectionControl_styles.selectionControlSizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(RadioButtonBase.RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxRuntime.jsxs("div", { className: cx.cx('inline-flex flex-col', selectionControl_styles.selectionControlSizes[size].textWrapper), children: [label && jsxRuntime.jsx("p", { className: cx.cx('text-secondary select-none', selectionControl_styles.selectionControlSizes[size].label), children: label }), hint && (
|
|
24
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
|
|
25
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
|
|
26
|
+
jsxRuntime.jsx("span", { className: cx.cx('text-tertiary', selectionControl_styles.selectionControlSizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
|
|
27
|
+
};
|
|
28
|
+
RadioButton.displayName = 'RadioButton';
|
|
29
|
+
|
|
30
|
+
exports.RadioButton = RadioButton;
|
|
31
|
+
//# sourceMappingURL=RadioButton.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.cjs","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"sourcesContent":[null],"names":["useContext","RadioGroupContext","useResolvedTestId","joinTestId","slugifyTestId","_jsx","AriaRadio","cx","selectionControlSizes","_jsxs","_Fragment","RadioButtonBase"],"mappings":";;;;;;;;;;;AAuBA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,cAAc,EAAoB,KAAI;AACrI,IAAA,MAAM,OAAO,GAAGA,gBAAU,CAACC,oCAAiB,CAAC;AAE7C,IAAA,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;AAE5B,IAAA,MAAM,cAAc,GAAGC,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACnH,IAAA,MAAM,WAAW,GACf,CAAC,UAAU,IAAI,OAAO,EAAE,YAAY,GAAGC,sBAAU,CAAC,OAAO,CAAC,YAAY,EAAE,CAAA,OAAA,EAAUC,yBAAa,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,cAAc;AAEnJ,IAAA,QACEC,cAAA,CAACC,yBAAS,EAAA,EAAA,GACJ,cAAc,EAAA,aAAA,EACL,WAAW,EACxB,SAAS,EAAE,CAAC,KAAK,KACfC,KAAE,CACA,2BAA2B,EAC3B,KAAK,CAAC,UAAU,IAAI,oBAAoB,EACxCC,6CAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,EAChC,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAC/D,YAGF,CAAC,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,MAC1CC,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACEL,cAAA,CAACM,+BAAe,EAAA,EACd,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,cAAc,EAC9B,SAAS,EAAE,KAAK,IAAI,IAAI,GAAG,QAAQ,GAAG,EAAE,EAAA,CACxC,EACD,CAAC,KAAK,IAAI,IAAI,MACbF,eAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEF,KAAE,CAAC,sBAAsB,EAAEC,6CAAqB,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC,EAAA,QAAA,EAAA,CAChF,KAAK,IAAIH,sBAAG,SAAS,EAAEE,KAAE,CAAC,4BAA4B,EAAEC,6CAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,EAAA,QAAA,EAAG,KAAK,EAAA,CAAK,EACvG,IAAI;;;AAGH,wBAAAH,cAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAEC,6CAAqB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,CAAC,KAAK,KAAK,KAAK,CAAC,eAAe,EAAE,EAAA,QAAA,EAChH,IAAI,EAAA,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACS;AAEhB;AACA,WAAW,CAAC,WAAW,GAAG,aAAa;;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode, type Ref } from 'react';
|
|
2
|
+
import { type RadioProps as AriaRadioProps } from 'react-aria-components';
|
|
3
|
+
export interface RadioButtonProps extends AriaRadioProps {
|
|
4
|
+
/** Sets the circle size and the label and hint text size; a parent `RadioGroup`'s `size` overrides it. */
|
|
5
|
+
size?: 'sm' | 'md';
|
|
6
|
+
/** Text shown beside the circle; clicking it selects the option. */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
/** Supporting text shown below the label. */
|
|
9
|
+
hint?: ReactNode;
|
|
10
|
+
/** Ref forwarded to the underlying `<label>`. */
|
|
11
|
+
ref?: Ref<HTMLLabelElement>;
|
|
12
|
+
/** Overrides the derived `data-testid` (defaults to `<group>--option-<value>`, from the `RadioGroup` it sits in). */
|
|
13
|
+
'data-testid'?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Single-select option rendered inside a `RadioGroup`. Enforces mutual exclusivity
|
|
17
|
+
* across all sibling radios and manages ARIA roles automatically via react-aria.
|
|
18
|
+
*
|
|
19
|
+
* @summary single-select option used within a mutually exclusive group
|
|
20
|
+
*/
|
|
21
|
+
export declare const RadioButton: {
|
|
22
|
+
({ label, hint, className, size, "data-testid": dataTestId, ...ariaRadioProps }: RadioButtonProps): import("react").JSX.Element;
|
|
23
|
+
displayName: string;
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=RadioButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAE,KAAK,GAAG,EAAc,MAAM,OAAO,CAAC;AAC7D,OAAO,EAAsB,KAAK,UAAU,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK9F,MAAM,WAAW,gBAAiB,SAAQ,cAAc;IACtD,0GAA0G;IAC1G,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,oEAAoE;IACpE,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iDAAiD;IACjD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAC5B,qHAAqH;IACrH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,WAAW;qFAA2F,gBAAgB;;CA+ClI,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useResolvedTestId, joinTestId, slugifyTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
|
+
import { useContext } from 'react';
|
|
5
|
+
import { Radio } from 'react-aria-components';
|
|
6
|
+
import { selectionControlSizes } from '../../../__internal__/selectionControl/selectionControl.styles.js';
|
|
7
|
+
import { RadioGroupContext } from '../providers/RadioGroup.context.js';
|
|
8
|
+
import { RadioButtonBase } from './RadioButtonBase.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Single-select option rendered inside a `RadioGroup`. Enforces mutual exclusivity
|
|
12
|
+
* across all sibling radios and manages ARIA roles automatically via react-aria.
|
|
13
|
+
*
|
|
14
|
+
* @summary single-select option used within a mutually exclusive group
|
|
15
|
+
*/
|
|
16
|
+
const RadioButton = ({ label, hint, className, size = 'sm', 'data-testid': dataTestId, ...ariaRadioProps }) => {
|
|
17
|
+
const context = useContext(RadioGroupContext);
|
|
18
|
+
size = context?.size ?? size;
|
|
19
|
+
const fallbackTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-button', rootName: 'radio-button' });
|
|
20
|
+
const radioTestId = !dataTestId && context?.testIdPrefix ? joinTestId(context.testIdPrefix, `option-${slugifyTestId(String(ariaRadioProps.value))}`) : fallbackTestId;
|
|
21
|
+
return (jsx(Radio, { ...ariaRadioProps, "data-testid": radioTestId, className: (state) => cx('relative flex items-start', state.isDisabled && 'cursor-not-allowed', selectionControlSizes[size].root, typeof className === 'function' ? className(state) : className), children: ({ isSelected, isDisabled, isFocusVisible }) => (jsxs(Fragment, { children: [jsx(RadioButtonBase, { size: size, isSelected: isSelected, isDisabled: isDisabled, isFocusVisible: isFocusVisible, className: label || hint ? 'mt-0.5' : '' }), (label || hint) && (jsxs("div", { className: cx('inline-flex flex-col', selectionControlSizes[size].textWrapper), children: [label && jsx("p", { className: cx('text-secondary select-none', selectionControlSizes[size].label), children: label }), hint && (
|
|
22
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: This is a hint that is not interactive
|
|
23
|
+
// biome-ignore lint/a11y/useKeyWithClickEvents: This is a hint that is not interactive
|
|
24
|
+
jsx("span", { className: cx('text-tertiary', selectionControlSizes[size].hint), onClick: (event) => event.stopPropagation(), children: hint }))] }))] })) }));
|
|
25
|
+
};
|
|
26
|
+
RadioButton.displayName = 'RadioButton';
|
|
27
|
+
|
|
28
|
+
export { RadioButton };
|
|
29
|
+
//# sourceMappingURL=RadioButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButton.js","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButton.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadio","_jsxs","_Fragment"],"mappings":";;;;;;;;;AAuBA;;;;;AAKG;AACI,MAAM,WAAW,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,cAAc,EAAoB,KAAI;AACrI,IAAA,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC;AAE7C,IAAA,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,IAAI;AAE5B,IAAA,MAAM,cAAc,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAC;AACnH,IAAA,MAAM,WAAW,GACf,CAAC,UAAU,IAAI,OAAO,EAAE,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,YAAY,EAAE,C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AAI,EAAA,CACA,CACR,IACG,CACP,CAAA,EAAA,CACA,CACJ,EAAA,CACS;AAEhB;AACA,WAAW,CAAC,WAAW,GAAG,aAAa;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
|
|
6
|
+
/** Visual-only radio circle with no input behaviour, for building custom selectable controls; `RadioButton` renders it inside a react-aria `Radio`. */
|
|
7
|
+
const RadioButtonBase = ({ className, isFocusVisible, isSelected, isDisabled, size = 'sm' }) => {
|
|
8
|
+
return (jsxRuntime.jsx("div", { className: cx.cx('flex size-4 shrink-0 cursor-pointer appearance-none items-center justify-center rounded-full bg-primary ring-1 ring-primary ring-inset', size === 'md' && 'size-5', isSelected && 'bg-brand-solid ring-brand-solid', isDisabled && 'cursor-not-allowed opacity-50', isDisabled && !isSelected && 'bg-tertiary', isFocusVisible && 'outline-2 outline-offset-2 outline-focus-ring', className), children: jsxRuntime.jsx("div", { className: cx.cx('size-1.5 rounded-full bg-fg-white opacity-0 transition-inherit-all', size === 'md' && 'size-2', isSelected && 'opacity-100') }) }));
|
|
9
|
+
};
|
|
10
|
+
RadioButtonBase.displayName = 'RadioButtonBase';
|
|
11
|
+
|
|
12
|
+
exports.RadioButtonBase = RadioButtonBase;
|
|
13
|
+
//# sourceMappingURL=RadioButtonBase.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonBase.cjs","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButtonBase.tsx"],"sourcesContent":[null],"names":["_jsx","cx"],"mappings":";;;;;AAiBA;AACO,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,EAAwB,KAAI;IAC1H,QACEA,cAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEC,KAAE,CACX,wIAAwI,EACxI,IAAI,KAAK,IAAI,IAAI,QAAQ,EACzB,UAAU,IAAI,iCAAiC,EAC/C,UAAU,IAAI,+BAA+B,EAC7C,UAAU,IAAI,CAAC,UAAU,IAAI,aAAa,EAC1C,cAAc,IAAI,+CAA+C,EACjE,SAAS,CACV,EAAA,QAAA,EAEDD,cAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAEC,KAAE,CAAC,oEAAoE,EAAE,IAAI,KAAK,IAAI,IAAI,QAAQ,EAAE,UAAU,IAAI,aAAa,CAAC,EAAA,CAC3I,EAAA,CACE;AAEV;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export interface RadioButtonBaseProps {
|
|
2
|
+
/** Sets the circle size: 16px at `sm`, 20px at `md`. */
|
|
3
|
+
size?: 'sm' | 'md';
|
|
4
|
+
/** Extra classes merged onto the circle element. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Draws the keyboard focus ring around the circle. */
|
|
7
|
+
isFocusVisible?: boolean;
|
|
8
|
+
/** Fills the circle with the brand colour and shows the inner dot. */
|
|
9
|
+
isSelected?: boolean;
|
|
10
|
+
/** Dims the circle and shows a not-allowed cursor. */
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/** Visual-only radio circle with no input behaviour, for building custom selectable controls; `RadioButton` renders it inside a react-aria `Radio`. */
|
|
14
|
+
export declare const RadioButtonBase: {
|
|
15
|
+
({ className, isFocusVisible, isSelected, isDisabled, size }: RadioButtonBaseProps): import("react").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=RadioButtonBase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonBase.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButtonBase.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uDAAuD;IACvD,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,sEAAsE;IACtE,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,sDAAsD;IACtD,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,uJAAuJ;AACvJ,eAAO,MAAM,eAAe;kEAAwE,oBAAoB;;CAkBvH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
|
|
4
|
+
/** Visual-only radio circle with no input behaviour, for building custom selectable controls; `RadioButton` renders it inside a react-aria `Radio`. */
|
|
5
|
+
const RadioButtonBase = ({ className, isFocusVisible, isSelected, isDisabled, size = 'sm' }) => {
|
|
6
|
+
return (jsx("div", { className: cx('flex size-4 shrink-0 cursor-pointer appearance-none items-center justify-center rounded-full bg-primary ring-1 ring-primary ring-inset', size === 'md' && 'size-5', isSelected && 'bg-brand-solid ring-brand-solid', isDisabled && 'cursor-not-allowed opacity-50', isDisabled && !isSelected && 'bg-tertiary', isFocusVisible && 'outline-2 outline-offset-2 outline-focus-ring', className), children: jsx("div", { className: cx('size-1.5 rounded-full bg-fg-white opacity-0 transition-inherit-all', size === 'md' && 'size-2', isSelected && 'opacity-100') }) }));
|
|
7
|
+
};
|
|
8
|
+
RadioButtonBase.displayName = 'RadioButtonBase';
|
|
9
|
+
|
|
10
|
+
export { RadioButtonBase };
|
|
11
|
+
//# sourceMappingURL=RadioButtonBase.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioButtonBase.js","sources":["../../../../../src/components/atoms/Radios/RadioButton/RadioButtonBase.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;AAiBA;AACO,MAAM,eAAe,GAAG,CAAC,EAAE,SAAS,EAAE,cAAc,EAAE,UAAU,EAAE,UAAU,EAAE,IAAI,GAAG,IAAI,EAAwB,KAAI;IAC1H,QACEA,GAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CACX,wIAAwI,EACxI,IAAI,KAAK,IAAI,IAAI,QAAQ,EACzB,UAAU,IAAI,iCAAiC,EAC/C,UAAU,IAAI,+BAA+B,EAC7C,UAAU,IAAI,CAAC,UAAU,IAAI,aAAa,EAC1C,cAAc,IAAI,+CAA+C,EACjE,SAAS,CACV,EAAA,QAAA,EAEDA,GAAA,CAAA,KAAA,EAAA,EACE,SAAS,EAAE,EAAE,CAAC,oEAAoE,EAAE,IAAI,KAAK,IAAI,IAAI,QAAQ,EAAE,UAAU,IAAI,aAAa,CAAC,EAAA,CAC3I,EAAA,CACE;AAEV;AACA,eAAe,CAAC,WAAW,GAAG,iBAAiB;;"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
5
|
+
var testIdUtils = require('@flipdish/ui-library/utilities/testIdUtils');
|
|
6
|
+
var reactAriaComponents = require('react-aria-components');
|
|
7
|
+
var RadioGroup_context = require('../providers/RadioGroup.context.cjs');
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A set of mutually exclusive `RadioButton` options, built on react-aria-components' `RadioGroup`: it owns the selection
|
|
11
|
+
* and arrow-key navigation, and passes `size` and a derived `data-testid` to every option. Use it whenever the user
|
|
12
|
+
* picks exactly one of a few options.
|
|
13
|
+
*
|
|
14
|
+
* @summary group that makes its radio buttons mutually exclusive
|
|
15
|
+
*/
|
|
16
|
+
const RadioGroup = ({ children, className, size = 'sm', 'data-testid': dataTestId, ...props }) => {
|
|
17
|
+
const rootTestId = testIdUtils.useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
18
|
+
return (jsxRuntime.jsx(RadioGroup_context.RadioGroupContext.Provider, { value: { size, testIdPrefix: rootTestId }, children: jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: cx.cx('flex flex-col gap-4', className), children: children }) }));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.RadioGroup = RadioGroup;
|
|
22
|
+
//# sourceMappingURL=RadioGroup.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.cjs","sources":["../../../../../src/components/atoms/Radios/RadioGroup/RadioGroup.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","_jsx","RadioGroupContext","AriaRadioGroup","cx"],"mappings":";;;;;;;;AAiBA;;;;;;AAMG;MACU,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAmB,KAAI;AACvH,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEC,cAAA,CAACC,oCAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,YACnED,cAAA,CAACE,8BAAc,EAAA,EAAA,GAAK,KAAK,iBAAe,UAAU,EAAE,SAAS,EAAEC,KAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAA,QAAA,EAChG,QAAQ,EAAA,CACM,EAAA,CACU;AAEjC;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import { type RadioGroupProps as AriaRadioGroupProps } from 'react-aria-components';
|
|
3
|
+
import { type RadioGroupContextType } from '../providers/RadioGroup.context';
|
|
4
|
+
export interface RadioGroupProps extends Pick<RadioGroupContextType, 'size'>, AriaRadioGroupProps {
|
|
5
|
+
/** The `RadioButton` options. */
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
/** Extra classes merged onto the group element. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** Overrides the `data-testid` (defaults to `fd-radio-group`). */
|
|
10
|
+
'data-testid'?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A set of mutually exclusive `RadioButton` options, built on react-aria-components' `RadioGroup`: it owns the selection
|
|
14
|
+
* and arrow-key navigation, and passes `size` and a derived `data-testid` to every option. Use it whenever the user
|
|
15
|
+
* picks exactly one of a few options.
|
|
16
|
+
*
|
|
17
|
+
* @summary group that makes its radio buttons mutually exclusive
|
|
18
|
+
*/
|
|
19
|
+
export declare const RadioGroup: ({ children, className, size, "data-testid": dataTestId, ...props }: RadioGroupProps) => import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=RadioGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Radios/RadioGroup/RadioGroup.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAgC,KAAK,eAAe,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAClH,OAAO,EAAqB,KAAK,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAEhG,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,EAAE,mBAAmB;IAC/F,iCAAiC;IACjC,QAAQ,EAAE,SAAS,CAAC;IACpB,mDAAmD;IACnD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,GAAI,oEAA2E,eAAe,gCAUpH,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
3
|
+
import { useResolvedTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
4
|
+
import { RadioGroup as RadioGroup$1 } from 'react-aria-components';
|
|
5
|
+
import { RadioGroupContext } from '../providers/RadioGroup.context.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A set of mutually exclusive `RadioButton` options, built on react-aria-components' `RadioGroup`: it owns the selection
|
|
9
|
+
* and arrow-key navigation, and passes `size` and a derived `data-testid` to every option. Use it whenever the user
|
|
10
|
+
* picks exactly one of a few options.
|
|
11
|
+
*
|
|
12
|
+
* @summary group that makes its radio buttons mutually exclusive
|
|
13
|
+
*/
|
|
14
|
+
const RadioGroup = ({ children, className, size = 'sm', 'data-testid': dataTestId, ...props }) => {
|
|
15
|
+
const rootTestId = useResolvedTestId({ testId: dataTestId, segment: 'radio-group', rootName: 'radio-group' });
|
|
16
|
+
return (jsx(RadioGroupContext.Provider, { value: { size, testIdPrefix: rootTestId }, children: jsx(RadioGroup$1, { ...props, "data-testid": rootTestId, className: cx('flex flex-col gap-4', className), children: children }) }));
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export { RadioGroup };
|
|
20
|
+
//# sourceMappingURL=RadioGroup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.js","sources":["../../../../../src/components/atoms/Radios/RadioGroup/RadioGroup.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup"],"mappings":";;;;;;AAiBA;;;;;;AAMG;MACU,UAAU,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAmB,KAAI;AACvH,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,QACEA,GAAA,CAAC,iBAAiB,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,UAAU,EAAE,YACnEA,GAAA,CAACC,YAAc,EAAA,EAAA,GAAK,KAAK,iBAAe,UAAU,EAAE,SAAS,EAAE,EAAE,CAAC,qBAAqB,EAAE,SAAS,CAAC,EAAA,QAAA,EAChG,QAAQ,EAAA,CACM,EAAA,CACU;AAEjC;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var RadioButton = require('./RadioButton/RadioButton.cjs');
|
|
4
|
+
var RadioButtonBase = require('./RadioButton/RadioButtonBase.cjs');
|
|
5
|
+
var RadioGroup = require('./RadioGroup/RadioGroup.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.RadioButton = RadioButton.RadioButton;
|
|
10
|
+
exports.RadioButtonBase = RadioButtonBase.RadioButtonBase;
|
|
11
|
+
exports.RadioGroup = RadioGroup.RadioGroup;
|
|
12
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Radio buttons for picking one option from a few: `RadioGroup` for the set, `RadioButton` for one option in it, and
|
|
3
|
+
* `RadioButtonBase` for the bare circle when building a custom selectable control.
|
|
4
|
+
*
|
|
5
|
+
* Explicit named re-exports on purpose: `export *` would publish every symbol of every member and private file
|
|
6
|
+
* (import paths are the public API here), so this list is the single source of truth for what Radios exposes.
|
|
7
|
+
* Each member's implementation, stories and docs live in its own folder (`RadioButton/RadioButton.tsx`), never as
|
|
8
|
+
* `index.tsx`: the `exports` wildcard would make that folder a public path.
|
|
9
|
+
*/
|
|
10
|
+
export type { RadioButtonProps } from './RadioButton/RadioButton';
|
|
11
|
+
export { RadioButton } from './RadioButton/RadioButton';
|
|
12
|
+
export type { RadioButtonBaseProps } from './RadioButton/RadioButtonBase';
|
|
13
|
+
export { RadioButtonBase } from './RadioButton/RadioButtonBase';
|
|
14
|
+
export type { RadioGroupProps } from './RadioGroup/RadioGroup';
|
|
15
|
+
export { RadioGroup } from './RadioGroup/RadioGroup';
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/atoms/Radios/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,YAAY,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,YAAY,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
|
|
5
|
+
/** What a web `RadioGroup` shares with the `RadioButton`s beneath it. */
|
|
6
|
+
const RadioGroupContext = React.createContext(null);
|
|
7
|
+
|
|
8
|
+
exports.RadioGroupContext = RadioGroupContext;
|
|
9
|
+
//# sourceMappingURL=RadioGroup.context.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.context.cjs","sources":["../../../../../src/components/atoms/Radios/providers/RadioGroup.context.ts"],"sourcesContent":[null],"names":["createContext"],"mappings":";;;;AAQA;MACa,iBAAiB,GAAGA,mBAAa,CAA+B,IAAI;;"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface RadioGroupContextType {
|
|
2
|
+
/** Sets the size of every radio in the group, and of its label and hint text. */
|
|
3
|
+
size?: 'sm' | 'md';
|
|
4
|
+
testIdPrefix?: string;
|
|
5
|
+
}
|
|
6
|
+
/** What a web `RadioGroup` shares with the `RadioButton`s beneath it. */
|
|
7
|
+
export declare const RadioGroupContext: import("react").Context<RadioGroupContextType | null>;
|
|
8
|
+
//# sourceMappingURL=RadioGroup.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.context.d.ts","sourceRoot":"","sources":["../../../../../src/components/atoms/Radios/providers/RadioGroup.context.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,qBAAqB;IACpC,iFAAiF;IACjF,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,uDAAoD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RadioGroup.context.js","sources":["../../../../../src/components/atoms/Radios/providers/RadioGroup.context.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAQA;MACa,iBAAiB,GAAG,aAAa,CAA+B,IAAI;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var
|
|
4
|
+
var Dividers = require('@flipdish/ui-library/components/atoms/Dividers');
|
|
5
5
|
var Skeleton = require('@flipdish/ui-library/components/atoms/Skeleton');
|
|
6
6
|
var SectionHeader = require('@flipdish/ui-library/components/molecules/SectionHeader');
|
|
7
7
|
var cx = require('@flipdish/ui-library/utilities/cx');
|
|
@@ -23,7 +23,7 @@ const FormSectionSkeleton = ({ label, sectionCount = 2, fieldCount = 3, 'data-te
|
|
|
23
23
|
// reliably announced, and a screen reader may hold back what changes inside a busy one.
|
|
24
24
|
const [announcement, setAnnouncement] = React.useState('');
|
|
25
25
|
React.useEffect(() => setAnnouncement(label), [label]);
|
|
26
|
-
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("output", { className: "sr-only", children: announcement }), jsxRuntime.jsx("div", { "aria-busy": "true", "data-testid": rootTestId, className: FormSection_styles.styles.stack, children: sections.map((section) => (jsxRuntime.jsxs(React.Fragment, { children: [section > 0 && jsxRuntime.jsx(
|
|
26
|
+
return (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("output", { className: "sr-only", children: announcement }), jsxRuntime.jsx("div", { "aria-busy": "true", "data-testid": rootTestId, className: FormSection_styles.styles.stack, children: sections.map((section) => (jsxRuntime.jsxs(React.Fragment, { children: [section > 0 && jsxRuntime.jsx(Dividers.Divider, {}), jsxRuntime.jsxs("div", { className: FormSection_styles.styles.root, children: [jsxRuntime.jsxs("div", { className: cx.cx(FormSection_styles.styles.labelColumn, 'gap-2'), children: [jsxRuntime.jsx(Skeleton.Skeleton, { width: "40%", height: 20 }), jsxRuntime.jsx(Skeleton.SkeletonText, { lines: 2 })] }), jsxRuntime.jsx("div", { className: FormSection_styles.styles.fieldColumn, children: fields.map((field) => (jsxRuntime.jsx(Skeleton.Skeleton, { height: 44 }, field))) })] })] }, section))) })] }));
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
29
|
* One titled section of a form: its name and description in a column on the left, its fields on the right, stacked
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../../src/components/forms/FormSection/index.tsx"],"sourcesContent":[null],"names":["_jsx","cx","styles","useResolvedTestId","useState","useEffect","_jsxs","_Fragment","Fragment","Divider","Skeleton","SkeletonText","useId","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AAC,CAAC;IAEhD,QACEC,eAAA,CAAAC,mBAAA,EAAA,EAAA,QAAA,EAAA,CACEP,cAAA,CAAA,QAAA,EAAA,EAAQ,SAAS,EAAC,SAAS,EAAA,QAAA,EAAE,YAAY,EAAA,CAAU,EACnDA,cAAA,CAAA,KAAA,EAAA,EAAA,WAAA,EAAe,MAAM,EAAA,aAAA,EAAc,UAAU,EAAE,SAAS,EAAEE,yBAAM,CAAC,KAAK,EAAA,QAAA,EACnE,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,MACpBI,eAAA,CAACE,cAAQ,EAAA,EAAA,QAAA,EAAA,CACN,OAAO,GAAG,CAAC,IAAIR,cAAA,CAACS,
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../../src/components/forms/FormSection/index.tsx"],"sourcesContent":[null],"names":["_jsx","cx","styles","useResolvedTestId","useState","useEffect","_jsxs","_Fragment","Fragment","Divider","Skeleton","SkeletonText","useId","TestIdProvider","SectionHeader","joinTestId"],"mappings":";;;;;;;;;;;AAUA;AACA,MAAM,kBAAkB,GAAG,EAAE;AAE7B,MAAM,OAAO,GAAG,CAAC,KAAa,MAAM,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,EAAE,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAsB9H;AACA,MAAM,cAAc,GAAG,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAuB,KAAKA,cAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAEC,KAAE,CAACC,yBAAM,CAAC,GAAG,EAAE,SAAS,CAAC,EAAA,QAAA,EAAG,QAAQ,EAAA,CAAO;AAapI;AACA,MAAM,mBAAmB,GAAG,CAAC,EAAE,KAAK,EAAE,YAAY,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,aAAa,EAAE,UAAU,EAA4B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AE,EAAE,SAAS,EAAA,QAAA,EAAG,KAAK,GAAyB,EACpE,WAAW,IAAId,cAAA,CAACc,2BAAa,CAAC,UAAU,EAAA,EAAA,QAAA,EAAE,WAAW,GAA4B,CAAA,EAAA,CAC9E,EAAA,CACS,EACjBd,cAAA,CAAA,KAAA,EAAA,EAAA,aAAA,EAAkBe,sBAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,EAAE,SAAS,EAAEb,yBAAM,CAAC,WAAW,EAAA,QAAA,EAC9E,QAAQ,EAAA,CACL,CAAA,EAAA,CACE;AAEd;AAEA,WAAW,CAAC,GAAG,GAAG,cAAc;AAChC,WAAW,CAAC,QAAQ,GAAG,mBAAmB;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { Divider } from '@flipdish/ui-library/components/atoms/
|
|
2
|
+
import { Divider } from '@flipdish/ui-library/components/atoms/Dividers';
|
|
3
3
|
import { Skeleton, SkeletonText } from '@flipdish/ui-library/components/atoms/Skeleton';
|
|
4
4
|
import { SectionHeader } from '@flipdish/ui-library/components/molecules/SectionHeader';
|
|
5
5
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var
|
|
4
|
+
var Checkboxes = require('@flipdish/ui-library/components/atoms/Checkboxes');
|
|
5
5
|
var useFocusTarget = require('../../__internal__/formField/hooks/useFocusTarget.cjs');
|
|
6
6
|
var useFormField = require('../../__internal__/formField/hooks/useFormField.cjs');
|
|
7
7
|
|
|
@@ -15,7 +15,7 @@ const FormCheckbox = ({ name, revalidates, hint, ...checkboxProps }) => {
|
|
|
15
15
|
const { value, ref, onCommit, onBlur, isInvalid, errorMessage, isDisabled, isLocked } = useFormField.useFormField(name, revalidates);
|
|
16
16
|
// `Checkbox`'s ref is its `<label>`, which cannot take focus, so the form is handed the input inside it.
|
|
17
17
|
const focusRef = useFocusTarget.useFocusTarget(ref, 'input');
|
|
18
|
-
return (jsxRuntime.jsx(
|
|
18
|
+
return (jsxRuntime.jsx(Checkboxes.Checkbox
|
|
19
19
|
// The form's schema validates; the browser's own `required` check would block the submit before it runs.
|
|
20
20
|
, {
|
|
21
21
|
// The form's schema validates; the browser's own `required` check would block the submit before it runs.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CheckboxProps } from '@flipdish/ui-library/components/atoms/
|
|
1
|
+
import { type CheckboxProps } from '@flipdish/ui-library/components/atoms/Checkboxes';
|
|
2
2
|
import type { FieldPath, FieldValues } from 'react-hook-form';
|
|
3
3
|
export interface FormCheckboxProps<TValues extends FieldValues = FieldValues> extends Omit<CheckboxProps, 'name' | 'isSelected' | 'defaultSelected' | 'onChange' | 'onBlur' | 'isInvalid' | 'ref'> {
|
|
4
4
|
/** The field's path in the form values, such as `acceptTerms` or `marketing.email`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormCheckbox/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/forms/fields/FormCheckbox/index.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,aAAa,EAAE,MAAM,kDAAkD,CAAC;AAChG,OAAO,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9D,MAAM,WAAW,iBAAiB,CAAC,OAAO,SAAS,WAAW,GAAG,WAAW,CAC1E,SAAQ,IAAI,CAAC,aAAa,EAAE,MAAM,GAAG,YAAY,GAAG,iBAAiB,GAAG,UAAU,GAAG,QAAQ,GAAG,WAAW,GAAG,KAAK,CAAC;IACpH,uFAAuF;IACvF,IAAI,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC;IACzB;;;OAGG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;CACzD;AAED;;;;;GAKG;AACH,eAAO,MAAM,YAAY,GAAI,OAAO,SAAS,WAAW,GAAG,WAAW,EAAE,+CAKrE,iBAAiB,CAAC,OAAO,CAAC,gCAiC5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Checkbox } from '@flipdish/ui-library/components/atoms/
|
|
2
|
+
import { Checkbox } from '@flipdish/ui-library/components/atoms/Checkboxes';
|
|
3
3
|
import { useFocusTarget } from '../../__internal__/formField/hooks/useFocusTarget.js';
|
|
4
4
|
import { useFormField } from '../../__internal__/formField/hooks/useFormField.js';
|
|
5
5
|
|