@bzync/rui 0.0.5 → 0.0.9
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 +476 -57
- 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 -1
- package/dist/components/aspect-ratio.js +1 -1
- 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 -1
- package/dist/components/avatar-group.js +1 -1
- 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 -1
- package/dist/components/blockquote.js +3 -3
- package/dist/components/breadcrumb.cjs +1 -1
- package/dist/components/breadcrumb.js +2 -2
- package/dist/components/button-group.cjs +1 -1
- package/dist/components/button-group.js +1 -1
- 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.js +4 -4
- 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 +3 -2
- package/dist/components/currency.cjs +1 -1
- package/dist/components/currency.js +1 -1
- 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 -1
- package/dist/components/description-list.js +1 -1
- package/dist/components/divider.cjs +1 -1
- package/dist/components/divider.js +1 -1
- 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 -1
- package/dist/components/rating.js +3 -3
- package/dist/components/richtext.cjs +1 -1
- package/dist/components/richtext.js +45 -18
- package/dist/components/scroll-area.cjs +1 -1
- package/dist/components/scroll-area.js +3 -3
- 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 -1
- package/dist/components/time-picker.d.ts +2 -0
- package/dist/components/time-picker.js +206 -148
- package/dist/components/timeline.cjs +1 -1
- package/dist/components/timeline.js +1 -1
- package/dist/components/toggle.cjs +1 -1
- package/dist/components/toggle.js +2 -2
- 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 -1
- package/dist/components/typography.d.ts +2 -3
- package/dist/components/typography.js +37 -24
- 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 +4 -0
- package/dist/index.js +126 -99
- 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
package/dist/components/modal.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { c as t } from "../component-styles-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { c as t } from "../component-styles-C2CbHEEA.js";
|
|
4
4
|
import { t as n } from "../use-event-callback-DGkfO_uu.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
5
|
+
import { n as r } from "../motion-gnRzFS5f.js";
|
|
6
|
+
import { n as i, t as a } from "../use-focus-trap-CS6BXJAB.js";
|
|
7
|
+
import { AnimatePresence as o, motion as s } from "framer-motion";
|
|
8
|
+
import { useId as c, useRef as l } from "react";
|
|
9
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
9
10
|
//#region src/components/modal.tsx
|
|
10
|
-
var
|
|
11
|
+
var f = {
|
|
11
12
|
sm: "max-w-[380px]",
|
|
12
13
|
md: "max-w-[480px]",
|
|
13
14
|
lg: "max-w-[560px]",
|
|
@@ -16,70 +17,31 @@ var d = {
|
|
|
16
17
|
"7xl": "max-w-3xl",
|
|
17
18
|
full: "max-w-[calc(100vw-2rem)]"
|
|
18
19
|
};
|
|
19
|
-
function
|
|
20
|
-
let
|
|
21
|
-
return
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [f]), o(() => {
|
|
28
|
-
if (!f) return;
|
|
29
|
-
!A.current && document.activeElement instanceof HTMLElement && (A.current = document.activeElement);
|
|
30
|
-
let e = document.body.style.overflow, t = (e) => {
|
|
31
|
-
if (e.key === "Escape" && D) {
|
|
32
|
-
e.preventDefault(), P();
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (e.key !== "Tab" || !k.current) return;
|
|
36
|
-
let t = r(k.current);
|
|
37
|
-
if (t.length === 0) {
|
|
38
|
-
e.preventDefault(), k.current.focus();
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
let n = t[0], i = t[t.length - 1];
|
|
42
|
-
e.shiftKey && document.activeElement === n ? (e.preventDefault(), i.focus()) : !e.shiftKey && document.activeElement === i && (e.preventDefault(), n.focus());
|
|
43
|
-
};
|
|
44
|
-
document.addEventListener("keydown", t), document.body.style.overflow = "hidden";
|
|
45
|
-
let n = () => {
|
|
46
|
-
(k.current?.querySelector("[data-autofocus]") ?? k.current?.querySelector("[data-modal-content] a[href],[data-modal-content] button:not([disabled]),[data-modal-content] input:not([disabled]),[data-modal-content] select:not([disabled]),[data-modal-content] textarea:not([disabled]),[data-modal-content] [tabindex]:not([tabindex=\"-1\"])") ?? k.current?.querySelector("a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex=\"-1\"])") ?? k.current)?.focus();
|
|
47
|
-
};
|
|
48
|
-
n();
|
|
49
|
-
let i = window.setTimeout(n, 0);
|
|
50
|
-
return () => {
|
|
51
|
-
window.clearTimeout(i), document.removeEventListener("keydown", t), document.body.style.overflow = e;
|
|
52
|
-
};
|
|
53
|
-
}, [
|
|
54
|
-
D,
|
|
55
|
-
f,
|
|
56
|
-
P
|
|
57
|
-
]), o(() => {
|
|
58
|
-
if (f || !A.current) return;
|
|
59
|
-
let e = A.current, t = window.setTimeout(() => e.focus(), 240);
|
|
60
|
-
return () => window.clearTimeout(t);
|
|
61
|
-
}, [f]), T ? f ? /* @__PURE__ */ l("div", {
|
|
62
|
-
ref: k,
|
|
20
|
+
function p({ open: p, onClose: m, children: h, className: g, overlayClassName: _, panelClassName: v, containerClassName: y, headerClassName: b, iconClassName: x, titleClassName: S, descriptionClassName: C, closeButtonClassName: w, contentClassName: T, size: E = "md", title: D, description: O, icon: k, showCloseButton: A = !0, closeAriaLabel: j = "Close dialog", scrollable: M = !1, unstyled: N = !1, ariaLabel: P = "Dialog", closeOnEscape: F = !0, closeOnOverlayClick: I = !0 }) {
|
|
21
|
+
let L = l(null), R = c(), z = c(), B = n(m), { previouslyFocusedRef: V, restoreNow: H } = i(p);
|
|
22
|
+
return a(L, {
|
|
23
|
+
active: p,
|
|
24
|
+
onEscape: B,
|
|
25
|
+
closeOnEscape: F
|
|
26
|
+
}), N ? p ? /* @__PURE__ */ u("div", {
|
|
27
|
+
ref: L,
|
|
63
28
|
role: "dialog",
|
|
64
29
|
"aria-modal": "true",
|
|
65
|
-
className: e(
|
|
66
|
-
children:
|
|
67
|
-
}) : null : /* @__PURE__ */
|
|
68
|
-
onExitComplete:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
children: f && /* @__PURE__ */ u("div", {
|
|
73
|
-
className: "fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6",
|
|
74
|
-
children: [/* @__PURE__ */ l(a.div, {
|
|
30
|
+
className: e(g, v),
|
|
31
|
+
children: h
|
|
32
|
+
}) : null : /* @__PURE__ */ u(o, {
|
|
33
|
+
onExitComplete: H,
|
|
34
|
+
children: p && /* @__PURE__ */ d("div", {
|
|
35
|
+
className: e("fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6", y),
|
|
36
|
+
children: [/* @__PURE__ */ u(s.div, {
|
|
75
37
|
initial: { opacity: 0 },
|
|
76
38
|
animate: { opacity: 1 },
|
|
77
39
|
exit: { opacity: 0 },
|
|
78
|
-
transition:
|
|
79
|
-
className: e("absolute inset-0 bg-overlay",
|
|
80
|
-
onClick:
|
|
81
|
-
}), /* @__PURE__ */
|
|
82
|
-
ref:
|
|
40
|
+
transition: r.overlay,
|
|
41
|
+
className: e("absolute inset-0 bg-overlay", _),
|
|
42
|
+
onClick: I ? B : void 0
|
|
43
|
+
}), /* @__PURE__ */ d(s.div, {
|
|
44
|
+
ref: L,
|
|
83
45
|
initial: {
|
|
84
46
|
opacity: 0,
|
|
85
47
|
scale: .98,
|
|
@@ -95,50 +57,42 @@ function f({ open: f, onClose: p, children: m, className: h, overlayClassName: g
|
|
|
95
57
|
scale: .98,
|
|
96
58
|
y: 10
|
|
97
59
|
},
|
|
98
|
-
transition:
|
|
99
|
-
duration: .22,
|
|
100
|
-
ease: [
|
|
101
|
-
.16,
|
|
102
|
-
1,
|
|
103
|
-
.3,
|
|
104
|
-
1
|
|
105
|
-
]
|
|
106
|
-
},
|
|
60
|
+
transition: r.panelEnter,
|
|
107
61
|
role: "dialog",
|
|
108
62
|
"aria-modal": "true",
|
|
109
|
-
"aria-labelledby":
|
|
110
|
-
"aria-describedby":
|
|
111
|
-
"aria-label":
|
|
63
|
+
"aria-labelledby": D ? R : void 0,
|
|
64
|
+
"aria-describedby": O ? z : void 0,
|
|
65
|
+
"aria-label": D ? void 0 : P,
|
|
112
66
|
tabIndex: -1,
|
|
113
|
-
className: e("relative w-full overflow-hidden flex flex-col", "rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay", "max-h-[min(90dvh,720px)]",
|
|
67
|
+
className: e("relative w-full overflow-hidden flex flex-col", "rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay", "max-h-[min(90dvh,720px)]", f[E], v, g),
|
|
114
68
|
children: [
|
|
115
|
-
|
|
116
|
-
className: "flex items-start justify-between gap-4 border-b border-border px-5 pb-3 pt-4 sm:px-6 shrink-0",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
69
|
+
D && /* @__PURE__ */ d("div", {
|
|
70
|
+
className: e("flex items-start justify-between gap-4 border-b border-border px-5 pb-3 pt-4 sm:px-6 shrink-0", b),
|
|
71
|
+
children: [/* @__PURE__ */ d("div", {
|
|
118
72
|
className: "flex gap-3.5 min-w-0 flex-1",
|
|
119
|
-
children: [
|
|
120
|
-
className: "mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-5",
|
|
73
|
+
children: [k && /* @__PURE__ */ u("div", {
|
|
74
|
+
className: e("mt-0.5 shrink-0 text-muted-foreground [&_svg]:size-5", x),
|
|
121
75
|
"aria-hidden": "true",
|
|
122
|
-
children:
|
|
123
|
-
}), /* @__PURE__ */
|
|
76
|
+
children: k
|
|
77
|
+
}), /* @__PURE__ */ d("div", {
|
|
124
78
|
className: "min-w-0 flex-1 pt-0.5",
|
|
125
|
-
children: [/* @__PURE__ */
|
|
126
|
-
id:
|
|
127
|
-
className: "text-base font-semibold leading-6 text-foreground",
|
|
128
|
-
children:
|
|
129
|
-
}),
|
|
130
|
-
id:
|
|
131
|
-
className: "mt-1 text-sm leading-5 text-muted-foreground",
|
|
132
|
-
children:
|
|
79
|
+
children: [/* @__PURE__ */ u("h2", {
|
|
80
|
+
id: R,
|
|
81
|
+
className: e("text-base font-semibold leading-6 text-foreground", S),
|
|
82
|
+
children: D
|
|
83
|
+
}), O && /* @__PURE__ */ u("p", {
|
|
84
|
+
id: z,
|
|
85
|
+
className: e("mt-1 text-sm leading-5 text-muted-foreground", C),
|
|
86
|
+
children: O
|
|
133
87
|
})]
|
|
134
88
|
})]
|
|
135
|
-
}),
|
|
89
|
+
}), A && /* @__PURE__ */ u("button", {
|
|
136
90
|
type: "button",
|
|
137
91
|
"data-modal-close": !0,
|
|
138
|
-
"aria-label":
|
|
139
|
-
onClick:
|
|
140
|
-
className: t,
|
|
141
|
-
children: /* @__PURE__ */
|
|
92
|
+
"aria-label": j,
|
|
93
|
+
onClick: B,
|
|
94
|
+
className: e(t, w),
|
|
95
|
+
children: /* @__PURE__ */ u("svg", {
|
|
142
96
|
width: "14",
|
|
143
97
|
height: "14",
|
|
144
98
|
viewBox: "0 0 24 24",
|
|
@@ -147,17 +101,17 @@ function f({ open: f, onClose: p, children: m, className: h, overlayClassName: g
|
|
|
147
101
|
strokeWidth: "2",
|
|
148
102
|
strokeLinecap: "round",
|
|
149
103
|
strokeLinejoin: "round",
|
|
150
|
-
children: /* @__PURE__ */
|
|
104
|
+
children: /* @__PURE__ */ u("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
151
105
|
})
|
|
152
106
|
})]
|
|
153
107
|
}),
|
|
154
|
-
!
|
|
108
|
+
!D && A && /* @__PURE__ */ u("button", {
|
|
155
109
|
type: "button",
|
|
156
110
|
"data-modal-close": !0,
|
|
157
|
-
"aria-label":
|
|
158
|
-
onClick:
|
|
159
|
-
className: e("absolute right-4 top-4 z-10", t),
|
|
160
|
-
children: /* @__PURE__ */
|
|
111
|
+
"aria-label": j,
|
|
112
|
+
onClick: B,
|
|
113
|
+
className: e("absolute right-4 top-4 z-10", t, w),
|
|
114
|
+
children: /* @__PURE__ */ u("svg", {
|
|
161
115
|
width: "14",
|
|
162
116
|
height: "14",
|
|
163
117
|
viewBox: "0 0 24 24",
|
|
@@ -166,54 +120,54 @@ function f({ open: f, onClose: p, children: m, className: h, overlayClassName: g
|
|
|
166
120
|
strokeWidth: "2",
|
|
167
121
|
strokeLinecap: "round",
|
|
168
122
|
strokeLinejoin: "round",
|
|
169
|
-
children: /* @__PURE__ */
|
|
123
|
+
children: /* @__PURE__ */ u("path", { d: "M18 6 6 18M6 6l12 12" })
|
|
170
124
|
})
|
|
171
125
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ u("div", {
|
|
173
127
|
"data-modal-content": !0,
|
|
174
|
-
className: e("px-5 py-4 sm:px-6 flex-1",
|
|
175
|
-
children:
|
|
128
|
+
className: e("px-5 py-4 sm:px-6 flex-1", M ? "overflow-y-auto overscroll-contain" : "overflow-y-auto", T),
|
|
129
|
+
children: h
|
|
176
130
|
})
|
|
177
131
|
]
|
|
178
132
|
})]
|
|
179
133
|
})
|
|
180
134
|
});
|
|
181
135
|
}
|
|
182
|
-
function
|
|
183
|
-
return /* @__PURE__ */
|
|
136
|
+
function m({ className: t, children: n, ...r }) {
|
|
137
|
+
return /* @__PURE__ */ u("div", {
|
|
184
138
|
className: e("px-5 pt-4 pb-3 sm:px-6 border-b border-border shrink-0", t),
|
|
185
139
|
...r,
|
|
186
140
|
children: n
|
|
187
141
|
});
|
|
188
142
|
}
|
|
189
|
-
function
|
|
190
|
-
return /* @__PURE__ */
|
|
143
|
+
function h({ as: t = "h2", className: n, children: r, ...i }) {
|
|
144
|
+
return /* @__PURE__ */ u(t, {
|
|
191
145
|
className: e("text-base font-semibold leading-6 text-foreground", n),
|
|
192
146
|
...i,
|
|
193
147
|
children: r
|
|
194
148
|
});
|
|
195
149
|
}
|
|
196
|
-
function
|
|
197
|
-
return /* @__PURE__ */
|
|
150
|
+
function g({ className: t, children: n, ...r }) {
|
|
151
|
+
return /* @__PURE__ */ u("p", {
|
|
198
152
|
className: e("mt-1 text-sm leading-5 text-muted-foreground", t),
|
|
199
153
|
...r,
|
|
200
154
|
children: n
|
|
201
155
|
});
|
|
202
156
|
}
|
|
203
|
-
function
|
|
204
|
-
return /* @__PURE__ */
|
|
157
|
+
function _({ className: t, scrollable: n = !1, children: r, ...i }) {
|
|
158
|
+
return /* @__PURE__ */ u("div", {
|
|
205
159
|
"data-modal-content": !0,
|
|
206
160
|
className: e("px-5 py-4 sm:px-6", n && "overflow-y-auto flex-1 overscroll-contain", t),
|
|
207
161
|
...i,
|
|
208
162
|
children: r
|
|
209
163
|
});
|
|
210
164
|
}
|
|
211
|
-
function
|
|
212
|
-
return /* @__PURE__ */
|
|
165
|
+
function v({ className: t, children: n, ...r }) {
|
|
166
|
+
return /* @__PURE__ */ u("div", {
|
|
213
167
|
className: e("flex flex-wrap items-center justify-end gap-2 border-t border-border px-5 pb-4 pt-3 sm:px-6 max-sm:flex-col-reverse max-sm:items-stretch", t),
|
|
214
168
|
...r,
|
|
215
169
|
children: n
|
|
216
170
|
});
|
|
217
171
|
}
|
|
218
172
|
//#endregion
|
|
219
|
-
export {
|
|
173
|
+
export { p as Modal, _ as ModalBody, g as ModalDescription, v as ModalFooter, m as ModalHeader, h as ModalTitle };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../component-styles-DY4wigiq.cjs");let n=require("react/jsx-runtime");function r({id:r,label:i,href:a,icon:o,badge:s,disabled:c,active:l,compact:u,onSelect:d,className:f}){let p=(0,n.jsxs)(n.Fragment,{children:[o&&(0,n.jsx)(`span`,{className:`shrink-0`,"aria-hidden":`true`,children:o}),(0,n.jsx)(`span`,{className:e.t(`truncate`,u&&`text-[11px]`),children:i}),s&&(0,n.jsx)(`span`,{className:`ml-auto shrink-0`,children:s})]}),m=e.t(`group relative inline-flex items-center justify-center gap-2 rounded-[var(--radius-md)] font-medium transition-colors`,t.s,u?`min-h-11 flex-col px-2 py-1.5`:`h-9 px-3 text-sm`,l?`bg-accent-50 text-accent-700 dark:bg-accent-500/12 dark:text-accent-300`:`text-muted-foreground hover:bg-muted hover:text-foreground`,c&&`pointer-events-none opacity-40`,f);return a?(0,n.jsx)(`a`,{href:a,className:m,"aria-current":l?`page`:void 0,"aria-disabled":c||void 0,onClick:e=>{d&&(e.preventDefault(),d(r))},children:p}):(0,n.jsx)(`button`,{type:`button`,className:m,"aria-current":l?`page`:void 0,disabled:c,onClick:()=>d?.(r),children:p})}function i({items:t,activeId:i,onSelect:a,ariaLabel:o=`Primary navigation`,className:s,children:c,...l}){return(0,n.jsxs)(`nav`,{"aria-label":o,className:e.t(`flex min-h-14 items-center gap-1 border border-border bg-surface px-3`,s),...l,children:[c,(0,n.jsx)(`div`,{className:`ml-auto flex items-center gap-1 overflow-x-auto`,children:t.map(e=>(0,n.jsx)(r,{...e,active:i===e.id,onSelect:a},e.id))})]})}function a({className:t,children:r,...i}){return(0,n.jsx)(`header`,{className:e.t(`flex min-h-14 items-center gap-3 border-b border-border bg-bg/95 px-4 backdrop-blur-sm`,t),...i,children:r})}function o({as:t=`h2`,className:r,children:i,...a}){return(0,n.jsx)(t,{className:e.t(`min-w-0 flex-1 truncate text-sm font-semibold text-foreground`,r),...a,children:i})}function s({items:t,activeId:i,onSelect:a,ariaLabel:o=`Sidebar navigation`,header:s,footer:c,className:l,...u}){return(0,n.jsxs)(`aside`,{className:e.t(`flex w-60 flex-col border border-border bg-surface`,l),...u,children:[s&&(0,n.jsx)(`div`,{className:`border-b border-border p-4`,children:s}),(0,n.jsx)(`nav`,{"aria-label":o,className:`flex flex-1 flex-col gap-1 p-2`,children:t.map(e=>(0,n.jsx)(r,{...e,active:i===e.id,onSelect:a,className:`w-full justify-start`},e.id))}),c&&(0,n.jsx)(`div`,{className:`border-t border-border p-3`,children:c})]})}function c({items:t,activeId:i,onSelect:a,ariaLabel:o=`Mobile navigation`,className:s,...c}){return(0,n.jsx)(`nav`,{"aria-label":o,className:e.t(`grid min-h-16 border border-border bg-surface/95 px-1 pb-safe-bottom shadow-floating backdrop-blur-sm`,s),style:{gridTemplateColumns:`repeat(${t.length}, minmax(0, 1fr))`},...c,children:t.map(e=>(0,n.jsx)(r,{...e,compact:!0,active:i===e.id,onSelect:a,className:`rounded-none`},e.id))})}function l({label:r,className:i,children:a,type:o=`button`,...s}){return(0,n.jsx)(`button`,{type:o,"aria-label":r,className:e.t(t.c,`size-9`,i),...s,children:a})}function u({mark:r,className:i,children:a,...o}){return(0,n.jsxs)(`a`,{className:e.t(`inline-flex shrink-0 items-center gap-2 text-sm font-semibold text-foreground`,t.s,i),...o,children:[r,a]})}exports.BottomBar=c,exports.BrandLink=u,exports.IconButton=l,exports.Navbar=i,exports.NavigationLink=r,exports.Sidebar=s,exports.Topbar=a,exports.TopbarTitle=o;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { c as t, s as n } from "../component-styles-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { c as t, s as n } from "../component-styles-C2CbHEEA.js";
|
|
4
4
|
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/navigation.tsx
|
|
6
6
|
function o({ id: t, label: o, href: s, icon: c, badge: l, disabled: u, active: d, compact: f, onSelect: p, className: m }) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../component-styles-DY4wigiq.cjs");let n=require("react"),r=require("react/jsx-runtime");var i={sm:{wrap:`h-7 text-xs`,btn:`w-6`,input:`w-16`},md:{wrap:`h-9 text-sm`,btn:`w-8`,input:`w-20`},lg:{wrap:`h-11 text-sm`,btn:`w-9`,input:`w-24`}},a=(0,n.forwardRef)(({className:a,label:o,hint:s,error:c,size:l=`md`,min:u=-1/0,max:d=1/0,step:f=1,value:p,defaultValue:m=0,onChange:h,disabled:g,id:_,autoComplete:v=`on`,fullWidth:y=!1,formatDisplay:b,onFocus:x,onBlur:S,onKeyDown:C,required:w,...T},E)=>{let D=(0,n.useId)(),O=_??D,k=`${O}-message`,[A,j]=(0,n.useState)(m),M=p??A,N=i[l],P=f.toString().includes(`.`)?f.toString().split(`.`)[1].length:0,F=e=>P>0?Math.round(e*10**P)/10**P:Math.round(e),I=e=>Math.min(d,Math.max(u,e));function L(e){let t=I(F(e));p===void 0&&j(t),h?.(t),z(String(t))}(0,n.useEffect)(()=>{p!==void 0&&j(p)},[p]);let[R,z]=(0,n.useState)(()=>String(M)),B=(0,n.useRef)(!1);(0,n.useEffect)(()=>{B.current||z(String(M))},[M]);function V(e){z(e)}function H(e){B.current=!1;let t=Number(R);L(Number.isNaN(t)?M:t),S?.(e)}function U(e){C?.(e),!e.defaultPrevented&&e.key===`Enter`&&e.currentTarget.blur()}return(0,r.jsxs)(`div`,{className:e.t(t.o,!y&&`w-auto`,a),children:[o&&(0,r.jsxs)(`label`,{htmlFor:O,className:`text-xs font-semibold leading-5 text-foreground`,children:[o,w&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(`span`,{"aria-hidden":`true`,className:`ml-1 text-destructive`,children:`*`}),(0,r.jsx)(`span`,{className:`sr-only`,children:` (required)`})]})]}),(0,r.jsxs)(`div`,{className:e.t(`inline-flex items-center overflow-hidden rounded-[var(--radius-md)]`,t.t,N.wrap,y&&`flex w-full`,c&&`border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25`,g&&`opacity-50`),children:[(0,r.jsx)(`button`,{type:`button`,"aria-label":o?`Decrease ${o}`:`Decrease value`,tabIndex:-1,disabled:g||M<=u,onClick:()=>L(M-f),className:e.t(`flex items-center justify-center shrink-0 border-r border-border`,`text-muted-foreground hover:bg-muted hover:text-foreground`,`disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,N.btn),children:(0,r.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M5 12h14`})})}),(0,r.jsx)(`input`,{ref:E,type:`number`,id:O,required:w,"aria-invalid":c?!0:void 0,"aria-describedby":c||s?k:void 0,"aria-valuetext":b?.(M),autoComplete:v,min:Number.isFinite(u)?u:void 0,max:Number.isFinite(d)?d:void 0,step:f,value:R,disabled:g,onFocus:e=>{B.current=!0,x?.(e)},onChange:e=>V(e.target.value),onBlur:H,onKeyDown:U,className:e.t(`flex-1 text-center bg-transparent text-foreground outline-none tabular-nums`,`[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none`,`disabled:cursor-not-allowed`,y?`min-w-0`:N.input),...T}),(0,r.jsx)(`button`,{type:`button`,"aria-label":o?`Increase ${o}`:`Increase value`,tabIndex:-1,disabled:g||M>=d,onClick:()=>L(M+f),className:e.t(`flex items-center justify-center shrink-0 border-l border-border`,`text-muted-foreground hover:bg-muted hover:text-foreground`,`disabled:opacity-40 disabled:cursor-not-allowed transition-colors`,N.btn),children:(0,r.jsx)(`svg`,{width:`10`,height:`10`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3`,strokeLinecap:`round`,children:(0,r.jsx)(`path`,{d:`M12 5v14M5 12h14`})})})]}),c&&(0,r.jsx)(`p`,{id:k,"aria-live":`polite`,className:`text-xs leading-5 text-destructive`,children:c}),s&&!c&&(0,r.jsx)(`p`,{id:k,className:`text-xs leading-5 text-muted-foreground`,children:s})]})});a.displayName=`NumberInput`,exports.NumberInput=a;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { o as t, t as n } from "../component-styles-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { o as t, t as n } from "../component-styles-C2CbHEEA.js";
|
|
4
4
|
import { forwardRef as r, useEffect as i, useId as a, useRef as o, useState as s } from "react";
|
|
5
5
|
import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/number-input.tsx
|
|
@@ -60,7 +60,7 @@ var d = {
|
|
|
60
60
|
})] })]
|
|
61
61
|
}),
|
|
62
62
|
/* @__PURE__ */ u("div", {
|
|
63
|
-
className: e("inline-flex items-center overflow-hidden rounded-[var(--radius-md)]", n, z.wrap, T && "flex w-full", m && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/
|
|
63
|
+
className: e("inline-flex items-center overflow-hidden rounded-[var(--radius-md)]", n, z.wrap, T && "flex w-full", m && "border-destructive/60 hover:border-destructive/70 focus-within:border-destructive focus-within:ring-destructive/25", S && "opacity-50"),
|
|
64
64
|
children: [
|
|
65
65
|
/* @__PURE__ */ l("button", {
|
|
66
66
|
type: "button",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs");let t=require("react"),n=require("react/jsx-runtime");function r({length:r=6,value:i,onChange:a,onComplete:o,label:s,hint:c,error:l,disabled:u,className:d,masked:f=!1}){let p=(0,t.useId)(),[m,h]=(0,t.useState)(``),g=(i??m).split(``).slice(0,r),_=(0,t.useRef)([]);function v(e){i===void 0&&h(e),a?.(e),e.length===r&&o?.(e)}function y(e,t){if(!/^\d*$/.test(t))return;let n=g.slice();n[e]=t.slice(-1),v(n.join(``).slice(0,r)),t&&e<r-1&&_.current[e+1]?.focus()}function b(e,t){if(t.key===`Backspace`){if(g[e]){let t=g.slice();t[e]=``,v(t.join(``))}else e>0&&_.current[e-1]?.focus()}else t.key===`ArrowLeft`&&e>0?_.current[e-1]?.focus():t.key===`ArrowRight`&&e<r-1&&_.current[e+1]?.focus()}function x(e){e.preventDefault();let t=e.clipboardData.getData(`text`).replace(/\D/g,``).slice(0,r);v(t),_.current[Math.min(t.length,r-1)]?.focus()}return(0,n.jsxs)(`div`,{className:e.t(`flex flex-col gap-1.5`,d),children:[s&&(0,n.jsx)(`label`,{htmlFor:`${p}-0`,className:`text-sm font-medium text-slate-600 dark:text-slate-300`,children:s}),(0,n.jsx)(`div`,{className:`flex items-center gap-2`,children:Array.from({length:r}).map((t,r)=>(0,n.jsx)(`input`,{ref:e=>{_.current[r]=e},id:`${p}-${r}`,name:`${p}-${r}`,type:f?`password`:`text`,inputMode:`numeric`,pattern:`\\d*`,maxLength:1,autoComplete:r===0?`one-time-code`:`off`,value:g[r]??``,disabled:u,onChange:e=>y(r,e.target.value),onKeyDown:e=>b(r,e),onPaste:x,onFocus:e=>e.target.select(),className:e.t(`w-10 h-12 text-center text-lg font-semibold rounded-lg border bg-black/4 dark:bg-white/4`,`text-foreground outline-none transition-colors`,`focus:ring-[3px] focus:ring-accent-500/30`,l?`border-red-500/40 focus:border-red-500/50`:`border-slate-300 dark:border-white/10 focus:border-accent-500/40`,u&&`opacity-50 cursor-not-allowed`)},r))}),l&&(0,n.jsx)(`p`,{className:`text-xs text-red-400`,children:l}),c&&!l&&(0,n.jsx)(`p`,{className:`text-xs text-slate-500`,children:c})]})}exports.OtpInput=r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
3
|
import { useId as t, useRef as n, useState as r } from "react";
|
|
4
4
|
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/otp-input.tsx
|
|
@@ -53,7 +53,7 @@ function o({ length: o = 6, value: s, onChange: c, onComplete: l, label: u, hint
|
|
|
53
53
|
onKeyDown: (e) => C(n, e),
|
|
54
54
|
onPaste: w,
|
|
55
55
|
onFocus: (e) => e.target.select(),
|
|
56
|
-
className: e("w-10 h-12 text-center text-lg font-semibold rounded-lg border bg-black/4 dark:bg-white/4", "text-
|
|
56
|
+
className: e("w-10 h-12 text-center text-lg font-semibold rounded-lg border bg-black/4 dark:bg-white/4", "text-foreground outline-none transition-colors", "focus:ring-[3px] focus:ring-accent-500/30", f ? "border-red-500/40 focus:border-red-500/50" : "border-slate-300 dark:border-white/10 focus:border-accent-500/40", p && "opacity-50 cursor-not-allowed")
|
|
57
57
|
}, n))
|
|
58
58
|
}),
|
|
59
59
|
f && /* @__PURE__ */ i("p", {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../use-event-callback-Du9_9eAi.cjs"),n=require("../motion-B2shivEB.cjs"),r=require("../use-focus-trap-CPLT49gN.cjs");let i=require("framer-motion"),a=require("react"),o=require("react/jsx-runtime"),s=require("react-dom");function c({open:c,onClose:l,children:u,portal:d=!0,disableScrollLock:f=!1,closeOnEscape:p=!0,closeOnOutsideClick:m=!0,zIndex:h=50,backdropClassName:g,panelClassName:_,className:v,containerClassName:y,ariaLabel:b,ariaLabelledby:x,ariaDescribedby:S,role:C=`dialog`}){let w=(0,a.useRef)(null),T=t.t(l),{restoreNow:E}=r.n(c);r.t(w,{active:c,onEscape:T,closeOnEscape:p,disableScrollLock:f}),(0,a.useEffect)(()=>{if(!c||!m)return;function e(e){w.current&&!w.current.contains(e.target)&&T()}return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[c,m,T]);let D=(0,o.jsx)(i.AnimatePresence,{onExitComplete:E,children:c&&(0,o.jsxs)(`div`,{className:e.t(`fixed inset-0 flex items-center justify-center p-4`,y),style:{zIndex:h},children:[(0,o.jsx)(i.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:n.n.overlay,className:e.t(`absolute inset-0 bg-overlay`,g),onClick:m?T:void 0,"aria-hidden":`true`}),(0,o.jsx)(i.motion.div,{ref:w,initial:{opacity:0,scale:.98,y:8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:8},transition:n.n.panelEnter,role:C,"aria-modal":C===`dialog`||void 0,"aria-label":x?void 0:b,"aria-labelledby":x,"aria-describedby":S,tabIndex:-1,className:e.t(`relative w-full rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay`,_,v),children:u})]})});return!d||typeof document>`u`?D:(0,s.createPortal)(D,document.body)}function l({open:r,onClose:a,className:s,zIndex:c=50,closeOnClick:l=!0}){let u=t.t(a);return(0,o.jsx)(i.AnimatePresence,{children:r&&(0,o.jsx)(i.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:n.n.overlay,className:e.t(`fixed inset-0 bg-overlay`,s),style:{zIndex:c},onClick:l?u:void 0,"aria-hidden":`true`})})}exports.Overlay=c,exports.OverlayBackdrop=l;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Overlay — shared primitive for Modal / Drawer / Dialog / Popover / Dropdown.
|
|
4
|
+
* Standardizes:
|
|
5
|
+
* - Portal (to document.body)
|
|
6
|
+
* - z-index layering
|
|
7
|
+
* - Escape handling
|
|
8
|
+
* - Outside click
|
|
9
|
+
* - Focus trap + restore
|
|
10
|
+
* - Scroll lock
|
|
11
|
+
*
|
|
12
|
+
* Individual components keep their own layout/animation but delegate
|
|
13
|
+
* overlay concerns here.
|
|
14
|
+
*/
|
|
15
|
+
export interface OverlayProps {
|
|
16
|
+
open: boolean;
|
|
17
|
+
onClose: () => void;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
/** Render without portal (for non-portaled overlays like inline Modal) */
|
|
20
|
+
portal?: boolean;
|
|
21
|
+
/** Disable scroll lock */
|
|
22
|
+
disableScrollLock?: boolean;
|
|
23
|
+
closeOnEscape?: boolean;
|
|
24
|
+
closeOnOutsideClick?: boolean;
|
|
25
|
+
/** z-index base (overlay) — panel renders at +1 */
|
|
26
|
+
zIndex?: number;
|
|
27
|
+
/** Class for the backdrop */
|
|
28
|
+
backdropClassName?: string;
|
|
29
|
+
/** Class for the panel wrapper */
|
|
30
|
+
panelClassName?: string;
|
|
31
|
+
/** Alias for the panel's root class, matching the component styling contract. */
|
|
32
|
+
className?: string;
|
|
33
|
+
/** Class for the fixed positioning container. */
|
|
34
|
+
containerClassName?: string;
|
|
35
|
+
/** Accessible label when no title is provided */
|
|
36
|
+
ariaLabel?: string;
|
|
37
|
+
ariaLabelledby?: string;
|
|
38
|
+
ariaDescribedby?: string;
|
|
39
|
+
/** If true, render as dialog */
|
|
40
|
+
role?: "dialog" | "menu" | "listbox";
|
|
41
|
+
}
|
|
42
|
+
export declare function Overlay({ open, onClose, children, portal, disableScrollLock, closeOnEscape, closeOnOutsideClick, zIndex, backdropClassName, panelClassName, className, containerClassName, ariaLabel, ariaLabelledby, ariaDescribedby, role, }: OverlayProps): import("react").JSX.Element;
|
|
43
|
+
/**
|
|
44
|
+
* OverlayBackdrop — standalone backdrop for Drawer/Popover that need custom positioning.
|
|
45
|
+
*/
|
|
46
|
+
export declare function OverlayBackdrop({ open, onClose, className, zIndex, closeOnClick, }: {
|
|
47
|
+
open: boolean;
|
|
48
|
+
onClose: () => void;
|
|
49
|
+
className?: string;
|
|
50
|
+
zIndex?: number;
|
|
51
|
+
closeOnClick?: boolean;
|
|
52
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { t } from "../use-event-callback-DGkfO_uu.js";
|
|
4
|
+
import { n } from "../motion-gnRzFS5f.js";
|
|
5
|
+
import { n as r, t as i } from "../use-focus-trap-CS6BXJAB.js";
|
|
6
|
+
import { AnimatePresence as a, motion as o } from "framer-motion";
|
|
7
|
+
import { useEffect as s, useRef as c } from "react";
|
|
8
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
9
|
+
import { createPortal as d } from "react-dom";
|
|
10
|
+
//#region src/components/overlay.tsx
|
|
11
|
+
function f({ open: f, onClose: p, children: m, portal: h = !0, disableScrollLock: g = !1, closeOnEscape: _ = !0, closeOnOutsideClick: v = !0, zIndex: y = 50, backdropClassName: b, panelClassName: x, className: S, containerClassName: C, ariaLabel: w, ariaLabelledby: T, ariaDescribedby: E, role: D = "dialog" }) {
|
|
12
|
+
let O = c(null), k = t(p), { restoreNow: A } = r(f);
|
|
13
|
+
i(O, {
|
|
14
|
+
active: f,
|
|
15
|
+
onEscape: k,
|
|
16
|
+
closeOnEscape: _,
|
|
17
|
+
disableScrollLock: g
|
|
18
|
+
}), s(() => {
|
|
19
|
+
if (!f || !v) return;
|
|
20
|
+
function e(e) {
|
|
21
|
+
O.current && !O.current.contains(e.target) && k();
|
|
22
|
+
}
|
|
23
|
+
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
24
|
+
}, [
|
|
25
|
+
f,
|
|
26
|
+
v,
|
|
27
|
+
k
|
|
28
|
+
]);
|
|
29
|
+
let j = /* @__PURE__ */ l(a, {
|
|
30
|
+
onExitComplete: A,
|
|
31
|
+
children: f && /* @__PURE__ */ u("div", {
|
|
32
|
+
className: e("fixed inset-0 flex items-center justify-center p-4", C),
|
|
33
|
+
style: { zIndex: y },
|
|
34
|
+
children: [/* @__PURE__ */ l(o.div, {
|
|
35
|
+
initial: { opacity: 0 },
|
|
36
|
+
animate: { opacity: 1 },
|
|
37
|
+
exit: { opacity: 0 },
|
|
38
|
+
transition: n.overlay,
|
|
39
|
+
className: e("absolute inset-0 bg-overlay", b),
|
|
40
|
+
onClick: v ? k : void 0,
|
|
41
|
+
"aria-hidden": "true"
|
|
42
|
+
}), /* @__PURE__ */ l(o.div, {
|
|
43
|
+
ref: O,
|
|
44
|
+
initial: {
|
|
45
|
+
opacity: 0,
|
|
46
|
+
scale: .98,
|
|
47
|
+
y: 8
|
|
48
|
+
},
|
|
49
|
+
animate: {
|
|
50
|
+
opacity: 1,
|
|
51
|
+
scale: 1,
|
|
52
|
+
y: 0
|
|
53
|
+
},
|
|
54
|
+
exit: {
|
|
55
|
+
opacity: 0,
|
|
56
|
+
scale: .98,
|
|
57
|
+
y: 8
|
|
58
|
+
},
|
|
59
|
+
transition: n.panelEnter,
|
|
60
|
+
role: D,
|
|
61
|
+
"aria-modal": D === "dialog" || void 0,
|
|
62
|
+
"aria-label": T ? void 0 : w,
|
|
63
|
+
"aria-labelledby": T,
|
|
64
|
+
"aria-describedby": E,
|
|
65
|
+
tabIndex: -1,
|
|
66
|
+
className: e("relative w-full rounded-[var(--radius-xl)] border border-border bg-surface-raised shadow-overlay", x, S),
|
|
67
|
+
children: m
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
return !h || typeof document > "u" ? j : d(j, document.body);
|
|
72
|
+
}
|
|
73
|
+
function p({ open: r, onClose: i, className: s, zIndex: c = 50, closeOnClick: u = !0 }) {
|
|
74
|
+
let d = t(i);
|
|
75
|
+
return /* @__PURE__ */ l(a, { children: r && /* @__PURE__ */ l(o.div, {
|
|
76
|
+
initial: { opacity: 0 },
|
|
77
|
+
animate: { opacity: 1 },
|
|
78
|
+
exit: { opacity: 0 },
|
|
79
|
+
transition: n.overlay,
|
|
80
|
+
className: e("fixed inset-0 bg-overlay", s),
|
|
81
|
+
style: { zIndex: c },
|
|
82
|
+
onClick: u ? d : void 0,
|
|
83
|
+
"aria-hidden": "true"
|
|
84
|
+
}) });
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { f as Overlay, p as OverlayBackdrop };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../component-styles-DY4wigiq.cjs");let n=require("react/jsx-runtime");function r(e,t){return Array.from({length:t-e+1},(t,n)=>e+n)}function i(e,t,n){if(t<=7)return r(1,t);let i=Math.max(2,e-n),a=Math.min(t-1,e+n),o=i>2,s=a<t-1;return!o&&s?[...r(1,3+n*2),`…`,t]:o&&!s?[1,`…`,...r(t-2-n*2,t)]:[1,`…`,...r(i,a),`…`,t]}var a=(0,n.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`m15 18-6-6 6-6`})}),o=(0,n.jsx)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,n.jsx)(`path`,{d:`m9 18 6-6-6-6`})});function s({page:r,totalPages:s,onPageChange:c,siblingCount:l=1,className:u}){if(s<=1)return null;let d=i(r,s,l);function f(i,a,o,s=!1){return(0,n.jsx)(`button`,{type:`button`,disabled:o,onClick:()=>!o&&c(a),"aria-current":s?`page`:void 0,"aria-label":typeof i==`number`?`Page ${i}`:a<r?`Previous page`:`Next page`,className:e.t(`flex items-center justify-center min-w-8 h-8 px-2 rounded-[var(--radius-md)] border text-sm font-medium transition-colors`,t.s,s?`border-accent-200 bg-accent-50 text-accent-700 dark:border-accent-500/20 dark:bg-accent-500/15 dark:text-accent-300`:`border-transparent text-muted-foreground hover:bg-muted hover:text-foreground`,o&&`opacity-40 cursor-not-allowed pointer-events-none`),children:i},typeof i==`number`?i:`${i}-${a}`)}return(0,n.jsxs)(`nav`,{className:e.t(`flex items-center gap-1`,u),"aria-label":`Pagination`,children:[f(a,r-1,r<=1),d.map((e,t)=>e===`…`?(0,n.jsx)(`span`,{className:`flex items-end justify-center w-8 h-8 text-slate-500 text-sm pb-1`,children:`…`},`dots-${t}`):f(e,e,!1,e===r)),f(o,r+1,r>=s)]})}exports.Pagination=s;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { t as e } from "../cn-
|
|
3
|
-
import { s as t } from "../component-styles-
|
|
2
|
+
import { t as e } from "../cn-BJyZJP-y.js";
|
|
3
|
+
import { s as t } from "../component-styles-C2CbHEEA.js";
|
|
4
4
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
5
5
|
//#region src/components/pagination.tsx
|
|
6
6
|
function i(e, t) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-
|
|
1
|
+
"use client";Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../cn-B6R3HKzx.cjs"),t=require("../motion-B2shivEB.cjs");let n=require("framer-motion"),r=require("react"),i=require("react/jsx-runtime");var a={top:{container:`bottom-full mb-2`,initial:{y:4}},bottom:{container:`top-full mt-2`,initial:{y:-4}},left:{container:`right-full mr-2`,initial:{x:4}},right:{container:`left-full ml-2`,initial:{x:-4}}},o={top:{start:`left-0`,center:`left-1/2 -translate-x-1/2`,end:`right-0`},bottom:{start:`left-0`,center:`left-1/2 -translate-x-1/2`,end:`right-0`},left:{start:`top-0`,center:`top-1/2 -translate-y-1/2`,end:`bottom-0`},right:{start:`top-0`,center:`top-1/2 -translate-y-1/2`,end:`bottom-0`}};function s({trigger:s,children:c,side:l=`bottom`,align:u=`start`,className:d,wrapperClassName:f,open:p,onOpenChange:m,ariaLabel:h=`Popover`}){let[g,_]=(0,r.useState)(!1),v=p??g,y=(0,r.useRef)(null),b=(0,r.useId)();function x(){let e=!v;p===void 0&&_(e),m?.(e)}function S(){p===void 0&&_(!1),m?.(!1)}(0,r.useEffect)(()=>{function e(e){y.current?.contains(e.target)||S()}function t(e){e.key===`Escape`&&v&&(e.preventDefault(),S(),y.current?.querySelector(`[aria-haspopup="dialog"]`)?.focus())}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[b,v]);let{container:C,initial:w}=a[l],T=o[l][u],E=(0,r.isValidElement)(s)?(0,r.cloneElement)(s,{"aria-haspopup":`dialog`,"aria-expanded":v,"aria-controls":b,onClick:e=>{s.props.onClick?.(e),e.defaultPrevented||x()}}):(0,i.jsx)(`button`,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":v,"aria-controls":b,onClick:x,children:s});return(0,i.jsxs)(`div`,{ref:y,className:e.t(`relative inline-flex`,f),children:[E,(0,i.jsx)(n.AnimatePresence,{children:v&&(0,i.jsx)(n.motion.div,{id:b,role:`dialog`,"aria-label":h,initial:{opacity:0,...w},animate:{opacity:1,y:0,x:0},exit:{opacity:0,...w},transition:t.n.fade,className:e.t(`absolute z-50 min-w-[180px] rounded-[var(--radius-lg)] border border-border bg-surface-raised shadow-floating`,C,T,d),children:c})})]})}function c({className:t,children:n,...r}){return(0,i.jsx)(`div`,{className:e.t(`p-3`,t),...r,children:n})}exports.Popover=s,exports.PopoverContent=c;
|
|
@@ -7,10 +7,11 @@ export interface PopoverProps {
|
|
|
7
7
|
side?: PopoverSide;
|
|
8
8
|
align?: PopoverAlign;
|
|
9
9
|
className?: string;
|
|
10
|
+
wrapperClassName?: string;
|
|
10
11
|
open?: boolean;
|
|
11
12
|
onOpenChange?: (open: boolean) => void;
|
|
12
13
|
ariaLabel?: string;
|
|
13
14
|
}
|
|
14
|
-
export declare function Popover({ trigger, children, side, align, className, open: controlledOpen, onOpenChange, ariaLabel, }: PopoverProps): import("react").JSX.Element;
|
|
15
|
+
export declare function Popover({ trigger, children, side, align, className, wrapperClassName, open: controlledOpen, onOpenChange, ariaLabel, }: PopoverProps): import("react").JSX.Element;
|
|
15
16
|
export declare function PopoverContent({ className, children, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
|
|
16
17
|
export {};
|