@nadicodeai/ui 12.1.102 → 12.1.103

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 (562) hide show
  1. package/dist/components/accordion.d.ts +38 -12
  2. package/dist/components/accordion.d.ts.map +1 -1
  3. package/dist/components/accordion.js +36 -15
  4. package/dist/components/account-menu.js +2 -2
  5. package/dist/components/action-menu.d.ts +20 -19
  6. package/dist/components/action-menu.d.ts.map +1 -1
  7. package/dist/components/action-menu.js +22 -15
  8. package/dist/components/action-status.d.ts +14 -10
  9. package/dist/components/action-status.d.ts.map +1 -1
  10. package/dist/components/action-status.js +14 -10
  11. package/dist/components/activity-calendar.d.ts +3 -1
  12. package/dist/components/activity-calendar.d.ts.map +1 -1
  13. package/dist/components/activity-calendar.js +16 -2
  14. package/dist/components/activity-feed.d.ts +2 -2
  15. package/dist/components/activity-feed.d.ts.map +1 -1
  16. package/dist/components/activity-feed.js +14 -5
  17. package/dist/components/agent-card.d.ts +11 -5
  18. package/dist/components/agent-card.d.ts.map +1 -1
  19. package/dist/components/agent-card.js +13 -7
  20. package/dist/components/agent-list-row.js +1 -1
  21. package/dist/components/agent-orb-appearance.d.ts +7 -1
  22. package/dist/components/agent-orb-appearance.d.ts.map +1 -1
  23. package/dist/components/agent-orb-appearance.js +26 -0
  24. package/dist/components/agent-profile.d.ts +8 -7
  25. package/dist/components/agent-profile.d.ts.map +1 -1
  26. package/dist/components/agent-profile.js +6 -6
  27. package/dist/components/alert-dialog.d.ts +25 -16
  28. package/dist/components/alert-dialog.d.ts.map +1 -1
  29. package/dist/components/alert-dialog.js +30 -18
  30. package/dist/components/alert.d.ts +1 -1
  31. package/dist/components/avatar.d.ts +83 -17
  32. package/dist/components/avatar.d.ts.map +1 -1
  33. package/dist/components/avatar.js +89 -23
  34. package/dist/components/badge.d.ts +59 -8
  35. package/dist/components/badge.d.ts.map +1 -1
  36. package/dist/components/badge.js +57 -14
  37. package/dist/components/breadcrumb.d.ts +18 -7
  38. package/dist/components/breadcrumb.d.ts.map +1 -1
  39. package/dist/components/breadcrumb.js +37 -13
  40. package/dist/components/button-group.d.ts +12 -15
  41. package/dist/components/button-group.d.ts.map +1 -1
  42. package/dist/components/button-group.js +13 -17
  43. package/dist/components/button.d.ts +126 -23
  44. package/dist/components/button.d.ts.map +1 -1
  45. package/dist/components/button.js +164 -39
  46. package/dist/components/calendar.d.ts +26 -15
  47. package/dist/components/calendar.d.ts.map +1 -1
  48. package/dist/components/calendar.js +60 -46
  49. package/dist/components/card-row.d.ts +13 -5
  50. package/dist/components/card-row.d.ts.map +1 -1
  51. package/dist/components/card-row.js +24 -10
  52. package/dist/components/card.d.ts +6 -12
  53. package/dist/components/card.d.ts.map +1 -1
  54. package/dist/components/card.js +11 -16
  55. package/dist/components/carousel.d.ts +3 -3
  56. package/dist/components/carousel.d.ts.map +1 -1
  57. package/dist/components/carousel.js +7 -7
  58. package/dist/components/catalog-drawer.d.ts +7 -7
  59. package/dist/components/catalog-drawer.d.ts.map +1 -1
  60. package/dist/components/catalog-drawer.js +6 -6
  61. package/dist/components/chart-area-stacked.d.ts +1 -1
  62. package/dist/components/chart-area-stacked.d.ts.map +1 -1
  63. package/dist/components/chart-area-stacked.js +4 -4
  64. package/dist/components/chart-axis.d.ts +14 -1
  65. package/dist/components/chart-axis.d.ts.map +1 -1
  66. package/dist/components/chart-axis.js +11 -1
  67. package/dist/components/chart-bar-horizontal.d.ts +2 -2
  68. package/dist/components/chart-bar-horizontal.d.ts.map +1 -1
  69. package/dist/components/chart-bar-horizontal.js +14 -5
  70. package/dist/components/chart-bar-multiple.d.ts +1 -1
  71. package/dist/components/chart-bar-multiple.d.ts.map +1 -1
  72. package/dist/components/chart-bar-multiple.js +3 -3
  73. package/dist/components/chart-bar-stacked.d.ts +1 -1
  74. package/dist/components/chart-bar-stacked.d.ts.map +1 -1
  75. package/dist/components/chart-bar-stacked.js +3 -3
  76. package/dist/components/chart-card.d.ts +17 -6
  77. package/dist/components/chart-card.d.ts.map +1 -1
  78. package/dist/components/chart-card.js +11 -4
  79. package/dist/components/chart-date-range-control.d.ts +18 -9
  80. package/dist/components/chart-date-range-control.d.ts.map +1 -1
  81. package/dist/components/chart-date-range-control.js +43 -47
  82. package/dist/components/chart-sparkline.d.ts +4 -3
  83. package/dist/components/chart-sparkline.d.ts.map +1 -1
  84. package/dist/components/chart-sparkline.js +6 -5
  85. package/dist/components/check-counts.d.ts +44 -0
  86. package/dist/components/check-counts.d.ts.map +1 -0
  87. package/dist/components/check-counts.js +51 -0
  88. package/dist/components/checkbox.d.ts +39 -11
  89. package/dist/components/checkbox.d.ts.map +1 -1
  90. package/dist/components/checkbox.js +38 -11
  91. package/dist/components/choicebox.d.ts +96 -0
  92. package/dist/components/choicebox.d.ts.map +1 -0
  93. package/dist/components/choicebox.js +113 -0
  94. package/dist/components/clearable-input.d.ts +57 -0
  95. package/dist/components/clearable-input.d.ts.map +1 -0
  96. package/dist/components/clearable-input.js +58 -0
  97. package/dist/components/code-block.d.ts +77 -17
  98. package/dist/components/code-block.d.ts.map +1 -1
  99. package/dist/components/code-block.js +85 -15
  100. package/dist/components/collapsible.d.ts +27 -10
  101. package/dist/components/collapsible.d.ts.map +1 -1
  102. package/dist/components/collapsible.js +24 -9
  103. package/dist/components/collection-filters.d.ts +3 -1
  104. package/dist/components/collection-filters.d.ts.map +1 -1
  105. package/dist/components/collection-filters.js +7 -9
  106. package/dist/components/collection-page.d.ts +31 -10
  107. package/dist/components/collection-page.d.ts.map +1 -1
  108. package/dist/components/collection-page.js +14 -13
  109. package/dist/components/collection-search.d.ts +32 -10
  110. package/dist/components/collection-search.d.ts.map +1 -1
  111. package/dist/components/collection-search.js +24 -13
  112. package/dist/components/collection-sort.d.ts.map +1 -1
  113. package/dist/components/collection-sort.js +2 -2
  114. package/dist/components/collection-toolbar.d.ts +5 -2
  115. package/dist/components/collection-toolbar.d.ts.map +1 -1
  116. package/dist/components/collection-toolbar.js +7 -4
  117. package/dist/components/combobox.d.ts +97 -22
  118. package/dist/components/combobox.d.ts.map +1 -1
  119. package/dist/components/combobox.js +80 -28
  120. package/dist/components/command.d.ts +34 -21
  121. package/dist/components/command.d.ts.map +1 -1
  122. package/dist/components/command.js +33 -25
  123. package/dist/components/confirm-dialog.d.ts +23 -6
  124. package/dist/components/confirm-dialog.d.ts.map +1 -1
  125. package/dist/components/confirm-dialog.js +32 -13
  126. package/dist/components/context-menu.d.ts +14 -10
  127. package/dist/components/context-menu.d.ts.map +1 -1
  128. package/dist/components/context-menu.js +17 -12
  129. package/dist/components/copy-button.d.ts +5 -2
  130. package/dist/components/copy-button.d.ts.map +1 -1
  131. package/dist/components/copy-button.js +16 -8
  132. package/dist/components/data-table.d.ts +120 -54
  133. package/dist/components/data-table.d.ts.map +1 -1
  134. package/dist/components/data-table.js +163 -92
  135. package/dist/components/desktop-shell.d.ts +4 -2
  136. package/dist/components/desktop-shell.d.ts.map +1 -1
  137. package/dist/components/desktop-shell.js +3 -3
  138. package/dist/components/dialog.d.ts +63 -24
  139. package/dist/components/dialog.d.ts.map +1 -1
  140. package/dist/components/dialog.js +52 -31
  141. package/dist/components/disclosure-row.d.ts +1 -2
  142. package/dist/components/disclosure-row.d.ts.map +1 -1
  143. package/dist/components/disclosure-row.js +1 -2
  144. package/dist/components/disclosure.d.ts +1 -1
  145. package/dist/components/disclosure.js +1 -1
  146. package/dist/components/drawer.d.ts +33 -12
  147. package/dist/components/drawer.d.ts.map +1 -1
  148. package/dist/components/drawer.js +47 -35
  149. package/dist/components/dropdown-menu.d.ts +59 -14
  150. package/dist/components/dropdown-menu.d.ts.map +1 -1
  151. package/dist/components/dropdown-menu.js +58 -26
  152. package/dist/components/empty-state.d.ts +35 -12
  153. package/dist/components/empty-state.d.ts.map +1 -1
  154. package/dist/components/empty-state.js +35 -17
  155. package/dist/components/entry-scene.d.ts +4 -4
  156. package/dist/components/entry-scene.d.ts.map +1 -1
  157. package/dist/components/entry-scene.js +2 -2
  158. package/dist/components/field.d.ts +44 -14
  159. package/dist/components/field.d.ts.map +1 -1
  160. package/dist/components/field.js +49 -20
  161. package/dist/components/file-diff.d.ts.map +1 -1
  162. package/dist/components/file-diff.js +3 -4
  163. package/dist/components/form-dialog.d.ts +7 -7
  164. package/dist/components/form-dialog.d.ts.map +1 -1
  165. package/dist/components/form-dialog.js +13 -11
  166. package/dist/components/form-drawer.d.ts +10 -7
  167. package/dist/components/form-drawer.d.ts.map +1 -1
  168. package/dist/components/form-drawer.js +11 -10
  169. package/dist/components/gauge.d.ts +64 -0
  170. package/dist/components/gauge.d.ts.map +1 -0
  171. package/dist/components/gauge.js +73 -0
  172. package/dist/components/hover-card.d.ts +72 -14
  173. package/dist/components/hover-card.d.ts.map +1 -1
  174. package/dist/components/hover-card.js +51 -17
  175. package/dist/components/identity-mark.d.ts +8 -1
  176. package/dist/components/identity-mark.d.ts.map +1 -1
  177. package/dist/components/identity-mark.js +31 -5
  178. package/dist/components/input-group.d.ts +44 -21
  179. package/dist/components/input-group.d.ts.map +1 -1
  180. package/dist/components/input-group.js +74 -27
  181. package/dist/components/input.d.ts +64 -12
  182. package/dist/components/input.d.ts.map +1 -1
  183. package/dist/components/input.js +51 -15
  184. package/dist/components/item.d.ts +37 -15
  185. package/dist/components/item.d.ts.map +1 -1
  186. package/dist/components/item.js +41 -22
  187. package/dist/components/kbd.d.ts +49 -13
  188. package/dist/components/kbd.d.ts.map +1 -1
  189. package/dist/components/kbd.js +115 -16
  190. package/dist/components/kpi-card.d.ts +12 -4
  191. package/dist/components/kpi-card.d.ts.map +1 -1
  192. package/dist/components/kpi-card.js +13 -4
  193. package/dist/components/label.d.ts +17 -10
  194. package/dist/components/label.d.ts.map +1 -1
  195. package/dist/components/label.js +18 -11
  196. package/dist/components/library-shelf.d.ts +6 -6
  197. package/dist/components/library-shelf.d.ts.map +1 -1
  198. package/dist/components/library-shelf.js +5 -5
  199. package/dist/components/load-more-button.d.ts +35 -0
  200. package/dist/components/load-more-button.d.ts.map +1 -0
  201. package/dist/components/load-more-button.js +26 -0
  202. package/dist/components/message-notice.d.ts +8 -13
  203. package/dist/components/message-notice.d.ts.map +1 -1
  204. package/dist/components/message-notice.js +25 -22
  205. package/dist/components/middle-truncate.d.ts +33 -0
  206. package/dist/components/middle-truncate.d.ts.map +1 -0
  207. package/dist/components/middle-truncate.js +72 -0
  208. package/dist/components/multi-select.d.ts +94 -0
  209. package/dist/components/multi-select.d.ts.map +1 -0
  210. package/dist/components/multi-select.js +132 -0
  211. package/dist/components/native-select.d.ts +37 -13
  212. package/dist/components/native-select.d.ts.map +1 -1
  213. package/dist/components/native-select.js +27 -11
  214. package/dist/components/notice-banner.d.ts +17 -10
  215. package/dist/components/notice-banner.d.ts.map +1 -1
  216. package/dist/components/notice-banner.js +12 -11
  217. package/dist/components/numbered-steps.d.ts +10 -4
  218. package/dist/components/numbered-steps.d.ts.map +1 -1
  219. package/dist/components/numbered-steps.js +9 -7
  220. package/dist/components/object-page.d.ts +40 -14
  221. package/dist/components/object-page.d.ts.map +1 -1
  222. package/dist/components/object-page.js +12 -10
  223. package/dist/components/object-workspace.d.ts +29 -10
  224. package/dist/components/object-workspace.d.ts.map +1 -1
  225. package/dist/components/object-workspace.js +18 -8
  226. package/dist/components/overview-page.d.ts +2 -2
  227. package/dist/components/overview-page.d.ts.map +1 -1
  228. package/dist/components/overview-page.js +8 -7
  229. package/dist/components/page-actions.d.ts +28 -8
  230. package/dist/components/page-actions.d.ts.map +1 -1
  231. package/dist/components/page-actions.js +22 -25
  232. package/dist/components/page-header.d.ts +11 -4
  233. package/dist/components/page-header.d.ts.map +1 -1
  234. package/dist/components/page-header.js +10 -5
  235. package/dist/components/pending-label.d.ts +6 -5
  236. package/dist/components/pending-label.d.ts.map +1 -1
  237. package/dist/components/pending-label.js +14 -6
  238. package/dist/components/picture-label.d.ts +2 -2
  239. package/dist/components/picture-label.d.ts.map +1 -1
  240. package/dist/components/picture-label.js +3 -3
  241. package/dist/components/portal-sidebar-frame.d.ts +9 -21
  242. package/dist/components/portal-sidebar-frame.d.ts.map +1 -1
  243. package/dist/components/portal-sidebar-frame.js +13 -27
  244. package/dist/components/progress-checklist.d.ts +46 -0
  245. package/dist/components/progress-checklist.d.ts.map +1 -0
  246. package/dist/components/progress-checklist.js +46 -0
  247. package/dist/components/progress.d.ts +48 -8
  248. package/dist/components/progress.d.ts.map +1 -1
  249. package/dist/components/progress.js +92 -16
  250. package/dist/components/prose.d.ts +19 -0
  251. package/dist/components/prose.d.ts.map +1 -0
  252. package/dist/components/prose.js +29 -0
  253. package/dist/components/radio-group.d.ts +51 -12
  254. package/dist/components/radio-group.d.ts.map +1 -1
  255. package/dist/components/radio-group.js +42 -12
  256. package/dist/components/reading-column.js +1 -1
  257. package/dist/components/record-identity.d.ts +6 -5
  258. package/dist/components/record-identity.d.ts.map +1 -1
  259. package/dist/components/record-identity.js +12 -3
  260. package/dist/components/record-list.d.ts +117 -27
  261. package/dist/components/record-list.d.ts.map +1 -1
  262. package/dist/components/record-list.js +185 -55
  263. package/dist/components/record-time.d.ts +20 -7
  264. package/dist/components/record-time.d.ts.map +1 -1
  265. package/dist/components/record-time.js +38 -19
  266. package/dist/components/resizable.d.ts +7 -5
  267. package/dist/components/resizable.d.ts.map +1 -1
  268. package/dist/components/resizable.js +6 -6
  269. package/dist/components/scope-switcher.d.ts +2 -0
  270. package/dist/components/scope-switcher.d.ts.map +1 -1
  271. package/dist/components/scope-switcher.js +2 -2
  272. package/dist/components/scroll-area.d.ts +47 -11
  273. package/dist/components/scroll-area.d.ts.map +1 -1
  274. package/dist/components/scroll-area.js +72 -14
  275. package/dist/components/segmented-control.d.ts +82 -0
  276. package/dist/components/segmented-control.d.ts.map +1 -0
  277. package/dist/components/segmented-control.js +90 -0
  278. package/dist/components/select.d.ts +55 -15
  279. package/dist/components/select.d.ts.map +1 -1
  280. package/dist/components/select.js +62 -19
  281. package/dist/components/separator.d.ts +12 -5
  282. package/dist/components/separator.d.ts.map +1 -1
  283. package/dist/components/separator.js +11 -6
  284. package/dist/components/settings-facts.d.ts +34 -14
  285. package/dist/components/settings-facts.d.ts.map +1 -1
  286. package/dist/components/settings-facts.js +21 -12
  287. package/dist/components/settings-page.d.ts +4 -4
  288. package/dist/components/settings-page.js +5 -5
  289. package/dist/components/settings-section.d.ts +160 -34
  290. package/dist/components/settings-section.d.ts.map +1 -1
  291. package/dist/components/settings-section.js +92 -39
  292. package/dist/components/sheet.d.ts +47 -16
  293. package/dist/components/sheet.d.ts.map +1 -1
  294. package/dist/components/sheet.js +40 -19
  295. package/dist/components/sidebar-sections.d.ts +16 -12
  296. package/dist/components/sidebar-sections.d.ts.map +1 -1
  297. package/dist/components/sidebar-sections.js +30 -15
  298. package/dist/components/sidebar.d.ts +117 -21
  299. package/dist/components/sidebar.d.ts.map +1 -1
  300. package/dist/components/sidebar.js +180 -55
  301. package/dist/components/skeleton.d.ts +54 -8
  302. package/dist/components/skeleton.d.ts.map +1 -1
  303. package/dist/components/skeleton.js +44 -9
  304. package/dist/components/slider.d.ts +53 -11
  305. package/dist/components/slider.d.ts.map +1 -1
  306. package/dist/components/slider.js +71 -17
  307. package/dist/components/snippet.d.ts +57 -0
  308. package/dist/components/snippet.d.ts.map +1 -0
  309. package/dist/components/snippet.js +60 -0
  310. package/dist/components/sonner.d.ts +13 -14
  311. package/dist/components/sonner.d.ts.map +1 -1
  312. package/dist/components/sonner.js +25 -22
  313. package/dist/components/status-badge.d.ts +37 -11
  314. package/dist/components/status-badge.d.ts.map +1 -1
  315. package/dist/components/status-badge.js +63 -15
  316. package/dist/components/status-dot.d.ts +42 -11
  317. package/dist/components/status-dot.d.ts.map +1 -1
  318. package/dist/components/status-dot.js +40 -11
  319. package/dist/components/switch.d.ts +43 -12
  320. package/dist/components/switch.d.ts.map +1 -1
  321. package/dist/components/switch.js +42 -12
  322. package/dist/components/table-card.d.ts +21 -12
  323. package/dist/components/table-card.d.ts.map +1 -1
  324. package/dist/components/table-card.js +17 -9
  325. package/dist/components/table-layouts.d.ts +40 -8
  326. package/dist/components/table-layouts.d.ts.map +1 -1
  327. package/dist/components/table-layouts.js +52 -8
  328. package/dist/components/table-value.d.ts +4 -3
  329. package/dist/components/table-value.d.ts.map +1 -1
  330. package/dist/components/table-value.js +6 -5
  331. package/dist/components/table.d.ts +62 -25
  332. package/dist/components/table.d.ts.map +1 -1
  333. package/dist/components/table.js +62 -26
  334. package/dist/components/tabs.d.ts +86 -17
  335. package/dist/components/tabs.d.ts.map +1 -1
  336. package/dist/components/tabs.js +93 -22
  337. package/dist/components/text-link.d.ts +4 -1
  338. package/dist/components/text-link.d.ts.map +1 -1
  339. package/dist/components/text-link.js +4 -1
  340. package/dist/components/text-with-copy-button.d.ts +30 -0
  341. package/dist/components/text-with-copy-button.d.ts.map +1 -0
  342. package/dist/components/text-with-copy-button.js +32 -0
  343. package/dist/components/textarea.d.ts +40 -10
  344. package/dist/components/textarea.d.ts.map +1 -1
  345. package/dist/components/textarea.js +50 -11
  346. package/dist/components/theme-mode-switcher.d.ts +18 -1
  347. package/dist/components/theme-mode-switcher.d.ts.map +1 -1
  348. package/dist/components/theme-mode-switcher.js +20 -2
  349. package/dist/components/toggle-group.d.ts +28 -8
  350. package/dist/components/toggle-group.d.ts.map +1 -1
  351. package/dist/components/toggle-group.js +12 -6
  352. package/dist/components/toggle.d.ts +6 -3
  353. package/dist/components/toggle.d.ts.map +1 -1
  354. package/dist/components/toggle.js +10 -7
  355. package/dist/components/tooltip.d.ts +43 -12
  356. package/dist/components/tooltip.d.ts.map +1 -1
  357. package/dist/components/tooltip.js +45 -16
  358. package/dist/components/trend-badge.js +1 -1
  359. package/dist/components/update-card.js +1 -1
  360. package/dist/eslint/index.js +82 -0
  361. package/dist/eslint/rules/badge-is-static-label.js +93 -0
  362. package/dist/eslint/rules/button-icon-slot.js +102 -0
  363. package/dist/eslint/rules/button-link-for-navigation.js +146 -0
  364. package/dist/eslint/rules/button-no-aria-label-with-text.js +75 -0
  365. package/dist/eslint/rules/button-type-roles-only-in-buttons.js +83 -0
  366. package/dist/eslint/rules/choice-control-has-a-name.js +98 -0
  367. package/dist/eslint/rules/choice-group-in-fieldset.js +86 -0
  368. package/dist/eslint/rules/command-shortcut-single-owner.js +118 -0
  369. package/dist/eslint/rules/confirm-dialog-words.js +63 -0
  370. package/dist/eslint/rules/data-table-one-unsized-column.js +96 -0
  371. package/dist/eslint/rules/destructive-action-placement.js +69 -0
  372. package/dist/eslint/rules/disabled-choice-says-why.js +71 -0
  373. package/dist/eslint/rules/ellipsis-opens-a-dialog.js +110 -0
  374. package/dist/eslint/rules/input-group-owners.js +155 -0
  375. package/dist/eslint/rules/kbd-children-no-modifier-text.js +128 -0
  376. package/dist/eslint/rules/literal-text.js +41 -0
  377. package/dist/eslint/rules/middle-truncate-placement.js +69 -0
  378. package/dist/eslint/rules/no-bare-button-label.js +55 -0
  379. package/dist/eslint/rules/no-control-in-read-only-surface.js +106 -0
  380. package/dist/eslint/rules/no-hand-built-busy.js +104 -0
  381. package/dist/eslint/rules/no-hand-built-theme-picker.js +144 -0
  382. package/dist/eslint/rules/no-hand-built-tile.js +41 -0
  383. package/dist/eslint/rules/no-hand-formatted-date.js +87 -0
  384. package/dist/eslint/rules/no-hand-stacked-avatars.js +67 -0
  385. package/dist/eslint/rules/no-nested-collapse.js +60 -0
  386. package/dist/eslint/rules/no-search-in-form.js +47 -0
  387. package/dist/eslint/rules/no-shadcn-appearance-override.js +2 -16
  388. package/dist/eslint/rules/no-shell-prompt-in-snippet.js +74 -0
  389. package/dist/eslint/rules/no-stock-error-words.js +56 -0
  390. package/dist/eslint/rules/no-tooltip-around-labelled-field.js +72 -0
  391. package/dist/eslint/rules/no-weight-class-on-strong-in-type-role.js +57 -0
  392. package/dist/eslint/rules/one-submenu-level.js +43 -0
  393. package/dist/eslint/rules/one-toast-per-flow.js +91 -0
  394. package/dist/eslint/rules/option-count.js +167 -0
  395. package/dist/eslint/rules/page-command-link-not-render.js +43 -0
  396. package/dist/eslint/rules/progress-needs-name.js +57 -0
  397. package/dist/eslint/rules/settings-limit-in-footer.js +94 -0
  398. package/dist/eslint/rules/skeleton-in-region.js +80 -0
  399. package/dist/eslint/rules/sortable-heading-uses-sort.js +79 -0
  400. package/dist/eslint/rules/table-cell-inset-owner.js +107 -0
  401. package/dist/eslint/rules/tabs-selection-is-controlled.js +47 -0
  402. package/dist/eslint/rules/tooltip-only-arrow.js +38 -0
  403. package/dist/eslint/rules/tooltip-trigger-accessible-name.js +114 -0
  404. package/dist/eslint/strict-design-system.js +21 -7
  405. package/dist/index.d.ts +13 -13
  406. package/dist/index.d.ts.map +1 -1
  407. package/dist/index.js +12 -13
  408. package/dist/internal/assistant-ui/attachment.d.ts.map +1 -1
  409. package/dist/internal/assistant-ui/attachment.js +2 -2
  410. package/dist/internal/assistant-ui/reasoning.d.ts +1 -1
  411. package/dist/internal/assistant-ui/reasoning.d.ts.map +1 -1
  412. package/dist/internal/assistant-ui/tool-fallback.js +1 -1
  413. package/dist/internal/assistant-ui/tool-group.d.ts +1 -1
  414. package/dist/internal/assistant-ui/tool-group.d.ts.map +1 -1
  415. package/dist/internal/assistant-ui/tooltip-icon-button.d.ts +2 -3
  416. package/dist/internal/assistant-ui/tooltip-icon-button.d.ts.map +1 -1
  417. package/dist/internal/assistant-ui/tooltip-icon-button.js +1 -1
  418. package/dist/internal/catalog-list.js +2 -2
  419. package/dist/internal/collection-note.d.ts +23 -0
  420. package/dist/internal/collection-note.d.ts.map +1 -0
  421. package/dist/internal/collection-note.js +17 -0
  422. package/dist/internal/collection-rail.d.ts +57 -0
  423. package/dist/internal/collection-rail.d.ts.map +1 -0
  424. package/dist/internal/collection-rail.js +33 -0
  425. package/dist/internal/company-logo.d.ts +18 -0
  426. package/dist/internal/company-logo.d.ts.map +1 -0
  427. package/dist/internal/company-logo.js +14 -0
  428. package/dist/internal/control-name.d.ts +12 -0
  429. package/dist/internal/control-name.d.ts.map +1 -0
  430. package/dist/internal/control-name.js +1 -0
  431. package/dist/internal/diff-line.d.ts +9 -0
  432. package/dist/internal/diff-line.d.ts.map +1 -0
  433. package/dist/internal/diff-line.js +8 -0
  434. package/dist/internal/empty.d.ts +8 -4
  435. package/dist/internal/empty.d.ts.map +1 -1
  436. package/dist/internal/empty.js +14 -8
  437. package/dist/internal/field-frame.d.ts +33 -0
  438. package/dist/internal/field-frame.d.ts.map +1 -0
  439. package/dist/internal/field-frame.js +20 -0
  440. package/dist/internal/final-focus.d.ts +8 -0
  441. package/dist/internal/final-focus.d.ts.map +1 -0
  442. package/dist/internal/final-focus.js +10 -0
  443. package/dist/internal/footer-strip.d.ts.map +1 -1
  444. package/dist/internal/footer-strip.js +3 -1
  445. package/dist/internal/form-submit.d.ts +9 -5
  446. package/dist/internal/form-submit.d.ts.map +1 -1
  447. package/dist/internal/form-submit.js +31 -2
  448. package/dist/internal/input-box.d.ts +26 -0
  449. package/dist/internal/input-box.d.ts.map +1 -0
  450. package/dist/internal/input-box.js +59 -0
  451. package/dist/internal/menu-surface.d.ts +10 -3
  452. package/dist/internal/menu-surface.d.ts.map +1 -1
  453. package/dist/internal/menu-surface.js +10 -3
  454. package/dist/internal/notice.d.ts +25 -0
  455. package/dist/internal/notice.d.ts.map +1 -0
  456. package/dist/internal/notice.js +33 -0
  457. package/dist/internal/overlay-stem.d.ts +5 -0
  458. package/dist/internal/overlay-stem.d.ts.map +1 -0
  459. package/dist/internal/overlay-stem.js +7 -0
  460. package/dist/internal/phone-sheet.d.ts +4 -0
  461. package/dist/internal/phone-sheet.d.ts.map +1 -0
  462. package/dist/internal/phone-sheet.js +2 -0
  463. package/dist/internal/present-content.d.ts +3 -0
  464. package/dist/internal/present-content.d.ts.map +1 -0
  465. package/dist/internal/present-content.js +1 -0
  466. package/dist/internal/record-menu-items.d.ts +4 -3
  467. package/dist/internal/record-menu-items.d.ts.map +1 -1
  468. package/dist/internal/record-menu-items.js +21 -6
  469. package/dist/internal/settings-save.d.ts +9 -2
  470. package/dist/internal/settings-save.d.ts.map +1 -1
  471. package/dist/internal/settings-save.js +9 -6
  472. package/dist/internal/table-compact-line.d.ts +38 -0
  473. package/dist/internal/table-compact-line.d.ts.map +1 -0
  474. package/dist/internal/table-compact-line.js +35 -0
  475. package/dist/internal/title-when-cut.d.ts +8 -0
  476. package/dist/internal/title-when-cut.d.ts.map +1 -0
  477. package/dist/internal/title-when-cut.js +22 -0
  478. package/dist/internal/unsaved-guard.d.ts +18 -0
  479. package/dist/internal/unsaved-guard.d.ts.map +1 -0
  480. package/dist/internal/unsaved-guard.js +31 -0
  481. package/dist/lib/merge-tokens.generated.js +2 -2
  482. package/dist/showcase/foundations.d.ts.map +1 -1
  483. package/dist/showcase/foundations.js +10 -2
  484. package/dist/showcase/specimens/actions.d.ts +2 -0
  485. package/dist/showcase/specimens/actions.d.ts.map +1 -1
  486. package/dist/showcase/specimens/actions.js +30 -5
  487. package/dist/showcase/specimens/charts.d.ts.map +1 -1
  488. package/dist/showcase/specimens/charts.js +22 -13
  489. package/dist/showcase/specimens/choices.d.ts +14 -3
  490. package/dist/showcase/specimens/choices.d.ts.map +1 -1
  491. package/dist/showcase/specimens/choices.js +93 -13
  492. package/dist/showcase/specimens/compositions.d.ts.map +1 -1
  493. package/dist/showcase/specimens/compositions.js +136 -23
  494. package/dist/showcase/specimens/data.d.ts +12 -7
  495. package/dist/showcase/specimens/data.d.ts.map +1 -1
  496. package/dist/showcase/specimens/data.js +139 -35
  497. package/dist/showcase/specimens/feedback.d.ts +2 -0
  498. package/dist/showcase/specimens/feedback.d.ts.map +1 -1
  499. package/dist/showcase/specimens/feedback.js +39 -15
  500. package/dist/showcase/specimens/index.d.ts +20 -12
  501. package/dist/showcase/specimens/index.d.ts.map +1 -1
  502. package/dist/showcase/specimens/inputs.d.ts +4 -2
  503. package/dist/showcase/specimens/inputs.d.ts.map +1 -1
  504. package/dist/showcase/specimens/inputs.js +62 -19
  505. package/dist/showcase/specimens/menus.d.ts +0 -1
  506. package/dist/showcase/specimens/menus.d.ts.map +1 -1
  507. package/dist/showcase/specimens/menus.js +47 -17
  508. package/dist/showcase/specimens/navigation.d.ts +6 -4
  509. package/dist/showcase/specimens/navigation.d.ts.map +1 -1
  510. package/dist/showcase/specimens/navigation.js +61 -32
  511. package/dist/showcase/specimens/other.d.ts +1 -3
  512. package/dist/showcase/specimens/other.d.ts.map +1 -1
  513. package/dist/showcase/specimens/other.js +17 -13
  514. package/dist/showcase/specimens/status.d.ts +4 -1
  515. package/dist/showcase/specimens/status.d.ts.map +1 -1
  516. package/dist/showcase/specimens/status.js +64 -11
  517. package/dist/showcase/usage.generated.d.ts +1 -1
  518. package/dist/showcase/usage.generated.d.ts.map +1 -1
  519. package/dist/showcase/usage.generated.js +632 -544
  520. package/dist/standalone/index.js +1 -1
  521. package/dist/styles/components.css +13 -13
  522. package/dist/styles/globals.css +25 -0
  523. package/package.json +2 -3
  524. package/dist/components/approval-row.d.ts +0 -34
  525. package/dist/components/approval-row.d.ts.map +0 -1
  526. package/dist/components/approval-row.js +0 -27
  527. package/dist/components/channel-view.d.ts +0 -112
  528. package/dist/components/channel-view.d.ts.map +0 -1
  529. package/dist/components/channel-view.js +0 -84
  530. package/dist/components/dashboard-shell.d.ts +0 -51
  531. package/dist/components/dashboard-shell.d.ts.map +0 -1
  532. package/dist/components/dashboard-shell.js +0 -89
  533. package/dist/components/direction.d.ts +0 -2
  534. package/dist/components/direction.d.ts.map +0 -1
  535. package/dist/components/direction.js +0 -1
  536. package/dist/components/expandable-block.d.ts +0 -20
  537. package/dist/components/expandable-block.d.ts.map +0 -1
  538. package/dist/components/expandable-block.js +0 -32
  539. package/dist/components/form.d.ts +0 -42
  540. package/dist/components/form.d.ts.map +0 -1
  541. package/dist/components/form.js +0 -91
  542. package/dist/components/label-system.d.ts +0 -17
  543. package/dist/components/label-system.d.ts.map +0 -1
  544. package/dist/components/label-system.js +0 -21
  545. package/dist/components/memory-item.d.ts +0 -21
  546. package/dist/components/memory-item.d.ts.map +0 -1
  547. package/dist/components/memory-item.js +0 -18
  548. package/dist/components/menubar.d.ts +0 -43
  549. package/dist/components/menubar.d.ts.map +0 -1
  550. package/dist/components/menubar.js +0 -69
  551. package/dist/components/navigation-menu.d.ts +0 -26
  552. package/dist/components/navigation-menu.d.ts.map +0 -1
  553. package/dist/components/navigation-menu.js +0 -45
  554. package/dist/components/pagination.d.ts +0 -33
  555. package/dist/components/pagination.d.ts.map +0 -1
  556. package/dist/components/pagination.js +0 -41
  557. package/dist/components/plugin-slot-boundary.d.ts +0 -42
  558. package/dist/components/plugin-slot-boundary.d.ts.map +0 -1
  559. package/dist/components/plugin-slot-boundary.js +0 -41
  560. package/dist/components/status-row.d.ts +0 -32
  561. package/dist/components/status-row.d.ts.map +0 -1
  562. package/dist/components/status-row.js +0 -35
