@flikk/ui 1.0.0-beta.31 → 1.0.0-beta.32

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 (428) hide show
  1. package/CHANGELOG.md +295 -22
  2. package/dist/components/ai/AgentRequest/AgentRequest.animations.d.ts +25 -0
  3. package/dist/components/ai/AgentRequest/AgentRequest.animations.js +81 -0
  4. package/dist/components/ai/AgentRequest/AgentRequest.d.ts +3 -0
  5. package/dist/components/ai/AgentRequest/AgentRequest.js +435 -0
  6. package/dist/components/ai/AgentRequest/AgentRequest.theme.d.ts +2 -0
  7. package/dist/components/ai/AgentRequest/AgentRequest.theme.js +106 -0
  8. package/dist/components/ai/AgentRequest/AgentRequest.types.d.ts +241 -0
  9. package/dist/components/ai/AgentRequest/index.d.ts +3 -0
  10. package/dist/components/ai/CodeBlock/CodeBlock.theme.js +1 -1
  11. package/dist/components/ai/PromptInput/PromptInput.js +2 -2
  12. package/dist/components/ai/PromptInput/PromptInput.theme.js +2 -2
  13. package/dist/components/ai/PromptSuggestion/PromptSuggestion.theme.js +2 -2
  14. package/dist/components/ai/Reasoning/Reasoning.js +27 -3
  15. package/dist/components/ai/Reasoning/Reasoning.theme.d.ts +6 -0
  16. package/dist/components/ai/Reasoning/Reasoning.theme.js +36 -0
  17. package/dist/components/ai/Reasoning/Reasoning.types.d.ts +58 -5
  18. package/dist/components/ai/Reasoning/ReasoningTrace.d.ts +11 -0
  19. package/dist/components/ai/Reasoning/ReasoningTrace.js +84 -0
  20. package/dist/components/ai/Reasoning/index.d.ts +2 -1
  21. package/dist/components/ai/StreamingResponse/AnimatedText.d.ts +7 -0
  22. package/dist/components/ai/StreamingResponse/AnimatedText.js +8 -7
  23. package/dist/components/ai/StreamingResponse/MarkdownRenderer.d.ts +5 -0
  24. package/dist/components/ai/StreamingResponse/MarkdownRenderer.js +4 -4
  25. package/dist/components/ai/StreamingResponse/StreamingCursor.d.ts +2 -2
  26. package/dist/components/ai/StreamingResponse/StreamingCursor.js +10 -7
  27. package/dist/components/ai/StreamingResponse/StreamingResponse.animations.d.ts +10 -0
  28. package/dist/components/ai/StreamingResponse/StreamingResponse.animations.js +59 -33
  29. package/dist/components/ai/StreamingResponse/StreamingResponse.js +13 -7
  30. package/dist/components/ai/StreamingResponse/StreamingResponse.types.d.ts +33 -2
  31. package/dist/components/ai/StreamingResponse/StreamingSurface.d.ts +13 -0
  32. package/dist/components/ai/StreamingResponse/StreamingSurface.js +38 -0
  33. package/dist/components/ai/StreamingResponse/WordAnimationContext.d.ts +5 -0
  34. package/dist/components/ai/StreamingResponse/WordAnimationContext.js +5 -4
  35. package/dist/components/ai/StreamingResponse/index.d.ts +4 -2
  36. package/dist/components/ai/TokenCounter/TokenCounter.theme.js +1 -1
  37. package/dist/components/ai/index.d.ts +3 -2
  38. package/dist/components/ai/index.js +4 -0
  39. package/dist/components/canvas/BaseNode.js +1 -1
  40. package/dist/components/canvas/CanvasToolbar.js +0 -1
  41. package/dist/components/canvas/Edge.js +2 -2
  42. package/dist/components/canvas/NodeControls.js +0 -1
  43. package/dist/components/canvas/NodeRenderer.js +2 -2
  44. package/dist/components/charts/ActivityRings/ActivityRings.js +2 -2
  45. package/dist/components/charts/ActivityRings/ActivityRings.theme.js +1 -1
  46. package/dist/components/charts/AreaChart/AreaChart.js +3 -3
  47. package/dist/components/charts/AreaChart/AreaChart.theme.js +3 -3
  48. package/dist/components/charts/BarChart/BarChart.js +4 -4
  49. package/dist/components/charts/ComboChart/BarRenderer.js +2 -2
  50. package/dist/components/charts/ComboChart/BarRenderer.types.d.ts +1 -1
  51. package/dist/components/charts/ComboChart/ComboChartCanvas.js +1 -1
  52. package/dist/components/charts/ComboChart/LineRenderer.js +1 -1
  53. package/dist/components/charts/ComboChart/LineRenderer.types.d.ts +1 -1
  54. package/dist/components/charts/DonutChart/DonutChart.theme.js +4 -4
  55. package/dist/components/charts/DonutChart/MultiSegmentDonutChart.theme.js +1 -1
  56. package/dist/components/charts/Heatmap/Heatmap.js +49 -42
  57. package/dist/components/charts/Heatmap/Heatmap.theme.d.ts +6 -2
  58. package/dist/components/charts/Heatmap/Heatmap.theme.js +20 -8
  59. package/dist/components/charts/Heatmap/Heatmap.types.d.ts +49 -82
  60. package/dist/components/charts/Heatmap/HeatmapCell.js +30 -81
  61. package/dist/components/charts/Heatmap/HeatmapLegend.d.ts +7 -6
  62. package/dist/components/charts/Heatmap/HeatmapLegend.js +6 -6
  63. package/dist/components/charts/Heatmap/index.d.ts +1 -1
  64. package/dist/components/charts/Heatmap/utils/heatmapUtils.d.ts +7 -12
  65. package/dist/components/charts/Heatmap/utils/heatmapUtils.js +16 -61
  66. package/dist/components/charts/Heatmap/utils/heatmapUtils.test.d.ts +1 -0
  67. package/dist/components/charts/HorizontalBarChart/HorizontalBarChart.js +1 -1
  68. package/dist/components/charts/LineChart/LineChart.js +2 -2
  69. package/dist/components/charts/LollipopChart/LollipopChart.js +1 -1
  70. package/dist/components/charts/RadarChart/RadarChart.js +1 -1
  71. package/dist/components/charts/StackedBarChart/StackedBarChart.js +3 -3
  72. package/dist/components/charts/hooks/useChartAccessibility.js +9 -6
  73. package/dist/components/charts/index.d.ts +4 -8
  74. package/dist/components/charts/index.js +2 -4
  75. package/dist/components/charts/shared/ChartText/ChartText.theme.js +1 -1
  76. package/dist/components/charts/shared/index.d.ts +1 -1
  77. package/dist/components/charts/theme/chart.theme.js +3 -3
  78. package/dist/components/charts/utils/animation-utils.d.ts +12 -7
  79. package/dist/components/charts/utils/animation-utils.js +19 -19
  80. package/dist/components/core/Accordion/Accordion.theme.js +1 -1
  81. package/dist/components/core/Alert/Alert.animations.d.ts +11 -4
  82. package/dist/components/core/Alert/Alert.animations.js +11 -4
  83. package/dist/components/core/Alert/Alert.js +16 -2
  84. package/dist/components/core/Alert/Alert.theme.js +1 -1
  85. package/dist/components/core/Alert/Alert.types.d.ts +4 -2
  86. package/dist/components/core/AlertDialog/AlertDialog.js +2 -2
  87. package/dist/components/core/Avatar/Avatar.theme.js +1 -1
  88. package/dist/components/core/Badge/Badge.animations.d.ts +0 -5
  89. package/dist/components/core/Badge/Badge.animations.js +5 -84
  90. package/dist/components/core/Badge/Badge.d.ts +7 -4
  91. package/dist/components/core/Badge/Badge.js +27 -64
  92. package/dist/components/core/Badge/Badge.theme.js +8 -12
  93. package/dist/components/core/Badge/Badge.types.d.ts +18 -34
  94. package/dist/components/core/Breadcrumbs/Breadcrumbs.theme.js +4 -4
  95. package/dist/components/core/Button/Button.js +7 -43
  96. package/dist/components/core/Button/Button.theme.js +2 -2
  97. package/dist/components/core/Button/Button.types.d.ts +8 -12
  98. package/dist/components/core/Button/index.d.ts +0 -2
  99. package/dist/components/core/Calendar/Calendar.theme.js +1 -1
  100. package/dist/components/core/Calendar/CalendarMini/CalendarMini.theme.js +2 -2
  101. package/dist/components/core/Card/Card.js +7 -2
  102. package/dist/components/core/Card/Card.theme.js +29 -1
  103. package/dist/components/core/Card/Card.types.d.ts +20 -0
  104. package/dist/components/core/Card/CardBody.js +9 -1
  105. package/dist/components/core/Card/CardContext.d.ts +13 -0
  106. package/dist/components/core/Card/CardContext.js +14 -0
  107. package/dist/components/core/Card/CardHeader.js +4 -1
  108. package/dist/components/core/ContextMenu/ContextMenu.theme.js +4 -3
  109. package/dist/components/core/ContextMenu/ContextMenu.types.d.ts +8 -1
  110. package/dist/components/core/ContextMenu/ContextMenuSub.d.ts +11 -1
  111. package/dist/components/core/ContextMenu/ContextMenuSub.js +35 -22
  112. package/dist/components/core/ContextMenu/ContextMenuSubBody.js +14 -3
  113. package/dist/components/core/ContextMenu/ContextMenuSubTrigger.js +21 -8
  114. package/dist/components/core/DragDrop/DragDrop.theme.js +2 -2
  115. package/dist/components/core/Drawer/Drawer.theme.js +1 -1
  116. package/dist/components/core/Drawer/DrawerHeader.js +0 -1
  117. package/dist/components/core/Dropdown/DropdownMenu.js +22 -7
  118. package/dist/components/core/Link/Link.js +1 -1
  119. package/dist/components/core/Masonry/Masonry.theme.js +1 -1
  120. package/dist/components/core/MenuItem/MenuItem.js +2 -1
  121. package/dist/components/core/MenuItem/MenuItem.theme.js +13 -1
  122. package/dist/components/core/Message/Message.js +2 -0
  123. package/dist/components/core/Message/Message.theme.js +3 -3
  124. package/dist/components/core/Modal/Modal.animations.d.ts +1 -1
  125. package/dist/components/core/Modal/Modal.animations.js +50 -11
  126. package/dist/components/core/Modal/Modal.js +5 -1
  127. package/dist/components/core/Modal/Modal.theme.js +1 -1
  128. package/dist/components/core/Modal/ModalHeader.js +0 -1
  129. package/dist/components/core/ModalStack/ModalStackModal.js +3 -1
  130. package/dist/components/core/NavItem/NavItem.js +3 -2
  131. package/dist/components/core/NavItem/NavItem.theme.js +1 -1
  132. package/dist/components/core/OfflineIndicator/OfflineIndicator.theme.js +4 -2
  133. package/dist/components/core/PageHeading/PageHeading.theme.js +1 -1
  134. package/dist/components/core/Pagination/Pagination.theme.js +2 -2
  135. package/dist/components/core/Pill/Pill.js +2 -1
  136. package/dist/components/core/Pill/Pill.theme.js +4 -2
  137. package/dist/components/core/Popover/PopoverBody.js +16 -5
  138. package/dist/components/core/Progress/Progress.d.ts +0 -25
  139. package/dist/components/core/Progress/Progress.js +79 -11
  140. package/dist/components/core/Progress/Progress.theme.js +17 -0
  141. package/dist/components/core/Progress/Progress.types.d.ts +47 -1
  142. package/dist/components/core/Rating/Rating.theme.js +1 -1
  143. package/dist/components/core/Rating/Rating.types.d.ts +3 -2
  144. package/dist/components/core/ScrollArea/ScrollArea.js +1 -1
  145. package/dist/components/core/ScrollArea/ScrollArea.theme.js +1 -1
  146. package/dist/components/core/Segmented/Segmented.theme.js +3 -3
  147. package/dist/components/core/Segmented/SegmentedContext.js +1 -0
  148. package/dist/components/core/Sidebar/Sidebar.js +5 -2
  149. package/dist/components/core/Sidebar/Sidebar.theme.js +2 -2
  150. package/dist/components/core/Sidebar/SidebarContent.js +1 -1
  151. package/dist/components/core/Sidebar/SidebarHeader.js +1 -1
  152. package/dist/components/core/Sidebar/SidebarSearch.js +2 -2
  153. package/dist/components/core/Sidebar/SidebarToggle.js +1 -1
  154. package/dist/components/core/Sidebar/SidebarUserProfile.js +1 -1
  155. package/dist/components/core/Sortable/Sortable.theme.js +1 -1
  156. package/dist/components/core/Tabs/Tabs.theme.js +1 -1
  157. package/dist/components/core/Tag/Tag.theme.js +1 -1
  158. package/dist/components/core/Toast/ToastProvider.js +1 -1
  159. package/dist/components/core/Tree/Tree.theme.js +1 -1
  160. package/dist/components/core/index.d.ts +0 -2
  161. package/dist/components/core/index.js +0 -4
  162. package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.d.ts +4 -0
  163. package/dist/components/core/shared/ChartTooltip/ChartTooltip.animations.js +20 -0
  164. package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.js +1 -1
  165. package/dist/components/core/shared/Ripple.d.ts +16 -0
  166. package/dist/components/core/shared/Ripple.js +141 -0
  167. package/dist/components/data-display/GanttChart/GanttChart.theme.js +6 -6
  168. package/dist/components/data-display/GanttChart/GanttTaskBar.js +1 -1
  169. package/dist/components/data-display/GanttChart/GanttTimelineHeader.js +1 -1
  170. package/dist/components/data-display/GanttChart/GanttToolbar.js +0 -1
  171. package/dist/components/data-display/KPI/KPI.js +11 -20
  172. package/dist/components/data-display/KPI/KPI.theme.js +8 -4
  173. package/dist/components/data-display/Metric/Metric.theme.js +4 -4
  174. package/dist/components/data-display/Table/Table.theme.js +2 -2
  175. package/dist/components/data-display/Table/TableColumnManager.js +1 -2
  176. package/dist/components/data-display/Table/TableContext.js +1 -0
  177. package/dist/components/data-display/Table/TableFilter.js +9 -2
  178. package/dist/components/data-display/Table/TableSelectionHeader.js +1 -1
  179. package/dist/components/data-display/Timeline/Timeline.theme.js +1 -1
  180. package/dist/components/effects/CustomCursor/CustomCursor.d.ts +1 -1
  181. package/dist/components/effects/CustomCursor/CustomCursor.js +1 -1
  182. package/dist/components/effects/CustomCursor/CustomCursor.theme.js +4 -4
  183. package/dist/components/effects/Neumorphic/InsetCircleButton.js +1 -1
  184. package/dist/components/effects/Overlay/Overlay.js +7 -3
  185. package/dist/components/effects/index.d.ts +0 -32
  186. package/dist/components/effects/index.js +0 -16
  187. package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.d.ts +0 -2
  188. package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.js +1 -93
  189. package/dist/components/effects/shared/ShaderCanvas/ShaderCanvas.types.d.ts +0 -10
  190. package/dist/components/effects/shared/ShaderCanvas/index.d.ts +1 -1
  191. package/dist/components/effects/shared/index.d.ts +1 -3
  192. package/dist/components/effects/shared/shaderNoise.glsl.d.ts +1 -1
  193. package/dist/components/effects/shared/shaderNoise.glsl.js +2 -11
  194. package/dist/components/forms/Checkbox/Checkbox.theme.js +1 -1
  195. package/dist/components/forms/ColorPicker/ColorPickerHeader.js +1 -1
  196. package/dist/components/forms/ColorPicker/ColorPickerImage.js +1 -1
  197. package/dist/components/forms/Combobox/Combobox.js +2 -0
  198. package/dist/components/forms/DateRangePicker/DateRangePicker.theme.js +1 -1
  199. package/dist/components/forms/DateRangePicker/DateRangePickerContext.js +1 -0
  200. package/dist/components/forms/FileUpload/FileUpload.theme.js +2 -2
  201. package/dist/components/forms/FileUpload/FileUploadProgress.theme.js +1 -1
  202. package/dist/components/forms/InputAddress/InputAddress.types.d.ts +2 -2
  203. package/dist/components/forms/Radio/Radio.theme.js +1 -1
  204. package/dist/components/forms/RichTextEditor/RichTextEditor.d.ts +12 -16
  205. package/dist/components/forms/RichTextEditor/RichTextEditor.js +165 -1680
  206. package/dist/components/forms/RichTextEditor/RichTextEditor.theme.d.ts +12 -56
  207. package/dist/components/forms/RichTextEditor/RichTextEditor.theme.js +60 -118
  208. package/dist/components/forms/RichTextEditor/RichTextEditor.types.d.ts +62 -126
  209. package/dist/components/forms/RichTextEditor/RichTextLinkField.d.ts +18 -0
  210. package/dist/components/forms/RichTextEditor/RichTextLinkField.js +46 -0
  211. package/dist/components/forms/RichTextEditor/RichTextToolbar.d.ts +15 -0
  212. package/dist/components/forms/RichTextEditor/RichTextToolbar.js +93 -0
  213. package/dist/components/forms/RichTextEditor/editorCommands.d.ts +50 -0
  214. package/dist/components/forms/RichTextEditor/editorCommands.js +58 -0
  215. package/dist/components/forms/RichTextEditor/editorState.d.ts +19 -0
  216. package/dist/components/forms/RichTextEditor/editorState.js +103 -0
  217. package/dist/components/forms/RichTextEditor/index.d.ts +5 -3
  218. package/dist/components/forms/RichTextEditor/sanitizeHtml.d.ts +38 -0
  219. package/dist/components/forms/RichTextEditor/sanitizeHtml.js +179 -0
  220. package/dist/components/forms/RichTextEditor/sanitizeHtml.test.d.ts +1 -0
  221. package/dist/components/forms/Select/Select.js +4 -4
  222. package/dist/components/forms/Select/Select.types.d.ts +70 -7
  223. package/dist/components/forms/Select/useSelectState.d.ts +9 -3
  224. package/dist/components/forms/Select/useSelectState.js +4 -1
  225. package/dist/components/forms/SelectableCard/SelectableCard.js +2 -1
  226. package/dist/components/forms/SelectableCard/SelectableCard.theme.js +1 -1
  227. package/dist/components/forms/Switch/Switch.theme.js +2 -2
  228. package/dist/components/forms/TimePicker/TimePicker.theme.js +1 -1
  229. package/dist/components/forms/TimePicker/TimePickerTrigger.js +1 -1
  230. package/dist/components/forms/forms.theme.js +19 -5
  231. package/dist/components/forms/index.js +1 -0
  232. package/dist/components/generative/FormShell.d.ts +22 -0
  233. package/dist/components/generative/FormShell.js +102 -0
  234. package/dist/components/generative/GenerativeView.d.ts +52 -1
  235. package/dist/components/generative/GenerativeView.js +203 -11
  236. package/dist/components/generative/actions.d.ts +5 -0
  237. package/dist/components/generative/ai-sdk/index.d.ts +1 -0
  238. package/dist/components/generative/ai-sdk/index.js +1 -0
  239. package/dist/components/generative/ai-sdk/useGenerativeChat.d.ts +52 -0
  240. package/dist/components/generative/ai-sdk/useGenerativeChat.js +73 -0
  241. package/dist/components/generative/ai-sdk/useGenerativeChat.test.d.ts +1 -0
  242. package/dist/components/generative/fieldBinding.d.ts +31 -0
  243. package/dist/components/generative/fieldBinding.js +33 -0
  244. package/dist/components/generative/fieldBinding.test.d.ts +1 -0
  245. package/dist/components/generative/formScope.d.ts +71 -0
  246. package/dist/components/generative/formScope.js +135 -0
  247. package/dist/components/generative/index.d.ts +4 -0
  248. package/dist/components/generative/index.js +4 -0
  249. package/dist/components/generative/registry.d.ts +2 -0
  250. package/dist/components/generative/registry.js +10 -10
  251. package/dist/components/generative/schema.generated.js +178 -292
  252. package/dist/components/generative/toToolResult.d.ts +21 -0
  253. package/dist/components/generative/toToolResult.js +15 -0
  254. package/dist/components/generative/toToolResult.test.d.ts +1 -0
  255. package/dist/components/generative/validate.d.ts +10 -1
  256. package/dist/components/generative/validate.js +126 -11
  257. package/dist/components/layout/Grid/Grid.js +1 -0
  258. package/dist/components/layout/Section/Section.theme.js +1 -1
  259. package/dist/components/layout/Stack/Stack.js +1 -0
  260. package/dist/generative.schema.json +178 -292
  261. package/dist/index.js +1 -4
  262. package/dist/registry.json +2599 -2375
  263. package/dist/shadcn-compat.css +5 -5
  264. package/dist/styles/theme.test.d.ts +1 -0
  265. package/dist/styles.css +1 -1
  266. package/dist/test/render.d.ts +17 -0
  267. package/dist/themes/precision.css +232 -0
  268. package/dist/tools.json +179 -294
  269. package/dist/utils/index.d.ts +0 -1
  270. package/package.json +31 -1
  271. package/src/global.scss +21 -28
  272. package/src/styles/theme.css +124 -41
  273. package/src/styles/theme.test.ts +119 -0
  274. package/tailwind.preset.cjs +30 -20
  275. package/dist/components/charts/FunnelChart/FunnelChart.animations.d.ts +0 -35
  276. package/dist/components/charts/FunnelChart/FunnelChart.animations.js +0 -59
  277. package/dist/components/charts/FunnelChart/FunnelChart.d.ts +0 -8
  278. package/dist/components/charts/FunnelChart/FunnelChart.js +0 -410
  279. package/dist/components/charts/FunnelChart/FunnelChart.theme.d.ts +0 -2
  280. package/dist/components/charts/FunnelChart/FunnelChart.theme.js +0 -12
  281. package/dist/components/charts/FunnelChart/FunnelChart.types.d.ts +0 -105
  282. package/dist/components/charts/FunnelChart/index.d.ts +0 -4
  283. package/dist/components/charts/ScatterPlot/ScatterPlot.d.ts +0 -9
  284. package/dist/components/charts/ScatterPlot/ScatterPlot.js +0 -208
  285. package/dist/components/charts/ScatterPlot/ScatterPlot.theme.d.ts +0 -18
  286. package/dist/components/charts/ScatterPlot/ScatterPlot.theme.js +0 -42
  287. package/dist/components/charts/ScatterPlot/ScatterPlot.types.d.ts +0 -60
  288. package/dist/components/charts/ScatterPlot/ScatterPlot.types.js +0 -19
  289. package/dist/components/charts/ScatterPlot/index.d.ts +0 -3
  290. package/dist/components/core/Button/Button.ripple.d.ts +0 -71
  291. package/dist/components/core/Button/Button.ripple.js +0 -236
  292. package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.d.ts +0 -4
  293. package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.theme.d.ts +0 -12
  294. package/dist/components/core/Calendar/CalendarEvent/CalendarEvent.types.d.ts +0 -23
  295. package/dist/components/core/Calendar/CalendarEvent/index.d.ts +0 -2
  296. package/dist/components/core/CardStack/CardStack.animations.d.ts +0 -47
  297. package/dist/components/core/CardStack/CardStack.d.ts +0 -3
  298. package/dist/components/core/CardStack/CardStack.js +0 -187
  299. package/dist/components/core/CardStack/CardStack.theme.d.ts +0 -6
  300. package/dist/components/core/CardStack/CardStack.theme.js +0 -33
  301. package/dist/components/core/CardStack/CardStack.types.d.ts +0 -139
  302. package/dist/components/core/CardStack/index.d.ts +0 -7
  303. package/dist/components/core/Carousel/Carousel.d.ts +0 -3
  304. package/dist/components/core/Carousel/Carousel.js +0 -83
  305. package/dist/components/core/Carousel/Carousel.theme.d.ts +0 -10
  306. package/dist/components/core/Carousel/Carousel.theme.js +0 -20
  307. package/dist/components/core/Carousel/Carousel.types.d.ts +0 -113
  308. package/dist/components/core/Carousel/CarouselBody.d.ts +0 -4
  309. package/dist/components/core/Carousel/CarouselBody.js +0 -59
  310. package/dist/components/core/Carousel/CarouselContext.d.ts +0 -3
  311. package/dist/components/core/Carousel/CarouselContext.js +0 -13
  312. package/dist/components/core/Carousel/CarouselItem.d.ts +0 -4
  313. package/dist/components/core/Carousel/CarouselItem.js +0 -11
  314. package/dist/components/core/Carousel/CarouselNext.d.ts +0 -4
  315. package/dist/components/core/Carousel/CarouselNext.js +0 -16
  316. package/dist/components/core/Carousel/CarouselPrevious.d.ts +0 -4
  317. package/dist/components/core/Carousel/CarouselPrevious.js +0 -16
  318. package/dist/components/core/Carousel/index.d.ts +0 -3
  319. package/dist/components/effects/ColorPanels/ColorPanels.d.ts +0 -8
  320. package/dist/components/effects/ColorPanels/ColorPanels.js +0 -66
  321. package/dist/components/effects/ColorPanels/ColorPanels.shaders.d.ts +0 -12
  322. package/dist/components/effects/ColorPanels/ColorPanels.shaders.js +0 -218
  323. package/dist/components/effects/ColorPanels/ColorPanels.types.d.ts +0 -29
  324. package/dist/components/effects/ColorPanels/ColorPanels.types.js +0 -3
  325. package/dist/components/effects/ColorPanels/index.d.ts +0 -2
  326. package/dist/components/effects/FlutedGlass/FlutedGlass.d.ts +0 -9
  327. package/dist/components/effects/FlutedGlass/FlutedGlass.js +0 -80
  328. package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.d.ts +0 -12
  329. package/dist/components/effects/FlutedGlass/FlutedGlass.shaders.js +0 -335
  330. package/dist/components/effects/FlutedGlass/FlutedGlass.types.d.ts +0 -61
  331. package/dist/components/effects/FlutedGlass/FlutedGlass.types.js +0 -16
  332. package/dist/components/effects/FlutedGlass/index.d.ts +0 -3
  333. package/dist/components/effects/GlassEffect/GlassEffect.d.ts +0 -15
  334. package/dist/components/effects/GlassEffect/GlassEffect.js +0 -38
  335. package/dist/components/effects/GlassEffect/GlassEffect.types.d.ts +0 -19
  336. package/dist/components/effects/GlassEffect/index.d.ts +0 -2
  337. package/dist/components/effects/GlassSurface/GlassSurface.d.ts +0 -8
  338. package/dist/components/effects/GlassSurface/GlassSurface.js +0 -250
  339. package/dist/components/effects/GlassSurface/GlassSurface.types.d.ts +0 -66
  340. package/dist/components/effects/GlassSurface/index.d.ts +0 -2
  341. package/dist/components/effects/GodRays/GodRays.d.ts +0 -8
  342. package/dist/components/effects/GodRays/GodRays.js +0 -68
  343. package/dist/components/effects/GodRays/GodRays.shaders.d.ts +0 -10
  344. package/dist/components/effects/GodRays/GodRays.shaders.js +0 -128
  345. package/dist/components/effects/GodRays/GodRays.types.d.ts +0 -25
  346. package/dist/components/effects/GodRays/GodRays.types.js +0 -3
  347. package/dist/components/effects/GodRays/index.d.ts +0 -2
  348. package/dist/components/effects/GridPattern/GridPattern.d.ts +0 -18
  349. package/dist/components/effects/GridPattern/GridPattern.js +0 -65
  350. package/dist/components/effects/GridPattern/GridPattern.types.d.ts +0 -47
  351. package/dist/components/effects/GridPattern/index.d.ts +0 -2
  352. package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.d.ts +0 -10
  353. package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.js +0 -78
  354. package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.d.ts +0 -22
  355. package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.shaders.js +0 -239
  356. package/dist/components/effects/HalftoneCmyk/HalftoneCmyk.types.d.ts +0 -52
  357. package/dist/components/effects/HalftoneCmyk/index.d.ts +0 -2
  358. package/dist/components/effects/HalftoneDots/HalftoneDots.d.ts +0 -9
  359. package/dist/components/effects/HalftoneDots/HalftoneDots.js +0 -68
  360. package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.d.ts +0 -13
  361. package/dist/components/effects/HalftoneDots/HalftoneDots.shaders.js +0 -296
  362. package/dist/components/effects/HalftoneDots/HalftoneDots.types.d.ts +0 -43
  363. package/dist/components/effects/HalftoneDots/HalftoneDots.types.js +0 -12
  364. package/dist/components/effects/HalftoneDots/index.d.ts +0 -3
  365. package/dist/components/effects/ImageDithering/ImageDithering.d.ts +0 -9
  366. package/dist/components/effects/ImageDithering/ImageDithering.js +0 -68
  367. package/dist/components/effects/ImageDithering/ImageDithering.shaders.d.ts +0 -12
  368. package/dist/components/effects/ImageDithering/ImageDithering.shaders.js +0 -117
  369. package/dist/components/effects/ImageDithering/ImageDithering.types.d.ts +0 -30
  370. package/dist/components/effects/ImageDithering/ImageDithering.types.js +0 -8
  371. package/dist/components/effects/ImageDithering/index.d.ts +0 -3
  372. package/dist/components/effects/MagneticElement/MagneticElement.d.ts +0 -30
  373. package/dist/components/effects/MagneticElement/MagneticElement.js +0 -111
  374. package/dist/components/effects/MagneticElement/MagneticElement.types.d.ts +0 -44
  375. package/dist/components/effects/MagneticElement/index.d.ts +0 -2
  376. package/dist/components/effects/Metaballs/Metaballs.d.ts +0 -8
  377. package/dist/components/effects/Metaballs/Metaballs.js +0 -59
  378. package/dist/components/effects/Metaballs/Metaballs.shaders.d.ts +0 -10
  379. package/dist/components/effects/Metaballs/Metaballs.shaders.js +0 -102
  380. package/dist/components/effects/Metaballs/Metaballs.types.d.ts +0 -16
  381. package/dist/components/effects/Metaballs/Metaballs.types.js +0 -3
  382. package/dist/components/effects/Metaballs/index.d.ts +0 -2
  383. package/dist/components/effects/PaperTexture/PaperTexture.d.ts +0 -9
  384. package/dist/components/effects/PaperTexture/PaperTexture.js +0 -61
  385. package/dist/components/effects/PaperTexture/PaperTexture.shaders.d.ts +0 -22
  386. package/dist/components/effects/PaperTexture/PaperTexture.shaders.js +0 -145
  387. package/dist/components/effects/PaperTexture/PaperTexture.types.d.ts +0 -19
  388. package/dist/components/effects/PaperTexture/index.d.ts +0 -2
  389. package/dist/components/effects/PulsingBorder/PulsingBorder.d.ts +0 -27
  390. package/dist/components/effects/PulsingBorder/PulsingBorder.js +0 -174
  391. package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.d.ts +0 -14
  392. package/dist/components/effects/PulsingBorder/PulsingBorder.shaders.js +0 -258
  393. package/dist/components/effects/PulsingBorder/PulsingBorder.types.d.ts +0 -75
  394. package/dist/components/effects/PulsingBorder/PulsingBorder.types.js +0 -3
  395. package/dist/components/effects/PulsingBorder/index.d.ts +0 -2
  396. package/dist/components/effects/SmokeRing/SmokeRing.d.ts +0 -8
  397. package/dist/components/effects/SmokeRing/SmokeRing.js +0 -62
  398. package/dist/components/effects/SmokeRing/SmokeRing.shaders.d.ts +0 -14
  399. package/dist/components/effects/SmokeRing/SmokeRing.shaders.js +0 -130
  400. package/dist/components/effects/SmokeRing/SmokeRing.types.d.ts +0 -22
  401. package/dist/components/effects/SmokeRing/SmokeRing.types.js +0 -3
  402. package/dist/components/effects/SmokeRing/index.d.ts +0 -2
  403. package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.d.ts +0 -9
  404. package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.js +0 -59
  405. package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.d.ts +0 -14
  406. package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.shaders.js +0 -129
  407. package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.d.ts +0 -23
  408. package/dist/components/effects/StaticGradientMesh/StaticGradientMesh.types.js +0 -3
  409. package/dist/components/effects/StaticGradientMesh/index.d.ts +0 -2
  410. package/dist/components/effects/Water/Water.d.ts +0 -9
  411. package/dist/components/effects/Water/Water.js +0 -65
  412. package/dist/components/effects/Water/Water.shaders.d.ts +0 -11
  413. package/dist/components/effects/Water/Water.shaders.js +0 -123
  414. package/dist/components/effects/Water/Water.types.d.ts +0 -25
  415. package/dist/components/effects/Water/index.d.ts +0 -2
  416. package/dist/components/effects/shared/bayerMatrices.glsl.d.ts +0 -10
  417. package/dist/components/effects/shared/bayerMatrices.glsl.js +0 -44
  418. package/dist/components/effects/shared/imageUV.glsl.d.ts +0 -12
  419. package/dist/components/effects/shared/imageUV.glsl.js +0 -26
  420. package/dist/components/forms/RichTextEditor/RichTextEditor.animations.d.ts +0 -7
  421. package/dist/components/forms/RichTextEditor/RichTextEditor.animations.js +0 -32
  422. package/dist/utils/calendarUtils.d.ts +0 -60
  423. /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.d.ts +0 -0
  424. /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.d.ts +0 -0
  425. /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.theme.js +0 -0
  426. /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltip.types.d.ts +0 -0
  427. /package/dist/components/{charts → core}/shared/ChartTooltip/ChartTooltipContent.d.ts +0 -0
  428. /package/dist/components/{charts → core}/shared/ChartTooltip/index.d.ts +0 -0
