@entifix/react-controls 0.18.2 → 0.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (328) hide show
  1. package/README.md +13 -5
  2. package/dist/i18n/catalog/en.d.ts.map +1 -1
  3. package/dist/i18n/catalog/en.js +68 -10
  4. package/dist/i18n/catalog/en.js.map +1 -1
  5. package/dist/i18n/catalog/es.d.ts +76 -5
  6. package/dist/i18n/catalog/es.d.ts.map +1 -1
  7. package/dist/i18n/catalog/es.js +74 -10
  8. package/dist/i18n/catalog/es.js.map +1 -1
  9. package/dist/i18n/catalog/index.d.ts +126 -10
  10. package/dist/i18n/catalog/index.d.ts.map +1 -1
  11. package/dist/i18n/entity-labels.d.ts +14 -0
  12. package/dist/i18n/entity-labels.d.ts.map +1 -1
  13. package/dist/i18n/entity-labels.js +15 -0
  14. package/dist/i18n/entity-labels.js.map +1 -1
  15. package/dist/i18n/i18n-context.js +2 -2
  16. package/dist/i18n/i18n-context.js.map +1 -1
  17. package/dist/index.d.ts +13 -2
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +13 -2
  20. package/dist/index.js.map +1 -1
  21. package/dist/primitives.d.ts +7 -1
  22. package/dist/primitives.d.ts.map +1 -1
  23. package/dist/primitives.js +7 -1
  24. package/dist/primitives.js.map +1 -1
  25. package/dist/theme/index.d.ts +1 -0
  26. package/dist/theme/index.d.ts.map +1 -1
  27. package/dist/theme/index.js +1 -0
  28. package/dist/theme/index.js.map +1 -1
  29. package/dist/theme/theme-context.d.ts +35 -7
  30. package/dist/theme/theme-context.d.ts.map +1 -1
  31. package/dist/theme/theme-context.js +109 -21
  32. package/dist/theme/theme-context.js.map +1 -1
  33. package/dist/theme/theme-cookie.d.ts +9 -0
  34. package/dist/theme/theme-cookie.d.ts.map +1 -0
  35. package/dist/theme/theme-cookie.js +8 -0
  36. package/dist/theme/theme-cookie.js.map +1 -0
  37. package/dist/theme/theme-script.d.ts +8 -5
  38. package/dist/theme/theme-script.d.ts.map +1 -1
  39. package/dist/theme/theme-script.js +24 -10
  40. package/dist/theme/theme-script.js.map +1 -1
  41. package/dist/theme/types.d.ts +19 -3
  42. package/dist/theme/types.d.ts.map +1 -1
  43. package/dist/theme/types.js.map +1 -1
  44. package/dist/ui/actions/action-surfaces.d.ts +1 -1
  45. package/dist/ui/actions/action-surfaces.js +1 -1
  46. package/dist/ui/actions/action-surfaces.js.map +1 -1
  47. package/dist/ui/actions/error-actions.d.ts +32 -0
  48. package/dist/ui/actions/error-actions.d.ts.map +1 -0
  49. package/dist/ui/actions/error-actions.js +40 -0
  50. package/dist/ui/actions/error-actions.js.map +1 -0
  51. package/dist/ui/actions/index.d.ts +2 -0
  52. package/dist/ui/actions/index.d.ts.map +1 -1
  53. package/dist/ui/actions/index.js +2 -0
  54. package/dist/ui/actions/index.js.map +1 -1
  55. package/dist/ui/actions/shortcut.d.ts +13 -0
  56. package/dist/ui/actions/shortcut.d.ts.map +1 -0
  57. package/dist/ui/actions/shortcut.js +18 -0
  58. package/dist/ui/actions/shortcut.js.map +1 -0
  59. package/dist/ui/actions/use-verb-invoker.d.ts +50 -0
  60. package/dist/ui/actions/use-verb-invoker.d.ts.map +1 -0
  61. package/dist/ui/actions/use-verb-invoker.js +93 -0
  62. package/dist/ui/actions/use-verb-invoker.js.map +1 -0
  63. package/dist/ui/atoms/alert/alert-dismiss.d.ts +9 -0
  64. package/dist/ui/atoms/alert/alert-dismiss.d.ts.map +1 -0
  65. package/dist/ui/atoms/alert/alert-dismiss.js +28 -0
  66. package/dist/ui/atoms/alert/alert-dismiss.js.map +1 -0
  67. package/dist/ui/atoms/alert/alert.d.ts +24 -0
  68. package/dist/ui/atoms/alert/alert.d.ts.map +1 -0
  69. package/dist/ui/atoms/alert/alert.js +50 -0
  70. package/dist/ui/atoms/alert/alert.js.map +1 -0
  71. package/dist/ui/atoms/alert/index.d.ts +3 -0
  72. package/dist/ui/atoms/alert/index.d.ts.map +1 -0
  73. package/dist/ui/atoms/alert/index.js +4 -0
  74. package/dist/ui/atoms/alert/index.js.map +1 -0
  75. package/dist/ui/atoms/alert/tone.d.ts +8 -0
  76. package/dist/ui/atoms/alert/tone.d.ts.map +1 -0
  77. package/dist/ui/atoms/alert/tone.js +11 -0
  78. package/dist/ui/atoms/alert/tone.js.map +1 -0
  79. package/dist/ui/atoms/button/button-recipe.js +1 -1
  80. package/dist/ui/atoms/button/button-recipe.js.map +1 -1
  81. package/dist/ui/atoms/button/index.d.ts +1 -0
  82. package/dist/ui/atoms/button/index.d.ts.map +1 -1
  83. package/dist/ui/atoms/button/index.js +1 -0
  84. package/dist/ui/atoms/button/index.js.map +1 -1
  85. package/dist/ui/atoms/button/submit-button.d.ts +13 -0
  86. package/dist/ui/atoms/button/submit-button.d.ts.map +1 -0
  87. package/dist/ui/atoms/button/submit-button.js +29 -0
  88. package/dist/ui/atoms/button/submit-button.js.map +1 -0
  89. package/dist/ui/atoms/cell-value/cell-value.d.ts +6 -1
  90. package/dist/ui/atoms/cell-value/cell-value.d.ts.map +1 -1
  91. package/dist/ui/atoms/cell-value/cell-value.js +48 -16
  92. package/dist/ui/atoms/cell-value/cell-value.js.map +1 -1
  93. package/dist/ui/atoms/field/checkbox.d.ts.map +1 -1
  94. package/dist/ui/atoms/field/checkbox.js +21 -1
  95. package/dist/ui/atoms/field/checkbox.js.map +1 -1
  96. package/dist/ui/atoms/field/field.js +1 -1
  97. package/dist/ui/atoms/field/field.js.map +1 -1
  98. package/dist/ui/atoms/field-control/field-control.d.ts +7 -1
  99. package/dist/ui/atoms/field-control/field-control.d.ts.map +1 -1
  100. package/dist/ui/atoms/field-control/field-control.js +25 -3
  101. package/dist/ui/atoms/field-control/field-control.js.map +1 -1
  102. package/dist/ui/atoms/money/index.d.ts +4 -0
  103. package/dist/ui/atoms/money/index.d.ts.map +1 -0
  104. package/dist/ui/atoms/money/index.js +5 -0
  105. package/dist/ui/atoms/money/index.js.map +1 -0
  106. package/dist/ui/atoms/money/money-input.d.ts +19 -0
  107. package/dist/ui/atoms/money/money-input.d.ts.map +1 -0
  108. package/dist/ui/atoms/money/money-input.js +75 -0
  109. package/dist/ui/atoms/money/money-input.js.map +1 -0
  110. package/dist/ui/atoms/money/money-math.d.ts +21 -0
  111. package/dist/ui/atoms/money/money-math.d.ts.map +1 -0
  112. package/dist/ui/atoms/money/money-math.js +36 -0
  113. package/dist/ui/atoms/money/money-math.js.map +1 -0
  114. package/dist/ui/atoms/money/money.d.ts +19 -0
  115. package/dist/ui/atoms/money/money.d.ts.map +1 -0
  116. package/dist/ui/atoms/money/money.js +26 -0
  117. package/dist/ui/atoms/money/money.js.map +1 -0
  118. package/dist/ui/atoms/number-input/index.d.ts +3 -0
  119. package/dist/ui/atoms/number-input/index.d.ts.map +1 -0
  120. package/dist/ui/atoms/number-input/index.js +4 -0
  121. package/dist/ui/atoms/number-input/index.js.map +1 -0
  122. package/dist/ui/atoms/number-input/number-input.d.ts +10 -0
  123. package/dist/ui/atoms/number-input/number-input.d.ts.map +1 -0
  124. package/dist/ui/atoms/number-input/number-input.js +23 -0
  125. package/dist/ui/atoms/number-input/number-input.js.map +1 -0
  126. package/dist/ui/atoms/number-input/quantity-input.d.ts +29 -0
  127. package/dist/ui/atoms/number-input/quantity-input.d.ts.map +1 -0
  128. package/dist/ui/atoms/number-input/quantity-input.js +100 -0
  129. package/dist/ui/atoms/number-input/quantity-input.js.map +1 -0
  130. package/dist/ui/atoms/skeleton/skeleton.js +1 -1
  131. package/dist/ui/atoms/skeleton/skeleton.js.map +1 -1
  132. package/dist/ui/atoms/status-tag/index.d.ts +2 -0
  133. package/dist/ui/atoms/status-tag/index.d.ts.map +1 -0
  134. package/dist/ui/atoms/status-tag/index.js +3 -0
  135. package/dist/ui/atoms/status-tag/index.js.map +1 -0
  136. package/dist/ui/atoms/status-tag/status-tag.d.ts +17 -0
  137. package/dist/ui/atoms/status-tag/status-tag.d.ts.map +1 -0
  138. package/dist/ui/atoms/status-tag/status-tag.js +37 -0
  139. package/dist/ui/atoms/status-tag/status-tag.js.map +1 -0
  140. package/dist/ui/atoms/switch/switch.d.ts.map +1 -1
  141. package/dist/ui/atoms/switch/switch.js +6 -3
  142. package/dist/ui/atoms/switch/switch.js.map +1 -1
  143. package/dist/ui/atoms/table/table.d.ts +12 -3
  144. package/dist/ui/atoms/table/table.d.ts.map +1 -1
  145. package/dist/ui/atoms/table/table.js +59 -10
  146. package/dist/ui/atoms/table/table.js.map +1 -1
  147. package/dist/ui/atoms/text/text.d.ts +2 -2
  148. package/dist/ui/atoms/text/text.d.ts.map +1 -1
  149. package/dist/ui/atoms/text/text.js.map +1 -1
  150. package/dist/ui/molecules/action-bar/action-bar.d.ts +76 -0
  151. package/dist/ui/molecules/action-bar/action-bar.d.ts.map +1 -0
  152. package/dist/ui/molecules/action-bar/action-bar.js +218 -0
  153. package/dist/ui/molecules/action-bar/action-bar.js.map +1 -0
  154. package/dist/ui/molecules/action-bar/index.d.ts +2 -0
  155. package/dist/ui/molecules/action-bar/index.d.ts.map +1 -0
  156. package/dist/ui/molecules/action-bar/index.js +3 -0
  157. package/dist/ui/molecules/action-bar/index.js.map +1 -0
  158. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts +11 -2
  159. package/dist/ui/molecules/breadcrumbs/breadcrumbs.d.ts.map +1 -1
  160. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js +9 -7
  161. package/dist/ui/molecules/breadcrumbs/breadcrumbs.js.map +1 -1
  162. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.d.ts.map +1 -1
  163. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js +8 -10
  164. package/dist/ui/molecules/bulk-action-bar/bulk-action-bar.js.map +1 -1
  165. package/dist/ui/molecules/bulk-result/bulk-result.d.ts +3 -3
  166. package/dist/ui/molecules/bulk-result/bulk-result.js +4 -4
  167. package/dist/ui/molecules/bulk-result/bulk-result.js.map +1 -1
  168. package/dist/ui/molecules/column-settings/column-settings.js +1 -1
  169. package/dist/ui/molecules/column-settings/column-settings.js.map +1 -1
  170. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts +24 -9
  171. package/dist/ui/molecules/confirm-dialog/confirm-dialog.d.ts.map +1 -1
  172. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js +38 -13
  173. package/dist/ui/molecules/confirm-dialog/confirm-dialog.js.map +1 -1
  174. package/dist/ui/molecules/description-list/description-list.d.ts +17 -0
  175. package/dist/ui/molecules/description-list/description-list.d.ts.map +1 -0
  176. package/dist/ui/molecules/description-list/description-list.js +36 -0
  177. package/dist/ui/molecules/description-list/description-list.js.map +1 -0
  178. package/dist/ui/molecules/description-list/index.d.ts +2 -0
  179. package/dist/ui/molecules/description-list/index.d.ts.map +1 -0
  180. package/dist/ui/molecules/description-list/index.js +3 -0
  181. package/dist/ui/molecules/description-list/index.js.map +1 -0
  182. package/dist/ui/molecules/drawer/drawer.js +3 -3
  183. package/dist/ui/molecules/drawer/drawer.js.map +1 -1
  184. package/dist/ui/molecules/empty-state/empty-state.d.ts +15 -0
  185. package/dist/ui/molecules/empty-state/empty-state.d.ts.map +1 -0
  186. package/dist/ui/molecules/empty-state/empty-state.js +29 -0
  187. package/dist/ui/molecules/empty-state/empty-state.js.map +1 -0
  188. package/dist/ui/molecules/empty-state/index.d.ts +2 -0
  189. package/dist/ui/molecules/empty-state/index.d.ts.map +1 -0
  190. package/dist/ui/molecules/empty-state/index.js +3 -0
  191. package/dist/ui/molecules/empty-state/index.js.map +1 -0
  192. package/dist/ui/molecules/entity-link-input/entity-link-input.d.ts.map +1 -1
  193. package/dist/ui/molecules/entity-link-input/entity-link-input.js +7 -4
  194. package/dist/ui/molecules/entity-link-input/entity-link-input.js.map +1 -1
  195. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js +2 -2
  196. package/dist/ui/molecules/entity-link-picker/entity-link-picker.js.map +1 -1
  197. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts +33 -20
  198. package/dist/ui/molecules/entity-record-card/entity-record-card.d.ts.map +1 -1
  199. package/dist/ui/molecules/entity-record-card/entity-record-card.js +53 -20
  200. package/dist/ui/molecules/entity-record-card/entity-record-card.js.map +1 -1
  201. package/dist/ui/molecules/filter-builder/filter-builder.d.ts +8 -2
  202. package/dist/ui/molecules/filter-builder/filter-builder.d.ts.map +1 -1
  203. package/dist/ui/molecules/filter-builder/filter-builder.js +14 -5
  204. package/dist/ui/molecules/filter-builder/filter-builder.js.map +1 -1
  205. package/dist/ui/molecules/filter-chips/filter-chips.d.ts +16 -0
  206. package/dist/ui/molecules/filter-chips/filter-chips.d.ts.map +1 -0
  207. package/dist/ui/molecules/filter-chips/filter-chips.js +73 -0
  208. package/dist/ui/molecules/filter-chips/filter-chips.js.map +1 -0
  209. package/dist/ui/molecules/filter-chips/index.d.ts +2 -0
  210. package/dist/ui/molecules/filter-chips/index.d.ts.map +1 -0
  211. package/dist/ui/molecules/filter-chips/index.js +3 -0
  212. package/dist/ui/molecules/filter-chips/index.js.map +1 -0
  213. package/dist/ui/molecules/media-gallery/index.d.ts +2 -0
  214. package/dist/ui/molecules/media-gallery/index.d.ts.map +1 -0
  215. package/dist/ui/molecules/media-gallery/index.js +3 -0
  216. package/dist/ui/molecules/media-gallery/index.js.map +1 -0
  217. package/dist/ui/molecules/media-gallery/media-gallery.d.ts +31 -0
  218. package/dist/ui/molecules/media-gallery/media-gallery.d.ts.map +1 -0
  219. package/dist/ui/molecules/media-gallery/media-gallery.js +64 -0
  220. package/dist/ui/molecules/media-gallery/media-gallery.js.map +1 -0
  221. package/dist/ui/molecules/menu/menu.d.ts +11 -1
  222. package/dist/ui/molecules/menu/menu.d.ts.map +1 -1
  223. package/dist/ui/molecules/menu/menu.js +68 -6
  224. package/dist/ui/molecules/menu/menu.js.map +1 -1
  225. package/dist/ui/molecules/nav-menu/nav-menu.js +4 -4
  226. package/dist/ui/molecules/nav-menu/nav-menu.js.map +1 -1
  227. package/dist/ui/molecules/pagination/pagination.d.ts +5 -0
  228. package/dist/ui/molecules/pagination/pagination.d.ts.map +1 -1
  229. package/dist/ui/molecules/pagination/pagination.js +35 -18
  230. package/dist/ui/molecules/pagination/pagination.js.map +1 -1
  231. package/dist/ui/molecules/region-state/index.d.ts +2 -0
  232. package/dist/ui/molecules/region-state/index.d.ts.map +1 -0
  233. package/dist/ui/molecules/region-state/index.js +3 -0
  234. package/dist/ui/molecules/region-state/index.js.map +1 -0
  235. package/dist/ui/molecules/region-state/region-state.d.ts +42 -0
  236. package/dist/ui/molecules/region-state/region-state.d.ts.map +1 -0
  237. package/dist/ui/molecules/region-state/region-state.js +83 -0
  238. package/dist/ui/molecules/region-state/region-state.js.map +1 -0
  239. package/dist/ui/molecules/segmented-nav/segment-classes.d.ts +3 -3
  240. package/dist/ui/molecules/segmented-nav/segment-classes.d.ts.map +1 -1
  241. package/dist/ui/molecules/segmented-nav/segment-classes.js +2 -2
  242. package/dist/ui/molecules/segmented-nav/segment-classes.js.map +1 -1
  243. package/dist/ui/molecules/segmented-nav/segmented-nav.d.ts +14 -4
  244. package/dist/ui/molecules/segmented-nav/segmented-nav.d.ts.map +1 -1
  245. package/dist/ui/molecules/segmented-nav/segmented-nav.js +6 -5
  246. package/dist/ui/molecules/segmented-nav/segmented-nav.js.map +1 -1
  247. package/dist/ui/molecules/split-view/split-view.js +3 -3
  248. package/dist/ui/molecules/split-view/split-view.js.map +1 -1
  249. package/dist/ui/molecules/tab-strip/tab-strip.d.ts +51 -12
  250. package/dist/ui/molecules/tab-strip/tab-strip.d.ts.map +1 -1
  251. package/dist/ui/molecules/tab-strip/tab-strip.js +125 -34
  252. package/dist/ui/molecules/tab-strip/tab-strip.js.map +1 -1
  253. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts +3 -1
  254. package/dist/ui/molecules/table-toolbar/table-toolbar.d.ts.map +1 -1
  255. package/dist/ui/molecules/table-toolbar/table-toolbar.js +3 -2
  256. package/dist/ui/molecules/table-toolbar/table-toolbar.js.map +1 -1
  257. package/dist/ui/molecules/toast-region/toast-region.d.ts +63 -19
  258. package/dist/ui/molecules/toast-region/toast-region.d.ts.map +1 -1
  259. package/dist/ui/molecules/toast-region/toast-region.js +129 -42
  260. package/dist/ui/molecules/toast-region/toast-region.js.map +1 -1
  261. package/dist/ui/organisms/command-palette/command-palette.d.ts.map +1 -1
  262. package/dist/ui/organisms/command-palette/command-palette.js +25 -18
  263. package/dist/ui/organisms/command-palette/command-palette.js.map +1 -1
  264. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.d.ts.map +1 -1
  265. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js +8 -3
  266. package/dist/ui/organisms/entity-detail-grid/entity-detail-grid.js.map +1 -1
  267. package/dist/ui/organisms/entity-form/entity-form.d.ts +1 -1
  268. package/dist/ui/organisms/entity-form/entity-form.d.ts.map +1 -1
  269. package/dist/ui/organisms/entity-form/entity-form.js +325 -215
  270. package/dist/ui/organisms/entity-form/entity-form.js.map +1 -1
  271. package/dist/ui/organisms/entity-form/entity-form.types.d.ts +8 -0
  272. package/dist/ui/organisms/entity-form/entity-form.types.d.ts.map +1 -1
  273. package/dist/ui/organisms/entity-form/entity-form.types.js.map +1 -1
  274. package/dist/ui/organisms/entity-table/entity-table.d.ts +1 -1
  275. package/dist/ui/organisms/entity-table/entity-table.d.ts.map +1 -1
  276. package/dist/ui/organisms/entity-table/entity-table.js +334 -198
  277. package/dist/ui/organisms/entity-table/entity-table.js.map +1 -1
  278. package/dist/ui/organisms/entity-table/entity-table.types.d.ts +19 -4
  279. package/dist/ui/organisms/entity-table/entity-table.types.d.ts.map +1 -1
  280. package/dist/ui/organisms/entity-table/entity-table.types.js.map +1 -1
  281. package/dist/ui/organisms/entity-table/header-sort.d.ts +18 -0
  282. package/dist/ui/organisms/entity-table/header-sort.d.ts.map +1 -0
  283. package/dist/ui/organisms/entity-table/header-sort.js +54 -0
  284. package/dist/ui/organisms/entity-table/header-sort.js.map +1 -0
  285. package/dist/ui/organisms/entity-table/pivot.d.ts +25 -0
  286. package/dist/ui/organisms/entity-table/pivot.d.ts.map +1 -0
  287. package/dist/ui/organisms/entity-table/pivot.js +106 -0
  288. package/dist/ui/organisms/entity-table/pivot.js.map +1 -0
  289. package/dist/ui/organisms/entity-table/use-result-announcement.d.ts +13 -0
  290. package/dist/ui/organisms/entity-table/use-result-announcement.d.ts.map +1 -0
  291. package/dist/ui/organisms/entity-table/use-result-announcement.js +31 -0
  292. package/dist/ui/organisms/entity-table/use-result-announcement.js.map +1 -0
  293. package/dist/ui/organisms/top-bar/live-indicator.d.ts +11 -0
  294. package/dist/ui/organisms/top-bar/live-indicator.d.ts.map +1 -0
  295. package/dist/ui/organisms/top-bar/live-indicator.js +46 -0
  296. package/dist/ui/organisms/top-bar/live-indicator.js.map +1 -0
  297. package/dist/ui/organisms/top-bar/top-bar.d.ts +11 -2
  298. package/dist/ui/organisms/top-bar/top-bar.d.ts.map +1 -1
  299. package/dist/ui/organisms/top-bar/top-bar.js +14 -5
  300. package/dist/ui/organisms/top-bar/top-bar.js.map +1 -1
  301. package/dist/ui/organisms/wizard/wizard.d.ts +1 -1
  302. package/dist/ui/organisms/wizard/wizard.d.ts.map +1 -1
  303. package/dist/ui/organisms/wizard/wizard.js +7 -1
  304. package/dist/ui/organisms/wizard/wizard.js.map +1 -1
  305. package/dist/ui/organisms/wizard/wizard.types.d.ts +8 -0
  306. package/dist/ui/organisms/wizard/wizard.types.d.ts.map +1 -1
  307. package/dist/ui/organisms/wizard/wizard.types.js.map +1 -1
  308. package/dist/ui/utils/live-updates.d.ts +24 -0
  309. package/dist/ui/utils/live-updates.d.ts.map +1 -0
  310. package/dist/ui/utils/live-updates.js +20 -0
  311. package/dist/ui/utils/live-updates.js.map +1 -0
  312. package/dist/ui/utils/use-focus-on-arrival.d.ts +14 -0
  313. package/dist/ui/utils/use-focus-on-arrival.d.ts.map +1 -0
  314. package/dist/ui/utils/use-focus-on-arrival.js +42 -0
  315. package/dist/ui/utils/use-focus-on-arrival.js.map +1 -0
  316. package/dist/ui/utils/use-hotkey.d.ts +44 -25
  317. package/dist/ui/utils/use-hotkey.d.ts.map +1 -1
  318. package/dist/ui/utils/use-hotkey.js +80 -48
  319. package/dist/ui/utils/use-hotkey.js.map +1 -1
  320. package/package.json +5 -5
  321. package/dist/ui/molecules/split-button/index.d.ts +0 -2
  322. package/dist/ui/molecules/split-button/index.d.ts.map +0 -1
  323. package/dist/ui/molecules/split-button/index.js +0 -3
  324. package/dist/ui/molecules/split-button/index.js.map +0 -1
  325. package/dist/ui/molecules/split-button/split-button.d.ts +0 -21
  326. package/dist/ui/molecules/split-button/split-button.d.ts.map +0 -1
  327. package/dist/ui/molecules/split-button/split-button.js +0 -35
  328. package/dist/ui/molecules/split-button/split-button.js.map +0 -1
