@nadicodeai/ui 12.1.101 → 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 (567) 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.d.ts +18 -18
  5. package/dist/components/account-menu.d.ts.map +1 -1
  6. package/dist/components/account-menu.js +17 -13
  7. package/dist/components/action-menu.d.ts +20 -19
  8. package/dist/components/action-menu.d.ts.map +1 -1
  9. package/dist/components/action-menu.js +22 -15
  10. package/dist/components/action-status.d.ts +14 -10
  11. package/dist/components/action-status.d.ts.map +1 -1
  12. package/dist/components/action-status.js +14 -10
  13. package/dist/components/activity-calendar.d.ts +3 -1
  14. package/dist/components/activity-calendar.d.ts.map +1 -1
  15. package/dist/components/activity-calendar.js +16 -2
  16. package/dist/components/activity-feed.d.ts +2 -2
  17. package/dist/components/activity-feed.d.ts.map +1 -1
  18. package/dist/components/activity-feed.js +14 -5
  19. package/dist/components/agent-card.d.ts +11 -5
  20. package/dist/components/agent-card.d.ts.map +1 -1
  21. package/dist/components/agent-card.js +13 -7
  22. package/dist/components/agent-list-row.js +1 -1
  23. package/dist/components/agent-orb-appearance.d.ts +7 -1
  24. package/dist/components/agent-orb-appearance.d.ts.map +1 -1
  25. package/dist/components/agent-orb-appearance.js +26 -0
  26. package/dist/components/agent-profile.d.ts +8 -7
  27. package/dist/components/agent-profile.d.ts.map +1 -1
  28. package/dist/components/agent-profile.js +6 -6
  29. package/dist/components/alert-dialog.d.ts +25 -16
  30. package/dist/components/alert-dialog.d.ts.map +1 -1
  31. package/dist/components/alert-dialog.js +30 -18
  32. package/dist/components/alert.d.ts +1 -1
  33. package/dist/components/avatar.d.ts +83 -17
  34. package/dist/components/avatar.d.ts.map +1 -1
  35. package/dist/components/avatar.js +89 -23
  36. package/dist/components/badge.d.ts +59 -8
  37. package/dist/components/badge.d.ts.map +1 -1
  38. package/dist/components/badge.js +57 -14
  39. package/dist/components/breadcrumb.d.ts +18 -7
  40. package/dist/components/breadcrumb.d.ts.map +1 -1
  41. package/dist/components/breadcrumb.js +37 -13
  42. package/dist/components/button-group.d.ts +12 -15
  43. package/dist/components/button-group.d.ts.map +1 -1
  44. package/dist/components/button-group.js +13 -17
  45. package/dist/components/button.d.ts +126 -23
  46. package/dist/components/button.d.ts.map +1 -1
  47. package/dist/components/button.js +164 -39
  48. package/dist/components/calendar.d.ts +26 -15
  49. package/dist/components/calendar.d.ts.map +1 -1
  50. package/dist/components/calendar.js +60 -46
  51. package/dist/components/card-row.d.ts +13 -5
  52. package/dist/components/card-row.d.ts.map +1 -1
  53. package/dist/components/card-row.js +24 -10
  54. package/dist/components/card.d.ts +6 -12
  55. package/dist/components/card.d.ts.map +1 -1
  56. package/dist/components/card.js +11 -16
  57. package/dist/components/carousel.d.ts +3 -3
  58. package/dist/components/carousel.d.ts.map +1 -1
  59. package/dist/components/carousel.js +7 -7
  60. package/dist/components/catalog-drawer.d.ts +7 -7
  61. package/dist/components/catalog-drawer.d.ts.map +1 -1
  62. package/dist/components/catalog-drawer.js +6 -6
  63. package/dist/components/chart-area-stacked.d.ts +1 -1
  64. package/dist/components/chart-area-stacked.d.ts.map +1 -1
  65. package/dist/components/chart-area-stacked.js +4 -4
  66. package/dist/components/chart-axis.d.ts +14 -1
  67. package/dist/components/chart-axis.d.ts.map +1 -1
  68. package/dist/components/chart-axis.js +11 -1
  69. package/dist/components/chart-bar-horizontal.d.ts +2 -2
  70. package/dist/components/chart-bar-horizontal.d.ts.map +1 -1
  71. package/dist/components/chart-bar-horizontal.js +14 -5
  72. package/dist/components/chart-bar-multiple.d.ts +1 -1
  73. package/dist/components/chart-bar-multiple.d.ts.map +1 -1
  74. package/dist/components/chart-bar-multiple.js +3 -3
  75. package/dist/components/chart-bar-stacked.d.ts +1 -1
  76. package/dist/components/chart-bar-stacked.d.ts.map +1 -1
  77. package/dist/components/chart-bar-stacked.js +3 -3
  78. package/dist/components/chart-card.d.ts +17 -6
  79. package/dist/components/chart-card.d.ts.map +1 -1
  80. package/dist/components/chart-card.js +11 -4
  81. package/dist/components/chart-date-range-control.d.ts +18 -9
  82. package/dist/components/chart-date-range-control.d.ts.map +1 -1
  83. package/dist/components/chart-date-range-control.js +43 -47
  84. package/dist/components/chart-sparkline.d.ts +4 -3
  85. package/dist/components/chart-sparkline.d.ts.map +1 -1
  86. package/dist/components/chart-sparkline.js +6 -5
  87. package/dist/components/check-counts.d.ts +44 -0
  88. package/dist/components/check-counts.d.ts.map +1 -0
  89. package/dist/components/check-counts.js +51 -0
  90. package/dist/components/checkbox.d.ts +39 -11
  91. package/dist/components/checkbox.d.ts.map +1 -1
  92. package/dist/components/checkbox.js +38 -11
  93. package/dist/components/choicebox.d.ts +96 -0
  94. package/dist/components/choicebox.d.ts.map +1 -0
  95. package/dist/components/choicebox.js +113 -0
  96. package/dist/components/clearable-input.d.ts +57 -0
  97. package/dist/components/clearable-input.d.ts.map +1 -0
  98. package/dist/components/clearable-input.js +58 -0
  99. package/dist/components/code-block.d.ts +77 -17
  100. package/dist/components/code-block.d.ts.map +1 -1
  101. package/dist/components/code-block.js +85 -15
  102. package/dist/components/collapsible.d.ts +27 -10
  103. package/dist/components/collapsible.d.ts.map +1 -1
  104. package/dist/components/collapsible.js +24 -9
  105. package/dist/components/collection-filters.d.ts +3 -1
  106. package/dist/components/collection-filters.d.ts.map +1 -1
  107. package/dist/components/collection-filters.js +7 -9
  108. package/dist/components/collection-page.d.ts +31 -10
  109. package/dist/components/collection-page.d.ts.map +1 -1
  110. package/dist/components/collection-page.js +14 -13
  111. package/dist/components/collection-search.d.ts +32 -10
  112. package/dist/components/collection-search.d.ts.map +1 -1
  113. package/dist/components/collection-search.js +24 -13
  114. package/dist/components/collection-sort.d.ts.map +1 -1
  115. package/dist/components/collection-sort.js +2 -2
  116. package/dist/components/collection-toolbar.d.ts +5 -2
  117. package/dist/components/collection-toolbar.d.ts.map +1 -1
  118. package/dist/components/collection-toolbar.js +7 -4
  119. package/dist/components/combobox.d.ts +97 -22
  120. package/dist/components/combobox.d.ts.map +1 -1
  121. package/dist/components/combobox.js +80 -28
  122. package/dist/components/command.d.ts +34 -21
  123. package/dist/components/command.d.ts.map +1 -1
  124. package/dist/components/command.js +33 -25
  125. package/dist/components/confirm-dialog.d.ts +23 -6
  126. package/dist/components/confirm-dialog.d.ts.map +1 -1
  127. package/dist/components/confirm-dialog.js +32 -13
  128. package/dist/components/context-menu.d.ts +14 -10
  129. package/dist/components/context-menu.d.ts.map +1 -1
  130. package/dist/components/context-menu.js +17 -12
  131. package/dist/components/copy-button.d.ts +5 -2
  132. package/dist/components/copy-button.d.ts.map +1 -1
  133. package/dist/components/copy-button.js +16 -8
  134. package/dist/components/data-table.d.ts +120 -54
  135. package/dist/components/data-table.d.ts.map +1 -1
  136. package/dist/components/data-table.js +163 -92
  137. package/dist/components/desktop-shell.d.ts +4 -2
  138. package/dist/components/desktop-shell.d.ts.map +1 -1
  139. package/dist/components/desktop-shell.js +3 -3
  140. package/dist/components/dialog.d.ts +63 -24
  141. package/dist/components/dialog.d.ts.map +1 -1
  142. package/dist/components/dialog.js +52 -31
  143. package/dist/components/disclosure-row.d.ts +1 -2
  144. package/dist/components/disclosure-row.d.ts.map +1 -1
  145. package/dist/components/disclosure-row.js +1 -2
  146. package/dist/components/disclosure.d.ts +1 -1
  147. package/dist/components/disclosure.js +1 -1
  148. package/dist/components/drawer.d.ts +33 -12
  149. package/dist/components/drawer.d.ts.map +1 -1
  150. package/dist/components/drawer.js +47 -35
  151. package/dist/components/dropdown-menu.d.ts +59 -14
  152. package/dist/components/dropdown-menu.d.ts.map +1 -1
  153. package/dist/components/dropdown-menu.js +58 -26
  154. package/dist/components/empty-state.d.ts +35 -12
  155. package/dist/components/empty-state.d.ts.map +1 -1
  156. package/dist/components/empty-state.js +35 -17
  157. package/dist/components/entry-scene.d.ts +4 -4
  158. package/dist/components/entry-scene.d.ts.map +1 -1
  159. package/dist/components/entry-scene.js +2 -2
  160. package/dist/components/field.d.ts +44 -14
  161. package/dist/components/field.d.ts.map +1 -1
  162. package/dist/components/field.js +49 -20
  163. package/dist/components/file-diff.d.ts.map +1 -1
  164. package/dist/components/file-diff.js +3 -4
  165. package/dist/components/form-dialog.d.ts +7 -7
  166. package/dist/components/form-dialog.d.ts.map +1 -1
  167. package/dist/components/form-dialog.js +13 -11
  168. package/dist/components/form-drawer.d.ts +10 -7
  169. package/dist/components/form-drawer.d.ts.map +1 -1
  170. package/dist/components/form-drawer.js +11 -10
  171. package/dist/components/gauge.d.ts +64 -0
  172. package/dist/components/gauge.d.ts.map +1 -0
  173. package/dist/components/gauge.js +73 -0
  174. package/dist/components/hover-card.d.ts +72 -14
  175. package/dist/components/hover-card.d.ts.map +1 -1
  176. package/dist/components/hover-card.js +51 -17
  177. package/dist/components/identity-mark.d.ts +8 -1
  178. package/dist/components/identity-mark.d.ts.map +1 -1
  179. package/dist/components/identity-mark.js +31 -5
  180. package/dist/components/input-group.d.ts +44 -21
  181. package/dist/components/input-group.d.ts.map +1 -1
  182. package/dist/components/input-group.js +74 -27
  183. package/dist/components/input.d.ts +64 -12
  184. package/dist/components/input.d.ts.map +1 -1
  185. package/dist/components/input.js +51 -15
  186. package/dist/components/item.d.ts +37 -15
  187. package/dist/components/item.d.ts.map +1 -1
  188. package/dist/components/item.js +41 -22
  189. package/dist/components/kbd.d.ts +49 -13
  190. package/dist/components/kbd.d.ts.map +1 -1
  191. package/dist/components/kbd.js +115 -16
  192. package/dist/components/kpi-card.d.ts +12 -4
  193. package/dist/components/kpi-card.d.ts.map +1 -1
  194. package/dist/components/kpi-card.js +13 -4
  195. package/dist/components/label.d.ts +17 -10
  196. package/dist/components/label.d.ts.map +1 -1
  197. package/dist/components/label.js +18 -11
  198. package/dist/components/library-shelf.d.ts +6 -6
  199. package/dist/components/library-shelf.d.ts.map +1 -1
  200. package/dist/components/library-shelf.js +5 -5
  201. package/dist/components/load-more-button.d.ts +35 -0
  202. package/dist/components/load-more-button.d.ts.map +1 -0
  203. package/dist/components/load-more-button.js +26 -0
  204. package/dist/components/menu-choice-row.d.ts +6 -8
  205. package/dist/components/menu-choice-row.d.ts.map +1 -1
  206. package/dist/components/menu-choice-row.js +8 -8
  207. package/dist/components/message-notice.d.ts +8 -13
  208. package/dist/components/message-notice.d.ts.map +1 -1
  209. package/dist/components/message-notice.js +25 -22
  210. package/dist/components/middle-truncate.d.ts +33 -0
  211. package/dist/components/middle-truncate.d.ts.map +1 -0
  212. package/dist/components/middle-truncate.js +72 -0
  213. package/dist/components/multi-select.d.ts +94 -0
  214. package/dist/components/multi-select.d.ts.map +1 -0
  215. package/dist/components/multi-select.js +132 -0
  216. package/dist/components/native-select.d.ts +37 -13
  217. package/dist/components/native-select.d.ts.map +1 -1
  218. package/dist/components/native-select.js +27 -11
  219. package/dist/components/notice-banner.d.ts +17 -10
  220. package/dist/components/notice-banner.d.ts.map +1 -1
  221. package/dist/components/notice-banner.js +12 -11
  222. package/dist/components/numbered-steps.d.ts +10 -4
  223. package/dist/components/numbered-steps.d.ts.map +1 -1
  224. package/dist/components/numbered-steps.js +9 -7
  225. package/dist/components/object-page.d.ts +40 -14
  226. package/dist/components/object-page.d.ts.map +1 -1
  227. package/dist/components/object-page.js +12 -10
  228. package/dist/components/object-workspace.d.ts +29 -10
  229. package/dist/components/object-workspace.d.ts.map +1 -1
  230. package/dist/components/object-workspace.js +18 -8
  231. package/dist/components/overview-page.d.ts +2 -2
  232. package/dist/components/overview-page.d.ts.map +1 -1
  233. package/dist/components/overview-page.js +8 -7
  234. package/dist/components/page-actions.d.ts +28 -8
  235. package/dist/components/page-actions.d.ts.map +1 -1
  236. package/dist/components/page-actions.js +22 -25
  237. package/dist/components/page-header.d.ts +11 -4
  238. package/dist/components/page-header.d.ts.map +1 -1
  239. package/dist/components/page-header.js +10 -5
  240. package/dist/components/pending-label.d.ts +6 -5
  241. package/dist/components/pending-label.d.ts.map +1 -1
  242. package/dist/components/pending-label.js +14 -6
  243. package/dist/components/picture-label.d.ts +2 -2
  244. package/dist/components/picture-label.d.ts.map +1 -1
  245. package/dist/components/picture-label.js +3 -3
  246. package/dist/components/portal-sidebar-frame.d.ts +9 -21
  247. package/dist/components/portal-sidebar-frame.d.ts.map +1 -1
  248. package/dist/components/portal-sidebar-frame.js +13 -27
  249. package/dist/components/progress-checklist.d.ts +46 -0
  250. package/dist/components/progress-checklist.d.ts.map +1 -0
  251. package/dist/components/progress-checklist.js +46 -0
  252. package/dist/components/progress.d.ts +48 -8
  253. package/dist/components/progress.d.ts.map +1 -1
  254. package/dist/components/progress.js +92 -16
  255. package/dist/components/prose.d.ts +19 -0
  256. package/dist/components/prose.d.ts.map +1 -0
  257. package/dist/components/prose.js +29 -0
  258. package/dist/components/radio-group.d.ts +51 -12
  259. package/dist/components/radio-group.d.ts.map +1 -1
  260. package/dist/components/radio-group.js +42 -12
  261. package/dist/components/reading-column.js +1 -1
  262. package/dist/components/record-identity.d.ts +6 -5
  263. package/dist/components/record-identity.d.ts.map +1 -1
  264. package/dist/components/record-identity.js +12 -3
  265. package/dist/components/record-list.d.ts +117 -27
  266. package/dist/components/record-list.d.ts.map +1 -1
  267. package/dist/components/record-list.js +185 -55
  268. package/dist/components/record-time.d.ts +20 -7
  269. package/dist/components/record-time.d.ts.map +1 -1
  270. package/dist/components/record-time.js +38 -19
  271. package/dist/components/resizable.d.ts +7 -5
  272. package/dist/components/resizable.d.ts.map +1 -1
  273. package/dist/components/resizable.js +6 -6
  274. package/dist/components/scope-switcher.d.ts +2 -0
  275. package/dist/components/scope-switcher.d.ts.map +1 -1
  276. package/dist/components/scope-switcher.js +2 -2
  277. package/dist/components/scroll-area.d.ts +47 -11
  278. package/dist/components/scroll-area.d.ts.map +1 -1
  279. package/dist/components/scroll-area.js +72 -14
  280. package/dist/components/segmented-control.d.ts +82 -0
  281. package/dist/components/segmented-control.d.ts.map +1 -0
  282. package/dist/components/segmented-control.js +90 -0
  283. package/dist/components/select.d.ts +55 -15
  284. package/dist/components/select.d.ts.map +1 -1
  285. package/dist/components/select.js +62 -19
  286. package/dist/components/separator.d.ts +12 -5
  287. package/dist/components/separator.d.ts.map +1 -1
  288. package/dist/components/separator.js +11 -6
  289. package/dist/components/settings-facts.d.ts +34 -14
  290. package/dist/components/settings-facts.d.ts.map +1 -1
  291. package/dist/components/settings-facts.js +21 -12
  292. package/dist/components/settings-page.d.ts +4 -4
  293. package/dist/components/settings-page.js +5 -5
  294. package/dist/components/settings-section.d.ts +160 -34
  295. package/dist/components/settings-section.d.ts.map +1 -1
  296. package/dist/components/settings-section.js +92 -39
  297. package/dist/components/sheet.d.ts +47 -16
  298. package/dist/components/sheet.d.ts.map +1 -1
  299. package/dist/components/sheet.js +40 -19
  300. package/dist/components/sidebar-sections.d.ts +16 -12
  301. package/dist/components/sidebar-sections.d.ts.map +1 -1
  302. package/dist/components/sidebar-sections.js +30 -15
  303. package/dist/components/sidebar.d.ts +117 -21
  304. package/dist/components/sidebar.d.ts.map +1 -1
  305. package/dist/components/sidebar.js +180 -55
  306. package/dist/components/skeleton.d.ts +54 -8
  307. package/dist/components/skeleton.d.ts.map +1 -1
  308. package/dist/components/skeleton.js +44 -9
  309. package/dist/components/slider.d.ts +53 -11
  310. package/dist/components/slider.d.ts.map +1 -1
  311. package/dist/components/slider.js +71 -17
  312. package/dist/components/snippet.d.ts +57 -0
  313. package/dist/components/snippet.d.ts.map +1 -0
  314. package/dist/components/snippet.js +60 -0
  315. package/dist/components/sonner.d.ts +13 -14
  316. package/dist/components/sonner.d.ts.map +1 -1
  317. package/dist/components/sonner.js +25 -22
  318. package/dist/components/status-badge.d.ts +37 -11
  319. package/dist/components/status-badge.d.ts.map +1 -1
  320. package/dist/components/status-badge.js +63 -15
  321. package/dist/components/status-dot.d.ts +42 -11
  322. package/dist/components/status-dot.d.ts.map +1 -1
  323. package/dist/components/status-dot.js +40 -11
  324. package/dist/components/switch.d.ts +43 -12
  325. package/dist/components/switch.d.ts.map +1 -1
  326. package/dist/components/switch.js +42 -12
  327. package/dist/components/table-card.d.ts +21 -12
  328. package/dist/components/table-card.d.ts.map +1 -1
  329. package/dist/components/table-card.js +17 -9
  330. package/dist/components/table-layouts.d.ts +40 -8
  331. package/dist/components/table-layouts.d.ts.map +1 -1
  332. package/dist/components/table-layouts.js +52 -8
  333. package/dist/components/table-value.d.ts +4 -3
  334. package/dist/components/table-value.d.ts.map +1 -1
  335. package/dist/components/table-value.js +6 -5
  336. package/dist/components/table.d.ts +62 -25
  337. package/dist/components/table.d.ts.map +1 -1
  338. package/dist/components/table.js +62 -26
  339. package/dist/components/tabs.d.ts +86 -17
  340. package/dist/components/tabs.d.ts.map +1 -1
  341. package/dist/components/tabs.js +93 -22
  342. package/dist/components/text-link.d.ts +4 -1
  343. package/dist/components/text-link.d.ts.map +1 -1
  344. package/dist/components/text-link.js +4 -1
  345. package/dist/components/text-with-copy-button.d.ts +30 -0
  346. package/dist/components/text-with-copy-button.d.ts.map +1 -0
  347. package/dist/components/text-with-copy-button.js +32 -0
  348. package/dist/components/textarea.d.ts +40 -10
  349. package/dist/components/textarea.d.ts.map +1 -1
  350. package/dist/components/textarea.js +50 -11
  351. package/dist/components/theme-mode-switcher.d.ts +20 -3
  352. package/dist/components/theme-mode-switcher.d.ts.map +1 -1
  353. package/dist/components/theme-mode-switcher.js +23 -6
  354. package/dist/components/toggle-group.d.ts +28 -8
  355. package/dist/components/toggle-group.d.ts.map +1 -1
  356. package/dist/components/toggle-group.js +12 -6
  357. package/dist/components/toggle.d.ts +6 -3
  358. package/dist/components/toggle.d.ts.map +1 -1
  359. package/dist/components/toggle.js +10 -7
  360. package/dist/components/tooltip.d.ts +43 -12
  361. package/dist/components/tooltip.d.ts.map +1 -1
  362. package/dist/components/tooltip.js +45 -16
  363. package/dist/components/trend-badge.js +1 -1
  364. package/dist/components/update-card.js +1 -1
  365. package/dist/eslint/index.js +82 -0
  366. package/dist/eslint/rules/badge-is-static-label.js +93 -0
  367. package/dist/eslint/rules/button-icon-slot.js +102 -0
  368. package/dist/eslint/rules/button-link-for-navigation.js +146 -0
  369. package/dist/eslint/rules/button-no-aria-label-with-text.js +75 -0
  370. package/dist/eslint/rules/button-type-roles-only-in-buttons.js +83 -0
  371. package/dist/eslint/rules/choice-control-has-a-name.js +98 -0
  372. package/dist/eslint/rules/choice-group-in-fieldset.js +86 -0
  373. package/dist/eslint/rules/command-shortcut-single-owner.js +118 -0
  374. package/dist/eslint/rules/confirm-dialog-words.js +63 -0
  375. package/dist/eslint/rules/data-table-one-unsized-column.js +96 -0
  376. package/dist/eslint/rules/destructive-action-placement.js +69 -0
  377. package/dist/eslint/rules/disabled-choice-says-why.js +71 -0
  378. package/dist/eslint/rules/ellipsis-opens-a-dialog.js +110 -0
  379. package/dist/eslint/rules/input-group-owners.js +155 -0
  380. package/dist/eslint/rules/kbd-children-no-modifier-text.js +128 -0
  381. package/dist/eslint/rules/literal-text.js +41 -0
  382. package/dist/eslint/rules/middle-truncate-placement.js +69 -0
  383. package/dist/eslint/rules/no-bare-button-label.js +55 -0
  384. package/dist/eslint/rules/no-control-in-read-only-surface.js +106 -0
  385. package/dist/eslint/rules/no-hand-built-busy.js +104 -0
  386. package/dist/eslint/rules/no-hand-built-theme-picker.js +144 -0
  387. package/dist/eslint/rules/no-hand-built-tile.js +41 -0
  388. package/dist/eslint/rules/no-hand-formatted-date.js +87 -0
  389. package/dist/eslint/rules/no-hand-stacked-avatars.js +67 -0
  390. package/dist/eslint/rules/no-nested-collapse.js +60 -0
  391. package/dist/eslint/rules/no-search-in-form.js +47 -0
  392. package/dist/eslint/rules/no-shadcn-appearance-override.js +2 -16
  393. package/dist/eslint/rules/no-shell-prompt-in-snippet.js +74 -0
  394. package/dist/eslint/rules/no-stock-error-words.js +56 -0
  395. package/dist/eslint/rules/no-tooltip-around-labelled-field.js +72 -0
  396. package/dist/eslint/rules/no-weight-class-on-strong-in-type-role.js +57 -0
  397. package/dist/eslint/rules/one-submenu-level.js +43 -0
  398. package/dist/eslint/rules/one-toast-per-flow.js +91 -0
  399. package/dist/eslint/rules/option-count.js +167 -0
  400. package/dist/eslint/rules/page-command-link-not-render.js +43 -0
  401. package/dist/eslint/rules/progress-needs-name.js +57 -0
  402. package/dist/eslint/rules/settings-limit-in-footer.js +94 -0
  403. package/dist/eslint/rules/skeleton-in-region.js +80 -0
  404. package/dist/eslint/rules/sortable-heading-uses-sort.js +79 -0
  405. package/dist/eslint/rules/table-cell-inset-owner.js +107 -0
  406. package/dist/eslint/rules/tabs-selection-is-controlled.js +47 -0
  407. package/dist/eslint/rules/tooltip-only-arrow.js +38 -0
  408. package/dist/eslint/rules/tooltip-trigger-accessible-name.js +114 -0
  409. package/dist/eslint/strict-design-system.js +21 -7
  410. package/dist/index.d.ts +13 -13
  411. package/dist/index.d.ts.map +1 -1
  412. package/dist/index.js +12 -13
  413. package/dist/internal/assistant-ui/attachment.d.ts.map +1 -1
  414. package/dist/internal/assistant-ui/attachment.js +2 -2
  415. package/dist/internal/assistant-ui/reasoning.d.ts +1 -1
  416. package/dist/internal/assistant-ui/reasoning.d.ts.map +1 -1
  417. package/dist/internal/assistant-ui/tool-fallback.js +1 -1
  418. package/dist/internal/assistant-ui/tool-group.d.ts +1 -1
  419. package/dist/internal/assistant-ui/tool-group.d.ts.map +1 -1
  420. package/dist/internal/assistant-ui/tooltip-icon-button.d.ts +2 -3
  421. package/dist/internal/assistant-ui/tooltip-icon-button.d.ts.map +1 -1
  422. package/dist/internal/assistant-ui/tooltip-icon-button.js +1 -1
  423. package/dist/internal/catalog-list.js +2 -2
  424. package/dist/internal/collection-note.d.ts +23 -0
  425. package/dist/internal/collection-note.d.ts.map +1 -0
  426. package/dist/internal/collection-note.js +17 -0
  427. package/dist/internal/collection-rail.d.ts +57 -0
  428. package/dist/internal/collection-rail.d.ts.map +1 -0
  429. package/dist/internal/collection-rail.js +33 -0
  430. package/dist/internal/company-logo.d.ts +18 -0
  431. package/dist/internal/company-logo.d.ts.map +1 -0
  432. package/dist/internal/company-logo.js +14 -0
  433. package/dist/internal/control-name.d.ts +12 -0
  434. package/dist/internal/control-name.d.ts.map +1 -0
  435. package/dist/internal/control-name.js +1 -0
  436. package/dist/internal/diff-line.d.ts +9 -0
  437. package/dist/internal/diff-line.d.ts.map +1 -0
  438. package/dist/internal/diff-line.js +8 -0
  439. package/dist/internal/empty.d.ts +8 -4
  440. package/dist/internal/empty.d.ts.map +1 -1
  441. package/dist/internal/empty.js +14 -8
  442. package/dist/internal/field-frame.d.ts +33 -0
  443. package/dist/internal/field-frame.d.ts.map +1 -0
  444. package/dist/internal/field-frame.js +20 -0
  445. package/dist/internal/final-focus.d.ts +8 -0
  446. package/dist/internal/final-focus.d.ts.map +1 -0
  447. package/dist/internal/final-focus.js +10 -0
  448. package/dist/internal/footer-strip.d.ts.map +1 -1
  449. package/dist/internal/footer-strip.js +3 -1
  450. package/dist/internal/form-submit.d.ts +9 -5
  451. package/dist/internal/form-submit.d.ts.map +1 -1
  452. package/dist/internal/form-submit.js +31 -2
  453. package/dist/internal/input-box.d.ts +26 -0
  454. package/dist/internal/input-box.d.ts.map +1 -0
  455. package/dist/internal/input-box.js +59 -0
  456. package/dist/internal/menu-surface.d.ts +10 -3
  457. package/dist/internal/menu-surface.d.ts.map +1 -1
  458. package/dist/internal/menu-surface.js +10 -3
  459. package/dist/internal/notice.d.ts +25 -0
  460. package/dist/internal/notice.d.ts.map +1 -0
  461. package/dist/internal/notice.js +33 -0
  462. package/dist/internal/overlay-stem.d.ts +5 -0
  463. package/dist/internal/overlay-stem.d.ts.map +1 -0
  464. package/dist/internal/overlay-stem.js +7 -0
  465. package/dist/internal/phone-sheet.d.ts +4 -0
  466. package/dist/internal/phone-sheet.d.ts.map +1 -0
  467. package/dist/internal/phone-sheet.js +2 -0
  468. package/dist/internal/present-content.d.ts +3 -0
  469. package/dist/internal/present-content.d.ts.map +1 -0
  470. package/dist/internal/present-content.js +1 -0
  471. package/dist/internal/record-menu-items.d.ts +4 -3
  472. package/dist/internal/record-menu-items.d.ts.map +1 -1
  473. package/dist/internal/record-menu-items.js +21 -6
  474. package/dist/internal/settings-save.d.ts +9 -2
  475. package/dist/internal/settings-save.d.ts.map +1 -1
  476. package/dist/internal/settings-save.js +9 -6
  477. package/dist/internal/table-compact-line.d.ts +38 -0
  478. package/dist/internal/table-compact-line.d.ts.map +1 -0
  479. package/dist/internal/table-compact-line.js +35 -0
  480. package/dist/internal/title-when-cut.d.ts +8 -0
  481. package/dist/internal/title-when-cut.d.ts.map +1 -0
  482. package/dist/internal/title-when-cut.js +22 -0
  483. package/dist/internal/unsaved-guard.d.ts +18 -0
  484. package/dist/internal/unsaved-guard.d.ts.map +1 -0
  485. package/dist/internal/unsaved-guard.js +31 -0
  486. package/dist/lib/merge-tokens.generated.js +2 -2
  487. package/dist/showcase/foundations.d.ts.map +1 -1
  488. package/dist/showcase/foundations.js +10 -2
  489. package/dist/showcase/specimens/actions.d.ts +2 -0
  490. package/dist/showcase/specimens/actions.d.ts.map +1 -1
  491. package/dist/showcase/specimens/actions.js +30 -5
  492. package/dist/showcase/specimens/charts.d.ts.map +1 -1
  493. package/dist/showcase/specimens/charts.js +22 -13
  494. package/dist/showcase/specimens/choices.d.ts +14 -3
  495. package/dist/showcase/specimens/choices.d.ts.map +1 -1
  496. package/dist/showcase/specimens/choices.js +93 -13
  497. package/dist/showcase/specimens/compositions.d.ts.map +1 -1
  498. package/dist/showcase/specimens/compositions.js +136 -23
  499. package/dist/showcase/specimens/data.d.ts +12 -7
  500. package/dist/showcase/specimens/data.d.ts.map +1 -1
  501. package/dist/showcase/specimens/data.js +139 -35
  502. package/dist/showcase/specimens/feedback.d.ts +2 -0
  503. package/dist/showcase/specimens/feedback.d.ts.map +1 -1
  504. package/dist/showcase/specimens/feedback.js +39 -15
  505. package/dist/showcase/specimens/index.d.ts +20 -12
  506. package/dist/showcase/specimens/index.d.ts.map +1 -1
  507. package/dist/showcase/specimens/inputs.d.ts +4 -2
  508. package/dist/showcase/specimens/inputs.d.ts.map +1 -1
  509. package/dist/showcase/specimens/inputs.js +62 -19
  510. package/dist/showcase/specimens/menus.d.ts +0 -1
  511. package/dist/showcase/specimens/menus.d.ts.map +1 -1
  512. package/dist/showcase/specimens/menus.js +47 -18
  513. package/dist/showcase/specimens/navigation.d.ts +6 -4
  514. package/dist/showcase/specimens/navigation.d.ts.map +1 -1
  515. package/dist/showcase/specimens/navigation.js +61 -32
  516. package/dist/showcase/specimens/other.d.ts +1 -3
  517. package/dist/showcase/specimens/other.d.ts.map +1 -1
  518. package/dist/showcase/specimens/other.js +17 -13
  519. package/dist/showcase/specimens/status.d.ts +4 -1
  520. package/dist/showcase/specimens/status.d.ts.map +1 -1
  521. package/dist/showcase/specimens/status.js +64 -11
  522. package/dist/showcase/usage.generated.d.ts +1 -1
  523. package/dist/showcase/usage.generated.d.ts.map +1 -1
  524. package/dist/showcase/usage.generated.js +637 -549
  525. package/dist/standalone/index.js +1 -1
  526. package/dist/styles/components.css +13 -13
  527. package/dist/styles/globals.css +25 -0
  528. package/package.json +2 -3
  529. package/dist/components/approval-row.d.ts +0 -34
  530. package/dist/components/approval-row.d.ts.map +0 -1
  531. package/dist/components/approval-row.js +0 -27
  532. package/dist/components/channel-view.d.ts +0 -112
  533. package/dist/components/channel-view.d.ts.map +0 -1
  534. package/dist/components/channel-view.js +0 -84
  535. package/dist/components/dashboard-shell.d.ts +0 -51
  536. package/dist/components/dashboard-shell.d.ts.map +0 -1
  537. package/dist/components/dashboard-shell.js +0 -89
  538. package/dist/components/direction.d.ts +0 -2
  539. package/dist/components/direction.d.ts.map +0 -1
  540. package/dist/components/direction.js +0 -1
  541. package/dist/components/expandable-block.d.ts +0 -20
  542. package/dist/components/expandable-block.d.ts.map +0 -1
  543. package/dist/components/expandable-block.js +0 -32
  544. package/dist/components/form.d.ts +0 -42
  545. package/dist/components/form.d.ts.map +0 -1
  546. package/dist/components/form.js +0 -91
  547. package/dist/components/label-system.d.ts +0 -17
  548. package/dist/components/label-system.d.ts.map +0 -1
  549. package/dist/components/label-system.js +0 -21
  550. package/dist/components/memory-item.d.ts +0 -21
  551. package/dist/components/memory-item.d.ts.map +0 -1
  552. package/dist/components/memory-item.js +0 -18
  553. package/dist/components/menubar.d.ts +0 -43
  554. package/dist/components/menubar.d.ts.map +0 -1
  555. package/dist/components/menubar.js +0 -69
  556. package/dist/components/navigation-menu.d.ts +0 -26
  557. package/dist/components/navigation-menu.d.ts.map +0 -1
  558. package/dist/components/navigation-menu.js +0 -45
  559. package/dist/components/pagination.d.ts +0 -33
  560. package/dist/components/pagination.d.ts.map +0 -1
  561. package/dist/components/pagination.js +0 -41
  562. package/dist/components/plugin-slot-boundary.d.ts +0 -42
  563. package/dist/components/plugin-slot-boundary.d.ts.map +0 -1
  564. package/dist/components/plugin-slot-boundary.js +0 -41
  565. package/dist/components/status-row.d.ts +0 -32
  566. package/dist/components/status-row.d.ts.map +0 -1
  567. package/dist/components/status-row.js +0 -35
