@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,59 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { useEffect, useMemo, useRef, useState } from "react";
4
+ import { useUiStrings } from "../i18n/index.js";
5
+ import { usePrefersReducedMotion } from "../utils/reduced-motion.js";
6
+ import { composeRefs } from "../utils/slot.js";
7
+ import { COUNT_UP_SCALE, countAt, parseDuration, parseEasing } from "./model.js";
8
+ import { MotionStyles } from "./motion-styles.js";
9
+ import { useStartedOnServer } from "./use-enter-phase.js";
10
+ function CountUp({ value, formatter, from = 0, className, ref, ...props }) {
11
+ const { locale } = useUiStrings();
12
+ const format = useMemo(() => formatter ?? new Intl.NumberFormat(locale), [formatter, locale]);
13
+ const startedOnServer = useStartedOnServer();
14
+ const reduced = usePrefersReducedMotion();
15
+ const [shown, setShown] = useState(() => startedOnServer || reduced ? value : from);
16
+ const node = useRef(null);
17
+ const latest = useRef(shown);
18
+ latest.current = shown;
19
+ useEffect(() => {
20
+ const start = latest.current;
21
+ const el = node.current;
22
+ if (reduced || start === value || !el || typeof requestAnimationFrame === "undefined") {
23
+ setShown(value);
24
+ return;
25
+ }
26
+ const styles = getComputedStyle(el);
27
+ const duration = parseDuration(styles.getPropertyValue("--motion-duration")) * COUNT_UP_SCALE;
28
+ const ease = parseEasing(styles.getPropertyValue("--motion-ease"));
29
+ const t0 = performance.now();
30
+ let frame = requestAnimationFrame(function tick(now) {
31
+ const next = countAt(start, value, now - t0, duration, ease);
32
+ setShown(next);
33
+ if (next !== value) frame = requestAnimationFrame(tick);
34
+ });
35
+ return () => cancelAnimationFrame(frame);
36
+ }, [value, reduced]);
37
+ const final = format.format(value);
38
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
39
+ /* @__PURE__ */ jsx(MotionStyles, {}),
40
+ /* @__PURE__ */ jsx(
41
+ "span",
42
+ {
43
+ ref: composeRefs(ref, node),
44
+ className: className ? `ui-count ${className}` : "ui-count",
45
+ ...props,
46
+ children: shown === value ? final : /* @__PURE__ */ jsxs(Fragment, { children: [
47
+ /* @__PURE__ */ jsxs("span", { className: "ui-count-run", "aria-hidden": "true", children: [
48
+ /* @__PURE__ */ jsx("span", { children: final }),
49
+ /* @__PURE__ */ jsx("span", { children: format.format(shown) })
50
+ ] }),
51
+ /* @__PURE__ */ jsx("span", { className: "ui-motion-sr", children: final })
52
+ ] })
53
+ }
54
+ )
55
+ ] });
56
+ }
57
+ export {
58
+ CountUp
59
+ };
@@ -0,0 +1,21 @@
1
+ import { type HTMLAttributes, type Key, type ReactNode, type Ref } from "react";
2
+ export interface CrossFadeProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** Identity of the content. A new key fades the old content out and the new one in. */
4
+ contentKey: Key;
5
+ children?: ReactNode;
6
+ ref?: Ref<HTMLDivElement>;
7
+ }
8
+ /**
9
+ * Swaps keyed content (a list-detail pane, a tab panel) with a cross-fade and a 4px rise. The old
10
+ * content stays mounted on top of the new one until it has faded, out of the layout (so nothing
11
+ * jumps), hidden from assistive tech and inert. If focus was inside the old content it moves to
12
+ * the new content. The first render (also server HTML) never animates; reduced motion swaps
13
+ * without any fade.
14
+ */
15
+ export declare function CrossFade({ contentKey, children, ref, ...props }: CrossFadeProps): import("react").JSX.Element;
16
+ export interface PresenceProps extends Omit<CrossFadeProps, "contentKey"> {
17
+ /** Shows the children when true; changes fade them in and out. */
18
+ present: boolean;
19
+ }
20
+ /** `CrossFade` between the children and nothing: shows or hides content with a fade. */
21
+ export declare function Presence({ present, children, ...props }: PresenceProps): import("react").JSX.Element;
@@ -0,0 +1,86 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import {
4
+ useEffect,
5
+ useLayoutEffect,
6
+ useRef,
7
+ useState
8
+ } from "react";
9
+ import { usePrefersReducedMotion } from "../utils/reduced-motion.js";
10
+ import { MotionStyles } from "./motion-styles.js";
11
+ const LEAVE_TIMEOUT_MS = 1e3;
12
+ function CrossFade({ contentKey, children, ref, ...props }) {
13
+ const reduced = usePrefersReducedMotion();
14
+ const current = useRef(null);
15
+ const committed = useRef(children);
16
+ const [state, setState] = useState({
17
+ key: contentKey,
18
+ entering: null,
19
+ leaving: [],
20
+ refocus: 0
21
+ });
22
+ if (state.key !== contentKey) {
23
+ const animate = !reduced;
24
+ const focused = typeof document !== "undefined" && document.activeElement;
25
+ setState({
26
+ key: contentKey,
27
+ entering: animate ? contentKey : null,
28
+ leaving: animate ? [
29
+ ...state.leaving.filter((layer) => layer.key !== contentKey),
30
+ { key: state.key, node: committed.current }
31
+ ] : [],
32
+ refocus: focused && current.current?.contains(focused) ? state.refocus + 1 : state.refocus
33
+ });
34
+ }
35
+ useLayoutEffect(() => {
36
+ committed.current = children;
37
+ });
38
+ useLayoutEffect(() => {
39
+ if (state.refocus === 0 || !current.current) return;
40
+ current.current.tabIndex = -1;
41
+ current.current.focus({ preventScroll: true });
42
+ }, [state.refocus]);
43
+ const leavingCount = state.leaving.length;
44
+ useEffect(() => {
45
+ if (leavingCount === 0) return;
46
+ const timer = setTimeout(() => setState((s) => ({ ...s, leaving: [] })), LEAVE_TIMEOUT_MS);
47
+ return () => clearTimeout(timer);
48
+ }, [leavingCount]);
49
+ const drop = (key) => (event) => {
50
+ if (event.target !== event.currentTarget) return;
51
+ setState((s) => ({ ...s, leaving: s.leaving.filter((layer) => layer.key !== key) }));
52
+ };
53
+ const layers = [
54
+ ...state.leaving.map((layer) => /* @__PURE__ */ jsx(
55
+ "div",
56
+ {
57
+ "data-motion-leave": "",
58
+ "aria-hidden": "true",
59
+ inert: true,
60
+ onAnimationEnd: drop(layer.key),
61
+ children: layer.node
62
+ },
63
+ `k:${String(layer.key)}`
64
+ )),
65
+ /* @__PURE__ */ jsx(
66
+ "div",
67
+ {
68
+ ref: current,
69
+ "data-motion": state.entering === contentKey ? "enter" : void 0,
70
+ children
71
+ },
72
+ `k:${String(contentKey)}`
73
+ )
74
+ ];
75
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
76
+ /* @__PURE__ */ jsx(MotionStyles, {}),
77
+ /* @__PURE__ */ jsx("div", { ref, "data-motion-swap": "", ...props, children: layers })
78
+ ] });
79
+ }
80
+ function Presence({ present, children, ...props }) {
81
+ return /* @__PURE__ */ jsx(CrossFade, { contentKey: present ? "present" : "absent", ...props, children: present ? children : null });
82
+ }
83
+ export {
84
+ CrossFade,
85
+ Presence
86
+ };
@@ -0,0 +1,5 @@
1
+ export { CountUp, type CountUpProps, type NumberFormatter } from "./count-up.js";
2
+ export { CrossFade, type CrossFadeProps, Presence, type PresenceProps } from "./cross-fade.js";
3
+ export { MotionStyles } from "./motion-styles.js";
4
+ export { Reveal, type RevealProps, Stagger, type StaggerProps } from "./reveal.js";
5
+ export { type HighlightRow, type HighlightRowProps, useHighlightRow } from "./use-highlight-row.js";
@@ -0,0 +1,14 @@
1
+ import { CountUp } from "./count-up.js";
2
+ import { CrossFade, Presence } from "./cross-fade.js";
3
+ import { MotionStyles } from "./motion-styles.js";
4
+ import { Reveal, Stagger } from "./reveal.js";
5
+ import { useHighlightRow } from "./use-highlight-row.js";
6
+ export {
7
+ CountUp,
8
+ CrossFade,
9
+ MotionStyles,
10
+ Presence,
11
+ Reveal,
12
+ Stagger,
13
+ useHighlightRow
14
+ };
@@ -0,0 +1,15 @@
1
+ /** Fallbacks when the theme does not define `--motion-duration` / `--motion-ease`. */
2
+ export declare const DEFAULT_DURATION_MS = 180;
3
+ export declare const DEFAULT_EASE = "cubic-bezier(.2,.8,.2,1)";
4
+ /** A count-up runs this many token durations: long enough to read, still under 300ms by default. */
5
+ export declare const COUNT_UP_SCALE = 1.5;
6
+ export type Easing = (t: number) => number;
7
+ /** Milliseconds from a CSS time (`180ms`, `.18s`); `fallback` when it does not parse. */
8
+ export declare function parseDuration(value: string | null | undefined, fallback?: number): number;
9
+ /** Easing function for a CSS `<easing-function>`: `linear`, the `ease*` keywords or `cubic-bezier()`. */
10
+ export declare function parseEasing(value: string | null | undefined): Easing;
11
+ /**
12
+ * Value a count-up shows `elapsed` ms into a run of `duration` ms. It lands exactly on `to` at the
13
+ * end, and integer runs stay integers so a formatter never flashes decimals.
14
+ */
15
+ export declare function countAt(from: number, to: number, elapsed: number, duration: number, ease: Easing): number;
@@ -0,0 +1,68 @@
1
+ const DEFAULT_DURATION_MS = 180;
2
+ const DEFAULT_EASE = "cubic-bezier(.2,.8,.2,1)";
3
+ const COUNT_UP_SCALE = 1.5;
4
+ function parseDuration(value, fallback = DEFAULT_DURATION_MS) {
5
+ const match = /^\s*(-?\d*\.?\d+)\s*(ms|s)\s*$/i.exec(value ?? "");
6
+ if (!match) return fallback;
7
+ const amount = Number(match[1]) * (match[2]?.toLowerCase() === "s" ? 1e3 : 1);
8
+ return Number.isFinite(amount) && amount >= 0 ? amount : fallback;
9
+ }
10
+ function cubicBezier(x1, y1, x2, y2) {
11
+ const sample = (a, b, t) => 3 * a * t * (1 - t) ** 2 + 3 * b * t ** 2 * (1 - t) + t ** 3;
12
+ const slope = (a, b, t) => 3 * a * (1 - t) ** 2 + 6 * (b - a) * t * (1 - t) + 3 * (1 - b) * t ** 2;
13
+ return (x) => {
14
+ if (x <= 0) return 0;
15
+ if (x >= 1) return 1;
16
+ let t = x;
17
+ for (let i = 0; i < 8; i += 1) {
18
+ const error = sample(x1, x2, t) - x;
19
+ if (Math.abs(error) < 1e-6) return sample(y1, y2, t);
20
+ const d = slope(x1, x2, t);
21
+ if (Math.abs(d) < 1e-6) break;
22
+ t -= error / d;
23
+ }
24
+ let lo = 0;
25
+ let hi = 1;
26
+ t = x;
27
+ for (let i = 0; i < 30; i += 1) {
28
+ const value = sample(x1, x2, t);
29
+ if (Math.abs(value - x) < 1e-6) break;
30
+ if (value < x) lo = t;
31
+ else hi = t;
32
+ t = (lo + hi) / 2;
33
+ }
34
+ return sample(y1, y2, t);
35
+ };
36
+ }
37
+ const KEYWORDS = {
38
+ ease: [0.25, 0.1, 0.25, 1],
39
+ "ease-in": [0.42, 0, 1, 1],
40
+ "ease-out": [0, 0, 0.58, 1],
41
+ "ease-in-out": [0.42, 0, 0.58, 1]
42
+ };
43
+ function parseEasing(value) {
44
+ const text = (value ?? "").trim().toLowerCase();
45
+ if (text === "linear") return (t) => Math.min(1, Math.max(0, t));
46
+ const keyword = KEYWORDS[text];
47
+ if (keyword) return cubicBezier(...keyword);
48
+ const match = /^cubic-bezier\(([^)]*)\)$/.exec(text);
49
+ const points = match?.[1]?.split(",").map(Number);
50
+ if (points?.length === 4 && points.every(Number.isFinite)) {
51
+ const [x1, y1, x2, y2] = points;
52
+ if (x1 >= 0 && x1 <= 1 && x2 >= 0 && x2 <= 1) return cubicBezier(x1, y1, x2, y2);
53
+ }
54
+ return cubicBezier(0.2, 0.8, 0.2, 1);
55
+ }
56
+ function countAt(from, to, elapsed, duration, ease) {
57
+ if (!(duration > 0) || elapsed >= duration) return to;
58
+ const value = from + (to - from) * ease(Math.max(0, elapsed) / duration);
59
+ return Number.isInteger(from) && Number.isInteger(to) ? Math.round(value) : value;
60
+ }
61
+ export {
62
+ COUNT_UP_SCALE,
63
+ DEFAULT_DURATION_MS,
64
+ DEFAULT_EASE,
65
+ countAt,
66
+ parseDuration,
67
+ parseEasing
68
+ };
@@ -0,0 +1 @@
1
+ export declare function MotionStyles(): import("react").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ const D = "var(--motion-duration,180ms)";
3
+ const E = "var(--motion-ease,cubic-bezier(.2,.8,.2,1))";
4
+ const CSS = `
5
+ @keyframes ui-motion-enter{from{opacity:0;transform:translate3d(0,var(--ui-motion-rise,6px),0)}}
6
+ @keyframes ui-motion-leave{to{opacity:0}}
7
+ @keyframes ui-motion-pulse-a{from{background-color:var(--ui-motion-highlight)}}
8
+ @keyframes ui-motion-pulse-b{from{background-color:var(--ui-motion-highlight)}}
9
+ [data-motion-stagger]{--ui-motion-step:min(calc(${D} / 4),calc(var(--ui-motion-span,calc(${D} * 1.5)) / var(--ui-motion-n,1)))}
10
+ [data-motion=wait]{opacity:0}
11
+ [data-motion=wait]:focus-within{opacity:1}
12
+ [data-motion=enter]{animation:ui-motion-enter ${D} ${E} backwards;animation-delay:calc(var(--ui-motion-delay,0ms) + var(--ui-motion-i,0) * var(--ui-motion-step,0ms))}
13
+ [data-motion-swap]{position:relative}
14
+ [data-motion-swap]>[data-motion=enter]{--ui-motion-rise:4px}
15
+ [data-motion-swap]>[data-motion-leave]{position:absolute;inset:0 0 auto;pointer-events:none;animation:ui-motion-leave ${D} ${E} forwards}
16
+ [data-motion-pulse]{--ui-motion-highlight:color-mix(in srgb,var(--accent,currentColor) 24%,transparent)}
17
+ [data-motion-pulse=a]:not(tr),tr[data-motion-pulse=a]>*{animation:ui-motion-pulse-a calc(${D} * 1.6) ${E}}
18
+ [data-motion-pulse=b]:not(tr),tr[data-motion-pulse=b]>*{animation:ui-motion-pulse-b calc(${D} * 1.6) ${E}}
19
+ .ui-count{font-variant-numeric:tabular-nums}
20
+ .ui-count-run{display:inline-grid;justify-items:end}
21
+ .ui-count-run>*{grid-area:1/1}
22
+ .ui-count-run>:first-child{visibility:hidden}
23
+ .ui-motion-sr{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}
24
+ @media (prefers-reduced-motion:reduce){
25
+ [data-motion]{animation:none!important;opacity:1!important}
26
+ [data-motion-swap]>[data-motion-leave]{display:none}
27
+ [data-motion-pulse]:not(tr),tr[data-motion-pulse]>*{animation:none!important}
28
+ }
29
+ `;
30
+ function MotionStyles() {
31
+ return /* @__PURE__ */ jsx("style", { href: "jcsoftdev-ui-motion", precedence: "default", children: CSS });
32
+ }
33
+ export {
34
+ MotionStyles
35
+ };
@@ -0,0 +1,37 @@
1
+ import { type HTMLAttributes, type ReactNode, type Ref } from "react";
2
+ export interface RevealProps extends HTMLAttributes<HTMLElement> {
3
+ /** Extra wait before entering, in ms. */
4
+ delay?: number;
5
+ /** Enter when the element first scrolls into view instead of on mount. */
6
+ inView?: boolean;
7
+ /** Animate the single child element instead of rendering a `div`. */
8
+ asChild?: boolean;
9
+ ref?: Ref<HTMLElement>;
10
+ }
11
+ /**
12
+ * Fades its content in with a small rise when it mounts on the client, or first scrolls into view
13
+ * with `inView`. Server-rendered content and reduced motion show the end state at once. The
14
+ * content stays in the accessibility tree the whole time: hiding uses `opacity` only.
15
+ */
16
+ export declare function Reveal({ delay, inView, asChild, style, ref, ...props }: RevealProps): import("react").JSX.Element;
17
+ export interface StaggerProps extends HTMLAttributes<HTMLElement> {
18
+ /** Extra wait before the first child enters, in ms. */
19
+ delay?: number;
20
+ /** Start when the group first scrolls into view instead of on mount. */
21
+ inView?: boolean;
22
+ /**
23
+ * Longest gap between the first and the last child's start, in ms. Each step is a quarter of
24
+ * `--motion-duration`, shortened so long lists still fit in this span (default 1.5 durations).
25
+ */
26
+ maxStagger?: number;
27
+ /** Element that wraps the children, e.g. `ul` for a list of `li`. */
28
+ as?: "div" | "ul" | "ol" | "section";
29
+ ref?: Ref<HTMLElement>;
30
+ children?: ReactNode;
31
+ }
32
+ /**
33
+ * Its children enter one after another, like `Reveal`, with the whole sequence capped by
34
+ * `maxStagger`. Each child element receives `data-motion` and a `style` variable, so it must
35
+ * pass `style` and `data-*` props to its DOM element (every element and most components do).
36
+ */
37
+ export declare function Stagger({ delay, inView, maxStagger, as: Tag, style, ref, children, ...props }: StaggerProps): import("react").JSX.Element;
@@ -0,0 +1,69 @@
1
+ "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import {
4
+ Children,
5
+ isValidElement
6
+ } from "react";
7
+ import { composeRefs, Slot } from "../utils/slot.js";
8
+ import { MotionStyles } from "./motion-styles.js";
9
+ import { useEnterPhase } from "./use-enter-phase.js";
10
+ function phaseProps(phase, vars, style) {
11
+ if (phase === "static") return { style };
12
+ return { "data-motion": phase, style: { ...vars, ...style } };
13
+ }
14
+ function Reveal({ delay, inView = false, asChild, style, ref, ...props }) {
15
+ const [phaseRef, phase] = useEnterPhase(inView);
16
+ const Comp = asChild ? Slot : "div";
17
+ const vars = { "--ui-motion-i": 0 };
18
+ if (delay) vars["--ui-motion-delay"] = `${delay}ms`;
19
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
20
+ /* @__PURE__ */ jsx(MotionStyles, {}),
21
+ /* @__PURE__ */ jsx(
22
+ Comp,
23
+ {
24
+ ref: composeRefs(ref, phaseRef),
25
+ ...phaseProps(phase, vars, style),
26
+ ...props
27
+ }
28
+ )
29
+ ] });
30
+ }
31
+ function Stagger({
32
+ delay,
33
+ inView = false,
34
+ maxStagger,
35
+ as: Tag = "div",
36
+ style,
37
+ ref,
38
+ children,
39
+ ...props
40
+ }) {
41
+ const [phaseRef, phase] = useEnterPhase(inView);
42
+ const items = Children.toArray(children);
43
+ const vars = { "--ui-motion-n": Math.max(1, items.length - 1) };
44
+ if (maxStagger !== void 0) vars["--ui-motion-span"] = `${Math.max(0, maxStagger)}ms`;
45
+ const itemVars = (i) => {
46
+ const next = { "--ui-motion-i": i };
47
+ if (delay) next["--ui-motion-delay"] = `${delay}ms`;
48
+ return next;
49
+ };
50
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
51
+ /* @__PURE__ */ jsx(MotionStyles, {}),
52
+ /* @__PURE__ */ jsx(
53
+ Tag,
54
+ {
55
+ ref: composeRefs(ref, phaseRef),
56
+ "data-motion-stagger": phase === "static" ? void 0 : "",
57
+ style: phase === "static" ? style : { ...vars, ...style },
58
+ ...props,
59
+ children: items.map(
60
+ (child, i) => isValidElement(child) ? /* @__PURE__ */ jsx(Slot, { ...phaseProps(phase, itemVars(i)), children: child }, child.key) : child
61
+ )
62
+ }
63
+ )
64
+ ] });
65
+ }
66
+ export {
67
+ Reveal,
68
+ Stagger
69
+ };
@@ -0,0 +1,11 @@
1
+ import { type RefCallback } from "react";
2
+ /**
3
+ * True when this component's first render came from server HTML (on the server and while
4
+ * hydrating), false when it mounted on the client. Fixed for the component's lifetime, so server
5
+ * markup is never animated after hydration and hydration always matches it.
6
+ */
7
+ export declare function useStartedOnServer(): boolean;
8
+ /** `static`: no motion (server HTML or reduced motion). `wait`: hidden until in view. `enter`: animating in. */
9
+ export type EnterPhase = "static" | "wait" | "enter";
10
+ /** Phase of an enter animation, on mount or (with `inView`) when the element first scrolls into view. */
11
+ export declare function useEnterPhase(inView: boolean): [RefCallback<HTMLElement>, EnterPhase];
@@ -0,0 +1,40 @@
1
+ "use client";
2
+ import { useEffect, useState, useSyncExternalStore } from "react";
3
+ import { usePrefersReducedMotion } from "../utils/reduced-motion.js";
4
+ const subscribeNever = () => () => {
5
+ };
6
+ function useStartedOnServer() {
7
+ const hydrating = useSyncExternalStore(
8
+ subscribeNever,
9
+ () => false,
10
+ () => true
11
+ );
12
+ const [started] = useState(hydrating);
13
+ return started;
14
+ }
15
+ function useEnterPhase(inView) {
16
+ const startedOnServer = useStartedOnServer();
17
+ const reduced = usePrefersReducedMotion();
18
+ const [seen, setSeen] = useState(!inView);
19
+ const [node, setNode] = useState(null);
20
+ const animate = !startedOnServer && !reduced;
21
+ useEffect(() => {
22
+ if (!animate || seen || !node) return;
23
+ if (typeof IntersectionObserver === "undefined") {
24
+ setSeen(true);
25
+ return;
26
+ }
27
+ const observer = new IntersectionObserver((entries) => {
28
+ if (!entries.some((entry) => entry.isIntersecting)) return;
29
+ observer.disconnect();
30
+ setSeen(true);
31
+ });
32
+ observer.observe(node);
33
+ return () => observer.disconnect();
34
+ }, [animate, seen, node]);
35
+ return [setNode, !animate ? "static" : seen ? "enter" : "wait"];
36
+ }
37
+ export {
38
+ useEnterPhase,
39
+ useStartedOnServer
40
+ };
@@ -0,0 +1,22 @@
1
+ import { type AnimationEvent, type Key } from "react";
2
+ type Pulse = "a" | "b";
3
+ /** Props for a highlighted row: spread them on the row element (`tr`, `li`, `div`). */
4
+ export interface HighlightRowProps {
5
+ "data-motion-pulse"?: Pulse;
6
+ onAnimationEnd: (event: AnimationEvent<HTMLElement>) => void;
7
+ }
8
+ export interface HighlightRow<K extends Key> {
9
+ /** Pulses the row with this key, e.g. after it was updated. Calling it again restarts the pulse. */
10
+ highlight: (key: K) => void;
11
+ /** Props for the row with this key. Render `<MotionStyles />` or any motion component once on the page. */
12
+ rowProps: (key: K) => HighlightRowProps;
13
+ }
14
+ /**
15
+ * A brief background pulse (accent tint fading out over 1.6 `--motion-duration`s) on rows that
16
+ * were inserted or updated. Pass the current row keys to pulse every key that appears after the
17
+ * first render automatically; call `highlight(key)` for updates. The rows on the first render
18
+ * (and in server HTML) never pulse, and under reduced motion nothing pulses.
19
+ * In a `tr` the cells carry the pulse, so it shows through cell backgrounds.
20
+ */
21
+ export declare function useHighlightRow<K extends Key>(keys?: readonly K[]): HighlightRow<K>;
22
+ export {};
@@ -0,0 +1,38 @@
1
+ "use client";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
+ import { usePrefersReducedMotion } from "../utils/reduced-motion.js";
4
+ function useHighlightRow(keys) {
5
+ const reduced = usePrefersReducedMotion();
6
+ const [pulses, setPulses] = useState(() => /* @__PURE__ */ new Map());
7
+ const known = useRef(null);
8
+ const highlight = useCallback(
9
+ (key) => {
10
+ if (reduced) return;
11
+ setPulses((map) => new Map(map).set(key, map.get(key) === "a" ? "b" : "a"));
12
+ },
13
+ [reduced]
14
+ );
15
+ useEffect(() => {
16
+ if (!keys) return;
17
+ const previous = known.current;
18
+ known.current = new Set(keys);
19
+ if (!previous) return;
20
+ for (const key of keys) if (!previous.has(key)) highlight(key);
21
+ }, [keys, highlight]);
22
+ const rowProps = (key) => ({
23
+ "data-motion-pulse": pulses.get(key),
24
+ onAnimationEnd: (event) => {
25
+ if (!event.animationName.startsWith("ui-motion-pulse")) return;
26
+ setPulses((map) => {
27
+ if (!map.has(key)) return map;
28
+ const next = new Map(map);
29
+ next.delete(key);
30
+ return next;
31
+ });
32
+ }
33
+ });
34
+ return { highlight, rowProps };
35
+ }
36
+ export {
37
+ useHighlightRow
38
+ };
@@ -120,7 +120,7 @@ function TabsTrigger({
120
120
  }
121
121
  }),
