@konstructio/ui 0.1.6 → 0.1.8

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 (70) hide show
  1. package/dist/check-Bekes_eB.js +14 -0
  2. package/dist/components/CopyButton/CopyButton.js +12 -12
  3. package/dist/components/DateRangePicker/DateRangePicker.js +58 -57
  4. package/dist/components/DateRangePicker/DateRangePicker.variants.js +1 -0
  5. package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +55 -54
  6. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +17 -17
  7. package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +15 -14
  8. package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
  9. package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +74 -55
  10. package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
  11. package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
  12. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
  13. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
  14. package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +38 -38
  15. package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
  16. package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +60 -56
  17. package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +21 -14
  18. package/dist/components/DateRangePicker/components/RightPanel/RightPanel.js +41 -25
  19. package/dist/components/DateRangePicker/contexts/date-range-picker/date-range-picker.provider.js +15 -14
  20. package/dist/components/Filter/Filter.variants.js +12 -7
  21. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.js +39 -0
  22. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.js +17 -14
  23. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.js +48 -27
  24. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Trigger/Trigger.js +13 -12
  25. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Wrapper/Wrapper.js +53 -17
  26. package/dist/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.provider.js +87 -78
  27. package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +44 -20
  28. package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +58 -50
  29. package/dist/components/Filter/hooks/index.js +5 -2
  30. package/dist/components/Filter/hooks/useFilterSheet.js +6 -0
  31. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +18 -18
  32. package/dist/components/Sheet/Sheet.js +143 -139
  33. package/dist/components/Sheet/components/SheetStep/SheetStep.js +57 -55
  34. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
  35. package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +42 -42
  36. package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +25 -2
  37. package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +1 -1
  38. package/dist/components/Tabs/Tabs.variants.js +4 -7
  39. package/dist/components/Tabs/components/Trigger.js +5 -5
  40. package/dist/components/Tooltip/Tooltip.js +17 -17
  41. package/dist/components/VirtualizedTable/components/Filter/Filter.js +40 -39
  42. package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
  43. package/dist/components/VirtualizedTable/constants/index.js +6 -5
  44. package/dist/components/VirtualizedTable/constants/responsive.js +2 -1
  45. package/dist/{constants-YCGllWdf.js → constants-Cw00eFTQ.js} +13 -13
  46. package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +6 -0
  47. package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.types.d.ts +2 -0
  48. package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.types.d.ts +2 -0
  49. package/dist/lib/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.d.ts +1 -1
  50. package/dist/lib/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.d.ts +3 -1
  51. package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.context.d.ts +2 -0
  52. package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.types.d.ts +1 -0
  53. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.d.ts +3 -0
  54. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.types.d.ts +3 -0
  55. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.d.ts +2 -1
  56. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.types.d.ts +4 -0
  57. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.d.ts +2 -1
  58. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.types.d.ts +4 -0
  59. package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.types.d.ts +2 -0
  60. package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +8 -0
  61. package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
  62. package/dist/lib/components/Filter/hooks/useFilterSheet.d.ts +2 -0
  63. package/dist/lib/components/Sheet/Sheet.types.d.ts +12 -0
  64. package/dist/lib/components/Sheet/components/SheetStep/SheetStep.d.ts +21 -3
  65. package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +1 -0
  66. package/dist/package.json +18 -18
  67. package/dist/styles.css +1 -1
  68. package/dist/ui/utilities.css +23 -0
  69. package/package.json +18 -18
  70. package/dist/StepIndicatorContent-C6MILk4c.js +0 -36
@@ -1,23 +1,23 @@
1
1
  "use client";
