@jcsoftdev/ui 0.5.0 → 0.7.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 (392) hide show
  1. package/CHANGELOG.md +361 -0
  2. package/README.md +31 -5
  3. package/bin/ui-theme.mjs +40 -6
  4. package/dist/ai/code-block/code-block.js +1 -1
  5. package/dist/atoms/avatar/avatar.d.ts +6 -1
  6. package/dist/atoms/avatar/avatar.js +3 -2
  7. package/dist/atoms/big-date/big-date.js +2 -2
  8. package/dist/atoms/button/button.d.ts +6 -1
  9. package/dist/atoms/button/button.js +2 -2
  10. package/dist/atoms/chip/chip.d.ts +5 -0
  11. package/dist/atoms/chip/chip.js +3 -3
  12. package/dist/atoms/icon-button/icon-button.js +1 -1
  13. package/dist/atoms/internal/hit-area.d.ts +5 -4
  14. package/dist/atoms/internal/hit-area.js +1 -1
  15. package/dist/atoms/progress/index.d.ts +1 -1
  16. package/dist/atoms/progress/index.js +4 -1
  17. package/dist/atoms/progress/progress.d.ts +6 -1
  18. package/dist/atoms/progress/progress.js +19 -1
  19. package/dist/atoms/radio-group/radio-group.js +1 -1
  20. package/dist/atoms/status-pill/status-pill.d.ts +16 -5
  21. package/dist/atoms/status-pill/status-pill.js +43 -18
  22. package/dist/brand/logo-forge.js +1 -1
  23. package/dist/charts/candlestick-chart/candlestick-chart.js +2 -2
  24. package/dist/charts/chart-grid/chart-grid.js +2 -2
  25. package/dist/charts/chord-chart/chord-chart.js +1 -1
  26. package/dist/charts/core/axes.js +2 -2
  27. package/dist/charts/core/cartesian/annotations.js +2 -2
  28. package/dist/charts/core/cartesian/marks.js +1 -1
  29. package/dist/charts/core/distribution/marks.js +1 -1
  30. package/dist/charts/core/distribution/xy-points.js +1 -1
  31. package/dist/charts/core/export-menu.js +1 -1
  32. package/dist/charts/funnel-chart/funnel-chart.js +1 -1
  33. package/dist/charts/gantt-chart/gantt-chart.js +4 -4
  34. package/dist/charts/gantt-chart/gantt-marks.js +3 -3
  35. package/dist/charts/index.d.ts +2 -0
  36. package/dist/charts/index.js +2 -0
  37. package/dist/charts/maps/geo/map-data-table.js +1 -1
  38. package/dist/charts/polar-area-chart/polar-area-chart.js +1 -1
  39. package/dist/charts/radar-chart/radar-chart.js +1 -1
  40. package/dist/charts/stock-chart/stock-chart.js +1 -1
  41. package/dist/charts/stock-chart/stock-drawing-layer.js +3 -3
  42. package/dist/charts/stock-chart/stock-plot.js +2 -2
  43. package/dist/containers/chat-thread/chat-thread.d.ts +98 -0
  44. package/dist/containers/chat-thread/chat-thread.js +219 -0
  45. package/dist/containers/chat-thread/format.d.ts +20 -0
  46. package/dist/containers/chat-thread/format.js +50 -0
  47. package/dist/containers/chat-thread/index.d.ts +1 -0
  48. package/dist/containers/chat-thread/index.js +8 -0
  49. package/dist/containers/cols/cols.d.ts +1 -1
  50. package/dist/containers/cols/cols.js +7 -0
  51. package/dist/containers/comment/comment.js +1 -1
  52. package/dist/containers/context-rail/context-rail.d.ts +62 -0
  53. package/dist/containers/context-rail/context-rail.js +175 -0
  54. package/dist/containers/context-rail/index.d.ts +1 -0
  55. package/dist/containers/context-rail/index.js +6 -0
  56. package/dist/containers/dashboard/dashboard.d.ts +40 -0
  57. package/dist/containers/dashboard/dashboard.js +84 -0
  58. package/dist/containers/dashboard/index.d.ts +1 -0
  59. package/dist/containers/dashboard/index.js +14 -0
  60. package/dist/containers/data-grid/data-grid.demos.js +4 -4
  61. package/dist/containers/data-grid/data-grid.js +6 -6
  62. package/dist/containers/data-grid/filter-builder-editor.js +2 -2
  63. package/dist/containers/data-grid/grid-toolbar.js +1 -1
  64. package/dist/containers/data-grid/spreadsheet.demos.d.ts +1 -1
  65. package/dist/containers/data-grid/spreadsheet.demos.js +1 -1
  66. package/dist/containers/detail-header/detail-header.d.ts +24 -0
  67. package/dist/containers/detail-header/detail-header.js +32 -0
  68. package/dist/containers/detail-header/index.d.ts +1 -0
  69. package/dist/containers/detail-header/index.js +6 -0
  70. package/dist/containers/facts/facts.js +1 -1
  71. package/dist/containers/filter-bar/filter-bar.d.ts +58 -0
  72. package/dist/containers/filter-bar/filter-bar.js +123 -0
  73. package/dist/containers/filter-bar/index.d.ts +1 -0
  74. package/dist/containers/filter-bar/index.js +6 -0
  75. package/dist/containers/hbars/hbars.js +2 -2
  76. package/dist/containers/index.d.ts +9 -0
  77. package/dist/containers/index.js +9 -0
  78. package/dist/containers/kanban/kanban.d.ts +23 -2
  79. package/dist/containers/kanban/kanban.js +103 -21
  80. package/dist/containers/kanban/model.d.ts +12 -0
  81. package/dist/containers/kanban/model.js +8 -0
  82. package/dist/containers/kpi/kpi.js +1 -1
  83. package/dist/containers/kpi-group/kpi-group.d.ts +6 -1
  84. package/dist/containers/kpi-group/kpi-group.js +6 -2
  85. package/dist/containers/list-detail/index.d.ts +1 -1
  86. package/dist/containers/list-detail/index.js +4 -0
  87. package/dist/containers/list-detail/list-detail.d.ts +51 -3
  88. package/dist/containers/list-detail/list-detail.js +111 -15
  89. package/dist/containers/page/page.d.ts +17 -4
  90. package/dist/containers/page/page.js +33 -4
  91. package/dist/containers/page-header/back.d.ts +10 -0
  92. package/dist/containers/page-header/back.js +28 -0
  93. package/dist/containers/page-header/index.d.ts +1 -0
  94. package/dist/containers/page-header/index.js +1 -0
  95. package/dist/containers/page-header/page-header.d.ts +19 -2
  96. package/dist/containers/page-header/page-header.js +26 -2
  97. package/dist/containers/pagination/cursor-pagination.d.ts +28 -0
  98. package/dist/containers/pagination/cursor-pagination.js +48 -0
  99. package/dist/containers/pagination/index.d.ts +3 -0
  100. package/dist/containers/pagination/index.js +10 -0
  101. package/dist/containers/pagination/pagination.d.ts +52 -0
  102. package/dist/containers/pagination/pagination.js +216 -0
  103. package/dist/containers/pagination/range.d.ts +29 -0
  104. package/dist/containers/pagination/range.js +42 -0
  105. package/dist/containers/pagination/use-pagination.d.ts +18 -0
  106. package/dist/containers/pagination/use-pagination.js +22 -0
  107. package/dist/containers/responsive-list/responsive-list.d.ts +29 -3
  108. package/dist/containers/responsive-list/responsive-list.js +202 -82
  109. package/dist/containers/row-actions/index.d.ts +1 -0
  110. package/dist/containers/row-actions/index.js +4 -0
  111. package/dist/containers/row-actions/row-actions.d.ts +26 -0
  112. package/dist/containers/row-actions/row-actions.js +78 -0
  113. package/dist/containers/selectable-card/index.d.ts +1 -0
  114. package/dist/containers/selectable-card/index.js +6 -0
  115. package/dist/containers/selectable-card/selectable-card.d.ts +26 -0
  116. package/dist/containers/selectable-card/selectable-card.js +57 -0
  117. package/dist/containers/settings-layout/settings-layout.d.ts +24 -7
  118. package/dist/containers/settings-layout/settings-layout.js +63 -8
  119. package/dist/containers/shortcuts/shortcuts.js +1 -1
  120. package/dist/containers/table/cell-padding.d.ts +2 -0
  121. package/dist/containers/table/cell-padding.js +4 -0
  122. package/dist/containers/table/index.d.ts +1 -0
  123. package/dist/containers/table/index.js +8 -0
  124. package/dist/containers/table/sort.d.ts +14 -0
  125. package/dist/containers/table/sort.js +11 -0
  126. package/dist/containers/table/table-parts.d.ts +24 -0
  127. package/dist/containers/table/table-parts.js +52 -0
  128. package/dist/containers/table/table.d.ts +37 -3
  129. package/dist/containers/table/table.js +120 -19
  130. package/dist/containers/table-columns-menu/index.d.ts +1 -0
  131. package/dist/containers/table-columns-menu/index.js +6 -0
  132. package/dist/containers/table-columns-menu/table-columns-menu.d.ts +14 -0
  133. package/dist/containers/table-columns-menu/table-columns-menu.js +46 -0
  134. package/dist/dashboards/layout.d.ts +1 -27
  135. package/dist/dashboards/layout.js +8 -40
  136. package/dist/forms/chip-group/chip-group.d.ts +5 -0
  137. package/dist/forms/chip-group/chip-group.js +3 -1
  138. package/dist/forms/combobox/combobox.js +1 -1
  139. package/dist/forms/copy-field/copy-field.js +1 -1
  140. package/dist/forms/date-picker/date-picker.d.ts +3 -1
  141. package/dist/forms/date-picker/date-picker.js +4 -2
  142. package/dist/forms/date-picker/date-time-picker.d.ts +8 -2
  143. package/dist/forms/date-picker/date-time-picker.js +13 -2
  144. package/dist/forms/field/field.d.ts +9 -2
  145. package/dist/forms/field/field.js +18 -4
  146. package/dist/forms/fieldset/fieldset.d.ts +11 -0
  147. package/dist/forms/fieldset/fieldset.js +12 -0
  148. package/dist/forms/fieldset/index.d.ts +1 -0
  149. package/dist/forms/fieldset/index.js +4 -0
  150. package/dist/forms/form-footer/form-footer.d.ts +26 -0
  151. package/dist/forms/form-footer/form-footer.js +44 -0
  152. package/dist/forms/form-footer/index.d.ts +1 -0
  153. package/dist/forms/form-footer/index.js +4 -0
  154. package/dist/forms/form-grid/form-grid.d.ts +21 -4
  155. package/dist/forms/form-grid/form-grid.js +20 -3
  156. package/dist/forms/form-grid/index.d.ts +1 -1
  157. package/dist/forms/form-grid/index.js +6 -2
  158. package/dist/forms/form-section/form-section.d.ts +12 -0
  159. package/dist/forms/form-section/form-section.js +30 -0
  160. package/dist/forms/form-section/index.d.ts +1 -0
  161. package/dist/forms/form-section/index.js +4 -0
  162. package/dist/forms/index.d.ts +3 -0
  163. package/dist/forms/index.js +3 -0
  164. package/dist/forms/input/input.d.ts +6 -2
  165. package/dist/forms/input/input.js +4 -1
  166. package/dist/forms/internal/listbox-items.d.ts +1 -1
  167. package/dist/forms/internal/listbox-items.js +3 -2
  168. package/dist/forms/native-select/native-select.js +1 -1
  169. package/dist/forms/number-stepper/index.d.ts +1 -1
  170. package/dist/forms/number-stepper/number-stepper.d.ts +7 -0
  171. package/dist/forms/number-stepper/number-stepper.js +37 -6
  172. package/dist/forms/select/index.d.ts +1 -1
  173. package/dist/forms/select/select.d.ts +5 -2
  174. package/dist/forms/select/select.js +7 -2
  175. package/dist/forms/select-menu/select-menu.js +1 -1
  176. package/dist/forms/time-input/time-input.d.ts +4 -2
  177. package/dist/forms/time-input/time-input.js +3 -1
  178. package/dist/i18n/strings.d.ts +94 -0
  179. package/dist/i18n/strings.js +50 -0
  180. package/dist/motion/count-up.d.ts +20 -0
  181. package/dist/motion/count-up.js +59 -0
  182. package/dist/motion/cross-fade.d.ts +21 -0
  183. package/dist/motion/cross-fade.js +86 -0
  184. package/dist/motion/index.d.ts +5 -0
  185. package/dist/motion/index.js +14 -0
  186. package/dist/motion/model.d.ts +15 -0
  187. package/dist/motion/model.js +68 -0
  188. package/dist/motion/motion-styles.d.ts +1 -0
  189. package/dist/motion/motion-styles.js +35 -0
  190. package/dist/motion/reveal.d.ts +37 -0
  191. package/dist/motion/reveal.js +69 -0
  192. package/dist/motion/use-enter-phase.d.ts +11 -0
  193. package/dist/motion/use-enter-phase.js +40 -0
  194. package/dist/motion/use-highlight-row.d.ts +22 -0
  195. package/dist/motion/use-highlight-row.js +38 -0
  196. package/dist/navigation/tabs/tabs.js +1 -1
  197. package/dist/navigation/wizard/wizard.d.ts +4 -1
  198. package/dist/navigation/wizard/wizard.js +3 -0
  199. package/dist/overlays/alert-dialog/alert-dialog.js +8 -1
  200. package/dist/overlays/context-menu/context-menu.js +3 -1
  201. package/dist/overlays/dialog/dialog.d.ts +1 -0
  202. package/dist/overlays/dialog/dialog.js +11 -3
  203. package/dist/overlays/drawer/drawer.d.ts +18 -4
  204. package/dist/overlays/drawer/drawer.js +53 -4
  205. package/dist/overlays/drawer/index.d.ts +1 -1
  206. package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +1 -1
  207. package/dist/overlays/dropdown-menu/dropdown-menu.js +5 -4
  208. package/dist/overlays/hover-card/hover-card.js +2 -0
  209. package/dist/overlays/popover/popover.js +2 -0
  210. package/dist/overlays/toaster/index.d.ts +1 -1
  211. package/dist/overlays/toaster/toast-store.d.ts +2 -0
  212. package/dist/overlays/toaster/toast-store.js +6 -1
  213. package/dist/overlays/toaster/toaster.d.ts +28 -2
  214. package/dist/overlays/toaster/toaster.js +86 -29
  215. package/dist/overlays/tooltip/tooltip.js +2 -0
  216. package/dist/primitives/use-presence.js +9 -0
  217. package/dist/shell/app-shell/app-shell.d.ts +8 -1
  218. package/dist/shell/app-shell/app-shell.js +50 -3
  219. package/dist/shell/index.d.ts +1 -0
  220. package/dist/shell/index.js +1 -0
  221. package/dist/shell/sidebar/sidebar.d.ts +17 -1
  222. package/dist/shell/sidebar/sidebar.js +126 -76
  223. package/dist/shell/topbar/topbar.d.ts +4 -2
  224. package/dist/shell/topbar/topbar.js +2 -0
  225. package/dist/showcase/operations-bento.js +2 -2
  226. package/dist/states/empty-state/empty-state.d.ts +10 -3
  227. package/dist/states/empty-state/empty-state.js +46 -5
  228. package/dist/states/error-state/error-state.js +1 -1
  229. package/dist/states/skeleton/skeleton.d.ts +16 -1
  230. package/dist/states/skeleton/skeleton.js +13 -5
  231. package/dist/utils/class-tokens.generated.js +4 -6
  232. package/dist/utils/focus-chain.d.ts +11 -0
  233. package/dist/utils/focus-chain.js +39 -0
  234. package/dist/utils/focus-rescue.d.ts +13 -0
  235. package/dist/utils/focus-rescue.js +48 -0
  236. package/dist/utils/list-navigation.d.ts +14 -0
  237. package/dist/utils/list-navigation.js +44 -0
  238. package/dist/utils/overlay-motion.d.ts +12 -0
  239. package/dist/utils/overlay-motion.js +14 -0
  240. package/dist/utils/use-container-width.d.ts +6 -0
  241. package/dist/utils/use-container-width.js +19 -0
  242. package/package.json +2 -2
  243. package/scripts/build-theme.mjs +46 -5
  244. package/src/ai/code-block/code-block.tsx +1 -1
  245. package/src/atoms/avatar/avatar.tsx +8 -2
  246. package/src/atoms/big-date/big-date.tsx +2 -2
  247. package/src/atoms/button/button.tsx +8 -3
  248. package/src/atoms/chip/chip.tsx +8 -3
  249. package/src/atoms/icon-button/icon-button.tsx +1 -1
  250. package/src/atoms/internal/hit-area.ts +5 -4
  251. package/src/atoms/progress/index.ts +8 -1
  252. package/src/atoms/progress/progress.tsx +30 -1
  253. package/src/atoms/radio-group/radio-group.tsx +1 -1
  254. package/src/atoms/status-pill/status-pill.tsx +59 -18
  255. package/src/brand/logo-forge.tsx +1 -1
  256. package/src/charts/candlestick-chart/candlestick-chart.tsx +2 -2
  257. package/src/charts/chart-grid/chart-grid.tsx +2 -2
  258. package/src/charts/chord-chart/chord-chart.tsx +1 -1
  259. package/src/charts/core/axes.tsx +2 -2
  260. package/src/charts/core/cartesian/annotations.tsx +2 -2
  261. package/src/charts/core/cartesian/marks.tsx +1 -1
  262. package/src/charts/core/distribution/marks.tsx +1 -1
  263. package/src/charts/core/distribution/xy-points.tsx +1 -1
  264. package/src/charts/core/export-menu.tsx +1 -1
  265. package/src/charts/funnel-chart/funnel-chart.tsx +1 -1
  266. package/src/charts/gantt-chart/gantt-chart.tsx +4 -4
  267. package/src/charts/gantt-chart/gantt-marks.tsx +3 -3
  268. package/src/charts/index.ts +2 -0
  269. package/src/charts/maps/geo/map-data-table.tsx +1 -1
  270. package/src/charts/polar-area-chart/polar-area-chart.tsx +1 -1
  271. package/src/charts/radar-chart/radar-chart.tsx +1 -1
  272. package/src/charts/stock-chart/stock-chart.tsx +1 -1
  273. package/src/charts/stock-chart/stock-drawing-layer.tsx +3 -3
  274. package/src/charts/stock-chart/stock-plot.tsx +2 -2
  275. package/src/containers/chat-thread/chat-thread.tsx +331 -0
  276. package/src/containers/chat-thread/format.ts +67 -0
  277. package/src/containers/chat-thread/index.ts +12 -0
  278. package/src/containers/cols/cols.tsx +13 -1
  279. package/src/containers/comment/comment.tsx +1 -1
  280. package/src/containers/context-rail/context-rail.tsx +229 -0
  281. package/src/containers/context-rail/index.ts +7 -0
  282. package/src/containers/dashboard/dashboard.tsx +142 -0
  283. package/src/containers/dashboard/index.ts +12 -0
  284. package/src/containers/data-grid/data-grid.demos.tsx +4 -4
  285. package/src/containers/data-grid/data-grid.tsx +6 -6
  286. package/src/containers/data-grid/filter-builder-editor.tsx +2 -2
  287. package/src/containers/data-grid/grid-toolbar.tsx +1 -1
  288. package/src/containers/data-grid/spreadsheet.demos.tsx +1 -1
  289. package/src/containers/detail-header/detail-header.tsx +64 -0
  290. package/src/containers/detail-header/index.ts +5 -0
  291. package/src/containers/facts/facts.tsx +1 -1
  292. package/src/containers/filter-bar/filter-bar.tsx +201 -0
  293. package/src/containers/filter-bar/index.ts +7 -0
  294. package/src/containers/hbars/hbars.tsx +2 -2
  295. package/src/containers/index.ts +9 -0
  296. package/src/containers/kanban/kanban.tsx +148 -39
  297. package/src/containers/kanban/model.ts +20 -0
  298. package/src/containers/kpi/kpi.tsx +1 -1
  299. package/src/containers/kpi-group/kpi-group.tsx +17 -2
  300. package/src/containers/list-detail/index.ts +5 -0
  301. package/src/containers/list-detail/list-detail.tsx +159 -9
  302. package/src/containers/page/page.tsx +61 -7
  303. package/src/containers/page-header/back.tsx +42 -0
  304. package/src/containers/page-header/index.ts +1 -0
  305. package/src/containers/page-header/page-header.tsx +49 -3
  306. package/src/containers/pagination/cursor-pagination.tsx +79 -0
  307. package/src/containers/pagination/index.ts +7 -0
  308. package/src/containers/pagination/pagination.tsx +266 -0
  309. package/src/containers/pagination/range.ts +68 -0
  310. package/src/containers/pagination/use-pagination.ts +44 -0
  311. package/src/containers/responsive-list/responsive-list.tsx +190 -47
  312. package/src/containers/row-actions/index.ts +1 -0
  313. package/src/containers/row-actions/row-actions.tsx +114 -0
  314. package/src/containers/selectable-card/index.ts +5 -0
  315. package/src/containers/selectable-card/selectable-card.tsx +84 -0
  316. package/src/containers/settings-layout/settings-layout.tsx +104 -13
  317. package/src/containers/shortcuts/shortcuts.tsx +1 -1
  318. package/src/containers/table/cell-padding.ts +2 -0
  319. package/src/containers/table/index.ts +6 -0
  320. package/src/containers/table/sort.ts +23 -0
  321. package/src/containers/table/table-parts.tsx +81 -0
  322. package/src/containers/table/table.tsx +212 -45
  323. package/src/containers/table-columns-menu/index.ts +5 -0
  324. package/src/containers/table-columns-menu/table-columns-menu.tsx +68 -0
  325. package/src/dashboards/layout.tsx +8 -75
  326. package/src/forms/chip-group/chip-group.tsx +8 -1
  327. package/src/forms/combobox/combobox.tsx +1 -1
  328. package/src/forms/copy-field/copy-field.tsx +1 -1
  329. package/src/forms/date-picker/date-picker.tsx +7 -2
  330. package/src/forms/date-picker/date-time-picker.tsx +28 -2
  331. package/src/forms/field/field.tsx +30 -3
  332. package/src/forms/fieldset/fieldset.tsx +22 -0
  333. package/src/forms/fieldset/index.ts +1 -0
  334. package/src/forms/form-footer/form-footer.tsx +74 -0
  335. package/src/forms/form-footer/index.ts +1 -0
  336. package/src/forms/form-grid/form-grid.tsx +42 -5
  337. package/src/forms/form-grid/index.ts +8 -1
  338. package/src/forms/form-section/form-section.tsx +41 -0
  339. package/src/forms/form-section/index.ts +1 -0
  340. package/src/forms/index.ts +3 -0
  341. package/src/forms/input/input.tsx +10 -3
  342. package/src/forms/internal/listbox-items.tsx +3 -4
  343. package/src/forms/native-select/native-select.tsx +1 -1
  344. package/src/forms/number-stepper/index.ts +1 -0
  345. package/src/forms/number-stepper/number-stepper.tsx +51 -6
  346. package/src/forms/select/index.ts +1 -1
  347. package/src/forms/select/select.tsx +14 -3
  348. package/src/forms/select-menu/select-menu.tsx +1 -1
  349. package/src/forms/time-input/time-input.tsx +6 -2
  350. package/src/i18n/strings.ts +94 -0
  351. package/src/motion/count-up.tsx +83 -0
  352. package/src/motion/cross-fade.tsx +139 -0
  353. package/src/motion/index.ts +5 -0
  354. package/src/motion/model.ts +86 -0
  355. package/src/motion/motion-styles.tsx +47 -0
  356. package/src/motion/reveal.tsx +115 -0
  357. package/src/motion/use-enter-phase.ts +50 -0
  358. package/src/motion/use-highlight-row.ts +63 -0
  359. package/src/navigation/tabs/tabs.tsx +1 -1
  360. package/src/navigation/wizard/wizard.tsx +6 -1
  361. package/src/overlays/alert-dialog/alert-dialog.tsx +5 -1
  362. package/src/overlays/context-menu/context-menu.tsx +3 -2
  363. package/src/overlays/dialog/dialog.tsx +9 -3
  364. package/src/overlays/drawer/drawer.tsx +68 -6
  365. package/src/overlays/drawer/index.ts +1 -0
  366. package/src/overlays/dropdown-menu/dropdown-menu.tsx +5 -4
  367. package/src/overlays/hover-card/hover-card.tsx +2 -0
  368. package/src/overlays/popover/popover.tsx +2 -0
  369. package/src/overlays/toaster/index.ts +2 -0
  370. package/src/overlays/toaster/toast-store.ts +8 -0
  371. package/src/overlays/toaster/toaster.tsx +127 -17
  372. package/src/overlays/tooltip/tooltip.tsx +2 -0
  373. package/src/primitives/use-presence.ts +13 -0
  374. package/src/shell/app-shell/app-shell.tsx +54 -2
  375. package/src/shell/index.ts +1 -0
  376. package/src/shell/sidebar/sidebar.tsx +154 -75
  377. package/src/shell/topbar/topbar.tsx +8 -0
  378. package/src/showcase/operations-bento.tsx +2 -2
  379. package/src/states/empty-state/empty-state.tsx +52 -9
  380. package/src/states/error-state/error-state.tsx +1 -1
  381. package/src/states/skeleton/skeleton.tsx +33 -5
  382. package/src/utils/class-tokens.generated.ts +4 -6
  383. package/src/utils/focus-chain.ts +53 -0
  384. package/src/utils/focus-rescue.ts +68 -0
  385. package/src/utils/list-navigation.ts +63 -0
  386. package/src/utils/overlay-motion.ts +33 -0
  387. package/src/utils/use-container-width.ts +24 -0
  388. package/styles/Theme.kt +15 -18
  389. package/styles/tailwind.css +29 -28
  390. package/styles/theme.css +29 -28
  391. package/styles/tokens.css +46 -0
  392. package/tokens/default.json +51 -29