@@ -1,42 +1,117 @@
1
1
  import * as React from "react";
2
2
  import { Combobox as ComboboxPrimitive } from "@base-ui/react/combobox";
3
+ import { type AccessibleName } from "./button.js";
4
+ import { type FieldName } from "../internal/field-frame.js";
5
+ import { type FieldSize } from "../internal/input-box.js";
3
6
  /**
4
7
  * Type to find one value, or several, in a known set.
5
8
  *
6
9
  * @family Choices
7
- * @when Typing to find in a known set: assign an Agent, choose a time zone, add several Agents at
8
- * once with `multiple`.
9
- * @instead A short fixed list is a `Select`. Free text is an `Input`. Narrowing a collection is
10
- * `CollectionFilters`.
11
- * @behaviour Typing filters the list. Loading and no match are different states; the chosen value
12
- * stays while results load. Enter picks the highlighted row and never submits the form around it.
13
- * Clear empties the box and keeps focus there. With `multiple`, each choice is a chip with its own
14
- * remove; Backspace in an empty box removes the last.
15
- * @words The hint is scoped: *Find an Agent*. No match quotes the query: *No Agent matches “Xy”.* A
16
- * chip reads as the record's name.
17
- * @access A visible label; combobox and listbox roles; each chip's remove is named: *Remove Acme
18
- * Quotes*. An Agent's orb in a row is a decorative mark beside her name.
10
+ * @when "Filters large lists to selectable options based on the matching query."
11
+ * (https://vercel.com/geist/combobox) "Pick `<Combobox>` when users type to filter a known list of
12
+ * values (regions, frameworks, env-var names)." (https://vercel.com/geist/combobox) Ours: assign an Agent, choose a time zone,
13
+ * add several Agents at once with `multiple`.
14
+ * @instead "For short, fixed lists where typing adds nothing, switch to `Select`."
15
+ * (https://vercel.com/geist/combobox) "When more than one value can be chosen at once, use
16
+ * `MultiSelect`." (https://vercel.com/geist/combobox) "For free-form filter strings that don’t
17
+ * resolve to a single option, drop in `Input` with the `search` variant."
18
+ * (https://vercel.com/geist/combobox) Ours: several values chosen from a list you scan rather than
19
+ * type into is a `MultiSelect`; `Combobox` takes several with `multiple`. `Input` has no `search`
20
+ * variant, so free text is an `Input` and narrowing a collection is `CollectionFilters`.
21
+ * @behaviour The box is `Input`'s: its three sizes (`size` on `ComboboxInput`), its ring, hover,
22
+ * focus halo and disabled, with the search mark at the start, a `placeholder` that names the scope,
23
+ * and the open-list or clear button flush at the end, in the muted grey until hovered (the
24
+ * open-list button is 30 px high and centred at the default size, full height at `sm` and `lg`).
25
+ * Colour sits in one place: an error turns the ring red, fills the halo and colours the typed text;
26
+ * the placeholder, marks and list stay neutral. `label` and `error` go on `ComboboxInput`, and a
27
+ * string `label` requires `id`; a box with no name does not compile. The list opens 8 px under it
28
+ * at its width (a narrower `className` width centres under the box), in a 6 px inset, up to five
29
+ * and a half rows tall (210 px) so a cut row shows there is more, with rows 36 px tall and no gap.
30
+ * A row is one line that ends in an ellipsis, with a 16 px mark 12 px before the name and a 14 px
31
+ * check at the chosen row's end, after the name. A row that cannot be chosen turns its text muted,
32
+ * never dimmed. Typing filters the list. "Options can opt out of the fixed row height with `ignoreDefaultHeight`
33
+ * to render multi-line content (e.g. a shared environment variable name plus its target). The list
34
+ * sizes each row to its content and stays scrollable." (https://vercel.com/geist/combobox) Ours:
35
+ * there is no `ignoreDefaultHeight`; a two-line row is an explicit column child. "Show a loading
36
+ * state for async results; don’t collapse the list while the request is in flight."
37
+ * (https://vercel.com/geist/combobox) Ours: while results load the list stays and `ComboboxLoading`
38
+ * says so, and the chosen value stays; `ComboboxContent` requires `empty`, the sentence for no
39
+ * match, or `null` while a search is still running. "Render a custom empty state of the form `No
40
+ * {items} match "{query}"` rather than a bare `No results`." (https://vercel.com/geist/combobox)
41
+ * "Keep arrow-key navigation through `<Combobox.Option>` items; don’t hijack Enter to submit the
42
+ * surrounding form while the list is open." (https://vercel.com/geist/combobox) "Set `clearable` to
43
+ * show a clear button when a value is selected." (https://vercel.com/geist/combobox) Ours:
44
+ * `showClear` with a `clearLabel` does it; clear empties the box and keeps focus there. With
45
+ * `multiple`, each choice is a chip with its own remove; Backspace in an empty box removes the
46
+ * last. "It is common to use Combobox inside a Modal. On mobile, the Modal automatically renders a
47
+ * Dialog instead." (https://vercel.com/geist/combobox) "Inside a `Modal`, Geist switches to a
48
+ * Dialog on mobile automatically; don’t layer a second portal." (https://vercel.com/geist/combobox)
49
+ * Ours: our overlay is `Dialog`, and `ComboboxContent` is the list's one portal.
50
+ * @words "Visible label is a short Title Case noun (`Region`, `Environment Variable Name`)."
51
+ * (https://vercel.com/geist/combobox) "Placeholder is the inline hint: `Search regions`,
52
+ * `DATABASE_URL`. Never bare `Search…` and never the label restated."
53
+ * (https://vercel.com/geist/combobox) "Option text is Title Case for short values and matches
54
+ * canonical branding (`Next.js`, not `NextJS`); same register across the list."
55
+ * (https://vercel.com/geist/combobox) "Validation names the field and constraint, sentence case
56
+ * with a period (`Select a region.`)." (https://vercel.com/geist/combobox) Ours: the label and the
57
+ * rows are sentence case. The hint is scoped: *Find an Agent*. No match quotes the query: *No Agent
58
+ * matches “Xy”.* A chip reads as the record's name.
59
+ * @access "`<Combobox>` has no `label` prop; pair a sibling `<Label htmlFor>` with the root `id`,
60
+ * or set `aria-label` on the root for icon-only triggers." (https://vercel.com/geist/combobox) "The
61
+ * root accepts `aria-label` only; there is no `aria-labelledby` prop, so the sibling-label path is
62
+ * the way to reference visible text." (https://vercel.com/geist/combobox) "Trap focus inside the
63
+ * popover when nested in a `Modal` so Tab cycles options instead of the page behind it."
64
+ * (https://vercel.com/geist/combobox) Ours: `ComboboxInput` takes a visible `label` tied to the box
65
+ * by `id`, or `aria-label` or `aria-labelledby`; combobox and listbox roles; the open-list and
66
+ * clear buttons are named by `triggerLabel` and `clearLabel`; each chip's remove is named: *Remove
67
+ * Acme Quotes*. An Agent's orb in a row is a decorative mark beside her name.
19
68
  */
