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