create-rykira-app 1.0.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 (143) hide show
  1. package/README.md +50 -0
  2. package/bin/cli.js +149 -0
  3. package/deployment.md +168 -0
  4. package/how-to-deploy-package.md +132 -0
  5. package/package.json +23 -0
  6. package/starter-usage.md +132 -0
  7. package/template/.dockerignore +11 -0
  8. package/template/.env.example +20 -0
  9. package/template/.eslintrc.js +13 -0
  10. package/template/.github/workflows/ci.yml +60 -0
  11. package/template/.prettierignore +7 -0
  12. package/template/.prettierrc +11 -0
  13. package/template/README.md +21 -0
  14. package/template/apps/admin/app/favicon.ico +0 -0
  15. package/template/apps/admin/app/layout.tsx +30 -0
  16. package/template/apps/admin/app/page.tsx +19 -0
  17. package/template/apps/admin/components/.gitkeep +0 -0
  18. package/template/apps/admin/components/theme-provider.tsx +71 -0
  19. package/template/apps/admin/components.json +23 -0
  20. package/template/apps/admin/eslint.config.js +4 -0
  21. package/template/apps/admin/hooks/.gitkeep +0 -0
  22. package/template/apps/admin/lib/.gitkeep +0 -0
  23. package/template/apps/admin/next-env.d.ts +6 -0
  24. package/template/apps/admin/next.config.mjs +6 -0
  25. package/template/apps/admin/nixpacks.toml +8 -0
  26. package/template/apps/admin/package.json +32 -0
  27. package/template/apps/admin/postcss.config.mjs +1 -0
  28. package/template/apps/admin/tsconfig.json +23 -0
  29. package/template/apps/api/nixpacks.toml +8 -0
  30. package/template/apps/api/package.json +32 -0
  31. package/template/apps/api/src/index.ts +11 -0
  32. package/template/apps/api/src/server.ts +21 -0
  33. package/template/apps/api/tsconfig.json +18 -0
  34. package/template/apps/web/app/favicon.ico +0 -0
  35. package/template/apps/web/app/layout.tsx +30 -0
  36. package/template/apps/web/app/page.tsx +19 -0
  37. package/template/apps/web/components/.gitkeep +0 -0
  38. package/template/apps/web/components/theme-provider.tsx +71 -0
  39. package/template/apps/web/components.json +23 -0
  40. package/template/apps/web/eslint.config.js +4 -0
  41. package/template/apps/web/hooks/.gitkeep +0 -0
  42. package/template/apps/web/lib/.gitkeep +0 -0
  43. package/template/apps/web/next-env.d.ts +6 -0
  44. package/template/apps/web/next.config.mjs +6 -0
  45. package/template/apps/web/nixpacks.toml +8 -0
  46. package/template/apps/web/package.json +32 -0
  47. package/template/apps/web/postcss.config.mjs +1 -0
  48. package/template/apps/web/tsconfig.json +23 -0
  49. package/template/infrastructure/docker/Dockerfile.admin +36 -0
  50. package/template/infrastructure/docker/Dockerfile.api +36 -0
  51. package/template/infrastructure/docker/Dockerfile.web +48 -0
  52. package/template/infrastructure/docker/compose.dev.yml +50 -0
  53. package/template/infrastructure/docker/compose.prod.yml +119 -0
  54. package/template/infrastructure/scripts/deploy.sh +3 -0
  55. package/template/infrastructure/scripts/dev.sh +5 -0
  56. package/template/infrastructure/scripts/init-traefik.sh +10 -0
  57. package/template/infrastructure/scripts/setup-server.sh +25 -0
  58. package/template/infrastructure/scripts/update.sh +7 -0
  59. package/template/infrastructure/traefik/acme.json +0 -0
  60. package/template/infrastructure/traefik/dynamic.yml +23 -0
  61. package/template/infrastructure/traefik/traefik.yml +26 -0
  62. package/template/package.json +25 -0
  63. package/template/packages/eslint-config/README.md +3 -0
  64. package/template/packages/eslint-config/base.js +32 -0
  65. package/template/packages/eslint-config/next.js +51 -0
  66. package/template/packages/eslint-config/package.json +26 -0
  67. package/template/packages/eslint-config/react-internal.js +41 -0
  68. package/template/packages/typescript-config/README.md +3 -0
  69. package/template/packages/typescript-config/base.json +20 -0
  70. package/template/packages/typescript-config/nextjs.json +13 -0
  71. package/template/packages/typescript-config/package.json +9 -0
  72. package/template/packages/typescript-config/react-library.json +8 -0
  73. package/template/packages/ui/components.json +23 -0
  74. package/template/packages/ui/eslint.config.js +4 -0
  75. package/template/packages/ui/package.json +52 -0
  76. package/template/packages/ui/postcss.config.mjs +6 -0
  77. package/template/packages/ui/src/components/.gitkeep +0 -0
  78. package/template/packages/ui/src/components/accordion.tsx +74 -0
  79. package/template/packages/ui/src/components/alert-dialog.tsx +187 -0
  80. package/template/packages/ui/src/components/alert.tsx +76 -0
  81. package/template/packages/ui/src/components/aspect-ratio.tsx +22 -0
  82. package/template/packages/ui/src/components/avatar.tsx +109 -0
  83. package/template/packages/ui/src/components/badge.tsx +52 -0
  84. package/template/packages/ui/src/components/breadcrumb.tsx +125 -0
  85. package/template/packages/ui/src/components/button-group.tsx +87 -0
  86. package/template/packages/ui/src/components/button.tsx +60 -0
  87. package/template/packages/ui/src/components/calendar.tsx +221 -0
  88. package/template/packages/ui/src/components/card.tsx +103 -0
  89. package/template/packages/ui/src/components/carousel.tsx +242 -0
  90. package/template/packages/ui/src/components/chart.tsx +356 -0
  91. package/template/packages/ui/src/components/checkbox.tsx +29 -0
  92. package/template/packages/ui/src/components/collapsible.tsx +21 -0
  93. package/template/packages/ui/src/components/combobox.tsx +297 -0
  94. package/template/packages/ui/src/components/command.tsx +196 -0
  95. package/template/packages/ui/src/components/context-menu.tsx +271 -0
  96. package/template/packages/ui/src/components/dialog.tsx +157 -0
  97. package/template/packages/ui/src/components/direction.tsx +6 -0
  98. package/template/packages/ui/src/components/drawer.tsx +131 -0
  99. package/template/packages/ui/src/components/dropdown-menu.tsx +268 -0
  100. package/template/packages/ui/src/components/empty.tsx +101 -0
  101. package/template/packages/ui/src/components/field.tsx +238 -0
  102. package/template/packages/ui/src/components/hover-card.tsx +51 -0
  103. package/template/packages/ui/src/components/input-group.tsx +158 -0
  104. package/template/packages/ui/src/components/input-otp.tsx +87 -0
  105. package/template/packages/ui/src/components/input.tsx +20 -0
  106. package/template/packages/ui/src/components/item.tsx +201 -0
  107. package/template/packages/ui/src/components/kbd.tsx +26 -0
  108. package/template/packages/ui/src/components/label.tsx +20 -0
  109. package/template/packages/ui/src/components/menubar.tsx +280 -0
  110. package/template/packages/ui/src/components/native-select.tsx +52 -0
  111. package/template/packages/ui/src/components/navigation-menu.tsx +168 -0
  112. package/template/packages/ui/src/components/pagination.tsx +130 -0
  113. package/template/packages/ui/src/components/popover.tsx +90 -0
  114. package/template/packages/ui/src/components/progress.tsx +83 -0
  115. package/template/packages/ui/src/components/radio-group.tsx +38 -0
  116. package/template/packages/ui/src/components/resizable.tsx +50 -0
  117. package/template/packages/ui/src/components/scroll-area.tsx +55 -0
  118. package/template/packages/ui/src/components/select.tsx +201 -0
  119. package/template/packages/ui/src/components/separator.tsx +25 -0
  120. package/template/packages/ui/src/components/sheet.tsx +135 -0
  121. package/template/packages/ui/src/components/sidebar.tsx +723 -0
  122. package/template/packages/ui/src/components/skeleton.tsx +13 -0
  123. package/template/packages/ui/src/components/slider.tsx +59 -0
  124. package/template/packages/ui/src/components/sonner.tsx +49 -0
  125. package/template/packages/ui/src/components/spinner.tsx +10 -0
  126. package/template/packages/ui/src/components/switch.tsx +32 -0
  127. package/template/packages/ui/src/components/table.tsx +116 -0
  128. package/template/packages/ui/src/components/tabs.tsx +82 -0
  129. package/template/packages/ui/src/components/textarea.tsx +18 -0
  130. package/template/packages/ui/src/components/toggle-group.tsx +89 -0
  131. package/template/packages/ui/src/components/toggle.tsx +44 -0
  132. package/template/packages/ui/src/components/tooltip.tsx +66 -0
  133. package/template/packages/ui/src/hooks/.gitkeep +0 -0
  134. package/template/packages/ui/src/hooks/use-mobile.ts +19 -0
  135. package/template/packages/ui/src/lib/.gitkeep +0 -0
  136. package/template/packages/ui/src/lib/utils.ts +6 -0
  137. package/template/packages/ui/src/styles/globals.css +128 -0
  138. package/template/packages/ui/tsconfig.json +11 -0
  139. package/template/packages/ui/tsconfig.lint.json +8 -0
  140. package/template/pnpm-lock.yaml +9103 -0
  141. package/template/pnpm-workspace.yaml +3 -0
  142. package/template/tsconfig.json +4 -0
  143. package/template/turbo.json +24 -0
