startx 0.0.1 → 0.1.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 (154) hide show
  1. package/.prettierignore +0 -13
  2. package/.prettierrc.js +52 -52
  3. package/.vscode/launch.json +32 -0
  4. package/.vscode/settings.json +9 -3
  5. package/apps/core-server/.env.example +18 -24
  6. package/apps/core-server/Dockerfile +35 -61
  7. package/apps/core-server/eslint.config.ts +7 -0
  8. package/apps/core-server/package.json +41 -52
  9. package/apps/core-server/src/config/custom-type.ts +2 -40
  10. package/apps/core-server/src/events/index.ts +37 -37
  11. package/apps/core-server/src/index.ts +4 -13
  12. package/apps/core-server/src/middlewares/auth-middleware.ts +24 -7
  13. package/apps/core-server/src/middlewares/cors-middleware.ts +7 -6
  14. package/apps/core-server/src/middlewares/error-middleware.ts +7 -4
  15. package/apps/core-server/src/middlewares/logger-middleware.ts +81 -21
  16. package/apps/core-server/src/middlewares/notfound-middleware.ts +6 -14
  17. package/apps/core-server/src/middlewares/serve-static.ts +30 -24
  18. package/apps/core-server/src/routes/files/router.ts +9 -7
  19. package/apps/core-server/src/routes/server.ts +30 -36
  20. package/apps/core-server/tsdown.config.ts +4 -3
  21. package/biome.json +58 -60
  22. package/configs/eslint-config/package.json +16 -19
  23. package/configs/eslint-config/src/configs/base.ts +185 -225
  24. package/configs/eslint-config/src/configs/extend.ts +3 -0
  25. package/configs/eslint-config/src/configs/frontend.ts +81 -56
  26. package/configs/eslint-config/src/configs/node.ts +6 -6
  27. package/configs/eslint-config/src/plugin.ts +1 -0
  28. package/configs/eslint-config/src/rules/index.ts +8 -12
  29. package/configs/eslint-config/src/rules/no-json-parse-json-stringify.test.ts +30 -17
  30. package/configs/eslint-config/src/rules/no-json-parse-json-stringify.ts +52 -49
  31. package/configs/eslint-config/src/rules/no-uncaught-json-parse.ts +43 -45
  32. package/configs/tsdown-config/package.json +10 -3
  33. package/configs/typescript-config/package.json +10 -1
  34. package/configs/typescript-config/tsconfig.common.json +3 -3
  35. package/configs/vitest-config/dist/base.mjs +1 -0
  36. package/configs/vitest-config/dist/frontend.mjs +1 -0
  37. package/configs/vitest-config/dist/node.mjs +1 -0
  38. package/configs/vitest-config/package.json +12 -0
  39. package/configs/vitest-config/src/base.ts +17 -29
  40. package/configs/vitest-config/src/index.ts +1 -0
  41. package/package.json +21 -13
  42. package/packages/@repo/constants/eslint.config.ts +4 -0
  43. package/packages/@repo/constants/package.json +16 -0
  44. package/packages/@repo/constants/src/index.ts +8 -8
  45. package/packages/@repo/db/eslint.config.ts +4 -0
  46. package/packages/@repo/db/package.json +16 -8
  47. package/packages/@repo/db/src/index.ts +26 -20
  48. package/packages/@repo/db/src/schema/common.ts +45 -49
  49. package/packages/@repo/env/eslint.config.ts +4 -0
  50. package/packages/@repo/env/package.json +39 -0
  51. package/packages/@repo/env/src/default-env.ts +12 -0
  52. package/packages/@repo/env/src/define-env.ts +70 -0
  53. package/packages/@repo/env/src/index.ts +2 -0
  54. package/packages/@repo/env/src/utils.ts +52 -0
  55. package/packages/@repo/env/tsconfig.json +7 -0
  56. package/packages/@repo/lib/eslint.config.ts +4 -0
  57. package/packages/@repo/lib/package.json +34 -34
  58. package/packages/@repo/lib/src/bucket-module/file-storage.ts +50 -49
  59. package/packages/@repo/lib/src/bucket-module/index.ts +3 -0
  60. package/packages/@repo/lib/src/bucket-module/s3-storage.ts +120 -114
  61. package/packages/@repo/lib/src/bucket-module/utils.ts +10 -11
  62. package/packages/@repo/lib/src/{cookie-module.ts → cookie-module/cookie-module.ts} +48 -42
  63. package/packages/@repo/lib/src/cookie-module/index.ts +1 -0
  64. package/packages/@repo/lib/src/extra/index.ts +1 -0
  65. package/packages/@repo/lib/src/extra/pagination-module.ts +35 -0
  66. package/packages/@repo/lib/src/{token-module.ts → extra/token-module.ts} +12 -5
  67. package/packages/@repo/lib/src/file-system-module/index.ts +170 -0
  68. package/packages/@repo/lib/src/{hashing-module.ts → hashing-module/index.ts} +9 -9
  69. package/packages/@repo/lib/src/index.ts +0 -26
  70. package/packages/@repo/lib/src/mail-module/index.ts +2 -0
  71. package/packages/@repo/lib/src/mail-module/mock.ts +8 -8
  72. package/packages/@repo/lib/src/mail-module/nodemailer.ts +17 -7
  73. package/packages/@repo/lib/src/notification-module/index.ts +1 -172
  74. package/packages/@repo/lib/src/notification-module/push-notification.ts +97 -90
  75. package/packages/@repo/lib/src/{oauth2-client.ts → oauth2-module/index.ts} +107 -109
  76. package/packages/@repo/lib/src/otp-module/index.ts +91 -0
  77. package/packages/@repo/lib/src/session-module/index.ts +113 -0
  78. package/packages/@repo/lib/src/utils.ts +43 -42
  79. package/packages/@repo/lib/src/validation-module/index.ts +242 -0
  80. package/packages/@repo/logger/eslint.config.ts +4 -0
  81. package/packages/@repo/logger/package.json +40 -0
  82. package/packages/@repo/logger/src/index.ts +2 -0
  83. package/packages/@repo/logger/src/logger.ts +72 -0
  84. package/packages/@repo/{lib/src/logger-module → logger/src}/memory-profiler.ts +64 -65
  85. package/packages/@repo/logger/tsconfig.json +7 -0
  86. package/packages/@repo/mail/eslint.config.ts +4 -0
  87. package/packages/@repo/mail/package.json +10 -3
  88. package/packages/@repo/mail/src/emails/admin/OtpEmail.tsx +169 -168
  89. package/packages/@repo/mail/src/index.ts +1 -2
  90. package/packages/@repo/mail/tsconfig.json +3 -3
  91. package/packages/@repo/redis/dist/index.d.mts +3 -0
  92. package/packages/@repo/redis/dist/index.mjs +5 -0
  93. package/packages/@repo/redis/dist/lib/redis-client.d.mts +7 -0
  94. package/packages/@repo/redis/dist/lib/redis-client.mjs +25 -0
  95. package/packages/@repo/redis/dist/lib/redis-client.mjs.map +1 -0
  96. package/packages/@repo/redis/dist/lib/redis-module.d.mts +5 -0
  97. package/packages/@repo/redis/dist/lib/redis-module.mjs +6 -0
  98. package/packages/@repo/redis/dist/lib/redis-module.mjs.map +1 -0
  99. package/packages/@repo/redis/eslint.config.ts +4 -0
  100. package/packages/@repo/redis/package.json +13 -10
  101. package/packages/@repo/redis/src/index.ts +2 -2
  102. package/packages/@repo/redis/src/lib/redis-client.ts +36 -23
  103. package/packages/@repo/redis/src/lib/redis-module.ts +69 -3
  104. package/packages/cli/dist/index.mjs +203 -0
  105. package/packages/cli/eslint.config.ts +4 -0
  106. package/packages/cli/package.json +44 -0
  107. package/packages/cli/tsconfig.json +12 -0
  108. package/packages/cli/tsdown.config.ts +17 -0
  109. package/packages/ui/components.json +0 -1
  110. package/packages/ui/eslint.config.ts +4 -0
  111. package/packages/ui/package.json +16 -3
  112. package/packages/ui/postcss.config.mjs +9 -9
  113. package/packages/ui/src/components/lib/utils.ts +53 -53
  114. package/packages/ui/src/components/ui/alert-dialog.tsx +118 -116
  115. package/packages/ui/src/components/ui/avatar.tsx +52 -53
  116. package/packages/ui/src/components/ui/badge.tsx +45 -46
  117. package/packages/ui/src/components/ui/breadcrumb.tsx +108 -109
  118. package/packages/ui/src/components/ui/card.tsx +91 -92
  119. package/packages/ui/src/components/ui/carousel.tsx +243 -243
  120. package/packages/ui/src/components/ui/checkbox.tsx +32 -32
  121. package/packages/ui/src/components/ui/command.tsx +144 -155
  122. package/packages/ui/src/components/ui/dialog.tsx +124 -127
  123. package/packages/ui/src/components/ui/form.tsx +166 -165
  124. package/packages/ui/src/components/ui/input-otp.tsx +74 -76
  125. package/packages/ui/src/components/ui/input.tsx +19 -21
  126. package/packages/ui/src/components/ui/multiple-select.tsx +4 -4
  127. package/packages/ui/src/{components/lucide.tsx → lucide.ts} +3 -3
  128. package/packages/ui/tailwind.config.ts +94 -94
  129. package/packages/ui/tsconfig.json +7 -1
  130. package/pnpm-workspace.yaml +41 -1
  131. package/turbo.json +20 -27
  132. package/apps/core-server/eslint.config.mjs +0 -47
  133. package/configs/eslint-config/src/rules/no-dynamic-import-template.ts +0 -32
  134. package/configs/eslint-config/src/rules/no-plain-errors.ts +0 -50
  135. package/configs/eslint-config/tsdown.config.ts +0 -11
  136. package/packages/@repo/constants/eslint.config.mjs +0 -21
  137. package/packages/@repo/db/eslint.config.mjs +0 -21
  138. package/packages/@repo/lib/eslint.config.mjs +0 -49
  139. package/packages/@repo/lib/src/command-module.ts +0 -77
  140. package/packages/@repo/lib/src/constants.ts +0 -3
  141. package/packages/@repo/lib/src/custom-type.ts +0 -54
  142. package/packages/@repo/lib/src/env.ts +0 -13
  143. package/packages/@repo/lib/src/file-system/index.ts +0 -90
  144. package/packages/@repo/lib/src/logger-module/log-config.ts +0 -16
  145. package/packages/@repo/lib/src/logger-module/logger.ts +0 -78
  146. package/packages/@repo/lib/src/mail-module/api.ts +0 -0
  147. package/packages/@repo/lib/src/otp-module.ts +0 -98
  148. package/packages/@repo/lib/src/pagination-module.ts +0 -49
  149. package/packages/@repo/lib/src/user-session.ts +0 -117
  150. package/packages/@repo/lib/src/validation-module.ts +0 -187
  151. package/packages/@repo/mail/tsconfig.build.json +0 -14
  152. package/packages/@repo/mail/tsdown.config.ts +0 -9
  153. package/packages/@repo/redis/eslint.config.mjs +0 -8
  154. package/packages/ui/eslint.config.mjs +0 -18
