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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/Checkboxes/index.d.mts +58 -58
  2. package/dist/Checkboxes/index.d.mts.map +1 -1
  3. package/dist/Checkboxes/index.mjs +10 -8
  4. package/dist/Checkboxes/index.mjs.map +1 -1
  5. package/dist/DatePicker/index.d.mts +46 -109
  6. package/dist/DatePicker/index.d.mts.map +1 -1
  7. package/dist/DatePicker/index.mjs +15 -23
  8. package/dist/DatePicker/index.mjs.map +1 -1
  9. package/dist/FieldArray/index.mjs +9 -7
  10. package/dist/FieldArray/index.mjs.map +1 -1
  11. package/dist/FieldCard/index.mjs +5 -8
  12. package/dist/FieldCard/index.mjs.map +1 -1
  13. package/dist/FieldHelper-B1DWl7eu.mjs +38 -0
  14. package/dist/FieldHelper-B1DWl7eu.mjs.map +1 -0
  15. package/dist/FieldLabel-DMTqq0Jj.mjs +29 -0
  16. package/dist/FieldLabel-DMTqq0Jj.mjs.map +1 -0
  17. package/dist/{FieldLayout-DcvQU0zN.mjs → FieldLayout-C9MEBZAC.mjs} +10 -17
  18. package/dist/FieldLayout-C9MEBZAC.mjs.map +1 -0
  19. package/dist/{FieldValidationError-iAayfTEw.mjs → FieldValidationError-BuLvuRyi.mjs} +3 -3
  20. package/dist/FieldValidationError-BuLvuRyi.mjs.map +1 -0
  21. package/dist/Input/index.d.mts +596 -431
  22. package/dist/Input/index.d.mts.map +1 -1
  23. package/dist/Input/index.mjs +7 -10
  24. package/dist/Input/index.mjs.map +1 -1
  25. package/dist/RadioBoxes/index.d.mts +79 -63
  26. package/dist/RadioBoxes/index.d.mts.map +1 -1
  27. package/dist/RadioBoxes/index.mjs +5 -13
  28. package/dist/RadioBoxes/index.mjs.map +1 -1
  29. package/dist/RadioTabs/index.d.mts +572 -317
  30. package/dist/RadioTabs/index.d.mts.map +1 -1
  31. package/dist/RadioTabs/index.mjs +11 -11
  32. package/dist/RadioTabs/index.mjs.map +1 -1
  33. package/dist/Radios/index.d.mts +44 -41
  34. package/dist/Radios/index.d.mts.map +1 -1
  35. package/dist/Radios/index.mjs +5 -13
  36. package/dist/Radios/index.mjs.map +1 -1
  37. package/dist/Select/index.d.mts +791 -599
  38. package/dist/Select/index.d.mts.map +1 -1
  39. package/dist/Select/index.mjs +7 -8
  40. package/dist/Select/index.mjs.map +1 -1
  41. package/dist/Slider/index.d.mts +664 -354
  42. package/dist/Slider/index.d.mts.map +1 -1
  43. package/dist/Slider/index.mjs +18 -26
  44. package/dist/Slider/index.mjs.map +1 -1
  45. package/dist/Switch/index.d.mts +1 -1
  46. package/dist/Switch/index.mjs +12 -17
  47. package/dist/Switch/index.mjs.map +1 -1
  48. package/dist/Switch-aBYStBoY.d.mts +990 -0
  49. package/dist/{Switch-Db2dpGz7.d.mts.map → Switch-aBYStBoY.d.mts.map} +1 -1
  50. package/dist/SwitchBox/index.d.mts +593 -231
  51. package/dist/SwitchBox/index.d.mts.map +1 -1
  52. package/dist/SwitchBox/index.mjs +14 -18
  53. package/dist/SwitchBox/index.mjs.map +1 -1
  54. package/dist/TextArea/index.d.mts +553 -216
  55. package/dist/TextArea/index.d.mts.map +1 -1
  56. package/dist/TextArea/index.mjs +7 -10
  57. package/dist/TextArea/index.mjs.map +1 -1
  58. package/dist/Time/index.d.mts +45 -45
  59. package/dist/Time/index.d.mts.map +1 -1
  60. package/dist/Time/index.mjs +17 -22
  61. package/dist/Time/index.mjs.map +1 -1
  62. package/dist/fieldHelperVariants-ClP8taiS.mjs +20 -0
  63. package/dist/fieldHelperVariants-ClP8taiS.mjs.map +1 -0
  64. package/dist/fieldLabelVariants-C4ZqECec.mjs +13 -0
  65. package/dist/fieldLabelVariants-C4ZqECec.mjs.map +1 -0
  66. package/dist/{FieldDescription-X_0s1Lhu.mjs → fieldProps-DWfz2jSO.mjs} +2 -13
  67. package/dist/fieldProps-DWfz2jSO.mjs.map +1 -0
  68. package/dist/{Switch-Db2dpGz7.d.mts → partials/FieldHelper/index.d.mts} +309 -408
  69. package/dist/partials/FieldHelper/index.d.mts.map +1 -0
  70. package/dist/partials/FieldHelper/index.mjs +7 -0
  71. package/dist/partials/FieldHelper/index.mjs.map +1 -0
  72. package/dist/partials/FieldLabel/index.d.mts +160 -0
  73. package/dist/partials/FieldLabel/index.d.mts.map +1 -0
  74. package/dist/partials/FieldLabel/index.mjs +7 -0
  75. package/dist/partials/FieldLabel/index.mjs.map +1 -0
  76. package/dist/partials/FieldValidationError/index.d.mts +2 -2
  77. package/dist/partials/FieldValidationError/index.mjs +1 -1
  78. package/dist/{radioControlVariants-BYRfaD6y.mjs → radioControlVariants-CbtG5U4_.mjs} +10 -6
  79. package/dist/radioControlVariants-CbtG5U4_.mjs.map +1 -0
  80. package/dist/{switchVariants-D16b2VaT.mjs → switchVariants-0Xa7TQYg.mjs} +5 -8
  81. package/dist/switchVariants-0Xa7TQYg.mjs.map +1 -0
  82. package/dist/{timeVariants-CtXyNKmW.mjs → timeVariants-Bkt4iwXx.mjs} +12 -10
  83. package/dist/timeVariants-Bkt4iwXx.mjs.map +1 -0
  84. package/dist/{FieldLabel-DrNWJIVh.mjs → useUniformField-TTNPTsVn.mjs} +3 -28
  85. package/dist/useUniformField-TTNPTsVn.mjs.map +1 -0
  86. package/package.json +4 -2
  87. package/dist/FieldDescription-X_0s1Lhu.mjs.map +0 -1
  88. package/dist/FieldLabel-DrNWJIVh.mjs.map +0 -1
  89. package/dist/FieldLayout-DcvQU0zN.mjs.map +0 -1
  90. package/dist/FieldValidationError-iAayfTEw.mjs.map +0 -1
  91. package/dist/radioControlVariants-BYRfaD6y.mjs.map +0 -1
  92. package/dist/switchVariants-D16b2VaT.mjs.map +0 -1
  93. package/dist/timeVariants-CtXyNKmW.mjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../../../src/partials/types.ts","../../../src/partials/FieldHelper/FieldHelper.tsx","../../../src/partials/FieldHelper/fieldHelperVariants.ts"],"mappings":";;;UAciB;;EAEf;;EAEA;;EAEA;;EAEA;;KCjBG,YAAY,QACf;UAGe;;EAEf,YAAY;;EAEZ,cAAc;;EAEd,eAAe;;EAEf,KAAK,KAAK;;EAEV;;;;;;;;cASI,gBAAe,WAAA,aAAA,cAAA,KAAA,WAMlB,qCAAgB,IAAA;;;;;;;;qBCvBN,uBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAWpB,+BAA+B,mBAClC"}
