create-reactivite 1.4.0 → 1.7.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 (150) hide show
  1. package/README.md +326 -290
  2. package/index.js +77 -2
  3. package/package.json +4 -2
  4. package/template/.storybook/main.ts +20 -0
  5. package/template/.storybook/preview.tsx +55 -0
  6. package/template/_gitignore +3 -0
  7. package/template/index.html +1 -1
  8. package/template/package.json +29 -23
  9. package/template/src/components/author-credit.tsx +25 -25
  10. package/template/src/components/ui-lib/auth-form.stories.tsx +26 -0
  11. package/template/src/components/ui-lib/auth-form.tsx +116 -0
  12. package/template/src/components/ui-lib/empty-state.stories.tsx +32 -0
  13. package/template/src/components/ui-lib/empty-state.tsx +54 -0
  14. package/template/src/components/ui-lib/feature-card.stories.tsx +45 -0
  15. package/template/src/components/ui-lib/feature-card.tsx +52 -0
  16. package/template/src/components/ui-lib/index.ts +13 -0
  17. package/template/src/components/ui-lib/page-header.stories.tsx +49 -0
  18. package/template/src/components/ui-lib/page-header.tsx +46 -0
  19. package/template/src/components/ui-lib/pricing-card.stories.tsx +58 -0
  20. package/template/src/components/ui-lib/pricing-card.tsx +86 -0
  21. package/template/src/components/ui-lib/stat-card.stories.tsx +55 -0
  22. package/template/src/components/ui-lib/stat-card.tsx +73 -0
  23. package/template/src/components/ui-lib/themes.stories.tsx +68 -0
  24. package/template/src/global.css +122 -0
  25. package/template2/.env.example +8 -8
  26. package/template2/.husky/pre-commit +4 -4
  27. package/template2/.prettierrc +5 -5
  28. package/template2/README.md +73 -73
  29. package/template2/__tests__/example.test.ts +20 -20
  30. package/template2/_gitignore +37 -37
  31. package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -52
  32. package/template2/app/[locale]/(public)/login/page.tsx +83 -83
  33. package/template2/app/[locale]/layout.tsx +58 -58
  34. package/template2/app/[locale]/locales.ts +10 -10
  35. package/template2/app/[locale]/page.tsx +38 -38
  36. package/template2/app/api/clear-session/route.ts +10 -10
  37. package/template2/app/globals.css +127 -127
  38. package/template2/app/layout.tsx +7 -7
  39. package/template2/app/page.tsx +6 -6
  40. package/template2/components/AuthEventListener.tsx +22 -22
  41. package/template2/components/author-credit.tsx +25 -25
  42. package/template2/components/theme-provider.tsx +78 -78
  43. package/template2/components/ui/button.tsx +60 -60
  44. package/template2/components/ui/card.tsx +92 -92
  45. package/template2/components/ui/input.tsx +21 -21
  46. package/template2/components/ui/label.tsx +24 -24
  47. package/template2/components/ui/sonner.tsx +40 -40
  48. package/template2/components.json +22 -22
  49. package/template2/config/constants.ts +7 -7
  50. package/template2/config/env.ts +5 -5
  51. package/template2/contexts/translation-context.tsx +70 -70
  52. package/template2/eslint.config.mjs +18 -18
  53. package/template2/hoc/provider.tsx +27 -27
  54. package/template2/lib/paramsSerializer.ts +40 -40
  55. package/template2/lib/utils.ts +6 -6
  56. package/template2/locales/az.json +20 -20
  57. package/template2/locales/en.json +20 -20
  58. package/template2/next-env.d.ts +1 -1
  59. package/template2/next.config.ts +17 -17
  60. package/template2/orval.config.ts +66 -66
  61. package/template2/package.json +62 -62
  62. package/template2/postcss.config.mjs +7 -7
  63. package/template2/scripts/fix-generated-types.mjs +13 -13
  64. package/template2/services/generated/.gitkeep +2 -2
  65. package/template2/services/httpClient/httpClient.ts +70 -70
  66. package/template2/services/httpClient/orvalMutator.ts +10 -10
  67. package/template2/store/example-store.tsx +16 -16
  68. package/template2/store/user-store.tsx +29 -29
  69. package/template2/testing/msw/handlers/index.ts +6 -6
  70. package/template2/testing/msw/server.ts +4 -4
  71. package/template2/tsconfig.json +34 -34
  72. package/template2/vitest.config.ts +17 -17
  73. package/template2/vitest.setup.ts +7 -7
  74. package/template3/README.md +34 -34
  75. package/template3/_gitignore +16 -16
  76. package/template3/components.json +21 -0
  77. package/template3/index.html +8 -2
  78. package/template3/package.json +48 -22
  79. package/template3/postcss.config.mjs +5 -0
  80. package/template3/rspack.config.mjs +59 -51
  81. package/template3/src/App.tsx +16 -11
  82. package/template3/src/components/author-credit.tsx +42 -42
  83. package/template3/src/components/layout.tsx +59 -0
  84. package/template3/src/components/matrix-rain.tsx +71 -0
  85. package/template3/src/components/ui/accordion.tsx +64 -0
  86. package/template3/src/components/ui/alert-dialog.tsx +196 -0
  87. package/template3/src/components/ui/alert.tsx +66 -0
  88. package/template3/src/components/ui/aspect-ratio.tsx +11 -0
  89. package/template3/src/components/ui/avatar.tsx +107 -0
  90. package/template3/src/components/ui/badge.tsx +48 -0
  91. package/template3/src/components/ui/breadcrumb.tsx +109 -0
  92. package/template3/src/components/ui/button-group.tsx +83 -0
  93. package/template3/src/components/ui/button.tsx +64 -0
  94. package/template3/src/components/ui/calendar.tsx +218 -0
  95. package/template3/src/components/ui/card.tsx +92 -0
  96. package/template3/src/components/ui/carousel.tsx +241 -0
  97. package/template3/src/components/ui/chart.tsx +372 -0
  98. package/template3/src/components/ui/checkbox.tsx +32 -0
  99. package/template3/src/components/ui/collapsible.tsx +31 -0
  100. package/template3/src/components/ui/combobox.tsx +310 -0
  101. package/template3/src/components/ui/command.tsx +184 -0
  102. package/template3/src/components/ui/context-menu.tsx +252 -0
  103. package/template3/src/components/ui/dialog.tsx +156 -0
  104. package/template3/src/components/ui/direction.tsx +22 -0
  105. package/template3/src/components/ui/drawer.tsx +133 -0
  106. package/template3/src/components/ui/dropdown-menu.tsx +257 -0
  107. package/template3/src/components/ui/empty.tsx +104 -0
  108. package/template3/src/components/ui/field.tsx +248 -0
  109. package/template3/src/components/ui/form.tsx +165 -0
  110. package/template3/src/components/ui/hover-card.tsx +42 -0
  111. package/template3/src/components/ui/input-group.tsx +168 -0
  112. package/template3/src/components/ui/input-otp.tsx +77 -0
  113. package/template3/src/components/ui/input.tsx +21 -0
  114. package/template3/src/components/ui/item.tsx +193 -0
  115. package/template3/src/components/ui/kbd.tsx +28 -0
  116. package/template3/src/components/ui/label.tsx +22 -0
  117. package/template3/src/components/ui/menubar.tsx +276 -0
  118. package/template3/src/components/ui/native-select.tsx +62 -0
  119. package/template3/src/components/ui/navigation-menu.tsx +168 -0
  120. package/template3/src/components/ui/pagination.tsx +127 -0
  121. package/template3/src/components/ui/popover.tsx +87 -0
  122. package/template3/src/components/ui/progress.tsx +31 -0
  123. package/template3/src/components/ui/radio-group.tsx +43 -0
  124. package/template3/src/components/ui/resizable.tsx +53 -0
  125. package/template3/src/components/ui/scroll-area.tsx +56 -0
  126. package/template3/src/components/ui/select.tsx +190 -0
  127. package/template3/src/components/ui/separator.tsx +26 -0
  128. package/template3/src/components/ui/sheet.tsx +143 -0
  129. package/template3/src/components/ui/sidebar.tsx +724 -0
  130. package/template3/src/components/ui/skeleton.tsx +13 -0
  131. package/template3/src/components/ui/slider.tsx +61 -0
  132. package/template3/src/components/ui/sonner.tsx +40 -0
  133. package/template3/src/components/ui/spinner.tsx +16 -0
  134. package/template3/src/components/ui/switch.tsx +33 -0
  135. package/template3/src/components/ui/table.tsx +116 -0
  136. package/template3/src/components/ui/tabs.tsx +89 -0
  137. package/template3/src/components/ui/textarea.tsx +18 -0
  138. package/template3/src/components/ui/toggle-group.tsx +83 -0
  139. package/template3/src/components/ui/toggle.tsx +47 -0
  140. package/template3/src/components/ui/tooltip.tsx +55 -0
  141. package/template3/src/hooks/use-mobile.ts +19 -0
  142. package/template3/src/index.css +175 -32
  143. package/template3/src/lib/utils.ts +6 -0
  144. package/template3/src/main.tsx +10 -10
  145. package/template3/src/pages/about.tsx +113 -0
  146. package/template3/src/pages/contact.tsx +111 -0
  147. package/template3/src/pages/home.tsx +81 -0
  148. package/template3/tsconfig.json +24 -20
  149. package/template/pnpm-lock.yaml +0 -3274
  150. package/template2/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,87 @@