@@ -1,155 +1,144 @@
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 "./dialog";
9
- import { cn } from "../lib/utils";
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
- const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
28
- return (
29
- <Dialog {...props}>
30
- <DialogContent className="overflow-hidden p-0 shadow-lg">
31
- <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">
32
- {children}
33
- </Command>
34
- </DialogContent>
35
- </Dialog>
36
- );
37
- };
38
-
39
- const CommandInput = React.forwardRef<
40
- React.ElementRef<typeof CommandPrimitive.Input>,
41
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
42
- >(({ className, ...props }, ref) => (
43
- <div className="flex items-center border-b px-3" cmdk-input-wrapper="">
44
- <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
45
- <CommandPrimitive.Input
46
- ref={ref}
47
- className={cn(
48
- "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",
49
- className
50
- )}
51
- {...props}
52
- />
53
- </div>
54
- ));
55
-
56
- CommandInput.displayName = CommandPrimitive.Input.displayName;
57
-
58
- const CommandList = React.forwardRef<
59
- React.ElementRef<typeof CommandPrimitive.List>,
60
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
61
- >(({ className, ...props }, ref) => (
62
- <CommandPrimitive.List
63
- ref={ref}
64
- className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
65
- {...props}
66
- />
67
- ));
68
-
69
- CommandList.displayName = CommandPrimitive.List.displayName;
70
-
71
- const CommandEmpty = React.forwardRef<
72
- React.ElementRef<typeof CommandPrimitive.Empty>,
73
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
74
- >((props, ref) => (
75
- <CommandPrimitive.Empty
76
- ref={ref}
77
- className="py-6 text-center text-sm"
78
- {...props}
79
- />
80
- ));
81
-
82
- CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
83
-
84
- const CommandGroup = React.forwardRef<
85
- React.ElementRef<typeof CommandPrimitive.Group>,
86
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
87
- >(({ className, ...props }, ref) => (
88
- <CommandPrimitive.Group
89
- ref={ref}
90
- className={cn(
91
- "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",
92
- className
93
- )}
94
- {...props}
95
- />
96
- ));
97
-
98
- CommandGroup.displayName = CommandPrimitive.Group.displayName;
99
-
100
- const CommandSeparator = React.forwardRef<
101
- React.ElementRef<typeof CommandPrimitive.Separator>,
102
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
103
- >(({ className, ...props }, ref) => (
104
- <CommandPrimitive.Separator
105
- ref={ref}
106
- className={cn("-mx-1 h-px bg-border", className)}
107
- {...props}
108
- />
109
- ));
110
- CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
111
-
112
- const CommandItem = React.forwardRef<
113
- React.ElementRef<typeof CommandPrimitive.Item>,
114
- React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
115
- >(({ className, ...props }, ref) => (
116
- <CommandPrimitive.Item
117
- ref={ref}
118
- className={cn(
119
- // "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
120
- "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-[selected='true']:bg-accent aria-[selected='true']:text-accent-foreground data-[disabled='true']:pointer-events-none 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
- CommandInput,
149
- CommandList,
150
- CommandEmpty,
151
- CommandGroup,
152
- CommandItem,
153
- CommandShortcut,
154
- CommandSeparator,
155
- };
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
+ import { cn } from "../lib/utils";
8
+ import { Dialog, DialogContent } from "./dialog";
9
+
10
+ const Command = React.forwardRef<
11
+ React.ElementRef<typeof CommandPrimitive>,
12
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive>
13
+ >(({ className, ...props }, ref) => (
14
+ <CommandPrimitive
15
+ ref={ref}
16
+ className={cn(
17
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
18
+ className
19
+ )}
20
+ {...props}
21
+ />
22
+ ));
23
+ Command.displayName = CommandPrimitive.displayName;
24
+
25
+ interface CommandDialogProps extends DialogProps {}
26
+ const CommandDialog = ({ children, ...props }: CommandDialogProps) => {
27
+ return (
28
+ <Dialog {...props}>
29
+ <DialogContent className="overflow-hidden p-0 shadow-lg">
30
+ <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">
31
+ {children}
32
+ </Command>
33
+ </DialogContent>
34
+ </Dialog>
35
+ );
36
+ };
37
+
38
+ const CommandInput = React.forwardRef<
39
+ React.ElementRef<typeof CommandPrimitive.Input>,
40
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
41
+ >(({ className, ...props }, ref) => (
42
+ <div className="flex items-center border-b px-3">
43
+ <Search className="mr-2 h-4 w-4 shrink-0 opacity-50" />
44
+ <CommandPrimitive.Input
45
+ ref={ref}
46
+ className={cn(
47
+ "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",
48
+ className
49
+ )}
50
+ {...props}
51
+ />
52
+ </div>
53
+ ));
54
+
55
+ CommandInput.displayName = CommandPrimitive.Input.displayName;
56
+
57
+ const CommandList = React.forwardRef<
58
+ React.ElementRef<typeof CommandPrimitive.List>,
59
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.List>
60
+ >(({ className, ...props }, ref) => (
61
+ <CommandPrimitive.List
62
+ ref={ref}
63
+ className={cn("max-h-[300px] overflow-y-auto overflow-x-hidden", className)}
64
+ {...props}
65
+ />
66
+ ));
67
+
68
+ CommandList.displayName = CommandPrimitive.List.displayName;
69
+
70
+ const CommandEmpty = React.forwardRef<
71
+ React.ElementRef<typeof CommandPrimitive.Empty>,
72
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
73
+ >((props, ref) => (
74
+ <CommandPrimitive.Empty ref={ref} className="py-6 text-center text-sm" {...props} />
75
+ ));
76
+
77
+ CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
78
+
79
+ const CommandGroup = React.forwardRef<
80
+ React.ElementRef<typeof CommandPrimitive.Group>,
81
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Group>
82
+ >(({ className, ...props }, ref) => (
83
+ <CommandPrimitive.Group
84
+ ref={ref}
85
+ className={cn(
86
+ "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",
87
+ className
88
+ )}
89
+ {...props}
90
+ />
91
+ ));
92
+
93
+ CommandGroup.displayName = CommandPrimitive.Group.displayName;
94
+
95
+ const CommandSeparator = React.forwardRef<
96
+ React.ElementRef<typeof CommandPrimitive.Separator>,
97
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Separator>
98
+ >(({ className, ...props }, ref) => (
99
+ <CommandPrimitive.Separator
100
+ ref={ref}
101
+ className={cn("-mx-1 h-px bg-border", className)}
102
+ {...props}
103
+ />
104
+ ));
105
+ CommandSeparator.displayName = CommandPrimitive.Separator.displayName;
106
+
107
+ const CommandItem = React.forwardRef<
108
+ React.ElementRef<typeof CommandPrimitive.Item>,
109
+ React.ComponentPropsWithoutRef<typeof CommandPrimitive.Item>
110
+ >(({ className, ...props }, ref) => (
111
+ <CommandPrimitive.Item
112
+ ref={ref}
113
+ className={cn(
114
+ // "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-selected:bg-accent aria-selected:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
115
+ "relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none aria-[selected='true']:bg-accent aria-[selected='true']:text-accent-foreground data-[disabled='true']:pointer-events-none data-[disabled='true']:opacity-50",
116
+ className
117
+ )}
118
+ {...props}
119
+ />
120
+ ));
121
+
122
+ CommandItem.displayName = CommandPrimitive.Item.displayName;
123
+
124
+ const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
125
+ return (
126
+ <span
127
+ className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
128
+ {...props}
129
+ />
130
+ );
131
+ };
132
+ CommandShortcut.displayName = "CommandShortcut";
133
+
134
+ export {
135
+ Command,
136
+ CommandDialog,
137
+ CommandInput,
138
+ CommandList,
139
+ CommandEmpty,
140
+ CommandGroup,
141
+ CommandItem,
142
+ CommandShortcut,
143
+ CommandSeparator,
144
+ };
@@ -1,127 +1,124 @@
1
- import * as DialogPrimitive from "@radix-ui/react-dialog";
2
- import { XIcon } from "lucide-react";
3
- import * as React from "react";
4
-
5
- import { cn } from "../lib/utils";
6
-
7
- function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
8
- return <DialogPrimitive.Root data-slot="dialog" {...props} />;
9
- }
10
-
11
- function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
12
- return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
13
- }
14
-
15
- function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
16
- return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
17
- }
18
-
19
- function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
20
- return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
21
- }
22
-
23
- function DialogOverlay({
24
- className,
25
- ...props
26
- }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
27
- return (
28
- <DialogPrimitive.Overlay
29
- data-slot="dialog-overlay"
30
- className={cn(
31
- "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",
32
- className
33
- )}
34
- {...props}
35
- />
36
- );
37
- }
38
-
39
- function DialogContent({
40
- className,
41
- children,
42
- showCloseButton = true,
43
- ...props
44
- }: React.ComponentProps<typeof DialogPrimitive.Content> & {
45
- showCloseButton?: boolean;
46
- }) {
47
- return (
48
- <DialogPortal data-slot="dialog-portal">
49
- <DialogOverlay />
50
- <DialogPrimitive.Content
51
- data-slot="dialog-content"
52
- className={cn(
53
- "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 outline-none sm:max-w-lg",
54
- className
55
- )}
56
- {...props}
57
- >
58
- {children}
59
- {showCloseButton && (
60
- <DialogPrimitive.Close
61
- data-slot="dialog-close"
62
- 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"
63
- >
64
- <XIcon />
65
- <span className="sr-only">Close</span>
66
- </DialogPrimitive.Close>
67
- )}
68
- </DialogPrimitive.Content>
69
- </DialogPortal>
70
- );
71
- }
72
-
73
- function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
74
- return (
75
- <div
76
- data-slot="dialog-header"
77
- className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
78
- {...props}
79
- />
80
- );
81
- }
82
-
83
- function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
84
- return (
85
- <div
86
- data-slot="dialog-footer"
87
- className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}
88
- {...props}
89
- />
90
- );
91
- }
92
-
93
- function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
94
- return (
95
- <DialogPrimitive.Title
96
- data-slot="dialog-title"
97
- className={cn("text-lg leading-none font-semibold", className)}
98
- {...props}
99
- />
100
- );
101
- }
102
-
103
- function DialogDescription({
104
- className,
105
- ...props
106
- }: React.ComponentProps<typeof DialogPrimitive.Description>) {
107
- return (
108
- <DialogPrimitive.Description
109
- data-slot="dialog-description"
110
- className={cn("text-muted-foreground text-sm", className)}
111
- {...props}
112
- />
113
- );
114
- }
115
-
116
- export {
117
- Dialog,
118
- DialogClose,
119
- DialogContent,
120
- DialogDescription,
121
- DialogFooter,
122
- DialogHeader,
123
- DialogOverlay,
124
- DialogPortal,
125
- DialogTitle,
126
- DialogTrigger,
127
- };
1
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
2
+ import { XIcon } from "lucide-react";
3
+
4
+ import { cn } from "../lib/utils";
5
+
6
+ function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
7
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />;
8
+ }
9
+
10
+ function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
11
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
12
+ }
13
+
14
+ function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
15
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
16
+ }
17
+
18
+ function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
19
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
20
+ }
21
+
22
+ function DialogOverlay({
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
26
+ return (
27
+ <DialogPrimitive.Overlay
28
+ data-slot="dialog-overlay"
29
+ className={cn(
30
+ "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",
31
+ className
32
+ )}
33
+ {...props}
34
+ />
35
+ );
36
+ }
37
+
38
+ function DialogContent({
39
+ className,
40
+ children,
41
+ showCloseButton = true,
42
+ ...props
43
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
44
+ showCloseButton?: boolean;
45
+ }) {
46
+ return (
47
+ <DialogPortal data-slot="dialog-portal">
48
+ <DialogOverlay />
49
+ <DialogPrimitive.Content
50
+ data-slot="dialog-content"
51
+ className={cn(
52
+ "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 outline-none sm:max-w-lg",
53
+ className
54
+ )}
55
+ {...props}
56
+ >
57
+ {children}
58
+ {showCloseButton ? <DialogPrimitive.Close
59
+ data-slot="dialog-close"
60
+ 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"
61
+ >
62
+ <XIcon />
63
+ <span className="sr-only">Close</span>
64
+ </DialogPrimitive.Close> : null}
65
+ </DialogPrimitive.Content>
66
+ </DialogPortal>
67
+ );
68
+ }
69
+
70
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
71
+ return (
72
+ <div
73
+ data-slot="dialog-header"
74
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
75
+ {...props}
76
+ />
77
+ );
78
+ }
79
+
80
+ function DialogFooter({ className, ...props }: React.ComponentProps<"div">) {
81
+ return (
82
+ <div
83
+ data-slot="dialog-footer"
84
+ className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}
85
+ {...props}
86
+ />
87
+ );
88
+ }
89
+
90
+ function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
91
+ return (
92
+ <DialogPrimitive.Title
93
+ data-slot="dialog-title"
94
+ className={cn("text-lg leading-none font-semibold", className)}
95
+ {...props}
96
+ />
97
+ );
98
+ }
99
+
100
+ function DialogDescription({
101
+ className,
102
+ ...props
103
+ }: React.ComponentProps<typeof DialogPrimitive.Description>) {
104
+ return (
105
+ <DialogPrimitive.Description
106
+ data-slot="dialog-description"
107
+ className={cn("text-muted-foreground text-sm", className)}
108
+ {...props}
109
+ />
110
+ );
111
+ }
112
+
113
+ export {
114
+ Dialog,
115
+ DialogClose,
116
+ DialogContent,
117
+ DialogDescription,
118
+ DialogFooter,
119
+ DialogHeader,
120
+ DialogOverlay,
121
+ DialogPortal,
122
+ DialogTitle,
123
+ DialogTrigger,
124
+ };