20
69
  declare const Combobox: typeof ComboboxPrimitive.Root;
21
70
  declare function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props): React.JSX.Element;
22
71
  declare function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props): React.JSX.Element;
23
- declare function ComboboxInput({ className, children, disabled, showTrigger, showClear, ...props }: ComboboxPrimitive.Input.Props & {
24
- showTrigger?: boolean;
25
- showClear?: boolean;
72
+ type ComboboxTriggerButton = {
73
+ showTrigger: false;
74
+ triggerLabel?: undefined;
75
+ } | {
76
+ showTrigger?: true;
77
+ triggerLabel: string;
78
+ };
79
+ type ComboboxClearButton = {
80
+ showClear?: false;
81
+ clearLabel?: undefined;
82
+ } | {
83
+ showClear: true;
84
+ clearLabel: string;
85
+ };
86
+ declare function ComboboxInput({ className, children, disabled, showTrigger, triggerLabel, showClear, clearLabel, size, label, error, ...props }: Omit<ComboboxPrimitive.Input.Props, "className" | "size"> & {
87
+ className?: string;
88
+ size?: FieldSize;
89
+ /** The scope, as an example of what to type: *Find an Agent*. Never *Search…* alone. */
90
+ placeholder: string;
91
+ /** The message under the box, in the product's words; it also marks the box invalid. */
92
+ error?: string;
93
+ } & FieldName & ComboboxTriggerButton & ComboboxClearButton): React.JSX.Element;
94
+ declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, empty, children, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor"> & {
95
+ /** What the list says when nothing matches, quoting the query; `null` while a search runs. */
96
+ empty: string | null;
26
97
  }): React.JSX.Element;