@@ -1,8 +1,37 @@
1
1
  "use client";
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  import { Button } from "../components/button.js";
4
- import { PendingLabel } from "../components/pending-label.js";
4
+ const TRIMMED_INPUT_TYPES = new Set(["text", "email", "url", "search", "tel"]);
5
+ function isTextField(field) {
6
+ return (field instanceof HTMLTextAreaElement ||
7
+ (field instanceof HTMLInputElement && TRIMMED_INPUT_TYPES.has(field.type)));
8
+ }
9
+ function replaceValue(field, value) {
10
+ const prototype = field instanceof HTMLTextAreaElement
11
+ ? HTMLTextAreaElement.prototype
12
+ : HTMLInputElement.prototype;
13
+ Object.getOwnPropertyDescriptor(prototype, "value")?.set?.call(field, value);
14
+ field.dispatchEvent(new Event("input", { bubbles: true }));
15
+ }
16
+ /**
17
+ * "Trim leading and trailing whitespace before submit so ` example.com` and `example.com` resolve
18
+ * to one value." (https://vercel.com/geist/input) "Trim leading and trailing whitespace on submit
19
+ * so empty newlines don’t pass a `required` check." (https://vercel.com/geist/textarea) Ours: a
20
+ * controlled field is told through its own `input` event; passwords and other types keep every
21
+ * character.
22
+ */
23
+ function trimTextFields(form) {
24
+ if (!form)
25
+ return;
26
+ for (const field of form.elements) {
27
+ if (!isTextField(field) || field.readOnly || field.disabled)
28
+ continue;
29
+ const trimmed = field.value.trim();
30
+ if (trimmed !== field.value)
31
+ replaceValue(field, trimmed);
32
+ }
33
+ }
5
34
  export function FormSubmitButton({ submit }) {
6
35
  const pending = submit.pending === true;
7
- return (_jsx(Button, { "aria-busy": pending || undefined, "aria-describedby": submit.describedBy, disabled: pending || submit.disabled, type: "submit", children: _jsx(PendingLabel, { pending: pending, pendingLabel: submit.pendingLabel ?? submit.label, children: submit.label }) }));
36
+ return (_jsx(Button, { "aria-describedby": submit.describedBy, disabled: submit.disabled, loading: pending, loadingLabel: submit.pendingLabel ?? submit.label, onClick: (event) => trimTextFields(event.currentTarget.form), type: "submit", children: submit.label }));
8
37
  }
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ export type FieldSize = "sm" | "default" | "lg";
3
+ /**
4
+ * The edge of every field-shaped box: a 1px ring drawn outside the box with a shadow, so the box
5
+ * keeps its size, and a 4px halo that is clear until focus or an error fills it. The states below
6
+ * only move the two colours.
7
+ */
8
+ export declare const fieldRing = "[--field-edge:var(--color-border)] [--field-halo:transparent] shadow-[0_0_0_1px_var(--field-edge),0_0_0_4px_var(--field-halo)] transition-shadow";
9
+ /** The states of a box that is itself the control: an input, a textarea, a select, a trigger. */
10
+ export declare const fieldStates: string;
11
+ /** A trigger whose list is open keeps the hover edge. */
12
+ export declare const fieldOpen = "data-popup-open:not-aria-invalid:[--field-edge:color-mix(in_oklab,var(--color-ring)_70%,transparent)]";
13
+ /** A trigger that keeps the page's outline for keyboard focus, as a button does: no halo. */
14
+ export declare const fieldTriggerStates: string;
15
+ /** The same states for a box that holds the control, so the ring wraps its prefix and suffix. */
16
+ export declare const fieldGroupStates: string;
17
+ /** The same states for a box of chips, whose ring wraps the chips and the input among them. */
18
+ export declare const fieldWithinStates: string;
19
+ /** A disabled box steps down in fill and text, never in opacity. */
20
+ export declare const fieldDisabled = "disabled:cursor-not-allowed disabled:bg-accent disabled:text-placeholder";
21
+ export type InputBoxProps = Omit<React.ComponentProps<"input">, "size"> & {
22
+ size?: FieldSize;
23
+ };
24
+ /** The bare box of `Input` and `InputGroupControl`, so the group can wrap it without a cycle. */
25
+ export declare function InputBox({ className, size, type, ...props }: InputBoxProps): React.JSX.Element;
26
+ //# sourceMappingURL=input-box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-box.d.ts","sourceRoot":"","sources":["../../src/internal/input-box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,MAAM,MAAM,SAAS,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,SAAS,qJAC8H,CAAC;AAErJ,iGAAiG;AACjG,eAAO,MAAM,WAAW,QAIb,CAAC;AAEZ,yDAAyD;AACzD,eAAO,MAAM,SAAS,0GACmF,CAAC;AAE1G,6FAA6F;AAC7F,eAAO,MAAM,kBAAkB,QAIpB,CAAC;AAEZ,iGAAiG;AACjG,eAAO,MAAM,gBAAgB,QAKlB,CAAC;AAEZ,+FAA+F;AAC/F,eAAO,MAAM,iBAAiB,QAKnB,CAAC;AAEZ,oEAAoE;AACpE,eAAO,MAAM,aAAa,6EACkD,CAAC;AAqB7E,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,GAAG;IACxE,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB,CAAC;AAEF,iGAAiG;AACjG,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,IAAgB,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,qBAWtF"}
@@ -0,0 +1,59 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Input as InputPrimitive } from "@base-ui/react/input";
3
+ import { cva } from "class-variance-authority";
4
+ import { cn } from "../lib/utils.js";
5
+ /**
6
+ * The edge of every field-shaped box: a 1px ring drawn outside the box with a shadow, so the box
7
+ * keeps its size, and a 4px halo that is clear until focus or an error fills it. The states below
8
+ * only move the two colours.
9
+ */
10
+ export const fieldRing = "[--field-edge:var(--color-border)] [--field-halo:transparent] shadow-[0_0_0_1px_var(--field-edge),0_0_0_4px_var(--field-halo)] transition-shadow";
11
+ /** The states of a box that is itself the control: an input, a textarea, a select, a trigger. */
12
+ export const fieldStates = [
13
+ "enabled:not-focus-visible:not-aria-invalid:hover:[--field-edge:color-mix(in_oklab,var(--color-ring)_70%,transparent)]",
14
+ "focus-visible:outline-none focus-visible:[--field-edge:var(--color-ring)] focus-visible:[--field-halo:color-mix(in_oklab,var(--color-ring)_16%,transparent)]",
15
+ "aria-invalid:outline-none aria-invalid:[--field-edge:var(--color-destructive)] aria-invalid:[--field-halo:var(--nc-rosso-300)] aria-invalid:enabled:not-focus-visible:hover:[--field-halo:var(--nc-rosso-500)]",
16
+ ].join(" ");
17
+ /** A trigger whose list is open keeps the hover edge. */
18
+ export const fieldOpen = "data-popup-open:not-aria-invalid:[--field-edge:color-mix(in_oklab,var(--color-ring)_70%,transparent)]";
19
+ /** A trigger that keeps the page's outline for keyboard focus, as a button does: no halo. */
20
+ export const fieldTriggerStates = [
21
+ "enabled:not-aria-invalid:hover:[--field-edge:color-mix(in_oklab,var(--color-ring)_70%,transparent)]",
22
+ fieldOpen,
23
+ "aria-invalid:outline-none aria-invalid:[--field-edge:var(--color-destructive)] aria-invalid:[--field-halo:var(--nc-rosso-300)] aria-invalid:enabled:hover:[--field-halo:var(--nc-rosso-500)]",
24
+ ].join(" ");
25
+ /** The same states for a box that holds the control, so the ring wraps its prefix and suffix. */
26
+ export const fieldGroupStates = [
27
+ "not-has-[[data-slot=input-group-control]:disabled]:not-has-[[data-slot=input-group-control]:focus-visible]:not-has-[[data-slot][aria-invalid=true]]:hover:[--field-edge:color-mix(in_oklab,var(--color-ring)_70%,transparent)]",
28
+ "has-[[data-slot=input-group-control]:focus-visible]:[--field-edge:var(--color-ring)] has-[[data-slot=input-group-control]:focus-visible]:[--field-halo:color-mix(in_oklab,var(--color-ring)_16%,transparent)]",
29
+ "has-[[data-slot][aria-invalid=true]]:[--field-edge:var(--color-destructive)] has-[[data-slot][aria-invalid=true]]:[--field-halo:var(--nc-rosso-300)]",
30
+ "has-[[data-slot][aria-invalid=true]]:not-has-[[data-slot=input-group-control]:disabled]:not-has-[[data-slot=input-group-control]:focus-visible]:hover:[--field-halo:var(--nc-rosso-500)]",
31
+ ].join(" ");
32
+ /** The same states for a box of chips, whose ring wraps the chips and the input among them. */
33
+ export const fieldWithinStates = [
34
+ "not-focus-within:not-has-aria-invalid:hover:[--field-edge:color-mix(in_oklab,var(--color-ring)_70%,transparent)]",
35
+ "focus-within:[--field-edge:var(--color-ring)] focus-within:[--field-halo:color-mix(in_oklab,var(--color-ring)_16%,transparent)]",
36
+ "has-aria-invalid:[--field-edge:var(--color-destructive)] has-aria-invalid:[--field-halo:var(--nc-rosso-300)]",
37
+ "has-aria-invalid:not-focus-within:hover:[--field-halo:var(--nc-rosso-500)]",
38
+ ].join(" ");
39
+ /** A disabled box steps down in fill and text, never in opacity. */
40
+ export const fieldDisabled = "disabled:cursor-not-allowed disabled:bg-accent disabled:text-placeholder";
41
+ const inputBoxVariants = cva([
42
+ "min-h-touch-target w-full min-w-0 bg-(--nc-field,var(--background)) px-control-padding-inline py-0 text-base file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-placeholder [@media(hover:hover)_and_(pointer:fine)]:min-h-0",
43
+ fieldRing,
44
+ fieldStates,
45
+ fieldDisabled,
46
+ ], {
47
+ variants: {
48
+ size: {
49
+ sm: "h-nadicode-control-height-sm rounded-sm md:text-sm",
50
+ default: "h-control-height rounded-sm md:text-sm",
51
+ lg: "h-nadicode-control-height-lg rounded-md",
52
+ },
53
+ },
54
+ defaultVariants: { size: "default" },
55
+ });
56
+ /** The bare box of `Input` and `InputGroupControl`, so the group can wrap it without a cycle. */
57
+ export function InputBox({ className, size = "default", type, ...props }) {
58
+ return (_jsx(InputPrimitive, { type: type, "data-slot": "input", "data-size": size, "data-field-frame": "", className: cn(inputBoxVariants({ size }), className), ...props }));
59
+ }
@@ -1,6 +1,13 @@
1
1
  /**
2
- * A dropdown and a context menu carry the same commands over the same dense rows, so both take this solid floating
3
- * surface; DESIGN.md ("Elevation & Depth") keeps glass for chrome over content that scrolls or moves under it.
2
+ * A dropdown and a context menu carry the same commands, so both take this floating glass surface (DESIGN.md
3
+ * "Elevation & Depth"): the content under an open menu stays in view, saturated, behind its rows.
4
4
  */
