@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":"brush-chart.js","names":[],"sources":["../../src/brush-chart/brush-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 { live, retarget, SMOOTH, tween } from \"../lib/spring-tween.js\";\n\n/**\n * BrushChart: a long, dense time series, when people need the whole history\n * and a close look at any stretch of it.\n *\n * A main plot shows the window; an overview strip under it shows everything.\n * Drag the window to pan, drag an edge to resize it, drag empty track to draw\n * a new window, tap to recentre, double tap (or Escape) to show it all. Zoomed\n * out, a seven point average and its low to high band replace the raw line so\n * dense weeks read as texture; zoomed in, the raw line fades in. The value\n * axis springs to the tallest point in view. Hover, drag or the arrow keys\n * scrub the plot: a crosshair and a tooltip with the day, the value and the\n * change against a week earlier. Annotations mark events on both charts.\n *\n * Plain SVG and CSS. The window, every path and the markers are written\n * straight to the DOM as the window moves, so a drag never re-renders the\n * chart. The plot and the window, and each edge, are sliders; a visually\n * hidden table carries every point in the window.\n */\nexport interface BrushChartDatum {\n /** A point in time, as a Date or epoch milliseconds. Points must be in ascending order. */\n date: Date | number;\n value: number;\n}\n\nexport interface BrushChartAnnotation {\n date: Date | number;\n /** Short label printed beside the marker, such as \"v2 launch\". */\n label: string;\n /** Longer note for the tooltip and screen readers. */\n description?: string;\n}\n\nexport interface BrushChartProps {\n data: BrushChartDatum[];\n /** What is measured, such as \"Daily active users\". Names the chart for assistive technology. */\n label: string;\n /** Unit after each value, such as \"users\". */\n unit?: string;\n formatValue?: (value: number) => string;\n /** Formats the value axis. Defaults to a compact number, such as 12K. */\n formatTick?: (value: number) => string;\n /** Formats a date in the tooltip and announcements. */\n formatDate?: (date: Date) => string;\n /** Events drawn as markers on both charts. */\n annotations?: BrushChartAnnotation[];\n /** Controlled window as [start, end] epoch milliseconds. A new value glides the window there. */\n range?: [number, number];\n /** Initial window when uncontrolled. Defaults to the whole series. */\n defaultRange?: [number, number];\n /** Called while the window is dragged, resized, stepped, or reset. */\n onRangeChange?: (range: [number, number]) => void;\n /** Smallest window in milliseconds. @default seven days */\n minSpan?: number;\n /** Main plot height in pixels. @default 240 */\n height?: number;\n /** Overview strip height in pixels. @default 52 */\n overviewHeight?: number;\n /** @default \"No data yet\" */\n emptyLabel?: string;\n /** Extra classes for the root. Merged last. */\n className?: string;\n}\n\ntype Point = { t: number; value: number };\ntype Window = [number, number];\ntype Drag = {\n mode: \"start\" | \"end\" | \"pan\" | \"new\";\n pointerX: number;\n from: Window;\n anchor: number;\n moved: boolean;\n};\n\nconst DAY = 86_400_000;\n/** Room above the top gridline, the gap between a point and its tooltip, and how close to an edge a press grabs it. */\nconst TOP = 28;\nconst GAP = 14;\nconst GRIP = 14;\n/** Width of an edge handle's hit area. */\nconst HANDLE = 28;\nconst COMPACT = new Intl.NumberFormat(\"en-US\", { notation: \"compact\", maximumFractionDigits: 1 });\nconst GROUPED = new Intl.NumberFormat(\"en-US\", { maximumFractionDigits: 1 });\nconst utc = (options: Intl.DateTimeFormatOptions) =>\n new Intl.DateTimeFormat(\"en-US\", { timeZone: \"UTC\", ...options });\nconst FULL_DATE = utc({ weekday: \"short\", month: \"short\", day: \"numeric\", year: \"numeric\" });\nconst DAY_TICK = utc({ month: \"short\", day: \"numeric\" });\nconst MONTH_TICK = utc({ month: \"short\" });\nconst YEAR_TICK = utc({ year: \"numeric\" });\nconst SHORT_DATE = utc({ month: \"short\", day: \"numeric\", year: \"numeric\" });\nconst clamp = (value: number, low: number, high: number) => Math.min(high, Math.max(low, value));\nconst time = (date: Date | number) => (typeof date === \"number\" ? date : date.getTime());\nconst clean = (value: number) => Number(value.toPrecision(12));\n\n/** Clean gridlines from zero: the smallest step of 1, 2, 2.5 or 5 that covers the data in four rows or fewer. */\nfunction niceTop(high: number) {\n const hi = Math.max(high, 1);\n const magnitude = 10 ** Math.floor(Math.log10(hi / 4));\n for (const factor of [1, 2, 2.5, 5, 10]) {\n const step = factor * magnitude;\n const top = Math.ceil(hi / step) * step;\n if (top / step <= 4 + 1e-9) return { top: clean(top), step: clean(step) };\n }\n return { top: hi, step: hi / 4 };\n}\n\n/** Calendar ticks that fit the width: days, weeks, then months, quarters and years, each landing on a real boundary. */\nfunction timeTicks(start: number, end: number, width: number) {\n const room = Math.max(2, Math.floor(width / 76));\n const span = end - start;\n for (const days of [1, 2, 7, 14]) {\n if (span / (days * DAY) > room) continue;\n const ticks: { t: number; label: string }[] = [];\n let t = Math.ceil(start / DAY) * DAY;\n if (days >= 7) while (new Date(t).getUTCDay() !== 1) t += DAY;\n for (; t <= end; t += days * DAY) ticks.push({ t, label: DAY_TICK.format(t) });\n return ticks;\n }\n for (const months of [1, 2, 3, 6, 12]) {\n if (span / (months * 30.44 * DAY) > room) continue;\n const ticks: { t: number; label: string }[] = [];\n const first = new Date(start);\n let y = first.getUTCFullYear();\n let m = first.getUTCMonth() + (first.getUTCDate() > 1 || first.getUTCHours() > 0 ? 1 : 0);\n for (;;) {\n y += Math.floor(m / 12);\n m %= 12;\n const t = Date.UTC(y, m, 1);\n if (t > end) break;\n if (m % months === 0)\n ticks.push({ t, label: m === 0 ? YEAR_TICK.format(t) : MONTH_TICK.format(t) });\n m += 1;\n }\n return ticks;\n }\n const ticks: { t: number; label: string }[] = [];\n for (let y = new Date(start).getUTCFullYear() + 1; Date.UTC(y, 0, 1) <= end; y++) {\n ticks.push({ t: Date.UTC(y, 0, 1), label: String(y) });\n }\n return ticks;\n}\n\n/** First index at or after t. */\nfunction lowerBound(points: { t: number }[], t: number) {\n let low = 0;\n let high = points.length;\n while (low < high) {\n const middle = (low + high) >> 1;\n if (points[middle]!.t < t) low = middle + 1;\n else high = middle;\n }\n return low;\n}\n\n/** A line through the points in view. Past two points per pixel, each pixel column keeps only its low and high so spikes survive. */\nfunction linePath(\n points: Point[],\n from: number,\n to: number,\n x: (t: number) => number,\n y: (value: number) => number,\n width: number,\n) {\n const slice = points.slice(Math.max(0, from), Math.min(points.length, to));\n if (!slice.length) return \"\";\n const parts: string[] = [];\n const add = (point: Point) => parts.push(`${x(point.t).toFixed(1)},${y(point.value).toFixed(1)}`);\n if (slice.length <= width * 2) {\n for (const point of slice) add(point);\n } else {\n let column = Number.NaN;\n let low: Point | null = null;\n let high: Point | null = null;\n const flush = () => {\n if (!low || !high) return;\n for (const point of low.t < high.t ? [low, high] : [high, low]) add(point);\n };\n for (const point of slice) {\n const at = Math.floor(x(point.t));\n if (at !== column) {\n flush();\n column = at;\n low = high = point;\n continue;\n }\n if (point.value < low!.value) low = point;\n if (point.value > high!.value) high = point;\n }\n flush();\n }\n return `M${parts.join(\"L\")}`;\n}\n\n/** A centred seven point average and its low to high band, each averaged once more so the edges ease instead of stepping. */\nfunction smoothed(points: Point[]) {\n const around = <T,>(index: number, read: (at: number) => T) => {\n const out: T[] = [];\n for (let at = Math.max(0, index - 3); at <= Math.min(points.length - 1, index + 3); at++)\n out.push(read(at));\n return out;\n };\n const raw = points.map((_, index) => {\n const values = around(index, (at) => points[at]!.value);\n return {\n value: values.reduce((sum, value) => sum + value, 0) / values.length,\n low: Math.min(...values),\n high: Math.max(...values),\n };\n });\n return points.map((point, index) => {\n const near = around(index, (at) => raw[at]!);\n return {\n t: point.t,\n value: raw[index]!.value,\n low: near.reduce((sum, item) => sum + item.low, 0) / near.length,\n high: near.reduce((sum, item) => sum + item.high, 0) / near.length,\n };\n });\n}\n\nexport const BrushChart = forwardRef<HTMLElement, BrushChartProps>(function BrushChart(\n {\n data,\n label,\n unit = \"\",\n formatValue = (value) => GROUPED.format(value),\n formatTick = (value) => COMPACT.format(value),\n formatDate = (date) => FULL_DATE.format(date),\n annotations,\n range,\n defaultRange,\n onRangeChange,\n minSpan = 7 * DAY,\n height = 240,\n overviewHeight = 52,\n emptyLabel = \"No data yet\",\n className,\n },\n ref,\n) {\n const uid = `brush${useId().replace(/[^a-zA-Z0-9-]/g, \"\")}`;\n const figure = useRef<HTMLElement | null>(null);\n const refs = useMemo(() => mergeRefs(ref, figure), [ref]);\n const plot = useRef<HTMLDivElement>(null);\n const plotSvg = useRef<SVGSVGElement>(null);\n const strip = useRef<HTMLDivElement>(null);\n const tip = useRef<HTMLDivElement>(null);\n const gutter = useRef<HTMLDivElement>(null);\n const axis = useRef<HTMLDivElement>(null);\n\n const points = useMemo<Point[]>(\n () => data.map((item) => ({ t: time(item.date), value: item.value })),\n [data],\n );\n const smooth = useMemo(() => smoothed(points), [points]);\n const events = useMemo(\n () =>\n (annotations ?? [])\n .map((item) => ({ ...item, t: time(item.date) }))\n .sort((a, b) => a.t - b.t),\n [annotations],\n );\n const empty = points.length < 2;\n const first = points[0]?.t ?? 0;\n const lastT = points[points.length - 1]?.t ?? 1;\n const whole: Window = [first, lastT];\n const fit = ([start, end]: Window): Window => {\n const span = clamp(end - start, Math.min(minSpan, lastT - first), lastT - first);\n const s = clamp(start, first, lastT - span);\n return [s, s + span];\n };\n\n // The window. `view` is where it is on screen right now; `shown` is the same, a few times a second, for what React renders.\n const view = useRef<Window>(range ?? defaultRange ?? whole);\n const [shown, setShown] = useState<Window>(view.current);\n const touched = useRef(false);\n const settleTimer = useRef(0);\n const flight = useRef<(() => void) | null>(null);\n const flush = useCallback(() => {\n window.clearTimeout(settleTimer.current);\n settleTimer.current = 0;\n setShown((now) =>\n now[0] === view.current[0] && now[1] === view.current[1] ? now : [...view.current],\n );\n }, []);\n const settleSoon = useCallback(() => {\n if (!settleTimer.current) settleTimer.current = window.setTimeout(flush, 100);\n }, [flush]);\n\n const latest = useRef({ points, smooth, events, first, lastT, height, overviewHeight, empty });\n const activeRef = useRef<{ index: number | null; event: number | null }>({\n index: null,\n event: null,\n });\n const plotW = useRef(0);\n const stripW = useRef(0);\n const topLive = useRef(live(0));\n const aimed = useRef<number | null>(null);\n const paintRef = useRef<() => void>(() => {});\n const [plotWidth, setPlotWidth] = useState(0);\n const [stripWidth, setStripWidth] = useState(0);\n\n /** One writer: the window, every path, the axes, the markers, the crosshair and the tooltip, straight onto the elements. */\n const paint = useCallback(() => {\n const L = latest.current;\n const w = plotW.current;\n const root = plotSvg.current;\n const sw = stripW.current;\n if (!root || L.empty) return;\n const [start, end] = view.current;\n const span = Math.max(1, end - start);\n const P = L.points;\n const x = (t: number) => ((t - start) / span) * w;\n const from = Math.max(0, lowerBound(P, start) - 1);\n const to = Math.min(P.length, lowerBound(P, end) + 1);\n let peak = 0;\n for (let index = from; index < to; index++) peak = Math.max(peak, P[index]!.value);\n const want = niceTop(peak * 1.04).top;\n // The value axis springs to the tallest point in view, so zooming into a quiet stretch fills the plot.\n if (aimed.current === null) {\n aimed.current = want;\n topLive.current.value = want;\n } else if (aimed.current !== want) {\n aimed.current = want;\n retarget(topLive.current, want, SMOOTH, () => paintRef.current());\n }\n const top = topLive.current.value || want;\n const H = L.height;\n const y = (value: number) => TOP + (1 - value / (top || 1)) * (H - TOP);\n // How much of the raw line shows: all of it past about four pixels a point, none below about three.\n const pxPerPoint = w && P.length > 1 ? (w * (L.lastT - L.first)) / (P.length - 1) / span : w;\n const detail = clamp((pxPerPoint - 2.75) / 1.5, 0, 1);\n\n if (w) {\n const line = linePath(P, from, to, x, y, w);\n const area = line\n ? `${line}L${x(P[to - 1]!.t).toFixed(1)},${H}L${x(P[from]!.t).toFixed(1)},${H}Z`\n : \"\";\n const S = L.smooth;\n const trend = linePath(S, from, to, x, y, w * 4);\n const upper = linePath(\n S.map((point) => ({ t: point.t, value: point.high })),\n from,\n to,\n x,\n y,\n w * 4,\n );\n const lower = linePath(\n S.map((point) => ({ t: point.t, value: point.low })),\n from,\n to,\n x,\n y,\n w * 4,\n );\n const band = trend ? `${upper}L${lower.slice(1).split(\"L\").reverse().join(\"L\")}Z` : \"\";\n const set = (part: string, d: string, opacity: number) => {\n const node = root.querySelector<SVGPathElement>(`[data-part=${part}]`);\n node?.setAttribute(\"d\", d);\n if (node) node.style.opacity = String(opacity);\n };\n set(\"line\", line, detail);\n set(\"area\", area, detail);\n set(\"trend\", trend, 1 - detail);\n set(\"band\", band, 1 - detail);\n }\n for (const node of root.querySelectorAll<SVGLineElement>(\"[data-grid]\")) {\n const value = Number(node.dataset.grid);\n const yy = String(Math.round(y(value)) + 0.5);\n node.setAttribute(\"y1\", yy);\n node.setAttribute(\"y2\", yy);\n node.style.visibility = value > top * 1.001 ? \"hidden\" : \"visible\";\n }\n for (const node of gutter.current?.querySelectorAll<HTMLElement>(\"[data-tick]\") ?? []) {\n const value = Number(node.dataset.tick);\n node.style.translate = `0 ${Math.round(y(value))}px`;\n node.style.visibility = value > top * 1.001 ? \"hidden\" : \"visible\";\n }\n for (const node of axis.current?.querySelectorAll<HTMLElement>(\"[data-t]\") ?? []) {\n const px = x(Number(node.dataset.t));\n node.style.left = `${px}px`;\n node.style.translate = `${px < 24 ? 0 : px > w - 24 ? -100 : -50}% 0`;\n }\n\n // Event markers: placed where they fall in the window, labelled left to right and skipped when they would collide with the one before.\n const marks = [...(plot.current?.querySelectorAll<HTMLElement>(\"[data-event]\") ?? [])];\n const inside = marks.filter((node) => {\n const t = L.events[Number(node.dataset.event)]!.t;\n return t >= start && t <= end;\n });\n marks.forEach((node) => {\n const index = Number(node.dataset.event);\n const t = L.events[index]!.t;\n const visible = inside.includes(node);\n node.toggleAttribute(\"data-out\", !visible);\n const px = x(t);\n node.style.left = `${px}px`;\n const rule = root.querySelector<SVGLineElement>(`[data-rule=\"${index}\"]`);\n rule?.toggleAttribute(\"data-out\", !visible);\n rule?.setAttribute(\"x1\", String(Math.round(px) + 0.5));\n rule?.setAttribute(\"x2\", String(Math.round(px) + 0.5));\n node.removeAttribute(\"data-labelled\");\n node.removeAttribute(\"data-flip\");\n });\n let edge = -Infinity;\n inside.forEach((node, at) => {\n const index = Number(node.dataset.event);\n const px = x(L.events[index]!.t);\n const text = L.events[index]!.label.length * 6.2 + 4;\n const next =\n at + 1 < inside.length ? x(L.events[Number(inside[at + 1]!.dataset.event)]!.t) - 10 : w;\n if (px + 14 >= edge && px + 14 + text <= next) {\n node.setAttribute(\"data-labelled\", \"\");\n edge = px + 14 + text + 8;\n return;\n }\n const before = at === 0 ? -Infinity : x(L.events[Number(inside[at - 1]!.dataset.event)]!.t);\n if (px - 14 - text >= Math.max(0, edge) && (at === 0 || px - 14 - text >= before + 12)) {\n node.setAttribute(\"data-labelled\", \"\");\n node.setAttribute(\"data-flip\", \"\");\n edge = px + 12;\n return;\n }\n edge = Math.max(edge, px + 12);\n });\n\n // The crosshair sits on the scrubbed point; the tooltip beside it, flipping before it leaves the plot.\n const { index, event } = activeRef.current;\n const at = index !== null && index >= from && index < to ? index : null;\n const cx = at === null ? 0 : x(P[at]!.t);\n const cy =\n at === null ? 0 : y(L.smooth[at]!.value + (P[at]!.value - L.smooth[at]!.value) * detail);\n const crossX = String(Math.round(cx) + 0.5);\n // A hovered event shows its tooltip with no point under it: then the crosshair and the dot stay hidden.\n const cross = root.querySelector<SVGElement>(\"[data-part=crosshair]\");\n cross?.setAttribute(\"x1\", crossX);\n cross?.setAttribute(\"x2\", crossX);\n if (cross) cross.style.opacity = at === null ? \"0\" : \"\";\n const dot = root.querySelector<SVGElement>(\"[data-part=dot]\");\n dot?.setAttribute(\"cx\", String(cx));\n dot?.setAttribute(\"cy\", String(cy));\n if (dot) dot.style.opacity = at === null ? \"0\" : \"\";\n const bubble = tip.current;\n if (bubble) {\n const ax = event !== null ? x(L.events[event]!.t) : cx;\n const ay = event !== null ? TOP : cy;\n const tw = bubble.offsetWidth;\n const th = bubble.offsetHeight;\n let left = ax + GAP;\n if (left + tw > w) left = ax - GAP - tw;\n let topY = ay - th - GAP;\n if (topY < 0) topY = ay + GAP;\n bubble.style.translate = `${clamp(left, 0, Math.max(0, w - tw))}px ${clamp(topY, 0, Math.max(0, H - th))}px`;\n }\n\n // The overview: the window box, its edges and the shades beside it, and the values the sliders report.\n const ox = (t: number) => ((t - L.first) / (L.lastT - L.first || 1)) * sw;\n const wx0 = ox(start);\n const wx1 = ox(end);\n const box = strip.current;\n if (box) {\n const place = (selector: string, css: Record<string, string>) => {\n const node = box.querySelector<HTMLElement>(selector);\n if (node) Object.assign(node.style, css);\n };\n place(\"[data-part=window-box]\", { left: `${wx0}px`, width: `${Math.max(0, wx1 - wx0)}px` });\n // The handles sit outside the window, so they never overlap each other or the window, however narrow it gets. The start handle turns inward at the left edge, where there is no room outside.\n const inward = wx0 < HANDLE;\n place(\"[data-handle=start]\", { left: `${inward ? wx0 : wx0 - HANDLE}px` });\n box.querySelector(\"[data-handle=start]\")?.toggleAttribute(\"data-inward\", inward);\n place(\"[data-handle=end]\", { left: `${wx1}px` });\n place(\"[data-edge=start]\", { left: \"0px\", width: `${Math.max(0, wx0)}px` });\n place(\"[data-edge=end]\", { left: `${wx1}px`, right: \"0px\" });\n const clip = box.querySelector(\"[data-part=window-clip]\");\n clip?.setAttribute(\"x\", String(wx0));\n clip?.setAttribute(\"width\", String(Math.max(0, wx1 - wx0)));\n const text = `${SHORT_DATE.format(start)} to ${SHORT_DATE.format(end)}`;\n const slider = (\n selector: string,\n min: number,\n max: number,\n now: number,\n valuetext: string,\n ) => {\n const node = box.querySelector<HTMLElement>(selector);\n if (!node) return;\n node.setAttribute(\"aria-valuemin\", String(Math.round(min)));\n node.setAttribute(\"aria-valuemax\", String(Math.round(max)));\n node.setAttribute(\"aria-valuenow\", String(Math.round(now)));\n node.setAttribute(\"aria-valuetext\", valuetext);\n };\n slider(\"[data-part=window]\", L.first, L.lastT, start, text);\n slider(\"[data-handle=start]\", L.first, end, start, SHORT_DATE.format(start));\n slider(\"[data-handle=end]\", start, L.lastT, end, SHORT_DATE.format(end));\n }\n }, []);\n useIsomorphicLayoutEffect(() => {\n latest.current = { points, smooth, events, first, lastT, height, overviewHeight, empty };\n paintRef.current = paint;\n paint();\n });\n\n const setView = (next: Window) => {\n view.current = next;\n paint();\n settleSoon();\n };\n const glideTo = (next: Window) => {\n flight.current?.();\n const from = view.current;\n flight.current = tween(\n SMOOTH,\n (p) => setView([from[0] + (next[0] - from[0]) * p, from[1] + (next[1] - from[1]) * p]),\n flush,\n );\n };\n const commit = (next: Window, smoothly: boolean) => {\n const target = fit(next);\n touched.current = true;\n if (smoothly) glideTo(target);\n else {\n flight.current?.();\n setView(target);\n }\n onRangeChange?.(target);\n };\n\n // A new controlled window glides there; data that no longer covers the window pulls it back inside.\n const rangeKey = range ? `${range[0]}:${range[1]}` : \"\";\n useEffect(() => {\n if (!range || empty) return;\n const target = fit(range);\n const now = view.current;\n if (Math.abs(target[0] - now[0]) + Math.abs(target[1] - now[1]) > 1000) glideTo(target);\n // The key stands for `range`.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [rangeKey, empty]);\n useEffect(() => {\n if (empty) return;\n const target = touched.current || range || defaultRange ? fit(view.current) : whole;\n if (target[0] !== view.current[0] || target[1] !== view.current[1]) {\n view.current = target;\n paint();\n flush();\n }\n // Only a change in what the data covers moves the window.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [first, lastT, empty]);\n useEffect(\n () => () => {\n flight.current?.();\n topLive.current.stop();\n window.clearTimeout(settleTimer.current);\n },\n [],\n );\n\n // Both charts draw in their own pixels: measure the widths and follow resizes.\n useIsomorphicLayoutEffect(() => {\n const nodes = [\n [plot.current, plotW, setPlotWidth],\n [strip.current, stripW, setStripWidth],\n ] as const;\n const stops: (() => void)[] = [];\n for (const [node, store, setter] of nodes) {\n if (!node) continue;\n const read = () => {\n store.current = node.clientWidth;\n setter(node.clientWidth);\n paintRef.current();\n };\n read();\n if (typeof ResizeObserver === \"undefined\") continue;\n const observer = new ResizeObserver(read);\n observer.observe(node);\n stops.push(() => observer.disconnect());\n }\n return () => stops.forEach((stop) => stop());\n }, []);\n\n // The line draws in from the left the first time the chart is seen.\n const [drawn, setDrawn] = useState(false);\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 rides the nearest point in view; a hovered event shows its note instead.\n const [active, setActive] = useState<number | null>(null);\n const [hoverEvent, setHoverEvent] = useState<number | null>(null);\n const [start, end] = shown;\n const from = Math.max(0, lowerBound(points, start) - 1);\n const to = Math.min(points.length, lowerBound(points, end) + 1);\n const index = active !== null && active >= from && active < to ? active : null;\n const eventAt =\n index === null\n ? null\n : (events.find((item) => Math.abs(item.t - points[index]!.t) < DAY / 2) ?? null);\n const shownEvent = hoverEvent !== null ? (events[hoverEvent] ?? null) : null;\n const tipOn = index !== null || shownEvent !== null;\n useIsomorphicLayoutEffect(() => {\n activeRef.current = { index, event: shownEvent ? events.indexOf(shownEvent) : null };\n paint();\n });\n\n const nearest = (clientX: number) => {\n const rect = plot.current?.getBoundingClientRect();\n if (!rect?.width || empty) return null;\n const [s, e] = view.current;\n const t = s + ((clientX - rect.left) / rect.width) * (e - s);\n const at = clamp(lowerBound(points, t), 1, points.length - 1);\n const lo = Math.max(0, lowerBound(points, s) - 1);\n const hi = Math.min(points.length, lowerBound(points, e) + 1);\n return clamp(t - points[at - 1]!.t < points[at]!.t - t ? at - 1 : at, lo, hi - 1);\n };\n const windowBounds = () => {\n const [s, e] = view.current;\n return [\n Math.max(0, lowerBound(points, s) - 1),\n Math.min(points.length, lowerBound(points, e) + 1),\n ] as const;\n };\n const onPlotKey = (event: KeyboardEvent<HTMLDivElement>) => {\n if (empty) return;\n if (event.key === \"Escape\" && index !== null) {\n event.preventDefault();\n setActive(null);\n return;\n }\n const [lo, hi] = windowBounds();\n const current = index ?? hi - 1;\n const page = Math.max(1, Math.round((hi - lo) / 8));\n const next = (\n {\n ArrowLeft: current - 1,\n ArrowRight: index === null ? hi - 1 : current + 1,\n PageDown: current - page,\n PageUp: current + page,\n Home: lo,\n End: hi - 1,\n } as Record<string, number>\n )[event.key];\n if (next === undefined) return;\n event.preventDefault();\n setActive(clamp(next, lo, hi - 1));\n };\n\n // Overview gestures: grab an edge to resize, the window to pan, or empty track to draw a new window. A tap recentres; a double tap resets.\n const drag = useRef<Drag | null>(null);\n const toTime = (clientX: number) => {\n const rect = strip.current?.getBoundingClientRect();\n return rect?.width\n ? first + clamp((clientX - rect.left) / rect.width, 0, 1) * (lastT - first)\n : first;\n };\n const onStripDown = (event: PointerEvent<HTMLDivElement>) => {\n if (empty || event.button > 0) return;\n const rect = strip.current!.getBoundingClientRect();\n const px = event.clientX - rect.left;\n const [s, e] = view.current;\n const wx0 = ((s - first) / (lastT - first)) * rect.width;\n const wx1 = ((e - first) / (lastT - first)) * rect.width;\n const mode: Drag[\"mode\"] =\n Math.abs(px - wx0) <= GRIP && px <= (wx0 + wx1) / 2\n ? \"start\"\n : Math.abs(px - wx1) <= GRIP\n ? \"end\"\n : px > wx0 && px < wx1\n ? \"pan\"\n : \"new\";\n drag.current = {\n mode,\n pointerX: event.clientX,\n from: view.current,\n anchor: toTime(event.clientX),\n moved: false,\n };\n try {\n event.currentTarget.setPointerCapture?.(event.pointerId);\n } catch {\n // A synthetic pointer has nothing to capture.\n }\n flight.current?.();\n };\n const onStripMove = (event: PointerEvent<HTMLDivElement>) => {\n const current = drag.current;\n if (!current) return;\n if (!current.moved && Math.abs(event.clientX - current.pointerX) < 3) return;\n current.moved = true;\n const t = toTime(event.clientX);\n const shift = t - current.anchor;\n const [s, e] = current.from;\n const least = Math.min(minSpan, lastT - first);\n const next: Window =\n current.mode === \"pan\"\n ? [s + shift, e + shift]\n : current.mode === \"start\"\n ? [clamp(t, first, e - least), e]\n : current.mode === \"end\"\n ? [s, clamp(t, s + least, lastT)]\n : [Math.min(current.anchor, t), Math.max(current.anchor, t)];\n if (current.mode === \"new\" && next[1] - next[0] < least) {\n if (t >= current.anchor) next[1] = next[0] + least;\n else next[0] = next[1] - least;\n }\n commit(next, false);\n };\n const onStripUp = () => {\n const current = drag.current;\n drag.current = null;\n if (current?.moved) flush();\n if (!current || current.moved || current.mode !== \"new\") return;\n const half = (view.current[1] - view.current[0]) / 2;\n commit([current.anchor - half, current.anchor + half], true);\n };\n const reset = () => commit(whole, true);\n\n const stepSize = Math.max(DAY, (lastT - first) / Math.max(1, points.length - 1));\n const onHandleKey = (event: KeyboardEvent<HTMLDivElement>, edge: \"start\" | \"end\" | \"window\") => {\n const [s, e] = view.current;\n const win = e - s;\n const big = event.shiftKey || event.key.startsWith(\"Page\");\n const delta = (\n {\n ArrowLeft: -1,\n ArrowDown: -1,\n PageDown: -1,\n ArrowRight: 1,\n ArrowUp: 1,\n PageUp: 1,\n } as Record<string, number>\n )[event.key];\n let next: Window | null = null;\n if (event.key === \"Escape\" || event.key === \"0\") next = whole;\n else if (edge === \"window\" && (event.key === \"+\" || event.key === \"=\"))\n next = [s + win / 4, e - win / 4];\n else if (edge === \"window\" && (event.key === \"-\" || event.key === \"_\"))\n next = [s - win / 2, e + win / 2];\n else if (event.key === \"Home\")\n next =\n edge === \"end\"\n ? [s, s + Math.min(minSpan, lastT - first)]\n : [first, edge === \"window\" ? first + win : e];\n else if (event.key === \"End\")\n next =\n edge === \"start\"\n ? [e - Math.min(minSpan, lastT - first), e]\n : [edge === \"window\" ? lastT - win : s, lastT];\n else if (delta) {\n const move =\n delta * (edge === \"window\" ? win * (big ? 0.5 : 0.1) : stepSize * (big ? 10 : 1));\n next =\n edge === \"window\"\n ? [s + move, e + move]\n : edge === \"start\"\n ? [Math.min(s + move, e - minSpan), e]\n : [s, Math.max(e + move, s + minSpan)];\n }\n if (!next) return;\n event.preventDefault();\n commit(next, false);\n flush();\n };\n\n // What React renders follows the settled window: gridlines and ticks, the event list, the overview and the table.\n const peak = useMemo(() => {\n let high = 0;\n for (let at = from; at < to; at++) high = Math.max(high, points[at]!.value);\n return high;\n }, [points, from, to]);\n const scale = niceTop(peak * 1.04);\n // The raw line is fully drawn past about four pixels a point; below that the tooltip speaks of the average.\n const detailShown = clamp(\n ((plotWidth && points.length > 1\n ? (plotWidth * (lastT - first)) / (points.length - 1) / Math.max(1, end - start)\n : plotWidth) -\n 2.75) /\n 1.5,\n 0,\n 1,\n );\n const ticks =\n scale.top > 0\n ? Array.from({ length: Math.round(scale.top / scale.step) + 1 }, (_, at) =>\n clean(at * scale.step),\n )\n : [];\n const xTicks = plotWidth && !empty ? timeTicks(start, end, plotWidth) : [];\n const overview = useMemo(() => {\n if (!stripWidth || empty)\n return { line: \"\", area: \"\", marks: [] as { t: number; x: number; y: number }[] };\n const ox = (t: number) => ((t - first) / (lastT - first || 1)) * stripWidth;\n const max = niceTop(smooth.reduce((m, point) => Math.max(m, point.value), 0)).top || 1;\n const oy = (value: number) => 4 + (1 - value / max) * (overviewHeight - 4);\n const path = linePath(smooth, 0, smooth.length, ox, oy, stripWidth * 4);\n const marks = events.map((item) => {\n const at = clamp(lowerBound(smooth, item.t), 0, smooth.length - 1);\n return { t: item.t, x: ox(item.t), y: oy(smooth[at]!.value) };\n });\n return {\n line: path,\n area: `${path}L${stripWidth},${overviewHeight}L0,${overviewHeight}Z`,\n marks,\n };\n }, [smooth, events, stripWidth, overviewHeight, empty, first, lastT]);\n\n const format = (value: number) => `${formatValue(value)}${unit ? ` ${unit}` : \"\"}`;\n const reading = index === null ? null : points[index]!;\n const previous = index !== null && index >= 7 ? points[index - 7]! : null;\n const change =\n reading && previous && previous.value\n ? (reading.value - previous.value) / previous.value\n : null;\n const windowText = `${SHORT_DATE.format(start)} to ${SHORT_DATE.format(end)}`;\n const announce = reading\n ? `${formatDate(new Date(reading.t))}, ${format(reading.value)}${eventAt ? `. ${eventAt.label}` : \"\"}`\n : \"\";\n const summary = empty\n ? `${label}. ${emptyLabel}.`\n : `${label}, ${SHORT_DATE.format(first)} to ${SHORT_DATE.format(lastT)}. Showing ${windowText}.`;\n const rows = empty ? [] : points.slice(lowerBound(points, start), lowerBound(points, end + 1));\n\n return (\n <figure\n ref={refs}\n data-slot=\"brush-chart\"\n aria-label={label}\n className={cn(\"brush-chart\", className)}\n style={{ \"--series\": \"var(--color-chart-1)\" } as CSSProperties}\n >\n <div\n data-slot=\"brush-chart-chart\"\n data-scrubbing={tipOn || undefined}\n className=\"brush-chart-frame\"\n >\n <div\n ref={plot}\n data-slot=\"brush-chart-plot\"\n role=\"slider\"\n tabIndex={empty ? -1 : 0}\n aria-label={`${label}, ${windowText}. Use left and right arrows to read values.`}\n aria-orientation=\"horizontal\"\n aria-valuemin={1}\n aria-valuemax={Math.max(1, points.length)}\n aria-valuenow={(index ?? Math.max(0, to - 1)) + 1}\n aria-valuetext={reading ? announce : summary}\n onPointerMove={(event) => {\n if (event.pointerType === \"mouse\" || event.buttons) setActive(nearest(event.clientX));\n }}\n onPointerDown={(event) => {\n if (event.pointerType === \"mouse\") return;\n event.currentTarget.setPointerCapture?.(event.pointerId);\n setActive(nearest(event.clientX));\n }}\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={onPlotKey}\n onBlur={() => setActive(null)}\n onDoubleClick={reset}\n onFocus={(event) => {\n if (event.currentTarget.matches(\":focus-visible\") && !empty) {\n setActive((current) => current ?? windowBounds()[1] - 1);\n }\n }}\n className=\"line-chart-plot\"\n style={{ height }}\n >\n <svg\n ref={plotSvg}\n width=\"100%\"\n height={height}\n aria-hidden=\"true\"\n focusable=\"false\"\n className=\"block overflow-visible\"\n >\n <defs>\n <clipPath id={`${uid}-draw`} clipPathUnits=\"userSpaceOnUse\">\n <rect\n className=\"line-chart-reveal\"\n x={-8}\n y={-16}\n height={height + 32}\n style={{ width: drawn ? plotWidth + 16 : 0 }}\n />\n </clipPath>\n </defs>\n {ticks.slice(1).map((value) => (\n <line key={value} data-grid={value} className=\"line-chart-grid\" x1={0} x2=\"100%\" />\n ))}\n <line\n className=\"line-chart-baseline\"\n x1={0}\n x2=\"100%\"\n y1={height - 0.5}\n y2={height - 0.5}\n />\n {events.map((item, at) => (\n <line\n key={item.t}\n data-rule={at}\n data-active={shownEvent === item || eventAt === item || undefined}\n className=\"brush-chart-rule\"\n y1={TOP - 10}\n y2={height}\n />\n ))}\n <g clipPath={`url(#${uid}-draw)`}>\n <path data-part=\"band\" className=\"brush-chart-band\" />\n <path data-part=\"area\" className=\"line-chart-area\" />\n <path data-part=\"trend\" className=\"brush-chart-trend\" />\n <path data-part=\"line\" className=\"line-chart-line\" />\n </g>\n <line\n data-part=\"crosshair\"\n className=\"line-chart-crosshair\"\n y1={TOP - 10}\n y2={height}\n />\n <circle data-part=\"dot\" r={4} className=\"line-chart-dot\" />\n </svg>\n {events.map((item, at) => (\n <span\n key={item.t}\n data-event={at}\n data-active={shownEvent === item || eventAt === item || undefined}\n aria-hidden=\"true\"\n className=\"brush-chart-event\"\n onPointerEnter={() => setHoverEvent(at)}\n onPointerLeave={() => setHoverEvent(null)}\n onPointerDown={(event) => event.stopPropagation()}\n >\n <span className=\"brush-chart-event-dot\" />\n <span className=\"brush-chart-event-label\">{item.label}</span>\n </span>\n ))}\n <div\n ref={tip}\n aria-hidden=\"true\"\n data-slot=\"brush-chart-tooltip\"\n className=\"line-chart-tooltip\"\n >\n {shownEvent ? (\n <>\n <p className=\"m-0 mb-0.5 whitespace-nowrap text-xs tabular-nums text-text-secondary\">\n {formatDate(new Date(shownEvent.t))}\n </p>\n <p className=\"m-0 text-base font-medium tabular-nums text-foreground\">\n {shownEvent.label}\n </p>\n {shownEvent.description ? (\n <p className=\"m-0 text-xs text-text-secondary\">{shownEvent.description}</p>\n ) : null}\n </>\n ) : reading ? (\n <>\n <p className=\"m-0 mb-0.5 whitespace-nowrap text-xs tabular-nums text-text-secondary\">\n {formatDate(new Date(reading.t))}\n </p>\n <p className=\"m-0 text-base font-medium tabular-nums text-foreground\">\n {format(reading.value)}\n </p>\n {index !== null && detailShown < 1 && smooth[index] ? (\n <p className=\"m-0 text-xs tabular-nums text-text-secondary\">\n {`${formatValue(Math.round(smooth[index].value))} seven day average`}\n </p>\n ) : null}\n {change !== null ? (\n <p className=\"m-0 text-xs tabular-nums text-text-secondary\">\n {`${change >= 0 ? \"+\" : \"−\"}${Math.abs(change * 100).toFixed(1)}% vs a week earlier`}\n </p>\n ) : null}\n {eventAt ? (\n <p className=\"m-0 mt-1 flex items-center gap-1.5 text-xs text-foreground\">\n <span aria-hidden=\"true\" className=\"brush-chart-tip-dot\" />\n {eventAt.label}\n </p>\n ) : null}\n </>\n ) : null}\n </div>\n {empty ? (\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 {emptyLabel}\n </p>\n ) : null}\n </div>\n <div ref={gutter} aria-hidden=\"true\" className=\"relative min-w-0 [grid-area:1/2]\">\n {ticks.map((value) => (\n <span\n key={value}\n data-tick={value}\n className=\"line-chart-tick motion-safe:animate-fade-in\"\n >\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 ref={axis} aria-hidden=\"true\" className=\"relative min-w-0 [grid-area:2/1]\">\n {xTicks.map((tick) => (\n <span\n key={tick.t}\n data-t={tick.t}\n className=\"absolute top-2 whitespace-nowrap text-xs leading-none tabular-nums text-muted-foreground\"\n >\n {tick.label}\n </span>\n ))}\n </div>\n <div\n ref={strip}\n data-slot=\"brush-chart-overview\"\n className=\"brush-chart-strip\"\n style={{ height: overviewHeight }}\n onPointerDown={onStripDown}\n onPointerMove={onStripMove}\n onPointerUp={onStripUp}\n onPointerCancel={() => {\n drag.current = null;\n }}\n onDoubleClick={reset}\n >\n <svg\n width=\"100%\"\n height={overviewHeight}\n aria-hidden=\"true\"\n focusable=\"false\"\n className=\"brush-chart-overview-svg\"\n >\n <defs>\n <clipPath id={`${uid}-window`}>\n <rect data-part=\"window-clip\" y={-2} height={overviewHeight + 4} />\n </clipPath>\n </defs>\n <path d={overview.area} className=\"brush-chart-overview-area\" />\n <path d={overview.line} className=\"brush-chart-overview-line\" />\n <g clipPath={`url(#${uid}-window)`}>\n <path d={overview.area} className=\"brush-chart-overview-area-in\" />\n <path d={overview.line} className=\"brush-chart-overview-line-in\" />\n </g>\n {overview.marks.map((mark) => (\n <circle\n key={mark.t}\n cx={mark.x}\n cy={mark.y}\n r={2.5}\n className=\"brush-chart-overview-event\"\n />\n ))}\n </svg>\n {empty ? null : (\n <>\n <div data-edge=\"start\" className=\"brush-chart-shade\" />\n <div data-edge=\"end\" className=\"brush-chart-shade\" />\n <div\n data-part=\"window\"\n role=\"slider\"\n tabIndex={0}\n aria-label={`${label} window`}\n aria-roledescription=\"range window\"\n onKeyDown={(event) => onHandleKey(event, \"window\")}\n className=\"brush-chart-window-key\"\n />\n <div data-part=\"window-box\" aria-hidden=\"true\" className=\"brush-chart-window\" />\n <div\n data-handle=\"start\"\n role=\"slider\"\n tabIndex={0}\n aria-label=\"Window start\"\n onKeyDown={(event) => onHandleKey(event, \"start\")}\n className=\"brush-chart-handle\"\n >\n <span className=\"brush-chart-grip\" />\n </div>\n <div\n data-handle=\"end\"\n role=\"slider\"\n tabIndex={0}\n aria-label=\"Window end\"\n onKeyDown={(event) => onHandleKey(event, \"end\")}\n className=\"brush-chart-handle\"\n >\n <span className=\"brush-chart-grip\" />\n </div>\n </>\n )}\n </div>\n </div>\n <p className=\"sr-only\" aria-live=\"polite\" aria-atomic=\"true\">\n {announce}\n </p>\n <p className=\"sr-only\">{summary}</p>\n {empty ? null : (\n <div className=\"sr-only\">\n <table>\n <caption>{`${label}, ${windowText}`}</caption>\n <thead>\n <tr>\n <th scope=\"col\">Date</th>\n <th scope=\"col\">{label}</th>\n <th scope=\"col\">Event</th>\n </tr>\n </thead>\n <tbody>\n {rows.map((point) => {\n const event = events.find((item) => Math.abs(item.t - point.t) < DAY / 2);\n return (\n <tr key={point.t}>\n <th scope=\"row\">{SHORT_DATE.format(point.t)}</th>\n <td>{format(point.value)}</td>\n <td>\n {event\n ? `${event.label}${event.description ? `. ${event.description}` : \"\"}`\n : \"\"}\n </td>\n </tr>\n );\n })}\n </tbody>\n </table>\n </div>\n )}\n </figure>\n );\n});\n"],"mappings":";;;;;;;;AA6FA,MAAM,MAAM;;AAEZ,MAAM,MAAM;AACZ,MAAM,MAAM;AACZ,MAAM,OAAO;;AAEb,MAAM,SAAS;AACf,MAAM,UAAU,IAAI,KAAK,aAAa,SAAS;CAAE,UAAU;CAAW,uBAAuB;AAAE,CAAC;AAChG,MAAM,UAAU,IAAI,KAAK,aAAa,SAAS,EAAE,uBAAuB,EAAE,CAAC;AAC3E,MAAM,OAAO,YACX,IAAI,KAAK,eAAe,SAAS;CAAE,UAAU;CAAO,GAAG;AAAQ,CAAC;AAClE,MAAM,YAAY,IAAI;CAAE,SAAS;CAAS,OAAO;CAAS,KAAK;CAAW,MAAM;AAAU,CAAC;AAC3F,MAAM,WAAW,IAAI;CAAE,OAAO;CAAS,KAAK;AAAU,CAAC;AACvD,MAAM,aAAa,IAAI,EAAE,OAAO,QAAQ,CAAC;AACzC,MAAM,YAAY,IAAI,EAAE,MAAM,UAAU,CAAC;AACzC,MAAM,aAAa,IAAI;CAAE,OAAO;CAAS,KAAK;CAAW,MAAM;AAAU,CAAC;AAC1E,MAAM,SAAS,OAAe,KAAa,SAAiB,KAAK,IAAI,MAAM,KAAK,IAAI,KAAK,KAA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MACxE,OACE,qBAAC,MAAD,EAAA,UAAA;OACE,oBAAC,MAAD;QAAI,OAAM;QAAO,UAAA,WAAW,OAAO,MAAM,CAAC;OAAM,CAAA;OAChD,oBAAC,MAAD,EAAA,UAAK,OAAO,MAAM,KAAK,EAAM,CAAA;OAC7B,oBAAC,MAAD,EAAA,UACG,QACG,GAAG,MAAM,QAAQ,MAAM,cAAc,KAAK,MAAM,gBAAgB,OAChE,GACF,CAAA;MACF,EAAA,GARK,MAAM,CAQX;KAER,CAAC,EACI,CAAA;IACF,EAAA,CAAA;GACJ,CAAA;EAED;;AAEZ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import { BrushChart, BrushChartAnnotation, BrushChartDatum, BrushChartProps } from "./brush-chart.js";
2
+ export { BrushChart, type BrushChartAnnotation, type BrushChartDatum, type BrushChartProps };
@@ -0,0 +1,2 @@
1
+ import { BrushChart } from "./brush-chart.js";
2
+ export { BrushChart };
@@ -3,8 +3,8 @@ import { ReactNode } from "react";
3
3
  import { ButtonProps, LinkProps } from "react-aria-components";
