@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.
- package/dist/components/accordion/accordion.js +57 -48
- package/dist/components/accordion/accordion.js.map +1 -1
- package/dist/components/alert-dialog/alert-dialog.js +120 -92
- package/dist/components/alert-dialog/alert-dialog.js.map +1 -1
- package/dist/components/avatar/avatar-group.js +38 -35
- package/dist/components/avatar/avatar-group.js.map +1 -1
- package/dist/components/avatar/avatar.js +78 -71
- package/dist/components/avatar/avatar.js.map +1 -1
- package/dist/components/badge/badge.js +60 -55
- package/dist/components/badge/badge.js.map +1 -1
- package/dist/components/breadcrumb/breadcrumb.js +99 -54
- package/dist/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/components/button/button.js +87 -77
- package/dist/components/button/button.js.map +1 -1
- package/dist/components/button-group/button-group.js +36 -32
- package/dist/components/button-group/button-group.js.map +1 -1
- package/dist/components/callout/callout.js +105 -98
- package/dist/components/callout/callout.js.map +1 -1
- package/dist/components/card/card.js +62 -52
- package/dist/components/card/card.js.map +1 -1
- package/dist/components/checkbox/checkbox.js +22 -19
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/code-block/code-block.js +135 -123
- package/dist/components/code-block/code-block.js.map +1 -1
- package/dist/components/code-editor/code-editor.js +276 -260
- package/dist/components/code-editor/code-editor.js.map +1 -1
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js +62 -56
- package/dist/components/collapsible-sidebar/collapsible-sidebar.js.map +1 -1
- package/dist/components/command/command.js +116 -105
- package/dist/components/command/command.js.map +1 -1
- package/dist/components/data-table/data-table-body.js +38 -34
- package/dist/components/data-table/data-table-body.js.map +1 -1
- package/dist/components/data-table/data-table-column-header.js +30 -26
- package/dist/components/data-table/data-table-column-header.js.map +1 -1
- package/dist/components/data-table/data-table-column-order.js +79 -73
- package/dist/components/data-table/data-table-column-order.js.map +1 -1
- package/dist/components/data-table/data-table-column-visibility.js +25 -22
- package/dist/components/data-table/data-table-column-visibility.js.map +1 -1
- package/dist/components/data-table/data-table-content.js +47 -44
- package/dist/components/data-table/data-table-content.js.map +1 -1
- package/dist/components/data-table/data-table-error.js +36 -32
- package/dist/components/data-table/data-table-error.js.map +1 -1
- package/dist/components/data-table/data-table-footer.js +10 -8
- package/dist/components/data-table/data-table-footer.js.map +1 -1
- package/dist/components/data-table/data-table-header-draggable.js +40 -36
- package/dist/components/data-table/data-table-header-draggable.js.map +1 -1
- package/dist/components/data-table/data-table-header.js +113 -99
- package/dist/components/data-table/data-table-header.js.map +1 -1
- package/dist/components/data-table/data-table-loading.js +21 -18
- package/dist/components/data-table/data-table-loading.js.map +1 -1
- package/dist/components/data-table/data-table-resize-handle.js +13 -11
- package/dist/components/data-table/data-table-resize-handle.js.map +1 -1
- package/dist/components/data-table/data-table-row.js +71 -59
- package/dist/components/data-table/data-table-row.js.map +1 -1
- package/dist/components/data-table/data-table-toolbar.js +9 -7
- package/dist/components/data-table/data-table-toolbar.js.map +1 -1
- package/dist/components/data-table/data-table.js +48 -46
- package/dist/components/data-table/data-table.js.map +1 -1
- package/dist/components/date-range-picker/date-range-picker.js +173 -164
- package/dist/components/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/date-range-picker/range-calendar.js +36 -34
- package/dist/components/date-range-picker/range-calendar.js.map +1 -1
- package/dist/components/date-time-picker/calendar.js +290 -272
- package/dist/components/date-time-picker/calendar.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-input.js +22 -20
- package/dist/components/date-time-picker/date-time-picker-input.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker-panel.js +126 -120
- package/dist/components/date-time-picker/date-time-picker-panel.js.map +1 -1
- package/dist/components/date-time-picker/date-time-picker.js +42 -40
- package/dist/components/date-time-picker/date-time-picker.js.map +1 -1
- package/dist/components/date-time-picker/time-picker.js +95 -87
- package/dist/components/date-time-picker/time-picker.js.map +1 -1
- package/dist/components/dialog/dialog.js +115 -95
- package/dist/components/dialog/dialog.js.map +1 -1
- package/dist/components/drawer/drawer.js +144 -109
- package/dist/components/drawer/drawer.js.map +1 -1
- package/dist/components/dropdown-menu/dropdown-menu.js +141 -112
- package/dist/components/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/field/field-combobox.js +196 -176
- package/dist/components/field/field-combobox.js.map +1 -1
- package/dist/components/field/field.js +137 -126
- package/dist/components/field/field.js.map +1 -1
- package/dist/components/list/list.js +237 -219
- package/dist/components/list/list.js.map +1 -1
- package/dist/components/option-card/option-card.js +129 -116
- package/dist/components/option-card/option-card.js.map +1 -1
- package/dist/components/pill/pill.js +55 -51
- package/dist/components/pill/pill.js.map +1 -1
- package/dist/components/popover/popover.js +53 -36
- package/dist/components/popover/popover.js.map +1 -1
- package/dist/components/radio/radio.js +38 -34
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/scroll-area/scroll-area.js +38 -35
- package/dist/components/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/scroll-overflow/scroll-overflow.js +166 -151
- package/dist/components/scroll-overflow/scroll-overflow.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +93 -85
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +149 -128
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/separator/separator.js +19 -16
- package/dist/components/separator/separator.js.map +1 -1
- package/dist/components/skeleton/skeleton.js +34 -30
- package/dist/components/skeleton/skeleton.js.map +1 -1
- package/dist/components/spinner/spinner.js +22 -17
- package/dist/components/spinner/spinner.js.map +1 -1
- package/dist/components/surface/surface.js +25 -22
- package/dist/components/surface/surface.js.map +1 -1
- package/dist/components/switch/switch.js +66 -57
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/components/table/table-pagination.js +139 -129
- package/dist/components/table/table-pagination.js.map +1 -1
- package/dist/components/table/table.js +104 -90
- package/dist/components/table/table.js.map +1 -1
- package/dist/components/tabs/tabs.js +206 -128
- package/dist/components/tabs/tabs.js.map +1 -1
- package/dist/components/toast/toast.js +112 -100
- package/dist/components/toast/toast.js.map +1 -1
- package/dist/components/toggle/toggle.js +32 -30
- package/dist/components/toggle/toggle.js.map +1 -1
- package/dist/components/tooltip/tooltip.js +59 -46
- package/dist/components/tooltip/tooltip.js.map +1 -1
- package/dist/index.d.ts +12 -0
- package/dist/lib/clear-button.js +18 -17
- package/dist/lib/clear-button.js.map +1 -1
- package/dist/styles/host-reset.js +47 -0
- package/dist/styles/host-reset.js.map +1 -0
- package/dist/styles/overlay-layer.js +5 -0
- package/dist/styles/overlay-layer.js.map +1 -0
- package/dist/tokens.json +1 -1
- package/package.json +8 -6
- package/scripts/migration-diagnostics.mjs +42 -7
- 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
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
},
|
|
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
|
-
...
|
|
15
|
+
...k.map(
|
|
15
16
|
(n) => `&:has([${r}="${n}"]:disabled)`
|
|
16
17
|
)
|
|
17
18
|
].flatMap(
|
|
18
|
-
(n) =>
|
|
19
|
+
(n) => ne.map((l) => [
|
|
19
20
|
`${n} [${r}="${l}"]`,
|
|
20
|
-
|
|
21
|
+
ie
|
|
21
22
|
])
|
|
22
23
|
)
|
|
23
|
-
),
|
|
24
|
+
), B = {
|
|
24
25
|
alignSelf: "center",
|
|
25
|
-
marginTop: `calc(-1 * ${
|
|
26
|
-
marginBottom: `calc(-1 * ${
|
|
27
|
-
},
|
|
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
|
-
...
|
|
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:
|
|
40
|
-
|
|
40
|
+
marginLeft: L,
|
|
41
|
+
...B
|
|
41
42
|
}
|
|
42
43
|
]
|
|
43
44
|
])
|
|
44
|
-
]), p =
|
|
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:
|
|
58
|
-
paddingBottom:
|
|
59
|
-
paddingLeft:
|
|
60
|
-
paddingRight:
|
|
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:
|
|
63
|
-
...d.borderRadius(
|
|
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:
|
|
76
|
+
outlineColor: U
|
|
75
77
|
},
|
|
76
78
|
"&[data-invalid]": {
|
|
77
|
-
backgroundColor:
|
|
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
|
-
...
|
|
87
|
-
...
|
|
88
|
+
...le(),
|
|
89
|
+
...ae()
|
|
88
90
|
},
|
|
89
91
|
rootDefault: {
|
|
90
|
-
backgroundColor:
|
|
92
|
+
backgroundColor: T,
|
|
91
93
|
":hover": {
|
|
92
|
-
backgroundColor:
|
|
94
|
+
backgroundColor: q
|
|
93
95
|
}
|
|
94
96
|
},
|
|
95
97
|
rootHighlight: {
|
|
96
|
-
backgroundColor:
|
|
98
|
+
backgroundColor: Y,
|
|
97
99
|
":hover": {
|
|
98
|
-
backgroundColor:
|
|
100
|
+
backgroundColor: X
|
|
99
101
|
}
|
|
100
102
|
},
|
|
101
103
|
rootReadonly: {
|
|
102
|
-
backgroundColor:
|
|
104
|
+
backgroundColor: T
|
|
103
105
|
},
|
|
104
106
|
rootDestructive: {
|
|
105
|
-
backgroundColor:
|
|
107
|
+
backgroundColor: I,
|
|
106
108
|
":hover": {
|
|
107
|
-
backgroundColor:
|
|
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(
|
|
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(
|
|
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(
|
|
141
|
+
...d.gap(F),
|
|
138
142
|
lineHeight: "1.375"
|
|
139
143
|
},
|
|
140
144
|
label: {
|
|
145
|
+
...m,
|
|
141
146
|
minHeight: "1rem",
|
|
142
|
-
fontSize:
|
|
143
|
-
lineHeight:
|
|
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(
|
|
152
|
+
...d.gap(F),
|
|
148
153
|
cursor: "default",
|
|
149
|
-
color:
|
|
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(
|
|
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:
|
|
179
|
+
fontSize: C,
|
|
174
180
|
lineHeight: "1.5",
|
|
175
|
-
fontWeight:
|
|
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:
|
|
189
|
+
color: x
|
|
184
190
|
},
|
|
185
191
|
descriptionHelper: {
|
|
186
|
-
color:
|
|
192
|
+
color: O
|
|
187
193
|
},
|
|
188
194
|
error: {
|
|
189
|
-
color:
|
|
190
|
-
fontSize:
|
|
191
|
-
lineHeight:
|
|
192
|
-
fontWeight:
|
|
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:
|
|
203
|
-
fontSize:
|
|
204
|
-
lineHeight:
|
|
205
|
-
fontWeight:
|
|
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:
|
|
223
|
+
height: V,
|
|
216
224
|
outlineStyle: "none",
|
|
217
|
-
fontSize:
|
|
218
|
-
lineHeight:
|
|
219
|
-
color:
|
|
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:
|
|
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(
|
|
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:
|
|
242
|
-
lineHeight:
|
|
243
|
-
color:
|
|
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:
|
|
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
|
-
|
|
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(
|
|
272
|
-
fontSize:
|
|
273
|
-
lineHeight:
|
|
274
|
-
fontWeight:
|
|
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
|
-
}),
|
|
294
|
+
}), ge = ({
|
|
284
295
|
variant: n = "default"
|
|
285
|
-
} = {}) => n,
|
|
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
|
-
},
|
|
294
|
-
const u = p(),
|
|
295
|
-
|
|
296
|
-
},
|
|
297
|
-
|
|
298
|
-
},
|
|
299
|
-
return /* @__PURE__ */ c(
|
|
300
|
-
|
|
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:
|
|
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,
|
|
308
|
-
onFocusCapture:
|
|
309
|
-
onBlurCapture:
|
|
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
|
-
),
|
|
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
|
-
),
|
|
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
|
-
),
|
|
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
|
-
),
|
|
372
|
+
), Se = a.forwardRef(
|
|
362
373
|
function({ className: l, ...e }, t) {
|
|
363
374
|
const o = p();
|
|
364
375
|
return /* @__PURE__ */ c(
|
|
365
|
-
|
|
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
|
-
),
|
|
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
|
-
}),
|
|
402
|
+
}), Ce = ({
|
|
392
403
|
variant: n = "default"
|
|
393
|
-
} = {}) => n,
|
|
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
|
-
|
|
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
|
-
}),
|
|
416
|
+
}), Le = a.forwardRef(
|
|
406
417
|
function({ className: l, children: e, errors: t, ...o }, i) {
|
|
407
|
-
const s = p(),
|
|
408
|
-
var
|
|
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 ? (
|
|
417
|
-
(g,
|
|
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
|
|
421
|
-
|
|
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:
|
|
440
|
+
children: h
|
|
430
441
|
}
|
|
431
442
|
) : null;
|
|
432
443
|
}
|
|
433
|
-
),
|
|
444
|
+
), we = a.forwardRef(
|
|
434
445
|
function({ className: l, ...e }, t) {
|
|
435
|
-
const o = p(), { inputRef: i } =
|
|
446
|
+
const o = p(), { inputRef: i } = $();
|
|
436
447
|
return /* @__PURE__ */ c(
|
|
437
|
-
|
|
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
|
-
),
|
|
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
|
-
}),
|
|
463
|
-
const i = p(), { inputRef: s } =
|
|
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,
|
|
486
|
+
className: f(i.textarea, h, l)
|
|
476
487
|
}
|
|
477
488
|
);
|
|
478
|
-
}),
|
|
489
|
+
}), De = ({
|
|
479
490
|
align: n = "start"
|
|
480
|
-
} = {}) => n,
|
|
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
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
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
|