create-croissant 0.1.39 → 0.1.41

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 (164) hide show
  1. package/dist/index.js +5 -5
  2. package/package.json +7 -10
  3. package/template/.oxlintignore +11 -0
  4. package/template/README.md +6 -6
  5. package/template/apps/desktop/README.md +1 -1
  6. package/template/apps/desktop/electron-builder.yml +6 -6
  7. package/template/apps/desktop/electron.vite.config.ts +8 -8
  8. package/template/apps/desktop/package.json +4 -13
  9. package/template/apps/desktop/src/main/index.ts +32 -32
  10. package/template/apps/desktop/src/preload/index.d.ts +3 -3
  11. package/template/apps/desktop/src/preload/index.ts +8 -8
  12. package/template/apps/desktop/src/renderer/src/App.tsx +5 -5
  13. package/template/apps/desktop/src/renderer/src/assets/base.css +4 -4
  14. package/template/apps/desktop/src/renderer/src/assets/main.css +3 -3
  15. package/template/apps/desktop/src/renderer/src/components/Versions.tsx +4 -4
  16. package/template/apps/desktop/src/renderer/src/main.tsx +7 -7
  17. package/template/apps/desktop/tsconfig.json +1 -4
  18. package/template/apps/desktop/tsconfig.node.json +1 -1
  19. package/template/apps/desktop/tsconfig.web.json +4 -11
  20. package/template/apps/mobile/app/(tabs)/_layout.tsx +11 -10
  21. package/template/apps/mobile/app/(tabs)/explore.tsx +29 -27
  22. package/template/apps/mobile/app/(tabs)/index.tsx +25 -24
  23. package/template/apps/mobile/app/_layout.tsx +8 -8
  24. package/template/apps/mobile/app/modal.tsx +6 -6
  25. package/template/apps/mobile/components/external-link.tsx +5 -5
  26. package/template/apps/mobile/components/haptic-tab.tsx +4 -4
  27. package/template/apps/mobile/components/hello-wave.tsx +5 -4
  28. package/template/apps/mobile/components/parallax-scroll-view.tsx +15 -13
  29. package/template/apps/mobile/components/themed-text.tsx +14 -14
  30. package/template/apps/mobile/components/themed-view.tsx +3 -3
  31. package/template/apps/mobile/components/ui/collapsible.tsx +14 -13
  32. package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +4 -4
  33. package/template/apps/mobile/components/ui/icon-symbol.tsx +9 -9
  34. package/template/apps/mobile/constants/theme.ts +19 -19
  35. package/template/apps/mobile/hooks/use-color-scheme.ts +1 -1
  36. package/template/apps/mobile/hooks/use-color-scheme.web.ts +3 -3
  37. package/template/apps/mobile/hooks/use-theme-color.ts +4 -4
  38. package/template/apps/mobile/package.json +3 -6
  39. package/template/apps/mobile/scripts/reset-project.js +2 -2
  40. package/template/apps/mobile/tsconfig.json +2 -9
  41. package/template/apps/platform/drizzle.config.ts +5 -5
  42. package/template/apps/platform/package.json +2 -6
  43. package/template/apps/platform/src/components/app-sidebar.tsx +60 -69
  44. package/template/apps/platform/src/components/login-form.tsx +32 -39
  45. package/template/apps/platform/src/components/search-form.tsx +5 -13
  46. package/template/apps/platform/src/components/signup-form.tsx +39 -49
  47. package/template/apps/platform/src/components/version-switcher.tsx +11 -21
  48. package/template/apps/platform/src/lib/auth-utils.ts +12 -14
  49. package/template/apps/platform/src/lib/orpc.ts +17 -17
  50. package/template/apps/platform/src/routeTree.gen.ts +264 -267
  51. package/template/apps/platform/src/router.tsx +5 -5
  52. package/template/apps/platform/src/routes/__root.tsx +13 -15
  53. package/template/apps/platform/src/routes/_auth/account.tsx +61 -50
  54. package/template/apps/platform/src/routes/_auth/dashboard.tsx +17 -17
  55. package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +13 -13
  56. package/template/apps/platform/src/routes/_auth/examples/ssr-orpc-auth.tsx +17 -17
  57. package/template/apps/platform/src/routes/_auth.tsx +5 -5
  58. package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +108 -88
  59. package/template/apps/platform/src/routes/_public/examples/isr.tsx +14 -14
  60. package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +92 -75
  61. package/template/apps/platform/src/routes/_public/index.tsx +22 -19
  62. package/template/apps/platform/src/routes/_public/login.tsx +4 -4
  63. package/template/apps/platform/src/routes/_public/signup.tsx +6 -5
  64. package/template/apps/platform/src/routes/_public.tsx +5 -5
  65. package/template/apps/platform/src/routes/api/auth/$.ts +13 -13
  66. package/template/apps/platform/src/routes/api/rpc.$.ts +13 -13
  67. package/template/apps/platform/tsconfig.json +1 -1
  68. package/template/apps/platform/vite.config.ts +8 -8
  69. package/template/docker-compose.yml +1 -1
  70. package/template/package.json +24 -22
  71. package/template/packages/auth/package.json +8 -12
  72. package/template/packages/auth/src/lib/auth.ts +1 -1
  73. package/template/packages/auth/tsconfig.json +1 -1
  74. package/template/packages/db/package.json +6 -10
  75. package/template/packages/db/src/index.ts +4 -4
  76. package/template/packages/db/src/schema.ts +2 -2
  77. package/template/packages/db/tsconfig.json +1 -1
  78. package/template/packages/orpc/package.json +6 -10
  79. package/template/packages/orpc/src/lib/planets.ts +39 -43
  80. package/template/packages/orpc/src/lib/router.ts +15 -15
  81. package/template/packages/orpc/tsconfig.json +1 -1
  82. package/template/packages/ui/package.json +8 -12
  83. package/template/packages/ui/src/components/accordion.tsx +20 -22
  84. package/template/packages/ui/src/components/alert-dialog.tsx +31 -56
  85. package/template/packages/ui/src/components/alert.tsx +15 -23
  86. package/template/packages/ui/src/components/aspect-ratio.tsx +3 -3
  87. package/template/packages/ui/src/components/avatar.tsx +19 -35
  88. package/template/packages/ui/src/components/badge.tsx +13 -17
  89. package/template/packages/ui/src/components/breadcrumb.tsx +22 -44
  90. package/template/packages/ui/src/components/button-group.tsx +16 -25
  91. package/template/packages/ui/src/components/button.tsx +8 -9
  92. package/template/packages/ui/src/components/calendar.tsx +43 -82
  93. package/template/packages/ui/src/components/card.tsx +15 -26
  94. package/template/packages/ui/src/components/carousel.tsx +70 -78
  95. package/template/packages/ui/src/components/chart.tsx +84 -117
  96. package/template/packages/ui/src/components/checkbox.tsx +8 -9
  97. package/template/packages/ui/src/components/collapsible.tsx +5 -9
  98. package/template/packages/ui/src/components/combobox.tsx +44 -68
  99. package/template/packages/ui/src/components/command.tsx +32 -47
  100. package/template/packages/ui/src/components/context-menu.tsx +45 -71
  101. package/template/packages/ui/src/components/dialog.tsx +29 -51
  102. package/template/packages/ui/src/components/direction.tsx +1 -4
  103. package/template/packages/ui/src/components/drawer.tsx +24 -38
  104. package/template/packages/ui/src/components/dropdown-menu.tsx +45 -55
  105. package/template/packages/ui/src/components/empty.tsx +16 -27
  106. package/template/packages/ui/src/components/field.tsx +49 -63
  107. package/template/packages/ui/src/components/hover-card.tsx +9 -14
  108. package/template/packages/ui/src/components/input-group.tsx +40 -52
  109. package/template/packages/ui/src/components/input-otp.tsx +17 -18
  110. package/template/packages/ui/src/components/input.tsx +6 -6
  111. package/template/packages/ui/src/components/item.tsx +31 -44
  112. package/template/packages/ui/src/components/kbd.tsx +5 -5
  113. package/template/packages/ui/src/components/label.tsx +6 -6
  114. package/template/packages/ui/src/components/menubar.tsx +51 -64
  115. package/template/packages/ui/src/components/mode-toggle.tsx +9 -15
  116. package/template/packages/ui/src/components/native-select.tsx +18 -24
  117. package/template/packages/ui/src/components/navigation-menu.tsx +28 -35
  118. package/template/packages/ui/src/components/pagination.tsx +19 -31
  119. package/template/packages/ui/src/components/popover.tsx +13 -26
  120. package/template/packages/ui/src/components/progress.tsx +13 -30
  121. package/template/packages/ui/src/components/radio-group.tsx +7 -7
  122. package/template/packages/ui/src/components/resizable.tsx +12 -20
  123. package/template/packages/ui/src/components/scroll-area.tsx +8 -12
  124. package/template/packages/ui/src/components/select.tsx +31 -42
  125. package/template/packages/ui/src/components/separator.tsx +6 -10
  126. package/template/packages/ui/src/components/sheet.tsx +25 -38
  127. package/template/packages/ui/src/components/sidebar.tsx +137 -170
  128. package/template/packages/ui/src/components/skeleton.tsx +3 -3
  129. package/template/packages/ui/src/components/slider.tsx +5 -5
  130. package/template/packages/ui/src/components/sonner.tsx +20 -24
  131. package/template/packages/ui/src/components/spinner.tsx +10 -5
  132. package/template/packages/ui/src/components/switch.tsx +6 -6
  133. package/template/packages/ui/src/components/table.tsx +18 -45
  134. package/template/packages/ui/src/components/tabs.tsx +14 -22
  135. package/template/packages/ui/src/components/textarea.tsx +5 -5
  136. package/template/packages/ui/src/components/theme-provider.tsx +43 -48
  137. package/template/packages/ui/src/components/toggle-group.tsx +18 -20
  138. package/template/packages/ui/src/components/toggle.tsx +9 -10
  139. package/template/packages/ui/src/components/tooltip.tsx +10 -22
  140. package/template/packages/ui/src/hooks/use-mobile.ts +11 -11
  141. package/template/packages/ui/src/lib/utils.ts +4 -4
  142. package/template/packages/ui/src/styles/globals.css +106 -106
  143. package/template/packages/ui/tsconfig.json +1 -1
  144. package/template/turbo.json +15 -6
  145. package/template/.prettierignore +0 -10
  146. package/template/apps/desktop/.prettierignore +0 -6
  147. package/template/apps/desktop/eslint.config.ts +0 -11
  148. package/template/apps/desktop/prettier.config.ts +0 -3
  149. package/template/apps/mobile/eslint.config.js +0 -10
  150. package/template/apps/platform/eslint.config.ts +0 -11
  151. package/template/apps/platform/prettier.config.ts +0 -3
  152. package/template/packages/auth/eslint.config.ts +0 -3
  153. package/template/packages/auth/prettier.config.ts +0 -3
  154. package/template/packages/config-eslint/index.ts +0 -24
  155. package/template/packages/config-eslint/package.json +0 -11
  156. package/template/packages/config-prettier/index.ts +0 -14
  157. package/template/packages/config-prettier/package.json +0 -7
  158. package/template/packages/db/eslint.config.ts +0 -3
  159. package/template/packages/db/prettier.config.ts +0 -3
  160. package/template/packages/orpc/eslint.config.ts +0 -3
  161. package/template/packages/orpc/prettier.config.ts +0 -3
  162. package/template/packages/ui/eslint.config.ts +0 -3
  163. package/template/packages/ui/prettier.config.ts +0 -3
  164. package/template/prettier.config.ts +0 -15
