@hewnui/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 (367) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +69 -2
  3. package/dist/chart/axes.d.ts +31 -0
  4. package/dist/chart/axes.js +20 -0
  5. package/dist/chart/colors.d.ts +1 -0
  6. package/dist/chart/colors.js +13 -0
  7. package/dist/chart/frame.d.ts +13 -0
  8. package/dist/chart/frame.js +17 -0
  9. package/dist/chart/interaction.d.ts +22 -0
  10. package/dist/chart/interaction.js +22 -0
  11. package/dist/chart/path.d.ts +10 -0
  12. package/dist/chart/path.js +24 -0
  13. package/dist/chart/scales.d.ts +34 -0
  14. package/dist/chart/scales.js +66 -0
  15. package/dist/chart/status.d.ts +3 -0
  16. package/dist/chart/status.js +15 -0
  17. package/dist/chart/types.d.ts +34 -0
  18. package/dist/chart/types.js +6 -0
  19. package/dist/components/area-chart/area-chart.d.ts +17 -0
  20. package/dist/components/area-chart/area-chart.js +54 -0
  21. package/dist/components/area-chart/index.d.ts +1 -0
  22. package/dist/components/area-chart/index.js +1 -0
  23. package/dist/components/badge/badge.d.ts +2 -0
  24. package/dist/components/badge/badge.js +5 -0
  25. package/dist/components/badge/badge.styles.d.ts +8 -0
  26. package/dist/components/badge/badge.styles.js +57 -0
  27. package/dist/components/badge/badge.types.d.ts +11 -0
  28. package/dist/components/badge/badge.types.js +1 -0
  29. package/dist/components/badge/index.d.ts +3 -0
  30. package/dist/components/badge/index.js +2 -0
  31. package/dist/components/bar-chart/bar-chart.d.ts +17 -0
  32. package/dist/components/bar-chart/bar-chart.js +73 -0
  33. package/dist/components/bar-chart/index.d.ts +1 -0
  34. package/dist/components/bar-chart/index.js +1 -0
  35. package/dist/components/breadcrumbs/breadcrumbs.d.ts +3 -0
  36. package/dist/components/breadcrumbs/breadcrumbs.js +13 -0
  37. package/dist/components/breadcrumbs/breadcrumbs.styles.d.ts +5 -0
  38. package/dist/components/breadcrumbs/breadcrumbs.styles.js +10 -0
  39. package/dist/components/breadcrumbs/breadcrumbs.types.d.ts +16 -0
  40. package/dist/components/breadcrumbs/breadcrumbs.types.js +1 -0
  41. package/dist/components/breadcrumbs/index.d.ts +2 -0
  42. package/dist/components/breadcrumbs/index.js +1 -0
  43. package/dist/components/button/button.d.ts +2 -0
  44. package/dist/components/button/button.js +18 -0
  45. package/dist/components/button/button.motion.d.ts +23 -0
  46. package/dist/components/button/button.motion.js +11 -0
  47. package/dist/components/button/button.styles.d.ts +10 -0
  48. package/dist/components/button/button.styles.js +24 -0
  49. package/dist/components/button/button.types.d.ts +11 -0
  50. package/dist/components/button/button.types.js +1 -0
  51. package/dist/components/button/index.d.ts +2 -0
  52. package/dist/components/button/index.js +1 -0
  53. package/dist/components/card/card.d.ts +21 -0
  54. package/dist/components/card/card.js +19 -0
  55. package/dist/components/card/card.styles.d.ts +4 -0
  56. package/dist/components/card/card.styles.js +13 -0
  57. package/dist/components/card/card.types.d.ts +4 -0
  58. package/dist/components/card/card.types.js +1 -0
  59. package/dist/components/card/index.d.ts +2 -0
  60. package/dist/components/card/index.js +1 -0
  61. package/dist/components/checkbox/checkbox.d.ts +2 -0
  62. package/dist/components/checkbox/checkbox.js +17 -0
  63. package/dist/components/checkbox/checkbox.styles.d.ts +3 -0
  64. package/dist/components/checkbox/checkbox.styles.js +6 -0
  65. package/dist/components/checkbox/checkbox.types.d.ts +6 -0
  66. package/dist/components/checkbox/checkbox.types.js +1 -0
  67. package/dist/components/checkbox/index.d.ts +2 -0
  68. package/dist/components/checkbox/index.js +1 -0
  69. package/dist/components/checkbox-group/checkbox-group.d.ts +2 -0
  70. package/dist/components/checkbox-group/checkbox-group.js +8 -0
  71. package/dist/components/checkbox-group/checkbox-group.styles.d.ts +2 -0
  72. package/dist/components/checkbox-group/checkbox-group.styles.js +5 -0
  73. package/dist/components/checkbox-group/checkbox-group.types.d.ts +9 -0
  74. package/dist/components/checkbox-group/checkbox-group.types.js +1 -0
  75. package/dist/components/checkbox-group/index.d.ts +2 -0
  76. package/dist/components/checkbox-group/index.js +1 -0
  77. package/dist/components/color-picker/color-picker.d.ts +2 -0
  78. package/dist/components/color-picker/color-picker.js +27 -0
  79. package/dist/components/color-picker/color-picker.oklch.d.ts +2 -0
  80. package/dist/components/color-picker/color-picker.oklch.js +54 -0
  81. package/dist/components/color-picker/color-picker.panel.d.ts +2 -0
  82. package/dist/components/color-picker/color-picker.panel.js +15 -0
  83. package/dist/components/color-picker/color-picker.styles.d.ts +16 -0
  84. package/dist/components/color-picker/color-picker.styles.js +28 -0
  85. package/dist/components/color-picker/color-picker.types.d.ts +36 -0
  86. package/dist/components/color-picker/color-picker.types.js +1 -0
  87. package/dist/components/color-picker/index.d.ts +4 -0
  88. package/dist/components/color-picker/index.js +3 -0
  89. package/dist/components/combobox/combobox.d.ts +15 -0
  90. package/dist/components/combobox/combobox.js +11 -0
  91. package/dist/components/combobox/index.d.ts +1 -0
  92. package/dist/components/combobox/index.js +1 -0
  93. package/dist/components/command-palette/command-palette-items.d.ts +4 -0
  94. package/dist/components/command-palette/command-palette-items.js +14 -0
  95. package/dist/components/command-palette/command-palette.d.ts +15 -0
  96. package/dist/components/command-palette/command-palette.hotkey.d.ts +8 -0
  97. package/dist/components/command-palette/command-palette.hotkey.js +51 -0
  98. package/dist/components/command-palette/command-palette.js +33 -0
  99. package/dist/components/command-palette/command-palette.styles.d.ts +13 -0
  100. package/dist/components/command-palette/command-palette.styles.js +25 -0
  101. package/dist/components/command-palette/command-palette.types.d.ts +65 -0
  102. package/dist/components/command-palette/command-palette.types.js +1 -0
  103. package/dist/components/command-palette/index.d.ts +14 -0
  104. package/dist/components/command-palette/index.js +13 -0
  105. package/dist/components/data-table/data-table.d.ts +7 -0
  106. package/dist/components/data-table/data-table.js +31 -0
  107. package/dist/components/data-table/index.d.ts +1 -0
  108. package/dist/components/data-table/index.js +1 -0
  109. package/dist/components/date-picker/date-picker.d.ts +7 -0
  110. package/dist/components/date-picker/date-picker.js +8 -0
  111. package/dist/components/date-picker/index.d.ts +1 -0
  112. package/dist/components/date-picker/index.js +1 -0
  113. package/dist/components/date-range-picker/date-range-picker.calendar.d.ts +5 -0
  114. package/dist/components/date-range-picker/date-range-picker.calendar.js +21 -0
  115. package/dist/components/date-range-picker/date-range-picker.d.ts +2 -0
  116. package/dist/components/date-range-picker/date-range-picker.js +9 -0
  117. package/dist/components/date-range-picker/date-range-picker.presets.d.ts +3 -0
  118. package/dist/components/date-range-picker/date-range-picker.presets.js +53 -0
  119. package/dist/components/date-range-picker/date-range-picker.styles.d.ts +11 -0
  120. package/dist/components/date-range-picker/date-range-picker.styles.js +14 -0
  121. package/dist/components/date-range-picker/date-range-picker.types.d.ts +28 -0
  122. package/dist/components/date-range-picker/date-range-picker.types.js +1 -0
  123. package/dist/components/date-range-picker/index.d.ts +2 -0
  124. package/dist/components/date-range-picker/index.js +1 -0
  125. package/dist/components/dialog/dialog.d.ts +18 -0
  126. package/dist/components/dialog/dialog.js +16 -0
  127. package/dist/components/dialog/dialog.styles.d.ts +6 -0
  128. package/dist/components/dialog/dialog.styles.js +9 -0
  129. package/dist/components/dialog/index.d.ts +7 -0
  130. package/dist/components/dialog/index.js +7 -0
  131. package/dist/components/donut-chart/donut-chart.d.ts +17 -0
  132. package/dist/components/donut-chart/donut-chart.js +65 -0
  133. package/dist/components/donut-chart/index.d.ts +1 -0
  134. package/dist/components/donut-chart/index.js +1 -0
  135. package/dist/components/drawer/drawer.d.ts +13 -0
  136. package/dist/components/drawer/drawer.js +14 -0
  137. package/dist/components/drawer/index.d.ts +1 -0
  138. package/dist/components/drawer/index.js +1 -0
  139. package/dist/components/empty/empty.d.ts +7 -0
  140. package/dist/components/empty/empty.js +5 -0
  141. package/dist/components/empty/index.d.ts +1 -0
  142. package/dist/components/empty/index.js +1 -0
  143. package/dist/components/file-upload/file-upload.d.ts +2 -0
  144. package/dist/components/file-upload/file-upload.js +44 -0
  145. package/dist/components/file-upload/file-upload.styles.d.ts +12 -0
  146. package/dist/components/file-upload/file-upload.styles.js +14 -0
  147. package/dist/components/file-upload/file-upload.types.d.ts +16 -0
  148. package/dist/components/file-upload/file-upload.types.js +1 -0
  149. package/dist/components/file-upload/index.d.ts +2 -0
  150. package/dist/components/file-upload/index.js +1 -0
  151. package/dist/components/form/form.d.ts +2 -0
  152. package/dist/components/form/form.js +7 -0
  153. package/dist/components/form/form.styles.d.ts +1 -0
  154. package/dist/components/form/form.styles.js +4 -0
  155. package/dist/components/form/form.types.d.ts +6 -0
  156. package/dist/components/form/form.types.js +1 -0
  157. package/dist/components/form/index.d.ts +2 -0
  158. package/dist/components/form/index.js +1 -0
  159. package/dist/components/input-group/index.d.ts +2 -0
  160. package/dist/components/input-group/index.js +1 -0
  161. package/dist/components/input-group/input-group.d.ts +14 -0
  162. package/dist/components/input-group/input-group.js +24 -0
  163. package/dist/components/input-group/input-group.styles.d.ts +8 -0
  164. package/dist/components/input-group/input-group.styles.js +9 -0
  165. package/dist/components/input-group/input-group.types.d.ts +22 -0
  166. package/dist/components/input-group/input-group.types.js +1 -0
  167. package/dist/components/input-otp/index.d.ts +2 -0
  168. package/dist/components/input-otp/index.js +1 -0
  169. package/dist/components/input-otp/input-otp.d.ts +2 -0
  170. package/dist/components/input-otp/input-otp.js +76 -0
  171. package/dist/components/input-otp/input-otp.styles.d.ts +8 -0
  172. package/dist/components/input-otp/input-otp.styles.js +11 -0
  173. package/dist/components/input-otp/input-otp.types.d.ts +23 -0
  174. package/dist/components/input-otp/input-otp.types.js +1 -0
  175. package/dist/components/line-chart/index.d.ts +1 -0
  176. package/dist/components/line-chart/index.js +1 -0
  177. package/dist/components/line-chart/line-chart.d.ts +17 -0
  178. package/dist/components/line-chart/line-chart.js +53 -0
  179. package/dist/components/link/index.d.ts +2 -0
  180. package/dist/components/link/index.js +1 -0
  181. package/dist/components/link/link.d.ts +2 -0
  182. package/dist/components/link/link.js +7 -0
  183. package/dist/components/link/link.styles.d.ts +5 -0
  184. package/dist/components/link/link.styles.js +9 -0
  185. package/dist/components/link/link.types.d.ts +8 -0
  186. package/dist/components/link/link.types.js +1 -0
  187. package/dist/components/menu/index.d.ts +8 -0
  188. package/dist/components/menu/index.js +8 -0
  189. package/dist/components/menu/menu.d.ts +20 -0
  190. package/dist/components/menu/menu.js +26 -0
  191. package/dist/components/number-field/index.d.ts +2 -0
  192. package/dist/components/number-field/index.js +1 -0
  193. package/dist/components/number-field/number-field.d.ts +2 -0
  194. package/dist/components/number-field/number-field.js +14 -0
  195. package/dist/components/number-field/number-field.styles.d.ts +8 -0
  196. package/dist/components/number-field/number-field.styles.js +7 -0
  197. package/dist/components/number-field/number-field.types.d.ts +14 -0
  198. package/dist/components/number-field/number-field.types.js +1 -0
  199. package/dist/components/pagination/index.d.ts +3 -0
  200. package/dist/components/pagination/index.js +2 -0
  201. package/dist/components/pagination/pagination.d.ts +2 -0
  202. package/dist/components/pagination/pagination.js +49 -0
  203. package/dist/components/pagination/pagination.styles.d.ts +8 -0
  204. package/dist/components/pagination/pagination.styles.js +19 -0
  205. package/dist/components/pagination/pagination.types.d.ts +35 -0
  206. package/dist/components/pagination/pagination.types.js +1 -0
  207. package/dist/components/pagination/pagination.utils.d.ts +6 -0
  208. package/dist/components/pagination/pagination.utils.js +51 -0
  209. package/dist/components/password-field/index.d.ts +2 -0
  210. package/dist/components/password-field/index.js +1 -0
  211. package/dist/components/password-field/password-field.d.ts +2 -0
  212. package/dist/components/password-field/password-field.js +17 -0
  213. package/dist/components/password-field/password-field.styles.d.ts +8 -0
  214. package/dist/components/password-field/password-field.styles.js +7 -0
  215. package/dist/components/password-field/password-field.types.d.ts +16 -0
  216. package/dist/components/password-field/password-field.types.js +1 -0
  217. package/dist/components/popover/index.d.ts +2 -0
  218. package/dist/components/popover/index.js +1 -0
  219. package/dist/components/popover/popover.d.ts +10 -0
  220. package/dist/components/popover/popover.js +16 -0
  221. package/dist/components/popover/popover.styles.d.ts +3 -0
  222. package/dist/components/popover/popover.styles.js +7 -0
  223. package/dist/components/popover/popover.types.d.ts +14 -0
  224. package/dist/components/popover/popover.types.js +1 -0
  225. package/dist/components/progress/index.d.ts +2 -0
  226. package/dist/components/progress/index.js +1 -0
  227. package/dist/components/progress/progress.d.ts +12 -0
  228. package/dist/components/progress/progress.js +26 -0
  229. package/dist/components/radio-group/index.d.ts +2 -0
  230. package/dist/components/radio-group/index.js +1 -0
  231. package/dist/components/radio-group/radio-group.d.ts +3 -0
  232. package/dist/components/radio-group/radio-group.js +21 -0
  233. package/dist/components/radio-group/radio-group.styles.d.ts +5 -0
  234. package/dist/components/radio-group/radio-group.styles.js +14 -0
  235. package/dist/components/radio-group/radio-group.types.d.ts +14 -0
  236. package/dist/components/radio-group/radio-group.types.js +1 -0
  237. package/dist/components/search-field/index.d.ts +2 -0
  238. package/dist/components/search-field/index.js +1 -0
  239. package/dist/components/search-field/search-field.d.ts +2 -0
  240. package/dist/components/search-field/search-field.js +15 -0
  241. package/dist/components/search-field/search-field.styles.d.ts +8 -0
  242. package/dist/components/search-field/search-field.styles.js +7 -0
  243. package/dist/components/search-field/search-field.types.d.ts +15 -0
  244. package/dist/components/search-field/search-field.types.js +1 -0
  245. package/dist/components/select/index.d.ts +5 -0
  246. package/dist/components/select/index.js +5 -0
  247. package/dist/components/select/select.d.ts +16 -0
  248. package/dist/components/select/select.js +11 -0
  249. package/dist/components/select/select.styles.d.ts +5 -0
  250. package/dist/components/select/select.styles.js +13 -0
  251. package/dist/components/skeleton/index.d.ts +1 -0
  252. package/dist/components/skeleton/index.js +1 -0
  253. package/dist/components/skeleton/skeleton.d.ts +3 -0
  254. package/dist/components/skeleton/skeleton.js +5 -0
  255. package/dist/components/slider/index.d.ts +2 -0
  256. package/dist/components/slider/index.js +1 -0
  257. package/dist/components/slider/slider.d.ts +2 -0
  258. package/dist/components/slider/slider.js +8 -0
  259. package/dist/components/slider/slider.styles.d.ts +6 -0
  260. package/dist/components/slider/slider.styles.js +9 -0
  261. package/dist/components/slider/slider.types.d.ts +8 -0
  262. package/dist/components/slider/slider.types.js +1 -0
  263. package/dist/components/sparkline/index.d.ts +1 -0
  264. package/dist/components/sparkline/index.js +1 -0
  265. package/dist/components/sparkline/sparkline.d.ts +11 -0
  266. package/dist/components/sparkline/sparkline.js +34 -0
  267. package/dist/components/spinner/index.d.ts +1 -0
  268. package/dist/components/spinner/index.js +1 -0
  269. package/dist/components/spinner/spinner.d.ts +4 -0
  270. package/dist/components/spinner/spinner.js +6 -0
  271. package/dist/components/stepper/index.d.ts +3 -0
  272. package/dist/components/stepper/index.js +2 -0
  273. package/dist/components/stepper/stepper-step.d.ts +15 -0
  274. package/dist/components/stepper/stepper-step.js +46 -0
  275. package/dist/components/stepper/stepper.d.ts +4 -0
  276. package/dist/components/stepper/stepper.js +17 -0
  277. package/dist/components/stepper/stepper.styles.d.ts +10 -0
  278. package/dist/components/stepper/stepper.styles.js +37 -0
  279. package/dist/components/stepper/stepper.types.d.ts +50 -0
  280. package/dist/components/stepper/stepper.types.js +1 -0
  281. package/dist/components/stepper/use-stepper.d.ts +6 -0
  282. package/dist/components/stepper/use-stepper.js +40 -0
  283. package/dist/components/switch/index.d.ts +2 -0
  284. package/dist/components/switch/index.js +1 -0
  285. package/dist/components/switch/switch.d.ts +2 -0
  286. package/dist/components/switch/switch.js +7 -0
  287. package/dist/components/switch/switch.styles.d.ts +3 -0
  288. package/dist/components/switch/switch.styles.js +6 -0
  289. package/dist/components/switch/switch.types.d.ts +6 -0
  290. package/dist/components/switch/switch.types.js +1 -0
  291. package/dist/components/table/index.d.ts +11 -0
  292. package/dist/components/table/index.js +11 -0
  293. package/dist/components/table/table-sort-glyph.d.ts +3 -0
  294. package/dist/components/table/table-sort-glyph.js +5 -0
  295. package/dist/components/table/table.d.ts +33 -0
  296. package/dist/components/table/table.js +31 -0
  297. package/dist/components/table/table.styles.d.ts +8 -0
  298. package/dist/components/table/table.styles.js +19 -0
  299. package/dist/components/tabs/index.d.ts +7 -0
  300. package/dist/components/tabs/index.js +7 -0
  301. package/dist/components/tabs/tabs.d.ts +20 -0
  302. package/dist/components/tabs/tabs.js +29 -0
  303. package/dist/components/tabs/tabs.styles.d.ts +5 -0
  304. package/dist/components/tabs/tabs.styles.js +30 -0
  305. package/dist/components/tag-field/index.d.ts +2 -0
  306. package/dist/components/tag-field/index.js +1 -0
  307. package/dist/components/tag-field/tag-field-icons.d.ts +2 -0
  308. package/dist/components/tag-field/tag-field-icons.js +7 -0
  309. package/dist/components/tag-field/tag-field-tags.d.ts +7 -0
  310. package/dist/components/tag-field/tag-field-tags.js +19 -0
  311. package/dist/components/tag-field/tag-field.d.ts +6 -0
  312. package/dist/components/tag-field/tag-field.js +46 -0
  313. package/dist/components/tag-field/tag-field.styles.d.ts +14 -0
  314. package/dist/components/tag-field/tag-field.styles.js +42 -0
  315. package/dist/components/tag-field/tag-field.types.d.ts +32 -0
  316. package/dist/components/tag-field/tag-field.types.js +1 -0
  317. package/dist/components/text-area/index.d.ts +2 -0
  318. package/dist/components/text-area/index.js +1 -0
  319. package/dist/components/text-area/text-area.d.ts +2 -0
  320. package/dist/components/text-area/text-area.js +9 -0
  321. package/dist/components/text-area/text-area.styles.d.ts +6 -0
  322. package/dist/components/text-area/text-area.styles.js +5 -0
  323. package/dist/components/text-area/text-area.types.d.ts +16 -0
  324. package/dist/components/text-area/text-area.types.js +1 -0
  325. package/dist/components/text-field/index.d.ts +2 -0
  326. package/dist/components/text-field/index.js +1 -0
  327. package/dist/components/text-field/text-field.d.ts +2 -0
  328. package/dist/components/text-field/text-field.js +8 -0
  329. package/dist/components/text-field/text-field.styles.d.ts +1 -0
  330. package/dist/components/text-field/text-field.styles.js +1 -0
  331. package/dist/components/text-field/text-field.types.d.ts +15 -0
  332. package/dist/components/text-field/text-field.types.js +1 -0
  333. package/dist/components/toast/index.d.ts +2 -0
  334. package/dist/components/toast/index.js +1 -0
  335. package/dist/components/toast/toast-glyph.d.ts +4 -0
  336. package/dist/components/toast/toast-glyph.js +23 -0
  337. package/dist/components/toast/toast-item.d.ts +14 -0
  338. package/dist/components/toast/toast-item.js +21 -0
  339. package/dist/components/toast/toast.d.ts +16 -0
  340. package/dist/components/toast/toast.js +50 -0
  341. package/dist/components/toast/toast.styles.d.ts +13 -0
  342. package/dist/components/toast/toast.styles.js +50 -0
  343. package/dist/components/tooltip/index.d.ts +2 -0
  344. package/dist/components/tooltip/index.js +1 -0
  345. package/dist/components/tooltip/tooltip.d.ts +3 -0
  346. package/dist/components/tooltip/tooltip.js +10 -0
  347. package/dist/components/tooltip/tooltip.styles.d.ts +1 -0
  348. package/dist/components/tooltip/tooltip.styles.js +6 -0
  349. package/dist/components/tooltip/tooltip.types.d.ts +18 -0
  350. package/dist/components/tooltip/tooltip.types.js +1 -0
  351. package/dist/index.d.ts +54 -0
  352. package/dist/index.js +51 -0
  353. package/dist/providers/material-provider.d.ts +12 -0
  354. package/dist/providers/material-provider.js +30 -0
  355. package/dist/providers/motion-provider.d.ts +20 -0
  356. package/dist/providers/motion-provider.js +45 -0
  357. package/dist/providers/radius-provider.d.ts +13 -0
  358. package/dist/providers/radius-provider.js +73 -0
  359. package/dist/providers/theme-provider.d.ts +25 -0
  360. package/dist/providers/theme-provider.js +66 -0
  361. package/dist/styles/field.d.ts +24 -0
  362. package/dist/styles/field.js +36 -0
  363. package/dist/styles/overlays.d.ts +3 -0
  364. package/dist/styles/overlays.js +4 -0
  365. package/dist/utils/cn.d.ts +1 -0
  366. package/dist/utils/cn.js +3 -0
  367. package/package.json +276 -3
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Himanshu Kumar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,70 @@
1
- # Temporary Holding Version
1
+ # @hewnui/ui
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Accessible React components built on React Aria, Tailwind v4 and Motion: 46 application UI components with six curated themes. Part of [Hewn](https://hewnui.dev).
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pnpm add @hewnui/ui react react-dom react-aria-components motion
9
+ ```
10
+
11
+ | Peer | Range |
12
+ |---|---|
13
+ | react / react-dom | ^19.2.7 |
14
+ | react-aria-components | ^1.19.0 |
15
+ | motion | ^12.42.2 |
16
+
17
+ Prefer to own the source?
18
+
19
+ ```bash
20
+ npx hewnui@latest add button
21
+ ```
22
+
23
+ ## Setup (Tailwind v4)
24
+
25
+ ```css
26
+ @import "tailwindcss";
27
+ @import "@hewnui/themes/tokens.css";
28
+ @import "@hewnui/themes/motion.css";
29
+ @import "@hewnui/themes/radius.css";
30
+ @import "@hewnui/themes/glass.css";
31
+ @source "../node_modules/@hewnui/ui/dist/**/*.js";
32
+ ```
33
+
34
+ Use `@tailwindcss/postcss`. The Tailwind v3 PostCSS plugin is not supported.
35
+
36
+ ## Usage
37
+
38
+ ```tsx
39
+ import { Button, TextField } from "@hewnui/ui";
40
+
41
+ <TextField
42
+ label="Workspace slug"
43
+ description="Lowercase letters, numbers, hyphens."
44
+ isInvalid={!valid}
45
+ errorMessage="That slug is taken."
46
+ />
47
+ <Button onPress={save}>Save workspace</Button>
48
+ ```
49
+
50
+ Subpath imports:
51
+
52
+ ```tsx
53
+ import { DataTable } from "@hewnui/ui/data-table";
54
+ ```
55
+
56
+ ## Providers
57
+
58
+ | Provider | Values |
59
+ |---|---|
60
+ | `ThemeProvider` (required) | `forest`, `tide`, `graphite`, `dune`, `clay`, `ember` |
61
+ | `MaterialProvider` | `solid`, `glass` |
62
+ | `RadiusProvider` | `sharp`, `soft`, `rounded`, `pill` |
63
+ | `MotionProvider` | `full` (default), `reduced`, `off`. Legacy `"on"` maps to `"full"`. OS `prefers-reduced-motion` caps the effective mode at `reduced`. |
64
+ | `ToastProvider` | — |
65
+
66
+ Docs and live examples: https://hewnui.dev/docs/components
67
+
68
+ ## License
69
+
70
+ MIT — see [LICENSE](./LICENSE).
@@ -0,0 +1,31 @@
1
+ type AxisScale = {
2
+ ticks?: (count?: number) => number[];
3
+ domain: () => Array<number | string>;
4
+ bandwidth?: () => number;
5
+ (value: number | string): number | undefined;
6
+ };
7
+ export declare function GridLines({ x, y, width, height, pad, }: {
8
+ x: AxisScale;
9
+ y: AxisScale;
10
+ width: number;
11
+ height: number;
12
+ pad: {
13
+ top: number;
14
+ right: number;
15
+ bottom: number;
16
+ left: number;
17
+ };
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ export declare function AxisLabels({ x, y, height, pad, xIsBand, }: {
20
+ x: AxisScale;
21
+ y: AxisScale;
22
+ height: number;
23
+ pad: {
24
+ top: number;
25
+ right: number;
26
+ bottom: number;
27
+ left: number;
28
+ };
29
+ xIsBand?: boolean;
30
+ }): import("react/jsx-runtime").JSX.Element;
31
+ export {};
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { formatTick } from "./status.js";
3
+ export function GridLines({ x, y, width, height, pad, }) {
4
+ const yTicks = y.ticks?.(4) ?? [];
5
+ return (_jsxs("g", { "aria-hidden": true, children: [yTicks.map((tick) => {
6
+ const py = y(tick) ?? 0;
7
+ return (_jsx("line", { x1: pad.left, x2: width - pad.right, y1: py, y2: py, stroke: "var(--kp-border)", strokeWidth: 1 }, `y-${tick}`));
8
+ }), _jsx("line", { x1: pad.left, x2: pad.left, y1: pad.top, y2: height - pad.bottom, stroke: "var(--kp-border)", strokeWidth: 1 }), _jsx("line", { x1: pad.left, x2: width - pad.right, y1: height - pad.bottom, y2: height - pad.bottom, stroke: "var(--kp-border)", strokeWidth: 1 })] }));
9
+ }
10
+ export function AxisLabels({ x, y, height, pad, xIsBand, }) {
11
+ const yTicks = y.ticks?.(4) ?? [];
12
+ const xDomain = x.domain();
13
+ const xLabels = xIsBand || xDomain.length <= 8
14
+ ? xDomain
15
+ : [xDomain[0], xDomain[Math.floor(xDomain.length / 2)], xDomain.at(-1)].filter((v) => v !== undefined);
16
+ return (_jsxs("g", { "aria-hidden": true, className: "tabular-nums", children: [yTicks.map((tick) => (_jsx("text", { x: pad.left - 8, y: (y(tick) ?? 0) + 4, textAnchor: "end", className: "fill-muted-foreground", style: { fontSize: 10, fontFamily: "var(--kp-font-mono)" }, children: formatTick(tick) }, `yl-${tick}`))), xLabels.map((label) => {
17
+ const px = (x(label) ?? 0) + (x.bandwidth?.() ?? 0) / 2;
18
+ return (_jsx("text", { x: px, y: height - pad.bottom + 16, textAnchor: "middle", className: "fill-muted-foreground", style: { fontSize: 10, fontFamily: "var(--kp-font-mono)" }, children: formatTick(label) }, `xl-${String(label)}`));
19
+ })] }));
20
+ }
@@ -0,0 +1 @@
1
+ export declare function seriesColor(index: number, override?: string): string;
@@ -0,0 +1,13 @@
1
+ /** Theme-token-driven series colors — accent first, then semantic hues. */
2
+ const SERIES_COLORS = [
3
+ "var(--kp-accent)",
4
+ "var(--kp-danger)",
5
+ "color-mix(in oklch, var(--kp-accent) 55%, var(--kp-foreground))",
6
+ "color-mix(in oklch, var(--kp-muted-foreground) 70%, var(--kp-accent))",
7
+ "color-mix(in oklch, var(--kp-accent) 35%, var(--kp-border))",
8
+ ];
9
+ export function seriesColor(index, override) {
10
+ if (override)
11
+ return override;
12
+ return SERIES_COLORS[index % SERIES_COLORS.length];
13
+ }
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from "react";
2
+ export declare function ChartFrame({ className, width, height, summary, children, status, errorMessage,
3
+ /** When true, SVG uses role=group so focusable point controls are not nested in role=img. */
4
+ interactive, }: {
5
+ className?: string | undefined;
6
+ width: number;
7
+ height: number;
8
+ summary: string;
9
+ children?: ReactNode;
10
+ status?: "ready" | "loading" | "empty" | "error";
11
+ errorMessage?: string;
12
+ interactive?: boolean;
13
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../utils/cn.js";
3
+ import { Skeleton } from "../components/skeleton/index.js";
4
+ export function ChartFrame({ className, width, height, summary, children, status = "ready", errorMessage = "Could not render chart.",
5
+ /** When true, SVG uses role=group so focusable point controls are not nested in role=img. */
6
+ interactive = false, }) {
7
+ if (status === "loading") {
8
+ return (_jsx("div", { className: cn("w-full", className), style: { width, height }, role: "status", "aria-label": "Loading chart", children: _jsx(Skeleton, { className: "h-full w-full rounded-[var(--kp-radius-md)]" }) }));
9
+ }
10
+ if (status === "empty") {
11
+ return (_jsx("div", { className: cn("flex items-center justify-center rounded-[var(--kp-radius-md)] border border-dashed border-border bg-muted/30 text-sm text-muted-foreground", className), style: { width, height }, role: "status", children: "No data to display" }));
12
+ }
13
+ if (status === "error") {
14
+ return (_jsx("div", { className: cn("flex items-center justify-center rounded-[var(--kp-radius-md)] border border-danger/40 bg-danger/5 text-sm text-danger", className), style: { width, height }, role: "alert", children: errorMessage }));
15
+ }
16
+ return (_jsxs("figure", { className: cn("m-0 w-full", className), style: { maxWidth: width }, children: [_jsx("svg", { role: interactive ? "group" : "img", "aria-label": summary, width: width, height: height, viewBox: `0 0 ${width} ${height}`, className: "overflow-visible", children: children }), _jsx("figcaption", { className: "sr-only", children: summary })] }));
17
+ }
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ChartDatum, ChartSeries } from "./types.js";
3
+ export type ChartHover = {
4
+ seriesId: string;
5
+ label: string;
6
+ point: ChartDatum;
7
+ color: string;
8
+ px: number;
9
+ py: number;
10
+ } | null;
11
+ type ChartInteractionValue = {
12
+ hover: ChartHover;
13
+ setHover: (next: ChartHover) => void;
14
+ series: ChartSeries[];
15
+ };
16
+ export declare function ChartInteractionProvider({ series, children, }: {
17
+ series: ChartSeries[];
18
+ children: ReactNode;
19
+ }): import("react/jsx-runtime").JSX.Element;
20
+ export declare function useChartInteraction(): ChartInteractionValue;
21
+ export declare function ChartTooltip(): import("react/jsx-runtime").JSX.Element | null;
22
+ export {};
@@ -0,0 +1,22 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createContext, useContext, useMemo, useState, } from "react";
4
+ const ChartInteractionContext = createContext(null);
5
+ export function ChartInteractionProvider({ series, children, }) {
6
+ const [hover, setHover] = useState(null);
7
+ const value = useMemo(() => ({ hover, setHover, series }), [hover, series]);
8
+ return (_jsx(ChartInteractionContext.Provider, { value: value, children: children }));
9
+ }
10
+ export function useChartInteraction() {
11
+ const ctx = useContext(ChartInteractionContext);
12
+ if (!ctx) {
13
+ throw new Error("Chart.Tooltip must be used within a chart root");
14
+ }
15
+ return ctx;
16
+ }
17
+ export function ChartTooltip() {
18
+ const { hover } = useChartInteraction();
19
+ if (!hover)
20
+ return null;
21
+ return (_jsxs("div", { className: "pointer-events-none absolute z-10 -translate-x-1/2 -translate-y-[calc(100%+8px)] rounded-[var(--kp-radius-sm)] border border-border bg-surface-raised px-2 py-1 text-xs shadow-[0_8px_24px_color-mix(in_oklch,var(--kp-foreground)_12%,transparent)]", style: { left: hover.px, top: hover.py }, role: "tooltip", children: [_jsx("p", { className: "font-medium text-foreground", children: hover.label }), _jsxs("p", { className: "font-mono tabular-nums text-muted-foreground", children: [String(hover.point.x), " \u00B7 ", hover.point.y] })] }));
22
+ }
@@ -0,0 +1,10 @@
1
+ import type { ChartDatum } from "./types.js";
2
+ type XScale = {
3
+ (value: number | string): number | undefined;
4
+ };
5
+ type YScale = {
6
+ (value: number): number | undefined;
7
+ };
8
+ export declare function linePath(data: ChartDatum[], x: XScale, y: YScale, xIsNumeric: boolean): string;
9
+ export declare function areaPath(data: ChartDatum[], x: XScale, y: YScale, xIsNumeric: boolean, y0: number): string;
10
+ export {};
@@ -0,0 +1,24 @@
1
+ import { area as d3Area, line as d3Line, curveMonotoneX } from "d3-shape";
2
+ export function linePath(data, x, y, xIsNumeric) {
3
+ const generator = d3Line()
4
+ .x((d) => {
5
+ const raw = xIsNumeric ? d.x : String(d.x);
6
+ return x(raw) ?? 0;
7
+ })
8
+ .y((d) => y(d.y) ?? 0)
9
+ .curve(curveMonotoneX)
10
+ .defined((d) => Number.isFinite(d.y));
11
+ return generator(data) ?? "";
12
+ }
13
+ export function areaPath(data, x, y, xIsNumeric, y0) {
14
+ const generator = d3Area()
15
+ .x((d) => {
16
+ const raw = xIsNumeric ? d.x : String(d.x);
17
+ return x(raw) ?? 0;
18
+ })
19
+ .y0(y0)
20
+ .y1((d) => y(d.y) ?? y0)
21
+ .curve(curveMonotoneX)
22
+ .defined((d) => Number.isFinite(d.y));
23
+ return generator(data) ?? "";
24
+ }
@@ -0,0 +1,34 @@
1
+ import type { ChartDatum, ChartSeries, ChartSize } from "./types.js";
2
+ export declare function flattenSeries(series: ChartSeries[]): ChartDatum[];
3
+ export declare function xDomain(data: ChartDatum[]): Array<number | string>;
4
+ export declare function yDomain(data: ChartDatum[], includeZero?: boolean): [number, number];
5
+ export declare function createLinearScales(data: ChartDatum[], size: ChartSize, opts?: {
6
+ includeZero?: boolean;
7
+ }): {
8
+ x: import("d3-scale").ScaleLinear<number, number, never> | import("d3-scale").ScalePoint<string>;
9
+ y: import("d3-scale").ScaleLinear<number, number, never>;
10
+ pad: {
11
+ top: number;
12
+ right: number;
13
+ bottom: number;
14
+ left: number;
15
+ };
16
+ innerW: number;
17
+ innerH: number;
18
+ xIsNumeric: boolean;
19
+ };
20
+ export declare function createBandScales(data: ChartDatum[], size: ChartSize, opts?: {
21
+ includeZero?: boolean;
22
+ }): {
23
+ x: import("d3-scale").ScaleBand<string>;
24
+ y: import("d3-scale").ScaleLinear<number, number, never>;
25
+ pad: {
26
+ top: number;
27
+ right: number;
28
+ bottom: number;
29
+ left: number;
30
+ };
31
+ innerW: number;
32
+ innerH: number;
33
+ categories: string[];
34
+ };
@@ -0,0 +1,66 @@
1
+ import { extent, max, min } from "d3-array";
2
+ import { scaleBand, scaleLinear, scalePoint } from "d3-scale";
3
+ import { DEFAULT_PADDING } from "./types.js";
4
+ export function flattenSeries(series) {
5
+ return series.flatMap((item) => item.data);
6
+ }
7
+ export function xDomain(data) {
8
+ const values = data.map((d) => d.x);
9
+ const allNumeric = values.every((v) => typeof v === "number");
10
+ if (allNumeric) {
11
+ const [lo, hi] = extent(values);
12
+ return [lo, hi];
13
+ }
14
+ return [...new Set(values.map(String))];
15
+ }
16
+ export function yDomain(data, includeZero = false) {
17
+ const ys = data.map((d) => d.y);
18
+ let lo = min(ys) ?? 0;
19
+ let hi = max(ys) ?? 1;
20
+ if (includeZero) {
21
+ lo = Math.min(0, lo);
22
+ hi = Math.max(0, hi);
23
+ }
24
+ if (lo === hi) {
25
+ lo -= 1;
26
+ hi += 1;
27
+ }
28
+ return [lo, hi];
29
+ }
30
+ export function createLinearScales(data, size, opts) {
31
+ const pad = { ...DEFAULT_PADDING, ...size.padding };
32
+ const innerW = Math.max(1, size.width - pad.left - pad.right);
33
+ const innerH = Math.max(1, size.height - pad.top - pad.bottom);
34
+ const xd = xDomain(data);
35
+ const yd = yDomain(data, opts?.includeZero);
36
+ const xIsNumeric = xd.length === 2 && typeof xd[0] === "number";
37
+ const x = xIsNumeric
38
+ ? scaleLinear()
39
+ .domain(xd)
40
+ .range([pad.left, pad.left + innerW])
41
+ : scalePoint()
42
+ .domain(xd.map(String))
43
+ .range([pad.left, pad.left + innerW])
44
+ .padding(0.2);
45
+ const y = scaleLinear()
46
+ .domain(yd)
47
+ .nice()
48
+ .range([pad.top + innerH, pad.top]);
49
+ return { x, y, pad, innerW, innerH, xIsNumeric };
50
+ }
51
+ export function createBandScales(data, size, opts) {
52
+ const pad = { ...DEFAULT_PADDING, ...size.padding };
53
+ const innerW = Math.max(1, size.width - pad.left - pad.right);
54
+ const innerH = Math.max(1, size.height - pad.top - pad.bottom);
55
+ const categories = [...new Set(data.map((d) => String(d.x)))];
56
+ const yd = yDomain(data, opts?.includeZero ?? true);
57
+ const x = scaleBand()
58
+ .domain(categories)
59
+ .range([pad.left, pad.left + innerW])
60
+ .padding(0.24);
61
+ const y = scaleLinear()
62
+ .domain(yd)
63
+ .nice()
64
+ .range([pad.top + innerH, pad.top]);
65
+ return { x, y, pad, innerW, innerH, categories };
66
+ }
@@ -0,0 +1,3 @@
1
+ import type { ChartDatum, ChartSeries, ChartStatus } from "./types.js";
2
+ export declare function resolveStatus(series: ChartSeries[] | ChartDatum[], status?: ChartStatus): ChartStatus;
3
+ export declare function formatTick(value: number | string): string;
@@ -0,0 +1,15 @@
1
+ export function resolveStatus(series, status) {
2
+ if (status)
3
+ return status;
4
+ const points = Array.isArray(series) && series.length > 0 && "data" in series[0]
5
+ ? series.flatMap((s) => s.data)
6
+ : series;
7
+ return points.length === 0 ? "empty" : "ready";
8
+ }
9
+ export function formatTick(value) {
10
+ if (typeof value === "string")
11
+ return value;
12
+ if (Number.isInteger(value))
13
+ return String(value);
14
+ return value.toFixed(1);
15
+ }
@@ -0,0 +1,34 @@
1
+ export type ChartDatum = {
2
+ x: number | string;
3
+ y: number;
4
+ };
5
+ export type ChartSeries = {
6
+ id: string;
7
+ label: string;
8
+ data: ChartDatum[];
9
+ /** Optional CSS color; defaults to accent ramp. */
10
+ color?: string;
11
+ };
12
+ export type ChartStatus = "ready" | "loading" | "empty" | "error";
13
+ export type DonutSlice = {
14
+ id: string;
15
+ label: string;
16
+ value: number;
17
+ color?: string;
18
+ };
19
+ export type ChartSize = {
20
+ width: number;
21
+ height: number;
22
+ padding?: {
23
+ top: number;
24
+ right: number;
25
+ bottom: number;
26
+ left: number;
27
+ };
28
+ };
29
+ export declare const DEFAULT_PADDING: {
30
+ readonly top: 12;
31
+ readonly right: 12;
32
+ readonly bottom: 28;
33
+ readonly left: 36;
34
+ };
@@ -0,0 +1,6 @@
1
+ export const DEFAULT_PADDING = {
2
+ top: 12,
3
+ right: 12,
4
+ bottom: 28,
5
+ left: 36,
6
+ };
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from "react";
2
+ import { ChartTooltip } from "../../chart/interaction.js";
3
+ import type { ChartSeries, ChartStatus } from "../../chart/types.js";
4
+ export type AreaChartProps = {
5
+ series: ChartSeries[];
6
+ summary: string;
7
+ className?: string;
8
+ width?: number;
9
+ height?: number;
10
+ status?: ChartStatus;
11
+ children?: ReactNode;
12
+ };
13
+ declare function AreaChartRoot({ series, summary, className, width, height, status, children, }: AreaChartProps): import("react/jsx-runtime").JSX.Element;
14
+ export declare const AreaChart: typeof AreaChartRoot & {
15
+ Tooltip: typeof ChartTooltip;
16
+ };
17
+ export {};
@@ -0,0 +1,54 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { drawIn, fadeIn } from "@hewnui/motion";
4
+ import { m } from "motion/react";
5
+ import { AxisLabels, GridLines } from "../../chart/axes.js";
6
+ import { seriesColor } from "../../chart/colors.js";
7
+ import { ChartFrame } from "../../chart/frame.js";
8
+ import { ChartInteractionProvider, ChartTooltip, useChartInteraction, } from "../../chart/interaction.js";
9
+ import { areaPath, linePath } from "../../chart/path.js";
10
+ import { createLinearScales, flattenSeries } from "../../chart/scales.js";
11
+ import { resolveStatus } from "../../chart/status.js";
12
+ import { useMotionMode } from "../../providers/motion-provider.js";
13
+ function AreaChartRoot({ series, summary, className, width = 480, height = 240, status, children, }) {
14
+ const resolved = resolveStatus(series, status);
15
+ if (resolved !== "ready") {
16
+ return (_jsx(ChartFrame, { className: className, width: width, height: height, summary: summary, status: resolved }));
17
+ }
18
+ return (_jsx(ChartInteractionProvider, { series: series, children: _jsxs("div", { className: "relative", style: { maxWidth: width }, children: [_jsx(AreaChartSvg, { series: series, summary: summary, className: className, width: width, height: height }), children] }) }));
19
+ }
20
+ function AreaChartSvg({ series, summary, className, width, height, }) {
21
+ const { motionEnabled } = useMotionMode();
22
+ const { setHover } = useChartInteraction();
23
+ const flat = flattenSeries(series);
24
+ const { x, y, pad, xIsNumeric } = createLinearScales(flat, { width, height }, { includeZero: true });
25
+ const baseline = y(0) ?? height - pad.bottom;
26
+ return (_jsxs(ChartFrame, { className: className, width: width, height: height, summary: summary, interactive: true, children: [_jsx(GridLines, { x: x, y: y, width: width, height: height, pad: pad }), _jsx(AxisLabels, { x: x, y: y, height: height, pad: pad }), series.map((item, index) => {
27
+ const color = seriesColor(index, item.color);
28
+ const fill = areaPath(item.data, x, y, xIsNumeric, baseline);
29
+ const stroke = linePath(item.data, x, y, xIsNumeric);
30
+ return (_jsxs("g", { children: [motionEnabled ? (_jsx(m.path, { d: fill, fill: color, fillOpacity: 0.18, stroke: "none", initial: { opacity: 0 }, animate: { opacity: 1 }, transition: fadeIn })) : (_jsx("path", { d: fill, fill: color, fillOpacity: 0.18, stroke: "none" })), motionEnabled ? (_jsx(m.path, { d: stroke, fill: "none", stroke: color, strokeWidth: 2, initial: { pathLength: 0 }, animate: { pathLength: 1 }, transition: drawIn })) : (_jsx("path", { d: stroke, fill: "none", stroke: color, strokeWidth: 2 })), item.data.map((point) => {
31
+ const raw = xIsNumeric ? point.x : String(point.x);
32
+ const px = x(raw) ?? 0;
33
+ const py = y(point.y) ?? 0;
34
+ return (_jsx("circle", { cx: px, cy: py, r: 4, fill: color, className: "cursor-pointer opacity-0 transition-opacity duration-[var(--kp-motion-duration-fast)] hover:opacity-100 focus-visible:opacity-100", tabIndex: 0, role: "button", "aria-label": `${item.label}: ${String(point.x)}, ${point.y}`, onFocus: () => setHover({
35
+ seriesId: item.id,
36
+ label: item.label,
37
+ point,
38
+ color,
39
+ px,
40
+ py,
41
+ }), onBlur: () => setHover(null), onMouseEnter: () => setHover({
42
+ seriesId: item.id,
43
+ label: item.label,
44
+ point,
45
+ color,
46
+ px,
47
+ py,
48
+ }), onMouseLeave: () => setHover(null) }, `${item.id}-${String(point.x)}`));
49
+ })] }, item.id));
50
+ })] }));
51
+ }
52
+ export const AreaChart = Object.assign(AreaChartRoot, {
53
+ Tooltip: ChartTooltip,
54
+ });
@@ -0,0 +1 @@
1
+ export { AreaChart, type AreaChartProps } from "./area-chart.js";
@@ -0,0 +1 @@
1
+ export { AreaChart } from "./area-chart.js";
@@ -0,0 +1,2 @@
1
+ import type { BadgeProps } from "./badge.types.js";
2
+ export declare function Badge({ children, className, color, size, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { badgeClassName, dotClassName } from "./badge.styles.js";
3
+ export function Badge({ children, className, color = "accent", size = "md", variant = "soft", ...props }) {
4
+ return (_jsxs("span", { className: badgeClassName({ className, color, size, variant }), ...props, children: [variant === "dot" ? (_jsx("span", { "aria-hidden": true, className: dotClassName(color) })) : null, children] }));
5
+ }
@@ -0,0 +1,8 @@
1
+ import type { BadgeColor, BadgeSize, BadgeVariant } from "./badge.types.js";
2
+ export declare function badgeClassName({ className, color, size, variant, }: {
3
+ className?: string | undefined;
4
+ color?: BadgeColor | undefined;
5
+ size?: BadgeSize | undefined;
6
+ variant?: BadgeVariant | undefined;
7
+ }): string;
8
+ export declare function dotClassName(color?: BadgeColor): string;
@@ -0,0 +1,57 @@
1
+ import { cn } from "../../utils/cn.js";
2
+ const colorStyles = {
3
+ accent: {
4
+ solid: "bg-accent text-accent-foreground",
5
+ soft: "bg-[color-mix(in_oklch,var(--kp-accent)_16%,transparent)] text-accent font-semibold",
6
+ outline: "border-[color-mix(in_oklch,var(--kp-accent)_40%,transparent)] text-accent",
7
+ dotBg: "bg-accent",
8
+ },
9
+ muted: {
10
+ solid: "bg-muted text-foreground",
11
+ soft: "bg-[color-mix(in_oklch,var(--kp-foreground)_10%,transparent)] text-foreground",
12
+ outline: "border-[color-mix(in_oklch,var(--kp-foreground)_20%,transparent)] text-foreground",
13
+ dotBg: "bg-foreground",
14
+ },
15
+ danger: {
16
+ solid: "bg-danger text-danger-foreground",
17
+ // Soft fills are pale — mix toward black so label text clears WCAG AA.
18
+ soft: "bg-danger-subtle text-[color-mix(in_oklch,var(--kp-danger)_58%,black)] font-semibold",
19
+ outline: "border-danger-border text-[color-mix(in_oklch,var(--kp-danger)_58%,black)]",
20
+ dotBg: "bg-danger",
21
+ },
22
+ success: {
23
+ solid: "bg-success text-success-foreground",
24
+ soft: "bg-success-subtle text-[color-mix(in_oklch,var(--kp-success)_58%,black)] font-semibold",
25
+ outline: "border-success-border text-[color-mix(in_oklch,var(--kp-success)_58%,black)]",
26
+ dotBg: "bg-success",
27
+ },
28
+ warning: {
29
+ solid: "bg-warning text-warning-foreground",
30
+ soft: "bg-warning-subtle text-warning-foreground font-semibold",
31
+ outline: "border-warning-border text-warning-foreground",
32
+ dotBg: "bg-warning",
33
+ },
34
+ };
35
+ const sizes = {
36
+ sm: "px-2 py-0.5 text-xs rounded-full gap-1 min-h-5",
37
+ md: "px-2.5 py-0.5 text-xs font-medium rounded-full gap-1.5 min-h-6",
38
+ lg: "px-3 py-1 text-sm font-medium rounded-full gap-2 min-h-7",
39
+ };
40
+ export function badgeClassName({ className, color = "accent", size = "md", variant = "soft", }) {
41
+ const palette = colorStyles[color];
42
+ let variantStyle = palette.soft;
43
+ if (variant === "solid")
44
+ variantStyle = palette.solid;
45
+ if (variant === "outline")
46
+ variantStyle = `border ${palette.outline} bg-transparent`;
47
+ if (variant === "glass") {
48
+ variantStyle = cn("border border-[color-mix(in_oklch,var(--kp-foreground)_14%,transparent)]", "bg-[color-mix(in_oklch,var(--kp-surface)_50%,transparent)] text-foreground", "backdrop-blur-md backdrop-saturate-150", "shadow-[inset_0_1px_0_oklch(1_0_0/25%)]");
49
+ }
50
+ if (variant === "dot") {
51
+ variantStyle = `bg-[color-mix(in_oklch,var(--kp-foreground)_8%,transparent)] text-foreground`;
52
+ }
53
+ return cn("inline-flex items-center justify-center font-medium tracking-tight", "transition-colors duration-[var(--kp-motion-duration)]", sizes[size], variantStyle, className);
54
+ }
55
+ export function dotClassName(color = "accent") {
56
+ return cn("h-1.5 w-1.5 rounded-full", colorStyles[color].dotBg);
57
+ }
@@ -0,0 +1,11 @@
1
+ import type { HTMLAttributes, ReactNode } from "react";
2
+ export type BadgeVariant = "solid" | "soft" | "outline" | "glass" | "dot";
3
+ export type BadgeColor = "accent" | "muted" | "danger" | "success" | "warning";
4
+ export type BadgeSize = "sm" | "md" | "lg";
5
+ export type BadgeProps = HTMLAttributes<HTMLSpanElement> & {
6
+ children?: ReactNode;
7
+ variant?: BadgeVariant;
8
+ color?: BadgeColor;
9
+ size?: BadgeSize;
10
+ className?: string;
11
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export { Badge } from "./badge.js";
2
+ export { badgeClassName, dotClassName } from "./badge.styles.js";
3
+ export type { BadgeColor, BadgeProps, BadgeSize, BadgeVariant, } from "./badge.types.js";
@@ -0,0 +1,2 @@
1
+ export { Badge } from "./badge.js";
2
+ export { badgeClassName, dotClassName } from "./badge.styles.js";