@ichaingo/ui 1.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 (141) hide show
  1. package/.babelrc +12 -0
  2. package/README.md +103 -0
  3. package/components.json +21 -0
  4. package/dist/accordion.d.ts +13 -0
  5. package/dist/accordion.mjs +64 -0
  6. package/dist/alert-dialog.d.ts +27 -0
  7. package/dist/alert-dialog.mjs +146 -0
  8. package/dist/alert.d.ts +16 -0
  9. package/dist/alert.mjs +66 -0
  10. package/dist/aspect-ratio.d.ts +6 -0
  11. package/dist/aspect-ratio.mjs +10 -0
  12. package/dist/avatar.d.ts +11 -0
  13. package/dist/avatar.mjs +53 -0
  14. package/dist/badge.d.ts +14 -0
  15. package/dist/badge.mjs +39 -0
  16. package/dist/breadcrumb.d.ts +20 -0
  17. package/dist/breadcrumb.mjs +102 -0
  18. package/dist/button.d.ts +15 -0
  19. package/dist/button.mjs +49 -0
  20. package/dist/calendar.d.ts +23 -0
  21. package/dist/calendar.mjs +173 -0
  22. package/dist/card.d.ts +18 -0
  23. package/dist/card.mjs +90 -0
  24. package/dist/carousel.d.ts +42 -0
  25. package/dist/carousel.mjs +177 -0
  26. package/dist/checkbox.d.ts +7 -0
  27. package/dist/checkbox.mjs +31 -0
  28. package/dist/collapsible.d.ts +10 -0
  29. package/dist/collapsible.mjs +34 -0
  30. package/dist/command.d.ts +31 -0
  31. package/dist/command.mjs +170 -0
  32. package/dist/context-menu.d.ts +42 -0
  33. package/dist/context-menu.mjs +223 -0
  34. package/dist/dialog.d.ts +27 -0
  35. package/dist/dialog.mjs +136 -0
  36. package/dist/dropdown-menu.d.ts +42 -0
  37. package/dist/dropdown-menu.mjs +231 -0
  38. package/dist/form.d.ts +38 -0
  39. package/dist/form.mjs +101 -0
  40. package/dist/hover-card.d.ts +11 -0
  41. package/dist/hover-card.mjs +38 -0
  42. package/dist/input.d.ts +6 -0
  43. package/dist/input.mjs +21 -0
  44. package/dist/label.d.ts +7 -0
  45. package/dist/label.mjs +23 -0
  46. package/dist/menubar.d.ts +44 -0
  47. package/dist/menubar.mjs +251 -0
  48. package/dist/navigation-menu.d.ts +26 -0
  49. package/dist/navigation-menu.mjs +170 -0
  50. package/dist/pagination.d.ts +33 -0
  51. package/dist/pagination.mjs +116 -0
  52. package/dist/popover.d.ts +13 -0
  53. package/dist/popover.mjs +44 -0
  54. package/dist/progress.d.ts +7 -0
  55. package/dist/progress.mjs +31 -0
  56. package/dist/radio-group.d.ts +9 -0
  57. package/dist/radio-group.mjs +45 -0
  58. package/dist/resizable.d.ts +13 -0
  59. package/dist/resizable.mjs +48 -0
  60. package/dist/scroll-area.d.ts +9 -0
  61. package/dist/scroll-area.mjs +60 -0
  62. package/dist/select.d.ts +27 -0
  63. package/dist/select.mjs +169 -0
  64. package/dist/separator.d.ts +7 -0
  65. package/dist/separator.mjs +26 -0
  66. package/dist/sheet.d.ts +23 -0
  67. package/dist/sheet.mjs +126 -0
  68. package/dist/skeleton.d.ts +5 -0
  69. package/dist/skeleton.mjs +15 -0
  70. package/dist/slider.d.ts +7 -0
  71. package/dist/slider.mjs +63 -0
  72. package/dist/sonner.d.ts +6 -0
  73. package/dist/sonner.mjs +22 -0
  74. package/dist/switch.d.ts +7 -0
  75. package/dist/switch.mjs +31 -0
  76. package/dist/table.d.ts +20 -0
  77. package/dist/table.mjs +114 -0
  78. package/dist/tabs.d.ts +13 -0
  79. package/dist/tabs.mjs +67 -0
  80. package/dist/textarea.d.ts +6 -0
  81. package/dist/textarea.mjs +18 -0
  82. package/dist/toggle-group.d.ts +16 -0
  83. package/dist/toggle-group.mjs +62 -0
  84. package/dist/toggle.d.ts +14 -0
  85. package/dist/toggle.mjs +43 -0
  86. package/dist/tooltip.d.ts +13 -0
  87. package/dist/tooltip.mjs +55 -0
  88. package/dist/utils-B7J70Nno.js +8 -0
  89. package/eslint.config.mjs +12 -0
  90. package/package.json +273 -0
  91. package/postcss.config.js +6 -0
  92. package/src/components/ui/accordion.tsx +64 -0
  93. package/src/components/ui/alert-dialog.tsx +155 -0
  94. package/src/components/ui/alert.tsx +66 -0
  95. package/src/components/ui/aspect-ratio.tsx +9 -0
  96. package/src/components/ui/avatar.tsx +51 -0
  97. package/src/components/ui/badge.tsx +46 -0
  98. package/src/components/ui/breadcrumb.tsx +109 -0
  99. package/src/components/ui/button.tsx +59 -0
  100. package/src/components/ui/calendar.tsx +211 -0
  101. package/src/components/ui/card.tsx +92 -0
  102. package/src/components/ui/carousel.tsx +239 -0
  103. package/src/components/ui/checkbox.tsx +30 -0
  104. package/src/components/ui/collapsible.tsx +31 -0
  105. package/src/components/ui/command.tsx +182 -0
  106. package/src/components/ui/context-menu.tsx +250 -0
  107. package/src/components/ui/dialog.tsx +141 -0
  108. package/src/components/ui/dropdown-menu.tsx +255 -0
  109. package/src/components/ui/form.tsx +165 -0
  110. package/src/components/ui/hover-card.tsx +42 -0
  111. package/src/components/ui/input.tsx +21 -0
  112. package/src/components/ui/label.tsx +24 -0
  113. package/src/components/ui/menubar.tsx +274 -0
  114. package/src/components/ui/navigation-menu.tsx +168 -0
  115. package/src/components/ui/pagination.tsx +125 -0
  116. package/src/components/ui/popover.tsx +46 -0
  117. package/src/components/ui/progress.tsx +29 -0
  118. package/src/components/ui/radio-group.tsx +43 -0
  119. package/src/components/ui/resizable.tsx +54 -0
  120. package/src/components/ui/scroll-area.tsx +56 -0
  121. package/src/components/ui/select.tsx +183 -0
  122. package/src/components/ui/separator.tsx +26 -0
  123. package/src/components/ui/sheet.tsx +137 -0
  124. package/src/components/ui/skeleton.tsx +13 -0
  125. package/src/components/ui/slider.tsx +61 -0
  126. package/src/components/ui/sonner.tsx +23 -0
  127. package/src/components/ui/switch.tsx +29 -0
  128. package/src/components/ui/table.tsx +114 -0
  129. package/src/components/ui/tabs.tsx +64 -0
  130. package/src/components/ui/textarea.tsx +18 -0
  131. package/src/components/ui/toggle-group.tsx +71 -0
  132. package/src/components/ui/toggle.tsx +45 -0
  133. package/src/components/ui/tooltip.tsx +59 -0
  134. package/src/index.ts +46 -0
  135. package/src/lib/utils.ts +6 -0
  136. package/src/style.css +0 -0
  137. package/tailwind.config.js +52 -0
  138. package/tsconfig.json +19 -0
  139. package/tsconfig.lib.json +54 -0
  140. package/tsconfig.spec.json +32 -0
  141. package/vite.config.ts +136 -0
