create-ej-app 12.0.0 → 15.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 (141) hide show
  1. package/cli.js +5 -4
  2. package/cli.ts +9 -4
  3. package/package.json +3 -3
  4. package/template/base/package.json +23 -29
  5. package/template/base/src/lib/auth.ts +15 -6
  6. package/template/base/terraform/artifact-registry.tf +5 -0
  7. package/template/base/terraform/backend-service.tf +13 -0
  8. package/template/base/terraform/cleanup.sh +9 -0
  9. package/template/base/terraform/cloudbuild.tf +70 -0
  10. package/template/base/terraform/cloudrun.tf +68 -0
  11. package/template/base/terraform/database.tf +60 -0
  12. package/template/base/terraform/forwarding-rule.tf +43 -0
  13. package/template/base/terraform/ip-address.tf +11 -0
  14. package/template/base/terraform/network-endpoint-group.tf +11 -0
  15. package/template/base/terraform/network.tf +21 -0
  16. package/template/base/terraform/pre.sh +3 -0
  17. package/template/base/terraform/providers.tf +18 -0
  18. package/template/base/terraform/secret.txt +11 -0
  19. package/template/base/terraform/setup.sh +25 -0
  20. package/template/base/terraform/ssl-certs.tf +32 -0
  21. package/template/base/terraform/target-https-proxy copy.tf +14 -0
  22. package/template/base/terraform/target-https-proxy.tf +14 -0
  23. package/template/base/terraform/terraform.tfvars +4 -0
  24. package/template/base/terraform/url-map.tf +23 -0
  25. package/template/base/terraform/variables.tf +21 -0
  26. package/template/old/.env.example +0 -17
  27. package/template/old/.eslintrc.cjs +0 -26
  28. package/template/old/components.json +0 -17
  29. package/template/old/drizzle.config.ts +0 -11
  30. package/template/old/next.config.mjs +0 -4
  31. package/template/old/package.json +0 -87
  32. package/template/old/postcss.config.mjs +0 -8
  33. package/template/old/prettier.config.mjs +0 -11
  34. package/template/old/public/next.svg +0 -1
  35. package/template/old/public/vercel.svg +0 -1
  36. package/template/old/src/app/(app)/dashboard/layout.tsx +0 -14
  37. package/template/old/src/app/(app)/dashboard/page.tsx +0 -12
  38. package/template/old/src/app/(app)/layout.tsx +0 -125
  39. package/template/old/src/app/(app)/roles/[id]/actions.ts +0 -59
  40. package/template/old/src/app/(app)/roles/[id]/page.tsx +0 -46
  41. package/template/old/src/app/(app)/roles/[id]/render.tsx +0 -264
  42. package/template/old/src/app/(app)/roles/[id]/validation.ts +0 -22
  43. package/template/old/src/app/(app)/roles/actions.ts +0 -33
  44. package/template/old/src/app/(app)/roles/page.tsx +0 -52
  45. package/template/old/src/app/(app)/roles/render.tsx +0 -80
  46. package/template/old/src/app/(app)/settings/actions.ts +0 -17
  47. package/template/old/src/app/(app)/settings/layout.tsx +0 -14
  48. package/template/old/src/app/(app)/settings/loading.tsx +0 -28
  49. package/template/old/src/app/(app)/settings/page.tsx +0 -19
  50. package/template/old/src/app/(app)/settings/render.tsx +0 -107
  51. package/template/old/src/app/(app)/settings/validation.ts +0 -5
  52. package/template/old/src/app/(app)/tasks/[id]/actions.ts +0 -92
  53. package/template/old/src/app/(app)/tasks/[id]/page.tsx +0 -59
  54. package/template/old/src/app/(app)/tasks/[id]/render.tsx +0 -482
  55. package/template/old/src/app/(app)/tasks/[id]/validation.ts +0 -18
  56. package/template/old/src/app/(app)/tasks/actions.ts +0 -39
  57. package/template/old/src/app/(app)/tasks/page.tsx +0 -59
  58. package/template/old/src/app/(app)/tasks/render.tsx +0 -129
  59. package/template/old/src/app/(app)/tasks/statusEnum.ts +0 -3
  60. package/template/old/src/app/(app)/users/[id]/actions.ts +0 -68
  61. package/template/old/src/app/(app)/users/[id]/page.tsx +0 -39
  62. package/template/old/src/app/(app)/users/[id]/render.tsx +0 -325
  63. package/template/old/src/app/(app)/users/[id]/validation.ts +0 -18
  64. package/template/old/src/app/(app)/users/actions.ts +0 -34
  65. package/template/old/src/app/(app)/users/page.tsx +0 -62
  66. package/template/old/src/app/(app)/users/render.tsx +0 -124
  67. package/template/old/src/app/(auth)/layout.tsx +0 -27
  68. package/template/old/src/app/(auth)/login/page.tsx +0 -49
  69. package/template/old/src/app/(auth)/login/render.tsx +0 -146
  70. package/template/old/src/app/(marketing)/layout.tsx +0 -42
  71. package/template/old/src/app/(marketing)/page.tsx +0 -97
  72. package/template/old/src/app/api/auth/[...nextauth]/route.ts +0 -7
  73. package/template/old/src/app/favicon.ico +0 -0
  74. package/template/old/src/app/globals.css +0 -76
  75. package/template/old/src/app/layout.tsx +0 -31
  76. package/template/old/src/components/app-nav-command.tsx +0 -178
  77. package/template/old/src/components/dark-mode-toggle.tsx +0 -43
  78. package/template/old/src/components/data-table/data-table-column-header.tsx +0 -91
  79. package/template/old/src/components/data-table/data-table-faceted-filter.tsx +0 -149
  80. package/template/old/src/components/data-table/data-table-loading.tsx +0 -77
  81. package/template/old/src/components/data-table/data-table-pagination.tsx +0 -94
  82. package/template/old/src/components/data-table/data-table-toolbar.tsx +0 -78
  83. package/template/old/src/components/data-table/data-table-types.ts +0 -17
  84. package/template/old/src/components/data-table/data-table-view-options.tsx +0 -59
  85. package/template/old/src/components/data-table/data-table.tsx +0 -301
  86. package/template/old/src/components/data-table/simple-data-table.tsx +0 -109
  87. package/template/old/src/components/empty-placeholder.tsx +0 -78
  88. package/template/old/src/components/heading.tsx +0 -17
  89. package/template/old/src/components/icons.tsx +0 -101
  90. package/template/old/src/components/main-nav.tsx +0 -64
  91. package/template/old/src/components/mobile-nav.tsx +0 -50
  92. package/template/old/src/components/shell.tsx +0 -13
  93. package/template/old/src/components/side-nav.tsx +0 -51
  94. package/template/old/src/components/site-footer.tsx +0 -31
  95. package/template/old/src/components/system-info.tsx +0 -36
  96. package/template/old/src/components/ui/alert-dialog.tsx +0 -141
  97. package/template/old/src/components/ui/avatar.tsx +0 -50
  98. package/template/old/src/components/ui/badge.tsx +0 -36
  99. package/template/old/src/components/ui/button.tsx +0 -56
  100. package/template/old/src/components/ui/card.tsx +0 -79
  101. package/template/old/src/components/ui/checkbox.tsx +0 -30
  102. package/template/old/src/components/ui/command.tsx +0 -155
  103. package/template/old/src/components/ui/dialog.tsx +0 -122
  104. package/template/old/src/components/ui/dropdown-menu.tsx +0 -200
  105. package/template/old/src/components/ui/form.tsx +0 -176
  106. package/template/old/src/components/ui/input.tsx +0 -25
  107. package/template/old/src/components/ui/label.tsx +0 -26
  108. package/template/old/src/components/ui/popover.tsx +0 -31
  109. package/template/old/src/components/ui/select.tsx +0 -160
  110. package/template/old/src/components/ui/separator.tsx +0 -31
  111. package/template/old/src/components/ui/skeleton.tsx +0 -15
  112. package/template/old/src/components/ui/sonner.tsx +0 -31
  113. package/template/old/src/components/ui/table.tsx +0 -117
  114. package/template/old/src/components/user-account-nav.tsx +0 -60
  115. package/template/old/src/components/user-avatar.tsx +0 -27
  116. package/template/old/src/data-access/resource.ts +0 -85
  117. package/template/old/src/data-access/role-permission.ts +0 -45
  118. package/template/old/src/data-access/role.ts +0 -105
  119. package/template/old/src/data-access/task.ts +0 -141
  120. package/template/old/src/data-access/user.ts +0 -141
  121. package/template/old/src/db/index.ts +0 -14
  122. package/template/old/src/db/schema.ts +0 -287
  123. package/template/old/src/env.mjs +0 -58
  124. package/template/old/src/hooks/use-debounce.tsx +0 -17
  125. package/template/old/src/hooks/use-lock-body.tsx +0 -13
  126. package/template/old/src/lib/auth.ts +0 -89
  127. package/template/old/src/lib/cn.ts +0 -4
  128. package/template/old/src/lib/currentUser.ts +0 -8
  129. package/template/old/src/lib/delay.ts +0 -2
  130. package/template/old/src/lib/formatDate.ts +0 -11
  131. package/template/old/src/lib/generateLabel.ts +0 -5
  132. package/template/old/src/lib/s3Client.ts +0 -156
  133. package/template/old/src/lib/safe-action.ts +0 -19
  134. package/template/old/src/lib/siteConfig.ts +0 -4
  135. package/template/old/src/lib/sortOrderEnum.ts +0 -2
  136. package/template/old/src/use-case/role-permission.ts +0 -19
  137. package/template/old/src/use-case/role.ts +0 -110
  138. package/template/old/src/use-case/task.ts +0 -166
  139. package/template/old/src/use-case/user.ts +0 -121
  140. package/template/old/tailwind.config.ts +0 -81
  141. package/template/old/tsconfig.json +0 -47
