@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
|
@@ -1,17 +1,38 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
3
|
import { type KanbanCardData, type KanbanColumnData, type KanbanMove } from "./model.js";
|
|
4
|
-
export type KanbanPart = "root" | "board" | "column" | "columnHeader" | "columnTitle" | "count" | "cards" | "card" | "grip" | "empty" | "indicator" | "ghost";
|
|
4
|
+
export type KanbanPart = "root" | "board" | "column" | "columnHeader" | "columnTitle" | "count" | "cards" | "card" | "grip" | "actions" | "empty" | "indicator" | "ghost";
|
|
5
5
|
export interface KanbanProps {
|
|
6
6
|
/** Controlled board. Pair with `onColumnsChange`. */
|
|
7
7
|
columns?: KanbanColumnData[];
|
|
8
8
|
defaultColumns?: KanbanColumnData[];
|
|
9
9
|
/** Called after a drop (pointer release or keyboard drop) with the new board and the move. */
|
|
10
10
|
onColumnsChange?: (columns: KanbanColumnData[], move: KanbanMove) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Set to `false` for a board that only displays: no drag handle, no pointer or keyboard
|
|
13
|
+
* pick-up, and cards are plain content (with `cardActions` still rendered). Defaults to `true`.
|
|
14
|
+
*/
|
|
15
|
+
draggable?: boolean;
|
|
11
16
|
/** Refuse drops into another column that already reached its WIP limit. */
|
|
12
17
|
enforceLimit?: boolean;
|
|
13
18
|
/** Replaces the default card body. */
|
|
14
19
|
renderCard?: (card: KanbanCardData) => ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Buttons shown under each card. When set, the card is no longer one `role="button"`: its body
|
|
22
|
+
* is plain content, the actions are real, separately focusable controls, and keyboard
|
|
23
|
+
* pick-up moves to a grip button. Without it the card keeps the single-button behaviour.
|
|
24
|
+
*/
|
|
25
|
+
cardActions?: (card: KanbanCardData) => ReactNode;
|
|
26
|
+
/** Accessible name of the grip button when `cardActions` is set; defaults to "Mover tarjeta: <title>". */
|
|
27
|
+
gripLabel?: (card: KanbanCardData) => string;
|
|
28
|
+
/**
|
|
29
|
+
* Lays the cards of a lane out as a responsive grid once the lane is 30rem (480 px) wide,
|
|
30
|
+
* with columns of at least `cardGridMinWidth`; a narrower lane stays a single column. Dropping with the pointer
|
|
31
|
+
* follows reading order; arrow keys still move a held card one place up or down the lane.
|
|
32
|
+
*/
|
|
33
|
+
cardGrid?: boolean;
|
|
34
|
+
/** Minimum card width (px) of the grid lane. Defaults to 224. */
|
|
35
|
+
cardGridMinWidth?: number;
|
|
15
36
|
emptyLabel?: string;
|
|
16
37
|
"aria-label"?: string;
|
|
17
38
|
className?: string;
|
|
@@ -23,4 +44,4 @@ export interface KanbanProps {
|
|
|
23
44
|
* grip). Keyboard: Space or Enter picks a card up, arrows move it, Space or Enter drops it,
|
|
24
45
|
* Escape cancels. Moves are announced in a live region.
|
|
25
46
|
*/
|
|
26
|
-
export declare function Kanban({ columns: controlled, defaultColumns, onColumnsChange, enforceLimit, renderCard, emptyLabel, className, classNames, "aria-label": ariaLabel, }: KanbanProps): import("react").JSX.Element;
|
|
47
|
+
export declare function Kanban({ columns: controlled, defaultColumns, onColumnsChange, draggable, enforceLimit, renderCard, cardActions, gripLabel, cardGrid, cardGridMinWidth, emptyLabel, className, classNames, "aria-label": ariaLabel, }: KanbanProps): import("react").JSX.Element;
|
|
@@ -13,6 +13,7 @@ import { GripVertical } from "../../icons/index.js";
|
|
|
13
13
|
import { cn } from "../../utils/cn.js";
|
|
14
14
|
import {
|
|
15
15
|
dropIndex,
|
|
16
|
+
dropIndexGrid,
|
|
16
17
|
keyboardTarget,
|
|
17
18
|
locateCard,
|
|
18
19
|
moveCard,
|
|
@@ -35,8 +36,13 @@ function Kanban({
|
|
|
35
36
|
columns: controlled,
|
|
36
37
|
defaultColumns = [],
|
|
37
38
|
onColumnsChange,
|
|
39
|
+
draggable = true,
|
|
38
40
|
enforceLimit = false,
|
|
39
41
|
renderCard,
|
|
42
|
+
cardActions,
|
|
43
|
+
gripLabel = (card) => `Mover tarjeta: ${card.title}`,
|
|
44
|
+
cardGrid = false,
|
|
45
|
+
cardGridMinWidth = 224,
|
|
40
46
|
emptyLabel = "Sin tarjetas",
|
|
41
47
|
className,
|
|
42
48
|
classNames,
|
|
@@ -64,7 +70,8 @@ function Kanban({
|
|
|
64
70
|
useLayoutEffect(() => {
|
|
65
71
|
const id = focusId.current;
|
|
66
72
|
if (!id) return;
|
|
67
|
-
const
|
|
73
|
+
const card = rootRef.current?.querySelector(`[data-card-id="${CSS.escape(id)}"]`);
|
|
74
|
+
const el = card?.querySelector("[data-card-grip]") ?? card;
|
|
68
75
|
if (el && document.activeElement !== el) el.focus();
|
|
69
76
|
if (!grabbedId) focusId.current = null;
|
|
70
77
|
});
|
|
@@ -120,6 +127,7 @@ function Kanban({
|
|
|
120
127
|
};
|
|
121
128
|
const startPointerDrag = (event, card) => {
|
|
122
129
|
if (event.button !== 0 || grabbedId) return;
|
|
130
|
+
if (event.target.closest("[data-card-actions]")) return;
|
|
123
131
|
if (event.pointerType === "touch" && !event.target.closest("[data-grip]")) {
|
|
124
132
|
return;
|
|
125
133
|
}
|
|
@@ -133,7 +141,14 @@ function Kanban({
|
|
|
133
141
|
const column = document.elementFromPoint(x, y)?.closest("[data-column-id]");
|
|
134
142
|
const columnId = column?.dataset.columnId;
|
|
135
143
|
if (!column || !columnId) return null;
|
|
136
|
-
const
|
|
144
|
+
const others = Array.from(column.querySelectorAll("[data-card-id]")).filter(
|
|
145
|
+
(el) => el.dataset.cardId !== card.id
|
|
146
|
+
);
|
|
147
|
+
if (column.hasAttribute("data-card-grid")) {
|
|
148
|
+
const rects = others.map((el) => el.getBoundingClientRect());
|
|
149
|
+
return { columnId, index: dropIndexGrid(rects, x, y) };
|
|
150
|
+
}
|
|
151
|
+
const mids = others.map((el) => {
|
|
137
152
|
const r = el.getBoundingClientRect();
|
|
138
153
|
return r.top + r.height / 2;
|
|
139
154
|
});
|
|
@@ -202,7 +217,7 @@ function Kanban({
|
|
|
202
217
|
}
|
|
203
218
|
},
|
|
204
219
|
children: [
|
|
205
|
-
/* @__PURE__ */ jsx("p", { id: instructionsId, className: "sr-only", children: "Presiona Espacio para tomar una tarjeta, las flechas para moverla y Espacio para soltarla. Escape cancela." }),
|
|
220
|
+
draggable ? /* @__PURE__ */ jsx("p", { id: instructionsId, className: "sr-only", children: "Presiona Espacio para tomar una tarjeta, las flechas para moverla y Espacio para soltarla. Escape cancela." }) : null,
|
|
206
221
|
/* @__PURE__ */ jsx("div", { role: "status", "aria-live": "assertive", className: "sr-only", children: status }),
|
|
207
222
|
/* @__PURE__ */ jsx(
|
|
208
223
|
"div",
|
|
@@ -235,39 +250,101 @@ function Kanban({
|
|
|
235
250
|
}
|
|
236
251
|
const grabbed = grabbedId === card.id;
|
|
237
252
|
items.push(
|
|
238
|
-
/* @__PURE__ */ jsx("li", { className: "min-w-0", children: /* @__PURE__ */ jsxs(
|
|
253
|
+
/* @__PURE__ */ jsx("li", { className: "min-w-0", children: cardActions ? /* @__PURE__ */ jsxs(
|
|
239
254
|
"div",
|
|
240
255
|
{
|
|
241
|
-
role: "button",
|
|
242
|
-
tabIndex: 0,
|
|
243
256
|
"data-card-id": card.id,
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
onKeyDown: (e) => onCardKeyDown(e, card),
|
|
248
|
-
onPointerDown: (e) => startPointerDrag(e, card),
|
|
257
|
+
onPointerDown: (e) => {
|
|
258
|
+
if (draggable) startPointerDrag(e, card);
|
|
259
|
+
},
|
|
249
260
|
className: cn(
|
|
250
|
-
"
|
|
261
|
+
"relative flex flex-col gap-density-sm rounded-input border-card surface-card p-density shadow-card",
|
|
262
|
+
draggable && "cursor-grab select-none",
|
|
251
263
|
isDragged && "opacity-40",
|
|
252
264
|
grabbed && "shadow-selected",
|
|
253
265
|
classNames?.card
|
|
254
266
|
),
|
|
255
267
|
children: [
|
|
268
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-1", children: [
|
|
269
|
+
draggable ? /* @__PURE__ */ jsx(
|
|
270
|
+
"button",
|
|
271
|
+
{
|
|
272
|
+
type: "button",
|
|
273
|
+
"data-card-grip": "",
|
|
274
|
+
"data-grip": "",
|
|
275
|
+
"aria-label": gripLabel(card),
|
|
276
|
+
"aria-pressed": grabbed,
|
|
277
|
+
"aria-roledescription": "tarjeta arrastrable",
|
|
278
|
+
"aria-describedby": instructionsId,
|
|
279
|
+
onKeyDown: (e) => onCardKeyDown(e, card),
|
|
280
|
+
className: cn(
|
|
281
|
+
"-ml-1 flex min-h-8 w-6 shrink-0 touch-none items-start justify-center rounded-control pt-0.5 text-ink-3 focus-visible:focus-ring",
|
|
282
|
+
classNames?.grip
|
|
283
|
+
),
|
|
284
|
+
children: /* @__PURE__ */ jsx(GripVertical, { "aria-hidden": "true", className: "size-4" })
|
|
285
|
+
}
|
|
286
|
+
) : null,
|
|
287
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: renderCard ? renderCard(card) : /* @__PURE__ */ jsx(DefaultCard, { card }) })
|
|
288
|
+
] }),
|
|
256
289
|
/* @__PURE__ */ jsx(
|
|
257
|
-
"
|
|
290
|
+
"div",
|
|
258
291
|
{
|
|
259
|
-
"data-
|
|
260
|
-
"aria-hidden": "true",
|
|
292
|
+
"data-card-actions": "",
|
|
261
293
|
className: cn(
|
|
262
|
-
"
|
|
263
|
-
classNames?.
|
|
294
|
+
"flex cursor-auto flex-wrap items-center gap-density-sm",
|
|
295
|
+
classNames?.actions
|
|
264
296
|
),
|
|
265
|
-
children:
|
|
297
|
+
children: cardActions(card)
|
|
266
298
|
}
|
|
267
|
-
)
|
|
268
|
-
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: renderCard ? renderCard(card) : /* @__PURE__ */ jsx(DefaultCard, { card }) })
|
|
299
|
+
)
|
|
269
300
|
]
|
|
270
301
|
}
|
|
302
|
+
) : draggable ? (
|
|
303
|
+
// biome-ignore lint/a11y/useSemanticElements: draggable card is a custom widget
|
|
304
|
+
/* @__PURE__ */ jsxs(
|
|
305
|
+
"div",
|
|
306
|
+
{
|
|
307
|
+
role: "button",
|
|
308
|
+
tabIndex: 0,
|
|
309
|
+
"data-card-id": card.id,
|
|
310
|
+
"aria-pressed": grabbed,
|
|
311
|
+
"aria-roledescription": "tarjeta arrastrable",
|
|
312
|
+
"aria-describedby": instructionsId,
|
|
313
|
+
onKeyDown: (e) => onCardKeyDown(e, card),
|
|
314
|
+
onPointerDown: (e) => startPointerDrag(e, card),
|
|
315
|
+
className: cn(
|
|
316
|
+
"pressable relative flex cursor-grab select-none gap-1 rounded-input border-card surface-card p-density shadow-card focus-visible:focus-ring",
|
|
317
|
+
isDragged && "opacity-40",
|
|
318
|
+
grabbed && "shadow-selected",
|
|
319
|
+
classNames?.card
|
|
320
|
+
),
|
|
321
|
+
children: [
|
|
322
|
+
/* @__PURE__ */ jsx(
|
|
323
|
+
"span",
|
|
324
|
+
{
|
|
325
|
+
"data-grip": "",
|
|
326
|
+
"aria-hidden": "true",
|
|
327
|
+
className: cn(
|
|
328
|
+
"-ml-1 flex w-4 shrink-0 touch-none items-start pt-0.5 text-ink-3",
|
|
329
|
+
classNames?.grip
|
|
330
|
+
),
|
|
331
|
+
children: /* @__PURE__ */ jsx(GripVertical, { className: "size-4" })
|
|
332
|
+
}
|
|
333
|
+
),
|
|
334
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: renderCard ? renderCard(card) : /* @__PURE__ */ jsx(DefaultCard, { card }) })
|
|
335
|
+
]
|
|
336
|
+
}
|
|
337
|
+
)
|
|
338
|
+
) : /* @__PURE__ */ jsx(
|
|
339
|
+
"div",
|
|
340
|
+
{
|
|
341
|
+
"data-card-id": card.id,
|
|
342
|
+
className: cn(
|
|
343
|
+
"relative flex gap-1 rounded-input border-card surface-card p-density shadow-card",
|
|
344
|
+
classNames?.card
|
|
345
|
+
),
|
|
346
|
+
children: /* @__PURE__ */ jsx("div", { className: "min-w-0 flex-1", children: renderCard ? renderCard(card) : /* @__PURE__ */ jsx(DefaultCard, { card }) })
|
|
347
|
+
}
|
|
271
348
|
) }, card.id)
|
|
272
349
|
);
|
|
273
350
|
}
|
|
@@ -276,9 +353,10 @@ function Kanban({
|
|
|
276
353
|
"section",
|
|
277
354
|
{
|
|
278
355
|
"data-column-id": column.id,
|
|
356
|
+
"data-card-grid": cardGrid ? "" : void 0,
|
|
279
357
|
"aria-label": column.title,
|
|
280
358
|
className: cn(
|
|
281
|
-
"flex w-[min(18rem,85cqw)] shrink-0 snap-start flex-col gap-density-sm rounded-card bg-surface-sunken p-density-sm @4xl/kanban:w-auto @4xl/kanban:min-w-56 @4xl/kanban:flex-1",
|
|
359
|
+
"@container/lane flex w-[min(18rem,85cqw)] shrink-0 snap-start flex-col gap-density-sm rounded-card bg-surface-sunken p-density-sm @4xl/kanban:w-auto @4xl/kanban:min-w-56 @4xl/kanban:flex-1",
|
|
282
360
|
classNames?.column
|
|
283
361
|
),
|
|
284
362
|
children: [
|
|
@@ -315,8 +393,10 @@ function Kanban({
|
|
|
315
393
|
/* @__PURE__ */ jsxs(
|
|
316
394
|
"ul",
|
|
317
395
|
{
|
|
396
|
+
style: cardGrid ? { "--lane-card-min": `${cardGridMinWidth}px` } : void 0,
|
|
318
397
|
className: cn(
|
|
319
398
|
"m-0 flex min-h-16 list-none flex-col gap-density-sm p-0",
|
|
399
|
+
cardGrid && "@min-[30rem]/lane:grid @min-[30rem]/lane:grid-cols-[repeat(auto-fill,minmax(var(--lane-card-min),1fr))] @min-[30rem]/lane:items-start",
|
|
320
400
|
classNames?.cards
|
|
321
401
|
),
|
|
322
402
|
children: [
|
|
@@ -47,3 +47,15 @@ export declare function keyboardTarget(columns: KanbanColumnData[], cardId: stri
|
|
|
47
47
|
} | null;
|
|
48
48
|
/** Insert index for a pointer at `y`, from the vertical midpoints of the cards left in a column. */
|
|
49
49
|
export declare function dropIndex(midpoints: number[], y: number): number;
|
|
50
|
+
export interface CardRect {
|
|
51
|
+
left: number;
|
|
52
|
+
right: number;
|
|
53
|
+
top: number;
|
|
54
|
+
bottom: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Insert index for a pointer at (`x`, `y`) over a lane that lays its cards out as a grid, from the
|
|
58
|
+
* rectangles of the cards left in the lane in reading order: a card is passed when the pointer is
|
|
59
|
+
* below its row, or inside its row and past its horizontal midpoint.
|
|
60
|
+
*/
|
|
61
|
+
export declare function dropIndexGrid(rects: CardRect[], x: number, y: number): number;
|
|
@@ -68,8 +68,16 @@ function dropIndex(midpoints, y) {
|
|
|
68
68
|
}
|
|
69
69
|
return index;
|
|
70
70
|
}
|
|
71
|
+
function dropIndexGrid(rects, x, y) {
|
|
72
|
+
let index = 0;
|
|
73
|
+
for (const rect of rects) {
|
|
74
|
+
if (y > rect.bottom || y >= rect.top && x > (rect.left + rect.right) / 2) index += 1;
|
|
75
|
+
}
|
|
76
|
+
return index;
|
|
77
|
+
}
|
|
71
78
|
export {
|
|
72
79
|
dropIndex,
|
|
80
|
+
dropIndexGrid,
|
|
73
81
|
keyboardTarget,
|
|
74
82
|
locateCard,
|
|
75
83
|
moveCard,
|
|
@@ -81,7 +81,7 @@ function KpiValue({ suffix, trend, mono, className, children, ...props }) {
|
|
|
81
81
|
{
|
|
82
82
|
...props,
|
|
83
83
|
className: cn(
|
|
84
|
-
"break-words text-kpi-number tabular-nums @max-[9rem]/kpi:text-fs-
|
|
84
|
+
"break-words text-kpi-number tabular-nums @max-[9rem]/kpi:text-fs-200",
|
|
85
85
|
mono && "font-mono tracking-normal",
|
|
86
86
|
valueTone,
|
|
87
87
|
classNames?.value,
|
|
@@ -25,6 +25,11 @@ export interface KpiGroupProps extends Omit<ComponentPropsWithoutRef<"dl">, "chi
|
|
|
25
25
|
layout?: KpiGroupLayout;
|
|
26
26
|
/** Minimum tile width in px for `layout="auto-fit"`. */
|
|
27
27
|
minItemWidth?: number;
|
|
28
|
+
/**
|
|
29
|
+
* Columns on the narrowest containers. `1` (default) stacks the tiles; `2` keeps two across
|
|
30
|
+
* (and `auto-fit` never goes below two) for short tiles on a phone.
|
|
31
|
+
*/
|
|
32
|
+
minColumns?: 1 | 2;
|
|
28
33
|
/** Animate numeric values counting up. */
|
|
29
34
|
animate?: boolean;
|
|
30
35
|
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root wrapper and is merged last. */
|
|
@@ -34,4 +39,4 @@ export interface KpiGroupProps extends Omit<ComponentPropsWithoutRef<"dl">, "chi
|
|
|
34
39
|
* Metrics that belong together in one card, divided by hairlines. Columns follow the
|
|
35
40
|
* container width: 1, 2 or 4 across.
|
|
36
41
|
*/
|
|
37
|
-
export declare function KpiGroup({ items, layout, minItemWidth, animate, className, classNames, style, ...props }: KpiGroupProps): import("react").JSX.Element;
|
|
42
|
+
export declare function KpiGroup({ items, layout, minItemWidth, minColumns, animate, className, classNames, style, ...props }: KpiGroupProps): import("react").JSX.Element;
|
|
@@ -6,6 +6,7 @@ function KpiGroup({
|
|
|
6
6
|
items,
|
|
7
7
|
layout = "divided",
|
|
8
8
|
minItemWidth = 150,
|
|
9
|
+
minColumns = 1,
|
|
9
10
|
animate = true,
|
|
10
11
|
className,
|
|
11
12
|
classNames,
|
|
@@ -18,12 +19,15 @@ function KpiGroup({
|
|
|
18
19
|
{
|
|
19
20
|
...props,
|
|
20
21
|
style: autoFit ? {
|
|
21
|
-
gridTemplateColumns: `repeat(auto-fit, minmax(min(100%, ${minItemWidth}px), 1fr))`,
|
|
22
|
+
gridTemplateColumns: `repeat(auto-fit, minmax(min(${minColumns === 2 ? `${minItemWidth}px, calc((100% - var(--gap-density)) / 2)` : `100%, ${minItemWidth}px`}), 1fr))`,
|
|
22
23
|
...style
|
|
23
24
|
} : style,
|
|
24
25
|
className: cn(
|
|
25
26
|
"m-0 grid",
|
|
26
|
-
autoFit ? "gap-density" :
|
|
27
|
+
autoFit ? "gap-density" : cn(
|
|
28
|
+
"gap-px overflow-hidden rounded-card border-card bg-divider shadow-card @sm/kpi-group:grid-cols-2 @3xl/kpi-group:grid-cols-4",
|
|
29
|
+
minColumns === 2 ? "grid-cols-2 @max-sm/kpi-group:[&>:last-child:nth-child(odd)]:col-span-2" : "grid-cols-1"
|
|
30
|
+
),
|
|
27
31
|
classNames?.list
|
|
28
32
|
),
|
|
29
33
|
children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ListDetail, ListDetailDetail, ListDetailDetailHeader, type ListDetailDetailHeaderProps, type ListDetailDetailProps, ListDetailItem, type ListDetailItemProps, ListDetailList, type ListDetailListProps, ListDetailMeta, type ListDetailProps, ListDetailTitle, useListDetail, } from "./list-detail.js";
|
|
1
|
+
export { ListDetail, ListDetailDetail, ListDetailDetailHeader, type ListDetailDetailHeaderProps, type ListDetailDetailProps, ListDetailEmpty, type ListDetailEmptyProps, ListDetailHeader, type ListDetailHeaderProps, ListDetailItem, type ListDetailItemProps, ListDetailList, type ListDetailListProps, ListDetailMeta, type ListDetailProps, type ListDetailRatio, ListDetailTitle, useListDetail, } from "./list-detail.js";
|
|
@@ -2,6 +2,8 @@ import {
|
|
|
2
2
|
ListDetail,
|
|
3
3
|
ListDetailDetail,
|
|
4
4
|
ListDetailDetailHeader,
|
|
5
|
+
ListDetailEmpty,
|
|
6
|
+
ListDetailHeader,
|
|
5
7
|
ListDetailItem,
|
|
6
8
|
ListDetailList,
|
|
7
9
|
ListDetailMeta,
|
|
@@ -12,6 +14,8 @@ export {
|
|
|
12
14
|
ListDetail,
|
|
13
15
|
ListDetailDetail,
|
|
14
16
|
ListDetailDetailHeader,
|
|
17
|
+
ListDetailEmpty,
|
|
18
|
+
ListDetailHeader,
|
|
15
19
|
ListDetailItem,
|
|
16
20
|
ListDetailList,
|
|
17
21
|
ListDetailMeta,
|
|
@@ -5,6 +5,8 @@ export declare function useListDetail(): {
|
|
|
5
5
|
select: (value: string | null) => void;
|
|
6
6
|
isSelected: (candidate: string) => boolean;
|
|
7
7
|
};
|
|
8
|
+
/** List-to-detail width ratio when `listWidth` is not set: `1:1` (default), `1:2` or `1:3`. */
|
|
9
|
+
export type ListDetailRatio = "1:1" | "1:2" | "1:3";
|
|
8
10
|
export interface ListDetailProps extends Omit<ComponentPropsWithoutRef<"div">, "defaultValue" | "onChange"> {
|
|
9
11
|
/** Controlled selected item id; `null` means none (the single-pane view then shows the list). */
|
|
10
12
|
value?: string | null | undefined;
|
|
@@ -21,6 +23,26 @@ export interface ListDetailProps extends Omit<ComponentPropsWithoutRef<"div">, "
|
|
|
21
23
|
onBack?: (() => void) | undefined;
|
|
22
24
|
/** Names the list of items. */
|
|
23
25
|
"aria-label": string;
|
|
26
|
+
/**
|
|
27
|
+
* Fixed width of the list column beside the detail, from 641px of the component's own width: a
|
|
28
|
+
* number is pixels, a string any CSS length (`"20rem"`). A rail of 280-360px reads better than
|
|
29
|
+
* an even split for most catalogues. Wins over `ratio`.
|
|
30
|
+
*/
|
|
31
|
+
listWidth?: number | string | undefined;
|
|
32
|
+
/** Proportional split when `listWidth` is not set. Defaults to `"1:1"` (the original even split). */
|
|
33
|
+
ratio?: ListDetailRatio | undefined;
|
|
34
|
+
/**
|
|
35
|
+
* `"flat"` (default) keeps the panes flush with a divider between them. `"card"` draws each pane
|
|
36
|
+
* as a raised card with a gap between them.
|
|
37
|
+
*/
|
|
38
|
+
surface?: "flat" | "card" | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Keeps the list column in view while the page scrolls and gives it its own scroll, from 641px
|
|
41
|
+
* of the component's own width. The list header stays at the top of the column.
|
|
42
|
+
*/
|
|
43
|
+
stickyList?: boolean | undefined;
|
|
44
|
+
/** Distance the sticky list keeps from the top of its scroll container (number = pixels). Default `0`. */
|
|
45
|
+
stickyOffset?: number | string | undefined;
|
|
24
46
|
children: ReactNode;
|
|
25
47
|
}
|
|
26
48
|
/**
|
|
@@ -28,9 +50,22 @@ export interface ListDetailProps extends Omit<ComponentPropsWithoutRef<"div">, "
|
|
|
28
50
|
* width it collapses to a single pane: the list until an item is chosen, then the detail with a
|
|
29
51
|
* back action (focus follows the change). Panes render flush to the container's inline edges.
|
|
30
52
|
*/
|
|
31
|
-
export declare function ListDetail({ value: valueProp, defaultValue, onValueChange, onBack, "aria-label": label, className, children, ...props }: ListDetailProps): import("react").JSX.Element;
|
|
32
|
-
export
|
|
33
|
-
|
|
53
|
+
export declare function ListDetail({ value: valueProp, defaultValue, onValueChange, onBack, "aria-label": label, listWidth, ratio, surface, stickyList, stickyOffset, className, style, children, ...props }: ListDetailProps): import("react").JSX.Element;
|
|
54
|
+
export interface ListDetailListProps extends Omit<ComponentPropsWithoutRef<"ul">, "aria-label"> {
|
|
55
|
+
/** Sits above the items and stays put while they scroll: a `ListDetailHeader` with search, filters and a count. */
|
|
56
|
+
header?: ReactNode;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The list column: an optional `header` above the item list. The `ul` is named by the
|
|
60
|
+
* `ListDetail`'s `aria-label`; `className` and the other props go to it.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ListDetailList({ header, className, ...props }: ListDetailListProps): import("react").JSX.Element;
|
|
63
|
+
export interface ListDetailHeaderProps extends ComponentPropsWithoutRef<"div"> {
|
|
64
|
+
/** End slot showing how many items match, e.g. `12`. Announced politely when it changes. */
|
|
65
|
+
count?: ReactNode;
|
|
66
|
+
}
|
|
67
|
+
/** Controls row of the list column: a search field, filter chips and a result count. */
|
|
68
|
+
export declare function ListDetailHeader({ count, className, children, ...props }: ListDetailHeaderProps): import("react").JSX.Element;
|
|
34
69
|
export interface ListDetailItemProps extends Omit<ComponentPropsWithoutRef<"button">, "value"> {
|
|
35
70
|
value: string;
|
|
36
71
|
/** End slot: a count, a status chip, a time. */
|
|
@@ -53,3 +88,16 @@ export interface ListDetailDetailHeaderProps extends Omit<ComponentPropsWithoutR
|
|
|
53
88
|
actions?: ReactNode;
|
|
54
89
|
}
|
|
55
90
|
export declare function ListDetailDetailHeader({ title, description, actions, className, ...props }: ListDetailDetailHeaderProps): import("react").JSX.Element;
|
|
91
|
+
export interface ListDetailEmptyProps extends Omit<ComponentPropsWithoutRef<"div">, "title"> {
|
|
92
|
+
/** Decorative icon; hidden from screen readers. */
|
|
93
|
+
icon?: ReactNode;
|
|
94
|
+
title: ReactNode;
|
|
95
|
+
description?: ReactNode;
|
|
96
|
+
/** Call to action under the text. */
|
|
97
|
+
action?: ReactNode;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Placeholder for the detail pane while nothing is selected ("Choose an item"). Render it inside
|
|
101
|
+
* `ListDetailDetail`; it renders nothing once an item is selected, so it needs no condition.
|
|
102
|
+
*/
|
|
103
|
+
export declare function ListDetailEmpty({ icon, title, description, action, className, ...props }: ListDetailEmptyProps): import("react").JSX.Element | null;
|
|
@@ -26,13 +26,28 @@ function useListDetail() {
|
|
|
26
26
|
const { value, select } = useListDetailContext("useListDetail");
|
|
27
27
|
return { value, select, isSelected: (candidate) => candidate === value };
|
|
28
28
|
}
|
|
29
|
+
const ratioClasses = {
|
|
30
|
+
"1:1": "@min-[641px]/list-detail:grid-cols-2",
|
|
31
|
+
"1:2": "@min-[641px]/list-detail:grid-cols-[minmax(0,1fr)_minmax(0,2fr)]",
|
|
32
|
+
"1:3": "@min-[641px]/list-detail:grid-cols-[minmax(0,1fr)_minmax(0,3fr)]"
|
|
33
|
+
};
|
|
34
|
+
const FIXED_LIST_COLUMNS = "@min-[641px]/list-detail:grid-cols-[minmax(0,var(--ld-list-width))_minmax(0,1fr)]";
|
|
35
|
+
function cssLength(value) {
|
|
36
|
+
return typeof value === "number" ? `${value}px` : value;
|
|
37
|
+
}
|
|
29
38
|
function ListDetail({
|
|
30
39
|
value: valueProp,
|
|
31
40
|
defaultValue = null,
|
|
32
41
|
onValueChange,
|
|
33
42
|
onBack,
|
|
34
43
|
"aria-label": label,
|
|
44
|
+
listWidth,
|
|
45
|
+
ratio = "1:1",
|
|
46
|
+
surface = "flat",
|
|
47
|
+
stickyList = false,
|
|
48
|
+
stickyOffset,
|
|
35
49
|
className,
|
|
50
|
+
style,
|
|
36
51
|
children,
|
|
37
52
|
...props
|
|
38
53
|
}) {
|
|
@@ -68,33 +83,81 @@ function ListDetail({
|
|
|
68
83
|
if (detail && back && back.getClientRects().length > 0) detail.focus();
|
|
69
84
|
}, [value]);
|
|
70
85
|
const context = useMemo(() => ({ value, select, label }), [value, select, label]);
|
|
71
|
-
return /* @__PURE__ */ jsx(ListDetailContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
86
|
+
return /* @__PURE__ */ jsx(ListDetailContext.Provider, { value: context, children: /* @__PURE__ */ jsx(
|
|
72
87
|
"div",
|
|
73
88
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
89
|
+
...props,
|
|
90
|
+
ref: rootRef,
|
|
91
|
+
className: cn("@container/list-detail min-w-0", className),
|
|
92
|
+
style: {
|
|
93
|
+
...style,
|
|
94
|
+
...listWidth !== void 0 ? { "--ld-list-width": cssLength(listWidth) } : null,
|
|
95
|
+
...stickyOffset !== void 0 ? { "--ld-sticky-top": cssLength(stickyOffset) } : null
|
|
96
|
+
},
|
|
97
|
+
children: /* @__PURE__ */ jsx(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
"data-view": value === null ? "list" : "detail",
|
|
101
|
+
"data-surface": surface,
|
|
102
|
+
"data-sticky-list": stickyList ? "" : void 0,
|
|
103
|
+
className: cn(
|
|
104
|
+
"group/ld grid grid-cols-1",
|
|
105
|
+
surface === "flat" && "border-t-divider",
|
|
106
|
+
listWidth !== void 0 ? FIXED_LIST_COLUMNS : ratioClasses[ratio],
|
|
107
|
+
surface === "card" && "@min-[641px]/list-detail:gap-4",
|
|
108
|
+
"[&>*]:min-w-0"
|
|
109
|
+
),
|
|
110
|
+
children
|
|
111
|
+
}
|
|
112
|
+
)
|
|
81
113
|
}
|
|
82
|
-
) })
|
|
114
|
+
) });
|
|
83
115
|
}
|
|
84
|
-
function ListDetailList({ className, ...props }) {
|
|
116
|
+
function ListDetailList({ header, className, ...props }) {
|
|
85
117
|
const { label } = useListDetailContext("ListDetailList");
|
|
86
|
-
return /* @__PURE__ */
|
|
87
|
-
"
|
|
118
|
+
return /* @__PURE__ */ jsxs(
|
|
119
|
+
"div",
|
|
88
120
|
{
|
|
89
121
|
"data-list-detail-pane": "list",
|
|
90
|
-
"aria-label": label,
|
|
91
122
|
className: cn(
|
|
92
|
-
"
|
|
123
|
+
"flex min-h-0 min-w-0 flex-col",
|
|
93
124
|
"@min-[641px]/list-detail:border-r-divider",
|
|
94
125
|
"group-data-[view=detail]/ld:@max-[640px]/list-detail:hidden",
|
|
126
|
+
"group-data-[surface=card]/ld:overflow-hidden group-data-[surface=card]/ld:rounded-card group-data-[surface=card]/ld:border-card group-data-[surface=card]/ld:shadow-card group-data-[surface=card]/ld:surface-card group-data-[surface=card]/ld:@min-[641px]/list-detail:border-r-0",
|
|
127
|
+
"group-data-[sticky-list]/ld:@min-[641px]/list-detail:sticky group-data-[sticky-list]/ld:@min-[641px]/list-detail:top-(--ld-sticky-top,0px) group-data-[sticky-list]/ld:@min-[641px]/list-detail:max-h-[calc(100dvh-var(--ld-sticky-top,0px))] group-data-[sticky-list]/ld:@min-[641px]/list-detail:self-start"
|
|
128
|
+
),
|
|
129
|
+
children: [
|
|
130
|
+
header,
|
|
131
|
+
/* @__PURE__ */ jsx(
|
|
132
|
+
"ul",
|
|
133
|
+
{
|
|
134
|
+
"aria-label": label,
|
|
135
|
+
className: cn(
|
|
136
|
+
"m-0 flex min-h-0 list-none flex-col p-0",
|
|
137
|
+
"group-data-[sticky-list]/ld:@min-[641px]/list-detail:overflow-y-auto",
|
|
138
|
+
"group-data-[surface=card]/ld:p-2",
|
|
139
|
+
className
|
|
140
|
+
),
|
|
141
|
+
...props
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
function ListDetailHeader({ count, className, children, ...props }) {
|
|
149
|
+
return /* @__PURE__ */ jsxs(
|
|
150
|
+
"div",
|
|
151
|
+
{
|
|
152
|
+
className: cn(
|
|
153
|
+
"flex shrink-0 flex-wrap items-center gap-2 border-b-divider py-2.5 group-data-[surface=card]/ld:px-3",
|
|
95
154
|
className
|
|
96
155
|
),
|
|
97
|
-
...props
|
|
156
|
+
...props,
|
|
157
|
+
children: [
|
|
158
|
+
children,
|
|
159
|
+
count !== void 0 ? /* @__PURE__ */ jsx("span", { "aria-live": "polite", className: "ml-auto text-count text-ink-3", children: count }) : null
|
|
160
|
+
]
|
|
98
161
|
}
|
|
99
162
|
);
|
|
100
163
|
}
|
|
@@ -117,6 +180,7 @@ function ListDetailItem({
|
|
|
117
180
|
onClick: composeHandlers(onClick, () => select(value)),
|
|
118
181
|
className: cn(
|
|
119
182
|
"grid min-h-11 w-full cursor-pointer grid-cols-[minmax(0,1fr)_auto] items-center gap-3 border-b-divider py-2.5 text-start hover:bg-surface-2 focus-visible:-outline-offset-2 focus-visible:focus-ring aria-[current=true]:bg-accent-soft",
|
|
183
|
+
"group-data-[surface=card]/ld:rounded-button group-data-[surface=card]/ld:border-b-0 group-data-[surface=card]/ld:px-3",
|
|
120
184
|
className
|
|
121
185
|
),
|
|
122
186
|
...props,
|
|
@@ -160,6 +224,7 @@ function ListDetailDetail({
|
|
|
160
224
|
className: cn(
|
|
161
225
|
"flex min-w-0 flex-col outline-none",
|
|
162
226
|
"group-data-[view=list]/ld:@max-[640px]/list-detail:hidden",
|
|
227
|
+
"group-data-[surface=card]/ld:rounded-card group-data-[surface=card]/ld:border-card group-data-[surface=card]/ld:px-card group-data-[surface=card]/ld:pb-card group-data-[surface=card]/ld:shadow-card group-data-[surface=card]/ld:surface-card",
|
|
163
228
|
className
|
|
164
229
|
),
|
|
165
230
|
children: [
|
|
@@ -209,10 +274,39 @@ function ListDetailDetailHeader({
|
|
|
209
274
|
}
|
|
210
275
|
);
|
|
211
276
|
}
|
|
277
|
+
function ListDetailEmpty({
|
|
278
|
+
icon,
|
|
279
|
+
title,
|
|
280
|
+
description,
|
|
281
|
+
action,
|
|
282
|
+
className,
|
|
283
|
+
...props
|
|
284
|
+
}) {
|
|
285
|
+
const { value } = useListDetailContext("ListDetailEmpty");
|
|
286
|
+
if (value !== null) return null;
|
|
287
|
+
return /* @__PURE__ */ jsxs(
|
|
288
|
+
"div",
|
|
289
|
+
{
|
|
290
|
+
className: cn(
|
|
291
|
+
"flex min-h-64 flex-1 flex-col items-center justify-center gap-2 px-6 py-12 text-center",
|
|
292
|
+
className
|
|
293
|
+
),
|
|
294
|
+
...props,
|
|
295
|
+
children: [
|
|
296
|
+
icon !== void 0 ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "inline-flex text-ink-3 [&_svg]:size-8", children: icon }) : null,
|
|
297
|
+
/* @__PURE__ */ jsx("p", { className: "m-0 font-semibold text-ink text-row-title", children: title }),
|
|
298
|
+
description !== void 0 ? /* @__PURE__ */ jsx("p", { className: "m-0 max-w-[44ch] text-ink-3 text-meta", children: description }) : null,
|
|
299
|
+
action !== void 0 ? /* @__PURE__ */ jsx("div", { className: "mt-2", children: action }) : null
|
|
300
|
+
]
|
|
301
|
+
}
|
|
302
|
+
);
|
|
303
|
+
}
|
|
212
304
|
export {
|
|
213
305
|
ListDetail,
|
|
214
306
|
ListDetailDetail,
|
|
215
307
|
ListDetailDetailHeader,
|
|
308
|
+
ListDetailEmpty,
|
|
309
|
+
ListDetailHeader,
|
|
216
310
|
ListDetailItem,
|
|
217
311
|
ListDetailList,
|
|
218
312
|
ListDetailMeta,
|
|
@@ -1,7 +1,20 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from "react";
|
|
2
|
-
export
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
export interface PageProps extends ComponentPropsWithoutRef<"div"> {
|
|
3
|
+
/**
|
|
4
|
+
* A fixed column beside the page content, usually an `Aside`. The column draws a divider and the
|
|
5
|
+
* page background, never narrows the width the `page` container measures (so `Cols` inside the
|
|
6
|
+
* content react the same with or without it), and falls under the content once the page is
|
|
7
|
+
* 1000px wide or less. With an aside, `className` and the other props apply to the content column.
|
|
8
|
+
*/
|
|
9
|
+
aside?: ReactNode;
|
|
10
|
+
/** Width of the aside column: a number is pixels, a string any CSS length. Default `20rem` (320px at 16px). */
|
|
11
|
+
asideWidth?: number | string;
|
|
12
|
+
/** Keeps the aside column in view and scrolls it on its own beside the content (above 1000px). */
|
|
13
|
+
asideSticky?: boolean;
|
|
14
|
+
}
|
|
3
15
|
/**
|
|
4
16
|
* Vertical flow of page sections. It is the `page` container, so `Cols` and `SettingsLayout`
|
|
5
|
-
* inside it react to the page width instead of the viewport.
|
|
17
|
+
* inside it react to the page width instead of the viewport. With `aside` the page is a content
|
|
18
|
+
* column plus a rail; the shell around the page still owns the outer gutter and scrolling.
|
|
6
19
|
*/
|
|
7
|
-
export declare function Page({ className, ...props }: PageProps): import("react").JSX.Element;
|
|
20
|
+
export declare function Page({ aside, asideWidth, asideSticky, className, style, children, ...props }: PageProps): import("react").JSX.Element;
|