@burtson-labs/ui 0.13.0 → 0.14.0

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 (391) hide show
  1. package/LICENSES/DEPENDENCIES.txt +2745 -0
  2. package/LICENSES/Radix-MIT.txt +21 -0
  3. package/LICENSES/cmdk-MIT.txt +21 -0
  4. package/LICENSES/overrides/react-remove-scroll-bar.txt +26 -0
  5. package/LICENSES/shadcn-MIT.txt +21 -0
  6. package/README.md +5 -1
  7. package/THIRD_PARTY_NOTICES.md +15 -3
  8. package/dist/components/accordion.d.ts +1 -1
  9. package/dist/components/accordion.js +9 -8
  10. package/dist/components/accordion.js.map +1 -1
  11. package/dist/components/alert-dialog.d.ts +1 -1
  12. package/dist/components/alert-dialog.js +12 -11
  13. package/dist/components/alert-dialog.js.map +1 -1
  14. package/dist/components/alert.js +1 -0
  15. package/dist/components/alert.js.map +1 -1
  16. package/dist/components/app-shell.js +1 -0
  17. package/dist/components/app-shell.js.map +1 -1
  18. package/dist/components/attachment.js +1 -0
  19. package/dist/components/attachment.js.map +1 -1
  20. package/dist/components/audio-player.js +1 -0
  21. package/dist/components/audio-player.js.map +1 -1
  22. package/dist/components/avatar.d.ts +1 -1
  23. package/dist/components/avatar.js +7 -6
  24. package/dist/components/avatar.js.map +1 -1
  25. package/dist/components/badge.js +3 -3
  26. package/dist/components/badge.js.map +1 -1
  27. package/dist/components/breadcrumb.js +3 -3
  28. package/dist/components/breadcrumb.js.map +1 -1
  29. package/dist/components/button.d.ts +2 -2
  30. package/dist/components/button.js +3 -3
  31. package/dist/components/button.js.map +1 -1
  32. package/dist/components/card.d.ts +1 -1
  33. package/dist/components/card.js +1 -0
  34. package/dist/components/card.js.map +1 -1
  35. package/dist/components/chat-history.js +1 -0
  36. package/dist/components/chat-history.js.map +1 -1
  37. package/dist/components/chat-layout.js +1 -0
  38. package/dist/components/chat-layout.js.map +1 -1
  39. package/dist/components/checkbox-card.d.ts +1 -1
  40. package/dist/components/checkbox-card.js +3 -3
  41. package/dist/components/checkbox-card.js.map +1 -1
  42. package/dist/components/checkbox.d.ts +1 -1
  43. package/dist/components/checkbox.js +6 -5
  44. package/dist/components/checkbox.js.map +1 -1
  45. package/dist/components/collapsible.d.ts +1 -1
  46. package/dist/components/collapsible.js +7 -6
  47. package/dist/components/collapsible.js.map +1 -1
  48. package/dist/components/combobox.js +1 -0
  49. package/dist/components/combobox.js.map +1 -1
  50. package/dist/components/command.d.ts +1 -1
  51. package/dist/components/command.js +12 -11
  52. package/dist/components/command.js.map +1 -1
  53. package/dist/components/composer.js +1 -0
  54. package/dist/components/composer.js.map +1 -1
  55. package/dist/components/connection-status.js +1 -0
  56. package/dist/components/connection-status.js.map +1 -1
  57. package/dist/components/context-menu.d.ts +1 -1
  58. package/dist/components/context-menu.js +19 -18
  59. package/dist/components/context-menu.js.map +1 -1
  60. package/dist/components/conversation.js +1 -0
  61. package/dist/components/conversation.js.map +1 -1
  62. package/dist/components/copy-button.js +1 -0
  63. package/dist/components/copy-button.js.map +1 -1
  64. package/dist/components/data-table.js +4 -2
  65. package/dist/components/data-table.js.map +1 -1
  66. package/dist/components/dialog.d.ts +1 -1
  67. package/dist/components/dialog.js +13 -12
  68. package/dist/components/dialog.js.map +1 -1
  69. package/dist/components/dropdown-menu.d.ts +1 -1
  70. package/dist/components/dropdown-menu.js +19 -18
  71. package/dist/components/dropdown-menu.js.map +1 -1
  72. package/dist/components/editor-tabs.js +1 -0
  73. package/dist/components/editor-tabs.js.map +1 -1
  74. package/dist/components/empty-state.js +1 -0
  75. package/dist/components/empty-state.js.map +1 -1
  76. package/dist/components/field.js +1 -0
  77. package/dist/components/field.js.map +1 -1
  78. package/dist/components/icon-button.js +1 -0
  79. package/dist/components/icon-button.js.map +1 -1
  80. package/dist/components/input.js +1 -0
  81. package/dist/components/input.js.map +1 -1
  82. package/dist/components/kbd.js +1 -0
  83. package/dist/components/kbd.js.map +1 -1
  84. package/dist/components/label.d.ts +1 -1
  85. package/dist/components/label.js +5 -4
  86. package/dist/components/label.js.map +1 -1
  87. package/dist/components/markdown.js +1 -0
  88. package/dist/components/markdown.js.map +1 -1
  89. package/dist/components/menubar.d.ts +1 -1
  90. package/dist/components/menubar.js +20 -19
  91. package/dist/components/menubar.js.map +1 -1
  92. package/dist/components/message-actions.js +1 -0
  93. package/dist/components/message-actions.js.map +1 -1
  94. package/dist/components/message.js +1 -0
  95. package/dist/components/message.js.map +1 -1
  96. package/dist/components/mobile-nav.js +1 -0
  97. package/dist/components/mobile-nav.js.map +1 -1
  98. package/dist/components/navigation-menu.d.ts +1 -1
  99. package/dist/components/navigation-menu.js +12 -11
  100. package/dist/components/navigation-menu.js.map +1 -1
  101. package/dist/components/onboarding-checklist.js +1 -0
  102. package/dist/components/onboarding-checklist.js.map +1 -1
  103. package/dist/components/page-header.js +1 -0
  104. package/dist/components/page-header.js.map +1 -1
  105. package/dist/components/pagination.js +3 -2
  106. package/dist/components/pagination.js.map +1 -1
  107. package/dist/components/popover.d.ts +1 -1
  108. package/dist/components/popover.js +8 -7
  109. package/dist/components/popover.js.map +1 -1
  110. package/dist/components/progress.d.ts +1 -1
  111. package/dist/components/progress.js +6 -5
  112. package/dist/components/progress.js.map +1 -1
  113. package/dist/components/radio-group.d.ts +1 -1
  114. package/dist/components/radio-group.js +7 -6
  115. package/dist/components/radio-group.js.map +1 -1
  116. package/dist/components/reasoning.js +5 -4
  117. package/dist/components/reasoning.js.map +1 -1
  118. package/dist/components/resizable.js +1 -0
  119. package/dist/components/resizable.js.map +1 -1
  120. package/dist/components/scroll-area.d.ts +1 -1
  121. package/dist/components/scroll-area.js +9 -8
  122. package/dist/components/scroll-area.js.map +1 -1
  123. package/dist/components/secret-input.js +1 -0
  124. package/dist/components/secret-input.js.map +1 -1
  125. package/dist/components/select.d.ts +1 -1
  126. package/dist/components/select.js +23 -18
  127. package/dist/components/select.js.map +1 -1
  128. package/dist/components/separator.d.ts +1 -1
  129. package/dist/components/separator.js +5 -4
  130. package/dist/components/separator.js.map +1 -1
  131. package/dist/components/sheet.d.ts +1 -1
  132. package/dist/components/sheet.js +10 -9
  133. package/dist/components/sheet.js.map +1 -1
  134. package/dist/components/skeleton.js +1 -0
  135. package/dist/components/skeleton.js.map +1 -1
  136. package/dist/components/slider.js +1 -0
  137. package/dist/components/slider.js.map +1 -1
  138. package/dist/components/source.js +1 -0
  139. package/dist/components/source.js.map +1 -1
  140. package/dist/components/spinner.js +1 -0
  141. package/dist/components/spinner.js.map +1 -1
  142. package/dist/components/stat-card.js +1 -0
  143. package/dist/components/stat-card.js.map +1 -1
  144. package/dist/components/status.js +1 -0
  145. package/dist/components/status.js.map +1 -1
  146. package/dist/components/steps.js +1 -0
  147. package/dist/components/steps.js.map +1 -1
  148. package/dist/components/switch.d.ts +1 -1
  149. package/dist/components/switch.js +6 -5
  150. package/dist/components/switch.js.map +1 -1
  151. package/dist/components/table.js +1 -0
  152. package/dist/components/table.js.map +1 -1
  153. package/dist/components/tabs.d.ts +1 -1
  154. package/dist/components/tabs.js +8 -7
  155. package/dist/components/tabs.js.map +1 -1
  156. package/dist/components/textarea.js +1 -0
  157. package/dist/components/textarea.js.map +1 -1
  158. package/dist/components/toast.d.ts +1 -1
  159. package/dist/components/toast.js +11 -10
  160. package/dist/components/toast.js.map +1 -1
  161. package/dist/components/toaster.js +1 -0
  162. package/dist/components/toaster.js.map +1 -1
  163. package/dist/components/tool-call.js +5 -4
  164. package/dist/components/tool-call.js.map +1 -1
  165. package/dist/components/toolbar.js +1 -0
  166. package/dist/components/toolbar.js.map +1 -1
  167. package/dist/components/tooltip.d.ts +1 -1
  168. package/dist/components/tooltip.js +10 -9
  169. package/dist/components/tooltip.js.map +1 -1
  170. package/dist/components/tour.js +8 -6
  171. package/dist/components/tour.js.map +1 -1
  172. package/dist/components/tree-view.js +1 -0
  173. package/dist/components/tree-view.js.map +1 -1
  174. package/dist/components/voice-recorder.js +1 -0
  175. package/dist/components/voice-recorder.js.map +1 -1
  176. package/dist/primitives/vendor/cmdk/command-score.d.ts +1 -0
  177. package/dist/primitives/vendor/cmdk/command-score.js +64 -0
  178. package/dist/primitives/vendor/cmdk/command-score.js.map +1 -0
  179. package/dist/primitives/vendor/cmdk/index.d.ts +384 -0
  180. package/dist/primitives/vendor/cmdk/index.js +687 -0
  181. package/dist/primitives/vendor/cmdk/index.js.map +1 -0
  182. package/dist/primitives/vendor/radix/number/index.d.ts +1 -0
  183. package/dist/primitives/vendor/radix/number/number.d.ts +2 -0
  184. package/dist/primitives/vendor/radix/number/number.js +9 -0
  185. package/dist/primitives/vendor/radix/number/number.js.map +1 -0
  186. package/dist/primitives/vendor/radix/primitive/index.d.ts +2 -0
  187. package/dist/primitives/vendor/radix/primitive/is-development.d.ts +1 -0
  188. package/dist/primitives/vendor/radix/primitive/is-development.js +7 -0
  189. package/dist/primitives/vendor/radix/primitive/is-development.js.map +1 -0
  190. package/dist/primitives/vendor/radix/primitive/primitive.d.ts +14 -0
  191. package/dist/primitives/vendor/radix/primitive/primitive.js +12 -0
  192. package/dist/primitives/vendor/radix/primitive/primitive.js.map +1 -0
  193. package/dist/primitives/vendor/radix/primitive/types.d.ts +5 -0
  194. package/dist/primitives/vendor/radix/react-accordion/accordion.d.ts +112 -0
  195. package/dist/primitives/vendor/radix/react-accordion/accordion.js +266 -0
  196. package/dist/primitives/vendor/radix/react-accordion/accordion.js.map +1 -0
  197. package/dist/primitives/vendor/radix/react-accordion/index.d.ts +2 -0
  198. package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.d.ts +49 -0
  199. package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js +122 -0
  200. package/dist/primitives/vendor/radix/react-alert-dialog/alert-dialog.js.map +1 -0
  201. package/dist/primitives/vendor/radix/react-alert-dialog/index.d.ts +2 -0
  202. package/dist/primitives/vendor/radix/react-arrow/arrow.d.ts +9 -0
  203. package/dist/primitives/vendor/radix/react-arrow/arrow.js +22 -0
  204. package/dist/primitives/vendor/radix/react-arrow/arrow.js.map +1 -0
  205. package/dist/primitives/vendor/radix/react-arrow/index.d.ts +2 -0
  206. package/dist/primitives/vendor/radix/react-avatar/avatar.d.ts +19 -0
  207. package/dist/primitives/vendor/radix/react-avatar/avatar.js +132 -0
  208. package/dist/primitives/vendor/radix/react-avatar/avatar.js.map +1 -0
  209. package/dist/primitives/vendor/radix/react-avatar/index.d.ts +2 -0
  210. package/dist/primitives/vendor/radix/react-checkbox/checkbox.d.ts +47 -0
  211. package/dist/primitives/vendor/radix/react-checkbox/checkbox.js +197 -0
  212. package/dist/primitives/vendor/radix/react-checkbox/checkbox.js.map +1 -0
  213. package/dist/primitives/vendor/radix/react-checkbox/index.d.ts +2 -0
  214. package/dist/primitives/vendor/radix/react-collapsible/collapsible.d.ts +31 -0
  215. package/dist/primitives/vendor/radix/react-collapsible/collapsible.js +133 -0
  216. package/dist/primitives/vendor/radix/react-collapsible/collapsible.js.map +1 -0
  217. package/dist/primitives/vendor/radix/react-collapsible/index.d.ts +2 -0
  218. package/dist/primitives/vendor/radix/react-collection/collection-legacy.d.ts +21 -0
  219. package/dist/primitives/vendor/radix/react-collection/collection-legacy.js +84 -0
  220. package/dist/primitives/vendor/radix/react-collection/collection-legacy.js.map +1 -0
  221. package/dist/primitives/vendor/radix/react-collection/collection.d.ts +32 -0
  222. package/dist/primitives/vendor/radix/react-collection/index.d.ts +4 -0
  223. package/dist/primitives/vendor/radix/react-collection/ordered-dictionary.d.ts +51 -0
  224. package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.d.ts +13 -0
  225. package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js +43 -0
  226. package/dist/primitives/vendor/radix/react-compose-refs/compose-refs.js.map +1 -0
  227. package/dist/primitives/vendor/radix/react-compose-refs/index.d.ts +1 -0
  228. package/dist/primitives/vendor/radix/react-context/create-context.d.ts +45 -0
  229. package/dist/primitives/vendor/radix/react-context/create-context.js +74 -0
  230. package/dist/primitives/vendor/radix/react-context/create-context.js.map +1 -0
  231. package/dist/primitives/vendor/radix/react-context/index.d.ts +2 -0
  232. package/dist/primitives/vendor/radix/react-context-menu/context-menu.d.ts +95 -0
  233. package/dist/primitives/vendor/radix/react-context-menu/context-menu.js +279 -0
  234. package/dist/primitives/vendor/radix/react-context-menu/context-menu.js.map +1 -0
  235. package/dist/primitives/vendor/radix/react-context-menu/index.d.ts +2 -0
  236. package/dist/primitives/vendor/radix/react-dialog/dialog.d.ts +97 -0
  237. package/dist/primitives/vendor/radix/react-dialog/dialog.js +262 -0
  238. package/dist/primitives/vendor/radix/react-dialog/dialog.js.map +1 -0
  239. package/dist/primitives/vendor/radix/react-dialog/index.d.ts +4 -0
  240. package/dist/primitives/vendor/radix/react-direction/direction.d.ts +10 -0
  241. package/dist/primitives/vendor/radix/react-direction/direction.js +13 -0
  242. package/dist/primitives/vendor/radix/react-direction/direction.js.map +1 -0
  243. package/dist/primitives/vendor/radix/react-direction/index.d.ts +1 -0
  244. package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.d.ts +61 -0
  245. package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js +336 -0
  246. package/dist/primitives/vendor/radix/react-dismissable-layer/dismissable-layer.js.map +1 -0
  247. package/dist/primitives/vendor/radix/react-dismissable-layer/index.d.ts +4 -0
  248. package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.d.ts +95 -0
  249. package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js +257 -0
  250. package/dist/primitives/vendor/radix/react-dropdown-menu/dropdown-menu.js.map +1 -0
  251. package/dist/primitives/vendor/radix/react-dropdown-menu/index.d.ts +2 -0
  252. package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.d.ts +11 -0
  253. package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js +49 -0
  254. package/dist/primitives/vendor/radix/react-focus-guards/focus-guards.js.map +1 -0
  255. package/dist/primitives/vendor/radix/react-focus-guards/index.d.ts +1 -0
  256. package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.d.ts +31 -0
  257. package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js +221 -0
  258. package/dist/primitives/vendor/radix/react-focus-scope/focus-scope.js.map +1 -0
  259. package/dist/primitives/vendor/radix/react-focus-scope/index.d.ts +1 -0
  260. package/dist/primitives/vendor/radix/react-id/id.d.ts +2 -0
  261. package/dist/primitives/vendor/radix/react-id/id.js +17 -0
  262. package/dist/primitives/vendor/radix/react-id/id.js.map +1 -0
  263. package/dist/primitives/vendor/radix/react-id/index.d.ts +1 -0
  264. package/dist/primitives/vendor/radix/react-label/index.d.ts +2 -0
  265. package/dist/primitives/vendor/radix/react-label/label.d.ts +9 -0
  266. package/dist/primitives/vendor/radix/react-label/label.js +21 -0
  267. package/dist/primitives/vendor/radix/react-label/label.js.map +1 -0
  268. package/dist/primitives/vendor/radix/react-menu/index.d.ts +2 -0
  269. package/dist/primitives/vendor/radix/react-menu/menu.d.ts +173 -0
  270. package/dist/primitives/vendor/radix/react-menu/menu.js +806 -0
  271. package/dist/primitives/vendor/radix/react-menu/menu.js.map +1 -0
  272. package/dist/primitives/vendor/radix/react-menubar/index.d.ts +2 -0
  273. package/dist/primitives/vendor/radix/react-menubar/menubar.d.ts +106 -0
  274. package/dist/primitives/vendor/radix/react-menubar/menubar.js +377 -0
  275. package/dist/primitives/vendor/radix/react-menubar/menubar.js.map +1 -0
  276. package/dist/primitives/vendor/radix/react-navigation-menu/index.d.ts +2 -0
  277. package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.d.ts +124 -0
  278. package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js +743 -0
  279. package/dist/primitives/vendor/radix/react-navigation-menu/navigation-menu.js.map +1 -0
  280. package/dist/primitives/vendor/radix/react-popover/index.d.ts +1 -0
  281. package/dist/primitives/vendor/radix/react-popover/popover.d.ts +83 -0
  282. package/dist/primitives/vendor/radix/react-popover/popover.js +236 -0
  283. package/dist/primitives/vendor/radix/react-popover/popover.js.map +1 -0
  284. package/dist/primitives/vendor/radix/react-popper/index.d.ts +2 -0
  285. package/dist/primitives/vendor/radix/react-popper/popper.d.ts +44 -0
  286. package/dist/primitives/vendor/radix/react-popper/popper.js +276 -0
  287. package/dist/primitives/vendor/radix/react-popper/popper.js.map +1 -0
  288. package/dist/primitives/vendor/radix/react-portal/index.d.ts +2 -0
  289. package/dist/primitives/vendor/radix/react-portal/portal.d.ts +13 -0
  290. package/dist/primitives/vendor/radix/react-portal/portal.js +21 -0
  291. package/dist/primitives/vendor/radix/react-portal/portal.js.map +1 -0
  292. package/dist/primitives/vendor/radix/react-presence/index.d.ts +2 -0
  293. package/dist/primitives/vendor/radix/react-presence/presence.d.ts +11 -0
  294. package/dist/primitives/vendor/radix/react-presence/presence.js +152 -0
  295. package/dist/primitives/vendor/radix/react-presence/presence.js.map +1 -0
  296. package/dist/primitives/vendor/radix/react-presence/use-state-machine.d.ts +10 -0
  297. package/dist/primitives/vendor/radix/react-presence/use-state-machine.js +12 -0
  298. package/dist/primitives/vendor/radix/react-presence/use-state-machine.js.map +1 -0
  299. package/dist/primitives/vendor/radix/react-primitive/index.d.ts +2 -0
  300. package/dist/primitives/vendor/radix/react-primitive/primitive.d.ts +56 -0
  301. package/dist/primitives/vendor/radix/react-primitive/primitive.js +84 -0
  302. package/dist/primitives/vendor/radix/react-primitive/primitive.js.map +1 -0
  303. package/dist/primitives/vendor/radix/react-progress/index.d.ts +2 -0
  304. package/dist/primitives/vendor/radix/react-progress/progress.d.ts +17 -0
  305. package/dist/primitives/vendor/radix/react-progress/progress.js +79 -0
  306. package/dist/primitives/vendor/radix/react-progress/progress.js.map +1 -0
  307. package/dist/primitives/vendor/radix/react-radio-group/index.d.ts +2 -0
  308. package/dist/primitives/vendor/radix/react-radio-group/radio-group.d.ts +55 -0
  309. package/dist/primitives/vendor/radix/react-radio-group/radio-group.js +173 -0
  310. package/dist/primitives/vendor/radix/react-radio-group/radio-group.js.map +1 -0
  311. package/dist/primitives/vendor/radix/react-radio-group/radio.d.ts +62 -0
  312. package/dist/primitives/vendor/radix/react-radio-group/radio.js +150 -0
  313. package/dist/primitives/vendor/radix/react-radio-group/radio.js.map +1 -0
  314. package/dist/primitives/vendor/radix/react-roving-focus/index.d.ts +2 -0
  315. package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.d.ts +47 -0
  316. package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js +218 -0
  317. package/dist/primitives/vendor/radix/react-roving-focus/roving-focus-group.js.map +1 -0
  318. package/dist/primitives/vendor/radix/react-scroll-area/index.d.ts +2 -0
  319. package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.d.ts +121 -0
  320. package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js +713 -0
  321. package/dist/primitives/vendor/radix/react-scroll-area/scroll-area.js.map +1 -0
  322. package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.d.ts +10 -0
  323. package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js +12 -0
  324. package/dist/primitives/vendor/radix/react-scroll-area/use-state-machine.js.map +1 -0
  325. package/dist/primitives/vendor/radix/react-select/index.d.ts +2 -0
  326. package/dist/primitives/vendor/radix/react-select/select.d.ts +163 -0
  327. package/dist/primitives/vendor/radix/react-select/select.js +1040 -0
  328. package/dist/primitives/vendor/radix/react-select/select.js.map +1 -0
  329. package/dist/primitives/vendor/radix/react-separator/index.d.ts +2 -0
  330. package/dist/primitives/vendor/radix/react-separator/separator.d.ts +20 -0
  331. package/dist/primitives/vendor/radix/react-separator/separator.js +29 -0
  332. package/dist/primitives/vendor/radix/react-separator/separator.js.map +1 -0
  333. package/dist/primitives/vendor/radix/react-slot/index.d.ts +1 -0
  334. package/dist/primitives/vendor/radix/react-slot/slot.d.ts +29 -0
  335. package/dist/primitives/vendor/radix/react-slot/slot.js +107 -0
  336. package/dist/primitives/vendor/radix/react-slot/slot.js.map +1 -0
  337. package/dist/primitives/vendor/radix/react-switch/index.d.ts +2 -0
  338. package/dist/primitives/vendor/radix/react-switch/switch.d.ts +41 -0
  339. package/dist/primitives/vendor/radix/react-switch/switch.js +185 -0
  340. package/dist/primitives/vendor/radix/react-switch/switch.js.map +1 -0
  341. package/dist/primitives/vendor/radix/react-tabs/index.d.ts +2 -0
  342. package/dist/primitives/vendor/radix/react-tabs/tabs.d.ts +54 -0
  343. package/dist/primitives/vendor/radix/react-tabs/tabs.js +145 -0
  344. package/dist/primitives/vendor/radix/react-tabs/tabs.js.map +1 -0
  345. package/dist/primitives/vendor/radix/react-toast/index.d.ts +2 -0
  346. package/dist/primitives/vendor/radix/react-toast/toast.d.ts +125 -0
  347. package/dist/primitives/vendor/radix/react-toast/toast.js +557 -0
  348. package/dist/primitives/vendor/radix/react-toast/toast.js.map +1 -0
  349. package/dist/primitives/vendor/radix/react-tooltip/index.d.ts +2 -0
  350. package/dist/primitives/vendor/radix/react-tooltip/tooltip.d.ts +99 -0
  351. package/dist/primitives/vendor/radix/react-tooltip/tooltip.js +503 -0
  352. package/dist/primitives/vendor/radix/react-tooltip/tooltip.js.map +1 -0
  353. package/dist/primitives/vendor/radix/react-use-callback-ref/index.d.ts +1 -0
  354. package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.d.ts +6 -0
  355. package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js +18 -0
  356. package/dist/primitives/vendor/radix/react-use-callback-ref/use-callback-ref.js.map +1 -0
  357. package/dist/primitives/vendor/radix/react-use-controllable-state/index.d.ts +2 -0
  358. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state-reducer.d.ts +28 -0
  359. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.d.ts +11 -0
  360. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js +59 -0
  361. package/dist/primitives/vendor/radix/react-use-controllable-state/use-controllable-state.js.map +1 -0
  362. package/dist/primitives/vendor/radix/react-use-effect-event/index.d.ts +1 -0
  363. package/dist/primitives/vendor/radix/react-use-effect-event/use-effect-event.d.ts +7 -0
  364. package/dist/primitives/vendor/radix/react-use-is-hydrated/index.d.ts +1 -0
  365. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.d.ts +1 -0
  366. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js +18 -0
  367. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated-legacy.js.map +1 -0
  368. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.d.ts +6 -0
  369. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js +19 -0
  370. package/dist/primitives/vendor/radix/react-use-is-hydrated/use-is-hydrated.js.map +1 -0
  371. package/dist/primitives/vendor/radix/react-use-layout-effect/index.d.ts +1 -0
  372. package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.d.ts +10 -0
  373. package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js +15 -0
  374. package/dist/primitives/vendor/radix/react-use-layout-effect/use-layout-effect.js.map +1 -0
  375. package/dist/primitives/vendor/radix/react-use-previous/index.d.ts +1 -0
  376. package/dist/primitives/vendor/radix/react-use-previous/use-previous.d.ts +2 -0
  377. package/dist/primitives/vendor/radix/react-use-previous/use-previous.js +20 -0
  378. package/dist/primitives/vendor/radix/react-use-previous/use-previous.js.map +1 -0
  379. package/dist/primitives/vendor/radix/react-use-size/index.d.ts +1 -0
  380. package/dist/primitives/vendor/radix/react-use-size/use-size.d.ts +5 -0
  381. package/dist/primitives/vendor/radix/react-use-size/use-size.js +42 -0
  382. package/dist/primitives/vendor/radix/react-use-size/use-size.js.map +1 -0
  383. package/dist/primitives/vendor/radix/react-visually-hidden/index.d.ts +2 -0
  384. package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.d.ts +21 -0
  385. package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js +32 -0
  386. package/dist/primitives/vendor/radix/react-visually-hidden/visually-hidden.js.map +1 -0
  387. package/dist/primitives/vendor/radix/rect/index.d.ts +2 -0
  388. package/dist/primitives/vendor/radix/rect/observe-element-rect.d.ts +16 -0
  389. package/dist/styles.css +1 -1
  390. package/package.json +21 -11
  391. package/vendor-manifest.json +1101 -0
