@middag-io/react 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist-lib/base/blocks/ActivityTimelineBlock.d.ts.map +1 -1
- package/dist-lib/base/shell/AuthShell.js +39 -0
- package/dist-lib/base/shell/BasicShell.js +207 -0
- package/dist-lib/base/shell/ImmersiveShell.js +55 -0
- package/dist-lib/base/shell/partials/InspectorContext.d.ts.map +1 -1
- package/dist-lib/base/shell/partials/InspectorContext.js +60 -0
- package/dist-lib/base/shell/partials/InspectorPanel.js +22 -0
- package/dist-lib/base/shell/partials/NavErrorBoundary.js +66 -0
- package/dist-lib/base/shell/partials/OverlayScreen.js +36 -0
- package/dist-lib/base/shell/partials/PageActionButton.js +4 -0
- package/dist-lib/base/theme/appearance.js +39 -0
- package/dist-lib/base/theme/host-layout-detector.js +39 -0
- package/dist-lib/base/theme/host-theme-detector.js +131 -0
- package/dist-lib/base/theme/sidebar-safelist.txt +20 -0
- package/dist-lib/base/theme/theme-bridge.css +164 -0
- package/dist-lib/base/theme/theme-context.js +103 -0
- package/dist-lib/base/theme/themes/classic.css +174 -0
- package/dist-lib/base/theme/tokens.css +290 -0
- package/dist-lib/base/theme/useHostTheme.js +34 -0
- package/dist-lib/base/utils/clipboard.js +16 -0
- package/dist-lib/base/utils/conditions.js +13 -0
- package/dist-lib/base/utils/icon-registry.js +16 -0
- package/dist-lib/base/utils/icons.js +11 -0
- package/dist-lib/base/utils/interpolate.js +6 -0
- package/dist-lib/base/utils/register-default-icons.js +9 -0
- package/dist-lib/base/utils/storage.js +30 -0
- package/dist-lib/base/utils/time.js +59 -0
- package/dist-lib/chunks/subpath-BD_PKGUX.js +146 -0
- package/dist-lib/chunks/subpath-DLFO_UGQ.js +604 -0
- package/dist-lib/components/reui/accordion.js +43 -0
- package/dist-lib/components/reui/alert-dialog.js +101 -0
- package/dist-lib/components/reui/alert.js +55 -0
- package/dist-lib/components/reui/aspect-ratio.js +11 -0
- package/dist-lib/components/reui/autocomplete.js +170 -0
- package/dist-lib/components/reui/avatar.js +51 -0
- package/dist-lib/components/reui/badge.js +64 -0
- package/dist-lib/components/reui/breadcrumb.js +69 -0
- package/dist-lib/components/reui/button-group.js +38 -0
- package/dist-lib/components/reui/button.js +47 -0
- package/dist-lib/components/reui/calendar.js +89 -0
- package/dist-lib/components/reui/card.js +55 -0
- package/dist-lib/components/reui/carousel.js +110 -0
- package/dist-lib/components/reui/chart.js +130 -0
- package/dist-lib/components/reui/checkbox.js +20 -0
- package/dist-lib/components/reui/collapsible.js +23 -0
- package/dist-lib/components/reui/combobox.js +166 -0
- package/dist-lib/components/reui/command.js +85 -0
- package/dist-lib/components/reui/context-menu.js +121 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-filter.js +108 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-header.js +217 -0
- package/dist-lib/components/reui/data-grid/data-grid-column-visibility.js +25 -0
- package/dist-lib/components/reui/data-grid/data-grid-pagination.js +132 -0
- package/dist-lib/components/reui/data-grid/data-grid-scroll-area.js +183 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd-rows.js +125 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-dnd.js +130 -0
- package/dist-lib/components/reui/data-grid/data-grid-table-virtual.js +156 -0
- package/dist-lib/components/reui/data-grid/data-grid-table.js +546 -0
- package/dist-lib/components/reui/data-grid/data-grid.js +113 -0
- package/dist-lib/components/reui/data-grid-pagination.js +131 -0
- package/dist-lib/components/reui/date-selector.js +642 -0
- package/dist-lib/components/reui/dialog.js +94 -0
- package/dist-lib/components/reui/drawer.js +77 -0
- package/dist-lib/components/reui/dropdown-menu.js +123 -0
- package/dist-lib/components/reui/empty.js +59 -0
- package/dist-lib/components/reui/field.js +115 -0
- package/dist-lib/components/reui/filters.js +873 -0
- package/dist-lib/components/reui/frame.js +97 -0
- package/dist-lib/components/reui/hover-card.js +31 -0
- package/dist-lib/components/reui/icon-placeholder.js +14 -0
- package/dist-lib/components/reui/index.js +18 -0
- package/dist-lib/components/reui/input-group.js +78 -0
- package/dist-lib/components/reui/input-otp.js +44 -0
- package/dist-lib/components/reui/input.js +14 -0
- package/dist-lib/components/reui/item.js +116 -0
- package/dist-lib/components/reui/kanban.js +316 -0
- package/dist-lib/components/reui/kbd.js +19 -0
- package/dist-lib/components/reui/label.js +14 -0
- package/dist-lib/components/reui/menubar.js +132 -0
- package/dist-lib/components/reui/native-select.js +37 -0
- package/dist-lib/components/reui/navigation-menu.js +80 -0
- package/dist-lib/components/reui/number-field.js +126 -0
- package/dist-lib/components/reui/pagination.js +78 -0
- package/dist-lib/components/reui/phone-input.js +124 -0
- package/dist-lib/components/reui/popover.js +55 -0
- package/dist-lib/components/reui/progress.js +20 -0
- package/dist-lib/components/reui/radio-group.js +27 -0
- package/dist-lib/components/reui/rating.js +81 -0
- package/dist-lib/components/reui/resizable.js +31 -0
- package/dist-lib/components/reui/scroll-area.js +36 -0
- package/dist-lib/components/reui/scrollspy.js +104 -0
- package/dist-lib/components/reui/select.js +97 -0
- package/dist-lib/components/reui/separator.js +17 -0
- package/dist-lib/components/reui/sheet.js +81 -0
- package/dist-lib/components/reui/sidebar.js +350 -0
- package/dist-lib/components/reui/skeleton.js +12 -0
- package/dist-lib/components/reui/slider.js +35 -0
- package/dist-lib/components/reui/sonner.js +28 -0
- package/dist-lib/components/reui/sortable.js +172 -0
- package/dist-lib/components/reui/spinner.js +14 -0
- package/dist-lib/components/reui/stepper.js +193 -0
- package/dist-lib/components/reui/svgs/claudeAiIcon.js +13 -0
- package/dist-lib/components/reui/svgs/gemini.js +257 -0
- package/dist-lib/components/reui/svgs/openai.js +10 -0
- package/dist-lib/components/reui/svgs/openaiDark.js +13 -0
- package/dist-lib/components/reui/switch.js +19 -0
- package/dist-lib/components/reui/table.js +66 -0
- package/dist-lib/components/reui/tabs.js +47 -0
- package/dist-lib/components/reui/textarea.js +13 -0
- package/dist-lib/components/reui/timeline.js +84 -0
- package/dist-lib/components/reui/toggle-group.js +48 -0
- package/dist-lib/components/reui/toggle.js +36 -0
- package/dist-lib/components/reui/tooltip.js +35 -0
- package/dist-lib/components/reui/tree.js +102 -0
- package/dist-lib/contracts/block-data/data-display.d.ts +8 -0
- package/dist-lib/contracts/block-data/data-display.d.ts.map +1 -1
- package/dist-lib/i18n/I18nProvider.js +23 -0
- package/dist-lib/i18n/host-resolver.js +10 -0
- package/dist-lib/i18n/instance.js +2 -0
- package/dist-lib/i18n/locales/en/ui.json +266 -0
- package/dist-lib/i18n/locales/en/validators.json +13 -0
- package/dist-lib/i18n/locales/pt-BR/ui.json +266 -0
- package/dist-lib/i18n/locales/pt-BR/validators.json +13 -0
- package/dist-lib/i18n/register-strings.js +7 -0
- package/dist-lib/i18n/render-label.js +13 -0
- package/dist-lib/i18n/resolve-field-error.js +10 -0
- package/dist-lib/i18n/useHostString.js +31 -0
- package/dist-lib/i18n/useTranslation.js +48 -0
- package/dist-lib/lib/actions/resolve-action-target.js +48 -0
- package/dist-lib/lib/hooks/use-copy-to-clipboard.js +18 -0
- package/dist-lib/lib/hooks/use-file-upload.js +171 -0
- package/dist-lib/lib/hooks/use-mobile.js +18 -0
- package/dist-lib/lib/portal-container.js +7 -0
- package/dist-lib/lib/utils.js +8 -0
- package/dist-lib/middag-react.css +1 -1
- package/dist-lib/middag-react.js +26 -5
- package/package.json +39 -7
- package/dist-lib/_redirects +0 -1
- package/dist-lib/api/example/moodle/get/books.json +0 -209
- package/dist-lib/api/example/moodle/get/dashboard.json +0 -203
- package/dist-lib/api/example/wordpress/get/products.json +0 -165
- package/dist-lib/api/index.json +0 -66
- package/dist-lib/api/inspector/connectors/canvas.json +0 -18
- package/dist-lib/api/inspector/connectors/moodle.json +0 -18
- package/dist-lib/api/inspector/connectors/n8n.json +0 -18
- package/dist-lib/api/inspector/connectors/open-edx.json +0 -18
- package/dist-lib/api/inspector/offerings/off-1.json +0 -18
- package/dist-lib/api/inspector/offerings/off-2.json +0 -18
- package/dist-lib/api/inspector/offerings/off-3.json +0 -18
- package/dist-lib/api/inspector/offerings/off-4.json +0 -18
- package/dist-lib/api/inspector/offerings/off-5.json +0 -18
- package/dist-lib/api/inspector/offerings/off-6.json +0 -17
- package/dist-lib/lottie/calendar/schedule-1.json +0 -1
- package/dist-lib/lottie/calendar/schedule-2.json +0 -1
- package/dist-lib/lottie/celebration/confetti-1.json +0 -1
- package/dist-lib/lottie/celebration/confetti-2.json +0 -1
- package/dist-lib/lottie/celebration/confetti-3.json +0 -1
- package/dist-lib/lottie/cloud/cloud-1.json +0 -1
- package/dist-lib/lottie/cloud/cloud-2.json +0 -1
- package/dist-lib/lottie/connection/network-1.json +0 -1
- package/dist-lib/lottie/connection/network-2.json +0 -1
- package/dist-lib/lottie/connection/network-3.json +0 -1
- package/dist-lib/lottie/dashboard/analytics-1.json +0 -1
- package/dist-lib/lottie/dashboard/analytics-2.json +0 -1
- package/dist-lib/lottie/dashboard/analytics-3.json +0 -1
- package/dist-lib/lottie/email/mail-1.json +0 -1
- package/dist-lib/lottie/email/mail-2.json +0 -1
- package/dist-lib/lottie/email/mail-3.json +0 -1
- package/dist-lib/lottie/empty-state/empty-1.json +0 -1
- package/dist-lib/lottie/empty-state/empty-2.json +0 -1
- package/dist-lib/lottie/empty-state/empty-3.json +0 -1
- package/dist-lib/lottie/error/warning-1.json +0 -1
- package/dist-lib/lottie/error/warning-2.json +0 -1
- package/dist-lib/lottie/error/warning-3.json +0 -1
- package/dist-lib/lottie/index.ts +0 -49
- package/dist-lib/lottie/loading/spinner-1.json +0 -1
- package/dist-lib/lottie/loading/spinner-2.json +0 -1
- package/dist-lib/lottie/loading/spinner-3.json +0 -1
- package/dist-lib/lottie/maintenance/construction-1.json +0 -1
- package/dist-lib/lottie/maintenance/construction-2.json +0 -1
- package/dist-lib/lottie/maintenance/construction-3.json +0 -1
- package/dist-lib/lottie/not-found/404-1.json +0 -1
- package/dist-lib/lottie/not-found/404-2.json +0 -1
- package/dist-lib/lottie/not-found/404-3.json +0 -1
- package/dist-lib/lottie/notification/bell-1.json +0 -1
- package/dist-lib/lottie/notification/bell-2.json +0 -1
- package/dist-lib/lottie/notification/bell-3.json +0 -1
- package/dist-lib/lottie/onboarding/welcome-1.json +0 -1
- package/dist-lib/lottie/onboarding/welcome-2.json +0 -1
- package/dist-lib/lottie/onboarding/welcome-3.json +0 -1
- package/dist-lib/lottie/payment/wallet-1.json +0 -1
- package/dist-lib/lottie/payment/wallet-2.json +0 -1
- package/dist-lib/lottie/payment/wallet-3.json +0 -1
- package/dist-lib/lottie/search/search-1.json +0 -1
- package/dist-lib/lottie/search/search-2.json +0 -1
- package/dist-lib/lottie/search/search-3.json +0 -1
- package/dist-lib/lottie/security/lock-1.json +0 -1
- package/dist-lib/lottie/security/lock-2.json +0 -1
- package/dist-lib/lottie/security/lock-3.json +0 -1
- package/dist-lib/lottie/settings/gear-1.json +0 -1
- package/dist-lib/lottie/settings/gear-2.json +0 -1
- package/dist-lib/lottie/settings/gear-3.json +0 -1
- package/dist-lib/lottie/success/check-1.json +0 -1
- package/dist-lib/lottie/success/check-2.json +0 -1
- package/dist-lib/lottie/success/check-3.json +0 -1
- package/dist-lib/lottie/upload/upload-1.json +0 -1
- package/dist-lib/lottie/upload/upload-2.json +0 -1
- package/dist-lib/lottie/upload/upload-3.json +0 -1
- package/dist-lib/lottie/user/profile-1.json +0 -1
- package/dist-lib/lottie/user/profile-2.json +0 -1
- package/dist-lib/lottie/user/profile-3.json +0 -1
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useCallback as e, useEffect as t, useRef as n } from "react";
|
|
3
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/reui/scrollspy.tsx
|
|
5
|
+
function i({ children: i, targetRef: a, onUpdate: o, className: s, offset: c = 0, smooth: l = !0, dataAttribute: u = "scrollspy", history: d = !0 }) {
|
|
6
|
+
let f = n(null), p = n(null), m = n(null), h = e((e, t = !1) => {
|
|
7
|
+
e && (p.current?.forEach((t) => {
|
|
8
|
+
t.getAttribute(`data-${u}-anchor`) === e ? t.setAttribute("data-active", "true") : t.removeAttribute("data-active");
|
|
9
|
+
}), o && o(e), d && (t || m.current !== e) && window.history.replaceState({}, "", `#${e}`), m.current = e);
|
|
10
|
+
}, [
|
|
11
|
+
p,
|
|
12
|
+
u,
|
|
13
|
+
d,
|
|
14
|
+
o
|
|
15
|
+
]), g = e(() => {
|
|
16
|
+
if (!p.current || p.current.length === 0) return;
|
|
17
|
+
let e = a?.current === document ? document.documentElement : a?.current;
|
|
18
|
+
if (!e) return;
|
|
19
|
+
let t = e.querySelector("[data-slot=\"scroll-area-viewport\"]");
|
|
20
|
+
t instanceof HTMLElement && (e = t);
|
|
21
|
+
let n = e === document.documentElement ? window.scrollY || document.documentElement.scrollTop : e.scrollTop, r = 0, i = Infinity;
|
|
22
|
+
p.current.forEach((e, t) => {
|
|
23
|
+
let a = e.getAttribute(`data-${u}-anchor`), o = document.getElementById(a);
|
|
24
|
+
if (!o) return;
|
|
25
|
+
let s = c, l = e.getAttribute(`data-${u}-offset`);
|
|
26
|
+
l && (s = parseInt(l, 10));
|
|
27
|
+
let d = Math.abs(o.offsetTop - s - n);
|
|
28
|
+
o.offsetTop - s <= n && d < i && (i = d, r = t);
|
|
29
|
+
});
|
|
30
|
+
let o = e.scrollHeight;
|
|
31
|
+
n + e.clientHeight >= o - 2 && (r = p.current.length - 1), h(p.current[r]?.getAttribute(`data-${u}-anchor`) || null);
|
|
32
|
+
}, [
|
|
33
|
+
p,
|
|
34
|
+
a,
|
|
35
|
+
u,
|
|
36
|
+
c,
|
|
37
|
+
h
|
|
38
|
+
]), _ = e((e) => (t) => {
|
|
39
|
+
t && t.preventDefault();
|
|
40
|
+
let n = e.getAttribute(`data-${u}-anchor`)?.replace("#", "") || null;
|
|
41
|
+
if (!n) return;
|
|
42
|
+
let r = document.getElementById(n);
|
|
43
|
+
if (!r) return;
|
|
44
|
+
let i = a?.current === document ? window : a?.current;
|
|
45
|
+
if (i instanceof HTMLElement) {
|
|
46
|
+
let e = i.querySelector("[data-slot=\"scroll-area-viewport\"]");
|
|
47
|
+
e instanceof HTMLElement && (i = e);
|
|
48
|
+
}
|
|
49
|
+
let o = c, s = e.getAttribute(`data-${u}-offset`);
|
|
50
|
+
s && (o = parseInt(s, 10));
|
|
51
|
+
let d = r.offsetTop - o;
|
|
52
|
+
i && "scrollTo" in i && i.scrollTo({
|
|
53
|
+
top: d,
|
|
54
|
+
left: 0,
|
|
55
|
+
behavior: l ? "smooth" : "auto"
|
|
56
|
+
}), h(n, !0);
|
|
57
|
+
}, [
|
|
58
|
+
u,
|
|
59
|
+
c,
|
|
60
|
+
l,
|
|
61
|
+
a,
|
|
62
|
+
h
|
|
63
|
+
]), v = e(() => {
|
|
64
|
+
let e = CSS.escape(window.location.hash.replace("#", ""));
|
|
65
|
+
if (e) {
|
|
66
|
+
let t = document.querySelector(`[data-${u}-anchor="${e}"]`);
|
|
67
|
+
t && _(t)();
|
|
68
|
+
}
|
|
69
|
+
}, [u, _]);
|
|
70
|
+
return t(() => {
|
|
71
|
+
f.current && (p.current = Array.from(f.current.querySelectorAll(`[data-${u}-anchor]`)));
|
|
72
|
+
let e = p.current;
|
|
73
|
+
e?.forEach((e) => {
|
|
74
|
+
e.addEventListener("click", _(e));
|
|
75
|
+
});
|
|
76
|
+
let t = (e) => {
|
|
77
|
+
let t = a?.current === document ? window : a?.current;
|
|
78
|
+
t && (t === window || t instanceof HTMLElement && t.contains(e.target)) && g();
|
|
79
|
+
};
|
|
80
|
+
window.addEventListener("scroll", t, !0);
|
|
81
|
+
let n = setTimeout(() => {
|
|
82
|
+
v(), g();
|
|
83
|
+
}, 100);
|
|
84
|
+
return () => {
|
|
85
|
+
window.removeEventListener("scroll", t, !0), e?.forEach((e) => {
|
|
86
|
+
e.removeEventListener("click", _(e));
|
|
87
|
+
}), clearTimeout(n);
|
|
88
|
+
};
|
|
89
|
+
}, [
|
|
90
|
+
a,
|
|
91
|
+
f,
|
|
92
|
+
g,
|
|
93
|
+
u,
|
|
94
|
+
_,
|
|
95
|
+
v
|
|
96
|
+
]), /* @__PURE__ */ r("div", {
|
|
97
|
+
"data-slot": "scrollspy",
|
|
98
|
+
className: s,
|
|
99
|
+
ref: f,
|
|
100
|
+
children: i
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
//#endregion
|
|
104
|
+
export { i as Scrollspy };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { CheckIcon as t, ChevronDownIcon as n, ChevronUpIcon as r } from "lucide-react";
|
|
4
|
+
import { Select as i } from "radix-ui";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/select.tsx
|
|
7
|
+
function s({ ...e }) {
|
|
8
|
+
return /* @__PURE__ */ a(i.Root, {
|
|
9
|
+
"data-slot": "select",
|
|
10
|
+
...e
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function c({ ...e }) {
|
|
14
|
+
return /* @__PURE__ */ a(i.Group, {
|
|
15
|
+
"data-slot": "select-group",
|
|
16
|
+
...e
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function l({ ...e }) {
|
|
20
|
+
return /* @__PURE__ */ a(i.Value, {
|
|
21
|
+
"data-slot": "select-value",
|
|
22
|
+
...e
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function u({ className: t, size: r = "default", children: s, ...c }) {
|
|
26
|
+
return /* @__PURE__ */ o(i.Trigger, {
|
|
27
|
+
"data-slot": "select-trigger",
|
|
28
|
+
"data-size": r,
|
|
29
|
+
className: e("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", t),
|
|
30
|
+
...c,
|
|
31
|
+
children: [s, /* @__PURE__ */ a(i.Icon, {
|
|
32
|
+
asChild: !0,
|
|
33
|
+
children: /* @__PURE__ */ a(n, { className: "size-4 opacity-50" })
|
|
34
|
+
})]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function d({ className: t, children: n, position: r = "item-aligned", align: s = "center", ...c }) {
|
|
38
|
+
return /* @__PURE__ */ a(i.Portal, { children: /* @__PURE__ */ o(i.Content, {
|
|
39
|
+
"data-slot": "select-content",
|
|
40
|
+
className: e("relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", r === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1", t),
|
|
41
|
+
position: r,
|
|
42
|
+
align: s,
|
|
43
|
+
...c,
|
|
44
|
+
children: [
|
|
45
|
+
/* @__PURE__ */ a(h, {}),
|
|
46
|
+
/* @__PURE__ */ a(i.Viewport, {
|
|
47
|
+
className: e("p-1", r === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),
|
|
48
|
+
children: n
|
|
49
|
+
}),
|
|
50
|
+
/* @__PURE__ */ a(g, {})
|
|
51
|
+
]
|
|
52
|
+
}) });
|
|
53
|
+
}
|
|
54
|
+
function f({ className: t, ...n }) {
|
|
55
|
+
return /* @__PURE__ */ a(i.Label, {
|
|
56
|
+
"data-slot": "select-label",
|
|
57
|
+
className: e("px-2 py-1.5 text-xs text-muted-foreground", t),
|
|
58
|
+
...n
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
function p({ className: n, children: r, ...s }) {
|
|
62
|
+
return /* @__PURE__ */ o(i.Item, {
|
|
63
|
+
"data-slot": "select-item",
|
|
64
|
+
className: e("relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2", n),
|
|
65
|
+
...s,
|
|
66
|
+
children: [/* @__PURE__ */ a("span", {
|
|
67
|
+
"data-slot": "select-item-indicator",
|
|
68
|
+
className: "absolute right-2 flex size-3.5 items-center justify-center",
|
|
69
|
+
children: /* @__PURE__ */ a(i.ItemIndicator, { children: /* @__PURE__ */ a(t, { className: "size-4" }) })
|
|
70
|
+
}), /* @__PURE__ */ a(i.ItemText, { children: r })]
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function m({ className: t, ...n }) {
|
|
74
|
+
return /* @__PURE__ */ a(i.Separator, {
|
|
75
|
+
"data-slot": "select-separator",
|
|
76
|
+
className: e("pointer-events-none -mx-1 my-1 h-px bg-border", t),
|
|
77
|
+
...n
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
function h({ className: t, ...n }) {
|
|
81
|
+
return /* @__PURE__ */ a(i.ScrollUpButton, {
|
|
82
|
+
"data-slot": "select-scroll-up-button",
|
|
83
|
+
className: e("flex cursor-default items-center justify-center py-1", t),
|
|
84
|
+
...n,
|
|
85
|
+
children: /* @__PURE__ */ a(r, { className: "size-4" })
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function g({ className: t, ...r }) {
|
|
89
|
+
return /* @__PURE__ */ a(i.ScrollDownButton, {
|
|
90
|
+
"data-slot": "select-scroll-down-button",
|
|
91
|
+
className: e("flex cursor-default items-center justify-center py-1", t),
|
|
92
|
+
...r,
|
|
93
|
+
children: /* @__PURE__ */ a(n, { className: "size-4" })
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { s as Select, d as SelectContent, c as SelectGroup, p as SelectItem, f as SelectLabel, g as SelectScrollDownButton, h as SelectScrollUpButton, m as SelectSeparator, u as SelectTrigger, l as SelectValue };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import { Separator as t } from "radix-ui";
|
|
5
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/separator.tsx
|
|
7
|
+
function r({ className: r, orientation: i = "horizontal", decorative: a = !0, ...o }) {
|
|
8
|
+
return /* @__PURE__ */ n(t.Root, {
|
|
9
|
+
"data-slot": "separator",
|
|
10
|
+
decorative: a,
|
|
11
|
+
orientation: i,
|
|
12
|
+
className: e("shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px", r),
|
|
13
|
+
...o
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { r as Separator };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import "react";
|
|
3
|
+
import { XIcon as t } from "lucide-react";
|
|
4
|
+
import { Dialog as n } from "radix-ui";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/reui/sheet.tsx
|
|
7
|
+
function a({ ...e }) {
|
|
8
|
+
return /* @__PURE__ */ r(n.Root, {
|
|
9
|
+
"data-slot": "sheet",
|
|
10
|
+
...e
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function o({ ...e }) {
|
|
14
|
+
return /* @__PURE__ */ r(n.Trigger, {
|
|
15
|
+
"data-slot": "sheet-trigger",
|
|
16
|
+
...e
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function s({ ...e }) {
|
|
20
|
+
return /* @__PURE__ */ r(n.Close, {
|
|
21
|
+
"data-slot": "sheet-close",
|
|
22
|
+
...e
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function c({ ...e }) {
|
|
26
|
+
return /* @__PURE__ */ r(n.Portal, {
|
|
27
|
+
"data-slot": "sheet-portal",
|
|
28
|
+
...e
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
function l({ className: t, ...i }) {
|
|
32
|
+
return /* @__PURE__ */ r(n.Overlay, {
|
|
33
|
+
"data-slot": "sheet-overlay",
|
|
34
|
+
className: e("fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0", t),
|
|
35
|
+
...i
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function u({ className: a, children: o, side: s = "right", showCloseButton: u = !0, ...d }) {
|
|
39
|
+
return /* @__PURE__ */ i(c, { children: [/* @__PURE__ */ r(l, {}), /* @__PURE__ */ i(n.Content, {
|
|
40
|
+
"data-slot": "sheet-content",
|
|
41
|
+
className: e("fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500", s === "right" && "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", s === "left" && "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", s === "top" && "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", s === "bottom" && "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", a),
|
|
42
|
+
...d,
|
|
43
|
+
children: [o, u && /* @__PURE__ */ i(n.Close, {
|
|
44
|
+
className: "absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary",
|
|
45
|
+
children: [/* @__PURE__ */ r(t, { className: "size-4" }), /* @__PURE__ */ r("span", {
|
|
46
|
+
className: "sr-only",
|
|
47
|
+
children: "Close"
|
|
48
|
+
})]
|
|
49
|
+
})]
|
|
50
|
+
})] });
|
|
51
|
+
}
|
|
52
|
+
function d({ className: t, ...n }) {
|
|
53
|
+
return /* @__PURE__ */ r("div", {
|
|
54
|
+
"data-slot": "sheet-header",
|
|
55
|
+
className: e("flex flex-col gap-1.5 p-4", t),
|
|
56
|
+
...n
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function f({ className: t, ...n }) {
|
|
60
|
+
return /* @__PURE__ */ r("div", {
|
|
61
|
+
"data-slot": "sheet-footer",
|
|
62
|
+
className: e("mt-auto flex flex-col gap-2 p-4", t),
|
|
63
|
+
...n
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function p({ className: t, ...i }) {
|
|
67
|
+
return /* @__PURE__ */ r(n.Title, {
|
|
68
|
+
"data-slot": "sheet-title",
|
|
69
|
+
className: e("font-semibold text-foreground", t),
|
|
70
|
+
...i
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
function m({ className: t, ...i }) {
|
|
74
|
+
return /* @__PURE__ */ r(n.Description, {
|
|
75
|
+
"data-slot": "sheet-description",
|
|
76
|
+
className: e("text-sm text-muted-foreground", t),
|
|
77
|
+
...i
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
//#endregion
|
|
81
|
+
export { a as Sheet, s as SheetClose, u as SheetContent, m as SheetDescription, f as SheetFooter, d as SheetHeader, p as SheetTitle, o as SheetTrigger };
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn as e } from "../../lib/utils.js";
|
|
3
|
+
import { Button as t } from "./button.js";
|
|
4
|
+
import { Separator as n } from "./separator.js";
|
|
5
|
+
import { Input as r } from "./input.js";
|
|
6
|
+
import { Skeleton as i } from "./skeleton.js";
|
|
7
|
+
import { useIsMobile as a } from "../../lib/hooks/use-mobile.js";
|
|
8
|
+
import { Tooltip as o, TooltipContent as s, TooltipProvider as c, TooltipTrigger as l } from "./tooltip.js";
|
|
9
|
+
import { Sheet as u, SheetContent as d, SheetDescription as f, SheetHeader as p, SheetTitle as m } from "./sheet.js";
|
|
10
|
+
import * as h from "react";
|
|
11
|
+
import { PanelLeftIcon as g } from "lucide-react";
|
|
12
|
+
import { Slot as _ } from "radix-ui";
|
|
13
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
14
|
+
import { cva as b } from "class-variance-authority";
|
|
15
|
+
//#region src/components/reui/sidebar.tsx
|
|
16
|
+
var x = "sidebar_state", S = 3600 * 24 * 7, C = "16rem", w = "18rem", T = "3rem", E = "b", D = h.createContext(null);
|
|
17
|
+
function O() {
|
|
18
|
+
let e = h.useContext(D);
|
|
19
|
+
if (!e) throw Error("useSidebar must be used within a SidebarProvider.");
|
|
20
|
+
return e;
|
|
21
|
+
}
|
|
22
|
+
function k({ defaultOpen: t = !0, open: n, onOpenChange: r, className: i, style: o, children: s, ...l }) {
|
|
23
|
+
let u = a(), [d, f] = h.useState(!1), [p, m] = h.useState(t), g = n ?? p, _ = h.useCallback((e) => {
|
|
24
|
+
let t = typeof e == "function" ? e(g) : e;
|
|
25
|
+
r ? r(t) : m(t), document.cookie = `${x}=${t}; path=/; max-age=${S}`;
|
|
26
|
+
}, [r, g]), y = h.useCallback(() => u ? f((e) => !e) : _((e) => !e), [
|
|
27
|
+
u,
|
|
28
|
+
_,
|
|
29
|
+
f
|
|
30
|
+
]);
|
|
31
|
+
h.useEffect(() => {
|
|
32
|
+
let e = (e) => {
|
|
33
|
+
e.key === E && (e.metaKey || e.ctrlKey) && (e.preventDefault(), y());
|
|
34
|
+
};
|
|
35
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
36
|
+
}, [y]);
|
|
37
|
+
let b = g ? "expanded" : "collapsed", w = h.useMemo(() => ({
|
|
38
|
+
state: b,
|
|
39
|
+
open: g,
|
|
40
|
+
setOpen: _,
|
|
41
|
+
isMobile: u,
|
|
42
|
+
openMobile: d,
|
|
43
|
+
setOpenMobile: f,
|
|
44
|
+
toggleSidebar: y
|
|
45
|
+
}), [
|
|
46
|
+
b,
|
|
47
|
+
g,
|
|
48
|
+
_,
|
|
49
|
+
u,
|
|
50
|
+
d,
|
|
51
|
+
f,
|
|
52
|
+
y
|
|
53
|
+
]);
|
|
54
|
+
return /* @__PURE__ */ v(D.Provider, {
|
|
55
|
+
value: w,
|
|
56
|
+
children: /* @__PURE__ */ v(c, {
|
|
57
|
+
delayDuration: 0,
|
|
58
|
+
children: /* @__PURE__ */ v("div", {
|
|
59
|
+
"data-slot": "sidebar-wrapper",
|
|
60
|
+
style: {
|
|
61
|
+
"--sidebar-width": C,
|
|
62
|
+
"--sidebar-width-icon": T,
|
|
63
|
+
...o
|
|
64
|
+
},
|
|
65
|
+
className: e("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full", i),
|
|
66
|
+
...l,
|
|
67
|
+
children: s
|
|
68
|
+
})
|
|
69
|
+
})
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function A({ side: t = "left", variant: n = "sidebar", collapsible: r = "offcanvas", className: i, children: a, ...o }) {
|
|
73
|
+
let { isMobile: s, state: c, openMobile: l, setOpenMobile: h } = O();
|
|
74
|
+
return r === "none" ? /* @__PURE__ */ v("div", {
|
|
75
|
+
"data-slot": "sidebar",
|
|
76
|
+
className: e("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col", i),
|
|
77
|
+
...o,
|
|
78
|
+
children: a
|
|
79
|
+
}) : s ? /* @__PURE__ */ v(u, {
|
|
80
|
+
open: l,
|
|
81
|
+
onOpenChange: h,
|
|
82
|
+
...o,
|
|
83
|
+
children: /* @__PURE__ */ y(d, {
|
|
84
|
+
"data-sidebar": "sidebar",
|
|
85
|
+
"data-slot": "sidebar",
|
|
86
|
+
"data-mobile": "true",
|
|
87
|
+
className: "bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",
|
|
88
|
+
style: { "--sidebar-width": w },
|
|
89
|
+
side: t,
|
|
90
|
+
children: [/* @__PURE__ */ y(p, {
|
|
91
|
+
className: "sr-only",
|
|
92
|
+
children: [/* @__PURE__ */ v(m, { children: "Sidebar" }), /* @__PURE__ */ v(f, { children: "Displays the mobile sidebar." })]
|
|
93
|
+
}), /* @__PURE__ */ v("div", {
|
|
94
|
+
className: "flex h-full w-full flex-col",
|
|
95
|
+
children: a
|
|
96
|
+
})]
|
|
97
|
+
})
|
|
98
|
+
}) : /* @__PURE__ */ y("div", {
|
|
99
|
+
className: "group peer text-sidebar-foreground hidden md:block",
|
|
100
|
+
"data-state": c,
|
|
101
|
+
"data-collapsible": c === "collapsed" ? r : "",
|
|
102
|
+
"data-variant": n,
|
|
103
|
+
"data-side": t,
|
|
104
|
+
"data-slot": "sidebar",
|
|
105
|
+
children: [/* @__PURE__ */ v("div", {
|
|
106
|
+
"data-slot": "sidebar-gap",
|
|
107
|
+
className: e("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear", "group-data-[collapsible=offcanvas]:w-0", "group-data-[side=right]:rotate-180", n === "floating" || n === "inset" ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)")
|
|
108
|
+
}), /* @__PURE__ */ v("div", {
|
|
109
|
+
"data-slot": "sidebar-container",
|
|
110
|
+
style: {
|
|
111
|
+
top: "var(--host-header-height, 0px)",
|
|
112
|
+
height: "calc(100svh - var(--host-header-height, 0px))"
|
|
113
|
+
},
|
|
114
|
+
className: e("fixed z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex", t === "left" ? "left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]" : "right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]", n === "floating" || n === "inset" ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]" : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l", i),
|
|
115
|
+
...o,
|
|
116
|
+
children: /* @__PURE__ */ v("div", {
|
|
117
|
+
"data-sidebar": "sidebar",
|
|
118
|
+
"data-slot": "sidebar-inner",
|
|
119
|
+
className: "bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",
|
|
120
|
+
children: a
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
function j({ className: n, onClick: r, ...i }) {
|
|
126
|
+
let { toggleSidebar: a } = O();
|
|
127
|
+
return /* @__PURE__ */ y(t, {
|
|
128
|
+
"data-sidebar": "trigger",
|
|
129
|
+
"data-slot": "sidebar-trigger",
|
|
130
|
+
variant: "ghost",
|
|
131
|
+
size: "icon",
|
|
132
|
+
className: e("size-7", n),
|
|
133
|
+
onClick: (e) => {
|
|
134
|
+
r?.(e), a();
|
|
135
|
+
},
|
|
136
|
+
...i,
|
|
137
|
+
children: [/* @__PURE__ */ v(g, {}), /* @__PURE__ */ v("span", {
|
|
138
|
+
className: "sr-only",
|
|
139
|
+
children: "Toggle Sidebar"
|
|
140
|
+
})]
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
function M({ className: t, ...n }) {
|
|
144
|
+
let { toggleSidebar: r } = O();
|
|
145
|
+
return /* @__PURE__ */ v("button", {
|
|
146
|
+
"data-sidebar": "rail",
|
|
147
|
+
"data-slot": "sidebar-rail",
|
|
148
|
+
"aria-label": "Toggle Sidebar",
|
|
149
|
+
tabIndex: -1,
|
|
150
|
+
onClick: r,
|
|
151
|
+
title: "Toggle Sidebar",
|
|
152
|
+
className: e("hover:after:bg-sidebar-border absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] sm:flex", "in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize", "[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize", "hover:group-data-[collapsible=offcanvas]:bg-sidebar group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full", "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2", "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2", t),
|
|
153
|
+
...n
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function N({ className: t, ...n }) {
|
|
157
|
+
return /* @__PURE__ */ v("main", {
|
|
158
|
+
"data-slot": "sidebar-inset",
|
|
159
|
+
className: e("bg-background relative flex w-full flex-1 flex-col", "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2", t),
|
|
160
|
+
...n
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
function P({ className: t, ...n }) {
|
|
164
|
+
return /* @__PURE__ */ v(r, {
|
|
165
|
+
"data-slot": "sidebar-input",
|
|
166
|
+
"data-sidebar": "input",
|
|
167
|
+
className: e("bg-background h-8 w-full shadow-none", t),
|
|
168
|
+
...n
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function F({ className: t, ...n }) {
|
|
172
|
+
return /* @__PURE__ */ v("div", {
|
|
173
|
+
"data-slot": "sidebar-header",
|
|
174
|
+
"data-sidebar": "header",
|
|
175
|
+
className: e("flex flex-col gap-2 p-2", t),
|
|
176
|
+
...n
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
function I({ className: t, ...n }) {
|
|
180
|
+
return /* @__PURE__ */ v("div", {
|
|
181
|
+
"data-slot": "sidebar-footer",
|
|
182
|
+
"data-sidebar": "footer",
|
|
183
|
+
className: e("flex flex-col gap-2 p-2", t),
|
|
184
|
+
...n
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
function L({ className: t, ...r }) {
|
|
188
|
+
return /* @__PURE__ */ v(n, {
|
|
189
|
+
"data-slot": "sidebar-separator",
|
|
190
|
+
"data-sidebar": "separator",
|
|
191
|
+
className: e("bg-sidebar-border mx-2 w-auto", t),
|
|
192
|
+
...r
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
function R({ className: t, ...n }) {
|
|
196
|
+
return /* @__PURE__ */ v("div", {
|
|
197
|
+
"data-slot": "sidebar-content",
|
|
198
|
+
"data-sidebar": "content",
|
|
199
|
+
className: e("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden", t),
|
|
200
|
+
...n
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
function z({ className: t, ...n }) {
|
|
204
|
+
return /* @__PURE__ */ v("div", {
|
|
205
|
+
"data-slot": "sidebar-group",
|
|
206
|
+
"data-sidebar": "group",
|
|
207
|
+
className: e("relative flex w-full min-w-0 flex-col p-2", t),
|
|
208
|
+
...n
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function B({ className: t, asChild: n = !1, ...r }) {
|
|
212
|
+
return /* @__PURE__ */ v(n ? _.Root : "div", {
|
|
213
|
+
"data-slot": "sidebar-group-label",
|
|
214
|
+
"data-sidebar": "group-label",
|
|
215
|
+
className: e("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0", t),
|
|
216
|
+
...r
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
function V({ className: t, asChild: n = !1, ...r }) {
|
|
220
|
+
return /* @__PURE__ */ v(n ? _.Root : "button", {
|
|
221
|
+
"data-slot": "sidebar-group-action",
|
|
222
|
+
"data-sidebar": "group-action",
|
|
223
|
+
className: e("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "after:absolute after:-inset-2 md:after:hidden", "group-data-[collapsible=icon]:hidden", t),
|
|
224
|
+
...r
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
function H({ className: t, ...n }) {
|
|
228
|
+
return /* @__PURE__ */ v("div", {
|
|
229
|
+
"data-slot": "sidebar-group-content",
|
|
230
|
+
"data-sidebar": "group-content",
|
|
231
|
+
className: e("w-full text-sm", t),
|
|
232
|
+
...n
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
function U({ className: t, ...n }) {
|
|
236
|
+
return /* @__PURE__ */ v("ul", {
|
|
237
|
+
"data-slot": "sidebar-menu",
|
|
238
|
+
"data-sidebar": "menu",
|
|
239
|
+
className: e("flex w-full min-w-0 flex-col gap-1", t),
|
|
240
|
+
...n
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
function W({ className: t, ...n }) {
|
|
244
|
+
return /* @__PURE__ */ v("li", {
|
|
245
|
+
"data-slot": "sidebar-menu-item",
|
|
246
|
+
"data-sidebar": "menu-item",
|
|
247
|
+
className: e("group/menu-item relative", t),
|
|
248
|
+
...n
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
var G = b("peer/menu-button ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:font-medium [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", {
|
|
252
|
+
variants: {
|
|
253
|
+
variant: {
|
|
254
|
+
default: "hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",
|
|
255
|
+
outline: "bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
256
|
+
},
|
|
257
|
+
size: {
|
|
258
|
+
default: "h-8 text-sm",
|
|
259
|
+
sm: "h-7 text-xs",
|
|
260
|
+
lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
defaultVariants: {
|
|
264
|
+
variant: "default",
|
|
265
|
+
size: "default"
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
function K({ asChild: t = !1, isActive: n = !1, variant: r = "default", size: i = "default", tooltip: a, className: c, ...u }) {
|
|
269
|
+
let d = t ? _.Root : "button", { isMobile: f, state: p } = O(), m = /* @__PURE__ */ v(d, {
|
|
270
|
+
"data-slot": "sidebar-menu-button",
|
|
271
|
+
"data-sidebar": "menu-button",
|
|
272
|
+
"data-size": i,
|
|
273
|
+
"data-active": n,
|
|
274
|
+
className: e(G({
|
|
275
|
+
variant: r,
|
|
276
|
+
size: i
|
|
277
|
+
}), c),
|
|
278
|
+
...u
|
|
279
|
+
});
|
|
280
|
+
return a ? (typeof a == "string" && (a = { children: a }), /* @__PURE__ */ y(o, { children: [/* @__PURE__ */ v(l, {
|
|
281
|
+
asChild: !0,
|
|
282
|
+
children: m
|
|
283
|
+
}), /* @__PURE__ */ v(s, {
|
|
284
|
+
side: "right",
|
|
285
|
+
align: "center",
|
|
286
|
+
hidden: p !== "collapsed" || f,
|
|
287
|
+
...a
|
|
288
|
+
})] })) : m;
|
|
289
|
+
}
|
|
290
|
+
function q({ className: t, asChild: n = !1, showOnHover: r = !1, ...i }) {
|
|
291
|
+
return /* @__PURE__ */ v(n ? _.Root : "button", {
|
|
292
|
+
"data-slot": "sidebar-menu-action",
|
|
293
|
+
"data-sidebar": "menu-action",
|
|
294
|
+
className: e("text-sidebar-foreground ring-sidebar-ring peer-hover/menu-button:text-sidebar-accent-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 outline-hidden transition-transform focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0", "after:absolute after:-inset-2 md:after:hidden", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", r && "peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 md:opacity-0", t),
|
|
295
|
+
...i
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function J({ className: t, ...n }) {
|
|
299
|
+
return /* @__PURE__ */ v("div", {
|
|
300
|
+
"data-slot": "sidebar-menu-badge",
|
|
301
|
+
"data-sidebar": "menu-badge",
|
|
302
|
+
className: e("text-sidebar-foreground pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums select-none", "peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground", "peer-data-[size=sm]/menu-button:top-1", "peer-data-[size=default]/menu-button:top-1.5", "peer-data-[size=lg]/menu-button:top-2.5", "group-data-[collapsible=icon]:hidden", t),
|
|
303
|
+
...n
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
function Y({ className: t, showIcon: n = !1, ...r }) {
|
|
307
|
+
let a = h.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
308
|
+
return /* @__PURE__ */ y("div", {
|
|
309
|
+
"data-slot": "sidebar-menu-skeleton",
|
|
310
|
+
"data-sidebar": "menu-skeleton",
|
|
311
|
+
className: e("flex h-8 items-center gap-2 rounded-md px-2", t),
|
|
312
|
+
...r,
|
|
313
|
+
children: [n && /* @__PURE__ */ v(i, {
|
|
314
|
+
className: "size-4 rounded-md",
|
|
315
|
+
"data-sidebar": "menu-skeleton-icon"
|
|
316
|
+
}), /* @__PURE__ */ v(i, {
|
|
317
|
+
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
318
|
+
"data-sidebar": "menu-skeleton-text",
|
|
319
|
+
style: { "--skeleton-width": a }
|
|
320
|
+
})]
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
function X({ className: t, ...n }) {
|
|
324
|
+
return /* @__PURE__ */ v("ul", {
|
|
325
|
+
"data-slot": "sidebar-menu-sub",
|
|
326
|
+
"data-sidebar": "menu-sub",
|
|
327
|
+
className: e("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5", "group-data-[collapsible=icon]:hidden", t),
|
|
328
|
+
...n
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
function Z({ className: t, ...n }) {
|
|
332
|
+
return /* @__PURE__ */ v("li", {
|
|
333
|
+
"data-slot": "sidebar-menu-sub-item",
|
|
334
|
+
"data-sidebar": "menu-sub-item",
|
|
335
|
+
className: e("group/menu-sub-item relative", t),
|
|
336
|
+
...n
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
function Q({ asChild: t = !1, size: n = "md", isActive: r = !1, className: i, ...a }) {
|
|
340
|
+
return /* @__PURE__ */ v(t ? _.Root : "a", {
|
|
341
|
+
"data-slot": "sidebar-menu-sub-button",
|
|
342
|
+
"data-sidebar": "menu-sub-button",
|
|
343
|
+
"data-size": n,
|
|
344
|
+
"data-active": r,
|
|
345
|
+
className: e("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0", "data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground", n === "sm" && "text-xs", n === "md" && "text-sm", "group-data-[collapsible=icon]:hidden", i),
|
|
346
|
+
...a
|
|
347
|
+
});
|
|
348
|
+
}
|
|
349
|
+
//#endregion
|
|
350
|
+
export { A as Sidebar, R as SidebarContent, I as SidebarFooter, z as SidebarGroup, V as SidebarGroupAction, H as SidebarGroupContent, B as SidebarGroupLabel, F as SidebarHeader, P as SidebarInput, N as SidebarInset, U as SidebarMenu, q as SidebarMenuAction, J as SidebarMenuBadge, K as SidebarMenuButton, W as SidebarMenuItem, Y as SidebarMenuSkeleton, X as SidebarMenuSub, Q as SidebarMenuSubButton, Z as SidebarMenuSubItem, k as SidebarProvider, M as SidebarRail, L as SidebarSeparator, j as SidebarTrigger, O as useSidebar };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/utils.js";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/reui/skeleton.tsx
|
|
4
|
+
function n({ className: n, ...r }) {
|
|
5
|
+
return /* @__PURE__ */ t("div", {
|
|
6
|
+
"data-slot": "skeleton",
|
|
7
|
+
className: e("animate-pulse rounded-md bg-accent", n),
|
|
8
|
+
...r
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
//#endregion
|
|
12
|
+
export { n as Skeleton };
|