@mostra/kit 0.0.0-placeholder → 0.19.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 (298) hide show
  1. package/README.md +42 -1
  2. package/css/kit.css +59 -0
  3. package/css/shadcn.css +638 -0
  4. package/dist/index.d.ts +16 -0
  5. package/dist/index.d.ts.map +1 -0
  6. package/dist/index.js +18 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/layout.d.ts +60 -0
  9. package/dist/layout.d.ts.map +1 -0
  10. package/dist/layout.js +112 -0
  11. package/dist/layout.js.map +1 -0
  12. package/dist/questionnaire.d.ts +100 -0
  13. package/dist/questionnaire.d.ts.map +1 -0
  14. package/dist/questionnaire.js +632 -0
  15. package/dist/questionnaire.js.map +1 -0
  16. package/package.json +120 -4
  17. package/registry/LICENSE.md +21 -0
  18. package/registry/base/accordion.json +19 -0
  19. package/registry/base/alert-dialog.json +21 -0
  20. package/registry/base/alert.json +18 -0
  21. package/registry/base/aspect-ratio.json +17 -0
  22. package/registry/base/attachment.json +22 -0
  23. package/registry/base/avatar.json +18 -0
  24. package/registry/base/badge.json +19 -0
  25. package/registry/base/breadcrumb.json +19 -0
  26. package/registry/base/bubble.json +19 -0
  27. package/registry/base/button-group.json +22 -0
  28. package/registry/base/button.json +19 -0
  29. package/registry/base/calendar.json +22 -0
  30. package/registry/base/card.json +17 -0
  31. package/registry/base/carousel.json +22 -0
  32. package/registry/base/chart.json +21 -0
  33. package/registry/base/checkbox.json +19 -0
  34. package/registry/base/code-block.json +23 -0
  35. package/registry/base/collapsible.json +17 -0
  36. package/registry/base/combobox.json +23 -0
  37. package/registry/base/command.json +23 -0
  38. package/registry/base/components/mostra/layout.tsx +221 -0
  39. package/registry/base/components/mostra/questionnaire.tsx +1005 -0
  40. package/registry/base/components/ui/accordion.tsx +71 -0
  41. package/registry/base/components/ui/alert-dialog.tsx +187 -0
  42. package/registry/base/components/ui/alert.tsx +75 -0
  43. package/registry/base/components/ui/aspect-ratio.tsx +22 -0
  44. package/registry/base/components/ui/attachment.tsx +207 -0
  45. package/registry/base/components/ui/avatar.tsx +108 -0
  46. package/registry/base/components/ui/badge.tsx +54 -0
  47. package/registry/base/components/ui/breadcrumb.tsx +124 -0
  48. package/registry/base/components/ui/bubble.tsx +127 -0
  49. package/registry/base/components/ui/button-group.tsx +87 -0
  50. package/registry/base/components/ui/button.tsx +57 -0
  51. package/registry/base/components/ui/calendar.tsx +221 -0
  52. package/registry/base/components/ui/card.tsx +102 -0
  53. package/registry/base/components/ui/carousel.tsx +242 -0
  54. package/registry/base/components/ui/chart.tsx +372 -0
  55. package/registry/base/components/ui/checkbox.tsx +28 -0
  56. package/registry/base/components/ui/code-block.tsx +249 -0
  57. package/registry/base/components/ui/collapsible.tsx +21 -0
  58. package/registry/base/components/ui/combobox.tsx +297 -0
  59. package/registry/base/components/ui/command.tsx +196 -0
  60. package/registry/base/components/ui/context-menu.tsx +270 -0
  61. package/registry/base/components/ui/dialog.tsx +160 -0
  62. package/registry/base/components/ui/direction.tsx +6 -0
  63. package/registry/base/components/ui/drawer.tsx +227 -0
  64. package/registry/base/components/ui/dropdown-menu.tsx +267 -0
  65. package/registry/base/components/ui/empty.tsx +103 -0
  66. package/registry/base/components/ui/field.tsx +238 -0
  67. package/registry/base/components/ui/hover-card.tsx +50 -0
  68. package/registry/base/components/ui/input-group.tsx +158 -0
  69. package/registry/base/components/ui/input-otp.tsx +86 -0
  70. package/registry/base/components/ui/input.tsx +19 -0
  71. package/registry/base/components/ui/item.tsx +201 -0
  72. package/registry/base/components/ui/kbd.tsx +26 -0
  73. package/registry/base/components/ui/label.tsx +19 -0
  74. package/registry/base/components/ui/marker.tsx +70 -0
  75. package/registry/base/components/ui/menubar.tsx +280 -0
  76. package/registry/base/components/ui/message-scroller.tsx +131 -0
  77. package/registry/base/components/ui/message.tsx +91 -0
  78. package/registry/base/components/ui/native-select.tsx +60 -0
  79. package/registry/base/components/ui/navigation-menu.tsx +167 -0
  80. package/registry/base/components/ui/pagination.tsx +130 -0
  81. package/registry/base/components/ui/popover.tsx +89 -0
  82. package/registry/base/components/ui/progress.tsx +82 -0
  83. package/registry/base/components/ui/questionnaire.tsx +324 -0
  84. package/registry/base/components/ui/radio-group.tsx +37 -0
  85. package/registry/base/components/ui/resizable.tsx +49 -0
  86. package/registry/base/components/ui/scroll-area.tsx +53 -0
  87. package/registry/base/components/ui/select.tsx +200 -0
  88. package/registry/base/components/ui/separator.tsx +24 -0
  89. package/registry/base/components/ui/sheet.tsx +138 -0
  90. package/registry/base/components/ui/sidebar.tsx +723 -0
  91. package/registry/base/components/ui/skeleton.tsx +13 -0
  92. package/registry/base/components/ui/slider.tsx +51 -0
  93. package/registry/base/components/ui/sonner.tsx +65 -0
  94. package/registry/base/components/ui/spinner.tsx +10 -0
  95. package/registry/base/components/ui/switch.tsx +31 -0
  96. package/registry/base/components/ui/table.tsx +116 -0
  97. package/registry/base/components/ui/tabs.tsx +85 -0
  98. package/registry/base/components/ui/textarea.tsx +17 -0
  99. package/registry/base/components/ui/toast.tsx +234 -0
  100. package/registry/base/components/ui/toggle-group.tsx +89 -0
  101. package/registry/base/components/ui/toggle.tsx +44 -0
  102. package/registry/base/components/ui/tooltip.tsx +65 -0
  103. package/registry/base/components/ui/trace.tsx +162 -0
  104. package/registry/base/context-menu.json +19 -0
  105. package/registry/base/dialog.json +22 -0
  106. package/registry/base/direction.json +17 -0
  107. package/registry/base/drawer.json +18 -0
  108. package/registry/base/dropdown-menu.json +19 -0
  109. package/registry/base/empty.json +18 -0
  110. package/registry/base/field.json +22 -0
  111. package/registry/base/hooks/use-highlighted-code.ts +75 -0
  112. package/registry/base/hooks/use-mobile.ts +19 -0
  113. package/registry/base/hover-card.json +18 -0
  114. package/registry/base/input-group.json +23 -0
  115. package/registry/base/input-otp.json +19 -0
  116. package/registry/base/input.json +18 -0
  117. package/registry/base/item.json +22 -0
  118. package/registry/base/kbd.json +17 -0
  119. package/registry/base/label.json +17 -0
  120. package/registry/base/lib/highlighter.tsx +124 -0
  121. package/registry/base/lib/utils.ts +1 -0
  122. package/registry/base/marker.json +19 -0
  123. package/registry/base/menubar.json +22 -0
  124. package/registry/base/message-scroller.json +22 -0
  125. package/registry/base/message.json +17 -0
  126. package/registry/base/mostra-layout.json +20 -0
  127. package/registry/base/mostra-questionnaire.json +22 -0
  128. package/registry/base/native-select.json +18 -0
  129. package/registry/base/navigation-menu.json +20 -0
  130. package/registry/base/pagination.json +21 -0
  131. package/registry/base/popover.json +18 -0
  132. package/registry/base/progress.json +18 -0
  133. package/registry/base/questionnaire.json +22 -0
  134. package/registry/base/radio-group.json +18 -0
  135. package/registry/base/registry.json +287 -0
  136. package/registry/base/resizable.json +18 -0
  137. package/registry/base/scroll-area.json +18 -0
  138. package/registry/base/select.json +19 -0
  139. package/registry/base/separator.json +18 -0
  140. package/registry/base/sheet.json +22 -0
  141. package/registry/base/sidebar.json +29 -0
  142. package/registry/base/skeleton.json +17 -0
  143. package/registry/base/slider.json +18 -0
  144. package/registry/base/sonner.json +18 -0
  145. package/registry/base/spinner.json +18 -0
  146. package/registry/base/switch.json +18 -0
  147. package/registry/base/table.json +17 -0
  148. package/registry/base/tabs.json +19 -0
  149. package/registry/base/textarea.json +17 -0
  150. package/registry/base/toast.json +22 -0
  151. package/registry/base/toggle-group.json +22 -0
  152. package/registry/base/toggle.json +19 -0
  153. package/registry/base/tooltip.json +18 -0
  154. package/registry/base/trace.json +21 -0
  155. package/registry/base/use-highlighted-code.json +21 -0
  156. package/registry/base/use-mobile.json +14 -0
  157. package/registry/base/utils.json +17 -0
  158. package/registry/radix/accordion.json +19 -0
  159. package/registry/radix/alert-dialog.json +21 -0
  160. package/registry/radix/alert.json +18 -0
  161. package/registry/radix/aspect-ratio.json +17 -0
  162. package/registry/radix/attachment.json +22 -0
  163. package/registry/radix/avatar.json +18 -0
  164. package/registry/radix/badge.json +19 -0
  165. package/registry/radix/breadcrumb.json +19 -0
  166. package/registry/radix/bubble.json +19 -0
  167. package/registry/radix/button-group.json +22 -0
  168. package/registry/radix/button.json +19 -0
  169. package/registry/radix/calendar.json +22 -0
  170. package/registry/radix/card.json +17 -0
  171. package/registry/radix/carousel.json +22 -0
  172. package/registry/radix/chart.json +18 -0
  173. package/registry/radix/checkbox.json +19 -0
  174. package/registry/radix/code-block.json +23 -0
  175. package/registry/radix/collapsible.json +17 -0
  176. package/registry/radix/combobox.json +23 -0
  177. package/registry/radix/command.json +23 -0
  178. package/registry/radix/components/mostra/layout.tsx +221 -0
  179. package/registry/radix/components/mostra/questionnaire.tsx +1005 -0
  180. package/registry/radix/components/ui/accordion.tsx +80 -0
  181. package/registry/radix/components/ui/alert-dialog.tsx +199 -0
  182. package/registry/radix/components/ui/alert.tsx +75 -0
  183. package/registry/radix/components/ui/aspect-ratio.tsx +11 -0
  184. package/registry/radix/components/ui/attachment.tsx +204 -0
  185. package/registry/radix/components/ui/avatar.tsx +111 -0
  186. package/registry/radix/components/ui/badge.tsx +51 -0
  187. package/registry/radix/components/ui/breadcrumb.tsx +121 -0
  188. package/registry/radix/components/ui/bubble.tsx +124 -0
  189. package/registry/radix/components/ui/button-group.tsx +83 -0
  190. package/registry/radix/components/ui/button.tsx +66 -0
  191. package/registry/radix/components/ui/calendar.tsx +222 -0
  192. package/registry/radix/components/ui/card.tsx +102 -0
  193. package/registry/radix/components/ui/carousel.tsx +242 -0
  194. package/registry/radix/components/ui/chart.tsx +372 -0
  195. package/registry/radix/components/ui/checkbox.tsx +32 -0
  196. package/registry/radix/components/ui/code-block.tsx +249 -0
  197. package/registry/radix/components/ui/collapsible.tsx +33 -0
  198. package/registry/radix/components/ui/combobox.tsx +299 -0
  199. package/registry/radix/components/ui/command.tsx +195 -0
  200. package/registry/radix/components/ui/context-menu.tsx +262 -0
  201. package/registry/radix/components/ui/dialog.tsx +168 -0
  202. package/registry/radix/components/ui/direction.tsx +22 -0
  203. package/registry/radix/components/ui/drawer.tsx +133 -0
  204. package/registry/radix/components/ui/dropdown-menu.tsx +268 -0
  205. package/registry/radix/components/ui/empty.tsx +103 -0
  206. package/registry/radix/components/ui/field.tsx +238 -0
  207. package/registry/radix/components/ui/hover-card.tsx +43 -0
  208. package/registry/radix/components/ui/input-group.tsx +156 -0
  209. package/registry/radix/components/ui/input-otp.tsx +86 -0
  210. package/registry/radix/components/ui/input.tsx +18 -0
  211. package/registry/radix/components/ui/item.tsx +196 -0
  212. package/registry/radix/components/ui/kbd.tsx +26 -0
  213. package/registry/radix/components/ui/label.tsx +23 -0
  214. package/registry/radix/components/ui/marker.tsx +68 -0
  215. package/registry/radix/components/ui/menubar.tsx +279 -0
  216. package/registry/radix/components/ui/message-scroller.tsx +131 -0
  217. package/registry/radix/components/ui/message.tsx +91 -0
  218. package/registry/radix/components/ui/native-select.tsx +60 -0
  219. package/registry/radix/components/ui/navigation-menu.tsx +163 -0
  220. package/registry/radix/components/ui/pagination.tsx +129 -0
  221. package/registry/radix/components/ui/popover.tsx +88 -0
  222. package/registry/radix/components/ui/progress.tsx +30 -0
  223. package/registry/radix/components/ui/questionnaire.tsx +324 -0
  224. package/registry/radix/components/ui/radio-group.tsx +43 -0
  225. package/registry/radix/components/ui/resizable.tsx +49 -0
  226. package/registry/radix/components/ui/scroll-area.tsx +54 -0
  227. package/registry/radix/components/ui/select.tsx +191 -0
  228. package/registry/radix/components/ui/separator.tsx +27 -0
  229. package/registry/radix/components/ui/sheet.tsx +147 -0
  230. package/registry/radix/components/ui/sidebar.tsx +702 -0
  231. package/registry/radix/components/ui/skeleton.tsx +13 -0
  232. package/registry/radix/components/ui/slider.tsx +62 -0
  233. package/registry/radix/components/ui/sonner.tsx +65 -0
  234. package/registry/radix/components/ui/spinner.tsx +10 -0
  235. package/registry/radix/components/ui/switch.tsx +32 -0
  236. package/registry/radix/components/ui/table.tsx +116 -0
  237. package/registry/radix/components/ui/tabs.tsx +129 -0
  238. package/registry/radix/components/ui/textarea.tsx +17 -0
  239. package/registry/radix/components/ui/toggle-group.tsx +89 -0
  240. package/registry/radix/components/ui/toggle.tsx +46 -0
  241. package/registry/radix/components/ui/tooltip.tsx +56 -0
  242. package/registry/radix/components/ui/trace.tsx +162 -0
  243. package/registry/radix/context-menu.json +19 -0
  244. package/registry/radix/dialog.json +22 -0
  245. package/registry/radix/direction.json +17 -0
  246. package/registry/radix/drawer.json +18 -0
  247. package/registry/radix/dropdown-menu.json +19 -0
  248. package/registry/radix/empty.json +18 -0
  249. package/registry/radix/field.json +22 -0
  250. package/registry/radix/hooks/use-highlighted-code.ts +75 -0
  251. package/registry/radix/hooks/use-mobile.ts +19 -0
  252. package/registry/radix/hover-card.json +18 -0
  253. package/registry/radix/input-group.json +23 -0
  254. package/registry/radix/input-otp.json +19 -0
  255. package/registry/radix/input.json +17 -0
  256. package/registry/radix/item.json +22 -0
  257. package/registry/radix/kbd.json +17 -0
  258. package/registry/radix/label.json +18 -0
  259. package/registry/radix/lib/highlighter.tsx +124 -0
  260. package/registry/radix/lib/utils.ts +1 -0
  261. package/registry/radix/marker.json +19 -0
  262. package/registry/radix/menubar.json +19 -0
  263. package/registry/radix/message-scroller.json +22 -0
  264. package/registry/radix/message.json +17 -0
  265. package/registry/radix/mostra-layout.json +20 -0
  266. package/registry/radix/mostra-questionnaire.json +22 -0
  267. package/registry/radix/native-select.json +18 -0
  268. package/registry/radix/navigation-menu.json +20 -0
  269. package/registry/radix/pagination.json +21 -0
  270. package/registry/radix/popover.json +18 -0
  271. package/registry/radix/progress.json +18 -0
  272. package/registry/radix/questionnaire.json +22 -0
  273. package/registry/radix/radio-group.json +18 -0
  274. package/registry/radix/registry.json +283 -0
  275. package/registry/radix/resizable.json +18 -0
  276. package/registry/radix/scroll-area.json +18 -0
  277. package/registry/radix/select.json +19 -0
  278. package/registry/radix/separator.json +18 -0
  279. package/registry/radix/sheet.json +22 -0
  280. package/registry/radix/sidebar.json +29 -0
  281. package/registry/radix/skeleton.json +17 -0
  282. package/registry/radix/slider.json +18 -0
  283. package/registry/radix/sonner.json +18 -0
  284. package/registry/radix/spinner.json +18 -0
  285. package/registry/radix/switch.json +18 -0
  286. package/registry/radix/table.json +17 -0
  287. package/registry/radix/tabs.json +19 -0
  288. package/registry/radix/textarea.json +17 -0
  289. package/registry/radix/toggle-group.json +22 -0
  290. package/registry/radix/toggle.json +19 -0
  291. package/registry/radix/tooltip.json +18 -0
  292. package/registry/radix/trace.json +21 -0
  293. package/registry/radix/use-highlighted-code.json +21 -0
  294. package/registry/radix/use-mobile.json +14 -0
  295. package/registry/radix/utils.json +17 -0
  296. package/src/index.ts +15 -0
  297. package/src/layout.tsx +221 -0
  298. package/src/questionnaire.tsx +1005 -0