27
- declare function ComboboxContent({ className, side, sideOffset, align, alignOffset, anchor, ...props }: ComboboxPrimitive.Popup.Props & Pick<ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">): React.JSX.Element;
28
98
  declare function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props): React.JSX.Element;
29
99
  declare function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props): React.JSX.Element;
30
100
  declare function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props): React.JSX.Element;
31
101
  declare function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props): React.JSX.Element;
32
102
  declare function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props): React.JSX.Element;
33
- declare function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props): React.JSX.Element;
103
+ declare function ComboboxLoading({ className, ...props }: ComboboxPrimitive.Status.Props): React.JSX.Element;
34
104
  declare function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props): React.JSX.Element;
35
105
  declare function ComboboxChips({ className, ...props }: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props): React.JSX.Element;
36
- declare function ComboboxChip({ className, children, showRemove, ...props }: ComboboxPrimitive.Chip.Props & {
37
- showRemove?: boolean;
38
- }): React.JSX.Element;
39
- declare function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props): React.JSX.Element;
106
+ type ComboboxChipRemove = {
107
+ showRemove: false;
108
+ removeLabel?: undefined;
109
+ } | {
110
+ showRemove?: true;
111
+ removeLabel: string;
112
+ };
113
+ declare function ComboboxChip({ className, children, showRemove, removeLabel, ...props }: ComboboxPrimitive.Chip.Props & ComboboxChipRemove): React.JSX.Element;
114
+ declare function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props & AccessibleName): React.JSX.Element;
40
115
  declare function useComboboxAnchor(): React.RefObject<HTMLDivElement | null>;
