@bzync/rui 0.0.4 → 0.0.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/README.md +10 -0
- package/dist/autocomplete-D6z5B-WU.cjs +1 -0
- package/dist/{autocomplete-BgKbj6M4.js → autocomplete-bgySuP8X.js} +149 -142
- package/dist/calendar-CQumLNgS.cjs +1 -0
- package/dist/{calendar-j2_zvum1.js → calendar-nkYCMEy3.js} +9 -9
- package/dist/charts-Cot5lCgC.cjs +1 -0
- package/dist/{charts-CxEy2c3M.js → charts-Dscl6UC3.js} +122 -145
- package/dist/cn-B6R3HKzx.cjs +1 -0
- package/dist/{cn-DpgY2leY.js → cn-BJyZJP-y.js} +389 -389
- package/dist/{component-styles-Bgy44fc8.js → component-styles-C2CbHEEA.js} +2 -2
- package/dist/component-styles-DY4wigiq.cjs +1 -0
- package/dist/components/accordion.cjs +1 -1
- package/dist/components/accordion.js +2 -2
- package/dist/components/alert.cjs +1 -1
- package/dist/components/alert.js +3 -3
- package/dist/components/aspect-ratio.cjs +1 -0
- package/dist/components/aspect-ratio.d.ts +5 -0
- package/dist/components/aspect-ratio.js +20 -0
- package/dist/components/auth-backdrop.cjs +1 -1
- package/dist/components/auth-backdrop.d.ts +4 -1
- package/dist/components/auth-backdrop.js +12 -8
- package/dist/components/autocomplete/dropdown.d.ts +4 -1
- package/dist/components/autocomplete/multi-trigger.d.ts +3 -1
- package/dist/components/autocomplete/single-trigger.d.ts +3 -1
- package/dist/components/autocomplete/types.d.ts +15 -0
- package/dist/components/autocomplete.cjs +1 -1
- package/dist/components/autocomplete.js +1 -1
- package/dist/components/avatar-group.cjs +1 -0
- package/dist/components/avatar-group.d.ts +14 -0
- package/dist/components/avatar-group.js +35 -0
- package/dist/components/avatar.cjs +1 -1
- package/dist/components/avatar.js +2 -2
- package/dist/components/badge.cjs +1 -1
- package/dist/components/badge.js +1 -1
- package/dist/components/billing-interval-toggle.cjs +1 -1
- package/dist/components/billing-interval-toggle.d.ts +4 -6
- package/dist/components/billing-interval-toggle.js +26 -19
- package/dist/components/blockquote.cjs +1 -0
- package/dist/components/blockquote.d.ts +10 -0
- package/dist/components/blockquote.js +32 -0
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +2 -2
- package/dist/components/button-group.cjs +1 -0
- package/dist/components/button-group.d.ts +7 -0
- package/dist/components/button-group.js +26 -0
- package/dist/components/button.cjs +1 -1
- package/dist/components/button.d.ts +2 -0
- package/dist/components/button.js +79 -36
- package/dist/components/calendar.cjs +1 -1
- package/dist/components/calendar.js +1 -1
- package/dist/components/callout.cjs +1 -1
- package/dist/components/callout.js +14 -14
- package/dist/components/card.cjs +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/charts/shared.d.ts +15 -0
- package/dist/components/charts.cjs +1 -1
- package/dist/components/charts.js +1 -1
- package/dist/components/checkbox.cjs +1 -1
- package/dist/components/checkbox.js +3 -3
- package/dist/components/code.cjs +3 -3
- package/dist/components/code.d.ts +4 -4
- package/dist/components/code.js +62 -60
- package/dist/components/command.cjs +1 -1
- package/dist/components/command.d.ts +8 -1
- package/dist/components/command.js +84 -83
- package/dist/components/confirm-dialog.cjs +1 -1
- package/dist/components/confirm-dialog.d.ts +8 -1
- package/dist/components/confirm-dialog.js +37 -31
- package/dist/components/copy-button.cjs +1 -1
- package/dist/components/copy-button.js +5 -4
- package/dist/components/currency.cjs +1 -0
- package/dist/components/currency.d.ts +18 -0
- package/dist/components/currency.js +62 -0
- package/dist/components/datatable/types.d.ts +4 -0
- package/dist/components/datatable.cjs +1 -1
- package/dist/components/datatable.d.ts +1 -5
- package/dist/components/datatable.js +1 -1
- package/dist/components/datepicker.cjs +1 -1
- package/dist/components/datepicker.d.ts +3 -3
- package/dist/components/datepicker.js +234 -105
- package/dist/components/description-list.cjs +1 -0
- package/dist/components/description-list.d.ts +14 -0
- package/dist/components/description-list.js +38 -0
- package/dist/components/divider.cjs +1 -0
- package/dist/components/divider.d.ts +12 -0
- package/dist/components/divider.js +45 -0
- package/dist/components/drawer.cjs +1 -1
- package/dist/components/drawer.d.ts +6 -1
- package/dist/components/drawer.js +128 -2
- package/dist/components/dropdown-menu-panel.cjs +1 -0
- package/dist/components/dropdown-menu-panel.d.ts +24 -0
- package/dist/components/dropdown-menu-panel.js +84 -0
- package/dist/components/dropdown-menu.cjs +1 -1
- package/dist/components/dropdown-menu.d.ts +5 -1
- package/dist/components/dropdown-menu.js +38 -93
- package/dist/components/empty-state.cjs +1 -1
- package/dist/components/empty-state.d.ts +5 -1
- package/dist/components/empty-state.js +9 -9
- package/dist/components/error-state.cjs +1 -1
- package/dist/components/error-state.js +2 -2
- package/dist/components/file-upload.cjs +1 -1
- package/dist/components/file-upload.js +4 -4
- package/dist/components/form-field.cjs +1 -1
- package/dist/components/form-field.d.ts +9 -0
- package/dist/components/form-field.js +49 -14
- package/dist/components/info-button.cjs +1 -1
- package/dist/components/info-button.d.ts +5 -3
- package/dist/components/info-button.js +33 -29
- package/dist/components/input.cjs +1 -1
- package/dist/components/input.js +3 -3
- package/dist/components/kbd.cjs +1 -1
- package/dist/components/kbd.js +1 -1
- package/dist/components/label.cjs +1 -1
- package/dist/components/label.js +2 -2
- package/dist/components/layout.cjs +1 -1
- package/dist/components/layout.js +1 -1
- package/dist/components/link.cjs +1 -1
- package/dist/components/link.js +1 -1
- package/dist/components/list.cjs +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/modal.cjs +1 -1
- package/dist/components/modal.d.ts +8 -1
- package/dist/components/modal.js +74 -120
- package/dist/components/navigation.cjs +1 -1
- package/dist/components/navigation.js +2 -2
- package/dist/components/number-input.cjs +1 -1
- package/dist/components/number-input.js +3 -3
- package/dist/components/otp-input.cjs +1 -1
- package/dist/components/otp-input.js +2 -2
- package/dist/components/overlay.cjs +1 -0
- package/dist/components/overlay.d.ts +52 -0
- package/dist/components/overlay.js +87 -0
- package/dist/components/pagination.cjs +1 -1
- package/dist/components/pagination.js +2 -2
- package/dist/components/popover.cjs +1 -1
- package/dist/components/popover.d.ts +2 -1
- package/dist/components/popover.js +41 -40
- package/dist/components/progressbar.cjs +1 -1
- package/dist/components/progressbar.js +1 -1
- package/dist/components/radio.cjs +1 -1
- package/dist/components/radio.js +3 -3
- package/dist/components/rating.cjs +1 -0
- package/dist/components/rating.d.ts +15 -0
- package/dist/components/rating.js +75 -0
- package/dist/components/richtext.cjs +1 -1
- package/dist/components/richtext.js +2 -2
- package/dist/components/scroll-area.cjs +1 -0
- package/dist/components/scroll-area.d.ts +8 -0
- package/dist/components/scroll-area.js +19 -0
- package/dist/components/select/option-list.d.ts +3 -1
- package/dist/components/select/types.d.ts +4 -0
- package/dist/components/select.cjs +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/seo.cjs +1 -1
- package/dist/components/seo.js +1 -1
- package/dist/components/separator.cjs +1 -1
- package/dist/components/separator.js +1 -1
- package/dist/components/skeleton.cjs +1 -1
- package/dist/components/skeleton.d.ts +14 -1
- package/dist/components/skeleton.js +56 -4
- package/dist/components/slider.cjs +1 -1
- package/dist/components/slider.js +2 -2
- package/dist/components/slot.cjs +1 -0
- package/dist/components/slot.d.ts +12 -0
- package/dist/components/slot.js +16 -0
- package/dist/components/snackbar-viewport.cjs +1 -0
- package/dist/components/snackbar-viewport.d.ts +27 -0
- package/dist/components/snackbar-viewport.js +181 -0
- package/dist/components/snackbar.cjs +1 -1
- package/dist/components/snackbar.d.ts +5 -1
- package/dist/components/snackbar.js +36 -200
- package/dist/components/spinner.cjs +1 -1
- package/dist/components/spinner.js +1 -1
- package/dist/components/stat.cjs +1 -1
- package/dist/components/stat.js +1 -1
- package/dist/components/status-dot.cjs +1 -1
- package/dist/components/status-dot.js +1 -1
- package/dist/components/stepper.cjs +1 -1
- package/dist/components/stepper.js +5 -5
- package/dist/components/switch.cjs +1 -1
- package/dist/components/switch.js +37 -43
- package/dist/components/table.cjs +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tabs.cjs +1 -1
- package/dist/components/tabs.d.ts +6 -4
- package/dist/components/tabs.js +51 -81
- package/dist/components/tag.cjs +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/terminal.cjs +1 -1
- package/dist/components/terminal.js +1 -1
- package/dist/components/textarea.cjs +1 -1
- package/dist/components/textarea.js +3 -3
- package/dist/components/theme-provider.cjs +1 -1
- package/dist/components/theme-provider.js +1 -1
- package/dist/components/theme-toggle.cjs +1 -1
- package/dist/components/theme-toggle.js +27 -3
- package/dist/components/time-picker.cjs +1 -0
- package/dist/components/time-picker.d.ts +31 -0
- package/dist/components/time-picker.js +394 -0
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle.cjs +1 -0
- package/dist/components/toggle.d.ts +42 -0
- package/dist/components/toggle.js +116 -0
- package/dist/components/tooltip.cjs +1 -1
- package/dist/components/tooltip.d.ts +2 -1
- package/dist/components/tooltip.js +37 -36
- package/dist/components/tree.cjs +1 -1
- package/dist/components/tree.js +1 -1
- package/dist/components/typography.cjs +1 -0
- package/dist/components/typography.d.ts +50 -0
- package/dist/components/typography.js +202 -0
- package/dist/components/visually-hidden.cjs +1 -0
- package/dist/components/visually-hidden.d.ts +16 -0
- package/dist/components/visually-hidden.js +13 -0
- package/dist/{datatable-yBN4M3UV.js → datatable-BJoZMrKI.js} +6 -6
- package/dist/datatable-t0U7t_xh.cjs +1 -0
- package/dist/icons-Dfetr1L2.cjs +1 -0
- package/dist/icons-Dk7VZ4Ph.js +51 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +16 -0
- package/dist/index.js +125 -86
- package/dist/lib/cn.d.ts +13 -1
- package/dist/lib/component-styles.d.ts +14 -2
- package/dist/lib/icons.d.ts +12 -0
- package/dist/lib/motion.d.ts +58 -0
- package/dist/motion-B2shivEB.cjs +1 -0
- package/dist/motion-gnRzFS5f.js +62 -0
- package/dist/select-ByjnuEcE.cjs +1 -0
- package/dist/{select-ClWrcj3R.js → select-CiMzLhUK.js} +128 -122
- package/dist/styles.css +1 -1
- package/dist/{terminal-CpraMs50.cjs → terminal-1U0ftG3i.cjs} +2 -2
- package/dist/{terminal-BOR2cFi1.js → terminal-VXdxVoAv.js} +4 -4
- package/dist/use-focus-trap-CPLT49gN.cjs +1 -0
- package/dist/use-focus-trap-CS6BXJAB.js +77 -0
- package/dist/{utils-CQ8pvCtk.js → utils-DEw5mQrH.js} +1 -1
- package/dist/{utils-DOFJTw8o.cjs → utils-MnnCTelh.cjs} +1 -1
- package/package.json +56 -9
- package/dist/autocomplete-Bk4pRQ2R.cjs +0 -1
- package/dist/calendar-CUXpVrVE.cjs +0 -1
- package/dist/charts-UDqS1BH1.cjs +0 -1
- package/dist/cn-BdjraxxU.cjs +0 -1
- package/dist/component-styles-DOUctc8_.cjs +0 -1
- package/dist/createLucideIcon-DDY8HuQR.js +0 -42
- package/dist/createLucideIcon-b_X_3fj-.cjs +0 -1
- package/dist/datatable-rzDgQ3r6.cjs +0 -1
- package/dist/drawer-CTeBsYrO.cjs +0 -1
- package/dist/drawer-ixuzyLVS.js +0 -189
- package/dist/select-BFwx--uK.cjs +0 -1
- package/dist/theme-toggle-Bb0BYo51.js +0 -71
- package/dist/theme-toggle-Cld8tktJ.cjs +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { c as t, o as n, t as r } from "../component-styles-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { c as t, o as n, t as r } from "../component-styles-C2CbHEEA.js";
|
|
4
4
|
import { AnimatePresence as i, motion as a } from "framer-motion";
|
|
5
|
-
import {
|
|
6
|
-
import { jsx as
|
|
5
|
+
import { forwardRef as o, useEffect as s, useId as ee, useImperativeHandle as c, useLayoutEffect as te, useRef as l, useState as u } from "react";
|
|
6
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/datepicker.tsx
|
|
8
|
-
var
|
|
8
|
+
var ne = [
|
|
9
9
|
"Su",
|
|
10
10
|
"Mo",
|
|
11
11
|
"Tu",
|
|
@@ -13,7 +13,7 @@ var f = [
|
|
|
13
13
|
"Th",
|
|
14
14
|
"Fr",
|
|
15
15
|
"Sa"
|
|
16
|
-
],
|
|
16
|
+
], m = [
|
|
17
17
|
"January",
|
|
18
18
|
"February",
|
|
19
19
|
"March",
|
|
@@ -27,65 +27,140 @@ var f = [
|
|
|
27
27
|
"November",
|
|
28
28
|
"December"
|
|
29
29
|
];
|
|
30
|
-
function
|
|
31
|
-
return `${
|
|
30
|
+
function h(e) {
|
|
31
|
+
return `${m[e.getMonth()].slice(0, 3)} ${e.getDate()}, ${e.getFullYear()}`;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function g(e, t) {
|
|
34
34
|
return new Date(e, t + 1, 0).getDate();
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function _(e, t) {
|
|
37
37
|
return new Date(e, t, 1).getDay();
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function v(e, t) {
|
|
40
40
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
function y(e) {
|
|
43
|
+
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
44
|
+
}
|
|
45
|
+
var b = o(({ value: o, onChange: b, label: x, hint: S, error: C, placeholder: w = "Select date…", disabled: T, clearable: E = !0, minDate: D, maxDate: O, className: k, ...re }, ie) => {
|
|
46
|
+
let [ae, A] = u(null), j = o === void 0 ? ae : o, M = /* @__PURE__ */ new Date(), [N, P] = u(!1), [F, I] = u((j ?? M).getFullYear()), [L, R] = u((j ?? M).getMonth()), [z, B] = u(j ?? M), [V, H] = u({ visibility: "hidden" }), U = l(null), W = l(null), G = l(null);
|
|
47
|
+
c(ie, () => U.current);
|
|
48
|
+
let K = ee(), q = `${K}-dialog`, J = `${K}-message`;
|
|
49
|
+
function Y(e) {
|
|
50
|
+
return !!(D && e < D || O && e > O);
|
|
51
|
+
}
|
|
52
|
+
function X(e) {
|
|
53
|
+
if (Y(e)) return;
|
|
54
|
+
let t = e.getFullYear() === F && e.getMonth() === L;
|
|
55
|
+
if (B(e), I(e.getFullYear()), R(e.getMonth()), t) {
|
|
56
|
+
G.current?.querySelector(`[data-date="${y(e)}"]`)?.focus({ preventScroll: !0 });
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
60
|
+
G.current?.querySelector(`[data-date="${y(e)}"]`)?.focus({ preventScroll: !0 });
|
|
61
|
+
}));
|
|
62
|
+
}
|
|
63
|
+
function oe() {
|
|
64
|
+
return j && !Y(j) ? j : Y(M) ? D && (!O || D <= O) ? D : O ?? M : M;
|
|
65
|
+
}
|
|
66
|
+
function se() {
|
|
67
|
+
let e = oe();
|
|
68
|
+
B(e), I(e.getFullYear()), R(e.getMonth()), H({ visibility: "hidden" }), P(!0), requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
69
|
+
G.current?.querySelector(`[data-date="${y(e)}"]`)?.focus({ preventScroll: !0 });
|
|
70
|
+
}));
|
|
46
71
|
}
|
|
47
|
-
function
|
|
48
|
-
|
|
72
|
+
function Z(e = !1) {
|
|
73
|
+
P(!1), e && requestAnimationFrame(() => W.current?.focus());
|
|
49
74
|
}
|
|
50
|
-
function
|
|
51
|
-
|
|
75
|
+
function ce(e) {
|
|
76
|
+
o === void 0 && A(e), b?.(e), Z(!0);
|
|
52
77
|
}
|
|
53
|
-
function
|
|
54
|
-
|
|
78
|
+
function le() {
|
|
79
|
+
o === void 0 && A(null), b?.(null);
|
|
55
80
|
}
|
|
56
|
-
|
|
81
|
+
function Q(e, t) {
|
|
82
|
+
let n = new Date(e, t, 1), r = new Date(e, t + 1, 0, 23, 59, 59, 999);
|
|
83
|
+
return !(D && D > r) && !(O && O < n);
|
|
84
|
+
}
|
|
85
|
+
function $(e) {
|
|
86
|
+
let t = new Date(F, L + e, 1), n = t.getFullYear(), r = t.getMonth();
|
|
87
|
+
if (!Q(n, r)) return;
|
|
88
|
+
let i = new Date(n, r, Math.min(z.getDate(), g(n, r)));
|
|
89
|
+
D && i < D && D.getFullYear() === n && D.getMonth() === r && (i = new Date(n, r, D.getDate())), O && i > O && O.getFullYear() === n && O.getMonth() === r && (i = new Date(n, r, O.getDate())), I(n), R(r), B(i);
|
|
90
|
+
}
|
|
91
|
+
s(() => {
|
|
57
92
|
function e(e) {
|
|
58
|
-
|
|
93
|
+
U.current?.contains(e.target) || Z();
|
|
59
94
|
}
|
|
60
95
|
function t(e) {
|
|
61
|
-
e.key === "Escape" &&
|
|
96
|
+
e.key === "Escape" && N && (e.preventDefault(), Z(!0));
|
|
62
97
|
}
|
|
63
98
|
return document.addEventListener("mousedown", e), document.addEventListener("keydown", t), () => {
|
|
64
99
|
document.removeEventListener("mousedown", e), document.removeEventListener("keydown", t);
|
|
65
100
|
};
|
|
66
|
-
}, [])
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
101
|
+
}, [N]), te(() => {
|
|
102
|
+
if (!N) return;
|
|
103
|
+
let e = () => {
|
|
104
|
+
let e = W.current, t = G.current;
|
|
105
|
+
if (!e || !t) return;
|
|
106
|
+
let n = t.getBoundingClientRect();
|
|
107
|
+
if (window.innerWidth < 640) {
|
|
108
|
+
H({
|
|
109
|
+
insetInline: 8,
|
|
110
|
+
bottom: 8,
|
|
111
|
+
top: "auto",
|
|
112
|
+
width: "auto",
|
|
113
|
+
visibility: "visible"
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
let r = e.getBoundingClientRect(), i = Math.min(Math.max(r.left, 16), Math.max(16, window.innerWidth - n.width - 16)), a = r.bottom + 6, o = r.top - n.height - 6, s = a + n.height <= window.innerHeight - 16 || o < 16 ? a : o;
|
|
118
|
+
H({
|
|
119
|
+
left: i,
|
|
120
|
+
top: Math.min(Math.max(s, 16), Math.max(16, window.innerHeight - n.height - 16)),
|
|
121
|
+
visibility: "visible"
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
return e(), window.addEventListener("resize", e), document.addEventListener("scroll", e, !0), () => {
|
|
125
|
+
window.removeEventListener("resize", e), document.removeEventListener("scroll", e, !0);
|
|
126
|
+
};
|
|
127
|
+
}, [N]), s(() => {
|
|
128
|
+
if (!N || window.innerWidth >= 640) return;
|
|
129
|
+
let e = document.body.style.overflow;
|
|
130
|
+
return document.body.style.overflow = "hidden", () => {
|
|
131
|
+
document.body.style.overflow = e;
|
|
132
|
+
};
|
|
133
|
+
}, [N]);
|
|
134
|
+
function ue(e, t) {
|
|
135
|
+
let n;
|
|
136
|
+
e.key === "ArrowLeft" ? n = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 1) : e.key === "ArrowRight" ? n = new Date(t.getFullYear(), t.getMonth(), t.getDate() + 1) : e.key === "ArrowUp" ? n = new Date(t.getFullYear(), t.getMonth(), t.getDate() - 7) : e.key === "ArrowDown" ? n = new Date(t.getFullYear(), t.getMonth(), t.getDate() + 7) : e.key === "Home" ? n = new Date(t.getFullYear(), t.getMonth(), t.getDate() - t.getDay()) : e.key === "End" ? n = new Date(t.getFullYear(), t.getMonth(), t.getDate() + (6 - t.getDay())) : e.key === "PageUp" ? n = new Date(t.getFullYear(), t.getMonth() - 1, Math.min(t.getDate(), g(t.getFullYear(), t.getMonth() - 1))) : e.key === "PageDown" && (n = new Date(t.getFullYear(), t.getMonth() + 1, Math.min(t.getDate(), g(t.getFullYear(), t.getMonth() + 1)))), n && (e.preventDefault(), X(n));
|
|
137
|
+
}
|
|
138
|
+
let de = g(F, L), fe = _(F, L), pe = [...Array(fe).fill(null), ...Array.from({ length: de }, (e, t) => t + 1)];
|
|
139
|
+
return /* @__PURE__ */ p("div", {
|
|
140
|
+
ref: U,
|
|
141
|
+
className: e("relative", n, k),
|
|
142
|
+
...re,
|
|
71
143
|
children: [
|
|
72
|
-
|
|
73
|
-
htmlFor:
|
|
144
|
+
x && /* @__PURE__ */ f("label", {
|
|
145
|
+
htmlFor: K,
|
|
74
146
|
className: "text-xs font-semibold leading-5 text-foreground",
|
|
75
|
-
children:
|
|
147
|
+
children: x
|
|
76
148
|
}),
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
149
|
+
/* @__PURE__ */ p("div", {
|
|
150
|
+
className: e("flex h-11 w-full items-center rounded-[var(--radius-md)] sm:h-9", r, C && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", T && "cursor-not-allowed opacity-50"),
|
|
151
|
+
children: [/* @__PURE__ */ p("button", {
|
|
152
|
+
ref: W,
|
|
153
|
+
type: "button",
|
|
154
|
+
id: K,
|
|
155
|
+
"aria-expanded": N,
|
|
156
|
+
"aria-haspopup": "dialog",
|
|
157
|
+
"aria-controls": q,
|
|
158
|
+
"aria-invalid": C ? !0 : void 0,
|
|
159
|
+
"aria-describedby": C || S ? J : void 0,
|
|
160
|
+
disabled: T,
|
|
161
|
+
onClick: () => N ? Z() : se(),
|
|
162
|
+
className: "flex h-full min-w-0 flex-1 items-center gap-2 rounded-[var(--radius-md)] px-3 text-left outline-none focus-visible:ring-[3px] focus-visible:ring-focus-ring/35",
|
|
163
|
+
children: [/* @__PURE__ */ p("svg", {
|
|
89
164
|
width: "14",
|
|
90
165
|
height: "14",
|
|
91
166
|
viewBox: "0 0 24 24",
|
|
@@ -96,7 +171,7 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
96
171
|
strokeLinejoin: "round",
|
|
97
172
|
className: "text-slate-500 shrink-0",
|
|
98
173
|
children: [
|
|
99
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ f("rect", {
|
|
100
175
|
width: "18",
|
|
101
176
|
height: "18",
|
|
102
177
|
x: "3",
|
|
@@ -104,50 +179,58 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
104
179
|
rx: "2",
|
|
105
180
|
ry: "2"
|
|
106
181
|
}),
|
|
107
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ f("line", {
|
|
108
183
|
x1: "16",
|
|
109
184
|
x2: "16",
|
|
110
185
|
y1: "2",
|
|
111
186
|
y2: "6"
|
|
112
187
|
}),
|
|
113
|
-
/* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ f("line", {
|
|
114
189
|
x1: "8",
|
|
115
190
|
x2: "8",
|
|
116
191
|
y1: "2",
|
|
117
192
|
y2: "6"
|
|
118
193
|
}),
|
|
119
|
-
/* @__PURE__ */
|
|
194
|
+
/* @__PURE__ */ f("line", {
|
|
120
195
|
x1: "3",
|
|
121
196
|
x2: "21",
|
|
122
197
|
y1: "10",
|
|
123
198
|
y2: "10"
|
|
124
199
|
})
|
|
125
200
|
]
|
|
126
|
-
}),
|
|
127
|
-
/* @__PURE__ */ u("span", {
|
|
201
|
+
}), /* @__PURE__ */ f("span", {
|
|
128
202
|
className: e("flex-1 text-sm truncate", j ? "text-foreground" : "text-muted-foreground"),
|
|
129
|
-
children: j ?
|
|
130
|
-
})
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
})
|
|
203
|
+
children: j ? h(j) : w
|
|
204
|
+
})]
|
|
205
|
+
}), E && j && !T && /* @__PURE__ */ f("button", {
|
|
206
|
+
type: "button",
|
|
207
|
+
"aria-label": `Clear ${x?.toLowerCase() ?? "date"}`,
|
|
208
|
+
onClick: le,
|
|
209
|
+
className: e(t, "mr-1 size-9 sm:size-7"),
|
|
210
|
+
children: /* @__PURE__ */ f("svg", {
|
|
211
|
+
"aria-hidden": "true",
|
|
212
|
+
width: "11",
|
|
213
|
+
height: "11",
|
|
214
|
+
viewBox: "0 0 24 24",
|
|
215
|
+
fill: "none",
|
|
216
|
+
stroke: "currentColor",
|
|
217
|
+
strokeWidth: "3",
|
|
218
|
+
strokeLinecap: "round",
|
|
219
|
+
strokeLinejoin: "round",
|
|
220
|
+
children: /* @__PURE__ */ f("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
147
221
|
})
|
|
148
|
-
]
|
|
222
|
+
})]
|
|
149
223
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ f(i, { children: N && /* @__PURE__ */ p(d, { children: [/* @__PURE__ */ f(a.div, {
|
|
225
|
+
"aria-hidden": "true",
|
|
226
|
+
className: "fixed inset-0 z-40 bg-overlay sm:hidden",
|
|
227
|
+
onMouseDown: () => Z(!0),
|
|
228
|
+
initial: { opacity: 0 },
|
|
229
|
+
animate: { opacity: 1 },
|
|
230
|
+
exit: { opacity: 0 }
|
|
231
|
+
}), /* @__PURE__ */ p(a.div, {
|
|
232
|
+
ref: G,
|
|
233
|
+
id: q,
|
|
151
234
|
initial: {
|
|
152
235
|
opacity: 0,
|
|
153
236
|
y: -4,
|
|
@@ -164,20 +247,46 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
164
247
|
scaleY: .97
|
|
165
248
|
},
|
|
166
249
|
transition: { duration: .13 },
|
|
167
|
-
style: { originY: 0 },
|
|
168
250
|
role: "dialog",
|
|
169
|
-
"aria-label": "Choose date",
|
|
170
|
-
className: "
|
|
251
|
+
"aria-label": x ? `Choose ${x.toLowerCase()}` : "Choose date",
|
|
252
|
+
className: "fixed z-50 w-[min(18rem,calc(100vw-2rem))] max-h-[calc(100dvh-1rem)] overflow-y-auto rounded-[var(--radius-lg)] border border-border bg-surface-raised p-3 shadow-floating",
|
|
253
|
+
style: {
|
|
254
|
+
...V,
|
|
255
|
+
originY: 0
|
|
256
|
+
},
|
|
171
257
|
children: [
|
|
172
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ p("div", {
|
|
259
|
+
className: "mb-2 flex items-center justify-between gap-3 sm:hidden",
|
|
260
|
+
children: [/* @__PURE__ */ f("strong", {
|
|
261
|
+
className: "text-sm text-foreground",
|
|
262
|
+
children: x ? `Choose ${x.toLowerCase()}` : "Choose date"
|
|
263
|
+
}), /* @__PURE__ */ f("button", {
|
|
264
|
+
type: "button",
|
|
265
|
+
onClick: () => Z(!0),
|
|
266
|
+
className: e(t, "size-11"),
|
|
267
|
+
"aria-label": "Close date picker",
|
|
268
|
+
children: /* @__PURE__ */ f("svg", {
|
|
269
|
+
"aria-hidden": "true",
|
|
270
|
+
width: "14",
|
|
271
|
+
height: "14",
|
|
272
|
+
viewBox: "0 0 24 24",
|
|
273
|
+
fill: "none",
|
|
274
|
+
stroke: "currentColor",
|
|
275
|
+
strokeWidth: "2",
|
|
276
|
+
children: /* @__PURE__ */ f("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
277
|
+
})
|
|
278
|
+
})]
|
|
279
|
+
}),
|
|
280
|
+
/* @__PURE__ */ p("div", {
|
|
173
281
|
className: "flex items-center justify-between mb-3",
|
|
174
282
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
283
|
+
/* @__PURE__ */ f("button", {
|
|
176
284
|
type: "button",
|
|
177
|
-
onClick:
|
|
285
|
+
onClick: () => $(-1),
|
|
286
|
+
disabled: !Q(new Date(F, L - 1, 1).getFullYear(), new Date(F, L - 1, 1).getMonth()),
|
|
178
287
|
"aria-label": "Previous month",
|
|
179
|
-
className: e(t, "size-7"),
|
|
180
|
-
children: /* @__PURE__ */
|
|
288
|
+
className: e(t, "size-11 disabled:cursor-not-allowed disabled:opacity-35 sm:size-7"),
|
|
289
|
+
children: /* @__PURE__ */ f("svg", {
|
|
181
290
|
width: "14",
|
|
182
291
|
height: "14",
|
|
183
292
|
viewBox: "0 0 24 24",
|
|
@@ -186,24 +295,25 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
186
295
|
strokeWidth: "2.5",
|
|
187
296
|
strokeLinecap: "round",
|
|
188
297
|
strokeLinejoin: "round",
|
|
189
|
-
children: /* @__PURE__ */
|
|
298
|
+
children: /* @__PURE__ */ f("path", { d: "m15 18-6-6 6-6" })
|
|
190
299
|
})
|
|
191
300
|
}),
|
|
192
|
-
/* @__PURE__ */
|
|
301
|
+
/* @__PURE__ */ p("span", {
|
|
193
302
|
"aria-live": "polite",
|
|
194
303
|
className: "text-sm font-semibold text-foreground",
|
|
195
304
|
children: [
|
|
196
|
-
|
|
305
|
+
m[L],
|
|
197
306
|
" ",
|
|
198
307
|
F
|
|
199
308
|
]
|
|
200
309
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
310
|
+
/* @__PURE__ */ f("button", {
|
|
202
311
|
type: "button",
|
|
203
|
-
onClick:
|
|
312
|
+
onClick: () => $(1),
|
|
313
|
+
disabled: !Q(new Date(F, L + 1, 1).getFullYear(), new Date(F, L + 1, 1).getMonth()),
|
|
204
314
|
"aria-label": "Next month",
|
|
205
|
-
className: e(t, "size-7"),
|
|
206
|
-
children: /* @__PURE__ */
|
|
315
|
+
className: e(t, "size-11 disabled:cursor-not-allowed disabled:opacity-35 sm:size-7"),
|
|
316
|
+
children: /* @__PURE__ */ f("svg", {
|
|
207
317
|
width: "14",
|
|
208
318
|
height: "14",
|
|
209
319
|
viewBox: "0 0 24 24",
|
|
@@ -212,28 +322,32 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
212
322
|
strokeWidth: "2.5",
|
|
213
323
|
strokeLinecap: "round",
|
|
214
324
|
strokeLinejoin: "round",
|
|
215
|
-
children: /* @__PURE__ */
|
|
325
|
+
children: /* @__PURE__ */ f("path", { d: "m9 18 6-6-6-6" })
|
|
216
326
|
})
|
|
217
327
|
})
|
|
218
328
|
]
|
|
219
329
|
}),
|
|
220
|
-
/* @__PURE__ */
|
|
330
|
+
/* @__PURE__ */ f("div", {
|
|
221
331
|
className: "grid grid-cols-7 gap-0.5 mb-1",
|
|
222
|
-
children:
|
|
332
|
+
children: ne.map((e) => /* @__PURE__ */ f("div", {
|
|
223
333
|
"aria-hidden": "true",
|
|
224
|
-
className: "text-center text-[10px] font-semibold text-muted-foreground
|
|
334
|
+
className: "py-1 text-center text-[10px] font-semibold text-muted-foreground",
|
|
225
335
|
children: e
|
|
226
336
|
}, e))
|
|
227
337
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ f("div", {
|
|
229
339
|
className: "grid grid-cols-7 gap-0.5",
|
|
230
|
-
children:
|
|
231
|
-
if (!t) return /* @__PURE__ */
|
|
232
|
-
let r = new Date(F, L, t), i = j ?
|
|
233
|
-
return /* @__PURE__ */
|
|
340
|
+
children: pe.map((t, n) => {
|
|
341
|
+
if (!t) return /* @__PURE__ */ f("div", {}, `empty-${n}`);
|
|
342
|
+
let r = new Date(F, L, t), i = j ? v(r, j) : !1, a = v(r, M), o = Y(r);
|
|
343
|
+
return /* @__PURE__ */ f("button", {
|
|
234
344
|
type: "button",
|
|
235
345
|
disabled: !!o,
|
|
236
|
-
onClick: () =>
|
|
346
|
+
onClick: () => ce(r),
|
|
347
|
+
onFocus: () => B(r),
|
|
348
|
+
onKeyDown: (e) => ue(e, r),
|
|
349
|
+
"data-date": y(r),
|
|
350
|
+
tabIndex: v(r, z) ? 0 : -1,
|
|
237
351
|
"aria-label": r.toLocaleDateString(void 0, {
|
|
238
352
|
weekday: "long",
|
|
239
353
|
year: "numeric",
|
|
@@ -242,26 +356,41 @@ function v({ value: v, onChange: y, label: b, hint: x, error: S, placeholder: C
|
|
|
242
356
|
}),
|
|
243
357
|
"aria-pressed": i,
|
|
244
358
|
"aria-current": a ? "date" : void 0,
|
|
245
|
-
className: e("h-
|
|
359
|
+
className: e("h-11 w-full rounded-md text-sm transition-colors focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-focus-ring/35 sm:h-8", i ? "bg-primary text-primary-foreground font-medium" : a ? "border border-accent-500/40 text-accent-400 hover:bg-accent-500/10" : "text-slate-700 dark:text-slate-200 hover:bg-black/6 dark:hover:bg-white/6", o && "opacity-30 cursor-not-allowed"),
|
|
246
360
|
children: t
|
|
247
361
|
}, t);
|
|
248
362
|
})
|
|
363
|
+
}),
|
|
364
|
+
/* @__PURE__ */ p("div", {
|
|
365
|
+
className: e("mt-3 flex items-center border-t border-border pt-3", Y(M) ? "justify-end" : "justify-between"),
|
|
366
|
+
children: [!Y(M) && /* @__PURE__ */ f("button", {
|
|
367
|
+
type: "button",
|
|
368
|
+
onClick: () => X(M),
|
|
369
|
+
className: "h-11 rounded-md px-3 text-xs font-medium text-accent-700 hover:bg-muted focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-focus-ring/35 sm:h-10 dark:text-accent-300",
|
|
370
|
+
children: "Today"
|
|
371
|
+
}), /* @__PURE__ */ f("button", {
|
|
372
|
+
type: "button",
|
|
373
|
+
onClick: () => Z(!0),
|
|
374
|
+
className: "h-11 rounded-md px-3 text-xs font-medium text-muted-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-focus-ring/35 sm:h-10",
|
|
375
|
+
children: "Cancel"
|
|
376
|
+
})]
|
|
249
377
|
})
|
|
250
378
|
]
|
|
251
|
-
}) }),
|
|
252
|
-
|
|
253
|
-
id:
|
|
379
|
+
})] }) }),
|
|
380
|
+
C && /* @__PURE__ */ f("p", {
|
|
381
|
+
id: J,
|
|
254
382
|
"aria-live": "polite",
|
|
255
383
|
className: "text-xs leading-5 text-destructive",
|
|
256
|
-
children:
|
|
384
|
+
children: C
|
|
257
385
|
}),
|
|
258
|
-
|
|
259
|
-
id:
|
|
386
|
+
S && !C && /* @__PURE__ */ f("p", {
|
|
387
|
+
id: J,
|
|
260
388
|
className: "text-xs leading-5 text-muted-foreground",
|
|
261
|
-
children:
|
|
389
|
+
children: S
|
|
262
390
|
})
|
|
263
391
|
]
|
|
264
392
|
});
|
|
265
|
-
}
|
|
393
|
+
});
|
|
394
|
+
b.displayName = "DatePicker";
|
|
266
395
|
//#endregion
|
|
267
|
-
export {
|
|
396
|
+
export { b as DatePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={1:`grid-cols-1`,2:`grid-cols-1 sm:grid-cols-2`,3:`grid-cols-1 sm:grid-cols-2 lg:grid-cols-3`},i={compact:`gap-x-4 gap-y-3`,default:`gap-x-6 gap-y-5`,relaxed:`gap-x-8 gap-y-7`},a=(0,t.forwardRef)(({columns:t=1,density:a=`default`,className:o,...s},c)=>(0,n.jsx)(`dl`,{ref:c,className:e.t(`grid min-w-0`,r[t],i[a],o),...s}));a.displayName=`DescriptionList`;var o=(0,t.forwardRef)(({orientation:t=`stacked`,className:r,...i},a)=>(0,n.jsx)(`div`,{ref:a,className:e.t(`min-w-0`,t===`inline`?`flex flex-col gap-1 sm:flex-row sm:items-baseline sm:justify-between sm:gap-4`:`flex flex-col gap-1`,r),...i}));o.displayName=`DescriptionItem`;var s=(0,t.forwardRef)(({className:t,...r},i)=>(0,n.jsx)(`dt`,{ref:i,className:e.t(`text-xs font-medium text-muted-foreground`,t),...r}));s.displayName=`DescriptionTerm`;var c=(0,t.forwardRef)(({className:t,...r},i)=>(0,n.jsx)(`dd`,{ref:i,className:e.t(`min-w-0 break-words text-sm font-medium text-foreground`,t),...r}));c.displayName=`DescriptionDetails`,exports.DescriptionDetails=c,exports.DescriptionItem=o,exports.DescriptionList=a,exports.DescriptionTerm=s;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
export type DescriptionListColumns = 1 | 2 | 3;
|
|
3
|
+
export type DescriptionListDensity = "compact" | "default" | "relaxed";
|
|
4
|
+
export interface DescriptionListProps extends HTMLAttributes<HTMLDListElement> {
|
|
5
|
+
columns?: DescriptionListColumns;
|
|
6
|
+
density?: DescriptionListDensity;
|
|
7
|
+
}
|
|
8
|
+
export declare const DescriptionList: import('react').ForwardRefExoticComponent<DescriptionListProps & import('react').RefAttributes<HTMLDListElement>>;
|
|
9
|
+
export interface DescriptionItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
10
|
+
orientation?: "stacked" | "inline";
|
|
11
|
+
}
|
|
12
|
+
export declare const DescriptionItem: import('react').ForwardRefExoticComponent<DescriptionItemProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const DescriptionTerm: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
14
|
+
export declare const DescriptionDetails: import('react').ForwardRefExoticComponent<HTMLAttributes<HTMLElement> & import('react').RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/description-list.tsx
|
|
5
|
+
var r = {
|
|
6
|
+
1: "grid-cols-1",
|
|
7
|
+
2: "grid-cols-1 sm:grid-cols-2",
|
|
8
|
+
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
|
|
9
|
+
}, i = {
|
|
10
|
+
compact: "gap-x-4 gap-y-3",
|
|
11
|
+
default: "gap-x-6 gap-y-5",
|
|
12
|
+
relaxed: "gap-x-8 gap-y-7"
|
|
13
|
+
}, a = t(({ columns: t = 1, density: a = "default", className: o, ...s }, c) => /* @__PURE__ */ n("dl", {
|
|
14
|
+
ref: c,
|
|
15
|
+
className: e("grid min-w-0", r[t], i[a], o),
|
|
16
|
+
...s
|
|
17
|
+
}));
|
|
18
|
+
a.displayName = "DescriptionList";
|
|
19
|
+
var o = t(({ orientation: t = "stacked", className: r, ...i }, a) => /* @__PURE__ */ n("div", {
|
|
20
|
+
ref: a,
|
|
21
|
+
className: e("min-w-0", t === "inline" ? "flex flex-col gap-1 sm:flex-row sm:items-baseline sm:justify-between sm:gap-4" : "flex flex-col gap-1", r),
|
|
22
|
+
...i
|
|
23
|
+
}));
|
|
24
|
+
o.displayName = "DescriptionItem";
|
|
25
|
+
var s = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("dt", {
|
|
26
|
+
ref: i,
|
|
27
|
+
className: e("text-xs font-medium text-muted-foreground", t),
|
|
28
|
+
...r
|
|
29
|
+
}));
|
|
30
|
+
s.displayName = "DescriptionTerm";
|
|
31
|
+
var c = t(({ className: t, ...r }, i) => /* @__PURE__ */ n("dd", {
|
|
32
|
+
ref: i,
|
|
33
|
+
className: e("min-w-0 break-words text-sm font-medium text-foreground", t),
|
|
34
|
+
...r
|
|
35
|
+
}));
|
|
36
|
+
c.displayName = "DescriptionDetails";
|
|
37
|
+
//#endregion
|
|
38
|
+
export { c as DescriptionDetails, o as DescriptionItem, a as DescriptionList, s as DescriptionTerm };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react"),n=require("react/jsx-runtime");var r={solid:`border-solid`,dashed:`border-dashed`,dotted:`border-dotted`},i={none:`my-0`,sm:`my-2`,md:`my-4`,lg:`my-6`},a={none:`mx-0`,sm:`mx-2`,md:`mx-4`,lg:`mx-6`},o=(0,t.forwardRef)(({orientation:t=`horizontal`,variant:o=`solid`,spacing:s=`md`,label:c,decorative:l=!0,className:u,...d},f)=>{let p=t===`vertical`,m=e.t(`min-w-0 flex-1 border-border`,r[o],p?`w-0 border-l`:`h-0 border-t`);return(0,n.jsxs)(`div`,{ref:f,role:l?`presentation`:`separator`,"aria-orientation":l?void 0:t,className:e.t(`flex shrink-0 items-center`,p?`h-full min-h-4 self-stretch flex-col`:`w-full min-w-0 flex-row`,p?a[s]:i[s],u),...d,children:[(0,n.jsx)(`span`,{"aria-hidden":`true`,className:m}),c&&(0,n.jsx)(`span`,{className:e.t(`shrink-0 text-xs font-medium text-muted-foreground`,p?`my-2 [writing-mode:vertical-rl]`:`mx-3`),children:c}),c&&(0,n.jsx)(`span`,{"aria-hidden":`true`,className:m})]})});o.displayName=`Divider`,exports.Divider=o;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type DividerOrientation = "horizontal" | "vertical";
|
|
3
|
+
export type DividerVariant = "solid" | "dashed" | "dotted";
|
|
4
|
+
export type DividerSpacing = "none" | "sm" | "md" | "lg";
|
|
5
|
+
export interface DividerProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
+
orientation?: DividerOrientation;
|
|
7
|
+
variant?: DividerVariant;
|
|
8
|
+
spacing?: DividerSpacing;
|
|
9
|
+
label?: ReactNode;
|
|
10
|
+
decorative?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const Divider: import('react').ForwardRefExoticComponent<DividerProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
2
|
+
import { forwardRef as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/divider.tsx
|
|
5
|
+
var i = {
|
|
6
|
+
solid: "border-solid",
|
|
7
|
+
dashed: "border-dashed",
|
|
8
|
+
dotted: "border-dotted"
|
|
9
|
+
}, a = {
|
|
10
|
+
none: "my-0",
|
|
11
|
+
sm: "my-2",
|
|
12
|
+
md: "my-4",
|
|
13
|
+
lg: "my-6"
|
|
14
|
+
}, o = {
|
|
15
|
+
none: "mx-0",
|
|
16
|
+
sm: "mx-2",
|
|
17
|
+
md: "mx-4",
|
|
18
|
+
lg: "mx-6"
|
|
19
|
+
}, s = t(({ orientation: t = "horizontal", variant: s = "solid", spacing: c = "md", label: l, decorative: u = !0, className: d, ...f }, p) => {
|
|
20
|
+
let m = t === "vertical", h = e("min-w-0 flex-1 border-border", i[s], m ? "w-0 border-l" : "h-0 border-t");
|
|
21
|
+
return /* @__PURE__ */ r("div", {
|
|
22
|
+
ref: p,
|
|
23
|
+
role: u ? "presentation" : "separator",
|
|
24
|
+
"aria-orientation": u ? void 0 : t,
|
|
25
|
+
className: e("flex shrink-0 items-center", m ? "h-full min-h-4 self-stretch flex-col" : "w-full min-w-0 flex-row", m ? o[c] : a[c], d),
|
|
26
|
+
...f,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ n("span", {
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: h
|
|
31
|
+
}),
|
|
32
|
+
l && /* @__PURE__ */ n("span", {
|
|
33
|
+
className: e("shrink-0 text-xs font-medium text-muted-foreground", m ? "my-2 [writing-mode:vertical-rl]" : "mx-3"),
|
|
34
|
+
children: l
|
|
35
|
+
}),
|
|
36
|
+
l && /* @__PURE__ */ n("span", {
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
className: h
|
|
39
|
+
})
|
|
40
|
+
]
|
|
41
|
+
});
|
|
42
|
+
});
|
|
43
|
+
s.displayName = "Divider";
|
|
44
|
+
//#endregion
|
|
45
|
+
export { s as Divider };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../component-styles-DY4wigiq.cjs"),n=require("../use-event-callback-Du9_9eAi.cjs"),r=require("../motion-B2shivEB.cjs"),i=require("../use-focus-trap-CPLT49gN.cjs"),a=require("../icons-Dfetr1L2.cjs");let o=require("framer-motion"),s=require("react"),c=require("react/jsx-runtime"),l=require("react-dom");function u({open:u,onClose:d,position:f=`left`,title:p,children:m,width:h=320,className:g,overlayClassName:_,panelClassName:v,headerClassName:y,titleClassName:b,closeButtonClassName:x,contentClassName:S,handleClassName:C,unstyled:w=!1,ariaLabel:T=`Drawer`,closeAriaLabel:E=`Close drawer`,closeOnEscape:D=!0,closeOnOverlayClick:O=!0}){let k=n.t(d),A=(0,s.useRef)(null),j=(0,s.useId)(),{previouslyFocusedRef:M,restoreNow:N}=i.n(u);i.t(A,{active:u,onEscape:k,closeOnEscape:D});let P=N;if(typeof document>`u`)return null;if(w&&u)return(0,l.createPortal)((0,c.jsx)(`div`,{ref:A,tabIndex:-1,role:`dialog`,"aria-modal":`true`,"aria-label":typeof p==`string`?p:T,className:e.t(g,v),children:m}),document.body);if(f===`bottom`)return(0,l.createPortal)((0,c.jsx)(o.AnimatePresence,{onExitComplete:P,children:u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:r.n.overlay,className:e.t(`fixed inset-0 z-[100] bg-overlay`,_),onClick:O?k:void 0},`drawer-backdrop`),(0,c.jsxs)(o.motion.div,{ref:A,tabIndex:-1,initial:{y:`100%`},animate:{y:0},exit:{y:`100%`},transition:r.n.panelEnter,role:`dialog`,"aria-modal":`true`,"aria-labelledby":p?j:void 0,"aria-label":p?void 0:T,className:e.t(`fixed bottom-0 left-0 right-0 z-[101] flex max-h-[80dvh] flex-col rounded-t-[var(--radius-xl)] border-t border-border bg-surface-raised shadow-overlay`,v,g),children:[(0,c.jsx)(`div`,{className:`flex justify-center pb-1 pt-3 shrink-0`,"aria-hidden":`true`,children:(0,c.jsx)(`div`,{className:e.t(`h-1 w-9 rounded-full bg-border-strong`,C)})}),p&&(0,c.jsxs)(`div`,{className:e.t(`flex items-center justify-between border-b border-border px-5 py-3 shrink-0`,y),children:[(0,c.jsx)(`h2`,{id:j,className:e.t(`text-sm font-semibold text-foreground`,b),children:p}),(0,c.jsx)(`button`,{type:`button`,onClick:k,className:e.t(t.c,x),"aria-label":E,children:(0,c.jsx)(a.t,{size:14,"aria-hidden":`true`})})]}),(0,c.jsx)(`div`,{className:e.t(`flex-1 overflow-y-auto pb-safe-bottom`,S),children:m})]},`drawer-panel`)]})}),document.body);let F=f===`left`?`-100%`:`100%`;return(0,l.createPortal)((0,c.jsx)(o.AnimatePresence,{onExitComplete:P,children:u&&(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(o.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:r.n.overlay,className:e.t(`fixed inset-0 z-[100] bg-overlay`,_),onClick:O?k:void 0},`drawer-backdrop`),(0,c.jsxs)(o.motion.div,{ref:A,tabIndex:-1,initial:{x:F},animate:{x:0},exit:{x:F},transition:r.n.panelEnter,role:`dialog`,"aria-modal":`true`,"aria-labelledby":p?j:void 0,"aria-label":p?void 0:T,className:e.t(`fixed top-0 bottom-0 z-[101] flex max-w-[100vw] flex-col bg-surface-raised shadow-overlay`,f===`left`?`left-0 border-r border-border`:`right-0 border-l border-border`,v,g),style:{width:h},children:[p&&(0,c.jsxs)(`div`,{className:e.t(`flex h-14 items-center justify-between gap-3 border-b border-border px-5 shrink-0`,y),children:[(0,c.jsx)(`h2`,{id:j,className:e.t(`min-w-0 truncate text-sm font-semibold text-foreground`,b),children:p}),(0,c.jsx)(`button`,{type:`button`,onClick:k,className:e.t(t.c,x),"aria-label":E,children:(0,c.jsx)(a.t,{size:14,"aria-hidden":`true`})})]}),(0,c.jsx)(`div`,{className:e.t(`flex-1 overflow-y-auto`,S),children:m})]},`drawer-panel`)]})}),document.body)}exports.Drawer=u;
|
|
@@ -9,10 +9,15 @@ export interface DrawerProps {
|
|
|
9
9
|
className?: string;
|
|
10
10
|
overlayClassName?: string;
|
|
11
11
|
panelClassName?: string;
|
|
12
|
+
headerClassName?: string;
|
|
13
|
+
titleClassName?: string;
|
|
14
|
+
closeButtonClassName?: string;
|
|
15
|
+
contentClassName?: string;
|
|
16
|
+
handleClassName?: string;
|
|
12
17
|
unstyled?: boolean;
|
|
13
18
|
ariaLabel?: string;
|
|
14
19
|
closeAriaLabel?: string;
|
|
15
20
|
closeOnEscape?: boolean;
|
|
16
21
|
closeOnOverlayClick?: boolean;
|
|
17
22
|
}
|
|
18
|
-
export declare function Drawer({ open, onClose, position, title, children, width, className, overlayClassName, panelClassName, unstyled, ariaLabel, closeAriaLabel, closeOnEscape, closeOnOverlayClick, }: DrawerProps): import('react').ReactPortal | null;
|
|
23
|
+
export declare function Drawer({ open, onClose, position, title, children, width, className, overlayClassName, panelClassName, headerClassName, titleClassName, closeButtonClassName, contentClassName, handleClassName, unstyled, ariaLabel, closeAriaLabel, closeOnEscape, closeOnOverlayClick, }: DrawerProps): import('react').ReactPortal | null;
|