@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,133 @@
|
|
|
1
|
+
/** What the sign-in screen is doing. It is the only input of the illustration besides `progress`. */
|
|
2
|
+
export type AuthState = "idle" | "typing" | "password" | "error" | "success";
|
|
3
|
+
export declare const AUTH_STATES: readonly AuthState[];
|
|
4
|
+
export declare const clamp01: (value: number) => number;
|
|
5
|
+
/** `progress` is the fill of the whole form: the identifier is the first half, the password the second. */
|
|
6
|
+
export declare const IDENTIFIER_SHARE = 0.5;
|
|
7
|
+
/**
|
|
8
|
+
* How far the three slabs sit apart: 0 is assembled, 1 is the loose resting layout. The slabs
|
|
9
|
+
* drift together as the form fills (first the identifier, then the password), fly apart on an
|
|
10
|
+
* error and lock together on success.
|
|
11
|
+
*/
|
|
12
|
+
export declare function slabSpread(state: AuthState, progress: number): number;
|
|
13
|
+
export declare const SLAB_COUNT = 3;
|
|
14
|
+
export interface SlabPlacement {
|
|
15
|
+
x: number;
|
|
16
|
+
y: number;
|
|
17
|
+
lift: number;
|
|
18
|
+
}
|
|
19
|
+
/** Position and height of one slab. The slab at `activeIndex` rises a little above the rest. */
|
|
20
|
+
export declare function slabPlacement(index: number, spread: number, activeIndex: number): SlabPlacement;
|
|
21
|
+
export interface SparkVector {
|
|
22
|
+
dx: number;
|
|
23
|
+
dy: number;
|
|
24
|
+
}
|
|
25
|
+
/** Offsets of the success burst. Deterministic, so server and client render the same markup. */
|
|
26
|
+
export declare function sparkVectors(count?: number): SparkVector[];
|
|
27
|
+
/** How long an error stays on screen before the illustration settles back to the password state. */
|
|
28
|
+
export declare const ERROR_HOLD_MS = 1100;
|
|
29
|
+
/** The state the art shows: an error that has been held long enough reads as `password` again. */
|
|
30
|
+
export declare function shownState(state: AuthState, errorHeld: boolean): AuthState;
|
|
31
|
+
/** Characters of the identifier at which its half of the form reads full; one keystroke moves `progress` by 1/(2 x this). */
|
|
32
|
+
export declare const KEYSTROKES_PER_FIELD = 10;
|
|
33
|
+
/**
|
|
34
|
+
* Fill of the whole form: the identifier grows its half by length, the password adds its half in
|
|
35
|
+
* one step as soon as it is not empty. The password's length never reaches `progress`, because
|
|
36
|
+
* `progress` is written to the DOM (styles, classes) where session-replay tools do not mask it.
|
|
37
|
+
*/
|
|
38
|
+
export declare function formProgress(identifierLength: number, passwordFilled: boolean): number;
|
|
39
|
+
export interface Keystroke {
|
|
40
|
+
/** Keystrokes so far across both fields. */
|
|
41
|
+
count: number;
|
|
42
|
+
/** Which of the three pieces reacts to this keystroke. */
|
|
43
|
+
target: number;
|
|
44
|
+
/**
|
|
45
|
+
* Alternates every time the same piece reacts again, so CSS can swap between two identical
|
|
46
|
+
* keyframes and restart the animation without JavaScript timers.
|
|
47
|
+
*/
|
|
48
|
+
phase: 0 | 1;
|
|
49
|
+
}
|
|
50
|
+
/** The keystroke a `progress` value stands for. */
|
|
51
|
+
export declare function keystroke(progress: number, pieces?: number): Keystroke;
|
|
52
|
+
export interface PointerOffset {
|
|
53
|
+
x: number;
|
|
54
|
+
y: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Where a pointer is relative to a box, as -1 to 1 on each axis from its center (clamped, so a
|
|
58
|
+
* pointer far over the form still reads as "all the way to that side").
|
|
59
|
+
*/
|
|
60
|
+
export declare function pointerOffset(point: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
}, box: {
|
|
64
|
+
left: number;
|
|
65
|
+
top: number;
|
|
66
|
+
width: number;
|
|
67
|
+
height: number;
|
|
68
|
+
}): PointerOffset;
|
|
69
|
+
/** Screen position of a point in isometric space: `u` runs right-down, `v` left-down, `z` up. */
|
|
70
|
+
export declare function isoPoint(u: number, v: number, z?: number): {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
};
|
|
74
|
+
export interface IsoBox {
|
|
75
|
+
top: string;
|
|
76
|
+
/** Face along the front-left edge (`v` at its maximum). */
|
|
77
|
+
left: string;
|
|
78
|
+
/** Face along the front-right edge (`u` at its maximum). */
|
|
79
|
+
right: string;
|
|
80
|
+
}
|
|
81
|
+
/** The three visible faces of a `w` by `d` by `h` box standing on the origin, centred on it. */
|
|
82
|
+
export declare function isoBox(w: number, d: number, h: number): IsoBox;
|
|
83
|
+
export interface StackBook {
|
|
84
|
+
/** Footprint along `u` and `v`, and thickness. */
|
|
85
|
+
w: number;
|
|
86
|
+
d: number;
|
|
87
|
+
h: number;
|
|
88
|
+
/** Offset from the tower's axis, in isometric units, so the pile looks hand stacked. */
|
|
89
|
+
du: number;
|
|
90
|
+
dv: number;
|
|
91
|
+
/** Colour role, 0 to 3. */
|
|
92
|
+
tone: number;
|
|
93
|
+
}
|
|
94
|
+
/** The books of the tower from the bottom up. Narrow containers show only the first ones. */
|
|
95
|
+
export declare const STACK_BOOKS: readonly StackBook[];
|
|
96
|
+
/** How many books a container shows: fewer when it is narrow. */
|
|
97
|
+
export declare const STACK_COUNTS: readonly [4, 5, 6];
|
|
98
|
+
export type StackCount = (typeof STACK_COUNTS)[number];
|
|
99
|
+
/**
|
|
100
|
+
* Books resting in a tower of `count`: the foundation is always there, the rest land one by one
|
|
101
|
+
* as the form fills, and all of them are down on success.
|
|
102
|
+
*/
|
|
103
|
+
export declare function stackPlaced(state: AuthState, progress: number, count: number): number;
|
|
104
|
+
export interface StackSlot {
|
|
105
|
+
/** Screen offset of the book's ground centre from the tower's base. */
|
|
106
|
+
x: number;
|
|
107
|
+
y: number;
|
|
108
|
+
}
|
|
109
|
+
/** Where each book sits, from its offsets and the thickness of the books under it. */
|
|
110
|
+
export declare function stackSlots(books?: readonly StackBook[]): StackSlot[];
|
|
111
|
+
/** Top centre of the tower of `count` books, where the success flag is planted. */
|
|
112
|
+
export declare function stackTop(count: number, books?: readonly StackBook[]): StackSlot;
|
|
113
|
+
/** Tiles per side of the mosaic floor; its container picks one by width. */
|
|
114
|
+
export declare const MOSAIC_SIZES: readonly [4, 5, 6];
|
|
115
|
+
export type MosaicSize = (typeof MOSAIC_SIZES)[number];
|
|
116
|
+
/** Diagonals of an `n` by `n` floor that are lit: they fill from the back corner as the form fills. */
|
|
117
|
+
export declare function mosaicFilled(state: AuthState, progress: number, n: number): number;
|
|
118
|
+
export interface MosaicTile {
|
|
119
|
+
row: number;
|
|
120
|
+
col: number;
|
|
121
|
+
/** Diagonal from the back corner, 0 to 2n-2: the fill and the error sweep follow it. */
|
|
122
|
+
diagonal: number;
|
|
123
|
+
/** Steps from the centre: the success ripple follows it. */
|
|
124
|
+
ring: number;
|
|
125
|
+
}
|
|
126
|
+
export declare function mosaicTiles(n: number): MosaicTile[];
|
|
127
|
+
/** Row and column of the tile carrying each portal's glyph, for each floor size. */
|
|
128
|
+
export declare const MOSAIC_GLYPH_TILES: Readonly<Record<MosaicSize, readonly (readonly [number, number])[]>>;
|
|
129
|
+
/** The tile that glints on a keystroke: it jumps around the floor instead of marching in order. */
|
|
130
|
+
export declare function mosaicGlint(count: number, n: number): number;
|
|
131
|
+
/** Lamps along the character's board; they fill with progress. */
|
|
132
|
+
export declare const BOARD_LIGHTS = 5;
|
|
133
|
+
export declare function boardLit(state: AuthState, progress: number): number;
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
const AUTH_STATES = [
|
|
2
|
+
"idle",
|
|
3
|
+
"typing",
|
|
4
|
+
"password",
|
|
5
|
+
"error",
|
|
6
|
+
"success"
|
|
7
|
+
];
|
|
8
|
+
const clamp01 = (value) => Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0;
|
|
9
|
+
const IDENTIFIER_SHARE = 0.5;
|
|
10
|
+
const SPREAD = { idle: 0.85, error: 1.35, success: 0 };
|
|
11
|
+
const TYPING = { start: 0.65, end: 0.35 };
|
|
12
|
+
const PASSWORD = { start: 0.22, end: 0.05 };
|
|
13
|
+
const lerp = (from, to, t) => from + (to - from) * clamp01(t);
|
|
14
|
+
function slabSpread(state, progress) {
|
|
15
|
+
const p = clamp01(progress);
|
|
16
|
+
switch (state) {
|
|
17
|
+
case "typing":
|
|
18
|
+
return lerp(TYPING.start, TYPING.end, p / IDENTIFIER_SHARE);
|
|
19
|
+
case "password":
|
|
20
|
+
return lerp(PASSWORD.start, PASSWORD.end, (p - IDENTIFIER_SHARE) / (1 - IDENTIFIER_SHARE));
|
|
21
|
+
default:
|
|
22
|
+
return SPREAD[state];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
const SLAB_COUNT = 3;
|
|
26
|
+
const SLAB_BASE = { x: 277, y: 149 };
|
|
27
|
+
const SLAB_ASSEMBLED = [
|
|
28
|
+
{ x: 0, y: 0 },
|
|
29
|
+
{ x: 86.6, y: 50 },
|
|
30
|
+
{ x: 0, y: 100 }
|
|
31
|
+
];
|
|
32
|
+
const SLAB_TRAVEL = [
|
|
33
|
+
{ x: -120, y: 14, lift: 34 },
|
|
34
|
+
{ x: 104, y: -44, lift: 62 },
|
|
35
|
+
{ x: 14, y: 78, lift: 14 }
|
|
36
|
+
];
|
|
37
|
+
const ACTIVE_LIFT = 20;
|
|
38
|
+
const round = (value) => Math.round(value * 100) / 100;
|
|
39
|
+
function slabPlacement(index, spread, activeIndex) {
|
|
40
|
+
const assembled = SLAB_ASSEMBLED[index];
|
|
41
|
+
const travel = SLAB_TRAVEL[index];
|
|
42
|
+
if (!assembled || !travel) return { x: SLAB_BASE.x, y: SLAB_BASE.y, lift: 0 };
|
|
43
|
+
return {
|
|
44
|
+
x: round(SLAB_BASE.x + assembled.x + travel.x * spread),
|
|
45
|
+
y: round(SLAB_BASE.y + assembled.y + travel.y * spread),
|
|
46
|
+
lift: round(travel.lift * spread + (index === activeIndex ? ACTIVE_LIFT : 0))
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function sparkVectors(count = 12) {
|
|
50
|
+
return Array.from({ length: count }, (_, n) => {
|
|
51
|
+
const angle = n / count * Math.PI * 2;
|
|
52
|
+
const distance = 90 + n * 37 % 90;
|
|
53
|
+
return { dx: round(Math.cos(angle) * distance), dy: round(Math.sin(angle) * distance * 0.7) };
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
const ERROR_HOLD_MS = 1100;
|
|
57
|
+
function shownState(state, errorHeld) {
|
|
58
|
+
return state === "error" && errorHeld ? "password" : state;
|
|
59
|
+
}
|
|
60
|
+
const KEYSTROKES_PER_FIELD = 10;
|
|
61
|
+
function formProgress(identifierLength, passwordFilled) {
|
|
62
|
+
const identifier = Math.min(1, Math.max(0, identifierLength) / KEYSTROKES_PER_FIELD);
|
|
63
|
+
return (identifier + (passwordFilled ? 1 : 0)) / 2;
|
|
64
|
+
}
|
|
65
|
+
function keystroke(progress, pieces = 3) {
|
|
66
|
+
const count = Math.round(clamp01(progress) * KEYSTROKES_PER_FIELD * 2);
|
|
67
|
+
return { count, target: count % pieces, phase: Math.floor(count / pieces) % 2 };
|
|
68
|
+
}
|
|
69
|
+
function pointerOffset(point, box) {
|
|
70
|
+
const axis = (value, start, size) => size > 0 ? Math.round(Math.max(-1, Math.min(1, (value - start - size / 2) / (size / 2))) * 1e3) / 1e3 : 0;
|
|
71
|
+
return { x: axis(point.x, box.left, box.width), y: axis(point.y, box.top, box.height) };
|
|
72
|
+
}
|
|
73
|
+
const ISO_X = 0.866;
|
|
74
|
+
const ISO_Y = 0.5;
|
|
75
|
+
function isoPoint(u, v, z = 0) {
|
|
76
|
+
return { x: round(ISO_X * (u - v)), y: round(ISO_Y * (u + v) - z) };
|
|
77
|
+
}
|
|
78
|
+
const pathOf = (points) => `M${points.map((p) => `${p.x} ${p.y}`).join("L")}Z`;
|
|
79
|
+
function isoBox(w, d, h) {
|
|
80
|
+
const [u0, u1, v0, v1] = [-w / 2, w / 2, -d / 2, d / 2];
|
|
81
|
+
return {
|
|
82
|
+
top: pathOf([
|
|
83
|
+
isoPoint(u0, v0, h),
|
|
84
|
+
isoPoint(u1, v0, h),
|
|
85
|
+
isoPoint(u1, v1, h),
|
|
86
|
+
isoPoint(u0, v1, h)
|
|
87
|
+
]),
|
|
88
|
+
left: pathOf([
|
|
89
|
+
isoPoint(u0, v1, h),
|
|
90
|
+
isoPoint(u1, v1, h),
|
|
91
|
+
isoPoint(u1, v1, 0),
|
|
92
|
+
isoPoint(u0, v1, 0)
|
|
93
|
+
]),
|
|
94
|
+
right: pathOf([
|
|
95
|
+
isoPoint(u1, v0, h),
|
|
96
|
+
isoPoint(u1, v1, h),
|
|
97
|
+
isoPoint(u1, v1, 0),
|
|
98
|
+
isoPoint(u1, v0, 0)
|
|
99
|
+
])
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const STACK_BOOKS = [
|
|
103
|
+
{ w: 178, d: 128, h: 30, du: 0, dv: 0, tone: 0 },
|
|
104
|
+
{ w: 152, d: 112, h: 22, du: 8, dv: -6, tone: 1 },
|
|
105
|
+
{ w: 164, d: 104, h: 26, du: -10, dv: 6, tone: 2 },
|
|
106
|
+
{ w: 140, d: 112, h: 20, du: 6, dv: 4, tone: 3 },
|
|
107
|
+
{ w: 150, d: 98, h: 24, du: -6, dv: -8, tone: 1 },
|
|
108
|
+
{ w: 128, d: 100, h: 20, du: 4, dv: 6, tone: 0 }
|
|
109
|
+
];
|
|
110
|
+
const STACK_COUNTS = [4, 5, 6];
|
|
111
|
+
function stackPlaced(state, progress, count) {
|
|
112
|
+
if (state === "success") return count;
|
|
113
|
+
return Math.min(count, 1 + Math.floor(clamp01(progress) * (count - 1) + 1e-9));
|
|
114
|
+
}
|
|
115
|
+
function stackSlots(books = STACK_BOOKS) {
|
|
116
|
+
let z = 0;
|
|
117
|
+
return books.map((book) => {
|
|
118
|
+
const at = isoPoint(book.du, book.dv, z);
|
|
119
|
+
z += book.h;
|
|
120
|
+
return at;
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
function stackTop(count, books = STACK_BOOKS) {
|
|
124
|
+
const shown = books.slice(0, count);
|
|
125
|
+
const last = shown[shown.length - 1];
|
|
126
|
+
if (!last) return { x: 0, y: 0 };
|
|
127
|
+
const z = shown.reduce((sum, book) => sum + book.h, 0);
|
|
128
|
+
return isoPoint(last.du, last.dv, z);
|
|
129
|
+
}
|
|
130
|
+
const MOSAIC_SIZES = [4, 5, 6];
|
|
131
|
+
function mosaicFilled(state, progress, n) {
|
|
132
|
+
const diagonals = n * 2 - 1;
|
|
133
|
+
if (state === "success") return diagonals;
|
|
134
|
+
return Math.min(diagonals, Math.floor(clamp01(progress) * diagonals + 1e-9));
|
|
135
|
+
}
|
|
136
|
+
function mosaicTiles(n) {
|
|
137
|
+
const middle = (n - 1) / 2;
|
|
138
|
+
return Array.from({ length: n * n }, (_, k) => {
|
|
139
|
+
const row = Math.floor(k / n);
|
|
140
|
+
const col = k % n;
|
|
141
|
+
return {
|
|
142
|
+
row,
|
|
143
|
+
col,
|
|
144
|
+
diagonal: row + col,
|
|
145
|
+
ring: Math.round(Math.abs(row - middle) + Math.abs(col - middle))
|
|
146
|
+
};
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
const MOSAIC_GLYPH_TILES = {
|
|
150
|
+
4: [
|
|
151
|
+
[1, 0],
|
|
152
|
+
[0, 2],
|
|
153
|
+
[2, 3]
|
|
154
|
+
],
|
|
155
|
+
5: [
|
|
156
|
+
[1, 1],
|
|
157
|
+
[0, 3],
|
|
158
|
+
[3, 3]
|
|
159
|
+
],
|
|
160
|
+
6: [
|
|
161
|
+
[1, 1],
|
|
162
|
+
[1, 4],
|
|
163
|
+
[4, 3]
|
|
164
|
+
]
|
|
165
|
+
};
|
|
166
|
+
function mosaicGlint(count, n) {
|
|
167
|
+
return count > 0 ? count * 7 % (n * n) : -1;
|
|
168
|
+
}
|
|
169
|
+
const BOARD_LIGHTS = 5;
|
|
170
|
+
function boardLit(state, progress) {
|
|
171
|
+
if (state === "success") return BOARD_LIGHTS;
|
|
172
|
+
return Math.min(BOARD_LIGHTS, Math.floor(clamp01(progress) * BOARD_LIGHTS + 1e-9));
|
|
173
|
+
}
|
|
174
|
+
export {
|
|
175
|
+
AUTH_STATES,
|
|
176
|
+
BOARD_LIGHTS,
|
|
177
|
+
ERROR_HOLD_MS,
|
|
178
|
+
IDENTIFIER_SHARE,
|
|
179
|
+
KEYSTROKES_PER_FIELD,
|
|
180
|
+
MOSAIC_GLYPH_TILES,
|
|
181
|
+
MOSAIC_SIZES,
|
|
182
|
+
SLAB_COUNT,
|
|
183
|
+
STACK_BOOKS,
|
|
184
|
+
STACK_COUNTS,
|
|
185
|
+
boardLit,
|
|
186
|
+
clamp01,
|
|
187
|
+
formProgress,
|
|
188
|
+
isoBox,
|
|
189
|
+
isoPoint,
|
|
190
|
+
keystroke,
|
|
191
|
+
mosaicFilled,
|
|
192
|
+
mosaicGlint,
|
|
193
|
+
mosaicTiles,
|
|
194
|
+
pointerOffset,
|
|
195
|
+
shownState,
|
|
196
|
+
slabPlacement,
|
|
197
|
+
slabSpread,
|
|
198
|
+
sparkVectors,
|
|
199
|
+
stackPlaced,
|
|
200
|
+
stackSlots,
|
|
201
|
+
stackTop
|
|
202
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Writes where the pointer is, relative to the art, as `--px` and `--py` (-1 to 1) on the art
|
|
4
|
+
* element. It listens on the surrounding `AuthLayout` so the art also reacts while the pointer is
|
|
5
|
+
* over the form. One write per animation frame at most; nothing runs for touch, coarse pointers or
|
|
6
|
+
* reduced motion, and it follows those settings when they change while the page is open (the art
|
|
7
|
+
* recentres when the parallax switches off). The listeners go away with the component.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useArtPointer(ref: RefObject<HTMLElement | null>): void;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { pointerOffset } from "./model.js";
|
|
4
|
+
const FINE_POINTER = "(hover: hover) and (pointer: fine)";
|
|
5
|
+
const REDUCED_MOTION = "(prefers-reduced-motion: reduce)";
|
|
6
|
+
function useArtPointer(ref) {
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const art = ref.current;
|
|
9
|
+
if (!art || typeof window.matchMedia !== "function") return;
|
|
10
|
+
const fine = window.matchMedia(FINE_POINTER);
|
|
11
|
+
const reduced = window.matchMedia(REDUCED_MOTION);
|
|
12
|
+
const area = art.closest("[data-layout]") ?? art;
|
|
13
|
+
let frame = 0;
|
|
14
|
+
let point = null;
|
|
15
|
+
let listening = false;
|
|
16
|
+
const write = () => {
|
|
17
|
+
frame = 0;
|
|
18
|
+
if (!point) {
|
|
19
|
+
art.style.setProperty("--px", "0");
|
|
20
|
+
art.style.setProperty("--py", "0");
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const offset = pointerOffset(point, art.getBoundingClientRect());
|
|
24
|
+
art.style.setProperty("--px", String(offset.x));
|
|
25
|
+
art.style.setProperty("--py", String(offset.y));
|
|
26
|
+
};
|
|
27
|
+
const schedule = () => {
|
|
28
|
+
if (!frame) frame = requestAnimationFrame(write);
|
|
29
|
+
};
|
|
30
|
+
const move = (event) => {
|
|
31
|
+
if (event.pointerType !== "mouse" && event.pointerType !== "pen") return;
|
|
32
|
+
point = { x: event.clientX, y: event.clientY };
|
|
33
|
+
schedule();
|
|
34
|
+
};
|
|
35
|
+
const leave = () => {
|
|
36
|
+
point = null;
|
|
37
|
+
schedule();
|
|
38
|
+
};
|
|
39
|
+
const stop = () => {
|
|
40
|
+
if (!listening) return;
|
|
41
|
+
listening = false;
|
|
42
|
+
area.removeEventListener("pointermove", move);
|
|
43
|
+
area.removeEventListener("pointerleave", leave);
|
|
44
|
+
if (frame) cancelAnimationFrame(frame);
|
|
45
|
+
frame = 0;
|
|
46
|
+
point = null;
|
|
47
|
+
art.style.removeProperty("--px");
|
|
48
|
+
art.style.removeProperty("--py");
|
|
49
|
+
};
|
|
50
|
+
const sync = () => {
|
|
51
|
+
if (!fine.matches || reduced.matches) return stop();
|
|
52
|
+
if (listening) return;
|
|
53
|
+
listening = true;
|
|
54
|
+
area.addEventListener("pointermove", move, { passive: true });
|
|
55
|
+
area.addEventListener("pointerleave", leave, { passive: true });
|
|
56
|
+
};
|
|
57
|
+
sync();
|
|
58
|
+
fine.addEventListener("change", sync);
|
|
59
|
+
reduced.addEventListener("change", sync);
|
|
60
|
+
return () => {
|
|
61
|
+
fine.removeEventListener("change", sync);
|
|
62
|
+
reduced.removeEventListener("change", sync);
|
|
63
|
+
stop();
|
|
64
|
+
};
|
|
65
|
+
}, [ref]);
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
useArtPointer
|
|
69
|
+
};
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
import { type AuthIllustrationProps } from "../auth-illustration/auth-illustration.js";
|
|
4
|
+
import type { AuthLook } from "../auth-illustration/look.js";
|
|
5
|
+
import type { AuthState } from "../auth-illustration/model.js";
|
|
6
|
+
import { type AuthContextValue, type AuthPanel } from "../internal/auth-context.js";
|
|
7
|
+
export type AuthLayoutKind = "split" | "split-reverse" | "centered";
|
|
8
|
+
export type AuthLayoutPart = "root" | "content" | "brand" | "art" | "panel" | "footer";
|
|
9
|
+
/** State shared by the illustration and the form of an `AuthLayout`. Throws outside one. */
|
|
10
|
+
export declare function useAuthLayout(): AuthContextValue;
|
|
11
|
+
export interface AuthLayoutProps extends ComponentPropsWithoutRef<"div"> {
|
|
12
|
+
/**
|
|
13
|
+
* `split` puts the art beside the panel once the layout is 768px wide, `split-reverse` swaps the
|
|
14
|
+
* sides, `centered` centers the panel over a faded illustration. Narrower than that the art
|
|
15
|
+
* stacks above the panel, and under 448px it is dropped. All of it follows the layout's own
|
|
16
|
+
* width, not the viewport's.
|
|
17
|
+
*/
|
|
18
|
+
layout?: AuthLayoutKind;
|
|
19
|
+
/**
|
|
20
|
+
* `paper` is the card over a tinted page. `solid` fills one side with a solid color for the art
|
|
21
|
+
* and leaves the form open on the other (no card). It applies to `split` and `split-reverse`;
|
|
22
|
+
* `centered` ignores it. A solid root sets `--auth-art-bg` and `--auth-art-ink` for the art, the
|
|
23
|
+
* brand and the illustration, which carries `data-panel="solid"`.
|
|
24
|
+
*/
|
|
25
|
+
panel?: AuthPanel;
|
|
26
|
+
/** What the screen is doing, for the illustration. Controlled; `LoginForm` keeps it current when left alone. */
|
|
27
|
+
state?: AuthState;
|
|
28
|
+
defaultState?: AuthState;
|
|
29
|
+
onStateChange?: (state: AuthState) => void;
|
|
30
|
+
/** Fill of the whole form, 0 to 1. */
|
|
31
|
+
progress?: number;
|
|
32
|
+
defaultProgress?: number;
|
|
33
|
+
onProgressChange?: (progress: number) => void;
|
|
34
|
+
/** Index of the portal in use (0 to 2). */
|
|
35
|
+
activeIndex?: number;
|
|
36
|
+
defaultActiveIndex?: number;
|
|
37
|
+
onActiveIndexChange?: (index: number) => void;
|
|
38
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
39
|
+
classNames?: ClassNames<AuthLayoutPart>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Screen for signing in: a brand, an illustration that reacts to the form and the form itself,
|
|
43
|
+
* laid out by the width of the layout. It owns the sign-in state (controlled or not) and shares it
|
|
44
|
+
* with `AuthIllustration` and `LoginForm`, so wiring them is just placing them inside.
|
|
45
|
+
*
|
|
46
|
+
* Parts: `AuthLayout.Brand`, `AuthLayout.Art`, `AuthLayout.Panel` and `AuthLayout.Footer`.
|
|
47
|
+
*/
|
|
48
|
+
export declare function AuthLayout({ layout, panel: panelProp, state: stateProp, defaultState, onStateChange, progress: progressProp, defaultProgress, onProgressChange, activeIndex: activeIndexProp, defaultActiveIndex, onActiveIndexChange, className, classNames, children, ...props }: AuthLayoutProps): import("react").JSX.Element;
|
|
49
|
+
export declare namespace AuthLayout {
|
|
50
|
+
var Brand: typeof AuthLayoutBrand;
|
|
51
|
+
var Art: typeof AuthLayoutArt;
|
|
52
|
+
var Panel: typeof AuthLayoutPanel;
|
|
53
|
+
var Footer: typeof AuthLayoutFooter;
|
|
54
|
+
}
|
|
55
|
+
export interface AuthLayoutBrandProps extends ComponentPropsWithoutRef<"div"> {
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Logo or wordmark pinned to the top corner on the art's side: left in `split` and `centered`,
|
|
59
|
+
* right in `split-reverse` once the art sits beside the panel, so it never lands on the card.
|
|
60
|
+
*/
|
|
61
|
+
export declare function AuthLayoutBrand({ className, ...props }: AuthLayoutBrandProps): import("react").JSX.Element;
|
|
62
|
+
export interface AuthLayoutArtProps extends ComponentPropsWithoutRef<"div">, Pick<AuthIllustrationProps, "headline" | "caption" | "action"> {
|
|
63
|
+
/** Look of the default illustration, used when there are no children (default `Slabs`). */
|
|
64
|
+
look?: AuthLook;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Holds the illustration (a default `AuthIllustration` when empty). It hides under 448px of layout
|
|
68
|
+
* width and, in `centered`, sits faded behind the panel. A drawn look is at most 12rem tall while
|
|
69
|
+
* it is stacked above the panel, so the form stays in reach, and 34rem beside it; set
|
|
70
|
+
* `--auth-art-max-h` on this part to change that.
|
|
71
|
+
*/
|
|
72
|
+
export declare function AuthLayoutArt({ look, headline, caption, action, className, children, ...props }: AuthLayoutArtProps): import("react").JSX.Element;
|
|
73
|
+
export interface AuthLayoutPanelProps extends ComponentPropsWithoutRef<"div"> {
|
|
74
|
+
}
|
|
75
|
+
/** The card that holds the form. */
|
|
76
|
+
export declare function AuthLayoutPanel({ className, ...props }: AuthLayoutPanelProps): import("react").JSX.Element;
|
|
77
|
+
export interface AuthLayoutFooterProps extends ComponentPropsWithoutRef<"div"> {
|
|
78
|
+
}
|
|
79
|
+
/** Line under the panel, across the full width (terms, support, a language switch). */
|
|
80
|
+
export declare function AuthLayoutFooter({ className, ...props }: AuthLayoutFooterProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import {
|
|
4
|
+
createContext,
|
|
5
|
+
useContext,
|
|
6
|
+
useMemo
|
|
7
|
+
} from "react";
|
|
8
|
+
import { cn } from "../../utils/cn.js";
|
|
9
|
+
import { useControllableState } from "../../utils/use-controllable-state.js";
|
|
10
|
+
import {
|
|
11
|
+
AuthIllustration
|
|
12
|
+
} from "../auth-illustration/auth-illustration.js";
|
|
13
|
+
import { AuthContext } from "../internal/auth-context.js";
|
|
14
|
+
import { AuthStyles } from "../internal/auth-styles.js";
|
|
15
|
+
const AuthLayoutPartsContext = createContext(null);
|
|
16
|
+
function useAuthLayoutParts(part) {
|
|
17
|
+
const parts = useContext(AuthLayoutPartsContext);
|
|
18
|
+
if (!parts) throw new Error(`AuthLayout.${part} must be rendered inside an AuthLayout`);
|
|
19
|
+
return parts;
|
|
20
|
+
}
|
|
21
|
+
function useAuthLayout() {
|
|
22
|
+
const auth = useContext(AuthContext);
|
|
23
|
+
if (!auth) throw new Error("useAuthLayout must be called inside an AuthLayout");
|
|
24
|
+
return auth;
|
|
25
|
+
}
|
|
26
|
+
function AuthLayout({
|
|
27
|
+
layout = "split",
|
|
28
|
+
panel: panelProp = "paper",
|
|
29
|
+
state: stateProp,
|
|
30
|
+
defaultState = "idle",
|
|
31
|
+
onStateChange,
|
|
32
|
+
progress: progressProp,
|
|
33
|
+
defaultProgress = 0,
|
|
34
|
+
onProgressChange,
|
|
35
|
+
activeIndex: activeIndexProp,
|
|
36
|
+
defaultActiveIndex = 0,
|
|
37
|
+
onActiveIndexChange,
|
|
38
|
+
className,
|
|
39
|
+
classNames,
|
|
40
|
+
children,
|
|
41
|
+
...props
|
|
42
|
+
}) {
|
|
43
|
+
const [state, setState] = useControllableState({
|
|
44
|
+
prop: stateProp,
|
|
45
|
+
defaultProp: defaultState,
|
|
46
|
+
onChange: onStateChange
|
|
47
|
+
});
|
|
48
|
+
const [progress, setProgress] = useControllableState({
|
|
49
|
+
prop: progressProp,
|
|
50
|
+
defaultProp: defaultProgress,
|
|
51
|
+
onChange: onProgressChange
|
|
52
|
+
});
|
|
53
|
+
const [activeIndex, setActiveIndex] = useControllableState({
|
|
54
|
+
prop: activeIndexProp,
|
|
55
|
+
defaultProp: defaultActiveIndex,
|
|
56
|
+
onChange: onActiveIndexChange
|
|
57
|
+
});
|
|
58
|
+
const panel = layout === "centered" ? "paper" : panelProp;
|
|
59
|
+
const auth = useMemo(
|
|
60
|
+
() => ({ panel, state, setState, progress, setProgress, activeIndex, setActiveIndex }),
|
|
61
|
+
[panel, state, setState, progress, setProgress, activeIndex, setActiveIndex]
|
|
62
|
+
);
|
|
63
|
+
const parts = useMemo(() => ({ layout, panel, classNames }), [layout, panel, classNames]);
|
|
64
|
+
return /* @__PURE__ */ jsx(AuthContext, { value: auth, children: /* @__PURE__ */ jsxs(AuthLayoutPartsContext, { value: parts, children: [
|
|
65
|
+
/* @__PURE__ */ jsx(AuthStyles, {}),
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
"div",
|
|
68
|
+
{
|
|
69
|
+
...props,
|
|
70
|
+
style: panel === "solid" ? { ...SOLID_ART_VARS, ...props.style } : props.style,
|
|
71
|
+
"data-layout": layout,
|
|
72
|
+
"data-panel": panel,
|
|
73
|
+
"data-state": state,
|
|
74
|
+
className: cn(
|
|
75
|
+
"@container/auth relative isolate min-h-164 min-w-0 overflow-hidden",
|
|
76
|
+
panel === "solid" ? "bg-surface" : "rounded-card border-divider bg-[color-mix(in_srgb,var(--accent)_14%,var(--bg))]",
|
|
77
|
+
classNames?.root,
|
|
78
|
+
className
|
|
79
|
+
),
|
|
80
|
+
children: /* @__PURE__ */ jsx(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: cn(
|
|
84
|
+
"grid min-h-[inherit] grid-cols-1",
|
|
85
|
+
panel === "solid" ? "content-start items-stretch @3xl/auth:grid-cols-2 @3xl/auth:content-stretch" : [
|
|
86
|
+
"content-center items-center gap-2 px-4 pt-14 pb-6 @max-md/auth:content-start @max-md/auth:bg-surface @lg/auth:px-8 @3xl/auth:px-14 @3xl/auth:pt-7 @3xl/auth:pb-8",
|
|
87
|
+
layout !== "centered" && "@3xl/auth:grid-cols-[minmax(0,1.1fr)_minmax(0,.9fr)] @3xl/auth:gap-12"
|
|
88
|
+
],
|
|
89
|
+
classNames?.content
|
|
90
|
+
),
|
|
91
|
+
children
|
|
92
|
+
}
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
)
|
|
96
|
+
] }) });
|
|
97
|
+
}
|
|
98
|
+
const SOLID_ART_VARS = {
|
|
99
|
+
"--auth-art-bg": "var(--accent)",
|
|
100
|
+
"--auth-art-ink": "var(--on-accent)"
|
|
101
|
+
};
|
|
102
|
+
function AuthLayoutBrand({ className, ...props }) {
|
|
103
|
+
const { layout, panel, classNames } = useAuthLayoutParts("Brand");
|
|
104
|
+
const onSolid = panel === "solid";
|
|
105
|
+
return /* @__PURE__ */ jsx(
|
|
106
|
+
"div",
|
|
107
|
+
{
|
|
108
|
+
...props,
|
|
109
|
+
className: cn(
|
|
110
|
+
"absolute top-5.5 left-4 z-[3] font-bold text-lg tracking-tight @lg/auth:left-8 @3xl/auth:left-14",
|
|
111
|
+
layout === "split-reverse" && "@3xl/auth:right-14 @3xl/auth:left-auto",
|
|
112
|
+
!onSolid && "text-ink",
|
|
113
|
+
onSolid && "text-[var(--auth-art-ink)] @max-md/auth:text-ink",
|
|
114
|
+
classNames?.brand,
|
|
115
|
+
className
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
function AuthLayoutArt({
|
|
121
|
+
look,
|
|
122
|
+
headline,
|
|
123
|
+
caption,
|
|
124
|
+
action,
|
|
125
|
+
className,
|
|
126
|
+
children,
|
|
127
|
+
...props
|
|
128
|
+
}) {
|
|
129
|
+
const { layout, panel, classNames } = useAuthLayoutParts("Art");
|
|
130
|
+
const solid = panel === "solid";
|
|
131
|
+
const art = children ?? /* @__PURE__ */ jsx(AuthIllustration, { look, headline, caption, action });
|
|
132
|
+
return /* @__PURE__ */ jsx(
|
|
133
|
+
"div",
|
|
134
|
+
{
|
|
135
|
+
...props,
|
|
136
|
+
className: cn(
|
|
137
|
+
"grid min-w-0 place-items-center [--auth-art-max-h:12rem] @max-md/auth:hidden @3xl/auth:[--auth-art-max-h:34rem]",
|
|
138
|
+
layout === "centered" && "pointer-events-none absolute inset-0 -z-10 px-8 opacity-35",
|
|
139
|
+
layout !== "centered" && !solid && "relative mx-auto w-full max-w-90 @3xl/auth:max-w-160",
|
|
140
|
+
layout !== "centered" && solid && "bg-[var(--auth-art-bg)] px-4 pt-16 pb-6 text-[var(--auth-art-ink)] @lg/auth:px-8 @3xl/auth:px-14 @3xl/auth:py-14",
|
|
141
|
+
layout === "split-reverse" && "@3xl/auth:order-2",
|
|
142
|
+
classNames?.art,
|
|
143
|
+
className
|
|
144
|
+
),
|
|
145
|
+
children: solid ? /* @__PURE__ */ jsx("div", { className: "w-full max-w-90 @3xl/auth:max-w-160", children: art }) : art
|
|
146
|
+
}
|
|
147
|
+
);
|
|
148
|
+
}
|
|
149
|
+
function AuthLayoutPanel({ className, ...props }) {
|
|
150
|
+
const { layout, panel, classNames } = useAuthLayoutParts("Panel");
|
|
151
|
+
return /* @__PURE__ */ jsx(
|
|
152
|
+
"div",
|
|
153
|
+
{
|
|
154
|
+
...props,
|
|
155
|
+
className: cn(
|
|
156
|
+
panel === "solid" ? "relative z-[2] grid min-w-0 content-center px-4 py-10 text-ink @max-md/auth:pt-20 @lg/auth:px-8 @3xl/auth:px-14 @3xl/auth:py-14" : "ui-auth-rise relative z-[2] w-full max-w-110 min-w-0 justify-self-center overflow-hidden rounded-card border-[1.5px] border-ink bg-surface text-ink shadow-[0_3px_0_var(--ink),0_24px_50px_-12px_color-mix(in_srgb,black_20%,transparent)] @max-md/auth:overflow-visible @max-md/auth:rounded-none @max-md/auth:border-0 @max-md/auth:shadow-none",
|
|
157
|
+
layout === "split-reverse" && "@3xl/auth:order-1",
|
|
158
|
+
classNames?.panel,
|
|
159
|
+
className
|
|
160
|
+
)
|
|
161
|
+
}
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
function AuthLayoutFooter({ className, ...props }) {
|
|
165
|
+
const { panel, classNames } = useAuthLayoutParts("Footer");
|
|
166
|
+
return /* @__PURE__ */ jsx(
|
|
167
|
+
"div",
|
|
168
|
+
{
|
|
169
|
+
...props,
|
|
170
|
+
className: cn(
|
|
171
|
+
"relative z-[2] col-span-full text-center text-ink-3 text-meta",
|
|
172
|
+
panel === "solid" && "px-4 pb-6",
|
|
173
|
+
classNames?.footer,
|
|
174
|
+
className
|
|
175
|
+
)
|
|
176
|
+
}
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
AuthLayout.Brand = AuthLayoutBrand;
|
|
180
|
+
AuthLayout.Art = AuthLayoutArt;
|
|
181
|
+
AuthLayout.Panel = AuthLayoutPanel;
|
|
182
|
+
AuthLayout.Footer = AuthLayoutFooter;
|
|
183
|
+
export {
|
|
184
|
+
AuthLayout,
|
|
185
|
+
AuthLayoutArt,
|
|
186
|
+
AuthLayoutBrand,
|
|
187
|
+
AuthLayoutFooter,
|
|
188
|
+
AuthLayoutPanel,
|
|
189
|
+
useAuthLayout
|
|
190
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./auth-layout.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./auth-layout.js";
|