@seekalfred/primitives 0.6.0 → 0.7.3

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 (346) hide show
  1. package/README.md +214 -15
  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 +53 -4
  8. package/dist/alert/alert.js +100 -11
  9. package/dist/alert/alert.js.map +1 -1
  10. package/dist/alert/index.d.ts +2 -2
  11. package/dist/alert/index.js +2 -2
  12. package/dist/alert-dialog/alert-dialog.d.ts +58 -18
  13. package/dist/alert-dialog/alert-dialog.js +152 -9
  14. package/dist/alert-dialog/alert-dialog.js.map +1 -1
  15. package/dist/alert-dialog/index.d.ts +2 -2
  16. package/dist/alert-dialog/index.js +2 -2
  17. package/dist/animated-counter/animated-counter.d.ts +38 -0
  18. package/dist/animated-counter/animated-counter.js +230 -0
  19. package/dist/animated-counter/animated-counter.js.map +1 -0
  20. package/dist/animated-counter/index.d.ts +2 -0
  21. package/dist/animated-counter/index.js +2 -0
  22. package/dist/announcement-bar/announcement-bar.d.ts +67 -0
  23. package/dist/announcement-bar/announcement-bar.js +364 -0
  24. package/dist/announcement-bar/announcement-bar.js.map +1 -0
  25. package/dist/announcement-bar/index.d.ts +2 -0
  26. package/dist/announcement-bar/index.js +2 -0
  27. package/dist/badge/badge.d.ts +1 -1
  28. package/dist/bar-chart/bar-chart.d.ts +51 -0
  29. package/dist/bar-chart/bar-chart.js +565 -0
  30. package/dist/bar-chart/bar-chart.js.map +1 -0
  31. package/dist/bar-chart/index.d.ts +2 -0
  32. package/dist/bar-chart/index.js +2 -0
  33. package/dist/breadcrumb/breadcrumb.d.ts +2 -2
  34. package/dist/breadcrumb/breadcrumb.js +12 -3
  35. package/dist/breadcrumb/breadcrumb.js.map +1 -1
  36. package/dist/brush-chart/brush-chart.d.ts +64 -0
  37. package/dist/brush-chart/brush-chart.js +1056 -0
  38. package/dist/brush-chart/brush-chart.js.map +1 -0
  39. package/dist/brush-chart/index.d.ts +2 -0
  40. package/dist/brush-chart/index.js +2 -0
  41. package/dist/button/button.d.ts +1 -1
  42. package/dist/button/button.js +31 -21
  43. package/dist/button/button.js.map +1 -1
  44. package/dist/button-group/button-group.js +3 -4
  45. package/dist/button-group/button-group.js.map +1 -1
  46. package/dist/calendar/calendar.d.ts +1 -1
  47. package/dist/card/card.d.ts +22 -1
  48. package/dist/card/card.js +60 -7
  49. package/dist/card/card.js.map +1 -1
  50. package/dist/card-stack/card-stack.d.ts +54 -0
  51. package/dist/card-stack/card-stack.js +492 -0
  52. package/dist/card-stack/card-stack.js.map +1 -0
  53. package/dist/card-stack/index.d.ts +2 -0
  54. package/dist/card-stack/index.js +2 -0
  55. package/dist/carousel/carousel.d.ts +77 -0
  56. package/dist/carousel/carousel.js +415 -0
  57. package/dist/carousel/carousel.js.map +1 -0
  58. package/dist/carousel/index.d.ts +2 -0
  59. package/dist/carousel/index.js +2 -0
  60. package/dist/checkbox/checkbox.js +4 -4
  61. package/dist/checkbox/checkbox.js.map +1 -1
  62. package/dist/chip-group/chip-group.d.ts +37 -0
  63. package/dist/chip-group/chip-group.js +148 -0
  64. package/dist/chip-group/chip-group.js.map +1 -0
  65. package/dist/chip-group/index.d.ts +2 -0
  66. package/dist/chip-group/index.js +2 -0
  67. package/dist/copy-button/copy-button.d.ts +18 -2
  68. package/dist/copy-button/copy-button.js +29 -8
  69. package/dist/copy-button/copy-button.js.map +1 -1
  70. package/dist/countdown/countdown.d.ts +45 -0
  71. package/dist/countdown/countdown.js +298 -0
  72. package/dist/countdown/countdown.js.map +1 -0
  73. package/dist/countdown/index.d.ts +2 -0
  74. package/dist/countdown/index.js +2 -0
  75. package/dist/date-picker/picker-parts.js +1 -1
  76. package/dist/date-picker/picker-parts.js.map +1 -1
  77. package/dist/dialog/dialog.js +1 -1
  78. package/dist/dialog/dialog.js.map +1 -1
  79. package/dist/donut-chart/donut-chart.d.ts +86 -0
  80. package/dist/donut-chart/donut-chart.js +593 -0
  81. package/dist/donut-chart/donut-chart.js.map +1 -0
  82. package/dist/donut-chart/index.d.ts +2 -0
  83. package/dist/donut-chart/index.js +2 -0
  84. package/dist/empty-state/empty-state.d.ts +42 -10
  85. package/dist/empty-state/empty-state.js +44 -26
  86. package/dist/empty-state/empty-state.js.map +1 -1
  87. package/dist/empty-state/index.d.ts +2 -2
  88. package/dist/empty-state/index.js +2 -2
  89. package/dist/file-drop-zone/file-drop-zone.js +1 -1
  90. package/dist/file-drop-zone/file-drop-zone.js.map +1 -1
  91. package/dist/filter-bar/filter-bar.d.ts +50 -26
  92. package/dist/filter-bar/filter-bar.js +317 -157
  93. package/dist/filter-bar/filter-bar.js.map +1 -1
  94. package/dist/gauge/gauge.d.ts +45 -0
  95. package/dist/gauge/gauge.js +219 -0
  96. package/dist/gauge/gauge.js.map +1 -0
  97. package/dist/gauge/index.d.ts +2 -0
  98. package/dist/gauge/index.js +2 -0
  99. package/dist/in-view-title/in-view-title.d.ts +33 -0
  100. package/dist/in-view-title/in-view-title.js +119 -0
  101. package/dist/in-view-title/in-view-title.js.map +1 -0
  102. package/dist/in-view-title/index.d.ts +2 -0
  103. package/dist/in-view-title/index.js +2 -0
  104. package/dist/index.d.ts +53 -10
  105. package/dist/index.js +52 -12
  106. package/dist/input/input.js +4 -4
  107. package/dist/input/input.js.map +1 -1
  108. package/dist/lib/cn.js +11 -1
  109. package/dist/lib/cn.js.map +1 -1
  110. package/dist/lib/field-message.js +28 -10
  111. package/dist/lib/field-message.js.map +1 -1
  112. package/dist/lib/field-shell.js +10 -3
  113. package/dist/lib/field-shell.js.map +1 -1
  114. package/dist/lib/field-surface.js +31 -9
  115. package/dist/lib/field-surface.js.map +1 -1
  116. package/dist/lib/flag-emoji.js +50 -0
  117. package/dist/lib/flag-emoji.js.map +1 -0
  118. package/dist/lib/flip.js +11 -3
  119. package/dist/lib/flip.js.map +1 -1
  120. package/dist/lib/menu-highlight.js +64 -0
  121. package/dist/lib/menu-highlight.js.map +1 -0
  122. package/dist/lib/motion.js +9 -2
  123. package/dist/lib/motion.js.map +1 -1
  124. package/dist/lib/rolling-value.js +1 -1
  125. package/dist/lib/rolling-value.js.map +1 -1
  126. package/dist/lib/spring-tween.js +500 -0
  127. package/dist/lib/spring-tween.js.map +1 -0
  128. package/dist/lib/swap-text.js +3 -1
  129. package/dist/lib/swap-text.js.map +1 -1
  130. package/dist/lib/use-copy-feedback.js +17 -3
  131. package/dist/lib/use-copy-feedback.js.map +1 -1
  132. package/dist/line-chart/index.d.ts +2 -0
  133. package/dist/line-chart/index.js +2 -0
  134. package/dist/line-chart/line-chart.d.ts +116 -0
  135. package/dist/line-chart/line-chart.js +740 -0
  136. package/dist/line-chart/line-chart.js.map +1 -0
  137. package/dist/mention-input/index.d.ts +2 -0
  138. package/dist/mention-input/index.js +2 -0
  139. package/dist/mention-input/mention-input.d.ts +98 -0
  140. package/dist/mention-input/mention-input.js +576 -0
  141. package/dist/mention-input/mention-input.js.map +1 -0
  142. package/dist/menu/menu.d.ts +2 -0
  143. package/dist/menu/menu.js +23 -12
  144. package/dist/menu/menu.js.map +1 -1
  145. package/dist/money-input/index.d.ts +2 -0
  146. package/dist/money-input/index.js +2 -0
  147. package/dist/money-input/money-input.d.ts +86 -0
  148. package/dist/money-input/money-input.js +613 -0
  149. package/dist/money-input/money-input.js.map +1 -0
  150. package/dist/morph-select/index.d.ts +2 -0
  151. package/dist/morph-select/index.js +2 -0
  152. package/dist/morph-select/morph-select.d.ts +89 -0
  153. package/dist/morph-select/morph-select.js +712 -0
  154. package/dist/morph-select/morph-select.js.map +1 -0
  155. package/dist/multi-select/index.d.ts +2 -0
  156. package/dist/multi-select/index.js +2 -0
  157. package/dist/multi-select/multi-select.d.ts +77 -0
  158. package/dist/multi-select/multi-select.js +209 -0
  159. package/dist/multi-select/multi-select.js.map +1 -0
  160. package/dist/number-field/index.d.ts +2 -0
  161. package/dist/number-field/index.js +2 -0
  162. package/dist/number-field/number-field.d.ts +42 -0
  163. package/dist/number-field/number-field.js +199 -0
  164. package/dist/number-field/number-field.js.map +1 -0
  165. package/dist/onboarding-checklist/index.d.ts +2 -0
  166. package/dist/onboarding-checklist/index.js +2 -0
  167. package/dist/onboarding-checklist/onboarding-checklist.d.ts +55 -0
  168. package/dist/onboarding-checklist/onboarding-checklist.js +577 -0
  169. package/dist/onboarding-checklist/onboarding-checklist.js.map +1 -0
  170. package/dist/password-field/password-field.d.ts +16 -0
  171. package/dist/password-field/password-field.js +39 -10
  172. package/dist/password-field/password-field.js.map +1 -1
  173. package/dist/phone-input/index.d.ts +3 -0
  174. package/dist/phone-input/index.js +3 -0
  175. package/dist/phone-input/phone-countries.d.ts +29 -0
  176. package/dist/phone-input/phone-countries.js +170 -0
  177. package/dist/phone-input/phone-countries.js.map +1 -0
  178. package/dist/phone-input/phone-input.d.ts +66 -0
  179. package/dist/phone-input/phone-input.js +440 -0
  180. package/dist/phone-input/phone-input.js.map +1 -0
  181. package/dist/popover/index.d.ts +2 -2
  182. package/dist/popover/index.js +2 -2
  183. package/dist/popover/popover.d.ts +51 -2
  184. package/dist/popover/popover.js +59 -8
  185. package/dist/popover/popover.js.map +1 -1
  186. package/dist/progress/progress.d.ts +16 -2
  187. package/dist/progress/progress.js +16 -9
  188. package/dist/progress/progress.js.map +1 -1
  189. package/dist/radio-group/index.d.ts +2 -2
  190. package/dist/radio-group/index.js +2 -2
  191. package/dist/radio-group/radio-group.d.ts +33 -3
  192. package/dist/radio-group/radio-group.js +110 -10
  193. package/dist/radio-group/radio-group.js.map +1 -1
  194. package/dist/reactions/index.d.ts +2 -0
  195. package/dist/reactions/index.js +2 -0
  196. package/dist/reactions/reactions.d.ts +50 -0
  197. package/dist/reactions/reactions.js +315 -0
  198. package/dist/reactions/reactions.js.map +1 -0
  199. package/dist/rich-text-editor/index.d.ts +3 -0
  200. package/dist/rich-text-editor/index.js +2 -0
  201. package/dist/rich-text-editor/rich-text-editor.d.ts +70 -0
  202. package/dist/rich-text-editor/rich-text-editor.js +909 -0
  203. package/dist/rich-text-editor/rich-text-editor.js.map +1 -0
  204. package/dist/rich-text-editor/rich-text-engine.d.ts +16 -0
  205. package/dist/rich-text-editor/rich-text-engine.js +366 -0
  206. package/dist/rich-text-editor/rich-text-engine.js.map +1 -0
  207. package/dist/rich-text-editor/rich-text-html.js +174 -0
  208. package/dist/rich-text-editor/rich-text-html.js.map +1 -0
  209. package/dist/rich-text-editor/rich-text-icons.js +43 -0
  210. package/dist/rich-text-editor/rich-text-icons.js.map +1 -0
  211. package/dist/ridgeline/index.d.ts +2 -0
  212. package/dist/ridgeline/index.js +2 -0
  213. package/dist/ridgeline/ridgeline.d.ts +55 -0
  214. package/dist/ridgeline/ridgeline.js +701 -0
  215. package/dist/ridgeline/ridgeline.js.map +1 -0
  216. package/dist/scroll-area/index.d.ts +2 -2
  217. package/dist/scroll-area/index.js +2 -2
  218. package/dist/scroll-area/scroll-area.d.ts +68 -31
  219. package/dist/scroll-area/scroll-area.js +212 -62
  220. package/dist/scroll-area/scroll-area.js.map +1 -1
  221. package/dist/scrub-input/evaluate.d.ts +14 -0
  222. package/dist/scrub-input/evaluate.js +72 -0
  223. package/dist/scrub-input/evaluate.js.map +1 -0
  224. package/dist/scrub-input/index.d.ts +3 -0
  225. package/dist/scrub-input/index.js +3 -0
  226. package/dist/scrub-input/scrub-input.d.ts +74 -0
  227. package/dist/scrub-input/scrub-input.js +486 -0
  228. package/dist/scrub-input/scrub-input.js.map +1 -0
  229. package/dist/search-field/search-field.d.ts +24 -2
  230. package/dist/search-field/search-field.js +24 -9
  231. package/dist/search-field/search-field.js.map +1 -1
  232. package/dist/select/select.d.ts +3 -1
  233. package/dist/select/select.js +28 -14
  234. package/dist/select/select.js.map +1 -1
  235. package/dist/separator/separator.d.ts +22 -10
  236. package/dist/separator/separator.js +33 -11
  237. package/dist/separator/separator.js.map +1 -1
  238. package/dist/sheet/sheet.js +2 -1
  239. package/dist/sheet/sheet.js.map +1 -1
  240. package/dist/shortcut-recorder/index.d.ts +3 -0
  241. package/dist/shortcut-recorder/index.js +3 -0
  242. package/dist/shortcut-recorder/shortcut-model.d.ts +27 -0
  243. package/dist/shortcut-recorder/shortcut-model.js +206 -0
  244. package/dist/shortcut-recorder/shortcut-model.js.map +1 -0
  245. package/dist/shortcut-recorder/shortcut-recorder.d.ts +93 -0
  246. package/dist/shortcut-recorder/shortcut-recorder.js +489 -0
  247. package/dist/shortcut-recorder/shortcut-recorder.js.map +1 -0
  248. package/dist/slider/index.d.ts +2 -2
  249. package/dist/slider/slider.d.ts +46 -14
  250. package/dist/slider/slider.js +151 -67
  251. package/dist/slider/slider.js.map +1 -1
  252. package/dist/slope-chart/index.d.ts +2 -0
  253. package/dist/slope-chart/index.js +2 -0
  254. package/dist/slope-chart/slope-chart.d.ts +54 -0
  255. package/dist/slope-chart/slope-chart.js +568 -0
  256. package/dist/slope-chart/slope-chart.js.map +1 -0
  257. package/dist/sparkline/index.d.ts +2 -0
  258. package/dist/sparkline/index.js +2 -0
  259. package/dist/sparkline/sparkline.d.ts +46 -0
  260. package/dist/sparkline/sparkline.js +390 -0
  261. package/dist/sparkline/sparkline.js.map +1 -0
  262. package/dist/split-bar/index.d.ts +2 -0
  263. package/dist/split-bar/index.js +2 -0
  264. package/dist/split-bar/split-bar.d.ts +62 -0
  265. package/dist/split-bar/split-bar.js +513 -0
  266. package/dist/split-bar/split-bar.js.map +1 -0
  267. package/dist/split-button/split-button.d.ts +1 -1
  268. package/dist/split-button/split-button.js +12 -11
  269. package/dist/split-button/split-button.js.map +1 -1
  270. package/dist/stat-card/index.d.ts +2 -2
  271. package/dist/stat-card/index.js +2 -2
  272. package/dist/stat-card/stat-card.d.ts +58 -5
  273. package/dist/stat-card/stat-card.js +144 -17
  274. package/dist/stat-card/stat-card.js.map +1 -1
  275. package/dist/stepper/index.d.ts +2 -0
  276. package/dist/stepper/index.js +2 -0
  277. package/dist/stepper/stepper.d.ts +51 -0
  278. package/dist/stepper/stepper.js +215 -0
  279. package/dist/stepper/stepper.js.map +1 -0
  280. package/dist/streamgraph/index.d.ts +2 -0
  281. package/dist/streamgraph/index.js +2 -0
  282. package/dist/streamgraph/streamgraph.d.ts +70 -0
  283. package/dist/streamgraph/streamgraph.js +613 -0
  284. package/dist/streamgraph/streamgraph.js.map +1 -0
  285. package/dist/styles.css +1 -1
  286. package/dist/swipe-actions/index.d.ts +2 -0
  287. package/dist/swipe-actions/index.js +2 -0
  288. package/dist/swipe-actions/swipe-actions.d.ts +67 -0
  289. package/dist/swipe-actions/swipe-actions.js +552 -0
  290. package/dist/swipe-actions/swipe-actions.js.map +1 -0
  291. package/dist/switch/switch.js +2 -2
  292. package/dist/switch/switch.js.map +1 -1
  293. package/dist/table/index.d.ts +2 -2
  294. package/dist/table/index.js +2 -2
  295. package/dist/table/table.d.ts +55 -3
  296. package/dist/table/table.js +340 -165
  297. package/dist/table/table.js.map +1 -1
  298. package/dist/tabs/tabs.js +2 -2
  299. package/dist/tabs/tabs.js.map +1 -1
  300. package/dist/tag-input/index.d.ts +2 -0
  301. package/dist/tag-input/index.js +2 -0
  302. package/dist/tag-input/tag-input.d.ts +40 -0
  303. package/dist/tag-input/tag-input.js +269 -0
  304. package/dist/tag-input/tag-input.js.map +1 -0
  305. package/dist/text-morph/index.d.ts +2 -0
  306. package/dist/text-morph/index.js +2 -0
  307. package/dist/text-morph/text-morph.d.ts +23 -0
  308. package/dist/text-morph/text-morph.js +21 -0
  309. package/dist/text-morph/text-morph.js.map +1 -0
  310. package/dist/text-reveal/index.d.ts +2 -0
  311. package/dist/text-reveal/index.js +2 -0
  312. package/dist/text-reveal/text-reveal.d.ts +27 -0
  313. package/dist/text-reveal/text-reveal.js +51 -0
  314. package/dist/text-reveal/text-reveal.js.map +1 -0
  315. package/dist/text-shimmer/index.d.ts +2 -0
  316. package/dist/text-shimmer/index.js +2 -0
  317. package/dist/text-shimmer/text-shimmer.d.ts +29 -0
  318. package/dist/text-shimmer/text-shimmer.js +29 -0
  319. package/dist/text-shimmer/text-shimmer.js.map +1 -0
  320. package/dist/time-picker/time-picker.d.ts +36 -1
  321. package/dist/time-picker/time-picker.js +35 -7
  322. package/dist/time-picker/time-picker.js.map +1 -1
  323. package/dist/toast/index.d.ts +2 -2
  324. package/dist/toast/index.js +2 -2
  325. package/dist/toast/toast.d.ts +7 -1
  326. package/dist/toast/toast.js +82 -40
  327. package/dist/toast/toast.js.map +1 -1
  328. package/dist/tooltip/tooltip.d.ts +9 -2
  329. package/dist/tooltip/tooltip.js +7 -7
  330. package/dist/tooltip/tooltip.js.map +1 -1
  331. package/dist/treemap/index.d.ts +2 -0
  332. package/dist/treemap/index.js +2 -0
  333. package/dist/treemap/treemap.d.ts +53 -0
  334. package/dist/treemap/treemap.js +699 -0
  335. package/dist/treemap/treemap.js.map +1 -0
  336. package/dist/usage-meter/index.d.ts +2 -0
  337. package/dist/usage-meter/index.js +2 -0
  338. package/dist/usage-meter/usage-meter.d.ts +80 -0
  339. package/dist/usage-meter/usage-meter.js +458 -0
  340. package/dist/usage-meter/usage-meter.js.map +1 -0
  341. package/dist/waffle-chart/index.d.ts +2 -0
  342. package/dist/waffle-chart/index.js +2 -0
  343. package/dist/waffle-chart/waffle-chart.d.ts +57 -0
  344. package/dist/waffle-chart/waffle-chart.js +426 -0
  345. package/dist/waffle-chart/waffle-chart.js.map +1 -0
  346. package/package.json +165 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"swipe-actions.js","names":["AriaButton","Menu","MenuItem"],"sources":["../../src/swipe-actions/swipe-actions.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n Children,\n createContext,\n Fragment,\n isValidElement,\n useCallback,\n useContext,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n type Dispatch,\n type MouseEvent as ReactMouseEvent,\n type PointerEvent as ReactPointerEvent,\n type ReactElement,\n type ReactNode,\n type SetStateAction,\n} from \"react\";\nimport { Button as AriaButton } from \"react-aria-components\";\n\nimport { cn, cnAll } from \"../lib/cn.js\";\nimport { useLeavingList } from \"../lib/leaving-list.js\";\nimport { Menu, MenuItem, MenuTrigger } from \"../menu/menu.js\";\nimport { prefersReducedMotion, useExitBackstop, useIsomorphicLayoutEffect } from \"../lib/motion.js\";\nimport { live, MORPH, retarget, SMOOTH, SNAPPY } from \"../lib/spring-tween.js\";\n\nexport interface SwipeAction {\n /** Names the action: under its icon when revealed, and in the row's More actions menu. */\n label: string;\n icon: ReactNode;\n /** The fill of the revealed action. Pair `destructive` with a label that names the destructive result. @default \"neutral\" */\n tone?: \"neutral\" | \"primary\" | \"destructive\";\n /** Runs for a full swipe, a tap on the revealed action, or the More actions menu. Remove the item here unless `keepRow` is set. */\n onSelect: () => void;\n /** The row springs home after the action instead of sliding away, for actions such as Mark as unread. */\n keepRow?: boolean;\n}\n\nexport interface SwipeActionsProps {\n /** Names the list. */\n label: string;\n /** `SwipeActionsRow`s, each with a stable `key`: a row that is removed slides out and the list closes the gap. */\n children: ReactNode;\n /** Extra classes for the list's frame. Merged last. */\n className?: string;\n}\n\n/** One row. `leading` actions sit under the left edge and `trailing` ones under the right; the outermost on each side commits on a full swipe. */\nexport interface SwipeActionsRowProps {\n /** Names the row in its menu button, for example the message subject. */\n label: string;\n leading?: SwipeAction[];\n trailing?: SwipeAction[];\n /** Lets a long swipe commit the outermost action without a tap. @default true */\n fullSwipe?: boolean;\n children: ReactNode;\n /** Extra classes for the row's content. Merged last. */\n className?: string;\n}\n\ntype Side = \"leading\" | \"trailing\";\n\ninterface Group {\n openId: string | null;\n setOpenId: Dispatch<SetStateAction<string | null>>;\n rows: Map<string, HTMLElement>;\n}\n\n/** What a list tells one of its rows: that it was removed and is on its way out, and that it arrived after the first render. */\ninterface RowState {\n id: string;\n leaving: boolean;\n fresh: boolean;\n done: (id: string) => void;\n}\n\ninterface Drag {\n pointer: number;\n type: string;\n startX: number;\n startY: number;\n origin: number;\n locked: \"x\" | \"y\" | null;\n samples: [number, number][];\n}\n\ninterface LayerParts {\n layer: HTMLElement;\n anchor: HTMLElement | null;\n icon: HTMLElement | null;\n label: HTMLElement | null;\n}\n\n/** Width of one action while a row rests open. */\nconst ACTION = 76;\n/** Movement before a press is read as a swipe or handed to the page as a scroll. */\nconst SLOP = 8;\n/** Seconds of travel projected from the release velocity, roughly a 0.99 deceleration rate. */\nconst PROJECTION = 0.1;\n/** Release speed in px/s that counts as a flick. */\nconst FLICK = 900;\n/** The longest a leaving row's collapse takes, plus a margin, for the backstop that removes a row whose transition never ends. */\nconst COLLAPSE_BACKSTOP = 1300;\n/** How long a committed row waits for its list to remove it before it comes back. */\nconst RESTORE_MS = 1400;\n\nconst clamp01 = (value: number) => Math.min(1, Math.max(0, value));\n/** Past its last stop the row still follows, but every pixel costs more, like pulling against elastic. */\nconst rubberBand = (overshoot: number, dimension: number) =>\n (1 - 1 / ((overshoot * 0.55) / dimension + 1)) * dimension;\nconst sideOf = (value: number): Side | null =>\n value > 0 ? \"leading\" : value < 0 ? \"trailing\" : null;\n\nconst GroupContext = createContext<Group>({ openId: null, setOpenId: () => {}, rows: new Map() });\nconst RowStateContext = createContext<RowState | null>(null);\n\nfunction velocityOf(samples: [number, number][]) {\n const last = samples[samples.length - 1];\n if (!last) return 0;\n const first = samples.find((sample) => last[0] - sample[0] <= 80) ?? last;\n const elapsed = (last[0] - first[0]) / 1000;\n return elapsed > 0 ? (last[1] - first[1]) / elapsed : 0;\n}\n\n/**\n * A list whose rows reveal actions on a horizontal swipe, the way a mail inbox does. Use\n * it for short lists where people triage items quickly.\n *\n * Only one row stays open at a time; touching anywhere else or pressing Escape puts it\n * away. Every row also has a More actions menu with the same actions, so keyboard,\n * screen reader and single-pointer users never need the gesture. A row that is removed\n * slides out and the list closes the gap; a row added later opens its height.\n *\n * Reduced motion: rows jump to where the finger leaves them, and removal is immediate.\n *\n * @example\n * <SwipeActions label=\"Inbox\">\n * {mails.map((mail) => (\n * <SwipeActionsRow key={mail.id} label={mail.subject} trailing={[archive, trash]}>\n * {mail.subject}\n * </SwipeActionsRow>\n * ))}\n * </SwipeActions>\n */\nexport function SwipeActions({ label, children, className }: SwipeActionsProps) {\n const [openId, setOpenId] = useState<string | null>(null);\n const [rows] = useState(() => new Map<string, HTMLElement>());\n\n useEffect(() => {\n if (!openId) return;\n const onPointerDown = (event: PointerEvent) => {\n const row = rows.get(openId);\n if (row && event.target instanceof Node && row.contains(event.target)) return;\n setOpenId(null);\n };\n const onKeyDown = (event: KeyboardEvent) => {\n if (event.key === \"Escape\") setOpenId(null);\n };\n document.addEventListener(\"pointerdown\", onPointerDown, true);\n document.addEventListener(\"keydown\", onKeyDown);\n return () => {\n document.removeEventListener(\"pointerdown\", onPointerDown, true);\n document.removeEventListener(\"keydown\", onKeyDown);\n };\n }, [openId, rows]);\n\n const group = useMemo(() => ({ openId, setOpenId, rows }), [openId, rows]);\n\n // A removed row stays on screen, collapsing, until its exit ends.\n const items = Children.toArray(children).filter((child): child is ReactElement =>\n isValidElement(child),\n );\n const { list, done: leaveDone } = useLeavingList(\n items.map((node) => ({ id: String(node.key), node })),\n );\n // The rows there at first render never animate in; one that arrives later opens its height.\n const [initial] = useState(() => new Set(items.map((node) => String(node.key))));\n const [ready, setReady] = useState(false);\n useIsomorphicLayoutEffect(() => {\n const frame = requestAnimationFrame(() => setReady(true));\n return () => cancelAnimationFrame(frame);\n }, []);\n const done = useCallback(\n (id: string) => {\n initial.delete(id);\n leaveDone(id);\n },\n [initial, leaveDone],\n );\n\n return (\n <GroupContext.Provider value={group}>\n <div\n data-slot=\"swipe-actions\"\n className={cn(\n \"swipe-actions-surface rounded-panel border-(length:--border-width) border-border bg-surface font-sans text-foreground\",\n className,\n )}\n >\n <ul\n role=\"list\"\n aria-label={label}\n tabIndex={-1}\n className=\"m-0 -mb-px list-none p-0 outline-none\"\n >\n {list.map(({ item, leaving }) => (\n <Fragment key={item.id}>\n <RowStateContext.Provider\n value={{ id: item.id, leaving, fresh: ready && !initial.has(item.id), done }}\n >\n {item.node}\n </RowStateContext.Provider>\n </Fragment>\n ))}\n </ul>\n </div>\n </GroupContext.Provider>\n );\n}\n\nconst layerTone = {\n neutral: \"bg-secondary text-secondary-foreground\",\n primary: \"bg-primary text-primary-foreground\",\n destructive: \"bg-destructive text-destructive-foreground\",\n} as const;\n\nconst iconOf = (action: SwipeAction) => (\n <span\n aria-hidden=\"true\"\n data-swipe-icon=\"\"\n className=\"inline-flex w-4 text-text-secondary [&_svg]:size-4\"\n >\n {action.icon}\n </span>\n);\n\n/**\n * One row of a `SwipeActions` list. Drag it sideways to reveal its actions: they share the\n * revealed space, widen together past their resting width, and the outermost one stretches\n * over the whole row for a full swipe (a tick of haptics on touch devices). A flick opens,\n * commits or closes by its speed as well as its distance, and a row dragged past its last\n * stop pulls back against elastic.\n *\n * The row's More actions button opens a menu of the same actions: the way to use them\n * without a gesture.\n */\nexport function SwipeActionsRow({\n label,\n leading = [],\n trailing = [],\n fullSwipe = true,\n children,\n className,\n}: SwipeActionsRowProps) {\n const { openId, setOpenId, rows } = useContext(GroupContext);\n const state = useContext(RowStateContext);\n const leaving = state?.leaving ?? false;\n const id = useId();\n\n const rowRef = useRef<HTMLLIElement>(null);\n const contentRef = useRef<HTMLDivElement>(null);\n const parts = useRef(new Map<string, LayerParts>());\n // The row's position and the stretch of the covering action: script-driven values, never React state.\n const motion = useRef({ x: live(0), cover: live(0) });\n const covering = useRef<{ side: Side; index: number } | null>(null);\n const width = useRef(0);\n const drag = useRef<Drag | null>(null);\n const armed = useRef(false);\n const exiting = useRef(false);\n const swallowClick = useRef(false);\n const focusNeighbour = useRef(false);\n const restoreTimer = useRef(0);\n // Decided once, at this row's own mount: a row there at first render does not open in.\n const [arrives] = useState(state?.fresh ?? false);\n const latest = useRef({ leading, trailing, fullSwipe });\n useIsomorphicLayoutEffect(() => {\n latest.current = { leading, trailing, fullSwipe };\n });\n\n const actionsOf = (side: Side) => latest.current[side];\n const openWidth = (side: Side) => actionsOf(side).length * ACTION;\n const outermost = (side: Side) => (side === \"leading\" ? 0 : actionsOf(side).length - 1);\n const canCommit = (side: Side) => latest.current.fullSwipe && actionsOf(side).length > 0;\n const threshold = (side: Side) => Math.max(openWidth(side) + 48, width.current * 0.56);\n\n /** Writes the row and every revealed action from `x` and `cover`. Called every frame; no React render. */\n function paint() {\n const content = contentRef.current;\n if (!content) return;\n const value = motion.current.x.value;\n const progress = motion.current.cover.value;\n content.style.transform = value === 0 ? \"\" : `translate3d(${value}px, 0, 0)`;\n for (const side of [\"leading\", \"trailing\"] as const) {\n const direction = side === \"leading\" ? 1 : -1;\n const count = actionsOf(side).length;\n const covered = covering.current;\n for (let index = 0; index < count; index++) {\n const layer = parts.current.get(`${side}-${index}`);\n if (!layer) continue;\n const rank = side === \"leading\" ? count - 1 - index : index;\n const coverRank =\n covered?.side === side\n ? side === \"leading\"\n ? count - 1 - covered.index\n : covered.index\n : null;\n const revealed = Math.max(0, value * direction);\n const segment = revealed / count;\n // The distance from the row's outer edge to this layer's inner edge.\n const base = ((count - rank) * revealed) / count;\n const inset =\n coverRank === rank\n ? base + progress * (revealed - base)\n : coverRank !== null && rank > coverRank\n ? base * (1 - progress)\n : base;\n layer.layer.style.transform = `translate3d(${direction * inset}px, 0, 0)`;\n // The glyph rides the centre of its share, then hugs the content edge while this action covers the row.\n const glyph =\n coverRank === rank ? segment / 2 + progress * (ACTION / 2 - segment / 2) : segment / 2;\n if (layer.anchor)\n layer.anchor.style.transform = `translate3d(${-direction * glyph}px, 0, 0)`;\n const reveal = (own: number) =>\n coverRank === rank\n ? Math.max(own, progress)\n : coverRank === null\n ? own\n : own * (1 - progress);\n const icon = reveal(clamp01((segment - ACTION * 0.25) / (ACTION * 0.55)));\n const text = reveal(clamp01((segment - ACTION * 0.72) / (ACTION * 0.24)));\n if (layer.icon) {\n layer.icon.style.opacity = String(icon);\n layer.icon.style.scale = String(0.6 + 0.4 * icon);\n }\n if (layer.label) layer.label.style.opacity = String(text);\n }\n }\n }\n\n function stretchTo(value: number) {\n retarget(motion.current.cover, value, MORPH, paint);\n }\n\n /** Springs the row to a stop. Under reduced motion it snaps. */\n function settle(target: number) {\n if (armed.current || (target !== 0 && motion.current.cover.value !== 0)) stretchTo(0);\n armed.current = false;\n retarget(motion.current.x, target, target === 0 ? SMOOTH : SNAPPY, paint, 0, () => {\n if (target === 0) {\n motion.current.cover.stop();\n motion.current.cover.value = 0;\n paint();\n }\n });\n if (target === 0) setOpenId((current) => (current === id ? null : current));\n else setOpenId(id);\n }\n\n /** The chosen action stretches over the whole row while the row leaves in its direction; the list then closes the gap. */\n function commit(side: Side, index: number) {\n const action = actionsOf(side)[index];\n if (!action || exiting.current) return;\n const direction = side === \"leading\" ? 1 : -1;\n armed.current = false;\n covering.current = { side, index };\n stretchTo(1);\n if (action.keepRow) {\n action.onSelect();\n settle(0);\n return;\n }\n exiting.current = true;\n const row = rowRef.current;\n if (row) row.dataset.removing = \"\";\n retarget(motion.current.x, direction * (width.current + 2), SMOOTH, paint);\n setOpenId((current) => (current === id ? null : current));\n action.onSelect();\n // A list that keeps the item gets its row back instead of an empty band of colour.\n window.clearTimeout(restoreTimer.current);\n restoreTimer.current = window.setTimeout(comeBack, RESTORE_MS);\n }\n\n function comeBack() {\n if (!exiting.current) return;\n exiting.current = false;\n delete rowRef.current?.dataset.removing;\n settle(0);\n }\n\n function arm(value: number, pointerType: string) {\n const side = sideOf(value);\n const limit = side ? threshold(side) : Infinity;\n const next =\n !!side && canCommit(side) && Math.abs(value) > (armed.current ? limit - 20 : limit);\n if (next === armed.current || !side) {\n if (!side && armed.current) {\n armed.current = false;\n stretchTo(0);\n }\n return;\n }\n armed.current = next;\n if (next) {\n covering.current = { side, index: outermost(side) };\n if (pointerType === \"touch\") navigator.vibrate?.(8);\n }\n stretchTo(next ? 1 : 0);\n }\n\n function constrain(raw: number) {\n const side = sideOf(raw);\n if (!side) return 0;\n const dimension = width.current || 320;\n const limit = actionsOf(side).length === 0 ? 0 : canCommit(side) ? dimension : openWidth(side);\n const distance = Math.abs(raw);\n return (\n Math.sign(raw) *\n (distance <= limit ? distance : limit + rubberBand(distance - limit, dimension))\n );\n }\n\n function release(velocity: number) {\n const value = motion.current.x.value;\n const side = sideOf(value);\n if (!side || actionsOf(side).length === 0) {\n settle(0);\n return;\n }\n const direction = side === \"leading\" ? 1 : -1;\n const distance = Math.abs(value);\n const outward = velocity * direction;\n const open = openWidth(side);\n const projected = distance + outward * PROJECTION;\n const flung = distance > open && outward > FLICK && projected > threshold(side);\n // A flick back toward home cancels an armed full swipe.\n if (canCommit(side) && ((armed.current && outward > -FLICK) || flung)) {\n commit(side, outermost(side));\n return;\n }\n settle(projected > open / 2 ? direction * open : 0);\n }\n\n function onPointerDown(event: ReactPointerEvent<HTMLDivElement>) {\n swallowClick.current = false;\n // The More button is a button, not a handle.\n if ((event.target as HTMLElement).closest(\"[data-swipe-more]\")) return;\n if (\n exiting.current ||\n !event.isPrimary ||\n (event.pointerType === \"mouse\" && event.button !== 0)\n )\n return;\n // Catch the row mid-flight: the next move retargets from wherever it is now.\n motion.current.x.stop();\n drag.current = {\n pointer: event.pointerId,\n type: event.pointerType,\n startX: event.clientX,\n startY: event.clientY,\n origin: motion.current.x.value,\n locked: null,\n samples: [[event.timeStamp, event.clientX]],\n };\n }\n\n function onPointerMove(event: ReactPointerEvent<HTMLDivElement>) {\n const current = drag.current;\n if (!current || current.pointer !== event.pointerId || current.locked === \"y\") return;\n if (!current.locked) {\n const dx = event.clientX - current.startX;\n const dy = event.clientY - current.startY;\n if (Math.hypot(dx, dy) < SLOP) return;\n if (Math.abs(dy) > Math.abs(dx)) {\n current.locked = \"y\";\n return;\n }\n // Measure from here, so crossing the slop never jumps the row.\n current.locked = \"x\";\n current.startX = event.clientX;\n try {\n event.currentTarget.setPointerCapture(event.pointerId);\n } catch {\n // A pointer the browser is not tracking (a synthetic one) cannot be captured; the row follows it all the same.\n }\n if (rowRef.current) rowRef.current.dataset.dragging = \"\";\n setOpenId(id);\n }\n const value = constrain(current.origin + event.clientX - current.startX);\n motion.current.x.value = value;\n paint();\n current.samples.push([event.timeStamp, event.clientX]);\n if (current.samples.length > 12) current.samples.shift();\n arm(value, current.type);\n }\n\n function onPointerEnd(event: ReactPointerEvent<HTMLDivElement>) {\n const current = drag.current;\n if (!current || current.pointer !== event.pointerId) return;\n drag.current = null;\n if (current.locked === \"x\") {\n swallowClick.current = true;\n if (rowRef.current) delete rowRef.current.dataset.dragging;\n current.samples.push([event.timeStamp, event.clientX]);\n release(event.type === \"pointercancel\" ? 0 : velocityOf(current.samples));\n return;\n }\n // A tap on an open row closes it instead of acting on what is underneath.\n if (current.locked === null && Math.abs(motion.current.x.value) > 0.5) {\n swallowClick.current = true;\n settle(0);\n }\n }\n\n function onClickCapture(event: ReactMouseEvent<HTMLDivElement>) {\n if (!swallowClick.current) return;\n swallowClick.current = false;\n event.preventDefault();\n event.stopPropagation();\n }\n\n /** After an action removed this row, focus goes to the next row's menu button, so a keyboard user keeps their place. */\n function moveFocusToNeighbour() {\n const row = rowRef.current;\n if (!row) return;\n const staying = (step: \"nextElementSibling\" | \"previousElementSibling\") => {\n let node = row[step];\n while (\n node instanceof HTMLElement &&\n (\"removing\" in node.dataset || \"leaving\" in node.dataset)\n )\n node = node[step];\n return node;\n };\n const neighbour = staying(\"nextElementSibling\") ?? staying(\"previousElementSibling\");\n (neighbour?.querySelector<HTMLElement>(\"[data-swipe-more]\") ?? row.parentElement)?.focus({\n preventScroll: true,\n });\n }\n\n useEffect(() => {\n const row = rowRef.current;\n if (!row) return;\n const { x, cover } = motion.current;\n rows.set(id, row);\n width.current = row.offsetWidth;\n const observer = new ResizeObserver(([entry]) => {\n if (entry) width.current = entry.contentRect.width;\n });\n observer.observe(row);\n return () => {\n observer.disconnect();\n rows.delete(id);\n window.clearTimeout(restoreTimer.current);\n x.stop();\n cover.stop();\n setOpenId((current) => (current === id ? null : current));\n };\n }, [id, rows, setOpenId]);\n\n // Another row opened, or someone touched outside: put this one away.\n useEffect(() => {\n if (\n openId !== id &&\n !exiting.current &&\n drag.current?.locked !== \"x\" &&\n motion.current.x.value !== 0\n )\n settle(0);\n // eslint-disable-next-line react-hooks/exhaustive-deps -- settle reads refs and live values only\n }, [openId]);\n\n // The list took the row away: it collapses in place. A row that comes back while it was leaving slides home.\n const wasLeaving = useRef(false);\n const gone = useCallback(() => state?.done(state.id), [state]);\n useExitBackstop(leaving, gone, COLLAPSE_BACKSTOP);\n useIsomorphicLayoutEffect(() => {\n if (leaving) {\n window.clearTimeout(restoreTimer.current);\n wasLeaving.current = true;\n // Reduced motion removes it at once: a transition that is switched off never ends.\n if (prefersReducedMotion()) gone();\n } else if (wasLeaving.current) {\n wasLeaving.current = false;\n exiting.current = false;\n delete rowRef.current?.dataset.removing;\n settle(0);\n }\n }, [leaving, gone]);\n\n const menuItems = [\n ...leading.map((action, index) => ({ action, side: \"leading\" as const, index })),\n ...trailing.map((action, index) => ({ action, side: \"trailing\" as const, index })),\n ];\n\n return (\n <li\n ref={rowRef}\n data-slot=\"swipe-actions-row\"\n data-leaving={leaving || undefined}\n data-fresh={arrives || undefined}\n onTransitionEnd={(event) => {\n if (leaving && event.target === event.currentTarget && event.propertyName === \"height\")\n gone();\n }}\n className=\"swipe-actions-row\"\n style={{ \"--swipe-action-width\": `${ACTION}px` } as CSSProperties}\n >\n {([\"leading\", \"trailing\"] as const).map((side) =>\n (side === \"leading\" ? leading : trailing).map((action, index) => (\n <button\n key={`${side}-${index}`}\n type=\"button\"\n // The menu button is the accessible path, so the revealed copy stays out of the tab order and the accessibility tree.\n tabIndex={-1}\n aria-hidden=\"true\"\n data-slot=\"swipe-actions-action\"\n data-side={side}\n ref={(node) => {\n const key = `${side}-${index}`;\n if (!node) {\n parts.current.delete(key);\n return;\n }\n parts.current.set(key, {\n layer: node,\n anchor: node.querySelector(\"[data-part=anchor]\"),\n icon: node.querySelector(\"[data-part=icon]\"),\n label: node.querySelector(\"[data-part=label]\"),\n });\n }}\n onClick={() => commit(side, index)}\n style={{ zIndex: (side === \"leading\" ? leading.length - 1 - index : index) + 1 }}\n className={cnAll(\n \"swipe-actions-layer border-0 p-0 font-sans\",\n layerTone[action.tone ?? \"neutral\"],\n )}\n >\n <span data-part=\"anchor\" className=\"swipe-actions-anchor\">\n <span className=\"swipe-actions-glyph\">\n <span data-part=\"icon\" className=\"grid place-items-center opacity-0 [&_svg]:size-5\">\n {action.icon}\n </span>\n <span\n data-part=\"label\"\n className=\"text-xs leading-(--leading-normal) font-medium whitespace-nowrap opacity-0\"\n >\n {action.label}\n </span>\n </span>\n </span>\n </button>\n )),\n )}\n <div\n ref={contentRef}\n data-slot=\"swipe-actions-content\"\n onPointerDown={onPointerDown}\n onPointerMove={onPointerMove}\n onPointerUp={onPointerEnd}\n onPointerCancel={onPointerEnd}\n onClickCapture={onClickCapture}\n className={cn(\"swipe-actions-content bg-surface\", className)}\n >\n <div className=\"min-w-0 flex-1\">{children}</div>\n {menuItems.length > 0 ? (\n <MenuTrigger\n onOpenChange={(open) => {\n if (open || !focusNeighbour.current) return;\n focusNeighbour.current = false;\n // The menu hands focus back to its button as it closes; this row is leaving, so the neighbour gets it after.\n requestAnimationFrame(() => requestAnimationFrame(moveFocusToNeighbour));\n }}\n >\n <AriaButton\n data-swipe-more=\"\"\n aria-label={`More actions for ${label}`}\n className=\"grid size-8 flex-none cursor-pointer place-items-center rounded-full border-0 bg-transparent p-0 text-text-secondary outline-none motion-safe:transition-[background-color,color] motion-safe:duration-(--duration-quick) motion-safe:ease-settle data-[hovered]:bg-muted data-[hovered]:text-foreground data-[pressed]:bg-muted data-[pressed]:text-foreground data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width) data-[focus-visible]:outline-(--color-ring)\"\n >\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 24 24\"\n fill=\"currentColor\"\n className=\"pointer-events-none size-4.5\"\n >\n <circle cx=\"5\" cy=\"12\" r=\"1.75\" />\n <circle cx=\"12\" cy=\"12\" r=\"1.75\" />\n <circle cx=\"19\" cy=\"12\" r=\"1.75\" />\n </svg>\n </AriaButton>\n <Menu\n placement=\"bottom end\"\n offset={6}\n onAction={(key) => {\n const found = menuItems.find((item) => `${item.side}-${item.index}` === key);\n if (!found) return;\n focusNeighbour.current = !found.action.keepRow;\n commit(found.side, found.index);\n }}\n >\n {menuItems.map(({ action, side, index }) => (\n <MenuItem\n key={`${side}-${index}`}\n id={`${side}-${index}`}\n textValue={action.label}\n className={\n action.tone === \"destructive\"\n ? \"[&_[data-swipe-icon]]:text-destructive-strong\"\n : undefined\n }\n >\n {iconOf(action)}\n {action.label}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n ) : null}\n </div>\n </li>\n );\n}\n"],"mappings":";;;;;;;;;;;AAkGA,MAAM,SAAS;;AAEf,MAAM,OAAO;;AAEb,MAAM,aAAa;;AAEnB,MAAM,QAAQ;;AAEd,MAAM,oBAAoB;;AAE1B,MAAM,aAAa;AAEnB,MAAM,WAAW,UAAkB,KAAK,IAAI,GAAG,KAAK,IAAI,GAAG,KAAK,CAAC;;AAEjE,MAAM,cAAc,WAAmB,eACpC,IAAI,KAAM,YAAY,MAAQ,YAAY,MAAM;AACnD,MAAM,UAAU,UACd,QAAQ,IAAI,YAAY,QAAQ,IAAI,aAAa;AAEnD,MAAM,eAAe,cAAqB;CAAE,QAAQ;CAAM,iBAAiB,CAAC;CAAG,sBAAM,IAAI,IAAI;AAAE,CAAC;AAChG,MAAM,kBAAkB,cAA+B,IAAI;AAE3D,SAAS,WAAW,SAA6B;CAC/C,MAAM,OAAO,QAAQ,QAAQ,SAAS;CACtC,IAAI,CAAC,MAAM,OAAO;CAClB,MAAM,QAAQ,QAAQ,MAAM,WAAW,KAAK,KAAK,OAAO,MAAM,EAAE,KAAK;CACrE,MAAM,WAAW,KAAK,KAAK,MAAM,MAAM;CACvC,OAAO,UAAU,KAAK,KAA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,UAAD;QAAQ,IAAG;QAAK,IAAG;QAAK,GAAE;OAAQ,CAAA;OAClC,oBAAC,UAAD;QAAQ,IAAG;QAAK,IAAG;QAAK,GAAE;OAAQ,CAAA;MAC/B;;IACK,CAAA,GACZ,oBAACC,QAAD;KACE,WAAU;KACV,QAAQ;KACR,WAAW,QAAQ;MACjB,MAAM,QAAQ,UAAU,MAAM,SAAS,GAAG,KAAK,KAAK,GAAG,KAAK,YAAY,GAAG;MAC3E,IAAI,CAAC,OAAO;MACZ,eAAe,UAAU,CAAC,MAAM,OAAO;MACvC,OAAO,MAAM,MAAM,MAAM,KAAK;KAChC;KAEC,UAAA,UAAU,KAAK,EAAE,QAAQ,MAAM,YAC9B,qBAACC,YAAD;MAEE,IAAI,GAAG,KAAK,GAAG;MACf,WAAW,OAAO;MAClB,WACE,OAAO,SAAS,gBACZ,kDACA,KAAA;MAPR,UAAA,CAUG,OAAO,MAAM,GACb,OAAO,KACA;KAXH,GAAA,GAAG,KAAK,GAAG,OAWR,CACX;IACG,CAAA,CACK;GACX,CAAA,IAAA,IACD;EACH,CAAA,CAAA;;AAER"}
