create-croissant 0.1.39 → 0.1.40

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 (155) hide show
  1. package/package.json +9 -9
  2. package/template/README.md +4 -4
  3. package/template/apps/desktop/electron-builder.yml +6 -6
  4. package/template/apps/desktop/electron.vite.config.ts +8 -8
  5. package/template/apps/desktop/package.json +5 -5
  6. package/template/apps/desktop/src/main/index.ts +32 -32
  7. package/template/apps/desktop/src/preload/index.d.ts +3 -3
  8. package/template/apps/desktop/src/preload/index.ts +8 -8
  9. package/template/apps/desktop/src/renderer/src/App.tsx +5 -5
  10. package/template/apps/desktop/src/renderer/src/assets/base.css +4 -4
  11. package/template/apps/desktop/src/renderer/src/assets/main.css +3 -3
  12. package/template/apps/desktop/src/renderer/src/components/Versions.tsx +4 -4
  13. package/template/apps/desktop/src/renderer/src/main.tsx +7 -7
  14. package/template/apps/desktop/tsconfig.json +1 -4
  15. package/template/apps/desktop/tsconfig.node.json +7 -1
  16. package/template/apps/desktop/tsconfig.web.json +3 -9
  17. package/template/apps/mobile/app/(tabs)/_layout.tsx +11 -10
  18. package/template/apps/mobile/app/(tabs)/explore.tsx +29 -27
  19. package/template/apps/mobile/app/(tabs)/index.tsx +25 -24
  20. package/template/apps/mobile/app/_layout.tsx +8 -8
  21. package/template/apps/mobile/app/modal.tsx +6 -6
  22. package/template/apps/mobile/components/external-link.tsx +5 -5
  23. package/template/apps/mobile/components/haptic-tab.tsx +4 -4
  24. package/template/apps/mobile/components/hello-wave.tsx +5 -4
  25. package/template/apps/mobile/components/parallax-scroll-view.tsx +15 -13
  26. package/template/apps/mobile/components/themed-text.tsx +14 -14
  27. package/template/apps/mobile/components/themed-view.tsx +3 -3
  28. package/template/apps/mobile/components/ui/collapsible.tsx +14 -13
  29. package/template/apps/mobile/components/ui/icon-symbol.ios.tsx +4 -4
  30. package/template/apps/mobile/components/ui/icon-symbol.tsx +9 -9
  31. package/template/apps/mobile/constants/theme.ts +19 -19
  32. package/template/apps/mobile/hooks/use-color-scheme.ts +1 -1
  33. package/template/apps/mobile/hooks/use-color-scheme.web.ts +3 -3
  34. package/template/apps/mobile/hooks/use-theme-color.ts +4 -4
  35. package/template/apps/mobile/package.json +3 -3
  36. package/template/apps/mobile/scripts/reset-project.js +2 -2
  37. package/template/apps/mobile/tsconfig.json +2 -9
  38. package/template/apps/platform/drizzle.config.ts +5 -5
  39. package/template/apps/platform/package.json +4 -4
  40. package/template/apps/platform/src/components/app-sidebar.tsx +60 -69
  41. package/template/apps/platform/src/components/login-form.tsx +32 -39
  42. package/template/apps/platform/src/components/search-form.tsx +5 -13
  43. package/template/apps/platform/src/components/signup-form.tsx +39 -49
  44. package/template/apps/platform/src/components/version-switcher.tsx +11 -21
  45. package/template/apps/platform/src/lib/auth-utils.ts +12 -14
  46. package/template/apps/platform/src/lib/orpc.ts +17 -17
  47. package/template/apps/platform/src/router.tsx +5 -5
  48. package/template/apps/platform/src/routes/__root.tsx +13 -15
  49. package/template/apps/platform/src/routes/_auth/account.tsx +61 -50
  50. package/template/apps/platform/src/routes/_auth/dashboard.tsx +17 -17
  51. package/template/apps/platform/src/routes/_auth/examples/client-orpc-auth.tsx +13 -13
  52. package/template/apps/platform/src/routes/_auth/examples/ssr-orpc-auth.tsx +16 -16
  53. package/template/apps/platform/src/routes/_auth.tsx +5 -5
  54. package/template/apps/platform/src/routes/_public/examples/client-orpc.tsx +108 -88
  55. package/template/apps/platform/src/routes/_public/examples/isr.tsx +14 -14
  56. package/template/apps/platform/src/routes/_public/examples/ssr-orpc.tsx +92 -75
  57. package/template/apps/platform/src/routes/_public/index.tsx +22 -19
  58. package/template/apps/platform/src/routes/_public/login.tsx +4 -4
  59. package/template/apps/platform/src/routes/_public/signup.tsx +6 -5
  60. package/template/apps/platform/src/routes/_public.tsx +5 -5
  61. package/template/apps/platform/src/routes/api/auth/$.ts +13 -13
  62. package/template/apps/platform/src/routes/api/rpc.$.ts +13 -13
  63. package/template/apps/platform/vite.config.ts +8 -8
  64. package/template/docker-compose.yml +1 -1
  65. package/template/package.json +24 -22
  66. package/template/packages/auth/package.json +9 -9
  67. package/template/packages/auth/src/lib/auth.ts +1 -1
  68. package/template/packages/db/package.json +7 -7
  69. package/template/packages/db/src/index.ts +4 -4
  70. package/template/packages/db/src/schema.ts +2 -2
  71. package/template/packages/orpc/package.json +6 -6
  72. package/template/packages/orpc/src/lib/planets.ts +39 -43
  73. package/template/packages/orpc/src/lib/router.ts +15 -15
  74. package/template/packages/ui/package.json +10 -10
  75. package/template/packages/ui/src/components/accordion.tsx +20 -22
  76. package/template/packages/ui/src/components/alert-dialog.tsx +31 -56
  77. package/template/packages/ui/src/components/alert.tsx +15 -23
  78. package/template/packages/ui/src/components/aspect-ratio.tsx +3 -3
  79. package/template/packages/ui/src/components/avatar.tsx +19 -35
  80. package/template/packages/ui/src/components/badge.tsx +13 -17
  81. package/template/packages/ui/src/components/breadcrumb.tsx +22 -44
  82. package/template/packages/ui/src/components/button-group.tsx +16 -25
  83. package/template/packages/ui/src/components/button.tsx +8 -9
  84. package/template/packages/ui/src/components/calendar.tsx +43 -82
  85. package/template/packages/ui/src/components/card.tsx +15 -26
  86. package/template/packages/ui/src/components/carousel.tsx +70 -78
  87. package/template/packages/ui/src/components/chart.tsx +84 -117
  88. package/template/packages/ui/src/components/checkbox.tsx +8 -9
  89. package/template/packages/ui/src/components/collapsible.tsx +5 -9
  90. package/template/packages/ui/src/components/combobox.tsx +44 -68
  91. package/template/packages/ui/src/components/command.tsx +32 -47
  92. package/template/packages/ui/src/components/context-menu.tsx +45 -71
  93. package/template/packages/ui/src/components/dialog.tsx +29 -51
  94. package/template/packages/ui/src/components/direction.tsx +1 -4
  95. package/template/packages/ui/src/components/drawer.tsx +24 -38
  96. package/template/packages/ui/src/components/dropdown-menu.tsx +45 -55
  97. package/template/packages/ui/src/components/empty.tsx +16 -27
  98. package/template/packages/ui/src/components/field.tsx +49 -63
  99. package/template/packages/ui/src/components/hover-card.tsx +9 -14
  100. package/template/packages/ui/src/components/input-group.tsx +40 -52
  101. package/template/packages/ui/src/components/input-otp.tsx +17 -18
  102. package/template/packages/ui/src/components/input.tsx +6 -6
  103. package/template/packages/ui/src/components/item.tsx +31 -44
  104. package/template/packages/ui/src/components/kbd.tsx +5 -5
  105. package/template/packages/ui/src/components/label.tsx +6 -6
  106. package/template/packages/ui/src/components/menubar.tsx +51 -64
  107. package/template/packages/ui/src/components/mode-toggle.tsx +9 -15
  108. package/template/packages/ui/src/components/native-select.tsx +18 -24
  109. package/template/packages/ui/src/components/navigation-menu.tsx +28 -35
  110. package/template/packages/ui/src/components/pagination.tsx +19 -31
  111. package/template/packages/ui/src/components/popover.tsx +13 -26
  112. package/template/packages/ui/src/components/progress.tsx +13 -30
  113. package/template/packages/ui/src/components/radio-group.tsx +7 -7
  114. package/template/packages/ui/src/components/resizable.tsx +12 -20
  115. package/template/packages/ui/src/components/scroll-area.tsx +8 -12
  116. package/template/packages/ui/src/components/select.tsx +31 -42
  117. package/template/packages/ui/src/components/separator.tsx +6 -10
  118. package/template/packages/ui/src/components/sheet.tsx +25 -38
  119. package/template/packages/ui/src/components/sidebar.tsx +137 -170
  120. package/template/packages/ui/src/components/skeleton.tsx +3 -3
  121. package/template/packages/ui/src/components/slider.tsx +5 -5
  122. package/template/packages/ui/src/components/sonner.tsx +20 -24
  123. package/template/packages/ui/src/components/spinner.tsx +10 -5
  124. package/template/packages/ui/src/components/switch.tsx +6 -6
  125. package/template/packages/ui/src/components/table.tsx +18 -45
  126. package/template/packages/ui/src/components/tabs.tsx +14 -22
  127. package/template/packages/ui/src/components/textarea.tsx +5 -5
  128. package/template/packages/ui/src/components/theme-provider.tsx +43 -48
  129. package/template/packages/ui/src/components/toggle-group.tsx +18 -20
  130. package/template/packages/ui/src/components/toggle.tsx +9 -10
  131. package/template/packages/ui/src/components/tooltip.tsx +10 -22
  132. package/template/packages/ui/src/hooks/use-mobile.ts +11 -11
  133. package/template/packages/ui/src/lib/utils.ts +4 -4
  134. package/template/packages/ui/src/styles/globals.css +106 -106
  135. package/template/turbo.json +15 -6
  136. package/template/.prettierignore +0 -10
  137. package/template/apps/desktop/.prettierignore +0 -6
  138. package/template/apps/desktop/eslint.config.ts +0 -11
  139. package/template/apps/desktop/prettier.config.ts +0 -3
  140. package/template/apps/mobile/eslint.config.js +0 -10
  141. package/template/apps/platform/eslint.config.ts +0 -11
  142. package/template/apps/platform/prettier.config.ts +0 -3
  143. package/template/packages/auth/eslint.config.ts +0 -3
  144. package/template/packages/auth/prettier.config.ts +0 -3
  145. package/template/packages/config-eslint/index.ts +0 -24
  146. package/template/packages/config-eslint/package.json +0 -11
  147. package/template/packages/config-prettier/index.ts +0 -14
  148. package/template/packages/config-prettier/package.json +0 -7
  149. package/template/packages/db/eslint.config.ts +0 -3
  150. package/template/packages/db/prettier.config.ts +0 -3
  151. package/template/packages/orpc/eslint.config.ts +0 -3
  152. package/template/packages/orpc/prettier.config.ts +0 -3
  153. package/template/packages/ui/eslint.config.ts +0 -3
  154. package/template/packages/ui/prettier.config.ts +0 -3
  155. package/template/prettier.config.ts +0 -15