41
- export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
116
+ export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxLoading, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
42
117
  //# sourceMappingURL=combobox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAaxE;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,QAAQ,+BAAyB,CAAC;AAExC,iBAAS,aAAa,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,qBAEjE;AAED,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,CAAC,OAAO,CAAC,KAAK,qBAW1F;AAeD,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAgB,EAChB,WAAkB,EAClB,SAAiB,EACjB,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,GAAG;IACjC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,qBAoBA;AAED,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,IAAe,EACf,UAAc,EACd,KAAe,EACf,WAAe,EACf,MAAM,EACN,GAAG,KAAK,EACT,EAAE,iBAAiB,CAAC,KAAK,CAAC,KAAK,GAC9B,IAAI,CACF,iBAAiB,CAAC,UAAU,CAAC,KAAK,EACl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,YAAY,EACZ,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,GAClB,CAAC"}
@@ -4,46 +4,95 @@ import { Combobox as ComboboxPrimitive } from "@base-ui/react/combobox";
4
4
  import { anchoredOverlayMotion } from "../lib/motion.js";
5
5
  import { cn } from "../lib/utils.js";
6
6
  import { Button } from "./button.js";
7
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, } from "./input-group.js";
8
- import { ChevronDownIcon, XIcon, CheckIcon } from "lucide-react";
7
+ import { FieldFrame } from "../internal/field-frame.js";
8
+ import { fieldRing, fieldWithinStates } from "../internal/input-box.js";
9
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupControl, } from "./input-group.js";
10
+ import { ChevronDownIcon, XIcon, CheckIcon, SearchIcon } from "lucide-react";
9
11
  /**
10
12
  * Type to find one value, or several, in a known set.
11
13
  *
12
14
  * @family Choices
13
- * @when Typing to find in a known set: assign an Agent, choose a time zone, add several Agents at
14
- * once with `multiple`.
15
- * @instead A short fixed list is a `Select`. Free text is an `Input`. Narrowing a collection is
16
- * `CollectionFilters`.
17
- * @behaviour Typing filters the list. Loading and no match are different states; the chosen value
18
- * stays while results load. Enter picks the highlighted row and never submits the form around it.
19
- * Clear empties the box and keeps focus there. With `multiple`, each choice is a chip with its own
20
- * remove; Backspace in an empty box removes the last.
21
- * @words The hint is scoped: *Find an Agent*. No match quotes the query: *No Agent matches “Xy”.* A
22
- * chip reads as the record's name.
23
- * @access A visible label; combobox and listbox roles; each chip's remove is named: *Remove Acme
24
- * Quotes*. An Agent's orb in a row is a decorative mark beside her name.
15
+ * @when "Filters large lists to selectable options based on the matching query."
16
+ * (https://vercel.com/geist/combobox) "Pick `<Combobox>` when users type to filter a known list of
17
+ * values (regions, frameworks, env-var names)." (https://vercel.com/geist/combobox) Ours: assign an Agent, choose a time zone,
18
+ * add several Agents at once with `multiple`.
19
+ * @instead "For short, fixed lists where typing adds nothing, switch to `Select`."
20
+ * (https://vercel.com/geist/combobox) "When more than one value can be chosen at once, use
21
+ * `MultiSelect`." (https://vercel.com/geist/combobox) "For free-form filter strings that don’t
22
+ * resolve to a single option, drop in `Input` with the `search` variant."
23
+ * (https://vercel.com/geist/combobox) Ours: several values chosen from a list you scan rather than
24
+ * type into is a `MultiSelect`; `Combobox` takes several with `multiple`. `Input` has no `search`
25
+ * variant, so free text is an `Input` and narrowing a collection is `CollectionFilters`.
26
+ * @behaviour The box is `Input`'s: its three sizes (`size` on `ComboboxInput`), its ring, hover,
27
+ * focus halo and disabled, with the search mark at the start, a `placeholder` that names the scope,
28
+ * and the open-list or clear button flush at the end, in the muted grey until hovered (the
29
+ * open-list button is 30 px high and centred at the default size, full height at `sm` and `lg`).
30
+ * Colour sits in one place: an error turns the ring red, fills the halo and colours the typed text;
31
+ * the placeholder, marks and list stay neutral. `label` and `error` go on `ComboboxInput`, and a
32
+ * string `label` requires `id`; a box with no name does not compile. The list opens 8 px under it
33
+ * at its width (a narrower `className` width centres under the box), in a 6 px inset, up to five
34
+ * and a half rows tall (210 px) so a cut row shows there is more, with rows 36 px tall and no gap.
35
+ * A row is one line that ends in an ellipsis, with a 16 px mark 12 px before the name and a 14 px
36
+ * check at the chosen row's end, after the name. A row that cannot be chosen turns its text muted,
37
+ * never dimmed. Typing filters the list. "Options can opt out of the fixed row height with `ignoreDefaultHeight`
38
+ * to render multi-line content (e.g. a shared environment variable name plus its target). The list
39
+ * sizes each row to its content and stays scrollable." (https://vercel.com/geist/combobox) Ours:
40
+ * there is no `ignoreDefaultHeight`; a two-line row is an explicit column child. "Show a loading
41
+ * state for async results; don’t collapse the list while the request is in flight."
42
+ * (https://vercel.com/geist/combobox) Ours: while results load the list stays and `ComboboxLoading`
43
+ * says so, and the chosen value stays; `ComboboxContent` requires `empty`, the sentence for no
44
+ * match, or `null` while a search is still running. "Render a custom empty state of the form `No
45
+ * {items} match "{query}"` rather than a bare `No results`." (https://vercel.com/geist/combobox)
46
+ * "Keep arrow-key navigation through `<Combobox.Option>` items; don’t hijack Enter to submit the
47
+ * surrounding form while the list is open." (https://vercel.com/geist/combobox) "Set `clearable` to
48
+ * show a clear button when a value is selected." (https://vercel.com/geist/combobox) Ours:
49
+ * `showClear` with a `clearLabel` does it; clear empties the box and keeps focus there. With
50
+ * `multiple`, each choice is a chip with its own remove; Backspace in an empty box removes the
51
+ * last. "It is common to use Combobox inside a Modal. On mobile, the Modal automatically renders a
52
+ * Dialog instead." (https://vercel.com/geist/combobox) "Inside a `Modal`, Geist switches to a
53
+ * Dialog on mobile automatically; don’t layer a second portal." (https://vercel.com/geist/combobox)
54
+ * Ours: our overlay is `Dialog`, and `ComboboxContent` is the list's one portal.
55
+ * @words "Visible label is a short Title Case noun (`Region`, `Environment Variable Name`)."
56
+ * (https://vercel.com/geist/combobox) "Placeholder is the inline hint: `Search regions`,
57
+ * `DATABASE_URL`. Never bare `Search…` and never the label restated."
58
+ * (https://vercel.com/geist/combobox) "Option text is Title Case for short values and matches
59
+ * canonical branding (`Next.js`, not `NextJS`); same register across the list."
60
+ * (https://vercel.com/geist/combobox) "Validation names the field and constraint, sentence case
61
+ * with a period (`Select a region.`)." (https://vercel.com/geist/combobox) Ours: the label and the
62
+ * rows are sentence case. The hint is scoped: *Find an Agent*. No match quotes the query: *No Agent
63
+ * matches “Xy”.* A chip reads as the record's name.
64
+ * @access "`<Combobox>` has no `label` prop; pair a sibling `<Label htmlFor>` with the root `id`,
65
+ * or set `aria-label` on the root for icon-only triggers." (https://vercel.com/geist/combobox) "The
66
+ * root accepts `aria-label` only; there is no `aria-labelledby` prop, so the sibling-label path is
67
+ * the way to reference visible text." (https://vercel.com/geist/combobox) "Trap focus inside the
68
+ * popover when nested in a `Modal` so Tab cycles options instead of the page behind it."
69
+ * (https://vercel.com/geist/combobox) Ours: `ComboboxInput` takes a visible `label` tied to the box
70
+ * by `id`, or `aria-label` or `aria-labelledby`; combobox and listbox roles; the open-list and
71
+ * clear buttons are named by `triggerLabel` and `clearLabel`; each chip's remove is named: *Remove
72
+ * Acme Quotes*. An Agent's orb in a row is a decorative mark beside her name.
25
73
  */
