@devalok/shilp-sutra 0.36.0 → 0.37.0-next.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 (530) hide show
  1. package/MIGRATION.md +346 -0
  2. package/README.md +26 -29
  3. package/dist/_chunks/badge-group.js +42 -42
  4. package/dist/_chunks/badge-group.js.map +1 -1
  5. package/dist/_chunks/chat.js +324 -327
  6. package/dist/_chunks/chat.js.map +1 -1
  7. package/dist/_chunks/date-picker.js +245 -245
  8. package/dist/_chunks/date-picker.js.map +1 -1
  9. package/dist/_chunks/document-preview.js +33 -33
  10. package/dist/_chunks/document-preview.js.map +1 -1
  11. package/dist/_chunks/file-preview.js +264 -264
  12. package/dist/_chunks/file-preview.js.map +1 -1
  13. package/dist/_chunks/image-preview.js +45 -45
  14. package/dist/_chunks/image-preview.js.map +1 -1
  15. package/dist/_chunks/mention-suggestion.js +85 -85
  16. package/dist/_chunks/mention-suggestion.js.map +1 -1
  17. package/dist/_chunks/motion-provider.js +13 -13
  18. package/dist/_chunks/motion-provider.js.map +1 -1
  19. package/dist/_chunks/popover.js +36 -36
  20. package/dist/_chunks/popover.js.map +1 -1
  21. package/dist/_chunks/primitives.js +489 -489
  22. package/dist/_chunks/primitives.js.map +1 -1
  23. package/dist/_chunks/rich-chat-input.js +1066 -1066
  24. package/dist/_chunks/rich-chat-input.js.map +1 -1
  25. package/dist/_chunks/shared.js +43 -43
  26. package/dist/_chunks/shared.js.map +1 -1
  27. package/dist/_chunks/text.js +432 -0
  28. package/dist/_chunks/text.js.map +1 -0
  29. package/dist/_chunks/tiptap.js +6053 -6187
  30. package/dist/_chunks/tiptap.js.map +1 -1
  31. package/dist/_chunks/tree-view.js +97 -97
  32. package/dist/_chunks/tree-view.js.map +1 -1
  33. package/dist/_chunks/use-calendar.js.map +1 -1
  34. package/dist/ai/ai-command-provider.d.ts.map +1 -1
  35. package/dist/ai/ai-command-provider.js.map +1 -1
  36. package/dist/ai/block-renderer.d.ts.map +1 -1
  37. package/dist/ai/block-renderer.js +43 -43
  38. package/dist/ai/block-renderer.js.map +1 -1
  39. package/dist/ai/blocks/block-table.d.ts.map +1 -1
  40. package/dist/ai/blocks/confirm.d.ts.map +1 -1
  41. package/dist/ai/blocks/divider.d.ts.map +1 -1
  42. package/dist/ai/blocks/error.d.ts.map +1 -1
  43. package/dist/ai/blocks/index.d.ts +5 -5
  44. package/dist/ai/blocks/index.d.ts.map +1 -1
  45. package/dist/ai/blocks/index.js +2 -2
  46. package/dist/ai/blocks/info.d.ts.map +1 -1
  47. package/dist/ai/blocks/loading.d.ts.map +1 -1
  48. package/dist/ai/blocks/stat-row.d.ts.map +1 -1
  49. package/dist/ai/blocks/success.d.ts.map +1 -1
  50. package/dist/ai/blocks/text.d.ts.map +1 -1
  51. package/dist/ai/command-bar.d.ts +0 -11
  52. package/dist/ai/command-bar.d.ts.map +1 -1
  53. package/dist/ai/command-bar.js +128 -128
  54. package/dist/ai/command-bar.js.map +1 -1
  55. package/dist/ai/conversation.d.ts +1 -1
  56. package/dist/ai/conversation.d.ts.map +1 -1
  57. package/dist/ai/conversation.js +76 -76
  58. package/dist/ai/conversation.js.map +1 -1
  59. package/dist/ai/devadoot-icon.d.ts +0 -12
  60. package/dist/ai/devadoot-icon.d.ts.map +1 -1
  61. package/dist/ai/index.d.ts +11 -11
  62. package/dist/ai/index.d.ts.map +1 -1
  63. package/dist/ai/index.js +44 -44
  64. package/dist/ai/index.js.map +1 -1
  65. package/dist/composed/activity-feed.d.ts.map +1 -1
  66. package/dist/composed/activity-feed.js +93 -93
  67. package/dist/composed/activity-feed.js.map +1 -1
  68. package/dist/composed/avatar-group.d.ts.map +1 -1
  69. package/dist/composed/avatar-group.js +50 -50
  70. package/dist/composed/avatar-group.js.map +1 -1
  71. package/dist/composed/bulk-action-bar.d.ts.map +1 -1
  72. package/dist/composed/bulk-action-bar.js +40 -40
  73. package/dist/composed/bulk-action-bar.js.map +1 -1
  74. package/dist/composed/command-palette.d.ts +0 -6
  75. package/dist/composed/command-palette.d.ts.map +1 -1
  76. package/dist/composed/command-palette.js +131 -131
  77. package/dist/composed/command-palette.js.map +1 -1
  78. package/dist/composed/confirm-dialog.d.ts.map +1 -1
  79. package/dist/composed/confirm-dialog.js.map +1 -1
  80. package/dist/composed/content-card.d.ts.map +1 -1
  81. package/dist/composed/content-card.js.map +1 -1
  82. package/dist/composed/date-picker/calendar-grid.d.ts.map +1 -1
  83. package/dist/composed/date-picker/date-picker.d.ts.map +1 -1
  84. package/dist/composed/date-picker/date-range-picker.d.ts.map +1 -1
  85. package/dist/composed/date-picker/date-time-picker.d.ts.map +1 -1
  86. package/dist/composed/date-picker/index.d.ts +11 -11
  87. package/dist/composed/date-picker/index.d.ts.map +1 -1
  88. package/dist/composed/date-picker/index.js +1 -1
  89. package/dist/composed/date-picker/month-picker.d.ts.map +1 -1
  90. package/dist/composed/date-picker/presets.d.ts.map +1 -1
  91. package/dist/composed/date-picker/time-picker.d.ts.map +1 -1
  92. package/dist/composed/date-picker/year-picker.d.ts.map +1 -1
  93. package/dist/composed/deadline-indicator.d.ts.map +1 -1
  94. package/dist/composed/deadline-indicator.js +25 -25
  95. package/dist/composed/deadline-indicator.js.map +1 -1
  96. package/dist/composed/emoji-picker.d.ts.map +1 -1
  97. package/dist/composed/emoji-picker.js +37 -37
  98. package/dist/composed/emoji-picker.js.map +1 -1
  99. package/dist/composed/empty-state.d.ts.map +1 -1
  100. package/dist/composed/empty-state.js +21 -21
  101. package/dist/composed/empty-state.js.map +1 -1
  102. package/dist/composed/error-boundary.d.ts +1 -1
  103. package/dist/composed/error-boundary.d.ts.map +1 -1
  104. package/dist/composed/error-boundary.js.map +1 -1
  105. package/dist/composed/extensions/emoji-node.d.ts.map +1 -1
  106. package/dist/composed/extensions/emoji-suggestion.d.ts.map +1 -1
  107. package/dist/composed/extensions/file-attachment.d.ts.map +1 -1
  108. package/dist/composed/extensions/mention-suggestion.d.ts +1 -1
  109. package/dist/composed/extensions/mention-suggestion.d.ts.map +1 -1
  110. package/dist/composed/extensions/slash-command.d.ts +1 -1
  111. package/dist/composed/extensions/slash-command.d.ts.map +1 -1
  112. package/dist/composed/file-preview/audio-preview.d.ts.map +1 -1
  113. package/dist/composed/file-preview/document-preview.d.ts.map +1 -1
  114. package/dist/composed/file-preview/embed-preview.d.ts.map +1 -1
  115. package/dist/composed/file-preview/image-preview.d.ts.map +1 -1
  116. package/dist/composed/file-preview/shared.d.ts.map +1 -1
  117. package/dist/composed/file-preview/video-preview.d.ts.map +1 -1
  118. package/dist/composed/file-preview.d.ts.map +1 -1
  119. package/dist/composed/filter-bar.d.ts +1 -1
  120. package/dist/composed/filter-bar.d.ts.map +1 -1
  121. package/dist/composed/filter-bar.js +54 -54
  122. package/dist/composed/filter-bar.js.map +1 -1
  123. package/dist/composed/form-section.d.ts.map +1 -1
  124. package/dist/composed/form-section.js +26 -26
  125. package/dist/composed/form-section.js.map +1 -1
  126. package/dist/composed/global-loading.d.ts.map +1 -1
  127. package/dist/composed/global-loading.js.map +1 -1
  128. package/dist/composed/index.d.ts +55 -55
  129. package/dist/composed/index.d.ts.map +1 -1
  130. package/dist/composed/index.js +17 -17
  131. package/dist/composed/inline-edit.d.ts.map +1 -1
  132. package/dist/composed/inline-edit.js.map +1 -1
  133. package/dist/composed/loading-skeleton.d.ts +1 -1
  134. package/dist/composed/loading-skeleton.d.ts.map +1 -1
  135. package/dist/composed/loading-skeleton.js.map +1 -1
  136. package/dist/composed/markdown-viewer.d.ts.map +1 -1
  137. package/dist/composed/markdown-viewer.js +3 -3
  138. package/dist/composed/markdown-viewer.js.map +1 -1
  139. package/dist/composed/master-detail.d.ts.map +1 -1
  140. package/dist/composed/master-detail.js +42 -42
  141. package/dist/composed/master-detail.js.map +1 -1
  142. package/dist/composed/member-picker.d.ts.map +1 -1
  143. package/dist/composed/member-picker.js.map +1 -1
  144. package/dist/composed/multi-select-popover.d.ts.map +1 -1
  145. package/dist/composed/multi-select-popover.js +55 -55
  146. package/dist/composed/multi-select-popover.js.map +1 -1
  147. package/dist/composed/page-header.d.ts.map +1 -1
  148. package/dist/composed/page-header.js.map +1 -1
  149. package/dist/composed/page-skeletons.d.ts.map +1 -1
  150. package/dist/composed/page-skeletons.js.map +1 -1
  151. package/dist/composed/priority-indicator.d.ts.map +1 -1
  152. package/dist/composed/priority-indicator.js +34 -34
  153. package/dist/composed/priority-indicator.js.map +1 -1
  154. package/dist/composed/responsive-overlay.d.ts.map +1 -1
  155. package/dist/composed/responsive-overlay.js.map +1 -1
  156. package/dist/composed/rich-chat-input/attachment-strip.d.ts.map +1 -1
  157. package/dist/composed/rich-chat-input/audio-player.d.ts.map +1 -1
  158. package/dist/composed/rich-chat-input/audio-waveform.d.ts.map +1 -1
  159. package/dist/composed/rich-chat-input/chat-toolbar.d.ts.map +1 -1
  160. package/dist/composed/rich-chat-input/recording-overlay.d.ts.map +1 -1
  161. package/dist/composed/rich-chat-input/reply-banner.d.ts.map +1 -1
  162. package/dist/composed/rich-chat-input/schedule-send.d.ts.map +1 -1
  163. package/dist/composed/rich-chat-input.d.ts +6 -6
  164. package/dist/composed/rich-chat-input.d.ts.map +1 -1
  165. package/dist/composed/rich-chat-input.js +1 -1
  166. package/dist/composed/rich-text-editor.d.ts.map +1 -1
  167. package/dist/composed/rich-text-editor.js +25 -25
  168. package/dist/composed/rich-text-editor.js.map +1 -1
  169. package/dist/composed/schedule-view.d.ts.map +1 -1
  170. package/dist/composed/schedule-view.js +53 -53
  171. package/dist/composed/schedule-view.js.map +1 -1
  172. package/dist/composed/simple-tooltip.d.ts.map +1 -1
  173. package/dist/composed/simple-tooltip.js.map +1 -1
  174. package/dist/composed/status-badge.d.ts +1 -1
  175. package/dist/composed/status-badge.d.ts.map +1 -1
  176. package/dist/composed/status-badge.js +30 -30
  177. package/dist/composed/status-badge.js.map +1 -1
  178. package/dist/hooks/index.d.ts +3 -3
  179. package/dist/hooks/index.d.ts.map +1 -1
  180. package/dist/hooks/index.js +1 -1
  181. package/dist/hooks/use-color-mode.js.map +1 -1
  182. package/dist/hooks/use-toast.d.ts +1 -1
  183. package/dist/hooks/use-toast.d.ts.map +1 -1
  184. package/dist/motion/index.d.ts +2 -2
  185. package/dist/motion/index.d.ts.map +1 -1
  186. package/dist/motion/index.js.map +1 -1
  187. package/dist/motion/motion-provider.d.ts +1 -1
  188. package/dist/motion/motion-provider.d.ts.map +1 -1
  189. package/dist/motion/primitives-index.d.ts +1 -1
  190. package/dist/motion/primitives-index.d.ts.map +1 -1
  191. package/dist/motion/primitives-index.js +40 -40
  192. package/dist/motion/primitives-index.js.map +1 -1
  193. package/dist/motion/primitives.d.ts +1 -1
  194. package/dist/motion/primitives.d.ts.map +1 -1
  195. package/dist/shell/app-command-palette.d.ts +0 -8
  196. package/dist/shell/app-command-palette.d.ts.map +1 -1
  197. package/dist/shell/app-command-palette.js.map +1 -1
  198. package/dist/shell/bottom-navbar.d.ts +0 -6
  199. package/dist/shell/bottom-navbar.d.ts.map +1 -1
  200. package/dist/shell/bottom-navbar.js +62 -62
  201. package/dist/shell/bottom-navbar.js.map +1 -1
  202. package/dist/shell/index.d.ts +8 -8
  203. package/dist/shell/index.d.ts.map +1 -1
  204. package/dist/shell/index.js +5 -5
  205. package/dist/shell/link-context.d.ts +1 -1
  206. package/dist/shell/link-context.d.ts.map +1 -1
  207. package/dist/shell/notification-center.d.ts +0 -6
  208. package/dist/shell/notification-center.d.ts.map +1 -1
  209. package/dist/shell/notification-center.js +54 -54
  210. package/dist/shell/notification-center.js.map +1 -1
  211. package/dist/shell/notification-preferences.d.ts +0 -6
  212. package/dist/shell/notification-preferences.d.ts.map +1 -1
  213. package/dist/shell/notification-preferences.js +22 -22
  214. package/dist/shell/notification-preferences.js.map +1 -1
  215. package/dist/shell/sidebar.d.ts.map +1 -1
  216. package/dist/shell/sidebar.js.map +1 -1
  217. package/dist/shell/top-bar.d.ts +0 -6
  218. package/dist/shell/top-bar.d.ts.map +1 -1
  219. package/dist/shell/top-bar.js.map +1 -1
  220. package/dist/tailwind/index.cjs +15 -499
  221. package/dist/tailwind/preset.d.ts +21 -0
  222. package/dist/tailwind/preset.d.ts.map +1 -1
  223. package/dist/tailwind/preset.js +14 -489
  224. package/dist/tailwind/preset.js.map +1 -1
  225. package/dist/tokens/animations.css +17 -0
  226. package/dist/tokens/base.css +26 -0
  227. package/dist/tokens/index.css +22 -0
  228. package/dist/tokens/semantic.css +436 -464
  229. package/dist/tokens/shilp-sutra.css +41 -0
  230. package/dist/tokens/typography-semantic.css +48 -41
  231. package/dist/tokens/utilities.css +276 -0
  232. package/dist/tokens/variants.css +14 -0
  233. package/dist/ui/accordion.d.ts +2 -2
  234. package/dist/ui/accordion.d.ts.map +1 -1
  235. package/dist/ui/accordion.js +23 -23
  236. package/dist/ui/accordion.js.map +1 -1
  237. package/dist/ui/alert-dialog.d.ts +2 -2
  238. package/dist/ui/alert-dialog.d.ts.map +1 -1
  239. package/dist/ui/alert-dialog.js +37 -37
  240. package/dist/ui/alert-dialog.js.map +1 -1
  241. package/dist/ui/alert.d.ts.map +1 -1
  242. package/dist/ui/alert.js +36 -36
  243. package/dist/ui/alert.js.map +1 -1
  244. package/dist/ui/aspect-ratio.d.ts +1 -1
  245. package/dist/ui/aspect-ratio.d.ts.map +1 -1
  246. package/dist/ui/aspect-ratio.js.map +1 -1
  247. package/dist/ui/autocomplete.d.ts +1 -1
  248. package/dist/ui/autocomplete.d.ts.map +1 -1
  249. package/dist/ui/autocomplete.js +27 -27
  250. package/dist/ui/autocomplete.js.map +1 -1
  251. package/dist/ui/avatar.d.ts +2 -2
  252. package/dist/ui/avatar.d.ts.map +1 -1
  253. package/dist/ui/avatar.js +41 -41
  254. package/dist/ui/avatar.js.map +1 -1
  255. package/dist/ui/badge-group.d.ts.map +1 -1
  256. package/dist/ui/badge-indicator.d.ts.map +1 -1
  257. package/dist/ui/badge-indicator.js +10 -10
  258. package/dist/ui/badge-indicator.js.map +1 -1
  259. package/dist/ui/badge.d.ts +2 -2
  260. package/dist/ui/badge.d.ts.map +1 -1
  261. package/dist/ui/banner.d.ts.map +1 -1
  262. package/dist/ui/banner.js +28 -28
  263. package/dist/ui/banner.js.map +1 -1
  264. package/dist/ui/breadcrumb.d.ts +1 -1
  265. package/dist/ui/breadcrumb.d.ts.map +1 -1
  266. package/dist/ui/breadcrumb.js.map +1 -1
  267. package/dist/ui/button-group.d.ts.map +1 -1
  268. package/dist/ui/button-group.js.map +1 -1
  269. package/dist/ui/button-processing.d.ts.map +1 -1
  270. package/dist/ui/button-processing.js +15 -15
  271. package/dist/ui/button-processing.js.map +1 -1
  272. package/dist/ui/button.d.ts.map +1 -1
  273. package/dist/ui/button.js +84 -84
  274. package/dist/ui/button.js.map +1 -1
  275. package/dist/ui/card.d.ts +1 -1
  276. package/dist/ui/card.d.ts.map +1 -1
  277. package/dist/ui/card.js +28 -28
  278. package/dist/ui/card.js.map +1 -1
  279. package/dist/ui/charts/_internal/axes.d.ts +1 -1
  280. package/dist/ui/charts/_internal/axes.d.ts.map +1 -1
  281. package/dist/ui/charts/_internal/grid-lines.d.ts.map +1 -1
  282. package/dist/ui/charts/_internal/legend.d.ts.map +1 -1
  283. package/dist/ui/charts/_internal/tooltip.d.ts +1 -1
  284. package/dist/ui/charts/_internal/tooltip.d.ts.map +1 -1
  285. package/dist/ui/charts/area-chart.d.ts.map +1 -1
  286. package/dist/ui/charts/bar-chart.d.ts +1 -1
  287. package/dist/ui/charts/bar-chart.d.ts.map +1 -1
  288. package/dist/ui/charts/chart-container.d.ts.map +1 -1
  289. package/dist/ui/charts/gauge-chart.d.ts.map +1 -1
  290. package/dist/ui/charts/index.d.ts +5 -5
  291. package/dist/ui/charts/index.d.ts.map +1 -1
  292. package/dist/ui/charts/index.js +618 -618
  293. package/dist/ui/charts/index.js.map +1 -1
  294. package/dist/ui/charts/line-chart.d.ts.map +1 -1
  295. package/dist/ui/charts/pie-chart.d.ts.map +1 -1
  296. package/dist/ui/charts/radar-chart.d.ts.map +1 -1
  297. package/dist/ui/charts/sparkline.d.ts.map +1 -1
  298. package/dist/ui/chat/date-separator.d.ts.map +1 -1
  299. package/dist/ui/chat/index.d.ts +4 -4
  300. package/dist/ui/chat/index.d.ts.map +1 -1
  301. package/dist/ui/chat/index.js +1 -1
  302. package/dist/ui/chat/message-input.d.ts.map +1 -1
  303. package/dist/ui/chat/message-list.d.ts.map +1 -1
  304. package/dist/ui/chat/message.d.ts +1 -1
  305. package/dist/ui/chat/message.d.ts.map +1 -1
  306. package/dist/ui/chat/system-message.d.ts.map +1 -1
  307. package/dist/ui/chat/typing-indicator.d.ts.map +1 -1
  308. package/dist/ui/chat/unread-separator.d.ts.map +1 -1
  309. package/dist/ui/checkbox.d.ts.map +1 -1
  310. package/dist/ui/checkbox.js +18 -18
  311. package/dist/ui/checkbox.js.map +1 -1
  312. package/dist/ui/code.d.ts.map +1 -1
  313. package/dist/ui/code.js.map +1 -1
  314. package/dist/ui/collapsible.d.ts +2 -2
  315. package/dist/ui/collapsible.d.ts.map +1 -1
  316. package/dist/ui/collapsible.js +10 -10
  317. package/dist/ui/collapsible.js.map +1 -1
  318. package/dist/ui/color-input.d.ts.map +1 -1
  319. package/dist/ui/color-input.js +85 -85
  320. package/dist/ui/color-input.js.map +1 -1
  321. package/dist/ui/color-swatch.d.ts.map +1 -1
  322. package/dist/ui/color-swatch.js.map +1 -1
  323. package/dist/ui/combobox.d.ts.map +1 -1
  324. package/dist/ui/combobox.js +58 -58
  325. package/dist/ui/combobox.js.map +1 -1
  326. package/dist/ui/container.d.ts.map +1 -1
  327. package/dist/ui/container.js.map +1 -1
  328. package/dist/ui/context-menu.d.ts +2 -2
  329. package/dist/ui/context-menu.d.ts.map +1 -1
  330. package/dist/ui/context-menu.js +47 -47
  331. package/dist/ui/context-menu.js.map +1 -1
  332. package/dist/ui/data-table-body.d.ts +1 -1
  333. package/dist/ui/data-table-body.d.ts.map +1 -1
  334. package/dist/ui/data-table-body.js +43 -43
  335. package/dist/ui/data-table-body.js.map +1 -1
  336. package/dist/ui/data-table-bulk-actions.js.map +1 -1
  337. package/dist/ui/data-table-card.d.ts.map +1 -1
  338. package/dist/ui/data-table-card.js +7 -7
  339. package/dist/ui/data-table-card.js.map +1 -1
  340. package/dist/ui/data-table-context.d.ts +1 -1
  341. package/dist/ui/data-table-context.d.ts.map +1 -1
  342. package/dist/ui/data-table-context.js.map +1 -1
  343. package/dist/ui/data-table-header.js +38 -38
  344. package/dist/ui/data-table-header.js.map +1 -1
  345. package/dist/ui/data-table-pagination.js.map +1 -1
  346. package/dist/ui/data-table-toolbar.d.ts.map +1 -1
  347. package/dist/ui/data-table-toolbar.js.map +1 -1
  348. package/dist/ui/data-table.d.ts +2 -2
  349. package/dist/ui/data-table.d.ts.map +1 -1
  350. package/dist/ui/data-table.js +5 -5
  351. package/dist/ui/data-table.js.map +1 -1
  352. package/dist/ui/devalok-grain.js +8 -8
  353. package/dist/ui/devalok-grain.js.map +1 -1
  354. package/dist/ui/dialog.d.ts +2 -2
  355. package/dist/ui/dialog.d.ts.map +1 -1
  356. package/dist/ui/dialog.js +41 -41
  357. package/dist/ui/dialog.js.map +1 -1
  358. package/dist/ui/dropdown-menu.d.ts +2 -2
  359. package/dist/ui/dropdown-menu.d.ts.map +1 -1
  360. package/dist/ui/dropdown-menu.js +46 -46
  361. package/dist/ui/dropdown-menu.js.map +1 -1
  362. package/dist/ui/file-upload.d.ts.map +1 -1
  363. package/dist/ui/file-upload.js +54 -54
  364. package/dist/ui/file-upload.js.map +1 -1
  365. package/dist/ui/form.d.ts.map +1 -1
  366. package/dist/ui/form.js +17 -17
  367. package/dist/ui/form.js.map +1 -1
  368. package/dist/ui/hover-card.d.ts +2 -2
  369. package/dist/ui/hover-card.d.ts.map +1 -1
  370. package/dist/ui/hover-card.js +19 -19
  371. package/dist/ui/hover-card.js.map +1 -1
  372. package/dist/ui/icon-button.d.ts.map +1 -1
  373. package/dist/ui/icon-button.js.map +1 -1
  374. package/dist/ui/icon-group.d.ts.map +1 -1
  375. package/dist/ui/icon-group.js +4 -4
  376. package/dist/ui/icon-group.js.map +1 -1
  377. package/dist/ui/icon.d.ts.map +1 -1
  378. package/dist/ui/icon.js +32 -32
  379. package/dist/ui/icon.js.map +1 -1
  380. package/dist/ui/index.d.ts +57 -57
  381. package/dist/ui/index.d.ts.map +1 -1
  382. package/dist/ui/index.js +27 -27
  383. package/dist/ui/index.js.map +1 -1
  384. package/dist/ui/input-otp.d.ts +1 -1
  385. package/dist/ui/input-otp.d.ts.map +1 -1
  386. package/dist/ui/input-otp.js.map +1 -1
  387. package/dist/ui/input.d.ts.map +1 -1
  388. package/dist/ui/input.js +14 -14
  389. package/dist/ui/input.js.map +1 -1
  390. package/dist/ui/label.d.ts +1 -1
  391. package/dist/ui/label.d.ts.map +1 -1
  392. package/dist/ui/label.js.map +1 -1
  393. package/dist/ui/lib/bottom-sheet.d.ts.map +1 -1
  394. package/dist/ui/lib/index.d.ts +4 -4
  395. package/dist/ui/lib/index.d.ts.map +1 -1
  396. package/dist/ui/lib/slot.d.ts +1 -1
  397. package/dist/ui/lib/slot.d.ts.map +1 -1
  398. package/dist/ui/lib/utils.d.ts.map +1 -1
  399. package/dist/ui/lib/utils.js.map +1 -1
  400. package/dist/ui/link.d.ts.map +1 -1
  401. package/dist/ui/link.js.map +1 -1
  402. package/dist/ui/menubar.d.ts +2 -2
  403. package/dist/ui/menubar.d.ts.map +1 -1
  404. package/dist/ui/menubar.js +64 -64
  405. package/dist/ui/menubar.js.map +1 -1
  406. package/dist/ui/navigation-menu.d.ts +2 -2
  407. package/dist/ui/navigation-menu.d.ts.map +1 -1
  408. package/dist/ui/navigation-menu.js +72 -72
  409. package/dist/ui/navigation-menu.js.map +1 -1
  410. package/dist/ui/number-input.d.ts.map +1 -1
  411. package/dist/ui/number-input.js.map +1 -1
  412. package/dist/ui/pagination.d.ts +1 -1
  413. package/dist/ui/pagination.d.ts.map +1 -1
  414. package/dist/ui/pagination.js.map +1 -1
  415. package/dist/ui/popover.d.ts +2 -2
  416. package/dist/ui/popover.d.ts.map +1 -1
  417. package/dist/ui/progress-ring.d.ts +1 -1
  418. package/dist/ui/progress-ring.d.ts.map +1 -1
  419. package/dist/ui/progress-ring.js +33 -33
  420. package/dist/ui/progress-ring.js.map +1 -1
  421. package/dist/ui/progress.d.ts +2 -2
  422. package/dist/ui/progress.d.ts.map +1 -1
  423. package/dist/ui/progress.js +23 -23
  424. package/dist/ui/progress.js.map +1 -1
  425. package/dist/ui/radio.d.ts.map +1 -1
  426. package/dist/ui/radio.js +19 -19
  427. package/dist/ui/radio.js.map +1 -1
  428. package/dist/ui/search-input.d.ts.map +1 -1
  429. package/dist/ui/search-input.js +17 -17
  430. package/dist/ui/search-input.js.map +1 -1
  431. package/dist/ui/segmented-control.d.ts.map +1 -1
  432. package/dist/ui/segmented-control.js +19 -19
  433. package/dist/ui/segmented-control.js.map +1 -1
  434. package/dist/ui/select.d.ts +2 -2
  435. package/dist/ui/select.d.ts.map +1 -1
  436. package/dist/ui/select.js +68 -68
  437. package/dist/ui/select.js.map +1 -1
  438. package/dist/ui/separator.d.ts +1 -1
  439. package/dist/ui/separator.d.ts.map +1 -1
  440. package/dist/ui/separator.js.map +1 -1
  441. package/dist/ui/sheet.d.ts +2 -2
  442. package/dist/ui/sheet.d.ts.map +1 -1
  443. package/dist/ui/sheet.js +44 -44
  444. package/dist/ui/sheet.js.map +1 -1
  445. package/dist/ui/sidebar.d.ts +1 -1
  446. package/dist/ui/sidebar.d.ts.map +1 -1
  447. package/dist/ui/sidebar.js +156 -156
  448. package/dist/ui/sidebar.js.map +1 -1
  449. package/dist/ui/skeleton.d.ts +1 -1
  450. package/dist/ui/skeleton.d.ts.map +1 -1
  451. package/dist/ui/skeleton.js +2 -2
  452. package/dist/ui/skeleton.js.map +1 -1
  453. package/dist/ui/slider.d.ts +2 -2
  454. package/dist/ui/slider.d.ts.map +1 -1
  455. package/dist/ui/slider.js +5 -5
  456. package/dist/ui/slider.js.map +1 -1
  457. package/dist/ui/spinner.d.ts.map +1 -1
  458. package/dist/ui/spinner.js +21 -21
  459. package/dist/ui/spinner.js.map +1 -1
  460. package/dist/ui/split-button.d.ts +1 -1
  461. package/dist/ui/split-button.d.ts.map +1 -1
  462. package/dist/ui/split-button.js +28 -28
  463. package/dist/ui/split-button.js.map +1 -1
  464. package/dist/ui/stack.d.ts +1 -1
  465. package/dist/ui/stack.d.ts.map +1 -1
  466. package/dist/ui/stack.js.map +1 -1
  467. package/dist/ui/stat-card.d.ts.map +1 -1
  468. package/dist/ui/stat-card.js +73 -73
  469. package/dist/ui/stat-card.js.map +1 -1
  470. package/dist/ui/status-dot.d.ts.map +1 -1
  471. package/dist/ui/status-dot.js.map +1 -1
  472. package/dist/ui/stepper.d.ts +1 -1
  473. package/dist/ui/stepper.d.ts.map +1 -1
  474. package/dist/ui/stepper.js +48 -48
  475. package/dist/ui/stepper.js.map +1 -1
  476. package/dist/ui/switch.d.ts +1 -1
  477. package/dist/ui/switch.d.ts.map +1 -1
  478. package/dist/ui/switch.js +15 -15
  479. package/dist/ui/switch.js.map +1 -1
  480. package/dist/ui/table.d.ts +1 -1
  481. package/dist/ui/table.d.ts.map +1 -1
  482. package/dist/ui/table.js.map +1 -1
  483. package/dist/ui/tabs.d.ts +2 -2
  484. package/dist/ui/tabs.d.ts.map +1 -1
  485. package/dist/ui/tabs.js +52 -52
  486. package/dist/ui/tabs.js.map +1 -1
  487. package/dist/ui/text.d.ts +1 -1
  488. package/dist/ui/text.d.ts.map +1 -1
  489. package/dist/ui/text.js.map +1 -1
  490. package/dist/ui/textarea.d.ts.map +1 -1
  491. package/dist/ui/textarea.js +13 -13
  492. package/dist/ui/textarea.js.map +1 -1
  493. package/dist/ui/toast-registry.js.map +1 -1
  494. package/dist/ui/toast.d.ts +3 -3
  495. package/dist/ui/toast.d.ts.map +1 -1
  496. package/dist/ui/toast.js +164 -164
  497. package/dist/ui/toast.js.map +1 -1
  498. package/dist/ui/toaster.d.ts.map +1 -1
  499. package/dist/ui/toaster.js +6 -6
  500. package/dist/ui/toaster.js.map +1 -1
  501. package/dist/ui/toggle-group.d.ts +1 -1
  502. package/dist/ui/toggle-group.d.ts.map +1 -1
  503. package/dist/ui/toggle-group.js.map +1 -1
  504. package/dist/ui/toggle.d.ts +1 -1
  505. package/dist/ui/toggle.d.ts.map +1 -1
  506. package/dist/ui/toggle.js +14 -14
  507. package/dist/ui/toggle.js.map +1 -1
  508. package/dist/ui/tooltip.d.ts +2 -2
  509. package/dist/ui/tooltip.d.ts.map +1 -1
  510. package/dist/ui/tooltip.js +26 -26
  511. package/dist/ui/tooltip.js.map +1 -1
  512. package/dist/ui/tree-view/index.d.ts +2 -2
  513. package/dist/ui/tree-view/index.d.ts.map +1 -1
  514. package/dist/ui/tree-view/index.js +1 -1
  515. package/dist/ui/tree-view/tree-view.d.ts +1 -1
  516. package/dist/ui/tree-view/tree-view.d.ts.map +1 -1
  517. package/dist/ui/visually-hidden.d.ts.map +1 -1
  518. package/dist/ui/visually-hidden.js.map +1 -1
  519. package/docs/components/_header.md +96 -0
  520. package/docs/rollback.md +179 -0
  521. package/llms-full.txt +97 -1
  522. package/llms.txt +24 -2
  523. package/package.json +296 -277
  524. package/dist/_chunks/framer.js +0 -5604
  525. package/dist/_chunks/framer.js.map +0 -1
  526. package/dist/_chunks/rolldown-runtime.js +0 -21
  527. package/dist/_chunks/sonner.js +0 -616
  528. package/dist/_chunks/sonner.js.map +0 -1
  529. package/dist/_chunks/stat-row.js +0 -432
  530. package/dist/_chunks/stat-row.js.map +0 -1
