@stagewise/ui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (266) hide show
  1. package/README.md +135 -0
  2. package/package.json +80 -0
  3. package/src/components/ui/accordion.tsx +66 -0
  4. package/src/components/ui/alert-dialog.tsx +185 -0
  5. package/src/components/ui/alert.tsx +76 -0
  6. package/src/components/ui/aspect-ratio.tsx +22 -0
  7. package/src/components/ui/avatar.tsx +107 -0
  8. package/src/components/ui/badge.tsx +52 -0
  9. package/src/components/ui/breadcrumb.tsx +125 -0
  10. package/src/components/ui/bubble.tsx +128 -0
  11. package/src/components/ui/button-group.tsx +87 -0
  12. package/src/components/ui/button.tsx +58 -0
  13. package/src/components/ui/calendar.tsx +221 -0
  14. package/src/components/ui/card.tsx +103 -0
  15. package/src/components/ui/carousel.tsx +240 -0
  16. package/src/components/ui/chart.tsx +371 -0
  17. package/src/components/ui/checkbox.tsx +30 -0
  18. package/src/components/ui/collapsible.tsx +19 -0
  19. package/src/components/ui/combobox.tsx +295 -0
  20. package/src/components/ui/command.tsx +348 -0
  21. package/src/components/ui/context-menu.tsx +271 -0
  22. package/src/components/ui/dialog.tsx +160 -0
  23. package/src/components/ui/direction.tsx +4 -0
  24. package/src/components/ui/drawer.tsx +228 -0
  25. package/src/components/ui/dropdown-menu.tsx +266 -0
  26. package/src/components/ui/empty.tsx +104 -0
  27. package/src/components/ui/field.tsx +236 -0
  28. package/src/components/ui/hover-card.tsx +51 -0
  29. package/src/components/ui/input-group.tsx +158 -0
  30. package/src/components/ui/input-otp.tsx +85 -0
  31. package/src/components/ui/input.tsx +20 -0
  32. package/src/components/ui/item.tsx +201 -0
  33. package/src/components/ui/kbd.tsx +26 -0
  34. package/src/components/ui/label.tsx +20 -0
  35. package/src/components/ui/marker.tsx +71 -0
  36. package/src/components/ui/menubar.tsx +280 -0
  37. package/src/components/ui/message.tsx +92 -0
  38. package/src/components/ui/native-select.tsx +61 -0
  39. package/src/components/ui/navigation-menu.tsx +168 -0
  40. package/src/components/ui/pagination.tsx +130 -0
  41. package/src/components/ui/popover.tsx +88 -0
  42. package/src/components/ui/progress.tsx +83 -0
  43. package/src/components/ui/questionnaire.tsx +324 -0
  44. package/src/components/ui/radio-group.tsx +36 -0
  45. package/src/components/ui/resizable.tsx +50 -0
  46. package/src/components/ui/scroll-area.tsx +53 -0
  47. package/src/components/ui/select.tsx +201 -0
  48. package/src/components/ui/separator.tsx +23 -0
  49. package/src/components/ui/sheet.tsx +136 -0
  50. package/src/components/ui/sidebar.tsx +723 -0
  51. package/src/components/ui/skeleton.tsx +13 -0
  52. package/src/components/ui/slider.tsx +52 -0
  53. package/src/components/ui/spinner.tsx +10 -0
  54. package/src/components/ui/switch.tsx +32 -0
  55. package/src/components/ui/table.tsx +114 -0
  56. package/src/components/ui/tabs.tsx +82 -0
  57. package/src/components/ui/textarea.tsx +18 -0
  58. package/src/components/ui/toast.tsx +234 -0
  59. package/src/components/ui/toggle-group.tsx +87 -0
  60. package/src/components/ui/toggle.tsx +43 -0
  61. package/src/components/ui/tooltip.tsx +66 -0
  62. package/src/fonts/OFL.txt +92 -0
  63. package/src/fonts/geist-variable-italic.woff2 +0 -0
  64. package/src/fonts/geist-variable.woff2 +0 -0
  65. package/src/hooks/use-mobile.ts +19 -0
  66. package/src/icons/custom/index.ts +1 -0
  67. package/src/icons/custom/ui-outline-18/Icon.tsx +28 -0
  68. package/src/icons/custom/ui-outline-18/IconBrowserTab.tsx +40 -0
  69. package/src/icons/custom/ui-outline-18/IconNewTerminal.tsx +77 -0
  70. package/src/icons/custom/ui-outline-18/index.ts +3 -0
  71. package/src/icons/index.ts +52 -0
  72. package/src/icons/nucleo/LICENSE.md +29 -0
  73. package/src/icons/nucleo/core-outline-24/Icon.tsx +27 -0
  74. package/src/icons/nucleo/core-outline-24/IconArrowUpOutline24.tsx +36 -0
  75. package/src/icons/nucleo/core-outline-24/IconBluetoothOutline24.tsx +26 -0
  76. package/src/icons/nucleo/core-outline-24/IconTrash2Outline24.tsx +76 -0
  77. package/src/icons/nucleo/core-outline-24/IconUsbOutline24.tsx +64 -0
  78. package/src/icons/nucleo/core-outline-24/index.ts +5 -0
  79. package/src/icons/nucleo/index.ts +48 -0
  80. package/src/icons/nucleo/micro-bold/Icon.tsx +27 -0
  81. package/src/icons/nucleo/micro-bold/IconArrowLeft.tsx +28 -0
  82. package/src/icons/nucleo/micro-bold/IconArrowRight.tsx +28 -0
  83. package/src/icons/nucleo/micro-bold/IconArrowRotateAnticlockwise.tsx +27 -0
  84. package/src/icons/nucleo/micro-bold/IconChevronLeft.tsx +16 -0
  85. package/src/icons/nucleo/micro-bold/IconChevronRight.tsx +16 -0
  86. package/src/icons/nucleo/micro-bold/IconClipboardContent.tsx +59 -0
  87. package/src/icons/nucleo/micro-bold/IconMagicWandSparkle.tsx +44 -0
  88. package/src/icons/nucleo/micro-bold/IconTriangleWarning.tsx +30 -0
  89. package/src/icons/nucleo/micro-bold/IconXmark.tsx +31 -0
  90. package/src/icons/nucleo/micro-bold/index.ts +10 -0
  91. package/src/icons/nucleo/social-media/Icon.tsx +27 -0
  92. package/src/icons/nucleo/social-media/IconApple.tsx +12 -0
  93. package/src/icons/nucleo/social-media/IconGithub.tsx +11 -0
  94. package/src/icons/nucleo/social-media/IconGoogle.tsx +20 -0
  95. package/src/icons/nucleo/social-media/index.ts +4 -0
  96. package/src/icons/nucleo/ui-fill-18/Icon.tsx +27 -0
  97. package/src/icons/nucleo/ui-fill-18/IconArrowLeftFill18.tsx +17 -0
  98. package/src/icons/nucleo/ui-fill-18/IconArrowRightFill18.tsx +17 -0
  99. package/src/icons/nucleo/ui-fill-18/IconCheckFill18.tsx +12 -0
  100. package/src/icons/nucleo/ui-fill-18/IconChevronDownFill18.tsx +12 -0
  101. package/src/icons/nucleo/ui-fill-18/IconGlobe2Fill18.tsx +17 -0
  102. package/src/icons/nucleo/ui-fill-18/IconLinkFill18.tsx +21 -0
  103. package/src/icons/nucleo/ui-fill-18/IconMediaStopFill18.tsx +17 -0
  104. package/src/icons/nucleo/ui-fill-18/IconPinTackFill18.tsx +17 -0
  105. package/src/icons/nucleo/ui-fill-18/IconPlusFill18.tsx +17 -0
  106. package/src/icons/nucleo/ui-fill-18/IconVolumeUpFill18.tsx +22 -0
  107. package/src/icons/nucleo/ui-fill-18/IconVolumeXmarkFill18.tsx +17 -0
  108. package/src/icons/nucleo/ui-fill-18/IconXmarkFill18.tsx +17 -0
  109. package/src/icons/nucleo/ui-fill-18/index.ts +13 -0
  110. package/src/icons/nucleo/ui-fill-duo-18/Icon.tsx +27 -0
  111. package/src/icons/nucleo/ui-fill-duo-18/IconBrainNodesFillDuo18.tsx +32 -0
  112. package/src/icons/nucleo/ui-fill-duo-18/IconCloudeCodeFillDuo18.tsx +25 -0
  113. package/src/icons/nucleo/ui-fill-duo-18/IconDatabaseFillDuo18.tsx +24 -0
  114. package/src/icons/nucleo/ui-fill-duo-18/IconDownload4FillDuo18.tsx +18 -0
  115. package/src/icons/nucleo/ui-fill-duo-18/IconEarthFillDuo18.tsx +20 -0
  116. package/src/icons/nucleo/ui-fill-duo-18/IconFinderFillDuo18.tsx +36 -0
  117. package/src/icons/nucleo/ui-fill-duo-18/IconFolderContent2FillDuo18.tsx +22 -0
  118. package/src/icons/nucleo/ui-fill-duo-18/IconGear3FillDuo18.tsx +18 -0
  119. package/src/icons/nucleo/ui-fill-duo-18/IconHistoryFillDuo18.tsx +20 -0
  120. package/src/icons/nucleo/ui-fill-duo-18/IconLockKeyFillDuo18.tsx +24 -0
  121. package/src/icons/nucleo/ui-fill-duo-18/IconNoteFillDuo18.tsx +34 -0
  122. package/src/icons/nucleo/ui-fill-duo-18/IconPenDrawSparkleFillDuo18.tsx +34 -0
  123. package/src/icons/nucleo/ui-fill-duo-18/IconServerFillDuo18.tsx +22 -0
  124. package/src/icons/nucleo/ui-fill-duo-18/IconSpace3dFillDuo18.tsx +24 -0
  125. package/src/icons/nucleo/ui-fill-duo-18/IconTriangleWarningFillDuo18.tsx +24 -0
  126. package/src/icons/nucleo/ui-fill-duo-18/index.ts +16 -0
  127. package/src/icons/nucleo/ui-outline-18/Icon.tsx +27 -0
  128. package/src/icons/nucleo/ui-outline-18/IconArrowDownOutline18.tsx +33 -0
  129. package/src/icons/nucleo/ui-outline-18/IconArrowRightOutline18.tsx +34 -0
  130. package/src/icons/nucleo/ui-outline-18/IconArrowUpRightOutline18.tsx +34 -0
  131. package/src/icons/nucleo/ui-outline-18/IconArrowsOppositeDirectionXOutline18.tsx +54 -0
  132. package/src/icons/nucleo/ui-outline-18/IconArrowsToCenterOutline18.tsx +101 -0
  133. package/src/icons/nucleo/ui-outline-18/IconBanOutline18.tsx +37 -0
  134. package/src/icons/nucleo/ui-outline-18/IconBellDotOutline18.tsx +43 -0
  135. package/src/icons/nucleo/ui-outline-18/IconBookOpen5Outline18.tsx +40 -0
  136. package/src/icons/nucleo/ui-outline-18/IconBookOpenOutline18.tsx +32 -0
  137. package/src/icons/nucleo/ui-outline-18/IconBooks2Outline18.tsx +100 -0
  138. package/src/icons/nucleo/ui-outline-18/IconBoxSparkleOutline18.tsx +75 -0
  139. package/src/icons/nucleo/ui-outline-18/IconBrainOutline18.tsx +57 -0
  140. package/src/icons/nucleo/ui-outline-18/IconBranchOutOutline18.tsx +52 -0
  141. package/src/icons/nucleo/ui-outline-18/IconBugOutline18.tsx +98 -0
  142. package/src/icons/nucleo/ui-outline-18/IconCameraOutline18.tsx +42 -0
  143. package/src/icons/nucleo/ui-outline-18/IconChartPieOutline18.tsx +30 -0
  144. package/src/icons/nucleo/ui-outline-18/IconCheck2Outline18.tsx +23 -0
  145. package/src/icons/nucleo/ui-outline-18/IconCheckOutline18.tsx +23 -0
  146. package/src/icons/nucleo/ui-outline-18/IconChevronDownOutline18.tsx +22 -0
  147. package/src/icons/nucleo/ui-outline-18/IconChevronExpandYOutline18.tsx +31 -0
  148. package/src/icons/nucleo/ui-outline-18/IconChevronLeftOutline18.tsx +22 -0
  149. package/src/icons/nucleo/ui-outline-18/IconChevronReduceYOutline18.tsx +31 -0
  150. package/src/icons/nucleo/ui-outline-18/IconChevronRightOutline18.tsx +22 -0
  151. package/src/icons/nucleo/ui-outline-18/IconChevronUpOutline18.tsx +22 -0
  152. package/src/icons/nucleo/ui-outline-18/IconCircleCheckOutline18.tsx +32 -0
  153. package/src/icons/nucleo/ui-outline-18/IconCircleInfoOutline18.tsx +37 -0
  154. package/src/icons/nucleo/ui-outline-18/IconCircleQuestionOutline18.tsx +39 -0
  155. package/src/icons/nucleo/ui-outline-18/IconClipboardContentOutline18.tsx +60 -0
  156. package/src/icons/nucleo/ui-outline-18/IconClipboardOutline18.tsx +37 -0
  157. package/src/icons/nucleo/ui-outline-18/IconClone2Outline18.tsx +32 -0
  158. package/src/icons/nucleo/ui-outline-18/IconCloneDashed2Outline18.tsx +49 -0
  159. package/src/icons/nucleo/ui-outline-18/IconCodeBranchOutline18.tsx +65 -0
  160. package/src/icons/nucleo/ui-outline-18/IconCodeCommitOutline18.tsx +48 -0
  161. package/src/icons/nucleo/ui-outline-18/IconColorPaletteOutline18.tsx +56 -0
  162. package/src/icons/nucleo/ui-outline-18/IconConnection2Outline18.tsx +43 -0
  163. package/src/icons/nucleo/ui-outline-18/IconCopyIdOutline18.tsx +52 -0
  164. package/src/icons/nucleo/ui-outline-18/IconCopyOutline18.tsx +32 -0
  165. package/src/icons/nucleo/ui-outline-18/IconCreditCardOutline18.tsx +61 -0
  166. package/src/icons/nucleo/ui-outline-18/IconDatabaseSearchOutline18.tsx +64 -0
  167. package/src/icons/nucleo/ui-outline-18/IconDotsOutline18.tsx +46 -0
  168. package/src/icons/nucleo/ui-outline-18/IconDownload4Outline18.tsx +43 -0
  169. package/src/icons/nucleo/ui-outline-18/IconEarthOutline18.tsx +47 -0
  170. package/src/icons/nucleo/ui-outline-18/IconEarthSearchOutline18.tsx +61 -0
  171. package/src/icons/nucleo/ui-outline-18/IconEnvelopeOutline18.tsx +38 -0
  172. package/src/icons/nucleo/ui-outline-18/IconEye2Outline18.tsx +34 -0
  173. package/src/icons/nucleo/ui-outline-18/IconEyeOutline18.tsx +32 -0
  174. package/src/icons/nucleo/ui-outline-18/IconFilePenOutline18.tsx +56 -0
  175. package/src/icons/nucleo/ui-outline-18/IconFileSearchOutline18.tsx +64 -0
  176. package/src/icons/nucleo/ui-outline-18/IconFloppyDiskOutline18.tsx +40 -0
  177. package/src/icons/nucleo/ui-outline-18/IconFolder5Outline18.tsx +37 -0
  178. package/src/icons/nucleo/ui-outline-18/IconFolderCloudOutline18.tsx +39 -0
  179. package/src/icons/nucleo/ui-outline-18/IconFolderOpenOutline18.tsx +31 -0
  180. package/src/icons/nucleo/ui-outline-18/IconFolderOutline18.tsx +32 -0
  181. package/src/icons/nucleo/ui-outline-18/IconFolderPenOutline18.tsx +40 -0
  182. package/src/icons/nucleo/ui-outline-18/IconFolderPlusOutline18.tsx +48 -0
  183. package/src/icons/nucleo/ui-outline-18/IconFolderSearchOutline18.tsx +48 -0
  184. package/src/icons/nucleo/ui-outline-18/IconGear2Outline18.tsx +193 -0
  185. package/src/icons/nucleo/ui-outline-18/IconGear3Outline18.tsx +32 -0
  186. package/src/icons/nucleo/ui-outline-18/IconGlobe3Outline18.tsx +61 -0
  187. package/src/icons/nucleo/ui-outline-18/IconGripDotsVerticalOutline18.tsx +74 -0
  188. package/src/icons/nucleo/ui-outline-18/IconHardDriveOutline18.tsx +40 -0
  189. package/src/icons/nucleo/ui-outline-18/IconHelpChatOutline18.tsx +47 -0
  190. package/src/icons/nucleo/ui-outline-18/IconHotDrinkOutline18.tsx +60 -0
  191. package/src/icons/nucleo/ui-outline-18/IconImageSparkle3Outline18.tsx +41 -0
  192. package/src/icons/nucleo/ui-outline-18/IconKey2Outline18.tsx +61 -0
  193. package/src/icons/nucleo/ui-outline-18/IconLoader6Outline18.tsx +23 -0
  194. package/src/icons/nucleo/ui-outline-18/IconLocation2Outline18.tsx +45 -0
  195. package/src/icons/nucleo/ui-outline-18/IconLockKeyOutline18.tsx +58 -0
  196. package/src/icons/nucleo/ui-outline-18/IconMagicWandOutline18.tsx +32 -0
  197. package/src/icons/nucleo/ui-outline-18/IconMagnifierMinusOutline18.tsx +39 -0
  198. package/src/icons/nucleo/ui-outline-18/IconMagnifierOutline18.tsx +32 -0
  199. package/src/icons/nucleo/ui-outline-18/IconMagnifierPlusOutline18.tsx +48 -0
  200. package/src/icons/nucleo/ui-outline-18/IconMicrophone3Outline18.tsx +57 -0
  201. package/src/icons/nucleo/ui-outline-18/IconMinusOutline18.tsx +25 -0
  202. package/src/icons/nucleo/ui-outline-18/IconMoonOutline18.tsx +23 -0
  203. package/src/icons/nucleo/ui-outline-18/IconMsgSleepOutline18.tsx +41 -0
  204. package/src/icons/nucleo/ui-outline-18/IconMsgWritingOutline18.tsx +42 -0
  205. package/src/icons/nucleo/ui-outline-18/IconMusicOutline18.tsx +67 -0
  206. package/src/icons/nucleo/ui-outline-18/IconOctagonWarningOutline18.tsx +35 -0
  207. package/src/icons/nucleo/ui-outline-18/IconOpenExternalOutline18.tsx +51 -0
  208. package/src/icons/nucleo/ui-outline-18/IconOpenRectArrowInOutline18.tsx +43 -0
  209. package/src/icons/nucleo/ui-outline-18/IconPanelLeftOutline18.tsx +39 -0
  210. package/src/icons/nucleo/ui-outline-18/IconPaperclip2Outline18.tsx +22 -0
  211. package/src/icons/nucleo/ui-outline-18/IconPen2Outline18.tsx +35 -0
  212. package/src/icons/nucleo/ui-outline-18/IconPenDrawSparkleOutline18.tsx +46 -0
  213. package/src/icons/nucleo/ui-outline-18/IconPenOutline18.tsx +23 -0
  214. package/src/icons/nucleo/ui-outline-18/IconPenPlusOutline18.tsx +47 -0
  215. package/src/icons/nucleo/ui-outline-18/IconPenWriting3Outline18.tsx +31 -0
  216. package/src/icons/nucleo/ui-outline-18/IconPhoneOutline18.tsx +23 -0
  217. package/src/icons/nucleo/ui-outline-18/IconPinTackOutline18.tsx +35 -0
  218. package/src/icons/nucleo/ui-outline-18/IconPinTackSlashOutline18.tsx +47 -0
  219. package/src/icons/nucleo/ui-outline-18/IconPlusOutline18.tsx +38 -0
  220. package/src/icons/nucleo/ui-outline-18/IconPowerOffOutline18.tsx +36 -0
  221. package/src/icons/nucleo/ui-outline-18/IconPresentationScreenVideoOutline18.tsx +55 -0
  222. package/src/icons/nucleo/ui-outline-18/IconPuzzlePieceOutline18.tsx +22 -0
  223. package/src/icons/nucleo/ui-outline-18/IconRedoOutline18.tsx +32 -0
  224. package/src/icons/nucleo/ui-outline-18/IconRefreshAnticlockwiseOutline18.tsx +48 -0
  225. package/src/icons/nucleo/ui-outline-18/IconReuseOutline18.tsx +50 -0
  226. package/src/icons/nucleo/ui-outline-18/IconSearchContentOutline18.tsx +81 -0
  227. package/src/icons/nucleo/ui-outline-18/IconServerOutline18.tsx +73 -0
  228. package/src/icons/nucleo/ui-outline-18/IconSideProfileSparkleOutline18.tsx +28 -0
  229. package/src/icons/nucleo/ui-outline-18/IconSidebarLeftHideOutline18.tsx +49 -0
  230. package/src/icons/nucleo/ui-outline-18/IconSidebarLeftShowOutline18.tsx +49 -0
  231. package/src/icons/nucleo/ui-outline-18/IconSidebarRightHideOutline18.tsx +48 -0
  232. package/src/icons/nucleo/ui-outline-18/IconSidebarRightShowOutline18.tsx +48 -0
  233. package/src/icons/nucleo/ui-outline-18/IconSparkleOutline18.tsx +43 -0
  234. package/src/icons/nucleo/ui-outline-18/IconSpeakerOutline18.tsx +47 -0
  235. package/src/icons/nucleo/ui-outline-18/IconSplitViewOutline18.tsx +32 -0
  236. package/src/icons/nucleo/ui-outline-18/IconSquareCodeOutline18.tsx +40 -0
  237. package/src/icons/nucleo/ui-outline-18/IconSquareDashedOutline18.tsx +94 -0
  238. package/src/icons/nucleo/ui-outline-18/IconSquareTerminalOutline18.tsx +48 -0
  239. package/src/icons/nucleo/ui-outline-18/IconSunOutline18.tsx +121 -0
  240. package/src/icons/nucleo/ui-outline-18/IconTerminalOutline18.tsx +35 -0
  241. package/src/icons/nucleo/ui-outline-18/IconTextAlignLeft2Outline18.tsx +60 -0
  242. package/src/icons/nucleo/ui-outline-18/IconTextBgColorOutline18.tsx +48 -0
  243. package/src/icons/nucleo/ui-outline-18/IconTextColorOutline18.tsx +48 -0
  244. package/src/icons/nucleo/ui-outline-18/IconThumbsDownOutline18.tsx +36 -0
  245. package/src/icons/nucleo/ui-outline-18/IconThumbsUpOutline18.tsx +37 -0
  246. package/src/icons/nucleo/ui-outline-18/IconTrashOutline18.tsx +41 -0
  247. package/src/icons/nucleo/ui-outline-18/IconTriangleWarningOutline18.tsx +37 -0
  248. package/src/icons/nucleo/ui-outline-18/IconUndoOutline18.tsx +32 -0
  249. package/src/icons/nucleo/ui-outline-18/IconVersionsOutline18.tsx +46 -0
  250. package/src/icons/nucleo/ui-outline-18/IconVideoOutline18.tsx +45 -0
  251. package/src/icons/nucleo/ui-outline-18/IconWaveformLinesOutline18.tsx +80 -0
  252. package/src/icons/nucleo/ui-outline-18/IconWindowCodeOutline18.tsx +62 -0
  253. package/src/icons/nucleo/ui-outline-18/IconWindowPointerOutline18.tsx +51 -0
  254. package/src/icons/nucleo/ui-outline-18/IconXmarkOutline18.tsx +38 -0
  255. package/src/icons/nucleo/ui-outline-18/index.ts +128 -0
  256. package/src/index.ts +66 -0
  257. package/src/lib/utils.ts +6 -0
  258. package/src/plugin/index.ts +611 -0
  259. package/src/styles/animations.css +59 -0
  260. package/src/styles/bridge.css +117 -0
  261. package/src/styles/derived-utilities.css +179 -0
  262. package/src/styles/fonts.css +23 -0
  263. package/src/styles/index.css +72 -0
  264. package/src/styles/palette.css +189 -0
  265. package/src/styles/tailwind-tokens.css +56 -0
  266. package/src/styles/theme.css +103 -0
