create-reactivite 1.3.0 → 1.6.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 (132) hide show
  1. package/README.md +326 -235
  2. package/index.js +157 -34
  3. package/package.json +5 -3
  4. package/template/package.json +22 -22
  5. package/template/pnpm-lock.yaml +3274 -3274
  6. package/template/src/components/author-credit.tsx +25 -25
  7. package/template2/.env.example +8 -8
  8. package/template2/.husky/pre-commit +4 -4
  9. package/template2/.prettierrc +5 -5
  10. package/template2/README.md +73 -73
  11. package/template2/__tests__/example.test.ts +20 -20
  12. package/template2/_gitignore +37 -37
  13. package/template2/app/[locale]/(private)/dashboard/page.tsx +52 -52
  14. package/template2/app/[locale]/(public)/login/page.tsx +83 -83
  15. package/template2/app/[locale]/layout.tsx +58 -58
  16. package/template2/app/[locale]/locales.ts +10 -10
  17. package/template2/app/[locale]/page.tsx +38 -38
  18. package/template2/app/api/clear-session/route.ts +10 -10
  19. package/template2/app/globals.css +127 -127
  20. package/template2/app/layout.tsx +7 -7
  21. package/template2/app/page.tsx +6 -6
  22. package/template2/components/AuthEventListener.tsx +22 -22
  23. package/template2/components/author-credit.tsx +25 -25
  24. package/template2/components/theme-provider.tsx +78 -78
  25. package/template2/components/ui/button.tsx +60 -60
  26. package/template2/components/ui/card.tsx +92 -92
  27. package/template2/components/ui/input.tsx +21 -21
  28. package/template2/components/ui/label.tsx +24 -24
  29. package/template2/components/ui/sonner.tsx +40 -40
  30. package/template2/components.json +22 -22
  31. package/template2/config/constants.ts +7 -7
  32. package/template2/config/env.ts +5 -5
  33. package/template2/contexts/translation-context.tsx +70 -70
  34. package/template2/eslint.config.mjs +18 -18
  35. package/template2/hoc/provider.tsx +27 -27
  36. package/template2/lib/paramsSerializer.ts +40 -40
  37. package/template2/lib/utils.ts +6 -6
  38. package/template2/locales/az.json +20 -20
  39. package/template2/locales/en.json +20 -20
  40. package/template2/next-env.d.ts +1 -1
  41. package/template2/next.config.ts +17 -17
  42. package/template2/orval.config.ts +66 -66
  43. package/template2/package.json +62 -62
  44. package/template2/postcss.config.mjs +7 -7
  45. package/template2/scripts/fix-generated-types.mjs +13 -13
  46. package/template2/services/generated/.gitkeep +2 -2
  47. package/template2/services/httpClient/httpClient.ts +70 -70
  48. package/template2/services/httpClient/orvalMutator.ts +10 -10
  49. package/template2/store/example-store.tsx +16 -16
  50. package/template2/store/user-store.tsx +29 -29
  51. package/template2/testing/msw/handlers/index.ts +6 -6
  52. package/template2/testing/msw/server.ts +4 -4
  53. package/template2/tsconfig.json +34 -34
  54. package/template2/vitest.config.ts +17 -17
  55. package/template2/vitest.setup.ts +7 -7
  56. package/template3/README.md +34 -34
  57. package/template3/_gitignore +16 -16
  58. package/template3/components.json +21 -0
  59. package/template3/index.html +8 -2
  60. package/template3/package-lock.json +3934 -0
  61. package/template3/package.json +48 -22
  62. package/template3/postcss.config.mjs +5 -0
  63. package/template3/rspack.config.mjs +59 -51
  64. package/template3/src/App.tsx +16 -11
  65. package/template3/src/components/author-credit.tsx +42 -42
  66. package/template3/src/components/layout.tsx +59 -0
  67. package/template3/src/components/matrix-rain.tsx +71 -0
  68. package/template3/src/components/ui/accordion.tsx +64 -0
  69. package/template3/src/components/ui/alert-dialog.tsx +196 -0
  70. package/template3/src/components/ui/alert.tsx +66 -0
  71. package/template3/src/components/ui/aspect-ratio.tsx +11 -0
  72. package/template3/src/components/ui/avatar.tsx +107 -0
  73. package/template3/src/components/ui/badge.tsx +48 -0
  74. package/template3/src/components/ui/breadcrumb.tsx +109 -0
  75. package/template3/src/components/ui/button-group.tsx +83 -0
  76. package/template3/src/components/ui/button.tsx +64 -0
  77. package/template3/src/components/ui/calendar.tsx +218 -0
  78. package/template3/src/components/ui/card.tsx +92 -0
  79. package/template3/src/components/ui/carousel.tsx +241 -0
  80. package/template3/src/components/ui/chart.tsx +372 -0
  81. package/template3/src/components/ui/checkbox.tsx +32 -0
  82. package/template3/src/components/ui/collapsible.tsx +31 -0
  83. package/template3/src/components/ui/combobox.tsx +310 -0
  84. package/template3/src/components/ui/command.tsx +184 -0
  85. package/template3/src/components/ui/context-menu.tsx +252 -0
  86. package/template3/src/components/ui/dialog.tsx +156 -0
  87. package/template3/src/components/ui/direction.tsx +22 -0
  88. package/template3/src/components/ui/drawer.tsx +133 -0
  89. package/template3/src/components/ui/dropdown-menu.tsx +257 -0
  90. package/template3/src/components/ui/empty.tsx +104 -0
  91. package/template3/src/components/ui/field.tsx +248 -0
  92. package/template3/src/components/ui/form.tsx +165 -0
  93. package/template3/src/components/ui/hover-card.tsx +42 -0
  94. package/template3/src/components/ui/input-group.tsx +168 -0
  95. package/template3/src/components/ui/input-otp.tsx +77 -0
  96. package/template3/src/components/ui/input.tsx +21 -0
  97. package/template3/src/components/ui/item.tsx +193 -0
  98. package/template3/src/components/ui/kbd.tsx +28 -0
  99. package/template3/src/components/ui/label.tsx +22 -0
  100. package/template3/src/components/ui/menubar.tsx +276 -0
  101. package/template3/src/components/ui/native-select.tsx +62 -0
  102. package/template3/src/components/ui/navigation-menu.tsx +168 -0
  103. package/template3/src/components/ui/pagination.tsx +127 -0
  104. package/template3/src/components/ui/popover.tsx +87 -0
  105. package/template3/src/components/ui/progress.tsx +31 -0
  106. package/template3/src/components/ui/radio-group.tsx +43 -0
  107. package/template3/src/components/ui/resizable.tsx +53 -0
  108. package/template3/src/components/ui/scroll-area.tsx +56 -0
  109. package/template3/src/components/ui/select.tsx +190 -0
  110. package/template3/src/components/ui/separator.tsx +26 -0
  111. package/template3/src/components/ui/sheet.tsx +143 -0
  112. package/template3/src/components/ui/sidebar.tsx +724 -0
  113. package/template3/src/components/ui/skeleton.tsx +13 -0
  114. package/template3/src/components/ui/slider.tsx +61 -0
  115. package/template3/src/components/ui/sonner.tsx +40 -0
  116. package/template3/src/components/ui/spinner.tsx +16 -0
  117. package/template3/src/components/ui/switch.tsx +33 -0
  118. package/template3/src/components/ui/table.tsx +116 -0
  119. package/template3/src/components/ui/tabs.tsx +89 -0
  120. package/template3/src/components/ui/textarea.tsx +18 -0
  121. package/template3/src/components/ui/toggle-group.tsx +83 -0
  122. package/template3/src/components/ui/toggle.tsx +47 -0
  123. package/template3/src/components/ui/tooltip.tsx +55 -0
  124. package/template3/src/hooks/use-mobile.ts +19 -0
  125. package/template3/src/index.css +175 -32
  126. package/template3/src/lib/utils.ts +6 -0
  127. package/template3/src/main.tsx +10 -10
  128. package/template3/src/pages/about.tsx +113 -0
  129. package/template3/src/pages/contact.tsx +111 -0
  130. package/template3/src/pages/home.tsx +81 -0
  131. package/template3/tsconfig.json +24 -20
  132. package/template2/tsconfig.tsbuildinfo +0 -1