@@ -1,86 +1,66 @@
1
1
  "use client";
2
- import { a as e } from "../../_chunks/framer.js";
3
- import { motionProps as t, tweens as n } from "../lib/motion.js";
4
- import { cn as r } from "../lib/utils.js";
5
- import { n as i } from "../../_chunks/motion-provider.js";
6
- import * as a from "react";
7
- import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
8
- import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
2
+ import { motionProps as e, tweens as t } from "../lib/motion.js";
3
+ import { cn as n } from "../lib/utils.js";
4
+ import { n as r } from "../../_chunks/motion-provider.js";
5
+ import * as i from "react";
6
+ import { useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
7
+ import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
8
+ import { motion as f } from "framer-motion";
9
9
  import { scaleBand as p, scaleLinear as m, scalePoint as h } from "d3-scale";
10
- import { axisBottom as g, axisLeft as _, axisRight as v, axisTop as y } from "d3-axis";
11
- import { select as b } from "d3-selection";
12
- import { arc as x, area as S, curveLinear as C, curveLinearClosed as w, curveMonotoneX as T, line as E, lineRadial as D, pie as O, stack as k, stackOffsetNone as A, stackOrderNone as j } from "d3-shape";
13
- //#region src/ui/charts/_internal/types.ts
14
- var M = {
15
- top: 20,
16
- right: 20,
17
- bottom: 40,
18
- left: 50
19
- }, N = a.forwardRef(({ height: e = 300, margin: t, className: n, ariaLabel: i = "Chart", ariaDescription: a, children: o, ...u }, p) => {
20
- let m = c(null), [h, g] = l(0), _ = {
21
- ...M,
22
- ...t
23
- };
24
- s(() => {
25
- if (!m.current) return;
26
- let e = new ResizeObserver((e) => {
27
- let t = e[0];
28
- t && g(t.contentRect.width);
29
- });
30
- return e.observe(m.current), () => e.disconnect();
31
- }, []);
32
- let v = Math.max(0, h - _.left - _.right), y = Math.max(0, e - _.top - _.bottom);
33
- return /* @__PURE__ */ d("div", {
34
- ref: (e) => {
35
- m.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
36
- },
37
- className: r("relative w-full", n),
38
- ...u,
39
- children: h > 0 && /* @__PURE__ */ f("svg", {
40
- width: h,
41
- height: e,
42
- role: "img",
43
- "aria-label": i,
44
- children: [a && /* @__PURE__ */ d("desc", { children: a }), /* @__PURE__ */ d("g", {
45
- transform: `translate(${_.left},${_.top})`,
46
- children: o({
47
- width: v,
48
- height: y,
49
- margin: _
50
- })
51
- })]
52
- })
10
+ import { arc as g, area as _, curveLinear as v, curveLinearClosed as y, curveMonotoneX as b, line as x, lineRadial as S, pie as C, stack as w, stackOffsetNone as T, stackOrderNone as E } from "d3-shape";
11
+ import { axisBottom as D, axisLeft as O, axisRight as k, axisTop as A } from "d3-axis";
12
+ import { select as j } from "d3-selection";
13
+ //#region src/ui/charts/_internal/legend.tsx
14
+ function M({ items: e, position: t = "bottom", className: r }) {
15
+ return /* @__PURE__ */ u("div", {
16
+ className: n("flex gap-ds-04 text-ds-sm text-surface-fg-muted", t === "left" || t === "right" ? "flex-col" : "flex-row flex-wrap justify-center", r),
17
+ children: e.map((e) => /* @__PURE__ */ d("div", {
18
+ className: "flex items-center gap-ds-02",
19
+ children: [/* @__PURE__ */ u("span", {
20
+ className: "inline-block h-3 w-3 shrink-0 rounded-ds-sm",
21
+ style: { backgroundColor: e.color }
22
+ }), /* @__PURE__ */ u("span", { children: e.label })]
23
+ }, e.label))
53
24
  });
54
- });
55
- N.displayName = "ChartContainer";
25
+ }
26
+ M.displayName = "Legend";
27
+ //#endregion
28
+ //#region src/ui/charts/_internal/animation.ts
29
+ function N() {
30
+ let { reducedMotion: e } = r();
31
+ return e;
32
+ }
33
+ function P(e, t = 300) {
34
+ return e ? 0 : t;
35
+ }
56
36
  //#endregion
57
37
  //#region src/ui/charts/_internal/axes.tsx
58
- function P({ scale: e, orientation: t, transform: n, tickCount: r, tickFormat: i, label: a, className: o }) {
59
- let l = c(null);
60
- return s(() => {
38
+ function F({ scale: e, orientation: t, transform: n, tickCount: r, tickFormat: i, label: a, className: c }) {
39
+ let l = s(null);
40
+ return o(() => {
61
41
  if (!l.current) return;
62
42
  let n = {
63
- top: y,
64
- right: v,
65
- bottom: g,
66
- left: _
43
+ top: A,
44
+ right: k,
45
+ bottom: D,
46
+ left: O
67
47
  }[t], a = n(e);
68
48
  r && (a = a.ticks(r)), i && (a = a.tickFormat(i));
69
- let o = b(l.current);
70
- o.call(a), o.selectAll(".tick line").attr("stroke", "var(--color-surface-border)"), o.selectAll(".tick text").attr("fill", "var(--color-surface-fg-muted)").attr("font-size", "var(--font-size-xs)"), o.selectAll(".domain").attr("stroke", "var(--color-surface-border-strong)");
49
+ let o = j(l.current);
50
+ o.call(a), o.selectAll(".tick line").attr("stroke", "var(--color-surface-border)"), o.selectAll(".tick text").attr("fill", "var(--color-surface-fg-muted)").attr("font-size", "var(--text-ds-xs)"), o.selectAll(".domain").attr("stroke", "var(--color-surface-border-strong)");
71
51
  }, [
72
52
  e,
73
53
  t,
74
54
  r,
75
55
  i
76
- ]), /* @__PURE__ */ d("g", {
56
+ ]), /* @__PURE__ */ u("g", {
77
57
  ref: l,
78
58
  transform: n,
79
- className: o,
80
- children: a && /* @__PURE__ */ d("text", {
59
+ className: c,
60
+ children: a && /* @__PURE__ */ u("text", {
81
61
  textAnchor: "middle",
82
62
  fill: "var(--color-surface-fg-muted)",
83
- fontSize: "var(--font-size-sm)",
63
+ fontSize: "var(--text-ds-sm)",
84
64
  ...t === "bottom" ? {
85
65
  x: "50%",
86
66
  dy: 35
@@ -93,13 +73,31 @@ function P({ scale: e, orientation: t, transform: n, tickCount: r, tickFormat: i
93
73
  })
94
74
  });
95
75
  }
96
- P.displayName = "Axis";
76
+ F.displayName = "Axis";
77
+ //#endregion
78
+ //#region src/ui/charts/_internal/colors.ts
79
+ var I = [
80
+ "chart-1",
81
+ "chart-2",
82
+ "chart-3",
83
+ "chart-4",
84
+ "chart-5",
85
+ "chart-6",
86
+ "chart-7",
87
+ "chart-8"
88
+ ];
89
+ function L(e) {
90
+ return `var(--${e})`;
91
+ }
92
+ function R(e, t = 0) {
93
+ return e ? I.includes(e) ? L(e) : e : L(I[t % I.length]);
94
+ }
97
95
  //#endregion
98
96
  //#region src/ui/charts/_internal/grid-lines.tsx
99
- function F({ width: e, height: t, xScale: n, yScale: r, horizontal: i = !0, vertical: a = !1 }) {
100
- return /* @__PURE__ */ f("g", {
97
+ function z({ width: e, height: t, xScale: n, yScale: r, horizontal: i = !0, vertical: a = !1 }) {
98
+ return /* @__PURE__ */ d("g", {
101
99
  className: "grid-lines",
102
- children: [i && r?.ticks && r.ticks().map((t, n) => /* @__PURE__ */ d("line", {
100
+ children: [i && r?.ticks && r.ticks().map((t, n) => /* @__PURE__ */ u("line", {
103
101
  x1: 0,
104
102
  x2: e,
105
103
  y1: r(t),
@@ -107,7 +105,7 @@ function F({ width: e, height: t, xScale: n, yScale: r, horizontal: i = !0, vert
107
105
  stroke: "var(--color-surface-border)",
108
106
  strokeDasharray: "3,3",
109
107
  opacity: .6
110
- }, `h-${n}`)), a && n?.ticks && n.ticks().map((e, r) => /* @__PURE__ */ d("line", {
108
+ }, `h-${n}`)), a && n?.ticks && n.ticks().map((e, r) => /* @__PURE__ */ u("line", {
111
109
  x1: n(e),
112
110
  x2: n(e),
113
111
  y1: 0,
@@ -118,27 +116,12 @@ function F({ width: e, height: t, xScale: n, yScale: r, horizontal: i = !0, vert
118
116
  }, `v-${r}`))]
119
117
  });
120
118
  }
121
- F.displayName = "GridLines";
122
- //#endregion
123
- //#region src/ui/charts/_internal/legend.tsx
124
- function I({ items: e, position: t = "bottom", className: n }) {
125
- return /* @__PURE__ */ d("div", {
126
- className: r("flex gap-ds-04 text-ds-sm text-surface-fg-muted", t === "left" || t === "right" ? "flex-col" : "flex-row flex-wrap justify-center", n),
127
- children: e.map((e) => /* @__PURE__ */ f("div", {
128
- className: "flex items-center gap-ds-02",
129
- children: [/* @__PURE__ */ d("span", {
130
- className: "inline-block h-3 w-3 shrink-0 rounded-ds-sm",
131
- style: { backgroundColor: e.color }
132
- }), /* @__PURE__ */ d("span", { children: e.label })]
133
- }, e.label))
134
- });
135
- }
136
- I.displayName = "Legend";
119
+ z.displayName = "GridLines";
137
120
  //#endregion
138
121
  //#region src/ui/charts/_internal/tooltip.tsx
139
- function L({ state: e, className: t }) {
140
- return e.visible ? /* @__PURE__ */ d("div", {
141
- className: r("pointer-events-none absolute z-tooltip", "rounded-ds-md border border-surface-border-strong", "bg-surface-overlay px-ds-03 py-ds-02", "shadow-raised-hover", "text-ds-sm text-surface-fg", t),
122
+ function B({ state: e, className: t }) {
123
+ return e.visible ? /* @__PURE__ */ u("div", {
124
+ className: n("pointer-events-none absolute z-tooltip", "rounded-ds-md border border-surface-border-strong", "bg-surface-overlay px-ds-03 py-ds-02", "shadow-raised-hover", "text-ds-sm text-surface-fg", t),
142
125
  style: {
143
126
  left: e.x + 12,
144
127
  top: e.y - 12
@@ -146,9 +129,9 @@ function L({ state: e, className: t }) {
146
129
  children: e.content
147
130
  }) : null;
148
131
  }
149
- L.displayName = "ChartTooltip";
150
- function R() {
151
- let [e, t] = l({
132
+ B.displayName = "ChartTooltip";
133
+ function V() {
134
+ let [e, t] = c({
152
135
  visible: !1,
153
136
  x: 0,
154
137
  y: 0,
@@ -156,7 +139,7 @@ function R() {
156
139
  });
157
140
  return {
158
141
  tooltip: e,
159
- show: o((e, n, r) => {
142
+ show: a((e, n, r) => {
160
143
  t({
161
144
  visible: !0,
162
145
  x: e,
@@ -164,7 +147,7 @@ function R() {
164
147
  content: r
165
148
  });
166
149
  }, []),
167
- hide: o(() => {
150
+ hide: a(() => {
168
151
  t((e) => ({
169
152
  ...e,
170
153
  visible: !1
@@ -173,40 +156,221 @@ function R() {
173
156
  };
174
157
  }
175
158
  //#endregion
176
- //#region src/ui/charts/_internal/colors.ts
177
- var z = [
178
- "chart-1",
179
- "chart-2",
180
- "chart-3",
181
- "chart-4",
182
- "chart-5",
183
- "chart-6",
184
- "chart-7",
185
- "chart-8"
186
- ];
187
- function B(e) {
188
- return `var(--${e})`;
189
- }
190
- function V(e, t = 0) {
191
- return e ? z.includes(e) ? B(e) : e : B(z[t % z.length]);
192
- }
159
+ //#region src/ui/charts/_internal/types.ts
160
+ var H = {
161
+ top: 20,
162
+ right: 20,
163
+ bottom: 40,
164
+ left: 50
165
+ }, U = i.forwardRef(({ height: e = 300, margin: t, className: r, ariaLabel: i = "Chart", ariaDescription: a, children: l, ...f }, p) => {
166
+ let m = s(null), [h, g] = c(0), _ = {
167
+ ...H,
168
+ ...t
169
+ };
170
+ o(() => {
171
+ if (!m.current) return;
172
+ let e = new ResizeObserver((e) => {
173
+ let t = e[0];
174
+ t && g(t.contentRect.width);
175
+ });
176
+ return e.observe(m.current), () => e.disconnect();
177
+ }, []);
178
+ let v = Math.max(0, h - _.left - _.right), y = Math.max(0, e - _.top - _.bottom);
179
+ return /* @__PURE__ */ u("div", {
180
+ ref: (e) => {
181
+ m.current = e, typeof p == "function" ? p(e) : p && (p.current = e);
182
+ },
183
+ className: n("relative w-full", r),
184
+ ...f,
185
+ children: h > 0 && /* @__PURE__ */ d("svg", {
186
+ width: h,
187
+ height: e,
188
+ role: "img",
189
+ "aria-label": i,
190
+ children: [a && /* @__PURE__ */ u("desc", { children: a }), /* @__PURE__ */ u("g", {
191
+ transform: `translate(${_.left},${_.top})`,
192
+ children: l({
193
+ width: v,
194
+ height: y,
195
+ margin: _
196
+ })
197
+ })]
198
+ })
199
+ });
200
+ });
201
+ U.displayName = "ChartContainer";
193
202
  //#endregion
194
- //#region src/ui/charts/_internal/animation.ts
195
- function H() {
196
- let { reducedMotion: e } = i();
197
- return e;
198
- }
199
- function U(e, t = 300) {
200
- return e ? 0 : t;
201
- }
203
+ //#region src/ui/charts/area-chart.tsx
204
+ var W = i.forwardRef(({ data: r, xKey: a, series: o, curved: s = !1, stacked: c = !1, fillOpacity: p = .3, gradient: g = !1, strokeWidth: y = 2, height: S = 300, showGrid: C = !0, showTooltip: D = !0, showLegend: O = !1, animate: k = !0, xLabel: A, yLabel: j, ariaLabel: P, className: I, ...L }, H) => {
205
+ let { tooltip: W, show: G, hide: K } = V(), q = N(), J = k && !q, Y = o.map((e, t) => R(e.color, t)), X = i.useId();
206
+ return /* @__PURE__ */ d(f.div, {
207
+ ref: H,
208
+ className: n("relative", I),
209
+ ...J ? {
210
+ initial: {
211
+ opacity: 0,
212
+ scale: .96
213
+ },
214
+ animate: {
215
+ opacity: 1,
216
+ scale: 1
217
+ },
218
+ transition: t.fade
219
+ } : {},
220
+ ...e(L),
221
+ children: [
222
+ /* @__PURE__ */ u(U, {
223
+ height: S,
224
+ ariaLabel: P ?? "Area chart",
225
+ children: ({ width: e, height: t, margin: n }) => {
226
+ let i = r.map((e) => e[a]), f = i.every((e) => typeof e == "number"), S, O, k;
227
+ if (f) {
228
+ let t = i, n = Math.min(...t), o = Math.max(...t), s = m().domain([n, o]).range([0, e]);
229
+ S = s, O = (e) => s(Number(e[a])), k = (e) => s(Number(r[e][a]));
230
+ } else {
231
+ let t = i.map(String), n = h().domain(t).range([0, e]).padding(.5);
232
+ S = n, O = (e) => n(String(e[a])) ?? 0, k = (e) => n(String(r[e][a])) ?? 0;
233
+ }
234
+ let M;
235
+ M = Math.max(...c ? r.map((e) => o.reduce((t, n) => t + (Number(e[n.key]) || 0), 0)) : r.flatMap((e) => o.map((t) => Number(e[t.key]) || 0)));
236
+ let N = m().domain([0, M * 1.1]).range([t, 0]).nice(), P = s ? b : v, I = () => r.map((n, i) => {
237
+ let s = O(n), c = e / Math.max(r.length - 1, 1);
238
+ return /* @__PURE__ */ u("rect", {
239
+ x: s - c / 2,
240
+ y: 0,
241
+ width: c,
242
+ height: t,
243
+ fill: "transparent",
244
+ onMouseMove: (e) => {
245
+ let t = e.currentTarget.closest("div")?.getBoundingClientRect();
246
+ G(e.clientX - (t?.left ?? 0), e.clientY - (t?.top ?? 0), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
247
+ className: "font-medium",
248
+ children: String(n[a])
249
+ }), o.map((e, t) => /* @__PURE__ */ d("div", {
250
+ className: "flex items-center gap-ds-02",
251
+ children: [
252
+ /* @__PURE__ */ u("span", {
253
+ className: "inline-block h-2 w-2 rounded-ds-full",
254
+ style: { backgroundColor: Y[t] }
255
+ }),
256
+ /* @__PURE__ */ d("span", {
257
+ className: "text-surface-fg-muted",
258
+ children: [e.label, ":"]
259
+ }),
260
+ " ",
261
+ Number(n[e.key]).toLocaleString()
262
+ ]
263
+ }, e.key))] }));
264
+ },
265
+ onMouseLeave: K
266
+ }, `hover-${i}`);
267
+ }), L = () => g ? /* @__PURE__ */ u("defs", { children: o.map((e, t) => /* @__PURE__ */ d("linearGradient", {
268
+ id: `${X}-gradient-${t}`,
269
+ x1: "0",
270
+ y1: "0",
271
+ x2: "0",
272
+ y2: "1",
273
+ children: [/* @__PURE__ */ u("stop", {
274
+ offset: "0%",
275
+ stopColor: Y[t],
276
+ stopOpacity: p
277
+ }), /* @__PURE__ */ u("stop", {
278
+ offset: "100%",
279
+ stopColor: Y[t],
280
+ stopOpacity: .05
281
+ })]
282
+ }, `grad-${t}`)) }) : null, R = () => /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(F, {
283
+ scale: S,
284
+ orientation: "bottom",
285
+ transform: `translate(0,${t})`,
286
+ label: A
287
+ }), /* @__PURE__ */ u(F, {
288
+ scale: N,
289
+ orientation: "left",
290
+ label: j
291
+ })] });
292
+ if (c) {
293
+ let n = o.map((e) => e.key), i = w().keys(n).order(E).offset(T)(r.map((e) => {
294
+ let t = { [a]: String(e[a]) };
295
+ for (let n of o) t[n.key] = Number(e[n.key]) || 0;
296
+ return t;
297
+ })), s = _().curve(P).x((e, t) => k(t)).y0((e) => N(e[0])).y1((e) => N(e[1])), c = x().curve(P).x((e, t) => k(t)).y((e) => N(e[1]));
298
+ return /* @__PURE__ */ d(l, { children: [
299
+ L(),
300
+ C && /* @__PURE__ */ u(z, {
301
+ width: e,
302
+ height: t,
303
+ yScale: N,
304
+ horizontal: !0
305
+ }),
306
+ [...i].reverse().map((e, t) => {
307
+ let n = i.length - 1 - t, r = e, a = s(r) ?? "", l = c(r) ?? "";
308
+ return /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("path", {
309
+ d: a,
310
+ fill: g ? `url(#${X}-gradient-${n})` : Y[n],
311
+ opacity: g ? 1 : p
312
+ }), /* @__PURE__ */ u("path", {
313
+ d: l,
314
+ fill: "none",
315
+ stroke: Y[n],
316
+ strokeWidth: y,
317
+ strokeLinejoin: "round",
318
+ strokeLinecap: "round"
319
+ })] }, o[n].key);
320
+ }),
321
+ D && I(),
322
+ R()
323
+ ] });
324
+ }
325
+ let B = _().curve(P).defined((e) => e != null), V = x().curve(P).defined((e) => e != null);
326
+ return /* @__PURE__ */ d(l, { children: [
327
+ L(),
328
+ C && /* @__PURE__ */ u(z, {
329
+ width: e,
330
+ height: t,
331
+ yScale: N,
332
+ horizontal: !0
333
+ }),
334
+ [...o].reverse().map((e, n) => {
335
+ let i = o.length - 1 - n, a = B.x((e) => O(e)).y0(t).y1((t) => N(Number(t[e.key]) || 0)), s = V.x((e) => O(e)).y((t) => N(Number(t[e.key]) || 0)), c = a(r) ?? "", l = s(r) ?? "";
336
+ return /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("path", {
337
+ d: c,
338
+ fill: g ? `url(#${X}-gradient-${i})` : Y[i],
339
+ opacity: g ? 1 : p
340
+ }), /* @__PURE__ */ u("path", {
341
+ d: l,
342
+ fill: "none",
343
+ stroke: Y[i],
344
+ strokeWidth: y,
345
+ strokeLinejoin: "round",
346
+ strokeLinecap: "round"
347
+ })] }, e.key);
348
+ }),
349
+ D && I(),
350
+ R()
351
+ ] });
352
+ }
353
+ }),
354
+ D && /* @__PURE__ */ u(B, { state: W }),
355
+ O && o.length > 1 && /* @__PURE__ */ u(M, {
356
+ items: o.map((e, t) => ({
357
+ label: e.label,
358
+ color: Y[t]
359
+ })),
360
+ className: "mt-ds-04"
361
+ })
362
+ ]
363
+ });
364
+ });
365
+ W.displayName = "AreaChart";
202
366
  //#endregion
203
367
  //#region src/ui/charts/bar-chart.tsx
204
- var W = a.forwardRef(({ data: i, xKey: a, yKey: o, orientation: s = "vertical", stacked: c = !1, grouped: l = !1, color: h, height: g = 300, showGrid: _ = !0, showTooltip: v = !0, showLegend: y = !1, animate: b = !0, barRadius: x = 4, xLabel: S, yLabel: C, seriesLabels: w, ariaLabel: T, className: E, ...D }, O) => {
205
- let { tooltip: k, show: A, hide: j } = R(), M = H(), z = s === "vertical", B = b && !M, U = Array.isArray(o) ? o : [o], W = U.length > 1, G = W ? U.map((e, t) => V(Array.isArray(h) ? h[t] : typeof h == "string" ? h : void 0, t)) : [V(typeof h == "string" ? h : Array.isArray(h) ? h[0] : void 0, 0)];
206
- return /* @__PURE__ */ f(e.div, {
368
+ var G = i.forwardRef(({ data: r, xKey: i, yKey: a, orientation: o = "vertical", stacked: s = !1, grouped: c = !1, color: h, height: g = 300, showGrid: _ = !0, showTooltip: v = !0, showLegend: y = !1, animate: b = !0, barRadius: x = 4, xLabel: S, yLabel: C, seriesLabels: w, ariaLabel: T, className: E, ...D }, O) => {
369
+ let { tooltip: k, show: A, hide: j } = V(), P = N(), I = o === "vertical", L = b && !P, H = Array.isArray(a) ? a : [a], W = H.length > 1, G = W ? H.map((e, t) => R(Array.isArray(h) ? h[t] : typeof h == "string" ? h : void 0, t)) : [R(typeof h == "string" ? h : Array.isArray(h) ? h[0] : void 0, 0)];
370
+ return /* @__PURE__ */ d(f.div, {
207
371
  ref: O,
208
- className: r("relative", E),
209
- ...B ? {
372
+ className: n("relative", E),
373
+ ...L ? {
210
374
  initial: {
211
375
  opacity: 0,
212
376
  scale: .96
@@ -215,51 +379,51 @@ var W = a.forwardRef(({ data: i, xKey: a, yKey: o, orientation: s = "vertical",
215
379
  opacity: 1,
216
380
  scale: 1
217
381
  },
218
- transition: n.fade
382
+ transition: t.fade
219
383
  } : {},
220
- ...t(D),
384
+ ...e(D),
221
385
  children: [
222
- /* @__PURE__ */ d(N, {
386
+ /* @__PURE__ */ u(U, {
223
387
  height: g,
224
388
  ariaLabel: T ?? "Bar chart",
225
389
  children: ({ width: e, height: t, margin: n }) => {
226
- let r = i.map((e) => String(e[a])), o = i.map((e) => `${String(e[a])} — ${U.map((t, n) => `${w?.[n] ?? t}: ${Number(e[t]).toLocaleString()}`).join(", ")}`).join(". "), s;
227
- s = Math.max(...c ? i.map((e) => U.reduce((t, n) => t + (Number(e[n]) || 0), 0)) : i.flatMap((e) => U.map((t) => Number(e[t]) || 0)));
228
- let h = p().domain(r).range(z ? [0, e] : [0, t]).padding(.2), g = m().domain([0, s * 1.1]).range(z ? [t, 0] : [0, e]).nice(), y = h.bandwidth(), b = W && l ? y / U.length : y;
229
- return /* @__PURE__ */ f(u, { children: [
230
- /* @__PURE__ */ d("desc", { children: o }),
231
- _ && /* @__PURE__ */ d(F, {
390
+ let a = r.map((e) => String(e[i])), o = r.map((e) => `${String(e[i])} — ${H.map((t, n) => `${w?.[n] ?? t}: ${Number(e[t]).toLocaleString()}`).join(", ")}`).join(". "), f;
391
+ f = Math.max(...s ? r.map((e) => H.reduce((t, n) => t + (Number(e[n]) || 0), 0)) : r.flatMap((e) => H.map((t) => Number(e[t]) || 0)));
392
+ let h = p().domain(a).range(I ? [0, e] : [0, t]).padding(.2), g = m().domain([0, f * 1.1]).range(I ? [t, 0] : [0, e]).nice(), y = h.bandwidth(), b = W && c ? y / H.length : y;
393
+ return /* @__PURE__ */ d(l, { children: [
394
+ /* @__PURE__ */ u("desc", { children: o }),
395
+ _ && /* @__PURE__ */ u(z, {
232
396
  width: e,
233
397
  height: t,
234
- yScale: z ? g : void 0,
235
- xScale: z ? void 0 : g,
236
- horizontal: z,
237
- vertical: !z
398
+ yScale: I ? g : void 0,
399
+ xScale: I ? void 0 : g,
400
+ horizontal: I,
401
+ vertical: !I
238
402
  }),
239
- i.map((e) => {
240
- let n = String(e[a]), r = 0;
241
- return U.map((i, a) => {
242
- let o = Number(e[i]) || 0, s = G[a] || G[0], u, p, m, _;
243
- z ? (u = (h(n) ?? 0) + (l && W ? a * b : 0), p = g(c ? r + o : o), m = b, _ = c ? g(r) - g(r + o) : t - g(o)) : (u = c ? g(r) : 0, p = (h(n) ?? 0) + (l && W ? a * b : 0), m = c ? g(r + o) - g(r) : g(o), _ = b), c && (r += o);
244
- let y = w?.[a] ?? i, S = W ? `${n}, ${y}: ${o.toLocaleString()}` : `${n}: ${o.toLocaleString()}`, C = /* @__PURE__ */ f("div", { children: [
245
- /* @__PURE__ */ d("div", {
403
+ r.map((e) => {
404
+ let n = String(e[i]), r = 0;
405
+ return H.map((i, a) => {
406
+ let o = Number(e[i]) || 0, l = G[a] || G[0], f, p, m, _;
407
+ I ? (f = (h(n) ?? 0) + (c && W ? a * b : 0), p = g(s ? r + o : o), m = b, _ = s ? g(r) - g(r + o) : t - g(o)) : (f = s ? g(r) : 0, p = (h(n) ?? 0) + (c && W ? a * b : 0), m = s ? g(r + o) - g(r) : g(o), _ = b), s && (r += o);
408
+ let y = w?.[a] ?? i, S = W ? `${n}, ${y}: ${o.toLocaleString()}` : `${n}: ${o.toLocaleString()}`, C = /* @__PURE__ */ d("div", { children: [
409
+ /* @__PURE__ */ u("div", {
246
410
  className: "font-medium",
247
411
  children: n
248
412
  }),
249
- W && /* @__PURE__ */ d("div", {
413
+ W && /* @__PURE__ */ u("div", {
250
414
  className: "text-surface-fg-muted",
251
415
  children: y
252
416
  }),
253
- /* @__PURE__ */ d("div", { children: o.toLocaleString() })
417
+ /* @__PURE__ */ u("div", { children: o.toLocaleString() })
254
418
  ] });
255
- return /* @__PURE__ */ d("rect", {
256
- x: u,
419
+ return /* @__PURE__ */ u("rect", {
420
+ x: f,
257
421
  y: p,
258
422
  width: Math.max(0, m),
259
423
  height: Math.max(0, _),
260
424
  rx: x,
261
- fill: s,
262
- className: "transition-opacity hover:opacity-80 focus-visible:outline-none focus-visible:opacity-80",
425
+ fill: l,
426
+ className: "transition-opacity hover:opacity-80 focus-visible:outline-hidden focus-visible:opacity-80",
263
427
  tabIndex: v ? 0 : void 0,
264
428
  role: v ? "graphics-symbol" : void 0,
265
429
  "aria-label": S,
@@ -280,21 +444,21 @@ var W = a.forwardRef(({ data: i, xKey: a, yKey: o, orientation: s = "vertical",
280
444
  }, `${n}-${i}`);
281
445
  });
282
446
  }),
283
- z ? /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(P, {
447
+ I ? /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(F, {
284
448
  scale: h,
285
449
  orientation: "bottom",
286
450
  transform: `translate(0,${t})`,
287
451
  label: S
288
- }), /* @__PURE__ */ d(P, {
452
+ }), /* @__PURE__ */ u(F, {
289
453
  scale: g,
290
454
  orientation: "left",
291
455
  label: C
292
- })] }) : /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(P, {
456
+ })] }) : /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u(F, {
293
457
  scale: g,
294
458
  orientation: "bottom",
295
459
  transform: `translate(0,${t})`,
296
460
  label: S
297
- }), /* @__PURE__ */ d(P, {
461
+ }), /* @__PURE__ */ u(F, {
298
462
  scale: h,
299
463
  orientation: "left",
300
464
  label: C
@@ -302,9 +466,9 @@ var W = a.forwardRef(({ data: i, xKey: a, yKey: o, orientation: s = "vertical",
302
466
  ] });
303
467
  }
304
468
  }),
305
- v && /* @__PURE__ */ d(L, { state: k }),
306
- y && W && /* @__PURE__ */ d(I, {
307
- items: U.map((e, t) => ({
469
+ v && /* @__PURE__ */ u(B, { state: k }),
470
+ y && W && /* @__PURE__ */ u(M, {
471
+ items: H.map((e, t) => ({
308
472
  label: w?.[t] ?? e,
309
473
  color: G[t]
310
474
  })),
@@ -313,15 +477,78 @@ var W = a.forwardRef(({ data: i, xKey: a, yKey: o, orientation: s = "vertical",
313
477
  ]
314
478
  });
315
479
  });
316
- W.displayName = "BarChart";
480
+ G.displayName = "BarChart";
481
+ //#endregion
482
+ //#region src/ui/charts/gauge-chart.tsx
483
+ var K = (e) => e * Math.PI / 180, q = i.forwardRef(({ value: r, max: i = 100, min: a = 0, label: o, valueLabel: s, color: c, trackColor: l = "var(--color-surface-border)", height: p = 200, startAngle: m = -120, endAngle: h = 120, thickness: _ = 16, animate: v = !0, className: y, ...b }, x) => {
484
+ let S = N(), C = P(S, v ? 600 : 0), w = v && !S, T = R(c, 0), E = p, D = E / 2, O = Math.min(Math.max(r, a), i), k = i === a ? 0 : (O - a) / (i - a), A = m + (h - m) * k, j = typeof s == "function" ? s(O) : typeof s == "string" ? s : String(O), M = g().innerRadius(D - _).outerRadius(D).startAngle(K(m)).endAngle(K(h)).cornerRadius(_ / 2), F = g().innerRadius(D - _).outerRadius(D).startAngle(K(m)).endAngle(K(A)).cornerRadius(_ / 2), I = M(null) ?? "", L = F(null) ?? "";
485
+ return /* @__PURE__ */ u(f.div, {
486
+ ref: x,
487
+ className: n("inline-flex flex-col items-center", y),
488
+ ...w ? {
489
+ initial: {
490
+ opacity: 0,
491
+ scale: .96
492
+ },
493
+ animate: {
494
+ opacity: 1,
495
+ scale: 1
496
+ },
497
+ transition: t.fade
498
+ } : {},
499
+ ...e(b),
500
+ role: "meter",
501
+ "aria-valuenow": O,
502
+ "aria-valuemin": a,
503
+ "aria-valuemax": i,
504
+ "aria-label": o ?? "Gauge chart",
505
+ children: /* @__PURE__ */ u("svg", {
506
+ width: E,
507
+ height: E,
508
+ role: "img",
509
+ "aria-hidden": "true",
510
+ children: /* @__PURE__ */ d("g", {
511
+ transform: `translate(${D},${D})`,
512
+ children: [
513
+ /* @__PURE__ */ u("path", {
514
+ d: I,
515
+ fill: l
516
+ }),
517
+ /* @__PURE__ */ u("path", {
518
+ d: L,
519
+ fill: T,
520
+ style: C > 0 ? { transition: `d ${C}ms ease-out` } : void 0
521
+ }),
522
+ /* @__PURE__ */ u("text", {
523
+ x: 0,
524
+ y: o ? -4 : 0,
525
+ textAnchor: "middle",
526
+ dominantBaseline: "central",
527
+ className: "fill-surface-fg text-ds-2xl font-semibold",
528
+ children: j
529
+ }),
530
+ o && /* @__PURE__ */ u("text", {
531
+ x: 0,
532
+ y: 20,
533
+ textAnchor: "middle",
534
+ dominantBaseline: "central",
535
+ className: "fill-surface-fg-muted text-ds-xs",
536
+ children: o
537
+ })
538
+ ]
539
+ })
540
+ })
541
+ });
542
+ });
543
+ q.displayName = "GaugeChart";
317
544
  //#endregion
318
545
  //#region src/ui/charts/line-chart.tsx
319
- var G = a.forwardRef(({ data: i, xKey: a, series: o, curved: s = !1, showDots: c = !1, dotSize: l = 4, strokeWidth: p = 2, height: g = 300, showGrid: _ = !0, showTooltip: v = !0, showLegend: y = !1, animate: b = !0, xLabel: x, yLabel: S, ariaLabel: w, className: D, ...O }, k) => {
320
- let { tooltip: A, show: j, hide: M } = R(), z = H(), B = b && !z, U = o.map((e, t) => V(e.color, t));
321
- return /* @__PURE__ */ f(e.div, {
546
+ var J = i.forwardRef(({ data: r, xKey: i, series: a, curved: o = !1, showDots: s = !1, dotSize: c = 4, strokeWidth: p = 2, height: g = 300, showGrid: _ = !0, showTooltip: y = !0, showLegend: S = !1, animate: C = !0, xLabel: w, yLabel: T, ariaLabel: E, className: D, ...O }, k) => {
547
+ let { tooltip: A, show: j, hide: P } = V(), I = N(), L = C && !I, H = a.map((e, t) => R(e.color, t));
548
+ return /* @__PURE__ */ d(f.div, {
322
549
  ref: k,
323
- className: r("relative", D),
324
- ...B ? {
550
+ className: n("relative", D),
551
+ ...L ? {
325
552
  initial: {
326
553
  opacity: 0,
327
554
  scale: .96
@@ -330,57 +557,57 @@ var G = a.forwardRef(({ data: i, xKey: a, series: o, curved: s = !1, showDots: c
330
557
  opacity: 1,
331
558
  scale: 1
332
559
  },
333
- transition: n.fade
560
+ transition: t.fade
334
561
  } : {},
335
- ...t(O),
562
+ ...e(O),
336
563
  children: [
337
- /* @__PURE__ */ d(N, {
564
+ /* @__PURE__ */ u(U, {
338
565
  height: g,
339
- ariaLabel: w ?? "Line chart",
566
+ ariaLabel: E ?? "Line chart",
340
567
  children: ({ width: e, height: t, margin: n }) => {
341
- let r = i.map((e) => e[a]), g = r.every((e) => typeof e == "number"), y, b;
568
+ let f = r.map((e) => e[i]), g = f.every((e) => typeof e == "number"), S, C;
342
569
  if (g) {
343
- let t = r, n = Math.min(...t), i = Math.max(...t), o = m().domain([n, i]).range([0, e]);
344
- y = o, b = (e) => o(Number(e[a]));
570
+ let t = f, n = Math.min(...t), r = Math.max(...t), a = m().domain([n, r]).range([0, e]);
571
+ S = a, C = (e) => a(Number(e[i]));
345
572
  } else {
346
- let t = r.map(String), n = h().domain(t).range([0, e]).padding(.5);
347
- y = n, b = (e) => n(String(e[a])) ?? 0;
573
+ let t = f.map(String), n = h().domain(t).range([0, e]).padding(.5);
574
+ S = n, C = (e) => n(String(e[i])) ?? 0;
348
575
  }
349
- let w = i.flatMap((e) => o.map((t) => Number(e[t.key]) || 0)), D = Math.max(...w), O = m().domain([0, D * 1.1]).range([t, 0]).nice(), k = s ? T : C, A = E().curve(k).defined((e) => e != null);
350
- return /* @__PURE__ */ f(u, { children: [
351
- /* @__PURE__ */ d("desc", { children: i.map((e) => `${String(e[a])} — ${o.map((t) => `${t.label}: ${Number(e[t.key]).toLocaleString()}`).join(", ")}`).join(". ") }),
352
- _ && /* @__PURE__ */ d(F, {
576
+ let E = r.flatMap((e) => a.map((t) => Number(e[t.key]) || 0)), D = Math.max(...E), O = m().domain([0, D * 1.1]).range([t, 0]).nice(), k = o ? b : v, A = x().curve(k).defined((e) => e != null);
577
+ return /* @__PURE__ */ d(l, { children: [
578
+ /* @__PURE__ */ u("desc", { children: r.map((e) => `${String(e[i])} — ${a.map((t) => `${t.label}: ${Number(e[t.key]).toLocaleString()}`).join(", ")}`).join(". ") }),
579
+ _ && /* @__PURE__ */ u(z, {
353
580
  width: e,
354
581
  height: t,
355
582
  yScale: O,
356
583
  horizontal: !0
357
584
  }),
358
- o.map((e, t) => /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
359
- d: A.x((e) => b(e)).y((t) => O(Number(t[e.key]) || 0))(i) ?? "",
585
+ a.map((e, t) => /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("path", {
586
+ d: A.x((e) => C(e)).y((t) => O(Number(t[e.key]) || 0))(r) ?? "",
360
587
  fill: "none",
361
- stroke: U[t],
588
+ stroke: H[t],
362
589
  strokeWidth: p,
363
590
  strokeLinejoin: "round",
364
591
  strokeLinecap: "round"
365
- }), c && i.map((n, r) => /* @__PURE__ */ d("circle", {
366
- cx: b(n),
592
+ }), s && r.map((n, r) => /* @__PURE__ */ u("circle", {
593
+ cx: C(n),
367
594
  cy: O(Number(n[e.key]) || 0),
368
- r: l,
369
- fill: U[t],
595
+ r: c,
596
+ fill: H[t],
370
597
  className: "transition-opacity hover:opacity-80"
371
598
  }, `${e.key}-dot-${r}`))] }, e.key)),
372
- v && i.map((n, r) => {
373
- let s = b(n), c = e / Math.max(i.length - 1, 1), l = String(n[a]), u = `${l}: ${o.map((e) => `${e.label} ${Number(n[e.key]).toLocaleString()}`).join(", ")}`, p = /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
599
+ y && r.map((n, o) => {
600
+ let s = C(n), c = e / Math.max(r.length - 1, 1), l = String(n[i]), f = `${l}: ${a.map((e) => `${e.label} ${Number(n[e.key]).toLocaleString()}`).join(", ")}`, p = /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
374
601
  className: "font-medium",
375
602
  children: l
376
- }), o.map((e, t) => /* @__PURE__ */ f("div", {
603
+ }), a.map((e, t) => /* @__PURE__ */ d("div", {
377
604
  className: "flex items-center gap-ds-02",
378
605
  children: [
379
- /* @__PURE__ */ d("span", {
606
+ /* @__PURE__ */ u("span", {
380
607
  className: "inline-block h-2 w-2 rounded-ds-full",
381
- style: { backgroundColor: U[t] }
608
+ style: { backgroundColor: H[t] }
382
609
  }),
383
- /* @__PURE__ */ f("span", {
610
+ /* @__PURE__ */ d("span", {
384
611
  className: "text-surface-fg-muted",
385
612
  children: [e.label, ":"]
386
613
  }),
@@ -388,7 +615,7 @@ var G = a.forwardRef(({ data: i, xKey: a, series: o, curved: s = !1, showDots: c
388
615
  Number(n[e.key]).toLocaleString()
389
616
  ]
390
617
  }, e.key))] });
391
- return /* @__PURE__ */ d("rect", {
618
+ return /* @__PURE__ */ u("rect", {
392
619
  x: s - c / 2,
393
620
  y: 0,
394
621
  width: c,
@@ -396,228 +623,64 @@ var G = a.forwardRef(({ data: i, xKey: a, series: o, curved: s = !1, showDots: c
396
623
  fill: "transparent",
397
624
  tabIndex: 0,
398
625
  role: "graphics-symbol",
399
- "aria-label": u,
400
- className: "focus-visible:outline-none",
626
+ "aria-label": f,
627
+ className: "focus-visible:outline-hidden",
401
628
  onMouseMove: (e) => {
402
629
  let t = e.currentTarget.closest("div")?.getBoundingClientRect();
403
630
  j(e.clientX - (t?.left ?? 0), e.clientY - (t?.top ?? 0), p);
404
631
  },
405
- onMouseLeave: M,
632
+ onMouseLeave: P,
406
633
  onFocus: (e) => {
407
634
  let t = e.currentTarget.closest("div")?.getBoundingClientRect(), n = e.currentTarget.getBoundingClientRect();
408
635
  j(n.left + n.width / 2 - (t?.left ?? 0), n.top + n.height / 2 - (t?.top ?? 0), p);
409
636
  },
410
- onBlur: M
411
- }, `hover-${r}`);
637
+ onBlur: P
638
+ }, `hover-${o}`);
412
639
  }),
413
- /* @__PURE__ */ d(P, {
414
- scale: y,
640
+ /* @__PURE__ */ u(F, {
641
+ scale: S,
415
642
  orientation: "bottom",
416
643
  transform: `translate(0,${t})`,
417
- label: x
644
+ label: w
418
645
  }),
419
- /* @__PURE__ */ d(P, {
646
+ /* @__PURE__ */ u(F, {
420
647
  scale: O,
421
648
  orientation: "left",
422
- label: S
649
+ label: T
423
650
  })
424
651
  ] });
425
652
  }
426
653
  }),
427
- v && /* @__PURE__ */ d(L, { state: A }),
428
- y && o.length > 1 && /* @__PURE__ */ d(I, {
429
- items: o.map((e, t) => ({
654
+ y && /* @__PURE__ */ u(B, { state: A }),
655
+ S && a.length > 1 && /* @__PURE__ */ u(M, {
656
+ items: a.map((e, t) => ({
430
657
  label: e.label,
431
- color: U[t]
658
+ color: H[t]
432
659
  })),
433
660
  className: "mt-ds-04"
434
661
  })
435
662
  ]
436
663
  });
437
664
  });
438
- G.displayName = "LineChart";
439
- //#endregion
440
- //#region src/ui/charts/area-chart.tsx
441
- var K = a.forwardRef(({ data: i, xKey: o, series: s, curved: c = !1, stacked: l = !1, fillOpacity: p = .3, gradient: g = !1, strokeWidth: _ = 2, height: v = 300, showGrid: y = !0, showTooltip: b = !0, showLegend: x = !1, animate: w = !0, xLabel: D, yLabel: O, ariaLabel: M, className: z, ...B }, U) => {
442
- let { tooltip: W, show: G, hide: K } = R(), q = H(), J = w && !q, Y = s.map((e, t) => V(e.color, t)), X = a.useId();
443
- return /* @__PURE__ */ f(e.div, {
444
- ref: U,
445
- className: r("relative", z),
446
- ...J ? {
447
- initial: {
448
- opacity: 0,
449
- scale: .96
450
- },
451
- animate: {
452
- opacity: 1,
453
- scale: 1
454
- },
455
- transition: n.fade
456
- } : {},
457
- ...t(B),
458
- children: [
459
- /* @__PURE__ */ d(N, {
460
- height: v,
461
- ariaLabel: M ?? "Area chart",
462
- children: ({ width: e, height: t, margin: n }) => {
463
- let r = i.map((e) => e[o]), a = r.every((e) => typeof e == "number"), v, x, w;
464
- if (a) {
465
- let t = r, n = Math.min(...t), a = Math.max(...t), s = m().domain([n, a]).range([0, e]);
466
- v = s, x = (e) => s(Number(e[o])), w = (e) => s(Number(i[e][o]));
467
- } else {
468
- let t = r.map(String), n = h().domain(t).range([0, e]).padding(.5);
469
- v = n, x = (e) => n(String(e[o])) ?? 0, w = (e) => n(String(i[e][o])) ?? 0;
470
- }
471
- let M;
472
- M = Math.max(...l ? i.map((e) => s.reduce((t, n) => t + (Number(e[n.key]) || 0), 0)) : i.flatMap((e) => s.map((t) => Number(e[t.key]) || 0)));
473
- let N = m().domain([0, M * 1.1]).range([t, 0]).nice(), I = c ? T : C, L = () => i.map((n, r) => {
474
- let a = x(n), c = e / Math.max(i.length - 1, 1);
475
- return /* @__PURE__ */ d("rect", {
476
- x: a - c / 2,
477
- y: 0,
478
- width: c,
479
- height: t,
480
- fill: "transparent",
481
- onMouseMove: (e) => {
482
- let t = e.currentTarget.closest("div")?.getBoundingClientRect();
483
- G(e.clientX - (t?.left ?? 0), e.clientY - (t?.top ?? 0), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
484
- className: "font-medium",
485
- children: String(n[o])
486
- }), s.map((e, t) => /* @__PURE__ */ f("div", {
487
- className: "flex items-center gap-ds-02",
488
- children: [
489
- /* @__PURE__ */ d("span", {
490
- className: "inline-block h-2 w-2 rounded-ds-full",
491
- style: { backgroundColor: Y[t] }
492
- }),
493
- /* @__PURE__ */ f("span", {
494
- className: "text-surface-fg-muted",
495
- children: [e.label, ":"]
496
- }),
497
- " ",
498
- Number(n[e.key]).toLocaleString()
499
- ]
500
- }, e.key))] }));
501
- },
502
- onMouseLeave: K
503
- }, `hover-${r}`);
504
- }), R = () => g ? /* @__PURE__ */ d("defs", { children: s.map((e, t) => /* @__PURE__ */ f("linearGradient", {
505
- id: `${X}-gradient-${t}`,
506
- x1: "0",
507
- y1: "0",
508
- x2: "0",
509
- y2: "1",
510
- children: [/* @__PURE__ */ d("stop", {
511
- offset: "0%",
512
- stopColor: Y[t],
513
- stopOpacity: p
514
- }), /* @__PURE__ */ d("stop", {
515
- offset: "100%",
516
- stopColor: Y[t],
517
- stopOpacity: .05
518
- })]
519
- }, `grad-${t}`)) }) : null, z = () => /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d(P, {
520
- scale: v,
521
- orientation: "bottom",
522
- transform: `translate(0,${t})`,
523
- label: D
524
- }), /* @__PURE__ */ d(P, {
525
- scale: N,
526
- orientation: "left",
527
- label: O
528
- })] });
529
- if (l) {
530
- let n = s.map((e) => e.key), r = k().keys(n).order(j).offset(A)(i.map((e) => {
531
- let t = { [o]: String(e[o]) };
532
- for (let n of s) t[n.key] = Number(e[n.key]) || 0;
533
- return t;
534
- })), a = S().curve(I).x((e, t) => w(t)).y0((e) => N(e[0])).y1((e) => N(e[1])), c = E().curve(I).x((e, t) => w(t)).y((e) => N(e[1]));
535
- return /* @__PURE__ */ f(u, { children: [
536
- R(),
537
- y && /* @__PURE__ */ d(F, {
538
- width: e,
539
- height: t,
540
- yScale: N,
541
- horizontal: !0
542
- }),
543
- [...r].reverse().map((e, t) => {
544
- let n = r.length - 1 - t, i = e, o = a(i) ?? "", l = c(i) ?? "";
545
- return /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
546
- d: o,
547
- fill: g ? `url(#${X}-gradient-${n})` : Y[n],
548
- opacity: g ? 1 : p
549
- }), /* @__PURE__ */ d("path", {
550
- d: l,
551
- fill: "none",
552
- stroke: Y[n],
553
- strokeWidth: _,
554
- strokeLinejoin: "round",
555
- strokeLinecap: "round"
556
- })] }, s[n].key);
557
- }),
558
- b && L(),
559
- z()
560
- ] });
561
- }
562
- let B = S().curve(I).defined((e) => e != null), V = E().curve(I).defined((e) => e != null);
563
- return /* @__PURE__ */ f(u, { children: [
564
- R(),
565
- y && /* @__PURE__ */ d(F, {
566
- width: e,
567
- height: t,
568
- yScale: N,
569
- horizontal: !0
570
- }),
571
- [...s].reverse().map((e, n) => {
572
- let r = s.length - 1 - n, a = B.x((e) => x(e)).y0(t).y1((t) => N(Number(t[e.key]) || 0)), o = V.x((e) => x(e)).y((t) => N(Number(t[e.key]) || 0)), c = a(i) ?? "", l = o(i) ?? "";
573
- return /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
574
- d: c,
575
- fill: g ? `url(#${X}-gradient-${r})` : Y[r],
576
- opacity: g ? 1 : p
577
- }), /* @__PURE__ */ d("path", {
578
- d: l,
579
- fill: "none",
580
- stroke: Y[r],
581
- strokeWidth: _,
582
- strokeLinejoin: "round",
583
- strokeLinecap: "round"
584
- })] }, e.key);
585
- }),
586
- b && L(),
587
- z()
588
- ] });
589
- }
590
- }),
591
- b && /* @__PURE__ */ d(L, { state: W }),
592
- x && s.length > 1 && /* @__PURE__ */ d(I, {
593
- items: s.map((e, t) => ({
594
- label: e.label,
595
- color: Y[t]
596
- })),
597
- className: "mt-ds-04"
598
- })
599
- ]
600
- });
601
- });
602
- K.displayName = "AreaChart";
665
+ J.displayName = "LineChart";
603
666
  //#endregion
604
667
  //#region src/ui/charts/pie-chart.tsx
605
- var q = a.forwardRef(({ data: i, variant: a = "pie", innerRadius: o = .6, padAngle: p = 0, cornerRadius: m = 0, height: h = 300, showTooltip: g = !0, showLegend: _ = !1, showLabels: v = !1, animate: y = !0, className: b, centerLabel: S, ariaLabel: C, ...w }, T) => {
606
- let E = c(null), [D, k] = l(0), [A, j] = l(null), { tooltip: M, show: N, hide: P } = R(), F = H(), z = y && !F;
607
- s(() => {
608
- if (!E.current) return;
668
+ var Y = i.forwardRef(({ data: r, variant: i = "pie", innerRadius: a = .6, padAngle: p = 0, cornerRadius: m = 0, height: h = 300, showTooltip: _ = !0, showLegend: v = !1, showLabels: y = !1, animate: b = !0, className: x, centerLabel: S, ariaLabel: w, ...T }, E) => {
669
+ let D = s(null), [O, k] = c(0), [A, j] = c(null), { tooltip: P, show: F, hide: I } = V(), L = N(), z = b && !L;
670
+ o(() => {
671
+ if (!D.current) return;
609
672
  let e = new ResizeObserver((e) => {
610
673
  let t = e[0];
611
674
  t && k(t.contentRect.width);
612
675
  });
613
- return e.observe(E.current), () => e.disconnect();
676
+ return e.observe(D.current), () => e.disconnect();
614
677
  }, []);
615
- let B = (D > 0 ? Math.min(D, h) : h) / 2, U = a === "donut" ? B * o : 0, W = i.map((e, t) => V(e.color, t)), G = i.reduce((e, t) => e + t.value, 0), K = O().value((e) => e.value).padAngle(p).sort(null)(i), q = x().innerRadius(U).outerRadius(B - 2).cornerRadius(m), J = U + (B - 2 - U) * .7, Y = x().innerRadius(J).outerRadius(J);
616
- return /* @__PURE__ */ f(e.div, {
678
+ let H = (O > 0 ? Math.min(O, h) : h) / 2, U = i === "donut" ? H * a : 0, W = r.map((e, t) => R(e.color, t)), G = r.reduce((e, t) => e + t.value, 0), K = C().value((e) => e.value).padAngle(p).sort(null)(r), q = g().innerRadius(U).outerRadius(H - 2).cornerRadius(m), J = U + (H - 2 - U) * .7, Y = g().innerRadius(J).outerRadius(J);
679
+ return /* @__PURE__ */ d(f.div, {
617
680
  ref: (e) => {
618
- E.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
681
+ D.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
619
682
  },
620
- className: r("relative w-full", b),
683
+ className: n("relative w-full", x),
621
684
  ...z ? {
622
685
  initial: {
623
686
  opacity: 0,
@@ -627,34 +690,34 @@ var q = a.forwardRef(({ data: i, variant: a = "pie", innerRadius: o = .6, padAng
627
690
  opacity: 1,
628
691
  scale: 1
629
692
  },
630
- transition: n.fade
693
+ transition: t.fade
631
694
  } : {},
632
- ...t(w),
633
- children: [D > 0 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("svg", {
634
- width: D,
695
+ ...e(T),
696
+ children: [O > 0 && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("svg", {
697
+ width: O,
635
698
  height: h,
636
699
  role: "img",
637
- "aria-label": C ?? "Pie chart",
638
- children: /* @__PURE__ */ f("g", {
639
- transform: `translate(${D / 2},${h / 2})`,
700
+ "aria-label": w ?? "Pie chart",
701
+ children: /* @__PURE__ */ d("g", {
702
+ transform: `translate(${O / 2},${h / 2})`,
640
703
  children: [
641
704
  K.map((e, t) => {
642
705
  let n = q(e);
643
706
  if (!n) return null;
644
707
  let [r, i] = q.centroid(e), a = Math.atan2(i, r), o = Math.cos(a) * 4, s = Math.sin(a) * 4, c = A === t;
645
- return /* @__PURE__ */ d("path", {
708
+ return /* @__PURE__ */ u("path", {
646
709
  d: n,
647
710
  fill: W[t],
648
711
  className: "cursor-pointer transition-transform",
649
712
  style: { transform: c ? `translate(${o}px, ${s}px)` : void 0 },
650
713
  onMouseEnter: () => j(t),
651
714
  onMouseMove: (t) => {
652
- if (g) {
715
+ if (_) {
653
716
  let n = t.currentTarget.closest("div")?.getBoundingClientRect(), r = G > 0 ? (e.data.value / G * 100).toFixed(1) : "0";
654
- N(t.clientX - (n?.left ?? 0), t.clientY - (n?.top ?? 0), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
717
+ F(t.clientX - (n?.left ?? 0), t.clientY - (n?.top ?? 0), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
655
718
  className: "font-medium",
656
719
  children: e.data.label
657
- }), /* @__PURE__ */ f("div", { children: [
720
+ }), /* @__PURE__ */ d("div", { children: [
658
721
  e.data.value.toLocaleString(),
659
722
  " (",
660
723
  r,
@@ -663,13 +726,13 @@ var q = a.forwardRef(({ data: i, variant: a = "pie", innerRadius: o = .6, padAng
663
726
  }
664
727
  },
665
728
  onMouseLeave: () => {
666
- j(null), P();
729
+ j(null), I();
667
730
  }
668
731
  }, `slice-${e.data.label}-${t}`);
669
732
  }),
670
- v && K.map((e, t) => {
733
+ y && K.map((e, t) => {
671
734
  let [n, r] = Y.centroid(e), i = G > 0 ? (e.data.value / G * 100).toFixed(0) : "0";
672
- return G > 0 && e.data.value / G < .03 ? null : /* @__PURE__ */ f("text", {
735
+ return G > 0 && e.data.value / G < .03 ? null : /* @__PURE__ */ d("text", {
673
736
  x: n,
674
737
  y: r,
675
738
  textAnchor: "middle",
@@ -678,20 +741,20 @@ var q = a.forwardRef(({ data: i, variant: a = "pie", innerRadius: o = .6, padAng
678
741
  children: [i, "%"]
679
742
  }, `label-${e.data.label}-${t}`);
680
743
  }),
681
- a === "donut" && S && U > 0 && /* @__PURE__ */ d("foreignObject", {
744
+ i === "donut" && S && U > 0 && /* @__PURE__ */ u("foreignObject", {
682
745
  x: -U * .7,
683
746
  y: -U * .7,
684
747
  width: U * 1.4,
685
748
  height: U * 1.4,
686
- children: /* @__PURE__ */ d("div", {
749
+ children: /* @__PURE__ */ u("div", {
687
750
  className: "flex h-full w-full items-center justify-center text-center text-surface-fg",
688
751
  children: S
689
752
  })
690
753
  })
691
754
  ]
692
755
  })
693
- }), g && /* @__PURE__ */ d(L, { state: M })] }), _ && /* @__PURE__ */ d(I, {
694
- items: i.map((e, t) => ({
756
+ }), _ && /* @__PURE__ */ u(B, { state: P })] }), v && /* @__PURE__ */ u(M, {
757
+ items: r.map((e, t) => ({
695
758
  label: e.label,
696
759
  color: W[t]
697
760
  })),
@@ -699,205 +762,32 @@ var q = a.forwardRef(({ data: i, variant: a = "pie", innerRadius: o = .6, padAng
699
762
  })]
700
763
  });
701
764
  });
702
- q.displayName = "PieChart";
703
- //#endregion
704
- //#region src/ui/charts/sparkline.tsx
705
- var J = {
706
- duration: 1,
707
- ease: "easeOut"
708
- }, Y = a.forwardRef(({ data: t, variant: n = "line", width: i = 120, height: a = 32, color: o, showLastDot: s = !1, strokeWidth: c = 1.5, animate: l = !0, className: u, ...p }, h) => {
709
- let g = V(o, 0), _ = H(), v = l && !_;
710
- if (!t.length) return null;
711
- let y = n === "bar" ? 1 : c, b = i - y * 2, x = a - y * 2, C = m().domain([0, Math.max(t.length - 1, 1)]).range([y, y + b]), w = Math.min(...t), D = Math.max(...t), O = w === D ? [w - 1, D + 1] : [w, D], k = m().domain(O).range([y + x, y]);
712
- if (n === "bar") {
713
- let e = Math.max(1, (b - 1 * (t.length - 1)) / t.length), n = y + x;
714
- return /* @__PURE__ */ d("svg", {
715
- ref: h,
716
- width: i,
717
- height: a,
718
- role: "img",
719
- "aria-label": "Sparkline bar chart",
720
- className: r("inline-block align-middle", u),
721
- ...p,
722
- children: t.map((t, r) => {
723
- let i = y + r * (e + 1), a = k(t);
724
- return /* @__PURE__ */ d("rect", {
725
- x: i,
726
- y: a,
727
- width: e,
728
- height: Math.max(1, n - a),
729
- rx: Math.min(1, e / 2),
730
- fill: g
731
- }, r);
732
- })
733
- });
734
- }
735
- if (n === "area") {
736
- let n = S().curve(T).x((e, t) => C(t)).y0(y + x).y1((e) => k(e)), o = E().curve(T).x((e, t) => C(t)).y((e) => k(e)), l = n(t) ?? "", m = o(t) ?? "", _ = C(t.length - 1), b = k(t[t.length - 1]);
737
- return /* @__PURE__ */ f("svg", {
738
- ref: h,
739
- width: i,
740
- height: a,
741
- role: "img",
742
- "aria-label": "Sparkline area chart",
743
- className: r("inline-block align-middle", u),
744
- ...p,
745
- children: [
746
- /* @__PURE__ */ d("path", {
747
- d: l,
748
- fill: g,
749
- opacity: .2
750
- }),
751
- v ? /* @__PURE__ */ d(e.path, {
752
- d: m,
753
- fill: "none",
754
- stroke: g,
755
- strokeWidth: c,
756
- strokeLinejoin: "round",
757
- strokeLinecap: "round",
758
- initial: { pathLength: 0 },
759
- animate: { pathLength: 1 },
760
- transition: J
761
- }) : /* @__PURE__ */ d("path", {
762
- d: m,
763
- fill: "none",
764
- stroke: g,
765
- strokeWidth: c,
766
- strokeLinejoin: "round",
767
- strokeLinecap: "round"
768
- }),
769
- s && /* @__PURE__ */ d("circle", {
770
- cx: _,
771
- cy: b,
772
- r: c + 1,
773
- fill: g
774
- })
775
- ]
776
- });
777
- }
778
- let A = E().curve(T).x((e, t) => C(t)).y((e) => k(e))(t) ?? "", j = C(t.length - 1), M = k(t[t.length - 1]);
779
- return /* @__PURE__ */ f("svg", {
780
- ref: h,
781
- width: i,
782
- height: a,
783
- role: "img",
784
- "aria-label": "Sparkline chart",
785
- className: r("inline-block align-middle", u),
786
- ...p,
787
- children: [v ? /* @__PURE__ */ d(e.path, {
788
- d: A,
789
- fill: "none",
790
- stroke: g,
791
- strokeWidth: c,
792
- strokeLinejoin: "round",
793
- strokeLinecap: "round",
794
- initial: { pathLength: 0 },
795
- animate: { pathLength: 1 },
796
- transition: J
797
- }) : /* @__PURE__ */ d("path", {
798
- d: A,
799
- fill: "none",
800
- stroke: g,
801
- strokeWidth: c,
802
- strokeLinejoin: "round",
803
- strokeLinecap: "round"
804
- }), s && /* @__PURE__ */ d("circle", {
805
- cx: j,
806
- cy: M,
807
- r: c + 1,
808
- fill: g
809
- })]
810
- });
811
- });
812
- Y.displayName = "Sparkline";
813
- //#endregion
814
- //#region src/ui/charts/gauge-chart.tsx
815
- var X = (e) => e * Math.PI / 180, Z = a.forwardRef(({ value: i, max: a = 100, min: o = 0, label: s, valueLabel: c, color: l, trackColor: u = "var(--color-surface-border)", height: p = 200, startAngle: m = -120, endAngle: h = 120, thickness: g = 16, animate: _ = !0, className: v, ...y }, b) => {
816
- let S = H(), C = U(S, _ ? 600 : 0), w = _ && !S, T = V(l, 0), E = p, D = E / 2, O = Math.min(Math.max(i, o), a), k = a === o ? 0 : (O - o) / (a - o), A = m + (h - m) * k, j = typeof c == "function" ? c(O) : typeof c == "string" ? c : String(O), M = x().innerRadius(D - g).outerRadius(D).startAngle(X(m)).endAngle(X(h)).cornerRadius(g / 2), N = x().innerRadius(D - g).outerRadius(D).startAngle(X(m)).endAngle(X(A)).cornerRadius(g / 2), P = M(null) ?? "", F = N(null) ?? "";
817
- return /* @__PURE__ */ d(e.div, {
818
- ref: b,
819
- className: r("inline-flex flex-col items-center", v),
820
- ...w ? {
821
- initial: {
822
- opacity: 0,
823
- scale: .96
824
- },
825
- animate: {
826
- opacity: 1,
827
- scale: 1
828
- },
829
- transition: n.fade
830
- } : {},
831
- ...t(y),
832
- role: "meter",
833
- "aria-valuenow": O,
834
- "aria-valuemin": o,
835
- "aria-valuemax": a,
836
- "aria-label": s ?? "Gauge chart",
837
- children: /* @__PURE__ */ d("svg", {
838
- width: E,
839
- height: E,
840
- role: "img",
841
- "aria-hidden": "true",
842
- children: /* @__PURE__ */ f("g", {
843
- transform: `translate(${D},${D})`,
844
- children: [
845
- /* @__PURE__ */ d("path", {
846
- d: P,
847
- fill: u
848
- }),
849
- /* @__PURE__ */ d("path", {
850
- d: F,
851
- fill: T,
852
- style: C > 0 ? { transition: `d ${C}ms ease-out` } : void 0
853
- }),
854
- /* @__PURE__ */ d("text", {
855
- x: 0,
856
- y: s ? -4 : 0,
857
- textAnchor: "middle",
858
- dominantBaseline: "central",
859
- className: "fill-surface-fg text-ds-2xl font-semibold",
860
- children: j
861
- }),
862
- s && /* @__PURE__ */ d("text", {
863
- x: 0,
864
- y: 20,
865
- textAnchor: "middle",
866
- dominantBaseline: "central",
867
- className: "fill-surface-fg-muted text-ds-xs",
868
- children: s
869
- })
870
- ]
871
- })
872
- })
873
- });
874
- });
875
- Z.displayName = "GaugeChart";
765
+ Y.displayName = "PieChart";
876
766
  //#endregion
877
767
  //#region src/ui/charts/radar-chart.tsx
878
- var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5, fillOpacity: h = .25, showDots: g = !1, height: _ = 300, showTooltip: v = !0, showLegend: y = !1, animate: b = !0, ariaLabel: x, className: S, ...C }, T) => {
879
- let E = c(null), [O, k] = l(0), { tooltip: A, show: j, hide: M } = R(), N = H(), P = b && !N;
880
- s(() => {
881
- if (!E.current) return;
768
+ var X = i.forwardRef(({ data: r, axes: i, series: a, maxValue: p, levels: m = 5, fillOpacity: h = .25, showDots: g = !1, height: _ = 300, showTooltip: v = !0, showLegend: b = !1, animate: x = !0, ariaLabel: C, className: w, ...T }, E) => {
769
+ let D = s(null), [O, k] = c(0), { tooltip: A, show: j, hide: P } = V(), F = N(), I = x && !F;
770
+ o(() => {
771
+ if (!D.current) return;
882
772
  let e = new ResizeObserver((e) => {
883
773
  let t = e[0];
884
774
  t && k(t.contentRect.width);
885
775
  });
886
- return e.observe(E.current), () => e.disconnect();
776
+ return e.observe(D.current), () => e.disconnect();
887
777
  }, []);
888
- let F = (O > 0 ? Math.min(O, _) : _) / 2 - 40, z = o.map((e, t) => V(e.color, t)), B = p ?? Math.max(...i.flatMap((e) => o.map((t) => Number(e[t.key]) || 0)), 1), U = 2 * Math.PI / a.length, W = D().radius((e) => F * e / B).angle((e, t) => t * U).curve(w), G = (e) => a.map((t, n) => Number(i[n]?.[e]) || 0), K = (e, t) => {
889
- let n = U * e - Math.PI / 2, r = F * t / B;
778
+ let L = (O > 0 ? Math.min(O, _) : _) / 2 - 40, z = a.map((e, t) => R(e.color, t)), H = p ?? Math.max(...r.flatMap((e) => a.map((t) => Number(e[t.key]) || 0)), 1), U = 2 * Math.PI / i.length, W = S().radius((e) => L * e / H).angle((e, t) => t * U).curve(y), G = (e) => i.map((t, n) => Number(r[n]?.[e]) || 0), K = (e, t) => {
779
+ let n = U * e - Math.PI / 2, r = L * t / H;
890
780
  return {
891
781
  x: r * Math.cos(n),
892
782
  y: r * Math.sin(n)
893
783
  };
894
784
  };
895
- return /* @__PURE__ */ f(e.div, {
785
+ return /* @__PURE__ */ d(f.div, {
896
786
  ref: (e) => {
897
- E.current = e, typeof T == "function" ? T(e) : T && (T.current = e);
787
+ D.current = e, typeof E == "function" ? E(e) : E && (E.current = e);
898
788
  },
899
- className: r("relative w-full", S),
900
- ...P ? {
789
+ className: n("relative w-full", w),
790
+ ...I ? {
901
791
  initial: {
902
792
  opacity: 0,
903
793
  scale: .96
@@ -906,21 +796,21 @@ var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5,
906
796
  opacity: 1,
907
797
  scale: 1
908
798
  },
909
- transition: n.fade
799
+ transition: t.fade
910
800
  } : {},
911
- ...t(C),
912
- children: [O > 0 && /* @__PURE__ */ f(u, { children: [/* @__PURE__ */ d("svg", {
801
+ ...e(T),
802
+ children: [O > 0 && /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ u("svg", {
913
803
  width: O,
914
804
  height: _,
915
805
  role: "img",
916
- "aria-label": x ?? "Radar chart",
917
- children: /* @__PURE__ */ f("g", {
806
+ "aria-label": C ?? "Radar chart",
807
+ children: /* @__PURE__ */ d("g", {
918
808
  transform: `translate(${O / 2},${_ / 2})`,
919
809
  children: [
920
810
  Array.from({ length: m }, (e, t) => {
921
- let n = F / m * (t + 1);
922
- return /* @__PURE__ */ d("polygon", {
923
- points: a.map((e, t) => {
811
+ let n = L / m * (t + 1);
812
+ return /* @__PURE__ */ u("polygon", {
813
+ points: i.map((e, t) => {
924
814
  let r = U * t - Math.PI / 2;
925
815
  return `${n * Math.cos(r)},${n * Math.sin(r)}`;
926
816
  }).join(" "),
@@ -930,20 +820,20 @@ var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5,
930
820
  strokeWidth: 1
931
821
  }, `grid-${t}`);
932
822
  }),
933
- a.map((e, t) => {
823
+ i.map((e, t) => {
934
824
  let n = U * t - Math.PI / 2;
935
- return /* @__PURE__ */ d("line", {
825
+ return /* @__PURE__ */ u("line", {
936
826
  x1: 0,
937
827
  y1: 0,
938
- x2: F * Math.cos(n),
939
- y2: F * Math.sin(n),
828
+ x2: L * Math.cos(n),
829
+ y2: L * Math.sin(n),
940
830
  stroke: "var(--color-surface-border)",
941
831
  strokeWidth: 1
942
832
  }, `axis-${t}`);
943
833
  }),
944
- a.map((e, t) => {
945
- let n = U * t - Math.PI / 2, r = F + 18, i = r * Math.cos(n), a = r * Math.sin(n), o = "middle";
946
- return Math.abs(Math.cos(n)) > .1 && (o = Math.cos(n) > 0 ? "start" : "end"), /* @__PURE__ */ d("text", {
834
+ i.map((e, t) => {
835
+ let n = U * t - Math.PI / 2, r = L + 18, i = r * Math.cos(n), a = r * Math.sin(n), o = "middle";
836
+ return Math.abs(Math.cos(n)) > .1 && (o = Math.cos(n) > 0 ? "start" : "end"), /* @__PURE__ */ u("text", {
947
837
  x: i,
948
838
  y: a,
949
839
  textAnchor: o,
@@ -953,8 +843,8 @@ var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5,
953
843
  }, `label-${t}`);
954
844
  }),
955
845
  Array.from({ length: m }, (e, t) => {
956
- let n = Math.round(B / m * (t + 1)), r = F / m * (t + 1), i = -Math.PI / 2;
957
- return /* @__PURE__ */ d("text", {
846
+ let n = Math.round(H / m * (t + 1)), r = L / m * (t + 1), i = -Math.PI / 2;
847
+ return /* @__PURE__ */ u("text", {
958
848
  x: r * Math.cos(i) + 4,
959
849
  y: r * Math.sin(i),
960
850
  textAnchor: "start",
@@ -963,9 +853,9 @@ var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5,
963
853
  children: n
964
854
  }, `level-label-${t}`);
965
855
  }),
966
- o.map((e, t) => {
856
+ a.map((e, t) => {
967
857
  let n = G(e.key), r = W(n);
968
- return r ? /* @__PURE__ */ f("g", { children: [/* @__PURE__ */ d("path", {
858
+ return r ? /* @__PURE__ */ d("g", { children: [/* @__PURE__ */ u("path", {
969
859
  d: r,
970
860
  fill: z[t],
971
861
  fillOpacity: h,
@@ -974,7 +864,7 @@ var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5,
974
864
  strokeLinejoin: "round"
975
865
  }), g && n.map((n, r) => {
976
866
  let { x: i, y: a } = K(r, n);
977
- return /* @__PURE__ */ d("circle", {
867
+ return /* @__PURE__ */ u("circle", {
978
868
  cx: i,
979
869
  cy: a,
980
870
  r: 4,
@@ -985,45 +875,45 @@ var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5,
985
875
  }, `dot-${e.key}-${r}`);
986
876
  })] }, e.key) : null;
987
877
  }),
988
- v && a.map((e, t) => {
878
+ v && i.map((e, t) => {
989
879
  let n = U * t - Math.PI / 2;
990
- return /* @__PURE__ */ d("circle", {
991
- cx: F * Math.cos(n),
992
- cy: F * Math.sin(n),
880
+ return /* @__PURE__ */ u("circle", {
881
+ cx: L * Math.cos(n),
882
+ cy: L * Math.sin(n),
993
883
  r: 16,
994
884
  fill: "transparent",
995
885
  className: "cursor-pointer",
996
886
  onMouseMove: (n) => {
997
- let r = n.currentTarget.closest("div")?.getBoundingClientRect();
998
- j(n.clientX - (r?.left ?? 0), n.clientY - (r?.top ?? 0), /* @__PURE__ */ f("div", { children: [/* @__PURE__ */ d("div", {
887
+ let i = n.currentTarget.closest("div")?.getBoundingClientRect();
888
+ j(n.clientX - (i?.left ?? 0), n.clientY - (i?.top ?? 0), /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("div", {
999
889
  className: "font-medium",
1000
890
  children: e
1001
- }), o.map((e, n) => {
1002
- let r = Number(i[t]?.[e.key]) || 0;
1003
- return /* @__PURE__ */ f("div", {
891
+ }), a.map((e, n) => {
892
+ let i = Number(r[t]?.[e.key]) || 0;
893
+ return /* @__PURE__ */ d("div", {
1004
894
  className: "flex items-center gap-ds-02",
1005
895
  children: [
1006
- /* @__PURE__ */ d("span", {
896
+ /* @__PURE__ */ u("span", {
1007
897
  className: "inline-block h-2 w-2 rounded-ds-full",
1008
898
  style: { backgroundColor: z[n] }
1009
899
  }),
1010
- /* @__PURE__ */ f("span", {
900
+ /* @__PURE__ */ d("span", {
1011
901
  className: "text-surface-fg-muted",
1012
902
  children: [e.label, ":"]
1013
903
  }),
1014
904
  " ",
1015
- r.toLocaleString()
905
+ i.toLocaleString()
1016
906
  ]
1017
907
  }, e.key);
1018
908
  })] }));
1019
909
  },
1020
- onMouseLeave: M
910
+ onMouseLeave: P
1021
911
  }, `hover-${t}`);
1022
912
  })
1023
913
  ]
1024
914
  })
1025
- }), v && /* @__PURE__ */ d(L, { state: A })] }), y && /* @__PURE__ */ d(I, {
1026
- items: o.map((e, t) => ({
915
+ }), v && /* @__PURE__ */ u(B, { state: A })] }), b && /* @__PURE__ */ u(M, {
916
+ items: a.map((e, t) => ({
1027
917
  label: e.label,
1028
918
  color: z[t]
1029
919
  })),
@@ -1031,6 +921,116 @@ var Q = a.forwardRef(({ data: i, axes: a, series: o, maxValue: p, levels: m = 5,
1031
921
  })]
1032
922
  });
1033
923
  });
1034
- Q.displayName = "RadarChart";
924
+ X.displayName = "RadarChart";
925
+ //#endregion
926
+ //#region src/ui/charts/sparkline.tsx
927
+ var Z = {
928
+ duration: 1,
929
+ ease: "easeOut"
930
+ }, Q = i.forwardRef(({ data: e, variant: t = "line", width: r = 120, height: i = 32, color: a, showLastDot: o = !1, strokeWidth: s = 1.5, animate: c = !0, className: l, ...p }, h) => {
931
+ let g = R(a, 0), v = N(), y = c && !v;
932
+ if (!e.length) return null;
933
+ let S = t === "bar" ? 1 : s, C = r - S * 2, w = i - S * 2, T = m().domain([0, Math.max(e.length - 1, 1)]).range([S, S + C]), E = Math.min(...e), D = Math.max(...e), O = E === D ? [E - 1, D + 1] : [E, D], k = m().domain(O).range([S + w, S]);
934
+ if (t === "bar") {
935
+ let t = Math.max(1, (C - 1 * (e.length - 1)) / e.length), a = S + w;
936
+ return /* @__PURE__ */ u("svg", {
937
+ ref: h,
938
+ width: r,
939
+ height: i,
940
+ role: "img",
941
+ "aria-label": "Sparkline bar chart",
942
+ className: n("inline-block align-middle", l),
943
+ ...p,
944
+ children: e.map((e, n) => {
945
+ let r = S + n * (t + 1), i = k(e);
946
+ return /* @__PURE__ */ u("rect", {
947
+ x: r,
948
+ y: i,
949
+ width: t,
950
+ height: Math.max(1, a - i),
951
+ rx: Math.min(1, t / 2),
952
+ fill: g
953
+ }, n);
954
+ })
955
+ });
956
+ }
957
+ if (t === "area") {
958
+ let t = _().curve(b).x((e, t) => T(t)).y0(S + w).y1((e) => k(e)), a = x().curve(b).x((e, t) => T(t)).y((e) => k(e)), c = t(e) ?? "", m = a(e) ?? "", v = T(e.length - 1), C = k(e[e.length - 1]);
959
+ return /* @__PURE__ */ d("svg", {
960
+ ref: h,
961
+ width: r,
962
+ height: i,
963
+ role: "img",
964
+ "aria-label": "Sparkline area chart",
965
+ className: n("inline-block align-middle", l),
966
+ ...p,
967
+ children: [
968
+ /* @__PURE__ */ u("path", {
969
+ d: c,
970
+ fill: g,
971
+ opacity: .2
972
+ }),
973
+ y ? /* @__PURE__ */ u(f.path, {
974
+ d: m,
975
+ fill: "none",
976
+ stroke: g,
977
+ strokeWidth: s,
978
+ strokeLinejoin: "round",
979
+ strokeLinecap: "round",
980
+ initial: { pathLength: 0 },
981
+ animate: { pathLength: 1 },
982
+ transition: Z
983
+ }) : /* @__PURE__ */ u("path", {
984
+ d: m,
985
+ fill: "none",
986
+ stroke: g,
987
+ strokeWidth: s,
988
+ strokeLinejoin: "round",
989
+ strokeLinecap: "round"
990
+ }),
991
+ o && /* @__PURE__ */ u("circle", {
992
+ cx: v,
993
+ cy: C,
994
+ r: s + 1,
995
+ fill: g
996
+ })
997
+ ]
998
+ });
999
+ }
1000
+ let A = x().curve(b).x((e, t) => T(t)).y((e) => k(e))(e) ?? "", j = T(e.length - 1), M = k(e[e.length - 1]);
1001
+ return /* @__PURE__ */ d("svg", {
1002
+ ref: h,
1003
+ width: r,
1004
+ height: i,
1005
+ role: "img",
1006
+ "aria-label": "Sparkline chart",
1007
+ className: n("inline-block align-middle", l),
1008
+ ...p,
1009
+ children: [y ? /* @__PURE__ */ u(f.path, {
1010
+ d: A,
1011
+ fill: "none",
1012
+ stroke: g,
1013
+ strokeWidth: s,
1014
+ strokeLinejoin: "round",
1015
+ strokeLinecap: "round",
1016
+ initial: { pathLength: 0 },
1017
+ animate: { pathLength: 1 },
1018
+ transition: Z
1019
+ }) : /* @__PURE__ */ u("path", {
1020
+ d: A,
1021
+ fill: "none",
1022
+ stroke: g,
1023
+ strokeWidth: s,
1024
+ strokeLinejoin: "round",
1025
+ strokeLinecap: "round"
1026
+ }), o && /* @__PURE__ */ u("circle", {
1027
+ cx: j,
1028
+ cy: M,
1029
+ r: s + 1,
1030
+ fill: g
1031
+ })]
1032
+ });
1033
+ });
1034
+ Q.displayName = "Sparkline";
1035
1035
  //#endregion
1036
- export { K as AreaChart, W as BarChart, N as ChartContainer, Z as GaugeChart, I as Legend, G as LineChart, q as PieChart, Q as RadarChart, Y as Sparkline };
1036
+ export { W as AreaChart, G as BarChart, U as ChartContainer, q as GaugeChart, M as Legend, J as LineChart, Y as PieChart, X as RadarChart, Q as Sparkline };