@fuf-stack/uniform 1.30.0 → 2.0.0-next.3

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.
Files changed (149) hide show
  1. package/README.md +0 -6
  2. package/dist/Checkboxes/index.d.mts +178 -274
  3. package/dist/Checkboxes/index.d.mts.map +1 -1
  4. package/dist/Checkboxes/index.mjs +294 -94
  5. package/dist/Checkboxes/index.mjs.map +1 -1
  6. package/dist/DatePicker/index.d.mts +1963 -148
  7. package/dist/DatePicker/index.d.mts.map +1 -1
  8. package/dist/DatePicker/index.mjs +401 -82
  9. package/dist/DatePicker/index.mjs.map +1 -1
  10. package/dist/FieldArray/index.d.mts +102 -97
  11. package/dist/FieldArray/index.d.mts.map +1 -1
  12. package/dist/FieldArray/index.mjs +340 -195
  13. package/dist/FieldArray/index.mjs.map +1 -1
  14. package/dist/FieldCard/index.d.mts +34 -34
  15. package/dist/FieldCard/index.d.mts.map +1 -1
  16. package/dist/FieldCard/index.mjs +181 -127
  17. package/dist/FieldCard/index.mjs.map +1 -1
  18. package/dist/{FieldCopyTestIdButton-Y9SfvaM9.mjs → FieldCopyTestIdButton-D3_jZYJ1.mjs} +4 -2
  19. package/dist/FieldCopyTestIdButton-D3_jZYJ1.mjs.map +1 -0
  20. package/dist/FieldDescription-X_0s1Lhu.mjs +35 -0
  21. package/dist/FieldDescription-X_0s1Lhu.mjs.map +1 -0
  22. package/dist/FieldLabel-DrNWJIVh.mjs +128 -0
  23. package/dist/FieldLabel-DrNWJIVh.mjs.map +1 -0
  24. package/dist/FieldLayout-DcvQU0zN.mjs +45 -0
  25. package/dist/FieldLayout-DcvQU0zN.mjs.map +1 -0
  26. package/dist/FieldReset/index.d.mts +17 -12
  27. package/dist/FieldReset/index.d.mts.map +1 -1
  28. package/dist/FieldReset/index.mjs +50 -33
  29. package/dist/FieldReset/index.mjs.map +1 -1
  30. package/dist/FieldValidationError-iAayfTEw.mjs +75 -0
  31. package/dist/FieldValidationError-iAayfTEw.mjs.map +1 -0
  32. package/dist/Form/index.d.mts +2 -2
  33. package/dist/Form/index.d.mts.map +1 -1
  34. package/dist/Form/index.mjs +9 -7
  35. package/dist/Form/index.mjs.map +1 -1
  36. package/dist/{FormContext-Dvt3MiKq.d.mts → FormContext-BnNJYZOo.d.mts} +3 -3
  37. package/dist/{FormContext-Dvt3MiKq.d.mts.map → FormContext-BnNJYZOo.d.mts.map} +1 -1
  38. package/dist/{FormContext-B8G_Xxd6.mjs → FormContext-PXkVlBdU.mjs} +6 -2
  39. package/dist/FormContext-PXkVlBdU.mjs.map +1 -0
  40. package/dist/Grid/index.mjs +1 -1
  41. package/dist/{Grid-Us2JFczS.mjs → Grid-DBL29Kwb.mjs} +4 -2
  42. package/dist/Grid-DBL29Kwb.mjs.map +1 -0
  43. package/dist/Input/index.d.mts +734 -47
  44. package/dist/Input/index.d.mts.map +1 -1
  45. package/dist/Input/index.mjs +411 -168
  46. package/dist/Input/index.mjs.map +1 -1
  47. package/dist/RadioBoxes/index.d.mts +300 -98
  48. package/dist/RadioBoxes/index.d.mts.map +1 -1
  49. package/dist/RadioBoxes/index.mjs +156 -119
  50. package/dist/RadioBoxes/index.mjs.map +1 -1
  51. package/dist/RadioTabs/index.d.mts +302 -76
  52. package/dist/RadioTabs/index.d.mts.map +1 -1
  53. package/dist/RadioTabs/index.mjs +274 -87
  54. package/dist/RadioTabs/index.mjs.map +1 -1
  55. package/dist/Radios/index.d.mts +314 -78
  56. package/dist/Radios/index.d.mts.map +1 -1
  57. package/dist/Radios/index.mjs +90 -44
  58. package/dist/Radios/index.mjs.map +1 -1
  59. package/dist/Select/index.d.mts +410 -142
  60. package/dist/Select/index.d.mts.map +1 -1
  61. package/dist/Select/index.mjs +284 -157
  62. package/dist/Select/index.mjs.map +1 -1
  63. package/dist/Slider/index.d.mts +382 -63
  64. package/dist/Slider/index.d.mts.map +1 -1
  65. package/dist/Slider/index.mjs +269 -90
  66. package/dist/Slider/index.mjs.map +1 -1
  67. package/dist/SubmitButton/index.d.mts.map +1 -1
  68. package/dist/SubmitButton/index.mjs +4 -1
  69. package/dist/SubmitButton/index.mjs.map +1 -1
  70. package/dist/Switch/index.d.mts +2 -427
  71. package/dist/Switch/index.mjs +167 -72
  72. package/dist/Switch/index.mjs.map +1 -1
  73. package/dist/Switch-Db2dpGz7.d.mts +648 -0
  74. package/dist/Switch-Db2dpGz7.d.mts.map +1 -0
  75. package/dist/SwitchBox/index.d.mts +191 -91
  76. package/dist/SwitchBox/index.d.mts.map +1 -1
  77. package/dist/SwitchBox/index.mjs +142 -88
  78. package/dist/SwitchBox/index.mjs.map +1 -1
  79. package/dist/TextArea/index.d.mts +347 -29
  80. package/dist/TextArea/index.d.mts.map +1 -1
  81. package/dist/TextArea/index.mjs +195 -47
  82. package/dist/TextArea/index.mjs.map +1 -1
  83. package/dist/Time/index.d.mts +1373 -139
  84. package/dist/Time/index.d.mts.map +1 -1
  85. package/dist/Time/index.mjs +160 -77
  86. package/dist/Time/index.mjs.map +1 -1
  87. package/dist/helpers/index.d.mts +1 -1
  88. package/dist/helpers/index.mjs +1 -1
  89. package/dist/helpers/index.mjs.map +1 -1
  90. package/dist/hooks/useClientValidation/index.mjs +1 -1
  91. package/dist/hooks/useController/index.d.mts +29 -2
  92. package/dist/hooks/useController/index.d.mts.map +1 -0
  93. package/dist/hooks/useController/index.mjs +1 -1
  94. package/dist/hooks/useFormContext/index.d.mts +44 -2
  95. package/dist/hooks/useFormContext/index.d.mts.map +1 -0
  96. package/dist/hooks/useFormContext/index.mjs +1 -1
  97. package/dist/hooks/useInputValueDebounce/index.d.mts +9 -3
  98. package/dist/hooks/useInputValueDebounce/index.d.mts.map +1 -1
  99. package/dist/hooks/useInputValueDebounce/index.mjs +27 -5
  100. package/dist/hooks/useInputValueDebounce/index.mjs.map +1 -1
  101. package/dist/hooks/useInputValueTransform/index.d.mts +1 -2
  102. package/dist/hooks/useInputValueTransform/index.mjs +1 -1
  103. package/dist/hooks/useWatchFormReset/index.mjs +1 -1
  104. package/dist/hooks/useWatchUserChange/index.mjs +1 -1
  105. package/dist/{useInputValueTransform-cevZBrIN.d.mts → index-cevZBrIN.d.mts} +1 -1
  106. package/dist/index-cevZBrIN.d.mts.map +1 -0
  107. package/dist/partials/FieldCopyTestIdButton/index.mjs +1 -1
  108. package/dist/partials/FieldValidationError/index.d.mts +637 -3
  109. package/dist/partials/FieldValidationError/index.d.mts.map +1 -1
  110. package/dist/partials/FieldValidationError/index.mjs +1 -1
  111. package/dist/radioControlVariants-BYRfaD6y.mjs +187 -0
  112. package/dist/radioControlVariants-BYRfaD6y.mjs.map +1 -0
  113. package/dist/switchVariants-D16b2VaT.mjs +67 -0
  114. package/dist/switchVariants-D16b2VaT.mjs.map +1 -0
  115. package/dist/timeVariants-CtXyNKmW.mjs +58 -0
  116. package/dist/timeVariants-CtXyNKmW.mjs.map +1 -0
  117. package/dist/{useController-CJjMqXU5.mjs → useController-JtIeurpw.mjs} +2 -2
  118. package/dist/{useController-CJjMqXU5.mjs.map → useController-JtIeurpw.mjs.map} +1 -1
  119. package/dist/{useFormContext-BEjPBdzb.mjs → useFormContext-piqnN2L-.mjs} +2 -2
  120. package/dist/{useFormContext-BEjPBdzb.mjs.map → useFormContext-piqnN2L-.mjs.map} +1 -1
  121. package/dist/{useInputValueTransform-D44BLp1Z.mjs → useInputValueTransform-CXWWFhy_.mjs} +2 -2
  122. package/dist/{useInputValueTransform-D44BLp1Z.mjs.map → useInputValueTransform-CXWWFhy_.mjs.map} +1 -1
  123. package/package.json +13 -25
  124. package/dist/FieldCopyTestIdButton-Y9SfvaM9.mjs.map +0 -1
  125. package/dist/FieldValidationError-BcUV0r1I.mjs +0 -48
  126. package/dist/FieldValidationError-BcUV0r1I.mjs.map +0 -1
  127. package/dist/FormContext-B8G_Xxd6.mjs.map +0 -1
  128. package/dist/Grid-Us2JFczS.mjs.map +0 -1
  129. package/dist/Switch/index.d.mts.map +0 -1
  130. package/dist/hooks/useInput/index.d.mts +0 -2
  131. package/dist/hooks/useInput/index.mjs +0 -5
  132. package/dist/hooks/useInput/index.mjs.map +0 -1
  133. package/dist/hooks/useUniformField/index.d.mts +0 -2
  134. package/dist/hooks/useUniformField/index.mjs +0 -141
  135. package/dist/hooks/useUniformField/index.mjs.map +0 -1
  136. package/dist/hooks/useUniformFieldArray/index.d.mts +0 -47
  137. package/dist/hooks/useUniformFieldArray/index.d.mts.map +0 -1
  138. package/dist/hooks/useUniformFieldArray/index.mjs +0 -99
  139. package/dist/hooks/useUniformFieldArray/index.mjs.map +0 -1
  140. package/dist/index-CaxrMD1A.d.mts +0 -1
  141. package/dist/index-DsB0_365.d.mts +0 -106
  142. package/dist/index-DsB0_365.d.mts.map +0 -1
  143. package/dist/useController-CdFEp-Wa.d.mts +0 -30
  144. package/dist/useController-CdFEp-Wa.d.mts.map +0 -1
  145. package/dist/useFormContext-BSSUZ0Md.d.mts +0 -45
  146. package/dist/useFormContext-BSSUZ0Md.d.mts.map +0 -1
  147. package/dist/useInput-ClpHDPdr.d.mts +0 -2
  148. package/dist/useInput-NPbS4w_n.mjs +0 -1
  149. package/dist/useInputValueTransform-cevZBrIN.d.mts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../../src/Checkboxes/Checkboxes.tsx"],"mappings":";;;qBAkBa,sBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA6FnB,eAAe,eAAe;KAE9B,YAAY,mBAAmB;UC7H1B;;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;;EAEA,YAAY;;;cAIR,eAAc,UAAA,WAAA,OAAA,QAAA,aAAA,MAAA,YAAA,qBASjB,oCAAe,IAAA"}
