@softure-ai/theme-notion 0.0.0-stage → 0.1.1

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 +21 -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,62 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { cn } from "../lib/utils.js"
4
+ import { Slot } from "radix-ui"
5
+
6
+ const buttonVariants = cva(
7
+ "inline-flex shrink-0 items-center justify-center gap-1.5 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground hover:bg-primary-hover",
12
+ destructive:
13
+ "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
14
+ outline:
15
+ "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
16
+ secondary: "bg-secondary text-secondary-foreground hover:bg-accent-strong",
17
+ ghost: "text-muted-foreground hover:bg-accent hover:text-foreground",
18
+ link: "text-primary underline-offset-4 hover:underline",
19
+ },
20
+ size: {
21
+ default:
22
+ "h-7 px-2.5 has-[>svg:first-child]:pl-2 has-[>svg:last-child]:pr-2",
23
+ xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
24
+ sm: "h-6 gap-1 rounded-md px-2 text-[13px] has-[>svg:first-child]:pl-1.5 has-[>svg:last-child]:pr-1.5",
25
+ lg: "h-8 rounded-md px-3 has-[>svg:first-child]:pl-2.5 has-[>svg:last-child]:pr-2.5",
26
+ icon: "size-7",
27
+ "icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
28
+ "icon-sm": "size-6",
29
+ "icon-lg": "size-8",
30
+ },
31
+ },
32
+ defaultVariants: {
33
+ variant: "default",
34
+ size: "default",
35
+ },
36
+ }
37
+ )
38
+
39
+ function Button({
40
+ className,
41
+ variant = "default",
42
+ size = "default",
43
+ asChild = false,
44
+ ...props
45
+ }: React.ComponentProps<"button"> &
46
+ VariantProps<typeof buttonVariants> & {
47
+ asChild?: boolean
48
+ }) {
49
+ const Comp = asChild ? Slot.Root : "button"
50
+
51
+ return (
52
+ <Comp
53
+ data-slot="button"
54
+ data-variant={variant}
55
+ data-size={size}
56
+ className={cn(buttonVariants({ variant, size, className }))}
57
+ {...props}
58
+ />
59
+ )
60
+ }
61
+
62
+ export { Button, buttonVariants }
@@ -0,0 +1,91 @@
1
+ import * as React from "react"
2
+ import { cn } from "../lib/utils.js"
3
+
4
+ function Card({ className, ...props }: React.ComponentProps<"div">) {
5
+ return (
6
+ <div
7
+ data-slot="card"
8
+ className={cn(
9
+ "flex flex-col gap-6 rounded-lg bg-card py-6 text-card-foreground shadow-card",
10
+ className
11
+ )}
12
+ {...props}
13
+ />
14
+ )
15
+ }
16
+
17
+ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
18
+ return (
19
+ <div
20
+ data-slot="card-header"
21
+ className={cn(
22
+ "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+
30
+ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
31
+ return (
32
+ <div
33
+ data-slot="card-title"
34
+ className={cn("leading-none font-semibold", className)}
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
41
+ return (
42
+ <div
43
+ data-slot="card-description"
44
+ className={cn("text-sm text-muted-foreground", className)}
45
+ {...props}
46
+ />
47
+ )
48
+ }
49
+
50
+ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
51
+ return (
52
+ <div
53
+ data-slot="card-action"
54
+ className={cn(
55
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
56
+ className
57
+ )}
58
+ {...props}
59
+ />
60
+ )
61
+ }
62
+
63
+ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
64
+ return (
65
+ <div
66
+ data-slot="card-content"
67
+ className={cn("px-6", className)}
68
+ {...props}
69
+ />
70
+ )
71
+ }
72
+
73
+ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
74
+ return (
75
+ <div
76
+ data-slot="card-footer"
77
+ className={cn("flex items-center px-6 [.border-t]:pt-6", className)}
78
+ {...props}
79
+ />
80
+ )
81
+ }
82
+
83
+ export {
84
+ Card,
85
+ CardHeader,
86
+ CardFooter,
87
+ CardTitle,
88
+ CardAction,
89
+ CardDescription,
90
+ CardContent,
91
+ }
@@ -0,0 +1,31 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../lib/utils.js"
5
+ import { CheckIcon } from "lucide-react"
6
+ import { Checkbox as CheckboxPrimitive } from "radix-ui"
7
+
8
+ function Checkbox({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
12
+ return (
13
+ <CheckboxPrimitive.Root
14
+ data-slot="checkbox"
15
+ className={cn(
16
+ "peer size-4 shrink-0 rounded-xs border-[1.5px] border-muted-foreground transition-shadow outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary",
17
+ className
18
+ )}
19
+ {...props}
20
+ >
21
+ <CheckboxPrimitive.Indicator
22
+ data-slot="checkbox-indicator"
23
+ className="grid place-content-center text-current transition-none"
24
+ >
25
+ <CheckIcon className="grid place-content-center text-current transition-none" />
26
+ </CheckboxPrimitive.Indicator>
27
+ </CheckboxPrimitive.Root>
28
+ )
29
+ }
30
+
31
+ export { Checkbox }
@@ -0,0 +1,33 @@
1
+ "use client"
2
+
3
+ import { Collapsible as CollapsiblePrimitive } from "radix-ui"
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 }
@@ -0,0 +1,185 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { Command as CommandPrimitive } from "cmdk"
5
+ import { en as messages } from "../messages/en.js"
6
+ import { cn } from "../lib/utils.js"
7
+ import { SearchIcon } from "lucide-react"
8
+
9
+ import {
10
+ Dialog,
11
+ DialogContent,
12
+ DialogDescription,
13
+ DialogHeader,
14
+ DialogTitle,
15
+ } from "./dialog.js"
16
+
17
+ function Command({
18
+ className,
19
+ ...props
20
+ }: React.ComponentProps<typeof CommandPrimitive>) {
21
+ return (
22
+ <CommandPrimitive
23
+ data-slot="command"
24
+ className={cn(
25
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
26
+ className
27
+ )}
28
+ {...props}
29
+ />
30
+ )
31
+ }
32
+
33
+ function CommandDialog({
34
+ title = messages.command.title,
35
+ description = messages.command.description,
36
+ children,
37
+ className,
38
+ showCloseButton = true,
39
+ ...props
40
+ }: React.ComponentProps<typeof Dialog> & {
41
+ title?: string
42
+ description?: string
43
+ className?: string
44
+ showCloseButton?: boolean
45
+ }) {
46
+ return (
47
+ <Dialog {...props}>
48
+ <DialogHeader className="sr-only">
49
+ <DialogTitle>{title}</DialogTitle>
50
+ <DialogDescription>{description}</DialogDescription>
51
+ </DialogHeader>
52
+ <DialogContent
53
+ className={cn("overflow-hidden p-0", className)}
54
+ showCloseButton={showCloseButton}
55
+ >
56
+ <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[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">
57
+ {children}
58
+ </Command>
59
+ </DialogContent>
60
+ </Dialog>
61
+ )
62
+ }
63
+
64
+ function CommandInput({
65
+ className,
66
+ ...props
67
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
68
+ return (
69
+ <div
70
+ data-slot="command-input-wrapper"
71
+ className="flex h-9 items-center gap-2 border-b px-3"
72
+ >
73
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
74
+ <CommandPrimitive.Input
75
+ data-slot="command-input"
76
+ className={cn(
77
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
78
+ className
79
+ )}
80
+ {...props}
81
+ />
82
+ </div>
83
+ )
84
+ }
85
+
86
+ function CommandList({
87
+ className,
88
+ ...props
89
+ }: React.ComponentProps<typeof CommandPrimitive.List>) {
90
+ return (
91
+ <CommandPrimitive.List
92
+ data-slot="command-list"
93
+ className={cn(
94
+ "max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",
95
+ className
96
+ )}
97
+ {...props}
98
+ />
99
+ )
100
+ }
101
+
102
+ function CommandEmpty({
103
+ ...props
104
+ }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
105
+ return (
106
+ <CommandPrimitive.Empty
107
+ data-slot="command-empty"
108
+ className="py-6 text-center text-sm"
109
+ {...props}
110
+ />
111
+ )
112
+ }
113
+
114
+ function CommandGroup({
115
+ className,
116
+ ...props
117
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
118
+ return (
119
+ <CommandPrimitive.Group
120
+ data-slot="command-group"
121
+ className={cn(
122
+ "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",
123
+ className
124
+ )}
125
+ {...props}
126
+ />
127
+ )
128
+ }
129
+
130
+ function CommandSeparator({
131
+ className,
132
+ ...props
133
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
134
+ return (
135
+ <CommandPrimitive.Separator
136
+ data-slot="command-separator"
137
+ className={cn("-mx-1 h-px bg-border", className)}
138
+ {...props}
139
+ />
140
+ )
141
+ }
142
+
143
+ function CommandItem({
144
+ className,
145
+ ...props
146
+ }: React.ComponentProps<typeof CommandPrimitive.Item>) {
147
+ return (
148
+ <CommandPrimitive.Item
149
+ data-slot="command-item"
150
+ className={cn(
151
+ "relative flex cursor-default items-center gap-2 rounded-md min-h-7 px-2 py-1 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
152
+ className
153
+ )}
154
+ {...props}
155
+ />
156
+ )
157
+ }
158
+
159
+ function CommandShortcut({
160
+ className,
161
+ ...props
162
+ }: React.ComponentProps<"span">) {
163
+ return (
164
+ <span
165
+ data-slot="command-shortcut"
166
+ className={cn(
167
+ "ml-auto text-xs tracking-widest text-muted-foreground",
168
+ className
169
+ )}
170
+ {...props}
171
+ />
172
+ )
173
+ }
174
+
175
+ export {
176
+ Command,
177
+ CommandDialog,
178
+ CommandInput,
179
+ CommandList,
180
+ CommandEmpty,
181
+ CommandGroup,
182
+ CommandItem,
183
+ CommandShortcut,
184
+ CommandSeparator,
185
+ }
@@ -0,0 +1,162 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { en as messages } from "../messages/en.js"
5
+ import { cn } from "../lib/utils.js"
6
+ import { XIcon } from "lucide-react"
7
+ import { Dialog as DialogPrimitive } from "radix-ui"
8
+
9
+ import { Button } from "./button.js"
10
+
11
+ function Dialog({
12
+ ...props
13
+ }: React.ComponentProps<typeof DialogPrimitive.Root>) {
14
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />
15
+ }
16
+
17
+ function DialogTrigger({
18
+ ...props
19
+ }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
20
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />
21
+ }
22
+
23
+ function DialogPortal({
24
+ ...props
25
+ }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
26
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />
27
+ }
28
+
29
+ function DialogClose({
30
+ ...props
31
+ }: React.ComponentProps<typeof DialogPrimitive.Close>) {
32
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />
33
+ }
34
+
35
+ function DialogOverlay({
36
+ className,
37
+ ...props
38
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
39
+ return (
40
+ <DialogPrimitive.Overlay
41
+ data-slot="dialog-overlay"
42
+ className={cn(
43
+ "fixed inset-0 z-50 bg-overlay data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
44
+ className
45
+ )}
46
+ {...props}
47
+ />
48
+ )
49
+ }
50
+
51
+ function DialogContent({
52
+ className,
53
+ children,
54
+ showCloseButton = true,
55
+ closeLabel = messages.dialog.close,
56
+ ...props
57
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
58
+ showCloseButton?: boolean
59
+ // The close button's hidden text, from the app's message layer.
60
+ closeLabel?: string
61
+ }) {
62
+ return (
63
+ <DialogPortal data-slot="dialog-portal">
64
+ <DialogOverlay />
65
+ <DialogPrimitive.Content
66
+ data-slot="dialog-content"
67
+ className={cn(
68
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-xl bg-background p-6 shadow-dialog duration-200 outline-none 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 sm:max-w-lg",
69
+ className
70
+ )}
71
+ {...props}
72
+ >
73
+ {children}
74
+ {showCloseButton && (
75
+ <DialogPrimitive.Close
76
+ data-slot="dialog-close"
77
+ className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
78
+ >
79
+ <XIcon />
80
+ <span className="sr-only">{closeLabel}</span>
81
+ </DialogPrimitive.Close>
82
+ )}
83
+ </DialogPrimitive.Content>
84
+ </DialogPortal>
85
+ )
86
+ }
87
+
88
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
89
+ return (
90
+ <div
91
+ data-slot="dialog-header"
92
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
93
+ {...props}
94
+ />
95
+ )
96
+ }
97
+
98
+ function DialogFooter({
99
+ className,
100
+ showCloseButton = false,
101
+ children,
102
+ ...props
103
+ }: React.ComponentProps<"div"> & {
104
+ showCloseButton?: boolean
105
+ }) {
106
+ return (
107
+ <div
108
+ data-slot="dialog-footer"
109
+ className={cn(
110
+ "flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",
111
+ className
112
+ )}
113
+ {...props}
114
+ >
115
+ {children}
116
+ {showCloseButton && (
117
+ <DialogPrimitive.Close asChild>
118
+ <Button variant="outline">Close</Button>
119
+ </DialogPrimitive.Close>
120
+ )}
121
+ </div>
122
+ )
123
+ }
124
+
125
+ function DialogTitle({
126
+ className,
127
+ ...props
128
+ }: React.ComponentProps<typeof DialogPrimitive.Title>) {
129
+ return (
130
+ <DialogPrimitive.Title
131
+ data-slot="dialog-title"
132
+ className={cn("text-lg leading-none font-semibold", className)}
133
+ {...props}
134
+ />
135
+ )
136
+ }
137
+
138
+ function DialogDescription({
139
+ className,
140
+ ...props
141
+ }: React.ComponentProps<typeof DialogPrimitive.Description>) {
142
+ return (
143
+ <DialogPrimitive.Description
144
+ data-slot="dialog-description"
145
+ className={cn("text-sm text-muted-foreground", className)}
146
+ {...props}
147
+ />
148
+ )
149
+ }
150
+
151
+ export {
152
+ Dialog,
153
+ DialogClose,
154
+ DialogContent,
155
+ DialogDescription,
156
+ DialogFooter,
157
+ DialogHeader,
158
+ DialogOverlay,
159
+ DialogPortal,
160
+ DialogTitle,
161
+ DialogTrigger,
162
+ }