@dcs-tech/ui 0.2.0 → 0.4.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 (445) hide show
  1. package/README.md +32 -6
  2. package/dist/ChartImageMenu-HILSfn5A.js +1115 -0
  3. package/dist/ChartView-Cehrcr05.js +1703 -0
  4. package/dist/SummaryChart-y27q_BBN.js +29 -0
  5. package/dist/SummaryImage-DDNEEu_K.js +18 -0
  6. package/dist/SummarySeeAll-0dX-_LFe.js +101 -0
  7. package/dist/defaults-DL745PK1.js +708 -0
  8. package/dist/exportContext-CdpsOzE8.js +235 -0
  9. package/dist/exportEngine-DL-jEXFU.js +890 -0
  10. package/dist/geometry-CG2nOEnw.js +1796 -0
  11. package/dist/index.js +23238 -15993
  12. package/dist/scrollArea-CkPGDYH2.js +210 -0
  13. package/dist/style.css +1 -1
  14. package/dist/summaryChartData-Djo73zb8.js +81 -0
  15. package/dist/types/components/AppBar/AppBar.d.ts +16 -0
  16. package/dist/types/components/ArrowKeyFocus/useArrowKeyFocus.d.ts +10 -0
  17. package/dist/types/components/Avatar/Avatar.d.ts +22 -0
  18. package/dist/types/{shared-web-ui/src → components}/Badge/Badge.d.ts +0 -11
  19. package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
  20. package/dist/types/{shared-web-ui/src → components}/Button/Button.d.ts +1 -1
  21. package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroup.d.ts +1 -1
  22. package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroupContext.d.ts +1 -1
  23. package/dist/types/{shared-web-ui/src → components}/Button/index.d.ts +1 -1
  24. package/dist/types/components/Card/Card.d.ts +17 -0
  25. package/dist/types/components/Charts/AnchoredMenu.d.ts +17 -0
  26. package/dist/types/components/Charts/BarList.d.ts +12 -0
  27. package/dist/types/components/Charts/CalendarHeatmap.d.ts +17 -0
  28. package/dist/types/components/Charts/Chart.d.ts +20 -0
  29. package/dist/types/components/Charts/ChartIcon.d.ts +5 -0
  30. package/dist/types/components/Charts/ChartImageMenu.d.ts +4 -0
  31. package/dist/types/components/Charts/ChartTable.d.ts +8 -0
  32. package/dist/types/components/Charts/ChartTooltip.d.ts +58 -0
  33. package/dist/types/components/Charts/ChartView.d.ts +15 -0
  34. package/dist/types/components/Charts/ColumnChart.d.ts +15 -0
  35. package/dist/types/components/Charts/Donut.d.ts +14 -0
  36. package/dist/types/components/Charts/Funnel.d.ts +10 -0
  37. package/dist/types/components/Charts/Gauge.d.ts +15 -0
  38. package/dist/types/components/Charts/Legend.d.ts +6 -0
  39. package/dist/types/components/Charts/LineChart.d.ts +13 -0
  40. package/dist/types/components/Charts/NumberTrend.d.ts +21 -0
  41. package/dist/types/components/Charts/Progress.d.ts +12 -0
  42. package/dist/types/components/Charts/StackedBar.d.ts +11 -0
  43. package/dist/types/components/Charts/Treemap.d.ts +12 -0
  44. package/dist/types/components/Charts/chartData.d.ts +69 -0
  45. package/dist/types/components/Charts/chartImage.d.ts +121 -0
  46. package/dist/types/components/Charts/geometry.d.ts +180 -0
  47. package/dist/types/components/Charts/index.d.ts +32 -0
  48. package/dist/types/components/Charts/labels.d.ts +46 -0
  49. package/dist/types/components/Charts/menuPlacement.d.ts +25 -0
  50. package/dist/types/components/Charts/palette.d.ts +81 -0
  51. package/dist/types/components/Charts/parts.d.ts +25 -0
  52. package/dist/types/components/Charts/pointer.d.ts +41 -0
  53. package/dist/types/components/Charts/types.d.ts +51 -0
  54. package/dist/types/components/Charts/ui.d.ts +3 -0
  55. package/dist/types/components/Charts/useBoxSize.d.ts +6 -0
  56. package/dist/types/components/Charts/useLegendFit.d.ts +1 -0
  57. package/dist/types/components/Charts/useUiScale.d.ts +1 -0
  58. package/dist/types/{shared-web-ui/src → components}/Checkbox/Checkbox.d.ts +1 -1
  59. package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroup.d.ts +1 -1
  60. package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroupContext.d.ts +1 -1
  61. package/dist/types/{shared-web-ui/src → components}/Checkbox/index.d.ts +1 -1
  62. package/dist/types/{shared-web-ui/src → components}/ChipInput/ChipInput.d.ts +1 -1
  63. package/dist/types/{shared-web-ui/src → components}/ChipInput/index.d.ts +2 -2
  64. package/dist/types/{shared-web-ui/src → components}/ChipInput/useChipSuggestions.d.ts +1 -1
  65. package/dist/types/{shared-web-ui/src → components}/Collapsible/Collapsible.d.ts +1 -1
  66. package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleContext.d.ts +1 -1
  67. package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleItem.d.ts +1 -3
  68. package/dist/types/{shared-web-ui/src → components}/Collapsible/index.d.ts +1 -1
  69. package/dist/types/components/ColorSchemeSelect/ColorSchemeSelect.d.ts +11 -0
  70. package/dist/types/components/CommandPalette/CommandPalette.d.ts +25 -0
  71. package/dist/types/components/DataTable/DataTable.d.ts +16 -0
  72. package/dist/types/components/DataTable/DataTable.storyData.d.ts +23 -0
  73. package/dist/types/components/DataTable/DisplayPopover.d.ts +22 -0
  74. package/dist/types/components/DataTable/HeaderMenu.d.ts +31 -0
  75. package/dist/types/components/DataTable/ManageModal.d.ts +31 -0
  76. package/dist/types/components/DataTable/PressButton.d.ts +2 -0
  77. package/dist/types/components/DataTable/SingleRowView.d.ts +9 -0
  78. package/dist/types/components/DataTable/SortModal.d.ts +16 -0
  79. package/dist/types/components/DataTable/StatusRow.d.ts +49 -0
  80. package/dist/types/components/DataTable/TableColumnModal.d.ts +18 -0
  81. package/dist/types/components/DataTable/TableControls.d.ts +48 -0
  82. package/dist/types/components/DataTable/TablePagination.d.ts +38 -0
  83. package/dist/types/components/DataTable/TableScrollStrip.d.ts +2 -0
  84. package/dist/types/components/DataTable/TableToolbar.d.ts +69 -0
  85. package/dist/types/components/DataTable/TableView.d.ts +61 -0
  86. package/dist/types/components/DataTable/bulk/BulkConfirmDialog.d.ts +13 -0
  87. package/dist/types/components/DataTable/bulk/TableToast.d.ts +13 -0
  88. package/dist/types/components/DataTable/bulk/bulkActions.d.ts +23 -0
  89. package/dist/types/components/DataTable/cards/CardFieldsEditor.d.ts +16 -0
  90. package/dist/types/components/DataTable/cards/CardView.d.ts +50 -0
  91. package/dist/types/components/DataTable/cards/cardFields.d.ts +32 -0
  92. package/dist/types/components/DataTable/cards/rowParts.d.ts +38 -0
  93. package/dist/types/components/DataTable/data/useServerData.d.ts +28 -0
  94. package/dist/types/components/DataTable/defaults.d.ts +18 -0
  95. package/dist/types/components/DataTable/detail/BuiltInDetail.d.ts +10 -0
  96. package/dist/types/components/DataTable/detail/DetailHost.d.ts +13 -0
  97. package/dist/types/components/DataTable/export/ExportPopover.d.ts +18 -0
  98. package/dist/types/components/DataTable/export/ExportPreviewModal.d.ts +11 -0
  99. package/dist/types/components/DataTable/export/ExportSettingsModal.d.ts +31 -0
  100. package/dist/types/components/DataTable/export/ExportTemplateCards.d.ts +19 -0
  101. package/dist/types/components/DataTable/export/exportContext.d.ts +10 -0
  102. package/dist/types/components/DataTable/export/exportEngine.d.ts +77 -0
  103. package/dist/types/components/DataTable/export/exportRows.d.ts +10 -0
  104. package/dist/types/components/DataTable/export/templateDisplay.d.ts +7 -0
  105. package/dist/types/components/DataTable/export/templateOptions.d.ts +6 -0
  106. package/dist/types/components/DataTable/export/useTableExport.d.ts +53 -0
  107. package/dist/types/components/DataTable/filters/ColumnFilterPopover.d.ts +14 -0
  108. package/dist/types/components/DataTable/filters/FilterChips.d.ts +9 -0
  109. package/dist/types/components/DataTable/filters/FilterConditionRow.d.ts +11 -0
  110. package/dist/types/components/DataTable/filters/FilterGroup.d.ts +12 -0
  111. package/dist/types/components/DataTable/filters/FilterModal.d.ts +14 -0
  112. package/dist/types/components/DataTable/filters/FilterRow.d.ts +20 -0
  113. package/dist/types/components/DataTable/filters/columnFilterModel.d.ts +29 -0
  114. package/dist/types/components/DataTable/filters/filterEngine.d.ts +16 -0
  115. package/dist/types/components/DataTable/filters/filterRowModel.d.ts +28 -0
  116. package/dist/types/components/DataTable/filters/quickFilterMatch.d.ts +3 -0
  117. package/dist/types/components/DataTable/grouping/GroupUi.d.ts +36 -0
  118. package/dist/types/components/DataTable/grouping/groupModel.d.ts +82 -0
  119. package/dist/types/components/DataTable/grouping/useGrouping.d.ts +39 -0
  120. package/dist/types/components/DataTable/host.d.ts +14 -0
  121. package/dist/types/components/DataTable/index.d.ts +18 -0
  122. package/dist/types/components/DataTable/keyboard/ShortcutsDialog.d.ts +14 -0
  123. package/dist/types/components/DataTable/keyboard/shortcuts.d.ts +22 -0
  124. package/dist/types/components/DataTable/keyboard/useGridKeyboard.d.ts +48 -0
  125. package/dist/types/components/DataTable/labels.d.ts +618 -0
  126. package/dist/types/components/DataTable/layout/LayoutSwitcher.d.ts +9 -0
  127. package/dist/types/components/DataTable/layout/layouts.d.ts +20 -0
  128. package/dist/types/components/DataTable/layout/scrollArea.d.ts +2 -0
  129. package/dist/types/components/DataTable/layout/useFillHeight.d.ts +11 -0
  130. package/dist/types/components/DataTable/menu/RowMenu.d.ts +56 -0
  131. package/dist/types/components/DataTable/menu/buildRowMenu.d.ts +35 -0
  132. package/dist/types/components/DataTable/menu/clipboard.d.ts +4 -0
  133. package/dist/types/components/DataTable/menu/layers.d.ts +1 -0
  134. package/dist/types/components/DataTable/menu/valueFilter.d.ts +15 -0
  135. package/dist/types/components/DataTable/motion/useRowMotion.d.ts +32 -0
  136. package/dist/types/components/DataTable/persistence/adapters.d.ts +6 -0
  137. package/dist/types/components/DataTable/persistence/reconcile.d.ts +64 -0
  138. package/dist/types/components/DataTable/persistence/useColumnPersistence.d.ts +51 -0
  139. package/dist/types/components/DataTable/persistence/useManagePrefs.d.ts +23 -0
  140. package/dist/types/components/DataTable/persistence/useOrphanPrefs.d.ts +3 -0
  141. package/dist/types/components/DataTable/pinning.d.ts +10 -0
  142. package/dist/types/components/DataTable/rows/PressRow.d.ts +7 -0
  143. package/dist/types/components/DataTable/rows/RowActions.d.ts +15 -0
  144. package/dist/types/components/DataTable/rows/rowPress.d.ts +35 -0
  145. package/dist/types/components/DataTable/sharing/Sharing.d.ts +21 -0
  146. package/dist/types/components/DataTable/split/SplitView.d.ts +29 -0
  147. package/dist/types/components/DataTable/summary/ManageSummaryCards.d.ts +18 -0
  148. package/dist/types/components/DataTable/summary/SummaryChart.d.ts +11 -0
  149. package/dist/types/components/DataTable/summary/SummaryControls.d.ts +33 -0
  150. package/dist/types/components/DataTable/summary/SummaryImage.d.ts +12 -0
  151. package/dist/types/components/DataTable/summary/SummarySeeAll.d.ts +17 -0
  152. package/dist/types/components/DataTable/summary/TableSummary.d.ts +34 -0
  153. package/dist/types/components/DataTable/summary/summaryCatalogue.d.ts +64 -0
  154. package/dist/types/components/DataTable/summary/summaryChartData.d.ts +9 -0
  155. package/dist/types/components/DataTable/summary/summaryModel.d.ts +152 -0
  156. package/dist/types/components/DataTable/summary/summaryWidth.d.ts +22 -0
  157. package/dist/types/components/DataTable/summary/useTableSummary.d.ts +18 -0
  158. package/dist/types/components/DataTable/types.d.ts +1145 -0
  159. package/dist/types/components/DataTable/ui-local/AutoHeight.d.ts +9 -0
  160. package/dist/types/components/DataTable/ui-local/DateRangePicker.d.ts +16 -0
  161. package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +4 -0
  162. package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +3 -0
  163. package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +70 -0
  164. package/dist/types/components/DataTable/ui-local/ReactModal.d.ts +20 -0
  165. package/dist/types/components/DataTable/ui-local/scrollLock.d.ts +1 -0
  166. package/dist/types/components/DataTable/ui.d.ts +13 -0
  167. package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -0
  168. package/dist/types/components/DataTable/useTable.d.ts +12 -0
  169. package/dist/types/components/DataTable/vendor/columnOrder.d.ts +1 -0
  170. package/dist/types/components/DataTable/vendor/diff.d.ts +5 -0
  171. package/dist/types/components/DataTable/vendor/fileActions.d.ts +19 -0
  172. package/dist/types/components/DataTable/vendor/index.d.ts +3 -0
  173. package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +27 -0
  174. package/dist/types/components/DatePicker/Calendar.d.ts +14 -0
  175. package/dist/types/components/DatePicker/DatePicker.d.ts +5 -0
  176. package/dist/types/components/DatePicker/TimeField.d.ts +16 -0
  177. package/dist/types/components/DatePicker/index.d.ts +4 -0
  178. package/dist/types/components/DatePicker/useOneMonthPane.d.ts +2 -0
  179. package/dist/types/components/Dialog/Dialog.d.ts +56 -0
  180. package/dist/types/components/Dialog/DialogHost.d.ts +44 -0
  181. package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +49 -0
  182. package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTable.d.ts +1 -6
  183. package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableActions.d.ts +1 -1
  184. package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableCell.d.ts +2 -20
  185. package/dist/types/components/EditableTable/EditableTableRow.d.ts +14 -0
  186. package/dist/types/components/EditableTable/EditableTableSummary.d.ts +11 -0
  187. package/dist/types/{shared-web-ui/src → components}/EditableTable/index.d.ts +1 -1
  188. package/dist/types/{shared-web-ui/src → components}/EditableTable/useEditableTable.d.ts +3 -3
  189. package/dist/types/components/EditableTable/useRowAnimation.d.ts +12 -0
  190. package/dist/types/components/FieldContext/FieldContext.d.ts +3 -0
  191. package/dist/types/components/FieldContext/FieldProvider.d.ts +4 -0
  192. package/dist/types/{shared-web-ui/src → components}/FieldContext/index.d.ts +1 -1
  193. package/dist/types/{shared-web-ui/src → components}/FieldContext/useField.d.ts +2 -29
  194. package/dist/types/components/FieldContext/useFieldSurface.d.ts +34 -0
  195. package/dist/types/{shared-web-ui/src → components}/FieldContext/useFormKeyboard.d.ts +1 -4
  196. package/dist/types/{shared-web-ui/src → components}/FieldWrapper/FieldWrapper.d.ts +1 -1
  197. package/dist/types/{shared-web-ui/src → components}/FieldWrapper/index.d.ts +1 -1
  198. package/dist/types/{shared-web-ui/src → components}/Fields/Field.d.ts +1 -1
  199. package/dist/types/components/Fields/FieldButton.d.ts +17 -0
  200. package/dist/types/{shared-web-ui/src → components}/Fields/Fields.d.ts +1 -1
  201. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldBlur.d.ts +1 -1
  202. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldChange.d.ts +1 -1
  203. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldCondition.d.ts +1 -1
  204. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldDisabled.d.ts +1 -1
  205. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldRender.d.ts +1 -1
  206. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldSelect.d.ts +1 -1
  207. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValidation.d.ts +1 -1
  208. package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValue.d.ts +1 -1
  209. package/dist/types/{shared-web-ui/src → components}/Fields/index.d.ts +1 -1
  210. package/dist/types/components/Floating/index.d.ts +3 -0
  211. package/dist/types/components/Floating/layers.d.ts +4 -0
  212. package/dist/types/components/Floating/scrollLock.d.ts +2 -0
  213. package/dist/types/components/Floating/useFloatingLayer.d.ts +20 -0
  214. package/dist/types/{shared-web-ui/src → components}/Form/Form.d.ts +1 -1
  215. package/dist/types/{shared-web-ui/src → components}/Form/index.d.ts +1 -1
  216. package/dist/types/components/Image/ImagePicker.d.ts +23 -0
  217. package/dist/types/components/Image/ImageStrip.d.ts +13 -0
  218. package/dist/types/components/Image/ImageViewer.d.ts +16 -0
  219. package/dist/types/components/Image/index.d.ts +8 -0
  220. package/dist/types/components/Image/prepareImage.d.ts +19 -0
  221. package/dist/types/{shared-web-ui/src → components}/Input/Input.d.ts +1 -1
  222. package/dist/types/{shared-web-ui/src → components}/Input/index.d.ts +1 -1
  223. package/dist/types/components/Popover/Popover.d.ts +25 -0
  224. package/dist/types/components/Popover/floatingPosition.d.ts +17 -0
  225. package/dist/types/components/Press/index.d.ts +2 -0
  226. package/dist/types/components/Press/usePress.d.ts +9 -0
  227. package/dist/types/{shared-web-ui/src → components}/Radio/Radio.d.ts +1 -1
  228. package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroup.d.ts +1 -1
  229. package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroupContext.d.ts +1 -1
  230. package/dist/types/{shared-web-ui/src → components}/Radio/index.d.ts +1 -1
  231. package/dist/types/components/Scroll/ScrollRule.d.ts +2 -0
  232. package/dist/types/components/Scroll/ScrollStrip.d.ts +9 -0
  233. package/dist/types/components/Scroll/index.d.ts +4 -0
  234. package/dist/types/components/Scroll/labels.d.ts +5 -0
  235. package/dist/types/components/Scroll/scrollActivity.d.ts +14 -0
  236. package/dist/types/components/Scroll/ui.d.ts +1 -0
  237. package/dist/types/{shared-web-ui/src → components}/Select/Select.d.ts +1 -1
  238. package/dist/types/{shared-web-ui/src → components}/Select/index.d.ts +1 -1
  239. package/dist/types/components/Select/useSelect.d.ts +2 -0
  240. package/dist/types/components/Sidebar/Sidebar.d.ts +24 -0
  241. package/dist/types/components/Skeleton/Skeleton.d.ts +18 -0
  242. package/dist/types/components/Stepper/Stepper.d.ts +17 -0
  243. package/dist/types/components/Stepper/index.d.ts +2 -0
  244. package/dist/types/{shared-web-ui/src → components}/Suggest/Suggest.d.ts +1 -1
  245. package/dist/types/{shared-web-ui/src → components}/Suggest/SuggestionList.d.ts +1 -1
  246. package/dist/types/{shared-web-ui/src → components}/Suggest/index.d.ts +2 -2
  247. package/dist/types/{shared-web-ui/src → components}/Suggest/searchFilters.d.ts +1 -1
  248. package/dist/types/{shared-web-ui/src → components}/Suggest/useSuggest.d.ts +1 -1
  249. package/dist/types/{shared-web-ui/src → components}/Switch/Switch.d.ts +1 -1
  250. package/dist/types/{shared-web-ui/src → components}/Switch/index.d.ts +1 -1
  251. package/dist/types/components/Tabs/Tabs.d.ts +36 -0
  252. package/dist/types/components/Toast/ToastHost.d.ts +8 -0
  253. package/dist/types/components/Toast/ToastItem.d.ts +10 -0
  254. package/dist/types/{shared-web-ui/src → components}/Toast/toast.types.d.ts +0 -13
  255. package/dist/types/components/Tooltip/Tooltip.d.ts +9 -0
  256. package/dist/types/components/Tooltip/useTooltip.d.ts +15 -0
  257. package/dist/types/{shared-web-ui/src → components}/Typography/Typography.d.ts +1 -1
  258. package/dist/types/{shared-web-ui/src → components}/Typography/index.d.ts +1 -1
  259. package/dist/types/components/UIProvider/UIPortalContext.d.ts +2 -0
  260. package/dist/types/components/UIProvider/UIProvider.d.ts +13 -0
  261. package/dist/types/components/UIProvider/UIThemeContext.d.ts +9 -0
  262. package/dist/types/core/hooks/index.d.ts +3 -0
  263. package/dist/types/core/hooks/useDebounced.d.ts +7 -0
  264. package/dist/types/core/hooks/usePresence.d.ts +5 -0
  265. package/dist/types/{shared-logic/src/ui → core/logic}/button.logic.d.ts +1 -1
  266. package/dist/types/core/logic/cellRules.logic.d.ts +32 -0
  267. package/dist/types/{shared-logic/src/ui → core/logic}/chipinput.logic.d.ts +1 -13
  268. package/dist/types/{shared-logic/src/ui → core/logic}/collapsible.logic.d.ts +1 -8
  269. package/dist/types/{shared-logic/src/ui → core/logic}/colorScheme.d.ts +0 -14
  270. package/dist/types/core/logic/columnOrder.logic.d.ts +1 -0
  271. package/dist/types/core/logic/datePicker.logic.d.ts +136 -0
  272. package/dist/types/core/logic/displayOrder.logic.d.ts +4 -0
  273. package/dist/types/{shared-logic/src/ui → core/logic}/editableTable.logic.d.ts +5 -28
  274. package/dist/types/core/logic/fieldControl.logic.d.ts +12 -0
  275. package/dist/types/{shared-logic/src/ui → core/logic}/fieldWrapper.logic.d.ts +1 -1
  276. package/dist/types/{shared-logic/src/ui → core/logic}/fields.logic.d.ts +1 -1
  277. package/dist/types/{shared-logic/src/ui → core/logic}/form.logic.d.ts +0 -8
  278. package/dist/types/core/logic/index.d.ts +33 -0
  279. package/dist/types/core/logic/keyboard.logic.d.ts +12 -0
  280. package/dist/types/core/logic/motion.logic.d.ts +1 -0
  281. package/dist/types/core/logic/navigation.logic.d.ts +6 -0
  282. package/dist/types/core/logic/popover.logic.d.ts +59 -0
  283. package/dist/types/core/logic/popupList.logic.d.ts +19 -0
  284. package/dist/types/core/logic/press.logic.d.ts +14 -0
  285. package/dist/types/core/logic/quickAddGrid.logic.d.ts +183 -0
  286. package/dist/types/core/logic/select.logic.d.ts +17 -0
  287. package/dist/types/core/logic/stepper.logic.d.ts +6 -0
  288. package/dist/types/{shared-logic/src/ui → core/logic}/suggest.logic.d.ts +1 -1
  289. package/dist/types/core/logic/tableLayout.logic.d.ts +13 -0
  290. package/dist/types/{shared-logic/src/ui → core/logic}/tableSummary.logic.d.ts +1 -20
  291. package/dist/types/core/logic/timeField.logic.d.ts +26 -0
  292. package/dist/types/core/logic/tooltip.logic.d.ts +11 -0
  293. package/dist/types/{shared-logic/src/ui → core/logic}/typography.logic.d.ts +1 -1
  294. package/dist/types/core/logic/uiScale.logic.d.ts +1 -0
  295. package/dist/types/core/logic/useMergeRefs.d.ts +2 -0
  296. package/dist/types/{shared-types/src/ui → core/types}/button.types.d.ts +1 -11
  297. package/dist/types/{shared-types/src/ui → core/types}/checkbox.types.d.ts +0 -4
  298. package/dist/types/{shared-types/src/ui → core/types}/chipinput.types.d.ts +0 -10
  299. package/dist/types/{shared-types/src/ui → core/types}/collapsible.types.d.ts +0 -18
  300. package/dist/types/core/types/common.types.d.ts +3 -0
  301. package/dist/types/core/types/control.types.d.ts +36 -0
  302. package/dist/types/core/types/datePicker.types.d.ts +46 -0
  303. package/dist/types/{shared-types/src/ui → core/types}/editableTable.types.d.ts +0 -79
  304. package/dist/types/core/types/field.types.d.ts +80 -0
  305. package/dist/types/{shared-types/src/ui → core/types}/fieldWrapper.types.d.ts +0 -10
  306. package/dist/types/{shared-types/src/ui → core/types}/fields.types.d.ts +0 -45
  307. package/dist/types/{shared-types/src/ui → core/types}/form.types.d.ts +0 -30
  308. package/dist/types/core/types/index.d.ts +22 -0
  309. package/dist/types/{shared-types/src/ui → core/types}/input.types.d.ts +0 -4
  310. package/dist/types/core/types/keyboard.types.d.ts +48 -0
  311. package/dist/types/core/types/navigation.types.d.ts +13 -0
  312. package/dist/types/{shared-types/src/ui → core/types}/radio.types.d.ts +0 -6
  313. package/dist/types/{shared-types/src/ui → core/types}/select.types.d.ts +0 -41
  314. package/dist/types/{shared-types/src/ui → core/types}/suggest.types.d.ts +1 -10
  315. package/dist/types/{shared-types/src/ui → core/types}/switch.types.d.ts +0 -4
  316. package/dist/types/{shared-types/src/ui → core/types}/table.types.d.ts +0 -59
  317. package/dist/types/core/types/tooltip.types.d.ts +43 -0
  318. package/dist/types/{shared-types/src/ui → core/types}/typography.types.d.ts +0 -4
  319. package/dist/types/index.d.ts +86 -0
  320. package/package.json +27 -26
  321. package/dist/types/published/dcs-ui/src/index.d.ts +0 -32
  322. package/dist/types/published/dcs-ui/src/publicLogic.d.ts +0 -35
  323. package/dist/types/published/dcs-ui/src/publicTypes.d.ts +0 -14
  324. package/dist/types/shared-logic/src/report/aggregate.d.ts +0 -29
  325. package/dist/types/shared-logic/src/report/canvas.d.ts +0 -106
  326. package/dist/types/shared-logic/src/report/conditions.d.ts +0 -18
  327. package/dist/types/shared-logic/src/report/constants.d.ts +0 -46
  328. package/dist/types/shared-logic/src/report/dataset.d.ts +0 -49
  329. package/dist/types/shared-logic/src/report/edit.d.ts +0 -188
  330. package/dist/types/shared-logic/src/report/fields.d.ts +0 -80
  331. package/dist/types/shared-logic/src/report/format.d.ts +0 -27
  332. package/dist/types/shared-logic/src/report/fromColumns.d.ts +0 -61
  333. package/dist/types/shared-logic/src/report/index.d.ts +0 -19
  334. package/dist/types/shared-logic/src/report/layout.d.ts +0 -85
  335. package/dist/types/shared-logic/src/report/metrics.d.ts +0 -62
  336. package/dist/types/shared-logic/src/report/migrate.d.ts +0 -77
  337. package/dist/types/shared-logic/src/report/paginate.d.ts +0 -40
  338. package/dist/types/shared-logic/src/report/renderers/html.d.ts +0 -29
  339. package/dist/types/shared-logic/src/report/renderers/pdfmake.d.ts +0 -45
  340. package/dist/types/shared-logic/src/report/resolve.d.ts +0 -40
  341. package/dist/types/shared-logic/src/report/scope.d.ts +0 -52
  342. package/dist/types/shared-logic/src/report/storage.d.ts +0 -112
  343. package/dist/types/shared-logic/src/report/validate.d.ts +0 -28
  344. package/dist/types/shared-logic/src/ui/cellRules.logic.d.ts +0 -67
  345. package/dist/types/shared-logic/src/ui/columnOrder.logic.d.ts +0 -12
  346. package/dist/types/shared-logic/src/ui/fieldControl.logic.d.ts +0 -24
  347. package/dist/types/shared-logic/src/ui/index.d.ts +0 -55
  348. package/dist/types/shared-logic/src/ui/keyboard.logic.d.ts +0 -72
  349. package/dist/types/shared-logic/src/ui/navigation.logic.d.ts +0 -30
  350. package/dist/types/shared-logic/src/ui/popover.logic.d.ts +0 -57
  351. package/dist/types/shared-logic/src/ui/popupList.logic.d.ts +0 -54
  352. package/dist/types/shared-logic/src/ui/select.logic.d.ts +0 -31
  353. package/dist/types/shared-logic/src/ui/tableLayout.logic.d.ts +0 -47
  354. package/dist/types/shared-logic/src/ui/tooltip.logic.d.ts +0 -35
  355. package/dist/types/shared-logic/src/ui/useMergeRefs.d.ts +0 -10
  356. package/dist/types/shared-types/src/report/bands.d.ts +0 -32
  357. package/dist/types/shared-types/src/report/blocks.d.ts +0 -181
  358. package/dist/types/shared-types/src/report/conditions.d.ts +0 -24
  359. package/dist/types/shared-types/src/report/dataset.d.ts +0 -106
  360. package/dist/types/shared-types/src/report/document.d.ts +0 -201
  361. package/dist/types/shared-types/src/report/index.d.ts +0 -9
  362. package/dist/types/shared-types/src/report/primitives.d.ts +0 -109
  363. package/dist/types/shared-types/src/report/registry.d.ts +0 -85
  364. package/dist/types/shared-types/src/report/storage.d.ts +0 -41
  365. package/dist/types/shared-types/src/report/template.d.ts +0 -92
  366. package/dist/types/shared-types/src/ui/common.types.d.ts +0 -14
  367. package/dist/types/shared-types/src/ui/control.types.d.ts +0 -133
  368. package/dist/types/shared-types/src/ui/field.types.d.ts +0 -200
  369. package/dist/types/shared-types/src/ui/index.d.ts +0 -37
  370. package/dist/types/shared-types/src/ui/keyboard.types.d.ts +0 -155
  371. package/dist/types/shared-types/src/ui/navigation.types.d.ts +0 -35
  372. package/dist/types/shared-types/src/ui/tooltip.types.d.ts +0 -68
  373. package/dist/types/shared-web-ui/src/AppBar/AppBar.d.ts +0 -25
  374. package/dist/types/shared-web-ui/src/ArrowKeyFocus/useArrowKeyFocus.d.ts +0 -29
  375. package/dist/types/shared-web-ui/src/Avatar/Avatar.d.ts +0 -36
  376. package/dist/types/shared-web-ui/src/Breadcrumbs/Breadcrumbs.d.ts +0 -70
  377. package/dist/types/shared-web-ui/src/Card/Card.d.ts +0 -33
  378. package/dist/types/shared-web-ui/src/ColorSchemeSelect/ColorSchemeSelect.d.ts +0 -26
  379. package/dist/types/shared-web-ui/src/CommandPalette/CommandPalette.d.ts +0 -52
  380. package/dist/types/shared-web-ui/src/Dialog/Dialog.d.ts +0 -101
  381. package/dist/types/shared-web-ui/src/Dialog/DialogHost.d.ts +0 -80
  382. package/dist/types/shared-web-ui/src/DropdownMenu/DropdownMenu.d.ts +0 -49
  383. package/dist/types/shared-web-ui/src/EditableTable/EditableTableRow.d.ts +0 -25
  384. package/dist/types/shared-web-ui/src/EditableTable/EditableTableSummary.d.ts +0 -22
  385. package/dist/types/shared-web-ui/src/EditableTable/useRowAnimation.d.ts +0 -44
  386. package/dist/types/shared-web-ui/src/FieldContext/FieldContext.d.ts +0 -18
  387. package/dist/types/shared-web-ui/src/FieldContext/FieldProvider.d.ts +0 -13
  388. package/dist/types/shared-web-ui/src/FieldContext/useFieldSurface.d.ts +0 -57
  389. package/dist/types/shared-web-ui/src/Fields/FieldButton.d.ts +0 -32
  390. package/dist/types/shared-web-ui/src/Popover/Popover.d.ts +0 -44
  391. package/dist/types/shared-web-ui/src/ReportDesigner/AlignedRowsEditor.d.ts +0 -4
  392. package/dist/types/shared-web-ui/src/ReportDesigner/BandList.d.ts +0 -26
  393. package/dist/types/shared-web-ui/src/ReportDesigner/BlockEditor.d.ts +0 -44
  394. package/dist/types/shared-web-ui/src/ReportDesigner/ColumnEditor.d.ts +0 -2
  395. package/dist/types/shared-web-ui/src/ReportDesigner/ConditionEditor.d.ts +0 -7
  396. package/dist/types/shared-web-ui/src/ReportDesigner/FieldPicker.d.ts +0 -25
  397. package/dist/types/shared-web-ui/src/ReportDesigner/FieldSelect.d.ts +0 -2
  398. package/dist/types/shared-web-ui/src/ReportDesigner/FormatEditor.d.ts +0 -2
  399. package/dist/types/shared-web-ui/src/ReportDesigner/Inspector.d.ts +0 -14
  400. package/dist/types/shared-web-ui/src/ReportDesigner/OptionsEditor.d.ts +0 -2
  401. package/dist/types/shared-web-ui/src/ReportDesigner/ReportDesigner.d.ts +0 -34
  402. package/dist/types/shared-web-ui/src/ReportDesigner/StyleEditor.d.ts +0 -2
  403. package/dist/types/shared-web-ui/src/ReportDesigner/TableEditor.d.ts +0 -10
  404. package/dist/types/shared-web-ui/src/ReportDesigner/WatermarkEditor.d.ts +0 -2
  405. package/dist/types/shared-web-ui/src/ReportDesigner/chipSources.d.ts +0 -6
  406. package/dist/types/shared-web-ui/src/ReportDesigner/icons.d.ts +0 -21
  407. package/dist/types/shared-web-ui/src/ReportDesigner/index.d.ts +0 -16
  408. package/dist/types/shared-web-ui/src/ReportDesigner/labels.d.ts +0 -34
  409. package/dist/types/shared-web-ui/src/ReportDesigner/parts.d.ts +0 -63
  410. package/dist/types/shared-web-ui/src/ReportDesigner/types.d.ts +0 -106
  411. package/dist/types/shared-web-ui/src/ReportPreview/ReportPreview.d.ts +0 -44
  412. package/dist/types/shared-web-ui/src/ReportPreview/index.d.ts +0 -1
  413. package/dist/types/shared-web-ui/src/Select/useSelect.d.ts +0 -2
  414. package/dist/types/shared-web-ui/src/Sidebar/Sidebar.d.ts +0 -55
  415. package/dist/types/shared-web-ui/src/Skeleton/Skeleton.d.ts +0 -33
  416. package/dist/types/shared-web-ui/src/Tabs/Tabs.d.ts +0 -79
  417. package/dist/types/shared-web-ui/src/Toast/ToastHost.d.ts +0 -22
  418. package/dist/types/shared-web-ui/src/Toast/ToastItem.d.ts +0 -19
  419. package/dist/types/shared-web-ui/src/Tooltip/Tooltip.d.ts +0 -25
  420. package/dist/types/shared-web-ui/src/Tooltip/useTooltip.d.ts +0 -24
  421. package/dist/types/shared-web-ui/src/UIProvider/UIPortalContext.d.ts +0 -16
  422. package/dist/types/shared-web-ui/src/UIProvider/UIProvider.d.ts +0 -54
  423. package/dist/types/shared-web-ui/src/UIProvider/UIThemeContext.d.ts +0 -17
  424. package/dist/types/shared-web-ui/src/index.d.ts +0 -78
  425. /package/dist/types/{shared-web-ui/src → components}/AppBar/index.d.ts +0 -0
  426. /package/dist/types/{shared-web-ui/src → components}/Avatar/index.d.ts +0 -0
  427. /package/dist/types/{shared-web-ui/src → components}/Badge/index.d.ts +0 -0
  428. /package/dist/types/{shared-web-ui/src → components}/Breadcrumbs/index.d.ts +0 -0
  429. /package/dist/types/{shared-web-ui/src → components}/Card/index.d.ts +0 -0
  430. /package/dist/types/{shared-web-ui/src → components}/ColorSchemeSelect/index.d.ts +0 -0
  431. /package/dist/types/{shared-web-ui/src → components}/CommandPalette/index.d.ts +0 -0
  432. /package/dist/types/{shared-web-ui/src → components}/Dialog/index.d.ts +0 -0
  433. /package/dist/types/{shared-web-ui/src → components}/DropdownMenu/index.d.ts +0 -0
  434. /package/dist/types/{shared-web-ui/src → components}/Popover/index.d.ts +0 -0
  435. /package/dist/types/{shared-web-ui/src → components}/Sidebar/index.d.ts +0 -0
  436. /package/dist/types/{shared-web-ui/src → components}/Skeleton/index.d.ts +0 -0
  437. /package/dist/types/{shared-web-ui/src → components}/Suggest/fuseSearch.d.ts +0 -0
  438. /package/dist/types/{shared-web-ui/src → components}/Tabs/index.d.ts +0 -0
  439. /package/dist/types/{shared-web-ui/src → components}/Toast/index.d.ts +0 -0
  440. /package/dist/types/{shared-web-ui/src → components}/Tooltip/index.d.ts +0 -0
  441. /package/dist/types/{shared-web-ui/src → components}/UIProvider/index.d.ts +0 -0
  442. /package/dist/types/{shared-logic/src/ui → core/logic}/checkbox.logic.d.ts +0 -0
  443. /package/dist/types/{shared-logic/src/ui → core/logic}/input.logic.d.ts +0 -0
  444. /package/dist/types/{shared-logic/src/ui → core/logic}/radio.logic.d.ts +0 -0
  445. /package/dist/types/{shared-logic/src/ui → core/logic}/switch.logic.d.ts +0 -0