@@ -0,0 +1,687 @@
1
+ "use client";
2
+ "use client";
3
+ import { composeRefs } from "../radix/react-compose-refs/compose-refs.js";
4
+ import { Primitive } from "../radix/react-primitive/primitive.js";
5
+ import { useId } from "../radix/react-id/id.js";
6
+ import { Content as DialogContent, Dialog as Dialog$1, DialogOverlay, DialogPortal } from "../radix/react-dialog/dialog.js";
7
+ import { commandScore } from "./command-score.js";
8
+ import * as React from "react";
9
+ import { jsx, jsxs } from "react/jsx-runtime";
10
+ //#region src/primitives/vendor/cmdk/index.tsx
11
+ var GROUP_SELECTOR = `[cmdk-group=""]`;
12
+ var GROUP_ITEMS_SELECTOR = `[cmdk-group-items=""]`;
13
+ var GROUP_HEADING_SELECTOR = `[cmdk-group-heading=""]`;
14
+ var ITEM_SELECTOR = `[cmdk-item=""]`;
15
+ var VALID_ITEM_SELECTOR = `${ITEM_SELECTOR}:not([aria-disabled="true"])`;
16
+ var SELECT_EVENT = `cmdk-item-select`;
17
+ var VALUE_ATTR = `data-value`;
18
+ var defaultFilter = (value, search, keywords) => commandScore(value, search, keywords);
19
+ var CommandContext = React.createContext(void 0);
20
+ var useCommand = () => React.useContext(CommandContext);
21
+ var StoreContext = React.createContext(void 0);
22
+ var useStore = () => React.useContext(StoreContext);
23
+ var GroupContext = React.createContext(void 0);
24
+ var Command = React.forwardRef((props, forwardedRef) => {
25
+ const state = useLazyRef(() => ({
26
+ /** Value of the search query. */
27
+ search: "",
28
+ /** Currently selected item value. */
29
+ value: props.value ?? props.defaultValue ?? "",
30
+ /** Currently selected item id. */
31
+ selectedItemId: void 0,
32
+ filtered: {
33
+ /** The count of all visible items. */
34
+ count: 0,
35
+ /** Map from visible item id to its search score. */
36
+ items: /* @__PURE__ */ new Map(),
37
+ /** Set of groups with at least one visible item. */
38
+ groups: /* @__PURE__ */ new Set()
39
+ }
40
+ }));
41
+ const allItems = useLazyRef(() => /* @__PURE__ */ new Set());
42
+ const allGroups = useLazyRef(() => /* @__PURE__ */ new Map());
43
+ const ids = useLazyRef(() => /* @__PURE__ */ new Map());
44
+ const listeners = useLazyRef(() => /* @__PURE__ */ new Set());
45
+ const propsRef = useAsRef(props);
46
+ const { label, children, value, onValueChange, filter, shouldFilter, loop, disablePointerSelection = false, vimBindings = true, ...etc } = props;
47
+ const listId = useId();
48
+ const labelId = useId();
49
+ const inputId = useId();
50
+ const listInnerRef = React.useRef(null);
51
+ const schedule = useScheduleLayoutEffect();
52
+ /** Controlled mode `value` handling. */
53
+ useLayoutEffect(() => {
54
+ if (value !== void 0) {
55
+ const v = value.trim();
56
+ state.current.value = v;
57
+ store.emit();
58
+ }
59
+ }, [value]);
60
+ useLayoutEffect(() => {
61
+ schedule(6, scrollSelectedIntoView);
62
+ }, []);
63
+ const store = React.useMemo(() => {
64
+ return {
65
+ subscribe: (cb) => {
66
+ listeners.current.add(cb);
67
+ return () => listeners.current.delete(cb);
68
+ },
69
+ snapshot: () => {
70
+ return state.current;
71
+ },
72
+ setState: (key, value, opts) => {
73
+ if (Object.is(state.current[key], value)) return;
74
+ state.current[key] = value;
75
+ if (key === "search") {
76
+ filterItems();
77
+ sort();
78
+ schedule(1, selectFirstItem);
79
+ } else if (key === "value") {
80
+ if (document.activeElement?.hasAttribute("cmdk-input") || document.activeElement?.hasAttribute("cmdk-root")) {
81
+ const input = document.getElementById(inputId);
82
+ if (input) input.focus();
83
+ else document.getElementById(listId)?.focus();
84
+ }
85
+ schedule(7, () => {
86
+ state.current.selectedItemId = getSelectedItem()?.id;
87
+ store.emit();
88
+ });
89
+ if (!opts) schedule(5, scrollSelectedIntoView);
90
+ if (propsRef.current?.value !== void 0) {
91
+ const newValue = value ?? "";
92
+ propsRef.current.onValueChange?.(newValue);
93
+ return;
94
+ }
95
+ }
96
+ store.emit();
97
+ },
98
+ emit: () => {
99
+ listeners.current.forEach((l) => l());
100
+ }
101
+ };
102
+ }, []);
103
+ const context = React.useMemo(() => ({
104
+ value: (id, value, keywords) => {
105
+ if (value !== ids.current.get(id)?.value) {
106
+ ids.current.set(id, {
107
+ value,
108
+ keywords
109
+ });
110
+ state.current.filtered.items.set(id, score(value, keywords));
111
+ schedule(2, () => {
112
+ sort();
113
+ store.emit();
114
+ });
115
+ }
116
+ },
117
+ item: (id, groupId) => {
118
+ allItems.current.add(id);
119
+ if (groupId) {
120
+ if (!allGroups.current.has(groupId)) allGroups.current.set(groupId, /* @__PURE__ */ new Set([id]));
121
+ else allGroups.current.get(groupId).add(id);
122
+ }
123
+ schedule(3, () => {
124
+ filterItems();
125
+ sort();
126
+ if (!state.current.value) selectFirstItem();
127
+ store.emit();
128
+ });
129
+ return () => {
130
+ ids.current.delete(id);
131
+ allItems.current.delete(id);
132
+ state.current.filtered.items.delete(id);
133
+ const selectedItem = getSelectedItem();
134
+ schedule(4, () => {
135
+ filterItems();
136
+ if (selectedItem?.getAttribute("id") === id) selectFirstItem();
137
+ store.emit();
138
+ });
139
+ };
140
+ },
141
+ group: (id) => {
142
+ if (!allGroups.current.has(id)) allGroups.current.set(id, /* @__PURE__ */ new Set());
143
+ return () => {
144
+ ids.current.delete(id);
145
+ allGroups.current.delete(id);
146
+ };
147
+ },
148
+ filter: () => {
149
+ return propsRef.current.shouldFilter;
150
+ },
151
+ label: label || props["aria-label"],
152
+ getDisablePointerSelection: () => {
153
+ return propsRef.current.disablePointerSelection;
154
+ },
155
+ listId,
156
+ inputId,
157
+ labelId,
158
+ listInnerRef
159
+ }), []);
160
+ function score(value, keywords) {
161
+ const filter = propsRef.current?.filter ?? defaultFilter;
162
+ return value ? filter(value, state.current.search, keywords) : 0;
163
+ }
164
+ /** Sorts items by score, and groups by highest item score. */
165
+ function sort() {
166
+ if (!state.current.search || propsRef.current.shouldFilter === false) return;
167
+ const scores = state.current.filtered.items;
168
+ const groups = [];
169
+ state.current.filtered.groups.forEach((value) => {
170
+ const items = allGroups.current.get(value);
171
+ let max = 0;
172
+ items?.forEach((item) => {
173
+ const score = scores.get(item);
174
+ max = Math.max(score ?? 0, max);
175
+ });
176
+ groups.push([value, max]);
177
+ });
178
+ const listInsertionElement = listInnerRef.current;
179
+ getValidItems().sort((a, b) => {
180
+ const valueA = a.getAttribute("id");
181
+ const valueB = b.getAttribute("id");
182
+ return (scores.get(valueB) ?? 0) - (scores.get(valueA) ?? 0);
183
+ }).forEach((item) => {
184
+ const group = item.closest(GROUP_ITEMS_SELECTOR);
185
+ if (group) group.appendChild(item.parentElement === group ? item : item.closest(`${GROUP_ITEMS_SELECTOR} > *`));
186
+ else listInsertionElement.appendChild(item.parentElement === listInsertionElement ? item : item.closest(`${GROUP_ITEMS_SELECTOR} > *`));
187
+ });
188
+ groups.sort((a, b) => b[1] - a[1]).forEach((group) => {
189
+ const element = listInnerRef.current?.querySelector(`${GROUP_SELECTOR}[${VALUE_ATTR}="${encodeURIComponent(group[0])}"]`);
190
+ element?.parentElement?.appendChild(element);
191
+ });
192
+ }
193
+ function selectFirstItem() {
194
+ const value = getValidItems().find((item) => item.getAttribute("aria-disabled") !== "true")?.getAttribute(VALUE_ATTR);
195
+ store.setState("value", value || void 0);
196
+ }
197
+ /** Filters the current items. */
198
+ function filterItems() {
199
+ if (!state.current.search || propsRef.current.shouldFilter === false) {
200
+ state.current.filtered.count = allItems.current.size;
201
+ return;
202
+ }
203
+ state.current.filtered.groups = /* @__PURE__ */ new Set();
204
+ let itemCount = 0;
205
+ for (const id of allItems.current) {
206
+ const rank = score(ids.current.get(id)?.value ?? "", ids.current.get(id)?.keywords ?? []);
207
+ state.current.filtered.items.set(id, rank);
208
+ if (rank > 0) itemCount++;
209
+ }
210
+ for (const [groupId, group] of allGroups.current) for (const itemId of group) if ((state.current.filtered.items.get(itemId) ?? 0) > 0) {
211
+ state.current.filtered.groups.add(groupId);
212
+ break;
213
+ }
214
+ state.current.filtered.count = itemCount;
215
+ }
216
+ function scrollSelectedIntoView() {
217
+ const item = getSelectedItem();
218
+ if (item) {
219
+ if (item.parentElement?.firstChild === item) item.closest(GROUP_SELECTOR)?.querySelector(GROUP_HEADING_SELECTOR)?.scrollIntoView({ block: "nearest" });
220
+ item.scrollIntoView({ block: "nearest" });
221
+ }
222
+ }
223
+ /** Getters */
224
+ function getSelectedItem() {
225
+ return listInnerRef.current?.querySelector(`${ITEM_SELECTOR}[aria-selected="true"]`);
226
+ }
227
+ function getValidItems() {
228
+ return Array.from(listInnerRef.current?.querySelectorAll(VALID_ITEM_SELECTOR) || []);
229
+ }
230
+ /** Setters */
231
+ function updateSelectedToIndex(index) {
232
+ const item = getValidItems()[index];
233
+ if (item) store.setState("value", item.getAttribute(VALUE_ATTR));
234
+ }
235
+ function updateSelectedByItem(change) {
236
+ const selected = getSelectedItem();
237
+ const items = getValidItems();
238
+ const index = items.findIndex((item) => item === selected);
239
+ let newSelected = items[index + change];
240
+ if (propsRef.current?.loop) newSelected = index + change < 0 ? items[items.length - 1] : index + change === items.length ? items[0] : items[index + change];
241
+ if (newSelected) store.setState("value", newSelected.getAttribute(VALUE_ATTR));
242
+ }
243
+ function updateSelectedByGroup(change) {
244
+ let group = getSelectedItem()?.closest(GROUP_SELECTOR);
245
+ let item;
246
+ while (group && !item) {
247
+ group = change > 0 ? findNextSibling(group, GROUP_SELECTOR) : findPreviousSibling(group, GROUP_SELECTOR);
248
+ item = group?.querySelector(VALID_ITEM_SELECTOR);
249
+ }
250
+ if (item) store.setState("value", item.getAttribute(VALUE_ATTR));
251
+ else updateSelectedByItem(change);
252
+ }
253
+ const last = () => updateSelectedToIndex(getValidItems().length - 1);
254
+ const next = (e) => {
255
+ e.preventDefault();
256
+ if (e.metaKey) last();
257
+ else if (e.altKey) updateSelectedByGroup(1);
258
+ else updateSelectedByItem(1);
259
+ };
260
+ const prev = (e) => {
261
+ e.preventDefault();
262
+ if (e.metaKey) updateSelectedToIndex(0);
263
+ else if (e.altKey) updateSelectedByGroup(-1);
264
+ else updateSelectedByItem(-1);
265
+ };
266
+ return /* @__PURE__ */ jsxs(Primitive.div, {
267
+ ref: forwardedRef,
268
+ tabIndex: -1,
269
+ ...etc,
270
+ "cmdk-root": "",
271
+ onKeyDown: (e) => {
272
+ etc.onKeyDown?.(e);
273
+ const isComposing = e.nativeEvent.isComposing || e.keyCode === 229;
274
+ if (e.defaultPrevented || isComposing) return;
275
+ switch (e.key) {
276
+ case "n":
277
+ case "j":
278
+ if (vimBindings && e.ctrlKey) next(e);
279
+ break;
280
+ case "ArrowDown":
281
+ next(e);
282
+ break;
283
+ case "p":
284
+ case "k":
285
+ if (vimBindings && e.ctrlKey) prev(e);
286
+ break;
287
+ case "ArrowUp":
288
+ prev(e);
289
+ break;
290
+ case "Home":
291
+ e.preventDefault();
292
+ updateSelectedToIndex(0);
293
+ break;
294
+ case "End":
295
+ e.preventDefault();
296
+ last();
297
+ break;
298
+ case "Enter": {
299
+ e.preventDefault();
300
+ const item = getSelectedItem();
301
+ if (item) {
302
+ const event = new Event(SELECT_EVENT);
303
+ item.dispatchEvent(event);
304
+ }
305
+ }
306
+ }
307
+ },
308
+ children: [/* @__PURE__ */ jsx("label", {
309
+ "cmdk-label": "",
310
+ htmlFor: context.inputId,
311
+ id: context.labelId,
312
+ style: srOnlyStyles,
313
+ children: label
314
+ }), SlottableWithNestedChildren(props, (child) => /* @__PURE__ */ jsx(StoreContext.Provider, {
315
+ value: store,
316
+ children: /* @__PURE__ */ jsx(CommandContext.Provider, {
317
+ value: context,
318
+ children: child
319
+ })
320
+ }))]
321
+ });
322
+ });
323
+ /**
324
+ * Command menu item. Becomes active on pointer enter or through keyboard navigation.
325
+ * Preferably pass a `value`, otherwise the value will be inferred from `children` or
326
+ * the rendered item's `textContent`.
327
+ */
328
+ var Item = React.forwardRef((props, forwardedRef) => {
329
+ const id = useId();
330
+ const ref = React.useRef(null);
331
+ const groupContext = React.useContext(GroupContext);
332
+ const context = useCommand();
333
+ const propsRef = useAsRef(props);
334
+ const forceMount = propsRef.current?.forceMount ?? groupContext?.forceMount;
335
+ useLayoutEffect(() => {
336
+ if (!forceMount) return context.item(id, groupContext?.id);
337
+ }, [forceMount]);
338
+ const value = useValue(id, ref, [
339
+ props.value,
340
+ props.children,
341
+ ref
342
+ ], props.keywords);
343
+ const store = useStore();
344
+ const selected = useCmdk((state) => state.value && state.value === value.current);
345
+ const render = useCmdk((state) => forceMount ? true : context.filter() === false ? true : !state.search ? true : (state.filtered.items.get(id) ?? 0) > 0);
346
+ React.useEffect(() => {
347
+ const element = ref.current;
348
+ if (!element || props.disabled) return;
349
+ element.addEventListener(SELECT_EVENT, onSelect);
350
+ return () => element.removeEventListener(SELECT_EVENT, onSelect);
351
+ }, [
352
+ render,
353
+ props.onSelect,
354
+ props.disabled
355
+ ]);
356
+ function onSelect() {
357
+ select();
358
+ propsRef.current.onSelect?.(value.current);
359
+ }
360
+ function select() {
361
+ store.setState("value", value.current, true);
362
+ }
363
+ if (!render) return null;
364
+ const { disabled, value: _, onSelect: __, forceMount: ___, keywords: ____, ...etc } = props;
365
+ return /* @__PURE__ */ jsx(Primitive.div, {
366
+ ref: composeRefs(ref, forwardedRef),
367
+ ...etc,
368
+ id,
369
+ "cmdk-item": "",
370
+ role: "option",
371
+ "aria-disabled": Boolean(disabled),
372
+ "aria-selected": Boolean(selected),
373
+ "data-disabled": Boolean(disabled),
374
+ "data-selected": Boolean(selected),
375
+ onPointerMove: disabled || context.getDisablePointerSelection() ? void 0 : select,
376
+ onClick: disabled ? void 0 : onSelect,
377
+ children: props.children
378
+ });
379
+ });
380
+ /**
381
+ * Group command menu items together with a heading.
382
+ * Grouped items are always shown together.
383
+ */
384
+ var Group = React.forwardRef((props, forwardedRef) => {
385
+ const { heading, children, forceMount, ...etc } = props;
386
+ const id = useId();
387
+ const ref = React.useRef(null);
388
+ const headingRef = React.useRef(null);
389
+ const headingId = useId();
390
+ const context = useCommand();
391
+ const render = useCmdk((state) => forceMount ? true : context.filter() === false ? true : !state.search ? true : state.filtered.groups.has(id));
392
+ useLayoutEffect(() => {
393
+ return context.group(id);
394
+ }, []);
395
+ useValue(id, ref, [
396
+ props.value,
397
+ props.heading,
398
+ headingRef
399
+ ]);
400
+ const contextValue = React.useMemo(() => ({
401
+ id,
402
+ forceMount
403
+ }), [forceMount]);
404
+ return /* @__PURE__ */ jsxs(Primitive.div, {
405
+ ref: composeRefs(ref, forwardedRef),
406
+ ...etc,
407
+ "cmdk-group": "",
408
+ role: "presentation",
409
+ hidden: render ? void 0 : true,
410
+ children: [heading && /* @__PURE__ */ jsx("div", {
411
+ ref: headingRef,
412
+ "cmdk-group-heading": "",
413
+ "aria-hidden": true,
414
+ id: headingId,
415
+ children: heading
416
+ }), SlottableWithNestedChildren(props, (child) => /* @__PURE__ */ jsx("div", {
417
+ "cmdk-group-items": "",
418
+ role: "group",
419
+ "aria-labelledby": heading ? headingId : void 0,
420
+ children: /* @__PURE__ */ jsx(GroupContext.Provider, {
421
+ value: contextValue,
422
+ children: child
423
+ })
424
+ }))]
425
+ });
426
+ });
427
+ /**
428
+ * A visual and semantic separator between items or groups.
429
+ * Visible when the search query is empty or `alwaysRender` is true, hidden otherwise.
430
+ */
431
+ var Separator = React.forwardRef((props, forwardedRef) => {
432
+ const { alwaysRender, ...etc } = props;
433
+ const ref = React.useRef(null);
434
+ const render = useCmdk((state) => !state.search);
435
+ if (!alwaysRender && !render) return null;
436
+ return /* @__PURE__ */ jsx(Primitive.div, {
437
+ ref: composeRefs(ref, forwardedRef),
438
+ ...etc,
439
+ "cmdk-separator": "",
440
+ role: "separator"
441
+ });
442
+ });
443
+ /**
444
+ * Command menu input.
445
+ * All props are forwarded to the underyling `input` element.
446
+ */
447
+ var Input = React.forwardRef((props, forwardedRef) => {
448
+ const { onValueChange, ...etc } = props;
449
+ const isControlled = props.value != null;
450
+ const store = useStore();
451
+ const search = useCmdk((state) => state.search);
452
+ const selectedItemId = useCmdk((state) => state.selectedItemId);
453
+ const context = useCommand();
454
+ React.useEffect(() => {
455
+ if (props.value != null) store.setState("search", props.value);
456
+ }, [props.value]);
457
+ return /* @__PURE__ */ jsx(Primitive.input, {
458
+ ref: forwardedRef,
459
+ ...etc,
460
+ "cmdk-input": "",
461
+ autoComplete: "off",
462
+ autoCorrect: "off",
463
+ spellCheck: false,
464
+ "aria-autocomplete": "list",
465
+ role: "combobox",
466
+ "aria-expanded": true,
467
+ "aria-controls": context.listId,
468
+ "aria-labelledby": context.labelId,
469
+ "aria-activedescendant": selectedItemId,
470
+ id: context.inputId,
471
+ type: "text",
472
+ value: isControlled ? props.value : search,
473
+ onChange: (e) => {
474
+ if (!isControlled) store.setState("search", e.target.value);
475
+ onValueChange?.(e.target.value);
476
+ }
477
+ });
478
+ });
479
+ /**
480
+ * Contains `Item`, `Group`, and `Separator`.
481
+ * Use the `--cmdk-list-height` CSS variable to animate height based on the number of results.
482
+ */
483
+ var List = React.forwardRef((props, forwardedRef) => {
484
+ const { children, label = "Suggestions", ...etc } = props;
485
+ const ref = React.useRef(null);
486
+ const height = React.useRef(null);
487
+ const selectedItemId = useCmdk((state) => state.selectedItemId);
488
+ const context = useCommand();
489
+ React.useEffect(() => {
490
+ if (height.current && ref.current) {
491
+ const el = height.current;
492
+ const wrapper = ref.current;
493
+ let animationFrame = 0;
494
+ const observer = new ResizeObserver(() => {
495
+ animationFrame = requestAnimationFrame(() => {
496
+ const height = el.offsetHeight;
497
+ wrapper.style.setProperty(`--cmdk-list-height`, height.toFixed(1) + "px");
498
+ });
499
+ });
500
+ observer.observe(el);
501
+ return () => {
502
+ cancelAnimationFrame(animationFrame);
503
+ observer.unobserve(el);
504
+ };
505
+ }
506
+ }, []);
507
+ return /* @__PURE__ */ jsx(Primitive.div, {
508
+ ref: composeRefs(ref, forwardedRef),
509
+ ...etc,
510
+ "cmdk-list": "",
511
+ role: "listbox",
512
+ tabIndex: -1,
513
+ "aria-activedescendant": selectedItemId,
514
+ "aria-label": label,
515
+ id: context.listId,
516
+ children: SlottableWithNestedChildren(props, (child) => /* @__PURE__ */ jsx("div", {
517
+ ref: composeRefs(height, context.listInnerRef),
518
+ "cmdk-list-sizer": "",
519
+ children: child
520
+ }))
521
+ });
522
+ });
523
+ /**
524
+ * Renders the command menu in a Radix Dialog.
525
+ */
526
+ var Dialog = React.forwardRef((props, forwardedRef) => {
527
+ const { open, onOpenChange, overlayClassName, contentClassName, container, ...etc } = props;
528
+ return /* @__PURE__ */ jsx(Dialog$1, {
529
+ open,
530
+ onOpenChange,
531
+ children: /* @__PURE__ */ jsxs(DialogPortal, {
532
+ container,
533
+ children: [/* @__PURE__ */ jsx(DialogOverlay, {
534
+ "cmdk-overlay": "",
535
+ className: overlayClassName
536
+ }), /* @__PURE__ */ jsx(DialogContent, {
537
+ "aria-label": props.label,
538
+ "cmdk-dialog": "",
539
+ className: contentClassName,
540
+ children: /* @__PURE__ */ jsx(Command, {
541
+ ref: forwardedRef,
542
+ ...etc
543
+ })
544
+ })]
545
+ })
546
+ });
547
+ });
548
+ /**
549
+ * Automatically renders when there are no results for the search query.
550
+ */
551
+ var Empty = React.forwardRef((props, forwardedRef) => {
552
+ if (!useCmdk((state) => state.filtered.count === 0)) return null;
553
+ return /* @__PURE__ */ jsx(Primitive.div, {
554
+ ref: forwardedRef,
555
+ ...props,
556
+ "cmdk-empty": "",
557
+ role: "presentation"
558
+ });
559
+ });
560
+ /**
561
+ * You should conditionally render this with `progress` while loading asynchronous items.
562
+ */
563
+ var Loading = React.forwardRef((props, forwardedRef) => {
564
+ const { progress, children, label = "Loading...", ...etc } = props;
565
+ return /* @__PURE__ */ jsx(Primitive.div, {
566
+ ref: forwardedRef,
567
+ ...etc,
568
+ "cmdk-loading": "",
569
+ role: "progressbar",
570
+ "aria-valuenow": progress,
571
+ "aria-valuemin": 0,
572
+ "aria-valuemax": 100,
573
+ "aria-label": label,
574
+ children: SlottableWithNestedChildren(props, (child) => /* @__PURE__ */ jsx("div", {
575
+ "aria-hidden": true,
576
+ children: child
577
+ }))
578
+ });
579
+ });
580
+ var pkg = Object.assign(Command, {
581
+ List,
582
+ Item,
583
+ Input,
584
+ Group,
585
+ Separator,
586
+ Dialog,
587
+ Empty,
588
+ Loading
589
+ });
590
+ /**
591
+ *
592
+ *
593
+ * Helpers
594
+ *
595
+ *
596
+ */
597
+ function findNextSibling(el, selector) {
598
+ let sibling = el.nextElementSibling;
599
+ while (sibling) {
600
+ if (sibling.matches(selector)) return sibling;
601
+ sibling = sibling.nextElementSibling;
602
+ }
603
+ }
604
+ function findPreviousSibling(el, selector) {
605
+ let sibling = el.previousElementSibling;
606
+ while (sibling) {
607
+ if (sibling.matches(selector)) return sibling;
608
+ sibling = sibling.previousElementSibling;
609
+ }
610
+ }
611
+ function useAsRef(data) {
612
+ const ref = React.useRef(data);
613
+ useLayoutEffect(() => {
614
+ ref.current = data;
615
+ });
616
+ return ref;
617
+ }
618
+ var useLayoutEffect = typeof window === "undefined" ? React.useEffect : React.useLayoutEffect;
619
+ function useLazyRef(fn) {
620
+ const ref = React.useRef(void 0);
621
+ if (ref.current === void 0) ref.current = fn();
622
+ return ref;
623
+ }
624
+ /** Run a selector against the store state. */
625
+ function useCmdk(selector) {
626
+ const store = useStore();
627
+ const cb = () => selector(store.snapshot());
628
+ return React.useSyncExternalStore(store.subscribe, cb, cb);
629
+ }
630
+ function useValue(id, ref, deps, aliases = []) {
631
+ const valueRef = React.useRef(void 0);
632
+ const context = useCommand();
633
+ useLayoutEffect(() => {
634
+ const value = (() => {
635
+ for (const part of deps) {
636
+ if (typeof part === "string") return part.trim();
637
+ if (part !== null && typeof part === "object" && "current" in part) {
638
+ if (part.current) return part.current.textContent?.trim();
639
+ return valueRef.current;
640
+ }
641
+ }
642
+ })();
643
+ const keywords = aliases.map((alias) => alias.trim());
644
+ context.value(id, value, keywords);
645
+ ref.current?.setAttribute(VALUE_ATTR, value);
646
+ valueRef.current = value;
647
+ });
648
+ return valueRef;
649
+ }
650
+ /** Imperatively run a function on the next layout effect cycle. */
651
+ var useScheduleLayoutEffect = () => {
652
+ const [s, ss] = React.useState();
653
+ const fns = useLazyRef(() => /* @__PURE__ */ new Map());
654
+ useLayoutEffect(() => {
655
+ fns.current.forEach((f) => f());
656
+ fns.current = /* @__PURE__ */ new Map();
657
+ }, [s]);
658
+ return (id, cb) => {
659
+ fns.current.set(id, cb);
660
+ ss({});
661
+ };
662
+ };
663
+ function renderChildren(children) {
664
+ const childrenType = children.type;
665
+ if (typeof childrenType === "function") return childrenType(children.props);
666
+ else if ("render" in childrenType) return childrenType.render(children.props);
667
+ else return children;
668
+ }
669
+ function SlottableWithNestedChildren({ asChild, children }, render) {
670
+ if (asChild && React.isValidElement(children)) return React.cloneElement(renderChildren(children), { ref: children.ref }, render(children.props.children));
671
+ return render(children);
672
+ }
673
+ var srOnlyStyles = {
674
+ position: "absolute",
675
+ width: "1px",
676
+ height: "1px",
677
+ padding: "0",
678
+ margin: "-1px",
679
+ overflow: "hidden",
680
+ clip: "rect(0, 0, 0, 0)",
681
+ whiteSpace: "nowrap",
682
+ borderWidth: "0"
683
+ };
684
+ //#endregion
685
+ export { pkg as Command, Dialog as CommandDialog, Empty as CommandEmpty, Group as CommandGroup, Input as CommandInput, Item as CommandItem, List as CommandList, Loading as CommandLoading, Command as CommandRoot, Separator as CommandSeparator, defaultFilter, useCmdk as useCommandState };
686
+
687
+ //# sourceMappingURL=index.js.map