package/CHANGELOG.md CHANGED
@@ -1,5 +1,366 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.7.0 (2026-11-03)
4
+
5
+ ### Demo gaps
6
+
7
+ #### Added
8
+
9
+ - **Focus restoration**: a toast's action, dismissal or timeout returns focus to the element that
10
+ was focused when the toast was published, or to its nearest surviving ancestor (a list). When the
11
+ focused item of a `ListDetail`, `ResponsiveList` or `Kanban` leaves the DOM (approved, started,
12
+ moved to another lane) focus moves to the item that took its place, the previous one when it was
13
+ the last, or the list when it empties. Focus that moved elsewhere on purpose is never touched.
14
+ - **`NumberStepper` `size`** (`sm` 30px, `md` default) and `incrementLabel` / `decrementLabel`.
15
+ New `increase` and `decrease` UI strings (en, es).
16
+ - **`SkeletonGroup`** and **`Skeleton` `announce`**: one status per loading region.
17
+ - **`Avatar` `decorative`**; `aria-hidden` passed to `Avatar` also drops its image role and label.
18
+
19
+ #### Changed
20
+
21
+ - `NumberStepper` plus and minus buttons are named by the verb and the field label (`Aumentar
22
+ billetes de S/ 100`) and follow the UI strings locale; they were a fixed Spanish "Aumentar" and
23
+ "Disminuir".
24
+ - `DialogHeader` stacks its children vertically (title above description) at every width; it was a
25
+ centred row. Pass `flex-row items-center` in `className` to keep the old layout.
26
+
27
+ ## 0.6.0 (2026-10-30)
28
+
29
+ ### App shells, layout containers and adaptive density
30
+
31
+ Pieces a phone-first operations app kept patching in: a bottom bar the shell knows about, a side
32
+ rail that collapses to a sheet, selectable lists, a chat thread, density that follows the pointer,
33
+ and a product type scale. Additive except for the changes listed under "Changed".
34
+
35
+ #### Added
36
+
37
+ - **`AppShell` `bottomBar`**: phone navigation, usually a `BottomNav`. The shell renders it after
38
+ its children, fixed to the bottom edge and hidden from 900 px of shell width. While compact it
39
+ reserves the bar's height plus the safe-area inset at the bottom and publishes it as
40
+ `--app-bottom-bar` on the shell and on the document root.
41
+ - **`ContextRail`**, new in `@jcsoftdev/ui/containers` (also `/containers/context-rail`): a work area
42
+ with a sticky side rail (`stickyTop`, its own scroll). `width` is a number or `{ m, w, xw }`
43
+ (default 360 / 400 / 440 from 720 / 1280 / 1600 px of container width). Under `breakpoint` (720,
44
+ 960 or 1280; `"never"` keeps the rail beside the work area, `"always"` always collapses it) the
45
+ rail stacks below the work area, or with `collapse="sheet"` it is replaced by a `summary` bar that
46
+ opens it as a bottom sheet (`sheetOpen` / `onSheetOpenChange`, `sheetLabel`, `railLabel`). The
47
+ summary bar sticks at `bottom: var(--app-bottom-bar, 0px)`, above an `AppShell` bottom bar.
48
+ - **`ChatThread`**, new in `@jcsoftdev/ui/containers`: business chat with `customer` (incoming),
49
+ `bot` and `staff` (outgoing) authors, day separators (Today / Yesterday / date, by `timeZone`),
50
+ `note` items for system lines, optional delivery status (`sending`, `sent`, `delivered`, `read`,
51
+ `failed` with `onRetry`), a `composer` slot, an `empty` slot and a live `log` that stays at the
52
+ bottom. Texts come from `labels` (`chatThreadLabels.en` / `.es`). The `ai/` chat parts are
53
+ unchanged.
54
+ - **`SelectableCard`**, new in `@jcsoftdev/ui/containers`: a card that is itself one `button`. No
55
+ `selected` makes it a plain button; `selected` makes it a toggle (`aria-pressed`) or, with
56
+ `semantics="radio"`, a radio (`aria-checked`). `disabled` with `disabledReason` keeps it focusable
57
+ (`aria-disabled`), ignores clicks and announces the reason.
58
+ - **`ResponsiveList` selection and layout**: `onSelect` with `selectedKey` makes rows selectable
59
+ (click, Enter, Space; arrows, Home and End move focus; `selectOnFocus` selects as well), with one
60
+ tab stop per list. Without `renderActions` the cards are a `listbox` of `option`s and the table a
61
+ `grid` with `aria-selected`; with it the rows keep list and table semantics and the selected one
62
+ has `aria-current="true"`. `layout="cards"` always renders cards (a list in a narrow pane);
63
+ `breakpoint` (480, 640, 672, 768, 960 or 1280; default 672, the previous 42rem) sets the
64
+ container width where the table starts; `cardLabels="hidden"` keeps the field labels for screen
65
+ readers only. Lists without these props render as before.
66
+ - **`Cols variant="thirds"`**: three equal columns from 1280 px of `page` width, two from 720 px (an
67
+ odd last item spans both) and one below. The other variants keep their 940 / 1080 / 1500 px cuts.
68
+ - **Container breakpoint tokens** (`@jcsoftdev/ui-tokens`): the optional `containers` section of a
69
+ token file emits `--container-<name>` widths in `theme.css`; `tokens/default.json` ships
70
+ `page-m` 720, `page-w` 1280 and `page-xw` 1600 (`@min-page-w/page:`). Files without the section
71
+ build byte-identically.
72
+ - **`data-density="auto"`** (opt-in, `@jcsoftdev/ui-tokens`): `normal` values on a fine pointer and
73
+ `touch` values under `@media (pointer: coarse)`, CSS only. An explicit level on a subtree still
74
+ wins. Token files set both sides with `styles.density.auto` (`{ "fine", "coarse" }`, level ids)
75
+ or omit it; `auto` is reserved as a level id.
76
+ - **`--touch` token** (0, or 1 under `touch` and under `auto` on a coarse pointer), from the new
77
+ `styles.density.fixed` list of density tokens that are not scaled.
78
+ - **`Kanban`**: `cardActions` renders real buttons under each card (the card is no longer a
79
+ `role="button"` wrapper and keyboard pick-up moves to a grip button named by `gripLabel`);
80
+ `cardGrid` lays a lane's cards out as a grid once the lane is 30rem wide (`cardGridMinWidth`,
81
+ default 224 px), with drops in reading order (`dropIndexGrid` in `model.ts`); `draggable={false}`
82
+ makes a display-only board with no grip, no pick-up and no drag instructions. Boards without
83
+ these props are unchanged.
84
+ - **`DrawerContent` `side="bottom"`**: a bottom sheet across the width, padded by the safe-area
85
+ inset, capped at 85dvh with its own scroll, sliding up (`SHEET_MOTION`). `handle` adds a
86
+ decorative grab handle; dragging it down closes the sheet unless `blocking`. New `handle` part and
87
+ `DrawerSide` type. `side="right"` (default) is unchanged.
88
+ - **`Sidebar` collapsible groups**: `collapsible`, `defaultCollapsed` and controlled `collapsed` /
89
+ `onCollapsedChange` on a group. The label becomes a toggle (`aria-expanded`, `aria-controls`); a
90
+ group holding the active page starts open, and an uncontrolled group opens when one of its items
91
+ becomes active later. The rail (`collapsed` sidebar) keeps every item visible. New `groupToggle`
92
+ and `groupItems` parts.
93
+ - **`Toaster`**: `offset` (px, a CSS length, or `{ x, y }`) and `position` per viewport width
94
+ (`{ base, sm?, lg? }`, from 640 / 1024 px). Bottom positions without an explicit `offset.y` clear
95
+ the `AppShell` bottom bar (`--app-bottom-bar + 1rem`).
96
+ - **`SettingsLayout` / `SettingsLayoutNav` `breakpoint`** (720, 940, 1080 or 1280; default 940, or
97
+ `"never"`) and `container="self"` to measure its own `@container/settings`. The component is now a
98
+ client component.
99
+ - **`Progress` / `Meter` `tone`** (`accent` default, `neutral`, `success`, `warning`, `danger`,
100
+ `info`, or a `tonePalettes` name); non-default tones set `data-tone` on the root.
101
+ - **`KpiGroup` `minColumns={2}`**: two tiles across on the narrowest containers (an odd last tile
102
+ spans both); with `layout="auto-fit"` it never goes under two columns.
103
+ - **`Topbar` `start`**: a slot between the menu button and the breadcrumbs; new `start` part.
104
+ - **`StatusPill`**: `icon` (decorative, hidden from screen readers), `dot` (default `true` without
105
+ `icon`, `false` with one) and `collapseLabel` (hides the label under 700 px of container width).
106
+
107
+ #### Changed
108
+
109
+ - **Type scale (breaking, visual)**: product text is one tighter scale and no mobile role exceeds
110
+ its desktop counterpart. Density never changes text size.
111
+
112
+ | Role | Before | After |
113
+ | --- | --- | --- |
114
+ | `kpi-number` | 30 / 1.15 / -0.03em | 24 / 1.2 / -0.025em |
115
+ | `page-title` | 26 / 1.18 / -0.025em | 22 / 1.25 / -0.02em |
116
+ | `card-title` | 14 / 1.5 | 15 / 1.4 |
117
+ | `lede` | 14.5 | 14 |
118
+ | `row-title` | 13.5 | 14 |
119
+ | `meta` | 12.5 | 12 |
120
+ | `data` | 12.5 / 1.6 | 13 / 1.5 |
121
+ | `clock` | 17 | 16 |
122
+ | `m-title` | 34 / 41px | 22 / 1.25 / -0.02em |
123
+ | `m-card-title` | 26 / 1.1 | 20 / 1.2 / -0.015em |
124
+ | `m-row-title`, `m-button` | 15.5 | 15 |
125
+
126
+ `dialog-title`, `body`, `control`, `chip-text`, `overline`, `count`, `m-body` and `m-meta` keep
127
+ their sizes. The size-only steps (`text-fs-*`) go from 14 to 10: `fs-100`, `110`, `120`, `130`,
128
+ `140`, `150`, `160`, `200`, `240`, `440`. Removed steps map to the nearest survivor: `fs-95` to
129
+ `fs-100`, `fs-105` to `fs-110`, `fs-115` and `fs-125` to `fs-120`, `fs-220` to `fs-200`, `fs-300`
130
+ to `fs-240`. Components moved to the new steps (the small `Button` and the pagination, filter bar
131
+ and columns-menu texts 12.5 to 12 px; the small `Chip` 11.5 to 12 px; `DetailHeader` and the narrow `Kpi` 22 to 20 px; `BigDate`
132
+ 30 / 22 to 24 / 20 px; chart and grid micro-text to the 10 / 11 / 12 steps). Compose
133
+ `UiFontSizes` loses `fs95`, `fs105`, `fs115`, `fs125`, `fs220` and `fs300` and gains `fs200` and
134
+ `fs240`.
135
+ - **`StatusPill` (breaking)**: without `onSelect` or `onClick` it renders a plain `span` instead of
136
+ a disabled `button`; `interactive` forces either element. Its label stays visible at every width
137
+ unless `collapseLabel` is set (it used to hide under 700 px unconditionally), and a pill with an
138
+ `icon` no longer repeats the status as icon plus dot.
139
+ - **Touch sizing reads tokens, not an ancestor selector**: `Checkbox`, `Switch`, `RadioGroup`
140
+ rows, `Chip` (interactive and removable), `ChipGroup`, `Shortcuts`, the `Dialog` and `Drawer` close
141
+ buttons, `SettingsLayout` nav items, `Sidebar` links, `Tabs` triggers, `DropdownMenu` items and the
142
+ `Skeleton` list rows read `--touch-target` or `--touch` instead of `in-data-[density=touch]:`, so
143
+ they follow the nearest density level, `auto` included. `Sidebar` links, `Tabs` triggers,
144
+ `DropdownMenu` items and `SettingsLayout` nav items now reach 44 px under touch. Default density
145
+ renders the same sizes as before.
146
+ - **`Toaster`**: the action button shows its focus ring on `:focus-visible` only.
147
+
148
+ #### Migration
149
+
150
+ - Replace any `text-fs-95`, `-105`, `-115`, `-125`, `-220` or `-300` class with the step above, and
151
+ drop overrides of the removed `--text-fs-*` names.
152
+ - A `StatusPill` used as a button needs `onSelect`, `onClick` or `interactive`; pass
153
+ `collapseLabel` to keep the old icon-only look on narrow containers.
154
+ - To get the bottom bar reservation, move a `BottomNav` from the page column to `AppShell`'s
155
+ `bottomBar`.
156
+
157
+ ### Control sizes, table density, row actions and pagination
158
+
159
+ One height per control size, a denser and steadier table, and the row and paging parts an app used to
160
+ patch in. Additive except for the visual changes listed under "Changed".
161
+
162
+ #### Added
163
+
164
+ - **`--control-height-md` token** (`@jcsoftdev/ui-tokens`, Tailwind `h-control-md` / `w-control-md`):
165
+ 38px, scaled by `data-density` like the other control heights and 48px under `touch`, the same as
166
+ `--input-height`. With `--control-height-sm` (30px) it is the one height of each control size.
167
+ - **`size` on every field** (`"sm"` 30px, `"md"` 38px, default `md`): new on `Select`, `DatePicker`,
168
+ `TimeInput` and `DateTimePicker` (which passes it to both halves); `Input` gains `sm` (the same as
169
+ `xs`, which stays). `Button`, `IconButton`, `Input`, `Select`, `SelectMenu`, `NativeSelect`,
170
+ `Combobox`, `DatePicker`, `DateTimePicker` and `TimeInput` now render the same token per size
171
+ (`h-control-sm`, `h-control-md`), so they line up in a toolbar or a table row. Story:
172
+ `Forms/Control sizes` measures them.
173
+ - **`DateTimePicker` `classNames` reach the inner parts**: new parts `dateInput`, `clear`, `trigger`,
174
+ `content`, `calendar` (the inner `DatePicker`) and `timeInput`.
175
+ - **`Wizard` `buttonSize`** (default `"md"`): size of the Back and Next/Finish buttons, which now
176
+ reach the 38px md height of a field (they followed `Button` md, 36px, before).
177
+ - **`Table` `density`** (`"comfortable"` default, `"compact"`): every body row is at least 48px or
178
+ 40px (`--row-min-h`), whatever its cells hold, with cells centred vertically and their vertical
179
+ padding from `--table-cell-py` (8px or 4px). Both variables can be overridden with `className` or
180
+ `style`. The table carries `data-table-density`.
181
+ - **`Table` `stickyActions`**: the last column (the row actions) sticks to the right edge while the
182
+ table scrolls sideways, from 24rem of the table's own width; its row divider is redrawn and an edge
183
+ shadow shows while columns are hidden underneath.
184
+ - **`RowActions`, new in `@jcsoftdev/ui/containers`** (also `/containers/row-actions`): one row's
185
+ actions as at most one inline `primary` action plus an overflow menu (`DropdownMenu`) behind a 30px
186
+ "more" `IconButton`. Required `label` names the trigger; `items` are
187
+ `{ id, label, onSelect, icon?, tone?: "default" | "danger", disabled? }`, with `danger` items sorted
188
+ last behind a separator. It never wraps, renders no trigger without items, and stops click and key
189
+ events from reaching the row (portaled menu included). Exported types `RowActionItem`,
190
+ `RowActionsProps`. It brings the menu primitive into the `containers` barrel, which grows by about
191
+ 4 kB gzip for apps that import the whole barrel; `@jcsoftdev/ui/containers/table` does not include it.
192
+ - **`Pagination` `variant="pages"`**: the range as "Showing 1–25 of 134" ("Mostrando 1–25 de 134"),
193
+ then Previous, page number buttons (`aria-current="page"` on the current one, gaps on long lists)
194
+ and Next, all 30px `Button`s. It renders nothing on a single page (`hideOnSinglePage`, default
195
+ `true` for this variant and `false` for the default one) and shows the page size picker only when
196
+ `pageSizeOptions` is passed. New `labels` keys `showing`, `previousLabel`, `nextLabel`,
197
+ `pageNumber`. The default variant is unchanged.
198
+ - **`CursorPagination`**, new in `@jcsoftdev/ui/containers`: server-side cursor paging with an unknown
199
+ total. `page`, `count` (rows on this page), `pageSize` (default 25), `hasNext`, `onPrevious`,
200
+ `onNext`, `labels`. Shows "Showing 26–50" and Previous / Next; renders nothing on a first page
201
+ without a next cursor.
202
+ - **`usePagination(rows, resetKey?, pageSize = 25)`**, new in `@jcsoftdev/ui/containers`: client-side
203
+ paging returning `{ page, pageCount, total, pageSize, items, setPage }`; the page is clamped when
204
+ the list shrinks and returns to 1 when `resetKey` changes. Type `PaginationState`.
205
+ - **New UI strings** (en, es): `showingRange`, `showingRangeOpen`, `previous`, `pageNumber`. They grow
206
+ every entry that carries the string table by a few dozen bytes gzip.
207
+ - **`ChipGroup` `size`**: `"sm"` (default, 30px minimum) or `"md"` (38px minimum).
208
+
209
+ #### Changed
210
+
211
+ - **`Button` and `IconButton` `size="md"` (the default) are 38px instead of 36px** (`h-control-md`,
212
+ `w-control-md`), so a default button lines up with a default field. `sm` (30px) and `lg` (52px) are
213
+ unchanged. `--control-height` (36px) still exists for code that uses it directly.
214
+ - **Fields at `md` use `h-control-md` instead of `h-input`.** Same 38px in every density, so nothing
215
+ moves; a `className` that overrode `h-input` on these controls still wins through `cn`.
216
+ - **`DatePicker` clear and calendar buttons have a 30px hit area** (`min-h-control-sm`); the glyphs
217
+ stay where they were.
218
+ - **Chips meet the 30px hit area.** `ChipGroup` chips grow from 28px to 30px (`min-h-control-sm`,
219
+ replacing `min-h-7`). A `Chip` with `onClick` or `role="button"` is at least 30px tall at either
220
+ `size`; a display chip (and one with only `onRemove`) keeps its 24px or content height.
221
+ - **Table rows have a steady height.** With the default `comfortable` density a body row is at least
222
+ 48px and body cells pad 8px vertically instead of 11px: a one-line text row grows from about 41px
223
+ to 48px, and a row holding a 30px button shrinks from about 52px to 48px, so both match. Rows
224
+ taller than that (wrapped text) lose 6px. Pass `density="compact"` for 40px rows. Header cells are
225
+ unchanged. Cells rendered outside a `Table` keep the former 11px.
226
+ - **`Dialog` and `Drawer` close button is a 30px square** (`size-control-sm`, 44px under touch as
227
+ before) instead of a 24px one. It is centred on the same point, so the X glyph does not move.
228
+ - **Type change: `Select` and `TimeInput` no longer accept the native numeric `size` attribute**; `size`
229
+ is now the control size. A native `<select size={n}>` list box was never styled by `Select` (it
230
+ draws a single-line trigger with a chevron); use a plain `<select>` for that.
231
+
232
+ ### Overlay enter and exit motion
233
+
234
+ #### Changed
235
+
236
+ - **Overlays animate in and out.** `DropdownMenu` content and submenus, `ContextMenu` content, `Popover`,
237
+ the `SelectMenu` and `Combobox` listbox, `Tooltip` and `HoverCard` fade in while they
238
+ grow from 96% at their anchor (`transform-origin: var(--ui-popper-transform-origin)`) and slide 4px
239
+ in from the side they open on (`data-side`). `Dialog` and `AlertDialog` fade and settle from 97%;
240
+ `Drawer` slides in from the right; the scrim fades. The exit is the reverse at two thirds of the
241
+ duration and plays before the node unmounts. Timing is `--motion-duration` (180ms by default) and
242
+ `--motion-ease` from the theme, so style presets and `[data-motion]` retune it;
243
+ `prefers-reduced-motion: reduce` turns it off and unmounts at once. Enter uses `@starting-style`,
244
+ so it needs no stylesheet beyond what consumers already compile: `@jcsoftdev/ui/styles/tokens.css`,
245
+ `@jcsoftdev/ui/styles/theme.css` and the `@source` for the package's `dist`.
246
+ - **Menu items and listbox options fade their highlight** (120ms at the default duration). **Table
247
+ rows fade their hover background**, a sticky actions cell follows it, and the `RowActions` "more"
248
+ glyph is muted until its row is hovered or focused on devices that hover (never hidden).
249
+ - **Exit waits for the longest effect.** `usePresence` used to unmount on the first exit-relevant
250
+ `transitionend`/`animationend`; it now waits until no exit animation or transition on the node is
251
+ still running, so a consumer's own longer exit animation is not cut short by the built-in one.
252
+ - **Tests that query an overlay right after opening it in a real browser** may see it at opacity 0
253
+ (`toBeVisible()` from jest-dom fails) or still mounted for a moment after closing; wrap those
254
+ assertions in `waitFor`. jsdom and Playwright's `toBeVisible` are unaffected. The `forms`,
255
+ `overlays` and `shell` entries grow by a few hundred bytes gzip.
256
+
257
+ ### Page structure (G1, G4, G9, G10)
258
+
259
+ Additive; every new prop defaults to the previous behavior unless noted.
260
+
261
+ - **`ListDetail` (G1).** New `listWidth` (fixed list rail, number = px or any CSS length), `ratio`
262
+ (`1:1` default, `1:2`, `1:3`), `surface` (`flat` default, `card`), `stickyList` and `stickyOffset`
263
+ (the list column stays in view and scrolls on its own from 641px of the component's width). New
264
+ parts `ListDetailHeader` (`count`; search, filter chips and a result count above the list, passed as
265
+ `ListDetailList` `header`) and `ListDetailEmpty` (detail placeholder while nothing is selected).
266
+ Default look is unchanged. Markup change to check: `ListDetailList` now renders a column wrapper
267
+ (`data-list-detail-pane="list"`, carrying the divider and the hide-when-detail classes) around the
268
+ `ul`; the `ul` keeps its `aria-label`, `className` and props, but `list.parentElement` is no longer
269
+ the grid.
270
+ - **`PageHeader` (G4).** New slots `back` (with the new `PageHeaderBack` link: `href` or `asChild`,
271
+ localized "Back" label by default), `meta` (wrapping row of chips and facts) and `tabs` (full-width
272
+ `TabsNav` or `Tabs` list under the title), plus `sticky` and `stickyOffset` (the header, tabs
273
+ included, stays at the top of its scroll container on the page background). Without them the
274
+ header renders as before.
275
+ - **`Page` (G9).** New `aside` (a rail beside the content; 20rem by default, `asideWidth` to change
276
+ it, `asideSticky` to keep it in view), with the rail falling under the content at 1000px of page
277
+ width or less. The rail does not change the width the `page` container measures, so `Cols` inside
278
+ react the same with or without it. Without `aside` the markup is unchanged. `PageProps` is now an
279
+ interface extending the div props.
280
+ - **`DetailHeader` (G10), new in `@jcsoftdev/ui/containers`.** Record header for applicant, person and
281
+ student screens: `avatar`, `name` (heading, `headingLevel` default 2), `status`, `subtitle`,
282
+ `facts` (a `Facts` list) and `actions`; the actions wrap under the name from 480px of its own width
283
+ down.
284
+
285
+ ### Forms and empty states (G2, G7)
286
+
287
+ Additive and source compatible; no default changed. New UI strings `save` and `unsavedChanges` (en, es).
288
+
289
+ #### Added
290
+
291
+ - **Forms.** `FormSection` (`title`, `description`: the title column sits beside the fields from
292
+ 640px of container width and stacks above them in a narrower container), `Fieldset` (`legend`,
293
+ `description`, a native `fieldset`) and `FormFooter` (sticky by default; `onCancel`,
294
+ `cancelLabel`, `submitLabel`, `submitDisabled`, `dirty` for an "Unsaved changes" hint in a status
295
+ region, `busy` for a submit that stays focusable but inert and a disabled cancel). Typical form:
296
+ `Form > FormSection > FormGrid > Field`, then `FormFooter`.
297
+ - **`FormGrid` `columns` and `FormGridItem`.** `columns` 1 to 3 (default `2`, as before): 2 columns
298
+ from 620px and 3 from 900px of container width. `FormGridItem` `span` (1, 2, 3 or `"full"`) never
299
+ adds a column the grid does not have.
300
+ - **`Field` `required` and `disabled`.** `required` adds a visible `*` (hidden from assistive
301
+ tech) and `aria-required` on the control; native validation stays off. `disabled` disables the
302
+ control and mutes the label. Both reach the control the same way `error` does, also in a
303
+ multi-child field. New `required` part for `classNames`.
304
+ - **`EmptyState`.** `size="sm"` is an inline row (icon, title, description, action) to replace a
305
+ muted one-line paragraph. `icon` also takes `"inbox"`, `"search"` or `"lock"` (exported type
306
+ `EmptyStateIconName`) for a default domain icon; a node still works as before.
307
+
308
+ ### Data and dashboards (G3, G5, G6, G11)
309
+
310
+ Additive and source compatible, except for the barrel growth noted below. Guide: `/docs/data-and-dashboards/`.
311
+
312
+ #### Added
313
+
314
+ - **Dashboard blocks** (`@jcsoftdev/ui/containers`). `DashboardPage`, `KpiRow`, `CardGrid` (`columns` 2 or 3),
315
+ `ChartCard` (`height`) and `TableCard`, promoted from the stories. `KpiRow` is a named `group`;
316
+ `ChartCard` and `TableCard` are `section` landmarks named by their title (`headingLevel` 2 to 4).
317
+ Grids answer to the `page` container, never the viewport.
318
+ - **Sortable `Table`.** `TableHeaderCell sortable` (with a `columnId`) cycles ascending, descending and off
319
+ and reports `aria-sort`; `Table` takes `sort`, `defaultSort` and `onSortChange` (`TableSort`,
320
+ `nextTableSort`, `ariaSortFor`). The table reports the state, the app sorts the rows.
321
+ - **`TableEmpty`, `TableLoading` and column visibility.** `TableEmpty` is a row with an `EmptyState`
322
+ across `colSpan` columns; `TableLoading` renders placeholder rows with one status announcement;
323
+ `Table hiddenColumns` drops columns by `columnId` and `TableColumnsMenu` is the checkbox picker.
324
+ - **`Pagination`.** Standalone footer (1-based `page` and `pageSize`, controlled or not, `pageSizeOptions`,
325
+ `total`, `labels`) with the range text, first, previous, next and last buttons. `DataGrid` keeps its own.
326
+ - **`FilterBar`.** Search, `quickFilters` chips, a "More filters" popover (its `children`), removable
327
+ `activeFilters` chips, `onClearAll`, `resultCount` (polite status) and an `actions` slot. Under 40rem of
328
+ its own container width the chips and extra filters fold into one "Filters" button.
329
+ - **UI strings.** `tableEmpty`, `columns`, `pagination`, `rowsPerPage`, `pageRange`, `firstPage`,
330
+ `previousPage`, `nextPage`, `lastPage`, `search`, `filters`, `moreFilters`, `clearAllFilters`,
331
+ `removeFilter`, `activeFilters`, `resultOne` and `resultMany` (en and es). A custom `UiStrings` object
332
+ must add them to type-check.
333
+
334
+ #### Fixed
335
+
336
+ - **Exports.** `BottomNav` (and its helpers) is now exported from `@jcsoftdev/ui/shell`, and
337
+ `BulletChart` and `LollipopChart` from `@jcsoftdev/ui/charts`; all three were implemented and
338
+ documented but missing from their barrels. The `shell` entry now includes `BottomNav` and its
339
+ `Drawer`, so it grows by about 6 kB gzip for apps that import the whole barrel.
340
+
341
+ ### Motion (G8)
342
+
343
+ New `@jcsoftdev/ui/motion` entry, additive, no new dependency. Guide: `/docs/motion/`.
344
+
345
+ #### Added
346
+
347
+ - **`Reveal`** (`delay`, `inView`, `asChild`): fades content in with a 6px rise on a client mount,
348
+ or when it first scrolls into view.
349
+ - **`Stagger`** (`delay`, `inView`, `maxStagger`, `as`): children enter one after another, a quarter
350
+ duration apart, with the whole sequence capped by `maxStagger` (default 1.5 durations).
351
+ - **`CrossFade`** (`contentKey`) and **`Presence`** (`present`): keyed swap for list-detail panes and
352
+ tab panels. The old content fades out on top, out of the layout, `aria-hidden` and `inert`; focus
353
+ inside it moves to the new content.
354
+ - **`CountUp`** (`value`, `formatter`, `from`): counts to its value with any `Intl.NumberFormat`-style
355
+ formatter (default: the UI strings locale); reads as the final value to assistive tech and
356
+ reserves the final width. Works as a `Kpi` `value`.
357
+ - **`useHighlightRow(keys?)`** returning `{ highlight, rowProps }`, plus **`MotionStyles`**: an
358
+ accent pulse on inserted rows (automatic from `keys`) and updated rows (`highlight(key)`).
359
+ - Every duration and easing comes from `--motion-duration` and `--motion-ease`; enter and leave
360
+ animate only `opacity` and `transform` (the pulse fades a background colour). Server HTML and
361
+ hydration never animate, reduced motion reaches each end state at once, and hidden states use
362
+ `opacity` only, so assistive tech keeps reading the content.
363
+
3
364
  ## 0.5.0 (2026-10-23)
4
365
 
5
366
  ### Busy buttons keep focus (behavior to check when upgrading)
package/README.md CHANGED
@@ -31,6 +31,7 @@ Set these on `<html>` (or any element to restyle only its subtree); no rebuild i
31
31
  - Component groups: `@jcsoftdev/ui/atoms`, `forms`, `overlays`, `navigation`, `containers`, `states`, `shell`, `palette`, `calendar`, `charts`, `dashboards`, `utils`, each also per component (`@jcsoftdev/ui/atoms/button`).
32
32
  - `@jcsoftdev/ui/ai`: chat, prompt input, markdown and code block building blocks for AI interfaces.
33
33
  - `@jcsoftdev/ui/rich-text`: rich text editor with a sanitizer.
34
+ - `@jcsoftdev/ui/motion`: `Reveal`, `Stagger`, `CrossFade`, `Presence`, `CountUp` and `useHighlightRow`, on the `--motion-*` tokens and reduced-motion aware.
34
35
  - `@jcsoftdev/ui/i18n`: `UiStringsProvider`, `useUiStrings` and the `en`/`es` string presets.
35
36
  - `@jcsoftdev/ui/xlsx`: dependency-free `.xlsx` writer.
36
37
  - `@jcsoftdev/ui/brand`: logo mark and logo forge utilities.
@@ -116,14 +117,32 @@ https://ui.jcsoftdev.com/docs/customization/
116
117
  fixed hit areas (Checkbox, Switch, RadioGroup rows, an interactive Chip, the Dialog and Drawer close
117
118
  buttons) grow to at least 44px under it and are unchanged under every other level.
118
119
 
120
+ `data-density="auto"` picks the level from the input device, with CSS only: `normal` sizes on a fine
121
+ pointer (mouse, trackpad) and `touch` sizes under `@media (pointer: coarse)` (phones, tablets).
122
+ It is opt-in, not the default: with no attribute the kit keeps `normal` everywhere, so upgrading
123
+ never resizes an existing app on touch devices.
124
+
119
125
  ```html
120
- <html data-density="touch"> <!-- or any subtree: <main data-density="touch"> -->
126
+ <html data-density="auto"> <!-- or any subtree: <main data-density="touch"> -->
121
127
  ```
122
128
 
129
+ Recommended setup:
130
+
131
+ - Put `auto` on `<html>` so every screen adapts to the device.
132
+ - Force `touch` on operational screens (POS, kitchen display, kiosk) that are used by finger even
133
+ when a mouse is plugged in.
134
+ - Force `compact` or `normal` on dense admin tables.
135
+
136
+ An explicit level on a subtree always beats an `auto` ancestor, because each level redeclares the
137
+ whole set of density tokens on its own element. Fixed hit areas read `--touch-target` (0 or 44px) and
138
+ the `--touch` switch (0 or 1) instead of a selector, so they follow whichever level is nearest, `auto` included.
139
+
123
140
  Portaled content (Dialog, Drawer) leaves the subtree, so set the attribute on `<html>` or pass the
124
141
  `container` prop to keep it inside. Custom token files can declare absolute sizes per level:
125
142
  `{ "id": "touch", "density": 1.125, "values": { "control-height": "44px" } }`; the keys must be
126
- tokens listed in `styles.density.scaled`.
143
+ tokens listed in `styles.density.scaled` or `styles.density.fixed`. Both sides of `auto` are level
144
+ ids in `styles.density.auto` (`{ "fine": "normal", "coarse": "touch" }`); point them at other levels
145
+ to retune them, or remove the key to emit no `auto` level. `auto` is reserved and cannot be a level id.
127
146
 
128
147
  ## Localized default strings
129
148
 
@@ -141,7 +160,7 @@ import { UiStringsProvider } from "@jcsoftdev/ui/i18n";
141
160
 
142
161
  `uiStrings.en` and `uiStrings.es` export the presets; `useUiStrings()` reads the active set. A nested
143
162
  provider inherits its parent and overrides only the keys it passes. Hard-coded Spanish labels that
144
- older components already ship (NumberStepper, Carousel, AI set) are not routed through it yet.
163
+ older components already ship (Carousel, AI set) are not routed through it yet.
145
164
 
146
165
  ## Status, forms and states (additive props)
147
166
 
@@ -175,7 +194,10 @@ https://ui.jcsoftdev.com/docs/blocks/
175
194
  | `Wizard` | `navigation` | `Stepper` plus Back/Next/Finish: `steps`, async `canAdvance`, `onBeforeNext`, `onComplete`. |
176
195
  | `TabsNav`, `TabsNavLink` | `navigation` | Link-mode sub-navigation strip (`aria-current="page"`, `renderLink` or `asChild`). |
177
196
  | `Section`, `Note`, `Aside` | `containers` | Titled block with `actions` and optional `divider`, a text note with a `tone`, and a complementary region. |
178
- | `ListDetail` | `containers` | Master-detail that collapses to one pane under 641px of its own width. |
197
+ | `ListDetail` | `containers` | Master-detail that collapses to one pane under 641px of its own width. `listWidth` or `ratio` for a list rail, `surface="card"`, `stickyList`, a `ListDetailHeader` above the list and a `ListDetailEmpty` detail placeholder. |
198
+ | `PageHeader`, `PageHeaderBack` | `containers` | Page title block with `back`, `breadcrumbs`, `meta` and `tabs` rows and a `sticky` variant. |
199
+ | `Page` | `containers` | The `page` container; `aside` adds a side rail that stacks under the content at 1000px of page width. |
200
+ | `DetailHeader` | `containers` | Record header: `avatar`, `name`, `status`, `subtitle`, `facts` and `actions`. |
179
201
  | `Feed`, `FeedEvent` | `containers` | Activity log with a mark, text and `<time>` (absolute or `relative`). |
180
202
  | `Shortcuts`, `ShortcutsItem` | `containers` | Link or button tiles with `icon`, `count`, `kbd`. |
181
203
 
@@ -185,7 +207,11 @@ Additive props on existing components:
185
207
  | --- | --- |
186
208
  | `DescriptionList` | `layout` (`auto`, `inline`, `stacked`), `columns` (1 to 3), `valueAlign` (`end`, `start`); `DescriptionListItem` with a dash placeholder for empty values. |
187
209
  | `Chip` | `size="sm"` (compact; a tag is `<Chip size="sm" square>`). |
188
- | `Skeleton` | `variant` `list`, `kpis`, `key-value`, `bar` and `count`. |
210
+ | `Skeleton` | `variant` `list`, `kpis`, `key-value`, `bar` and `count`; `announce={false}` makes it silent (`aria-hidden`), and `SkeletonGroup` announces once for every skeleton inside it. |
211
+ | `NumberStepper` | `size` (`sm` 30px, `md`), `incrementLabel` / `decrementLabel`; the plus and minus buttons are named by the localized verb plus the field label (`aria-label`, `aria-labelledby` or the `<label>`). |
212
+ | `Avatar` | `decorative` (or `aria-hidden`) drops the image role and label, for an avatar beside a visible name. |
213
+ | `DialogHeader` | Stacks its title above the description at every width; pass `flex-row items-center` in `className` for the side-by-side layout. |
214
+ | `Toaster`, `ListDetail`, `ResponsiveList`, `Kanban` | Focus never falls to `<body>`: a toast action or dismissal returns it to the element focused when the toast was published (or its nearest surviving ancestor); an item removed while focused hands focus to the next one, the previous one, or the list. |
189
215
  | `ErrorState` | `actions` node, rendered in the same row as the retry button (the retry button now sits inside a wrapper `div`). |
190
216
  | `RadioGroup` | Each radio is named by its label and described by its description. |
191
217
  | `Checkbox`, `Switch` | The 44px touch target is an invisible `::after`; under touch density the layout box stays 40px. |
package/bin/ui-theme.mjs CHANGED
@@ -608,13 +608,22 @@ function stylesOf(tokens2) {
608
608
  };
609
609
  const density = styles.density ?? { levels: [] };
610
610
  const densityGoverned = new Set(
611
- density.levels.length ? ["density", ...density.scaled ?? []] : []
611
+ density.levels.length ? ["density", ...density.scaled ?? [], ...density.fixed ?? []] : []
612
612
  );
613
613
  for (const name of densityGoverned) {
614
614
  known(name, "density");
615
615
  if (isThemed(byName.get(name).value))
616
616
  throw new Error(`styles: density token "${name}" is themed`);
617
617
  }
618
+ const levelIds = new Set(density.levels.map((l) => l.id));
619
+ if (density.auto) {
620
+ if (levelIds.has("auto"))
621
+ throw new Error('styles: "auto" is reserved and cannot be a density level');
622
+ for (const side of ["fine", "coarse"]) {
623
+ if (!levelIds.has(density.auto[side]))
624
+ throw new Error(`styles: density auto.${side} names unknown level "${density.auto[side]}"`);
625
+ }
626
+ }
618
627
  for (const level of density.levels) {
619
628
  for (const name of Object.keys(level.values ?? {})) {
620
629
  if (!densityGoverned.has(name) || name === "density")
@@ -669,12 +678,26 @@ function buildStyleBlocks(tokens2) {
669
678
  });
670
679
  blocks.push(...variantBlocks("data-style", p.id, entries, themes));
671
680
  }
681
+ const fixed = new Set(s.density.fixed ?? []);
682
+ const densityEntries = (level) => s.densityGoverned.map((name) => {
683
+ if (name === "density") return [name, String(level.density)];
684
+ const base = s.byName.get(name).value;
685
+ return [
686
+ name,
687
+ level.values?.[name] ?? (fixed.has(name) ? base : `calc(${base} * var(--density))`)
688
+ ];
689
+ });
672
690
  for (const level of s.density.levels) {
673
- const entries = s.densityGoverned.map((name) => {
674
- if (name === "density") return [name, String(level.density)];
675
- return [name, level.values?.[name] ?? `calc(${s.byName.get(name).value} * var(--density))`];
676
- });
677
- blocks.push(...variantBlocks("data-density", level.id, entries, themes));
691
+ blocks.push(...variantBlocks("data-density", level.id, densityEntries(level), themes));
692
+ }
693
+ const auto = s.density.auto;
694
+ if (auto) {
695
+ const side = (id) => densityEntries(s.density.levels.find((l) => l.id === id));
696
+ blocks.push(...variantBlocks("data-density", "auto", side(auto.fine), themes));
697
+ const coarse = variantBlocks("data-density", "auto", side(auto.coarse), themes)[0];
698
+ blocks.push(`@media (pointer: coarse) {
699
+ ${indent(coarse)}
700
+ }`);
678
701
  }
679
702
  for (const level of s.radiusLevels) {
680
703
  const entries = s.radiusGoverned.flatMap((name) => {
@@ -782,6 +805,17 @@ function buildThemeCss(tokens2) {
782
805
  for (const s of tokens2.type?.sizeScale ?? []) {
783
806
  lines.push(` --text-${s.name}: ${s.fontSize};`);
784
807
  }
808
+ for (const [name, width] of Object.entries(tokens2.containers ?? {})) {
809
+ if (!TONE_NAME.test(name)) {
810
+ throw new Error(
811
+ `containers: "${name}" must be kebab-case (lowercase letters, digits, hyphens)`
812
+ );
813
+ }
814
+ if (!/^\d+(\.\d+)?(px|rem)$/.test(width)) {
815
+ throw new Error(`containers.${name}: "${width}" must be a literal px or rem width`);
816
+ }
817
+ lines.push(` --container-${name}: ${width};`);
818
+ }
785
819
  const styles = stylesOf(tokens2);
786
820
  for (const [themeVar, name] of Object.entries(tokens2.styles?.tailwind ?? {})) {
787
821
  if (!styles.byName.has(name)) throw new Error(`styles.tailwind: unknown token "${name}"`);
@@ -75,7 +75,7 @@ function CodeBlock({
75
75
  {
76
76
  tabIndex: 0,
77
77
  className: cn(
78
- "m-0 p-3 font-mono text-fs-125 leading-relaxed focus-visible:focus-ring",
78
+ "m-0 p-3 font-mono text-fs-120 leading-relaxed focus-visible:focus-ring",
79
79
  wrap ? "whitespace-pre-wrap break-words" : "overflow-x-auto",
80
80
  classNames?.pre
81
81
  ),
@@ -17,9 +17,14 @@ export interface AvatarProps extends Omit<ComponentPropsWithRef<"span">, "childr
17
17
  tone?: AvatarTone;
18
18
  /** Small status dot at the bottom-right corner. */
19
19
  status?: StatusDotTone;
20
+ /**
21
+ * Hides the avatar from assistive technology, for one beside a visible name that already says
22
+ * who it is. `aria-hidden` passed directly does the same.
23
+ */
24
+ decorative?: boolean;
20
25
  /** Accessible text for the status dot; defaults to the status name. */
21
26
  statusLabel?: string;
22
27
  /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
23
28
  classNames?: ClassNames<AvatarPart>;
24
29
  }
25
- export declare function Avatar({ name, src, size, highlighted, tone, status: statusTone, statusLabel, className, classNames, style, ...props }: AvatarProps): import("react").JSX.Element;
30
+ export declare function Avatar({ name, src, size, highlighted, tone, status: statusTone, statusLabel, decorative, className, classNames, style, ...props }: AvatarProps): import("react").JSX.Element;
@@ -69,6 +69,7 @@ function Avatar({
69
69
  tone = "neutral",
70
70
  status: statusTone,
71
71
  statusLabel,
72
+ decorative,
72
73
  className,
73
74
  classNames,
74
75
  style,
@@ -80,8 +81,8 @@ function Avatar({
80
81
  const avatar = /* @__PURE__ */ jsxs(
81
82
  "span",
82
83
  {
83
- role: "img",
84
- "aria-label": name,
84
+ ...decorative || props["aria-hidden"] ? {} : { role: "img", "aria-label": name },
85
+ ...decorative ? { "aria-hidden": true } : {},
85
86
  ...props,
86
87
  style: customToneStyle(tone, builtinTones, style),
87
88
  className: cn(
@@ -1,8 +1,8 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { cn } from "../../utils/cn.js";
3
3
  const sizeClasses = {
4
- normal: "text-fs-300",
5
- compact: "text-fs-220"
4
+ normal: "text-fs-240",
5
+ compact: "text-fs-200"
6
6
  };
7
7
  function BigDate({ size = "normal", className, ...props }) {
8
8
  return /* @__PURE__ */ jsx(
@@ -6,7 +6,11 @@ export type ButtonSize = "sm" | "md" | "lg";
6
6
  * `cn(buttonVariantClasses.primary, "bg-brand")` on a link, or `{ ...buttonVariantClasses, brand: "..." }`.
7
7
  */
8
8
  export declare const buttonVariantClasses: Readonly<Record<ButtonVariant, string>>;
9
- /** Class map behind each `size`; exported like {@link buttonVariantClasses}. */
9
+ /**
10
+ * Class map behind each `size`; exported like {@link buttonVariantClasses}. `sm` and `md` take the
11
+ * shared control heights (`--control-height-sm`, `--control-height-md`), so a button lines up with an
12
+ * `Input`, `Select`, `Combobox`, `DatePicker` or `TimeInput` of the same size.
13
+ */
10
14
  export declare const buttonSizeClasses: Readonly<Record<ButtonSize, string>>;
11
15
  export interface ButtonClassOptions {
12
16
  variant?: ButtonVariant;
@@ -21,6 +25,7 @@ export interface ButtonClassOptions {
21
25
  export declare function buttonClasses({ variant, size, block, className, }?: ButtonClassOptions): string;
22
26
  export interface ButtonProps extends ComponentPropsWithRef<"button"> {
23
27
  variant?: ButtonVariant;
28
+ /** `sm` is 30px and `md` (default) 38px, the heights every form control shares; `lg` is 52px. */
24
29
  size?: ButtonSize;
25
30
  /**
26
31
  * Busy state: the button keeps its focus and its full colour, ignores clicks (a submit button no
@@ -15,8 +15,8 @@ const buttonVariantClasses = {
15
15
  danger: "bg-danger-soft text-danger hover:bg-danger-soft/70"
16
16
  };
17
17
  const buttonSizeClasses = {
18
- sm: "h-control-sm px-3 text-fs-125 [&_svg]:size-3.5",
19
- md: "h-control px-control-x text-fs-130",
18
+ sm: "h-control-sm px-3 text-fs-120 [&_svg]:size-3.5",
19
+ md: "h-control-md px-control-x text-fs-130",
20
20
  lg: "h-control-lg px-control-x text-fs-140"
21
21
  };
22
22
  const baseClasses = "inline-flex min-w-0 max-w-full cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-button pressable focus-visible:focus-ring font-[650] no-underline disabled:cursor-not-allowed disabled:opacity-45 aria-busy:cursor-progress aria-busy:scale-none! [&_svg]:shrink-0";
@@ -20,6 +20,11 @@ export interface ChipProps extends ComponentPropsWithRef<"span"> {
20
20
  icon?: ReactNode;
21
21
  /** Prefix `info`, `success`, `warning` and `danger` chips with their status glyph. */
22
22
  statusIcon?: boolean;
23
+ /**
24
+ * A chip with `onClick` (or `role="button"`) is interactive and never shorter than 30px
25
+ * (`--control-height-sm`), the smallest hit area of the kit, whatever its `size`.
26
+ */
27
+ onClick?: ComponentPropsWithRef<"span">["onClick"];
23
28
  /** Appends a remove button that calls this. */
24
29
  onRemove?: () => void;
25
30
  /** Accessible name of the remove button. Defaults to the localized "Remove". */