@tioelvis/next-template 2.4.8 → 3.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 (132) hide show
  1. package/README.md +42 -42
  2. package/package.json +44 -92
  3. package/src/actions/configure-package-json.js +32 -0
  4. package/src/actions/init-project.js +40 -0
  5. package/src/actions/init-shadcn-ui.js +48 -0
  6. package/src/actions/init-theme.js +28 -0
  7. package/src/actions/init-tioelvis-components.js +42 -0
  8. package/src/actions/install-main-packages.js +51 -0
  9. package/src/constants.js +234 -97
  10. package/src/lib/exception.js +9 -0
  11. package/src/lib/utils.js +55 -0
  12. package/src/main.js +158 -229
  13. package/src/template/eslint.config.mjs +15 -13
  14. package/src/template/postcss.config.mjs +3 -1
  15. package/src/template/src/app/globals.css +0 -122
  16. package/src/template/src/app/layout.tsx +7 -15
  17. package/src/template/src/app/page.tsx +6 -2
  18. package/src/template/tsconfig.json +9 -2
  19. package/src/themes/blue.css +141 -0
  20. package/src/themes/default.css +141 -0
  21. package/src/themes/green.css +141 -0
  22. package/src/themes/orange.css +141 -0
  23. package/src/themes/red.css +141 -0
  24. package/src/themes/rose.css +141 -0
  25. package/src/themes/violet.css +141 -0
  26. package/src/themes/yellow.css +141 -0
  27. package/src/tioelvis-components/max-width-wrapper.tsx +21 -0
  28. package/src/app/components/ui/accordion.json +0 -6
  29. package/src/app/components/ui/accordion.tsx +0 -64
  30. package/src/app/components/ui/alert-dialog.json +0 -6
  31. package/src/app/components/ui/alert-dialog.tsx +0 -157
  32. package/src/app/components/ui/alert.json +0 -6
  33. package/src/app/components/ui/alert.tsx +0 -66
  34. package/src/app/components/ui/aspect-ratio.json +0 -6
  35. package/src/app/components/ui/aspect-ratio.tsx +0 -11
  36. package/src/app/components/ui/avatar.json +0 -6
  37. package/src/app/components/ui/avatar.tsx +0 -53
  38. package/src/app/components/ui/badge.json +0 -6
  39. package/src/app/components/ui/badge.tsx +0 -46
  40. package/src/app/components/ui/breadcrumb.json +0 -6
  41. package/src/app/components/ui/breadcrumb.tsx +0 -107
  42. package/src/app/components/ui/button.json +0 -6
  43. package/src/app/components/ui/button.tsx +0 -58
  44. package/src/app/components/ui/calendar.json +0 -6
  45. package/src/app/components/ui/calendar.tsx +0 -213
  46. package/src/app/components/ui/card.json +0 -6
  47. package/src/app/components/ui/card.tsx +0 -92
  48. package/src/app/components/ui/carousel.json +0 -6
  49. package/src/app/components/ui/carousel.tsx +0 -236
  50. package/src/app/components/ui/chart.json +0 -6
  51. package/src/app/components/ui/chart.tsx +0 -347
  52. package/src/app/components/ui/checkbox.json +0 -6
  53. package/src/app/components/ui/checkbox.tsx +0 -30
  54. package/src/app/components/ui/collapsible.json +0 -6
  55. package/src/app/components/ui/collapsible.tsx +0 -33
  56. package/src/app/components/ui/command.json +0 -6
  57. package/src/app/components/ui/command.tsx +0 -182
  58. package/src/app/components/ui/context-menu.json +0 -6
  59. package/src/app/components/ui/context-menu.tsx +0 -249
  60. package/src/app/components/ui/dialog.json +0 -6
  61. package/src/app/components/ui/dialog.tsx +0 -141
  62. package/src/app/components/ui/drawer.json +0 -6
  63. package/src/app/components/ui/drawer.tsx +0 -134
  64. package/src/app/components/ui/dropdown-menu.json +0 -6
  65. package/src/app/components/ui/dropdown-menu.tsx +0 -256
  66. package/src/app/components/ui/form.json +0 -12
  67. package/src/app/components/ui/form.tsx +0 -167
  68. package/src/app/components/ui/hover-card.json +0 -6
  69. package/src/app/components/ui/hover-card.tsx +0 -49
  70. package/src/app/components/ui/input-otp.json +0 -6
  71. package/src/app/components/ui/input-otp.tsx +0 -76
  72. package/src/app/components/ui/input.json +0 -6
  73. package/src/app/components/ui/input.tsx +0 -21
  74. package/src/app/components/ui/label.json +0 -6
  75. package/src/app/components/ui/label.tsx +0 -24
  76. package/src/app/components/ui/menubar.json +0 -6
  77. package/src/app/components/ui/menubar.tsx +0 -273
  78. package/src/app/components/ui/navigation-menu.json +0 -6
  79. package/src/app/components/ui/navigation-menu.tsx +0 -164
  80. package/src/app/components/ui/pagination.json +0 -6
  81. package/src/app/components/ui/pagination.tsx +0 -124
  82. package/src/app/components/ui/popover.json +0 -6
  83. package/src/app/components/ui/popover.tsx +0 -55
  84. package/src/app/components/ui/progress.json +0 -6
  85. package/src/app/components/ui/progress.tsx +0 -30
  86. package/src/app/components/ui/radio-group.json +0 -6
  87. package/src/app/components/ui/radio-group.tsx +0 -43
  88. package/src/app/components/ui/resizable.json +0 -6
  89. package/src/app/components/ui/resizable.tsx +0 -55
  90. package/src/app/components/ui/scroll-area.json +0 -6
  91. package/src/app/components/ui/scroll-area.tsx +0 -55
  92. package/src/app/components/ui/select.json +0 -6
  93. package/src/app/components/ui/select.tsx +0 -179
  94. package/src/app/components/ui/separator.json +0 -6
  95. package/src/app/components/ui/separator.tsx +0 -28
  96. package/src/app/components/ui/sheet.json +0 -6
  97. package/src/app/components/ui/sheet.tsx +0 -145
  98. package/src/app/components/ui/sidebar.json +0 -6
  99. package/src/app/components/ui/sidebar.tsx +0 -718
  100. package/src/app/components/ui/skeleton.json +0 -6
  101. package/src/app/components/ui/skeleton.tsx +0 -13
  102. package/src/app/components/ui/slider.json +0 -6
  103. package/src/app/components/ui/slider.tsx +0 -61
  104. package/src/app/components/ui/sonner.json +0 -6
  105. package/src/app/components/ui/sonner.tsx +0 -25
  106. package/src/app/components/ui/switch.json +0 -6
  107. package/src/app/components/ui/switch.tsx +0 -30
  108. package/src/app/components/ui/table.json +0 -6
  109. package/src/app/components/ui/table.tsx +0 -115
  110. package/src/app/components/ui/tabs.json +0 -6
  111. package/src/app/components/ui/tabs.tsx +0 -66
  112. package/src/app/components/ui/textarea.json +0 -6
  113. package/src/app/components/ui/textarea.tsx +0 -18
  114. package/src/app/components/ui/toggle-group.json +0 -6
  115. package/src/app/components/ui/toggle-group.tsx +0 -71
  116. package/src/app/components/ui/toggle.json +0 -6
  117. package/src/app/components/ui/toggle.tsx +0 -47
  118. package/src/app/components/ui/tooltip.json +0 -6
  119. package/src/app/components/ui/tooltip.tsx +0 -60
  120. package/src/app/hooks/use-mobile.ts +0 -21
  121. package/src/app/lib/utils.ts +0 -6
  122. package/src/app/tsconfig.json +0 -27
  123. package/src/template/components.json +0 -21
  124. package/src/template/next-env.d.ts +0 -5
  125. package/src/template/public/.gitkeep +0 -0
  126. package/src/template/src/lib/axios.ts +0 -39
  127. package/src/template/src/lib/constants.ts +0 -1
  128. package/src/template/src/lib/utils.ts +0 -6
  129. package/src/template/src/providers/query.provider.tsx +0 -12
  130. package/src/template/src/providers/theme.provider.tsx +0 -8
  131. package/src/utils.js +0 -113
  132. /package/src/template/{src/app → public}/favicon.ico +0 -0