@@ -1,79 +0,0 @@
1
- import * as React from 'react'
2
-
3
- import { cn } from '@/lib/cn'
4
-
5
- const Card = React.forwardRef<
6
- HTMLDivElement,
7
- React.HTMLAttributes<HTMLDivElement>
8
- >(({ className, ...props }, ref) => (
9
- <div
10
- ref={ref}
11
- className={cn(
12
- 'rounded-lg border bg-card text-card-foreground shadow-sm',
13
- className
14
- )}
15
- {...props}
16
- />
17
- ))
18
- Card.displayName = 'Card'
19
-
20
- const CardHeader = React.forwardRef<
21
- HTMLDivElement,
22
- React.HTMLAttributes<HTMLDivElement>
23
- >(({ className, ...props }, ref) => (
24
- <div
25
- ref={ref}
26
- className={cn('flex flex-col space-y-1.5 p-6', className)}
27
- {...props}
28
- />
29
- ))
30
- CardHeader.displayName = 'CardHeader'
31
-
32
- const CardTitle = React.forwardRef<
33
- HTMLParagraphElement,
34
- React.HTMLAttributes<HTMLHeadingElement>
35
- >(({ className, ...props }, ref) => (
36
- <h3
37
- ref={ref}
38
- className={cn(
39
- 'text-2xl font-semibold leading-none tracking-tight',
40
- className
41
- )}
42
- {...props}
43
- />
44
- ))
45
- CardTitle.displayName = 'CardTitle'
46
-
47
- const CardDescription = React.forwardRef<
48
- HTMLParagraphElement,
49
- React.HTMLAttributes<HTMLParagraphElement>
50
- >(({ className, ...props }, ref) => (
51
- <p
52
- ref={ref}
53
- className={cn('text-sm text-muted-foreground', className)}
54
- {...props}
55
- />
56
- ))
57
- CardDescription.displayName = 'CardDescription'
58
-
59
- const CardContent = React.forwardRef<
60
- HTMLDivElement,
61
- React.HTMLAttributes<HTMLDivElement>
62
- >(({ className, ...props }, ref) => (
63
- <div ref={ref} className={cn('p-6 pt-0', className)} {...props} />
64
- ))
65
- CardContent.displayName = 'CardContent'
66
-
67
- const CardFooter = React.forwardRef<
68
- HTMLDivElement,
69
- React.HTMLAttributes<HTMLDivElement>
70
- >(({ className, ...props }, ref) => (
71
- <div
72
- ref={ref}
73
- className={cn('flex items-center p-6 pt-0', className)}
74
- {...props}
75
- />
76
- ))
77
- CardFooter.displayName = 'CardFooter'
78
-
79
- export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }
@@ -1,30 +0,0 @@
1
- 'use client'
2
-
3
- import * as CheckboxPrimitive from '@radix-ui/react-checkbox'
4
- import { Check } from 'lucide-react'
5
- import * as React from 'react'
6
-
7
- import { cn } from '@/lib/cn'
8
-
9
- const Checkbox = React.forwardRef<
10
- React.ElementRef<typeof CheckboxPrimitive.Root>,
11
- React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>
12
- >(({ className, ...props }, ref) => (
13
- <CheckboxPrimitive.Root
14
- ref={ref}
15
- className={cn(
16
- 'peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground',
17
- className
18
- )}
19
- {...props}
20
- >
21
- <CheckboxPrimitive.Indicator
22
- className={cn('flex items-center justify-center text-current')}
23
- >
24
- <Check className="h-4 w-4" />
25
- </CheckboxPrimitive.Indicator>
26
- </CheckboxPrimitive.Root>
27
- ))
28
- Checkbox.displayName = CheckboxPrimitive.Root.displayName
29
-
30
- export { Checkbox }
@@ -1,155 +0,0 @@
1
- 'use client'
2
-
3
- import { type DialogProps } from '@radix-ui/react-dialog'
4
- import { Command as CommandPrimitive } from 'cmdk'
5
- import { Search } from 'lucide-react'
6
- import * as React from 'react'
7
-
8
- import { Dialog, DialogContent } from '@/components/ui/dialog'
9
- import { cn } from '@/lib/cn'
10
-
11
- const Command = React.forwardRef<
12
- React.ElementRef<typeof CommandPrimitive>,
13
- React.ComponentPropsWithoutRef<typeof CommandPrimitive>
14
- >(({ className, ...props }, ref) => (
15
- <CommandPrimitive
16
- ref={ref}
17
- className={cn(
18
- 'flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground',
19
- className
20
- )}
21
- {...props}
22
- />
23
- ))
24
- Command.displayName = CommandPrimitive.displayName
25
-
26
- interface CommandDialogProps extends DialogProps {}
27
-
28
- const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
29
- return (
30
- <Dialog {...props}>
31
- <DialogContent className="overflow-hidden p-0 shadow-lg">
32
- <Command className="[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
33
- {children}
34
- </Command>
35
- </DialogContent>
36
- </Dialog>
37
- )
38
- }
39
-
40
- const CommandInput = React.forwardRef<
41
- React.ElementRef<typeof CommandPrimitive.Input>,
42
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
43
- >(({ className, ...props }, ref) => (
44
- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
45
- <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
46
- <CommandPrimitive.Input
47
- ref={ref}
48
- className={cn(
49
- 'flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50',
50
- className
51
- )}
52
- {...props}
53
- />
54
- </div>
55
- ))
56
-
57
- CommandInput.displayName = CommandPrimitive.Input.displayName
58
-
59
- const CommandList = React.forwardRef<
60
- React.ElementRef<typeof CommandPrimitive.List>,
61
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
62
- >(({ className, ...props }, ref) => (
63
- <CommandPrimitive.List
64
- ref={ref}
65
- className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}
66
- {...props}
67
- />
68
- ))
69
-
70
- CommandList.displayName = CommandPrimitive.List.displayName
71
-
72
- const CommandEmpty = React.forwardRef<
73
- React.ElementRef<typeof CommandPrimitive.Empty>,
74
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
75
- >((props, ref) => (
76
- <CommandPrimitive.Empty
77
- ref={ref}
78
- className="py-6 text-center text-sm"
79
- {...props}
80
- />
81
- ))
82
-
83
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName
84
-
85
- const CommandGroup = React.forwardRef<
86
- React.ElementRef<typeof CommandPrimitive.Group>,
87
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
88
- >(({ className, ...props }, ref) => (
89
- <CommandPrimitive.Group
90
- ref={ref}
91
- className={cn(
92
- 'overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground',
93
- className
94
- )}
95
- {...props}
96
- />
97
- ))
98
-
99
- CommandGroup.displayName = CommandPrimitive.Group.displayName
100
-
101
- const CommandSeparator = React.forwardRef<
102
- React.ElementRef<typeof CommandPrimitive.Separator>,
103
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
104
- >(({ className, ...props }, ref) => (
105
- <CommandPrimitive.Separator
106
- ref={ref}
107
- className={cn('-mx-1 h-px bg-border', className)}
108
- {...props}
109
- />
110
- ))
111
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName
112
-
113
- const CommandItem = React.forwardRef<
114
- React.ElementRef<typeof CommandPrimitive.Item>,
115
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
116
- >(({ className, ...props }, ref) => (
117
- <CommandPrimitive.Item
118
- ref={ref}
119
- className={cn(
120
- 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50',
121
- className
122
- )}
123
- {...props}
124
- />
125
- ))
126
-
127
- CommandItem.displayName = CommandPrimitive.Item.displayName
128
-
129
- const CommandShortcut = ({
130
- className,
131
- ...props
132
- }: React.HTMLAttributes<HTMLSpanElement>) => {
133
- return (
134
- <span
135
- className={cn(
136
- 'ml-auto text-xs tracking-widest text-muted-foreground',
137
- className
138
- )}
139
- {...props}
140
- />
141
- )
142
- }
143
- CommandShortcut.displayName = 'CommandShortcut'
144
-
145
- export {
146
- Command,
147
- CommandDialog,
148
- CommandEmpty,
149
- CommandGroup,
150
- CommandInput,
151
- CommandItem,
152
- CommandList,
153
- CommandSeparator,
154
- CommandShortcut
155
- }
@@ -1,122 +0,0 @@
1
- 'use client'
2
-
3
- import * as DialogPrimitive from '@radix-ui/react-dialog'
4
- import { X } from 'lucide-react'
5
- import * as React from 'react'
6
-
7
- import { cn } from '@/lib/cn'
8
-
9
- const Dialog = DialogPrimitive.Root
10
-
11
- const DialogTrigger = DialogPrimitive.Trigger
12
-
13
- const DialogPortal = DialogPrimitive.Portal
14
-
15
- const DialogClose = DialogPrimitive.Close
16
-
17
- const DialogOverlay = React.forwardRef<
18
- React.ElementRef<typeof DialogPrimitive.Overlay>,
19
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Overlay>
20
- >(({ className, ...props }, ref) => (
21
- <DialogPrimitive.Overlay
22
- ref={ref}
23
- className={cn(
24
- 'fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
25
- className
26
- )}
27
- {...props}
28
- />
29
- ))
30
- DialogOverlay.displayName = DialogPrimitive.Overlay.displayName
31
-
32
- const DialogContent = React.forwardRef<
33
- React.ElementRef<typeof DialogPrimitive.Content>,
34
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>
35
- >(({ className, children, ...props }, ref) => (
36
- <DialogPortal>
37
- <DialogOverlay />
38
- <DialogPrimitive.Content
39
- ref={ref}
40
- className={cn(
41
- 'fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
42
- className
43
- )}
44
- {...props}
45
- >
46
- {children}
47
- <DialogPrimitive.Close className="absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground">
48
- <X className="h-4 w-4" />
49
- <span className="sr-only">Close</span>
50
- </DialogPrimitive.Close>
51
- </DialogPrimitive.Content>
52
- </DialogPortal>
53
- ))
54
- DialogContent.displayName = DialogPrimitive.Content.displayName
55
-
56
- const DialogHeader = ({
57
- className,
58
- ...props
59
- }: React.HTMLAttributes<HTMLDivElement>) => (
60
- <div
61
- className={cn(
62
- 'flex flex-col space-y-1.5 text-center sm:text-left',
63
- className
64
- )}
65
- {...props}
66
- />
67
- )
68
- DialogHeader.displayName = 'DialogHeader'
69
-
70
- const DialogFooter = ({
71
- className,
72
- ...props
73
- }: React.HTMLAttributes<HTMLDivElement>) => (
74
- <div
75
- className={cn(
76
- 'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
77
- className
78
- )}
79
- {...props}
80
- />
81
- )
82
- DialogFooter.displayName = 'DialogFooter'
83
-
84
- const DialogTitle = React.forwardRef<
85
- React.ElementRef<typeof DialogPrimitive.Title>,
86
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>
87
- >(({ className, ...props }, ref) => (
88
- <DialogPrimitive.Title
89
- ref={ref}
90
- className={cn(
91
- 'text-lg font-semibold leading-none tracking-tight',
92
- className
93
- )}
94
- {...props}
95
- />
96
- ))
97
- DialogTitle.displayName = DialogPrimitive.Title.displayName
98
-
99
- const DialogDescription = React.forwardRef<
100
- React.ElementRef<typeof DialogPrimitive.Description>,
101
- React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>
102
- >(({ className, ...props }, ref) => (
103
- <DialogPrimitive.Description
104
- ref={ref}
105
- className={cn('text-sm text-muted-foreground', className)}
106
- {...props}
107
- />
108
- ))
109
- DialogDescription.displayName = DialogPrimitive.Description.displayName
110
-
111
- export {
112
- Dialog,
113
- DialogClose,
114
- DialogContent,
115
- DialogDescription,
116
- DialogFooter,
117
- DialogHeader,
118
- DialogOverlay,
119
- DialogPortal,
120
- DialogTitle,
121
- DialogTrigger
122
- }
@@ -1,200 +0,0 @@
1
- 'use client'
2
-
3
- import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'
4
- import { Check, ChevronRight, Circle } from 'lucide-react'
5
- import * as React from 'react'
6
-
7
- import { cn } from '@/lib/cn'
8
-
9
- const DropdownMenu = DropdownMenuPrimitive.Root
10
-
11
- const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger
12
-
13
- const DropdownMenuGroup = DropdownMenuPrimitive.Group
14
-
15
- const DropdownMenuPortal = DropdownMenuPrimitive.Portal
16
-
17
- const DropdownMenuSub = DropdownMenuPrimitive.Sub
18
-
19
- const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup
20
-
21
- const DropdownMenuSubTrigger = React.forwardRef<
22
- React.ElementRef<typeof DropdownMenuPrimitive.SubTrigger>,
23
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {
24
- inset?: boolean
25
- }
26
- >(({ className, inset, children, ...props }, ref) => (
27
- <DropdownMenuPrimitive.SubTrigger
28
- ref={ref}
29
- className={cn(
30
- 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
31
- inset && 'pl-8',
32
- className
33
- )}
34
- {...props}
35
- >
36
- {children}
37
- <ChevronRight className="ml-auto h-4 w-4" />
38
- </DropdownMenuPrimitive.SubTrigger>
39
- ))
40
- DropdownMenuSubTrigger.displayName =
41
- DropdownMenuPrimitive.SubTrigger.displayName
42
-
43
- const DropdownMenuSubContent = React.forwardRef<
44
- React.ElementRef<typeof DropdownMenuPrimitive.SubContent>,
45
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>
46
- >(({ className, ...props }, ref) => (
47
- <DropdownMenuPrimitive.SubContent
48
- ref={ref}
49
- className={cn(
50
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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',
51
- className
52
- )}
53
- {...props}
54
- />
55
- ))
56
- DropdownMenuSubContent.displayName =
57
- DropdownMenuPrimitive.SubContent.displayName
58
-
59
- const DropdownMenuContent = React.forwardRef<
60
- React.ElementRef<typeof DropdownMenuPrimitive.Content>,
61
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>
62
- >(({ className, sideOffset = 4, ...props }, ref) => (
63
- <DropdownMenuPrimitive.Portal>
64
- <DropdownMenuPrimitive.Content
65
- ref={ref}
66
- sideOffset={sideOffset}
67
- className={cn(
68
- 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]: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',
69
- className
70
- )}
71
- {...props}
72
- />
73
- </DropdownMenuPrimitive.Portal>
74
- ))
75
- DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName
76
-
77
- const DropdownMenuItem = React.forwardRef<
78
- React.ElementRef<typeof DropdownMenuPrimitive.Item>,
79
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {
80
- inset?: boolean
81
- }
82
- >(({ className, inset, ...props }, ref) => (
83
- <DropdownMenuPrimitive.Item
84
- ref={ref}
85
- className={cn(
86
- 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
87
- inset && 'pl-8',
88
- className
89
- )}
90
- {...props}
91
- />
92
- ))
93
- DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName
94
-
95
- const DropdownMenuCheckboxItem = React.forwardRef<
96
- React.ElementRef<typeof DropdownMenuPrimitive.CheckboxItem>,
97
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>
98
- >(({ className, children, checked, ...props }, ref) => (
99
- <DropdownMenuPrimitive.CheckboxItem
100
- ref={ref}
101
- className={cn(
102
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
103
- className
104
- )}
105
- checked={checked}
106
- {...props}
107
- >
108
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
109
- <DropdownMenuPrimitive.ItemIndicator>
110
- <Check className="h-4 w-4" />
111
- </DropdownMenuPrimitive.ItemIndicator>
112
- </span>
113
- {children}
114
- </DropdownMenuPrimitive.CheckboxItem>
115
- ))
116
- DropdownMenuCheckboxItem.displayName =
117
- DropdownMenuPrimitive.CheckboxItem.displayName
118
-
119
- const DropdownMenuRadioItem = React.forwardRef<
120
- React.ElementRef<typeof DropdownMenuPrimitive.RadioItem>,
121
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>
122
- >(({ className, children, ...props }, ref) => (
123
- <DropdownMenuPrimitive.RadioItem
124
- ref={ref}
125
- className={cn(
126
- 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
127
- className
128
- )}
129
- {...props}
130
- >
131
- <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
132
- <DropdownMenuPrimitive.ItemIndicator>
133
- <Circle className="h-2 w-2 fill-current" />
134
- </DropdownMenuPrimitive.ItemIndicator>
135
- </span>
136
- {children}
137
- </DropdownMenuPrimitive.RadioItem>
138
- ))
139
- DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName
140
-
141
- const DropdownMenuLabel = React.forwardRef<
142
- React.ElementRef<typeof DropdownMenuPrimitive.Label>,
143
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {
144
- inset?: boolean
145
- }
146
- >(({ className, inset, ...props }, ref) => (
147
- <DropdownMenuPrimitive.Label
148
- ref={ref}
149
- className={cn(
150
- 'px-2 py-1.5 text-sm font-semibold',
151
- inset && 'pl-8',
152
- className
153
- )}
154
- {...props}
155
- />
156
- ))
157
- DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName
158
-
159
- const DropdownMenuSeparator = React.forwardRef<
160
- React.ElementRef<typeof DropdownMenuPrimitive.Separator>,
161
- React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>
162
- >(({ className, ...props }, ref) => (
163
- <DropdownMenuPrimitive.Separator
164
- ref={ref}
165
- className={cn('-mx-1 my-1 h-px bg-muted', className)}
166
- {...props}
167
- />
168
- ))
169
- DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
170
-
171
- const DropdownMenuShortcut = ({
172
- className,
173
- ...props
174
- }: React.HTMLAttributes<HTMLSpanElement>) => {
175
- return (
176
- <span
177
- className={cn('ml-auto text-xs tracking-widest opacity-60', className)}
178
- {...props}
179
- />
180
- )
181
- }
182
- DropdownMenuShortcut.displayName = 'DropdownMenuShortcut'
183
-
184
- export {
185
- DropdownMenu,
186
- DropdownMenuCheckboxItem,
187
- DropdownMenuContent,
188
- DropdownMenuGroup,
189
- DropdownMenuItem,
190
- DropdownMenuLabel,
191
- DropdownMenuPortal,
192
- DropdownMenuRadioGroup,
193
- DropdownMenuRadioItem,
194
- DropdownMenuSeparator,
195
- DropdownMenuShortcut,
196
- DropdownMenuSub,
197
- DropdownMenuSubContent,
198
- DropdownMenuSubTrigger,
199
- DropdownMenuTrigger
200
- }