@epilot/zenith-react 0.2.0 → 0.3.0-next.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (105) hide show
  1. package/CHANGELOG.md +278 -0
  2. package/codemods/README.md +5 -3
  3. package/codemods/migrate/volt/field-combobox.ts +37 -0
  4. package/codemods/migrate/volt/index.ts +2 -0
  5. package/codemods/migrate/volt/same-name.ts +2 -17
  6. package/codemods/radix-to-base-ui.ts +4 -1
  7. package/dist/_virtual/_zenith-runtime-family_autocomplete.js +7 -0
  8. package/dist/_virtual/_zenith-runtime-family_autocomplete.js.map +1 -0
  9. package/dist/components/callout/callout.js +0 -1
  10. package/dist/components/callout/callout.js.map +1 -1
  11. package/dist/components/command/command.js +263 -179
  12. package/dist/components/command/command.js.map +1 -1
  13. package/dist/components/field/field-combobox.js +213 -177
  14. package/dist/components/field/field-combobox.js.map +1 -1
  15. package/dist/components/field/field.js +281 -247
  16. package/dist/components/field/field.js.map +1 -1
  17. package/dist/components/list/list-sortable.js +86 -72
  18. package/dist/components/list/list-sortable.js.map +1 -1
  19. package/dist/components/list/list.js +206 -205
  20. package/dist/components/list/list.js.map +1 -1
  21. package/dist/components/tooltip/tooltip.js +10 -11
  22. package/dist/components/tooltip/tooltip.js.map +1 -1
  23. package/dist/index.d.ts +91 -256
  24. package/dist/index.js +120 -119
  25. package/dist/renderer/runtime-contract.generated.js +4 -4
  26. package/dist/renderer/runtime-contract.generated.js.map +1 -1
  27. package/package.json +39 -4
  28. package/dist/vendor/.bun/@radix-ui_primitive@1.1.3/vendor/@radix-ui/primitive/dist/index.js +0 -10
  29. package/dist/vendor/.bun/@radix-ui_primitive@1.1.3/vendor/@radix-ui/primitive/dist/index.js.map +0 -1
  30. package/dist/vendor/.bun/@radix-ui_react-compose-refs@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-compose-refs/dist/index.js +0 -30
  31. package/dist/vendor/.bun/@radix-ui_react-compose-refs@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-compose-refs/dist/index.js.map +0 -1
  32. package/dist/vendor/.bun/@radix-ui_react-context@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-context/dist/index.js +0 -71
  33. package/dist/vendor/.bun/@radix-ui_react-context@1.1.2_0ac650c021fb1b59/vendor/@radix-ui/react-context/dist/index.js.map +0 -1
  34. package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js +0 -258
  35. package/dist/vendor/.bun/@radix-ui_react-dialog@1.1.15_2b23df507bdda662/vendor/@radix-ui/react-dialog/dist/index.js.map +0 -1
  36. package/dist/vendor/.bun/@radix-ui_react-dismissable-layer@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  37. package/dist/vendor/.bun/@radix-ui_react-dismissable-layer@1.1.11_2b23df507bdda662/vendor/@radix-ui/react-dismissable-layer/dist/index.js.map +0 -1
  38. package/dist/vendor/.bun/@radix-ui_react-focus-guards@1.1.3_0ac650c021fb1b59/vendor/@radix-ui/react-focus-guards/dist/index.js +0 -18
  39. package/dist/vendor/.bun/@radix-ui_react-focus-guards@1.1.3_0ac650c021fb1b59/vendor/@radix-ui/react-focus-guards/dist/index.js.map +0 -1
  40. package/dist/vendor/.bun/@radix-ui_react-focus-scope@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-focus-scope/dist/index.js +0 -138
  41. package/dist/vendor/.bun/@radix-ui_react-focus-scope@1.1.7_2b23df507bdda662/vendor/@radix-ui/react-focus-scope/dist/index.js.map +0 -1
  42. package/dist/vendor/.bun/@radix-ui_react-id@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-id/dist/index.js +0 -14
  43. package/dist/vendor/.bun/@radix-ui_react-id@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-id/dist/index.js.map +0 -1
  44. package/dist/vendor/.bun/@radix-ui_react-portal@1.1.9_2b23df507bdda662/vendor/@radix-ui/react-portal/dist/index.js +0 -17
  45. package/dist/vendor/.bun/@radix-ui_react-portal@1.1.9_2b23df507bdda662/vendor/@radix-ui/react-portal/dist/index.js.map +0 -1
  46. package/dist/vendor/.bun/@radix-ui_react-presence@1.1.5_2b23df507bdda662/vendor/@radix-ui/react-presence/dist/index.js +0 -72
  47. package/dist/vendor/.bun/@radix-ui_react-presence@1.1.5_2b23df507bdda662/vendor/@radix-ui/react-presence/dist/index.js.map +0 -1
  48. package/dist/vendor/.bun/@radix-ui_react-primitive@2.1.3_2b23df507bdda662/vendor/@radix-ui/react-primitive/dist/index.js +0 -37
  49. package/dist/vendor/.bun/@radix-ui_react-primitive@2.1.3_2b23df507bdda662/vendor/@radix-ui/react-primitive/dist/index.js.map +0 -1
  50. package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js +0 -51
  51. package/dist/vendor/.bun/@radix-ui_react-slot@1.2.3_0ac650c021fb1b59/vendor/@radix-ui/react-slot/dist/index.js.map +0 -1
  52. package/dist/vendor/.bun/@radix-ui_react-use-callback-ref@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-callback-ref/dist/index.js +0 -14
  53. package/dist/vendor/.bun/@radix-ui_react-use-callback-ref@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-callback-ref/dist/index.js.map +0 -1
  54. package/dist/vendor/.bun/@radix-ui_react-use-controllable-state@1.2.2_0ac650c021fb1b59/vendor/@radix-ui/react-use-controllable-state/dist/index.js +0 -55
  55. package/dist/vendor/.bun/@radix-ui_react-use-controllable-state@1.2.2_0ac650c021fb1b59/vendor/@radix-ui/react-use-controllable-state/dist/index.js.map +0 -1
  56. package/dist/vendor/.bun/@radix-ui_react-use-escape-keydown@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-escape-keydown/dist/index.js +0 -15
  57. package/dist/vendor/.bun/@radix-ui_react-use-escape-keydown@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-escape-keydown/dist/index.js.map +0 -1
  58. package/dist/vendor/.bun/@radix-ui_react-use-layout-effect@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-layout-effect/dist/index.js +0 -7
  59. package/dist/vendor/.bun/@radix-ui_react-use-layout-effect@1.1.1_0ac650c021fb1b59/vendor/@radix-ui/react-use-layout-effect/dist/index.js.map +0 -1
  60. package/dist/vendor/.bun/aria-hidden@1.2.6/vendor/aria-hidden/dist/es2015/index.js +0 -53
  61. package/dist/vendor/.bun/aria-hidden@1.2.6/vendor/aria-hidden/dist/es2015/index.js.map +0 -1
  62. package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/chunk-NZJY6EH4.js +0 -18
  63. package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/chunk-NZJY6EH4.js.map +0 -1
  64. package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/index.js +0 -313
  65. package/dist/vendor/.bun/cmdk@1.1.1_2b23df507bdda662/vendor/cmdk/dist/index.js.map +0 -1
  66. package/dist/vendor/.bun/get-nonce@1.0.1/vendor/get-nonce/dist/es2015/index.js +0 -8
  67. package/dist/vendor/.bun/get-nonce@1.0.1/vendor/get-nonce/dist/es2015/index.js.map +0 -1
  68. package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/component.js +0 -72
  69. package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/component.js.map +0 -1
  70. package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/constants.js +0 -8
  71. package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/constants.js.map +0 -1
  72. package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/utils.js +0 -26
  73. package/dist/vendor/.bun/react-remove-scroll-bar@2.3.8_0ac650c021fb1b59/vendor/react-remove-scroll-bar/dist/es2015/utils.js.map +0 -1
  74. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/Combination.js +0 -12
  75. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/Combination.js.map +0 -1
  76. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/SideEffect.js +0 -116
  77. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/SideEffect.js.map +0 -1
  78. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/UI.js +0 -32
  79. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/UI.js.map +0 -1
  80. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -17
  81. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/aggresiveCapture.js.map +0 -1
  82. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/handleScroll.js +0 -69
  83. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/handleScroll.js.map +0 -1
  84. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/medium.js +0 -6
  85. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/medium.js.map +0 -1
  86. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/sidecar.js +0 -8
  87. package/dist/vendor/.bun/react-remove-scroll@2.7.2_0ac650c021fb1b59/vendor/react-remove-scroll/dist/es2015/sidecar.js.map +0 -1
  88. package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/component.js +0 -12
  89. package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/component.js.map +0 -1
  90. package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/hook.js +0 -16
  91. package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/hook.js.map +0 -1
  92. package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/singleton.js +0 -31
  93. package/dist/vendor/.bun/react-style-singleton@2.2.3_0ac650c021fb1b59/vendor/react-style-singleton/dist/es2015/singleton.js.map +0 -1
  94. package/dist/vendor/.bun/tslib@2.8.1/vendor/tslib/tslib.es6.js +0 -28
  95. package/dist/vendor/.bun/tslib@2.8.1/vendor/tslib/tslib.es6.js.map +0 -1
  96. package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/assignRef.js +0 -7
  97. package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/assignRef.js.map +0 -1
  98. package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useMergeRef.js +0 -27
  99. package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useMergeRef.js.map +0 -1
  100. package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useRef.js +0 -26
  101. package/dist/vendor/.bun/use-callback-ref@1.3.3_0ac650c021fb1b59/vendor/use-callback-ref/dist/es2015/useRef.js.map +0 -1
  102. package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/exports.js +0 -19
  103. package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/exports.js.map +0 -1
  104. package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/medium.js +0 -68
  105. package/dist/vendor/.bun/use-sidecar@1.1.3_0ac650c021fb1b59/vendor/use-sidecar/dist/es2015/medium.js.map +0 -1
