@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
@@ -1,11 +1,15 @@
1
1
  "use client";
2
2
  import { cn, cnAll } from "../lib/cn.js";
3
3
  import { Button as Button$1 } from "../button/button.js";
4
+ import { SwapText } from "../lib/swap-text.js";
5
+ import { useFlip } from "../lib/flip.js";
6
+ import { Checkbox as Checkbox$1 } from "../checkbox/checkbox.js";
4
7
  import { Select as Select$1, SelectItem } from "../select/select.js";
5
8
  import { cva } from "class-variance-authority";
6
- import { forwardRef, useMemo, useState } from "react";
9
+ import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
7
10
  import { Cell, Column, Row, Table, TableBody, TableFooter, TableHeader } from "react-aria-components";
8
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
11
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
12
+ import { flushSync } from "react-dom";
9
13
  //#region src/table/table.tsx
10
14
  /**
11
15
  * Table, ported from the legacy shadcn table onto React Aria's Table.
@@ -58,10 +62,29 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
58
62
  *
59
63
  * overflow-hidden is load-bearing: the header fill runs to the table's edge and
60
64
  * would square off the rounded corners without it.
65
+ *
66
+ * THE EDGE SHADOWS. A table wider than its card scrolls inside it, and on a
67
+ * trackpad the scrollbar only shows while scrolling, so a cut-off column looks
68
+ * like the table's last one. The card carries `data-overflow-start` and
69
+ * `data-overflow-end` while columns are hidden on that side (the Table sets
70
+ * them from its scroll position), and each draws a shadow on that edge: the
71
+ * text colour fading to nothing at 15%, so it follows the theme. With a sticky
72
+ * first column the start is never hidden behind the card's edge, so the start
73
+ * shadow stays off and the sticky column's own divider does that job.
61
74
  */
