@mesob/ui 0.1.1 → 0.2.1
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/dist/components/alert-dialog.js +22 -22
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.js +1 -1
- package/dist/components/alert.js.map +1 -1
- package/dist/components/animated-tabs.js +1 -1
- package/dist/components/animated-tabs.js.map +1 -1
- package/dist/components/app-breadcrumbs.d.ts +34 -0
- package/dist/components/app-breadcrumbs.js +177 -0
- package/dist/components/app-breadcrumbs.js.map +1 -0
- package/dist/components/app-header-actions.d.ts +39 -0
- package/dist/components/app-header-actions.js +644 -0
- package/dist/components/app-header-actions.js.map +1 -0
- package/dist/components/app-sidebar.d.ts +24 -0
- package/dist/components/app-sidebar.js +669 -0
- package/dist/components/app-sidebar.js.map +1 -0
- package/dist/components/button-group.js +1 -1
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.d.ts +6 -3
- package/dist/components/button.js +16 -8
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.js +24 -16
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.js +1 -1
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.js +28 -20
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/command.js +5 -5
- package/dist/components/command.js.map +1 -1
- package/dist/components/context-menu.js +2 -2
- package/dist/components/context-menu.js.map +1 -1
- package/dist/components/data-table/index.d.ts +9 -2
- package/dist/components/data-table/index.js +336 -152
- package/dist/components/data-table/index.js.map +1 -1
- package/dist/components/dialog.js +2 -2
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drawer.js +2 -2
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.js +2 -2
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/entity/index.d.ts +85 -9
- package/dist/components/entity/index.js +539 -414
- package/dist/components/entity/index.js.map +1 -1
- package/dist/components/hover-card.js +1 -1
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.d.ts +1 -1
- package/dist/components/input-group.js +27 -19
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/item.d.ts +1 -1
- package/dist/components/link.d.ts +12 -0
- package/dist/components/link.js +51 -0
- package/dist/components/link.js.map +1 -0
- package/dist/components/menubar.js +3 -3
- package/dist/components/menubar.js.map +1 -1
- package/dist/components/mesob-context.d.ts +34 -0
- package/dist/components/mesob-context.js +53 -0
- package/dist/components/mesob-context.js.map +1 -0
- package/dist/components/navigation-menu.js +1 -1
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/page/index.d.ts +46 -0
- package/dist/components/page/index.js +205 -0
- package/dist/components/page/index.js.map +1 -0
- package/dist/components/pagination.js +20 -20
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/popover.js +1 -1
- package/dist/components/popover.js.map +1 -1
- package/dist/components/powered-by.d.ts +4 -1
- package/dist/components/powered-by.js +28 -12
- package/dist/components/powered-by.js.map +1 -1
- package/dist/components/section/index.js +29 -21
- package/dist/components/section/index.js.map +1 -1
- package/dist/components/select.js +1 -1
- package/dist/components/select.js.map +1 -1
- package/dist/components/sheet.js +2 -2
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/shell.d.ts +13 -0
- package/dist/components/shell.js +553 -0
- package/dist/components/shell.js.map +1 -0
- package/dist/components/sidebar.d.ts +4 -0
- package/dist/components/sidebar.js +119 -82
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/spotlight-search.js +67 -59
- package/dist/components/spotlight-search.js.map +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/table.js.map +1 -1
- package/dist/components/theme-toggle.js +21 -13
- package/dist/components/theme-toggle.js.map +1 -1
- package/dist/components/tooltip.d.ts +1 -1
- package/dist/components/tooltip.js +2 -1
- package/dist/components/tooltip.js.map +1 -1
- package/dist/hooks/use-router.d.ts +7 -0
- package/dist/hooks/use-router.js +36 -0
- package/dist/hooks/use-router.js.map +1 -0
- package/dist/hooks/use-translation.d.ts +5 -0
- package/dist/hooks/use-translation.js +42 -0
- package/dist/hooks/use-translation.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +94 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/theme-schema.d.ts +21 -0
- package/dist/lib/theme-schema.js +95 -0
- package/dist/lib/theme-schema.js.map +1 -0
- package/package.json +8 -5
- package/src/styles/globals.css +0 -126
|
@@ -10,18 +10,18 @@ function cn(...inputs) {
|
|
|
10
10
|
// src/components/button.tsx
|
|
11
11
|
import { Slot } from "@radix-ui/react-slot";
|
|
12
12
|
import { cva } from "class-variance-authority";
|
|
13
|
-
import {
|
|
13
|
+
import { jsxs } from "react/jsx-runtime";
|
|
14
14
|
var buttonVariants = cva(
|
|
15
15
|
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",
|
|
16
16
|
{
|
|
17
17
|
variants: {
|
|
18
18
|
variant: {
|
|
19
|
-
default: "bg-primary text-primary-foreground hover:bg-primary
|
|
20
|
-
destructive: "bg-destructive text-
|
|
21
|
-
outline: "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
22
|
-
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary
|
|
19
|
+
default: "bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400",
|
|
20
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
|
|
21
|
+
outline: "border border-input bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",
|
|
22
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400",
|
|
23
23
|
ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
|
|
24
|
-
link: "text-primary underline-offset-4 hover:underline"
|
|
24
|
+
link: "text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline"
|
|
25
25
|
},
|
|
26
26
|
size: {
|
|
27
27
|
default: "h-9 px-4 py-2 has-[>svg]:px-3",
|
|
@@ -43,23 +43,31 @@ function Button({
|
|
|
43
43
|
variant,
|
|
44
44
|
size,
|
|
45
45
|
asChild = false,
|
|
46
|
+
leftIcon,
|
|
47
|
+
rightIcon,
|
|
48
|
+
children,
|
|
46
49
|
...props
|
|
47
50
|
}) {
|
|
48
51
|
const Comp = asChild ? Slot : "button";
|
|
49
|
-
return /* @__PURE__ */
|
|
52
|
+
return /* @__PURE__ */ jsxs(
|
|
50
53
|
Comp,
|
|
51
54
|
{
|
|
52
55
|
"data-slot": "button",
|
|
53
56
|
className: cn(buttonVariants({ variant, size, className })),
|
|
54
|
-
...props
|
|
57
|
+
...props,
|
|
58
|
+
children: [
|
|
59
|
+
leftIcon,
|
|
60
|
+
children,
|
|
61
|
+
rightIcon
|
|
62
|
+
]
|
|
55
63
|
}
|
|
56
64
|
);
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
// src/components/input.tsx
|
|
60
|
-
import { jsx
|
|
68
|
+
import { jsx } from "react/jsx-runtime";
|
|
61
69
|
function Input({ className, type, ...props }) {
|
|
62
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ jsx(
|
|
63
71
|
"input",
|
|
64
72
|
{
|
|
65
73
|
type,
|
|
@@ -77,14 +85,14 @@ function Input({ className, type, ...props }) {
|
|
|
77
85
|
|
|
78
86
|
// src/components/separator.tsx
|
|
79
87
|
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
80
|
-
import { jsx as
|
|
88
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
81
89
|
function Separator({
|
|
82
90
|
className,
|
|
83
91
|
orientation = "horizontal",
|
|
84
92
|
decorative = true,
|
|
85
93
|
...props
|
|
86
94
|
}) {
|
|
87
|
-
return /* @__PURE__ */
|
|
95
|
+
return /* @__PURE__ */ jsx2(
|
|
88
96
|
SeparatorPrimitive.Root,
|
|
89
97
|
{
|
|
90
98
|
"data-slot": "separator",
|
|
@@ -102,25 +110,25 @@ function Separator({
|
|
|
102
110
|
// src/components/sheet.tsx
|
|
103
111
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
104
112
|
import { IconX } from "@tabler/icons-react";
|
|
105
|
-
import { jsx as
|
|
113
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
106
114
|
function Sheet({ ...props }) {
|
|
107
|
-
return /* @__PURE__ */
|
|
115
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Root, { "data-slot": "sheet", ...props });
|
|
108
116
|
}
|
|
109
117
|
function SheetPortal({
|
|
110
118
|
...props
|
|
111
119
|
}) {
|
|
112
|
-
return /* @__PURE__ */
|
|
120
|
+
return /* @__PURE__ */ jsx3(SheetPrimitive.Portal, { "data-slot": "sheet-portal", ...props });
|
|
113
121
|
}
|
|
114
122
|
function SheetOverlay({
|
|
115
123
|
className,
|
|
116
124
|
...props
|
|
117
125
|
}) {
|
|
118
|
-
return /* @__PURE__ */
|
|
126
|
+
return /* @__PURE__ */ jsx3(
|
|
119
127
|
SheetPrimitive.Overlay,
|
|
120
128
|
{
|
|
121
129
|
"data-slot": "sheet-overlay",
|
|
122
130
|
className: cn(
|
|
123
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-
|
|
131
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=open]:opacity-100 fixed inset-0 z-50 bg-[var(--overlay,oklch(0_0_0/0.5))]",
|
|
124
132
|
className
|
|
125
133
|
),
|
|
126
134
|
...props
|
|
@@ -133,14 +141,14 @@ function SheetContent({
|
|
|
133
141
|
side = "right",
|
|
134
142
|
...props
|
|
135
143
|
}) {
|
|
136
|
-
return /* @__PURE__ */
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
144
|
+
return /* @__PURE__ */ jsxs2(SheetPortal, { children: [
|
|
145
|
+
/* @__PURE__ */ jsx3(SheetOverlay, {}),
|
|
146
|
+
/* @__PURE__ */ jsxs2(
|
|
139
147
|
SheetPrimitive.Content,
|
|
140
148
|
{
|
|
141
149
|
"data-slot": "sheet-content",
|
|
142
150
|
className: cn(
|
|
143
|
-
"bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-
|
|
151
|
+
"bg-background text-foreground border-border data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:opacity-100 fixed z-[51] flex min-w-0 flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",
|
|
144
152
|
side === "right" && "data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
145
153
|
side === "left" && "data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
146
154
|
side === "top" && "data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
@@ -150,9 +158,9 @@ function SheetContent({
|
|
|
150
158
|
...props,
|
|
151
159
|
children: [
|
|
152
160
|
children,
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ jsxs2(SheetPrimitive.Close, { className: "ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none", children: [
|
|
162
|
+
/* @__PURE__ */ jsx3(IconX, { className: "size-4" }),
|
|
163
|
+
/* @__PURE__ */ jsx3("span", { className: "sr-only", children: "Close" })
|
|
156
164
|
] })
|
|
157
165
|
]
|
|
158
166
|
}
|
|
@@ -160,7 +168,7 @@ function SheetContent({
|
|
|
160
168
|
] });
|
|
161
169
|
}
|
|
162
170
|
function SheetHeader({ className, ...props }) {
|
|
163
|
-
return /* @__PURE__ */
|
|
171
|
+
return /* @__PURE__ */ jsx3(
|
|
164
172
|
"div",
|
|
165
173
|
{
|
|
166
174
|
"data-slot": "sheet-header",
|
|
@@ -173,7 +181,7 @@ function SheetTitle({
|
|
|
173
181
|
className,
|
|
174
182
|
...props
|
|
175
183
|
}) {
|
|
176
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ jsx3(
|
|
177
185
|
SheetPrimitive.Title,
|
|
178
186
|
{
|
|
179
187
|
"data-slot": "sheet-title",
|
|
@@ -186,7 +194,7 @@ function SheetDescription({
|
|
|
186
194
|
className,
|
|
187
195
|
...props
|
|
188
196
|
}) {
|
|
189
|
-
return /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ jsx3(
|
|
190
198
|
SheetPrimitive.Description,
|
|
191
199
|
{
|
|
192
200
|
"data-slot": "sheet-description",
|
|
@@ -197,9 +205,9 @@ function SheetDescription({
|
|
|
197
205
|
}
|
|
198
206
|
|
|
199
207
|
// src/components/skeleton.tsx
|
|
200
|
-
import { jsx as
|
|
208
|
+
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
201
209
|
function Skeleton({ className, ...props }) {
|
|
202
|
-
return /* @__PURE__ */
|
|
210
|
+
return /* @__PURE__ */ jsx4(
|
|
203
211
|
"div",
|
|
204
212
|
{
|
|
205
213
|
"data-slot": "skeleton",
|
|
@@ -211,12 +219,12 @@ function Skeleton({ className, ...props }) {
|
|
|
211
219
|
|
|
212
220
|
// src/components/tooltip.tsx
|
|
213
221
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
214
|
-
import { jsx as
|
|
222
|
+
import { jsx as jsx5, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
215
223
|
function TooltipProvider({
|
|
216
224
|
delayDuration = 0,
|
|
217
225
|
...props
|
|
218
226
|
}) {
|
|
219
|
-
return /* @__PURE__ */
|
|
227
|
+
return /* @__PURE__ */ jsx5(
|
|
220
228
|
TooltipPrimitive.Provider,
|
|
221
229
|
{
|
|
222
230
|
"data-slot": "tooltip-provider",
|
|
@@ -226,14 +234,15 @@ function TooltipProvider({
|
|
|
226
234
|
);
|
|
227
235
|
}
|
|
228
236
|
function Tooltip({
|
|
237
|
+
children,
|
|
229
238
|
...props
|
|
230
239
|
}) {
|
|
231
|
-
return /* @__PURE__ */
|
|
240
|
+
return /* @__PURE__ */ jsx5(TooltipPrimitive.Root, { "data-slot": "tooltip", ...props, children });
|
|
232
241
|
}
|
|
233
242
|
function TooltipTrigger({
|
|
234
243
|
...props
|
|
235
244
|
}) {
|
|
236
|
-
return /* @__PURE__ */
|
|
245
|
+
return /* @__PURE__ */ jsx5(TooltipPrimitive.Trigger, { "data-slot": "tooltip-trigger", ...props });
|
|
237
246
|
}
|
|
238
247
|
function TooltipContent({
|
|
239
248
|
className,
|
|
@@ -241,7 +250,7 @@ function TooltipContent({
|
|
|
241
250
|
children,
|
|
242
251
|
...props
|
|
243
252
|
}) {
|
|
244
|
-
return /* @__PURE__ */
|
|
253
|
+
return /* @__PURE__ */ jsx5(TooltipPrimitive.Portal, { children: /* @__PURE__ */ jsxs3(
|
|
245
254
|
TooltipPrimitive.Content,
|
|
246
255
|
{
|
|
247
256
|
"data-slot": "tooltip-content",
|
|
@@ -253,7 +262,7 @@ function TooltipContent({
|
|
|
253
262
|
...props,
|
|
254
263
|
children: [
|
|
255
264
|
children,
|
|
256
|
-
/* @__PURE__ */
|
|
265
|
+
/* @__PURE__ */ jsx5(TooltipPrimitive.Arrow, { className: "bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]" })
|
|
257
266
|
]
|
|
258
267
|
}
|
|
259
268
|
) });
|
|
@@ -283,13 +292,30 @@ import { Slot as Slot2 } from "@radix-ui/react-slot";
|
|
|
283
292
|
import { IconMenu2 } from "@tabler/icons-react";
|
|
284
293
|
import { cva as cva2 } from "class-variance-authority";
|
|
285
294
|
import * as React2 from "react";
|
|
286
|
-
import { jsx as
|
|
295
|
+
import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
287
296
|
var SIDEBAR_COOKIE_NAME = "sidebar_state";
|
|
297
|
+
var SIDEBAR_WIDTH_COOKIE = "sidebar_width";
|
|
288
298
|
var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
|
|
299
|
+
var SIDEBAR_WIDTH_DEFAULT = 256;
|
|
300
|
+
var SIDEBAR_WIDTH_MIN = 200;
|
|
301
|
+
var SIDEBAR_WIDTH_MAX = 480;
|
|
289
302
|
var SIDEBAR_WIDTH = "16rem";
|
|
290
303
|
var SIDEBAR_WIDTH_MOBILE = "18rem";
|
|
291
304
|
var SIDEBAR_WIDTH_ICON = "3rem";
|
|
292
305
|
var SIDEBAR_KEYBOARD_SHORTCUT = "b";
|
|
306
|
+
function getWidthFromCookie() {
|
|
307
|
+
if (typeof document === "undefined") {
|
|
308
|
+
return SIDEBAR_WIDTH_DEFAULT;
|
|
309
|
+
}
|
|
310
|
+
const m = document.cookie.match(
|
|
311
|
+
new RegExp(`(?:^|; )${SIDEBAR_WIDTH_COOKIE}=([^;]*)`)
|
|
312
|
+
);
|
|
313
|
+
const n = m ? Number(m[1]) : Number.NaN;
|
|
314
|
+
return Number.isFinite(n) && n >= SIDEBAR_WIDTH_MIN && n <= SIDEBAR_WIDTH_MAX ? n : SIDEBAR_WIDTH_DEFAULT;
|
|
315
|
+
}
|
|
316
|
+
function setWidthCookie(width) {
|
|
317
|
+
document.cookie = `${SIDEBAR_WIDTH_COOKIE}=${width}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
|
|
318
|
+
}
|
|
293
319
|
var SidebarContext = React2.createContext(null);
|
|
294
320
|
function useSidebar() {
|
|
295
321
|
const context = React2.useContext(SidebarContext);
|
|
@@ -309,6 +335,12 @@ function SidebarProvider({
|
|
|
309
335
|
}) {
|
|
310
336
|
const isMobile = useIsMobile();
|
|
311
337
|
const [openMobile, setOpenMobile] = React2.useState(false);
|
|
338
|
+
const [width, setWidthState] = React2.useState(getWidthFromCookie);
|
|
339
|
+
const setWidth = React2.useCallback((w) => {
|
|
340
|
+
const clamped = Math.max(SIDEBAR_WIDTH_MIN, Math.min(SIDEBAR_WIDTH_MAX, w));
|
|
341
|
+
setWidthState(clamped);
|
|
342
|
+
setWidthCookie(clamped);
|
|
343
|
+
}, []);
|
|
312
344
|
const [_open, _setOpen] = React2.useState(defaultOpen);
|
|
313
345
|
const open = openProp ?? _open;
|
|
314
346
|
const setOpen = React2.useCallback(
|
|
@@ -344,14 +376,19 @@ function SidebarProvider({
|
|
|
344
376
|
isMobile,
|
|
345
377
|
openMobile,
|
|
346
378
|
setOpenMobile,
|
|
347
|
-
toggleSidebar
|
|
379
|
+
toggleSidebar,
|
|
380
|
+
width,
|
|
381
|
+
setWidth,
|
|
382
|
+
minWidth: SIDEBAR_WIDTH_MIN,
|
|
383
|
+
maxWidth: SIDEBAR_WIDTH_MAX
|
|
348
384
|
};
|
|
349
|
-
|
|
385
|
+
const sidebarWidthValue = open ? `${width}px` : SIDEBAR_WIDTH;
|
|
386
|
+
return /* @__PURE__ */ jsx6(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx6(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx6(
|
|
350
387
|
"div",
|
|
351
388
|
{
|
|
352
389
|
"data-slot": "sidebar-wrapper",
|
|
353
390
|
style: {
|
|
354
|
-
"--sidebar-width":
|
|
391
|
+
"--sidebar-width": sidebarWidthValue,
|
|
355
392
|
"--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
|
|
356
393
|
...style
|
|
357
394
|
},
|
|
@@ -374,7 +411,7 @@ function Sidebar({
|
|
|
374
411
|
}) {
|
|
375
412
|
const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
|
|
376
413
|
if (collapsible === "none") {
|
|
377
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ jsx6(
|
|
378
415
|
"div",
|
|
379
416
|
{
|
|
380
417
|
"data-slot": "sidebar",
|
|
@@ -388,7 +425,7 @@ function Sidebar({
|
|
|
388
425
|
);
|
|
389
426
|
}
|
|
390
427
|
if (isMobile) {
|
|
391
|
-
return /* @__PURE__ */
|
|
428
|
+
return /* @__PURE__ */ jsx6(Sheet, { open: openMobile, onOpenChange: setOpenMobile, ...props, children: /* @__PURE__ */ jsxs4(
|
|
392
429
|
SheetContent,
|
|
393
430
|
{
|
|
394
431
|
"data-sidebar": "sidebar",
|
|
@@ -400,16 +437,16 @@ function Sidebar({
|
|
|
400
437
|
},
|
|
401
438
|
side,
|
|
402
439
|
children: [
|
|
403
|
-
/* @__PURE__ */
|
|
404
|
-
/* @__PURE__ */
|
|
405
|
-
/* @__PURE__ */
|
|
440
|
+
/* @__PURE__ */ jsxs4(SheetHeader, { className: "sr-only", children: [
|
|
441
|
+
/* @__PURE__ */ jsx6(SheetTitle, { children: "Sidebar" }),
|
|
442
|
+
/* @__PURE__ */ jsx6(SheetDescription, { children: "Displays the mobile sidebar." })
|
|
406
443
|
] }),
|
|
407
|
-
/* @__PURE__ */
|
|
444
|
+
/* @__PURE__ */ jsx6("div", { className: "flex h-full w-full flex-col", children })
|
|
408
445
|
]
|
|
409
446
|
}
|
|
410
447
|
) });
|
|
411
448
|
}
|
|
412
|
-
return /* @__PURE__ */
|
|
449
|
+
return /* @__PURE__ */ jsxs4(
|
|
413
450
|
"div",
|
|
414
451
|
{
|
|
415
452
|
className: "group peer text-sidebar-foreground hidden md:block",
|
|
@@ -419,7 +456,7 @@ function Sidebar({
|
|
|
419
456
|
"data-side": side,
|
|
420
457
|
"data-slot": "sidebar",
|
|
421
458
|
children: [
|
|
422
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ jsx6(
|
|
423
460
|
"div",
|
|
424
461
|
{
|
|
425
462
|
"data-slot": "sidebar-gap",
|
|
@@ -431,7 +468,7 @@ function Sidebar({
|
|
|
431
468
|
)
|
|
432
469
|
}
|
|
433
470
|
),
|
|
434
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ jsx6(
|
|
435
472
|
"div",
|
|
436
473
|
{
|
|
437
474
|
"data-slot": "sidebar-container",
|
|
@@ -443,7 +480,7 @@ function Sidebar({
|
|
|
443
480
|
className
|
|
444
481
|
),
|
|
445
482
|
...props,
|
|
446
|
-
children: /* @__PURE__ */
|
|
483
|
+
children: /* @__PURE__ */ jsx6(
|
|
447
484
|
"div",
|
|
448
485
|
{
|
|
449
486
|
"data-sidebar": "sidebar",
|
|
@@ -464,7 +501,7 @@ function SidebarTrigger({
|
|
|
464
501
|
...props
|
|
465
502
|
}) {
|
|
466
503
|
const { toggleSidebar } = useSidebar();
|
|
467
|
-
return /* @__PURE__ */
|
|
504
|
+
return /* @__PURE__ */ jsxs4(
|
|
468
505
|
Button,
|
|
469
506
|
{
|
|
470
507
|
"data-sidebar": "trigger",
|
|
@@ -478,15 +515,15 @@ function SidebarTrigger({
|
|
|
478
515
|
},
|
|
479
516
|
...props,
|
|
480
517
|
children: [
|
|
481
|
-
/* @__PURE__ */
|
|
482
|
-
/* @__PURE__ */
|
|
518
|
+
/* @__PURE__ */ jsx6(IconMenu2, {}),
|
|
519
|
+
/* @__PURE__ */ jsx6("span", { className: "sr-only", children: "Toggle Sidebar" })
|
|
483
520
|
]
|
|
484
521
|
}
|
|
485
522
|
);
|
|
486
523
|
}
|
|
487
524
|
function SidebarRail({ className, ...props }) {
|
|
488
525
|
const { toggleSidebar } = useSidebar();
|
|
489
|
-
return /* @__PURE__ */
|
|
526
|
+
return /* @__PURE__ */ jsx6(
|
|
490
527
|
"button",
|
|
491
528
|
{
|
|
492
529
|
"data-sidebar": "rail",
|
|
@@ -509,7 +546,7 @@ function SidebarRail({ className, ...props }) {
|
|
|
509
546
|
);
|
|
510
547
|
}
|
|
511
548
|
function SidebarInset({ className, ...props }) {
|
|
512
|
-
return /* @__PURE__ */
|
|
549
|
+
return /* @__PURE__ */ jsx6(
|
|
513
550
|
"main",
|
|
514
551
|
{
|
|
515
552
|
"data-slot": "sidebar-inset",
|
|
@@ -526,7 +563,7 @@ function SidebarInput({
|
|
|
526
563
|
className,
|
|
527
564
|
...props
|
|
528
565
|
}) {
|
|
529
|
-
return /* @__PURE__ */
|
|
566
|
+
return /* @__PURE__ */ jsx6(
|
|
530
567
|
Input,
|
|
531
568
|
{
|
|
532
569
|
"data-slot": "sidebar-input",
|
|
@@ -537,7 +574,7 @@ function SidebarInput({
|
|
|
537
574
|
);
|
|
538
575
|
}
|
|
539
576
|
function SidebarHeader({ className, ...props }) {
|
|
540
|
-
return /* @__PURE__ */
|
|
577
|
+
return /* @__PURE__ */ jsx6(
|
|
541
578
|
"div",
|
|
542
579
|
{
|
|
543
580
|
"data-slot": "sidebar-header",
|
|
@@ -548,7 +585,7 @@ function SidebarHeader({ className, ...props }) {
|
|
|
548
585
|
);
|
|
549
586
|
}
|
|
550
587
|
function SidebarFooter({ className, ...props }) {
|
|
551
|
-
return /* @__PURE__ */
|
|
588
|
+
return /* @__PURE__ */ jsx6(
|
|
552
589
|
"div",
|
|
553
590
|
{
|
|
554
591
|
"data-slot": "sidebar-footer",
|
|
@@ -562,7 +599,7 @@ function SidebarSeparator({
|
|
|
562
599
|
className,
|
|
563
600
|
...props
|
|
564
601
|
}) {
|
|
565
|
-
return /* @__PURE__ */
|
|
602
|
+
return /* @__PURE__ */ jsx6(
|
|
566
603
|
Separator,
|
|
567
604
|
{
|
|
568
605
|
"data-slot": "sidebar-separator",
|
|
@@ -573,7 +610,7 @@ function SidebarSeparator({
|
|
|
573
610
|
);
|
|
574
611
|
}
|
|
575
612
|
function SidebarContent({ className, ...props }) {
|
|
576
|
-
return /* @__PURE__ */
|
|
613
|
+
return /* @__PURE__ */ jsx6(
|
|
577
614
|
"div",
|
|
578
615
|
{
|
|
579
616
|
"data-slot": "sidebar-content",
|
|
@@ -587,7 +624,7 @@ function SidebarContent({ className, ...props }) {
|
|
|
587
624
|
);
|
|
588
625
|
}
|
|
589
626
|
function SidebarGroup({ className, ...props }) {
|
|
590
|
-
return /* @__PURE__ */
|
|
627
|
+
return /* @__PURE__ */ jsx6(
|
|
591
628
|
"div",
|
|
592
629
|
{
|
|
593
630
|
"data-slot": "sidebar-group",
|
|
@@ -603,7 +640,7 @@ function SidebarGroupLabel({
|
|
|
603
640
|
...props
|
|
604
641
|
}) {
|
|
605
642
|
const Comp = asChild ? Slot2 : "div";
|
|
606
|
-
return /* @__PURE__ */
|
|
643
|
+
return /* @__PURE__ */ jsx6(
|
|
607
644
|
Comp,
|
|
608
645
|
{
|
|
609
646
|
"data-slot": "sidebar-group-label",
|
|
@@ -623,7 +660,7 @@ function SidebarGroupAction({
|
|
|
623
660
|
...props
|
|
624
661
|
}) {
|
|
625
662
|
const Comp = asChild ? Slot2 : "button";
|
|
626
|
-
return /* @__PURE__ */
|
|
663
|
+
return /* @__PURE__ */ jsx6(
|
|
627
664
|
Comp,
|
|
628
665
|
{
|
|
629
666
|
"data-slot": "sidebar-group-action",
|
|
@@ -643,7 +680,7 @@ function SidebarGroupContent({
|
|
|
643
680
|
className,
|
|
644
681
|
...props
|
|
645
682
|
}) {
|
|
646
|
-
return /* @__PURE__ */
|
|
683
|
+
return /* @__PURE__ */ jsx6(
|
|
647
684
|
"div",
|
|
648
685
|
{
|
|
649
686
|
"data-slot": "sidebar-group-content",
|
|
@@ -654,7 +691,7 @@ function SidebarGroupContent({
|
|
|
654
691
|
);
|
|
655
692
|
}
|
|
656
693
|
function SidebarMenu({ className, ...props }) {
|
|
657
|
-
return /* @__PURE__ */
|
|
694
|
+
return /* @__PURE__ */ jsx6(
|
|
658
695
|
"ul",
|
|
659
696
|
{
|
|
660
697
|
"data-slot": "sidebar-menu",
|
|
@@ -665,7 +702,7 @@ function SidebarMenu({ className, ...props }) {
|
|
|
665
702
|
);
|
|
666
703
|
}
|
|
667
704
|
function SidebarMenuItem({ className, ...props }) {
|
|
668
|
-
return /* @__PURE__ */
|
|
705
|
+
return /* @__PURE__ */ jsx6(
|
|
669
706
|
"li",
|
|
670
707
|
{
|
|
671
708
|
"data-slot": "sidebar-menu-item",
|
|
@@ -676,11 +713,11 @@ function SidebarMenuItem({ className, ...props }) {
|
|
|
676
713
|
);
|
|
677
714
|
}
|
|
678
715
|
var sidebarMenuButtonVariants = cva2(
|
|
679
|
-
|
|
716
|
+
'peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-active focus-visible:ring-2 active:bg-sidebar-active 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]:relative data-[active=true]:bg-sidebar-active data-[active=true]:pl-3 data-[active=true]:font-medium data-[active=true]:text-sidebar-primary data-[active=true]:before:absolute data-[active=true]:before:left-1 data-[active=true]:before:top-[6px] data-[active=true]:before:bottom-[6px] data-[active=true]:before:w-[3px] data-[active=true]:before:rounded-full data-[active=true]:before:bg-primary data-[active=true]:before:content-[""] data-[state=open]:hover:bg-sidebar-active group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 min-w-0',
|
|
680
717
|
{
|
|
681
718
|
variants: {
|
|
682
719
|
variant: {
|
|
683
|
-
default: "hover:bg-sidebar-
|
|
720
|
+
default: "hover:bg-sidebar-active",
|
|
684
721
|
outline: "bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"
|
|
685
722
|
},
|
|
686
723
|
size: {
|
|
@@ -706,7 +743,7 @@ function SidebarMenuButton({
|
|
|
706
743
|
}) {
|
|
707
744
|
const Comp = asChild ? Slot2 : "button";
|
|
708
745
|
const { isMobile, state } = useSidebar();
|
|
709
|
-
const button = /* @__PURE__ */
|
|
746
|
+
const button = /* @__PURE__ */ jsx6(
|
|
710
747
|
Comp,
|
|
711
748
|
{
|
|
712
749
|
"data-slot": "sidebar-menu-button",
|
|
@@ -725,9 +762,9 @@ function SidebarMenuButton({
|
|
|
725
762
|
children: tooltip
|
|
726
763
|
};
|
|
727
764
|
}
|
|
728
|
-
return /* @__PURE__ */
|
|
729
|
-
/* @__PURE__ */
|
|
730
|
-
/* @__PURE__ */
|
|
765
|
+
return /* @__PURE__ */ jsxs4(Tooltip, { children: [
|
|
766
|
+
/* @__PURE__ */ jsx6(TooltipTrigger, { asChild: true, children: button }),
|
|
767
|
+
/* @__PURE__ */ jsx6(
|
|
731
768
|
TooltipContent,
|
|
732
769
|
{
|
|
733
770
|
side: "right",
|
|
@@ -745,7 +782,7 @@ function SidebarMenuAction({
|
|
|
745
782
|
...props
|
|
746
783
|
}) {
|
|
747
784
|
const Comp = asChild ? Slot2 : "button";
|
|
748
|
-
return /* @__PURE__ */
|
|
785
|
+
return /* @__PURE__ */ jsx6(
|
|
749
786
|
Comp,
|
|
750
787
|
{
|
|
751
788
|
"data-slot": "sidebar-menu-action",
|
|
@@ -769,7 +806,7 @@ function SidebarMenuBadge({
|
|
|
769
806
|
className,
|
|
770
807
|
...props
|
|
771
808
|
}) {
|
|
772
|
-
return /* @__PURE__ */
|
|
809
|
+
return /* @__PURE__ */ jsx6(
|
|
773
810
|
"div",
|
|
774
811
|
{
|
|
775
812
|
"data-slot": "sidebar-menu-badge",
|
|
@@ -795,7 +832,7 @@ function SidebarMenuSkeleton({
|
|
|
795
832
|
const [width] = React2.useState(
|
|
796
833
|
() => `${Math.floor(Math.random() * 40) + 50}%`
|
|
797
834
|
);
|
|
798
|
-
return /* @__PURE__ */
|
|
835
|
+
return /* @__PURE__ */ jsxs4(
|
|
799
836
|
"div",
|
|
800
837
|
{
|
|
801
838
|
"data-slot": "sidebar-menu-skeleton",
|
|
@@ -803,14 +840,14 @@ function SidebarMenuSkeleton({
|
|
|
803
840
|
className: cn("flex h-8 items-center gap-2 rounded-md px-2", className),
|
|
804
841
|
...props,
|
|
805
842
|
children: [
|
|
806
|
-
showIcon && /* @__PURE__ */
|
|
843
|
+
showIcon && /* @__PURE__ */ jsx6(
|
|
807
844
|
Skeleton,
|
|
808
845
|
{
|
|
809
846
|
className: "size-4 rounded-md",
|
|
810
847
|
"data-sidebar": "menu-skeleton-icon"
|
|
811
848
|
}
|
|
812
849
|
),
|
|
813
|
-
/* @__PURE__ */
|
|
850
|
+
/* @__PURE__ */ jsx6(
|
|
814
851
|
Skeleton,
|
|
815
852
|
{
|
|
816
853
|
className: "h-4 max-w-(--skeleton-width) flex-1",
|
|
@@ -825,13 +862,13 @@ function SidebarMenuSkeleton({
|
|
|
825
862
|
);
|
|
826
863
|
}
|
|
827
864
|
function SidebarMenuSub({ className, ...props }) {
|
|
828
|
-
return /* @__PURE__ */
|
|
865
|
+
return /* @__PURE__ */ jsx6(
|
|
829
866
|
"ul",
|
|
830
867
|
{
|
|
831
868
|
"data-slot": "sidebar-menu-sub",
|
|
832
869
|
"data-sidebar": "menu-sub",
|
|
833
870
|
className: cn(
|
|
834
|
-
"border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
|
|
871
|
+
"border-sidebar-border relative mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5",
|
|
835
872
|
"group-data-[collapsible=icon]:hidden",
|
|
836
873
|
className
|
|
837
874
|
),
|
|
@@ -843,7 +880,7 @@ function SidebarMenuSubItem({
|
|
|
843
880
|
className,
|
|
844
881
|
...props
|
|
845
882
|
}) {
|
|
846
|
-
return /* @__PURE__ */
|
|
883
|
+
return /* @__PURE__ */ jsx6(
|
|
847
884
|
"li",
|
|
848
885
|
{
|
|
849
886
|
"data-slot": "sidebar-menu-sub-item",
|
|
@@ -861,7 +898,7 @@ function SidebarMenuSubButton({
|
|
|
861
898
|
...props
|
|
862
899
|
}) {
|
|
863
900
|
const Comp = asChild ? Slot2 : "a";
|
|
864
|
-
return /* @__PURE__ */
|
|
901
|
+
return /* @__PURE__ */ jsx6(
|
|
865
902
|
Comp,
|
|
866
903
|
{
|
|
867
904
|
"data-slot": "sidebar-menu-sub-button",
|
|
@@ -869,8 +906,8 @@ function SidebarMenuSubButton({
|
|
|
869
906
|
"data-size": size,
|
|
870
907
|
"data-active": isActive,
|
|
871
908
|
className: cn(
|
|
872
|
-
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-
|
|
873
|
-
|
|
909
|
+
"text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-active active:bg-sidebar-active [&>svg]:text-sidebar-primary flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",
|
|
910
|
+
'data-[active=true]:relative data-[active=true]:bg-sidebar-active data-[active=true]:pl-3 data-[active=true]:text-sidebar-primary data-[active=true]:before:absolute data-[active=true]:before:left-1 data-[active=true]:before:top-[6px] data-[active=true]:before:bottom-[6px] data-[active=true]:before:w-[3px] data-[active=true]:before:rounded-full data-[active=true]:before:bg-primary data-[active=true]:before:content-[""]',
|
|
874
911
|
size === "sm" && "text-xs",
|
|
875
912
|
size === "md" && "text-sm",
|
|
876
913
|
"group-data-[collapsible=icon]:hidden",
|