@@ -1,31 +1,80 @@
1
+ 'use client';
1
2
  import { _ as _extends } from "@swc/helpers/_/_extends";
2
3
  import { _ as _object_without_properties_loose } from "@swc/helpers/_/_object_without_properties_loose";
3
- import { jsx as _jsx } from "react/jsx-runtime";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
+ import { useEffect, useId, useRef, useState } from 'react';
4
6
  import { cn } from '../../utils/cn.js';
7
+ /**
8
+ * Whether an element's content is larger than its box, on either axis —
9
+ * measured again whenever the box or the content it holds resizes.
10
+ */ function useOverflows(ref) {
11
+ const [overflows, setOverflows] = useState(false);
12
+ useEffect(()=>{
13
+ const node = ref.current;
14
+ const measure = ()=>setOverflows(node.scrollWidth > node.clientWidth || node.scrollHeight > node.clientHeight);
15
+ measure();
16
+ const observer = new ResizeObserver(measure);
17
+ observer.observe(node);
18
+ // The table grows with its rows while the container keeps its size.
19
+ for (const child of Array.from(node.children))observer.observe(child);
20
+ return ()=>observer.disconnect();
21
+ }, [
22
+ ref
23
+ ]);
24
+ return overflows;
25
+ }
5
26
  /**
6
27
  * Styled table primitive — no entity knowledge, no data fetching. `EntityTable`
7
28
  * composes these; anything rendering non-entity tabular data can use them too.
8
29
  *
9
30
  * Wide tables scroll inside their own container rather than pushing the page
10
- * sideways.
31
+ * sideways. A container that scrolls is a **focusable region** named by the
32
+ * caption, so a keyboard can scroll it — and one that fits is neither, so it
33
+ * adds no tab stop that does nothing.
11
34
  */ export function Table(_0) {
12
- let { className, containerClassName } = _0, props = _object_without_properties_loose(_0, [
35
+ let { className, containerClassName, caption, captionClassName = 'sr-only', children } = _0, props = _object_without_properties_loose(_0, [
13
36
  "className",
14
- "containerClassName"
37
+ "containerClassName",
38
+ "caption",
39
+ "captionClassName",
40
+ "children"
15
41
  ]);
16
- return /*#__PURE__*/ _jsx("div", {
17
- className: cn('w-full overflow-x-auto rounded-xl border border-border bg-surface-elevated', containerClassName),
18
- children: /*#__PURE__*/ _jsx("table", _extends({
42
+ const container = useRef(null);
43
+ const captionId = useId();
44
+ const overflows = useOverflows(container);
45
+ const named = caption !== undefined;
46
+ return /*#__PURE__*/ _jsx("div", _extends({
47
+ ref: container,
48
+ "data-overflows": overflows || undefined
49
+ }, overflows && {
50
+ tabIndex: 0,
51
+ role: named ? 'region' : undefined,
52
+ 'aria-labelledby': named ? captionId : undefined
53
+ }, {
54
+ className: cn('w-full overflow-auto rounded-xl border border-border bg-surface-elevated focus-ring', containerClassName),
55
+ children: /*#__PURE__*/ _jsxs("table", _extends({
19
56
  className: cn('w-full border-collapse text-step-0 text-content', className)
20
- }, props))
21
- });
57
+ }, props, {
58
+ children: [
59
+ named && /*#__PURE__*/ _jsx("caption", {
60
+ id: captionId,
61
+ className: captionClassName,
62
+ children: caption
63
+ }),
64
+ children
65
+ ]
66
+ }))
67
+ }));
22
68
  }
23
69
  export function TableHead(_0) {
24
70
  let { className } = _0, props = _object_without_properties_loose(_0, [
25
71
  "className"
26
72
  ]);
27
73
  return /*#__PURE__*/ _jsx("thead", _extends({
28
- className: cn('border-b border-border bg-surface', className)
74
+ // Sticky inside a container that scrolls: the column names stay in view
75
+ // over a long page of rows. One layer above the rows, and no higher: a
76
+ // row menu opened under it must still paint over it.
77
+ className: cn('top-0 sticky z-1 border-b border-border bg-surface', className)
29
78
  }, props));
30
79
  }
31
80
  export function TableBody(_0) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/atoms/table/table.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\nexport interface TableProps extends ComponentPropsWithoutRef<'table'> {\n /** Class names for the scroll container wrapping the `<table>`. */\n containerClassName?: string;\n}\n\n/**\n * Styled table primitive — no entity knowledge, no data fetching. `EntityTable`\n * composes these; anything rendering non-entity tabular data can use them too.\n *\n * Wide tables scroll inside their own container rather than pushing the page\n * sideways.\n */\nexport function Table({ className, containerClassName, ...props }: TableProps) {\n return (\n <div\n className={cn(\n 'w-full overflow-x-auto rounded-xl border border-border bg-surface-elevated',\n containerClassName,\n )}\n >\n <table\n className={cn(\n 'w-full border-collapse text-step-0 text-content',\n className,\n )}\n {...props}\n />\n </div>\n );\n}\n\nexport function TableHead({\n className,\n ...props\n}: ComponentPropsWithoutRef<'thead'>) {\n return (\n <thead\n className={cn('border-b border-border bg-surface', className)}\n {...props}\n />\n );\n}\n\nexport function TableBody({\n className,\n ...props\n}: ComponentPropsWithoutRef<'tbody'>) {\n return (\n <tbody className={cn('divide-y divide-border', className)} {...props} />\n );\n}\n\nexport function TableRow({\n className,\n ...props\n}: ComponentPropsWithoutRef<'tr'>) {\n return (\n <tr\n className={cn(\n 'transition-colors duration-200 ease-smooth hover:bg-surface',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport type TableCellAlign = 'start' | 'center' | 'end';\n\nconst ALIGN_CLASS: Record<TableCellAlign, string> = {\n start: 'text-left',\n center: 'text-center',\n end: 'text-right',\n};\n\n// `align` shadows the deprecated HTML attribute, which allows a different set\n// of values — omit the native one rather than narrow it.\nexport interface TableHeaderCellProps extends Omit<\n ComponentPropsWithoutRef<'th'>,\n 'align'\n> {\n align?: TableCellAlign;\n}\n\nexport function TableHeaderCell({\n align = 'start',\n className,\n ...props\n}: TableHeaderCellProps) {\n return (\n <th\n scope=\"col\"\n className={cn(\n 'px-s py-2xs text-step-sm font-semibold whitespace-nowrap text-content-muted',\n ALIGN_CLASS[align],\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface TableCellProps extends Omit<\n ComponentPropsWithoutRef<'td'>,\n 'align'\n> {\n align?: TableCellAlign;\n}\n\nexport function TableCell({\n align = 'start',\n className,\n ...props\n}: TableCellProps) {\n return (\n <td\n className={cn('px-s py-2xs align-middle', ALIGN_CLASS[align], className)}\n {...props}\n />\n );\n}\n\n/** Full-width message row — empty results, an error, a loading state. */\nexport function TableMessageRow({\n colSpan,\n className,\n ...props\n}: ComponentPropsWithoutRef<'td'> & { colSpan: number }) {\n return (\n <tr>\n <td\n colSpan={colSpan}\n className={cn(\n 'px-s py-m text-center text-step-sm text-content-muted',\n className,\n )}\n {...props}\n />\n </tr>\n );\n}\n"],"names":["cn","Table","className","containerClassName","props","div","table","TableHead","thead","TableBody","tbody","TableRow","tr","ALIGN_CLASS","start","center","end","TableHeaderCell","align","th","scope","TableCell","td","TableMessageRow","colSpan"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AAOvC;;;;;;CAMC,GACD,OAAO,SAASC,MAAM,EAAuD;QAAvD,EAAEC,SAAS,EAAEC,kBAAkB,EAAwB,OAAnBC;;;;IACxD,qBACE,KAACC;QACCH,WAAWF,GACT,8EACAG;kBAGF,cAAA,KAACG;YACCJ,WAAWF,GACT,mDACAE;WAEEE;;AAIZ;AAEA,OAAO,SAASG,UAAU,EAGU;QAHV,EACxBL,SAAS,EAEyB,OAD/BE;;;IAEH,qBACE,KAACI;QACCN,WAAWF,GAAG,qCAAqCE;OAC/CE;AAGV;AAEA,OAAO,SAASK,UAAU,EAGU;QAHV,EACxBP,SAAS,EAEyB,OAD/BE;;;IAEH,qBACE,KAACM;QAAMR,WAAWF,GAAG,0BAA0BE;OAAgBE;AAEnE;AAEA,OAAO,SAASO,SAAS,EAGQ;QAHR,EACvBT,SAAS,EAEsB,OAD5BE;;;IAEH,qBACE,KAACQ;QACCV,WAAWF,GACT,+DACAE;OAEEE;AAGV;AAIA,MAAMS,cAA8C;IAClDC,OAAO;IACPC,QAAQ;IACRC,KAAK;AACP;AAWA,OAAO,SAASC,gBAAgB,EAIT;QAJS,EAC9BC,QAAQ,OAAO,EACfhB,SAAS,EAEY,OADlBE;;;;IAEH,qBACE,KAACe;QACCC,OAAM;QACNlB,WAAWF,GACT,+EACAa,WAAW,CAACK,MAAM,EAClBhB;OAEEE;AAGV;AASA,OAAO,SAASiB,UAAU,EAIT;QAJS,EACxBH,QAAQ,OAAO,EACfhB,SAAS,EAEM,OADZE;;;;IAEH,qBACE,KAACkB;QACCpB,WAAWF,GAAG,4BAA4Ba,WAAW,CAACK,MAAM,EAAEhB;OAC1DE;AAGV;AAEA,uEAAuE,GACvE,OAAO,SAASmB,gBAAgB,EAIuB;QAJvB,EAC9BC,OAAO,EACPtB,SAAS,EAE4C,OADlDE;;;;IAEH,qBACE,KAACQ;kBACC,cAAA,KAACU;YACCE,SAASA;YACTtB,WAAWF,GACT,yDACAE;WAEEE;;AAIZ"}
1
+ {"version":3,"sources":["../../../../src/ui/atoms/table/table.tsx"],"sourcesContent":["'use client';\n\nimport {\n type ComponentPropsWithoutRef,\n type ReactNode,\n type RefObject,\n useEffect,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\nexport interface TableProps extends ComponentPropsWithoutRef<'table'> {\n /** Class names for the scroll container wrapping the `<table>`. */\n containerClassName?: string;\n /**\n * What the table holds — \"Clientes, 12 resultados\". It names the table and,\n * once the table overflows its container, the scroll region too.\n */\n caption?: ReactNode;\n /** Class names for the caption; screen-reader only unless overridden. */\n captionClassName?: string;\n}\n\n/**\n * Whether an element's content is larger than its box, on either axis —\n * measured again whenever the box or the content it holds resizes.\n */\nfunction useOverflows(ref: RefObject<HTMLElement | null>): boolean {\n const [overflows, setOverflows] = useState(false);\n useEffect(() => {\n const node = ref.current as HTMLElement;\n const measure = () =>\n setOverflows(\n node.scrollWidth > node.clientWidth ||\n node.scrollHeight > node.clientHeight,\n );\n measure();\n const observer = new ResizeObserver(measure);\n observer.observe(node);\n // The table grows with its rows while the container keeps its size.\n for (const child of Array.from(node.children)) observer.observe(child);\n return () => observer.disconnect();\n }, [ref]);\n return overflows;\n}\n\n/**\n * Styled table primitive — no entity knowledge, no data fetching. `EntityTable`\n * composes these; anything rendering non-entity tabular data can use them too.\n *\n * Wide tables scroll inside their own container rather than pushing the page\n * sideways. A container that scrolls is a **focusable region** named by the\n * caption, so a keyboard can scroll it — and one that fits is neither, so it\n * adds no tab stop that does nothing.\n */\nexport function Table({\n className,\n containerClassName,\n caption,\n captionClassName = 'sr-only',\n children,\n ...props\n}: TableProps) {\n const container = useRef<HTMLDivElement>(null);\n const captionId = useId();\n const overflows = useOverflows(container);\n const named = caption !== undefined;\n\n return (\n <div\n ref={container}\n data-overflows={overflows || undefined}\n {...(overflows && {\n tabIndex: 0,\n role: named ? 'region' : undefined,\n 'aria-labelledby': named ? captionId : undefined,\n })}\n className={cn(\n 'w-full overflow-auto rounded-xl border border-border bg-surface-elevated focus-ring',\n containerClassName,\n )}\n >\n <table\n className={cn(\n 'w-full border-collapse text-step-0 text-content',\n className,\n )}\n {...props}\n >\n {named && (\n <caption id={captionId} className={captionClassName}>\n {caption}\n </caption>\n )}\n {children}\n </table>\n </div>\n );\n}\n\nexport function TableHead({\n className,\n ...props\n}: ComponentPropsWithoutRef<'thead'>) {\n return (\n <thead\n // Sticky inside a container that scrolls: the column names stay in view\n // over a long page of rows. One layer above the rows, and no higher: a\n // row menu opened under it must still paint over it.\n className={cn(\n 'top-0 sticky z-1 border-b border-border bg-surface',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport function TableBody({\n className,\n ...props\n}: ComponentPropsWithoutRef<'tbody'>) {\n return (\n <tbody className={cn('divide-y divide-border', className)} {...props} />\n );\n}\n\nexport function TableRow({\n className,\n ...props\n}: ComponentPropsWithoutRef<'tr'>) {\n return (\n <tr\n className={cn(\n 'transition-colors duration-200 ease-smooth hover:bg-surface',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport type TableCellAlign = 'start' | 'center' | 'end';\n\nconst ALIGN_CLASS: Record<TableCellAlign, string> = {\n start: 'text-left',\n center: 'text-center',\n end: 'text-right',\n};\n\n// `align` shadows the deprecated HTML attribute, which allows a different set\n// of values — omit the native one rather than narrow it.\nexport interface TableHeaderCellProps extends Omit<\n ComponentPropsWithoutRef<'th'>,\n 'align'\n> {\n align?: TableCellAlign;\n}\n\nexport function TableHeaderCell({\n align = 'start',\n className,\n ...props\n}: TableHeaderCellProps) {\n return (\n <th\n scope=\"col\"\n className={cn(\n 'px-s py-2xs text-step-sm font-semibold whitespace-nowrap text-content-muted',\n ALIGN_CLASS[align],\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface TableCellProps extends Omit<\n ComponentPropsWithoutRef<'td'>,\n 'align'\n> {\n align?: TableCellAlign;\n}\n\nexport function TableCell({\n align = 'start',\n className,\n ...props\n}: TableCellProps) {\n return (\n <td\n className={cn('px-s py-2xs align-middle', ALIGN_CLASS[align], className)}\n {...props}\n />\n );\n}\n\n/** Full-width message row — empty results, an error, a loading state. */\nexport function TableMessageRow({\n colSpan,\n className,\n ...props\n}: ComponentPropsWithoutRef<'td'> & { colSpan: number }) {\n return (\n <tr>\n <td\n colSpan={colSpan}\n className={cn(\n 'px-s py-m text-center text-step-sm text-content-muted',\n className,\n )}\n {...props}\n />\n </tr>\n );\n}\n"],"names":["useEffect","useId","useRef","useState","cn","useOverflows","ref","overflows","setOverflows","node","current","measure","scrollWidth","clientWidth","scrollHeight","clientHeight","observer","ResizeObserver","observe","child","Array","from","children","disconnect","Table","className","containerClassName","caption","captionClassName","props","container","captionId","named","undefined","div","data-overflows","tabIndex","role","table","id","TableHead","thead","TableBody","tbody","TableRow","tr","ALIGN_CLASS","start","center","end","TableHeaderCell","align","th","scope","TableCell","td","TableMessageRow","colSpan"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AD/BI;;;IAEH,qBACE,KAACY;QACC,wEAAwE;QACxE,uEAAuE;QACvE,qDAAqD;QACrDhB,WAAWrB,GACT,sDACAqB;OAEEI;AAGV;AAEA,OAAO,SAASa,UAAU,EAGU;QAHV,EACxBjB,SAAS,EAEyB,OAD/BI;;;IAEH,qBACE,KAACc;QAAMlB,WAAWrB,GAAG,0BAA0BqB;OAAgBI;AAEnE;AAEA,OAAO,SAASe,SAAS,EAGQ;QAHR,EACvBnB,SAAS,EAEsB,OAD5BI;;;IAEH,qBACE,KAACgB;QACCpB,WAAWrB,GACT,+DACAqB;OAEEI;AAGV;AAIA,MAAMiB,cAA8C;IAClDC,OAAO;IACPC,QAAQ;IACRC,KAAK;AACP;AAWA,OAAO,SAASC,gBAAgB,EAIT;QAJS,EAC9BC,QAAQ,OAAO,EACf1B,SAAS,EAEY,OADlBI;;;;IAEH,qBACE,KAACuB;QACCC,OAAM;QACN5B,WAAWrB,GACT,+EACA0C,WAAW,CAACK,MAAM,EAClB1B;OAEEI;AAGV;AASA,OAAO,SAASyB,UAAU,EAIT;QAJS,EACxBH,QAAQ,OAAO,EACf1B,SAAS,EAEM,OADZI;;;;IAEH,qBACE,KAAC0B;QACC9B,WAAWrB,GAAG,4BAA4B0C,WAAW,CAACK,MAAM,EAAE1B;OAC1DI;AAGV;AAEA,uEAAuE,GACvE,OAAO,SAAS2B,gBAAgB,EAIuB;QAJvB,EAC9BC,OAAO,EACPhC,SAAS,EAE4C,OADlDI;;;;IAEH,qBACE,KAACgB;kBACC,cAAA,KAACU;YACCE,SAASA;YACThC,WAAWrB,GACT,yDACAqB;WAEEI;;AAIZ"}
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef, ElementType } from 'react';
1
+ import type { ComponentProps, ComponentPropsWithoutRef, ElementType } from 'react';
2
2
  /** Fluid type step (Utopia). Negatives taper below body for fine print. */
3
3
  type Step = -2 | -1 | 0 | 1 | 2 | 3;
4
4
  /**
@@ -17,7 +17,7 @@ type Tone = 'default' | 'muted' | 'primary' | 'accent';
17
17
  type Align = 'start' | 'center' | 'end';
18
18
  /** Multi-line clamp (static classes so Tailwind can see them). */
19
19
  type Clamp = 1 | 2 | 3 | 4;
20
- export interface TextProps extends ComponentPropsWithoutRef<'p'> {
20
+ export interface TextProps extends ComponentProps<'p'> {
21
21
  /** Fluid type step (Utopia). Defaults to body (0). */
22
22
  step?: Step;
23
23
  /** Font weight. */
@@ -1 +1 @@
1
- {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../../src/ui/atoms/text/text.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAInE,2EAA2E;AAC3E,KAAK,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAWpC;;;;;;;;;GASG;AACH,KAAK,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC;AAQ/C,mEAAmE;AACnE,KAAK,IAAI,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AASvD,KAAK,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AAQxC,kEAAkE;AAClE,KAAK,KAAK,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAS3B,MAAM,WAAW,SAAU,SAAQ,wBAAwB,CAAC,GAAG,CAAC;IAC9D,sDAAsD;IACtD,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,mBAAmB;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sBAAsB;IACtB,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,sBAAsB;IACtB,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,kDAAkD;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,yCAAyC;IACzC,SAAS,CAAC,EAAE,KAAK,CA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K,EAAE,iBAAiB,+BAEpD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,+BAEnD;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,iBAAiB,+BAEnD;AAED,wBAAgB,UAAU,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,+BAUpE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/ui/atoms/text/text.tsx"],"sourcesContent":["import type { ComponentPropsWithoutRef, ElementType } from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\n/** Fluid type step (Utopia). Negatives taper below body for fine print. */\ntype Step = -2 | -1 | 0 | 1 | 2 | 3;\n\nconst STEP_CLASS: Record<Step, string> = {\n '-2': 'text-step-xs',\n '-1': 'text-step-sm',\n 0: 'text-step-0',\n 1: 'text-step-1',\n 2: 'text-step-2',\n 3: 'text-step-3',\n};\n\n/**\n * Three weights, and no fourth.\n *\n * 400 body, 500 secondary emphasis, 600 headings and labels. `bold` (700) was\n * removed: \"heading\" and \"emphatic heading\" were never distinct roles here,\n * only different authors — measured, `font-bold` appeared three times against\n * `font-semibold`'s thirteen, all of them headings that had no reason to differ\n * from their neighbours. A fourth weight comes back when a role needs it, not\n * when a screen wants one.\n */\ntype Weight = 'normal' | 'medium' | 'semibold';\n\nconst WEIGHT_CLASS: Record<Weight, string> = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n};\n\n/** Semantic content color. Superset of the legacy `muted` flag. */\ntype Tone = 'default' | 'muted' | 'primary' | 'accent';\n\nconst TONE_CLASS: Record<Tone, string> = {\n default: 'text-content',\n muted: 'text-content-muted',\n primary: 'text-primary',\n accent: 'text-accent',\n};\n\ntype Align = 'start' | 'center' | 'end';\n\nconst ALIGN_CLASS: Record<Align, string> = {\n start: 'text-left',\n center: 'text-center',\n end: 'text-right',\n};\n\n/** Multi-line clamp (static classes so Tailwind can see them). */\ntype Clamp = 1 | 2 | 3 | 4;\n\nconst CLAMP_CLASS: Record<Clamp, string> = {\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n 4: 'line-clamp-4',\n};\n\nexport interface TextProps extends ComponentPropsWithoutRef<'p'> {\n /** Fluid type step (Utopia). Defaults to body (0). */\n step?: Step;\n /** Font weight. */\n weight?: Weight;\n /** Semantic color. */\n tone?: Tone;\n /** Text alignment. */\n align?: Align;\n /** Truncate to a single line with an ellipsis. */\n truncate?: boolean;\n /** Clamp to N lines with an ellipsis. */\n lineClamp?: Clamp;\n /** Shortcut for `tone=\"muted\"`. */\n muted?: boolean;\n as?: ElementType;\n}\n\n/** Body text with fluid sizing and theme-driven color. */\nexport function Text({\n step = 0,\n weight,\n tone = 'default',\n align,\n truncate = false,\n lineClamp,\n muted = false,\n as: Tag = 'p',\n className,\n ...props\n}: TextProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n weight && WEIGHT_CLASS[weight],\n TONE_CLASS[muted ? 'muted' : tone],\n align && ALIGN_CLASS[align],\n truncate && 'truncate',\n lineClamp && CLAMP_CLASS[lineClamp],\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Larger intro paragraph — sets a subject up before the body copy. */\nexport function Lead({ className, ...props }: Omit<TextProps, 'step'>) {\n return (\n <Text\n step={1}\n tone=\"muted\"\n className={cn('max-w-prose leading-relaxed', className)}\n {...props}\n />\n );\n}\n\n/** Small supporting copy (helper text, meta). */\nexport function Small({ className, ...props }: Omit<TextProps, 'step' | 'as'>) {\n return <Text as=\"small\" step={-1} className={className} {...props} />;\n}\n\n/** Caption / fine print — smallest step, muted by default. */\nexport function Caption({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as'>) {\n return (\n <Text as=\"span\" step={-2} tone=\"muted\" className={className} {...props} />\n );\n}\n\n/** Overline / eyebrow — uppercase tracked label above a heading. */\nexport function Overline({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as' | 'weight'>) {\n return (\n <Text\n as=\"span\"\n step={-2}\n weight=\"semibold\"\n tone=\"muted\"\n className={cn('tracking-wide uppercase', className)}\n {...props}\n />\n );\n}\n\n/* ---------- Inline emphasis ---------- */\n\n/** Bold inline emphasis. */\nexport function Strong({\n className,\n ...props\n}: ComponentPropsWithoutRef<'strong'>) {\n return (\n <strong\n className={cn('font-semibold text-content', className)}\n {...props}\n />\n );\n}\n\n/** Italic inline emphasis. */\nexport function Em({ className, ...props }: ComponentPropsWithoutRef<'em'>) {\n return <em className={cn('italic', className)} {...props} />;\n}\n\n/** Inline code. */\nexport function Code({\n className,\n ...props\n}: ComponentPropsWithoutRef<'code'>) {\n return (\n <code\n className={cn(\n 'rounded-sm border border-border bg-surface px-2xs py-3xs',\n 'font-mono text-step-sm text-content tabular-nums',\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Keyboard key. */\nexport function Kbd({ className, ...props }: ComponentPropsWithoutRef<'kbd'>) {\n return (\n <kbd\n className={cn(\n 'inline-flex items-center rounded-md border border-border bg-surface-elevated',\n 'px-2xs py-3xs font-mono text-step-xs text-content-muted shadow-edge',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * {@link Link}'s styling on its own, for a host that renders its own link\n * component (a router's) and should still look like one.\n */\nexport const linkClassName = cn(\n 'font-medium text-primary underline underline-offset-2',\n 'transition-colors duration-200 ease-smooth hover:text-accent',\n 'focus-ring',\n);\n\n/** Themed anchor. */\nexport function Link({\n className,\n children,\n ...props\n}: ComponentPropsWithoutRef<'a'>) {\n return (\n <a className={cn(linkClassName, className)} {...props}>\n {children}\n </a>\n );\n}\n\n/* ---------- Block-level ---------- */\n\n/** Pull quote — left border + muted italic body. */\nexport function Blockquote({\n className,\n ...props\n}: ComponentPropsWithoutRef<'blockquote'>) {\n return (\n <blockquote\n className={cn(\n 'border-l-4 border-primary pl-s italic',\n 'text-step-1 text-content-muted',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface ListProps extends ComponentPropsWithoutRef<'ul'> {\n /** Render an ordered list (`<ol>`) with numeric markers. */\n ordered?: boolean;\n}\n\n/** Bulleted or numbered list with themed markers and fluid spacing. */\nexport function List({ ordered = false, className, ...props }: ListProps) {\n const Tag = ordered ? 'ol' : 'ul';\n return (\n <Tag\n className={cn(\n ordered ? 'list-decimal' : 'list-disc',\n 'ms-m flex flex-col gap-2xs text-step-0 text-content marker:text-content-muted',\n className,\n )}\n {...(props as ComponentPropsWithoutRef<'ol'>)}\n />\n );\n}\n\n/** List item — pairs with `List`. */\nexport function ListItem({\n className,\n ...props\n}: ComponentPropsWithoutRef<'li'>) {\n return <li className={cn('ps-2xs', className)} {...props} />;\n}\n\n/* ---------- Headings ---------- */\n\nexport interface HeadingProps extends ComponentPropsWithoutRef<'h2'> {\n step?: Step;\n weight?: Weight;\n as?: ElementType;\n}\n\n/** Heading primitive — fluid step + weight, defaults to the largest step. */\nexport function Heading({\n step = 3,\n weight = 'semibold',\n as: Tag = 'h2',\n className,\n ...props\n}: HeadingProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n WEIGHT_CLASS[weight],\n 'text-content',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Semantic heading components (h1–h6) mapped to the fluid type scale.\n * Sizes taper past the four Utopia steps by dropping weight for h5/h6.\n */\nexport type NamedHeadingProps = Omit<HeadingProps, 'as' | 'step'>;\n\nexport function HeadingOne(props: NamedHeadingProps) {\n return <Heading as=\"h1\" step={3} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingTwo(props: NamedHeadingProps) {\n return <Heading as=\"h2\" step={2} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingThree(props: NamedHeadingProps) {\n return <Heading as=\"h3\" step={1} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFour(props: NamedHeadingProps) {\n return <Heading as=\"h4\" step={0} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFive(props: NamedHeadingProps) {\n return <Heading as=\"h5\" step={0} weight=\"medium\" {...props} />;\n}\n\nexport function HeadingSix({ className, ...props }: NamedHeadingProps) {\n return (\n <Heading\n as=\"h6\"\n step={0}\n weight=\"medium\"\n className={cn('tracking-wide text-content-muted uppercase', className)}\n {...props}\n />\n );\n}\n"],"names":["cn","STEP_CLASS","WEIGHT_CLASS","normal","medium","semibold","TONE_CLASS","default","muted","primary","accent","ALIGN_CLASS","start","center","end","CLAMP_CLASS","Text","step","weight","tone","align","truncate","lineClamp","as","Tag","className","props","Lead","Small","Caption","Overline","Strong","strong","Em","em","Code","code","Kbd","kbd","linkClassName","Link","children","a","Blockquote","blockquote","List","ordered","ListItem","li","Heading","HeadingOne","HeadingTwo","HeadingThree","HeadingFour","HeadingFive","HeadingSix"],"mappings":";;;AAEA,SAASA,EAAE,QAAQ,oBAAoB;AAKvC,MAAMC,aAAmC;IACvC,MAAM;IACN,MAAM;IACN,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAcA,MAAMC,eAAuC;IAC3CC,QAAQ;IACRC,QAAQ;IACRC,UAAU;AACZ;AAKA,MAAMC,aAAmC;IACvCC,SAAS;IACTC,OAAO;IACPC,SAAS;IACTC,QAAQ;AACV;AAIA,MAAMC,cAAqC;IACzCC,OAAO;IACPC,QAAQ;IACRC,KAAK;AACP;AAKA,MAAMC,cAAqC;IACzC,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAoBA,wDAAwD,GACxD,OAAO,SAASC,KAAK,EAWT;QAXS,EACnBC,OAAO,CAAC,EACRC,MAAM,EACNC,OAAO,SAAS,EAChBC,KAAK,EACLC,WAAW,KAAK,EAChBC,SAAS,EACTd,QAAQ,KAAK,EACbe,IAAIC,MAAM,GAAG,EACbC,SAAS,EAEC,OADPC;;;;;;;;;;;IAEH,qBACE,KAACF;QACCC,WAAWzB,GACTC,UAAU,CAACgB,KAAK,EAChBC,UAAUhB,YAAY,CAACgB,OAAO,EAC9BZ,UAAU,CAACE,QAAQ,UAAUW,KAAK,EAClCC,SAAST,WAAW,CAACS,MAAM,EAC3BC,YAAY,YACZC,aAAaP,WAA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AG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAASyB,WAAWzB,KAAwB;IACjD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS0B,aAAa1B,KAAwB;IACnD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS2B,YAAY3B,KAAwB;IAClD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS4B,YAAY5B,KAAwB;IAClD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAaQ;AACvD;AAEA,OAAO,SAAS6B,WAAW,EAA0C;QAA1C,EAAE9B,SAAS,EAA+B,OAA1BC;;;IACzC,qBACE,KAACuB;QACC1B,IAAG;QACHN,MAAM;QACNC,QAAO;QACPO,WAAWzB,GAAG,8CAA8CyB;OACxDC;AAGV"}
1
+ {"version":3,"sources":["../../../../src/ui/atoms/text/text.tsx"],"sourcesContent":["import type {\n ComponentProps,\n ComponentPropsWithoutRef,\n ElementType,\n} from 'react';\n\nimport { cn } from '../../utils/cn.js';\n\n/** Fluid type step (Utopia). Negatives taper below body for fine print. */\ntype Step = -2 | -1 | 0 | 1 | 2 | 3;\n\nconst STEP_CLASS: Record<Step, string> = {\n '-2': 'text-step-xs',\n '-1': 'text-step-sm',\n 0: 'text-step-0',\n 1: 'text-step-1',\n 2: 'text-step-2',\n 3: 'text-step-3',\n};\n\n/**\n * Three weights, and no fourth.\n *\n * 400 body, 500 secondary emphasis, 600 headings and labels. `bold` (700) was\n * removed: \"heading\" and \"emphatic heading\" were never distinct roles here,\n * only different authors — measured, `font-bold` appeared three times against\n * `font-semibold`'s thirteen, all of them headings that had no reason to differ\n * from their neighbours. A fourth weight comes back when a role needs it, not\n * when a screen wants one.\n */\ntype Weight = 'normal' | 'medium' | 'semibold';\n\nconst WEIGHT_CLASS: Record<Weight, string> = {\n normal: 'font-normal',\n medium: 'font-medium',\n semibold: 'font-semibold',\n};\n\n/** Semantic content color. Superset of the legacy `muted` flag. */\ntype Tone = 'default' | 'muted' | 'primary' | 'accent';\n\nconst TONE_CLASS: Record<Tone, string> = {\n default: 'text-content',\n muted: 'text-content-muted',\n primary: 'text-primary',\n accent: 'text-accent',\n};\n\ntype Align = 'start' | 'center' | 'end';\n\nconst ALIGN_CLASS: Record<Align, string> = {\n start: 'text-left',\n center: 'text-center',\n end: 'text-right',\n};\n\n/** Multi-line clamp (static classes so Tailwind can see them). */\ntype Clamp = 1 | 2 | 3 | 4;\n\nconst CLAMP_CLASS: Record<Clamp, string> = {\n 1: 'line-clamp-1',\n 2: 'line-clamp-2',\n 3: 'line-clamp-3',\n 4: 'line-clamp-4',\n};\n\nexport interface TextProps extends ComponentProps<'p'> {\n /** Fluid type step (Utopia). Defaults to body (0). */\n step?: Step;\n /** Font weight. */\n weight?: Weight;\n /** Semantic color. */\n tone?: Tone;\n /** Text alignment. */\n align?: Align;\n /** Truncate to a single line with an ellipsis. */\n truncate?: boolean;\n /** Clamp to N lines with an ellipsis. */\n lineClamp?: Clamp;\n /** Shortcut for `tone=\"muted\"`. */\n muted?: boolean;\n as?: ElementType;\n}\n\n/** Body text with fluid sizing and theme-driven color. */\nexport function Text({\n step = 0,\n weight,\n tone = 'default',\n align,\n truncate = false,\n lineClamp,\n muted = false,\n as: Tag = 'p',\n className,\n ...props\n}: TextProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n weight && WEIGHT_CLASS[weight],\n TONE_CLASS[muted ? 'muted' : tone],\n align && ALIGN_CLASS[align],\n truncate && 'truncate',\n lineClamp && CLAMP_CLASS[lineClamp],\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Larger intro paragraph — sets a subject up before the body copy. */\nexport function Lead({ className, ...props }: Omit<TextProps, 'step'>) {\n return (\n <Text\n step={1}\n tone=\"muted\"\n className={cn('max-w-prose leading-relaxed', className)}\n {...props}\n />\n );\n}\n\n/** Small supporting copy (helper text, meta). */\nexport function Small({ className, ...props }: Omit<TextProps, 'step' | 'as'>) {\n return <Text as=\"small\" step={-1} className={className} {...props} />;\n}\n\n/** Caption / fine print — smallest step, muted by default. */\nexport function Caption({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as'>) {\n return (\n <Text as=\"span\" step={-2} tone=\"muted\" className={className} {...props} />\n );\n}\n\n/** Overline / eyebrow — uppercase tracked label above a heading. */\nexport function Overline({\n className,\n ...props\n}: Omit<TextProps, 'step' | 'as' | 'weight'>) {\n return (\n <Text\n as=\"span\"\n step={-2}\n weight=\"semibold\"\n tone=\"muted\"\n className={cn('tracking-wide uppercase', className)}\n {...props}\n />\n );\n}\n\n/* ---------- Inline emphasis ---------- */\n\n/** Bold inline emphasis. */\nexport function Strong({\n className,\n ...props\n}: ComponentPropsWithoutRef<'strong'>) {\n return (\n <strong\n className={cn('font-semibold text-content', className)}\n {...props}\n />\n );\n}\n\n/** Italic inline emphasis. */\nexport function Em({ className, ...props }: ComponentPropsWithoutRef<'em'>) {\n return <em className={cn('italic', className)} {...props} />;\n}\n\n/** Inline code. */\nexport function Code({\n className,\n ...props\n}: ComponentPropsWithoutRef<'code'>) {\n return (\n <code\n className={cn(\n 'rounded-sm border border-border bg-surface px-2xs py-3xs',\n 'font-mono text-step-sm text-content tabular-nums',\n className,\n )}\n {...props}\n />\n );\n}\n\n/** Keyboard key. */\nexport function Kbd({ className, ...props }: ComponentPropsWithoutRef<'kbd'>) {\n return (\n <kbd\n className={cn(\n 'inline-flex items-center rounded-md border border-border bg-surface-elevated',\n 'px-2xs py-3xs font-mono text-step-xs text-content-muted shadow-edge',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * {@link Link}'s styling on its own, for a host that renders its own link\n * component (a router's) and should still look like one.\n */\nexport const linkClassName = cn(\n 'font-medium text-primary underline underline-offset-2',\n 'transition-colors duration-200 ease-smooth hover:text-accent',\n 'focus-ring',\n);\n\n/** Themed anchor. */\nexport function Link({\n className,\n children,\n ...props\n}: ComponentPropsWithoutRef<'a'>) {\n return (\n <a className={cn(linkClassName, className)} {...props}>\n {children}\n </a>\n );\n}\n\n/* ---------- Block-level ---------- */\n\n/** Pull quote — left border + muted italic body. */\nexport function Blockquote({\n className,\n ...props\n}: ComponentPropsWithoutRef<'blockquote'>) {\n return (\n <blockquote\n className={cn(\n 'border-l-4 border-primary pl-s italic',\n 'text-step-1 text-content-muted',\n className,\n )}\n {...props}\n />\n );\n}\n\nexport interface ListProps extends ComponentPropsWithoutRef<'ul'> {\n /** Render an ordered list (`<ol>`) with numeric markers. */\n ordered?: boolean;\n}\n\n/** Bulleted or numbered list with themed markers and fluid spacing. */\nexport function List({ ordered = false, className, ...props }: ListProps) {\n const Tag = ordered ? 'ol' : 'ul';\n return (\n <Tag\n className={cn(\n ordered ? 'list-decimal' : 'list-disc',\n 'ms-m flex flex-col gap-2xs text-step-0 text-content marker:text-content-muted',\n className,\n )}\n {...(props as ComponentPropsWithoutRef<'ol'>)}\n />\n );\n}\n\n/** List item — pairs with `List`. */\nexport function ListItem({\n className,\n ...props\n}: ComponentPropsWithoutRef<'li'>) {\n return <li className={cn('ps-2xs', className)} {...props} />;\n}\n\n/* ---------- Headings ---------- */\n\nexport interface HeadingProps extends ComponentPropsWithoutRef<'h2'> {\n step?: Step;\n weight?: Weight;\n as?: ElementType;\n}\n\n/** Heading primitive — fluid step + weight, defaults to the largest step. */\nexport function Heading({\n step = 3,\n weight = 'semibold',\n as: Tag = 'h2',\n className,\n ...props\n}: HeadingProps) {\n return (\n <Tag\n className={cn(\n STEP_CLASS[step],\n WEIGHT_CLASS[weight],\n 'text-content',\n className,\n )}\n {...props}\n />\n );\n}\n\n/**\n * Semantic heading components (h1–h6) mapped to the fluid type scale.\n * Sizes taper past the four Utopia steps by dropping weight for h5/h6.\n */\nexport type NamedHeadingProps = Omit<HeadingProps, 'as' | 'step'>;\n\nexport function HeadingOne(props: NamedHeadingProps) {\n return <Heading as=\"h1\" step={3} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingTwo(props: NamedHeadingProps) {\n return <Heading as=\"h2\" step={2} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingThree(props: NamedHeadingProps) {\n return <Heading as=\"h3\" step={1} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFour(props: NamedHeadingProps) {\n return <Heading as=\"h4\" step={0} weight=\"semibold\" {...props} />;\n}\n\nexport function HeadingFive(props: NamedHeadingProps) {\n return <Heading as=\"h5\" step={0} weight=\"medium\" {...props} />;\n}\n\nexport function HeadingSix({ className, ...props }: NamedHeadingProps) {\n return (\n <Heading\n as=\"h6\"\n step={0}\n weight=\"medium\"\n className={cn('tracking-wide text-content-muted uppercase', className)}\n {...props}\n />\n );\n}\n"],"names":["cn","STEP_CLASS","WEIGHT_CLASS","normal","medium","semibold","TONE_CLASS","default","muted","primary","accent","ALIGN_CLASS","start","center","end","CLAMP_CLASS","Text","step","weight","tone","align","truncate","lineClamp","as","Tag","className","props","Lead","Small","Caption","Overline","Strong","strong","Em","em","Code","code","Kbd","kbd","linkClassName","Link","children","a","Blockquote","blockquote","List","ordered","ListItem","li","Heading","HeadingOne","HeadingTwo","HeadingThree","HeadingFour","HeadingFive","HeadingSix"],"mappings":";;;AAMA,SAASA,EAAE,QAAQ,oBAAoB;AAKvC,MAAMC,aAAmC;IACvC,MAAM;IACN,MAAM;IACN,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;AACL;AAcA,MAAMC,eAAuC;IAC3CC,QAAQ;IACRC,QAAQ;IACRC,UAAU;AACZ;AAKA,MAAMC,aAAmC;IACvCC,SAAS;IACTC,OAAO;IACPC,SAAS;IACTC,QAAQ;AACV;AAIA,MAAMC,cAAqC;IACzCC,OAAO;IACPC,QAAQ;IACRC,KAAK;AACP;AAKA,MAAMC,cAAqC;IACzC,GAAG;IACH,GAAG;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AASqB,SAAS,EAGQ;QAHR,EACvBtB,SAAS,EAEsB,OAD5BC;;;IAEH,qBAAO,KAACsB;QAAGvB,WAAWzB,GAAG,UAAUyB;OAAgBC;AACrD;AAUA,2EAA2E,GAC3E,OAAO,SAASuB,QAAQ,EAMT;QANS,EACtBhC,OAAO,CAAC,EACRC,SAAS,UAAU,EACnBK,IAAIC,MAAM,IAAI,EACdC,SAAS,EAEI,OADVC;;;;;;IAEH,qBACE,KAACF;QACCC,WAAWzB,GACTC,UAAU,CAACgB,KAAK,EAChBf,YAAY,CAACgB,OAAO,EACpB,gBACAO;OAEEC;AAGV;AAQA,OAAO,SAASwB,WAAWxB,KAAwB;IACjD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAASyB,WAAWzB,KAAwB;IACjD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS0B,aAAa1B,KAAwB;IACnD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS2B,YAAY3B,KAAwB;IAClD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAeQ;AACzD;AAEA,OAAO,SAAS4B,YAAY5B,KAAwB;IAClD,qBAAO,KAACuB;QAAQ1B,IAAG;QAAKN,MAAM;QAAGC,QAAO;OAAaQ;AACvD;AAEA,OAAO,SAAS6B,WAAW,EAA0C;QAA1C,EAAE9B,SAAS,EAA+B,OAA1BC;;;IACzC,qBACE,KAACuB;QACC1B,IAAG;QACHN,MAAM;QACNC,QAAO;QACPO,WAAWzB,GAAG,8CAA8CyB;OACxDC;AAGV"}
@@ -0,0 +1,76 @@
1
+ import type { UseCaseDescriptor } from '@entifix/core';
2
+ import { type ActionSurface, type NavigationIntent, type RenderLink } from '../../actions/index.js';
3
+ /** Every surface an {@link ActionBar} renders: the palette lists, it does not render a bar. */
4
+ export type ActionBarSurface = Exclude<ActionSurface, 'command-palette'>;
5
+ /** How many secondaries stay visible beside the primary before the rest fold. */
6
+ export declare const VISIBLE_SECONDARIES = 3;
7
+ /** One action in a bar: a declared verb, or one the surface brings itself (Save, New). */
8
+ export interface ActionBarItem {
9
+ readonly key: string;
10
+ /** Already in the reader's language. */
11
+ readonly label: string;
12
+ readonly emphasis?: 'primary' | 'default';
13
+ /** Order among the secondaries, lowest first; absent keeps the given order. */
14
+ readonly priority?: number;
15
+ readonly destructive?: boolean;
16
+ /** Shown on a row itself rather than only in its menu. */
17
+ readonly rowInline?: boolean;
18
+ readonly shortcut?: string;
19
+ readonly disabled?: boolean;
20
+ /**
21
+ * An action that navigates rather than acts — a list's "New". It is never
22
+ * folded into a menu, whatever its emphasis: a menu entry is a button, and a
23
+ * link must stay a link so it can be opened in a new tab.
24
+ */
25
+ readonly href?: string;
26
+ /** What the link means, for a host that answers navigation itself. */
27
+ readonly intent?: NavigationIntent;
28
+ readonly onSelect?: () => void;
29
+ /**
30
+ * Submits the form the bar sits in — a form's Save — so Enter in a field
31
+ * saves too. As a button it leaves the act to the form's submit handler; in
32
+ * a menu, where a menu item cannot submit, it runs `onSelect`.
33
+ */
34
+ readonly submit?: boolean;
35
+ }
36
+ export interface ActionBarProps {
37
+ readonly surface: ActionBarSurface;
38
+ readonly items: readonly ActionBarItem[];
39
+ /**
40
+ * The overflow trigger's name. Defaults to "More actions"; a row passes
41
+ * "Actions for {record}", so a list of rows is not a list of identical
42
+ * buttons.
43
+ */
44
+ readonly menuLabel?: string;
45
+ readonly size?: 'sm' | 'md';
46
+ readonly renderLink?: RenderLink;
47
+ readonly className?: string;
48
+ }
49
+ /**
50
+ * The bar items for declared verbs: label translated, weight and order carried
51
+ * from the descriptor, every one routed through `onSelect` — which is where a
52
+ * surface's `invoke()` asks for a confirmation, so no surface can reach a verb
53
+ * around it.
54
+ */
55
+ export declare function itemsForUseCases(descriptors: readonly UseCaseDescriptor[], translate: (key: string) => string, onSelect: (descriptor: UseCaseDescriptor) => void, disabled?: boolean): ActionBarItem[];
56
+ /**
57
+ * One way every surface renders its verbs
58
+ * ([ADR 0026](../../../../../../../docs/adr/0026-actions-hierarchy-overflow-and-destructive-verbs.md)):
59
+ * the primary, then up to {@link VISIBLE_SECONDARIES} secondaries, then a
60
+ * "More actions" menu button holding the rest — destructive verbs last, after
61
+ * a separator.
62
+ *
63
+ * ⚠️ **It collapses by container, not by viewport.** Below the container's
64
+ * `md` width it renders the primary and one menu holding every secondary; a
65
+ * bar inside a split view or a drawer is as narrow as its container, whatever
66
+ * the window is. Both arrangements are in the DOM and CSS shows one, so the
67
+ * server renders the right one with no measurement.
68
+ *
69
+ * A row renders differently: the verb it declares `rowInline` sits on the row,
70
+ * and everything else is in one menu named for the record.
71
+ *
72
+ * It throws on a second primary, and on a destructive primary on a page
73
+ * surface — both are declarations no rendering can make sensible.
74
+ */
75
+ export declare function ActionBar({ surface, items, menuLabel, size, renderLink, className, }: ActionBarProps): import("react").JSX.Element;
76
+ //# sourceMappingURL=action-bar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-bar.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/action-bar/action-bar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAIvD,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,gBAAgB,EAGrB,KAAK,UAAU,EAChB,MAAM,wBAAwB,CAAC;AAOhC,+FAA+F;AAC/F,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAC;AAczE,iFAAiF;AACjF,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAErC,0FAA0F;AAC1F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wCAAwC;IACxC,QAAQ,CAAC,K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;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,SAAS,CAAC,EACxB,OAAO,EACP,KAAK,EACL,SAAS,EACT,IAAW,EACX,UAAyB,EACzB,SAAS,GACV,EAAE,cAAc,+BAoIhB"}
@@ -0,0 +1,218 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Fragment } from 'react';
4
+ import { useT } from '../../../i18n/index.js';
5
+ import { OVERFLOW_GLYPH, renderAnchor } from '../../actions/index.js';
6
+ import { ariaKeyShortcuts } from '../../actions/shortcut.js';
7
+ import { Button, button } from '../../atoms/button/index.js';
8
+ import { cn } from '../../utils/cn.js';
9
+ import { useHotkey } from '../../utils/use-hotkey.js';
10
+ import { Menu } from '../menu/index.js';
11
+ /**
12
+ * Surfaces that are a **page** — a record's header and footer, a list's
13
+ * toolbar. A destructive verb is never the primary there: the thing a page is
14
+ * for is not destroying it. A selection's bar and a row are not pages, and
15
+ * deleting what was selected may well be what the bar is for.
16
+ */ const PAGE_SURFACES = new Set([
17
+ 'form-header',
18
+ 'form-footer',
19
+ 'table-toolbar'
20
+ ]);
21
+ /** How many secondaries stay visible beside the primary before the rest fold. */ export const VISIBLE_SECONDARIES = 3;
22
+ /**
23
+ * The bar items for declared verbs: label translated, weight and order carried
24
+ * from the descriptor, every one routed through `onSelect` — which is where a
25
+ * surface's `invoke()` asks for a confirmation, so no surface can reach a verb
26
+ * around it.
27
+ */ export function itemsForUseCases(descriptors, translate, onSelect, disabled = false) {
28
+ return descriptors.map((descriptor)=>{
29
+ var _descriptor_confirm;
30
+ return {
31
+ key: descriptor.key,
32
+ label: translate(descriptor.labelKey),
33
+ emphasis: descriptor.emphasis,
34
+ priority: descriptor.priority,
35
+ destructive: ((_descriptor_confirm = descriptor.confirm) == null ? void 0 : _descriptor_confirm.tone) === 'destructive',
36
+ rowInline: descriptor.rowInline === true,
37
+ shortcut: descriptor.shortcut,
38
+ disabled,
39
+ onSelect: ()=>onSelect(descriptor)
40
+ };
41
+ });
42
+ }
43
+ /**
44
+ * Secondaries in the order they render: by priority, then as given, with the
45
+ * destructive ones last so a separator can stand between "do" and "destroy".
46
+ */ function ordered(items) {
47
+ const ranked = items.map((item, index)=>({
48
+ item,
49
+ index
50
+ })).sort((a, b)=>{
51
+ var _a_item_priority, _b_item_priority;
52
+ return ((_a_item_priority = a.item.priority) != null ? _a_item_priority : Infinity) - ((_b_item_priority = b.item.priority) != null ? _b_item_priority : Infinity) || a.index - b.index;
53
+ }).map(({ item })=>item);
54
+ return [
55
+ ...ranked.filter((item)=>!item.destructive),
56
+ ...ranked.filter((item)=>item.destructive)
57
+ ];
58
+ }
59
+ function assertHierarchy(surface, items) {
60
+ const primaries = items.filter((item)=>item.emphasis === 'primary');
61
+ if (primaries.length > 1) {
62
+ throw new Error(`The ${surface} surface has ${primaries.length} primary actions (${primaries.map((item)=>item.key).join(', ')}). A surface has one thing it is for: declare one primary and give the rest the default emphasis.`);
63
+ }
64
+ const [primary] = primaries;
65
+ if ((primary == null ? void 0 : primary.destructive) && PAGE_SURFACES.has(surface)) {
66
+ throw new Error(`"${primary.key}" is destructive and declared primary on ${surface}. A page is never for destroying itself: give it the default emphasis, and it renders last, after a separator.`);
67
+ }
68
+ return primary;
69
+ }
70
+ /**
71
+ * One way every surface renders its verbs
72
+ * ([ADR 0026](../../../../../../../docs/adr/0026-actions-hierarchy-overflow-and-destructive-verbs.md)):
73
+ * the primary, then up to {@link VISIBLE_SECONDARIES} secondaries, then a
74
+ * "More actions" menu button holding the rest — destructive verbs last, after
75
+ * a separator.
76
+ *
77
+ * ⚠️ **It collapses by container, not by viewport.** Below the container's
78
+ * `md` width it renders the primary and one menu holding every secondary; a
79
+ * bar inside a split view or a drawer is as narrow as its container, whatever
80
+ * the window is. Both arrangements are in the DOM and CSS shows one, so the
81
+ * server renders the right one with no measurement.
82
+ *
83
+ * A row renders differently: the verb it declares `rowInline` sits on the row,
84
+ * and everything else is in one menu named for the record.
85
+ *
86
+ * It throws on a second primary, and on a destructive primary on a page
87
+ * surface — both are declarations no rendering can make sensible.
88
+ */ export function ActionBar({ surface, items, menuLabel, size = 'sm', renderLink = renderAnchor, className }) {
89
+ const t = useT();
90
+ const primary = assertHierarchy(surface, items);
91
+ // A row's verbs are bound nowhere — every row would claim the same chord —
92
+ // so they advertise none. Every other surface binds what it advertises.
93
+ const bindsShortcuts = surface !== 'row-menu';
94
+ const keyShortcuts = (item)=>bindsShortcuts && item.shortcut !== undefined ? ariaKeyShortcuts(item.shortcut) : undefined;
95
+ const label = menuLabel != null ? menuLabel : t('actions.more');
96
+ const asButton = (item, variant)=>{
97
+ var _item_intent;
98
+ return item.href === undefined ? /*#__PURE__*/ _jsx(Button, {
99
+ type: item.submit ? 'submit' : 'button',
100
+ variant: item.destructive ? 'destructive' : variant,
101
+ size: size,
102
+ disabled: item.disabled,
103
+ "aria-keyshortcuts": keyShortcuts(item),
104
+ onClick: item.submit ? undefined : item.onSelect,
105
+ children: item.label
106
+ }, item.key) : /*#__PURE__*/ _jsx("span", {
107
+ className: "contents",
108
+ children: renderLink({
109
+ href: item.href,
110
+ className: button({
111
+ variant,
112
+ size
113
+ }),
114
+ children: item.label,
115
+ intent: (_item_intent = item.intent) != null ? _item_intent : {
116
+ kind: 'new'
117
+ }
118
+ })
119
+ }, item.key);
120
+ };
121
+ const menu = (folded, key)=>{
122
+ if (folded.length === 0) return undefined;
123
+ const firstDestructive = folded.findIndex((item)=>item.destructive);
124
+ return /*#__PURE__*/ _jsxs(Menu, {
125
+ children: [
126
+ /*#__PURE__*/ _jsx(Menu.Trigger, {
127
+ "aria-label": label,
128
+ title: label,
129
+ children: OVERFLOW_GLYPH
130
+ }),
131
+ /*#__PURE__*/ _jsx(Menu.Items, {
132
+ children: folded.map((item, index)=>/*#__PURE__*/ _jsxs(Fragment, {
133
+ children: [
134
+ index > 0 && index === firstDestructive && /*#__PURE__*/ _jsx(Menu.Separator, {}),
135
+ /*#__PURE__*/ _jsx(Menu.Item, {
136
+ tone: item.destructive ? 'destructive' : 'neutral',
137
+ disabled: item.disabled,
138
+ "aria-keyshortcuts": keyShortcuts(item),
139
+ onClick: item.onSelect,
140
+ children: item.label
141
+ })
142
+ ]
143
+ }, item.key))
144
+ })
145
+ ]
146
+ }, key);
147
+ };
148
+ if (surface === 'row-menu') {
149
+ const inline = items.filter((item)=>item.rowInline);
150
+ return /*#__PURE__*/ _jsxs("span", {
151
+ className: cn('flex items-center gap-2xs', className),
152
+ children: [
153
+ inline.map((item)=>asButton(item, 'secondary')),
154
+ menu(ordered(items.filter((item)=>!item.rowInline)), 'row')
155
+ ]
156
+ });
157
+ }
158
+ const links = items.filter((item)=>item !== primary && item.href !== undefined);
159
+ const secondaries = ordered(items.filter((item)=>item !== primary && item.href === undefined));
160
+ const visible = secondaries.slice(0, VISIBLE_SECONDARIES);
161
+ const separatorAt = visible.findIndex((item)=>item.destructive);
162
+ // A menu holding one entry is strictly worse than the button it replaced.
163
+ const collapses = secondaries.length > 1;
164
+ return /*#__PURE__*/ _jsxs("div", {
165
+ className: cn('min-w-0 @container/actions flex-1', className),
166
+ "data-surface": surface,
167
+ children: [
168
+ items.map((item)=>item.shortcut === undefined || item.onSelect === undefined || item.href !== undefined ? null : /*#__PURE__*/ _jsx(ItemShortcut, {
169
+ chord: item.shortcut,
170
+ onSelect: item.onSelect,
171
+ enabled: item.disabled !== true
172
+ }, item.key)),
173
+ /*#__PURE__*/ _jsxs("div", {
174
+ className: "flex flex-wrap items-center gap-2xs",
175
+ children: [
176
+ primary && asButton(primary, 'primary'),
177
+ links.map((item)=>asButton(item, 'secondary')),
178
+ /*#__PURE__*/ _jsxs("div", {
179
+ className: cn('flex-wrap items-center gap-2xs', collapses ? '@md/actions:flex hidden' : 'flex'),
180
+ "data-arrangement": "wide",
181
+ children: [
182
+ visible.map((item, index)=>/*#__PURE__*/ _jsxs("span", {
183
+ className: "contents",
184
+ children: [
185
+ index > 0 && index === separatorAt && /*#__PURE__*/ _jsx("span", {
186
+ "aria-hidden": "true",
187
+ className: "w-px self-stretch bg-border"
188
+ }),
189
+ asButton(item, 'secondary')
190
+ ]
191
+ }, item.key)),
192
+ menu(secondaries.slice(VISIBLE_SECONDARIES), 'overflow')
193
+ ]
194
+ }),
195
+ collapses && /*#__PURE__*/ _jsx("div", {
196
+ className: "@md/actions:hidden flex",
197
+ "data-arrangement": "narrow",
198
+ children: menu(secondaries, 'collapsed')
199
+ })
200
+ ]
201
+ })
202
+ ]
203
+ });
204
+ }
205
+ /**
206
+ * Binds one item's shortcut for as long as the bar shows it — yielding to a
207
+ * binding already there, so a host's own chord wins over a surface's default.
208
+ */ function ItemShortcut({ chord, onSelect, enabled }) {
209
+ useHotkey([
210
+ chord
211
+ ], onSelect, {
212
+ enabled,
213
+ ifFree: true
214
+ });
215
+ return null;
216
+ }
217
+
218
+ //# sourceMappingURL=action-bar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/action-bar/action-bar.tsx"],"sourcesContent":["'use client';\n\nimport type { UseCaseDescriptor } from '@entifix/core';\nimport { Fragment, type ReactNode } from 'react';\n\nimport { useT } from '../../../i18n/index.js';\nimport {\n type ActionSurface,\n type NavigationIntent,\n OVERFLOW_GLYPH,\n renderAnchor,\n type RenderLink,\n} from '../../actions/index.js';\nimport { ariaKeyShortcuts } from '../../actions/shortcut.js';\nimport { Button, button } from '../../atoms/button/index.js';\nimport { cn } from '../../utils/cn.js';\nimport { useHotkey } from '../../utils/use-hotkey.js';\nimport { Menu } from '../menu/index.js';\n\n/** Every surface an {@link ActionBar} renders: the palette lists, it does not render a bar. */\nexport type ActionBarSurface = Exclude<ActionSurface, 'command-palette'>;\n\n/**\n * Surfaces that are a **page** — a record's header and footer, a list's\n * toolbar. A destructive verb is never the primary there: the thing a page is\n * for is not destroying it. A selection's bar and a row are not pages, and\n * deleting what was selected may well be what the bar is for.\n */\nconst PAGE_SURFACES: ReadonlySet<ActionBarSurface> = new Set([\n 'form-header',\n 'form-footer',\n 'table-toolbar',\n]);\n\n/** How many secondaries stay visible beside the primary before the rest fold. */\nexport const VISIBLE_SECONDARIES = 3;\n\n/** One action in a bar: a declared verb, or one the surface brings itself (Save, New). */\nexport interface ActionBarItem {\n readonly key: string;\n /** Already in the reader's language. */\n readonly label: string;\n readonly emphasis?: 'primary' | 'default';\n /** Order among the secondaries, lowest first; absent keeps the given order. */\n readonly priority?: number;\n readonly destructive?: boolean;\n /** Shown on a row itself rather than only in its menu. */\n readonly rowInline?: boolean;\n readonly shortcut?: string;\n readonly disabled?: boolean;\n /**\n * An action that navigates rather than acts — a list's \"New\". It is never\n * folded into a menu, whatever its emphasis: a menu entry is a button, and a\n * link must stay a link so it can be opened in a new tab.\n */\n readonly href?: string;\n /** What the link means, for a host that answers navigation itself. */\n readonly intent?: NavigationIntent;\n readonly onSelect?: () => void;\n /**\n * Submits the form the bar sits in — a form's Save — so Enter in a field\n * saves too. As a button it leaves the act to the form's submit handler; in\n * a menu, where a menu item cannot submit, it runs `onSelect`.\n */\n readonly submit?: boolean;\n}\n\nexport interface ActionBarProps {\n readonly surface: ActionBarSurface;\n readonly items: readonly ActionBarItem[];\n /**\n * The overflow trigger's name. Defaults to \"More actions\"; a row passes\n * \"Actions for {record}\", so a list of rows is not a list of identical\n * buttons.\n */\n readonly menuLabel?: string;\n readonly size?: 'sm' | 'md';\n readonly renderLink?: RenderLink;\n readonly className?: string;\n}\n\n/**\n * The bar items for declared verbs: label translated, weight and order carried\n * from the descriptor, every one routed through `onSelect` — which is where a\n * surface's `invoke()` asks for a confirmation, so no surface can reach a verb\n * around it.\n */\nexport function itemsForUseCases(\n descriptors: readonly UseCaseDescriptor[],\n translate: (key: string) => string,\n onSelect: (descriptor: UseCaseDescriptor) => void,\n disabled = false,\n): ActionBarItem[] {\n return descriptors.map(descriptor => ({\n key: descriptor.key,\n label: translate(descriptor.labelKey),\n emphasis: descriptor.emphasis,\n priority: descriptor.priority,\n destructive: descriptor.confirm?.tone === 'destructive',\n rowInline: descriptor.rowInline === true,\n shortcut: descriptor.shortcut,\n disabled,\n onSelect: () => onSelect(descriptor),\n }));\n}\n\n/**\n * Secondaries in the order they render: by priority, then as given, with the\n * destructive ones last so a separator can stand between \"do\" and \"destroy\".\n */\nfunction ordered(items: readonly ActionBarItem[]): ActionBarItem[] {\n const ranked = items\n .map((item, index) => ({ item, index }))\n .sort(\n (a, b) =>\n (a.item.priority ?? Infinity) - (b.item.priority ?? Infinity) ||\n a.index - b.index,\n )\n .map(({ item }) => item);\n return [\n ...ranked.filter(item => !item.destructive),\n ...ranked.filter(item => item.destructive),\n ];\n}\n\nfunction assertHierarchy(\n surface: ActionBarSurface,\n items: readonly ActionBarItem[],\n): ActionBarItem | undefined {\n const primaries = items.filter(item => item.emphasis === 'primary');\n if (primaries.length > 1) {\n throw new Error(\n `The ${surface} surface has ${primaries.length} primary actions (${primaries\n .map(item => item.key)\n .join(\n ', ',\n )}). A surface has one thing it is for: declare one primary and give the rest the default emphasis.`,\n );\n }\n const [primary] = primaries;\n if (primary?.destructive && PAGE_SURFACES.has(surface)) {\n throw new Error(\n `\"${primary.key}\" is destructive and declared primary on ${surface}. A page is never for destroying itself: give it the default emphasis, and it renders last, after a separator.`,\n );\n }\n return primary;\n}\n\n/**\n * One way every surface renders its verbs\n * ([ADR 0026](../../../../../../../docs/adr/0026-actions-hierarchy-overflow-and-destructive-verbs.md)):\n * the primary, then up to {@link VISIBLE_SECONDARIES} secondaries, then a\n * \"More actions\" menu button holding the rest — destructive verbs last, after\n * a separator.\n *\n * ⚠️ **It collapses by container, not by viewport.** Below the container's\n * `md` width it renders the primary and one menu holding every secondary; a\n * bar inside a split view or a drawer is as narrow as its container, whatever\n * the window is. Both arrangements are in the DOM and CSS shows one, so the\n * server renders the right one with no measurement.\n *\n * A row renders differently: the verb it declares `rowInline` sits on the row,\n * and everything else is in one menu named for the record.\n *\n * It throws on a second primary, and on a destructive primary on a page\n * surface — both are declarations no rendering can make sensible.\n */\nexport function ActionBar({\n surface,\n items,\n menuLabel,\n size = 'sm',\n renderLink = renderAnchor,\n className,\n}: ActionBarProps) {\n const t = useT();\n const primary = assertHierarchy(surface, items);\n // A row's verbs are bound nowhere — every row would claim the same chord —\n // so they advertise none. Every other surface binds what it advertises.\n const bindsShortcuts = surface !== 'row-menu';\n const keyShortcuts = (item: ActionBarItem) =>\n bindsShortcuts && item.shortcut !== undefined\n ? ariaKeyShortcuts(item.shortcut)\n : undefined;\n const label = menuLabel ?? t('actions.more');\n\n const asButton = (item: ActionBarItem, variant: 'primary' | 'secondary') =>\n item.href === undefined ? (\n <Button\n key={item.key}\n type={item.submit ? 'submit' : 'button'}\n variant={item.destructive ? 'destructive' : variant}\n size={size}\n disabled={item.disabled}\n aria-keyshortcuts={keyShortcuts(item)}\n onClick={item.submit ? undefined : item.onSelect}\n >\n {item.label}\n </Button>\n ) : (\n <span key={item.key} className=\"contents\">\n {renderLink({\n href: item.href,\n className: button({ variant, size }),\n children: item.label,\n intent: item.intent ?? { kind: 'new' },\n })}\n </span>\n );\n\n const menu = (folded: readonly ActionBarItem[], key: string): ReactNode => {\n if (folded.length === 0) return undefined;\n const firstDestructive = folded.findIndex(item => item.destructive);\n return (\n <Menu key={key}>\n <Menu.Trigger aria-label={label} title={label}>\n {OVERFLOW_GLYPH}\n </Menu.Trigger>\n <Menu.Items>\n {folded.map((item, index) => (\n <Fragment key={item.key}>\n {index > 0 && index === firstDestructive && <Menu.Separator />}\n <Menu.Item\n tone={item.destructive ? 'destructive' : 'neutral'}\n disabled={item.disabled}\n aria-keyshortcuts={keyShortcuts(item)}\n onClick={item.onSelect}\n >\n {item.label}\n </Menu.Item>\n </Fragment>\n ))}\n </Menu.Items>\n </Menu>\n );\n };\n\n if (surface === 'row-menu') {\n const inline = items.filter(item => item.rowInline);\n return (\n <span className={cn('flex items-center gap-2xs', className)}>\n {inline.map(item => asButton(item, 'secondary'))}\n {menu(ordered(items.filter(item => !item.rowInline)), 'row')}\n </span>\n );\n }\n\n const links = items.filter(\n item => item !== primary && item.href !== undefined,\n );\n const secondaries = ordered(\n items.filter(item => item !== primary && item.href === undefined),\n );\n const visible = secondaries.slice(0, VISIBLE_SECONDARIES);\n const separatorAt = visible.findIndex(item => item.destructive);\n // A menu holding one entry is strictly worse than the button it replaced.\n const collapses = secondaries.length > 1;\n\n return (\n <div\n className={cn('min-w-0 @container/actions flex-1', className)}\n data-surface={surface}\n >\n {items.map(item =>\n item.shortcut === undefined ||\n item.onSelect === undefined ||\n item.href !== undefined ? null : (\n <ItemShortcut\n key={item.key}\n chord={item.shortcut}\n onSelect={item.onSelect}\n enabled={item.disabled !== true}\n />\n ),\n )}\n <div className=\"flex flex-wrap items-center gap-2xs\">\n {primary && asButton(primary, 'primary')}\n {links.map(item => asButton(item, 'secondary'))}\n <div\n className={cn(\n 'flex-wrap items-center gap-2xs',\n collapses ? '@md/actions:flex hidden' : 'flex',\n )}\n data-arrangement=\"wide\"\n >\n {visible.map((item, index) => (\n <span key={item.key} className=\"contents\">\n {index > 0 && index === separatorAt && (\n <span\n aria-hidden=\"true\"\n className=\"w-px self-stretch bg-border\"\n />\n )}\n {asButton(item, 'secondary')}\n </span>\n ))}\n {menu(secondaries.slice(VISIBLE_SECONDARIES), 'overflow')}\n </div>\n {collapses && (\n <div className=\"@md/actions:hidden flex\" data-arrangement=\"narrow\">\n {menu(secondaries, 'collapsed')}\n </div>\n )}\n </div>\n </div>\n );\n}\n\n/**\n * Binds one item's shortcut for as long as the bar shows it — yielding to a\n * binding already there, so a host's own chord wins over a surface's default.\n */\nfunction ItemShortcut({\n chord,\n onSelect,\n enabled,\n}: {\n chord: string;\n onSelect: () => void;\n enabled: boolean;\n}) {\n useHotkey([chord], onSelect, { enabled, ifFree: true });\n return null;\n}\n"],"names":["Fragment","useT","OVERFLOW_GLYPH","renderAnchor","ariaKeyShortcuts","Button","button","cn","useHotkey","Menu","PAGE_SURFACES","Set","VISIBLE_SECONDARIES","itemsForUseCases","descriptors","translate","onSelect","disabled","map","descriptor","key","label","labelKey","emphasis","priority","destructive","confirm","tone","rowInline","shortcut","ordered","items","ranked","item","index","sort","a","b","Infinity","filter","assertHierarchy","surface","primaries","length","Error","join","primary","has","ActionBar","menuLabel","size","renderLink","className","t","bindsShortcuts","keyShortcuts","undefined","asButton","variant","href","type","submit","aria-keyshortcuts","onClick","span","children","intent","kind","menu","folded","firstDestructive","findIndex","Trigger","aria-label","title","Items","Separator","Item","inline","links","secondaries","visible","slice","separatorAt","collapses","div","data-surface","ItemShortcut","chord","enabled","data-arrangement","aria-hidden","ifFree"],"mappings":"AAAA;;AAGA,SAASA,QAAQ,QAAwB,QAAQ;AAEjD,SAASC,IAAI,QAAQ,yBAAyB;AAC9C,SAGEC,cAAc,EACdC,YAAY,QAEP,yBAAyB;AAChC,SAASC,gBAAgB,QAAQ,4BAA4B;AAC7D,SAASC,MAAM,EAAEC,MAAM,QAAQ,8BAA8B;AAC7D,SAASC,EAAE,QAAQ,oBAAoB;AACvC,SAASC,SAAS,QAAQ,4BAA4B;AACtD,SAASC,IAAI,QAAQ,mBAAmB;AAKxC;;;;;CAKC,GACD,MAAMC,gBAA+C,IAAIC,IAAI;IAC3D;IACA;IACA;CACD;AAED,+EAA+E,GAC/E,OAAO,MAAMC,sBAAsB,EAAE;AA8CrC;;;;;CAKC,GACD,OAAO,SAASC,iBACdC,WAAyC,EACzCC,SAAkC,EAClCC,QAAiD,EACjDC,WAAW,KAAK;IAEhB,OAAOH,YAAYI,GAAG,CAACC,CAAAA;YAKRA;eALuB;YACpCC,KAAKD,WAAWC,GAAG;YACnBC,OAAON,UAAUI,WAAWG,QAAQ;YACpCC,UAAUJ,WAAWI,QAAQ;YAC7BC,UAAUL,WAAWK,QAAQ;YAC7BC,aAAaN,EAAAA,sBAAAA,WAAWO,OAAO,qBAAlBP,oBAAoBQ,IAAI,MAAK;YAC1CC,WAAWT,WAAWS,SAAS,KAAK;YACpCC,UAAUV,WAAWU,QAAQ;YAC7BZ;YACAD,UAAU,IAAMA,SAASG;QAC3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AC+B;oBAECC,OAAOvD,KAAKJ,QAAQ;oBACpBb,UAAUiB,KAAKjB,QAAQ;oBACvByE,SAASxD,KAAKhB,QAAQ,KAAK;mBAHtBgB,KAAKb,GAAG;0BAOnB,MAACiE;gBAAIjC,WAAU;;oBACZN,WAAWW,SAASX,SAAS;oBAC7BiC,MAAM7D,GAAG,CAACe,CAAAA,OAAQwB,SAASxB,MAAM;kCAClC,MAACoD;wBACCjC,WAAW7C,GACT,kCACA6E,YAAY,4BAA4B;wBAE1CM,oBAAiB;;4BAEhBT,QAAQ/D,GAAG,CAAC,CAACe,MAAMC,sBAClB,MAAC8B;oCAAoBZ,WAAU;;wCAC5BlB,QAAQ,KAAKA,UAAUiD,6BACtB,KAACnB;4CACC2B,eAAY;4CACZvC,WAAU;;wCAGbK,SAASxB,MAAM;;mCAPPA,KAAKb,GAAG;4BAUpBgD,KAAKY,YAAYE,KAAK,CAACtE,sBAAsB;;;oBAE/CwE,2BACC,KAACC;wBAAIjC,WAAU;wBAA0BsC,oBAAiB;kCACvDtB,KAAKY,aAAa;;;;;;AAM/B;AAEA;;;CAGC,GACD,SAASO,aAAa,EACpBC,KAAK,EACLxE,QAAQ,EACRyE,OAAO,EAKR;IACCjF,UAAU;QAACgF;KAAM,EAAExE,UAAU;QAAEyE;QAASG,QAAQ;IAAK;IACrD,OAAO;AACT"}
@@ -0,0 +1,2 @@
1
+ export * from './action-bar.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/molecules/action-bar/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './action-bar.js';
2
+
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/ui/molecules/action-bar/index.ts"],"sourcesContent":["export * from './action-bar.js';\n"],"names":[],"mappings":"AAAA,cAAc,kBAAkB"}
@@ -5,6 +5,11 @@ export interface BreadcrumbItem {
5
5
  }
6
6
  export interface BreadcrumbsProps extends Omit<ComponentPropsWithoutRef<'nav'>, 'children'> {
7
7
  items: BreadcrumbItem[];
8
+ /**
9
+ * The trail's accessible name. English when omitted; a host with a catalog
10
+ * passes its own (the controls catalog's `breadcrumbs.label`).
11
+ */
12
+ label?: string;
8
13
  /** Glyph between crumbs. */
9
14
  separator?: ReactNode;
10
15
  /**
@@ -22,6 +27,10 @@ export interface BreadcrumbsProps extends Omit<ComponentPropsWithoutRef<'nav'>,
22
27
  className: string;
23
28
  }) => ReactNode;
24
29
  }
25
- /** Accessible breadcrumb trail. Presentational only — no routing knowledge. */
26
- export declare function Breadcrumbs({ items, separator, renderLink, className, ...props }: BreadcrumbsProps): import("react").JSX.Element;
30
+ /**
31
+ * Accessible breadcrumb trail. Presentational only — no routing knowledge, and
32
+ * no hooks: every label arrives as a prop, so a server component renders it
33
+ * and a storefront never pays a client boundary for its trail.
34
+ */
35
+ export declare function Breadcrumbs({ items, label, separator, renderLink, className, ...props }: BreadcrumbsProps): import("react").JSX.Element;
27
36
  //# sourceMappingURL=breadcrumbs.d.ts.map