@@ -1,124 +1,324 @@
1
- import { useUniformField } from "../hooks/useUniformField/index.mjs";
2
- import { Checkbox, CheckboxGroup } from "@heroui/checkbox";
3
- import { checkbox } from "@heroui/theme";
4
- import { slugify, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
5
- import { jsx, jsxs } from "react/jsx-runtime";
6
- // src/Checkboxes/Checkboxes.tsx
1
+ import { n as useUniformField } from "../FieldLabel-DrNWJIVh.mjs";
2
+ import { n as getFieldControlProps } from "../FieldDescription-X_0s1Lhu.mjs";
3
+ import { t as FieldLayout } from "../FieldLayout-DcvQU0zN.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
+ // 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
- base: [
10
- "group",
11
- "flex w-full flex-col",
12
- "gap-y-1.5"
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]:cursor-not-allowed data-[disabled=true]:opacity-disabled data-[disabled=true]:**:cursor-not-allowed"
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
- errorMessage: "text-tiny",
15
- label: "inline-flex cursor-default text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger",
16
- optionBase: ["data-[disabled=true]:pointer-events-auto data-[disabled=true]:cursor-not-allowed", "data-[disabled=true]:**:cursor-not-allowed"],
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
- optionWrapper: "",
21
- wrapper: ""
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
- readOnly: { true: { base: "**:cursor-not-allowed cursor-not-allowed opacity-disabled" } },
29
67
  lineThrough: { true: {
30
- optionLabel: [...checkbox.variants.lineThrough.true.label, "relative before:transition-all before:duration-200"],
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
+ ],
31
74
  optionLabelSubline: "group-data-[selected=true]:opacity-60"
75
+ } },
76
+ invalid: { true: {
77
+ optionLabel: "text-danger",
78
+ optionWrapper: "before:border-danger"
79
+ } },
80
+ readOnly: { true: {
81
+ base: "cursor-not-allowed opacity-disabled **:cursor-not-allowed",
82
+ optionWrapper: "group-data-[hover=true]:before:bg-transparent"
32
83
  } }