@@ -1,30 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
5
- import { CheckIcon } from "lucide-react";
6
-
7
- import { cn } from "@/lib/utils";
8
-
9
- function Checkbox({
10
- className,
11
- ...props
12
- }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
13
- return (
14
- <CheckboxPrimitive.Root
15
- data-slot="checkbox"
16
- className={cn(
17
- "peer border-input cursor-pointer dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
18
- className
19
- )}
20
- {...props}>
21
- <CheckboxPrimitive.Indicator
22
- data-slot="checkbox-indicator"
23
- className="flex items-center justify-center text-current transition-none ">
24
- <CheckIcon className="size-3.5" />
25
- </CheckboxPrimitive.Indicator>
26
- </CheckboxPrimitive.Root>
27
- );
28
- }
29
-
30
- export { Checkbox };
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": ["@radix-ui/react-collapsible"],
3
- "dev_dependence": [],
4
- "hooks": [],
5
- "supports": []
6
- }
@@ -1,33 +0,0 @@
1
- "use client";
2
-
3
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible";
4
-
5
- function Collapsible({
6
- ...props
7
- }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
8
- return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
9
- }
10
-
11
- function CollapsibleTrigger({
12
- ...props
13
- }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
14
- return (
15
- <CollapsiblePrimitive.CollapsibleTrigger
16
- data-slot="collapsible-trigger"
17
- {...props}
18
- />
19
- );
20
- }
21
-
22
- function CollapsibleContent({
23
- ...props
24
- }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
25
- return (
26
- <CollapsiblePrimitive.CollapsibleContent
27
- data-slot="collapsible-content"
28
- {...props}
29
- />
30
- );
31
- }
32
-
33
- export { Collapsible, CollapsibleTrigger, CollapsibleContent };
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": ["cmdk"],
3
- "dev_dependence": [],
4
- "hooks": [],
5
- "supports": ["dialog"]
6
- }
@@ -1,182 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { Command as CommandPrimitive } from "cmdk";
5
- import { SearchIcon } from "lucide-react";
6
-
7
- import { cn } from "@/lib/utils";
8
- import {
9
- Dialog,
10
- DialogContent,
11
- DialogDescription,
12
- DialogHeader,
13
- DialogTitle,
14
- } from "@/components/ui/dialog";
15
-
16
- function Command({
17
- className,
18
- ...props
19
- }: React.ComponentProps<typeof CommandPrimitive>) {
20
- return (
21
- <CommandPrimitive
22
- data-slot="command"
23
- className={cn(
24
- "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
25
- className
26
- )}
27
- {...props}
28
- />
29
- );
30
- }
31
-
32
- function CommandDialog({
33
- title = "Command Palette",
34
- description = "Search for a command to run...",
35
- children,
36
- className,
37
- showCloseButton = true,
38
- ...props
39
- }: React.ComponentProps<typeof Dialog> & {
40
- title?: string;
41
- description?: string;
42
- className?: string;
43
- showCloseButton?: boolean;
44
- }) {
45
- return (
46
- <Dialog {...props}>
47
- <DialogHeader className="sr-only">
48
- <DialogTitle>{title}</DialogTitle>
49
- <DialogDescription>{description}</DialogDescription>
50
- </DialogHeader>
51
- <DialogContent
52
- className={cn("overflow-hidden p-0", className)}
53
- showCloseButton={showCloseButton}>
54
- <Command className="[&_[cmdk-group-heading]]:text-muted-foreground **:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[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">
55
- {children}
56
- </Command>
57
- </DialogContent>
58
- </Dialog>
59
- );
60
- }
61
-
62
- function CommandInput({
63
- className,
64
- ...props
65
- }: React.ComponentProps<typeof CommandPrimitive.Input>) {
66
- return (
67
- <div
68
- data-slot="command-input-wrapper"
69
- className="flex h-9 items-center gap-2 border-b px-3">
70
- <SearchIcon className="size-4 shrink-0 opacity-50" />
71
- <CommandPrimitive.Input
72
- data-slot="command-input"
73
- className={cn(
74
- "placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
75
- className
76
- )}
77
- {...props}
78
- />
79
- </div>
80
- );
81
- }
82
-
83
- function CommandList({
84
- className,
85
- ...props
86
- }: React.ComponentProps<typeof CommandPrimitive.List>) {
87
- return (
88
- <CommandPrimitive.List
89
- data-slot="command-list"
90
- className={cn(
91
- "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
92
- className
93
- )}
94
- {...props}
95
- />
96
- );
97
- }
98
-
99
- function CommandEmpty({
100
- ...props
101
- }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
102
- return (
103
- <CommandPrimitive.Empty
104
- data-slot="command-empty"
105
- className="py-6 text-center text-sm"
106
- {...props}
107
- />
108
- );
109
- }
110
-
111
- function CommandGroup({
112
- className,
113
- ...props
114
- }: React.ComponentProps<typeof CommandPrimitive.Group>) {
115
- return (
116
- <CommandPrimitive.Group
117
- data-slot="command-group"
118
- className={cn(
119
- "text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
120
- className
121
- )}
122
- {...props}
123
- />
124
- );
125
- }
126
-
127
- function CommandSeparator({
128
- className,
129
- ...props
130
- }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
131
- return (
132
- <CommandPrimitive.Separator
133
- data-slot="command-separator"
134
- className={cn("bg-border -mx-1 h-px", className)}
135
- {...props}
136
- />
137
- );
138
- }
139
-
140
- function CommandItem({
141
- className,
142
- ...props
143
- }: React.ComponentProps<typeof CommandPrimitive.Item>) {
144
- return (
145
- <CommandPrimitive.Item
146
- data-slot="command-item"
147
- className={cn(
148
- "data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:cursor-not-allowed data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
149
- className
150
- )}
151
- {...props}
152
- />
153
- );
154
- }
155
-
156
- function CommandShortcut({
157
- className,
158
- ...props
159
- }: React.ComponentProps<"span">) {
160
- return (
161
- <span
162
- data-slot="command-shortcut"
163
- className={cn(
164
- "text-muted-foreground ml-auto text-xs tracking-widest",
165
- className
166
- )}
167
- {...props}
168
- />
169
- );
170
- }
171
-
172
- export {
173
- Command,
174
- CommandDialog,
175
- CommandInput,
176
- CommandList,
177
- CommandEmpty,
178
- CommandGroup,
179
- CommandItem,
180
- CommandShortcut,
181
- CommandSeparator,
182
- };
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": ["@radix-ui/react-context-menu"],
3
- "dev_dependence": [],
4
- "hooks": [],
5
- "supports": []
6
- }
@@ -1,249 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
5
- import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
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
- "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-pointer items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
70
- className
71
- )}
72
- {...props}>
73
- {children}
74
- <ChevronRightIcon className="ml-auto" />
75
- </ContextMenuPrimitive.SubTrigger>
76
- );
77
- }
78
-
79
- function ContextMenuSubContent({
80
- className,
81
- ...props
82
- }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
83
- return (
84
- <ContextMenuPrimitive.SubContent
85
- data-slot="context-menu-sub-content"
86
- className={cn(
87
- "bg-popover text-popover-foreground 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 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg",
88
- className
89
- )}
90
- {...props}
91
- />
92
- );
93
- }
94
-
95
- function ContextMenuContent({
96
- className,
97
- ...props
98
- }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
99
- return (
100
- <ContextMenuPrimitive.Portal>
101
- <ContextMenuPrimitive.Content
102
- data-slot="context-menu-content"
103
- className={cn(
104
- "bg-popover text-popover-foreground 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 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 p-1 shadow-md",
105
- className
106
- )}
107
- {...props}
108
- />
109
- </ContextMenuPrimitive.Portal>
110
- );
111
- }
112
-
113
- function ContextMenuItem({
114
- className,
115
- inset,
116
- variant = "default",
117
- ...props
118
- }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
119
- inset?: boolean;
120
- variant?: "default" | "destructive";
121
- }) {
122
- return (
123
- <ContextMenuPrimitive.Item
124
- data-slot="context-menu-item"
125
- data-inset={inset}
126
- data-variant={variant}
127
- className={cn(
128
- "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-pointer items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
129
- className
130
- )}
131
- {...props}
132
- />
133
- );
134
- }
135
-
136
- function ContextMenuCheckboxItem({
137
- className,
138
- children,
139
- checked,
140
- ...props
141
- }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
142
- return (
143
- <ContextMenuPrimitive.CheckboxItem
144
- data-slot="context-menu-checkbox-item"
145
- className={cn(
146
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
147
- className
148
- )}
149
- checked={checked}
150
- {...props}>
151
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
152
- <ContextMenuPrimitive.ItemIndicator>
153
- <CheckIcon className="size-4" />
154
- </ContextMenuPrimitive.ItemIndicator>
155
- </span>
156
- {children}
157
- </ContextMenuPrimitive.CheckboxItem>
158
- );
159
- }
160
-
161
- function ContextMenuRadioItem({
162
- className,
163
- children,
164
- ...props
165
- }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
166
- return (
167
- <ContextMenuPrimitive.RadioItem
168
- data-slot="context-menu-radio-item"
169
- className={cn(
170
- "focus:bg-accent focus:text-accent-foreground relative flex cursor-pointer items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:cursor-not-allowed data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
171
- className
172
- )}
173
- {...props}>
174
- <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
175
- <ContextMenuPrimitive.ItemIndicator>
176
- <CircleIcon className="size-2 fill-current" />
177
- </ContextMenuPrimitive.ItemIndicator>
178
- </span>
179
- {children}
180
- </ContextMenuPrimitive.RadioItem>
181
- );
182
- }
183
-
184
- function ContextMenuLabel({
185
- className,
186
- inset,
187
- ...props
188
- }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
189
- inset?: boolean;
190
- }) {
191
- return (
192
- <ContextMenuPrimitive.Label
193
- data-slot="context-menu-label"
194
- data-inset={inset}
195
- className={cn(
196
- "text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
197
- className
198
- )}
199
- {...props}
200
- />
201
- );
202
- }
203
-
204
- function ContextMenuSeparator({
205
- className,
206
- ...props
207
- }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
208
- return (
209
- <ContextMenuPrimitive.Separator
210
- data-slot="context-menu-separator"
211
- className={cn("bg-border -mx-1 my-1 h-px", className)}
212
- {...props}
213
- />
214
- );
215
- }
216
-
217
- function ContextMenuShortcut({
218
- className,
219
- ...props
220
- }: React.ComponentProps<"span">) {
221
- return (
222
- <span
223
- data-slot="context-menu-shortcut"
224
- className={cn(
225
- "text-muted-foreground ml-auto text-xs tracking-widest",
226
- className
227
- )}
228
- {...props}
229
- />
230
- );
231
- }
232
-
233
- export {
234
- ContextMenu,
235
- ContextMenuTrigger,
236
- ContextMenuContent,
237
- ContextMenuItem,
238
- ContextMenuCheckboxItem,
239
- ContextMenuRadioItem,
240
- ContextMenuLabel,
241
- ContextMenuSeparator,
242
- ContextMenuShortcut,
243
- ContextMenuGroup,
244
- ContextMenuPortal,
245
- ContextMenuSub,
246
- ContextMenuSubContent,
247
- ContextMenuSubTrigger,
248
- ContextMenuRadioGroup,
249
- };
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": ["@radix-ui/react-dialog"],
3
- "dev_dependence": [],
4
- "hooks": [],
5
- "supports": []
6
- }
@@ -1,141 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as DialogPrimitive from "@radix-ui/react-dialog";
5
- import { XIcon } from "lucide-react";
6
-
7
- import { cn } from "@/lib/utils";
8
-
9
- function Dialog({
10
- ...props
11
- }: React.ComponentProps<typeof DialogPrimitive.Root>) {
12
- return <DialogPrimitive.Root data-slot="dialog" {...props} />;
13
- }
14
-
15
- function DialogTrigger({
16
- ...props
17
- }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
18
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
19
- }
20
-
21
- function DialogPortal({
22
- ...props
23
- }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
24
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
25
- }
26
-
27
- function DialogClose({
28
- ...props
29
- }: React.ComponentProps<typeof DialogPrimitive.Close>) {
30
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
31
- }
32
-
33
- function DialogOverlay({
34
- className,
35
- ...props
36
- }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
37
- return (
38
- <DialogPrimitive.Overlay
39
- data-slot="dialog-overlay"
40
- className={cn(
41
- "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
42
- className
43
- )}
44
- {...props}
45
- />
46
- );
47
- }
48
-
49
- function DialogContent({
50
- className,
51
- children,
52
- showCloseButton = true,
53
- ...props
54
- }: React.ComponentProps<typeof DialogPrimitive.Content> & {
55
- showCloseButton?: boolean;
56
- }) {
57
- return (
58
- <DialogPortal data-slot="dialog-portal">
59
- <DialogOverlay />
60
- <DialogPrimitive.Content
61
- data-slot="dialog-content"
62
- className={cn(
63
- "bg-background 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 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 p-6 shadow-lg duration-200 sm:max-w-lg",
64
- className
65
- )}
66
- {...props}>
67
- {children}
68
- {showCloseButton && (
69
- <DialogPrimitive.Close
70
- data-slot="dialog-close"
71
- className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4">
72
- <XIcon />
73
- <span className="sr-only">Close</span>
74
- </DialogPrimitive.Close>
75
- )}
76
- </DialogPrimitive.Content>
77
- </DialogPortal>
78
- );
79
- }
80
-
81
- function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
82
- return (
83
- <div
84
- data-slot="dialog-header"
85
- className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
86
- {...props}
87
- />
88
- );
89
- }
90
-
91
- function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
92
- return (
93
- <div
94
- data-slot="dialog-footer"
95
- className={cn(
96
- "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
97
- className
98
- )}
99
- {...props}
100
- />
101
- );
102
- }
103
-
104
- function DialogTitle({
105
- className,
106
- ...props
107
- }: React.ComponentProps<typeof DialogPrimitive.Title>) {
108
- return (
109
- <DialogPrimitive.Title
110
- data-slot="dialog-title"
111
- className={cn("text-lg leading-none font-semibold", className)}
112
- {...props}
113
- />
114
- );
115
- }
116
-
117
- function DialogDescription({
118
- className,
119
- ...props
120
- }: React.ComponentProps<typeof DialogPrimitive.Description>) {
121
- return (
122
- <DialogPrimitive.Description
123
- data-slot="dialog-description"
124
- className={cn("text-muted-foreground text-sm", className)}
125
- {...props}
126
- />
127
- );
128
- }
129
-
130
- export {
131
- Dialog,
132
- DialogClose,
133
- DialogContent,
134
- DialogDescription,
135
- DialogFooter,
136
- DialogHeader,
137
- DialogOverlay,
138
- DialogPortal,
139
- DialogTitle,
140
- DialogTrigger,
141
- };
@@ -1,6 +0,0 @@
1
- {
2
- "dependencies": ["vaul"],
3
- "dev_dependence": [],
4
- "hooks": [],
5
- "supports": []
6
- }