@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.
Files changed (103) hide show
  1. package/dist/components/alert-dialog.js +22 -22
  2. package/dist/components/alert-dialog.js.map +1 -1
  3. package/dist/components/alert.js +1 -1
  4. package/dist/components/alert.js.map +1 -1
  5. package/dist/components/animated-tabs.js +1 -1
  6. package/dist/components/animated-tabs.js.map +1 -1
  7. package/dist/components/app-breadcrumbs.d.ts +34 -0
  8. package/dist/components/app-breadcrumbs.js +177 -0
  9. package/dist/components/app-breadcrumbs.js.map +1 -0
  10. package/dist/components/app-header-actions.d.ts +39 -0
  11. package/dist/components/app-header-actions.js +644 -0
  12. package/dist/components/app-header-actions.js.map +1 -0
  13. package/dist/components/app-sidebar.d.ts +24 -0
  14. package/dist/components/app-sidebar.js +669 -0
  15. package/dist/components/app-sidebar.js.map +1 -0
  16. package/dist/components/button-group.js +1 -1
  17. package/dist/components/button-group.js.map +1 -1
  18. package/dist/components/button.d.ts +6 -3
  19. package/dist/components/button.js +16 -8
  20. package/dist/components/button.js.map +1 -1
  21. package/dist/components/calendar.js +24 -16
  22. package/dist/components/calendar.js.map +1 -1
  23. package/dist/components/card.js +1 -1
  24. package/dist/components/card.js.map +1 -1
  25. package/dist/components/carousel.js +28 -20
  26. package/dist/components/carousel.js.map +1 -1
  27. package/dist/components/command.js +5 -5
  28. package/dist/components/command.js.map +1 -1
  29. package/dist/components/context-menu.js +2 -2
  30. package/dist/components/context-menu.js.map +1 -1
  31. package/dist/components/data-table/index.d.ts +9 -2
  32. package/dist/components/data-table/index.js +336 -152
  33. package/dist/components/data-table/index.js.map +1 -1
  34. package/dist/components/dialog.js +2 -2
  35. package/dist/components/dialog.js.map +1 -1
  36. package/dist/components/drawer.js +2 -2
  37. package/dist/components/drawer.js.map +1 -1
  38. package/dist/components/dropdown-menu.js +2 -2
  39. package/dist/components/dropdown-menu.js.map +1 -1
  40. package/dist/components/entity/index.d.ts +85 -9
  41. package/dist/components/entity/index.js +539 -414
  42. package/dist/components/entity/index.js.map +1 -1
  43. package/dist/components/hover-card.js +1 -1
  44. package/dist/components/hover-card.js.map +1 -1
  45. package/dist/components/input-group.d.ts +1 -1
  46. package/dist/components/input-group.js +27 -19
  47. package/dist/components/input-group.js.map +1 -1
  48. package/dist/components/item.d.ts +1 -1
  49. package/dist/components/link.d.ts +12 -0
  50. package/dist/components/link.js +51 -0
  51. package/dist/components/link.js.map +1 -0
  52. package/dist/components/menubar.js +3 -3
  53. package/dist/components/menubar.js.map +1 -1
  54. package/dist/components/mesob-context.d.ts +34 -0
  55. package/dist/components/mesob-context.js +53 -0
  56. package/dist/components/mesob-context.js.map +1 -0
  57. package/dist/components/navigation-menu.js +1 -1
  58. package/dist/components/navigation-menu.js.map +1 -1
  59. package/dist/components/page/index.d.ts +46 -0
  60. package/dist/components/page/index.js +205 -0
  61. package/dist/components/page/index.js.map +1 -0
  62. package/dist/components/pagination.js +20 -20
  63. package/dist/components/pagination.js.map +1 -1
  64. package/dist/components/popover.js +1 -1
  65. package/dist/components/popover.js.map +1 -1
  66. package/dist/components/powered-by.d.ts +4 -1
  67. package/dist/components/powered-by.js +28 -12
  68. package/dist/components/powered-by.js.map +1 -1
  69. package/dist/components/section/index.js +29 -21
  70. package/dist/components/section/index.js.map +1 -1
  71. package/dist/components/select.js +1 -1
  72. package/dist/components/select.js.map +1 -1
  73. package/dist/components/sheet.js +2 -2
  74. package/dist/components/sheet.js.map +1 -1
  75. package/dist/components/shell.d.ts +13 -0
  76. package/dist/components/shell.js +553 -0
  77. package/dist/components/shell.js.map +1 -0
  78. package/dist/components/sidebar.d.ts +4 -0
  79. package/dist/components/sidebar.js +119 -82
  80. package/dist/components/sidebar.js.map +1 -1
  81. package/dist/components/spotlight-search.js +67 -59
  82. package/dist/components/spotlight-search.js.map +1 -1
  83. package/dist/components/table.js +1 -1
  84. package/dist/components/table.js.map +1 -1
  85. package/dist/components/theme-toggle.js +21 -13
  86. package/dist/components/theme-toggle.js.map +1 -1
  87. package/dist/components/tooltip.d.ts +1 -1
  88. package/dist/components/tooltip.js +2 -1
  89. package/dist/components/tooltip.js.map +1 -1
  90. package/dist/hooks/use-router.d.ts +7 -0
  91. package/dist/hooks/use-router.js +36 -0
  92. package/dist/hooks/use-router.js.map +1 -0
  93. package/dist/hooks/use-translation.d.ts +5 -0
  94. package/dist/hooks/use-translation.js +42 -0
  95. package/dist/hooks/use-translation.js.map +1 -0
  96. package/dist/index.d.ts +1 -0
  97. package/dist/index.js +94 -1
  98. package/dist/index.js.map +1 -1
  99. package/dist/lib/theme-schema.d.ts +21 -0
  100. package/dist/lib/theme-schema.js +95 -0
  101. package/dist/lib/theme-schema.js.map +1 -0
  102. package/package.json +8 -5
  103. package/src/styles/globals.css +0 -126
