@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
|
@@ -9,17 +9,17 @@ import { useUiStrings } from "../../i18n/index.js";
|
|
|
9
9
|
import { cn } from "../../utils/cn.js";
|
|
10
10
|
import { Slot } from "../../utils/slot.js";
|
|
11
11
|
const buttonVariantClasses = {
|
|
12
|
-
primary: "bg-accent text-on-accent font-bold hover:bg-accent-ink",
|
|
12
|
+
primary: "bg-accent text-on-accent font-bold hover:bg-accent-ink hover:text-surface",
|
|
13
13
|
secondary: "bg-surface-control text-ink shadow-control hover:bg-surface-2",
|
|
14
14
|
ghost: "bg-transparent text-ink-2 hover:bg-surface-2 hover:text-ink",
|
|
15
15
|
danger: "bg-danger-soft text-danger hover:bg-danger-soft/70"
|
|
16
16
|
};
|
|
17
17
|
const buttonSizeClasses = {
|
|
18
|
-
sm: "h-control-sm px-3 text-fs-
|
|
19
|
-
md: "h-control px-control-x text-fs-130",
|
|
18
|
+
sm: "h-control-sm px-3 text-fs-120 [&_svg]:size-3.5",
|
|
19
|
+
md: "h-control-md px-control-x text-fs-130",
|
|
20
20
|
lg: "h-control-lg px-control-x text-fs-140"
|
|
21
21
|
};
|
|
22
|
-
const baseClasses = "inline-flex min-w-0 max-w-full cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-button pressable focus-visible:focus-ring font-[650] no-underline disabled:cursor-not-allowed disabled:opacity-45 [&_svg]:shrink-0";
|
|
22
|
+
const baseClasses = "inline-flex min-w-0 max-w-full cursor-pointer items-center justify-center gap-1.5 whitespace-nowrap rounded-button pressable focus-visible:focus-ring font-[650] no-underline disabled:cursor-not-allowed disabled:opacity-45 aria-busy:cursor-progress aria-busy:scale-none! [&_svg]:shrink-0";
|
|
23
23
|
function buttonClasses({
|
|
24
24
|
variant = "secondary",
|
|
25
25
|
size = "md",
|
|
@@ -44,9 +44,11 @@ function Button({
|
|
|
44
44
|
asChild,
|
|
45
45
|
className,
|
|
46
46
|
children,
|
|
47
|
+
onClick,
|
|
47
48
|
...props
|
|
48
49
|
}) {
|
|
49
50
|
const strings = useUiStrings();
|
|
51
|
+
const busy = Boolean(loading) && !disabled;
|
|
50
52
|
const Comp = asChild ? Slot : "button";
|
|
51
53
|
const showLoadingLabel = loading && loadingLabel !== void 0 && !asChild;
|
|
52
54
|
const content = showLoadingLabel ? labelRun(loadingLabel) : asChild ? children : Children.map(children, labelRun);
|
|
@@ -55,9 +57,11 @@ function Button({
|
|
|
55
57
|
{
|
|
56
58
|
...asChild ? {} : { type: "button" },
|
|
57
59
|
"aria-busy": loading ? "true" : void 0,
|
|
58
|
-
disabled:
|
|
60
|
+
"aria-disabled": busy || void 0,
|
|
61
|
+
disabled,
|
|
59
62
|
className: buttonClasses({ variant, size, block, className }),
|
|
60
63
|
...props,
|
|
64
|
+
onClick: busy ? ignoreClick : onClick,
|
|
61
65
|
children: content
|
|
62
66
|
}
|
|
63
67
|
);
|
|
@@ -67,6 +71,9 @@ function Button({
|
|
|
67
71
|
/* @__PURE__ */ jsx("span", { role: "status", className: "sr-only", children: loading ? loadingLabel ?? strings.loading : null })
|
|
68
72
|
] });
|
|
69
73
|
}
|
|
74
|
+
function ignoreClick(event) {
|
|
75
|
+
event.preventDefault();
|
|
76
|
+
}
|
|
70
77
|
function labelRun(child) {
|
|
71
78
|
if (typeof child === "string" || typeof child === "number") {
|
|
72
79
|
return /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: child });
|
|
@@ -20,6 +20,11 @@ export interface ChipProps extends ComponentPropsWithRef<"span"> {
|
|
|
20
20
|
icon?: ReactNode;
|
|
21
21
|
/** Prefix `info`, `success`, `warning` and `danger` chips with their status glyph. */
|
|
22
22
|
statusIcon?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* A chip with `onClick` (or `role="button"`) is interactive and never shorter than 30px
|
|
25
|
+
* (`--control-height-sm`), the smallest hit area of the kit, whatever its `size`.
|
|
26
|
+
*/
|
|
27
|
+
onClick?: ComponentPropsWithRef<"span">["onClick"];
|
|
23
28
|
/** Appends a remove button that calls this. */
|
|
24
29
|
onRemove?: () => void;
|
|
25
30
|
/** Accessible name of the remove button. Defaults to the localized "Remove". */
|
package/dist/atoms/chip/chip.js
CHANGED
|
@@ -17,7 +17,7 @@ const chipToneClasses = {
|
|
|
17
17
|
};
|
|
18
18
|
const chipSizeClasses = {
|
|
19
19
|
md: "h-6 px-2.5 font-[650] text-fs-120",
|
|
20
|
-
sm: "h-auto min-h-5 px-1.5 py-px font-medium text-fs-
|
|
20
|
+
sm: "h-auto min-h-5 px-1.5 py-px font-medium text-fs-120 tabular-nums"
|
|
21
21
|
};
|
|
22
22
|
const statusTones = /* @__PURE__ */ new Set(["info", "success", "warning", "danger"]);
|
|
23
23
|
const builtinTones = new Set(Object.keys(chipToneClasses));
|
|
@@ -46,7 +46,7 @@ function Chip({
|
|
|
46
46
|
chipSizeClasses[size],
|
|
47
47
|
square ? "rounded-chip" : "rounded-badge",
|
|
48
48
|
custom ? "bg-(--tone-c-soft) text-(--tone-c-ink)" : chipToneClasses[tone] ?? chipToneClasses.neutral,
|
|
49
|
-
|
|
49
|
+
interactive ? "min-h-control-sm" : onRemove && "min-h-(--touch-target)",
|
|
50
50
|
onRemove && "pr-1",
|
|
51
51
|
className
|
|
52
52
|
),
|
|
@@ -61,7 +61,7 @@ function Chip({
|
|
|
61
61
|
type: "button",
|
|
62
62
|
"aria-label": removeLabel ?? strings.remove,
|
|
63
63
|
onClick: onRemove,
|
|
64
|
-
className: "grid size-
|
|
64
|
+
className: "-mr-[calc(0.5rem*var(--touch))] grid size-[calc(1rem+1.75rem*var(--touch))] shrink-0 cursor-pointer place-items-center self-center rounded-full text-current opacity-70 hover:opacity-100 focus-visible:focus-ring",
|
|
65
65
|
children: /* @__PURE__ */ jsx(X, { "aria-hidden": "true" })
|
|
66
66
|
}
|
|
67
67
|
) : null
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from "react";
|
|
2
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
export type DividerPart = "root" | "line" | "label";
|
|
4
|
+
export interface DividerProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
5
|
+
/** Text centered on the rule. Without it the divider is a plain hairline. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
8
|
+
classNames?: ClassNames<DividerPart>;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Horizontal rule, optionally carrying a short label ("or", "with your account"). It is a
|
|
12
|
+
* separator for assistive technology, so the label is read as part of the separator's name
|
|
13
|
+
* rather than as page content.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Divider({ children, className, classNames, ...props }: DividerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../utils/cn.js";
|
|
3
|
+
function Divider({ children, className, classNames, ...props }) {
|
|
4
|
+
const labelled = children !== void 0 && children !== null && children !== false;
|
|
5
|
+
const line = cn("h-px min-w-0 flex-1 bg-line", classNames?.line);
|
|
6
|
+
return (
|
|
7
|
+
// biome-ignore lint/a11y/useSemanticElements: an <hr> cannot carry the label between the two rules
|
|
8
|
+
/* @__PURE__ */ jsxs(
|
|
9
|
+
"div",
|
|
10
|
+
{
|
|
11
|
+
role: "separator",
|
|
12
|
+
"aria-orientation": "horizontal",
|
|
13
|
+
"aria-label": labelled && typeof children === "string" ? children : void 0,
|
|
14
|
+
...props,
|
|
15
|
+
className: cn("flex items-center gap-3 text-ink-3 text-meta", classNames?.root, className),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: line }),
|
|
18
|
+
labelled ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("shrink-0", classNames?.label), children }) : null,
|
|
19
|
+
labelled ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: line }) : null
|
|
20
|
+
]
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
Divider
|
|
27
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./divider.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./divider.js";
|
|
@@ -8,7 +8,7 @@ export interface IconButtonProps extends Omit<ComponentPropsWithRef<"button">, "
|
|
|
8
8
|
label: string;
|
|
9
9
|
variant?: ButtonVariant;
|
|
10
10
|
size?: IconButtonSize;
|
|
11
|
-
/** Swaps the icon for a spinner and
|
|
11
|
+
/** Swaps the icon for a spinner and makes the button busy like `Button` `loading`: it keeps focus, ignores clicks and announces the localized `loading` string. */
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
/** Render the child element (via Slot) instead of a `<button>`, e.g. a link wrapping the icon. */
|
|
14
14
|
asChild?: boolean;
|
|
@@ -5,7 +5,7 @@ import { Button } from "../button/button.js";
|
|
|
5
5
|
import { Spinner } from "../spinner/spinner.js";
|
|
6
6
|
const iconButtonSizeClasses = {
|
|
7
7
|
sm: "w-control-sm",
|
|
8
|
-
md: "w-control [&_svg]:size-4",
|
|
8
|
+
md: "w-control-md [&_svg]:size-4",
|
|
9
9
|
lg: "w-control-lg [&_svg]:size-4"
|
|
10
10
|
};
|
|
11
11
|
function IconButton({
|
package/dist/atoms/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./big-date/index.js";
|
|
|
4
4
|
export * from "./button/index.js";
|
|
5
5
|
export * from "./checkbox/index.js";
|
|
6
6
|
export * from "./chip/index.js";
|
|
7
|
+
export * from "./divider/index.js";
|
|
7
8
|
export * from "./due-chip/index.js";
|
|
8
9
|
export * from "./icon/index.js";
|
|
9
10
|
export * from "./icon-button/index.js";
|
package/dist/atoms/index.js
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./big-date/index.js";
|
|
|
4
4
|
export * from "./button/index.js";
|
|
5
5
|
export * from "./checkbox/index.js";
|
|
6
6
|
export * from "./chip/index.js";
|
|
7
|
+
export * from "./divider/index.js";
|
|
7
8
|
export * from "./due-chip/index.js";
|
|
8
9
|
export * from "./icon/index.js";
|
|
9
10
|
export * from "./icon-button/index.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Invisible 44px hit target for a small control under `data-density="touch"
|
|
3
|
-
*
|
|
4
|
-
* be `relative`.
|
|
2
|
+
* Invisible 44px hit target for a small control under `data-density="touch"` (and `"auto"` on a
|
|
3
|
+
* coarse pointer). It is a pseudo element of `--touch-target` size centred on the control, so the
|
|
4
|
+
* visual box and the layout never change; the control must be `relative`. Other densities size it
|
|
5
|
+
* to 0.
|
|
5
6
|
*/
|
|
6
|
-
export declare const touchHitArea = "relative
|
|
7
|
+
export declare const touchHitArea = "relative after:absolute after:top-1/2 after:left-1/2 after:size-(--touch-target) after:-translate-1/2 after:content-['']";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const touchHitArea = "relative
|
|
1
|
+
const touchHitArea = "relative after:absolute after:top-1/2 after:left-1/2 after:size-(--touch-target) after:-translate-1/2 after:content-['']";
|
|
2
2
|
export {
|
|
3
3
|
touchHitArea
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Meter, Progress, type ProgressPart, type ProgressProps } from "./progress.js";
|
|
1
|
+
export { Meter, Progress, type ProgressBuiltinTone, type ProgressPart, type ProgressProps, type ProgressTone, } from "./progress.js";
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef } from "react";
|
|
2
2
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
export type ProgressBuiltinTone = "accent" | "neutral" | "success" | "warning" | "danger" | "info";
|
|
4
|
+
/** A built-in tone, or the name of a tone declared in `tonePalettes`. */
|
|
5
|
+
export type ProgressTone = ProgressBuiltinTone | (string & {});
|
|
3
6
|
export type ProgressPart = "root" | "indicator";
|
|
4
7
|
export interface ProgressProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
5
8
|
value: number;
|
|
6
9
|
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
7
10
|
classNames?: ClassNames<ProgressPart>;
|
|
8
11
|
max?: number;
|
|
12
|
+
/** Colour of the indicator. Defaults to `"accent"`. The value is always exposed through the progressbar semantics, never by colour alone. */
|
|
13
|
+
tone?: ProgressTone;
|
|
9
14
|
/** Text announced as `aria-valuetext`; defaults to the rounded percentage. */
|
|
10
15
|
getValueLabel?: (value: number, max: number) => string;
|
|
11
16
|
}
|
|
12
|
-
export declare function Progress({ value, max: maxProp, getValueLabel, className, classNames, ...props }: ProgressProps): import("react").JSX.Element;
|
|
17
|
+
export declare function Progress({ value, max: maxProp, getValueLabel, tone, className, classNames, style, ...props }: ProgressProps): import("react").JSX.Element;
|
|
13
18
|
/** Thinner progress bar. */
|
|
14
19
|
export declare function Meter({ className, ...props }: ProgressProps): import("react").JSX.Element;
|
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
|
+
import { customToneStyle, isCustomTone } from "../../utils/tone.js";
|
|
5
|
+
const toneClasses = {
|
|
6
|
+
accent: "bg-accent",
|
|
7
|
+
neutral: "bg-ink-3",
|
|
8
|
+
success: "bg-success",
|
|
9
|
+
warning: "bg-warning",
|
|
10
|
+
danger: "bg-danger",
|
|
11
|
+
info: "bg-info"
|
|
12
|
+
};
|
|
13
|
+
const builtinTones = new Set(Object.keys(toneClasses));
|
|
4
14
|
const DEFAULT_MAX = 100;
|
|
5
15
|
function isValidMax(max) {
|
|
6
16
|
return typeof max === "number" && !Number.isNaN(max) && max > 0;
|
|
@@ -15,8 +25,10 @@ function Progress({
|
|
|
15
25
|
value,
|
|
16
26
|
max: maxProp = DEFAULT_MAX,
|
|
17
27
|
getValueLabel = defaultGetValueLabel,
|
|
28
|
+
tone = "accent",
|
|
18
29
|
className,
|
|
19
30
|
classNames,
|
|
31
|
+
style,
|
|
20
32
|
...props
|
|
21
33
|
}) {
|
|
22
34
|
const max = isValidMax(maxProp) ? maxProp : DEFAULT_MAX;
|
|
@@ -33,6 +45,8 @@ function Progress({
|
|
|
33
45
|
"data-state": state,
|
|
34
46
|
"data-value": current ?? void 0,
|
|
35
47
|
"data-max": max,
|
|
48
|
+
"data-tone": tone === "accent" ? void 0 : tone,
|
|
49
|
+
style: customToneStyle(tone, builtinTones, style),
|
|
36
50
|
className: cn("h-1.5 overflow-hidden rounded-pill bg-track", classNames?.root, className),
|
|
37
51
|
...props,
|
|
38
52
|
children: /* @__PURE__ */ jsx(
|
|
@@ -41,7 +55,11 @@ function Progress({
|
|
|
41
55
|
"data-state": state,
|
|
42
56
|
"data-value": current ?? void 0,
|
|
43
57
|
"data-max": max,
|
|
44
|
-
className: cn(
|
|
58
|
+
className: cn(
|
|
59
|
+
"block h-full transition-transform",
|
|
60
|
+
isCustomTone(tone, builtinTones) ? "bg-(--tone-c)" : toneClasses[tone] ?? toneClasses.accent,
|
|
61
|
+
classNames?.indicator
|
|
62
|
+
),
|
|
45
63
|
style: { transform: `translateX(-${100 - (current ?? 0) / max * 100}%)` }
|
|
46
64
|
}
|
|
47
65
|
)
|
|
@@ -27,7 +27,7 @@ function RadioGroup({ options, className, classNames, ...props }) {
|
|
|
27
27
|
{
|
|
28
28
|
htmlFor: id,
|
|
29
29
|
className: cn(
|
|
30
|
-
"flex cursor-pointer items-start gap-2 rounded-control border-divider p-2.5 text-body
|
|
30
|
+
"flex cursor-pointer items-start gap-2 rounded-control border-divider p-2.5 text-body min-h-(--touch-target) has-[[data-state=checked]]:border-accent has-[[data-state=checked]]:shadow-[inset_0_0_0_1px_var(--accent)]",
|
|
31
31
|
classNames?.option
|
|
32
32
|
),
|
|
33
33
|
children: [
|
|
@@ -1,14 +1,25 @@
|
|
|
1
|
-
import type { ComponentPropsWithRef } from "react";
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
2
|
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
3
|
import { type LedStatus } from "../led/index.js";
|
|
4
|
-
export type StatusPillPart = "root" | "dot" | "label";
|
|
4
|
+
export type StatusPillPart = "root" | "icon" | "dot" | "label";
|
|
5
5
|
export interface StatusPillProps extends Omit<ComponentPropsWithRef<"button">, "children" | "onSelect"> {
|
|
6
6
|
status: LedStatus;
|
|
7
7
|
label: string;
|
|
8
|
-
/**
|
|
8
|
+
/** Decorative leading icon, hidden from screen readers; the label still names the status. */
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
/** Shows the status dot. Defaults to `true` without an `icon` and `false` with one, where the icon carries the look; the label still names the status either way. */
|
|
11
|
+
dot?: boolean;
|
|
12
|
+
/** Hides the visible label when the surrounding container is narrower than 700 px (the status stays announced). Defaults to `false`: the label is always visible. */
|
|
13
|
+
collapseLabel?: boolean;
|
|
14
|
+
/** Makes the pill a button. Without it, and without `onClick`, the pill is a plain `span`. */
|
|
9
15
|
onSelect?: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Forces the element: `true` renders a button even without a handler, `false` a `span` even
|
|
18
|
+
* with one. Omitted, the pill is a button only when `onSelect` or `onClick` is given.
|
|
19
|
+
*/
|
|
20
|
+
interactive?: boolean;
|
|
10
21
|
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
11
22
|
classNames?: ClassNames<StatusPillPart>;
|
|
12
23
|
}
|
|
13
|
-
/** Pill showing a status LED and its label; the label
|
|
14
|
-
export declare function StatusPill({ status, label, onSelect, className, classNames, ...props }: StatusPillProps): import("react").JSX.Element;
|
|
24
|
+
/** Pill showing a status LED and its label; `collapseLabel` hides the label when the surrounding container is narrow. */
|
|
25
|
+
export declare function StatusPill({ status, label, icon, dot, collapseLabel, onSelect, interactive, className, classNames, ...props }: StatusPillProps): import("react").JSX.Element;
|
|
@@ -1,33 +1,58 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { cn } from "../../utils/cn.js";
|
|
4
4
|
import { Led } from "../led/index.js";
|
|
5
5
|
function StatusPill({
|
|
6
6
|
status,
|
|
7
7
|
label,
|
|
8
|
+
icon,
|
|
9
|
+
dot,
|
|
10
|
+
collapseLabel = false,
|
|
8
11
|
onSelect,
|
|
12
|
+
interactive,
|
|
9
13
|
className,
|
|
10
14
|
classNames,
|
|
11
15
|
...props
|
|
12
16
|
}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
className: cn(
|
|
21
|
-
"flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-badge border-divider bg-surface-control px-2.5 font-semibold text-fs-120 text-ink-2 hover:enabled:border-line-strong disabled:cursor-default",
|
|
22
|
-
classNames?.root,
|
|
23
|
-
className
|
|
24
|
-
),
|
|
25
|
-
children: [
|
|
26
|
-
/* @__PURE__ */ jsx(Led, { status, label, classNames: { dot: classNames?.dot } }),
|
|
27
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: cn("@max-[700px]:hidden", classNames?.label), children: label })
|
|
28
|
-
]
|
|
29
|
-
}
|
|
17
|
+
const isButton = interactive ?? (onSelect !== void 0 || props.onClick !== void 0);
|
|
18
|
+
const showDot = dot ?? icon == null;
|
|
19
|
+
const rootClass = cn(
|
|
20
|
+
"flex h-control-sm shrink-0 items-center gap-1.5 whitespace-nowrap rounded-badge border-divider bg-surface-control px-2.5 font-semibold text-fs-120 text-ink-2",
|
|
21
|
+
isButton && "hover:enabled:border-line-strong disabled:cursor-default",
|
|
22
|
+
classNames?.root,
|
|
23
|
+
className
|
|
30
24
|
);
|
|
25
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
+
icon ? /* @__PURE__ */ jsx(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
"aria-hidden": "true",
|
|
30
|
+
className: cn("inline-flex shrink-0 [&_svg]:size-3.5", classNames?.icon),
|
|
31
|
+
children: icon
|
|
32
|
+
}
|
|
33
|
+
) : null,
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
Led,
|
|
36
|
+
{
|
|
37
|
+
status,
|
|
38
|
+
label,
|
|
39
|
+
classNames: { dot: cn(!showDot && "hidden", classNames?.dot) }
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
"span",
|
|
44
|
+
{
|
|
45
|
+
"aria-hidden": "true",
|
|
46
|
+
className: cn(collapseLabel && "@max-[700px]:hidden", classNames?.label),
|
|
47
|
+
children: label
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
] });
|
|
51
|
+
if (!isButton) {
|
|
52
|
+
const { ref, type: _type, disabled: _disabled, onClick: _onClick, ...rest } = props;
|
|
53
|
+
return /* @__PURE__ */ jsx("span", { ...rest, ref, className: rootClass, children: content });
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick: onSelect, ...props, className: rootClass, children: content });
|
|
31
56
|
}
|
|
32
57
|
export {
|
|
33
58
|
StatusPill
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
2
|
+
import type { AuthLook } from "./look.js";
|
|
3
|
+
import { type AuthState } from "./model.js";
|
|
4
|
+
export interface AuthIllustrationProps extends Omit<ComponentPropsWithoutRef<"div">, "children"> {
|
|
5
|
+
/**
|
|
6
|
+
* The look, a component from its own entry (`Stack` from `@jcsoftdev/ui/auth/stack`, and so on).
|
|
7
|
+
* Defaults to `Slabs`; looks you do not pass stay out of your bundle. For a string `variant`
|
|
8
|
+
* use `AuthIllustrationAny` from `@jcsoftdev/ui/auth/looks`.
|
|
9
|
+
*/
|
|
10
|
+
look?: AuthLook;
|
|
11
|
+
/** What the screen is doing. Inside an `AuthLayout` it follows the layout's state. */
|
|
12
|
+
state?: AuthState;
|
|
13
|
+
/** Fill of the whole form, 0 to 1. Inside an `AuthLayout` it follows the layout's progress. */
|
|
14
|
+
progress?: number;
|
|
15
|
+
/** Index of the portal being used (0 to 2); that slab rises above the others. */
|
|
16
|
+
activeIndex?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Accessible name of the image. Without it the illustration is decorative and hidden from
|
|
19
|
+
* assistive technology. Ignored by text looks (`Statement`): their text is the content, so they
|
|
20
|
+
* are never an `img` and never hidden.
|
|
21
|
+
*/
|
|
22
|
+
label?: string;
|
|
23
|
+
/** Text looks (`Statement`) only: the headline (a string animates word by word). Defaults to the UI string `welcomeBack`. */
|
|
24
|
+
headline?: ReactNode;
|
|
25
|
+
/** Text looks only: a supporting line under the headline. */
|
|
26
|
+
caption?: ReactNode;
|
|
27
|
+
/** Text looks only: content beside the arrow pill, such as a link. */
|
|
28
|
+
action?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Isometric illustration of the three portals that reacts to the sign-in state with CSS
|
|
32
|
+
* transitions only. Colours come from the theme tokens (`--accent`, `--surface`, `--ink`), so dark
|
|
33
|
+
* mode and every accent apply on their own. With reduced motion it rests assembled and still.
|
|
34
|
+
*/
|
|
35
|
+
export declare function AuthIllustration({ look: Look, state: stateProp, progress: progressProp, activeIndex: activeIndexProp, label, headline, caption, action, className, ...props }: AuthIllustrationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
useEffect,
|
|
5
|
+
useId,
|
|
6
|
+
useRef,
|
|
7
|
+
useState
|
|
8
|
+
} from "react";
|
|
9
|
+
import { cn } from "../../utils/cn.js";
|
|
10
|
+
import { useOptionalAuth } from "../internal/auth-context.js";
|
|
11
|
+
import { AuthStyles } from "../internal/auth-styles.js";
|
|
12
|
+
import { Slabs } from "../slabs/slabs.js";
|
|
13
|
+
import { clamp01, ERROR_HOLD_MS, shownState } from "./model.js";
|
|
14
|
+
import { useArtPointer } from "./use-art-pointer.js";
|
|
15
|
+
function AuthIllustration({
|
|
16
|
+
look: Look = Slabs,
|
|
17
|
+
state: stateProp,
|
|
18
|
+
progress: progressProp,
|
|
19
|
+
activeIndex: activeIndexProp,
|
|
20
|
+
label,
|
|
21
|
+
headline,
|
|
22
|
+
caption,
|
|
23
|
+
action,
|
|
24
|
+
className,
|
|
25
|
+
...props
|
|
26
|
+
}) {
|
|
27
|
+
const auth = useOptionalAuth();
|
|
28
|
+
const uid = useId().replace(/[^a-zA-Z0-9_-]/g, "");
|
|
29
|
+
const state = stateProp ?? auth?.state ?? "idle";
|
|
30
|
+
const progress = clamp01(progressProp ?? auth?.progress ?? 0);
|
|
31
|
+
const activeIndex = activeIndexProp ?? auth?.activeIndex ?? 0;
|
|
32
|
+
const ref = useRef(null);
|
|
33
|
+
useArtPointer(ref);
|
|
34
|
+
const [errorHeld, setErrorHeld] = useState(false);
|
|
35
|
+
useEffect(() => {
|
|
36
|
+
setErrorHeld(false);
|
|
37
|
+
if (state !== "error") return;
|
|
38
|
+
const timer = setTimeout(() => setErrorHeld(true), ERROR_HOLD_MS);
|
|
39
|
+
return () => clearTimeout(timer);
|
|
40
|
+
}, [state]);
|
|
41
|
+
const shown = shownState(state, errorHeld);
|
|
42
|
+
return /* @__PURE__ */ jsxs(
|
|
43
|
+
"div",
|
|
44
|
+
{
|
|
45
|
+
...props,
|
|
46
|
+
ref,
|
|
47
|
+
...Look.text ? {} : label ? { role: "img", "aria-label": label } : { "aria-hidden": true },
|
|
48
|
+
"data-state": shown,
|
|
49
|
+
"data-panel": auth?.panel,
|
|
50
|
+
"data-variant": Look.variant,
|
|
51
|
+
className: cn("ui-auth-art @container/art w-full min-w-0", className),
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ jsx(AuthStyles, {}),
|
|
54
|
+
/* @__PURE__ */ jsx(
|
|
55
|
+
Look,
|
|
56
|
+
{
|
|
57
|
+
state: shown,
|
|
58
|
+
progress,
|
|
59
|
+
activeIndex,
|
|
60
|
+
uid,
|
|
61
|
+
headline,
|
|
62
|
+
caption,
|
|
63
|
+
action
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
]
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
export {
|
|
71
|
+
AuthIllustration
|
|
72
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from "react";
|
|
2
|
+
import type { AuthState } from "./model.js";
|
|
3
|
+
/** What every illustration look receives. State and progress come already clamped. */
|
|
4
|
+
export interface AuthVariantProps {
|
|
5
|
+
state: AuthState;
|
|
6
|
+
/** Fill of the whole form, 0 to 1. */
|
|
7
|
+
progress: number;
|
|
8
|
+
/** Index of the portal in use (0 to 2). */
|
|
9
|
+
activeIndex: number;
|
|
10
|
+
/** Unique per rendered illustration; use it to prefix SVG ids (patterns, gradients, clip paths). */
|
|
11
|
+
uid: string;
|
|
12
|
+
/** Text looks only (`statement`): the main line; a string animates word by word. */
|
|
13
|
+
headline?: ReactNode;
|
|
14
|
+
/** Text looks only: a supporting line under the headline. */
|
|
15
|
+
caption?: ReactNode;
|
|
16
|
+
/** Text looks only: content placed beside the arrow pill, such as a link. */
|
|
17
|
+
action?: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* A look is a component with {@link AuthVariantProps}. It renders inside a `@container/art` element,
|
|
21
|
+
* so it adapts to the width it is given with `@sm/art:` classes or `@container art (min-width: ...)`
|
|
22
|
+
* rules, and it reads `data-state` from the wrapper for state-driven CSS. Two optional static
|
|
23
|
+
* properties describe it to `AuthIllustration` without a registry: `variant` is the name written
|
|
24
|
+
* to `data-variant`, and `text` marks a look made of text people read, which is then not hidden
|
|
25
|
+
* from assistive technology.
|
|
26
|
+
*/
|
|
27
|
+
export type AuthLook = ComponentType<AuthVariantProps> & {
|
|
28
|
+
variant?: string;
|
|
29
|
+
text?: boolean;
|
|
30
|
+
};
|
|
File without changes
|