33
84
  }
34
85
  });
86
+ const checkboxOptionVariants = tv({
87
+ extend: checkboxColorVariants,
88
+ slots: {
89
+ /** Option field context without an additional layout box */
90
+ field: "contents",
91
+ /** Container for the option label and optional subline */
92
+ label: "relative select-none text-foreground transition-colors-opacity text-medium before:transition-width motion-reduce:transition-none"
93
+ },
94
+ variants: { invalid: { true: { label: "text-danger" } } }
95
+ });
96
+ // src/Checkboxes/subcomponents/CheckboxIndicator.tsx
97
+ /** Checkbox selection indicator with an animated checkmark */
98
+ const CheckboxIndicator = ({ className, selected }) => {
99
+ return /* @__PURE__ */ jsx("span", {
100
+ "aria-hidden": true,
101
+ className: className.wrapper,
102
+ "data-slot": "wrapper",
103
+ children: /* @__PURE__ */ jsx("svg", {
104
+ "aria-hidden": true,
105
+ className: className.icon,
106
+ "data-slot": "icon",
107
+ fill: "none",
108
+ role: "presentation",
109
+ stroke: "currentColor",
110
+ strokeDasharray: 22,
111
+ strokeDashoffset: selected ? 44 : 66,
112
+ strokeLinecap: "round",
113
+ strokeLinejoin: "round",
114
+ strokeWidth: 2,
115
+ viewBox: "0 0 17 18",
116
+ children: /* @__PURE__ */ jsx("polyline", {
117
+ className: "transition-[stroke-dashoffset] delay-200 duration-250 ease-linear motion-reduce:transition-none",
118
+ points: "1 9 7 14 15 4"
119
+ })
120
+ })
121
+ });
122
+ };
123
+ // src/Checkboxes/subcomponents/CheckboxLabel.tsx
124
+ /** Checkbox option text with an optional supporting line and accessible-name IDs */
125
+ const CheckboxLabel = ({ className, id, label, labelSubline }) => {
126
+ return /* @__PURE__ */ jsx("span", {
127
+ className: className.base,
128
+ "data-slot": "label",
129
+ id: `${id}-label`,
130
+ children: labelSubline ? /* @__PURE__ */ jsxs("div", {
131
+ className: "flex grow flex-col items-start",
132
+ children: [/* @__PURE__ */ jsx("span", {
133
+ className: className.label,
134
+ id: `${id}-label-text`,
135
+ children: label
136
+ }), /* @__PURE__ */ jsx("span", {
137
+ className: className.subline,
138
+ id: `${id}-subline`,
139
+ children: labelSubline
140
+ })]
141
+ }) : label
142
+ });
143
+ };
144
+ // src/Checkboxes/subcomponents/CheckboxControl.tsx
35
145
  /**
36
- * Checkboxes component based on [HeroUI CheckboxGroup](https://www.heroui.com//docs/components/checkbox-group)
146
+ * Checkbox option with an animated indicator, label and optional subline
147
+ *
148
+ * @see https://react-aria.adobe.com/Checkbox
37
149
  */
