@nadicodeai/ui 12.1.102 → 12.1.104

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 +19 -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,21 +1,79 @@
1
1
  import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
2
+ import { type ButtonLinkProps } from "./button.js";
3
+ import type { PresentContent } from "../internal/present-content.js";
2
4
  /**
3
- * A preview of a few facts about something named in a dense row.
5
+ * A card of a few facts about something named in a dense row, shown on hover or focus.
4
6
  *
5
7
  * @family Feedback
6
- * @when A preview of a few facts about something named in a dense row: the exact moment behind a
7
- * relative time, a record's summary.
8
- * @instead For one phrase use `Tooltip`. For anything to edit or keep open use a `Sheet` or the
9
- * record's page. Never the only way to an action.
10
- * @behaviour Opens on hover and on focus, below by default, 4 px off; stays while the pointer is on
11
- * it. Solid floating surface, 12 px padding.
12
- * @words Facts, not prose: the date in words, the time with its zone, the machine timestamp. The
13
- * trigger keeps its verb sentence: *Updated 3 hours ago*.
14
- * @access The trigger is a real element with its own name (a `time` with its `datetime` for a
15
- * moment), so the facts never depend on hover. Keyboard opening is tested, not assumed.
8
+ * @when "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a
9
+ * project, an API key." "The trigger is usually a name link or avatar in dense data."
10
+ * (https://vercel.com/geist/context-card)
11
+ * Ours: `Context Card` is `HoverCard`. The exact moment behind a relative time is also a card. An
12
+ * entity's card is a `HoverCardSummary`.
13
+ * @instead "For a one-line "why" without metadata rows, use `Tooltip`." "For long-form content, edit
14
+ * forms, or persistent navigation, route to a `Drawer` or a detail page." "Don’t use Context Card to
15
+ * surface destructive actions; the panel can dismiss on cursor exit before the user commits." "Don’t
16
+ * nest a Context Card inside a Tooltip or another Context Card; the second layer steals focus and
17
+ * traps keyboard users." (https://vercel.com/geist/context-card)
18
+ * Ours: `Drawer` is `Sheet`. A card is never the only way to an action.
19
+ * @behaviour "Context Card opens on hover and keyboard focus and closes on cursor exit or blur."
20
+ * "Preserve the ~150ms entry delay so it doesn’t flash on a fast mouse sweep." "Cap interactive
21
+ * content at one primary action (`View Project`, `Open Settings`)." "More than one CTA reads as a
22
+ * menu and belongs in `Menu`." "Use `align` to position the card at the start, center, or end of the
23
+ * trigger." "Use `render` to set the trigger as a custom element, such as a link, button, or badge."
24
+ * (https://vercel.com/geist/context-card)
25
+ * Ours: the card stays open while the pointer is on it and opens above by default with a stem
26
+ * pointing at the trigger. `HoverCardContent` requires its facts as children. Colour: one neutral
27
+ * surface with no hue; the only accent a card carries is its link, in the outline button.
28
+ * @words "Lead with the entity name as a Title Case heading and one identifying line in sentence
29
+ * case underneath (team slug, owner, deployment URL)." "Follow with 2–4 metadata rows of `Label:
30
+ * value`." "Keys are Title Case noun phrases (`Last Active`, `Created`, `Plan`); values follow the
31
+ * same formatting rules as table cells." "Use the em-dash character `—` for unknown values, never
32
+ * `N/A` or `null`." "Don’t restate what the trigger already showed." "If the row already renders the
33
+ * deployment URL, don’t repeat it as the first card line." (https://vercel.com/geist/context-card)
34
+ * Ours: the name and the keys are in sentence case (*Last active*). A time's card leads with the
35
+ * relative label, and its trigger keeps its verb sentence: *Updated 3 hours ago*.
36
+ * @access "The trigger keeps its own accessible name; the card is supplementary and shouldn’t
37
+ * replace it." "Card content is reachable by keyboard once the trigger has focus; Escape closes the
38
+ * card and returns focus to the trigger." (https://vercel.com/geist/context-card)
39
+ * Ours: the trigger is a real element (a `time` with its `datetime` for a moment), so the facts
40
+ * never depend on hover. Keyboard opening is tested, not assumed.
16
41
  */
17
42
  declare function HoverCard({ ...props }: PreviewCardPrimitive.Root.Props): import("react").JSX.Element;
