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