5
- export declare const menuSurface = "group/menu z-50 max-h-(--available-height) w-max min-w-[min(14rem,var(--available-width))] max-w-(--available-width) overflow-x-hidden overflow-y-auto rounded-lg border-0 bg-popover p-nadicode-xxs text-popover-foreground nc-elevation-floating outline-none data-closed:overflow-hidden";
5
+ export declare const menuSurface = "group/menu z-50 max-h-(--available-height) w-max min-w-[min(12.5rem,var(--available-width))] max-w-(--available-width) overflow-x-hidden overflow-y-auto rounded-lg border-0 nc-glass p-1.5 text-popover-foreground nc-elevation-floating outline-none data-closed:overflow-hidden";
6
+ /**
7
+ * Every row of a menu, whatever it holds, so the parts of one menu never differ in height. A row that can be
8
+ * chosen shows the pointer cursor; one that cannot turns its text muted, never dimmed, keeps the default cursor
9
+ * and takes no highlight from the keyboard. The highlight is the row's fill alone: no text inside the row changes
10
+ * colour with it.
11
+ */
12
+ export declare const menuRow = "relative flex min-h-touch-target cursor-pointer items-center gap-1.5 rounded-sm px-1.5 py-1 group-data-[density=comfortable]/menu:gap-2 group-data-[density=comfortable]/menu:px-2 group-data-[density=comfortable]/menu:py-2 text-sm outline-hidden select-none focus:bg-accent data-inset:pl-7 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:text-muted-foreground data-disabled:focus:bg-transparent [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
6
13
  //# sourceMappingURL=menu-surface.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-surface.d.ts","sourceRoot":"","sources":["../../src/internal/menu-surface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,gSACuQ,CAAC"}
