@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.
- package/CHANGELOG.md +434 -0
- package/README.md +26 -4
- package/bin/ui-theme.mjs +40 -6
- package/dist/ai/code-block/code-block.js +1 -1
- package/dist/atoms/big-date/big-date.js +2 -2
- package/dist/atoms/button/button.d.ts +14 -2
- package/dist/atoms/button/button.js +12 -5
- package/dist/atoms/chip/chip.d.ts +5 -0
- package/dist/atoms/chip/chip.js +3 -3
- package/dist/atoms/divider/divider.d.ts +15 -0
- package/dist/atoms/divider/divider.js +27 -0
- package/dist/atoms/divider/index.d.ts +1 -0
- package/dist/atoms/divider/index.js +1 -0
- package/dist/atoms/icon-button/icon-button.d.ts +1 -1
- package/dist/atoms/icon-button/icon-button.js +1 -1
- package/dist/atoms/index.d.ts +1 -0
- package/dist/atoms/index.js +1 -0
- package/dist/atoms/internal/hit-area.d.ts +5 -4
- package/dist/atoms/internal/hit-area.js +1 -1
- package/dist/atoms/progress/index.d.ts +1 -1
- package/dist/atoms/progress/index.js +4 -1
- package/dist/atoms/progress/progress.d.ts +6 -1
- package/dist/atoms/progress/progress.js +19 -1
- package/dist/atoms/radio-group/radio-group.js +1 -1
- package/dist/atoms/status-pill/status-pill.d.ts +16 -5
- package/dist/atoms/status-pill/status-pill.js +43 -18
- package/dist/auth/auth-illustration/auth-illustration.d.ts +35 -0
- package/dist/auth/auth-illustration/auth-illustration.js +72 -0
- package/dist/auth/auth-illustration/index.d.ts +3 -0
- package/dist/auth/auth-illustration/index.js +11 -0
- package/dist/auth/auth-illustration/look.d.ts +30 -0
- package/dist/auth/auth-illustration/look.js +0 -0
- package/dist/auth/auth-illustration/model.d.ts +133 -0
- package/dist/auth/auth-illustration/model.js +202 -0
- package/dist/auth/auth-illustration/use-art-pointer.d.ts +9 -0
- package/dist/auth/auth-illustration/use-art-pointer.js +69 -0
- package/dist/auth/auth-layout/auth-layout.d.ts +80 -0
- package/dist/auth/auth-layout/auth-layout.js +190 -0
- package/dist/auth/auth-layout/index.d.ts +1 -0
- package/dist/auth/auth-layout/index.js +1 -0
- package/dist/auth/character/character.d.ts +12 -0
- package/dist/auth/character/character.js +333 -0
- package/dist/auth/character/index.d.ts +1 -0
- package/dist/auth/character/index.js +1 -0
- package/dist/auth/index.d.ts +4 -0
- package/dist/auth/index.js +4 -0
- package/dist/auth/internal/auth-context.d.ts +17 -0
- package/dist/auth/internal/auth-context.js +10 -0
- package/dist/auth/internal/auth-styles.d.ts +1 -0
- package/dist/auth/internal/auth-styles.js +29 -0
- package/dist/auth/internal/portal-glyphs.d.ts +6 -0
- package/dist/auth/internal/portal-glyphs.js +39 -0
- package/dist/auth/login-form/context.d.ts +51 -0
- package/dist/auth/login-form/context.js +12 -0
- package/dist/auth/login-form/index.d.ts +2 -0
- package/dist/auth/login-form/index.js +23 -0
- package/dist/auth/login-form/login-form.d.ts +66 -0
- package/dist/auth/login-form/login-form.js +233 -0
- package/dist/auth/login-form/parts.d.ts +71 -0
- package/dist/auth/login-form/parts.js +371 -0
- package/dist/auth/looks/auth-illustration-any.d.ts +16 -0
- package/dist/auth/looks/auth-illustration-any.js +24 -0
- package/dist/auth/looks/index.d.ts +1 -0
- package/dist/auth/looks/index.js +1 -0
- package/dist/auth/mosaic/index.d.ts +1 -0
- package/dist/auth/mosaic/index.js +1 -0
- package/dist/auth/mosaic/mosaic.d.ts +11 -0
- package/dist/auth/mosaic/mosaic.js +195 -0
- package/dist/auth/slabs/index.d.ts +1 -0
- package/dist/auth/slabs/index.js +1 -0
- package/dist/auth/slabs/slabs.d.ts +13 -0
- package/dist/auth/slabs/slabs.js +136 -0
- package/dist/auth/stack/index.d.ts +1 -0
- package/dist/auth/stack/index.js +1 -0
- package/dist/auth/stack/stack.d.ts +6 -0
- package/dist/auth/stack/stack.js +222 -0
- package/dist/auth/statement/index.d.ts +1 -0
- package/dist/auth/statement/index.js +1 -0
- package/dist/auth/statement/statement.d.ts +13 -0
- package/dist/auth/statement/statement.js +99 -0
- package/dist/brand/logo-forge.js +1 -1
- package/dist/charts/candlestick-chart/candlestick-chart.js +2 -2
- package/dist/charts/chart-grid/chart-grid.js +2 -2
- package/dist/charts/chord-chart/chord-chart.js +1 -1
- package/dist/charts/core/axes.js +2 -2
- package/dist/charts/core/cartesian/annotations.js +2 -2
- package/dist/charts/core/cartesian/marks.js +1 -1
- package/dist/charts/core/distribution/marks.js +1 -1
- package/dist/charts/core/distribution/xy-points.js +1 -1
- package/dist/charts/core/export-menu.js +1 -1
- package/dist/charts/funnel-chart/funnel-chart.js +1 -1
- package/dist/charts/gantt-chart/gantt-chart.js +4 -4
- package/dist/charts/gantt-chart/gantt-marks.js +3 -3
- package/dist/charts/index.d.ts +2 -0
- package/dist/charts/index.js +2 -0
- package/dist/charts/maps/geo/map-data-table.js +1 -1
- package/dist/charts/polar-area-chart/polar-area-chart.js +1 -1
- package/dist/charts/radar-chart/radar-chart.js +1 -1
- package/dist/charts/stock-chart/stock-chart.js +1 -1
- package/dist/charts/stock-chart/stock-drawing-layer.js +3 -3
- package/dist/charts/stock-chart/stock-plot.js +2 -2
- package/dist/containers/chat-thread/chat-thread.d.ts +98 -0
- package/dist/containers/chat-thread/chat-thread.js +219 -0
- package/dist/containers/chat-thread/format.d.ts +20 -0
- package/dist/containers/chat-thread/format.js +50 -0
- package/dist/containers/chat-thread/index.d.ts +1 -0
- package/dist/containers/chat-thread/index.js +8 -0
- package/dist/containers/cols/cols.d.ts +1 -1
- package/dist/containers/cols/cols.js +7 -0
- package/dist/containers/comment/comment.js +1 -1
- package/dist/containers/context-rail/context-rail.d.ts +62 -0
- package/dist/containers/context-rail/context-rail.js +175 -0
- package/dist/containers/context-rail/index.d.ts +1 -0
- package/dist/containers/context-rail/index.js +6 -0
- package/dist/containers/dashboard/dashboard.d.ts +40 -0
- package/dist/containers/dashboard/dashboard.js +84 -0
- package/dist/containers/dashboard/index.d.ts +1 -0
- package/dist/containers/dashboard/index.js +14 -0
- package/dist/containers/data-grid/data-grid.demos.js +4 -4
- package/dist/containers/data-grid/data-grid.js +6 -6
- package/dist/containers/data-grid/filter-builder-editor.js +2 -2
- package/dist/containers/data-grid/grid-toolbar.js +1 -1
- package/dist/containers/data-grid/spreadsheet.demos.d.ts +1 -1
- package/dist/containers/data-grid/spreadsheet.demos.js +1 -1
- package/dist/containers/detail-header/detail-header.d.ts +24 -0
- package/dist/containers/detail-header/detail-header.js +32 -0
- package/dist/containers/detail-header/index.d.ts +1 -0
- package/dist/containers/detail-header/index.js +6 -0
- package/dist/containers/facts/facts.js +1 -1
- package/dist/containers/filter-bar/filter-bar.d.ts +58 -0
- package/dist/containers/filter-bar/filter-bar.js +123 -0
- package/dist/containers/filter-bar/index.d.ts +1 -0
- package/dist/containers/filter-bar/index.js +6 -0
- package/dist/containers/hbars/hbars.js +2 -2
- package/dist/containers/index.d.ts +9 -0
- package/dist/containers/index.js +9 -0
- package/dist/containers/kanban/kanban.d.ts +23 -2
- package/dist/containers/kanban/kanban.js +101 -21
- package/dist/containers/kanban/model.d.ts +12 -0
- package/dist/containers/kanban/model.js +8 -0
- package/dist/containers/kpi/kpi.js +1 -1
- package/dist/containers/kpi-group/kpi-group.d.ts +6 -1
- package/dist/containers/kpi-group/kpi-group.js +6 -2
- package/dist/containers/list-detail/index.d.ts +1 -1
- package/dist/containers/list-detail/index.js +4 -0
- package/dist/containers/list-detail/list-detail.d.ts +51 -3
- package/dist/containers/list-detail/list-detail.js +109 -15
- package/dist/containers/page/page.d.ts +17 -4
- package/dist/containers/page/page.js +33 -4
- package/dist/containers/page-header/back.d.ts +10 -0
- package/dist/containers/page-header/back.js +28 -0
- package/dist/containers/page-header/index.d.ts +1 -0
- package/dist/containers/page-header/index.js +1 -0
- package/dist/containers/page-header/page-header.d.ts +19 -2
- package/dist/containers/page-header/page-header.js +26 -2
- package/dist/containers/pagination/cursor-pagination.d.ts +28 -0
- package/dist/containers/pagination/cursor-pagination.js +48 -0
- package/dist/containers/pagination/index.d.ts +3 -0
- package/dist/containers/pagination/index.js +10 -0
- package/dist/containers/pagination/pagination.d.ts +52 -0
- package/dist/containers/pagination/pagination.js +216 -0
- package/dist/containers/pagination/range.d.ts +29 -0
- package/dist/containers/pagination/range.js +42 -0
- package/dist/containers/pagination/use-pagination.d.ts +18 -0
- package/dist/containers/pagination/use-pagination.js +22 -0
- package/dist/containers/responsive-list/responsive-list.d.ts +28 -2
- package/dist/containers/responsive-list/responsive-list.js +134 -25
- package/dist/containers/row-actions/index.d.ts +1 -0
- package/dist/containers/row-actions/index.js +4 -0
- package/dist/containers/row-actions/row-actions.d.ts +26 -0
- package/dist/containers/row-actions/row-actions.js +78 -0
- package/dist/containers/selectable-card/index.d.ts +1 -0
- package/dist/containers/selectable-card/index.js +6 -0
- package/dist/containers/selectable-card/selectable-card.d.ts +26 -0
- package/dist/containers/selectable-card/selectable-card.js +57 -0
- package/dist/containers/settings-layout/settings-layout.d.ts +24 -7
- package/dist/containers/settings-layout/settings-layout.js +63 -8
- package/dist/containers/shortcuts/shortcuts.js +1 -1
- package/dist/containers/table/cell-padding.d.ts +2 -0
- package/dist/containers/table/cell-padding.js +4 -0
- package/dist/containers/table/index.d.ts +1 -0
- package/dist/containers/table/index.js +8 -0
- package/dist/containers/table/sort.d.ts +14 -0
- package/dist/containers/table/sort.js +11 -0
- package/dist/containers/table/table-parts.d.ts +24 -0
- package/dist/containers/table/table-parts.js +52 -0
- package/dist/containers/table/table.d.ts +37 -3
- package/dist/containers/table/table.js +120 -19
- package/dist/containers/table-columns-menu/index.d.ts +1 -0
- package/dist/containers/table-columns-menu/index.js +6 -0
- package/dist/containers/table-columns-menu/table-columns-menu.d.ts +14 -0
- package/dist/containers/table-columns-menu/table-columns-menu.js +46 -0
- package/dist/dashboards/layout.d.ts +1 -27
- package/dist/dashboards/layout.js +8 -40
- package/dist/forms/chip-group/chip-group.d.ts +5 -0
- package/dist/forms/chip-group/chip-group.js +3 -1
- package/dist/forms/combobox/combobox.js +1 -1
- package/dist/forms/copy-field/copy-field.js +1 -1
- package/dist/forms/date-picker/date-picker.d.ts +3 -1
- package/dist/forms/date-picker/date-picker.js +4 -2
- package/dist/forms/date-picker/date-time-picker.d.ts +8 -2
- package/dist/forms/date-picker/date-time-picker.js +13 -2
- package/dist/forms/field/field.d.ts +9 -2
- package/dist/forms/field/field.js +18 -4
- package/dist/forms/fieldset/fieldset.d.ts +11 -0
- package/dist/forms/fieldset/fieldset.js +12 -0
- package/dist/forms/fieldset/index.d.ts +1 -0
- package/dist/forms/fieldset/index.js +4 -0
- package/dist/forms/form-footer/form-footer.d.ts +26 -0
- package/dist/forms/form-footer/form-footer.js +44 -0
- package/dist/forms/form-footer/index.d.ts +1 -0
- package/dist/forms/form-footer/index.js +4 -0
- package/dist/forms/form-grid/form-grid.d.ts +21 -4
- package/dist/forms/form-grid/form-grid.js +20 -3
- package/dist/forms/form-grid/index.d.ts +1 -1
- package/dist/forms/form-grid/index.js +6 -2
- package/dist/forms/form-section/form-section.d.ts +12 -0
- package/dist/forms/form-section/form-section.js +30 -0
- package/dist/forms/form-section/index.d.ts +1 -0
- package/dist/forms/form-section/index.js +4 -0
- package/dist/forms/index.d.ts +4 -0
- package/dist/forms/index.js +4 -0
- package/dist/forms/input/input.d.ts +6 -2
- package/dist/forms/input/input.js +6 -2
- package/dist/forms/internal/listbox-items.d.ts +1 -1
- package/dist/forms/internal/listbox-items.js +3 -2
- package/dist/forms/native-select/native-select.js +1 -1
- package/dist/forms/password-input/index.d.ts +1 -0
- package/dist/forms/password-input/index.js +1 -0
- package/dist/forms/password-input/password-input.d.ts +16 -0
- package/dist/forms/password-input/password-input.js +45 -0
- package/dist/forms/select/index.d.ts +1 -1
- package/dist/forms/select/select.d.ts +5 -2
- package/dist/forms/select/select.js +7 -2
- package/dist/forms/select-menu/select-menu.js +1 -1
- package/dist/forms/time-input/time-input.d.ts +4 -2
- package/dist/forms/time-input/time-input.js +3 -1
- package/dist/i18n/strings.d.ts +150 -0
- package/dist/i18n/strings.js +80 -2
- package/dist/icons/eye.d.ts +2 -0
- package/dist/icons/eye.js +11 -0
- package/dist/icons/graduation-cap.d.ts +2 -0
- package/dist/icons/graduation-cap.js +12 -0
- package/dist/icons/house.d.ts +2 -0
- package/dist/icons/house.js +11 -0
- package/dist/icons/index.d.ts +4 -0
- package/dist/icons/index.js +8 -0
- package/dist/icons/mail.d.ts +2 -0
- package/dist/icons/mail.js +11 -0
- package/dist/motion/count-up.d.ts +20 -0
- package/dist/motion/count-up.js +59 -0
- package/dist/motion/cross-fade.d.ts +21 -0
- package/dist/motion/cross-fade.js +86 -0
- package/dist/motion/index.d.ts +5 -0
- package/dist/motion/index.js +14 -0
- package/dist/motion/model.d.ts +15 -0
- package/dist/motion/model.js +68 -0
- package/dist/motion/motion-styles.d.ts +1 -0
- package/dist/motion/motion-styles.js +35 -0
- package/dist/motion/reveal.d.ts +37 -0
- package/dist/motion/reveal.js +69 -0
- package/dist/motion/use-enter-phase.d.ts +11 -0
- package/dist/motion/use-enter-phase.js +40 -0
- package/dist/motion/use-highlight-row.d.ts +22 -0
- package/dist/motion/use-highlight-row.js +38 -0
- package/dist/navigation/tabs/tabs.js +1 -1
- package/dist/navigation/wizard/wizard.d.ts +4 -1
- package/dist/navigation/wizard/wizard.js +3 -0
- package/dist/overlays/alert-dialog/alert-dialog.js +8 -1
- package/dist/overlays/context-menu/context-menu.js +3 -1
- package/dist/overlays/dialog/dialog.js +10 -2
- package/dist/overlays/drawer/drawer.d.ts +18 -4
- package/dist/overlays/drawer/drawer.js +53 -4
- package/dist/overlays/drawer/index.d.ts +1 -1
- package/dist/overlays/dropdown-menu/dropdown-menu.d.ts +1 -1
- package/dist/overlays/dropdown-menu/dropdown-menu.js +5 -4
- package/dist/overlays/hover-card/hover-card.js +2 -0
- package/dist/overlays/popover/popover.js +2 -0
- package/dist/overlays/toaster/index.d.ts +1 -1
- package/dist/overlays/toaster/toaster.d.ts +28 -2
- package/dist/overlays/toaster/toaster.js +73 -29
- package/dist/overlays/tooltip/tooltip.js +2 -0
- package/dist/primitives/use-presence.js +9 -0
- package/dist/shell/app-shell/app-shell.d.ts +8 -1
- package/dist/shell/app-shell/app-shell.js +50 -3
- package/dist/shell/index.d.ts +1 -0
- package/dist/shell/index.js +1 -0
- package/dist/shell/sidebar/sidebar.d.ts +17 -1
- package/dist/shell/sidebar/sidebar.js +126 -76
- package/dist/shell/topbar/topbar.d.ts +4 -2
- package/dist/shell/topbar/topbar.js +2 -0
- package/dist/showcase/operations-bento.js +2 -2
- package/dist/states/empty-state/empty-state.d.ts +10 -3
- package/dist/states/empty-state/empty-state.js +46 -5
- package/dist/states/error-state/error-state.js +1 -1
- package/dist/states/skeleton/skeleton.js +1 -1
- package/dist/utils/class-tokens.generated.js +4 -6
- package/dist/utils/list-navigation.d.ts +14 -0
- package/dist/utils/list-navigation.js +44 -0
- package/dist/utils/overlay-motion.d.ts +12 -0
- package/dist/utils/overlay-motion.js +14 -0
- package/dist/utils/use-container-width.d.ts +6 -0
- package/dist/utils/use-container-width.js +19 -0
- package/icons/svg/eye.svg +4 -0
- package/icons/svg/graduation-cap.svg +5 -0
- package/icons/svg/house.svg +4 -0
- package/icons/svg/mail.svg +4 -0
- package/package.json +2 -2
- package/scripts/build-theme.mjs +46 -5
- package/src/ai/code-block/code-block.tsx +1 -1
- package/src/atoms/big-date/big-date.tsx +2 -2
- package/src/atoms/button/button.tsx +33 -6
- package/src/atoms/chip/chip.tsx +8 -3
- package/src/atoms/divider/divider.tsx +40 -0
- package/src/atoms/divider/index.ts +1 -0
- package/src/atoms/icon-button/icon-button.tsx +2 -2
- package/src/atoms/index.ts +1 -0
- package/src/atoms/internal/hit-area.ts +5 -4
- package/src/atoms/progress/index.ts +8 -1
- package/src/atoms/progress/progress.tsx +30 -1
- package/src/atoms/radio-group/radio-group.tsx +1 -1
- package/src/atoms/status-pill/status-pill.tsx +59 -18
- package/src/auth/auth-illustration/auth-illustration.tsx +100 -0
- package/src/auth/auth-illustration/index.ts +8 -0
- package/src/auth/auth-illustration/look.ts +32 -0
- package/src/auth/auth-illustration/model.ts +330 -0
- package/src/auth/auth-illustration/use-art-pointer.ts +78 -0
- package/src/auth/auth-layout/auth-layout.tsx +282 -0
- package/src/auth/auth-layout/index.ts +1 -0
- package/src/auth/character/character.tsx +346 -0
- package/src/auth/character/index.ts +1 -0
- package/src/auth/index.ts +4 -0
- package/src/auth/internal/auth-context.ts +26 -0
- package/src/auth/internal/auth-styles.tsx +39 -0
- package/src/auth/internal/portal-glyphs.tsx +32 -0
- package/src/auth/login-form/context.ts +78 -0
- package/src/auth/login-form/index.ts +21 -0
- package/src/auth/login-form/login-form.tsx +330 -0
- package/src/auth/login-form/parts.tsx +457 -0
- package/src/auth/looks/auth-illustration-any.tsx +38 -0
- package/src/auth/looks/index.ts +1 -0
- package/src/auth/mosaic/index.ts +1 -0
- package/src/auth/mosaic/mosaic.tsx +255 -0
- package/src/auth/slabs/index.ts +1 -0
- package/src/auth/slabs/slabs.tsx +181 -0
- package/src/auth/stack/index.ts +1 -0
- package/src/auth/stack/stack.tsx +267 -0
- package/src/auth/statement/index.ts +1 -0
- package/src/auth/statement/statement.tsx +122 -0
- package/src/brand/logo-forge.tsx +1 -1
- package/src/charts/candlestick-chart/candlestick-chart.tsx +2 -2
- package/src/charts/chart-grid/chart-grid.tsx +2 -2
- package/src/charts/chord-chart/chord-chart.tsx +1 -1
- package/src/charts/core/axes.tsx +2 -2
- package/src/charts/core/cartesian/annotations.tsx +2 -2
- package/src/charts/core/cartesian/marks.tsx +1 -1
- package/src/charts/core/distribution/marks.tsx +1 -1
- package/src/charts/core/distribution/xy-points.tsx +1 -1
- package/src/charts/core/export-menu.tsx +1 -1
- package/src/charts/funnel-chart/funnel-chart.tsx +1 -1
- package/src/charts/gantt-chart/gantt-chart.tsx +4 -4
- package/src/charts/gantt-chart/gantt-marks.tsx +3 -3
- package/src/charts/index.ts +2 -0
- package/src/charts/maps/geo/map-data-table.tsx +1 -1
- package/src/charts/polar-area-chart/polar-area-chart.tsx +1 -1
- package/src/charts/radar-chart/radar-chart.tsx +1 -1
- package/src/charts/stock-chart/stock-chart.tsx +1 -1
- package/src/charts/stock-chart/stock-drawing-layer.tsx +3 -3
- package/src/charts/stock-chart/stock-plot.tsx +2 -2
- package/src/containers/chat-thread/chat-thread.tsx +331 -0
- package/src/containers/chat-thread/format.ts +67 -0
- package/src/containers/chat-thread/index.ts +12 -0
- package/src/containers/cols/cols.tsx +13 -1
- package/src/containers/comment/comment.tsx +1 -1
- package/src/containers/context-rail/context-rail.tsx +229 -0
- package/src/containers/context-rail/index.ts +7 -0
- package/src/containers/dashboard/dashboard.tsx +142 -0
- package/src/containers/dashboard/index.ts +12 -0
- package/src/containers/data-grid/data-grid.demos.tsx +4 -4
- package/src/containers/data-grid/data-grid.tsx +6 -6
- package/src/containers/data-grid/filter-builder-editor.tsx +2 -2
- package/src/containers/data-grid/grid-toolbar.tsx +1 -1
- package/src/containers/data-grid/spreadsheet.demos.tsx +1 -1
- package/src/containers/detail-header/detail-header.tsx +64 -0
- package/src/containers/detail-header/index.ts +5 -0
- package/src/containers/facts/facts.tsx +1 -1
- package/src/containers/filter-bar/filter-bar.tsx +201 -0
- package/src/containers/filter-bar/index.ts +7 -0
- package/src/containers/hbars/hbars.tsx +2 -2
- package/src/containers/index.ts +9 -0
- package/src/containers/kanban/kanban.tsx +146 -39
- package/src/containers/kanban/model.ts +20 -0
- package/src/containers/kpi/kpi.tsx +1 -1
- package/src/containers/kpi-group/kpi-group.tsx +17 -2
- package/src/containers/list-detail/index.ts +5 -0
- package/src/containers/list-detail/list-detail.tsx +157 -9
- package/src/containers/page/page.tsx +61 -7
- package/src/containers/page-header/back.tsx +42 -0
- package/src/containers/page-header/index.ts +1 -0
- package/src/containers/page-header/page-header.tsx +49 -3
- package/src/containers/pagination/cursor-pagination.tsx +79 -0
- package/src/containers/pagination/index.ts +7 -0
- package/src/containers/pagination/pagination.tsx +266 -0
- package/src/containers/pagination/range.ts +68 -0
- package/src/containers/pagination/use-pagination.ts +44 -0
- package/src/containers/responsive-list/responsive-list.tsx +183 -46
- package/src/containers/row-actions/index.ts +1 -0
- package/src/containers/row-actions/row-actions.tsx +114 -0
- package/src/containers/selectable-card/index.ts +5 -0
- package/src/containers/selectable-card/selectable-card.tsx +84 -0
- package/src/containers/settings-layout/settings-layout.tsx +104 -13
- package/src/containers/shortcuts/shortcuts.tsx +1 -1
- package/src/containers/table/cell-padding.ts +2 -0
- package/src/containers/table/index.ts +6 -0
- package/src/containers/table/sort.ts +23 -0
- package/src/containers/table/table-parts.tsx +81 -0
- package/src/containers/table/table.tsx +212 -45
- package/src/containers/table-columns-menu/index.ts +5 -0
- package/src/containers/table-columns-menu/table-columns-menu.tsx +68 -0
- package/src/dashboards/layout.tsx +8 -75
- package/src/forms/chip-group/chip-group.tsx +8 -1
- package/src/forms/combobox/combobox.tsx +1 -1
- package/src/forms/copy-field/copy-field.tsx +1 -1
- package/src/forms/date-picker/date-picker.tsx +7 -2
- package/src/forms/date-picker/date-time-picker.tsx +28 -2
- package/src/forms/field/field.tsx +30 -3
- package/src/forms/fieldset/fieldset.tsx +22 -0
- package/src/forms/fieldset/index.ts +1 -0
- package/src/forms/form-footer/form-footer.tsx +74 -0
- package/src/forms/form-footer/index.ts +1 -0
- package/src/forms/form-grid/form-grid.tsx +42 -5
- package/src/forms/form-grid/index.ts +8 -1
- package/src/forms/form-section/form-section.tsx +41 -0
- package/src/forms/form-section/index.ts +1 -0
- package/src/forms/index.ts +4 -0
- package/src/forms/input/input.tsx +12 -3
- package/src/forms/internal/listbox-items.tsx +3 -4
- package/src/forms/native-select/native-select.tsx +1 -1
- package/src/forms/password-input/index.ts +1 -0
- package/src/forms/password-input/password-input.tsx +57 -0
- package/src/forms/select/index.ts +1 -1
- package/src/forms/select/select.tsx +14 -3
- package/src/forms/select-menu/select-menu.tsx +1 -1
- package/src/forms/time-input/time-input.tsx +6 -2
- package/src/i18n/strings.ts +150 -0
- package/src/icons/eye.tsx +12 -0
- package/src/icons/graduation-cap.tsx +13 -0
- package/src/icons/house.tsx +12 -0
- package/src/icons/index.ts +4 -0
- package/src/icons/mail.tsx +12 -0
- package/src/motion/count-up.tsx +83 -0
- package/src/motion/cross-fade.tsx +139 -0
- package/src/motion/index.ts +5 -0
- package/src/motion/model.ts +86 -0
- package/src/motion/motion-styles.tsx +47 -0
- package/src/motion/reveal.tsx +115 -0
- package/src/motion/use-enter-phase.ts +50 -0
- package/src/motion/use-highlight-row.ts +63 -0
- package/src/navigation/tabs/tabs.tsx +1 -1
- package/src/navigation/wizard/wizard.tsx +6 -1
- package/src/overlays/alert-dialog/alert-dialog.tsx +5 -1
- package/src/overlays/context-menu/context-menu.tsx +3 -2
- package/src/overlays/dialog/dialog.tsx +7 -2
- package/src/overlays/drawer/drawer.tsx +68 -6
- package/src/overlays/drawer/index.ts +1 -0
- package/src/overlays/dropdown-menu/dropdown-menu.tsx +5 -4
- package/src/overlays/hover-card/hover-card.tsx +2 -0
- package/src/overlays/popover/popover.tsx +2 -0
- package/src/overlays/toaster/index.ts +2 -0
- package/src/overlays/toaster/toaster.tsx +113 -17
- package/src/overlays/tooltip/tooltip.tsx +2 -0
- package/src/primitives/use-presence.ts +13 -0
- package/src/shell/app-shell/app-shell.tsx +54 -2
- package/src/shell/index.ts +1 -0
- package/src/shell/sidebar/sidebar.tsx +154 -75
- package/src/shell/topbar/topbar.tsx +8 -0
- package/src/showcase/operations-bento.tsx +2 -2
- package/src/states/empty-state/empty-state.tsx +52 -9
- package/src/states/error-state/error-state.tsx +1 -1
- package/src/states/skeleton/skeleton.tsx +1 -1
- package/src/utils/class-tokens.generated.ts +4 -6
- package/src/utils/list-navigation.ts +63 -0
- package/src/utils/overlay-motion.ts +33 -0
- package/src/utils/use-container-width.ts +24 -0
- package/styles/Theme.kt +15 -18
- package/styles/tailwind.css +29 -28
- package/styles/theme.css +29 -28
- package/styles/tokens.css +46 -0
- package/tokens/default.json +51 -29
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type CSSProperties, type ReactNode, 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 type { ClassNames } from "../../utils/class-names.js";
|
|
8
|
+
import { cn } from "../../utils/cn.js";
|
|
9
|
+
import { useContainerWidth } from "../../utils/use-container-width.js";
|
|
10
|
+
|
|
11
|
+
export type ContextRailPart = "root" | "grid" | "main" | "rail" | "summary" | "sheet";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Container widths (px) under which the rail collapses; the set is closed so every query is a
|
|
15
|
+
* literal class. `"never"` keeps the rail beside the work area at any width and `"always"`
|
|
16
|
+
* collapses it at any width.
|
|
17
|
+
*/
|
|
18
|
+
export type ContextRailBreakpoint = 720 | 960 | 1280 | "never" | "always";
|
|
19
|
+
|
|
20
|
+
export interface ContextRailWidths {
|
|
21
|
+
/** Rail width (px) from the collapse breakpoint up. */
|
|
22
|
+
m?: number;
|
|
23
|
+
/** From 1280 px of container width. */
|
|
24
|
+
w?: number;
|
|
25
|
+
/** From 1600 px of container width. */
|
|
26
|
+
xw?: number;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ContextRailProps {
|
|
30
|
+
/** The work area. */
|
|
31
|
+
children: ReactNode;
|
|
32
|
+
/** Content of the rail. */
|
|
33
|
+
rail: ReactNode;
|
|
34
|
+
/** Rail width in px, or one width per breakpoint. Defaults to 360 / 400 / 440. */
|
|
35
|
+
width?: number | ContextRailWidths;
|
|
36
|
+
/** Distance (px) the sticky rail keeps from the top of the scroll container. Defaults to 0. */
|
|
37
|
+
stickyTop?: number;
|
|
38
|
+
/** Container width under which the rail collapses (`"never"` / `"always"` pin it). Defaults to 720. */
|
|
39
|
+
breakpoint?: ContextRailBreakpoint;
|
|
40
|
+
/**
|
|
41
|
+
* Collapsed behaviour: `"stack"` puts the rail below the work area; `"sheet"` hides it behind a
|
|
42
|
+
* `summary` bar that opens it as a bottom sheet.
|
|
43
|
+
*/
|
|
44
|
+
collapse?: "stack" | "sheet";
|
|
45
|
+
/** 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. */
|
|
46
|
+
summary?: ReactNode;
|
|
47
|
+
/** Label of the button that opens the sheet, and name of the sheet. */
|
|
48
|
+
sheetLabel?: string;
|
|
49
|
+
/** Accessible name of the rail region. */
|
|
50
|
+
railLabel?: string;
|
|
51
|
+
/** Controlled open state of the sheet. */
|
|
52
|
+
sheetOpen?: boolean;
|
|
53
|
+
onSheetOpenChange?: (open: boolean) => void;
|
|
54
|
+
className?: string;
|
|
55
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
56
|
+
classNames?: ClassNames<ContextRailPart>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const DEFAULT_WIDTHS: Required<ContextRailWidths> = { m: 360, w: 400, xw: 440 };
|
|
60
|
+
|
|
61
|
+
const collapseClasses: Record<
|
|
62
|
+
ContextRailBreakpoint,
|
|
63
|
+
{ grid: string; rail: string; bar: string; hide: string }
|
|
64
|
+
> = {
|
|
65
|
+
720: {
|
|
66
|
+
grid: "@max-[719px]/rail:grid-cols-[minmax(0,1fr)]",
|
|
67
|
+
rail: "@max-[719px]/rail:static @max-[719px]/rail:max-h-none",
|
|
68
|
+
bar: "hidden @max-[719px]/rail:block",
|
|
69
|
+
hide: "@max-[719px]/rail:hidden",
|
|
70
|
+
},
|
|
71
|
+
960: {
|
|
72
|
+
grid: "@max-[959px]/rail:grid-cols-[minmax(0,1fr)]",
|
|
73
|
+
rail: "@max-[959px]/rail:static @max-[959px]/rail:max-h-none",
|
|
74
|
+
bar: "hidden @max-[959px]/rail:block",
|
|
75
|
+
hide: "@max-[959px]/rail:hidden",
|
|
76
|
+
},
|
|
77
|
+
1280: {
|
|
78
|
+
grid: "@max-[1279px]/rail:grid-cols-[minmax(0,1fr)]",
|
|
79
|
+
rail: "@max-[1279px]/rail:static @max-[1279px]/rail:max-h-none",
|
|
80
|
+
bar: "hidden @max-[1279px]/rail:block",
|
|
81
|
+
hide: "@max-[1279px]/rail:hidden",
|
|
82
|
+
},
|
|
83
|
+
never: { grid: "", rail: "", bar: "hidden", hide: "" },
|
|
84
|
+
always: {
|
|
85
|
+
grid: "grid-cols-[minmax(0,1fr)]",
|
|
86
|
+
rail: "static max-h-none",
|
|
87
|
+
bar: "block",
|
|
88
|
+
hide: "hidden",
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
/** Whether the rail is collapsed for a measured container width (`null` before the first measurement). */
|
|
93
|
+
export function isRailCollapsed(breakpoint: ContextRailBreakpoint, width: number | null): boolean {
|
|
94
|
+
if (breakpoint === "always") return true;
|
|
95
|
+
if (breakpoint === "never") return false;
|
|
96
|
+
return width !== null && width < breakpoint;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function resolveRailWidths(width: number | ContextRailWidths | undefined) {
|
|
100
|
+
if (typeof width === "number") return { m: width, w: width, xw: width };
|
|
101
|
+
return { ...DEFAULT_WIDTHS, ...width };
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Work area with a persistent side rail (cart, payment, selected table). The rail sticks to the
|
|
106
|
+
* top of the scroll container with its own scroll, and its width grows with the container.
|
|
107
|
+
* Under `breakpoint` it stacks below the work area, or with `collapse="sheet"` it leaves the page
|
|
108
|
+
* for a bottom sheet opened from the `summary` bar. `breakpoint="never"` keeps it beside the work
|
|
109
|
+
* area at any width, `"always"` collapses it at any width. Widths and cuts follow the container
|
|
110
|
+
* (`@container/rail`), not the viewport.
|
|
111
|
+
*/
|
|
112
|
+
export function ContextRail({
|
|
113
|
+
children,
|
|
114
|
+
rail,
|
|
115
|
+
width,
|
|
116
|
+
stickyTop = 0,
|
|
117
|
+
breakpoint = 720,
|
|
118
|
+
collapse = "stack",
|
|
119
|
+
summary,
|
|
120
|
+
sheetLabel,
|
|
121
|
+
railLabel,
|
|
122
|
+
sheetOpen: sheetOpenProp,
|
|
123
|
+
onSheetOpenChange,
|
|
124
|
+
className,
|
|
125
|
+
classNames,
|
|
126
|
+
}: ContextRailProps) {
|
|
127
|
+
const strings = useUiStrings();
|
|
128
|
+
const rootRef = useRef<HTMLDivElement>(null);
|
|
129
|
+
const measured = useContainerWidth(rootRef);
|
|
130
|
+
const collapsed = isRailCollapsed(breakpoint, measured);
|
|
131
|
+
const [openState, setOpenState] = useState(false);
|
|
132
|
+
const controlled = sheetOpenProp !== undefined;
|
|
133
|
+
const open = (controlled ? sheetOpenProp : openState) && collapsed;
|
|
134
|
+
const setOpen = (next: boolean) => {
|
|
135
|
+
if (!controlled) setOpenState(next);
|
|
136
|
+
onSheetOpenChange?.(next);
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
const widths = resolveRailWidths(width);
|
|
140
|
+
const classes = collapseClasses[breakpoint];
|
|
141
|
+
const sheet = collapse === "sheet";
|
|
142
|
+
const label = sheetLabel ?? railLabel;
|
|
143
|
+
|
|
144
|
+
const style = {
|
|
145
|
+
"--rail-m": `${widths.m}px`,
|
|
146
|
+
"--rail-w": `${widths.w}px`,
|
|
147
|
+
"--rail-xw": `${widths.xw}px`,
|
|
148
|
+
"--rail-top": `${stickyTop}px`,
|
|
149
|
+
} as CSSProperties;
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<div
|
|
153
|
+
ref={rootRef}
|
|
154
|
+
data-collapsed={collapsed ? "" : undefined}
|
|
155
|
+
style={style}
|
|
156
|
+
className={cn("@container/rail min-w-0", classNames?.root, className)}
|
|
157
|
+
>
|
|
158
|
+
<div
|
|
159
|
+
className={cn(
|
|
160
|
+
"grid items-start gap-4 [--rail:var(--rail-m)] @min-[1280px]/rail:[--rail:var(--rail-w)] @min-[1600px]/rail:[--rail:var(--rail-xw)]",
|
|
161
|
+
breakpoint === "always" ? undefined : "grid-cols-[minmax(0,1fr)_var(--rail)]",
|
|
162
|
+
classes.grid,
|
|
163
|
+
classNames?.grid,
|
|
164
|
+
)}
|
|
165
|
+
>
|
|
166
|
+
<div className={cn("min-w-0", classNames?.main)}>{children}</div>
|
|
167
|
+
<aside
|
|
168
|
+
aria-label={railLabel}
|
|
169
|
+
className={cn(
|
|
170
|
+
"sticky top-(--rail-top) min-w-0 max-h-[calc(100dvh-var(--rail-top))] overflow-y-auto overscroll-contain",
|
|
171
|
+
classes.rail,
|
|
172
|
+
sheet && classes.hide,
|
|
173
|
+
classNames?.rail,
|
|
174
|
+
)}
|
|
175
|
+
>
|
|
176
|
+
{sheet && collapsed ? null : rail}
|
|
177
|
+
</aside>
|
|
178
|
+
</div>
|
|
179
|
+
{sheet && summary != null ? (
|
|
180
|
+
<div
|
|
181
|
+
className={cn(
|
|
182
|
+
"sticky bottom-(--app-bottom-bar,0px) z-10 border-t-divider surface-card p-density",
|
|
183
|
+
classes.bar,
|
|
184
|
+
classNames?.summary,
|
|
185
|
+
)}
|
|
186
|
+
>
|
|
187
|
+
<div className="flex items-center justify-between gap-3">
|
|
188
|
+
<div className="min-w-0 flex-1">{summary}</div>
|
|
189
|
+
<button
|
|
190
|
+
type="button"
|
|
191
|
+
aria-haspopup="dialog"
|
|
192
|
+
aria-expanded={open}
|
|
193
|
+
onClick={() => setOpen(true)}
|
|
194
|
+
className="shrink-0 rounded-button px-3 py-2 font-semibold text-accent-ink text-body focus-visible:focus-ring"
|
|
195
|
+
>
|
|
196
|
+
{label ?? strings.actions}
|
|
197
|
+
</button>
|
|
198
|
+
</div>
|
|
199
|
+
</div>
|
|
200
|
+
) : null}
|
|
201
|
+
{sheet ? (
|
|
202
|
+
<DialogPrimitive.Root open={open} onOpenChange={setOpen}>
|
|
203
|
+
<DialogPrimitive.Portal>
|
|
204
|
+
<DialogPrimitive.Overlay className="fixed inset-0 z-70 bg-scrim" />
|
|
205
|
+
<DialogPrimitive.Content
|
|
206
|
+
className={cn(
|
|
207
|
+
"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",
|
|
208
|
+
classNames?.sheet,
|
|
209
|
+
)}
|
|
210
|
+
>
|
|
211
|
+
<div className="mb-2 flex items-center justify-between gap-3">
|
|
212
|
+
<DialogPrimitive.Title className="m-0 font-semibold text-card-title text-ink">
|
|
213
|
+
{label ?? strings.actions}
|
|
214
|
+
</DialogPrimitive.Title>
|
|
215
|
+
<DialogPrimitive.Close
|
|
216
|
+
aria-label={strings.close}
|
|
217
|
+
className="rounded-event p-1 text-ink-3 hover:text-ink focus-visible:focus-ring"
|
|
218
|
+
>
|
|
219
|
+
<X aria-hidden="true" className="size-4" />
|
|
220
|
+
</DialogPrimitive.Close>
|
|
221
|
+
</div>
|
|
222
|
+
{rail}
|
|
223
|
+
</DialogPrimitive.Content>
|
|
224
|
+
</DialogPrimitive.Portal>
|
|
225
|
+
</DialogPrimitive.Root>
|
|
226
|
+
) : null}
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode, useId } from "react";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
import { Card, CardBody, CardHeader } from "../card/card.js";
|
|
4
|
+
|
|
5
|
+
export type DashboardPageProps = ComponentPropsWithoutRef<"div">;
|
|
6
|
+
|
|
7
|
+
/** Vertical rhythm of a dashboard page. Put it inside `Page` so the `page` container query applies. */
|
|
8
|
+
export function DashboardPage({ className, ...props }: DashboardPageProps) {
|
|
9
|
+
return <div className={cn("flex min-w-0 flex-col gap-4", className)} {...props} />;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface KpiRowProps extends ComponentPropsWithoutRef<"div"> {
|
|
13
|
+
/** Accessible name of the group of figures, e.g. "Key figures". */
|
|
14
|
+
"aria-label"?: string;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Joined KPI tiles: two per row when narrow, four from 720 px of `page` container width. It is a
|
|
19
|
+
* named `group`, so give it an `aria-label` when the tiles are not introduced by a heading.
|
|
20
|
+
*/
|
|
21
|
+
export function KpiRow({ className, ...props }: KpiRowProps) {
|
|
22
|
+
return (
|
|
23
|
+
// biome-ignore lint/a11y/useSemanticElements: a fieldset would add form semantics and default chrome to a grid of figures
|
|
24
|
+
<div
|
|
25
|
+
role="group"
|
|
26
|
+
className={cn(
|
|
27
|
+
"grid grid-cols-2 gap-px overflow-hidden rounded-card border-card bg-line shadow-card @min-[720px]/page:grid-cols-4",
|
|
28
|
+
className,
|
|
29
|
+
)}
|
|
30
|
+
{...props}
|
|
31
|
+
/>
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const gridClasses = {
|
|
36
|
+
2: "grid-cols-1 @min-[720px]/page:grid-cols-2",
|
|
37
|
+
3: "grid-cols-1 @min-[720px]/page:grid-cols-2 @min-[1180px]/page:grid-cols-3",
|
|
38
|
+
} as const;
|
|
39
|
+
|
|
40
|
+
export interface CardGridProps extends ComponentPropsWithoutRef<"div"> {
|
|
41
|
+
/** Columns at the widest container: 2 (from 720 px) or 3 (2 from 720 px, 3 from 1180 px). Default 2. */
|
|
42
|
+
columns?: 2 | 3;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** Equal cards that stack under 720 px of `page` container width. */
|
|
46
|
+
export function CardGrid({ columns = 2, className, ...props }: CardGridProps) {
|
|
47
|
+
return (
|
|
48
|
+
<div className={cn("grid items-start gap-4", gridClasses[columns], className)} {...props} />
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface DashboardCardProps {
|
|
53
|
+
title: string;
|
|
54
|
+
subtitle?: string;
|
|
55
|
+
/** Slot at the end of the header (a chip, a button). */
|
|
56
|
+
aside?: ReactNode;
|
|
57
|
+
/** Heading level of the title; the card is a named `region`. Default 2. */
|
|
58
|
+
headingLevel?: 2 | 3 | 4;
|
|
59
|
+
className?: string;
|
|
60
|
+
children: ReactNode;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export interface ChartCardProps extends DashboardCardProps {
|
|
64
|
+
/** Fixed height of the body in px; the chart inside uses `height="fill"`. Default 300. */
|
|
65
|
+
height?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function CardTitle({
|
|
69
|
+
id,
|
|
70
|
+
title,
|
|
71
|
+
subtitle,
|
|
72
|
+
level,
|
|
73
|
+
}: {
|
|
74
|
+
id: string;
|
|
75
|
+
title: string;
|
|
76
|
+
subtitle: string | undefined;
|
|
77
|
+
level: 2 | 3 | 4;
|
|
78
|
+
}) {
|
|
79
|
+
const Heading = `h${level}` as const;
|
|
80
|
+
return (
|
|
81
|
+
<div className="min-w-0 flex-1">
|
|
82
|
+
<Heading id={id} className="m-0 break-words font-semibold text-fs-140 text-ink">
|
|
83
|
+
{title}
|
|
84
|
+
</Heading>
|
|
85
|
+
{subtitle ? <p className="m-0 break-words text-fs-120 text-ink-3">{subtitle}</p> : null}
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Card with a fixed-height body so `height="fill"` charts take exactly the space left. It is a
|
|
92
|
+
* `region` named by its title.
|
|
93
|
+
*/
|
|
94
|
+
export function ChartCard({
|
|
95
|
+
title,
|
|
96
|
+
subtitle,
|
|
97
|
+
aside,
|
|
98
|
+
height = 300,
|
|
99
|
+
headingLevel = 2,
|
|
100
|
+
className,
|
|
101
|
+
children,
|
|
102
|
+
}: ChartCardProps) {
|
|
103
|
+
const titleId = useId();
|
|
104
|
+
return (
|
|
105
|
+
<section aria-labelledby={titleId} className={cn("min-w-0", className)}>
|
|
106
|
+
<Card>
|
|
107
|
+
<CardHeader>
|
|
108
|
+
<CardTitle id={titleId} title={title} subtitle={subtitle} level={headingLevel} />
|
|
109
|
+
{aside}
|
|
110
|
+
</CardHeader>
|
|
111
|
+
<CardBody>
|
|
112
|
+
<div className="min-w-0" style={{ height }}>
|
|
113
|
+
{children}
|
|
114
|
+
</div>
|
|
115
|
+
</CardBody>
|
|
116
|
+
</Card>
|
|
117
|
+
</section>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/** Card whose body is a table or grid that scrolls inside its own wrapper. A `region` named by its title. */
|
|
122
|
+
export function TableCard({
|
|
123
|
+
title,
|
|
124
|
+
subtitle,
|
|
125
|
+
aside,
|
|
126
|
+
headingLevel = 2,
|
|
127
|
+
className,
|
|
128
|
+
children,
|
|
129
|
+
}: DashboardCardProps) {
|
|
130
|
+
const titleId = useId();
|
|
131
|
+
return (
|
|
132
|
+
<section aria-labelledby={titleId} className={cn("min-w-0", className)}>
|
|
133
|
+
<Card>
|
|
134
|
+
<CardHeader>
|
|
135
|
+
<CardTitle id={titleId} title={title} subtitle={subtitle} level={headingLevel} />
|
|
136
|
+
{aside}
|
|
137
|
+
</CardHeader>
|
|
138
|
+
<div className="min-w-0">{children}</div>
|
|
139
|
+
</Card>
|
|
140
|
+
</section>
|
|
141
|
+
);
|
|
142
|
+
}
|
|
@@ -30,7 +30,7 @@ export type DemoControls = Pick<
|
|
|
30
30
|
"density" | "selectable" | "loading" | "hideToolbar" | "height"
|
|
31
31
|
>;
|
|
32
32
|
|
|
33
|
-
const note = "text-fs-
|
|
33
|
+
const note = "text-fs-120 text-ink-3";
|
|
34
34
|
|
|
35
35
|
function Stack({ children }: { children: ReactNode }) {
|
|
36
36
|
return <div className="grid gap-2">{children}</div>;
|
|
@@ -231,7 +231,7 @@ function PersistenceGrid({ density, height, onReset }: DemoControls & { onReset:
|
|
|
231
231
|
<button
|
|
232
232
|
type="button"
|
|
233
233
|
onClick={reset}
|
|
234
|
-
className="inline-flex h-control-sm items-center rounded-control border-divider bg-surface-control px-2.5 font-[600] text-fs-
|
|
234
|
+
className="inline-flex h-control-sm items-center rounded-control border-divider bg-surface-control px-2.5 font-[600] text-fs-120 text-ink-2 hover:border-line-strong hover:text-ink"
|
|
235
235
|
>
|
|
236
236
|
Restablecer todo
|
|
237
237
|
</button>
|
|
@@ -308,7 +308,7 @@ export function KeyboardDemo({ density }: DemoControls) {
|
|
|
308
308
|
<p className="text-fs-130 text-ink" aria-live="polite">
|
|
309
309
|
Celda activa: <b className="font-[650]">{where}</b>
|
|
310
310
|
</p>
|
|
311
|
-
<table className="w-full border-collapse text-left text-fs-
|
|
311
|
+
<table className="w-full border-collapse text-left text-fs-120">
|
|
312
312
|
<caption className="sr-only">Atajos de teclado</caption>
|
|
313
313
|
<tbody>
|
|
314
314
|
{SHORTCUTS.map(([keys, action]) => (
|
|
@@ -487,7 +487,7 @@ export function FilterBuilderDemo({ density, height }: DemoControls) {
|
|
|
487
487
|
return column ? distinctValues(ventas, column) : [];
|
|
488
488
|
}}
|
|
489
489
|
/>
|
|
490
|
-
<p className="mt-3 border-t-divider pt-2 text-fs-
|
|
490
|
+
<p className="mt-3 border-t-divider pt-2 text-fs-120 text-ink-3">
|
|
491
491
|
{text ? `Filtro: ${text}` : "Sin filtro activo."}{" "}
|
|
492
492
|
<button
|
|
493
493
|
type="button"
|
|
@@ -3080,7 +3080,7 @@ export function DataGrid<T>({
|
|
|
3080
3080
|
<span className="min-w-0 flex-1">{labels.loadError}</span>
|
|
3081
3081
|
<button
|
|
3082
3082
|
type="button"
|
|
3083
|
-
className="rounded-control border border-danger px-2.5 py-1 font-[600] text-fs-
|
|
3083
|
+
className="rounded-control border border-danger px-2.5 py-1 font-[600] text-fs-120 hover:bg-surface"
|
|
3084
3084
|
onClick={remote.retry}
|
|
3085
3085
|
>
|
|
3086
3086
|
{labels.retry}
|
|
@@ -3183,7 +3183,7 @@ export function DataGrid<T>({
|
|
|
3183
3183
|
{sourceActive && remote.failed ? (
|
|
3184
3184
|
<button
|
|
3185
3185
|
type="button"
|
|
3186
|
-
className="rounded-control border-divider px-2.5 py-1 font-[600] text-fs-
|
|
3186
|
+
className="rounded-control border-divider px-2.5 py-1 font-[600] text-fs-120 text-ink-2 hover:text-ink"
|
|
3187
3187
|
onClick={remote.retry}
|
|
3188
3188
|
>
|
|
3189
3189
|
{labels.retry}
|
|
@@ -3191,7 +3191,7 @@ export function DataGrid<T>({
|
|
|
3191
3191
|
) : emptyFiltered ? (
|
|
3192
3192
|
<button
|
|
3193
3193
|
type="button"
|
|
3194
|
-
className="rounded-control border-divider px-2.5 py-1 font-[600] text-fs-
|
|
3194
|
+
className="rounded-control border-divider px-2.5 py-1 font-[600] text-fs-120 text-ink-2 hover:text-ink"
|
|
3195
3195
|
onClick={() => {
|
|
3196
3196
|
setFiltersState({});
|
|
3197
3197
|
setSearch("");
|
|
@@ -3230,7 +3230,7 @@ export function DataGrid<T>({
|
|
|
3230
3230
|
</div>
|
|
3231
3231
|
</div>
|
|
3232
3232
|
{rangeSelection ? (
|
|
3233
|
-
<div className="flex flex-wrap items-center gap-x-4 gap-y-1 border-t-divider px-3 py-1.5 text-fs-
|
|
3233
|
+
<div className="flex flex-wrap items-center gap-x-4 gap-y-1 border-t-divider px-3 py-1.5 text-fs-120 text-ink-2">
|
|
3234
3234
|
{stats && cellRange ? (
|
|
3235
3235
|
<>
|
|
3236
3236
|
<span className="font-[650] text-ink">{labels.rangeCells(rangeCellCount)}</span>
|
|
@@ -3355,14 +3355,14 @@ function Pagination({
|
|
|
3355
3355
|
return (
|
|
3356
3356
|
<nav
|
|
3357
3357
|
aria-label={labels.rowsPerPage}
|
|
3358
|
-
className="flex flex-wrap items-center justify-end gap-x-3 gap-y-1 border-t-divider px-2 py-1.5 text-fs-
|
|
3358
|
+
className="flex flex-wrap items-center justify-end gap-x-3 gap-y-1 border-t-divider px-2 py-1.5 text-fs-120 text-ink-2"
|
|
3359
3359
|
>
|
|
3360
3360
|
<label className="flex items-center gap-2">
|
|
3361
3361
|
<span>{labels.rowsPerPage}</span>
|
|
3362
3362
|
<select
|
|
3363
3363
|
value={pageSize}
|
|
3364
3364
|
onChange={(event) => onPageSize(Number(event.target.value))}
|
|
3365
|
-
className="h-control-sm rounded-input border-control bg-surface-control px-1.5 text-fs-
|
|
3365
|
+
className="h-control-sm rounded-input border-control bg-surface-control px-1.5 text-fs-120 text-ink"
|
|
3366
3366
|
>
|
|
3367
3367
|
{[...new Set([...options, pageSize])]
|
|
3368
3368
|
.sort((a, b) => a - b)
|
|
@@ -32,7 +32,7 @@ export interface FilterBuilderProps<T> {
|
|
|
32
32
|
const fieldClass =
|
|
33
33
|
"h-control-sm w-full min-w-0 rounded-input border-control bg-surface-control px-2 text-fs-130 text-ink placeholder:text-ink-3 focus-visible:border-accent focus-visible:outline-none";
|
|
34
34
|
const buttonClass =
|
|
35
|
-
"inline-flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-control border-divider bg-surface-control px-2.5 font-[600] text-fs-
|
|
35
|
+
"inline-flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-control border-divider bg-surface-control px-2.5 font-[600] text-fs-120 text-ink-2 hover:border-line-strong hover:text-ink [&_svg]:size-3.5";
|
|
36
36
|
|
|
37
37
|
/**
|
|
38
38
|
* Builds a filter of nested AND / OR groups of conditions (column, operator, value). It is a
|
|
@@ -136,7 +136,7 @@ function GroupEditor<T>({
|
|
|
136
136
|
)}
|
|
137
137
|
</div>
|
|
138
138
|
{group.children.length === 0 ? (
|
|
139
|
-
<p className="px-1 text-fs-
|
|
139
|
+
<p className="px-1 text-fs-120 text-ink-3">{labels.noConditions}</p>
|
|
140
140
|
) : (
|
|
141
141
|
<ul className="grid gap-2">
|
|
142
142
|
{group.children.map((child, index) => (
|
|
@@ -22,7 +22,7 @@ import type { DataGridColumn, Density } from "./types.js";
|
|
|
22
22
|
const DENSITIES: Density[] = ["compact", "normal", "comfortable"];
|
|
23
23
|
|
|
24
24
|
const buttonClass =
|
|
25
|
-
"inline-flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-control border-divider bg-surface-control px-2.5 font-[600] text-fs-
|
|
25
|
+
"inline-flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-control border-divider bg-surface-control px-2.5 font-[600] text-fs-120 text-ink-2 hover:border-line-strong hover:text-ink [&_svg]:size-3.5";
|
|
26
26
|
|
|
27
27
|
export interface GridToolbarProps<T> {
|
|
28
28
|
labels: DataGridLabels;
|
|
@@ -13,7 +13,7 @@ import type { CellValue, DataGridColumn } from "./types.js";
|
|
|
13
13
|
|
|
14
14
|
export type SheetControls = Pick<DataGridProps<Venta>, "density" | "height">;
|
|
15
15
|
|
|
16
|
-
export const note = "text-fs-
|
|
16
|
+
export const note = "text-fs-120 text-ink-3";
|
|
17
17
|
|
|
18
18
|
export function Stack({ children }: { children: ReactNode }) {
|
|
19
19
|
return <div className="grid gap-2">{children}</div>;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
|
|
4
|
+
export type DetailHeaderLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
5
|
+
|
|
6
|
+
export interface DetailHeaderProps extends Omit<ComponentPropsWithoutRef<"header">, "title"> {
|
|
7
|
+
/** The record's name: the heading of the header. */
|
|
8
|
+
name: ReactNode;
|
|
9
|
+
/** Picture slot before the name, usually an `Avatar` (pass `className="size-14"` for a larger one). */
|
|
10
|
+
avatar?: ReactNode;
|
|
11
|
+
/** Line under the name: a role, a code, a relationship. */
|
|
12
|
+
subtitle?: ReactNode;
|
|
13
|
+
/** Status next to the name: a `Chip` or `StatusPill`. Wraps under the name when narrow. */
|
|
14
|
+
status?: ReactNode;
|
|
15
|
+
/** Key facts row under the header, usually a `Facts` list. */
|
|
16
|
+
facts?: ReactNode;
|
|
17
|
+
/** Buttons for the record. They wrap under the name when the header's own width is 480px or less. */
|
|
18
|
+
actions?: ReactNode;
|
|
19
|
+
/** Level of the name heading. Defaults to `2`, the level under the page's `h1`. */
|
|
20
|
+
headingLevel?: DetailHeaderLevel;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Header of a record screen (an applicant, a person, a student): picture, name, status, facts and
|
|
25
|
+
* actions in one block. It is the record's heading, not the page's: keep the page title in
|
|
26
|
+
* `PageHeader` and put this under it, or let it be the first thing of a detail pane.
|
|
27
|
+
*/
|
|
28
|
+
export function DetailHeader({
|
|
29
|
+
name,
|
|
30
|
+
avatar,
|
|
31
|
+
subtitle,
|
|
32
|
+
status,
|
|
33
|
+
facts,
|
|
34
|
+
actions,
|
|
35
|
+
headingLevel = 2,
|
|
36
|
+
className,
|
|
37
|
+
...props
|
|
38
|
+
}: DetailHeaderProps) {
|
|
39
|
+
const Heading = `h${headingLevel}` as const;
|
|
40
|
+
return (
|
|
41
|
+
<header className={cn("@container/detail-header flex min-w-0 flex-col", className)} {...props}>
|
|
42
|
+
<div className="flex flex-wrap items-start gap-x-4 gap-y-3">
|
|
43
|
+
{avatar !== undefined ? <div className="shrink-0">{avatar}</div> : null}
|
|
44
|
+
<div className="min-w-0 flex-1 basis-56">
|
|
45
|
+
<div className="flex flex-wrap items-center gap-x-2.5 gap-y-1">
|
|
46
|
+
<Heading className="m-0 min-w-0 break-words font-semibold text-fs-200 text-ink [text-wrap:balance]">
|
|
47
|
+
{name}
|
|
48
|
+
</Heading>
|
|
49
|
+
{status}
|
|
50
|
+
</div>
|
|
51
|
+
{subtitle !== undefined ? (
|
|
52
|
+
<p className="m-0 mt-0.5 break-words text-ink-3 text-meta">{subtitle}</p>
|
|
53
|
+
) : null}
|
|
54
|
+
</div>
|
|
55
|
+
{actions !== undefined ? (
|
|
56
|
+
<div className="flex flex-wrap items-center gap-2 @max-[480px]/detail-header:basis-full">
|
|
57
|
+
{actions}
|
|
58
|
+
</div>
|
|
59
|
+
) : null}
|
|
60
|
+
</div>
|
|
61
|
+
{facts}
|
|
62
|
+
</header>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
@@ -14,7 +14,7 @@ export function Facts({ className, ...props }: FactsProps) {
|
|
|
14
14
|
<dl
|
|
15
15
|
className={cn(
|
|
16
16
|
"mt-3.5 grid grid-cols-3 gap-3.5 border-t-divider border-dashed pt-3.5",
|
|
17
|
-
"[&_dt]:font-semibold [&_dt]:text-fs-
|
|
17
|
+
"[&_dt]:font-semibold [&_dt]:text-fs-120 [&_dt]:text-ink-3",
|
|
18
18
|
"[&_dd]:mt-0.5 [&_dd]:font-[620] [&_dd]:text-fs-130",
|
|
19
19
|
"[&_dt]:break-words [&_dd]:break-words @max-[560px]/facts:grid-cols-1",
|
|
20
20
|
className,
|