38
- const Checkboxes = ({ children = void 0, className = void 0, color = "primary", inline = false, lineThrough = false, name, options, ...uniformFieldProps }) => {
39
- const { ariaLabel, disabled, errorMessage, field: { onChange, value: fieldValue, ref, onBlur }, invalid, label, readOnly, required, testId } = useUniformField({
40
- isArrayValue: true,
41
- name,
42
- ...uniformFieldProps
150
+ const CheckboxControl = ({ className: classNames, color, describedBy, disabled, invalid, option, testId }) => {
151
+ const id = useId();
152
+ const styling = useStyling();
153
+ const hasSubline = !!option.labelSubline;
154
+ const hasLabel = !!option.label || hasSubline;
155
+ const labelledBy = hasSubline ? `${id}-label-text ${id}-subline` : `${id}-label`;
156
+ const variants = styling.resolve(checkboxOptionVariants, {
157
+ color,
158
+ invalid
159
+ });
160
+ const optionClassNames = styling.variantsToClassNames(variants, {
161
+ label: hasSubline ? void 0 : classNames.optionLabel,
162
+ wrapper: classNames.optionWrapper
43
163
  });
44
- const value = Array.isArray(fieldValue) ? fieldValue : [];
45
- const variants = checkboxesVariants({
164
+ const renderOption = (props, state) => {
165
+ return /* @__PURE__ */ jsx("label", {
166
+ ...props,
167
+ "data-focus": state.isFocused || void 0,
168
+ "data-hover": state.isHovered || void 0,
169
+ "data-invalid": invalid,
170
+ htmlFor: id,
171
+ children: props.children
172
+ });
173
+ };
174
+ return /* @__PURE__ */ jsx(CheckboxField, {
175
+ "aria-describedby": describedBy,
176
+ "aria-invalid": invalid || void 0,
177
+ "aria-label": typeof option.label === "string" ? option.label : option.value,
178
+ "aria-labelledby": hasLabel ? labelledBy : void 0,
179
+ className: optionClassNames.field,
180
+ id,
181
+ isDisabled: disabled,
182
+ isRequired: false,
183
+ validationBehavior: "aria",
184
+ value: option.value,
185
+ children: /* @__PURE__ */ jsx(CheckboxButton, {
186
+ className: classNames.optionBase,
187
+ "data-testid": testId,
188
+ render: renderOption,
189
+ children: ({ isSelected }) => {
190
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(CheckboxIndicator, {
191
+ className: {
192
+ icon: classNames.optionIcon,
193
+ wrapper: optionClassNames.wrapper
194
+ },
195
+ selected: isSelected
196
+ }), hasLabel ? /* @__PURE__ */ jsx(CheckboxLabel, {
197
+ className: {
198
+ base: optionClassNames.label,
199
+ label: classNames.optionLabel,
200
+ subline: classNames.optionLabelSubline
201
+ },
202
+ id,
203
+ label: option.label,
204
+ labelSubline: option.labelSubline
205
+ }) : null] });
206
+ }
207
+ })
208
+ });
209
+ };
210
+ // 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, readOnly, 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, {
46
222
  lineThrough,
223
+ invalid,
47
224
  readOnly
48
225
  });