1
+ {"version":3,"file":"menu-surface.d.ts","sourceRoot":"","sources":["../../src/internal/menu-surface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,uRAC8P,CAAC;AAEvR;;;;;GAKG;AACH,eAAO,MAAM,OAAO,8iBACyhB,CAAC"}
@@ -1,5 +1,12 @@
1
1
  /**
2
- * A dropdown and a context menu carry the same commands over the same dense rows, so both take this solid floating
3
- * surface; DESIGN.md ("Elevation & Depth") keeps glass for chrome over content that scrolls or moves under it.
2
+ * A dropdown and a context menu carry the same commands, so both take this floating glass surface (DESIGN.md
3
+ * "Elevation & Depth"): the content under an open menu stays in view, saturated, behind its rows.
4
4
  */
5
- export const menuSurface = "group/menu z-50 max-h-(--available-height) w-max min-w-[min(14rem,var(--available-width))] max-w-(--available-width) overflow-x-hidden overflow-y-auto rounded-lg border-0 bg-popover p-nadicode-xxs text-popover-foreground nc-elevation-floating outline-none data-closed:overflow-hidden";
5
+ export const menuSurface = "group/menu z-50 max-h-(--available-height) w-max min-w-[min(12.5rem,var(--available-width))] max-w-(--available-width) overflow-x-hidden overflow-y-auto rounded-lg border-0 nc-glass p-1.5 text-popover-foreground nc-elevation-floating outline-none data-closed:overflow-hidden";
6
+ /**
7
+ * Every row of a menu, whatever it holds, so the parts of one menu never differ in height. A row that can be
8
+ * chosen shows the pointer cursor; one that cannot turns its text muted, never dimmed, keeps the default cursor
9
+ * and takes no highlight from the keyboard. The highlight is the row's fill alone: no text inside the row changes
10
+ * colour with it.
11
+ */
12
+ export const menuRow = "relative flex min-h-touch-target cursor-pointer items-center gap-1.5 rounded-sm px-1.5 py-1 group-data-[density=comfortable]/menu:gap-2 group-data-[density=comfortable]/menu:px-2 group-data-[density=comfortable]/menu:py-2 text-sm outline-hidden select-none focus:bg-accent data-inset:pl-7 data-disabled:pointer-events-none data-disabled:cursor-default data-disabled:text-muted-foreground data-disabled:focus:bg-transparent [@media(hover:hover)_and_(pointer:fine)]:min-h-0 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4";
@@ -0,0 +1,25 @@
1
+ import { type LucideIcon } from "lucide-react";
2
+ import { type PageCommand } from "../components/page-actions.js";
3
+ export type NoticeTone = "neutral" | "info" | "warning" | "destructive";
4
+ /** The hue of a notice's edge: a light step of its text colour, neutral for the plain tone. */
5
+ export declare const NOTICE_EDGE: Record<NoticeTone, string>;
6
+ /** The mark a tone draws: Info for neutral and info, the triangle for warning and destructive. */
7
+ export declare function NoticeMark({ icon, tone }: {
8
+ icon?: LucideIcon | undefined;
9
+ tone: NoticeTone;
10
+ }): import("react").JSX.Element;
11
+ /**
12
+ * A notice's one fix, drawn as an underlined 14 px link with no padding. In a `strip` it takes the
13
+ * darkest step of the strip's own hue (neutral takes the foreground) and returns to the strip's
14
+ * text on hover; `inline` it follows the sentence in the sentence's own colour.
15
+ */
16
+ export declare function NoticeLink({ className, command, ...place }: {
17
+ className?: string;
18
+ command: PageCommand;
19
+ } & ({
20
+ place: "inline";
21
+ } | {
22
+ place: "strip";
23
+ tone: NoticeTone;
24
+ })): import("react").JSX.Element;
25
+ //# sourceMappingURL=notice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"notice.d.ts","sourceRoot":"","sources":["../../src/internal/notice.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAiB,MAAM,cAAc,CAAC;AAEpE,OAAO,EAAE,KAAK,WAAW,EAAqB,MAAM,2BAA2B,CAAC;AAGhF,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,aAAa,CAAC;AAExE,+FAA+F;AAC/F,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAKlD,CAAC;AAEF,kGAAkG;AAClG,wBAAgB,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,+BAG7F;AAgBD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,OAAO,EACP,GAAG,KAAK,EACT,EAAE;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,WAAW,CAAC;CACtB,GAAG,CAAC;IAAE,KAAK,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC,+BAc/D"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Info, TriangleAlert } from "lucide-react";
3
+ import { PageCommandButton } from "../components/page-actions.js";
4
+ import { cn } from "../lib/utils.js";
5
+ /** The hue of a notice's edge: a light step of its text colour, neutral for the plain tone. */
6
+ export const NOTICE_EDGE = {
7
+ neutral: "border-border",
8
+ info: "border-info-soft-foreground/25",
9
+ warning: "border-warning-soft-foreground/25",
10
+ destructive: "border-destructive-soft-foreground/25",
11
+ };
12
+ /** The mark a tone draws: Info for neutral and info, the triangle for warning and destructive. */
13
+ export function NoticeMark({ icon, tone }) {
14
+ const Mark = icon ?? (tone === "warning" || tone === "destructive" ? TriangleAlert : Info);
15
+ return _jsx(Mark, { "aria-hidden": "true" });
16
+ }
17
+ const LINK_LOOK = "[&_[data-slot=button]]:gap-0.5 [&_[data-slot=button]]:px-0! [&_[data-slot=button]]:text-body-sm [&_[data-slot=button]]:underline [&_[data-slot=button]_svg]:size-4!";
18
+ const STRIP_LINK = "[&_[data-slot=button]]:h-6 [&_[data-slot=button]]:hover:text-inherit";
19
+ const STRIP_LINK_TONE = {
20
+ neutral: "[&_[data-slot=button]]:text-foreground",
21
+ info: "[&_[data-slot=button]]:text-(--nc-cobalto-1000)",
22
+ warning: "[&_[data-slot=button]]:text-(--nc-giallo-1000)",
23
+ destructive: "[&_[data-slot=button]]:text-(--nc-rosso-1000)",
24
+ };
25
+ const INLINE_LINK = "align-bottom [&_[data-slot=button]]:h-5 [&_[data-slot=button]]:text-current";
26
+ /**
27
+ * A notice's one fix, drawn as an underlined 14 px link with no padding. In a `strip` it takes the
28
+ * darkest step of the strip's own hue (neutral takes the foreground) and returns to the strip's
29
+ * text on hover; `inline` it follows the sentence in the sentence's own colour.
30
+ */
31
+ export function NoticeLink({ className, command, ...place }) {
32
+ return (_jsx("span", { className: cn("inline-flex", LINK_LOOK, place.place === "strip" ? [STRIP_LINK, STRIP_LINK_TONE[place.tone]] : INLINE_LINK, className), "data-notice-action": true, children: _jsx(PageCommandButton, { command: command, size: "xs", variant: "link" }) }));
33
+ }
@@ -0,0 +1,5 @@
1
+ export declare const overlayStem = "z-50 flex h-1.5 w-3.5 data-[side=bottom]:bottom-full data-[side=bottom]:rotate-180 data-[side=inline-end]:top-1/2! data-[side=inline-end]:left-full data-[side=inline-end]:-translate-x-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-end]:-rotate-90 data-[side=inline-start]:top-1/2! data-[side=inline-start]:right-full data-[side=inline-start]:translate-x-1 data-[side=inline-start]:-translate-y-1/2 data-[side=inline-start]:rotate-90 data-[side=left]:top-1/2! data-[side=left]:left-full data-[side=left]:-translate-x-1 data-[side=left]:-translate-y-1/2 data-[side=left]:-rotate-90 data-[side=right]:top-1/2! data-[side=right]:right-full data-[side=right]:translate-x-1 data-[side=right]:-translate-y-1/2 data-[side=right]:rotate-90 data-[side=top]:top-full";
2
+ export declare function OverlayStemShape({ outlined }: {
3
+ outlined?: boolean;
4
+ }): import("react").JSX.Element;
5
+ //# sourceMappingURL=overlay-stem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"overlay-stem.d.ts","sourceRoot":"","sources":["../../src/internal/overlay-stem.tsx"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW,qwBAC4uB,CAAC;AAOrwB,wBAAgB,gBAAgB,CAAC,EAAE,QAAgB,EAAE,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,+BAO5E"}
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ export const overlayStem = "z-50 flex h-1.5 w-3.5 data-[side=bottom]:bottom-full data-[side=bottom]:rotate-180 data-[side=inline-end]:top-1/2! data-[side=inline-end]:left-full data-[side=inline-end]:-translate-x-1 data-[side=inline-end]:-translate-y-1/2 data-[side=inline-end]:-rotate-90 data-[side=inline-start]:top-1/2! data-[side=inline-start]:right-full data-[side=inline-start]:translate-x-1 data-[side=inline-start]:-translate-y-1/2 data-[side=inline-start]:rotate-90 data-[side=left]:top-1/2! data-[side=left]:left-full data-[side=left]:-translate-x-1 data-[side=left]:-translate-y-1/2 data-[side=left]:-rotate-90 data-[side=right]:top-1/2! data-[side=right]:right-full data-[side=right]:translate-x-1 data-[side=right]:-translate-y-1/2 data-[side=right]:rotate-90 data-[side=top]:top-full";
3
+ const STEM_SHAPE = "M13.8284 0H0.17157C0.702003 0 1.21071 0.210714 1.58578 0.585787L5.58578 4.58579C6.36683 5.36684 7.63316 5.36683 8.41421 4.58579L12.4142 0.585786C12.7893 0.210714 13.298 0 13.8284 0Z";
4
+ const STEM_EDGE = "M0.17157 0C0.702003 0 1.21071 0.210714 1.58578 0.585787L5.58578 4.58579C6.36683 5.36684 7.63316 5.36683 8.41421 4.58579L12.4142 0.585786C12.7893 0.210714 13.298 0 13.8284 0";
5
+ export function OverlayStemShape({ outlined = false }) {
6
+ return (_jsxs("svg", { "aria-hidden": "true", className: "overflow-visible", height: "6", viewBox: "0 0 14 6", width: "14", children: [_jsx("path", { className: "fill-popover", d: STEM_SHAPE }), outlined ? _jsx("path", { className: "stroke-border", d: STEM_EDGE, fill: "none" }) : null] }));
7
+ }
@@ -0,0 +1,4 @@
1
+ export type PhoneLayout = "sheet" | "centred";
2
+ /** A centred modal popup docked to the bottom edge, full width, under 640 px. */
3
+ export declare const phoneSheetLayout = "max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none";
4
+ //# sourceMappingURL=phone-sheet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"phone-sheet.d.ts","sourceRoot":"","sources":["../../src/internal/phone-sheet.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,SAAS,CAAC;AAE9C,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,oIACsG,CAAC"}
@@ -0,0 +1,2 @@
1
+ /** A centred modal popup docked to the bottom edge, full width, under 640 px. */
2
+ export const phoneSheetLayout = "max-sm:top-auto max-sm:bottom-0 max-sm:left-0 max-sm:max-w-none max-sm:translate-x-0 max-sm:translate-y-0 max-sm:rounded-b-none";
@@ -0,0 +1,3 @@
1
+ /** Content that exists: not `null`, `undefined` or a boolean, so a required slot cannot be filled with nothing. */
2
+ export type PresentContent = Exclude<React.ReactNode, boolean | null | undefined>;
3
+ //# sourceMappingURL=present-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"present-content.d.ts","sourceRoot":"","sources":["../../src/internal/present-content.ts"],"names":[],"mappings":"AAAA,mHAAmH;AACnH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -1,6 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { MenuCommand, RecordMenu } from "../components/action-menu.js";
3
- import type { PageCommandAction } from "../components/page-actions.js";
3
+ import type { PageCommand, PageCommandAction } from "../components/page-actions.js";
4
4
  export declare function menuItemAction(action: PageCommandAction): {
5
5
  render: import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>>;
6
6
  nativeButton: boolean;
@@ -10,10 +10,11 @@ export declare function menuItemAction(action: PageCommandAction): {
10
10
  render?: undefined;
11
11
  nativeButton?: undefined;
12
12
  };
13
- export declare function MenuCommandRow({ command, value }: {
13
+ export declare function MenuCommandRow({ command, iconEnd, value, }: {
14
14
  command: MenuCommand;
15
+ iconEnd?: boolean;
15
16
  value?: ReactNode;
16
17
  }): import("react").JSX.Element;
17
- export declare function soleMenuButton(commands: readonly MenuCommand[]): MenuCommand | undefined;
18
+ export declare function soleMenuButton(commands: readonly MenuCommand[]): PageCommand | undefined;
18
19
  export declare function RecordMenuItems({ record, commands }: Omit<RecordMenu, "label">): import("react").JSX.Element;
19
20
  //# sourceMappingURL=record-menu-items.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"record-menu-items.d.ts","sourceRoot":"","sources":["../../src/internal/record-menu-items.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAQxE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEnE,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB;;;;;;;;EAIvD;AAED,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;IAAE,OAAO,EAAE,WAAW,CAAC;IAAC,KAAK,CAAC,EAAE,SAAS,CAAA;CAAE,+BAqB7F;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,WAAW,GAAG,SAAS,CAGxF;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,+BAe9E"}
1
+ {"version":3,"file":"record-menu-items.d.ts","sourceRoot":"","sources":["../../src/internal/record-menu-items.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAQxE,OAAO,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAEhF,wBAAgB,cAAc,CAAC,MAAM,EAAE,iBAAiB;;;;;;;;EAMvD;AAYD,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,OAAe,EACf,KAAK,GACN,EAAE;IACD,OAAO,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,+BAuBA;AAED,wBAAgB,cAAc,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,GAAG,WAAW,GAAG,SAAS,CAKxF;AAED,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,+BAe9E"}
@@ -2,16 +2,31 @@
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { DropdownMenuCommand, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuShortcut, } from "../components/dropdown-menu.js";
4
4
  export function menuItemAction(action) {
5
- return action.render
6
- ? { render: action.render, nativeButton: action.render.type === "button" }
7
- : { onClick: action.onClick };
5
+ if (action.link)
6
+ return { render: action.link, nativeButton: false };
7
+ if (action.render) {
8
+ return { render: action.render, nativeButton: action.render.type === "button" };
9
+ }
10
+ return { onClick: action.onClick };
8
11
  }
9
- export function MenuCommandRow({ command, value }) {
10
- return (_jsx(DropdownMenuCommand, { "aria-label": command.accessibleName, disabled: command.disabled, icon: command.icon, detail: command.detail, reason: command.reason, variant: command.destructive ? "destructive" : "default", ...menuItemAction(command), children: value === undefined ? (command.label) : (_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "min-w-0 flex-1", children: command.label }), " ", _jsx(DropdownMenuShortcut, { children: value })] })) }));
12
+ function commandAction(command) {
13
+ return command.link ? { link: command.link } : menuItemAction(command);
14
+ }
15
+ function commandState(command) {
16
+ return command.locked
17
+ ? { locked: true, reason: command.reason }
18
+ : { disabledReason: command.disabledReason };
19
+ }
20
+ export function MenuCommandRow({ command, iconEnd = false, value, }) {
21
+ return (_jsx(DropdownMenuCommand, { "aria-label": command.accessibleName, icon: command.icon, iconEnd: iconEnd, detail: command.detail, variant: command.destructive ? "destructive" : "default", ...commandState(command), loading: command.pending === true, loadingLabel: command.pendingLabel ?? command.label, ...commandAction(command), children: value === undefined ? (command.label) : (_jsxs("span", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "min-w-0 flex-1", children: command.label }), " ", _jsx(DropdownMenuShortcut, { children: value })] })) }));
11
22
  }