26
74
  const Combobox = ComboboxPrimitive.Root;
27
75
  function ComboboxValue({ ...props }) {
28
76
  return _jsx(ComboboxPrimitive.Value, { "data-slot": "combobox-value", ...props });
29
77
  }
30
78
  function ComboboxTrigger({ className, children, ...props }) {
31
- return (_jsxs(ComboboxPrimitive.Trigger, { "data-slot": "combobox-trigger", className: cn("[&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none size-4 text-muted-foreground" })] }));
79
+ return (_jsxs(ComboboxPrimitive.Trigger, { "data-slot": "combobox-trigger", className: cn("[&_svg:not([class*='size-'])]:size-3.5", className), ...props, children: [children, _jsx(ChevronDownIcon, { className: "pointer-events-none size-3.5 text-muted-foreground" })] }));
32
80
  }
33
81
  function ComboboxClear({ className, ...props }) {
34
- return (_jsx(ComboboxPrimitive.Clear, { "data-slot": "combobox-clear", render: _jsx(InputGroupButton, { variant: "ghost", size: "icon-xs" }), className: cn(className), ...props, children: _jsx(XIcon, { className: "pointer-events-none" }) }));
82
+ return (_jsx(ComboboxPrimitive.Clear, { "data-slot": "combobox-clear", render: _jsx(InputGroupButton, { variant: "ghost", size: "icon", "aria-label": props["aria-label"] }), className: cn(className), ...props, children: _jsx(XIcon, { className: "pointer-events-none size-3.5" }) }));
35
83
  }
36
- function ComboboxInput({ className, children, disabled = false, showTrigger = true, showClear = false, ...props }) {
37
- return (_jsxs(InputGroup, { className: cn("w-auto", className), children: [_jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupInput, { disabled: disabled }), ...props }), _jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && (_jsx(InputGroupButton, { size: "icon-xs", variant: "ghost", render: _jsx(ComboboxTrigger, {}), "data-slot": "input-group-button", className: "group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent", disabled: disabled })), showClear && _jsx(ComboboxClear, { disabled: disabled })] }), children] }));
84
+ function ComboboxInput({ className, children, disabled = false, showTrigger = true, triggerLabel, showClear = false, clearLabel, size, label, error, ...props }) {
85
+ const hasButton = showTrigger || showClear;
86
+ return (_jsx(FieldFrame, { label: label, error: error, size: size, control: props, children: (aria) => (_jsxs(InputGroup, { size: size, className: className, children: [_jsx(InputGroupAddon, { children: _jsx(SearchIcon, { "aria-hidden": "true" }) }), _jsx(ComboboxPrimitive.Input, { render: _jsx(InputGroupControl, { disabled: disabled, className: cn("aria-invalid:text-destructive", hasButton && "pr-0") }), ...props, ...aria }), hasButton ? (_jsxs(InputGroupAddon, { align: "inline-end", children: [showTrigger && triggerLabel !== undefined ? (_jsx(InputGroupButton, { size: "icon", variant: "ghost", "aria-label": triggerLabel, render: _jsx(ComboboxTrigger, {}), "data-slot": "input-group-button", className: "group-data-[size=default]/input-group:h-7.5 group-data-[size=default]/input-group:self-center group-has-data-[slot=combobox-clear]/input-group:hidden data-pressed:bg-transparent", disabled: disabled })) : null, showClear && clearLabel !== undefined ? (_jsx(ComboboxClear, { "aria-label": clearLabel, disabled: disabled })) : null] })) : null, children] })) }));
38
87
  }
39
- function ComboboxContent({ className, side = "bottom", sideOffset = 6, align = "start", alignOffset = 0, anchor, ...props }) {
40
- return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsx(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", "data-chips": !!anchor, className: cn("pointer-events-auto", "group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] overflow-hidden rounded-lg border-0 nc-glass text-popover-foreground nc-elevation-floating data-[chips=true]:min-w-(--anchor-width) *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-control-height *:data-[slot=input-group]:border-input/30 *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-none", anchoredOverlayMotion, className), ...props }) }) }));
88
+ function ComboboxContent({ className, side = "bottom", sideOffset = 8, align = "center", alignOffset = 0, anchor, empty, children, ...props }) {
89
+ return (_jsx(ComboboxPrimitive.Portal, { children: _jsx(ComboboxPrimitive.Positioner, { side: side, sideOffset: sideOffset, align: align, alignOffset: alignOffset, anchor: anchor, className: "isolate z-50", children: _jsxs(ComboboxPrimitive.Popup, { "data-slot": "combobox-content", className: cn("pointer-events-auto", "group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) overflow-hidden rounded-lg border-0 nc-glass text-popover-foreground nc-elevation-floating *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-control-height *:data-[slot=input-group]:bg-input/30 *:data-[slot=input-group]:shadow-[0_0_0_1px_color-mix(in_oklab,var(--input)_30%,transparent)]", anchoredOverlayMotion, className), ...props, children: [empty === null ? null : _jsx(ComboboxEmpty, { children: empty }), children] }) }) }));
41
90
  }
42
91
  function ComboboxList({ className, ...props }) {
43
- return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", className: cn("no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-nadicode-xxs data-empty:p-0", className), ...props }));
92
+ return (_jsx(ComboboxPrimitive.List, { "data-slot": "combobox-list", className: cn("no-scrollbar max-h-[min(--spacing(52.5),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto overscroll-contain p-1.5 data-empty:p-0", className), ...props }));
44
93
  }
45
94
  function ComboboxItem({ className, children, ...props }) {
46
- return (_jsxs(ComboboxPrimitive.Item, { "data-slot": "combobox-item", className: cn("relative flex min-h-touch-target w-full cursor-default items-center gap-2 rounded-sm py-1 pr-8 pl-1.5 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50 [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [children, _jsx(ComboboxPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none absolute right-2 flex size-4 items-center justify-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none" }) })] }));
95
+ return (_jsxs(ComboboxPrimitive.Item, { "data-slot": "combobox-item", className: cn("relative flex min-h-touch-target w-full cursor-default items-center gap-3 rounded-sm px-2 py-2 text-sm outline-hidden select-none data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground data-disabled:pointer-events-none data-disabled:text-muted-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", className), ...props, children: [React.Children.map(children, (child) => React.isValidElement(child) ? (child) : (_jsx("span", { className: "min-w-0 truncate text-left", children: child }))), _jsx(ComboboxPrimitive.ItemIndicator, { render: _jsx("span", { className: "pointer-events-none ml-auto flex shrink-0 items-center" }), children: _jsx(CheckIcon, { className: "pointer-events-none size-3.5" }) })] }));
47
96
  }
