@softure-ai/theme-notion 0.0.0-stage → 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 (247) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/LICENSE +21 -0
  3. package/README.md +114 -2
  4. package/dist/index.d.ts +47 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +49 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/lib/utils.d.ts +6 -0
  9. package/dist/lib/utils.d.ts.map +1 -0
  10. package/dist/lib/utils.js +8 -0
  11. package/dist/lib/utils.js.map +1 -0
  12. package/dist/messages/en.d.ts +29 -0
  13. package/dist/messages/en.d.ts.map +1 -0
  14. package/dist/messages/en.js +13 -0
  15. package/dist/messages/en.js.map +1 -0
  16. package/dist/messages/index.d.ts +30 -0
  17. package/dist/messages/index.d.ts.map +1 -0
  18. package/dist/messages/index.js +4 -0
  19. package/dist/messages/index.js.map +1 -0
  20. package/dist/notion/PageFrame.d.ts +11 -0
  21. package/dist/notion/PageFrame.d.ts.map +1 -0
  22. package/dist/notion/PageFrame.js +10 -0
  23. package/dist/notion/PageFrame.js.map +1 -0
  24. package/dist/notion/PageHeader.d.ts +16 -0
  25. package/dist/notion/PageHeader.d.ts.map +1 -0
  26. package/dist/notion/PageHeader.js +9 -0
  27. package/dist/notion/PageHeader.js.map +1 -0
  28. package/dist/notion/PropertyList.d.ts +12 -0
  29. package/dist/notion/PropertyList.d.ts.map +1 -0
  30. package/dist/notion/PropertyList.js +8 -0
  31. package/dist/notion/PropertyList.js.map +1 -0
  32. package/dist/notion/Status.d.ts +11 -0
  33. package/dist/notion/Status.d.ts.map +1 -0
  34. package/dist/notion/Status.js +21 -0
  35. package/dist/notion/Status.js.map +1 -0
  36. package/dist/notion/icon-stroke.d.ts +2 -0
  37. package/dist/notion/icon-stroke.d.ts.map +1 -0
  38. package/dist/notion/icon-stroke.js +3 -0
  39. package/dist/notion/icon-stroke.js.map +1 -0
  40. package/dist/notion/palette.d.ts +3 -0
  41. package/dist/notion/palette.d.ts.map +1 -0
  42. package/dist/notion/palette.js +4 -0
  43. package/dist/notion/palette.js.map +1 -0
  44. package/dist/sft-bridge.css +47 -0
  45. package/dist/theme.css +388 -0
  46. package/dist/tokens.d.ts +801 -0
  47. package/dist/tokens.d.ts.map +1 -0
  48. package/dist/tokens.js +139 -0
  49. package/dist/tokens.js.map +1 -0
  50. package/dist/ui/accordion.d.ts +8 -0
  51. package/dist/ui/accordion.d.ts.map +1 -0
  52. package/dist/ui/accordion.js +20 -0
  53. package/dist/ui/accordion.js.map +1 -0
  54. package/dist/ui/alert-dialog.d.ts +19 -0
  55. package/dist/ui/alert-dialog.d.ts.map +1 -0
  56. package/dist/ui/alert-dialog.js +44 -0
  57. package/dist/ui/alert-dialog.js.map +1 -0
  58. package/dist/ui/alert.d.ts +10 -0
  59. package/dist/ui/alert.d.ts.map +1 -0
  60. package/dist/ui/alert.js +35 -0
  61. package/dist/ui/alert.js.map +1 -0
  62. package/dist/ui/avatar.d.ts +12 -0
  63. package/dist/ui/avatar.d.ts.map +1 -0
  64. package/dist/ui/avatar.js +25 -0
  65. package/dist/ui/avatar.js.map +1 -0
  66. package/dist/ui/badge.d.ts +11 -0
  67. package/dist/ui/badge.d.ts.map +1 -0
  68. package/dist/ui/badge.js +41 -0
  69. package/dist/ui/badge.js.map +1 -0
  70. package/dist/ui/breadcrumb.d.ts +14 -0
  71. package/dist/ui/breadcrumb.d.ts.map +1 -0
  72. package/dist/ui/breadcrumb.js +30 -0
  73. package/dist/ui/breadcrumb.js.map +1 -0
  74. package/dist/ui/button-group.d.ts +12 -0
  75. package/dist/ui/button-group.d.ts.map +1 -0
  76. package/dist/ui/button-group.js +28 -0
  77. package/dist/ui/button-group.js.map +1 -0
  78. package/dist/ui/button.d.ts +11 -0
  79. package/dist/ui/button.d.ts.map +1 -0
  80. package/dist/ui/button.js +37 -0
  81. package/dist/ui/button.js.map +1 -0
  82. package/dist/ui/card.d.ts +10 -0
  83. package/dist/ui/card.d.ts.map +1 -0
  84. package/dist/ui/card.js +26 -0
  85. package/dist/ui/card.js.map +1 -0
  86. package/dist/ui/checkbox.d.ts +5 -0
  87. package/dist/ui/checkbox.d.ts.map +1 -0
  88. package/dist/ui/checkbox.js +11 -0
  89. package/dist/ui/checkbox.js.map +1 -0
  90. package/dist/ui/collapsible.d.ts +6 -0
  91. package/dist/ui/collapsible.d.ts.map +1 -0
  92. package/dist/ui/collapsible.js +14 -0
  93. package/dist/ui/collapsible.js.map +1 -0
  94. package/dist/ui/command.d.ts +19 -0
  95. package/dist/ui/command.d.ts.map +1 -0
  96. package/dist/ui/command.js +37 -0
  97. package/dist/ui/command.js.map +1 -0
  98. package/dist/ui/dialog.d.ts +19 -0
  99. package/dist/ui/dialog.d.ts.map +1 -0
  100. package/dist/ui/dialog.js +40 -0
  101. package/dist/ui/dialog.js.map +1 -0
  102. package/dist/ui/dropdown-menu.d.ts +26 -0
  103. package/dist/ui/dropdown-menu.d.ts.map +1 -0
  104. package/dist/ui/dropdown-menu.js +53 -0
  105. package/dist/ui/dropdown-menu.js.map +1 -0
  106. package/dist/ui/empty.d.ts +12 -0
  107. package/dist/ui/empty.d.ts.map +1 -0
  108. package/dist/ui/empty.js +34 -0
  109. package/dist/ui/empty.js.map +1 -0
  110. package/dist/ui/field.d.ts +25 -0
  111. package/dist/ui/field.d.ts.map +1 -0
  112. package/dist/ui/field.js +77 -0
  113. package/dist/ui/field.js.map +1 -0
  114. package/dist/ui/input-group.d.ts +17 -0
  115. package/dist/ui/input-group.d.ts.map +1 -0
  116. package/dist/ui/input-group.js +65 -0
  117. package/dist/ui/input-group.js.map +1 -0
  118. package/dist/ui/input.d.ts +4 -0
  119. package/dist/ui/input.d.ts.map +1 -0
  120. package/dist/ui/input.js +8 -0
  121. package/dist/ui/input.js.map +1 -0
  122. package/dist/ui/item.d.ts +24 -0
  123. package/dist/ui/item.d.ts.map +1 -0
  124. package/dist/ui/item.js +68 -0
  125. package/dist/ui/item.js.map +1 -0
  126. package/dist/ui/kbd.d.ts +4 -0
  127. package/dist/ui/kbd.d.ts.map +1 -0
  128. package/dist/ui/kbd.js +10 -0
  129. package/dist/ui/kbd.js.map +1 -0
  130. package/dist/ui/label.d.ts +5 -0
  131. package/dist/ui/label.d.ts.map +1 -0
  132. package/dist/ui/label.js +10 -0
  133. package/dist/ui/label.js.map +1 -0
  134. package/dist/ui/popover.d.ts +11 -0
  135. package/dist/ui/popover.d.ts.map +1 -0
  136. package/dist/ui/popover.js +28 -0
  137. package/dist/ui/popover.js.map +1 -0
  138. package/dist/ui/progress.d.ts +5 -0
  139. package/dist/ui/progress.d.ts.map +1 -0
  140. package/dist/ui/progress.js +10 -0
  141. package/dist/ui/progress.js.map +1 -0
  142. package/dist/ui/scroll-area.d.ts +6 -0
  143. package/dist/ui/scroll-area.d.ts.map +1 -0
  144. package/dist/ui/scroll-area.js +15 -0
  145. package/dist/ui/scroll-area.js.map +1 -0
  146. package/dist/ui/select.d.ts +16 -0
  147. package/dist/ui/select.d.ts.map +1 -0
  148. package/dist/ui/select.js +40 -0
  149. package/dist/ui/select.js.map +1 -0
  150. package/dist/ui/separator.d.ts +5 -0
  151. package/dist/ui/separator.d.ts.map +1 -0
  152. package/dist/ui/separator.js +10 -0
  153. package/dist/ui/separator.js.map +1 -0
  154. package/dist/ui/sheet.d.ts +16 -0
  155. package/dist/ui/sheet.d.ts.map +1 -0
  156. package/dist/ui/sheet.js +43 -0
  157. package/dist/ui/sheet.js.map +1 -0
  158. package/dist/ui/sidebar.d.ts +76 -0
  159. package/dist/ui/sidebar.d.ts.map +1 -0
  160. package/dist/ui/sidebar.js +216 -0
  161. package/dist/ui/sidebar.js.map +1 -0
  162. package/dist/ui/skeleton.d.ts +3 -0
  163. package/dist/ui/skeleton.d.ts.map +1 -0
  164. package/dist/ui/skeleton.js +7 -0
  165. package/dist/ui/skeleton.js.map +1 -0
  166. package/dist/ui/sonner.d.ts +4 -0
  167. package/dist/ui/sonner.d.ts.map +1 -0
  168. package/dist/ui/sonner.js +22 -0
  169. package/dist/ui/sonner.js.map +1 -0
  170. package/dist/ui/spinner.d.ts +3 -0
  171. package/dist/ui/spinner.d.ts.map +1 -0
  172. package/dist/ui/spinner.js +9 -0
  173. package/dist/ui/spinner.js.map +1 -0
  174. package/dist/ui/switch-thumb.d.ts +7 -0
  175. package/dist/ui/switch-thumb.d.ts.map +1 -0
  176. package/dist/ui/switch-thumb.js +7 -0
  177. package/dist/ui/switch-thumb.js.map +1 -0
  178. package/dist/ui/switch.d.ts +7 -0
  179. package/dist/ui/switch.d.ts.map +1 -0
  180. package/dist/ui/switch.js +11 -0
  181. package/dist/ui/switch.js.map +1 -0
  182. package/dist/ui/table.d.ts +11 -0
  183. package/dist/ui/table.d.ts.map +1 -0
  184. package/dist/ui/table.js +30 -0
  185. package/dist/ui/table.js.map +1 -0
  186. package/dist/ui/tabs.d.ts +12 -0
  187. package/dist/ui/tabs.d.ts.map +1 -0
  188. package/dist/ui/tabs.js +31 -0
  189. package/dist/ui/tabs.js.map +1 -0
  190. package/dist/ui/textarea.d.ts +4 -0
  191. package/dist/ui/textarea.d.ts.map +1 -0
  192. package/dist/ui/textarea.js +8 -0
  193. package/dist/ui/textarea.js.map +1 -0
  194. package/dist/ui/tooltip.d.ts +8 -0
  195. package/dist/ui/tooltip.d.ts.map +1 -0
  196. package/dist/ui/tooltip.js +19 -0
  197. package/dist/ui/tooltip.js.map +1 -0
  198. package/package.json +69 -4
  199. package/src/index.ts +50 -0
  200. package/src/lib/utils.ts +9 -0
  201. package/src/messages/en.ts +12 -0
  202. package/src/messages/index.ts +6 -0
  203. package/src/notion/PageFrame.tsx +18 -0
  204. package/src/notion/PageHeader.tsx +62 -0
  205. package/src/notion/PropertyList.tsx +38 -0
  206. package/src/notion/Status.tsx +44 -0
  207. package/src/notion/icon-stroke.ts +2 -0
  208. package/src/notion/palette.ts +5 -0
  209. package/src/sft-bridge.css +47 -0
  210. package/src/tokens.ts +140 -0
  211. package/src/ui/accordion.tsx +65 -0
  212. package/src/ui/alert-dialog.tsx +196 -0
  213. package/src/ui/alert.tsx +74 -0
  214. package/src/ui/avatar.tsx +108 -0
  215. package/src/ui/badge.tsx +63 -0
  216. package/src/ui/breadcrumb.tsx +113 -0
  217. package/src/ui/button-group.tsx +83 -0
  218. package/src/ui/button.tsx +62 -0
  219. package/src/ui/card.tsx +91 -0
  220. package/src/ui/checkbox.tsx +31 -0
  221. package/src/ui/collapsible.tsx +33 -0
  222. package/src/ui/command.tsx +185 -0
  223. package/src/ui/dialog.tsx +162 -0
  224. package/src/ui/dropdown-menu.tsx +256 -0
  225. package/src/ui/empty.tsx +103 -0
  226. package/src/ui/field.tsx +248 -0
  227. package/src/ui/input-group.tsx +170 -0
  228. package/src/ui/input.tsx +20 -0
  229. package/src/ui/item.tsx +193 -0
  230. package/src/ui/kbd.tsx +28 -0
  231. package/src/ui/label.tsx +23 -0
  232. package/src/ui/popover.tsx +88 -0
  233. package/src/ui/progress.tsx +30 -0
  234. package/src/ui/scroll-area.tsx +57 -0
  235. package/src/ui/select.tsx +189 -0
  236. package/src/ui/separator.tsx +27 -0
  237. package/src/ui/sheet.tsx +146 -0
  238. package/src/ui/sidebar.tsx +744 -0
  239. package/src/ui/skeleton.tsx +13 -0
  240. package/src/ui/sonner.tsx +39 -0
  241. package/src/ui/spinner.tsx +16 -0
  242. package/src/ui/switch-thumb.ts +6 -0
  243. package/src/ui/switch.tsx +36 -0
  244. package/src/ui/table.tsx +115 -0
  245. package/src/ui/tabs.tsx +90 -0
  246. package/src/ui/textarea.tsx +17 -0
  247. package/src/ui/tooltip.tsx +55 -0