@@ -1,4 +1,4 @@
1
- import { cn } from "@workspace/ui/lib/utils"
1
+ import { cn } from "@workspace/ui/lib/utils";
2
2
 
3
3
  function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
4
  return (
@@ -7,7 +7,7 @@ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
7
7
  className={cn("animate-pulse rounded-md bg-muted", className)}
8
8
  {...props}
9
9
  />
10
- )
10
+ );
11
11
  }
12
12
 
13
- export { Skeleton }
13
+ export { Skeleton };
@@ -1,6 +1,6 @@
1
- import { Slider as SliderPrimitive } from "@base-ui/react/slider"
1
+ import { Slider as SliderPrimitive } from "@base-ui/react/slider";
2
2
 
3
- import { cn } from "@workspace/ui/lib/utils"
3
+ import { cn } from "@workspace/ui/lib/utils";
4
4
 
5
5
  function Slider({
6
6
  className,
@@ -14,7 +14,7 @@ function Slider({
14
14
  ? value
15
15
  : Array.isArray(defaultValue)
16
16
  ? defaultValue
17
- : [min, max]
17
+ : [min, max];
18
18
 
19
19
  return (
20
20
  <SliderPrimitive.Root
@@ -46,7 +46,7 @@ function Slider({
46
46
  ))}
47
47
  </SliderPrimitive.Control>
48
48
  </SliderPrimitive.Root>
49
- )
49
+ );
50
50
  }
51
51
 
52
- export { Slider }
52
+ export { Slider };
@@ -1,33 +1,29 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import { useTheme } from "next-themes"
4
- import { Toaster as Sonner } from "sonner"
5
- import { CircleCheckIcon, InfoIcon, Loader2Icon, OctagonXIcon, TriangleAlertIcon } from "lucide-react"
6
- import type {ToasterProps} from "sonner";
3
+ import { useTheme } from "next-themes";
4
+ import { Toaster as Sonner } from "sonner";
5
+ import {
6
+ CircleCheckIcon,
7
+ InfoIcon,
8
+ Loader2Icon,
9
+ OctagonXIcon,
10
+ TriangleAlertIcon,
11
+ } from "lucide-react";
12
+ import type { ToasterProps } from "sonner";
7
13
 
8
14
  const Toaster = ({ ...props }: ToasterProps) => {
9
- const { theme = "system" } = useTheme()
15
+ const { theme = "system" } = useTheme();
10
16
 
11
17
  return (
12
18
  <Sonner
13
19
  theme={theme as ToasterProps["theme"]}
14
20
  className="toaster group"
15
21
  icons={{
16
- success: (
17
- <CircleCheckIcon className="size-4" />
18
- ),
19
- info: (
20
- <InfoIcon className="size-4" />
21
- ),
22
- warning: (
23
- <TriangleAlertIcon className="size-4" />
24
- ),
25
- error: (
26
- <OctagonXIcon className="size-4" />
27
- ),
28
- loading: (
29
- <Loader2Icon className="size-4 animate-spin" />
30
- ),
22
+ success: <CircleCheckIcon className="size-4" />,
23
+ info: <InfoIcon className="size-4" />,
24
+ warning: <TriangleAlertIcon className="size-4" />,
25
+ error: <OctagonXIcon className="size-4" />,
26
+ loading: <Loader2Icon className="size-4 animate-spin" />,
31
27
  }}
32
28
  style={
33
29
  {
@@ -44,7 +40,7 @@ const Toaster = ({ ...props }: ToasterProps) => {
44
40
  }}
45
41
  {...props}
46
42
  />
47
- )
48
- }
43
+ );
44
+ };
49
45
 
50
- export { Toaster }
46
+ export { Toaster };
@@ -1,10 +1,15 @@
1
- import { Loader2Icon } from "lucide-react"
2
- import { cn } from "@workspace/ui/lib/utils"
1
+ import { Loader2Icon } from "lucide-react";
2
+ import { cn } from "@workspace/ui/lib/utils";
3
3
 
4
4
  function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
5
5
  return (
6
- <Loader2Icon role="status" aria-label="Loading" className={cn("size-4 animate-spin", className)} {...props} />
7
- )
6
+ <Loader2Icon
7
+ role="status"
8
+ aria-label="Loading"
9
+ className={cn("size-4 animate-spin", className)}
10
+ {...props}
11
+ />
12
+ );
8
13
  }
9
14
 
10
- export { Spinner }
15
+ export { Spinner };
@@ -1,13 +1,13 @@
1
- import { Switch as SwitchPrimitive } from "@base-ui/react/switch"
1
+ import { Switch as SwitchPrimitive } from "@base-ui/react/switch";
2
2
 
3
- import { cn } from "@workspace/ui/lib/utils"
3
+ import { cn } from "@workspace/ui/lib/utils";
4
4
 
5
5
  function Switch({
6
6
  className,
7
7
  size = "default",
8
8
  ...props
9
9
  }: SwitchPrimitive.Root.Props & {
10
- size?: "sm" | "default"
10
+ size?: "sm" | "default";
11
11
  }) {
12
12
  return (
13
13
  <SwitchPrimitive.Root
@@ -15,7 +15,7 @@ function Switch({
15
15
  data-size={size}
16
16
  className={cn(
17
17
  "peer group/switch relative inline-flex shrink-0 items-center rounded-full border border-transparent transition-all outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 data-[size=default]:h-[18.4px] data-[size=default]:w-[32px] data-[size=sm]:h-[14px] data-[size=sm]:w-[24px] dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:bg-primary data-unchecked:bg-input dark:data-unchecked:bg-input/80 data-disabled:cursor-not-allowed data-disabled:opacity-50",
18
- className
18
+ className,
19
19
  )}
20
20
  {...props}
21
21
  >
@@ -24,7 +24,7 @@ function Switch({
24
24
  className="pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 group-data-[size=default]/switch:data-checked:translate-x-[calc(100%-2px)] group-data-[size=sm]/switch:data-checked:translate-x-[calc(100%-2px)] dark:data-checked:bg-primary-foreground group-data-[size=default]/switch:data-unchecked:translate-x-0 group-data-[size=sm]/switch:data-unchecked:translate-x-0 dark:data-unchecked:bg-foreground"
25
25
  />
26
26
  </SwitchPrimitive.Root>
27
- )
27
+ );
28
28
  }
29
29
 
30
- export { Switch }
30
+ export { Switch };
@@ -1,32 +1,23 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import * as React from "react"
3
+ import * as React from "react";
4
4
 
5
- import { cn } from "@workspace/ui/lib/utils"
5
+ import { cn } from "@workspace/ui/lib/utils";
6
6
 
7
7
  function Table({ className, ...props }: React.ComponentProps<"table">) {
8
8
  return (
9
- <div
10
- data-slot="table-container"
11
- className="relative w-full overflow-x-auto"
12
- >
9
+ <div data-slot="table-container" className="relative w-full overflow-x-auto">
13
10
  <table
14
11
  data-slot="table"
15
12
  className={cn("w-full caption-bottom text-sm", className)}
16
13
  {...props}
17
14
  />
18
15
  </div>
19
- )
16
+ );
20
17
  }
21
18
 
22
19
  function TableHeader({ className, ...props }: React.ComponentProps<"thead">) {
23
- return (
24
- <thead
25
- data-slot="table-header"
26
- className={cn("[&_tr]:border-b", className)}
27
- {...props}
28
- />
29
- )
20
+ return <thead data-slot="table-header" className={cn("[&_tr]:border-b", className)} {...props} />;
30
21
  }
31
22
 
32
23
  function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
@@ -36,20 +27,17 @@ function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
36
27
  className={cn("[&_tr:last-child]:border-0", className)}
37
28
  {...props}
38
29
  />
39
- )
30
+ );
40
31
  }
41
32
 
42
33
  function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
43
34
  return (
44
35
  <tfoot
45
36
  data-slot="table-footer"
46
- className={cn(
47
- "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
48
- className
49
- )}
37
+ className={cn("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0", className)}
50
38
  {...props}
51
39
  />
52
- )
40
+ );
53
41
  }
54
42
 
55
43
  function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
@@ -58,11 +46,11 @@ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
58
46
  data-slot="table-row"
59
47
  className={cn(
60
48
  "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
61
- className
49
+ className,
62
50
  )}
63
51
  {...props}
64
52
  />
65
- )
53
+ );
66
54
  }
67
55
 
68
56
  function TableHead({ className, ...props }: React.ComponentProps<"th">) {
@@ -71,46 +59,31 @@ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
71
59
  data-slot="table-head"
72
60
  className={cn(
73
61
  "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0",
74
- className
62
+ className,
75
63
  )}
76
64
  {...props}
77
65
  />
78
- )
66
+ );
79
67
  }
80
68
 
81
69
  function TableCell({ className, ...props }: React.ComponentProps<"td">) {
82
70
  return (
83
71
  <td
84
72
  data-slot="table-cell"
85
- className={cn(
86
- "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0",
87
- className
88
- )}
73
+ className={cn("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0", className)}
89
74
  {...props}
90
75
  />
91
- )
76
+ );
92
77
  }
93
78
 
94
- function TableCaption({
95
- className,
96
- ...props
97
- }: React.ComponentProps<"caption">) {
79
+ function TableCaption({ className, ...props }: React.ComponentProps<"caption">) {
98
80
  return (
99
81
  <caption
100
82
  data-slot="table-caption"
101
83
  className={cn("mt-4 text-sm text-muted-foreground", className)}
102
84
  {...props}
103
85
  />
104
- )
86
+ );
105
87
  }
106
88
 
107
- export {
108
- Table,
109
- TableHeader,
110
- TableBody,
111
- TableFooter,
112
- TableHead,
113
- TableRow,
114
- TableCell,
115
- TableCaption,
116
- }
89
+ export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
@@ -1,25 +1,17 @@
1
- import { Tabs as TabsPrimitive } from "@base-ui/react/tabs"
2
- import { cva } from "class-variance-authority"
3
- import { cn } from "@workspace/ui/lib/utils"
4
- import type {VariantProps} from "class-variance-authority";
1
+ import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
2
+ import { cva } from "class-variance-authority";
3
+ import { cn } from "@workspace/ui/lib/utils";
4
+ import type { VariantProps } from "class-variance-authority";
5
5
 
6
-
7
- function Tabs({
8
- className,
9
- orientation = "horizontal",
10
- ...props
11
- }: TabsPrimitive.Root.Props) {
6
+ function Tabs({ className, orientation = "horizontal", ...props }: TabsPrimitive.Root.Props) {
12
7
  return (
13
8
  <TabsPrimitive.Root
14
9
  data-slot="tabs"
15
10
  data-orientation={orientation}
16
- className={cn(
17
- "group/tabs flex gap-2 data-horizontal:flex-col",
18
- className
19
- )}
11
+ className={cn("group/tabs flex gap-2 data-horizontal:flex-col", className)}
20
12
  {...props}
21
13
  />
22
- )
14
+ );
23
15
  }
