@seekalfred/primitives 0.5.1 → 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 (446) hide show
  1. package/README.md +682 -19
  2. package/dist/accordion/accordion.js +10 -4
  3. package/dist/accordion/accordion.js.map +1 -1
  4. package/dist/action-button/action-button.d.ts +50 -0
  5. package/dist/action-button/action-button.js +159 -0
  6. package/dist/action-button/action-button.js.map +1 -0
  7. package/dist/action-button/index.d.ts +2 -0
  8. package/dist/action-button/index.js +2 -0
  9. package/dist/activity-heatmap/activity-heatmap.d.ts +92 -0
  10. package/dist/activity-heatmap/activity-heatmap.js +699 -0
  11. package/dist/activity-heatmap/activity-heatmap.js.map +1 -0
  12. package/dist/activity-heatmap/index.d.ts +2 -0
  13. package/dist/activity-heatmap/index.js +2 -0
  14. package/dist/alert/alert.d.ts +19 -1
  15. package/dist/alert/alert.js +180 -23
  16. package/dist/alert/alert.js.map +1 -1
  17. package/dist/alert-dialog/alert-dialog.d.ts +45 -18
  18. package/dist/alert-dialog/alert-dialog.js +128 -9
  19. package/dist/alert-dialog/alert-dialog.js.map +1 -1
  20. package/dist/alert-dialog/index.d.ts +2 -2
  21. package/dist/alert-dialog/index.js +2 -2
  22. package/dist/animated-counter/animated-counter.d.ts +38 -0
  23. package/dist/animated-counter/animated-counter.js +230 -0
  24. package/dist/animated-counter/animated-counter.js.map +1 -0
  25. package/dist/animated-counter/index.d.ts +2 -0
  26. package/dist/animated-counter/index.js +2 -0
  27. package/dist/announcement-bar/announcement-bar.d.ts +67 -0
  28. package/dist/announcement-bar/announcement-bar.js +364 -0
  29. package/dist/announcement-bar/announcement-bar.js.map +1 -0
  30. package/dist/announcement-bar/index.d.ts +2 -0
  31. package/dist/announcement-bar/index.js +2 -0
  32. package/dist/avatar/avatar.d.ts +6 -0
  33. package/dist/avatar/avatar.js +47 -16
  34. package/dist/avatar/avatar.js.map +1 -1
  35. package/dist/badge/badge.d.ts +10 -3
  36. package/dist/badge/badge.js +35 -5
  37. package/dist/badge/badge.js.map +1 -1
  38. package/dist/bar-chart/bar-chart.d.ts +51 -0
  39. package/dist/bar-chart/bar-chart.js +565 -0
  40. package/dist/bar-chart/bar-chart.js.map +1 -0
  41. package/dist/bar-chart/index.d.ts +2 -0
  42. package/dist/bar-chart/index.js +2 -0
  43. package/dist/breadcrumb/breadcrumb.d.ts +2 -29
  44. package/dist/breadcrumb/breadcrumb.js +32 -9
  45. package/dist/breadcrumb/breadcrumb.js.map +1 -1
  46. package/dist/brush-chart/brush-chart.d.ts +64 -0
  47. package/dist/brush-chart/brush-chart.js +1056 -0
  48. package/dist/brush-chart/brush-chart.js.map +1 -0
  49. package/dist/brush-chart/index.d.ts +2 -0
  50. package/dist/brush-chart/index.js +2 -0
  51. package/dist/button/button.d.ts +36 -23
  52. package/dist/button/button.js +198 -45
  53. package/dist/button/button.js.map +1 -1
  54. package/dist/button-group/button-group.d.ts +76 -0
  55. package/dist/button-group/button-group.js +402 -0
  56. package/dist/button-group/button-group.js.map +1 -0
  57. package/dist/button-group/index.d.ts +2 -0
  58. package/dist/button-group/index.js +2 -0
  59. package/dist/calendar/calendar.d.ts +1 -1
  60. package/dist/calendar/calendar.js +257 -30
  61. package/dist/calendar/calendar.js.map +1 -1
  62. package/dist/card/card.d.ts +9 -2
  63. package/dist/card/card.js +16 -5
  64. package/dist/card/card.js.map +1 -1
  65. package/dist/card-stack/card-stack.d.ts +54 -0
  66. package/dist/card-stack/card-stack.js +492 -0
  67. package/dist/card-stack/card-stack.js.map +1 -0
  68. package/dist/card-stack/index.d.ts +2 -0
  69. package/dist/card-stack/index.js +2 -0
  70. package/dist/carousel/carousel.d.ts +56 -0
  71. package/dist/carousel/carousel.js +389 -0
  72. package/dist/carousel/carousel.js.map +1 -0
  73. package/dist/carousel/index.d.ts +2 -0
  74. package/dist/carousel/index.js +2 -0
  75. package/dist/checkbox/checkbox.d.ts +0 -7
  76. package/dist/checkbox/checkbox.js +26 -29
  77. package/dist/checkbox/checkbox.js.map +1 -1
  78. package/dist/chip-group/chip-group.d.ts +37 -0
  79. package/dist/chip-group/chip-group.js +148 -0
  80. package/dist/chip-group/chip-group.js.map +1 -0
  81. package/dist/chip-group/index.d.ts +2 -0
  82. package/dist/chip-group/index.js +2 -0
  83. package/dist/confirm-morph/confirm-morph.d.ts +85 -0
  84. package/dist/confirm-morph/confirm-morph.js +652 -0
  85. package/dist/confirm-morph/confirm-morph.js.map +1 -0
  86. package/dist/confirm-morph/index.d.ts +2 -0
  87. package/dist/confirm-morph/index.js +2 -0
  88. package/dist/copy-button/copy-button.d.ts +32 -0
  89. package/dist/copy-button/copy-button.js +134 -0
  90. package/dist/copy-button/copy-button.js.map +1 -0
  91. package/dist/copy-button/index.d.ts +2 -0
  92. package/dist/copy-button/index.js +2 -0
  93. package/dist/countdown/countdown.d.ts +45 -0
  94. package/dist/countdown/countdown.js +298 -0
  95. package/dist/countdown/countdown.js.map +1 -0
  96. package/dist/countdown/index.d.ts +2 -0
  97. package/dist/countdown/index.js +2 -0
  98. package/dist/date-picker/date-picker.d.ts +51 -0
  99. package/dist/date-picker/date-picker.js +241 -0
  100. package/dist/date-picker/date-picker.js.map +1 -0
  101. package/dist/date-picker/date-range-picker.d.ts +78 -0
  102. package/dist/date-picker/date-range-picker.js +1015 -0
  103. package/dist/date-picker/date-range-picker.js.map +1 -0
  104. package/dist/date-picker/index.d.ts +4 -0
  105. package/dist/date-picker/index.js +4 -0
  106. package/dist/date-picker/picker-parts.d.ts +46 -0
  107. package/dist/date-picker/picker-parts.js +135 -0
  108. package/dist/date-picker/picker-parts.js.map +1 -0
  109. package/dist/dialog/dialog.d.ts +10 -14
  110. package/dist/dialog/dialog.js +40 -12
  111. package/dist/dialog/dialog.js.map +1 -1
  112. package/dist/donut-chart/donut-chart.d.ts +64 -0
  113. package/dist/donut-chart/donut-chart.js +576 -0
  114. package/dist/donut-chart/donut-chart.js.map +1 -0
  115. package/dist/donut-chart/index.d.ts +2 -0
  116. package/dist/donut-chart/index.js +2 -0
  117. package/dist/empty-state/empty-state.d.ts +55 -0
  118. package/dist/empty-state/empty-state.js +89 -0
  119. package/dist/empty-state/empty-state.js.map +1 -0
  120. package/dist/empty-state/index.d.ts +2 -0
  121. package/dist/empty-state/index.js +2 -0
  122. package/dist/expanding-button-group/expanding-button-group.d.ts +54 -0
  123. package/dist/expanding-button-group/expanding-button-group.js +350 -0
  124. package/dist/expanding-button-group/expanding-button-group.js.map +1 -0
  125. package/dist/expanding-button-group/index.d.ts +2 -0
  126. package/dist/expanding-button-group/index.js +2 -0
  127. package/dist/file-drop-zone/file-drop-zone.d.ts +71 -0
  128. package/dist/file-drop-zone/file-drop-zone.js +116 -0
  129. package/dist/file-drop-zone/file-drop-zone.js.map +1 -0
  130. package/dist/file-drop-zone/index.d.ts +2 -0
  131. package/dist/file-drop-zone/index.js +2 -0
  132. package/dist/filter-bar/filter-bar.d.ts +142 -0
  133. package/dist/filter-bar/filter-bar.js +416 -0
  134. package/dist/filter-bar/filter-bar.js.map +1 -0
  135. package/dist/filter-bar/index.d.ts +2 -0
  136. package/dist/filter-bar/index.js +2 -0
  137. package/dist/floating-button-group/floating-button-group.d.ts +61 -0
  138. package/dist/floating-button-group/floating-button-group.js +340 -0
  139. package/dist/floating-button-group/floating-button-group.js.map +1 -0
  140. package/dist/floating-button-group/index.d.ts +2 -0
  141. package/dist/floating-button-group/index.js +2 -0
  142. package/dist/gauge/gauge.d.ts +45 -0
  143. package/dist/gauge/gauge.js +219 -0
  144. package/dist/gauge/gauge.js.map +1 -0
  145. package/dist/gauge/index.d.ts +2 -0
  146. package/dist/gauge/index.js +2 -0
  147. package/dist/icon-morph/icon-morph.d.ts +55 -0
  148. package/dist/icon-morph/icon-morph.js +331 -0
  149. package/dist/icon-morph/icon-morph.js.map +1 -0
  150. package/dist/icon-morph/index.d.ts +2 -0
  151. package/dist/icon-morph/index.js +2 -0
  152. package/dist/in-view-title/in-view-title.d.ts +33 -0
  153. package/dist/in-view-title/in-view-title.js +119 -0
  154. package/dist/in-view-title/in-view-title.js.map +1 -0
  155. package/dist/in-view-title/index.d.ts +2 -0
  156. package/dist/in-view-title/index.js +2 -0
  157. package/dist/index.d.ts +71 -6
  158. package/dist/index.js +73 -11
  159. package/dist/input/input.d.ts +22 -0
  160. package/dist/input/input.js +36 -12
  161. package/dist/input/input.js.map +1 -1
  162. package/dist/lib/cn.js +11 -1
  163. package/dist/lib/cn.js.map +1 -1
  164. package/dist/lib/count-to.js +113 -0
  165. package/dist/lib/count-to.js.map +1 -0
  166. package/dist/lib/eye-morph.js +62 -0
  167. package/dist/lib/eye-morph.js.map +1 -0
  168. package/dist/lib/field-message.js +354 -0
  169. package/dist/lib/field-message.js.map +1 -0
  170. package/dist/lib/field-shell.js +81 -0
  171. package/dist/lib/field-shell.js.map +1 -0
  172. package/dist/lib/field-surface.js +11 -8
  173. package/dist/lib/field-surface.js.map +1 -1
  174. package/dist/lib/flag-emoji.js +50 -0
  175. package/dist/lib/flag-emoji.js.map +1 -0
  176. package/dist/lib/flip.js +88 -0
  177. package/dist/lib/flip.js.map +1 -0
  178. package/dist/lib/height-follow.js +59 -0
  179. package/dist/lib/height-follow.js.map +1 -0
  180. package/dist/lib/icon-swap.js +47 -0
  181. package/dist/lib/icon-swap.js.map +1 -0
  182. package/dist/lib/leaving-list.js +57 -0
  183. package/dist/lib/leaving-list.js.map +1 -0
  184. package/dist/lib/menu-highlight.js +64 -0
  185. package/dist/lib/menu-highlight.js.map +1 -0
  186. package/dist/lib/merge-refs.js +3 -3
  187. package/dist/lib/merge-refs.js.map +1 -1
  188. package/dist/lib/morph-text.js +128 -0
  189. package/dist/lib/morph-text.js.map +1 -0
  190. package/dist/lib/motion.js +169 -0
  191. package/dist/lib/motion.js.map +1 -0
  192. package/dist/lib/pausable-timeout.js +67 -0
  193. package/dist/lib/pausable-timeout.js.map +1 -0
  194. package/dist/lib/rolling-value.js +31 -0
  195. package/dist/lib/rolling-value.js.map +1 -0
  196. package/dist/lib/spring-progress.js +114 -0
  197. package/dist/lib/spring-progress.js.map +1 -0
  198. package/dist/lib/spring-tween.js +500 -0
  199. package/dist/lib/spring-tween.js.map +1 -0
  200. package/dist/lib/svg-id.js +10 -0
  201. package/dist/lib/svg-id.js.map +1 -0
  202. package/dist/lib/swap-text.js +79 -0
  203. package/dist/lib/swap-text.js.map +1 -0
  204. package/dist/lib/use-copy-feedback.js +36 -0
  205. package/dist/lib/use-copy-feedback.js.map +1 -0
  206. package/dist/line-chart/index.d.ts +2 -0
  207. package/dist/line-chart/index.js +2 -0
  208. package/dist/line-chart/line-chart.d.ts +76 -0
  209. package/dist/line-chart/line-chart.js +611 -0
  210. package/dist/line-chart/line-chart.js.map +1 -0
  211. package/dist/mention-input/index.d.ts +2 -0
  212. package/dist/mention-input/index.js +2 -0
  213. package/dist/mention-input/mention-input.d.ts +98 -0
  214. package/dist/mention-input/mention-input.js +576 -0
  215. package/dist/mention-input/mention-input.js.map +1 -0
  216. package/dist/menu/menu.d.ts +2 -0
  217. package/dist/menu/menu.js +23 -12
  218. package/dist/menu/menu.js.map +1 -1
  219. package/dist/money-input/index.d.ts +2 -0
  220. package/dist/money-input/index.js +2 -0
  221. package/dist/money-input/money-input.d.ts +65 -0
  222. package/dist/money-input/money-input.js +607 -0
  223. package/dist/money-input/money-input.js.map +1 -0
  224. package/dist/morph-select/index.d.ts +2 -0
  225. package/dist/morph-select/index.js +2 -0
  226. package/dist/morph-select/morph-select.d.ts +71 -0
  227. package/dist/morph-select/morph-select.js +693 -0
  228. package/dist/morph-select/morph-select.js.map +1 -0
  229. package/dist/multi-select/index.d.ts +2 -0
  230. package/dist/multi-select/index.js +2 -0
  231. package/dist/multi-select/multi-select.d.ts +36 -0
  232. package/dist/multi-select/multi-select.js +152 -0
  233. package/dist/multi-select/multi-select.js.map +1 -0
  234. package/dist/number-field/index.d.ts +2 -0
  235. package/dist/number-field/index.js +2 -0
  236. package/dist/number-field/number-field.d.ts +42 -0
  237. package/dist/number-field/number-field.js +199 -0
  238. package/dist/number-field/number-field.js.map +1 -0
  239. package/dist/onboarding-checklist/index.d.ts +2 -0
  240. package/dist/onboarding-checklist/index.js +2 -0
  241. package/dist/onboarding-checklist/onboarding-checklist.d.ts +55 -0
  242. package/dist/onboarding-checklist/onboarding-checklist.js +577 -0
  243. package/dist/onboarding-checklist/onboarding-checklist.js.map +1 -0
  244. package/dist/page-header/index.d.ts +2 -0
  245. package/dist/page-header/index.js +2 -0
  246. package/dist/page-header/page-header.d.ts +75 -0
  247. package/dist/page-header/page-header.js +83 -0
  248. package/dist/page-header/page-header.js.map +1 -0
  249. package/dist/password-field/index.d.ts +2 -0
  250. package/dist/password-field/index.js +2 -0
  251. package/dist/password-field/password-field.d.ts +37 -0
  252. package/dist/password-field/password-field.js +101 -0
  253. package/dist/password-field/password-field.js.map +1 -0
  254. package/dist/password-strength/index.d.ts +2 -0
  255. package/dist/password-strength/index.js +2 -0
  256. package/dist/password-strength/password-strength.d.ts +127 -0
  257. package/dist/password-strength/password-strength.js +455 -0
  258. package/dist/password-strength/password-strength.js.map +1 -0
  259. package/dist/phone-input/index.d.ts +3 -0
  260. package/dist/phone-input/index.js +3 -0
  261. package/dist/phone-input/phone-countries.d.ts +29 -0
  262. package/dist/phone-input/phone-countries.js +170 -0
  263. package/dist/phone-input/phone-countries.js.map +1 -0
  264. package/dist/phone-input/phone-input.d.ts +66 -0
  265. package/dist/phone-input/phone-input.js +440 -0
  266. package/dist/phone-input/phone-input.js.map +1 -0
  267. package/dist/popover/popover.d.ts +20 -0
  268. package/dist/popover/popover.js +33 -9
  269. package/dist/popover/popover.js.map +1 -1
  270. package/dist/progress/progress.js +46 -5
  271. package/dist/progress/progress.js.map +1 -1
  272. package/dist/radio-group/radio-group.js +8 -7
  273. package/dist/radio-group/radio-group.js.map +1 -1
  274. package/dist/reactions/index.d.ts +2 -0
  275. package/dist/reactions/index.js +2 -0
  276. package/dist/reactions/reactions.d.ts +50 -0
  277. package/dist/reactions/reactions.js +315 -0
  278. package/dist/reactions/reactions.js.map +1 -0
  279. package/dist/rich-text-editor/index.d.ts +3 -0
  280. package/dist/rich-text-editor/index.js +2 -0
  281. package/dist/rich-text-editor/rich-text-editor.d.ts +70 -0
  282. package/dist/rich-text-editor/rich-text-editor.js +909 -0
  283. package/dist/rich-text-editor/rich-text-editor.js.map +1 -0
  284. package/dist/rich-text-editor/rich-text-engine.d.ts +16 -0
  285. package/dist/rich-text-editor/rich-text-engine.js +366 -0
  286. package/dist/rich-text-editor/rich-text-engine.js.map +1 -0
  287. package/dist/rich-text-editor/rich-text-html.js +174 -0
  288. package/dist/rich-text-editor/rich-text-html.js.map +1 -0
  289. package/dist/rich-text-editor/rich-text-icons.js +43 -0
  290. package/dist/rich-text-editor/rich-text-icons.js.map +1 -0
  291. package/dist/ridgeline/index.d.ts +2 -0
  292. package/dist/ridgeline/index.js +2 -0
  293. package/dist/ridgeline/ridgeline.d.ts +55 -0
  294. package/dist/ridgeline/ridgeline.js +701 -0
  295. package/dist/ridgeline/ridgeline.js.map +1 -0
  296. package/dist/scroll-area/index.d.ts +2 -2
  297. package/dist/scroll-area/index.js +2 -2
  298. package/dist/scroll-area/scroll-area.d.ts +75 -28
  299. package/dist/scroll-area/scroll-area.js +212 -41
  300. package/dist/scroll-area/scroll-area.js.map +1 -1
  301. package/dist/scrub-input/evaluate.d.ts +14 -0
  302. package/dist/scrub-input/evaluate.js +72 -0
  303. package/dist/scrub-input/evaluate.js.map +1 -0
  304. package/dist/scrub-input/index.d.ts +3 -0
  305. package/dist/scrub-input/index.js +3 -0
  306. package/dist/scrub-input/scrub-input.d.ts +74 -0
  307. package/dist/scrub-input/scrub-input.js +486 -0
  308. package/dist/scrub-input/scrub-input.js.map +1 -0
  309. package/dist/search-field/index.d.ts +2 -0
  310. package/dist/search-field/index.js +2 -0
  311. package/dist/search-field/search-field.d.ts +27 -0
  312. package/dist/search-field/search-field.js +155 -0
  313. package/dist/search-field/search-field.js.map +1 -0
  314. package/dist/select/select.d.ts +3 -1
  315. package/dist/select/select.js +95 -25
  316. package/dist/select/select.js.map +1 -1
  317. package/dist/separator/separator.d.ts +1 -1
  318. package/dist/sheet/sheet.js +4 -2
  319. package/dist/sheet/sheet.js.map +1 -1
  320. package/dist/shortcut-recorder/index.d.ts +3 -0
  321. package/dist/shortcut-recorder/index.js +3 -0
  322. package/dist/shortcut-recorder/shortcut-model.d.ts +27 -0
  323. package/dist/shortcut-recorder/shortcut-model.js +206 -0
  324. package/dist/shortcut-recorder/shortcut-model.js.map +1 -0
  325. package/dist/shortcut-recorder/shortcut-recorder.d.ts +93 -0
  326. package/dist/shortcut-recorder/shortcut-recorder.js +489 -0
  327. package/dist/shortcut-recorder/shortcut-recorder.js.map +1 -0
  328. package/dist/side-nav/index.d.ts +2 -0
  329. package/dist/side-nav/index.js +2 -0
  330. package/dist/side-nav/side-nav.d.ts +72 -0
  331. package/dist/side-nav/side-nav.js +142 -0
  332. package/dist/side-nav/side-nav.js.map +1 -0
  333. package/dist/skeleton/skeleton.d.ts +8 -2
  334. package/dist/skeleton/skeleton.js +6 -2
  335. package/dist/skeleton/skeleton.js.map +1 -1
  336. package/dist/slider/index.d.ts +2 -2
  337. package/dist/slider/slider.d.ts +46 -14
  338. package/dist/slider/slider.js +188 -50
  339. package/dist/slider/slider.js.map +1 -1
  340. package/dist/slope-chart/index.d.ts +2 -0
  341. package/dist/slope-chart/index.js +2 -0
  342. package/dist/slope-chart/slope-chart.d.ts +54 -0
  343. package/dist/slope-chart/slope-chart.js +568 -0
  344. package/dist/slope-chart/slope-chart.js.map +1 -0
  345. package/dist/sparkline/index.d.ts +2 -0
  346. package/dist/sparkline/index.js +2 -0
  347. package/dist/sparkline/sparkline.d.ts +46 -0
  348. package/dist/sparkline/sparkline.js +390 -0
  349. package/dist/sparkline/sparkline.js.map +1 -0
  350. package/dist/split-bar/index.d.ts +2 -0
  351. package/dist/split-bar/index.js +2 -0
  352. package/dist/split-bar/split-bar.d.ts +62 -0
  353. package/dist/split-bar/split-bar.js +513 -0
  354. package/dist/split-bar/split-bar.js.map +1 -0
  355. package/dist/split-button/index.d.ts +2 -0
  356. package/dist/split-button/index.js +2 -0
  357. package/dist/split-button/split-button.d.ts +46 -0
  358. package/dist/split-button/split-button.js +123 -0
  359. package/dist/split-button/split-button.js.map +1 -0
  360. package/dist/stat-card/index.d.ts +2 -0
  361. package/dist/stat-card/index.js +2 -0
  362. package/dist/stat-card/stat-card.d.ts +101 -0
  363. package/dist/stat-card/stat-card.js +249 -0
  364. package/dist/stat-card/stat-card.js.map +1 -0
  365. package/dist/stepper/index.d.ts +2 -0
  366. package/dist/stepper/index.js +2 -0
  367. package/dist/stepper/stepper.d.ts +51 -0
  368. package/dist/stepper/stepper.js +215 -0
  369. package/dist/stepper/stepper.js.map +1 -0
  370. package/dist/streamgraph/index.d.ts +2 -0
  371. package/dist/streamgraph/index.js +2 -0
  372. package/dist/streamgraph/streamgraph.d.ts +70 -0
  373. package/dist/streamgraph/streamgraph.js +613 -0
  374. package/dist/streamgraph/streamgraph.js.map +1 -0
  375. package/dist/styles.css +1 -1
  376. package/dist/swipe-actions/index.d.ts +2 -0
  377. package/dist/swipe-actions/index.js +2 -0
  378. package/dist/swipe-actions/swipe-actions.d.ts +67 -0
  379. package/dist/swipe-actions/swipe-actions.js +552 -0
  380. package/dist/swipe-actions/swipe-actions.js.map +1 -0
  381. package/dist/switch/switch.js +10 -9
  382. package/dist/switch/switch.js.map +1 -1
  383. package/dist/table/index.d.ts +2 -2
  384. package/dist/table/index.js +2 -2
  385. package/dist/table/table.d.ts +87 -4
  386. package/dist/table/table.js +441 -165
  387. package/dist/table/table.js.map +1 -1
  388. package/dist/tabs/tabs.js +143 -7
  389. package/dist/tabs/tabs.js.map +1 -1
  390. package/dist/tag-input/index.d.ts +2 -0
  391. package/dist/tag-input/index.js +2 -0
  392. package/dist/tag-input/tag-input.d.ts +40 -0
  393. package/dist/tag-input/tag-input.js +269 -0
  394. package/dist/tag-input/tag-input.js.map +1 -0
  395. package/dist/text-morph/index.d.ts +2 -0
  396. package/dist/text-morph/index.js +2 -0
  397. package/dist/text-morph/text-morph.d.ts +23 -0
  398. package/dist/text-morph/text-morph.js +21 -0
  399. package/dist/text-morph/text-morph.js.map +1 -0
  400. package/dist/text-reveal/index.d.ts +2 -0
  401. package/dist/text-reveal/index.js +2 -0
  402. package/dist/text-reveal/text-reveal.d.ts +27 -0
  403. package/dist/text-reveal/text-reveal.js +51 -0
  404. package/dist/text-reveal/text-reveal.js.map +1 -0
  405. package/dist/text-shimmer/index.d.ts +2 -0
  406. package/dist/text-shimmer/index.js +2 -0
  407. package/dist/text-shimmer/text-shimmer.d.ts +29 -0
  408. package/dist/text-shimmer/text-shimmer.js +29 -0
  409. package/dist/text-shimmer/text-shimmer.js.map +1 -0
  410. package/dist/textarea/textarea.d.ts +23 -0
  411. package/dist/textarea/textarea.js +24 -2
  412. package/dist/textarea/textarea.js.map +1 -1
  413. package/dist/theme-switch/index.d.ts +2 -0
  414. package/dist/theme-switch/index.js +2 -0
  415. package/dist/theme-switch/theme-switch.d.ts +37 -0
  416. package/dist/theme-switch/theme-switch.js +123 -0
  417. package/dist/theme-switch/theme-switch.js.map +1 -0
  418. package/dist/time-picker/index.d.ts +2 -0
  419. package/dist/time-picker/index.js +2 -0
  420. package/dist/time-picker/time-picker.d.ts +54 -0
  421. package/dist/time-picker/time-picker.js +201 -0
  422. package/dist/time-picker/time-picker.js.map +1 -0
  423. package/dist/toast/index.d.ts +2 -2
  424. package/dist/toast/index.js +2 -2
  425. package/dist/toast/toast.d.ts +6 -0
  426. package/dist/toast/toast.js +98 -36
  427. package/dist/toast/toast.js.map +1 -1
  428. package/dist/tooltip/tooltip.d.ts +10 -3
  429. package/dist/tooltip/tooltip.js +67 -18
  430. package/dist/tooltip/tooltip.js.map +1 -1
  431. package/dist/treemap/index.d.ts +2 -0
  432. package/dist/treemap/index.js +2 -0
  433. package/dist/treemap/treemap.d.ts +53 -0
  434. package/dist/treemap/treemap.js +699 -0
  435. package/dist/treemap/treemap.js.map +1 -0
  436. package/dist/usage-meter/index.d.ts +2 -0
  437. package/dist/usage-meter/index.js +2 -0
  438. package/dist/usage-meter/usage-meter.d.ts +50 -0
  439. package/dist/usage-meter/usage-meter.js +440 -0
  440. package/dist/usage-meter/usage-meter.js.map +1 -0
  441. package/dist/waffle-chart/index.d.ts +2 -0
  442. package/dist/waffle-chart/index.js +2 -0
  443. package/dist/waffle-chart/waffle-chart.d.ts +57 -0
  444. package/dist/waffle-chart/waffle-chart.js +426 -0
  445. package/dist/waffle-chart/waffle-chart.js.map +1 -0
  446. package/package.json +245 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"button-group.js","names":["AriaButton","Menu","MenuItem"],"sources":["../../src/button-group/button-group.tsx"],"sourcesContent":["\"use client\";\n\nimport {\n isValidElement,\n useCallback,\n useEffect,\n useRef,\n useState,\n type FocusEvent,\n type KeyboardEvent,\n type PointerEvent,\n type ReactNode,\n} from \"react\";\nimport { Button as AriaButton } from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport {\n useExitBackstop,\n useIsomorphicLayoutEffect,\n useLeavingItems,\n useMorphWidth,\n prefersReducedMotion,\n} from \"../lib/motion.js\";\nimport { Menu, MenuItem, MenuTrigger } from \"../menu/menu.js\";\n\nexport type ButtonGroupVariant = \"outline\" | \"solid\";\nexport type ButtonGroupSize = \"sm\" | \"md\";\nexport type ButtonGroupOrientation = \"horizontal\" | \"vertical\";\n\nexport interface ButtonGroupItem {\n /** Stable key for the segment. */\n id: string;\n /** Visible text and the accessible name. Changing it crossfades in place, so \"Share\" can answer \"Copied\". */\n label: string;\n /** Every other label this segment can show, such as [\"Copied\"]. The segment sizes to the widest, so a label change never resizes it. */\n reserve?: string[];\n /** An icon before the label. Swapping it for another morphs; re-rendering the same icon does not. Mark it `aria-hidden`. */\n icon?: ReactNode;\n /** Shows only the icon; the label becomes the accessible name and the tooltip. */\n iconOnly?: boolean;\n /** Visible content in place of the label, such as a live value. The label stays the accessible name. */\n content?: ReactNode;\n onSelect?: () => void;\n /** Renders the segment as a link. */\n href?: string;\n isDisabled?: boolean;\n}\n\nexport interface ButtonGroupMenuItem {\n id: string;\n label: string;\n /** An icon before the label. Mark it `aria-hidden`. */\n icon?: ReactNode;\n onSelect?: () => void;\n href?: string;\n isDisabled?: boolean;\n /** Colours the item as a destructive action. */\n destructive?: boolean;\n}\n\nexport interface ButtonGroupMenu {\n /** Accessible name and tooltip of the chevron segment, such as \"More actions\". */\n label: string;\n items: ButtonGroupMenuItem[];\n}\n\nexport interface ButtonGroupProps {\n items: ButtonGroupItem[];\n /** Adds a trailing chevron segment that opens these actions in a menu aligned to the group's edge. */\n menu?: ButtonGroupMenu;\n /** Accessible name of the group, such as \"Document actions\". */\n label: string;\n /** @default \"outline\" */\n variant?: ButtonGroupVariant;\n /** @default \"md\" */\n size?: ButtonGroupSize;\n /** @default \"horizontal\" */\n orientation?: ButtonGroupOrientation;\n /** When the row does not fit its container, segments with an icon drop their label and keep the icon. Horizontal only. @default true */\n collapseLabels?: boolean;\n /** Disables every segment and the menu. */\n isDisabled?: boolean;\n /** Extra classes. Merged last, so they win conflicts with ours. */\n className?: string;\n}\n\n/** Key of the chevron segment. Plain text, because the HTML parser rewrites control characters in server-rendered attributes. */\nconst MENU = \"button-group-menu\";\n\n/** Names the icon element, so swapping Link for Check morphs while a re-render of the same icon stays still. */\nfunction iconKey(node: ReactNode): string {\n if (!isValidElement(node))\n return typeof node === \"string\" || typeof node === \"number\" ? String(node) : \"\";\n const type = node.type as string | { displayName?: string; name?: string };\n return typeof type === \"string\" ? type : (type?.displayName ?? type?.name ?? \"icon\");\n}\n\nconst PHASE =\n \"col-start-1 row-start-1 inline-flex items-center gap-2 whitespace-nowrap group-data-[size=sm]/bg:gap-1.5\";\n\nfunction LeavingPhase({\n id,\n onDone,\n children,\n}: {\n id: number;\n onDone: (id: number) => void;\n children: ReactNode;\n}) {\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 className={cn(PHASE + \" motion-safe:animate-label-out motion-reduce:animate-fade-out\")}\n >\n {children}\n </span>\n );\n}\n\n/**\n * Icon and label of one segment. Every reserved label sits invisibly in the same\n * grid cell, so the segment is as wide as its widest state and a new label\n * crossfades inside a fixed box: it rises in from a soft blur while the old one\n * lifts away. A label nobody reserved still never snaps: the slot springs to its\n * width.\n */\nfunction SegmentContent({ item }: { item: ButtonGroupItem }) {\n const contentRef = useRef<HTMLSpanElement>(null);\n const phaseRef = useRef<HTMLSpanElement>(null);\n const glyph = iconKey(item.icon);\n const key =\n glyph + \"|\" + (item.content !== undefined ? \"\\u0000content\" : item.iconOnly ? \"\" : item.label);\n useMorphWidth(contentRef, key);\n\n const collapsible = item.icon ? \"group-data-[compact]/bg:hidden\" : \"\";\n const node = (\n <>\n {item.icon ? (\n <span className=\"inline-flex flex-none [&_svg]:size-(--icon-sm)\">{item.icon}</span>\n ) : null}\n {item.content !== undefined ? (\n <span className=\"inline-flex items-center tabular-nums\">{item.content}</span>\n ) : item.iconOnly ? null : (\n <span className={cn(\"inline-block \" + collapsible)}>{item.label}</span>\n )}\n </>\n );\n const { leaving, changed, remove } = useLeavingItems(key, node, () => phaseRef.current);\n const sizers =\n item.iconOnly || item.content !== undefined\n ? []\n : [...new Set([item.label, ...(item.reserve ?? [])])];\n\n return (\n <span\n className=\"button-slot [--morph-clip:inset(-50%_calc(var(--spacing)*-3))]\"\n aria-hidden=\"true\"\n >\n <span ref={contentRef} className=\"inline-grid flex-none items-center justify-items-center\">\n {sizers.map((text) => (\n <span key={text} className={cn(PHASE + \" pointer-events-none invisible\")}>\n {item.icon ? <span className=\"inline-block size-4 flex-none\" /> : null}\n <span className={cn(\"inline-block \" + collapsible)}>{text}</span>\n </span>\n ))}\n {leaving.map((entry) => (\n <LeavingPhase key={entry.id} id={entry.id} onDone={remove}>\n {entry.value}\n </LeavingPhase>\n ))}\n <span\n key={key}\n ref={phaseRef}\n className={cn(\n PHASE + (changed ? \" motion-safe:animate-label-in motion-reduce:animate-fade-in\" : \"\"),\n )}\n >\n {node}\n </span>\n </span>\n </span>\n );\n}\n\nconst inside = (node: HTMLElement, x: number, y: number) => {\n const rect = node.getBoundingClientRect();\n return x >= rect.left && x < rect.right && y >= rect.top && y < rect.bottom;\n};\n/** Segments are found by their data-key, so the group needs no ref per segment. */\nconst segmentsIn = (root: HTMLElement | null) =>\n Array.from(root?.querySelectorAll<HTMLElement>(\":scope > [data-key]\") ?? []);\nconst segmentIn = (root: HTMLElement | null, key: string | null) =>\n key === null ? undefined : segmentsIn(root).find((node) => node.dataset.key === key);\n/** The segment's box inside the group at sub-pixel precision, undoing any scale an ancestor applies. */\nfunction boxOf(group: HTMLElement, node: HTMLElement) {\n const outer = group.getBoundingClientRect();\n const inner = node.getBoundingClientRect();\n // offsetWidth is rounded to whole pixels, so only a real transform (more than a pixel apart) counts as scale.\n const scale =\n group.offsetWidth && Math.abs(outer.width - group.offsetWidth) > 1\n ? outer.width / group.offsetWidth\n : 1;\n return [\n (inner.left - outer.left) / scale - group.clientLeft + group.scrollLeft,\n (inner.top - outer.top) / scale - group.clientTop + group.scrollTop,\n inner.width / scale,\n inner.height / scale,\n ] as const;\n}\nconst inert = (node: HTMLElement) =>\n (node as HTMLButtonElement).disabled || node.getAttribute(\"aria-disabled\") === \"true\";\n\nconst TRAVEL =\n \"translate var(--duration-snappy) var(--ease-snappy), width var(--duration-snappy) var(--ease-snappy), height var(--duration-snappy) var(--ease-snappy), opacity var(--duration-quick) var(--ease-settle)\";\nconst FADE = \"opacity var(--duration-quick) var(--ease-settle)\";\nconst FADE_INSTANT = \"opacity var(--duration-instant) var(--ease-settle)\";\n\nconst focusRing =\n \"data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width) data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring) focus-visible:outline-solid focus-visible:outline-(length:--focus-ring-width) focus-visible:outline-offset-(--focus-ring-offset) focus-visible:outline-(--color-ring)\";\n\n/**\n * Related actions joined into one surface: a shared border and radius, hairline\n * dividers, no gaps. One soft highlight glides between segments under the\n * pointer or keyboard focus, the pressed segment answers in place, and an\n * optional chevron segment opens more actions in a menu aligned to the group's\n * edge.\n *\n * Tab visits every segment in order; the arrow keys along the orientation, Home\n * and End also move between them. A segment's label can change in place (\"Share\"\n * answers \"Copied\") without resizing it, and a label that changes right after its\n * segment is pressed is announced once.\n *\n * @example\n * <ButtonGroup label=\"Document actions\" items={[{ id: \"edit\", label: \"Edit\" }, { id: \"share\", label: \"Share\", reserve: [\"Copied\"] }]} />\n */\nexport function ButtonGroup({\n items,\n menu,\n label,\n variant = \"outline\",\n size = \"md\",\n orientation = \"horizontal\",\n collapseLabels = true,\n isDisabled = false,\n className,\n}: ButtonGroupProps) {\n const root = useRef<HTMLDivElement>(null);\n const highlight = useRef<HTMLSpanElement>(null);\n const vertical = orientation === \"vertical\";\n\n // The highlight sits on the pointer's segment, else the pressed one (touch), else the open menu's chevron, else keyboard focus.\n const [hover, setHover] = useState<string | null>(null);\n const [pressed, setPressed] = useState<string | null>(null);\n const [focused, setFocused] = useState<string | null>(null);\n const [menuOpen, setMenuOpen] = useState(false);\n const active = hover ?? pressed ?? (menuOpen ? MENU : null) ?? focused;\n const keys = [...items.map((item) => item.id), ...(menu ? [MENU] : [])];\n const activeIndex = active ? keys.indexOf(active) : -1;\n const inertKey = String(isDisabled) + items.map((item) => (item.isDisabled ? 1 : 0)).join(\"\");\n\n const shown = useRef<string | null>(null);\n\n useIsomorphicLayoutEffect(() => {\n const el = highlight.current;\n const group = root.current;\n if (!el || !group) return;\n const reduced = prefersReducedMotion();\n const node = segmentIn(group, active);\n // Hovering a disabled segment shows nothing; focus on one still shows where the keyboard is.\n if (!node || (inert(node) && active !== focused)) {\n if (shown.current) {\n el.style.transition = reduced ? FADE_INSTANT : FADE;\n el.style.opacity = \"0\";\n }\n shown.current = null;\n return;\n }\n const [x, y, width, height] = boxOf(group, node);\n // Arriving from nowhere, it appears in place; only moves between segments travel.\n const arriving = !shown.current || reduced;\n el.style.transition = arriving ? (reduced ? FADE_INSTANT : FADE) : TRAVEL;\n el.style.translate = x + \"px \" + y + \"px\";\n el.style.width = width + \"px\";\n el.style.height = height + \"px\";\n el.style.opacity = \"1\";\n shown.current = active;\n // inertKey re-checks a segment that turns disabled under a still pointer.\n }, [active, inertKey, focused]);\n\n // Segments resize when a label morphs or labels collapse; the highlight stays locked to its segment.\n const keyList = keys.join(\"\\u0000\");\n useEffect(() => {\n const group = root.current;\n const el = highlight.current;\n if (!group || !el || typeof ResizeObserver === \"undefined\") return;\n // Work is deferred a frame: a callback that changes layout inside the observer's own notification reports a loop error.\n let frame = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(() => {\n const node = segmentIn(group, shown.current);\n if (!node) return;\n const [x, y, width, height] = boxOf(group, node);\n el.style.transition = FADE;\n el.style.translate = x + \"px \" + y + \"px\";\n el.style.width = width + \"px\";\n el.style.height = height + \"px\";\n });\n });\n observer.observe(group);\n segmentsIn(group).forEach((node) => observer.observe(node));\n return () => {\n cancelAnimationFrame(frame);\n observer.disconnect();\n };\n }, [keyList]);\n\n // Labels collapse to icons when the row overflows, and come back once the container is wide enough for the full row again.\n const [overflowing, setCompact] = useState(false);\n const fullWidth = useRef(0);\n const blockedAt = useRef(0);\n const collapsible =\n collapseLabels &&\n !vertical &&\n items.some((item) => item.icon && !item.iconOnly && item.content === undefined);\n const compact = collapsible && overflowing;\n useEffect(() => {\n const group = root.current;\n const parent = group?.parentElement;\n if (!group || !parent || !collapsible || typeof ResizeObserver === \"undefined\") return;\n const check = () => {\n const box = getComputedStyle(parent);\n const available =\n parent.clientWidth - parseFloat(box.paddingLeft) - parseFloat(box.paddingRight);\n if (group.dataset.compact === undefined) {\n if (group.scrollWidth > group.clientWidth + 1) {\n fullWidth.current = group.scrollWidth + 2;\n blockedAt.current = available;\n setCompact(true);\n }\n } else if (available > blockedAt.current && available >= fullWidth.current) setCompact(false);\n };\n // Collapsing changes the layout being observed, so the check runs a frame later (see the highlight observer).\n let frame = 0;\n const observer = new ResizeObserver(() => {\n cancelAnimationFrame(frame);\n frame = requestAnimationFrame(check);\n });\n observer.observe(group);\n observer.observe(parent);\n return () => {\n cancelAnimationFrame(frame);\n observer.disconnect();\n };\n }, [collapsible, keyList]);\n\n // Pressing tracks the segment under the finger, so touch gets the same highlight a pointer gets on hover.\n useEffect(() => {\n if (!pressed) return;\n const release = () => setPressed(null);\n window.addEventListener(\"pointerup\", release);\n window.addEventListener(\"pointercancel\", release);\n return () => {\n window.removeEventListener(\"pointerup\", release);\n window.removeEventListener(\"pointercancel\", release);\n };\n }, [pressed]);\n\n const hit = (event: PointerEvent) => {\n for (const node of segmentsIn(root.current))\n if (inside(node, event.clientX, event.clientY))\n return inert(node) ? null : (node.dataset.key ?? null);\n return null;\n };\n const onPointerMove = (event: PointerEvent<HTMLDivElement>) => {\n if (event.pointerType !== \"touch\") setHover(hit(event));\n };\n const onPointerLeave = () => setHover(null);\n const onPointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button === 0) setPressed(hit(event));\n };\n\n // Keyboard focus shows the highlight; a mouse click focuses without it, so nothing stays lit after the pointer leaves.\n const onFocus = (event: FocusEvent<HTMLDivElement>) => {\n const target = event.target as HTMLElement;\n const key = target.dataset.key;\n if (key === undefined) return;\n let visible = true;\n try {\n visible = target.matches(\":focus-visible\");\n } catch {\n /* older engines */\n }\n setFocused(visible ? key : null);\n };\n const onBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (!root.current?.contains(event.relatedTarget)) setFocused(null);\n };\n\n // Tab visits every segment in order; arrow keys along the orientation, Home and End also move between them.\n const onKeyDown = (event: KeyboardEvent<HTMLDivElement>) => {\n if (event.defaultPrevented) return;\n // Disabled segments stay focusable (aria-disabled), so the keyboard can find them and hear why nothing happens.\n const list = segmentsIn(root.current).filter((node) => !(node as HTMLButtonElement).disabled);\n const index = list.findIndex((node) => node === document.activeElement);\n if (index < 0) return;\n const rtl = !vertical && getComputedStyle(root.current!).direction === \"rtl\";\n const forward = vertical ? \"ArrowDown\" : rtl ? \"ArrowLeft\" : \"ArrowRight\";\n const backward = vertical ? \"ArrowUp\" : rtl ? \"ArrowRight\" : \"ArrowLeft\";\n const last = list.length - 1;\n const target =\n event.key === forward\n ? index === last\n ? 0\n : index + 1\n : event.key === backward\n ? index === 0\n ? last\n : index - 1\n : event.key === \"Home\"\n ? 0\n : event.key === \"End\"\n ? last\n : -1;\n if (target < 0) return;\n event.preventDefault();\n list[target]!.focus();\n };\n\n // A label that changes right after its segment is pressed, such as \"Copied\", is announced once; the quiet revert is not.\n const [announcement, setAnnouncement] = useState(\"\");\n const labels = useRef<Map<string, string> | null>(null);\n const activated = useRef({ key: \"\", at: 0 });\n const labelList = items.map((item) => item.id + \"\\u0000\" + item.label).join(\"\\u0001\");\n useEffect(() => {\n const previous = labels.current;\n labels.current = new Map(items.map((item) => [item.id, item.label]));\n if (!previous) return;\n const recent = performance.now() - activated.current.at < 1000;\n const changed = items.filter(\n (item) =>\n recent &&\n item.id === activated.current.key &&\n previous.has(item.id) &&\n previous.get(item.id) !== item.label &&\n item.content === undefined,\n );\n\n if (changed.length) setAnnouncement(changed.map((item) => item.label).join(\", \"));\n // labelList carries the only part of items this effect reads.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [labelList]);\n\n const select = (item: ButtonGroupItem) => {\n activated.current = { key: item.id, at: performance.now() };\n item.onSelect?.();\n };\n const quiet = (index: number) =>\n activeIndex >= 0 && (index === activeIndex || index === activeIndex + 1) ? \"\" : undefined;\n\n const segments = items.map((item, index) => {\n const off = item.isDisabled && !isDisabled;\n const named = item.iconOnly || item.content !== undefined || (compact && !!item.icon);\n const common = {\n className: cn(\"button-group-segment \" + focusRing),\n \"data-key\": item.id,\n \"data-quiet\": quiet(index),\n \"data-icon-only\": item.iconOnly ? \"\" : undefined,\n \"data-collapsible\":\n item.icon && !item.iconOnly && item.content === undefined ? \"\" : undefined,\n \"aria-label\": named ? item.label : undefined,\n title: item.iconOnly || (compact && item.icon) ? item.label : undefined,\n };\n const body = (\n <span className=\"button-group-content\">\n <SegmentContent item={item} />\n </span>\n );\n const name = named ? null : <span className=\"sr-only\">{item.label}</span>;\n if (item.href && !off && !isDisabled)\n return (\n <a key={item.id} {...common} href={item.href} onClick={() => select(item)}>\n {body}\n {name}\n </a>\n );\n return (\n <button\n key={item.id}\n {...common}\n type=\"button\"\n disabled={isDisabled}\n aria-disabled={off || undefined}\n onClick={off ? undefined : () => select(item)}\n >\n {body}\n {name}\n </button>\n );\n });\n\n return (\n <div\n ref={root}\n role=\"group\"\n aria-label={label}\n aria-disabled={isDisabled || undefined}\n data-orientation={orientation}\n data-variant={variant}\n data-size={size}\n data-compact={compact ? \"\" : undefined}\n onPointerMove={onPointerMove}\n onPointerLeave={onPointerLeave}\n onPointerDown={onPointerDown}\n onFocus={onFocus}\n onBlur={onBlur}\n onKeyDown={onKeyDown}\n className={cn(\"button-group group/bg\", className)}\n >\n <span\n ref={highlight}\n aria-hidden=\"true\"\n data-pressed={pressed && pressed === active ? \"\" : undefined}\n className=\"button-group-highlight\"\n />\n {segments}\n {menu ? (\n <MenuTrigger onOpenChange={setMenuOpen}>\n <AriaButton\n data-key={MENU}\n data-trigger=\"\"\n data-quiet={quiet(items.length)}\n aria-label={menu.label}\n isDisabled={isDisabled}\n className={cn(\"button-group-segment group/trigger \" + focusRing)}\n >\n <span className=\"button-group-content\">\n <svg\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth={1.75}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n className=\"size-4 motion-safe:transition-[rotate] motion-safe:duration-(--duration-gentle) motion-safe:ease-gentle group-aria-expanded/trigger:rotate-180\"\n >\n <path d=\"m6 9 6 6 6-6\" />\n </svg>\n </span>\n </AriaButton>\n <Menu placement={vertical ? \"bottom start\" : \"bottom end\"} offset={6} shouldFocusWrap>\n {menu.items.map((action) => (\n <MenuItem\n key={action.id}\n id={action.id}\n textValue={action.label}\n href={action.href}\n isDisabled={action.isDisabled}\n onAction={action.onSelect}\n destructive={action.destructive}\n >\n {action.icon ? (\n <span\n aria-hidden=\"true\"\n className={action.destructive ? \"inline-flex\" : \"inline-flex text-text-secondary\"}\n >\n {action.icon}\n </span>\n ) : null}\n {action.label}\n </MenuItem>\n ))}\n </Menu>\n </MenuTrigger>\n ) : null}\n <span className=\"sr-only\" aria-live=\"polite\">\n {announcement}\n </span>\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAuFA,MAAM,OAAO;;AAGb,SAAS,QAAQ,MAAyB;CACxC,IAAI,CAAC,eAAe,IAAI,GACtB,OAAO,OAAO,SAAS,YAAY,OAAO,SAAS,WAAW,OAAO,IAAI,IAAI;CAC/E,MAAM,OAAO,KAAK;CAClB,OAAO,OAAO,SAAS,WAAW,OAAQ,MAAM,eAAe,MAAM,QAAQ;AAC/E;AAEA,MAAM,QACJ;AAEF,SAAS,aAAa,EACpB,IACA,QACA,YAKC;CACD,MAAM,SAAS,kBAAkB,OAAO,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC;CACzD,gBAAgB,MAAM,MAAM;CAC5B,OACE,oBAAC,QAAD;EACE,eAAY;EACZ,iBAAiB,UAAU;GACzB,IAAI,MAAM,WAAW,MAAM,eAAe,OAAO;EACnD;EACA,WAAW,GAAG,QAAQ,+DAA+D;EAEpF;CACG,CAAA;AAEV;;;;;;;;AASA,SAAS,eAAe,EAAE,QAAmC;CAC3D,MAAM,aAAa,OAAwB,IAAI;CAC/C,MAAM,WAAW,OAAwB,IAAI;CAE7C,MAAM,MADQ,QAAQ,KAAK,IAErB,IAAI,OAAO,KAAK,YAAY,KAAA,IAAY,cAAkB,KAAK,WAAW,KAAK,KAAK;CAC1F,cAA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GAAA,OAAO,EAiBJ,CACX;IACG,CAAA,CACK;GACX,CAAA,IAAA;GACJ,oBAAC,QAAD;IAAM,WAAU;IAAU,aAAU;IACjC,UAAA;GACG,CAAA;EACH;;AAET"}