122
122
  className: cn(
123
- "inline-flex shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap border-b-2 border-transparent px-2.5 @max-[420px]/tabs:px-2 pt-2.75 pb-2.5 text-control text-ink-3 hover:text-ink focus-visible:-outline-offset-2 data-[state=active]:border-accent-word data-[state=active]:text-ink",
123
+ "inline-flex min-h-(--touch-target) shrink-0 cursor-pointer items-center gap-1.5 whitespace-nowrap border-b-2 border-transparent px-2.5 @max-[420px]/tabs:px-2 pt-2.75 pb-2.5 text-control text-ink-3 hover:text-ink focus-visible:-outline-offset-2 data-[state=active]:border-accent-word data-[state=active]:text-ink",
124
124
  className
125
125
  ),
126
126
  children: [
@@ -1,4 +1,5 @@
1
1
  import { type ComponentPropsWithoutRef, type ReactNode } from "react";
2
+ import { type ButtonSize } from "../../atoms/button/button.js";
2
3
  import type { ClassNames } from "../../utils/class-names.js";
3
4
  import { type WizardGate } from "./model.js";
4
5
  export type { WizardGate } from "./model.js";
@@ -32,6 +33,8 @@ export interface WizardProps extends Omit<ComponentPropsWithoutRef<"div">, "chil
32
33
  backLabel?: string | undefined;
33
34
  nextLabel?: string | undefined;
34
35
  finishLabel?: string | undefined;
36
+ /** Size of the Back and Next/Finish buttons. Default `md` (38px, the height of a default field). */
37
+ buttonSize?: ButtonSize | undefined;
35
38
  /** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root. */
36
39
  classNames?: ClassNames<WizardPart>;
37
40
  }
