@jcsoftdev/ui 0.4.0 → 0.6.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 (489) hide show
  1. package/CHANGELOG.md +434 -0
  2. package/README.md +26 -4
  3. package/bin/ui-theme.mjs +40 -6
  4. package/dist/ai/code-block/code-block.js +1 -1
  5. package/dist/atoms/big-date/big-date.js +2 -2
  6. package/dist/atoms/button/button.d.ts +14 -2
  7. package/dist/atoms/button/button.js +12 -5
  8. package/dist/atoms/chip/chip.d.ts +5 -0
  9. package/dist/atoms/chip/chip.js +3 -3
  10. package/dist/atoms/divider/divider.d.ts +15 -0
  11. package/dist/atoms/divider/divider.js +27 -0
  12. package/dist/atoms/divider/index.d.ts +1 -0
  13. package/dist/atoms/divider/index.js +1 -0
  14. package/dist/atoms/icon-button/icon-button.d.ts +1 -1
  15. package/dist/atoms/icon-button/icon-button.js +1 -1
  16. package/dist/atoms/index.d.ts +1 -0
  17. package/dist/atoms/index.js +1 -0
  18. package/dist/atoms/internal/hit-area.d.ts +5 -4
  19. package/dist/atoms/internal/hit-area.js +1 -1
  20. package/dist/atoms/progress/index.d.ts +1 -1
  21. package/dist/atoms/progress/index.js +4 -1
  22. package/dist/atoms/progress/progress.d.ts +6 -1
  23. package/dist/atoms/progress/progress.js +19 -1
  24. package/dist/atoms/radio-group/radio-group.js +1 -1
  25. package/dist/atoms/status-pill/status-pill.d.ts +16 -5
  26. package/dist/atoms/status-pill/status-pill.js +43 -18
  27. package/dist/auth/auth-illustration/auth-illustration.d.ts +35 -0
  28. package/dist/auth/auth-illustration/auth-illustration.js +72 -0
  29. package/dist/auth/auth-illustration/index.d.ts +3 -0
  30. package/dist/auth/auth-illustration/index.js +11 -0
  31. package/dist/auth/auth-illustration/look.d.ts +30 -0
  32. package/dist/auth/auth-illustration/look.js +0 -0
  33. package/dist/auth/auth-illustration/model.d.ts +133 -0
  34. package/dist/auth/auth-illustration/model.js +202 -0
  35. package/dist/auth/auth-illustration/use-art-pointer.d.ts +9 -0
  36. package/dist/auth/auth-illustration/use-art-pointer.js +69 -0
  37. package/dist/auth/auth-layout/auth-layout.d.ts +80 -0
  38. package/dist/auth/auth-layout/auth-layout.js +190 -0
  39. package/dist/auth/auth-layout/index.d.ts +1 -0
  40. package/dist/auth/auth-layout/index.js +1 -0
  41. package/dist/auth/character/character.d.ts +12 -0
  42. package/dist/auth/character/character.js +333 -0
  43. package/dist/auth/character/index.d.ts +1 -0
  44. package/dist/auth/character/index.js +1 -0
  45. package/dist/auth/index.d.ts +4 -0
  46. package/dist/auth/index.js +4 -0
  47. package/dist/auth/internal/auth-context.d.ts +17 -0
  48. package/dist/auth/internal/auth-context.js +10 -0
  49. package/dist/auth/internal/auth-styles.d.ts +1 -0
  50. package/dist/auth/internal/auth-styles.js +29 -0
  51. package/dist/auth/internal/portal-glyphs.d.ts +6 -0
  52. package/dist/auth/internal/portal-glyphs.js +39 -0
  53. package/dist/auth/login-form/context.d.ts +51 -0
  54. package/dist/auth/login-form/context.js +12 -0
  55. package/dist/auth/login-form/index.d.ts +2 -0
  56. package/dist/auth/login-form/index.js +23 -0
  57. package/dist/auth/login-form/login-form.d.ts +66 -0
  58. package/dist/auth/login-form/login-form.js +233 -0
  59. package/dist/auth/login-form/parts.d.ts +71 -0
  60. package/dist/auth/login-form/parts.js +371 -0
  61. package/dist/auth/looks/auth-illustration-any.d.ts +16 -0
  62. package/dist/auth/looks/auth-illustration-any.js +24 -0
  63. package/dist/auth/looks/index.d.ts +1 -0
  64. package/dist/auth/looks/index.js +1 -0
  65. package/dist/auth/mosaic/index.d.ts +1 -0
  66. package/dist/auth/mosaic/index.js +1 -0
  67. package/dist/auth/mosaic/mosaic.d.ts +11 -0
  68. package/dist/auth/mosaic/mosaic.js +195 -0
  69. package/dist/auth/slabs/index.d.ts +1 -0
  70. package/dist/auth/slabs/index.js +1 -0
  71. package/dist/auth/slabs/slabs.d.ts +13 -0
  72. package/dist/auth/slabs/slabs.js +136 -0
  73. package/dist/auth/stack/index.d.ts +1 -0
  74. package/dist/auth/stack/index.js +1 -0
  75. package/dist/auth/stack/stack.d.ts +6 -0
  76. package/dist/auth/stack/stack.js +222 -0
  77. package/dist/auth/statement/index.d.ts +1 -0
  78. package/dist/auth/statement/index.js +1 -0
  79. package/dist/auth/statement/statement.d.ts +13 -0
  80. package/dist/auth/statement/statement.js +99 -0
  81. package/dist/brand/logo-forge.js +1 -1
  82. package/dist/charts/candlestick-chart/candlestick-chart.js +2 -2
  83. package/dist/charts/chart-grid/chart-grid.js +2 -2
  84. package/dist/charts/chord-chart/chord-chart.js +1 -1
  85. package/dist/charts/core/axes.js +2 -2
  86. package/dist/charts/core/cartesian/annotations.js +2 -2
  87. package/dist/charts/core/cartesian/marks.js +1 -1
  88. package/dist/charts/core/distribution/marks.js +1 -1
  89. package/dist/charts/core/distribution/xy-points.js +1 -1
  90. package/dist/charts/core/export-menu.js +1 -1
  91. package/dist/charts/funnel-chart/funnel-chart.js +1 -1
  92. package/dist/charts/gantt-chart/gantt-chart.js +4 -4
  93. package/dist/charts/gantt-chart/gantt-marks.js +3 -3
  94. package/dist/charts/index.d.ts +2 -0
  95. package/dist/charts/index.js +2 -0
  96. package/dist/charts/maps/geo/map-data-table.js +1 -1
  97. package/dist/charts/polar-area-chart/polar-area-chart.js +1 -1
  98. package/dist/charts/radar-chart/radar-chart.js +1 -1
  99. package/dist/charts/stock-chart/stock-chart.js +1 -1
  100. package/dist/charts/stock-chart/stock-drawing-layer.js +3 -3
  101. package/dist/charts/stock-chart/stock-plot.js +2 -2
  102. package/dist/containers/chat-thread/chat-thread.d.ts +98 -0
  103. package/dist/containers/chat-thread/chat-thread.js +219 -0
  104. package/dist/containers/chat-thread/format.d.ts +20 -0
  105. package/dist/containers/chat-thread/format.js +50 -0
  106. package/dist/containers/chat-thread/index.d.ts +1 -0
  107. package/dist/containers/chat-thread/index.js +8 -0
  108. package/dist/containers/cols/cols.d.ts +1 -1
  109. package/dist/containers/cols/cols.js +7 -0
  110. package/dist/containers/comment/comment.js +1 -1
  111. package/dist/containers/context-rail/context-rail.d.ts +62 -0
  112. package/dist/containers/context-rail/context-rail.js +175 -0
  113. package/dist/containers/context-rail/index.d.ts +1 -0
  114. package/dist/containers/context-rail/index.js +6 -0
  115. package/dist/containers/dashboard/dashboard.d.ts +40 -0
  116. package/dist/containers/dashboard/dashboard.js +84 -0
  117. package/dist/containers/dashboard/index.d.ts +1 -0
  118. package/dist/containers/dashboard/index.js +14 -0
  119. package/dist/containers/data-grid/data-grid.demos.js +4 -4
  120. package/dist/containers/data-grid/data-grid.js +6 -6
  121. package/dist/containers/data-grid/filter-builder-editor.js +2 -2
  122. package/dist/containers/data-grid/grid-toolbar.js +1 -1
  123. package/dist/containers/data-grid/spreadsheet.demos.d.ts +1 -1
  124. package/dist/containers/data-grid/spreadsheet.demos.js +1 -1
  125. package/dist/containers/detail-header/detail-header.d.ts +24 -0
  126. package/dist/containers/detail-header/detail-header.js +32 -0
  127. package/dist/containers/detail-header/index.d.ts +1 -0
  128. package/dist/containers/detail-header/index.js +6 -0
  129. package/dist/containers/facts/facts.js +1 -1
  130. package/dist/containers/filter-bar/filter-bar.d.ts +58 -0
  131. package/dist/containers/filter-bar/filter-bar.js +123 -0
  132. package/dist/containers/filter-bar/index.d.ts +1 -0
  133. package/dist/containers/filter-bar/index.js +6 -0
  134. package/dist/containers/hbars/hbars.js +2 -2
  135. package/dist/containers/index.d.ts +9 -0
  136. package/dist/containers/index.js +9 -0
  137. package/dist/containers/kanban/kanban.d.ts +23 -2
  138. package/dist/containers/kanban/kanban.js +101 -21
  139. package/dist/containers/kanban/model.d.ts +12 -0
  140. package/dist/containers/kanban/model.js +8 -0
  141. package/dist/containers/kpi/kpi.js +1 -1
  142. package/dist/containers/kpi-group/kpi-group.d.ts +6 -1
  143. package/dist/containers/kpi-group/kpi-group.js +6 -2
  144. package/dist/containers/list-detail/index.d.ts +1 -1
  145. package/dist/containers/list-detail/index.js +4 -0
  146. package/dist/containers/list-detail/list-detail.d.ts +51 -3
  147. package/dist/containers/list-detail/list-detail.js +109 -15
  148. package/dist/containers/page/page.d.ts +17 -4
  149. package/dist/containers/page/page.js +33 -4
  150. package/dist/containers/page-header/back.d.ts +10 -0
  151. package/dist/containers/page-header/back.js +28 -0
  152. package/dist/containers/page-header/index.d.ts +1 -0
  153. package/dist/containers/page-header/index.js +1 -0
  154. package/dist/containers/page-header/page-header.d.ts +19 -2
  155. package/dist/containers/page-header/page-header.js +26 -2
  156. package/dist/containers/pagination/cursor-pagination.d.ts +28 -0
  157. package/dist/containers/pagination/cursor-pagination.js +48 -0
  158. package/dist/containers/pagination/index.d.ts +3 -0
  159. package/dist/containers/pagination/index.js +10 -0
  160. package/dist/containers/pagination/pagination.d.ts +52 -0
  161. package/dist/containers/pagination/pagination.js +216 -0
  162. package/dist/containers/pagination/range.d.ts +29 -0
  163. package/dist/containers/pagination/range.js +42 -0
  164. package/dist/containers/pagination/use-pagination.d.ts +18 -0
  165. package/dist/containers/pagination/use-pagination.js +22 -0
  166. package/dist/containers/responsive-list/responsive-list.d.ts +28 -2
  167. package/dist/containers/responsive-list/responsive-list.js +134 -25
  168. package/dist/containers/row-actions/index.d.ts +1 -0
  169. package/dist/containers/row-actions/index.js +4 -0
  170. package/dist/containers/row-actions/row-actions.d.ts +26 -0
  171. package/dist/containers/row-actions/row-actions.js +78 -0
  172. package/dist/containers/selectable-card/index.d.ts +1 -0
  173. package/dist/containers/selectable-card/index.js +6 -0
  174. package/dist/containers/selectable-card/selectable-card.d.ts +26 -0
  175. package/dist/containers/selectable-card/selectable-card.js +57 -0
  176. package/dist/containers/settings-layout/settings-layout.d.ts +24 -7
  177. package/dist/containers/settings-layout/settings-layout.js +63 -8
  178. package/dist/containers/shortcuts/shortcuts.js +1 -1
  179. package/dist/containers/table/cell-padding.d.ts +2 -0
  180. package/dist/containers/table/cell-padding.js +4 -0
  181. package/dist/containers/table/index.d.ts +1 -0
  182. package/dist/containers/table/index.js +8 -0
  183. package/dist/containers/table/sort.d.ts +14 -0
  184. package/dist/containers/table/sort.js +11 -0
  185. package/dist/containers/table/table-parts.d.ts +24 -0
  186. package/dist/containers/table/table-parts.js +52 -0
  187. package/dist/containers/table/table.d.ts +37 -3
  188. package/dist/containers/table/table.js +120 -19
  189. package/dist/containers/table-columns-menu/index.d.ts +1 -0
  190. package/dist/containers/table-columns-menu/index.js +6 -0
  191. package/dist/containers/table-columns-menu/table-columns-menu.d.ts +14 -0
  192. package/dist/containers/table-columns-menu/table-columns-menu.js +46 -0
  193. package/dist/dashboards/layout.d.ts +1 -27
  194. package/dist/dashboards/layout.js +8 -40
  195. package/dist/forms/chip-group/chip-group.d.ts +5 -0
  196. package/dist/forms/chip-group/chip-group.js +3 -1
  197. package/dist/forms/combobox/combobox.js +1 -1
  198. package/dist/forms/copy-field/copy-field.js +1 -1
  199. package/dist/forms/date-picker/date-picker.d.ts +3 -1
  200. package/dist/forms/date-picker/date-picker.js +4 -2
  201. package/dist/forms/date-picker/date-time-picker.d.ts +8 -2
  202. package/dist/forms/date-picker/date-time-picker.js +13 -2
  203. package/dist/forms/field/field.d.ts +9 -2
  204. package/dist/forms/field/field.js +18 -4
  205. package/dist/forms/fieldset/fieldset.d.ts +11 -0
  206. package/dist/forms/fieldset/fieldset.js +12 -0
  207. package/dist/forms/fieldset/index.d.ts +1 -0
  208. package/dist/forms/fieldset/index.js +4 -0
  209. package/dist/forms/form-footer/form-footer.d.ts +26 -0
  210. package/dist/forms/form-footer/form-footer.js +44 -0
  211. package/dist/forms/form-footer/index.d.ts +1 -0
  212. package/dist/forms/form-footer/index.js +4 -0
  213. package/dist/forms/form-grid/form-grid.d.ts +21 -4
  214. package/dist/forms/form-grid/form-grid.js +20 -3
  215. package/dist/forms/form-grid/index.d.ts +1 -1
  216. package/dist/forms/form-grid/index.js +6 -2
  217. package/dist/forms/form-section/form-section.d.ts +12 -0
  218. package/dist/forms/form-section/form-section.js +30 -0
  219. package/dist/forms/form-section/index.d.ts +1 -0
  220. package/dist/forms/form-section/index.js +4 -0
  221. package/dist/forms/index.d.ts +4 -0
  222. package/dist/forms/index.js +4 -0
  223. package/dist/forms/input/input.d.ts +6 -2
  224. package/dist/forms/input/input.js +6 -2
  225. package/dist/forms/internal/listbox-items.d.ts +1 -1
  226. package/dist/forms/internal/listbox-items.js +3 -2
  227. package/dist/forms/native-select/native-select.js +1 -1
  228. package/dist/forms/password-input/index.d.ts +1 -0
  229. package/dist/forms/password-input/index.js +1 -0
  230. package/dist/forms/password-input/password-input.d.ts +16 -0
  231. package/dist/forms/password-input/password-input.js +45 -0
  232. package/dist/forms/select/index.d.ts +1 -1
  233. package/dist/forms/select/select.d.ts +5 -2
  234. package/dist/forms/select/select.js +7 -2
  235. package/dist/forms/select-menu/select-menu.js +1 -1
  236. package/dist/forms/time-input/time-input.d.ts +4 -2
  237. package/dist/forms/time-input/time-input.js +3 -1
  238. package/dist/i18n/strings.d.ts +150 -0
  239. package/dist/i18n/strings.js +80 -2
  240. package/dist/icons/eye.d.ts +2 -0
  241. package/dist/icons/eye.js +11 -0
  242. package/dist/icons/graduation-cap.d.ts +2 -0
  243. package/dist/icons/graduation-cap.js +12 -0
  244. package/dist/icons/house.d.ts +2 -0
  245. package/dist/icons/house.js +11 -0
  246. package/dist/icons/index.d.ts +4 -0
  247. package/dist/icons/index.js +8 -0
  248. package/dist/icons/mail.d.ts +2 -0
  249. package/dist/icons/mail.js +11 -0
  250. package/dist/motion/count-up.d.ts +20 -0
  251. package/dist/motion/count-up.js +59 -0
  252. package/dist/motion/cross-fade.d.ts +21 -0
  253. package/dist/motion/cross-fade.js +86 -0
  254. package/dist/motion/index.d.ts +5 -0
  255. package/dist/motion/index.js +14 -0
  256. package/dist/motion/model.d.ts +15 -0
  257. package/dist/motion/model.js +68 -0
  258. package/dist/motion/motion-styles.d.ts +1 -0
  259. package/dist/motion/motion-styles.js +35 -0
  260. package/dist/motion/reveal.d.ts +37 -0
  261. package/dist/motion/reveal.js +69 -0
  262. package/dist/motion/use-enter-phase.d.ts +11 -0
  263. package/dist/motion/use-enter-phase.js +40 -0
  264. package/dist/motion/use-highlight-row.d.ts +22 -0
  265. package/dist/motion/use-highlight-row.js +38 -0
  266. package/dist/navigation/tabs/tabs.js +1 -1
  267. package/dist/navigation/wizard/wizard.d.ts +4 -1
  268. package/dist/navigation/wizard/wizard.js +3 -0
  269. package/dist/overlays/alert-dialog/alert-dialog.js +8 -1
  270. package/dist/overlays/context-menu/context-menu.js +3 -1
  271. package/dist/overlays/dialog/dialog.js +10 -2
  272. package/dist/overlays/drawer/drawer.d.ts +18 -4
  273. package/dist/overlays/drawer/drawer.js +53 -4
  274. package/dist/overlays/drawer/index.d.ts +1 -1
  275. package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +1 -1
  276. package/dist/overlays/dropdown-menu/dropdown-menu.js +5 -4
  277. package/dist/overlays/hover-card/hover-card.js +2 -0
  278. package/dist/overlays/popover/popover.js +2 -0
  279. package/dist/overlays/toaster/index.d.ts +1 -1
  280. package/dist/overlays/toaster/toaster.d.ts +28 -2
  281. package/dist/overlays/toaster/toaster.js +73 -29
  282. package/dist/overlays/tooltip/tooltip.js +2 -0
  283. package/dist/primitives/use-presence.js +9 -0
  284. package/dist/shell/app-shell/app-shell.d.ts +8 -1
  285. package/dist/shell/app-shell/app-shell.js +50 -3
  286. package/dist/shell/index.d.ts +1 -0
  287. package/dist/shell/index.js +1 -0
  288. package/dist/shell/sidebar/sidebar.d.ts +17 -1
  289. package/dist/shell/sidebar/sidebar.js +126 -76
  290. package/dist/shell/topbar/topbar.d.ts +4 -2
  291. package/dist/shell/topbar/topbar.js +2 -0
  292. package/dist/showcase/operations-bento.js +2 -2
  293. package/dist/states/empty-state/empty-state.d.ts +10 -3
  294. package/dist/states/empty-state/empty-state.js +46 -5
  295. package/dist/states/error-state/error-state.js +1 -1
  296. package/dist/states/skeleton/skeleton.js +1 -1
  297. package/dist/utils/class-tokens.generated.js +4 -6
  298. package/dist/utils/list-navigation.d.ts +14 -0
  299. package/dist/utils/list-navigation.js +44 -0
  300. package/dist/utils/overlay-motion.d.ts +12 -0
  301. package/dist/utils/overlay-motion.js +14 -0
  302. package/dist/utils/use-container-width.d.ts +6 -0
  303. package/dist/utils/use-container-width.js +19 -0
  304. package/icons/svg/eye.svg +4 -0
  305. package/icons/svg/graduation-cap.svg +5 -0
  306. package/icons/svg/house.svg +4 -0
  307. package/icons/svg/mail.svg +4 -0
  308. package/package.json +2 -2
  309. package/scripts/build-theme.mjs +46 -5
  310. package/src/ai/code-block/code-block.tsx +1 -1
  311. package/src/atoms/big-date/big-date.tsx +2 -2
  312. package/src/atoms/button/button.tsx +33 -6
  313. package/src/atoms/chip/chip.tsx +8 -3
  314. package/src/atoms/divider/divider.tsx +40 -0
  315. package/src/atoms/divider/index.ts +1 -0
  316. package/src/atoms/icon-button/icon-button.tsx +2 -2
  317. package/src/atoms/index.ts +1 -0
  318. package/src/atoms/internal/hit-area.ts +5 -4
  319. package/src/atoms/progress/index.ts +8 -1
  320. package/src/atoms/progress/progress.tsx +30 -1
  321. package/src/atoms/radio-group/radio-group.tsx +1 -1
  322. package/src/atoms/status-pill/status-pill.tsx +59 -18
  323. package/src/auth/auth-illustration/auth-illustration.tsx +100 -0
  324. package/src/auth/auth-illustration/index.ts +8 -0
  325. package/src/auth/auth-illustration/look.ts +32 -0
  326. package/src/auth/auth-illustration/model.ts +330 -0
  327. package/src/auth/auth-illustration/use-art-pointer.ts +78 -0
  328. package/src/auth/auth-layout/auth-layout.tsx +282 -0
  329. package/src/auth/auth-layout/index.ts +1 -0
  330. package/src/auth/character/character.tsx +346 -0
  331. package/src/auth/character/index.ts +1 -0
  332. package/src/auth/index.ts +4 -0
  333. package/src/auth/internal/auth-context.ts +26 -0
  334. package/src/auth/internal/auth-styles.tsx +39 -0
  335. package/src/auth/internal/portal-glyphs.tsx +32 -0
  336. package/src/auth/login-form/context.ts +78 -0
  337. package/src/auth/login-form/index.ts +21 -0
  338. package/src/auth/login-form/login-form.tsx +330 -0
  339. package/src/auth/login-form/parts.tsx +457 -0
  340. package/src/auth/looks/auth-illustration-any.tsx +38 -0
  341. package/src/auth/looks/index.ts +1 -0
  342. package/src/auth/mosaic/index.ts +1 -0
  343. package/src/auth/mosaic/mosaic.tsx +255 -0
  344. package/src/auth/slabs/index.ts +1 -0
  345. package/src/auth/slabs/slabs.tsx +181 -0
  346. package/src/auth/stack/index.ts +1 -0
  347. package/src/auth/stack/stack.tsx +267 -0
  348. package/src/auth/statement/index.ts +1 -0
  349. package/src/auth/statement/statement.tsx +122 -0
  350. package/src/brand/logo-forge.tsx +1 -1
  351. package/src/charts/candlestick-chart/candlestick-chart.tsx +2 -2
  352. package/src/charts/chart-grid/chart-grid.tsx +2 -2
  353. package/src/charts/chord-chart/chord-chart.tsx +1 -1
  354. package/src/charts/core/axes.tsx +2 -2
  355. package/src/charts/core/cartesian/annotations.tsx +2 -2
  356. package/src/charts/core/cartesian/marks.tsx +1 -1
  357. package/src/charts/core/distribution/marks.tsx +1 -1
  358. package/src/charts/core/distribution/xy-points.tsx +1 -1
  359. package/src/charts/core/export-menu.tsx +1 -1
  360. package/src/charts/funnel-chart/funnel-chart.tsx +1 -1
  361. package/src/charts/gantt-chart/gantt-chart.tsx +4 -4
  362. package/src/charts/gantt-chart/gantt-marks.tsx +3 -3
  363. package/src/charts/index.ts +2 -0
  364. package/src/charts/maps/geo/map-data-table.tsx +1 -1
  365. package/src/charts/polar-area-chart/polar-area-chart.tsx +1 -1
  366. package/src/charts/radar-chart/radar-chart.tsx +1 -1
  367. package/src/charts/stock-chart/stock-chart.tsx +1 -1
  368. package/src/charts/stock-chart/stock-drawing-layer.tsx +3 -3
  369. package/src/charts/stock-chart/stock-plot.tsx +2 -2
  370. package/src/containers/chat-thread/chat-thread.tsx +331 -0
  371. package/src/containers/chat-thread/format.ts +67 -0
  372. package/src/containers/chat-thread/index.ts +12 -0
  373. package/src/containers/cols/cols.tsx +13 -1
  374. package/src/containers/comment/comment.tsx +1 -1
  375. package/src/containers/context-rail/context-rail.tsx +229 -0
  376. package/src/containers/context-rail/index.ts +7 -0
  377. package/src/containers/dashboard/dashboard.tsx +142 -0
  378. package/src/containers/dashboard/index.ts +12 -0
  379. package/src/containers/data-grid/data-grid.demos.tsx +4 -4
  380. package/src/containers/data-grid/data-grid.tsx +6 -6
  381. package/src/containers/data-grid/filter-builder-editor.tsx +2 -2
  382. package/src/containers/data-grid/grid-toolbar.tsx +1 -1
  383. package/src/containers/data-grid/spreadsheet.demos.tsx +1 -1
  384. package/src/containers/detail-header/detail-header.tsx +64 -0
  385. package/src/containers/detail-header/index.ts +5 -0
  386. package/src/containers/facts/facts.tsx +1 -1
  387. package/src/containers/filter-bar/filter-bar.tsx +201 -0
  388. package/src/containers/filter-bar/index.ts +7 -0
  389. package/src/containers/hbars/hbars.tsx +2 -2
  390. package/src/containers/index.ts +9 -0
  391. package/src/containers/kanban/kanban.tsx +146 -39
  392. package/src/containers/kanban/model.ts +20 -0
  393. package/src/containers/kpi/kpi.tsx +1 -1
  394. package/src/containers/kpi-group/kpi-group.tsx +17 -2
  395. package/src/containers/list-detail/index.ts +5 -0
  396. package/src/containers/list-detail/list-detail.tsx +157 -9
  397. package/src/containers/page/page.tsx +61 -7
  398. package/src/containers/page-header/back.tsx +42 -0
  399. package/src/containers/page-header/index.ts +1 -0
  400. package/src/containers/page-header/page-header.tsx +49 -3
  401. package/src/containers/pagination/cursor-pagination.tsx +79 -0
  402. package/src/containers/pagination/index.ts +7 -0
  403. package/src/containers/pagination/pagination.tsx +266 -0
  404. package/src/containers/pagination/range.ts +68 -0
  405. package/src/containers/pagination/use-pagination.ts +44 -0
  406. package/src/containers/responsive-list/responsive-list.tsx +183 -46
  407. package/src/containers/row-actions/index.ts +1 -0
  408. package/src/containers/row-actions/row-actions.tsx +114 -0
  409. package/src/containers/selectable-card/index.ts +5 -0
  410. package/src/containers/selectable-card/selectable-card.tsx +84 -0
  411. package/src/containers/settings-layout/settings-layout.tsx +104 -13
  412. package/src/containers/shortcuts/shortcuts.tsx +1 -1
  413. package/src/containers/table/cell-padding.ts +2 -0
  414. package/src/containers/table/index.ts +6 -0
  415. package/src/containers/table/sort.ts +23 -0
  416. package/src/containers/table/table-parts.tsx +81 -0
  417. package/src/containers/table/table.tsx +212 -45
  418. package/src/containers/table-columns-menu/index.ts +5 -0
  419. package/src/containers/table-columns-menu/table-columns-menu.tsx +68 -0
  420. package/src/dashboards/layout.tsx +8 -75
  421. package/src/forms/chip-group/chip-group.tsx +8 -1
  422. package/src/forms/combobox/combobox.tsx +1 -1
  423. package/src/forms/copy-field/copy-field.tsx +1 -1
  424. package/src/forms/date-picker/date-picker.tsx +7 -2
  425. package/src/forms/date-picker/date-time-picker.tsx +28 -2
  426. package/src/forms/field/field.tsx +30 -3
  427. package/src/forms/fieldset/fieldset.tsx +22 -0
  428. package/src/forms/fieldset/index.ts +1 -0
  429. package/src/forms/form-footer/form-footer.tsx +74 -0
  430. package/src/forms/form-footer/index.ts +1 -0
  431. package/src/forms/form-grid/form-grid.tsx +42 -5
  432. package/src/forms/form-grid/index.ts +8 -1
  433. package/src/forms/form-section/form-section.tsx +41 -0
  434. package/src/forms/form-section/index.ts +1 -0
  435. package/src/forms/index.ts +4 -0
  436. package/src/forms/input/input.tsx +12 -3
  437. package/src/forms/internal/listbox-items.tsx +3 -4
  438. package/src/forms/native-select/native-select.tsx +1 -1
  439. package/src/forms/password-input/index.ts +1 -0
  440. package/src/forms/password-input/password-input.tsx +57 -0
  441. package/src/forms/select/index.ts +1 -1
  442. package/src/forms/select/select.tsx +14 -3
  443. package/src/forms/select-menu/select-menu.tsx +1 -1
  444. package/src/forms/time-input/time-input.tsx +6 -2
  445. package/src/i18n/strings.ts +150 -0
  446. package/src/icons/eye.tsx +12 -0
  447. package/src/icons/graduation-cap.tsx +13 -0
  448. package/src/icons/house.tsx +12 -0
  449. package/src/icons/index.ts +4 -0
  450. package/src/icons/mail.tsx +12 -0
  451. package/src/motion/count-up.tsx +83 -0
  452. package/src/motion/cross-fade.tsx +139 -0
  453. package/src/motion/index.ts +5 -0
  454. package/src/motion/model.ts +86 -0
  455. package/src/motion/motion-styles.tsx +47 -0
  456. package/src/motion/reveal.tsx +115 -0
  457. package/src/motion/use-enter-phase.ts +50 -0
  458. package/src/motion/use-highlight-row.ts +63 -0
  459. package/src/navigation/tabs/tabs.tsx +1 -1
  460. package/src/navigation/wizard/wizard.tsx +6 -1
  461. package/src/overlays/alert-dialog/alert-dialog.tsx +5 -1
  462. package/src/overlays/context-menu/context-menu.tsx +3 -2
  463. package/src/overlays/dialog/dialog.tsx +7 -2
  464. package/src/overlays/drawer/drawer.tsx +68 -6
  465. package/src/overlays/drawer/index.ts +1 -0
  466. package/src/overlays/dropdown-menu/dropdown-menu.tsx +5 -4
  467. package/src/overlays/hover-card/hover-card.tsx +2 -0
  468. package/src/overlays/popover/popover.tsx +2 -0
  469. package/src/overlays/toaster/index.ts +2 -0
  470. package/src/overlays/toaster/toaster.tsx +113 -17
  471. package/src/overlays/tooltip/tooltip.tsx +2 -0
  472. package/src/primitives/use-presence.ts +13 -0
  473. package/src/shell/app-shell/app-shell.tsx +54 -2
  474. package/src/shell/index.ts +1 -0
  475. package/src/shell/sidebar/sidebar.tsx +154 -75
  476. package/src/shell/topbar/topbar.tsx +8 -0
  477. package/src/showcase/operations-bento.tsx +2 -2
  478. package/src/states/empty-state/empty-state.tsx +52 -9
  479. package/src/states/error-state/error-state.tsx +1 -1
  480. package/src/states/skeleton/skeleton.tsx +1 -1
  481. package/src/utils/class-tokens.generated.ts +4 -6
  482. package/src/utils/list-navigation.ts +63 -0
  483. package/src/utils/overlay-motion.ts +33 -0
  484. package/src/utils/use-container-width.ts +24 -0
  485. package/styles/Theme.kt +15 -18
  486. package/styles/tailwind.css +29 -28
  487. package/styles/theme.css +29 -28
  488. package/styles/tokens.css +46 -0
  489. package/tokens/default.json +51 -29