@@ -0,0 +1,2 @@
1
+ import { ButtonGroup, ButtonGroupItem, ButtonGroupMenu, ButtonGroupMenuItem, ButtonGroupOrientation, ButtonGroupProps, ButtonGroupSize, ButtonGroupVariant } from "./button-group.js";
2
+ export { ButtonGroup, type ButtonGroupItem, type ButtonGroupMenu, type ButtonGroupMenuItem, type ButtonGroupOrientation, type ButtonGroupProps, type ButtonGroupSize, type ButtonGroupVariant };
@@ -0,0 +1,2 @@
1
+ import { ButtonGroup } from "./button-group.js";
2
+ export { ButtonGroup };
@@ -50,7 +50,7 @@ export declare const calendarClearVariants: (props?: import("class-variance-auth
50
50
  * is a strikethrough.
51
51
  */
52
52
  export declare const calendarCellVariants: (props?: ({
53
- selection?: "single" | "range" | null | undefined;
53
+ selection?: "single" | "range" | "band" | null | undefined;
54
54
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
55
55
  interface CalendarSharedProps {
56
56
  /**
@@ -1,9 +1,11 @@
1
1
  "use client";
2
2
  import { cn } from "../lib/cn.js";
3
+ import { useIsomorphicLayoutEffect } from "../lib/motion.js";
4
+ import { SwapText } from "../lib/swap-text.js";
3
5
  import { cva } from "class-variance-authority";
4
- import { forwardRef, useContext } from "react";
6
+ import { forwardRef, useContext, useRef, useState } from "react";
5
7
  import { Button, Calendar, CalendarCell, CalendarGrid, CalendarGridBody, CalendarGridHeader, CalendarHeaderCell, CalendarHeading, CalendarStateContext, RangeCalendar, RangeCalendarStateContext } from "react-aria-components";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
8
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
9
  //#region src/calendar/calendar.tsx
8
10
  /**
9
11
  * Calendar, built on React Aria's Calendar and RangeCalendar.
@@ -41,7 +43,7 @@ const calendarNavVariants = cva([
41
43
  "[&_svg]:pointer-events-none [&_svg]:shrink-0",
42
44
  "[&_svg:not([class*='size-'])]:size-(--icon-sm)",
43
45
  "[&_svg]:rtl:-scale-x-100",
44
- "motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard",
46
+ "calendar-nav-motion",
45
47
  "data-[hovered]:bg-muted data-[pressed]:bg-muted",
46
48
  "data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width)",
47
49
  "data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring)",
@@ -49,6 +51,8 @@ const calendarNavVariants = cva([
49
51
  ]);
50
52
  const calendarMonthsVariants = cva(["flex flex-col gap-(--density-gap) sm:flex-row sm:items-start"]);
51
53
  const calendarHeadingVariants = cva(["mb-1 text-center text-sm font-semibold text-foreground"]);
54
+ /** The month title of a one-month calendar, in the header beside the buttons. */
55
+ const calendarTitleVariants = cva(["min-w-0 flex-1 text-start text-sm font-semibold text-foreground tabular-nums whitespace-nowrap"]);
52
56
  const calendarGridVariants = cva(["border-collapse"]);
53
57
  const calendarHeaderCellVariants = cva(["w-(--density-control-h-sm) pb-1", "text-center text-2xs font-medium text-muted-foreground"]);
54
58
  const calendarClearVariants = cva([
@@ -79,8 +83,8 @@ const calendarCellVariants = cva([
79
83
  "size-(--density-control-h-sm) rounded-md",
80
84
  "text-sm leading-(--leading-normal) text-foreground",
81
85
  "cursor-pointer select-none outline-none",
82
- "motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard",
83
- "data-[hovered]:bg-muted",
86
+ "relative z-10 calendar-day",
87
+ "data-[hovered]:not-data-[selected]:bg-muted",
84
88
  "data-[today]:font-semibold data-[today]:underline data-[today]:underline-offset-4",
85
89
  "data-[outside-month]:text-muted-foreground data-[outside-month]:opacity-(--opacity-disabled)",
86
90
  "data-[unavailable]:cursor-not-allowed data-[unavailable]:text-muted-foreground",
@@ -96,13 +100,24 @@ const calendarCellVariants = cva([
96
100
  * exactly what OCP asks a variant to model.
97
101
  */
98
102
  selection: {
99
- single: ["data-[selected]:bg-primary data-[selected]:text-primary-foreground", "data-[selected]:font-semibold"],
103
+ single: ["data-[selected]:text-primary-foreground", "data-[selected]:font-semibold"],
100
104
  range: [
101
105
  "data-[selected]:rounded-none data-[selected]:bg-muted data-[selected]:text-foreground",
102
106
  "data-[selection-start]:rounded-s-md data-[selection-start]:bg-primary",
103
107
  "data-[selection-start]:font-semibold data-[selection-start]:text-primary-foreground",
104
108
  "data-[selection-end]:rounded-e-md data-[selection-end]:bg-primary",
105
109
  "data-[selection-end]:font-semibold data-[selection-end]:text-primary-foreground"
110
+ ],
111
+ /**
112
+ * The range picker's own look: the band and the ends are drawn beneath the
113
+ * cells by the picker, which slides and stretches them, so the cells paint
114
+ * only their text (and the shorter press, .9 in 120ms).
115
+ */
116
+ band: [
117
+ "[--press-scale:0.9] [--press-time:120ms]",
118
+ "data-[selected]:not-data-[selection-start]:not-data-[selection-end]:text-foreground",
119
+ "data-[selection-start]:font-medium data-[selection-start]:text-primary-foreground data-[selection-start]:[--number-delay:40ms]",
120
+ "data-[selection-end]:font-medium data-[selection-end]:text-primary-foreground data-[selection-end]:[--number-delay:40ms]"
106
121
  ]
107
122
  } },
108
123
  defaultVariants: { selection: "single" }
@@ -169,25 +184,245 @@ function ClearButton({ label }) {
169
184
  children: label
170
185
  });
171
186
  }
187
+ /** The month's rows, headers and cells: one grid for the month `offset` months from the first visible one. */
188
+ function MonthGrid({ offset, selection }) {
189
+ return /* @__PURE__ */ jsxs(CalendarGrid, {
190
+ offset: { months: offset },
191
+ className: calendarGridVariants(),
192
+ children: [/* @__PURE__ */ jsx(CalendarGridHeader, { children: (weekday) => /* @__PURE__ */ jsx(CalendarHeaderCell, {
193
+ className: calendarHeaderCellVariants(),
194
+ children: weekday
195
+ }) }), /* @__PURE__ */ jsx(CalendarGridBody, { children: (date) => /* @__PURE__ */ jsx(CalendarCell, {
196
+ date,
197
+ "data-slot": "calendar-cell",
198
+ className: calendarCellVariants({ selection })
199
+ }) })]
200
+ });
201
+ }
202
+ /** The first visible day, from whichever root we are under. */
203
+ function useVisibleStart() {
204
+ const single = useContext(CalendarStateContext);
205
+ const range = useContext(RangeCalendarStateContext);
206
+ return (single ?? range)?.visibleRange.start;
207
+ }
208
+ /**
209
+ * The month title. React Aria's own heading stays, visually hidden, as the text;
210
+ * the copy the eye sees crosses in place: the new month arrives from the side the
211
+ * strip travels to while the old one leaves toward the other. Nothing animates on
212
+ * first mount.
213
+ */
214
+ function MonthTitle() {
215
+ const start = useVisibleStart();
216
+ const headingRef = useRef(null);
217
+ const [text, setText] = useState("");
218
+ const [shown, setShown] = useState(start);
219
+ const [dir, setDir] = useState(1);
220
+ if (start && shown && start.compare(shown) !== 0) {
221
+ setShown(start);
222
+ setDir(start.compare(shown) > 0 ? 1 : -1);
223
+ }
224
+ useIsomorphicLayoutEffect(() => {
225
+ const next = headingRef.current?.textContent ?? "";
226
+ if (next !== text) setText(next);
227
+ });
228
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(CalendarHeading, {
229
+ ref: headingRef,
230
+ className: "sr-only"
231
+ }), /* @__PURE__ */ jsx("span", {
232
+ "aria-hidden": "true",
233
+ "data-slot": "calendar-title",
234
+ className: calendarTitleVariants(),
235
+ children: /* @__PURE__ */ jsx(SwapText, {
236
+ swapKey: text,
237
+ dir,
238
+ motion: "slide",
239
+ className: "block",
240
+ children: text
241
+ }, text === "" ? "boot" : "live")
242
+ })] });
243
+ }
244
+ /** A day cell's place in its month's grid, read from the table's structure: no layout is forced. */
245
+ function gridPlace(cell) {
246
+ const td = cell.closest("td");
247
+ const tr = td?.parentElement;
248
+ return td && tr ? {
249
+ col: td.cellIndex,
250
+ row: tr.sectionRowIndex
251
+ } : null;
252
+ }
253
+ /**
254
+ * Drives the selected disc of every month. The disc is one element under the day
255
+ * cells, placed from the selected cell's measured box, so it glides on a straight
256
+ * line between any two days, keeps its place while the strip slides, and only
257
+ * grows in or fades out when the selection enters or leaves a month. Each number
258
+ * flips colour as the disc actually passes it: the day it lands on waits longer on
259
+ * long hops, the day it leaves waits longer on short ones.
260
+ *
261
+ * It is one component, first in the tree, because order matters: the colour
262
+ * transitions start at the first style recalculation after a cell's state
263
+ * changes, and anything that measures the page (the title's swap does, on every
264
+ * commit) forces one. So every delay is set from the table's structure before any
265
+ * box is measured, and it runs before the header's effects do.
266
+ */
267
+ function DiscDriver() {
268
+ const marker = useRef(null);
269
+ const memory = useRef(/* @__PURE__ */ new WeakMap());
270
+ useContext(CalendarStateContext);
271
+ useIsomorphicLayoutEffect(() => {
272
+ const root = marker.current?.parentElement;
273
+ if (!root) return;
274
+ const work = [...root.querySelectorAll("[data-slot=\"calendar-month\"]")].flatMap((pane) => {
275
+ const el = pane.querySelector(":scope > [data-slot=\"calendar-disc\"]");
276
+ if (!el) return [];
277
+ return [{
278
+ pane,
279
+ el,
280
+ cell: pane.querySelector("[data-slot=\"calendar-cell\"][data-selected]")
281
+ }];
282
+ });
283
+ for (const { el, cell } of work) {
284
+ if (!cell) continue;
285
+ const place = gridPlace(cell);
286
+ const before = memory.current.get(el);
287
+ if (el.dataset.visible === void 0 || !before || before.cell === cell || !place) continue;
288
+ const distance = Math.hypot(place.col - before.col, place.row - before.row);
289
+ if (distance === 0) continue;
290
+ cell.style.setProperty("--number-delay", `${Math.round(Math.min(260, 95 + 85 * Math.log(distance)))}ms`);
291
+ if (before.cell.isConnected) before.cell.style.setProperty("--number-delay", `${Math.round(Math.max(20, 130 / distance))}ms`);
292
+ }
293
+ for (const { pane, el, cell } of work) {
294
+ if (!cell) {
295
+ delete el.dataset.visible;
296
+ memory.current.delete(el);
297
+ continue;
298
+ }
299
+ const box = cell.getBoundingClientRect();
300
+ const paneBox = pane.getBoundingClientRect();
301
+ const x = box.left - paneBox.left - (box.width - cell.offsetWidth) / 2;
302
+ const y = box.top - paneBox.top - (box.height - cell.offsetHeight) / 2;
303
+ el.style.width = `${cell.offsetWidth}px`;
304
+ el.style.height = `${cell.offsetHeight}px`;
305
+ if (el.dataset.visible === void 0) {
306
+ el.style.transition = "none";
307
+ el.style.translate = `${x}px ${y}px`;
308
+ el.offsetWidth;
309
+ el.style.transition = "";
310
+ el.dataset.visible = "";
311
+ } else el.style.translate = `${x}px ${y}px`;
312
+ const place = gridPlace(cell);
313
+ if (place) memory.current.set(el, {
314
+ cell,
315
+ ...place
316
+ });
317
+ }
318
+ });
319
+ return /* @__PURE__ */ jsx("span", {
320
+ ref: marker,
321
+ hidden: true,
322
+ "data-slot": "calendar-disc-driver"
323
+ });
324
+ }
325
+ /** The disc itself: an empty shell the driver places. */
326
+ function SelectionDisc() {
327
+ return /* @__PURE__ */ jsx("span", {
328
+ "aria-hidden": "true",
329
+ "data-slot": "calendar-disc",
330
+ className: "calendar-disc",
331
+ children: /* @__PURE__ */ jsx("span", { className: "calendar-disc-fill" })
332
+ });
333
+ }
334
+ /**
335
+ * One month of the strip. Months sit side by side in a clipped window and slide
336
+ * on a spring; the pane that is not the current month fades back and is inert.
337
+ */
338
+ function MonthPane({ offset, dir, fresh, disc, selection }) {
339
+ return /* @__PURE__ */ jsxs("div", {
340
+ ref: (node) => {
341
+ if (!node) return;
342
+ if (offset === 0) node.removeAttribute("inert");
343
+ else node.setAttribute("inert", "");
344
+ },
345
+ "data-slot": "calendar-month",
346
+ "data-offset": offset,
347
+ "aria-hidden": offset === 0 ? void 0 : true,
348
+ style: {
349
+ "--k": offset,
350
+ "--dir": dir
351
+ },
352
+ className: cn("calendar-pane", fresh && "motion-safe:animate-calendar-pane-in"),
353
+ children: [disc ? /* @__PURE__ */ jsx(SelectionDisc, {}) : null, /* @__PURE__ */ jsx(MonthGrid, {
354
+ offset,
355
+ selection
356
+ })]
357
+ });
358
+ }
359
+ /**
360
+ * One month, shown with its neighbours beside it on a strip. Moving by a month
361
+ * slides the strip; a jump of more than a month brings the new month in from one
362
+ * month away instead of scrolling through the ones between.
363
+ */
364
+ function MonthStrip({ selection }) {
365
+ const start = useVisibleStart();
366
+ const [shown, setShown] = useState(start);
367
+ const [dir, setDir] = useState(1);
368
+ const [fresh, setFresh] = useState(null);
369
+ const strip = useRef(null);
370
+ useIsomorphicLayoutEffect(() => {
371
+ const el = strip.current;
372
+ const current = el?.querySelector("[data-offset=\"0\"]");
373
+ if (el && current) el.style.height = `${current.offsetHeight}px`;
374
+ });
375
+ const keyOf = (offset) => {
376
+ const d = start?.add({ months: offset });
377
+ return d ? `${d.era}-${d.year}-${d.month}` : String(offset);
378
+ };
379
+ if (start && shown && start.compare(shown) !== 0) {
380
+ const months = (start.year - shown.year) * 12 + (start.month - shown.month);
381
+ setShown(start);
382
+ setDir(months > 0 ? 1 : -1);
383
+ setFresh(Math.abs(months) > 1 ? keyOf(0) : null);
384
+ }
385
+ return /* @__PURE__ */ jsx("div", {
386
+ ref: strip,
387
+ "data-slot": "calendar-months",
388
+ className: "calendar-strip",
389
+ children: [
390
+ -1,
391
+ 0,
392
+ 1
393
+ ].map((offset) => /* @__PURE__ */ jsx(MonthPane, {
394
+ offset,
395
+ dir,
396
+ fresh: fresh === keyOf(offset) && offset === 0,
397
+ disc: selection === "single",
398
+ selection
399
+ }, keyOf(offset)))
400
+ });
401
+ }
172
402
  /** Header, grids and Clear — identical under both calendar roots. */
173
403
  function CalendarBody({ visibleMonths, clearable, clearLabel, previousLabel, nextLabel, selection }) {
174
- return /* @__PURE__ */ jsxs(Fragment, { children: [
404
+ const strip = visibleMonths === 1;
405
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
406
+ strip && selection === "single" ? /* @__PURE__ */ jsx(DiscDriver, {}) : null,
175
407
  /* @__PURE__ */ jsxs("header", {
176
408
  "data-slot": "calendar-header",
177
409
  className: calendarHeaderVariants(),
178
- children: [/* @__PURE__ */ jsx(Button, {
179
- slot: "previous",
180
- "aria-label": previousLabel,
181
- className: calendarNavVariants(),
182
- children: /* @__PURE__ */ jsx(ChevronPrevious, {})
183
- }), /* @__PURE__ */ jsx(Button, {
184
- slot: "next",
185
- "aria-label": nextLabel,
186
- className: calendarNavVariants(),
187
- children: /* @__PURE__ */ jsx(ChevronNext, {})
410
+ children: [strip ? /* @__PURE__ */ jsx(MonthTitle, {}) : null, /* @__PURE__ */ jsxs("div", {
411
+ className: "ms-auto flex items-center gap-0.5",
412
+ children: [/* @__PURE__ */ jsx(Button, {
413
+ slot: "previous",
414
+ "aria-label": previousLabel,
415
+ className: calendarNavVariants(),
416
+ children: /* @__PURE__ */ jsx(ChevronPrevious, {})
417
+ }), /* @__PURE__ */ jsx(Button, {
418
+ slot: "next",
419
+ "aria-label": nextLabel,
420
+ className: calendarNavVariants(),
421
+ children: /* @__PURE__ */ jsx(ChevronNext, {})
422
+ })]
188
423
  })]
189
424
  }),
190
- /* @__PURE__ */ jsx("div", {
425
+ strip ? /* @__PURE__ */ jsx(MonthStrip, { selection }) : /* @__PURE__ */ jsx("div", {
191
426
  "data-slot": "calendar-months",
192
427
  className: calendarMonthsVariants(),
193
428
  children: Array.from({ length: visibleMonths }, (_, offset) => /* @__PURE__ */ jsxs("div", {
@@ -195,17 +430,9 @@ function CalendarBody({ visibleMonths, clearable, clearLabel, previousLabel, nex
195
430
  children: [/* @__PURE__ */ jsx(CalendarHeading, {
196
431
  offset: { months: offset },
197
432
  className: calendarHeadingVariants()
198
- }), /* @__PURE__ */ jsxs(CalendarGrid, {
199
- offset: { months: offset },
200
- className: calendarGridVariants(),
201
- children: [/* @__PURE__ */ jsx(CalendarGridHeader, { children: (weekday) => /* @__PURE__ */ jsx(CalendarHeaderCell, {
202
- className: calendarHeaderCellVariants(),
203
- children: weekday
204
- }) }), /* @__PURE__ */ jsx(CalendarGridBody, { children: (date) => /* @__PURE__ */ jsx(CalendarCell, {
205
- date,
206
- "data-slot": "calendar-cell",
207
- className: calendarCellVariants({ selection })
208
- }) })]
433
+ }), /* @__PURE__ */ jsx(MonthGrid, {
434
+ offset,
435
+ selection
209
436
  })]
210
437
  }, offset))
211
438
  }),
@@ -279,6 +506,6 @@ const CalendarRange = forwardRef(function CalendarRange({ className, label, labe
279
506
  });
280
507
  });
281
508
  //#endregion
282
- export { Calendar$1 as Calendar, CalendarRange, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarVariants };
509
+ export { Calendar$1 as Calendar, CalendarRange, calendarCellVariants, calendarClearVariants, calendarGridVariants, calendarHeaderCellVariants, calendarHeaderVariants, calendarHeadingVariants, calendarLabelVariants, calendarMonthsVariants, calendarNavVariants, calendarTitleVariants, calendarVariants };
283
510
 
284
511
  //# sourceMappingURL=calendar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.js","names":["AriaButton","AriaCalendarHeading","AriaCalendarGrid","AriaCalendarGridHeader","AriaCalendarHeaderCell","AriaCalendarGridBody","AriaCalendarCell","Calendar","AriaCalendar","AriaRangeCalendar"],"sources":["../../src/calendar/calendar.tsx"],"sourcesContent":["\"use client\";\n\nimport type { DateValue } from \"@internationalized/date\";\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef, useContext } from \"react\";\nimport {\n Button as AriaButton,\n Calendar as AriaCalendar,\n CalendarCell as AriaCalendarCell,\n CalendarGrid as AriaCalendarGrid,\n CalendarGridBody as AriaCalendarGridBody,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarHeaderCell as AriaCalendarHeaderCell,\n CalendarHeading as AriaCalendarHeading,\n CalendarStateContext,\n RangeCalendar as AriaRangeCalendar,\n RangeCalendarStateContext,\n type CalendarProps as AriaCalendarProps,\n type RangeCalendarProps as AriaRangeCalendarProps,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Calendar, built on React Aria's Calendar and RangeCalendar.\n *\n * Values are `DateValue` objects from `@internationalized/date`, NOT JS\n * `Date`. ADR 0006 names that package the one allowed public type dependency\n * precisely here: a calendar day has no time zone, so modelling it as a\n * timestamp is what costs you a day at a DST boundary. The import is\n * `import type` only — nothing at runtime needs a constructor from it, so the\n * package contributes zero bytes to the bundle.\n *\n * Every string below is a STATIC literal. Tailwind scans source text, so a\n * class assembled at runtime is invisible to it and would simply never be\n * emitted — the component would render unstyled, with no error anywhere.\n *\n * State comes from React Aria's data attributes rather than pseudo-classes:\n * `data-[focus-visible]` is keyboard focus only, and `data-[hovered]` /\n * `data-[pressed]` cover pointer, touch and keyboard uniformly.\n */\nexport const calendarVariants = cva([\n \"flex w-fit flex-col gap-(--density-gap) box-border\",\n \"font-sans text-sm leading-(--leading-normal) text-foreground\",\n]);\n\nexport const calendarLabelVariants = cva([\"text-sm font-medium text-foreground\"]);\n\nexport const calendarHeaderVariants = cva([\n \"flex items-center justify-between gap-(--density-control-gap)\",\n]);\n\n/**\n * The month/prev/next buttons.\n *\n * Deliberately NOT `buttonVariants` from ../button. That would put a\n * cross-component import in the bundle for one caller and six classes, and\n * DRY extracts at two callers, not one.\n */\nexport const calendarNavVariants = cva([\n \"inline-flex shrink-0 items-center justify-center\",\n \"size-(--density-control-h-sm) rounded-md\",\n // A library consumer may load no reset at all, so a bare <button> keeps its\n // user-agent border and ButtonFace grey without these two.\n \"border-(length:--border-width) border-transparent bg-transparent\",\n \"cursor-pointer select-none text-foreground outline-none\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-(--icon-sm)\",\n // The glyph is directional where the BEHAVIOUR is logical: React Aria maps\n // slot=\"previous\" to the correct month either way, so only the arrow flips.\n \"[&_svg]:rtl:-scale-x-100\",\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n \"data-[hovered]:bg-muted data-[pressed]:bg-muted\",\n \"data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring)\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)\",\n]);\n\nexport const calendarMonthsVariants = cva([\n \"flex flex-col gap-(--density-gap) sm:flex-row sm:items-start\",\n]);\n\nexport const calendarHeadingVariants = cva([\n \"mb-1 text-center text-sm font-semibold text-foreground\",\n]);\n\nexport const calendarGridVariants = cva([\n // Without this a bare <table> falls back to user-agent border spacing and\n // the range band shows gaps between cells.\n \"border-collapse\",\n]);\n\nexport const calendarHeaderCellVariants = cva([\n \"w-(--density-control-h-sm) pb-1\",\n \"text-center text-2xs font-medium text-muted-foreground\",\n]);\n\nexport const calendarClearVariants = cva([\n \"self-end rounded-md px-2 py-1\",\n \"border-(length:--border-width) border-transparent bg-transparent\",\n \"cursor-pointer select-none text-sm text-muted-foreground outline-none\",\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n \"data-[hovered]:bg-muted data-[hovered]:text-foreground\",\n \"data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring)\",\n]);\n\n/**\n * A day.\n *\n * Sized from `--density-control-h-sm` rather than a new\n * `--density-calendar-cell`: the density contract test requires every scope to\n * declare every token name, so a new one is three file edits — and this one is\n * already 30/36/42px, all clear of the 24px floor that WCAG 2.2 SC 2.5.8 sets.\n *\n * ARCHITECTURE section 5 rule 6 — no state is carried by colour alone, because\n * every author colour is replaced under forced-colors and the distinction\n * would vanish. Selected adds weight, the range ends add SHAPE, today is an\n * underline (not an outline, which would fight the focus ring) and unavailable\n * is a strikethrough.\n */\nexport const calendarCellVariants = cva(\n [\n \"flex items-center justify-center box-border\",\n \"size-(--density-control-h-sm) rounded-md\",\n \"text-sm leading-(--leading-normal) text-foreground\",\n \"cursor-pointer select-none outline-none\",\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n \"data-[hovered]:bg-muted\",\n \"data-[today]:font-semibold data-[today]:underline data-[today]:underline-offset-4\",\n \"data-[outside-month]:text-muted-foreground data-[outside-month]:opacity-(--opacity-disabled)\",\n // Unavailable dates stay FOCUSABLE, so ADR 0007 holds them to 4.5:1 — this\n // dims to muted-foreground, which the contrast contract grades, never below.\n \"data-[unavailable]:cursor-not-allowed data-[unavailable]:text-muted-foreground\",\n \"data-[unavailable]:line-through\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)\",\n \"data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring)\",\n ],\n {\n variants: {\n /**\n * A variant axis rather than a boolean prop, because the two modes are\n * mutually exclusive visual treatments of the same element — which is\n * exactly what OCP asks a variant to model.\n */\n selection: {\n single: [\n \"data-[selected]:bg-primary data-[selected]:text-primary-foreground\",\n \"data-[selected]:font-semibold\",\n ],\n range: [\n // The band is `muted` — a pair the contrast contract already grades\n // at 4.5:1, so the range needs no new contrast-pairs.json entry.\n \"data-[selected]:rounded-none data-[selected]:bg-muted data-[selected]:text-foreground\",\n \"data-[selection-start]:rounded-s-md data-[selection-start]:bg-primary\",\n \"data-[selection-start]:font-semibold data-[selection-start]:text-primary-foreground\",\n \"data-[selection-end]:rounded-e-md data-[selection-end]:bg-primary\",\n \"data-[selection-end]:font-semibold data-[selection-end]:text-primary-foreground\",\n ],\n },\n },\n defaultVariants: { selection: \"single\" },\n },\n);\n\nfunction ChevronPrevious() {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" aria-hidden=\"true\">\n <path d=\"m15 18-6-6 6-6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\nfunction ChevronNext() {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" aria-hidden=\"true\">\n <path d=\"m9 18 6-6-6-6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\n/**\n * Resets the selection to null.\n *\n * It reads the calendar state from React Aria's context and calls\n * `setValue(null)`, which runs through `useControlledState` — so it fires\n * `onChange` for a controlled parent AND updates uncontrolled state, with no\n * mirrored state here. That is the whole reason there is no `onClear` prop:\n * from inside the provider tree the reset is free, and from outside it it\n * would force every consumer to own the value.\n *\n * The two states are narrowed separately rather than through a union, because\n * `setValue` has a different parameter type on each and the union call is not\n * assignable to either.\n *\n * `slot={null}` opts out of the Button context: inside a Calendar that context\n * carries the previous/next slots, and an unslotted Button would claim one.\n */\nfunction ClearButton({ label }: { label: string }) {\n const calendarState = useContext(CalendarStateContext);\n const rangeState = useContext(RangeCalendarStateContext);\n\n /*\n * Inherit the calendar's own inert states.\n *\n * Without this the Clear button stayed focusable and announced as enabled\n * inside an `isDisabled` calendar — every cell and both nav buttons were\n * inert, and one control in the middle of them was not. `isReadOnly` is the\n * same argument: \"the value is immutable\" has to include clearing it.\n */\n const state = calendarState ?? rangeState;\n const isInert = Boolean(state?.isDisabled ?? false) || Boolean(state?.isReadOnly ?? false);\n\n return (\n <AriaButton\n slot={null}\n data-slot=\"calendar-clear\"\n isDisabled={isInert}\n className={calendarClearVariants()}\n // Stays enabled when there is nothing to clear. Disabling it on press\n // moves focus to <body>, which silently strands a keyboard user mid-grid.\n onPress={() => {\n if (calendarState) calendarState.setValue(null);\n else rangeState?.setValue(null);\n }}\n >\n {label}\n </AriaButton>\n );\n}\n\ninterface CalendarBodyProps {\n visibleMonths: number;\n clearable: boolean;\n clearLabel: string;\n previousLabel: string;\n nextLabel: string;\n selection: \"single\" | \"range\";\n}\n\n/** Header, grids and Clear — identical under both calendar roots. */\nfunction CalendarBody({\n visibleMonths,\n clearable,\n clearLabel,\n previousLabel,\n nextLabel,\n selection,\n}: CalendarBodyProps) {\n return (\n <>\n <header data-slot=\"calendar-header\" className={calendarHeaderVariants()}>\n <AriaButton slot=\"previous\" aria-label={previousLabel} className={calendarNavVariants()}>\n <ChevronPrevious />\n </AriaButton>\n <AriaButton slot=\"next\" aria-label={nextLabel} className={calendarNavVariants()}>\n <ChevronNext />\n </AriaButton>\n </header>\n\n <div data-slot=\"calendar-months\" className={calendarMonthsVariants()}>\n {Array.from({ length: visibleMonths }, (_, offset) => (\n <div key={offset} data-slot=\"calendar-month\">\n {/* Per grid, so three months are three named columns rather than\n one combined range nobody can map back to a column. */}\n <AriaCalendarHeading\n offset={{ months: offset }}\n className={calendarHeadingVariants()}\n />\n <AriaCalendarGrid offset={{ months: offset }} className={calendarGridVariants()}>\n <AriaCalendarGridHeader>\n {(weekday) => (\n <AriaCalendarHeaderCell className={calendarHeaderCellVariants()}>\n {weekday}\n </AriaCalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n <AriaCalendarGridBody>\n {(date) => (\n <AriaCalendarCell\n date={date}\n data-slot=\"calendar-cell\"\n className={calendarCellVariants({ selection })}\n />\n )}\n </AriaCalendarGridBody>\n </AriaCalendarGrid>\n </div>\n ))}\n </div>\n\n {clearable ? <ClearButton label={clearLabel} /> : null}\n </>\n );\n}\n\ninterface CalendarSharedProps {\n /**\n * Accessible name for the calendar.\n *\n * REQUIRED. React Aria renders the root as `role=\"application\"`, which has\n * no implicit name, so without this every calendar announces as an unnamed\n * application — the same finding that made `label` required on Select,\n * Progress, Slider and ScrollArea.\n */\n label: string;\n /**\n * Hide the label visually while leaving it on the accessibility tree. Pass\n * this when the surrounding UI already names the control.\n *\n * @default false\n */\n labelHidden?: boolean;\n /**\n * Number of months displayed side by side. Maps to React Aria's\n * `visibleDuration`, which is omitted from the public surface so the two\n * cannot disagree.\n *\n * @default 1\n */\n visibleMonths?: number;\n /**\n * Render a Clear button that resets the selection to `null`.\n *\n * Works controlled and uncontrolled: the button calls React Aria's\n * `setValue(null)` through context, so `onChange` fires either way and there\n * is no `onClear` for a consumer to wire up.\n *\n * @default false\n */\n clearable?: boolean;\n /**\n * Visible text of the Clear button.\n *\n * A prop rather than a literal because `ARCHITECTURE.md` §7 rule 9 forbids\n * hard-coded user-visible strings and says it cannot be retrofitted.\n * `useMessages()` does not exist yet, so this follows Dialog's `closeLabel`.\n *\n * @default \"Clear\"\n */\n clearLabel?: string;\n /**\n * Accessible name for the previous-month button, which is icon-only. Same\n * reasoning as {@link CalendarSharedProps.clearLabel}.\n *\n * @default \"Previous month\"\n */\n previousLabel?: string;\n /**\n * Accessible name for the next-month button. Same reasoning as\n * {@link CalendarSharedProps.clearLabel}.\n *\n * @default \"Next month\"\n */\n nextLabel?: string;\n /** Extra classes. Merged last through `cn()`, so the consumer wins. */\n className?: string;\n}\n\n/**\n * Props for {@link Calendar}.\n *\n * Extends the React Aria type via `Omit` rather than\n * `ComponentPropsWithoutRef`, matching every other React Aria-backed component\n * here and recorded in ADR 0008. Intersecting would advertise DOM props that\n * React Aria ignores silently.\n */\nexport interface CalendarProps\n extends Omit<\n AriaCalendarProps<DateValue>,\n \"className\" | \"style\" | \"children\" | \"visibleDuration\"\n >,\n CalendarSharedProps {}\n\n/** Props for {@link CalendarRange}. */\nexport interface CalendarRangeProps\n extends Omit<\n AriaRangeCalendarProps<DateValue>,\n \"className\" | \"style\" | \"children\" | \"visibleDuration\"\n >,\n CalendarSharedProps {}\n\n/**\n * A calendar for picking a single date.\n *\n * Maturity: **experimental**. `ARCHITECTURE.md` §7 rule 8's metadata mechanism\n * does not exist yet, and ADR 0006 blocks `stable` until a WebKit test\n * instance lands regardless.\n *\n * `onChange` hands back a `DateValue`; `String(value)` is its `YYYY-MM-DD`\n * form, which is what an API filter or query parameter wants.\n *\n * @example\n * <Calendar label=\"Report date\" value={date} onChange={setDate} clearable />\n */\nexport const Calendar = forwardRef<HTMLDivElement, CalendarProps>(function Calendar(\n {\n className,\n label,\n labelHidden = false,\n visibleMonths = 1,\n clearable = false,\n clearLabel = \"Clear\",\n previousLabel = \"Previous month\",\n nextLabel = \"Next month\",\n ...props\n },\n ref,\n) {\n return (\n <AriaCalendar\n ref={ref}\n {...props}\n aria-label={label}\n visibleDuration={{ months: visibleMonths }}\n data-slot=\"calendar\"\n className={cn(calendarVariants(), className)}\n >\n {labelHidden ? null : (\n <span data-slot=\"calendar-label\" className={calendarLabelVariants()}>\n {label}\n </span>\n )}\n <CalendarBody\n visibleMonths={visibleMonths}\n clearable={clearable}\n clearLabel={clearLabel}\n previousLabel={previousLabel}\n nextLabel={nextLabel}\n selection=\"single\"\n />\n </AriaCalendar>\n );\n});\n\n/**\n * A calendar for picking a contiguous date range.\n *\n * `onChange` hands back `{ start, end }`, both `DateValue`.\n *\n * @example\n * <CalendarRange label=\"Period\" visibleMonths={3}\n * value={range} onChange={setRange} clearable />\n */\nexport const CalendarRange = forwardRef<HTMLDivElement, CalendarRangeProps>(function CalendarRange(\n {\n className,\n label,\n labelHidden = false,\n visibleMonths = 1,\n clearable = false,\n clearLabel = \"Clear\",\n previousLabel = \"Previous month\",\n nextLabel = \"Next month\",\n ...props\n },\n ref,\n) {\n return (\n <AriaRangeCalendar\n ref={ref}\n {...props}\n aria-label={label}\n visibleDuration={{ months: visibleMonths }}\n data-slot=\"calendar\"\n className={cn(calendarVariants(), className)}\n >\n {labelHidden ? null : (\n <span data-slot=\"calendar-label\" className={calendarLabelVariants()}>\n {label}\n </span>\n )}\n <CalendarBody\n visibleMonths={visibleMonths}\n clearable={clearable}\n clearLabel={clearLabel}\n previousLabel={previousLabel}\n nextLabel={nextLabel}\n selection=\"range\"\n />\n </AriaRangeCalendar>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,MAAa,mBAAmB,IAAI,CAClC,sDACA,8DACF,CAAC;AAED,MAAa,wBAAwB,IAAI,CAAC,qCAAqC,CAAC;AAEhF,MAAa,yBAAyB,IAAI,CACxC,+DACF,CAAC;;;;;;;;AASD,MAAa,sBAAsB,IAAI;CACrC;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,yBAAyB,IAAI,CACxC,8DACF,CAAC;A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,GAChB,YAAY,OACZ,aAAa,SACb,gBAAgB,kBAChB,YAAY,cACZ,GAAG,SAEL,KACA;CACA,OACE,qBAACC,UAAD;EACO;EACL,GAAI;EACJ,cAAY;EACZ,iBAAiB,EAAE,QAAQ,cAAc;EACzC,aAAU;EACV,WAAW,GAAG,iBAAiB,GAAG,SAAS;EAN7C,UAAA,CAQG,cAAc,OACb,oBAAC,QAAD;GAAM,aAAU;GAAiB,WAAW,sBAAsB;GAC/D,UAAA;EACG,CAAA,GAER,oBAAC,cAAD;GACiB;GACJ;GACC;GACG;GACJ;GACX,WAAU;EACX,CAAA,CACW;;AAElB,CAAC;;;;;;;;;;AAWD,MAAa,gBAAgB,WAA+C,SAAS,cACnF,EACE,WACA,OACA,cAAc,OACd,gBAAgB,GAChB,YAAY,OACZ,aAAa,SACb,gBAAgB,kBAChB,YAAY,cACZ,GAAG,SAEL,KACA;CACA,OACE,qBAACC,eAAD;EACO;EACL,GAAI;EACJ,cAAY;EACZ,iBAAiB,EAAE,QAAQ,cAAc;EACzC,aAAU;EACV,WAAW,GAAG,iBAAiB,GAAG,SAAS;EAN7C,UAAA,CAQG,cAAc,OACb,oBAAC,QAAD;GAAM,aAAU;GAAiB,WAAW,sBAAsB;GAC/D,UAAA;EACG,CAAA,GAER,oBAAC,cAAD;GACiB;GACJ;GACC;GACG;GACJ;GACX,WAAU;EACX,CAAA,CACgB;;AAEvB,CAAC"}
1
+ {"version":3,"file":"calendar.js","names":["AriaButton","AriaCalendarGrid","AriaCalendarGridHeader","AriaCalendarHeaderCell","AriaCalendarGridBody","AriaCalendarCell","AriaCalendarHeading","Calendar","AriaCalendar","AriaRangeCalendar"],"sources":["../../src/calendar/calendar.tsx"],"sourcesContent":["\"use client\";\n\nimport type { DateValue } from \"@internationalized/date\";\nimport { cva } from \"class-variance-authority\";\nimport {\n forwardRef,\n useContext,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\";\nimport {\n Button as AriaButton,\n Calendar as AriaCalendar,\n CalendarCell as AriaCalendarCell,\n CalendarGrid as AriaCalendarGrid,\n CalendarGridBody as AriaCalendarGridBody,\n CalendarGridHeader as AriaCalendarGridHeader,\n CalendarHeaderCell as AriaCalendarHeaderCell,\n CalendarHeading as AriaCalendarHeading,\n CalendarStateContext,\n RangeCalendar as AriaRangeCalendar,\n RangeCalendarStateContext,\n type CalendarProps as AriaCalendarProps,\n type RangeCalendarProps as AriaRangeCalendarProps,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { useIsomorphicLayoutEffect } from \"../lib/motion.js\";\nimport { SwapText } from \"../lib/swap-text.js\";\n\n/**\n * Calendar, built on React Aria's Calendar and RangeCalendar.\n *\n * Values are `DateValue` objects from `@internationalized/date`, NOT JS\n * `Date`. ADR 0006 names that package the one allowed public type dependency\n * precisely here: a calendar day has no time zone, so modelling it as a\n * timestamp is what costs you a day at a DST boundary. The import is\n * `import type` only — nothing at runtime needs a constructor from it, so the\n * package contributes zero bytes to the bundle.\n *\n * Every string below is a STATIC literal. Tailwind scans source text, so a\n * class assembled at runtime is invisible to it and would simply never be\n * emitted — the component would render unstyled, with no error anywhere.\n *\n * State comes from React Aria's data attributes rather than pseudo-classes:\n * `data-[focus-visible]` is keyboard focus only, and `data-[hovered]` /\n * `data-[pressed]` cover pointer, touch and keyboard uniformly.\n */\nexport const calendarVariants = cva([\n \"flex w-fit flex-col gap-(--density-gap) box-border\",\n \"font-sans text-sm leading-(--leading-normal) text-foreground\",\n]);\n\nexport const calendarLabelVariants = cva([\"text-sm font-medium text-foreground\"]);\n\nexport const calendarHeaderVariants = cva([\n \"flex items-center justify-between gap-(--density-control-gap)\",\n]);\n\n/**\n * The month/prev/next buttons.\n *\n * Deliberately NOT `buttonVariants` from ../button. That would put a\n * cross-component import in the bundle for one caller and six classes, and\n * DRY extracts at two callers, not one.\n */\nexport const calendarNavVariants = cva([\n \"inline-flex shrink-0 items-center justify-center\",\n \"size-(--density-control-h-sm) rounded-md\",\n // A library consumer may load no reset at all, so a bare <button> keeps its\n // user-agent border and ButtonFace grey without these two.\n \"border-(length:--border-width) border-transparent bg-transparent\",\n \"cursor-pointer select-none text-foreground outline-none\",\n \"[&_svg]:pointer-events-none [&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-(--icon-sm)\",\n // The glyph is directional where the BEHAVIOUR is logical: React Aria maps\n // slot=\"previous\" to the correct month either way, so only the arrow flips.\n \"[&_svg]:rtl:-scale-x-100\",\n // Fill and colour ease in over 160ms; the press shrinks to .96 and springs back.\n \"calendar-nav-motion\",\n \"data-[hovered]:bg-muted data-[pressed]:bg-muted\",\n \"data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring)\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)\",\n]);\n\nexport const calendarMonthsVariants = cva([\n \"flex flex-col gap-(--density-gap) sm:flex-row sm:items-start\",\n]);\n\nexport const calendarHeadingVariants = cva([\n \"mb-1 text-center text-sm font-semibold text-foreground\",\n]);\n\n/** The month title of a one-month calendar, in the header beside the buttons. */\nexport const calendarTitleVariants = cva([\n \"min-w-0 flex-1 text-start text-sm font-semibold text-foreground tabular-nums whitespace-nowrap\",\n]);\n\nexport const calendarGridVariants = cva([\n // Without this a bare <table> falls back to user-agent border spacing and\n // the range band shows gaps between cells.\n \"border-collapse\",\n]);\n\nexport const calendarHeaderCellVariants = cva([\n \"w-(--density-control-h-sm) pb-1\",\n \"text-center text-2xs font-medium text-muted-foreground\",\n]);\n\nexport const calendarClearVariants = cva([\n \"self-end rounded-md px-2 py-1\",\n \"border-(length:--border-width) border-transparent bg-transparent\",\n \"cursor-pointer select-none text-sm text-muted-foreground outline-none\",\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n \"data-[hovered]:bg-muted data-[hovered]:text-foreground\",\n \"data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring)\",\n]);\n\n/**\n * A day.\n *\n * Sized from `--density-control-h-sm` rather than a new\n * `--density-calendar-cell`: the density contract test requires every scope to\n * declare every token name, so a new one is three file edits — and this one is\n * already 30/36/42px, all clear of the 24px floor that WCAG 2.2 SC 2.5.8 sets.\n *\n * ARCHITECTURE section 5 rule 6 — no state is carried by colour alone, because\n * every author colour is replaced under forced-colors and the distinction\n * would vanish. Selected adds weight, the range ends add SHAPE, today is an\n * underline (not an outline, which would fight the focus ring) and unavailable\n * is a strikethrough.\n */\nexport const calendarCellVariants = cva(\n [\n \"flex items-center justify-center box-border\",\n \"size-(--density-control-h-sm) rounded-md\",\n \"text-sm leading-(--leading-normal) text-foreground\",\n \"cursor-pointer select-none outline-none\",\n // Above the selection disc that glides beneath it. Colour, fill and the press\n // scale are one utility; --number-delay lets the number flip as the disc passes.\n \"relative z-10 calendar-day\",\n \"data-[hovered]:not-data-[selected]:bg-muted\",\n \"data-[today]:font-semibold data-[today]:underline data-[today]:underline-offset-4\",\n \"data-[outside-month]:text-muted-foreground data-[outside-month]:opacity-(--opacity-disabled)\",\n // Unavailable dates stay FOCUSABLE, so ADR 0007 holds them to 4.5:1 — this\n // dims to muted-foreground, which the contrast contract grades, never below.\n \"data-[unavailable]:cursor-not-allowed data-[unavailable]:text-muted-foreground\",\n \"data-[unavailable]:line-through\",\n \"data-[disabled]:cursor-not-allowed data-[disabled]:opacity-(--opacity-disabled)\",\n \"data-[focus-visible]:outline-solid data-[focus-visible]:outline-(length:--focus-ring-width)\",\n \"data-[focus-visible]:outline-offset-(--focus-ring-offset) data-[focus-visible]:outline-(--color-ring)\",\n ],\n {\n variants: {\n /**\n * A variant axis rather than a boolean prop, because the two modes are\n * mutually exclusive visual treatments of the same element — which is\n * exactly what OCP asks a variant to model.\n */\n selection: {\n single: [\n // The fill is the disc under the cell, not the cell: it glides between days.\n \"data-[selected]:text-primary-foreground\",\n \"data-[selected]:font-semibold\",\n ],\n range: [\n // The band is `muted` — a pair the contrast contract already grades\n // at 4.5:1, so the range needs no new contrast-pairs.json entry.\n \"data-[selected]:rounded-none data-[selected]:bg-muted data-[selected]:text-foreground\",\n \"data-[selection-start]:rounded-s-md data-[selection-start]:bg-primary\",\n \"data-[selection-start]:font-semibold data-[selection-start]:text-primary-foreground\",\n \"data-[selection-end]:rounded-e-md data-[selection-end]:bg-primary\",\n \"data-[selection-end]:font-semibold data-[selection-end]:text-primary-foreground\",\n ],\n /**\n * The range picker's own look: the band and the ends are drawn beneath the\n * cells by the picker, which slides and stretches them, so the cells paint\n * only their text (and the shorter press, .9 in 120ms).\n */\n band: [\n \"[--press-scale:0.9] [--press-time:120ms]\",\n \"data-[selected]:not-data-[selection-start]:not-data-[selection-end]:text-foreground\",\n \"data-[selection-start]:font-medium data-[selection-start]:text-primary-foreground data-[selection-start]:[--number-delay:40ms]\",\n \"data-[selection-end]:font-medium data-[selection-end]:text-primary-foreground data-[selection-end]:[--number-delay:40ms]\",\n ],\n },\n },\n defaultVariants: { selection: \"single\" },\n },\n);\n\nfunction ChevronPrevious() {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" aria-hidden=\"true\">\n <path d=\"m15 18-6-6 6-6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\nfunction ChevronNext() {\n return (\n <svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" aria-hidden=\"true\">\n <path d=\"m9 18 6-6-6-6\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n );\n}\n\n/**\n * Resets the selection to null.\n *\n * It reads the calendar state from React Aria's context and calls\n * `setValue(null)`, which runs through `useControlledState` — so it fires\n * `onChange` for a controlled parent AND updates uncontrolled state, with no\n * mirrored state here. That is the whole reason there is no `onClear` prop:\n * from inside the provider tree the reset is free, and from outside it it\n * would force every consumer to own the value.\n *\n * The two states are narrowed separately rather than through a union, because\n * `setValue` has a different parameter type on each and the union call is not\n * assignable to either.\n *\n * `slot={null}` opts out of the Button context: inside a Calendar that context\n * carries the previous/next slots, and an unslotted Button would claim one.\n */\nfunction ClearButton({ label }: { label: string }) {\n const calendarState = useContext(CalendarStateContext);\n const rangeState = useContext(RangeCalendarStateContext);\n\n /*\n * Inherit the calendar's own inert states.\n *\n * Without this the Clear button stayed focusable and announced as enabled\n * inside an `isDisabled` calendar — every cell and both nav buttons were\n * inert, and one control in the middle of them was not. `isReadOnly` is the\n * same argument: \"the value is immutable\" has to include clearing it.\n */\n const state = calendarState ?? rangeState;\n const isInert = Boolean(state?.isDisabled ?? false) || Boolean(state?.isReadOnly ?? false);\n\n return (\n <AriaButton\n slot={null}\n data-slot=\"calendar-clear\"\n isDisabled={isInert}\n className={calendarClearVariants()}\n // Stays enabled when there is nothing to clear. Disabling it on press\n // moves focus to <body>, which silently strands a keyboard user mid-grid.\n onPress={() => {\n if (calendarState) calendarState.setValue(null);\n else rangeState?.setValue(null);\n }}\n >\n {label}\n </AriaButton>\n );\n}\n\ninterface CalendarBodyProps {\n visibleMonths: number;\n clearable: boolean;\n clearLabel: string;\n previousLabel: string;\n nextLabel: string;\n selection: \"single\" | \"range\";\n}\n\n/** The month's rows, headers and cells: one grid for the month `offset` months from the first visible one. */\nfunction MonthGrid({ offset, selection }: { offset: number; selection: \"single\" | \"range\" }) {\n return (\n <AriaCalendarGrid offset={{ months: offset }} className={calendarGridVariants()}>\n <AriaCalendarGridHeader>\n {(weekday) => (\n <AriaCalendarHeaderCell className={calendarHeaderCellVariants()}>\n {weekday}\n </AriaCalendarHeaderCell>\n )}\n </AriaCalendarGridHeader>\n <AriaCalendarGridBody>\n {(date) => (\n <AriaCalendarCell\n date={date}\n data-slot=\"calendar-cell\"\n className={calendarCellVariants({ selection })}\n />\n )}\n </AriaCalendarGridBody>\n </AriaCalendarGrid>\n );\n}\n\n/** The first visible day, from whichever root we are under. */\nfunction useVisibleStart() {\n const single = useContext(CalendarStateContext);\n const range = useContext(RangeCalendarStateContext);\n return (single ?? range)?.visibleRange.start;\n}\n\n/**\n * The month title. React Aria's own heading stays, visually hidden, as the text;\n * the copy the eye sees crosses in place: the new month arrives from the side the\n * strip travels to while the old one leaves toward the other. Nothing animates on\n * first mount.\n */\nfunction MonthTitle() {\n const start = useVisibleStart();\n const headingRef = useRef<HTMLHeadingElement>(null);\n const [text, setText] = useState(\"\");\n const [shown, setShown] = useState(start);\n const [dir, setDir] = useState(1);\n if (start && shown && start.compare(shown) !== 0) {\n setShown(start);\n setDir(start.compare(shown) > 0 ? 1 : -1);\n }\n useIsomorphicLayoutEffect(() => {\n const next = headingRef.current?.textContent ?? \"\";\n if (next !== text) setText(next);\n });\n return (\n <>\n <AriaCalendarHeading ref={headingRef} className=\"sr-only\" />\n <span aria-hidden=\"true\" data-slot=\"calendar-title\" className={calendarTitleVariants()}>\n {/* The text is read from the heading a render after the first, so the first text is a fresh swap, not a change. */}\n <SwapText key={text === \"\" ? \"boot\" : \"live\"} swapKey={text} dir={dir} motion=\"slide\" className=\"block\">\n {text}\n </SwapText>\n </span>\n </>\n );\n}\n\n/** A day cell's place in its month's grid, read from the table's structure: no layout is forced. */\nfunction gridPlace(cell: HTMLElement) {\n const td = cell.closest(\"td\");\n const tr = td?.parentElement as HTMLTableRowElement | null | undefined;\n return td && tr ? { col: td.cellIndex, row: tr.sectionRowIndex } : null;\n}\n\ninterface DiscMemory {\n cell: HTMLElement;\n col: number;\n row: number;\n}\n\n/**\n * Drives the selected disc of every month. The disc is one element under the day\n * cells, placed from the selected cell's measured box, so it glides on a straight\n * line between any two days, keeps its place while the strip slides, and only\n * grows in or fades out when the selection enters or leaves a month. Each number\n * flips colour as the disc actually passes it: the day it lands on waits longer on\n * long hops, the day it leaves waits longer on short ones.\n *\n * It is one component, first in the tree, because order matters: the colour\n * transitions start at the first style recalculation after a cell's state\n * changes, and anything that measures the page (the title's swap does, on every\n * commit) forces one. So every delay is set from the table's structure before any\n * box is measured, and it runs before the header's effects do.\n */\nfunction DiscDriver() {\n const marker = useRef<HTMLSpanElement>(null);\n const memory = useRef(new WeakMap<HTMLElement, DiscMemory>());\n // Subscribing re-renders the driver when the selection, the month or the focus changes.\n useContext(CalendarStateContext);\n useIsomorphicLayoutEffect(() => {\n const root = marker.current?.parentElement;\n if (!root) return;\n const panes = [...root.querySelectorAll<HTMLElement>('[data-slot=\"calendar-month\"]')];\n const work = panes.flatMap((pane) => {\n const el = pane.querySelector<HTMLElement>(':scope > [data-slot=\"calendar-disc\"]');\n if (!el) return [];\n const cell = pane.querySelector<HTMLElement>('[data-slot=\"calendar-cell\"][data-selected]');\n return [{ pane, el, cell }];\n });\n // Pass 1, no layout reads: the number delays.\n for (const { el, cell } of work) {\n if (!cell) continue;\n const place = gridPlace(cell);\n const before = memory.current.get(el);\n if (el.dataset.visible === undefined || !before || before.cell === cell || !place) continue;\n const distance = Math.hypot(place.col - before.col, place.row - before.row);\n if (distance === 0) continue;\n cell.style.setProperty(\n \"--number-delay\",\n `${Math.round(Math.min(260, 95 + 85 * Math.log(distance)))}ms`,\n );\n if (before.cell.isConnected)\n before.cell.style.setProperty(\n \"--number-delay\",\n `${Math.round(Math.max(20, 130 / distance))}ms`,\n );\n }\n // Pass 2: place the discs.\n for (const { pane, el, cell } of work) {\n if (!cell) {\n delete el.dataset.visible;\n memory.current.delete(el);\n continue;\n }\n const box = cell.getBoundingClientRect();\n const paneBox = pane.getBoundingClientRect();\n // A pressed cell is scaled about its centre; offsetWidth is the unscaled box.\n const x = box.left - paneBox.left - (box.width - cell.offsetWidth) / 2;\n const y = box.top - paneBox.top - (box.height - cell.offsetHeight) / 2;\n el.style.width = `${cell.offsetWidth}px`;\n el.style.height = `${cell.offsetHeight}px`;\n if (el.dataset.visible === undefined) {\n // Arriving in this month: land in place, then grow in.\n el.style.transition = \"none\";\n el.style.translate = `${x}px ${y}px`;\n void el.offsetWidth;\n el.style.transition = \"\";\n el.dataset.visible = \"\";\n } else {\n el.style.translate = `${x}px ${y}px`;\n }\n const place = gridPlace(cell);\n if (place) memory.current.set(el, { cell, ...place });\n }\n });\n return <span ref={marker} hidden data-slot=\"calendar-disc-driver\" />;\n}\n\n/** The disc itself: an empty shell the driver places. */\nfunction SelectionDisc() {\n return (\n <span aria-hidden=\"true\" data-slot=\"calendar-disc\" className=\"calendar-disc\">\n <span className=\"calendar-disc-fill\" />\n </span>\n );\n}\n\n/**\n * One month of the strip. Months sit side by side in a clipped window and slide\n * on a spring; the pane that is not the current month fades back and is inert.\n */\nfunction MonthPane({\n offset,\n dir,\n fresh,\n disc,\n selection,\n}: {\n offset: number;\n dir: number;\n fresh: boolean;\n disc: boolean;\n selection: \"single\" | \"range\";\n}) {\n return (\n <div\n ref={(node) => {\n if (!node) return;\n if (offset === 0) node.removeAttribute(\"inert\");\n else node.setAttribute(\"inert\", \"\");\n }}\n data-slot=\"calendar-month\"\n data-offset={offset}\n aria-hidden={offset === 0 ? undefined : true}\n style={{ \"--k\": offset, \"--dir\": dir } as CSSProperties}\n className={cn(\"calendar-pane\", fresh && \"motion-safe:animate-calendar-pane-in\")}\n >\n {disc ? <SelectionDisc /> : null}\n <MonthGrid offset={offset} selection={selection} />\n </div>\n );\n}\n\n/**\n * One month, shown with its neighbours beside it on a strip. Moving by a month\n * slides the strip; a jump of more than a month brings the new month in from one\n * month away instead of scrolling through the ones between.\n */\nfunction MonthStrip({ selection }: { selection: \"single\" | \"range\" }) {\n const start = useVisibleStart();\n const [shown, setShown] = useState(start);\n const [dir, setDir] = useState(1);\n const [fresh, setFresh] = useState<string | null>(null);\n const strip = useRef<HTMLDivElement>(null);\n // The window is as tall as the month in view, and follows it when a month has more\n // or fewer weeks than the last, so the calendar never leaves a gap or clips a row.\n useIsomorphicLayoutEffect(() => {\n const el = strip.current;\n const current = el?.querySelector<HTMLElement>('[data-offset=\"0\"]');\n if (el && current) el.style.height = `${current.offsetHeight}px`;\n });\n const keyOf = (offset: number) => {\n const d = start?.add({ months: offset });\n return d ? `${d.era}-${d.year}-${d.month}` : String(offset);\n };\n if (start && shown && start.compare(shown) !== 0) {\n const months = (start.year - shown.year) * 12 + (start.month - shown.month);\n setShown(start);\n setDir(months > 0 ? 1 : -1);\n setFresh(Math.abs(months) > 1 ? keyOf(0) : null);\n }\n return (\n <div ref={strip} data-slot=\"calendar-months\" className=\"calendar-strip\">\n {[-1, 0, 1].map((offset) => (\n <MonthPane\n key={keyOf(offset)}\n offset={offset}\n dir={dir}\n fresh={fresh === keyOf(offset) && offset === 0}\n disc={selection === \"single\"}\n selection={selection}\n />\n ))}\n </div>\n );\n}\n\n/** Header, grids and Clear — identical under both calendar roots. */\nfunction CalendarBody({\n visibleMonths,\n clearable,\n clearLabel,\n previousLabel,\n nextLabel,\n selection,\n}: CalendarBodyProps) {\n // One month shows as a strip with its title in the header; several months stay side by side.\n const strip = visibleMonths === 1;\n return (\n <>\n {strip && selection === \"single\" ? <DiscDriver /> : null}\n <header data-slot=\"calendar-header\" className={calendarHeaderVariants()}>\n {strip ? <MonthTitle /> : null}\n <div className=\"ms-auto flex items-center gap-0.5\">\n <AriaButton slot=\"previous\" aria-label={previousLabel} className={calendarNavVariants()}>\n <ChevronPrevious />\n </AriaButton>\n <AriaButton slot=\"next\" aria-label={nextLabel} className={calendarNavVariants()}>\n <ChevronNext />\n </AriaButton>\n </div>\n </header>\n\n {strip ? (\n <MonthStrip selection={selection} />\n ) : (\n <div data-slot=\"calendar-months\" className={calendarMonthsVariants()}>\n {Array.from({ length: visibleMonths }, (_, offset) => (\n <div key={offset} data-slot=\"calendar-month\">\n {/* Per grid, so three months are three named columns rather than\n one combined range nobody can map back to a column. */}\n <AriaCalendarHeading\n offset={{ months: offset }}\n className={calendarHeadingVariants()}\n />\n <MonthGrid offset={offset} selection={selection} />\n </div>\n ))}\n </div>\n )}\n\n {clearable ? <ClearButton label={clearLabel} /> : null}\n </>\n );\n}\n\ninterface CalendarSharedProps {\n /**\n * Accessible name for the calendar.\n *\n * REQUIRED. React Aria renders the root as `role=\"application\"`, which has\n * no implicit name, so without this every calendar announces as an unnamed\n * application — the same finding that made `label` required on Select,\n * Progress, Slider and ScrollArea.\n */\n label: string;\n /**\n * Hide the label visually while leaving it on the accessibility tree. Pass\n * this when the surrounding UI already names the control.\n *\n * @default false\n */\n labelHidden?: boolean;\n /**\n * Number of months displayed side by side. Maps to React Aria's\n * `visibleDuration`, which is omitted from the public surface so the two\n * cannot disagree.\n *\n * @default 1\n */\n visibleMonths?: number;\n /**\n * Render a Clear button that resets the selection to `null`.\n *\n * Works controlled and uncontrolled: the button calls React Aria's\n * `setValue(null)` through context, so `onChange` fires either way and there\n * is no `onClear` for a consumer to wire up.\n *\n * @default false\n */\n clearable?: boolean;\n /**\n * Visible text of the Clear button.\n *\n * A prop rather than a literal because `ARCHITECTURE.md` §7 rule 9 forbids\n * hard-coded user-visible strings and says it cannot be retrofitted.\n * `useMessages()` does not exist yet, so this follows Dialog's `closeLabel`.\n *\n * @default \"Clear\"\n */\n clearLabel?: string;\n /**\n * Accessible name for the previous-month button, which is icon-only. Same\n * reasoning as {@link CalendarSharedProps.clearLabel}.\n *\n * @default \"Previous month\"\n */\n previousLabel?: string;\n /**\n * Accessible name for the next-month button. Same reasoning as\n * {@link CalendarSharedProps.clearLabel}.\n *\n * @default \"Next month\"\n */\n nextLabel?: string;\n /** Extra classes. Merged last through `cn()`, so the consumer wins. */\n className?: string;\n}\n\n/**\n * Props for {@link Calendar}.\n *\n * Extends the React Aria type via `Omit` rather than\n * `ComponentPropsWithoutRef`, matching every other React Aria-backed component\n * here and recorded in ADR 0008. Intersecting would advertise DOM props that\n * React Aria ignores silently.\n */\nexport interface CalendarProps\n extends Omit<\n AriaCalendarProps<DateValue>,\n \"className\" | \"style\" | \"children\" | \"visibleDuration\"\n >,\n CalendarSharedProps {}\n\n/** Props for {@link CalendarRange}. */\nexport interface CalendarRangeProps\n extends Omit<\n AriaRangeCalendarProps<DateValue>,\n \"className\" | \"style\" | \"children\" | \"visibleDuration\"\n >,\n CalendarSharedProps {}\n\n/**\n * A calendar for picking a single date.\n *\n * Maturity: **experimental**. `ARCHITECTURE.md` §7 rule 8's metadata mechanism\n * does not exist yet, and ADR 0006 blocks `stable` until a WebKit test\n * instance lands regardless.\n *\n * `onChange` hands back a `DateValue`; `String(value)` is its `YYYY-MM-DD`\n * form, which is what an API filter or query parameter wants.\n *\n * @example\n * <Calendar label=\"Report date\" value={date} onChange={setDate} clearable />\n */\nexport const Calendar = forwardRef<HTMLDivElement, CalendarProps>(function Calendar(\n {\n className,\n label,\n labelHidden = false,\n visibleMonths = 1,\n clearable = false,\n clearLabel = \"Clear\",\n previousLabel = \"Previous month\",\n nextLabel = \"Next month\",\n ...props\n },\n ref,\n) {\n return (\n <AriaCalendar\n ref={ref}\n {...props}\n aria-label={label}\n visibleDuration={{ months: visibleMonths }}\n data-slot=\"calendar\"\n className={cn(calendarVariants(), className)}\n >\n {labelHidden ? null : (\n <span data-slot=\"calendar-label\" className={calendarLabelVariants()}>\n {label}\n </span>\n )}\n <CalendarBody\n visibleMonths={visibleMonths}\n clearable={clearable}\n clearLabel={clearLabel}\n previousLabel={previousLabel}\n nextLabel={nextLabel}\n selection=\"single\"\n />\n </AriaCalendar>\n );\n});\n\n/**\n * A calendar for picking a contiguous date range.\n *\n * `onChange` hands back `{ start, end }`, both `DateValue`.\n *\n * @example\n * <CalendarRange label=\"Period\" visibleMonths={3}\n * value={range} onChange={setRange} clearable />\n */\nexport const CalendarRange = forwardRef<HTMLDivElement, CalendarRangeProps>(function CalendarRange(\n {\n className,\n label,\n labelHidden = false,\n visibleMonths = 1,\n clearable = false,\n clearLabel = \"Clear\",\n previousLabel = \"Previous month\",\n nextLabel = \"Next month\",\n ...props\n },\n ref,\n) {\n return (\n <AriaRangeCalendar\n ref={ref}\n {...props}\n aria-label={label}\n visibleDuration={{ months: visibleMonths }}\n data-slot=\"calendar\"\n className={cn(calendarVariants(), className)}\n >\n {labelHidden ? null : (\n <span data-slot=\"calendar-label\" className={calendarLabelVariants()}>\n {label}\n </span>\n )}\n <CalendarBody\n visibleMonths={visibleMonths}\n clearable={clearable}\n clearLabel={clearLabel}\n previousLabel={previousLabel}\n nextLabel={nextLabel}\n selection=\"range\"\n />\n </AriaRangeCalendar>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDA,MAAa,mBAAmB,IAAI,CAClC,sDACA,8DACF,CAAC;AAED,MAAa,wBAAwB,IAAI,CAAC,qCAAqC,CAAC;AAEhF,MAAa,yBAAyB,IAAI,CACxC,+DACF,CAAC;;;;;;;;AASD,MAAa,sBAAsB,IAAI;CACrC;CACA;CAGA;CACA;CACA;CACA;CAGA;CAEA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,yBAAyB,IAAI,CACxC,8DACF,CAAC;AAED,MAAa,0BAA0B,IAAI,CACzC,wDACF,CAAC;;AAGD,MAAa,wBAAwB,IAAI,CACvC,gGACF,CAAC;AAED,MAAa,uBAAuB,IAAI,CAGtC,iBACF,CAAC;AAED,MAAa,6BAA6B,IAAI,CAC5C,mCACA,wDACF,CAAC;AAED,MAAa,wBAAwB,IAAI;CACvC;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;;;;;;;;;;;;;;AAgBD,MAAa,uBAAuB,IAClC;CACE;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CAGA;CACA;CACA;CACA;CACA;AACF,GACA;CACE,UAAU;;;;;;AAMR,WAAW;EACT,QAAQ,CAEN,2CACA,+BACF;EACA,OAAO;GAGL;GACA;GACA;GACA;GACA;EACF;;;;;;EAMA,MAAM;GACJ;GACA;GACA;GACA;EACF;CACF,EACF;CACA,iBAAiB,EAAE,WAAW,SAAS;AACzC,CACF;AAEA,SAAS,kBAAkB;CACzB,OACE,oBAAC,OAAD;EAAK,SAAQ;EAAY,MAAK;EAAO,QAAO;EAAe,aAAY;EAAI,eAAY;EACrF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C,eAAD;EACO;EACL,GAAI;EACJ,cAAY;EACZ,iBAAiB,EAAE,QAAQ,cAAc;EACzC,aAAU;EACV,WAAW,GAAG,iBAAiB,GAAG,SAAS;EAN7C,UAAA,CAQG,cAAc,OACb,oBAAC,QAAD;GAAM,aAAU;GAAiB,WAAW,sBAAsB;GAC/D,UAAA;EACG,CAAA,GAER,oBAAC,cAAD;GACiB;GACJ;GACC;GACG;GACJ;GACX,WAAU;EACX,CAAA,CACgB;;AAEvB,CAAC"}
@@ -53,8 +53,15 @@ export declare const cardFooterVariants: (props?: import("class-variance-authori
53
53
  * <CardContent>Twelve of eighteen modules complete.</CardContent>
54
54
  * </Card>
55
55
  */
56
- export type CardProps = ComponentPropsWithoutRef<"div">;
57
- export declare const Card: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
56
+ export interface CardProps extends ComponentPropsWithoutRef<"div"> {
57
+ /**
58
+ * Make the card respond to a pointer: it floats 2px on a spring while it is pointed
59
+ * at, its border darkens and its shadow deepens. Mouse and pen only; touch never lifts.
60
+ * Leave it off for a card that is not a target: a static card should not move.
61
+ */
62
+ interactive?: boolean;
63
+ }
64
+ export declare const Card: import("react").ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
58
65
  /** Title and description, stacked. */
59
66
  export type CardHeaderProps = ComponentPropsWithoutRef<"div">;
60
67
  export declare const CardHeader: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;