react-shadcn-kit 0.0.3 → 0.0.5

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 (142) hide show
  1. package/dist/assets/global.css +1 -1
  2. package/dist/cjs/atoms/accordion.js +1 -0
  3. package/dist/cjs/atoms/alert-dialog.js +1 -0
  4. package/dist/cjs/atoms/alert.js +1 -0
  5. package/dist/cjs/atoms/aspect-ratio.js +1 -0
  6. package/dist/cjs/atoms/avatar.js +1 -0
  7. package/dist/cjs/atoms/badge.js +1 -0
  8. package/dist/cjs/atoms/breadcrumb.js +1 -0
  9. package/dist/cjs/atoms/button-group.js +1 -0
  10. package/dist/cjs/atoms/button.js +1 -0
  11. package/dist/cjs/atoms/calendar.js +1 -0
  12. package/dist/cjs/atoms/card.js +1 -0
  13. package/dist/cjs/atoms/carousel.js +1 -0
  14. package/dist/cjs/atoms/chart.js +7 -0
  15. package/dist/cjs/atoms/checkbox.js +1 -0
  16. package/dist/cjs/atoms/collapsible.js +1 -0
  17. package/dist/cjs/atoms/command.js +1 -0
  18. package/dist/cjs/atoms/context-menu.js +1 -0
  19. package/dist/cjs/atoms/dialog.js +1 -0
  20. package/dist/cjs/atoms/drawer.js +1 -0
  21. package/dist/cjs/atoms/dropdown-menu.js +1 -0
  22. package/dist/cjs/atoms/empty.js +1 -0
  23. package/dist/cjs/atoms/field.js +1 -0
  24. package/dist/cjs/atoms/form.js +1 -0
  25. package/dist/cjs/atoms/hover-card.js +1 -0
  26. package/dist/cjs/atoms/input-group.js +1 -0
  27. package/dist/cjs/atoms/input-otp.js +1 -0
  28. package/dist/cjs/atoms/input.js +1 -0
  29. package/dist/cjs/atoms/item.js +1 -0
  30. package/dist/cjs/atoms/kbd.js +1 -0
  31. package/dist/cjs/atoms/label.js +1 -0
  32. package/dist/cjs/atoms/menubar.js +1 -0
  33. package/dist/cjs/atoms/navigation-menu.js +1 -0
  34. package/dist/cjs/atoms/pagination.js +1 -0
  35. package/dist/cjs/atoms/popover.js +1 -0
  36. package/dist/cjs/atoms/progress.js +1 -0
  37. package/dist/cjs/atoms/radio-group.js +1 -0
  38. package/dist/cjs/atoms/resizable.js +1 -0
  39. package/dist/cjs/atoms/scroll-area.js +1 -0
  40. package/dist/cjs/atoms/select.js +1 -0
  41. package/dist/cjs/atoms/separator.js +1 -0
  42. package/dist/cjs/atoms/sheet.js +1 -0
  43. package/dist/cjs/atoms/sidebar.js +1 -0
  44. package/dist/cjs/atoms/skeleton.js +1 -0
  45. package/dist/cjs/atoms/slider.js +1 -0
  46. package/dist/cjs/atoms/sonner.js +1 -0
  47. package/dist/cjs/atoms/spinner.js +1 -0
  48. package/dist/cjs/atoms/switch.js +1 -0
  49. package/dist/cjs/atoms/table.js +1 -0
  50. package/dist/cjs/atoms/tabs.js +1 -0
  51. package/dist/cjs/atoms/textarea.js +1 -0
  52. package/dist/cjs/atoms/toggle-group.js +1 -0
  53. package/dist/cjs/atoms/toggle.js +1 -0
  54. package/dist/cjs/atoms/tooltip.js +1 -0
  55. package/dist/cjs/config/blog-layout.config.js +1 -0
  56. package/dist/cjs/config/default-Sidebar.js +1 -0
  57. package/dist/cjs/config/default-layout.js +1 -0
  58. package/dist/cjs/config/default-navigation.js +1 -0
  59. package/dist/cjs/config/sidebar.config.js +1 -0
  60. package/dist/cjs/hooks/use-mobile.js +1 -0
  61. package/dist/cjs/index.js +1 -0
  62. package/dist/cjs/layouts/blog-layout.js +1 -0
  63. package/dist/cjs/layouts/default-layout.js +1 -0
  64. package/dist/cjs/layouts/sidebar-scroll-layout.js +1 -0
  65. package/dist/cjs/lib/utils.js +1 -0
  66. package/dist/cjs/molecules/theme-toggle.js +1 -0
  67. package/dist/cjs/molecules/user-menu.js +1 -0
  68. package/dist/cjs/organisms/app-navbar.js +1 -0
  69. package/dist/cjs/organisms/app-sidebar-client.js +1 -0
  70. package/dist/cjs/organisms/app-sidebar.js +1 -0
  71. package/dist/{index.js → es/index.js} +1 -1
  72. package/dist/es/organisms/app-sidebar-client.js +38 -0
  73. package/dist/es/organisms/app-sidebar.js +143 -0
  74. package/dist/organisms/app-sidebar-client.d.ts +5 -0
  75. package/package.json +19 -11
  76. package/dist/organisms/app-sidebar.js +0 -169
  77. /package/dist/{atoms → es/atoms}/accordion.js +0 -0
  78. /package/dist/{atoms → es/atoms}/alert-dialog.js +0 -0
  79. /package/dist/{atoms → es/atoms}/alert.js +0 -0
  80. /package/dist/{atoms → es/atoms}/aspect-ratio.js +0 -0
  81. /package/dist/{atoms → es/atoms}/avatar.js +0 -0
  82. /package/dist/{atoms → es/atoms}/badge.js +0 -0
  83. /package/dist/{atoms → es/atoms}/breadcrumb.js +0 -0
  84. /package/dist/{atoms → es/atoms}/button-group.js +0 -0
  85. /package/dist/{atoms → es/atoms}/button.js +0 -0
  86. /package/dist/{atoms → es/atoms}/calendar.js +0 -0
  87. /package/dist/{atoms → es/atoms}/card.js +0 -0
  88. /package/dist/{atoms → es/atoms}/carousel.js +0 -0
  89. /package/dist/{atoms → es/atoms}/chart.js +0 -0
  90. /package/dist/{atoms → es/atoms}/checkbox.js +0 -0
  91. /package/dist/{atoms → es/atoms}/collapsible.js +0 -0
  92. /package/dist/{atoms → es/atoms}/command.js +0 -0
  93. /package/dist/{atoms → es/atoms}/context-menu.js +0 -0
  94. /package/dist/{atoms → es/atoms}/dialog.js +0 -0
  95. /package/dist/{atoms → es/atoms}/drawer.js +0 -0
  96. /package/dist/{atoms → es/atoms}/dropdown-menu.js +0 -0
  97. /package/dist/{atoms → es/atoms}/empty.js +0 -0
  98. /package/dist/{atoms → es/atoms}/field.js +0 -0
  99. /package/dist/{atoms → es/atoms}/form.js +0 -0
  100. /package/dist/{atoms → es/atoms}/hover-card.js +0 -0
  101. /package/dist/{atoms → es/atoms}/input-group.js +0 -0
  102. /package/dist/{atoms → es/atoms}/input-otp.js +0 -0
  103. /package/dist/{atoms → es/atoms}/input.js +0 -0
  104. /package/dist/{atoms → es/atoms}/item.js +0 -0
  105. /package/dist/{atoms → es/atoms}/kbd.js +0 -0
  106. /package/dist/{atoms → es/atoms}/label.js +0 -0
  107. /package/dist/{atoms → es/atoms}/menubar.js +0 -0
  108. /package/dist/{atoms → es/atoms}/navigation-menu.js +0 -0
  109. /package/dist/{atoms → es/atoms}/pagination.js +0 -0
  110. /package/dist/{atoms → es/atoms}/popover.js +0 -0
  111. /package/dist/{atoms → es/atoms}/progress.js +0 -0
  112. /package/dist/{atoms → es/atoms}/radio-group.js +0 -0
  113. /package/dist/{atoms → es/atoms}/resizable.js +0 -0
  114. /package/dist/{atoms → es/atoms}/scroll-area.js +0 -0
  115. /package/dist/{atoms → es/atoms}/select.js +0 -0
  116. /package/dist/{atoms → es/atoms}/separator.js +0 -0
  117. /package/dist/{atoms → es/atoms}/sheet.js +0 -0
  118. /package/dist/{atoms → es/atoms}/sidebar.js +0 -0
  119. /package/dist/{atoms → es/atoms}/skeleton.js +0 -0
  120. /package/dist/{atoms → es/atoms}/slider.js +0 -0
  121. /package/dist/{atoms → es/atoms}/sonner.js +0 -0
  122. /package/dist/{atoms → es/atoms}/spinner.js +0 -0
  123. /package/dist/{atoms → es/atoms}/switch.js +0 -0
  124. /package/dist/{atoms → es/atoms}/table.js +0 -0
  125. /package/dist/{atoms → es/atoms}/tabs.js +0 -0
  126. /package/dist/{atoms → es/atoms}/textarea.js +0 -0
  127. /package/dist/{atoms → es/atoms}/toggle-group.js +0 -0
  128. /package/dist/{atoms → es/atoms}/toggle.js +0 -0
  129. /package/dist/{atoms → es/atoms}/tooltip.js +0 -0
  130. /package/dist/{config → es/config}/blog-layout.config.js +0 -0
  131. /package/dist/{config → es/config}/default-Sidebar.js +0 -0
  132. /package/dist/{config → es/config}/default-layout.js +0 -0
  133. /package/dist/{config → es/config}/default-navigation.js +0 -0
  134. /package/dist/{config → es/config}/sidebar.config.js +0 -0
  135. /package/dist/{hooks → es/hooks}/use-mobile.js +0 -0
  136. /package/dist/{layouts → es/layouts}/blog-layout.js +0 -0
  137. /package/dist/{layouts → es/layouts}/default-layout.js +0 -0
  138. /package/dist/{layouts → es/layouts}/sidebar-scroll-layout.js +0 -0
  139. /package/dist/{lib → es/lib}/utils.js +0 -0
  140. /package/dist/{molecules → es/molecules}/theme-toggle.js +0 -0
  141. /package/dist/{molecules → es/molecules}/user-menu.js +0 -0
  142. /package/dist/{organisms → es/organisms}/app-navbar.js +0 -0