@@ -1,57 +1,53 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { mergeProps } from "@base-ui/react/merge-props"
5
- import { useRender } from "@base-ui/react/use-render"
6
- import { cva } from "class-variance-authority"
7
-
8
- import { PanelLeftIcon } from "lucide-react"
9
- import { useIsMobile } from "@workspace/ui/hooks/use-mobile"
10
- import { cn } from "@workspace/ui/lib/utils"
11
- import { Button } from "@workspace/ui/components/button"
12
- import { Input } from "@workspace/ui/components/input"
13
- import { Separator } from "@workspace/ui/components/separator"
1
+ "use client";
2
+
3
+ import * as React from "react";
4
+ import { mergeProps } from "@base-ui/react/merge-props";
5
+ import { useRender } from "@base-ui/react/use-render";
6
+ import { cva } from "class-variance-authority";
7
+
8
+ import { PanelLeftIcon } from "lucide-react";
9
+ import { useIsMobile } from "@workspace/ui/hooks/use-mobile";
10
+ import { cn } from "@workspace/ui/lib/utils";
11
+ import { Button } from "@workspace/ui/components/button";
12
+ import { Input } from "@workspace/ui/components/input";
13
+ import { Separator } from "@workspace/ui/components/separator";
14
14
  import {
15
15
  Sheet,
16
16
  SheetContent,
17
17
  SheetDescription,
18
18
  SheetHeader,
19
19
  SheetTitle,
20
- } from "@workspace/ui/components/sheet"
21
- import { Skeleton } from "@workspace/ui/components/skeleton"
22
- import {
23
- Tooltip,
24
- TooltipContent,
25
- TooltipTrigger,
26
- } from "@workspace/ui/components/tooltip"
27
- import type {VariantProps} from "class-variance-authority";
28
-
29
- const SIDEBAR_COOKIE_NAME = "sidebar_state"
30
- const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7
31
- const SIDEBAR_WIDTH = "16rem"
32
- const SIDEBAR_WIDTH_MOBILE = "18rem"
33
- const SIDEBAR_WIDTH_ICON = "3rem"
34
- const SIDEBAR_KEYBOARD_SHORTCUT = "b"
20
+ } from "@workspace/ui/components/sheet";
21
+ import { Skeleton } from "@workspace/ui/components/skeleton";
22
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@workspace/ui/components/tooltip";
23
+ import type { VariantProps } from "class-variance-authority";
24
+
25
+ const SIDEBAR_COOKIE_NAME = "sidebar_state";
26
+ const SIDEBAR_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
27
+ const SIDEBAR_WIDTH = "16rem";
28
+ const SIDEBAR_WIDTH_MOBILE = "18rem";
29
+ const SIDEBAR_WIDTH_ICON = "3rem";
30
+ const SIDEBAR_KEYBOARD_SHORTCUT = "b";
35
31
 