18
- declare function HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props): import("react").JSX.Element;
19
- declare function HoverCardContent({ className, side, sideOffset, align, alignOffset, ...props }: PreviewCardPrimitive.Popup.Props & Pick<PreviewCardPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">): import("react").JSX.Element;
20
- export { HoverCard, HoverCardTrigger, HoverCardContent };
43
+ declare function HoverCardTrigger({ delay, ...props }: PreviewCardPrimitive.Trigger.Props): import("react").JSX.Element;
44
+ declare function HoverCardContent({ className, side, sideOffset, align, alignOffset, children, ...props }: PreviewCardPrimitive.Popup.Props & Pick<PreviewCardPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset"> & {
45
+ /** The facts of the card; a card without any does not compile. */
46
+ children: PresentContent;
47
+ }): import("react").JSX.Element;
48
+ export type HoverCardFact = {
49
+ label: string;
50
+ /** `null` is a value not known: drawn as a dash that `missingLabel` names to a screen reader. */
51
+ value: string | null;
52
+ };
53
+ type HoverCardFacts = readonly [HoverCardFact, HoverCardFact] | readonly [HoverCardFact, HoverCardFact, HoverCardFact] | readonly [HoverCardFact, HoverCardFact, HoverCardFact, HoverCardFact];
54
+ export type HoverCardSummaryProps = Omit<React.ComponentProps<"div">, "children"> & {
55
+ /** The entity's name. */
56
+ name: string;
57
+ /** The one line that identifies it, such as a team slug, an owner or a URL. */
58
+ detail: string;
59
+ /** Two to four label and value rows. */
60
+ facts: HoverCardFacts;
61
+ /** What an unknown value means, read to a screen reader behind its dash: "Not reported". */
62
+ missingLabel: string;
63
+ /**
64
+ * The one way onward, a link, so it can never be destructive. `render` is the product's router
65
+ * link, so the card navigates without a page reload.
66
+ */
67
+ action?: {
68
+ label: string;
69
+ href: string;
70
+ render?: ButtonLinkProps["render"];
71
+ };
72
+ };
73
+ /**
74
+ * The content of a `HoverCardContent` that previews an entity: its name, the line that identifies
75
+ * it, two to four facts and at most one link.
76
+ */
77
+ declare function HoverCardSummary({ name, detail, facts, missingLabel, action, className, ...props }: HoverCardSummaryProps): import("react").JSX.Element;
78
+ export { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardSummary };
21
79
  //# sourceMappingURL=hover-card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAKlF;;;;;;;;;;;;;;GAcG;AACH,iBAAS,SAAS,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,IAAI,CAAC,KAAK,+BAE/D;AAED,iBAAS,gBAAgB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,oBAAoB,CAAC,OAAO,CAAC,KAAK,+BAEzE;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,IAAe,EACf,UAAc,EACd,KAAgB,EAChB,WAAe,EACf,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,GACjC,IAAI,CAAC,oBAAoB,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,MAAM,GAAG,YAAY,CAAC,+BAuB7F;AAED,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