12
23
  export function soleMenuButton(commands) {
13
24
  const [only] = commands;
14
- return commands.length === 1 && only && !only.destructive ? only : undefined;
25
+ if (commands.length !== 1 || !only || only.destructive)
26
+ return undefined;
27
+ if (only.locked === true || only.disabledReason !== undefined)
28
+ return undefined;
29
+ return only;
15
30
  }
16
31
  export function RecordMenuItems({ record, commands }) {
17
32
  const kept = commands.filter((command) => !command.destructive);
@@ -6,13 +6,20 @@ export type SettingsSaveFailure = {
6
6
  field?: string;
7
7
  };
8
8
  export type SettingsSave = {
9
- /** Saves the section's fields; resolves to null once saved. */
9
+ /**
10
+ * Saves the section's fields; resolves to null once saved. A state change after its await goes in
11
+ * `startTransition`, or React renders it while Save still says Saving; what the page shows once saved goes in
12
+ * `saved`.
13
+ */
10
14
  action: (formData: FormData) => Promise<SettingsSaveFailure | null>;
11
15
  /** "Save" */
12
16
  label: string;
13
17
  /** "Saving" */
14
18
  pendingLabel: string;
15
- /** Called once a save resolves null: the product announces it through its own toast. */
19
+ /**
20
+ * Called once a save resolves null, in the transition that ends the save: the product announces it through its
21
+ * own toast, and a state change made here renders with Save ready again.
22
+ */
16
23
  saved: () => void;
17
24
  /** What is specific to this card, on the footer's left: a limit, what a value is for, a plan it needs, a link. Absent: nothing. */
18
25
  hint?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"settings-save.d.ts","sourceRoot":"","sources":["../../src/internal/settings-save.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,SAAS,EAMf,MAAM,OAAO,CAAC;AAOf,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAOtF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,eAAe,CAAC;IACzB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,+DAA+D;IAC/D,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACpE,aAAa;IACb,KAAK,EAAE,MAAM,CAAC;IACd,eAAe;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,wFAAwF;IACxF,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,mIAAmI;IACnI,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3F;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAgGF,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAkFA;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,sCA2B1D"}
1
+ {"version":3,"file":"settings-save.d.ts","sourceRoot":"","sources":["../../src/internal/settings-save.tsx"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,SAAS,EAOf,MAAM,OAAO,CAAC;AAMf,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAOtF,MAAM,MAAM,mBAAmB,GAAG;IAChC,OAAO,EAAE,eAAe,CAAC;IACzB,2FAA2F;IAC3F,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB;;;;OAIG;IACH,MAAM,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAC;IACpE,aAAa;IACb,KAAK,EAAE,MAAM,CAAC;IACd,eAAe;IACf,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,mIAAmI;IACnI,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;QAAC,OAAO,CAAC,EAAE,OAAO,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3F;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AA4FF,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,OAAO,EACP,QAAQ,GACT,EAAE;IACD,IAAI,EAAE,YAAY,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;CACrB,+BAsFA;AAED,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,sCA2B1D"}
@@ -1,11 +1,10 @@
1
1
  "use client";
2
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { createContext, use, useCallback, useEffect, useRef, useState, } from "react";
3
+ import { createContext, startTransition, use, useCallback, useEffect, useRef, useState, } from "react";
4
4
  import { useFormStatus } from "react-dom";
5
5
  import { Button } from "../components/button.js";
6
6
  import { FieldError } from "../components/field.js";
7
7
  import { MessageNotice } from "../components/message-notice.js";
8
- import { PendingLabel } from "../components/pending-label.js";
9
8
  import { messageSentences } from "../components/product-message.js";
10
9
  import { CardContent } from "../components/card.js";
11
10
  import { WaitingLine } from "../components/waiting-line.js";
@@ -55,7 +54,7 @@ function editableValues(form) {
55
54
  }
56
55
  function SaveFooter({ save, changed }) {
57
56
  const { pending } = useFormStatus();
58
- return (_jsxs(FooterStrip, { hint: save.hint, hintSlot: "settings-section-hint", children: [save.cancel ? (_jsx(Button, { "aria-busy": save.cancel.pending || undefined, disabled: pending || save.cancel.pending, onClick: save.cancel.onCancel, type: "button", variant: "outline", children: _jsx(PendingLabel, { pending: save.cancel.pending ?? false, pendingLabel: save.cancel.pendingLabel ?? save.cancel.label, children: save.cancel.label }) })) : null, _jsx(FormSubmitButton, { submit: {
57
+ return (_jsxs(FooterStrip, { hint: save.hint, hintSlot: "settings-section-hint", children: [save.cancel ? (_jsx(Button, { disabled: pending, loading: save.cancel.pending ?? false, loadingLabel: save.cancel.pendingLabel ?? save.cancel.label, onClick: save.cancel.onCancel, type: "button", variant: "outline", children: save.cancel.label })) : null, _jsx(FormSubmitButton, { submit: {
59
58
  label: save.label,
60
59
  pendingLabel: save.pendingLabel,
61
60
  pending,
@@ -100,9 +99,13 @@ export function SettingsSaveForm({ save, titleId, children, }) {
100
99
  return (_jsx(SettingsSaveContext, { value: { failure, claim }, children: _jsxs("form", { ref: form, "aria-labelledby": titleId, className: "contents", "data-slot": "settings-section-form", action: async (formData) => {
101
100
  const result = await save.action(formData);
102
101
  keepValuesOnReset.current = result !== null;
103
- setFailure(result);
104
- if (result === null)
105
- save.saved();
102
+ // React leaves an update after an await out of the action, so it would render while Save still says
103
+ // Saving; inside a transition it renders with the end of the save.
104
+ startTransition(() => {
105
+ setFailure(result);
106
+ if (result === null)
107
+ save.saved();
108
+ });
106
109
  }, onChange: (event) => {
107
110
  const edited = event.target;
108
111
  if (edited instanceof Element &&
@@ -0,0 +1,38 @@
1
+ import * as React from "react";
2
+ import { type TableCompactLayout } from "../components/table-layouts.js";
3
+ export type TableDetailFact = {
4
+ id: string;
5
+ label: React.ReactNode;
6
+ value: React.ReactNode;
7
+ /** The value is prose a reader needs whole, such as why a check failed: the line wraps instead of ending in an ellipsis. */
8
+ wraps?: boolean;
9
+ };
10
+ export declare function DetailFacts({ facts, leadingSeparator, }: {
11
+ facts: readonly TableDetailFact[];
12
+ leadingSeparator?: boolean;
13
+ }): React.JSX.Element[];
14
+ type TableCompactLineValue = {
15
+ layout: TableCompactLayout;
16
+ facts: readonly TableDetailFact[];
17
+ };
18
+ /**
19
+ * The facts an entity row moves onto the line under its name on a card narrower than its
20
+ * columns, so the record stays one 72 px row: the name over one muted line. `RecordIdentity`
21
+ * draws them after its own line.
22
+ */
23
+ export declare function TableCompactLine({ children, ...value }: TableCompactLineValue & {
24
+ children: React.ReactNode;
25
+ }): React.JSX.Element;
26
+ /** The compact facts of the row this stands in, after a middle dot; nothing outside such a row or on a card wide enough for the columns. */
27
+ export declare function TableCompactFacts(): React.JSX.Element | null;
28
+ /**
29
+ * Whether the entity rows around it are laid out compact now, read from the layout the browser
30
+ * drew: a row's cells move what does not fit beside the name under it instead.
31
+ */
32
+ export declare function TableLaidOutCompact({ compact, children, }: {
33
+ compact: boolean;
34
+ children: React.ReactNode;
35
+ }): React.JSX.Element;
36
+ export declare function useTableLaidOutCompact(): boolean;
37
+ export {};
38
+ //# sourceMappingURL=table-compact-line.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"table-compact-line.d.ts","sourceRoot":"","sources":["../../src/internal/table-compact-line.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAuB,KAAK,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAG1F,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4HAA4H;IAC5H,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,gBAAwB,GACzB,EAAE;IACD,KAAK,EAAE,SAAS,eAAe,EAAE,CAAC;IAClC,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B,uBAQA;AAED,KAAK,qBAAqB,GAAG;IAAE,MAAM,EAAE,kBAAkB,CAAC;IAAC,KAAK,EAAE,SAAS,eAAe,EAAE,CAAA;CAAE,CAAC;AAI/F;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,qBAAqB,GAAG;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAEvD;AAED,4IAA4I;AAC5I,wBAAgB,iBAAiB,6BAehC;AAID;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,EAClC,OAAO,EACP,QAAQ,GACT,EAAE;IACD,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,qBAEA;AAED,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import * as React from "react";
4
+ import { tableCompactLayouts } from "../components/table-layouts.js";
5
+ import { cn } from "../lib/utils.js";
6
+ export function DetailFacts({ facts, leadingSeparator = false, }) {
7
+ return facts.map((fact, index) => (_jsxs("span", { children: [index > 0 || leadingSeparator ? _jsx("span", { "aria-hidden": "true", children: " \u00B7 " }) : null, _jsxs("span", { className: "sr-only", children: [fact.label, ": "] }), fact.value] }, fact.id)));
8
+ }
9
+ const TableCompactLineContext = React.createContext(null);
10
+ /**
11
+ * The facts an entity row moves onto the line under its name on a card narrower than its
12
+ * columns, so the record stays one 72 px row: the name over one muted line. `RecordIdentity`
13
+ * draws them after its own line.
14
+ */
15
+ export function TableCompactLine({ children, ...value }) {
16
+ return _jsx(TableCompactLineContext, { value: value, children: children });
17
+ }
18
+ /** The compact facts of the row this stands in, after a middle dot; nothing outside such a row or on a card wide enough for the columns. */
19
+ export function TableCompactFacts() {
20
+ const line = React.useContext(TableCompactLineContext);
21
+ if (!line || line.facts.length === 0)
22
+ return null;
23
+ return (_jsx("span", { className: cn("[&_[data-slot=tag]]:contents [&>span>:is(div,p,.block,.grid,.flex)]:inline", tableCompactLayouts[line.layout].details), "data-slot": "table-detail-line", "data-wraps": line.facts.some((fact) => fact.wraps) || undefined, children: _jsx(DetailFacts, { facts: line.facts, leadingSeparator: true }) }));
24
+ }
25
+ const TableLaidOutCompactContext = React.createContext(false);
26
+ /**
27
+ * Whether the entity rows around it are laid out compact now, read from the layout the browser
28
+ * drew: a row's cells move what does not fit beside the name under it instead.
29
+ */
30
+ export function TableLaidOutCompact({ compact, children, }) {
31
+ return _jsx(TableLaidOutCompactContext, { value: compact, children: children });
32
+ }
33
+ export function useTableLaidOutCompact() {
34
+ return React.useContext(TableLaidOutCompactContext);
35
+ }
@@ -0,0 +1,8 @@
1
+ import type * as React from "react";
2
+ /**
3
+ * Names an element whole in its title while some of its text is cut by an ellipsis and no title
4
+ * inside it reads that text whole, such as the line under a name whose own title holds only the
5
+ * name, and drops the title once everything fits.
6
+ */
7
+ export declare function titleWhenCut(event: React.SyntheticEvent<HTMLElement>): void;
8
+ //# sourceMappingURL=title-when-cut.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"title-when-cut.d.ts","sourceRoot":"","sources":["../../src/internal/title-when-cut.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAIpC;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,QAiBpE"}
@@ -0,0 +1,22 @@
1
+ const read = (text) => (text ?? "").replace(/\s+/g, " ").trim();
2
+ /**
3
+ * Names an element whole in its title while some of its text is cut by an ellipsis and no title
4
+ * inside it reads that text whole, such as the line under a name whose own title holds only the
5
+ * name, and drops the title once everything fits.
6
+ */
7
+ export function titleWhenCut(event) {
8
+ const element = event.currentTarget;
9
+ const readWholeInside = (node) => {
10
+ const titled = node.closest("[title]");
11
+ return (titled !== null &&
12
+ titled !== element &&
13
+ element.contains(titled) &&
14
+ read(titled.title).includes(read(node.textContent)));
15
+ };
16
+ const cut = [element, ...element.querySelectorAll("*")].some((node) => node.scrollWidth > node.clientWidth && !readWholeInside(node));
17
+ const text = read(element.textContent);
18
+ if (cut && text)
19
+ element.title = text;
20
+ else
21
+ element.removeAttribute("title");
22
+ }
@@ -0,0 +1,18 @@
1
+ import type { Drawer as DrawerPrimitive } from "@base-ui/react/drawer";
2
+ /** Input a person typed that closing the surface would lose. */
3
+ export type UnsavedGuard = {
4
+ dirty: boolean;
5
+ /** Runs when a dismissal was held back, so the caller can ask what to do. */
6
+ onDismissBlocked: () => void;
7
+ };
8
+ /** What a surface's `onOpenChange` is told about why it closes; the Drawer's reasons are a superset of the Dialog's. */
9
+ export type DismissDetails = Pick<DrawerPrimitive.Root.ChangeEventDetails, "reason" | "cancel">;
10
+ /**
11
+ * Escape, a press outside, a swipe and the system back gesture are accidents, so with unsaved
12
+ * input they are held back (the close is cancelled) and reported; Close and Cancel are deliberate
13
+ * and always go through. Returns whether the close was held back.
14
+ */
15
+ export declare function holdBackUnsavedDismissal(open: boolean, details: DismissDetails, unsaved?: UnsavedGuard): boolean;
16
+ /** The `onOpenChange` of a form surface that reports only whether it is open. */
17
+ export declare function guardUnsaved(onOpenChange: (open: boolean) => void, unsaved?: UnsavedGuard): (open: boolean, details: DismissDetails) => void;
18
+ //# sourceMappingURL=unsaved-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unsaved-guard.d.ts","sourceRoot":"","sources":["../../src/internal/unsaved-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAEvE,gEAAgE;AAChE,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,6EAA6E;IAC7E,gBAAgB,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAEF,wHAAwH;AACxH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,kBAAkB,EAAE,QAAQ,GAAG,QAAQ,CAAC,CAAC;AAchG;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE,YAAY,GACrB,OAAO,CAKT;AAED,iFAAiF;AACjF,wBAAgB,YAAY,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,EAAE,OAAO,CAAC,EAAE,YAAY,IAChF,MAAM,OAAO,EAAE,SAAS,cAAc,UAI/C"}
@@ -0,0 +1,31 @@
1
+ const HELD_BACK_WHEN_DIRTY = {
2
+ "escape-key": true,
3
+ "outside-press": true,
4
+ swipe: true,
5
+ "close-watcher": true,
6
+ "trigger-press": false,
7
+ "close-press": false,
8
+ "focus-out": false,
9
+ "imperative-action": false,
10
+ none: false,
11
+ };
12
+ /**
13
+ * Escape, a press outside, a swipe and the system back gesture are accidents, so with unsaved
14
+ * input they are held back (the close is cancelled) and reported; Close and Cancel are deliberate
15
+ * and always go through. Returns whether the close was held back.
16
+ */
17
+ export function holdBackUnsavedDismissal(open, details, unsaved) {
18
+ if (open || !unsaved?.dirty || !HELD_BACK_WHEN_DIRTY[details.reason])
19
+ return false;
20
+ details.cancel();
21
+ unsaved.onDismissBlocked();
22
+ return true;
23
+ }
24
+ /** The `onOpenChange` of a form surface that reports only whether it is open. */
25
+ export function guardUnsaved(onOpenChange, unsaved) {
26
+ return (open, details) => {
27
+ if (holdBackUnsavedDismissal(open, details, unsaved))
28
+ return;
29
+ onOpenChange(open);
30
+ };
31
+ }