@rafal.lemieszewski/tide-ui 0.83.0 → 0.84.3
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 +20 -8
- package/dist/cjs/components/core-index.cjs +1 -0
- package/dist/cjs/components/fundamental/accordion.cjs +1 -0
- package/dist/cjs/components/fundamental/alert-dialog.cjs +1 -0
- package/dist/cjs/components/fundamental/alert.cjs +1 -0
- package/dist/cjs/components/fundamental/autocomplete-search.cjs +1 -0
- package/dist/cjs/components/fundamental/avatar-group.cjs +1 -0
- package/dist/cjs/components/fundamental/avatar.cjs +1 -0
- package/dist/cjs/components/fundamental/badge.cjs +1 -0
- package/dist/cjs/components/fundamental/breadcrumb.cjs +1 -0
- package/dist/cjs/components/fundamental/button-group.cjs +1 -0
- package/dist/cjs/components/fundamental/button.cjs +1 -0
- package/dist/cjs/components/fundamental/calendar.cjs +1 -0
- package/dist/cjs/components/fundamental/card.cjs +1 -0
- package/dist/cjs/components/fundamental/chart.cjs +1 -0
- package/dist/cjs/components/fundamental/checkbox.cjs +1 -0
- package/dist/cjs/components/fundamental/collapsible.cjs +1 -0
- package/dist/cjs/components/fundamental/combobox.cjs +1 -0
- package/dist/cjs/components/fundamental/command.cjs +1 -0
- package/dist/cjs/components/fundamental/country-dropdown.cjs +1 -0
- package/dist/cjs/components/fundamental/custom-icons.cjs +1 -0
- package/dist/cjs/components/fundamental/date-picker.cjs +1 -0
- package/dist/cjs/components/fundamental/dialog.cjs +1 -0
- package/dist/cjs/components/fundamental/drawer.cjs +1 -0
- package/dist/cjs/components/fundamental/dropdown-menu.cjs +1 -0
- package/dist/cjs/components/fundamental/editable.cjs +1 -0
- package/dist/cjs/components/fundamental/empty.cjs +1 -0
- package/dist/cjs/components/fundamental/file-upload.cjs +1 -0
- package/dist/cjs/components/fundamental/flag.cjs +1 -0
- package/dist/cjs/components/fundamental/form-field.cjs +1 -0
- package/dist/cjs/components/fundamental/hover-card.cjs +1 -0
- package/dist/cjs/components/fundamental/icon.cjs +1 -0
- package/dist/cjs/components/fundamental/input-group.cjs +1 -0
- package/dist/cjs/components/fundamental/input.cjs +1 -0
- package/dist/cjs/components/fundamental/kbd.cjs +1 -0
- package/dist/cjs/components/fundamental/label.cjs +1 -0
- package/dist/cjs/components/fundamental/month-picker.cjs +1 -0
- package/dist/cjs/components/fundamental/pagination.cjs +1 -0
- package/dist/cjs/components/fundamental/popover.cjs +1 -0
- package/dist/cjs/components/fundamental/progress.cjs +1 -0
- package/dist/cjs/components/fundamental/radio-group.cjs +1 -0
- package/dist/cjs/components/fundamental/resizable.cjs +1 -0
- package/dist/cjs/components/fundamental/scroll-area.cjs +1 -0
- package/dist/cjs/components/fundamental/select.cjs +1 -0
- package/dist/cjs/components/fundamental/separator.cjs +1 -0
- package/dist/cjs/components/fundamental/sheet.cjs +1 -0
- package/dist/cjs/components/fundamental/sidebar.cjs +1 -0
- package/dist/cjs/components/fundamental/skeleton.cjs +1 -0
- package/dist/cjs/components/fundamental/slider.cjs +1 -0
- package/dist/cjs/components/fundamental/spinner.cjs +1 -0
- package/dist/cjs/components/fundamental/switch.cjs +1 -0
- package/dist/cjs/components/fundamental/table.cjs +1 -0
- package/dist/cjs/components/fundamental/tabs.cjs +1 -0
- package/dist/cjs/components/fundamental/tag.cjs +27 -0
- package/dist/cjs/components/fundamental/text-link.cjs +1 -0
- package/dist/cjs/components/fundamental/textarea.cjs +1 -0
- package/dist/cjs/components/fundamental/toast.cjs +1 -0
- package/dist/cjs/components/fundamental/toggle-group.cjs +1 -0
- package/dist/cjs/components/fundamental/toggle.cjs +1 -0
- package/dist/cjs/components/fundamental/tooltip.cjs +1 -0
- package/dist/cjs/components/fundamental/tree.cjs +1 -0
- package/dist/cjs/components/product/activity-log.cjs +1 -0
- package/dist/cjs/components/product/app-frame.cjs +1 -0
- package/dist/cjs/components/product/attributes-list.cjs +1 -0
- package/dist/cjs/components/product/bookmarks.cjs +1 -0
- package/dist/cjs/components/product/data-table-settings-menu.cjs +1 -0
- package/dist/cjs/components/product/data-table.cjs +1 -0
- package/dist/cjs/components/product/filters.cjs +1 -0
- package/dist/cjs/components/product/fixture-status.cjs +1 -0
- package/dist/cjs/components/product/linked-chart.cjs +1 -0
- package/dist/cjs/components/product/view-mode-menu.cjs +1 -0
- package/dist/cjs/lib/date-utils.cjs +1 -0
- package/dist/cjs/lib/hooks.cjs +1 -0
- package/dist/cjs/lib/index.cjs +1 -0
- package/dist/cjs/lib/utils.cjs +1 -0
- package/dist/es/components/core-index.js +37 -0
- package/dist/es/components/fundamental/accordion.js +60 -0
- package/dist/es/components/fundamental/alert-dialog.js +116 -0
- package/dist/es/components/fundamental/alert.js +65 -0
- package/dist/es/components/fundamental/autocomplete-search.js +139 -0
- package/dist/es/components/fundamental/avatar-group.js +51 -0
- package/dist/es/components/fundamental/avatar.js +165 -0
- package/dist/es/components/fundamental/badge.js +157 -0
- package/dist/es/components/fundamental/breadcrumb.js +142 -0
- package/dist/es/components/fundamental/button-group.js +86 -0
- package/dist/es/components/fundamental/button.js +186 -0
- package/dist/es/components/fundamental/calendar.js +130 -0
- package/dist/es/components/fundamental/card.js +68 -0
- package/dist/es/components/fundamental/chart.js +1006 -0
- package/dist/es/components/fundamental/checkbox.js +51 -0
- package/dist/es/components/fundamental/collapsible.js +55 -0
- package/dist/es/components/fundamental/combobox.js +229 -0
- package/dist/es/components/fundamental/command.js +155 -0
- package/dist/es/components/fundamental/country-dropdown.js +215 -0
- package/dist/es/components/fundamental/custom-icons.js +876 -0
- package/dist/es/components/fundamental/date-picker.js +119 -0
- package/dist/es/components/fundamental/dialog.js +106 -0
- package/dist/es/components/fundamental/drawer.js +93 -0
- package/dist/es/components/fundamental/dropdown-menu.js +600 -0
- package/dist/es/components/fundamental/editable.js +123 -0
- package/dist/es/components/fundamental/empty.js +152 -0
- package/dist/es/components/fundamental/file-upload.js +289 -0
- package/dist/es/components/fundamental/flag.js +60 -0
- package/dist/es/components/fundamental/form-field.js +352 -0
- package/dist/es/components/fundamental/hover-card.js +23 -0
- package/dist/es/components/fundamental/icon.js +200 -0
- package/dist/es/components/fundamental/input-group.js +135 -0
- package/dist/es/components/fundamental/input.js +78 -0
- package/dist/es/components/fundamental/kbd.js +57 -0
- package/dist/es/components/fundamental/label.js +54 -0
- package/dist/es/components/fundamental/month-picker.js +161 -0
- package/dist/es/components/fundamental/pagination.js +109 -0
- package/dist/es/components/fundamental/popover.js +24 -0
- package/dist/es/components/fundamental/progress.js +66 -0
- package/dist/es/components/fundamental/radio-group.js +64 -0
- package/dist/es/components/fundamental/resizable.js +43 -0
- package/dist/es/components/fundamental/scroll-area.js +38 -0
- package/dist/es/components/fundamental/select.js +136 -0
- package/dist/es/components/fundamental/separator.js +47 -0
- package/dist/es/components/fundamental/sheet.js +134 -0
- package/dist/es/components/fundamental/sidebar.js +709 -0
- package/dist/es/components/fundamental/skeleton.js +158 -0
- package/dist/es/components/fundamental/slider.js +35 -0
- package/dist/es/components/fundamental/spinner.js +225 -0
- package/dist/es/components/fundamental/switch.js +27 -0
- package/dist/es/components/fundamental/table.js +263 -0
- package/dist/es/components/fundamental/tabs.js +170 -0
- package/dist/es/components/fundamental/tag.js +295 -0
- package/dist/es/components/fundamental/text-link.js +105 -0
- package/dist/es/components/fundamental/textarea.js +47 -0
- package/dist/es/components/fundamental/toast.js +108 -0
- package/dist/es/components/fundamental/toggle-group.js +37 -0
- package/dist/es/components/fundamental/toggle.js +51 -0
- package/dist/es/components/fundamental/tooltip.js +26 -0
- package/dist/es/components/fundamental/tree.js +161 -0
- package/dist/es/components/product/activity-log.js +231 -0
- package/dist/es/components/product/app-frame.js +985 -0
- package/dist/es/components/product/attributes-list.js +351 -0
- package/dist/es/components/product/bookmarks.js +833 -0
- package/dist/es/components/product/data-table-settings-menu.js +169 -0
- package/dist/es/components/product/data-table.js +2473 -0
- package/dist/es/components/product/filters.js +1041 -0
- package/dist/es/components/product/fixture-status.js +178 -0
- package/dist/es/components/product/linked-chart.js +179 -0
- package/dist/es/components/product/view-mode-menu.js +353 -0
- package/dist/es/lib/date-utils.js +151 -0
- package/dist/es/lib/hooks.js +29 -0
- package/dist/es/lib/index.js +348 -0
- package/dist/es/lib/utils.js +8 -0
- package/dist/es/style.css +1 -0
- package/dist/types/bookmarks.d.ts +2 -0
- package/dist/types/calendar.d.ts +2 -0
- package/dist/types/chart.d.ts +2 -0
- package/dist/types/components/core-index.d.cts +135 -0
- package/dist/types/components/core-index.d.ts +135 -0
- package/dist/{components → types/components}/fundamental/avatar.d.ts +3 -3
- package/dist/{components → types/components}/fundamental/badge.d.ts +2 -2
- package/dist/{components → types/components}/fundamental/button-group.d.ts +2 -2
- package/dist/{components → types/components}/fundamental/button.d.ts +1 -1
- package/dist/types/components/fundamental/calendar.d.ts +7 -0
- package/dist/types/components/fundamental/chart.d.ts +95 -0
- package/dist/{components → types/components}/fundamental/command.d.ts +2 -2
- package/dist/types/components/fundamental/country-dropdown.d.ts +34 -0
- package/dist/types/components/fundamental/date-picker.d.ts +30 -0
- package/dist/{components → types/components}/fundamental/file-upload.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/form-field.d.ts +2 -2
- package/dist/{components → types/components}/fundamental/form.d.ts +2 -2
- package/dist/{components → types/components}/fundamental/icon.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/input-group.d.ts +1 -1
- package/dist/types/components/fundamental/resizable.d.cts +23 -0
- package/dist/{components → types/components}/fundamental/resizable.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/sidebar.d.ts +3 -3
- package/dist/{components → types/components}/fundamental/spinner.d.ts +1 -1
- package/dist/{components → types/components}/fundamental/table.d.ts +3 -3
- package/dist/{components → types/components}/fundamental/text-link.d.ts +1 -1
- package/dist/{components → types/components}/index.d.ts +118 -118
- package/dist/{components → types/components}/product/activity-log.d.ts +1 -1
- package/dist/{components → types/components}/product/attributes-list.d.ts +1 -1
- package/dist/types/components/product/bookmarks.d.cts +90 -0
- package/dist/{components → types/components}/product/bookmarks.d.ts +1 -1
- package/dist/types/components/product/data-table.d.ts +802 -0
- package/dist/types/components/product/filters.d.ts +124 -0
- package/dist/{components → types/components}/product/fixture-status.d.ts +1 -1
- package/dist/types/components/product/linked-chart.d.cts +22 -0
- package/dist/{components → types/components}/product/linked-chart.d.ts +1 -1
- package/dist/types/country-dropdown.d.ts +2 -0
- package/dist/types/data-table.d.ts +2 -0
- package/dist/types/date-picker.d.ts +2 -0
- package/dist/types/filters.d.ts +2 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/lib/index.d.cts +104 -0
- package/dist/types/lib/index.d.ts +104 -0
- package/dist/types/linked-chart.d.ts +2 -0
- package/dist/types/resizable.d.ts +2 -0
- package/package.json +191 -31
- package/dist/index.cjs.js +0 -144
- package/dist/index.cjs.js.map +0 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.es.js +0 -87768
- package/dist/index.es.js.map +0 -1
- package/dist/lib/index.d.ts +0 -3
- package/dist/style.css +0 -1
- /package/dist/{components → types/components}/fundamental/accordion.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/alert-dialog.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/alert.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/autocomplete-search.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/avatar-group.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/breadcrumb.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/button.test.d.ts +0 -0
- /package/dist/{components/fundamental/calendar.d.ts → types/components/fundamental/calendar.d.cts} +0 -0
- /package/dist/{components → types/components}/fundamental/card.d.ts +0 -0
- /package/dist/{components/fundamental/chart.d.ts → types/components/fundamental/chart.d.cts} +0 -0
- /package/dist/{components → types/components}/fundamental/checkbox.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/collapsible.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/combobox.d.ts +0 -0
- /package/dist/{components/fundamental/country-dropdown.d.ts → types/components/fundamental/country-dropdown.d.cts} +0 -0
- /package/dist/{components → types/components}/fundamental/custom-icons.d.ts +0 -0
- /package/dist/{components/fundamental/date-picker.d.ts → types/components/fundamental/date-picker.d.cts} +0 -0
- /package/dist/{components → types/components}/fundamental/dialog.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/drawer.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/dropdown-menu.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/editable.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/empty.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/flag.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/hover-card.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/input.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/kbd.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/label.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/month-picker.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/pagination.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/popover.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/progress.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/radio-group.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/scroll-area.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/select.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/separator.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/sheet.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/skeleton.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/slider.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/switch.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tabs.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tag.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/textarea.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/toast.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/toggle-group.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/toggle.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tooltip.d.ts +0 -0
- /package/dist/{components → types/components}/fundamental/tree.d.ts +0 -0
- /package/dist/{components → types/components}/product/app-frame.d.ts +0 -0
- /package/dist/{components → types/components}/product/data-table-settings-menu.d.ts +0 -0
- /package/dist/{components/product/data-table.d.ts → types/components/product/data-table.d.cts} +0 -0
- /package/dist/{components/product/filters.d.ts → types/components/product/filters.d.cts} +0 -0
- /package/dist/{components → types/components}/product/view-mode-menu.d.ts +0 -0
- /package/dist/{lib → types/lib}/date-utils.d.ts +0 -0
- /package/dist/{lib → types/lib}/hooks.d.ts +0 -0
- /package/dist/{lib → types/lib}/utils.d.ts +0 -0
|
@@ -0,0 +1,709 @@
|
|
|
1
|
+
import { jsx as d, jsxs as C } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { cva as P } from "class-variance-authority";
|
|
4
|
+
import * as I from "@radix-ui/react-dialog";
|
|
5
|
+
import * as _ from "@radix-ui/react-tooltip";
|
|
6
|
+
import { cn as s } from "../../lib/utils.js";
|
|
7
|
+
import { Button as O } from "./button.js";
|
|
8
|
+
import { Separator as F } from "./separator.js";
|
|
9
|
+
import { Icon as W } from "./icon.js";
|
|
10
|
+
const $ = "sidebar:state", V = 3600 * 24 * 7, q = "16rem", U = "18rem", X = "3rem", Y = "b", G = t.createContext(null);
|
|
11
|
+
function E() {
|
|
12
|
+
const r = t.useContext(G);
|
|
13
|
+
if (!r)
|
|
14
|
+
throw new Error("useSidebar must be used within a SidebarProvider.");
|
|
15
|
+
return r;
|
|
16
|
+
}
|
|
17
|
+
const A = /* @__PURE__ */ t.forwardRef(
|
|
18
|
+
({ defaultOpen: r = !0, open: e, onOpenChange: a, className: o, style: i, children: l, ...u }, f) => {
|
|
19
|
+
const [p, m] = t.useState(r), [v, h] = t.useState(!1), [y, R] = t.useState(!1), g = e ?? p, w = t.useCallback(
|
|
20
|
+
(n) => {
|
|
21
|
+
const c = typeof n == "function" ? n(g) : n;
|
|
22
|
+
a ? a(c) : m(c), typeof document < "u" && (document.cookie = `${$}=${c}; path=/; max-age=${V}`);
|
|
23
|
+
},
|
|
24
|
+
[a, g]
|
|
25
|
+
), b = t.useCallback(() => y ? h((n) => !n) : w((n) => !n), [y, w, h]);
|
|
26
|
+
t.useEffect(() => {
|
|
27
|
+
const n = (c) => {
|
|
28
|
+
c.key === Y && (c.metaKey || c.ctrlKey) && (c.preventDefault(), b());
|
|
29
|
+
};
|
|
30
|
+
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
31
|
+
}, [b]), t.useEffect(() => {
|
|
32
|
+
const n = () => {
|
|
33
|
+
R(window.innerWidth < 768);
|
|
34
|
+
};
|
|
35
|
+
return n(), window.addEventListener("resize", n), () => window.removeEventListener("resize", n);
|
|
36
|
+
}, []);
|
|
37
|
+
const N = g ? "expanded" : "collapsed", S = t.useMemo(
|
|
38
|
+
() => ({
|
|
39
|
+
state: N,
|
|
40
|
+
open: g,
|
|
41
|
+
setOpen: w,
|
|
42
|
+
isMobile: y,
|
|
43
|
+
openMobile: v,
|
|
44
|
+
setOpenMobile: h,
|
|
45
|
+
toggleSidebar: b
|
|
46
|
+
}),
|
|
47
|
+
[N, g, w, y, v, h, b]
|
|
48
|
+
);
|
|
49
|
+
return /* @__PURE__ */ d(G.Provider, { value: S, children: /* @__PURE__ */ d(_.Provider, { delayDuration: 0, children: /* @__PURE__ */ d(
|
|
50
|
+
"div",
|
|
51
|
+
{
|
|
52
|
+
ref: f,
|
|
53
|
+
style: {
|
|
54
|
+
"--sidebar-width": q,
|
|
55
|
+
"--sidebar-width-icon": X,
|
|
56
|
+
...i
|
|
57
|
+
},
|
|
58
|
+
className: s(
|
|
59
|
+
"group/sidebar-wrapper flex h-svh w-full min-w-0 has-[[data-variant=inset]]:bg-[var(--color-surface-secondary)]",
|
|
60
|
+
o
|
|
61
|
+
),
|
|
62
|
+
...u,
|
|
63
|
+
children: l
|
|
64
|
+
}
|
|
65
|
+
) }) });
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
A.displayName = "SidebarProvider";
|
|
69
|
+
const J = /* @__PURE__ */ t.forwardRef(
|
|
70
|
+
({
|
|
71
|
+
variant: r = "sidebar",
|
|
72
|
+
collapsible: e = "offcanvas",
|
|
73
|
+
side: a = "left",
|
|
74
|
+
className: o,
|
|
75
|
+
children: i,
|
|
76
|
+
...l
|
|
77
|
+
}, u) => {
|
|
78
|
+
const { isMobile: f, state: p, openMobile: m, setOpenMobile: v } = E();
|
|
79
|
+
return e === "none" ? /* @__PURE__ */ d(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: s(
|
|
83
|
+
"flex h-full w-[var(--sidebar-width)] flex-col bg-[var(--color-surface-primary)] text-[var(--color-text-primary)]",
|
|
84
|
+
o
|
|
85
|
+
),
|
|
86
|
+
ref: u,
|
|
87
|
+
...l,
|
|
88
|
+
children: i
|
|
89
|
+
}
|
|
90
|
+
) : f ? /* @__PURE__ */ d(I.Root, { open: m, onOpenChange: v, modal: !1, children: /* @__PURE__ */ C(I.Portal, { children: [
|
|
91
|
+
/* @__PURE__ */ d(I.Overlay, { className: "fixed inset-0 z-40 bg-black/80" }),
|
|
92
|
+
/* @__PURE__ */ d(
|
|
93
|
+
I.Content,
|
|
94
|
+
{
|
|
95
|
+
ref: u,
|
|
96
|
+
"data-sidebar": "sidebar",
|
|
97
|
+
"data-mobile": "true",
|
|
98
|
+
className: "fixed inset-y-0 z-50 h-auto w-[var(--sidebar-width-mobile)] bg-[var(--color-surface-primary)] p-0 text-[var(--color-text-primary)] shadow-md transition ease-in-out data-[state=open]:duration-300 data-[state=closed]:duration-200 data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left",
|
|
99
|
+
style: {
|
|
100
|
+
"--sidebar-width": U
|
|
101
|
+
},
|
|
102
|
+
...l,
|
|
103
|
+
children: /* @__PURE__ */ d("div", { className: "flex h-full w-full flex-col", children: i })
|
|
104
|
+
}
|
|
105
|
+
)
|
|
106
|
+
] }) }) : /* @__PURE__ */ d(
|
|
107
|
+
"div",
|
|
108
|
+
{
|
|
109
|
+
ref: u,
|
|
110
|
+
className: "group peer hidden md:block text-[var(--color-text-primary)]",
|
|
111
|
+
"data-state": p,
|
|
112
|
+
"data-collapsible": p === "collapsed" ? e : "",
|
|
113
|
+
"data-variant": r,
|
|
114
|
+
"data-side": a,
|
|
115
|
+
children: /* @__PURE__ */ d(
|
|
116
|
+
"div",
|
|
117
|
+
{
|
|
118
|
+
className: s(
|
|
119
|
+
"duration-200 relative h-svh w-[var(--sidebar-width)] bg-[var(--color-surface-primary)] border-r border-[var(--color-border-primary-subtle)] transition-[width] ease-linear",
|
|
120
|
+
"group-data-[collapsible=offcanvas]:w-0",
|
|
121
|
+
"group-data-[collapsible=icon]:w-[var(--sidebar-width-icon)]",
|
|
122
|
+
r === "floating" && "m-[var(--space-s)] rounded-m border border-[var(--color-border-primary-subtle)] shadow-md",
|
|
123
|
+
r === "inset" && "m-[var(--space-s)] ml-0 rounded-r-m border-r border-[var(--color-border-primary-subtle)]",
|
|
124
|
+
o
|
|
125
|
+
),
|
|
126
|
+
...l,
|
|
127
|
+
children: /* @__PURE__ */ d(
|
|
128
|
+
"div",
|
|
129
|
+
{
|
|
130
|
+
"data-sidebar": "sidebar",
|
|
131
|
+
className: "flex h-full w-full flex-col",
|
|
132
|
+
children: i
|
|
133
|
+
}
|
|
134
|
+
)
|
|
135
|
+
}
|
|
136
|
+
)
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
J.displayName = "Sidebar";
|
|
142
|
+
const Q = /* @__PURE__ */ t.forwardRef(({ className: r, onClick: e, ...a }, o) => {
|
|
143
|
+
const { toggleSidebar: i } = E();
|
|
144
|
+
return /* @__PURE__ */ C(
|
|
145
|
+
O,
|
|
146
|
+
{
|
|
147
|
+
ref: o,
|
|
148
|
+
"data-sidebar": "trigger",
|
|
149
|
+
variant: "ghost",
|
|
150
|
+
size: "s",
|
|
151
|
+
className: s("h-7 w-7 p-0", r),
|
|
152
|
+
onClick: (l) => {
|
|
153
|
+
e?.(l), i();
|
|
154
|
+
},
|
|
155
|
+
...a,
|
|
156
|
+
children: [
|
|
157
|
+
/* @__PURE__ */ d(W, { name: "panel-left", size: "s" }),
|
|
158
|
+
/* @__PURE__ */ d("span", { className: "sr-only", children: "Toggle sidebar" })
|
|
159
|
+
]
|
|
160
|
+
}
|
|
161
|
+
);
|
|
162
|
+
});
|
|
163
|
+
Q.displayName = "SidebarTrigger";
|
|
164
|
+
const Z = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => {
|
|
165
|
+
const { toggleSidebar: o } = E();
|
|
166
|
+
return /* @__PURE__ */ d(
|
|
167
|
+
"button",
|
|
168
|
+
{
|
|
169
|
+
ref: a,
|
|
170
|
+
"data-sidebar": "rail",
|
|
171
|
+
"aria-label": "Toggle sidebar",
|
|
172
|
+
tabIndex: -1,
|
|
173
|
+
onClick: o,
|
|
174
|
+
title: "Toggle sidebar",
|
|
175
|
+
className: s(
|
|
176
|
+
"absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-[var(--color-border-primary)] group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex",
|
|
177
|
+
"[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize",
|
|
178
|
+
"[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize",
|
|
179
|
+
"group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-[var(--color-surface-secondary)]",
|
|
180
|
+
"[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
|
|
181
|
+
"[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
|
|
182
|
+
r
|
|
183
|
+
),
|
|
184
|
+
...e
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
});
|
|
188
|
+
Z.displayName = "SidebarRail";
|
|
189
|
+
const H = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
190
|
+
"main",
|
|
191
|
+
{
|
|
192
|
+
ref: a,
|
|
193
|
+
className: s(
|
|
194
|
+
"relative flex flex-1 flex-col min-w-0 bg-[var(--color-surface-base)]",
|
|
195
|
+
"peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm",
|
|
196
|
+
r
|
|
197
|
+
),
|
|
198
|
+
...e
|
|
199
|
+
}
|
|
200
|
+
));
|
|
201
|
+
H.displayName = "SidebarInset";
|
|
202
|
+
const ee = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
203
|
+
"input",
|
|
204
|
+
{
|
|
205
|
+
ref: a,
|
|
206
|
+
"data-sidebar": "input",
|
|
207
|
+
className: s(
|
|
208
|
+
"flex h-8 w-full rounded-l border border-[var(--color-interaction-border-input)] bg-[var(--color-surface-primary)] px-[var(--space-m)] py-[var(--space-s)] text-sm text-[var(--color-text-primary)] ring-offset-[var(--color-surface-primary)] file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-[var(--color-text-tertiary)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-border-focused)] focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
|
|
209
|
+
r
|
|
210
|
+
),
|
|
211
|
+
...e
|
|
212
|
+
}
|
|
213
|
+
));
|
|
214
|
+
ee.displayName = "SidebarInput";
|
|
215
|
+
const re = /* @__PURE__ */ t.forwardRef(({ className: r, children: e, onOpenChange: a, shortcuts: o = ["⌘", "K"], ...i }, l) => /* @__PURE__ */ C(
|
|
216
|
+
"button",
|
|
217
|
+
{
|
|
218
|
+
ref: l,
|
|
219
|
+
"data-sidebar": "search-button",
|
|
220
|
+
className: s(
|
|
221
|
+
"text-body-md flex h-8 w-full cursor-pointer items-center rounded-m border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-primary)] px-3 py-1 pr-20 pl-8 text-left text-[var(--color-text-tertiary)] transition-colors hover:border-[var(--color-border-primary-medium)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)] focus:ring-offset-2 focus:outline-none active:border-[var(--color-border-primary-medium)] group-data-[collapsible=icon]:hidden",
|
|
222
|
+
r
|
|
223
|
+
),
|
|
224
|
+
onClick: () => a?.(!0),
|
|
225
|
+
...i,
|
|
226
|
+
children: [
|
|
227
|
+
e || "Search",
|
|
228
|
+
/* @__PURE__ */ d("div", { className: "absolute top-1/2 right-2 flex -translate-y-1/2 gap-1", children: o.map((u, f) => /* @__PURE__ */ d("kbd", { className: "pointer-events-none inline-flex h-5 select-none items-center gap-1 rounded border border-[var(--color-border-primary-subtle)] bg-[var(--color-surface-secondary)] px-1.5 font-mono text-[10px] font-medium text-[var(--color-text-tertiary)] opacity-100", children: u }, f)) })
|
|
229
|
+
]
|
|
230
|
+
}
|
|
231
|
+
));
|
|
232
|
+
re.displayName = "SidebarSearchButton";
|
|
233
|
+
const ae = /* @__PURE__ */ t.forwardRef(({ className: r, onOpenChange: e, shortcuts: a = ["⌘", "K"], ...o }, i) => /* @__PURE__ */ d(
|
|
234
|
+
"button",
|
|
235
|
+
{
|
|
236
|
+
ref: i,
|
|
237
|
+
"data-sidebar": "search-trigger",
|
|
238
|
+
className: s(
|
|
239
|
+
"hidden h-8 w-8 cursor-pointer items-center justify-center rounded border border-[var(--color-border-primary-subtle)] bg-transparent transition-all duration-200 group-data-[collapsible=icon]:flex hover:border-[var(--color-border-primary-medium)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] focus:border-[var(--color-border-brand-bold)] focus:ring-2 focus:ring-[var(--color-border-brand-bold)] focus:ring-offset-2 focus:outline-none active:border-[var(--color-border-primary-medium)]",
|
|
240
|
+
r
|
|
241
|
+
),
|
|
242
|
+
onClick: () => e?.(!0),
|
|
243
|
+
"aria-label": "Search",
|
|
244
|
+
...o
|
|
245
|
+
}
|
|
246
|
+
));
|
|
247
|
+
ae.displayName = "SidebarSearchTrigger";
|
|
248
|
+
const te = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
ref: a,
|
|
252
|
+
"data-sidebar": "header",
|
|
253
|
+
className: s("flex flex-col gap-[var(--space-s)] p-[var(--space-m)] group-data-[collapsible=icon]:p-[var(--space-s)]", r),
|
|
254
|
+
...e
|
|
255
|
+
}
|
|
256
|
+
));
|
|
257
|
+
te.displayName = "SidebarHeader";
|
|
258
|
+
const oe = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
259
|
+
"div",
|
|
260
|
+
{
|
|
261
|
+
ref: a,
|
|
262
|
+
"data-sidebar": "footer",
|
|
263
|
+
className: s("flex flex-col gap-[var(--space-s)] p-[var(--space-m)] group-data-[collapsible=icon]:p-[var(--space-s)]", r),
|
|
264
|
+
...e
|
|
265
|
+
}
|
|
266
|
+
));
|
|
267
|
+
oe.displayName = "SidebarFooter";
|
|
268
|
+
const de = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
269
|
+
F,
|
|
270
|
+
{
|
|
271
|
+
ref: a,
|
|
272
|
+
"data-sidebar": "separator",
|
|
273
|
+
className: s("mx-2 w-auto bg-[var(--color-border-primary-subtle)]", r),
|
|
274
|
+
...e
|
|
275
|
+
}
|
|
276
|
+
));
|
|
277
|
+
de.displayName = "SidebarSeparator";
|
|
278
|
+
const se = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
279
|
+
"div",
|
|
280
|
+
{
|
|
281
|
+
ref: a,
|
|
282
|
+
"data-sidebar": "content",
|
|
283
|
+
className: s(
|
|
284
|
+
"flex min-h-0 flex-1 flex-col overflow-y-auto group-data-[collapsible=icon]:overflow-hidden",
|
|
285
|
+
r
|
|
286
|
+
),
|
|
287
|
+
...e
|
|
288
|
+
}
|
|
289
|
+
));
|
|
290
|
+
se.displayName = "SidebarContent";
|
|
291
|
+
const le = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
292
|
+
"div",
|
|
293
|
+
{
|
|
294
|
+
ref: a,
|
|
295
|
+
"data-sidebar": "group",
|
|
296
|
+
className: s("relative flex w-full min-w-0 flex-col p-[var(--space-m)] group-data-[collapsible=icon]:p-[var(--space-s)]", r),
|
|
297
|
+
...e
|
|
298
|
+
}
|
|
299
|
+
));
|
|
300
|
+
le.displayName = "SidebarGroup";
|
|
301
|
+
const ie = /* @__PURE__ */ t.forwardRef(({ className: r, asChild: e = !1, ...a }, o) => /* @__PURE__ */ d(
|
|
302
|
+
"div",
|
|
303
|
+
{
|
|
304
|
+
ref: o,
|
|
305
|
+
"data-sidebar": "group-label",
|
|
306
|
+
className: s(
|
|
307
|
+
"duration-200 flex h-8 shrink-0 items-center rounded-m px-2 [&]:text-body-medium-sm text-[var(--color-text-tertiary)] outline-none ring-[var(--color-border-focused)] transition-opacity ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
308
|
+
"group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",
|
|
309
|
+
r
|
|
310
|
+
),
|
|
311
|
+
...a
|
|
312
|
+
}
|
|
313
|
+
));
|
|
314
|
+
ie.displayName = "SidebarGroupLabel";
|
|
315
|
+
const ne = /* @__PURE__ */ t.forwardRef(({ className: r, asChild: e = !1, ...a }, o) => /* @__PURE__ */ d(
|
|
316
|
+
"button",
|
|
317
|
+
{
|
|
318
|
+
ref: o,
|
|
319
|
+
"data-sidebar": "group-action",
|
|
320
|
+
className: s(
|
|
321
|
+
"absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-m p-0 text-[var(--color-text-secondary)] outline-none ring-[var(--color-border-focused)] transition-transform hover:bg-[var(--color-background-neutral-subtlest)] focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
|
|
322
|
+
"after:absolute after:-inset-2 after:md:hidden",
|
|
323
|
+
"group-data-[collapsible=icon]:hidden",
|
|
324
|
+
r
|
|
325
|
+
),
|
|
326
|
+
...a
|
|
327
|
+
}
|
|
328
|
+
));
|
|
329
|
+
ne.displayName = "SidebarGroupAction";
|
|
330
|
+
const ce = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
331
|
+
"div",
|
|
332
|
+
{
|
|
333
|
+
ref: a,
|
|
334
|
+
"data-sidebar": "group-content",
|
|
335
|
+
className: s("w-full text-sm", r),
|
|
336
|
+
...e
|
|
337
|
+
}
|
|
338
|
+
));
|
|
339
|
+
ce.displayName = "SidebarGroupContent";
|
|
340
|
+
const ue = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
341
|
+
"ul",
|
|
342
|
+
{
|
|
343
|
+
ref: a,
|
|
344
|
+
"data-sidebar": "menu",
|
|
345
|
+
className: s("flex w-full min-w-0 flex-col gap-[var(--space-s)]", r),
|
|
346
|
+
...e
|
|
347
|
+
}
|
|
348
|
+
));
|
|
349
|
+
ue.displayName = "SidebarMenu";
|
|
350
|
+
const be = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
351
|
+
"li",
|
|
352
|
+
{
|
|
353
|
+
ref: a,
|
|
354
|
+
"data-sidebar": "menu-item",
|
|
355
|
+
className: s("group/menu-item relative", r),
|
|
356
|
+
...e
|
|
357
|
+
}
|
|
358
|
+
));
|
|
359
|
+
be.displayName = "SidebarMenuItem";
|
|
360
|
+
const pe = P(
|
|
361
|
+
"peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-m px-2 py-1.5 text-left text-body-medium-md outline-none ring-[var(--color-border-focused)] transition-all duration-150 ease-in-out focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-[var(--color-background-blue-subtle-selected)] data-[active=true]:text-[var(--color-text-brand-bold-selected)] data-[state=open]:bg-[var(--color-surface-secondary)] group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 group-data-[collapsible=icon]:justify-center [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 data-[active=true]:[&>svg]:text-[var(--color-text-brand-bold-selected)] cursor-pointer",
|
|
362
|
+
{
|
|
363
|
+
variants: {
|
|
364
|
+
variant: {
|
|
365
|
+
default: "hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)] focus-visible:bg-[var(--color-background-neutral-subtlest-hovered)] active:bg-[var(--color-background-neutral-subtlest-hovered)] data-[active=true]:hover:!bg-[var(--color-background-blue-subtle-selected-hovered)] data-[active=true]:hover:!text-[var(--color-text-brand-bold-hovered)] data-[active=true]:active:!bg-[var(--color-background-blue-subtle-selected-hovered)] data-[active=true]:active:!text-[var(--color-text-brand-bold-hovered)] data-[active=true]:hover:[&>svg]:!text-[var(--color-icon-brand-bold-hovered)] data-[active=true]:active:[&>svg]:!text-[var(--color-icon-brand-bold-hovered)] data-[state=open]:hover:bg-[var(--color-background-neutral-subtlest-hovered)]",
|
|
366
|
+
outline: "bg-[var(--color-surface-primary)] border border-[var(--color-border-primary-subtle)] hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)] focus-visible:bg-[var(--color-background-neutral-subtlest-hovered)] active:bg-[var(--color-background-neutral-subtlest-hovered)] data-[active=true]:hover:!bg-[var(--color-background-blue-subtle-selected-hovered)] data-[active=true]:hover:!text-[var(--color-text-brand-bold-hovered)] data-[active=true]:active:!bg-[var(--color-background-blue-subtle-selected-hovered)] data-[active=true]:active:!text-[var(--color-text-brand-bold-hovered)] data-[active=true]:hover:[&>svg]:!text-[var(--color-icon-brand-bold-hovered)] data-[active=true]:active:[&>svg]:!text-[var(--color-icon-brand-bold-hovered)]"
|
|
367
|
+
},
|
|
368
|
+
size: {
|
|
369
|
+
default: "h-8",
|
|
370
|
+
s: "h-7 text-body-sm py-1",
|
|
371
|
+
l: "h-12 py-3 text-body-lg group-data-[collapsible=icon]:!size-8"
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
defaultVariants: {
|
|
375
|
+
variant: "default",
|
|
376
|
+
size: "default"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
), ve = /* @__PURE__ */ t.forwardRef(
|
|
380
|
+
({
|
|
381
|
+
asChild: r = !1,
|
|
382
|
+
isActive: e = !1,
|
|
383
|
+
variant: a = "enhanced",
|
|
384
|
+
size: o = "default",
|
|
385
|
+
tooltip: i,
|
|
386
|
+
enhancedHover: l = !0,
|
|
387
|
+
preserveActiveOnFocus: u = !0,
|
|
388
|
+
className: f,
|
|
389
|
+
onMouseEnter: p,
|
|
390
|
+
onMouseLeave: m,
|
|
391
|
+
onFocus: v,
|
|
392
|
+
onBlur: h,
|
|
393
|
+
onMouseDown: y,
|
|
394
|
+
...R
|
|
395
|
+
}, g) => {
|
|
396
|
+
const w = r ? "span" : "button", { isMobile: b, state: N } = E(), [S, n] = t.useState(!1), [c, z] = t.useState(!1), M = t.useRef(!1), B = t.useCallback(
|
|
397
|
+
(k) => {
|
|
398
|
+
l && n(!0), p?.(k);
|
|
399
|
+
},
|
|
400
|
+
[l, p]
|
|
401
|
+
), D = t.useCallback(
|
|
402
|
+
(k) => {
|
|
403
|
+
l && n(!1), m?.(k);
|
|
404
|
+
},
|
|
405
|
+
[l, m]
|
|
406
|
+
), x = t.useCallback(
|
|
407
|
+
(k) => {
|
|
408
|
+
M.current = !0, y?.(k);
|
|
409
|
+
},
|
|
410
|
+
[y]
|
|
411
|
+
), j = t.useCallback(
|
|
412
|
+
(k) => {
|
|
413
|
+
l && !M.current && z(!0), M.current = !1, v?.(k);
|
|
414
|
+
},
|
|
415
|
+
[l, v]
|
|
416
|
+
), K = t.useCallback(
|
|
417
|
+
(k) => {
|
|
418
|
+
l && z(!1), h?.(k);
|
|
419
|
+
},
|
|
420
|
+
[l, h]
|
|
421
|
+
), L = t.useMemo(() => a !== "enhanced" ? pe({ variant: "default", size: o }) : s(
|
|
422
|
+
// Base button styles
|
|
423
|
+
"relative peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-m px-2 py-1.5 text-left text-body-medium-md outline-none ring-[var(--color-border-focused)] transition-all duration-150 ease-in-out focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 cursor-pointer z-2",
|
|
424
|
+
// Size variants
|
|
425
|
+
o === "s" && "h-7 text-body-sm py-1",
|
|
426
|
+
o === "default" && "h-8",
|
|
427
|
+
o === "l" && "h-12 py-3 text-body-lg group-data-[collapsible=icon]:!size-8",
|
|
428
|
+
// Enhanced hover behavior for non-active items
|
|
429
|
+
S && !c && !e && "bg-[var(--color-background-neutral-subtlest-hovered)]",
|
|
430
|
+
// Enhanced hover behavior for active items
|
|
431
|
+
S && !c && e && [
|
|
432
|
+
"bg-[var(--color-background-blue-subtle-selected-hovered)]",
|
|
433
|
+
"[&>svg]:text-[var(--color-icon-brand-bold-hovered)]"
|
|
434
|
+
],
|
|
435
|
+
// Focus styles - clean focus for non-active items
|
|
436
|
+
c && !e && "bg-transparent ring-2 ring-[var(--color-border-brand-bold)]",
|
|
437
|
+
// Active item focus - preserve brand background when focused
|
|
438
|
+
c && e && u && [
|
|
439
|
+
"bg-[var(--color-background-blue-subtle-selected)]",
|
|
440
|
+
"text-[var(--color-text-brand-bold)]",
|
|
441
|
+
"[&]:text-body-medium-md [&]:font-normal",
|
|
442
|
+
"ring-2 ring-[var(--color-border-brand-bold)]",
|
|
443
|
+
"[&>svg]:text-[var(--color-text-brand-bold)]"
|
|
444
|
+
],
|
|
445
|
+
// Active item styles (non-focus state)
|
|
446
|
+
e && !c && [
|
|
447
|
+
"bg-[var(--color-background-blue-subtle-selected)]",
|
|
448
|
+
"text-[var(--color-text-brand-bold)]",
|
|
449
|
+
"[&]:text-body-medium-md [&]:font-normal",
|
|
450
|
+
"[&>svg]:text-[var(--color-text-brand-bold)]",
|
|
451
|
+
"hover:bg-[var(--color-background-blue-subtle-selected-hovered)]",
|
|
452
|
+
"hover:[&>svg]:text-[var(--color-icon-brand-bold-hovered)]"
|
|
453
|
+
],
|
|
454
|
+
// Open state (for collapsible items)
|
|
455
|
+
"data-[state=open]:bg-[var(--color-surface-secondary)]",
|
|
456
|
+
// Collapsed sidebar styles
|
|
457
|
+
"group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2"
|
|
458
|
+
), [a, o, S, c, e, u]), T = /* @__PURE__ */ d(
|
|
459
|
+
w,
|
|
460
|
+
{
|
|
461
|
+
ref: g,
|
|
462
|
+
"data-sidebar": "menu-button",
|
|
463
|
+
"data-size": o,
|
|
464
|
+
"data-active": e,
|
|
465
|
+
className: s(L, f),
|
|
466
|
+
onMouseEnter: l ? B : p,
|
|
467
|
+
onMouseLeave: l ? D : m,
|
|
468
|
+
onMouseDown: l ? x : y,
|
|
469
|
+
onFocus: l ? j : v,
|
|
470
|
+
onBlur: l ? K : h,
|
|
471
|
+
...R
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
return i ? (typeof i == "string" && (i = {
|
|
475
|
+
children: i
|
|
476
|
+
}), /* @__PURE__ */ C(_.Root, { children: [
|
|
477
|
+
/* @__PURE__ */ d(_.Trigger, { asChild: !0, children: T }),
|
|
478
|
+
/* @__PURE__ */ d(
|
|
479
|
+
_.Content,
|
|
480
|
+
{
|
|
481
|
+
side: "right",
|
|
482
|
+
align: "center",
|
|
483
|
+
hidden: N !== "collapsed" || b,
|
|
484
|
+
className: "z-50 overflow-hidden rounded-m bg-[var(--color-surface-primary)] px-3 py-1.5 text-xs text-[var(--color-text-primary)] border border-[var(--color-border-primary-subtle)] shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 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",
|
|
485
|
+
...i
|
|
486
|
+
}
|
|
487
|
+
)
|
|
488
|
+
] })) : T;
|
|
489
|
+
}
|
|
490
|
+
);
|
|
491
|
+
ve.displayName = "SidebarMenuButton";
|
|
492
|
+
const fe = /* @__PURE__ */ t.forwardRef(({ className: r, showOnHover: e = !1, size: a = "m", ...o }, i) => /* @__PURE__ */ d(
|
|
493
|
+
O,
|
|
494
|
+
{
|
|
495
|
+
ref: i,
|
|
496
|
+
"data-sidebar": "menu-action",
|
|
497
|
+
variant: "ghost",
|
|
498
|
+
size: "s",
|
|
499
|
+
className: s(
|
|
500
|
+
// Base positioning and styling - Fixed inconsistencies
|
|
501
|
+
"absolute right-1 flex aspect-square items-center justify-center rounded-m p-0",
|
|
502
|
+
"text-[var(--color-text-secondary)] outline-none transition-all duration-150 ease-in-out",
|
|
503
|
+
"hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)]",
|
|
504
|
+
"focus-visible:ring-2 focus-visible:ring-[var(--color-border-focused)]",
|
|
505
|
+
"peer-hover/menu-button:text-[var(--color-text-primary)]",
|
|
506
|
+
"enabled:active:bg-[var(--grey-alpha-100)] enabled:active:translate-y-px",
|
|
507
|
+
"[&>svg]:size-4 [&>svg]:shrink-0",
|
|
508
|
+
// Consistent sizing - Fixed w-5 -> w-6 issue
|
|
509
|
+
"w-6 h-6",
|
|
510
|
+
// Improved positioning - Fixed top-1.5 -> top-1 issue
|
|
511
|
+
"top-1",
|
|
512
|
+
// Size-responsive positioning for different menu button sizes
|
|
513
|
+
"peer-data-[size=s]/menu-button:top-1",
|
|
514
|
+
"peer-data-[size=default]/menu-button:top-1",
|
|
515
|
+
"peer-data-[size=l]/menu-button:top-2.5",
|
|
516
|
+
// Enhanced showOnHover behavior with improved transitions
|
|
517
|
+
e && [
|
|
518
|
+
"opacity-0 transition-opacity duration-150",
|
|
519
|
+
"group-hover/menu-item:opacity-100",
|
|
520
|
+
"group-focus-within/menu-item:opacity-100",
|
|
521
|
+
"data-[state=open]:opacity-100",
|
|
522
|
+
"peer-data-[active=true]/menu-button:opacity-100",
|
|
523
|
+
"peer-data-[active=true]/menu-button:text-[var(--color-text-primary)]"
|
|
524
|
+
],
|
|
525
|
+
// Hide in collapsed sidebar
|
|
526
|
+
"group-data-[collapsible=icon]:hidden",
|
|
527
|
+
r
|
|
528
|
+
),
|
|
529
|
+
...o
|
|
530
|
+
}
|
|
531
|
+
));
|
|
532
|
+
fe.displayName = "SidebarMenuAction";
|
|
533
|
+
const me = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
534
|
+
"div",
|
|
535
|
+
{
|
|
536
|
+
ref: a,
|
|
537
|
+
"data-sidebar": "menu-badge",
|
|
538
|
+
className: s(
|
|
539
|
+
"absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-m px-1 text-xs font-medium tabular-nums text-[var(--color-text-on-action)] select-none pointer-events-none",
|
|
540
|
+
"peer-hover/menu-button:text-[var(--color-text-brand-bold-selected)] peer-data-[active=true]/menu-button:text-[var(--color-text-brand-bold-selected)]",
|
|
541
|
+
"peer-data-[size=s]/menu-button:top-1",
|
|
542
|
+
"peer-data-[size=default]/menu-button:top-1.5",
|
|
543
|
+
"peer-data-[size=l]/menu-button:top-2.5",
|
|
544
|
+
"group-data-[collapsible=icon]:hidden",
|
|
545
|
+
r
|
|
546
|
+
),
|
|
547
|
+
...e
|
|
548
|
+
}
|
|
549
|
+
));
|
|
550
|
+
me.displayName = "SidebarMenuBadge";
|
|
551
|
+
const ge = /* @__PURE__ */ t.forwardRef(({ className: r, showIcon: e = !1, ...a }, o) => {
|
|
552
|
+
const i = t.useMemo(() => `${Math.floor(Math.random() * 40) + 50}%`, []);
|
|
553
|
+
return /* @__PURE__ */ C(
|
|
554
|
+
"div",
|
|
555
|
+
{
|
|
556
|
+
ref: o,
|
|
557
|
+
"data-sidebar": "menu-skeleton",
|
|
558
|
+
className: s("rounded-m h-8 flex gap-2 px-2 items-center", r),
|
|
559
|
+
...a,
|
|
560
|
+
children: [
|
|
561
|
+
e && /* @__PURE__ */ d("div", { className: "rounded-m bg-[var(--color-surface-secondary)] size-4 animate-pulse" }),
|
|
562
|
+
/* @__PURE__ */ d(
|
|
563
|
+
"div",
|
|
564
|
+
{
|
|
565
|
+
className: "h-4 flex-1 max-w-[--skeleton-width] bg-[var(--color-surface-secondary)] rounded-m animate-pulse",
|
|
566
|
+
style: {
|
|
567
|
+
"--skeleton-width": i
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
)
|
|
571
|
+
]
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
});
|
|
575
|
+
ge.displayName = "SidebarMenuSkeleton";
|
|
576
|
+
const xe = /* @__PURE__ */ t.forwardRef(({ className: r, ...e }, a) => /* @__PURE__ */ d(
|
|
577
|
+
"ul",
|
|
578
|
+
{
|
|
579
|
+
ref: a,
|
|
580
|
+
"data-sidebar": "menu-sub",
|
|
581
|
+
className: s(
|
|
582
|
+
"mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-[var(--color-border-primary-subtle)] px-2.5 py-0.5 z-1",
|
|
583
|
+
"group-data-[collapsible=icon]:hidden",
|
|
584
|
+
r
|
|
585
|
+
),
|
|
586
|
+
...e
|
|
587
|
+
}
|
|
588
|
+
));
|
|
589
|
+
xe.displayName = "SidebarMenuSub";
|
|
590
|
+
const he = /* @__PURE__ */ t.forwardRef(({ ...r }, e) => /* @__PURE__ */ d("li", { ref: e, ...r }));
|
|
591
|
+
he.displayName = "SidebarMenuSubItem";
|
|
592
|
+
const ye = /* @__PURE__ */ t.forwardRef(({
|
|
593
|
+
asChild: r = !1,
|
|
594
|
+
size: e = "m",
|
|
595
|
+
isActive: a = !1,
|
|
596
|
+
enhancedHover: o = !0,
|
|
597
|
+
preserveActiveOnFocus: i = !0,
|
|
598
|
+
className: l,
|
|
599
|
+
onMouseEnter: u,
|
|
600
|
+
onMouseLeave: f,
|
|
601
|
+
onFocus: p,
|
|
602
|
+
onBlur: m,
|
|
603
|
+
onMouseDown: v,
|
|
604
|
+
...h
|
|
605
|
+
}, y) => {
|
|
606
|
+
const R = r ? "span" : "button", [g, w] = t.useState(!1), [b, N] = t.useState(!1), S = t.useRef(!1), n = t.useCallback(
|
|
607
|
+
(x) => {
|
|
608
|
+
o && w(!0), u?.(x);
|
|
609
|
+
},
|
|
610
|
+
[o, u]
|
|
611
|
+
), c = t.useCallback(
|
|
612
|
+
(x) => {
|
|
613
|
+
o && w(!1), f?.(x);
|
|
614
|
+
},
|
|
615
|
+
[o, f]
|
|
616
|
+
), z = t.useCallback(
|
|
617
|
+
(x) => {
|
|
618
|
+
S.current = !0, v?.(x);
|
|
619
|
+
},
|
|
620
|
+
[v]
|
|
621
|
+
), M = t.useCallback(
|
|
622
|
+
(x) => {
|
|
623
|
+
o && !S.current && N(!0), S.current = !1, p?.(x);
|
|
624
|
+
},
|
|
625
|
+
[o, p]
|
|
626
|
+
), B = t.useCallback(
|
|
627
|
+
(x) => {
|
|
628
|
+
o && N(!1), m?.(x);
|
|
629
|
+
},
|
|
630
|
+
[o, m]
|
|
631
|
+
), D = t.useMemo(() => s(
|
|
632
|
+
// Base submenu button styles
|
|
633
|
+
"relative flex w-full justify-start h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-m px-2 text-[var(--color-text-secondary)] outline-none ring-[var(--color-border-focused)] transition-all duration-150 ease-in-out disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 cursor-pointer [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-[var(--color-text-secondary)] z-2",
|
|
634
|
+
// Size variants
|
|
635
|
+
e === "s" && "text-body-sm px-1.5 py-0.5",
|
|
636
|
+
e === "m" && "text-body-md",
|
|
637
|
+
// Enhanced hover behavior for non-active items
|
|
638
|
+
o && g && !b && !a && "bg-[var(--color-background-neutral-subtlest-hovered)]",
|
|
639
|
+
// Enhanced hover behavior for active items
|
|
640
|
+
o && g && !b && a && "bg-[var(--color-background-blue-subtle-selected-hovered)]",
|
|
641
|
+
// Focus styles - clean focus for non-active items
|
|
642
|
+
o && b && !a && "bg-transparent ring-2 ring-[var(--color-border-brand-bold)]",
|
|
643
|
+
// Active item focus - preserve brand background when focused
|
|
644
|
+
o && b && a && i && [
|
|
645
|
+
"bg-[var(--color-background-blue-subtle-selected)]",
|
|
646
|
+
"text-[var(--color-text-brand-bold)]",
|
|
647
|
+
"[&]:text-body-md [&]:font-normal",
|
|
648
|
+
"ring-2 ring-[var(--color-border-brand-bold)]"
|
|
649
|
+
],
|
|
650
|
+
// Active item styles (non-focus state)
|
|
651
|
+
a && !b && [
|
|
652
|
+
"bg-[var(--color-background-blue-subtle-selected)]",
|
|
653
|
+
"text-[var(--color-text-brand-bold)]",
|
|
654
|
+
"[&]:text-body-md [&]:font-normal",
|
|
655
|
+
"hover:bg-[var(--color-background-blue-subtle-selected-hovered)]"
|
|
656
|
+
],
|
|
657
|
+
// Fallback for non-enhanced behavior
|
|
658
|
+
!o && [
|
|
659
|
+
"hover:bg-[var(--color-background-neutral-subtlest-hovered)] hover:text-[var(--color-text-primary)] focus-visible:ring-2 active:bg-[var(--color-background-neutral-subtlest-hovered)] active:text-[var(--color-text-primary)]",
|
|
660
|
+
"data-[active=true]:bg-[var(--color-background-blue-subtle-selected)] data-[active=true]:text-[var(--color-text-brand-bold-selected)] data-[active=true]:hover:!bg-[var(--color-background-blue-subtle-selected-hovered)] data-[active=true]:hover:!text-[var(--color-text-brand-bold-hovered)] data-[active=true]:active:!bg-[var(--color-background-blue-subtle-selected-hovered)] data-[active=true]:active:!text-[var(--color-text-brand-bold-hovered)]"
|
|
661
|
+
]
|
|
662
|
+
), [e, o, g, b, a, i]);
|
|
663
|
+
return /* @__PURE__ */ d(
|
|
664
|
+
R,
|
|
665
|
+
{
|
|
666
|
+
ref: y,
|
|
667
|
+
"data-sidebar": "menu-sub-button",
|
|
668
|
+
"data-size": e,
|
|
669
|
+
"data-active": a,
|
|
670
|
+
className: s(D, l),
|
|
671
|
+
type: r ? void 0 : "button",
|
|
672
|
+
onMouseEnter: o ? n : u,
|
|
673
|
+
onMouseLeave: o ? c : f,
|
|
674
|
+
onMouseDown: o ? z : v,
|
|
675
|
+
onFocus: o ? M : p,
|
|
676
|
+
onBlur: o ? B : m,
|
|
677
|
+
...h
|
|
678
|
+
}
|
|
679
|
+
);
|
|
680
|
+
});
|
|
681
|
+
ye.displayName = "SidebarMenuSubButton";
|
|
682
|
+
export {
|
|
683
|
+
J as Sidebar,
|
|
684
|
+
se as SidebarContent,
|
|
685
|
+
oe as SidebarFooter,
|
|
686
|
+
le as SidebarGroup,
|
|
687
|
+
ne as SidebarGroupAction,
|
|
688
|
+
ce as SidebarGroupContent,
|
|
689
|
+
ie as SidebarGroupLabel,
|
|
690
|
+
te as SidebarHeader,
|
|
691
|
+
ee as SidebarInput,
|
|
692
|
+
H as SidebarInset,
|
|
693
|
+
ue as SidebarMenu,
|
|
694
|
+
fe as SidebarMenuAction,
|
|
695
|
+
me as SidebarMenuBadge,
|
|
696
|
+
ve as SidebarMenuButton,
|
|
697
|
+
be as SidebarMenuItem,
|
|
698
|
+
ge as SidebarMenuSkeleton,
|
|
699
|
+
xe as SidebarMenuSub,
|
|
700
|
+
ye as SidebarMenuSubButton,
|
|
701
|
+
he as SidebarMenuSubItem,
|
|
702
|
+
A as SidebarProvider,
|
|
703
|
+
Z as SidebarRail,
|
|
704
|
+
re as SidebarSearchButton,
|
|
705
|
+
ae as SidebarSearchTrigger,
|
|
706
|
+
de as SidebarSeparator,
|
|
707
|
+
Q as SidebarTrigger,
|
|
708
|
+
E as useSidebar
|
|
709
|
+
};
|