49
- const classNames = variantsToClassNames(variants, className, "base");
50
- const heroCheckboxGroupClassNames = {
51
- base: classNames.base,
52
- label: classNames.label,
53
- wrapper: classNames.wrapper
54
- };
55
- const heroCheckboxClassNames = {
56
- base: classNames.optionBase,
57
- icon: classNames.optionIcon,
58
- label: classNames.optionLabel,
59
- wrapper: classNames.optionWrapper
60
- };
226
+ const classNames = styling.variantsToClassNames(variants, className, "base");
227
+ const associations = controlProps;
228
+ const describedBy = [associations["aria-describedby"], required ? `${ids.control}-required` : void 0].filter(Boolean).join(" ") || void 0;
61
229
  const renderedOptions = options?.map((option) => {
62
- const optionTestId = slugify(`${testId}_option_${option?.testId ?? option?.value}`, { replaceDots: true });
63
- const hasSubline = !!option.labelSubline;
64
- let labelContent;
65
- let optionClassNames = heroCheckboxClassNames;
66
- if (hasSubline) {
67
- labelContent = /* @__PURE__ */ jsxs("div", {
68
- className: "flex grow flex-col items-start",
69
- children: [/* @__PURE__ */ jsx("span", {
70
- className: classNames.optionLabel,
71
- children: option.label
72
- }), /* @__PURE__ */ jsx("span", {
73
- className: classNames.optionLabelSubline,
74
- children: option.labelSubline
75
- })]
76
- });
77
- optionClassNames = {
78
- ...optionClassNames,
79
- label: ""
80
- };
81
- } else labelContent = option.label;
82
- const optionIsDisabled = !!disabled || !!option.disabled;
230
+ const optionDisabled = !!disabled || !!option.disabled;
83
231
  return {
84
- checkbox: /* @__PURE__ */ jsx(Checkbox, {
85
- "aria-label": typeof option.label === "string" ? option.label : option.value,
86
- classNames: optionClassNames,
87
- "data-invalid": invalid,
88
- "data-testid": optionTestId,
89
- isDisabled: optionIsDisabled,
90
- value: option?.value,
91
- children: labelContent
92
- }, `index_${option.value}`),
93
232
  option,
94
233
  state: {
95
234
  checked: value.includes(option.value),
96
- disabled: optionIsDisabled,
235
+ disabled: optionDisabled,
97
236
  invalid: !!invalid
98
- }
237
+ },
238
+ checkbox: /* @__PURE__ */ jsx(CheckboxControl, {
239
+ className: classNames,
240
+ color: color === "info" ? "primary" : color,
241
+ describedBy,
242
+ disabled: optionDisabled,
243
+ invalid,
244
+ option,
245
+ testId: slugify(`${testId}_option_${option.testId ?? option.value}`, { replaceDots: true })
246
+ }, `index_${option.value}`)
99
247
  };
100
248
  });