@@ -42,4 +45,4 @@ export interface WizardProps extends Omit<ComponentPropsWithoutRef<"div">, "chil
42
45
  * single-line input advances. Under 420px of its own width the step title becomes visible and
43
46
  * the buttons stack.
44
47
  */
45
- export declare function Wizard({ steps, value: valueProp, defaultValue, onValueChange, onBeforeNext, onComplete, backLabel, nextLabel, finishLabel, className, classNames, ...props }: WizardProps): import("react").JSX.Element | null;
48
+ export declare function Wizard({ steps, value: valueProp, defaultValue, onValueChange, onBeforeNext, onComplete, backLabel, nextLabel, buttonSize, finishLabel, className, classNames, ...props }: WizardProps): import("react").JSX.Element | null;
@@ -20,6 +20,7 @@ function Wizard({
20
20
  onComplete,
21
21
  backLabel,
22
22
  nextLabel,
23
+ buttonSize = "md",
23
24
  finishLabel,
24
25
  className,
25
26
  classNames,
@@ -139,6 +140,7 @@ function Wizard({
139
140
  Button,
140
141
  {
141
142
  variant: "secondary",
143
+ size: buttonSize,
142
144
  disabled: index === 0 || pending !== null,
143
145
  onClick: () => goTo(index - 1),
144
146
  className: classNames?.back,
@@ -149,6 +151,7 @@ function Wizard({
149
151
  Button,
150
152
  {
151
153
  variant: "primary",
154
+ size: buttonSize,
152
155
  loading: pending !== null,
153
156
  loadingLabel: strings.processing,
154
157
  disabled: blocked,
@@ -14,6 +14,7 @@ import { useUiStrings } from "../../i18n/index.js";
14
14
  import * as DialogPrimitive from "../../primitives/dialog/dialog.js";
15
15
  import { cn } from "../../utils/cn.js";
16
16
  import { materialClass } from "../../utils/material.js";
17
+ import { DIALOG_MOTION, OVERLAY_MOTION } from "../../utils/overlay-motion.js";
17
18
  import { useControllableState } from "../../utils/use-controllable-state.js";
18
19
  import {
19
20
  PreviousFocusProvider,
@@ -191,7 +192,12 @@ function AlertDialogPanel({
191
192
  }) {
192
193
  const previousFocusRef = usePreviousFocus();
193
194
  return /* @__PURE__ */ jsxs(DialogPrimitive.Portal, { container, children: [
194
- /* @__PURE__ */ jsx(DialogPrimitive.Overlay, { className: cn("fixed inset-0 z-70 bg-scrim", classNames?.overlay) }),
195
+ /* @__PURE__ */ jsx(
196
+ DialogPrimitive.Overlay,
197
+ {
198
+ className: cn("fixed inset-0 z-70 bg-scrim", OVERLAY_MOTION, classNames?.overlay)
199
+ }
200
+ ),
195
201
  /* @__PURE__ */ jsx(
196
202
  DialogPrimitive.Content,
197
203
  {
@@ -204,6 +210,7 @@ function AlertDialogPanel({
204
210
  onCloseAutoFocus: (event) => restoreFocusOnClose(event, previousFocusRef),
205
211
  className: cn(
206
212
  "@container/dialog fixed top-[9dvh] left-1/2 z-70 flex max-h-[84dvh] w-[min(420px,100%)] max-w-full -translate-x-1/2 flex-col overflow-auto rounded-dialog outline-none surface-overlay shadow-overlay",
213
+ DIALOG_MOTION,
207
214
  materialClass(material, "surface-solid"),
208
215
  classNames?.root,
209
216
  className
@@ -13,6 +13,7 @@ import { Check } from "../../icons/index.js";
13
13
  import * as MenuPrimitive from "../../primitives/menu/menu.js";
14
14
  import { cn } from "../../utils/cn.js";
15
15
  import { materialClass } from "../../utils/material.js";
16
+ import { ITEM_MOTION, POPPER_MOTION } from "../../utils/overlay-motion.js";
16
17
  const ContextMenuContext = createContext(null);
17
18
  const LONG_PRESS_MS = 600;
18
19
  function ContextMenu({
@@ -141,6 +142,7 @@ function ContextMenuContent({
141
142
  },
142
143
  className: cn(
143
144
  "z-85 max-h-(--ui-popper-available-height) min-w-48 max-w-(--ui-popper-available-width) overflow-y-auto rounded-popover border-card surface-overlay p-1.5 text-ink shadow-overlay",
145
+ POPPER_MOTION,
144
146
  materialClass(material, "surface-solid"),
145
147
  className
146
148
  ),
@@ -148,7 +150,7 @@ function ContextMenuContent({
148
150
  }
149
151
  ) });
150
152
  }
151
- const itemBase = "relative flex min-h-control-sm w-full cursor-pointer select-none items-center gap-density-sm rounded-button px-control-x text-body outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-surface-2 [&_svg]:size-4 [&_svg]:shrink-0";
153
+ const itemBase = `relative flex min-h-control-sm w-full cursor-pointer select-none items-center gap-density-sm rounded-button px-control-x text-body outline-none data-disabled:pointer-events-none data-disabled:opacity-50 data-highlighted:bg-surface-2 [&_svg]:size-4 [&_svg]:shrink-0 ${ITEM_MOTION}`;
152
154
  function ContextMenuItem({ className, tone = "default", ...props }) {
153
155
  return /* @__PURE__ */ jsx(
154
156
  MenuPrimitive.Item,