@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.
- package/dist/check-Bekes_eB.js +14 -0
- package/dist/components/CopyButton/CopyButton.js +12 -12
- package/dist/components/DateRangePicker/DateRangePicker.js +58 -57
- package/dist/components/DateRangePicker/DateRangePicker.variants.js +1 -0
- package/dist/components/DateRangePicker/components/CalendarPanel/CalendarPanel.js +55 -54
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.js +17 -17
- package/dist/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/components/CalendarMonthContent/CalendarMonthContent.js +15 -14
- package/dist/components/DateRangePicker/components/CalendarPanel/components/IndependentModeCalendar/IndependentModeCalendar.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.js +74 -55
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/constants/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/index.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useIndependentCarousel.js +1 -1
- package/dist/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.js +38 -38
- package/dist/components/DateRangePicker/components/CalendarPanel/utils/index.js +1 -1
- package/dist/components/DateRangePicker/components/DateTimeInputs/DateTimeInputs.js +60 -56
- package/dist/components/DateRangePicker/components/PresetPanel/PresetPanel.variants.js +21 -14
- package/dist/components/DateRangePicker/components/RightPanel/RightPanel.js +41 -25
- package/dist/components/DateRangePicker/contexts/date-range-picker/date-range-picker.provider.js +15 -14
- package/dist/components/Filter/Filter.variants.js +12 -7
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.js +39 -0
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.js +17 -14
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.js +48 -27
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Trigger/Trigger.js +13 -12
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/components/Wrapper/Wrapper.js +53 -17
- package/dist/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.provider.js +87 -78
- package/dist/components/Filter/components/FilterDropdown/FilterDropdown.js +44 -20
- package/dist/components/Filter/components/TextMultiSelect/TextMultiSelect.js +58 -50
- package/dist/components/Filter/hooks/index.js +5 -2
- package/dist/components/Filter/hooks/useFilterSheet.js +6 -0
- package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +18 -18
- package/dist/components/Sheet/Sheet.js +143 -139
- package/dist/components/Sheet/components/SheetStep/SheetStep.js +57 -55
- package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +1 -1
- package/dist/components/Stepper/components/HorizontalStepItem/HorizontalStepItem.js +42 -42
- package/dist/components/Stepper/components/StepIndicatorContent/StepIndicatorContent.js +25 -2
- package/dist/components/Stepper/components/VerticalStepItem/VerticalStepItem.js +1 -1
- package/dist/components/Tabs/Tabs.variants.js +4 -7
- package/dist/components/Tabs/components/Trigger.js +5 -5
- package/dist/components/Tooltip/Tooltip.js +17 -17
- package/dist/components/VirtualizedTable/components/Filter/Filter.js +40 -39
- package/dist/components/VirtualizedTable/components/Header/Header.js +2 -2
- package/dist/components/VirtualizedTable/constants/index.js +6 -5
- package/dist/components/VirtualizedTable/constants/responsive.js +2 -1
- package/dist/{constants-YCGllWdf.js → constants-Cw00eFTQ.js} +13 -13
- package/dist/lib/components/DateRangePicker/DateRangePicker.types.d.ts +6 -0
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/CalendarMonth/CalendarMonth.types.d.ts +2 -0
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/components/TogetherModeCalendar/TogetherModeCalendar.types.d.ts +2 -0
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/constants/dayPickerClassNames.d.ts +1 -1
- package/dist/lib/components/DateRangePicker/components/CalendarPanel/hooks/useTogetherCarousel.d.ts +3 -1
- package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.context.d.ts +2 -0
- package/dist/lib/components/DateRangePicker/contexts/date-range-picker/date-range-picker.types.d.ts +1 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.d.ts +3 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/MobilePresets/MobilePresets.types.d.ts +3 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.d.ts +2 -1
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/PanelActions/PanelActions.types.d.ts +4 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.d.ts +2 -1
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/components/Picker/Picker.types.d.ts +4 -0
- package/dist/lib/components/Filter/components/CustomDateRangeFilterDropdown/contexts/custom-date-range-filter-dropdown/custom-date-range-filter-dropdown.types.d.ts +2 -0
- package/dist/lib/components/Filter/components/FilterDropdown/FilterDropdown.types.d.ts +8 -0
- package/dist/lib/components/Filter/hooks/index.d.ts +1 -0
- package/dist/lib/components/Filter/hooks/useFilterSheet.d.ts +2 -0
- package/dist/lib/components/Sheet/Sheet.types.d.ts +12 -0
- package/dist/lib/components/Sheet/components/SheetStep/SheetStep.d.ts +21 -3
- package/dist/lib/components/VirtualizedTable/constants/responsive.d.ts +1 -0
- package/dist/package.json +18 -18
- package/dist/styles.css +1 -1
- package/dist/ui/utilities.css +23 -0
- package/package.json +18 -18
- package/dist/StepIndicatorContent-C6MILk4c.js +0 -36
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import { t as
|
|
5
|
-
import { SheetStep as
|
|
6
|
-
import { resolveSheetGesture as
|
|
7
|
-
import { useCallback as
|
|
8
|
-
import { Fragment as
|
|
9
|
-
import { AnimatePresence as ue, animate as u, motion as v, useMotionValue as
|
|
10
|
-
var
|
|
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
|
-
},
|
|
13
|
+
}, Te = {
|
|
14
14
|
type: "spring",
|
|
15
15
|
stiffness: 380,
|
|
16
16
|
damping: 38
|
|
17
|
-
}, j = { duration: 0 },
|
|
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:
|
|
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:
|
|
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",
|
|
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
|
-
},
|
|
37
|
-
const
|
|
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
|
-
}),
|
|
42
|
-
U.current.step !== c && (
|
|
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,
|
|
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
|
-
|
|
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 && !
|
|
58
|
+
}), Y.current = !1, xe(!0), ie.current = _e && e && !m && !s ? be.current : null;
|
|
59
59
|
}
|
|
60
|
-
const { direction: V, animated:
|
|
61
|
-
|
|
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
|
-
|
|
64
|
-
Z(null),
|
|
65
|
-
}, [c]),
|
|
66
|
-
|
|
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
|
|
68
|
+
const Re = o === "bottom" ? "100%" : "-100%", Ye = m ? {
|
|
69
69
|
initial: !1,
|
|
70
70
|
animate: { y: 0 }
|
|
71
71
|
} : {
|
|
72
|
-
initial: { y:
|
|
72
|
+
initial: { y: Re },
|
|
73
73
|
animate: { y: 0 },
|
|
74
|
-
exit: { y:
|
|
75
|
-
},
|
|
76
|
-
ae.set(
|
|
77
|
-
},
|
|
78
|
-
const t = e.pointerType !== "mouse" || e.button === 0, n =
|
|
79
|
-
J.current = t && (n ||
|
|
80
|
-
}, He = (e) => (
|
|
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
|
-
|
|
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
|
-
},
|
|
90
|
-
const n =
|
|
89
|
+
}, tt = (e, t) => {
|
|
90
|
+
const n = P.current;
|
|
91
91
|
if (!n) return;
|
|
92
|
-
const
|
|
92
|
+
const w = t.offset.y * ce;
|
|
93
93
|
if (!N) {
|
|
94
|
-
|
|
94
|
+
O.set(w >= 0 ? t.offset.y : t.offset.y * Ot);
|
|
95
95
|
return;
|
|
96
96
|
}
|
|
97
|
-
const y = n.startHeight -
|
|
97
|
+
const y = n.startHeight - w;
|
|
98
98
|
if (y >= n.restHeight) {
|
|
99
|
-
d.set(Math.min(y, n.maxHeight)),
|
|
99
|
+
d.set(Math.min(y, n.maxHeight)), O.set(0);
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
d.set(n.restHeight),
|
|
102
|
+
d.set(n.restHeight), O.set((n.restHeight - y) * ce);
|
|
103
103
|
}, oe = (e, t, n) => {
|
|
104
|
-
if (u(
|
|
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
|
-
},
|
|
117
|
-
const n =
|
|
116
|
+
}, nt = (e, t) => {
|
|
117
|
+
const n = P.current;
|
|
118
118
|
if (!n) return;
|
|
119
|
-
|
|
120
|
-
const
|
|
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
|
-
|
|
130
|
-
},
|
|
131
|
-
const t =
|
|
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:
|
|
135
|
+
titleOutX: S * e,
|
|
136
136
|
titleOutOpacity: 1 - e,
|
|
137
|
-
titleInX: (n ? 0 : -36) * 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 (
|
|
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
|
-
|
|
145
|
+
C(n + (k.current - n) * e);
|
|
146
146
|
}
|
|
147
|
-
},
|
|
147
|
+
}, Ie = (e) => {
|
|
148
148
|
const t = Ne(e);
|
|
149
|
-
u(
|
|
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,
|
|
152
|
-
|
|
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
|
-
},
|
|
155
|
-
const t =
|
|
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
|
|
161
|
-
},
|
|
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 &&
|
|
164
|
-
},
|
|
165
|
-
if (ee !== "idle" || !
|
|
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
|
-
},
|
|
173
|
+
}, ot = () => {
|
|
171
174
|
Y.current = !0, W?.();
|
|
172
|
-
},
|
|
173
|
-
Z(null),
|
|
174
|
-
},
|
|
175
|
+
}, lt = () => {
|
|
176
|
+
Z(null), E("idle"), ke();
|
|
177
|
+
}, ut = () => {
|
|
175
178
|
!te || ee === "dragging" || re.current || (re.current = !0, u(ae, "0px", {
|
|
176
|
-
...
|
|
179
|
+
...m ? j : At,
|
|
177
180
|
onComplete: () => ye(!1)
|
|
178
181
|
}));
|
|
179
|
-
},
|
|
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":
|
|
184
|
-
className:
|
|
185
|
-
children: /* @__PURE__ */ a("div", { className:
|
|
186
|
-
}),
|
|
187
|
-
if (he.current = e,
|
|
188
|
-
me(!1),
|
|
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,
|
|
195
|
+
be.current = n, C(n);
|
|
193
196
|
};
|
|
194
|
-
t(e.getBoundingClientRect().height), typeof ResizeObserver < "u" && (
|
|
197
|
+
t(e.getBoundingClientRect().height), typeof ResizeObserver < "u" && (I.current = new ResizeObserver(([n]) => {
|
|
195
198
|
n && t(n.contentRect.height);
|
|
196
|
-
}),
|
|
199
|
+
}), I.current.observe(e)), B.current = requestAnimationFrame(() => {
|
|
197
200
|
me(!0);
|
|
198
201
|
});
|
|
199
202
|
}, []);
|
|
200
|
-
return /* @__PURE__ */ a(
|
|
203
|
+
return /* @__PURE__ */ a(vt, {
|
|
201
204
|
open: i,
|
|
202
205
|
onOpenChange: (e) => !e && fe(),
|
|
203
|
-
children: /* @__PURE__ */ a(ue, { children: i && /* @__PURE__ */ a(
|
|
206
|
+
children: /* @__PURE__ */ a(ue, { children: i && /* @__PURE__ */ a(mt, {
|
|
204
207
|
forceMount: !0,
|
|
205
|
-
children: /* @__PURE__ */
|
|
206
|
-
"data-theme":
|
|
208
|
+
children: /* @__PURE__ */ x("div", {
|
|
209
|
+
"data-theme": je,
|
|
207
210
|
className: "contents",
|
|
208
|
-
children: [/* @__PURE__ */ a(
|
|
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:
|
|
219
|
+
transition: Me
|
|
217
220
|
})
|
|
218
|
-
}), /* @__PURE__ */ a(
|
|
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__ */
|
|
227
|
+
children: /* @__PURE__ */ x(v.div, {
|
|
225
228
|
ref: A,
|
|
226
229
|
tabIndex: -1,
|
|
227
|
-
className:
|
|
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:
|
|
235
|
+
y: O,
|
|
233
236
|
height: d
|
|
234
237
|
},
|
|
235
|
-
transition:
|
|
236
|
-
onPointerDownCapture:
|
|
237
|
-
onPanStart:
|
|
238
|
-
onPan:
|
|
239
|
-
onPanEnd:
|
|
240
|
-
|
|
238
|
+
transition: Me,
|
|
239
|
+
onPointerDownCapture: Ze,
|
|
240
|
+
onPanStart: et,
|
|
241
|
+
onPan: tt,
|
|
242
|
+
onPanEnd: nt,
|
|
243
|
+
...Ye,
|
|
241
244
|
children: [
|
|
242
|
-
o === "bottom" &&
|
|
243
|
-
/* @__PURE__ */
|
|
244
|
-
className:
|
|
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(
|
|
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: !
|
|
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: !
|
|
260
|
-
initial: !
|
|
262
|
+
variants: !m && R ? Et : void 0,
|
|
263
|
+
initial: !m && R ? "enter" : !1,
|
|
261
264
|
animate: "center",
|
|
262
|
-
exit: !
|
|
265
|
+
exit: !m && R ? "exit" : void 0,
|
|
263
266
|
transition: l,
|
|
264
|
-
children:
|
|
267
|
+
children: Oe ? /* @__PURE__ */ a(Pe, { children: /* @__PURE__ */ x("button", {
|
|
265
268
|
type: "button",
|
|
266
269
|
"data-sheet-back": "",
|
|
267
|
-
onClick:
|
|
268
|
-
className:
|
|
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(
|
|
275
|
+
children: /* @__PURE__ */ a(yt, {
|
|
273
276
|
"aria-hidden": "true",
|
|
274
277
|
className: "size-5"
|
|
275
278
|
})
|
|
276
|
-
}), /* @__PURE__ */
|
|
279
|
+
}), /* @__PURE__ */ x("span", {
|
|
277
280
|
className: "relative flex items-center",
|
|
278
281
|
children: [/* @__PURE__ */ a(v.span, {
|
|
279
|
-
className:
|
|
282
|
+
className: p(de, q),
|
|
280
283
|
style: {
|
|
281
|
-
x:
|
|
282
|
-
opacity:
|
|
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:
|
|
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__ */
|
|
299
|
+
}) }) : /* @__PURE__ */ x(Pe, { children: [Xe, /* @__PURE__ */ a("span", {
|
|
297
300
|
"aria-hidden": "true",
|
|
298
|
-
className:
|
|
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:
|
|
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" :
|
|
308
|
-
transition:
|
|
309
|
-
onAnimationComplete:
|
|
310
|
-
children: /* @__PURE__ */
|
|
311
|
-
ref:
|
|
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:
|
|
320
|
-
opacity:
|
|
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: !
|
|
331
|
+
instant: !R
|
|
329
332
|
},
|
|
330
|
-
|
|
333
|
+
onExitComplete: () => xe(!1),
|
|
334
|
+
children: /* @__PURE__ */ a(xt, {
|
|
331
335
|
step: c,
|
|
332
336
|
direction: V,
|
|
333
|
-
animated: !
|
|
334
|
-
canSwipeBack:
|
|
335
|
-
onMount:
|
|
336
|
-
commitSignal:
|
|
337
|
-
isArmed:
|
|
337
|
+
animated: !m && R,
|
|
338
|
+
canSwipeBack: Oe,
|
|
339
|
+
onMount: st,
|
|
340
|
+
commitSignal: Je,
|
|
341
|
+
isArmed: at,
|
|
338
342
|
onBackStart: Be,
|
|
339
|
-
onBackMove:
|
|
340
|
-
onBackEnd:
|
|
341
|
-
onBackCommit:
|
|
342
|
-
onBackCancel:
|
|
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" &&
|
|
352
|
+
o === "top" && Ce
|
|
349
353
|
]
|
|
350
354
|
})
|
|
351
355
|
})]
|
|
@@ -353,7 +357,7 @@ var Pe = {
|
|
|
353
357
|
}) })
|
|
354
358
|
});
|
|
355
359
|
};
|
|
356
|
-
|
|
360
|
+
Bt.displayName = "KonstructSheet";
|
|
357
361
|
export {
|
|
358
|
-
|
|
362
|
+
Bt as Sheet
|
|
359
363
|
};
|