@@ -1,35 +0,0 @@
1
- import type { Variants, Transition } from 'motion/react';
2
- /**
3
- * Animation variants for FunnelChart segments
4
- */
5
- export declare const segmentVariants: Variants;
6
- /**
7
- * Animation variants for vertical orientation segments
8
- */
9
- export declare const verticalSegmentVariants: Variants;
10
- /**
11
- * Animation variants for labels
12
- */
13
- export declare const labelVariants: Variants;
14
- /**
15
- * Animation variants for conversion badges
16
- */
17
- export declare const badgeVariants: Variants;
18
- /**
19
- * Animation variants for summary box
20
- */
21
- export declare const summaryVariants: Variants;
22
- /**
23
- * Hover animation for segments
24
- */
25
- export declare const hoverTransition: Transition;
26
- /**
27
- * Default animation settings
28
- */
29
- export declare const funnelAnimationDefaults: {
30
- staggerDelay: number;
31
- segmentDuration: number;
32
- labelDelay: number;
33
- badgeDelay: number;
34
- summaryDelay: number;
35
- };
@@ -1,59 +0,0 @@
1
- /**
2
- * Animation variants for FunnelChart segments
3
- */
4
- /**
5
- * Animation variants for labels
6
- */
7
- const labelVariants = {
8
- hidden: {
9
- opacity: 0,
10
- y: -10,
11
- },
12
- visible: (index) => ({
13
- opacity: 1,
14
- y: 0,
15
- transition: {
16
- delay: index * 0.08 + 0.2,
17
- duration: 0.3,
18
- ease: 'easeOut',
19
- },
20
- }),
21
- };
22
- /**
23
- * Animation variants for conversion badges
24
- */
25
- const badgeVariants = {
26
- hidden: {
27
- opacity: 0,
28
- scale: 0.8,
29
- },
30
- visible: (index) => ({
31
- opacity: 1,
32
- scale: 1,
33
- transition: {
34
- delay: index * 0.08 + 0.3,
35
- duration: 0.25,
36
- ease: 'easeOut',
37
- },
38
- }),
39
- };
40
- /**
41
- * Animation variants for summary box
42
- */
43
- const summaryVariants = {
44
- hidden: {
45
- opacity: 0,
46
- x: 20,
47
- },
48
- visible: {
49
- opacity: 1,
50
- x: 0,
51
- transition: {
52
- delay: 0.5,
53
- duration: 0.3,
54
- ease: 'easeOut',
55
- },
56
- },
57
- };
58
-
59
- export { badgeVariants, labelVariants, summaryVariants };
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import type { FunnelChartProps } from "./FunnelChart.types";
3
- /**
4
- * Displays conversion funnel data with trapezoid shapes showing progressive
5
- * dropoff. The render keeps the chart surface focused: stage-level detail lives
6
- * in labels/tooltips while conversion and dropoff badges appear on focus.
7
- */
8
- export declare const FunnelChart: React.FC<FunnelChartProps>;
@@ -1,410 +0,0 @@
1
- "use client";
2
- import { jsx, jsxs } from 'react/jsx-runtime';
3
- import { useRef, useId, useState, useCallback, useMemo } from 'react';
4
- import { useReducedMotion, AnimatePresence, motion } from 'motion/react';
5
- import { cn } from '../../../utils/cn.js';
6
- import { funnelChartTheme } from './FunnelChart.theme.js';
7
- import { summaryVariants, labelVariants, badgeVariants } from './FunnelChart.animations.js';
8
- import { ChartTooltip } from '../shared/ChartTooltip/ChartTooltip.js';
9
- import { Badge } from '../../core/Badge/Badge.js';
10
- import { useTooltipPosition } from '../hooks/useTooltipPosition.js';
11
- import { useChartDimensions } from '../hooks/useChartDimensions.js';
12
-
13
- const sanitizeSvgId = (value) => value.replace(/[^a-zA-Z0-9_-]/g, "");
14
- const resolveColor = (color, fallback) => {
15
- if (!color)
16
- return fallback;
17
- if (!color.startsWith("var(") &&
18
- !color.startsWith("#") &&
19
- !color.startsWith("rgb") &&
20
- !color.startsWith("hsl") &&
21
- color.includes("-")) {
22
- return `var(--color-${color})`;
23
- }
24
- return color;
25
- };
26
- /**
27
- * Displays conversion funnel data with trapezoid shapes showing progressive
28
- * dropoff. The render keeps the chart surface focused: stage-level detail lives
29
- * in labels/tooltips while conversion and dropoff badges appear on focus.
30
- */
31
- const FunnelChart = ({ data, height = 400, width = 600, showPercentages = true, showValues = true, showLabels = true, showDropoff = false, showConversionRate = true, showSummary = true, colors, theme: themeOverrides, className, orientation = "horizontal", curved = true, useGradient = true, fillOpacity = 0.85, onStageClick, formatValue, labelPosition = "top", summaryPosition = "top-right", animate = true, onStageFocus, ...props }) => {
32
- const theme = { ...funnelChartTheme, ...(themeOverrides || {}) };
33
- const chartColors = colors || theme.colors || funnelChartTheme.colors;
34
- const rootRef = useRef(null);
35
- const chartRef = useRef(null);
36
- const { dimensions, measured } = useChartDimensions(chartRef);
37
- const shouldReduceMotion = useReducedMotion();
38
- const shouldAnimate = animate && !shouldReduceMotion;
39
- const chartId = sanitizeSvgId(useId());
40
- const { tooltipData, tooltipRef, handleMouseEnter: tooltipMouseEnter, handleMouseMove: tooltipMouseMove, handleMouseLeave: tooltipMouseLeave, } = useTooltipPosition({
41
- containerRef: rootRef,
42
- });
43
- const [hoveredIndex, setHoveredIndex] = useState(null);
44
- const [focusedIndex, setFocusedIndex] = useState(0);
45
- const activeIndex = hoveredIndex !== null && hoveredIndex !== void 0 ? hoveredIndex : focusedIndex;
46
- const formatDisplayValue = useCallback((value) => {
47
- if (formatValue)
48
- return formatValue(value);
49
- return value.toLocaleString();
50
- }, [formatValue]);
51
- const maxValue = useMemo(() => {
52
- if (!data.length)
53
- return 0;
54
- return Math.max(...data.map((d) => Number.isFinite(d.value) ? d.value : 0));
55
- }, [data]);
56
- const stages = useMemo(() => {
57
- if (!data.length || maxValue <= 0)
58
- return [];
59
- return data.map((item, index) => {
60
- const safeValue = Number.isFinite(item.value) ? Math.max(0, item.value) : 0;
61
- const percentage = (safeValue / maxValue) * 100;
62
- const prevValue = index > 0 ? Math.max(0, data[index - 1].value) : 0;
63
- const dropoff = index > 0 && prevValue > 0
64
- ? ((prevValue - safeValue) / prevValue) * 100
65
- : 0;
66
- const conversionRate = index > 0 && prevValue > 0 ? (safeValue / prevValue) * 100 : 100;
67
- const usersLost = index > 0 ? Math.max(0, prevValue - safeValue) : 0;
68
- const color = resolveColor(item.color, chartColors[index % chartColors.length] || "var(--color-primary)");
69
- return {
70
- ...item,
71
- value: safeValue,
72
- percentage,
73
- dropoff,
74
- conversionRate,
75
- usersLost,
76
- color,
77
- opacity: Math.max(0.54, 0.96 - index * 0.08),
78
- gradientId: `funnel-gradient-${chartId}-${index}`,
79
- };
80
- });
81
- }, [data, maxValue, chartColors, chartId]);
82
- const containerHeight = typeof height === "number" ? `${height}px` : height;
83
- const containerWidth = typeof width === "number" ? `${width}px` : width;
84
- if (stages.length === 0) {
85
- return (jsx("div", { className: cn(theme.baseStyle, "justify-center text-[var(--color-text-muted)]", className), style: { width: containerWidth, height: containerHeight }, role: "img", "aria-label": "Empty funnel chart - no data available", ...props, children: jsx("span", { children: "No data available" }) }));
86
- }
87
- const hasTopSummary = showSummary && summaryPosition !== "none" && summaryPosition.startsWith("top");
88
- const hasBottomSummary = showSummary && summaryPosition !== "none" && summaryPosition.startsWith("bottom");
89
- const plotMargin = {
90
- top: orientation === "horizontal" && labelPosition === "top" ? 46 : 18,
91
- right: orientation === "vertical" && (showConversionRate || showDropoff) ? 82 : 24,
92
- bottom: orientation === "horizontal" && labelPosition === "bottom" ? 46 : 18,
93
- left: orientation === "vertical" && (showConversionRate || showDropoff) ? 82 : 24,
94
- };
95
- const innerWidth = Math.max(0, dimensions.width - plotMargin.left - plotMargin.right);
96
- const innerHeight = Math.max(0, dimensions.height - plotMargin.top - plotMargin.bottom);
97
- const stageWidth = stages.length > 0 ? innerWidth / stages.length : 0;
98
- const stageHeight = stages.length > 0 ? innerHeight / stages.length : 0;
99
- const minThickness = orientation === "horizontal" ? 18 : 24;
100
- const availableThickness = orientation === "horizontal" ? innerHeight : innerWidth;
101
- const getThickness = (percentage) => {
102
- if (!percentage)
103
- return minThickness;
104
- return Math.max(minThickness, (percentage / 100) * availableThickness);
105
- };
106
- const getHorizontalBoundaryPoint = (boundaryIndex, edge) => {
107
- const boundedIndex = Math.max(0, Math.min(stages.length, boundaryIndex));
108
- const stageIndex = Math.min(boundedIndex, stages.length - 1);
109
- const thickness = getThickness(stages[stageIndex].percentage);
110
- const centerY = plotMargin.top + innerHeight / 2;
111
- return {
112
- x: plotMargin.left + boundedIndex * stageWidth,
113
- y: edge === "top" ? centerY - thickness / 2 : centerY + thickness / 2,
114
- };
115
- };
116
- const getSmoothHorizontalCurve = (index, edge) => {
117
- const p0 = getHorizontalBoundaryPoint(index - 1, edge);
118
- const p1 = getHorizontalBoundaryPoint(index, edge);
119
- const p2 = getHorizontalBoundaryPoint(index + 1, edge);
120
- const p3 = getHorizontalBoundaryPoint(index + 2, edge);
121
- const smoothing = 0.22;
122
- return {
123
- start: p1,
124
- end: p2,
125
- cp1: {
126
- x: p1.x + (p2.x - p0.x) * smoothing,
127
- y: p1.y + (p2.y - p0.y) * smoothing,
128
- },
129
- cp2: {
130
- x: p2.x - (p3.x - p1.x) * smoothing,
131
- y: p2.y - (p3.y - p1.y) * smoothing,
132
- },
133
- };
134
- };
135
- const getHorizontalGeometry = (index) => {
136
- const stage = stages[index];
137
- const nextStage = stages[index + 1] || stage;
138
- const xStart = plotMargin.left + index * stageWidth;
139
- const xEnd = xStart + stageWidth;
140
- const startThickness = getThickness(stage.percentage);
141
- const endThickness = getThickness(nextStage.percentage);
142
- const centerY = plotMargin.top + innerHeight / 2;
143
- const startTop = centerY - startThickness / 2;
144
- const startBottom = centerY + startThickness / 2;
145
- const endTop = centerY - endThickness / 2;
146
- const endBottom = centerY + endThickness / 2;
147
- const path = curved
148
- ? (() => {
149
- const topCurve = getSmoothHorizontalCurve(index, "top");
150
- const bottomCurve = getSmoothHorizontalCurve(index, "bottom");
151
- return `
152
- M ${topCurve.start.x} ${topCurve.start.y}
153
- C ${topCurve.cp1.x} ${topCurve.cp1.y}, ${topCurve.cp2.x} ${topCurve.cp2.y}, ${topCurve.end.x} ${topCurve.end.y}
154
- L ${bottomCurve.end.x} ${bottomCurve.end.y}
155
- C ${bottomCurve.cp2.x} ${bottomCurve.cp2.y}, ${bottomCurve.cp1.x} ${bottomCurve.cp1.y}, ${bottomCurve.start.x} ${bottomCurve.start.y}
156
- Z
157
- `;
158
- })()
159
- : `
160
- M ${xStart} ${startTop}
161
- L ${xEnd} ${endTop}
162
- L ${xEnd} ${endBottom}
163
- L ${xStart} ${startBottom}
164
- Z
165
- `;
166
- return {
167
- path,
168
- centerX: xStart + stageWidth / 2,
169
- centerY,
170
- boundaryX: xStart,
171
- boundaryY: centerY,
172
- labelWidth: Math.max(72, stageWidth - 16),
173
- labelFitsInside: Math.min(startThickness, endThickness) >= 48 && stageWidth >= 92,
174
- };
175
- };
176
- const getVerticalGeometry = (index) => {
177
- const stage = stages[index];
178
- const nextStage = stages[index + 1] || stage;
179
- const yStart = plotMargin.top + index * stageHeight;
180
- const yEnd = yStart + stageHeight;
181
- const topWidth = getThickness(stage.percentage);
182
- const bottomWidth = getThickness(nextStage.percentage);
183
- const centerX = plotMargin.left + innerWidth / 2;
184
- const topLeft = centerX - topWidth / 2;
185
- const topRight = centerX + topWidth / 2;
186
- const bottomLeft = centerX - bottomWidth / 2;
187
- const bottomRight = centerX + bottomWidth / 2;
188
- return {
189
- path: `
190
- M ${topLeft} ${yStart}
191
- L ${topRight} ${yStart}
192
- L ${bottomRight} ${yEnd}
193
- L ${bottomLeft} ${yEnd}
194
- Z
195
- `,
196
- centerX,
197
- centerY: yStart + stageHeight / 2,
198
- boundaryX: centerX,
199
- boundaryY: yStart,
200
- labelWidth: Math.max(96, Math.min(topWidth, bottomWidth) - 18),
201
- labelFitsInside: Math.min(topWidth, bottomWidth) >= 132 && stageHeight >= 56,
202
- };
203
- };
204
- const geometries = stages.map((_, index) => orientation === "horizontal"
205
- ? getHorizontalGeometry(index)
206
- : getVerticalGeometry(index));
207
- const overallConversion = stages.length > 1 && stages[0].value > 0
208
- ? ((stages[stages.length - 1].value / stages[0].value) * 100).toFixed(1)
209
- : "100";
210
- const buildTooltipContent = (stage, index) => {
211
- const series = [
212
- {
213
- key: "value",
214
- label: "Value",
215
- value: formatDisplayValue(stage.value),
216
- color: stage.color,
217
- },
218
- {
219
- key: "percentage",
220
- label: "Of total",
221
- value: `${stage.percentage.toFixed(1)}%`,
222
- },
223
- ];
224
- if (index > 0) {
225
- series.push({
226
- key: "conversion",
227
- label: "Conversion",
228
- value: `${stage.conversionRate.toFixed(1)}%`,
229
- color: stage.conversionRate >= 50
230
- ? "var(--color-success)"
231
- : "var(--color-warning)",
232
- });
233
- series.push({
234
- key: "lost",
235
- label: "Lost",
236
- value: formatDisplayValue(stage.usersLost),
237
- color: "var(--color-danger)",
238
- });
239
- }
240
- return {
241
- category: stage.name,
242
- series,
243
- };
244
- };
245
- const handleMouseEnter = (e, stage, index) => {
246
- const geometry = geometries[index];
247
- tooltipMouseEnter(e, buildTooltipContent(stage, index), {
248
- x: geometry.centerX,
249
- y: geometry.centerY,
250
- dimensions,
251
- });
252
- setHoveredIndex(index);
253
- };
254
- const handleMouseLeave = () => {
255
- tooltipMouseLeave();
256
- setHoveredIndex(null);
257
- };
258
- const handleClick = (stage, index) => {
259
- onStageClick === null || onStageClick === void 0 ? void 0 : onStageClick(stage, index);
260
- };
261
- const handleKeyDown = (e) => {
262
- const nextKey = orientation === "horizontal" ? "ArrowRight" : "ArrowDown";
263
- const prevKey = orientation === "horizontal" ? "ArrowLeft" : "ArrowUp";
264
- if (e.key === nextKey) {
265
- e.preventDefault();
266
- setFocusedIndex((index) => Math.min(stages.length - 1, index + 1));
267
- return;
268
- }
269
- if (e.key === prevKey) {
270
- e.preventDefault();
271
- setFocusedIndex((index) => Math.max(0, index - 1));
272
- return;
273
- }
274
- if (e.key === "Home") {
275
- e.preventDefault();
276
- setFocusedIndex(0);
277
- return;
278
- }
279
- if (e.key === "End") {
280
- e.preventDefault();
281
- setFocusedIndex(stages.length - 1);
282
- return;
283
- }
284
- if (e.key === "Enter" || e.key === " ") {
285
- e.preventDefault();
286
- handleClick(stages[focusedIndex], focusedIndex);
287
- }
288
- };
289
- const renderSummary = () => {
290
- if (!showSummary || summaryPosition === "none" || stages.length <= 1) {
291
- return null;
292
- }
293
- return (jsxs(motion.div, { className: cn("flex w-full items-center justify-between gap-4 rounded-md border border-[var(--color-border)] bg-[var(--color-background)] px-3 py-2 shadow-sm", summaryPosition.endsWith("left") ? "text-left" : "text-right"), ...(shouldAnimate
294
- ? {
295
- variants: summaryVariants,
296
- initial: "hidden",
297
- animate: "visible",
298
- }
299
- : {}), children: [jsxs("div", { children: [jsx("div", { className: "text-sm text-[var(--color-text-secondary)]", children: "Overall conversion" }), jsxs("div", { className: "text-lg font-semibold text-[var(--color-text-primary)]", children: [overallConversion, "%"] })] }), jsxs("div", { className: "text-sm text-[var(--color-text-muted)]", children: [formatDisplayValue(stages[0].value), " to", " ", formatDisplayValue(stages[stages.length - 1].value)] })] }));
300
- };
301
- const renderStageLabel = (stage, index) => {
302
- if (!showLabels || labelPosition === "tooltip-only" || !measured)
303
- return null;
304
- const geometry = geometries[index];
305
- const isInside = labelPosition === "inside" ||
306
- (orientation === "vertical" && geometry.labelFitsInside);
307
- const shouldShowInside = isInside && geometry.labelFitsInside;
308
- const top = orientation === "horizontal"
309
- ? shouldShowInside
310
- ? geometry.centerY
311
- : labelPosition === "bottom"
312
- ? dimensions.height - 30
313
- : 12
314
- : geometry.centerY;
315
- const left = orientation === "vertical" && !shouldShowInside
316
- ? plotMargin.left + innerWidth + 14
317
- : geometry.centerX;
318
- return (jsxs(motion.div, { className: "absolute pointer-events-none text-center", style: {
319
- left,
320
- top,
321
- width: Math.min(geometry.labelWidth, 180),
322
- transform: shouldShowInside
323
- ? "translate(-50%, -50%)"
324
- : orientation === "vertical"
325
- ? "translateY(-50%)"
326
- : "translateX(-50%)",
327
- }, ...(shouldAnimate
328
- ? {
329
- variants: labelVariants,
330
- initial: "hidden",
331
- animate: "visible",
332
- custom: index,
333
- }
334
- : {}), children: [jsx("div", { className: cn("truncate text-sm font-semibold leading-5", shouldShowInside
335
- ? "text-white drop-shadow-md"
336
- : "text-[var(--color-text-primary)]"), title: stage.name, children: stage.name }), (showValues || showPercentages) && (jsxs("div", { className: cn("truncate text-xs leading-4", shouldShowInside
337
- ? "text-white/90 drop-shadow-md"
338
- : "text-[var(--color-text-secondary)]"), children: [showValues && formatDisplayValue(stage.value), showValues && showPercentages && " / ", showPercentages && `${stage.percentage.toFixed(0)}%`] }))] }, `label-${stage.name}`));
339
- };
340
- const renderActiveBadge = () => {
341
- const index = activeIndex;
342
- if (!measured || index <= 0 || index >= stages.length)
343
- return null;
344
- const stage = stages[index];
345
- const geometry = geometries[index];
346
- const isGoodConversion = stage.conversionRate >= 50;
347
- return (jsxs(motion.div, { className: "absolute pointer-events-none", style: {
348
- left: orientation === "horizontal"
349
- ? geometry.boundaryX
350
- : plotMargin.left + 8,
351
- top: orientation === "horizontal"
352
- ? geometry.boundaryY
353
- : geometry.boundaryY,
354
- transform: orientation === "horizontal"
355
- ? "translate(-50%, -50%)"
356
- : "translateY(-50%)",
357
- }, ...(shouldAnimate
358
- ? {
359
- variants: badgeVariants,
360
- initial: "hidden",
361
- animate: "visible",
362
- custom: index,
363
- }
364
- : {}), children: [showConversionRate && (jsxs(Badge, { color: isGoodConversion ? "success" : "warning", variant: "soft", size: "sm", pill: true, children: [stage.conversionRate.toFixed(1), "%"] })), showDropoff && (jsxs("div", { className: "mt-1 text-center text-xs font-medium text-[var(--color-danger)]", children: ["-", Math.max(0, stage.dropoff).toFixed(1), "%"] }))] }, `active-badge-${stage.name}`));
365
- };
366
- return (jsxs("div", { ref: rootRef, className: cn(theme.baseStyle, "gap-3", className), style: { width: containerWidth, height: containerHeight }, role: "img", "aria-label": `Conversion funnel chart with ${stages.length} stages. Overall conversion: ${overallConversion}%`, tabIndex: 0, onKeyDown: handleKeyDown, ...props, children: [hasTopSummary && renderSummary(), jsxs("div", { ref: chartRef, className: "relative min-h-0 w-full flex-1", children: [jsxs("svg", { viewBox: `0 0 ${dimensions.width} ${dimensions.height}`, width: "100%", height: "100%", "aria-hidden": "true", className: "block overflow-visible", children: [jsx("defs", { children: useGradient &&
367
- stages.map((stage) => {
368
- const centerOpacity = Math.min(0.98, stage.opacity);
369
- const edgeOpacity = Math.max(0.26, centerOpacity - 0.34);
370
- return (jsxs("linearGradient", { id: stage.gradientId, gradientUnits: "objectBoundingBox", x1: orientation === "horizontal" ? "0" : "0.5", y1: orientation === "horizontal" ? "0.5" : "0", x2: orientation === "horizontal" ? "1" : "0.5", y2: orientation === "horizontal" ? "0.5" : "1", children: [jsx("stop", { offset: "0%", stopColor: stage.color, stopOpacity: centerOpacity }), jsx("stop", { offset: "70%", stopColor: stage.color, stopOpacity: Math.max(edgeOpacity, centerOpacity - 0.12) }), jsx("stop", { offset: "100%", stopColor: stage.color, stopOpacity: edgeOpacity })] }, stage.gradientId));
371
- }) }), jsx(AnimatePresence, { children: measured &&
372
- stages.map((stage, index) => {
373
- const geometry = geometries[index];
374
- const fill = useGradient
375
- ? `url(#${stage.gradientId})`
376
- : stage.color;
377
- const isActive = activeIndex === index;
378
- const isDimmed = hoveredIndex !== null && hoveredIndex !== index;
379
- return (jsx(motion.path, { d: geometry.path, fill: fill, fillOpacity: useGradient ? 1 : fillOpacity, stroke: isActive
380
- ? stage.color
381
- : "var(--color-surface)", strokeWidth: isActive ? 1.5 : 1, strokeLinejoin: "round", vectorEffect: "non-scaling-stroke", className: "cursor-pointer outline-none transition-colors duration-200", initial: shouldAnimate
382
- ? {
383
- opacity: 0,
384
- scaleX: orientation === "horizontal" ? 0.84 : 1,
385
- scaleY: orientation === "vertical" ? 0.84 : 1,
386
- }
387
- : false, animate: {
388
- opacity: isDimmed ? 0.36 : 1,
389
- scaleX: 1,
390
- scaleY: 1,
391
- }, exit: shouldAnimate ? { opacity: 0 } : undefined, transition: {
392
- delay: shouldAnimate ? index * 0.06 : 0,
393
- duration: shouldAnimate ? 0.36 : 0,
394
- ease: "easeOut",
395
- }, style: {
396
- transformOrigin: orientation === "horizontal"
397
- ? `${geometry.centerX}px ${geometry.centerY}px`
398
- : `${geometry.centerX}px ${geometry.centerY}px`,
399
- filter: isActive
400
- ? "drop-shadow(0 8px 14px rgb(0 0 0 / 0.14))"
401
- : undefined,
402
- }, onMouseEnter: (e) => handleMouseEnter(e, stage, index), onMouseMove: tooltipMouseMove, onMouseLeave: handleMouseLeave, onFocus: () => {
403
- setFocusedIndex(index);
404
- onStageFocus === null || onStageFocus === void 0 ? void 0 : onStageFocus(stage, index);
405
- }, onClick: () => handleClick(stage, index) }, stage.name));
406
- }) })] }), stages.map(renderStageLabel), renderActiveBadge()] }), hasBottomSummary && renderSummary(), jsx(ChartTooltip, { active: !!tooltipData, position: tooltipData ? { x: tooltipData.x, y: tooltipData.y } : { x: 0, y: 0 }, tooltipRef: tooltipRef, content: tooltipData === null || tooltipData === void 0 ? void 0 : tooltipData.content })] }));
407
- };
408
- FunnelChart.displayName = "FunnelChart";
409
-
410
- export { FunnelChart };
@@ -1,2 +0,0 @@
1
- import { FunnelChartThemeOverrides } from './FunnelChart.types';
2
- export declare const funnelChartTheme: FunnelChartThemeOverrides;
@@ -1,12 +0,0 @@
1
- const funnelChartTheme = {
2
- baseStyle: 'relative inline-flex flex-col items-center',
3
- colors: [
4
- '#3b82f6', // blue
5
- '#10b981', // emerald
6
- '#f59e0b', // amber
7
- '#ef4444', // red
8
- '#8b5cf6', // violet
9
- ],
10
- };
11
-
12
- export { funnelChartTheme };
@@ -1,105 +0,0 @@
1
- import React from 'react';
2
- /**
3
- * Data point for FunnelChart
4
- */
5
- export interface FunnelChartDataPoint {
6
- /** Stage name */
7
- name: string;
8
- /** Value at this stage */
9
- value: number;
10
- /** Optional custom color */
11
- color?: string;
12
- }
13
- /**
14
- * Theme overrides for FunnelChart
15
- */
16
- export interface FunnelChartThemeOverrides {
17
- baseStyle?: string;
18
- colors?: string[];
19
- }
20
- /**
21
- * Point helper for curve calculations
22
- */
23
- export interface FunnelChartPoint {
24
- x: number;
25
- y: number;
26
- }
27
- /**
28
- * Tooltip data for funnel stage
29
- */
30
- export interface FunnelTooltipData {
31
- stage: FunnelChartDataPoint;
32
- index: number;
33
- percentage: number;
34
- dropoff: number;
35
- conversionRate: number;
36
- usersLost: number;
37
- }
38
- /**
39
- * Label position options
40
- */
41
- export type FunnelLabelPosition = 'top' | 'bottom' | 'inside' | 'tooltip-only';
42
- /**
43
- * Summary box position options
44
- */
45
- export type FunnelSummaryPosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'none';
46
- /**
47
- * FunnelChart props
48
- */
49
- export interface FunnelChartProps extends React.HTMLAttributes<HTMLDivElement> {
50
- /** Funnel stages data */
51
- data: FunnelChartDataPoint[];
52
- /** Height of the chart */
53
- height?: number | string;
54
- /** Width of the chart */
55
- width?: number | string;
56
- /** Whether to show percentages */
57
- showPercentages?: boolean;
58
- /** Whether to show values */
59
- showValues?: boolean;
60
- /** Whether to show stage labels (name) */
61
- showLabels?: boolean;
62
- /** Whether to show dropoff percentages between stages */
63
- showDropoff?: boolean;
64
- /** Whether to show conversion rates between stages */
65
- showConversionRate?: boolean;
66
- /** Whether to show summary statistics */
67
- showSummary?: boolean;
68
- /** Custom colors */
69
- colors?: string[];
70
- /** Orientation of the funnel */
71
- orientation?: 'vertical' | 'horizontal';
72
- /** Whether to curve segment edges (horizontal only) */
73
- curved?: boolean;
74
- /** Whether to use gradient fills */
75
- useGradient?: boolean;
76
- /** Fill opacity when gradients are disabled or for gradient stops */
77
- fillOpacity?: number;
78
- /** Theme overrides */
79
- theme?: FunnelChartThemeOverrides;
80
- /** Additional className */
81
- className?: string;
82
- /** Callback when a stage is clicked */
83
- onStageClick?: (stage: FunnelChartDataPoint, index: number) => void;
84
- /** Format function for values */
85
- formatValue?: (value: number) => string;
86
- /** Position of stage labels */
87
- labelPosition?: FunnelLabelPosition;
88
- /** Position of summary statistics box */
89
- summaryPosition?: FunnelSummaryPosition;
90
- /** Whether to animate on mount */
91
- animate?: boolean;
92
- /** Callback when a stage receives keyboard focus */
93
- onStageFocus?: (stage: FunnelChartDataPoint, index: number) => void;
94
- }
95
- /**
96
- * Internal stage data with computed values
97
- */
98
- export interface ComputedFunnelStage extends FunnelChartDataPoint {
99
- percentage: number;
100
- dropoff: number;
101
- conversionRate: number;
102
- usersLost: number;
103
- opacity: number;
104
- gradientId: string;
105
- }
@@ -1,4 +0,0 @@
1
- export { FunnelChart } from './FunnelChart';
2
- export type { FunnelChartProps, FunnelChartDataPoint, FunnelChartThemeOverrides, FunnelLabelPosition, FunnelSummaryPosition, ComputedFunnelStage, } from './FunnelChart.types';
3
- export { funnelChartTheme } from './FunnelChart.theme';
4
- export { segmentVariants, verticalSegmentVariants, labelVariants, badgeVariants, summaryVariants, funnelAnimationDefaults, } from './FunnelChart.animations';
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import type { ScatterPlotProps } from './ScatterPlot.types';
3
- /**
4
- * ScatterPlot Component
5
- *
6
- * Displays correlation between two variables with optional bubble sizing.
7
- * Now uses shared axis components with tick marks and value labels like other charts.
8
- */
9
- export declare const ScatterPlot: React.FC<ScatterPlotProps>;