@fuf-stack/uniform 1.28.0 → 2.0.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -35
- package/dist/Checkboxes/index.d.mts +192 -263
- package/dist/Checkboxes/index.d.mts.map +1 -1
- package/dist/Checkboxes/index.mjs +294 -90
- package/dist/Checkboxes/index.mjs.map +1 -1
- package/dist/DatePicker/index.d.mts +1278 -496
- package/dist/DatePicker/index.d.mts.map +1 -1
- package/dist/DatePicker/index.mjs +403 -83
- package/dist/DatePicker/index.mjs.map +1 -1
- package/dist/FieldArray/index.d.mts +105 -98
- package/dist/FieldArray/index.d.mts.map +1 -1
- package/dist/FieldArray/index.mjs +344 -195
- package/dist/FieldArray/index.mjs.map +1 -1
- package/dist/FieldCard/index.d.mts +37 -35
- package/dist/FieldCard/index.d.mts.map +1 -1
- package/dist/FieldCard/index.mjs +187 -128
- package/dist/FieldCard/index.mjs.map +1 -1
- package/dist/{FieldCopyTestIdButton-9xTF-DBW.mjs → FieldCopyTestIdButton-DV0tkdh2.mjs} +4 -2
- package/dist/FieldCopyTestIdButton-DV0tkdh2.mjs.map +1 -0
- package/dist/FieldDescription-C4l0HKGL.mjs +36 -0
- package/dist/FieldDescription-C4l0HKGL.mjs.map +1 -0
- package/dist/FieldLabel-DKzqkuY1.mjs +125 -0
- package/dist/FieldLabel-DKzqkuY1.mjs.map +1 -0
- package/dist/FieldLayout-BLW5S-Jm.mjs +46 -0
- package/dist/FieldLayout-BLW5S-Jm.mjs.map +1 -0
- package/dist/FieldValidationError-DgkCL3cC.mjs +77 -0
- package/dist/FieldValidationError-DgkCL3cC.mjs.map +1 -0
- package/dist/Form/index.d.mts +12 -12
- package/dist/Form/index.d.mts.map +1 -1
- package/dist/Form/index.mjs +9 -7
- package/dist/Form/index.mjs.map +1 -1
- package/dist/{FormContext-CB7Glm02.mjs → FormContext-CHctWFAP.mjs} +51 -8
- package/dist/FormContext-CHctWFAP.mjs.map +1 -0
- package/dist/FormContext-CsFiNvuJ.d.mts.map +1 -1
- package/dist/Grid/index.mjs +1 -2
- package/dist/{Grid-CTs-Rb9G.mjs → Grid-DfcZeuib.mjs} +4 -2
- package/dist/Grid-DfcZeuib.mjs.map +1 -0
- package/dist/Input/index.d.mts +638 -394
- package/dist/Input/index.d.mts.map +1 -1
- package/dist/Input/index.mjs +414 -165
- package/dist/Input/index.mjs.map +1 -1
- package/dist/RadioBoxes/index.d.mts +1588 -125
- package/dist/RadioBoxes/index.d.mts.map +1 -1
- package/dist/RadioBoxes/index.mjs +159 -114
- package/dist/RadioBoxes/index.mjs.map +1 -1
- package/dist/RadioTabs/index.d.mts +300 -81
- package/dist/RadioTabs/index.d.mts.map +1 -1
- package/dist/RadioTabs/index.mjs +277 -86
- package/dist/RadioTabs/index.mjs.map +1 -1
- package/dist/Radios/index.d.mts +1354 -109
- package/dist/Radios/index.d.mts.map +1 -1
- package/dist/Radios/index.mjs +105 -54
- package/dist/Radios/index.mjs.map +1 -1
- package/dist/Select/index.d.mts +554 -3009
- package/dist/Select/index.d.mts.map +1 -1
- package/dist/Select/index.mjs +319 -177
- package/dist/Select/index.mjs.map +1 -1
- package/dist/Slider/index.d.mts +416 -1328
- package/dist/Slider/index.d.mts.map +1 -1
- package/dist/Slider/index.mjs +276 -94
- package/dist/Slider/index.mjs.map +1 -1
- package/dist/SubmitButton/index.d.mts.map +1 -1
- package/dist/SubmitButton/index.mjs +4 -1
- package/dist/SubmitButton/index.mjs.map +1 -1
- package/dist/Switch/index.d.mts +2 -1248
- package/dist/Switch/index.mjs +167 -68
- package/dist/Switch/index.mjs.map +1 -1
- package/dist/Switch-CvPO8IF9.d.mts +601 -0
- package/dist/Switch-CvPO8IF9.d.mts.map +1 -0
- package/dist/SwitchBox/index.d.mts +135 -39
- package/dist/SwitchBox/index.d.mts.map +1 -1
- package/dist/SwitchBox/index.mjs +142 -87
- package/dist/SwitchBox/index.mjs.map +1 -1
- package/dist/TextArea/index.d.mts +295 -411
- package/dist/TextArea/index.d.mts.map +1 -1
- package/dist/TextArea/index.mjs +200 -48
- package/dist/TextArea/index.mjs.map +1 -1
- package/dist/Time/index.d.mts +1170 -601
- package/dist/Time/index.d.mts.map +1 -1
- package/dist/Time/index.mjs +162 -74
- package/dist/Time/index.mjs.map +1 -1
- package/dist/helpers/index.d.mts +1 -1
- package/dist/helpers/index.mjs +1 -1
- package/dist/helpers/index.mjs.map +1 -1
- package/dist/hooks/useClientValidation/index.mjs +1 -1
- package/dist/hooks/useController/index.d.mts +31 -3
- package/dist/hooks/useController/index.d.mts.map +1 -0
- package/dist/hooks/useController/index.mjs +1 -2
- package/dist/hooks/useFormContext/index.d.mts +65 -3
- package/dist/hooks/useFormContext/index.d.mts.map +1 -0
- package/dist/hooks/useFormContext/index.mjs +1 -2
- package/dist/hooks/useInputValueDebounce/index.d.mts +11 -5
- package/dist/hooks/useInputValueDebounce/index.d.mts.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.mjs +27 -5
- package/dist/hooks/useInputValueDebounce/index.mjs.map +1 -1
- package/dist/hooks/useInputValueTransform/index.d.mts +1 -2
- package/dist/hooks/useInputValueTransform/index.mjs +1 -2
- package/dist/hooks/useWatchFormReset/index.mjs +1 -1
- package/dist/hooks/useWatchUserChange/index.d.mts +2 -2
- package/dist/hooks/useWatchUserChange/index.d.mts.map +1 -1
- package/dist/hooks/useWatchUserChange/index.mjs +1 -1
- package/dist/hooks/useWatchUserChange/index.mjs.map +1 -1
- package/dist/{useInputValueTransform-LOaEim7k.d.mts → index-BS8IoBOn.d.mts} +3 -3
- package/dist/index-BS8IoBOn.d.mts.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.mjs +1 -2
- package/dist/partials/FieldValidationError/index.d.mts +637 -3
- package/dist/partials/FieldValidationError/index.d.mts.map +1 -1
- package/dist/partials/FieldValidationError/index.mjs +1 -2
- package/dist/radioControlVariants-Cm6WufWo.mjs +188 -0
- package/dist/radioControlVariants-Cm6WufWo.mjs.map +1 -0
- package/dist/switchVariants-BaQw2DA7.mjs +67 -0
- package/dist/switchVariants-BaQw2DA7.mjs.map +1 -0
- package/dist/timeVariants-B9HDfNYt.mjs +58 -0
- package/dist/timeVariants-B9HDfNYt.mjs.map +1 -0
- package/dist/{useController-BBSbeKbn.mjs → useController-BCFeZbBZ.mjs} +2 -2
- package/dist/{useController-BBSbeKbn.mjs.map → useController-BCFeZbBZ.mjs.map} +1 -1
- package/dist/{useFormContext-DNb_B8LQ.mjs → useFormContext-BPjJjNnM.mjs} +2 -2
- package/dist/{useFormContext-DNb_B8LQ.mjs.map → useFormContext-BPjJjNnM.mjs.map} +1 -1
- package/dist/{useInputValueTransform-DJ5zkqSy.mjs → useInputValueTransform-Mw8YEOXT.mjs} +2 -2
- package/dist/{useInputValueTransform-DJ5zkqSy.mjs.map → useInputValueTransform-Mw8YEOXT.mjs.map} +1 -1
- package/package.json +17 -29
- package/dist/FieldCopyTestIdButton-9xTF-DBW.mjs.map +0 -1
- package/dist/FieldValidationError-ByRoIxaM.mjs +0 -50
- package/dist/FieldValidationError-ByRoIxaM.mjs.map +0 -1
- package/dist/FormContext-CB7Glm02.mjs.map +0 -1
- package/dist/Grid-CTs-Rb9G.mjs.map +0 -1
- package/dist/Switch/index.d.mts.map +0 -1
- package/dist/hooks/useInput/index.d.mts +0 -2
- package/dist/hooks/useInput/index.mjs +0 -7
- package/dist/hooks/useInput/index.mjs.map +0 -1
- package/dist/hooks/useUniformField/index.d.mts +0 -100
- package/dist/hooks/useUniformField/index.d.mts.map +0 -1
- package/dist/hooks/useUniformField/index.mjs +0 -139
- package/dist/hooks/useUniformField/index.mjs.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.d.mts +0 -73
- package/dist/hooks/useUniformFieldArray/index.d.mts.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.mjs +0 -101
- package/dist/hooks/useUniformFieldArray/index.mjs.map +0 -1
- package/dist/index-CAdGtKE_.d.mts +0 -1
- package/dist/index-CaxrMD1A.d.mts +0 -1
- package/dist/index-CwJo1b4Z.d.mts +0 -1
- package/dist/useController-DcK2YHbw.d.mts +0 -32
- package/dist/useController-DcK2YHbw.d.mts.map +0 -1
- package/dist/useFormContext-BegmYvGA.d.mts +0 -66
- package/dist/useFormContext-BegmYvGA.d.mts.map +0 -1
- package/dist/useInput-C0aJaAGe.mjs +0 -2
- package/dist/useInput-ClpHDPdr.d.mts +0 -2
- package/dist/useInputValueTransform-LOaEim7k.d.mts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/Checkboxes/Checkboxes.tsx"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../../src/Checkboxes/checkboxesVariants.ts","../../src/Checkboxes/Checkboxes.tsx"],"mappings":";;;;qBAuCa,sBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAsFnB,eAAe,eAAe;KAE9B,YAAY,mBAAmB;;;UCtH1B;;EAEf;;EAEA,QAAQ;;EAER,eAAe;;EAEf,OAAO;;EAEP;;EAEA;;UAGQ;;EAER,UAAU;;EAEV,QAAQ;;EAER;;IAEE;;IAEA;;IAEA;;;UAIa;;EAEf;;EAEA,YAAY,SAAS,wBAAwB;;EAE7C,YAAY;;EAEZ,QAAQ;;EAER,cAAc;;EAEd;;EAEA;;EAEA,QAAQ;;EAER;;EAEA;;EAEA,SAAS;;EAET;;EAEA,YAAY;;;cAIR,eAAc,UAAA,WAAA,OAAA,QAAA,aAAA,MAAA,YAAA,qBASjB,oCAAe,IAAA"}
|
|
@@ -1,119 +1,323 @@
|
|
|
1
|
-
import { useUniformField } from "../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
|
|
1
|
+
import { n as useUniformField } from "../FieldLabel-DKzqkuY1.mjs";
|
|
2
|
+
import { n as getFieldControlProps } from "../FieldDescription-C4l0HKGL.mjs";
|
|
3
|
+
import { t as FieldLayout } from "../FieldLayout-BLW5S-Jm.mjs";
|
|
4
|
+
import { useId } from "react";
|
|
5
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
+
import { slugify, tv } from "@fuf-stack/pixel-utils";
|
|
7
|
+
import { useStyling } from "@fuf-stack/pixels/StylingProvider";
|
|
8
|
+
import { CheckboxButton, CheckboxField, CheckboxGroup, Label } from "react-aria-components";
|
|
9
|
+
//#region src/Checkboxes/checkboxesVariants.ts
|
|
10
|
+
const checkboxColorVariants = tv({
|
|
11
|
+
slots: { wrapper: "" },
|
|
12
|
+
variants: { color: {
|
|
13
|
+
danger: { wrapper: "text-danger-foreground after:bg-danger after:text-danger-foreground" },
|
|
14
|
+
default: { wrapper: "text-default-foreground after:bg-default after:text-default-foreground" },
|
|
15
|
+
info: { wrapper: "text-info-foreground after:bg-info after:text-info-foreground" },
|
|
16
|
+
primary: { wrapper: "text-primary-foreground after:bg-primary after:text-primary-foreground" },
|
|
17
|
+
secondary: { wrapper: "text-secondary-foreground after:bg-secondary after:text-secondary-foreground" },
|
|
18
|
+
success: { wrapper: "text-success-foreground after:bg-success after:text-success-foreground" },
|
|
19
|
+
warning: { wrapper: "text-warning-foreground after:bg-warning after:text-warning-foreground" }
|
|
20
|
+
} }
|
|
21
|
+
});
|
|
7
22
|
const checkboxesVariants = tv({
|
|
23
|
+
extend: checkboxColorVariants,
|
|
8
24
|
slots: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
25
|
+
/** Container for the field control and supporting text */
|
|
26
|
+
base: ["group flex w-full flex-col gap-y-1.5", "relative"],
|
|
27
|
+
/** Supporting text for the field */
|
|
28
|
+
description: "text-foreground-400 text-small",
|
|
29
|
+
/** Container for validation messages */
|
|
30
|
+
errorMessage: ["text-tiny", "text-danger text-small"],
|
|
31
|
+
/** Container for help text and validation messages */
|
|
32
|
+
helperWrapper: "relative block p-0",
|
|
33
|
+
/** Visible field label */
|
|
34
|
+
label: ["inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger", "relative"],
|
|
35
|
+
/** Clickable checkbox option */
|
|
36
|
+
optionBase: [
|
|
37
|
+
"",
|
|
38
|
+
"group relative -m-2 inline-flex max-w-fit cursor-pointer select-none items-center justify-start p-2 tap-highlight-transparent",
|
|
39
|
+
"data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-disabled"
|
|
40
|
+
],
|
|
41
|
+
/** Checkmark inside the selection indicator */
|
|
42
|
+
optionIcon: [
|
|
43
|
+
"",
|
|
44
|
+
"pointer-events-none z-10 h-3 w-4 opacity-0 transition-opacity",
|
|
45
|
+
"group-data-[selected=true]:opacity-100",
|
|
46
|
+
"motion-reduce:transition-none"
|
|
13
47
|
],
|
|
14
|
-
|
|
15
|
-
label: "inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger",
|
|
16
|
-
optionBase: "",
|
|
17
|
-
optionIcon: "",
|
|
48
|
+
/** Primary option text */
|
|
18
49
|
optionLabel: "",
|
|
50
|
+
/** Additional text below the option label */
|
|
19
51
|
optionLabelSubline: "text-foreground-400 !text-small",
|
|
20
|
-
|
|
21
|
-
|
|
52
|
+
/** Outline and fill around the checkmark */
|
|
53
|
+
optionWrapper: [
|
|
54
|
+
"",
|
|
55
|
+
"relative me-2 inline-flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden rounded-[calc(var(--pixel-radius-medium)*0.6)] transition-transform",
|
|
56
|
+
"before:absolute before:inset-0 before:box-border before:rounded-[inherit] before:border-2 before:border-solid before:border-default before:transition-colors before:content-['']",
|
|
57
|
+
"after:absolute after:inset-0 after:origin-center after:scale-50 after:rounded-[inherit] after:opacity-0 after:duration-200 after:ease-linear after:content-[''] after:transition-transform-opacity",
|
|
58
|
+
"group-data-[pressed=true]:scale-95",
|
|
59
|
+
"group-data-[focus-visible=true]:ring-2 group-data-[focus-visible=true]:ring-focus group-data-[focus-visible=true]:ring-offset-2 group-data-[focus-visible=true]:ring-offset-background",
|
|
60
|
+
"group-data-[hover=true]:before:bg-default-100 group-data-[selected=true]:after:scale-100 group-data-[selected=true]:after:opacity-100",
|
|
61
|
+
"motion-reduce:transition-none"
|
|
62
|
+
],
|
|
63
|
+
/** Container arranging the selectable content */
|
|
64
|
+
wrapper: ["", "flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row"]
|
|
22
65
|
},
|
|
23
66
|
variants: {
|
|
24
|
-
color: {
|
|
25
|
-
info: { wrapper: "text-info-foreground after:bg-info after:text-info-foreground" },
|
|
26
|
-
...checkbox.variants.color
|
|
27
|
-
},
|
|
28
67
|
lineThrough: { true: {
|
|
29
|
-
optionLabel: [
|
|
68
|
+
optionLabel: [
|
|
69
|
+
"inline-flex items-center justify-center",
|
|
70
|
+
"before:absolute before:h-0.5 before:w-0 before:bg-foreground before:content-['']",
|
|
71
|
+
"group-data-[selected=true]:opacity-60 group-data-[selected=true]:before:w-full",
|
|
72
|
+
"relative before:transition-all before:duration-200"
|
|
73
|
+
],
|
|
30
74
|
optionLabelSubline: "group-data-[selected=true]:opacity-60"
|
|
75
|
+
} },
|
|
76
|
+
invalid: { true: {
|
|
77
|
+
optionLabel: "text-danger",
|
|
78
|
+
optionWrapper: "before:border-danger"
|
|
31
79
|
} }
|
|
32
80
|
}
|
|
33
81
|
});
|
|
82
|
+
const checkboxOptionVariants = tv({
|
|
83
|
+
extend: checkboxColorVariants,
|
|
84
|
+
slots: {
|
|
85
|
+
/** Option field context without an additional layout box */
|
|
86
|
+
field: "contents",
|
|
87
|
+
/** Container for the option label and optional subline */
|
|
88
|
+
label: "relative select-none text-foreground transition-colors-opacity text-medium before:transition-width motion-reduce:transition-none"
|
|
89
|
+
},
|
|
90
|
+
variants: { invalid: { true: { label: "text-danger" } } }
|
|
91
|
+
});
|
|
92
|
+
//#endregion
|
|
93
|
+
//#region src/Checkboxes/subcomponents/CheckboxIndicator.tsx
|
|
94
|
+
/** Checkbox selection indicator with an animated checkmark */
|
|
95
|
+
const CheckboxIndicator = ({ className, selected }) => {
|
|
96
|
+
return /* @__PURE__ */ jsx("span", {
|
|
97
|
+
"aria-hidden": true,
|
|
98
|
+
className: className.wrapper,
|
|
99
|
+
"data-slot": "wrapper",
|
|
100
|
+
children: /* @__PURE__ */ jsx("svg", {
|
|
101
|
+
"aria-hidden": true,
|
|
102
|
+
className: className.icon,
|
|
103
|
+
"data-slot": "icon",
|
|
104
|
+
fill: "none",
|
|
105
|
+
role: "presentation",
|
|
106
|
+
stroke: "currentColor",
|
|
107
|
+
strokeDasharray: 22,
|
|
108
|
+
strokeDashoffset: selected ? 44 : 66,
|
|
109
|
+
strokeLinecap: "round",
|
|
110
|
+
strokeLinejoin: "round",
|
|
111
|
+
strokeWidth: 2,
|
|
112
|
+
viewBox: "0 0 17 18",
|
|
113
|
+
children: /* @__PURE__ */ jsx("polyline", {
|
|
114
|
+
className: "transition-[stroke-dashoffset] delay-200 duration-250 ease-linear motion-reduce:transition-none",
|
|
115
|
+
points: "1 9 7 14 15 4"
|
|
116
|
+
})
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
//#endregion
|
|
121
|
+
//#region src/Checkboxes/subcomponents/CheckboxLabel.tsx
|
|
122
|
+
/** Checkbox option text with an optional supporting line and accessible-name IDs */
|
|
123
|
+
const CheckboxLabel = ({ className, id, label, labelSubline }) => {
|
|
124
|
+
return /* @__PURE__ */ jsx("span", {
|
|
125
|
+
className: className.base,
|
|
126
|
+
"data-slot": "label",
|
|
127
|
+
id: `${id}-label`,
|
|
128
|
+
children: labelSubline ? /* @__PURE__ */ jsxs("div", {
|
|
129
|
+
className: "flex grow flex-col items-start",
|
|
130
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
131
|
+
className: className.label,
|
|
132
|
+
id: `${id}-label-text`,
|
|
133
|
+
children: label
|
|
134
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
135
|
+
className: className.subline,
|
|
136
|
+
id: `${id}-subline`,
|
|
137
|
+
children: labelSubline
|
|
138
|
+
})]
|
|
139
|
+
}) : label
|
|
140
|
+
});
|
|
141
|
+
};
|
|
142
|
+
//#endregion
|
|
143
|
+
//#region src/Checkboxes/subcomponents/CheckboxControl.tsx
|
|
34
144
|
/**
|
|
35
|
-
*
|
|
145
|
+
* Checkbox option with an animated indicator, label and optional subline
|
|
146
|
+
*
|
|
147
|
+
* @see https://react-aria.adobe.com/Checkbox
|
|
36
148
|
*/
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
149
|
+
const CheckboxControl = ({ className: classNames, color, describedBy, disabled, invalid, option, testId }) => {
|
|
150
|
+
const id = useId();
|
|
151
|
+
const styling = useStyling();
|
|
152
|
+
const hasSubline = !!option.labelSubline;
|
|
153
|
+
const hasLabel = !!option.label || hasSubline;
|
|
154
|
+
const labelledBy = hasSubline ? `${id}-label-text ${id}-subline` : `${id}-label`;
|
|
155
|
+
const variants = styling.resolve(checkboxOptionVariants, {
|
|
156
|
+
color,
|
|
157
|
+
invalid
|
|
42
158
|
});
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const classNames = variantsToClassNames(variants, className, "base");
|
|
46
|
-
const heroCheckboxGroupClassNames = {
|
|
47
|
-
base: classNames.base,
|
|
48
|
-
label: classNames.label,
|
|
49
|
-
wrapper: classNames.wrapper
|
|
50
|
-
};
|
|
51
|
-
const heroCheckboxClassNames = {
|
|
52
|
-
base: classNames.optionBase,
|
|
53
|
-
icon: classNames.optionIcon,
|
|
54
|
-
label: classNames.optionLabel,
|
|
159
|
+
const optionClassNames = styling.variantsToClassNames(variants, {
|
|
160
|
+
label: hasSubline ? void 0 : classNames.optionLabel,
|
|
55
161
|
wrapper: classNames.optionWrapper
|
|
162
|
+
});
|
|
163
|
+
const renderOption = (props, state) => {
|
|
164
|
+
return /* @__PURE__ */ jsx("label", {
|
|
165
|
+
...props,
|
|
166
|
+
"data-focus": state.isFocused || void 0,
|
|
167
|
+
"data-hover": state.isHovered || void 0,
|
|
168
|
+
"data-invalid": invalid,
|
|
169
|
+
htmlFor: id,
|
|
170
|
+
children: props.children
|
|
171
|
+
});
|
|
56
172
|
};
|
|
173
|
+
return /* @__PURE__ */ jsx(CheckboxField, {
|
|
174
|
+
"aria-describedby": describedBy,
|
|
175
|
+
"aria-invalid": invalid || void 0,
|
|
176
|
+
"aria-label": typeof option.label === "string" ? option.label : option.value,
|
|
177
|
+
"aria-labelledby": hasLabel ? labelledBy : void 0,
|
|
178
|
+
className: optionClassNames.field,
|
|
179
|
+
id,
|
|
180
|
+
isDisabled: disabled,
|
|
181
|
+
isRequired: false,
|
|
182
|
+
validationBehavior: "aria",
|
|
183
|
+
value: option.value,
|
|
184
|
+
children: /* @__PURE__ */ jsx(CheckboxButton, {
|
|
185
|
+
className: classNames.optionBase,
|
|
186
|
+
"data-testid": testId,
|
|
187
|
+
render: renderOption,
|
|
188
|
+
children: ({ isSelected }) => {
|
|
189
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CheckboxIndicator, {
|
|
190
|
+
className: {
|
|
191
|
+
icon: classNames.optionIcon,
|
|
192
|
+
wrapper: optionClassNames.wrapper
|
|
193
|
+
},
|
|
194
|
+
selected: isSelected
|
|
195
|
+
}), hasLabel ? /* @__PURE__ */ jsx(CheckboxLabel, {
|
|
196
|
+
className: {
|
|
197
|
+
base: optionClassNames.label,
|
|
198
|
+
label: classNames.optionLabel,
|
|
199
|
+
subline: classNames.optionLabelSubline
|
|
200
|
+
},
|
|
201
|
+
id,
|
|
202
|
+
label: option.label,
|
|
203
|
+
labelSubline: option.labelSubline
|
|
204
|
+
}) : null] });
|
|
205
|
+
}
|
|
206
|
+
})
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
//#endregion
|
|
210
|
+
//#region src/Checkboxes/subcomponents/CheckboxesControl.tsx
|
|
211
|
+
/**
|
|
212
|
+
* Checkbox group presentation with option composition and focus routing
|
|
213
|
+
*
|
|
214
|
+
* @see https://react-aria.adobe.com/CheckboxGroup
|
|
215
|
+
*/
|
|
216
|
+
const CheckboxesControl = ({ field, children, className, color = "primary", inline = false, lineThrough, options }) => {
|
|
217
|
+
const { description, disabled, errorMessage, ids, ref: inputRef, invalid, label, name, onBlur, onChange: onValueChange, required, testId } = field;
|
|
218
|
+
const controlProps = getFieldControlProps(field);
|
|
219
|
+
const styling = useStyling();
|
|
220
|
+
const value = Array.isArray(field.value) ? field.value : [];
|
|
221
|
+
const variants = styling.resolve(checkboxesVariants, {
|
|
222
|
+
lineThrough,
|
|
223
|
+
invalid
|
|
224
|
+
});
|
|
225
|
+
const classNames = styling.variantsToClassNames(variants, className, "base");
|
|
226
|
+
const associations = controlProps;
|
|
227
|
+
const describedBy = [associations["aria-describedby"], required ? `${ids.control}-required` : void 0].filter(Boolean).join(" ") || void 0;
|
|
57
228
|
const renderedOptions = options?.map((option) => {
|
|
58
|
-
const
|
|
59
|
-
const hasSubline = !!option.labelSubline;
|
|
60
|
-
let labelContent;
|
|
61
|
-
let optionClassNames = heroCheckboxClassNames;
|
|
62
|
-
if (hasSubline) {
|
|
63
|
-
labelContent = /* @__PURE__ */ jsxs("div", {
|
|
64
|
-
className: "flex grow flex-col items-start",
|
|
65
|
-
children: [/* @__PURE__ */ jsx("span", {
|
|
66
|
-
className: classNames.optionLabel,
|
|
67
|
-
children: option.label
|
|
68
|
-
}), /* @__PURE__ */ jsx("span", {
|
|
69
|
-
className: classNames.optionLabelSubline,
|
|
70
|
-
children: option.labelSubline
|
|
71
|
-
})]
|
|
72
|
-
});
|
|
73
|
-
optionClassNames = {
|
|
74
|
-
...optionClassNames,
|
|
75
|
-
label: ""
|
|
76
|
-
};
|
|
77
|
-
} else labelContent = option.label;
|
|
78
|
-
const optionIsDisabled = !!disabled || !!option.disabled;
|
|
229
|
+
const optionDisabled = !!disabled || !!option.disabled;
|
|
79
230
|
return {
|
|
80
|
-
checkbox: /* @__PURE__ */ jsx(Checkbox, {
|
|
81
|
-
"aria-label": typeof option.label === "string" ? option.label : option.value,
|
|
82
|
-
classNames: optionClassNames,
|
|
83
|
-
"data-invalid": invalid,
|
|
84
|
-
"data-testid": optionTestId,
|
|
85
|
-
isDisabled: optionIsDisabled,
|
|
86
|
-
value: option?.value,
|
|
87
|
-
children: labelContent
|
|
88
|
-
}, `index_${option.value}`),
|
|
89
231
|
option,
|
|
90
232
|
state: {
|
|
91
233
|
checked: value.includes(option.value),
|
|
92
|
-
disabled:
|
|
234
|
+
disabled: optionDisabled,
|
|
93
235
|
invalid: !!invalid
|
|
94
|
-
}
|
|
236
|
+
},
|
|
237
|
+
checkbox: /* @__PURE__ */ jsx(CheckboxControl, {
|
|
238
|
+
className: classNames,
|
|
239
|
+
color: color === "info" ? "primary" : color,
|
|
240
|
+
describedBy,
|
|
241
|
+
disabled: optionDisabled,
|
|
242
|
+
invalid,
|
|
243
|
+
option,
|
|
244
|
+
testId: slugify(`${testId}_option_${option.testId ?? option.value}`, { replaceDots: true })
|
|
245
|
+
}, `index_${option.value}`)
|
|
95
246
|
};
|
|
96
247
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
"
|
|
248
|
+
const handleControlRef = (node) => {
|
|
249
|
+
inputRef(node ? { focus: () => {
|
|
250
|
+
node.querySelector("input:not(:disabled)")?.focus();
|
|
251
|
+
} } : null);
|
|
252
|
+
};
|
|
253
|
+
const renderGroup = (props) => {
|
|
254
|
+
return /* @__PURE__ */ jsx("div", {
|
|
255
|
+
...props,
|
|
256
|
+
"aria-invalid": invalid || void 0,
|
|
257
|
+
"data-invalid": invalid,
|
|
258
|
+
"data-required": required,
|
|
259
|
+
children: props.children
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
return /* @__PURE__ */ jsxs(FieldLayout, {
|
|
263
|
+
baseAs: CheckboxGroup,
|
|
264
|
+
baseProps: {
|
|
265
|
+
"aria-describedby": describedBy,
|
|
266
|
+
"aria-label": associations["aria-label"],
|
|
267
|
+
"data-component": "checkboxes",
|
|
268
|
+
"data-slot": "base",
|
|
269
|
+
"data-testid": testId,
|
|
270
|
+
id: associations.id,
|
|
271
|
+
isDisabled: disabled,
|
|
272
|
+
isInvalid: invalid,
|
|
273
|
+
isRequired: required,
|
|
274
|
+
name,
|
|
275
|
+
onBlur,
|
|
276
|
+
onChange: onValueChange,
|
|
277
|
+
ref: handleControlRef,
|
|
278
|
+
render: renderGroup,
|
|
279
|
+
validationBehavior: "aria",
|
|
280
|
+
value
|
|
281
|
+
},
|
|
282
|
+
className: classNames,
|
|
283
|
+
description,
|
|
104
284
|
errorMessage,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
285
|
+
ids,
|
|
286
|
+
invalid,
|
|
287
|
+
label,
|
|
288
|
+
labelAs: Label,
|
|
289
|
+
required,
|
|
290
|
+
children: [required ? /* @__PURE__ */ jsx("span", {
|
|
291
|
+
className: "sr-only",
|
|
292
|
+
id: `${ids.control}-required`,
|
|
293
|
+
children: "Required selection."
|
|
294
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
295
|
+
className: classNames.wrapper,
|
|
296
|
+
"data-orientation": inline ? "horizontal" : "vertical",
|
|
297
|
+
"data-slot": "wrapper",
|
|
298
|
+
children: children ? children(renderedOptions ?? []) : renderedOptions?.map(({ checkbox }) => {
|
|
299
|
+
return checkbox;
|
|
300
|
+
})
|
|
301
|
+
})]
|
|
302
|
+
});
|
|
303
|
+
};
|
|
304
|
+
//#endregion
|
|
305
|
+
//#region src/Checkboxes/Checkboxes.tsx
|
|
306
|
+
/** Form selection field for multiple checkbox options */
|
|
307
|
+
const Checkboxes = ({ children = void 0, className = void 0, color = "primary", inline = false, lineThrough = false, name, options, ...uniformFieldProps }) => {
|
|
308
|
+
const { field } = useUniformField({
|
|
309
|
+
...uniformFieldProps,
|
|
310
|
+
isArrayValue: true,
|
|
311
|
+
name
|
|
312
|
+
});
|
|
313
|
+
return /* @__PURE__ */ jsx(CheckboxesControl, {
|
|
314
|
+
className,
|
|
315
|
+
color,
|
|
316
|
+
field,
|
|
317
|
+
inline,
|
|
318
|
+
lineThrough,
|
|
319
|
+
options,
|
|
320
|
+
children
|
|
117
321
|
});
|
|
118
322
|
};
|
|
119
323
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["heroCheckboxVariants","HeroCheckbox","HeroCheckboxGroup"],"sources":["../../src/Checkboxes/Checkboxes.tsx","../../src/Checkboxes/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type {\n CheckboxGroupProps as HeroCheckboxGroupProps,\n CheckboxProps as HeroCheckboxProps,\n} from '@heroui/checkbox';\nimport type { ReactNode } from 'react';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\n\nimport {\n Checkbox as HeroCheckbox,\n CheckboxGroup as HeroCheckboxGroup,\n} from '@heroui/checkbox';\nimport { checkbox as heroCheckboxVariants } from '@heroui/theme';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const checkboxesVariants = tv({\n slots: {\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/group consistent.\n 'gap-y-1.5',\n ],\n errorMessage: 'text-tiny',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger',\n optionBase: '',\n optionIcon: '',\n optionLabel: '',\n optionLabelSubline: 'text-foreground-400 !text-small',\n optionWrapper: '',\n wrapper: '',\n },\n variants: {\n // see: https://github.com/heroui-inc/heroui/blob/canary/packages/core/theme/src/components/checkbox.ts\n color: {\n info: {\n wrapper:\n 'text-info-foreground after:bg-info after:text-info-foreground',\n },\n ...heroCheckboxVariants.variants.color,\n } as const,\n lineThrough: {\n true: {\n optionLabel: [\n ...heroCheckboxVariants.variants.lineThrough.true.label,\n // fix stroke position when used with subline and enable animation\n 'relative before:transition-all before:duration-200',\n ],\n optionLabelSubline: 'group-data-[selected=true]:opacity-60',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof checkboxesVariants>;\ntype ClassName = TVClassName<typeof checkboxesVariants>;\n\nexport interface CheckboxOption {\n /** option label */\n label?: ReactNode;\n /** subline displayed below the label */\n labelSubline?: ReactNode;\n /** Arbitrary option metadata for custom render logic. */\n meta?: Record<string, unknown>;\n /** option value */\n value: string;\n /** disables the option */\n disabled?: boolean;\n /** HTML data-testid attribute of the option */\n testId?: string;\n}\n\ninterface ChildRenderOption {\n /** Prebuilt checkbox element so consumers don't need to recreate HeroCheckbox */\n checkbox: ReactNode;\n /** Option data as provided in `options` */\n option: CheckboxOption;\n /** Render-state flags for this option */\n state: {\n /** Whether this option is currently selected */\n checked: boolean;\n /** Whether this option is disabled */\n disabled: boolean;\n /** Whether the checkbox group is invalid */\n invalid: boolean;\n };\n}\n\nexport interface CheckboxesProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** Optional child render function for custom full-list layout rendering. */\n children?: (options: ChildRenderOption[]) => ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the checkboxes */\n color?: VariantProps['color'];\n /** Sets all checkboxes disabled */\n disabled?: boolean;\n /** Orientation of the checkboxes */\n inline?: boolean;\n /** Label displayed above the checkboxes */\n label?: ReactNode;\n /** Whether the checkboxes label should be crossed out */\n lineThrough?: boolean;\n /** Name the Field is registered on the form */\n name: string;\n /** Checkboxes that should be displayed. */\n options: CheckboxOption[];\n\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** allows disentangled display and form values for a field */\n transform?: InputValueTransform<string[]>;\n}\n\n/**\n * Checkboxes component based on [HeroUI CheckboxGroup](https://www.heroui.com//docs/components/checkbox-group)\n */\nconst Checkboxes = ({\n children = undefined,\n className = undefined,\n color = 'primary',\n inline = false,\n lineThrough = false,\n name,\n options,\n ...uniformFieldProps\n}: CheckboxesProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onChange, value: fieldValue, ref, onBlur },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n // Checkbox group values are arrays and can produce nested RHF error shapes.\n isArrayValue: true,\n name,\n ...uniformFieldProps,\n });\n\n // Ensure value is always an array (checkboxes need arrays)\n const value = Array.isArray(fieldValue) ? (fieldValue as string[]) : [];\n\n // classNames from slots\n const variants = checkboxesVariants({ lineThrough });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // map slots to HeroUI class names\n const heroCheckboxGroupClassNames: HeroCheckboxGroupProps['classNames'] = {\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n };\n const heroCheckboxClassNames: HeroCheckboxProps['classNames'] = {\n base: classNames.optionBase,\n icon: classNames.optionIcon,\n label: classNames.optionLabel,\n wrapper: classNames.optionWrapper,\n };\n\n // Build option descriptors once so default and custom layouts share the same checkbox nodes/state.\n const renderedOptions = options?.map((option) => {\n const optionTestId = slugify(\n `${testId}_option_${option?.testId ?? option?.value}`,\n {\n replaceDots: true,\n },\n );\n\n // set content and classes depending option has subline\n const hasSubline = !!option.labelSubline;\n let labelContent: ReactNode;\n let optionClassNames = heroCheckboxClassNames;\n if (hasSubline) {\n labelContent = (\n <div className=\"flex grow flex-col items-start\">\n <span className={classNames.optionLabel}>{option.label}</span>\n <span className={classNames.optionLabelSubline}>\n {option.labelSubline}\n </span>\n </div>\n );\n // remove label classes from outer label when subline is used\n optionClassNames = { ...optionClassNames, label: '' };\n } else {\n labelContent = option.label;\n }\n\n const optionIsDisabled = !!disabled || !!option.disabled;\n const checkbox = (\n <HeroCheckbox\n key={`index_${option.value}`}\n aria-label={\n typeof option.label === 'string' ? option.label : option.value\n }\n classNames={optionClassNames}\n data-invalid={invalid}\n data-testid={optionTestId}\n isDisabled={optionIsDisabled}\n value={option?.value}\n >\n {labelContent}\n </HeroCheckbox>\n );\n\n return {\n checkbox,\n option,\n state: {\n checked: value.includes(option.value),\n disabled: optionIsDisabled,\n invalid: !!invalid,\n },\n };\n });\n\n return (\n <HeroCheckboxGroup\n ref={ref}\n aria-label={ariaLabel}\n classNames={heroCheckboxGroupClassNames}\n color={color === 'info' ? 'primary' : color}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n orientation={inline ? 'horizontal' : 'vertical'}\n value={value}\n >\n {/* Child render function can fully control list layout; fallback keeps default rendering. */}\n {children\n ? children(renderedOptions ?? [])\n : renderedOptions?.map(({ checkbox }) => {\n return checkbox;\n })}\n </HeroCheckboxGroup>\n );\n};\n\nexport default Checkboxes;\n","import Checkboxes from './Checkboxes';\n\nexport type { CheckboxesProps, CheckboxOption } from './Checkboxes';\n\nexport { checkboxesVariants } from './Checkboxes';\n\nexport default Checkboxes;\n"],"mappings":";;;;;;AAkBA,MAAa,qBAAqB,GAAG;CACnC,OAAO;EACL,MAAM;GAEJ;GAEA;GAEA;EACF;EACA,cAAc;EAGd,OACE;EACF,YAAY;EACZ,YAAY;EACZ,aAAa;EACb,oBAAoB;EACpB,eAAe;EACf,SAAS;CACX;CACA,UAAU;EAER,OAAO;GACL,MAAM,EACJ,SACE,gEACJ;GACA,GAAGA,SAAqB,SAAS;EACnC;EACA,aAAa,EACX,MAAM;GACJ,aAAa,CACX,GAAGA,SAAqB,SAAS,YAAY,KAAK,OAElD,oDACF;GACA,oBAAoB;EACtB,EACF;CACF;AACF,CAAC;;;;AAmED,MAAM,cAAc,EAClB,WAAW,KAAA,GACX,YAAY,KAAA,GACZ,QAAQ,WACR,SAAS,OACT,cAAc,OACd,MACA,SACA,GAAG,wBACkB;CACrB,MAAM,EACJ,WACA,UACA,cACA,OAAO,EAAE,UAAU,OAAO,YAAY,KAAK,UAC3C,SACA,OACA,UACA,WACE,gBAAgB;EAElB,cAAc;EACd;EACA,GAAG;CACL,CAAC;CAGD,MAAM,QAAQ,MAAM,QAAQ,UAAU,IAAK,aAA0B,CAAC;CAGtE,MAAM,WAAW,mBAAmB,EAAE,YAAY,CAAC;CACnD,MAAM,aAAa,qBAAqB,UAAU,WAAW,MAAM;CAGnE,MAAM,8BAAoE;EACxE,MAAM,WAAW;EACjB,OAAO,WAAW;EAClB,SAAS,WAAW;CACtB;CACA,MAAM,yBAA0D;EAC9D,MAAM,WAAW;EACjB,MAAM,WAAW;EACjB,OAAO,WAAW;EAClB,SAAS,WAAW;CACtB;CAGA,MAAM,kBAAkB,SAAS,KAAK,WAAW;EAC/C,MAAM,eAAe,QACnB,GAAG,OAAO,UAAU,QAAQ,UAAU,QAAQ,SAC9C,EACE,aAAa,KACf,CACF;EAGA,MAAM,aAAa,CAAC,CAAC,OAAO;EAC5B,IAAI;EACJ,IAAI,mBAAmB;EACvB,IAAI,YAAY;GACd,eACE,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,QAAD;KAAM,WAAW,WAAW;KAAc,UAAA,OAAO;IAAY,CAAA,GAC7D,oBAAC,QAAD;KAAM,WAAW,WAAW;KACzB,UAAA,OAAO;IACJ,CAAA,CACH;;GAGP,mBAAmB;IAAE,GAAG;IAAkB,OAAO;GAAG;EACtD,OACE,eAAe,OAAO;EAGxB,MAAM,mBAAmB,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO;EAiBhD,OAAO;GACL,UAAA,oBAhBCC,UAAD;IAEE,cACE,OAAO,OAAO,UAAU,WAAW,OAAO,QAAQ,OAAO;IAE3D,YAAY;IACZ,gBAAc;IACd,eAAa;IACb,YAAY;IACZ,OAAO,QAAQ;IAEd,UAAA;GACW,GAXP,SAAS,OAAO,OAehB;GACP;GACA,OAAO;IACL,SAAS,MAAM,SAAS,OAAO,KAAK;IACpC,UAAU;IACV,SAAS,CAAC,CAAC;GACb;EACF;CACF,CAAC;CAED,OACE,oBAACC,eAAD;EACO;EACL,cAAY;EACZ,YAAY;EACZ,OAAO,UAAU,SAAS,YAAY;EAGtC,gBAAc;EACd,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,oBAAC,UAAD,EAAA,UAAS,MAAc,CAAA,IAAI;EACpC;EACE;EACE;EACV,aAAa,SAAS,eAAe;EAC9B;EAGN,UAAA,WACG,SAAS,mBAAmB,CAAC,CAAC,IAC9B,iBAAiB,KAAK,EAAE,eAAe;GACrC,OAAO;EACT,CAAC;CACY,CAAA;AAEvB;;;AC5PA,IAAA,qBAAe"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/Checkboxes/checkboxesVariants.ts","../../src/Checkboxes/subcomponents/CheckboxIndicator.tsx","../../src/Checkboxes/subcomponents/CheckboxLabel.tsx","../../src/Checkboxes/subcomponents/CheckboxControl.tsx","../../src/Checkboxes/subcomponents/CheckboxesControl.tsx","../../src/Checkboxes/Checkboxes.tsx","../../src/Checkboxes/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nconst checkboxColorVariants = tv({\n slots: { wrapper: '' },\n variants: {\n color: {\n danger: {\n wrapper:\n 'text-danger-foreground after:bg-danger after:text-danger-foreground',\n },\n default: {\n wrapper:\n 'text-default-foreground after:bg-default after:text-default-foreground',\n },\n info: {\n wrapper:\n 'text-info-foreground after:bg-info after:text-info-foreground',\n },\n primary: {\n wrapper:\n 'text-primary-foreground after:bg-primary after:text-primary-foreground',\n },\n secondary: {\n wrapper:\n 'text-secondary-foreground after:bg-secondary after:text-secondary-foreground',\n },\n success: {\n wrapper:\n 'text-success-foreground after:bg-success after:text-success-foreground',\n },\n warning: {\n wrapper:\n 'text-warning-foreground after:bg-warning after:text-warning-foreground',\n },\n },\n },\n});\nexport const checkboxesVariants = tv({\n extend: checkboxColorVariants,\n slots: {\n /** Container for the field control and supporting text */\n base: ['group flex w-full flex-col gap-y-1.5', 'relative'],\n /** Supporting text for the field */\n description: 'text-foreground-400 text-small',\n /** Container for validation messages */\n errorMessage: ['text-tiny', 'text-danger text-small'],\n /** Container for help text and validation messages */\n helperWrapper: 'relative block p-0',\n /** Visible field label */\n label: [\n 'inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger',\n 'relative',\n ],\n /** Clickable checkbox option */\n optionBase: [\n '',\n // option layout and pointer behavior\n 'group relative -m-2 inline-flex max-w-fit cursor-pointer select-none items-center justify-start p-2 tap-highlight-transparent',\n // disabled interaction and opacity\n 'data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-disabled',\n ],\n /** Checkmark inside the selection indicator */\n optionIcon: [\n '',\n // checkmark dimensions and fade transition\n 'pointer-events-none z-10 h-3 w-4 opacity-0 transition-opacity',\n // selected visibility\n 'group-data-[selected=true]:opacity-100',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Primary option text */\n optionLabel: '',\n /** Additional text below the option label */\n optionLabelSubline: 'text-foreground-400 !text-small',\n /** Outline and fill around the checkmark */\n optionWrapper: [\n '',\n // checkbox dimensions and layout\n 'relative me-2 inline-flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden rounded-[calc(var(--pixel-radius-medium)*0.6)] transition-transform',\n // unselected border layer\n \"before:absolute before:inset-0 before:box-border before:rounded-[inherit] before:border-2 before:border-solid before:border-default before:transition-colors before:content-['']\",\n // animated selection layer\n \"after:absolute after:inset-0 after:origin-center after:scale-50 after:rounded-[inherit] after:opacity-0 after:duration-200 after:ease-linear after:content-[''] after:transition-transform-opacity\",\n // pressed scale\n 'group-data-[pressed=true]:scale-95',\n // keyboard focus ring\n 'group-data-[focus-visible=true]:ring-2 group-data-[focus-visible=true]:ring-focus group-data-[focus-visible=true]:ring-offset-2 group-data-[focus-visible=true]:ring-offset-background',\n // hover and selected states\n 'group-data-[hover=true]:before:bg-default-100 group-data-[selected=true]:after:scale-100 group-data-[selected=true]:after:opacity-100',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Container arranging the selectable content */\n wrapper: [\n '',\n 'flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row',\n ],\n },\n variants: {\n lineThrough: {\n true: {\n optionLabel: [\n // label layout\n 'inline-flex items-center justify-center',\n // strikethrough line\n \"before:absolute before:h-0.5 before:w-0 before:bg-foreground before:content-['']\",\n // selected strikethrough state\n 'group-data-[selected=true]:opacity-60 group-data-[selected=true]:before:w-full',\n 'relative before:transition-all before:duration-200',\n ],\n optionLabelSubline: 'group-data-[selected=true]:opacity-60',\n },\n },\n invalid: {\n true: {\n optionLabel: 'text-danger',\n optionWrapper: 'before:border-danger',\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof checkboxesVariants>;\n\nexport type ClassName = TVClassName<typeof checkboxesVariants>;\nexport const checkboxOptionVariants = tv({\n extend: checkboxColorVariants,\n slots: {\n /** Option field context without an additional layout box */\n field: 'contents',\n /** Container for the option label and optional subline */\n label:\n 'relative select-none text-foreground transition-colors-opacity text-medium before:transition-width motion-reduce:transition-none',\n },\n variants: { invalid: { true: { label: 'text-danger' } } },\n});\n\n/** Resolved checkbox group and option slot classes */\nexport type CheckboxClassNames = Record<\n keyof ReturnType<typeof checkboxesVariants>,\n string\n>;\n","interface CheckboxIndicatorProps {\n /** CSS class name */\n className: {\n /** Animated checkmark */\n icon: string;\n /** Selection indicator surface */\n wrapper: string;\n };\n /** Whether the option is selected */\n selected: boolean;\n}\n\n/** Checkbox selection indicator with an animated checkmark */\nconst CheckboxIndicator = ({ className, selected }: CheckboxIndicatorProps) => {\n return (\n <span aria-hidden className={className.wrapper} data-slot=\"wrapper\">\n <svg\n aria-hidden\n className={className.icon}\n data-slot=\"icon\"\n fill=\"none\"\n role=\"presentation\"\n stroke=\"currentColor\"\n strokeDasharray={22}\n strokeDashoffset={selected ? 44 : 66}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n strokeWidth={2}\n viewBox=\"0 0 17 18\"\n >\n <polyline\n className=\"transition-[stroke-dashoffset] delay-200 duration-250 ease-linear motion-reduce:transition-none\"\n points=\"1 9 7 14 15 4\"\n />\n </svg>\n </span>\n );\n};\n\nexport default CheckboxIndicator;\n","import type { CheckboxOption } from '../Checkboxes';\n\ninterface CheckboxLabelProps extends Pick<\n CheckboxOption,\n 'label' | 'labelSubline'\n> {\n /** CSS class name */\n className: {\n /** Container for the option text */\n base: string;\n /** Primary option text */\n label: string;\n /** Supporting option text */\n subline: string;\n };\n /** Option ID used by the control's accessible-name associations */\n id: string;\n}\n\n/** Checkbox option text with an optional supporting line and accessible-name IDs */\nconst CheckboxLabel = ({\n className,\n id,\n label,\n labelSubline,\n}: CheckboxLabelProps) => {\n return (\n <span className={className.base} data-slot=\"label\" id={`${id}-label`}>\n {labelSubline ? (\n <div className=\"flex grow flex-col items-start\">\n <span className={className.label} id={`${id}-label-text`}>\n {label}\n </span>\n <span className={className.subline} id={`${id}-subline`}>\n {labelSubline}\n </span>\n </div>\n ) : (\n label\n )}\n </span>\n );\n};\n\nexport default CheckboxLabel;\n","import type { CheckboxButtonProps } from 'react-aria-components';\nimport type { CheckboxesProps, CheckboxOption } from '../Checkboxes';\nimport type { CheckboxClassNames } from '../checkboxesVariants';\n\nimport { useId } from 'react';\nimport { CheckboxButton, CheckboxField } from 'react-aria-components';\n\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport { checkboxOptionVariants } from '../checkboxesVariants';\nimport CheckboxIndicator from './CheckboxIndicator';\nimport CheckboxLabel from './CheckboxLabel';\n\ninterface CheckboxControlProps {\n /** CSS class name */\n className: CheckboxClassNames;\n /** Color scheme for the selection indicator */\n color: NonNullable<CheckboxesProps['color']>;\n /** Supporting description and error IDs */\n describedBy: string | undefined;\n /** Disables the field */\n disabled: boolean;\n /** Shows validation failure */\n invalid: boolean;\n /** Option label, subline and value */\n option: CheckboxOption;\n /** HTML data-testid attribute for e2e tests */\n testId: string;\n}\n\n/**\n * Checkbox option with an animated indicator, label and optional subline\n *\n * @see https://react-aria.adobe.com/Checkbox\n */\nconst CheckboxControl = ({\n className: classNames,\n color,\n describedBy,\n disabled,\n invalid,\n option,\n testId,\n}: CheckboxControlProps) => {\n const id = useId();\n const styling = useStyling();\n\n const hasSubline = !!option.labelSubline;\n const hasLabel = !!option.label || hasSubline;\n const labelledBy = hasSubline\n ? `${id}-label-text ${id}-subline`\n : `${id}-label`;\n\n // classNames from slots\n const variants = styling.resolve(checkboxOptionVariants, { color, invalid });\n const optionClassNames = styling.variantsToClassNames(variants, {\n label: hasSubline ? undefined : classNames.optionLabel,\n wrapper: classNames.optionWrapper,\n });\n\n // preserve option interaction selectors on the clickable label\n const renderOption: NonNullable<CheckboxButtonProps['render']> = (\n props,\n state,\n ) => {\n return (\n <label\n {...props}\n data-focus={state.isFocused || undefined}\n data-hover={state.isHovered || undefined}\n data-invalid={invalid}\n htmlFor={id}\n >\n {props.children}\n </label>\n );\n };\n\n return (\n <CheckboxField\n aria-describedby={describedBy}\n aria-invalid={invalid || undefined}\n aria-label={\n typeof option.label === 'string' ? option.label : option.value\n }\n aria-labelledby={hasLabel ? labelledBy : undefined}\n className={optionClassNames.field}\n id={id}\n isDisabled={disabled}\n isRequired={false}\n validationBehavior=\"aria\"\n value={option.value}\n >\n <CheckboxButton\n className={classNames.optionBase}\n data-testid={testId}\n render={renderOption}\n >\n {({ isSelected }) => {\n return (\n <>\n <CheckboxIndicator\n className={{\n icon: classNames.optionIcon,\n wrapper: optionClassNames.wrapper,\n }}\n selected={isSelected}\n />\n {hasLabel ? (\n <CheckboxLabel\n className={{\n base: optionClassNames.label,\n label: classNames.optionLabel,\n subline: classNames.optionLabelSubline,\n }}\n id={id}\n label={option.label}\n labelSubline={option.labelSubline}\n />\n ) : null}\n </>\n );\n }}\n </CheckboxButton>\n </CheckboxField>\n );\n};\n\nexport default CheckboxControl;\n","import type { CheckboxGroupProps } from 'react-aria-components';\nimport type { UniformField } from '../../hooks/useUniformField/types';\nimport type { CheckboxesProps } from '../Checkboxes';\n\nimport { CheckboxGroup, Label } from 'react-aria-components';\n\nimport { slugify } from '@fuf-stack/pixel-utils';\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nimport { getFieldControlProps } from '../../helpers/fieldProps/fieldProps';\nimport FieldLayout from '../../partials/FieldLayout/FieldLayout';\nimport { checkboxesVariants } from '../checkboxesVariants';\nimport CheckboxControl from './CheckboxControl';\n\ninterface CheckboxesControlProps extends Pick<\n CheckboxesProps,\n 'children' | 'className' | 'color' | 'inline' | 'lineThrough' | 'options'\n> {\n /** Bound field values, interactions and metadata */\n field: UniformField<unknown, string[]>;\n}\n\n/**\n * Checkbox group presentation with option composition and focus routing\n *\n * @see https://react-aria.adobe.com/CheckboxGroup\n */\nconst CheckboxesControl = ({\n field,\n children,\n className,\n color = 'primary',\n inline = false,\n lineThrough,\n options,\n}: CheckboxesControlProps) => {\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 } = field;\n\n // associate the editable control with its label and messages\n const controlProps = getFieldControlProps(field);\n\n const styling = useStyling();\n\n // treat non-array form values as an empty selection\n const value = Array.isArray(field.value) ? field.value : [];\n\n // classNames from slots\n const variants = styling.resolve(checkboxesVariants, {\n lineThrough,\n invalid,\n });\n const classNames = styling.variantsToClassNames(variants, className, 'base');\n\n const associations = controlProps;\n const describedBy =\n [\n associations['aria-describedby'],\n required ? `${ids.control}-required` : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined;\n\n const renderedOptions = options?.map((option) => {\n const optionDisabled = !!disabled || !!option.disabled;\n\n return {\n option,\n state: {\n checked: value.includes(option.value),\n disabled: optionDisabled,\n invalid: !!invalid,\n },\n checkbox: (\n <CheckboxControl\n key={`index_${option.value}`}\n className={classNames}\n color={color === 'info' ? 'primary' : color}\n describedBy={describedBy}\n disabled={optionDisabled}\n invalid={invalid}\n option={option}\n testId={slugify(`${testId}_option_${option.testId ?? option.value}`, {\n replaceDots: true,\n })}\n />\n ),\n };\n });\n\n // route form focus to the first enabled checkbox\n const handleControlRef = (node: HTMLDivElement | null) => {\n inputRef(\n node\n ? {\n focus: () => {\n node\n .querySelector<HTMLInputElement>('input:not(:disabled)')\n ?.focus();\n },\n }\n : null,\n );\n };\n\n // keep the group styling state on its root\n const renderGroup: NonNullable<CheckboxGroupProps['render']> = (props) => {\n return (\n <div\n {...props}\n aria-invalid={invalid || undefined}\n data-invalid={invalid}\n data-required={required}\n >\n {props.children}\n </div>\n );\n };\n\n return (\n <FieldLayout\n baseAs={CheckboxGroup}\n baseProps={{\n 'aria-describedby': describedBy,\n 'aria-label': associations['aria-label'],\n 'data-component': 'checkboxes',\n 'data-slot': 'base',\n 'data-testid': testId,\n id: associations.id,\n isDisabled: disabled,\n isInvalid: invalid,\n isRequired: required,\n name,\n onBlur,\n onChange: onValueChange,\n ref: handleControlRef,\n render: renderGroup,\n validationBehavior: 'aria',\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 {required ? (\n <span className=\"sr-only\" id={`${ids.control}-required`}>\n Required selection.\n </span>\n ) : null}\n <div\n className={classNames.wrapper}\n data-orientation={inline ? 'horizontal' : 'vertical'}\n data-slot=\"wrapper\"\n >\n {children\n ? children(renderedOptions ?? [])\n : renderedOptions?.map(({ checkbox }) => {\n return checkbox;\n })}\n </div>\n </FieldLayout>\n );\n};\n\nexport default CheckboxesControl;\n","import type { ReactNode } from 'react';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\nimport type { ClassName, VariantProps } from './checkboxesVariants';\n\nimport useUniformField from '../hooks/useUniformField/useUniformField';\nimport CheckboxesControl from './subcomponents/CheckboxesControl';\n\nexport { checkboxesVariants } from './checkboxesVariants';\n\nexport interface CheckboxOption {\n /** Disables the field */\n disabled?: boolean;\n /** Field label */\n label?: ReactNode;\n /** subline displayed below the label */\n labelSubline?: ReactNode;\n /** Arbitrary option metadata for custom render logic. */\n meta?: Record<string, unknown>;\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n /** option value */\n value: string;\n}\n\ninterface ChildRenderOption {\n /** Prebuilt checkbox element for custom option layouts */\n checkbox: ReactNode;\n /** Option data as provided in `options` */\n option: CheckboxOption;\n /** Render-state flags for this option */\n state: {\n /** Whether this option is currently selected */\n checked: boolean;\n /** Disables the field */\n disabled: boolean;\n /** Whether the checkbox group is invalid */\n invalid: boolean;\n };\n}\n\nexport interface CheckboxesProps {\n /** Custom accessible name */\n ariaLabel?: string;\n /** Optional child render function for custom full-list layout rendering. */\n children?: (options: ChildRenderOption[]) => ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Color scheme of the checkboxes */\n color?: VariantProps['color'];\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 /** Whether the checkboxes label should be crossed out */\n lineThrough?: boolean;\n /** Field name */\n name: string;\n /** Available options */\n options: CheckboxOption[];\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n /** allows disentangled display and form values for a field */\n transform?: InputValueTransform<string[]>;\n}\n\n/** Form selection field for multiple checkbox options */\nconst Checkboxes = ({\n children = undefined,\n className = undefined,\n color = 'primary',\n inline = false,\n lineThrough = false,\n name,\n options,\n ...uniformFieldProps\n}: CheckboxesProps) => {\n const { field } = useUniformField({\n ...uniformFieldProps,\n isArrayValue: true,\n name,\n });\n\n return (\n <CheckboxesControl\n className={className}\n color={color}\n field={field}\n inline={inline}\n lineThrough={lineThrough}\n options={options}\n >\n {children}\n </CheckboxesControl>\n );\n};\n\nexport default Checkboxes;\n","import Checkboxes from './Checkboxes';\n\nexport type { CheckboxesProps, CheckboxOption } from './Checkboxes';\n\nexport { checkboxesVariants } from './Checkboxes';\n\nexport default Checkboxes;\n"],"mappings":";;;;;;;;;AAIA,MAAM,wBAAwB,GAAG;CAC/B,OAAO,EAAE,SAAS,GAAG;CACrB,UAAU,EACR,OAAO;EACL,QAAQ,EACN,SACE,sEACJ;EACA,SAAS,EACP,SACE,yEACJ;EACA,MAAM,EACJ,SACE,gEACJ;EACA,SAAS,EACP,SACE,yEACJ;EACA,WAAW,EACT,SACE,+EACJ;EACA,SAAS,EACP,SACE,yEACJ;EACA,SAAS,EACP,SACE,yEACJ;CACF,EACF;AACF,CAAC;AACD,MAAa,qBAAqB,GAAG;CACnC,QAAQ;CACR,OAAO;;EAEL,MAAM,CAAC,wCAAwC,UAAU;;EAEzD,aAAa;;EAEb,cAAc,CAAC,aAAa,wBAAwB;;EAEpD,eAAe;;EAEf,OAAO,CACL,kHACA,UACF;;EA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