1
+ import * as React from "react"
2
+ import { Popover as PopoverPrimitive } from "radix-ui"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Popover({
7
+ ...props
8
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
9
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
10
+ }
11
+
12
+ function PopoverTrigger({
13
+ ...props
14
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
15
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
16
+ }
17
+
18
+ function PopoverContent({
19
+ className,
20
+ align = "center",
21
+ sideOffset = 4,
22
+ ...props
23
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
24
+ return (
25
+ <PopoverPrimitive.Portal>
26
+ <PopoverPrimitive.Content
27
+ data-slot="popover-content"
28
+ align={align}
29
+ sideOffset={sideOffset}
30
+ className={cn(
31
+ "z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden 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 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
32
+ className
33
+ )}
34
+ {...props}
35
+ />
36
+ </PopoverPrimitive.Portal>
37
+ )
38
+ }
39
+
40
+ function PopoverAnchor({
41
+ ...props
42
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
43
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
44
+ }
45
+
46
+ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
47
+ return (
48
+ <div
49
+ data-slot="popover-header"
50
+ className={cn("flex flex-col gap-1 text-sm", className)}
51
+ {...props}
52
+ />
53
+ )
54
+ }
55
+
56
+ function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
57
+ return (
58
+ <div
59
+ data-slot="popover-title"
60
+ className={cn("font-medium", className)}
61
+ {...props}
62
+ />
63
+ )
64
+ }
65
+
66
+ function PopoverDescription({
67
+ className,
68
+ ...props
69
+ }: React.ComponentProps<"p">) {
70
+ return (
71
+ <p
72
+ data-slot="popover-description"
73
+ className={cn("text-muted-foreground", className)}
74
+ {...props}
75
+ />
76
+ )
77
+ }
78
+
79
+ export {
80
+ Popover,
81
+ PopoverTrigger,
82
+ PopoverContent,
83
+ PopoverAnchor,
84
+ PopoverHeader,
85
+ PopoverTitle,
86
+ PopoverDescription,
87
+ }
@@ -0,0 +1,31 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Progress as ProgressPrimitive } from "radix-ui"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function Progress({
9
+ className,
10
+ value,
11
+ ...props
12
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
13
+ return (
14
+ <ProgressPrimitive.Root
15
+ data-slot="progress"
16
+ className={cn(
17
+ "relative h-2 w-full overflow-hidden rounded-full bg-primary/20",
18
+ className
19
+ )}
20
+ {...props}
21
+ >
22
+ <ProgressPrimitive.Indicator
23
+ data-slot="progress-indicator"
24
+ className="h-full w-full flex-1 bg-primary transition-all"
25
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
26
+ />
27
+ </ProgressPrimitive.Root>
28
+ )
29
+ }
30
+
31
+ export { Progress }
@@ -0,0 +1,43 @@
1
+ import * as React from "react"
2
+ import { CircleIcon } from "lucide-react"
3
+ import { RadioGroup as RadioGroupPrimitive } from "radix-ui"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function RadioGroup({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
11
+ return (
12
+ <RadioGroupPrimitive.Root
13
+ data-slot="radio-group"
14
+ className={cn("grid gap-3", className)}
15
+ {...props}
16
+ />
17
+ )
18
+ }
19
+
20
+ function RadioGroupItem({
21
+ className,
22
+ ...props
23
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
24
+ return (
25
+ <RadioGroupPrimitive.Item
26
+ data-slot="radio-group-item"
27
+ className={cn(
28
+ "aspect-square size-4 shrink-0 rounded-full border border-input text-primary shadow-xs transition-[color,box-shadow] outline-none 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 dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
29
+ className
30
+ )}
31
+ {...props}
32
+ >
33
+ <RadioGroupPrimitive.Indicator
34
+ data-slot="radio-group-indicator"
35
+ className="relative flex items-center justify-center"
36
+ >
37
+ <CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-primary" />
38
+ </RadioGroupPrimitive.Indicator>
39
+ </RadioGroupPrimitive.Item>
40
+ )
41
+ }
42
+
43
+ export { RadioGroup, RadioGroupItem }
@@ -0,0 +1,53 @@
1
+ "use client"
2
+
3
+ import { GripVerticalIcon } from "lucide-react"
4
+ import * as ResizablePrimitive from "react-resizable-panels"
5
+
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function ResizablePanelGroup({
9
+ className,
10
+ ...props
11
+ }: ResizablePrimitive.GroupProps) {
12
+ return (
13
+ <ResizablePrimitive.Group
14
+ data-slot="resizable-panel-group"
15
+ className={cn(
16
+ "flex h-full w-full aria-[orientation=vertical]:flex-col",
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ )
22
+ }
23
+
24
+ function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
25
+ return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
26
+ }
27
+
28
+ function ResizableHandle({
29
+ withHandle,
30
+ className,
31
+ ...props
32
+ }: ResizablePrimitive.SeparatorProps & {
33
+ withHandle?: boolean
34
+ }) {
35
+ return (
36
+ <ResizablePrimitive.Separator
37
+ data-slot="resizable-handle"
38
+ className={cn(
39
+ "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90",
40
+ className
41
+ )}
42
+ {...props}
43
+ >
44
+ {withHandle && (
45
+ <div className="z-10 flex h-4 w-3 items-center justify-center rounded-xs border bg-border">
46
+ <GripVerticalIcon className="size-2.5" />
47
+ </div>
48
+ )}
49
+ </ResizablePrimitive.Separator>
50
+ )
51
+ }
52
+
53
+ export { ResizableHandle, ResizablePanel, ResizablePanelGroup }
@@ -0,0 +1,56 @@
1
+ import * as React from "react"
2
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function ScrollArea({
7
+ className,
8
+ children,
9
+ ...props
10
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
11
+ return (
12
+ <ScrollAreaPrimitive.Root
13
+ data-slot="scroll-area"
14
+ className={cn("relative", className)}
15
+ {...props}
16
+ >
17
+ <ScrollAreaPrimitive.Viewport
18
+ data-slot="scroll-area-viewport"
19
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1"
20
+ >
21
+ {children}
22
+ </ScrollAreaPrimitive.Viewport>
23
+ <ScrollBar />
24
+ <ScrollAreaPrimitive.Corner />
25
+ </ScrollAreaPrimitive.Root>
26
+ )
27
+ }
28
+
29
+ function ScrollBar({
30
+ className,
31
+ orientation = "vertical",
32
+ ...props
33
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
34
+ return (
35
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
36
+ data-slot="scroll-area-scrollbar"
37
+ orientation={orientation}
38
+ className={cn(
39
+ "flex touch-none p-px transition-colors select-none",
40
+ orientation === "vertical" &&
41
+ "h-full w-2.5 border-l border-l-transparent",
42
+ orientation === "horizontal" &&
43
+ "h-2.5 flex-col border-t border-t-transparent",
44
+ className
45
+ )}
46
+ {...props}
47
+ >
48
+ <ScrollAreaPrimitive.ScrollAreaThumb
49
+ data-slot="scroll-area-thumb"
50
+ className="relative flex-1 rounded-full bg-border"
51
+ />
52
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
53
+ )
54
+ }
55
+
56
+ export { ScrollArea, ScrollBar }
@@ -0,0 +1,190 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react"
5
+ import { Select as SelectPrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function Select({
10
+ ...props
11
+ }: React.ComponentProps<typeof SelectPrimitive.Root>) {
12
+ return <SelectPrimitive.Root data-slot="select" {...props} />
13
+ }
14
+
15
+ function SelectGroup({
16
+ ...props
17
+ }: React.ComponentProps<typeof SelectPrimitive.Group>) {
18
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />
19
+ }
20
+
21
+ function SelectValue({
22
+ ...props
23
+ }: React.ComponentProps<typeof SelectPrimitive.Value>) {
24
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />
25
+ }
26
+
27
+ function SelectTrigger({
28
+ className,
29
+ size = "default",
30
+ children,
31
+ ...props
32
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
33
+ size?: "sm" | "default"
34
+ }) {
35
+ return (
36
+ <SelectPrimitive.Trigger
37
+ data-slot="select-trigger"
38
+ data-size={size}
39
+ className={cn(
40
+ "flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none 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 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
41
+ className
42
+ )}
43
+ {...props}
44
+ >
45
+ {children}
46
+ <SelectPrimitive.Icon asChild>
47
+ <ChevronDownIcon className="size-4 opacity-50" />
48
+ </SelectPrimitive.Icon>
49
+ </SelectPrimitive.Trigger>
50
+ )
51
+ }
52
+
53
+ function SelectContent({
54
+ className,
55
+ children,
56
+ position = "item-aligned",
57
+ align = "center",
58
+ ...props
59
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
60
+ return (
61
+ <SelectPrimitive.Portal>
62
+ <SelectPrimitive.Content
63
+ data-slot="select-content"
64
+ className={cn(
65
+ "relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md 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 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
66
+ position === "popper" &&
67
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
68
+ className
69
+ )}
70
+ position={position}
71
+ align={align}
72
+ {...props}
73
+ >
74
+ <SelectScrollUpButton />
75
+ <SelectPrimitive.Viewport
76
+ className={cn(
77
+ "p-1",
78
+ position === "popper" &&
79
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"
80
+ )}
81
+ >
82
+ {children}
83
+ </SelectPrimitive.Viewport>
84
+ <SelectScrollDownButton />
85
+ </SelectPrimitive.Content>
86
+ </SelectPrimitive.Portal>
87
+ )
88
+ }
89
+
90
+ function SelectLabel({
91
+ className,
92
+ ...props
93
+ }: React.ComponentProps<typeof SelectPrimitive.Label>) {
94
+ return (
95
+ <SelectPrimitive.Label
96
+ data-slot="select-label"
97
+ className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
98
+ {...props}
99
+ />
100
+ )
101
+ }
102
+
103
+ function SelectItem({
104
+ className,
105
+ children,
106
+ ...props
107
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
108
+ return (
109
+ <SelectPrimitive.Item
110
+ data-slot="select-item"
111
+ className={cn(
112
+ "relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
113
+ className
114
+ )}
115
+ {...props}
116
+ >
117
+ <span
118
+ data-slot="select-item-indicator"
119
+ className="absolute right-2 flex size-3.5 items-center justify-center"
120
+ >
121
+ <SelectPrimitive.ItemIndicator>
122
+ <CheckIcon className="size-4" />
123
+ </SelectPrimitive.ItemIndicator>
124
+ </span>
125
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
126
+ </SelectPrimitive.Item>
127
+ )
128
+ }
129
+
130
+ function SelectSeparator({
131
+ className,
132
+ ...props
133
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
134
+ return (
135
+ <SelectPrimitive.Separator
136
+ data-slot="select-separator"
137
+ className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
138
+ {...props}
139
+ />
140
+ )
141
+ }
142
+
143
+ function SelectScrollUpButton({
144
+ className,
145
+ ...props
146
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
147
+ return (
148
+ <SelectPrimitive.ScrollUpButton
149
+ data-slot="select-scroll-up-button"
150
+ className={cn(
151
+ "flex cursor-default items-center justify-center py-1",
152
+ className
153
+ )}
154
+ {...props}
155
+ >
156
+ <ChevronUpIcon className="size-4" />
157
+ </SelectPrimitive.ScrollUpButton>
158
+ )
159
+ }
160
+
161
+ function SelectScrollDownButton({
162
+ className,
163
+ ...props
164
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
165
+ return (
166
+ <SelectPrimitive.ScrollDownButton
167
+ data-slot="select-scroll-down-button"
168
+ className={cn(
169
+ "flex cursor-default items-center justify-center py-1",
170
+ className
171
+ )}
172
+ {...props}
173
+ >
174
+ <ChevronDownIcon className="size-4" />
175
+ </SelectPrimitive.ScrollDownButton>
176
+ )
177
+ }
178
+
179
+ export {
180
+ Select,
181
+ SelectContent,
182
+ SelectGroup,
183
+ SelectItem,
184
+ SelectLabel,
185
+ SelectScrollDownButton,
186
+ SelectScrollUpButton,
187
+ SelectSeparator,
188
+ SelectTrigger,
189
+ SelectValue,
190
+ }
@@ -0,0 +1,26 @@
1
+ import * as React from "react"
2
+ import { Separator as SeparatorPrimitive } from "radix-ui"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Separator({
7
+ className,
8
+ orientation = "horizontal",
9
+ decorative = true,
10
+ ...props
11
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
12
+ return (
13
+ <SeparatorPrimitive.Root
14
+ data-slot="separator"
15
+ decorative={decorative}
16
+ orientation={orientation}
17
+ className={cn(
18
+ "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
19
+ className
20
+ )}
21
+ {...props}
22
+ />
23
+ )
24
+ }
25
+
26
+ export { Separator }
@@ -0,0 +1,143 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { XIcon } from "lucide-react"
5
+ import { Dialog as SheetPrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
10
+ return <SheetPrimitive.Root data-slot="sheet" {...props} />
11
+ }
12
+
13
+ function SheetTrigger({
14
+ ...props
15
+ }: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
16
+ return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
17
+ }
18
+
19
+ function SheetClose({
20
+ ...props
21
+ }: React.ComponentProps<typeof SheetPrimitive.Close>) {
22
+ return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
23
+ }
24
+
25
+ function SheetPortal({
26
+ ...props
27
+ }: React.ComponentProps<typeof SheetPrimitive.Portal>) {
28
+ return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
29
+ }
30
+
31
+ function SheetOverlay({
32
+ className,
33
+ ...props
34
+ }: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
35
+ return (
36
+ <SheetPrimitive.Overlay
37
+ data-slot="sheet-overlay"
38
+ className={cn(
39
+ "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ )
45
+ }
46
+
47
+ function SheetContent({
48
+ className,
49
+ children,
50
+ side = "right",
51
+ showCloseButton = true,
52
+ ...props
53
+ }: React.ComponentProps<typeof SheetPrimitive.Content> & {
54
+ side?: "top" | "right" | "bottom" | "left"
55
+ showCloseButton?: boolean
56
+ }) {
57
+ return (
58
+ <SheetPortal>
59
+ <SheetOverlay />
60
+ <SheetPrimitive.Content
61
+ data-slot="sheet-content"
62
+ className={cn(
63
+ "fixed z-50 flex flex-col gap-4 bg-background shadow-lg transition ease-in-out data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:animate-in data-[state=open]:duration-500",
64
+ side === "right" &&
65
+ "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm",
66
+ side === "left" &&
67
+ "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",
68
+ side === "top" &&
69
+ "inset-x-0 top-0 h-auto border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",
70
+ side === "bottom" &&
71
+ "inset-x-0 bottom-0 h-auto border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",
72
+ className
73
+ )}
74
+ {...props}
75
+ >
76
+ {children}
77
+ {showCloseButton && (
78
+ <SheetPrimitive.Close className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-secondary">
79
+ <XIcon className="size-4" />
80
+ <span className="sr-only">Close</span>
81
+ </SheetPrimitive.Close>
82
+ )}
83
+ </SheetPrimitive.Content>
84
+ </SheetPortal>
85
+ )
86
+ }
87
+
88
+ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
89
+ return (
90
+ <div
91
+ data-slot="sheet-header"
92
+ className={cn("flex flex-col gap-1.5 p-4", className)}
93
+ {...props}
94
+ />
95
+ )
96
+ }
97
+
98
+ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
99
+ return (
100
+ <div
101
+ data-slot="sheet-footer"
102
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
103
+ {...props}
104
+ />
105
+ )
106
+ }
107
+
108
+ function SheetTitle({
109
+ className,
110
+ ...props
111
+ }: React.ComponentProps<typeof SheetPrimitive.Title>) {
112
+ return (
113
+ <SheetPrimitive.Title
114
+ data-slot="sheet-title"
115
+ className={cn("font-semibold text-foreground", className)}
116
+ {...props}
117
+ />
118
+ )
119
+ }
120
+
121
+ function SheetDescription({
122
+ className,
123
+ ...props
124
+ }: React.ComponentProps<typeof SheetPrimitive.Description>) {
125
+ return (
126
+ <SheetPrimitive.Description
127
+ data-slot="sheet-description"
128
+ className={cn("text-sm text-muted-foreground", className)}
129
+ {...props}
130
+ />
131
+ )
132
+ }
133
+
134
+ export {
135
+ Sheet,
136
+ SheetTrigger,
137
+ SheetClose,
138
+ SheetContent,
139
+ SheetHeader,
140
+ SheetFooter,
141
+ SheetTitle,
142
+ SheetDescription,
143
+ }