@@ -0,0 +1,256 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../lib/utils.js"
5
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react"
6
+ import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui"
7
+
8
+ function DropdownMenu({
9
+ ...props
10
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
11
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />
12
+ }
13
+
14
+ function DropdownMenuPortal({
15
+ ...props
16
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
17
+ return (
18
+ <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
19
+ )
20
+ }
21
+
22
+ function DropdownMenuTrigger({
23
+ ...props
24
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
25
+ return (
26
+ <DropdownMenuPrimitive.Trigger
27
+ data-slot="dropdown-menu-trigger"
28
+ {...props}
29
+ />
30
+ )
31
+ }
32
+
33
+ function DropdownMenuContent({
34
+ className,
35
+ sideOffset = 4,
36
+ ...props
37
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
38
+ return (
39
+ <DropdownMenuPrimitive.Portal>
40
+ <DropdownMenuPrimitive.Content
41
+ data-slot="dropdown-menu-content"
42
+ sideOffset={sideOffset}
43
+ className={cn(
44
+ "z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover p-1 text-popover-foreground shadow-menu 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
45
+ className
46
+ )}
47
+ {...props}
48
+ />
49
+ </DropdownMenuPrimitive.Portal>
50
+ )
51
+ }
52
+
53
+ function DropdownMenuGroup({
54
+ ...props
55
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
56
+ return (
57
+ <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
58
+ )
59
+ }
60
+
61
+ function DropdownMenuItem({
62
+ className,
63
+ inset,
64
+ variant = "default",
65
+ ...props
66
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
67
+ inset?: boolean
68
+ variant?: "default" | "destructive"
69
+ }) {
70
+ return (
71
+ <DropdownMenuPrimitive.Item
72
+ data-slot="dropdown-menu-item"
73
+ data-inset={inset}
74
+ data-variant={variant}
75
+ className={cn(
76
+ "relative flex cursor-default items-center gap-2 rounded-md min-h-7 px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
77
+ className
78
+ )}
79
+ {...props}
80
+ />
81
+ )
82
+ }
83
+
84
+ function DropdownMenuCheckboxItem({
85
+ className,
86
+ children,
87
+ checked,
88
+ ...props
89
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
90
+ return (
91
+ <DropdownMenuPrimitive.CheckboxItem
92
+ data-slot="dropdown-menu-checkbox-item"
93
+ className={cn(
94
+ "relative flex cursor-default items-center gap-2 rounded-md min-h-7 py-1 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
95
+ className
96
+ )}
97
+ checked={checked}
98
+ {...props}
99
+ >
100
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
101
+ <DropdownMenuPrimitive.ItemIndicator>
102
+ <CheckIcon className="size-4" />
103
+ </DropdownMenuPrimitive.ItemIndicator>
104
+ </span>
105
+ {children}
106
+ </DropdownMenuPrimitive.CheckboxItem>
107
+ )
108
+ }
109
+
110
+ function DropdownMenuRadioGroup({
111
+ ...props
112
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
113
+ return (
114
+ <DropdownMenuPrimitive.RadioGroup
115
+ data-slot="dropdown-menu-radio-group"
116
+ {...props}
117
+ />
118
+ )
119
+ }
120
+
121
+ function DropdownMenuRadioItem({
122
+ className,
123
+ children,
124
+ ...props
125
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
126
+ return (
127
+ <DropdownMenuPrimitive.RadioItem
128
+ data-slot="dropdown-menu-radio-item"
129
+ className={cn(
130
+ "relative flex cursor-default items-center gap-2 rounded-md min-h-7 py-1 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
131
+ className
132
+ )}
133
+ {...props}
134
+ >
135
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
136
+ <DropdownMenuPrimitive.ItemIndicator>
137
+ <CircleIcon className="size-2 fill-current" />
138
+ </DropdownMenuPrimitive.ItemIndicator>
139
+ </span>
140
+ {children}
141
+ </DropdownMenuPrimitive.RadioItem>
142
+ )
143
+ }
144
+
145
+ function DropdownMenuLabel({
146
+ className,
147
+ inset,
148
+ ...props
149
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
150
+ inset?: boolean
151
+ }) {
152
+ return (
153
+ <DropdownMenuPrimitive.Label
154
+ data-slot="dropdown-menu-label"
155
+ data-inset={inset}
156
+ className={cn(
157
+ "px-2 py-1.5 text-xs font-medium text-muted-foreground data-[inset]:pl-8",
158
+ className
159
+ )}
160
+ {...props}
161
+ />
162
+ )
163
+ }
164
+
165
+ function DropdownMenuSeparator({
166
+ className,
167
+ ...props
168
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
169
+ return (
170
+ <DropdownMenuPrimitive.Separator
171
+ data-slot="dropdown-menu-separator"
172
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
173
+ {...props}
174
+ />
175
+ )
176
+ }
177
+
178
+ function DropdownMenuShortcut({
179
+ className,
180
+ ...props
181
+ }: React.ComponentProps<"span">) {
182
+ return (
183
+ <span
184
+ data-slot="dropdown-menu-shortcut"
185
+ className={cn(
186
+ "ml-auto text-xs tracking-widest text-muted-foreground",
187
+ className
188
+ )}
189
+ {...props}
190
+ />
191
+ )
192
+ }
193
+
194
+ function DropdownMenuSub({
195
+ ...props
196
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
197
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />
198
+ }
199
+
200
+ function DropdownMenuSubTrigger({
201
+ className,
202
+ inset,
203
+ children,
204
+ ...props
205
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
206
+ inset?: boolean
207
+ }) {
208
+ return (
209
+ <DropdownMenuPrimitive.SubTrigger
210
+ data-slot="dropdown-menu-sub-trigger"
211
+ data-inset={inset}
212
+ className={cn(
213
+ "flex cursor-default items-center gap-2 rounded-md min-h-7 px-2 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
214
+ className
215
+ )}
216
+ {...props}
217
+ >
218
+ {children}
219
+ <ChevronRightIcon className="ml-auto size-4" />
220
+ </DropdownMenuPrimitive.SubTrigger>
221
+ )
222
+ }
223
+
224
+ function DropdownMenuSubContent({
225
+ className,
226
+ ...props
227
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
228
+ return (
229
+ <DropdownMenuPrimitive.SubContent
230
+ data-slot="dropdown-menu-sub-content"
231
+ className={cn(
232
+ "z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-xl bg-popover p-1 text-popover-foreground shadow-menu 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 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
233
+ className
234
+ )}
235
+ {...props}
236
+ />
237
+ )
238
+ }
239
+
240
+ export {
241
+ DropdownMenu,
242
+ DropdownMenuPortal,
243
+ DropdownMenuTrigger,
244
+ DropdownMenuContent,
245
+ DropdownMenuGroup,
246
+ DropdownMenuLabel,
247
+ DropdownMenuItem,
248
+ DropdownMenuCheckboxItem,
249
+ DropdownMenuRadioGroup,
250
+ DropdownMenuRadioItem,
251
+ DropdownMenuSeparator,
252
+ DropdownMenuShortcut,
253
+ DropdownMenuSub,
254
+ DropdownMenuSubTrigger,
255
+ DropdownMenuSubContent,
256
+ }
@@ -0,0 +1,103 @@
1
+ import { cva, type VariantProps } from "class-variance-authority"
2
+ import { cn } from "../lib/utils.js"
3
+
4
+ function Empty({ className, ...props }: React.ComponentProps<"div">) {
5
+ return (
6
+ <div
7
+ data-slot="empty"
8
+ className={cn(
9
+ "flex min-w-0 flex-1 flex-col items-center justify-center gap-6 rounded-lg border-dashed p-6 text-center text-balance md:p-12",
10
+ className
11
+ )}
12
+ {...props}
13
+ />
14
+ )
15
+ }
16
+
17
+ function EmptyHeader({ className, ...props }: React.ComponentProps<"div">) {
18
+ return (
19
+ <div
20
+ data-slot="empty-header"
21
+ className={cn(
22
+ "flex max-w-sm flex-col items-center gap-2 text-center",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+
30
+ const emptyMediaVariants = cva(
31
+ "mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
32
+ {
33
+ variants: {
34
+ variant: {
35
+ default: "bg-transparent",
36
+ icon: "flex size-10 shrink-0 items-center justify-center rounded-lg bg-muted text-foreground [&_svg:not([class*='size-'])]:size-6",
37
+ },
38
+ },
39
+ defaultVariants: {
40
+ variant: "default",
41
+ },
42
+ }
43
+ )
44
+
45
+ function EmptyMedia({
46
+ className,
47
+ variant = "default",
48
+ ...props
49
+ }: React.ComponentProps<"div"> & VariantProps<typeof emptyMediaVariants>) {
50
+ return (
51
+ <div
52
+ data-slot="empty-icon"
53
+ data-variant={variant}
54
+ className={cn(emptyMediaVariants({ variant, className }))}
55
+ {...props}
56
+ />
57
+ )
58
+ }
59
+
60
+ function EmptyTitle({ className, ...props }: React.ComponentProps<"div">) {
61
+ return (
62
+ <div
63
+ data-slot="empty-title"
64
+ className={cn("text-lg font-medium tracking-tight", className)}
65
+ {...props}
66
+ />
67
+ )
68
+ }
69
+
70
+ function EmptyDescription({ className, ...props }: React.ComponentProps<"p">) {
71
+ return (
72
+ <div
73
+ data-slot="empty-description"
74
+ className={cn(
75
+ "text-sm/relaxed text-muted-foreground [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
76
+ className
77
+ )}
78
+ {...props}
79
+ />
80
+ )
81
+ }
82
+
83
+ function EmptyContent({ className, ...props }: React.ComponentProps<"div">) {
84
+ return (
85
+ <div
86
+ data-slot="empty-content"
87
+ className={cn(
88
+ "flex w-full max-w-sm min-w-0 flex-col items-center gap-4 text-sm text-balance",
89
+ className
90
+ )}
91
+ {...props}
92
+ />
93
+ )
94
+ }
95
+
96
+ export {
97
+ Empty,
98
+ EmptyHeader,
99
+ EmptyTitle,
100
+ EmptyDescription,
101
+ EmptyContent,
102
+ EmptyMedia,
103
+ }
@@ -0,0 +1,248 @@
1
+ "use client"
2
+
3
+ import { useMemo } from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+ import { cn } from "../lib/utils.js"
6
+
7
+ import { Label } from "./label.js"
8
+ import { Separator } from "./separator.js"
9
+
10
+ function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
11
+ return (
12
+ <fieldset
13
+ data-slot="field-set"
14
+ className={cn(
15
+ "flex flex-col gap-6",
16
+ "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
17
+ className
18
+ )}
19
+ {...props}
20
+ />
21
+ )
22
+ }
23
+
24
+ function FieldLegend({
25
+ className,
26
+ variant = "legend",
27
+ ...props
28
+ }: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
29
+ return (
30
+ <legend
31
+ data-slot="field-legend"
32
+ data-variant={variant}
33
+ className={cn(
34
+ "mb-3 font-medium",
35
+ "data-[variant=legend]:text-base",
36
+ "data-[variant=label]:text-sm",
37
+ className
38
+ )}
39
+ {...props}
40
+ />
41
+ )
42
+ }
43
+
44
+ function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
45
+ return (
46
+ <div
47
+ data-slot="field-group"
48
+ className={cn(
49
+ "group/field-group @container/field-group flex w-full flex-col gap-7 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4",
50
+ className
51
+ )}
52
+ {...props}
53
+ />
54
+ )
55
+ }
56
+
57
+ const fieldVariants = cva(
58
+ "group/field flex w-full gap-3 data-[invalid=true]:text-destructive",
59
+ {
60
+ variants: {
61
+ orientation: {
62
+ vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
63
+ horizontal: [
64
+ "flex-row items-center",
65
+ "[&>[data-slot=field-label]]:flex-auto",
66
+ "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
67
+ ],
68
+ responsive: [
69
+ "flex-col @md/field-group:flex-row @md/field-group:items-center [&>*]:w-full @md/field-group:[&>*]:w-auto [&>.sr-only]:w-auto",
70
+ "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
71
+ "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
72
+ ],
73
+ },
74
+ },
75
+ defaultVariants: {
76
+ orientation: "vertical",
77
+ },
78
+ }
79
+ )
80
+
81
+ function Field({
82
+ className,
83
+ orientation = "vertical",
84
+ ...props
85
+ }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {
86
+ return (
87
+ <div
88
+ role="group"
89
+ data-slot="field"
90
+ data-orientation={orientation}
91
+ className={cn(fieldVariants({ orientation }), className)}
92
+ {...props}
93
+ />
94
+ )
95
+ }
96
+
97
+ function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
98
+ return (
99
+ <div
100
+ data-slot="field-content"
101
+ className={cn(
102
+ "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
103
+ className
104
+ )}
105
+ {...props}
106
+ />
107
+ )
108
+ }
109
+
110
+ function FieldLabel({
111
+ className,
112
+ ...props
113
+ }: React.ComponentProps<typeof Label>) {
114
+ return (
115
+ <Label
116
+ data-slot="field-label"
117
+ className={cn(
118
+ "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
119
+ "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
120
+ "has-data-[state=checked]:border-primary has-data-[state=checked]:bg-primary/5 dark:has-data-[state=checked]:bg-primary/10",
121
+ className
122
+ )}
123
+ {...props}
124
+ />
125
+ )
126
+ }
127
+
128
+ function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
129
+ return (
130
+ <div
131
+ data-slot="field-label"
132
+ className={cn(
133
+ "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
134
+ className
135
+ )}
136
+ {...props}
137
+ />
138
+ )
139
+ }
140
+
141
+ function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
142
+ return (
143
+ <p
144
+ data-slot="field-description"
145
+ className={cn(
146
+ "text-sm leading-normal font-normal text-muted-foreground group-has-[[data-orientation=horizontal]]/field:text-balance",
147
+ "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
148
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
149
+ className
150
+ )}
151
+ {...props}
152
+ />
153
+ )
154
+ }
155
+
156
+ function FieldSeparator({
157
+ children,
158
+ className,
159
+ ...props
160
+ }: React.ComponentProps<"div"> & {
161
+ children?: React.ReactNode
162
+ }) {
163
+ return (
164
+ <div
165
+ data-slot="field-separator"
166
+ data-content={!!children}
167
+ className={cn(
168
+ "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
169
+ className
170
+ )}
171
+ {...props}
172
+ >
173
+ <Separator className="absolute inset-0 top-1/2" />
174
+ {children && (
175
+ <span
176
+ className="relative mx-auto block w-fit bg-background px-2 text-muted-foreground"
177
+ data-slot="field-separator-content"
178
+ >
179
+ {children}
180
+ </span>
181
+ )}
182
+ </div>
183
+ )
184
+ }
185
+
186
+ function FieldError({
187
+ className,
188
+ children,
189
+ errors,
190
+ ...props
191
+ }: React.ComponentProps<"div"> & {
192
+ errors?: Array<{ message?: string } | undefined>
193
+ }) {
194
+ const content = useMemo(() => {
195
+ if (children) {
196
+ return children
197
+ }
198
+
199
+ if (!errors?.length) {
200
+ return null
201
+ }
202
+
203
+ const uniqueErrors = [
204
+ ...new Map(errors.map((error) => [error?.message, error])).values(),
205
+ ]
206
+
207
+ if (uniqueErrors?.length == 1) {
208
+ return uniqueErrors[0]?.message
209
+ }
210
+
211
+ return (
212
+ <ul className="ml-4 flex list-disc flex-col gap-1">
213
+ {uniqueErrors.map(
214
+ (error, index) =>
215
+ error?.message && <li key={index}>{error.message}</li>
216
+ )}
217
+ </ul>
218
+ )
219
+ }, [children, errors])
220
+
221
+ if (!content) {
222
+ return null
223
+ }
224
+
225
+ return (
226
+ <div
227
+ role="alert"
228
+ data-slot="field-error"
229
+ className={cn("text-sm font-normal text-destructive", className)}
230
+ {...props}
231
+ >
232
+ {content}
233
+ </div>
234
+ )
235
+ }
236
+
237
+ export {
238
+ Field,
239
+ FieldLabel,
240
+ FieldDescription,
241
+ FieldError,
242
+ FieldGroup,
243
+ FieldLegend,
244
+ FieldSeparator,
245
+ FieldSet,
246
+ FieldContent,
247
+ FieldTitle,
248
+ }