@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,170 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cva, type VariantProps } from "class-variance-authority"
5
+ import { cn } from "../lib/utils.js"
6
+
7
+ import { Button } from "./button.js"
8
+ import { Input } from "./input.js"
9
+ import { Textarea } from "./textarea.js"
10
+
11
+ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
12
+ return (
13
+ <div
14
+ data-slot="input-group"
15
+ role="group"
16
+ className={cn(
17
+ "group/input-group relative flex w-full items-center rounded-md border border-input bg-field transition-[color,box-shadow] outline-none",
18
+ "h-7 min-w-0 has-[>textarea]:h-auto",
19
+
20
+ // Variants based on alignment.
21
+ "has-[>[data-align=inline-start]]:[&>input]:pl-2",
22
+ "has-[>[data-align=inline-end]]:[&>input]:pr-2",
23
+ "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
24
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
25
+
26
+ // Focus state.
27
+ "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-2 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",
28
+
29
+ // Error state.
30
+ "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
31
+
32
+ className
33
+ )}
34
+ {...props}
35
+ />
36
+ )
37
+ }
38
+
39
+ const inputGroupAddonVariants = cva(
40
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-xs [&>svg:not([class*='size-'])]:size-4",
41
+ {
42
+ variants: {
43
+ align: {
44
+ "inline-start":
45
+ "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
46
+ "inline-end":
47
+ "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
48
+ "block-start":
49
+ "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
50
+ "block-end":
51
+ "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
52
+ },
53
+ },
54
+ defaultVariants: {
55
+ align: "inline-start",
56
+ },
57
+ }
58
+ )
59
+
60
+ function InputGroupAddon({
61
+ className,
62
+ align = "inline-start",
63
+ ...props
64
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
65
+ return (
66
+ <div
67
+ role="group"
68
+ data-slot="input-group-addon"
69
+ data-align={align}
70
+ className={cn(inputGroupAddonVariants({ align }), className)}
71
+ onClick={(e) => {
72
+ if ((e.target as HTMLElement).closest("button")) {
73
+ return
74
+ }
75
+ e.currentTarget.parentElement?.querySelector("input")?.focus()
76
+ }}
77
+ {...props}
78
+ />
79
+ )
80
+ }
81
+
82
+ const inputGroupButtonVariants = cva(
83
+ "flex items-center gap-2 text-sm shadow-none",
84
+ {
85
+ variants: {
86
+ size: {
87
+ xs: "h-6 gap-1 rounded-sm px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
88
+ sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
89
+ "icon-xs":
90
+ "size-6 rounded-sm p-0 has-[>svg]:p-0",
91
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
92
+ },
93
+ },
94
+ defaultVariants: {
95
+ size: "xs",
96
+ },
97
+ }
98
+ )
99
+
100
+ function InputGroupButton({
101
+ className,
102
+ type = "button",
103
+ variant = "ghost",
104
+ size = "xs",
105
+ ...props
106
+ }: Omit<React.ComponentProps<typeof Button>, "size"> &
107
+ VariantProps<typeof inputGroupButtonVariants>) {
108
+ return (
109
+ <Button
110
+ type={type}
111
+ data-size={size}
112
+ variant={variant}
113
+ className={cn(inputGroupButtonVariants({ size }), className)}
114
+ {...props}
115
+ />
116
+ )
117
+ }
118
+
119
+ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
120
+ return (
121
+ <span
122
+ className={cn(
123
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
124
+ className
125
+ )}
126
+ {...props}
127
+ />
128
+ )
129
+ }
130
+
131
+ function InputGroupInput({
132
+ className,
133
+ ...props
134
+ }: React.ComponentProps<"input">) {
135
+ return (
136
+ <Input
137
+ data-slot="input-group-control"
138
+ className={cn(
139
+ "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
140
+ className
141
+ )}
142
+ {...props}
143
+ />
144
+ )
145
+ }
146
+
147
+ function InputGroupTextarea({
148
+ className,
149
+ ...props
150
+ }: React.ComponentProps<"textarea">) {
151
+ return (
152
+ <Textarea
153
+ data-slot="input-group-control"
154
+ className={cn(
155
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
156
+ className
157
+ )}
158
+ {...props}
159
+ />
160
+ )
161
+ }
162
+
163
+ export {
164
+ InputGroup,
165
+ InputGroupAddon,
166
+ InputGroupButton,
167
+ InputGroupText,
168
+ InputGroupInput,
169
+ InputGroupTextarea,
170
+ }
@@ -0,0 +1,20 @@
1
+ import * as React from "react"
2
+ import { cn } from "../lib/utils.js"
3
+
4
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
5
+ return (
6
+ <input
7
+ type={type}
8
+ data-slot="input"
9
+ className={cn(
10
+ "h-7 w-full min-w-0 rounded-md border border-input bg-field px-2.5 py-1 text-base transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
11
+ "focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring",
12
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
13
+ className
14
+ )}
15
+ {...props}
16
+ />
17
+ )
18
+ }
19
+
20
+ export { Input }
@@ -0,0 +1,193 @@
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
+ import { Separator } from "./separator.js"
7
+
8
+ function ItemGroup({ className, ...props }: React.ComponentProps<"div">) {
9
+ return (
10
+ <div
11
+ role="list"
12
+ data-slot="item-group"
13
+ className={cn("group/item-group flex flex-col", className)}
14
+ {...props}
15
+ />
16
+ )
17
+ }
18
+
19
+ function ItemSeparator({
20
+ className,
21
+ ...props
22
+ }: React.ComponentProps<typeof Separator>) {
23
+ return (
24
+ <Separator
25
+ data-slot="item-separator"
26
+ orientation="horizontal"
27
+ className={cn("my-0", className)}
28
+ {...props}
29
+ />
30
+ )
31
+ }
32
+
33
+ const itemVariants = cva(
34
+ "group/item flex flex-wrap items-center rounded-md border border-transparent text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring [a]:transition-colors [a]:hover:bg-accent/50",
35
+ {
36
+ variants: {
37
+ variant: {
38
+ default: "bg-transparent",
39
+ outline: "border-border",
40
+ muted: "bg-muted/50",
41
+ },
42
+ size: {
43
+ default: "gap-4 p-4",
44
+ sm: "gap-2.5 px-4 py-3",
45
+ },
46
+ },
47
+ defaultVariants: {
48
+ variant: "default",
49
+ size: "default",
50
+ },
51
+ }
52
+ )
53
+
54
+ function Item({
55
+ className,
56
+ variant = "default",
57
+ size = "default",
58
+ asChild = false,
59
+ ...props
60
+ }: React.ComponentProps<"div"> &
61
+ VariantProps<typeof itemVariants> & { asChild?: boolean }) {
62
+ const Comp = asChild ? Slot.Root : "div"
63
+ return (
64
+ <Comp
65
+ data-slot="item"
66
+ data-variant={variant}
67
+ data-size={size}
68
+ className={cn(itemVariants({ variant, size, className }))}
69
+ {...props}
70
+ />
71
+ )
72
+ }
73
+
74
+ const itemMediaVariants = cva(
75
+ "flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:translate-y-0.5 group-has-[[data-slot=item-description]]/item:self-start [&_svg]:pointer-events-none",
76
+ {
77
+ variants: {
78
+ variant: {
79
+ default: "bg-transparent",
80
+ icon: "size-8 rounded-sm border bg-muted [&_svg:not([class*='size-'])]:size-4",
81
+ image:
82
+ "size-10 overflow-hidden rounded-sm [&_img]:size-full [&_img]:object-cover",
83
+ },
84
+ },
85
+ defaultVariants: {
86
+ variant: "default",
87
+ },
88
+ }
89
+ )
90
+
91
+ function ItemMedia({
92
+ className,
93
+ variant = "default",
94
+ ...props
95
+ }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>) {
96
+ return (
97
+ <div
98
+ data-slot="item-media"
99
+ data-variant={variant}
100
+ className={cn(itemMediaVariants({ variant, className }))}
101
+ {...props}
102
+ />
103
+ )
104
+ }
105
+
106
+ function ItemContent({ className, ...props }: React.ComponentProps<"div">) {
107
+ return (
108
+ <div
109
+ data-slot="item-content"
110
+ className={cn(
111
+ "flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none",
112
+ className
113
+ )}
114
+ {...props}
115
+ />
116
+ )
117
+ }
118
+
119
+ function ItemTitle({ className, ...props }: React.ComponentProps<"div">) {
120
+ return (
121
+ <div
122
+ data-slot="item-title"
123
+ className={cn(
124
+ "flex w-fit items-center gap-2 text-sm leading-snug font-medium",
125
+ className
126
+ )}
127
+ {...props}
128
+ />
129
+ )
130
+ }
131
+
132
+ function ItemDescription({ className, ...props }: React.ComponentProps<"p">) {
133
+ return (
134
+ <p
135
+ data-slot="item-description"
136
+ className={cn(
137
+ "line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground",
138
+ "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary",
139
+ className
140
+ )}
141
+ {...props}
142
+ />
143
+ )
144
+ }
145
+
146
+ function ItemActions({ className, ...props }: React.ComponentProps<"div">) {
147
+ return (
148
+ <div
149
+ data-slot="item-actions"
150
+ className={cn("flex items-center gap-2", className)}
151
+ {...props}
152
+ />
153
+ )
154
+ }
155
+
156
+ function ItemHeader({ className, ...props }: React.ComponentProps<"div">) {
157
+ return (
158
+ <div
159
+ data-slot="item-header"
160
+ className={cn(
161
+ "flex basis-full items-center justify-between gap-2",
162
+ className
163
+ )}
164
+ {...props}
165
+ />
166
+ )
167
+ }
168
+
169
+ function ItemFooter({ className, ...props }: React.ComponentProps<"div">) {
170
+ return (
171
+ <div
172
+ data-slot="item-footer"
173
+ className={cn(
174
+ "flex basis-full items-center justify-between gap-2",
175
+ className
176
+ )}
177
+ {...props}
178
+ />
179
+ )
180
+ }
181
+
182
+ export {
183
+ Item,
184
+ ItemMedia,
185
+ ItemContent,
186
+ ItemActions,
187
+ ItemGroup,
188
+ ItemSeparator,
189
+ ItemTitle,
190
+ ItemDescription,
191
+ ItemHeader,
192
+ ItemFooter,
193
+ }
package/src/ui/kbd.tsx ADDED
@@ -0,0 +1,28 @@
1
+ import { cn } from "../lib/utils.js"
2
+
3
+ function Kbd({ className, ...props }: React.ComponentProps<"kbd">) {
4
+ return (
5
+ <kbd
6
+ data-slot="kbd"
7
+ className={cn(
8
+ "pointer-events-none inline-flex h-5 w-fit min-w-5 items-center justify-center gap-1 rounded-sm bg-muted px-1 font-sans text-xs font-medium text-muted-foreground select-none",
9
+ "[&_svg:not([class*='size-'])]:size-3",
10
+ "[[data-slot=tooltip-content]_&]:bg-background/20 [[data-slot=tooltip-content]_&]:text-background dark:[[data-slot=tooltip-content]_&]:bg-background/10",
11
+ className
12
+ )}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+
18
+ function KbdGroup({ className, ...props }: React.ComponentProps<"div">) {
19
+ return (
20
+ <kbd
21
+ data-slot="kbd-group"
22
+ className={cn("inline-flex items-center gap-1", className)}
23
+ {...props}
24
+ />
25
+ )
26
+ }
27
+
28
+ export { Kbd, KbdGroup }
@@ -0,0 +1,23 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../lib/utils.js"
5
+ import { Label as LabelPrimitive } from "radix-ui"
6
+
7
+ function Label({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof LabelPrimitive.Root>) {
11
+ return (
12
+ <LabelPrimitive.Root
13
+ data-slot="label"
14
+ className={cn(
15
+ "flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ export { Label }
@@ -0,0 +1,88 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../lib/utils.js"
5
+ import { Popover as PopoverPrimitive } from "radix-ui"
6
+
7
+ function Popover({
8
+ ...props
9
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
10
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
11
+ }
12
+
13
+ function PopoverTrigger({
14
+ ...props
15
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
16
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
17
+ }
18
+
19
+ function PopoverContent({
20
+ className,
21
+ align = "center",
22
+ sideOffset = 4,
23
+ ...props
24
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
25
+ return (
26
+ <PopoverPrimitive.Portal>
27
+ <PopoverPrimitive.Content
28
+ data-slot="popover-content"
29
+ align={align}
30
+ sideOffset={sideOffset}
31
+ className={cn(
32
+ "z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-xl bg-popover p-4 text-popover-foreground shadow-menu outline-hidden 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",
33
+ className
34
+ )}
35
+ {...props}
36
+ />
37
+ </PopoverPrimitive.Portal>
38
+ )
39
+ }
40
+
41
+ function PopoverAnchor({
42
+ ...props
43
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
44
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
45
+ }
46
+
47
+ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
48
+ return (
49
+ <div
50
+ data-slot="popover-header"
51
+ className={cn("flex flex-col gap-1 text-sm", className)}
52
+ {...props}
53
+ />
54
+ )
55
+ }
56
+
57
+ function PopoverTitle({ className, ...props }: React.ComponentProps<"h2">) {
58
+ return (
59
+ <div
60
+ data-slot="popover-title"
61
+ className={cn("font-medium", className)}
62
+ {...props}
63
+ />
64
+ )
65
+ }
66
+
67
+ function PopoverDescription({
68
+ className,
69
+ ...props
70
+ }: React.ComponentProps<"p">) {
71
+ return (
72
+ <p
73
+ data-slot="popover-description"
74
+ className={cn("text-muted-foreground", className)}
75
+ {...props}
76
+ />
77
+ )
78
+ }
79
+
80
+ export {
81
+ Popover,
82
+ PopoverTrigger,
83
+ PopoverContent,
84
+ PopoverAnchor,
85
+ PopoverHeader,
86
+ PopoverTitle,
87
+ PopoverDescription,
88
+ }
@@ -0,0 +1,30 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../lib/utils.js"
5
+ import { Progress as ProgressPrimitive } from "radix-ui"
6
+
7
+ function Progress({
8
+ className,
9
+ value,
10
+ ...props
11
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
12
+ return (
13
+ <ProgressPrimitive.Root
14
+ data-slot="progress"
15
+ className={cn(
16
+ "relative h-1.5 w-full overflow-hidden rounded-full bg-primary/20",
17
+ className
18
+ )}
19
+ {...props}
20
+ >
21
+ <ProgressPrimitive.Indicator
22
+ data-slot="progress-indicator"
23
+ className="h-full w-full flex-1 bg-primary transition-all"
24
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
25
+ />
26
+ </ProgressPrimitive.Root>
27
+ )
28
+ }
29
+
30
+ export { Progress }
@@ -0,0 +1,57 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "../lib/utils.js"
5
+ import { ScrollArea as ScrollAreaPrimitive } from "radix-ui"
6
+
7
+ function ScrollArea({
8
+ className,
9
+ children,
10
+ ...props
11
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
12
+ return (
13
+ <ScrollAreaPrimitive.Root
14
+ data-slot="scroll-area"
15
+ className={cn("relative", className)}
16
+ {...props}
17
+ >
18
+ <ScrollAreaPrimitive.Viewport
19
+ data-slot="scroll-area-viewport"
20
+ className="size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-1"
21
+ >
22
+ {children}
23
+ </ScrollAreaPrimitive.Viewport>
24
+ <ScrollBar />
25
+ <ScrollAreaPrimitive.Corner />
26
+ </ScrollAreaPrimitive.Root>
27
+ )
28
+ }
29
+
30
+ function ScrollBar({
31
+ className,
32
+ orientation = "vertical",
33
+ ...props
34
+ }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
35
+ return (
36
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
37
+ data-slot="scroll-area-scrollbar"
38
+ orientation={orientation}
39
+ className={cn(
40
+ "flex touch-none p-px transition-colors select-none",
41
+ orientation === "vertical" &&
42
+ "h-full w-2.5 border-l border-l-transparent",
43
+ orientation === "horizontal" &&
44
+ "h-2.5 flex-col border-t border-t-transparent",
45
+ className
46
+ )}
47
+ {...props}
48
+ >
49
+ <ScrollAreaPrimitive.ScrollAreaThumb
50
+ data-slot="scroll-area-thumb"
51
+ className="relative flex-1 rounded-full bg-border"
52
+ />
53
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
54
+ )
55
+ }
56
+
57
+ export { ScrollArea, ScrollBar }