@epilot/zenith-react 0.2.0-next.5 → 0.2.0-next.7
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 +1 -1
- package/dist/components/checkbox/checkbox.js +41 -39
- package/dist/components/checkbox/checkbox.js.map +1 -1
- package/dist/components/radio/radio.js +14 -11
- package/dist/components/radio/radio.js.map +1 -1
- package/dist/components/segmented-control/segmented-control.js +133 -122
- package/dist/components/segmented-control/segmented-control.js.map +1 -1
- package/dist/components/select/select.js +178 -176
- package/dist/components/select/select.js.map +1 -1
- package/dist/components/switch/switch.js +59 -57
- package/dist/components/switch/switch.js.map +1 -1
- package/dist/lib/hidden-input-box.js +26 -0
- package/dist/lib/hidden-input-box.js.map +1 -0
- package/dist/tokens.json +1 -1
- package/package.json +3 -3
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import { jsx as o, jsxs as E, Fragment as
|
|
1
|
+
import { jsx as o, jsxs as E, Fragment as R } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
3
|
import { createPortal as st } from "react-dom";
|
|
4
4
|
import { DirectionProvider as at } from "../../_virtual/_zenith-runtime-family_direction-provider.js";
|
|
5
5
|
import { Select as p } from "../../_virtual/_zenith-runtime-family_select.js";
|
|
6
|
-
import { mergeClasses as
|
|
6
|
+
import { mergeClasses as v, SLOT_ATTR as f, shorthands as w } from "@epilot/zenith-runtime/v1";
|
|
7
7
|
import { useAppearanceAttributes as ct } from "../appearance-boundary/appearance-boundary.js";
|
|
8
8
|
import { useDensity as dt } from "../density-provider/density-provider.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { useOptionalFieldContext as ut } from "../field/field.js";
|
|
10
|
+
import { HiddenInputBox as pt } from "../../lib/hidden-input-box.js";
|
|
11
|
+
import { makeZenithStyles as ft } from "../../styles/make-styles.js";
|
|
12
|
+
import { boxModel as h, nativeControl as gt } from "../../styles/host-reset.js";
|
|
11
13
|
import { OVERLAY_Z_INDEX as j } from "../../styles/overlay-layer.js";
|
|
12
|
-
import { spacingElement1 as
|
|
13
|
-
const
|
|
14
|
+
import { spacingElement1 as C, graySoft as mt, gray11 as ht, fontWeightSemibold as wt, leadingXs as xt, textXs as vt, spacingElement2 as x, grayA11 as F, accentA3 as G, grayA12 as H, leadingSm as U, textSm as Y, selectItemPaddingY as Z, selectItemPaddingLeft as yt, body as St, accentA11 as V, focusRing as J, accentSoft as bt, grayA8 as It, radiusMd as K, radius2xl as Ct, selectContentGap as At, selectContentPadding as Dt, radiusLg as Lt } from "../../tokens/index.js";
|
|
15
|
+
const Rt = (i) => /* @__PURE__ */ o(
|
|
14
16
|
"svg",
|
|
15
17
|
{
|
|
16
18
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -21,7 +23,7 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
21
23
|
...i,
|
|
22
24
|
children: /* @__PURE__ */ o("path", { d: "M480-424 284-228q-11 11-28 11t-28-11q-11-11-11-28t11-28l196-196-196-196q-11-11-11-28t11-28q11-11 28-11t28 11l196 196 196-196q11-11 28-11t28 11q11 11 11 28t-11 28L536-480l196 196q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-424Z" })
|
|
23
25
|
}
|
|
24
|
-
),
|
|
26
|
+
), Tt = (i) => /* @__PURE__ */ o(
|
|
25
27
|
"svg",
|
|
26
28
|
{
|
|
27
29
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -32,7 +34,7 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
32
34
|
...i,
|
|
33
35
|
children: /* @__PURE__ */ o("path", { d: "m382-354 339-339q12-12 28-12t28 12q12 12 12 28.5T777-636L410-268q-12 12-28 12t-28-12L182-440q-12-12-11.5-28.5T183-497q12-12 28.5-12t28.5 12l142 143Z" })
|
|
34
36
|
}
|
|
35
|
-
),
|
|
37
|
+
), Nt = (i) => /* @__PURE__ */ o(
|
|
36
38
|
"svg",
|
|
37
39
|
{
|
|
38
40
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -54,18 +56,18 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
54
56
|
...i,
|
|
55
57
|
children: /* @__PURE__ */ o("path", { d: "M480-528 324-372q-11 11-28 11t-28-11q-11-11-11-28t11-28l184-184q12-12 28-12t28 12l184 184q11 11 11 28t-11 28q-11 11-28 11t-28-11L480-528Z" })
|
|
56
58
|
}
|
|
57
|
-
),
|
|
59
|
+
), D = ft({
|
|
58
60
|
trigger: {
|
|
59
|
-
...
|
|
61
|
+
...gt,
|
|
60
62
|
display: "flex",
|
|
61
63
|
width: "100%",
|
|
62
64
|
alignItems: "center",
|
|
63
65
|
justifyContent: "space-between",
|
|
64
|
-
...
|
|
65
|
-
...
|
|
66
|
+
...w.gap(x),
|
|
67
|
+
...w.borderRadius(Lt),
|
|
66
68
|
backgroundColor: "transparent",
|
|
67
|
-
fontSize:
|
|
68
|
-
lineHeight:
|
|
69
|
+
fontSize: Y,
|
|
70
|
+
lineHeight: U,
|
|
69
71
|
outlineStyle: "none",
|
|
70
72
|
whiteSpace: "normal",
|
|
71
73
|
textAlign: "left",
|
|
@@ -87,23 +89,23 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
87
89
|
opacity: 0.5
|
|
88
90
|
},
|
|
89
91
|
"&[data-placeholder]": {
|
|
90
|
-
color:
|
|
92
|
+
color: It
|
|
91
93
|
},
|
|
92
94
|
"& svg": {
|
|
93
95
|
pointerEvents: "none",
|
|
94
96
|
flexShrink: 0
|
|
95
97
|
},
|
|
96
|
-
[`& [${
|
|
98
|
+
[`& [${f}="select-value"]`]: {
|
|
97
99
|
display: "flex",
|
|
98
100
|
alignItems: "center",
|
|
99
|
-
...
|
|
101
|
+
...w.gap(x),
|
|
100
102
|
overflow: "hidden",
|
|
101
103
|
textOverflow: "ellipsis",
|
|
102
104
|
whiteSpace: "nowrap"
|
|
103
105
|
},
|
|
104
106
|
// The open-state chevron rotation is declared HERE, on the trigger that carries the state
|
|
105
107
|
// attribute, reaching the icon by SLOT_ATTR.
|
|
106
|
-
[`&[data-popup-open] [${
|
|
108
|
+
[`&[data-popup-open] [${f}="select-icon"]`]: {
|
|
107
109
|
transform: "rotate(180deg)"
|
|
108
110
|
}
|
|
109
111
|
},
|
|
@@ -117,7 +119,7 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
117
119
|
...h,
|
|
118
120
|
width: "1.5rem",
|
|
119
121
|
height: "1.5rem",
|
|
120
|
-
color:
|
|
122
|
+
color: F,
|
|
121
123
|
transitionProperty: "transform",
|
|
122
124
|
transitionDuration: "150ms",
|
|
123
125
|
transitionTimingFunction: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
@@ -139,9 +141,9 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
139
141
|
backgroundColor: "transparent",
|
|
140
142
|
color: V,
|
|
141
143
|
cursor: "pointer",
|
|
142
|
-
...
|
|
144
|
+
...w.borderRadius(K),
|
|
143
145
|
":hover": {
|
|
144
|
-
backgroundColor:
|
|
146
|
+
backgroundColor: bt
|
|
145
147
|
},
|
|
146
148
|
":focus-visible": {
|
|
147
149
|
outlineColor: J,
|
|
@@ -173,21 +175,21 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
173
175
|
// Radix laid its content out as a column: scroll-up arrow, viewport, scroll-down arrow.
|
|
174
176
|
display: "flex",
|
|
175
177
|
flexDirection: "column",
|
|
176
|
-
backgroundColor:
|
|
178
|
+
backgroundColor: St,
|
|
177
179
|
// DENSITY-SPEC.md §2.3 — popup padding/gap only; the slide-in transition offsets a few lines
|
|
178
180
|
// below deliberately keep the plain (non-density) `spacingElement2` value: they are not in the
|
|
179
181
|
// approved matrix, and re-using the same primitive for two unrelated purposes doesn't make the
|
|
180
182
|
// animation distance a density lever too.
|
|
181
|
-
...
|
|
182
|
-
...
|
|
183
|
-
color:
|
|
183
|
+
...w.padding(Dt),
|
|
184
|
+
...w.gap(At),
|
|
185
|
+
color: H,
|
|
184
186
|
position: "relative",
|
|
185
187
|
zIndex: j,
|
|
186
188
|
transformOrigin: "var(--transform-origin)",
|
|
187
189
|
overflowX: "hidden",
|
|
188
190
|
overflowY: "auto",
|
|
189
|
-
...
|
|
190
|
-
...
|
|
191
|
+
...w.borderRadius(Ct),
|
|
192
|
+
...w.border("1px", "solid", "transparent"),
|
|
191
193
|
// v1 shadow-md
|
|
192
194
|
boxShadow: "0 4px 6px -1px #0000001a, 0 2px 4px -2px #0000001a",
|
|
193
195
|
outlineStyle: "none",
|
|
@@ -200,16 +202,16 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
200
202
|
transform: "scale(0.95)"
|
|
201
203
|
},
|
|
202
204
|
"&[data-starting-style][data-side='bottom']": {
|
|
203
|
-
transform: `translateY(-${
|
|
205
|
+
transform: `translateY(-${x}) scale(0.95)`
|
|
204
206
|
},
|
|
205
207
|
"&[data-starting-style][data-side='left']": {
|
|
206
|
-
transform: `translateX(${
|
|
208
|
+
transform: `translateX(${x}) scale(0.95)`
|
|
207
209
|
},
|
|
208
210
|
"&[data-starting-style][data-side='right']": {
|
|
209
|
-
transform: `translateX(-${
|
|
211
|
+
transform: `translateX(-${x}) scale(0.95)`
|
|
210
212
|
},
|
|
211
213
|
"&[data-starting-style][data-side='top']": {
|
|
212
|
-
transform: `translateY(${
|
|
214
|
+
transform: `translateY(${x}) scale(0.95)`
|
|
213
215
|
},
|
|
214
216
|
"&[data-ending-style]": {
|
|
215
217
|
opacity: 0,
|
|
@@ -239,8 +241,8 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
239
241
|
},
|
|
240
242
|
width: "100%",
|
|
241
243
|
minWidth: "var(--anchor-width)",
|
|
242
|
-
scrollMarginTop:
|
|
243
|
-
scrollMarginBottom:
|
|
244
|
+
scrollMarginTop: C,
|
|
245
|
+
scrollMarginBottom: C
|
|
244
246
|
},
|
|
245
247
|
item: {
|
|
246
248
|
...h,
|
|
@@ -250,18 +252,18 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
250
252
|
cursor: "default",
|
|
251
253
|
userSelect: "none",
|
|
252
254
|
alignItems: "center",
|
|
253
|
-
...
|
|
254
|
-
...
|
|
255
|
+
...w.gap(x),
|
|
256
|
+
...w.borderRadius(K),
|
|
255
257
|
// DENSITY-SPEC.md §2.3 — left padding and vertical padding are density levers; right padding
|
|
256
258
|
// stays a fixed 32px at every tier (reserves the check-indicator's space, not modeled in
|
|
257
259
|
// density.yaml).
|
|
258
|
-
paddingLeft:
|
|
260
|
+
paddingLeft: yt,
|
|
259
261
|
paddingRight: "2rem",
|
|
260
|
-
paddingTop:
|
|
261
|
-
paddingBottom:
|
|
262
|
-
fontSize:
|
|
263
|
-
lineHeight:
|
|
264
|
-
color:
|
|
262
|
+
paddingTop: Z,
|
|
263
|
+
paddingBottom: Z,
|
|
264
|
+
fontSize: Y,
|
|
265
|
+
lineHeight: U,
|
|
266
|
+
color: H,
|
|
265
267
|
outlineStyle: "none",
|
|
266
268
|
":not(:first-child)": {
|
|
267
269
|
marginTop: "0.125rem"
|
|
@@ -281,13 +283,13 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
281
283
|
flexShrink: 0
|
|
282
284
|
},
|
|
283
285
|
"& svg:not([class*='text-'])": {
|
|
284
|
-
color:
|
|
286
|
+
color: F
|
|
285
287
|
}
|
|
286
288
|
},
|
|
287
289
|
itemIndicatorWrapper: {
|
|
288
290
|
...h,
|
|
289
291
|
position: "absolute",
|
|
290
|
-
right:
|
|
292
|
+
right: x,
|
|
291
293
|
display: "flex",
|
|
292
294
|
width: "1rem",
|
|
293
295
|
height: "1rem",
|
|
@@ -300,28 +302,28 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
300
302
|
display: "block",
|
|
301
303
|
width: "1rem",
|
|
302
304
|
height: "1rem",
|
|
303
|
-
color:
|
|
305
|
+
color: F
|
|
304
306
|
},
|
|
305
307
|
label: {
|
|
306
308
|
...h,
|
|
307
|
-
paddingLeft:
|
|
308
|
-
paddingRight:
|
|
309
|
+
paddingLeft: x,
|
|
310
|
+
paddingRight: x,
|
|
309
311
|
paddingTop: "0.375rem",
|
|
310
312
|
paddingBottom: "0.375rem",
|
|
311
|
-
fontSize:
|
|
312
|
-
lineHeight:
|
|
313
|
-
fontWeight:
|
|
314
|
-
color:
|
|
313
|
+
fontSize: vt,
|
|
314
|
+
lineHeight: xt,
|
|
315
|
+
fontWeight: wt,
|
|
316
|
+
color: ht
|
|
315
317
|
},
|
|
316
318
|
separator: {
|
|
317
319
|
...h,
|
|
318
320
|
pointerEvents: "none",
|
|
319
|
-
marginLeft: `calc(-1 * ${
|
|
320
|
-
marginRight: `calc(-1 * ${
|
|
321
|
-
marginTop:
|
|
322
|
-
marginBottom:
|
|
321
|
+
marginLeft: `calc(-1 * ${C})`,
|
|
322
|
+
marginRight: `calc(-1 * ${C})`,
|
|
323
|
+
marginTop: C,
|
|
324
|
+
marginBottom: C,
|
|
323
325
|
height: "1px",
|
|
324
|
-
backgroundColor:
|
|
326
|
+
backgroundColor: mt
|
|
325
327
|
},
|
|
326
328
|
scrollArrow: {
|
|
327
329
|
display: "flex",
|
|
@@ -332,11 +334,11 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
332
334
|
},
|
|
333
335
|
scrollArrowUp: {
|
|
334
336
|
...h,
|
|
335
|
-
paddingBottom:
|
|
337
|
+
paddingBottom: C
|
|
336
338
|
},
|
|
337
339
|
scrollArrowDown: {
|
|
338
340
|
...h,
|
|
339
|
-
paddingTop:
|
|
341
|
+
paddingTop: C
|
|
340
342
|
},
|
|
341
343
|
scrollArrowIcon: {
|
|
342
344
|
...h,
|
|
@@ -347,21 +349,21 @@ const Dt = (i) => /* @__PURE__ */ o(
|
|
|
347
349
|
transform: "rotate(180deg)"
|
|
348
350
|
}
|
|
349
351
|
});
|
|
350
|
-
function
|
|
352
|
+
function L(i) {
|
|
351
353
|
const t = s.Children.toArray(i).filter(s.isValidElement);
|
|
352
354
|
return t.length === 1 ? t[0] : void 0;
|
|
353
355
|
}
|
|
354
|
-
function
|
|
355
|
-
const r = i ?
|
|
356
|
+
function T(i, t) {
|
|
357
|
+
const r = i ? L(t) : void 0;
|
|
356
358
|
return r ? { render: r } : { children: t };
|
|
357
359
|
}
|
|
358
|
-
function
|
|
359
|
-
const e = i ?
|
|
360
|
+
function W(i, t, r) {
|
|
361
|
+
const e = i ? L(t) : void 0;
|
|
360
362
|
if (!e) return { children: r(t) };
|
|
361
363
|
const n = e.props.children;
|
|
362
364
|
return { render: s.cloneElement(e, void 0, r(n)) };
|
|
363
365
|
}
|
|
364
|
-
function
|
|
366
|
+
function qt(i) {
|
|
365
367
|
if (i)
|
|
366
368
|
return () => {
|
|
367
369
|
const t = new Event("focus", { cancelable: !0 }), r = document.activeElement;
|
|
@@ -370,7 +372,7 @@ function Tt(i) {
|
|
|
370
372
|
return e !== r && e instanceof HTMLElement && queueMicrotask(() => e.focus()), !t.defaultPrevented;
|
|
371
373
|
};
|
|
372
374
|
}
|
|
373
|
-
function
|
|
375
|
+
function Et() {
|
|
374
376
|
const i = /* @__PURE__ */ new Map(), t = /* @__PURE__ */ new Set();
|
|
375
377
|
let r = 0;
|
|
376
378
|
const e = () => {
|
|
@@ -396,105 +398,105 @@ function Nt() {
|
|
|
396
398
|
version: () => r
|
|
397
399
|
};
|
|
398
400
|
}
|
|
399
|
-
const
|
|
401
|
+
const N = s.createContext(null), A = s.createContext(!1);
|
|
400
402
|
function Q(i) {
|
|
401
403
|
return i === "" ? null : i;
|
|
402
404
|
}
|
|
403
|
-
const
|
|
404
|
-
const [
|
|
405
|
+
const Qt = s.forwardRef(function({ children: t, dir: r, value: e, defaultValue: n, onValueChange: a, onOpenChange: l, ...c }, d) {
|
|
406
|
+
const [g] = s.useState(Et), u = s.useMemo(() => ({ labels: g, dir: r }), [g, r]), y = ut() !== null, m = /* @__PURE__ */ o(
|
|
405
407
|
p.Root,
|
|
406
408
|
{
|
|
407
409
|
"data-slot": "select",
|
|
408
410
|
...e !== void 0 ? { value: Q(e) } : {},
|
|
409
411
|
...n !== void 0 ? { defaultValue: Q(n) } : {},
|
|
410
|
-
onValueChange: (
|
|
411
|
-
onOpenChange: (
|
|
412
|
-
if (
|
|
413
|
-
|
|
412
|
+
onValueChange: (I) => a == null ? void 0 : a(I ?? ""),
|
|
413
|
+
onOpenChange: (I, b) => {
|
|
414
|
+
if (b.reason === "escape-key" && b.event.defaultPrevented) {
|
|
415
|
+
b.cancel();
|
|
414
416
|
return;
|
|
415
417
|
}
|
|
416
|
-
l == null || l(
|
|
418
|
+
l == null || l(I, b);
|
|
417
419
|
},
|
|
418
420
|
...c,
|
|
419
|
-
children: /* @__PURE__ */ o(
|
|
421
|
+
children: /* @__PURE__ */ o(N.Provider, { value: u, children: t })
|
|
420
422
|
}
|
|
421
|
-
);
|
|
422
|
-
return r ? /* @__PURE__ */ o(at, { direction: r, children:
|
|
423
|
-
}),
|
|
423
|
+
), S = c.name === void 0 || y ? m : /* @__PURE__ */ o(pt, { slot: "select-box", layout: "block", children: m });
|
|
424
|
+
return r ? /* @__PURE__ */ o(at, { direction: r, children: S }) : S;
|
|
425
|
+
}), te = s.forwardRef(
|
|
424
426
|
function({ asChild: t = !1, className: r, children: e, ...n }, a) {
|
|
425
|
-
return s.useContext(
|
|
427
|
+
return s.useContext(A) ? /* @__PURE__ */ o(R, { children: e }) : /* @__PURE__ */ o(
|
|
426
428
|
p.Group,
|
|
427
429
|
{
|
|
428
430
|
ref: a,
|
|
429
431
|
"data-slot": "select-group",
|
|
430
|
-
[
|
|
432
|
+
[f]: "select-group",
|
|
431
433
|
className: r,
|
|
432
434
|
...n,
|
|
433
|
-
...
|
|
435
|
+
...T(t, e)
|
|
434
436
|
}
|
|
435
437
|
);
|
|
436
438
|
}
|
|
437
|
-
),
|
|
439
|
+
), ee = s.forwardRef(
|
|
438
440
|
function({ asChild: t = !1, className: r, children: e, placeholder: n, style: a, ...l }, c) {
|
|
439
|
-
var
|
|
440
|
-
const d = (
|
|
441
|
+
var m;
|
|
442
|
+
const d = (m = s.useContext(N)) == null ? void 0 : m.labels;
|
|
441
443
|
s.useSyncExternalStore(
|
|
442
|
-
(d == null ? void 0 : d.subscribe) ??
|
|
444
|
+
(d == null ? void 0 : d.subscribe) ?? Pt,
|
|
443
445
|
(d == null ? void 0 : d.version) ?? tt,
|
|
444
446
|
(d == null ? void 0 : d.version) ?? tt
|
|
445
447
|
);
|
|
446
|
-
const
|
|
448
|
+
const g = t ? L(e) : void 0, u = t ? void 0 : e, y = (S) => S == null ? n : u ?? (d == null ? void 0 : d.labelFor(S)) ?? null;
|
|
447
449
|
return /* @__PURE__ */ o(
|
|
448
450
|
p.Value,
|
|
449
451
|
{
|
|
450
452
|
ref: c,
|
|
451
453
|
"data-slot": "select-value",
|
|
452
|
-
[
|
|
454
|
+
[f]: "select-value",
|
|
453
455
|
className: r,
|
|
454
456
|
style: { pointerEvents: "none", ...a },
|
|
455
457
|
...l,
|
|
456
|
-
...
|
|
457
|
-
children:
|
|
458
|
+
...g ? { render: g } : {},
|
|
459
|
+
children: y
|
|
458
460
|
}
|
|
459
461
|
);
|
|
460
462
|
}
|
|
461
463
|
);
|
|
462
|
-
function
|
|
464
|
+
function Pt() {
|
|
463
465
|
return () => {
|
|
464
466
|
};
|
|
465
467
|
}
|
|
466
468
|
function tt() {
|
|
467
469
|
return 0;
|
|
468
470
|
}
|
|
469
|
-
const
|
|
471
|
+
const oe = s.forwardRef(function({ asChild: t = !1, className: r, children: e, ...n }, a) {
|
|
470
472
|
var u;
|
|
471
|
-
const l =
|
|
473
|
+
const l = D(), c = (u = s.useContext(N)) == null ? void 0 : u.dir, d = t ? L(e) : void 0, g = !d || typeof d.type != "string" || d.type === "button";
|
|
472
474
|
return /* @__PURE__ */ o(
|
|
473
475
|
p.Trigger,
|
|
474
476
|
{
|
|
475
477
|
ref: a,
|
|
476
478
|
"data-slot": "select-trigger",
|
|
477
|
-
[
|
|
478
|
-
nativeButton:
|
|
479
|
-
className:
|
|
479
|
+
[f]: "select-trigger",
|
|
480
|
+
nativeButton: g,
|
|
481
|
+
className: v(l.trigger, r),
|
|
480
482
|
...c ? { dir: c } : {},
|
|
481
483
|
...n,
|
|
482
|
-
...
|
|
483
|
-
|
|
484
|
+
...W(t, e, (y) => /* @__PURE__ */ E(R, { children: [
|
|
485
|
+
y,
|
|
484
486
|
/* @__PURE__ */ o(
|
|
485
487
|
p.Icon,
|
|
486
488
|
{
|
|
487
489
|
"data-slot": "select-icon",
|
|
488
|
-
[
|
|
490
|
+
[f]: "select-icon",
|
|
489
491
|
className: l.triggerIconWrapper,
|
|
490
|
-
render: /* @__PURE__ */ o(
|
|
492
|
+
render: /* @__PURE__ */ o(Nt, { className: l.triggerIcon })
|
|
491
493
|
}
|
|
492
494
|
)
|
|
493
495
|
] }))
|
|
494
496
|
}
|
|
495
497
|
);
|
|
496
|
-
}),
|
|
497
|
-
const a =
|
|
498
|
+
}), re = s.forwardRef(function({ className: t, onClick: r, ...e }, n) {
|
|
499
|
+
const a = D();
|
|
498
500
|
return /* @__PURE__ */ o(
|
|
499
501
|
"span",
|
|
500
502
|
{
|
|
@@ -502,8 +504,8 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
502
504
|
role: "button",
|
|
503
505
|
tabIndex: 0,
|
|
504
506
|
"data-slot": "select-trigger-clear",
|
|
505
|
-
[
|
|
506
|
-
className:
|
|
507
|
+
[f]: "select-trigger-clear",
|
|
508
|
+
className: v(a.triggerClear, t),
|
|
507
509
|
onPointerDown: (l) => {
|
|
508
510
|
l.preventDefault(), l.stopPropagation();
|
|
509
511
|
},
|
|
@@ -514,18 +516,18 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
514
516
|
l.preventDefault(), l.stopPropagation(), r == null || r(l);
|
|
515
517
|
},
|
|
516
518
|
...e,
|
|
517
|
-
children: /* @__PURE__ */ o(
|
|
519
|
+
children: /* @__PURE__ */ o(Rt, { className: a.triggerClearIcon })
|
|
518
520
|
}
|
|
519
521
|
);
|
|
520
|
-
}),
|
|
522
|
+
}), kt = {
|
|
521
523
|
side: "none",
|
|
522
524
|
align: "none",
|
|
523
525
|
fallbackAxisSide: "none"
|
|
524
|
-
},
|
|
526
|
+
}, Bt = {
|
|
525
527
|
side: "flip",
|
|
526
528
|
align: "flip",
|
|
527
529
|
fallbackAxisSide: "none"
|
|
528
|
-
},
|
|
530
|
+
}, Ft = 10, ne = s.forwardRef(function({
|
|
529
531
|
asChild: t = !1,
|
|
530
532
|
className: r,
|
|
531
533
|
children: e,
|
|
@@ -534,26 +536,26 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
534
536
|
side: l = "bottom",
|
|
535
537
|
sideOffset: c = 0,
|
|
536
538
|
align: d = "center",
|
|
537
|
-
alignOffset:
|
|
539
|
+
alignOffset: g = 0,
|
|
538
540
|
arrowPadding: u = 0,
|
|
539
|
-
avoidCollisions:
|
|
540
|
-
collisionBoundary:
|
|
541
|
-
collisionPadding:
|
|
542
|
-
sticky:
|
|
543
|
-
hideWhenDetached:
|
|
541
|
+
avoidCollisions: y = !0,
|
|
542
|
+
collisionBoundary: m = [],
|
|
543
|
+
collisionPadding: S = Ft,
|
|
544
|
+
sticky: I = "partial",
|
|
545
|
+
hideWhenDetached: b = !1,
|
|
544
546
|
updatePositionStrategy: P,
|
|
545
547
|
onCloseAutoFocus: k,
|
|
546
548
|
...ot
|
|
547
549
|
}, rt) {
|
|
548
550
|
var z, X, $;
|
|
549
|
-
const q =
|
|
551
|
+
const q = D(), M = (z = s.useContext(N)) == null ? void 0 : z.dir, O = dt(), nt = ct(), [_, it] = s.useState(null);
|
|
550
552
|
if (s.useLayoutEffect(() => {
|
|
551
553
|
it(document.createDocumentFragment());
|
|
552
|
-
}, []), s.useContext(
|
|
553
|
-
const lt = t ? ($ = (X =
|
|
554
|
-
return /* @__PURE__ */ E(
|
|
554
|
+
}, []), s.useContext(A)) return null;
|
|
555
|
+
const lt = t ? ($ = (X = L(e)) == null ? void 0 : X.props) == null ? void 0 : $.children : e;
|
|
556
|
+
return /* @__PURE__ */ E(R, { children: [
|
|
555
557
|
_ && st(
|
|
556
|
-
/* @__PURE__ */ o(
|
|
558
|
+
/* @__PURE__ */ o(A.Provider, { value: !0, children: lt }),
|
|
557
559
|
_
|
|
558
560
|
),
|
|
559
561
|
/* @__PURE__ */ o(
|
|
@@ -563,44 +565,44 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
563
565
|
children: /* @__PURE__ */ o(
|
|
564
566
|
p.Positioner,
|
|
565
567
|
{
|
|
566
|
-
className:
|
|
568
|
+
className: v(
|
|
567
569
|
q.positioner,
|
|
568
|
-
|
|
570
|
+
b && q.hideWhenDetached
|
|
569
571
|
),
|
|
570
572
|
alignItemWithTrigger: a === "item-aligned",
|
|
571
573
|
side: l,
|
|
572
574
|
sideOffset: c,
|
|
573
575
|
align: d,
|
|
574
|
-
alignOffset:
|
|
576
|
+
alignOffset: g,
|
|
575
577
|
arrowPadding: u,
|
|
576
|
-
collisionBoundary: (Array.isArray(
|
|
577
|
-
collisionPadding:
|
|
578
|
-
collisionAvoidance:
|
|
579
|
-
sticky:
|
|
578
|
+
collisionBoundary: (Array.isArray(m) ? m : [m]).filter((B) => B !== null),
|
|
579
|
+
collisionPadding: S,
|
|
580
|
+
collisionAvoidance: y ? Bt : kt,
|
|
581
|
+
sticky: I === "always",
|
|
580
582
|
children: /* @__PURE__ */ o(
|
|
581
583
|
p.Popup,
|
|
582
584
|
{
|
|
583
585
|
ref: rt,
|
|
584
586
|
"data-slot": "select-content",
|
|
585
|
-
[
|
|
587
|
+
[f]: "select-content",
|
|
586
588
|
...O !== void 0 ? { "data-density": O } : {},
|
|
587
589
|
...nt,
|
|
588
|
-
...
|
|
589
|
-
finalFocus:
|
|
590
|
-
className:
|
|
590
|
+
...M ? { dir: M } : {},
|
|
591
|
+
finalFocus: qt(k),
|
|
592
|
+
className: v(q.popup, r),
|
|
591
593
|
...ot,
|
|
592
|
-
...
|
|
593
|
-
/* @__PURE__ */ o(
|
|
594
|
+
...W(t, e, (B) => /* @__PURE__ */ E(R, { children: [
|
|
595
|
+
/* @__PURE__ */ o(Wt, {}),
|
|
594
596
|
/* @__PURE__ */ o(
|
|
595
597
|
p.List,
|
|
596
598
|
{
|
|
597
599
|
"data-slot": "select-viewport",
|
|
598
|
-
[
|
|
600
|
+
[f]: "select-viewport",
|
|
599
601
|
className: q.viewport,
|
|
600
602
|
children: B
|
|
601
603
|
}
|
|
602
604
|
),
|
|
603
|
-
/* @__PURE__ */ o(
|
|
605
|
+
/* @__PURE__ */ o(Mt, {})
|
|
604
606
|
] }))
|
|
605
607
|
}
|
|
606
608
|
)
|
|
@@ -609,22 +611,22 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
609
611
|
}
|
|
610
612
|
)
|
|
611
613
|
] });
|
|
612
|
-
}),
|
|
614
|
+
}), ie = s.forwardRef(
|
|
613
615
|
function({ asChild: t = !1, className: r, children: e, ...n }, a) {
|
|
614
|
-
const l =
|
|
615
|
-
return s.useContext(
|
|
616
|
+
const l = D();
|
|
617
|
+
return s.useContext(A) ? null : /* @__PURE__ */ o(
|
|
616
618
|
p.GroupLabel,
|
|
617
619
|
{
|
|
618
620
|
ref: a,
|
|
619
621
|
"data-slot": "select-label",
|
|
620
|
-
[
|
|
621
|
-
className:
|
|
622
|
+
[f]: "select-label",
|
|
623
|
+
className: v(l.label, r),
|
|
622
624
|
...n,
|
|
623
|
-
...
|
|
625
|
+
...T(t, e)
|
|
624
626
|
}
|
|
625
627
|
);
|
|
626
628
|
}
|
|
627
|
-
),
|
|
629
|
+
), le = s.forwardRef(
|
|
628
630
|
function({
|
|
629
631
|
asChild: t = !1,
|
|
630
632
|
className: r,
|
|
@@ -634,11 +636,11 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
634
636
|
textValue: l,
|
|
635
637
|
...c
|
|
636
638
|
}, d) {
|
|
637
|
-
var
|
|
638
|
-
const
|
|
639
|
+
var I, b, P;
|
|
640
|
+
const g = D(), u = (I = s.useContext(N)) == null ? void 0 : I.labels, y = s.useContext(A), [m] = s.useState(() => ({})), S = t ? (P = (b = L(e)) == null ? void 0 : b.props) == null ? void 0 : P.children : e;
|
|
639
641
|
return s.useLayoutEffect(() => {
|
|
640
|
-
u == null || u.set(
|
|
641
|
-
}), s.useLayoutEffect(() => () => u == null ? void 0 : u.delete(
|
|
642
|
+
u == null || u.set(m, n, S);
|
|
643
|
+
}), s.useLayoutEffect(() => () => u == null ? void 0 : u.delete(m), [u, m]), y ? null : /* @__PURE__ */ o(
|
|
642
644
|
p.Item,
|
|
643
645
|
{
|
|
644
646
|
ref: d,
|
|
@@ -646,72 +648,72 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
646
648
|
disabled: a,
|
|
647
649
|
...l !== void 0 ? { label: l } : {},
|
|
648
650
|
"data-slot": "select-item",
|
|
649
|
-
[
|
|
650
|
-
className:
|
|
651
|
+
[f]: "select-item",
|
|
652
|
+
className: v(g.item, r),
|
|
651
653
|
...c,
|
|
652
|
-
...
|
|
653
|
-
/* @__PURE__ */ o("span", { className:
|
|
654
|
+
...W(t, e, (k) => /* @__PURE__ */ E(R, { children: [
|
|
655
|
+
/* @__PURE__ */ o("span", { className: g.itemIndicatorWrapper, children: /* @__PURE__ */ o(p.ItemIndicator, { children: /* @__PURE__ */ o(Tt, { className: g.itemIndicatorIcon }) }) }),
|
|
654
656
|
/* @__PURE__ */ o(p.ItemText, { render: /* @__PURE__ */ o("span", {}), children: k })
|
|
655
657
|
] }))
|
|
656
658
|
}
|
|
657
659
|
);
|
|
658
660
|
}
|
|
659
|
-
),
|
|
660
|
-
const l =
|
|
661
|
-
return s.useContext(
|
|
661
|
+
), se = s.forwardRef(function({ asChild: t = !1, className: r, children: e, ...n }, a) {
|
|
662
|
+
const l = D();
|
|
663
|
+
return s.useContext(A) ? null : /* @__PURE__ */ o(
|
|
662
664
|
p.Separator,
|
|
663
665
|
{
|
|
664
666
|
ref: a,
|
|
665
667
|
"aria-hidden": !0,
|
|
666
668
|
"data-slot": "select-separator",
|
|
667
|
-
[
|
|
668
|
-
className:
|
|
669
|
+
[f]: "select-separator",
|
|
670
|
+
className: v(l.separator, r),
|
|
669
671
|
...n,
|
|
670
|
-
...
|
|
672
|
+
...T(t, e)
|
|
671
673
|
}
|
|
672
674
|
);
|
|
673
|
-
}),
|
|
674
|
-
const c =
|
|
675
|
-
return s.useContext(
|
|
675
|
+
}), Wt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, style: n, ...a }, l) {
|
|
676
|
+
const c = D();
|
|
677
|
+
return s.useContext(A) ? null : /* @__PURE__ */ o(
|
|
676
678
|
p.ScrollUpArrow,
|
|
677
679
|
{
|
|
678
680
|
ref: l,
|
|
679
681
|
"data-slot": "select-scroll-up-button",
|
|
680
|
-
[
|
|
681
|
-
className:
|
|
682
|
+
[f]: "select-scroll-up-button",
|
|
683
|
+
className: v(
|
|
682
684
|
c.scrollArrow,
|
|
683
685
|
c.scrollArrowUp,
|
|
684
686
|
r
|
|
685
687
|
),
|
|
686
688
|
style: { position: "static", ...n },
|
|
687
689
|
...a,
|
|
688
|
-
...
|
|
690
|
+
...T(
|
|
689
691
|
t,
|
|
690
692
|
e ?? /* @__PURE__ */ o(et, { className: c.scrollArrowIcon })
|
|
691
693
|
)
|
|
692
694
|
}
|
|
693
695
|
);
|
|
694
|
-
}),
|
|
695
|
-
const c =
|
|
696
|
-
return s.useContext(
|
|
696
|
+
}), Mt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, style: n, ...a }, l) {
|
|
697
|
+
const c = D();
|
|
698
|
+
return s.useContext(A) ? null : /* @__PURE__ */ o(
|
|
697
699
|
p.ScrollDownArrow,
|
|
698
700
|
{
|
|
699
701
|
ref: l,
|
|
700
702
|
"data-slot": "select-scroll-down-button",
|
|
701
|
-
[
|
|
702
|
-
className:
|
|
703
|
+
[f]: "select-scroll-down-button",
|
|
704
|
+
className: v(
|
|
703
705
|
c.scrollArrow,
|
|
704
706
|
c.scrollArrowDown,
|
|
705
707
|
r
|
|
706
708
|
),
|
|
707
709
|
style: { position: "static", ...n },
|
|
708
710
|
...a,
|
|
709
|
-
...
|
|
711
|
+
...T(
|
|
710
712
|
t,
|
|
711
713
|
e ?? /* @__PURE__ */ o(
|
|
712
714
|
et,
|
|
713
715
|
{
|
|
714
|
-
className:
|
|
716
|
+
className: v(
|
|
715
717
|
c.scrollArrowIcon,
|
|
716
718
|
c.scrollArrowDownIcon
|
|
717
719
|
)
|
|
@@ -722,16 +724,16 @@ const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, .
|
|
|
722
724
|
);
|
|
723
725
|
});
|
|
724
726
|
export {
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
727
|
+
Qt as Select,
|
|
728
|
+
ne as SelectContent,
|
|
729
|
+
te as SelectGroup,
|
|
730
|
+
le as SelectItem,
|
|
731
|
+
ie as SelectLabel,
|
|
732
|
+
Mt as SelectScrollDownButton,
|
|
733
|
+
Wt as SelectScrollUpButton,
|
|
734
|
+
se as SelectSeparator,
|
|
735
|
+
oe as SelectTrigger,
|
|
736
|
+
re as SelectTriggerClear,
|
|
737
|
+
ee as SelectValue
|
|
736
738
|
};
|
|
737
739
|
//# sourceMappingURL=select.js.map
|