@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.
@@ -1,16 +1,18 @@
1
- import { jsx as o, jsxs as E, Fragment as D } from "react/jsx-runtime";
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 y, SLOT_ATTR as g, shorthands as v } from "@epilot/zenith-runtime/v1";
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 { makeZenithStyles as ut } from "../../styles/make-styles.js";
10
- import { boxModel as h, nativeControl as pt } from "../../styles/host-reset.js";
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 b, graySoft as ft, gray11 as gt, fontWeightSemibold as mt, leadingXs as ht, textXs as wt, spacingElement2 as S, grayA11 as W, accentA3 as G, grayA12 as U, leadingSm as Y, textSm as Z, selectItemPaddingY as H, selectItemPaddingLeft as xt, body as vt, accentA11 as V, focusRing as J, accentSoft as St, grayA8 as yt, radiusMd as K, radius2xl as bt, selectContentGap as It, selectContentPadding as Ct, radiusLg as At } from "../../tokens/index.js";
13
- const Dt = (i) => /* @__PURE__ */ o(
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
- ), Lt = (i) => /* @__PURE__ */ o(
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
- ), Rt = (i) => /* @__PURE__ */ o(
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
- ), C = ut({
59
+ ), D = ft({
58
60
  trigger: {
59
- ...pt,
61
+ ...gt,
60
62
  display: "flex",
61
63
  width: "100%",
62
64
  alignItems: "center",
63
65
  justifyContent: "space-between",
64
- ...v.gap(S),
65
- ...v.borderRadius(At),
66
+ ...w.gap(x),
67
+ ...w.borderRadius(Lt),
66
68
  backgroundColor: "transparent",
67
- fontSize: Z,
68
- lineHeight: Y,
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: yt
92
+ color: It
91
93
  },
92
94
  "& svg": {
93
95
  pointerEvents: "none",
94
96
  flexShrink: 0
95
97
  },
96
- [`& [${g}="select-value"]`]: {
98
+ [`& [${f}="select-value"]`]: {
97
99
  display: "flex",
98
100
  alignItems: "center",
99
- ...v.gap(S),
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] [${g}="select-icon"]`]: {
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: W,
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
- ...v.borderRadius(K),
144
+ ...w.borderRadius(K),
143
145
  ":hover": {
144
- backgroundColor: St
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: vt,
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
- ...v.padding(Ct),
182
- ...v.gap(It),
183
- color: U,
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
- ...v.borderRadius(bt),
190
- ...v.border("1px", "solid", "transparent"),
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(-${S}) scale(0.95)`
205
+ transform: `translateY(-${x}) scale(0.95)`
204
206
  },
205
207
  "&[data-starting-style][data-side='left']": {
206
- transform: `translateX(${S}) scale(0.95)`
208
+ transform: `translateX(${x}) scale(0.95)`
207
209
  },
208
210
  "&[data-starting-style][data-side='right']": {
209
- transform: `translateX(-${S}) scale(0.95)`
211
+ transform: `translateX(-${x}) scale(0.95)`
210
212
  },
211
213
  "&[data-starting-style][data-side='top']": {
212
- transform: `translateY(${S}) scale(0.95)`
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: b,
243
- scrollMarginBottom: b
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
- ...v.gap(S),
254
- ...v.borderRadius(K),
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: xt,
260
+ paddingLeft: yt,
259
261
  paddingRight: "2rem",
260
- paddingTop: H,
261
- paddingBottom: H,
262
- fontSize: Z,
263
- lineHeight: Y,
264
- color: U,
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: W
286
+ color: F
285
287
  }
286
288
  },
287
289
  itemIndicatorWrapper: {
288
290
  ...h,
289
291
  position: "absolute",
290
- right: S,
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: W
305
+ color: F
304
306
  },
305
307
  label: {
306
308
  ...h,
307
- paddingLeft: S,
308
- paddingRight: S,
309
+ paddingLeft: x,
310
+ paddingRight: x,
309
311
  paddingTop: "0.375rem",
310
312
  paddingBottom: "0.375rem",
311
- fontSize: wt,
312
- lineHeight: ht,
313
- fontWeight: mt,
314
- color: gt
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 * ${b})`,
320
- marginRight: `calc(-1 * ${b})`,
321
- marginTop: b,
322
- marginBottom: b,
321
+ marginLeft: `calc(-1 * ${C})`,
322
+ marginRight: `calc(-1 * ${C})`,
323
+ marginTop: C,
324
+ marginBottom: C,
323
325
  height: "1px",
324
- backgroundColor: ft
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: b
337
+ paddingBottom: C
336
338
  },
337
339
  scrollArrowDown: {
338
340
  ...h,
339
- paddingTop: b
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 A(i) {
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 L(i, t) {
355
- const r = i ? A(t) : void 0;
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 M(i, t, r) {
359
- const e = i ? A(t) : void 0;
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 Tt(i) {
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 Nt() {
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 R = s.createContext(null), I = s.createContext(!1);
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 Ht = s.forwardRef(function({ children: t, dir: r, value: e, defaultValue: n, onValueChange: a, onOpenChange: l, ...c }, d) {
404
- const [m] = s.useState(Nt), u = s.useMemo(() => ({ labels: m, dir: r }), [m, r]), x = /* @__PURE__ */ o(
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: (f) => a == null ? void 0 : a(f ?? ""),
411
- onOpenChange: (f, w) => {
412
- if (w.reason === "escape-key" && w.event.defaultPrevented) {
413
- w.cancel();
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(f, w);
418
+ l == null || l(I, b);
417
419
  },
418
420
  ...c,
419
- children: /* @__PURE__ */ o(R.Provider, { value: u, children: t })
421
+ children: /* @__PURE__ */ o(N.Provider, { value: u, children: t })
420
422
  }
421
- );
422
- return r ? /* @__PURE__ */ o(at, { direction: r, children: x }) : x;
423
- }), Vt = s.forwardRef(
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(I) ? /* @__PURE__ */ o(D, { children: e }) : /* @__PURE__ */ o(
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
- [g]: "select-group",
432
+ [f]: "select-group",
431
433
  className: r,
432
434
  ...n,
433
- ...L(t, e)
435
+ ...T(t, e)
434
436
  }
435
437
  );
436
438
  }
437
- ), Jt = s.forwardRef(
439
+ ), ee = s.forwardRef(
438
440
  function({ asChild: t = !1, className: r, children: e, placeholder: n, style: a, ...l }, c) {
439
- var f;
440
- const d = (f = s.useContext(R)) == null ? void 0 : f.labels;
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) ?? qt,
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 m = t ? A(e) : void 0, u = t ? void 0 : e, x = (w) => w == null ? n : u ?? (d == null ? void 0 : d.labelFor(w)) ?? null;
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
- [g]: "select-value",
454
+ [f]: "select-value",
453
455
  className: r,
454
456
  style: { pointerEvents: "none", ...a },
455
457
  ...l,
456
- ...m ? { render: m } : {},
457
- children: x
458
+ ...g ? { render: g } : {},
459
+ children: y
458
460
  }
459
461
  );
460
462
  }
461
463
  );
462
- function qt() {
464
+ function Pt() {
463
465
  return () => {
464
466
  };
465
467
  }
466
468
  function tt() {
467
469
  return 0;
468
470
  }
469
- const Kt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, ...n }, a) {
471
+ const oe = s.forwardRef(function({ asChild: t = !1, className: r, children: e, ...n }, a) {
470
472
  var u;
471
- const l = C(), c = (u = s.useContext(R)) == null ? void 0 : u.dir, d = t ? A(e) : void 0, m = !d || typeof d.type != "string" || d.type === "button";
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
- [g]: "select-trigger",
478
- nativeButton: m,
479
- className: y(l.trigger, r),
479
+ [f]: "select-trigger",
480
+ nativeButton: g,
481
+ className: v(l.trigger, r),
480
482
  ...c ? { dir: c } : {},
481
483
  ...n,
482
- ...M(t, e, (x) => /* @__PURE__ */ E(D, { children: [
483
- x,
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
- [g]: "select-icon",
490
+ [f]: "select-icon",
489
491
  className: l.triggerIconWrapper,
490
- render: /* @__PURE__ */ o(Rt, { className: l.triggerIcon })
492
+ render: /* @__PURE__ */ o(Nt, { className: l.triggerIcon })
491
493
  }
492
494
  )
493
495
  ] }))
494
496
  }
495
497
  );
496
- }), Qt = s.forwardRef(function({ className: t, onClick: r, ...e }, n) {
497
- const a = C();
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
- [g]: "select-trigger-clear",
506
- className: y(a.triggerClear, t),
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(Dt, { className: a.triggerClearIcon })
519
+ children: /* @__PURE__ */ o(Rt, { className: a.triggerClearIcon })
518
520
  }
519
521
  );
520
- }), Et = {
522
+ }), kt = {
521
523
  side: "none",
522
524
  align: "none",
523
525
  fallbackAxisSide: "none"
524
- }, Pt = {
526
+ }, Bt = {
525
527
  side: "flip",
526
528
  align: "flip",
527
529
  fallbackAxisSide: "none"
528
- }, kt = 10, te = s.forwardRef(function({
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: m = 0,
539
+ alignOffset: g = 0,
538
540
  arrowPadding: u = 0,
539
- avoidCollisions: x = !0,
540
- collisionBoundary: f = [],
541
- collisionPadding: w = kt,
542
- sticky: T = "partial",
543
- hideWhenDetached: N = !1,
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 = C(), F = (z = s.useContext(R)) == null ? void 0 : z.dir, O = dt(), nt = ct(), [_, it] = s.useState(null);
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(I)) return null;
553
- const lt = t ? ($ = (X = A(e)) == null ? void 0 : X.props) == null ? void 0 : $.children : e;
554
- return /* @__PURE__ */ E(D, { children: [
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(I.Provider, { value: !0, children: lt }),
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: y(
568
+ className: v(
567
569
  q.positioner,
568
- N && q.hideWhenDetached
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: m,
576
+ alignOffset: g,
575
577
  arrowPadding: u,
576
- collisionBoundary: (Array.isArray(f) ? f : [f]).filter((B) => B !== null),
577
- collisionPadding: w,
578
- collisionAvoidance: x ? Pt : Et,
579
- sticky: T === "always",
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
- [g]: "select-content",
587
+ [f]: "select-content",
586
588
  ...O !== void 0 ? { "data-density": O } : {},
587
589
  ...nt,
588
- ...F ? { dir: F } : {},
589
- finalFocus: Tt(k),
590
- className: y(q.popup, r),
590
+ ...M ? { dir: M } : {},
591
+ finalFocus: qt(k),
592
+ className: v(q.popup, r),
591
593
  ...ot,
592
- ...M(t, e, (B) => /* @__PURE__ */ E(D, { children: [
593
- /* @__PURE__ */ o(Bt, {}),
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
- [g]: "select-viewport",
600
+ [f]: "select-viewport",
599
601
  className: q.viewport,
600
602
  children: B
601
603
  }
602
604
  ),
603
- /* @__PURE__ */ o(Wt, {})
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
- }), ee = s.forwardRef(
614
+ }), ie = s.forwardRef(
613
615
  function({ asChild: t = !1, className: r, children: e, ...n }, a) {
614
- const l = C();
615
- return s.useContext(I) ? null : /* @__PURE__ */ o(
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
- [g]: "select-label",
621
- className: y(l.label, r),
622
+ [f]: "select-label",
623
+ className: v(l.label, r),
622
624
  ...n,
623
- ...L(t, e)
625
+ ...T(t, e)
624
626
  }
625
627
  );
626
628
  }
627
- ), oe = s.forwardRef(
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 T, N, P;
638
- const m = C(), u = (T = s.useContext(R)) == null ? void 0 : T.labels, x = s.useContext(I), [f] = s.useState(() => ({})), w = t ? (P = (N = A(e)) == null ? void 0 : N.props) == null ? void 0 : P.children : e;
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(f, n, w);
641
- }), s.useLayoutEffect(() => () => u == null ? void 0 : u.delete(f), [u, f]), x ? null : /* @__PURE__ */ o(
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
- [g]: "select-item",
650
- className: y(m.item, r),
651
+ [f]: "select-item",
652
+ className: v(g.item, r),
651
653
  ...c,
652
- ...M(t, e, (k) => /* @__PURE__ */ E(D, { children: [
653
- /* @__PURE__ */ o("span", { className: m.itemIndicatorWrapper, children: /* @__PURE__ */ o(p.ItemIndicator, { children: /* @__PURE__ */ o(Lt, { className: m.itemIndicatorIcon }) }) }),
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
- ), re = s.forwardRef(function({ asChild: t = !1, className: r, children: e, ...n }, a) {
660
- const l = C();
661
- return s.useContext(I) ? null : /* @__PURE__ */ o(
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
- [g]: "select-separator",
668
- className: y(l.separator, r),
669
+ [f]: "select-separator",
670
+ className: v(l.separator, r),
669
671
  ...n,
670
- ...L(t, e)
672
+ ...T(t, e)
671
673
  }
672
674
  );
673
- }), Bt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, style: n, ...a }, l) {
674
- const c = C();
675
- return s.useContext(I) ? null : /* @__PURE__ */ o(
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
- [g]: "select-scroll-up-button",
681
- className: y(
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
- ...L(
690
+ ...T(
689
691
  t,
690
692
  e ?? /* @__PURE__ */ o(et, { className: c.scrollArrowIcon })
691
693
  )
692
694
  }
693
695
  );
694
- }), Wt = s.forwardRef(function({ asChild: t = !1, className: r, children: e, style: n, ...a }, l) {
695
- const c = C();
696
- return s.useContext(I) ? null : /* @__PURE__ */ o(
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
- [g]: "select-scroll-down-button",
702
- className: y(
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
- ...L(
711
+ ...T(
710
712
  t,
711
713
  e ?? /* @__PURE__ */ o(
712
714
  et,
713
715
  {
714
- className: y(
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
- Ht as Select,
726
- te as SelectContent,
727
- Vt as SelectGroup,
728
- oe as SelectItem,
729
- ee as SelectLabel,
730
- Wt as SelectScrollDownButton,
731
- Bt as SelectScrollUpButton,
732
- re as SelectSeparator,
733
- Kt as SelectTrigger,
734
- Qt as SelectTriggerClear,
735
- Jt as SelectValue
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