36
32
  type SidebarContextProps = {
37
- state: "expanded" | "collapsed"
38
- open: boolean
39
- setOpen: (open: boolean) => void
40
- openMobile: boolean
41
- setOpenMobile: (open: boolean) => void
42
- isMobile: boolean
43
- toggleSidebar: () => void
44
- }
33
+ state: "expanded" | "collapsed";
34
+ open: boolean;
35
+ setOpen: (open: boolean) => void;
36
+ openMobile: boolean;
37
+ setOpenMobile: (open: boolean) => void;
38
+ isMobile: boolean;
39
+ toggleSidebar: () => void;
40
+ };
45
41
 
46
- const SidebarContext = React.createContext<SidebarContextProps | null>(null)
42
+ const SidebarContext = React.createContext<SidebarContextProps | null>(null);
47
43
 
48
44
  function useSidebar() {
49
- const context = React.useContext(SidebarContext)
45
+ const context = React.useContext(SidebarContext);
50
46
  if (!context) {
51
- throw new Error("useSidebar must be used within a SidebarProvider.")
47
+ throw new Error("useSidebar must be used within a SidebarProvider.");
52
48
  }
53
49
 
54
- return context
50
+ return context;
55
51
  }
56
52
 
57
53
  function SidebarProvider({
@@ -63,58 +59,53 @@ function SidebarProvider({
63
59
  children,
64
60
  ...props
65
61
  }: React.ComponentProps<"div"> & {
66
- defaultOpen?: boolean
67
- open?: boolean
68
- onOpenChange?: (open: boolean) => void
62
+ defaultOpen?: boolean;
63
+ open?: boolean;
64
+ onOpenChange?: (open: boolean) => void;
69
65
  }) {
70
- const isMobile = useIsMobile()
71
- const [openMobile, setOpenMobile] = React.useState(false)
66
+ const isMobile = useIsMobile();
67
+ const [openMobile, setOpenMobile] = React.useState(false);
72
68
 
73
69
  // This is the internal state of the sidebar.
74
70
  // We use openProp and setOpenProp for control from outside the component.
75
- const [_open, _setOpen] = React.useState(defaultOpen)
76
- const open = openProp ?? _open
71
+ const [_open, _setOpen] = React.useState(defaultOpen);
72
+ const open = openProp ?? _open;
77
73
  const setOpen = React.useCallback(
78
74
  (value: boolean | ((value: boolean) => boolean)) => {
79
- const openState = typeof value === "function" ? value(open) : value
75
+ const openState = typeof value === "function" ? value(open) : value;
80
76
  if (setOpenProp) {
81
- setOpenProp(openState)
77
+ setOpenProp(openState);
82
78
  } else {
83
- _setOpen(openState)
79
+ _setOpen(openState);
84
80
  }
85
81
 
86
82
  // This sets the cookie to keep the sidebar state.
87
- document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`
83
+ document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
88
84
  },
89
- [setOpenProp, open]
90
- )
85
+ [setOpenProp, open],
86
+ );
91
87
 
92
88
  // Helper to toggle the sidebar.
93
89
  const toggleSidebar = React.useCallback(() => {
94
- return isMobile
95
- ? setOpenMobile((prevOpen) => !prevOpen)
96
- : setOpen((prevOpen) => !prevOpen)
97
- }, [isMobile, setOpen, setOpenMobile])
90
+ return isMobile ? setOpenMobile((prevOpen) => !prevOpen) : setOpen((prevOpen) => !prevOpen);
91
+ }, [isMobile, setOpen, setOpenMobile]);
98
92
 
99
93
  // Adds a keyboard shortcut to toggle the sidebar.
100
94
  React.useEffect(() => {
101
95
  const handleKeyDown = (event: KeyboardEvent) => {
102
- if (
103
- event.key === SIDEBAR_KEYBOARD_SHORTCUT &&
104
- (event.metaKey || event.ctrlKey)
105
- ) {
106
- event.preventDefault()
107
- toggleSidebar()
96
+ if (event.key === SIDEBAR_KEYBOARD_SHORTCUT && (event.metaKey || event.ctrlKey)) {
97
+ event.preventDefault();
98
+ toggleSidebar();
108
99
  }
109
- }
100
+ };
110
101
 
111
- window.addEventListener("keydown", handleKeyDown)
112
- return () => window.removeEventListener("keydown", handleKeyDown)
113
- }, [toggleSidebar])
102
+ window.addEventListener("keydown", handleKeyDown);
103
+ return () => window.removeEventListener("keydown", handleKeyDown);
104
+ }, [toggleSidebar]);
114
105
 
115
106
  // We add a state so that we can do data-state="expanded" or "collapsed".
116
107
  // This makes it easier to style the sidebar with Tailwind classes.
117
- const state = open ? "expanded" : "collapsed"
108
+ const state = open ? "expanded" : "collapsed";
118
109
 
119
110
  const contextValue = React.useMemo<SidebarContextProps>(
120
111
  () => ({
@@ -126,8 +117,8 @@ function SidebarProvider({
126
117
  setOpenMobile,
127
118
  toggleSidebar,
128
119
  }),
129
- [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar]
130
- )
120
+ [state, open, setOpen, isMobile, openMobile, setOpenMobile, toggleSidebar],
121
+ );
131
122
 
132
123
  return (
133
124
  <SidebarContext.Provider value={contextValue}>
@@ -142,14 +133,14 @@ function SidebarProvider({
142
133
  }
143
134
  className={cn(
144
135
  "group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar",
145
- className
136
+ className,
146
137
  )}
147
138
  {...props}
148
139
  >
149
140
  {children}
150
141
  </div>
151
142
  </SidebarContext.Provider>
152
- )
143
+ );
153
144
  }
154
145
 
155
146
  function Sidebar({
@@ -161,11 +152,11 @@ function Sidebar({
161
152
  dir,
162
153
  ...props
163
154
  }: React.ComponentProps<"div"> & {
164
- side?: "left" | "right"
165
- variant?: "sidebar" | "floating" | "inset"
166
- collapsible?: "offcanvas" | "icon" | "none"
155
+ side?: "left" | "right";
156
+ variant?: "sidebar" | "floating" | "inset";
157
+ collapsible?: "offcanvas" | "icon" | "none";
167
158
  }) {
168
- const { isMobile, state, openMobile, setOpenMobile } = useSidebar()
159
+ const { isMobile, state, openMobile, setOpenMobile } = useSidebar();
169
160
 
170
161
  if (collapsible === "none") {
171
162
  return (
@@ -173,13 +164,13 @@ function Sidebar({
173
164
  data-slot="sidebar"
174
165
  className={cn(
175
166
  "flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground",
176
- className
167
+ className,
177
168
  )}
178
169
  {...props}
179
170
  >
180
171
  {children}
181
172
  </div>
182
- )
173
+ );
183
174
  }
184
175
 
185
176
  if (isMobile) {
@@ -205,7 +196,7 @@ function Sidebar({
205
196
  <div className="flex h-full w-full flex-col">{children}</div>
206
197
  </SheetContent>
207
198
  </Sheet>
208
- )
199
+ );
209
200
  }
210
201
 
211
202
  return (
@@ -226,7 +217,7 @@ function Sidebar({
226
217
  "group-data-[side=right]:rotate-180",
227
218
  variant === "floating" || variant === "inset"
228
219
  ? "group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]"
229
- : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)"
220
+ : "group-data-[collapsible=icon]:w-(--sidebar-width-icon)",
230
221
  )}
231
222
  />
232
223
  <div
@@ -238,7 +229,7 @@ function Sidebar({
238
229
  variant === "floating" || variant === "inset"
239
230
  ? "p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]"
240
231
  : "group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",
241
- className
232
+ className,
242
233
  )}
243
234
  {...props}
244
235
  >
@@ -251,15 +242,11 @@ function Sidebar({
251
242
  </div>
252
243
  </div>
253
244
  </div>
254
- )
245
+ );
255
246
  }
256
247
 
257
- function SidebarTrigger({
258
- className,
259
- onClick,
260
- ...props
261
- }: React.ComponentProps<typeof Button>) {
262
- const { toggleSidebar } = useSidebar()
248
+ function SidebarTrigger({ className, onClick, ...props }: React.ComponentProps<typeof Button>) {
249
+ const { toggleSidebar } = useSidebar();
263
250
 
264
251
  return (
265
252
  <Button
@@ -269,19 +256,19 @@ function SidebarTrigger({
269
256
  size="icon-sm"
270
257
  className={cn(className)}
271
258
  onClick={(event) => {
272
- onClick?.(event)
273
- toggleSidebar()
259
+ onClick?.(event);
260
+ toggleSidebar();
274
261
  }}
275
262
  {...props}
276
263
  >
277
264
  <PanelLeftIcon />
278
265
  <span className="sr-only">Toggle Sidebar</span>
279
266
  </Button>
280
- )
267
+ );
281
268
  }
282
269
 
283
270
  function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
284
- const { toggleSidebar } = useSidebar()
271
+ const { toggleSidebar } = useSidebar();
285
272
 
286
273
  return (
287
274
  <button
@@ -298,11 +285,11 @@ function SidebarRail({ className, ...props }: React.ComponentProps<"button">) {
298
285
  "group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar",
299
286
  "[[data-side=left][data-collapsible=offcanvas]_&]:-right-2",
300
287
  "[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",
301
- className
288
+ className,
302
289
  )}
303
290
  {...props}
304
291
  />
305
- )
292
+ );
306
293
  }
307
294
 
308
295
  function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
@@ -311,17 +298,14 @@ function SidebarInset({ className, ...props }: React.ComponentProps<"main">) {
311
298
  data-slot="sidebar-inset"
312
299
  className={cn(
313
300
  "relative flex w-full flex-1 flex-col 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]:shadow-sm md:peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2",
314
- className
301
+ className,
315
302
  )}
316
303
  {...props}
317
304
  />
318
- )
305
+ );
319
306
  }
320
307
 
321
- function SidebarInput({
322
- className,
323
- ...props
324
- }: React.ComponentProps<typeof Input>) {
308
+ function SidebarInput({ className, ...props }: React.ComponentProps<typeof Input>) {
325
309
  return (
326
310
  <Input
327
311
  data-slot="sidebar-input"
@@ -329,7 +313,7 @@ function SidebarInput({
329
313
  className={cn("h-8 w-full bg-background shadow-none", className)}
330
314
  {...props}
331
315
  />
332
- )
316
+ );
333
317
  }
334
318
 
335
319
  function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
@@ -340,7 +324,7 @@ function SidebarHeader({ className, ...props }: React.ComponentProps<"div">) {
340
324
  className={cn("flex flex-col gap-2 p-2", className)}
341
325
  {...props}
342
326
  />
343
- )
327
+ );
344
328
  }
345
329
 
346
330
  function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
@@ -351,13 +335,10 @@ function SidebarFooter({ className, ...props }: React.ComponentProps<"div">) {
351
335
  className={cn("flex flex-col gap-2 p-2", className)}
352
336
  {...props}
353
337
  />
354
- )
338
+ );
355
339
  }
356
340
 
357
- function SidebarSeparator({
358
- className,
359
- ...props
360
- }: React.ComponentProps<typeof Separator>) {
341
+ function SidebarSeparator({ className, ...props }: React.ComponentProps<typeof Separator>) {
361
342
  return (
362
343
  <Separator
363
344
  data-slot="sidebar-separator"
@@ -365,7 +346,7 @@ function SidebarSeparator({
365
346
  className={cn("mx-2 w-auto bg-sidebar-border", className)}
366
347
  {...props}
367
348
  />
368
- )
349
+ );
369
350
  }
370
351
 
371
352
  function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
@@ -375,11 +356,11 @@ function SidebarContent({ className, ...props }: React.ComponentProps<"div">) {
375
356
  data-sidebar="content"
376
357
  className={cn(
377
358
  "no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden",
378
- className
359
+ className,
379
360
  )}
380
361
  {...props}
381
362
  />
382
- )
363
+ );
383
364
  }
384
365
 
385
366
  function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
@@ -390,7 +371,7 @@ function SidebarGroup({ className, ...props }: React.ComponentProps<"div">) {
390
371
  className={cn("relative flex w-full min-w-0 flex-col p-2", className)}
391
372
  {...props}
392
373
  />
393
- )
374
+ );
394
375
  }
395
376
 
396
377
  function SidebarGroupLabel({
@@ -404,17 +385,17 @@ function SidebarGroupLabel({
404
385
  {
405
386
  className: cn(
406
387
  "flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0",
407
- className
388
+ className,
408
389
  ),
409
390
  },
410
- props
391
+ props,
411
392
  ),
412
393
  render,
413
394
  state: {
414
395
  slot: "sidebar-group-label",
415
396
  sidebar: "group-label",
416
397
  },
417
- })
398
+ });
418
399
  }
419
400
 
420
401
  function SidebarGroupAction({
@@ -428,23 +409,20 @@ function SidebarGroupAction({
428
409
  {
429
410
  className: cn(
430
411
  "absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
431
- className
412
+ className,
432
413
  ),
433
414
  },
434
- props
415
+ props,
435
416
  ),
436
417
  render,
437
418
  state: {
438
419
  slot: "sidebar-group-action",
439
420
  sidebar: "group-action",
440
421
  },
441
- })
422
+ });
442
423
  }
443
424
 
444
- function SidebarGroupContent({
445
- className,
446
- ...props
447
- }: React.ComponentProps<"div">) {
425
+ function SidebarGroupContent({ className, ...props }: React.ComponentProps<"div">) {
448
426
  return (
449
427
  <div
450
428
  data-slot="sidebar-group-content"
@@ -452,7 +430,7 @@ function SidebarGroupContent({
452
430
  className={cn("w-full text-sm", className)}
453
431
  {...props}
454
432
  />
455
- )
433
+ );
456
434
  }
457
435
 
458
436
  function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
@@ -463,7 +441,7 @@ function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">) {
463
441
  className={cn("flex w-full min-w-0 flex-col gap-0", className)}
464
442
  {...props}
465
443
  />
466
- )
444
+ );
467
445
  }
468
446
 
469
447
  function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
@@ -474,7 +452,7 @@ function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">) {
474
452
  className={cn("group/menu-item relative", className)}
475
453
  {...props}
476
454
  />
477
- )
455
+ );
478
456
  }
479
457
 
480
458
  const sidebarMenuButtonVariants = cva(
@@ -496,8 +474,8 @@ const sidebarMenuButtonVariants = cva(
496
474
  variant: "default",
497
475
  size: "default",
498
476
  },
499
- }
500
- )
477
+ },
478
+ );
501
479
 
502
480
  function SidebarMenuButton({
503
481
  render,
@@ -510,17 +488,17 @@ function SidebarMenuButton({
510
488
  ...props
511
489
  }: useRender.ComponentProps<"button"> &
512
490
  React.ComponentProps<"button"> & {
513
- isActive?: boolean
514
- tooltip?: string | React.ComponentProps<typeof TooltipContent>
491
+ isActive?: boolean;
492
+ tooltip?: string | React.ComponentProps<typeof TooltipContent>;
515
493
  } & VariantProps<typeof sidebarMenuButtonVariants>) {
516
- const { isMobile, state, setOpenMobile } = useSidebar()
494
+ const { isMobile, state, setOpenMobile } = useSidebar();
517
495
 
518
496
  const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
519
497
  if (isMobile) {
520
- setOpenMobile(false)
498
+ setOpenMobile(false);
521
499
  }
522
- onClick?.(event)
523
- }
500
+ onClick?.(event);
501
+ };
524
502
 
525
503
  const comp = useRender({
526
504
  defaultTagName: "button",
@@ -529,7 +507,7 @@ function SidebarMenuButton({
529
507
  className: cn(sidebarMenuButtonVariants({ variant, size }), className),
530
508
  onClick: handleClick,
531
509
  },
532
- props
510
+ props,
533
511
  ),
534
512
  render: !tooltip ? render : <TooltipTrigger render={render} />,
535
513
  state: {
@@ -538,16 +516,16 @@ function SidebarMenuButton({
538
516
  size,
539
517
  active: isActive,
540
518
  },
541
- })
519
+ });
542
520
 
543
521
  if (!tooltip) {
544
- return comp
522
+ return comp;
545
523
  }
546
524
 
547
525
  if (typeof tooltip === "string") {
548
526
  tooltip = {
549
527
  children: tooltip,
550
- }
528
+ };
551
529
  }
552
530
 
553
531
  return (
@@ -560,7 +538,7 @@ function SidebarMenuButton({
560
538
  {...tooltip}
561
539
  />
562
540
  </Tooltip>
563
- )
541
+ );
564
542
  }
565
543
 
566
544
  function SidebarMenuAction({
@@ -570,7 +548,7 @@ function SidebarMenuAction({
570
548
  ...props
571
549
  }: useRender.ComponentProps<"button"> &
572
550
  React.ComponentProps<"button"> & {
573
- showOnHover?: boolean
551
+ showOnHover?: boolean;
574
552
  }) {
575
553
  return useRender({
576
554
  defaultTagName: "button",
@@ -580,34 +558,31 @@ function SidebarMenuAction({
580
558
  "absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0",
581
559
  showOnHover &&
582
560
  "group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0",
583
- className
561
+ className,
584
562
  ),
585
563
  },
586
- props
564
+ props,
587
565
  ),
588
566
  render,
589
567
  state: {
590
568
  slot: "sidebar-menu-action",
591
569
  sidebar: "menu-action",
592
570
  },
593
- })
571
+ });
594
572
  }
595
573
 
596
- function SidebarMenuBadge({
597
- className,
598
- ...props
599
- }: React.ComponentProps<"div">) {
574
+ function SidebarMenuBadge({ className, ...props }: React.ComponentProps<"div">) {
600
575
  return (
601
576
  <div
602
577
  data-slot="sidebar-menu-badge"
603
578
  data-sidebar="menu-badge"
604
579
  className={cn(
605
580
  "pointer-events-none absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium text-sidebar-foreground tabular-nums select-none group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 peer-data-active/menu-button:text-sidebar-accent-foreground",
606
- className
581
+ className,
607
582
  )}
608
583
  {...props}
609
584
  />
610
- )
585
+ );
611
586
  }
612
587
 
613
588
  function SidebarMenuSkeleton({
@@ -615,12 +590,12 @@ function SidebarMenuSkeleton({
615
590
  showIcon = false,
616
591
  ...props
617
592
  }: React.ComponentProps<"div"> & {
618
- showIcon?: boolean
593
+ showIcon?: boolean;
619
594
  }) {
620
595
  // Random width between 50 to 90%.
621
596
  const [width] = React.useState(() => {
622
- return `${Math.floor(Math.random() * 40) + 50}%`
623
- })
597
+ return `${Math.floor(Math.random() * 40) + 50}%`;
598
+ });
624
599
 
625
600
  return (
626
601
  <div
@@ -629,12 +604,7 @@ function SidebarMenuSkeleton({
629
604
  className={cn("flex h-8 items-center gap-2 rounded-md px-2", className)}
630
605
  {...props}
631
606
  >
632
- {showIcon && (
633
- <Skeleton
634
- className="size-4 rounded-md"
635
- data-sidebar="menu-skeleton-icon"
636
- />
637
- )}
607
+ {showIcon && <Skeleton className="size-4 rounded-md" data-sidebar="menu-skeleton-icon" />}
638
608
  <Skeleton
639
609
  className="h-4 max-w-(--skeleton-width) flex-1"
640
610
  data-sidebar="menu-skeleton-text"
@@ -645,7 +615,7 @@ function SidebarMenuSkeleton({
645
615
  }
646
616
  />
647
617
  </div>
648
- )
618
+ );
649
619
  }
650
620
 
651
621
  function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
@@ -655,17 +625,14 @@ function SidebarMenuSub({ className, ...props }: React.ComponentProps<"ul">) {
655
625
  data-sidebar="menu-sub"
656
626
  className={cn(
657
627
  "mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden",
658
- className
628
+ className,
659
629
  )}
660
630
  {...props}
661
631
  />
662
- )
632
+ );
663
633
  }
664
634
 
665
- function SidebarMenuSubItem({
666
- className,
667
- ...props
668
- }: React.ComponentProps<"li">) {
635
+ function SidebarMenuSubItem({ className, ...props }: React.ComponentProps<"li">) {
669
636
  return (
670
637
  <li
671
638
  data-slot="sidebar-menu-sub-item"
@@ -673,7 +640,7 @@ function SidebarMenuSubItem({
673
640
  className={cn("group/menu-sub-item relative", className)}
674
641
  {...props}
675
642
  />
676
- )
643
+ );
677
644
  }
678
645
 
679
646
  function SidebarMenuSubButton({
@@ -684,8 +651,8 @@ function SidebarMenuSubButton({
684
651
  ...props
685
652
  }: useRender.ComponentProps<"a"> &
686
653
  React.ComponentProps<"a"> & {
687
- size?: "sm" | "md"
688
- isActive?: boolean
654
+ size?: "sm" | "md";
655
+ isActive?: boolean;
689
656
  }) {
690
657
  return useRender({
691
658
  defaultTagName: "a",
@@ -693,10 +660,10 @@ function SidebarMenuSubButton({
693
660
  {
694
661
  className: cn(
695
662
  "flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground",
696
- className
663
+ className,
697
664
  ),
698
665
  },
699
- props
666
+ props,
700
667
  ),
701
668
  render,
702
669
  state: {
@@ -705,7 +672,7 @@ function SidebarMenuSubButton({
705
672
  size,
706
673
  active: isActive,
707
674
  },
708
- })
675
+ });
709
676
  }
710
677
 
711
678
  export {
@@ -733,4 +700,4 @@ export {
733
700
  SidebarSeparator,
734
701
  SidebarTrigger,
735
702
  useSidebar,
736
- }
703
+ };