48
97
  function ComboboxGroup({ className, ...props }) {
49
98
  return (_jsx(ComboboxPrimitive.Group, { "data-slot": "combobox-group", className: cn(className), ...props }));
@@ -55,21 +104,24 @@ function ComboboxCollection({ ...props }) {
55
104
  return _jsx(ComboboxPrimitive.Collection, { "data-slot": "combobox-collection", ...props });
56
105
  }
57
106
  function ComboboxEmpty({ className, ...props }) {
58
- return (_jsx(ComboboxPrimitive.Empty, { "data-slot": "combobox-empty", className: cn("hidden w-full justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", className), ...props }));
107
+ return (_jsx(ComboboxPrimitive.Empty, { "data-slot": "combobox-empty", className: cn("hidden min-h-12 w-full items-center justify-center py-2 text-center text-sm text-muted-foreground group-data-empty/combobox-content:flex", className), ...props }));
108
+ }
109
+ function ComboboxLoading({ className, ...props }) {
110
+ return (_jsx(ComboboxPrimitive.Status, { "data-slot": "combobox-loading", className: cn("px-2 py-2 text-center text-sm text-muted-foreground empty:p-0", className), ...props }));
59
111
  }
60
112
  function ComboboxSeparator({ className, ...props }) {
61
113
  return (_jsx(ComboboxPrimitive.Separator, { "data-slot": "combobox-separator", className: cn("-mx-1 my-1 h-px bg-border", className), ...props }));
62
114
  }
63
115
  function ComboboxChips({ className, ...props }) {
64
- return (_jsx(ComboboxPrimitive.Chips, { "data-slot": "combobox-chips", className: cn("flex min-h-touch-target flex-wrap items-center gap-1 rounded-sm border border-input bg-background bg-clip-padding px-control-padding-inline py-1 text-sm transition-colors focus-within:nc-focus-outline focus-within:outline-ring has-aria-invalid:border-destructive has-aria-invalid:nc-focus-outline has-aria-invalid:outline-destructive has-data-[slot=combobox-chip]:px-1 [@media(hover:hover)_and_(pointer:fine)]:min-h-control-height", className), ...props }));
116
+ return (_jsx(ComboboxPrimitive.Chips, { "data-slot": "combobox-chips", className: cn("flex min-h-touch-target flex-wrap items-center gap-1 rounded-sm bg-background bg-clip-padding px-control-padding-inline py-1 text-sm has-data-[slot=combobox-chip]:px-1 [@media(hover:hover)_and_(pointer:fine)]:min-h-control-height", fieldRing, fieldWithinStates, className), ...props }));
65
117
  }
66
- function ComboboxChip({ className, children, showRemove = true, ...props }) {
67
- return (_jsxs(ComboboxPrimitive.Chip, { "data-slot": "combobox-chip", className: cn("flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50 has-data-[slot=combobox-chip-remove]:pr-0", className), ...props, children: [children, showRemove && (_jsx(ComboboxPrimitive.ChipRemove, { render: _jsx(Button, { variant: "ghost", size: "icon-xs" }), className: "-ml-1 opacity-50 hover:opacity-100", "data-slot": "combobox-chip-remove", children: _jsx(XIcon, { className: "pointer-events-none" }) }))] }));
118
+ function ComboboxChip({ className, children, showRemove = true, removeLabel, ...props }) {
119
+ return (_jsxs(ComboboxPrimitive.Chip, { "data-slot": "combobox-chip", className: cn("flex h-[calc(--spacing(5.25))] w-fit items-center justify-center gap-1 rounded-sm bg-muted px-1.5 text-xs font-medium whitespace-nowrap text-foreground has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:text-muted-foreground has-data-[slot=combobox-chip-remove]:pr-0", className), ...props, children: [children, showRemove && removeLabel !== undefined && (_jsx(ComboboxPrimitive.ChipRemove, { render: _jsx(Button, { variant: "ghost", size: "icon-xs", "aria-label": removeLabel }), className: "-ml-1 text-muted-foreground hover:text-foreground", "data-slot": "combobox-chip-remove", children: _jsx(XIcon, { className: "pointer-events-none" }) }))] }));
68
120
  }
69
121
  function ComboboxChipsInput({ className, ...props }) {
70
- return (_jsx(ComboboxPrimitive.Input, { "data-slot": "combobox-chip-input", className: cn("min-w-16 flex-1 outline-none", className), ...props }));
122
+ return (_jsx(ComboboxPrimitive.Input, { "data-slot": "combobox-chip-input", "data-field-frame": "", className: cn("min-w-16 flex-1 outline-none", className), ...props }));
71
123
  }
72
124
  function useComboboxAnchor() {
73
125
  return React.useRef(null);
74
126
  }
75
- export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxEmpty, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
127
+ export { Combobox, ComboboxInput, ComboboxContent, ComboboxList, ComboboxItem, ComboboxGroup, ComboboxLabel, ComboboxCollection, ComboboxLoading, ComboboxSeparator, ComboboxChips, ComboboxChip, ComboboxChipsInput, ComboboxTrigger, ComboboxValue, useComboboxAnchor, };
@@ -1,36 +1,49 @@
1
1
  import * as React from "react";
2
2
  import { Command as CommandPrimitive } from "cmdk";
3
3
  import { Dialog } from "./dialog.js";
4
- declare function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>): React.JSX.Element;
4
+ import { type KbdProps } from "./kbd.js";
5
+ type ResultCount = {
6
+ /** The sentence a screen reader hears as the list narrows, from the catalogue: "3 results". */
7
+ resultCount: (count: number) => string;
8
+ };
9
+ declare function Command({ className, children, resultCount, ...props }: React.ComponentProps<typeof CommandPrimitive> & ResultCount): React.JSX.Element;
5
10
  /**
6
11
  * Find anything across the product and go there.
7
12
  *
8
13
  * @family Navigation
9
- * @when Finding anything across the product and going there: an Agent, a customer, a page, a
10
- * creation command. Opened by ⌘K or the sidebar's Find.
11
- * @instead One record's commands are its `ActionMenu`. Search inside one collection is
12
- * `CollectionSearch`. Choosing the page's scope is `ScopeSwitcher`.
13
- * @behaviour Opens instantly, a third of the way down, on glass at 12 px corners. Arrows move the
14
- * highlight, Enter goes, Esc closes and returns focus to the trigger. An empty query shows useful
15
- * defaults; no match says so.
16
- * @words Groups are plural nouns (*Agents*, *Go to*). Items are names, or verb and noun for a
17
- * command (*New Agent*). No match quotes the query.
18
- * @access A dialog with a screen-reader title and description; the field is a combobox over a
19
- * listbox; the highlighted item is `aria-selected`.
14
+ * @when "Use CommandMenu for a global, keyboard-first command palette that finds resources and runs actions across the app." (https://vercel.com/geist/command-menu) Ours: finding anything across the product and going there: an Agent, a customer, a page, a creation page (*New Agent*). Opened by ⌘K or the sidebar's Find. It goes to places and never runs a command.
15
+ * @instead "For a menu opened from a visible trigger on a single resource, use `Menu`; for right-click on a row, use `ContextMenu`." (https://vercel.com/geist/command-menu) "Group items into pages (`Projects`, `Team Settings`) when a single flat list would exceed roughly 30 items or span multiple resource types." (https://vercel.com/geist/command-menu) Ours: those are `DropdownMenu` and `ContextMenu`. One record's commands are its `ActionMenu`. Search inside one collection is `CollectionSearch`. Choosing the page's scope is `ScopeSwitcher`. `CommandDialog` has no pages: its list is groups.
16
+ * @behaviour "Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group's heading is a muted 36 px row, a divider bleeds across the list. A row's shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue.
17
+ * @words "`<CommandMenu.Item>` children are Title Case verb phrases (`Deploy Project`, `Invite Team Member`). Avoid navigation phrasing like `Go to project page`; CommandMenu commands act, not browse." (https://vercel.com/geist/command-menu) "`CommandMenuPage.label` is Title Case and names the scope (`Projects`, `Team Settings`)." (https://vercel.com/geist/command-menu) "`CommandMenuPage.placeholder` is sentence case, action-oriented, and ends with `…` (`Search projects…`, `Type a command or search…`). Bare `Search…` is wrong because it doesn’t name the scope." (https://vercel.com/geist/command-menu) "`<CommandMenu.Group heading>` is Title Case, 1–2 words (`Actions`, `Recent`)." (https://vercel.com/geist/command-menu) Ours: groups are plural nouns in sentence case (*Agents*, *Go to*), one or two words. Items are names, or verb and noun for a creation page (*New Agent*), because the dialog goes to places. The placeholder names what is searched, never a bare "Search". No match quotes the query.
18
+ * @access "Use `aria-live="polite"` on the result count so screen readers hear how the list narrows as the user types." (https://vercel.com/geist/command-menu) "Up/Down arrows move highlight, Enter activates, Escape closes. Backspace at an empty input pops the page stack." (https://vercel.com/geist/command-menu) "Display each item’s `keybind` as a `Kbd` slot so the shortcut is discoverable to sighted users and announced as a label to screen readers." (https://vercel.com/geist/command-menu) Ours: a dialog with a screen-reader `title` and `description`, both required; the *Esc* key is a button named by `closeLabel`, which is required; the field is a combobox over a listbox; the highlighted item is `aria-selected`. A polite live region reads `resultCount` as the list narrows, and it is required. `CommandInput` requires its `placeholder`, `CommandGroup` its `heading` and `CommandItem` its `onSelect`, so no field, group or row is left unnamed or inert; a row with no group stands outside a `CommandGroup`. A shortcut is a `CommandShortcut`, drawn as `kbd` elements. With no pages there is no stack for Backspace to pop.
20
19
  */
21
- declare function CommandDialog({ title, description, children, className, showCloseButton, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
22
- title?: string;
23
- description?: string;
20
+ declare function CommandDialog({ title, description, children, className, closeLabel, resultCount, filter, ...props }: Omit<React.ComponentProps<typeof Dialog>, "children"> & ResultCount & {
21
+ title: string;
22
+ description: string;
23
+ /** The *Esc* key's name, from the catalogue: "Close". */
24
+ closeLabel: string;
25
+ /** How a row matches the typed words, where the product matches on more than the row's text. */
26
+ filter?: React.ComponentProps<typeof CommandPrimitive>["filter"];
24
27
  className?: string;
25
- showCloseButton?: boolean;
26
28
  children: React.ReactNode;
27
29
  }): React.JSX.Element;
28
- declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>): React.JSX.Element;
30
+ declare function CommandInput({ className, ...props }: Omit<React.ComponentProps<typeof CommandPrimitive.Input>, "placeholder"> & {
31
+ /** Names what is searched, never a bare "Search": "Find an Agent, a customer or a page". */
32
+ placeholder: string;
33
+ }): React.JSX.Element;
29
34
  declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
30
35
  declare function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
31
- declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
36
+ declare function CommandGroup({ className, ...props }: Omit<React.ComponentProps<typeof CommandPrimitive.Group>, "heading"> & {
37
+ /** The group's name, a muted 36 px row above its items. Items with no group stand outside a `CommandGroup`. */
38
+ heading: React.ReactNode;
39
+ }): React.JSX.Element;
32
40
  declare function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>): React.JSX.Element;
33
- declare function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>): React.JSX.Element;
34
- declare function CommandShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
35
- export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
41
+ declare function CommandItem({ className, children, ...props }: Omit<React.ComponentProps<typeof CommandPrimitive.Item>, "onSelect"> & {
42
+ /** What choosing the row does: Enter and a click both run it. */
43
+ onSelect: NonNullable<React.ComponentProps<typeof CommandPrimitive.Item>["onSelect"]>;
44
+ }): React.JSX.Element;
45
+ type CommandShortcutProps = KbdProps extends infer P ? P extends unknown ? Omit<P, "size"> : never : never;
46
+ declare function CommandShortcut({ className, ...props }: CommandShortcutProps): React.JSX.Element;
47
+ declare function CommandSuffix({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
48
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSuffix, CommandSeparator, };
36
49
  //# sourceMappingURL=command.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/components/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAC;AAGnD,OAAO,EACL,MAAM,EAKP,MAAM,qBAAqB,CAAC;AAI7B,iBAAS,OAAO,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cA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AC,CAAC,UAAU,CAAC,CAAC,CAAC;CACvF,qBAcA;AAED,KAAK,oBAAoB,GAAG,QAAQ,SAAS,MAAM,CAAC,GAChD,CAAC,SAAS,OAAO,GACf,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,GACf,KAAK,GACP,KAAK,CAAC;AAEV,iBAAS,eAAe,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,qBAIrE;AAED,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAQ3E;AAED,OAAO,EACL,OAAO,EACP,aAAa,EACb,YAAY,EACZ,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,gBAAgB,GACjB,CAAC"}
@@ -1,51 +1,59 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { Command as CommandPrimitive } from "cmdk";
3
+ import * as React from "react";
4
+ import { Command as CommandPrimitive, useCommandState } from "cmdk";
4
5
  import { cn } from "../lib/utils.js";
5
- import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
6
+ import { Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle, } from "./dialog.js";
6
7
  import { InputGroup, InputGroupAddon } from "./input-group.js";
8
+ import { Kbd } from "./kbd.js";
7
9
  import { SearchIcon, CheckIcon } from "lucide-react";
8
- function Command({ className, ...props }) {
9
- return (_jsx(CommandPrimitive, { "data-slot": "command", className: cn("flex size-full flex-col overflow-hidden rounded-lg! nc-glass p-nadicode-xxs text-popover-foreground", className), ...props }));
10
+ const CommandDialogCloseLabel = React.createContext(null);
11
+ function CommandResultCount({ resultCount }) {
12
+ const count = useCommandState((state) => state.filtered.count);
13
+ return (_jsx("div", { "aria-live": "polite", className: "sr-only", "data-slot": "command-result-count", role: "status", children: resultCount(count) }));
14
+ }
15
+ function Command({ className, children, resultCount, ...props }) {
16
+ return (_jsxs(CommandPrimitive, { "data-slot": "command", className: cn("flex size-full flex-col overflow-hidden rounded-lg! nc-glass text-popover-foreground", className), ...props, children: [children, _jsx(CommandResultCount, { resultCount: resultCount })] }));
10
17
  }
11
18
  /**
12
19
  * Find anything across the product and go there.
13
20
  *
14
21
  * @family Navigation
15
- * @when Finding anything across the product and going there: an Agent, a customer, a page, a
16
- * creation command. Opened by ⌘K or the sidebar's Find.
17
- * @instead One record's commands are its `ActionMenu`. Search inside one collection is
18
- * `CollectionSearch`. Choosing the page's scope is `ScopeSwitcher`.
19
- * @behaviour Opens instantly, a third of the way down, on glass at 12 px corners. Arrows move the
20
- * highlight, Enter goes, Esc closes and returns focus to the trigger. An empty query shows useful
21
- * defaults; no match says so.
22
- * @words Groups are plural nouns (*Agents*, *Go to*). Items are names, or verb and noun for a
23
- * command (*New Agent*). No match quotes the query.
24
- * @access A dialog with a screen-reader title and description; the field is a combobox over a
25
- * listbox; the highlighted item is `aria-selected`.
22
+ * @when "Use CommandMenu for a global, keyboard-first command palette that finds resources and runs actions across the app." (https://vercel.com/geist/command-menu) Ours: finding anything across the product and going there: an Agent, a customer, a page, a creation page (*New Agent*). Opened by ⌘K or the sidebar's Find. It goes to places and never runs a command.
23
+ * @instead "For a menu opened from a visible trigger on a single resource, use `Menu`; for right-click on a row, use `ContextMenu`." (https://vercel.com/geist/command-menu) "Group items into pages (`Projects`, `Team Settings`) when a single flat list would exceed roughly 30 items or span multiple resource types." (https://vercel.com/geist/command-menu) Ours: those are `DropdownMenu` and `ContextMenu`. One record's commands are its `ActionMenu`. Search inside one collection is `CollectionSearch`. Choosing the page's scope is `ScopeSwitcher`. `CommandDialog` has no pages: its list is groups.
24
+ * @behaviour "Bind `⌘K` on macOS and `Ctrl+K` elsewhere. Don’t reuse the binding for any in-page filter input; it’s a global shortcut." (https://vercel.com/geist/command-menu) "Open into the root page; preserve the search query when navigating back from a sub-page so the user’s typing isn’t lost." (https://vercel.com/geist/command-menu) "Trap focus inside the overlay while it’s open and return focus to the previously active element on close." (https://vercel.com/geist/command-menu) "Show a recent or default item set when the input is empty so the menu is useful before typing." (https://vercel.com/geist/command-menu) Ours: opens instantly, 640 px wide and 15% down the window; on a phone it is a bottom sheet, 640 px high with 8 px top corners and the list filling it. The input row stands above the list with a line under it, the field in large type with no icon and an *Esc* key at its end that closes the dialog and is the next stop after the field on Tab; the list scrolls past 436 px. The first row is highlighted on open. No match says so. Every row is 36 px with the pointer cursor, a group's heading is a muted 36 px row, a divider bleeds across the list. A row's shortcut is a `CommandShortcut` and a word or icon at its end is a `CommandSuffix`. Colour carries nothing: the highlighted row is a faint neutral wash with its text unchanged, group headings, suffixes and the empty line are muted, and no row, key or divider takes a hue.
25
+ * @words "`<CommandMenu.Item>` children are Title Case verb phrases (`Deploy Project`, `Invite Team Member`). Avoid navigation phrasing like `Go to project page`; CommandMenu commands act, not browse." (https://vercel.com/geist/command-menu) "`CommandMenuPage.label` is Title Case and names the scope (`Projects`, `Team Settings`)." (https://vercel.com/geist/command-menu) "`CommandMenuPage.placeholder` is sentence case, action-oriented, and ends with `…` (`Search projects…`, `Type a command or search…`). Bare `Search…` is wrong because it doesn’t name the scope." (https://vercel.com/geist/command-menu) "`<CommandMenu.Group heading>` is Title Case, 1–2 words (`Actions`, `Recent`)." (https://vercel.com/geist/command-menu) Ours: groups are plural nouns in sentence case (*Agents*, *Go to*), one or two words. Items are names, or verb and noun for a creation page (*New Agent*), because the dialog goes to places. The placeholder names what is searched, never a bare "Search". No match quotes the query.
26
+ * @access "Use `aria-live="polite"` on the result count so screen readers hear how the list narrows as the user types." (https://vercel.com/geist/command-menu) "Up/Down arrows move highlight, Enter activates, Escape closes. Backspace at an empty input pops the page stack." (https://vercel.com/geist/command-menu) "Display each item’s `keybind` as a `Kbd` slot so the shortcut is discoverable to sighted users and announced as a label to screen readers." (https://vercel.com/geist/command-menu) Ours: a dialog with a screen-reader `title` and `description`, both required; the *Esc* key is a button named by `closeLabel`, which is required; the field is a combobox over a listbox; the highlighted item is `aria-selected`. A polite live region reads `resultCount` as the list narrows, and it is required. `CommandInput` requires its `placeholder`, `CommandGroup` its `heading` and `CommandItem` its `onSelect`, so no field, group or row is left unnamed or inert; a row with no group stands outside a `CommandGroup`. A shortcut is a `CommandShortcut`, drawn as `kbd` elements. With no pages there is no stack for Backspace to pop.
26
27
  */
27
- function CommandDialog({ title = "Command Palette", description = "Search for a command to run...", children, className, showCloseButton = false, ...props }) {
28
- return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("top-1/3 translate-y-0 overflow-hidden rounded-lg! bg-transparent p-0!", className), motion: "instant", showCloseButton: showCloseButton, children: children })] }));
28
+ function CommandDialog({ title, description, children, className, closeLabel, resultCount, filter, ...props }) {
29
+ return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("top-[15%] translate-y-0 overflow-hidden bg-transparent p-0! max-sm:h-160 max-sm:rounded-t-md sm:max-w-160", className), motion: "instant", showCloseButton: false, children: _jsx(CommandDialogCloseLabel.Provider, { value: closeLabel, children: _jsx(Command, { className: "max-sm:rounded-t-md! max-sm:rounded-b-none! **:data-[slot=command-list]:max-h-109 max-sm:**:data-[slot=command-list]:max-h-none max-sm:**:data-[slot=command-list]:flex-1", filter: filter, label: title, resultCount: resultCount, children: children }) }) })] }));
29
30
  }