@@ -0,0 +1,30 @@
1
+ import * as React from "react"
2
+ import * as CheckboxPrimitive from "@radix-ui/react-checkbox"
3
+ import { CheckIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Checkbox({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
11
+ return (
12
+ <CheckboxPrimitive.Root
13
+ data-slot="checkbox"
14
+ className={cn(
15
+ "peer border-input 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",
16
+ className
17
+ )}
18
+ {...props}
19
+ >
20
+ <CheckboxPrimitive.Indicator
21
+ data-slot="checkbox-indicator"
22
+ className="flex items-center justify-center text-current transition-none"
23
+ >
24
+ <CheckIcon className="size-3.5" />
25
+ </CheckboxPrimitive.Indicator>
26
+ </CheckboxPrimitive.Root>
27
+ )
28
+ }
29
+
30
+ export { Checkbox }
@@ -0,0 +1,31 @@
1
+ import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
2
+
3
+ function Collapsible({
4
+ ...props
5
+ }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
6
+ return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />
7
+ }
8
+
9
+ function CollapsibleTrigger({
10
+ ...props
11
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
12
+ return (
13
+ <CollapsiblePrimitive.CollapsibleTrigger
14
+ data-slot="collapsible-trigger"
15
+ {...props}
16
+ />
17
+ )
18
+ }
19
+
20
+ function CollapsibleContent({
21
+ ...props
22
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
23
+ return (
24
+ <CollapsiblePrimitive.CollapsibleContent
25
+ data-slot="collapsible-content"
26
+ {...props}
27
+ />
28
+ )
29
+ }
30
+
31
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent }
@@ -0,0 +1,182 @@
1
+ import * as React from "react"
2
+ import { Command as CommandPrimitive } from "cmdk"
3
+ import { SearchIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+ import {
7
+ Dialog,
8
+ DialogContent,
9
+ DialogDescription,
10
+ DialogHeader,
11
+ DialogTitle,
12
+ } from "@/components/ui/dialog"
13
+
14
+ function Command({
15
+ className,
16
+ ...props
17
+ }: React.ComponentProps<typeof CommandPrimitive>) {
18
+ return (
19
+ <CommandPrimitive
20
+ data-slot="command"
21
+ className={cn(
22
+ "bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+
30
+ function CommandDialog({
31
+ title = "Command Palette",
32
+ description = "Search for a command to run...",
33
+ children,
34
+ className,
35
+ showCloseButton = true,
36
+ ...props
37
+ }: React.ComponentProps<typeof Dialog> & {
38
+ title?: string
39
+ description?: string
40
+ className?: string
41
+ showCloseButton?: boolean
42
+ }) {
43
+ return (
44
+ <Dialog {...props}>
45
+ <DialogHeader className="sr-only">
46
+ <DialogTitle>{title}</DialogTitle>
47
+ <DialogDescription>{description}</DialogDescription>
48
+ </DialogHeader>
49
+ <DialogContent
50
+ className={cn("overflow-hidden p-0", className)}
51
+ showCloseButton={showCloseButton}
52
+ >
53
+ <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">
54
+ {children}
55
+ </Command>
56
+ </DialogContent>
57
+ </Dialog>
58
+ )
59
+ }
60
+
61
+ function CommandInput({
62
+ className,
63
+ ...props
64
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
65
+ return (
66
+ <div
67
+ data-slot="command-input-wrapper"
68
+ className="flex h-9 items-center gap-2 border-b px-3"
69
+ >
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-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none 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
+ }
@@ -0,0 +1,250 @@
1
+ import * as React from "react"
2
+ import * as ContextMenuPrimitive from "@radix-ui/react-context-menu"
3
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function ContextMenu({
8
+ ...props
9
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
10
+ return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />
11
+ }
12
+
13
+ function ContextMenuTrigger({
14
+ ...props
15
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
16
+ return (
17
+ <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />
18
+ )
19
+ }
20
+
21
+ function ContextMenuGroup({
22
+ ...props
23
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
24
+ return (
25
+ <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />
26
+ )
27
+ }
28
+
29
+ function ContextMenuPortal({
30
+ ...props
31
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
32
+ return (
33
+ <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />
34
+ )
35
+ }
36
+
37
+ function ContextMenuSub({
38
+ ...props
39
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
40
+ return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />
41
+ }
42
+
43
+ function ContextMenuRadioGroup({
44
+ ...props
45
+ }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
46
+ return (
47
+ <ContextMenuPrimitive.RadioGroup
48
+ data-slot="context-menu-radio-group"
49
+ {...props}
50
+ />
51
+ )
52
+ }
53
+
54
+ function ContextMenuSubTrigger({
55
+ className,
56
+ inset,
57
+ children,
58
+ ...props
59
+ }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
60
+ inset?: boolean
61
+ }) {
62
+ return (
63
+ <ContextMenuPrimitive.SubTrigger
64
+ data-slot="context-menu-sub-trigger"
65
+ data-inset={inset}
66
+ className={cn(
67
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground flex cursor-default 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",
68
+ className
69
+ )}
70
+ {...props}
71
+ >
72
+ {children}
73
+ <ChevronRightIcon className="ml-auto" />
74
+ </ContextMenuPrimitive.SubTrigger>
75
+ )
76
+ }
77
+
78
+ function ContextMenuSubContent({
79
+ className,
80
+ ...props
81
+ }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
82
+ return (
83
+ <ContextMenuPrimitive.SubContent
84
+ data-slot="context-menu-sub-content"
85
+ className={cn(
86
+ "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",
87
+ className
88
+ )}
89
+ {...props}
90
+ />
91
+ )
92
+ }
93
+
94
+ function ContextMenuContent({
95
+ className,
96
+ ...props
97
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
98
+ return (
99
+ <ContextMenuPrimitive.Portal>
100
+ <ContextMenuPrimitive.Content
101
+ data-slot="context-menu-content"
102
+ className={cn(
103
+ "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",
104
+ className
105
+ )}
106
+ {...props}
107
+ />
108
+ </ContextMenuPrimitive.Portal>
109
+ )
110
+ }
111
+
112
+ function ContextMenuItem({
113
+ className,
114
+ inset,
115
+ variant = "default",
116
+ ...props
117
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
118
+ inset?: boolean
119
+ variant?: "default" | "destructive"
120
+ }) {
121
+ return (
122
+ <ContextMenuPrimitive.Item
123
+ data-slot="context-menu-item"
124
+ data-inset={inset}
125
+ data-variant={variant}
126
+ className={cn(
127
+ "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-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
128
+ className
129
+ )}
130
+ {...props}
131
+ />
132
+ )
133
+ }
134
+
135
+ function ContextMenuCheckboxItem({
136
+ className,
137
+ children,
138
+ checked,
139
+ ...props
140
+ }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
141
+ return (
142
+ <ContextMenuPrimitive.CheckboxItem
143
+ data-slot="context-menu-checkbox-item"
144
+ className={cn(
145
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
146
+ className
147
+ )}
148
+ checked={checked}
149
+ {...props}
150
+ >
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-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
171
+ className
172
+ )}
173
+ {...props}
174
+ >
175
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
176
+ <ContextMenuPrimitive.ItemIndicator>
177
+ <CircleIcon className="size-2 fill-current" />
178
+ </ContextMenuPrimitive.ItemIndicator>
179
+ </span>
180
+ {children}
181
+ </ContextMenuPrimitive.RadioItem>
182
+ )
183
+ }
184
+
185
+ function ContextMenuLabel({
186
+ className,
187
+ inset,
188
+ ...props
189
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
190
+ inset?: boolean
191
+ }) {
192
+ return (
193
+ <ContextMenuPrimitive.Label
194
+ data-slot="context-menu-label"
195
+ data-inset={inset}
196
+ className={cn(
197
+ "text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8",
198
+ className
199
+ )}
200
+ {...props}
201
+ />
202
+ )
203
+ }
204
+
205
+ function ContextMenuSeparator({
206
+ className,
207
+ ...props
208
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
209
+ return (
210
+ <ContextMenuPrimitive.Separator
211
+ data-slot="context-menu-separator"
212
+ className={cn("bg-border -mx-1 my-1 h-px", className)}
213
+ {...props}
214
+ />
215
+ )
216
+ }
217
+
218
+ function ContextMenuShortcut({
219
+ className,
220
+ ...props
221
+ }: React.ComponentProps<"span">) {
222
+ return (
223
+ <span
224
+ data-slot="context-menu-shortcut"
225
+ className={cn(
226
+ "text-muted-foreground ml-auto text-xs tracking-widest",
227
+ className
228
+ )}
229
+ {...props}
230
+ />
231
+ )
232
+ }
233
+
234
+ export {
235
+ ContextMenu,
236
+ ContextMenuTrigger,
237
+ ContextMenuContent,
238
+ ContextMenuItem,
239
+ ContextMenuCheckboxItem,
240
+ ContextMenuRadioItem,
241
+ ContextMenuLabel,
242
+ ContextMenuSeparator,
243
+ ContextMenuShortcut,
244
+ ContextMenuGroup,
245
+ ContextMenuPortal,
246
+ ContextMenuSub,
247
+ ContextMenuSubContent,
248
+ ContextMenuSubTrigger,
249
+ ContextMenuRadioGroup,
250
+ }
@@ -0,0 +1,141 @@
1
+ import * as React from "react"
2
+ import * as DialogPrimitive from "@radix-ui/react-dialog"
3
+ import { XIcon } from "lucide-react"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Dialog({
8
+ ...props
9
+ }: React.ComponentProps<typeof DialogPrimitive.Root>) {
10
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
11
+ }
12
+
13
+ function DialogTrigger({
14
+ ...props
15
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
16
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
17
+ }
18
+
19
+ function DialogPortal({
20
+ ...props
21
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
22
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
23
+ }
24
+
25
+ function DialogClose({
26
+ ...props
27
+ }: React.ComponentProps<typeof DialogPrimitive.Close>) {
28
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
29
+ }
30
+
31
+ function DialogOverlay({
32
+ className,
33
+ ...props
34
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
35
+ return (
36
+ <DialogPrimitive.Overlay
37
+ data-slot="dialog-overlay"
38
+ className={cn(
39
+ "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",
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ )
45
+ }
46
+
47
+ function DialogContent({
48
+ className,
49
+ children,
50
+ showCloseButton = true,
51
+ ...props
52
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
53
+ showCloseButton?: boolean
54
+ }) {
55
+ return (
56
+ <DialogPortal data-slot="dialog-portal">
57
+ <DialogOverlay />
58
+ <DialogPrimitive.Content
59
+ data-slot="dialog-content"
60
+ className={cn(
61
+ "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",
62
+ className
63
+ )}
64
+ {...props}
65
+ >
66
+ {children}
67
+ {showCloseButton && (
68
+ <DialogPrimitive.Close
69
+ data-slot="dialog-close"
70
+ 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"
71
+ >
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
+ }