@@ -0,0 +1,219 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useLayoutEffect, useRef } from "react";
4
+ import { Button } from "../../atoms/button/button.js";
5
+ import { useUiStrings } from "../../i18n/index.js";
6
+ import { Check, CheckCheck } from "../../icons/index.js";
7
+ import { cn } from "../../utils/cn.js";
8
+ import { dayKey, formatDay, formatTime, withDayBreaks } from "./format.js";
9
+ const chatThreadLabels = {
10
+ en: {
11
+ conversation: "Conversation",
12
+ today: "Today",
13
+ yesterday: "Yesterday",
14
+ customer: "Customer",
15
+ bot: "Bot",
16
+ staff: "Staff",
17
+ sending: "Sending",
18
+ sent: "Sent",
19
+ delivered: "Delivered",
20
+ read: "Read",
21
+ notSent: "Not sent"
22
+ },
23
+ es: {
24
+ conversation: "Conversaci\xF3n",
25
+ today: "Hoy",
26
+ yesterday: "Ayer",
27
+ customer: "Cliente",
28
+ bot: "Bot",
29
+ staff: "Equipo",
30
+ sending: "Enviando",
31
+ sent: "Enviado",
32
+ delivered: "Entregado",
33
+ read: "Le\xEDdo",
34
+ notSent: "No se envi\xF3"
35
+ }
36
+ };
37
+ const useIsomorphicLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
38
+ const bubbleTone = {
39
+ customer: "bg-surface-2 text-ink",
40
+ bot: "border border-accent-line bg-accent-soft text-accent-ink",
41
+ staff: "bg-accent text-on-accent"
42
+ };
43
+ function Status({ status, labels }) {
44
+ const label = {
45
+ sending: labels.sending,
46
+ sent: labels.sent,
47
+ delivered: labels.delivered,
48
+ read: labels.read,
49
+ failed: labels.notSent
50
+ }[status];
51
+ return /* @__PURE__ */ jsxs(
52
+ "span",
53
+ {
54
+ "data-status": status,
55
+ className: cn(
56
+ "inline-flex items-center gap-1",
57
+ status === "read" && "text-accent-ink",
58
+ status === "failed" && "text-danger"
59
+ ),
60
+ children: [
61
+ status === "sent" ? /* @__PURE__ */ jsx(Check, { "aria-hidden": "true", className: "size-3" }) : null,
62
+ status === "delivered" || status === "read" ? /* @__PURE__ */ jsx(CheckCheck, { "aria-hidden": "true", className: "size-3" }) : null,
63
+ label
64
+ ]
65
+ }
66
+ );
67
+ }
68
+ function ChatThread({
69
+ items,
70
+ composer,
71
+ labels: labelsProp,
72
+ label,
73
+ onRetry,
74
+ empty,
75
+ locale,
76
+ timeZone,
77
+ now,
78
+ className,
79
+ classNames
80
+ }) {
81
+ const labels = { ...chatThreadLabels.en, ...labelsProp };
82
+ const logRef = useRef(null);
83
+ const stickToEnd = useRef(true);
84
+ const reference = now ?? /* @__PURE__ */ new Date();
85
+ const format = { locale, timeZone };
86
+ const authorName = { customer: labels.customer, bot: labels.bot, staff: labels.staff };
87
+ useIsomorphicLayoutEffect(() => {
88
+ const log = logRef.current;
89
+ if (log && stickToEnd.current) log.scrollTop = log.scrollHeight;
90
+ });
91
+ return /* @__PURE__ */ jsxs(
92
+ "section",
93
+ {
94
+ "aria-label": label ?? labels.conversation,
95
+ className: cn("flex min-h-0 min-w-0 flex-col", classNames?.root, className),
96
+ children: [
97
+ items.length === 0 && empty != null ? /* @__PURE__ */ jsx("div", { className: "flex flex-1 items-center justify-center p-card", children: empty }) : /* @__PURE__ */ jsx(
98
+ "div",
99
+ {
100
+ ref: logRef,
101
+ role: "log",
102
+ "aria-live": "polite",
103
+ "aria-relevant": "additions",
104
+ tabIndex: 0,
105
+ onScroll: (event) => {
106
+ const log = event.currentTarget;
107
+ stickToEnd.current = log.scrollHeight - log.scrollTop - log.clientHeight < 80;
108
+ },
109
+ className: cn(
110
+ "min-h-0 flex-1 overflow-y-auto overscroll-contain p-density focus-visible:focus-ring",
111
+ classNames?.log
112
+ ),
113
+ children: /* @__PURE__ */ jsx("ol", { className: "m-0 flex list-none flex-col gap-2 p-0", children: withDayBreaks(items, timeZone).map(({ item, dayStart }) => /* @__PURE__ */ jsx(
114
+ ChatThreadRow,
115
+ {
116
+ item,
117
+ dayLabel: dayStart ? formatDay(
118
+ item.at,
119
+ reference,
120
+ { today: labels.today, yesterday: labels.yesterday },
121
+ format
122
+ ) : void 0,
123
+ dayValue: dayStart ? dayKey(item.at, timeZone) : void 0,
124
+ time: formatTime(item.at, format),
125
+ authorName,
126
+ labels,
127
+ onRetry,
128
+ classNames
129
+ },
130
+ item.id
131
+ )) })
132
+ }
133
+ ),
134
+ composer != null ? /* @__PURE__ */ jsx(
135
+ "div",
136
+ {
137
+ className: cn("shrink-0 border-t-divider p-density", classNames?.composer),
138
+ "data-slot": "composer",
139
+ children: composer
140
+ }
141
+ ) : null
142
+ ]
143
+ }
144
+ );
145
+ }
146
+ function ChatThreadRow({
147
+ item,
148
+ dayLabel,
149
+ dayValue,
150
+ time,
151
+ authorName,
152
+ labels,
153
+ onRetry,
154
+ classNames
155
+ }) {
156
+ const strings = useUiStrings();
157
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
158
+ dayLabel ? /* @__PURE__ */ jsx("li", { className: cn("flex justify-center py-1", classNames?.day), "data-slot": "day", children: /* @__PURE__ */ jsx(
159
+ "time",
160
+ {
161
+ dateTime: dayValue,
162
+ className: "rounded-badge bg-sunken px-2.5 py-0.5 text-ink-2 text-meta",
163
+ children: dayLabel
164
+ }
165
+ ) }) : null,
166
+ item.kind === "note" ? /* @__PURE__ */ jsx("li", { className: "flex justify-center", "data-kind": "note", children: /* @__PURE__ */ jsx(
167
+ "p",
168
+ {
169
+ className: cn(
170
+ "m-0 max-w-[85%] rounded-badge bg-sunken px-3 py-1 text-center text-ink-2 text-meta",
171
+ classNames?.note
172
+ ),
173
+ children: item.content
174
+ }
175
+ ) }) : /* @__PURE__ */ jsx(
176
+ "li",
177
+ {
178
+ "data-author": item.author,
179
+ className: cn(
180
+ "flex",
181
+ item.author === "customer" ? "justify-start" : "justify-end",
182
+ classNames?.message
183
+ ),
184
+ children: /* @__PURE__ */ jsxs(
185
+ "div",
186
+ {
187
+ className: cn(
188
+ "flex min-w-0 max-w-[min(34rem,85%)] flex-col gap-0.5",
189
+ item.author === "customer" ? "items-start" : "items-end"
190
+ ),
191
+ children: [
192
+ /* @__PURE__ */ jsx("span", { className: cn("text-ink-3 text-meta", classNames?.author), children: item.name ?? authorName[item.author] }),
193
+ /* @__PURE__ */ jsx(
194
+ "div",
195
+ {
196
+ className: cn(
197
+ "min-w-0 whitespace-pre-wrap rounded-card px-3 py-2 text-body [overflow-wrap:anywhere]",
198
+ bubbleTone[item.author],
199
+ classNames?.bubble
200
+ ),
201
+ children: item.content
202
+ }
203
+ ),
204
+ /* @__PURE__ */ jsxs("div", { className: cn("flex items-center gap-2 text-ink-3 text-meta", classNames?.meta), children: [
205
+ /* @__PURE__ */ jsx("time", { dateTime: new Date(item.at).toISOString(), children: time }),
206
+ item.author !== "customer" && item.status ? /* @__PURE__ */ jsx(Status, { status: item.status, labels }) : null,
207
+ item.status === "failed" && onRetry ? /* @__PURE__ */ jsx(Button, { variant: "ghost", size: "sm", onClick: () => onRetry(item.id), children: strings.retry }) : null
208
+ ] })
209
+ ]
210
+ }
211
+ )
212
+ }
213
+ )
214
+ ] });
215
+ }
216
+ export {
217
+ ChatThread,
218
+ chatThreadLabels
219
+ };
@@ -0,0 +1,20 @@
1
+ export type ChatTimestamp = Date | string | number;
2
+ export interface ChatThreadFormat {
3
+ locale?: string | undefined;
4
+ timeZone?: string | undefined;
5
+ }
6
+ /** `YYYY-MM-DD` of the instant in `timeZone` (the local zone when omitted). */
7
+ export declare function dayKey(at: ChatTimestamp, timeZone?: string): string;
8
+ export declare function formatTime(at: ChatTimestamp, { locale, timeZone }?: ChatThreadFormat): string;
9
+ /** "Today" and "Yesterday" relative to `now`, otherwise a long date (with the year when it differs). */
10
+ export declare function formatDay(at: ChatTimestamp, now: ChatTimestamp, labels: {
11
+ today: string;
12
+ yesterday: string;
13
+ }, { locale, timeZone }?: ChatThreadFormat): string;
14
+ /** Items in order, each flagged with whether a new day starts at it. */
15
+ export declare function withDayBreaks<T extends {
16
+ at: ChatTimestamp;
17
+ }>(items: readonly T[], timeZone?: string): Array<{
18
+ item: T;
19
+ dayStart: boolean;
20
+ }>;
@@ -0,0 +1,50 @@
1
+ const toDate = (at) => at instanceof Date ? at : new Date(at);
2
+ function dayKey(at, timeZone) {
3
+ return new Intl.DateTimeFormat("en-CA", {
4
+ timeZone,
5
+ year: "numeric",
6
+ month: "2-digit",
7
+ day: "2-digit"
8
+ }).format(toDate(at));
9
+ }
10
+ function shiftDay(key, days) {
11
+ const [year = 0, month = 1, day = 1] = key.split("-").map(Number);
12
+ const shifted = new Date(Date.UTC(year, month - 1, day + days));
13
+ return shifted.toISOString().slice(0, 10);
14
+ }
15
+ function formatTime(at, { locale, timeZone } = {}) {
16
+ return new Intl.DateTimeFormat(locale, {
17
+ timeZone,
18
+ hour: "2-digit",
19
+ minute: "2-digit"
20
+ }).format(toDate(at));
21
+ }
22
+ function formatDay(at, now, labels, { locale, timeZone } = {}) {
23
+ const key = dayKey(at, timeZone);
24
+ const today = dayKey(now, timeZone);
25
+ if (key === today) return labels.today;
26
+ if (key === shiftDay(today, -1)) return labels.yesterday;
27
+ const sameYear = key.slice(0, 4) === today.slice(0, 4);
28
+ return new Intl.DateTimeFormat(locale, {
29
+ timeZone,
30
+ weekday: "long",
31
+ day: "numeric",
32
+ month: "long",
33
+ ...sameYear ? {} : { year: "numeric" }
34
+ }).format(toDate(at));
35
+ }
36
+ function withDayBreaks(items, timeZone) {
37
+ let previous = null;
38
+ return items.map((item) => {
39
+ const key = dayKey(item.at, timeZone);
40
+ const dayStart = key !== previous;
41
+ previous = key;
42
+ return { item, dayStart };
43
+ });
44
+ }
45
+ export {
46
+ dayKey,
47
+ formatDay,
48
+ formatTime,
49
+ withDayBreaks
50
+ };
@@ -0,0 +1 @@
1
+ export { type ChatAuthorKind, type ChatDeliveryStatus, ChatThread, type ChatThreadItem, type ChatThreadLabels, type ChatThreadMessage, type ChatThreadNote, type ChatThreadPart, type ChatThreadProps, chatThreadLabels, } from "./chat-thread.js";
@@ -0,0 +1,8 @@
1
+ import {
2
+ ChatThread,
3
+ chatThreadLabels
4
+ } from "./chat-thread.js";
5
+ export {
6
+ ChatThread,
7
+ chatThreadLabels
8
+ };
@@ -1,5 +1,5 @@
1
1
  import type { ComponentPropsWithoutRef } from "react";
