@gv-tech/ui-web 2.15.2 → 2.16.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.
Files changed (133) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.mjs +3 -3
  3. package/dist/alert-dialog.cjs +2 -2
  4. package/dist/alert-dialog.mjs +16 -16
  5. package/dist/alert.cjs +1 -1
  6. package/dist/alert.mjs +1 -1
  7. package/dist/avatar.cjs +1 -1
  8. package/dist/avatar.mjs +34 -34
  9. package/dist/badge.cjs +1 -1
  10. package/dist/badge.mjs +1 -1
  11. package/dist/breadcrumb.cjs +1 -1
  12. package/dist/breadcrumb.mjs +1 -1
  13. package/dist/button.cjs +1 -1
  14. package/dist/button.mjs +1 -1
  15. package/dist/calendar.cjs +1 -1
  16. package/dist/calendar.mjs +1 -1
  17. package/dist/card.cjs +1 -1
  18. package/dist/card.mjs +1 -1
  19. package/dist/carousel.cjs +1 -1
  20. package/dist/carousel.mjs +1 -1
  21. package/dist/chart.cjs +1 -1
  22. package/dist/chart.mjs +1 -1
  23. package/dist/checkbox.cjs +1 -1
  24. package/dist/checkbox.mjs +2 -2
  25. package/dist/command.cjs +1 -1
  26. package/dist/command.mjs +114 -114
  27. package/dist/context-menu.cjs +1 -1
  28. package/dist/context-menu.mjs +68 -68
  29. package/dist/dialog.cjs +1 -1
  30. package/dist/dialog.mjs +21 -21
  31. package/dist/drawer.cjs +1 -1
  32. package/dist/drawer.mjs +16 -16
  33. package/dist/dropdown-menu.cjs +1 -1
  34. package/dist/dropdown-menu.mjs +43 -43
  35. package/dist/form.cjs +1 -1
  36. package/dist/form.mjs +1 -1
  37. package/dist/hover-card.cjs +1 -1
  38. package/dist/hover-card.mjs +2 -2
  39. package/dist/index.cjs +1 -1
  40. package/dist/index.d.ts +28 -0
  41. package/dist/index.mjs +22 -20
  42. package/dist/input.cjs +1 -1
  43. package/dist/input.mjs +1 -1
  44. package/dist/label.cjs +1 -1
  45. package/dist/label.mjs +2 -2
  46. package/dist/menubar.cjs +1 -1
  47. package/dist/menubar.mjs +77 -77
  48. package/dist/navigation-menu.cjs +1 -1
  49. package/dist/navigation-menu.mjs +57 -57
  50. package/dist/pagination.cjs +1 -1
  51. package/dist/pagination.mjs +1 -1
  52. package/dist/popover.cjs +1 -1
  53. package/dist/popover.mjs +62 -62
  54. package/dist/progress.cjs +2 -2
  55. package/dist/progress.mjs +2 -2
  56. package/dist/radio-group.cjs +1 -1
  57. package/dist/radio-group.mjs +36 -36
  58. package/dist/resizable.cjs +1 -1
  59. package/dist/resizable.mjs +1 -1
  60. package/dist/scroll-area.cjs +1 -1
  61. package/dist/scroll-area.mjs +88 -88
  62. package/dist/search.cjs +1 -1
  63. package/dist/search.mjs +1 -1
  64. package/dist/select.cjs +1 -1
  65. package/dist/select.mjs +74 -74
  66. package/dist/separator.cjs +1 -1
  67. package/dist/separator.mjs +9 -9
  68. package/dist/sheet.cjs +1 -1
  69. package/dist/sheet.mjs +12 -12
  70. package/dist/skeleton.cjs +1 -1
  71. package/dist/skeleton.mjs +1 -1
  72. package/dist/slider.cjs +1 -1
  73. package/dist/slider.mjs +2 -2
  74. package/dist/switch.cjs +1 -1
  75. package/dist/switch.mjs +12 -12
  76. package/dist/table-of-contents.cjs +1 -0
  77. package/dist/table-of-contents.d.ts +35 -0
  78. package/dist/table-of-contents.mjs +160 -0
  79. package/dist/table.cjs +1 -1
  80. package/dist/table.mjs +1 -1
  81. package/dist/tabs.cjs +1 -1
  82. package/dist/tabs.mjs +41 -41
  83. package/dist/text.cjs +1 -1
  84. package/dist/text.mjs +1 -1
  85. package/dist/textarea.cjs +1 -1
  86. package/dist/textarea.mjs +1 -1
  87. package/dist/{theme-toggle-B4VZTDpe.js → theme-toggle-DXQGNfCe.js} +1 -1
  88. package/dist/{theme-toggle-WtPW9UZi.mjs → theme-toggle-tHXIbr8W.mjs} +1 -1
  89. package/dist/theme-toggle.cjs +1 -1
  90. package/dist/theme-toggle.mjs +2 -2
  91. package/dist/toast.cjs +1 -1
  92. package/dist/toast.mjs +35 -35
  93. package/dist/toggle-group.cjs +1 -1
  94. package/dist/toggle-group.mjs +15 -15
  95. package/dist/toggle.cjs +1 -1
  96. package/dist/toggle.mjs +4 -4
  97. package/dist/tooltip.cjs +1 -1
  98. package/dist/tooltip.mjs +3 -3
  99. package/dist/utils-DY6fhrgS.mjs +12 -0
  100. package/dist/utils-cdbZV8DZ.js +1 -0
  101. package/package.json +1 -1
  102. package/src/accordion.tsx +2 -2
  103. package/src/alert-dialog.tsx +6 -6
  104. package/src/avatar.tsx +3 -3
  105. package/src/checkbox.tsx +1 -1
  106. package/src/command.tsx +7 -7
  107. package/src/context-menu.tsx +8 -8
  108. package/src/dialog.tsx +4 -4
  109. package/src/drawer.tsx +3 -3
  110. package/src/dropdown-menu.tsx +8 -8
  111. package/src/hover-card.tsx +1 -1
  112. package/src/index.ts +4 -1
  113. package/src/label.tsx +1 -1
  114. package/src/lib/utils.ts +10 -0
  115. package/src/menubar.tsx +10 -10
  116. package/src/navigation-menu.tsx +6 -6
  117. package/src/popover.tsx +1 -1
  118. package/src/progress.tsx +1 -1
  119. package/src/radio-group.tsx +2 -2
  120. package/src/scroll-area.tsx +2 -2
  121. package/src/select.tsx +7 -7
  122. package/src/separator.tsx +1 -1
  123. package/src/sheet.tsx +4 -4
  124. package/src/slider.tsx +1 -1
  125. package/src/switch.tsx +1 -1
  126. package/src/table-of-contents.tsx +285 -0
  127. package/src/tabs.tsx +3 -3
  128. package/src/toast.tsx +6 -6
  129. package/src/toggle-group.tsx +2 -2
  130. package/src/toggle.tsx +1 -1
  131. package/src/tooltip.tsx +2 -2
  132. package/dist/utils-B6yFEsav.mjs +0 -8
  133. package/dist/utils-IjLH3w2e.js +0 -1
package/dist/select.mjs CHANGED
@@ -8,8 +8,8 @@ import { c as ht } from "./index-DFdF7K7v.mjs";
8
8
  import { u as L } from "./index-DLcqcWxM.mjs";
9
9
  import { c as gt } from "./index-IZ2gq03c.mjs";
10
10
  import { u as vt } from "./index-CD6_IrA-.mjs";
11
- import { D as xt } from "./index-Dfzl8TxY.mjs";
12
- import { h as St, u as wt, R as yt, F as Ct } from "./index-CRyCZJLa.mjs";
11
+ import { D as St } from "./index-Dfzl8TxY.mjs";
12
+ import { h as xt, u as wt, R as yt, F as Ct } from "./index-CRyCZJLa.mjs";
13
13
  import { u as Ie } from "./index-DnFcfnA9.mjs";
14
14
  import { A as It, c as Re, C as Tt, R as Nt, a as bt } from "./index-CwfE56Ep.mjs";
15
15
  import { P as Pt } from "./index-C7HEunrh.mjs";
@@ -19,7 +19,7 @@ import { u as G } from "./index-CCKe-Mpx.mjs";
19
19
  import { u as Et } from "./index-BZPx6jYI.mjs";
20
20
  import { V as _t } from "./index-DKN_vhyX.mjs";
21
21
  import { ChevronDown as Ee, ChevronUp as jt, Check as Mt } from "lucide-react";