@@ -0,0 +1,1703 @@
1
+ "use client";
2
+ import { A as e, C as t, D as n, E as r, F as i, G as a, J as o, K as s, L as c, M as l, Mn as u, N as d, Nn as f, O as p, R as m, S as h, T as g, W as _, X as v, Y as y, Z as b, _ as x, b as S, c as C, ct as w, d as T, f as E, ft as D, g as O, h as k, i as A, j, k as M, l as N, m as P, o as F, ot as I, p as L, q as R, r as z, s as B, t as V, u as ee, v as H, vt as te, w as ne, y as re, z as ie } from "./geometry-CG2nOEnw.js";
3
+ import { useCallback as U, useEffect as ae, useLayoutEffect as W, useMemo as oe, useRef as G, useState as K } from "react";
4
+ import { Fragment as se, jsx as q, jsxs as J } from "react/jsx-runtime";
5
+ import { createPortal as ce } from "react-dom";
6
+ // src/core/logic/uiScale.logic.ts
7
+ function le(e) {
8
+ let t = parseFloat(e ?? "");
9
+ return Number.isFinite(t) && t > 0 ? t : 1;
10
+ }
11
+ // src/components/Charts/useUiScale.ts
12
+ function Y() {
13
+ let [e, t] = K(null), [n, r] = K(1);
14
+ return W(() => {
15
+ e && r(le(getComputedStyle(e).getPropertyValue("--ui-scale")));
16
+ }), W(() => {
17
+ if (!e || typeof ResizeObserver > "u") return;
18
+ let t = new ResizeObserver(() => r(le(getComputedStyle(e).getPropertyValue("--ui-scale"))));
19
+ return t.observe(e), () => t.disconnect();
20
+ }, [e]), [U((e) => t(e), []), n];
21
+ }
22
+ // src/components/Charts/pointer.ts
23
+ function ue(e, t, n) {
24
+ return n <= 0 || t <= 0 ? null : Math.max(0, Math.min(n - 1, Math.floor(e / t * n)));
25
+ }
26
+ function de(e, t) {
27
+ let n = null, r = Infinity;
28
+ return t.forEach((t, i) => {
29
+ let a = e < t.start ? t.start - e : e > t.end ? e - t.end : 0;
30
+ a < r && (n = i, r = a);
31
+ }), n;
32
+ }
33
+ function fe(e, t, n) {
34
+ let r = null, i = Infinity;
35
+ return n.forEach((n, a) => {
36
+ if (!n) return;
37
+ let o = e < n.left ? n.left - e : e > n.left + n.width ? e - n.left - n.width : 0, s = t < n.top ? n.top - t : t > n.top + n.height ? t - n.top - n.height : 0, c = o * o + s * s;
38
+ c < i && (r = a, i = c);
39
+ }), r;
40
+ }
41
+ function pe(e, t) {
42
+ let n = Math.atan2(e, -t);
43
+ return n < 0 ? n + 2 * Math.PI : n;
44
+ }
45
+ var me = -1;
46
+ function he(e, t, n, r, i) {
47
+ let a = Math.hypot(e, t);
48
+ if (a > n || !i.length) return null;
49
+ if (a < r) return -1;
50
+ let o = pe(e, t), s = 2 * Math.PI, c = (e, t) => ((t - e) % s + s) % s, l = 0, u = Infinity;
51
+ return i.forEach((e, t) => {
52
+ if (o >= e.a0 && o <= e.a1) {
53
+ l = t, u = -1;
54
+ return;
55
+ }
56
+ if (u < 0) return;
57
+ let n = Math.min(c(o, e.a0), c(e.a1, o));
58
+ n < u && (l = t, u = n);
59
+ }), l;
60
+ }
61
+ var ge = {
62
+ x: 12,
63
+ y: 4
64
+ };
65
+ function _e(e, t, n, r = ge, i = 8) {
66
+ let a = (e, t, n) => Math.min(Math.max(e, t), Math.max(t, n)), o = e.x + r.x, s = "right";
67
+ o + t.width > n.width - i && (o = e.x - r.x - t.width, s = "left");
68
+ let c = e.y + r.y, l = "below";
69
+ return c + t.height > n.height - i && (c = e.y - r.y - t.height, l = "above"), {
70
+ left: a(o, i, n.width - t.width - i),
71
+ top: a(c, i, n.height - t.height - i),
72
+ x: s,
73
+ y: l
74
+ };
75
+ }
76
+ // src/components/Charts/ChartTooltip.tsx
77
+ var X = null, ve = 8, ye = () => ({
78
+ width: document.documentElement.clientWidth || window.innerWidth,
79
+ height: document.documentElement.clientHeight || window.innerHeight
80
+ });
81
+ function Z(e) {
82
+ let t = G(e);
83
+ t.current = e;
84
+ let [n] = K(() => ({})), r = G(null), i = G(null), a = u(), [o, s] = K(null), c = G(null), l = G(null), [d, p] = K(null), m = !!e.onPick, h = (e) => e >= 0 && e < t.current.count && (t.current.focusable?.(e) ?? !0), g = U((e) => {
85
+ r.current = e;
86
+ }, []), _ = U(() => {
87
+ c.current = null, s(null);
88
+ }, []), y = U((e, t) => {
89
+ X && X.id !== n && X.clear(), X = {
90
+ id: n,
91
+ clear: _
92
+ }, s((n) => n && n.index === e && n.via === t ? n : {
93
+ index: e,
94
+ via: t
95
+ });
96
+ }, [n, _]);
97
+ ae(() => () => {
98
+ X?.id === n && (X = null);
99
+ }, [n]);
100
+ let b = U(() => {
101
+ let e = i.current, n = r.current;
102
+ if (!e || !n || !o) return;
103
+ let a = {
104
+ width: e.offsetWidth,
105
+ height: e.offsetHeight
106
+ }, s;
107
+ if (c.current) s = _e(c.current, a, ye());
108
+ else {
109
+ let e = t.current.anchor?.(o.index, n) ?? be(n, o.index) ?? n.getBoundingClientRect();
110
+ s = f({
111
+ anchor: e,
112
+ tooltip: a,
113
+ viewport: ye(),
114
+ placement: "top",
115
+ offset: 8,
116
+ margin: 8
117
+ });
118
+ }
119
+ let l = e.parentElement?.getBoundingClientRect() ?? {
120
+ left: 0,
121
+ top: 0
122
+ };
123
+ e.style.transform = `translate(${Math.round(s.left - l.left)}px, ${Math.round(s.top - l.top)}px)`, e.style.visibility = "visible";
124
+ }, [o]);
125
+ W(b), ae(() => {
126
+ if (o?.via !== "touch") return;
127
+ let e = (e) => {
128
+ r.current?.contains(e.target) || _();
129
+ };
130
+ return document.addEventListener("pointerdown", e, !0), () => document.removeEventListener("pointerdown", e, !0);
131
+ }, [o?.via, _]);
132
+ let x = (e, n) => {
133
+ let i = r.current;
134
+ if (!i) return null;
135
+ let a = i.getBoundingClientRect();
136
+ return t.current.pick(e - a.left, n - a.top, a, i);
137
+ }, S = (e) => {
138
+ c.current = {
139
+ x: e.clientX,
140
+ y: e.clientY
141
+ };
142
+ let t = x(e.clientX, e.clientY);
143
+ if (t === null) return _();
144
+ y(t, e.pointerType === "touch" ? "touch" : "pointer"), b();
145
+ }, C = [
146
+ d,
147
+ o?.index ?? null,
148
+ e.start ?? null
149
+ ].find((e) => e !== null && h(e)) ?? null;
150
+ for (let t = 0; t < e.count && C === null; t++) h(t) && (C = t);
151
+ let w = (e) => {
152
+ let t = e instanceof Element && e !== r.current ? e.closest("[data-hit]") : null;
153
+ return t && r.current?.contains(t) ? Number(t.getAttribute("data-hit")) : null;
154
+ };
155
+ return {
156
+ active: o?.index ?? null,
157
+ pickable: m,
158
+ item: (e, t = {}) => m && h(e) ? {
159
+ "data-hit": e,
160
+ role: "button",
161
+ tabIndex: e === C ? 0 : -1,
162
+ "aria-pressed": t.disabled ? void 0 : !!t.pressed,
163
+ "aria-disabled": t.disabled ? !0 : void 0
164
+ } : { "data-hit": e },
165
+ plotProps: {
166
+ ref: g,
167
+ tabIndex: m ? void 0 : 0,
168
+ "data-chart-plot": "",
169
+ onPointerDown: (e) => {
170
+ e.pointerType === "touch" && (l.current = {
171
+ x: e.clientX,
172
+ y: e.clientY,
173
+ moved: !1
174
+ }, S(e));
175
+ },
176
+ onPointerMove: (e) => {
177
+ if (e.pointerType === "touch") {
178
+ if (!l.current) return;
179
+ Math.hypot(e.clientX - l.current.x, e.clientY - l.current.y) > ve && (l.current.moved = !0);
180
+ }
181
+ S(e);
182
+ },
183
+ onPointerUp: () => {
184
+ l.current && setTimeout(() => l.current = null, 0);
185
+ },
186
+ onPointerLeave: (e) => {
187
+ e.pointerType !== "touch" && _();
188
+ },
189
+ onClick: (e) => {
190
+ if (l.current?.moved) return;
191
+ let n = x(e.clientX, e.clientY);
192
+ n !== null && n >= 0 && t.current.onPick?.(n);
193
+ },
194
+ onKeyDown: (e) => {
195
+ let n = t.current, i = w(e.target);
196
+ if (n.onPick && i !== null && !h(i)) return;
197
+ let a = i ?? (o && o.index >= 0 ? o.index : null);
198
+ if ((e.key === "Enter" || e.key === " ") && a !== null && n.onPick) {
199
+ e.preventDefault(), n.onPick(a);
200
+ return;
201
+ }
202
+ if (e.key === "Escape") return o && e.stopPropagation(), _();
203
+ let s = o && o.index >= 0 ? o.index : n.start ?? null, l = v(e.key, s, n.count, n.keys, n.onPick ? h : void 0);
204
+ l !== null && (e.preventDefault(), c.current = null, y(l, "key"), n.onPick && r.current?.querySelector(`[data-hit="${l}"]`)?.focus());
205
+ },
206
+ onFocus: (e) => {
207
+ let t = w(e.target);
208
+ m && t !== null && (p(t), o?.index !== t && (c.current = null, y(t, "key")));
209
+ },
210
+ onBlur: (e) => {
211
+ e.relatedTarget instanceof Node && r.current?.contains(e.relatedTarget) || o?.via === "key" && _();
212
+ }
213
+ },
214
+ tooltip: (e) => {
215
+ if (!o || e == null || !a) return null;
216
+ let t = r.current?.closest("[data-theme]")?.getAttribute("data-theme") ?? void 0;
217
+ return ce(/* @__PURE__ */ q("div", {
218
+ className: "chart-tooltip-layer",
219
+ "data-theme": t,
220
+ children: /* @__PURE__ */ q("div", {
221
+ ref: i,
222
+ className: "chart-root chart-tooltip",
223
+ role: "presentation",
224
+ "aria-hidden": !0,
225
+ style: { visibility: "hidden" },
226
+ children: e
227
+ })
228
+ }), a);
229
+ }
230
+ };
231
+ }
232
+ function be(e, t) {
233
+ let n = e.querySelector(`[data-hit="${t}"]`);
234
+ return n ? n.getBoundingClientRect() : null;
235
+ }
236
+ function xe(e) {
237
+ let t = e.getBoundingClientRect(), n = [];
238
+ return e.querySelectorAll("[data-hit]").forEach((e) => {
239
+ let r = e.getBoundingClientRect();
240
+ n[Number(e.dataset.hit)] = {
241
+ left: r.left - t.left,
242
+ top: r.top - t.top,
243
+ width: r.width,
244
+ height: r.height
245
+ };
246
+ }), n;
247
+ }
248
+ function Q({ title: e, rows: t = [], note: n }) {
249
+ return /* @__PURE__ */ J(se, { children: [
250
+ e != null && e !== "" && /* @__PURE__ */ q("p", {
251
+ className: "chart-tooltip-title",
252
+ children: e
253
+ }),
254
+ t.map((e) => /* @__PURE__ */ J("p", {
255
+ className: "chart-tooltip-series",
256
+ children: [
257
+ e.color && /* @__PURE__ */ q("span", {
258
+ className: "chart-swatch chart-swatch--small",
259
+ style: { background: e.color }
260
+ }),
261
+ /* @__PURE__ */ q("span", {
262
+ className: "chart-tooltip-label",
263
+ children: e.label
264
+ }),
265
+ /* @__PURE__ */ q("strong", {
266
+ className: "chart-tooltip-value",
267
+ children: e.value
268
+ })
269
+ ]
270
+ }, e.key)),
271
+ n != null && n !== "" && /* @__PURE__ */ q("p", {
272
+ className: "chart-tooltip-note",
273
+ children: n
274
+ })
275
+ ] });
276
+ }
277
+ // src/components/Charts/BarList.tsx
278
+ function Se({ href: e, className: t, title: n, children: r }) {
279
+ return /* @__PURE__ */ q("a", {
280
+ href: e,
281
+ className: t,
282
+ title: n,
283
+ children: r
284
+ });
285
+ }
286
+ function Ce({ data: e, series: t, ariaLabel: n, title: r, linkAs: i = Se, compact: c = !1, onSelect: l, selected: u = null, ...f }) {
287
+ let { nf: p, L: m } = b(f), h = (t) => !!l && !e[t]?.href && e[t]?.selectable !== !1, g = Z({
288
+ count: e.length,
289
+ pick: (e, t, n, r) => de(t, xe(r).map((e) => e ? {
290
+ start: e.top,
291
+ end: e.top + e.height
292
+ } : {
293
+ start: Infinity,
294
+ end: Infinity
295
+ })),
296
+ keys: {
297
+ ArrowLeft: 0,
298
+ ArrowRight: 0
299
+ },
300
+ start: u === null ? null : e.findIndex((e) => H(e) === u),
301
+ onPick: l ? (t) => h(t) && l(e[t]) : void 0,
302
+ focusable: (t) => !e[t]?.href
303
+ }), v = e.map((e) => re(e, t));
304
+ if (v.every((e) => e === 0)) return /* @__PURE__ */ q(s, {
305
+ title: r,
306
+ children: /* @__PURE__ */ q(_, {
307
+ ariaLabel: n,
308
+ text: m.empty,
309
+ compact: c
310
+ })
311
+ });
312
+ let y = N(v), x = v.reduce((e, t) => e + t, 0), S = g.active, C = S === null ? u : H(e[S]), w = S === null ? null : e[S], T = (e, t) => `${e.fullLabel ?? e.label}: ${p(v[t])}`;
313
+ return /* @__PURE__ */ J(s, {
314
+ title: r,
315
+ children: [
316
+ /* @__PURE__ */ q("div", {
317
+ className: R(`chart-bars chart-plot chart-plot--rows${l ? " chart-plot--pick" : ""}`, c),
318
+ role: l ? "group" : "img",
319
+ "aria-label": !l && w ? T(w, S) : n,
320
+ ...g.plotProps,
321
+ children: e.map((e, n) => {
322
+ let r = H(e), a = e.fullLabel ?? e.label, o = g.pickable && !e.href;
323
+ return /* @__PURE__ */ J("div", {
324
+ ...g.item(n, {
325
+ pressed: u === r,
326
+ disabled: !h(n)
327
+ }),
328
+ "aria-label": o ? `${e.label}: ${p(v[n])}` : void 0,
329
+ "aria-description": o && a !== e.label ? a : void 0,
330
+ className: `chart-bars-item${n === S ? " chart-bars-item--active" : ""}${u === r ? " chart-bars-item--on" : ""}`,
331
+ children: [
332
+ e.href ? /* @__PURE__ */ q(i, {
333
+ href: e.href,
334
+ className: "chart-bars-label chart-bars-link",
335
+ title: a,
336
+ children: e.label
337
+ }) : /* @__PURE__ */ q("span", {
338
+ className: "chart-bars-label",
339
+ title: a,
340
+ children: e.label
341
+ }),
342
+ " ",
343
+ /* @__PURE__ */ q("span", {
344
+ className: `chart-bars-bar${C !== null && C !== r ? " chart-faded" : ""}`,
345
+ "aria-hidden": !0,
346
+ children: t.map((n, r) => {
347
+ let i = e.values[n.key] ?? 0;
348
+ if (!i) return null;
349
+ let a = t.slice(r + 1).every((t) => !(e.values[t.key] ?? 0));
350
+ return /* @__PURE__ */ q("span", {
351
+ className: `chart-bars-segment${a ? " chart-bars-segment--end" : ""}`,
352
+ style: {
353
+ width: `${i / y * 100}%`,
354
+ background: I(t.length === 1 && e.slot ? e.slot : n.slot)
355
+ }
356
+ }, n.key);
357
+ })
358
+ }),
359
+ /* @__PURE__ */ q("span", {
360
+ className: "chart-bars-value",
361
+ children: p(v[n])
362
+ })
363
+ ]
364
+ }, r);
365
+ })
366
+ }),
367
+ /* @__PURE__ */ q(a, { text: w ? T(w, S) : "" }),
368
+ g.tooltip(w && /* @__PURE__ */ q(Q, {
369
+ title: w.fullLabel ?? w.label,
370
+ rows: t.map((e) => ({
371
+ key: e.key,
372
+ color: I(t.length === 1 && w.slot ? w.slot : e.slot),
373
+ label: e.label,
374
+ value: p(w.values[e.key] ?? 0)
375
+ })),
376
+ note: m.shareOf(o(d(v[S], x)), p(x))
377
+ }))
378
+ ]
379
+ });
380
+ }
381
+ // src/components/Charts/useBoxSize.ts
382
+ function we() {
383
+ let [e, t] = K(null), [n, r] = K({
384
+ width: 0,
385
+ height: 0
386
+ });
387
+ return W(() => {
388
+ if (!e) return;
389
+ let t = () => {
390
+ let t = e.getBoundingClientRect();
391
+ r((e) => e.width === Math.round(t.width) && e.height === Math.round(t.height) ? e : {
392
+ width: Math.round(t.width),
393
+ height: Math.round(t.height)
394
+ });
395
+ };
396
+ if (t(), typeof ResizeObserver > "u") return;
397
+ let n = new ResizeObserver(t);
398
+ return n.observe(e), () => n.disconnect();
399
+ }, [e]), [U((e) => t(e), []), n];
400
+ }
401
+ function $() {
402
+ let [e, t] = we();
403
+ return [e, t.width];
404
+ }
405
+ // src/components/Charts/CalendarHeatmap.tsx
406
+ function Te(e) {
407
+ let t = (t) => {
408
+ try {
409
+ return new Intl.DateTimeFormat(e, {
410
+ ...t,
411
+ timeZone: "UTC"
412
+ });
413
+ } catch {
414
+ return new Intl.DateTimeFormat(void 0, {
415
+ ...t,
416
+ timeZone: "UTC"
417
+ });
418
+ }
419
+ };
420
+ return {
421
+ day: t({ dateStyle: "medium" }),
422
+ month: t({ month: "short" }),
423
+ weekday: t({ weekday: "short" })
424
+ };
425
+ }
426
+ var Ee = (e = "en-IN") => Array.from({ length: 7 }, (t, n) => Te(e).weekday.format(Date.UTC(2024, 0, 1 + n)));
427
+ function De({ days: e, ariaLabel: t, title: n, onSelect: r, selected: i = null, compact: o = !1, ...c }) {
428
+ let { nf: l, L: u } = b(c), d = c.locale ?? "en-IN", f = oe(() => Te(d), [d]), p = oe(() => Ee(d), [d]), m = oe(() => T(e), [e]), [h, g] = $(), [v, y] = Y(), x = ee(g, m.weeks, o ? V.compactMax : V.max, y), C = x.cell + x.gap, D = x.weekdays ? P(y) : 0, O = i === null ? -1 : m.cells.findIndex((e) => e.day === i), k = Z({
429
+ count: m.cells.length,
430
+ pick: (e, t) => fe(e, t, m.cells.map((e) => ({
431
+ left: D + e.week * C,
432
+ top: e.weekday * C,
433
+ width: x.cell,
434
+ height: x.cell
435
+ }))),
436
+ keys: {
437
+ ArrowLeft: -7,
438
+ ArrowRight: 7,
439
+ ArrowUp: -1,
440
+ ArrowDown: 1
441
+ },
442
+ start: O >= 0 ? O : null,
443
+ onPick: r ? (e) => r({
444
+ day: m.cells[e].day,
445
+ count: m.cells[e].count
446
+ }) : void 0
447
+ });
448
+ if (!m.cells.length || m.total === 0) return /* @__PURE__ */ q(s, {
449
+ title: n,
450
+ children: /* @__PURE__ */ q(_, {
451
+ ariaLabel: t,
452
+ text: u.empty,
453
+ compact: o
454
+ })
455
+ });
456
+ let A = (e) => `${f.day.format(S(e.day))}: ${l(e.count)}`, j = k.active, M = j === null ? null : m.cells[j] ?? null, N = `${x.weekdays ? `${D}px ` : ""}repeat(${m.weeks}, ${x.cell}px)`, F = x.weekdays ? 2 : 1;
457
+ return /* @__PURE__ */ q(s, {
458
+ title: n,
459
+ children: /* @__PURE__ */ J("div", {
460
+ ref: h,
461
+ className: R("chart-calendar", o),
462
+ role: "group",
463
+ "aria-label": `${t}: ${u.total} ${l(m.total)}`,
464
+ children: [
465
+ /* @__PURE__ */ q("div", {
466
+ ref: v,
467
+ className: "chart-calendar-months",
468
+ style: {
469
+ gridTemplateColumns: N,
470
+ columnGap: x.gap
471
+ },
472
+ "aria-hidden": !0,
473
+ children: E(m.months, C, y).map((e) => /* @__PURE__ */ q("span", {
474
+ style: {
475
+ gridRow: 1,
476
+ gridColumn: `${e.week + F} / span ${Math.max(1, Math.ceil(L(y) / C))}`
477
+ },
478
+ children: f.month.format(S(`${e.month}-01`))
479
+ }, e.month))
480
+ }),
481
+ /* @__PURE__ */ J("div", {
482
+ className: `chart-calendar-grid chart-plot${r ? " chart-plot--pick" : ""}`,
483
+ style: {
484
+ gridTemplateColumns: N,
485
+ gridTemplateRows: `repeat(7, ${x.cell}px)`,
486
+ gap: x.gap
487
+ },
488
+ role: r ? void 0 : "img",
489
+ "aria-label": r ? void 0 : M ? A(M) : t,
490
+ ...k.plotProps,
491
+ children: [x.weekdays && p.map((e, t) => /* @__PURE__ */ q("span", {
492
+ className: "chart-calendar-weekday",
493
+ style: {
494
+ gridRow: t + 1,
495
+ gridColumn: 1
496
+ },
497
+ "aria-hidden": !0,
498
+ children: t % 2 == 0 ? e : ""
499
+ }, e)), m.cells.map((e, t) => /* @__PURE__ */ q("span", {
500
+ ...k.item(t, { pressed: t === O }),
501
+ "aria-label": k.pickable ? A(e) : void 0,
502
+ className: `chart-calendar-day${t === O ? " chart-calendar-day--on" : ""}${t === j ? " chart-calendar-day--active" : ""}${O >= 0 && t !== O ? " chart-calendar-day--faded" : ""}`,
503
+ style: {
504
+ gridRow: e.weekday + 1,
505
+ gridColumn: e.week + F,
506
+ background: w(e.level),
507
+ borderRadius: x.cell < 8 ? 1 : 2
508
+ },
509
+ "data-level": e.level,
510
+ "aria-hidden": !k.pickable || void 0
511
+ }, e.day))]
512
+ }),
513
+ /* @__PURE__ */ J("div", {
514
+ className: "chart-calendar-legend",
515
+ "aria-hidden": !0,
516
+ children: [
517
+ /* @__PURE__ */ q("span", { children: u.less }),
518
+ Array.from({ length: 5 }, (e, t) => /* @__PURE__ */ q("span", {
519
+ className: "chart-calendar-swatch",
520
+ style: { background: w(t) }
521
+ }, t)),
522
+ /* @__PURE__ */ q("span", { children: u.more })
523
+ ]
524
+ }),
525
+ /* @__PURE__ */ q(a, { text: M ? A(M) : "" }),
526
+ k.tooltip(M && /* @__PURE__ */ q(Q, {
527
+ title: f.day.format(S(M.day)),
528
+ rows: [{
529
+ key: "n",
530
+ color: w(Math.max(1, M.level)),
531
+ label: t,
532
+ value: l(M.count)
533
+ }]
534
+ }))
535
+ ]
536
+ })
537
+ });
538
+ }
539
+ // src/components/Charts/Legend.tsx
540
+ function Oe({ series: e, labels: t }) {
541
+ let { L: n } = b({ labels: t });
542
+ return e.length < 2 ? null : /* @__PURE__ */ q("ul", {
543
+ className: R("chart-legend"),
544
+ "aria-label": n.legend,
545
+ children: e.map((e) => /* @__PURE__ */ J("li", {
546
+ className: "chart-legend-item",
547
+ children: [/* @__PURE__ */ q("span", {
548
+ className: "chart-swatch",
549
+ style: { background: I(e.slot) },
550
+ "aria-hidden": !0
551
+ }), e.label]
552
+ }, e.key))
553
+ });
554
+ }
555
+ // src/components/Charts/ColumnChart.tsx
556
+ var ke = 6, Ae = 2, je = 6, Me = 44;
557
+ function Ne({ data: e, series: t, ariaLabel: n, title: i, height: o, compact: c = !1, mode: l = "stacked", legend: u = !1, onSelect: d, selected: f = null, ...p }) {
558
+ let { nf: m, L: h } = b(p), [g, v] = $(), [y, S] = Y(), w = e.length, T = (t) => !!d && e[t]?.selectable !== !1, E = Z({
559
+ count: w,
560
+ pick: (e, t, n) => ue(e, n.width, w),
561
+ anchor: (e, t) => {
562
+ let n = t.getBoundingClientRect();
563
+ return {
564
+ left: n.left + n.width * e / w,
565
+ top: n.top,
566
+ width: n.width / w,
567
+ height: n.height
568
+ };
569
+ },
570
+ keys: {
571
+ ArrowUp: 0,
572
+ ArrowDown: 0
573
+ },
574
+ start: f === null ? null : e.findIndex((e) => H(e) === f),
575
+ onPick: d ? (t) => T(t) && d(e[t]) : void 0
576
+ }), D = e.map((e) => re(e, t));
577
+ if (D.every((e) => e === 0)) return /* @__PURE__ */ q(s, {
578
+ title: i,
579
+ children: /* @__PURE__ */ q(_, {
580
+ ariaLabel: n,
581
+ text: h.empty,
582
+ compact: c
583
+ })
584
+ });
585
+ let k = (o ?? (c ? 96 : 220)) * S, A = l === "grouped" && t.length > 1, { max: j, ticks: M } = O(x(e, t, A ? "grouped" : "stacked")), N = A ? r(t.length, 100, ke) : [], P = E.active, F = (P === null ? null : H(e[P])) ?? f, L = v && v / Math.max(1, w) < je ? 0 : Ae, z = new Set(C(w, Math.max(2, Math.min(12, Math.floor((v || 600) / (Me * S)))))), B = (e, n) => `${e.fullLabel ?? e.label}: ${t.length > 1 ? t.map((t) => `${t.label} ${m(e.values[t.key] ?? 0)}`).join(", ") : m(D[n])}`, V = P === null ? null : e[P];
586
+ return /* @__PURE__ */ q(s, {
587
+ title: i,
588
+ children: /* @__PURE__ */ J("div", {
589
+ ref: g,
590
+ className: R(`chart-columns${A ? " chart-columns--grouped" : ""}`, c),
591
+ role: "group",
592
+ "aria-label": n,
593
+ children: [
594
+ /* @__PURE__ */ J("div", {
595
+ className: "chart-columns-plot",
596
+ style: { height: k },
597
+ children: [!c && /* @__PURE__ */ q("div", {
598
+ className: "chart-axis-y",
599
+ "aria-hidden": !0,
600
+ children: [...M].reverse().map((e) => /* @__PURE__ */ q("span", { children: m(e) }, e))
601
+ }), /* @__PURE__ */ J("div", {
602
+ className: `chart-columns-area chart-plot chart-plot--x${d ? " chart-plot--pick" : ""}`,
603
+ role: d ? void 0 : "img",
604
+ "aria-label": d ? void 0 : V ? B(V, P) : n,
605
+ ...E.plotProps,
606
+ children: [!c && M.slice(1).map((e) => /* @__PURE__ */ q("div", {
607
+ className: "chart-gridline",
608
+ style: { bottom: `${e / j * 100}%` },
609
+ "aria-hidden": !0
610
+ }, e)), /* @__PURE__ */ q("div", {
611
+ className: "chart-columns-bars",
612
+ style: { gap: L },
613
+ "aria-hidden": !E.pickable || void 0,
614
+ children: e.map((e, n) => {
615
+ let r = H(e), i = F !== null && F !== r ? " chart-faded" : "";
616
+ return /* @__PURE__ */ q("div", {
617
+ ...E.item(n, {
618
+ pressed: f === r,
619
+ disabled: !T(n)
620
+ }),
621
+ "aria-label": E.pickable ? B(e, n) : void 0,
622
+ className: `chart-column${n === P ? " chart-column--active" : ""}${f === r ? " chart-column--on" : ""}`,
623
+ children: A ? /* @__PURE__ */ q("span", {
624
+ className: `chart-column-group${i}`,
625
+ children: t.map((t, n) => /* @__PURE__ */ q("span", {
626
+ className: "chart-column-segment chart-column-segment--top chart-column-bar",
627
+ style: {
628
+ left: `${N[n].x}%`,
629
+ width: `${N[n].width}%`,
630
+ height: `${(e.values[t.key] ?? 0) / j * k}px`,
631
+ background: I(t.slot)
632
+ }
633
+ }, t.key))
634
+ }) : /* @__PURE__ */ q("span", {
635
+ className: `chart-column-stack${i}`,
636
+ children: t.map((n, r) => {
637
+ let i = e.values[n.key] ?? 0;
638
+ if (!i) return null;
639
+ let a = t.slice(r + 1).every((t) => !(e.values[t.key] ?? 0));
640
+ return /* @__PURE__ */ q("span", {
641
+ className: `chart-column-segment${a ? " chart-column-segment--top" : ""}`,
642
+ style: {
643
+ height: `${i / j * k}px`,
644
+ background: I(n.slot)
645
+ }
646
+ }, n.key);
647
+ })
648
+ })
649
+ }, r);
650
+ })
651
+ })]
652
+ })]
653
+ }),
654
+ /* @__PURE__ */ q("div", {
655
+ ref: y,
656
+ className: `chart-axis-x${c ? " chart-axis-x--compact" : ""}`,
657
+ style: { gap: L },
658
+ "aria-hidden": !0,
659
+ children: e.map((e, t) => /* @__PURE__ */ q("span", {
660
+ className: f !== null && f !== H(e) ? "chart-faded" : void 0,
661
+ children: z.has(t) ? e.label : ""
662
+ }, H(e)))
663
+ }),
664
+ u && /* @__PURE__ */ q("div", {
665
+ className: "chart-columns-legend",
666
+ children: /* @__PURE__ */ q(Oe, {
667
+ series: t,
668
+ labels: p.labels
669
+ })
670
+ }),
671
+ /* @__PURE__ */ q(a, { text: V ? B(V, P) : "" }),
672
+ E.tooltip(V && /* @__PURE__ */ q(Q, {
673
+ title: V.fullLabel ?? V.label,
674
+ rows: t.map((e) => ({
675
+ key: e.key,
676
+ color: I(e.slot),
677
+ label: e.label,
678
+ value: m(V.values[e.key] ?? 0)
679
+ })),
680
+ note: t.length > 1 ? `${h.total}: ${m(D[P])}` : void 0
681
+ }))
682
+ ]
683
+ })
684
+ });
685
+ }
686
+ // src/components/Charts/useLegendFit.ts
687
+ function Pe(e, t) {
688
+ let [n, r] = K(null), [i, a] = K(e), [o, s] = K(e);
689
+ return W(() => {
690
+ if (!t || !n) {
691
+ a(e), s(e);
692
+ return;
693
+ }
694
+ let r = 0, i = () => {
695
+ let t = n.clientHeight, r = Array.from(n.children).filter((e) => !e.hasAttribute("data-legend-more")), i = e;
696
+ if (t && r.length >= e) {
697
+ let a = n.getBoundingClientRect().top, o = r.filter((e) => e.getBoundingClientRect().bottom - a <= t + .5).length;
698
+ i = o >= e ? e : Math.max(0, o - 1);
699
+ }
700
+ a(i), s(i);
701
+ }, o = () => {
702
+ cancelAnimationFrame(r), a(e), r = requestAnimationFrame(i);
703
+ };
704
+ if (o(), typeof ResizeObserver > "u") return () => cancelAnimationFrame(r);
705
+ let c = n.parentElement ?? n, l = c.clientWidth, u = new ResizeObserver(() => {
706
+ c.clientWidth !== l && (l = c.clientWidth, o());
707
+ });
708
+ return u.observe(c), () => {
709
+ cancelAnimationFrame(r), u.disconnect();
710
+ };
711
+ }, [
712
+ n,
713
+ e,
714
+ t
715
+ ]), [
716
+ U((e) => r(e), []),
717
+ t ? i : e,
718
+ t ? o : e
719
+ ];
720
+ }
721
+ // src/components/Charts/Donut.tsx
722
+ var Fe = 2.5;
723
+ function Ie({ slices: n, ariaLabel: r, title: i, size: s, compact: c = !1, variant: u = "donut", onLegendCut: f, legend: p = !0, onSelect: m, selected: h = null, ...g }) {
724
+ let { nf: _, L: v } = b(g), [y, x] = K(null), [S, C, w] = Pe(n.length, c);
725
+ ae(() => f?.(n.length - w), [
726
+ f,
727
+ n.length,
728
+ w
729
+ ]);
730
+ let [T, E] = Y(), D = (s ?? (c ? 112 : 168)) * E, O = n.reduce((e, t) => e + t.value, 0), k = u === "pie", A = k ? e(n).map((e) => ({
731
+ slice: e.slice,
732
+ a0: e.a0,
733
+ a1: e.a1
734
+ })) : t(n).map((e) => ({
735
+ slice: e.slice,
736
+ a0: e.start / z * 2 * Math.PI,
737
+ a1: (e.start + e.length) / z * 2 * Math.PI
738
+ })), j = (e) => !!m && n[e].value > 0 && n[e].selectable !== !1, M = Z({
739
+ count: n.length,
740
+ pick: (e, t, r) => {
741
+ let i = r.width / 100, a = 48 * i, o = k ? 0 : 32 * i, s = he(e - r.width / 2, t - r.height / 2, a, o, A);
742
+ return s === null || s === -1 ? s : n.indexOf(A[s].slice);
743
+ },
744
+ anchor: (e, t) => {
745
+ let r = t.getBoundingClientRect(), i = A.find((t) => t.slice === n[e]), a = i ? l(r.left + r.width / 2, r.top + r.height / 2, r.width / 100 * (k ? 36 : 40), (i.a0 + i.a1) / 2) : {
746
+ x: r.left + r.width / 2,
747
+ y: r.top + r.height / 2
748
+ };
749
+ return {
750
+ left: a.x - 1,
751
+ top: a.y - 1,
752
+ width: 2,
753
+ height: 2
754
+ };
755
+ },
756
+ start: h === null ? null : n.findIndex((e) => e.key === h),
757
+ onPick: m ? (e) => j(e) && m(n[e]) : void 0,
758
+ focusable: (e) => n[e].value > 0
759
+ }), N = (e) => {
760
+ let t = n.indexOf(e);
761
+ return {
762
+ ...M.item(t, {
763
+ pressed: h === e.key,
764
+ disabled: !j(t)
765
+ }),
766
+ "aria-label": M.pickable ? F(e) : void 0
767
+ };
768
+ }, P = (e) => d(e, O), F = (e) => `${e.label} ${_(e.value)} (${o(P(e.value))})`, L = M.active === -1, B = M.active !== null && M.active >= 0 ? n[M.active] : void 0, V = B?.key ?? y ?? h, ee = n.find((e) => e.key === V) ?? n[0], H = (e) => V !== null && V !== e ? .55 : 1, ne = k ? e(n) : [];
769
+ return /* @__PURE__ */ J("figure", {
770
+ ref: T,
771
+ className: R(k ? "chart-donut chart-pie" : "chart-donut", c),
772
+ "aria-label": r,
773
+ children: [
774
+ i && /* @__PURE__ */ q("figcaption", {
775
+ className: "chart-donut-title",
776
+ children: i
777
+ }),
778
+ /* @__PURE__ */ J("div", {
779
+ className: `chart-donut-ring chart-plot${m ? " chart-plot--pick" : ""}`,
780
+ style: {
781
+ width: D,
782
+ height: D
783
+ },
784
+ role: m ? void 0 : "img",
785
+ "aria-label": m ? void 0 : B ? F(B) : `${r}: ${n.map(F).join(", ")}`,
786
+ ...M.plotProps,
787
+ children: [/* @__PURE__ */ q("svg", {
788
+ viewBox: "0 0 100 100",
789
+ width: D,
790
+ height: D,
791
+ className: "chart-donut-svg",
792
+ overflow: "visible",
793
+ "aria-hidden": !M.pickable || void 0,
794
+ children: k ? O === 0 ? /* @__PURE__ */ q("circle", {
795
+ cx: "50",
796
+ cy: "50",
797
+ r: 48,
798
+ fill: I("rest"),
799
+ opacity: .5,
800
+ "aria-hidden": !0
801
+ }) : ne.map((e) => {
802
+ let t = e.slice, n = V === t.key && ne.length > 1 ? l(0, 0, Fe, (e.a0 + e.a1) / 2) : null;
803
+ return /* @__PURE__ */ J("g", {
804
+ transform: n ? `translate(${n.x} ${n.y})` : void 0,
805
+ opacity: H(t.key),
806
+ className: "chart-pie-slice-group",
807
+ children: [/* @__PURE__ */ q("path", {
808
+ ...N(t),
809
+ d: ie(50, 50, 48, e.a0, e.a1),
810
+ fill: I(t.slot),
811
+ stroke: "var(--chart-surface)",
812
+ strokeWidth: +(ne.length > 1),
813
+ strokeLinejoin: "round",
814
+ className: "chart-donut-slice chart-pie-slice"
815
+ }), e.label && /* @__PURE__ */ q("text", {
816
+ x: e.label.x,
817
+ y: e.label.y,
818
+ className: "chart-pie-share",
819
+ fill: te(t.slot),
820
+ textAnchor: "middle",
821
+ dominantBaseline: "central",
822
+ "aria-hidden": !0,
823
+ children: o(e.share)
824
+ })]
825
+ }, t.key);
826
+ }) : /* @__PURE__ */ q("g", {
827
+ transform: "rotate(-90 50 50)",
828
+ children: O === 0 ? /* @__PURE__ */ q("circle", {
829
+ cx: "50",
830
+ cy: "50",
831
+ r: 40,
832
+ fill: "none",
833
+ stroke: I("rest"),
834
+ strokeWidth: 16,
835
+ opacity: .5,
836
+ "aria-hidden": !0
837
+ }) : t(n).map(({ slice: e, start: t, length: n }) => /* @__PURE__ */ q("circle", {
838
+ ...N(e),
839
+ cx: "50",
840
+ cy: "50",
841
+ r: 40,
842
+ fill: "none",
843
+ stroke: I(e.slot),
844
+ strokeWidth: V === e.key ? 18 : 16,
845
+ strokeDasharray: `${n} ${z}`,
846
+ strokeDashoffset: -t,
847
+ className: "chart-donut-slice",
848
+ opacity: L ? 1 : H(e.key)
849
+ }, e.key))
850
+ })
851
+ }), k ? O === 0 && /* @__PURE__ */ q("div", {
852
+ className: "chart-donut-centre",
853
+ "aria-hidden": !0,
854
+ children: /* @__PURE__ */ q("span", {
855
+ className: "chart-donut-empty",
856
+ children: v.empty
857
+ })
858
+ }) : /* @__PURE__ */ q("div", {
859
+ className: "chart-donut-centre",
860
+ "aria-hidden": !0,
861
+ children: O > 0 && L ? /* @__PURE__ */ J(se, { children: [/* @__PURE__ */ q("span", {
862
+ className: "chart-donut-share",
863
+ children: _(O)
864
+ }), /* @__PURE__ */ q("span", {
865
+ className: "chart-donut-share-label",
866
+ children: v.total.toLowerCase()
867
+ })] }) : O > 0 && ee ? /* @__PURE__ */ J(se, { children: [/* @__PURE__ */ q("span", {
868
+ className: "chart-donut-share",
869
+ children: o(P(ee.value))
870
+ }), /* @__PURE__ */ q("span", {
871
+ className: "chart-donut-share-label",
872
+ children: ee.label.toLowerCase()
873
+ })] }) : /* @__PURE__ */ q("span", {
874
+ className: "chart-donut-empty",
875
+ children: v.empty
876
+ })
877
+ })]
878
+ }),
879
+ p && /* @__PURE__ */ J("ul", {
880
+ ref: S,
881
+ className: "chart-donut-legend",
882
+ "aria-label": v.legend,
883
+ children: [n.slice(0, C).map((e, t) => /* @__PURE__ */ J("li", {
884
+ className: `chart-donut-legend-item${j(t) ? " chart-donut-legend-item--hit" : ""}${h === e.key ? " chart-donut-legend-item--on" : ""}${h !== null && h !== e.key ? " chart-faded" : ""}`,
885
+ onMouseEnter: () => x(e.key),
886
+ onMouseLeave: () => x(null),
887
+ onClick: j(t) ? () => m(e) : void 0,
888
+ children: [
889
+ /* @__PURE__ */ q("span", {
890
+ className: "chart-swatch",
891
+ style: { background: I(e.slot) },
892
+ "aria-hidden": !0
893
+ }),
894
+ /* @__PURE__ */ q("span", {
895
+ className: "chart-donut-legend-label",
896
+ children: e.label
897
+ }),
898
+ /* @__PURE__ */ J("span", {
899
+ className: "chart-donut-legend-value",
900
+ children: [
901
+ _(e.value),
902
+ " · ",
903
+ o(P(e.value))
904
+ ]
905
+ })
906
+ ]
907
+ }, e.key)), C < n.length && /* @__PURE__ */ q("li", {
908
+ className: "chart-donut-legend-more",
909
+ "data-legend-more": "",
910
+ children: v.moreValues(_(n.length - C))
911
+ })]
912
+ }),
913
+ /* @__PURE__ */ q(a, { text: B ? F(B) : L ? `${v.total} ${_(O)}` : "" }),
914
+ M.tooltip(L ? /* @__PURE__ */ q(Q, {
915
+ title: r,
916
+ rows: n.map((e) => ({
917
+ key: e.key,
918
+ color: I(e.slot),
919
+ label: e.label,
920
+ value: _(e.value)
921
+ })),
922
+ note: `${v.total}: ${_(O)}`
923
+ }) : B && /* @__PURE__ */ q(Q, {
924
+ rows: [{
925
+ key: B.key,
926
+ color: I(B.slot),
927
+ label: B.label,
928
+ value: _(B.value)
929
+ }],
930
+ note: v.shareOf(o(P(B.value)), _(O))
931
+ }))
932
+ ]
933
+ });
934
+ }
935
+ // src/components/Charts/Funnel.tsx
936
+ function Le({ steps: e, ariaLabel: t, title: n, compact: r = !1, onSelect: i, selected: c = null, ...l }) {
937
+ let { nf: u, L: d } = b(l), f = (t) => !!i && e[t].selectable !== !1, p = Z({
938
+ count: e.length,
939
+ pick: (e, t, n, r) => de(t, xe(r).map((e) => e ? {
940
+ start: e.top,
941
+ end: e.top + e.height
942
+ } : {
943
+ start: Infinity,
944
+ end: Infinity
945
+ })),
946
+ keys: {
947
+ ArrowLeft: 0,
948
+ ArrowRight: 0
949
+ },
950
+ start: c === null ? null : e.findIndex((e) => e.key === c),
951
+ onPick: i ? (t) => f(t) && i(e[t]) : void 0
952
+ });
953
+ if (!e.some((e) => e.value > 0)) return /* @__PURE__ */ q(s, {
954
+ title: n,
955
+ children: /* @__PURE__ */ q(_, {
956
+ ariaLabel: t,
957
+ text: d.empty,
958
+ compact: r
959
+ })
960
+ });
961
+ let m = ne(e), h = p.active === null ? null : m[p.active] ?? null, g = h?.step.key ?? c, v = (e) => `${e.step.label}: ${u(e.step.value)}${e.drop === null ? "" : `, ${d.funnelDrop} ${y(e.drop)}`}`;
962
+ return /* @__PURE__ */ J(s, {
963
+ title: n,
964
+ children: [
965
+ /* @__PURE__ */ q("ol", {
966
+ className: R(`chart-funnel chart-plot chart-plot--rows${i ? " chart-plot--pick" : ""}`, r),
967
+ role: i ? void 0 : "img",
968
+ "aria-label": !i && h ? v(h) : t,
969
+ ...p.plotProps,
970
+ children: m.map(({ step: e, width: t, drop: n }, r) => /* @__PURE__ */ q("li", {
971
+ "data-hit": p.pickable ? void 0 : r,
972
+ className: `chart-funnel-item${r === p.active ? " chart-funnel-item--active" : ""}`,
973
+ "aria-hidden": !p.pickable || void 0,
974
+ children: /* @__PURE__ */ J("span", {
975
+ ...p.pickable ? p.item(r, {
976
+ pressed: c === e.key,
977
+ disabled: !f(r)
978
+ }) : {},
979
+ "aria-label": p.pickable ? `${e.label}: ${u(e.value)}${n === null ? "" : `, ${y(n)}`}` : void 0,
980
+ "aria-description": p.pickable && n !== null ? d.funnelDrop : void 0,
981
+ className: `chart-funnel-row${g !== null && g !== e.key ? " chart-faded" : ""}`,
982
+ children: [
983
+ /* @__PURE__ */ q("span", {
984
+ className: "chart-funnel-label",
985
+ title: e.label,
986
+ children: e.label
987
+ }),
988
+ " ",
989
+ /* @__PURE__ */ J("span", {
990
+ className: "chart-funnel-track",
991
+ children: [/* @__PURE__ */ q("span", {
992
+ className: "chart-funnel-bar",
993
+ style: {
994
+ width: `${t * 100}%`,
995
+ background: I(e.slot),
996
+ color: te(e.slot)
997
+ },
998
+ children: t >= .18 ? u(e.value) : ""
999
+ }), t < .18 && /* @__PURE__ */ q("span", {
1000
+ className: "chart-funnel-outside",
1001
+ children: u(e.value)
1002
+ })]
1003
+ }),
1004
+ " ",
1005
+ /* @__PURE__ */ q("span", {
1006
+ className: "chart-funnel-drop",
1007
+ "data-change": n === null ? void 0 : n > 0 ? "drop" : n < 0 ? "rise" : "flat",
1008
+ children: n === null ? "" : y(n)
1009
+ })
1010
+ ]
1011
+ })
1012
+ }, e.key))
1013
+ }),
1014
+ /* @__PURE__ */ q(a, { text: h ? v(h) : "" }),
1015
+ p.tooltip(h && /* @__PURE__ */ q(Q, {
1016
+ rows: [{
1017
+ key: h.step.key,
1018
+ color: I(h.step.slot),
1019
+ label: h.step.label,
1020
+ value: u(h.step.value)
1021
+ }],
1022
+ note: [p.active > 0 ? `${d.funnelOfFirst}: ${o(h.ofFirst)}` : "", h.drop === null ? "" : `${d.funnelDrop}: ${y(h.drop)}`].filter(Boolean).join(" · ") || void 0
1023
+ }))
1024
+ ]
1025
+ });
1026
+ }
1027
+ // src/components/Charts/Gauge.tsx
1028
+ function Re({ value: e, total: t, ariaLabel: n, label: r, variant: i = "half", color: s = 1, size: c, compact: l = !1, ...u }) {
1029
+ let { nf: f, L: p } = b(u), m = A[i], h = d(e, t), { a0: _, a1: v, end: y } = g(i, h), [x, S] = Y(), C = (c ?? (i === "half" ? l ? 120 : 168 : l ? 88 : 128)) * S, w = Z({
1030
+ count: 1,
1031
+ pick: (e, t, n) => {
1032
+ let r = n.width / m.width;
1033
+ return he(e - m.cx * r, t - m.cy * r, (m.r + 6) * r, 0, [{
1034
+ a0: _,
1035
+ a1: v
1036
+ }]) === null ? null : 0;
1037
+ }
1038
+ }), T = p.ofTotal(f(e), f(t)), E = I(D(s, h));
1039
+ return /* @__PURE__ */ J("div", {
1040
+ ref: x,
1041
+ className: R(`chart-gauge chart-gauge--${i}`, l),
1042
+ role: "meter",
1043
+ "aria-label": n,
1044
+ "aria-valuemin": 0,
1045
+ "aria-valuemax": 100,
1046
+ "aria-valuenow": Math.round(h * 10) / 10,
1047
+ "aria-valuetext": `${T} (${o(h)})`,
1048
+ children: [
1049
+ /* @__PURE__ */ J("div", {
1050
+ className: "chart-gauge-dial chart-plot",
1051
+ style: { width: C },
1052
+ ...w.plotProps,
1053
+ children: [/* @__PURE__ */ J("svg", {
1054
+ viewBox: `0 0 ${m.width} ${m.height}`,
1055
+ width: C,
1056
+ height: C * m.height / m.width,
1057
+ "aria-hidden": !0,
1058
+ children: [/* @__PURE__ */ q("path", {
1059
+ d: F(m.cx, m.cy, m.r, _, v),
1060
+ className: "chart-gauge-track",
1061
+ fill: "none",
1062
+ strokeWidth: 12,
1063
+ strokeLinecap: "round"
1064
+ }), h > 0 && /* @__PURE__ */ q("path", {
1065
+ d: F(m.cx, m.cy, m.r, _, Math.max(y, _ + .01)),
1066
+ className: "chart-gauge-value",
1067
+ fill: "none",
1068
+ stroke: E,
1069
+ strokeWidth: 12,
1070
+ strokeLinecap: "round"
1071
+ })]
1072
+ }), /* @__PURE__ */ q("span", {
1073
+ className: "chart-gauge-share",
1074
+ "aria-hidden": !0,
1075
+ children: o(h)
1076
+ })]
1077
+ }),
1078
+ r !== void 0 && /* @__PURE__ */ q("span", {
1079
+ className: "chart-gauge-label",
1080
+ children: r
1081
+ }),
1082
+ /* @__PURE__ */ q("span", {
1083
+ className: "chart-gauge-of",
1084
+ "aria-hidden": !0,
1085
+ children: T
1086
+ }),
1087
+ /* @__PURE__ */ q(a, { text: w.active === null ? "" : `${T} (${o(h)})` }),
1088
+ w.tooltip(w.active !== null && /* @__PURE__ */ q(Q, {
1089
+ title: r ?? n,
1090
+ rows: [{
1091
+ key: "v",
1092
+ color: E,
1093
+ label: T,
1094
+ value: o(h)
1095
+ }]
1096
+ }))
1097
+ ]
1098
+ });
1099
+ }
1100
+ // src/components/Charts/LineChart.tsx
1101
+ var ze = 64;
1102
+ function Be({ data: e, series: t, ariaLabel: r, title: i, area: o = !1, height: c, compact: l = !1, onSelect: u, selected: d = null, ...f }) {
1103
+ let { nf: m, L: h } = b(f), [g, v] = $(), [y, x] = Y(), S = e.length, w = d === null ? -1 : e.findIndex((e) => H(e) === d), T = Z({
1104
+ count: S,
1105
+ pick: (e, t, n) => M(e, n.width, S),
1106
+ anchor: (e, t) => {
1107
+ let n = t.getBoundingClientRect();
1108
+ return {
1109
+ left: n.left + j(e, S, 100) / 100 * n.width - 1,
1110
+ top: n.top,
1111
+ width: 2,
1112
+ height: n.height
1113
+ };
1114
+ },
1115
+ keys: {
1116
+ ArrowUp: 0,
1117
+ ArrowDown: 0
1118
+ },
1119
+ start: w >= 0 ? w : null,
1120
+ onPick: u ? (t) => e[t].selectable !== !1 && u(e[t]) : void 0
1121
+ }), E = e.flatMap((e) => t.map((t) => e.values[t.key] ?? 0));
1122
+ if (!E.some((e) => e > 0)) return /* @__PURE__ */ q(s, {
1123
+ title: i,
1124
+ children: /* @__PURE__ */ q(_, {
1125
+ ariaLabel: r,
1126
+ text: h.empty,
1127
+ compact: l
1128
+ })
1129
+ });
1130
+ let D = (c ?? (l ? 96 : 220)) * x, { max: k, ticks: A } = O(E), N = t.map((t) => ({
1131
+ s: t,
1132
+ points: p(e.map((e) => e.values[t.key] ?? 0), 100, 100, k)
1133
+ })), P = T.active, F = (e) => `${e.fullLabel ?? e.label}: ${t.map((n) => t.length > 1 ? `${n.label} ${m(e.values[n.key] ?? 0)}` : m(e.values[n.key] ?? 0)).join(", ")}`, L = P === null ? null : e[P] ?? null, z = C(S, Math.max(2, Math.min(l ? 4 : 6, Math.floor((v || 400) / (ze * x))))), V = (e) => `${j(e, S, 100)}%`;
1134
+ return /* @__PURE__ */ q(s, {
1135
+ title: i,
1136
+ children: /* @__PURE__ */ J("div", {
1137
+ ref: g,
1138
+ className: R(`chart-line${o ? " chart-line--area" : ""}`, l),
1139
+ role: "group",
1140
+ "aria-label": r,
1141
+ children: [
1142
+ /* @__PURE__ */ J("div", {
1143
+ className: "chart-columns-plot",
1144
+ style: { height: D },
1145
+ children: [!l && /* @__PURE__ */ q("div", {
1146
+ className: "chart-axis-y",
1147
+ "aria-hidden": !0,
1148
+ children: [...A].reverse().map((e) => /* @__PURE__ */ q("span", { children: m(e) }, e))
1149
+ }), /* @__PURE__ */ J("div", {
1150
+ className: `chart-line-area chart-plot chart-plot--x${u ? " chart-plot--pick" : ""}`,
1151
+ role: u ? void 0 : "img",
1152
+ "aria-label": u ? void 0 : L ? F(L) : r,
1153
+ ...T.plotProps,
1154
+ children: [
1155
+ T.pickable && e.map((e, t) => /* @__PURE__ */ q("span", {
1156
+ ...T.item(t, {
1157
+ pressed: t === w,
1158
+ disabled: e.selectable === !1
1159
+ }),
1160
+ "aria-label": F(e),
1161
+ className: "chart-line-slot",
1162
+ style: { left: V(t) }
1163
+ }, H(e))),
1164
+ !l && A.slice(1).map((e) => /* @__PURE__ */ q("div", {
1165
+ className: "chart-gridline",
1166
+ style: { bottom: `${e / k * 100}%` },
1167
+ "aria-hidden": !0
1168
+ }, e)),
1169
+ /* @__PURE__ */ J("svg", {
1170
+ className: "chart-line-svg",
1171
+ viewBox: "0 0 100 100",
1172
+ preserveAspectRatio: "none",
1173
+ width: "100%",
1174
+ height: "100%",
1175
+ "aria-hidden": !0,
1176
+ children: [
1177
+ o && N.map(({ s: e, points: t }) => /* @__PURE__ */ q("path", {
1178
+ d: B(t, 100),
1179
+ fill: I(e.slot),
1180
+ className: "chart-line-fill"
1181
+ }, `a-${e.key}`)),
1182
+ N.map(({ s: e, points: t }) => /* @__PURE__ */ q("path", {
1183
+ d: n(t),
1184
+ fill: "none",
1185
+ stroke: I(e.slot),
1186
+ className: "chart-line-path",
1187
+ vectorEffect: "non-scaling-stroke"
1188
+ }, e.key)),
1189
+ w >= 0 && /* @__PURE__ */ q("line", {
1190
+ className: "chart-line-selected",
1191
+ x1: j(w, S, 100),
1192
+ x2: j(w, S, 100),
1193
+ y1: 0,
1194
+ y2: 100,
1195
+ vectorEffect: "non-scaling-stroke"
1196
+ }),
1197
+ P !== null && /* @__PURE__ */ q("line", {
1198
+ className: "chart-line-crosshair",
1199
+ x1: j(P, S, 100),
1200
+ x2: j(P, S, 100),
1201
+ y1: 0,
1202
+ y2: 100,
1203
+ vectorEffect: "non-scaling-stroke"
1204
+ })
1205
+ ]
1206
+ }),
1207
+ [P, w >= 0 ? w : null].map((e, t) => e === null || t === 1 && e === P ? null : N.map(({ s: n, points: r }) => /* @__PURE__ */ q("span", {
1208
+ className: "chart-line-dot",
1209
+ style: {
1210
+ left: V(e),
1211
+ top: `${r[e].y}%`,
1212
+ background: I(n.slot)
1213
+ },
1214
+ "aria-hidden": !0
1215
+ }, `${t}-${n.key}`)))
1216
+ ]
1217
+ })]
1218
+ }),
1219
+ /* @__PURE__ */ q("div", {
1220
+ ref: y,
1221
+ className: `chart-line-axis-x${l ? " chart-line-axis-x--compact" : ""}`,
1222
+ "aria-hidden": !0,
1223
+ children: z.map((t) => /* @__PURE__ */ q("span", {
1224
+ style: { left: V(t) },
1225
+ className: t === 0 ? "chart-line-axis-first" : t === S - 1 ? "chart-line-axis-last" : void 0,
1226
+ children: e[t].label
1227
+ }, t))
1228
+ }),
1229
+ /* @__PURE__ */ q(a, { text: L ? F(L) : "" }),
1230
+ T.tooltip(L && /* @__PURE__ */ q(Q, {
1231
+ title: L.fullLabel ?? L.label,
1232
+ rows: t.map((e) => ({
1233
+ key: e.key,
1234
+ color: I(e.slot),
1235
+ label: e.label,
1236
+ value: m(L.values[e.key] ?? 0)
1237
+ })),
1238
+ note: t.length > 1 ? `${h.total}: ${m(re(L, t))}` : void 0
1239
+ }))
1240
+ ]
1241
+ })
1242
+ });
1243
+ }
1244
+ // src/components/Charts/NumberTrend.tsx
1245
+ function Ve({ value: e, ariaLabel: t, title: r, points: s = [], current: c, previous: l, good: u = "up", slot: d = 1, compact: f = !1, ...p }) {
1246
+ let { nf: g, L: _ } = b(p), v = Z({
1247
+ count: s.length,
1248
+ pick: (e, t, n) => M(e, n.width, s.length),
1249
+ anchor: (e, t) => {
1250
+ let n = t.getBoundingClientRect();
1251
+ return {
1252
+ left: n.left + j(e, s.length, 100) / 100 * n.width - 1,
1253
+ top: n.top,
1254
+ width: 2,
1255
+ height: n.height
1256
+ };
1257
+ },
1258
+ keys: {
1259
+ ArrowUp: 0,
1260
+ ArrowDown: 0
1261
+ }
1262
+ }), y = c ?? s.reduce((e, t) => e + t.value, 0), x = l === void 0 ? null : m(y, l), S = x ? h(x.direction, u) : "neutral", C = x ? x.direction === "up" ? "▲" : x.direction === "down" ? "▼" : "=" : "", w = x ? x.percent === null ? _.deltaNew : o(Math.abs(x.percent)) : "", T = x ? `${x.direction === "up" ? _.deltaUp : x.direction === "down" ? _.deltaDown : _.deltaSame}${x.direction === "same" ? "" : ` ${w}`} ${_.vsPrevious}` : "", E = i(s.map((e) => e.value), 100, 100), D = v.active, O = D === null ? null : s[D] ?? null;
1263
+ return /* @__PURE__ */ J("div", {
1264
+ className: R("chart-number", f),
1265
+ role: "group",
1266
+ "aria-label": `${t}: ${g(e)}${T ? `, ${T}` : ""}`,
1267
+ children: [
1268
+ r != null && r !== "" && /* @__PURE__ */ q("div", {
1269
+ className: "chart-title",
1270
+ children: r
1271
+ }),
1272
+ /* @__PURE__ */ J("div", {
1273
+ className: "chart-number-line",
1274
+ "aria-hidden": !0,
1275
+ children: [/* @__PURE__ */ q("span", {
1276
+ className: "chart-number-value",
1277
+ children: g(e)
1278
+ }), x && /* @__PURE__ */ J("span", {
1279
+ className: "chart-number-delta",
1280
+ "data-tone": S,
1281
+ style: { color: I(S) },
1282
+ children: [
1283
+ C,
1284
+ " ",
1285
+ x.direction === "same" ? o(0) : w
1286
+ ]
1287
+ })]
1288
+ }),
1289
+ E.length > 1 && /* @__PURE__ */ J("div", {
1290
+ className: "chart-number-spark chart-plot chart-plot--x",
1291
+ role: "img",
1292
+ "aria-label": O ? `${O.label}: ${g(O.value)}` : t,
1293
+ ...v.plotProps,
1294
+ children: [/* @__PURE__ */ J("svg", {
1295
+ viewBox: "0 0 100 100",
1296
+ preserveAspectRatio: "none",
1297
+ width: "100%",
1298
+ height: "100%",
1299
+ "aria-hidden": !0,
1300
+ children: [
1301
+ /* @__PURE__ */ q("path", {
1302
+ d: B(E, 100),
1303
+ fill: I(d),
1304
+ className: "chart-line-fill"
1305
+ }),
1306
+ /* @__PURE__ */ q("path", {
1307
+ d: n(E),
1308
+ fill: "none",
1309
+ stroke: I(d),
1310
+ className: "chart-line-path",
1311
+ vectorEffect: "non-scaling-stroke"
1312
+ }),
1313
+ D !== null && /* @__PURE__ */ q("line", {
1314
+ className: "chart-line-crosshair",
1315
+ x1: j(D, s.length, 100),
1316
+ x2: j(D, s.length, 100),
1317
+ y1: 0,
1318
+ y2: 100,
1319
+ vectorEffect: "non-scaling-stroke"
1320
+ })
1321
+ ]
1322
+ }), D !== null && E[D] && /* @__PURE__ */ q("span", {
1323
+ className: "chart-line-dot",
1324
+ style: {
1325
+ left: `${E[D].x}%`,
1326
+ top: `${E[D].y}%`,
1327
+ background: I(d)
1328
+ },
1329
+ "aria-hidden": !0
1330
+ })]
1331
+ }),
1332
+ x && /* @__PURE__ */ q("div", {
1333
+ className: "chart-number-note",
1334
+ "aria-hidden": !0,
1335
+ children: _.vsPrevious
1336
+ }),
1337
+ /* @__PURE__ */ q(a, { text: O ? `${O.label}: ${g(O.value)}` : "" }),
1338
+ v.tooltip(O && /* @__PURE__ */ q(Q, {
1339
+ title: O.label,
1340
+ rows: [{
1341
+ key: "v",
1342
+ color: I(d),
1343
+ label: t,
1344
+ value: g(O.value)
1345
+ }]
1346
+ }))
1347
+ ]
1348
+ });
1349
+ }
1350
+ // src/components/Charts/Progress.tsx
1351
+ function He({ value: e, total: t, ariaLabel: n, label: r, color: i = 1, compact: s = !1, ...c }) {
1352
+ let { nf: l, L: u } = b(c), d = Z({
1353
+ count: 1,
1354
+ pick: () => 0
1355
+ }), f = t > 0 ? e / t * 100 : 0, p = I(D(i, f)), m = u.ofTotal(l(e), l(t));
1356
+ return /* @__PURE__ */ J("div", {
1357
+ className: R("chart-progress chart-plot", s),
1358
+ role: "progressbar",
1359
+ "aria-label": n,
1360
+ "aria-valuemin": 0,
1361
+ "aria-valuemax": 100,
1362
+ "aria-valuenow": Math.round(f * 10) / 10,
1363
+ "aria-valuetext": `${l(e)} / ${l(t)} (${o(f)})`,
1364
+ ...d.plotProps,
1365
+ children: [
1366
+ r !== void 0 && /* @__PURE__ */ J("div", {
1367
+ className: "chart-progress-head",
1368
+ children: [/* @__PURE__ */ q("span", {
1369
+ className: "chart-progress-label",
1370
+ children: r
1371
+ }), /* @__PURE__ */ q("span", {
1372
+ className: "chart-progress-share",
1373
+ children: o(f)
1374
+ })]
1375
+ }),
1376
+ /* @__PURE__ */ q("div", {
1377
+ className: "chart-progress-track",
1378
+ children: /* @__PURE__ */ q("div", {
1379
+ className: "chart-progress-fill",
1380
+ style: {
1381
+ width: `${Math.min(100, f)}%`,
1382
+ background: p
1383
+ }
1384
+ })
1385
+ }),
1386
+ /* @__PURE__ */ q(a, { text: d.active === null ? "" : `${m} (${o(f)})` }),
1387
+ d.tooltip(d.active !== null && /* @__PURE__ */ q(Q, {
1388
+ title: r ?? n,
1389
+ rows: [{
1390
+ key: "v",
1391
+ color: p,
1392
+ label: m,
1393
+ value: o(f)
1394
+ }]
1395
+ }))
1396
+ ]
1397
+ });
1398
+ }
1399
+ // src/components/Charts/StackedBar.tsx
1400
+ function Ue({ slices: e, ariaLabel: t, title: n, compact: r = !1, onLegendCut: i, onSelect: c, selected: l = null, ...u }) {
1401
+ let { nf: f, L: p } = b(u), [m, h] = K(null), [g, v, y] = Pe(e.length, r);
1402
+ ae(() => i?.(e.length - y), [
1403
+ i,
1404
+ e.length,
1405
+ y
1406
+ ]);
1407
+ let x = e.filter((e) => e.value > 0), S = (e) => !!c && e.value > 0 && e.selectable !== !1, C = Z({
1408
+ count: x.length,
1409
+ pick: (e, t, n, r) => de(e, xe(r).map((e) => e ? {
1410
+ start: e.left,
1411
+ end: e.left + e.width
1412
+ } : {
1413
+ start: Infinity,
1414
+ end: Infinity
1415
+ })),
1416
+ keys: {
1417
+ ArrowUp: 0,
1418
+ ArrowDown: 0
1419
+ },
1420
+ start: l === null ? null : x.findIndex((e) => e.key === l),
1421
+ onPick: c ? (e) => S(x[e]) && c(x[e]) : void 0
1422
+ }), w = e.reduce((e, t) => e + t.value, 0);
1423
+ if (w === 0) return /* @__PURE__ */ q(s, {
1424
+ title: n,
1425
+ children: /* @__PURE__ */ q(_, {
1426
+ ariaLabel: t,
1427
+ text: p.empty,
1428
+ compact: r
1429
+ })
1430
+ });
1431
+ let T = (e) => d(e, w), E = (e) => `${e.label} ${f(e.value)} (${o(T(e.value))})`, D = C.active === null ? null : x[C.active] ?? null, O = D?.key ?? m ?? l, k = (e) => O !== null && O !== e ? " chart-faded" : "";
1432
+ return /* @__PURE__ */ J("figure", {
1433
+ className: R("chart-stacked", r),
1434
+ "aria-label": t,
1435
+ children: [
1436
+ n && /* @__PURE__ */ q("figcaption", {
1437
+ className: "chart-title",
1438
+ children: n
1439
+ }),
1440
+ /* @__PURE__ */ q("div", {
1441
+ className: `chart-stacked-bar chart-plot chart-plot--x${c ? " chart-plot--pick" : ""}`,
1442
+ role: c ? void 0 : "img",
1443
+ "aria-label": c ? void 0 : D ? E(D) : `${t}: ${e.map(E).join(", ")}`,
1444
+ ...C.plotProps,
1445
+ children: x.map((e, t) => /* @__PURE__ */ q("span", {
1446
+ ...C.item(t, {
1447
+ pressed: l === e.key,
1448
+ disabled: !S(e)
1449
+ }),
1450
+ "aria-label": C.pickable ? E(e) : void 0,
1451
+ "aria-hidden": !C.pickable || void 0,
1452
+ className: `chart-stacked-segment${k(e.key)}`,
1453
+ style: {
1454
+ flexGrow: e.value,
1455
+ background: I(e.slot)
1456
+ }
1457
+ }, e.key))
1458
+ }),
1459
+ /* @__PURE__ */ J("ul", {
1460
+ ref: g,
1461
+ className: "chart-donut-legend chart-stacked-legend",
1462
+ "aria-label": p.legend,
1463
+ children: [e.slice(0, v).map((e) => /* @__PURE__ */ J("li", {
1464
+ className: `chart-donut-legend-item${S(e) ? " chart-donut-legend-item--hit" : ""}${l === e.key ? " chart-donut-legend-item--on" : ""}${k(e.key)}`,
1465
+ onMouseEnter: () => h(e.key),
1466
+ onMouseLeave: () => h(null),
1467
+ onClick: S(e) ? () => c(e) : void 0,
1468
+ children: [
1469
+ /* @__PURE__ */ q("span", {
1470
+ className: "chart-swatch",
1471
+ style: { background: I(e.slot) },
1472
+ "aria-hidden": !0
1473
+ }),
1474
+ /* @__PURE__ */ q("span", {
1475
+ className: "chart-donut-legend-label",
1476
+ children: e.label
1477
+ }),
1478
+ /* @__PURE__ */ J("span", {
1479
+ className: "chart-donut-legend-value",
1480
+ children: [
1481
+ f(e.value),
1482
+ " · ",
1483
+ o(T(e.value))
1484
+ ]
1485
+ })
1486
+ ]
1487
+ }, e.key)), v < e.length && /* @__PURE__ */ q("li", {
1488
+ className: "chart-donut-legend-more",
1489
+ "data-legend-more": "",
1490
+ children: p.moreValues(f(e.length - v))
1491
+ })]
1492
+ }),
1493
+ /* @__PURE__ */ q(a, { text: D ? E(D) : "" }),
1494
+ C.tooltip(D && /* @__PURE__ */ q(Q, {
1495
+ rows: [{
1496
+ key: D.key,
1497
+ color: I(D.slot),
1498
+ label: D.label,
1499
+ value: f(D.value)
1500
+ }],
1501
+ note: p.shareOf(o(T(D.value)), f(w))
1502
+ }))
1503
+ ]
1504
+ });
1505
+ }
1506
+ // src/components/Charts/Treemap.tsx
1507
+ var We = 400;
1508
+ function Ge({ nodes: e, ariaLabel: t, title: n, height: r, compact: i = !1, onSelect: l, selected: u = null, ...f }) {
1509
+ let { nf: p, L: m } = b(f), [h, g] = $(), v = g || We, [y, x] = Y(), S = (r ?? (i ? 120 : 220)) * x, C = e.reduce((e, t) => e + Math.max(0, t.value), 0), w = C > 0 ? c(e, v, S, x) : [], T = w.filter((e) => !e.node.children?.some((e) => e.value > 0)), E = (e) => e.parent ?? e.node, D = (e) => !!l && E(e).selectable !== !1, O = Z({
1510
+ count: T.length,
1511
+ pick: (e, t, n) => fe(e / n.width * v, t / n.height * S, T.map((e) => ({
1512
+ left: e.rect.x,
1513
+ top: e.rect.y,
1514
+ width: e.rect.w,
1515
+ height: e.rect.h
1516
+ }))),
1517
+ start: u === null ? null : T.findIndex((e) => E(e).key === u),
1518
+ onPick: l ? (e) => D(T[e]) && l(E(T[e])) : void 0
1519
+ }), A = O.plotProps.ref, j = U((e) => {
1520
+ h(e), A(e);
1521
+ }, [h, A]);
1522
+ if (C <= 0) return /* @__PURE__ */ q(s, {
1523
+ title: n,
1524
+ children: /* @__PURE__ */ q(_, {
1525
+ ariaLabel: t,
1526
+ text: m.empty,
1527
+ compact: i
1528
+ })
1529
+ });
1530
+ let M = (e) => `${e.parent ? `${e.parent.label} › ` : ""}${e.node.label} ${p(e.node.value)} (${o(d(e.node.value, C))})`, N = (e) => e.parent ? `${e.parent.key}\u0000${e.node.key}` : e.node.key, P = O.active === null ? null : T[O.active] ?? null, F = (e) => ({
1531
+ left: `${e.rect.x / v * 100}%`,
1532
+ top: `${e.rect.y / S * 100}%`,
1533
+ width: `${e.rect.w / v * 100}%`,
1534
+ height: `${e.rect.h / S * 100}%`
1535
+ });
1536
+ return /* @__PURE__ */ q(s, {
1537
+ title: n,
1538
+ children: /* @__PURE__ */ J("div", {
1539
+ ref: y,
1540
+ className: R("chart-treemap", i),
1541
+ role: "group",
1542
+ "aria-label": t,
1543
+ children: [
1544
+ /* @__PURE__ */ q("div", {
1545
+ className: `chart-treemap-box chart-plot${l ? " chart-plot--pick" : ""}`,
1546
+ style: { height: S },
1547
+ role: l ? void 0 : "img",
1548
+ "aria-label": l ? void 0 : P ? M(P) : `${t}: ${T.map(M).join(", ")}`,
1549
+ ...O.plotProps,
1550
+ ref: j,
1551
+ children: w.map((e) => {
1552
+ let t = E(e), n = !!e.node.children?.some((e) => e.value > 0), r = e.parent ? e.parent.children.filter((e) => e.value > 0).indexOf(e.node) : 0, i = u !== null && u !== t.key || P !== null && E(P).key !== t.key, a = T.indexOf(e);
1553
+ return /* @__PURE__ */ q("div", {
1554
+ ...a >= 0 ? O.item(a, {
1555
+ pressed: u === t.key,
1556
+ disabled: !D(e)
1557
+ }) : {},
1558
+ "aria-label": O.pickable && a >= 0 ? M(e) : void 0,
1559
+ className: `chart-treemap-tile${n ? " chart-treemap-tile--group" : ""}${e.parent ? " chart-treemap-tile--child" : ""}${i ? " chart-faded" : ""}${u === t.key ? " chart-treemap-tile--on" : ""}${P === e ? " chart-treemap-tile--active" : ""}`,
1560
+ style: {
1561
+ ...F(e),
1562
+ background: I(t.slot),
1563
+ color: te(t.slot),
1564
+ opacity: e.parent ? k(r) : void 0
1565
+ },
1566
+ "aria-hidden": O.pickable && a >= 0 ? void 0 : !0,
1567
+ children: e.label && /* @__PURE__ */ J("span", {
1568
+ className: "chart-treemap-label",
1569
+ children: [
1570
+ /* @__PURE__ */ q("span", {
1571
+ className: "chart-treemap-name",
1572
+ children: e.node.label
1573
+ }),
1574
+ " ",
1575
+ !n && /* @__PURE__ */ q("span", {
1576
+ className: "chart-treemap-count",
1577
+ children: p(e.node.value)
1578
+ })
1579
+ ]
1580
+ })
1581
+ }, N(e));
1582
+ })
1583
+ }),
1584
+ /* @__PURE__ */ q(a, { text: P ? M(P) : "" }),
1585
+ O.tooltip(P && /* @__PURE__ */ q(Q, {
1586
+ title: P.parent ? `${P.parent.label} › ${P.node.label}` : P.node.label,
1587
+ rows: [{
1588
+ key: "n",
1589
+ color: I(E(P).slot),
1590
+ label: t,
1591
+ value: p(P.node.value)
1592
+ }],
1593
+ note: m.shareOf(o(d(P.node.value, C)), p(C))
1594
+ }))
1595
+ ]
1596
+ })
1597
+ });
1598
+ }
1599
+ // src/components/Charts/ChartView.tsx
1600
+ function Ke({ chart: e, ariaLabel: t, compact: n = !1, height: r, size: i, onSelect: a, selected: o = null, linkAs: s, onLegendCut: c, legend: l = !0, ...u }) {
1601
+ let d = {
1602
+ ariaLabel: t,
1603
+ compact: n,
1604
+ ...u
1605
+ }, f = a ? (e) => a(e.key ?? e.label) : void 0;
1606
+ switch (e.kind) {
1607
+ case "columns": return /* @__PURE__ */ q(Ne, {
1608
+ data: e.data,
1609
+ series: e.series,
1610
+ mode: e.mode,
1611
+ legend: l && e.series.length > 1,
1612
+ height: r,
1613
+ onSelect: f,
1614
+ selected: o,
1615
+ ...d
1616
+ });
1617
+ case "line": return /* @__PURE__ */ q(Be, {
1618
+ data: e.data,
1619
+ series: e.series,
1620
+ area: e.area,
1621
+ height: r,
1622
+ onSelect: f,
1623
+ selected: o,
1624
+ ...d
1625
+ });
1626
+ case "bars": return /* @__PURE__ */ q(Ce, {
1627
+ data: e.data,
1628
+ series: e.series,
1629
+ linkAs: s,
1630
+ onSelect: f,
1631
+ selected: o,
1632
+ ...d
1633
+ });
1634
+ case "stacked": return /* @__PURE__ */ q(Ue, {
1635
+ slices: e.slices,
1636
+ onLegendCut: c,
1637
+ onSelect: f,
1638
+ selected: o,
1639
+ ...d
1640
+ });
1641
+ case "donut":
1642
+ case "pie": return /* @__PURE__ */ q(Ie, {
1643
+ variant: e.kind,
1644
+ slices: e.slices,
1645
+ size: i,
1646
+ legend: l,
1647
+ onLegendCut: c,
1648
+ onSelect: f,
1649
+ selected: o,
1650
+ ...d
1651
+ });
1652
+ case "treemap": return /* @__PURE__ */ q(Ge, {
1653
+ nodes: e.nodes,
1654
+ height: r,
1655
+ onSelect: f,
1656
+ selected: o,
1657
+ ...d
1658
+ });
1659
+ case "calendar": return /* @__PURE__ */ q(De, {
1660
+ days: e.days,
1661
+ onSelect: a ? (e) => a(e.day) : void 0,
1662
+ selected: o,
1663
+ ...d
1664
+ });
1665
+ case "funnel": return /* @__PURE__ */ q(Le, {
1666
+ steps: e.steps,
1667
+ onSelect: f,
1668
+ selected: o,
1669
+ ...d
1670
+ });
1671
+ case "gauge": {
1672
+ let t = e.rows[0];
1673
+ return /* @__PURE__ */ q(Re, {
1674
+ value: t.value,
1675
+ total: t.total,
1676
+ color: t.color,
1677
+ variant: e.variant,
1678
+ label: n ? void 0 : t.label,
1679
+ ...d
1680
+ });
1681
+ }
1682
+ case "progress": {
1683
+ let t = e.rows[0];
1684
+ return /* @__PURE__ */ q(He, {
1685
+ value: t.value,
1686
+ total: t.total,
1687
+ color: t.color,
1688
+ label: n ? void 0 : t.label,
1689
+ ...d
1690
+ });
1691
+ }
1692
+ case "number": return /* @__PURE__ */ q(Ve, {
1693
+ value: e.value,
1694
+ points: e.points,
1695
+ current: e.current,
1696
+ previous: e.previous,
1697
+ good: e.good,
1698
+ slot: e.slot,
1699
+ ...d
1700
+ });
1701
+ }
1702
+ }
1703
+ export { pe as C, he as D, fe as E, de as O, ge as S, _e as T, Q as _, Ve as a, Z as b, Le as c, Oe as d, De as f, Ce as g, $ as h, He as i, Y as k, Ie as l, we as m, Ge as n, Be as o, Ee as p, Ue as r, Re as s, Ke as t, Ne as u, be as v, ue as w, me as x, xe as y };