2
- export type ColsVariant = "rail" | "half" | "calc";
2
+ export type ColsVariant = "rail" | "half" | "calc" | "thirds";
3
3
  export interface ColsProps extends ComponentPropsWithoutRef<"div"> {
4
4
  /** Column proportions. Omit for the base main + side split. */
5
5
  variant?: ColsVariant;
@@ -16,6 +16,13 @@ const variantClasses = {
16
16
  "grid-cols-[minmax(0,1fr)_minmax(0,1.5fr)]",
17
17
  "@min-[1500px]/page:grid-cols-[minmax(0,1fr)_minmax(0,2fr)]",
18
18
  "@max-[940px]/page:grid-cols-[minmax(0,1fr)]"
19
+ ),
20
+ thirds: cn(
21
+ "grid-cols-[repeat(3,minmax(0,1fr))]",
22
+ "@max-[1279px]/page:grid-cols-[repeat(2,minmax(0,1fr))]",
23
+ "@max-[1279px]/page:[&>:last-child:nth-child(odd)]:col-span-2",
24
+ "@max-[719px]/page:grid-cols-[minmax(0,1fr)]",
25
+ "@max-[719px]/page:[&>:last-child:nth-child(odd)]:col-span-1"
19
26
  )
20
27
  };
21
28
  function Cols({ variant, className, ...props }) {
@@ -23,7 +23,7 @@ function Comment({
23
23
  role: "note",
24
24
  "aria-label": label,
25
25
  className: cn(
26
- "mx-4 mb-3.5 break-words rounded-control px-3 py-2.5 text-fs-125",
26
+ "mx-4 mb-3.5 break-words rounded-control px-3 py-2.5 text-fs-120",
27
27
  toneClasses[tone],
28
28
  className
29
29
  ),
@@ -0,0 +1,62 @@
1
+ import { type ReactNode } from "react";
2
+ import type { ClassNames } from "../../utils/class-names.js";
3
+ export type ContextRailPart = "root" | "grid" | "main" | "rail" | "summary" | "sheet";
4
+ /**
5
+ * Container widths (px) under which the rail collapses; the set is closed so every query is a
6
+ * literal class. `"never"` keeps the rail beside the work area at any width and `"always"`
7
+ * collapses it at any width.
8
+ */
9
+ export type ContextRailBreakpoint = 720 | 960 | 1280 | "never" | "always";
10
+ export interface ContextRailWidths {
11
+ /** Rail width (px) from the collapse breakpoint up. */
12
+ m?: number;
13
+ /** From 1280 px of container width. */
14
+ w?: number;
15
+ /** From 1600 px of container width. */
16
+ xw?: number;
17
+ }
18
+ export interface ContextRailProps {
19
+ /** The work area. */
20
+ children: ReactNode;
21
+ /** Content of the rail. */
22
+ rail: ReactNode;
23
+ /** Rail width in px, or one width per breakpoint. Defaults to 360 / 400 / 440. */
24
+ width?: number | ContextRailWidths;
25
+ /** Distance (px) the sticky rail keeps from the top of the scroll container. Defaults to 0. */
26
+ stickyTop?: number;
27
+ /** Container width under which the rail collapses (`"never"` / `"always"` pin it). Defaults to 720. */
28
+ breakpoint?: ContextRailBreakpoint;
29
+ /**
30
+ * Collapsed behaviour: `"stack"` puts the rail below the work area; `"sheet"` hides it behind a
31
+ * `summary` bar that opens it as a bottom sheet.
32
+ */
33
+ collapse?: "stack" | "sheet";
34
+ /** Compact bar shown while collapsed to a sheet (total plus the main action). It owns the button that opens the sheet. Inside an `AppShell` with a `bottomBar` it sits above that bar. */
35
+ summary?: ReactNode;
36
+ /** Label of the button that opens the sheet, and name of the sheet. */
37
+ sheetLabel?: string;
38
+ /** Accessible name of the rail region. */
39
+ railLabel?: string;
40
+ /** Controlled open state of the sheet. */
41
+ sheetOpen?: boolean;
42
+ onSheetOpenChange?: (open: boolean) => void;
43
+ className?: string;
44
+ /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
45
+ classNames?: ClassNames<ContextRailPart>;
46
+ }
47
+ /** Whether the rail is collapsed for a measured container width (`null` before the first measurement). */
48
+ export declare function isRailCollapsed(breakpoint: ContextRailBreakpoint, width: number | null): boolean;
49
+ export declare function resolveRailWidths(width: number | ContextRailWidths | undefined): {
50
+ m: number;
51
+ w: number;
52
+ xw: number;
53
+ };
54
+ /**
55
+ * Work area with a persistent side rail (cart, payment, selected table). The rail sticks to the
56
+ * top of the scroll container with its own scroll, and its width grows with the container.
57
+ * Under `breakpoint` it stacks below the work area, or with `collapse="sheet"` it leaves the page
58
+ * for a bottom sheet opened from the `summary` bar. `breakpoint="never"` keeps it beside the work
59
+ * area at any width, `"always"` collapses it at any width. Widths and cuts follow the container
60
+ * (`@container/rail`), not the viewport.
61
+ */
62
+ export declare function ContextRail({ children, rail, width, stickyTop, breakpoint, collapse, summary, sheetLabel, railLabel, sheetOpen: sheetOpenProp, onSheetOpenChange, className, classNames, }: ContextRailProps): import("react").JSX.Element;
@@ -0,0 +1,175 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useRef, useState } from "react";
4
+ import { useUiStrings } from "../../i18n/index.js";
5
+ import { X } from "../../icons/index.js";
6
+ import * as DialogPrimitive from "../../primitives/dialog/dialog.js";
7
+ import { cn } from "../../utils/cn.js";
8
+ import { useContainerWidth } from "../../utils/use-container-width.js";
9
+ const DEFAULT_WIDTHS = { m: 360, w: 400, xw: 440 };
10
+ const collapseClasses = {
11
+ 720: {
12
+ grid: "@max-[719px]/rail:grid-cols-[minmax(0,1fr)]",
13
+ rail: "@max-[719px]/rail:static @max-[719px]/rail:max-h-none",
14
+ bar: "hidden @max-[719px]/rail:block",
15
+ hide: "@max-[719px]/rail:hidden"
16
+ },
17
+ 960: {
18
+ grid: "@max-[959px]/rail:grid-cols-[minmax(0,1fr)]",
19
+ rail: "@max-[959px]/rail:static @max-[959px]/rail:max-h-none",
20
+ bar: "hidden @max-[959px]/rail:block",
21
+ hide: "@max-[959px]/rail:hidden"
22
+ },
23
+ 1280: {
24
+ grid: "@max-[1279px]/rail:grid-cols-[minmax(0,1fr)]",
25
+ rail: "@max-[1279px]/rail:static @max-[1279px]/rail:max-h-none",
26
+ bar: "hidden @max-[1279px]/rail:block",
27
+ hide: "@max-[1279px]/rail:hidden"
28
+ },
29
+ never: { grid: "", rail: "", bar: "hidden", hide: "" },
30
+ always: {
31
+ grid: "grid-cols-[minmax(0,1fr)]",
32
+ rail: "static max-h-none",
33
+ bar: "block",
34
+ hide: "hidden"
35
+ }
36
+ };
37
+ function isRailCollapsed(breakpoint, width) {
38
+ if (breakpoint === "always") return true;
39
+ if (breakpoint === "never") return false;
40
+ return width !== null && width < breakpoint;
41
+ }
42
+ function resolveRailWidths(width) {
43
+ if (typeof width === "number") return { m: width, w: width, xw: width };
44
+ return { ...DEFAULT_WIDTHS, ...width };
45
+ }
46
+ function ContextRail({
47
+ children,
48
+ rail,
49
+ width,
50
+ stickyTop = 0,
51
+ breakpoint = 720,
52
+ collapse = "stack",
53
+ summary,
54
+ sheetLabel,
55
+ railLabel,
56
+ sheetOpen: sheetOpenProp,
57
+ onSheetOpenChange,
58
+ className,
59
+ classNames
60
+ }) {
61
+ const strings = useUiStrings();
62
+ const rootRef = useRef(null);
63
+ const measured = useContainerWidth(rootRef);
64
+ const collapsed = isRailCollapsed(breakpoint, measured);
65
+ const [openState, setOpenState] = useState(false);
66
+ const controlled = sheetOpenProp !== void 0;
67
+ const open = (controlled ? sheetOpenProp : openState) && collapsed;
68
+ const setOpen = (next) => {
69
+ if (!controlled) setOpenState(next);
70
+ onSheetOpenChange?.(next);
71
+ };
72
+ const widths = resolveRailWidths(width);
73
+ const classes = collapseClasses[breakpoint];
74
+ const sheet = collapse === "sheet";
75
+ const label = sheetLabel ?? railLabel;
76
+ const style = {
77
+ "--rail-m": `${widths.m}px`,
78
+ "--rail-w": `${widths.w}px`,
79
+ "--rail-xw": `${widths.xw}px`,
80
+ "--rail-top": `${stickyTop}px`
81
+ };
82
+ return /* @__PURE__ */ jsxs(
83
+ "div",
84
+ {
85
+ ref: rootRef,
86
+ "data-collapsed": collapsed ? "" : void 0,
87
+ style,
88
+ className: cn("@container/rail min-w-0", classNames?.root, className),
89
+ children: [
90
+ /* @__PURE__ */ jsxs(
91
+ "div",
92
+ {
93
+ className: cn(
94
+ "grid items-start gap-4 [--rail:var(--rail-m)] @min-[1280px]/rail:[--rail:var(--rail-w)] @min-[1600px]/rail:[--rail:var(--rail-xw)]",
95
+ breakpoint === "always" ? void 0 : "grid-cols-[minmax(0,1fr)_var(--rail)]",
96
+ classes.grid,
97
+ classNames?.grid
98
+ ),
99
+ children: [
100
+ /* @__PURE__ */ jsx("div", { className: cn("min-w-0", classNames?.main), children }),
101
+ /* @__PURE__ */ jsx(
102
+ "aside",
103
+ {
104
+ "aria-label": railLabel,
105
+ className: cn(
106
+ "sticky top-(--rail-top) min-w-0 max-h-[calc(100dvh-var(--rail-top))] overflow-y-auto overscroll-contain",
107
+ classes.rail,
108
+ sheet && classes.hide,
109
+ classNames?.rail
110
+ ),
111
+ children: sheet && collapsed ? null : rail
112
+ }
113
+ )
114
+ ]
115
+ }
116
+ ),
117
+ sheet && summary != null ? /* @__PURE__ */ jsx(
118
+ "div",
119
+ {
120
+ className: cn(
121
+ "sticky bottom-(--app-bottom-bar,0px) z-10 border-t-divider surface-card p-density",
122
+ classes.bar,
123
+ classNames?.summary
124
+ ),
125
+ children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
126
+ /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: summary }),
127
+ /* @__PURE__ */ jsx(
128
+ "button",
129
+ {
130
+ type: "button",
131
+ "aria-haspopup": "dialog",
132
+ "aria-expanded": open,
133
+ onClick: () => setOpen(true),
134
+ className: "shrink-0 rounded-button px-3 py-2 font-semibold text-accent-ink text-body focus-visible:focus-ring",
135
+ children: label ?? strings.actions
136
+ }
137
+ )
138
+ ] })
139
+ }
140
+ ) : null,
141
+ sheet ? /* @__PURE__ */ jsx(DialogPrimitive.Root, { open, onOpenChange: setOpen, children: /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { children: [
142
+ /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: "fixed inset-0 z-70 bg-scrim" }),
143
+ /* @__PURE__ */ jsxs(
144
+ DialogPrimitive.Content,
145
+ {
146
+ className: cn(
147
+ "fixed inset-x-0 bottom-0 z-70 flex max-h-[85dvh] flex-col overflow-y-auto rounded-t-card p-card outline-none surface-overlay shadow-overlay",
148
+ classNames?.sheet
149
+ ),
150
+ children: [
151
+ /* @__PURE__ */ jsxs("div", { className: "mb-2 flex items-center justify-between gap-3", children: [
152
+ /* @__PURE__ */ jsx(DialogPrimitive.Title, { className: "m-0 font-semibold text-card-title text-ink", children: label ?? strings.actions }),
153
+ /* @__PURE__ */ jsx(
154
+ DialogPrimitive.Close,
155
+ {
156
+ "aria-label": strings.close,
157
+ className: "rounded-event p-1 text-ink-3 hover:text-ink focus-visible:focus-ring",
158
+ children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true", className: "size-4" })
159
+ }
160
+ )
161
+ ] }),
162
+ rail
163
+ ]
164
+ }
165
+ )
166
+ ] }) }) : null
167
+ ]
168
+ }
169
+ );
170
+ }
171
+ export {
172
+ ContextRail,
173
+ isRailCollapsed,
174
+ resolveRailWidths
175
+ };
@@ -0,0 +1 @@
1
+ export { ContextRail, type ContextRailBreakpoint, type ContextRailPart, type ContextRailProps, type ContextRailWidths, } from "./context-rail.js";
@@ -0,0 +1,6 @@
1
+ import {
2
+ ContextRail
3
+ } from "./context-rail.js";
4
+ export {
5
+ ContextRail
6
+ };
@@ -0,0 +1,40 @@
1
+ import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ export type DashboardPageProps = ComponentPropsWithoutRef<"div">;
3
+ /** Vertical rhythm of a dashboard page. Put it inside `Page` so the `page` container query applies. */
4
+ export declare function DashboardPage({ className, ...props }: DashboardPageProps): import("react").JSX.Element;
5
+ export interface KpiRowProps extends ComponentPropsWithoutRef<"div"> {
6
+ /** Accessible name of the group of figures, e.g. "Key figures". */
7
+ "aria-label"?: string;
8
+ }
9
+ /**
10
+ * Joined KPI tiles: two per row when narrow, four from 720 px of `page` container width. It is a
11
+ * named `group`, so give it an `aria-label` when the tiles are not introduced by a heading.
12
+ */
13
+ export declare function KpiRow({ className, ...props }: KpiRowProps): import("react").JSX.Element;
14
+ export interface CardGridProps extends ComponentPropsWithoutRef<"div"> {
15
+ /** Columns at the widest container: 2 (from 720 px) or 3 (2 from 720 px, 3 from 1180 px). Default 2. */
16
+ columns?: 2 | 3;
17
+ }
18
+ /** Equal cards that stack under 720 px of `page` container width. */
19
+ export declare function CardGrid({ columns, className, ...props }: CardGridProps): import("react").JSX.Element;
20
+ export interface DashboardCardProps {
21
+ title: string;
22
+ subtitle?: string;
23
+ /** Slot at the end of the header (a chip, a button). */
24
+ aside?: ReactNode;
25
+ /** Heading level of the title; the card is a named `region`. Default 2. */
26
+ headingLevel?: 2 | 3 | 4;
27
+ className?: string;
28
+ children: ReactNode;
29
+ }
30
+ export interface ChartCardProps extends DashboardCardProps {
31
+ /** Fixed height of the body in px; the chart inside uses `height="fill"`. Default 300. */
32
+ height?: number;
33
+ }
34
+ /**
35
+ * Card with a fixed-height body so `height="fill"` charts take exactly the space left. It is a
36
+ * `region` named by its title.
37
+ */
38
+ export declare function ChartCard({ title, subtitle, aside, height, headingLevel, className, children, }: ChartCardProps): import("react").JSX.Element;
39
+ /** Card whose body is a table or grid that scrolls inside its own wrapper. A `region` named by its title. */
40
+ export declare function TableCard({ title, subtitle, aside, headingLevel, className, children, }: DashboardCardProps): import("react").JSX.Element;