2
- import { a as lt, o as ut, r as dt, s as ft, t as ht } from "../../dist-DWopnVS-.js";
3
- import { t as mt } from "../../chevron-left-B1zWfqll.js";
4
- import { t as m } from "../../utils-DnIJruo0.js";
5
- import { SheetStep as pt } from "./components/SheetStep/SheetStep.js";
6
- import { resolveSheetGesture as gt, shouldSwipeBack as vt } from "./utils/index.js";
7
- import { useCallback as yt, useEffect as bt, useLayoutEffect as xt, useRef as r, useState as p } from "react";
8
- import { Fragment as Ce, jsx as a, jsxs as b } from "react/jsx-runtime";
9
- import { AnimatePresence as ue, animate as u, motion as v, useMotionValue as f, useReducedMotion as kt } from "motion/react";
10
- var Pe = {
2
+ import { a as ht, o as mt, r as pt, s as gt, t as vt } from "../../dist-DWopnVS-.js";
3
+ import { t as yt } from "../../chevron-left-B1zWfqll.js";
4
+ import { t as p } from "../../utils-DnIJruo0.js";
5
+ import { SheetStep as xt } from "./components/SheetStep/SheetStep.js";
6
+ import { resolveSheetGesture as bt, shouldSwipeBack as kt } from "./utils/index.js";
7
+ import { useCallback as Rt, useEffect as wt, useLayoutEffect as St, useRef as r, useState as f } from "react";
8
+ import { Fragment as Pe, jsx as a, jsxs as x } from "react/jsx-runtime";
9
+ import { AnimatePresence as ue, animate as u, motion as v, useMotionValue as h, useReducedMotion as Ht } from "motion/react";
10
+ var Me = {
11
11
  duration: 0.2,
12
12
  ease: "easeOut"
13
- }, Me = {
13
+ }, Te = {
14
14
  type: "spring",
15
15
  stiffness: 380,
16
16
  damping: 38
17
- }, j = { duration: 0 }, Rt = 0.05, Te = (i) => typeof i == "number" ? i : i.direction, wt = {
17
+ }, j = { duration: 0 }, Ot = 0.05, Le = (i) => typeof i == "number" ? i : i.direction, Et = {
18
18
  enter: (i) => ({
19
19
  opacity: 0,
20
- x: Te(i) > 0 ? w : -w
20
+ x: Le(i) > 0 ? S : -S
21
21
  }),
22
22
  center: {
23
23
  opacity: 1,
@@ -28,80 +28,80 @@ var Pe = {
28
28
  transition: j
29
29
  } : {
30
30
  opacity: 0,
31
- x: Te(i) > 0 ? -w : w
31
+ x: Le(i) > 0 ? -S : S
32
32
  }
33
- }, de = "text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-metal-400", w = 24, Ht = "96px", St = {
33
+ }, de = "text-xs font-semibold uppercase tracking-wide text-slate-500 dark:text-metal-400", S = 24, Nt = "96px", At = {
34
34
  duration: 0.45,
35
35
  ease: "easeOut"
36
- }, Ot = (i) => i instanceof Element && i.closest("[data-sheet-grip]") !== null, Nt = ({ isOpen: i, onClose: fe, onBack: W, title: H, hideTitle: De = !1, leading: Xe, position: o = "bottom", expandable: N = !1, step: c = 0, className: _e, bodyClassName: Le, headerClassName: Fe, titleClassName: q, theme: Ge, children: K }) => {
37
- const h = kt(), A = r(null), he = r(null), E = r(null), B = r(null), [ze, I] = p("auto"), [Ve, me] = p(!1), [s, $] = p(!1), [je, pe] = p(!1), ge = r(0), C = r(null), J = r(!1), Q = r(!1), P = r(null), S = f(0), d = f("auto"), U = r({
36
+ }, It = (i) => i instanceof Element && i.closest("[data-sheet-grip]") !== null, Bt = ({ isOpen: i, onClose: fe, onBack: W, title: H, hideTitle: De = !1, leading: Xe, position: o = "bottom", expandable: N = !1, step: c = 0, softReveal: _e = !1, previousContent: Fe, className: Ge, bodyClassName: ze, headerClassName: Ve, titleClassName: q, theme: je, children: K }) => {
37
+ const m = Ht(), A = r(null), he = r(null), I = r(null), B = r(null), [We, C] = f("auto"), [qe, me] = f(!1), [s, $] = f(!1), [Ke, pe] = f(!1), ge = r(0), P = r(null), J = r(!1), Q = r(!1), M = r(null), O = h(0), d = h("auto"), U = r({
38
38
  step: c,
39
39
  title: H,
40
40
  children: K
41
- }), M = r(null), Y = r(!1), ve = r(null), x = r(0), T = r(0), [g, Z] = p(null), [ee, O] = p("idle"), [te, ye] = p(!1), [We, qe] = p(0), ne = r(!1), D = f(0), X = f(0), _ = f(0), L = f(1), F = f(0), G = f(0), z = f(1), ae = f("0px"), re = r(!1), ie = r(null), be = r(0);
42
- U.current.step !== c && (M.current = U.current), U.current = {
41
+ }), b = r(null), Y = r(!1), ve = r(null), k = r(0), T = r(0), [g, Z] = f(null), [ee, E] = f("idle"), [te, ye] = f(!1), [$e, xe] = f(!1), [Je, Qe] = f(0), ne = r(!1), L = h(0), D = h(0), X = h(0), _ = h(1), F = h(0), G = h(0), z = h(1), ae = h("0px"), re = r(!1), ie = r(null), be = r(0);
42
+ U.current.step !== c && (b.current = U.current), U.current = {
43
43
  step: c,
44
44
  title: H,
45
45
  children: K
46
46
  }, s && (!i || !N) && ($(!1), d.set("auto"));
47
- const [se, Ke] = p({
47
+ const [se, Ue] = f({
48
48
  step: c,
49
49
  direction: 1,
50
50
  animated: !0
51
51
  });
52
52
  if (se.step !== c) {
53
53
  const e = !Y.current;
54
- Ke({
54
+ Ue({
55
55
  step: c,
56
56
  direction: c > se.step ? 1 : -1,
57
57
  animated: e
58
- }), Y.current = !1, ie.current = e && !h && !s ? be.current : null;
58
+ }), Y.current = !1, xe(!0), ie.current = _e && e && !m && !s ? be.current : null;
59
59
  }
60
- const { direction: V, animated: k } = se, ce = o === "bottom" ? 1 : -1, l = h ? j : Me, xe = () => {
61
- D.set(0), X.set(0), _.set(0), L.set(1), F.set(0), G.set(0), z.set(1);
60
+ const { direction: V, animated: R } = se, ce = o === "bottom" ? 1 : -1, l = m ? j : Te, ke = () => {
61
+ L.set(0), D.set(0), X.set(0), _.set(1), F.set(0), G.set(0), z.set(1);
62
62
  };
63
- bt(() => {
64
- Z(null), O("idle"), xe(), s || d.set("auto");
65
- }, [c]), xt(() => {
66
- x.current = ve.current?.getBoundingClientRect().height ?? 0, g && !s && x.current > T.current && Re(), g && ne.current && (ne.current = !1, O("settling"), Ee(1), qe((e) => e + 1));
63
+ wt(() => {
64
+ Z(null), E("idle"), ke(), s || d.set("auto");
65
+ }, [c]), St(() => {
66
+ k.current = ve.current?.getBoundingClientRect().height ?? 0, g && !s && k.current > T.current && we(), g && ne.current && (ne.current = !1, E("settling"), Ie(1), Qe((e) => e + 1));
67
67
  }, [g]);
68
- const ke = o === "bottom" ? "100%" : "-100%", $e = h ? {
68
+ const Re = o === "bottom" ? "100%" : "-100%", Ye = m ? {
69
69
  initial: !1,
70
70
  animate: { y: 0 }
71
71
  } : {
72
- initial: { y: ke },
72
+ initial: { y: Re },
73
73
  animate: { y: 0 },
74
- exit: { y: ke }
75
- }, Re = () => {
76
- ae.set(Ht), re.current = !1, ye(!0);
77
- }, we = N && !s, Je = (e) => {
78
- const t = e.pointerType !== "mouse" || e.button === 0, n = Ot(e.target);
79
- J.current = t && (n || we), Q.current = t && !n, P.current = null;
80
- }, He = (e) => (P.current === null && (P.current = Math.abs(e.offset.x) > Math.abs(e.offset.y) ? "x" : "y"), P.current), Qe = (e, t) => {
74
+ exit: { y: Re }
75
+ }, we = () => {
76
+ ae.set(Nt), re.current = !1, ye(!0);
77
+ }, Se = N && !s, Ze = (e) => {
78
+ const t = e.pointerType !== "mouse" || e.button === 0, n = It(e.target);
79
+ J.current = t && (n || Se), Q.current = t && !n, M.current = null;
80
+ }, He = (e) => (M.current === null && (M.current = Math.abs(e.offset.x) > Math.abs(e.offset.y) ? "x" : "y"), M.current), et = (e, t) => {
81
81
  if (!J.current || He(t) === "x") return;
82
82
  J.current = !1;
83
83
  const n = A.current?.offsetHeight ?? 0;
84
- C.current = {
84
+ P.current = {
85
85
  startHeight: n,
86
86
  restHeight: s ? ge.current : n,
87
87
  maxHeight: window.visualViewport?.height ?? window.innerHeight
88
88
  }, d.set(n), pe(!0);
89
- }, Ue = (e, t) => {
90
- const n = C.current;
89
+ }, tt = (e, t) => {
90
+ const n = P.current;
91
91
  if (!n) return;
92
- const R = t.offset.y * ce;
92
+ const w = t.offset.y * ce;
93
93
  if (!N) {
94
- S.set(R >= 0 ? t.offset.y : t.offset.y * Rt);
94
+ O.set(w >= 0 ? t.offset.y : t.offset.y * Ot);
95
95
  return;
96
96
  }
97
- const y = n.startHeight - R;
97
+ const y = n.startHeight - w;
98
98
  if (y >= n.restHeight) {
99
- d.set(Math.min(y, n.maxHeight)), S.set(0);
99
+ d.set(Math.min(y, n.maxHeight)), O.set(0);
100
100
  return;
101
101
  }
102
- d.set(n.restHeight), S.set((n.restHeight - y) * ce);
102
+ d.set(n.restHeight), O.set((n.restHeight - y) * ce);
103
103
  }, oe = (e, t, n) => {
104
- if (u(S, 0, l), t) {
104
+ if (u(O, 0, l), t) {
105
105
  u(d, e.maxHeight, {
106
106
  ...l,
107
107
  velocity: n
@@ -113,11 +113,11 @@ var Pe = {
113
113
  velocity: n,
114
114
  onComplete: () => d.set("auto")
115
115
  });
116
- }, Ye = (e, t) => {
117
- const n = C.current;
116
+ }, nt = (e, t) => {
117
+ const n = P.current;
118
118
  if (!n) return;
119
- C.current = null, pe(!1);
120
- const R = gt({
119
+ P.current = null, pe(!1);
120
+ const w = bt({
121
121
  offset: t.offset.y,
122
122
  velocity: t.velocity.y,
123
123
  panelHeight: n.startHeight,
@@ -126,86 +126,89 @@ var Pe = {
126
126
  isExpanded: s,
127
127
  restHeight: n.restHeight
128
128
  }), y = -t.velocity.y * ce;
129
- R === "dismiss" ? (d.set("auto"), fe()) : R === "expand" ? (ge.current = n.restHeight, $(!0), oe(n, !0, y)) : R === "collapse" ? ($(!1), oe(n, !1, y)) : oe(n, s, y);
130
- }, Se = !!W && c > 0, le = () => A.current?.offsetWidth || 1, Oe = () => x.current > 0 && !s, Ze = (e) => Q.current && He(e) === "x", Ne = (e) => {
131
- const t = M.current, n = t !== null && t.step > 0;
129
+ w === "dismiss" ? (d.set("auto"), fe()) : w === "expand" ? (ge.current = n.restHeight, $(!0), oe(n, !0, y)) : w === "collapse" ? ($(!1), oe(n, !1, y)) : oe(n, s, y);
130
+ }, Oe = !!W && c > 0, le = () => A.current?.offsetWidth || 1, Ee = () => k.current > 0 && !s, at = (e) => Q.current && He(e) === "x", Ne = (e) => {
131
+ const t = b.current, n = t !== null && t.step > 0;
132
132
  return {
133
133
  previewX: -0.3 * le() * (1 - e),
134
134
  previewOpacity: e,
135
- titleOutX: w * e,
135
+ titleOutX: S * e,
136
136
  titleOutOpacity: 1 - e,
137
- titleInX: (n ? 0 : -36) * e - w * (1 - e),
137
+ titleInX: (n ? 0 : -36) * e - S * (1 - e),
138
138
  titleInOpacity: e,
139
139
  chevronOpacity: n ? 1 : 1 - e
140
140
  };
141
141
  }, Ae = (e) => {
142
142
  const t = Ne(e);
143
- if (D.set(t.previewX), X.set(t.previewOpacity), _.set(t.titleOutX), L.set(t.titleOutOpacity), F.set(t.titleInX), G.set(t.titleInOpacity), z.set(t.chevronOpacity), Oe()) {
143
+ if (L.set(t.previewX), D.set(t.previewOpacity), X.set(t.titleOutX), _.set(t.titleOutOpacity), F.set(t.titleInX), G.set(t.titleInOpacity), z.set(t.chevronOpacity), Ee()) {
144
144
  const n = T.current;
145
- I(n + (x.current - n) * e);
145
+ C(n + (k.current - n) * e);
146
146
  }
147
- }, Ee = (e) => {
147
+ }, Ie = (e) => {
148
148
  const t = Ne(e);
149
- u(D, t.previewX, l), u(X, t.previewOpacity, l), u(_, t.titleOutX, l), u(L, t.titleOutOpacity, l), u(F, t.titleInX, l), u(G, t.titleInOpacity, l), u(z, t.chevronOpacity, l), Oe() && I(e === 1 ? x.current : T.current);
149
+ u(L, t.previewX, l), u(D, t.previewOpacity, l), u(X, t.titleOutX, l), u(_, t.titleOutOpacity, l), u(F, t.titleInX, l), u(G, t.titleInOpacity, l), u(z, t.chevronOpacity, l), Ee() && C(e === 1 ? k.current : T.current);
150
150
  }, Be = () => {
151
- Q.current = !1, T.current = he.current?.getBoundingClientRect().height ?? 0, x.current = 0, Ae(0), Z(M.current), O("dragging");
152
- }, et = (e) => {
151
+ Q.current = !1, T.current = he.current?.getBoundingClientRect().height ?? 0, k.current = 0, Ae(0), Z(b.current && {
152
+ ...b.current,
153
+ children: Fe ?? b.current.children
154
+ }), E("dragging");
155
+ }, rt = (e) => {
153
156
  Ae(Math.min(e / le(), 1));
154
- }, tt = (e) => {
155
- const t = vt({
157
+ }, it = (e) => {
158
+ const t = kt({
156
159
  offset: e.offset.x,
157
160
  velocity: e.velocity.x,
158
161
  panelWidth: le()
159
162
  });
160
- return O("settling"), Ee(t ? 1 : 0), t ? "back" : "stay";
161
- }, nt = (e) => {
163
+ return E("settling"), Ie(t ? 1 : 0), t ? "back" : "stay";
164
+ }, st = (e) => {
162
165
  const t = ie.current;
163
- ie.current = null, t !== null && e > t && Re();
164
- }, at = () => {
165
- if (ee !== "idle" || !M.current) {
166
+ ie.current = null, t !== null && e > t && we();
167
+ }, ct = () => {
168
+ if (ee !== "idle" || !b.current) {
166
169
  W?.();
167
170
  return;
168
171
  }
169
172
  ne.current = !0, Be();
170
- }, rt = () => {
173
+ }, ot = () => {
171
174
  Y.current = !0, W?.();
172
- }, it = () => {
173
- Z(null), O("idle"), xe();
174
- }, st = () => {
175
+ }, lt = () => {
176
+ Z(null), E("idle"), ke();
177
+ }, ut = () => {
175
178
  !te || ee === "dragging" || re.current || (re.current = !0, u(ae, "0px", {
176
- ...h ? j : St,
179
+ ...m ? j : At,
177
180
  onComplete: () => ye(!1)
178
181
  }));
179
- }, ct = h || !Ve || ee === "dragging" ? j : Me, Ie = /* @__PURE__ */ a("div", {
182
+ }, dt = m || !qe || ee === "dragging" ? j : Te, Ce = /* @__PURE__ */ a("div", {
180
183
  "aria-hidden": "true",
181
184
  "data-sheet-handle": "",
182
185
  "data-sheet-grip": "",
183
- "data-active": je || void 0,
184
- className: m("group flex shrink-0 cursor-grab touch-none justify-center active:cursor-grabbing", o === "bottom" ? "pb-2" : "pt-2"),
185
- children: /* @__PURE__ */ a("div", { className: m("h-1 w-10 rounded-full transition-colors duration-150", "bg-slate-300 dark:bg-metal-600", "group-data-[active]:bg-slate-400 dark:group-data-[active]:bg-metal-400") })
186
- }), ot = yt((e) => {
187
- if (he.current = e, E.current?.disconnect(), E.current = null, B.current !== null && (cancelAnimationFrame(B.current), B.current = null), !e) {
188
- me(!1), I("auto");
186
+ "data-active": Ke || void 0,
187
+ className: p("group flex shrink-0 cursor-grab touch-none justify-center active:cursor-grabbing", o === "bottom" ? "pb-2" : "pt-2"),
188
+ children: /* @__PURE__ */ a("div", { className: p("h-1 w-10 rounded-full transition-colors duration-150", "bg-slate-300 dark:bg-metal-600", "group-data-[active]:bg-slate-400 dark:group-data-[active]:bg-metal-400") })
189
+ }), ft = Rt((e) => {
190
+ if (he.current = e, I.current?.disconnect(), I.current = null, B.current !== null && (cancelAnimationFrame(B.current), B.current = null), !e) {
191
+ me(!1), C("auto");
189
192
  return;
190
193
  }
191
194
  const t = (n) => {
192
- be.current = n, I(n);
195
+ be.current = n, C(n);
193
196
  };
194
- t(e.getBoundingClientRect().height), typeof ResizeObserver < "u" && (E.current = new ResizeObserver(([n]) => {
197
+ t(e.getBoundingClientRect().height), typeof ResizeObserver < "u" && (I.current = new ResizeObserver(([n]) => {
195
198
  n && t(n.contentRect.height);
196
- }), E.current.observe(e)), B.current = requestAnimationFrame(() => {
199
+ }), I.current.observe(e)), B.current = requestAnimationFrame(() => {
197
200
  me(!0);
198
201
  });
199
202
  }, []);
200
- return /* @__PURE__ */ a(ht, {
203
+ return /* @__PURE__ */ a(vt, {
201
204
  open: i,
202
205
  onOpenChange: (e) => !e && fe(),
203
- children: /* @__PURE__ */ a(ue, { children: i && /* @__PURE__ */ a(ut, {
206
+ children: /* @__PURE__ */ a(ue, { children: i && /* @__PURE__ */ a(mt, {
204
207
  forceMount: !0,
205
- children: /* @__PURE__ */ b("div", {
206
- "data-theme": Ge,
208
+ children: /* @__PURE__ */ x("div", {
209
+ "data-theme": je,
207
210
  className: "contents",
208
- children: [/* @__PURE__ */ a(lt, {
211
+ children: [/* @__PURE__ */ a(ht, {
209
212
  asChild: !0,
210
213
  forceMount: !0,
211
214
  children: /* @__PURE__ */ a(v.div, {
@@ -213,37 +216,37 @@ var Pe = {
213
216
  initial: { opacity: 0 },
214
217
  animate: { opacity: 1 },
215
218
  exit: { opacity: 0 },
216
- transition: Pe
219
+ transition: Me
217
220
  })
218
- }), /* @__PURE__ */ a(dt, {
221
+ }), /* @__PURE__ */ a(pt, {
219
222
  asChild: !0,
220
223
  forceMount: !0,
221
224
  onOpenAutoFocus: (e) => {
222
225
  e.preventDefault(), A.current?.focus();
223
226
  },
224
- children: /* @__PURE__ */ b(v.div, {
227
+ children: /* @__PURE__ */ x(v.div, {
225
228
  ref: A,
226
229
  tabIndex: -1,
227
- className: m("konstruct-sheet fixed inset-x-0 z-70 flex flex-col", "bg-white text-slate-800 shadow-xl outline-none", "dark:bg-metal-800 dark:text-metal-50", o === "bottom" ? "bottom-0 pb-[calc(1rem+env(safe-area-inset-bottom))]" : "top-0 pt-[calc(1rem+env(safe-area-inset-top))]", s ? "max-h-dvh" : "max-h-[calc(100dvh-4rem)]", o === "bottom" ? "rounded-t-lg" : "rounded-b-lg", o === "bottom" && (s ? "pt-[calc(0.5rem+env(safe-area-inset-top))]" : "pt-2"), o === "top" && (s ? "pb-[calc(0.5rem+env(safe-area-inset-bottom))]" : "pb-2"), _e),
230
+ className: p("konstruct-sheet fixed inset-x-0 z-70 flex flex-col", "bg-white text-slate-800 shadow-xl outline-none", "dark:bg-metal-800 dark:text-metal-50", o === "bottom" ? "bottom-0 pb-[calc(1rem+env(safe-area-inset-bottom))]" : "top-0 pt-[calc(1rem+env(safe-area-inset-top))]", s ? "max-h-dvh" : "max-h-[calc(100dvh-4rem)]", o === "bottom" ? "rounded-t-lg" : "rounded-b-lg", o === "bottom" && (s ? "pt-[calc(0.5rem+env(safe-area-inset-top))]" : "pt-2"), o === "top" && (s ? "pb-[calc(0.5rem+env(safe-area-inset-bottom))]" : "pb-2"), Ge),
228
231
  "data-position": o,
229
232
  "data-step": c,
230
233
  "data-expanded": s || void 0,
231
234
  style: {
232
- y: S,
235
+ y: O,
233
236
  height: d
234
237
  },
235
- transition: Pe,
236
- onPointerDownCapture: Je,
237
- onPanStart: Qe,
238
- onPan: Ue,
239
- onPanEnd: Ye,
240
- ...$e,
238
+ transition: Me,
239
+ onPointerDownCapture: Ze,
240
+ onPanStart: et,
241
+ onPan: tt,
242
+ onPanEnd: nt,
243
+ ...Ye,
241
244
  children: [
242
- o === "bottom" && Ie,
243
- /* @__PURE__ */ b("div", {
244
- className: m("flex min-h-9 shrink-0 touch-none items-center gap-2 px-6 pb-2", Fe, De && "sr-only"),
245
+ o === "bottom" && Ce,
246
+ /* @__PURE__ */ x("div", {
247
+ className: p("flex min-h-9 shrink-0 touch-none items-center gap-2 px-6 pb-2", Ve, De && "sr-only"),
245
248
  "data-sheet-grip": "",
246
- children: [/* @__PURE__ */ a(ft, {
249
+ children: [/* @__PURE__ */ a(gt, {
247
250
  className: "sr-only",
248
251
  children: H
249
252
  }), /* @__PURE__ */ a(ue, {
@@ -251,41 +254,41 @@ var Pe = {
251
254
  initial: !1,
252
255
  custom: {
253
256
  direction: V,
254
- instant: !k
257
+ instant: !R
255
258
  },
256
259
  children: /* @__PURE__ */ a(v.div, {
257
260
  custom: V,
258
261
  className: "flex min-h-9 items-center gap-2",
259
- variants: !h && k ? wt : void 0,
260
- initial: !h && k ? "enter" : !1,
262
+ variants: !m && R ? Et : void 0,
263
+ initial: !m && R ? "enter" : !1,
261
264
  animate: "center",
262
- exit: !h && k ? "exit" : void 0,
265
+ exit: !m && R ? "exit" : void 0,
263
266
  transition: l,
264
- children: Se ? /* @__PURE__ */ a(Ce, { children: /* @__PURE__ */ b("button", {
267
+ children: Oe ? /* @__PURE__ */ a(Pe, { children: /* @__PURE__ */ x("button", {
265
268
  type: "button",
266
269
  "data-sheet-back": "",
267
- onClick: at,
268
- className: m("-my-1 -ml-2 flex h-9 items-center gap-2 rounded pr-2 outline-none", "focus-visible:ring-1 focus-visible:ring-aurora-500", "pointer-coarse:active:bg-slate-100 dark:pointer-coarse:active:bg-metal-700"),
270
+ onClick: ct,
271
+ className: p("-my-1 -ml-2 flex h-9 items-center gap-2 rounded pr-2 outline-none", "focus-visible:ring-1 focus-visible:ring-aurora-500", "pointer-coarse:active:bg-slate-100 dark:pointer-coarse:active:bg-metal-700"),
269
272
  children: [/* @__PURE__ */ a(v.span, {
270
273
  className: "flex size-9 shrink-0 items-center justify-center text-slate-800 dark:text-metal-50",
271
274
  style: { opacity: z },
272
- children: /* @__PURE__ */ a(mt, {
275
+ children: /* @__PURE__ */ a(yt, {
273
276
  "aria-hidden": "true",
274
277
  className: "size-5"
275
278
  })
276
- }), /* @__PURE__ */ b("span", {
279
+ }), /* @__PURE__ */ x("span", {
277
280
  className: "relative flex items-center",
278
281
  children: [/* @__PURE__ */ a(v.span, {
279
- className: m(de, q),
282
+ className: p(de, q),
280
283
  style: {
281
- x: _,
282
- opacity: L
284
+ x: X,
285
+ opacity: _
283
286
  },
284
287
  children: H
285
288
  }), g && /* @__PURE__ */ a(v.span, {
286
289
  "aria-hidden": "true",
287
290
  "data-sheet-preview-title": "",
288
- className: m("absolute left-0 whitespace-nowrap", de, q),
291
+ className: p("absolute left-0 whitespace-nowrap", de, q),
289
292
  style: {
290
293
  x: F,
291
294
  opacity: G
@@ -293,22 +296,22 @@ var Pe = {
293
296
  children: g.title
294
297
  })]
295
298
  })]
296
- }) }) : /* @__PURE__ */ b(Ce, { children: [Xe, /* @__PURE__ */ a("span", {
299
+ }) }) : /* @__PURE__ */ x(Pe, { children: [Xe, /* @__PURE__ */ a("span", {
297
300
  "aria-hidden": "true",
298
- className: m(de, q),
301
+ className: p(de, q),
299
302
  children: H
300
303
  })] })
301
304
  }, c)
302
305
  })]
303
306
  }),
304
307
  /* @__PURE__ */ a(v.div, {
305
- className: m("flex min-h-0 flex-col overflow-x-hidden", g || te ? "overflow-y-hidden" : "overflow-y-auto", we && "touch-none", te && "[mask-image:linear-gradient(to_bottom,black_calc(100%-var(--sheet-reveal)),transparent)]", s && "flex-1", Le),
308
+ className: p("flex min-h-0 flex-col overflow-x-hidden", g || te || $e ? "overflow-y-hidden" : "overflow-y-auto", Se && "touch-none", te && "[mask-image:linear-gradient(to_bottom,black_calc(100%-var(--sheet-reveal)),transparent)]", s && "flex-1", ze),
306
309
  style: { "--sheet-reveal": ae },
307
- animate: { height: s ? "auto" : ze },
308
- transition: ct,
309
- onAnimationComplete: st,
310
- children: /* @__PURE__ */ b("div", {
311
- ref: ot,
310
+ animate: { height: s ? "auto" : We },
311
+ transition: dt,
312
+ onAnimationComplete: ut,
313
+ children: /* @__PURE__ */ x("div", {
314
+ ref: ft,
312
315
  className: "relative",
313
316
  children: [g && /* @__PURE__ */ a(v.div, {
314
317
  ref: ve,
@@ -316,8 +319,8 @@ var Pe = {
316
319
  "data-sheet-preview": "",
317
320
  className: "pointer-events-none absolute inset-x-0 top-0 flex w-full flex-col",
318
321
  style: {
319
- x: D,
320
- opacity: X
322
+ x: L,
323
+ opacity: D
321
324
  },
322
325
  children: g.children
323
326
  }), /* @__PURE__ */ a(ue, {
@@ -325,27 +328,28 @@ var Pe = {
325
328
  initial: !1,
326
329
  custom: {
327
330
  direction: V,
328
- instant: !k
331
+ instant: !R
329
332
  },
330
- children: /* @__PURE__ */ a(pt, {
333
+ onExitComplete: () => xe(!1),
334
+ children: /* @__PURE__ */ a(xt, {
331
335
  step: c,
332
336
  direction: V,
333
- animated: !h && k,
334
- canSwipeBack: Se,
335
- onMount: nt,
336
- commitSignal: We,
337
- isArmed: Ze,
337
+ animated: !m && R,
338
+ canSwipeBack: Oe,
339
+ onMount: st,
340
+ commitSignal: Je,
341
+ isArmed: at,
338
342
  onBackStart: Be,
339
- onBackMove: et,
340
- onBackEnd: tt,
341
- onBackCommit: rt,
342
- onBackCancel: it,
343
+ onBackMove: rt,
344
+ onBackEnd: it,
345
+ onBackCommit: ot,
346
+ onBackCancel: lt,
343
347
  children: K
344
348
  }, c)
345
349
  })]
346
350
  })
347
351
  }),
348
- o === "top" && Ie
352
+ o === "top" && Ce
349
353
  ]
350
354
  })
351
355
  })]
@@ -353,7 +357,7 @@ var Pe = {
353
357
  }) })
354
358
  });
355
359
  };
356
- Nt.displayName = "KonstructSheet";
360
+ Bt.displayName = "KonstructSheet";
357
361
  export {
358
- Nt as Sheet
362
+ Bt as Sheet
359
363
  };