@seekalfred/primitives 0.6.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (322) hide show
  1. package/README.md +19 -11
  2. package/dist/activity-heatmap/activity-heatmap.d.ts +92 -0
  3. package/dist/activity-heatmap/activity-heatmap.js +699 -0
  4. package/dist/activity-heatmap/activity-heatmap.js.map +1 -0
  5. package/dist/activity-heatmap/index.d.ts +2 -0
  6. package/dist/activity-heatmap/index.js +2 -0
  7. package/dist/alert/alert.d.ts +5 -1
  8. package/dist/alert/alert.js +68 -7
  9. package/dist/alert/alert.js.map +1 -1
  10. package/dist/alert-dialog/alert-dialog.d.ts +45 -18
  11. package/dist/alert-dialog/alert-dialog.js +128 -9
  12. package/dist/alert-dialog/alert-dialog.js.map +1 -1
  13. package/dist/alert-dialog/index.d.ts +2 -2
  14. package/dist/alert-dialog/index.js +2 -2
  15. package/dist/animated-counter/animated-counter.d.ts +38 -0
  16. package/dist/animated-counter/animated-counter.js +230 -0
  17. package/dist/animated-counter/animated-counter.js.map +1 -0
  18. package/dist/animated-counter/index.d.ts +2 -0
  19. package/dist/animated-counter/index.js +2 -0
  20. package/dist/announcement-bar/announcement-bar.d.ts +67 -0
  21. package/dist/announcement-bar/announcement-bar.js +364 -0
  22. package/dist/announcement-bar/announcement-bar.js.map +1 -0
  23. package/dist/announcement-bar/index.d.ts +2 -0
  24. package/dist/announcement-bar/index.js +2 -0
  25. package/dist/badge/badge.d.ts +1 -1
  26. package/dist/bar-chart/bar-chart.d.ts +51 -0
  27. package/dist/bar-chart/bar-chart.js +565 -0
  28. package/dist/bar-chart/bar-chart.js.map +1 -0
  29. package/dist/bar-chart/index.d.ts +2 -0
  30. package/dist/bar-chart/index.js +2 -0
  31. package/dist/breadcrumb/breadcrumb.d.ts +2 -2
  32. package/dist/breadcrumb/breadcrumb.js +12 -3
  33. package/dist/breadcrumb/breadcrumb.js.map +1 -1
  34. package/dist/brush-chart/brush-chart.d.ts +64 -0
  35. package/dist/brush-chart/brush-chart.js +1056 -0
  36. package/dist/brush-chart/brush-chart.js.map +1 -0
  37. package/dist/brush-chart/index.d.ts +2 -0
  38. package/dist/brush-chart/index.js +2 -0
  39. package/dist/button/button.d.ts +2 -2
  40. package/dist/button/button.js +31 -21
  41. package/dist/button/button.js.map +1 -1
  42. package/dist/button-group/button-group.js +3 -4
  43. package/dist/button-group/button-group.js.map +1 -1
  44. package/dist/card/card.js +1 -1
  45. package/dist/card/card.js.map +1 -1
  46. package/dist/card-stack/card-stack.d.ts +54 -0
  47. package/dist/card-stack/card-stack.js +492 -0
  48. package/dist/card-stack/card-stack.js.map +1 -0
  49. package/dist/card-stack/index.d.ts +2 -0
  50. package/dist/card-stack/index.js +2 -0
  51. package/dist/carousel/carousel.d.ts +56 -0
  52. package/dist/carousel/carousel.js +389 -0
  53. package/dist/carousel/carousel.js.map +1 -0
  54. package/dist/carousel/index.d.ts +2 -0
  55. package/dist/carousel/index.js +2 -0
  56. package/dist/checkbox/checkbox.js +4 -4
  57. package/dist/checkbox/checkbox.js.map +1 -1
  58. package/dist/chip-group/chip-group.d.ts +37 -0
  59. package/dist/chip-group/chip-group.js +148 -0
  60. package/dist/chip-group/chip-group.js.map +1 -0
  61. package/dist/chip-group/index.d.ts +2 -0
  62. package/dist/chip-group/index.js +2 -0
  63. package/dist/countdown/countdown.d.ts +45 -0
  64. package/dist/countdown/countdown.js +298 -0
  65. package/dist/countdown/countdown.js.map +1 -0
  66. package/dist/countdown/index.d.ts +2 -0
  67. package/dist/countdown/index.js +2 -0
  68. package/dist/date-picker/picker-parts.js +1 -1
  69. package/dist/date-picker/picker-parts.js.map +1 -1
  70. package/dist/dialog/dialog.js +1 -1
  71. package/dist/dialog/dialog.js.map +1 -1
  72. package/dist/donut-chart/donut-chart.d.ts +64 -0
  73. package/dist/donut-chart/donut-chart.js +576 -0
  74. package/dist/donut-chart/donut-chart.js.map +1 -0
  75. package/dist/donut-chart/index.d.ts +2 -0
  76. package/dist/donut-chart/index.js +2 -0
  77. package/dist/empty-state/empty-state.d.ts +21 -10
  78. package/dist/empty-state/empty-state.js +32 -26
  79. package/dist/empty-state/empty-state.js.map +1 -1
  80. package/dist/empty-state/index.d.ts +2 -2
  81. package/dist/empty-state/index.js +2 -2
  82. package/dist/file-drop-zone/file-drop-zone.js +1 -1
  83. package/dist/file-drop-zone/file-drop-zone.js.map +1 -1
  84. package/dist/filter-bar/filter-bar.d.ts +47 -26
  85. package/dist/filter-bar/filter-bar.js +272 -156
  86. package/dist/filter-bar/filter-bar.js.map +1 -1
  87. package/dist/gauge/gauge.d.ts +45 -0
  88. package/dist/gauge/gauge.js +219 -0
  89. package/dist/gauge/gauge.js.map +1 -0
  90. package/dist/gauge/index.d.ts +2 -0
  91. package/dist/gauge/index.js +2 -0
  92. package/dist/in-view-title/in-view-title.d.ts +33 -0
  93. package/dist/in-view-title/in-view-title.js +119 -0
  94. package/dist/in-view-title/in-view-title.js.map +1 -0
  95. package/dist/in-view-title/index.d.ts +2 -0
  96. package/dist/in-view-title/index.js +2 -0
  97. package/dist/index.d.ts +49 -6
  98. package/dist/index.js +48 -8
  99. package/dist/lib/cn.js +11 -1
  100. package/dist/lib/cn.js.map +1 -1
  101. package/dist/lib/field-message.js +28 -10
  102. package/dist/lib/field-message.js.map +1 -1
  103. package/dist/lib/field-surface.js +9 -8
  104. package/dist/lib/field-surface.js.map +1 -1
  105. package/dist/lib/flag-emoji.js +50 -0
  106. package/dist/lib/flag-emoji.js.map +1 -0
  107. package/dist/lib/flip.js +11 -3
  108. package/dist/lib/flip.js.map +1 -1
  109. package/dist/lib/menu-highlight.js +64 -0
  110. package/dist/lib/menu-highlight.js.map +1 -0
  111. package/dist/lib/motion.js +9 -2
  112. package/dist/lib/motion.js.map +1 -1
  113. package/dist/lib/rolling-value.js +1 -1
  114. package/dist/lib/rolling-value.js.map +1 -1
  115. package/dist/lib/spring-tween.js +500 -0
  116. package/dist/lib/spring-tween.js.map +1 -0
  117. package/dist/lib/swap-text.js +3 -1
  118. package/dist/lib/swap-text.js.map +1 -1
  119. package/dist/line-chart/index.d.ts +2 -0
  120. package/dist/line-chart/index.js +2 -0
  121. package/dist/line-chart/line-chart.d.ts +76 -0
  122. package/dist/line-chart/line-chart.js +611 -0
  123. package/dist/line-chart/line-chart.js.map +1 -0
  124. package/dist/mention-input/index.d.ts +2 -0
  125. package/dist/mention-input/index.js +2 -0
  126. package/dist/mention-input/mention-input.d.ts +98 -0
  127. package/dist/mention-input/mention-input.js +576 -0
  128. package/dist/mention-input/mention-input.js.map +1 -0
  129. package/dist/menu/menu.d.ts +2 -0
  130. package/dist/menu/menu.js +23 -12
  131. package/dist/menu/menu.js.map +1 -1
  132. package/dist/money-input/index.d.ts +2 -0
  133. package/dist/money-input/index.js +2 -0
  134. package/dist/money-input/money-input.d.ts +65 -0
  135. package/dist/money-input/money-input.js +607 -0
  136. package/dist/money-input/money-input.js.map +1 -0
  137. package/dist/morph-select/index.d.ts +2 -0
  138. package/dist/morph-select/index.js +2 -0
  139. package/dist/morph-select/morph-select.d.ts +71 -0
  140. package/dist/morph-select/morph-select.js +693 -0
  141. package/dist/morph-select/morph-select.js.map +1 -0
  142. package/dist/multi-select/index.d.ts +2 -0
  143. package/dist/multi-select/index.js +2 -0
  144. package/dist/multi-select/multi-select.d.ts +36 -0
  145. package/dist/multi-select/multi-select.js +152 -0
  146. package/dist/multi-select/multi-select.js.map +1 -0
  147. package/dist/number-field/index.d.ts +2 -0
  148. package/dist/number-field/index.js +2 -0
  149. package/dist/number-field/number-field.d.ts +42 -0
  150. package/dist/number-field/number-field.js +199 -0
  151. package/dist/number-field/number-field.js.map +1 -0
  152. package/dist/onboarding-checklist/index.d.ts +2 -0
  153. package/dist/onboarding-checklist/index.js +2 -0
  154. package/dist/onboarding-checklist/onboarding-checklist.d.ts +55 -0
  155. package/dist/onboarding-checklist/onboarding-checklist.js +577 -0
  156. package/dist/onboarding-checklist/onboarding-checklist.js.map +1 -0
  157. package/dist/password-field/password-field.js +2 -2
  158. package/dist/password-field/password-field.js.map +1 -1
  159. package/dist/phone-input/index.d.ts +3 -0
  160. package/dist/phone-input/index.js +3 -0
  161. package/dist/phone-input/phone-countries.d.ts +29 -0
  162. package/dist/phone-input/phone-countries.js +170 -0
  163. package/dist/phone-input/phone-countries.js.map +1 -0
  164. package/dist/phone-input/phone-input.d.ts +66 -0
  165. package/dist/phone-input/phone-input.js +440 -0
  166. package/dist/phone-input/phone-input.js.map +1 -0
  167. package/dist/popover/popover.d.ts +12 -0
  168. package/dist/popover/popover.js +31 -7
  169. package/dist/popover/popover.js.map +1 -1
  170. package/dist/progress/progress.js +1 -1
  171. package/dist/radio-group/radio-group.js +1 -1
  172. package/dist/radio-group/radio-group.js.map +1 -1
  173. package/dist/reactions/index.d.ts +2 -0
  174. package/dist/reactions/index.js +2 -0
  175. package/dist/reactions/reactions.d.ts +50 -0
  176. package/dist/reactions/reactions.js +315 -0
  177. package/dist/reactions/reactions.js.map +1 -0
  178. package/dist/rich-text-editor/index.d.ts +3 -0
  179. package/dist/rich-text-editor/index.js +2 -0
  180. package/dist/rich-text-editor/rich-text-editor.d.ts +70 -0
  181. package/dist/rich-text-editor/rich-text-editor.js +909 -0
  182. package/dist/rich-text-editor/rich-text-editor.js.map +1 -0
  183. package/dist/rich-text-editor/rich-text-engine.d.ts +16 -0
  184. package/dist/rich-text-editor/rich-text-engine.js +366 -0
  185. package/dist/rich-text-editor/rich-text-engine.js.map +1 -0
  186. package/dist/rich-text-editor/rich-text-html.js +174 -0
  187. package/dist/rich-text-editor/rich-text-html.js.map +1 -0
  188. package/dist/rich-text-editor/rich-text-icons.js +43 -0
  189. package/dist/rich-text-editor/rich-text-icons.js.map +1 -0
  190. package/dist/ridgeline/index.d.ts +2 -0
  191. package/dist/ridgeline/index.js +2 -0
  192. package/dist/ridgeline/ridgeline.d.ts +55 -0
  193. package/dist/ridgeline/ridgeline.js +701 -0
  194. package/dist/ridgeline/ridgeline.js.map +1 -0
  195. package/dist/scroll-area/index.d.ts +2 -2
  196. package/dist/scroll-area/index.js +2 -2
  197. package/dist/scroll-area/scroll-area.d.ts +68 -31
  198. package/dist/scroll-area/scroll-area.js +208 -59
  199. package/dist/scroll-area/scroll-area.js.map +1 -1
  200. package/dist/scrub-input/evaluate.d.ts +14 -0
  201. package/dist/scrub-input/evaluate.js +72 -0
  202. package/dist/scrub-input/evaluate.js.map +1 -0
  203. package/dist/scrub-input/index.d.ts +3 -0
  204. package/dist/scrub-input/index.js +3 -0
  205. package/dist/scrub-input/scrub-input.d.ts +74 -0
  206. package/dist/scrub-input/scrub-input.js +486 -0
  207. package/dist/scrub-input/scrub-input.js.map +1 -0
  208. package/dist/search-field/search-field.d.ts +2 -1
  209. package/dist/search-field/search-field.js +4 -4
  210. package/dist/search-field/search-field.js.map +1 -1
  211. package/dist/select/select.d.ts +3 -1
  212. package/dist/select/select.js +20 -8
  213. package/dist/select/select.js.map +1 -1
  214. package/dist/separator/separator.d.ts +1 -1
  215. package/dist/sheet/sheet.js +2 -1
  216. package/dist/sheet/sheet.js.map +1 -1
  217. package/dist/shortcut-recorder/index.d.ts +3 -0
  218. package/dist/shortcut-recorder/index.js +3 -0
  219. package/dist/shortcut-recorder/shortcut-model.d.ts +27 -0
  220. package/dist/shortcut-recorder/shortcut-model.js +206 -0
  221. package/dist/shortcut-recorder/shortcut-model.js.map +1 -0
  222. package/dist/shortcut-recorder/shortcut-recorder.d.ts +93 -0
  223. package/dist/shortcut-recorder/shortcut-recorder.js +489 -0
  224. package/dist/shortcut-recorder/shortcut-recorder.js.map +1 -0
  225. package/dist/slider/index.d.ts +2 -2
  226. package/dist/slider/slider.d.ts +46 -14
  227. package/dist/slider/slider.js +151 -67
  228. package/dist/slider/slider.js.map +1 -1
  229. package/dist/slope-chart/index.d.ts +2 -0
  230. package/dist/slope-chart/index.js +2 -0
  231. package/dist/slope-chart/slope-chart.d.ts +54 -0
  232. package/dist/slope-chart/slope-chart.js +568 -0
  233. package/dist/slope-chart/slope-chart.js.map +1 -0
  234. package/dist/sparkline/index.d.ts +2 -0
  235. package/dist/sparkline/index.js +2 -0
  236. package/dist/sparkline/sparkline.d.ts +46 -0
  237. package/dist/sparkline/sparkline.js +390 -0
  238. package/dist/sparkline/sparkline.js.map +1 -0
  239. package/dist/split-bar/index.d.ts +2 -0
  240. package/dist/split-bar/index.js +2 -0
  241. package/dist/split-bar/split-bar.d.ts +62 -0
  242. package/dist/split-bar/split-bar.js +513 -0
  243. package/dist/split-bar/split-bar.js.map +1 -0
  244. package/dist/split-button/split-button.d.ts +1 -1
  245. package/dist/split-button/split-button.js +12 -11
  246. package/dist/split-button/split-button.js.map +1 -1
  247. package/dist/stat-card/index.d.ts +2 -2
  248. package/dist/stat-card/index.js +2 -2
  249. package/dist/stat-card/stat-card.d.ts +24 -4
  250. package/dist/stat-card/stat-card.js +114 -17
  251. package/dist/stat-card/stat-card.js.map +1 -1
  252. package/dist/stepper/index.d.ts +2 -0
  253. package/dist/stepper/index.js +2 -0
  254. package/dist/stepper/stepper.d.ts +51 -0
  255. package/dist/stepper/stepper.js +215 -0
  256. package/dist/stepper/stepper.js.map +1 -0
  257. package/dist/streamgraph/index.d.ts +2 -0
  258. package/dist/streamgraph/index.js +2 -0
  259. package/dist/streamgraph/streamgraph.d.ts +70 -0
  260. package/dist/streamgraph/streamgraph.js +613 -0
  261. package/dist/streamgraph/streamgraph.js.map +1 -0
  262. package/dist/styles.css +1 -1
  263. package/dist/swipe-actions/index.d.ts +2 -0
  264. package/dist/swipe-actions/index.js +2 -0
  265. package/dist/swipe-actions/swipe-actions.d.ts +67 -0
  266. package/dist/swipe-actions/swipe-actions.js +552 -0
  267. package/dist/swipe-actions/swipe-actions.js.map +1 -0
  268. package/dist/switch/switch.js +2 -2
  269. package/dist/switch/switch.js.map +1 -1
  270. package/dist/table/index.d.ts +2 -2
  271. package/dist/table/index.js +2 -2
  272. package/dist/table/table.d.ts +56 -4
  273. package/dist/table/table.js +340 -165
  274. package/dist/table/table.js.map +1 -1
  275. package/dist/tabs/tabs.js +2 -2
  276. package/dist/tabs/tabs.js.map +1 -1
  277. package/dist/tag-input/index.d.ts +2 -0
  278. package/dist/tag-input/index.js +2 -0
  279. package/dist/tag-input/tag-input.d.ts +40 -0
  280. package/dist/tag-input/tag-input.js +269 -0
  281. package/dist/tag-input/tag-input.js.map +1 -0
  282. package/dist/text-morph/index.d.ts +2 -0
  283. package/dist/text-morph/index.js +2 -0
  284. package/dist/text-morph/text-morph.d.ts +23 -0
  285. package/dist/text-morph/text-morph.js +21 -0
  286. package/dist/text-morph/text-morph.js.map +1 -0
  287. package/dist/text-reveal/index.d.ts +2 -0
  288. package/dist/text-reveal/index.js +2 -0
  289. package/dist/text-reveal/text-reveal.d.ts +27 -0
  290. package/dist/text-reveal/text-reveal.js +51 -0
  291. package/dist/text-reveal/text-reveal.js.map +1 -0
  292. package/dist/text-shimmer/index.d.ts +2 -0
  293. package/dist/text-shimmer/index.js +2 -0
  294. package/dist/text-shimmer/text-shimmer.d.ts +29 -0
  295. package/dist/text-shimmer/text-shimmer.js +29 -0
  296. package/dist/text-shimmer/text-shimmer.js.map +1 -0
  297. package/dist/time-picker/time-picker.js +2 -2
  298. package/dist/time-picker/time-picker.js.map +1 -1
  299. package/dist/toast/index.d.ts +2 -2
  300. package/dist/toast/index.js +2 -2
  301. package/dist/toast/toast.d.ts +6 -0
  302. package/dist/toast/toast.js +82 -40
  303. package/dist/toast/toast.js.map +1 -1
  304. package/dist/tooltip/tooltip.d.ts +9 -2
  305. package/dist/tooltip/tooltip.js +7 -7
  306. package/dist/tooltip/tooltip.js.map +1 -1
  307. package/dist/treemap/index.d.ts +2 -0
  308. package/dist/treemap/index.js +2 -0
  309. package/dist/treemap/treemap.d.ts +53 -0
  310. package/dist/treemap/treemap.js +699 -0
  311. package/dist/treemap/treemap.js.map +1 -0
  312. package/dist/usage-meter/index.d.ts +2 -0
  313. package/dist/usage-meter/index.js +2 -0
  314. package/dist/usage-meter/usage-meter.d.ts +50 -0
  315. package/dist/usage-meter/usage-meter.js +440 -0
  316. package/dist/usage-meter/usage-meter.js.map +1 -0
  317. package/dist/waffle-chart/index.d.ts +2 -0
  318. package/dist/waffle-chart/index.js +2 -0
  319. package/dist/waffle-chart/waffle-chart.d.ts +57 -0
  320. package/dist/waffle-chart/waffle-chart.js +426 -0
  321. package/dist/waffle-chart/waffle-chart.js.map +1 -0
  322. package/package.json +165 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"line-chart.js","names":[],"sources":["../../src/line-chart/line-chart.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type KeyboardEvent,\n type PointerEvent,\n} from \"react\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { mergeRefs } from \"../lib/merge-refs.js\";\nimport { prefersReducedMotion, useIsomorphicLayoutEffect } from \"../lib/motion.js\";\nimport { SMOOTH, SNAPPY, tween } from \"../lib/spring-tween.js\";\n\n/**\n * LineChart: one or more measures over time, when the shape of the trend\n * matters more than any single value.\n *\n * The lines draw left to right the first time the chart is seen. New data\n * morphs every line from the shape on screen, and the value axis slides to its\n * new range while gridlines fade in and out. Hiding a series flattens it into\n * the baseline as it fades and the rest rescale. Hover, drag or the arrow keys\n * scrub: a crosshair glides between points with a dot on each line and a\n * tooltip that follows on its own spring and flips before it leaves the plot.\n * `loading` keeps the current lines on screen, dimmed and breathing.\n *\n * Plain SVG and CSS; one small spring tween drives the shapes, the scale and\n * the crosshair. A visually hidden table carries every value for assistive\n * technology, and the plot itself is a slider.\n */\nexport interface LineChartSeries {\n /** Stable identity. A series keeps its line across data changes, so switching ranges morphs it. */\n key: string;\n /** Name in the legend, the tooltip and the data table. */\n label: string;\n /** Any CSS colour. Defaults to chart-1 for the first series, then quieter neutral steps. */\n color?: string;\n /** A dashed stroke, for a previous period or a target. */\n dashed?: boolean;\n /** A faint fill under the line. Defaults to true for the first series. */\n area?: boolean;\n}\n\nexport interface LineChartDatum {\n /** Stable identity, such as an ISO date. */\n key: string;\n /** Full label for the tooltip and screen readers, such as \"Tue, Sep 15\". */\n label: string;\n /** Short label on the x axis. Leave it out to keep the axis quiet at that point. */\n axisLabel?: string;\n /** One value per series key. A missing value counts as zero. */\n values: Record<string, number | undefined>;\n}\n\nexport interface LineChartProps {\n data: LineChartDatum[];\n series: LineChartSeries[];\n /** What is measured, such as \"Signups\". Names the chart for assistive technology. */\n label: string;\n /** Unit after each value in the tooltip, such as \"ms\". */\n unit?: string;\n /** Plot height in pixels. The width follows the container. @default 220 */\n height?: number;\n /** Formats values in the tooltip and data table. */\n formatValue?: (value: number, series: LineChartSeries) => string;\n /** Formats the value axis. Defaults to a compact number, such as 1.2K. */\n formatTick?: (value: number) => string;\n /** Controlled hidden series keys. */\n hiddenSeries?: string[];\n defaultHiddenSeries?: string[];\n onHiddenSeriesChange?: (hidden: string[]) => void;\n /** Called as the crosshair moves, and with null when it leaves. */\n onActiveChange?: (index: number | null, datum: LineChartDatum | null) => void;\n /** Keeps the current lines on screen, dimmed, while the next range loads. */\n loading?: boolean;\n /** Shown when there are no points. @default \"No data for this range\" */\n emptyLabel?: string;\n /** Series toggles above the plot. Shown by default when there is more than one series. */\n legend?: boolean;\n /** Header of the first column in the data table read by screen readers. @default \"Date\" */\n categoryLabel?: string;\n /** Smooth monotone curves that never swing past the data, or straight segments. @default \"smooth\" */\n curve?: \"smooth\" | \"linear\";\n /** Extra classes for the root. Merged last. */\n className?: string;\n}\n\ntype Point = [x: number, value: number];\ntype Track = { shape: Point[]; presence: number; stop: (() => void) | null };\n\n/** Room above the top gridline, and the gap between the crosshair and its tooltip. */\nconst TOP = 12;\nconst GAP = 14;\n/** The first draw: 480ms x 1.75, slow at both ends. */\nexport const LINE_CHART_DRAW_MS = 840;\nconst PALETTE = [\n \"var(--color-chart-1)\",\n \"color-mix(in oklab, var(--color-foreground) 46%, var(--color-surface))\",\n \"color-mix(in oklab, var(--color-foreground) 26%, var(--color-surface))\",\n];\nconst GROUPED = new Intl.NumberFormat(\"en-US\", { maximumFractionDigits: 1 });\nconst COMPACT = new Intl.NumberFormat(\"en-US\", { notation: \"compact\", maximumFractionDigits: 1 });\nconst GRID = Array.from({ length: 241 }, (_, index) => index / 240);\nconst clamp = (value: number, low: number, high: number) => Math.min(high, Math.max(low, value));\nconst colorOf = (line: LineChartSeries, index: number) =>\n line.color ?? PALETTE[Math.min(index, PALETTE.length - 1)]!;\nconst clean = (value: number) => Number(value.toPrecision(12));\n\n/** Clean gridlines: the smallest step of 1, 2, 2.5 or 5 that covers the data in four rows or fewer, from zero unless the data dips below it. */\nfunction niceScale(low: number, high: number) {\n const lo = Math.min(0, low);\n const hi = Math.max(high, lo + 1);\n const magnitude = 10 ** Math.floor(Math.log10((hi - lo) / 4));\n for (const factor of [1, 2, 2.5, 5, 10]) {\n const step = factor * magnitude;\n const bottom = Math.floor(lo / step) * step;\n const top = Math.ceil(hi / step) * step;\n if ((top - bottom) / step <= 4 + 1e-9) {\n const ticks: number[] = [];\n for (let value = bottom; value <= top + step / 2; value += step) ticks.push(clean(value));\n return { min: clean(bottom), max: clean(top), ticks };\n }\n }\n return { min: lo, max: hi, ticks: [lo, hi] };\n}\n\n/** The line through every value, sampled densely on x from 0 to 1 in data units. Monotone tangents keep a smooth curve from swinging past the data. */\nfunction curveFor(values: number[], smooth: boolean): Point[] {\n if (values.length === 0) return [];\n if (values.length === 1) return [[0, values[0]!], [1, values[0]!]];\n const last = values.length - 1;\n const step = 1 / last;\n if (!smooth) return values.map((value, index) => [index * step, value]);\n const slopes = values.slice(1).map((value, index) => (value - values[index]!) / step);\n const tangents = values.map((_, index) =>\n index === 0 || index === last\n ? 0\n : (Math.sign(slopes[index - 1]!) + Math.sign(slopes[index]!)) *\n Math.min(\n Math.abs(slopes[index - 1]!),\n Math.abs(slopes[index]!),\n Math.abs(slopes[index - 1]! + slopes[index]!) / 4,\n ) || 0,\n );\n if (last > 1) {\n tangents[0] = (3 * slopes[0]! - tangents[1]!) / 2;\n tangents[last] = (3 * slopes[last - 1]! - tangents[last - 1]!) / 2;\n } else {\n tangents[0] = slopes[0]!;\n tangents[1] = slopes[0]!;\n }\n const samples = Math.max(1, Math.min(16, Math.round(192 / last)));\n const points: Point[] = [];\n for (let index = 0; index < last; index++) {\n const low = Math.min(values[index]!, values[index + 1]!);\n const high = Math.max(values[index]!, values[index + 1]!);\n for (let sample = 0; sample < samples; sample++) {\n const t = sample / samples;\n const t2 = t * t;\n const t3 = t2 * t;\n const value =\n (2 * t3 - 3 * t2 + 1) * values[index]! +\n (t3 - 2 * t2 + t) * step * tangents[index]! +\n (3 * t2 - 2 * t3) * values[index + 1]! +\n (t3 - t2) * step * tangents[index + 1]!;\n points.push([(index + t) * step, clamp(value, low, high)]);\n }\n }\n points.push([1, values[last]!]);\n return points;\n}\n\n/** Value of a sampled line at x, straight between samples. */\nfunction valueAt(shape: Point[], x: number) {\n if (!shape.length) return 0;\n let low = 0;\n let high = shape.length - 1;\n if (x <= shape[low]![0]) return shape[low]![1];\n if (x >= shape[high]![0]) return shape[high]![1];\n while (high - low > 1) {\n const middle = (low + high) >> 1;\n if (shape[middle]![0] < x) low = middle;\n else high = middle;\n }\n const [x0, y0] = shape[low]!;\n const [x1, y1] = shape[high]!;\n return x1 === x0 ? y1 : y0 + ((y1 - y0) * (x - x0)) / (x1 - x0);\n}\n\n/** Axis labels that fit: at most one per 76 pixels, counted back from the latest so the newest always shows. */\nfunction axisPicks(data: LineChartDatum[], width: number) {\n const labeled = data.flatMap((item, index) => (item.axisLabel ? [index] : []));\n if (!width || !labeled.length) return [];\n const room = Math.max(2, Math.floor(width / 76));\n const stride = Math.ceil(labeled.length / room);\n return labeled\n .reverse()\n .filter((_, rank) => rank % stride === 0)\n .reverse();\n}\n\nexport const LineChart = forwardRef<HTMLElement, LineChartProps>(function LineChart(\n {\n data,\n series,\n label,\n unit = \"\",\n height = 220,\n formatValue,\n formatTick = (value) => COMPACT.format(value),\n hiddenSeries,\n defaultHiddenSeries,\n onHiddenSeriesChange,\n onActiveChange,\n loading = false,\n emptyLabel = \"No data for this range\",\n legend,\n categoryLabel = \"Date\",\n curve = \"smooth\",\n className,\n },\n ref,\n) {\n const figure = useRef<HTMLElement | null>(null);\n const refs = useMemo(() => mergeRefs(ref, figure), [ref]);\n const plot = useRef<HTMLDivElement>(null);\n const svg = useRef<SVGSVGElement>(null);\n const tip = useRef<HTMLDivElement>(null);\n const gutter = useRef<HTMLDivElement>(null);\n const uid = `line${useId().replace(/[^a-zA-Z0-9_-]/g, \"\")}`;\n const last = data.length - 1;\n const empty = data.length === 0;\n\n const [ownHidden, setOwnHidden] = useState<string[]>(defaultHiddenSeries ?? []);\n const hidden = hiddenSeries ?? ownHidden;\n const toggle = (key: string) => {\n const next = hidden.includes(key) ? hidden.filter((item) => item !== key) : [...hidden, key];\n if (hiddenSeries === undefined) setOwnHidden(next);\n onHiddenSeriesChange?.(next);\n };\n const visible = series.filter((line) => !hidden.includes(line.key));\n const showLegend = legend ?? series.length > 1;\n\n // Each series becomes a dense curve in data units; the scale fits only the series on show.\n const signature = `${curve}|${series.map((line) => line.key).join(\",\")}|${data\n .map((item) => `${item.key}:${series.map((line) => item.values[line.key] ?? 0).join(\",\")}`)\n .join(\";\")}`;\n const targets = useMemo(\n () =>\n new Map(\n series.map((line) => [\n line.key,\n curveFor(\n data.map((item) => item.values[line.key] ?? 0),\n curve === \"smooth\",\n ),\n ]),\n ),\n // The signature captures everything the curves read.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [signature],\n );\n let low = Infinity;\n let high = -Infinity;\n for (const line of visible) {\n for (const item of data) {\n const value = item.values[line.key] ?? 0;\n low = Math.min(low, value);\n high = Math.max(high, value);\n }\n }\n const range = Number.isFinite(low) ? niceScale(low, high) : null;\n const [steady, setSteady] = useState(() => range ?? niceScale(0, 100));\n if (range && (range.min !== steady.min || range.max !== steady.max)) setSteady(range);\n\n // Scrubbing: a new range lets go of the crosshair.\n const [active, setActive] = useState<number | null>(null);\n const [seen, setSeen] = useState(signature);\n if (seen !== signature) {\n setSeen(signature);\n setActive(null);\n }\n const index = active === null || empty ? null : Math.min(active, last);\n const scrubbing = index !== null;\n\n const width = useRef(0);\n const [plotWidth, setPlotWidth] = useState(0);\n const [drawn, setDrawn] = useState(false);\n const tracks = useRef(new Map<string, Track>());\n const scale = useRef({ min: steady.min, max: steady.max });\n const cursor = useRef(1);\n const live = useRef({ series, hidden });\n useIsomorphicLayoutEffect(() => {\n live.current = { series, hidden };\n });\n\n /** One writer for every drawn attribute: morphs, toggles, the scale, the crosshair and the size all repaint through here. */\n const paint = useCallback(() => {\n const w = width.current;\n const root = svg.current;\n if (!w || !root) return;\n const lo = scale.current.min;\n const span = scale.current.max - lo || 1;\n const toY = (value: number) => TOP + (1 - (value - lo) / span) * (height - TOP);\n const at = cursor.current;\n const dotYs: number[] = [];\n for (const line of live.current.series) {\n const track = tracks.current.get(line.key);\n if (!track) continue;\n const p = track.presence;\n const y = (value: number) => toY(lo + (value - lo) * p);\n const path = track.shape.length\n ? `M${track.shape.map(([x, value]) => `${(x * w).toFixed(1)},${y(value).toFixed(1)}`).join(\"L\")}`\n : \"\";\n const group = root.querySelector<SVGGElement>(`[data-series=\"${CSS.escape(line.key)}\"]`);\n group?.querySelector(\"[data-part=line]\")?.setAttribute(\"d\", path);\n group?.querySelector(\"[data-part=area]\")?.setAttribute(\"d\", path ? `${path}L${w},${height}L0,${height}Z` : \"\");\n if (group) group.style.opacity = String(p);\n const dot = root.querySelector<SVGCircleElement>(`[data-dot=\"${CSS.escape(line.key)}\"]`);\n if (dot && track.shape.length) {\n const cy = y(valueAt(track.shape, at));\n dot.setAttribute(\"cx\", (at * w).toFixed(1));\n dot.setAttribute(\"cy\", cy.toFixed(1));\n if (p > 0.5) dotYs.push(cy);\n }\n }\n // Gridlines and tick labels ride the scale.\n for (const node of root.querySelectorAll<SVGLineElement>(\"[data-grid]\")) {\n const yy = String(Math.round(toY(Number(node.dataset.grid))) + 0.5);\n node.setAttribute(\"y1\", yy);\n node.setAttribute(\"y2\", yy);\n }\n for (const node of gutter.current?.querySelectorAll<HTMLElement>(\"[data-tick]\") ?? []) {\n node.style.translate = `0 ${Math.round(toY(Number(node.dataset.tick)))}px`;\n }\n const cx = Math.round(at * w) + 0.5;\n const cross = root.querySelector(\"[data-part=crosshair]\");\n cross?.setAttribute(\"x1\", String(cx));\n cross?.setAttribute(\"x2\", String(cx));\n // The tooltip sits beside the crosshair, flips sides before it would leave the plot, and centres on the points it describes.\n const bubble = tip.current;\n if (bubble) {\n const tw = bubble.offsetWidth;\n const th = bubble.offsetHeight;\n let x = cx + GAP;\n if (x + tw > w) x = cx - GAP - tw;\n const middle = dotYs.length ? dotYs.reduce((sum, value) => sum + value, 0) / dotYs.length : height / 2;\n bubble.style.translate = `${clamp(x, 0, Math.max(0, w - tw))}px ${clamp(middle - th / 2, 0, Math.max(0, height - th))}px`;\n }\n }, [height]);\n\n // The plot draws in its own pixels: measure the width and follow resizes.\n useIsomorphicLayoutEffect(() => {\n const node = plot.current;\n if (!node) return;\n const read = () => {\n width.current = node.clientWidth;\n setPlotWidth(node.clientWidth);\n paint();\n };\n read();\n if (typeof ResizeObserver === \"undefined\") return;\n const observer = new ResizeObserver(read);\n observer.observe(node);\n return () => observer.disconnect();\n }, [paint]);\n useIsomorphicLayoutEffect(paint);\n\n // New data morphs every line from the shape on screen, sampled on shared x positions so a range that gains or loses points still flows.\n useEffect(() => {\n const moves: { track: Track; xs: number[]; from: number[]; to: number[]; target: Point[] }[] = [];\n for (const [key, target] of targets) {\n const track = tracks.current.get(key);\n if (!track) {\n tracks.current.set(key, { shape: target, presence: live.current.hidden.includes(key) ? 0 : 1, stop: null });\n continue;\n }\n if (!track.shape.length || !target.length) {\n track.shape = target;\n continue;\n }\n const xs = [...new Set([...GRID, ...target.map(([x]) => x)])].sort((a, b) => a - b);\n moves.push({ track, xs, from: xs.map((x) => valueAt(track.shape, x)), to: xs.map((x) => valueAt(target, x)), target });\n }\n if (!moves.length) {\n paint();\n return;\n }\n return tween(\n SMOOTH,\n (p) => {\n for (const move of moves) {\n move.track.shape = move.xs.map((x, at): Point => [x, move.from[at]! + (move.to[at]! - move.from[at]!) * p]);\n }\n paint();\n },\n () => {\n for (const move of moves) move.track.shape = move.target;\n paint();\n },\n );\n }, [paint, targets]);\n\n // A hidden series flattens into the baseline as it fades; the ones that stay rescale around it.\n const hiddenKey = hidden.join(\"|\");\n useEffect(() => {\n for (const [key, track] of tracks.current) {\n const to = hidden.includes(key) ? 0 : 1;\n if (track.presence === to) continue;\n track.stop?.();\n const from = track.presence;\n track.stop = tween(SMOOTH, (p) => {\n track.presence = from + (to - from) * p;\n paint();\n });\n }\n paint();\n // hiddenKey stands for `hidden`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [hiddenKey, paint]);\n\n // The value axis slides to its new range on the smooth spring.\n useEffect(() => {\n const from = { ...scale.current };\n if (from.min === steady.min && from.max === steady.max) return;\n return tween(SMOOTH, (p) => {\n scale.current = { min: from.min + (steady.min - from.min) * p, max: from.max + (steady.max - from.max) * p };\n paint();\n });\n }, [paint, steady]);\n\n // The lines draw left to right the first time the chart is seen with data.\n useEffect(() => {\n if (empty || drawn) return;\n const node = figure.current;\n if (!node || prefersReducedMotion() || typeof IntersectionObserver === \"undefined\") {\n setDrawn(true);\n return;\n }\n const observer = new IntersectionObserver(\n ([entry]) => {\n if (!entry?.isIntersecting) return;\n observer.disconnect();\n setDrawn(true);\n },\n { threshold: 0.3 },\n );\n observer.observe(node);\n return () => observer.disconnect();\n }, [drawn, empty]);\n\n // The crosshair appears on the first scrubbed point and glides between the ones after it.\n const wasScrubbing = useRef(false);\n useEffect(() => {\n if (index === null) {\n wasScrubbing.current = false;\n return;\n }\n const to = last > 0 ? index / last : 0.5;\n const from = cursor.current;\n if (!wasScrubbing.current) {\n wasScrubbing.current = true;\n cursor.current = to;\n paint();\n return;\n }\n return tween(SNAPPY, (p) => {\n cursor.current = from + (to - from) * p;\n paint();\n });\n }, [index, last, paint]);\n\n const onActive = useRef(onActiveChange);\n useIsomorphicLayoutEffect(() => {\n onActive.current = onActiveChange;\n });\n useEffect(() => {\n onActive.current?.(index, index === null ? null : (data[index] ?? null));\n // Report only when the scrubbed point changes.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [index]);\n\n const pointAt = (clientX: number) => {\n const rect = plot.current?.getBoundingClientRect();\n if (!rect?.width || last < 1) return Math.max(0, last);\n return clamp(Math.round(((clientX - rect.left) / rect.width) * last), 0, last);\n };\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.key === \"Escape\" && scrubbing) {\n event.preventDefault();\n setActive(null);\n return;\n }\n const from = index ?? last + 1;\n const page = Math.max(1, Math.round(data.length / 6));\n const next = (\n {\n ArrowLeft: from - 1,\n ArrowDown: from - 1,\n ArrowRight: index === null ? last : from + 1,\n ArrowUp: index === null ? last : from + 1,\n PageDown: from - page,\n PageUp: from + page,\n Home: 0,\n End: last,\n } as Record<string, number>\n )[event.key];\n if (next === undefined || empty) return;\n event.preventDefault();\n setActive(clamp(next, 0, last));\n };\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (empty) return;\n if (event.pointerType !== \"mouse\") event.currentTarget.setPointerCapture?.(event.pointerId);\n setActive(pointAt(event.clientX));\n };\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n if (!empty && (event.pointerType === \"mouse\" || event.buttons)) setActive(pointAt(event.clientX));\n };\n\n const format = (value: number, line: LineChartSeries) =>\n `${formatValue ? formatValue(value, line) : GROUPED.format(value)}${unit ? ` ${unit}` : \"\"}`;\n const reading = index === null ? null : data[index];\n const shown = reading ?? data[last];\n const valueText = reading\n ? `${reading.label}: ${visible.map((line) => `${line.label} ${format(reading.values[line.key] ?? 0, line)}`).join(\", \")}`\n : empty\n ? emptyLabel\n : `${visible.length} of ${series.length} series shown`;\n const summary = empty\n ? `${label}. ${emptyLabel}.`\n : `${label}, ${data[0]!.label} to ${data[last]!.label}. ${visible\n .map((line) => `${line.label}, latest ${format(data[last]!.values[line.key] ?? 0, line)}`)\n .join(\". \")}.`;\n const picks = axisPicks(data, plotWidth);\n const allHidden = !empty && visible.length === 0;\n\n return (\n <figure\n ref={refs}\n data-slot=\"line-chart\"\n aria-label={label}\n aria-busy={loading || undefined}\n className={cn(\"m-0 grid min-w-0 gap-4 box-border font-sans text-foreground\", className)}\n >\n {showLegend ? (\n <div role=\"group\" aria-label={`${label} series`} className=\"-mx-2 flex min-w-0 flex-wrap gap-x-1 gap-y-0.5\">\n {series.map((line, at) => (\n <button\n key={line.key}\n type=\"button\"\n data-slot=\"line-chart-toggle\"\n aria-pressed={!hidden.includes(line.key)}\n onClick={() => toggle(line.key)}\n style={{ \"--series\": colorOf(line, at) } as CSSProperties}\n className=\"chart-legend-toggle\"\n >\n <span aria-hidden=\"true\" data-dashed={line.dashed || undefined} className=\"chart-swatch\" />\n <span className=\"chart-toggle-label\">{line.label}</span>\n </button>\n ))}\n </div>\n ) : null}\n <div\n data-slot=\"line-chart-chart\"\n data-scrubbing={scrubbing || undefined}\n data-loading={loading || undefined}\n data-drawn={drawn || undefined}\n className=\"line-chart-frame\"\n >\n <div\n ref={plot}\n data-slot=\"line-chart-plot\"\n role=\"slider\"\n tabIndex={empty ? -1 : 0}\n aria-label={`${label}, explore by ${categoryLabel.toLowerCase()}`}\n aria-orientation=\"horizontal\"\n aria-valuemin={1}\n aria-valuemax={Math.max(1, data.length)}\n aria-valuenow={(index ?? last) + 1}\n aria-valuetext={valueText}\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={(event) => {\n if (event.pointerType !== \"mouse\") setActive(null);\n }}\n onPointerCancel={() => setActive(null)}\n onPointerLeave={(event) => {\n if (event.pointerType === \"mouse\") setActive(null);\n }}\n onKeyDown={onKeyDown}\n onBlur={() => setActive(null)}\n onFocus={(event) => {\n if (event.currentTarget.matches(\":focus-visible\") && !empty) setActive((current) => current ?? last);\n }}\n className=\"line-chart-plot\"\n style={{ height }}\n >\n <svg ref={svg} width=\"100%\" height={height} aria-hidden=\"true\" focusable=\"false\" className=\"block overflow-visible\">\n <defs>\n <clipPath id={`${uid}-draw`} clipPathUnits=\"userSpaceOnUse\">\n <rect className=\"line-chart-reveal\" x={-8} y={-16} height={height + 32} style={{ width: drawn ? plotWidth + 16 : 0 }} />\n </clipPath>\n </defs>\n {steady.ticks.slice(1).map((value) => (\n <line key={value} data-grid={value} className=\"line-chart-grid\" x1={0} x2=\"100%\" />\n ))}\n <line className=\"line-chart-baseline\" x1={0} x2=\"100%\" y1={height - 0.5} y2={height - 0.5} />\n <line data-part=\"crosshair\" className=\"line-chart-crosshair\" y1={TOP - 4} y2={height} />\n <g className=\"line-chart-series\" clipPath={`url(#${uid}-draw)`}>\n {series.map((line, at) => (\n <g key={line.key} data-series={line.key} style={{ \"--series\": colorOf(line, at) } as CSSProperties}>\n {(line.area ?? at === 0) ? <path data-part=\"area\" className=\"line-chart-area\" /> : null}\n <path data-part=\"line\" data-dashed={line.dashed || undefined} className=\"line-chart-line\" />\n </g>\n ))}\n </g>\n {series.map((line, at) => (\n <circle\n key={line.key}\n data-dot={line.key}\n data-hidden={hidden.includes(line.key) || undefined}\n r={4}\n className=\"line-chart-dot\"\n style={{ \"--series\": colorOf(line, at) } as CSSProperties}\n />\n ))}\n </svg>\n <div ref={tip} aria-hidden=\"true\" data-slot=\"line-chart-tooltip\" className=\"line-chart-tooltip\">\n <p className=\"m-0 mb-0.5 whitespace-nowrap text-xs tabular-nums text-text-secondary\">{shown?.label ?? \"\"}</p>\n {visible.map((line) => (\n <p\n key={line.key}\n className=\"m-0 flex min-w-0 items-center gap-2 text-sm\"\n style={{ \"--series\": colorOf(line, series.indexOf(line)) } as CSSProperties}\n >\n <span data-dashed={line.dashed || undefined} className=\"chart-tip-swatch\" />\n <span className=\"min-w-0 flex-1 truncate text-text-secondary\">{line.label}</span>\n <span className=\"ms-2 flex-none whitespace-nowrap font-medium tabular-nums text-foreground\">\n {format(shown?.values[line.key] ?? 0, line)}\n </span>\n </p>\n ))}\n </div>\n {(empty || allHidden) && !loading ? (\n <p className=\"absolute inset-0 m-0 grid place-items-center text-sm text-muted-foreground pointer-events-none motion-safe:animate-fade-in\">\n {empty ? emptyLabel : \"Choose a series to show\"}\n </p>\n ) : null}\n {loading && empty ? <span aria-hidden=\"true\" className=\"chart-skeleton\" /> : null}\n </div>\n <div ref={gutter} aria-hidden=\"true\" className=\"relative min-w-0 [grid-area:1/2]\">\n {steady.ticks.map((value) => (\n <span key={value} data-tick={value} className=\"line-chart-tick motion-safe:animate-fade-in\">\n <span className=\"block -translate-y-1/2 text-xs leading-none tabular-nums text-muted-foreground\">\n {formatTick(value)}\n </span>\n </span>\n ))}\n </div>\n <div aria-hidden=\"true\" className=\"relative min-w-0 [grid-area:2/1]\">\n {picks.map((at) => {\n const share = last > 0 ? at / last : 0.5;\n return (\n <span\n key={`${data[at]!.key}:${data[at]!.axisLabel}`}\n className=\"absolute top-2 whitespace-nowrap text-xs leading-none tabular-nums text-muted-foreground motion-safe:animate-fade-in\"\n style={{ left: `${share * 100}%`, translate: `${-share * 100}% 0` }}\n >\n {data[at]!.axisLabel}\n </span>\n );\n })}\n </div>\n </div>\n <p className=\"sr-only\">{summary}</p>\n {empty ? null : (\n <div className=\"sr-only\">\n <table>\n <caption>{label}</caption>\n <thead>\n <tr>\n <th scope=\"col\">{categoryLabel}</th>\n {series.map((line) => (\n <th key={line.key} scope=\"col\">\n {line.label}\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {data.map((item) => (\n <tr key={item.key}>\n <th scope=\"row\">{item.label}</th>\n {series.map((line) => (\n <td key={line.key}>{format(item.values[line.key] ?? 0, line)}</td>\n ))}\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n )}\n <p className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {loading ? \"Loading\" : \"\"}\n </p>\n </figure>\n );\n});\n"],"mappings":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IAAI;SAAI,WAAW,GAAG,CAAC,QAAQ,IAAI;QAAK;QAEjE,UAAA,KAAK,GAAG,CAAE;OACP,GALC,GAAG,KAAK,GAAG,CAAE,IAAI,GAAG,KAAK,GAAG,CAAE,WAK/B;MAEV,CAAC;KACE,CAAA;IACF;;GACL,oBAAC,KAAD;IAAG,WAAU;IAAW,UAAA;GAAW,CAAA;GAClC,QAAQ,OACP,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,qBAAC,SAAD,EAAA,UAAA;KACE,oBAAC,WAAD,EAAA,UAAU,MAAe,CAAA;KACzB,oBAAC,SAAD,EAAA,UACE,qBAAC,MAAD,EAAA,UAAA,CACE,oBAAC,MAAD;MAAI,OAAM;MAAO,UAAA;KAAkB,CAAA,GAClC,OAAO,KAAK,SACX,oBAAC,MAAD;MAAmB,OAAM;MACtB,UAAA,KAAK;KACJ,GAFK,KAAK,GAEV,CACL,CACC,EAAA,CAAA,EACC,CAAA;KACP,oBAAC,SAAD,EAAA,UACG,KAAK,KAAK,SACT,qBAAC,MAAD,EAAA,UAAA,CACE,oBAAC,MAAD;MAAI,OAAM;MAAO,UAAA,KAAK;KAAU,CAAA,GAC/B,OAAO,KAAK,SACX,oBAAC,MAAD,EAAA,UAAoB,OAAO,KAAK,OAAO,KAAK,QAAQ,GAAG,IAAI,EAAM,GAAxD,KAAK,GAAmD,CAClE,CACC,EAAA,GALK,KAAK,GAKV,CACL,EACI,CAAA;IACF,EAAA,CAAA;GACJ,CAAA;GAEP,oBAAC,KAAD;IAAG,WAAU;IAAU,aAAU;IAAS,eAAY;IACnD,UAAA,UAAU,YAAY;GACtB,CAAA;EACG;;AAEZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { Mention, MentionChannel, MentionInput, MentionInputHandle, MentionInputProps, MentionKind, MentionPerson, MentionValue, mentionText, serializeMentions } from "./mention-input.js";