@@ -0,0 +1,553 @@
1
+ "use client";
2
+
3
+ // src/lib/utils.ts
4
+ import { clsx } from "clsx";
5
+ import { twMerge } from "tailwind-merge";
6
+ function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
8
+ }
9
+
10
+ // src/components/breadcrumb.tsx
11
+ import { Slot } from "@radix-ui/react-slot";
12
+ import { IconChevronRight, IconDots } from "@tabler/icons-react";
13
+ import { jsx, jsxs } from "react/jsx-runtime";
14
+ function Breadcrumb({ ...props }) {
15
+ return /* @__PURE__ */ jsx("nav", { "aria-label": "breadcrumb", "data-slot": "breadcrumb", ...props });
16
+ }
17
+ function BreadcrumbList({ className, ...props }) {
18
+ return /* @__PURE__ */ jsx(
19
+ "ol",
20
+ {
21
+ "data-slot": "breadcrumb-list",
22
+ className: cn(
23
+ "text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5",
24
+ className
25
+ ),
26
+ ...props
27
+ }
28
+ );
29
+ }
30
+ function BreadcrumbItem({ className, ...props }) {
31
+ return /* @__PURE__ */ jsx(
32
+ "li",
33
+ {
34
+ "data-slot": "breadcrumb-item",
35
+ className: cn("inline-flex items-center gap-1.5", className),
36
+ ...props
37
+ }
38
+ );
39
+ }
40
+ function BreadcrumbPage({ className, ...props }) {
41
+ return /* @__PURE__ */ jsx(
42
+ "span",
43
+ {
44
+ "data-slot": "breadcrumb-page",
45
+ "aria-disabled": "true",
46
+ "aria-current": "page",
47
+ className: cn("text-foreground font-normal", className),
48
+ ...props
49
+ }
50
+ );
51
+ }
52
+ function BreadcrumbSeparator({
53
+ children,
54
+ className,
55
+ ...props
56
+ }) {
57
+ return /* @__PURE__ */ jsx(
58
+ "li",
59
+ {
60
+ "data-slot": "breadcrumb-separator",
61
+ role: "presentation",
62
+ "aria-hidden": "true",
63
+ className: cn("[&>svg]:size-3.5", className),
64
+ ...props,
65
+ children: children ?? /* @__PURE__ */ jsx(IconChevronRight, {})
66
+ }
67
+ );
68
+ }
69
+
70
+ // src/components/tooltip.tsx
71
+ import * as TooltipPrimitive from "@radix-ui/react-tooltip";
72
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
73
+ function TooltipProvider({
74
+ delayDuration = 0,
75
+ ...props
76
+ }) {
77
+ return /* @__PURE__ */ jsx2(
78
+ TooltipPrimitive.Provider,
79
+ {
80
+ "data-slot": "tooltip-provider",
81
+ delayDuration,
82
+ ...props
83
+ }
84
+ );
85
+ }
86
+
87
+ // src/components/mesob-context.tsx
88
+ import {
89
+ createContext,
90
+ useContext,
91
+ useMemo
92
+ } from "react";
93
+ import { jsx as jsx3 } from "react/jsx-runtime";
94
+ var MesobContext = createContext(null);
95
+ function useMesob() {
96
+ return useContext(MesobContext);
97
+ }
98
+
99
+ // src/components/app-breadcrumbs.tsx
100
+ import {
101
+ createContext as createContext2,
102
+ Fragment,
103
+ useCallback,
104
+ useContext as useContext2,
105
+ useEffect,
106
+ useMemo as useMemo2,
107
+ useRef,
108
+ useState
109
+ } from "react";
110
+ import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
111
+ var BreadcrumbContext = createContext2(null);
112
+ function useBreadcrumbs(options) {
113
+ const context = useContext2(BreadcrumbContext);
114
+ if (!context) {
115
+ throw new Error("useBreadcrumbs must be used within BreadcrumbProvider");
116
+ }
117
+ const { setItems } = context;
118
+ const prevItemsStrRef = useRef(void 0);
119
+ useEffect(() => {
120
+ const items = options?.items;
121
+ if (!items) {
122
+ return;
123
+ }
124
+ const itemsStr = JSON.stringify(items);
125
+ if (prevItemsStrRef.current !== itemsStr) {
126
+ prevItemsStrRef.current = itemsStr;
127
+ setItems(items);
128
+ }
129
+ }, [options?.items, setItems]);
130
+ return context;
131
+ }
132
+ function BreadcrumbProvider({
133
+ children,
134
+ defaultItems = []
135
+ }) {
136
+ const [items, setItems] = useState(defaultItems);
137
+ const push = useCallback((item) => {
138
+ setItems((prev) => [...prev, item]);
139
+ }, []);
140
+ const pop = useCallback(() => {
141
+ setItems((prev) => prev.slice(0, -1));
142
+ }, []);
143
+ const clear = useCallback(() => {
144
+ setItems([]);
145
+ }, []);
146
+ const value = useMemo2(
147
+ () => ({
148
+ items,
149
+ setItems,
150
+ push,
151
+ pop,
152
+ clear
153
+ }),
154
+ [items, push, pop, clear]
155
+ );
156
+ return /* @__PURE__ */ jsx4(BreadcrumbContext.Provider, { value, children });
157
+ }
158
+ function AppBreadcrumbs({
159
+ linkComponent: linkProp,
160
+ className
161
+ }) {
162
+ const mesob = useMesob();
163
+ const Link = linkProp ?? mesob?.linkComponent;
164
+ const { items } = useBreadcrumbs(void 0);
165
+ if (items.length === 0) {
166
+ return null;
167
+ }
168
+ return /* @__PURE__ */ jsx4(Breadcrumb, { className, children: /* @__PURE__ */ jsx4(BreadcrumbList, { children: items.map((crumb, index) => {
169
+ let content;
170
+ if (crumb.href) {
171
+ if (Link) {
172
+ content = /* @__PURE__ */ jsx4(Link, { href: crumb.href, className: "hover:underline", children: crumb.label });
173
+ } else {
174
+ content = /* @__PURE__ */ jsx4("a", { href: crumb.href, className: "hover:underline", children: crumb.label });
175
+ }
176
+ } else {
177
+ content = /* @__PURE__ */ jsx4(BreadcrumbPage, { children: crumb.label });
178
+ }
179
+ return /* @__PURE__ */ jsxs3(Fragment, { children: [
180
+ index > 0 && /* @__PURE__ */ jsx4(BreadcrumbSeparator, { className: "hidden md:block" }),
181
+ /* @__PURE__ */ jsx4(BreadcrumbItem, { className: index === 0 ? "hidden md:block" : "", children: content })
182
+ ] }, `${crumb.label}-${crumb.href ?? ""}-${index}`);
183
+ }) }) });
184
+ }
185
+
186
+ // src/components/separator.tsx
187
+ import * as SeparatorPrimitive from "@radix-ui/react-separator";
188
+ import { jsx as jsx5 } from "react/jsx-runtime";
189
+ function Separator({
190
+ className,
191
+ orientation = "horizontal",
192
+ decorative = true,
193
+ ...props
194
+ }) {
195
+ return /* @__PURE__ */ jsx5(
196
+ SeparatorPrimitive.Root,
197
+ {
198
+ "data-slot": "separator",
199
+ decorative,
200
+ orientation,
201
+ className: cn(
202
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
203
+ className
204
+ ),
205
+ ...props
206
+ }
207
+ );
208
+ }
209
+
210
+ // src/components/button.tsx
211
+ import { Slot as Slot2 } from "@radix-ui/react-slot";
212
+ import { cva } from "class-variance-authority";
213
+ import { jsxs as jsxs4 } from "react/jsx-runtime";
214
+ var buttonVariants = cva(
215
+ "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",
216
+ {
217
+ variants: {
218
+ variant: {
219
+ default: "bg-primary text-primary-foreground hover:bg-primary-600 dark:hover:bg-primary-400",
220
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
221
+ 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",
222
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary-600 dark:hover:bg-secondary-400",
223
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
224
+ link: "text-primary underline-offset-4 hover:text-primary-600 dark:hover:text-primary-400 hover:underline"
225
+ },
226
+ size: {
227
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
228
+ sm: "h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",
229
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
230
+ icon: "size-9",
231
+ "icon-sm": "size-8",
232
+ "icon-lg": "size-10"
233
+ }
234
+ },
235
+ defaultVariants: {
236
+ variant: "default",
237
+ size: "default"
238
+ }
239
+ }
240
+ );
241
+ function Button({
242
+ className,
243
+ variant,
244
+ size,
245
+ asChild = false,
246
+ leftIcon,
247
+ rightIcon,
248
+ children,
249
+ ...props
250
+ }) {
251
+ const Comp = asChild ? Slot2 : "button";
252
+ return /* @__PURE__ */ jsxs4(
253
+ Comp,
254
+ {
255
+ "data-slot": "button",
256
+ className: cn(buttonVariants({ variant, size, className })),
257
+ ...props,
258
+ children: [
259
+ leftIcon,
260
+ children,
261
+ rightIcon
262
+ ]
263
+ }
264
+ );
265
+ }
266
+
267
+ // src/components/input.tsx
268
+ import { jsx as jsx6 } from "react/jsx-runtime";
269
+
270
+ // src/components/sheet.tsx
271
+ import * as SheetPrimitive from "@radix-ui/react-dialog";
272
+ import { IconX } from "@tabler/icons-react";
273
+ import { jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
274
+
275
+ // src/components/skeleton.tsx
276
+ import { jsx as jsx8 } from "react/jsx-runtime";
277
+
278
+ // src/hooks/use-mobile.ts
279
+ import * as React from "react";
280
+ var MOBILE_BREAKPOINT = 768;
281
+ function useIsMobile() {
282
+ const [isMobile, setIsMobile] = React.useState(
283
+ void 0
284
+ );
285
+ React.useEffect(() => {
286
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
287
+ const onChange = () => {
288
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
289
+ };
290
+ mql.addEventListener("change", onChange);
291
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
292
+ return () => mql.removeEventListener("change", onChange);
293
+ }, []);
294
+ return !!isMobile;
295
+ }
296
+
297
+ // src/components/sidebar.tsx
298
+ import { Slot as Slot3 } from "@radix-ui/react-slot";
299
+ import { IconMenu2 } from "@tabler/icons-react";
300
+ import { cva as cva2 } from "class-variance-authority";
301
+ import * as React2 from "react";
302
+ import { jsx as jsx9, jsxs as jsxs6 } from "react/jsx-runtime";
303
+ var SIDEBAR_COOKIE_NAME = "sidebar_state";
304
+ var SIDEBAR_WIDTH_COOKIE = "sidebar_width";
305
+ var SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
306
+ var SIDEBAR_WIDTH_DEFAULT = 256;
307
+ var SIDEBAR_WIDTH_MIN = 200;
308
+ var SIDEBAR_WIDTH_MAX = 480;
309
+ var SIDEBAR_WIDTH = "16rem";
310
+ var SIDEBAR_WIDTH_ICON = "3rem";
311
+ var SIDEBAR_KEYBOARD_SHORTCUT = "b";
312
+ function getWidthFromCookie() {
313
+ if (typeof document === "undefined") {
314
+ return SIDEBAR_WIDTH_DEFAULT;
315
+ }
316
+ const m = document.cookie.match(
317
+ new RegExp(`(?:^|; )${SIDEBAR_WIDTH_COOKIE}=([^;]*)`)
318
+ );
319
+ const n = m ? Number(m[1]) : Number.NaN;
320
+ return Number.isFinite(n) && n >= SIDEBAR_WIDTH_MIN && n <= SIDEBAR_WIDTH_MAX ? n : SIDEBAR_WIDTH_DEFAULT;
321
+ }
322
+ function setWidthCookie(width) {
323
+ document.cookie = `${SIDEBAR_WIDTH_COOKIE}=${width}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
324
+ }
325
+ var SidebarContext = React2.createContext(null);
326
+ function useSidebar() {
327
+ const context = React2.useContext(SidebarContext);
328
+ if (!context) {
329
+ throw new Error("useSidebar must be used within a SidebarProvider.");
330
+ }
331
+ return context;
332
+ }
333
+ function SidebarProvider({
334
+ defaultOpen = true,
335
+ open: openProp,
336
+ onOpenChange: setOpenProp,
337
+ className,
338
+ style,
339
+ children,
340
+ ...props
341
+ }) {
342
+ const isMobile = useIsMobile();
343
+ const [openMobile, setOpenMobile] = React2.useState(false);
344
+ const [width, setWidthState] = React2.useState(getWidthFromCookie);
345
+ const setWidth = React2.useCallback((w) => {
346
+ const clamped = Math.max(SIDEBAR_WIDTH_MIN, Math.min(SIDEBAR_WIDTH_MAX, w));
347
+ setWidthState(clamped);
348
+ setWidthCookie(clamped);
349
+ }, []);
350
+ const [_open, _setOpen] = React2.useState(defaultOpen);
351
+ const open = openProp ?? _open;
352
+ const setOpen = React2.useCallback(
353
+ (value) => {
354
+ const openState = typeof value === "function" ? value(open) : value;
355
+ if (setOpenProp) {
356
+ setOpenProp(openState);
357
+ } else {
358
+ _setOpen(openState);
359
+ }
360
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
361
+ },
362
+ [open, setOpenProp]
363
+ );
364
+ const toggleSidebar = React2.useCallback(() => {
365
+ return isMobile ? setOpenMobile((value) => !value) : setOpen((value) => !value);
366
+ }, [isMobile, setOpen]);
367
+ React2.useEffect(() => {
368
+ const handleKeyDown = (event) => {
369
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
370
+ event.preventDefault();
371
+ toggleSidebar();
372
+ }
373
+ };
374
+ window.addEventListener("keydown", handleKeyDown);
375
+ return () => window.removeEventListener("keydown", handleKeyDown);
376
+ }, [toggleSidebar]);
377
+ const state = open ? "expanded" : "collapsed";
378
+ const contextValue = {
379
+ state,
380
+ open,
381
+ setOpen,
382
+ isMobile,
383
+ openMobile,
384
+ setOpenMobile,
385
+ toggleSidebar,
386
+ width,
387
+ setWidth,
388
+ minWidth: SIDEBAR_WIDTH_MIN,
389
+ maxWidth: SIDEBAR_WIDTH_MAX
390
+ };
391
+ const sidebarWidthValue = open ? `${width}px` : SIDEBAR_WIDTH;
392
+ return /* @__PURE__ */ jsx9(SidebarContext.Provider, { value: contextValue, children: /* @__PURE__ */ jsx9(TooltipProvider, { delayDuration: 0, children: /* @__PURE__ */ jsx9(
393
+ "div",
394
+ {
395
+ "data-slot": "sidebar-wrapper",
396
+ style: {
397
+ "--sidebar-width": sidebarWidthValue,
398
+ "--sidebar-width-icon": SIDEBAR_WIDTH_ICON,
399
+ ...style
400
+ },
401
+ className: cn(
402
+ "group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",
403
+ className
404
+ ),
405
+ ...props,
406
+ children
407
+ }
408
+ ) }) });
409
+ }
410
+ function SidebarTrigger({
411
+ className,
412
+ onClick,
413
+ ...props
414
+ }) {
415
+ const { toggleSidebar } = useSidebar();
416
+ return /* @__PURE__ */ jsxs6(
417
+ Button,
418
+ {
419
+ "data-sidebar": "trigger",
420
+ "data-slot": "sidebar-trigger",
421
+ variant: "ghost",
422
+ size: "icon",
423
+ className: cn("size-7", className),
424
+ onClick: (event) => {
425
+ onClick?.(event);
426
+ toggleSidebar();
427
+ },
428
+ ...props,
429
+ children: [
430
+ /* @__PURE__ */ jsx9(IconMenu2, {}),
431
+ /* @__PURE__ */ jsx9("span", { className: "sr-only", children: "Toggle Sidebar" })
432
+ ]
433
+ }
434
+ );
435
+ }
436
+ function SidebarInset({ className, ...props }) {
437
+ return /* @__PURE__ */ jsx9(
438
+ "main",
439
+ {
440
+ "data-slot": "sidebar-inset",
441
+ className: cn(
442
+ "bg-background relative flex w-full flex-1 flex-col",
443
+ "md:peer-data-[variant=inset]:m-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
444
+ className
445
+ ),
446
+ ...props
447
+ }
448
+ );
449
+ }
450
+ var sidebarMenuButtonVariants = cva2(
451
+ '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',
452
+ {
453
+ variants: {
454
+ variant: {
455
+ default: "hover:bg-sidebar-active",
456
+ 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))]"
457
+ },
458
+ size: {
459
+ default: "h-8 text-sm",
460
+ sm: "h-7 text-xs",
461
+ lg: "h-12 text-sm group-data-[collapsible=icon]:p-0!"
462
+ }
463
+ },
464
+ defaultVariants: {
465
+ variant: "default",
466
+ size: "default"
467
+ }
468
+ }
469
+ );
470
+
471
+ // src/components/sonner.tsx
472
+ import {
473
+ IconAlertTriangle,
474
+ IconCircleCheck,
475
+ IconInfoCircle,
476
+ IconLoader2,
477
+ IconX as IconX2
478
+ } from "@tabler/icons-react";
479
+ import { useTheme } from "next-themes";
480
+ import { Toaster as Sonner } from "sonner";
481
+ import { toast } from "sonner";
482
+ import { jsx as jsx10 } from "react/jsx-runtime";
483
+ var Toaster = ({ ...props }) => {
484
+ const { theme = "system" } = useTheme();
485
+ return /* @__PURE__ */ jsx10(
486
+ Sonner,
487
+ {
488
+ theme,
489
+ className: "toaster group",
490
+ icons: {
491
+ success: /* @__PURE__ */ jsx10(IconCircleCheck, { className: "size-4" }),
492
+ info: /* @__PURE__ */ jsx10(IconInfoCircle, { className: "size-4" }),
493
+ warning: /* @__PURE__ */ jsx10(IconAlertTriangle, { className: "size-4" }),
494
+ error: /* @__PURE__ */ jsx10(IconX2, { className: "size-4" }),
495
+ loading: /* @__PURE__ */ jsx10(IconLoader2, { className: "size-4 animate-spin" })
496
+ },
497
+ style: {
498
+ "--normal-bg": "var(--popover)",
499
+ "--normal-text": "var(--popover-foreground)",
500
+ "--normal-border": "var(--border)",
501
+ "--border-radius": "var(--radius)"
502
+ },
503
+ ...props
504
+ }
505
+ );
506
+ };
507
+
508
+ // src/components/shell.tsx
509
+ import { jsx as jsx11, jsxs as jsxs7 } from "react/jsx-runtime";
510
+ function Shell({
511
+ sidebar,
512
+ headerActions,
513
+ children,
514
+ showToaster = true,
515
+ contentClassName
516
+ }) {
517
+ return /* @__PURE__ */ jsx11(BreadcrumbProvider, { children: /* @__PURE__ */ jsxs7(SidebarProvider, { children: [
518
+ sidebar,
519
+ /* @__PURE__ */ jsxs7(SidebarInset, { children: [
520
+ /* @__PURE__ */ jsxs7("header", { className: "flex h-16 shrink-0 items-center justify-between gap-2 border-b px-4", children: [
521
+ /* @__PURE__ */ jsxs7("div", { className: "flex items-center gap-2", children: [
522
+ /* @__PURE__ */ jsx11(SidebarTrigger, { className: "-ml-1" }),
523
+ /* @__PURE__ */ jsxs7("div", { className: "hidden md:flex md:items-center md:gap-2", children: [
524
+ /* @__PURE__ */ jsx11(
525
+ Separator,
526
+ {
527
+ orientation: "vertical",
528
+ className: "mr-2 data-[orientation=vertical]:h-4"
529
+ }
530
+ ),
531
+ /* @__PURE__ */ jsx11(AppBreadcrumbs, {})
532
+ ] })
533
+ ] }),
534
+ headerActions
535
+ ] }),
536
+ /* @__PURE__ */ jsx11(
537
+ "div",
538
+ {
539
+ className: cn(
540
+ "flex min-h-0 flex-1 flex-col gap-4 overflow-auto p-4",
541
+ contentClassName
542
+ ),
543
+ children: /* @__PURE__ */ jsx11("div", { className: "mx-auto w-full max-w-7xl", children })
544
+ }
545
+ )
546
+ ] }),
547
+ showToaster && /* @__PURE__ */ jsx11(Toaster, {})
548
+ ] }) });
549
+ }
550
+ export {
551
+ Shell
552
+ };
553
+ //# sourceMappingURL=shell.js.map