@konopskidev/ui 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 (280) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +182 -2
  3. package/dist/components/ui/accordion.d.ts +8 -0
  4. package/dist/components/ui/accordion.d.ts.map +1 -0
  5. package/dist/components/ui/accordion.js +55 -0
  6. package/dist/components/ui/accordion.js.map +1 -0
  7. package/dist/components/ui/alert-dialog.d.ts +19 -0
  8. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  9. package/dist/components/ui/alert-dialog.js +101 -0
  10. package/dist/components/ui/alert-dialog.js.map +1 -0
  11. package/dist/components/ui/alert.d.ts +11 -0
  12. package/dist/components/ui/alert.d.ts.map +1 -0
  13. package/dist/components/ui/alert.js +44 -0
  14. package/dist/components/ui/alert.js.map +1 -0
  15. package/dist/components/ui/aspect-ratio.d.ts +4 -0
  16. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  17. package/dist/components/ui/aspect-ratio.js +14 -0
  18. package/dist/components/ui/aspect-ratio.js.map +1 -0
  19. package/dist/components/ui/attachment.d.ts +25 -0
  20. package/dist/components/ui/attachment.d.ts.map +1 -0
  21. package/dist/components/ui/attachment.js +102 -0
  22. package/dist/components/ui/attachment.js.map +1 -0
  23. package/dist/components/ui/avatar.d.ts +12 -0
  24. package/dist/components/ui/avatar.d.ts.map +1 -0
  25. package/dist/components/ui/avatar.js +51 -0
  26. package/dist/components/ui/avatar.js.map +1 -0
  27. package/dist/components/ui/badge.d.ts +10 -0
  28. package/dist/components/ui/badge.d.ts.map +1 -0
  29. package/dist/components/ui/badge.js +29 -0
  30. package/dist/components/ui/badge.js.map +1 -0
  31. package/dist/components/ui/breadcrumb.d.ts +12 -0
  32. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  33. package/dist/components/ui/breadcrumb.js +72 -0
  34. package/dist/components/ui/breadcrumb.js.map +1 -0
  35. package/dist/components/ui/bubble.d.ts +18 -0
  36. package/dist/components/ui/bubble.d.ts.map +1 -0
  37. package/dist/components/ui/bubble.js +73 -0
  38. package/dist/components/ui/bubble.js.map +1 -0
  39. package/dist/components/ui/button-group.d.ts +12 -0
  40. package/dist/components/ui/button-group.d.ts.map +1 -0
  41. package/dist/components/ui/button-group.js +40 -0
  42. package/dist/components/ui/button-group.js.map +1 -0
  43. package/dist/components/ui/button.d.ts +22 -0
  44. package/dist/components/ui/button.d.ts.map +1 -0
  45. package/dist/components/ui/button.js +61 -0
  46. package/dist/components/ui/button.js.map +1 -0
  47. package/dist/components/ui/calendar.d.ts +11 -0
  48. package/dist/components/ui/calendar.d.ts.map +1 -0
  49. package/dist/components/ui/calendar.js +111 -0
  50. package/dist/components/ui/calendar.js.map +1 -0
  51. package/dist/components/ui/card.d.ts +26 -0
  52. package/dist/components/ui/card.d.ts.map +1 -0
  53. package/dist/components/ui/card.js +76 -0
  54. package/dist/components/ui/card.js.map +1 -0
  55. package/dist/components/ui/carousel.d.ts +29 -0
  56. package/dist/components/ui/carousel.d.ts.map +1 -0
  57. package/dist/components/ui/carousel.js +132 -0
  58. package/dist/components/ui/carousel.js.map +1 -0
  59. package/dist/components/ui/chart.d.ts +45 -0
  60. package/dist/components/ui/chart.d.ts.map +1 -0
  61. package/dist/components/ui/chart.js +151 -0
  62. package/dist/components/ui/chart.js.map +1 -0
  63. package/dist/components/ui/checkbox.d.ts +5 -0
  64. package/dist/components/ui/checkbox.d.ts.map +1 -0
  65. package/dist/components/ui/checkbox.js +21 -0
  66. package/dist/components/ui/checkbox.js.map +1 -0
  67. package/dist/components/ui/code-block.d.ts +27 -0
  68. package/dist/components/ui/code-block.d.ts.map +1 -0
  69. package/dist/components/ui/code-block.js +123 -0
  70. package/dist/components/ui/code-block.js.map +1 -0
  71. package/dist/components/ui/collapsible.d.ts +6 -0
  72. package/dist/components/ui/collapsible.d.ts.map +1 -0
  73. package/dist/components/ui/collapsible.js +26 -0
  74. package/dist/components/ui/collapsible.js.map +1 -0
  75. package/dist/components/ui/combobox.d.ts +25 -0
  76. package/dist/components/ui/combobox.d.ts.map +1 -0
  77. package/dist/components/ui/combobox.js +174 -0
  78. package/dist/components/ui/combobox.js.map +1 -0
  79. package/dist/components/ui/command.d.ts +19 -0
  80. package/dist/components/ui/command.d.ts.map +1 -0
  81. package/dist/components/ui/command.js +90 -0
  82. package/dist/components/ui/command.js.map +1 -0
  83. package/dist/components/ui/context-menu.d.ts +32 -0
  84. package/dist/components/ui/context-menu.d.ts.map +1 -0
  85. package/dist/components/ui/context-menu.js +125 -0
  86. package/dist/components/ui/context-menu.js.map +1 -0
  87. package/dist/components/ui/dialog.d.ts +18 -0
  88. package/dist/components/ui/dialog.d.ts.map +1 -0
  89. package/dist/components/ui/dialog.js +98 -0
  90. package/dist/components/ui/dialog.js.map +1 -0
  91. package/dist/components/ui/direction.d.ts +12 -0
  92. package/dist/components/ui/direction.d.ts.map +1 -0
  93. package/dist/components/ui/direction.js +16 -0
  94. package/dist/components/ui/direction.js.map +1 -0
  95. package/dist/components/ui/drawer.d.ts +14 -0
  96. package/dist/components/ui/drawer.d.ts.map +1 -0
  97. package/dist/components/ui/drawer.js +78 -0
  98. package/dist/components/ui/drawer.js.map +1 -0
  99. package/dist/components/ui/dropdown-menu.d.ts +30 -0
  100. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  101. package/dist/components/ui/dropdown-menu.js +130 -0
  102. package/dist/components/ui/dropdown-menu.js.map +1 -0
  103. package/dist/components/ui/empty.d.ts +12 -0
  104. package/dist/components/ui/empty.d.ts.map +1 -0
  105. package/dist/components/ui/empty.js +60 -0
  106. package/dist/components/ui/empty.js.map +1 -0
  107. package/dist/components/ui/field.d.ts +25 -0
  108. package/dist/components/ui/field.d.ts.map +1 -0
  109. package/dist/components/ui/field.js +112 -0
  110. package/dist/components/ui/field.js.map +1 -0
  111. package/dist/components/ui/hover-card.d.ts +7 -0
  112. package/dist/components/ui/hover-card.d.ts.map +1 -0
  113. package/dist/components/ui/hover-card.js +32 -0
  114. package/dist/components/ui/hover-card.js.map +1 -0
  115. package/dist/components/ui/input-group.d.ts +17 -0
  116. package/dist/components/ui/input-group.d.ts.map +1 -0
  117. package/dist/components/ui/input-group.js +79 -0
  118. package/dist/components/ui/input-group.js.map +1 -0
  119. package/dist/components/ui/input-otp.d.ts +12 -0
  120. package/dist/components/ui/input-otp.d.ts.map +1 -0
  121. package/dist/components/ui/input-otp.js +49 -0
  122. package/dist/components/ui/input-otp.js.map +1 -0
  123. package/dist/components/ui/input.d.ts +11 -0
  124. package/dist/components/ui/input.d.ts.map +1 -0
  125. package/dist/components/ui/input.js +25 -0
  126. package/dist/components/ui/input.js.map +1 -0
  127. package/dist/components/ui/item.d.ts +24 -0
  128. package/dist/components/ui/item.d.ts.map +1 -0
  129. package/dist/components/ui/item.js +121 -0
  130. package/dist/components/ui/item.js.map +1 -0
  131. package/dist/components/ui/kbd.d.ts +4 -0
  132. package/dist/components/ui/kbd.d.ts.map +1 -0
  133. package/dist/components/ui/kbd.js +20 -0
  134. package/dist/components/ui/kbd.js.map +1 -0
  135. package/dist/components/ui/label.d.ts +5 -0
  136. package/dist/components/ui/label.d.ts.map +1 -0
  137. package/dist/components/ui/label.js +15 -0
  138. package/dist/components/ui/label.js.map +1 -0
  139. package/dist/components/ui/marker.d.ts +12 -0
  140. package/dist/components/ui/marker.d.ts.map +1 -0
  141. package/dist/components/ui/marker.js +41 -0
  142. package/dist/components/ui/marker.js.map +1 -0
  143. package/dist/components/ui/menubar.d.ts +31 -0
  144. package/dist/components/ui/menubar.d.ts.map +1 -0
  145. package/dist/components/ui/menubar.js +137 -0
  146. package/dist/components/ui/menubar.js.map +1 -0
  147. package/dist/components/ui/message-scroller.d.ts +11 -0
  148. package/dist/components/ui/message-scroller.d.ts.map +1 -0
  149. package/dist/components/ui/message-scroller.js +61 -0
  150. package/dist/components/ui/message-scroller.js.map +1 -0
  151. package/dist/components/ui/message.d.ts +11 -0
  152. package/dist/components/ui/message.d.ts.map +1 -0
  153. package/dist/components/ui/message.js +50 -0
  154. package/dist/components/ui/message.js.map +1 -0
  155. package/dist/components/ui/native-select.d.ts +9 -0
  156. package/dist/components/ui/native-select.d.ts.map +1 -0
  157. package/dist/components/ui/native-select.js +39 -0
  158. package/dist/components/ui/native-select.js.map +1 -0
  159. package/dist/components/ui/navigation-menu.d.ts +15 -0
  160. package/dist/components/ui/navigation-menu.d.ts.map +1 -0
  161. package/dist/components/ui/navigation-menu.js +81 -0
  162. package/dist/components/ui/navigation-menu.js.map +1 -0
  163. package/dist/components/ui/pagination.d.ts +18 -0
  164. package/dist/components/ui/pagination.d.ts.map +1 -0
  165. package/dist/components/ui/pagination.js +81 -0
  166. package/dist/components/ui/pagination.js.map +1 -0
  167. package/dist/components/ui/popover.d.ts +11 -0
  168. package/dist/components/ui/popover.d.ts.map +1 -0
  169. package/dist/components/ui/popover.js +56 -0
  170. package/dist/components/ui/popover.js.map +1 -0
  171. package/dist/components/ui/progress.d.ts +5 -0
  172. package/dist/components/ui/progress.d.ts.map +1 -0
  173. package/dist/components/ui/progress.js +23 -0
  174. package/dist/components/ui/progress.js.map +1 -0
  175. package/dist/components/ui/questionnaire.d.ts +20 -0
  176. package/dist/components/ui/questionnaire.d.ts.map +1 -0
  177. package/dist/components/ui/questionnaire.js +172 -0
  178. package/dist/components/ui/questionnaire.js.map +1 -0
  179. package/dist/components/ui/radio-group.d.ts +6 -0
  180. package/dist/components/ui/radio-group.d.ts.map +1 -0
  181. package/dist/components/ui/radio-group.js +27 -0
  182. package/dist/components/ui/radio-group.js.map +1 -0
  183. package/dist/components/ui/resizable.d.ts +8 -0
  184. package/dist/components/ui/resizable.d.ts.map +1 -0
  185. package/dist/components/ui/resizable.js +30 -0
  186. package/dist/components/ui/resizable.js.map +1 -0
  187. package/dist/components/ui/scroll-area.d.ts +6 -0
  188. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  189. package/dist/components/ui/scroll-area.js +38 -0
  190. package/dist/components/ui/scroll-area.js.map +1 -0
  191. package/dist/components/ui/select.d.ts +16 -0
  192. package/dist/components/ui/select.d.ts.map +1 -0
  193. package/dist/components/ui/select.js +102 -0
  194. package/dist/components/ui/select.js.map +1 -0
  195. package/dist/components/ui/separator.d.ts +5 -0
  196. package/dist/components/ui/separator.d.ts.map +1 -0
  197. package/dist/components/ui/separator.js +17 -0
  198. package/dist/components/ui/separator.js.map +1 -0
  199. package/dist/components/ui/sheet.d.ts +15 -0
  200. package/dist/components/ui/sheet.d.ts.map +1 -0
  201. package/dist/components/ui/sheet.js +90 -0
  202. package/dist/components/ui/sheet.js.map +1 -0
  203. package/dist/components/ui/sidebar.d.ts +70 -0
  204. package/dist/components/ui/sidebar.d.ts.map +1 -0
  205. package/dist/components/ui/sidebar.js +380 -0
  206. package/dist/components/ui/sidebar.js.map +1 -0
  207. package/dist/components/ui/skeleton.d.ts +3 -0
  208. package/dist/components/ui/skeleton.d.ts.map +1 -0
  209. package/dist/components/ui/skeleton.js +13 -0
  210. package/dist/components/ui/skeleton.js.map +1 -0
  211. package/dist/components/ui/slider.d.ts +8 -0
  212. package/dist/components/ui/slider.d.ts.map +1 -0
  213. package/dist/components/ui/slider.js +40 -0
  214. package/dist/components/ui/slider.js.map +1 -0
  215. package/dist/components/ui/sonner.d.ts +14 -0
  216. package/dist/components/ui/sonner.d.ts.map +1 -0
  217. package/dist/components/ui/sonner.js +35 -0
  218. package/dist/components/ui/sonner.js.map +1 -0
  219. package/dist/components/ui/spinner.d.ts +3 -0
  220. package/dist/components/ui/spinner.d.ts.map +1 -0
  221. package/dist/components/ui/spinner.js +16 -0
  222. package/dist/components/ui/spinner.js.map +1 -0
  223. package/dist/components/ui/switch.d.ts +7 -0
  224. package/dist/components/ui/switch.d.ts.map +1 -0
  225. package/dist/components/ui/switch.js +22 -0
  226. package/dist/components/ui/switch.js.map +1 -0
  227. package/dist/components/ui/table.d.ts +11 -0
  228. package/dist/components/ui/table.d.ts.map +1 -0
  229. package/dist/components/ui/table.js +67 -0
  230. package/dist/components/ui/table.js.map +1 -0
  231. package/dist/components/ui/tabs.d.ts +12 -0
  232. package/dist/components/ui/tabs.d.ts.map +1 -0
  233. package/dist/components/ui/tabs.js +48 -0
  234. package/dist/components/ui/tabs.js.map +1 -0
  235. package/dist/components/ui/textarea.d.ts +10 -0
  236. package/dist/components/ui/textarea.d.ts.map +1 -0
  237. package/dist/components/ui/textarea.js +37 -0
  238. package/dist/components/ui/textarea.js.map +1 -0
  239. package/dist/components/ui/toggle-group.d.ts +11 -0
  240. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  241. package/dist/components/ui/toggle-group.js +53 -0
  242. package/dist/components/ui/toggle-group.js.map +1 -0
  243. package/dist/components/ui/toggle.d.ts +10 -0
  244. package/dist/components/ui/toggle.d.ts.map +1 -0
  245. package/dist/components/ui/toggle.js +37 -0
  246. package/dist/components/ui/toggle.js.map +1 -0
  247. package/dist/components/ui/tooltip.d.ts +8 -0
  248. package/dist/components/ui/tooltip.d.ts.map +1 -0
  249. package/dist/components/ui/tooltip.js +38 -0
  250. package/dist/components/ui/tooltip.js.map +1 -0
  251. package/dist/components/ui/trace.d.ts +19 -0
  252. package/dist/components/ui/trace.d.ts.map +1 -0
  253. package/dist/components/ui/trace.js +76 -0
  254. package/dist/components/ui/trace.js.map +1 -0
  255. package/dist/hooks/use-highlighted-code.d.ts +3 -0
  256. package/dist/hooks/use-highlighted-code.d.ts.map +1 -0
  257. package/dist/hooks/use-mobile.d.ts +2 -0
  258. package/dist/hooks/use-mobile.d.ts.map +1 -0
  259. package/dist/hooks/use-mobile.js +22 -0
  260. package/dist/hooks/use-mobile.js.map +1 -0
  261. package/dist/index.d.ts +74 -0
  262. package/dist/index.d.ts.map +1 -0
  263. package/dist/index.js +67 -0
  264. package/dist/lib/get-placeholder.d.ts +6 -0
  265. package/dist/lib/get-placeholder.d.ts.map +1 -0
  266. package/dist/lib/get-placeholder.js +12 -0
  267. package/dist/lib/get-placeholder.js.map +1 -0
  268. package/dist/lib/highlighter.d.ts +10 -0
  269. package/dist/lib/highlighter.d.ts.map +1 -0
  270. package/dist/lib/utils.d.ts +9 -0
  271. package/dist/lib/utils.d.ts.map +1 -0
  272. package/dist/lib/utils.js +1 -0
  273. package/package.json +148 -3
  274. package/src/styles/base.css +70 -0
  275. package/src/styles/globals.css +33 -0
  276. package/src/styles/prose.css +105 -0
  277. package/src/styles/theme.css +108 -0
  278. package/src/styles/tokens.css +129 -0
  279. package/src/styles/utilities.css +57 -0
  280. package/src/styles/variants.css +649 -0