@@ -0,0 +1,143 @@
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
+ import { ChevronDown as u, LogOut as k } from "lucide-react";
3
+ import { SidebarThemeToggle as G } from "./app-sidebar-client.js";
4
+ import { Sidebar as O, SidebarHeader as p, SidebarMenu as c, SidebarMenuItem as o, SidebarMenuButton as d, SidebarContent as B, SidebarGroup as F, SidebarGroupLabel as b, SidebarGroupContent as f, SidebarMenuSub as q, SidebarMenuSubItem as E, SidebarMenuSubButton as H, SidebarFooter as J } from "../atoms/sidebar.js";
5
+ import { Collapsible as g, CollapsibleTrigger as N, CollapsibleContent as x } from "../atoms/collapsible.js";
6
+ import { cn as K } from "../lib/utils.js";
7
+ import { defaultSidebarConfig as i } from "../config/default-Sidebar.js";
8
+ import { defaultSidebarStyles as m } from "../config/sidebar.config.js";
9
+ import { Avatar as v, AvatarImage as C, AvatarFallback as S } from "../atoms/avatar.js";
10
+ import { DropdownMenu as P, DropdownMenuTrigger as Q, DropdownMenuContent as R, DropdownMenuLabel as U, DropdownMenuSeparator as V, DropdownMenuItem as M } from "../atoms/dropdown-menu.js";
11
+ function ne({
12
+ config: s,
13
+ side: w = "left",
14
+ variant: A,
15
+ collapsible: y,
16
+ hideBranding: D = !1,
17
+ showThemeToggle: I = !0,
18
+ className: z,
19
+ style: L,
20
+ scrollable: T,
21
+ ...j
22
+ }) {
23
+ const r = {
24
+ groups: s?.groups || i.groups,
25
+ header: s?.header || i.header,
26
+ footer: s?.footer || i.footer,
27
+ user: s?.user || i.user,
28
+ userMenuItems: s?.userMenuItems || i.userMenuItems,
29
+ branding: D ? void 0 : s?.branding || i.branding,
30
+ fixed: s?.fixed ?? i.fixed,
31
+ variant: A ?? s?.variant ?? m.variant,
32
+ collapsible: y ?? s?.collapsible ?? m.collapsible,
33
+ scrollable: T ?? s?.scrollable ?? !1,
34
+ style: { ...m.style, ...s?.style, ...L },
35
+ className: s?.className
36
+ };
37
+ return /* @__PURE__ */ a(
38
+ O,
39
+ {
40
+ side: w,
41
+ variant: r.variant,
42
+ collapsible: r.collapsible,
43
+ scrollable: r.scrollable,
44
+ className: K(
45
+ r.fixed ? void 0 : "absolute h-full",
46
+ r.className,
47
+ z
48
+ ),
49
+ style: r.style,
50
+ ...j,
51
+ children: [
52
+ r.header && /* @__PURE__ */ e(p, { children: r.header }),
53
+ r.branding && !r.header && /* @__PURE__ */ e(p, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(d, { size: "lg", asChild: !0, children: /* @__PURE__ */ a("a", { href: r.branding.href || "#", children: [
54
+ /* @__PURE__ */ e("div", { className: "bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg", children: r.branding.logo && /* @__PURE__ */ e(r.branding.logo, { className: "size-4" }) }),
55
+ /* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
56
+ /* @__PURE__ */ e("span", { className: "truncate font-semibold", children: r.branding.name }),
57
+ /* @__PURE__ */ e("span", { className: "truncate text-xs", children: "Enterprise" })
58
+ ] })
59
+ ] }) }) }) }) }),
60
+ /* @__PURE__ */ e(B, { children: r.groups.map((n, h) => /* @__PURE__ */ a(F, { children: [
61
+ n.label && (n.collapsible ? /* @__PURE__ */ a(g, { defaultOpen: !0, className: "group/collapsible", children: [
62
+ /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ a(N, { children: [
63
+ n.label,
64
+ /* @__PURE__ */ e(u, { className: "ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180" })
65
+ ] }) }),
66
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(c, { children: n.items.map((l) => /* @__PURE__ */ e(o, { children: /* @__PURE__ */ e(d, { asChild: !0, isActive: l.isActive, children: /* @__PURE__ */ a("a", { href: l.href, children: [
67
+ l.icon && /* @__PURE__ */ e(l.icon, {}),
68
+ /* @__PURE__ */ e("span", { children: l.label })
69
+ ] }) }) }, l.href)) }) }) })
70
+ ] }) : /* @__PURE__ */ e(b, { children: n.label })),
71
+ !n.collapsible && /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(c, { children: n.items.map((l) => /* @__PURE__ */ e(o, { children: l.items && l.items.length > 0 ? /* @__PURE__ */ a(g, { className: "group/collapsible", children: [
72
+ /* @__PURE__ */ e(d, { asChild: !0, isActive: l.isActive, children: /* @__PURE__ */ a(N, { children: [
73
+ l.icon && /* @__PURE__ */ e(l.icon, {}),
74
+ /* @__PURE__ */ e("span", { children: l.label }),
75
+ /* @__PURE__ */ e(u, { className: "ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180" })
76
+ ] }) }),
77
+ /* @__PURE__ */ e(x, { children: /* @__PURE__ */ e(q, { children: l.items.map((t) => /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(H, { asChild: !0, isActive: t.isActive, children: /* @__PURE__ */ e("a", { href: t.href, children: /* @__PURE__ */ e("span", { children: t.label }) }) }) }, t.href)) }) })
78
+ ] }) : /* @__PURE__ */ e(d, { asChild: !0, isActive: l.isActive, children: /* @__PURE__ */ a("a", { href: l.href, children: [
79
+ l.icon && /* @__PURE__ */ e(l.icon, {}),
80
+ /* @__PURE__ */ e("span", { children: l.label })
81
+ ] }) }) }, l.href)) }) })
82
+ ] }, n.label || h)) }),
83
+ /* @__PURE__ */ a(J, { children: [
84
+ I && /* @__PURE__ */ e(G, {}),
85
+ r.user && /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(o, { children: /* @__PURE__ */ a(P, { children: [
86
+ /* @__PURE__ */ e(Q, { asChild: !0, children: /* @__PURE__ */ a(
87
+ d,
88
+ {
89
+ size: "lg",
90
+ className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
91
+ children: [
92
+ /* @__PURE__ */ a(v, { className: "h-8 w-8 rounded-lg", children: [
93
+ /* @__PURE__ */ e(C, { src: r.user.avatar, alt: r.user.name }),
94
+ /* @__PURE__ */ e(S, { className: "rounded-lg", children: "CN" })
95
+ ] }),
96
+ /* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
97
+ /* @__PURE__ */ e("span", { className: "truncate font-semibold", children: r.user.name }),
98
+ /* @__PURE__ */ e("span", { className: "truncate text-xs", children: r.user.email })
99
+ ] }),
100
+ /* @__PURE__ */ e(u, { className: "ml-auto size-4" })
101
+ ]
102
+ }
103
+ ) }),
104
+ /* @__PURE__ */ a(
105
+ R,
106
+ {
107
+ className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
108
+ side: "bottom",
109
+ align: "end",
110
+ sideOffset: 4,
111
+ children: [
112
+ /* @__PURE__ */ e(U, { className: "p-0 font-normal", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
113
+ /* @__PURE__ */ a(v, { className: "h-8 w-8 rounded-lg", children: [
114
+ /* @__PURE__ */ e(C, { src: r.user.avatar, alt: r.user.name }),
115
+ /* @__PURE__ */ e(S, { className: "rounded-lg", children: "CN" })
116
+ ] }),
117
+ /* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
118
+ /* @__PURE__ */ e("span", { className: "truncate font-semibold", children: r.user.name }),
119
+ /* @__PURE__ */ e("span", { className: "truncate text-xs", children: r.user.email })
120
+ ] })
121
+ ] }) }),
122
+ /* @__PURE__ */ e(V, {}),
123
+ r.userMenuItems?.map((n, h) => /* @__PURE__ */ e(M, { asChild: !0, children: /* @__PURE__ */ a("a", { href: n.href || "#", onClick: n.onClick, children: [
124
+ n.icon && /* @__PURE__ */ e(n.icon, { className: "mr-2 h-4 w-4" }),
125
+ /* @__PURE__ */ e("span", { children: n.label })
126
+ ] }) }, h)),
127
+ !r.userMenuItems && /* @__PURE__ */ a(M, { children: [
128
+ /* @__PURE__ */ e(k, { className: "mr-2 h-4 w-4" }),
129
+ /* @__PURE__ */ e("span", { children: "Log out" })
130
+ ] })
131
+ ]
132
+ }
133
+ )
134
+ ] }) }) }),
135
+ r.footer
136
+ ] })
137
+ ]
138
+ }
139
+ );
140
+ }
141
+ export {
142
+ ne as AppSidebar
143
+ };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Client-only theme toggle component for sidebar footer.
3
+ * This component uses next-themes hooks and must remain client-side.
4
+ */
5
+ export declare function SidebarThemeToggle(): import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -2,10 +2,10 @@
2
2
  "name": "react-shadcn-kit",