30
31
  function CommandInput({ className, ...props }) {
31
- return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-1 pb-0", children: _jsxs(InputGroup, { className: "h-control-height! rounded-sm! border-input bg-background shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("w-full text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className), ...props }), _jsx(InputGroupAddon, { children: _jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
32
+ const closeLabel = React.useContext(CommandDialogCloseLabel);
33
+ if (closeLabel !== null) {
34
+ return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex items-center gap-3 border-b border-border px-4 py-3", children: [_jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("h-7 min-w-0 flex-1 bg-transparent text-body-lg outline-hidden placeholder:text-placeholder disabled:cursor-not-allowed disabled:opacity-50", className), ...props }), _jsx(DialogClose, { "aria-label": closeLabel, className: "shrink-0 rounded-xs-plus", children: _jsx(Kbd, { className: "bg-transparent", size: "sm", children: "Esc" }) })] }));
35
+ }
36
+ return (_jsx("div", { "data-slot": "command-input-wrapper", className: "p-2 pb-0", children: _jsxs(InputGroup, { className: "h-control-height! rounded-sm! border-input bg-background shadow-none! *:data-[slot=input-group-addon]:pl-2!", children: [_jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("size-full min-w-0 bg-transparent px-2 text-sm outline-hidden placeholder:text-placeholder disabled:cursor-not-allowed disabled:opacity-50", className), ...props }), _jsx(InputGroupAddon, { children: _jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }) })] }) }));
32
37
  }
33
38
  function CommandList({ className, ...props }) {
34
- return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn("no-scrollbar max-h-72 scroll-py-1 overflow-x-hidden overflow-y-auto outline-none", className), ...props }));
39
+ return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn("no-scrollbar max-h-72 scroll-py-2 overflow-x-hidden overflow-y-auto p-2 outline-none", className), ...props }));
35
40
  }
36
41
  function CommandEmpty({ className, ...props }) {
37
- return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: cn("py-6 text-center text-sm", className), ...props }));
42
+ return (_jsx(CommandPrimitive.Empty, { "data-slot": "command-empty", className: cn("py-7.5 text-center text-sm text-muted-foreground", className), ...props }));
38
43
  }
39
44
  function CommandGroup({ className, ...props }) {
40
- return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn("overflow-hidden p-1 text-foreground **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:py-1.5 **:[[cmdk-group-heading]]:text-xs **:[[cmdk-group-heading]]:font-medium **:[[cmdk-group-heading]]:text-muted-foreground", className), ...props }));
45
+ return (_jsx(CommandPrimitive.Group, { "data-slot": "command-group", className: cn("overflow-hidden text-foreground **:[[cmdk-group-heading]]:flex **:[[cmdk-group-heading]]:h-9 **:[[cmdk-group-heading]]:items-center **:[[cmdk-group-heading]]:px-2 **:[[cmdk-group-heading]]:text-label-sm **:[[cmdk-group-heading]]:font-normal **:[[cmdk-group-heading]]:text-muted-foreground", className), ...props }));
41
46
  }
42
47
  function CommandSeparator({ className, ...props }) {
43
- return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn("-mx-1 h-px bg-border", className), ...props }));
48
+ return (_jsx(CommandPrimitive.Separator, { "data-slot": "command-separator", className: cn("-mx-2 my-2 h-px bg-border", className), ...props }));
44
49
  }
45
50
  function CommandItem({ className, children, ...props }) {
46
- return (_jsxs(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("group/command-item relative flex min-h-touch-target cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-muted data-[selected=true]:text-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground", className), ...props, children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] }));
51
+ return (_jsxs(CommandPrimitive.Item, { "data-slot": "command-item", className: cn("group/command-item relative flex min-h-touch-target cursor-pointer items-center gap-3 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:cursor-default data-[disabled=true]:text-muted-foreground data-[selected=true]:bg-accent data-[selected=true]:text-foreground [@media(hover:hover)_and_(pointer:fine)]:min-h-control-height [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[selected=true]:*:[svg]:text-foreground", className), ...props, children: [children, _jsx(CheckIcon, { className: "ml-auto opacity-0 group-has-data-[slot=command-shortcut]/command-item:hidden group-has-data-[slot=command-suffix]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" })] }));
47
52
  }
48
53
  function CommandShortcut({ className, ...props }) {
49
- return (_jsx("span", { "data-slot": "command-shortcut", className: cn("ml-auto text-xs tracking-widest text-muted-foreground group-data-selected/command-item:text-foreground", className), ...props }));
54
+ return (_jsx(Kbd, { "data-slot": "command-shortcut", ...props, className: cn("ml-auto", className), size: "sm" }));
55
+ }
56
+ function CommandSuffix({ className, ...props }) {
57
+ return (_jsx("span", { "data-slot": "command-suffix", className: cn("ml-auto flex items-center gap-1 text-sm text-muted-foreground", className), ...props }));
50
58
  }
51
- export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator, };
59
+ export { Command, CommandDialog, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSuffix, CommandSeparator, };