62
- const tableCardVariants = cva(["w-full box-border overflow-hidden"], {
75
+ const tableCardVariants = cva([
76
+ "w-full box-border overflow-hidden relative isolate",
77
+ "before:pointer-events-none before:absolute before:inset-y-0 before:start-0 before:z-2 before:w-6",
78
+ "before:bg-linear-to-r rtl:before:bg-linear-to-l before:from-foreground before:to-transparent",
79
+ "before:opacity-0 motion-safe:before:transition-opacity",
80
+ "data-[overflow-start]:not-data-[sticky-first]:before:opacity-15",
81
+ "after:pointer-events-none after:absolute after:inset-y-0 after:end-0 after:z-2 after:w-6",
82
+ "after:bg-linear-to-l rtl:after:bg-linear-to-r after:from-foreground after:to-transparent",
83
+ "after:opacity-0 motion-safe:after:transition-opacity",
84
+ "data-[overflow-end]:after:opacity-15"
85
+ ], {
63
86
  variants: { frame: {
64
- card: "rounded-md border-(length:--border-width) border-separator bg-background",
87
+ card: "rounded-panel border-(length:--border-width) border-separator bg-surface",
65
88
  none: ""
66
89
  } },
67
90
  defaultVariants: { frame: "card" }
@@ -85,12 +108,16 @@ function renderValue(column, value, row) {
85
108
  /** Reserved id for the chevron column, so it cannot collide with a real one. */
86
109
  const CHEVRON_COLUMN_ID = "__table_row_action";
87
110
  const CHEVRON_CELL = "w-10 px-0 text-center";
111
+ /** Reserved id for the checkbox column of a selectable table. */
112
+ const SELECT_COLUMN_ID = "__table_row_select";
113
+ /** The checkbox column is as wide as its box needs, with the table's usual inset on its leading side. */
114
+ const SELECT_CELL = "w-11 px-0 ps-(--density-row-pad-x)";
88
115
  /** The horizontal scroll container. The table owns it; 5 of 6 consumers built one by hand. */
89
116
  const tableScrollVariants = cva(["w-full overflow-x-auto box-border"]);
90
117
  const tableVariants = cva([
91
118
  "w-full border-collapse box-border",
92
119
  "font-sans text-base leading-(--leading-normal)",
93
- "bg-background text-foreground"
120
+ "bg-surface text-foreground"
94
121
  ]);
95
122
  /**
96
123
  * The header is near-white, not a grey band.
@@ -116,8 +143,24 @@ const tablePaginationVariants = cva([
116
143
  "px-(--density-row-pad-x) py-(--density-row-pad-y)",
117
144
  "font-sans text-sm leading-(--leading-normal) text-muted-foreground"
118
145
  ]);
146
+ /**
147
+ * The bar under a selectable table: how many rows, or how many are selected,
148
+ * and the action that clears them. A sibling of the table, like the pagination.
149
+ */
150
+ const tableSelectionBarVariants = cva([
151
+ "flex min-h-11 items-center justify-between gap-(--density-control-gap) box-border",
152
+ "border-t-(length:--border-width) border-t-separator",
153
+ "ps-(--density-row-pad-x) pe-2 font-sans text-sm leading-(--leading-normal)",
154
+ "text-muted-foreground data-[active]:text-foreground",
155
+ "motion-safe:transition-colors motion-safe:duration-(--duration-standard) motion-safe:ease-settle"
156
+ ]);
157
+ /**
158
+ * What stands in for the rows when there are none: centred, muted, and tall
159
+ * enough to read as a state rather than as a squashed row.
160
+ */
161
+ const tableEmptyVariants = cva(["flex min-h-30 items-center justify-center px-(--density-row-pad-x) py-6", "box-border text-center text-sm text-muted-foreground wrap-anywhere"]);
119
162
  /** The footer band. Heavier than a row rule, because it closes the table. */
120
- const tableFooterVariants = cva(["bg-background font-semibold text-foreground", "border-t-(length:--border-width) border-t-border"]);
163
+ const tableFooterVariants = cva(["bg-surface font-semibold text-foreground", "border-t-(length:--border-width) border-t-border"]);
121
164
  /** Shared focus treatment. Authored once; both the column header and the row take it. */
122
165
  const FOCUS_RING = [
123
166
  "outline-none",
@@ -129,6 +172,7 @@ const FOCUS_RING = [
129
172
  const tableColumnVariants = cva([
130
173
  "px-(--density-row-pad-x) py-(--density-row-pad-y)",
131
174
  "box-border align-middle text-sm font-semibold select-none",
175
+ "data-[sorted]:bg-foreground/3 data-[sorted]:text-foreground",
132
176
  ...FOCUS_RING,
133
177
  "data-[allows-sorting]:cursor-pointer"
134
178
  ], {
@@ -149,9 +193,10 @@ const tableColumnVariants = cva([
149
193
  }
150
194
  });
151
195
  const tableRowVariants = cva([
152
- "box-border",
196
+ "group/row box-border bg-surface",
153
197
  "motion-safe:transition-colors motion-safe:duration-(--duration-fast) motion-safe:ease-standard",
154
198
  "hover:bg-muted data-[hovered]:bg-muted data-[focused]:bg-muted",
199
+ "data-[selected]:bg-muted data-[selected]:hover:bg-separator data-[selected]:data-[hovered]:bg-separator",
155
200
  "data-[highlighted]:bg-primary-subtle",
156
201
  ...FOCUS_RING
157
202
  ], {
@@ -172,7 +217,8 @@ const tableRowVariants = cva([
172
217
  });
173
218
  const tableCellVariants = cva([
174
219
  "px-(--density-row-pad-x) py-(--density-row-pad-y)",
175
- "box-border align-middle",
220
+ "box-border align-middle wrap-anywhere",
221
+ "data-[sorted]:bg-foreground/3",
176
222
  ...FOCUS_RING
177
223
  ], {
178
224
  variants: {
@@ -182,7 +228,7 @@ const tableCellVariants = cva([
182
228
  end: "text-end"
183
229
  },
184
230
  numeric: {
185
- true: "tabular-nums",
231
+ true: "tabular-nums whitespace-nowrap",
186
232
  false: ""
187
233
  }
188
234
  },
@@ -192,6 +238,78 @@ const tableCellVariants = cva([
192
238
  }
193
239
  });
194
240
  /**
241
+ * The first cell of every row, held in place while the rest scroll under it
242
+ * (`stickyFirstColumn`).
243
+ *
244
+ * A sticky cell is opaque -- otherwise the scrolled cells show through it -- so
245
+ * it repaints whatever fill its row has: the row's hover, focus and highlight
246
+ * through `group/row`, the stripe when striped. A divider on its trailing edge
247
+ * marks where the frozen column ends.
248
+ */
249
+ const tableStickyCellVariants = cva(["sticky start-0 z-1", "border-e-(length:--border-width) border-e-separator"], {
250
+ variants: {
251
+ part: {
252
+ header: "bg-header-fill",
253
+ bare: "bg-surface",
254
+ body: [
255
+ "bg-surface",
256
+ "group-hover/row:bg-muted group-data-[hovered]/row:bg-muted group-data-[focused]/row:bg-muted",
257
+ "group-data-[highlighted]/row:bg-primary-subtle"
258
+ ]
259
+ },
260
+ striped: {
261
+ true: "",
262
+ false: ""
263
+ }
264
+ },
265
+ compoundVariants: [{
266
+ part: "body",
267
+ striped: true,
268
+ class: "group-even/row:bg-row-stripe"
269
+ }],
270
+ defaultVariants: {
271
+ part: "body",
272
+ striped: false
273
+ }
274
+ });
275
+ /**
276
+ * Which sides of a scroll container hide content right now.
277
+ *
278
+ * Read from the container on scroll and whenever it or the table resizes, so
279
+ * a window resize or rows arriving later update it too. scrollLeft runs
280
+ * negative in a right-to-left layout; the distance travelled is what counts.
281
+ */
282
+ function useScrollEdges(scroller) {
283
+ const [edges, setEdges] = useState({
284
+ start: false,
285
+ end: false
286
+ });
287
+ useEffect(() => {
288
+ const el = scroller.current;
289
+ if (!el) return;
290
+ const update = () => {
291
+ const hidden = el.scrollWidth - el.clientWidth;
292
+ const travelled = Math.abs(el.scrollLeft);
293
+ const start = hidden > 1 && travelled > 1;
294
+ const end = hidden > 1 && travelled < hidden - 1;
295
+ setEdges((prev) => prev.start === start && prev.end === end ? prev : {
296
+ start,
297
+ end
298
+ });
299
+ };
300
+ update();
301
+ el.addEventListener("scroll", update, { passive: true });
302
+ const resize = typeof ResizeObserver === "undefined" ? void 0 : new ResizeObserver(update);
303
+ resize?.observe(el);
304
+ if (el.firstElementChild) resize?.observe(el.firstElementChild);
305
+ return () => {
306
+ el.removeEventListener("scroll", update);
307
+ resize?.disconnect();
308
+ };
309
+ }, [scroller]);
310
+ return edges;
311
+ }
312
+ /**
195
313
  * Both glyphs are aria-hidden and neither is focusable.
196
314
  *
197
315
  * The chevron says "this row does something"; the ROW is what React Aria makes
@@ -258,7 +376,7 @@ function RowChevronGlyph() {
258
376
  });
259
377
  }
260
378
  function SortCaretGlyph({ direction }) {
261
- return /* @__PURE__ */ jsx("svg", {
379
+ return /* @__PURE__ */ jsxs("svg", {
262
380
  "data-slot": "table-sort-caret",
263
381
  "data-direction": direction,
264
382
  "aria-hidden": "true",
@@ -268,8 +386,67 @@ function SortCaretGlyph({ direction }) {
268
386
  strokeWidth: "1.5",
269
387
  strokeLinecap: "round",
270
388
  strokeLinejoin: "round",
271
- className: "size-(--icon-sm) ms-1 inline-block align-middle",
272
- children: direction === "none" ? /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("path", { d: "m4 7 4-4 4 4" }), /* @__PURE__ */ jsx("path", { d: "m4 9 4 4 4-4" })] }) : /* @__PURE__ */ jsx("path", { d: direction === "ascending" ? "m4 10 4-4 4 4" : "m4 6 4 4 4-4" })
389
+ className: "table-sort-caret size-(--icon-sm) ms-1 inline-block align-middle",
390
+ children: [/* @__PURE__ */ jsxs("g", {
391
+ className: "table-sort-idle",
392
+ children: [/* @__PURE__ */ jsx("path", { d: "m4 7 4-4 4 4" }), /* @__PURE__ */ jsx("path", { d: "m4 9 4 4 4-4" })]
393
+ }), /* @__PURE__ */ jsxs("g", {
394
+ className: "table-sort-arrow",
395
+ children: [/* @__PURE__ */ jsx("path", { d: "M8 13V3" }), /* @__PURE__ */ jsx("path", { d: "m4.5 6.5 3.5-3.5 3.5 3.5" })]
396
+ })]
397
+ });
398
+ }
399
+ /** 1 when the value grew, -1 when it shrank: the way a changed number swaps. Updated during render. */
400
+ function useChangeDirection(value) {
401
+ const [seen, setSeen] = useState({
402
+ value,
403
+ dir: 1
404
+ });
405
+ if (seen.value !== value) setSeen({
406
+ value,
407
+ dir: value < seen.value ? -1 : 1
408
+ });
409
+ return seen.dir;
410
+ }
411
+ /**
412
+ * The bar under a selectable table. With nothing chosen it counts the rows
413
+ * ("12 rows"); with some chosen it counts them ("3 selected") and offers the
414
+ * way back. The number and the word swap in place as they change.
415
+ */
416
+ function SelectionBar({ count, total, labels, onClear }) {
417
+ const shown = count || total;
418
+ const noun = count ? labels.selected : shown === 1 ? labels.item.one : labels.item.other;
419
+ const direction = useChangeDirection(shown);
420
+ return /* @__PURE__ */ jsxs("div", {
421
+ "data-slot": "table-selection-bar",
422
+ "data-active": count > 0 || void 0,
423
+ className: cnAll(tableSelectionBarVariants()),
424
+ children: [/* @__PURE__ */ jsxs("span", {
425
+ "data-slot": "table-selection-count",
426
+ className: "inline-flex items-baseline gap-1",
427
+ children: [
428
+ /* @__PURE__ */ jsx(SwapText, {
429
+ swapKey: String(shown),
430
+ dir: direction,
431
+ className: "inline-block tabular-nums",
432
+ children: shown
433
+ }),
434
+ " ",
435
+ /* @__PURE__ */ jsx(SwapText, {
436
+ swapKey: noun,
437
+ dir: count ? 1 : -1,
438
+ className: "inline-block",
439
+ children: noun
440
+ })
441
+ ]
442
+ }), count > 0 ? /* @__PURE__ */ jsx(Button$1, {
443
+ variant: "ghost",
444
+ size: "sm",
445
+ "data-slot": "table-selection-clear",
446
+ className: "motion-safe:animate-fade-in",
447
+ onPress: onClear,
448
+ children: labels.clear
449
+ }) : null]
273
450
  });
274
451
  }
275
452
  /** Builds columns that keep each column's own value type. */
@@ -279,9 +456,11 @@ function createColumns() {
279
456
  /**
280
457
  * A data table.
281
458
  *
282
- * Maturity: **beta**. Selection, row expansion, filtering, grouping, the total
283
- * row and pagination are deliberately absent -- each had one consumer or none
284
- * across the six legacy tables, and the stateful ones belong to DataGrid.
459
+ * Maturity: **beta**. Row expansion, filtering and grouping are deliberately
460
+ * absent -- each had one consumer or none across the six legacy tables, and the
461
+ * stateful ones belong to DataGrid. Sorting glides: when a sort reorders the
462
+ * rows, each slides to its new place instead of jumping (the lib/flip helper).
463
+ * Selection is opt-in with `selectionMode="multiple"`.
285
464
  *
286
465
  * @example
287
466
  * const { column } = createColumns<Channel>();
@@ -317,7 +496,7 @@ function compareKeys(a, b) {
317
496
  if (typeof a === "number" && typeof b === "number") return a - b;
318
497
  return String(a).localeCompare(String(b));
319
498
  }
320
- const Table$1 = forwardRef(function Table$2({ data, columns, getRowId, variant, sortDescriptor, defaultSortDescriptor, onSortChange, onRowAction, isRowHighlighted, rowClassName, frame, headerType, headerFill, striped, totalRow, empty, minWidth, pageSize, pageSizeOptions, onPageSizeChange, pageLabels, className, ...props }, ref) {
499
+ const Table$1 = forwardRef(function Table$2({ data, columns, getRowId, variant, sortDescriptor, defaultSortDescriptor, onSortChange, onRowAction, isRowHighlighted, rowClassName, selectionMode, selectedKeys, defaultSelectedKeys, onSelectionChange, selectionLabels, frame, headerType, headerFill, striped, totalRow, empty, minWidth, stickyFirstColumn, pageSize, pageSizeOptions, onPageSizeChange, pageLabels, className, ...props }, ref) {
321
500
  const isControlled = sortDescriptor !== void 0;
322
501
  const [uncontrolledSort, setUncontrolledSort] = useState(defaultSortDescriptor);
323
502
  const activeSort = isControlled ? sortDescriptor : uncontrolledSort;
@@ -348,167 +527,264 @@ const Table$1 = forwardRef(function Table$2({ data, columns, getRowId, variant,
348
527
  rowsPerPage: pageLabels?.rowsPerPage ?? "Rows per page"
349
528
  };
350
529
  const rowsByKey = new Map(data.map((row) => [getRowId(row), row]));
530
+ const selectable = selectionMode === "multiple";
531
+ const [uncontrolledSelection, setUncontrolledSelection] = useState(defaultSelectedKeys ?? /* @__PURE__ */ new Set());
532
+ const selection = selectedKeys ?? uncontrolledSelection;
533
+ const commitSelection = (keys) => {
534
+ if (selectedKeys === void 0) setUncontrolledSelection(keys);
535
+ onSelectionChange?.(keys);
536
+ };
537
+ const selectedCount = selection === "all" ? visibleRows.length : [...selection].filter((key) => rowsByKey.has(key)).length;
538
+ const selectLabels = {
539
+ item: selectionLabels?.item ?? {
540
+ one: "row",
541
+ other: "rows"
542
+ },
543
+ selected: selectionLabels?.selected ?? "selected",
544
+ clear: selectionLabels?.clear ?? "Clear selection"
545
+ };
546
+ const sortedColumn = activeSort?.column;
351
547
  const hasWidths = columns.some((column) => column.width !== void 0);
352
548
  const tableStyle = {};
353
549
  if (minWidth !== void 0) tableStyle.minWidth = minWidth;
354
550
  if (hasWidths) tableStyle.tableLayout = "fixed";
551
+ const scrollRef = useRef(null);
552
+ const edges = useScrollEdges(scrollRef);
553
+ const [rowOrder, setRowOrder] = useState("");
554
+ useEffect(() => {
555
+ const root = scrollRef.current;
556
+ if (!root) return;
557
+ let last = "";
558
+ const look = () => {
559
+ const next = Array.from(root.querySelectorAll("tbody > [data-flip]")).map((row) => row.dataset.flip).join("\0");
560
+ if (next === last) return;
561
+ last = next;
562
+ flushSync(() => setRowOrder(next));
563
+ };
564
+ look();
565
+ const observer = new MutationObserver(look);
566
+ observer.observe(root, {
567
+ childList: true,
568
+ subtree: true
569
+ });
570
+ return () => observer.disconnect();
571
+ }, []);
572
+ useFlip(scrollRef, rowOrder, "var(--duration-smooth)", "var(--ease-smooth)", true);
573
+ const stickyCell = (part) => tableStickyCellVariants({
574
+ part,
575
+ striped: part === "body" && !!striped
576
+ });
355
577
  return /* @__PURE__ */ jsxs("div", {
356
578
  "data-slot": "table-card",
579
+ "data-overflow-start": edges.start || void 0,
580
+ "data-overflow-end": edges.end || void 0,
581
+ "data-sticky-first": stickyFirstColumn || void 0,
357
582
  className: cnAll(tableCardVariants({ frame })),
358
- children: [/* @__PURE__ */ jsx("div", {
359
- "data-slot": "table-scroll",
360
- className: cnAll(tableScrollVariants()),
361
- children: /* @__PURE__ */ jsxs(Table, {
362
- ref,
363
- ...props,
364
- "data-slot": "table",
365
- className: cn(tableVariants(), className),
366
- style: tableStyle,
367
- sortDescriptor: activeSort,
368
- onSortChange: (descriptor) => {
369
- if (!isControlled) setUncontrolledSort(descriptor);
370
- setPage(1);
371
- onSortChange?.(descriptor);
372
- },
373
- onRowAction: onRowAction ? (key) => {
374
- const row = rowsByKey.get(key);
375
- if (row !== void 0) onRowAction(row);
376
- } : void 0,
377
- children: [
378
- /* @__PURE__ */ jsxs(TableHeader, {
379
- "data-slot": "table-header",
380
- className: cnAll(tableHeaderVariants({ headerFill })),
381
- children: [columns.map((column) => /* @__PURE__ */ jsxs(Column, {
382
- id: column.id,
383
- isRowHeader: column === columns[0],
384
- allowsSorting: column.sortable,
385
- "data-slot": "table-column",
386
- className: cnAll(tableColumnVariants({
387
- align: column.align ?? (column.numeric ? "end" : void 0),
388
- headerType
389
- })),
390
- style: column.width === void 0 ? void 0 : { width: column.width },
391
- children: [column.header, column.sortable ? /* @__PURE__ */ jsx(SortCaretGlyph, { direction: activeSort?.column === column.id ? activeSort.direction : "none" }) : null]
392
- }, column.id)), onRowAction ? /* @__PURE__ */ jsx(Column, {
393
- id: CHEVRON_COLUMN_ID,
394
- "data-slot": "table-column",
395
- className: cnAll(tableColumnVariants({ headerType }), CHEVRON_CELL),
396
- children: ""
397
- }) : null]
398
- }),
399
- /* @__PURE__ */ jsx(TableBody, {
400
- "data-slot": "table-body",
401
- renderEmptyState: empty === void 0 ? void 0 : () => empty,
402
- children: visibleRows.map((row, index) => /* @__PURE__ */ jsxs(Row, {
403
- id: getRowId(row),
404
- "data-slot": "table-row",
405
- "data-highlighted": isRowHighlighted?.(row) || void 0,
406
- className: cn(cnAll(tableRowVariants({
407
- variant,
408
- striped
409
- }), onRowAction && "cursor-pointer"), rowClassName?.(row)),
410
- children: [columns.map((column) => {
411
- const value = column.accessor(row);
412
- return /* @__PURE__ */ jsx(Cell, {
413
- "data-slot": "table-cell",
414
- className: cnAll(tableCellVariants({
583
+ children: [
584
+ /* @__PURE__ */ jsx("div", {
585
+ ref: scrollRef,
586
+ "data-slot": "table-scroll",
587
+ className: cnAll(tableScrollVariants()),
588
+ children: /* @__PURE__ */ jsxs(Table, {
589
+ ref,
590
+ ...props,
591
+ "data-slot": "table",
592
+ className: cn(tableVariants(), className),
593
+ style: tableStyle,
594
+ selectionMode: selectable ? "multiple" : void 0,
595
+ selectedKeys: selectable ? selection : void 0,
596
+ onSelectionChange: selectable ? commitSelection : void 0,
597
+ sortDescriptor: activeSort,
598
+ onSortChange: (descriptor) => {
599
+ if (!isControlled) setUncontrolledSort(descriptor);
600
+ setPage(1);
601
+ onSortChange?.(descriptor);
602
+ },
603
+ onRowAction: onRowAction ? (key) => {
604
+ const row = rowsByKey.get(key);
605
+ if (row !== void 0) onRowAction(row);
606
+ } : void 0,
607
+ children: [
608
+ /* @__PURE__ */ jsxs(TableHeader, {
609
+ "data-slot": "table-header",
610
+ className: cnAll(tableHeaderVariants({ headerFill })),
611
+ children: [
612
+ selectable ? /* @__PURE__ */ jsx(Column, {
613
+ id: SELECT_COLUMN_ID,
614
+ "data-slot": "table-column",
615
+ className: cnAll(tableColumnVariants({ headerType }), SELECT_CELL, stickyFirstColumn && stickyCell(headerFill === "none" ? "bare" : "header"), stickyFirstColumn && "border-e-0"),
616
+ children: /* @__PURE__ */ jsx(Checkbox$1, {
617
+ slot: "selection",
618
+ "aria-label": selectionLabels?.selectAll
619
+ })
620
+ }) : null,
621
+ columns.map((column) => /* @__PURE__ */ jsxs(Column, {
622
+ id: column.id,
623
+ isRowHeader: column === columns[0],
624
+ allowsSorting: column.sortable,
625
+ "data-slot": "table-column",
626
+ "data-sorted": sortedColumn === column.id || void 0,
627
+ className: cnAll(tableColumnVariants({
415
628
  align: column.align ?? (column.numeric ? "end" : void 0),
416
- numeric: column.numeric
417
- })),
418
- children: column.cell ? column.cell({
419
- value,
420
- row,
421
- index
422
- }) : renderValue(column, value, row)
423
- }, column.id);
424
- }), onRowAction ? /* @__PURE__ */ jsx(Cell, {
425
- "data-slot": "table-cell",
426
- className: cnAll(tableCellVariants(), CHEVRON_CELL),
427
- children: /* @__PURE__ */ jsx(RowChevronGlyph, {})
428
- }) : null]
429
- }, String(getRowId(row))))
430
- }),
431
- totalRow ? /* @__PURE__ */ jsx(TableFooter, {
432
- "data-slot": "table-footer",
433
- className: cnAll(tableFooterVariants()),
434
- children: /* @__PURE__ */ jsxs(Row, {
435
- id: "__table_total",
436
- children: [columns.map((col) => /* @__PURE__ */ jsx(Cell, {
437
- "data-slot": "table-cell",
438
- className: cnAll(tableCellVariants({
439
- align: col.align ?? (col.numeric ? "end" : void 0),
440
- numeric: col.numeric
441
- })),
442
- children: totalRow(col)
443
- }, col.id)), onRowAction ? /* @__PURE__ */ jsx(Cell, {
444
- "data-slot": "table-cell",
445
- className: cnAll(tableCellVariants(), CHEVRON_CELL),
446
- children: ""
447
- }) : null]
629
+ headerType
630
+ }), stickyFirstColumn && column === columns[0] && stickyCell(headerFill === "none" ? "bare" : "header"), stickyFirstColumn && selectable && column === columns[0] && "start-11"),
631
+ style: column.width === void 0 ? void 0 : { width: column.width },
632
+ children: [column.header, column.sortable ? /* @__PURE__ */ jsx(SortCaretGlyph, { direction: activeSort?.column === column.id ? activeSort.direction : "none" }) : null]
633
+ }, column.id)),
634
+ onRowAction ? /* @__PURE__ */ jsx(Column, {
635
+ id: CHEVRON_COLUMN_ID,
636
+ "data-slot": "table-column",
637
+ className: cnAll(tableColumnVariants({ headerType }), CHEVRON_CELL),
638
+ children: ""
639
+ }) : null
640
+ ]
641
+ }),
642
+ /* @__PURE__ */ jsx(TableBody, {
643
+ "data-slot": "table-body",
644
+ renderEmptyState: empty === void 0 ? void 0 : () => /* @__PURE__ */ jsx("div", {
645
+ "data-slot": "table-empty",
646
+ className: cnAll(tableEmptyVariants()),
647
+ children: empty
648
+ }),
649
+ children: visibleRows.map((row, index) => /* @__PURE__ */ jsxs(Row, {
650
+ id: getRowId(row),
651
+ "data-slot": "table-row",
652
+ "data-flip": String(getRowId(row)),
653
+ "data-highlighted": isRowHighlighted?.(row) || void 0,
654
+ className: cn(cnAll(tableRowVariants({
655
+ variant,
656
+ striped
657
+ }), onRowAction && "cursor-pointer"), rowClassName?.(row)),
658
+ children: [
659
+ selectable ? /* @__PURE__ */ jsx(Cell, {
660
+ "data-slot": "table-cell",
661
+ className: cnAll(tableCellVariants(), SELECT_CELL, stickyFirstColumn && stickyCell("body"), stickyFirstColumn && "border-e-0"),
662
+ children: /* @__PURE__ */ jsx(Checkbox$1, {
663
+ slot: "selection",
664
+ "aria-label": selectionLabels?.selectRow
665
+ })
666
+ }) : null,
667
+ columns.map((column) => {
668
+ const value = column.accessor(row);
669
+ return /* @__PURE__ */ jsx(Cell, {
670
+ "data-slot": "table-cell",
671
+ "data-sorted": sortedColumn === column.id || void 0,
672
+ className: cnAll(tableCellVariants({
673
+ align: column.align ?? (column.numeric ? "end" : void 0),
674
+ numeric: column.numeric
675
+ }), stickyFirstColumn && column === columns[0] && stickyCell("body"), stickyFirstColumn && selectable && column === columns[0] && "start-11"),
676
+ children: column.cell ? column.cell({
677
+ value,
678
+ row,
679
+ index
680
+ }) : renderValue(column, value, row)
681
+ }, column.id);
682
+ }),
683
+ onRowAction ? /* @__PURE__ */ jsx(Cell, {
684
+ "data-slot": "table-cell",
685
+ className: cnAll(tableCellVariants(), CHEVRON_CELL),
686
+ children: /* @__PURE__ */ jsx(RowChevronGlyph, {})
687
+ }) : null
688
+ ]
689
+ }, String(getRowId(row))))
690
+ }),
691
+ totalRow ? /* @__PURE__ */ jsx(TableFooter, {
692
+ "data-slot": "table-footer",
693
+ className: cnAll(tableFooterVariants()),
694
+ children: /* @__PURE__ */ jsxs(Row, {
695
+ id: "__table_total",
696
+ children: [
697
+ selectable ? /* @__PURE__ */ jsx(Cell, {
698
+ "data-slot": "table-cell",
699
+ className: cnAll(tableCellVariants(), SELECT_CELL, stickyFirstColumn && stickyCell("bare"), stickyFirstColumn && "border-e-0"),
700
+ children: ""
701
+ }) : null,
702
+ columns.map((col) => /* @__PURE__ */ jsx(Cell, {
703
+ "data-slot": "table-cell",
704
+ className: cnAll(tableCellVariants({
705
+ align: col.align ?? (col.numeric ? "end" : void 0),
706
+ numeric: col.numeric
707
+ }), stickyFirstColumn && col === columns[0] && stickyCell("bare"), stickyFirstColumn && selectable && col === columns[0] && "start-11"),
708
+ children: totalRow(col)
709
+ }, col.id)),
710
+ onRowAction ? /* @__PURE__ */ jsx(Cell, {
711
+ "data-slot": "table-cell",
712
+ className: cnAll(tableCellVariants(), CHEVRON_CELL),
713
+ children: ""
714
+ }) : null
715
+ ]
716
+ })
717
+ }) : null
718
+ ]
719
+ })
720
+ }),
721
+ selectable ? /* @__PURE__ */ jsx(SelectionBar, {
722
+ count: selectedCount,
723
+ total: data.length,
724
+ labels: selectLabels,
725
+ onClear: () => commitSelection(/* @__PURE__ */ new Set())
726
+ }) : null,
727
+ rowsPerPage === void 0 || pageCount <= 1 && !pageSizeOptions ? null : /* @__PURE__ */ jsxs("nav", {
728
+ "data-slot": "table-pagination",
729
+ "aria-label": `${props["aria-label"]} pagination`,
730
+ className: cnAll(tablePaginationVariants()),
731
+ children: [/* @__PURE__ */ jsx("div", {
732
+ "data-slot": "table-pagination-pages",
733
+ className: "flex items-center gap-1",
734
+ children: pageCount <= 1 ? null : /* @__PURE__ */ jsxs(Fragment$1, { children: [
735
+ /* @__PURE__ */ jsx(Button$1, {
736
+ variant: "ghost",
737
+ size: "sm",
738
+ className: "w-(--density-control-h-sm) px-0",
739
+ "aria-label": labels.previous,
740
+ isDisabled: currentPage <= 1,
741
+ onPress: () => setPage(currentPage - 1),
742
+ children: /* @__PURE__ */ jsx(PageChevronGlyph, { direction: "previous" })
743
+ }),
744
+ pageWindow(currentPage, pageCount).map((entry, index) => entry === "ellipsis" ? /* @__PURE__ */ jsx("span", {
745
+ "data-slot": "table-pagination-ellipsis",
746
+ "aria-hidden": "true",
747
+ className: "px-2 text-sm text-muted-foreground",
748
+ children: "…"
749
+ }, `ellipsis-${String(index)}`) : /* @__PURE__ */ jsx(Button$1, {
750
+ variant: entry === currentPage ? "primary" : "ghost",
751
+ size: "sm",
752
+ className: "min-w-(--density-control-h-sm) px-2",
753
+ "aria-label": labels.page(entry, entry === currentPage),
754
+ onPress: () => setPage(entry),
755
+ children: entry
756
+ }, entry)),
757
+ /* @__PURE__ */ jsx(Button$1, {
758
+ variant: "ghost",
759
+ size: "sm",
760
+ className: "w-(--density-control-h-sm) px-0",
761
+ "aria-label": labels.next,
762
+ isDisabled: currentPage >= pageCount,
763
+ onPress: () => setPage(currentPage + 1),
764
+ children: /* @__PURE__ */ jsx(PageChevronGlyph, { direction: "next" })
448
765
  })
449
- }) : null
450
- ]
766
+ ] })
767
+ }), pageSizeOptions === void 0 ? null : /* @__PURE__ */ jsx(Select$1, {
768
+ className: "w-auto",
769
+ label: labels.rowsPerPage,
770
+ labelHidden: true,
771
+ selectedKey: String(rowsPerPage),
772
+ onSelectionChange: (key) => {
773
+ const size = Number(key);
774
+ setChosenSize(size);
775
+ setPage(1);
776
+ onPageSizeChange?.(size);
777
+ },
778
+ children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, {
779
+ id: String(option),
780
+ children: labels.perPage(option)
781
+ }, option))
782
+ })]
451
783
  })
452
- }), rowsPerPage === void 0 || pageCount <= 1 && !pageSizeOptions ? null : /* @__PURE__ */ jsxs("nav", {
453
- "data-slot": "table-pagination",
454
- "aria-label": `${props["aria-label"]} pagination`,
455
- className: cnAll(tablePaginationVariants()),
456
- children: [/* @__PURE__ */ jsx("div", {
457
- "data-slot": "table-pagination-pages",
458
- className: "flex items-center gap-1",
459
- children: pageCount <= 1 ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
460
- /* @__PURE__ */ jsx(Button$1, {
461
- variant: "ghost",
462
- size: "sm",
463
- className: "w-(--density-control-h-sm) px-0",
464
- "aria-label": labels.previous,
465
- isDisabled: currentPage <= 1,
466
- onPress: () => setPage(currentPage - 1),
467
- children: /* @__PURE__ */ jsx(PageChevronGlyph, { direction: "previous" })
468
- }),
469
- pageWindow(currentPage, pageCount).map((entry, index) => entry === "ellipsis" ? /* @__PURE__ */ jsx("span", {
470
- "data-slot": "table-pagination-ellipsis",
471
- "aria-hidden": "true",
472
- className: "px-2 text-sm text-muted-foreground",
473
- children: "…"
474
- }, `ellipsis-${String(index)}`) : /* @__PURE__ */ jsx(Button$1, {
475
- variant: entry === currentPage ? "primary" : "ghost",
476
- size: "sm",
477
- className: "min-w-(--density-control-h-sm) px-2",
478
- "aria-label": labels.page(entry, entry === currentPage),
479
- onPress: () => setPage(entry),
480
- children: entry
481
- }, entry)),
482
- /* @__PURE__ */ jsx(Button$1, {
483
- variant: "ghost",
484
- size: "sm",
485
- className: "w-(--density-control-h-sm) px-0",
486
- "aria-label": labels.next,
487
- isDisabled: currentPage >= pageCount,
488
- onPress: () => setPage(currentPage + 1),
489
- children: /* @__PURE__ */ jsx(PageChevronGlyph, { direction: "next" })
490
- })
491
- ] })
492
- }), pageSizeOptions === void 0 ? null : /* @__PURE__ */ jsx(Select$1, {
493
- className: "w-auto",
494
- label: labels.rowsPerPage,
495
- labelHidden: true,
496
- selectedKey: String(rowsPerPage),
497
- onSelectionChange: (key) => {
498
- const size = Number(key);
499
- setChosenSize(size);
500
- setPage(1);
501
- onPageSizeChange?.(size);
502
- },
503
- children: pageSizeOptions.map((option) => /* @__PURE__ */ jsx(SelectItem, {
504
- id: String(option),
505
- children: labels.perPage(option)
506
- }, option))
507
- })]
508
- })]
784
+ ]
509
785
  });
510
786
  });
511
787
  //#endregion
512
- export { Table$1 as Table, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableVariants };
788
+ export { Table$1 as Table, createColumns, tableCardVariants, tableCellVariants, tableColumnVariants, tableEmptyVariants, tableFooterVariants, tableHeaderVariants, tablePaginationVariants, tableRowVariants, tableScrollVariants, tableSelectionBarVariants, tableStickyCellVariants, tableVariants };
513
789
 
514
790
  //# sourceMappingURL=table.js.map