3
3
  "author": "Tushar Yadav",
4
4
  "private": false,
5
- "version": "0.0.3",
5
+ "version": "0.0.5",
6
6
  "type": "module",
7
- "main": "dist/index.js",
8
- "module": "dist/index.js",
7
+ "main": "dist/cjs/index.js",
8
+ "module": "dist/es/index.js",
9
9
  "types": "dist/index.d.ts",
10
10
  "files": [
11
11
  "dist"
@@ -16,35 +16,43 @@
16
16
  "exports": {
17
17
  ".": {
18
18
  "types": "./dist/index.d.ts",
19
- "import": "./dist/index.js"
19
+ "import": "./dist/es/index.js",
20
+ "require": "./dist/cjs/index.js"
20
21
  },
21
22
  "./atoms/*": {
22
23
  "types": "./dist/atoms/*.d.ts",
23
- "import": "./dist/atoms/*.js"
24
+ "import": "./dist/es/atoms/*.js",
25
+ "require": "./dist/cjs/atoms/*.js"
24
26
  },
25
27
  "./molecules/*": {
26
28
  "types": "./dist/molecules/*.d.ts",
27
- "import": "./dist/molecules/*.js"
29
+ "import": "./dist/es/molecules/*.js",
30
+ "require": "./dist/cjs/molecules/*.js"
28
31
  },
29
32
  "./organisms/*": {
30
33
  "types": "./dist/organisms/*.d.ts",
31
- "import": "./dist/organisms/*.js"
34
+ "import": "./dist/es/organisms/*.js",
35
+ "require": "./dist/cjs/organisms/*.js"
32
36
  },
33
37
  "./layouts/*": {
34
38
  "types": "./dist/layouts/*.d.ts",
35
- "import": "./dist/layouts/*.js"
39
+ "import": "./dist/es/layouts/*.js",
40
+ "require": "./dist/cjs/layouts/*.js"
36
41
  },
37
42
  "./hooks/*": {
38
43
  "types": "./dist/hooks/*.d.ts",
39
- "import": "./dist/hooks/*.js"
44
+ "import": "./dist/es/hooks/*.js",
45
+ "require": "./dist/cjs/hooks/*.js"
40
46
  },
41
47
  "./lib/*": {
42
48
  "types": "./dist/lib/*.d.ts",
43
- "import": "./dist/lib/*.js"
49
+ "import": "./dist/es/lib/*.js",
50
+ "require": "./dist/cjs/lib/*.js"
44
51
  },
45
52
  "./config/*": {
46
53
  "types": "./dist/config/*.d.ts",
47
- "import": "./dist/config/*.js"
54
+ "import": "./dist/es/config/*.js",
55
+ "require": "./dist/cjs/config/*.js"
48
56
  }
49
57
  },
50
58
  "scripts": {
@@ -1,169 +0,0 @@
1
- import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
- import { ChevronDown as m, Sun as B, Moon as F, LogOut as E } from "lucide-react";
3
- import { useTheme as H } from "next-themes";
4
- import { Sidebar as J, SidebarHeader as f, SidebarMenu as d, SidebarMenuItem as c, SidebarMenuButton as t, SidebarContent as K, SidebarGroup as P, SidebarGroupLabel as g, SidebarGroupContent as N, SidebarMenuSub as Q, SidebarMenuSubItem as R, SidebarMenuSubButton as U, SidebarFooter as V } from "../atoms/sidebar.js";
5
- import { Collapsible as x, CollapsibleTrigger as v, CollapsibleContent as C } from "../atoms/collapsible.js";
6
- import { cn as W } from "../lib/utils.js";
7
- import { defaultSidebarConfig as n } from "../config/default-Sidebar.js";
8
- import { defaultSidebarStyles as b } from "../config/sidebar.config.js";
9
- import { Avatar as S, AvatarImage as w, AvatarFallback as M } from "../atoms/avatar.js";
10
- import { DropdownMenu as y, DropdownMenuTrigger as k, DropdownMenuContent as A, DropdownMenuItem as o, DropdownMenuLabel as X, DropdownMenuSeparator as Y } from "../atoms/dropdown-menu.js";
11
- function te({
12
- config: i,
13
- side: z = "left",
14
- variant: D,
15
- collapsible: I,
16
- hideBranding: T = !1,
17
- showThemeToggle: L = !0,
18
- className: j,
19
- style: O,
20
- scrollable: G,
21
- ...q
22
- }) {
23
- const { setTheme: u } = H(), r = {
24
- groups: i?.groups || n.groups,
25
- header: i?.header || n.header,
26
- footer: i?.footer || n.footer,
27
- user: i?.user || n.user,
28
- userMenuItems: i?.userMenuItems || n.userMenuItems,
29
- branding: T ? void 0 : i?.branding || n.branding,
30
- fixed: i?.fixed ?? n.fixed,
31
- variant: D ?? i?.variant ?? b.variant,
32
- collapsible: I ?? i?.collapsible ?? b.collapsible,
33
- scrollable: G ?? i?.scrollable ?? !1,
34
- style: { ...b.style, ...i?.style, ...O },
35
- className: i?.className
36
- };
37
- return /* @__PURE__ */ a(
38
- J,
39
- {
40
- side: z,
41
- variant: r.variant,
42
- collapsible: r.collapsible,
43
- scrollable: r.scrollable,
44
- className: W(
45
- r.fixed ? void 0 : "absolute h-full",
46
- r.className,
47
- j
48
- ),
49
- style: r.style,
50
- ...q,
51
- children: [
52
- r.header && /* @__PURE__ */ e(f, { children: r.header }),
53
- r.branding && !r.header && /* @__PURE__ */ e(f, { children: /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(t, { size: "lg", asChild: !0, children: /* @__PURE__ */ a("a", { href: r.branding.href || "#", children: [
54
- /* @__PURE__ */ e("div", { className: "bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg", children: r.branding.logo && /* @__PURE__ */ e(r.branding.logo, { className: "size-4" }) }),
55
- /* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
56
- /* @__PURE__ */ e("span", { className: "truncate font-semibold", children: r.branding.name }),
57
- /* @__PURE__ */ e("span", { className: "truncate text-xs", children: "Enterprise" })
58
- ] })
59
- ] }) }) }) }) }),
60
- /* @__PURE__ */ e(K, { children: r.groups.map((s, p) => /* @__PURE__ */ a(P, { children: [
61
- s.label && (s.collapsible ? /* @__PURE__ */ a(x, { defaultOpen: !0, className: "group/collapsible", children: [
62
- /* @__PURE__ */ e(g, { asChild: !0, children: /* @__PURE__ */ a(v, { children: [
63
- s.label,
64
- /* @__PURE__ */ e(m, { className: "ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180" })
65
- ] }) }),
66
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(d, { children: s.items.map((l) => /* @__PURE__ */ e(c, { children: /* @__PURE__ */ e(t, { asChild: !0, isActive: l.isActive, children: /* @__PURE__ */ a("a", { href: l.href, children: [
67
- l.icon && /* @__PURE__ */ e(l.icon, {}),
68
- /* @__PURE__ */ e("span", { children: l.label })
69
- ] }) }) }, l.href)) }) }) })
70
- ] }) : /* @__PURE__ */ e(g, { children: s.label })),
71
- !s.collapsible && /* @__PURE__ */ e(N, { children: /* @__PURE__ */ e(d, { children: s.items.map((l) => /* @__PURE__ */ e(c, { children: l.items && l.items.length > 0 ? /* @__PURE__ */ a(x, { className: "group/collapsible", children: [
72
- /* @__PURE__ */ e(t, { asChild: !0, isActive: l.isActive, children: /* @__PURE__ */ a(v, { children: [
73
- l.icon && /* @__PURE__ */ e(l.icon, {}),
74
- /* @__PURE__ */ e("span", { children: l.label }),
75
- /* @__PURE__ */ e(m, { className: "ml-auto transition-transform group-data-[state=open]/collapsible:rotate-180" })
76
- ] }) }),
77
- /* @__PURE__ */ e(C, { children: /* @__PURE__ */ e(Q, { children: l.items.map((h) => /* @__PURE__ */ e(R, { children: /* @__PURE__ */ e(U, { asChild: !0, isActive: h.isActive, children: /* @__PURE__ */ e("a", { href: h.href, children: /* @__PURE__ */ e("span", { children: h.label }) }) }) }, h.href)) }) })
78
- ] }) : /* @__PURE__ */ e(t, { asChild: !0, isActive: l.isActive, children: /* @__PURE__ */ a("a", { href: l.href, children: [
79
- l.icon && /* @__PURE__ */ e(l.icon, {}),
80
- /* @__PURE__ */ e("span", { children: l.label })
81
- ] }) }) }, l.href)) }) })
82
- ] }, s.label || p)) }),
83
- /* @__PURE__ */ a(V, { children: [
84
- L && /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ a(y, { children: [
85
- /* @__PURE__ */ e(k, { asChild: !0, children: /* @__PURE__ */ a(t, { size: "lg", children: [
86
- /* @__PURE__ */ a("div", { className: "flex aspect-square size-8 items-center justify-center rounded-lg bg-sidebar-primary text-sidebar-primary-foreground", children: [
87
- /* @__PURE__ */ e(B, { className: "size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
88
- /* @__PURE__ */ e(F, { className: "absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" })
89
- ] }),
90
- /* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
91
- /* @__PURE__ */ e("span", { className: "truncate font-semibold", children: "Theme" }),
92
- /* @__PURE__ */ e("span", { className: "truncate text-xs", children: "Toggle theme" })
93
- ] }),
94
- /* @__PURE__ */ e(m, { className: "ml-auto size-4" })
95
- ] }) }),
96
- /* @__PURE__ */ a(
97
- A,
98
- {
99
- className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
100
- side: "bottom",
101
- align: "end",
102
- sideOffset: 4,
103
- children: [
104
- /* @__PURE__ */ e(o, { onClick: () => u("light"), children: "Light" }),
105
- /* @__PURE__ */ e(o, { onClick: () => u("dark"), children: "Dark" }),
106
- /* @__PURE__ */ e(o, { onClick: () => u("system"), children: "System" })
107
- ]
108
- }
109
- )
110
- ] }) }) }),
111
- r.user && /* @__PURE__ */ e(d, { children: /* @__PURE__ */ e(c, { children: /* @__PURE__ */ a(y, { children: [
112
- /* @__PURE__ */ e(k, { asChild: !0, children: /* @__PURE__ */ a(
113
- t,
114
- {
115
- size: "lg",
116
- className: "data-[state=open]:bg-sidebar-accent data-[state=open]:text-sidebar-accent-foreground",
117
- children: [
118
- /* @__PURE__ */ a(S, { className: "h-8 w-8 rounded-lg", children: [
119
- /* @__PURE__ */ e(w, { src: r.user.avatar, alt: r.user.name }),
120
- /* @__PURE__ */ e(M, { className: "rounded-lg", children: "CN" })
121
- ] }),
122
- /* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
123
- /* @__PURE__ */ e("span", { className: "truncate font-semibold", children: r.user.name }),
124
- /* @__PURE__ */ e("span", { className: "truncate text-xs", children: r.user.email })
125
- ] }),
126
- /* @__PURE__ */ e(m, { className: "ml-auto size-4" })
127
- ]
128
- }
129
- ) }),
130
- /* @__PURE__ */ a(
131
- A,
132
- {
133
- className: "w-(--radix-dropdown-menu-trigger-width) min-w-56 rounded-lg",
134
- side: "bottom",
135
- align: "end",
136
- sideOffset: 4,
137
- children: [
138
- /* @__PURE__ */ e(X, { className: "p-0 font-normal", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 px-1 py-1.5 text-left text-sm", children: [
139
- /* @__PURE__ */ a(S, { className: "h-8 w-8 rounded-lg", children: [
140
- /* @__PURE__ */ e(w, { src: r.user.avatar, alt: r.user.name }),
141
- /* @__PURE__ */ e(M, { className: "rounded-lg", children: "CN" })
142
- ] }),
143
- /* @__PURE__ */ a("div", { className: "grid flex-1 text-left text-sm leading-tight", children: [
144
- /* @__PURE__ */ e("span", { className: "truncate font-semibold", children: r.user.name }),
145
- /* @__PURE__ */ e("span", { className: "truncate text-xs", children: r.user.email })
146
- ] })
147
- ] }) }),
148
- /* @__PURE__ */ e(Y, {}),
149
- r.userMenuItems?.map((s, p) => /* @__PURE__ */ e(o, { asChild: !0, children: /* @__PURE__ */ a("a", { href: s.href || "#", onClick: s.onClick, children: [
150
- s.icon && /* @__PURE__ */ e(s.icon, { className: "mr-2 h-4 w-4" }),
151
- /* @__PURE__ */ e("span", { children: s.label })
152
- ] }) }, p)),
153
- !r.userMenuItems && /* @__PURE__ */ a(o, { children: [
154
- /* @__PURE__ */ e(E, { className: "mr-2 h-4 w-4" }),
155
- /* @__PURE__ */ e("span", { children: "Log out" })
156
- ] })
157
- ]
158
- }
159
- )
160
- ] }) }) }),
161
- r.footer
162
- ] })
163
- ]
164
- }
165
- );
166
- }
167
- export {
168
- te as AppSidebar
169
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes