@cogito.ai/cli 0.3.4 → 0.4.0

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 (70) hide show
  1. package/dist/index.js +77 -6
  2. package/dist/templates/web-nextjs/apps/docs/.source/browser.ts +1 -1
  3. package/dist/templates/web-nextjs/apps/docs/.source/server.ts +3 -2
  4. package/dist/templates/web-nextjs/apps/docs/content/docs/decisions/meta.json +1 -1
  5. package/dist/templates/web-nextjs/apps/docs/content/docs/decisions/turbo-package-manager.mdx +70 -0
  6. package/dist/templates/web-nextjs/apps/docs/package.json +1 -1
  7. package/dist/templates/web-nextjs/apps/web/middleware.ts +6 -13
  8. package/dist/templates/web-nextjs/apps/web/package.json +26 -0
  9. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/login/page.tsx +87 -93
  10. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(auth)/signup/page.tsx +116 -98
  11. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/dashboard/page.tsx +38 -29
  12. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/(protected)/layout.tsx +2 -5
  13. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/layout.tsx +11 -8
  14. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/privacy/page.tsx +23 -0
  15. package/dist/templates/web-nextjs/apps/web/src/app/[locale]/terms/page.tsx +23 -0
  16. package/dist/templates/web-nextjs/apps/web/src/app/route.ts +13 -0
  17. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/app-sidebar.tsx +188 -0
  18. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/chart-area-interactive.tsx +291 -0
  19. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/data-table.tsx +807 -0
  20. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/data.json +614 -0
  21. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-documents.tsx +92 -0
  22. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-main.tsx +58 -0
  23. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-secondary.tsx +42 -0
  24. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/nav-user.tsx +118 -0
  25. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/page.tsx +40 -0
  26. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/section-cards.tsx +102 -0
  27. package/dist/templates/web-nextjs/apps/web/src/components/dashboard/site-header.tsx +30 -0
  28. package/dist/templates/web-nextjs/apps/web/src/components/ui/alert-dialog.tsx +196 -0
  29. package/dist/templates/web-nextjs/apps/web/src/components/ui/avatar.tsx +109 -0
  30. package/dist/templates/web-nextjs/apps/web/src/components/ui/badge.tsx +48 -0
  31. package/dist/templates/web-nextjs/apps/web/src/components/ui/breadcrumb.tsx +109 -0
  32. package/dist/templates/web-nextjs/apps/web/src/components/ui/button.tsx +14 -2
  33. package/dist/templates/web-nextjs/apps/web/src/components/ui/card.tsx +92 -0
  34. package/dist/templates/web-nextjs/apps/web/src/components/ui/chart.tsx +374 -0
  35. package/dist/templates/web-nextjs/apps/web/src/components/ui/checkbox.tsx +32 -0
  36. package/dist/templates/web-nextjs/apps/web/src/components/ui/collapsible.tsx +33 -0
  37. package/dist/templates/web-nextjs/apps/web/src/components/ui/command.tsx +184 -0
  38. package/dist/templates/web-nextjs/apps/web/src/components/ui/dialog.tsx +158 -0
  39. package/dist/templates/web-nextjs/apps/web/src/components/ui/drawer.tsx +135 -0
  40. package/dist/templates/web-nextjs/apps/web/src/components/ui/dropdown-menu.tsx +257 -0
  41. package/dist/templates/web-nextjs/apps/web/src/components/ui/field.tsx +248 -0
  42. package/dist/templates/web-nextjs/apps/web/src/components/ui/input-otp.tsx +77 -0
  43. package/dist/templates/web-nextjs/apps/web/src/components/ui/pagination.tsx +127 -0
  44. package/dist/templates/web-nextjs/apps/web/src/components/ui/popover.tsx +89 -0
  45. package/dist/templates/web-nextjs/apps/web/src/components/ui/progress.tsx +31 -0
  46. package/dist/templates/web-nextjs/apps/web/src/components/ui/radio-group.tsx +45 -0
  47. package/dist/templates/web-nextjs/apps/web/src/components/ui/scroll-area.tsx +58 -0
  48. package/dist/templates/web-nextjs/apps/web/src/components/ui/select.tsx +190 -0
  49. package/dist/templates/web-nextjs/apps/web/src/components/ui/separator.tsx +29 -0
  50. package/dist/templates/web-nextjs/apps/web/src/components/ui/sheet.tsx +143 -0
  51. package/dist/templates/web-nextjs/apps/web/src/components/ui/sidebar.tsx +726 -0
  52. package/dist/templates/web-nextjs/apps/web/src/components/ui/skeleton.tsx +13 -0
  53. package/dist/templates/web-nextjs/apps/web/src/components/ui/slider.tsx +63 -0
  54. package/dist/templates/web-nextjs/apps/web/src/components/ui/sonner.tsx +11 -25
  55. package/dist/templates/web-nextjs/apps/web/src/components/ui/switch.tsx +35 -0
  56. package/dist/templates/web-nextjs/apps/web/src/components/ui/table.tsx +116 -0
  57. package/dist/templates/web-nextjs/apps/web/src/components/ui/tabs.tsx +91 -0
  58. package/dist/templates/web-nextjs/apps/web/src/components/ui/textarea.tsx +18 -0
  59. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle-group.tsx +83 -0
  60. package/dist/templates/web-nextjs/apps/web/src/components/ui/toggle.tsx +47 -0
  61. package/dist/templates/web-nextjs/apps/web/src/components/ui/tooltip.tsx +57 -0
  62. package/dist/templates/web-nextjs/apps/web/src/features/auth/server.ts +15 -0
  63. package/dist/templates/web-nextjs/apps/web/src/hooks/use-mobile.ts +21 -0
  64. package/dist/templates/web-nextjs/package.json +10 -1
  65. package/dist/templates/web-nextjs/packages/openspec-docs-sync/package.json +1 -3
  66. package/dist/templates/web-nextjs/pnpm-lock.yaml +1562 -100
  67. package/dist/templates/web-nextjs/pnpm-workspace.yaml +15 -0
  68. package/dist/templates/web-nextjs/turbo.json +1 -0
  69. package/package.json +2 -2
  70. /package/dist/templates/web-nextjs/{.env.example → apps/web/.env.example} +0 -0
@@ -0,0 +1,13 @@
1
+ import { cn } from "@/lib/utils"
2
+
3
+ function Skeleton({ className, ...props }: React.ComponentProps<"div">) {
4
+ return (
5
+ <div
6
+ data-slot="skeleton"
7
+ className={cn("animate-pulse rounded-md bg-accent", className)}
8
+ {...props}
9
+ />
10
+ )
11
+ }
12
+
13
+ export { Skeleton }
@@ -0,0 +1,63 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Slider as SliderPrimitive } from "radix-ui"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Slider({
9
+ className,
10
+ defaultValue,
11
+ value,
12
+ min = 0,
13
+ max = 100,
14
+ ...props
15
+ }: React.ComponentProps<typeof SliderPrimitive.Root>) {
16
+ const _values = React.useMemo(
17
+ () =>
18
+ Array.isArray(value)
19
+ ? value
20
+ : Array.isArray(defaultValue)
21
+ ? defaultValue
22
+ : [min, max],
23
+ [value, defaultValue, min, max]
24
+ )
25
+
26
+ return (
27
+ <SliderPrimitive.Root
28
+ data-slot="slider"
29
+ {...(defaultValue !== undefined && { defaultValue })}
30
+ {...(value !== undefined && { value })}
31
+ min={min}
32
+ max={max}
33
+ className={cn(
34
+ "relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
35
+ className
36
+ )}
37
+ {...props}
38
+ >
39
+ <SliderPrimitive.Track
40
+ data-slot="slider-track"
41
+ className={cn(
42
+ "relative grow overflow-hidden rounded-full bg-muted data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
43
+ )}
44
+ >
45
+ <SliderPrimitive.Range
46
+ data-slot="slider-range"
47
+ className={cn(
48
+ "absolute bg-primary data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
49
+ )}
50
+ />
51
+ </SliderPrimitive.Track>
52
+ {Array.from({ length: _values.length }, (_, index) => (
53
+ <SliderPrimitive.Thumb
54
+ data-slot="slider-thumb"
55
+ key={index}
56
+ className="block size-4 shrink-0 rounded-full border border-primary bg-white shadow-sm ring-ring/50 transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
57
+ />
58
+ ))}
59
+ </SliderPrimitive.Root>
60
+ )
61
+ }
62
+
63
+ export { Slider }
@@ -1,33 +1,24 @@
1
1
  "use client"
