@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,142 @@
1
+ "use client";
2
+ import { cn } from "../lib/cn.js";
3
+ import { Select as Select$1, SelectItem } from "../select/select.js";
4
+ import { cva } from "class-variance-authority";
5
+ import { forwardRef, useId } from "react";
6
+ import { Header, ListBox, ListBoxItem, ListBoxSection } from "react-aria-components";
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+ //#region src/side-nav/side-nav.tsx
9
+ /**
10
+ * SideNav: the sections of one screen, listed down its side.
11
+ *
12
+ * A row of tabs holds a handful of choices. Past about eight it no longer
13
+ * fits a laptop, hides its ends off the edge and stops being a switch: it is
14
+ * a list of sections. SideNav lists them vertically, grouped under plain
15
+ * headings, and shows the chosen one beside the list.
16
+ *
17
+ * WIDE (its own box at least 48rem: a container query, so it follows the
18
+ * space the page gives it, not the window): the grouped list on the inline
19
+ * start, sticky while the section scrolls. It is React Aria's ListBox with one
20
+ * section per group, so each group is announced by its heading; the up and
21
+ * down arrows move through every section ACROSS the groups and choose as
22
+ * they go (the same automatic activation as Tabs); Home and End jump to the
23
+ * ends; typing a section's first letters jumps to it.
24
+ *
25
+ * NARROW (under 48rem): a column of sections does not fit beside anything on
26
+ * a phone, so the list gives way to one Select above the body.
27
+ *
28
+ * The chosen section's title is the body's `<h2>`, one size for every
29
+ * section, with the screen's description of that section under it -- so no
30
+ * section draws its own title at its own size.
31
+ *
32
+ * WHY NOT `Tabs orientation="vertical"`: React Aria's TabList is a flat
33
+ * collection with no sections, so it cannot carry group headings, and a
34
+ * heading placed among the tabs would be announced as part of a tab's name.
35
+ * A group with no sections is not drawn.
36
+ */
37
+ const sideNavVariants = cva(["@container/side-nav box-border font-sans text-foreground"]);
38
+ const sideNavMenuVariants = cva(["hidden w-56 shrink-0 box-border", "side-nav-wide:sticky side-nav-wide:top-4 side-nav-wide:block side-nav-wide:max-h-screen side-nav-wide:overflow-y-auto"]);
39
+ const sideNavHeaderVariants = cva(["mb-1 px-2 text-2xs leading-(--leading-normal) font-semibold uppercase tracking-wider text-muted-foreground"]);
40
+ const sideNavItemVariants = cva([
41
+ "flex cursor-pointer items-center rounded-md px-2 py-1 box-border",
42
+ "text-sm leading-(--leading-normal) text-foreground",
43
+ "border-s-2 border-transparent",
44
+ "data-[hovered]:bg-muted",
45
+ "data-[selected]:bg-muted data-[selected]:font-medium data-[selected]:border-foreground",
46
+ "motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard",
47
+ "outline-none",
48
+ "data-[focus-visible]:outline-solid",
49
+ "data-[focus-visible]:outline-(length:--focus-ring-width)",
50
+ "data-[focus-visible]:-outline-offset-(--focus-ring-width)",
51
+ "data-[focus-visible]:outline-(--color-ring)"
52
+ ]);
53
+ const SideNav = forwardRef(function SideNav({ "aria-label": label, groups, selectedKey, onSelectionChange, selectLabel = "Section", description, children, className }, ref) {
54
+ const shown = groups.filter((g) => g.sections.length > 0);
55
+ const all = shown.flatMap((g) => g.sections);
56
+ const current = all.find((s) => s.id === selectedKey);
57
+ const headingId = useId();
58
+ const choose = (key) => {
59
+ if (key != null && String(key) !== selectedKey) onSelectionChange(String(key));
60
+ };
61
+ const chooseFromList = (keys) => {
62
+ if (keys === "all") return;
63
+ choose(Array.from(keys)[0] ?? null);
64
+ };
65
+ return /* @__PURE__ */ jsx("div", {
66
+ ref,
67
+ "data-slot": "side-nav",
68
+ className: cn(sideNavVariants(), className),
69
+ children: /* @__PURE__ */ jsxs("div", {
70
+ "data-slot": "side-nav-layout",
71
+ className: "side-nav-wide:flex side-nav-wide:items-start side-nav-wide:gap-8",
72
+ children: [
73
+ /* @__PURE__ */ jsx("nav", {
74
+ "aria-label": label,
75
+ "data-slot": "side-nav-menu",
76
+ className: sideNavMenuVariants(),
77
+ children: /* @__PURE__ */ jsx(ListBox, {
78
+ "aria-label": label,
79
+ selectionMode: "single",
80
+ selectionBehavior: "replace",
81
+ disallowEmptySelection: true,
82
+ selectedKeys: current ? [current.id] : [],
83
+ onSelectionChange: chooseFromList,
84
+ className: "flex flex-col gap-3 outline-none",
85
+ children: shown.map((group) => /* @__PURE__ */ jsxs(ListBoxSection, {
86
+ id: group.label,
87
+ className: "flex flex-col gap-0.5",
88
+ children: [/* @__PURE__ */ jsx(Header, {
89
+ "data-slot": "side-nav-header",
90
+ className: sideNavHeaderVariants(),
91
+ children: group.label
92
+ }), group.sections.map((section) => /* @__PURE__ */ jsx(ListBoxItem, {
93
+ id: section.id,
94
+ textValue: section.label,
95
+ "data-slot": "side-nav-item",
96
+ className: sideNavItemVariants(),
97
+ children: section.label
98
+ }, section.id))]
99
+ }, group.label))
100
+ })
101
+ }),
102
+ /* @__PURE__ */ jsx("div", {
103
+ "data-slot": "side-nav-select",
104
+ className: "mb-4 side-nav-wide:hidden",
105
+ children: /* @__PURE__ */ jsx(Select$1, {
106
+ label: selectLabel,
107
+ selectedKey: current?.id ?? null,
108
+ onSelectionChange: choose,
109
+ children: all.map((section) => /* @__PURE__ */ jsx(SelectItem, {
110
+ id: section.id,
111
+ children: section.label
112
+ }, section.id))
113
+ })
114
+ }),
115
+ /* @__PURE__ */ jsxs("section", {
116
+ "aria-labelledby": headingId,
117
+ "data-slot": "side-nav-body",
118
+ className: "min-w-0 flex-1",
119
+ children: [
120
+ /* @__PURE__ */ jsx("h2", {
121
+ id: headingId,
122
+ className: "font-display text-h4 leading-(--leading-snug) font-semibold text-foreground",
123
+ children: current?.label
124
+ }),
125
+ description == null ? null : /* @__PURE__ */ jsx("p", {
126
+ className: "mt-1 max-w-3xl text-sm leading-(--leading-normal) text-muted-foreground",
127
+ children: description
128
+ }),
129
+ /* @__PURE__ */ jsx("div", {
130
+ className: "mt-4",
131
+ children
132
+ })
133
+ ]
134
+ })
135
+ ]
136
+ })
137
+ });
138
+ });
139
+ //#endregion
140
+ export { SideNav, sideNavHeaderVariants, sideNavItemVariants, sideNavMenuVariants, sideNavVariants };
141
+
142
+ //# sourceMappingURL=side-nav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"side-nav.js","names":["AriaListBox","AriaListBoxSection","AriaHeader","AriaListBoxItem","Select"],"sources":["../../src/side-nav/side-nav.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef, useId, type ReactNode } from \"react\";\nimport {\n Header as AriaHeader,\n ListBox as AriaListBox,\n ListBoxItem as AriaListBoxItem,\n ListBoxSection as AriaListBoxSection,\n type Key,\n type Selection,\n} from \"react-aria-components\";\n\nimport { cn } from \"../lib/cn.js\";\nimport { Select, SelectItem } from \"../select/select.js\";\n\n/**\n * SideNav: the sections of one screen, listed down its side.\n *\n * A row of tabs holds a handful of choices. Past about eight it no longer\n * fits a laptop, hides its ends off the edge and stops being a switch: it is\n * a list of sections. SideNav lists them vertically, grouped under plain\n * headings, and shows the chosen one beside the list.\n *\n * WIDE (its own box at least 48rem: a container query, so it follows the\n * space the page gives it, not the window): the grouped list on the inline\n * start, sticky while the section scrolls. It is React Aria's ListBox with one\n * section per group, so each group is announced by its heading; the up and\n * down arrows move through every section ACROSS the groups and choose as\n * they go (the same automatic activation as Tabs); Home and End jump to the\n * ends; typing a section's first letters jumps to it.\n *\n * NARROW (under 48rem): a column of sections does not fit beside anything on\n * a phone, so the list gives way to one Select above the body.\n *\n * The chosen section's title is the body's `<h2>`, one size for every\n * section, with the screen's description of that section under it -- so no\n * section draws its own title at its own size.\n *\n * WHY NOT `Tabs orientation=\"vertical\"`: React Aria's TabList is a flat\n * collection with no sections, so it cannot carry group headings, and a\n * heading placed among the tabs would be announced as part of a tab's name.\n * A group with no sections is not drawn.\n */\n\nexport const sideNavVariants = cva([\"@container/side-nav box-border font-sans text-foreground\"]);\n\nexport const sideNavMenuVariants = cva([\n \"hidden w-56 shrink-0 box-border\",\n \"side-nav-wide:sticky side-nav-wide:top-4 side-nav-wide:block side-nav-wide:max-h-screen side-nav-wide:overflow-y-auto\",\n]);\n\nexport const sideNavHeaderVariants = cva([\n \"mb-1 px-2 text-2xs leading-(--leading-normal) font-semibold uppercase tracking-wider text-muted-foreground\",\n]);\n\nexport const sideNavItemVariants = cva([\n \"flex cursor-pointer items-center rounded-md px-2 py-1 box-border\",\n \"text-sm leading-(--leading-normal) text-foreground\",\n // A bar on the inline start marks the chosen section. The fill alone\n // (muted on background) is 1.13:1, no boundary anyone can see; the bar\n // in the foreground colour is what clears WCAG 1.4.11. Transparent at\n // rest so choosing a section does not move its text.\n \"border-s-2 border-transparent\",\n \"data-[hovered]:bg-muted\",\n \"data-[selected]:bg-muted data-[selected]:font-medium data-[selected]:border-foreground\",\n \"motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard\",\n \"outline-none\",\n \"data-[focus-visible]:outline-solid\",\n \"data-[focus-visible]:outline-(length:--focus-ring-width)\",\n // Inset: the menu scrolls on a short window, which would clip a ring\n // drawn outside the item.\n \"data-[focus-visible]:-outline-offset-(--focus-ring-width)\",\n \"data-[focus-visible]:outline-(--color-ring)\",\n]);\n\n/** One section of the screen. */\nexport interface SideNavSection {\n /** The section's key, reported by `onSelectionChange`. */\n id: string;\n /** Its name in the menu, and the body's heading while it is chosen. */\n label: string;\n}\n\n/** A heading and the sections under it. */\nexport interface SideNavGroup {\n /** The plain heading the sections sit under. */\n label: string;\n /** The group's sections, in order. A group with none is not drawn. */\n sections: readonly SideNavSection[];\n}\n\nexport interface SideNavProps {\n /** What the menu is for. Names the navigation landmark and the list. */\n \"aria-label\": string;\n /** The sections, grouped. */\n groups: readonly SideNavGroup[];\n /** The chosen section's `id`. Controlled: the screen owns it (often in the URL). */\n selectedKey: string;\n /** Called with a section's `id` when a different one is chosen. */\n onSelectionChange: (key: string) => void;\n /**\n * The visible label of the Select that replaces the menu under 48rem wide.\n * @default \"Section\"\n */\n selectLabel?: string;\n /** One or two sentences under the chosen section's title. */\n description?: ReactNode;\n /** The chosen section's body. */\n children?: ReactNode;\n /** Extra classes for the root. Merged last. */\n className?: string;\n}\n\nexport const SideNav = forwardRef<HTMLDivElement, SideNavProps>(function SideNav(\n {\n \"aria-label\": label,\n groups,\n selectedKey,\n onSelectionChange,\n selectLabel = \"Section\",\n description,\n children,\n className,\n },\n ref,\n) {\n const shown = groups.filter((g) => g.sections.length > 0);\n const all = shown.flatMap((g) => g.sections);\n const current = all.find((s) => s.id === selectedKey);\n const headingId = useId();\n\n const choose = (key: Key | null) => {\n if (key != null && String(key) !== selectedKey) onSelectionChange(String(key));\n };\n const chooseFromList = (keys: Selection) => {\n if (keys === \"all\") return;\n choose(Array.from(keys)[0] ?? null);\n };\n\n return (\n <div ref={ref} data-slot=\"side-nav\" className={cn(sideNavVariants(), className)}>\n <div\n data-slot=\"side-nav-layout\"\n className=\"side-nav-wide:flex side-nav-wide:items-start side-nav-wide:gap-8\"\n >\n <nav aria-label={label} data-slot=\"side-nav-menu\" className={sideNavMenuVariants()}>\n <AriaListBox\n aria-label={label}\n selectionMode=\"single\"\n selectionBehavior=\"replace\"\n disallowEmptySelection\n selectedKeys={current ? [current.id] : []}\n onSelectionChange={chooseFromList}\n className=\"flex flex-col gap-3 outline-none\"\n >\n {shown.map((group) => (\n <AriaListBoxSection\n key={group.label}\n id={group.label}\n className=\"flex flex-col gap-0.5\"\n >\n <AriaHeader data-slot=\"side-nav-header\" className={sideNavHeaderVariants()}>\n {group.label}\n </AriaHeader>\n {group.sections.map((section) => (\n <AriaListBoxItem\n key={section.id}\n id={section.id}\n textValue={section.label}\n data-slot=\"side-nav-item\"\n className={sideNavItemVariants()}\n >\n {section.label}\n </AriaListBoxItem>\n ))}\n </AriaListBoxSection>\n ))}\n </AriaListBox>\n </nav>\n\n <div data-slot=\"side-nav-select\" className=\"mb-4 side-nav-wide:hidden\">\n <Select label={selectLabel} selectedKey={current?.id ?? null} onSelectionChange={choose}>\n {all.map((section) => (\n <SelectItem key={section.id} id={section.id}>\n {section.label}\n </SelectItem>\n ))}\n </Select>\n </div>\n\n <section aria-labelledby={headingId} data-slot=\"side-nav-body\" className=\"min-w-0 flex-1\">\n <h2\n id={headingId}\n className=\"font-display text-h4 leading-(--leading-snug) font-semibold text-foreground\"\n >\n {current?.label}\n </h2>\n {description == null ? null : (\n <p className=\"mt-1 max-w-3xl text-sm leading-(--leading-normal) text-muted-foreground\">\n {description}\n </p>\n )}\n <div className=\"mt-4\">{children}</div>\n </section>\n </div>\n </div>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAa,kBAAkB,IAAI,CAAC,0DAA0D,CAAC;AAE/F,MAAa,sBAAsB,IAAI,CACrC,mCACA,uHACF,CAAC;AAED,MAAa,wBAAwB,IAAI,CACvC,4GACF,CAAC;AAED,MAAa,sBAAsB,IAAI;CACrC;CACA;CAKA;CACA;CACA;CACA;CACA;CACA;CACA;CAGA;CACA;AACF,CAAC;AAwCD,MAAa,UAAU,WAAyC,SAAS,QACvE,EACE,cAAc,OACd,QACA,aACA,mBACA,cAAc,WACd,aACA,UACA,aAEF,KACA;CACA,MAAM,QAAQ,OAAO,QAAQ,MAAM,EAAE,SAAS,SAAS,CAAC;CACxD,MAAM,MAAM,MAAM,SAAS,MAAM,EAAE,QAAQ;CAC3C,MAAM,UAAU,IAAI,MAAM,MAAM,EAAE,OAAO,WAAW;CACpD,MAAM,YAAY,MAAM;CAExB,MAAM,UAAU,QAAoB;EAClC,IAAI,OAAO,QAAQ,OAAO,GAAG,MAAM,aAAa,kBAAkB,OAAO,GAAG,CAAC;CAC/E;CACA,MAAM,kBAAkB,SAAoB;EAC1C,IAAI,SAAS,OAAO;EACpB,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,MAAM,IAAI;CACpC;CAEA,OACE,oBAAC,OAAD;EAAU;EAAK,aAAU;EAAW,WAAW,GAAG,gBAAgB,GAAG,SAAS;EAC5E,UAAA,qBAAC,OAAD;GACE,aAAU;GACV,WAAU;GAFZ,UAAA;IAIE,oBAAC,OAAD;KAAK,cAAY;KAAO,aAAU;KAAgB,WAAW,oBAAoB;KAC/E,UAAA,oBAACA,SAAD;MACE,cAAY;MACZ,eAAc;MACd,mBAAkB;MAClB,wBAAA;MACA,cAAc,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC;MACxC,mBAAmB;MACnB,WAAU;MAET,UAAA,MAAM,KAAK,UACV,qBAACC,gBAAD;OAEE,IAAI,MAAM;OACV,WAAU;OAHZ,UAAA,CAKE,oBAACC,QAAD;QAAY,aAAU;QAAkB,WAAW,sBAAsB;QACtE,UAAA,MAAM;OACG,CAAA,GACX,MAAM,SAAS,KAAK,YACnB,oBAACC,aAAD;QAEE,IAAI,QAAQ;QACZ,WAAW,QAAQ;QACnB,aAAU;QACV,WAAW,oBAAoB;QAE9B,UAAA,QAAQ;OACM,GAPV,QAAQ,EAOE,CAClB,CACiB;MAlBb,GAAA,MAAM,KAkBO,CACrB;KACU,CAAA;IACV,CAAA;IAEL,oBAAC,OAAD;KAAK,aAAU;KAAkB,WAAU;KACzC,UAAA,oBAACC,UAAD;MAAQ,OAAO;MAAa,aAAa,SAAS,MAAM;MAAM,mBAAmB;MAC9E,UAAA,IAAI,KAAK,YACR,oBAAC,YAAD;OAA6B,IAAI,QAAQ;OACtC,UAAA,QAAQ;MACC,GAFK,QAAQ,EAEb,CACb;KACK,CAAA;IACL,CAAA;IAEL,qBAAC,WAAD;KAAS,mBAAiB;KAAW,aAAU;KAAgB,WAAU;KAAzE,UAAA;MACE,oBAAC,MAAD;OACE,IAAI;OACJ,WAAU;OAET,UAAA,SAAS;MACR,CAAA;MACH,eAAe,OAAO,OACrB,oBAAC,KAAD;OAAG,WAAU;OACV,UAAA;MACA,CAAA;MAEL,oBAAC,OAAD;OAAK,WAAU;OAAQ;MAAc,CAAA;KAC9B;;GACN;;CACF,CAAA;AAET,CAAC"}
@@ -27,7 +27,13 @@ export declare const skeletonVariants: (props?: import("class-variance-authority
27
27
  * @example
28
28
  * <Skeleton className="h-4 w-32" />
29
29
  */
30
- export type SkeletonProps = ComponentPropsWithoutRef<"div">;
31
- export declare const Skeleton: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
30
+ export interface SkeletonProps extends ComponentPropsWithoutRef<"div"> {
31
+ /**
32
+ * Position among stacked skeletons. Each block starts its pulse 90ms after
33
+ * the one above it, so a list dims in a wave instead of all at once.
34
+ */
35
+ index?: number;
36
+ }
37
+ export declare const Skeleton: import("react").ForwardRefExoticComponent<SkeletonProps & import("react").RefAttributes<HTMLDivElement>>;
32
38
  //#endregion
33
39
  //# sourceMappingURL=skeleton.d.ts.map
@@ -26,13 +26,17 @@ import { jsx } from "react/jsx-runtime";
26
26
  */
27
27
  const skeletonVariants = cva([
28
28
  "block bg-muted rounded-md",
29
- "motion-safe:animate-pulse",
29
+ "motion-safe:animate-skeleton-pulse",
30
30
  "box-border"
31
31
  ]);
32
- const Skeleton = forwardRef(function Skeleton({ className, ...props }, ref) {
32
+ const Skeleton = forwardRef(function Skeleton({ className, index, style, ...props }, ref) {
33
33
  return /* @__PURE__ */ jsx("div", {
34
34
  ref,
35
35
  ...props,
36
+ style: index ? {
37
+ animationDelay: `${index * 90}ms`,
38
+ ...style
39
+ } : style,
36
40
  "aria-hidden": "true",
37
41
  "data-slot": "skeleton",
38
42
  className: cn(skeletonVariants(), className)
@@ -1 +1 @@
1
- {"version":3,"file":"skeleton.js","names":[],"sources":["../../src/skeleton/skeleton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef, type ComponentPropsWithoutRef } from \"react\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Skeleton, ported from the legacy shadcn component.\n *\n * Census: 2 files, 33 uses, and every single one passes `className` and\n * nothing else -- the size always comes from the call site. So there is no\n * variant axis to invent here; the component is a surface and a pulse.\n *\n * THE PULSE DID NOT EXIST. `animate-pulse` names `--animate-pulse`, which\n * this repo does not define: it imports only `tailwindcss/utilities.css`,\n * never Tailwind's default theme, so both the custom property and the\n * `@keyframes pulse` are absent and the utility emits NO RULE AT ALL. The\n * class was present, tsc and ESLint were happy, and nothing moved. Same\n * failure mode as the Dialog's `max-w-lg`. This port adds the token\n * (`scale.json` -> `--animate-pulse`) and the keyframes\n * (`@seekalfred/styles/motion.css`).\n *\n * `bg-accent` becomes `bg-muted`: in the legacy theme `--accent` is\n * character-for-character `--muted` in both themes, so this is a rename to\n * the role Alfred actually has, not a colour change.\n */\nexport const skeletonVariants = cva([\n \"block bg-muted rounded-md\",\n // motion-safe: a full-screen page of these pulsing is exactly what\n // prefers-reduced-motion exists for. Without the animation it is still a\n // visible placeholder, which is the whole job.\n \"motion-safe:animate-pulse\",\n // The reset in @seekalfred/styles is OPT-IN, so a consumer may load none,\n // and every call site sizes this through className -- content-box would\n // add any padding they set on top of the height they asked for.\n \"box-border\",\n]);\n\n/**\n * A loading placeholder.\n *\n * @example\n * <Skeleton className=\"h-4 w-32\" />\n */\nexport type SkeletonProps = ComponentPropsWithoutRef<\"div\">;\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { className, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n {...props}\n // aria-hidden: a placeholder is not content. Thirty-three empty boxes\n // announced while a page loads is noise, and the loading STATE belongs\n // on the region being replaced (aria-busy), which only the consumer\n // can place.\n aria-hidden=\"true\"\n data-slot=\"skeleton\"\n className={cn(skeletonVariants(), className)}\n />\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,mBAAmB,IAAI;CAClC;CAIA;CAIA;AACF,CAAC;AAUD,MAAa,WAAW,WAA0C,SAAS,SACzE,EAAE,WAAW,GAAG,SAChB,KACA;CACA,OACE,oBAAC,OAAD;EACO;EACL,GAAI;EAKJ,eAAY;EACZ,aAAU;EACV,WAAW,GAAG,iBAAiB,GAAG,SAAS;CAC5C,CAAA;AAEL,CAAC"}
1
+ {"version":3,"file":"skeleton.js","names":[],"sources":["../../src/skeleton/skeleton.tsx"],"sourcesContent":["\"use client\";\n\nimport { cva } from \"class-variance-authority\";\nimport { forwardRef, type ComponentPropsWithoutRef } from \"react\";\n\nimport { cn } from \"../lib/cn.js\";\n\n/**\n * Skeleton, ported from the legacy shadcn component.\n *\n * Census: 2 files, 33 uses, and every single one passes `className` and\n * nothing else -- the size always comes from the call site. So there is no\n * variant axis to invent here; the component is a surface and a pulse.\n *\n * THE PULSE DID NOT EXIST. `animate-pulse` names `--animate-pulse`, which\n * this repo does not define: it imports only `tailwindcss/utilities.css`,\n * never Tailwind's default theme, so both the custom property and the\n * `@keyframes pulse` are absent and the utility emits NO RULE AT ALL. The\n * class was present, tsc and ESLint were happy, and nothing moved. Same\n * failure mode as the Dialog's `max-w-lg`. This port adds the token\n * (`scale.json` -> `--animate-pulse`) and the keyframes\n * (`@seekalfred/styles/motion.css`).\n *\n * `bg-accent` becomes `bg-muted`: in the legacy theme `--accent` is\n * character-for-character `--muted` in both themes, so this is a rename to\n * the role Alfred actually has, not a colour change.\n */\nexport const skeletonVariants = cva([\n \"block bg-muted rounded-md\",\n // A finite pulse (11 beats, then rest). motion-safe: a full-screen page of\n // these pulsing is exactly what prefers-reduced-motion exists for. Without the animation it is still a\n // visible placeholder, which is the whole job.\n \"motion-safe:animate-skeleton-pulse\",\n // The reset in @seekalfred/styles is OPT-IN, so a consumer may load none,\n // and every call site sizes this through className -- content-box would\n // add any padding they set on top of the height they asked for.\n \"box-border\",\n]);\n\n/**\n * A loading placeholder.\n *\n * @example\n * <Skeleton className=\"h-4 w-32\" />\n */\nexport interface SkeletonProps extends ComponentPropsWithoutRef<\"div\"> {\n /**\n * Position among stacked skeletons. Each block starts its pulse 90ms after\n * the one above it, so a list dims in a wave instead of all at once.\n */\n index?: number;\n}\n\nexport const Skeleton = forwardRef<HTMLDivElement, SkeletonProps>(function Skeleton(\n { className, index, style, ...props },\n ref,\n) {\n return (\n <div\n ref={ref}\n {...props}\n style={index ? { animationDelay: `${index * 90}ms`, ...style } : style}\n // aria-hidden: a placeholder is not content. Thirty-three empty boxes\n // announced while a page loads is noise, and the loading STATE belongs\n // on the region being replaced (aria-busy), which only the consumer\n // can place.\n aria-hidden=\"true\"\n data-slot=\"skeleton\"\n className={cn(skeletonVariants(), className)}\n />\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,MAAa,mBAAmB,IAAI;CAClC;CAIA;CAIA;AACF,CAAC;AAgBD,MAAa,WAAW,WAA0C,SAAS,SACzE,EAAE,WAAW,OAAO,OAAO,GAAG,SAC9B,KACA;CACA,OACE,oBAAC,OAAD;EACO;EACL,GAAI;EACJ,OAAO,QAAQ;GAAE,gBAAgB,GAAG,QAAQ,GAAG;GAAK,GAAG;EAAM,IAAI;EAKjE,eAAY;EACZ,aAAU;EACV,WAAW,GAAG,iBAAiB,GAAG,SAAS;CAC5C,CAAA;AAEL,CAAC"}
@@ -1,2 +1,2 @@
1
- import { Slider, SliderProps, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants } from "./slider.js";
2
- export { Slider, type SliderProps, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants };
1
+ import { Slider, SliderMark, SliderProps, SliderValue, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants } from "./slider.js";
2
+ export { Slider, type SliderMark, type SliderProps, type SliderValue, sliderBarVariants, sliderFillVariants, sliderThumbVariants, sliderTrackVariants, sliderVariants };
@@ -1,4 +1,4 @@
1
- import { ReactNode } from "react";
1
+ import { ReactElement, ReactNode, RefAttributes } from "react";
2
2
  import { SliderProps } from "react-aria-components";
3
3
  //#region src/slider/slider.d.ts
4
4
  /**
@@ -12,18 +12,21 @@ import { SliderProps } from "react-aria-components";
12
12
  *
13
13
  * `label` IS REQUIRED here, the same answer Progress and Dialog give.
14
14
  *
15
- * THE PALETTE DELIBERATELY DOES NOT MATCH SWITCH, and the reason is worth
16
- * stating because the two look like the same problem. A Switch has no
17
- * fill: its track is one colour and the thumb tells you the state, so
18
- * `border` unchecked and `primary-strong` checked works. A Slider has a
19
- * filled portion whose LENGTH is the value -- and `primary-strong` on a
20
- * `border` track is 1.01:1. The two halves would be the same grey and the
21
- * value would be invisible to anyone not reading the thumb position.
15
+ * LOOK (UX owner's colours): a thin, rounded track in primary 200 (light
16
+ * #FEEAE0, dark #441B00, role `slider-track`, no outline) with a fill in
17
+ * `primary-strong` (the dark orange, so it reads against the pale track) and a
18
+ * solid light thumb (`slider-thumb`) with a soft shadow. The label sits left
19
+ * and the value right. The fill's LENGTH is the value.
22
20
  *
23
- * So the track is `muted` with a `border` boundary and the fill is
24
- * `primary-strong`: fill against track 4.61:1, track against page 5.25:1,
25
- * thumb against fill 5.20:1, thumb edge against track 4.65:1. All four
26
- * pairs are in the build-failing contrast contract.
21
+ * Contrast, from contrast-pairs.json (build-failing): fill against the track
22
+ * 4.9:1 light / 8.3:1 dark; thumb against what it meets at its edge (the fill in
23
+ * light, a 2px ring in the page colour in dark -- see `shadow.slider-thumb`)
24
+ * 5.7:1 / 18.6:1. A near-white thumb on a light fill (dark) would otherwise
25
+ * melt into it, and the old dark thumb (the card colour) all but vanished on the
26
+ * page. The pale track is 1.12:1 / 1.3:1 on the page, under the 3:1 non-text
27
+ * floor, by the same accepted trade-off as `--border`; the state is the EDGE OF
28
+ * THE FILL (>= 4.9:1) plus the value text beside the label. The thumb is a 24px
29
+ * target and rests on the track with a shadow.
27
30
  *
28
31
  * Three legacy defects go with it: the focus ring was `ring-1`, a 1px
29
32
  * box-shadow that forced-colors discards entirely; the thumb border was
@@ -37,14 +40,22 @@ export declare const sliderTrackVariants: (props?: import("class-variance-author
37
40
  export declare const sliderBarVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
38
41
  export declare const sliderFillVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
39
42
  export declare const sliderThumbVariants: (props?: import("class-variance-authority/types").ClassProp | undefined) => string;
43
+ /** One thumb is a number; two thumbs are a `[low, high]` pair. */
44
+ export type SliderValue = number | [number, number];
45
+ /** A tick on the track, with an optional label printed under it. */
46
+ export interface SliderMark {
47
+ value: number;
48
+ label?: ReactNode;
49
+ }
40
50
  /**
41
51
  * A value along a range.
42
52
  *
43
53
  * @example
44
54
  * <Slider label="Input volume" defaultValue={40} />
45
55
  * <Slider label="Playback position" value={t} onChange={seek} formatOptions={{ style: "percent" }} />
56
+ * <Slider label="Budget" defaultValue={[2200, 8000]} minValue={0} maxValue={10000} step={100} />
46
57
  */
47
- interface SliderProps$1 extends Omit<SliderProps<number>, "className" | "style" | "children"> {
58
+ interface SliderProps$1<T extends SliderValue = number> extends Omit<SliderProps<number | number[]>, "className" | "style" | "children" | "value" | "defaultValue" | "onChange" | "onChangeEnd"> {
48
59
  /**
49
60
  * What the slider controls, and its accessible name.
50
61
  *
@@ -61,10 +72,31 @@ interface SliderProps$1 extends Omit<SliderProps<number>, "className" | "style"
61
72
  * distinguishable only by the thumb.
62
73
  */
63
74
  showValue?: boolean;
75
+ /** A number for one thumb, a `[low, high]` pair for a range with two thumbs. */
76
+ value?: T;
77
+ /** The uncontrolled value; its shape (a number or a pair) also picks one or two thumbs. */
78
+ defaultValue?: T;
79
+ onChange?: (value: T) => void;
80
+ /** Runs once a drag is released or a key changes the value, for work too heavy for every step. */
81
+ onChangeEnd?: (value: T) => void;
82
+ /** Grey helper text under the control. It also describes the slider to a screen reader. */
83
+ description?: ReactNode;
84
+ /**
85
+ * Tick dots on the track. A number draws a tick; a mark with a `label` also
86
+ * prints it under the track. Marks are decoration: the slider still reads out
87
+ * its own value, so pair them with `step` to make the ticks reachable.
88
+ */
89
+ marks?: (number | SliderMark)[];
90
+ /** Accessible names for the two range thumbs. @default ["Minimum", "Maximum"] */
91
+ thumbLabels?: [string, string];
92
+ /** Content before the track, such as an icon button that mutes. */
93
+ start?: ReactNode;
94
+ /** Content after the track. */
95
+ end?: ReactNode;
64
96
  /** Extra classes. Merged last, so they win conflicts with ours. */
65
97
  className?: string;
66
98
  }
67
- declare const Slider$1: import("react").ForwardRefExoticComponent<SliderProps$1 & import("react").RefAttributes<HTMLDivElement>>;
99
+ declare const Slider$1: <T extends SliderValue = number>(props: SliderProps$1<T> & RefAttributes<HTMLDivElement>) => ReactElement | null;
68
100
  //#endregion
69
101
  export { Slider$1 as Slider, SliderProps$1 as SliderProps };
70
102
  //# sourceMappingURL=slider.d.ts.map
@@ -1,9 +1,10 @@
1
1
  "use client";
2
2
  import { cn, cnAll } from "../lib/cn.js";
3
+ import { SwapText } from "../lib/swap-text.js";
3
4
  import { cva } from "class-variance-authority";
4
- import { forwardRef } from "react";
5
- import { Label, Slider, SliderOutput, SliderThumb, SliderTrack } from "react-aria-components";
6
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { Fragment, forwardRef, useContext, useId, useState } from "react";
6
+ import { Label, Slider, SliderOutput, SliderStateContext, SliderThumb, SliderTrack } from "react-aria-components";
7
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
8
  //#region src/slider/slider.tsx
8
9
  /**
9
10
  * Slider, ported from the legacy shadcn/Radix component.
@@ -16,18 +17,21 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
16
17
  *
17
18
  * `label` IS REQUIRED here, the same answer Progress and Dialog give.
18
19
  *
19
- * THE PALETTE DELIBERATELY DOES NOT MATCH SWITCH, and the reason is worth
20
- * stating because the two look like the same problem. A Switch has no
21
- * fill: its track is one colour and the thumb tells you the state, so
22
- * `border` unchecked and `primary-strong` checked works. A Slider has a
23
- * filled portion whose LENGTH is the value -- and `primary-strong` on a
24
- * `border` track is 1.01:1. The two halves would be the same grey and the
25
- * value would be invisible to anyone not reading the thumb position.
20
+ * LOOK (UX owner's colours): a thin, rounded track in primary 200 (light
21
+ * #FEEAE0, dark #441B00, role `slider-track`, no outline) with a fill in
22
+ * `primary-strong` (the dark orange, so it reads against the pale track) and a
23
+ * solid light thumb (`slider-thumb`) with a soft shadow. The label sits left
24
+ * and the value right. The fill's LENGTH is the value.
26
25
  *
27
- * So the track is `muted` with a `border` boundary and the fill is
28
- * `primary-strong`: fill against track 4.61:1, track against page 5.25:1,
29
- * thumb against fill 5.20:1, thumb edge against track 4.65:1. All four
30
- * pairs are in the build-failing contrast contract.
26
+ * Contrast, from contrast-pairs.json (build-failing): fill against the track
27
+ * 4.9:1 light / 8.3:1 dark; thumb against what it meets at its edge (the fill in
28
+ * light, a 2px ring in the page colour in dark -- see `shadow.slider-thumb`)
29
+ * 5.7:1 / 18.6:1. A near-white thumb on a light fill (dark) would otherwise
30
+ * melt into it, and the old dark thumb (the card colour) all but vanished on the
31
+ * page. The pale track is 1.12:1 / 1.3:1 on the page, under the 3:1 non-text
32
+ * floor, by the same accepted trade-off as `--border`; the state is the EDGE OF
33
+ * THE FILL (>= 4.9:1) plus the value text beside the label. The thumb is a 24px
34
+ * target and rests on the track with a shadow.
31
35
  *
32
36
  * Three legacy defects go with it: the focus ring was `ring-1`, a 1px
33
37
  * box-shadow that forced-colors discards entirely; the thumb border was
@@ -36,14 +40,20 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
36
40
  * form elements -- Radix renders a `<span role="slider">`, so a disabled
37
41
  * slider looked exactly like an enabled one.
38
42
  */
39
- const sliderVariants = cva(["flex w-full flex-col gap-2 box-border font-sans"]);
40
- const sliderTrackVariants = cva(["relative flex w-full items-center", "h-6"]);
41
- const sliderBarVariants = cva(["absolute h-2 w-full rounded-pill box-border", "bg-muted border-(length:--border-width) border-border"]);
42
- const sliderFillVariants = cva(["absolute h-2 rounded-pill bg-primary-strong"]);
43
+ const sliderVariants = cva(["flex w-full flex-col gap-2 box-border font-sans", "data-[disabled]:opacity-(--opacity-disabled)"]);
44
+ const sliderTrackVariants = cva([
45
+ "relative mx-3 flex items-center",
46
+ "h-6",
47
+ "slider-track"
48
+ ]);
49
+ const sliderBarVariants = cva(["absolute h-1.5 w-full rounded-pill bg-slider-track"]);
50
+ const sliderFillVariants = cva(["absolute h-1.5 rounded-pill bg-primary-strong", "slider-fill"]);
43
51
  const sliderThumbVariants = cva([
44
- "size-6 rounded-full box-border",
45
- "bg-background border-(length:--border-width) border-border shadow-surface",
52
+ "size-6 rounded-circle box-border",
53
+ "top-1/2",
54
+ "bg-slider-thumb",
46
55
  "cursor-grab data-[dragging]:cursor-grabbing",
56
+ "slider-thumb",
47
57
  "outline-none",
48
58
  "data-[focus-visible]:outline-solid",
49
59
  "data-[focus-visible]:outline-(length:--focus-ring-width)",
@@ -51,41 +61,169 @@ const sliderThumbVariants = cva([
51
61
  "data-[focus-visible]:outline-(--color-ring)",
52
62
  "data-[disabled]:cursor-not-allowed"
53
63
  ]);
54
- const Slider$1 = forwardRef(function Slider$2({ label, labelHidden, showValue = true, className, ...props }, ref) {
64
+ /** A tick dot on the track: dim on the unfilled side, light where the fill passes under it. */
65
+ const sliderTickClasses = "pointer-events-none absolute top-1/2 size-1 -translate-1/2 rounded-pill bg-foreground/30 data-[on]:bg-background/60 motion-safe:transition-colors motion-safe:duration-(--duration-quick)";
66
+ /** A step label under its tick. */
67
+ const sliderMarkLabelClasses = "slider-mark-label absolute top-0 whitespace-nowrap text-xs leading-(--leading-normal) text-text-secondary tabular-nums data-[on]:text-foreground motion-safe:transition-colors motion-safe:duration-(--duration-quick)";
68
+ /**
69
+ * Text that rolls when its value changes: a larger value rises in from below, a
70
+ * smaller one drops in from above. The caller's own text stays for a screen
71
+ * reader; the copy the eye sees is aria-hidden.
72
+ */
73
+ function RollingText({ value, text }) {
74
+ const [trail, setTrail] = useState({
75
+ value,
76
+ dir: 1
77
+ });
78
+ if (trail.value !== value) setTrail({
79
+ value,
80
+ dir: value > trail.value ? 1 : -1
81
+ });
82
+ const dir = trail.value === value ? trail.dir : value > trail.value ? 1 : -1;
83
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx("span", {
84
+ className: "sr-only",
85
+ children: text
86
+ }), /* @__PURE__ */ jsx("span", {
87
+ "aria-hidden": "true",
88
+ children: /* @__PURE__ */ jsx(SwapText, {
89
+ swapKey: text,
90
+ dir,
91
+ motion: "roll",
92
+ className: "inline-block",
93
+ children: text
94
+ })
95
+ })] });
96
+ }
97
+ const RANGE_DASH = " – ";
98
+ /** Step labels under the track, each centred on its tick (the end ones hold inside the component). */
99
+ function SliderMarkLabels({ marks, percentOf, minValue, maxValue }) {
100
+ const values = useContext(SliderStateContext)?.values ?? [];
101
+ const isOn = (v) => values.length > 1 ? v >= values[0] && v <= values[values.length - 1] : v <= (values[0] ?? minValue);
102
+ return /* @__PURE__ */ jsx("div", {
103
+ "aria-hidden": "true",
104
+ "data-slot": "slider-marks",
105
+ className: "relative col-start-2 row-start-2 mx-3 mt-1 h-5",
106
+ children: marks.map((mark) => mark.label == null ? null : /* @__PURE__ */ jsx("span", {
107
+ "data-slot": "slider-mark-label",
108
+ "data-on": isOn(mark.value) || void 0,
109
+ "data-edge": mark.value <= minValue ? "start" : mark.value >= maxValue ? "end" : void 0,
110
+ className: sliderMarkLabelClasses,
111
+ style: { left: `${percentOf(mark.value)}%` },
112
+ children: mark.label
113
+ }, mark.value))
114
+ });
115
+ }
116
+ const Slider$1 = forwardRef(function Slider$2({ label, labelHidden, showValue = true, description, marks, thumbLabels = ["Minimum", "Maximum"], start, end, className, "aria-describedby": describedByProp, ...props }, ref) {
117
+ const descriptionId = useId();
118
+ const describedBy = [describedByProp, description == null ? null : descriptionId].filter(Boolean).join(" ");
119
+ const minValue = props.minValue ?? 0;
120
+ const maxValue = props.maxValue ?? 100;
121
+ const markList = (marks ?? []).map((mark) => typeof mark === "number" ? { value: mark } : mark);
122
+ const percentOf = (v) => maxValue === minValue ? 0 : (v - minValue) / (maxValue - minValue) * 100;
55
123
  return /* @__PURE__ */ jsxs(Slider, {
56
124
  ref,
57
125
  ...props,
58
126
  "data-slot": "slider",
59
127
  className: cn(sliderVariants(), className),
60
- children: [/* @__PURE__ */ jsxs("div", {
61
- className: cnAll("flex items-center justify-between gap-2", labelHidden && "sr-only"),
62
- children: [/* @__PURE__ */ jsx(Label, {
63
- "data-slot": "slider-label",
64
- className: "text-sm leading-(--leading-normal) text-foreground",
65
- children: label
66
- }), showValue ? /* @__PURE__ */ jsx(SliderOutput, {
67
- "data-slot": "slider-output",
68
- className: "text-sm leading-(--leading-normal) text-muted-foreground"
69
- }) : null]
70
- }), /* @__PURE__ */ jsx(SliderTrack, {
71
- "data-slot": "slider-track",
72
- className: sliderTrackVariants(),
73
- children: ({ state }) => /* @__PURE__ */ jsxs(Fragment, { children: [
74
- /* @__PURE__ */ jsx("div", {
75
- "data-slot": "slider-bar",
76
- className: sliderBarVariants()
77
- }),
78
- /* @__PURE__ */ jsx("div", {
79
- "data-slot": "slider-fill",
80
- className: sliderFillVariants(),
81
- style: { width: `${state.getThumbPercent(0) * 100}%` }
82
- }),
83
- /* @__PURE__ */ jsx(SliderThumb, {
84
- "data-slot": "slider-thumb",
85
- className: sliderThumbVariants()
86
- })
87
- ] })
88
- })]
128
+ children: [
129
+ /* @__PURE__ */ jsxs("div", {
130
+ className: cnAll("flex items-baseline justify-between gap-4", labelHidden && "sr-only"),
131
+ children: [/* @__PURE__ */ jsx(Label, {
132
+ "data-slot": "slider-label",
133
+ className: "text-sm leading-(--leading-normal) font-medium text-foreground",
134
+ children: label
135
+ }), showValue ? /* @__PURE__ */ jsx(SliderOutput, {
136
+ "data-slot": "slider-output",
137
+ className: "text-sm leading-(--leading-normal) whitespace-nowrap text-text-secondary tabular-nums",
138
+ children: ({ state }) => state.values.map((_, i) => /* @__PURE__ */ jsxs(Fragment, { children: [i > 0 ? /* @__PURE__ */ jsx("span", {
139
+ "aria-hidden": "true",
140
+ children: RANGE_DASH
141
+ }) : null, /* @__PURE__ */ jsx(RollingText, {
142
+ value: state.getThumbValue(i),
143
+ text: state.getThumbValueLabel(i)
144
+ })] }, i))
145
+ }) : null]
146
+ }),
147
+ /* @__PURE__ */ jsxs("div", {
148
+ className: "grid grid-cols-[auto_minmax(0,1fr)_auto] items-center",
149
+ children: [
150
+ start ? /* @__PURE__ */ jsx("div", {
151
+ className: "col-start-1 row-start-1 me-3 flex",
152
+ children: start
153
+ }) : null,
154
+ /* @__PURE__ */ jsx(SliderTrack, {
155
+ "data-slot": "slider-track",
156
+ className: cnAll(sliderTrackVariants(), "col-start-2 row-start-1"),
157
+ children: ({ state }) => {
158
+ const count = state.values.length;
159
+ const low = count > 1 ? state.getThumbPercent(0) * 100 : 0;
160
+ const high = state.getThumbPercent(count - 1) * 100;
161
+ const dragging = state.values.some((_, i) => state.isThumbDragging(i));
162
+ const isOn = (v) => count > 1 ? v >= state.values[0] && v <= state.values[count - 1] : v <= state.values[0];
163
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [
164
+ /* @__PURE__ */ jsx("div", {
165
+ "data-slot": "slider-bar",
166
+ className: sliderBarVariants()
167
+ }),
168
+ /* @__PURE__ */ jsx("div", {
169
+ "data-slot": "slider-fill",
170
+ className: sliderFillVariants(),
171
+ "data-dragging": dragging || void 0,
172
+ style: {
173
+ left: `${low}%`,
174
+ width: `${high - low}%`
175
+ }
176
+ }),
177
+ markList.map((mark) => /* @__PURE__ */ jsx("span", {
178
+ "aria-hidden": "true",
179
+ "data-slot": "slider-tick",
180
+ "data-on": isOn(mark.value) || void 0,
181
+ className: sliderTickClasses,
182
+ style: { left: `${percentOf(mark.value)}%` }
183
+ }, mark.value)),
184
+ state.values.map((_, i) => /* @__PURE__ */ jsx(SliderThumb, {
185
+ index: i,
186
+ "aria-label": count > 1 ? thumbLabels[i] : void 0,
187
+ "aria-describedby": describedBy || void 0,
188
+ "data-slot": "slider-thumb",
189
+ className: sliderThumbVariants(),
190
+ children: ({ isDragging, isFocusVisible, state: thumbState }) => /* @__PURE__ */ jsx("span", {
191
+ "aria-hidden": "true",
192
+ className: "slider-bubble-anchor pointer-events-none absolute bottom-full left-1/2 mb-2",
193
+ style: { "--at": thumbState.getThumbPercent(i) * 100 },
194
+ children: /* @__PURE__ */ jsx("span", {
195
+ "data-slot": "slider-bubble",
196
+ "data-shown": isDragging || isFocusVisible || void 0,
197
+ className: "slider-bubble block whitespace-nowrap rounded-pill bg-foreground px-3 py-1 text-sm leading-none font-medium text-background shadow-surface",
198
+ children: /* @__PURE__ */ jsx(RollingText, {
199
+ value: thumbState.getThumbValue(i),
200
+ text: thumbState.getThumbValueLabel(i)
201
+ })
202
+ })
203
+ })
204
+ }, i))
205
+ ] });
206
+ }
207
+ }),
208
+ end ? /* @__PURE__ */ jsx("div", {
209
+ className: "col-start-3 row-start-1 ms-3 flex",
210
+ children: end
211
+ }) : null,
212
+ markList.some((mark) => mark.label != null) ? /* @__PURE__ */ jsx(SliderMarkLabels, {
213
+ marks: markList,
214
+ percentOf,
215
+ minValue,
216
+ maxValue
217
+ }) : null
218
+ ]
219
+ }),
220
+ description != null ? /* @__PURE__ */ jsx("p", {
221
+ id: descriptionId,
222
+ "data-slot": "slider-description",
223
+ className: "m-0 text-sm leading-(--leading-normal) text-text-secondary",
224
+ children: description
225
+ }) : null
226
+ ]
89
227
  });
90
228
  });
91
229
  //#endregion