@@ -0,0 +1,252 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
5
+ import { ContextMenu as ContextMenuPrimitive } from "radix-ui"
6
+
7
+ import { cn } from "@/lib/utils"
8
+
9
+ function ContextMenu({
10
+ ...props
11
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
12
+ return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
13
+ }
14
+
15
+ function ContextMenuTrigger({
16
+ ...props
17
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
18
+ return (
19
+ <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
20
+ )
21
+ }
22
+
23
+ function ContextMenuGroup({
24
+ ...props
25
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
26
+ return (
27
+ <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
28
+ )
29
+ }
30
+
31
+ function ContextMenuPortal({
32
+ ...props
33
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
34
+ return (
35
+ <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
36
+ )
37
+ }
38
+
39
+ function ContextMenuSub({
40
+ ...props
41
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
42
+ return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />
43
+ }
44
+
45
+ function ContextMenuRadioGroup({
46
+ ...props
47
+ }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
48
+ return (
49
+ <ContextMenuPrimitive.RadioGroup
50
+ data-slot="context-menu-radio-group"
51
+ {...props}
52
+ />
53
+ )
54
+ }
55
+
56
+ function ContextMenuSubTrigger({
57
+ className,
58
+ inset,
59
+ children,
60
+ ...props
61
+ }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
62
+ inset?: boolean
63
+ }) {
64
+ return (
65
+ <ContextMenuPrimitive.SubTrigger
66
+ data-slot="context-menu-sub-trigger"
67
+ data-inset={inset}
68
+ className={cn(
69
+ "flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
70
+ className
71
+ )}
72
+ {...props}
73
+ >
74
+ {children}
75
+ <ChevronRightIcon className="ml-auto" />
76
+ </ContextMenuPrimitive.SubTrigger>
77
+ )
78
+ }
79
+
80
+ function ContextMenuSubContent({
81
+ className,
82
+ ...props
83
+ }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
84
+ return (
85
+ <ContextMenuPrimitive.SubContent
86
+ data-slot="context-menu-sub-content"
87
+ className={cn(
88
+ "z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",
89
+ className
90
+ )}
91
+ {...props}
92
+ />
93
+ )
94
+ }
95
+
96
+ function ContextMenuContent({
97
+ className,
98
+ ...props
99
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
100
+ return (
101
+ <ContextMenuPrimitive.Portal>
102
+ <ContextMenuPrimitive.Content
103
+ data-slot="context-menu-content"
104
+ className={cn(
105
+ "z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 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",
106
+ className
107
+ )}
108
+ {...props}
109
+ />
110
+ </ContextMenuPrimitive.Portal>
111
+ )
112
+ }
113
+
114
+ function ContextMenuItem({
115
+ className,
116
+ inset,
117
+ variant = "default",
118
+ ...props
119
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
120
+ inset?: boolean
121
+ variant?: "default" | "destructive"
122
+ }) {
123
+ return (
124
+ <ContextMenuPrimitive.Item
125
+ data-slot="context-menu-item"
126
+ data-inset={inset}
127
+ data-variant={variant}
128
+ className={cn(
129
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
130
+ className
131
+ )}
132
+ {...props}
133
+ />
134
+ )
135
+ }
136
+
137
+ function ContextMenuCheckboxItem({
138
+ className,
139
+ children,
140
+ checked,
141
+ ...props
142
+ }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
143
+ return (
144
+ <ContextMenuPrimitive.CheckboxItem
145
+ data-slot="context-menu-checkbox-item"
146
+ className={cn(
147
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 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",
148
+ className
149
+ )}
150
+ checked={checked}
151
+ {...props}
152
+ >
153
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
154
+ <ContextMenuPrimitive.ItemIndicator>
155
+ <CheckIcon className="size-4" />
156
+ </ContextMenuPrimitive.ItemIndicator>
157
+ </span>
158
+ {children}
159
+ </ContextMenuPrimitive.CheckboxItem>
160
+ )
161
+ }
162
+
163
+ function ContextMenuRadioItem({
164
+ className,
165
+ children,
166
+ ...props
167
+ }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
168
+ return (
169
+ <ContextMenuPrimitive.RadioItem
170
+ data-slot="context-menu-radio-item"
171
+ className={cn(
172
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 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",
173
+ className
174
+ )}
175
+ {...props}
176
+ >
177
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
178
+ <ContextMenuPrimitive.ItemIndicator>
179
+ <CircleIcon className="size-2 fill-current" />
180
+ </ContextMenuPrimitive.ItemIndicator>
181
+ </span>
182
+ {children}
183
+ </ContextMenuPrimitive.RadioItem>
184
+ )
185
+ }
186
+
187
+ function ContextMenuLabel({
188
+ className,
189
+ inset,
190
+ ...props
191
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
192
+ inset?: boolean
193
+ }) {
194
+ return (
195
+ <ContextMenuPrimitive.Label
196
+ data-slot="context-menu-label"
197
+ data-inset={inset}
198
+ className={cn(
199
+ "px-2 py-1.5 text-sm font-medium text-foreground data-[inset]:pl-8",
200
+ className
201
+ )}
202
+ {...props}
203
+ />
204
+ )
205
+ }
206
+
207
+ function ContextMenuSeparator({
208
+ className,
209
+ ...props
210
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
211
+ return (
212
+ <ContextMenuPrimitive.Separator
213
+ data-slot="context-menu-separator"
214
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
215
+ {...props}
216
+ />
217
+ )
218
+ }
219
+
220
+ function ContextMenuShortcut({
221
+ className,
222
+ ...props
223
+ }: React.ComponentProps<"span">) {
224
+ return (
225
+ <span
226
+ data-slot="context-menu-shortcut"
227
+ className={cn(
228
+ "ml-auto text-xs tracking-widest text-muted-foreground",
229
+ className
230
+ )}
231
+ {...props}
232
+ />
233
+ )
234
+ }
235
+
236
+ export {
237
+ ContextMenu,
238
+ ContextMenuTrigger,
239
+ ContextMenuContent,
240
+ ContextMenuItem,
241
+ ContextMenuCheckboxItem,
242
+ ContextMenuRadioItem,
243
+ ContextMenuLabel,
244
+ ContextMenuSeparator,
245
+ ContextMenuShortcut,
246
+ ContextMenuGroup,
247
+ ContextMenuPortal,
248
+ ContextMenuSub,
249
+ ContextMenuSubContent,
250
+ ContextMenuSubTrigger,
251
+ ContextMenuRadioGroup,
252
+ }
@@ -0,0 +1,156 @@
1
+ import * as React from "react"
2
+ import { XIcon } from "lucide-react"
3
+ import { Dialog as DialogPrimitive } from "radix-ui"
4
+
5
+ import { cn } from "@/lib/utils"
6
+ import { Button } from "@/components/ui/button"
7
+
8
+ function Dialog({
9
+ ...props
10
+ }: React.ComponentProps<typeof DialogPrimitive.Root>) {
11
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
12
+ }
13
+
14
+ function DialogTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
17
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
18
+ }
19
+
20
+ function DialogPortal({
21
+ ...props
22
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
23
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
24
+ }
25
+
26
+ function DialogClose({
27
+ ...props
28
+ }: React.ComponentProps<typeof DialogPrimitive.Close>) {
29
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
30
+ }
31
+
32
+ function DialogOverlay({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
36
+ return (
37
+ <DialogPrimitive.Overlay
38
+ data-slot="dialog-overlay"
39
+ className={cn(
40
+ "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",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ )
46
+ }
47
+
48
+ function DialogContent({
49
+ className,
50
+ children,
51
+ showCloseButton = true,
52
+ ...props
53
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
54
+ showCloseButton?: boolean
55
+ }) {
56
+ return (
57
+ <DialogPortal data-slot="dialog-portal">
58
+ <DialogOverlay />
59
+ <DialogPrimitive.Content
60
+ data-slot="dialog-content"
61
+ className={cn(
62
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none 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 sm:max-w-lg",
63
+ className
64
+ )}
65
+ {...props}
66
+ >
67
+ {children}
68
+ {showCloseButton && (
69
+ <DialogPrimitive.Close
70
+ data-slot="dialog-close"
71
+ 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-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
72
+ >
73
+ <XIcon />
74
+ <span className="sr-only">Close</span>
75
+ </DialogPrimitive.Close>
76
+ )}
77
+ </DialogPrimitive.Content>
78
+ </DialogPortal>
79
+ )
80
+ }
81
+
82
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
83
+ return (
84
+ <div
85
+ data-slot="dialog-header"
86
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
87
+ {...props}
88
+ />
89
+ )
90
+ }
91
+
92
+ function DialogFooter({
93
+ className,
94
+ showCloseButton = false,
95
+ children,
96
+ ...props
97
+ }: React.ComponentProps<"div"> & {
98
+ showCloseButton?: boolean
99
+ }) {
100
+ return (
101
+ <div
102
+ data-slot="dialog-footer"
103
+ className={cn(
104
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
105
+ className
106
+ )}
107
+ {...props}
108
+ >
109
+ {children}
110
+ {showCloseButton && (
111
+ <DialogPrimitive.Close asChild>
112
+ <Button variant="outline">Close</Button>
113
+ </DialogPrimitive.Close>
114
+ )}
115
+ </div>
116
+ )
117
+ }
118
+
119
+ function DialogTitle({
120
+ className,
121
+ ...props
122
+ }: React.ComponentProps<typeof DialogPrimitive.Title>) {
123
+ return (
124
+ <DialogPrimitive.Title
125
+ data-slot="dialog-title"
126
+ className={cn("text-lg leading-none font-semibold", className)}
127
+ {...props}
128
+ />
129
+ )
130
+ }
131
+
132
+ function DialogDescription({
133
+ className,
134
+ ...props
135
+ }: React.ComponentProps<typeof DialogPrimitive.Description>) {
136
+ return (
137
+ <DialogPrimitive.Description
138
+ data-slot="dialog-description"
139
+ className={cn("text-sm text-muted-foreground", className)}
140
+ {...props}
141
+ />
142
+ )
143
+ }
144
+
145
+ export {
146
+ Dialog,
147
+ DialogClose,
148
+ DialogContent,
149
+ DialogDescription,
150
+ DialogFooter,
151
+ DialogHeader,
152
+ DialogOverlay,
153
+ DialogPortal,
154
+ DialogTitle,
155
+ DialogTrigger,
156
+ }
@@ -0,0 +1,22 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Direction } from "radix-ui"
5
+
6
+ function DirectionProvider({
7
+ dir,
8
+ direction,
9
+ children,
10
+ }: React.ComponentProps<typeof Direction.DirectionProvider> & {
11
+ direction?: React.ComponentProps<typeof Direction.DirectionProvider>["dir"]
12
+ }) {
13
+ return (
14
+ <Direction.DirectionProvider dir={direction ?? dir}>
15
+ {children}
16
+ </Direction.DirectionProvider>
17
+ )
18
+ }
19
+
20
+ const useDirection = Direction.useDirection
21
+
22
+ export { DirectionProvider, useDirection }
@@ -0,0 +1,133 @@
1
+ import * as React from "react"
2
+ import { Drawer as DrawerPrimitive } from "vaul"
3
+
4
+ import { cn } from "@/lib/utils"
5
+
6
+ function Drawer({
7
+ ...props
8
+ }: React.ComponentProps<typeof DrawerPrimitive.Root>) {
9
+ return <DrawerPrimitive.Root data-slot="drawer" {...props} />
10
+ }
11
+
12
+ function DrawerTrigger({
13
+ ...props
14
+ }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
15
+ return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
16
+ }
17
+
18
+ function DrawerPortal({
19
+ ...props
20
+ }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
21
+ return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
22
+ }
23
+
24
+ function DrawerClose({
25
+ ...props
26
+ }: React.ComponentProps<typeof DrawerPrimitive.Close>) {
27
+ return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
28
+ }
29
+
30
+ function DrawerOverlay({
31
+ className,
32
+ ...props
33
+ }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
34
+ return (
35
+ <DrawerPrimitive.Overlay
36
+ data-slot="drawer-overlay"
37
+ className={cn(
38
+ "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",
39
+ className
40
+ )}
41
+ {...props}
42
+ />
43
+ )
44
+ }
45
+
46
+ function DrawerContent({
47
+ className,
48
+ children,
49
+ ...props
50
+ }: React.ComponentProps<typeof DrawerPrimitive.Content>) {
51
+ return (
52
+ <DrawerPortal data-slot="drawer-portal">
53
+ <DrawerOverlay />
54
+ <DrawerPrimitive.Content
55
+ data-slot="drawer-content"
56
+ className={cn(
57
+ "group/drawer-content fixed z-50 flex h-auto flex-col bg-background",
58
+ "data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-lg data-[vaul-drawer-direction=top]:border-b",
59
+ "data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-lg data-[vaul-drawer-direction=bottom]:border-t",
60
+ "data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=right]:sm:max-w-sm",
61
+ "data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=left]:sm:max-w-sm",
62
+ className
63
+ )}
64
+ {...props}
65
+ >
66
+ <div className="mx-auto mt-4 hidden h-2 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
67
+ {children}
68
+ </DrawerPrimitive.Content>
69
+ </DrawerPortal>
70
+ )
71
+ }
72
+
73
+ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
74
+ return (
75
+ <div
76
+ data-slot="drawer-header"
77
+ className={cn(
78
+ "flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-1.5 md:text-left",
79
+ className
80
+ )}
81
+ {...props}
82
+ />
83
+ )
84
+ }
85
+
86
+ function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
87
+ return (
88
+ <div
89
+ data-slot="drawer-footer"
90
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
91
+ {...props}
92
+ />
93
+ )
94
+ }
95
+
96
+ function DrawerTitle({
97
+ className,
98
+ ...props
99
+ }: React.ComponentProps<typeof DrawerPrimitive.Title>) {
100
+ return (
101
+ <DrawerPrimitive.Title
102
+ data-slot="drawer-title"
103
+ className={cn("font-semibold text-foreground", className)}
104
+ {...props}
105
+ />
106
+ )
107
+ }
108
+
109
+ function DrawerDescription({
110
+ className,
111
+ ...props
112
+ }: React.ComponentProps<typeof DrawerPrimitive.Description>) {
113
+ return (
114
+ <DrawerPrimitive.Description
115
+ data-slot="drawer-description"
116
+ className={cn("text-sm text-muted-foreground", className)}
117
+ {...props}
118
+ />
119
+ )
120
+ }
121
+
122
+ export {
123
+ Drawer,
124
+ DrawerPortal,
125
+ DrawerOverlay,
126
+ DrawerTrigger,
127
+ DrawerClose,
128
+ DrawerContent,
129
+ DrawerHeader,
130
+ DrawerFooter,
131
+ DrawerTitle,
132
+ DrawerDescription,
133
+ }