2
2
 
3
- import { useTheme } from "next-themes"
4
3
  import { Toaster as Sonner, type ToasterProps } from "sonner"
5
4
  import { CircleCheckIcon, InfoIcon, TriangleAlertIcon, OctagonXIcon, Loader2Icon } from "lucide-react"
6
5
 
6
+ /**
7
+ * Toaster wrapping Sonner with consistent icon set and shadcn CSS variable theming.
8
+ * Uses prefers-color-scheme via theme="system" — no ThemeProvider required.
9
+ * Add next-themes ThemeProvider + useTheme when implementing a dark-mode toggle.
10
+ */
7
11
  const Toaster = ({ ...props }: ToasterProps) => {
8
- const { resolvedTheme } = useTheme()
9
- const theme: ToasterProps['theme'] = resolvedTheme === 'dark' ? 'dark' : resolvedTheme === 'light' ? 'light' : 'system'
10
-
11
12
  return (
12
13
  <Sonner
13
- theme={theme}
14
+ theme="system"
14
15
  className="toaster group"
15
16
  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
- ),
17
+ success: <CircleCheckIcon className="size-4" />,
18
+ info: <InfoIcon className="size-4" />,
19
+ warning: <TriangleAlertIcon className="size-4" />,
20
+ error: <OctagonXIcon className="size-4" />,
21
+ loading: <Loader2Icon className="size-4 animate-spin" />,
31
22
  }}
32
23
  style={
33
24
  {
@@ -37,11 +28,6 @@ const Toaster = ({ ...props }: ToasterProps) => {
37
28
  "--border-radius": "var(--radius)",
38
29
  } as React.CSSProperties
39
30
  }
40
- toastOptions={{
41
- classNames: {
42
- toast: "cn-toast",
43
- },
44
- }}
45
31
  {...props}
46
32
  />
47
33
  )
