@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
@@ -2,6 +2,7 @@
2
2
 
3
3
  import {
4
4
  type ComponentPropsWithoutRef,
5
+ type CSSProperties,
5
6
  createContext,
6
7
  type ReactNode,
7
8
  useCallback,
@@ -17,6 +18,7 @@ import { useUiStrings } from "../../i18n/index.js";
17
18
  import { ChevronLeft } from "../../icons/index.js";
18
19
  import { cn } from "../../utils/cn.js";
19
20
  import { composeHandlers } from "../../utils/compose.js";
21
+ import { useFocusRescue } from "../../utils/focus-rescue.js";
20
22
  import { useControllableState } from "../../utils/use-controllable-state.js";
21
23
 
22
24
  interface ListDetailContextValue {
@@ -39,6 +41,22 @@ export function useListDetail() {
39
41
  return { value, select, isSelected: (candidate: string) => candidate === value };
40
42
  }
41
43
 
44
+ /** List-to-detail width ratio when `listWidth` is not set: `1:1` (default), `1:2` or `1:3`. */
45
+ export type ListDetailRatio = "1:1" | "1:2" | "1:3";
46
+
47
+ const ratioClasses: Record<ListDetailRatio, string> = {
48
+ "1:1": "@min-[641px]/list-detail:grid-cols-2",
49
+ "1:2": "@min-[641px]/list-detail:grid-cols-[minmax(0,1fr)_minmax(0,2fr)]",
50
+ "1:3": "@min-[641px]/list-detail:grid-cols-[minmax(0,1fr)_minmax(0,3fr)]",
51
+ };
52
+
53
+ const FIXED_LIST_COLUMNS =
54
+ "@min-[641px]/list-detail:grid-cols-[minmax(0,var(--ld-list-width))_minmax(0,1fr)]";
55
+
56
+ function cssLength(value: number | string): string {
57
+ return typeof value === "number" ? `${value}px` : value;
58
+ }
59
+
42
60
  export interface ListDetailProps
43
61
  extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange"> {
44
62
  /** Controlled selected item id; `null` means none (the single-pane view then shows the list). */
@@ -56,6 +74,26 @@ export interface ListDetailProps
56
74
  onBack?: (() => void) | undefined;
57
75
  /** Names the list of items. */
58
76
  "aria-label": string;
77
+ /**
78
+ * Fixed width of the list column beside the detail, from 641px of the component's own width: a
79
+ * number is pixels, a string any CSS length (`"20rem"`). A rail of 280-360px reads better than
80
+ * an even split for most catalogues. Wins over `ratio`.
81
+ */
82
+ listWidth?: number | string | undefined;
83
+ /** Proportional split when `listWidth` is not set. Defaults to `"1:1"` (the original even split). */
84
+ ratio?: ListDetailRatio | undefined;
85
+ /**
86
+ * `"flat"` (default) keeps the panes flush with a divider between them. `"card"` draws each pane
87
+ * as a raised card with a gap between them.
88
+ */
89
+ surface?: "flat" | "card" | undefined;
90
+ /**
91
+ * Keeps the list column in view while the page scrolls and gives it its own scroll, from 641px
92
+ * of the component's own width. The list header stays at the top of the column.
93
+ */
94
+ stickyList?: boolean | undefined;
95
+ /** Distance the sticky list keeps from the top of its scroll container (number = pixels). Default `0`. */
96
+ stickyOffset?: number | string | undefined;
59
97
  children: ReactNode;
60
98
  }
61
99
 
@@ -70,7 +108,13 @@ export function ListDetail({
70
108
  onValueChange,
71
109
  onBack,
72
110
  "aria-label": label,
111
+ listWidth,
112
+ ratio = "1:1",
113
+ surface = "flat",
114
+ stickyList = false,
115
+ stickyOffset,
73
116
  className,
117
+ style,
74
118
  children,
75
119
  ...props
76
120
  }: ListDetailProps) {
@@ -92,6 +136,7 @@ export function ListDetail({
92
136
  );
93
137
  const rootRef = useRef<HTMLDivElement>(null);
94
138
  const previous = useRef<string | null>(value);
139
+ useFocusRescue(rootRef, { item: "[data-list-detail-item]", group: "ul" });
95
140
 
96
141
  useEffect(() => {
97
142
  const before = previous.current;
@@ -112,12 +157,27 @@ export function ListDetail({
112
157
 
113
158
  return (
114
159
  <ListDetailContext.Provider value={context}>
115
- <div {...props} ref={rootRef} className={cn("@container/list-detail min-w-0", className)}>
160
+ <div
161
+ {...props}
162
+ ref={rootRef}
163
+ className={cn("@container/list-detail min-w-0", className)}
164
+ style={
165
+ {
166
+ ...style,
167
+ ...(listWidth !== undefined ? { "--ld-list-width": cssLength(listWidth) } : null),
168
+ ...(stickyOffset !== undefined ? { "--ld-sticky-top": cssLength(stickyOffset) } : null),
169
+ } as CSSProperties
170
+ }
171
+ >
116
172
  <div
117
173
  data-view={value === null ? "list" : "detail"}
174
+ data-surface={surface}
175
+ data-sticky-list={stickyList ? "" : undefined}
118
176
  className={cn(
119
- "group/ld grid grid-cols-1 border-t-divider",
120
- "@min-[641px]/list-detail:grid-cols-2",
177
+ "group/ld grid grid-cols-1",
178
+ surface === "flat" && "border-t-divider",
179
+ listWidth !== undefined ? FIXED_LIST_COLUMNS : ratioClasses[ratio],
180
+ surface === "card" && "@min-[641px]/list-detail:gap-4",
121
181
  "[&>*]:min-w-0",
122
182
  )}
123
183
  >
@@ -128,22 +188,65 @@ export function ListDetail({
128
188
  );
129
189
  }
130
190
 
131
- export type ListDetailListProps = Omit<ComponentPropsWithoutRef<"ul">, "aria-label">;
191
+ export interface ListDetailListProps extends Omit<ComponentPropsWithoutRef<"ul">, "aria-label"> {
192
+ /** Sits above the items and stays put while they scroll: a `ListDetailHeader` with search, filters and a count. */
193
+ header?: ReactNode;
194
+ }
132
195
 
133
- export function ListDetailList({ className, ...props }: ListDetailListProps) {
196
+ /**
197
+ * The list column: an optional `header` above the item list. The `ul` is named by the
198
+ * `ListDetail`'s `aria-label`; `className` and the other props go to it.
199
+ */
200
+ export function ListDetailList({ header, className, ...props }: ListDetailListProps) {
134
201
  const { label } = useListDetailContext("ListDetailList");
135
202
  return (
136
- <ul
203
+ <div
137
204
  data-list-detail-pane="list"
138
- aria-label={label}
139
205
  className={cn(
140
- "m-0 flex list-none flex-col p-0",
206
+ "flex min-h-0 min-w-0 flex-col",
141
207
  "@min-[641px]/list-detail:border-r-divider",
142
208
  "group-data-[view=detail]/ld:@max-[640px]/list-detail:hidden",
209
+ "group-data-[surface=card]/ld:overflow-hidden group-data-[surface=card]/ld:rounded-card group-data-[surface=card]/ld:border-card group-data-[surface=card]/ld:shadow-card group-data-[surface=card]/ld:surface-card group-data-[surface=card]/ld:@min-[641px]/list-detail:border-r-0",
210
+ "group-data-[sticky-list]/ld:@min-[641px]/list-detail:sticky group-data-[sticky-list]/ld:@min-[641px]/list-detail:top-(--ld-sticky-top,0px) group-data-[sticky-list]/ld:@min-[641px]/list-detail:max-h-[calc(100dvh-var(--ld-sticky-top,0px))] group-data-[sticky-list]/ld:@min-[641px]/list-detail:self-start",
211
+ )}
212
+ >
213
+ {header}
214
+ <ul
215
+ aria-label={label}
216
+ className={cn(
217
+ "m-0 flex min-h-0 list-none flex-col p-0",
218
+ "group-data-[sticky-list]/ld:@min-[641px]/list-detail:overflow-y-auto",
219
+ "group-data-[surface=card]/ld:p-2",
220
+ className,
221
+ )}
222
+ {...props}
223
+ />
224
+ </div>
225
+ );
226
+ }
227
+
228
+ export interface ListDetailHeaderProps extends ComponentPropsWithoutRef<"div"> {
229
+ /** End slot showing how many items match, e.g. `12`. Announced politely when it changes. */
230
+ count?: ReactNode;
231
+ }
232
+
233
+ /** Controls row of the list column: a search field, filter chips and a result count. */
234
+ export function ListDetailHeader({ count, className, children, ...props }: ListDetailHeaderProps) {
235
+ return (
236
+ <div
237
+ className={cn(
238
+ "flex shrink-0 flex-wrap items-center gap-2 border-b-divider py-2.5 group-data-[surface=card]/ld:px-3",
143
239
  className,
144
240
  )}
145
241
  {...props}
146
- />
242
+ >
243
+ {children}
244
+ {count !== undefined ? (
245
+ <span aria-live="polite" className="ml-auto text-count text-ink-3">
246
+ {count}
247
+ </span>
248
+ ) : null}
249
+ </div>
147
250
  );
148
251
  }
149
252
 
@@ -172,6 +275,7 @@ export function ListDetailItem({
172
275
  onClick={composeHandlers(onClick, () => select(value))}
173
276
  className={cn(
174
277
  "grid min-h-11 w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b-divider py-2.5 text-start hover:bg-surface-2 focus-visible:-outline-offset-2 focus-visible:focus-ring aria-[current=true]:bg-accent-soft",
278
+ "group-data-[surface=card]/ld:rounded-button group-data-[surface=card]/ld:border-b-0 group-data-[surface=card]/ld:px-3",
175
279
  className,
176
280
  )}
177
281
  {...props}
@@ -234,6 +338,7 @@ export function ListDetailDetail({
234
338
  className={cn(
235
339
  "flex min-w-0 flex-col outline-none",
236
340
  "group-data-[view=list]/ld:@max-[640px]/list-detail:hidden",
341
+ "group-data-[surface=card]/ld:rounded-card group-data-[surface=card]/ld:border-card group-data-[surface=card]/ld:px-card group-data-[surface=card]/ld:pb-card group-data-[surface=card]/ld:shadow-card group-data-[surface=card]/ld:surface-card",
237
342
  className,
238
343
  )}
239
344
  >
@@ -291,3 +396,48 @@ export function ListDetailDetailHeader({
291
396
  </div>
292
397
  );
293
398
  }
399
+
400
+ export interface ListDetailEmptyProps extends Omit<ComponentPropsWithoutRef<"div">, "title"> {
401
+ /** Decorative icon; hidden from screen readers. */
402
+ icon?: ReactNode;
403
+ title: ReactNode;
404
+ description?: ReactNode;
405
+ /** Call to action under the text. */
406
+ action?: ReactNode;
407
+ }
408
+
409
+ /**
410
+ * Placeholder for the detail pane while nothing is selected ("Choose an item"). Render it inside
411
+ * `ListDetailDetail`; it renders nothing once an item is selected, so it needs no condition.
412
+ */
413
+ export function ListDetailEmpty({
414
+ icon,
415
+ title,
416
+ description,
417
+ action,
418
+ className,
419
+ ...props
420
+ }: ListDetailEmptyProps) {
421
+ const { value } = useListDetailContext("ListDetailEmpty");
422
+ if (value !== null) return null;
423
+ return (
424
+ <div
425
+ className={cn(
426
+ "flex min-h-64 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center",
427
+ className,
428
+ )}
429
+ {...props}
430
+ >
431
+ {icon !== undefined ? (
432
+ <span aria-hidden="true" className="inline-flex text-ink-3 [&_svg]:size-8">
433
+ {icon}
434
+ </span>
435
+ ) : null}
436
+ <p className="m-0 font-semibold text-ink text-row-title">{title}</p>
437
+ {description !== undefined ? (
438
+ <p className="m-0 max-w-[44ch] text-ink-3 text-meta">{description}</p>
439
+ ) : null}
440
+ {action !== undefined ? <div className="mt-2">{action}</div> : null}
441
+ </div>
442
+ );
443
+ }
@@ -1,17 +1,71 @@
1
- import type { ComponentPropsWithoutRef } from "react";
1
+ import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from "react";
2
2
  import { cn } from "../../utils/cn.js";
3
3
 
4
- export type PageProps = ComponentPropsWithoutRef<"div">;
4
+ export interface PageProps extends ComponentPropsWithoutRef<"div"> {
5
+ /**
6
+ * A fixed column beside the page content, usually an `Aside`. The column draws a divider and the
7
+ * page background, never narrows the width the `page` container measures (so `Cols` inside the
8
+ * content react the same with or without it), and falls under the content once the page is
9
+ * 1000px wide or less. With an aside, `className` and the other props apply to the content column.
10
+ */
11
+ aside?: ReactNode;
12
+ /** Width of the aside column: a number is pixels, a string any CSS length. Default `20rem` (320px at 16px). */
13
+ asideWidth?: number | string;
14
+ /** Keeps the aside column in view and scrolls it on its own beside the content (above 1000px). */
15
+ asideSticky?: boolean;
16
+ }
17
+
18
+ const CONTENT = "flex w-full min-w-0 flex-col gap-6";
5
19
 
6
20
  /**
7
21
  * Vertical flow of page sections. It is the `page` container, so `Cols` and `SettingsLayout`
8
- * inside it react to the page width instead of the viewport.
22
+ * inside it react to the page width instead of the viewport. With `aside` the page is a content
23
+ * column plus a rail; the shell around the page still owns the outer gutter and scrolling.
9
24
  */
10
- export function Page({ className, ...props }: PageProps) {
25
+ export function Page({
26
+ aside,
27
+ asideWidth,
28
+ asideSticky = false,
29
+ className,
30
+ style,
31
+ children,
32
+ ...props
33
+ }: PageProps) {
34
+ if (aside === undefined) {
35
+ return (
36
+ <div className={cn("@container/page", CONTENT, className)} style={style} {...props}>
37
+ {children}
38
+ </div>
39
+ );
40
+ }
41
+ const width =
42
+ asideWidth === undefined
43
+ ? undefined
44
+ : typeof asideWidth === "number"
45
+ ? `${asideWidth}px`
46
+ : asideWidth;
11
47
  return (
12
48
  <div
13
- className={cn("@container/page flex w-full min-w-0 flex-col gap-6", className)}
14
- {...props}
15
- />
49
+ data-page-aside=""
50
+ className="@container/page w-full min-w-0"
51
+ style={width === undefined ? undefined : ({ "--page-aside-width": width } as CSSProperties)}
52
+ >
53
+ <div className="grid grid-cols-[minmax(0,1fr)_var(--page-aside-width,20rem)] items-start @max-[1000px]/page:grid-cols-[minmax(0,1fr)]">
54
+ <div className={cn(CONTENT, className)} style={style} {...props}>
55
+ {children}
56
+ </div>
57
+ <div
58
+ data-page-rail=""
59
+ className={cn(
60
+ "flex min-w-0 flex-col self-stretch border-l-divider bg-surface",
61
+ "@max-[1000px]/page:border-t-divider @max-[1000px]/page:border-l-0",
62
+ asideSticky &&
63
+ "@min-[1001px]/page:sticky @min-[1001px]/page:top-0 @min-[1001px]/page:max-h-dvh @min-[1001px]/page:self-start @min-[1001px]/page:overflow-y-auto",
64
+ )}
65
+ >
66
+ {aside}
67
+ </div>
68
+ </div>
69
+ </div>
16
70
  );
17
71
  }
@@ -0,0 +1,42 @@
1
+ "use client";
2
+
3
+ import type { ComponentPropsWithoutRef } from "react";
4
+ import { useUiStrings } from "../../i18n/index.js";
5
+ import { ChevronLeft } from "../../icons/index.js";
6
+ import { cn } from "../../utils/cn.js";
7
+ import { Slot } from "../../utils/slot.js";
8
+
9
+ export interface PageHeaderBackProps extends ComponentPropsWithoutRef<"a"> {
10
+ /** Renders the single child element (a router `Link`) with the link's look. The child supplies the label. */
11
+ asChild?: boolean | undefined;
12
+ }
13
+
14
+ /**
15
+ * The way back to the parent screen, for `PageHeader`'s `back` slot. A real link: pass `href`, or
16
+ * `asChild` with your router's `Link`. The label defaults to the localized "Back".
17
+ */
18
+ export function PageHeaderBack({
19
+ asChild = false,
20
+ className,
21
+ children,
22
+ ...props
23
+ }: PageHeaderBackProps) {
24
+ const strings = useUiStrings();
25
+ const classes = cn(
26
+ "inline-flex min-h-8 items-center gap-1 text-control text-ink-2 no-underline hover:text-ink focus-visible:focus-ring",
27
+ className,
28
+ );
29
+ if (asChild) {
30
+ return (
31
+ <Slot {...props} className={classes}>
32
+ {children}
33
+ </Slot>
34
+ );
35
+ }
36
+ return (
37
+ <a {...props} className={classes}>
38
+ <ChevronLeft aria-hidden="true" className="size-4" />
39
+ {children ?? strings.back}
40
+ </a>
41
+ );
42
+ }
@@ -1 +1,2 @@
1
+ export * from "./back.js";
1
2
  export * from "./page-header.js";
@@ -1,4 +1,4 @@
1
- import type { ComponentPropsWithoutRef, ReactNode } from "react";
1
+ import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from "react";
2
2
  import { cn } from "../../utils/cn.js";
3
3
 
4
4
  export interface PageHeaderProps extends ComponentPropsWithoutRef<"header"> {
@@ -6,32 +6,78 @@ export interface PageHeaderProps extends ComponentPropsWithoutRef<"header"> {
6
6
  breadcrumbs?: ReactNode;
7
7
  /** Tighter, centred header with a smaller title and a body-size lede. */
8
8
  compact?: boolean;
9
+ /** Link to the parent screen on its own row above the title: a `PageHeaderBack`. Shown before `breadcrumbs`. */
10
+ back?: ReactNode;
11
+ /** Row under the title block for status chips and short facts. Wraps; never needs a container query. */
12
+ meta?: ReactNode;
13
+ /**
14
+ * Sub-navigation under the title, full width: a `TabsNav` (route tabs) or a `Tabs` list. The
15
+ * strip carries its own bottom divider, so it closes the header.
16
+ */
17
+ tabs?: ReactNode;
18
+ /**
19
+ * Keeps the whole header, tabs included, at the top of its scroll container with an opaque page
20
+ * background. The navigation inside stays reachable while the page scrolls.
21
+ */
22
+ sticky?: boolean;
23
+ /** Distance a sticky header keeps from the top of its scroll container (number = pixels). Default `0`. */
24
+ stickyOffset?: number | string;
9
25
  }
10
26
 
11
27
  /**
12
28
  * Page header. No required parts: compose an eyebrow / title / lede block in
13
29
  * a plain `<div>` and, when the view has buttons, `PageHeaderActions` as the
14
- * second child. Actions wrap under the title when the container is too narrow.
30
+ * second child. Actions wrap under the title when the container is too narrow. `back`,
31
+ * `breadcrumbs`, `meta` and `tabs` each take a full-width row around the children.
15
32
  */
16
33
  export function PageHeader({
17
34
  breadcrumbs,
35
+ back,
36
+ meta,
37
+ tabs,
38
+ sticky,
39
+ stickyOffset,
18
40
  className,
19
41
  compact,
42
+ style,
20
43
  children,
21
44
  ...props
22
45
  }: PageHeaderProps) {
23
46
  return (
24
47
  <header
25
48
  data-compact={compact ? "" : undefined}
49
+ data-sticky={sticky ? "" : undefined}
26
50
  className={cn(
27
51
  "flex flex-wrap items-end justify-between gap-x-6 gap-y-3.5",
28
52
  compact && "flex-col items-center justify-center gap-y-2 text-center",
53
+ sticky && "sticky top-(--page-header-top,0px) z-10 bg-surface",
29
54
  className,
30
55
  )}
56
+ style={
57
+ stickyOffset === undefined
58
+ ? style
59
+ : ({
60
+ ...style,
61
+ "--page-header-top":
62
+ typeof stickyOffset === "number" ? `${stickyOffset}px` : stickyOffset,
63
+ } as CSSProperties)
64
+ }
31
65
  {...props}
32
66
  >
67
+ {back ? <div className="basis-full">{back}</div> : null}
33
68
  {breadcrumbs ? <div className="basis-full">{breadcrumbs}</div> : null}
34
69
  {children}
70
+ {meta ? (
71
+ <div
72
+ className={cn(
73
+ "flex basis-full flex-wrap items-center gap-x-3 gap-y-1.5 text-ink-2 text-meta",
74
+ compact && "justify-center",
75
+ )}
76
+ >
77
+ {meta}
78
+ </div>
79
+ ) : null}
80
+ {tabs ? <div className="basis-full">{tabs}</div> : null}
35
81
  </header>
36
82
  );
37
83
  }
@@ -54,7 +100,7 @@ export function PageHeaderTitle({ className, ...props }: PageHeaderTitleProps) {
54
100
  return (
55
101
  <h1
56
102
  className={cn(
57
- "m-0 break-words text-page-title [text-wrap:balance] in-data-compact:text-fs-220",
103
+ "m-0 break-words text-page-title [text-wrap:balance] in-data-compact:text-fs-200",
58
104
  className,
59
105
  )}
60
106
  {...props}
@@ -0,0 +1,79 @@
1
+ "use client";
2
+
3
+ import { type ComponentPropsWithoutRef, useMemo } from "react";
4
+ import { Button } from "../../atoms/button/button.js";
5
+ import { useUiStrings } from "../../i18n/index.js";
6
+ import { cn } from "../../utils/cn.js";
7
+ import { formatRange } from "./range.js";
8
+
9
+ export interface CursorPaginationLabels {
10
+ nav: string;
11
+ /** `{first}` and `{last}` are replaced. */
12
+ range: string;
13
+ previous: string;
14
+ next: string;
15
+ }
16
+
17
+ export interface CursorPaginationProps
18
+ extends Omit<ComponentPropsWithoutRef<"nav">, "children" | "onChange"> {
19
+ /** 1-based page the cursor trail is on. */
20
+ page: number;
21
+ /** Rows on this page. */
22
+ count: number;
23
+ /** Rows per page, to number the range. Default 25. */
24
+ pageSize?: number;
25
+ /** Whether the server reported a next cursor. */
26
+ hasNext: boolean;
27
+ onPrevious: () => void;
28
+ onNext: () => void;
29
+ /** Texts (localized by default through `UiStrings`). */
30
+ labels?: Partial<CursorPaginationLabels>;
31
+ }
32
+
33
+ /**
34
+ * Footer for server-side cursor paging, where the total is unknown: the range on screen ("Showing
35
+ * 26–50") and Previous / Next. Keep the cursor trail yourself; this only reports the clicks. It
36
+ * renders nothing while the whole list fits on the first page.
37
+ */
38
+ export function CursorPagination({
39
+ page,
40
+ count,
41
+ pageSize = 25,
42
+ hasNext,
43
+ onPrevious,
44
+ onNext,
45
+ labels,
46
+ className,
47
+ ...props
48
+ }: CursorPaginationProps) {
49
+ const strings = useUiStrings();
50
+ const format = useMemo(() => new Intl.NumberFormat(strings.locale), [strings.locale]);
51
+ if (page <= 1 && !hasNext) return null;
52
+ const first = (Math.max(1, page) - 1) * pageSize + 1;
53
+ const last = first + Math.max(count, 1) - 1;
54
+ return (
55
+ <nav
56
+ aria-label={labels?.nav ?? strings.pagination}
57
+ className={cn(
58
+ "flex min-w-0 flex-wrap items-center justify-between gap-x-4 gap-y-2 py-2 text-fs-120 text-ink-2",
59
+ className,
60
+ )}
61
+ {...props}
62
+ >
63
+ <span aria-live="polite" className="tabular-nums">
64
+ {formatRange(labels?.range ?? strings.showingRangeOpen, {
65
+ first: format.format(first),
66
+ last: format.format(last),
67
+ })}
68
+ </span>
69
+ <span className="flex items-center gap-1">
70
+ <Button size="sm" disabled={page <= 1} onClick={onPrevious}>
71
+ {labels?.previous ?? strings.previous}
72
+ </Button>
73
+ <Button size="sm" disabled={!hasNext} onClick={onNext}>
74
+ {labels?.next ?? strings.next}
75
+ </Button>
76
+ </span>
77
+ </nav>
78
+ );
79
+ }
@@ -0,0 +1,7 @@
1
+ export {
2
+ CursorPagination,
3
+ type CursorPaginationLabels,
4
+ type CursorPaginationProps,
5
+ } from "./cursor-pagination.js";
6
+ export { Pagination, type PaginationLabels, type PaginationProps } from "./pagination.js";
7
+ export { type PaginationState, usePagination } from "./use-pagination.js";