2
+ export { type Mention, type MentionChannel, MentionInput, type MentionInputHandle, type MentionInputProps, type MentionKind, type MentionPerson, type MentionValue, mentionText, serializeMentions };
@@ -0,0 +1,2 @@
1
+ import { MentionInput, mentionText, serializeMentions } from "./mention-input.js";
2
+ export { MentionInput, mentionText, serializeMentions };
@@ -0,0 +1,98 @@
1
+ //#region src/mention-input/mention-input.d.ts
2
+ export type MentionKind = "person" | "channel";
3
+ export interface MentionPerson {
4
+ id: string;
5
+ name: string;
6
+ /** One short line under the name, such as a job title. */
7
+ role?: string;
8
+ /** Portrait URL. Initials show when it is missing. */
9
+ avatar?: string;
10
+ }
11
+ export interface MentionChannel {
12
+ id: string;
13
+ name: string;
14
+ description?: string;
15
+ members?: number;
16
+ }
17
+ /** A mention inside `text`. `start` and `end` are character offsets; the text between them is `@label` or `#label`. */
18
+ export interface Mention {
19
+ kind: MentionKind;
20
+ id: string;
21
+ label: string;
22
+ start: number;
23
+ end: number;
24
+ }
25
+ export interface MentionValue {
26
+ text: string;
27
+ mentions: Mention[];
28
+ }
29
+ export interface MentionInputHandle {
30
+ focus: () => void;
31
+ /** Inserts text at the caret, as if typed. */
32
+ insert: (text: string) => void;
33
+ /** Types a trigger at the caret so the suggestions open, adding a space first when needed. */
34
+ openSuggestions: (kind: MentionKind) => void;
35
+ clear: () => void;
36
+ textarea: HTMLTextAreaElement | null;
37
+ }
38
+ /**
39
+ * MentionInput: a text area with `@` people and `#` channel mentions. Typing a
40
+ * trigger opens a list of suggestions at the caret; choosing one turns the
41
+ * trigger and what was typed after it into a mention token. A token is atomic:
42
+ * the caret steps over it, a click lands on its nearest edge, and one Backspace
43
+ * removes all of it (and one undo brings it back). The value is plain text plus
44
+ * a `mentions` array of offsets, ready to store or to notify from.
45
+ *
46
+ * It is a real `<textarea>`, not a contenteditable. The tokens are drawn by a
47
+ * mirror layer under the textarea's own transparent text, which shares every
48
+ * metric with it, so each token sits exactly under its characters. That keeps
49
+ * native editing, selection, spellcheck, IME and undo, at a cost: a token can
50
+ * be tinted but not laid out (no avatar or padding inside the text), and a line
51
+ * wrap inside a long token follows the text's own wrap.
52
+ *
53
+ * The list is the component's own listbox, as the textarea is the combobox
54
+ * (`aria-activedescendant`), so React Aria's ComboBox, which owns a one-line
55
+ * input, does not fit.
56
+ */
57
+ export interface MentionInputProps {
58
+ /** What the field is for, and its accessible name. */
59
+ label: string;
60
+ /** Render the label for screen readers only. */
61
+ labelHidden?: boolean;
62
+ value?: MentionValue;
63
+ defaultValue?: MentionValue;
64
+ onValueChange?: (value: MentionValue) => void;
65
+ /** People offered after `@`. Leave it out to turn person mentions off. */
66
+ people?: MentionPerson[];
67
+ /** Channels offered after `#`. Leave it out to turn channel mentions off. */
68
+ channels?: MentionChannel[];
69
+ /** Called when a suggestion becomes a mention. */
70
+ onMentionAdd?: (mention: Mention) => void;
71
+ /** With `submitOnEnter`, Enter submits and Shift+Enter adds a line. */
72
+ onSubmit?: (value: MentionValue) => void;
73
+ submitOnEnter?: boolean;
74
+ placeholder?: string;
75
+ /** @default 1 */
76
+ minRows?: number;
77
+ /** The field grows to this many rows, then scrolls. @default 8 */
78
+ maxRows?: number;
79
+ /** Where suggestions open. `auto` flips above when there is no room below. @default "auto" */
80
+ placement?: "auto" | "top" | "bottom";
81
+ /** @default 6 */
82
+ maxSuggestions?: number;
83
+ /** Helper text under the field. A string, because the copy is animated word by word. */
84
+ description?: string;
85
+ /** Error text under the field. It also marks the field invalid. */
86
+ error?: string;
87
+ disabled?: boolean;
88
+ name?: string;
89
+ id?: string;
90
+ /** Extra classes for the wrapper. Merged last. */
91
+ className?: string;
92
+ }
93
+ export declare const mentionText: (kind: MentionKind, label: string) => string;
94
+ /** Turns a value into storage-friendly text, `<@id>` for people and `<#id>` for channels by default. */
95
+ export declare function serializeMentions(value: MentionValue, format?: (mention: Mention) => string): string;
96
+ export declare const MentionInput: import("react").ForwardRefExoticComponent<MentionInputProps & import("react").RefAttributes<MentionInputHandle>>;
97
+ //#endregion
98
+ //# sourceMappingURL=mention-input.d.ts.map