@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,693 @@
1
+ "use client";
2
+ import { cn, cnAll } from "../lib/cn.js";
3
+ import { prefersReducedMotion, useExitBackstop, useIsomorphicLayoutEffect, useLeavingItems } from "../lib/motion.js";
4
+ import { labelVariants } from "../label/label.js";
5
+ import { useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
6
+ import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
7
+ //#region src/morph-select/morph-select.tsx
8
+ const TYPEAHEAD_RESET = 600;
9
+ const PAGE = 8;
10
+ const isGroup = (item) => "options" in item;
11
+ /** Loose options between groups gather into unlabelled sections, so the list keeps the order it was given. */
12
+ function normalize(items) {
13
+ const out = [];
14
+ items.forEach((item, index) => {
15
+ if (isGroup(item)) {
16
+ out.push({
17
+ key: `group-${index}`,
18
+ label: item.label,
19
+ options: item.options
20
+ });
21
+ return;
22
+ }
23
+ const last = out[out.length - 1];
24
+ if (last && !last.label) last.options.push(item);
25
+ else out.push({
26
+ key: `loose-${index}`,
27
+ options: [item]
28
+ });
29
+ });
30
+ return out;
31
+ }
32
+ const matches = (option, needle) => `${option.label} ${option.meta ?? ""} ${option.keywords ?? ""}`.toLowerCase().includes(needle);
33
+ /** The closed trigger's width, rounded up. offsetWidth rounds to the nearest pixel, and half a pixel short is enough to ellipsize the label. */
34
+ function triggerWidth(node) {
35
+ const exact = node.getBoundingClientRect().width;
36
+ const rounded = node.offsetWidth;
37
+ return Math.abs(exact - rounded) <= .5 ? Math.ceil(exact - .01) : rounded + 1;
38
+ }
39
+ /** The layout the closed trigger and its invisible measuring copy share, so the copy's width is the trigger's. */
40
+ const triggerLayout = "box-border flex h-(--ms-h) items-center gap-2 ps-(--ms-pad) pe-10 font-medium whitespace-nowrap";
41
+ const iconClass = "grid size-5 flex-none place-items-center text-text-secondary [&>svg]:size-4 [&>img]:size-5 [&>img]:rounded-full [&>img]:object-cover";
42
+ /** The label a layer shows: the icon, then the text, or the placeholder. */
43
+ function Value({ option, placeholder }) {
44
+ if (!option) return /* @__PURE__ */ jsx("span", {
45
+ className: "font-normal text-muted-foreground",
46
+ children: placeholder
47
+ });
48
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [option.icon ? /* @__PURE__ */ jsx("span", {
49
+ className: iconClass,
50
+ "aria-hidden": "true",
51
+ children: option.icon
52
+ }) : null, /* @__PURE__ */ jsx("span", {
53
+ className: "min-w-0 truncate",
54
+ children: option.label
55
+ })] });
56
+ }
57
+ /** A replaced label on its way out, popped out of flow where it stood and lifting away. */
58
+ function LeavingLayer({ id, rect, dir, fly, onDone, children }) {
59
+ const remove = useCallback(() => onDone(id), [onDone, id]);
60
+ useExitBackstop(true, remove);
61
+ return /* @__PURE__ */ jsx("span", {
62
+ "aria-hidden": "true",
63
+ "data-leaving": "",
64
+ onAnimationEnd: (event) => {
65
+ if (event.target === event.currentTarget) remove();
66
+ },
67
+ style: {
68
+ ...rect,
69
+ "--dir": fly ? 1 : dir * 1.5
70
+ },
71
+ className: "absolute flex min-w-0 items-center gap-2 motion-safe:animate-field-swap-out motion-reduce:animate-fade-out",
72
+ children
73
+ });
74
+ }
75
+ function MorphSelect({ label, labelHidden = false, items, value, defaultValue = null, onValueChange, placeholder = "Select", searchable = "auto", searchPlaceholder, panelWidth = 272, maxListHeight = 296, align = "start", size = "md", name, disabled = false, className }) {
76
+ const uid = useId();
77
+ const labelId = `${uid}-label`;
78
+ const listId = `${uid}-list`;
79
+ const optionId = (index) => `${uid}-option-${index}`;
80
+ const rootRef = useRef(null);
81
+ const anchorRef = useRef(null);
82
+ const shapeRef = useRef(null);
83
+ const measureRef = useRef(null);
84
+ const faceRef = useRef(null);
85
+ const scrollRef = useRef(null);
86
+ const triggerRef = useRef(null);
87
+ const inputRef = useRef(null);
88
+ const slotRef = useRef(null);
89
+ const layerRef = useRef(null);
90
+ const highlightRef = useRef(null);
91
+ const searchRowRef = useRef(null);
92
+ const optionRefs = useRef(/* @__PURE__ */ new Map());
93
+ const sections = useMemo(() => normalize(items), [items]);
94
+ const all = useMemo(() => sections.flatMap((section) => section.options), [sections]);
95
+ const indexOf = useMemo(() => new Map(all.map((option, index) => [option.value, index])), [all]);
96
+ const canSearch = searchable === "auto" ? all.length > 8 : searchable;
97
+ const [inner, setInner] = useState(defaultValue);
98
+ const selected = value !== void 0 ? value : inner;
99
+ const selectedOption = selected === null ? void 0 : all.find((option) => option.value === selected);
100
+ const [open, setOpen] = useState(false);
101
+ const [query, setQuery] = useState("");
102
+ const [active, setActive] = useState(null);
103
+ const [change, setChange] = useState({
104
+ value: null,
105
+ dir: 1,
106
+ fly: null
107
+ });
108
+ const needle = query.trim().toLowerCase();
109
+ const visibleSections = useMemo(() => needle ? sections.map((section) => ({
110
+ ...section,
111
+ options: section.options.filter((option) => matches(option, needle))
112
+ })).filter((section) => section.options.length) : sections, [needle, sections]);
113
+ const enabled = useMemo(() => visibleSections.flatMap((section) => section.options).filter((option) => !option.disabled), [visibleSections]);
114
+ const current = active !== null && enabled.some((option) => option.value === active) ? active : enabled[0]?.value ?? null;
115
+ const resultCount = visibleSections.reduce((sum, section) => sum + section.options.length, 0);
116
+ const sizes = useRef({
117
+ trigger: 0,
118
+ lid: 0,
119
+ listW: 0,
120
+ listH: 0
121
+ });
122
+ const live = useRef({
123
+ open: false,
124
+ anchorW: 0
125
+ });
126
+ const place = useCallback(() => {
127
+ const { trigger, lid, listW, listH } = sizes.current;
128
+ const shape = shapeRef.current;
129
+ const anchor = anchorRef.current;
130
+ if (!trigger || !lid || !shape || !anchor) return;
131
+ const isOpen = live.current.open;
132
+ if (trigger !== live.current.anchorW) {
133
+ anchor.toggleAttribute("data-widening", trigger > live.current.anchorW);
134
+ live.current.anchorW = trigger;
135
+ }
136
+ anchor.style.width = `${trigger}px`;
137
+ shape.style.width = `${isOpen ? Math.max(trigger, listW) : trigger}px`;
138
+ shape.style.height = `${isOpen ? lid + listH : lid}px`;
139
+ }, []);
140
+ const read = useCallback(() => {
141
+ const measure = measureRef.current;
142
+ const face = faceRef.current;
143
+ const root = rootRef.current;
144
+ if (!measure || !face || !root) return;
145
+ const trigger = triggerWidth(measure);
146
+ root.style.setProperty("--ms-trigger-w", `${trigger}px`);
147
+ sizes.current = {
148
+ trigger,
149
+ lid: measure.offsetHeight,
150
+ listW: face.offsetWidth,
151
+ listH: face.offsetHeight
152
+ };
153
+ place();
154
+ }, [place]);
155
+ useIsomorphicLayoutEffect(() => {
156
+ const measure = measureRef.current;
157
+ const face = faceRef.current;
158
+ const root = rootRef.current;
159
+ if (!measure || !face || !root) return;
160
+ read();
161
+ shapeRef.current?.offsetWidth;
162
+ root.setAttribute("data-ready", "");
163
+ if (typeof ResizeObserver === "undefined") return;
164
+ const observer = new ResizeObserver(read);
165
+ observer.observe(measure);
166
+ observer.observe(face);
167
+ return () => observer.disconnect();
168
+ }, [read]);
169
+ useIsomorphicLayoutEffect(() => {
170
+ if (live.current.open === open) return;
171
+ live.current.open = open;
172
+ read();
173
+ }, [open, read]);
174
+ const scrollIntent = useRef(false);
175
+ useIsomorphicLayoutEffect(() => {
176
+ const highlight = highlightRef.current;
177
+ if (!highlight) return;
178
+ const node = open && current !== null ? optionRefs.current.get(current) : void 0;
179
+ if (!node) {
180
+ highlight.removeAttribute("data-on");
181
+ return;
182
+ }
183
+ const top = node.offsetTop;
184
+ const height = node.offsetHeight;
185
+ highlight.toggleAttribute("data-jump", !highlight.hasAttribute("data-on") || prefersReducedMotion());
186
+ highlight.style.translate = `0 ${top}px`;
187
+ highlight.style.height = `${height}px`;
188
+ highlight.setAttribute("data-on", "");
189
+ const scroller = scrollRef.current;
190
+ if (scroller && scrollIntent.current) {
191
+ scrollIntent.current = false;
192
+ const pad = 6;
193
+ if (top < scroller.scrollTop + pad) scroller.scrollTop = top - pad;
194
+ else if (top + height > scroller.scrollTop + scroller.clientHeight - pad) scroller.scrollTop = top + height - scroller.clientHeight + pad;
195
+ }
196
+ }, [
197
+ current,
198
+ open,
199
+ visibleSections
200
+ ]);
201
+ const showSearch = open && canSearch;
202
+ useIsomorphicLayoutEffect(() => {
203
+ triggerRef.current?.toggleAttribute("inert", showSearch);
204
+ searchRowRef.current?.toggleAttribute("inert", !showSearch);
205
+ const face = faceRef.current;
206
+ if (!face) return;
207
+ face.toggleAttribute("inert", !open);
208
+ if (open) face.removeAttribute("aria-hidden");
209
+ else face.setAttribute("aria-hidden", "true");
210
+ }, [open, showSearch]);
211
+ const pendingFocus = useRef(null);
212
+ useIsomorphicLayoutEffect(() => {
213
+ const target = pendingFocus.current;
214
+ pendingFocus.current = null;
215
+ if (target === "input") inputRef.current?.focus({ preventScroll: true });
216
+ if (target === "trigger") triggerRef.current?.focus({ preventScroll: true });
217
+ }, [open]);
218
+ const typeahead = useRef({
219
+ buffer: "",
220
+ at: 0
221
+ });
222
+ /** Space opens and picks on keydown; the click a button fires on the matching keyup must not undo it. */
223
+ const suppressClick = useRef(false);
224
+ const [announcement, setAnnouncement] = useState("");
225
+ function openList(focus, seed = "") {
226
+ if (disabled || open) return;
227
+ setQuery(seed);
228
+ setActive(focus !== void 0 ? focus : selected);
229
+ scrollIntent.current = true;
230
+ pendingFocus.current = canSearch ? "input" : "trigger";
231
+ setAnnouncement("");
232
+ setOpen(true);
233
+ }
234
+ const close = useCallback((restoreFocus) => {
235
+ typeahead.current.buffer = "";
236
+ if (restoreFocus) pendingFocus.current = "trigger";
237
+ setOpen(false);
238
+ }, []);
239
+ function commit(option, source) {
240
+ if (!option || option.disabled) return;
241
+ if (option.value !== selected) {
242
+ let fly = null;
243
+ const slot = slotRef.current;
244
+ const part = source?.querySelector("[data-part='value']");
245
+ if (!prefersReducedMotion() && part && slot) {
246
+ const from = part.getBoundingClientRect();
247
+ const to = slot.getBoundingClientRect();
248
+ fly = {
249
+ x: from.left - to.left,
250
+ y: from.top + from.height / 2 - (to.top + to.height / 2)
251
+ };
252
+ }
253
+ const from = selected === null ? -1 : indexOf.get(selected) ?? -1;
254
+ const to = indexOf.get(option.value) ?? 0;
255
+ setChange({
256
+ value: option.value,
257
+ dir: from < 0 ? 1 : Math.sign(to - from) || 1,
258
+ fly
259
+ });
260
+ if (value === void 0) setInner(option.value);
261
+ onValueChange?.(option.value, option);
262
+ }
263
+ close(true);
264
+ }
265
+ function typeTo(char) {
266
+ const now = performance.now();
267
+ const state = typeahead.current;
268
+ state.buffer = now - state.at > TYPEAHEAD_RESET ? char : state.buffer + char;
269
+ state.at = now;
270
+ const buffer = state.buffer.toLowerCase();
271
+ const repeated = buffer.split("").every((letter) => letter === buffer[0]);
272
+ const search = repeated ? buffer[0] : buffer;
273
+ const pool = all.filter((option) => !option.disabled);
274
+ const from = open ? current : selected;
275
+ const at = pool.findIndex((option) => option.value === from);
276
+ const offset = repeated || buffer.length === 1 ? 1 : 0;
277
+ return [...pool.slice(at + offset), ...pool.slice(0, at + offset)].find((option) => option.label.toLowerCase().startsWith(search));
278
+ }
279
+ function move(to) {
280
+ if (to === void 0 || to === null) return;
281
+ scrollIntent.current = true;
282
+ setActive(to);
283
+ }
284
+ function onKey(event, fromInput) {
285
+ const { key } = event;
286
+ if (key === " " && !fromInput) suppressClick.current = true;
287
+ const printable = key.length === 1 && !event.metaKey && !event.ctrlKey && !event.altKey;
288
+ const typing = performance.now() - typeahead.current.at < TYPEAHEAD_RESET && typeahead.current.buffer.length > 0;
289
+ if (!open) {
290
+ if (key === "ArrowDown" || key === "ArrowUp" || key === "Enter" || key === " " && !typing) {
291
+ event.preventDefault();
292
+ openList();
293
+ return;
294
+ }
295
+ if (key === "Home" || key === "End") {
296
+ event.preventDefault();
297
+ const pool = all.filter((option) => !option.disabled);
298
+ openList((key === "Home" ? pool[0] : pool[pool.length - 1])?.value ?? null);
299
+ return;
300
+ }
301
+ if (printable) {
302
+ event.preventDefault();
303
+ if (canSearch) openList(void 0, key);
304
+ else openList(typeTo(key)?.value ?? selected);
305
+ }
306
+ return;
307
+ }
308
+ const at = enabled.findIndex((option) => option.value === current);
309
+ const caretKeys = fromInput && query.length > 0;
310
+ const pick = () => commit(enabled[at], optionRefs.current.get(current ?? ""));
311
+ switch (key) {
312
+ case "ArrowDown":
313
+ event.preventDefault();
314
+ move(enabled[Math.min(enabled.length - 1, at + 1)]?.value);
315
+ return;
316
+ case "ArrowUp":
317
+ event.preventDefault();
318
+ if (event.altKey) {
319
+ pick();
320
+ return;
321
+ }
322
+ move(enabled[Math.max(0, at - 1)]?.value);
323
+ return;
324
+ case "PageDown":
325
+ event.preventDefault();
326
+ move(enabled[Math.min(enabled.length - 1, at + PAGE)]?.value);
327
+ return;
328
+ case "PageUp":
329
+ event.preventDefault();
330
+ move(enabled[Math.max(0, at - PAGE)]?.value);
331
+ return;
332
+ case "Home":
333
+ if (caretKeys) return;
334
+ event.preventDefault();
335
+ move(enabled[0]?.value);
336
+ return;
337
+ case "End":
338
+ if (caretKeys) return;
339
+ event.preventDefault();
340
+ move(enabled[enabled.length - 1]?.value);
341
+ return;
342
+ case "Enter":
343
+ event.preventDefault();
344
+ pick();
345
+ return;
346
+ case "Escape":
347
+ event.preventDefault();
348
+ event.stopPropagation();
349
+ close(true);
350
+ return;
351
+ case "Tab":
352
+ close(false);
353
+ return;
354
+ }
355
+ if (fromInput) return;
356
+ if (key === " " && !typing) {
357
+ event.preventDefault();
358
+ pick();
359
+ return;
360
+ }
361
+ if (printable) {
362
+ event.preventDefault();
363
+ move(typeTo(key)?.value);
364
+ }
365
+ }
366
+ useEffect(() => {
367
+ if (!open) return;
368
+ const down = (event) => {
369
+ if (!rootRef.current?.contains(event.target)) close(false);
370
+ };
371
+ document.addEventListener("pointerdown", down);
372
+ return () => document.removeEventListener("pointerdown", down);
373
+ }, [close, open]);
374
+ function onBlur(event) {
375
+ const next = event.relatedTarget;
376
+ if (open && next && !event.currentTarget.contains(next)) close(false);
377
+ }
378
+ function onQuery(next) {
379
+ setQuery(next);
380
+ setActive(null);
381
+ scrollIntent.current = true;
382
+ if (scrollRef.current) scrollRef.current.scrollTop = 0;
383
+ const text = next.trim().toLowerCase();
384
+ const count = text ? all.filter((option) => matches(option, text)).length : all.length;
385
+ setAnnouncement(text ? count ? `${count} ${count === 1 ? "option" : "options"}` : "No matches" : "");
386
+ }
387
+ const layerKey = selected ?? "__empty";
388
+ const flying = change.value === selected ? change.fly : null;
389
+ const { leaving, changed, remove } = useLeavingItems(layerKey, {
390
+ key: layerKey,
391
+ node: /* @__PURE__ */ jsx(Value, {
392
+ option: selectedOption,
393
+ placeholder
394
+ }),
395
+ dir: change.dir,
396
+ fly: Boolean(flying)
397
+ }, () => layerRef.current);
398
+ const rootStyle = {
399
+ "--ms-panel-w": `${panelWidth}px`,
400
+ "--ms-list-max": `${maxListHeight}px`
401
+ };
402
+ const layerStyle = {
403
+ "--dir": change.dir,
404
+ ...flying ? {
405
+ "--fly-x": `${flying.x}px`,
406
+ "--fly-y": `${flying.y}px`
407
+ } : {}
408
+ };
409
+ return /* @__PURE__ */ jsxs("div", {
410
+ ref: rootRef,
411
+ "data-slot": "morph-select",
412
+ "data-open": open || void 0,
413
+ "data-align": align,
414
+ "data-size": size,
415
+ "data-disabled": disabled || void 0,
416
+ style: rootStyle,
417
+ onBlur,
418
+ className: cn("morph-select-root group/ms relative inline-grid min-w-0 justify-items-start gap-2 font-sans leading-(--leading-normal) text-foreground data-[align=end]:justify-items-end data-[open]:z-30 data-[size=sm]:text-sm data-[size=md]:text-base data-[size=lg]:text-base", className),
419
+ children: [
420
+ /* @__PURE__ */ jsx("span", {
421
+ id: labelId,
422
+ "data-slot": "morph-select-label",
423
+ className: cnAll(labelVariants(), labelHidden && "sr-only"),
424
+ children: label
425
+ }),
426
+ /* @__PURE__ */ jsxs("div", {
427
+ ref: anchorRef,
428
+ className: "morph-select-anchor",
429
+ children: [/* @__PURE__ */ jsx("span", {
430
+ ref: measureRef,
431
+ "aria-hidden": "true",
432
+ className: cnAll(triggerLayout, "morph-select-measure"),
433
+ children: /* @__PURE__ */ jsx(Value, {
434
+ option: selectedOption,
435
+ placeholder
436
+ })
437
+ }), /* @__PURE__ */ jsxs("div", {
438
+ ref: shapeRef,
439
+ "data-slot": "morph-select-shape",
440
+ "data-open": open || void 0,
441
+ "data-disabled": disabled || void 0,
442
+ className: "morph-select-shape",
443
+ children: [/* @__PURE__ */ jsxs("div", {
444
+ className: "absolute inset-x-0 top-0 z-10 h-(--ms-h)",
445
+ children: [
446
+ /* @__PURE__ */ jsx("button", {
447
+ ref: triggerRef,
448
+ type: "button",
449
+ role: "combobox",
450
+ "data-slot": "morph-select-trigger",
451
+ "aria-labelledby": labelId,
452
+ "aria-haspopup": "listbox",
453
+ "aria-expanded": open,
454
+ "aria-controls": listId,
455
+ "aria-activedescendant": open && !canSearch && current !== null ? optionId(indexOf.get(current) ?? 0) : void 0,
456
+ disabled,
457
+ tabIndex: showSearch ? -1 : 0,
458
+ onClick: () => {
459
+ if (suppressClick.current) {
460
+ suppressClick.current = false;
461
+ return;
462
+ }
463
+ if (open) close(true);
464
+ else openList();
465
+ },
466
+ onKeyDown: (event) => onKey(event, false),
467
+ onKeyUp: (event) => {
468
+ if (event.key === " ") window.setTimeout(() => {
469
+ suppressClick.current = false;
470
+ });
471
+ },
472
+ className: cnAll(triggerLayout, "absolute inset-0 w-full cursor-pointer border-0 bg-transparent text-start text-foreground outline-none [font-family:inherit] [font-size:inherit] [line-height:inherit] [letter-spacing:inherit] [-webkit-tap-highlight-color:transparent] [touch-action:manipulation] disabled:cursor-not-allowed"),
473
+ children: /* @__PURE__ */ jsxs("span", {
474
+ ref: slotRef,
475
+ "data-hidden": showSearch || void 0,
476
+ className: "relative block h-full min-w-0 flex-1 data-[hidden]:opacity-0 motion-safe:transition-opacity motion-safe:duration-(--duration-instant) motion-safe:ease-settle",
477
+ children: [leaving.map((item) => /* @__PURE__ */ jsx(LeavingLayer, {
478
+ id: item.id,
479
+ rect: item.rect,
480
+ dir: item.value.dir,
481
+ fly: item.value.fly,
482
+ onDone: remove,
483
+ children: item.value.node
484
+ }, item.id)), /* @__PURE__ */ jsx("span", {
485
+ ref: layerRef,
486
+ style: layerStyle,
487
+ className: cnAll("absolute inset-0 flex min-w-0 items-center gap-2", changed && (flying ? "motion-safe:animate-morph-select-fly motion-reduce:animate-fade-in" : "motion-safe:animate-select-value-in motion-reduce:animate-fade-in")),
488
+ children: /* @__PURE__ */ jsx(Value, {
489
+ option: selectedOption,
490
+ placeholder
491
+ })
492
+ }, layerKey)]
493
+ })
494
+ }),
495
+ canSearch ? /* @__PURE__ */ jsxs("div", {
496
+ ref: searchRowRef,
497
+ className: cnAll("absolute inset-0 flex items-center gap-2 ps-(--ms-pad) pe-1.5 motion-safe:transition-opacity motion-safe:duration-(--duration-quick) motion-safe:ease-settle", showSearch ? "opacity-100" : "pointer-events-none opacity-0"),
498
+ children: [
499
+ /* @__PURE__ */ jsxs("svg", {
500
+ "aria-hidden": "true",
501
+ viewBox: "0 0 16 16",
502
+ fill: "none",
503
+ stroke: "currentColor",
504
+ strokeWidth: "1.75",
505
+ strokeLinecap: "round",
506
+ strokeLinejoin: "round",
507
+ className: "size-4 flex-none text-muted-foreground",
508
+ children: [/* @__PURE__ */ jsx("circle", {
509
+ cx: "7",
510
+ cy: "7",
511
+ r: "4.25"
512
+ }), /* @__PURE__ */ jsx("path", { d: "m10.5 10.5 3 3" })]
513
+ }),
514
+ /* @__PURE__ */ jsx("input", {
515
+ ref: inputRef,
516
+ type: "text",
517
+ role: "combobox",
518
+ "data-slot": "morph-select-search",
519
+ "aria-label": `Search ${label.toLowerCase()}`,
520
+ "aria-expanded": open,
521
+ "aria-controls": listId,
522
+ "aria-autocomplete": "list",
523
+ "aria-activedescendant": open && current !== null ? optionId(indexOf.get(current) ?? 0) : void 0,
524
+ placeholder: searchPlaceholder ?? selectedOption?.label ?? "Search",
525
+ value: query,
526
+ autoComplete: "off",
527
+ spellCheck: false,
528
+ onChange: (event) => onQuery(event.target.value),
529
+ onKeyDown: (event) => onKey(event, true),
530
+ className: "h-full min-w-0 flex-1 border-0 bg-transparent p-0 [font:inherit] text-foreground outline-none placeholder:text-muted-foreground"
531
+ }),
532
+ query ? /* @__PURE__ */ jsx("button", {
533
+ type: "button",
534
+ "aria-label": "Clear search",
535
+ onPointerDown: (event) => event.preventDefault(),
536
+ onClick: () => {
537
+ onQuery("");
538
+ inputRef.current?.focus();
539
+ },
540
+ className: "grid size-6 flex-none cursor-pointer place-items-center rounded-pill border-0 bg-muted p-0 text-text-secondary outline-none motion-safe:animate-field-clear-in motion-reduce:animate-fade-in hover:text-foreground",
541
+ children: /* @__PURE__ */ jsx("svg", {
542
+ "aria-hidden": "true",
543
+ viewBox: "0 0 16 16",
544
+ fill: "none",
545
+ stroke: "currentColor",
546
+ strokeWidth: "1.75",
547
+ strokeLinecap: "round",
548
+ className: "size-3.5",
549
+ children: /* @__PURE__ */ jsx("path", { d: "m4 4 8 8M12 4l-8 8" })
550
+ })
551
+ }) : null,
552
+ /* @__PURE__ */ jsx("button", {
553
+ type: "button",
554
+ "aria-label": `Close ${label.toLowerCase()}`,
555
+ onClick: () => close(true),
556
+ className: "size-9 flex-none cursor-pointer rounded-pill border-0 bg-transparent p-0 outline-none motion-safe:transition-[background-color] motion-safe:duration-(--duration-quick) motion-safe:ease-settle hover:bg-muted"
557
+ })
558
+ ]
559
+ }) : null,
560
+ /* @__PURE__ */ jsx("svg", {
561
+ "aria-hidden": "true",
562
+ viewBox: "0 0 16 16",
563
+ fill: "none",
564
+ stroke: "currentColor",
565
+ strokeWidth: "1.75",
566
+ strokeLinecap: "round",
567
+ strokeLinejoin: "round",
568
+ className: "pointer-events-none absolute end-4 top-1/2 -mt-2 size-4 text-muted-foreground motion-safe:transition-[rotate] motion-safe:duration-(--duration-gentle) motion-safe:ease-gentle group-data-[open]/ms:rotate-180",
569
+ children: /* @__PURE__ */ jsx("path", { d: "m4 6 4 4 4-4" })
570
+ })
571
+ ]
572
+ }), /* @__PURE__ */ jsx("div", {
573
+ ref: faceRef,
574
+ "data-open": open || void 0,
575
+ className: "morph-select-face",
576
+ children: /* @__PURE__ */ jsx("div", {
577
+ ref: scrollRef,
578
+ className: "max-h-(--ms-list-max) overflow-y-auto overscroll-contain pt-1.5 [scrollbar-width:thin]",
579
+ children: /* @__PURE__ */ jsxs("div", {
580
+ id: listId,
581
+ role: "listbox",
582
+ "aria-labelledby": labelId,
583
+ className: "relative grid grid-cols-1 gap-0.5",
584
+ children: [
585
+ /* @__PURE__ */ jsx("span", {
586
+ ref: highlightRef,
587
+ "aria-hidden": "true",
588
+ className: "morph-select-highlight"
589
+ }),
590
+ visibleSections.map((section) => {
591
+ const rows = section.options.map((option) => {
592
+ const index = indexOf.get(option.value) ?? 0;
593
+ const isSelected = option.value === selected;
594
+ return /* @__PURE__ */ jsxs("div", {
595
+ id: optionId(index),
596
+ role: "option",
597
+ "aria-selected": isSelected,
598
+ "aria-disabled": option.disabled || void 0,
599
+ "data-slot": "morph-select-option",
600
+ "data-active": option.value === current || void 0,
601
+ ref: (node) => {
602
+ if (node) optionRefs.current.set(option.value, node);
603
+ else optionRefs.current.delete(option.value);
604
+ },
605
+ onPointerMove: (event) => {
606
+ if (event.pointerType === "mouse" && !option.disabled && option.value !== current) setActive(option.value);
607
+ },
608
+ onPointerDown: (event) => event.preventDefault(),
609
+ onClick: (event) => commit(option, event.currentTarget),
610
+ className: "morph-select-option relative box-border flex min-h-9 cursor-pointer select-none items-center gap-2 rounded-lg text-text-secondary outline-none data-[active]:text-foreground aria-selected:text-foreground aria-disabled:cursor-not-allowed aria-disabled:opacity-(--opacity-disabled) motion-safe:transition-colors motion-safe:duration-(--duration-quick) motion-safe:ease-settle",
611
+ children: [
612
+ /* @__PURE__ */ jsxs("span", {
613
+ "data-part": "value",
614
+ className: "flex min-w-0 flex-1 items-center gap-2 font-medium",
615
+ children: [option.icon ? /* @__PURE__ */ jsx("span", {
616
+ className: iconClass,
617
+ "aria-hidden": "true",
618
+ children: option.icon
619
+ }) : null, /* @__PURE__ */ jsx("span", {
620
+ className: "min-w-0 truncate",
621
+ children: option.label
622
+ })]
623
+ }),
624
+ option.meta ? /* @__PURE__ */ jsx("span", {
625
+ className: "flex-none text-xs tabular-nums text-muted-foreground",
626
+ children: option.meta
627
+ }) : null,
628
+ /* @__PURE__ */ jsx("span", {
629
+ "aria-hidden": "true",
630
+ "data-on": isSelected || void 0,
631
+ className: "grid size-4 flex-none scale-60 place-items-center text-foreground opacity-0 data-[on]:scale-100 data-[on]:opacity-100 motion-safe:transition-[opacity,scale] motion-safe:duration-(--duration-quick) motion-safe:ease-settle",
632
+ children: /* @__PURE__ */ jsx("svg", {
633
+ viewBox: "0 0 16 16",
634
+ fill: "none",
635
+ stroke: "currentColor",
636
+ strokeWidth: "1.75",
637
+ strokeLinecap: "round",
638
+ strokeLinejoin: "round",
639
+ className: "size-4",
640
+ children: /* @__PURE__ */ jsx("path", { d: "m3.5 8.5 3 3 6-6" })
641
+ })
642
+ })
643
+ ]
644
+ }, option.value);
645
+ });
646
+ return section.label ? /* @__PURE__ */ jsxs("div", {
647
+ role: "group",
648
+ "aria-labelledby": `${uid}-${section.key}`,
649
+ className: "grid grid-cols-1 gap-0.5 not-first:mt-1",
650
+ children: [/* @__PURE__ */ jsx("div", {
651
+ id: `${uid}-${section.key}`,
652
+ role: "presentation",
653
+ className: "px-2.5 pt-2 pb-1 text-xs text-muted-foreground",
654
+ children: section.label
655
+ }), rows]
656
+ }, section.key) : /* @__PURE__ */ jsx("div", {
657
+ role: "presentation",
658
+ className: "grid grid-cols-1 gap-0.5 not-first:mt-1",
659
+ children: rows
660
+ }, section.key);
661
+ }),
662
+ resultCount === 0 ? /* @__PURE__ */ jsxs("p", {
663
+ className: "m-0 px-2.5 pt-3 pb-3.5 text-sm text-muted-foreground",
664
+ children: [
665
+ "No matches for “",
666
+ query.trim(),
667
+ "”"
668
+ ]
669
+ }) : null
670
+ ]
671
+ })
672
+ })
673
+ })]
674
+ })]
675
+ }),
676
+ name ? /* @__PURE__ */ jsx("input", {
677
+ type: "hidden",
678
+ name,
679
+ value: selected ?? ""
680
+ }) : null,
681
+ /* @__PURE__ */ jsx("span", {
682
+ className: "sr-only",
683
+ role: "status",
684
+ "aria-live": "polite",
685
+ children: announcement
686
+ })
687
+ ]
688
+ });
689
+ }
690
+ //#endregion
691
+ export { MorphSelect };
692
+
693
+ //# sourceMappingURL=morph-select.js.map