@flipdish/ui-library 0.66.0 → 0.66.2
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/__internal__/selectionControl/utilities/fieldProps.utils.cjs +30 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.cjs.map +1 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.d.ts +16 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.d.ts.map +1 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.js +28 -0
- package/dist/components/__internal__/selectionControl/utilities/fieldProps.utils.js.map +1 -0
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs +23 -16
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js +24 -17
- package/dist/components/atoms/Checkboxes/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.cjs +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.d.ts +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.d.ts.map +1 -1
- package/dist/components/atoms/Checkboxes/Checkbox/components/CheckboxBase.js +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs +11 -4
- package/dist/components/atoms/Radios/RadioButton/RadioButton.cjs.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.d.ts.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/RadioButton.js +12 -5
- package/dist/components/atoms/Radios/RadioButton/RadioButton.js.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.cjs +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.d.ts +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.d.ts.map +1 -1
- package/dist/components/atoms/Radios/RadioButton/components/RadioButtonBase.js +1 -1
- package/dist/components/atoms/Toggle/index.cjs +17 -7
- package/dist/components/atoms/Toggle/index.cjs.map +1 -1
- package/dist/components/atoms/Toggle/index.d.ts +2 -2
- package/dist/components/atoms/Toggle/index.d.ts.map +1 -1
- package/dist/components/atoms/Toggle/index.js +18 -8
- package/dist/components/atoms/Toggle/index.js.map +1 -1
- package/dist/components/forms/FormFooter/index.cjs +3 -3
- package/dist/components/forms/FormFooter/index.cjs.map +1 -1
- package/dist/components/forms/FormFooter/index.js +3 -3
- package/dist/components/forms/FormFooter/index.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardAvatar/RadioCardAvatar.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.cjs +9 -3
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.js +9 -3
- package/dist/components/molecules/RadioCards/RadioCardAvatar/hooks/useCommitOnPress.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardBullet/RadioCardBullet.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.js.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.cjs +3 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.cjs.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.d.ts.map +1 -1
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.js +4 -2
- package/dist/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.js.map +1 -1
- package/dist/components/molecules/RadioCards/hooks/useOptionIds.cjs +2 -2
- package/dist/components/molecules/RadioCards/hooks/useOptionIds.d.ts +2 -2
- package/dist/components/molecules/RadioCards/hooks/useOptionIds.js +2 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs +3 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.cjs.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.d.ts.map +1 -1
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js +4 -2
- package/dist/components/molecules/RadioGroup/components/RadioGroupAvatar.js.map +1 -1
- package/dist/components/organisms/SidePanel/components/SidePanelFooter.cjs +3 -1
- package/dist/components/organisms/SidePanel/components/SidePanelFooter.cjs.map +1 -1
- package/dist/components/organisms/SidePanel/components/SidePanelFooter.d.ts +2 -2
- package/dist/components/organisms/SidePanel/components/SidePanelFooter.d.ts.map +1 -1
- package/dist/components/organisms/SidePanel/components/SidePanelFooter.js +3 -1
- package/dist/components/organisms/SidePanel/components/SidePanelFooter.js.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs +6 -4
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.cjs.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.d.ts.map +1 -1
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.js +7 -5
- package/dist/components/organisms/TextEditor/components/TextEditorExtensions.js.map +1 -1
- package/dist/components/organisms/TreeView/index.cjs +3 -1
- package/dist/components/organisms/TreeView/index.cjs.map +1 -1
- package/dist/components/organisms/TreeView/index.d.ts.map +1 -1
- package/dist/components/organisms/TreeView/index.js +4 -2
- package/dist/components/organisms/TreeView/index.js.map +1 -1
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.d.ts +1 -1
- package/dist/native/components/atoms/Checkboxes/Checkbox/Checkbox.js +1 -1
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.d.ts +1 -1
- package/dist/native/components/atoms/Radios/RadioButton/RadioButton.js +1 -1
- package/dist/native/components/atoms/Toggle/index.d.ts +1 -1
- package/dist/native/components/atoms/Toggle/index.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardCheck.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","
|
|
1
|
+
{"version":3,"file":"RadioCardCheck.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardCheck/RadioCardCheck.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadioField","AriaRadioButton","_jsxs"],"mappings":";;;;;;;;AAwBA;;;;;AAKG;MACU,cAAc,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAuB,KAAI;AAC5H,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAG,YAAY,EAAE;IAEhC,QACEA,IAACC,UAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;YACzB,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;YAEvH;;AAEE,YAAAD,GAAA,CAACE,UAAc,EAAA,EACb,UAAU,EAAE,IAAI,CAAC,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CAAC,EAAA,QAAA,EAChH,IAAI,CAAC,KAAK,EAAA,CACN,EACN,IAAI,CAAC,cAAc,KAClBA,GAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAChG,IAAI,CAAC,cAAc,EAAA,CACf,CACR,CAAA,EAAA,CACI,EACN,IAAI,CAAC,WAAW,KACfA,GAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAC7F,IAAI,CAAC,WAAW,EAAA,CACZ,CACR,CAAA,EAAA,CACG,CAAA,EAAA,CACL,CACJ,EAAA,CACe,IAhDb,IAAI,CAAC,KAAK,CAiDA;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
|
@@ -20,7 +20,9 @@ const RadioCardIcon = ({ items, size = 'sm', className, 'data-testid': dataTestI
|
|
|
20
20
|
const optionIds = useOptionIds.useOptionIds();
|
|
21
21
|
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan, index) => {
|
|
22
22
|
const ids = optionIds(index, { title: plan.title, secondaryTitle: plan.secondaryTitle, description: plan.description });
|
|
23
|
-
return (
|
|
23
|
+
return (
|
|
24
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
25
|
+
jsxRuntime.jsx(reactAriaComponents.RadioField, { isDisabled: plan.disabled, value: plan.value, "aria-labelledby": ariaIds_utils.joinIds(ids.title, ids.secondaryTitle), "aria-describedby": ids.description, className: "contents", children: jsxRuntime.jsx(reactAriaComponents.RadioButton, { "data-testid": testIdUtils.joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "flex flex-1 gap-3", children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { icon: plan.icon, size: size === 'md' ? 'md' : 'sm', color: "gray", theme: "modern", className: cx.cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxRuntime.jsxs("span", { className: cx.cx('flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsxRuntime.jsx("span", { id: ids.title, className: cx.cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), plan.secondaryTitle && (jsxRuntime.jsx("span", { id: ids.secondaryTitle, className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle }))] }), plan.description && (jsxRuntime.jsx("span", { id: ids.description, className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description }))] })] }), jsxRuntime.jsx(Checkboxes.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }) }, plan.value));
|
|
24
26
|
}) }));
|
|
25
27
|
};
|
|
26
28
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardIcon.cjs","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","
|
|
1
|
+
{"version":3,"file":"RadioCardIcon.cjs","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","AriaRadioField","joinIds","AriaRadioButton","joinTestId","_jsxs","_Fragment","FeaturedIcon","CheckboxBase"],"mappings":";;;;;;;;;;;AAqBA;;;;;AAKG;MACU,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAsB,KAAI;AAC1H,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAGC,yBAAY,EAAE;IAEhC,QACEC,eAACC,8BAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAKC,KAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;YACzB,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;YAEvH;;AAEE,YAAAF,cAAA,CAACG,8BAAc,EAAA,EACb,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,iBAAA,EACAC,qBAAO,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,CAAC,cAAc,CAAC,EA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C,YAChH,IAAI,CAAC,KAAK,EAAA,CACN,EACN,IAAI,CAAC,cAAc,KAClBF,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,cAAc,EAAE,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAChG,IAAI,CAAC,cAAc,EAAA,CACf,CACR,IACI,EACN,IAAI,CAAC,WAAW,KACfF,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAC7F,IAAI,CAAC,WAAW,GACZ,CACR,CAAA,EAAA,CACG,CAAA,EAAA,CACF,EAENF,eAACU,uBAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAAA,EAAA,CAClI,CACJ,GACe,EAAA,EAnDb,IAAI,CAAC,KAAK,CAoDA;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,yEAAyE;IACzE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,iEAAwE,kBAAkB,
|
|
1
|
+
{"version":3,"file":"RadioCardIcon.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,MAAM,WAAW,kBAAmB,SAAQ,eAAe;IACzD,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,yEAAyE;IACzE,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,GAAI,iEAAwE,kBAAkB,gCA2EvH,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkboxes';
|
|
|
3
3
|
import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
5
|
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
|
-
import { RadioGroup,
|
|
6
|
+
import { RadioGroup, RadioField, RadioButton } from 'react-aria-components';
|
|
7
7
|
import { joinIds } from '../../../../utilities/__internal__/ariaIdsUtils/ariaIds.utils.js';
|
|
8
8
|
import { useOptionIds } from '../hooks/useOptionIds.js';
|
|
9
9
|
|
|
@@ -18,7 +18,9 @@ const RadioCardIcon = ({ items, size = 'sm', className, 'data-testid': dataTestI
|
|
|
18
18
|
const optionIds = useOptionIds();
|
|
19
19
|
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((plan, index) => {
|
|
20
20
|
const ids = optionIds(index, { title: plan.title, secondaryTitle: plan.secondaryTitle, description: plan.description });
|
|
21
|
-
return (
|
|
21
|
+
return (
|
|
22
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
23
|
+
jsx(RadioField, { isDisabled: plan.disabled, value: plan.value, "aria-labelledby": joinIds(ids.title, ids.secondaryTitle), "aria-describedby": ids.description, className: "contents", children: jsx(RadioButton, { "data-testid": joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: "flex flex-1 gap-3", children: [jsx(FeaturedIcon, { icon: plan.icon, size: size === 'md' ? 'md' : 'sm', color: "gray", theme: "modern", className: cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxs("span", { className: cx('flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsx("span", { id: ids.title, className: cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: plan.title }), plan.secondaryTitle && (jsx("span", { id: ids.secondaryTitle, className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle }))] }), plan.description && (jsx("span", { id: ids.description, className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description }))] })] }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }) }, plan.value));
|
|
22
24
|
}) }));
|
|
23
25
|
};
|
|
24
26
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardIcon.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","
|
|
1
|
+
{"version":3,"file":"RadioCardIcon.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIcon/RadioCardIcon.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadioField","AriaRadioButton","_jsxs","_Fragment"],"mappings":";;;;;;;;;AAqBA;;;;;AAKG;MACU,aAAa,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAsB,KAAI;AAC1H,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAG,YAAY,EAAE;IAEhC,QACEA,IAACC,UAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;YACzB,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;YAEvH;;AAEE,YAAAD,GAAA,CAACE,UAAc,EAAA,EACb,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI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AAE,EAAE,CAAC,gBAAgB,EAAE,IAAI,KAAK,IAAI,GAAG,qBAAqB,GAAG,qBAAqB,CAAC,YAChH,IAAI,CAAC,KAAK,EAAA,CACN,EACN,IAAI,CAAC,cAAc,KAClBA,GAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,cAAc,EAAE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAChG,IAAI,CAAC,cAAc,EAAA,CACf,CACR,IACI,EACN,IAAI,CAAC,WAAW,KACfA,GAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAC7F,IAAI,CAAC,WAAW,GACZ,CACR,CAAA,EAAA,CACG,CAAA,EAAA,CACF,EAENA,IAAC,YAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAAA,EAAA,CAClI,CACJ,GACe,EAAA,EAnDb,IAAI,CAAC,KAAK,CAoDA;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs
CHANGED
|
@@ -27,7 +27,9 @@ const RadioCardIconFeatured = ({ items, size = 'sm', className, 'data-testid': d
|
|
|
27
27
|
description: plan.description,
|
|
28
28
|
badge: plan.badge,
|
|
29
29
|
});
|
|
30
|
-
return (
|
|
30
|
+
return (
|
|
31
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
32
|
+
jsxRuntime.jsx(reactAriaComponents.RadioField, { isDisabled: plan.disabled, value: plan.value, "aria-labelledby": ids.title, "aria-describedby": ariaIds_utils.joinIds(ids.price, ids.secondaryTitle, ids.description, ids.badge), className: "contents", children: jsxRuntime.jsx(reactAriaComponents.RadioButton, { "data-testid": testIdUtils.joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative block cursor-pointer rounded-xl bg-primary outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex items-center gap-3 rounded-t-xl p-3 pr-5 ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-hidden'), children: [jsxRuntime.jsx(FeaturedIcon.FeaturedIcon, { size: size === 'md' ? 'md' : 'sm', icon: plan.icon, color: "gray", theme: "modern", className: cx.cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsxRuntime.jsx("span", { id: ids.title, className: cx.cx('mr-1 text-secondary', size === 'md' ? 'text-lg font-semibold' : 'text-md font-semibold'), children: plan.title }), jsxRuntime.jsx(Checkboxes.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', className: "ml-auto", isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] }), jsxRuntime.jsxs("div", { className: "flex flex-col-reverse items-start justify-between gap-4 rounded-b-lg p-4 sm:flex-row sm:gap-1", children: [jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-2' : 'gap-1'), children: [jsxRuntime.jsxs("p", { className: "flex items-baseline gap-1", children: [jsxRuntime.jsx("span", { id: ids.price, className: cx.cx('text-secondary', size === 'md' ? 'text-display-md font-semibold' : 'text-display-sm font-semibold'), children: plan.price }), jsxRuntime.jsx("span", { id: ids.secondaryTitle, className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsxRuntime.jsx("p", { id: ids.description, className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] }), plan.badge && (jsxRuntime.jsx(Badges.BadgeWithDot, { size: "sm", type: "modern", color: "success", children: jsxRuntime.jsx("span", { id: ids.badge, children: plan.badge }) }))] })] })) }) }, plan.value));
|
|
31
33
|
}) }));
|
|
32
34
|
};
|
|
33
35
|
|
package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardIconFeatured.cjs","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","
|
|
1
|
+
{"version":3,"file":"RadioCardIconFeatured.cjs","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","AriaRadioField","joinIds","AriaRadioButton","joinTestId","_jsxs","FeaturedIcon","CheckboxBase","BadgeWithDot"],"mappings":";;;;;;;;;;;;AAiCA;;;;;AAKG;MACU,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA8B,KAAI;AAC1I,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAGC,yBAAY,EAAE;IAEhC,QACEC,eA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GAAG,+BAA+B,CAAC,EAAA,QAAA,EAEjH,IAAI,CAAC,KAAK,EAAA,CACN,EACPF,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,cAAc,EAAE,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAChG,IAAI,CAAC,cAAc,GACf,CAAA,EAAA,CACL,EACJF,sBAAG,EAAE,EAAE,GAAG,CAAC,WAAW,EAAE,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EAC1F,IAAI,CAAC,WAAW,EAAA,CACf,IACA,EACL,IAAI,CAAC,KAAK,KACTF,eAACU,mBAAY,EAAA,EAAC,IAAI,EAAC,IAAI,EAAC,IAAI,EAAC,QAAQ,EAAC,KAAK,EAAC,SAAS,EAAA,QAAA,EACnDV,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,KAAK,EAAA,QAAA,EAAG,IAAI,CAAC,KAAK,EAAA,CAAQ,GAC3B,CAChB,CAAA,EAAA,CACG,CAAA,EAAA,CACL,CACJ,EAAA,CACe,EAAA,EA5Eb,IAAI,CAAC,KAAK,CA6EA;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardIconFeatured.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK7D,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,mEAAmE;IACnE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,iEAAwE,0BAA0B,
|
|
1
|
+
{"version":3,"file":"RadioCardIconFeatured.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK7D,KAAK,gBAAgB,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,IAAI,EAAE,EAAE,CAAC;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,WAAW,0BAA2B,SAAQ,eAAe;IACjE,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,mEAAmE;IACnE,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,iEAAwE,0BAA0B,gCA0GvI,CAAC"}
|
|
@@ -4,7 +4,7 @@ import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkboxes';
|
|
|
4
4
|
import { FeaturedIcon } from '@flipdish/ui-library/components/atoms/FeaturedIcon';
|
|
5
5
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
6
6
|
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
7
|
-
import { RadioGroup,
|
|
7
|
+
import { RadioGroup, RadioField, RadioButton } from 'react-aria-components';
|
|
8
8
|
import { joinIds } from '../../../../utilities/__internal__/ariaIdsUtils/ariaIds.utils.js';
|
|
9
9
|
import { useOptionIds } from '../hooks/useOptionIds.js';
|
|
10
10
|
|
|
@@ -25,7 +25,9 @@ const RadioCardIconFeatured = ({ items, size = 'sm', className, 'data-testid': d
|
|
|
25
25
|
description: plan.description,
|
|
26
26
|
badge: plan.badge,
|
|
27
27
|
});
|
|
28
|
-
return (
|
|
28
|
+
return (
|
|
29
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
30
|
+
jsx(RadioField, { isDisabled: plan.disabled, value: plan.value, "aria-labelledby": ids.title, "aria-describedby": joinIds(ids.price, ids.secondaryTitle, ids.description, ids.badge), className: "contents", children: jsx(RadioButton, { "data-testid": joinTestId(rootTestId, `option-${plan.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative block cursor-pointer rounded-xl bg-primary outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: cx('flex items-center gap-3 rounded-t-xl p-3 pr-5 ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'ring-disabled', isSelected && isDisabled && 'ring-disabled_subtle', isFocusVisible && 'outline-hidden'), children: [jsx(FeaturedIcon, { size: size === 'md' ? 'md' : 'sm', icon: plan.icon, color: "gray", theme: "modern", className: cx(isDisabled && 'bg-disabled text-fg-disabled') }), jsx("span", { id: ids.title, className: cx('mr-1 text-secondary', size === 'md' ? 'text-lg font-semibold' : 'text-md font-semibold'), children: plan.title }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', className: "ml-auto", isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] }), jsxs("div", { className: "flex flex-col-reverse items-start justify-between gap-4 rounded-b-lg p-4 sm:flex-row sm:gap-1", children: [jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-2' : 'gap-1'), children: [jsxs("p", { className: "flex items-baseline gap-1", children: [jsx("span", { id: ids.price, className: cx('text-secondary', size === 'md' ? 'text-display-md font-semibold' : 'text-display-sm font-semibold'), children: plan.price }), jsx("span", { id: ids.secondaryTitle, className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.secondaryTitle })] }), jsx("p", { id: ids.description, className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: plan.description })] }), plan.badge && (jsx(BadgeWithDot, { size: "sm", type: "modern", color: "success", children: jsx("span", { id: ids.badge, children: plan.badge }) }))] })] })) }) }, plan.value));
|
|
29
31
|
}) }));
|
|
30
32
|
};
|
|
31
33
|
|
package/dist/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardIconFeatured.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","
|
|
1
|
+
{"version":3,"file":"RadioCardIconFeatured.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardIconFeatured/RadioCardIconFeatured.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadioField","AriaRadioButton","_jsxs"],"mappings":";;;;;;;;;;AAiCA;;;;;AAKG;MACU,qBAAqB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAA8B,KAAI;AAC1I,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAG,YAAY,EAAE;IAEhC,QACEA,IAACC,UAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;AACzB,YAAA,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE;gBAC3B,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,KAAK,EAAE,IAAI,CAAC,KAAK;gBACjB,cAAc,EAAE,IAAI,CAAC,cAAc;gBACnC,WAAW,EAAE,IAAI,CAAC,WAAW;gBAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;AAClB,aAAA,CAAC;YAEF;;YAEED,GAAA,CAACE,UAAc,IACb,UAAU,EAAE,IAAI,CAAC,QAAQ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,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,KAAK,EAAA,QAAA,EAAG,IAAI,CAAC,KAAK,EAAA,CAAQ,GAC3B,CAChB,CAAA,EAAA,CACG,CAAA,EAAA,CACL,CACJ,EAAA,CACe,EAAA,EA5Eb,IAAI,CAAC,KAAK,CA6EA;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
|
@@ -19,7 +19,9 @@ const RadioCardPayment = ({ items, size = 'sm', className, 'data-testid': dataTe
|
|
|
19
19
|
const optionIds = useOptionIds.useOptionIds();
|
|
20
20
|
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((card, index) => {
|
|
21
21
|
const ids = optionIds(index, { title: card.title, description: card.description });
|
|
22
|
-
return (
|
|
22
|
+
return (
|
|
23
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
24
|
+
jsxRuntime.jsx(reactAriaComponents.RadioField, { isDisabled: card.disabled, value: card.value, "aria-labelledby": ids.title, "aria-describedby": ids.description, className: "contents", children: jsxRuntime.jsx(reactAriaComponents.RadioButton, { "data-testid": testIdUtils.joinTestId(rootTestId, `option-${card.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'bg-disabled_subtle ring-disabled_subtle cursor-not-allowed', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex flex-1', size === 'md' ? 'gap-3 md:gap-4' : 'gap-3'), children: [jsxRuntime.jsx("span", { className: "shrink-0", children: card.logo }), jsxRuntime.jsxs("div", { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxRuntime.jsx("span", { id: ids.title, className: cx.cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: card.title }), card.description && (jsxRuntime.jsx("span", { id: ids.description, className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: card.description }))] }), jsxRuntime.jsxs("div", { className: cx.cx('flex gap-3', size === 'md' ? 'mt-3' : 'mt-2'), children: [jsxRuntime.jsx(Buttons.Button, { color: "link-gray", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Set as default" }), jsxRuntime.jsx(Buttons.Button, { color: "link-color", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Edit" })] })] })] }), jsxRuntime.jsx(Checkboxes.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }) }, card.value));
|
|
23
25
|
}) }));
|
|
24
26
|
};
|
|
25
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardPayment.cjs","sources":["../../../../../src/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","
|
|
1
|
+
{"version":3,"file":"RadioCardPayment.cjs","sources":["../../../../../src/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","AriaRadioField","AriaRadioButton","joinTestId","_jsxs","_Fragment","Button","CheckboxBase"],"mappings":";;;;;;;;;;AA4BA;;;;;AAKG;MACU,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB,KAAI;AAChI,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE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C,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAA,QAAA,EAAA,MAAA,EAAA,CAE3E,IACL,CAAA,EAAA,CACF,CAAA,EAAA,CACF,EAENR,cAAA,CAACS,uBAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAAA,EAAA,CAClI,CACJ,GACe,EAAA,EA/Cb,IAAI,CAAC,KAAK,CAgDA;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardPayment.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,8EAA8E;IAC9E,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,iEAAwE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"RadioCardPayment.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAI7D,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,8EAA8E;IAC9E,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,gGAAgG;IAChG,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,iEAAwE,qBAAqB,gCAuE7H,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { Button } from '@flipdish/ui-library/components/atoms/Buttons';
|
|
|
3
3
|
import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkboxes';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
5
|
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
|
-
import { RadioGroup,
|
|
6
|
+
import { RadioGroup, RadioField, RadioButton } from 'react-aria-components';
|
|
7
7
|
import { useOptionIds } from '../hooks/useOptionIds.js';
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -17,7 +17,9 @@ const RadioCardPayment = ({ items, size = 'sm', className, 'data-testid': dataTe
|
|
|
17
17
|
const optionIds = useOptionIds();
|
|
18
18
|
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((card, index) => {
|
|
19
19
|
const ids = optionIds(index, { title: card.title, description: card.description });
|
|
20
|
-
return (
|
|
20
|
+
return (
|
|
21
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
22
|
+
jsx(RadioField, { isDisabled: card.disabled, value: card.value, "aria-labelledby": ids.title, "aria-describedby": ids.description, className: "contents", children: jsx(RadioButton, { "data-testid": joinTestId(rootTestId, `option-${card.value}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'bg-disabled_subtle ring-disabled_subtle cursor-not-allowed', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: cx('flex flex-1', size === 'md' ? 'gap-3 md:gap-4' : 'gap-3'), children: [jsx("span", { className: "shrink-0", children: card.logo }), jsxs("div", { children: [jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsx("span", { id: ids.title, className: cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: card.title }), card.description && (jsx("span", { id: ids.description, className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: card.description }))] }), jsxs("div", { className: cx('flex gap-3', size === 'md' ? 'mt-3' : 'mt-2'), children: [jsx(Button, { color: "link-gray", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Set as default" }), jsx(Button, { color: "link-color", size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, children: "Edit" })] })] })] }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }) }, card.value));
|
|
21
23
|
}) }));
|
|
22
24
|
};
|
|
23
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioCardPayment.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","
|
|
1
|
+
{"version":3,"file":"RadioCardPayment.js","sources":["../../../../../src/components/molecules/RadioCards/RadioCardPayment/RadioCardPayment.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadioField","AriaRadioButton","_jsxs","_Fragment"],"mappings":";;;;;;;;AA4BA;;;;;AAKG;MACU,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB,KAAI;AAChI,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAG,YAAY,EAAE;IAEhC,QACEA,IAACC,UAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,KAAI;YACzB,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,CAAC;YAElF;;AAEE,YAAAD,GAAA,CAACE,UAAc,EAAA,EACb,UAAU,EAAE,IAAI,CAAC,QAAQ,EAEzB,KAAK,EAAE,IAAI,CAAC,KAAK,EAAA,iBAAA,EACA,GAAG,CAAC,KAAK,EAAA,kBAAA,EACR,GAAG,CAAC,WAAW,EACjC,SAAS,EAAC,UAAU,YAEpBF,GAAA,CAACG,WAAe,EAAA,EAAA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,QAAA,EAC7F,IAAI,CAAC,WAAW,EAAA,CACZ,CACR,CAAA,EAAA,CACG,EACNI,IAAA,CAAA,KAAA,EAAA,EAAK,SAAS,EAAE,EAAE,CAAC,YAAY,EAAE,IAAI,KAAK,IAAI,GAAG,MAAM,GAAG,MAAM,CAAC,aAC/DJ,GAAA,CAAC,MAAM,EAAA,EAAC,KAAK,EAAC,WAAW,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAA,QAAA,EAAA,gBAAA,EAAA,CAE1E,EACTA,GAAA,CAAC,MAAM,EAAA,EAAC,KAAK,EAAC,YAAY,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAA,QAAA,EAAA,MAAA,EAAA,CAE3E,IACL,CAAA,EAAA,CACF,CAAA,EAAA,CACF,EAENA,GAAA,CAAC,YAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAAA,EAAA,CAClI,CACJ,GACe,EAAA,EA/Cb,IAAI,CAAC,KAAK,CAgDA;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
|
@@ -4,8 +4,8 @@ var React = require('react');
|
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Gives every text part of every option in a radio group an id of its own, so each radio is named and described by
|
|
7
|
-
* its own card. react-aria's `Label`
|
|
8
|
-
*
|
|
7
|
+
* its own card. react-aria's `Label` cannot do this inside a `RadioField`: it takes the group's id, which every card
|
|
8
|
+
* then shares.
|
|
9
9
|
*
|
|
10
10
|
* @returns A function taking an option's position in the group and its text parts by name. It returns an id for each
|
|
11
11
|
* part that has content and `undefined` for the rest, unique across the options and across groups on the page.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Gives every text part of every option in a radio group an id of its own, so each radio is named and described by
|
|
3
|
-
* its own card. react-aria's `Label`
|
|
4
|
-
*
|
|
3
|
+
* its own card. react-aria's `Label` cannot do this inside a `RadioField`: it takes the group's id, which every card
|
|
4
|
+
* then shares.
|
|
5
5
|
*
|
|
6
6
|
* @returns A function taking an option's position in the group and its text parts by name. It returns an id for each
|
|
7
7
|
* part that has content and `undefined` for the rest, unique across the options and across groups on the page.
|
|
@@ -2,8 +2,8 @@ import { useId } from 'react';
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Gives every text part of every option in a radio group an id of its own, so each radio is named and described by
|
|
5
|
-
* its own card. react-aria's `Label`
|
|
6
|
-
*
|
|
5
|
+
* its own card. react-aria's `Label` cannot do this inside a `RadioField`: it takes the group's id, which every card
|
|
6
|
+
* then shares.
|
|
7
7
|
*
|
|
8
8
|
* @returns A function taking an option's position in the group and its text parts by name. It returns an id for each
|
|
9
9
|
* part that has content and `undefined` for the rest, unique across the options and across groups on the page.
|
|
@@ -15,7 +15,9 @@ const RadioGroupAvatar = ({ items, size = 'sm', className, 'data-testid': dataTe
|
|
|
15
15
|
const optionIds = useOptionIds.useOptionIds();
|
|
16
16
|
return (jsxRuntime.jsx(reactAriaComponents.RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx.cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((person, index) => {
|
|
17
17
|
const ids = optionIds(index, { name: person.name, username: person.username, title: person.title });
|
|
18
|
-
return (
|
|
18
|
+
return (
|
|
19
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
20
|
+
jsxRuntime.jsx(reactAriaComponents.RadioField, { isDisabled: person.disabled, value: person.id, "aria-labelledby": ariaIds_utils.joinIds(ids.name, ids.username), "aria-describedby": ids.title, className: "contents", children: jsxRuntime.jsx(reactAriaComponents.RadioButton, { "data-testid": testIdUtils.joinTestId(rootTestId, `option-${person.id}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx.cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: cx.cx('flex flex-1', size === 'md' ? 'gap-3 md:gap-4' : 'gap-3'), children: [jsxRuntime.jsx(Avatar.Avatar, { alt: person.name, src: person.avatarUrl, size: size === 'md' ? 'md' : 'sm' }), jsxRuntime.jsxs("div", { className: cx.cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxRuntime.jsxs("span", { className: cx.cx('flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsxRuntime.jsx("span", { id: ids.name, className: cx.cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: person.name }), person.username && (jsxRuntime.jsx("span", { id: ids.username, className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: person.username }))] }), person.title && (jsxRuntime.jsx("span", { id: ids.title, className: cx.cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: person.title }))] })] }), jsxRuntime.jsx(Checkboxes.CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }) }, person.id));
|
|
19
21
|
}) }));
|
|
20
22
|
};
|
|
21
23
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupAvatar.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/RadioGroupAvatar.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","
|
|
1
|
+
{"version":3,"file":"RadioGroupAvatar.cjs","sources":["../../../../../src/components/molecules/RadioGroup/components/RadioGroupAvatar.tsx"],"sourcesContent":[null],"names":["useResolvedTestId","useOptionIds","_jsx","AriaRadioGroup","cx","AriaRadioField","joinIds","AriaRadioButton","joinTestId","_jsxs","_Fragment","AvatarComponent","CheckboxBase"],"mappings":";;;;;;;;;;;AA6BA;MACa,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB,KAAI;AAChI,IAAA,MAAM,UAAU,GAAGA,6BAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAGC,yBAAY,EAAE;IAEhC,QACEC,eAACC,8BAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAKC,KAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;YAC3B,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;YAEnG;;AAEE,YAAAF,cAAA,CAACG,8BAAc,EAAA,EACb,UAAU,EAAE,MAAM,CAAC,QAAQ,EAE3B,KAAK,EAAE,MAAM,CAAC,EAAE,qBACCC,qBAAO,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAA,kBAAA,EAC9B,GAAG,CAAC,KAAK,EAC3B,SAAS,EAAC,UAAU,EAAA,QAAA,EAEpBJ,c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AAM,CAAC,QAAQ,KACdF,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,YAC1F,MAAM,CAAC,QAAQ,EAAA,CACX,CACR,CAAA,EAAA,CACI,EACN,MAAM,CAAC,KAAK,KACXF,cAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,SAAS,EAAEE,KAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EACvF,MAAM,CAAC,KAAK,GACR,CACR,CAAA,EAAA,CACG,CAAA,EAAA,CACF,EACNF,eAACU,uBAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAAA,EAAA,CAClI,CACJ,GACe,EAAA,EA5Cb,MAAM,CAAC,EAAE,CA6CC;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupAvatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/RadioGroupAvatar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK7D,UAAU,cAAc;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,4DAA4D;IAC5D,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,mIAAmI;AACnI,eAAO,MAAM,gBAAgB,GAAI,iEAAwE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"RadioGroupAvatar.d.ts","sourceRoot":"","sources":["../../../../../src/components/molecules/RadioGroup/components/RadioGroupAvatar.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAK7D,UAAU,cAAc;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,qBAAsB,SAAQ,eAAe;IAC5D,6DAA6D;IAC7D,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,4DAA4D;IAC5D,KAAK,EAAE,cAAc,EAAE,CAAC;IACxB,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,mIAAmI;AACnI,eAAO,MAAM,gBAAgB,GAAI,iEAAwE,qBAAqB,gCAoE7H,CAAC"}
|
|
@@ -3,7 +3,7 @@ import { Avatar } from '@flipdish/ui-library/components/atoms/Avatar';
|
|
|
3
3
|
import { CheckboxBase } from '@flipdish/ui-library/components/atoms/Checkboxes';
|
|
4
4
|
import { cx } from '@flipdish/ui-library/utilities/cx';
|
|
5
5
|
import { useResolvedTestId, joinTestId } from '@flipdish/ui-library/utilities/testIdUtils';
|
|
6
|
-
import { RadioGroup,
|
|
6
|
+
import { RadioGroup, RadioField, RadioButton } from 'react-aria-components';
|
|
7
7
|
import { joinIds } from '../../../../utilities/__internal__/ariaIdsUtils/ariaIds.utils.js';
|
|
8
8
|
import { useOptionIds } from '../../RadioCards/hooks/useOptionIds.js';
|
|
9
9
|
|
|
@@ -13,7 +13,9 @@ const RadioGroupAvatar = ({ items, size = 'sm', className, 'data-testid': dataTe
|
|
|
13
13
|
const optionIds = useOptionIds();
|
|
14
14
|
return (jsx(RadioGroup, { ...props, "data-testid": rootTestId, className: (state) => cx('flex flex-col gap-3', typeof className === 'function' ? className(state) : className), children: items.map((person, index) => {
|
|
15
15
|
const ids = optionIds(index, { name: person.name, username: person.username, title: person.title });
|
|
16
|
-
return (
|
|
16
|
+
return (
|
|
17
|
+
// No box of its own, so the `<label>` is still the card the group lays out.
|
|
18
|
+
jsx(RadioField, { isDisabled: person.disabled, value: person.id, "aria-labelledby": joinIds(ids.name, ids.username), "aria-describedby": ids.title, className: "contents", children: jsx(RadioButton, { "data-testid": joinTestId(rootTestId, `option-${person.id}`), className: ({ isDisabled, isSelected, isFocusVisible }) => cx('relative flex cursor-pointer items-start gap-1 rounded-xl bg-primary p-4 outline-focus-ring ring-inset', isSelected ? 'ring-2 ring-brand' : 'ring-1 ring-secondary', isDisabled && 'cursor-not-allowed bg-disabled_subtle ring-disabled_subtle', isFocusVisible && 'outline-2 outline-offset-2'), children: ({ isDisabled, isSelected, isFocusVisible }) => (jsxs(Fragment, { children: [jsxs("div", { className: cx('flex flex-1', size === 'md' ? 'gap-3 md:gap-4' : 'gap-3'), children: [jsx(Avatar, { alt: person.name, src: person.avatarUrl, size: size === 'md' ? 'md' : 'sm' }), jsxs("div", { className: cx('flex flex-col', size === 'md' ? 'gap-0.5' : ''), children: [jsxs("span", { className: cx('flex', size === 'md' ? 'gap-1.5' : 'gap-1'), children: [jsx("span", { id: ids.name, className: cx('text-secondary', size === 'md' ? 'text-md font-medium' : 'text-sm font-medium'), children: person.name }), person.username && (jsx("span", { id: ids.username, className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: person.username }))] }), person.title && (jsx("span", { id: ids.title, className: cx('text-tertiary', size === 'md' ? 'text-md' : 'text-sm'), children: person.title }))] })] }), jsx(CheckboxBase, { size: size === 'md' ? 'md' : 'sm', isDisabled: isDisabled, isSelected: isSelected, isFocusVisible: isFocusVisible })] })) }) }, person.id));
|
|
17
19
|
}) }));
|
|
18
20
|
};
|
|
19
21
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioGroupAvatar.js","sources":["../../../../../src/components/molecules/RadioGroup/components/RadioGroupAvatar.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","
|
|
1
|
+
{"version":3,"file":"RadioGroupAvatar.js","sources":["../../../../../src/components/molecules/RadioGroup/components/RadioGroupAvatar.tsx"],"sourcesContent":[null],"names":["_jsx","AriaRadioGroup","AriaRadioField","AriaRadioButton","_jsxs","_Fragment","AvatarComponent"],"mappings":";;;;;;;;;AA6BA;MACa,gBAAgB,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAyB,KAAI;AAChI,IAAA,MAAM,UAAU,GAAG,iBAAiB,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,CAAC;AAE7G,IAAA,MAAM,SAAS,GAAG,YAAY,EAAE;IAEhC,QACEA,IAACC,UAAc,EAAA,EAAA,GACT,KAAK,EAAA,aAAA,EACI,UAAU,EACvB,SAAS,EAAE,CAAC,KAAK,KAAK,EAAE,CAAC,qBAAqB,EAAE,OAAO,SAAS,KAAK,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,EAAA,QAAA,EAE9G,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,KAAK,KAAI;YAC3B,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE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A,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,EAAE,CAAC,MAAM,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,OAAO,CAAC,EAAA,QAAA,EAAA,CAC9DJ,GAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,IAAI,KAAK,IAAI,GAAG,qBAAqB,GAAG,qBAAqB,CAAC,EAAA,QAAA,EAC/G,MAAM,CAAC,IAAI,GACP,EACN,MAAM,CAAC,QAAQ,KACdA,GAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,YAC1F,MAAM,CAAC,QAAQ,EAAA,CACX,CACR,CAAA,EAAA,CACI,EACN,MAAM,CAAC,KAAK,KACXA,GAAA,CAAA,MAAA,EAAA,EAAM,EAAE,EAAE,GAAG,CAAC,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,eAAe,EAAE,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,SAAS,CAAC,EAAA,QAAA,EACvF,MAAM,CAAC,KAAK,GACR,CACR,CAAA,EAAA,CACG,CAAA,EAAA,CACF,EACNA,IAAC,YAAY,EAAA,EAAC,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAA,CAAI,CAAA,EAAA,CAClI,CACJ,GACe,EAAA,EA5Cb,MAAM,CAAC,EAAE,CA6CC;QAErB,CAAC,CAAC,EAAA,CACa;AAErB;;"}
|
|
@@ -8,7 +8,9 @@ var React = require('react');
|
|
|
8
8
|
/** Pinned actions under the content, such as a message input or a primary button. */
|
|
9
9
|
const SidePanelFooter = React.forwardRef(({ className, variant = 'plain', 'data-testid': dataTestId, ...props }, ref) => {
|
|
10
10
|
const prefix = testIdUtils.useTestIdPrefix();
|
|
11
|
-
return (jsxRuntime.jsx("footer", { ...props, ref: ref, "data-testid": dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'footer') : undefined), className: cx.cx('w-full px-4 pb-4 lg:px-6 lg:pb-5',
|
|
11
|
+
return (jsxRuntime.jsx("footer", { ...props, ref: ref, "data-testid": dataTestId ?? (prefix ? testIdUtils.joinTestId(prefix, 'footer') : undefined), className: cx.cx('w-full px-4 pb-4 lg:px-6 lg:pb-5',
|
|
12
|
+
// Below `md` every action is full width with the primary one, last in the markup, on top, as in the bottom sheets.
|
|
13
|
+
variant === 'actions' && 'flex items-center justify-end gap-3 border-t border-secondary pt-4 max-md:flex-col-reverse max-md:items-stretch', className) }));
|
|
12
14
|
});
|
|
13
15
|
SidePanelFooter.displayName = 'SidePanelFooter';
|
|
14
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelFooter.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelFooter.tsx"],"sourcesContent":[null],"names":["forwardRef","useTestIdPrefix","_jsx","joinTestId","cx"],"mappings":";;;;;;;AAgBA;AACO,MAAM,eAAe,GAAGA,gBAAU,CACvC,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC7E,IAAA,MAAM,MAAM,GAAGC,2BAAe,EAAE;AAEhC,IAAA,QACEC,cAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EACT,GAAG,EAAE,GAAG,EAAA,aAAA,EACK,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAEC,KAAE,CACX,kCAAkC,
|
|
1
|
+
{"version":3,"file":"SidePanelFooter.cjs","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelFooter.tsx"],"sourcesContent":[null],"names":["forwardRef","useTestIdPrefix","_jsx","joinTestId","cx"],"mappings":";;;;;;;AAgBA;AACO,MAAM,eAAe,GAAGA,gBAAU,CACvC,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC7E,IAAA,MAAM,MAAM,GAAGC,2BAAe,EAAE;AAEhC,IAAA,QACEC,cAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EACT,GAAG,EAAE,GAAG,EAAA,aAAA,EACK,UAAU,KAAK,MAAM,GAAGC,sBAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAEC,KAAE,CACX,kCAAkC;;QAElC,OAAO,KAAK,SAAS,IAAI,iHAAiH,EAC1I,SAAS,CACV,EAAA,CACD;AAEN,CAAC;AAEH,eAAe,CAAC,WAAW,GAAG,iBAAiB;;"}
|
|
@@ -2,7 +2,7 @@ import { type ComponentPropsWithoutRef } from 'react';
|
|
|
2
2
|
export type SidePanelFooterProps = ComponentPropsWithoutRef<'footer'> & {
|
|
3
3
|
/**
|
|
4
4
|
* `plain` pads the content, for a message input. `actions` adds the top border of the design's
|
|
5
|
-
* action bar
|
|
5
|
+
* action bar, for one or two buttons: right-aligned from `md`, and below it stacked at full width with the last one on top.
|
|
6
6
|
*/
|
|
7
7
|
variant?: 'plain' | 'actions';
|
|
8
8
|
/** Overrides the footer's `data-testid` (defaults to `<root>--footer`). */
|
|
@@ -12,7 +12,7 @@ export type SidePanelFooterProps = ComponentPropsWithoutRef<'footer'> & {
|
|
|
12
12
|
export declare const SidePanelFooter: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
13
13
|
/**
|
|
14
14
|
* `plain` pads the content, for a message input. `actions` adds the top border of the design's
|
|
15
|
-
* action bar
|
|
15
|
+
* action bar, for one or two buttons: right-aligned from `md`, and below it stacked at full width with the last one on top.
|
|
16
16
|
*/
|
|
17
17
|
variant?: "plain" | "actions";
|
|
18
18
|
/** Overrides the footer's `data-testid` (defaults to `<root>--footer`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelFooter.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelFooter.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,QAAQ,CAAC,GAAG;IACtE;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,eAAe;IAV1B;;;OAGG;cACO,OAAO,GAAG,SAAS;IAC7B,2EAA2E;oBAC3D,MAAM;+
|
|
1
|
+
{"version":3,"file":"SidePanelFooter.d.ts","sourceRoot":"","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelFooter.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,wBAAwB,EAAc,MAAM,OAAO,CAAC;AAElE,MAAM,MAAM,oBAAoB,GAAG,wBAAwB,CAAC,QAAQ,CAAC,GAAG;IACtE;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC9B,2EAA2E;IAC3E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,eAAe;IAV1B;;;OAGG;cACO,OAAO,GAAG,SAAS;IAC7B,2EAA2E;oBAC3D,MAAM;+CAsBvB,CAAC"}
|
|
@@ -6,7 +6,9 @@ import { forwardRef } from 'react';
|
|
|
6
6
|
/** Pinned actions under the content, such as a message input or a primary button. */
|
|
7
7
|
const SidePanelFooter = forwardRef(({ className, variant = 'plain', 'data-testid': dataTestId, ...props }, ref) => {
|
|
8
8
|
const prefix = useTestIdPrefix();
|
|
9
|
-
return (jsx("footer", { ...props, ref: ref, "data-testid": dataTestId ?? (prefix ? joinTestId(prefix, 'footer') : undefined), className: cx('w-full px-4 pb-4 lg:px-6 lg:pb-5',
|
|
9
|
+
return (jsx("footer", { ...props, ref: ref, "data-testid": dataTestId ?? (prefix ? joinTestId(prefix, 'footer') : undefined), className: cx('w-full px-4 pb-4 lg:px-6 lg:pb-5',
|
|
10
|
+
// Below `md` every action is full width with the primary one, last in the markup, on top, as in the bottom sheets.
|
|
11
|
+
variant === 'actions' && 'flex items-center justify-end gap-3 border-t border-secondary pt-4 max-md:flex-col-reverse max-md:items-stretch', className) }));
|
|
10
12
|
});
|
|
11
13
|
SidePanelFooter.displayName = 'SidePanelFooter';
|
|
12
14
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanelFooter.js","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelFooter.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAgBA;AACO,MAAM,eAAe,GAAG,UAAU,CACvC,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC7E,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAEhC,IAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EACT,GAAG,EAAE,GAAG,EAAA,aAAA,EACK,UAAU,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAE,EAAE,CACX,kCAAkC,
|
|
1
|
+
{"version":3,"file":"SidePanelFooter.js","sources":["../../../../../src/components/organisms/SidePanel/components/SidePanelFooter.tsx"],"sourcesContent":[null],"names":["_jsx"],"mappings":";;;;;AAgBA;AACO,MAAM,eAAe,GAAG,UAAU,CACvC,CAAC,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAI;AAC7E,IAAA,MAAM,MAAM,GAAG,eAAe,EAAE;AAEhC,IAAA,QACEA,GAAA,CAAA,QAAA,EAAA,EAAA,GACM,KAAK,EACT,GAAG,EAAE,GAAG,EAAA,aAAA,EACK,UAAU,KAAK,MAAM,GAAG,UAAU,CAAC,MAAM,EAAE,QAAQ,CAAC,GAAG,SAAS,CAAC,EAC9E,SAAS,EAAE,EAAE,CACX,kCAAkC;;QAElC,OAAO,KAAK,SAAS,IAAI,iHAAiH,EAC1I,SAAS,CACV,EAAA,CACD;AAEN,CAAC;AAEH,eAAe,CAAC,WAAW,GAAG,iBAAiB;;"}
|
|
@@ -286,12 +286,14 @@ const TextEditorColor = ({ className }) => {
|
|
|
286
286
|
return (jsxRuntime.jsxs(reactAriaComponents.DialogTrigger, { children: [jsxRuntime.jsx(Tooltip.Tooltip, { title: "Text color", children: jsxRuntime.jsx(TextEditorButton.EditorButton, { "aria-label": "Text color", isDisabled: isDisabled, className: className, "data-testid": prefix ? testIdUtils.joinTestId(prefix, 'toolbar-color') : undefined, children: jsxRuntime.jsx("div", { style: {
|
|
287
287
|
outlineColor: selectionColor || DEFAULT_COLOR_SWATCH,
|
|
288
288
|
backgroundColor: selectionColor || DEFAULT_COLOR_SWATCH,
|
|
289
|
-
}, className: "size-4 rounded-full ring-1 ring-black/10 ring-inset in-pressed:outline-[1.5px] in-pressed:outline-offset-2" }) }) }), jsxRuntime.jsx(reactAriaComponents.Popover, { children: jsxRuntime.jsx(reactAriaComponents.Dialog, { className: "rounded-xl bg-primary_alt p-3 shadow-lg ring-1 ring-secondary_alt outline-hidden", children: jsxRuntime.jsx("div", { className: "flex flex-col gap-3 lg:flex-row lg:items-center", children: jsxRuntime.jsxs(reactAriaComponents.RadioGroup, { className: "flex flex-col items-start gap-2", value: color?.toString('hex'), onChange: handleColorChange, children: [jsxRuntime.jsx("div", { className: "grid grid-cols-8 gap-1", children: colorSwatches.map((color) => (
|
|
290
|
-
|
|
291
|
-
|
|
289
|
+
}, className: "size-4 rounded-full ring-1 ring-black/10 ring-inset in-pressed:outline-[1.5px] in-pressed:outline-offset-2" }) }) }), jsxRuntime.jsx(reactAriaComponents.Popover, { children: jsxRuntime.jsx(reactAriaComponents.Dialog, { className: "rounded-xl bg-primary_alt p-3 shadow-lg ring-1 ring-secondary_alt outline-hidden", children: jsxRuntime.jsx("div", { className: "flex flex-col gap-3 lg:flex-row lg:items-center", children: jsxRuntime.jsxs(reactAriaComponents.RadioGroup, { "aria-label": "Text color", className: "flex flex-col items-start gap-2", value: color?.toString('hex'), onChange: handleColorChange, children: [jsxRuntime.jsx("div", { className: "grid grid-cols-8 gap-1", children: colorSwatches.map((color) => (
|
|
290
|
+
// No box of its own, so each swatch's `<label>` is still a cell of the grid.
|
|
291
|
+
jsxRuntime.jsx(reactAriaComponents.RadioField, { value: color, className: "contents", children: jsxRuntime.jsx(reactAriaComponents.RadioButton, { className: "p-0.5", children: ({ isSelected, isFocused }) => (jsxRuntime.jsx(reactAriaComponents.ColorSwatch, { style: {
|
|
292
|
+
outlineColor: color,
|
|
293
|
+
}, color: color, className: cx.cx('size-4 cursor-pointer rounded-full ring-1 ring-black/10 ring-inset', (isSelected || isFocused) && 'outline-2 outline-offset-2') })) }) }, color))) }), jsxRuntime.jsxs("div", { className: "flex w-full shrink-0 items-center", children: [jsxRuntime.jsx("span", { className: "mr-3 text-sm font-semibold text-primary", children: "Custom" }), jsxRuntime.jsx(reactAriaComponents.RadioField, { value: customColor.toString('hex'), className: "contents", children: jsxRuntime.jsx(reactAriaComponents.RadioButton, { children: ({ isSelected, isFocused }) => (jsxRuntime.jsx(reactAriaComponents.ColorSwatch, { style: {
|
|
292
294
|
outlineColor: customColor.toString('hex'),
|
|
293
295
|
backgroundColor: customColor.toString('hex'),
|
|
294
|
-
}, className: cx.cx('mr-2 size-4 shrink-0 cursor-pointer rounded-full ring-1 ring-black/10 ring-inset', (isSelected || isFocused) && 'outline-2 outline-offset-2') }) })
|
|
296
|
+
}, className: cx.cx('mr-2 size-4 shrink-0 cursor-pointer rounded-full ring-1 ring-black/10 ring-inset', (isSelected || isFocused) && 'outline-2 outline-offset-2') })) }) }), jsxRuntime.jsx(reactAriaComponents.ColorField, { "aria-label": "Custom color", className: "flex min-w-0 flex-1", value: customColor, onChange: handleCustomColorChange, children: jsxRuntime.jsx(Inputs.InputBase, { size: "md", wrapperClassName: "flex-1 w-23 min-w-0" }) })] })] }) }) }) })] }));
|
|
295
297
|
};
|
|
296
298
|
/**
|
|
297
299
|
* Text editor button for changing the text font family.
|