@misoto22/folio 0.0.0 → 0.16.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 (686) hide show
  1. package/AGENTS.md +88 -0
  2. package/CLAUDE.md +1 -0
  3. package/LICENSE +21 -0
  4. package/README.md +208 -2
  5. package/bin/folio-design.mjs +277 -0
  6. package/bin/migrate-legacy.mjs +81 -0
  7. package/dist/agent/Accordion.md +65 -0
  8. package/dist/agent/Actions.md +49 -0
  9. package/dist/agent/Alert.md +65 -0
  10. package/dist/agent/AppShell.md +69 -0
  11. package/dist/agent/ArchitectureFigure.md +72 -0
  12. package/dist/agent/AreaChart.md +94 -0
  13. package/dist/agent/Article.md +65 -0
  14. package/dist/agent/AspectRatio.md +58 -0
  15. package/dist/agent/Avatar.md +53 -0
  16. package/dist/agent/Badge.md +62 -0
  17. package/dist/agent/BarChart.md +93 -0
  18. package/dist/agent/BarList.md +67 -0
  19. package/dist/agent/BigNumber.md +70 -0
  20. package/dist/agent/BoxPlot.md +82 -0
  21. package/dist/agent/Breadcrumb.md +55 -0
  22. package/dist/agent/BulletChart.md +71 -0
  23. package/dist/agent/Button.md +81 -0
  24. package/dist/agent/Calendar.md +77 -0
  25. package/dist/agent/CalendarHeatmap.md +75 -0
  26. package/dist/agent/Card.md +72 -0
  27. package/dist/agent/Checkbox.md +57 -0
  28. package/dist/agent/Code.md +51 -0
  29. package/dist/agent/CodeBlock.md +77 -0
  30. package/dist/agent/Collapsible.md +68 -0
  31. package/dist/agent/Collection.md +169 -0
  32. package/dist/agent/ColorPicker.md +76 -0
  33. package/dist/agent/Combobox.md +77 -0
  34. package/dist/agent/Command.md +122 -0
  35. package/dist/agent/ComposedChart.md +82 -0
  36. package/dist/agent/Contact.md +90 -0
  37. package/dist/agent/Content.md +70 -0
  38. package/dist/agent/ContextMenu.md +93 -0
  39. package/dist/agent/Conversation.md +247 -0
  40. package/dist/agent/DataflowFigure.md +49 -0
  41. package/dist/agent/DatePicker.md +104 -0
  42. package/dist/agent/DescriptionList.md +69 -0
  43. package/dist/agent/Diagram.md +71 -0
  44. package/dist/agent/DiagramCanvas.md +71 -0
  45. package/dist/agent/DiagramExportMenu.md +65 -0
  46. package/dist/agent/DiagramInspector.md +73 -0
  47. package/dist/agent/DiagramLegend.md +56 -0
  48. package/dist/agent/DiagramMinimap.md +69 -0
  49. package/dist/agent/DiagramToolbar.md +70 -0
  50. package/dist/agent/Dialog.md +76 -0
  51. package/dist/agent/DropdownMenu.md +110 -0
  52. package/dist/agent/EmptyState.md +63 -0
  53. package/dist/agent/ErrorState.md +67 -0
  54. package/dist/agent/Evidence.md +165 -0
  55. package/dist/agent/Facet.md +107 -0
  56. package/dist/agent/Field.md +79 -0
  57. package/dist/agent/FigureBand.md +49 -0
  58. package/dist/agent/FloatingIconButton.md +61 -0
  59. package/dist/agent/FunnelChart.md +75 -0
  60. package/dist/agent/Heading.md +65 -0
  61. package/dist/agent/Heatmap.md +78 -0
  62. package/dist/agent/Histogram.md +88 -0
  63. package/dist/agent/Input.md +52 -0
  64. package/dist/agent/Kbd.md +48 -0
  65. package/dist/agent/LifecycleFigure.md +50 -0
  66. package/dist/agent/LineChart.md +85 -0
  67. package/dist/agent/LinkArrow.md +49 -0
  68. package/dist/agent/Markdown.md +69 -0
  69. package/dist/agent/Media.md +261 -0
  70. package/dist/agent/Metric.md +70 -0
  71. package/dist/agent/Metrics.md +114 -0
  72. package/dist/agent/Music.md +86 -0
  73. package/dist/agent/NativeSelect.md +62 -0
  74. package/dist/agent/NavItem.md +56 -0
  75. package/dist/agent/NumberField.md +73 -0
  76. package/dist/agent/PageHeader.md +69 -0
  77. package/dist/agent/Pagination.md +70 -0
  78. package/dist/agent/PieChart.md +80 -0
  79. package/dist/agent/Popover.md +80 -0
  80. package/dist/agent/Portfolio.md +93 -0
  81. package/dist/agent/PortfolioIndex.md +34 -0
  82. package/dist/agent/Progress.md +58 -0
  83. package/dist/agent/RadarChart.md +79 -0
  84. package/dist/agent/RadialChart.md +81 -0
  85. package/dist/agent/RadioGroup.md +66 -0
  86. package/dist/agent/Reading.md +233 -0
  87. package/dist/agent/Recovery.md +72 -0
  88. package/dist/agent/SankeyChart.md +85 -0
  89. package/dist/agent/ScatterChart.md +80 -0
  90. package/dist/agent/ScrollArea.md +62 -0
  91. package/dist/agent/SearchPalette.md +51 -0
  92. package/dist/agent/SearchableMenu.md +69 -0
  93. package/dist/agent/Select.md +102 -0
  94. package/dist/agent/Separator.md +60 -0
  95. package/dist/agent/SequenceFigure.md +51 -0
  96. package/dist/agent/Sheet.md +82 -0
  97. package/dist/agent/Sidebar.md +194 -0
  98. package/dist/agent/SiteNavigation.md +62 -0
  99. package/dist/agent/SiteShell.md +67 -0
  100. package/dist/agent/Skeleton.md +96 -0
  101. package/dist/agent/Slider.md +67 -0
  102. package/dist/agent/Sparkline.md +68 -0
  103. package/dist/agent/Spinner.md +62 -0
  104. package/dist/agent/StatusDot.md +56 -0
  105. package/dist/agent/StatusPill.md +55 -0
  106. package/dist/agent/Steps.md +68 -0
  107. package/dist/agent/Switch.md +50 -0
  108. package/dist/agent/Table.md +111 -0
  109. package/dist/agent/Tabs.md +71 -0
  110. package/dist/agent/Tag.md +67 -0
  111. package/dist/agent/Text.md +66 -0
  112. package/dist/agent/Textarea.md +46 -0
  113. package/dist/agent/Timeline.md +114 -0
  114. package/dist/agent/Timestamp.md +65 -0
  115. package/dist/agent/Toast.md +51 -0
  116. package/dist/agent/ToggleGroup.md +67 -0
  117. package/dist/agent/Toolbar.md +72 -0
  118. package/dist/agent/Tooltip.md +74 -0
  119. package/dist/agent/TreemapChart.md +76 -0
  120. package/dist/agent/WaterfallChart.md +86 -0
  121. package/dist/agent/WorkflowFigure.md +51 -0
  122. package/dist/agent/catalog.json +8006 -0
  123. package/dist/agent/index.md +182 -0
  124. package/dist/article.css +407 -0
  125. package/dist/charts/AreaChart/AreaChart.d.ts +198 -0
  126. package/dist/charts/AreaChart/AreaChart.js +479 -0
  127. package/dist/charts/AreaChart/AreaChart.js.map +1 -0
  128. package/dist/charts/BarChart/BarChart.d.ts +190 -0
  129. package/dist/charts/BarChart/BarChart.js +599 -0
  130. package/dist/charts/BarChart/BarChart.js.map +1 -0
  131. package/dist/charts/BarList/BarList.d.ts +65 -0
  132. package/dist/charts/BarList/BarList.js +79 -0
  133. package/dist/charts/BarList/BarList.js.map +1 -0
  134. package/dist/charts/BigNumber/BigNumber.d.ts +72 -0
  135. package/dist/charts/BigNumber/BigNumber.js +51 -0
  136. package/dist/charts/BigNumber/BigNumber.js.map +1 -0
  137. package/dist/charts/BoxPlot/BoxPlot.d.ts +177 -0
  138. package/dist/charts/BoxPlot/BoxPlot.js +497 -0
  139. package/dist/charts/BoxPlot/BoxPlot.js.map +1 -0
  140. package/dist/charts/BulletChart/BulletChart.d.ts +100 -0
  141. package/dist/charts/BulletChart/BulletChart.js +197 -0
  142. package/dist/charts/BulletChart/BulletChart.js.map +1 -0
  143. package/dist/charts/CalendarHeatmap/CalendarHeatmap.d.ts +106 -0
  144. package/dist/charts/CalendarHeatmap/CalendarHeatmap.js +103 -0
  145. package/dist/charts/CalendarHeatmap/CalendarHeatmap.js.map +1 -0
  146. package/dist/charts/ComposedChart/ComposedChart.d.ts +178 -0
  147. package/dist/charts/ComposedChart/ComposedChart.js +667 -0
  148. package/dist/charts/ComposedChart/ComposedChart.js.map +1 -0
  149. package/dist/charts/Facet/Facet.d.ts +240 -0
  150. package/dist/charts/Facet/Facet.js +133 -0
  151. package/dist/charts/Facet/Facet.js.map +1 -0
  152. package/dist/charts/Facet/panels.d.ts +187 -0
  153. package/dist/charts/Facet/panels.js +203 -0
  154. package/dist/charts/Facet/panels.js.map +1 -0
  155. package/dist/charts/FunnelChart/FunnelChart.d.ts +106 -0
  156. package/dist/charts/FunnelChart/FunnelChart.js +137 -0
  157. package/dist/charts/FunnelChart/FunnelChart.js.map +1 -0
  158. package/dist/charts/Heatmap/Heatmap.d.ts +101 -0
  159. package/dist/charts/Heatmap/Heatmap.js +125 -0
  160. package/dist/charts/Heatmap/Heatmap.js.map +1 -0
  161. package/dist/charts/Histogram/Histogram.d.ts +188 -0
  162. package/dist/charts/Histogram/Histogram.js +382 -0
  163. package/dist/charts/Histogram/Histogram.js.map +1 -0
  164. package/dist/charts/LineChart/LineChart.d.ts +174 -0
  165. package/dist/charts/LineChart/LineChart.js +485 -0
  166. package/dist/charts/LineChart/LineChart.js.map +1 -0
  167. package/dist/charts/PieChart/PieChart.d.ts +140 -0
  168. package/dist/charts/PieChart/PieChart.js +317 -0
  169. package/dist/charts/PieChart/PieChart.js.map +1 -0
  170. package/dist/charts/RadarChart/RadarChart.d.ts +135 -0
  171. package/dist/charts/RadarChart/RadarChart.js +303 -0
  172. package/dist/charts/RadarChart/RadarChart.js.map +1 -0
  173. package/dist/charts/RadialChart/RadialChart.d.ts +142 -0
  174. package/dist/charts/RadialChart/RadialChart.js +279 -0
  175. package/dist/charts/RadialChart/RadialChart.js.map +1 -0
  176. package/dist/charts/SankeyChart/SankeyChart.d.ts +149 -0
  177. package/dist/charts/SankeyChart/SankeyChart.js +509 -0
  178. package/dist/charts/SankeyChart/SankeyChart.js.map +1 -0
  179. package/dist/charts/ScatterChart/ScatterChart.d.ts +149 -0
  180. package/dist/charts/ScatterChart/ScatterChart.js +275 -0
  181. package/dist/charts/ScatterChart/ScatterChart.js.map +1 -0
  182. package/dist/charts/Sparkline/Sparkline.d.ts +53 -0
  183. package/dist/charts/Sparkline/Sparkline.js +95 -0
  184. package/dist/charts/Sparkline/Sparkline.js.map +1 -0
  185. package/dist/charts/TreemapChart/TreemapChart.d.ts +98 -0
  186. package/dist/charts/TreemapChart/TreemapChart.js +127 -0
  187. package/dist/charts/TreemapChart/TreemapChart.js.map +1 -0
  188. package/dist/charts/WaterfallChart/WaterfallChart.d.ts +164 -0
  189. package/dist/charts/WaterfallChart/WaterfallChart.js +321 -0
  190. package/dist/charts/WaterfallChart/WaterfallChart.js.map +1 -0
  191. package/dist/charts/index.d.ts +43 -0
  192. package/dist/charts/index.js +130 -0
  193. package/dist/charts/index.js.map +1 -0
  194. package/dist/charts/lib/annotations.d.ts +103 -0
  195. package/dist/charts/lib/annotations.js +99 -0
  196. package/dist/charts/lib/annotations.js.map +1 -0
  197. package/dist/charts/lib/axis.d.ts +18 -0
  198. package/dist/charts/lib/axis.js +21 -0
  199. package/dist/charts/lib/axis.js.map +1 -0
  200. package/dist/charts/lib/background.d.ts +33 -0
  201. package/dist/charts/lib/background.js +173 -0
  202. package/dist/charts/lib/background.js.map +1 -0
  203. package/dist/charts/lib/brush.d.ts +94 -0
  204. package/dist/charts/lib/brush.js +535 -0
  205. package/dist/charts/lib/brush.js.map +1 -0
  206. package/dist/charts/lib/chart.d.ts +94 -0
  207. package/dist/charts/lib/chart.js +149 -0
  208. package/dist/charts/lib/chart.js.map +1 -0
  209. package/dist/charts/lib/dot.d.ts +29 -0
  210. package/dist/charts/lib/dot.js +78 -0
  211. package/dist/charts/lib/dot.js.map +1 -0
  212. package/dist/charts/lib/empty.d.ts +31 -0
  213. package/dist/charts/lib/empty.js +24 -0
  214. package/dist/charts/lib/empty.js.map +1 -0
  215. package/dist/charts/lib/export.d.ts +94 -0
  216. package/dist/charts/lib/export.js +62 -0
  217. package/dist/charts/lib/export.js.map +1 -0
  218. package/dist/charts/lib/figure.d.ts +81 -0
  219. package/dist/charts/lib/figure.js +62 -0
  220. package/dist/charts/lib/figure.js.map +1 -0
  221. package/dist/charts/lib/format.d.ts +46 -0
  222. package/dist/charts/lib/format.js +56 -0
  223. package/dist/charts/lib/format.js.map +1 -0
  224. package/dist/charts/lib/legend.d.ts +45 -0
  225. package/dist/charts/lib/legend.js +117 -0
  226. package/dist/charts/lib/legend.js.map +1 -0
  227. package/dist/charts/lib/loading.d.ts +48 -0
  228. package/dist/charts/lib/loading.js +105 -0
  229. package/dist/charts/lib/loading.js.map +1 -0
  230. package/dist/charts/lib/paint.d.ts +154 -0
  231. package/dist/charts/lib/paint.js +551 -0
  232. package/dist/charts/lib/paint.js.map +1 -0
  233. package/dist/charts/lib/scale.d.ts +23 -0
  234. package/dist/charts/lib/scale.js +13 -0
  235. package/dist/charts/lib/scale.js.map +1 -0
  236. package/dist/charts/lib/selection.d.ts +20 -0
  237. package/dist/charts/lib/selection.js +18 -0
  238. package/dist/charts/lib/selection.js.map +1 -0
  239. package/dist/charts/lib/sonify-control.d.ts +163 -0
  240. package/dist/charts/lib/sonify-control.js +172 -0
  241. package/dist/charts/lib/sonify-control.js.map +1 -0
  242. package/dist/charts/lib/sonify.d.ts +248 -0
  243. package/dist/charts/lib/sonify.js +262 -0
  244. package/dist/charts/lib/sonify.js.map +1 -0
  245. package/dist/charts/lib/toolbar.d.ts +144 -0
  246. package/dist/charts/lib/toolbar.js +156 -0
  247. package/dist/charts/lib/toolbar.js.map +1 -0
  248. package/dist/charts/lib/tooltip.d.ts +59 -0
  249. package/dist/charts/lib/tooltip.js +135 -0
  250. package/dist/charts/lib/tooltip.js.map +1 -0
  251. package/dist/charts/lib/values.d.ts +56 -0
  252. package/dist/charts/lib/values.js +71 -0
  253. package/dist/charts/lib/values.js.map +1 -0
  254. package/dist/charts/lib/zoom.d.ts +139 -0
  255. package/dist/charts/lib/zoom.js +314 -0
  256. package/dist/charts/lib/zoom.js.map +1 -0
  257. package/dist/components/Accordion/Accordion.d.ts +34 -0
  258. package/dist/components/Accordion/Accordion.js +43 -0
  259. package/dist/components/Accordion/Accordion.js.map +1 -0
  260. package/dist/components/Alert/Alert.d.ts +32 -0
  261. package/dist/components/Alert/Alert.js +49 -0
  262. package/dist/components/Alert/Alert.js.map +1 -0
  263. package/dist/components/AppShell/AppShell.d.ts +58 -0
  264. package/dist/components/AppShell/AppShell.js +126 -0
  265. package/dist/components/AppShell/AppShell.js.map +1 -0
  266. package/dist/components/Article/Article.d.ts +58 -0
  267. package/dist/components/Article/Article.js +34 -0
  268. package/dist/components/Article/Article.js.map +1 -0
  269. package/dist/components/AspectRatio/AspectRatio.d.ts +46 -0
  270. package/dist/components/AspectRatio/AspectRatio.js +33 -0
  271. package/dist/components/AspectRatio/AspectRatio.js.map +1 -0
  272. package/dist/components/Avatar/Avatar.d.ts +38 -0
  273. package/dist/components/Avatar/Avatar.js +44 -0
  274. package/dist/components/Avatar/Avatar.js.map +1 -0
  275. package/dist/components/Badge/Badge.d.ts +30 -0
  276. package/dist/components/Badge/Badge.js +29 -0
  277. package/dist/components/Badge/Badge.js.map +1 -0
  278. package/dist/components/Breadcrumb/Breadcrumb.d.ts +37 -0
  279. package/dist/components/Breadcrumb/Breadcrumb.js +46 -0
  280. package/dist/components/Breadcrumb/Breadcrumb.js.map +1 -0
  281. package/dist/components/Button/Button.d.ts +70 -0
  282. package/dist/components/Button/Button.js +95 -0
  283. package/dist/components/Button/Button.js.map +1 -0
  284. package/dist/components/Calendar/Calendar.d.ts +54 -0
  285. package/dist/components/Calendar/Calendar.js +369 -0
  286. package/dist/components/Calendar/Calendar.js.map +1 -0
  287. package/dist/components/Card/Card.d.ts +55 -0
  288. package/dist/components/Card/Card.js +64 -0
  289. package/dist/components/Card/Card.js.map +1 -0
  290. package/dist/components/Checkbox/Checkbox.d.ts +26 -0
  291. package/dist/components/Checkbox/Checkbox.js +34 -0
  292. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  293. package/dist/components/Code/Code.d.ts +30 -0
  294. package/dist/components/Code/Code.js +21 -0
  295. package/dist/components/Code/Code.js.map +1 -0
  296. package/dist/components/CodeBlock/CodeBlock.d.ts +145 -0
  297. package/dist/components/CodeBlock/CodeBlock.js +114 -0
  298. package/dist/components/CodeBlock/CodeBlock.js.map +1 -0
  299. package/dist/components/Collapsible/Collapsible.d.ts +45 -0
  300. package/dist/components/Collapsible/Collapsible.js +60 -0
  301. package/dist/components/Collapsible/Collapsible.js.map +1 -0
  302. package/dist/components/ColorPicker/ColorPicker.d.ts +67 -0
  303. package/dist/components/ColorPicker/ColorPicker.js +334 -0
  304. package/dist/components/ColorPicker/ColorPicker.js.map +1 -0
  305. package/dist/components/Combobox/Combobox.d.ts +77 -0
  306. package/dist/components/Combobox/Combobox.js +170 -0
  307. package/dist/components/Combobox/Combobox.js.map +1 -0
  308. package/dist/components/Command/Command.d.ts +125 -0
  309. package/dist/components/Command/Command.js +204 -0
  310. package/dist/components/Command/Command.js.map +1 -0
  311. package/dist/components/ContextMenu/ContextMenu.d.ts +63 -0
  312. package/dist/components/ContextMenu/ContextMenu.js +109 -0
  313. package/dist/components/ContextMenu/ContextMenu.js.map +1 -0
  314. package/dist/components/DatePicker/DatePicker.d.ts +130 -0
  315. package/dist/components/DatePicker/DatePicker.js +257 -0
  316. package/dist/components/DatePicker/DatePicker.js.map +1 -0
  317. package/dist/components/DescriptionList/DescriptionList.d.ts +73 -0
  318. package/dist/components/DescriptionList/DescriptionList.js +35 -0
  319. package/dist/components/DescriptionList/DescriptionList.js.map +1 -0
  320. package/dist/components/Diagram/Diagram.d.ts +86 -0
  321. package/dist/components/Diagram/Diagram.js +211 -0
  322. package/dist/components/Diagram/Diagram.js.map +1 -0
  323. package/dist/components/Dialog/Dialog.d.ts +63 -0
  324. package/dist/components/Dialog/Dialog.js +90 -0
  325. package/dist/components/Dialog/Dialog.js.map +1 -0
  326. package/dist/components/DropdownMenu/DropdownMenu.d.ts +87 -0
  327. package/dist/components/DropdownMenu/DropdownMenu.js +120 -0
  328. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
  329. package/dist/components/EmptyState/EmptyState.d.ts +55 -0
  330. package/dist/components/EmptyState/EmptyState.js +32 -0
  331. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  332. package/dist/components/ErrorState/ErrorState.d.ts +55 -0
  333. package/dist/components/ErrorState/ErrorState.js +41 -0
  334. package/dist/components/ErrorState/ErrorState.js.map +1 -0
  335. package/dist/components/Field/Field.d.ts +111 -0
  336. package/dist/components/Field/Field.js +95 -0
  337. package/dist/components/Field/Field.js.map +1 -0
  338. package/dist/components/Field/field-control.d.ts +31 -0
  339. package/dist/components/Field/field-control.js +12 -0
  340. package/dist/components/Field/field-control.js.map +1 -0
  341. package/dist/components/FigureBand/FigureBand.d.ts +31 -0
  342. package/dist/components/FigureBand/FigureBand.js +51 -0
  343. package/dist/components/FigureBand/FigureBand.js.map +1 -0
  344. package/dist/components/FloatingIconButton/FloatingIconButton.d.ts +29 -0
  345. package/dist/components/FloatingIconButton/FloatingIconButton.js +34 -0
  346. package/dist/components/FloatingIconButton/FloatingIconButton.js.map +1 -0
  347. package/dist/components/Heading/Heading.d.ts +62 -0
  348. package/dist/components/Heading/Heading.js +44 -0
  349. package/dist/components/Heading/Heading.js.map +1 -0
  350. package/dist/components/Input/Input.d.ts +22 -0
  351. package/dist/components/Input/Input.js +21 -0
  352. package/dist/components/Input/Input.js.map +1 -0
  353. package/dist/components/Kbd/Kbd.d.ts +27 -0
  354. package/dist/components/Kbd/Kbd.js +21 -0
  355. package/dist/components/Kbd/Kbd.js.map +1 -0
  356. package/dist/components/LinkArrow/LinkArrow.d.ts +24 -0
  357. package/dist/components/LinkArrow/LinkArrow.js +24 -0
  358. package/dist/components/LinkArrow/LinkArrow.js.map +1 -0
  359. package/dist/components/Markdown/Markdown.d.ts +139 -0
  360. package/dist/components/Markdown/Markdown.js +135 -0
  361. package/dist/components/Markdown/Markdown.js.map +1 -0
  362. package/dist/components/Markdown/inline.d.ts +29 -0
  363. package/dist/components/Markdown/inline.js +74 -0
  364. package/dist/components/Markdown/inline.js.map +1 -0
  365. package/dist/components/Markdown/nodes.d.ts +65 -0
  366. package/dist/components/Markdown/nodes.js +1 -0
  367. package/dist/components/Markdown/nodes.js.map +1 -0
  368. package/dist/components/Markdown/parse.d.ts +24 -0
  369. package/dist/components/Markdown/parse.js +110 -0
  370. package/dist/components/Markdown/parse.js.map +1 -0
  371. package/dist/components/Markdown/slug.d.ts +15 -0
  372. package/dist/components/Markdown/slug.js +7 -0
  373. package/dist/components/Markdown/slug.js.map +1 -0
  374. package/dist/components/Metric/Metric.d.ts +61 -0
  375. package/dist/components/Metric/Metric.js +51 -0
  376. package/dist/components/Metric/Metric.js.map +1 -0
  377. package/dist/components/NativeSelect/NativeSelect.d.ts +33 -0
  378. package/dist/components/NativeSelect/NativeSelect.js +44 -0
  379. package/dist/components/NativeSelect/NativeSelect.js.map +1 -0
  380. package/dist/components/NavItem/NavItem.d.ts +39 -0
  381. package/dist/components/NavItem/NavItem.js +31 -0
  382. package/dist/components/NavItem/NavItem.js.map +1 -0
  383. package/dist/components/NumberField/NumberField.d.ts +69 -0
  384. package/dist/components/NumberField/NumberField.js +162 -0
  385. package/dist/components/NumberField/NumberField.js.map +1 -0
  386. package/dist/components/PageHeader/PageHeader.d.ts +92 -0
  387. package/dist/components/PageHeader/PageHeader.js +37 -0
  388. package/dist/components/PageHeader/PageHeader.js.map +1 -0
  389. package/dist/components/Pagination/Pagination.d.ts +67 -0
  390. package/dist/components/Pagination/Pagination.js +112 -0
  391. package/dist/components/Pagination/Pagination.js.map +1 -0
  392. package/dist/components/Popover/Popover.d.ts +39 -0
  393. package/dist/components/Popover/Popover.js +57 -0
  394. package/dist/components/Popover/Popover.js.map +1 -0
  395. package/dist/components/Progress/Progress.d.ts +43 -0
  396. package/dist/components/Progress/Progress.js +57 -0
  397. package/dist/components/Progress/Progress.js.map +1 -0
  398. package/dist/components/RadioGroup/RadioGroup.d.ts +49 -0
  399. package/dist/components/RadioGroup/RadioGroup.js +53 -0
  400. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  401. package/dist/components/ScrollArea/ScrollArea.d.ts +46 -0
  402. package/dist/components/ScrollArea/ScrollArea.js +54 -0
  403. package/dist/components/ScrollArea/ScrollArea.js.map +1 -0
  404. package/dist/components/SearchableMenu/SearchableMenu.d.ts +68 -0
  405. package/dist/components/SearchableMenu/SearchableMenu.js +101 -0
  406. package/dist/components/SearchableMenu/SearchableMenu.js.map +1 -0
  407. package/dist/components/Select/Select.d.ts +87 -0
  408. package/dist/components/Select/Select.js +130 -0
  409. package/dist/components/Select/Select.js.map +1 -0
  410. package/dist/components/Separator/Separator.d.ts +48 -0
  411. package/dist/components/Separator/Separator.js +43 -0
  412. package/dist/components/Separator/Separator.js.map +1 -0
  413. package/dist/components/Sheet/Sheet.d.ts +43 -0
  414. package/dist/components/Sheet/Sheet.js +79 -0
  415. package/dist/components/Sheet/Sheet.js.map +1 -0
  416. package/dist/components/Sidebar/Sidebar.d.ts +357 -0
  417. package/dist/components/Sidebar/Sidebar.js +447 -0
  418. package/dist/components/Sidebar/Sidebar.js.map +1 -0
  419. package/dist/components/Skeleton/Skeleton.d.ts +70 -0
  420. package/dist/components/Skeleton/Skeleton.js +44 -0
  421. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  422. package/dist/components/Slider/Slider.d.ts +74 -0
  423. package/dist/components/Slider/Slider.js +143 -0
  424. package/dist/components/Slider/Slider.js.map +1 -0
  425. package/dist/components/Spinner/Spinner.d.ts +58 -0
  426. package/dist/components/Spinner/Spinner.js +49 -0
  427. package/dist/components/Spinner/Spinner.js.map +1 -0
  428. package/dist/components/StatusDot/StatusDot.d.ts +29 -0
  429. package/dist/components/StatusDot/StatusDot.js +44 -0
  430. package/dist/components/StatusDot/StatusDot.js.map +1 -0
  431. package/dist/components/StatusPill/StatusPill.d.ts +30 -0
  432. package/dist/components/StatusPill/StatusPill.js +37 -0
  433. package/dist/components/StatusPill/StatusPill.js.map +1 -0
  434. package/dist/components/Steps/Steps.d.ts +65 -0
  435. package/dist/components/Steps/Steps.js +25 -0
  436. package/dist/components/Steps/Steps.js.map +1 -0
  437. package/dist/components/Switch/Switch.d.ts +23 -0
  438. package/dist/components/Switch/Switch.js +23 -0
  439. package/dist/components/Switch/Switch.js.map +1 -0
  440. package/dist/components/Table/Table.d.ts +116 -0
  441. package/dist/components/Table/Table.js +137 -0
  442. package/dist/components/Table/Table.js.map +1 -0
  443. package/dist/components/Tabs/Tabs.d.ts +37 -0
  444. package/dist/components/Tabs/Tabs.js +205 -0
  445. package/dist/components/Tabs/Tabs.js.map +1 -0
  446. package/dist/components/Tag/Tag.d.ts +87 -0
  447. package/dist/components/Tag/Tag.js +62 -0
  448. package/dist/components/Tag/Tag.js.map +1 -0
  449. package/dist/components/Text/Text.d.ts +62 -0
  450. package/dist/components/Text/Text.js +30 -0
  451. package/dist/components/Text/Text.js.map +1 -0
  452. package/dist/components/Textarea/Textarea.d.ts +20 -0
  453. package/dist/components/Textarea/Textarea.js +32 -0
  454. package/dist/components/Textarea/Textarea.js.map +1 -0
  455. package/dist/components/Timestamp/Timestamp.d.ts +59 -0
  456. package/dist/components/Timestamp/Timestamp.js +56 -0
  457. package/dist/components/Timestamp/Timestamp.js.map +1 -0
  458. package/dist/components/Toast/Toast.d.ts +32 -0
  459. package/dist/components/Toast/Toast.js +64 -0
  460. package/dist/components/Toast/Toast.js.map +1 -0
  461. package/dist/components/ToggleGroup/ToggleGroup.d.ts +46 -0
  462. package/dist/components/ToggleGroup/ToggleGroup.js +88 -0
  463. package/dist/components/ToggleGroup/ToggleGroup.js.map +1 -0
  464. package/dist/components/Toolbar/Toolbar.d.ts +55 -0
  465. package/dist/components/Toolbar/Toolbar.js +43 -0
  466. package/dist/components/Toolbar/Toolbar.js.map +1 -0
  467. package/dist/components/Tooltip/Tooltip.d.ts +43 -0
  468. package/dist/components/Tooltip/Tooltip.js +40 -0
  469. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  470. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.d.ts +55 -0
  471. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js +175 -0
  472. package/dist/diagrams/ArchitectureFigure/ArchitectureFigure.js.map +1 -0
  473. package/dist/diagrams/DataflowFigure/DataflowFigure.d.ts +28 -0
  474. package/dist/diagrams/DataflowFigure/DataflowFigure.js +148 -0
  475. package/dist/diagrams/DataflowFigure/DataflowFigure.js.map +1 -0
  476. package/dist/diagrams/DiagramCanvas/DiagramCanvas.d.ts +78 -0
  477. package/dist/diagrams/DiagramCanvas/DiagramCanvas.js +229 -0
  478. package/dist/diagrams/DiagramCanvas/DiagramCanvas.js.map +1 -0
  479. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.d.ts +106 -0
  480. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js +123 -0
  481. package/dist/diagrams/DiagramExportMenu/DiagramExportMenu.js.map +1 -0
  482. package/dist/diagrams/DiagramInspector/DiagramInspector.d.ts +70 -0
  483. package/dist/diagrams/DiagramInspector/DiagramInspector.js +94 -0
  484. package/dist/diagrams/DiagramInspector/DiagramInspector.js.map +1 -0
  485. package/dist/diagrams/DiagramLegend/DiagramLegend.d.ts +42 -0
  486. package/dist/diagrams/DiagramLegend/DiagramLegend.js +35 -0
  487. package/dist/diagrams/DiagramLegend/DiagramLegend.js.map +1 -0
  488. package/dist/diagrams/DiagramMinimap/DiagramMinimap.d.ts +77 -0
  489. package/dist/diagrams/DiagramMinimap/DiagramMinimap.js +106 -0
  490. package/dist/diagrams/DiagramMinimap/DiagramMinimap.js.map +1 -0
  491. package/dist/diagrams/DiagramToolbar/DiagramToolbar.d.ts +48 -0
  492. package/dist/diagrams/DiagramToolbar/DiagramToolbar.js +53 -0
  493. package/dist/diagrams/DiagramToolbar/DiagramToolbar.js.map +1 -0
  494. package/dist/diagrams/LifecycleFigure/LifecycleFigure.d.ts +31 -0
  495. package/dist/diagrams/LifecycleFigure/LifecycleFigure.js +234 -0
  496. package/dist/diagrams/LifecycleFigure/LifecycleFigure.js.map +1 -0
  497. package/dist/diagrams/SequenceFigure/SequenceFigure.d.ts +38 -0
  498. package/dist/diagrams/SequenceFigure/SequenceFigure.js +261 -0
  499. package/dist/diagrams/SequenceFigure/SequenceFigure.js.map +1 -0
  500. package/dist/diagrams/WorkflowFigure/WorkflowFigure.d.ts +36 -0
  501. package/dist/diagrams/WorkflowFigure/WorkflowFigure.js +259 -0
  502. package/dist/diagrams/WorkflowFigure/WorkflowFigure.js.map +1 -0
  503. package/dist/diagrams/index.d.ts +17 -0
  504. package/dist/diagrams/index.js +29 -0
  505. package/dist/diagrams/index.js.map +1 -0
  506. package/dist/diagrams/lib/dev.d.ts +61 -0
  507. package/dist/diagrams/lib/dev.js +96 -0
  508. package/dist/diagrams/lib/dev.js.map +1 -0
  509. package/dist/diagrams/lib/frame.d.ts +138 -0
  510. package/dist/diagrams/lib/frame.js +131 -0
  511. package/dist/diagrams/lib/frame.js.map +1 -0
  512. package/dist/diagrams/lib/geometry.d.ts +114 -0
  513. package/dist/diagrams/lib/geometry.js +113 -0
  514. package/dist/diagrams/lib/geometry.js.map +1 -0
  515. package/dist/diagrams/lib/legend.d.ts +32 -0
  516. package/dist/diagrams/lib/legend.js +84 -0
  517. package/dist/diagrams/lib/legend.js.map +1 -0
  518. package/dist/diagrams/lib/marks.d.ts +207 -0
  519. package/dist/diagrams/lib/marks.js +480 -0
  520. package/dist/diagrams/lib/marks.js.map +1 -0
  521. package/dist/diagrams/lib/route.d.ts +106 -0
  522. package/dist/diagrams/lib/route.js +201 -0
  523. package/dist/diagrams/lib/route.js.map +1 -0
  524. package/dist/diagrams/lib/wires.d.ts +59 -0
  525. package/dist/diagrams/lib/wires.js +94 -0
  526. package/dist/diagrams/lib/wires.js.map +1 -0
  527. package/dist/diagrams/spec.d.ts +405 -0
  528. package/dist/diagrams/spec.js +1 -0
  529. package/dist/diagrams/spec.js.map +1 -0
  530. package/dist/fonts/hanken-grotesk-300.woff2 +0 -0
  531. package/dist/fonts/hanken-grotesk-400.woff2 +0 -0
  532. package/dist/fonts/hanken-grotesk-500.woff2 +0 -0
  533. package/dist/fonts/hanken-grotesk-600.woff2 +0 -0
  534. package/dist/fonts/hanken-grotesk-700.woff2 +0 -0
  535. package/dist/fonts/ibm-plex-mono-400.woff2 +0 -0
  536. package/dist/fonts/ibm-plex-mono-500.woff2 +0 -0
  537. package/dist/fonts/ibm-plex-mono-600.woff2 +0 -0
  538. package/dist/fonts/newsreader-300.woff2 +0 -0
  539. package/dist/fonts/newsreader-400.woff2 +0 -0
  540. package/dist/fonts/newsreader-500.woff2 +0 -0
  541. package/dist/fonts/newsreader-600.woff2 +0 -0
  542. package/dist/fonts.css +96 -0
  543. package/dist/index.d.ts +97 -0
  544. package/dist/index.js +80 -0
  545. package/dist/index.js.map +1 -0
  546. package/dist/keyframes.css +300 -0
  547. package/dist/lib/cn.d.ts +21 -0
  548. package/dist/lib/cn.js +9 -0
  549. package/dist/lib/cn.js.map +1 -0
  550. package/dist/lib/color.d.ts +80 -0
  551. package/dist/lib/color.js +189 -0
  552. package/dist/lib/color.js.map +1 -0
  553. package/dist/lib/control.d.ts +32 -0
  554. package/dist/lib/control.js +14 -0
  555. package/dist/lib/control.js.map +1 -0
  556. package/dist/lib/index.d.ts +4 -0
  557. package/dist/lib/index.js +11 -0
  558. package/dist/lib/index.js.map +1 -0
  559. package/dist/lib/numeric.d.ts +35 -0
  560. package/dist/lib/numeric.js +29 -0
  561. package/dist/lib/numeric.js.map +1 -0
  562. package/dist/lib/overlay-container.d.ts +48 -0
  563. package/dist/lib/overlay-container.js +15 -0
  564. package/dist/lib/overlay-container.js.map +1 -0
  565. package/dist/lib/slot-content.d.ts +8 -0
  566. package/dist/lib/slot-content.js +17 -0
  567. package/dist/lib/slot-content.js.map +1 -0
  568. package/dist/lib/step-rail.d.ts +45 -0
  569. package/dist/lib/step-rail.js +47 -0
  570. package/dist/lib/step-rail.js.map +1 -0
  571. package/dist/lib/svg-export.d.ts +138 -0
  572. package/dist/lib/svg-export.js +198 -0
  573. package/dist/lib/svg-export.js.map +1 -0
  574. package/dist/lib/useClipboardCopy.d.ts +30 -0
  575. package/dist/lib/useClipboardCopy.js +37 -0
  576. package/dist/lib/useClipboardCopy.js.map +1 -0
  577. package/dist/lib/useSelectionIndicator.d.ts +29 -0
  578. package/dist/lib/useSelectionIndicator.js +49 -0
  579. package/dist/lib/useSelectionIndicator.js.map +1 -0
  580. package/dist/lib/warn.d.ts +73 -0
  581. package/dist/lib/warn.js +38 -0
  582. package/dist/lib/warn.js.map +1 -0
  583. package/dist/semantic.css +193 -0
  584. package/dist/styles.css +98 -0
  585. package/dist/themes.css +514 -0
  586. package/dist/tokens/brand.d.ts +47 -0
  587. package/dist/tokens/brand.js +38 -0
  588. package/dist/tokens/brand.js.map +1 -0
  589. package/dist/tokens.css +652 -0
  590. package/dist/tokens.d.ts +198 -0
  591. package/dist/tokens.js +1020 -0
  592. package/dist/tokens.json +1019 -0
  593. package/dist/website/Actions/Actions.d.ts +34 -0
  594. package/dist/website/Actions/Actions.js +29 -0
  595. package/dist/website/Actions/Actions.js.map +1 -0
  596. package/dist/website/Collection/Collection.d.ts +128 -0
  597. package/dist/website/Collection/Collection.js +162 -0
  598. package/dist/website/Collection/Collection.js.map +1 -0
  599. package/dist/website/Contact/Contact.d.ts +87 -0
  600. package/dist/website/Contact/Contact.js +94 -0
  601. package/dist/website/Contact/Contact.js.map +1 -0
  602. package/dist/website/Content/CodePanel.d.ts +27 -0
  603. package/dist/website/Content/CodePanel.js +30 -0
  604. package/dist/website/Content/CodePanel.js.map +1 -0
  605. package/dist/website/Content/Content.d.ts +29 -0
  606. package/dist/website/Content/Content.js +38 -0
  607. package/dist/website/Content/Content.js.map +1 -0
  608. package/dist/website/Conversation/Conversation.d.ts +193 -0
  609. package/dist/website/Conversation/Conversation.js +252 -0
  610. package/dist/website/Conversation/Conversation.js.map +1 -0
  611. package/dist/website/Evidence/Evidence.d.ts +116 -0
  612. package/dist/website/Evidence/Evidence.js +142 -0
  613. package/dist/website/Evidence/Evidence.js.map +1 -0
  614. package/dist/website/Media/Media.d.ts +173 -0
  615. package/dist/website/Media/Media.js +225 -0
  616. package/dist/website/Media/Media.js.map +1 -0
  617. package/dist/website/Media/MediaLightbox.d.ts +18 -0
  618. package/dist/website/Media/MediaLightbox.js +38 -0
  619. package/dist/website/Media/MediaLightbox.js.map +1 -0
  620. package/dist/website/Metrics/Metrics.d.ts +74 -0
  621. package/dist/website/Metrics/Metrics.js +96 -0
  622. package/dist/website/Metrics/Metrics.js.map +1 -0
  623. package/dist/website/Music/Music.d.ts +60 -0
  624. package/dist/website/Music/Music.js +80 -0
  625. package/dist/website/Music/Music.js.map +1 -0
  626. package/dist/website/Portfolio/FrameLayout.d.ts +9 -0
  627. package/dist/website/Portfolio/FrameLayout.js +42 -0
  628. package/dist/website/Portfolio/FrameLayout.js.map +1 -0
  629. package/dist/website/Portfolio/Portfolio.d.ts +49 -0
  630. package/dist/website/Portfolio/Portfolio.js +66 -0
  631. package/dist/website/Portfolio/Portfolio.js.map +1 -0
  632. package/dist/website/Portfolio/QuestionCard.d.ts +22 -0
  633. package/dist/website/Portfolio/QuestionCard.js +33 -0
  634. package/dist/website/Portfolio/QuestionCard.js.map +1 -0
  635. package/dist/website/PortfolioIndex/PortfolioIndex.d.ts +21 -0
  636. package/dist/website/PortfolioIndex/PortfolioIndex.js +31 -0
  637. package/dist/website/PortfolioIndex/PortfolioIndex.js.map +1 -0
  638. package/dist/website/Reading/Reading.d.ts +203 -0
  639. package/dist/website/Reading/Reading.js +357 -0
  640. package/dist/website/Reading/Reading.js.map +1 -0
  641. package/dist/website/Recovery/Recovery.d.ts +39 -0
  642. package/dist/website/Recovery/Recovery.js +96 -0
  643. package/dist/website/Recovery/Recovery.js.map +1 -0
  644. package/dist/website/SearchPalette/SearchPalette.d.ts +59 -0
  645. package/dist/website/SearchPalette/SearchPalette.js +120 -0
  646. package/dist/website/SearchPalette/SearchPalette.js.map +1 -0
  647. package/dist/website/SiteNavigation/SiteNavigation.d.ts +46 -0
  648. package/dist/website/SiteNavigation/SiteNavigation.js +101 -0
  649. package/dist/website/SiteNavigation/SiteNavigation.js.map +1 -0
  650. package/dist/website/SiteShell/SiteShell.d.ts +45 -0
  651. package/dist/website/SiteShell/SiteShell.js +46 -0
  652. package/dist/website/SiteShell/SiteShell.js.map +1 -0
  653. package/dist/website/Timeline/Timeline.d.ts +80 -0
  654. package/dist/website/Timeline/Timeline.js +99 -0
  655. package/dist/website/Timeline/Timeline.js.map +1 -0
  656. package/dist/website/index.d.ts +27 -0
  657. package/dist/website/index.js +21 -0
  658. package/dist/website/index.js.map +1 -0
  659. package/dist/website-actions.css +6 -0
  660. package/dist/website-base.css +46 -0
  661. package/dist/website-collection.css +89 -0
  662. package/dist/website-contact.css +29 -0
  663. package/dist/website-content.css +17 -0
  664. package/dist/website-controls.css +91 -0
  665. package/dist/website-conversation.css +115 -0
  666. package/dist/website-evidence.css +56 -0
  667. package/dist/website-media.css +227 -0
  668. package/dist/website-metrics.css +15 -0
  669. package/dist/website-music.css +27 -0
  670. package/dist/website-portfolio.css +94 -0
  671. package/dist/website-reading.css +159 -0
  672. package/dist/website-recovery.css +28 -0
  673. package/dist/website-search.css +26 -0
  674. package/dist/website-shell.css +89 -0
  675. package/dist/website-timeline.css +43 -0
  676. package/dist/website.css +25 -0
  677. package/llms.txt +35 -0
  678. package/package.json +163 -5
  679. package/skills/folio-design/SKILL.md +228 -0
  680. package/skills/folio-design/evals/claims.json +95 -0
  681. package/skills/folio-design/evals/evals.json +84 -0
  682. package/skills/folio-design/rules/a11y.md +167 -0
  683. package/skills/folio-design/rules/composition.md +108 -0
  684. package/skills/folio-design/rules/forms.md +135 -0
  685. package/skills/folio-design/rules/naming.md +155 -0
  686. package/skills/folio-design/rules/tokens.md +133 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/charts/lib/paint.tsx"],"sourcesContent":["'use client'\n\nimport type { ReactNode } from 'react'\nimport { motion } from 'motion/react'\nimport type { ChartConfig } from './chart'\nimport { colorStops } from './chart'\n\n/**\n * The intro wipe's direction, shared by every mark that has one.\n *\n * Named for the DATA rather than for the screen. `forward` runs from the first\n * row to the last, `reverse` the other way — which is the thing the author\n * actually means, and stays true in a right-to-left document, where a cartesian\n * plot is still drawn first-row-first.\n *\n * `\"none\"` opts out, and is also what a device with the OS reduce-motion\n * preference falls back to: a reveal is a per-frame animated SVG mask, the\n * heaviest thing in the package and the least welcome to a reader who has\n * asked for stillness.\n */\nexport type ChartRevealType = 'none' | 'forward' | 'reverse' | 'center-out' | 'edges-in'\n\n/** A reveal that actually plays. */\nexport type ChartRevealDirection = Exclude<ChartRevealType, 'none'>\n\n/** The intro wipe, in seconds. */\nexport const REVEAL_DURATION = 1\n\n/**\n * The wipe's curve. Not `--ease`: the system's easing is tuned for a control\n * moving a few pixels, and over a full plot width it arrives too abruptly.\n * A long, flat tail is what makes a line read as being drawn.\n */\nexport const REVEAL_EASE: [number, number, number, number] = [0, 0.7, 0.5, 1]\n\n/** The edge a single-rect wipe grows from: 0 the start, 1 the end, 0.5 the middle. */\nconst REVEAL_ORIGIN: Record<Exclude<ChartRevealDirection, 'edges-in'>, number> = {\n forward: 0,\n reverse: 1,\n 'center-out': 0.5,\n}\n\n/**\n * The mask that draws a line or an area in.\n *\n * One mask covers the mark's fill, its stroke AND its resting dots, so the\n * three arrive together. Drawn separately — which is what Recharts' own\n * animation does — the dots pop in before the line reaches them.\n *\n * Both `maskUnits` and `maskContentUnits` are user space so every masked\n * element shares one coordinate system and the wipe edge lands at the same x\n * on each of them.\n */\nexport function RevealMask({ id, type }: { id: string; type: ChartRevealDirection }) {\n const reveal = {\n initial: { scaleX: 0 },\n animate: { scaleX: 1 },\n transition: { duration: REVEAL_DURATION, ease: REVEAL_EASE },\n }\n\n return (\n <mask\n id={`${id}-reveal-mask`}\n maskUnits=\"userSpaceOnUse\"\n maskContentUnits=\"userSpaceOnUse\"\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n >\n {type === 'edges-in' ? (\n <>\n <motion.rect\n {...reveal}\n x=\"0\"\n y=\"0\"\n width=\"50%\"\n height=\"100%\"\n fill=\"white\"\n style={{ originX: 0 }}\n />\n <motion.rect\n {...reveal}\n x=\"50%\"\n y=\"0\"\n width=\"50%\"\n height=\"100%\"\n fill=\"white\"\n style={{ originX: 1 }}\n />\n </>\n ) : (\n <motion.rect\n {...reveal}\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n fill=\"white\"\n style={{ originX: REVEAL_ORIGIN[type] }}\n />\n )}\n </mask>\n )\n}\n\nexport interface PaintProps {\n /** The owning mark's id, which scopes every definition below. */\n id: string\n /** The series being painted. */\n dataKey: string\n}\n\n/**\n * The one gradient everything else is masked out of.\n *\n * Every fill variant, every stroke and every dot in a chart paints from this,\n * which is what makes a series a single visual object rather than a set of\n * elements that happen to share a colour. A series with one colour still gets a\n * two-stop gradient: it keeps the paint reference identical across variants, so\n * switching a series from one colour to three changes no other code.\n */\nexport function SeriesGradient({\n id,\n dataKey,\n config,\n direction = 'horizontal',\n gradientUnits,\n}: PaintProps & {\n config: ChartConfig\n /** Horizontal reads along the axis; vertical reads up the mark. */\n direction?: 'horizontal' | 'vertical'\n gradientUnits?: 'userSpaceOnUse' | 'objectBoundingBox'\n}) {\n const stops = colorStops(config[dataKey])\n const axis =\n direction === 'vertical'\n ? { x1: '0', y1: '0', x2: '0', y2: '1' }\n : { x1: '0', y1: '0', x2: '1', y2: '0' }\n\n return (\n <linearGradient id={`${id}-colors-${dataKey}`} {...axis} gradientUnits={gradientUnits}>\n <ColorStops dataKey={dataKey} stops={stops} />\n </linearGradient>\n )\n}\n\n/**\n * The stops themselves, so a variant can build its own gradient from them.\n *\n * `opacities` ramps the stops independently of their colour — a radar's fill\n * fades from its centre outward without needing a second gradient to mask it.\n */\nexport function ColorStops({\n dataKey,\n stops,\n opacities,\n}: {\n dataKey: string\n stops: number\n opacities?: number[]\n}) {\n if (stops === 1) {\n return (\n <>\n <stop offset=\"0%\" stopColor={`var(--color-${dataKey}-0)`} stopOpacity={opacities?.[0]} />\n <stop\n offset=\"100%\"\n stopColor={`var(--color-${dataKey}-0)`}\n stopOpacity={opacities?.[opacities.length - 1]}\n />\n </>\n )\n }\n\n return (\n <>\n {Array.from({ length: stops }, (_, index) => {\n const offset = `${(index / (stops - 1)) * 100}%`\n return (\n <stop\n key={offset}\n offset={offset}\n stopColor={`var(--color-${dataKey}-${index}, var(--color-${dataKey}-0))`}\n stopOpacity={opacities?.[index]}\n />\n )\n })}\n </>\n )\n}\n\n/**\n * A texture, expressed once.\n *\n * Every fill variant in the package has the same three parts: a texture, a mask\n * built from it, and a pattern that paints the series gradient through that\n * mask. Writing those three out per variant — which is how this arrived — meant\n * six near-identical twenty-line blocks per chart type and four chart types\n * that each had their own copy.\n */\nfunction MaskedFill({\n name,\n id,\n dataKey,\n texture,\n patternUnits = 'userSpaceOnUse',\n patternContentUnits,\n size = { width: '100%', height: '100%' },\n maskContentUnits,\n fill,\n}: PaintProps & {\n /** The variant's name, which becomes its paint reference. */\n name: string\n /** The mask's contents — white shows the series through, black hides it. */\n texture: ReactNode\n patternUnits?: 'userSpaceOnUse' | 'objectBoundingBox'\n patternContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox'\n size?: { width: string | number; height: string | number }\n maskContentUnits?: 'userSpaceOnUse' | 'objectBoundingBox'\n /** The paint the mask reveals. Defaults to the series gradient. */\n fill?: string\n}) {\n const maskId = `${id}-${name}-mask-${dataKey}`\n const paint = fill ?? `url(#${id}-colors-${dataKey})`\n\n return (\n <>\n <mask id={maskId} maskContentUnits={maskContentUnits}>\n {texture}\n </mask>\n <pattern\n id={`${id}-${name}-${dataKey}`}\n patternUnits={patternUnits}\n patternContentUnits={patternContentUnits}\n width={size.width}\n height={size.height}\n >\n <rect\n x=\"0\"\n y=\"0\"\n width={size.width}\n height={size.height}\n fill={paint}\n mask={`url(#${maskId})`}\n />\n </pattern>\n </>\n )\n}\n\n/* ── Area fills ───────────────────────────────────────────────────────────\n Six ways an area meets the plot, and in the monochrome default they are the\n PRIMARY way two series are told apart — the ramp is the second encoding. */\n\n/** Solid at the top, dissolving toward the axis. The default. */\nexport function AreaGradientFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <linearGradient id={`${id}-area-gradient-fade-${dataKey}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"white\" stopOpacity=\"var(--chart-fill)\" />\n <stop offset=\"100%\" stopColor=\"white\" stopOpacity={0} />\n </linearGradient>\n <MaskedFill\n name=\"gradient\"\n id={id}\n dataKey={dataKey}\n texture={\n <rect\n width=\"100%\"\n height=\"100%\"\n fill={`url(#${id}-area-gradient-fade-${dataKey})`}\n />\n }\n />\n </>\n )\n}\n\n/** The same fade, run the other way — heavier where it meets the axis. */\nexport function AreaGradientReverseFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <linearGradient id={`${id}-area-reverse-fade-${dataKey}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor=\"white\" stopOpacity={0} />\n <stop offset=\"100%\" stopColor=\"white\" stopOpacity=\"var(--chart-fill)\" />\n </linearGradient>\n <MaskedFill\n name=\"gradient-reverse\"\n id={id}\n dataKey={dataKey}\n texture={\n <rect width=\"100%\" height=\"100%\" fill={`url(#${id}-area-reverse-fade-${dataKey})`} />\n }\n />\n </>\n )\n}\n\n/** One flat wash, no fade. Reads as a band rather than as a slope. */\nexport function AreaSolidFill({ id, dataKey }: PaintProps) {\n return (\n <MaskedFill\n name=\"solid\"\n id={id}\n dataKey={dataKey}\n texture={<rect width=\"100%\" height=\"100%\" fill=\"white\" fillOpacity=\"var(--chart-fill)\" />}\n />\n )\n}\n\n/** A field of dots. The lightest texture, and the one that stacks best. */\nexport function AreaDottedFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <pattern\n id={`${id}-area-dotted-texture-${dataKey}`}\n x=\"0\"\n y=\"0\"\n width=\"6\"\n height=\"6\"\n patternUnits=\"userSpaceOnUse\"\n >\n <circle cx=\"4\" cy=\"4\" r=\"0.5\" fill=\"white\" />\n </pattern>\n <MaskedFill\n name=\"dotted\"\n id={id}\n dataKey={dataKey}\n texture={\n <rect\n width=\"100%\"\n height=\"100%\"\n fill={`url(#${id}-area-dotted-texture-${dataKey})`}\n fillOpacity=\"var(--chart-texture)\"\n />\n }\n />\n </>\n )\n}\n\n/** Diagonal rule lines, 45°. */\nexport function AreaLinesFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <pattern\n id={`${id}-area-lines-texture-${dataKey}`}\n patternUnits=\"userSpaceOnUse\"\n width=\"5\"\n height=\"5\"\n patternTransform=\"rotate(45)\"\n >\n <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"5\" stroke=\"white\" strokeWidth=\"1\" />\n </pattern>\n <MaskedFill\n name=\"lines\"\n id={id}\n dataKey={dataKey}\n texture={\n <rect\n width=\"100%\"\n height=\"100%\"\n fill={`url(#${id}-area-lines-texture-${dataKey})`}\n fillOpacity=\"var(--chart-texture)\"\n />\n }\n />\n </>\n )\n}\n\n/** Wide soft-edged stripes at 20°. The heaviest of the six. */\nexport function AreaHatchedFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <linearGradient id={`${id}-area-hatched-stripe-${dataKey}`} x1=\"0\" y1=\"0\" x2=\"1\" y2=\"0\">\n <stop offset=\"50%\" stopColor=\"white\" stopOpacity={0.2} />\n <stop offset=\"50%\" stopColor=\"white\" stopOpacity={1} />\n </linearGradient>\n <pattern\n id={`${id}-area-hatched-texture-${dataKey}`}\n x=\"0\"\n y=\"0\"\n width=\"20\"\n height=\"10\"\n patternUnits=\"userSpaceOnUse\"\n overflow=\"visible\"\n patternTransform=\"rotate(20)\"\n >\n <rect width=\"20\" height=\"10\" fill={`url(#${id}-area-hatched-stripe-${dataKey})`} />\n </pattern>\n <MaskedFill\n name=\"hatched\"\n id={id}\n dataKey={dataKey}\n texture={\n <rect\n width=\"100%\"\n height=\"100%\"\n fill={`url(#${id}-area-hatched-texture-${dataKey})`}\n fillOpacity=\"var(--chart-texture)\"\n />\n }\n />\n </>\n )\n}\n\n/**\n * What a series looks like when another one is selected.\n *\n * A thin diagonal rule rather than a lower opacity: opacity alone makes a\n * series faint, and a faint area on a white ground is still an area. The\n * texture change is what makes it read as \"not this one\".\n */\nexport function UnselectedFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <pattern\n id={`${id}-unselected-texture-${dataKey}`}\n patternUnits=\"userSpaceOnUse\"\n width=\"5\"\n height=\"5\"\n patternTransform=\"rotate(45)\"\n >\n <line x1=\"0\" y1=\"0\" x2=\"0\" y2=\"5\" stroke=\"white\" strokeWidth=\"1\" />\n </pattern>\n <MaskedFill\n name=\"unselected\"\n id={id}\n dataKey={dataKey}\n texture={\n <rect\n width=\"100%\"\n height=\"100%\"\n fill={`url(#${id}-unselected-texture-${dataKey})`}\n fillOpacity=\"var(--chart-texture)\"\n />\n }\n />\n </>\n )\n}\n\n/* ── Bar fills ────────────────────────────────────────────────────────────\n A bar is a solid block, so its textures are denser than an area's — the eye\n has less of it to read and the mark can carry more. */\n\n/** 45° stripes over a faint ground. */\nexport function BarHatchedFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <pattern\n id={`${id}-bar-hatched-texture-${dataKey}`}\n x=\"0\"\n y=\"0\"\n width=\"5\"\n height=\"5\"\n patternUnits=\"userSpaceOnUse\"\n patternTransform=\"rotate(-45)\"\n >\n <rect width=\"5\" height=\"5\" fill=\"white\" fillOpacity={0.3} />\n <rect width=\"1.5\" height=\"5\" fill=\"white\" fillOpacity={1} />\n </pattern>\n <MaskedFill\n name=\"hatched\"\n id={id}\n dataKey={dataKey}\n texture={<rect width=\"100%\" height=\"100%\" fill={`url(#${id}-bar-hatched-texture-${dataKey})`} />}\n />\n </>\n )\n}\n\n/**\n * Stripes with nothing behind them — the projected, not-yet-real part of a\n * series. Used by the last bar when `buffer` is set.\n */\nexport function BarBufferFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <pattern\n id={`${id}-bar-buffer-texture-${dataKey}`}\n x=\"0\"\n y=\"0\"\n width=\"5\"\n height=\"5\"\n patternUnits=\"userSpaceOnUse\"\n patternTransform=\"rotate(-45)\"\n >\n <rect width=\"5\" height=\"5\" fill=\"black\" fillOpacity={0} />\n <rect width=\"1\" height=\"5\" fill=\"white\" fillOpacity={1} />\n </pattern>\n <MaskedFill\n name=\"buffer\"\n id={id}\n dataKey={dataKey}\n texture={<rect width=\"100%\" height=\"100%\" fill={`url(#${id}-bar-buffer-texture-${dataKey})`} />}\n />\n </>\n )\n}\n\n/**\n * A bar split down its own middle, one half at full weight.\n *\n * Everything here is in object-bounding-box units so the split lands at each\n * bar's centre rather than at the plot's — in user space a narrow bar at the\n * right of the chart would be entirely on one side of the seam.\n */\nexport function BarDuotoneFill({\n id,\n dataKey,\n config,\n reverse = false,\n}: PaintProps & { config: ChartConfig; reverse?: boolean }) {\n const name = reverse ? 'duotone-reverse' : 'duotone'\n const stops = colorStops(config[dataKey])\n\n return (\n <>\n <linearGradient\n id={`${id}-${name}-split-${dataKey}`}\n gradientUnits=\"objectBoundingBox\"\n x1=\"0\"\n y1=\"0\"\n x2=\"1\"\n y2=\"0\"\n >\n <stop offset=\"50%\" stopColor=\"white\" stopOpacity={reverse ? 1 : 0.4} />\n <stop offset=\"50%\" stopColor=\"white\" stopOpacity={reverse ? 0.4 : 1} />\n </linearGradient>\n <linearGradient\n id={`${id}-${name}-colors-${dataKey}`}\n gradientUnits=\"objectBoundingBox\"\n x1=\"0\"\n y1=\"0\"\n x2=\"0\"\n y2=\"1\"\n >\n <ColorStops dataKey={dataKey} stops={stops} />\n </linearGradient>\n <MaskedFill\n name={name}\n id={id}\n dataKey={dataKey}\n patternUnits=\"objectBoundingBox\"\n patternContentUnits=\"objectBoundingBox\"\n maskContentUnits=\"objectBoundingBox\"\n size={{ width: 1, height: 1 }}\n fill={`url(#${id}-${name}-colors-${dataKey})`}\n texture={\n <rect\n x=\"0\"\n y=\"0\"\n width=\"1\"\n height=\"1\"\n fill={`url(#${id}-${name}-split-${dataKey})`}\n />\n }\n />\n </>\n )\n}\n\n/** Solid at the top of the bar, dissolving toward the baseline. */\nexport function BarGradientFill({ id, dataKey }: PaintProps) {\n return (\n <>\n <linearGradient id={`${id}-bar-gradient-fade-${dataKey}`} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"20%\" stopColor=\"white\" stopOpacity={1} />\n <stop offset=\"90%\" stopColor=\"white\" stopOpacity={0} />\n </linearGradient>\n <MaskedFill\n name=\"gradient\"\n id={id}\n dataKey={dataKey}\n texture={<rect width=\"100%\" height=\"100%\" fill={`url(#${id}-bar-gradient-fade-${dataKey})`} />}\n />\n </>\n )\n}\n\n/**\n * A faint body under a solid cap, drawn by the bar shape itself.\n *\n * The variant that survives density best: at twenty bars a solid block becomes\n * a wall, and a 2px cap over a wash still reads as twenty distinct values.\n */\nexport function BarStrippedFill({ id, dataKey }: PaintProps) {\n return (\n <MaskedFill\n name=\"stripped\"\n id={id}\n dataKey={dataKey}\n texture={<rect width=\"100%\" height=\"100%\" fill=\"white\" fillOpacity=\"var(--chart-fill)\" />}\n />\n )\n}\n\n/**\n * The halo behind a highlighted mark.\n *\n * The one blur in the package, and it is a filter on a MARK rather than a\n * box-shadow under a panel — law 2 bans the second, not the first. It exists\n * because a monochrome chart has no \"brighter\" to reach for when one series has\n * to be the point of the figure.\n *\n * A line needs a wider, stronger halo than a bar: a 0.8px stroke has almost no\n * area to bleed from, where a bar has its whole face.\n */\nexport function GlowFilter({\n id,\n dataKey,\n spread = 8,\n intensity = 0.5,\n}: PaintProps & {\n /** Blur radius, in user units. */\n spread?: number\n /** Alpha multiplier on the blurred copy. Above 1 saturates it. */\n intensity?: number\n}) {\n return (\n <filter id={`${id}-glow-${dataKey}`} x=\"-100%\" y=\"-100%\" width=\"300%\" height=\"300%\">\n <feGaussianBlur in=\"SourceGraphic\" stdDeviation={spread} result=\"blur\" />\n <feColorMatrix\n in=\"blur\"\n type=\"matrix\"\n values={`1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 ${intensity} 0`}\n result=\"glow\"\n />\n <feMerge>\n <feMergeNode in=\"glow\" />\n <feMergeNode in=\"SourceGraphic\" />\n </feMerge>\n </filter>\n )\n}\n\n/**\n * A dashed stroke that crawls along its own path.\n *\n * SMIL rather than CSS, because the two attributes have to stay in lockstep and\n * a CSS animation on `stroke-dasharray` is not interpolated the same way in\n * every engine. It is composed as a CHILD of the mark, so a caller that does\n * not ask for it pays nothing — and `keyframes.css`'s reduced-motion rule\n * cannot reach SMIL, which is why the call sites gate it on `useReducedMotion`\n * instead.\n */\nexport function AnimatedDashedStroke({ dash = 3 }: { dash?: number }) {\n return (\n <>\n <animate\n attributeName=\"stroke-dasharray\"\n values={`${dash} ${dash}; 0 ${dash}; ${dash} ${dash}`}\n dur=\"1s\"\n repeatCount=\"indefinite\"\n keyTimes=\"0;0.5;1\"\n />\n <animate\n attributeName=\"stroke-dashoffset\"\n values={`0; -${dash * 2}`}\n dur=\"1s\"\n repeatCount=\"indefinite\"\n keyTimes=\"0;1\"\n />\n </>\n )\n}\n"],"mappings":";AAuEQ,mBACE,KADF;AApER,SAAS,cAAc;AAEvB,SAAS,kBAAkB;AAqBpB,MAAM,kBAAkB;AAOxB,MAAM,cAAgD,CAAC,GAAG,KAAK,KAAK,CAAC;AAG5E,MAAM,gBAA2E;AAAA,EAC/E,SAAS;AAAA,EACT,SAAS;AAAA,EACT,cAAc;AAChB;AAaO,SAAS,WAAW,EAAE,IAAI,KAAK,GAA+C;AACnF,QAAM,SAAS;AAAA,IACb,SAAS,EAAE,QAAQ,EAAE;AAAA,IACrB,SAAS,EAAE,QAAQ,EAAE;AAAA,IACrB,YAAY,EAAE,UAAU,iBAAiB,MAAM,YAAY;AAAA,EAC7D;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,IAAI,GAAG,EAAE;AAAA,MACT,WAAU;AAAA,MACV,kBAAiB;AAAA,MACjB,GAAE;AAAA,MACF,GAAE;AAAA,MACF,OAAM;AAAA,MACN,QAAO;AAAA,MAEN,mBAAS,aACR,iCACE;AAAA;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YACE,GAAG;AAAA,YACJ,GAAE;AAAA,YACF,GAAE;AAAA,YACF,OAAM;AAAA,YACN,QAAO;AAAA,YACP,MAAK;AAAA,YACL,OAAO,EAAE,SAAS,EAAE;AAAA;AAAA,QACtB;AAAA,QACA;AAAA,UAAC,OAAO;AAAA,UAAP;AAAA,YACE,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AAA,IACA;AAAA,MAAC;AAAA;AAAA,QACC,eAAc;AAAA,QACd,QAAQ,OAAO,OAAO,CAAC;AAAA,QACvB,KAAI;AAAA,QACJ,aAAY;AAAA,QACZ,UAAS;AAAA;AAAA,IACX;AAAA,KACF;AAEJ;","names":[]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Where a value sits on a linear scale, and what to do when the scale has no
3
+ * width.
4
+ *
5
+ * The three engine-less forms — `Sparkline`, `Heatmap`, `BulletChart` — each
6
+ * normalise a value into a 0-to-1 position, and each had answered the
7
+ * degenerate case differently: the heatmap put a constant grid in the middle of
8
+ * its ramp, the bullet chart put a constant measure at the start of its track,
9
+ * and the sparkline divided by a substituted `1` and so drew every flat run
10
+ * along the floor. A flat run along the floor is the worst of the three,
11
+ * because in a column of sparklines "unchanged" and "pinned at its worst" is
12
+ * the one distinction the reader is scanning for.
13
+ *
14
+ * The middle is the honest answer: a scale with no width cannot rank anything,
15
+ * so no position on it is more true than another, and the centre is the only
16
+ * one that does not read as a verdict.
17
+ */
18
+ /** Where `value` sits between `min` and `max`, 0 to 1. Not held to the ends. */
19
+ declare function fraction(value: number, min: number, max: number): number;
20
+ /** `fraction`, held inside the track. */
21
+ declare function clampedFraction(value: number, min: number, max: number): number;
22
+
23
+ export { clampedFraction, fraction };
@@ -0,0 +1,13 @@
1
+ function fraction(value, min, max) {
2
+ const span = max - min;
3
+ if (span === 0) return 0.5;
4
+ return (value - min) / span;
5
+ }
6
+ function clampedFraction(value, min, max) {
7
+ return Math.min(1, Math.max(0, fraction(value, min, max)));
8
+ }
9
+ export {
10
+ clampedFraction,
11
+ fraction
12
+ };
13
+ //# sourceMappingURL=scale.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/charts/lib/scale.ts"],"sourcesContent":["/**\n * Where a value sits on a linear scale, and what to do when the scale has no\n * width.\n *\n * The three engine-less forms — `Sparkline`, `Heatmap`, `BulletChart` — each\n * normalise a value into a 0-to-1 position, and each had answered the\n * degenerate case differently: the heatmap put a constant grid in the middle of\n * its ramp, the bullet chart put a constant measure at the start of its track,\n * and the sparkline divided by a substituted `1` and so drew every flat run\n * along the floor. A flat run along the floor is the worst of the three,\n * because in a column of sparklines \"unchanged\" and \"pinned at its worst\" is\n * the one distinction the reader is scanning for.\n *\n * The middle is the honest answer: a scale with no width cannot rank anything,\n * so no position on it is more true than another, and the centre is the only\n * one that does not read as a verdict.\n */\n\n/** Where `value` sits between `min` and `max`, 0 to 1. Not held to the ends. */\nexport function fraction(value: number, min: number, max: number): number {\n const span = max - min\n if (span === 0) return 0.5\n return (value - min) / span\n}\n\n/** `fraction`, held inside the track. */\nexport function clampedFraction(value: number, min: number, max: number): number {\n return Math.min(1, Math.max(0, fraction(value, min, max)))\n}\n"],"mappings":"AAmBO,SAAS,SAAS,OAAe,KAAa,KAAqB;AACxE,QAAM,OAAO,MAAM;AACnB,MAAI,SAAS,EAAG,QAAO;AACvB,UAAQ,QAAQ,OAAO;AACzB;AAGO,SAAS,gBAAgB,OAAe,KAAa,KAAqB;AAC/E,SAAO,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,SAAS,OAAO,KAAK,GAAG,CAAC,CAAC;AAC3D;","names":[]}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * A chart's selected series, sector, bar or node — controlled or not.
3
+ *
4
+ * Nine charts each grew a `defaultSelected*` prop and a `useState` seeded from
5
+ * it, and none of them grew the other half. A default seeds the state ONCE:
6
+ * pass a new one and nothing happens, because the state was already
7
+ * initialised. So a call site that wanted a chart's selection to follow a
8
+ * filter, a route or a sibling chart had no way to say so — the prop that looks
9
+ * like the way to do it silently is not.
10
+ *
11
+ * The pair is the React convention and it is the whole fix: pass `selected` to
12
+ * drive it from outside, or leave it undefined and the chart keeps its own.
13
+ *
14
+ * @param selected The controlled value. `undefined` leaves the chart in charge.
15
+ * @param fallback What an uncontrolled chart starts on.
16
+ * @param onChange Fires on every change, controlled or not.
17
+ */
18
+ declare function useChartSelection(selected: string | null | undefined, fallback: string | null, onChange: ((selected: string | null) => void) | undefined): [string | null, (next: string | null) => void];
19
+
20
+ export { useChartSelection };
@@ -0,0 +1,18 @@
1
+ "use client";
2
+ import { useCallback, useState } from "react";
3
+ function useChartSelection(selected, fallback, onChange) {
4
+ const [own, setOwn] = useState(fallback);
5
+ const isControlled = selected !== void 0;
6
+ const select = useCallback(
7
+ (next) => {
8
+ setOwn(next);
9
+ onChange?.(next);
10
+ },
11
+ [onChange]
12
+ );
13
+ return [isControlled ? selected : own, select];
14
+ }
15
+ export {
16
+ useChartSelection
17
+ };
18
+ //# sourceMappingURL=selection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/charts/lib/selection.ts"],"sourcesContent":["'use client'\n\nimport { useCallback, useState } from 'react'\n\n/**\n * A chart's selected series, sector, bar or node — controlled or not.\n *\n * Nine charts each grew a `defaultSelected*` prop and a `useState` seeded from\n * it, and none of them grew the other half. A default seeds the state ONCE:\n * pass a new one and nothing happens, because the state was already\n * initialised. So a call site that wanted a chart's selection to follow a\n * filter, a route or a sibling chart had no way to say so — the prop that looks\n * like the way to do it silently is not.\n *\n * The pair is the React convention and it is the whole fix: pass `selected` to\n * drive it from outside, or leave it undefined and the chart keeps its own.\n *\n * @param selected The controlled value. `undefined` leaves the chart in charge.\n * @param fallback What an uncontrolled chart starts on.\n * @param onChange Fires on every change, controlled or not.\n */\nexport function useChartSelection(\n selected: string | null | undefined,\n fallback: string | null,\n onChange: ((selected: string | null) => void) | undefined,\n): [string | null, (next: string | null) => void] {\n const [own, setOwn] = useState<string | null>(fallback)\n const isControlled = selected !== undefined\n\n const select = useCallback(\n (next: string | null) => {\n // The controlled chart still updates its own copy. It is never read while\n // `selected` is given, and it means an unmount of the controlling prop\n // does not throw the selection away.\n setOwn(next)\n onChange?.(next)\n },\n [onChange],\n )\n\n return [isControlled ? selected : own, select]\n}\n"],"mappings":";AAEA,SAAS,aAAa,gBAAgB;AAmB/B,SAAS,kBACd,UACA,UACA,UACgD;AAChD,QAAM,CAAC,KAAK,MAAM,IAAI,SAAwB,QAAQ;AACtD,QAAM,eAAe,aAAa;AAElC,QAAM,SAAS;AAAA,IACb,CAAC,SAAwB;AAIvB,aAAO,IAAI;AACX,iBAAW,IAAI;AAAA,IACjB;AAAA,IACA,CAAC,QAAQ;AAAA,EACX;AAEA,SAAO,CAAC,eAAe,WAAW,KAAK,MAAM;AAC/C;","names":[]}
@@ -0,0 +1,163 @@
1
+ import * as react from 'react';
2
+ import { FC } from 'react';
3
+ import { ChartConfig } from './chart.js';
4
+ import { SonifyOptions, SonifyPoint, SonifySeries, SonifyState } from './sonify.js';
5
+ import 'recharts';
6
+
7
+ /**
8
+ * A chart's rows, flattened into what the engine plays.
9
+ *
10
+ * Anything that is not a finite number becomes a gap rather than a zero. A
11
+ * missing month is not a month with no visitors, and sounding it as the bottom
12
+ * of the range would invent a crash that never happened.
13
+ *
14
+ * A series whose `label` is not text falls back to its key: the label is spoken,
15
+ * and an icon cannot be.
16
+ */
17
+ declare function chartSonifySeries(rows: Record<string, unknown>[], config: ChartConfig, xDataKey?: string, keys?: string[]): SonifySeries[];
18
+ interface UseSonifyOptions extends SonifyOptions {
19
+ /**
20
+ * What the run is called. Spoken once, when the last note has finished, so a
21
+ * listener knows the silence is the end rather than a stall.
22
+ */
23
+ name?: string;
24
+ /**
25
+ * Fires as each point sounds, and with `null` between series.
26
+ *
27
+ * The hook already tracks this for you (`activePoint`); this is for a call
28
+ * site that wants to drive something else — a reference line on the plot, a
29
+ * row highlight in a table beside it.
30
+ */
31
+ onPointChange?: (point: SonifyPoint | null) => void;
32
+ }
33
+ interface UseSonifyResult {
34
+ state: SonifyState;
35
+ isPlaying: boolean;
36
+ /** False where the browser has no Web Audio. Resolved after mount, never during render. */
37
+ isSupported: boolean;
38
+ /** The point sounding right now, or `null` between series and at rest. */
39
+ activePoint: SonifyPoint | null;
40
+ /** The latest text for a live region — a series' range, or the end of the run. */
41
+ announcement: string;
42
+ /** Starts, or resumes. Call it from an event handler and nowhere else. */
43
+ play: () => void;
44
+ pause: () => void;
45
+ stop: () => void;
46
+ /** Play when idle or paused, pause when playing — what one button needs. */
47
+ toggle: () => void;
48
+ /** How long the whole run takes, in milliseconds. */
49
+ durationMs: number;
50
+ }
51
+ /**
52
+ * Plays a set of series as pitch over time, and reports what is sounding.
53
+ *
54
+ * The controller is rebuilt whenever the data or the tuning changes and the
55
+ * previous one is destroyed with it, so a brush drag or an unmount cancels
56
+ * every pending timer and releases the audio hardware. No `AudioContext` is
57
+ * constructed until the first `play()`.
58
+ *
59
+ * @example
60
+ * const series = useMemo(() => chartSonifySeries(rows, config, 'month'), [rows, config])
61
+ * const { toggle, isPlaying, announcement } = useSonify(series, { name: 'Visitors per month' })
62
+ *
63
+ * return (
64
+ * <>
65
+ * <button type="button" onClick={toggle}>{isPlaying ? 'Pause' : 'Play'}</button>
66
+ * <span role="status" aria-live="polite" className="sr-only">{announcement}</span>
67
+ * </>
68
+ * )
69
+ */
70
+ declare function useSonify(series: SonifySeries[], options?: UseSonifyOptions): UseSonifyResult;
71
+ /** Where the control sits above the plot. */
72
+ type SonifyAlign = 'start' | 'end';
73
+ interface SonifyProps extends SonifyOptions {
74
+ /**
75
+ * Which series play, in order. Defaults to every series in the chart's
76
+ * config.
77
+ *
78
+ * Worth narrowing on a chart with four series: sequential playback means four
79
+ * runs, and a listener rarely wants all of them.
80
+ */
81
+ keys?: string[];
82
+ /** Where the control sits above the plot. */
83
+ align?: SonifyAlign;
84
+ /** Overrides the control's visible label. */
85
+ label?: string;
86
+ /**
87
+ * Fires as each point sounds, and with `null` between series — for a call
88
+ * site that wants to mark the point on the plot itself.
89
+ */
90
+ onPointChange?: (point: SonifyPoint | null) => void;
91
+ /** Merged onto the control row, last. */
92
+ className?: string;
93
+ }
94
+ /**
95
+ * Plays this chart's values as sound.
96
+ *
97
+ * A slot: it renders nothing, and the chart root reads its props — the same
98
+ * shape as `<Chart.Values>`. Composing it is what adds the control above the
99
+ * plot, so a chart that does not ask for sonification ships none of it.
100
+ *
101
+ * Reach for it on the charts where a run of values over an axis IS the reading:
102
+ * a line, an area, a bar series over time. It is not offered on a pie or a
103
+ * treemap, where there is no order for the notes to be in.
104
+ *
105
+ * @example
106
+ * <LineChart title="Visitors per month" config={config} data={data} xDataKey="month">
107
+ * <LineChart.Sonify />
108
+ * <LineChart.XAxis dataKey="month" />
109
+ * <LineChart.Line dataKey="desktop" />
110
+ * </LineChart>
111
+ */
112
+ declare const Sonify: FC<SonifyProps>;
113
+ /**
114
+ * What a chart root calls to turn its composed `<Chart.Sonify />` slot and its
115
+ * on-screen rows into playable series.
116
+ *
117
+ * The memo is keyed on the VALUE of the slot's `keys`, not on its identity: a
118
+ * slot's props object is rebuilt on every parent render, so an identity
119
+ * dependency would replace the controller — and cancel whatever was playing —
120
+ * every time anything else on the page moved.
121
+ *
122
+ * Rows are the rows on screen, brush included. Sonifying the full data behind a
123
+ * brushed range would say something the picture does not.
124
+ *
125
+ * `rows` and `config` are compared by identity, as everywhere else in the
126
+ * package: a chart handed a freshly built `config` object on every render
127
+ * rebuilds its run each time, which stops playback. Define both outside the
128
+ * render, which is what every example here does.
129
+ */
130
+ declare function useChartSonifySeries(slot: SonifyProps | null, rows: Record<string, unknown>[], config: ChartConfig, xDataKey?: string): SonifySeries[];
131
+ interface ChartSonifyButtonProps extends SonifyProps {
132
+ /** The figure's name. Spoken as part of the control's accessible name. */
133
+ title: string;
134
+ /** The series to play, already flattened — see `chartSonifySeries`. */
135
+ series: SonifySeries[];
136
+ }
137
+ /**
138
+ * The control that starts a chart's sonification.
139
+ *
140
+ * A real `<button>`, because this is the whole point of the feature: an audio
141
+ * reading that a keyboard cannot reach is not an accessibility feature. The
142
+ * visible label is the verb only — "Play", "Pause" — and the rest of the
143
+ * accessible name is visually hidden, so the name still contains the visible
144
+ * text verbatim (WCAG 2.5.3) while a screen reader hears which figure it
145
+ * belongs to.
146
+ *
147
+ * No `aria-pressed`. A toggle button announces as "pressed"/"not pressed",
148
+ * which for a transport control contradicts the label it is sitting on —
149
+ * "Pause, toggle button, pressed" leaves the listener to work out whether the
150
+ * chart is playing. A label that names the next action says it once.
151
+ *
152
+ * The live region carries the RANGE announcement before each series, not a line
153
+ * per point: a fourteen-point run would interrupt itself fourteen times and the
154
+ * listener would hear none of the tones. The per-point readout beside the
155
+ * button is `aria-hidden` for the same reason — it is there for a sighted
156
+ * reader following along.
157
+ *
158
+ * @example
159
+ * <ChartSonifyButton title="Visitors per month" series={series} />
160
+ */
161
+ declare function ChartSonifyButton({ title, series, align, label, className, keys: _keys, onPointChange, formatValue, ...options }: ChartSonifyButtonProps): react.JSX.Element;
162
+
163
+ export { ChartSonifyButton, type ChartSonifyButtonProps, Sonify, type SonifyAlign, type SonifyProps, type UseSonifyOptions, type UseSonifyResult, chartSonifySeries, Sonify as default, useChartSonifySeries, useSonify };
@@ -0,0 +1,172 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { RiPauseLine, RiPlayLine, RiStopLine } from "@remixicon/react";
4
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
5
+ import { cn } from "../../lib/cn.js";
6
+ import { Button } from "../../components/Button/Button.js";
7
+ import { defaultTick } from "./format.js";
8
+ import {
9
+ createSonification,
10
+ hasAudioSupport
11
+ } from "./sonify.js";
12
+ function categoryText(value) {
13
+ if (typeof value === "number") return value.toLocaleString();
14
+ if (typeof value === "string" || typeof value === "boolean") return String(value);
15
+ return "";
16
+ }
17
+ function chartSonifySeries(rows, config, xDataKey, keys) {
18
+ const wanted = keys ?? Object.keys(config);
19
+ const categories = xDataKey ? rows.map((row) => categoryText(row[xDataKey])) : void 0;
20
+ return wanted.filter((key) => key in config).map((key) => {
21
+ const label = config[key]?.label;
22
+ return {
23
+ key,
24
+ label: typeof label === "string" || typeof label === "number" ? String(label) : key,
25
+ values: rows.map((row) => {
26
+ const value = row[key];
27
+ return typeof value === "number" && Number.isFinite(value) ? value : null;
28
+ }),
29
+ categories
30
+ };
31
+ });
32
+ }
33
+ function useSonify(series, options = {}) {
34
+ const {
35
+ name,
36
+ onPointChange,
37
+ noteMs,
38
+ gapMs,
39
+ leadInMs,
40
+ rootFrequency,
41
+ semitones,
42
+ wave,
43
+ volume,
44
+ formatValue = defaultTick
45
+ } = options;
46
+ const [state, setState] = useState("idle");
47
+ const [activePoint, setActivePoint] = useState(null);
48
+ const [announcement, setAnnouncement] = useState("");
49
+ const [isSupported, setIsSupported] = useState(true);
50
+ const pointChange = useRef(onPointChange);
51
+ useEffect(() => {
52
+ pointChange.current = onPointChange;
53
+ }, [onPointChange]);
54
+ useEffect(() => {
55
+ setIsSupported(hasAudioSupport());
56
+ }, []);
57
+ const controller = useMemo(
58
+ () => createSonification({
59
+ series,
60
+ options: { noteMs, gapMs, leadInMs, rootFrequency, semitones, wave, volume, formatValue },
61
+ onPoint: (point) => {
62
+ setActivePoint(point);
63
+ pointChange.current?.(point);
64
+ },
65
+ onAnnounce: setAnnouncement,
66
+ onStateChange: setState,
67
+ onEnd: () => setAnnouncement(name ? `End of ${name}.` : "End of chart.")
68
+ }),
69
+ [series, noteMs, gapMs, leadInMs, rootFrequency, semitones, wave, volume, formatValue, name]
70
+ );
71
+ useEffect(() => {
72
+ setState("idle");
73
+ setActivePoint(null);
74
+ return () => controller.destroy();
75
+ }, [controller]);
76
+ const play = useCallback(() => controller.play(), [controller]);
77
+ const pause = useCallback(() => controller.pause(), [controller]);
78
+ const stop = useCallback(() => {
79
+ controller.stop();
80
+ setAnnouncement("");
81
+ }, [controller]);
82
+ const toggle = useCallback(() => {
83
+ if (controller.state === "playing") controller.pause();
84
+ else controller.play();
85
+ }, [controller]);
86
+ return {
87
+ state,
88
+ isPlaying: state === "playing",
89
+ isSupported,
90
+ activePoint,
91
+ announcement,
92
+ play,
93
+ pause,
94
+ stop,
95
+ toggle,
96
+ durationMs: controller.durationMs
97
+ };
98
+ }
99
+ const ALIGN = {
100
+ start: "justify-start",
101
+ end: "justify-end"
102
+ };
103
+ const Sonify = () => null;
104
+ const NO_SERIES = [];
105
+ const KEY_SEPARATOR = "\0";
106
+ function useChartSonifySeries(slot, rows, config, xDataKey) {
107
+ const hasSlot = slot !== null;
108
+ const keys = slot?.keys?.join(KEY_SEPARATOR);
109
+ return useMemo(
110
+ () => hasSlot ? chartSonifySeries(rows, config, xDataKey, keys?.split(KEY_SEPARATOR)) : NO_SERIES,
111
+ [hasSlot, keys, rows, config, xDataKey]
112
+ );
113
+ }
114
+ function ChartSonifyButton({
115
+ title,
116
+ series,
117
+ align = "end",
118
+ label,
119
+ className,
120
+ keys: _keys,
121
+ onPointChange,
122
+ formatValue = defaultTick,
123
+ ...options
124
+ }) {
125
+ const { state, isPlaying, isSupported, activePoint, announcement, stop, toggle } = useSonify(
126
+ series,
127
+ { ...options, formatValue, name: title, onPointChange }
128
+ );
129
+ const hasPoints = series.some((entry) => entry.values.some((value) => value !== null));
130
+ const isDisabled = !isSupported || !hasPoints;
131
+ const Icon = isPlaying ? RiPauseLine : RiPlayLine;
132
+ const reason = !isSupported ? " \u2014 audio is not available in this browser" : !hasPoints ? " \u2014 nothing to play" : "";
133
+ return /* @__PURE__ */ jsxs("div", { className: cn("mb-2 flex items-center gap-2", ALIGN[align], className), children: [
134
+ activePoint && // Visual only. The live region is deliberately not told about every
135
+ // point; see the component note above.
136
+ /* @__PURE__ */ jsxs("span", { "aria-hidden": true, className: "mono-meta truncate text-(--ink-3-aa)", children: [
137
+ activePoint.category ?? `#${activePoint.index + 1}`,
138
+ activePoint.value !== null && ` \xB7 ${formatValue(activePoint.value)}`
139
+ ] }),
140
+ state !== "idle" && /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "md", onClick: stop, children: [
141
+ /* @__PURE__ */ jsx(RiStopLine, { size: 14, "aria-hidden": true }),
142
+ "Stop",
143
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
144
+ " playing ",
145
+ title,
146
+ " as sound"
147
+ ] })
148
+ ] }),
149
+ /* @__PURE__ */ jsxs(Button, { variant: "secondary", size: "md", onClick: toggle, disabled: isDisabled, children: [
150
+ /* @__PURE__ */ jsx(Icon, { size: 14, "aria-hidden": true }),
151
+ label ?? (isPlaying ? "Pause" : "Play"),
152
+ /* @__PURE__ */ jsxs("span", { className: "sr-only", children: [
153
+ " ",
154
+ isPlaying ? "playing" : "this chart",
155
+ " as sound: ",
156
+ title,
157
+ reason
158
+ ] })
159
+ ] }),
160
+ /* @__PURE__ */ jsx("span", { role: "status", "aria-live": "polite", className: "sr-only", children: announcement })
161
+ ] });
162
+ }
163
+ var sonify_control_default = Sonify;
164
+ export {
165
+ ChartSonifyButton,
166
+ Sonify,
167
+ chartSonifySeries,
168
+ sonify_control_default as default,
169
+ useChartSonifySeries,
170
+ useSonify
171
+ };
172
+ //# sourceMappingURL=sonify-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/charts/lib/sonify-control.tsx"],"sourcesContent":["'use client'\n\nimport { RiPauseLine, RiPlayLine, RiStopLine } from '@remixicon/react'\nimport { useCallback, useEffect, useMemo, useRef, useState, type FC } from 'react'\nimport { cn } from '../../lib/cn'\nimport { Button } from '../../components/Button/Button'\nimport type { ChartConfig } from './chart'\nimport { defaultTick } from './format'\nimport {\n createSonification,\n hasAudioSupport,\n type SonifyOptions,\n type SonifyPoint,\n type SonifySeries,\n type SonifyState,\n} from './sonify'\n\n/**\n * The React surface over `sonify.ts` — a hook, a control, and the slot a chart\n * composes.\n *\n * Everything here obeys the one rule the engine is built around: **sound only\n * ever starts from an explicit user action.** There is no effect that plays, no\n * `autoPlay` prop, and no dependency change that can begin a run. That is not\n * the same conversation as `prefers-reduced-motion` — sound is not motion, and\n * reading a motion preference as \"no audio either\" would silence the readers\n * this feature exists for.\n */\n\n/** A cell as speakable text. Speech has no use for an object. */\nfunction categoryText(value: unknown): string {\n if (typeof value === 'number') return value.toLocaleString()\n if (typeof value === 'string' || typeof value === 'boolean') return String(value)\n return ''\n}\n\n/**\n * A chart's rows, flattened into what the engine plays.\n *\n * Anything that is not a finite number becomes a gap rather than a zero. A\n * missing month is not a month with no visitors, and sounding it as the bottom\n * of the range would invent a crash that never happened.\n *\n * A series whose `label` is not text falls back to its key: the label is spoken,\n * and an icon cannot be.\n */\nexport function chartSonifySeries(\n rows: Record<string, unknown>[],\n config: ChartConfig,\n xDataKey?: string,\n keys?: string[],\n): SonifySeries[] {\n const wanted = keys ?? Object.keys(config)\n const categories = xDataKey ? rows.map((row) => categoryText(row[xDataKey])) : undefined\n\n return wanted\n .filter((key) => key in config)\n .map((key) => {\n const label = config[key]?.label\n return {\n key,\n label: typeof label === 'string' || typeof label === 'number' ? String(label) : key,\n values: rows.map((row) => {\n const value = row[key]\n return typeof value === 'number' && Number.isFinite(value) ? value : null\n }),\n categories,\n }\n })\n}\n\nexport interface UseSonifyOptions extends SonifyOptions {\n /**\n * What the run is called. Spoken once, when the last note has finished, so a\n * listener knows the silence is the end rather than a stall.\n */\n name?: string\n /**\n * Fires as each point sounds, and with `null` between series.\n *\n * The hook already tracks this for you (`activePoint`); this is for a call\n * site that wants to drive something else — a reference line on the plot, a\n * row highlight in a table beside it.\n */\n onPointChange?: (point: SonifyPoint | null) => void\n}\n\nexport interface UseSonifyResult {\n state: SonifyState\n isPlaying: boolean\n /** False where the browser has no Web Audio. Resolved after mount, never during render. */\n isSupported: boolean\n /** The point sounding right now, or `null` between series and at rest. */\n activePoint: SonifyPoint | null\n /** The latest text for a live region — a series' range, or the end of the run. */\n announcement: string\n /** Starts, or resumes. Call it from an event handler and nowhere else. */\n play: () => void\n pause: () => void\n stop: () => void\n /** Play when idle or paused, pause when playing — what one button needs. */\n toggle: () => void\n /** How long the whole run takes, in milliseconds. */\n durationMs: number\n}\n\n/**\n * Plays a set of series as pitch over time, and reports what is sounding.\n *\n * The controller is rebuilt whenever the data or the tuning changes and the\n * previous one is destroyed with it, so a brush drag or an unmount cancels\n * every pending timer and releases the audio hardware. No `AudioContext` is\n * constructed until the first `play()`.\n *\n * @example\n * const series = useMemo(() => chartSonifySeries(rows, config, 'month'), [rows, config])\n * const { toggle, isPlaying, announcement } = useSonify(series, { name: 'Visitors per month' })\n *\n * return (\n * <>\n * <button type=\"button\" onClick={toggle}>{isPlaying ? 'Pause' : 'Play'}</button>\n * <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">{announcement}</span>\n * </>\n * )\n */\nexport function useSonify(series: SonifySeries[], options: UseSonifyOptions = {}): UseSonifyResult {\n const {\n name,\n onPointChange,\n noteMs,\n gapMs,\n leadInMs,\n rootFrequency,\n semitones,\n wave,\n volume,\n formatValue = defaultTick,\n } = options\n\n const [state, setState] = useState<SonifyState>('idle')\n const [activePoint, setActivePoint] = useState<SonifyPoint | null>(null)\n const [announcement, setAnnouncement] = useState('')\n // Starts optimistic so the server and the first client render agree; the\n // effect below is the only place the browser is asked.\n const [isSupported, setIsSupported] = useState(true)\n\n // Held in a ref rather than in the memo's dependencies: a call site that\n // passes an inline arrow would otherwise rebuild the controller — and cancel\n // the run — on every render.\n const pointChange = useRef(onPointChange)\n useEffect(() => {\n pointChange.current = onPointChange\n }, [onPointChange])\n\n useEffect(() => {\n setIsSupported(hasAudioSupport())\n }, [])\n\n const controller = useMemo(\n () =>\n createSonification({\n series,\n options: { noteMs, gapMs, leadInMs, rootFrequency, semitones, wave, volume, formatValue },\n onPoint: (point) => {\n setActivePoint(point)\n pointChange.current?.(point)\n },\n onAnnounce: setAnnouncement,\n onStateChange: setState,\n onEnd: () => setAnnouncement(name ? `End of ${name}.` : 'End of chart.'),\n }),\n [series, noteMs, gapMs, leadInMs, rootFrequency, semitones, wave, volume, formatValue, name],\n )\n\n useEffect(() => {\n setState('idle')\n setActivePoint(null)\n // Runs when the data changes as well as on unmount, which is what stops a\n // brushed-away run from playing on against rows that are no longer drawn.\n return () => controller.destroy()\n }, [controller])\n\n const play = useCallback(() => controller.play(), [controller])\n const pause = useCallback(() => controller.pause(), [controller])\n const stop = useCallback(() => {\n controller.stop()\n setAnnouncement('')\n }, [controller])\n\n const toggle = useCallback(() => {\n if (controller.state === 'playing') controller.pause()\n else controller.play()\n }, [controller])\n\n return {\n state,\n isPlaying: state === 'playing',\n isSupported,\n activePoint,\n announcement,\n play,\n pause,\n stop,\n toggle,\n durationMs: controller.durationMs,\n }\n}\n\n/** Where the control sits above the plot. */\nexport type SonifyAlign = 'start' | 'end'\n\nconst ALIGN: Record<SonifyAlign, string> = {\n start: 'justify-start',\n end: 'justify-end',\n}\n\nexport interface SonifyProps extends SonifyOptions {\n /**\n * Which series play, in order. Defaults to every series in the chart's\n * config.\n *\n * Worth narrowing on a chart with four series: sequential playback means four\n * runs, and a listener rarely wants all of them.\n */\n keys?: string[]\n /** Where the control sits above the plot. */\n align?: SonifyAlign\n /** Overrides the control's visible label. */\n label?: string\n /**\n * Fires as each point sounds, and with `null` between series — for a call\n * site that wants to mark the point on the plot itself.\n */\n onPointChange?: (point: SonifyPoint | null) => void\n /** Merged onto the control row, last. */\n className?: string\n}\n\n/**\n * Plays this chart's values as sound.\n *\n * A slot: it renders nothing, and the chart root reads its props — the same\n * shape as `<Chart.Values>`. Composing it is what adds the control above the\n * plot, so a chart that does not ask for sonification ships none of it.\n *\n * Reach for it on the charts where a run of values over an axis IS the reading:\n * a line, an area, a bar series over time. It is not offered on a pie or a\n * treemap, where there is no order for the notes to be in.\n *\n * @example\n * <LineChart title=\"Visitors per month\" config={config} data={data} xDataKey=\"month\">\n * <LineChart.Sonify />\n * <LineChart.XAxis dataKey=\"month\" />\n * <LineChart.Line dataKey=\"desktop\" />\n * </LineChart>\n */\nexport const Sonify: FC<SonifyProps> = () => null\n\n/** Shared so an absent slot always yields the same array, not a new empty one. */\nconst NO_SERIES: SonifySeries[] = []\n\n/** Separator for the memo key below. Never appears in a series key. */\nconst KEY_SEPARATOR = '\\u0000'\n\n/**\n * What a chart root calls to turn its composed `<Chart.Sonify />` slot and its\n * on-screen rows into playable series.\n *\n * The memo is keyed on the VALUE of the slot's `keys`, not on its identity: a\n * slot's props object is rebuilt on every parent render, so an identity\n * dependency would replace the controller — and cancel whatever was playing —\n * every time anything else on the page moved.\n *\n * Rows are the rows on screen, brush included. Sonifying the full data behind a\n * brushed range would say something the picture does not.\n *\n * `rows` and `config` are compared by identity, as everywhere else in the\n * package: a chart handed a freshly built `config` object on every render\n * rebuilds its run each time, which stops playback. Define both outside the\n * render, which is what every example here does.\n */\nexport function useChartSonifySeries(\n slot: SonifyProps | null,\n rows: Record<string, unknown>[],\n config: ChartConfig,\n xDataKey?: string,\n): SonifySeries[] {\n const hasSlot = slot !== null\n const keys = slot?.keys?.join(KEY_SEPARATOR)\n\n return useMemo(\n () =>\n hasSlot\n ? chartSonifySeries(rows, config, xDataKey, keys?.split(KEY_SEPARATOR))\n : NO_SERIES,\n [hasSlot, keys, rows, config, xDataKey],\n )\n}\n\nexport interface ChartSonifyButtonProps extends SonifyProps {\n /** The figure's name. Spoken as part of the control's accessible name. */\n title: string\n /** The series to play, already flattened — see `chartSonifySeries`. */\n series: SonifySeries[]\n}\n\n/**\n * The control that starts a chart's sonification.\n *\n * A real `<button>`, because this is the whole point of the feature: an audio\n * reading that a keyboard cannot reach is not an accessibility feature. The\n * visible label is the verb only — \"Play\", \"Pause\" — and the rest of the\n * accessible name is visually hidden, so the name still contains the visible\n * text verbatim (WCAG 2.5.3) while a screen reader hears which figure it\n * belongs to.\n *\n * No `aria-pressed`. A toggle button announces as \"pressed\"/\"not pressed\",\n * which for a transport control contradicts the label it is sitting on —\n * \"Pause, toggle button, pressed\" leaves the listener to work out whether the\n * chart is playing. A label that names the next action says it once.\n *\n * The live region carries the RANGE announcement before each series, not a line\n * per point: a fourteen-point run would interrupt itself fourteen times and the\n * listener would hear none of the tones. The per-point readout beside the\n * button is `aria-hidden` for the same reason — it is there for a sighted\n * reader following along.\n *\n * @example\n * <ChartSonifyButton title=\"Visitors per month\" series={series} />\n */\nexport function ChartSonifyButton({\n title,\n series,\n align = 'end',\n label,\n className,\n keys: _keys,\n onPointChange,\n formatValue = defaultTick,\n ...options\n}: ChartSonifyButtonProps) {\n const { state, isPlaying, isSupported, activePoint, announcement, stop, toggle } = useSonify(\n series,\n { ...options, formatValue, name: title, onPointChange },\n )\n\n const hasPoints = series.some((entry) => entry.values.some((value) => value !== null))\n const isDisabled = !isSupported || !hasPoints\n const Icon = isPlaying ? RiPauseLine : RiPlayLine\n\n const reason = !isSupported\n ? ' — audio is not available in this browser'\n : !hasPoints\n ? ' — nothing to play'\n : ''\n\n return (\n <div className={cn('mb-2 flex items-center gap-2', ALIGN[align], className)}>\n {activePoint && (\n // Visual only. The live region is deliberately not told about every\n // point; see the component note above.\n <span aria-hidden className=\"mono-meta truncate text-(--ink-3-aa)\">\n {activePoint.category ?? `#${activePoint.index + 1}`}\n {activePoint.value !== null && ` · ${formatValue(activePoint.value)}`}\n </span>\n )}\n\n {state !== 'idle' && (\n <Button variant=\"ghost\" size=\"md\" onClick={stop}>\n <RiStopLine size={14} aria-hidden />\n Stop\n <span className=\"sr-only\"> playing {title} as sound</span>\n </Button>\n )}\n\n <Button variant=\"secondary\" size=\"md\" onClick={toggle} disabled={isDisabled}>\n <Icon size={14} aria-hidden />\n {label ?? (isPlaying ? 'Pause' : 'Play')}\n <span className=\"sr-only\">\n {' '}\n {isPlaying ? 'playing' : 'this chart'} as sound: {title}\n {reason}\n </span>\n </Button>\n\n <span role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {announcement}\n </span>\n </div>\n )\n}\n\nexport default Sonify\n"],"mappings":";AAyWQ,SAQE,KARF;AAvWR,SAAS,aAAa,YAAY,kBAAkB;AACpD,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAyB;AAC3E,SAAS,UAAU;AACnB,SAAS,cAAc;AAEvB,SAAS,mBAAmB;AAC5B;AAAA,EACE;AAAA,EACA;AAAA,OAKK;AAeP,SAAS,aAAa,OAAwB;AAC5C,MAAI,OAAO,UAAU,SAAU,QAAO,MAAM,eAAe;AAC3D,MAAI,OAAO,UAAU,YAAY,OAAO,UAAU,UAAW,QA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