@@ -0,0 +1,7 @@
1
+ import { t as FieldHelper } from "../../FieldHelper-B1DWl7eu.mjs";
2
+ import { t as fieldHelperVariants } from "../../fieldHelperVariants-ClP8taiS.mjs";
3
+ // src/partials/FieldHelper/index.ts
4
+ var FieldHelper_default = FieldHelper;
5
+ export { FieldHelper_default as default, fieldHelperVariants };
6
+
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/partials/FieldHelper/index.ts"],"sourcesContent":["import FieldHelper from './FieldHelper';\n\nexport type { FieldHelperProps } from './FieldHelper';\nexport { fieldHelperVariants } from './fieldHelperVariants';\nexport type { FieldHelperVariantsClassName } from './fieldHelperVariants';\n\nexport default FieldHelper;\n"],"mappings":";;;AAMA,IAAA,sBAAe"}
@@ -0,0 +1,160 @@
1
+ import { HTMLAttributes, ReactNode } from "react";
2
+ import { TVClassName } from "@fuf-stack/pixel-utils";
3
+ import { Label } from "react-aria-components";
4
+ interface FieldLabelProps extends Pick<HTMLAttributes<HTMLElement>, 'aria-level' | 'role'> {
5
+ /** Label element, React Aria Label preserves the surrounding field context */
6
+ as?: 'label' | 'div' | 'span' | typeof Label;
7
+ /** Label content */
8
+ children: ReactNode;
9
+ /** CSS class name */
10
+ className?: string;
11
+ /** ID of the labeled control */
12
+ htmlFor?: string;
13
+ /** Label ID */
14
+ id?: string;
15
+ /** Shows the required indicator */
16
+ required?: boolean;
17
+ /** Required indicator CSS class name */
18
+ requiredClassName?: string;
19
+ }
20
+ /**
21
+ * Shared field label and required indicator
22
+ *
23
+ * Uses a native label by default, with span/div hosts for nested labels and
24
+ * headings, or React Aria Label for fields that supply label context
25
+ *
26
+ * @see https://react-aria.adobe.com/TextField
27
+ * @see https://react-aria.adobe.com/CheckboxGroup
28
+ */
29
+ declare const FieldLabel: ({ as: Component, children, className, htmlFor, id, required, requiredClassName, ...props }: FieldLabelProps) => import("react").JSX.Element | null;
30
+ /**
31
+ * Shared field label style, red while the field is invalid
32
+ *
33
+ * Field recipes compose `fieldLabelVariants.base` and add only structural
34
+ * classes, such as display or a label beside the control. The bottom padding
35
+ * spaces a stacked label from its control, so fields need no base gap.
36
+ */
37
+ export declare const fieldLabelVariants: ((props?: ({} & ({
38
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
39
+ className?: never;
40
+ } | {
41
+ class?: never;
42
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
43
+ })) | ({} & ({
44
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
45
+ className?: never;
46
+ } | {
47
+ class?: never;
48
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
49
+ })) | ({} & ({
50
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
51
+ className?: never;
52
+ } | {
53
+ class?: never;
54
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
55
+ })) | ({} & ({
56
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
57
+ className?: never;
58
+ } | {
59
+ class?: never;
60
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
61
+ })) | ({} & ({
62
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
63
+ className?: never;
64
+ } | {
65
+ class?: never;
66
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
67
+ })) | ({} & ({
68
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
69
+ className?: never;
70
+ } | {
71
+ class?: never;
72
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
73
+ })) | undefined) => string) & {
74
+ extend: ((props?: ({} & ({
75
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
76
+ className?: never;
77
+ } | {
78
+ class?: never;
79
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
80
+ })) | undefined) => {} & {} & {
81
+ base: (slotProps?: ({} & ({
82
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
83
+ className?: never;
84
+ } | {
85
+ class?: never;
86
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
87
+ })) | undefined) => string;
88
+ }) & {
89
+ extend: undefined;
90
+ base: "cursor-default pb-1.5 text-small text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger";
91
+ slots: undefined;
92
+ variants: unknown;
93
+ defaultVariants: {};
94
+ compoundVariants: ({} & ({
95
+ class?: (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined) | {
96
+ base?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
97
+ };
98
+ className?: never;
99
+ } | {
100
+ class?: never;
101
+ className?: (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined) | {
102
+ base?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
103
+ };
104
+ }))[];
105
+ compoundSlots: ({
106
+ slots: "base"[];
107
+ } & ({} & ({
108
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
109
+ className?: never;
110
+ } | {
111
+ class?: never;
112
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
113
+ })))[];
114
+ variantKeys: undefined;
115
+ };
116
+ base: "cursor-default pb-1.5 text-small text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger";
117
+ slots: undefined;
118
+ variants: {} | {} | {};
119
+ defaultVariants: {};
120
+ compoundVariants: ({} & ({
121
+ class?: (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined) | {
122
+ base?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
123
+ };
124
+ className?: never;
125
+ } | {
126
+ class?: never;
127
+ className?: (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined) | {
128
+ base?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
129
+ };
130
+ }))[];
131
+ compoundSlots: (({
132
+ slots: "base"[];
133
+ } & ({} & ({
134
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
135
+ className?: never;
136
+ } | {
137
+ class?: never;
138
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
139
+ }))) | ({
140
+ slots: "base"[];
141
+ } & ({} & ({
142
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
143
+ className?: never;
144
+ } | {
145
+ class?: never;
146
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
147
+ }))) | ({
148
+ slots: "base"[];
149
+ } & ({} & ({
150
+ class?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
151
+ className?: never;
152
+ } | {
153
+ class?: never;
154
+ className?: string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | readonly (string | false | 0 | 0n | /*elided*/ any | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined)[] | null | undefined;
155
+ }))))[];
156
+ variantKeys: never[];
157
+ };
158
+ type FieldLabelVariantsClassName = TVClassName<typeof fieldLabelVariants>;
159
+ export { type FieldLabelProps, type FieldLabelVariantsClassName, FieldLabel as default };
160
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","names":["AriaLabel"],"sources":["../../../src/partials/FieldLabel/FieldLabel.tsx","../../../src/partials/FieldLabel/fieldLabelVariants.ts"],"mappings":";;;UAGiB,wBAAwB,KACvC,eAAe;;EAIf,uCAAuCA;;EAEvC,UAAU;;EAEV;;EAEA;;EAEA;;EAEA;;EAEA;;;;;;;;;;;cAYI,eAAc,IAAA,WAAA,UAAA,WAAA,SAAA,IAAA,UAAA,sBAAA,SASjB,oCAAe,IAAA;;;;;;;;qBC9BL,sBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAInB,8BAA8B,mBACjC"}
@@ -0,0 +1,7 @@
1
+ import { t as FieldLabel } from "../../FieldLabel-DMTqq0Jj.mjs";
2
+ import { t as fieldLabelVariants } from "../../fieldLabelVariants-C4ZqECec.mjs";
3
+ // src/partials/FieldLabel/index.ts
4
+ var FieldLabel_default = FieldLabel;
5
+ export { FieldLabel_default as default, fieldLabelVariants };
6
+
7
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/partials/FieldLabel/index.ts"],"sourcesContent":["import FieldLabel from './FieldLabel';\n\nexport type { FieldLabelProps } from './FieldLabel';\nexport { fieldLabelVariants } from './fieldLabelVariants';\nexport type { FieldLabelVariantsClassName } from './fieldLabelVariants';\n\nexport default FieldLabel;\n"],"mappings":";;;AAMA,IAAA,qBAAe"}
@@ -513,7 +513,7 @@ declare const fieldValidationErrorVariants: ((props?: ({
513
513
  base: string;
514
514
  /** Animated entry for one validation message */
515
515
  item: string;
516
- /** Padded content inside an animated entry */
516
+ /** Content inside an animated entry, padded so the entry animates its spacing */
517
517
  message: string;
518
518
  /** Associated error container rendered when an ID is supplied */
519
519
  wrapper: string;
@@ -554,7 +554,7 @@ declare const fieldValidationErrorVariants: ((props?: ({
554
554
  base: string;
555
555
  /** Animated entry for one validation message */
556
556
  item: string;
557
- /** Padded content inside an animated entry */
557
+ /** Content inside an animated entry, padded so the entry animates its spacing */
558
558
  message: string;
559
559
  /** Associated error container rendered when an ID is supplied */
560
560
  wrapper: string;
@@ -1 +1 @@
1
- export { t as default } from "../../FieldValidationError-iAayfTEw.mjs";
1
+ export { t as default } from "../../FieldValidationError-BuLvuRyi.mjs";
@@ -1,3 +1,5 @@
1
+ import { t as fieldHelperVariants } from "./fieldHelperVariants-ClP8taiS.mjs";
2
+ import { t as fieldLabelVariants } from "./fieldLabelVariants-C4ZqECec.mjs";
1
3
  import { createContext, useContext, useId, useRef } from "react";
2
4
  import { jsx, jsxs } from "react/jsx-runtime";
3
5
  import { tv } from "@fuf-stack/pixel-utils";
@@ -64,12 +66,14 @@ const radioGroupFieldVariants = tv({
64
66
  slots: {
65
67
  /** Container grouping the label, options and hints */
66
68
  base: "relative",
67
- /** Supporting text below the options */
68
- description: "text-foreground-400 text-tiny",
69
- /** Container for validation messages */
70
- errorMessage: "",
69
+ /** Help text below the control */
70
+ description: fieldHelperVariants.slots.description,
71
+ /** Validation message container */
72
+ errorMessage: fieldHelperVariants.slots.errorMessage,
73
+ /** Container for help text and validation messages */
74
+ helperWrapper: fieldHelperVariants.slots.helperWrapper,
71
75
  /** Label above the options */
72
- label: "relative",
76
+ label: [fieldLabelVariants.base, "relative inline-flex"],
73
77
  /** Container around the selectable options */
74
78
  wrapper: ""
75
79
  },
@@ -184,4 +188,4 @@ const radioControlVariants = tv({
184
188
  });
185
189
  export { RadioGroupField as i, RadioControl as n, radioGroupFieldVariants as r, radioControlVariants as t };
186
190
 
187
- //# sourceMappingURL=radioControlVariants-BYRfaD6y.mjs.map
191
+ //# sourceMappingURL=radioControlVariants-CbtG5U4_.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radioControlVariants-CbtG5U4_.mjs","names":[],"sources":["../src/partials/RadioGroupField/RadioGroupDescriptionContext.ts","../src/partials/RadioGroupField/RadioGroupField.tsx","../src/partials/RadioGroupField/radioGroupFieldVariants.ts","../src/Radios/subcomponents/RadioControl.tsx","../src/Radios/subcomponents/radioControlVariants.ts"],"sourcesContent":["import { createContext } from 'react';\n\n/** Supporting message IDs inherited by each option */\nconst RadioGroupDescriptionContext = createContext<string | undefined>(\n undefined,\n);\n\nexport default RadioGroupDescriptionContext;\n","import type { ReactNode } from 'react';\nimport type { RadioGroupProps } from 'react-aria-components';\nimport type { FieldControlProps } from '../types';\n\nimport { useRef } from 'react';\nimport { RadioGroup } from 'react-aria-components';\n\nimport RadioGroupDescriptionContext from './RadioGroupDescriptionContext';\n\ninterface RadioGroupFieldProps {\n /** Group content, including its label and options */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** Control ID, explicit accessible name and supporting message IDs */\n controlProps: Pick<\n FieldControlProps,\n 'id' | 'aria-label' | 'aria-describedby'\n >;\n /** Identifies the public component owning the radio group */\n dataComponent?: string;\n /** Disables every option */\n disabled?: boolean;\n /** Arranges options horizontally */\n inline: boolean;\n /** Connects form focus requests to the selected or first enabled option */\n inputRef: (control: Pick<HTMLElement, 'focus'> | null) => void;\n /** Marks visible validation failure */\n invalid: boolean;\n /** Field name */\n name: string;\n /** Callback when focus leaves the group */\n onBlur: () => void;\n /** Callback with the selected option's string value */\n onChange: (value: string) => void;\n /** Prevents selection changes while options stay focusable */\n readOnly?: boolean;\n /** Marks the group as required */\n required: boolean;\n /** HTML data-testid attribute */\n testId: string;\n /** Selected value, nullish values become an empty selection */\n value: unknown;\n}\n\n/**\n * React Aria radio-group engine with option focus routing and shared descriptions\n *\n * Receives bound values and callbacks, without registering a form field.\n * Its children own the field layout and option presentation.\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nconst RadioGroupField = ({\n children,\n className = undefined,\n controlProps,\n dataComponent = undefined,\n disabled = undefined,\n inputRef,\n invalid,\n inline,\n name,\n onBlur,\n onChange,\n readOnly = undefined,\n required,\n testId,\n value,\n}: RadioGroupFieldProps) => {\n const groupRef = useRef<HTMLDivElement>(null);\n\n // focus the selected enabled option, otherwise the first enabled option\n const handleFocus = () => {\n const input =\n groupRef.current?.querySelector<HTMLInputElement>(\n 'input:checked:not(:disabled)',\n ) ??\n groupRef.current?.querySelector<HTMLInputElement>('input:not(:disabled)');\n input?.focus();\n };\n\n // expose option focus through the binding ref\n const setControlRef = (node: HTMLDivElement | null) => {\n groupRef.current = node;\n inputRef(node ? { focus: handleFocus } : null);\n };\n\n // preserve the group's existing state selectors on the actual root\n const renderGroup: NonNullable<RadioGroupProps['render']> = (props) => {\n return (\n <div {...props} data-invalid={invalid} data-required={required}>\n {props.children}\n </div>\n );\n };\n\n return (\n <RadioGroup\n ref={setControlRef}\n aria-describedby={controlProps['aria-describedby']}\n aria-label={controlProps['aria-label']}\n className={className}\n data-component={dataComponent}\n data-invalid={invalid}\n data-required={required}\n data-slot=\"base\"\n data-testid={testId}\n id={controlProps.id}\n isDisabled={disabled}\n isInvalid={invalid}\n isReadOnly={readOnly}\n isRequired={required}\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n orientation={inline ? 'horizontal' : 'vertical'}\n render={renderGroup}\n validationBehavior=\"aria\"\n value={value != null ? String(value) : ''}\n >\n <RadioGroupDescriptionContext.Provider\n value={controlProps['aria-describedby']}\n >\n {children}\n </RadioGroupDescriptionContext.Provider>\n </RadioGroup>\n );\n};\n\nexport default RadioGroupField;\n","import { tv } from '@fuf-stack/pixel-utils';\n\nimport { fieldHelperVariants } from '../FieldHelper/fieldHelperVariants';\nimport { fieldLabelVariants } from '../FieldLabel/fieldLabelVariants';\n\nconst radioGroupFieldVariants = tv({\n // reference slots instead of extending, tv types follow only one extend level\n slots: {\n /** Container grouping the label, options and hints */\n base: 'relative',\n /** Help text below the control */\n description: fieldHelperVariants.slots.description,\n /** Validation message container */\n errorMessage: fieldHelperVariants.slots.errorMessage,\n /** Container for help text and validation messages */\n helperWrapper: fieldHelperVariants.slots.helperWrapper,\n /** Label above the options */\n label: [fieldLabelVariants.base, 'relative inline-flex'],\n /** Container around the selectable options */\n wrapper: '',\n },\n variants: {\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 },\n },\n },\n});\n\nexport default radioGroupFieldVariants;\n","import type { ReactNode } from 'react';\nimport type { RadioButtonProps } from 'react-aria-components';\nimport type { RadioControlClassNames } from './radioControlVariants';\n\nimport { useContext, useId } from 'react';\nimport { RadioButton, RadioField } from 'react-aria-components';\n\nimport RadioGroupDescriptionContext from '../../partials/RadioGroupField/RadioGroupDescriptionContext';\n\ninterface RadioControlProps {\n /** Option label */\n children: ReactNode;\n /** CSS class name */\n className: RadioControlClassNames;\n /** Help text associated with the field */\n description?: ReactNode;\n /** Disables the field */\n disabled?: boolean;\n /** Decorative option icon */\n icon?: ReactNode;\n /** Marks visible validation failure */\n invalid: boolean;\n /** HTML data-testid attribute for e2e tests */\n testId?: string;\n /** String value managed by the containing group */\n value: string;\n}\n\n/**\n * React Aria radio option with an indicator, label and optional supporting text\n *\n * Inherits selection and disabled state from its RadioGroup, and supporting\n * message IDs from RadioGroupField when composed inside that engine.\n *\n * @see https://react-aria.adobe.com/RadioGroup\n */\nconst RadioControl = ({\n children,\n className: classNames,\n description = undefined,\n disabled = undefined,\n icon = undefined,\n invalid,\n testId = undefined,\n value,\n}: RadioControlProps) => {\n const id = useId();\n const groupDescription = useContext(RadioGroupDescriptionContext);\n\n const describedBy =\n [groupDescription, description ? `${id}-description` : undefined]\n .filter(Boolean)\n .join(' ') || undefined;\n\n const control = (\n <span aria-hidden className={classNames.wrapper} data-slot=\"wrapper\">\n <span className={classNames.control} data-slot=\"control\" />\n </span>\n );\n\n // preserve option state selectors on the visible label\n const renderOption: NonNullable<RadioButtonProps['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-hover-unselected={\n (state.isHovered && !state.isSelected) || undefined\n }\n htmlFor={`${id}-control`}\n >\n {props.children}\n </label>\n );\n };\n\n return (\n <RadioField\n aria-describedby={describedBy}\n aria-labelledby={`${id}-label`}\n className={classNames.field}\n id={`${id}-control`}\n isDisabled={disabled}\n value={value}\n >\n <RadioButton\n className={classNames.base}\n data-invalid={invalid}\n data-slot=\"base\"\n data-testid={testId}\n render={renderOption}\n >\n {!icon ? control : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className={classNames.labelWrapper} data-slot=\"label-wrapper\">\n <span\n className={classNames.label}\n data-slot=\"label\"\n id={`${id}-label`}\n >\n {children}\n </span>\n {description ? (\n <div\n className={classNames.description}\n data-slot=\"description\"\n id={`${id}-description`}\n >\n {description}\n </div>\n ) : null}\n </div>\n {icon ? control : null}\n </RadioButton>\n </RadioField>\n );\n};\n\nexport default RadioControl;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nconst radioControlVariants = tv({\n slots: {\n /** Clickable option containing the indicator and label */\n base: [\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 /** Dot marking the selected option */\n control: [\n // selection dot appearance and animation\n 'z-10 h-2 w-2 origin-center scale-0 rounded-full bg-primary text-primary-foreground opacity-0 transition-transform-opacity',\n // selection and validation states\n 'group-data-[selected=true]:scale-100 group-data-[invalid=true]:bg-danger group-data-[invalid=true]:text-danger-foreground group-data-[selected=true]:opacity-100',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Supporting text below the option label */\n description:\n 'relative text-foreground-400 transition-colors text-small motion-reduce:transition-none',\n /** Option state boundary without an additional layout box */\n field: 'contents',\n /** Container for a decorative option icon */\n icon: '',\n /** Primary option text */\n label:\n 'relative select-none text-foreground transition-colors text-medium motion-reduce:transition-none',\n /** Container grouping the option label and description */\n labelWrapper: 'ml-1 ms-2 flex flex-col',\n /** Circular outline around the selection indicator */\n wrapper: [\n // indicator dimensions and layout\n 'relative box-border inline-flex h-5 w-5 shrink-0 items-center justify-center overflow-hidden',\n // circular border and transitions\n 'rounded-full border-2 border-solid border-default transition-transform-colors',\n // pressed, selected and invalid states\n 'group-data-[pressed=true]:scale-95 group-data-[invalid=true]:border-danger group-data-[invalid=true]:group-data-[selected=true]:border-danger group-data-[selected=true]:border-primary group-data-[hover-unselected=true]:bg-default-100',\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 // reduced motion\n 'motion-reduce:transition-none',\n ],\n },\n variants: {\n invalid: {\n true: {\n control: 'bg-danger text-danger-foreground',\n description: 'text-danger-300',\n label: 'text-danger',\n wrapper: 'border-danger group-data-[selected=true]:border-danger',\n },\n },\n },\n});\n\nexport type RadioControlClassNames = Partial<\n Record<keyof ReturnType<typeof radioControlVariants>, string>\n>;\n\nexport type ClassName = TVClassName<typeof radioControlVariants>;\n\nexport default radioControlVariants;\n"],"mappings":";;;;;;;;AAGA,MAAM,+BAA+B,cACnC,KAAA,CACF;;;;;;;;;;ACgDA,MAAM,mBAAmB,EACvB,UACA,YAAY,KAAA,GACZ,cACA,gBAAgB,KAAA,GAChB,WAAW,KAAA,GACX,UACA,SACA,QACA,MACA,QACA,UACA,WAAW,KAAA,GACX,UACA,QACA,YAC0B;CAC1B,MAAM,WAAW,OAAuB,IAAI;CAG5C,MAAM,oBAAoB;EAMxB,CAJE,SAAS,SAAS,cAChB,8BACF,KACA,SAAS,SAAS,cAAgC,sBAAsB,EAAA,EACnE,MAAM;CACf;CAGA,MAAM,iBAAiB,SAAgC;EACrD,SAAS,UAAU;EACnB,SAAS,OAAO,EAAE,OAAO,YAAY,IAAI,IAAI;CAC/C;CAGA,MAAM,eAAuD,UAAU;EACrE,OACE,oBAAC,OAAD;GAAK,GAAI;GAAO,gBAAc;GAAS,iBAAe;GACnD,UAAA,MAAM;EACJ,CAAA;CAET;CAEA,OACE,oBAAC,YAAD;EACE,KAAK;EACL,oBAAkB,aAAa;EAC/B,cAAY,aAAa;EACd;EACX,kBAAgB;EAChB,gBAAc;EACd,iBAAe;EACf,aAAU;EACV,eAAa;EACb,IAAI,aAAa;EACjB,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,YAAY;EACN;EACE;EACE;EACV,aAAa,SAAS,eAAe;EACrC,QAAQ;EACR,oBAAmB;EACnB,OAAO,SAAS,OAAO,OAAO,KAAK,IAAI;EAEvC,UAAA,oBAAC,6BAA6B,UAA9B;GACE,OAAO,aAAa;GAEnB;EACoC,CAAA;CAC7B,CAAA;AAEhB;;AC3HA,MAAM,0BAA0B,GAAG;CAEjC,OAAO;;EAEL,MAAM;;EAEN,aAAa,oBAAoB,MAAM;;EAEvC,cAAc,oBAAoB,MAAM;;EAExC,eAAe,oBAAoB,MAAM;;EAEzC,OAAO,CAAC,mBAAmB,MAAM,sBAAsB;;EAEvD,SAAS;CACX;CACA,UAAU,EACR,UAAU,EACR,MAAM,EAEJ,MAAM,4DACR,EACF,EACF;AACF,CAAC;;;;;;;;;;ACOD,MAAM,gBAAgB,EACpB,UACA,WAAW,YACX,cAAc,KAAA,GACd,WAAW,KAAA,GACX,OAAO,KAAA,GACP,SACA,SAAS,KAAA,GACT,YACuB;CACvB,MAAM,KAAK,MAAM;CAGjB,MAAM,cACJ,CAHuB,WAAW,4BAGlB,GAAG,cAAc,GAAG,GAAG,gBAAgB,KAAA,CAAS,CAAC,CAC9D,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,KAAK,KAAA;CAElB,MAAM,UACJ,oBAAC,QAAD;EAAM,eAAA;EAAY,WAAW,WAAW;EAAS,aAAU;EACzD,UAAA,oBAAC,QAAD;GAAM,WAAW,WAAW;GAAS,aAAU;EAAW,CAAA;CACtD,CAAA;CAIR,MAAM,gBACJ,OACA,UACG;EACH,OACE,oBAAC,SAAD;GACE,GAAI;GACJ,cAAY,MAAM,aAAa,KAAA;GAC/B,cAAY,MAAM,aAAa,KAAA;GAC/B,yBACG,MAAM,aAAa,CAAC,MAAM,cAAe,KAAA;GAE5C,SAAS,GAAG,GAAG;GAEd,UAAA,MAAM;EACF,CAAA;CAEX;CAEA,OACE,oBAAC,YAAD;EACE,oBAAkB;EAClB,mBAAiB,GAAG,GAAG;EACvB,WAAW,WAAW;EACtB,IAAI,GAAG,GAAG;EACV,YAAY;EACL;EAEP,UAAA,qBAAC,aAAD;GACE,WAAW,WAAW;GACtB,gBAAc;GACd,aAAU;GACV,eAAa;GACb,QAAQ;GALV,UAAA;IAOG,CAAC,OAAO,UAAU;IAClB,OAAO,oBAAC,OAAD;KAAK,WAAW,WAAW;KAAO,UAAA;IAAU,CAAA,IAAI;IACxD,qBAAC,OAAD;KAAK,WAAW,WAAW;KAAc,aAAU;KAAnD,UAAA,CACE,oBAAC,QAAD;MACE,WAAW,WAAW;MACtB,aAAU;MACV,IAAI,GAAG,GAAG;MAET;KACG,CAAA,GACL,cACC,oBAAC,OAAD;MACE,WAAW,WAAW;MACtB,aAAU;MACV,IAAI,GAAG,GAAG;MAET,UAAA;KACE,CAAA,IACH,IACD;;IACJ,OAAO,UAAU;GACP;;CACH,CAAA;AAEhB;;ACpHA,MAAM,uBAAuB,GAAG;CAC9B,OAAO;;EAEL,MAAM,CAEJ,iIAEA,0HACF;;EAEA,SAAS;GAEP;GAEA;GAEA;EACF;;EAEA,aACE;;EAEF,OAAO;;EAEP,MAAM;;EAEN,OACE;;EAEF,cAAc;;EAEd,SAAS;GAEP;GAEA;GAEA;GAEA;GAEA;EACF;CACF;CACA,UAAU,EACR,SAAS,EACP,MAAM;EACJ,SAAS;EACT,aAAa;EACb,OAAO;EACP,SAAS;CACX,EACF,EACF;AACF,CAAC"}
@@ -1,23 +1,20 @@
1
+ import { t as fieldHelperVariants } from "./fieldHelperVariants-ClP8taiS.mjs";
2
+ import { t as fieldLabelVariants } from "./fieldLabelVariants-C4ZqECec.mjs";
1
3
  import { tv } from "@fuf-stack/pixel-utils";
2
4
  // src/Switch/switchVariants.ts
3
5
  const switchVariants = tv({
6
+ extend: fieldHelperVariants,
4
7
  slots: {
5
8
  /** Container for the field control and supporting text */
6
9
  base: "group relative inline-flex max-w-fit cursor-pointer touch-none select-none items-center justify-start tap-highlight-transparent",
7
- /** Supporting text for the field */
8
- description: "text-foreground-500 text-tiny",
9
10
  /** Content at the end of the control */
10
11
  endContent: [
11
12
  "absolute end-1.5 z-0 text-default-600 opacity-100 transition-transform-opacity text-small",
12
13
  "group-data-[selected=true]:translate-x-3 group-data-[selected=true]:opacity-0",
13
14
  "motion-reduce:transition-none"
14
15
  ],
15
- /** Container for validation messages */
16
- errorMessage: "text-danger text-tiny",
17
- /** Container for help text and validation messages */
18
- helperWrapper: "relative ml-0 block p-0",
19
16
  /** Visible field label */
20
- label: "group-data-[invalid=true]:text-danger! relative ms-2 select-none text-sm text-foreground subpixel-antialiased",
17
+ label: [fieldLabelVariants.base, "relative ms-2 cursor-pointer select-none pb-0"],
21
18
  /** Container grouping the toggle and field messages */
22
19
  outerWrapper: "place-content-center",
23
20
  /** Content at the start of the control */
@@ -64,4 +61,4 @@ const switchVariants = tv({
64
61
  });
65
62
  export { switchVariants as t };
66
63
 
67
- //# sourceMappingURL=switchVariants-D16b2VaT.mjs.map
64
+ //# sourceMappingURL=switchVariants-0Xa7TQYg.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"switchVariants-0Xa7TQYg.mjs","names":[],"sources":["../src/Switch/switchVariants.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport { fieldHelperVariants } from '../partials/FieldHelper/fieldHelperVariants';\nimport { fieldLabelVariants } from '../partials/FieldLabel/fieldLabelVariants';\n\nexport const switchVariants = tv({\n extend: fieldHelperVariants,\n slots: {\n /** Container for the field control and supporting text */\n base: 'group relative inline-flex max-w-fit cursor-pointer touch-none select-none items-center justify-start tap-highlight-transparent',\n /** Content at the end of the control */\n endContent: [\n // end icon position and fade transition\n 'absolute end-1.5 z-0 text-default-600 opacity-100 transition-transform-opacity text-small',\n // move and hide the selected end icon\n 'group-data-[selected=true]:translate-x-3 group-data-[selected=true]:opacity-0',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Visible field label */\n label: [\n fieldLabelVariants.base,\n // beside the control, without the spacing below a stacked label\n 'relative ms-2 cursor-pointer select-none pb-0',\n ],\n /** Container grouping the toggle and field messages */\n outerWrapper: 'place-content-center',\n /** Content at the start of the control */\n startContent: [\n // start icon position and fade transition\n 'absolute start-1.5 z-0 scale-50 text-current opacity-0 transition-transform-opacity text-small',\n // reveal the selected start icon\n 'group-data-[selected=true]:scale-100 group-data-[selected=true]:opacity-100',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Movable indicator showing the current value */\n thumb: [\n // thumb layout and surface\n 'pointer-events-none z-10 flex h-5 w-5 origin-right items-center justify-center rounded-full bg-white shadow-small transition-all text-small',\n // selected position and pressed width\n 'group-data-[selected=true]:group-data-[pressed=true]:ms-4 group-data-[selected=true]:ms-5 group-data-[pressed=true]:w-6',\n // reduced motion\n 'motion-reduce:transition-none',\n ],\n /** Content inside the toggle thumb */\n thumbIcon: 'text-black',\n /** Container arranging the selectable content */\n wrapper: [\n // switch track layout and surface\n 'relative inline-flex h-7 w-12 shrink-0 items-center justify-start overflow-hidden rounded-full bg-default-200 px-1 transition-background',\n // selected track colors\n 'group-data-[selected=true]:bg-primary group-data-[selected=true]:text-primary-foreground',\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 // reduced motion\n 'motion-reduce:transition-none',\n ],\n },\n variants: {\n size: {\n lg: {\n endContent: 'text-medium',\n startContent: 'text-medium',\n thumb:\n 'h-6 w-6 text-medium group-data-[selected=true]:group-data-[pressed=true]:ms-5 group-data-[selected=true]:ms-6 group-data-[pressed=true]:w-7',\n wrapper: 'h-8 w-14',\n },\n md: {},\n sm: {\n endContent: 'text-tiny',\n startContent: 'text-tiny',\n thumb:\n 'h-4 w-4 text-tiny group-data-[selected=true]:group-data-[pressed=true]:ms-3 group-data-[selected=true]:ms-4 group-data-[pressed=true]:w-5',\n wrapper: 'h-6 w-10',\n },\n },\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\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 },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof switchVariants>;\n\nexport type ClassName = TVClassName<typeof switchVariants>;\n"],"mappings":";;;;AAOA,MAAa,iBAAiB,GAAG;CAC/B,QAAQ;CACR,OAAO;;EAEL,MAAM;;EAEN,YAAY;GAEV;GAEA;GAEA;EACF;;EAEA,OAAO,CACL,mBAAmB,MAEnB,+CACF;;EAEA,cAAc;;EAEd,cAAc;GAEZ;GAEA;GAEA;EACF;;EAEA,OAAO;GAEL;GAEA;GAEA;EACF;;EAEA,WAAW;;EAEX,SAAS;GAEP;GAEA;GAEA;GAEA;EACF;CACF;CACA,UAAU;EACR,MAAM;GACJ,IAAI;IACF,YAAY;IACZ,cAAc;IACd,OACE;IACF,SAAS;GACX;GACA,IAAI,CAAC;GACL,IAAI;IACF,YAAY;IACZ,cAAc;IACd,OACE;IACF,SAAS;GACX;EACF;EACA,UAAU,EAAE,MAAM,EAAE,MAAM,uCAAuC,EAAE;EACnE,UAAU,EACR,MAAM,EAEJ,MAAM,4DACR,EACF;CACF;AACF,CAAC"}
@@ -1,15 +1,17 @@
1
+ import { t as fieldHelperVariants } from "./fieldHelperVariants-ClP8taiS.mjs";
2
+ import { t as fieldLabelVariants } from "./fieldLabelVariants-C4ZqECec.mjs";
1
3
  import { tv } from "@fuf-stack/pixel-utils";
2
4
  // src/Time/timeVariants.ts
3
5
  /** Shared segmented input defaults, also extended by DatePicker */
4
6
  const segmentedInputVariants = tv({ slots: {
5
- /** Field container with space for supporting text */
6
- base: "group flex w-full flex-col gap-y-1.5 pb-5",
7
- /** Field description text */
8
- description: "text-foreground-500 text-tiny",
9
- /** Validation message text */
10
- errorMessage: "text-danger text-tiny",
11
- /** Supporting text below the input surface */
12
- helperWrapper: ["absolute start-0 top-[calc(100%_+_2px)] flex flex-col gap-1.5", "p-0"],
7
+ /** Field container */
8
+ base: "group flex w-full flex-col",
9
+ /** Help text below the control */
10
+ description: fieldHelperVariants.slots.description,
11
+ /** Validation message container */
12
+ errorMessage: fieldHelperVariants.slots.errorMessage,
13
+ /** Container for help text and validation messages */
14
+ helperWrapper: fieldHelperVariants.slots.helperWrapper,
13
15
  /** Row containing segments and optional controls */
14
16
  innerWrapper: "flex h-6 w-full items-center gap-x-2 text-default-400",
15
17
  /** Editable date or time segment group */
@@ -24,7 +26,7 @@ const segmentedInputVariants = tv({ slots: {
24
26
  "bg-content1 focus-within:border-focus"
25
27
  ],
26
28
  /** Label above the segmented input */
27
- label: ["block w-full text-foreground subpixel-antialiased text-small", "cursor-default"],
29
+ label: [fieldLabelVariants.base, "block w-full"],
28
30
  /** Individual editable value or separator */
29
31
  segment: [
30
32
  "outline-solid focus:shadow-xs",
@@ -55,4 +57,4 @@ const timeVariants = tv({
55
57
  });
56
58
  export { timeVariants as n, segmentedInputVariants as t };
57
59
 
58
- //# sourceMappingURL=timeVariants-CtXyNKmW.mjs.map
60
+ //# sourceMappingURL=timeVariants-Bkt4iwXx.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"timeVariants-Bkt4iwXx.mjs","names":[],"sources":["../src/Time/timeVariants.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\n\nimport { tv } from '@fuf-stack/pixel-utils';\n\nimport { fieldHelperVariants } from '../partials/FieldHelper/fieldHelperVariants';\nimport { fieldLabelVariants } from '../partials/FieldLabel/fieldLabelVariants';\n\n/** Shared segmented input defaults, also extended by DatePicker */\nexport const segmentedInputVariants = tv({\n // reference slots instead of extending, tv types follow only one extend level\n slots: {\n /** Field container */\n base: 'group flex w-full flex-col',\n /** Help text below the control */\n description: fieldHelperVariants.slots.description,\n /** Validation message container */\n errorMessage: fieldHelperVariants.slots.errorMessage,\n /** Container for help text and validation messages */\n helperWrapper: fieldHelperVariants.slots.helperWrapper,\n /** Row containing segments and optional controls */\n innerWrapper: 'flex h-6 w-full items-center gap-x-2 text-default-400',\n /** Editable date or time segment group */\n input: 'flex h-full w-full gap-x-0.5 font-normal text-small',\n /** Bordered surface around the editable segments */\n inputWrapper: [\n // segmented control frame and layout\n 'shadow-xs relative inline-flex h-10 min-h-10 w-full cursor-text flex-row items-center gap-3',\n // border and padding\n 'rounded-small border-2 border-default-200 px-3',\n // color transitions\n 'transition-colors duration-150',\n // hover and focus borders\n 'hover:border-default-400 focus-within:hover:border-default-foreground',\n // reduced motion\n 'motion-reduce:transition-none',\n // surface color and focused border\n 'bg-content1 focus-within:border-focus',\n ],\n /** Label above the segmented input */\n label: [fieldLabelVariants.base, 'block w-full'],\n /** Individual editable value or separator */\n segment: [\n // segment focus outline and shadow\n 'outline-solid focus:shadow-xs',\n // segment spacing and typography\n 'group my-auto box-content inline-block rounded-md px-0.5 text-start tabular-nums text-foreground-500 outline-transparent',\n // color transition\n 'transition-colors',\n // first segment alignment and focus background\n 'first:-ml-0.5 focus:bg-default-400/50',\n // editable values and empty placeholders\n 'data-[editable=true]:data-[placeholder=true]:text-foreground-500 data-[editable=true]:text-foreground data-[editable=true]:focus:text-default-foreground',\n // reduced motion\n 'motion-reduce:transition-none',\n // spacing between subsequent segments\n '[&:not(:first-child)]:-ml-1',\n ],\n },\n});\n\nexport const timeVariants = tv({\n extend: segmentedInputVariants,\n variants: {\n disabled: { true: { base: 'pointer-events-none opacity-disabled' } },\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 },\n },\n invalid: {\n true: {\n innerWrapper: 'text-danger',\n inputWrapper:\n 'border-danger focus-within:border-danger hover:border-danger focus-within:hover:border-danger',\n label: 'text-danger',\n segment: [\n // invalid text and focus background\n 'text-danger-300 focus:bg-danger-400/50',\n // editable values and empty placeholders\n 'data-[editable=true]:data-[placeholder=true]:text-danger data-[editable=true]:text-danger data-[editable=true]:focus:text-danger',\n // dark theme focus background\n 'dark:focus:bg-danger-400/20',\n ],\n },\n },\n },\n});\n\nexport type VariantProps = TVProps<typeof timeVariants>;\n\nexport type ClassName = TVClassName<typeof timeVariants>;\n\n/** Resolved class names for the segmented time slots */\nexport type TimeClassNames = Record<\n keyof ReturnType<typeof timeVariants>,\n string\n>;\n"],"mappings":";;;;;AAQA,MAAa,yBAAyB,GAAG,EAEvC,OAAO;;CAEL,MAAM;;CAEN,aAAa,oBAAoB,MAAM;;CAEvC,cAAc,oBAAoB,MAAM;;CAExC,eAAe,oBAAoB,MAAM;;CAEzC,cAAc;;CAEd,OAAO;;CAEP,cAAc;EAEZ;EAEA;EAEA;EAEA;EAEA;EAEA;CACF;;CAEA,OAAO,CAAC,mBAAmB,MAAM,cAAc;;CAE/C,SAAS;EAEP;EAEA;EAEA;EAEA;EAEA;EAEA;EAEA;CACF;AACF,EACF,CAAC;AAED,MAAa,eAAe,GAAG;CAC7B,QAAQ;CACR,UAAU;EACR,UAAU,EAAE,MAAM,EAAE,MAAM,uCAAuC,EAAE;EACnE,UAAU,EACR,MAAM,EAEJ,MAAM,4DACR,EACF;EACA,SAAS,EACP,MAAM;GACJ,cAAc;GACd,cACE;GACF,OAAO;GACP,SAAS;IAEP;IAEA;IAEA;GACF;EACF,EACF;CACF;AACF,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { a as useSensitiveField } from "./FormContext-PXkVlBdU.mjs";
2
2
  import { flattenFieldErrors, isValueEmpty } from "./helpers/index.mjs";
3
3
  import { t as FieldCopyTestIdButton_default } from "./FieldCopyTestIdButton-D3_jZYJ1.mjs";
4
- import { t as FieldValidationError_default } from "./FieldValidationError-iAayfTEw.mjs";
4
+ import { t as FieldValidationError_default } from "./FieldValidationError-BuLvuRyi.mjs";
5
5
  import { t as useController } from "./useController-JtIeurpw.mjs";
6
6
  import { n as useFormContext } from "./useFormContext-piqnN2L-.mjs";
7
7
  import { t as useInputValueTransform } from "./useInputValueTransform-CXWWFhy_.mjs";
@@ -98,31 +98,6 @@ const useUniformField = (params) => {
98
98
  resetField
99
99
  };
100
100
  };
101
- // src/partials/FieldLabel/FieldLabel.tsx
102
- /**
103
- * Shared field label and required indicator
104
- *
105
- * Uses a native label by default, with span/div hosts for nested labels and
106
- * headings, or React Aria Label for fields that supply label context
107
- *
108
- * @see https://react-aria.adobe.com/TextField
109
- * @see https://react-aria.adobe.com/CheckboxGroup
110
- */
111
- const FieldLabel = ({ as: Component = "label", children, className = void 0, htmlFor = void 0, id = void 0, required = false, requiredClassName = "ml-0.5 text-danger", ...props }) => {
112
- if (!children) return null;
113
- return /* @__PURE__ */ jsxs(Component, {
114
- ...props,
115
- className,
116
- "data-slot": "label",
117
- htmlFor,
118
- id,
119
- children: [children, required ? /* @__PURE__ */ jsx("span", {
120
- "aria-hidden": true,
121
- className: requiredClassName,
122
- children: "*"
123
- }) : null]
124
- });
125
- };
126
- export { useUniformField as n, FieldLabel as t };
101
+ export { useUniformField as t };
127
102
 
128
- //# sourceMappingURL=FieldLabel-DrNWJIVh.mjs.map
103
+ //# sourceMappingURL=useUniformField-TTNPTsVn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useUniformField-TTNPTsVn.mjs","names":["FieldCopyTestIdButton","FieldValidationError"],"sources":["../src/hooks/useUniformField/useUniformField.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FieldValues } from 'react-hook-form';\nimport type { UniformFieldState, UseUniformFieldParams } from './types';\n\nimport React from 'react';\n\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { useSensitiveField } from '../../Form/subcomponents/SensitiveFields';\nimport { flattenFieldErrors, isValueEmpty } from '../../helpers';\nimport FieldCopyTestIdButton from '../../partials/FieldCopyTestIdButton';\nimport FieldValidationError from '../../partials/FieldValidationError';\nimport { useController } from '../useController/useController';\nimport { useFormContext } from '../useFormContext/useFormContext';\nimport { useInputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\n/**\n * Binds a form field's value, interactions, validation and label metadata\n *\n * Converts stored values for display and edited values back to form values\n * through `transform`, with automatic number conversion for numeric inputs\n *\n * Reveals validation errors after editing a nonempty value, blur or submission,\n * keeping pristine fields quiet. Debounces invalid-state changes to avoid\n * flickering during validation updates\n *\n * Returns a bound `field` with callbacks, a focus ref, rendered validation\n * messages and label content, including the test ID action in debug mode\n * Stable IDs and accessible-name metadata support associations in controls\n * Form operations remain separate from the field bundle\n *\n * Only `disabled` reaches the form controller, so disabled values are omitted\n * from validation and submission. Read-only fields stay registered, controls\n * prevent changes while their value is still validated and submitted\n */\nconst useUniformField = <\n TFieldValues extends FieldValues = FieldValues,\n TDisplay = unknown,\n>(\n params: UseUniformFieldParams<TFieldValues, TDisplay>,\n): UniformFieldState<TFieldValues, TDisplay> => {\n // field configuration\n const {\n name,\n ariaLabel: customAriaLabel,\n disabled = false,\n description,\n isArrayValue = false,\n testId: explicitTestId,\n label,\n placeholder,\n readOnly = false,\n sensitive = false,\n type,\n transform,\n } = params;\n\n // revealing a password never changes its diagnostic redaction\n useSensitiveField(name, type === 'password' || sensitive);\n\n // stable associations between the control, label and messages\n const associationId = React.useId();\n const ids = {\n control: `uniform-${associationId}`,\n label: `uniform-${associationId}-label`,\n description: `uniform-${associationId}-description`,\n error: `uniform-${associationId}-error`,\n };\n\n // form operations and submission state\n const {\n control,\n debugMode,\n formState: { submitCount },\n formReset,\n getFieldState,\n getValues,\n resetField,\n } = useFormContext<TFieldValues>();\n\n // validation and interaction state\n const {\n error: rawError,\n invalid: rawInvalid,\n isDirty,\n isTouched,\n required,\n testId,\n } = getFieldState(name, explicitTestId);\n\n // register the field and connect its value and callbacks\n const { field: controllerField } = useController<TFieldValues>({\n control,\n disabled,\n name,\n });\n\n const {\n onChange: fieldOnChange,\n value: fieldValue,\n disabled: isDisabled,\n onBlur,\n ref,\n } = controllerField;\n\n // convert between stored form values and displayed values\n const { toDisplayValue, toFormValue } = useInputValueTransform<TDisplay>({\n transform,\n type,\n });\n\n const transformedValue = toDisplayValue(fieldValue);\n const transformedOnChange = (eventOrValue: TDisplay | React.ChangeEvent) => {\n // accept native events as well as direct values\n const displayValue =\n (eventOrValue as React.ChangeEvent<HTMLInputElement>)?.target?.value ??\n eventOrValue;\n const formValue = toFormValue(displayValue as TDisplay);\n fieldOnChange(formValue);\n };\n\n const defaultValue = (getValues() as Record<string, unknown>)?.[\n name as string\n ];\n\n // show errors after editing a nonempty value, blur or submission\n const hasValue = !isValueEmpty(fieldValue);\n const showInvalid =\n rawInvalid && ((isDirty && hasValue) || isTouched || submitCount > 0);\n\n // allow validation messages to finish their exit animation\n const invalid = useDebounce(showInvalid, 200);\n\n // include the test ID action when debugging fields\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const labelNode: ReactNode | null =\n !!label || showTestIdCopyButton ? (\n <>\n {label !== false ? label : null}\n {showTestIdCopyButton ? (\n <FieldCopyTestIdButton testId={testId} />\n ) : null}\n </>\n ) : null;\n\n // preserve nested errors for groups, flatten messages for rendering\n const error = isArrayValue ? flattenFieldErrors(rawError) : rawError;\n const normalizedError = flattenFieldErrors(rawError);\n const errorMessage = (\n <FieldValidationError error={normalizedError} testId={testId} />\n );\n\n // prefer a visible label, use placeholder text only when the field has no label\n const fallbackLabel = !label && placeholder?.trim() ? placeholder : name;\n const ariaLabel =\n customAriaLabel ??\n (label && typeof label === 'string' ? label : fallbackLabel);\n\n // collect the bound field without exposing controller internals\n const field = {\n ariaLabel,\n customAriaLabel,\n defaultValue,\n description,\n disabled: isDisabled,\n error,\n errorMessage,\n hasErrors: normalizedError.length > 0,\n hasLabel: !!label,\n ids,\n invalid,\n label: labelNode,\n name: controllerField.name,\n onBlur,\n onChange: transformedOnChange,\n readOnly,\n ref,\n required,\n testId,\n value: transformedValue,\n };\n\n return {\n control,\n debugMode,\n field,\n formReset,\n getValues,\n resetField,\n };\n};\n\nexport default useUniformField;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,mBAIJ,WAC8C;CAE9C,MAAM,EACJ,MACA,WAAW,iBACX,WAAW,OACX,aACA,eAAe,OACf,QAAQ,gBACR,OACA,aACA,WAAW,OACX,YAAY,OACZ,MACA,cACE;CAGJ,kBAAkB,MAAM,SAAS,cAAc,SAAS;CAGxD,MAAM,gBAAgB,MAAM,MAAM;CAClC,MAAM,MAAM;EACV,SAAS,WAAW;EACpB,OAAO,WAAW,cAAc;EAChC,aAAa,WAAW,cAAc;EACtC,OAAO,WAAW,cAAc;CAClC;CAGA,MAAM,EACJ,SACA,WACA,WAAW,EAAE,eACb,WACA,eACA,WACA,eACE,eAA6B;CAGjC,MAAM,EACJ,OAAO,UACP,SAAS,YACT,SACA,WACA,UACA,WACE,cAAc,MAAM,cAAc;CAGtC,MAAM,EAAE,OAAO,oBAAoB,cAA4B;EAC7D;EACA;EACA;CACF,CAAC;CAED,MAAM,EACJ,UAAU,eACV,OAAO,YACP,UAAU,YACV,QACA,QACE;CAGJ,MAAM,EAAE,gBAAgB,gBAAgB,uBAAiC;EACvE;EACA;CACF,CAAC;CAED,MAAM,mBAAmB,eAAe,UAAU;CAClD,MAAM,uBAAuB,iBAA+C;EAE1E,MAAM,eACH,cAAsD,QAAQ,SAC/D;EACF,MAAM,YAAY,YAAY,YAAwB;EACtD,cAAc,SAAS;CACzB;CAEA,MAAM,eAAgB,UAAU,CAAC,GAC/B;CAIF,MAAM,WAAW,CAAC,aAAa,UAAU;CAKzC,MAAM,UAAU,YAHd,eAAgB,WAAW,YAAa,aAAa,cAAc,IAG5B,GAAG;CAG5C,MAAM,uBAAuB,cAAc;CAC3C,MAAM,YACJ,CAAC,CAAC,SAAS,uBACT,qBAAA,UAAA,EAAA,UAAA,CACG,UAAU,QAAQ,QAAQ,MAC1B,uBACC,oBAACA,+BAAD,EAA+B,OAAS,CAAA,IACtC,IACJ,EAAA,CAAA,IACA;CAGN,MAAM,QAAQ,eAAe,mBAAmB,QAAQ,IAAI;CAC5D,MAAM,kBAAkB,mBAAmB,QAAQ;CACnD,MAAM,eACJ,oBAACC,8BAAD;EAAsB,OAAO;EAAyB;CAAS,CAAA;CAIjE,MAAM,gBAAgB,CAAC,SAAS,aAAa,KAAK,IAAI,cAAc;CA6BpE,OAAO;EACL;EACA;EACA,OAAA;GAzBA,WALA,oBACC,SAAS,OAAO,UAAU,WAAW,QAAQ;GAK9C;GACA;GACA;GACA,UAAU;GACV;GACA;GACA,WAAW,gBAAgB,SAAS;GACpC,UAAU,CAAC,CAAC;GACZ;GACA;GACA,OAAO;GACP,MAAM,gBAAgB;GACtB;GACA,UAAU;GACV;GACA;GACA;GACA;GACA,OAAO;EAMH;EACJ;EACA;EACA;CACF;AACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuf-stack/uniform",
3
- "version": "2.0.0-next.3",
3
+ "version": "2.0.0-next.4",
4
4
  "description": "fuf react form library",
5
5
  "author": "Fröhlich ∧ Frei",
6
6
  "homepage": "https://github.com/fuf-stack/pixels#readme",
@@ -25,6 +25,8 @@
25
25
  "./hooks/useWatchUserChange": "./dist/hooks/useWatchUserChange/index.mjs",
26
26
  "./Input": "./dist/Input/index.mjs",
27
27
  "./partials/FieldCopyTestIdButton": "./dist/partials/FieldCopyTestIdButton/index.mjs",
28
+ "./partials/FieldHelper": "./dist/partials/FieldHelper/index.mjs",
29
+ "./partials/FieldLabel": "./dist/partials/FieldLabel/index.mjs",
28
30
  "./partials/FieldValidationError": "./dist/partials/FieldValidationError/index.mjs",
29
31
  "./RadioBoxes": "./dist/RadioBoxes/index.mjs",
30
32
  "./Radios": "./dist/Radios/index.mjs",
@@ -88,5 +90,5 @@
88
90
  "react": "19.3.1",
89
91
  "react-dom": "19.3.1"
90
92
  },
91
- "gitHead": "50d6df62dcc5bd2570bd129476cb4a5a36fc15ed"
93
+ "gitHead": "90f8a3935fb30fb27ffb6ef1174f0d371b233769"
92
94
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldDescription-X_0s1Lhu.mjs","names":[],"sources":["../src/helpers/fieldProps/fieldProps.ts","../src/partials/FieldDescription/FieldDescription.tsx"],"sourcesContent":["import type { UniformField } from '../../hooks/useUniformField/types';\nimport type { FieldControlProps } from '../../partials/types';\n\ninterface FieldDataState {\n /** Disables interaction with the field */\n disabled?: boolean;\n /** Marks visible validation failure */\n invalid?: boolean;\n /** Prevents changes to the field */\n readOnly?: boolean;\n /** Marks a required field */\n required?: boolean;\n}\n\n/** Shared styling attributes for field state, inactive flags are omitted */\nexport const getFieldDataAttributes = ({\n disabled,\n invalid,\n readOnly,\n required,\n}: FieldDataState) => {\n return {\n 'data-disabled': disabled ? true : undefined,\n 'data-invalid': invalid ? true : undefined,\n 'data-readonly': readOnly ? true : undefined,\n 'data-required': required ? true : undefined,\n };\n};\n\n/** Field metadata needed to associate an editable control with its content */\ntype FieldControlState = Pick<\n UniformField,\n | 'ariaLabel'\n | 'customAriaLabel'\n | 'description'\n | 'hasErrors'\n | 'hasLabel'\n | 'ids'\n | 'invalid'\n | 'required'\n>;\n\n/** ID and ARIA associations for the editable control or selection group */\nexport const getFieldControlProps = ({\n ariaLabel,\n customAriaLabel,\n description,\n hasErrors,\n hasLabel,\n ids,\n invalid,\n required,\n}: FieldControlState): FieldControlProps => {\n return {\n id: ids.control,\n 'aria-label': customAriaLabel ?? (!hasLabel ? ariaLabel : undefined),\n 'aria-labelledby': !customAriaLabel && hasLabel ? ids.label : undefined,\n 'aria-describedby':\n [\n description ? ids.description : undefined,\n invalid && hasErrors ? ids.error : undefined,\n ]\n .filter(Boolean)\n .join(' ') || undefined,\n 'aria-invalid': invalid || undefined,\n 'aria-required': required || undefined,\n };\n};\n","import type { HTMLAttributes, ReactNode } from 'react';\n\ninterface FieldDescriptionProps extends HTMLAttributes<HTMLDivElement> {\n /** Help text */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n}\n\n/** Help text associated with a field through its description ID */\nconst FieldDescription = ({ children, ...props }: FieldDescriptionProps) => {\n if (!children) {\n return null;\n }\n\n return (\n <div data-slot=\"description\" {...props}>\n {children}\n </div>\n );\n};\n\nexport default FieldDescription;\n"],"mappings":";;;AAeA,MAAa,0BAA0B,EACrC,UACA,SACA,UACA,eACoB;CACpB,OAAO;EACL,iBAAiB,WAAW,OAAO,KAAA;EACnC,gBAAgB,UAAU,OAAO,KAAA;EACjC,iBAAiB,WAAW,OAAO,KAAA;EACnC,iBAAiB,WAAW,OAAO,KAAA;CACrC;AACF;;AAgBA,MAAa,wBAAwB,EACnC,WACA,iBACA,aACA,WACA,UACA,KACA,SACA,eAC0C;CAC1C,OAAO;EACL,IAAI,IAAI;EACR,cAAc,oBAAoB,CAAC,WAAW,YAAY,KAAA;EAC1D,mBAAmB,CAAC,mBAAmB,WAAW,IAAI,QAAQ,KAAA;EAC9D,oBACE,CACE,cAAc,IAAI,cAAc,KAAA,GAChC,WAAW,YAAY,IAAI,QAAQ,KAAA,CACrC,CAAC,CACE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG,KAAK,KAAA;EAClB,gBAAgB,WAAW,KAAA;EAC3B,iBAAiB,YAAY,KAAA;CAC/B;AACF;;;ACzDA,MAAM,oBAAoB,EAAE,UAAU,GAAG,YAAmC;CAC1E,IAAI,CAAC,UACH,OAAO;CAGT,OACE,oBAAC,OAAD;EAAK,aAAU;EAAc,GAAI;EAC9B;CACE,CAAA;AAET"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldLabel-DrNWJIVh.mjs","names":["FieldCopyTestIdButton","FieldValidationError"],"sources":["../src/hooks/useUniformField/useUniformField.tsx","../src/partials/FieldLabel/FieldLabel.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { FieldValues } from 'react-hook-form';\nimport type { UniformFieldState, UseUniformFieldParams } from './types';\n\nimport React from 'react';\n\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { useSensitiveField } from '../../Form/subcomponents/SensitiveFields';\nimport { flattenFieldErrors, isValueEmpty } from '../../helpers';\nimport FieldCopyTestIdButton from '../../partials/FieldCopyTestIdButton';\nimport FieldValidationError from '../../partials/FieldValidationError';\nimport { useController } from '../useController/useController';\nimport { useFormContext } from '../useFormContext/useFormContext';\nimport { useInputValueTransform } from '../useInputValueTransform/useInputValueTransform';\n\n/**\n * Binds a form field's value, interactions, validation and label metadata\n *\n * Converts stored values for display and edited values back to form values\n * through `transform`, with automatic number conversion for numeric inputs\n *\n * Reveals validation errors after editing a nonempty value, blur or submission,\n * keeping pristine fields quiet. Debounces invalid-state changes to avoid\n * flickering during validation updates\n *\n * Returns a bound `field` with callbacks, a focus ref, rendered validation\n * messages and label content, including the test ID action in debug mode\n * Stable IDs and accessible-name metadata support associations in controls\n * Form operations remain separate from the field bundle\n *\n * Only `disabled` reaches the form controller, so disabled values are omitted\n * from validation and submission. Read-only fields stay registered, controls\n * prevent changes while their value is still validated and submitted\n */\nconst useUniformField = <\n TFieldValues extends FieldValues = FieldValues,\n TDisplay = unknown,\n>(\n params: UseUniformFieldParams<TFieldValues, TDisplay>,\n): UniformFieldState<TFieldValues, TDisplay> => {\n // field configuration\n const {\n name,\n ariaLabel: customAriaLabel,\n disabled = false,\n description,\n isArrayValue = false,\n testId: explicitTestId,\n label,\n placeholder,\n readOnly = false,\n sensitive = false,\n type,\n transform,\n } = params;\n\n // revealing a password never changes its diagnostic redaction\n useSensitiveField(name, type === 'password' || sensitive);\n\n // stable associations between the control, label and messages\n const associationId = React.useId();\n const ids = {\n control: `uniform-${associationId}`,\n label: `uniform-${associationId}-label`,\n description: `uniform-${associationId}-description`,\n error: `uniform-${associationId}-error`,\n };\n\n // form operations and submission state\n const {\n control,\n debugMode,\n formState: { submitCount },\n formReset,\n getFieldState,\n getValues,\n resetField,\n } = useFormContext<TFieldValues>();\n\n // validation and interaction state\n const {\n error: rawError,\n invalid: rawInvalid,\n isDirty,\n isTouched,\n required,\n testId,\n } = getFieldState(name, explicitTestId);\n\n // register the field and connect its value and callbacks\n const { field: controllerField } = useController<TFieldValues>({\n control,\n disabled,\n name,\n });\n\n const {\n onChange: fieldOnChange,\n value: fieldValue,\n disabled: isDisabled,\n onBlur,\n ref,\n } = controllerField;\n\n // convert between stored form values and displayed values\n const { toDisplayValue, toFormValue } = useInputValueTransform<TDisplay>({\n transform,\n type,\n });\n\n const transformedValue = toDisplayValue(fieldValue);\n const transformedOnChange = (eventOrValue: TDisplay | React.ChangeEvent) => {\n // accept native events as well as direct values\n const displayValue =\n (eventOrValue as React.ChangeEvent<HTMLInputElement>)?.target?.value ??\n eventOrValue;\n const formValue = toFormValue(displayValue as TDisplay);\n fieldOnChange(formValue);\n };\n\n const defaultValue = (getValues() as Record<string, unknown>)?.[\n name as string\n ];\n\n // show errors after editing a nonempty value, blur or submission\n const hasValue = !isValueEmpty(fieldValue);\n const showInvalid =\n rawInvalid && ((isDirty && hasValue) || isTouched || submitCount > 0);\n\n // allow validation messages to finish their exit animation\n const invalid = useDebounce(showInvalid, 200);\n\n // include the test ID action when debugging fields\n const showTestIdCopyButton = debugMode === 'debug-testids';\n const labelNode: ReactNode | null =\n !!label || showTestIdCopyButton ? (\n <>\n {label !== false ? label : null}\n {showTestIdCopyButton ? (\n <FieldCopyTestIdButton testId={testId} />\n ) : null}\n </>\n ) : null;\n\n // preserve nested errors for groups, flatten messages for rendering\n const error = isArrayValue ? flattenFieldErrors(rawError) : rawError;\n const normalizedError = flattenFieldErrors(rawError);\n const errorMessage = (\n <FieldValidationError error={normalizedError} testId={testId} />\n );\n\n // prefer a visible label, use placeholder text only when the field has no label\n const fallbackLabel = !label && placeholder?.trim() ? placeholder : name;\n const ariaLabel =\n customAriaLabel ??\n (label && typeof label === 'string' ? label : fallbackLabel);\n\n // collect the bound field without exposing controller internals\n const field = {\n ariaLabel,\n customAriaLabel,\n defaultValue,\n description,\n disabled: isDisabled,\n error,\n errorMessage,\n hasErrors: normalizedError.length > 0,\n hasLabel: !!label,\n ids,\n invalid,\n label: labelNode,\n name: controllerField.name,\n onBlur,\n onChange: transformedOnChange,\n readOnly,\n ref,\n required,\n testId,\n value: transformedValue,\n };\n\n return {\n control,\n debugMode,\n field,\n formReset,\n getValues,\n resetField,\n };\n};\n\nexport default useUniformField;\n","import type { HTMLAttributes, ReactNode } from 'react';\nimport type { Label as AriaLabel } from 'react-aria-components';\n\ninterface FieldLabelProps extends Pick<\n HTMLAttributes<HTMLElement>,\n 'aria-level' | 'role'\n> {\n /** Label element, React Aria Label preserves the surrounding field context */\n as?: 'label' | 'div' | 'span' | typeof AriaLabel;\n /** Label content */\n children: ReactNode;\n /** CSS class name */\n className?: string;\n /** ID of the labeled control */\n htmlFor?: string;\n /** Label ID */\n id?: string;\n /** Shows the required indicator */\n required?: boolean;\n /** Required indicator CSS class name */\n requiredClassName?: string;\n}\n\n/**\n * Shared field label and required indicator\n *\n * Uses a native label by default, with span/div hosts for nested labels and\n * headings, or React Aria Label for fields that supply label context\n *\n * @see https://react-aria.adobe.com/TextField\n * @see https://react-aria.adobe.com/CheckboxGroup\n */\nconst FieldLabel = ({\n as: Component = 'label',\n children,\n className = undefined,\n htmlFor = undefined,\n id = undefined,\n required = false,\n requiredClassName = 'ml-0.5 text-danger',\n ...props\n}: FieldLabelProps) => {\n if (!children) {\n return null;\n }\n\n return (\n <Component\n {...props}\n className={className}\n data-slot=\"label\"\n htmlFor={htmlFor}\n id={id}\n >\n {children}\n {required ? (\n <span aria-hidden className={requiredClassName}>\n *\n </span>\n ) : null}\n </Component>\n );\n};\n\nexport default FieldLabel;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCA,MAAM,mBAIJ,WAC8C;CAE9C,MAAM,EACJ,MACA,WAAW,iBACX,WAAW,OACX,aACA,eAAe,OACf,QAAQ,gBACR,OACA,aACA,WAAW,OACX,YAAY,OACZ,MACA,cACE;CAGJ,kBAAkB,MAAM,SAAS,cAAc,SAAS;CAGxD,MAAM,gBAAgB,MAAM,MAAM;CAClC,MAAM,MAAM;EACV,SAAS,WAAW;EACpB,OAAO,WAAW,cAAc;EAChC,aAAa,WAAW,cAAc;EACtC,OAAO,WAAW,cAAc;CAClC;CAGA,MAAM,EACJ,SACA,WACA,WAAW,EAAE,eACb,WACA,eACA,WACA,eACE,eAA6B;CAGjC,MAAM,EACJ,OAAO,UACP,SAAS,YACT,SACA,WACA,UACA,WACE,cAAc,MAAM,cAAc;CAGtC,MAAM,EAAE,OAAO,oBAAoB,cAA4B;EAC7D;EACA;EACA;CACF,CAAC;CAED,MAAM,EACJ,UAAU,eACV,OAAO,YACP,UAAU,YACV,QACA,QACE;CAGJ,MAAM,EAAE,gBAAgB,gBAAgB,uBAAiC;EACvE;EACA;CACF,CAAC;CAED,MAAM,mBAAmB,eAAe,UAAU;CAClD,MAAM,uBAAuB,iBAA+C;EAE1E,MAAM,eACH,cAAsD,QAAQ,SAC/D;EACF,MAAM,YAAY,YAAY,YAAwB;EACtD,cAAc,SAAS;CACzB;CAEA,MAAM,eAAgB,UAAU,CAAC,GAC/B;CAIF,MAAM,WAAW,CAAC,aAAa,UAAU;CAKzC,MAAM,UAAU,YAHd,eAAgB,WAAW,YAAa,aAAa,cAAc,IAG5B,GAAG;CAG5C,MAAM,uBAAuB,cAAc;CAC3C,MAAM,YACJ,CAAC,CAAC,SAAS,uBACT,qBAAA,UAAA,EAAA,UAAA,CACG,UAAU,QAAQ,QAAQ,MAC1B,uBACC,oBAACA,+BAAD,EAA+B,OAAS,CAAA,IACtC,IACJ,EAAA,CAAA,IACA;CAGN,MAAM,QAAQ,eAAe,mBAAmB,QAAQ,IAAI;CAC5D,MAAM,kBAAkB,mBAAmB,QAAQ;CACnD,MAAM,eACJ,oBAACC,8BAAD;EAAsB,OAAO;EAAyB;CAAS,CAAA;CAIjE,MAAM,gBAAgB,CAAC,SAAS,aAAa,KAAK,IAAI,cAAc;CA6BpE,OAAO;EACL;EACA;EACA,OAAA;GAzBA,WALA,oBACC,SAAS,OAAO,UAAU,WAAW,QAAQ;GAK9C;GACA;GACA;GACA,UAAU;GACV;GACA;GACA,WAAW,gBAAgB,SAAS;GACpC,UAAU,CAAC,CAAC;GACZ;GACA;GACA,OAAO;GACP,MAAM,gBAAgB;GACtB;GACA,UAAU;GACV;GACA;GACA;GACA;GACA,OAAO;EAMH;EACJ;EACA;EACA;CACF;AACF;;;;;;;;;;;AC9JA,MAAM,cAAc,EAClB,IAAI,YAAY,SAChB,UACA,YAAY,KAAA,GACZ,UAAU,KAAA,GACV,KAAK,KAAA,GACL,WAAW,OACX,oBAAoB,sBACpB,GAAG,YACkB;CACrB,IAAI,CAAC,UACH,OAAO;CAGT,OACE,qBAAC,WAAD;EACE,GAAI;EACO;EACX,aAAU;EACD;EACL;EALN,UAAA,CAOG,UACA,WACC,oBAAC,QAAD;GAAM,eAAA;GAAY,WAAW;GAAmB,UAAA;EAE1C,CAAA,IACJ,IACK;;AAEf"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldLayout-DcvQU0zN.mjs","names":[],"sources":["../src/partials/FieldLayout/FieldLayout.tsx"],"sourcesContent":["import type {\n ComponentProps,\n ComponentPropsWithRef,\n ElementType,\n ReactNode,\n} from 'react';\nimport type { FieldIds } from '../types';\n\nimport FieldDescription from '../FieldDescription/FieldDescription';\nimport FieldLabel from '../FieldLabel/FieldLabel';\n\ntype ClassName = Partial<\n Record<\n 'base' | 'description' | 'errorMessage' | 'helperWrapper' | 'label',\n string\n >\n>;\n\ntype BaseProps<TBase extends ElementType> = Omit<\n ComponentPropsWithRef<TBase>,\n 'children' | 'className' | 'dangerouslySetInnerHTML'\n> &\n Record<`data-${string}`, string | number | boolean | undefined>;\n\n// require the configuration when the base has props the layout cannot supply\ntype BaseConfiguration<TBase extends ElementType> =\n Record<never, never> extends BaseProps<TBase>\n ? { baseProps?: BaseProps<TBase> }\n : { baseProps: BaseProps<TBase> };\n\ninterface FieldLayoutProps<TBase extends ElementType> {\n /** Component or element used for the base slot */\n baseAs?: TBase;\n /** Attributes, interactions and ref for the base element */\n baseProps?: BaseProps<NoInfer<TBase>>;\n /** Editable field content */\n children: ReactNode;\n /** CSS class name */\n className: ClassName;\n /** Help text */\n description?: ReactNode;\n /** Rendered validation messages */\n errorMessage: ReactNode;\n /** IDs shared with the editable control */\n ids: FieldIds;\n /** Shows the validation message */\n invalid: boolean;\n /** Field label */\n label?: ReactNode;\n /** Label element, use React Aria Label inside group engines */\n labelAs?: ComponentProps<typeof FieldLabel>['as'];\n /** Shows the required indicator */\n required?: boolean;\n}\n\n/**\n * Default arrangement of a field label, editable content and supporting messages\n *\n * Renders the base component around the label, content and messages\n * Receives IDs, resolved classes and validation state\n */\nconst FieldLayout = <TBase extends ElementType = 'div'>({\n baseAs = undefined,\n baseProps = undefined,\n children,\n className,\n description = undefined,\n errorMessage,\n ids,\n invalid,\n label = undefined,\n labelAs = 'label',\n required = false,\n}: FieldLayoutProps<TBase> & BaseConfiguration<NoInfer<TBase>>) => {\n const Base = baseAs ?? 'div';\n\n return (\n <Base {...baseProps} className={className.base} data-slot=\"base\">\n {/* field label */}\n <FieldLabel\n as={labelAs}\n className={className.label}\n htmlFor={labelAs === 'label' ? ids.control : undefined}\n id={ids.label}\n required={required}\n >\n {label}\n </FieldLabel>\n\n {/* editable content */}\n {children}\n\n {/* help text and validation messages */}\n {description || invalid ? (\n <div className={className.helperWrapper} data-slot=\"helper-wrapper\">\n <FieldDescription\n className={className.description}\n id={ids.description}\n >\n {description}\n </FieldDescription>\n {invalid ? (\n <div\n className={className.errorMessage}\n data-slot=\"error-message\"\n id={ids.error}\n >\n {errorMessage}\n </div>\n ) : null}\n </div>\n ) : null}\n </Base>\n );\n};\n\nexport default FieldLayout;\n"],"mappings":";;;;;;;;;;AA6DA,MAAM,eAAkD,EACtD,SAAS,KAAA,GACT,YAAY,KAAA,GACZ,UACA,WACA,cAAc,KAAA,GACd,cACA,KACA,SACA,QAAQ,KAAA,GACR,UAAU,SACV,WAAW,YACsD;CAGjE,OACE,qBAHW,UAAU,OAGrB;EAAM,GAAI;EAAW,WAAW,UAAU;EAAM,aAAU;EAA1D,UAAA;GAEE,oBAAC,YAAD;IACE,IAAI;IACJ,WAAW,UAAU;IACrB,SAAS,YAAY,UAAU,IAAI,UAAU,KAAA;IAC7C,IAAI,IAAI;IACE;IAET,UAAA;GACS,CAAA;GAGX;GAGA,eAAe,UACd,qBAAC,OAAD;IAAK,WAAW,UAAU;IAAe,aAAU;IAAnD,UAAA,CACE,oBAAC,kBAAD;KACE,WAAW,UAAU;KACrB,IAAI,IAAI;KAEP,UAAA;IACe,CAAA,GACjB,UACC,oBAAC,OAAD;KACE,WAAW,UAAU;KACrB,aAAU;KACV,IAAI,IAAI;KAEP,UAAA;IACE,CAAA,IACH,IACD;GACH,CAAA,IAAA;EACA;;AAEV"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldValidationError-iAayfTEw.mjs","names":[],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify, tv } from '@fuf-stack/pixel-utils';\nimport { useStyling } from '@fuf-stack/pixels/StylingProvider';\n\nconst fieldValidationErrorVariants = tv({\n slots: {\n /** List of validation messages */\n base: '',\n /** Animated entry for one validation message */\n item: '',\n /** Padded content inside an animated entry */\n message: 'px-1 pt-1',\n /** Associated error container rendered when an ID is supplied */\n wrapper: '',\n },\n});\n\ntype ClassName = TVClassName<typeof fieldValidationErrorVariants>;\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: ClassName;\n /** Field errors */\n error?: FieldError[];\n /** Error association ID, adds a wrapper referenced by the editable control */\n id?: string;\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Animated validation messages for a form field\n *\n * The owning field controls visibility. Supplying an ID adds an associated\n * error wrapper, otherwise the component renders the standalone list\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n id = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n const styling = useStyling();\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // classNames from slots\n const variants = styling.resolve(fieldValidationErrorVariants);\n const classNames = styling.variantsToClassNames(variants, className, 'base');\n\n const errorList = (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={classNames.base}\n data-component={id === undefined ? 'field-validation-error' : undefined}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n className={classNames.item}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className={classNames.message}>{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n\n if (id === undefined) {\n return errorList;\n }\n\n return (\n <div\n className={classNames.wrapper}\n data-component=\"field-validation-error\"\n data-slot=\"error-message\"\n id={id}\n >\n {errorList}\n </div>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport default FieldValidationError;\n"],"mappings":";;;;;AAWA,MAAM,+BAA+B,GAAG,EACtC,OAAO;;CAEL,MAAM;;CAEN,MAAM;;CAEN,SAAS;;CAET,SAAS;AACX,EACF,CAAC;;;;;;;AAqBD,MAAM,wBAAwB,EAC5B,YAAY,KAAA,GACZ,QAAQ,KAAA,GACR,KAAK,KAAA,GACL,aAC+B;CAC/B,MAAM,UAAU,WAAW;CAE3B,MAAM,mBAAmB,iBAAiB;CAG1C,MAAM,WAAW,QAAQ,QAAQ,4BAA4B;CAC7D,MAAM,aAAa,QAAQ,qBAAqB,UAAU,WAAW,MAAM;CAE3E,MAAM,YACJ,oBAAC,MAAD;EACE,cAAY,8BAA8B;EAC1C,WAAW,WAAW;EACtB,kBAAgB,OAAO,KAAA,IAAY,2BAA2B,KAAA;EAC9D,eAAa,QAAQ,GAAG,OAAO,OAAO;EAEtC,UAAA,oBAAC,iBAAD;GAAiB,SAAS,CAAC;GACxB,UAAA,OAAO,KAAK,EAAE,WAAW,MAAM;IAC9B,OACE,oBAAC,OAAO,IAAR;KAEE,SACE,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;KAAO;KAE9D,WAAW,WAAW;KACtB,MAAM,mBAAmB,KAAA,IAAY;MAAE,SAAS;MAAG,QAAQ;KAAE;KAC7D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;KAAE;KAC5D,OAAO,EAAE,UAAU,SAAS;KAC5B,YAAY;MAAE,UAAU;MAAK,MAAM;KAAU;KAG7C,UAAA,oBAAC,OAAD;MAAK,WAAW,WAAW;MAAU,UAAA;KAAa,CAAA;IACzC,GAZJ,QAAQ,GAAG,OAAO,SAAS,GAAG,CAY1B;GAEf,CAAC;EACc,CAAA;CACf,CAAA;CAGN,IAAI,OAAO,KAAA,GACT,OAAO;CAGT,OACE,oBAAC,OAAD;EACE,WAAW,WAAW;EACtB,kBAAe;EACf,aAAU;EACN;EAEH,UAAA;CACE,CAAA;AAET;;ACjGA,IAAA,+BAAe"}