@@ -0,0 +1,103 @@
1
+ import * as React from "react"
2
+
3
+ import { cn } from "../../lib/utils"
4
+
5
+ function Card({
6
+ className,
7
+ size = "default",
8
+ ...props
9
+ }: React.ComponentProps<"div"> & { size?: "default" | "sm" }) {
10
+ return (
11
+ <div
12
+ data-slot="card"
13
+ data-size={size}
14
+ className={cn(
15
+ "group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl",
16
+ className
17
+ )}
18
+ {...props}
19
+ />
20
+ )
21
+ }
22
+
23
+ function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
24
+ return (
25
+ <div
26
+ data-slot="card-header"
27
+ className={cn(
28
+ "group/card-header @container/card-header grid auto-rows-min items-start gap-0.5 rounded-t-xl px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)",
29
+ className
30
+ )}
31
+ {...props}
32
+ />
33
+ )
34
+ }
35
+
36
+ function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
37
+ return (
38
+ <div
39
+ data-slot="card-title"
40
+ className={cn(
41
+ "font-heading text-base leading-snug font-medium group-data-[size=sm]/card:text-sm",
42
+ className
43
+ )}
44
+ {...props}
45
+ />
46
+ )
47
+ }
48
+
49
+ function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
50
+ return (
51
+ <div
52
+ data-slot="card-description"
53
+ className={cn("text-sm text-muted-foreground", className)}
54
+ {...props}
55
+ />
56
+ )
57
+ }
58
+
59
+ function CardAction({ className, ...props }: React.ComponentProps<"div">) {
60
+ return (
61
+ <div
62
+ data-slot="card-action"
63
+ className={cn(
64
+ "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
65
+ className
66
+ )}
67
+ {...props}
68
+ />
69
+ )
70
+ }
71
+
72
+ function CardContent({ className, ...props }: React.ComponentProps<"div">) {
73
+ return (
74
+ <div
75
+ data-slot="card-content"
76
+ className={cn("px-(--card-spacing)", className)}
77
+ {...props}
78
+ />
79
+ )
80
+ }
81
+
82
+ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
83
+ return (
84
+ <div
85
+ data-slot="card-footer"
86
+ className={cn(
87
+ "flex flex-row-reverse items-center gap-2 rounded-b-xl border-t bg-muted/50 p-(--card-spacing)",
88
+ className
89
+ )}
90
+ {...props}
91
+ />
92
+ )
93
+ }
94
+
95
+ export {
96
+ Card,
97
+ CardHeader,
98
+ CardFooter,
99
+ CardTitle,
100
+ CardAction,
101
+ CardDescription,
102
+ CardContent,
103
+ }
@@ -0,0 +1,240 @@
1
+ import * as React from "react"
2
+ import useEmblaCarousel, {
3
+ type UseEmblaCarouselType,
4
+ } from "embla-carousel-react"
5
+
6
+ import { cn } from "../../lib/utils"
7
+ import { Button } from "./button"
8
+ import { IconChevronLeftOutline18, IconChevronRightOutline18 } from "../../icons"
9
+
10
+ type CarouselApi = UseEmblaCarouselType[1]
11
+ type UseCarouselParameters = Parameters<typeof useEmblaCarousel>
12
+ type CarouselOptions = UseCarouselParameters[0]
13
+ type CarouselPlugin = UseCarouselParameters[1]
14
+
15
+ type CarouselProps = {
16
+ opts?: CarouselOptions
17
+ plugins?: CarouselPlugin
18
+ orientation?: "horizontal" | "vertical"
19
+ setApi?: (api: CarouselApi) => void
20
+ }
21
+
22
+ type CarouselContextProps = {
23
+ carouselRef: ReturnType<typeof useEmblaCarousel>[0]
24
+ api: ReturnType<typeof useEmblaCarousel>[1]
25
+ scrollPrev: () => void
26
+ scrollNext: () => void
27
+ canScrollPrev: boolean
28
+ canScrollNext: boolean
29
+ } & CarouselProps
30
+
31
+ const CarouselContext = React.createContext<CarouselContextProps | null>(null)
32
+
33
+ function useCarousel() {
34
+ const context = React.useContext(CarouselContext)
35
+
36
+ if (!context) {
37
+ throw new Error("useCarousel must be used within a <Carousel />")
38
+ }
39
+
40
+ return context
41
+ }
42
+
43
+ function Carousel({
44
+ orientation = "horizontal",
45
+ opts,
46
+ setApi,
47
+ plugins,
48
+ className,
49
+ children,
50
+ ...props
51
+ }: React.ComponentProps<"div"> & CarouselProps) {
52
+ const [carouselRef, api] = useEmblaCarousel(
53
+ {
54
+ ...opts,
55
+ axis: orientation === "horizontal" ? "x" : "y",
56
+ },
57
+ plugins
58
+ )
59
+ const [canScrollPrev, setCanScrollPrev] = React.useState(false)
60
+ const [canScrollNext, setCanScrollNext] = React.useState(false)
61
+
62
+ const onSelect = React.useCallback((api: CarouselApi) => {
63
+ if (!api) return
64
+ setCanScrollPrev(api.canScrollPrev())
65
+ setCanScrollNext(api.canScrollNext())
66
+ }, [])
67
+
68
+ const scrollPrev = React.useCallback(() => {
69
+ api?.scrollPrev()
70
+ }, [api])
71
+
72
+ const scrollNext = React.useCallback(() => {
73
+ api?.scrollNext()
74
+ }, [api])
75
+
76
+ const handleKeyDown = React.useCallback(
77
+ (event: React.KeyboardEvent<HTMLDivElement>) => {
78
+ if (event.key === "ArrowLeft") {
79
+ event.preventDefault()
80
+ scrollPrev()
81
+ } else if (event.key === "ArrowRight") {
82
+ event.preventDefault()
83
+ scrollNext()
84
+ }
85
+ },
86
+ [scrollPrev, scrollNext]
87
+ )
88
+
89
+ React.useEffect(() => {
90
+ if (!api || !setApi) return
91
+ setApi(api)
92
+ }, [api, setApi])
93
+
94
+ React.useEffect(() => {
95
+ if (!api) return
96
+ onSelect(api)
97
+ api.on("reInit", onSelect)
98
+ api.on("select", onSelect)
99
+
100
+ return () => {
101
+ api?.off("select", onSelect)
102
+ }
103
+ }, [api, onSelect])
104
+
105
+ return (
106
+ <CarouselContext.Provider
107
+ value={{
108
+ carouselRef,
109
+ api: api,
110
+ opts,
111
+ orientation:
112
+ orientation || (opts?.axis === "y" ? "vertical" : "horizontal"),
113
+ scrollPrev,
114
+ scrollNext,
115
+ canScrollPrev,
116
+ canScrollNext,
117
+ }}
118
+ >
119
+ <div
120
+ onKeyDownCapture={handleKeyDown}
121
+ className={cn("relative", className)}
122
+ role="region"
123
+ aria-roledescription="carousel"
124
+ data-slot="carousel"
125
+ {...props}
126
+ >
127
+ {children}
128
+ </div>
129
+ </CarouselContext.Provider>
130
+ )
131
+ }
132
+
133
+ function CarouselContent({ className, ...props }: React.ComponentProps<"div">) {
134
+ const { carouselRef, orientation } = useCarousel()
135
+
136
+ return (
137
+ <div
138
+ ref={carouselRef}
139
+ className="overflow-hidden"
140
+ data-slot="carousel-content"
141
+ >
142
+ <div
143
+ className={cn(
144
+ "flex",
145
+ orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col",
146
+ className
147
+ )}
148
+ {...props}
149
+ />
150
+ </div>
151
+ )
152
+ }
153
+
154
+ function CarouselItem({ className, ...props }: React.ComponentProps<"div">) {
155
+ const { orientation } = useCarousel()
156
+
157
+ return (
158
+ <div
159
+ role="group"
160
+ aria-roledescription="slide"
161
+ data-slot="carousel-item"
162
+ className={cn(
163
+ "min-w-0 shrink-0 grow-0 basis-full",
164
+ orientation === "horizontal" ? "pl-4" : "pt-4",
165
+ className
166
+ )}
167
+ {...props}
168
+ />
169
+ )
170
+ }
171
+
172
+ function CarouselPrevious({
173
+ className,
174
+ variant = "outline",
175
+ size = "icon-sm",
176
+ ...props
177
+ }: React.ComponentProps<typeof Button>) {
178
+ const { orientation, scrollPrev, canScrollPrev } = useCarousel()
179
+
180
+ return (
181
+ <Button
182
+ data-slot="carousel-previous"
183
+ variant={variant}
184
+ size={size}
185
+ className={cn(
186
+ "absolute touch-manipulation rounded-full",
187
+ orientation === "horizontal"
188
+ ? "inset-y-0 -left-12 my-auto"
189
+ : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
190
+ className
191
+ )}
192
+ disabled={!canScrollPrev}
193
+ onClick={scrollPrev}
194
+ {...props}
195
+ >
196
+ <IconChevronLeftOutline18 />
197
+ <span className="sr-only">Previous slide</span>
198
+ </Button>
199
+ )
200
+ }
201
+
202
+ function CarouselNext({
203
+ className,
204
+ variant = "outline",
205
+ size = "icon-sm",
206
+ ...props
207
+ }: React.ComponentProps<typeof Button>) {
208
+ const { orientation, scrollNext, canScrollNext } = useCarousel()
209
+
210
+ return (
211
+ <Button
212
+ data-slot="carousel-next"
213
+ variant={variant}
214
+ size={size}
215
+ className={cn(
216
+ "absolute touch-manipulation rounded-full",
217
+ orientation === "horizontal"
218
+ ? "inset-y-0 -right-12 my-auto"
219
+ : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
220
+ className
221
+ )}
222
+ disabled={!canScrollNext}
223
+ onClick={scrollNext}
224
+ {...props}
225
+ >
226
+ <IconChevronRightOutline18 />
227
+ <span className="sr-only">Next slide</span>
228
+ </Button>
229
+ )
230
+ }
231
+
232
+ export {
233
+ type CarouselApi,
234
+ Carousel,
235
+ CarouselContent,
236
+ CarouselItem,
237
+ CarouselPrevious,
238
+ CarouselNext,
239
+ useCarousel,
240
+ }
@@ -0,0 +1,371 @@
1
+ import * as React from "react"
2
+ import * as RechartsPrimitive from "recharts"
3
+ import type { TooltipValueType } from "recharts"
4
+
5
+ import { cn } from "../../lib/utils"
6
+
7
+ // Format: { THEME_NAME: CSS_SELECTOR }
8
+ const THEMES = { light: "", dark: ".dark" } as const
9
+
10
+ const INITIAL_DIMENSION = { width: 320, height: 200 } as const
11
+ type TooltipNameType = number | string
12
+
13
+ export type ChartConfig = Record<
14
+ string,
15
+ {
16
+ label?: React.ReactNode
17
+ icon?: React.ComponentType
18
+ } & (
19
+ | { color?: string; theme?: never }
20
+ | { color?: never; theme: Record<keyof typeof THEMES, string> }
21
+ )
22
+ >
23
+
24
+ type ChartContextProps = {
25
+ config: ChartConfig
26
+ }
27
+
28
+ const ChartContext = React.createContext<ChartContextProps | null>(null)
29
+
30
+ function useChart() {
31
+ const context = React.useContext(ChartContext)
32
+
33
+ if (!context) {
34
+ throw new Error("useChart must be used within a <ChartContainer />")
35
+ }
36
+
37
+ return context
38
+ }
39
+
40
+ function ChartContainer({
41
+ id,
42
+ className,
43
+ children,
44
+ config,
45
+ initialDimension = INITIAL_DIMENSION,
46
+ ...props
47
+ }: React.ComponentProps<"div"> & {
48
+ config: ChartConfig
49
+ children: React.ComponentProps<
50
+ typeof RechartsPrimitive.ResponsiveContainer
51
+ >["children"]
52
+ initialDimension?: {
53
+ width: number
54
+ height: number
55
+ }
56
+ }) {
57
+ const uniqueId = React.useId()
58
+ const chartId = `chart-${id ?? uniqueId.replace(/:/g, "")}`
59
+
60
+ return (
61
+ <ChartContext.Provider value={{ config }}>
62
+ <div
63
+ data-slot="chart"
64
+ data-chart={chartId}
65
+ className={cn(
66
+ "flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden",
67
+ className
68
+ )}
69
+ {...props}
70
+ >
71
+ <ChartStyle id={chartId} config={config} />
72
+ <RechartsPrimitive.ResponsiveContainer
73
+ initialDimension={initialDimension}
74
+ >
75
+ {children}
76
+ </RechartsPrimitive.ResponsiveContainer>
77
+ </div>
78
+ </ChartContext.Provider>
79
+ )
80
+ }
81
+
82
+ const ChartStyle = ({ id, config }: { id: string; config: ChartConfig }) => {
83
+ const colorConfig = Object.entries(config).filter(
84
+ ([, config]) => config.theme ?? config.color
85
+ )
86
+
87
+ if (!colorConfig.length) {
88
+ return null
89
+ }
90
+
91
+ return (
92
+ <style
93
+ dangerouslySetInnerHTML={{
94
+ __html: Object.entries(THEMES)
95
+ .map(
96
+ ([theme, prefix]) => `
97
+ ${prefix} [data-chart=${id}] {
98
+ ${colorConfig
99
+ .map(([key, itemConfig]) => {
100
+ const color =
101
+ itemConfig.theme?.[theme as keyof typeof itemConfig.theme] ??
102
+ itemConfig.color
103
+ return color ? ` --color-${key}: ${color};` : null
104
+ })
105
+ .join("\n")}
106
+ }
107
+ `
108
+ )
109
+ .join("\n"),
110
+ }}
111
+ />
112
+ )
113
+ }
114
+
115
+ const ChartTooltip = RechartsPrimitive.Tooltip
116
+
117
+ function ChartTooltipContent({
118
+ active,
119
+ payload,
120
+ className,
121
+ indicator = "dot",
122
+ hideLabel = false,
123
+ hideIndicator = false,
124
+ label,
125
+ labelFormatter,
126
+ labelClassName,
127
+ formatter,
128
+ color,
129
+ nameKey,
130
+ labelKey,
131
+ }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> &
132
+ React.ComponentProps<"div"> & {
133
+ hideLabel?: boolean
134
+ hideIndicator?: boolean
135
+ indicator?: "line" | "dot" | "dashed"
136
+ nameKey?: string
137
+ labelKey?: string
138
+ } & Omit<
139
+ RechartsPrimitive.DefaultTooltipContentProps<
140
+ TooltipValueType,
141
+ TooltipNameType
142
+ >,
143
+ "accessibilityLayer"
144
+ >) {
145
+ const { config } = useChart()
146
+
147
+ const tooltipLabel = React.useMemo(() => {
148
+ if (hideLabel || !payload?.length) {
149
+ return null
150
+ }
151
+
152
+ const [item] = payload
153
+ const key = `${labelKey ?? item?.dataKey ?? item?.name ?? "value"}`
154
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
155
+ const value =
156
+ !labelKey && typeof label === "string"
157
+ ? (config[label]?.label ?? label)
158
+ : itemConfig?.label
159
+
160
+ if (labelFormatter) {
161
+ return (
162
+ <div className={cn("font-medium", labelClassName)}>
163
+ {labelFormatter(value, payload)}
164
+ </div>
165
+ )
166
+ }
167
+
168
+ if (!value) {
169
+ return null
170
+ }
171
+
172
+ return <div className={cn("font-medium", labelClassName)}>{value}</div>
173
+ }, [
174
+ label,
175
+ labelFormatter,
176
+ payload,
177
+ hideLabel,
178
+ labelClassName,
179
+ config,
180
+ labelKey,
181
+ ])
182
+
183
+ if (!active || !payload?.length) {
184
+ return null
185
+ }
186
+
187
+ const nestLabel = payload.length === 1 && indicator !== "dot"
188
+
189
+ return (
190
+ <div
191
+ className={cn(
192
+ "grid min-w-32 items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",
193
+ className
194
+ )}
195
+ >
196
+ {!nestLabel ? tooltipLabel : null}
197
+ <div className="grid gap-1.5">
198
+ {payload
199
+ .filter((item) => item.type !== "none")
200
+ .map((item, index) => {
201
+ const key = `${nameKey ?? item.name ?? item.dataKey ?? "value"}`
202
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
203
+ const indicatorColor = color ?? item.payload?.fill ?? item.color
204
+
205
+ return (
206
+ <div
207
+ key={index}
208
+ className={cn(
209
+ "flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",
210
+ indicator === "dot" && "items-center"
211
+ )}
212
+ >
213
+ {formatter && item?.value !== undefined && item.name ? (
214
+ formatter(item.value, item.name, item, index, item.payload)
215
+ ) : (
216
+ <>
217
+ {itemConfig?.icon ? (
218
+ <itemConfig.icon />
219
+ ) : (
220
+ !hideIndicator && (
221
+ <div
222
+ className={cn(
223
+ "shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)",
224
+ {
225
+ "h-2.5 w-2.5": indicator === "dot",
226
+ "w-1": indicator === "line",
227
+ "w-0 border-[1.5px] border-dashed bg-transparent":
228
+ indicator === "dashed",
229
+ "my-0.5": nestLabel && indicator === "dashed",
230
+ }
231
+ )}
232
+ style={
233
+ {
234
+ "--color-bg": indicatorColor,
235
+ "--color-border": indicatorColor,
236
+ } as React.CSSProperties
237
+ }
238
+ />
239
+ )
240
+ )}
241
+ <div
242
+ className={cn(
243
+ "flex flex-1 justify-between leading-none",
244
+ nestLabel ? "items-end" : "items-center"
245
+ )}
246
+ >
247
+ <div className="grid gap-1.5">
248
+ {nestLabel ? tooltipLabel : null}
249
+ <span className="text-muted-foreground">
250
+ {itemConfig?.label ?? item.name}
251
+ </span>
252
+ </div>
253
+ {item.value != null && (
254
+ <span className="font-mono font-medium text-foreground tabular-nums">
255
+ {typeof item.value === "number"
256
+ ? item.value.toLocaleString()
257
+ : String(item.value)}
258
+ </span>
259
+ )}
260
+ </div>
261
+ </>
262
+ )}
263
+ </div>
264
+ )
265
+ })}
266
+ </div>
267
+ </div>
268
+ )
269
+ }
270
+
271
+ const ChartLegend = RechartsPrimitive.Legend
272
+
273
+ function ChartLegendContent({
274
+ className,
275
+ hideIcon = false,
276
+ payload,
277
+ verticalAlign = "bottom",
278
+ nameKey,
279
+ }: React.ComponentProps<"div"> & {
280
+ hideIcon?: boolean
281
+ nameKey?: string
282
+ } & RechartsPrimitive.DefaultLegendContentProps) {
283
+ const { config } = useChart()
284
+
285
+ if (!payload?.length) {
286
+ return null
287
+ }
288
+
289
+ return (
290
+ <div
291
+ className={cn(
292
+ "flex items-center justify-center gap-4",
293
+ verticalAlign === "top" ? "pb-3" : "pt-3",
294
+ className
295
+ )}
296
+ >
297
+ {payload
298
+ .filter((item) => item.type !== "none")
299
+ .map((item, index) => {
300
+ const key = `${nameKey ?? item.dataKey ?? "value"}`
301
+ const itemConfig = getPayloadConfigFromPayload(config, item, key)
302
+
303
+ return (
304
+ <div
305
+ key={index}
306
+ className={cn(
307
+ "flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"
308
+ )}
309
+ >
310
+ {itemConfig?.icon && !hideIcon ? (
311
+ <itemConfig.icon />
312
+ ) : (
313
+ <div
314
+ className="h-2 w-2 shrink-0 rounded-[2px]"
315
+ style={{
316
+ backgroundColor: item.color,
317
+ }}
318
+ />
319
+ )}
320
+ {itemConfig?.label}
321
+ </div>
322
+ )
323
+ })}
324
+ </div>
325
+ )
326
+ }
327
+
328
+ function getPayloadConfigFromPayload(
329
+ config: ChartConfig,
330
+ payload: unknown,
331
+ key: string
332
+ ) {
333
+ if (typeof payload !== "object" || payload === null) {
334
+ return undefined
335
+ }
336
+
337
+ const payloadPayload =
338
+ "payload" in payload &&
339
+ typeof payload.payload === "object" &&
340
+ payload.payload !== null
341
+ ? payload.payload
342
+ : undefined
343
+
344
+ let configLabelKey: string = key
345
+
346
+ if (
347
+ key in payload &&
348
+ typeof payload[key as keyof typeof payload] === "string"
349
+ ) {
350
+ configLabelKey = payload[key as keyof typeof payload] as string
351
+ } else if (
352
+ payloadPayload &&
353
+ key in payloadPayload &&
354
+ typeof payloadPayload[key as keyof typeof payloadPayload] === "string"
355
+ ) {
356
+ configLabelKey = payloadPayload[
357
+ key as keyof typeof payloadPayload
358
+ ] as string
359
+ }
360
+
361
+ return configLabelKey in config ? config[configLabelKey] : config[key]
362
+ }
363
+
364
+ export {
365
+ ChartContainer,
366
+ ChartTooltip,
367
+ ChartTooltipContent,
368
+ ChartLegend,
369
+ ChartLegendContent,
370
+ ChartStyle,
371
+ }