1
+ {"version":3,"file":"hover-card.d.ts","sourceRoot":"","sources":["../../src/components/hover-card.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGlF,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAEvE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAMjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;A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C,MAAM,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAA;KAAE,CAAC;CAC9E,CAAC;AAEF;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,EACxB,IAAI,EACJ,MAAM,EACN,KAAK,EACL,YAAY,EACZ,MAAM,EACN,SAAS,EACT,GAAG,KAAK,EACT,EAAE,qBAAqB,+BA8BvB;AAED,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,30 +1,64 @@
1
1
  "use client";
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
4
+ import { Fragment } from "react";
5
+ import { ButtonLink } from "./button.js";
6
+ import { TableValue } from "./table-value.js";
4
7
  import { anchoredOverlayMotion } from "../lib/motion.js";
5
8
  import { cn } from "../lib/utils.js";
9
+ const HOVER_CARD_DELAY = 150;
6
10
  /**
7
- * A preview of a few facts about something named in a dense row.
11
+ * A card of a few facts about something named in a dense row, shown on hover or focus.
8
12
  *
9
13
  * @family Feedback
10
- * @when A preview of a few facts about something named in a dense row: the exact moment behind a
11
- * relative time, a record's summary.
12
- * @instead For one phrase use `Tooltip`. For anything to edit or keep open use a `Sheet` or the
13
- * record's page. Never the only way to an action.
14
- * @behaviour Opens on hover and on focus, below by default, 4 px off; stays while the pointer is on
15
- * it. Solid floating surface, 12 px padding.
16
- * @words Facts, not prose: the date in words, the time with its zone, the machine timestamp. The
17
- * trigger keeps its verb sentence: *Updated 3 hours ago*.
18
- * @access The trigger is a real element with its own name (a `time` with its `datetime` for a
19
- * moment), so the facts never depend on hover. Keyboard opening is tested, not assumed.
14
+ * @when "Use Context Card to reveal entity metadata on hover or focus: a user, a deployment, a
15
+ * project, an API key." "The trigger is usually a name link or avatar in dense data."
16
+ * (https://vercel.com/geist/context-card)
17
+ * Ours: `Context Card` is `HoverCard`. The exact moment behind a relative time is also a card. An
18
+ * entity's card is a `HoverCardSummary`.
19
+ * @instead "For a one-line "why" without metadata rows, use `Tooltip`." "For long-form content, edit
20
+ * forms, or persistent navigation, route to a `Drawer` or a detail page." "Don’t use Context Card to
21
+ * surface destructive actions; the panel can dismiss on cursor exit before the user commits." "Don’t
22
+ * nest a Context Card inside a Tooltip or another Context Card; the second layer steals focus and
23
+ * traps keyboard users." (https://vercel.com/geist/context-card)
24
+ * Ours: `Drawer` is `Sheet`. A card is never the only way to an action.
25
+ * @behaviour "Context Card opens on hover and keyboard focus and closes on cursor exit or blur."
26
+ * "Preserve the ~150ms entry delay so it doesn’t flash on a fast mouse sweep." "Cap interactive
27
+ * content at one primary action (`View Project`, `Open Settings`)." "More than one CTA reads as a
28
+ * menu and belongs in `Menu`." "Use `align` to position the card at the start, center, or end of the
29
+ * trigger." "Use `render` to set the trigger as a custom element, such as a link, button, or badge."
30
+ * (https://vercel.com/geist/context-card)
31
+ * Ours: the card stays open while the pointer is on it and opens above by default with a stem
32
+ * pointing at the trigger. `HoverCardContent` requires its facts as children. Colour: one neutral
33
+ * surface with no hue; the only accent a card carries is its link, in the outline button.
34
+ * @words "Lead with the entity name as a Title Case heading and one identifying line in sentence
35
+ * case underneath (team slug, owner, deployment URL)." "Follow with 2–4 metadata rows of `Label:
36
+ * value`." "Keys are Title Case noun phrases (`Last Active`, `Created`, `Plan`); values follow the
37
+ * same formatting rules as table cells." "Use the em-dash character `—` for unknown values, never
38
+ * `N/A` or `null`." "Don’t restate what the trigger already showed." "If the row already renders the
39
+ * deployment URL, don’t repeat it as the first card line." (https://vercel.com/geist/context-card)
40
+ * Ours: the name and the keys are in sentence case (*Last active*). A time's card leads with the
41
+ * relative label, and its trigger keeps its verb sentence: *Updated 3 hours ago*.
42
+ * @access "The trigger keeps its own accessible name; the card is supplementary and shouldn’t
43
+ * replace it." "Card content is reachable by keyboard once the trigger has focus; Escape closes the
44
+ * card and returns focus to the trigger." (https://vercel.com/geist/context-card)
45
+ * Ours: the trigger is a real element (a `time` with its `datetime` for a moment), so the facts
46
+ * never depend on hover. Keyboard opening is tested, not assumed.
20
47
  */
21
48
  function HoverCard({ ...props }) {
22
49
  return _jsx(PreviewCardPrimitive.Root, { "data-slot": "hover-card", ...props });
23
50
  }
24
- function HoverCardTrigger({ ...props }) {
25
- return _jsx(PreviewCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", ...props });
51
+ function HoverCardTrigger({ delay = HOVER_CARD_DELAY, ...props }) {
52
+ return _jsx(PreviewCardPrimitive.Trigger, { "data-slot": "hover-card-trigger", delay: delay, ...props });
26
53
  }
27
- function HoverCardContent({ className, side = "bottom", sideOffset = 4, align = "center", alignOffset = 4, ...props }) {
28
- return (_jsx(PreviewCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(PreviewCardPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsx(PreviewCardPrimitive.Popup, { "data-slot": "hover-card-content", className: cn("pointer-events-auto", "z-50 w-64 rounded-lg border-0 bg-popover p-control-padding-inline text-sm text-popover-foreground nc-elevation-floating outline-hidden", anchoredOverlayMotion, className), ...props }) }) }));
54
+ function HoverCardContent({ className, side = "top", sideOffset = 14, align = "center", alignOffset = 0, children, ...props }) {
55
+ return (_jsx(PreviewCardPrimitive.Portal, { "data-slot": "hover-card-portal", children: _jsx(PreviewCardPrimitive.Positioner, { align: align, alignOffset: alignOffset, side: side, sideOffset: sideOffset, className: "isolate z-50", children: _jsx(PreviewCardPrimitive.Popup, { "data-slot": "hover-card-content", className: cn("pointer-events-auto", "z-50 w-fit max-w-max rounded-sm border-0 bg-popover p-control-padding-inline text-body-md text-popover-foreground nc-elevation-floating outline-hidden", anchoredOverlayMotion, className), ...props, children: children }) }) }));
29
56
  }
30
- export { HoverCard, HoverCardTrigger, HoverCardContent };
57
+ /**
58
+ * The content of a `HoverCardContent` that previews an entity: its name, the line that identifies
59
+ * it, two to four facts and at most one link.
60
+ */
61
+ function HoverCardSummary({ name, detail, facts, missingLabel, action, className, ...props }) {
62
+ return (_jsxs("div", { "data-slot": "hover-card-summary", className: cn("grid gap-3", className), ...props, children: [_jsxs("div", { className: "grid gap-0.5", children: [_jsx("p", { className: "text-heading-compact", children: name }), _jsx("p", { className: "text-body-sm text-muted-foreground", children: detail })] }), _jsx("dl", { className: "grid grid-cols-[auto_1fr] gap-x-4 gap-y-1 text-body-sm", children: facts.map((fact) => (_jsxs(Fragment, { children: [_jsx("dt", { className: "text-muted-foreground", children: fact.label }), _jsx("dd", { className: "min-w-0 break-words", children: _jsx(TableValue, { missingLabel: missingLabel, value: fact.value }) })] }, fact.label))) }), action ? (_jsx(ButtonLink, { href: action.href, render: action.render, size: "sm", variant: "outline", className: "justify-self-start", children: action.label })) : null] }));
63
+ }
64
+ export { HoverCard, HoverCardTrigger, HoverCardContent, HoverCardSummary };
@@ -28,6 +28,11 @@ export type IdentityMarkProps = {
28
28
  } & AppMarkGlyph) | {
29
29
  kind: "company";
30
30
  name: string;
31
+ /**
32
+ * The company's logo: the white ink Sofia kept from its site, drawn on a dark tile in every
33
+ * theme, or a square icon in its own colours (an SVG tile), which fills the tile as it is.
34
+ */
35
+ logo?: string;
31
36
  } | {
32
37
  kind: "person";
33
38
  name: string;
@@ -38,6 +43,8 @@ export type IdentityMarkProps = {
38
43
  icon: IconComponent;
39
44
  /** A catalogue kind's ground; neutral is the ringed card ground. */
40
45
  tone?: "neutral" | "skill" | "plugin" | "teal";
46
+ /** The record's own object picture, a transparent image drawn on its kind's ground in place of the icon. */
47
+ picture?: string;
41
48
  });
42
49
  /**
43
50
  * What says which thing a record is, at a fixed size at the start of its row,
@@ -47,7 +54,7 @@ export type IdentityMarkProps = {
47
54
  * @family Status
48
55
  * @when The first thing in a record's row (32), at the head of its object page (64), in a feed or a sidebar identity line (24), on a Library entry (40): wherever it tells a person which thing they are looking at.
49
56
  * @instead An icon beside a card's title, a KPI's label or a section heading only repeats the words and is left out. A picture for a first use or a whole-page moment is the empty state's or the page's own. A model is its `ModelIdentity`.
50
- * @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her orb from the orb engine, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo on the white tile; a company is two initials on the ringed card tile; a person is their picture, then their initials; a record with no picture of its own takes its kind's navigation icon, on the purple ground for a skill and the blue one for a plugin.
57
+ * @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her orb from the orb engine, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo on the white tile; a company is its logo: the one white ink Sofia kept from its site on a black tile in both themes, as the company's card stamps it, or a square SVG icon in its own colours filling the tile, as Vercel shows a project's favicon; its two initials on the ringed card tile until a logo is found, or when the stored logo does not load; a person is their picture, then their initials; a record with its own object picture, such as a Library skill or plugin, draws that picture on its kind's ground; a record with no picture of its own takes its kind's navigation icon, on the purple ground for a skill and the blue one for a plugin.
51
58
  * @words None of its own: the record's name stands beside it. Initials are the first letters of the name's first two words.
52
59
  * @access Decorative beside the record's name. Alone, as in a narrow rail, `label` names it.
53
60
  */
@@ -1 +1 @@
1
- {"version":3,"file":"identity-mark.d.ts","sourceRoot":"","sources":["../../src/components/identity-mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEnF,OAAO,EAEL,KAAK,cAAc,EAEnB,KAAK,aAAa,EACnB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAW,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAInE,MAAM,MAAM,gBAAgB,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AAE3D,qHAAqH;AACrH,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;IACxC,SAAS,CAAC,EAAE,MAAM,CA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D;IACE,IAAI,EAAE,QAAQ,CAAC;IACf,0FAA0F;IAC1F,IAAI,EAAE,aAAa,CAAC;IACpB,oEAAoE;IACpE,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAC/C,4GAA4G;IAC5G,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CACJ,CAAC;AA6FF;;;;;;;;;;;GAWG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,GAAG,SAAS,CAyEhE"}
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { AgentOrb, } from "./agent-orb.js";
3
3
  import { AppMark } from "./app-mark.js";
4
4
  import { Avatar, AvatarFallback, AvatarImage } from "./avatar.js";
5
+ import { CompanyLogo } from "../internal/company-logo.js";
5
6
  import { cn } from "../lib/utils.js";
6
7
  const MEASURES = {
7
8
  20: { orb: 20, icon: 12, initials: 8 },
@@ -17,6 +18,26 @@ const TONES = {
17
18
  plugin: "bg-info-soft text-info-soft-foreground",
18
19
  teal: "bg-category-teal text-category-teal-foreground",
19
20
  };
21
+ const SVG_DATA = "data:image/svg+xml";
22
+ /**
23
+ * Whether the logo is a square icon in its own colours: an SVG data URL whose box is square. The
24
+ * logos Sofia keeps are a raster white ink, never SVG, so everything else is ink for the dark tile.
25
+ */
26
+ function logoIsColourTile(logo) {
27
+ if (!logo.startsWith(SVG_DATA))
28
+ return false;
29
+ const comma = logo.indexOf(",");
30
+ let svg;
31
+ try {
32
+ const body = logo.slice(comma + 1);
33
+ svg = logo.slice(0, comma).endsWith(";base64") ? atob(body) : decodeURIComponent(body);
34
+ }
35
+ catch {
36
+ return false;
37
+ }
38
+ const box = /viewBox\s*=\s*["']\s*[-\d.]+[\s,]+[-\d.]+[\s,]+([\d.]+)[\s,]+([\d.]+)/i.exec(svg);
39
+ return box !== null && box[1] === box[2];
40
+ }
20
41
  function identityInitials(name) {
21
42
  return name
22
43
  .split(/\s+/)
@@ -31,6 +52,9 @@ function naming(label) {
31
52
  ? { role: "img", "aria-label": label }
32
53
  : { "aria-hidden": true };
33
54
  }
55
+ function avatarName(label) {
56
+ return label ? { label } : { decorative: true };
57
+ }
34
58
  function Tile({ kind, label, size, tone, children, }) {
35
59
  return (_jsx("span", { className: cn("inline-flex shrink-0 items-center justify-center", size >= 40 ? "rounded-md" : "rounded-sm", TONES[tone]), "data-kind": kind, "data-slot": "identity-mark", style: { width: size, height: size }, ...naming(label), children: children }));
36
60
  }
@@ -42,7 +66,7 @@ function Tile({ kind, label, size, tone, children, }) {
42
66
  * @family Status
43
67
  * @when The first thing in a record's row (32), at the head of its object page (64), in a feed or a sidebar identity line (24), on a Library entry (40): wherever it tells a person which thing they are looking at.
44
68
  * @instead An icon beside a card's title, a KPI's label or a section heading only repeats the words and is left out. A picture for a first use or a whole-page moment is the empty state's or the page's own. A model is its `ModelIdentity`.
45
- * @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her orb from the orb engine, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo on the white tile; a company is two initials on the ringed card tile; a person is their picture, then their initials; a record with no picture of its own takes its kind's navigation icon, on the purple ground for a skill and the blue one for a plugin.
69
+ * @behaviour Static, except an Agent's orb, which moves with her state. An Agent is always her orb from the orb engine, never an avatar or a painted circle, and `frame` lets the product wrap that orb, such as in the transition that carries her to her page; an app keeps its own logo on the white tile; a company is its logo: the one white ink Sofia kept from its site on a black tile in both themes, as the company's card stamps it, or a square SVG icon in its own colours filling the tile, as Vercel shows a project's favicon; its two initials on the ringed card tile until a logo is found, or when the stored logo does not load; a person is their picture, then their initials; a record with its own object picture, such as a Library skill or plugin, draws that picture on its kind's ground; a record with no picture of its own takes its kind's navigation icon, on the purple ground for a skill and the blue one for a plugin.
46
70
  * @words None of its own: the record's name stands beside it. Initials are the first letters of the name's first two words.
47
71
  * @access Decorative beside the record's name. Alone, as in a narrow rail, `label` names it.
48
72
  */
@@ -57,10 +81,12 @@ export function IdentityMark(props) {
57
81
  case "app":
58
82
  return props.platform ? (_jsx(AppMark, { app: props.app, label: props.label, platform: props.platform, size: size })) : (_jsx(AppMark, { app: props.app, label: props.label, logo: props.logo, size: size }));
59
83
  case "person":
60
- return (_jsxs(Avatar, { "data-kind": "person", "data-slot": "identity-mark", style: { width: size, height: size }, ...naming(props.label), children: [props.image ? _jsx(AvatarImage, { alt: "", src: props.image }) : null, _jsx(AvatarFallback, { style: { fontSize: measures.initials }, children: identityInitials(props.name) })] }));
61
- case "company":
62
- return (_jsx(Tile, { kind: "company", label: props.label, size: size, tone: "neutral", children: _jsx("span", { "aria-hidden": "true", className: "leading-none font-semibold", style: { fontSize: measures.initials }, children: identityInitials(props.name) }) }));
84
+ return (_jsxs(Avatar, { "data-kind": "person", "data-slot": "identity-mark", style: { width: size, height: size }, ...avatarName(props.label), children: [props.image ? _jsx(AvatarImage, { alt: "", src: props.image }) : null, _jsx(AvatarFallback, { style: { fontSize: measures.initials }, children: identityInitials(props.name) })] }));
85
+ case "company": {
86
+ const initials = (_jsx(Tile, { kind: "company", label: props.label, size: size, tone: "neutral", children: _jsx("span", { "aria-hidden": "true", className: "leading-none font-semibold", style: { fontSize: measures.initials }, children: identityInitials(props.name) }) }));
87
+ return props.logo ? (_jsx(CompanyLogo, { colourTile: logoIsColourTile(props.logo), fallback: initials, logo: props.logo, naming: naming(props.label), size: size })) : (initials);
88
+ }
63
89
  case "record":
64
- return (_jsx(Tile, { kind: "record", label: props.label, size: size, tone: props.tone ?? "neutral", children: _jsx(props.icon, { "aria-hidden": "true", size: measures.icon }) }));
90
+ return (_jsx(Tile, { kind: "record", label: props.label, size: size, tone: props.tone ?? "neutral", children: props.picture ? (_jsx("img", { alt: "", className: "size-[84%] object-contain", "data-slot": "identity-mark-picture", src: props.picture })) : (_jsx(props.icon, { "aria-hidden": "true", size: measures.icon })) }));
65
91
  }
66
92
  }
@@ -1,35 +1,58 @@
1
1
  import * as React from "react";
2
2
  import { type VariantProps } from "class-variance-authority";
3
- import { Button } from "./button.js";
3
+ import { type AccessibleName, type TextButtonProps } from "./button.js";
4
+ import { InputBox, type FieldSize } from "../internal/input-box.js";
4
5
  /**
5
6
  * One input box with something fixed inside it: a mark, a prefix, a button.
6
7
  *
7
8
  * @family Inputs
8
- * @when A single-line value with something fixed inside the box: a search mark, a clear button, a
9
- * prefix like *https://*, a copy button.
10
- * @instead A collection's search is `CollectionSearch`, never a hand-built group. A plain value is
11
- * `Input`. Many known values to filter is `Combobox`.
12
- * @behaviour The group draws the edge and the focus outline for the input inside it. The clear
13
- * button empties the value and puts focus back in the box. Escape clears only while the box holds
14
- * the interaction and has a value; otherwise it closes the overlay as usual.
9
+ * @when A single-line value with a button inside the box: a copy button, a block addon, a textarea
10
+ * with a toolbar, a server-given value (a project ID) shown read-only in mono beside its copy
11
+ * button, with no Save.
12
+ * @instead A prefix or suffix of text or an icon (*https://*, *.com*), in a cell or plain, is the
13
+ * `prefix`, `suffix` and `look` props of `Input`. A value that clears itself is `ClearableInput`; a
14
+ * collection's search is `CollectionSearch`, never a hand-built group. Many known values to filter
15
+ * is `Combobox`.
16
+ * @behaviour The group draws the edge and the focus halo for the input inside it, so the ring
17
+ * wraps the addons too, and takes the sizes of `Input`: the input follows the group's. An addon is
18
+ * a `segment` (a filled cell with a divider, the look of `Input`'s prefix and suffix) or `plain`
19
+ * (a mark on the box's own fill, flush against the text). An icon button in an addon fills the
20
+ * row, sits flush against the edge, is muted until hovered and never fills on hover or press.
21
+ * A disabled input steps the whole group down in fill and text, never in opacity, an icon button
22
+ * included; a button in an addon that is held, such as a send button waiting for text, leaves the
23
+ * box as it is.
24
+ * Colour sits where it does on `Input`: only an error reddens the ring; a suffix reads in the text
25
+ * colour in both looks, a prefix in the muted grey. `rounded` makes the group a pill. The group's own
26
+ * `size` is the only place a size is set.
15
27
  * @words Prefix and suffix are literal text, never the label. An inline button names what it does:
16
- * *Clear search*, *Copy address*.
17
- * @access `role="group"` around the box. The input inside keeps its own label. Inline buttons are
18
- * named: *Clear search*, *Copy address*.
28
+ * *Copy address*.
29
+ * @access `role="group"` around the box. The input inside is named by `aria-label` or
30
+ * `aria-labelledby`. "For icon-only affordances inside a row of inputs, use `<Button shape="circle"
31
+ * svgOnly aria-label="…">` rather than an unlabeled icon." (https://vercel.com/geist/input) Ours:
32
+ * an inline button carries its `aria-label`.
19
33
  */
20
- declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
34
+ declare function InputGroup({ className, size, rounded, ...props }: React.ComponentProps<"div"> & {
35
+ size?: FieldSize;
36
+ /** A pill: the box and its cells take the full corner. */
37
+ rounded?: boolean;
38
+ }): React.JSX.Element;
21
39
  declare const inputGroupAddonVariants: (props?: ({
22
40
  align?: "inline-end" | "inline-start" | "block-end" | "block-start" | null | undefined;
41
+ look?: "plain" | "segment" | null | undefined;
23
42
  } & import("class-variance-authority/types").ClassProp) | undefined) => string;
24
- declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
25
- declare const inputGroupButtonVariants: (props?: ({
26
- size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
27
- } & import("class-variance-authority/types").ClassProp) | undefined) => string;
28
- declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> & VariantProps<typeof inputGroupButtonVariants> & {
43
+ declare function InputGroupAddon({ className, align, look, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
44
+ type InputGroupButtonBase = Omit<TextButtonProps, "size" | "type" | "loading" | "loadingLabel"> & {
29
45
  type?: "button" | "submit" | "reset";
30
- }): React.JSX.Element;
46
+ };
47
+ type InputGroupButtonProps = (InputGroupButtonBase & {
48
+ size?: "xs" | "sm";
49
+ }) | (Omit<InputGroupButtonBase, "prefix" | "suffix"> & AccessibleName & {
50
+ size: "icon";
51
+ });
52
+ declare function InputGroupButton({ className, type, variant, size, ...props }: InputGroupButtonProps): React.JSX.Element;
31
53
  declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
32
- declare function InputGroupInput({ className, ...props }: React.ComponentProps<"input">): React.JSX.Element;
33
- declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
34
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
54
+ declare function InputGroupControl({ className, ...props }: Omit<React.ComponentProps<typeof InputBox>, "size">): React.JSX.Element;
55
+ declare function InputGroupInput(props: React.ComponentProps<typeof InputGroupControl> & AccessibleName): React.JSX.Element;
56
+ declare function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea"> & AccessibleName): React.JSX.Element;
57
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupControl, InputGroupInput, InputGroupTextarea, };
35
58
  //# sourceMappingURL=input-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"input-group.d.ts","sourceRoot":"","sources":["../../src/components/input-group.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAI7C;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAYvE;AAED,QAAA,MAAM,uBAAuB;;8EAiB5B,CAAC;AAEF,iBAAS,eAAe,CAAC,EACvB,SAAS,EACT,KAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAAC,OAAO,uBAAuB,CAAC,qBAkB5E;AAED,QAAA,MAAM,wBAAwB;;8EAY5B,CAA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iBAAS,kBAAkB,CAAC,EAC1B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,UAAU,CAAC,GAAG,cAAc,qBAWnD;AAED,OAAO,EACL,UAAU,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,eAAe,EACf,kBAAkB,GACnB,CAAC"}
@@ -1,44 +1,88 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
+ import * as React from "react";
3
4
  import { cva } from "class-variance-authority";
4
5
  import { cn } from "../lib/utils.js";
5
6
  import { Button } from "./button.js";
6
- import { Input } from "./input.js";
7
7
  import { Textarea } from "./textarea.js";
8
+ import { fieldGroupStates, fieldRing, InputBox } from "../internal/input-box.js";
9
+ const InputGroupSizeContext = React.createContext("default");
10
+ const inputGroupVariants = cva([
11
+ "group/input-group relative flex min-h-touch-target w-full min-w-0 items-center overflow-hidden bg-(--nc-field,var(--background)) has-[[data-slot=input-group-control]:disabled]:cursor-not-allowed has-[[data-slot=input-group-control]:disabled]:bg-accent",
12
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 [@media(hover:hover)_and_(pointer:fine)]:min-h-0",
13
+ fieldRing,
14
+ fieldGroupStates,
15
+ ], {
16
+ variants: {
17
+ size: {
18
+ sm: "h-nadicode-control-height-sm rounded-sm [--input-group-radius:var(--radius-sm)]",
19
+ default: "h-control-height rounded-sm [--input-group-radius:var(--radius-sm)]",
20
+ lg: "h-nadicode-control-height-lg rounded-md [--input-group-radius:var(--radius-md)]",
21
+ },
22
+ rounded: {
23
+ true: "rounded-full [--input-group-radius:var(--radius-full)]",
24
+ false: "",
25
+ },
26
+ },
27
+ defaultVariants: { size: "default", rounded: false },
28
+ });
8
29
  /**
9
30
  * One input box with something fixed inside it: a mark, a prefix, a button.
10
31
  *
11
32
  * @family Inputs
12
- * @when A single-line value with something fixed inside the box: a search mark, a clear button, a
13
- * prefix like *https://*, a copy button.
14
- * @instead A collection's search is `CollectionSearch`, never a hand-built group. A plain value is
15
- * `Input`. Many known values to filter is `Combobox`.
16
- * @behaviour The group draws the edge and the focus outline for the input inside it. The clear
17
- * button empties the value and puts focus back in the box. Escape clears only while the box holds
18
- * the interaction and has a value; otherwise it closes the overlay as usual.
33
+ * @when A single-line value with a button inside the box: a copy button, a block addon, a textarea
34
+ * with a toolbar, a server-given value (a project ID) shown read-only in mono beside its copy
35
+ * button, with no Save.
36
+ * @instead A prefix or suffix of text or an icon (*https://*, *.com*), in a cell or plain, is the
37
+ * `prefix`, `suffix` and `look` props of `Input`. A value that clears itself is `ClearableInput`; a
38
+ * collection's search is `CollectionSearch`, never a hand-built group. Many known values to filter
39
+ * is `Combobox`.
40
+ * @behaviour The group draws the edge and the focus halo for the input inside it, so the ring
41
+ * wraps the addons too, and takes the sizes of `Input`: the input follows the group's. An addon is
42
+ * a `segment` (a filled cell with a divider, the look of `Input`'s prefix and suffix) or `plain`
43
+ * (a mark on the box's own fill, flush against the text). An icon button in an addon fills the
44
+ * row, sits flush against the edge, is muted until hovered and never fills on hover or press.
45
+ * A disabled input steps the whole group down in fill and text, never in opacity, an icon button
46
+ * included; a button in an addon that is held, such as a send button waiting for text, leaves the
47
+ * box as it is.
48
+ * Colour sits where it does on `Input`: only an error reddens the ring; a suffix reads in the text
49
+ * colour in both looks, a prefix in the muted grey. `rounded` makes the group a pill. The group's own
50
+ * `size` is the only place a size is set.
19
51
  * @words Prefix and suffix are literal text, never the label. An inline button names what it does:
20
- * *Clear search*, *Copy address*.
21
- * @access `role="group"` around the box. The input inside keeps its own label. Inline buttons are
22
- * named: *Clear search*, *Copy address*.
52
+ * *Copy address*.
53
+ * @access `role="group"` around the box. The input inside is named by `aria-label` or
54
+ * `aria-labelledby`. "For icon-only affordances inside a row of inputs, use `<Button shape="circle"
55
+ * svgOnly aria-label="…">` rather than an unlabeled icon." (https://vercel.com/geist/input) Ours:
56
+ * an inline button carries its `aria-label`.
23
57
  */
24
- function InputGroup({ className, ...props }) {
25
- return (_jsx("div", { "data-slot": "input-group", role: "group", className: cn("group/input-group relative flex h-control-height min-h-touch-target w-full min-w-0 items-center rounded-sm border border-input bg-background transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit has-disabled:bg-input/50 has-disabled:opacity-50 not-in-data-[slot=combobox-content]:has-[[data-slot=input-group-control]:focus-visible]:nc-focus-outline has-[[data-slot=input-group-control]:focus-visible]:outline-ring has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:nc-focus-outline has-[[data-slot][aria-invalid=true]]:outline-destructive has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [@media(hover:hover)_and_(pointer:fine)]:min-h-0", className), ...props }));
58
+ function InputGroup({ className, size = "default", rounded = false, ...props }) {
59
+ return (_jsx(InputGroupSizeContext.Provider, { value: size, children: _jsx("div", { "data-slot": "input-group", "data-size": size, "data-rounded": rounded || undefined, role: "group", className: cn(inputGroupVariants({ size, rounded }), className), ...props }) }));
26
60
  }
27
- const inputGroupAddonVariants = cva("flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4", {
61
+ const inputGroupAddonVariants = cva("flex cursor-text items-center justify-center text-sm font-normal text-muted-foreground select-none group-has-[[data-slot=input-group-control]:disabled]/input-group:cursor-not-allowed [&>svg:not([class*='size-'])]:size-3.5", {
28
62
  variants: {
29
63
  align: {
30
- "inline-start": "order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]",
31
- "inline-end": "order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]",
32
- "block-start": "order-first w-full justify-start px-control-padding-inline pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
33
- "block-end": "order-last w-full justify-start px-control-padding-inline pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
64
+ "inline-start": "order-first self-stretch px-control-padding-inline group-data-[size=sm]/input-group:px-2 has-[>button]:p-0",
65
+ "inline-end": "order-last self-stretch px-control-padding-inline text-foreground group-data-[size=sm]/input-group:px-2 has-[>button]:p-0",
66
+ "block-start": "order-first w-full justify-start gap-2 px-control-padding-inline py-1.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2",
67
+ "block-end": "order-last w-full justify-start gap-2 px-control-padding-inline py-1.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2",
68
+ },
69
+ look: {
70
+ plain: "",
71
+ segment: "bg-muted",
34
72
  },
35
73
  },
74
+ compoundVariants: [
75
+ { align: "inline-start", look: "plain", className: "pr-0" },
76
+ { align: "inline-start", look: "segment", className: "border-r border-input" },
77
+ { align: "inline-end", look: "segment", className: "border-l border-input" },
78
+ ],
36
79
  defaultVariants: {
37
80
  align: "inline-start",
81
+ look: "plain",
38
82
  },
39
83
  });
40
- function InputGroupAddon({ className, align = "inline-start", ...props }) {
41
- return (_jsx("div", { role: "group", "data-slot": "input-group-addon", "data-align": align, className: cn(inputGroupAddonVariants({ align }), className), onClick: (e) => {
84
+ function InputGroupAddon({ className, align = "inline-start", look = "plain", ...props }) {
85
+ return (_jsx("div", { role: "group", "data-slot": "input-group-addon", "data-align": align, "data-look": look, className: cn(inputGroupAddonVariants({ align, look }), className), onClick: (e) => {
42
86
  // SAFETY: a click reaches this handler only from the addon or a node inside it, and React reports a text node's parent element as the target (react-dom's getEventTarget), so the target is an Element in whichever document the addon renders.
43
87
  if (e.target.closest("button")) {
44
88
  return;
@@ -46,13 +90,12 @@ function InputGroupAddon({ className, align = "inline-start", ...props }) {
46
90
  e.currentTarget.parentElement?.querySelector("input")?.focus();
47
91
  }, ...props }));
48
92
  }
49
- const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
93
+ const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none focus-visible:-outline-offset-2", {
50
94
  variants: {
51
95
  size: {
52
96
  xs: "h-6 gap-1 rounded-sm px-1.5 [&>svg:not([class*='size-'])]:size-3.5",
53
97
  sm: "",
54
- "icon-xs": "size-6 rounded-sm p-0 has-[>svg]:p-0",
55
- "icon-sm": "size-8 p-0 has-[>svg]:p-0",
98
+ icon: "h-full justify-center rounded-none px-2.5 text-base text-muted-foreground hover:bg-transparent hover:text-foreground active:bg-transparent aria-expanded:bg-transparent aria-expanded:text-foreground disabled:text-placeholder disabled:opacity-100 aria-disabled:not-aria-busy:text-placeholder aria-disabled:not-aria-busy:opacity-100 in-data-[align=inline-end]:last:rounded-r-[calc(var(--input-group-radius)-1px)] [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [@media(hover:hover)_and_(pointer:fine)]:min-w-10",
56
99
  },
57
100
  },
58
101
  defaultVariants: {
@@ -65,10 +108,14 @@ function InputGroupButton({ className, type = "button", variant = "ghost", size
65
108
  function InputGroupText({ className, ...props }) {
66
109
  return (_jsx("span", { className: cn("flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4", className), ...props }));
67
110
  }
68
- function InputGroupInput({ className, ...props }) {
69
- return (_jsx(Input, { "data-slot": "input-group-control", className: cn("flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:outline-none disabled:bg-transparent aria-invalid:outline-none", className), ...props }));
111
+ function InputGroupControl({ className, ...props }) {
112
+ const size = React.useContext(InputGroupSizeContext);
113
+ return (_jsx(InputBox, { "data-slot": "input-group-control", size: size, className: cn("flex-1 rounded-none bg-transparent shadow-none focus-visible:outline-none disabled:bg-transparent aria-invalid:outline-none", className), ...props }));
114
+ }
115
+ function InputGroupInput(props) {
116
+ return _jsx(InputGroupControl, { ...props });
70
117
  }
71
118
  function InputGroupTextarea({ className, ...props }) {
72
- return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn("flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none focus-visible:outline-none disabled:bg-transparent aria-invalid:outline-none", className), ...props }));
119
+ return (_jsx(Textarea, { "data-slot": "input-group-control", className: cn("flex-1 resize-none rounded-none bg-transparent shadow-none focus-visible:outline-none disabled:bg-transparent aria-invalid:outline-none", className), ...props }));
73
120
  }
74
- export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, InputGroupTextarea, };
121
+ export { InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupControl, InputGroupInput, InputGroupTextarea, };