@@ -0,0 +1,51 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { cn } from "cn"
4
+ import { Slot } from "radix-ui"
5
+
6
+ const badgeVariants = cva(
7
+ "group/badge inline-flex h-6 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-badge border border-transparent px-2.5 text-xs font-semibold whitespace-nowrap transition-colors focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
12
+ secondary:
13
+ "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
14
+ destructive:
15
+ "bg-destructive/10 text-[color-mix(in_oklab,var(--destructive)_72%,var(--foreground))] focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20",
16
+ outline:
17
+ "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground",
18
+ ghost:
19
+ "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
20
+ link: "text-primary underline-offset-4 hover:underline",
21
+ accent: "bg-accent text-accent-foreground",
22
+ success: "bg-success/12 text-[color-mix(in_oklab,var(--success)_72%,var(--foreground))]",
23
+ warning: "bg-warning/12 text-[color-mix(in_oklab,var(--warning)_72%,var(--foreground))]",
24
+ },
25
+ },
26
+ defaultVariants: {
27
+ variant: "default",
28
+ },
29
+ }
30
+ )
31
+
32
+ function Badge({
33
+ className,
34
+ variant = "default",
35
+ asChild = false,
36
+ ...props
37
+ }: React.ComponentProps<"span"> &
38
+ VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
39
+ const Comp = asChild ? Slot.Root : "span"
40
+
41
+ return (
42
+ <Comp
43
+ data-slot="badge"
44
+ data-variant={variant}
45
+ className={cn(badgeVariants({ variant }), className)}
46
+ {...props}
47
+ />
48
+ )
49
+ }
50
+
51
+ export { Badge, badgeVariants }
@@ -0,0 +1,121 @@
1
+ import * as React from "react"
2
+ import { cn } from "cn"
3
+ import { Slot } from "radix-ui"
4
+ import { ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
5
+
6
+ function Breadcrumb({ className, ...props }: React.ComponentProps<"nav">) {
7
+ return (
8
+ <nav
9
+ aria-label="breadcrumb"
10
+ data-slot="breadcrumb"
11
+ className={cn(className)}
12
+ {...props}
13
+ />
14
+ )
15
+ }
16
+
17
+ function BreadcrumbList({ className, ...props }: React.ComponentProps<"ol">) {
18
+ return (
19
+ <ol
20
+ data-slot="breadcrumb-list"
21
+ className={cn(
22
+ "flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground",
23
+ className
24
+ )}
25
+ {...props}
26
+ />
27
+ )
28
+ }
29
+
30
+ function BreadcrumbItem({ className, ...props }: React.ComponentProps<"li">) {
31
+ return (
32
+ <li
33
+ data-slot="breadcrumb-item"
34
+ className={cn("inline-flex items-center gap-1", className)}
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ function BreadcrumbLink({
41
+ asChild,
42
+ className,
43
+ ...props
44
+ }: React.ComponentProps<"a"> & {
45
+ asChild?: boolean
46
+ }) {
47
+ const Comp = asChild ? Slot.Root : "a"
48
+
49
+ return (
50
+ <Comp
51
+ data-slot="breadcrumb-link"
52
+ className={cn("transition-colors hover:text-foreground", className)}
53
+ {...props}
54
+ />
55
+ )
56
+ }
57
+
58
+ function BreadcrumbPage({ className, ...props }: React.ComponentProps<"span">) {
59
+ return (
60
+ <span
61
+ data-slot="breadcrumb-page"
62
+ role="link"
63
+ aria-disabled="true"
64
+ aria-current="page"
65
+ className={cn("font-normal text-foreground", className)}
66
+ {...props}
67
+ />
68
+ )
69
+ }
70
+
71
+ function BreadcrumbSeparator({
72
+ children,
73
+ className,
74
+ ...props
75
+ }: React.ComponentProps<"li">) {
76
+ return (
77
+ <li
78
+ data-slot="breadcrumb-separator"
79
+ role="presentation"
80
+ aria-hidden="true"
81
+ className={cn("[&>svg]:size-3.5", className)}
82
+ {...props}
83
+ >
84
+ {children ?? (
85
+ <ChevronRightIcon />
86
+ )}
87
+ </li>
88
+ )
89
+ }
90
+
91
+ function BreadcrumbEllipsis({
92
+ className,
93
+ ...props
94
+ }: React.ComponentProps<"span">) {
95
+ return (
96
+ <span
97
+ data-slot="breadcrumb-ellipsis"
98
+ role="presentation"
99
+ aria-hidden="true"
100
+ className={cn(
101
+ "flex size-5 items-center justify-center [&>svg]:size-4",
102
+ className
103
+ )}
104
+ {...props}
105
+ >
106
+ <MoreHorizontalIcon
107
+ />
108
+ <span className="sr-only">More</span>
109
+ </span>
110
+ )
111
+ }
112
+
113
+ export {
114
+ Breadcrumb,
115
+ BreadcrumbList,
116
+ BreadcrumbItem,
117
+ BreadcrumbLink,
118
+ BreadcrumbPage,
119
+ BreadcrumbSeparator,
120
+ BreadcrumbEllipsis,
121
+ }
@@ -0,0 +1,124 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { cn } from "cn"
4
+ import { Slot } from "radix-ui"
5
+
6
+ function BubbleGroup({ className, ...props }: React.ComponentProps<"div">) {
7
+ return (
8
+ <div
9
+ data-slot="bubble-group"
10
+ className={cn("flex min-w-0 flex-col gap-2", className)}
11
+ {...props}
12
+ />
13
+ )
14
+ }
15
+
16
+ const bubbleVariants = cva(
17
+ "group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-1 group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full",
18
+ {
19
+ variants: {
20
+ variant: {
21
+ default:
22
+ "*:data-[slot=bubble-content]:bg-primary *:data-[slot=bubble-content]:text-primary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-primary/80",
23
+ secondary:
24
+ "*:data-[slot=bubble-content]:bg-secondary *:data-[slot=bubble-content]:text-secondary-foreground [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)]",
25
+ muted:
26
+ "*:data-[slot=bubble-content]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[color-mix(in_oklch,var(--muted),var(--foreground)_5%)]",
27
+ tinted:
28
+ "*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.93_calc(c*0.4)_h)] *:data-[slot=bubble-content]:text-foreground dark:*:data-[slot=bubble-content]:bg-[oklch(from_var(--primary)_0.3_calc(c*0.4)_h)] [&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.88_calc(c*0.5)_h)] dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-[oklch(from_var(--primary)_0.35_calc(c*0.5)_h)]",
29
+ outline:
30
+ "*:data-[slot=bubble-content]:border-border *:data-[slot=bubble-content]:bg-background [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-input/30",
31
+ ghost:
32
+ "border-none *:data-[slot=bubble-content]:rounded-none *:data-[slot=bubble-content]:bg-transparent *:data-[slot=bubble-content]:p-0 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted [&>[data-slot=bubble-content]:is(button,a):hover]:text-foreground dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-muted/50",
33
+ destructive:
34
+ "*:data-[slot=bubble-content]:bg-destructive/10 *:data-[slot=bubble-content]:text-destructive dark:*:data-[slot=bubble-content]:bg-destructive/20 [&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/20 dark:[&>[data-slot=bubble-content]:is(button,a):hover]:bg-destructive/30",
35
+ },
36
+ },
37
+ defaultVariants: {
38
+ variant: "default",
39
+ },
40
+ }
41
+ )
42
+
43
+ function Bubble({
44
+ variant = "default",
45
+ align = "start",
46
+ className,
47
+ ...props
48
+ }: React.ComponentProps<"div"> &
49
+ VariantProps<typeof bubbleVariants> & {
50
+ align?: "start" | "end"
51
+ }) {
52
+ return (
53
+ <div
54
+ data-slot="bubble"
55
+ data-variant={variant}
56
+ data-align={align}
57
+ className={cn(bubbleVariants({ variant }), className)}
58
+ {...props}
59
+ />
60
+ )
61
+ }
62
+
63
+ function BubbleContent({
64
+ asChild = false,
65
+ className,
66
+ ...props
67
+ }: React.ComponentProps<"div"> & {
68
+ asChild?: boolean
69
+ }) {
70
+ const Comp = asChild ? Slot.Root : "div"
71
+
72
+ return (
73
+ <Comp
74
+ data-slot="bubble-content"
75
+ className={cn(
76
+ "w-fit max-w-full min-w-0 overflow-hidden rounded-xl border border-transparent px-3 py-2 text-sm leading-relaxed wrap-break-word group-data-[align=end]/bubble:self-end [button]:text-left [button,a]:transition-colors [button,a]:outline-none [button,a]:focus-visible:border-ring [button,a]:focus-visible:ring-3 [button,a]:focus-visible:ring-ring/50",
77
+ className
78
+ )}
79
+ {...props}
80
+ />
81
+ )
82
+ }
83
+
84
+ const bubbleReactionsVariants = cva(
85
+ "absolute z-10 flex w-fit shrink-0 items-center justify-center gap-1 rounded-full bg-muted px-1.5 py-0.5 text-sm ring-3 ring-card has-[button]:p-0",
86
+ {
87
+ variants: {
88
+ side: {
89
+ top: "top-0 -translate-y-3/4",
90
+ bottom: "bottom-0 translate-y-3/4",
91
+ },
92
+ align: {
93
+ start: "left-3",
94
+ end: "right-3",
95
+ },
96
+ },
97
+ defaultVariants: {
98
+ side: "bottom",
99
+ align: "end",
100
+ },
101
+ }
102
+ )
103
+
104
+ function BubbleReactions({
105
+ side = "bottom",
106
+ align = "end",
107
+ className,
108
+ ...props
109
+ }: React.ComponentProps<"div"> & {
110
+ align?: "start" | "end"
111
+ side?: "top" | "bottom"
112
+ }) {
113
+ return (
114
+ <div
115
+ data-slot="bubble-reactions"
116
+ data-align={align}
117
+ data-side={side}
118
+ className={cn(bubbleReactionsVariants({ side, align }), className)}
119
+ {...props}
120
+ />
121
+ )
122
+ }
123
+
124
+ export { BubbleGroup, Bubble, BubbleContent, BubbleReactions }
@@ -0,0 +1,83 @@
1
+ import { cva, type VariantProps } from "class-variance-authority"
2
+ import { cn } from "cn"
3
+ import { Slot } from "radix-ui"
4
+
5
+ import { Separator } from "@/components/ui/separator"
6
+
7
+ const buttonGroupVariants = cva(
8
+ "group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
9
+ {
10
+ variants: {
11
+ orientation: {
12
+ horizontal:
13
+ "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!",
14
+ vertical:
15
+ "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!",
16
+ },
17
+ },
18
+ defaultVariants: {
19
+ orientation: "horizontal",
20
+ },
21
+ }
22
+ )
23
+
24
+ function ButtonGroup({
25
+ className,
26
+ orientation,
27
+ ...props
28
+ }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
29
+ return (
30
+ <div
31
+ role="group"
32
+ data-slot="button-group"
33
+ data-orientation={orientation}
34
+ className={cn(buttonGroupVariants({ orientation }), className)}
35
+ {...props}
36
+ />
37
+ )
38
+ }
39
+
40
+ function ButtonGroupText({
41
+ className,
42
+ asChild = false,
43
+ ...props
44
+ }: React.ComponentProps<"div"> & {
45
+ asChild?: boolean
46
+ }) {
47
+ const Comp = asChild ? Slot.Root : "div"
48
+
49
+ return (
50
+ <Comp
51
+ className={cn(
52
+ "flex items-center gap-2 rounded-lg border bg-muted px-2.5 text-sm font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
53
+ className
54
+ )}
55
+ {...props}
56
+ />
57
+ )
58
+ }
59
+
60
+ function ButtonGroupSeparator({
61
+ className,
62
+ orientation = "vertical",
63
+ ...props
64
+ }: React.ComponentProps<typeof Separator>) {
65
+ return (
66
+ <Separator
67
+ data-slot="button-group-separator"
68
+ orientation={orientation}
69
+ className={cn(
70
+ "relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto",
71
+ className
72
+ )}
73
+ {...props}
74
+ />
75
+ )
76
+ }
77
+
78
+ export {
79
+ ButtonGroup,
80
+ ButtonGroupSeparator,
81
+ ButtonGroupText,
82
+ buttonGroupVariants,
83
+ }
@@ -0,0 +1,66 @@
1
+ import * as React from "react"
2
+ import { cva, type VariantProps } from "class-variance-authority"
3
+ import { cn } from "cn"
4
+ import { Slot } from "radix-ui"
5
+
6
+ const buttonVariants = cva(
7
+ "group/button press inline-flex shrink-0 items-center justify-center rounded-button border bg-clip-padding font-medium whitespace-nowrap outline-none select-none focus-visible:ring-3 focus-visible:ring-ring/40 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8
+ {
9
+ variants: {
10
+ variant: {
11
+ default: "border-transparent bg-primary text-primary-foreground shadow-button hover:bg-[color-mix(in_oklab,var(--primary),var(--foreground)_14%)]",
12
+ outline:
13
+ "border-(--button-outline-border) bg-(--button-outline-bg) text-foreground shadow-control hover:bg-muted aria-expanded:bg-muted",
14
+ secondary:
15
+ "border-transparent bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklab,var(--secondary),var(--foreground)_6%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
16
+ ghost:
17
+ "border-transparent text-foreground hover:bg-muted aria-expanded:bg-muted",
18
+ destructive:
19
+ "border-transparent bg-destructive text-destructive-foreground hover:bg-[color-mix(in_oklab,var(--destructive),var(--foreground)_14%)] focus-visible:ring-destructive/30",
20
+ link: "border-transparent text-primary underline-offset-4 hover:underline",
21
+ },
22
+ size: {
23
+ default:
24
+ "h-(--control-h) gap-2 px-5 text-[0.9375rem] has-data-[icon=inline-end]:pr-4 has-data-[icon=inline-start]:pl-4",
25
+ xs: "h-7 gap-1 px-2.5 text-xs has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-3",
26
+ sm: "h-(--control-h-sm) gap-1.5 px-3.5 text-sm has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3 [&_svg:not([class*='size-'])]:size-3.5",
27
+ lg: "h-12 gap-2 px-7 text-base has-data-[icon=inline-end]:pr-6 has-data-[icon=inline-start]:pl-6",
28
+ icon: "size-(--control-h)",
29
+ "icon-xs":
30
+ "size-7 [&_svg:not([class*='size-'])]:size-3",
31
+ "icon-sm":
32
+ "size-(--control-h-sm)",
33
+ "icon-lg": "size-12",
34
+ },
35
+ },
36
+ defaultVariants: {
37
+ variant: "default",
38
+ size: "default",
39
+ },
40
+ }
41
+ )
42
+
43
+ function Button({
44
+ className,
45
+ variant = "default",
46
+ size = "default",
47
+ asChild = false,
48
+ ...props
49
+ }: React.ComponentProps<"button"> &
50
+ VariantProps<typeof buttonVariants> & {
51
+ asChild?: boolean
52
+ }) {
53
+ const Comp = asChild ? Slot.Root : "button"
54
+
55
+ return (
56
+ <Comp
57
+ data-slot="button"
58
+ data-variant={variant}
59
+ data-size={size}
60
+ className={cn(buttonVariants({ variant, size, className }))}
61
+ {...props}
62
+ />
63
+ )
64
+ }
65
+
66
+ export { Button, buttonVariants }
@@ -0,0 +1,222 @@
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import { cn } from "cn"
5
+ import {
6
+ DayPicker,
7
+ getDefaultClassNames,
8
+ type DayButton,
9
+ type Locale,
10
+ } from "react-day-picker"
11
+
12
+ import { Button, buttonVariants } from "@/components/ui/button"
13
+ import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from "lucide-react"
14
+
15
+ function Calendar({
16
+ className,
17
+ classNames,
18
+ showOutsideDays = true,
19
+ captionLayout = "label",
20
+ buttonVariant = "ghost",
21
+ locale,
22
+ formatters,
23
+ components,
24
+ ...props
25
+ }: React.ComponentProps<typeof DayPicker> & {
26
+ buttonVariant?: React.ComponentProps<typeof Button>["variant"]
27
+ }) {
28
+ const defaultClassNames = getDefaultClassNames()
29
+
30
+ return (
31
+ <DayPicker
32
+ showOutsideDays={showOutsideDays}
33
+ className={cn(
34
+ "group/calendar bg-background p-2 [--cell-radius:var(--radius-md)] [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent",
35
+ String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
36
+ String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
37
+ className
38
+ )}
39
+ captionLayout={captionLayout}
40
+ locale={locale}
41
+ formatters={{
42
+ formatMonthDropdown: (date) =>
43
+ date.toLocaleString(locale?.code, { month: "short" }),
44
+ ...formatters,
45
+ }}
46
+ classNames={{
47
+ root: cn("w-fit", defaultClassNames.root),
48
+ months: cn(
49
+ "relative flex flex-col gap-4 md:flex-row",
50
+ defaultClassNames.months
51
+ ),
52
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
53
+ nav: cn(
54
+ "absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
55
+ defaultClassNames.nav
56
+ ),
57
+ button_previous: cn(
58
+ buttonVariants({ variant: buttonVariant }),
59
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
60
+ defaultClassNames.button_previous
61
+ ),
62
+ button_next: cn(
63
+ buttonVariants({ variant: buttonVariant }),
64
+ "size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
65
+ defaultClassNames.button_next
66
+ ),
67
+ month_caption: cn(
68
+ "flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
69
+ defaultClassNames.month_caption
70
+ ),
71
+ dropdowns: cn(
72
+ "flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
73
+ defaultClassNames.dropdowns
74
+ ),
75
+ dropdown_root: cn(
76
+ "relative rounded-(--cell-radius)",
77
+ defaultClassNames.dropdown_root
78
+ ),
79
+ dropdown: cn(
80
+ "absolute inset-0 bg-popover opacity-0",
81
+ defaultClassNames.dropdown
82
+ ),
83
+ caption_label: cn(
84
+ "font-medium select-none",
85
+ captionLayout === "label"
86
+ ? "text-sm"
87
+ : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
88
+ defaultClassNames.caption_label
89
+ ),
90
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
91
+ weekdays: cn("flex", defaultClassNames.weekdays),
92
+ weekday: cn(
93
+ "flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none",
94
+ defaultClassNames.weekday
95
+ ),
96
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
97
+ week_number_header: cn(
98
+ "w-(--cell-size) select-none",
99
+ defaultClassNames.week_number_header
100
+ ),
101
+ week_number: cn(
102
+ "text-[0.8rem] text-muted-foreground select-none",
103
+ defaultClassNames.week_number
104
+ ),
105
+ day: cn(
106
+ "group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)",
107
+ props.showWeekNumber
108
+ ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)"
109
+ : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)",
110
+ defaultClassNames.day
111
+ ),
112
+ range_start: cn(
113
+ "relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted",
114
+ defaultClassNames.range_start
115
+ ),
116
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
117
+ range_end: cn(
118
+ "relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted",
119
+ defaultClassNames.range_end
120
+ ),
121
+ today: cn(
122
+ "rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none",
123
+ defaultClassNames.today
124
+ ),
125
+ outside: cn(
126
+ "text-muted-foreground aria-selected:text-muted-foreground",
127
+ defaultClassNames.outside
128
+ ),
129
+ disabled: cn(
130
+ "text-muted-foreground opacity-50",
131
+ defaultClassNames.disabled
132
+ ),
133
+ hidden: cn("invisible", defaultClassNames.hidden),
134
+ ...classNames,
135
+ }}
136
+ components={{
137
+ Root: ({ className, rootRef, ...props }) => {
138
+ return (
139
+ <div
140
+ data-slot="calendar"
141
+ ref={rootRef}
142
+ className={cn(className)}
143
+ {...props}
144
+ />
145
+ )
146
+ },
147
+ Chevron: ({ className, orientation, ...props }) => {
148
+ if (orientation === "left") {
149
+ return (
150
+ <ChevronLeftIcon className={cn("size-4", className)} {...props} />
151
+ )
152
+ }
153
+
154
+ if (orientation === "right") {
155
+ return (
156
+ <ChevronRightIcon className={cn("size-4", className)} {...props} />
157
+ )
158
+ }
159
+
160
+ return (
161
+ <ChevronDownIcon className={cn("size-4", className)} {...props} />
162
+ )
163
+ },
164
+ DayButton: ({ ...props }) => (
165
+ <CalendarDayButton locale={locale} {...props} />
166
+ ),
167
+ WeekNumber: ({ children, ...props }) => {
168
+ return (
169
+ <td {...props}>
170
+ <div className="flex size-(--cell-size) items-center justify-center text-center">
171
+ {children}
172
+ </div>
173
+ </td>
174
+ )
175
+ },
176
+ ...components,
177
+ }}
178
+ {...props}
179
+ />
180
+ )
181
+ }
182
+
183
+ function CalendarDayButton({
184
+ className,
185
+ day,
186
+ modifiers,
187
+ locale,
188
+ ...props
189
+ }: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {
190
+ const defaultClassNames = getDefaultClassNames()
191
+
192
+ const ref = React.useRef<HTMLButtonElement>(null)
193
+ React.useEffect(() => {
194
+ if (modifiers.focused) ref.current?.focus()
195
+ }, [modifiers.focused])
196
+
197
+ return (
198
+ <Button
199
+ ref={ref}
200
+ variant="ghost"
201
+ size="icon"
202
+ data-day={day.date.toLocaleDateString(locale?.code)}
203
+ data-selected-single={
204
+ modifiers.selected &&
205
+ !modifiers.range_start &&
206
+ !modifiers.range_end &&
207
+ !modifiers.range_middle
208
+ }
209
+ data-range-start={modifiers.range_start}
210
+ data-range-end={modifiers.range_end}
211
+ data-range-middle={modifiers.range_middle}
212
+ className={cn(
213
+ "relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70",
214
+ defaultClassNames.day,
215
+ className
216
+ )}
217
+ {...props}
218
+ />
219
+ )
220
+ }
221
+
222
+ export { Calendar, CalendarDayButton }