@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,12 @@
|
|
|
1
|
+
import type { AuthVariantProps } from "../auth-illustration/look.js";
|
|
2
|
+
/**
|
|
3
|
+
* A student with a backpack riding a hover board over a pulsing shadow, for the art panel. They bob,
|
|
4
|
+
* blink and follow the pointer; while the form is typed into they look toward it and nod per
|
|
5
|
+
* keystroke, for the password they cover their eyes, on an error they shake their head and on
|
|
6
|
+
* success they hop with a boost. The deck lamps fill with progress and the chest badge carries the
|
|
7
|
+
* active portal's glyph.
|
|
8
|
+
*/
|
|
9
|
+
export declare function Character({ state, progress, activeIndex, uid }: AuthVariantProps): import("react").JSX.Element;
|
|
10
|
+
export declare namespace Character {
|
|
11
|
+
var variant: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,333 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { BOARD_LIGHTS, boardLit, keystroke } from "../auth-illustration/model.js";
|
|
4
|
+
import { PORTAL_GLYPHS } from "../internal/portal-glyphs.js";
|
|
5
|
+
const CSS = `
|
|
6
|
+
@keyframes ui-chr-bob{50%{transform:translateY(-12px)}}
|
|
7
|
+
@keyframes ui-chr-pulse{50%{transform:scale(.8);opacity:.6}}
|
|
8
|
+
@keyframes ui-chr-blink{0%,93%,100%{transform:scaleY(0)}96%{transform:scaleY(1)}}
|
|
9
|
+
@keyframes ui-chr-nod-0{40%{transform:rotate(-5deg) translateY(2px)}}
|
|
10
|
+
@keyframes ui-chr-nod-1{40%{transform:rotate(5deg) translateY(2px)}}
|
|
11
|
+
@keyframes ui-chr-shake{15%,55%{transform:translateX(-7px) rotate(-4deg)}35%,75%{transform:translateX(7px) rotate(4deg)}}
|
|
12
|
+
@keyframes ui-chr-hop{0%{transform:translateY(0)}18%{transform:translateY(8px) scaleY(.94)}48%{transform:translateY(-58px)}74%{transform:translateY(4px)}100%{transform:translateY(0)}}
|
|
13
|
+
@keyframes ui-chr-hop-shadow{48%{transform:scale(.55);opacity:.35}}
|
|
14
|
+
@keyframes ui-chr-boost{0%,12%{opacity:0;transform:scaleY(.2)}30%{opacity:1;transform:scaleY(1.25)}62%{opacity:1;transform:scaleY(.9)}100%{opacity:0;transform:scaleY(.3)}}
|
|
15
|
+
@keyframes ui-chr-flicker{50%{transform:scaleY(.7)}}
|
|
16
|
+
@keyframes ui-chr-drift{50%{transform:translate(10px,-8px)}}
|
|
17
|
+
@keyframes ui-chr-in{from{opacity:0;transform:translateY(36px) scale(.92)}}
|
|
18
|
+
.ui-chr{--side:1;--line:color-mix(in srgb,black 80%,var(--accent));--skin:color-mix(in srgb,white 90%,var(--accent));--hoodie:var(--accent);--pack:color-mix(in srgb,var(--ink) 22%,color-mix(in srgb,black 62%,var(--accent)));--hair:color-mix(in srgb,var(--ink) 22%,color-mix(in srgb,black 72%,var(--accent)));--pants:color-mix(in srgb,black 45%,var(--accent));--deck:color-mix(in srgb,var(--ink) 22%,color-mix(in srgb,black 70%,var(--accent)));--lamp:color-mix(in srgb,white 30%,var(--accent-2));--lamp-off:color-mix(in srgb,white 18%,var(--deck));--blush:color-mix(in srgb,var(--danger) 30%,white);--flame:var(--accent-2);--decor:color-mix(in srgb,var(--accent) 45%,transparent);overflow:visible}
|
|
19
|
+
.ui-auth-art[data-panel=solid] .ui-chr{--hoodie:color-mix(in srgb,var(--auth-art-ink) 34%,var(--auth-art-bg));--decor:color-mix(in srgb,var(--auth-art-ink) 18%,transparent);--flame:var(--ua-tint)}
|
|
20
|
+
:where([data-layout=split-reverse]) .ui-chr{--side:-1}
|
|
21
|
+
.ui-chr-line{stroke:var(--line);stroke-width:3;stroke-linejoin:round;stroke-linecap:round}
|
|
22
|
+
.ui-chr-fill-skin{fill:var(--skin)}.ui-chr-fill-hoodie{fill:var(--hoodie)}.ui-chr-fill-pack{fill:var(--pack)}.ui-chr-fill-hair{fill:var(--hair)}.ui-chr-fill-pants{fill:var(--pants)}.ui-chr-fill-deck{fill:var(--deck)}.ui-chr-fill-line{fill:var(--line)}
|
|
23
|
+
.ui-chr-dots{fill:color-mix(in srgb,black 30%,transparent)}
|
|
24
|
+
.ui-chr-shine{fill:white;opacity:.7}
|
|
25
|
+
.ui-chr-blush{fill:var(--blush);opacity:.75}
|
|
26
|
+
.ui-chr-in{animation:ui-chr-in .9s var(--ua-land) backwards .1s}
|
|
27
|
+
.ui-chr-shadow{fill:var(--ua-shadow);transform-box:fill-box;transform-origin:center;animation:ui-chr-pulse 3.2s ease-in-out infinite}
|
|
28
|
+
.ui-chr-bob{animation:ui-chr-bob 3.2s ease-in-out infinite}
|
|
29
|
+
.ui-chr-par{transform:translate(calc(var(--px,0) * 6px),calc(var(--py,0) * 3px));transition:transform .6s var(--ua-glide)}
|
|
30
|
+
.ui-chr-hop,.ui-chr-head,.ui-chr-nod,.ui-chr-turn,.ui-chr-arm,.ui-chr-brow,.ui-chr-flame,.ui-chr-lid{transform-box:view-box}
|
|
31
|
+
.ui-chr-head,.ui-chr-nod{transform-origin:200px 200px}
|
|
32
|
+
.ui-chr-turn{transition:transform .45s var(--ua-bounce)}
|
|
33
|
+
.ui-chr-nod-0{animation:ui-chr-nod-0 .34s var(--ua-glide)}
|
|
34
|
+
.ui-chr-nod-1{animation:ui-chr-nod-1 .34s var(--ua-glide)}
|
|
35
|
+
.ui-chr-eyes{transform:translate(calc(var(--ex,var(--px,0)) * 6px),calc(var(--ey,var(--py,0)) * 4px));transition:transform .3s var(--ua-glide)}
|
|
36
|
+
.ui-auth-art[data-state=typing] .ui-chr-eyes{--ex:calc(var(--side) * 1.1);--ey:.9}
|
|
37
|
+
.ui-auth-art[data-state=password] .ui-chr-turn{transform:translateX(calc(var(--side) * -6px)) rotate(calc(var(--side) * -6deg))}
|
|
38
|
+
.ui-chr-lid{transform-box:fill-box;transform-origin:50% 0;transform:scaleY(0);animation:ui-chr-blink 4.6s infinite}
|
|
39
|
+
.ui-chr-lid rect{fill:var(--skin)}
|
|
40
|
+
.ui-auth-art[data-state=password] .ui-chr-lid{animation:none;transform:scaleY(1);transition:transform .18s ease-out}
|
|
41
|
+
.ui-chr-brow{transition:transform .35s var(--ua-bounce)}
|
|
42
|
+
.ui-auth-art[data-state=error] .ui-chr-brow-l{transform:translateY(3px) rotate(16deg);transform-box:fill-box;transform-origin:center}
|
|
43
|
+
.ui-auth-art[data-state=error] .ui-chr-brow-r{transform:translateY(3px) rotate(-16deg);transform-box:fill-box;transform-origin:center}
|
|
44
|
+
.ui-auth-art[data-state=success] .ui-chr-brow{transform:translateY(-4px)}
|
|
45
|
+
.ui-chr-mouth{opacity:0;transition:opacity .2s linear}
|
|
46
|
+
.ui-auth-art:is([data-state=idle],[data-state=typing]) .ui-chr-mouth-smile,.ui-auth-art[data-state=password] .ui-chr-mouth-hush,.ui-auth-art[data-state=error] .ui-chr-mouth-wobble,.ui-auth-art[data-state=success] .ui-chr-mouth-grin{opacity:1}
|
|
47
|
+
.ui-chr-sweat{fill:color-mix(in srgb,white 55%,var(--accent-2));opacity:0;transform:translateY(-6px);transition:opacity .2s linear,transform .5s var(--ua-glide)}
|
|
48
|
+
.ui-auth-art[data-state=error] .ui-chr-sweat{opacity:1;transform:none}
|
|
49
|
+
.ui-chr-arm{transition:transform .5s var(--ua-bounce)}
|
|
50
|
+
.ui-chr-arm-l{transform-origin:158px 214px}.ui-chr-arm-r{transform-origin:242px 214px}
|
|
51
|
+
.ui-auth-art[data-state=password] .ui-chr-arm-l{transform:rotate(-170deg)}
|
|
52
|
+
.ui-auth-art[data-state=password] .ui-chr-arm-r{transform:rotate(170deg)}
|
|
53
|
+
.ui-auth-art[data-state=success] .ui-chr-arm-l{transform:rotate(138deg)}
|
|
54
|
+
.ui-auth-art[data-state=success] .ui-chr-arm-r{transform:rotate(-138deg)}
|
|
55
|
+
.ui-auth-art[data-state=error] .ui-chr-arm-l{transform:rotate(-18deg)}
|
|
56
|
+
.ui-auth-art[data-state=error] .ui-chr-arm-r{transform:rotate(18deg)}
|
|
57
|
+
.ui-auth-art[data-state=error] .ui-chr-head{animation:ui-chr-shake .6s var(--ua-glide)}
|
|
58
|
+
.ui-auth-art[data-state=success] .ui-chr-hop{animation:ui-chr-hop 1s var(--ua-glide) .1s}
|
|
59
|
+
.ui-auth-art[data-state=success] .ui-chr-shadow-hop{animation:ui-chr-hop-shadow 1s var(--ua-glide) .1s;transform-box:fill-box;transform-origin:center}
|
|
60
|
+
.ui-chr-lamp{fill:var(--lamp-off);transition:opacity .3s linear}
|
|
61
|
+
.ui-chr-lamp-on{fill:var(--lamp);opacity:var(--on);transition:opacity .3s linear;transition-delay:calc(var(--i) * 60ms)}
|
|
62
|
+
.ui-auth-art[data-state=error] .ui-chr-lamp-on{fill:var(--danger)}
|
|
63
|
+
.ui-chr-flame{fill:var(--flame);transform-box:fill-box;transform-origin:50% 0;opacity:0}
|
|
64
|
+
.ui-chr-flame-idle{opacity:.55;animation:ui-chr-flicker .5s ease-in-out infinite;transform:scaleY(.55)}
|
|
65
|
+
.ui-auth-art[data-state=success] .ui-chr-flame-boost{animation:ui-chr-boost 1.1s var(--ua-glide) .1s}
|
|
66
|
+
.ui-chr-decor{display:none;fill:var(--decor)}
|
|
67
|
+
.ui-chr-drift{transform-box:fill-box;animation:ui-chr-drift 7s ease-in-out infinite;animation-delay:calc(var(--i) * -2.3s)}
|
|
68
|
+
@container art (min-width:24rem){.ui-chr-decor{display:inline}}
|
|
69
|
+
.ui-auth-art[data-state=success] .ui-auth-spark{animation-delay:.45s}
|
|
70
|
+
@media (prefers-reduced-motion:reduce){
|
|
71
|
+
.ui-chr *,.ui-auth-art[data-state] .ui-chr *{animation:none!important;transition:none!important}
|
|
72
|
+
.ui-chr-par,.ui-chr-eyes{transform:none}
|
|
73
|
+
.ui-chr-flame-idle{transform:scaleY(.55)}
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
76
|
+
const LAMPS = Array.from({ length: BOARD_LIGHTS }, (_, i) => 132 + i * 30);
|
|
77
|
+
const SPARKS = [
|
|
78
|
+
{ dx: "-70px", dy: "-60px", star: true },
|
|
79
|
+
{ dx: "60px", dy: "-80px", star: false },
|
|
80
|
+
{ dx: "86px", dy: "-20px", star: true },
|
|
81
|
+
{ dx: "-90px", dy: "-10px", star: false },
|
|
82
|
+
{ dx: "10px", dy: "-104px", star: true }
|
|
83
|
+
];
|
|
84
|
+
function Arm({ side }) {
|
|
85
|
+
const d = side === "l" ? "M158 216 Q142 244 148 268" : "M242 216 Q258 244 252 268";
|
|
86
|
+
const hand = side === "l" ? { cx: 148, cy: 272 } : { cx: 252, cy: 272 };
|
|
87
|
+
return /* @__PURE__ */ jsxs("g", { className: `ui-chr-arm ui-chr-arm-${side}`, children: [
|
|
88
|
+
/* @__PURE__ */ jsx("path", { d, fill: "none", stroke: "var(--line)", strokeWidth: "25", strokeLinecap: "round" }),
|
|
89
|
+
/* @__PURE__ */ jsx("path", { d, fill: "none", stroke: "var(--hoodie)", strokeWidth: "19", strokeLinecap: "round" }),
|
|
90
|
+
/* @__PURE__ */ jsx("circle", { className: "ui-chr-fill-skin ui-chr-line", cx: hand.cx, cy: hand.cy, r: "10.5" })
|
|
91
|
+
] });
|
|
92
|
+
}
|
|
93
|
+
function Character({ state, progress, activeIndex, uid }) {
|
|
94
|
+
const dots = `url(#${uid}-chr-dots)`;
|
|
95
|
+
const tick = keystroke(progress);
|
|
96
|
+
const nod = tick.count > 0 ? `ui-chr-nod ui-chr-nod-${tick.phase}` : "ui-chr-nod";
|
|
97
|
+
const lit = boardLit(state, progress);
|
|
98
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
99
|
+
/* @__PURE__ */ jsx("style", { href: "jcsoftdev-ui-auth-character", precedence: "default", children: CSS }),
|
|
100
|
+
/* @__PURE__ */ jsxs("svg", { viewBox: "40 8 320 432", focusable: "false", className: "ui-chr", children: [
|
|
101
|
+
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: `${uid}-chr-dots`, width: "5", height: "5", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx("circle", { className: "ui-chr-dots", cx: "2.5", cy: "2.5", r: "1" }) }) }),
|
|
102
|
+
/* @__PURE__ */ jsx("g", { className: "ui-chr-decor", children: [
|
|
103
|
+
{ x: 84, y: 130, s: 1.2 },
|
|
104
|
+
{ x: 312, y: 104, s: 0.8 },
|
|
105
|
+
{ x: 318, y: 290, s: 1 },
|
|
106
|
+
{ x: 76, y: 300, s: 0.7 }
|
|
107
|
+
].map((star, i) => /* @__PURE__ */ jsx("g", { transform: `translate(${star.x} ${star.y}) scale(${star.s})`, children: /* @__PURE__ */ jsx(
|
|
108
|
+
"path",
|
|
109
|
+
{
|
|
110
|
+
className: "ui-chr-drift",
|
|
111
|
+
style: { "--i": i },
|
|
112
|
+
d: "M0 -14 Q2 -2 14 0 Q2 2 0 14 Q-2 2 -14 0 Q-2 -2 0 -14 Z"
|
|
113
|
+
}
|
|
114
|
+
) }, star.x)) }),
|
|
115
|
+
/* @__PURE__ */ jsxs("g", { className: "ui-chr-in", children: [
|
|
116
|
+
/* @__PURE__ */ jsx("g", { className: "ui-chr-shadow-hop", children: /* @__PURE__ */ jsx("ellipse", { className: "ui-chr-shadow", cx: "200", cy: "414", rx: "92", ry: "11" }) }),
|
|
117
|
+
/* @__PURE__ */ jsx("g", { className: "ui-chr-par", children: /* @__PURE__ */ jsx("g", { className: "ui-chr-hop", children: /* @__PURE__ */ jsxs("g", { className: "ui-chr-bob", children: [
|
|
118
|
+
[150, 250].map((x) => /* @__PURE__ */ jsxs("g", { children: [
|
|
119
|
+
/* @__PURE__ */ jsx(
|
|
120
|
+
"path",
|
|
121
|
+
{
|
|
122
|
+
className: "ui-chr-flame ui-chr-flame-idle",
|
|
123
|
+
d: `M${x - 8} 360 Q${x} 392 ${x + 8} 360 Z`
|
|
124
|
+
}
|
|
125
|
+
),
|
|
126
|
+
/* @__PURE__ */ jsx(
|
|
127
|
+
"path",
|
|
128
|
+
{
|
|
129
|
+
className: "ui-chr-flame ui-chr-flame-boost",
|
|
130
|
+
d: `M${x - 11} 360 Q${x - 4} 420 ${x} 432 Q${x + 4} 420 ${x + 11} 360 Z`
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
/* @__PURE__ */ jsx(
|
|
134
|
+
"rect",
|
|
135
|
+
{
|
|
136
|
+
className: "ui-chr-fill-deck ui-chr-line",
|
|
137
|
+
x: x - 14,
|
|
138
|
+
y: "344",
|
|
139
|
+
width: "28",
|
|
140
|
+
height: "18",
|
|
141
|
+
rx: "6"
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
] }, x)),
|
|
145
|
+
/* @__PURE__ */ jsx(
|
|
146
|
+
"rect",
|
|
147
|
+
{
|
|
148
|
+
className: "ui-chr-fill-deck ui-chr-line",
|
|
149
|
+
x: "104",
|
|
150
|
+
y: "326",
|
|
151
|
+
width: "192",
|
|
152
|
+
height: "22",
|
|
153
|
+
rx: "11"
|
|
154
|
+
}
|
|
155
|
+
),
|
|
156
|
+
/* @__PURE__ */ jsx("rect", { x: "104", y: "326", width: "192", height: "22", rx: "11", fill: dots }),
|
|
157
|
+
LAMPS.map((x, i) => /* @__PURE__ */ jsxs("g", { children: [
|
|
158
|
+
/* @__PURE__ */ jsx("rect", { className: "ui-chr-lamp", x, y: "334", width: "16", height: "6", rx: "3" }),
|
|
159
|
+
/* @__PURE__ */ jsx(
|
|
160
|
+
"rect",
|
|
161
|
+
{
|
|
162
|
+
className: "ui-chr-lamp-on",
|
|
163
|
+
style: { "--i": i, "--on": i < lit ? 1 : 0 },
|
|
164
|
+
x,
|
|
165
|
+
y: "334",
|
|
166
|
+
width: "16",
|
|
167
|
+
height: "6",
|
|
168
|
+
rx: "3"
|
|
169
|
+
}
|
|
170
|
+
)
|
|
171
|
+
] }, x)),
|
|
172
|
+
/* @__PURE__ */ jsx(
|
|
173
|
+
"rect",
|
|
174
|
+
{
|
|
175
|
+
className: "ui-chr-fill-pants ui-chr-line",
|
|
176
|
+
x: "174",
|
|
177
|
+
y: "276",
|
|
178
|
+
width: "22",
|
|
179
|
+
height: "44",
|
|
180
|
+
rx: "8"
|
|
181
|
+
}
|
|
182
|
+
),
|
|
183
|
+
/* @__PURE__ */ jsx(
|
|
184
|
+
"rect",
|
|
185
|
+
{
|
|
186
|
+
className: "ui-chr-fill-pants ui-chr-line",
|
|
187
|
+
x: "204",
|
|
188
|
+
y: "276",
|
|
189
|
+
width: "22",
|
|
190
|
+
height: "44",
|
|
191
|
+
rx: "8"
|
|
192
|
+
}
|
|
193
|
+
),
|
|
194
|
+
/* @__PURE__ */ jsx(
|
|
195
|
+
"path",
|
|
196
|
+
{
|
|
197
|
+
className: "ui-chr-fill-skin ui-chr-line",
|
|
198
|
+
d: "M170 314 h28 v9 q0 5 -5 5 h-28 q-6 0 -6 -6 q0 -8 11 -8 Z"
|
|
199
|
+
}
|
|
200
|
+
),
|
|
201
|
+
/* @__PURE__ */ jsx(
|
|
202
|
+
"path",
|
|
203
|
+
{
|
|
204
|
+
className: "ui-chr-fill-skin ui-chr-line",
|
|
205
|
+
d: "M230 314 h-28 v9 q0 5 5 5 h28 q6 0 6 -6 q0 -8 -11 -8 Z"
|
|
206
|
+
}
|
|
207
|
+
),
|
|
208
|
+
/* @__PURE__ */ jsx(
|
|
209
|
+
"rect",
|
|
210
|
+
{
|
|
211
|
+
className: "ui-chr-fill-pack ui-chr-line",
|
|
212
|
+
x: "134",
|
|
213
|
+
y: "204",
|
|
214
|
+
width: "132",
|
|
215
|
+
height: "76",
|
|
216
|
+
rx: "24"
|
|
217
|
+
}
|
|
218
|
+
),
|
|
219
|
+
/* @__PURE__ */ jsx("rect", { x: "134", y: "204", width: "132", height: "76", rx: "24", fill: dots }),
|
|
220
|
+
/* @__PURE__ */ jsx(
|
|
221
|
+
"path",
|
|
222
|
+
{
|
|
223
|
+
className: "ui-chr-fill-hoodie ui-chr-line",
|
|
224
|
+
d: "M160 208 Q200 190 240 208 L252 278 Q200 296 148 278 Z"
|
|
225
|
+
}
|
|
226
|
+
),
|
|
227
|
+
/* @__PURE__ */ jsx("path", { d: "M226 202 Q244 210 252 278 Q240 284 228 286 Z", fill: dots }),
|
|
228
|
+
/* @__PURE__ */ jsx("path", { className: "ui-chr-line", fill: "none", d: "M170 206 Q166 236 172 270" }),
|
|
229
|
+
/* @__PURE__ */ jsx("path", { className: "ui-chr-line", fill: "none", d: "M230 206 Q234 236 228 270" }),
|
|
230
|
+
/* @__PURE__ */ jsx("circle", { className: "ui-chr-fill-skin ui-chr-line", cx: "200", cy: "246", r: "17" }),
|
|
231
|
+
/* @__PURE__ */ jsx(
|
|
232
|
+
"g",
|
|
233
|
+
{
|
|
234
|
+
transform: "translate(188 234) scale(.24)",
|
|
235
|
+
style: {
|
|
236
|
+
"--glyph-a": "var(--hoodie)",
|
|
237
|
+
"--glyph-b": "var(--line)",
|
|
238
|
+
"--glyph-c": "var(--skin)",
|
|
239
|
+
"--glyph-line": "var(--line)"
|
|
240
|
+
},
|
|
241
|
+
children: PORTAL_GLYPHS[activeIndex] ?? PORTAL_GLYPHS[0]
|
|
242
|
+
}
|
|
243
|
+
),
|
|
244
|
+
/* @__PURE__ */ jsx("g", { className: "ui-chr-head", children: /* @__PURE__ */ jsx("g", { className: nod, children: /* @__PURE__ */ jsxs("g", { className: "ui-chr-turn", children: [
|
|
245
|
+
/* @__PURE__ */ jsx("circle", { className: "ui-chr-fill-skin ui-chr-line", cx: "200", cy: "148", r: "54" }),
|
|
246
|
+
/* @__PURE__ */ jsx(
|
|
247
|
+
"path",
|
|
248
|
+
{
|
|
249
|
+
className: "ui-chr-fill-hair ui-chr-line",
|
|
250
|
+
d: "M146 146 Q144 92 200 92 Q258 92 254 148 Q240 122 214 120 Q206 132 186 126 Q164 124 146 146 Z"
|
|
251
|
+
}
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ jsx("path", { d: "M216 96 Q250 104 254 146 Q242 124 220 120 Z", fill: dots }),
|
|
254
|
+
/* @__PURE__ */ jsx("circle", { className: "ui-chr-blush", cx: "168", cy: "172", r: "9" }),
|
|
255
|
+
/* @__PURE__ */ jsx("circle", { className: "ui-chr-blush", cx: "232", cy: "172", r: "9" }),
|
|
256
|
+
/* @__PURE__ */ jsx("g", { className: "ui-chr-brow ui-chr-brow-l", children: /* @__PURE__ */ jsx("path", { className: "ui-chr-line", fill: "none", d: "M172 136 q10 -6 20 -2" }) }),
|
|
257
|
+
/* @__PURE__ */ jsx("g", { className: "ui-chr-brow ui-chr-brow-r", children: /* @__PURE__ */ jsx("path", { className: "ui-chr-line", fill: "none", d: "M208 134 q10 -4 20 2" }) }),
|
|
258
|
+
/* @__PURE__ */ jsx("g", { className: "ui-chr-eyes", children: [182, 218].map((x) => /* @__PURE__ */ jsxs("g", { children: [
|
|
259
|
+
/* @__PURE__ */ jsx("ellipse", { className: "ui-chr-fill-line", cx: x, cy: "156", rx: "6", ry: "8" }),
|
|
260
|
+
/* @__PURE__ */ jsx("circle", { className: "ui-chr-shine", cx: x + 2, cy: "152", r: "2.2" })
|
|
261
|
+
] }, x)) }),
|
|
262
|
+
[182, 218].map((x) => /* @__PURE__ */ jsxs("g", { className: "ui-chr-lid", children: [
|
|
263
|
+
/* @__PURE__ */ jsx("rect", { x: x - 9, y: "146", width: "18", height: "18" }),
|
|
264
|
+
/* @__PURE__ */ jsx("path", { className: "ui-chr-line", fill: "none", d: `M${x - 8} 164 q8 5 16 0` })
|
|
265
|
+
] }, x)),
|
|
266
|
+
/* @__PURE__ */ jsx(
|
|
267
|
+
"path",
|
|
268
|
+
{
|
|
269
|
+
className: "ui-chr-mouth ui-chr-mouth-smile ui-chr-line",
|
|
270
|
+
fill: "none",
|
|
271
|
+
d: "M190 178 q10 8 20 0"
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
/* @__PURE__ */ jsx(
|
|
275
|
+
"path",
|
|
276
|
+
{
|
|
277
|
+
className: "ui-chr-mouth ui-chr-mouth-hush ui-chr-line",
|
|
278
|
+
fill: "none",
|
|
279
|
+
d: "M194 180 h12"
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
/* @__PURE__ */ jsx(
|
|
283
|
+
"path",
|
|
284
|
+
{
|
|
285
|
+
className: "ui-chr-mouth ui-chr-mouth-wobble ui-chr-line",
|
|
286
|
+
fill: "none",
|
|
287
|
+
d: "M188 182 q4 -5 8 0 t8 0 t8 0"
|
|
288
|
+
}
|
|
289
|
+
),
|
|
290
|
+
/* @__PURE__ */ jsx(
|
|
291
|
+
"path",
|
|
292
|
+
{
|
|
293
|
+
className: "ui-chr-mouth ui-chr-mouth-grin ui-chr-fill-line ui-chr-line",
|
|
294
|
+
d: "M186 174 h28 q0 18 -14 18 q-14 0 -14 -18 Z"
|
|
295
|
+
}
|
|
296
|
+
),
|
|
297
|
+
/* @__PURE__ */ jsx(
|
|
298
|
+
"path",
|
|
299
|
+
{
|
|
300
|
+
className: "ui-chr-sweat ui-chr-line",
|
|
301
|
+
strokeWidth: "2",
|
|
302
|
+
d: "M246 118 q8 12 0 16 q-8 -4 0 -16 Z"
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
] }) }) }),
|
|
306
|
+
/* @__PURE__ */ jsx(Arm, { side: "l" }),
|
|
307
|
+
/* @__PURE__ */ jsx(Arm, { side: "r" })
|
|
308
|
+
] }) }) }),
|
|
309
|
+
state === "success" ? /* @__PURE__ */ jsx("g", { transform: "translate(200 210)", children: SPARKS.map((spark) => /* @__PURE__ */ jsx(
|
|
310
|
+
"g",
|
|
311
|
+
{
|
|
312
|
+
className: "ui-auth-spark",
|
|
313
|
+
style: { "--dx": spark.dx, "--dy": spark.dy },
|
|
314
|
+
children: spark.star ? /* @__PURE__ */ jsx(
|
|
315
|
+
"path",
|
|
316
|
+
{
|
|
317
|
+
d: "M0 -9 L2.5 -2.5 L9 0 L2.5 2.5 L0 9 L-2.5 2.5 L-9 0 L-2.5 -2.5 Z",
|
|
318
|
+
fill: "var(--ua-spark-0)",
|
|
319
|
+
stroke: "var(--line)",
|
|
320
|
+
strokeWidth: "1.6"
|
|
321
|
+
}
|
|
322
|
+
) : /* @__PURE__ */ jsx("circle", { r: "5", fill: "var(--ua-spark-1)", stroke: "var(--line)", strokeWidth: "1.6" })
|
|
323
|
+
},
|
|
324
|
+
`${spark.dx}${spark.dy}`
|
|
325
|
+
)) }) : null
|
|
326
|
+
] })
|
|
327
|
+
] })
|
|
328
|
+
] });
|
|
329
|
+
}
|
|
330
|
+
Character.variant = "character";
|
|
331
|
+
export {
|
|
332
|
+
Character
|
|
333
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./character.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./character.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AuthState } from "../auth-illustration/model.js";
|
|
2
|
+
export type AuthPanel = "paper" | "solid";
|
|
3
|
+
export interface AuthContextValue {
|
|
4
|
+
/** Composition of the screen: the card over paper, or a solid side panel with an open form. */
|
|
5
|
+
panel: AuthPanel;
|
|
6
|
+
state: AuthState;
|
|
7
|
+
setState: (state: AuthState) => void;
|
|
8
|
+
/** Fill of the whole form, 0 to 1. */
|
|
9
|
+
progress: number;
|
|
10
|
+
setProgress: (progress: number) => void;
|
|
11
|
+
/** Index of the portal the user is signing in through; the illustration lifts it. */
|
|
12
|
+
activeIndex: number;
|
|
13
|
+
setActiveIndex: (index: number) => void;
|
|
14
|
+
}
|
|
15
|
+
export declare const AuthContext: import("react").Context<AuthContextValue | null>;
|
|
16
|
+
/** The state an `AuthLayout` shares with its illustration and form, or `null` outside one. */
|
|
17
|
+
export declare function useOptionalAuth(): AuthContextValue | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function AuthStyles(): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const CSS = `
|
|
3
|
+
@keyframes ui-auth-spark{0%{opacity:0;transform:scale(.3) rotate(0)}12%{opacity:1}100%{opacity:0;transform:translate(var(--dx),var(--dy)) scale(1.1) rotate(120deg)}}
|
|
4
|
+
@keyframes ui-auth-shake{20%,60%{transform:translateX(-9px)}40%,80%{transform:translateX(9px)}}
|
|
5
|
+
@keyframes ui-auth-rise{from{opacity:0;transform:translateY(18px)}}
|
|
6
|
+
.ui-auth-rise{animation:ui-auth-rise .7s .25s var(--motion-ease,cubic-bezier(.2,.7,.2,1)) backwards}
|
|
7
|
+
.ui-auth-art{--ua-edge:color-mix(in srgb,var(--ink) 88%,var(--surface));--ua-shadow:color-mix(in srgb,black 14%,transparent);--ua-spark-0:var(--accent);--ua-spark-1:var(--accent-2);--ua-spark-2:var(--accent-soft);--ua-spark-3:var(--ink);--ua-bounce:cubic-bezier(.34,1.5,.5,1);--ua-land:cubic-bezier(.2,.9,.25,1.15);--ua-glide:cubic-bezier(.2,.7,.2,1)}
|
|
8
|
+
.ui-auth-art[data-panel=solid]{--ua-edge:var(--auth-art-ink);--ua-tint:color-mix(in srgb,var(--auth-art-bg) 22%,white);--ua-mid:color-mix(in srgb,var(--auth-art-ink) 30%,var(--auth-art-bg));--ua-shadow:color-mix(in srgb,var(--auth-art-ink) 22%,transparent);--ua-spark-0:var(--auth-art-ink);--ua-spark-1:var(--ua-tint);--ua-spark-2:color-mix(in srgb,var(--auth-art-ink) 55%,var(--auth-art-bg));--ua-spark-3:var(--auth-art-ink)}
|
|
9
|
+
.ui-auth-art>svg{display:block;width:100%;height:auto;max-height:var(--auth-art-max-h,none);overflow:visible}
|
|
10
|
+
.ui-auth-art[data-state=error]>svg{animation:ui-auth-shake .5s var(--ua-glide)}
|
|
11
|
+
.ui-auth-g{stroke-width:3;stroke-linejoin:round;stroke:var(--glyph-b)}
|
|
12
|
+
.ui-auth-ga{fill:var(--glyph-a)}
|
|
13
|
+
.ui-auth-gc{fill:var(--glyph-c)}
|
|
14
|
+
.ui-auth-gline{fill:none}
|
|
15
|
+
.ui-auth-spark{fill:var(--ua-spark-0);opacity:0;transform-box:fill-box;transform-origin:center;animation:ui-auth-spark 1s .75s cubic-bezier(.1,.7,.3,1) both}
|
|
16
|
+
.ui-auth-spark[data-tone="1"]{fill:var(--ua-spark-1)}
|
|
17
|
+
.ui-auth-spark[data-tone="2"]{fill:var(--ua-spark-2)}
|
|
18
|
+
.ui-auth-spark[data-tone="3"]{fill:var(--ua-spark-3)}
|
|
19
|
+
@media (prefers-reduced-motion:reduce){
|
|
20
|
+
.ui-auth-rise,.ui-auth-art[data-state=error]>svg{animation:none}
|
|
21
|
+
.ui-auth-spark{animation:none;opacity:1;transform:translate(calc(var(--dx) * .62),calc(var(--dy) * .62))}
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
24
|
+
function AuthStyles() {
|
|
25
|
+
return /* @__PURE__ */ jsx("style", { href: "jcsoftdev-ui-auth-styles", precedence: "default", children: CSS });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
AuthStyles
|
|
29
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The three portal glyphs (a book, a house and a graduation cap) on a 100px square. They paint with
|
|
4
|
+
* `--glyph-a` (fill), `--glyph-b` (outline), `--glyph-c` (detail) and `--glyph-line` (accent line).
|
|
5
|
+
*/
|
|
6
|
+
export declare const PORTAL_GLYPHS: readonly ReactNode[];
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
const PORTAL_GLYPHS = [
|
|
3
|
+
/* @__PURE__ */ jsxs("g", { children: [
|
|
4
|
+
/* @__PURE__ */ jsx(
|
|
5
|
+
"path",
|
|
6
|
+
{
|
|
7
|
+
className: "ui-auth-g ui-auth-ga",
|
|
8
|
+
d: "M18 30 Q34 23 50 32 Q66 23 82 30 V74 Q66 67 50 76 Q34 67 18 74Z"
|
|
9
|
+
}
|
|
10
|
+
),
|
|
11
|
+
/* @__PURE__ */ jsx(
|
|
12
|
+
"path",
|
|
13
|
+
{
|
|
14
|
+
className: "ui-auth-g ui-auth-gline",
|
|
15
|
+
d: "M50 32V76",
|
|
16
|
+
style: { stroke: "var(--glyph-line)" }
|
|
17
|
+
}
|
|
18
|
+
)
|
|
19
|
+
] }, "book"),
|
|
20
|
+
/* @__PURE__ */ jsxs("g", { children: [
|
|
21
|
+
/* @__PURE__ */ jsx("path", { className: "ui-auth-g ui-auth-ga", d: "M50 20 L84 48 H75 V78 H25 V48 H16Z" }),
|
|
22
|
+
/* @__PURE__ */ jsx("rect", { className: "ui-auth-g ui-auth-gc", x: "42", y: "56", width: "16", height: "22" })
|
|
23
|
+
] }, "house"),
|
|
24
|
+
/* @__PURE__ */ jsxs("g", { children: [
|
|
25
|
+
/* @__PURE__ */ jsx("path", { className: "ui-auth-g ui-auth-ga", d: "M50 24 L90 44 L50 64 L10 44Z" }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
"path",
|
|
28
|
+
{
|
|
29
|
+
className: "ui-auth-g ui-auth-gline",
|
|
30
|
+
d: "M28 55 V70 Q50 84 72 70 V55",
|
|
31
|
+
style: { stroke: "var(--glyph-line)", strokeWidth: 5 }
|
|
32
|
+
}
|
|
33
|
+
),
|
|
34
|
+
/* @__PURE__ */ jsx("path", { className: "ui-auth-g ui-auth-gline", d: "M88 46 V72" })
|
|
35
|
+
] }, "cap")
|
|
36
|
+
];
|
|
37
|
+
export {
|
|
38
|
+
PORTAL_GLYPHS
|
|
39
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { type ReactNode, type RefObject } from "react";
|
|
2
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
export interface LoginPortal {
|
|
4
|
+
/** Value reported to `onSubmit` and the form's `portal` field. */
|
|
5
|
+
value: string;
|
|
6
|
+
label: string;
|
|
7
|
+
/** Line under the title while this portal is selected. */
|
|
8
|
+
description?: string;
|
|
9
|
+
/** Label and placeholder of the identifier field while this portal is selected. */
|
|
10
|
+
identifierLabel?: string;
|
|
11
|
+
/** Icon of the tile; the first three portals fall back to a book, a house and a cap. */
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export type LoginFormPart = "root" | "header" | "title" | "description" | "portals" | "portal" | "identifier" | "password" | "error" | "submit" | "options" | "providers" | "footer";
|
|
15
|
+
export type LoginFormAppearance = "card" | "open";
|
|
16
|
+
export type LoginField = "identifier" | "password";
|
|
17
|
+
/**
|
|
18
|
+
* Where the current error is shown: `field` under the field it is about (a field left empty),
|
|
19
|
+
* `form` in `LoginForm.Error` (the sign-in itself failed).
|
|
20
|
+
*/
|
|
21
|
+
export type LoginErrorPlacement = "field" | "form";
|
|
22
|
+
export interface LoginFormContextValue {
|
|
23
|
+
ids: {
|
|
24
|
+
identifier: string;
|
|
25
|
+
password: string;
|
|
26
|
+
/** `LoginForm.Error`, the live region of errors about the whole sign-in. */
|
|
27
|
+
error: string;
|
|
28
|
+
/** Message under the identifier or the password, for errors about that field. */
|
|
29
|
+
fieldError: string;
|
|
30
|
+
portals: string;
|
|
31
|
+
};
|
|
32
|
+
portals: readonly LoginPortal[];
|
|
33
|
+
portal: LoginPortal | undefined;
|
|
34
|
+
setPortal: (value: string) => void;
|
|
35
|
+
identifier: string;
|
|
36
|
+
password: string;
|
|
37
|
+
appearance: LoginFormAppearance;
|
|
38
|
+
remember: boolean;
|
|
39
|
+
setRemember: (remember: boolean) => void;
|
|
40
|
+
loading: boolean;
|
|
41
|
+
error: string | null;
|
|
42
|
+
/** The field the current error belongs to, so it can be marked invalid. */
|
|
43
|
+
invalidField: LoginField | null;
|
|
44
|
+
errorPlacement: LoginErrorPlacement | null;
|
|
45
|
+
setValue: (field: LoginField, value: string) => void;
|
|
46
|
+
identifierRef: RefObject<HTMLInputElement | null>;
|
|
47
|
+
passwordRef: RefObject<HTMLInputElement | null>;
|
|
48
|
+
classNames: ClassNames<LoginFormPart> | undefined;
|
|
49
|
+
}
|
|
50
|
+
export declare const LoginFormContext: import("react").Context<LoginFormContextValue | null>;
|
|
51
|
+
export declare function useLoginForm(part: string): LoginFormContextValue;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
3
|
+
const LoginFormContext = createContext(null);
|
|
4
|
+
function useLoginForm(part) {
|
|
5
|
+
const context = useContext(LoginFormContext);
|
|
6
|
+
if (!context) throw new Error(`LoginForm.${part} must be rendered inside a LoginForm`);
|
|
7
|
+
return context;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
LoginFormContext,
|
|
11
|
+
useLoginForm
|
|
12
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export * from "./login-form.js";
|
|
2
|
+
export { LoginFormError, type LoginFormErrorProps, type LoginFormFieldProps, LoginFormFooter, type LoginFormFooterProps, LoginFormHeader, type LoginFormHeaderProps, LoginFormIdentifier, LoginFormOptions, type LoginFormOptionsProps, LoginFormPassword, type LoginFormPasswordProps, LoginFormPortals, type LoginFormPortalsProps, LoginFormProviders, type LoginFormProvidersProps, LoginFormSubmit, type LoginFormSubmitProps, } from "./parts.js";
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export * from "./login-form.js";
|
|
2
|
+
import {
|
|
3
|
+
LoginFormError,
|
|
4
|
+
LoginFormFooter,
|
|
5
|
+
LoginFormHeader,
|
|
6
|
+
LoginFormIdentifier,
|
|
7
|
+
LoginFormOptions,
|
|
8
|
+
LoginFormPassword,
|
|
9
|
+
LoginFormPortals,
|
|
10
|
+
LoginFormProviders,
|
|
11
|
+
LoginFormSubmit
|
|
12
|
+
} from "./parts.js";
|
|
13
|
+
export {
|
|
14
|
+
LoginFormError,
|
|
15
|
+
LoginFormFooter,
|
|
16
|
+
LoginFormHeader,
|
|
17
|
+
LoginFormIdentifier,
|
|
18
|
+
LoginFormOptions,
|
|
19
|
+
LoginFormPassword,
|
|
20
|
+
LoginFormPortals,
|
|
21
|
+
LoginFormProviders,
|
|
22
|
+
LoginFormSubmit
|
|
23
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
|
2
|
+
import type { ClassNames } from "../../utils/class-names.js";
|
|
3
|
+
import { type LoginFormAppearance, type LoginFormPart, type LoginPortal } from "./context.js";
|
|
4
|
+
import { LoginFormError, LoginFormFooter, LoginFormHeader, LoginFormIdentifier, LoginFormOptions, LoginFormPassword, LoginFormPortals, LoginFormProviders, LoginFormSubmit } from "./parts.js";
|
|
5
|
+
export type { LoginFormAppearance, LoginFormPart, LoginPortal } from "./context.js";
|
|
6
|
+
export interface LoginValues {
|
|
7
|
+
identifier: string;
|
|
8
|
+
password: string;
|
|
9
|
+
/** Value of the selected portal; `undefined` when the form has none. */
|
|
10
|
+
portal: string | undefined;
|
|
11
|
+
/** State of `LoginForm.Options`' remember-me checkbox. */
|
|
12
|
+
remember: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface LoginFormProps extends Omit<ComponentPropsWithoutRef<"form">, "onSubmit" | "children"> {
|
|
15
|
+
/**
|
|
16
|
+
* Called with the values when the form is submitted with both fields filled. A returned promise
|
|
17
|
+
* keeps the form loading; if it resolves the form reads as signed in, if it rejects the message of
|
|
18
|
+
* the error (or the localized default) is shown. Leave it out and drive `loading`, `error` and
|
|
19
|
+
* `success` yourself.
|
|
20
|
+
*/
|
|
21
|
+
onSubmit?: (values: LoginValues) => void | Promise<void>;
|
|
22
|
+
/** Portals the person can sign in through. With two or more, `LoginForm.Portals` renders a picker. */
|
|
23
|
+
portals?: readonly LoginPortal[];
|
|
24
|
+
/** Selected portal value. Controlled; omit it for an uncontrolled picker. */
|
|
25
|
+
portal?: string;
|
|
26
|
+
defaultPortal?: string;
|
|
27
|
+
onPortalChange?: (value: string) => void;
|
|
28
|
+
/**
|
|
29
|
+
* `card` is the form inside the panel card, labels hidden visually. `open` has no card chrome and
|
|
30
|
+
* shows the labels above the fields with a pill button. Defaults to `open` inside an
|
|
31
|
+
* `AuthLayout panel="solid"` and `card` otherwise.
|
|
32
|
+
*/
|
|
33
|
+
appearance?: LoginFormAppearance;
|
|
34
|
+
/** The form is waiting for the server. Overrides the state `onSubmit` keeps. */
|
|
35
|
+
loading?: boolean;
|
|
36
|
+
/** Sign-in error to show. `null` clears it. Overrides the state `onSubmit` keeps. */
|
|
37
|
+
error?: string | null;
|
|
38
|
+
/** The sign-in worked. Overrides the state `onSubmit` keeps. */
|
|
39
|
+
success?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* Parts to place yourself: `LoginForm.Header`, `.Portals`, `.Error`, `.Identifier`, `.Password`,
|
|
42
|
+
* `.Options`, `.Submit`, `.Providers` and `.Footer`. Without children the form renders them in that
|
|
43
|
+
* order (no `.Options`, `.Providers` or `.Footer`). A field left empty is reported under that field;
|
|
44
|
+
* `.Error` shows only errors about the sign-in itself, so place it above the fields.
|
|
45
|
+
*/
|
|
46
|
+
children?: ReactNode;
|
|
47
|
+
/** Per-part classes merged with `cn`; consumer classes win. `className` still targets the root and is merged last. */
|
|
48
|
+
classNames?: ClassNames<LoginFormPart>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Sign-in form that works alone and, inside an `AuthLayout`, drives its illustration: focusing the
|
|
52
|
+
* identifier or the password, typing, failing and signing in all update the layout's state and
|
|
53
|
+
* progress, and the selected portal becomes the illustration's active slab.
|
|
54
|
+
*/
|
|
55
|
+
export declare function LoginForm({ onSubmit, portals, portal: portalProp, appearance: appearanceProp, defaultPortal, onPortalChange, loading: loadingProp, error: errorProp, success: successProp, children, className, classNames, onFocus, onBlur, ...props }: LoginFormProps): import("react").JSX.Element;
|
|
56
|
+
export declare namespace LoginForm {
|
|
57
|
+
var Header: typeof LoginFormHeader;
|
|
58
|
+
var Portals: typeof LoginFormPortals;
|
|
59
|
+
var Identifier: typeof LoginFormIdentifier;
|
|
60
|
+
var Password: typeof LoginFormPassword;
|
|
61
|
+
var Options: typeof LoginFormOptions;
|
|
62
|
+
var Providers: typeof LoginFormProviders;
|
|
63
|
+
var Error: typeof LoginFormError;
|
|
64
|
+
var Submit: typeof LoginFormSubmit;
|
|
65
|
+
var Footer: typeof LoginFormFooter;
|
|
66
|
+
}
|