@fuf-stack/uniform 2.0.0-next.1 → 2.0.0-next.4
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/Checkboxes/index.d.mts +47 -27
- package/dist/Checkboxes/index.d.mts.map +1 -1
- package/dist/Checkboxes/index.mjs +26 -25
- package/dist/Checkboxes/index.mjs.map +1 -1
- package/dist/DatePicker/index.d.mts +63 -86
- package/dist/DatePicker/index.d.mts.map +1 -1
- package/dist/DatePicker/index.mjs +43 -49
- package/dist/DatePicker/index.mjs.map +1 -1
- package/dist/FieldArray/index.d.mts +8 -16
- package/dist/FieldArray/index.d.mts.map +1 -1
- package/dist/FieldArray/index.mjs +25 -37
- package/dist/FieldArray/index.mjs.map +1 -1
- package/dist/FieldCard/index.d.mts +0 -4
- package/dist/FieldCard/index.d.mts.map +1 -1
- package/dist/FieldCard/index.mjs +14 -25
- package/dist/FieldCard/index.mjs.map +1 -1
- package/dist/{FieldCopyTestIdButton-DV0tkdh2.mjs → FieldCopyTestIdButton-D3_jZYJ1.mjs} +3 -5
- package/dist/{FieldCopyTestIdButton-DV0tkdh2.mjs.map → FieldCopyTestIdButton-D3_jZYJ1.mjs.map} +1 -1
- package/dist/FieldHelper-B1DWl7eu.mjs +38 -0
- package/dist/FieldHelper-B1DWl7eu.mjs.map +1 -0
- package/dist/FieldLabel-DMTqq0Jj.mjs +29 -0
- package/dist/FieldLabel-DMTqq0Jj.mjs.map +1 -0
- package/dist/{FieldLayout-BLW5S-Jm.mjs → FieldLayout-C9MEBZAC.mjs} +11 -19
- package/dist/FieldLayout-C9MEBZAC.mjs.map +1 -0
- package/dist/FieldReset/index.d.mts +420 -0
- package/dist/FieldReset/index.d.mts.map +1 -0
- package/dist/FieldReset/index.mjs +258 -0
- package/dist/FieldReset/index.mjs.map +1 -0
- package/dist/{FieldValidationError-DgkCL3cC.mjs → FieldValidationError-BuLvuRyi.mjs} +5 -7
- package/dist/FieldValidationError-BuLvuRyi.mjs.map +1 -0
- package/dist/Form/index.d.mts +12 -14
- package/dist/Form/index.d.mts.map +1 -1
- package/dist/Form/index.mjs +7 -10
- package/dist/Form/index.mjs.map +1 -1
- package/dist/FormContext-BnNJYZOo.d.mts +124 -0
- package/dist/FormContext-BnNJYZOo.d.mts.map +1 -0
- package/dist/{FormContext-CHctWFAP.mjs → FormContext-PXkVlBdU.mjs} +5 -9
- package/dist/{FormContext-CHctWFAP.mjs.map → FormContext-PXkVlBdU.mjs.map} +1 -1
- package/dist/Grid/index.d.mts +0 -2
- package/dist/Grid/index.d.mts.map +1 -1
- package/dist/Grid/index.mjs +1 -1
- package/dist/{Grid-DfcZeuib.mjs → Grid-DBL29Kwb.mjs} +3 -5
- package/dist/{Grid-DfcZeuib.mjs.map → Grid-DBL29Kwb.mjs.map} +1 -1
- package/dist/Input/index.d.mts +610 -393
- package/dist/Input/index.d.mts.map +1 -1
- package/dist/Input/index.mjs +24 -31
- package/dist/Input/index.mjs.map +1 -1
- package/dist/RadioBoxes/index.d.mts +247 -2227
- package/dist/RadioBoxes/index.d.mts.map +1 -1
- package/dist/RadioBoxes/index.mjs +25 -37
- package/dist/RadioBoxes/index.mjs.map +1 -1
- package/dist/RadioTabs/index.d.mts +599 -289
- package/dist/RadioTabs/index.d.mts.map +1 -1
- package/dist/RadioTabs/index.mjs +24 -27
- package/dist/RadioTabs/index.mjs.map +1 -1
- package/dist/Radios/index.d.mts +164 -2077
- package/dist/Radios/index.d.mts.map +1 -1
- package/dist/Radios/index.mjs +12 -23
- package/dist/Radios/index.mjs.map +1 -1
- package/dist/Select/index.d.mts +809 -484
- package/dist/Select/index.d.mts.map +1 -1
- package/dist/Select/index.mjs +69 -54
- package/dist/Select/index.mjs.map +1 -1
- package/dist/Slider/index.d.mts +657 -281
- package/dist/Slider/index.d.mts.map +1 -1
- package/dist/Slider/index.mjs +42 -42
- package/dist/Slider/index.mjs.map +1 -1
- package/dist/SubmitButton/index.d.mts +0 -2
- package/dist/SubmitButton/index.d.mts.map +1 -1
- package/dist/SubmitButton/index.mjs +2 -4
- package/dist/SubmitButton/index.mjs.map +1 -1
- package/dist/Switch/index.d.mts +1 -1
- package/dist/Switch/index.mjs +25 -32
- package/dist/Switch/index.mjs.map +1 -1
- package/dist/Switch-aBYStBoY.d.mts +990 -0
- package/dist/Switch-aBYStBoY.d.mts.map +1 -0
- package/dist/SwitchBox/index.d.mts +606 -201
- package/dist/SwitchBox/index.d.mts.map +1 -1
- package/dist/SwitchBox/index.mjs +29 -33
- package/dist/SwitchBox/index.mjs.map +1 -1
- package/dist/TextArea/index.d.mts +565 -185
- package/dist/TextArea/index.d.mts.map +1 -1
- package/dist/TextArea/index.mjs +18 -23
- package/dist/TextArea/index.mjs.map +1 -1
- package/dist/Time/index.d.mts +60 -44
- package/dist/Time/index.d.mts.map +1 -1
- package/dist/Time/index.mjs +27 -36
- package/dist/Time/index.mjs.map +1 -1
- package/dist/fieldHelperVariants-ClP8taiS.mjs +20 -0
- package/dist/fieldHelperVariants-ClP8taiS.mjs.map +1 -0
- package/dist/fieldLabelVariants-C4ZqECec.mjs +13 -0
- package/dist/fieldLabelVariants-C4ZqECec.mjs.map +1 -0
- package/dist/{FieldDescription-C4l0HKGL.mjs → fieldProps-DWfz2jSO.mjs} +5 -17
- package/dist/fieldProps-DWfz2jSO.mjs.map +1 -0
- package/dist/helpers/index.d.mts +0 -6
- package/dist/helpers/index.d.mts.map +1 -1
- package/dist/helpers/index.mjs +3 -6
- package/dist/helpers/index.mjs.map +1 -1
- package/dist/hooks/useClientValidation/index.d.mts +0 -2
- package/dist/hooks/useClientValidation/index.d.mts.map +1 -1
- package/dist/hooks/useClientValidation/index.mjs +3 -5
- package/dist/hooks/useController/index.d.mts +0 -2
- package/dist/hooks/useController/index.d.mts.map +1 -1
- package/dist/hooks/useController/index.mjs +2 -3
- package/dist/hooks/useFormContext/index.d.mts +31 -52
- package/dist/hooks/useFormContext/index.d.mts.map +1 -1
- package/dist/hooks/useFormContext/index.mjs +2 -3
- package/dist/hooks/useInputValueDebounce/index.d.mts +0 -2
- package/dist/hooks/useInputValueDebounce/index.d.mts.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.mjs +3 -5
- package/dist/hooks/useInputValueTransform/index.d.mts +1 -1
- package/dist/hooks/useInputValueTransform/index.mjs +2 -3
- package/dist/hooks/useWatchFormReset/index.d.mts +0 -2
- package/dist/hooks/useWatchFormReset/index.d.mts.map +1 -1
- package/dist/hooks/useWatchFormReset/index.mjs +3 -5
- package/dist/hooks/useWatchUserChange/index.d.mts +0 -2
- package/dist/hooks/useWatchUserChange/index.d.mts.map +1 -1
- package/dist/hooks/useWatchUserChange/index.mjs +3 -5
- package/dist/{index-BS8IoBOn.d.mts → index-cevZBrIN.d.mts} +1 -3
- package/dist/index-cevZBrIN.d.mts.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.d.mts +0 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.mts.map +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.mjs +1 -1
- package/dist/{Switch-CvPO8IF9.d.mts → partials/FieldHelper/index.d.mts} +309 -361
- package/dist/partials/FieldHelper/index.d.mts.map +1 -0
- package/dist/partials/FieldHelper/index.mjs +7 -0
- package/dist/partials/FieldHelper/index.mjs.map +1 -0
- package/dist/partials/FieldLabel/index.d.mts +160 -0
- package/dist/partials/FieldLabel/index.d.mts.map +1 -0
- package/dist/partials/FieldLabel/index.mjs +7 -0
- package/dist/partials/FieldLabel/index.mjs.map +1 -0
- package/dist/partials/FieldValidationError/index.d.mts +13 -15
- package/dist/partials/FieldValidationError/index.d.mts.map +1 -1
- package/dist/partials/FieldValidationError/index.mjs +1 -1
- package/dist/{radioControlVariants-Cm6WufWo.mjs → radioControlVariants-CbtG5U4_.mjs} +28 -25
- package/dist/radioControlVariants-CbtG5U4_.mjs.map +1 -0
- package/dist/{switchVariants-BaQw2DA7.mjs → switchVariants-0Xa7TQYg.mjs} +8 -11
- package/dist/switchVariants-0Xa7TQYg.mjs.map +1 -0
- package/dist/{timeVariants-B9HDfNYt.mjs → timeVariants-Bkt4iwXx.mjs} +14 -12
- package/dist/timeVariants-Bkt4iwXx.mjs.map +1 -0
- package/dist/{useController-BCFeZbBZ.mjs → useController-JtIeurpw.mjs} +3 -4
- package/dist/{useController-BCFeZbBZ.mjs.map → useController-JtIeurpw.mjs.map} +1 -1
- package/dist/{useFormContext-BPjJjNnM.mjs → useFormContext-piqnN2L-.mjs} +3 -4
- package/dist/useFormContext-piqnN2L-.mjs.map +1 -0
- package/dist/{useInputValueTransform-Mw8YEOXT.mjs → useInputValueTransform-CXWWFhy_.mjs} +2 -3
- package/dist/{useInputValueTransform-Mw8YEOXT.mjs.map → useInputValueTransform-CXWWFhy_.mjs.map} +1 -1
- package/dist/{FieldLabel-DKzqkuY1.mjs → useUniformField-TTNPTsVn.mjs} +15 -37
- package/dist/useUniformField-TTNPTsVn.mjs.map +1 -0
- package/package.json +10 -7
- package/dist/FieldDescription-C4l0HKGL.mjs.map +0 -1
- package/dist/FieldLabel-DKzqkuY1.mjs.map +0 -1
- package/dist/FieldLayout-BLW5S-Jm.mjs.map +0 -1
- package/dist/FieldValidationError-DgkCL3cC.mjs.map +0 -1
- package/dist/FormContext-CsFiNvuJ.d.mts +0 -19
- package/dist/FormContext-CsFiNvuJ.d.mts.map +0 -1
- package/dist/Switch-CvPO8IF9.d.mts.map +0 -1
- package/dist/index-BS8IoBOn.d.mts.map +0 -1
- package/dist/radioControlVariants-Cm6WufWo.mjs.map +0 -1
- package/dist/switchVariants-BaQw2DA7.mjs.map +0 -1
- package/dist/timeVariants-B9HDfNYt.mjs.map +0 -1
- package/dist/useFormContext-BPjJjNnM.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/RadioBoxes/radioBoxesVariants.ts","../../src/RadioBoxes/RadioBoxes.tsx","../../src/RadioBoxes/subcomponents/radioBoxVariants.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/RadioBoxes/radioBoxesVariants.ts","../../src/RadioBoxes/RadioBoxes.tsx","../../src/RadioBoxes/subcomponents/radioBoxVariants.ts"],"mappings":";;qBAMa,sBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAkCnB,eAAe,eAAe;KAE9B,YAAY,mBAAmB;UClC1B;;EAEf,cAAc;;EAEd;;EAEA,OAAO;;EAEP,QAAQ;;EAER;;EAEA;;UAGe,wBAAwB;;EAEvC;;EAEA,YAAY;;EAEZ,cAAc;;EAEd;;EAEA;;EAEA,QAAQ;;EAER;;EAEA,SAAS;;EAET;;EAEA;;;cAII,eAAc,WAAA,QAAA,MAAA,YAAA,qBAMjB,oCAAe,IAAA;qBC/CL,oBAAgB"}
|
|
@@ -1,22 +1,18 @@
|
|
|
1
|
+
import { t as useUniformField } from "../useUniformField-TTNPTsVn.mjs";
|
|
1
2
|
import { createOptionValueConverter } from "../helpers/index.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { t as
|
|
5
|
-
import { i as RadioGroupField, n as RadioControl, r as radioGroupFieldVariants, t as radioControlVariants } from "../radioControlVariants-Cm6WufWo.mjs";
|
|
3
|
+
import { t as getFieldControlProps } from "../fieldProps-DWfz2jSO.mjs";
|
|
4
|
+
import { t as FieldLayout } from "../FieldLayout-C9MEBZAC.mjs";
|
|
5
|
+
import { i as RadioGroupField, n as RadioControl, r as radioGroupFieldVariants, t as radioControlVariants } from "../radioControlVariants-CbtG5U4_.mjs";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { slugify, tv } from "@fuf-stack/pixel-utils";
|
|
8
8
|
import { useStyling } from "@fuf-stack/pixels/StylingProvider";
|
|
9
9
|
import { Label } from "react-aria-components";
|
|
10
|
-
|
|
10
|
+
// src/RadioBoxes/radioBoxesVariants.ts
|
|
11
11
|
const radioBoxesVariants = tv({
|
|
12
12
|
extend: radioGroupFieldVariants,
|
|
13
13
|
slots: {
|
|
14
14
|
/** Container for the field control and supporting text */
|
|
15
|
-
base: [
|
|
16
|
-
"group",
|
|
17
|
-
"flex w-full flex-col",
|
|
18
|
-
"gap-y-1.5"
|
|
19
|
-
],
|
|
15
|
+
base: ["group", "flex w-full flex-col"],
|
|
20
16
|
/** Clickable option box */
|
|
21
17
|
boxBase: "",
|
|
22
18
|
/** Indicator marking the selected box */
|
|
@@ -27,16 +23,12 @@ const radioBoxesVariants = tv({
|
|
|
27
23
|
boxLabel: "",
|
|
28
24
|
/** Container grouping option text */
|
|
29
25
|
boxLabelWrapper: "",
|
|
30
|
-
/** Container for validation messages */
|
|
31
|
-
errorMessage: "text-danger text-tiny",
|
|
32
|
-
/** Visible field label */
|
|
33
|
-
label: "mb-2 inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger",
|
|
34
26
|
/** Container arranging the selectable content */
|
|
35
27
|
wrapper: "flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row"
|
|
36
|
-
}
|
|
28
|
+
},
|
|
29
|
+
variants: { readOnly: { true: { boxBase: "hover:bg-transparent" } } }
|
|
37
30
|
});
|
|
38
|
-
|
|
39
|
-
//#region src/RadioBoxes/subcomponents/radioBoxVariants.ts
|
|
31
|
+
// src/RadioBoxes/subcomponents/radioBoxVariants.ts
|
|
40
32
|
const radioBoxVariants = tv({
|
|
41
33
|
slots: {
|
|
42
34
|
/** Container for the field control and supporting text */
|
|
@@ -61,8 +53,8 @@ const radioBoxVariants = tv({
|
|
|
61
53
|
wrapper: radioControlVariants.slots.wrapper
|
|
62
54
|
},
|
|
63
55
|
variants: {
|
|
64
|
-
|
|
65
|
-
|
|
56
|
+
disabled: { true: { base: "cursor-not-allowed opacity-disabled **:cursor-not-allowed hover:bg-transparent" } },
|
|
57
|
+
invalid: { true: {
|
|
66
58
|
base: "!border-danger",
|
|
67
59
|
control: radioControlVariants.variants.invalid.true.control,
|
|
68
60
|
label: radioControlVariants.variants.invalid.true.label,
|
|
@@ -70,44 +62,42 @@ const radioBoxVariants = tv({
|
|
|
70
62
|
} }
|
|
71
63
|
}
|
|
72
64
|
});
|
|
73
|
-
|
|
74
|
-
//#region src/RadioBoxes/subcomponents/RadioBox.tsx
|
|
65
|
+
// src/RadioBoxes/subcomponents/RadioBox.tsx
|
|
75
66
|
/**
|
|
76
67
|
* Selectable radio box with an icon, supporting text and selection indicator
|
|
77
68
|
*
|
|
78
69
|
* @see https://react-aria.adobe.com/RadioGroup
|
|
79
70
|
*/
|
|
80
|
-
const RadioBox = ({ className = void 0, classNames: _classNames = void 0, icon = void 0,
|
|
71
|
+
const RadioBox = ({ className = void 0, classNames: _classNames = void 0, icon = void 0, invalid = false, disabled = false, description = void 0, children = void 0, value, ...props }) => {
|
|
81
72
|
const styling = useStyling();
|
|
82
73
|
const variants = styling.resolve(radioBoxVariants, {
|
|
83
|
-
|
|
84
|
-
|
|
74
|
+
disabled,
|
|
75
|
+
invalid
|
|
85
76
|
});
|
|
86
77
|
const classNames = styling.variantsToClassNames(variants, _classNames ?? className, "base");
|
|
87
78
|
return /* @__PURE__ */ jsx(RadioControl, {
|
|
88
79
|
className: classNames,
|
|
89
80
|
description,
|
|
90
|
-
disabled
|
|
81
|
+
disabled,
|
|
91
82
|
icon,
|
|
92
|
-
invalid
|
|
83
|
+
invalid,
|
|
93
84
|
testId: props["data-testid"],
|
|
94
85
|
value,
|
|
95
86
|
children
|
|
96
87
|
});
|
|
97
88
|
};
|
|
98
|
-
|
|
99
|
-
//#region src/RadioBoxes/subcomponents/RadioBoxesControl.tsx
|
|
89
|
+
// src/RadioBoxes/subcomponents/RadioBoxesControl.tsx
|
|
100
90
|
/**
|
|
101
91
|
* Radio boxes with shared group layout and focus routing
|
|
102
92
|
*
|
|
103
93
|
* @see https://react-aria.adobe.com/RadioGroup
|
|
104
94
|
*/
|
|
105
95
|
const RadioBoxesControl = ({ field, className, inline = false, options }) => {
|
|
106
|
-
const { description, disabled, errorMessage, ids, ref: inputRef, invalid, label, name, onBlur, onChange: onValueChange, required, testId, value } = field;
|
|
96
|
+
const { description, disabled, errorMessage, ids, ref: inputRef, invalid, label, name, onBlur, onChange: onValueChange, readOnly, required, testId, value } = field;
|
|
107
97
|
const controlProps = getFieldControlProps(field);
|
|
108
98
|
const styling = useStyling();
|
|
109
99
|
const { convertToOriginalType } = createOptionValueConverter(options);
|
|
110
|
-
const variants = styling.resolve(radioBoxesVariants);
|
|
100
|
+
const variants = styling.resolve(radioBoxesVariants, { readOnly });
|
|
111
101
|
const classNames = styling.variantsToClassNames(variants, className, "base");
|
|
112
102
|
const handleChange = (nextValue) => {
|
|
113
103
|
onValueChange(convertToOriginalType(nextValue));
|
|
@@ -124,6 +114,7 @@ const RadioBoxesControl = ({ field, className, inline = false, options }) => {
|
|
|
124
114
|
name,
|
|
125
115
|
onBlur,
|
|
126
116
|
onChange: handleChange,
|
|
117
|
+
readOnly,
|
|
127
118
|
required,
|
|
128
119
|
testId,
|
|
129
120
|
value
|
|
@@ -153,9 +144,9 @@ const RadioBoxesControl = ({ field, className, inline = false, options }) => {
|
|
|
153
144
|
},
|
|
154
145
|
"data-testid": optionTestId,
|
|
155
146
|
description: option.description,
|
|
147
|
+
disabled: !!disabled || option.disabled,
|
|
156
148
|
icon: option.icon,
|
|
157
|
-
|
|
158
|
-
isInvalid: invalid,
|
|
149
|
+
invalid,
|
|
159
150
|
value: String(option.value),
|
|
160
151
|
children: option.label ?? option.value
|
|
161
152
|
}, String(option.value));
|
|
@@ -165,8 +156,7 @@ const RadioBoxesControl = ({ field, className, inline = false, options }) => {
|
|
|
165
156
|
})
|
|
166
157
|
});
|
|
167
158
|
};
|
|
168
|
-
|
|
169
|
-
//#region src/RadioBoxes/RadioBoxes.tsx
|
|
159
|
+
// src/RadioBoxes/RadioBoxes.tsx
|
|
170
160
|
/** Form selection field for one option displayed as a box */
|
|
171
161
|
const RadioBoxes = ({ className = void 0, inline = false, name, options, ...uniformFieldProps }) => {
|
|
172
162
|
const { field } = useUniformField({
|
|
@@ -180,10 +170,8 @@ const RadioBoxes = ({ className = void 0, inline = false, name, options, ...unif
|
|
|
180
170
|
options
|
|
181
171
|
});
|
|
182
172
|
};
|
|
183
|
-
|
|
184
|
-
//#region src/RadioBoxes/index.ts
|
|
173
|
+
// src/RadioBoxes/index.ts
|
|
185
174
|
var RadioBoxes_default = RadioBoxes;
|
|
186
|
-
//#endregion
|
|
187
175
|
export { RadioBoxes_default as default, radioBoxVariants, radioBoxesVariants };
|
|
188
176
|
|
|
189
177
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/RadioBoxes/radioBoxesVariants.ts","../../src/RadioBoxes/subcomponents/radioBoxVariants.ts","../../src/RadioBoxes/subcomponents/RadioBox.tsx","../../src/RadioBoxes/subcomponents/RadioBoxesControl.tsx","../../src/RadioBoxes/RadioBoxes.tsx","../../src/RadioBoxes/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport radioGroupFieldVariants from '../partials/RadioGroupField/radioGroupFieldVariants';\n\nexport const radioBoxesVariants = tv({\n extend: radioGroupFieldVariants,\n slots: {\n /** Container for the field control and supporting text */\n base: [\n // Needs group for group-data condition.\n 'group',\n // Match shared field wrapper layout.\n 'flex w-full flex-col',\n // Keep spacing between label/radio boxes consistent.\n 'gap-y-1.5',\n ],\n /** Clickable option box */\n boxBase: '',\n /** Indicator marking the selected box */\n boxControl: '',\n /** Supporting text inside an option box */\n boxDescription: '',\n /** Primary option text */\n boxLabel: '',\n /** Container grouping option text */\n boxLabelWrapper: '',\n /** Container for validation messages */\n errorMessage: 'text-danger text-tiny',\n /** Visible field label */\n label:\n 'mb-2 inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n /** Container arranging the selectable content */\n wrapper:\n 'flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row',\n },\n});\n\nexport type VariantProps = TVProps<typeof radioBoxesVariants>;\n\nexport type ClassName = TVClassName<typeof radioBoxesVariants>;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport radioControlVariants from '../../Radios/subcomponents/radioControlVariants';\n\nexport const radioBoxVariants = tv({\n slots: {\n /** Container for the field control and supporting text */\n base: [\n // option box layout\n 'group inline-flex flex-auto cursor-pointer items-center justify-between gap-4',\n // box border and padding\n 'rounded-lg border-2 border-default p-4',\n // hover and selection feedback\n 'hover:bg-content2 data-[selected=true]:border-focus',\n ],\n /** Dot marking the selected option */\n control: radioControlVariants.slots.control,\n /** Supporting text for the field */\n description: 'text-foreground opacity-70 text-small',\n /** Option state boundary without an additional layout box */\n field: radioControlVariants.slots.field,\n /** Decorative icon beside the option text */\n icon: '',\n /** Visible field label */\n label: radioControlVariants.slots.label,\n /** Container grouping the option label and description */\n labelWrapper: [radioControlVariants.slots.labelWrapper, 'grow'],\n /** Circular outline around the selection indicator */\n wrapper: radioControlVariants.slots.wrapper,\n },\n variants: {\n isDisabled: {\n true: {\n base: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n base: '!border-danger',\n control: radioControlVariants.variants.invalid.true.control,\n label: radioControlVariants.variants.invalid.true.label,\n wrapper: radioControlVariants.variants.invalid.true.wrapper,\n },\n },\n },\n});\n\nexport type ClassName = TVClassName<typeof radioBoxVariants>;\n","import type { ReactNode } from 'react';\nimport type { ClassName } from './radioBoxVariants';\n\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport RadioControl from '../../Radios/subcomponents/RadioControl';\nimport { radioBoxVariants } from './radioBoxVariants';\n\nexport interface RadioBoxProps {\n /** Option label. */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Legacy alias for className */\n classNames?: ClassName;\n /** HTML test ID for the option. */\n 'data-testid'?: string;\n /** Help text associated with the field */\n description?: ReactNode;\n /** icon for the option */\n icon?: ReactNode;\n /** Whether the option is disabled. */\n isDisabled?: boolean;\n /** whether the radio is invalid */\n isInvalid?: boolean;\n /** String value managed by the containing radio group. */\n value: string;\n}\n\n/**\n * Selectable radio box with an icon, supporting text and selection indicator\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nexport const RadioBox = ({\n className = undefined,\n classNames: _classNames = undefined,\n icon = undefined,\n isInvalid = false,\n isDisabled = false,\n description = undefined,\n children = undefined,\n value,\n ...props\n}: RadioBoxProps) => {\n const styling = useStyling();\n\n // classNames from slots\n const variants = styling.resolve(radioBoxVariants, { isDisabled, isInvalid });\n const classNames = styling.variantsToClassNames(\n variants,\n _classNames ?? className,\n 'base',\n );\n\n return (\n <RadioControl\n className={classNames}\n description={description}\n disabled={isDisabled}\n icon={icon}\n invalid={isInvalid}\n testId={props['data-testid']}\n value={value}\n >\n {children}\n </RadioControl>\n );\n};\n\nexport default RadioBox;\n","import type { UniformField } from '../../hooks/useUniformField/types';\nimport type { RadioBoxesProps } from '../RadioBoxes';\n\nimport { Label } from 'react-aria-components';\n\nimport { slugify } from '@fuf-stack/pixel-utils';\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport { createOptionValueConverter } from '../../helpers';\nimport { getFieldControlProps } from '../../helpers/fieldProps/fieldProps';\nimport FieldLayout from '../../partials/FieldLayout/FieldLayout';\nimport RadioGroupField from '../../partials/RadioGroupField/RadioGroupField';\nimport { radioBoxesVariants } from '../radioBoxesVariants';\nimport { RadioBox } from './RadioBox';\n\ninterface RadioBoxesControlProps extends Pick<\n RadioBoxesProps,\n 'className' | 'inline' | 'options'\n> {\n /** Bound field values, interactions and metadata */\n field: UniformField<unknown, string | number | boolean>;\n}\n\n/**\n * Radio boxes with shared group layout and focus routing\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nconst RadioBoxesControl = ({\n field,\n className,\n inline = false,\n options,\n}: RadioBoxesControlProps) => {\n const {\n description,\n disabled,\n errorMessage,\n ids,\n ref: inputRef,\n invalid,\n label,\n name,\n onBlur,\n onChange: onValueChange,\n required,\n testId,\n value,\n } = field;\n\n // associate the editable control with its label and messages\n const controlProps = getFieldControlProps(field);\n\n const styling = useStyling();\n\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = styling.resolve(radioBoxesVariants);\n const classNames = styling.variantsToClassNames(variants, className, 'base');\n\n // restore the selected option's original value type\n const handleChange = (nextValue: string) => {\n onValueChange(convertToOriginalType(nextValue));\n };\n\n return (\n <FieldLayout\n baseAs={RadioGroupField}\n baseProps={{\n controlProps,\n dataComponent: 'radio-boxes',\n disabled,\n inline,\n inputRef,\n invalid,\n name,\n onBlur,\n onChange: handleChange,\n required,\n testId,\n value,\n }}\n className={classNames}\n description={description}\n errorMessage={errorMessage}\n ids={ids}\n invalid={invalid}\n label={label}\n labelAs={Label}\n required={required}\n >\n <div\n className={classNames.wrapper}\n data-orientation={inline ? 'horizontal' : 'vertical'}\n data-slot=\"wrapper\"\n >\n {options.map((option) => {\n if ('value' in option) {\n const optionTestId = slugify(\n `${testId}_option_${option.testId ?? option.value}`,\n { replaceDots: true },\n );\n return (\n <RadioBox\n key={String(option.value)}\n className={{\n base: classNames.boxBase,\n control: classNames.boxControl,\n description: classNames.boxDescription,\n label: classNames.boxLabel,\n labelWrapper: classNames.boxLabelWrapper,\n }}\n data-testid={optionTestId}\n description={option.description}\n icon={option.icon}\n isDisabled={!!disabled || option.disabled}\n isInvalid={invalid}\n value={String(option.value)}\n >\n {option.label ?? option.value}\n </RadioBox>\n );\n }\n return null;\n })}\n </div>\n </FieldLayout>\n );\n};\n\nexport default RadioBoxesControl;\n","import type { ReactNode } from 'react';\nimport type { ClassName, VariantProps } from './radioBoxesVariants';\n\nimport useUniformField from '../hooks/useUniformField/useUniformField';\nimport RadioBoxesControl from './subcomponents/RadioBoxesControl';\n\nexport { radioBoxesVariants } from './radioBoxesVariants';\n\nexport interface RadioBoxOption {\n /** Help text associated with the field */\n description?: ReactNode;\n /** Disables the field */\n disabled?: boolean;\n /** option icon */\n icon?: ReactNode;\n /** Field label */\n label?: ReactNode;\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n /** option value */\n value: string | number;\n}\n\nexport interface RadioBoxesProps extends VariantProps {\n /** Custom accessible name */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** Help text associated with the field */\n description?: ReactNode;\n /** Disables the field */\n disabled?: boolean;\n /** Arranges options horizontally */\n inline?: boolean;\n /** Field label */\n label?: ReactNode;\n /** Field name */\n name: string;\n /** Available options */\n options: RadioBoxOption[];\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n}\n\n/** Form selection field for one option displayed as a box */\nconst RadioBoxes = ({\n className = undefined,\n inline = false,\n name,\n options,\n ...uniformFieldProps\n}: RadioBoxesProps) => {\n const { field } = useUniformField({ ...uniformFieldProps, name });\n\n return (\n <RadioBoxesControl\n className={className}\n field={field}\n inline={inline}\n options={options}\n />\n );\n};\n\nexport default RadioBoxes;\n","import RadioBoxes from './RadioBoxes';\n\nexport type { RadioBoxesProps, RadioBoxOption } from './RadioBoxes';\n\nexport { radioBoxesVariants } from './radioBoxesVariants';\n\nexport { radioBoxVariants } from './subcomponents/radioBoxVariants';\n\nexport default RadioBoxes;\n"],"mappings":";;;;;;;;;;AAMA,MAAa,qBAAqB,GAAG;CACnC,QAAQ;CACR,OAAO;;EAEL,MAAM;GAEJ;GAEA;GAEA;EACF;;EAEA,SAAS;;EAET,YAAY;;EAEZ,gBAAgB;;EAEhB,UAAU;;EAEV,iBAAiB;;EAEjB,cAAc;;EAEd,OACE;;EAEF,SACE;CACJ;AACF,CAAC;;;AC/BD,MAAa,mBAAmB,GAAG;CACjC,OAAO;;EAEL,MAAM;GAEJ;GAEA;GAEA;EACF;;EAEA,SAAS,qBAAqB,MAAM;;EAEpC,aAAa;;EAEb,OAAO,qBAAqB,MAAM;;EAElC,MAAM;;EAEN,OAAO,qBAAqB,MAAM;;EAElC,cAAc,CAAC,qBAAqB,MAAM,cAAc,MAAM;;EAE9D,SAAS,qBAAqB,MAAM;CACtC;CACA,UAAU;EACR,YAAY,EACV,MAAM,EACJ,MAAM,uCACR,EACF;EACA,WAAW,EACT,MAAM;GACJ,MAAM;GACN,SAAS,qBAAqB,SAAS,QAAQ,KAAK;GACpD,OAAO,qBAAqB,SAAS,QAAQ,KAAK;GAClD,SAAS,qBAAqB,SAAS,QAAQ,KAAK;EACtD,EACF;CACF;AACF,CAAC;;;;;;;;ACbD,MAAa,YAAY,EACvB,YAAY,KAAA,GACZ,YAAY,cAAc,KAAA,GAC1B,OAAO,KAAA,GACP,YAAY,OACZ,aAAa,OACb,cAAc,KAAA,GACd,WAAW,KAAA,GACX,OACA,GAAG,YACgB;CACnB,MAAM,UAAU,WAAW;CAG3B,MAAM,WAAW,QAAQ,QAAQ,kBAAkB;EAAE;EAAY;CAAU,CAAC;CAC5E,MAAM,aAAa,QAAQ,qBACzB,UACA,eAAe,WACf,MACF;CAEA,OACE,oBAAC,cAAD;EACE,WAAW;EACE;EACb,UAAU;EACJ;EACN,SAA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CACM,CAAA;AAEjB;;;;ACpFA,MAAM,cAAc,EAClB,YAAY,KAAA,GACZ,SAAS,OACT,MACA,SACA,GAAG,wBACkB;CACrB,MAAM,EAAE,UAAU,gBAAgB;EAAE,GAAG;EAAmB;CAAK,CAAC;CAEhE,OACE,oBAAC,mBAAD;EACa;EACJ;EACC;EACC;CACV,CAAA;AAEL;;;ACtDA,IAAA,qBAAe"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/RadioBoxes/radioBoxesVariants.ts","../../src/RadioBoxes/subcomponents/radioBoxVariants.ts","../../src/RadioBoxes/subcomponents/RadioBox.tsx","../../src/RadioBoxes/subcomponents/RadioBoxesControl.tsx","../../src/RadioBoxes/RadioBoxes.tsx","../../src/RadioBoxes/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport radioGroupFieldVariants from '../partials/RadioGroupField/radioGroupFieldVariants';\n\nexport const radioBoxesVariants = tv({\n extend: radioGroupFieldVariants,\n slots: {\n /** Container for the field control and supporting text */\n base: [\n // Needs group for group-data condition.\n 'group',\n // Match shared field wrapper layout.\n 'flex w-full flex-col',\n ],\n /** Clickable option box */\n boxBase: '',\n /** Indicator marking the selected box */\n boxControl: '',\n /** Supporting text inside an option box */\n boxDescription: '',\n /** Primary option text */\n boxLabel: '',\n /** Container grouping option text */\n boxLabelWrapper: '',\n /** Container arranging the selectable content */\n wrapper:\n 'flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row',\n },\n variants: {\n readOnly: {\n true: {\n // drop hover feedback so read-only boxes do not look clickable\n boxBase: 'hover:bg-transparent',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof radioBoxesVariants>;\n\nexport type ClassName = TVClassName<typeof radioBoxesVariants>;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport radioControlVariants from '../../Radios/subcomponents/radioControlVariants';\n\nexport const radioBoxVariants = tv({\n slots: {\n /** Container for the field control and supporting text */\n base: [\n // option box layout\n 'group inline-flex flex-auto cursor-pointer items-center justify-between gap-4',\n // box border and padding\n 'rounded-lg border-2 border-default p-4',\n // hover and selection feedback\n 'hover:bg-content2 data-[selected=true]:border-focus',\n ],\n /** Dot marking the selected option */\n control: radioControlVariants.slots.control,\n /** Supporting text for the field */\n description: 'text-foreground opacity-70 text-small',\n /** Option state boundary without an additional layout box */\n field: radioControlVariants.slots.field,\n /** Decorative icon beside the option text */\n icon: '',\n /** Visible field label */\n label: radioControlVariants.slots.label,\n /** Container grouping the option label and description */\n labelWrapper: [radioControlVariants.slots.labelWrapper, 'grow'],\n /** Circular outline around the selection indicator */\n wrapper: radioControlVariants.slots.wrapper,\n },\n variants: {\n disabled: {\n true: {\n // keep pointer events so the disabled cursor shows, the input blocks changes\n base: 'cursor-not-allowed opacity-disabled **:cursor-not-allowed hover:bg-transparent',\n },\n },\n invalid: {\n true: {\n base: '!border-danger',\n control: radioControlVariants.variants.invalid.true.control,\n label: radioControlVariants.variants.invalid.true.label,\n wrapper: radioControlVariants.variants.invalid.true.wrapper,\n },\n },\n },\n});\n\nexport type ClassName = TVClassName<typeof radioBoxVariants>;\n","import type { ReactNode } from 'react';\nimport type { ClassName } from './radioBoxVariants';\n\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport RadioControl from '../../Radios/subcomponents/RadioControl';\nimport { radioBoxVariants } from './radioBoxVariants';\n\nexport interface RadioBoxProps {\n /** Option label. */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Legacy alias for className */\n classNames?: ClassName;\n /** HTML test ID for the option. */\n 'data-testid'?: string;\n /** Help text associated with the field */\n description?: ReactNode;\n /** Disables the option */\n disabled?: boolean;\n /** icon for the option */\n icon?: ReactNode;\n /** Marks the option as invalid */\n invalid?: boolean;\n /** String value managed by the containing radio group. */\n value: string;\n}\n\n/**\n * Selectable radio box with an icon, supporting text and selection indicator\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nexport const RadioBox = ({\n className = undefined,\n classNames: _classNames = undefined,\n icon = undefined,\n invalid = false,\n disabled = false,\n description = undefined,\n children = undefined,\n value,\n ...props\n}: RadioBoxProps) => {\n const styling = useStyling();\n\n // classNames from slots\n const variants = styling.resolve(radioBoxVariants, { disabled, invalid });\n const classNames = styling.variantsToClassNames(\n variants,\n _classNames ?? className,\n 'base',\n );\n\n return (\n <RadioControl\n className={classNames}\n description={description}\n disabled={disabled}\n icon={icon}\n invalid={invalid}\n testId={props['data-testid']}\n value={value}\n >\n {children}\n </RadioControl>\n );\n};\n\nexport default RadioBox;\n","import type { UniformField } from '../../hooks/useUniformField/types';\nimport type { RadioBoxesProps } from '../RadioBoxes';\n\nimport { Label } from 'react-aria-components';\n\nimport { slugify } from '@fuf-stack/pixel-utils';\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport { createOptionValueConverter } from '../../helpers';\nimport { getFieldControlProps } from '../../helpers/fieldProps/fieldProps';\nimport FieldLayout from '../../partials/FieldLayout/FieldLayout';\nimport RadioGroupField from '../../partials/RadioGroupField/RadioGroupField';\nimport { radioBoxesVariants } from '../radioBoxesVariants';\nimport { RadioBox } from './RadioBox';\n\ninterface RadioBoxesControlProps extends Pick<\n RadioBoxesProps,\n 'className' | 'inline' | 'options'\n> {\n /** Bound field values, interactions and metadata */\n field: UniformField<unknown, string | number | boolean>;\n}\n\n/**\n * Radio boxes with shared group layout and focus routing\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nconst RadioBoxesControl = ({\n field,\n className,\n inline = false,\n options,\n}: RadioBoxesControlProps) => {\n const {\n description,\n disabled,\n errorMessage,\n ids,\n ref: inputRef,\n invalid,\n label,\n name,\n onBlur,\n onChange: onValueChange,\n readOnly,\n required,\n testId,\n value,\n } = field;\n\n // associate the editable control with its label and messages\n const controlProps = getFieldControlProps(field);\n\n const styling = useStyling();\n\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = styling.resolve(radioBoxesVariants, { readOnly });\n const classNames = styling.variantsToClassNames(variants, className, 'base');\n\n // restore the selected option's original value type\n const handleChange = (nextValue: string) => {\n onValueChange(convertToOriginalType(nextValue));\n };\n\n return (\n <FieldLayout\n baseAs={RadioGroupField}\n baseProps={{\n controlProps,\n dataComponent: 'radio-boxes',\n disabled,\n inline,\n inputRef,\n invalid,\n name,\n onBlur,\n onChange: handleChange,\n readOnly,\n required,\n testId,\n value,\n }}\n className={classNames}\n description={description}\n errorMessage={errorMessage}\n ids={ids}\n invalid={invalid}\n label={label}\n labelAs={Label}\n required={required}\n >\n <div\n className={classNames.wrapper}\n data-orientation={inline ? 'horizontal' : 'vertical'}\n data-slot=\"wrapper\"\n >\n {options.map((option) => {\n if ('value' in option) {\n const optionTestId = slugify(\n `${testId}_option_${option.testId ?? option.value}`,\n { replaceDots: true },\n );\n return (\n <RadioBox\n key={String(option.value)}\n className={{\n base: classNames.boxBase,\n control: classNames.boxControl,\n description: classNames.boxDescription,\n label: classNames.boxLabel,\n labelWrapper: classNames.boxLabelWrapper,\n }}\n data-testid={optionTestId}\n description={option.description}\n disabled={!!disabled || option.disabled}\n icon={option.icon}\n invalid={invalid}\n value={String(option.value)}\n >\n {option.label ?? option.value}\n </RadioBox>\n );\n }\n return null;\n })}\n </div>\n </FieldLayout>\n );\n};\n\nexport default RadioBoxesControl;\n","import type { ReactNode } from 'react';\nimport type { ClassName, VariantProps } from './radioBoxesVariants';\n\nimport useUniformField from '../hooks/useUniformField/useUniformField';\nimport RadioBoxesControl from './subcomponents/RadioBoxesControl';\n\nexport { radioBoxesVariants } from './radioBoxesVariants';\n\nexport interface RadioBoxOption {\n /** Help text associated with the field */\n description?: ReactNode;\n /** Disables the field */\n disabled?: boolean;\n /** option icon */\n icon?: ReactNode;\n /** Field label */\n label?: ReactNode;\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n /** option value */\n value: string | number;\n}\n\nexport interface RadioBoxesProps extends VariantProps {\n /** Custom accessible name */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** Help text associated with the field */\n description?: ReactNode;\n /** Disables the field */\n disabled?: boolean;\n /** Arranges options horizontally */\n inline?: boolean;\n /** Field label */\n label?: ReactNode;\n /** Field name */\n name: string;\n /** Available options */\n options: RadioBoxOption[];\n /** Prevents changes while keeping the selection in validation and submission */\n readOnly?: boolean;\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n}\n\n/** Form selection field for one option displayed as a box */\nconst RadioBoxes = ({\n className = undefined,\n inline = false,\n name,\n options,\n ...uniformFieldProps\n}: RadioBoxesProps) => {\n const { field } = useUniformField({ ...uniformFieldProps, name });\n\n return (\n <RadioBoxesControl\n className={className}\n field={field}\n inline={inline}\n options={options}\n />\n );\n};\n\nexport default RadioBoxes;\n","import RadioBoxes from './RadioBoxes';\n\nexport type { RadioBoxesProps, RadioBoxOption } from './RadioBoxes';\n\nexport { radioBoxesVariants } from './radioBoxesVariants';\n\nexport { radioBoxVariants } from './subcomponents/radioBoxVariants';\n\nexport default RadioBoxes;\n"],"mappings":";;;;;;;;;;AAMA,MAAa,qBAAqB,GAAG;CACnC,QAAQ;CACR,OAAO;;EAEL,MAAM,CAEJ,SAEA,sBACF;;EAEA,SAAS;;EAET,YAAY;;EAEZ,gBAAgB;;EAEhB,UAAU;;EAEV,iBAAiB;;EAEjB,SACE;CACJ;CACA,UAAU,EACR,UAAU,EACR,MAAM,EAEJ,SAAS,uBACX,EACF,EACF;AACF,CAAC;;AChCD,MAAa,mBAAmB,GAAG;CACjC,OAAO;;EAEL,MAAM;GAEJ;GAEA;GAEA;EACF;;EAEA,SAAS,qBAAqB,MAAM;;EAEpC,aAAa;;EAEb,OAAO,qBAAqB,MAAM;;EAElC,MAAM;;EAEN,OAAO,qBAAqB,MAAM;;EAElC,cAAc,CAAC,qBAAqB,MAAM,cAAc,MAAM;;EAE9D,SAAS,qBAAqB,MAAM;CACtC;CACA,UAAU;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