@@ -0,0 +1,35 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Switch as SwitchPrimitive } from "radix-ui"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Switch({
9
+ className,
10
+ size = "default",
11
+ ...props
12
+ }: React.ComponentProps<typeof SwitchPrimitive.Root> & {
13
+ size?: "sm" | "default"
14
+ }) {
15
+ return (
16
+ <SwitchPrimitive.Root
17
+ data-slot="switch"
18
+ data-size={size}
19
+ className={cn(
20
+ "peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80",
21
+ className
22
+ )}
23
+ {...props}
24
+ >
25
+ <SwitchPrimitive.Thumb
26
+ data-slot="switch-thumb"
27
+ className={cn(
28
+ "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 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground"
29
+ )}
30
+ />
31
+ </SwitchPrimitive.Root>
32
+ )
33
+ }
34
+
35
+ export { Switch }
@@ -0,0 +1,116 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Table({ className, ...props }: React.ComponentProps<"table">) {
8
+ return (
9
+ <div
10
+ data-slot="table-container"
11
+ className="relative w-full overflow-x-auto"
12
+ >
13
+ <table
14
+ data-slot="table"
15
+ className={cn("w-full caption-bottom text-sm", className)}
16
+ {...props}
17
+ />
18
+ </div>
19
+ )
20
+ }
21
+
22
+ 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
+ )
30
+ }
31
+
32
+ function TableBody({ className, ...props }: React.ComponentProps<"tbody">) {
33
+ return (
34
+ <tbody
35
+ data-slot="table-body"
36
+ className={cn("[&_tr:last-child]:border-0", className)}
37
+ {...props}
38
+ />
39
+ )
40
+ }
41
+
42
+ function TableFooter({ className, ...props }: React.ComponentProps<"tfoot">) {
43
+ return (
44
+ <tfoot
45
+ data-slot="table-footer"
46
+ className={cn(
47
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ )
53
+ }
54
+
55
+ function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
56
+ return (
57
+ <tr
58
+ data-slot="table-row"
59
+ className={cn(
60
+ "border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",
61
+ className
62
+ )}
63
+ {...props}
64
+ />
65
+ )
66
+ }
67
+
68
+ function TableHead({ className, ...props }: React.ComponentProps<"th">) {
69
+ return (
70
+ <th
71
+ data-slot="table-head"
72
+ className={cn(
73
+ "h-10 px-2 text-left align-middle font-medium whitespace-nowrap text-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
74
+ className
75
+ )}
76
+ {...props}
77
+ />
78
+ )
79
+ }
80
+
81
+ function TableCell({ className, ...props }: React.ComponentProps<"td">) {
82
+ return (
83
+ <td
84
+ data-slot="table-cell"
85
+ className={cn(
86
+ "p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
87
+ className
88
+ )}
89
+ {...props}
90
+ />
91
+ )
92
+ }
93
+
94
+ function TableCaption({
95
+ className,
96
+ ...props
97
+ }: React.ComponentProps<"caption">) {
98
+ return (
99
+ <caption
100
+ data-slot="table-caption"
101
+ className={cn("mt-4 text-sm text-muted-foreground", className)}
102
+ {...props}
103
+ />
104
+ )
105
+ }
106
+
107
+ export {
108
+ Table,
109
+ TableHeader,
110
+ TableBody,
111
+ TableFooter,
112
+ TableHead,
113
+ TableRow,
114
+ TableCell,
115
+ TableCaption,
116
+ }
@@ -0,0 +1,91 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+ import { Tabs as TabsPrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function Tabs({
10
+ className,
11
+ orientation = "horizontal",
12
+ ...props
13
+ }: React.ComponentProps<typeof TabsPrimitive.Root>) {
14
+ return (
15
+ <TabsPrimitive.Root
16
+ data-slot="tabs"
17
+ data-orientation={orientation}
18
+ orientation={orientation}
19
+ className={cn(
20
+ "group/tabs flex gap-2 data-[orientation=horizontal]:flex-col",
21
+ className
22
+ )}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ const tabsListVariants = cva(
29
+ "group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-[orientation=horizontal]/tabs:h-9 group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col data-[variant=line]:rounded-none",
30
+ {
31
+ variants: {
32
+ variant: {
33
+ default: "bg-muted",
34
+ line: "gap-1 bg-transparent",
35
+ },
36
+ },
37
+ defaultVariants: {
38
+ variant: "default",
39
+ },
40
+ }
41
+ )
42
+
43
+ function TabsList({
44
+ className,
45
+ variant = "default",
46
+ ...props
47
+ }: React.ComponentProps<typeof TabsPrimitive.List> &
48
+ VariantProps<typeof tabsListVariants>) {
49
+ return (
50
+ <TabsPrimitive.List
51
+ data-slot="tabs-list"
52
+ data-variant={variant}
53
+ className={cn(tabsListVariants({ variant }), className)}
54
+ {...props}
55
+ />
56
+ )
57
+ }
58
+
59
+ function TabsTrigger({
60
+ className,
61
+ ...props
62
+ }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
63
+ return (
64
+ <TabsPrimitive.Trigger
65
+ data-slot="tabs-trigger"
66
+ className={cn(
67
+ "relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none dark:text-muted-foreground dark:hover:text-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
68
+ "group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent",
69
+ "data-[state=active]:bg-background data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 dark:data-[state=active]:text-foreground",
70
+ "after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100",
71
+ className
72
+ )}
73
+ {...props}
74
+ />
75
+ )
76
+ }
77
+
78
+ function TabsContent({
79
+ className,
80
+ ...props
81
+ }: React.ComponentProps<typeof TabsPrimitive.Content>) {
82
+ return (
83
+ <TabsPrimitive.Content
84
+ data-slot="tabs-content"
85
+ className={cn("flex-1 outline-none", className)}
86
+ {...props}
87
+ />
88
+ )
89
+ }
90
+
91
+ export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
@@ -0,0 +1,18 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "@/lib/utils"
4
+
5
+ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
6
+ return (
7
+ <textarea
8
+ data-slot="textarea"
9
+ className={cn(
10
+ "flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+
18
+ export { Textarea }
@@ -0,0 +1,83 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { type VariantProps } from "class-variance-authority"
5
+ import { ToggleGroup as ToggleGroupPrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+ import { toggleVariants } from "@/components/ui/toggle"
9
+
10
+ const ToggleGroupContext = React.createContext<
11
+ VariantProps<typeof toggleVariants> & {
12
+ spacing?: number
13
+ }
14
+ >({
15
+ size: "default",
16
+ variant: "default",
17
+ spacing: 0,
18
+ })
19
+
20
+ function ToggleGroup({
21
+ className,
22
+ variant,
23
+ size,
24
+ spacing = 0,
25
+ children,
26
+ ...props
27
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &
28
+ VariantProps<typeof toggleVariants> & {
29
+ spacing?: number
30
+ }) {
31
+ return (
32
+ <ToggleGroupPrimitive.Root
33
+ data-slot="toggle-group"
34
+ data-variant={variant}
35
+ data-size={size}
36
+ data-spacing={spacing}
37
+ style={{ "--gap": spacing } as React.CSSProperties}
38
+ className={cn(
39
+ "group/toggle-group flex w-fit items-center gap-[--spacing(var(--gap))] rounded-md data-[spacing=default]:data-[variant=outline]:shadow-xs",
40
+ className
41
+ )}
42
+ {...props}
43
+ >
44
+ <ToggleGroupContext.Provider value={{ variant, size, spacing }}>
45
+ {children}
46
+ </ToggleGroupContext.Provider>
47
+ </ToggleGroupPrimitive.Root>
48
+ )
49
+ }
50
+
51
+ function ToggleGroupItem({
52
+ className,
53
+ children,
54
+ variant,
55
+ size,
56
+ ...props
57
+ }: React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
58
+ VariantProps<typeof toggleVariants>) {
59
+ const context = React.useContext(ToggleGroupContext)
60
+
61
+ return (
62
+ <ToggleGroupPrimitive.Item
63
+ data-slot="toggle-group-item"
64
+ data-variant={context.variant || variant}
65
+ data-size={context.size || size}
66
+ data-spacing={context.spacing}
67
+ className={cn(
68
+ toggleVariants({
69
+ variant: context.variant || variant,
70
+ size: context.size || size,
71
+ }),
72
+ "w-auto min-w-0 shrink-0 px-3 focus:z-10 focus-visible:z-10",
73
+ "data-[spacing=0]:rounded-none data-[spacing=0]:shadow-none data-[spacing=0]:first:rounded-l-md data-[spacing=0]:last:rounded-r-md data-[spacing=0]:data-[variant=outline]:border-l-0 data-[spacing=0]:data-[variant=outline]:first:border-l",
74
+ className
75
+ )}
76
+ {...props}
77
+ >
78
+ {children}
79
+ </ToggleGroupPrimitive.Item>
80
+ )
81
+ }
82
+
83
+ export { ToggleGroup, ToggleGroupItem }
@@ -0,0 +1,47 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+ import { Toggle as TogglePrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ const toggleVariants = cva(
10
+ "inline-flex items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-[color,box-shadow] outline-none hover:bg-muted hover:text-muted-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 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
11
+ {
12
+ variants: {
13
+ variant: {
14
+ default: "bg-transparent",
15
+ outline:
16
+ "border border-input bg-transparent shadow-xs hover:bg-accent hover:text-accent-foreground",
17
+ },
18
+ size: {
19
+ default: "h-9 min-w-9 px-2",
20
+ sm: "h-8 min-w-8 px-1.5",
21
+ lg: "h-10 min-w-10 px-2.5",
22
+ },
23
+ },
24
+ defaultVariants: {
25
+ variant: "default",
26
+ size: "default",
27
+ },
28
+ }
29
+ )
30
+
31
+ function Toggle({
32
+ className,
33
+ variant,
34
+ size,
35
+ ...props
36
+ }: React.ComponentProps<typeof TogglePrimitive.Root> &
37
+ VariantProps<typeof toggleVariants>) {
38
+ return (
39
+ <TogglePrimitive.Root
40
+ data-slot="toggle"
41
+ className={cn(toggleVariants({ variant, size, className }))}
42
+ {...props}
43
+ />
44
+ )
45
+ }
46
+
47
+ export { Toggle, toggleVariants }
@@ -0,0 +1,57 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Tooltip as TooltipPrimitive } from "radix-ui"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function TooltipProvider({
9
+ delayDuration = 0,
10
+ ...props
11
+ }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
12
+ return (
13
+ <TooltipPrimitive.Provider
14
+ data-slot="tooltip-provider"
15
+ delayDuration={delayDuration}
16
+ {...props}
17
+ />
18
+ )
19
+ }
20
+
21
+ function Tooltip({
22
+ ...props
23
+ }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
24
+ return <TooltipPrimitive.Root data-slot="tooltip" {...props} />
25
+ }
26
+
27
+ function TooltipTrigger({
28
+ ...props
29
+ }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
30
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />
31
+ }
32
+
33
+ function TooltipContent({
34
+ className,
35
+ sideOffset = 0,
36
+ children,
37
+ ...props
38
+ }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
39
+ return (
40
+ <TooltipPrimitive.Portal>
41
+ <TooltipPrimitive.Content
42
+ data-slot="tooltip-content"
43
+ sideOffset={sideOffset}
44
+ className={cn(
45
+ "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
46
+ className
47
+ )}
48
+ {...props}
49
+ >
50
+ {children}
51
+ <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
52
+ </TooltipPrimitive.Content>
53
+ </TooltipPrimitive.Portal>
54
+ )
55
+ }
56
+
57
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
@@ -0,0 +1,15 @@
1
+ import { cache } from 'react'
2
+ import { getServerClient } from '@/infra/db/client'
3
+
4
+ /**
5
+ * Returns the current authenticated user for the active request.
6
+ * Wrapped in React cache() so repeated reads in one request are deduplicated.
7
+ */
8
+ export const getCurrentUser = cache(async () => {
9
+ const supabase = await getServerClient()
10
+ const {
11
+ data: { user },
12
+ } = await supabase.auth.getUser()
13
+
14
+ return user
15
+ })
@@ -0,0 +1,21 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+
5
+ const MOBILE_BREAKPOINT = 768
6
+
7
+ export function useIsMobile() {
8
+ const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined)
9
+
10
+ React.useEffect(() => {
11
+ const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`)
12
+ const onChange = () => {
13
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
14
+ }
15
+ mql.addEventListener("change", onChange)
16
+ setIsMobile(window.innerWidth < MOBILE_BREAKPOINT)
17
+ return () => mql.removeEventListener("change", onChange)
18
+ }, [])
19
+
20
+ return !!isMobile
21
+ }
@@ -7,7 +7,6 @@
7
7
  "pnpm": ">=9",
8
8
  "node": ">=18"
9
9
  },
10
- "packageManager": "pnpm@9.0.0",
11
10
  "scripts": {
12
11
  "build": "pnpm -r run build",
13
12
  "dev": "turbo run dev",
@@ -22,5 +21,15 @@
22
21
  },
23
22
  "agentdock": {
24
23
  "minCliVersion": "0.1.0"
24
+ },
25
+ "pnpm": {
26
+ "onlyBuiltDependencies": [
27
+ "@fission-ai/openspec",
28
+ "@parcel/watcher",
29
+ "@swc/core",
30
+ "esbuild",
31
+ "msw",
32
+ "sharp"
33
+ ]
25
34
  }
26
35
  }
@@ -3,11 +3,9 @@
3
3
  "version": "0.0.1",
4
4
  "private": true,
5
5
  "type": "module",
6
- "bin": {
7
- "openspec-docs-sync": "./dist/index.js"
8
- },
9
6
  "scripts": {
10
7
  "build": "tsc",
8
+ "prepare": "tsc",
11
9
  "dev": "tsc --watch",
12
10
  "check-types": "tsc --noEmit"
13
11
  },