24
16
 
25
17
  const tabsListVariants = cva(
@@ -34,8 +26,8 @@ const tabsListVariants = cva(
34
26
  defaultVariants: {
35
27
  variant: "default",
36
28
  },
37
- }
38
- )
29
+ },
30
+ );
39
31
 
40
32
  function TabsList({
41
33
  className,
@@ -49,7 +41,7 @@ function TabsList({
49
41
  className={cn(tabsListVariants({ variant }), className)}
50
42
  {...props}
51
43
  />
52
- )
44
+ );
53
45
  }
54
46
 
55
47
  function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
@@ -61,11 +53,11 @@ function TabsTrigger({ className, ...props }: TabsPrimitive.Tab.Props) {
61
53
  "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent",
62
54
  "data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground",
63
55
  "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100",
64
- className
56
+ className,
65
57
  )}
66
58
  {...props}
67
59
  />
68
- )
60
+ );
69
61
  }
70
62
 
71
63
  function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {
@@ -75,7 +67,7 @@ function TabsContent({ className, ...props }: TabsPrimitive.Panel.Props) {
75
67
  className={cn("flex-1 text-sm outline-none", className)}
76
68
  {...props}
77
69
  />
78
- )
70
+ );
79
71
  }
80
72
 
81
- export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
73
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
@@ -1,6 +1,6 @@
1
- import * as React from "react"
1
+ import * as React from "react";
2
2
 
3
- import { cn } from "@workspace/ui/lib/utils"
3
+ import { cn } from "@workspace/ui/lib/utils";
4
4
 
5
5
  function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
6
  return (
@@ -8,11 +8,11 @@ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
8
8
  data-slot="textarea"
9
9
  className={cn(
10
10
  "flex field-sizing-content min-h-16 w-full rounded-lg border border-input bg-transparent px-2.5 py-2 text-base transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",
11
- className
11
+ className,
12
12
  )}
13
13
  {...props}
14
14
  />
15
- )
15
+ );
16
16
  }
17
17
 
18
- export { Textarea }
18
+ export { Textarea };
@@ -1,43 +1,41 @@
1
- import { createContext, useContext, useEffect, useState } from "react"
2
- import { ScriptOnce } from "@tanstack/react-router"
1
+ import { createContext, useContext, useEffect, useState } from "react";
2
+ import { ScriptOnce } from "@tanstack/react-router";
3
3
 
4
- type Theme = "dark" | "light" | "system"
4
+ type Theme = "dark" | "light" | "system";
5
5
 
6
6
  type ThemeProviderProps = {
7
- children: React.ReactNode
8
- defaultTheme?: Theme
9
- storageKey?: string
10
- }
7
+ children: React.ReactNode;
8
+ defaultTheme?: Theme;
9
+ storageKey?: string;
10
+ };
11
11
 
12
12
  type ThemeProviderState = {
13
- theme: Theme
14
- setTheme: (theme: Theme) => void
15
- }
13
+ theme: Theme;
14
+ setTheme: (theme: Theme) => void;
15
+ };
16
16
 
17
17
  function getThemeScript(storageKey: string, defaultTheme: Theme) {
18
- const key = JSON.stringify(storageKey)
19
- const fallback = JSON.stringify(defaultTheme)
18
+ const key = JSON.stringify(storageKey);
19
+ const fallback = JSON.stringify(defaultTheme);
20
20
 
21
- return `(function(){try{var t=localStorage.getItem(${key});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${fallback}}var d=matchMedia('(prefers-color-scheme: dark)').matches;var r=t==='system'?(d?'dark':'light'):t;var e=document.documentElement;e.classList.add(r);e.style.colorScheme=r}catch(e){}})();`
21
+ return `(function(){try{var t=localStorage.getItem(${key});if(t!=='light'&&t!=='dark'&&t!=='system'){t=${fallback}}var d=matchMedia('(prefers-color-scheme: dark)').matches;var r=t==='system'?(d?'dark':'light'):t;var e=document.documentElement;e.classList.add(r);e.style.colorScheme=r}catch(e){}})();`;
22
22
  }