4
4
  //#region src/button/button.d.ts
5
5
  export declare const buttonVariants: (props?: ({
6
- variant?: "link" | "destructive" | "primary" | "secondary" | "outline" | "outlineNeutral" | "ghost" | null | undefined;
7
- size?: "sm" | "md" | "lg" | "icon" | null | undefined;
6
+ variant?: "link" | "outline" | "primary" | "ai" | "secondary" | "outlineNeutral" | "ghost" | "destructive" | null | undefined;
7
+ size?: "icon" | "sm" | "md" | "lg" | null | undefined;
8
8
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
9
9
  /**
10
10
  * Props.
@@ -30,7 +30,7 @@ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
30
30
  const pressScale = "motion-safe:data-[pressed]:scale-(--press-scale) [&:is([aria-haspopup]:not([aria-haspopup=false]),[data-state],[role=combobox])]:scale-none!";
31
31
  const buttonVariants = cva([
32
32
  "inline-flex items-center justify-center gap-(--density-control-gap) shrink-0 whitespace-nowrap",
33
- "rounded-md font-sans font-medium",
33
+ "rounded-control font-sans font-medium",
34
34
  "cursor-pointer select-none",
35
35
  "border-(length:--border-width) border-transparent bg-transparent",
36
36
  "[&_svg]:pointer-events-none [&_svg]:shrink-0",
@@ -50,20 +50,29 @@ const buttonVariants = cva([
50
50
  "bg-primary text-primary-foreground shadow-surface",
51
51
  "motion-safe:button-motion",
52
52
  pressScale,
53
- "data-[hovered]:opacity-91 data-[hovered]:shadow-resting",
54
- "data-[pressed]:opacity-84",
53
+ "data-[hovered]:bg-primary-hover data-[hovered]:shadow-resting",
54
+ "data-[pressed]:bg-primary-pressed",
55
+ "data-[disabled]:opacity-(--opacity-button-disabled)"
56
+ ],
57
+ ai: [
58
+ "bg-primary text-primary-foreground shadow-surface",
59
+ "ai-beam",
60
+ "motion-safe:button-motion",
61
+ pressScale,
62
+ "data-[hovered]:bg-primary-hover",
63
+ "motion-safe:data-[hovered]:[&_svg]:-rotate-12",
55
64
  "data-[disabled]:opacity-(--opacity-button-disabled)"
56
65
  ],
57
66
  secondary: [
58
- "bg-secondary text-secondary-foreground shadow-surface",
67
+ "bg-surface text-foreground border-(length:--border-width) border-border shadow-surface",
59
68
  "motion-safe:button-motion",
60
69
  pressScale,
61
- "data-[hovered]:bg-secondary-hover data-[hovered]:shadow-resting",
62
- "data-[pressed]:bg-secondary-pressed",
70
+ "data-[hovered]:bg-muted data-[hovered]:shadow-resting",
71
+ "data-[pressed]:bg-muted",
63
72
  "data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground data-[disabled]:border-border"
64
73
  ],
65
74
  outline: [
66
- "bg-background text-primary-strong border-(length:--border-width) border-primary-strong shadow-surface",
75
+ "bg-surface text-primary-strong border-(length:--border-width) border-primary-strong shadow-surface",
67
76
  "motion-safe:button-motion",
68
77
  pressScale,
69
78
  "data-[hovered]:bg-muted data-[hovered]:shadow-resting",
@@ -71,40 +80,41 @@ const buttonVariants = cva([
71
80
  "data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground data-[disabled]:border-border"
72
81
  ],
73
82
  outlineNeutral: [
74
- "bg-background text-foreground border-(length:--border-width) border-border shadow-surface",
83
+ "bg-surface text-foreground border-(length:--border-width) border-border shadow-surface",
75
84
  "motion-safe:button-motion",
76
85
  pressScale,
77
86
  "data-[hovered]:bg-muted data-[hovered]:shadow-resting",
78
- "data-[pressed]:bg-muted data-[pressed]:border-foreground",
79
- "data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground"
87
+ "data-[pressed]:bg-muted",
88
+ "data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-text-disabled"
80
89
  ],
81
90
  ghost: [
82
- "bg-transparent text-primary-strong",
91
+ "bg-transparent text-text-secondary",
83
92
  "motion-safe:button-motion",
84
93
  pressScale,
85
- "data-[hovered]:bg-muted",
86
- "data-[disabled]:opacity-100 data-[disabled]:text-muted-foreground",
94
+ "data-[hovered]:bg-muted data-[hovered]:text-foreground",
95
+ "data-[disabled]:opacity-100 data-[disabled]:text-text-disabled",
87
96
  "data-[pressed]:bg-muted data-[pressed]:border-primary-strong"
88
97
  ],
89
98
  destructive: [
90
- "bg-destructive text-destructive-foreground shadow-surface",
99
+ "bg-surface text-destructive-strong border-(length:--border-width) border-border shadow-surface",
91
100
  "motion-safe:button-motion",
92
101
  pressScale,
93
- "data-[hovered]:bg-destructive-hover",
94
- "data-[pressed]:bg-destructive-pressed",
102
+ "data-[hovered]:bg-muted data-[hovered]:border-destructive-strong",
103
+ "data-[pressed]:bg-muted data-[pressed]:border-destructive-strong",
95
104
  "data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:border-border data-[disabled]:text-[color-mix(in_oklab,var(--color-destructive)_55%,var(--color-muted))]"
96
105
  ],
97
106
  link: [
98
- "bg-transparent text-primary-strong underline-offset-(--underline-offset)",
107
+ "bg-transparent text-text-link underline-offset-(--underline-offset)",
99
108
  "motion-safe:button-motion",
100
- "data-[disabled]:opacity-(--opacity-button-disabled)",
109
+ "data-[disabled]:text-text-disabled",
101
110
  "data-[hovered]:underline",
102
- "data-[pressed]:underline"
111
+ "data-[pressed]:underline data-[pressed]:opacity-80",
112
+ "[&_svg:last-child]:transition-transform motion-safe:data-[hovered]:[&_svg:last-child]:translate-x-0.75 rtl:motion-safe:data-[hovered]:[&_svg:last-child]:-translate-x-0.75"
103
113
  ]
104
114
  },
105
115
  size: {
106
- sm: "h-(--density-control-h-sm) px-(--density-control-pad-sm) text-sm",
107
- md: "h-(--density-control-h-md) px-(--density-control-pad-md) text-base",
116
+ sm: "h-(--density-control-h-sm) px-4 text-sm",
117
+ md: "h-(--density-control-h-md) px-4 text-sm",
108
118
  lg: "h-(--density-control-h-lg) px-(--density-control-pad-lg) text-lg",
109
119
  icon: "size-(--density-control-h-md) px-0 text-base"
110
120
  }
@@ -1 +1 @@
1
- {"version":3,"file":"button.js","names":["Button","AriaLink","AriaButton"],"sources":["../../src/button/button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport {\n forwardRef,\n isValidElement,\n useCallback,\n useRef,\n useState,\n type ForwardedRef,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport {\n Button as AriaButton,\n Link as AriaLink,\n type ButtonProps as AriaButtonProps,\n type ButtonRenderProps,\n type LinkProps as AriaLinkProps,\n type PressEvent,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { mergeRefs } from \"../lib/merge-refs.js\";\nimport {\n anchorsLayer,\n pressScaleFor,\n useAriaBusy,\n useExitBackstop,\n useLeavingItems,\n useMorphWidth,\n type Rect,\n} from \"../lib/motion.js\";\n\n/**\n * Variant classes, exported so a consumer can reuse the exact classes we ship\n * rather than guessing at them.\n *\n * NOT the answer for a link-shaped button any more: pass `href` to Button. On a\n * consumer's own <a> these classes get none of their states -- hover, press and\n * the focus ring all key on React Aria data attributes that a plain anchor never\n * receives, and the base sets outline-none, so keyboard focus was invisible.\n *\n * Ported from the legacy shadcn Button. The variant and size vocabulary is\n * deliberately identical so existing call sites migrate by rename, with six\n * corrections that the Alfred contracts require -- each marked below.\n *\n * Every string here is a STATIC literal. Tailwind scans source text, so a class\n * assembled at runtime is invisible to it and would simply never be emitted.\n *\n * State comes from React Aria data attributes rather than pseudo-classes:\n * data-[focus-visible] is keyboard focus only, and data-[pressed] covers mouse,\n * touch and keyboard uniformly. The original had no pressed state at all.\n */\n/*\n * The press: the button scales down while pressed (see onPressStart for the\n * scale, which depends on width) and springs back on release. Anchors of\n * floating layers never scale: a menu that opens on pointerdown would measure a\n * shrunken trigger.\n */\nconst pressScale =\n \"motion-safe:data-[pressed]:scale-(--press-scale) [&:is([aria-haspopup]:not([aria-haspopup=false]),[data-state],[role=combobox])]:scale-none!\";\n\nexport const buttonVariants = cva(\n [\n \"inline-flex items-center justify-center gap-(--density-control-gap) shrink-0 whitespace-nowrap\",\n // No leading-* here on purpose. tailwind-merge treats a later text-* class\n // as owning line-height (a Tailwind v3 assumption, where text-base carried\n // one), so a leading-* in the base string is silently STRIPPED by cn() once\n // a size variant adds text-base. It is not needed either: the control has a\n // fixed height and centres with flex, so line-height cannot overflow it.\n // A component with auto height must put leading-* AFTER its text-* class.\n \"rounded-md font-sans font-medium\",\n \"cursor-pointer select-none\",\n\n // font-sans above is part of the same problem: a <button> does not inherit\n // the page font, so without a reset it renders in the user-agent face\n // (Arial in Chromium) rather than the design system's. The same applies to\n // bg-transparent: an unstyled <button> paints the user-agent ButtonFace\n // grey -- which is what surfaces the moment a fill class fails to resolve,\n // and is why the paint stories compare against tokens rather than checking\n // for transparency.\n //\n // The reset in @seekalfred/styles is OPT-IN, so a consumer may never load\n // one. A bare <button> then keeps its user-agent border (2px, black, in\n // Chromium) and inline padding, which is a black box around every variant\n // that does not set a border of its own. The original inherited a zeroed\n // border from Tailwind Preflight in the app; a library component cannot\n // assume the consumer supplied one.\n \"border-(length:--border-width) border-transparent bg-transparent\",\n\n // Icon handling, ported verbatim: an svg child is sized unless the caller\n // already said otherwise, and never swallows the press.\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-(--icon-sm)\",\n\n // CORRECTION 1 -- the original focused with `ring-[3px]`, which is a\n // box-shadow. Box-shadows are discarded under forced-colors, taking the\n // only focus indication with them, and axe has no rule that would catch it\n // (ARCHITECTURE section 5, rule 6). A real outline survives.\n //\n // outline-solid on the focus variant is load-bearing, not decoration.\n // `outline-none` sets BOTH outline-style:none and --tw-outline-style:none,\n // and Tailwind's outline-width utility resolves its style from that same\n // variable -- so the focus variant applied a width and a colour while\n // faithfully re-applying style:none, and painted nothing. The button was\n // keyboard-focusable with no visible ring. axe has no focus-indicator\n // rule, so every automated gate stayed green; the KeyboardFocus story now\n // asserts outlineStyle directly.\n \"outline-none\",\n \"data-[focus-visible]:outline-solid\",\n \"data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset)\",\n \"data-[focus-visible]:outline-(--color-ring)\",\n\n // CORRECTION 2 -- `disabled:pointer-events-none` also kills the cursor, so\n // the control reads as inert rather than as unavailable. React Aria already\n // blocks activation; this only has to say so.\n // The opacity half of the disabled look moved into each variant: the\n // outlined and ghost buttons stay fully opaque and mute their colours\n // instead, which a single base opacity cannot express.\n \"data-[disabled]:cursor-not-allowed\",\n \"[-webkit-tap-highlight-color:transparent]\",\n\n // React Aria's own pending state. The original had no equivalent.\n \"data-[pending]:cursor-progress\",\n ],\n {\n variants: {\n variant: {\n // CORRECTION 3 -- the legacy button filled this variant with the brand\n // gradient. It is flat here, because the brand system caps\n // --gradient-brand at one intentional element per view and keeps that\n // budget for the logo and progress bars: \"a gradient on every button\n // spends that budget everywhere. Ours is the flat primary.\"\n //\n // CORRECTION 4 -- the label is ink, not white. Brand orange #FF8431\n // carries white at 2.44:1; ink clears it at 8.35:1, which is the brand\n // system's own --text-on-orange rule. Its Button ships white only as a\n // dated, individually signed-off exception, and this library's contrast\n // contract is build-failing with no exemption mechanism to inherit it.\n //\n // CORRECTION 7 (reversed by decision) -- hover and pressed used to be\n // their own TOKENS (500 rest, 600 hover, 700 pressed), because an\n // opacity modifier lightens the button toward the page, which reads as\n // receding, and makes the label pair unmeasurable: an alpha composite\n // depends on whatever sits behind it. They are now opacity steps (.91,\n // .84) plus the resting shadow, by explicit decision, so the hover and\n // pressed fills are no longer used here. The contrast contract still\n // lists them (contrast-pairs.json) but cannot express an alpha, so the\n // faded states were measured by hand: ink on orange, both faded over\n // the page, is 6.54:1 at .84 on the light page and 6.08:1 on the dark\n // one (8.35:1 at rest), all above the 4.5:1 floor.\n primary: [\n \"bg-primary text-primary-foreground shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:opacity-91 data-[hovered]:shadow-resting\",\n \"data-[pressed]:opacity-84\",\n \"data-[disabled]:opacity-(--opacity-button-disabled)\",\n ],\n secondary: [\n \"bg-secondary text-secondary-foreground shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-secondary-hover data-[hovered]:shadow-resting\",\n \"data-[pressed]:bg-secondary-pressed\",\n // A disabled outlined button keeps its shape and mutes its\n // label, so it reads as a button that is off, not as plain text.\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground data-[disabled]:border-border\",\n ],\n // primary-strong, never primary: the brand orange is 2.44:1 on the page\n // and cannot legally be a label OR a border. That is the whole reason\n // the token exists.\n outline: [\n \"bg-background text-primary-strong border-(length:--border-width) border-primary-strong shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted data-[hovered]:shadow-resting\",\n \"data-[pressed]:bg-muted data-[pressed]:border-foreground\",\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground data-[disabled]:border-border\",\n ],\n /*\n * The NEUTRAL outline, and the product's single most-used button:\n * 99 call sites against 32 for the brand-coloured one.\n *\n * It exists because `outline` above is brand-toned -- orange border,\n * orange label -- which is what the product calls `secondaryOutline`.\n * Its plain `outline` is this: a grey border and ordinary body text,\n * for a button that must not compete with the primary action next to\n * it. One name could not cover both, and renaming `outline` would have\n * silently repainted every existing call site of ours instead.\n *\n * `border` rather than `primary-strong`: --color-border is the token\n * already held to the 3:1 non-text floor of WCAG 1.4.11, which is what\n * a border separating a control from the page has to clear.\n */\n outlineNeutral: [\n \"bg-background text-foreground border-(length:--border-width) border-border shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted data-[hovered]:shadow-resting\",\n \"data-[pressed]:bg-muted data-[pressed]:border-foreground\",\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground\",\n ],\n ghost: [\n \"bg-transparent text-primary-strong\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted\",\n \"data-[disabled]:opacity-100 data-[disabled]:text-muted-foreground\",\n // CORRECTION 5 -- pressed must not be background-only. A ghost button\n // has no border at rest, so the pressed border is the non-colour cue\n // that survives forced-colors (rule 6 again).\n \"data-[pressed]:bg-muted data-[pressed]:border-primary-strong\",\n ],\n destructive: [\n \"bg-destructive text-destructive-foreground shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-destructive-hover\",\n \"data-[pressed]:bg-destructive-pressed\",\n // Muted fill, label tinted toward destructive.\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:border-border data-[disabled]:text-[color-mix(in_oklab,var(--color-destructive)_55%,var(--color-muted))]\",\n ],\n link: [\n \"bg-transparent text-primary-strong underline-offset-(--underline-offset)\",\n \"motion-safe:button-motion\",\n \"data-[disabled]:opacity-(--opacity-button-disabled)\",\n \"data-[hovered]:underline\",\n \"data-[pressed]:underline\",\n ],\n },\n size: {\n // Height, padding and label size all come from the control scale, so\n // data-density moves them together. The icon-only variant is square at\n // the md height. The legacy shadcn rule that tightened padding when a\n // child was an icon is gone: it needed three more magic numbers, the\n // brand system has no equivalent, and the gap token now owns icon\n // spacing.\n sm: \"h-(--density-control-h-sm) px-(--density-control-pad-sm) text-sm\",\n md: \"h-(--density-control-h-md) px-(--density-control-pad-md) text-base\",\n lg: \"h-(--density-control-h-lg) px-(--density-control-pad-lg) text-lg\",\n // text-base even though there is no visible label: without it the\n // user-agent default (13.33px in Chromium) leaks in and sizes any\n // em-based child against the wrong root.\n icon: \"size-(--density-control-h-md) px-0 text-base\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n },\n);\n\n/*\n * The label motion, without an animation library.\n *\n * A presence library would keep the outgoing label mounted for the crossfade\n * and drive a motion value for the width morph. CSS cannot keep an outgoing\n * label mounted or observe its own content width, so those two jobs are the\n * plain React below; every animation itself is a CSS keyframe or transition\n * (@seekalfred/styles motion.css, the button-* utilities in styles.css, the\n * --animate-* tokens).\n */\n\n/** A key for the label content: text plus element names, so a new label or icon crossfades while prop-only updates stay in place. */\nfunction labelKey(node: ReactNode): string {\n if (node == null || typeof node === \"boolean\") return \"\";\n if (typeof node === \"string\" || typeof node === \"number\" || typeof node === \"bigint\") return String(node);\n if (Array.isArray(node)) return node.map(labelKey).join(\"\");\n if (!isValidElement(node)) return \"\";\n const type = node.type as string | { displayName?: string; name?: string };\n return \"<\" + (typeof type === \"string\" ? type : (type?.displayName ?? type?.name ?? \"\")) + \">\" + labelKey((node.props as { children?: ReactNode }).children);\n}\n\n/** A label with no text once element names are stripped is an icon, which scales instead of rising. */\nconst isIconKey = (key: string) => !/\\S/.test(key.replace(/<[^>]*>/g, \"\"));\n\ninterface LeavingLabel {\n id: number;\n node: ReactNode;\n icon: boolean;\n rect: Rect;\n}\n\nfunction LeavingPhase({ phase, onDone }: { phase: LeavingLabel; onDone: (id: number) => void }) {\n const { id } = phase;\n const remove = useCallback(() => onDone(id), [onDone, id]);\n useExitBackstop(true, remove);\n return (\n <span\n aria-hidden=\"true\"\n onAnimationEnd={(event) => {\n if (event.target === event.currentTarget) remove();\n }}\n style={phase.rect}\n className={cn(\n \"absolute inline-flex items-center justify-center gap-(--density-control-gap) whitespace-nowrap [&_svg]:shrink-0\",\n phase.icon\n ? \"motion-safe:animate-glyph-out motion-reduce:animate-fade-out\"\n : \"motion-safe:animate-label-out motion-reduce:animate-fade-out\",\n )}\n >\n {phase.node}\n </span>\n );\n}\n\n/** The loading spinner: it scales in on the snappy spring, and out smaller with a little blur. Nothing animates if it is there on first mount. */\nfunction Loader({ show }: { show: boolean }) {\n const [initial] = useState(show);\n const [rendered, setRendered] = useState(show);\n const [animated, setAnimated] = useState(false);\n const leaving = rendered && !show;\n if (show && !rendered) setRendered(true);\n if (!animated && show !== initial) setAnimated(true);\n const unmount = useCallback(() => setRendered(false), []);\n useExitBackstop(leaving, unmount);\n if (!rendered) return null;\n return (\n <span\n aria-hidden=\"true\"\n onAnimationEnd={(event) => {\n if (leaving && event.target === event.currentTarget) unmount();\n }}\n className={cn(\n \"absolute top-1/2 left-1/2 -m-2 grid size-4\",\n leaving\n ? \"motion-safe:animate-loader-out motion-reduce:animate-fade-out\"\n : animated && \"motion-safe:animate-loader-in motion-reduce:animate-fade-in\",\n )}\n >\n <span className=\"rounded-circle border-(length:--border-width-spinner) border-current border-r-transparent motion-safe:animate-spin-fast\" />\n </span>\n );\n}\n\n/**\n * The button's inside: a loader, and a slot that holds the current label.\n *\n * A new label (a different text, or a different icon) mounts under a new key and\n * rises in while the old one is popped out of flow where it was and lifts away.\n * Nothing animates on first mount, and a prop-only update (same key) stays in\n * place.\n */\nfunction ButtonContent({ children, pending }: { children: ReactNode; pending: boolean }) {\n const key = labelKey(children);\n const icon = isIconKey(key);\n const contentRef = useRef<HTMLSpanElement>(null);\n const phaseRef = useRef<HTMLSpanElement>(null);\n\n useMorphWidth(contentRef, key);\n const { leaving, changed, remove } = useLeavingItems(key, { node: children, icon }, () => phaseRef.current);\n\n return (\n <>\n <Loader show={pending} />\n <span className={cn(\"button-slot\", pending && \"opacity-0\")}>\n <span ref={contentRef} className=\"inline-flex flex-none items-center\">\n {leaving.map((item) => (\n <LeavingPhase key={item.id} phase={{ id: item.id, node: item.value.node, icon: item.value.icon, rect: item.rect }} onDone={remove} />\n ))}\n <span\n key={key}\n ref={phaseRef}\n data-slot=\"button-label\"\n className={cn(\n \"inline-flex items-center justify-center gap-(--density-control-gap) whitespace-nowrap [&_svg]:shrink-0\",\n changed &&\n (icon\n ? \"motion-safe:animate-glyph-in motion-reduce:animate-fade-in\"\n : \"motion-safe:animate-label-in motion-reduce:animate-fade-in\"),\n )}\n >\n {children}\n </span>\n </span>\n </span>\n </>\n );\n}\n\n/**\n * Props.\n *\n * CORRECTION 6 -- the legacy Button was a plain `<button>`, so it took\n * `onClick`, `disabled` and Radix's `asChild`. React Aria's Button has none of\n * those: `ButtonProps` explicitly omits `onClick` and `href`. The replacements\n * are `onPress`, `isDisabled`, and `href` -- which renders React Aria's Link in\n * place of its Button. See the migration table in the package README.\n *\n * Deliberately NOT intersected with ComponentPropsWithoutRef<\"button\">: that\n * would advertise disabled, tabIndex and role, which React Aria does not\n * implement and silently ignores. React Aria already forwards the native event\n * surface, so nothing is lost.\n */\nexport interface ButtonProps\n extends Omit<AriaButtonProps, \"className\" | \"style\">, VariantProps<typeof buttonVariants> {\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n /**\n * Icon rendered before the label.\n *\n * Mark the glyph `aria-hidden` -- the label is the accessible name, and a\n * second name source only makes the button announce twice. It is sized by the\n * base `[&_svg]` rule at `--icon-sm` unless it carries a `size-*` class of\n * its own, and spaced by `--density-control-gap`.\n *\n * Two named slots rather than one `icon` plus a position prop: a button can\n * legitimately carry a leading glyph AND a trailing affordance, which one\n * icon and a position cannot express.\n *\n * NOT the route for `size=\"icon\"`. An icon-only button passes its glyph as\n * `children`, which is what gives it its single centred child.\n */\n startIcon?: ReactNode;\n /** Icon rendered after the label. Same rules as {@link ButtonProps.startIcon}. */\n endIcon?: ReactNode;\n /**\n * Makes the button a link. It renders React Aria's `Link` -- a real `<a>`,\n * announced as a link -- with exactly the classes a button of the same\n * `variant` and `size` gets, and the same hover, press and focus-ring states.\n *\n * Use it whenever activating the control navigates. A button that navigates\n * cannot be opened in a new tab, is announced as the wrong role, and is\n * skipped by a screen reader's list of links.\n *\n * Client-side routing needs React Aria's `RouterProvider` mounted once above\n * it; without one, an `href` is an ordinary page load, which is also what an\n * external or download link wants.\n *\n * Button-only props have nothing to act on here: `type`, `form*` and\n * `isPending` are ignored, and the `ref` receives the `<a>`.\n */\n href?: AriaLinkProps[\"href\"];\n /** With `href` only: where to open it, e.g. `\"_blank\"`. */\n target?: AriaLinkProps[\"target\"];\n /** With `href` only. Give `\"noreferrer\"` alongside `target=\"_blank\"` to an external site. */\n rel?: AriaLinkProps[\"rel\"];\n /** With `href` only: download the target instead of opening it, optionally under this file name. */\n download?: AriaLinkProps[\"download\"];\n}\n\n/**\n * A button.\n *\n * A label that changes (a different text, or a different icon) crossfades, and\n * the button's width springs to fit it. While that runs, the OUTGOING label is\n * still in the DOM for about 200ms, `aria-hidden` and out of flow, so read a\n * button's text after the change settles, and do not put `id`s, inputs or\n * anything stateful inside a label that changes. Text that changes constantly,\n * such as a live counter, crossfades every time it does.\n *\n * `size=\"icon\"` renders a square button with no visible text, so it **must**\n * carry an `aria-label` -- otherwise it has no accessible name and fails axe's\n * `button-name` rule. The IconOnly story is the guard on that.\n *\n * @example\n * <Button onPress={save}>Save changes</Button>\n * <Button startIcon={<SaveIcon aria-hidden />}>Save changes</Button>\n * <Button endIcon={<ChevronIcon aria-hidden />}>Continue</Button>\n * <Button variant=\"outline\" size=\"icon\" aria-label=\"Close\"><XIcon /></Button>\n * <Button href=\"/reports\" variant=\"outlineNeutral\">View reports</Button>\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { className, variant, size, startIcon, endIcon, children, href, target, rel, download, ...props },\n ref,\n) {\n const classes = cn(buttonVariants({ variant, size }), className);\n\n const button = useAriaBusy(props.isPending === true);\n\n /*\n * children passes through UNTOUCHED when neither slot is used, so a button\n * with no icon renders byte-identical DOM to before this prop existed. That is\n * what keeps this an additive change rather than a structural one -- and the\n * childOrder assertions in the stories are what hold it true, since they read\n * the button's direct children.\n *\n * The slot branch has to be a render function because React Aria's children\n * are ChildrenOrFunction<ButtonRenderProps>: a consumer may pass a function to\n * read isPressed or isPending, and wrapping the node directly would silently\n * render that function as nothing. The fragment adds no element of its own.\n */\n const content = (renderProps: ButtonRenderProps & { defaultChildren: ReactNode | undefined }) => (\n <ButtonContent pending={renderProps.isPending}>\n {startIcon}\n {typeof children === \"function\" ? children(renderProps) : children}\n {endIcon}\n </ButtonContent>\n );\n\n const { onPressStart } = props;\n const pressStart = (event: PressEvent) => {\n if (!anchorsLayer(props)) {\n const target = event.target as HTMLElement;\n target.style.setProperty(\"--press-scale\", pressScaleFor(target.offsetWidth));\n }\n onPressStart?.(event);\n };\n\n if (href !== undefined) {\n /*\n * The same classes on React Aria's Link. It sets data-hovered,\n * data-pressed and data-focus-visible on the <a>, which is what every\n * state class above keys on -- nothing here is re-implemented.\n *\n * Button-only props need no stripping: Link runs its props through\n * filterDOMProps, so `type` never reaches the <a>, and `isPending` is not a\n * DOM prop. A link has no pending state, so a render-function child is told\n * it is not pending rather than handed an object missing the field. The ref\n * is typed for the button this usually is; with href it receives the <a>,\n * which the TSDoc on `href` says.\n */\n return (\n <AriaLink\n ref={ref as unknown as ForwardedRef<HTMLAnchorElement>}\n {...(props as Omit<AriaLinkProps, \"className\" | \"children\">)}\n onPressStart={pressStart}\n href={href}\n target={target}\n rel={rel}\n download={download}\n data-slot=\"button\"\n className={classes}\n >\n {(renderProps) => content({ ...renderProps, isPending: false })}\n </AriaLink>\n );\n }\n\n return (\n <AriaButton ref={mergeRefs(ref, button as RefObject<HTMLButtonElement | null>)} {...props} onPressStart={pressStart} data-slot=\"button\" className={classes}>\n {content}\n </AriaButton>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,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AD;EAAY,KAAK,UAAU,KAAK,MAA6C;EAAG,GAAI;EAAO,cAAc;EAAY,aAAU;EAAS,WAAW;EAChJ,UAAA;CACS,CAAA;AAEhB,CAAC"}
1
+ {"version":3,"file":"button.js","names":["Button","AriaLink","AriaButton"],"sources":["../../src/button/button.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport {\n forwardRef,\n isValidElement,\n useCallback,\n useRef,\n useState,\n type ForwardedRef,\n type ReactNode,\n type RefObject,\n} from \"react\";\nimport {\n Button as AriaButton,\n Link as AriaLink,\n type ButtonProps as AriaButtonProps,\n type ButtonRenderProps,\n type LinkProps as AriaLinkProps,\n type PressEvent,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { mergeRefs } from \"../lib/merge-refs.js\";\nimport {\n anchorsLayer,\n pressScaleFor,\n useAriaBusy,\n useExitBackstop,\n useLeavingItems,\n useMorphWidth,\n type Rect,\n} from \"../lib/motion.js\";\n\n/**\n * Variant classes, exported so a consumer can reuse the exact classes we ship\n * rather than guessing at them.\n *\n * NOT the answer for a link-shaped button any more: pass `href` to Button. On a\n * consumer's own <a> these classes get none of their states -- hover, press and\n * the focus ring all key on React Aria data attributes that a plain anchor never\n * receives, and the base sets outline-none, so keyboard focus was invisible.\n *\n * Ported from the legacy shadcn Button. The variant and size vocabulary is\n * deliberately identical so existing call sites migrate by rename, with six\n * corrections that the Alfred contracts require -- each marked below.\n *\n * Every string here is a STATIC literal. Tailwind scans source text, so a class\n * assembled at runtime is invisible to it and would simply never be emitted.\n *\n * State comes from React Aria data attributes rather than pseudo-classes:\n * data-[focus-visible] is keyboard focus only, and data-[pressed] covers mouse,\n * touch and keyboard uniformly. The original had no pressed state at all.\n */\n/*\n * The press: the button scales down while pressed (see onPressStart for the\n * scale, which depends on width) and springs back on release. Anchors of\n * floating layers never scale: a menu that opens on pointerdown would measure a\n * shrunken trigger.\n */\nconst pressScale =\n \"motion-safe:data-[pressed]:scale-(--press-scale) [&:is([aria-haspopup]:not([aria-haspopup=false]),[data-state],[role=combobox])]:scale-none!\";\n\nexport const buttonVariants = cva(\n [\n \"inline-flex items-center justify-center gap-(--density-control-gap) shrink-0 whitespace-nowrap\",\n // No leading-* here on purpose. tailwind-merge treats a later text-* class\n // as owning line-height (a Tailwind v3 assumption, where text-base carried\n // one), so a leading-* in the base string is silently STRIPPED by cn() once\n // a size variant adds text-base. It is not needed either: the control has a\n // fixed height and centres with flex, so line-height cannot overflow it.\n // A component with auto height must put leading-* AFTER its text-* class.\n \"rounded-control font-sans font-medium\",\n \"cursor-pointer select-none\",\n\n // font-sans above is part of the same problem: a <button> does not inherit\n // the page font, so without a reset it renders in the user-agent face\n // (Arial in Chromium) rather than the design system's. The same applies to\n // bg-transparent: an unstyled <button> paints the user-agent ButtonFace\n // grey -- which is what surfaces the moment a fill class fails to resolve,\n // and is why the paint stories compare against tokens rather than checking\n // for transparency.\n //\n // The reset in @seekalfred/styles is OPT-IN, so a consumer may never load\n // one. A bare <button> then keeps its user-agent border (2px, black, in\n // Chromium) and inline padding, which is a black box around every variant\n // that does not set a border of its own. The original inherited a zeroed\n // border from Tailwind Preflight in the app; a library component cannot\n // assume the consumer supplied one.\n \"border-(length:--border-width) border-transparent bg-transparent\",\n\n // Icon handling, ported verbatim: an svg child is sized unless the caller\n // already said otherwise, and never swallows the press.\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-(--icon-sm)\",\n\n // CORRECTION 1 -- the original focused with `ring-[3px]`, which is a\n // box-shadow. Box-shadows are discarded under forced-colors, taking the\n // only focus indication with them, and axe has no rule that would catch it\n // (ARCHITECTURE section 5, rule 6). A real outline survives.\n //\n // outline-solid on the focus variant is load-bearing, not decoration.\n // `outline-none` sets BOTH outline-style:none and --tw-outline-style:none,\n // and Tailwind's outline-width utility resolves its style from that same\n // variable -- so the focus variant applied a width and a colour while\n // faithfully re-applying style:none, and painted nothing. The button was\n // keyboard-focusable with no visible ring. axe has no focus-indicator\n // rule, so every automated gate stayed green; the KeyboardFocus story now\n // asserts outlineStyle directly.\n \"outline-none\",\n \"data-[focus-visible]:outline-solid\",\n \"data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset)\",\n \"data-[focus-visible]:outline-(--color-ring)\",\n\n // CORRECTION 2 -- `disabled:pointer-events-none` also kills the cursor, so\n // the control reads as inert rather than as unavailable. React Aria already\n // blocks activation; this only has to say so.\n // The opacity half of the disabled look moved into each variant: the\n // outlined and ghost buttons stay fully opaque and mute their colours\n // instead, which a single base opacity cannot express.\n \"data-[disabled]:cursor-not-allowed\",\n \"[-webkit-tap-highlight-color:transparent]\",\n\n // React Aria's own pending state. The original had no equivalent.\n \"data-[pending]:cursor-progress\",\n ],\n {\n variants: {\n variant: {\n // CORRECTION 3 -- the legacy button filled this variant with the brand\n // gradient. It is flat here, because the brand system caps\n // --gradient-brand at one intentional element per view and keeps that\n // budget for the logo and progress bars: \"a gradient on every button\n // spends that budget everywhere. Ours is the flat primary.\"\n //\n // CORRECTION 4 -- the label is ink, not white. Brand orange #FF8431\n // carries white at 2.44:1; ink clears it at 8.35:1, which is the brand\n // system's own --text-on-orange rule. Its Button ships white only as a\n // dated, individually signed-off exception, and this library's contrast\n // contract is build-failing with no exemption mechanism to inherit it.\n //\n // Hover and pressed are their own TOKENS again (primary 400 and 600),\n // as the design spec (Oct 2026) sets them; an opacity step would make\n // the label pair depend on whatever sits behind the button. Both pairs\n // are in the contrast contract (contrast-pairs.json).\n primary: [\n \"bg-primary text-primary-foreground shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n // Design spec (Oct 2026): hover primary 400, pressed primary 600.\n \"data-[hovered]:bg-primary-hover data-[hovered]:shadow-resting\",\n \"data-[pressed]:bg-primary-pressed\",\n \"data-[disabled]:opacity-(--opacity-button-disabled)\",\n ],\n /*\n * The AI action (Generate, Seek Alfred). The primary fill with a beam\n * that runs around its edge in orange, lavender and teal; on hover the\n * beam speeds up, the button glows and an icon tilts. Disabled stops the\n * beam. See ai-beam in styles.css.\n */\n ai: [\n \"bg-primary text-primary-foreground shadow-surface\",\n \"ai-beam\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-primary-hover\",\n \"motion-safe:data-[hovered]:[&_svg]:-rotate-12\",\n \"data-[disabled]:opacity-(--opacity-button-disabled)\",\n ],\n /*\n * Design spec (Oct 2026): Secondary is a white surface with a light\n * border and dark text -- the same paint as `outlineNeutral` below, kept\n * under this name so existing call sites need no rename. It used to be\n * the lavender fill; the lavender `secondary` role still exists for\n * badges and highlights, just not on a button.\n */\n secondary: [\n \"bg-surface text-foreground border-(length:--border-width) border-border shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted data-[hovered]:shadow-resting\",\n \"data-[pressed]:bg-muted\",\n // A disabled secondary button keeps its shape and mutes its fill and\n // label, so it reads as a button that is off, not as plain text.\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground data-[disabled]:border-border\",\n ],\n // primary-strong, never primary: the brand orange is 2.44:1 on the page\n // and cannot legally be a label OR a border. That is the whole reason\n // the token exists.\n outline: [\n \"bg-surface text-primary-strong border-(length:--border-width) border-primary-strong shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted data-[hovered]:shadow-resting\",\n \"data-[pressed]:bg-muted data-[pressed]:border-foreground\",\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-muted-foreground data-[disabled]:border-border\",\n ],\n /*\n * The NEUTRAL outline, and the product's single most-used button:\n * 99 call sites against 32 for the brand-coloured one.\n *\n * It exists because `outline` above is brand-toned -- orange border,\n * orange label -- which is what the product calls `secondaryOutline`.\n * Its plain `outline` is this: a grey border and ordinary body text,\n * for a button that must not compete with the primary action next to\n * it. One name could not cover both, and renaming `outline` would have\n * silently repainted every existing call site of ours instead.\n *\n * This is the design spec's Secondary button: surface, the light\n * `border` hairline and body text. The hairline is below 3:1 by UX\n * decision; the label, hover fill and focus ring carry the boundary.\n */\n outlineNeutral: [\n \"bg-surface text-foreground border-(length:--border-width) border-border shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted data-[hovered]:shadow-resting\",\n \"data-[pressed]:bg-muted\",\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:text-text-disabled\",\n ],\n ghost: [\n \"bg-transparent text-text-secondary\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted data-[hovered]:text-foreground\",\n \"data-[disabled]:opacity-100 data-[disabled]:text-text-disabled\",\n // CORRECTION 5 -- pressed must not be background-only. A ghost button\n // has no border at rest, so the pressed border is the non-colour cue\n // that survives forced-colors (rule 6 again).\n \"data-[pressed]:bg-muted data-[pressed]:border-primary-strong\",\n ],\n // Design spec (Oct 2026): an outlined Danger button, not a red fill.\n destructive: [\n \"bg-surface text-destructive-strong border-(length:--border-width) border-border shadow-surface\",\n \"motion-safe:button-motion\",\n pressScale,\n \"data-[hovered]:bg-muted data-[hovered]:border-destructive-strong\",\n \"data-[pressed]:bg-muted data-[pressed]:border-destructive-strong\",\n // Muted fill, label tinted toward destructive.\n \"data-[disabled]:opacity-100 data-[disabled]:bg-muted data-[disabled]:border-border data-[disabled]:text-[color-mix(in_oklab,var(--color-destructive)_55%,var(--color-muted))]\",\n ],\n link: [\n \"bg-transparent text-text-link underline-offset-(--underline-offset)\",\n \"motion-safe:button-motion\",\n \"data-[disabled]:text-text-disabled\",\n \"data-[hovered]:underline\",\n \"data-[pressed]:underline data-[pressed]:opacity-80\",\n // A trailing arrow moves 3px on hover.\n \"[&_svg:last-child]:transition-transform motion-safe:data-[hovered]:[&_svg:last-child]:translate-x-0.75 rtl:motion-safe:data-[hovered]:[&_svg:last-child]:-translate-x-0.75\",\n ],\n },\n size: {\n // Height, padding and label size all come from the control scale, so\n // data-density moves them together. The icon-only variant is square at\n // the md height. The legacy shadcn rule that tightened padding when a\n // child was an icon is gone: it needed three more magic numbers, the\n // brand system has no equivalent, and the gap token now owns icon\n // spacing.\n // Design spec (Oct 2026): 16px padding and 14px label at 36px and 44px.\n sm: \"h-(--density-control-h-sm) px-4 text-sm\",\n md: \"h-(--density-control-h-md) px-4 text-sm\",\n lg: \"h-(--density-control-h-lg) px-(--density-control-pad-lg) text-lg\",\n // text-base even though there is no visible label: without it the\n // user-agent default (13.33px in Chromium) leaks in and sizes any\n // em-based child against the wrong root.\n icon: \"size-(--density-control-h-md) px-0 text-base\",\n },\n },\n defaultVariants: {\n variant: \"primary\",\n size: \"md\",\n },\n },\n);\n\n/*\n * The label motion, without an animation library.\n *\n * A presence library would keep the outgoing label mounted for the crossfade\n * and drive a motion value for the width morph. CSS cannot keep an outgoing\n * label mounted or observe its own content width, so those two jobs are the\n * plain React below; every animation itself is a CSS keyframe or transition\n * (@seekalfred/styles motion.css, the button-* utilities in styles.css, the\n * --animate-* tokens).\n */\n\n/** A key for the label content: text plus element names, so a new label or icon crossfades while prop-only updates stay in place. */\nfunction labelKey(node: ReactNode): string {\n if (node == null || typeof node === \"boolean\") return \"\";\n if (typeof node === \"string\" || typeof node === \"number\" || typeof node === \"bigint\") return String(node);\n if (Array.isArray(node)) return node.map(labelKey).join(\"\");\n if (!isValidElement(node)) return \"\";\n const type = node.type as string | { displayName?: string; name?: string };\n return \"<\" + (typeof type === \"string\" ? type : (type?.displayName ?? type?.name ?? \"\")) + \">\" + labelKey((node.props as { children?: ReactNode }).children);\n}\n\n/** A label with no text once element names are stripped is an icon, which scales instead of rising. */\nconst isIconKey = (key: string) => !/\\S/.test(key.replace(/<[^>]*>/g, \"\"));\n\ninterface LeavingLabel {\n id: number;\n node: ReactNode;\n icon: boolean;\n rect: Rect;\n}\n\nfunction LeavingPhase({ phase, onDone }: { phase: LeavingLabel; onDone: (id: number) => void }) {\n const { id } = phase;\n const remove = useCallback(() => onDone(id), [onDone, id]);\n useExitBackstop(true, remove);\n return (\n <span\n aria-hidden=\"true\"\n onAnimationEnd={(event) => {\n if (event.target === event.currentTarget) remove();\n }}\n style={phase.rect}\n className={cn(\n \"absolute inline-flex items-center justify-center gap-(--density-control-gap) whitespace-nowrap [&_svg]:shrink-0\",\n phase.icon\n ? \"motion-safe:animate-glyph-out motion-reduce:animate-fade-out\"\n : \"motion-safe:animate-label-out motion-reduce:animate-fade-out\",\n )}\n >\n {phase.node}\n </span>\n );\n}\n\n/** The loading spinner: it scales in on the snappy spring, and out smaller with a little blur. Nothing animates if it is there on first mount. */\nfunction Loader({ show }: { show: boolean }) {\n const [initial] = useState(show);\n const [rendered, setRendered] = useState(show);\n const [animated, setAnimated] = useState(false);\n const leaving = rendered && !show;\n if (show && !rendered) setRendered(true);\n if (!animated && show !== initial) setAnimated(true);\n const unmount = useCallback(() => setRendered(false), []);\n useExitBackstop(leaving, unmount);\n if (!rendered) return null;\n return (\n <span\n aria-hidden=\"true\"\n onAnimationEnd={(event) => {\n if (leaving && event.target === event.currentTarget) unmount();\n }}\n className={cn(\n \"absolute top-1/2 left-1/2 -m-2 grid size-4\",\n leaving\n ? \"motion-safe:animate-loader-out motion-reduce:animate-fade-out\"\n : animated && \"motion-safe:animate-loader-in motion-reduce:animate-fade-in\",\n )}\n >\n <span className=\"rounded-circle border-(length:--border-width-spinner) border-current border-r-transparent motion-safe:animate-spin-fast\" />\n </span>\n );\n}\n\n/**\n * The button's inside: a loader, and a slot that holds the current label.\n *\n * A new label (a different text, or a different icon) mounts under a new key and\n * rises in while the old one is popped out of flow where it was and lifts away.\n * Nothing animates on first mount, and a prop-only update (same key) stays in\n * place.\n */\nfunction ButtonContent({ children, pending }: { children: ReactNode; pending: boolean }) {\n const key = labelKey(children);\n const icon = isIconKey(key);\n const contentRef = useRef<HTMLSpanElement>(null);\n const phaseRef = useRef<HTMLSpanElement>(null);\n\n useMorphWidth(contentRef, key);\n const { leaving, changed, remove } = useLeavingItems(key, { node: children, icon }, () => phaseRef.current);\n\n return (\n <>\n <Loader show={pending} />\n <span className={cn(\"button-slot\", pending && \"opacity-0\")}>\n <span ref={contentRef} className=\"inline-flex flex-none items-center\">\n {leaving.map((item) => (\n <LeavingPhase key={item.id} phase={{ id: item.id, node: item.value.node, icon: item.value.icon, rect: item.rect }} onDone={remove} />\n ))}\n <span\n key={key}\n ref={phaseRef}\n data-slot=\"button-label\"\n className={cn(\n \"inline-flex items-center justify-center gap-(--density-control-gap) whitespace-nowrap [&_svg]:shrink-0\",\n changed &&\n (icon\n ? \"motion-safe:animate-glyph-in motion-reduce:animate-fade-in\"\n : \"motion-safe:animate-label-in motion-reduce:animate-fade-in\"),\n )}\n >\n {children}\n </span>\n </span>\n </span>\n </>\n );\n}\n\n/**\n * Props.\n *\n * CORRECTION 6 -- the legacy Button was a plain `<button>`, so it took\n * `onClick`, `disabled` and Radix's `asChild`. React Aria's Button has none of\n * those: `ButtonProps` explicitly omits `onClick` and `href`. The replacements\n * are `onPress`, `isDisabled`, and `href` -- which renders React Aria's Link in\n * place of its Button. See the migration table in the package README.\n *\n * Deliberately NOT intersected with ComponentPropsWithoutRef<\"button\">: that\n * would advertise disabled, tabIndex and role, which React Aria does not\n * implement and silently ignores. React Aria already forwards the native event\n * surface, so nothing is lost.\n */\nexport interface ButtonProps\n extends Omit<AriaButtonProps, \"className\" | \"style\">, VariantProps<typeof buttonVariants> {\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n /**\n * Icon rendered before the label.\n *\n * Mark the glyph `aria-hidden` -- the label is the accessible name, and a\n * second name source only makes the button announce twice. It is sized by the\n * base `[&_svg]` rule at `--icon-sm` unless it carries a `size-*` class of\n * its own, and spaced by `--density-control-gap`.\n *\n * Two named slots rather than one `icon` plus a position prop: a button can\n * legitimately carry a leading glyph AND a trailing affordance, which one\n * icon and a position cannot express.\n *\n * NOT the route for `size=\"icon\"`. An icon-only button passes its glyph as\n * `children`, which is what gives it its single centred child.\n */\n startIcon?: ReactNode;\n /** Icon rendered after the label. Same rules as {@link ButtonProps.startIcon}. */\n endIcon?: ReactNode;\n /**\n * Makes the button a link. It renders React Aria's `Link` -- a real `<a>`,\n * announced as a link -- with exactly the classes a button of the same\n * `variant` and `size` gets, and the same hover, press and focus-ring states.\n *\n * Use it whenever activating the control navigates. A button that navigates\n * cannot be opened in a new tab, is announced as the wrong role, and is\n * skipped by a screen reader's list of links.\n *\n * Client-side routing needs React Aria's `RouterProvider` mounted once above\n * it; without one, an `href` is an ordinary page load, which is also what an\n * external or download link wants.\n *\n * Button-only props have nothing to act on here: `type`, `form*` and\n * `isPending` are ignored, and the `ref` receives the `<a>`.\n */\n href?: AriaLinkProps[\"href\"];\n /** With `href` only: where to open it, e.g. `\"_blank\"`. */\n target?: AriaLinkProps[\"target\"];\n /** With `href` only. Give `\"noreferrer\"` alongside `target=\"_blank\"` to an external site. */\n rel?: AriaLinkProps[\"rel\"];\n /** With `href` only: download the target instead of opening it, optionally under this file name. */\n download?: AriaLinkProps[\"download\"];\n}\n\n/**\n * A button.\n *\n * A label that changes (a different text, or a different icon) crossfades, and\n * the button's width springs to fit it. While that runs, the OUTGOING label is\n * still in the DOM for about 200ms, `aria-hidden` and out of flow, so read a\n * button's text after the change settles, and do not put `id`s, inputs or\n * anything stateful inside a label that changes. Text that changes constantly,\n * such as a live counter, crossfades every time it does.\n *\n * `size=\"icon\"` renders a square button with no visible text, so it **must**\n * carry an `aria-label` -- otherwise it has no accessible name and fails axe's\n * `button-name` rule. The IconOnly story is the guard on that.\n *\n * @example\n * <Button onPress={save}>Save changes</Button>\n * <Button startIcon={<SaveIcon aria-hidden />}>Save changes</Button>\n * <Button endIcon={<ChevronIcon aria-hidden />}>Continue</Button>\n * <Button variant=\"outline\" size=\"icon\" aria-label=\"Close\"><XIcon /></Button>\n * <Button href=\"/reports\" variant=\"outlineNeutral\">View reports</Button>\n */\nexport const Button = forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n { className, variant, size, startIcon, endIcon, children, href, target, rel, download, ...props },\n ref,\n) {\n const classes = cn(buttonVariants({ variant, size }), className);\n\n const button = useAriaBusy(props.isPending === true);\n\n /*\n * children passes through UNTOUCHED when neither slot is used, so a button\n * with no icon renders byte-identical DOM to before this prop existed. That is\n * what keeps this an additive change rather than a structural one -- and the\n * childOrder assertions in the stories are what hold it true, since they read\n * the button's direct children.\n *\n * The slot branch has to be a render function because React Aria's children\n * are ChildrenOrFunction<ButtonRenderProps>: a consumer may pass a function to\n * read isPressed or isPending, and wrapping the node directly would silently\n * render that function as nothing. The fragment adds no element of its own.\n */\n const content = (renderProps: ButtonRenderProps & { defaultChildren: ReactNode | undefined }) => (\n <ButtonContent pending={renderProps.isPending}>\n {startIcon}\n {typeof children === \"function\" ? children(renderProps) : children}\n {endIcon}\n </ButtonContent>\n );\n\n const { onPressStart } = props;\n const pressStart = (event: PressEvent) => {\n if (!anchorsLayer(props)) {\n const target = event.target as HTMLElement;\n target.style.setProperty(\"--press-scale\", pressScaleFor(target.offsetWidth));\n }\n onPressStart?.(event);\n };\n\n if (href !== undefined) {\n /*\n * The same classes on React Aria's Link. It sets data-hovered,\n * data-pressed and data-focus-visible on the <a>, which is what every\n * state class above keys on -- nothing here is re-implemented.\n *\n * Button-only props need no stripping: Link runs its props through\n * filterDOMProps, so `type` never reaches the <a>, and `isPending` is not a\n * DOM prop. A link has no pending state, so a render-function child is told\n * it is not pending rather than handed an object missing the field. The ref\n * is typed for the button this usually is; with href it receives the <a>,\n * which the TSDoc on `href` says.\n */\n return (\n <AriaLink\n ref={ref as unknown as ForwardedRef<HTMLAnchorElement>}\n {...(props as Omit<AriaLinkProps, \"className\" | \"children\">)}\n onPressStart={pressStart}\n href={href}\n target={target}\n rel={rel}\n download={download}\n data-slot=\"button\"\n className={classes}\n >\n {(renderProps) => content({ ...renderProps, isPending: false })}\n </AriaLink>\n );\n }\n\n return (\n <AriaButton ref={mergeRefs(ref, button as RefObject<HTMLButtonElement | null>)} {...props} onPressStart={pressStart} data-slot=\"button\" className={classes}>\n {content}\n </AriaButton>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAM,aACJ;AAEF,MAAa,iBAAiB,IAC5B;CACE;CAOA;CACA;CAgBA;CAIA;CACA;CAeA;CACA;CACA;CACA;CACA;CAQA;CACA;CAGA;AACF,GACA;CACE,UAAU;EACR,SAAS;GAiBP,SAAS;IACP;IACA;IACA;IAEA;IACA;IACA;GACF;GAOA,IAAI;IACF;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GAQA,WAAW;IACT;IACA;IACA;IACA;IACA;IAGA;GACF;GAIA,SAAS;IACP;IACA;IACA;IACA;IACA;IACA;GACF;GAgBA,gBAAgB;IACd;IACA;IACA;IACA;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;IACA;IACA;IAIA;GACF;GAEA,aAAa;IACX;IACA;IACA;IACA;IACA;IAEA;GACF;GACA,MAAM;IACJ;IACA;IACA;IACA;IACA;IAEA;GACF;EACF;EACA,MAAM;GAQJ,IAAI;GACJ,IAAI;GACJ,IAAI;GAIJ,MAAM;EACR;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;;AAcA,SAAS,SAAS,MAAyB;CACzC,IAAI,QAAQ,QAAQ,OAAO,SAAS,WAAW,OAAO;CACtD,IAAI,OAAO,SAAS,YAAY,OAAO,SAAS,YAAY,OAAO,SAAS,UAAU,OAAO,OAAO,IAAI;CACxG,IAAI,MAAM,QAAQ,IAAI,GAAG,OAAO,KAAK,IAAI,QAAQ,CAAC,CAAC,KAAK,EAAE;CAC1D,IAAI,CAAC,eAAe,IAAI,GAAG,OAAO;CAClC,MAAM,OAAO,KAAK;CAClB,OAAO,OAAO,OAAO,SAAS,WAAW,OAAQ,MAAM,eAAe,MAAM,QAAQ,MAAO,MAAM,SAAU,KAAK,MAAmC,QAAQ;AAC7J;;AAGA,MAAM,aAAa,QAAgB,CAAC,KAAK,KAAK,IAAI,QAAQ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L,GAAK;EACL,cAAc;EACR;EACE;EACH;EACK;EACV,aAAU;EACV,WAAW;EAET,WAAA,gBAAgB,QAAQ;GAAE,GAAG;GAAa,WAAW;EAAM,CAAC;CACtD,CAAA;CAId,OACE,oBAACC,QAAD;EAAY,KAAK,UAAU,KAAK,MAA6C;EAAG,GAAI;EAAO,cAAc;EAAY,aAAU;EAAS,WAAW;EAChJ,UAAA;CACS,CAAA;AAEhB,CAAC"}
@@ -373,17 +373,16 @@ function ButtonGroup({ items, menu, label, variant = "outline", size = "md", ori
373
373
  placement: vertical ? "bottom start" : "bottom end",
374
374
  offset: 6,
375
375
  shouldFocusWrap: true,
376
- className: cn("menu-motion " + (vertical ? "[--menu-ox:left]" : "[--menu-ox:right]")),
377
- children: menu.items.map((action, index) => /* @__PURE__ */ jsxs(MenuItem$1, {
376
+ children: menu.items.map((action) => /* @__PURE__ */ jsxs(MenuItem$1, {
378
377
  id: action.id,
379
378
  textValue: action.label,
380
379
  href: action.href,
381
380
  isDisabled: action.isDisabled,
382
381
  onAction: action.onSelect,
383
- "data-i": Math.min(index, 4),
384
- className: cn("menu-item-motion gap-2.5" + (action.destructive ? " text-destructive-strong data-[focused]:bg-[color-mix(in_oklab,var(--color-destructive-strong)_8%,var(--color-card))]" : "")),
382
+ destructive: action.destructive,
385
383
  children: [action.icon ? /* @__PURE__ */ jsx("span", {
386
384
  "aria-hidden": "true",
385
+ className: action.destructive ? "inline-flex" : "inline-flex text-text-secondary",
387
386
  children: action.icon
388
387
  }) : null, action.label]
389
388
  }, action.id))