@@ -1,50 +1,62 @@
1
- import { jsx as c } from "react/jsx-runtime";
2
- import * as a from "react";
3
- import { mergeClasses as f, SLOT_ATTR as r, shorthands as d } from "@epilot/zenith-runtime/v1";
4
- import { makeZenithStyles as P } from "../../styles/make-styles.js";
5
- import { boxModel as m, nativeControl as N } from "../../styles/host-reset.js";
6
- import { fontWeightNormal as S, leadingSm as R, textSm as D, grayA11 as O, grayA8 as G, grayA12 as x, fieldPaddingY as w, fieldInputHeight as V, leadingXs as E, textXs as C, errorOnSoft as H, errorA4 as j, errorSoft as I, grayA3 as T, accentA4 as X, accentA3 as Y, grayA4 as q, focusRing as U, spacingElement1 as L, fieldPaddingX as A, spacingElement2 as F, fieldSetGap as Z, radiusLg as J } from "../../tokens/index.js";
7
- const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createContext(null), $ = () => {
8
- const n = a.useContext(z);
9
- if (!n)
1
+ import { jsx as u } from "react/jsx-runtime";
2
+ import * as l from "react";
3
+ import { mergeClasses as m, SLOT_ATTR as s, shorthands as c } from "@epilot/zenith-runtime/v1";
4
+ import { makeZenithStyles as ie } from "../../styles/make-styles.js";
5
+ import { boxModel as y, nativeControl as _ } from "../../styles/host-reset.js";
6
+ import { fontWeightNormal as F, leadingSm as E, textSm as N, grayA11 as W, grayA8 as M, grayA12 as L, fieldPaddingY as R, fieldInputHeight as le, leadingXs as z, textXs as v, errorOnSoft as P, errorA4 as re, errorSoft as V, grayA3 as j, accentA4 as ae, accentA3 as se, grayA4 as de, focusRing as ce, spacingElement1 as I, fieldPaddingX as X, spacingElement2 as w, fieldSetGap as ue, radiusLg as fe } from "../../tokens/index.js";
7
+ const pe = "div", me = "label", ge = "input", he = "p", be = "div", k = l.createContext(null), D = l.createContext(null), De = () => {
8
+ const t = l.useContext(D);
9
+ if (!(t != null && t.labels.length)) return;
10
+ const { labels: o, controlId: e } = t;
11
+ return ((e ? o.find((i) => i.htmlFor === e) : void 0) ?? o[0]).id;
12
+ }, Ee = (t) => {
13
+ var e;
14
+ const o = (e = l.useContext(D)) == null ? void 0 : e.setControlId;
15
+ O(() => {
16
+ if (o)
17
+ return o(t), () => o(void 0);
18
+ }, [o, t]);
19
+ }, O = typeof window > "u" ? l.useEffect : l.useLayoutEffect, Y = () => {
20
+ const t = l.useContext(k);
21
+ if (!t)
10
22
  throw new Error("FieldInput must be used within a Field component");
11
- return n;
12
- }, pe = () => a.useContext(z), k = ["field-input", "field-textarea", "select-trigger"], ne = ["field-label", "label"], ie = { cursor: "not-allowed", opacity: 0.5 }, le = () => Object.fromEntries(
23
+ return t;
24
+ }, Ne = () => l.useContext(k), q = ["field-input", "field-textarea", "select-trigger"], ye = ["field-label", "label"], xe = { cursor: "not-allowed", opacity: 0.5 }, Ce = () => Object.fromEntries(
13
25
  [
14
26
  "&[data-disabled]",
15
- ...k.map(
16
- (n) => `&:has([${r}="${n}"]:disabled)`
27
+ ...q.map(
28
+ (t) => `&:has([${s}="${t}"]:disabled)`
17
29
  )
18
30
  ].flatMap(
19
- (n) => ne.map((l) => [
20
- `${n} [${r}="${l}"]`,
21
- ie
31
+ (t) => ye.map((o) => [
32
+ `${t} [${s}="${o}"]`,
33
+ xe
22
34
  ])
23
35
  )
24
- ), B = {
36
+ ), U = {
25
37
  alignSelf: "center",
26
- marginTop: `calc(-1 * ${w})`,
27
- marginBottom: `calc(-1 * ${w})`
28
- }, re = [...k, "field-input-group"], ae = () => Object.fromEntries([
38
+ marginTop: `calc(-1 * ${R})`,
39
+ marginBottom: `calc(-1 * ${R})`
40
+ }, Se = [...q, "field-input-group"], Fe = () => Object.fromEntries([
29
41
  ["& > *", { gridColumnStart: 1, gridColumnEnd: -1 }],
30
- ...re.flatMap((n) => [
42
+ ...Se.flatMap((t) => [
31
43
  [
32
- `& > [${r}="${n}"]`,
44
+ `& > [${s}="${t}"]`,
33
45
  { gridColumnStart: 1, gridColumnEnd: 2 }
34
46
  ],
35
47
  [
36
- `& > [${r}="${n}"] + :not([${r}])`,
48
+ `& > [${s}="${t}"] + :not([${s}])`,
37
49
  {
38
50
  gridColumnStart: 2,
39
51
  gridColumnEnd: 3,
40
- marginLeft: L,
41
- ...B
52
+ marginLeft: I,
53
+ ...U
42
54
  }
43
55
  ]
44
56
  ])
45
- ]), p = P({
57
+ ]), g = ie({
46
58
  root: {
47
- ...m,
59
+ ...y,
48
60
  position: "relative",
49
61
  // A grid, not a column, so an injected button can sit beside the control (see BESIDE_CONTROL).
50
62
  // The second column is empty and zero-wide unless something is injected.
@@ -56,13 +68,13 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
56
68
  // is a half-step short of the 0.75rem v1 actually uses, which three components got wrong by
57
69
  // reaching for it directly; that pitfall is why fieldPaddingX's normal tier aliases
58
70
  // spacingElement3, not spacingGroup1 (packages/tokens/spec/density.yaml).
59
- paddingTop: w,
60
- paddingBottom: w,
61
- paddingLeft: A,
62
- paddingRight: A,
71
+ paddingTop: R,
72
+ paddingBottom: R,
73
+ paddingLeft: X,
74
+ paddingRight: X,
63
75
  // Row gap only: a column gap would narrow the control even while the second column is empty.
64
- rowGap: L,
65
- ...d.borderRadius(J),
76
+ rowGap: I,
77
+ ...c.borderRadius(fe),
66
78
  transitionProperty: "all",
67
79
  transitionDuration: "75ms",
68
80
  outlineOffset: "2px",
@@ -73,10 +85,10 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
73
85
  },
74
86
  "&[data-focused='true'], &[data-focus-visible]": {
75
87
  outlineStyle: "solid",
76
- outlineColor: U
88
+ outlineColor: ce
77
89
  },
78
90
  "&[data-invalid]": {
79
- backgroundColor: I
91
+ backgroundColor: V
80
92
  },
81
93
  // Label's disabled styling, declared here because Field owns the elements these selectors are
82
94
  // rooted at. On Label they were written as "[data-disabled] &", ":disabled ~ &" and
@@ -85,46 +97,46 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
85
97
  // See src/ancestor-selector.test.ts. The port of those rules still missed: they named the
86
98
  // `label` slot while FieldLabel emits `field-label`, and the `~` forms needed the label AFTER
87
99
  // the control, but it comes first. `:has()` reaches the control wherever it sits.
88
- ...le(),
89
- ...ae()
100
+ ...Ce(),
101
+ ...Fe()
90
102
  },
91
103
  rootDefault: {
92
- backgroundColor: T,
104
+ backgroundColor: j,
93
105
  ":hover": {
94
- backgroundColor: q
106
+ backgroundColor: de
95
107
  }
96
108
  },
97
109
  rootHighlight: {
98
- backgroundColor: Y,
110
+ backgroundColor: se,
99
111
  ":hover": {
100
- backgroundColor: X
112
+ backgroundColor: ae
101
113
  }
102
114
  },
103
115
  rootReadonly: {
104
- backgroundColor: T
116
+ backgroundColor: j
105
117
  },
106
118
  rootDestructive: {
107
- backgroundColor: I,
119
+ backgroundColor: V,
108
120
  ":hover": {
109
- backgroundColor: j
121
+ backgroundColor: re
110
122
  }
111
123
  },
112
124
  fieldSet: {
113
- ...m,
125
+ ...y,
114
126
  display: "flex",
115
127
  flexDirection: "column",
116
128
  // Density-bound (DENSITY-SPEC.md §2.3): normal resolves to the same spacingLayout2 (32px)
117
129
  // this used before binding.
118
- ...d.gap(Z),
119
- ...d.border("0"),
120
- ...d.padding(0),
121
- ...d.margin(0)
130
+ ...c.gap(ue),
131
+ ...c.border("0"),
132
+ ...c.padding(0),
133
+ ...c.margin(0)
122
134
  },
123
135
  fieldGroup: {
124
- ...m,
136
+ ...y,
125
137
  display: "flex",
126
138
  width: "100%",
127
- ...d.gap(F)
139
+ ...c.gap(w)
128
140
  },
129
141
  fieldGroupColumn: {
130
142
  flexDirection: "column"
@@ -138,20 +150,20 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
138
150
  flexShrink: 1,
139
151
  flexBasis: "0%",
140
152
  flexDirection: "column",
141
- ...d.gap(F),
153
+ ...c.gap(w),
142
154
  lineHeight: "1.375"
143
155
  },
144
156
  label: {
145
- ...m,
157
+ ...y,
146
158
  minHeight: "1rem",
147
- fontSize: C,
148
- lineHeight: E,
159
+ fontSize: v,
160
+ lineHeight: z,
149
161
  // No width: the label stretches across the field's column, so the whole label row is a hit
150
162
  // area for the control rather than only the text. Field reads as one box and is aimed at as one.
151
163
  display: "flex",
152
- ...d.gap(F),
164
+ ...c.gap(w),
153
165
  cursor: "default",
154
- color: x,
166
+ color: L,
155
167
  "&[data-disabled]": {
156
168
  opacity: 0.5
157
169
  }
@@ -159,7 +171,7 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
159
171
  labelContent: {
160
172
  display: "inline-flex",
161
173
  alignItems: "center",
162
- ...d.gap(L),
174
+ ...c.gap(I),
163
175
  transitionProperty: "opacity",
164
176
  transitionDuration: "150ms",
165
177
  "@media (prefers-reduced-motion: reduce)": {
@@ -167,7 +179,7 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
167
179
  }
168
180
  },
169
181
  labelContentHover: {
170
- ...m,
182
+ ...y,
171
183
  width: 0,
172
184
  height: 0,
173
185
  overflowX: "visible",
@@ -176,86 +188,86 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
176
188
  pointerEvents: "none"
177
189
  },
178
190
  description: {
179
- fontSize: C,
191
+ fontSize: v,
180
192
  lineHeight: "1.5",
181
- fontWeight: S,
182
- ...d.margin(0),
193
+ fontWeight: F,
194
+ ...c.margin(0),
183
195
  "& a": {
184
196
  textDecorationLine: "underline",
185
197
  textUnderlineOffset: "4px"
186
198
  }
187
199
  },
188
200
  descriptionDefault: {
189
- color: x
201
+ color: L
190
202
  },
191
203
  descriptionHelper: {
192
- color: O
204
+ color: W
193
205
  },
194
206
  error: {
195
- color: H,
196
- fontSize: C,
197
- lineHeight: E,
198
- fontWeight: S
207
+ color: P,
208
+ fontSize: v,
209
+ lineHeight: z,
210
+ fontWeight: F
199
211
  },
200
212
  errorList: {
201
- ...m,
213
+ ...y,
202
214
  display: "flex",
203
215
  flexDirection: "column",
204
- ...d.margin(0),
216
+ ...c.margin(0),
205
217
  paddingLeft: "1.25rem",
206
218
  listStyleType: "disc"
207
219
  },
208
220
  errorListItem: {
209
- color: H,
210
- fontSize: C,
211
- lineHeight: E,
212
- fontWeight: S,
221
+ color: P,
222
+ fontSize: v,
223
+ lineHeight: z,
224
+ fontWeight: F,
213
225
  marginTop: "0.25rem",
214
226
  marginBottom: "0.25rem"
215
227
  },
216
228
  input: {
217
- ...N,
229
+ ..._,
218
230
  width: "100%",
219
231
  // Density-bound (DENSITY-SPEC.md §2.3): normal resolves to the same "1.5rem" this used before
220
232
  // binding. FieldComboboxInput (field-combobox.tsx) has its OWN separate makeZenithStyles call
221
233
  // and its own unrelated "input" key (width: "100%" only, no height) — this binding does not
222
234
  // reach it; review corrected an earlier claim that it did.
223
- height: V,
235
+ height: le,
224
236
  outlineStyle: "none",
225
- fontSize: D,
226
- lineHeight: R,
227
- color: x,
237
+ fontSize: N,
238
+ lineHeight: E,
239
+ color: L,
228
240
  backgroundColor: "transparent",
229
- ...d.border("0"),
230
- ...d.padding(0),
241
+ ...c.border("0"),
242
+ ...c.padding(0),
231
243
  "::placeholder": {
232
- color: G
244
+ color: M
233
245
  },
234
246
  ":disabled": {
235
247
  cursor: "not-allowed"
236
248
  }
237
249
  },
238
250
  inputGroup: {
239
- ...m,
251
+ ...y,
240
252
  display: "flex",
241
253
  alignItems: "center",
242
- ...d.gap(L),
254
+ ...c.gap(I),
243
255
  width: "100%",
244
256
  // Already a row, so an injected button lands beside the input; it must not stretch the row.
245
- [`& > [${r}="field-input"] + :not([${r}])`]: B
257
+ [`& > [${s}="field-input"] + :not([${s}])`]: U
246
258
  },
247
259
  textarea: {
248
- ...N,
260
+ ..._,
249
261
  width: "100%",
250
262
  outlineStyle: "none",
251
- fontSize: D,
252
- lineHeight: R,
253
- color: x,
263
+ fontSize: N,
264
+ lineHeight: E,
265
+ color: L,
254
266
  backgroundColor: "transparent",
255
- ...d.border("0"),
256
- ...d.padding(0),
267
+ ...c.border("0"),
268
+ ...c.padding(0),
257
269
  "::placeholder": {
258
- color: G
270
+ color: M
259
271
  },
260
272
  ":disabled": {
261
273
  cursor: "not-allowed"
@@ -271,18 +283,18 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
271
283
  resize: "horizontal"
272
284
  },
273
285
  addon: {
274
- ...m,
275
- color: O,
286
+ ...y,
287
+ color: W,
276
288
  display: "flex",
277
289
  height: "auto",
278
290
  cursor: "text",
279
291
  whiteSpace: "nowrap",
280
292
  alignItems: "center",
281
293
  justifyContent: "center",
282
- ...d.gap(F),
283
- fontSize: D,
284
- lineHeight: R,
285
- fontWeight: S,
294
+ ...c.gap(w),
295
+ fontSize: N,
296
+ lineHeight: E,
297
+ fontWeight: F,
286
298
  userSelect: "none"
287
299
  },
288
300
  addonStart: {
@@ -291,239 +303,261 @@ const K = "div", Q = "label", ee = "input", te = "p", oe = "div", z = a.createCo
291
303
  addonEnd: {
292
304
  order: 1
293
305
  }
294
- }), ge = ({
295
- variant: n = "default"
296
- } = {}) => n, me = a.forwardRef(
306
+ }), ze = ({
307
+ variant: t = "default"
308
+ } = {}) => t, Oe = l.forwardRef(
297
309
  function({
298
- className: l,
310
+ className: o,
299
311
  variant: e = "default",
300
- children: t,
301
- onFocusCapture: o,
302
- onBlurCapture: i,
303
- ...s
304
- }, h) {
305
- const u = p(), y = a.useRef(null), [g, b] = a.useState(!1), _ = (v) => {
306
- b(!0), o == null || o(v);
307
- }, W = (v) => {
308
- b(!1), i == null || i(v);
309
- }, M = e === "highlight" ? u.rootHighlight : e === "readonly" ? u.rootReadonly : e === "destructive" ? u.rootDestructive : u.rootDefault;
310
- return /* @__PURE__ */ c(z.Provider, { value: { inputRef: y }, children: /* @__PURE__ */ c(
311
- K,
312
+ children: n,
313
+ onFocusCapture: i,
314
+ onBlurCapture: r,
315
+ ...a
316
+ }, p) {
317
+ const d = g(), b = l.useRef(null), [f, x] = l.useState(!1), [G, H] = l.useState([]), [T, Z] = l.useState(), A = l.useCallback((h) => {
318
+ H((C) => {
319
+ const S = C.findIndex((ne) => ne.key === h.key);
320
+ if (S === -1) return [...C, h];
321
+ const { id: te, htmlFor: oe } = C[S];
322
+ if (te === h.id && oe === h.htmlFor) return C;
323
+ const B = C.slice();
324
+ return B[S] = h, B;
325
+ });
326
+ }, []), $ = l.useCallback((h) => {
327
+ H((C) => C.filter((S) => S.key !== h));
328
+ }, []), J = l.useMemo(
329
+ () => ({ labels: G, controlId: T, setLabel: A, removeLabel: $, setControlId: Z }),
330
+ [G, T, A, $]
331
+ ), K = (h) => {
332
+ x(!0), i == null || i(h);
333
+ }, Q = (h) => {
334
+ x(!1), r == null || r(h);
335
+ }, ee = e === "highlight" ? d.rootHighlight : e === "readonly" ? d.rootReadonly : e === "destructive" ? d.rootDestructive : d.rootDefault;
336
+ return /* @__PURE__ */ u(k.Provider, { value: { inputRef: b }, children: /* @__PURE__ */ u(D.Provider, { value: J, children: /* @__PURE__ */ u(
337
+ pe,
312
338
  {
313
- ref: h,
339
+ ref: p,
314
340
  role: "group",
315
341
  "data-slot": "field",
316
- [r]: "field",
317
- "data-focused": g ? "true" : "false",
318
- className: f(u.root, M, l),
319
- onFocusCapture: _,
320
- onBlurCapture: W,
321
- ...s,
322
- children: t
342
+ [s]: "field",
343
+ "data-focused": f ? "true" : "false",
344
+ className: m(d.root, ee, o),
345
+ onFocusCapture: K,
346
+ onBlurCapture: Q,
347
+ ...a,
348
+ children: n
323
349
  }
324
- ) });
350
+ ) }) });
325
351
  }
326
- ), he = a.forwardRef(
327
- function({ className: l, ...e }, t) {
328
- const o = p();
329
- return /* @__PURE__ */ c(
352
+ ), ke = l.forwardRef(
353
+ function({ className: o, ...e }, n) {
354
+ const i = g();
355
+ return /* @__PURE__ */ u(
330
356
  "fieldset",
331
357
  {
332
- ref: t,
358
+ ref: n,
333
359
  "data-slot": "field-set",
334
- [r]: "field-set",
335
- className: f(o.fieldSet, l),
360
+ [s]: "field-set",
361
+ className: m(i.fieldSet, o),
336
362
  ...e
337
363
  }
338
364
  );
339
365
  }
340
- ), ye = a.forwardRef(
341
- function({ className: l, direction: e = "column", ...t }, o) {
342
- const i = p();
343
- return /* @__PURE__ */ c(
366
+ ), Ge = l.forwardRef(
367
+ function({ className: o, direction: e = "column", ...n }, i) {
368
+ const r = g();
369
+ return /* @__PURE__ */ u(
344
370
  "div",
345
371
  {
346
- ref: o,
372
+ ref: i,
347
373
  "data-slot": "field-group",
348
- [r]: "field-group",
349
- className: f(
350
- i.fieldGroup,
351
- e === "row" ? i.fieldGroupRow : i.fieldGroupColumn,
352
- l
374
+ [s]: "field-group",
375
+ className: m(
376
+ r.fieldGroup,
377
+ e === "row" ? r.fieldGroupRow : r.fieldGroupColumn,
378
+ o
353
379
  ),
354
- ...t
380
+ ...n
355
381
  }
356
382
  );
357
383
  }
358
- ), be = a.forwardRef(
359
- function({ className: l, ...e }, t) {
360
- const o = p();
361
- return /* @__PURE__ */ c(
384
+ ), He = l.forwardRef(
385
+ function({ className: o, ...e }, n) {
386
+ const i = g();
387
+ return /* @__PURE__ */ u(
362
388
  "div",
363
389
  {
364
- ref: t,
390
+ ref: n,
365
391
  "data-slot": "field-content",
366
- [r]: "field-content",
367
- className: f(o.fieldContent, l),
392
+ [s]: "field-content",
393
+ className: m(i.fieldContent, o),
368
394
  ...e
369
395
  }
370
396
  );
371
397
  }
372
- ), Se = a.forwardRef(
373
- function({ className: l, ...e }, t) {
374
- const o = p();
375
- return /* @__PURE__ */ c(
376
- Q,
398
+ ), Te = l.forwardRef(
399
+ function({ className: o, id: e, ...n }, i) {
400
+ const r = g(), a = l.useId(), p = l.useContext(D), d = e ?? (p ? a : void 0), b = p == null ? void 0 : p.setLabel, f = p == null ? void 0 : p.removeLabel, x = n.htmlFor;
401
+ return O(() => {
402
+ b && d && b({ key: a, id: d, htmlFor: x });
403
+ }, [b, a, d, x]), O(() => {
404
+ if (f)
405
+ return () => f(a);
406
+ }, [f, a]), /* @__PURE__ */ u(
407
+ me,
377
408
  {
378
- ref: t,
409
+ ref: i,
410
+ id: d,
379
411
  "data-slot": "field-label",
380
- [r]: "field-label",
381
- className: f(o.label, l),
382
- ...e
412
+ [s]: "field-label",
413
+ className: m(r.label, o),
414
+ ...n
383
415
  }
384
416
  );
385
417
  }
386
- ), xe = a.forwardRef(function({ className: l, showOnHover: e = !0, ...t }, o) {
387
- const i = p();
388
- return /* @__PURE__ */ c(
418
+ ), Ae = l.forwardRef(function({ className: o, showOnHover: e = !0, ...n }, i) {
419
+ const r = g();
420
+ return /* @__PURE__ */ u(
389
421
  "div",
390
422
  {
391
- ref: o,
423
+ ref: i,
392
424
  "data-slot": "field-label-content",
393
- [r]: "field-label-content",
394
- className: f(
395
- i.labelContent,
396
- e && i.labelContentHover,
397
- l
425
+ [s]: "field-label-content",
426
+ className: m(
427
+ r.labelContent,
428
+ e && r.labelContentHover,
429
+ o
398
430
  ),
399
- ...t
431
+ ...n
400
432
  }
401
433
  );
402
- }), Ce = ({
403
- variant: n = "default"
404
- } = {}) => n, Fe = a.forwardRef(function({ className: l, variant: e = "default", ...t }, o) {
405
- const i = p(), s = e === "helper" ? i.descriptionHelper : i.descriptionDefault;
406
- return /* @__PURE__ */ c(
407
- te,
434
+ }), $e = ({
435
+ variant: t = "default"
436
+ } = {}) => t, Be = l.forwardRef(function({ className: o, variant: e = "default", ...n }, i) {
437
+ const r = g(), a = e === "helper" ? r.descriptionHelper : r.descriptionDefault;
438
+ return /* @__PURE__ */ u(
439
+ he,
408
440
  {
409
- ref: o,
441
+ ref: i,
410
442
  "data-slot": "field-description",
411
- [r]: "field-description",
412
- className: f(i.description, s, l),
413
- ...t
443
+ [s]: "field-description",
444
+ className: m(r.description, a, o),
445
+ ...n
414
446
  }
415
447
  );
416
- }), Le = a.forwardRef(
417
- function({ className: l, children: e, errors: t, ...o }, i) {
418
- const s = p(), h = a.useMemo(() => {
419
- var y;
448
+ }), _e = l.forwardRef(
449
+ function({ className: o, children: e, errors: n, ...i }, r) {
450
+ const a = g(), p = l.useMemo(() => {
451
+ var b;
420
452
  if (e)
421
453
  return e;
422
- if (!(t != null && t.length))
454
+ if (!(n != null && n.length))
423
455
  return null;
424
- const u = [
425
- ...new Map(t.map((g) => [g == null ? void 0 : g.message, g])).values()
456
+ const d = [
457
+ ...new Map(n.map((f) => [f == null ? void 0 : f.message, f])).values()
426
458
  ];
427
- return u.length === 1 ? (y = u[0]) == null ? void 0 : y.message : /* @__PURE__ */ c("ul", { className: s.errorList, children: u.map(
428
- (g, b) => (g == null ? void 0 : g.message) && /* @__PURE__ */ c("li", { className: s.errorListItem, children: g.message }, b)
459
+ return d.length === 1 ? (b = d[0]) == null ? void 0 : b.message : /* @__PURE__ */ u("ul", { className: a.errorList, children: d.map(
460
+ (f, x) => (f == null ? void 0 : f.message) && /* @__PURE__ */ u("li", { className: a.errorListItem, children: f.message }, x)
429
461
  ) });
430
- }, [e, t, s.errorList, s.errorListItem]);
431
- return h ? /* @__PURE__ */ c(
432
- oe,
462
+ }, [e, n, a.errorList, a.errorListItem]);
463
+ return p ? /* @__PURE__ */ u(
464
+ be,
433
465
  {
434
- ref: i,
466
+ ref: r,
435
467
  role: "alert",
436
468
  "data-slot": "field-error",
437
- [r]: "field-error",
438
- className: f(s.error, l),
439
- ...o,
440
- children: h
469
+ [s]: "field-error",
470
+ className: m(a.error, o),
471
+ ...i,
472
+ children: p
441
473
  }
442
474
  ) : null;
443
475
  }
444
- ), we = a.forwardRef(
445
- function({ className: l, ...e }, t) {
446
- const o = p(), { inputRef: i } = $();
447
- return /* @__PURE__ */ c(
448
- ee,
476
+ ), We = l.forwardRef(
477
+ function({ className: o, ...e }, n) {
478
+ const i = g(), { inputRef: r } = Y();
479
+ return /* @__PURE__ */ u(
480
+ ge,
449
481
  {
450
- ref: (s) => {
451
- i.current = s, typeof t == "function" ? t(s) : t && (t.current = s);
482
+ ref: (a) => {
483
+ r.current = a, typeof n == "function" ? n(a) : n && (n.current = a);
452
484
  },
453
485
  "data-readonly": e.readOnly,
454
486
  "data-slot": "field-input",
455
- [r]: "field-input",
456
- className: f(o.input, l),
487
+ [s]: "field-input",
488
+ className: m(i.input, o),
457
489
  ...e
458
490
  }
459
491
  );
460
492
  }
461
- ), ve = a.forwardRef(function({ className: l, ...e }, t) {
462
- const o = p();
463
- return /* @__PURE__ */ c(
493
+ ), Me = l.forwardRef(function({ className: o, ...e }, n) {
494
+ const i = g();
495
+ return /* @__PURE__ */ u(
464
496
  "div",
465
497
  {
466
- ref: t,
498
+ ref: n,
467
499
  "data-slot": "field-input-group",
468
- [r]: "field-input-group",
469
- className: f(o.inputGroup, l),
500
+ [s]: "field-input-group",
501
+ className: m(i.inputGroup, o),
470
502
  ...e
471
503
  }
472
504
  );
473
- }), Re = a.forwardRef(function({ className: l, resize: e = "none", ...t }, o) {
474
- const i = p(), { inputRef: s } = $(), h = e === "vertical" ? i.resizeVertical : e === "horizontal" ? i.resizeHorizontal : i.resizeNone;
475
- return /* @__PURE__ */ c(
505
+ }), Pe = l.forwardRef(function({ className: o, resize: e = "none", ...n }, i) {
506
+ const r = g(), { inputRef: a } = Y(), p = e === "vertical" ? r.resizeVertical : e === "horizontal" ? r.resizeHorizontal : r.resizeNone;
507
+ return /* @__PURE__ */ u(
476
508
  "textarea",
477
509
  {
478
- ...t,
479
- ref: (u) => {
480
- s.current = u, typeof o == "function" ? o(u) : o && (o.current = u);
510
+ ...n,
511
+ ref: (d) => {
512
+ a.current = d, typeof i == "function" ? i(d) : i && (i.current = d);
481
513
  },
482
- "data-readonly": t.readOnly,
514
+ "data-readonly": n.readOnly,
483
515
  "data-slot": "field-textarea",
484
- [r]: "field-textarea",
516
+ [s]: "field-textarea",
485
517
  "data-resize": e,
486
- className: f(i.textarea, h, l)
518
+ className: m(r.textarea, p, o)
487
519
  }
488
520
  );
489
- }), De = ({
490
- align: n = "start"
491
- } = {}) => n, Ee = a.forwardRef(function({ className: l, align: e = "start", ...t }, o) {
492
- const i = p();
493
- return /* @__PURE__ */ c(
521
+ }), Ve = ({
522
+ align: t = "start"
523
+ } = {}) => t, je = l.forwardRef(function({ className: o, align: e = "start", ...n }, i) {
524
+ const r = g();
525
+ return /* @__PURE__ */ u(
494
526
  "div",
495
527
  {
496
- ref: o,
528
+ ref: i,
497
529
  role: "group",
498
530
  "data-slot": "input-group-addon",
499
- [r]: "input-group-addon",
531
+ [s]: "input-group-addon",
500
532
  "data-align": e,
501
- className: f(
502
- i.addon,
503
- e === "end" ? i.addonEnd : i.addonStart,
504
- l
533
+ className: m(
534
+ r.addon,
535
+ e === "end" ? r.addonEnd : r.addonStart,
536
+ o
505
537
  ),
506
- ...t
538
+ ...n
507
539
  }
508
540
  );
509
541
  });
510
542
  export {
511
- me as Field,
512
- be as FieldContent,
513
- Fe as FieldDescription,
514
- Le as FieldError,
515
- ye as FieldGroup,
516
- Ee as FieldGroupAddon,
517
- we as FieldInput,
518
- ve as FieldInputGroup,
519
- Se as FieldLabel,
520
- xe as FieldLabelContent,
521
- he as FieldSet,
522
- Re as FieldTextarea,
523
- Ce as fieldDescriptionVariants,
524
- ge as fieldVariants,
525
- De as inputGroupAddonVariants,
526
- $ as useFieldContext,
527
- pe as useOptionalFieldContext
543
+ Oe as Field,
544
+ He as FieldContent,
545
+ Be as FieldDescription,
546
+ _e as FieldError,
547
+ Ge as FieldGroup,
548
+ je as FieldGroupAddon,
549
+ We as FieldInput,
550
+ Me as FieldInputGroup,
551
+ Te as FieldLabel,
552
+ Ae as FieldLabelContent,
553
+ ke as FieldSet,
554
+ Pe as FieldTextarea,
555
+ $e as fieldDescriptionVariants,
556
+ ze as fieldVariants,
557
+ Ve as inputGroupAddonVariants,
558
+ Y as useFieldContext,
559
+ De as useFieldLabelId,
560
+ Ne as useOptionalFieldContext,
561
+ Ee as useReportFieldControlId
528
562
  };
529
563
  //# sourceMappingURL=field.js.map