23
23
 
24
- const ThemeProviderContext = createContext<ThemeProviderState | undefined>(
25
- undefined
26
- )
24
+ const ThemeProviderContext = createContext<ThemeProviderState | undefined>(undefined);
27
25
 
28
26
  function applyTheme(theme: Theme) {
29
- const root = document.documentElement
30
- root.classList.remove("light", "dark")
27
+ const root = document.documentElement;
28
+ root.classList.remove("light", "dark");
31
29
 
32
30
  const resolved =
33
31
  theme === "system"
34
32
  ? window.matchMedia("(prefers-color-scheme: dark)").matches
35
33
  ? "dark"
36
34
  : "light"
37
- : theme
35
+ : theme;
38
36
 
39
- root.classList.add(resolved)
40
- root.style.colorScheme = resolved
37
+ root.classList.add(resolved);
38
+ root.style.colorScheme = resolved;
41
39
  }
42
40
 
43
41
  export function ThemeProvider({
@@ -45,49 +43,46 @@ export function ThemeProvider({
45
43
  defaultTheme = "system",
46
44
  storageKey = "theme",
47
45
  }: ThemeProviderProps) {
48
- const [theme, setThemeState] = useState<Theme>(defaultTheme)
49
- const [mounted, setMounted] = useState(false)
46
+ const [theme, setThemeState] = useState<Theme>(defaultTheme);
47
+ const [mounted, setMounted] = useState(false);
50
48
 
51
49
  useEffect(() => {
52
- const stored = localStorage.getItem(storageKey)
50
+ const stored = localStorage.getItem(storageKey);
53
51
  setThemeState(
54
- stored === "light" || stored === "dark" || stored === "system"
55
- ? stored
56
- : defaultTheme
57
- )
58
- setMounted(true)
59
- }, [defaultTheme, storageKey])
52
+ stored === "light" || stored === "dark" || stored === "system" ? stored : defaultTheme,
53
+ );
54
+ setMounted(true);
55
+ }, [defaultTheme, storageKey]);
60
56
 
61
57
  useEffect(() => {
62
- if (!mounted) return
63
- applyTheme(theme)
64
- }, [theme, mounted])
58
+ if (!mounted) return;
59
+ applyTheme(theme);
60
+ }, [theme, mounted]);
65
61
 
66
62
  useEffect(() => {
67
- if (!mounted || theme !== "system") return
63
+ if (!mounted || theme !== "system") return;
68
64
 
69
- const media = window.matchMedia("(prefers-color-scheme: dark)")
70
- const onChange = () => applyTheme("system")
71
- media.addEventListener("change", onChange)
72
- return () => media.removeEventListener("change", onChange)
73
- }, [theme, mounted])
65
+ const media = window.matchMedia("(prefers-color-scheme: dark)");
66
+ const onChange = () => applyTheme("system");
67
+ media.addEventListener("change", onChange);
68
+ return () => media.removeEventListener("change", onChange);
69
+ }, [theme, mounted]);
74
70
 
75
71
  const setTheme = (next: Theme) => {
76
- localStorage.setItem(storageKey, next)
77
- setThemeState(next)
78
- }
72
+ localStorage.setItem(storageKey, next);
73
+ setThemeState(next);
74
+ };
79
75
 
80
76
  return (
81
77
  <ThemeProviderContext value={{ theme, setTheme }}>
82
78
  <ScriptOnce>{getThemeScript(storageKey, defaultTheme)}</ScriptOnce>
83
79
  {children}
84
80
  </ThemeProviderContext>
85
- )
81
+ );
86
82
  }
87
83
 
88
84
  export function useTheme() {
89
- const context = useContext(ThemeProviderContext)
90
- if (context === undefined)
91
- throw new Error("useTheme must be used within a ThemeProvider")
92
- return context
93
- }
85
+ const context = useContext(ThemeProviderContext);
86
+ if (context === undefined) throw new Error("useTheme must be used within a ThemeProvider");
87
+ return context;
88
+ }
@@ -1,22 +1,22 @@
1
- import * as React from "react"
2
- import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
3
- import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group"
1
+ import * as React from "react";
2
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
3
+ import { ToggleGroup as ToggleGroupPrimitive } from "@base-ui/react/toggle-group";
4
4
 