101
- return /* @__PURE__ */ jsx(CheckboxGroup, {
102
- ref,
103
- "aria-label": ariaLabel,
104
- classNames: heroCheckboxGroupClassNames,
105
- color: color === "info" ? "primary" : color,
106
- "data-invalid": invalid,
107
- "data-testid": testId,
249
+ const handleControlRef = (node) => {
250
+ inputRef(node ? { focus: () => {
251
+ node.querySelector("input:not(:disabled)")?.focus();
252
+ } } : null);
253
+ };
254
+ const renderGroup = (props) => {
255
+ return /* @__PURE__ */ jsx("div", {
256
+ ...props,
257
+ "aria-invalid": invalid || void 0,
258
+ "data-invalid": invalid,
259
+ "data-required": required,
260
+ children: props.children
261
+ });
262
+ };
263
+ return /* @__PURE__ */ jsxs(FieldLayout, {
264
+ baseAs: CheckboxGroup,
265
+ baseProps: {
266
+ "aria-describedby": describedBy,
267
+ "aria-label": associations["aria-label"],
268
+ "data-component": "checkboxes",
269
+ "data-slot": "base",
270
+ "data-testid": testId,
271
+ id: associations.id,
272
+ isDisabled: disabled,
273
+ isInvalid: invalid,
274
+ isReadOnly: readOnly,
275
+ isRequired: required,
276
+ name,
277
+ onBlur,
278
+ onChange: onValueChange,
279
+ ref: handleControlRef,
280
+ render: renderGroup,
281
+ validationBehavior: "aria",
282
+ value
283
+ },
284
+ className: classNames,
285
+ description,
108
286
  errorMessage,
109
- isDisabled: disabled,
110
- isInvalid: invalid,
111
- isReadOnly: readOnly,
112
- isRequired: required,
113
- label: label ? /* @__PURE__ */ jsx("legend", { children: label }) : null,
114
- name,
115
- onBlur,
116
- onChange,
117
- orientation: inline ? "horizontal" : "vertical",
118
- value,
119
- children: children ? children(renderedOptions ?? []) : renderedOptions?.map(({ checkbox }) => {
120
- return checkbox;
121
- })
287
+ ids,
288
+ invalid,
289
+ label,
290
+ labelAs: Label,
291
+ required,
292
+ children: [required ? /* @__PURE__ */ jsx("span", {
293
+ className: "sr-only",
294
+ id: `${ids.control}-required`,
295
+ children: "Required selection."
296
+ }) : null, /* @__PURE__ */ jsx("div", {
297
+ className: classNames.wrapper,
298
+ "data-orientation": inline ? "horizontal" : "vertical",
299
+ "data-slot": "wrapper",
300
+ children: children ? children(renderedOptions ?? []) : renderedOptions?.map(({ checkbox }) => {
301
+ return checkbox;
302
+ })
303
+ })]
304
+ });
305
+ };
306
+ // src/Checkboxes/Checkboxes.tsx
307
+ /** Form selection field for multiple checkbox options */
308
+ const Checkboxes = ({ children = void 0, className = void 0, color = "primary", inline = false, lineThrough = false, name, options, ...uniformFieldProps }) => {
309
+ const { field } = useUniformField({
310
+ ...uniformFieldProps,
311
+ isArrayValue: true,
312
+ name
313
+ });
314
+ return /* @__PURE__ */ jsx(CheckboxesControl, {
315
+ className,
316
+ color,
317
+ field,
318
+ inline,
319
+ lineThrough,
320
+ options,
321
+ children
122
322
  });
123
323
  };
124
324
  // src/Checkboxes/index.ts
@@ -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 // HeroUI disables pointer events on disabled options, which hides the\n // cursor; re-enable them (the disabled input still blocks changes).\n 'data-[disabled=true]:pointer-events-auto data-[disabled=true]:cursor-not-allowed',\n // The hidden native input covers the option and keeps the browser's\n // default cursor, so override every descendant too.\n 'data-[disabled=true]:**:cursor-not-allowed',\n ],\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 readOnly: {\n true: {\n // Inner controls set their own cursors, so override every descendant.\n base: '**:cursor-not-allowed cursor-not-allowed opacity-disabled',\n },\n },\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 /** disables the option */\n disabled?: boolean;\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 /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: 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 /** Prevents changes while keeping the checkboxes focusable and its value in validation and submission */\n readOnly?: boolean;\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 readOnly,\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, readOnly });\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 isReadOnly={readOnly}\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,CAGV,oFAGA,4CACF;EACA,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,UAAU,EACR,MAAM,EAEJ,MAAM,4DACR,EACF;EACA,aAAa,EACX,MAAM;GACJ,aAAa,CACX,GAAGA,SAAqB,SAAS,YAAY,KAAK,OAElD,oDACF;GACA,oBAAoB;EACtB,EACF;CACF;AACF,CAAC;;;;AAqED,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,UACA,WACE,gBAAgB;EAElB,cAAc;EACd;EACA,GAAG;CACL,CAAC;CAGD,MAAM,QAAQ,MAAM,QAAQ,UAAU,IAAK,aAA0B,CAAC;CAGtE,MAAM,WAAW,mBAAmB;EAAE;EAAa;CAAS,CAAC;CAC7D,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,MAA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["../../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 cursor and opacity, the native input covers the option\n 'data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-disabled data-[disabled=true]:**:cursor-not-allowed',\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 readOnly: {\n true: {\n // inner controls set their own cursors, override every descendant\n base: 'cursor-not-allowed opacity-disabled **:cursor-not-allowed',\n optionWrapper: 'group-data-[hover=true]:before:bg-transparent',\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 readOnly,\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 readOnly,\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 isReadOnly: readOnly,\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 /** 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 /** 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,yEAC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