@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 @@
|
|
|
1
|
+
export { type RowActionItem, RowActions, type RowActionsProps } from "./row-actions.js";
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
type ComponentPropsWithoutRef,
|
|
5
|
+
Fragment,
|
|
6
|
+
type KeyboardEvent,
|
|
7
|
+
type MouseEvent,
|
|
8
|
+
type ReactNode,
|
|
9
|
+
} from "react";
|
|
10
|
+
import { IconButton } from "../../atoms/icon-button/icon-button.js";
|
|
11
|
+
import { EllipsisVertical } from "../../icons/index.js";
|
|
12
|
+
import {
|
|
13
|
+
DropdownMenu,
|
|
14
|
+
DropdownMenuContent,
|
|
15
|
+
DropdownMenuItem,
|
|
16
|
+
DropdownMenuSeparator,
|
|
17
|
+
DropdownMenuTrigger,
|
|
18
|
+
} from "../../overlays/dropdown-menu/dropdown-menu.js";
|
|
19
|
+
import { cn } from "../../utils/cn.js";
|
|
20
|
+
|
|
21
|
+
export interface RowActionItem {
|
|
22
|
+
/** Stable key of the item. */
|
|
23
|
+
id: string;
|
|
24
|
+
label: string;
|
|
25
|
+
onSelect: () => void;
|
|
26
|
+
/** Leading decorative icon. */
|
|
27
|
+
icon?: ReactNode;
|
|
28
|
+
/** `danger` items sort to the end of the menu, behind a separator, and read in the danger colour. */
|
|
29
|
+
tone?: "default" | "danger";
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export interface RowActionsProps
|
|
34
|
+
extends Omit<ComponentPropsWithoutRef<"span">, "children" | "onClick" | "onKeyDown"> {
|
|
35
|
+
/** Accessible name of the overflow trigger. Name the row: "Actions for Ana Quispe". */
|
|
36
|
+
label: string;
|
|
37
|
+
/** At most one inline action, typically a `Button size="sm"`: the one thing the row is mostly for. */
|
|
38
|
+
primary?: ReactNode;
|
|
39
|
+
/** The rest, in the overflow menu. No trigger renders when it is empty. */
|
|
40
|
+
items: readonly RowActionItem[];
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A click or a key inside the actions (the menu is portaled, but React events still bubble
|
|
45
|
+
* through the component tree) never reaches the row, so a clickable row does not also activate.
|
|
46
|
+
*/
|
|
47
|
+
function contain(event: MouseEvent | KeyboardEvent): void {
|
|
48
|
+
event.stopPropagation();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* One row's actions: at most one inline primary action, the rest in an overflow menu behind a
|
|
53
|
+
* 30px "more" button. It never wraps, so the row keeps its height; destructive items sort last,
|
|
54
|
+
* behind a separator. The menu is a WAI-ARIA menu: arrows, Home/End, typeahead, Escape.
|
|
55
|
+
*/
|
|
56
|
+
export function RowActions({ label, primary, items, className, ...props }: RowActionsProps) {
|
|
57
|
+
const regular = items.filter((item) => item.tone !== "danger");
|
|
58
|
+
const destructive = items.filter((item) => item.tone === "danger");
|
|
59
|
+
return (
|
|
60
|
+
// biome-ignore lint/a11y/noStaticElementInteractions: only stops events from bubbling to the row; the controls inside are the interactive parts
|
|
61
|
+
<span
|
|
62
|
+
data-slot="row-actions"
|
|
63
|
+
className={cn(
|
|
64
|
+
"inline-flex flex-nowrap items-center justify-end gap-1.5 whitespace-nowrap",
|
|
65
|
+
className,
|
|
66
|
+
)}
|
|
67
|
+
{...props}
|
|
68
|
+
onClick={contain}
|
|
69
|
+
onKeyDown={contain}
|
|
70
|
+
>
|
|
71
|
+
{primary}
|
|
72
|
+
{items.length > 0 ? (
|
|
73
|
+
<DropdownMenu>
|
|
74
|
+
<DropdownMenuTrigger asChild>
|
|
75
|
+
<IconButton
|
|
76
|
+
size="sm"
|
|
77
|
+
variant="secondary"
|
|
78
|
+
label={label}
|
|
79
|
+
// Reveal: on a pointer that hovers, the glyph is muted until its row is hovered or
|
|
80
|
+
// holds focus; it never hides, so touch and keyboard users always see it.
|
|
81
|
+
className="transition-[scale,color] duration-(--motion-duration) ease-(--motion-ease) motion-reduce:transition-none [@media(hover:hover)]:text-ink-3 [@media(hover:hover)]:group-focus-within/row:text-ink [@media(hover:hover)]:group-hover/row:text-ink data-[state=open]:text-ink"
|
|
82
|
+
>
|
|
83
|
+
<EllipsisVertical aria-hidden="true" />
|
|
84
|
+
</IconButton>
|
|
85
|
+
</DropdownMenuTrigger>
|
|
86
|
+
<DropdownMenuContent align="end">
|
|
87
|
+
{[regular, destructive].map((group, index) =>
|
|
88
|
+
group.length === 0 ? null : (
|
|
89
|
+
<Fragment key={index === 0 ? "regular" : "destructive"}>
|
|
90
|
+
{index === 1 && regular.length > 0 ? <DropdownMenuSeparator /> : null}
|
|
91
|
+
{group.map((item) => (
|
|
92
|
+
<DropdownMenuItem
|
|
93
|
+
key={item.id}
|
|
94
|
+
disabled={item.disabled}
|
|
95
|
+
onSelect={() => item.onSelect()}
|
|
96
|
+
data-tone={item.tone === "danger" ? "danger" : undefined}
|
|
97
|
+
className={cn(
|
|
98
|
+
"[&_svg]:size-4 [&_svg]:shrink-0",
|
|
99
|
+
item.tone === "danger" && "text-danger data-highlighted:bg-danger-soft",
|
|
100
|
+
)}
|
|
101
|
+
>
|
|
102
|
+
{item.icon}
|
|
103
|
+
{item.label}
|
|
104
|
+
</DropdownMenuItem>
|
|
105
|
+
))}
|
|
106
|
+
</Fragment>
|
|
107
|
+
),
|
|
108
|
+
)}
|
|
109
|
+
</DropdownMenuContent>
|
|
110
|
+
</DropdownMenu>
|
|
111
|
+
) : null}
|
|
112
|
+
</span>
|
|
113
|
+
);
|
|
114
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type ComponentPropsWithRef, type MouseEvent, type ReactNode, useId } from "react";
|
|
4
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
5
|
+
import { cn } from "../../utils/cn.js";
|
|
6
|
+
|
|
7
|
+
export type SelectableCardPart = "root" | "content" | "reason";
|
|
8
|
+
|
|
9
|
+
export interface SelectableCardProps
|
|
10
|
+
extends Omit<ComponentPropsWithRef<"button">, "children" | "role" | "aria-checked"> {
|
|
11
|
+
/** Card content. It sits inside a button, so use phrasing content only (spans, text, icons). */
|
|
12
|
+
children: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* Selectable mode. Omitted: the card is a plain button that runs `onClick`. A boolean makes it
|
|
15
|
+
* a toggle (`aria-pressed`), or a radio (`aria-checked`) with `semantics="radio"`.
|
|
16
|
+
*/
|
|
17
|
+
selected?: boolean;
|
|
18
|
+
/** `"pressed"` for a toggle (default), `"radio"` when exactly one card of a group is selected; wrap the group in `role="radiogroup"`. */
|
|
19
|
+
semantics?: "pressed" | "radio";
|
|
20
|
+
/** The card stays focusable and ignores clicks (`aria-disabled`), and the reason is read out with it. */
|
|
21
|
+
disabled?: boolean;
|
|
22
|
+
/** Visible text explaining why the card is disabled; announced as its description. */
|
|
23
|
+
disabledReason?: string;
|
|
24
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
25
|
+
classNames?: ClassNames<SelectableCardPart>;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A card that is itself the interactive element: one `button`, no overlay and no nested
|
|
30
|
+
* controls. Use it as a button (`onClick`) or as a selectable option (`selected`). A disabled card
|
|
31
|
+
* keeps focus so its reason can be reached.
|
|
32
|
+
*/
|
|
33
|
+
export function SelectableCard({
|
|
34
|
+
children,
|
|
35
|
+
selected,
|
|
36
|
+
semantics = "pressed",
|
|
37
|
+
disabled = false,
|
|
38
|
+
disabledReason,
|
|
39
|
+
onClick,
|
|
40
|
+
className,
|
|
41
|
+
classNames,
|
|
42
|
+
"aria-describedby": describedBy,
|
|
43
|
+
...props
|
|
44
|
+
}: SelectableCardProps) {
|
|
45
|
+
const reasonId = useId();
|
|
46
|
+
const showReason = disabled && Boolean(disabledReason);
|
|
47
|
+
const radio = semantics === "radio" && selected !== undefined;
|
|
48
|
+
const handleClick = (event: MouseEvent<HTMLButtonElement>) => {
|
|
49
|
+
if (disabled) {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
onClick?.(event);
|
|
54
|
+
};
|
|
55
|
+
return (
|
|
56
|
+
// biome-ignore lint/a11y/useAriaPropsSupportedByRole: aria-checked is only set together with role="radio"
|
|
57
|
+
<button
|
|
58
|
+
type="button"
|
|
59
|
+
{...props}
|
|
60
|
+
role={radio ? "radio" : undefined}
|
|
61
|
+
aria-checked={radio ? selected : undefined}
|
|
62
|
+
aria-pressed={!radio && selected !== undefined ? selected : undefined}
|
|
63
|
+
aria-disabled={disabled || undefined}
|
|
64
|
+
aria-describedby={
|
|
65
|
+
[describedBy, showReason ? reasonId : undefined].filter(Boolean).join(" ") || undefined
|
|
66
|
+
}
|
|
67
|
+
onClick={handleClick}
|
|
68
|
+
className={cn(
|
|
69
|
+
"pressable flex w-full min-w-0 flex-col gap-1 rounded-card border-card p-card text-left shadow-card surface-card focus-visible:focus-ring",
|
|
70
|
+
selected && "border-accent-line bg-accent-soft shadow-selected",
|
|
71
|
+
disabled ? "cursor-not-allowed opacity-60" : "cursor-pointer",
|
|
72
|
+
classNames?.root,
|
|
73
|
+
className,
|
|
74
|
+
)}
|
|
75
|
+
>
|
|
76
|
+
<span className={cn("flex min-w-0 flex-col gap-1", classNames?.content)}>{children}</span>
|
|
77
|
+
{showReason ? (
|
|
78
|
+
<span id={reasonId} className={cn("text-ink-3 text-meta", classNames?.reason)}>
|
|
79
|
+
{disabledReason}
|
|
80
|
+
</span>
|
|
81
|
+
) : null}
|
|
82
|
+
</button>
|
|
83
|
+
);
|
|
84
|
+
}
|
|
@@ -1,39 +1,130 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { type ComponentPropsWithoutRef, createContext, use } from "react";
|
|
2
4
|
import { cn } from "../../utils/cn.js";
|
|
3
5
|
|
|
4
|
-
|
|
6
|
+
/** Container widths (px) under which the layout stacks. The set is closed so every query is a literal class. */
|
|
7
|
+
export type SettingsLayoutBreakpoint = 720 | 940 | 1080 | 1280;
|
|
8
|
+
|
|
9
|
+
export type SettingsLayoutContainer = "page" | "self";
|
|
10
|
+
|
|
11
|
+
interface SettingsLayoutConfig {
|
|
12
|
+
breakpoint: SettingsLayoutBreakpoint | "never";
|
|
13
|
+
container: SettingsLayoutContainer;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const SettingsLayoutContext = createContext<SettingsLayoutConfig>({
|
|
17
|
+
breakpoint: 940,
|
|
18
|
+
container: "page",
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const stackClasses: Record<
|
|
22
|
+
SettingsLayoutContainer,
|
|
23
|
+
Record<SettingsLayoutBreakpoint, { grid: string; nav: string }>
|
|
24
|
+
> = {
|
|
25
|
+
page: {
|
|
26
|
+
720: {
|
|
27
|
+
grid: "@max-[720px]/page:grid-cols-1",
|
|
28
|
+
nav: "@max-[720px]/page:static @max-[720px]/page:flex-row @max-[720px]/page:overflow-x-auto",
|
|
29
|
+
},
|
|
30
|
+
940: {
|
|
31
|
+
grid: "@max-[940px]/page:grid-cols-1",
|
|
32
|
+
nav: "@max-[940px]/page:static @max-[940px]/page:flex-row @max-[940px]/page:overflow-x-auto",
|
|
33
|
+
},
|
|
34
|
+
1080: {
|
|
35
|
+
grid: "@max-[1080px]/page:grid-cols-1",
|
|
36
|
+
nav: "@max-[1080px]/page:static @max-[1080px]/page:flex-row @max-[1080px]/page:overflow-x-auto",
|
|
37
|
+
},
|
|
38
|
+
1280: {
|
|
39
|
+
grid: "@max-[1280px]/page:grid-cols-1",
|
|
40
|
+
nav: "@max-[1280px]/page:static @max-[1280px]/page:flex-row @max-[1280px]/page:overflow-x-auto",
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
self: {
|
|
44
|
+
720: {
|
|
45
|
+
grid: "@max-[720px]/settings:grid-cols-1",
|
|
46
|
+
nav: "@max-[720px]/settings:static @max-[720px]/settings:flex-row @max-[720px]/settings:overflow-x-auto",
|
|
47
|
+
},
|
|
48
|
+
940: {
|
|
49
|
+
grid: "@max-[940px]/settings:grid-cols-1",
|
|
50
|
+
nav: "@max-[940px]/settings:static @max-[940px]/settings:flex-row @max-[940px]/settings:overflow-x-auto",
|
|
51
|
+
},
|
|
52
|
+
1080: {
|
|
53
|
+
grid: "@max-[1080px]/settings:grid-cols-1",
|
|
54
|
+
nav: "@max-[1080px]/settings:static @max-[1080px]/settings:flex-row @max-[1080px]/settings:overflow-x-auto",
|
|
55
|
+
},
|
|
56
|
+
1280: {
|
|
57
|
+
grid: "@max-[1280px]/settings:grid-cols-1",
|
|
58
|
+
nav: "@max-[1280px]/settings:static @max-[1280px]/settings:flex-row @max-[1280px]/settings:overflow-x-auto",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
function stackFor(config: SettingsLayoutConfig, part: "grid" | "nav") {
|
|
64
|
+
return config.breakpoint === "never"
|
|
65
|
+
? undefined
|
|
66
|
+
: stackClasses[config.container][config.breakpoint][part];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface SettingsLayoutProps extends ComponentPropsWithoutRef<"div"> {
|
|
70
|
+
/**
|
|
71
|
+
* Container width (px) under which the nav and the content stack. `"never"` keeps two columns.
|
|
72
|
+
* Defaults to 940. `SettingsLayoutNav` follows it without being told.
|
|
73
|
+
*/
|
|
74
|
+
breakpoint?: SettingsLayoutBreakpoint | "never";
|
|
75
|
+
/**
|
|
76
|
+
* Which container is measured. `"page"` (default) is the ancestor `@container/page`;
|
|
77
|
+
* `"self"` wraps the layout in its own container, for use outside a page shell.
|
|
78
|
+
*/
|
|
79
|
+
container?: SettingsLayoutContainer;
|
|
80
|
+
}
|
|
5
81
|
|
|
6
82
|
/**
|
|
7
|
-
* Two-column settings grid (side nav + content).
|
|
8
|
-
*
|
|
83
|
+
* Two-column settings grid (side nav + content). Stacks to one column under `breakpoint`
|
|
84
|
+
* (940 px by default) of the measured container, never of the viewport.
|
|
9
85
|
*/
|
|
10
|
-
export function SettingsLayout({
|
|
11
|
-
|
|
86
|
+
export function SettingsLayout({
|
|
87
|
+
breakpoint = 940,
|
|
88
|
+
container = "page",
|
|
89
|
+
className,
|
|
90
|
+
...props
|
|
91
|
+
}: SettingsLayoutProps) {
|
|
92
|
+
const config = { breakpoint, container };
|
|
93
|
+
const grid = (
|
|
12
94
|
<div
|
|
13
95
|
className={cn(
|
|
14
|
-
"grid grid-cols-[220px_minmax(0,1fr)] items-start gap-6
|
|
96
|
+
"grid grid-cols-[220px_minmax(0,1fr)] items-start gap-6",
|
|
97
|
+
stackFor(config, "grid"),
|
|
15
98
|
className,
|
|
16
99
|
)}
|
|
17
100
|
{...props}
|
|
18
101
|
/>
|
|
19
102
|
);
|
|
103
|
+
return (
|
|
104
|
+
<SettingsLayoutContext value={config}>
|
|
105
|
+
{container === "self" ? <div className="@container/settings min-w-0">{grid}</div> : grid}
|
|
106
|
+
</SettingsLayoutContext>
|
|
107
|
+
);
|
|
20
108
|
}
|
|
21
109
|
|
|
22
|
-
export
|
|
110
|
+
export interface SettingsLayoutNavProps extends ComponentPropsWithoutRef<"nav"> {
|
|
111
|
+
/** Overrides the breakpoint the surrounding `SettingsLayout` set. */
|
|
112
|
+
breakpoint?: SettingsLayoutBreakpoint | "never";
|
|
113
|
+
}
|
|
23
114
|
|
|
24
115
|
/** Sticky side nav that becomes a scrollable horizontal row on narrow pages. */
|
|
25
116
|
export function SettingsLayoutNav({
|
|
26
117
|
"aria-label": ariaLabel = "Sections",
|
|
118
|
+
breakpoint,
|
|
27
119
|
className,
|
|
28
120
|
...props
|
|
29
121
|
}: SettingsLayoutNavProps) {
|
|
122
|
+
const inherited = use(SettingsLayoutContext);
|
|
123
|
+
const config = { ...inherited, breakpoint: breakpoint ?? inherited.breakpoint };
|
|
30
124
|
return (
|
|
31
125
|
<nav
|
|
32
126
|
aria-label={ariaLabel}
|
|
33
|
-
className={cn(
|
|
34
|
-
"sticky top-20 flex flex-col gap-px @max-[940px]/page:static @max-[940px]/page:flex-row @max-[940px]/page:overflow-x-auto",
|
|
35
|
-
className,
|
|
36
|
-
)}
|
|
127
|
+
className={cn("sticky top-20 flex flex-col gap-px", stackFor(config, "nav"), className)}
|
|
37
128
|
{...props}
|
|
38
129
|
/>
|
|
39
130
|
);
|
|
@@ -55,7 +146,7 @@ export function SettingsLayoutNavItem({
|
|
|
55
146
|
type={type}
|
|
56
147
|
aria-current={active ? "true" : undefined}
|
|
57
148
|
className={cn(
|
|
58
|
-
"flex shrink-0 items-center gap-2.5 rounded-control px-2.5 py-1.75 font-medium text-fs-130 text-ink-2 hover:bg-surface-2 hover:text-ink",
|
|
149
|
+
"flex min-h-(--touch-target) shrink-0 items-center gap-2.5 rounded-control px-2.5 py-1.75 font-medium text-fs-130 text-ink-2 hover:bg-surface-2 hover:text-ink",
|
|
59
150
|
active && "bg-accent-soft font-semibold text-accent-ink",
|
|
60
151
|
className,
|
|
61
152
|
)}
|
|
@@ -31,7 +31,7 @@ export interface ShortcutsItemProps extends ComponentPropsWithoutRef<"a"> {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
const itemClasses =
|
|
34
|
-
"flex min-h-control-sm w-full cursor-pointer items-center gap-2 rounded-button px-2 text-start text-fs-130 text-ink-2 no-underline hover:bg-surface-2 hover:text-ink focus-visible:focus-ring
|
|
34
|
+
"flex min-h-control-sm w-full cursor-pointer items-center gap-2 rounded-button px-2 text-start text-fs-130 text-ink-2 no-underline hover:bg-surface-2 hover:text-ink focus-visible:focus-ring";
|
|
35
35
|
|
|
36
36
|
export function ShortcutsItem({
|
|
37
37
|
icon,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type TableSortDirection = "ascending" | "descending";
|
|
2
|
+
|
|
3
|
+
/** The sorted column and its direction. `null` stands for "not sorted". */
|
|
4
|
+
export interface TableSort {
|
|
5
|
+
columnId: string;
|
|
6
|
+
direction: TableSortDirection;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export type AriaSort = "ascending" | "descending" | "none";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Next sort when a header is activated: unsorted -> ascending -> descending -> unsorted. Activating
|
|
13
|
+
* another column starts it at ascending.
|
|
14
|
+
*/
|
|
15
|
+
export function nextTableSort(current: TableSort | null, columnId: string): TableSort | null {
|
|
16
|
+
if (!current || current.columnId !== columnId) return { columnId, direction: "ascending" };
|
|
17
|
+
return current.direction === "ascending" ? { columnId, direction: "descending" } : null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** `aria-sort` value of a sortable header: only the sorted column reports a direction. */
|
|
21
|
+
export function ariaSortFor(current: TableSort | null, columnId: string): AriaSort {
|
|
22
|
+
return current?.columnId === columnId ? current.direction : "none";
|
|
23
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import type { ReactNode } from "react";
|
|
4
|
+
import { useUiStrings } from "../../i18n/index.js";
|
|
5
|
+
import { EmptyState } from "../../states/empty-state/empty-state.js";
|
|
6
|
+
import { cn } from "../../utils/cn.js";
|
|
7
|
+
import { CELL_PY } from "./cell-padding.js";
|
|
8
|
+
|
|
9
|
+
export interface TableEmptyProps {
|
|
10
|
+
/** Number of columns to span: the count of header cells. */
|
|
11
|
+
colSpan: number;
|
|
12
|
+
/** Defaults to the localized "No rows to show". */
|
|
13
|
+
title?: ReactNode;
|
|
14
|
+
description?: ReactNode;
|
|
15
|
+
icon?: ReactNode;
|
|
16
|
+
/** Call to action, e.g. a button that clears the filters. */
|
|
17
|
+
action?: ReactNode;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Single row that holds an `EmptyState` across every column. Put it in `TableBody` when there are no rows. */
|
|
22
|
+
export function TableEmpty({
|
|
23
|
+
colSpan,
|
|
24
|
+
title,
|
|
25
|
+
description,
|
|
26
|
+
icon,
|
|
27
|
+
action,
|
|
28
|
+
className,
|
|
29
|
+
}: TableEmptyProps) {
|
|
30
|
+
const strings = useUiStrings();
|
|
31
|
+
return (
|
|
32
|
+
<tr>
|
|
33
|
+
<td colSpan={colSpan} className={cn("p-0", className)}>
|
|
34
|
+
<EmptyState
|
|
35
|
+
title={title ?? strings.tableEmpty}
|
|
36
|
+
description={description}
|
|
37
|
+
icon={icon}
|
|
38
|
+
action={action}
|
|
39
|
+
/>
|
|
40
|
+
</td>
|
|
41
|
+
</tr>
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface TableLoadingProps {
|
|
46
|
+
/** Number of columns of the table. */
|
|
47
|
+
columns: number;
|
|
48
|
+
/** Placeholder rows. Default 5. */
|
|
49
|
+
rows?: number;
|
|
50
|
+
/** Text announced to screen readers. Defaults to the localized "Loading". */
|
|
51
|
+
label?: string;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const WIDTHS = ["w-3/4", "w-1/2", "w-2/3", "w-5/6"] as const;
|
|
55
|
+
|
|
56
|
+
/** Placeholder rows for the first load. The rows are decorative; one status region announces the load. */
|
|
57
|
+
export function TableLoading({ columns, rows = 5, label }: TableLoadingProps) {
|
|
58
|
+
const strings = useUiStrings();
|
|
59
|
+
return Array.from({ length: Math.max(0, rows) }, (_, row) => (
|
|
60
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder rows have no identity
|
|
61
|
+
<tr key={row} aria-hidden={row === 0 ? undefined : "true"} className="border-b-divider">
|
|
62
|
+
{Array.from({ length: Math.max(1, columns) }, (_, column) => (
|
|
63
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: placeholder cells have no identity
|
|
64
|
+
<td key={column} className={cn("px-4 align-middle @max-sm/table:px-2.5", CELL_PY)}>
|
|
65
|
+
{row === 0 && column === 0 ? (
|
|
66
|
+
<span role="status" className="sr-only">
|
|
67
|
+
{label ?? strings.loading}
|
|
68
|
+
</span>
|
|
69
|
+
) : null}
|
|
70
|
+
<span
|
|
71
|
+
aria-hidden="true"
|
|
72
|
+
className={cn(
|
|
73
|
+
"block h-3 animate-pulse rounded-xs bg-surface-2",
|
|
74
|
+
WIDTHS[(row + column) % WIDTHS.length],
|
|
75
|
+
)}
|
|
76
|
+
/>
|
|
77
|
+
</td>
|
|
78
|
+
))}
|
|
79
|
+
</tr>
|
|
80
|
+
));
|
|
81
|
+
}
|