@@ -0,0 +1,271 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { ContextMenu as ContextMenuPrimitive } from "@base-ui/react/context-menu"
5
+
6
+ import { cn } from "@workspace/ui/lib/utils"
7
+ import { ChevronRightIcon, CheckIcon } from "lucide-react"
8
+
9
+ function ContextMenu({ ...props }: ContextMenuPrimitive.Root.Props) {
10
+ return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
11
+ }
12
+
13
+ function ContextMenuPortal({ ...props }: ContextMenuPrimitive.Portal.Props) {
14
+ return (
15
+ <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
16
+ )
17
+ }
18
+
19
+ function ContextMenuTrigger({
20
+ className,
21
+ ...props
22
+ }: ContextMenuPrimitive.Trigger.Props) {
23
+ return (
24
+ <ContextMenuPrimitive.Trigger
25
+ data-slot="context-menu-trigger"
26
+ className={cn("select-none", className)}
27
+ {...props}
28
+ />
29
+ )
30
+ }
31
+
32
+ function ContextMenuContent({
33
+ className,
34
+ align = "start",
35
+ alignOffset = 4,
36
+ side = "right",
37
+ sideOffset = 0,
38
+ ...props
39
+ }: ContextMenuPrimitive.Popup.Props &
40
+ Pick<
41
+ ContextMenuPrimitive.Positioner.Props,
42
+ "align" | "alignOffset" | "side" | "sideOffset"
43
+ >) {
44
+ return (
45
+ <ContextMenuPrimitive.Portal>
46
+ <ContextMenuPrimitive.Positioner
47
+ className="isolate z-50 outline-none"
48
+ align={align}
49
+ alignOffset={alignOffset}
50
+ side={side}
51
+ sideOffset={sideOffset}
52
+ >
53
+ <ContextMenuPrimitive.Popup
54
+ data-slot="context-menu-content"
55
+ className={cn("z-50 max-h-(--available-height) min-w-36 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-md bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95", className )}
56
+ {...props}
57
+ />
58
+ </ContextMenuPrimitive.Positioner>
59
+ </ContextMenuPrimitive.Portal>
60
+ )
61
+ }
62
+
63
+ function ContextMenuGroup({ ...props }: ContextMenuPrimitive.Group.Props) {
64
+ return (
65
+ <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
66
+ )
67
+ }
68
+
69
+ function ContextMenuLabel({
70
+ className,
71
+ inset,
72
+ ...props
73
+ }: ContextMenuPrimitive.GroupLabel.Props & {
74
+ inset?: boolean
75
+ }) {
76
+ return (
77
+ <ContextMenuPrimitive.GroupLabel
78
+ data-slot="context-menu-label"
79
+ data-inset={inset}
80
+ className={cn(
81
+ "px-2 py-1.5 text-xs font-medium text-muted-foreground data-inset:pl-8",
82
+ className
83
+ )}
84
+ {...props}
85
+ />
86
+ )
87
+ }
88
+
89
+ function ContextMenuItem({
90
+ className,
91
+ inset,
92
+ variant = "default",
93
+ ...props
94
+ }: ContextMenuPrimitive.Item.Props & {
95
+ inset?: boolean
96
+ variant?: "default" | "destructive"
97
+ }) {
98
+ return (
99
+ <ContextMenuPrimitive.Item
100
+ data-slot="context-menu-item"
101
+ data-inset={inset}
102
+ data-variant={variant}
103
+ className={cn(
104
+ "group/context-menu-item 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-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 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 focus:*:[svg]:text-accent-foreground data-[variant=destructive]:*:[svg]:text-destructive",
105
+ className
106
+ )}
107
+ {...props}
108
+ />
109
+ )
110
+ }
111
+
112
+ function ContextMenuSub({ ...props }: ContextMenuPrimitive.SubmenuRoot.Props) {
113
+ return (
114
+ <ContextMenuPrimitive.SubmenuRoot data-slot="context-menu-sub" {...props} />
115
+ )
116
+ }
117
+
118
+ function ContextMenuSubTrigger({
119
+ className,
120
+ inset,
121
+ children,
122
+ ...props
123
+ }: ContextMenuPrimitive.SubmenuTrigger.Props & {
124
+ inset?: boolean
125
+ }) {
126
+ return (
127
+ <ContextMenuPrimitive.SubmenuTrigger
128
+ data-slot="context-menu-sub-trigger"
129
+ data-inset={inset}
130
+ className={cn(
131
+ "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-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
132
+ className
133
+ )}
134
+ {...props}
135
+ >
136
+ {children}
137
+ <ChevronRightIcon className="ml-auto" />
138
+ </ContextMenuPrimitive.SubmenuTrigger>
139
+ )
140
+ }
141
+
142
+ function ContextMenuSubContent({
143
+ ...props
144
+ }: React.ComponentProps<typeof ContextMenuContent>) {
145
+ return (
146
+ <ContextMenuContent
147
+ data-slot="context-menu-sub-content"
148
+ className="shadow-lg"
149
+ side="right"
150
+ {...props}
151
+ />
152
+ )
153
+ }
154
+
155
+ function ContextMenuCheckboxItem({
156
+ className,
157
+ children,
158
+ checked,
159
+ inset,
160
+ ...props
161
+ }: ContextMenuPrimitive.CheckboxItem.Props & {
162
+ inset?: boolean
163
+ }) {
164
+ return (
165
+ <ContextMenuPrimitive.CheckboxItem
166
+ data-slot="context-menu-checkbox-item"
167
+ data-inset={inset}
168
+ className={cn(
169
+ "relative flex 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-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
170
+ className
171
+ )}
172
+ checked={checked}
173
+ {...props}
174
+ >
175
+ <span className="pointer-events-none absolute right-2">
176
+ <ContextMenuPrimitive.CheckboxItemIndicator>
177
+ <CheckIcon
178
+ />
179
+ </ContextMenuPrimitive.CheckboxItemIndicator>
180
+ </span>
181
+ {children}
182
+ </ContextMenuPrimitive.CheckboxItem>
183
+ )
184
+ }
185
+
186
+ function ContextMenuRadioGroup({
187
+ ...props
188
+ }: ContextMenuPrimitive.RadioGroup.Props) {
189
+ return (
190
+ <ContextMenuPrimitive.RadioGroup
191
+ data-slot="context-menu-radio-group"
192
+ {...props}
193
+ />
194
+ )
195
+ }
196
+
197
+ function ContextMenuRadioItem({
198
+ className,
199
+ children,
200
+ inset,
201
+ ...props
202
+ }: ContextMenuPrimitive.RadioItem.Props & {
203
+ inset?: boolean
204
+ }) {
205
+ return (
206
+ <ContextMenuPrimitive.RadioItem
207
+ data-slot="context-menu-radio-item"
208
+ data-inset={inset}
209
+ className={cn(
210
+ "relative flex 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-inset:pl-8 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
211
+ className
212
+ )}
213
+ {...props}
214
+ >
215
+ <span className="pointer-events-none absolute right-2">
216
+ <ContextMenuPrimitive.RadioItemIndicator>
217
+ <CheckIcon
218
+ />
219
+ </ContextMenuPrimitive.RadioItemIndicator>
220
+ </span>
221
+ {children}
222
+ </ContextMenuPrimitive.RadioItem>
223
+ )
224
+ }
225
+
226
+ function ContextMenuSeparator({
227
+ className,
228
+ ...props
229
+ }: ContextMenuPrimitive.Separator.Props) {
230
+ return (
231
+ <ContextMenuPrimitive.Separator
232
+ data-slot="context-menu-separator"
233
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
234
+ {...props}
235
+ />
236
+ )
237
+ }
238
+
239
+ function ContextMenuShortcut({
240
+ className,
241
+ ...props
242
+ }: React.ComponentProps<"span">) {
243
+ return (
244
+ <span
245
+ data-slot="context-menu-shortcut"
246
+ className={cn(
247
+ "ml-auto text-xs tracking-widest text-muted-foreground group-focus/context-menu-item:text-accent-foreground",
248
+ className
249
+ )}
250
+ {...props}
251
+ />
252
+ )
253
+ }
254
+
255
+ export {
256
+ ContextMenu,
257
+ ContextMenuTrigger,
258
+ ContextMenuContent,
259
+ ContextMenuItem,
260
+ ContextMenuCheckboxItem,
261
+ ContextMenuRadioItem,
262
+ ContextMenuLabel,
263
+ ContextMenuSeparator,
264
+ ContextMenuShortcut,
265
+ ContextMenuGroup,
266
+ ContextMenuPortal,
267
+ ContextMenuSub,
268
+ ContextMenuSubContent,
269
+ ContextMenuSubTrigger,
270
+ ContextMenuRadioGroup,
271
+ }
@@ -0,0 +1,157 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Dialog as DialogPrimitive } from "@base-ui/react/dialog"
5
+
6
+ import { cn } from "@workspace/ui/lib/utils"
7
+ import { Button } from "@workspace/ui/components/button"
8
+ import { XIcon } from "lucide-react"
9
+
10
+ function Dialog({ ...props }: DialogPrimitive.Root.Props) {
11
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
12
+ }
13
+
14
+ function DialogTrigger({ ...props }: DialogPrimitive.Trigger.Props) {
15
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
16
+ }
17
+
18
+ function DialogPortal({ ...props }: DialogPrimitive.Portal.Props) {
19
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
20
+ }
21
+
22
+ function DialogClose({ ...props }: DialogPrimitive.Close.Props) {
23
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
24
+ }
25
+
26
+ function DialogOverlay({
27
+ className,
28
+ ...props
29
+ }: DialogPrimitive.Backdrop.Props) {
30
+ return (
31
+ <DialogPrimitive.Backdrop
32
+ data-slot="dialog-overlay"
33
+ className={cn(
34
+ "fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
35
+ className
36
+ )}
37
+ {...props}
38
+ />
39
+ )
40
+ }
41
+
42
+ function DialogContent({
43
+ className,
44
+ children,
45
+ showCloseButton = true,
46
+ ...props
47
+ }: DialogPrimitive.Popup.Props & {
48
+ showCloseButton?: boolean
49
+ }) {
50
+ return (
51
+ <DialogPortal>
52
+ <DialogOverlay />
53
+ <DialogPrimitive.Popup
54
+ data-slot="dialog-content"
55
+ className={cn(
56
+ "fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-6 rounded-xl bg-background p-6 text-sm ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-md data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
57
+ className
58
+ )}
59
+ {...props}
60
+ >
61
+ {children}
62
+ {showCloseButton && (
63
+ <DialogPrimitive.Close
64
+ data-slot="dialog-close"
65
+ render={
66
+ <Button
67
+ variant="ghost"
68
+ className="absolute top-4 right-4"
69
+ size="icon-sm"
70
+ />
71
+ }
72
+ >
73
+ <XIcon
74
+ />
75
+ <span className="sr-only">Close</span>
76
+ </DialogPrimitive.Close>
77
+ )}
78
+ </DialogPrimitive.Popup>
79
+ </DialogPortal>
80
+ )
81
+ }
82
+
83
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
84
+ return (
85
+ <div
86
+ data-slot="dialog-header"
87
+ className={cn("flex flex-col gap-2", className)}
88
+ {...props}
89
+ />
90
+ )
91
+ }
92
+
93
+ function DialogFooter({
94
+ className,
95
+ showCloseButton = false,
96
+ children,
97
+ ...props
98
+ }: React.ComponentProps<"div"> & {
99
+ showCloseButton?: boolean
100
+ }) {
101
+ return (
102
+ <div
103
+ data-slot="dialog-footer"
104
+ className={cn(
105
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
106
+ className
107
+ )}
108
+ {...props}
109
+ >
110
+ {children}
111
+ {showCloseButton && (
112
+ <DialogPrimitive.Close render={<Button variant="outline" />}>
113
+ Close
114
+ </DialogPrimitive.Close>
115
+ )}
116
+ </div>
117
+ )
118
+ }
119
+
120
+ function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
121
+ return (
122
+ <DialogPrimitive.Title
123
+ data-slot="dialog-title"
124
+ className={cn("leading-none font-medium", className)}
125
+ {...props}
126
+ />
127
+ )
128
+ }
129
+
130
+ function DialogDescription({
131
+ className,
132
+ ...props
133
+ }: DialogPrimitive.Description.Props) {
134
+ return (
135
+ <DialogPrimitive.Description
136
+ data-slot="dialog-description"
137
+ className={cn(
138
+ "text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground",
139
+ className
140
+ )}
141
+ {...props}
142
+ />
143
+ )
144
+ }
145
+
146
+ export {
147
+ Dialog,
148
+ DialogClose,
149
+ DialogContent,
150
+ DialogDescription,
151
+ DialogFooter,
152
+ DialogHeader,
153
+ DialogOverlay,
154
+ DialogPortal,
155
+ DialogTitle,
156
+ DialogTrigger,
157
+ }
@@ -0,0 +1,6 @@
1
+ "use client"
2
+
3
+ export {
4
+ DirectionProvider,
5
+ useDirection,
6
+ } from "@base-ui/react/direction-provider"
@@ -0,0 +1,131 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Drawer as DrawerPrimitive } from "vaul"
5
+
6
+ import { cn } from "@workspace/ui/lib/utils"
7
+
8
+ function Drawer({
9
+ ...props
10
+ }: React.ComponentProps<typeof DrawerPrimitive.Root>) {
11
+ return <DrawerPrimitive.Root data-slot="drawer" {...props} />
12
+ }
13
+
14
+ function DrawerTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {
17
+ return <DrawerPrimitive.Trigger data-slot="drawer-trigger" {...props} />
18
+ }
19
+
20
+ function DrawerPortal({
21
+ ...props
22
+ }: React.ComponentProps<typeof DrawerPrimitive.Portal>) {
23
+ return <DrawerPrimitive.Portal data-slot="drawer-portal" {...props} />
24
+ }
25
+
26
+ function DrawerClose({
27
+ ...props
28
+ }: React.ComponentProps<typeof DrawerPrimitive.Close>) {
29
+ return <DrawerPrimitive.Close data-slot="drawer-close" {...props} />
30
+ }
31
+
32
+ function DrawerOverlay({
33
+ className,
34
+ ...props
35
+ }: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {
36
+ return (
37
+ <DrawerPrimitive.Overlay
38
+ data-slot="drawer-overlay"
39
+ className={cn(
40
+ "fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ )
46
+ }
47
+
48
+ function DrawerContent({
49
+ className,
50
+ children,
51
+ ...props
52
+ }: React.ComponentProps<typeof DrawerPrimitive.Content>) {
53
+ return (
54
+ <DrawerPortal data-slot="drawer-portal">
55
+ <DrawerOverlay />
56
+ <DrawerPrimitive.Content
57
+ data-slot="drawer-content"
58
+ className={cn(
59
+ "group/drawer-content fixed z-50 flex h-auto flex-col bg-background text-sm 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-xl data-[vaul-drawer-direction=bottom]:border-t 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]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r 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]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l 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-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:sm:max-w-sm data-[vaul-drawer-direction=right]:sm:max-w-sm",
60
+ className
61
+ )}
62
+ {...props}
63
+ >
64
+ <div className="mx-auto mt-4 hidden h-1.5 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" />
65
+ {children}
66
+ </DrawerPrimitive.Content>
67
+ </DrawerPortal>
68
+ )
69
+ }
70
+
71
+ function DrawerHeader({ className, ...props }: React.ComponentProps<"div">) {
72
+ return (
73
+ <div
74
+ data-slot="drawer-header"
75
+ className={cn(
76
+ "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",
77
+ className
78
+ )}
79
+ {...props}
80
+ />
81
+ )
82
+ }
83
+
84
+ function DrawerFooter({ className, ...props }: React.ComponentProps<"div">) {
85
+ return (
86
+ <div
87
+ data-slot="drawer-footer"
88
+ className={cn("mt-auto flex flex-col gap-2 p-4", className)}
89
+ {...props}
90
+ />
91
+ )
92
+ }
93
+
94
+ function DrawerTitle({
95
+ className,
96
+ ...props
97
+ }: React.ComponentProps<typeof DrawerPrimitive.Title>) {
98
+ return (
99
+ <DrawerPrimitive.Title
100
+ data-slot="drawer-title"
101
+ className={cn("font-medium text-foreground", className)}
102
+ {...props}
103
+ />
104
+ )
105
+ }
106
+
107
+ function DrawerDescription({
108
+ className,
109
+ ...props
110
+ }: React.ComponentProps<typeof DrawerPrimitive.Description>) {
111
+ return (
112
+ <DrawerPrimitive.Description
113
+ data-slot="drawer-description"
114
+ className={cn("text-sm text-muted-foreground", className)}
115
+ {...props}
116
+ />
117
+ )
118
+ }
119
+
120
+ export {
121
+ Drawer,
122
+ DrawerPortal,
123
+ DrawerOverlay,
124
+ DrawerTrigger,
125
+ DrawerClose,
126
+ DrawerContent,
127
+ DrawerHeader,
128
+ DrawerFooter,
129
+ DrawerTitle,
130
+ DrawerDescription,
131
+ }