22
- import { c as z } from "./utils-B6yFEsav.mjs";
22
+ import { c as z } from "./utils-DY6fhrgS.mjs";
23
23
  var At = [" ", "Enter", "ArrowUp", "ArrowDown"], Ot = [" ", "Enter"], Q = "Select", [ie, de, Dt] = ht(Q), [oe] = gt(Q, [
24
24
  Dt,
25
25
  Re
@@ -39,7 +39,7 @@ var At = [" ", "Enter", "ArrowUp", "ArrowDown"], Ot = [" ", "Enter"], Q = "Selec
39
39
  disabled: P,
40
40
  required: T,
41
41
  form: C
42
- } = o, d = pe(n), [h, x] = t.useState(null), [m, g] = t.useState(null), [U, M] = t.useState(!1), ne = vt(f), [R, O] = be({
42
+ } = o, d = pe(n), [h, S] = t.useState(null), [m, g] = t.useState(null), [F, M] = t.useState(!1), ne = vt(f), [R, O] = be({
43
43
  prop: l,
44
44
  defaultProp: a ?? !1,
45
45
  onChange: p,
@@ -56,10 +56,10 @@ var At = [" ", "Enter", "ArrowUp", "ArrowDown"], Ot = [" ", "Enter"], Q = "Selec
56
56
  required: T,
57
57
  scope: n,
58
58
  trigger: h,
59
- onTriggerChange: x,
59
+ onTriggerChange: S,
60
60
  valueNode: m,
61
61
  onValueNodeChange: g,
62
- valueNodeHasChildren: U,
62
+ valueNodeHasChildren: F,
63
63
  onValueNodeHasChildrenChange: M,
64
64
  contentId: Ie(),
65
65
  value: W,
@@ -79,8 +79,8 @@ var At = [" ", "Enter", "ArrowUp", "ArrowDown"], Ot = [" ", "Enter"], Q = "Selec
79
79
  }, []),
80
80
  onNativeOptionRemove: t.useCallback((E) => {
81
81
  V((D) => {
82
- const F = new Set(D);
83
- return F.delete(E), F;
82
+ const U = new Set(D);
83
+ return U.delete(E), U;
84
84
  });
85
85
  }, []),
86
86
  children: e
@@ -113,7 +113,7 @@ _e.displayName = Q;
113
113
  var je = "SelectTrigger", Me = t.forwardRef(
114
114
  (o, n) => {
115
115
  const { __scopeSelect: e, disabled: l = !1, ...a } = o, p = pe(e), s = Y(je, e), c = s.disabled || l, i = L(n, s.onTriggerChange), f = de(e), v = t.useRef("touch"), [w, P, T] = nt((d) => {
116
- const h = f().filter((g) => !g.disabled), x = h.find((g) => g.value === s.value), m = rt(h, d, x);
116
+ const h = f().filter((g) => !g.disabled), S = h.find((g) => g.value === s.value), m = rt(h, d, S);
117
117
  m !== void 0 && s.onValueChange(m.value);
118
118
  }), C = (d) => {
119
119
  c || (s.onOpenChange(!0), T()), d && (s.triggerPointerDownPosRef.current = {
@@ -196,7 +196,7 @@ var ee = "SelectContent", ke = t.forwardRef(
196
196
  }
197
197
  );
198
198
  ke.displayName = ee;
199
- var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.RemoveScroll"), Ve = t.forwardRef(
199
+ var A = 10, [Be, q] = oe(ee), Ut = "SelectContentImpl", Ft = mt("SelectContent.RemoveScroll"), Ve = t.forwardRef(
200
200
  (o, n) => {
201
201
  const {
202
202
  __scopeSelect: e,
@@ -217,18 +217,18 @@ var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.R
217
217
  hideWhenDetached: d,
218
218
  avoidCollisions: h,
219
219
  //
220
- ...x
221
- } = o, m = Y(ee, e), [g, U] = t.useState(null), [M, ne] = t.useState(null), R = L(n, (u) => U(u)), [O, W] = t.useState(null), [X, k] = t.useState(
220
+ ...S
221
+ } = o, m = Y(ee, e), [g, F] = t.useState(null), [M, ne] = t.useState(null), R = L(n, (u) => F(u)), [O, W] = t.useState(null), [X, k] = t.useState(
222
222
  null
223
223
  ), B = de(e), [K, V] = t.useState(!1), H = t.useRef(!1);
224
224
  t.useEffect(() => {
225
- if (g) return St(g);
225
+ if (g) return xt(g);
226
226
  }, [g]), wt();
227
227
  const E = t.useCallback(
228
228
  (u) => {
229
- const [I, ..._] = B().map((N) => N.ref.current), [S] = _.slice(-1), y = document.activeElement;
229
+ const [I, ..._] = B().map((N) => N.ref.current), [x] = _.slice(-1), y = document.activeElement;
230
230
  for (const N of u)
231
- if (N === y || (N?.scrollIntoView({ block: "nearest" }), N === I && M && (M.scrollTop = 0), N === S && M && (M.scrollTop = M.scrollHeight), N?.focus(), document.activeElement !== y)) return;
231
+ if (N === y || (N?.scrollIntoView({ block: "nearest" }), N === I && M && (M.scrollTop = 0), N === x && M && (M.scrollTop = M.scrollHeight), N?.focus(), document.activeElement !== y)) return;
232
232
  },
233
233
  [B, M]
234
234
  ), D = t.useCallback(
@@ -238,44 +238,44 @@ var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.R
238
238
  t.useEffect(() => {
239
239
  K && D();
240
240
  }, [K, D]);
241
- const { onOpenChange: F, triggerPointerDownPosRef: $ } = m;
241
+ const { onOpenChange: U, triggerPointerDownPosRef: $ } = m;
242
242
  t.useEffect(() => {
243
243
  if (g) {
244
244
  let u = { x: 0, y: 0 };
245
- const I = (S) => {
245
+ const I = (x) => {
246
246
  u = {
247
- x: Math.abs(Math.round(S.pageX) - ($.current?.x ?? 0)),
248
- y: Math.abs(Math.round(S.pageY) - ($.current?.y ?? 0))
247
+ x: Math.abs(Math.round(x.pageX) - ($.current?.x ?? 0)),
248
+ y: Math.abs(Math.round(x.pageY) - ($.current?.y ?? 0))
249
249
  };
250
- }, _ = (S) => {
251
- u.x <= 10 && u.y <= 10 ? S.preventDefault() : g.contains(S.target) || F(!1), document.removeEventListener("pointermove", I), $.current = null;
250
+ }, _ = (x) => {
251
+ u.x <= 10 && u.y <= 10 ? x.preventDefault() : g.contains(x.target) || U(!1), document.removeEventListener("pointermove", I), $.current = null;
252
252
  };
253
253
  return $.current !== null && (document.addEventListener("pointermove", I), document.addEventListener("pointerup", _, { capture: !0, once: !0 })), () => {
254
254
  document.removeEventListener("pointermove", I), document.removeEventListener("pointerup", _, { capture: !0 });
255
255
  };
256
256
  }
257
- }, [g, F, $]), t.useEffect(() => {
258
- const u = () => F(!1);
257
+ }, [g, U, $]), t.useEffect(() => {
258
+ const u = () => U(!1);
259
259
  return window.addEventListener("blur", u), window.addEventListener("resize", u), () => {
260
260
  window.removeEventListener("blur", u), window.removeEventListener("resize", u);
261
261
  };
262
- }, [F]);
262
+ }, [U]);
263
263
  const [ue, ae] = nt((u) => {
264
- const I = B().filter((y) => !y.disabled), _ = I.find((y) => y.ref.current === document.activeElement), S = rt(I, u, _);
265
- S && setTimeout(() => S.ref.current.focus());
264
+ const I = B().filter((y) => !y.disabled), _ = I.find((y) => y.ref.current === document.activeElement), x = rt(I, u, _);
265
+ x && setTimeout(() => x.ref.current.focus());
266
266
  }), fe = t.useCallback(
267
267
  (u, I, _) => {
268
- const S = !H.current && !_;
269
- (m.value !== void 0 && m.value === I || S) && (W(u), S && (H.current = !0));
268
+ const x = !H.current && !_;
269
+ (m.value !== void 0 && m.value === I || x) && (W(u), x && (H.current = !0));
270
270
  },
271
271
  [m.value]
272
272
  ), me = t.useCallback(() => g?.focus(), [g]), te = t.useCallback(
273
273
  (u, I, _) => {
274
- const S = !H.current && !_;
275
- (m.value !== void 0 && m.value === I || S) && k(u);
274
+ const x = !H.current && !_;
275
+ (m.value !== void 0 && m.value === I || x) && k(u);
276
276
  },
277
277
  [m.value]
278
- ), le = l === "popper" ? xe : He, re = le === xe ? {
278
+ ), le = l === "popper" ? Se : He, re = le === Se ? {
279
279
  side: c,
280
280
  sideOffset: i,
281
281
  align: f,
@@ -303,7 +303,7 @@ var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.R
303
303
  position: l,
304
304
  isPositioned: K,
305
305
  searchRef: ue,
306
- children: /* @__PURE__ */ r.jsx(yt, { as: Ut, allowPinchZoom: !0, children: /* @__PURE__ */ r.jsx(
306
+ children: /* @__PURE__ */ r.jsx(yt, { as: Ft, allowPinchZoom: !0, children: /* @__PURE__ */ r.jsx(
307
307
  Ct,
308
308
  {
309
309
  asChild: !0,
@@ -315,7 +315,7 @@ var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.R
315
315
  m.trigger?.focus({ preventScroll: !0 }), u.preventDefault();
316
316
  }),
317
317
  children: /* @__PURE__ */ r.jsx(
318
- xt,
318
+ St,
319
319
  {
320
320
  asChild: !0,
321
321
  disableOutsidePointerEvents: !0,
@@ -331,7 +331,7 @@ var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.R
331
331
  "data-state": m.open ? "open" : "closed",
332
332
  dir: m.dir,
333
333
  onContextMenu: (u) => u.preventDefault(),
334
- ...x,
334
+ ...S,
335
335
  ...re,
336
336
  onPlaced: () => V(!0),
337
337
  ref: R,
@@ -341,17 +341,17 @@ var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.R
341
341
  flexDirection: "column",
342
342
  // reset the outline by default as the content MAY get focused
343
343
  outline: "none",
344
- ...x.style
344
+ ...S.style
345
345
  },
346
- onKeyDown: b(x.onKeyDown, (u) => {
346
+ onKeyDown: b(S.onKeyDown, (u) => {
347
347
  const I = u.ctrlKey || u.altKey || u.metaKey;
348
348
  if (u.key === "Tab" && u.preventDefault(), !I && u.key.length === 1 && ae(u.key), ["ArrowUp", "ArrowDown", "Home", "End"].includes(u.key)) {
349
- let S = B().filter((y) => !y.disabled).map((y) => y.ref.current);
350
- if (["ArrowUp", "End"].includes(u.key) && (S = S.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(u.key)) {
351
- const y = u.target, N = S.indexOf(y);
352
- S = S.slice(N + 1);
349
+ let x = B().filter((y) => !y.disabled).map((y) => y.ref.current);
350
+ if (["ArrowUp", "End"].includes(u.key) && (x = x.slice().reverse()), ["ArrowUp", "ArrowDown"].includes(u.key)) {
351
+ const y = u.target, N = x.indexOf(y);
352
+ x = x.slice(N + 1);
353
353
  }
354
- setTimeout(() => E(S)), u.preventDefault();
354
+ setTimeout(() => E(x)), u.preventDefault();
355
355
  }
356
356
  })
357
357
  }
@@ -364,11 +364,11 @@ var A = 10, [Be, q] = oe(ee), Ft = "SelectContentImpl", Ut = mt("SelectContent.R
364
364
  );
365
365
  }
366
366
  );
367
- Ve.displayName = Ft;
367
+ Ve.displayName = Ut;
368
368
  var Wt = "SelectItemAlignedPosition", He = t.forwardRef((o, n) => {
369
- const { __scopeSelect: e, onPlaced: l, ...a } = o, p = Y(ee, e), s = q(ee, e), [c, i] = t.useState(null), [f, v] = t.useState(null), w = L(n, (R) => v(R)), P = de(e), T = t.useRef(!1), C = t.useRef(!0), { viewport: d, selectedItem: h, selectedItemText: x, focusSelectedItem: m } = s, g = t.useCallback(() => {
370
- if (p.trigger && p.valueNode && c && f && d && h && x) {
371
- const R = p.trigger.getBoundingClientRect(), O = f.getBoundingClientRect(), W = p.valueNode.getBoundingClientRect(), X = x.getBoundingClientRect();
369
+ const { __scopeSelect: e, onPlaced: l, ...a } = o, p = Y(ee, e), s = q(ee, e), [c, i] = t.useState(null), [f, v] = t.useState(null), w = L(n, (R) => v(R)), P = de(e), T = t.useRef(!1), C = t.useRef(!0), { viewport: d, selectedItem: h, selectedItemText: S, focusSelectedItem: m } = s, g = t.useCallback(() => {
370
+ if (p.trigger && p.valueNode && c && f && d && h && S) {
371
+ const R = p.trigger.getBoundingClientRect(), O = f.getBoundingClientRect(), W = p.valueNode.getBoundingClientRect(), X = S.getBoundingClientRect();
372
372
  if (p.dir !== "rtl") {
373
373
  const y = X.left - O.left, N = W.left - y, Z = R.left - N, J = R.width + Z, he = Math.max(J, O.width), ge = window.innerWidth - A, ve = Ne(N, [
374
374
  A,
@@ -387,7 +387,7 @@ var Wt = "SelectItemAlignedPosition", He = t.forwardRef((o, n) => {
387
387
  ]);
388
388
  c.style.minWidth = J + "px", c.style.right = ve + "px";
389
389
  }
390
- const k = P(), B = window.innerHeight - A * 2, K = d.scrollHeight, V = window.getComputedStyle(f), H = parseInt(V.borderTopWidth, 10), E = parseInt(V.paddingTop, 10), D = parseInt(V.borderBottomWidth, 10), F = parseInt(V.paddingBottom, 10), $ = H + E + K + F + D, ue = Math.min(h.offsetHeight * 5, $), ae = window.getComputedStyle(d), fe = parseInt(ae.paddingTop, 10), me = parseInt(ae.paddingBottom, 10), te = R.top + R.height / 2 - A, le = B - te, re = h.offsetHeight / 2, u = h.offsetTop + re, I = H + E + u, _ = $ - I;
390
+ const k = P(), B = window.innerHeight - A * 2, K = d.scrollHeight, V = window.getComputedStyle(f), H = parseInt(V.borderTopWidth, 10), E = parseInt(V.paddingTop, 10), D = parseInt(V.borderBottomWidth, 10), U = parseInt(V.paddingBottom, 10), $ = H + E + K + U + D, ue = Math.min(h.offsetHeight * 5, $), ae = window.getComputedStyle(d), fe = parseInt(ae.paddingTop, 10), me = parseInt(ae.paddingBottom, 10), te = R.top + R.height / 2 - A, le = B - te, re = h.offsetHeight / 2, u = h.offsetTop + re, I = H + E + u, _ = $ - I;
391
391
  if (I <= te) {
392
392
  const y = k.length > 0 && h === k[k.length - 1].ref.current;
393
393
  c.style.bottom = "0px";
@@ -417,12 +417,12 @@ var Wt = "SelectItemAlignedPosition", He = t.forwardRef((o, n) => {
417
417
  f,
418
418
  d,
419
419
  h,
420
- x,
420
+ S,
421
421
  p.dir,
422
422
  l
423
423
  ]);
424
424
  G(() => g(), [g]);
425
- const [U, M] = t.useState();
425
+ const [F, M] = t.useState();
426
426
  G(() => {
427
427
  f && M(window.getComputedStyle(f).zIndex);
428
428
  }, [f]);
@@ -447,7 +447,7 @@ var Wt = "SelectItemAlignedPosition", He = t.forwardRef((o, n) => {
447
447
  display: "flex",
448
448
  flexDirection: "column",
449
449
  position: "fixed",
450
- zIndex: U
450
+ zIndex: F
451
451
  },
452
452
  children: /* @__PURE__ */ r.jsx(
453
453
  j.div,
@@ -470,7 +470,7 @@ var Wt = "SelectItemAlignedPosition", He = t.forwardRef((o, n) => {
470
470
  );
471
471
  });
472
472
  He.displayName = Wt;
473
- var Kt = "SelectPopperPosition", xe = t.forwardRef((o, n) => {
473
+ var Kt = "SelectPopperPosition", Se = t.forwardRef((o, n) => {
474
474
  const {
475
475
  __scopeSelect: e,
476
476
  align: l = "start",
@@ -498,10 +498,10 @@ var Kt = "SelectPopperPosition", xe = t.forwardRef((o, n) => {
498
498
  }
499
499
  );
500
500
  });
501
- xe.displayName = Kt;
502
- var [$t, Te] = oe(ee, {}), Se = "SelectViewport", Fe = t.forwardRef(
501
+ Se.displayName = Kt;
502
+ var [$t, Te] = oe(ee, {}), xe = "SelectViewport", Ue = t.forwardRef(
503
503
  (o, n) => {
504
- const { __scopeSelect: e, nonce: l, ...a } = o, p = q(Se, e), s = Te(Se, e), c = L(n, p.onViewportChange), i = t.useRef(0);
504
+ const { __scopeSelect: e, nonce: l, ...a } = o, p = q(xe, e), s = Te(xe, e), c = L(n, p.onViewportChange), i = t.useRef(0);
505
505
  return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
506
506
  /* @__PURE__ */ r.jsx(
507
507
  "style",
@@ -537,10 +537,10 @@ var [$t, Te] = oe(ee, {}), Se = "SelectViewport", Fe = t.forwardRef(
537
537
  if (P?.current && w) {
538
538
  const T = Math.abs(i.current - v.scrollTop);
539
539
  if (T > 0) {
540
- const C = window.innerHeight - A * 2, d = parseFloat(w.style.minHeight), h = parseFloat(w.style.height), x = Math.max(d, h);
541
- if (x < C) {
542
- const m = x + T, g = Math.min(C, m), U = m - g;
543
- w.style.height = g + "px", w.style.bottom === "0px" && (v.scrollTop = U > 0 ? U : 0, w.style.justifyContent = "flex-end");
540
+ const C = window.innerHeight - A * 2, d = parseFloat(w.style.minHeight), h = parseFloat(w.style.height), S = Math.max(d, h);
541
+ if (S < C) {
542
+ const m = S + T, g = Math.min(C, m), F = m - g;
543
+ w.style.height = g + "px", w.style.bottom === "0px" && (v.scrollTop = F > 0 ? F : 0, w.style.justifyContent = "flex-end");
544
544
  }
545
545
  }
546
546
  }
@@ -551,14 +551,14 @@ var [$t, Te] = oe(ee, {}), Se = "SelectViewport", Fe = t.forwardRef(
551
551
  ] });
552
552
  }
553
553
  );
554
- Fe.displayName = Se;
555
- var Ue = "SelectGroup", [Gt, zt] = oe(Ue), We = t.forwardRef(
554
+ Ue.displayName = xe;
555
+ var Fe = "SelectGroup", [Gt, zt] = oe(Fe), We = t.forwardRef(
556
556
  (o, n) => {
557
557
  const { __scopeSelect: e, ...l } = o, a = Ie();
558
558
  return /* @__PURE__ */ r.jsx(Gt, { scope: e, id: a, children: /* @__PURE__ */ r.jsx(j.div, { role: "group", "aria-labelledby": a, ...l, ref: n }) });
559
559
  }
560
560
  );
561
- We.displayName = Ue;
561
+ We.displayName = Fe;
562
562
  var Ke = "SelectLabel", $e = t.forwardRef(
563
563
  (o, n) => {
564
564
  const { __scopeSelect: e, ...l } = o, a = zt(Ke, e);
@@ -577,7 +577,7 @@ var ce = "SelectItem", [Yt, Ge] = oe(ce), ze = t.forwardRef(
577
577
  } = o, c = Y(ce, e), i = q(ce, e), f = c.value === l, [v, w] = t.useState(p ?? ""), [P, T] = t.useState(!1), C = L(
578
578
  n,
579
579
  (m) => i.itemRefCallback?.(m, l, a)
580
- ), d = Ie(), h = t.useRef("touch"), x = () => {
580
+ ), d = Ie(), h = t.useRef("touch"), S = () => {
581
581
  a || (c.onValueChange(l), c.onOpenChange(!1));
582
582
  };
583
583
  if (l === "")
@@ -618,10 +618,10 @@ var ce = "SelectItem", [Yt, Ge] = oe(ce), ze = t.forwardRef(
618
618
  onFocus: b(s.onFocus, () => T(!0)),
619
619
  onBlur: b(s.onBlur, () => T(!1)),
620
620
  onClick: b(s.onClick, () => {
621
- h.current !== "mouse" && x();
621
+ h.current !== "mouse" && S();
622
622
  }),
623
623
  onPointerUp: b(s.onPointerUp, () => {
624
- h.current === "mouse" && x();
624
+ h.current === "mouse" && S();
625
625
  }),
626
626
  onPointerDown: b(s.onPointerDown, (m) => {
627
627
  h.current = m.pointerType;
@@ -633,7 +633,7 @@ var ce = "SelectItem", [Yt, Ge] = oe(ce), ze = t.forwardRef(
633
633
  m.currentTarget === document.activeElement && i.onItemLeave?.();
634
634
  }),
635
635
  onKeyDown: b(s.onKeyDown, (m) => {
636
- i.searchRef?.current !== "" && m.key === " " || (Ot.includes(m.key) && x(), m.key === " " && m.preventDefault());
636
+ i.searchRef?.current !== "" && m.key === " " || (Ot.includes(m.key) && S(), m.key === " " && m.preventDefault());
637
637
  })
638
638
  }
639
639
  )
@@ -648,9 +648,9 @@ var se = "SelectItemText", Ye = t.forwardRef(
648
648
  (o, n) => {
649
649
  const { __scopeSelect: e, className: l, style: a, ...p } = o, s = Y(se, e), c = q(se, e), i = Ge(se, e), f = Bt(se, e), [v, w] = t.useState(null), P = L(
650
650
  n,
651
- (x) => w(x),
651
+ (S) => w(S),
652
652
  i.onItemTextChange,
653
- (x) => c.itemTextRefCallback?.(x, i.value, i.disabled)
653
+ (S) => c.itemTextRefCallback?.(S, i.value, i.disabled)
654
654
  ), T = v?.textContent, C = t.useMemo(
655
655
  () => /* @__PURE__ */ r.jsx("option", { value: i.value, disabled: i.disabled, children: T }, i.value),
656
656
  [i.disabled, i.value, T]
@@ -810,7 +810,7 @@ function rt(o, n, e) {
810
810
  function Jt(o, n) {
811
811
  return o.map((e, l) => o[(n + l) % o.length]);
812
812
  }
813
- var Qt = _e, st = Me, eo = Oe, to = De, oo = Le, at = ke, no = Fe, ro = We, lt = $e, ct = ze, so = Ye, ao = Xe, it = Ze, dt = Je, pt = et;
813
+ var Qt = _e, st = Me, eo = Oe, to = De, oo = Le, at = ke, no = Ue, ro = We, lt = $e, ct = ze, so = Ye, ao = Xe, it = Ze, dt = Je, pt = et;
814
814
  const Mo = Qt, Ao = ro, Oo = eo, lo = t.forwardRef(({ className: o, children: n, ...e }, l) => /* @__PURE__ */ r.jsxs(
815
815
  st,
816
816
  {
@@ -826,7 +826,7 @@ const Mo = Qt, Ao = ro, Oo = eo, lo = t.forwardRef(({ className: o, children: n,
826
826
  ]
827
827
  }
828
828
  ));
829
- lo.displayName = st.displayName;
829
+ lo.displayName = st?.displayName || "SelectTrigger";
830
830
  const ut = t.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r.jsx(
831
831
  it,
832
832
  {
@@ -836,7 +836,7 @@ const ut = t.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r.jsx(
836
836
  children: /* @__PURE__ */ r.jsx(jt, { className: "h-4 w-4" })
837
837
  }
838
838
  ));
839
- ut.displayName = it.displayName;
839
+ ut.displayName = it?.displayName || "SelectScrollUpButton";
840
840
  const ft = t.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r.jsx(
841
841
  dt,
842
842
  {
@@ -846,7 +846,7 @@ const ft = t.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r.jsx(
846
846
  children: /* @__PURE__ */ r.jsx(Ee, { className: "h-4 w-4" })
847
847
  }
848
848
  ));
849
- ft.displayName = dt.displayName;
849
+ ft.displayName = dt?.displayName || "SelectScrollDownButton";
850
850
  const co = t.forwardRef(({ className: o, children: n, position: e = "popper", ...l }, a) => /* @__PURE__ */ r.jsx(oo, { children: /* @__PURE__ */ r.jsxs(
851
851
  at,
852
852
  {
@@ -874,9 +874,9 @@ const co = t.forwardRef(({ className: o, children: n, position: e = "popper", ..
874
874
  ]
875
875
  }
876
876
  ) }));
877
- co.displayName = at.displayName;
877
+ co.displayName = at?.displayName || "SelectContent";
878
878
  const io = t.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r.jsx(lt, { ref: e, className: z("px-2 py-1.5 text-sm font-semibold", o), ...n }));
879
- io.displayName = lt.displayName;
879
+ io.displayName = lt?.displayName || "SelectLabel";
880
880
  const po = t.forwardRef(({ className: o, children: n, ...e }, l) => /* @__PURE__ */ r.jsxs(
881
881
  ct,
882
882
  {
@@ -892,9 +892,9 @@ const po = t.forwardRef(({ className: o, children: n, ...e }, l) => /* @__PURE__
892
892
  ]
893
893
  }
894
894
  ));
895
- po.displayName = ct.displayName;
895
+ po.displayName = ct?.displayName || "SelectItem";
896
896
  const uo = t.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r.jsx(pt, { ref: e, className: z("bg-muted -mx-1 my-1 h-px", o), ...n }));
897
- uo.displayName = pt.displayName;
897
+ uo.displayName = pt?.displayName || "SelectSeparator";
898
898
  export {
899
899
  Mo as Select,
900
900
  co as SelectContent,
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-nZSsnGb7.js"),f=require("react"),m=require("./index-B39Lzq0v.js"),v=require("./utils-IjLH3w2e.js");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const c=O(f);var b="Separator",i="horizontal",j=["horizontal","vertical"],l=c.forwardRef((e,t)=>{const{decorative:r,orientation:o=i,...a}=e,n=x(o)?o:i,d=r?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return s.jsxRuntimeExports.jsx(m.Primitive.div,{"data-orientation":n,...d,...a,ref:t})});l.displayName=b;function x(e){return j.includes(e)}var u=l;const p=c.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...o},a)=>s.jsxRuntimeExports.jsx(u,{ref:a,decorative:r,orientation:t,className:v.cn("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));p.displayName=u.displayName;exports.Separator=p;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./jsx-runtime-nZSsnGb7.js"),f=require("react"),m=require("./index-B39Lzq0v.js"),v=require("./utils-cdbZV8DZ.js");function O(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,o.get?o:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const c=O(f);var b="Separator",i="horizontal",j=["horizontal","vertical"],l=c.forwardRef((e,t)=>{const{decorative:r,orientation:o=i,...a}=e,n=x(o)?o:i,d=r?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return s.jsxRuntimeExports.jsx(m.Primitive.div,{"data-orientation":n,...d,...a,ref:t})});l.displayName=b;function x(e){return j.includes(e)}var u=l;const p=c.forwardRef(({className:e,orientation:t="horizontal",decorative:r=!0,...o},a)=>s.jsxRuntimeExports.jsx(u,{ref:a,decorative:r,orientation:t,className:v.cn("bg-border shrink-0",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...o}));p.displayName=u?.displayName||"Separator";exports.Separator=p;
@@ -2,16 +2,16 @@
2
2
  import { j as s } from "./jsx-runtime-tc70JA_2.mjs";
3
3
  import * as l from "react";
4
4
  import { P as d } from "./index-DaILh3TV.mjs";
5
- import { c as f } from "./utils-B6yFEsav.mjs";
6
- var v = "Separator", n = "horizontal", u = ["horizontal", "vertical"], p = l.forwardRef((r, o) => {
7
- const { decorative: t, orientation: a = n, ...i } = r, e = N(a) ? a : n, m = t ? { role: "none" } : { "aria-orientation": e === "vertical" ? e : void 0, role: "separator" };
5
+ import { c as f } from "./utils-DY6fhrgS.mjs";
6
+ var v = "Separator", n = "horizontal", u = ["horizontal", "vertical"], p = l.forwardRef((r, a) => {
7
+ const { decorative: t, orientation: o = n, ...i } = r, e = N(o) ? o : n, m = t ? { role: "none" } : { "aria-orientation": e === "vertical" ? e : void 0, role: "separator" };
8
8
  return /* @__PURE__ */ s.jsx(
9
9
  d.div,
10
10
  {
11
11
  "data-orientation": e,
12
12
  ...m,
13
13
  ...i,
14
- ref: o
14
+ ref: a
15
15
  }
16
16
  );
17
17
  });
@@ -20,17 +20,17 @@ function N(r) {
20
20
  return u.includes(r);
21
21
  }
22
22
  var c = p;
23
- const h = l.forwardRef(({ className: r, orientation: o = "horizontal", decorative: t = !0, ...a }, i) => /* @__PURE__ */ s.jsx(
23
+ const h = l.forwardRef(({ className: r, orientation: a = "horizontal", decorative: t = !0, ...o }, i) => /* @__PURE__ */ s.jsx(
24
24
  c,
25
25
  {
26
26
  ref: i,
27
27
  decorative: t,
28
- orientation: o,
29
- className: f("bg-border shrink-0", o === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", r),
30
- ...a
28
+ orientation: a,
29
+ className: f("bg-border shrink-0", a === "horizontal" ? "h-[1px] w-full" : "h-full w-[1px]", r),
30
+ ...o
31
31
  }
32
32
  ));
33
- h.displayName = c.displayName;
33
+ h.displayName = c?.displayName || "Separator";
34
34
  export {
35
35
  h as Separator
36
36
  };
package/dist/sheet.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-nZSsnGb7.js"),s=require("./index-ByiPJW53.js"),h=require("class-variance-authority"),g=require("lucide-react"),j=require("react"),n=require("./utils-IjLH3w2e.js");function y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=y(j),b=s.Root,S=s.Trigger,N=s.Close,d=s.Portal,l=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Overlay,{className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:a}));l.displayName=s.Overlay.displayName;const R=h.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),c=i.forwardRef(({side:e="right",className:t,children:a,...r},f)=>o.jsxRuntimeExports.jsxs(d,{children:[o.jsxRuntimeExports.jsx(l,{}),o.jsxRuntimeExports.jsxs(s.Content,{ref:f,className:n.cn(R({side:e}),t),...r,children:[o.jsxRuntimeExports.jsxs(s.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[o.jsxRuntimeExports.jsx(g.X,{className:"h-4 w-4"}),o.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));c.displayName=s.Content.displayName;const m=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});m.displayName="SheetHeader";const u=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});u.displayName="SheetFooter";const p=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Title,{ref:a,className:n.cn("text-foreground text-lg font-semibold",e),...t}));p.displayName=s.Title.displayName;const x=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Description,{ref:a,className:n.cn("text-muted-foreground text-sm",e),...t}));x.displayName=s.Description.displayName;exports.Sheet=b;exports.SheetClose=N;exports.SheetContent=c;exports.SheetDescription=x;exports.SheetFooter=u;exports.SheetHeader=m;exports.SheetOverlay=l;exports.SheetPortal=d;exports.SheetTitle=p;exports.SheetTrigger=S;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./jsx-runtime-nZSsnGb7.js"),s=require("./index-ByiPJW53.js"),h=require("class-variance-authority"),g=require("lucide-react"),y=require("react"),n=require("./utils-cdbZV8DZ.js");function S(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const i=S(y),j=s.Root,b=s.Trigger,N=s.Close,d=s.Portal,l=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Overlay,{className:n.cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/80",e),...t,ref:a}));l.displayName=s.Overlay?.displayName||"SheetOverlay";const R=h.cva("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),c=i.forwardRef(({side:e="right",className:t,children:a,...r},f)=>o.jsxRuntimeExports.jsxs(d,{children:[o.jsxRuntimeExports.jsx(l,{}),o.jsxRuntimeExports.jsxs(s.Content,{ref:f,className:n.cn(R({side:e}),t),...r,children:[o.jsxRuntimeExports.jsxs(s.Close,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[o.jsxRuntimeExports.jsx(g.X,{className:"h-4 w-4"}),o.jsxRuntimeExports.jsx("span",{className:"sr-only",children:"Close"})]}),a]})]}));c.displayName=s.Content?.displayName||"SheetContent";const m=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col space-y-2 text-center sm:text-left",e),...t});m.displayName="SheetHeader";const u=({className:e,...t})=>o.jsxRuntimeExports.jsx("div",{className:n.cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});u.displayName="SheetFooter";const p=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Title,{ref:a,className:n.cn("text-foreground text-lg font-semibold",e),...t}));p.displayName=s.Title?.displayName||"SheetTitle";const x=i.forwardRef(({className:e,...t},a)=>o.jsxRuntimeExports.jsx(s.Description,{ref:a,className:n.cn("text-muted-foreground text-sm",e),...t}));x.displayName=s.Description?.displayName||"SheetDescription";exports.Sheet=j;exports.SheetClose=N;exports.SheetContent=c;exports.SheetDescription=x;exports.SheetFooter=u;exports.SheetHeader=m;exports.SheetOverlay=l;exports.SheetPortal=d;exports.SheetTitle=p;exports.SheetTrigger=b;
package/dist/sheet.mjs CHANGED
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import { j as a } from "./jsx-runtime-tc70JA_2.mjs";
3
- import { O as r, P as x, C as n, a as d, T as l, D as m, R as h, b as u } from "./index-DlY82G31.mjs";
3
+ import { O as r, P as h, C as n, a as d, T as l, D as m, R as x, b as u } from "./index-DlY82G31.mjs";
4
4
  import { cva as g } from "class-variance-authority";
5
5
  import { X as y } from "lucide-react";
6
6
  import * as i from "react";
7
- import { c as o } from "./utils-B6yFEsav.mjs";
8
- const P = h, z = u, F = d, b = x, c = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
7
+ import { c as o } from "./utils-DY6fhrgS.mjs";
8
+ const P = x, z = u, F = d, b = h, c = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(
9
9
  r,
10
10
  {
11
11
  className: o(
@@ -16,7 +16,7 @@ const P = h, z = u, F = d, b = x, c = i.forwardRef(({ className: e, ...t }, s) =
16
16
  ref: s
17
17
  }
18
18
  ));
19
- c.displayName = r.displayName;
19
+ c.displayName = r?.displayName || "SheetOverlay";
20
20
  const N = g(
21
21
  "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",
22
22
  {
@@ -32,7 +32,7 @@ const N = g(
32
32
  side: "right"
33
33
  }
34
34
  }
35
- ), j = i.forwardRef(
35
+ ), S = i.forwardRef(
36
36
  ({ side: e = "right", className: t, children: s, ...f }, p) => /* @__PURE__ */ a.jsxs(b, { children: [
37
37
  /* @__PURE__ */ a.jsx(c, {}),
38
38
  /* @__PURE__ */ a.jsxs(n, { ref: p, className: o(N({ side: e }), t), ...f, children: [
@@ -44,22 +44,22 @@ const N = g(
44
44
  ] })
45
45
  ] })
46
46
  );
47
- j.displayName = n.displayName;
48
- const S = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: o("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
49
- S.displayName = "SheetHeader";
47
+ S.displayName = n?.displayName || "SheetContent";
48
+ const j = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: o("flex flex-col space-y-2 text-center sm:text-left", e), ...t });
49
+ j.displayName = "SheetHeader";
50
50
  const w = ({ className: e, ...t }) => /* @__PURE__ */ a.jsx("div", { className: o("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2", e), ...t });
51
51
  w.displayName = "SheetFooter";
52
52
  const v = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(l, { ref: s, className: o("text-foreground text-lg font-semibold", e), ...t }));
53
- v.displayName = l.displayName;
53
+ v.displayName = l?.displayName || "SheetTitle";
54
54
  const R = i.forwardRef(({ className: e, ...t }, s) => /* @__PURE__ */ a.jsx(m, { ref: s, className: o("text-muted-foreground text-sm", e), ...t }));
55
- R.displayName = m.displayName;
55
+ R.displayName = m?.displayName || "SheetDescription";
56
56
  export {
57
57
  P as Sheet,
58
58
  F as SheetClose,
59
- j as SheetContent,
59
+ S as SheetContent,
60
60
  R as SheetDescription,
61
61
  w as SheetFooter,
62
- S as SheetHeader,
62
+ j as SheetHeader,
63
63
  c as SheetOverlay,
64
64
  b as SheetPortal,
65
65
  v as SheetTitle,
package/dist/skeleton.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-nZSsnGb7.js"),r=require("./utils-IjLH3w2e.js");function i({className:e,...t}){return n.jsxRuntimeExports.jsx("div",{className:r.cn("bg-primary/10 animate-pulse rounded-md",e),...t})}exports.Skeleton=i;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./jsx-runtime-nZSsnGb7.js"),r=require("./utils-cdbZV8DZ.js");function i({className:e,...t}){return n.jsxRuntimeExports.jsx("div",{className:r.cn("bg-primary/10 animate-pulse rounded-md",e),...t})}exports.Skeleton=i;
package/dist/skeleton.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { j as t } from "./jsx-runtime-tc70JA_2.mjs";
3
- import { c as m } from "./utils-B6yFEsav.mjs";
3
+ import { c as m } from "./utils-DY6fhrgS.mjs";
4
4
  function s({ className: e, ...r }) {
5
5
  return /* @__PURE__ */ t.jsx("div", { className: m("bg-primary/10 animate-pulse rounded-md", e), ...r });
6
6
  }
package/dist/slider.cjs CHANGED
@@ -1 +1 @@
1
- "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./jsx-runtime-nZSsnGb7.js"),le=require("react"),L=require("./index-C8ni3LLa.js"),E=require("./index-BtZvtDmp.js"),C=require("./index-_XxjJPRD.js"),de=require("./index-D2HnlO3y.js"),ue=require("./index-Ce5TOFAK.js"),fe=require("./index-Dko2XdTk.js"),me=require("./index-DYxWvftI.js"),pe=require("./index-Cjj_rUPu.js"),xe=require("./index-BGIK9FQF.js"),Se=require("./utils-IjLH3w2e.js");function he(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=he(le);var U=["PageUp","PageDown"],F=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Y={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},_="Slider",[k,ge,ve]=xe.createCollection(_),[X]=de.createContextScope(_,[ve]),[Re,A]=X(_),G=l.forwardRef((e,t)=>{const{name:n,min:o=0,max:i=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:f=0,defaultValue:v=[o],value:S,onValueChange:s=()=>{},onValueCommit:u=()=>{},inverted:g=!1,form:w,...h}=e,p=l.useRef(new Set),m=l.useRef(0),R=r==="horizontal"?be:we,[x=[],M]=ue.useControllableState({prop:S,defaultProp:v,onChange:b=>{[...p.current][m.current]?.focus(),s(b)}}),T=l.useRef(x);function V(b){const y=De(x,b);K(b,y)}function ae(b){K(b,m.current)}function ce(){const b=T.current[m.current];x[m.current]!==b&&u(x)}function K(b,y,{commit:B}={commit:!1}){const $=Ke(c),N=Ie(Math.round((b-o)/c)*c+o,$),I=L.clamp(N,[o,i]);M((D=[])=>{const P=Pe(D,I,y);if(Me(P,f*c)){m.current=P.indexOf(I);const q=String(P)!==String(D);return q&&B&&u(P),q?P:D}else return D})}return d.jsxRuntimeExports.jsx(Re,{scope:e.__scopeSlider,name:n,disabled:a,min:o,max:i,valueIndexToChangeRef:m,thumbs:p.current,values:x,orientation:r,form:w,children:d.jsxRuntimeExports.jsx(k.Provider,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(k.Slot,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(R,{"aria-disabled":a,"data-disabled":a?"":void 0,...h,ref:t,onPointerDown:E.composeEventHandlers(h.onPointerDown,()=>{a||(T.current=x)}),min:o,max:i,inverted:g,onSlideStart:a?void 0:V,onSlideMove:a?void 0:ae,onSlideEnd:a?void 0:ce,onHomeKeyDown:()=>!a&&K(o,0,{commit:!0}),onEndKeyDown:()=>!a&&K(i,x.length-1,{commit:!0}),onStepKeyDown:({event:b,direction:y})=>{if(!a){const N=U.includes(b.key)||b.shiftKey&&F.includes(b.key)?10:1,I=m.current,D=x[I],P=c*N*y;K(D+P,I,{commit:!0})}}})})})})});G.displayName=_;var[W,J]=X(_,{startEdge:"left",endEdge:"right",size:"width",direction:1}),be=l.forwardRef((e,t)=>{const{min:n,max:o,dir:i,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:f,onStepKeyDown:v,...S}=e,[s,u]=l.useState(null),g=C.useComposedRefs(t,R=>u(R)),w=l.useRef(void 0),h=fe.useDirection(i),p=h==="ltr",m=p&&!c||!p&&c;function j(R){const x=w.current||s.getBoundingClientRect(),M=[0,x.width],V=z(M,m?[n,o]:[o,n]);return w.current=x,V(R-x.left)}return d.jsxRuntimeExports.jsx(W,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:d.jsxRuntimeExports.jsx(Q,{dir:h,"data-orientation":"horizontal",...S,ref:g,style:{...S.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const x=j(R.clientX);r?.(x)},onSlideMove:R=>{const x=j(R.clientX);a?.(x)},onSlideEnd:()=>{w.current=void 0,f?.()},onStepKeyDown:R=>{const M=Y[m?"from-left":"from-right"].includes(R.key);v?.({event:R,direction:M?-1:1})}})})}),we=l.forwardRef((e,t)=>{const{min:n,max:o,inverted:i,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:f,...v}=e,S=l.useRef(null),s=C.useComposedRefs(t,S),u=l.useRef(void 0),g=!i;function w(h){const p=u.current||S.current.getBoundingClientRect(),m=[0,p.height],R=z(m,g?[o,n]:[n,o]);return u.current=p,R(h-p.top)}return d.jsxRuntimeExports.jsx(W,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:d.jsxRuntimeExports.jsx(Q,{"data-orientation":"vertical",...v,ref:s,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const p=w(h.clientY);c?.(p)},onSlideMove:h=>{const p=w(h.clientY);r?.(p)},onSlideEnd:()=>{u.current=void 0,a?.()},onStepKeyDown:h=>{const m=Y[g?"from-bottom":"from-top"].includes(h.key);f?.({event:h,direction:m?-1:1})}})})}),Q=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:i,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:f,...v}=e,S=A(_,n);return d.jsxRuntimeExports.jsx(E.Primitive.span,{...v,ref:t,onKeyDown:E.composeEventHandlers(e.onKeyDown,s=>{s.key==="Home"?(r(s),s.preventDefault()):s.key==="End"?(a(s),s.preventDefault()):U.concat(F).includes(s.key)&&(f(s),s.preventDefault())}),onPointerDown:E.composeEventHandlers(e.onPointerDown,s=>{const u=s.target;u.setPointerCapture(s.pointerId),s.preventDefault(),S.thumbs.has(u)?u.focus():o(s)}),onPointerMove:E.composeEventHandlers(e.onPointerMove,s=>{s.target.hasPointerCapture(s.pointerId)&&i(s)}),onPointerUp:E.composeEventHandlers(e.onPointerUp,s=>{const u=s.target;u.hasPointerCapture(s.pointerId)&&(u.releasePointerCapture(s.pointerId),c(s))})})}),Z="SliderTrack",ee=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=A(Z,n);return d.jsxRuntimeExports.jsx(E.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:t})});ee.displayName=Z;var H="SliderRange",te=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=A(H,n),c=J(H,n),r=l.useRef(null),a=C.useComposedRefs(t,r),f=i.values.length,v=i.values.map(u=>re(u,i.min,i.max)),S=f>1?Math.min(...v):0,s=100-Math.max(...v);return d.jsxRuntimeExports.jsx(E.Primitive.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:a,style:{...e.style,[c.startEdge]:S+"%",[c.endEdge]:s+"%"}})});te.displayName=H;var O="SliderThumb",ne=l.forwardRef((e,t)=>{const n=ge(e.__scopeSlider),[o,i]=l.useState(null),c=C.useComposedRefs(t,a=>i(a)),r=l.useMemo(()=>o?n().findIndex(a=>a.ref.current===o):-1,[n,o]);return d.jsxRuntimeExports.jsx(Ee,{...e,ref:c,index:r})}),Ee=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:i,...c}=e,r=A(O,n),a=J(O,n),[f,v]=l.useState(null),S=C.useComposedRefs(t,j=>v(j)),s=f?r.form||!!f.closest("form"):!0,u=pe.useSize(f),g=r.values[o],w=g===void 0?0:re(g,r.min,r.max),h=je(o,r.values.length),p=u?.[a.size],m=p?Ce(p,w,a.direction):0;return l.useEffect(()=>{if(f)return r.thumbs.add(f),()=>{r.thumbs.delete(f)}},[f,r.thumbs]),d.jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${m}px)`},children:[d.jsxRuntimeExports.jsx(k.ItemSlot,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(E.Primitive.span,{role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":r.min,"aria-valuenow":g,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:S,style:g===void 0?{display:"none"}:e.style,onFocus:E.composeEventHandlers(e.onFocus,()=>{r.valueIndexToChangeRef.current=o})})}),s&&d.jsxRuntimeExports.jsx(oe,{name:i??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:g},o)]})});ne.displayName=O;var ye="RadioBubbleInput",oe=l.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const i=l.useRef(null),c=C.useComposedRefs(i,o),r=me.usePrevious(t);return l.useEffect(()=>{const a=i.current;if(!a)return;const f=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(f,"value").set;if(r!==t&&S){const s=new Event("input",{bubbles:!0});S.call(a,t),a.dispatchEvent(s)}},[r,t]),d.jsxRuntimeExports.jsx(E.Primitive.input,{style:{display:"none"},...n,ref:c,defaultValue:t})});oe.displayName=ye;function Pe(e=[],t,n){const o=[...e];return o[n]=t,o.sort((i,c)=>i-c)}function re(e,t,n){const c=100/(n-t)*(e-t);return L.clamp(c,[0,100])}function je(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function De(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),o=Math.min(...n);return n.indexOf(o)}function Ce(e,t,n){const o=e/2,c=z([0,50],[0,o]);return(o-c(t)*n)*n}function _e(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Me(e,t){if(t>0){const n=_e(e);return Math.min(...n)>=t}return!0}function z(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function Ke(e){return(String(e).split(".")[1]||"").length}function Ie(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var se=G,Ae=ee,Te=te,Ve=ne;const ie=l.forwardRef(({className:e,...t},n)=>d.jsxRuntimeExports.jsxs(se,{ref:n,className:Se.cn("relative flex w-full touch-none items-center select-none",e),...t,children:[d.jsxRuntimeExports.jsx(Ae,{className:"bg-primary/20 relative h-1.5 w-full grow overflow-hidden rounded-full",children:d.jsxRuntimeExports.jsx(Te,{className:"bg-primary absolute h-full"})}),d.jsxRuntimeExports.jsx(Ve,{className:"border-primary/50 bg-background focus-visible:ring-ring block h-4 w-4 rounded-full border shadow transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"})]}));ie.displayName=se.displayName;exports.Slider=ie;
1
+ "use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./jsx-runtime-nZSsnGb7.js"),le=require("react"),L=require("./index-C8ni3LLa.js"),E=require("./index-BtZvtDmp.js"),C=require("./index-_XxjJPRD.js"),de=require("./index-D2HnlO3y.js"),ue=require("./index-Ce5TOFAK.js"),fe=require("./index-Dko2XdTk.js"),me=require("./index-DYxWvftI.js"),pe=require("./index-Cjj_rUPu.js"),xe=require("./index-BGIK9FQF.js"),Se=require("./utils-cdbZV8DZ.js");function he(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const l=he(le);var U=["PageUp","PageDown"],F=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Y={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},_="Slider",[k,ge,ve]=xe.createCollection(_),[X]=de.createContextScope(_,[ve]),[Re,A]=X(_),G=l.forwardRef((e,t)=>{const{name:n,min:o=0,max:i=100,step:c=1,orientation:r="horizontal",disabled:a=!1,minStepsBetweenThumbs:f=0,defaultValue:v=[o],value:S,onValueChange:s=()=>{},onValueCommit:u=()=>{},inverted:g=!1,form:w,...h}=e,p=l.useRef(new Set),m=l.useRef(0),R=r==="horizontal"?be:we,[x=[],M]=ue.useControllableState({prop:S,defaultProp:v,onChange:b=>{[...p.current][m.current]?.focus(),s(b)}}),T=l.useRef(x);function V(b){const y=De(x,b);K(b,y)}function ae(b){K(b,m.current)}function ce(){const b=T.current[m.current];x[m.current]!==b&&u(x)}function K(b,y,{commit:B}={commit:!1}){const $=Ke(c),N=Ie(Math.round((b-o)/c)*c+o,$),I=L.clamp(N,[o,i]);M((D=[])=>{const P=Pe(D,I,y);if(Me(P,f*c)){m.current=P.indexOf(I);const q=String(P)!==String(D);return q&&B&&u(P),q?P:D}else return D})}return d.jsxRuntimeExports.jsx(Re,{scope:e.__scopeSlider,name:n,disabled:a,min:o,max:i,valueIndexToChangeRef:m,thumbs:p.current,values:x,orientation:r,form:w,children:d.jsxRuntimeExports.jsx(k.Provider,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(k.Slot,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(R,{"aria-disabled":a,"data-disabled":a?"":void 0,...h,ref:t,onPointerDown:E.composeEventHandlers(h.onPointerDown,()=>{a||(T.current=x)}),min:o,max:i,inverted:g,onSlideStart:a?void 0:V,onSlideMove:a?void 0:ae,onSlideEnd:a?void 0:ce,onHomeKeyDown:()=>!a&&K(o,0,{commit:!0}),onEndKeyDown:()=>!a&&K(i,x.length-1,{commit:!0}),onStepKeyDown:({event:b,direction:y})=>{if(!a){const N=U.includes(b.key)||b.shiftKey&&F.includes(b.key)?10:1,I=m.current,D=x[I],P=c*N*y;K(D+P,I,{commit:!0})}}})})})})});G.displayName=_;var[W,J]=X(_,{startEdge:"left",endEdge:"right",size:"width",direction:1}),be=l.forwardRef((e,t)=>{const{min:n,max:o,dir:i,inverted:c,onSlideStart:r,onSlideMove:a,onSlideEnd:f,onStepKeyDown:v,...S}=e,[s,u]=l.useState(null),g=C.useComposedRefs(t,R=>u(R)),w=l.useRef(void 0),h=fe.useDirection(i),p=h==="ltr",m=p&&!c||!p&&c;function j(R){const x=w.current||s.getBoundingClientRect(),M=[0,x.width],V=z(M,m?[n,o]:[o,n]);return w.current=x,V(R-x.left)}return d.jsxRuntimeExports.jsx(W,{scope:e.__scopeSlider,startEdge:m?"left":"right",endEdge:m?"right":"left",direction:m?1:-1,size:"width",children:d.jsxRuntimeExports.jsx(Q,{dir:h,"data-orientation":"horizontal",...S,ref:g,style:{...S.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:R=>{const x=j(R.clientX);r?.(x)},onSlideMove:R=>{const x=j(R.clientX);a?.(x)},onSlideEnd:()=>{w.current=void 0,f?.()},onStepKeyDown:R=>{const M=Y[m?"from-left":"from-right"].includes(R.key);v?.({event:R,direction:M?-1:1})}})})}),we=l.forwardRef((e,t)=>{const{min:n,max:o,inverted:i,onSlideStart:c,onSlideMove:r,onSlideEnd:a,onStepKeyDown:f,...v}=e,S=l.useRef(null),s=C.useComposedRefs(t,S),u=l.useRef(void 0),g=!i;function w(h){const p=u.current||S.current.getBoundingClientRect(),m=[0,p.height],R=z(m,g?[o,n]:[n,o]);return u.current=p,R(h-p.top)}return d.jsxRuntimeExports.jsx(W,{scope:e.__scopeSlider,startEdge:g?"bottom":"top",endEdge:g?"top":"bottom",size:"height",direction:g?1:-1,children:d.jsxRuntimeExports.jsx(Q,{"data-orientation":"vertical",...v,ref:s,style:{...v.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:h=>{const p=w(h.clientY);c?.(p)},onSlideMove:h=>{const p=w(h.clientY);r?.(p)},onSlideEnd:()=>{u.current=void 0,a?.()},onStepKeyDown:h=>{const m=Y[g?"from-bottom":"from-top"].includes(h.key);f?.({event:h,direction:m?-1:1})}})})}),Q=l.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:o,onSlideMove:i,onSlideEnd:c,onHomeKeyDown:r,onEndKeyDown:a,onStepKeyDown:f,...v}=e,S=A(_,n);return d.jsxRuntimeExports.jsx(E.Primitive.span,{...v,ref:t,onKeyDown:E.composeEventHandlers(e.onKeyDown,s=>{s.key==="Home"?(r(s),s.preventDefault()):s.key==="End"?(a(s),s.preventDefault()):U.concat(F).includes(s.key)&&(f(s),s.preventDefault())}),onPointerDown:E.composeEventHandlers(e.onPointerDown,s=>{const u=s.target;u.setPointerCapture(s.pointerId),s.preventDefault(),S.thumbs.has(u)?u.focus():o(s)}),onPointerMove:E.composeEventHandlers(e.onPointerMove,s=>{s.target.hasPointerCapture(s.pointerId)&&i(s)}),onPointerUp:E.composeEventHandlers(e.onPointerUp,s=>{const u=s.target;u.hasPointerCapture(s.pointerId)&&(u.releasePointerCapture(s.pointerId),c(s))})})}),Z="SliderTrack",ee=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=A(Z,n);return d.jsxRuntimeExports.jsx(E.Primitive.span,{"data-disabled":i.disabled?"":void 0,"data-orientation":i.orientation,...o,ref:t})});ee.displayName=Z;var H="SliderRange",te=l.forwardRef((e,t)=>{const{__scopeSlider:n,...o}=e,i=A(H,n),c=J(H,n),r=l.useRef(null),a=C.useComposedRefs(t,r),f=i.values.length,v=i.values.map(u=>re(u,i.min,i.max)),S=f>1?Math.min(...v):0,s=100-Math.max(...v);return d.jsxRuntimeExports.jsx(E.Primitive.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:a,style:{...e.style,[c.startEdge]:S+"%",[c.endEdge]:s+"%"}})});te.displayName=H;var O="SliderThumb",ne=l.forwardRef((e,t)=>{const n=ge(e.__scopeSlider),[o,i]=l.useState(null),c=C.useComposedRefs(t,a=>i(a)),r=l.useMemo(()=>o?n().findIndex(a=>a.ref.current===o):-1,[n,o]);return d.jsxRuntimeExports.jsx(Ee,{...e,ref:c,index:r})}),Ee=l.forwardRef((e,t)=>{const{__scopeSlider:n,index:o,name:i,...c}=e,r=A(O,n),a=J(O,n),[f,v]=l.useState(null),S=C.useComposedRefs(t,j=>v(j)),s=f?r.form||!!f.closest("form"):!0,u=pe.useSize(f),g=r.values[o],w=g===void 0?0:re(g,r.min,r.max),h=je(o,r.values.length),p=u?.[a.size],m=p?Ce(p,w,a.direction):0;return l.useEffect(()=>{if(f)return r.thumbs.add(f),()=>{r.thumbs.delete(f)}},[f,r.thumbs]),d.jsxRuntimeExports.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[a.startEdge]:`calc(${w}% + ${m}px)`},children:[d.jsxRuntimeExports.jsx(k.ItemSlot,{scope:e.__scopeSlider,children:d.jsxRuntimeExports.jsx(E.Primitive.span,{role:"slider","aria-label":e["aria-label"]||h,"aria-valuemin":r.min,"aria-valuenow":g,"aria-valuemax":r.max,"aria-orientation":r.orientation,"data-orientation":r.orientation,"data-disabled":r.disabled?"":void 0,tabIndex:r.disabled?void 0:0,...c,ref:S,style:g===void 0?{display:"none"}:e.style,onFocus:E.composeEventHandlers(e.onFocus,()=>{r.valueIndexToChangeRef.current=o})})}),s&&d.jsxRuntimeExports.jsx(oe,{name:i??(r.name?r.name+(r.values.length>1?"[]":""):void 0),form:r.form,value:g},o)]})});ne.displayName=O;var ye="RadioBubbleInput",oe=l.forwardRef(({__scopeSlider:e,value:t,...n},o)=>{const i=l.useRef(null),c=C.useComposedRefs(i,o),r=me.usePrevious(t);return l.useEffect(()=>{const a=i.current;if(!a)return;const f=window.HTMLInputElement.prototype,S=Object.getOwnPropertyDescriptor(f,"value").set;if(r!==t&&S){const s=new Event("input",{bubbles:!0});S.call(a,t),a.dispatchEvent(s)}},[r,t]),d.jsxRuntimeExports.jsx(E.Primitive.input,{style:{display:"none"},...n,ref:c,defaultValue:t})});oe.displayName=ye;function Pe(e=[],t,n){const o=[...e];return o[n]=t,o.sort((i,c)=>i-c)}function re(e,t,n){const c=100/(n-t)*(e-t);return L.clamp(c,[0,100])}function je(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function De(e,t){if(e.length===1)return 0;const n=e.map(i=>Math.abs(i-t)),o=Math.min(...n);return n.indexOf(o)}function Ce(e,t,n){const o=e/2,c=z([0,50],[0,o]);return(o-c(t)*n)*n}function _e(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Me(e,t){if(t>0){const n=_e(e);return Math.min(...n)>=t}return!0}function z(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const o=(t[1]-t[0])/(e[1]-e[0]);return t[0]+o*(n-e[0])}}function Ke(e){return(String(e).split(".")[1]||"").length}function Ie(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var se=G,Ae=ee,Te=te,Ve=ne;const ie=l.forwardRef(({className:e,...t},n)=>d.jsxRuntimeExports.jsxs(se,{ref:n,className:Se.cn("relative flex w-full touch-none items-center select-none",e),...t,children:[d.jsxRuntimeExports.jsx(Ae,{className:"bg-primary/20 relative h-1.5 w-full grow overflow-hidden rounded-full",children:d.jsxRuntimeExports.jsx(Te,{className:"bg-primary absolute h-full"})}),d.jsxRuntimeExports.jsx(Ve,{className:"border-primary/50 bg-background focus-visible:ring-ring block h-4 w-4 rounded-full border shadow transition-colors focus-visible:ring-1 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50"})]}));ie.displayName=se?.displayName||"Slider";exports.Slider=ie;
package/dist/slider.mjs CHANGED
@@ -10,7 +10,7 @@ import { u as ue } from "./index-CD6_IrA-.mjs";
10
10
  import { u as fe } from "./index-BZPx6jYI.mjs";
11
11
  import { u as me } from "./index-C1qb0595.mjs";
12
12
  import { c as pe } from "./index-DFdF7K7v.mjs";
13
- import { c as Se } from "./utils-B6yFEsav.mjs";
13
+ import { c as Se } from "./utils-DY6fhrgS.mjs";
14
14
  var $ = ["PageUp", "PageDown"], X = ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], G = {
15
15
  "from-left": ["Home", "PageDown", "ArrowDown", "ArrowLeft"],
16
16
  "from-right": ["Home", "PageDown", "ArrowDown", "ArrowRight"],
@@ -437,7 +437,7 @@ const Ve = c.forwardRef(({ className: e, ...t }, n) => /* @__PURE__ */ d.jsxs(
437
437
  ]
438
438
  }
439
439
  ));
440
- Ve.displayName = se.displayName;
440
+ Ve.displayName = se?.displayName || "Slider";
441
441
  export {
442
442
  Ve as Slider
443
443
  };