@@ -0,0 +1,61 @@
1
+ import { cn } from "cn";
2
+ import { Slot } from "radix-ui";
3
+ import "react";
4
+ import { jsx } from "react/jsx-runtime";
5
+ import { cva } from "class-variance-authority";
6
+ // src/components/ui/button.tsx
7
+ /**
8
+ * konopskidev's button.
9
+ *
10
+ * The variant and size names are a superset of shadcn/ui's: everything upstream
11
+ * accepts still works, and the site's extras (`primary`, `ghost-primary`,
12
+ * `ghost-destructive`, the `icon-*` sizes) sit alongside them. Sizing is
13
+ * padding-based rather than fixed-height, so a button lines up with the 40px
14
+ * `Input` by using the default size.
15
+ */
16
+ var buttonVariants = cva("inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-sm border border-transparent font-sans text-sm font-medium whitespace-nowrap focus-ring transition-colors disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4", {
17
+ variants: {
18
+ variant: {
19
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
20
+ primary: "bg-primary text-primary-foreground hover:bg-primary/90",
21
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
22
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
23
+ outline: "border-border bg-background hover:bg-accent hover:text-accent-foreground",
24
+ ghost: "bg-transparent hover:bg-accent hover:text-accent-foreground",
25
+ "ghost-primary": "bg-transparent text-primary hover:bg-primary/10",
26
+ "ghost-destructive": "bg-transparent text-destructive hover:bg-destructive/10",
27
+ link: "text-primary underline-offset-4 hover:underline"
28
+ },
29
+ size: {
30
+ default: "px-4 py-2.5",
31
+ xs: "gap-1 px-2 py-1 text-xs [&_svg:not([class*=size-])]:size-3",
32
+ sm: "px-3 py-1.5 text-sm",
33
+ lg: "px-6 py-3",
34
+ "icon-xs": "p-1.5 [&_svg:not([class*=size-])]:size-3",
35
+ "icon-sm": "p-2",
36
+ icon: "p-2.5",
37
+ "icon-lg": "p-3"
38
+ }
39
+ },
40
+ defaultVariants: {
41
+ variant: "default",
42
+ size: "default"
43
+ }
44
+ });
45
+ function Button({ className, variant = "default", size = "default", asChild = false, type = "button", ...props }) {
46
+ const Comp = asChild ? Slot.Root : "button";
47
+ return /* @__PURE__ */ jsx(Comp, {
48
+ "data-slot": "button",
49
+ "data-variant": variant,
50
+ "data-size": size,
51
+ type,
52
+ className: cn(buttonVariants({
53
+ variant,
54
+ size
55
+ }), className),
56
+ ...props
57
+ });
58
+ }
59
+ export { Button, buttonVariants };
60
+
61
+ //# sourceMappingURL=button.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button.js","names":[],"sources":["../../../src/components/ui/button.tsx"],"sourcesContent":["import { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from 'cn';\nimport { Slot } from 'radix-ui';\nimport * as React from 'react';\n\n/**\n * konopskidev's button.\n *\n * The variant and size names are a superset of shadcn/ui's: everything upstream\n * accepts still works, and the site's extras (`primary`, `ghost-primary`,\n * `ghost-destructive`, the `icon-*` sizes) sit alongside them. Sizing is\n * padding-based rather than fixed-height, so a button lines up with the 40px\n * `Input` by using the default size.\n */\nconst buttonVariants = cva(\n 'inline-flex shrink-0 cursor-pointer items-center justify-center gap-2 rounded-sm border border-transparent font-sans text-sm font-medium whitespace-nowrap focus-ring transition-colors disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',\n {\n variants: {\n variant: {\n default: 'bg-primary text-primary-foreground hover:bg-primary/90',\n primary: 'bg-primary text-primary-foreground hover:bg-primary/90',\n secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',\n destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',\n outline: 'border-border bg-background hover:bg-accent hover:text-accent-foreground',\n ghost: 'bg-transparent hover:bg-accent hover:text-accent-foreground',\n 'ghost-primary': 'bg-transparent text-primary hover:bg-primary/10',\n 'ghost-destructive': 'bg-transparent text-destructive hover:bg-destructive/10',\n link: 'text-primary underline-offset-4 hover:underline',\n },\n size: {\n default: 'px-4 py-2.5',\n xs: 'gap-1 px-2 py-1 text-xs [&_svg:not([class*=size-])]:size-3',\n sm: 'px-3 py-1.5 text-sm',\n lg: 'px-6 py-3',\n 'icon-xs': 'p-1.5 [&_svg:not([class*=size-])]:size-3',\n 'icon-sm': 'p-2',\n icon: 'p-2.5',\n 'icon-lg': 'p-3',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ComponentProps<'button'>, VariantProps<typeof buttonVariants> {\n /** Render the single child element instead of a `<button>`. */\n asChild?: boolean;\n}\n\nfunction Button({\n className,\n variant = 'default',\n size = 'default',\n asChild = false,\n type = 'button',\n ...props\n}: ButtonProps) {\n const Comp = asChild ? Slot.Root : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n type={type}\n className={cn(buttonVariants({ variant, size }), className)}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"],"mappings":";;;;;;;;;;;;;;;AAcA,IAAM,iBAAiB,IACrB,wVACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;GACT,SAAS;GACT,WAAW;GACX,aAAa;GACb,SAAS;GACT,OAAO;GACP,iBAAiB;GACjB,qBAAqB;GACrB,MAAM;EACR;EACA,MAAM;GACJ,SAAS;GACT,IAAI;GACJ,IAAI;GACJ,IAAI;GACJ,WAAW;GACX,WAAW;GACX,MAAM;GACN,WAAW;EACb;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;AAQA,SAAS,OAAO,EACd,WACA,UAAU,WACV,OAAO,WACP,UAAU,OACV,OAAO,UACP,GAAG,SACW;CACd,MAAM,OAAO,UAAU,KAAK,OAAO;CAEnC,OACE,oBAAC,MAAD;EACE,aAAU;EACV,gBAAc;EACd,aAAW;EACL;EACN,WAAW,GAAG,eAAe;GAAE;GAAS;EAAK,CAAC,GAAG,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,11 @@
1
+ import * as React from 'react';
2
+ import { DayPicker, type DayButton, type Locale } from 'react-day-picker';
3
+ import { Button } from './button.js';
4
+ declare function Calendar({ className, classNames, showOutsideDays, captionLayout, buttonVariant, locale, formatters, components, ...props }: React.ComponentProps<typeof DayPicker> & {
5
+ buttonVariant?: React.ComponentProps<typeof Button>['variant'];
6
+ }): React.JSX.Element;
7
+ declare function CalendarDayButton({ className, day, modifiers, locale, ...props }: React.ComponentProps<typeof DayButton> & {
8
+ locale?: Partial<Locale>;
9
+ }): React.JSX.Element;
10
+ export { Calendar, CalendarDayButton };
11
+ //# sourceMappingURL=calendar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../src/components/ui/calendar.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,SAAS,EAAwB,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAEhG,OAAO,EAAE,MAAM,EAAkB,MAAM,UAAU,CAAC;AAElD,iBAAS,QAAQ,CAAC,EAChB,SAAS,EACT,UAAU,EACV,eAAsB,EACtB,aAAuB,EACvB,aAAuB,EACvB,MAAM,EACN,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAC1C,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,CAAC,SAAS,CAAC,CAAC;CAChE,qBA2HA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,EACH,SAAS,EACT,MAAM,EACN,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,GAAG;IAAE,MAAM,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,CAAA;CAAE,qBA+BvE;AAED,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC"}
@@ -0,0 +1,111 @@
1
+ "use client";
2
+ "use client";
3
+ import { Button, buttonVariants } from "./button.js";
4
+ import { cn } from "cn";
5
+ import { ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
6
+ import * as React from "react";
7
+ import { jsx } from "react/jsx-runtime";
8
+ import { DayPicker, getDefaultClassNames } from "react-day-picker";
9
+ // src/components/ui/calendar.tsx
10
+ function Calendar({ className, classNames, showOutsideDays = true, captionLayout = "label", buttonVariant = "ghost", locale, formatters, components, ...props }) {
11
+ const defaultClassNames = getDefaultClassNames();
12
+ return /* @__PURE__ */ jsx(DayPicker, {
13
+ showOutsideDays,
14
+ className: cn("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", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
15
+ captionLayout,
16
+ locale,
17
+ formatters: {
18
+ formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: "short" }),
19
+ ...formatters
20
+ },
21
+ classNames: {
22
+ root: cn("w-fit", defaultClassNames.root),
23
+ months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
24
+ month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
25
+ nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
26
+ button_previous: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
27
+ button_next: cn(buttonVariants({ variant: buttonVariant }), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
28
+ month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
29
+ dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
30
+ dropdown_root: cn("relative rounded-(--cell-radius)", defaultClassNames.dropdown_root),
31
+ dropdown: cn("absolute inset-0 bg-popover opacity-0", defaultClassNames.dropdown),
32
+ caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground", defaultClassNames.caption_label),
33
+ month_grid: cn("w-full border-collapse", defaultClassNames.month_grid),
34
+ weekdays: cn("flex", defaultClassNames.weekdays),
35
+ weekday: cn("flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none", defaultClassNames.weekday),
36
+ week: cn("mt-2 flex w-full", defaultClassNames.week),
37
+ week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
38
+ week_number: cn("text-[0.8rem] text-muted-foreground select-none", defaultClassNames.week_number),
39
+ day: cn("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)", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)" : "[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)", defaultClassNames.day),
40
+ range_start: cn("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", defaultClassNames.range_start),
41
+ range_middle: cn("rounded-none", defaultClassNames.range_middle),
42
+ range_end: cn("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", defaultClassNames.range_end),
43
+ today: cn("rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none", defaultClassNames.today),
44
+ outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
45
+ disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
46
+ hidden: cn("invisible", defaultClassNames.hidden),
47
+ ...classNames
48
+ },
49
+ components: {
50
+ Root: ({ className, rootRef, ...props }) => {
51
+ return /* @__PURE__ */ jsx("div", {
52
+ "data-slot": "calendar",
53
+ ref: rootRef,
54
+ className: cn(className),
55
+ ...props
56
+ });
57
+ },
58
+ Chevron: ({ className, orientation, ...props }) => {
59
+ if (orientation === "left") return /* @__PURE__ */ jsx(ChevronLeftIcon, {
60
+ className: cn("size-4", className),
61
+ ...props
62
+ });
63
+ if (orientation === "right") return /* @__PURE__ */ jsx(ChevronRightIcon, {
64
+ className: cn("size-4", className),
65
+ ...props
66
+ });
67
+ return /* @__PURE__ */ jsx(ChevronDownIcon, {
68
+ className: cn("size-4", className),
69
+ ...props
70
+ });
71
+ },
72
+ DayButton: ({ ...props }) => /* @__PURE__ */ jsx(CalendarDayButton, {
73
+ locale,
74
+ ...props
75
+ }),
76
+ WeekNumber: ({ children, ...props }) => {
77
+ return /* @__PURE__ */ jsx("td", {
78
+ ...props,
79
+ children: /* @__PURE__ */ jsx("div", {
80
+ className: "flex size-(--cell-size) items-center justify-center text-center",
81
+ children
82
+ })
83
+ });
84
+ },
85
+ ...components
86
+ },
87
+ ...props
88
+ });
89
+ }
90
+ function CalendarDayButton({ className, day, modifiers, locale, ...props }) {
91
+ const defaultClassNames = getDefaultClassNames();
92
+ const ref = React.useRef(null);
93
+ React.useEffect(() => {
94
+ if (modifiers.focused) ref.current?.focus();
95
+ }, [modifiers.focused]);
96
+ return /* @__PURE__ */ jsx(Button, {
97
+ ref,
98
+ variant: "ghost",
99
+ size: "icon",
100
+ "data-day": day.date.toLocaleDateString(locale?.code),
101
+ "data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
102
+ "data-range-start": modifiers.range_start,
103
+ "data-range-end": modifiers.range_end,
104
+ "data-range-middle": modifiers.range_middle,
105
+ className: cn("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", defaultClassNames.day, className),
106
+ ...props
107
+ });
108
+ }
109
+ export { Calendar, CalendarDayButton };
110
+
111
+ //# sourceMappingURL=calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendar.js","names":[],"sources":["../../../src/components/ui/calendar.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from 'cn';\nimport { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';\nimport * as React from 'react';\nimport { DayPicker, getDefaultClassNames, type DayButton, type Locale } from 'react-day-picker';\n\nimport { Button, buttonVariants } from './button';\n\nfunction Calendar({\n className,\n classNames,\n showOutsideDays = true,\n captionLayout = 'label',\n buttonVariant = 'ghost',\n locale,\n formatters,\n components,\n ...props\n}: React.ComponentProps<typeof DayPicker> & {\n buttonVariant?: React.ComponentProps<typeof Button>['variant'];\n}) {\n const defaultClassNames = getDefaultClassNames();\n\n return (\n <DayPicker\n showOutsideDays={showOutsideDays}\n className={cn(\n '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',\n String.raw`rtl:**:[.rdp-button\\_next>svg]:rotate-180`,\n String.raw`rtl:**:[.rdp-button\\_previous>svg]:rotate-180`,\n className,\n )}\n captionLayout={captionLayout}\n locale={locale}\n formatters={{\n formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),\n ...formatters,\n }}\n classNames={{\n root: cn('w-fit', defaultClassNames.root),\n months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),\n month: cn('flex w-full flex-col gap-4', defaultClassNames.month),\n nav: cn(\n 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',\n defaultClassNames.nav,\n ),\n button_previous: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_previous,\n ),\n button_next: cn(\n buttonVariants({ variant: buttonVariant }),\n 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',\n defaultClassNames.button_next,\n ),\n month_caption: cn(\n 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',\n defaultClassNames.month_caption,\n ),\n dropdowns: cn(\n 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',\n defaultClassNames.dropdowns,\n ),\n dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),\n dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),\n caption_label: cn(\n 'font-medium select-none',\n captionLayout === 'label'\n ? 'text-sm'\n : 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',\n defaultClassNames.caption_label,\n ),\n month_grid: cn('w-full border-collapse', defaultClassNames.month_grid),\n weekdays: cn('flex', defaultClassNames.weekdays),\n weekday: cn(\n 'flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none',\n defaultClassNames.weekday,\n ),\n week: cn('mt-2 flex w-full', defaultClassNames.week),\n week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),\n week_number: cn(\n 'text-[0.8rem] text-muted-foreground select-none',\n defaultClassNames.week_number,\n ),\n day: cn(\n '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)',\n props.showWeekNumber\n ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'\n : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',\n defaultClassNames.day,\n ),\n range_start: cn(\n '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',\n defaultClassNames.range_start,\n ),\n range_middle: cn('rounded-none', defaultClassNames.range_middle),\n range_end: cn(\n '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',\n defaultClassNames.range_end,\n ),\n today: cn(\n 'rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none',\n defaultClassNames.today,\n ),\n outside: cn(\n 'text-muted-foreground aria-selected:text-muted-foreground',\n defaultClassNames.outside,\n ),\n disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),\n hidden: cn('invisible', defaultClassNames.hidden),\n ...classNames,\n }}\n components={{\n Root: ({ className, rootRef, ...props }) => {\n return <div data-slot=\"calendar\" ref={rootRef} className={cn(className)} {...props} />;\n },\n Chevron: ({ className, orientation, ...props }) => {\n if (orientation === 'left') {\n return <ChevronLeftIcon className={cn('size-4', className)} {...props} />;\n }\n\n if (orientation === 'right') {\n return <ChevronRightIcon className={cn('size-4', className)} {...props} />;\n }\n\n return <ChevronDownIcon className={cn('size-4', className)} {...props} />;\n },\n DayButton: ({ ...props }) => <CalendarDayButton locale={locale} {...props} />,\n WeekNumber: ({ children, ...props }) => {\n return (\n <td {...props}>\n <div className=\"flex size-(--cell-size) items-center justify-center text-center\">\n {children}\n </div>\n </td>\n );\n },\n ...components,\n }}\n {...props}\n />\n );\n}\n\nfunction CalendarDayButton({\n className,\n day,\n modifiers,\n locale,\n ...props\n}: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {\n const defaultClassNames = getDefaultClassNames();\n\n const ref = React.useRef<HTMLButtonElement>(null);\n React.useEffect(() => {\n if (modifiers.focused) ref.current?.focus();\n }, [modifiers.focused]);\n\n return (\n <Button\n ref={ref}\n variant=\"ghost\"\n size=\"icon\"\n data-day={day.date.toLocaleDateString(locale?.code)}\n data-selected-single={\n modifiers.selected &&\n !modifiers.range_start &&\n !modifiers.range_end &&\n !modifiers.range_middle\n }\n data-range-start={modifiers.range_start}\n data-range-end={modifiers.range_end}\n data-range-middle={modifiers.range_middle}\n className={cn(\n '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',\n defaultClassNames.day,\n className,\n )}\n {...props}\n />\n );\n}\n\nexport { Calendar, Calendar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,OAAA,CAAA;CACO,OAAA,oBAAA,QAAA;EACL;EACA,SAAK;EACL,MAAA;EACA,YAAA,IAAA,KAAA,mBACY,QACT,IAAA;EAIH,wBAAkB,UAAU,YAAA,CAAA,UAAA,eAAA,CAAA,UAAA,aAAA,CAAA,UAAA;EAC5B,oBAAgB,UAAU;EAC1B,kBAAA,UAAmB;EACnB,qBACE,UAAA;EAIF,WAAI,GAAA,w7BAAA,kBAAA,KAAA,SAAA;EACL,GAAA;CAEL,CAAA"}
@@ -0,0 +1,26 @@
1
+ import * as React from 'react';
2
+ type CardProps = React.ComponentProps<'div'> & {
3
+ /** Adds a subtle hover affordance for cards that behave as links. */
4
+ interactive?: boolean;
5
+ };
6
+ declare function Card({ className, interactive, ...props }: CardProps): React.JSX.Element;
7
+ declare function CardHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
8
+ declare function CardTitle({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
9
+ declare function CardDescription({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
10
+ declare function CardAction({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
11
+ declare function CardContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
12
+ declare function CardFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
13
+ interface CardImageProps extends Omit<React.ComponentProps<'img'>, 'src'> {
14
+ src?: string | null;
15
+ alt: string;
16
+ /** Tailwind aspect ratio utility for the media box. */
17
+ aspect?: string;
18
+ }
19
+ /**
20
+ * A bleeding card image, sized by aspect ratio. Framework-agnostic on purpose:
21
+ * this package never imports a framework-specific image component, so the same
22
+ * card works in Vite, Astro, Next or a plain HTML page.
23
+ */
24
+ declare function CardImage({ className, src, alt, aspect, ...props }: CardImageProps): React.JSX.Element | null;
25
+ export { Card, CardHeader, CardFooter, CardTitle, CardDescription, CardAction, CardContent, CardImage, type CardProps, type CardImageProps, };
26
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
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AAED;;;;GAIG;AACH,iBAAS,SAAS,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,MAAwB,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,4BAkB7F;AAED,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,eAAe,EACf,UAAU,EACV,WAAW,EACX,SAAS,EACT,KAAK,SAAS,EACd,KAAK,cAAc,GACpB,CAAC"}
@@ -0,0 +1,76 @@
1
+ import { cn } from "cn";
2
+ import "react";
3
+ import { jsx } from "react/jsx-runtime";
4
+ // src/components/ui/card.tsx
5
+ function Card({ className, interactive = false, ...props }) {
6
+ return /* @__PURE__ */ jsx("div", {
7
+ "data-slot": "card",
8
+ className: cn("flex flex-col card", interactive && "transition-colors hover:border-foreground/25", className),
9
+ ...props
10
+ });
11
+ }
12
+ function CardHeader({ className, ...props }) {
13
+ return /* @__PURE__ */ jsx("div", {
14
+ "data-slot": "card-header",
15
+ className: cn("flex flex-col gap-2 p-5", className),
16
+ ...props
17
+ });
18
+ }
19
+ function CardTitle({ className, ...props }) {
20
+ return /* @__PURE__ */ jsx("div", {
21
+ "data-slot": "card-title",
22
+ className: cn("font-display text-h3 font-semibold tracking-tight", className),
23
+ ...props
24
+ });
25
+ }
26
+ function CardDescription({ className, ...props }) {
27
+ return /* @__PURE__ */ jsx("div", {
28
+ "data-slot": "card-description",
29
+ className: cn("text-base leading-relaxed text-muted-foreground", className),
30
+ ...props
31
+ });
32
+ }
33
+ function CardAction({ className, ...props }) {
34
+ return /* @__PURE__ */ jsx("div", {
35
+ "data-slot": "card-action",
36
+ className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className),
37
+ ...props
38
+ });
39
+ }
40
+ function CardContent({ className, ...props }) {
41
+ return /* @__PURE__ */ jsx("div", {
42
+ "data-slot": "card-content",
43
+ className: cn("flex flex-col gap-2 p-5 pt-0", className),
44
+ ...props
45
+ });
46
+ }
47
+ function CardFooter({ className, ...props }) {
48
+ return /* @__PURE__ */ jsx("div", {
49
+ "data-slot": "card-footer",
50
+ className: cn("flex items-center p-5 pt-0", className),
51
+ ...props
52
+ });
53
+ }
54
+ /**
55
+ * A bleeding card image, sized by aspect ratio. Framework-agnostic on purpose:
56
+ * this package never imports a framework-specific image component, so the same
57
+ * card works in Vite, Astro, Next or a plain HTML page.
58
+ */
59
+ function CardImage({ className, src, alt, aspect = "aspect-[16/9]", ...props }) {
60
+ if (!src) return null;
61
+ return /* @__PURE__ */ jsx("div", {
62
+ "data-slot": "card-image",
63
+ className: cn("relative overflow-hidden rounded-t-sm", aspect, className),
64
+ children: /* @__PURE__ */ jsx("img", {
65
+ src,
66
+ alt,
67
+ loading: "lazy",
68
+ decoding: "async",
69
+ className: "h-full w-full object-cover",
70
+ ...props
71
+ })
72
+ });
73
+ }
74
+ export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardImage, CardTitle };
75
+
76
+ //# sourceMappingURL=card.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.js","names":[],"sources":["../../../src/components/ui/card.tsx"],"sourcesContent":["import { cn } from 'cn';\nimport * as React from 'react';\n\ntype CardProps = React.ComponentProps<'div'> & {\n /** Adds a subtle hover affordance for cards that behave as links. */\n interactive?: boolean;\n};\n\nfunction Card({ className, interactive = false, ...props }: CardProps) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\n 'flex flex-col card',\n interactive && 'transition-colors hover:border-foreground/25',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div data-slot=\"card-header\" className={cn('flex flex-col gap-2 p-5', className)} {...props} />\n );\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-title\"\n className={cn('font-display text-h3 font-semibold tracking-tight', className)}\n {...props}\n />\n );\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-description\"\n className={cn('text-base leading-relaxed text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}\n {...props}\n />\n );\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-content\"\n className={cn('flex flex-col gap-2 p-5 pt-0', className)}\n {...props}\n />\n );\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<'div'>) {\n return (\n <div\n data-slot=\"card-footer\"\n className={cn('flex items-center p-5 pt-0', className)}\n {...props}\n />\n );\n}\n\ninterface CardImageProps extends Omit<React.ComponentProps<'img'>, 'src'> {\n src?: string | null;\n alt: string;\n /** Tailwind aspect ratio utility for the media box. */\n aspect?: string;\n}\n\n/**\n * A bleeding card image, sized by aspect ratio. Framework-agnostic on purpose:\n * this package never imports a framework-specific image component, so the same\n * card works in Vite, Astro, Next or a plain HTML page.\n */\nfunction CardImage({ className, src, alt, aspect = 'aspect-[16/9]', ...props }: CardImageProps) {\n if (!src) return null;\n\n return (\n <div\n data-slot=\"card-image\"\n className={cn('relative overflow-hidden rounded-t-sm', aspect, className)}\n >\n <img\n src={src}\n alt={alt}\n loading=\"lazy\"\n decoding=\"async\"\n className=\"h-full w-full object-cover\"\n {...props}\n />\n </div>\n );\n}\n\nexport {\n Card,\n CardHeader,\n CardFooter,\n CardTitle,\n CardDescription,\n CardAction,\n CardContent,\n CardImage,\n type CardProps,\n type CardImageProps,\n};\n"],"mappings":";;;;AAQA,SAAS,KAAK,EAAE,WAAW,cAAc,OAAO,GAAG,SAAoB;CACrE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,sBACA,eAAe,gDACf,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EAAK,aAAU;EAAc,WAAW,GAAG,2BAA2B,SAAS;EAAG,GAAI;CAAQ,CAAA;AAElG;AAEA,SAAS,UAAU,EAAE,WAAW,GAAG,SAAsC;CACvE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,qDAAqD,SAAS;EAC5E,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,gBAAgB,EAAE,WAAW,GAAG,SAAsC;CAC7E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,mDAAmD,SAAS;EAC1E,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,kEAAkE,SAAS;EACzF,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EAAE,WAAW,GAAG,SAAsC;CACzE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,gCAAgC,SAAS;EACvD,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,WAAW,EAAE,WAAW,GAAG,SAAsC;CACxE,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,8BAA8B,SAAS;EACrD,GAAI;CACL,CAAA;AAEL;;;;;;AAcA,SAAS,UAAU,EAAE,WAAW,KAAK,KAAK,SAAS,iBAAiB,GAAG,SAAyB;CAC9F,IAAI,CAAC,KAAK,OAAO;CAEjB,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,yCAAyC,QAAQ,SAAS;EAExE,UAAA,oBAAC,OAAD;GACO;GACA;GACL,SAAQ;GACR,UAAS;GACT,WAAU;GACV,GAAI;EACL,CAAA;CACE,CAAA;AAET"}
@@ -0,0 +1,29 @@
1
+ import useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';
2
+ import * as React from 'react';
3
+ import { Button } from './button.js';
4
+ type CarouselApi = UseEmblaCarouselType[1];
5
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
6
+ type CarouselOptions = UseCarouselParameters[0];
7
+ type CarouselPlugin = UseCarouselParameters[1];
8
+ type CarouselProps = {
9
+ opts?: CarouselOptions;
10
+ plugins?: CarouselPlugin;
11
+ orientation?: 'horizontal' | 'vertical';
12
+ setApi?: (api: CarouselApi) => void;
13
+ };
14
+ type CarouselContextProps = {
15
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0];
16
+ api: ReturnType<typeof useEmblaCarousel>[1];
17
+ scrollPrev: () => void;
18
+ scrollNext: () => void;
19
+ canScrollPrev: boolean;
20
+ canScrollNext: boolean;
21
+ } & CarouselProps;
22
+ declare function useCarousel(): CarouselContextProps;
23
+ declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<'div'> & CarouselProps): React.JSX.Element;
24
+ declare function CarouselContent({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
25
+ declare function CarouselItem({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
26
+ declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
27
+ declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
28
+ export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, useCarousel, };
29
+ //# sourceMappingURL=carousel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.d.ts","sourceRoot":"","sources":["../../../src/components/ui/carousel.tsx"],"names":[],"mappings":"AACA,OAAO,gBAAgB,EAAE,EAAE,KAAK,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,KAAK,WAAW,GAAG,oBAAoB,CAAC,CAAC,CAAC,CAAC;AAC3C,KAAK,qBAAqB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AACjE,KAAK,eAAe,GAAG,qBA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S,YAAY,CAAC,EACpB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,qBAuBrC;AAED,OAAO,EACL,KAAK,WAAW,EAChB,QAAQ,EACR,eAAe,EACf,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,WAAW,GACZ,CAAC"}
@@ -0,0 +1,132 @@
1
+ import { Button } from "./button.js";
2
+ import { cn } from "cn";
3
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
4
+ import * as React from "react";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import useEmblaCarousel from "embla-carousel-react";
7
+ // src/components/ui/carousel.tsx
8
+ var CarouselContext = React.createContext(null);
9
+ function useCarousel() {
10
+ const context = React.useContext(CarouselContext);
11
+ if (!context) throw new Error("useCarousel must be used within a <Carousel />");
12
+ return context;
13
+ }
14
+ function Carousel({ orientation = "horizontal", opts, setApi, plugins, className, children, ...props }) {
15
+ const [carouselRef, api] = useEmblaCarousel({
16
+ ...opts,
17
+ axis: orientation === "horizontal" ? "x" : "y"
18
+ }, plugins);
19
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false);
20
+ const [canScrollNext, setCanScrollNext] = React.useState(false);
21
+ const onSelect = React.useCallback((api) => {
22
+ if (!api) return;
23
+ setCanScrollPrev(api.canScrollPrev());
24
+ setCanScrollNext(api.canScrollNext());
25
+ }, []);
26
+ const scrollPrev = React.useCallback(() => {
27
+ api?.scrollPrev();
28
+ }, [api]);
29
+ const scrollNext = React.useCallback(() => {
30
+ api?.scrollNext();
31
+ }, [api]);
32
+ const handleKeyDown = React.useCallback((event) => {
33
+ if (event.key === "ArrowLeft") {
34
+ event.preventDefault();
35
+ scrollPrev();
36
+ } else if (event.key === "ArrowRight") {
37
+ event.preventDefault();
38
+ scrollNext();
39
+ }
40
+ }, [scrollPrev, scrollNext]);
41
+ React.useEffect(() => {
42
+ if (!api || !setApi) return;
43
+ setApi(api);
44
+ }, [api, setApi]);
45
+ React.useEffect(() => {
46
+ if (!api) return;
47
+ onSelect(api);
48
+ api.on("reInit", onSelect);
49
+ api.on("select", onSelect);
50
+ return () => {
51
+ api?.off("select", onSelect);
52
+ };
53
+ }, [api, onSelect]);
54
+ return /* @__PURE__ */ jsx(CarouselContext.Provider, {
55
+ value: {
56
+ carouselRef,
57
+ api,
58
+ opts,
59
+ orientation: orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
60
+ scrollPrev,
61
+ scrollNext,
62
+ canScrollPrev,
63
+ canScrollNext
64
+ },
65
+ children: /* @__PURE__ */ jsx("div", {
66
+ onKeyDownCapture: handleKeyDown,
67
+ className: cn("relative", className),
68
+ role: "region",
69
+ "aria-roledescription": "carousel",
70
+ "data-slot": "carousel",
71
+ ...props,
72
+ children
73
+ })
74
+ });
75
+ }
76
+ function CarouselContent({ className, ...props }) {
77
+ const { carouselRef, orientation } = useCarousel();
78
+ return /* @__PURE__ */ jsx("div", {
79
+ ref: carouselRef,
80
+ className: "overflow-hidden",
81
+ "data-slot": "carousel-content",
82
+ children: /* @__PURE__ */ jsx("div", {
83
+ className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className),
84
+ ...props
85
+ })
86
+ });
87
+ }
88
+ function CarouselItem({ className, ...props }) {
89
+ const { orientation } = useCarousel();
90
+ return /* @__PURE__ */ jsx("div", {
91
+ role: "group",
92
+ "aria-roledescription": "slide",
93
+ "data-slot": "carousel-item",
94
+ className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className),
95
+ ...props
96
+ });
97
+ }
98
+ function CarouselPrevious({ className, variant = "outline", size = "icon-sm", ...props }) {
99
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel();
100
+ return /* @__PURE__ */ jsxs(Button, {
101
+ "data-slot": "carousel-previous",
102
+ variant,
103
+ size,
104
+ className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -left-12 my-auto" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
105
+ disabled: !canScrollPrev,
106
+ onClick: scrollPrev,
107
+ ...props,
108
+ children: [/* @__PURE__ */ jsx(ChevronLeftIcon, {}), /* @__PURE__ */ jsx("span", {
109
+ className: "sr-only",
110
+ children: "Previous slide"
111
+ })]
112
+ });
113
+ }
114
+ function CarouselNext({ className, variant = "outline", size = "icon-sm", ...props }) {
115
+ const { orientation, scrollNext, canScrollNext } = useCarousel();
116
+ return /* @__PURE__ */ jsxs(Button, {
117
+ "data-slot": "carousel-next",
118
+ variant,
119
+ size,
120
+ className: cn("absolute touch-manipulation rounded-full", orientation === "horizontal" ? "inset-y-0 -right-12 my-auto" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
121
+ disabled: !canScrollNext,
122
+ onClick: scrollNext,
123
+ ...props,
124
+ children: [/* @__PURE__ */ jsx(ChevronRightIcon, {}), /* @__PURE__ */ jsx("span", {
125
+ className: "sr-only",
126
+ children: "Next slide"
127
+ })]
128
+ });
129
+ }
130
+ export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, useCarousel };
131
+
132
+ //# sourceMappingURL=carousel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"carousel.js","names":[],"sources":["../../../src/components/ui/carousel.tsx"],"sourcesContent":["import { cn } from 'cn';\nimport useEmblaCarousel, { type UseEmblaCarouselType } from 'embla-carousel-react';\nimport { ChevronLeftIcon, ChevronRightIcon } from 'lucide-react';\nimport * as React from 'react';\n\nimport { Button } from './button';\n\ntype CarouselApi = UseEmblaCarouselType[1];\ntype UseCarouselParameters = Parameters<typeof useEmblaCarousel>;\ntype CarouselOptions = UseCarouselParameters[0];\ntype CarouselPlugin = UseCarouselParameters[1];\n\ntype CarouselProps = {\n opts?: CarouselOptions;\n plugins?: CarouselPlugin;\n orientation?: 'horizontal' | 'vertical';\n setApi?: (api: CarouselApi) => void;\n};\n\ntype CarouselContextProps = {\n carouselRef: ReturnType<typeof useEmblaCarousel>[0];\n api: ReturnType<typeof useEmblaCarousel>[1];\n scrollPrev: () => void;\n scrollNext: () => void;\n canScrollPrev: boolean;\n canScrollNext: boolean;\n} & CarouselProps;\n\nconst CarouselContext = React.createContext<CarouselContextProps | null>(null);\n\nfunction useCarousel() {\n const context = React.useContext(CarouselContext);\n\n if (!context) {\n throw new Error('useCarousel must be used within a <Carousel />');\n }\n\n return context;\n}\n\nfunction Carousel({\n orientation = 'horizontal',\n opts,\n setApi,\n plugins,\n className,\n children,\n ...props\n}: React.ComponentProps<'div'> & CarouselProps) {\n const [carouselRef, api] = useEmblaCarousel(\n {\n ...opts,\n axis: orientation === 'horizontal' ? 'x' : 'y',\n },\n plugins,\n );\n const [canScrollPrev, setCanScrollPrev] = React.useState(false);\n const [canScrollNext, setCanScrollNext] = React.useState(false);\n\n const onSelect = React.useCallback((api: CarouselApi) => {\n if (!api) return;\n setCanScrollPrev(api.canScrollPrev());\n setCanScrollNext(api.canScrollNext());\n }, []);\n\n const scrollPrev = React.useCallback(() => {\n api?.scrollPrev();\n }, [api]);\n\n const scrollNext = React.useCallback(() => {\n api?.scrollNext();\n }, [api]);\n\n const handleKeyDown = React.useCallback(\n (event: React.KeyboardEvent<HTMLDivElement>) => {\n if (event.key === 'ArrowLeft') {\n event.preventDefault();\n scrollPrev();\n } else if (event.key === 'ArrowRight') {\n event.preventDefault();\n scrollNext();\n }\n },\n [scrollPrev, scrollNext],\n );\n\n React.useEffect(() => {\n if (!api || !setApi) return;\n // Publishes embla's instance to the optional controlled `setApi` prop.\n setApi(api);\n }, [api, setApi]);\n\n React.useEffect(() => {\n if (!api) return;\n // Hands embla's initial selection to the caller's `setApi`/`onSelect` state.\n // eslint-disable-next-line react-hooks/set-state-in-effect\n onSelect(api);\n api.on('reInit', onSelect);\n api.on('select', onSelect);\n\n return () => {\n api?.off('select', onSelect);\n };\n }, [api, onSelect]);\n\n return (\n <CarouselContext.Provider\n value={{\n carouselRef,\n api: api,\n opts,\n orientation: orientation || (opts?.axis === 'y' ? 'vertical' : 'horizontal'),\n scrollPrev,\n scrollNext,\n canScrollPrev,\n canScrollNext,\n }}\n >\n <div\n onKeyDownCapture={handleKeyDown}\n className={cn('relative', className)}\n role=\"region\"\n aria-roledescription=\"carousel\"\n data-slot=\"carousel\"\n {...props}\n >\n {children}\n </div>\n </CarouselContext.Provider>\n );\n}\n\nfunction CarouselContent({ className, ...props }: React.ComponentProps<'div'>) {\n const { carouselRef, orientation } = useCarousel();\n\n return (\n <div ref={carouselRef} className=\"overflow-hidden\" data-slot=\"carousel-content\">\n <div\n className={cn('flex', orientation === 'horizontal' ? '-ml-4' : '-mt-4 flex-col', className)}\n {...props}\n />\n </div>\n );\n}\n\nfunction CarouselItem({ className, ...props }: React.ComponentProps<'div'>) {\n const { orientation } = useCarousel();\n\n return (\n <div\n role=\"group\"\n aria-roledescription=\"slide\"\n data-slot=\"carousel-item\"\n className={cn(\n 'min-w-0 shrink-0 grow-0 basis-full',\n orientation === 'horizontal' ? 'pl-4' : 'pt-4',\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction CarouselPrevious({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollPrev, canScrollPrev } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-previous\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'inset-y-0 -left-12 my-auto'\n : '-top-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollPrev}\n onClick={scrollPrev}\n {...props}\n >\n <ChevronLeftIcon />\n <span className=\"sr-only\">Previous slide</span>\n </Button>\n );\n}\n\nfunction CarouselNext({\n className,\n variant = 'outline',\n size = 'icon-sm',\n ...props\n}: React.ComponentProps<typeof Button>) {\n const { orientation, scrollNext, canScrollNext } = useCarousel();\n\n return (\n <Button\n data-slot=\"carousel-next\"\n variant={variant}\n size={size}\n className={cn(\n 'absolute touch-manipulation rounded-full',\n orientation === 'horizontal'\n ? 'inset-y-0 -right-12 my-auto'\n : '-bottom-12 left-1/2 -translate-x-1/2 rotate-90',\n className,\n )}\n disabled={!canScrollNext}\n onClick={scrollNext}\n {...props}\n >\n <ChevronRightIcon />\n <span className=\"sr-only\">Next slide</span>\n </Button>\n );\n}\n\nexport {\n type CarouselApi,\n Carousel,\n CarouselContent,\n CarouselItem,\n CarouselPrevious,\n CarouselNext,\n useCarousel,\n};\n"],"mappings":";;;;;;;AA4BA,IAAM,kBAAkB,MAAM,cAA2C,IAAI;AAE7E,SAAS,cAAc;CACrB,MAAM,UAAU,MAAM,WAAW,eAAe;CAEhD,IAAI,CAAC,SACH,MAAM,IAAI,MAAM,gDAAgD;CAGlE,OAAO;AACT;AAEA,SAAS,SAAS,EAChB,cAAc,cACd,MACA,QACA,SACA,WACA,UACA,GAAG,SAC2C;CAC9C,MAAM,CAAC,aAAa,OAAO,iBACzB;EACE,GAAG;EACH,MAAM,gBAAgB,eAAe,MAAM;CAC7C,GACA,OACF;CACA,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAC9D,MAAM,CAAC,eAAe,oBAAoB,MAAM,SAAS,KAAK;CAE9D,MAAM,WAAW,MAAM,aAAa,QAAqB;EACvD,IAAI,CAAC,KAAK;EACV,iBAAiB,IAAI,cAAc,CAAC;EACpC,iBAAiB,IAAI,cAAc,CAAC;CACtC,GAAG,CAAC,CAAC;CAEL,MAAM,aAAa,MAAM,kBAAkB;EACzC,KAAK,WAAW;CAClB,GAAG,CAAC,GAAG,CAAC;CAER,MAAM,aAAa,MAAM,kBAAkB;EACzC,KAAK,WAAW;CAClB,GAAG,CAAC,GAAG,CAAC;CAER,MAAM,gBAAgB,MAAM,aACzB,UAA+C;EAC9C,IAAI,MAAM,QAAQ,aAAa;GAC7B,MAAM,eAAe;GACrB,WAAW;EACb,OAAO,IAAI,MAAM,QAAQ,cAAc;GACrC,MAAM,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EAAE,aAAa,YAAY,kBAAkB,YAAY;CAE/D,OACE,qBAAC,QAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,GACT,4CACA,gBAAgB,eACZ,+BACA,+CACJ,SACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;EAbN,UAAA,CAeE,oBAAC,iBAAD,CAAkB,CAAA,GAClB,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAoB,CAAA,CACxC;;AAEZ;AAEA,SAAS,aAAa,EACpB,WACA,UAAU,WACV,OAAO,WACP,GAAG,SACmC;CACtC,MAAM,EAAE,aAAa,YAAY,kBAAkB,YAAY;CAE/D,OACE,qBAAC,QAAD;EACE,aAAU;EACD;EACH;EACN,WAAW,GACT,4CACA,gBAAgB,eACZ,gCACA,kDACJ,SACF;EACA,UAAU,CAAC;EACX,SAAS;EACT,GAAI;EAbN,UAAA,CAeE,oBAAC,kBAAD,CAAmB,CAAA,GACnB,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAgB,CAAA,CACpC;;AAEZ"}
@@ -0,0 +1,45 @@
1
+ import * as React from 'react';
2
+ import * as RechartsPrimitive from 'recharts';
3
+ import type { TooltipValueType } from 'recharts';
4
+ declare const THEMES: {
5
+ readonly light: "";
6
+ readonly dark: ".dark";
7
+ };
8
+ type TooltipNameType = number | string;
9
+ export type ChartConfig = Record<string, {
10
+ label?: React.ReactNode;
11
+ icon?: React.ComponentType;
12
+ } & ({
13
+ color?: string;
14
+ theme?: never;
15
+ } | {
16
+ color?: never;
17
+ theme: Record<keyof typeof THEMES, string>;
18
+ })>;
19
+ declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: React.ComponentProps<'div'> & {
20
+ config: ChartConfig;
21
+ children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>['children'];
22
+ initialDimension?: {
23
+ width: number;
24
+ height: number;
25
+ };
26
+ }): React.JSX.Element;
27
+ declare const ChartStyle: ({ id, config }: {
28
+ id: string;
29
+ config: ChartConfig;
30
+ }) => React.JSX.Element | null;
31
+ declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
32
+ declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<'div'> & {
33
+ hideLabel?: boolean;
34
+ hideIndicator?: boolean;
35
+ indicator?: 'line' | 'dot' | 'dashed';
36
+ nameKey?: string;
37
+ labelKey?: string;
38
+ } & Omit<RechartsPrimitive.DefaultTooltipContentProps<TooltipValueType, TooltipNameType>, 'accessibilityLayer'>): React.JSX.Element | null;
39
+ declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
40
+ declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<'div'> & {
41
+ hideIcon?: boolean;
42
+ nameKey?: string;
43
+ } & RechartsPrimitive.DefaultLegendContentProps): React.JSX.Element | null;
44
+ export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
45
+ //# sourceMappingURL=chart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chart.d.ts","sourceRoot":"","sources":["../../../src/components/ui/chart.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,iBAAiB,MAAM,UAAU,CAAC;AAE9C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAGjD,QAAA,MAAM,MAAM;;;CAAwC,CAAC;AAGrD,KAAK,eAAe,GAAG,MAAM,GAAG,MAAM,CAAC;AAEvC,MAAM,MAAM,WAAW,GAAG,MAAM,CAC9B,MAAM,EACN;IACE,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;CAC5B,GAAG,CACA;IA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