tembro 4.0.1 → 4.2.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/CHANGELOG.md +15 -0
- package/dist/components/display/chat.cjs +1 -0
- package/dist/components/display/chat.d.ts +94 -0
- package/dist/components/display/chat.js +1 -0
- package/dist/components/display/index.d.ts +1 -0
- package/dist/components/display/kanban.d.ts +33 -1
- package/dist/components/inputs/combobox.cjs +1 -0
- package/dist/components/inputs/combobox.d.ts +46 -0
- package/dist/components/inputs/combobox.js +1 -0
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/public.d.ts +1 -0
- package/dist/components/layout/sidebar.d.ts +24 -2
- package/dist/components/modern/rich-text-editor.d.ts +13 -1
- package/dist/components/theme-provider.d.ts +19 -6
- package/dist/components/ui/badge/index.d.ts +8 -2
- package/dist/src/components/display/activity-feed.cjs +1 -1
- package/dist/src/components/display/activity-feed.js +4 -1
- package/dist/src/components/display/chat.cjs +1 -0
- package/dist/src/components/display/chat.js +372 -0
- package/dist/src/components/display/index.cjs +1 -1
- package/dist/src/components/display/index.js +17 -16
- package/dist/src/components/display/kanban.cjs +1 -1
- package/dist/src/components/display/kanban.js +321 -176
- package/dist/src/components/display/timeline.cjs +1 -1
- package/dist/src/components/display/timeline.js +5 -5
- package/dist/src/components/inputs/combobox.cjs +1 -0
- package/dist/src/components/inputs/combobox.js +162 -0
- package/dist/src/components/inputs/index.cjs +1 -1
- package/dist/src/components/inputs/index.js +10 -9
- package/dist/src/components/inputs/public.cjs +1 -1
- package/dist/src/components/inputs/public.js +10 -9
- package/dist/src/components/inputs/tag-input.cjs +1 -1
- package/dist/src/components/inputs/tag-input.js +6 -2
- package/dist/src/components/layout/index.cjs +1 -1
- package/dist/src/components/layout/index.js +4 -4
- package/dist/src/components/layout/public.cjs +1 -1
- package/dist/src/components/layout/public.js +4 -4
- package/dist/src/components/layout/sidebar.cjs +1 -1
- package/dist/src/components/layout/sidebar.js +326 -228
- package/dist/src/components/modern/rich-text-editor.cjs +1 -1
- package/dist/src/components/modern/rich-text-editor.js +216 -89
- package/dist/src/components/theme-provider.cjs +1 -1
- package/dist/src/components/theme-provider.js +58 -36
- package/dist/src/components/ui/badge/index.cjs +1 -1
- package/dist/src/components/ui/badge/index.js +59 -47
- package/dist/src/components/ui/input/clearable.cjs +1 -1
- package/dist/src/components/ui/input/clearable.js +5 -2
- package/dist/src/components/ui/input/primitive.cjs +1 -1
- package/dist/src/components/ui/input/primitive.js +1 -1
- package/dist/src/index.cjs +1 -1
- package/dist/src/index.js +88 -86
- package/dist/src/public-component-surface.cjs +1 -1
- package/dist/src/public-component-surface.js +107 -41
- package/package.json +1 -1
- package/packages/cli/dist/index.cjs +37 -37
- package/packages/cli/vendor/src/components/display/activity-feed.tsx +1 -1
- package/packages/cli/vendor/src/components/display/chat.tsx +237 -0
- package/packages/cli/vendor/src/components/display/index.ts +1 -0
- package/packages/cli/vendor/src/components/display/kanban.tsx +219 -72
- package/packages/cli/vendor/src/components/display/timeline.tsx +10 -10
- package/packages/cli/vendor/src/components/inputs/combobox.tsx +303 -0
- package/packages/cli/vendor/src/components/inputs/index.ts +1 -0
- package/packages/cli/vendor/src/components/inputs/public.ts +1 -0
- package/packages/cli/vendor/src/components/inputs/tag-input.tsx +3 -2
- package/packages/cli/vendor/src/components/layout/sidebar.tsx +212 -51
- package/packages/cli/vendor/src/components/modern/rich-text-editor.tsx +115 -32
- package/packages/cli/vendor/src/components/theme-provider.tsx +82 -36
- package/packages/cli/vendor/src/components/ui/badge/index.tsx +29 -8
- package/packages/cli/vendor/src/components/ui/input/clearable.tsx +2 -2
- package/packages/cli/vendor/src/components/ui/input/primitive.tsx +1 -1
- package/packages/cli/vendor/src/public-component-surface.ts +36 -22
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/HeroSection.tsx +2 -2
- package/packages/cli/vendor/templates/showcase/src/showcase/layout/WorkbenchSidebar.tsx +1 -1
- package/packages/cli/vendor/templates/styles/globals.css +91 -10
- package/registry.json +28 -11
|
@@ -1,196 +1,212 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { cn as e } from "../../lib/utils.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import {
|
|
3
|
+
import { Input as t } from "../ui/input/index.js";
|
|
4
|
+
import { useIsMobile as n } from "../../hooks/use-is-mobile.js";
|
|
5
|
+
import { ControllableDetails as r } from "./controllable-details.js";
|
|
6
|
+
import { Tooltip as i } from "../ui/tooltip/index.js";
|
|
7
|
+
import { useSidebar as a } from "./sidebar-context.js";
|
|
8
|
+
import * as o from "react";
|
|
9
|
+
import { ChevronRightIcon as s, MenuIcon as c, SearchIcon as l, XIcon as u } from "lucide-react";
|
|
10
|
+
import { Fragment as d, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
11
|
//#region src/components/layout/sidebar.tsx
|
|
11
|
-
var
|
|
12
|
-
function
|
|
12
|
+
var m = 1024, h = "18rem", g = "4.75rem", _ = "min(88vw, 22rem)";
|
|
13
|
+
function v({ active: t, disabled: n }) {
|
|
13
14
|
return e("border border-transparent bg-transparent text-[color:color-mix(in_oklch,var(--sidebar-foreground),transparent_6%)] hover:border-[color:var(--aui-sidebar-item-active-border)] hover:bg-[color:var(--aui-sidebar-item-hover-bg)] hover:text-[color:var(--sidebar-foreground)] focus-visible:border-[color:var(--sidebar-ring)] focus-visible:bg-[color:var(--aui-sidebar-item-hover-bg)] focus-visible:text-[color:var(--sidebar-foreground)] focus-visible:shadow-[0_0_0_3px_color-mix(in_oklch,var(--sidebar-ring),transparent_82%)]", t && "border-[color:var(--aui-sidebar-item-active-border)] bg-[color:var(--aui-sidebar-item-active-bg)] text-[color:var(--aui-sidebar-item-active-fg)] shadow-[inset_0_1px_0_rgba(255,255,255,0.08),0_10px_24px_color-mix(in_oklch,var(--sidebar-primary),transparent_88%)]", n && "hover:border-transparent hover:bg-transparent hover:text-[color:color-mix(in_oklch,var(--sidebar-foreground),transparent_6%)]");
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
+
function y({ collapsed: t, depth: n, itemSize: r, activeIndicator: i }) {
|
|
16
17
|
return e("relative w-full rounded-[min(var(--radius-xl),14px)] py-2", r === "sm" && "min-h-8 text-xs", r === "md" && "min-h-9 text-sm", r === "lg" && "min-h-11 text-sm", t ? "justify-center px-2" : "px-2.5", !t && n > 0 && "pl-3", i === "bar" && "data-[active=true]:pl-4 before:pointer-events-none before:absolute before:left-1.5 before:top-1/2 before:hidden before:h-5 before:w-1 before:-translate-y-1/2 before:rounded-full before:bg-[color:var(--sidebar-primary)] data-[active=true]:before:block", i === "pill" && "rounded-full", i === "none" && "data-[active=true]:shadow-none");
|
|
17
18
|
}
|
|
18
|
-
function
|
|
19
|
+
function b(e) {
|
|
19
20
|
return e.items?.some((e) => !e.hidden) ?? !1;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
return e.active ? !0 : e.items?.some((e) =>
|
|
22
|
+
function x(e) {
|
|
23
|
+
return e.active ? !0 : e.items?.some((e) => x(e)) ?? !1;
|
|
23
24
|
}
|
|
24
|
-
function
|
|
25
|
+
function S(e, t) {
|
|
25
26
|
e.onSelect?.(), t?.(e);
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
-
let
|
|
29
|
-
"aria-
|
|
28
|
+
function C({ item: t, collapsed: n, depth: r, itemSize: a, activeIndicator: o, onItemSelect: s, renderLink: c }) {
|
|
29
|
+
let l = t.current ?? (t.active ? "page" : void 0), u = {
|
|
30
|
+
"aria-label": n && typeof t.label == "string" ? t.label : void 0,
|
|
31
|
+
"aria-current": l,
|
|
30
32
|
"aria-disabled": t.disabled || void 0,
|
|
31
33
|
"data-slot": "sidebar-item",
|
|
32
34
|
"data-active": t.active || void 0,
|
|
33
35
|
"data-disabled": t.disabled || void 0,
|
|
34
|
-
"data-depth": String(
|
|
36
|
+
"data-depth": String(r),
|
|
35
37
|
"data-size": a,
|
|
36
38
|
"data-active-indicator": o,
|
|
37
|
-
className: e("flex items-center gap-2 border border-transparent font-medium outline-none transition-[background-color,border-color,color,box-shadow] data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
|
|
39
|
+
className: e("flex min-w-0 flex-1 items-center gap-2 border border-transparent text-left font-medium outline-none transition-[background-color,border-color,color,box-shadow] data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", v({
|
|
38
40
|
active: t.active,
|
|
39
41
|
disabled: t.disabled
|
|
40
|
-
}),
|
|
42
|
+
}), y({
|
|
41
43
|
collapsed: n,
|
|
42
|
-
depth:
|
|
44
|
+
depth: r,
|
|
43
45
|
itemSize: a,
|
|
44
46
|
activeIndicator: o
|
|
45
47
|
}))
|
|
46
|
-
},
|
|
47
|
-
t.icon && /* @__PURE__ */
|
|
48
|
+
}, m = /* @__PURE__ */ p(d, { children: [
|
|
49
|
+
t.icon && /* @__PURE__ */ f("span", {
|
|
48
50
|
className: "shrink-0",
|
|
49
51
|
children: t.icon
|
|
50
52
|
}),
|
|
51
|
-
!n && /* @__PURE__ */
|
|
53
|
+
!n && /* @__PURE__ */ f("span", {
|
|
52
54
|
className: "min-w-0 flex-1 truncate",
|
|
53
55
|
children: t.label
|
|
54
56
|
}),
|
|
55
|
-
!n && t.badge && /* @__PURE__ */
|
|
57
|
+
!n && t.badge && /* @__PURE__ */ f("span", {
|
|
56
58
|
className: "shrink-0",
|
|
57
59
|
children: t.badge
|
|
58
60
|
})
|
|
59
|
-
] }),
|
|
61
|
+
] }), h = (e) => n ? /* @__PURE__ */ f(i, {
|
|
60
62
|
content: t.tooltip ?? t.label,
|
|
61
63
|
side: "right",
|
|
62
|
-
children: /* @__PURE__ */
|
|
64
|
+
children: /* @__PURE__ */ f("span", {
|
|
63
65
|
className: "block",
|
|
64
66
|
children: e
|
|
65
67
|
})
|
|
66
|
-
}) : e
|
|
67
|
-
|
|
68
|
+
}) : e, g = (e) => n || !t.action ? e : /* @__PURE__ */ p("div", {
|
|
69
|
+
"data-slot": "sidebar-item-row",
|
|
70
|
+
className: "group/sidebar-item-row flex min-w-0 items-center gap-1",
|
|
71
|
+
children: [e, /* @__PURE__ */ f("button", {
|
|
72
|
+
type: "button",
|
|
73
|
+
"data-slot": "sidebar-item-action",
|
|
74
|
+
"aria-label": t.actionLabel ?? `Actions for ${String(t.label)}`,
|
|
75
|
+
className: "grid size-8 shrink-0 place-items-center rounded-md p-0 leading-none text-muted-foreground opacity-0 outline-none transition hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:opacity-100 focus-visible:ring-2 focus-visible:ring-sidebar-ring group-hover/sidebar-item-row:opacity-100",
|
|
76
|
+
onClick: (e) => {
|
|
77
|
+
e.preventDefault(), e.stopPropagation(), t.onAction?.();
|
|
78
|
+
},
|
|
79
|
+
children: t.action
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
return t.href?.startsWith("/") ? h(g(c ? /* @__PURE__ */ f(d, { children: c({
|
|
68
83
|
item: t,
|
|
69
84
|
href: t.href,
|
|
70
|
-
...
|
|
85
|
+
...u,
|
|
71
86
|
onClick: (e) => {
|
|
72
87
|
if (t.disabled) {
|
|
73
88
|
e.preventDefault();
|
|
74
89
|
return;
|
|
75
90
|
}
|
|
76
|
-
|
|
91
|
+
S(t, s);
|
|
77
92
|
},
|
|
78
|
-
children:
|
|
79
|
-
}) }) : /* @__PURE__ */
|
|
93
|
+
children: m
|
|
94
|
+
}) }) : /* @__PURE__ */ f("a", {
|
|
80
95
|
href: t.href,
|
|
81
|
-
...
|
|
96
|
+
...u,
|
|
82
97
|
onClick: (e) => {
|
|
83
98
|
if (t.disabled) {
|
|
84
99
|
e.preventDefault();
|
|
85
100
|
return;
|
|
86
101
|
}
|
|
87
|
-
|
|
102
|
+
S(t, s);
|
|
88
103
|
},
|
|
89
|
-
children:
|
|
90
|
-
})) : t.href ?
|
|
104
|
+
children: m
|
|
105
|
+
}))) : t.href ? h(g(/* @__PURE__ */ f("button", {
|
|
91
106
|
type: "button",
|
|
92
|
-
...
|
|
93
|
-
className: e(
|
|
107
|
+
...u,
|
|
108
|
+
className: e(u.className, "w-full"),
|
|
94
109
|
onClick: () => {
|
|
95
110
|
if (t.disabled) return;
|
|
96
111
|
let e = t.href;
|
|
97
112
|
if (e) {
|
|
98
|
-
if (
|
|
113
|
+
if (S(t, s), e.startsWith("http")) {
|
|
99
114
|
window.open(e, "_blank", "noopener,noreferrer");
|
|
100
115
|
return;
|
|
101
116
|
}
|
|
102
117
|
window.location.assign(e);
|
|
103
118
|
}
|
|
104
119
|
},
|
|
105
|
-
children:
|
|
106
|
-
})) :
|
|
120
|
+
children: m
|
|
121
|
+
}))) : h(g(/* @__PURE__ */ f("button", {
|
|
107
122
|
type: "button",
|
|
108
123
|
disabled: t.disabled,
|
|
109
|
-
...
|
|
124
|
+
...u,
|
|
110
125
|
onClick: () => {
|
|
111
|
-
t.disabled ||
|
|
126
|
+
t.disabled || S(t, s);
|
|
112
127
|
},
|
|
113
|
-
children:
|
|
114
|
-
}));
|
|
128
|
+
children: m
|
|
129
|
+
})));
|
|
115
130
|
}
|
|
116
|
-
function
|
|
131
|
+
function w({ items: t, collapsed: n, depth: a, showSectionLabels: c, itemSize: l, activeIndicator: u, onItemSelect: d, renderLink: m }) {
|
|
117
132
|
return t.map((t) => {
|
|
118
133
|
if (t.hidden) return null;
|
|
119
|
-
let h =
|
|
120
|
-
if (!h) return /* @__PURE__ */
|
|
134
|
+
let h = b(t), g = x(t), _ = c && !n && a === 0 && t.sectionLabel;
|
|
135
|
+
if (!h) return /* @__PURE__ */ p(o.Fragment, { children: [_ ? /* @__PURE__ */ f("div", {
|
|
121
136
|
"data-slot": "sidebar-group-label",
|
|
122
137
|
className: "px-2.5 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-[0.14em] text-[color:color-mix(in_oklch,var(--sidebar-foreground),transparent_42%)] first:pt-0",
|
|
123
138
|
children: t.sectionLabel
|
|
124
|
-
}) : null, /* @__PURE__ */
|
|
139
|
+
}) : null, /* @__PURE__ */ f(C, {
|
|
125
140
|
item: t,
|
|
126
|
-
collapsed:
|
|
127
|
-
depth:
|
|
141
|
+
collapsed: n,
|
|
142
|
+
depth: a,
|
|
128
143
|
itemSize: l,
|
|
129
|
-
activeIndicator:
|
|
130
|
-
onItemSelect:
|
|
144
|
+
activeIndicator: u,
|
|
145
|
+
onItemSelect: d,
|
|
131
146
|
renderLink: m
|
|
132
147
|
})] }, t.key);
|
|
133
|
-
let
|
|
134
|
-
return /* @__PURE__ */
|
|
148
|
+
let S = t.defaultExpanded ?? g;
|
|
149
|
+
return /* @__PURE__ */ p("div", {
|
|
135
150
|
"data-slot": "sidebar-group",
|
|
136
|
-
"data-depth":
|
|
137
|
-
children: [
|
|
151
|
+
"data-depth": a,
|
|
152
|
+
children: [_ && /* @__PURE__ */ f("div", {
|
|
138
153
|
"data-slot": "sidebar-group-label",
|
|
139
154
|
className: "px-2.5 pb-1 pt-3 text-[11px] font-semibold uppercase tracking-[0.14em] text-[color:color-mix(in_oklch,var(--sidebar-foreground),transparent_42%)] first:pt-0",
|
|
140
155
|
children: t.sectionLabel
|
|
141
|
-
}), /* @__PURE__ */
|
|
156
|
+
}), /* @__PURE__ */ p(r, {
|
|
142
157
|
"data-slot": "sidebar-group-details",
|
|
143
158
|
open: t.expanded,
|
|
144
|
-
defaultOpen:
|
|
159
|
+
defaultOpen: S,
|
|
145
160
|
className: "group/sidebar-details",
|
|
146
161
|
onOpenChange: t.onExpandedChange,
|
|
147
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ p("summary", {
|
|
163
|
+
"aria-label": n && typeof t.label == "string" ? t.label : void 0,
|
|
148
164
|
"data-slot": "sidebar-group-trigger",
|
|
149
165
|
"data-size": l,
|
|
150
|
-
"data-active":
|
|
151
|
-
"data-active-indicator":
|
|
152
|
-
className: e("flex list-none items-center gap-2 border border-transparent font-medium outline-none transition-[background-color,border-color,color,box-shadow]",
|
|
153
|
-
collapsed:
|
|
154
|
-
depth:
|
|
166
|
+
"data-active": g || void 0,
|
|
167
|
+
"data-active-indicator": u,
|
|
168
|
+
className: e("flex list-none items-center gap-2 border border-transparent text-left font-medium outline-none transition-[background-color,border-color,color,box-shadow]", v({ active: g }), y({
|
|
169
|
+
collapsed: n,
|
|
170
|
+
depth: a,
|
|
155
171
|
itemSize: l,
|
|
156
|
-
activeIndicator:
|
|
172
|
+
activeIndicator: u
|
|
157
173
|
})),
|
|
158
174
|
children: [
|
|
159
|
-
t.icon ?
|
|
175
|
+
t.icon ? n ? /* @__PURE__ */ f(i, {
|
|
160
176
|
content: t.tooltip ?? t.label,
|
|
161
177
|
side: "right",
|
|
162
|
-
children: /* @__PURE__ */
|
|
178
|
+
children: /* @__PURE__ */ f("span", {
|
|
163
179
|
className: "shrink-0",
|
|
164
180
|
children: t.icon
|
|
165
181
|
})
|
|
166
|
-
}) : /* @__PURE__ */
|
|
182
|
+
}) : /* @__PURE__ */ f("span", {
|
|
167
183
|
className: "shrink-0",
|
|
168
184
|
children: t.icon
|
|
169
185
|
}) : null,
|
|
170
|
-
!
|
|
186
|
+
!n && /* @__PURE__ */ f("span", {
|
|
171
187
|
className: "min-w-0 flex-1 truncate",
|
|
172
188
|
children: t.label
|
|
173
189
|
}),
|
|
174
|
-
!
|
|
190
|
+
!n && t.badge && /* @__PURE__ */ f("span", {
|
|
175
191
|
className: "shrink-0",
|
|
176
192
|
children: t.badge
|
|
177
193
|
}),
|
|
178
|
-
!
|
|
194
|
+
!n && /* @__PURE__ */ f(s, {
|
|
179
195
|
"data-slot": "sidebar-group-chevron",
|
|
180
196
|
className: "ml-auto size-3.5 shrink-0 text-[color:color-mix(in_oklch,var(--sidebar-foreground),transparent_42%)] transition-transform group-open/sidebar-details:rotate-90"
|
|
181
197
|
})
|
|
182
198
|
]
|
|
183
|
-
}), /* @__PURE__ */
|
|
199
|
+
}), /* @__PURE__ */ f("div", {
|
|
184
200
|
"data-slot": "sidebar-group-content",
|
|
185
|
-
className: e("mt-1 flex flex-col gap-1", !
|
|
186
|
-
children: /* @__PURE__ */
|
|
201
|
+
className: e("mt-1 flex flex-col gap-1", !n && "pl-3"),
|
|
202
|
+
children: /* @__PURE__ */ f(w, {
|
|
187
203
|
items: t.items ?? [],
|
|
188
|
-
collapsed:
|
|
189
|
-
depth:
|
|
204
|
+
collapsed: n,
|
|
205
|
+
depth: a + 1,
|
|
190
206
|
showSectionLabels: c,
|
|
191
207
|
itemSize: l,
|
|
192
|
-
activeIndicator:
|
|
193
|
-
onItemSelect:
|
|
208
|
+
activeIndicator: u,
|
|
209
|
+
onItemSelect: d,
|
|
194
210
|
renderLink: m
|
|
195
211
|
})
|
|
196
212
|
})]
|
|
@@ -198,51 +214,66 @@ function S({ items: t, collapsed: i, depth: s, showSectionLabels: c, itemSize: l
|
|
|
198
214
|
}, t.key);
|
|
199
215
|
});
|
|
200
216
|
}
|
|
201
|
-
function
|
|
202
|
-
let
|
|
217
|
+
function T(e, t) {
|
|
218
|
+
let n = t.trim().toLocaleLowerCase();
|
|
219
|
+
return n ? e.flatMap((e) => {
|
|
220
|
+
let t = e.items ? T(e.items, n) : [];
|
|
221
|
+
return ![
|
|
222
|
+
typeof e.label == "string" ? e.label : "",
|
|
223
|
+
e.sectionLabel,
|
|
224
|
+
...e.keywords ?? []
|
|
225
|
+
].filter((e) => typeof e == "string").join(" ").toLocaleLowerCase().includes(n) && t.length === 0 ? [] : [{
|
|
226
|
+
...e,
|
|
227
|
+
items: t.length ? t : e.items,
|
|
228
|
+
defaultExpanded: t.length ? !0 : e.defaultExpanded
|
|
229
|
+
}];
|
|
230
|
+
}) : e;
|
|
231
|
+
}
|
|
232
|
+
function E({ item: t, collapsed: n, onItemSelect: r }) {
|
|
233
|
+
let a = /* @__PURE__ */ p("button", {
|
|
203
234
|
type: "button",
|
|
204
235
|
"data-slot": "sidebar-action",
|
|
205
236
|
"data-active": t.active || void 0,
|
|
206
237
|
"data-disabled": t.disabled || void 0,
|
|
207
|
-
className: e("flex min-h-9 items-center gap-2 rounded-lg border border-transparent px-2.5 text-sm font-medium outline-none transition-[background-color,border-color,color,box-shadow] data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50",
|
|
238
|
+
className: e("flex min-h-9 items-center gap-2 rounded-lg border border-transparent px-2.5 text-sm font-medium outline-none transition-[background-color,border-color,color,box-shadow] data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50", v({
|
|
208
239
|
active: t.active,
|
|
209
240
|
disabled: t.disabled
|
|
210
241
|
}), n && "justify-center px-2"),
|
|
211
242
|
disabled: t.disabled,
|
|
212
243
|
onClick: () => {
|
|
213
|
-
t.disabled ||
|
|
244
|
+
t.disabled || S(t, r);
|
|
214
245
|
},
|
|
215
246
|
children: [
|
|
216
|
-
t.icon ? /* @__PURE__ */
|
|
247
|
+
t.icon ? /* @__PURE__ */ f("span", {
|
|
217
248
|
className: "shrink-0",
|
|
218
249
|
children: t.icon
|
|
219
250
|
}) : null,
|
|
220
|
-
n ? null : /* @__PURE__ */
|
|
251
|
+
n ? null : /* @__PURE__ */ f("span", {
|
|
221
252
|
className: "min-w-0 flex-1 truncate",
|
|
222
253
|
children: t.label
|
|
223
254
|
}),
|
|
224
|
-
!n && t.badge ? /* @__PURE__ */
|
|
255
|
+
!n && t.badge ? /* @__PURE__ */ f("span", {
|
|
225
256
|
className: "shrink-0",
|
|
226
257
|
children: t.badge
|
|
227
258
|
}) : null
|
|
228
259
|
]
|
|
229
260
|
});
|
|
230
|
-
return n ? /* @__PURE__ */
|
|
261
|
+
return n ? /* @__PURE__ */ f(i, {
|
|
231
262
|
content: t.tooltip ?? t.label,
|
|
232
263
|
side: "right",
|
|
233
|
-
children: /* @__PURE__ */
|
|
264
|
+
children: /* @__PURE__ */ f("span", {
|
|
234
265
|
className: "block",
|
|
235
266
|
children: a
|
|
236
267
|
})
|
|
237
268
|
}) : a;
|
|
238
269
|
}
|
|
239
|
-
function
|
|
240
|
-
let a = /* @__PURE__ */
|
|
270
|
+
function D({ account: t, collapsed: n, onAfterSelect: r }) {
|
|
271
|
+
let a = /* @__PURE__ */ p("button", {
|
|
241
272
|
type: "button",
|
|
242
273
|
"data-slot": "sidebar-account",
|
|
243
|
-
className: e("flex w-full items-center gap-3 rounded-[min(var(--radius-xl),16px)] border border-transparent text-left transition-[background-color,border-color,color,box-shadow]",
|
|
274
|
+
className: e("flex w-full items-center gap-3 rounded-[min(var(--radius-xl),16px)] border border-transparent text-left transition-[background-color,border-color,color,box-shadow]", v({}), n ? "justify-center px-2 py-2.5" : "px-3 py-2.5"),
|
|
244
275
|
onClick: () => {
|
|
245
|
-
if (t.onSelect?.(),
|
|
276
|
+
if (t.onSelect?.(), r?.(), t.href) {
|
|
246
277
|
if (t.href.startsWith("http")) {
|
|
247
278
|
window.open(t.href, "_blank", "noopener,noreferrer");
|
|
248
279
|
return;
|
|
@@ -250,183 +281,238 @@ function w({ account: t, collapsed: n, onAfterSelect: i }) {
|
|
|
250
281
|
window.location.assign(t.href);
|
|
251
282
|
}
|
|
252
283
|
},
|
|
253
|
-
children: [t.avatar ? /* @__PURE__ */
|
|
284
|
+
children: [t.avatar ? /* @__PURE__ */ f("span", {
|
|
254
285
|
"data-slot": "sidebar-account-avatar",
|
|
255
286
|
className: "inline-flex size-9 shrink-0 items-center justify-center overflow-hidden rounded-full border border-border/65 bg-muted/45 text-sm font-semibold",
|
|
256
287
|
children: t.avatar
|
|
257
|
-
}) : null, n ? null : /* @__PURE__ */
|
|
288
|
+
}) : null, n ? null : /* @__PURE__ */ p("span", {
|
|
258
289
|
className: "min-w-0 flex-1",
|
|
259
|
-
children: [/* @__PURE__ */
|
|
290
|
+
children: [/* @__PURE__ */ f("span", {
|
|
260
291
|
"data-slot": "sidebar-account-label",
|
|
261
292
|
className: "block truncate text-sm font-semibold text-[color:var(--sidebar-foreground)]",
|
|
262
293
|
children: t.label
|
|
263
|
-
}), t.description ? /* @__PURE__ */
|
|
294
|
+
}), t.description ? /* @__PURE__ */ f("span", {
|
|
264
295
|
"data-slot": "sidebar-account-description",
|
|
265
296
|
className: "block truncate text-xs text-[color:color-mix(in_oklch,var(--sidebar-foreground),transparent_36%)]",
|
|
266
297
|
children: t.description
|
|
267
298
|
}) : null]
|
|
268
299
|
})]
|
|
269
300
|
});
|
|
270
|
-
return n ? /* @__PURE__ */
|
|
301
|
+
return n ? /* @__PURE__ */ f(i, {
|
|
271
302
|
content: t.tooltip ?? t.label,
|
|
272
303
|
side: "right",
|
|
273
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ f("span", {
|
|
274
305
|
className: "block",
|
|
275
306
|
children: a
|
|
276
307
|
})
|
|
277
308
|
}) : a;
|
|
278
309
|
}
|
|
279
|
-
function
|
|
280
|
-
let H =
|
|
281
|
-
|
|
310
|
+
function O({ className: n, style: r, header: a, footer: s, items: c = [], collapsed: m = !1, width: _ = h, collapsedWidth: v = g, collapsedRail: y, railItems: b = [], footerAccount: x, secondaryActions: S = [], footerSecondary: C, footerClassName: O, tooltipOnCollapsed: ee, showSectionLabels: te = !0, itemSize: ne = "md", activeIndicator: re = "bar", navigationLabel: ie = "Primary navigation", search: k, hideScrollbar: ae = !0, variant: A = "sidebar", side: j = "left", collapsible: M = "icon", onItemSelect: N, renderItem: P, renderLink: oe, children: F, mobile: I, mobileTitle: L, mobileDescription: R, mobileCloseLabel: se = "Close navigation", onRequestClose: z, closeOnSelect: B = !0, ...ce }) {
|
|
311
|
+
let V = k && !o.isValidElement(k) && typeof k == "object" ? k : void 0, [le, ue] = o.useState(V?.defaultValue ?? ""), H = V?.value ?? le, U = T(c.filter((e) => !e.hidden), H), W = b.filter((e) => !e.hidden), G = S.filter((e) => !e.hidden), K = o.useCallback((e) => {
|
|
312
|
+
N?.(e), I && B && z?.();
|
|
282
313
|
}, [
|
|
283
314
|
B,
|
|
284
|
-
|
|
285
|
-
|
|
315
|
+
I,
|
|
316
|
+
N,
|
|
286
317
|
z
|
|
287
|
-
]),
|
|
288
|
-
return /* @__PURE__ */
|
|
318
|
+
]), q = I && (L || R || z);
|
|
319
|
+
return /* @__PURE__ */ p("aside", {
|
|
289
320
|
"data-slot": "sidebar",
|
|
290
|
-
"data-collapsed":
|
|
291
|
-
"data-mobile":
|
|
292
|
-
|
|
321
|
+
"data-collapsed": m || void 0,
|
|
322
|
+
"data-mobile": I || void 0,
|
|
323
|
+
"data-variant": A,
|
|
324
|
+
"data-side": j,
|
|
325
|
+
"data-collapsible": M,
|
|
326
|
+
className: e("peer group/sidebar flex h-full min-h-0 flex-col overflow-hidden bg-sidebar text-sidebar-foreground transition-[width,min-width,transform,border-radius,box-shadow] duration-200", j === "right" && "border-l border-r-0", !I && A === "floating" && "m-2 h-[calc(100%-1rem)] rounded-xl border shadow-lg", !I && A === "inset" && "m-2 h-[calc(100%-1rem)] rounded-lg border bg-sidebar/92 shadow-sm", I && "m-0 h-full rounded-none border-y-0", M === "offcanvas" && m && (j === "left" ? "-translate-x-full" : "translate-x-full"), n),
|
|
293
327
|
style: {
|
|
294
|
-
width:
|
|
295
|
-
minWidth:
|
|
296
|
-
...
|
|
328
|
+
width: m ? M === "icon" ? v : M === "offcanvas" ? 0 : _ : _,
|
|
329
|
+
minWidth: m ? M === "icon" ? v : M === "offcanvas" ? 0 : _ : _,
|
|
330
|
+
...r
|
|
297
331
|
},
|
|
298
|
-
...
|
|
332
|
+
...ce,
|
|
299
333
|
children: [
|
|
300
|
-
(
|
|
334
|
+
(a || q) && /* @__PURE__ */ f("div", {
|
|
301
335
|
"data-slot": "sidebar-header",
|
|
302
336
|
className: "shrink-0 border-b p-3",
|
|
303
|
-
children: /* @__PURE__ */
|
|
337
|
+
children: /* @__PURE__ */ p("div", {
|
|
304
338
|
className: "flex items-start gap-3",
|
|
305
|
-
children: [/* @__PURE__ */
|
|
339
|
+
children: [/* @__PURE__ */ p("div", {
|
|
306
340
|
className: "min-w-0 flex-1",
|
|
307
|
-
children: [
|
|
308
|
-
className: e(
|
|
309
|
-
children: [
|
|
341
|
+
children: [a ?? null, q ? /* @__PURE__ */ p("div", {
|
|
342
|
+
className: e(a && "mt-3"),
|
|
343
|
+
children: [L ? /* @__PURE__ */ f("p", {
|
|
310
344
|
className: "text-sm font-semibold text-foreground",
|
|
311
|
-
children: I
|
|
312
|
-
}) : null, L ? /* @__PURE__ */ u("p", {
|
|
313
|
-
className: "mt-1 text-xs leading-5 text-muted-foreground",
|
|
314
345
|
children: L
|
|
346
|
+
}) : null, R ? /* @__PURE__ */ f("p", {
|
|
347
|
+
className: "mt-1 text-xs leading-5 text-muted-foreground",
|
|
348
|
+
children: R
|
|
315
349
|
}) : null]
|
|
316
350
|
}) : null]
|
|
317
|
-
}),
|
|
351
|
+
}), I && z ? /* @__PURE__ */ f("button", {
|
|
318
352
|
type: "button",
|
|
319
|
-
"aria-label":
|
|
353
|
+
"aria-label": se,
|
|
320
354
|
"data-slot": "sidebar-mobile-close",
|
|
321
355
|
className: "inline-flex size-9 shrink-0 items-center justify-center rounded-xl border border-[color:var(--aui-divider,var(--border))] bg-[color:var(--aui-page-bg-alt,var(--muted))] text-[color:var(--aui-page-foreground,var(--foreground))] transition hover:bg-[color:var(--aui-control-bg,var(--muted))]",
|
|
322
356
|
onClick: z,
|
|
323
|
-
children: /* @__PURE__ */ u
|
|
357
|
+
children: /* @__PURE__ */ f(u, { className: "size-4" })
|
|
324
358
|
}) : null]
|
|
325
359
|
})
|
|
326
360
|
}),
|
|
327
|
-
/* @__PURE__ */
|
|
361
|
+
k && !m ? /* @__PURE__ */ f("div", {
|
|
362
|
+
"data-slot": "sidebar-search",
|
|
363
|
+
className: "shrink-0 px-2 pt-2",
|
|
364
|
+
children: o.isValidElement(k) ? k : /* @__PURE__ */ f(t, {
|
|
365
|
+
kind: "search",
|
|
366
|
+
value: H,
|
|
367
|
+
onValueChange: (e) => {
|
|
368
|
+
V?.value === void 0 && ue(e), V?.onValueChange?.(e);
|
|
369
|
+
},
|
|
370
|
+
placeholder: V?.placeholder ?? "Search navigation...",
|
|
371
|
+
searchIcon: /* @__PURE__ */ f(l, {}),
|
|
372
|
+
"aria-label": V?.label ?? "Search navigation",
|
|
373
|
+
className: "h-9 bg-sidebar-accent/45"
|
|
374
|
+
})
|
|
375
|
+
}) : null,
|
|
376
|
+
/* @__PURE__ */ p("nav", {
|
|
328
377
|
"data-slot": "sidebar-nav",
|
|
329
|
-
"aria-label":
|
|
330
|
-
className: "flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overscroll-contain p-2",
|
|
331
|
-
children: [
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
378
|
+
"aria-label": ie,
|
|
379
|
+
className: e("flex min-h-0 flex-1 flex-col gap-1 overflow-y-auto overscroll-contain p-2 [scrollbar-gutter:stable]", ae && "[scrollbar-width:none] [&::-webkit-scrollbar]:hidden"),
|
|
380
|
+
children: [
|
|
381
|
+
F ?? U.map((e) => {
|
|
382
|
+
if (!P) return null;
|
|
383
|
+
let t = P(e, { collapsed: m });
|
|
384
|
+
return !m || !ee ? /* @__PURE__ */ f(o.Fragment, { children: t }, e.key) : /* @__PURE__ */ f(i, {
|
|
385
|
+
content: e.tooltip ?? e.label,
|
|
386
|
+
side: "right",
|
|
387
|
+
children: /* @__PURE__ */ f("span", {
|
|
388
|
+
className: "block",
|
|
389
|
+
children: t
|
|
390
|
+
})
|
|
391
|
+
}, e.key);
|
|
392
|
+
}),
|
|
393
|
+
!F && !P && /* @__PURE__ */ f(w, {
|
|
394
|
+
items: U,
|
|
395
|
+
collapsed: m,
|
|
396
|
+
depth: 0,
|
|
397
|
+
showSectionLabels: te,
|
|
398
|
+
itemSize: ne,
|
|
399
|
+
activeIndicator: re,
|
|
400
|
+
onItemSelect: K,
|
|
401
|
+
renderLink: oe
|
|
402
|
+
}),
|
|
403
|
+
!F && U.length === 0 ? /* @__PURE__ */ f("div", {
|
|
404
|
+
"data-slot": "sidebar-search-empty",
|
|
405
|
+
className: "grid min-h-24 place-items-center px-4 text-center text-xs text-muted-foreground",
|
|
406
|
+
children: V?.empty ?? "No navigation items found."
|
|
407
|
+
}) : null
|
|
408
|
+
]
|
|
352
409
|
}),
|
|
353
|
-
(
|
|
410
|
+
(x || C || s || G.length > 0 || m && (y || W.length > 0)) && /* @__PURE__ */ p("div", {
|
|
354
411
|
"data-slot": "sidebar-footer",
|
|
355
|
-
className: e("shrink-0 border-t p-3",
|
|
412
|
+
className: e("shrink-0 border-t p-3", O),
|
|
356
413
|
children: [
|
|
357
|
-
|
|
414
|
+
m ? /* @__PURE__ */ p(d, { children: [W.length > 0 ? /* @__PURE__ */ f("div", {
|
|
358
415
|
"data-slot": "sidebar-rail-actions",
|
|
359
416
|
className: "grid gap-2",
|
|
360
|
-
children:
|
|
417
|
+
children: W.map((e) => /* @__PURE__ */ f(E, {
|
|
361
418
|
item: e,
|
|
362
419
|
collapsed: !0,
|
|
363
|
-
onItemSelect:
|
|
420
|
+
onItemSelect: K
|
|
364
421
|
}, e.key))
|
|
365
|
-
}) : null,
|
|
422
|
+
}) : null, y ? /* @__PURE__ */ f("div", {
|
|
366
423
|
"data-slot": "sidebar-rail",
|
|
367
|
-
children:
|
|
424
|
+
children: y
|
|
368
425
|
}) : null] }) : null,
|
|
369
|
-
!
|
|
426
|
+
!m && x ? /* @__PURE__ */ f("div", {
|
|
370
427
|
"data-slot": "sidebar-account-wrap",
|
|
371
428
|
className: "mb-3",
|
|
372
|
-
children: /* @__PURE__ */
|
|
373
|
-
account:
|
|
429
|
+
children: /* @__PURE__ */ f(D, {
|
|
430
|
+
account: x,
|
|
374
431
|
collapsed: !1,
|
|
375
432
|
onAfterSelect: () => {
|
|
376
|
-
|
|
433
|
+
I && B && z?.();
|
|
377
434
|
}
|
|
378
435
|
})
|
|
379
436
|
}) : null,
|
|
380
|
-
!
|
|
437
|
+
!m && G.length > 0 ? /* @__PURE__ */ f("div", {
|
|
381
438
|
"data-slot": "sidebar-secondary-actions",
|
|
382
439
|
className: "mb-3 grid gap-2",
|
|
383
|
-
children:
|
|
440
|
+
children: G.map((e) => /* @__PURE__ */ f(E, {
|
|
384
441
|
item: e,
|
|
385
442
|
collapsed: !1,
|
|
386
|
-
onItemSelect:
|
|
443
|
+
onItemSelect: K
|
|
387
444
|
}, e.key))
|
|
388
445
|
}) : null,
|
|
389
|
-
!
|
|
446
|
+
!m && C ? /* @__PURE__ */ f("div", {
|
|
390
447
|
"data-slot": "sidebar-footer-secondary",
|
|
391
448
|
className: "mb-3",
|
|
392
|
-
children:
|
|
449
|
+
children: C
|
|
393
450
|
}) : null,
|
|
394
|
-
|
|
451
|
+
m && x ? /* @__PURE__ */ f("div", {
|
|
395
452
|
"data-slot": "sidebar-account-wrap",
|
|
396
|
-
children: /* @__PURE__ */
|
|
397
|
-
account:
|
|
453
|
+
children: /* @__PURE__ */ f(D, {
|
|
454
|
+
account: x,
|
|
398
455
|
collapsed: !0,
|
|
399
456
|
onAfterSelect: () => {
|
|
400
|
-
|
|
457
|
+
I && B && z?.();
|
|
401
458
|
}
|
|
402
459
|
})
|
|
403
460
|
}) : null,
|
|
404
|
-
!
|
|
461
|
+
!m && s
|
|
405
462
|
]
|
|
406
463
|
})
|
|
407
464
|
]
|
|
408
465
|
});
|
|
409
466
|
}
|
|
410
|
-
function
|
|
411
|
-
let
|
|
412
|
-
|
|
467
|
+
function ee({ className: t, header: r, footer: i, items: s = [], collapsed: l, defaultCollapsed: u = !1, onCollapsedChange: v, variant: y = "sidebar", side: b = "left", collapsible: x = "icon", width: S = h, collapsedWidth: C = g, mobileWidth: w = _, collapsedRail: T, railItems: E = [], footerAccount: D, secondaryActions: ee = [], footerSecondary: te, tooltipOnCollapsed: ne = !0, showSectionLabels: re = !0, itemSize: ie = "md", activeIndicator: k = "bar", navigationLabel: ae = "Primary navigation", search: A, hideScrollbar: j = !0, keyboardShortcut: M = "b", persistKey: N, responsive: P = !0, mobileBreakpoint: oe = m, mobileOpen: F, defaultMobileOpen: I = !1, onMobileOpenChange: L, mobileTitle: R, mobileDescription: se, mobileToggleLabel: z = "Open navigation", mobileCloseLabel: B = "Close navigation", mobileToggleIcon: ce, showMobileToggle: V = !0, closeOnSelect: le = !0, mobileToggleClassName: ue, mobilePanelClassName: H, mobileOverlayClassName: U, renderMobileToggle: W, onItemSelect: G, renderItem: K, renderLink: q, children: de, ...fe }) {
|
|
468
|
+
let J = a(!0), [pe, me] = o.useState(u), Y = x === "none" ? !1 : l ?? J?.collapsed ?? pe, he = n(oe), X = P && he, [ge, _e] = o.useState(I), Z = F ?? J?.mobileOpen ?? ge, Q = o.useCallback((e) => {
|
|
469
|
+
x !== "none" && (l === void 0 && J ? J.setCollapsed(e) : l === void 0 && me(e), v?.(e), N && window.localStorage.setItem(N, String(e)));
|
|
470
|
+
}, [
|
|
471
|
+
l,
|
|
472
|
+
x,
|
|
473
|
+
v,
|
|
474
|
+
N,
|
|
475
|
+
J
|
|
476
|
+
]);
|
|
477
|
+
o.useEffect(() => {
|
|
478
|
+
if (!N || l !== void 0) return;
|
|
479
|
+
let e = window.localStorage.getItem(N);
|
|
480
|
+
(e === "true" || e === "false") && Q(e === "true");
|
|
413
481
|
}, [
|
|
482
|
+
l,
|
|
414
483
|
N,
|
|
484
|
+
Q
|
|
485
|
+
]), o.useEffect(() => {
|
|
486
|
+
if (!M || x === "none") return;
|
|
487
|
+
let e = (e) => {
|
|
488
|
+
(e.metaKey || e.ctrlKey) && e.key.toLocaleLowerCase() === M.toLocaleLowerCase() && (e.preventDefault(), Q(!Y));
|
|
489
|
+
};
|
|
490
|
+
return window.addEventListener("keydown", e), () => window.removeEventListener("keydown", e);
|
|
491
|
+
}, [
|
|
492
|
+
Y,
|
|
493
|
+
x,
|
|
494
|
+
M,
|
|
495
|
+
Q
|
|
496
|
+
]);
|
|
497
|
+
let $ = o.useCallback((e) => {
|
|
498
|
+
F == null && J ? J.setMobileOpen(e) : F ?? _e(e), L?.(e);
|
|
499
|
+
}, [
|
|
415
500
|
F,
|
|
416
|
-
|
|
501
|
+
L,
|
|
502
|
+
J
|
|
417
503
|
]);
|
|
418
|
-
|
|
419
|
-
!X && Z &&
|
|
504
|
+
o.useEffect(() => {
|
|
505
|
+
!X && Z && $(!1);
|
|
420
506
|
}, [
|
|
421
507
|
X,
|
|
422
508
|
Z,
|
|
423
|
-
|
|
424
|
-
]),
|
|
509
|
+
$
|
|
510
|
+
]), o.useEffect(() => {
|
|
425
511
|
if (!X || !Z) return;
|
|
426
512
|
let e = document.body.style.overflow;
|
|
427
513
|
document.body.style.overflow = "hidden";
|
|
428
514
|
let t = (e) => {
|
|
429
|
-
e.key === "Escape" &&
|
|
515
|
+
e.key === "Escape" && $(!1);
|
|
430
516
|
};
|
|
431
517
|
return window.addEventListener("keydown", t), () => {
|
|
432
518
|
document.body.style.overflow = e, window.removeEventListener("keydown", t);
|
|
@@ -434,83 +520,95 @@ function E({ className: n, header: r, footer: o, items: c = [], collapsed: g, wi
|
|
|
434
520
|
}, [
|
|
435
521
|
X,
|
|
436
522
|
Z,
|
|
437
|
-
|
|
523
|
+
$
|
|
438
524
|
]);
|
|
439
|
-
let
|
|
440
|
-
className:
|
|
525
|
+
let ve = {
|
|
526
|
+
className: t,
|
|
441
527
|
header: r,
|
|
442
|
-
footer:
|
|
443
|
-
items:
|
|
444
|
-
collapsed:
|
|
445
|
-
width:
|
|
446
|
-
collapsedWidth:
|
|
447
|
-
collapsedRail:
|
|
448
|
-
railItems:
|
|
449
|
-
footerAccount:
|
|
450
|
-
secondaryActions:
|
|
451
|
-
footerSecondary:
|
|
452
|
-
tooltipOnCollapsed:
|
|
453
|
-
showSectionLabels:
|
|
454
|
-
itemSize:
|
|
528
|
+
footer: i,
|
|
529
|
+
items: s,
|
|
530
|
+
collapsed: Y,
|
|
531
|
+
width: S,
|
|
532
|
+
collapsedWidth: C,
|
|
533
|
+
collapsedRail: T,
|
|
534
|
+
railItems: E,
|
|
535
|
+
footerAccount: D,
|
|
536
|
+
secondaryActions: ee,
|
|
537
|
+
footerSecondary: te,
|
|
538
|
+
tooltipOnCollapsed: ne,
|
|
539
|
+
showSectionLabels: re,
|
|
540
|
+
itemSize: ie,
|
|
455
541
|
activeIndicator: k,
|
|
456
|
-
navigationLabel:
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
542
|
+
navigationLabel: ae,
|
|
543
|
+
search: A,
|
|
544
|
+
hideScrollbar: j,
|
|
545
|
+
variant: y,
|
|
546
|
+
side: b,
|
|
547
|
+
collapsible: x,
|
|
548
|
+
mobileCloseLabel: B,
|
|
549
|
+
closeOnSelect: le,
|
|
550
|
+
onItemSelect: G,
|
|
551
|
+
renderItem: K,
|
|
552
|
+
renderLink: q,
|
|
553
|
+
children: de,
|
|
554
|
+
...fe
|
|
464
555
|
};
|
|
465
|
-
if (!
|
|
466
|
-
let
|
|
556
|
+
if (!P || !X) return /* @__PURE__ */ f(O, { ...ve });
|
|
557
|
+
let ye = /* @__PURE__ */ p("button", {
|
|
467
558
|
type: "button",
|
|
468
|
-
"aria-label": Z ?
|
|
559
|
+
"aria-label": Z ? B : z,
|
|
469
560
|
"data-slot": "sidebar-mobile-trigger",
|
|
470
561
|
"data-state": Z ? "open" : "closed",
|
|
471
|
-
className: e("inline-flex min-h-10 items-center gap-2 rounded-xl border border-[color:var(--aui-divider,var(--border))] bg-[color:var(--aui-page-bg,var(--background))] px-3 text-sm font-medium text-[color:var(--aui-page-foreground,var(--foreground))] shadow-sm transition hover:bg-[color:var(--aui-page-bg-alt,var(--muted))]",
|
|
472
|
-
onClick: () =>
|
|
473
|
-
children: [/* @__PURE__ */
|
|
562
|
+
className: e("inline-flex min-h-10 items-center gap-2 rounded-xl border border-[color:var(--aui-divider,var(--border))] bg-[color:var(--aui-page-bg,var(--background))] px-3 text-sm font-medium text-[color:var(--aui-page-foreground,var(--foreground))] shadow-sm transition hover:bg-[color:var(--aui-page-bg-alt,var(--muted))]", ue),
|
|
563
|
+
onClick: () => $(!Z),
|
|
564
|
+
children: [/* @__PURE__ */ f("span", {
|
|
474
565
|
className: "inline-flex size-8 items-center justify-center rounded-lg bg-[color:var(--aui-page-bg-alt,var(--muted))]",
|
|
475
|
-
children:
|
|
476
|
-
}), /* @__PURE__ */
|
|
566
|
+
children: ce ?? /* @__PURE__ */ f(c, { className: "size-4" })
|
|
567
|
+
}), /* @__PURE__ */ f("span", { children: Z ? B : z })]
|
|
477
568
|
});
|
|
478
|
-
return /* @__PURE__ */ d
|
|
569
|
+
return /* @__PURE__ */ p(d, { children: [V ? W ? W({
|
|
479
570
|
open: Z,
|
|
480
|
-
setOpen:
|
|
481
|
-
}) :
|
|
571
|
+
setOpen: $
|
|
572
|
+
}) : ye : null, /* @__PURE__ */ p("div", {
|
|
482
573
|
"data-slot": "sidebar-mobile-root",
|
|
483
574
|
className: "relative z-40",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
575
|
+
children: [/* @__PURE__ */ f("button", {
|
|
485
576
|
type: "button",
|
|
486
577
|
"aria-label": "Dismiss navigation",
|
|
487
578
|
"data-slot": "sidebar-mobile-overlay",
|
|
488
579
|
"data-state": Z ? "open" : "closed",
|
|
489
|
-
className: e("fixed inset-0 z-40 bg-black/45 transition-opacity duration-200", Z ? "opacity-100" : "pointer-events-none opacity-0",
|
|
580
|
+
className: e("fixed inset-0 z-40 bg-black/45 transition-opacity duration-200", Z ? "opacity-100" : "pointer-events-none opacity-0", U),
|
|
490
581
|
style: {
|
|
491
582
|
opacity: +!!Z,
|
|
492
583
|
pointerEvents: Z ? "auto" : "none"
|
|
493
584
|
},
|
|
494
|
-
onClick: () =>
|
|
495
|
-
}), /* @__PURE__ */
|
|
496
|
-
|
|
585
|
+
onClick: () => $(!1)
|
|
586
|
+
}), /* @__PURE__ */ f(O, {
|
|
587
|
+
...ve,
|
|
497
588
|
mobile: !0,
|
|
498
589
|
collapsed: !1,
|
|
499
|
-
mobileTitle:
|
|
500
|
-
mobileDescription:
|
|
501
|
-
onRequestClose: () =>
|
|
590
|
+
mobileTitle: R,
|
|
591
|
+
mobileDescription: se,
|
|
592
|
+
onRequestClose: () => $(!1),
|
|
502
593
|
"data-state": Z ? "open" : "closed",
|
|
503
594
|
role: "dialog",
|
|
504
595
|
"aria-modal": "true",
|
|
505
|
-
"aria-label": typeof
|
|
506
|
-
className: e("fixed inset-y-0
|
|
596
|
+
"aria-label": typeof R == "string" ? R : "Navigation",
|
|
597
|
+
className: e("fixed inset-y-0 z-50 max-w-[22rem] border-[color:var(--aui-divider,var(--border))] bg-[color:var(--aui-page-bg,var(--background))] shadow-2xl transition-transform duration-200 ease-out", b === "left" ? "left-0 border-r" : "right-0 border-l", Z ? "translate-x-0" : b === "left" ? "-translate-x-full" : "translate-x-full", H, t),
|
|
507
598
|
style: {
|
|
508
|
-
width:
|
|
509
|
-
minWidth:
|
|
510
|
-
translate: Z ? "0 0" : "-100% 0"
|
|
599
|
+
width: w,
|
|
600
|
+
minWidth: w,
|
|
601
|
+
translate: Z ? "0 0" : b === "left" ? "-100% 0" : "100% 0"
|
|
511
602
|
}
|
|
512
603
|
})]
|
|
513
604
|
})] });
|
|
514
605
|
}
|
|
606
|
+
function te({ className: t, ...n }) {
|
|
607
|
+
return /* @__PURE__ */ f("main", {
|
|
608
|
+
"data-slot": "sidebar-inset",
|
|
609
|
+
className: e("relative flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden bg-background 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]:border md:peer-data-[variant=inset]:shadow-sm", t),
|
|
610
|
+
...n
|
|
611
|
+
});
|
|
612
|
+
}
|
|
515
613
|
//#endregion
|
|
516
|
-
export {
|
|
614
|
+
export { ee as Sidebar, te as SidebarInset };
|