@@ -31,12 +31,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
31
31
  const switchTrackVariants = cva([
32
32
  "relative inline-flex h-5 w-9 shrink-0 items-center",
33
33
  "rounded-full box-border p-0.5",
34
- "bg-border",
34
+ "bg-control-edge",
35
35
  "motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard",
36
36
  "group-data-[selected]:bg-primary-strong",
37
37
  selectionRingVariants()
38
38
  ]);
39
- const switchThumbVariants = cva(["block h-4 rounded-full bg-background shadow-surface", "switch-thumb"]);
39
+ const switchThumbVariants = cva(["block h-4 rounded-full bg-surface shadow-surface", "switch-thumb"]);
40
40
  const Switch$1 = forwardRef(function Switch$2({ className, children, onChange, ...props }, ref) {
41
41
  const [changed, setChanged] = useState(false);
42
42
  return /* @__PURE__ */ jsxs(Switch, {
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","names":["Switch","AriaSwitch"],"sources":["../../src/switch/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef, useState, type ReactNode } from \"react\";\nimport { Switch as AriaSwitch, type SwitchProps as AriaSwitchProps } from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { selectionLabelVariants, selectionRingVariants } from \"../lib/selection-control.js\";\n\n/**\n * Switch, ported from the legacy shadcn/Radix component onto React Aria.\n *\n * Census: 7 files, 16 uses. `checked` 16, `onCheckedChange` 16, `id` 9,\n * `disabled` 7, `className` 4, `aria-label` 3.\n *\n * WORTH RAISING: only 3 of the 16 pass `aria-label` and 9 pass `id`. A\n * Radix Switch renders a bare `<button role=\"switch\">` with no text, so any\n * use with neither has no accessible name at all. Here the label is\n * `children`, so the common case names itself.\n *\n * THE COLOURS ARE NOT THE LEGACY'S, AND COULD NOT BE. The naive design --\n * a white thumb on a `--color-primary` track -- is 2.44:1, and a white\n * thumb on `--color-muted` is 1.13:1. Both fail WCAG 1.4.11, which is the\n * criterion that applies to the parts of a graphic you need to see to read\n * its state. So the track is `border` unchecked and `primary-strong`\n * checked, which puts every pair over 3:1 in both themes (5.25 / 5.20\n * light, 3.73 / 9.65 dark) and needs no border on the thumb.\n *\n * Position still carries the state as well as colour: the thumb moves.\n * That is the non-colour cue WCAG 1.4.1 asks for.\n */\nexport const switchTrackVariants = cva([\n \"relative inline-flex h-5 w-9 shrink-0 items-center\",\n \"rounded-full box-border p-0.5\",\n \"bg-border\",\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n \"group-data-[selected]:bg-primary-strong\",\n selectionRingVariants(),\n]);\n\nexport const switchThumbVariants = cva([\n \"block h-4 rounded-full bg-background shadow-surface\",\n // The track is w-9 (36px) with p-0.5 (2px) each side and a 16px thumb, so\n // the travel is exactly 36 - 4 - 16 = 16px (1rem). Travel, the press\n // stretch and the RTL direction live in switch-thumb (styles.css).\n \"switch-thumb\",\n]);\n\n/**\n * A switch.\n *\n * @example\n * <Switch isSelected={on} onChange={setOn}>Email notifications</Switch>\n * <Switch aria-label=\"Mute\" isSelected={muted} onChange={setMuted} />\n */\nexport interface SwitchProps extends Omit<AriaSwitchProps, \"className\" | \"style\" | \"children\"> {\n /**\n * The label, and the control's accessible name.\n *\n * Omit it only for a genuinely label-less switch, and pass `aria-label`\n * instead. A Radix Switch with neither -- which the census suggests\n * exists -- has no accessible name at all.\n */\n children?: ReactNode;\n /** Extra classes for the label. Merged last, so they win conflicts. */\n className?: string;\n}\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { className, children, onChange, ...props },\n ref,\n) {\n // The thumb swells only for a change the user made: not at mount and not\n // when a controlled value arrives from elsewhere.\n const [changed, setChanged] = useState(false);\n return (\n <AriaSwitch\n {...props}\n // inputRef, not ref: AriaSwitch's own ref targets the label it\n // renders around a visually-hidden native input, and a label cannot\n // be focused -- ref.current.focus() would silently no-op. inputRef is\n // React Aria's own escape hatch to the real control.\n inputRef={ref}\n data-slot=\"switch\"\n data-changed={changed || undefined}\n onChange={(value) => {\n setChanged(true);\n onChange?.(value);\n }}\n className={cn(selectionLabelVariants(), className)}\n >\n {/*\n aria-hidden: the real input already carries the state. A decorative\n track announced as well would say everything twice.\n */}\n <span aria-hidden=\"true\" data-slot=\"switch-track\" className={switchTrackVariants()}>\n <span data-slot=\"switch-thumb\" className={switchThumbVariants()} />\n </span>\n {children == null ? null : <span data-slot=\"switch-label\">{children}</span>}\n </AriaSwitch>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,sBAAsB,IAAI;CACrC;CACA;CACA;CACA;CACA;CACA,sBAAsB;AACxB,CAAC;AAED,MAAa,sBAAsB,IAAI,CACrC,uDAIA,cACF,CAAC;AAsBD,MAAaA,WAAS,WAA0C,SAASA,SACvE,EAAE,WAAW,UAAU,UAAU,GAAG,SACpC,KACA;CAGA,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,OACE,qBAACC,QAAD;EACE,GAAI;EAKJ,UAAU;EACV,aAAU;EACV,gBAAc,WAAW,KAAA;EACzB,WAAW,UAAU;GACnB,WAAW,IAAI;GACf,WAAW,KAAK;EAClB;EACA,WAAW,GAAG,uBAAuB,GAAG,SAAS;EAbnD,UAAA,CAmBE,oBAAC,QAAD;GAAM,eAAY;GAAO,aAAU;GAAe,WAAW,oBAAoB;GAC/E,UAAA,oBAAC,QAAD;IAAM,aAAU;IAAe,WAAW,oBAAoB;GAAI,CAAA;EAC9D,CAAA,GACL,YAAY,OAAO,OAAO,oBAAC,QAAD;GAAM,aAAU;GAAgB;EAAe,CAAA,CAChE;;AAEhB,CAAC"}
1
+ {"version":3,"file":"switch.js","names":["Switch","AriaSwitch"],"sources":["../../src/switch/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef, useState, type ReactNode } from \"react\";\nimport { Switch as AriaSwitch, type SwitchProps as AriaSwitchProps } from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { selectionLabelVariants, selectionRingVariants } from \"../lib/selection-control.js\";\n\n/**\n * Switch, ported from the legacy shadcn/Radix component onto React Aria.\n *\n * Census: 7 files, 16 uses. `checked` 16, `onCheckedChange` 16, `id` 9,\n * `disabled` 7, `className` 4, `aria-label` 3.\n *\n * WORTH RAISING: only 3 of the 16 pass `aria-label` and 9 pass `id`. A\n * Radix Switch renders a bare `<button role=\"switch\">` with no text, so any\n * use with neither has no accessible name at all. Here the label is\n * `children`, so the common case names itself.\n *\n * THE COLOURS ARE NOT THE LEGACY'S, AND COULD NOT BE. The naive design --\n * a white thumb on a `--color-primary` track -- is 2.44:1, and a white\n * thumb on `--color-muted` is 1.13:1. Both fail WCAG 1.4.11, which is the\n * criterion that applies to the parts of a graphic you need to see to read\n * its state. So the track is `border` unchecked and `primary-strong`\n * checked, which puts every pair over 3:1 in both themes (5.25 / 5.20\n * light, 3.73 / 9.65 dark) and needs no border on the thumb.\n *\n * Position still carries the state as well as colour: the thumb moves.\n * That is the non-colour cue WCAG 1.4.1 asks for.\n */\nexport const switchTrackVariants = cva([\n \"relative inline-flex h-5 w-9 shrink-0 items-center\",\n \"rounded-full box-border p-0.5\",\n \"bg-control-edge\",\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n \"group-data-[selected]:bg-primary-strong\",\n selectionRingVariants(),\n]);\n\nexport const switchThumbVariants = cva([\n \"block h-4 rounded-full bg-surface shadow-surface\",\n // The track is w-9 (36px) with p-0.5 (2px) each side and a 16px thumb, so\n // the travel is exactly 36 - 4 - 16 = 16px (1rem). Travel, the press\n // stretch and the RTL direction live in switch-thumb (styles.css).\n \"switch-thumb\",\n]);\n\n/**\n * A switch.\n *\n * @example\n * <Switch isSelected={on} onChange={setOn}>Email notifications</Switch>\n * <Switch aria-label=\"Mute\" isSelected={muted} onChange={setMuted} />\n */\nexport interface SwitchProps extends Omit<AriaSwitchProps, \"className\" | \"style\" | \"children\"> {\n /**\n * The label, and the control's accessible name.\n *\n * Omit it only for a genuinely label-less switch, and pass `aria-label`\n * instead. A Radix Switch with neither -- which the census suggests\n * exists -- has no accessible name at all.\n */\n children?: ReactNode;\n /** Extra classes for the label. Merged last, so they win conflicts. */\n className?: string;\n}\n\nexport const Switch = forwardRef<HTMLInputElement, SwitchProps>(function Switch(\n { className, children, onChange, ...props },\n ref,\n) {\n // The thumb swells only for a change the user made: not at mount and not\n // when a controlled value arrives from elsewhere.\n const [changed, setChanged] = useState(false);\n return (\n <AriaSwitch\n {...props}\n // inputRef, not ref: AriaSwitch's own ref targets the label it\n // renders around a visually-hidden native input, and a label cannot\n // be focused -- ref.current.focus() would silently no-op. inputRef is\n // React Aria's own escape hatch to the real control.\n inputRef={ref}\n data-slot=\"switch\"\n data-changed={changed || undefined}\n onChange={(value) => {\n setChanged(true);\n onChange?.(value);\n }}\n className={cn(selectionLabelVariants(), className)}\n >\n {/*\n aria-hidden: the real input already carries the state. A decorative\n track announced as well would say everything twice.\n */}\n <span aria-hidden=\"true\" data-slot=\"switch-track\" className={switchTrackVariants()}>\n <span data-slot=\"switch-thumb\" className={switchThumbVariants()} />\n </span>\n {children == null ? null : <span data-slot=\"switch-label\">{children}</span>}\n </AriaSwitch>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAa,sBAAsB,IAAI;CACrC;CACA;CACA;CACA;CACA;CACA,sBAAsB;AACxB,CAAC;AAED,MAAa,sBAAsB,IAAI,CACrC,oDAIA,cACF,CAAC;AAsBD,MAAaA,WAAS,WAA0C,SAASA,SACvE,EAAE,WAAW,UAAU,UAAU,GAAG,SACpC,KACA;CAGA,MAAM,CAAC,SAAS,cAAc,SAAS,KAAK;CAC5C,OACE,qBAACC,QAAD;EACE,GAAI;EAKJ,UAAU;EACV,aAAU;EACV,gBAAc,WAAW,KAAA;EACzB,WAAW,UAAU;GACnB,WAAW,IAAI;GACf,WAAW,KAAK;EAClB;EACA,WAAW,GAAG,uBAAuB,GAAG,SAAS;EAbnD,UAAA,CAmBE,oBAAC,QAAD;GAAM,eAAY;GAAO,aAAU;GAAe,WAAW,oBAAoB;GAC/E,UAAA,oBAAC,QAAD;IAAM,aAAU;IAAe,WAAW,oBAAoB;GAAI,CAAA;EAC9D,CAAA,GACL,YAAY,OAAO,OAAO,oBAAC,QAAD;GAAM,aAAU;GAAgB;EAAe,CAAA,CAChE;;AAEhB,CAAC"}
@@ -1,2 +1,2 @@
1
- import { Column, RowKey, Table, TableProps, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableStickyCellVariants, tableVariants } from "./table.js";
2
- export { type Column, type RowKey, Table, type TableProps, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableStickyCellVariants, tableVariants };
1
+ import { Column, RowKey, Table, TableProps, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableEmptyVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableSelectionBarVariants, tableStickyCellVariants, tableVariants } from "./table.js";
2
+ export { type Column, type RowKey, Table, type TableProps, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableEmptyVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableSelectionBarVariants, tableStickyCellVariants, tableVariants };
@@ -1,2 +1,2 @@
1
- import { Table, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableStickyCellVariants, tableVariants } from "./table.js";
2
- export { Table, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableStickyCellVariants, tableVariants };
1
+ import { Table, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableEmptyVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableSelectionBarVariants, tableStickyCellVariants, tableVariants } from "./table.js";
2
+ export { Table, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableEmptyVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableSelectionBarVariants, tableStickyCellVariants, tableVariants };
@@ -1,6 +1,6 @@
1
1
  import { VariantProps } from "class-variance-authority";
2
2
  import { ReactElement, ReactNode, RefAttributes } from "react";
3
- import { SortDescriptor } from "react-aria-components";
3
+ import { Selection, SortDescriptor } from "react-aria-components";
4
4
  //#region src/table/table.d.ts
5
5
  /**
6
6
  * Table, ported from the legacy shadcn table onto React Aria's Table.
@@ -85,10 +85,20 @@ export declare const tableHeaderVariants: (props?: ({
85
85
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
86
86
  /** The pagination bar. A sibling of the table, never a row inside it. */
87
87
  export declare const tablePaginationVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
88
+ /**
89
+ * The bar under a selectable table: how many rows, or how many are selected,
90
+ * and the action that clears them. A sibling of the table, like the pagination.
91
+ */
92
+ export declare const tableSelectionBarVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
93
+ /**
94
+ * What stands in for the rows when there are none: centred, muted, and tall
95
+ * enough to read as a state rather than as a squashed row.
96
+ */
97
+ export declare const tableEmptyVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
88
98
  /** The footer band. Heavier than a row rule, because it closes the table. */
89
99
  export declare const tableFooterVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
90
100
  export declare const tableColumnVariants: (props?: ({
91
- align?: "start" | "end" | "center" | null | undefined;
101
+ align?: "center" | "start" | "end" | null | undefined;
92
102
  headerType?: "sentence" | "caps" | null | undefined;
93
103
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
94
104
  export declare const tableRowVariants: (props?: ({
@@ -96,7 +106,7 @@ export declare const tableRowVariants: (props?: ({
96
106
  striped?: boolean | null | undefined;
97
107
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
98
108
  export declare const tableCellVariants: (props?: ({
99
- align?: "start" | "end" | "center" | null | undefined;
109
+ align?: "center" | "start" | "end" | null | undefined;
100
110
  numeric?: boolean | null | undefined;
101
111
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
102
112
  /**
@@ -288,6 +298,48 @@ export interface TableProps<T> extends VariantProps<typeof tableRowVariants> {
288
298
  /** Accessible name for the rows-per-page select itself. */
289
299
  rowsPerPage?: string;
290
300
  };
301
+ /**
302
+ * Row selection. `multiple` adds a checkbox column (the library's Checkbox,
303
+ * on React Aria's table selection) with a select-all box in the header that
304
+ * shows a dash while only some rows are chosen, and a bar under the table
305
+ * that counts the rows and clears the choice. Clicking a row's checkbox, or
306
+ * the row itself, toggles it; Escape clears. `none` (the default) adds
307
+ * nothing.
308
+ */
309
+ selectionMode?: "none" | "multiple";
310
+ /**
311
+ * The chosen rows, CONTROLLED: a set of `getRowId` values, or `"all"`.
312
+ * Pass this and the table stops keeping the selection itself.
313
+ */
314
+ selectedKeys?: Selection;
315
+ /** The rows chosen at the start, when uncontrolled. */
316
+ defaultSelectedKeys?: Selection;
317
+ /** Fires with the new selection (a set of ids, or `"all"`), controlled or not. */
318
+ onSelectionChange?: (keys: Selection) => void;
319
+ /**
320
+ * Copy for the selection controls, with English defaults for the same reason
321
+ * as `pageLabels`: a `useMessages()` mechanism does not exist in this package
322
+ * yet.
323
+ */
324
+ selectionLabels?: {
325
+ /** Accessible name of the header checkbox. React Aria's own, localized ("Select All"), when omitted. */
326
+ selectAll?: string;
327
+ /**
328
+ * The word before a row's name in its checkbox's accessible name. React
329
+ * Aria appends the text of the row's first column itself, so "Select"
330
+ * becomes "Select Meta"; its own localized word is used when omitted.
331
+ */
332
+ selectRow?: string;
333
+ /** What a row is called in the count: "1 row", "5 rows". */
334
+ item?: {
335
+ one: string;
336
+ other: string;
337
+ };
338
+ /** The word after the count while some rows are chosen: "3 selected". */
339
+ selected?: string;
340
+ /** The clear button's text. */
341
+ clear?: string;
342
+ };
291
343
  /**
292
344
  * Whether the table draws its own card. `none` for one that already sits
293
345
  * inside a card, or is meant to be bare on the page.