@epilot/zenith-react 0.2.0-next.0 → 0.2.0-next.3

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