5
- import { cn } from "@workspace/ui/lib/utils"
6
- import { toggleVariants } from "@workspace/ui/components/toggle"
7
- import type {VariantProps} from "class-variance-authority";
5
+ import { cn } from "@workspace/ui/lib/utils";
6
+ import { toggleVariants } from "@workspace/ui/components/toggle";
7
+ import type { VariantProps } from "class-variance-authority";
8
8
 
9
9
  const ToggleGroupContext = React.createContext<
10
10
  VariantProps<typeof toggleVariants> & {
11
- spacing?: number
12
- orientation?: "horizontal" | "vertical"
11
+ spacing?: number;
12
+ orientation?: "horizontal" | "vertical";
13
13
  }
14
14
  >({
15
15
  size: "default",
16
16
  variant: "default",
17
17
  spacing: 0,
18
18
  orientation: "horizontal",
19
- })
19
+ });
20
20
 
21
21
  function ToggleGroup({
22
22
  className,
@@ -28,8 +28,8 @@ function ToggleGroup({
28
28
  ...props
29
29
  }: ToggleGroupPrimitive.Props &
30
30
  VariantProps<typeof toggleVariants> & {
31
- spacing?: number
32
- orientation?: "horizontal" | "vertical"
31
+ spacing?: number;
32
+ orientation?: "horizontal" | "vertical";
33
33
  }) {
34
34
  return (
35
35
  <ToggleGroupPrimitive
@@ -41,17 +41,15 @@ function ToggleGroup({
41
41
  style={{ "--gap": spacing } as React.CSSProperties}
42
42
  className={cn(
43
43
  "group/toggle-group flex w-fit flex-row items-center gap-[--spacing(var(--gap))] rounded-lg data-[size=sm]:rounded-[min(var(--radius-md),10px)] data-vertical:flex-col data-vertical:items-stretch",
44
- className
44
+ className,
45
45
  )}
46
46
  {...props}
47
47
  >
48
- <ToggleGroupContext.Provider
49
- value={{ variant, size, spacing, orientation }}
50
- >
48
+ <ToggleGroupContext.Provider value={{ variant, size, spacing, orientation }}>
51
49
  {children}
52
50
  </ToggleGroupContext.Provider>
53
51
  </ToggleGroupPrimitive>
54
- )
52
+ );
55
53
  }
56
54
 
57
55
  function ToggleGroupItem({
@@ -61,7 +59,7 @@ function ToggleGroupItem({
61
59
  size = "default",
62
60
  ...props
63
61
  }: TogglePrimitive.Props & VariantProps<typeof toggleVariants>) {
64
- const context = React.useContext(ToggleGroupContext)
62
+ const context = React.useContext(ToggleGroupContext);
65
63
 
66
64
  return (
67
65
  <TogglePrimitive
@@ -75,13 +73,13 @@ function ToggleGroupItem({
75
73
  variant: context.variant || variant,
76
74
  size: context.size || size,
77
75
  }),
78
- className
76
+ className,
79
77
  )}
80
78
  {...props}
81
79
  >
82
80
  {children}
83
81
  </TogglePrimitive>
84
- )
82
+ );
85
83
  }
86
84
 
87
- export { ToggleGroup, ToggleGroupItem }
85
+ export { ToggleGroup, ToggleGroupItem };
@@ -1,10 +1,9 @@
1
- "use client"
2
-
3
- import { Toggle as TogglePrimitive } from "@base-ui/react/toggle"
4
- import { cva } from "class-variance-authority"
5
- import { cn } from "@workspace/ui/lib/utils"
6
- import type {VariantProps} from "class-variance-authority";
1
+ "use client";
7
2
 
3
+ import { Toggle as TogglePrimitive } from "@base-ui/react/toggle";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "@workspace/ui/lib/utils";
6
+ import type { VariantProps } from "class-variance-authority";
8
7
 
9
8
  const toggleVariants = cva(
10
9
  "group/toggle inline-flex items-center justify-center gap-1 rounded-lg text-sm font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
@@ -25,8 +24,8 @@ const toggleVariants = cva(
25
24
  variant: "default",
26
25
  size: "default",
27
26
  },
28
- }
29
- )
27
+ },
28
+ );
30
29
 
31
30
  function Toggle({
32
31
  className,
@@ -40,7 +39,7 @@ function Toggle({
40
39
  className={cn(toggleVariants({ variant, size, className }))}
41
40
  {...props}
42
41
  />
43
- )
42
+ );
44
43
  }
45
44
 
46
- export { Toggle, toggleVariants }
45
+ export { Toggle, toggleVariants };