@alepha/ui 0.25.1 → 0.26.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/LICENSE +21 -0
- package/README.md +136 -2
- package/dist/components/account/account-connections.d.ts +16 -0
- package/dist/components/account/account-connections.d.ts.map +1 -0
- package/dist/components/account/account-connections.js +76 -0
- package/dist/components/account/account-connections.js.map +1 -0
- package/dist/components/account/account-delete-dialog.d.ts +44 -0
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -0
- package/dist/components/account/account-delete-dialog.js +126 -0
- package/dist/components/account/account-delete-dialog.js.map +1 -0
- package/dist/components/account/account-header.d.ts +33 -0
- package/dist/components/account/account-header.d.ts.map +1 -0
- package/dist/components/account/account-header.js +41 -0
- package/dist/components/account/account-header.js.map +1 -0
- package/dist/components/account/account-keys.d.ts +23 -0
- package/dist/components/account/account-keys.d.ts.map +1 -0
- package/dist/components/account/account-keys.js +168 -0
- package/dist/components/account/account-keys.js.map +1 -0
- package/dist/components/account/account-layout.d.ts +32 -0
- package/dist/components/account/account-layout.d.ts.map +1 -0
- package/dist/components/account/account-layout.js +53 -0
- package/dist/components/account/account-layout.js.map +1 -0
- package/dist/components/account/account-password-dialog.d.ts +31 -0
- package/dist/components/account/account-password-dialog.d.ts.map +1 -0
- package/dist/components/account/account-password-dialog.js +120 -0
- package/dist/components/account/account-password-dialog.js.map +1 -0
- package/dist/components/account/account-profile.d.ts +27 -0
- package/dist/components/account/account-profile.d.ts.map +1 -0
- package/dist/components/account/account-profile.js +217 -0
- package/dist/components/account/account-profile.js.map +1 -0
- package/dist/components/account/account-router-options.d.ts +77 -0
- package/dist/components/account/account-router-options.d.ts.map +1 -0
- package/dist/components/account/account-router-options.js +22 -0
- package/dist/components/account/account-router-options.js.map +1 -0
- package/dist/components/account/account-router-page.d.ts +49 -0
- package/dist/components/account/account-router-page.d.ts.map +1 -0
- package/dist/components/account/account-router-page.js +61 -0
- package/dist/components/account/account-router-page.js.map +1 -0
- package/dist/components/account/account-router.d.ts +214 -0
- package/dist/components/account/account-router.d.ts.map +1 -0
- package/dist/components/account/account-router.js +216 -0
- package/dist/components/account/account-router.js.map +1 -0
- package/dist/components/account/account-security.d.ts +22 -0
- package/dist/components/account/account-security.d.ts.map +1 -0
- package/dist/components/account/account-security.js +107 -0
- package/dist/components/account/account-security.js.map +1 -0
- package/dist/components/account/account-sessions.d.ts +17 -0
- package/dist/components/account/account-sessions.d.ts.map +1 -0
- package/dist/components/account/account-sessions.js +108 -0
- package/dist/components/account/account-sessions.js.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts +39 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.js +40 -0
- package/dist/components/action-error-toaster/action-error-toaster.js.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts +16 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.js +117 -0
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -0
- package/dist/components/admin/admin-analytics-results.d.ts +15 -0
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-results.js +56 -0
- package/dist/components/admin/admin-analytics-results.js.map +1 -0
- package/dist/components/admin/admin-analytics.d.ts +9 -0
- package/dist/components/admin/admin-analytics.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics.js +66 -0
- package/dist/components/admin/admin-analytics.js.map +1 -0
- package/dist/components/admin/admin-audits.d.ts +4 -0
- package/dist/components/admin/admin-audits.d.ts.map +1 -0
- package/dist/components/admin/admin-audits.js +173 -0
- package/dist/components/admin/admin-audits.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +4 -0
- package/dist/components/admin/admin-files.d.ts.map +1 -0
- package/dist/components/admin/admin-files.js +237 -0
- package/dist/components/admin/admin-files.js.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +11 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.js +200 -0
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts +9 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.js +26 -0
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -0
- package/dist/components/admin/admin-jobs.d.ts +4 -0
- package/dist/components/admin/admin-jobs.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs.js +248 -0
- package/dist/components/admin/admin-jobs.js.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts +15 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.js +66 -0
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -0
- package/dist/components/admin/admin-keys.d.ts +4 -0
- package/dist/components/admin/admin-keys.d.ts.map +1 -0
- package/dist/components/admin/admin-keys.js +161 -0
- package/dist/components/admin/admin-keys.js.map +1 -0
- package/dist/components/admin/admin-layout.d.ts +33 -0
- package/dist/components/admin/admin-layout.d.ts.map +1 -0
- package/dist/components/admin/admin-layout.js +101 -0
- package/dist/components/admin/admin-layout.js.map +1 -0
- package/dist/components/admin/admin-notifications.d.ts +4 -0
- package/dist/components/admin/admin-notifications.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications.js +99 -0
- package/dist/components/admin/admin-notifications.js.map +1 -0
- package/dist/components/admin/admin-page.d.ts +16 -0
- package/dist/components/admin/admin-page.d.ts.map +1 -0
- package/dist/components/admin/admin-page.js +15 -0
- package/dist/components/admin/admin-page.js.map +1 -0
- package/dist/components/admin/admin-parameters.d.ts +26 -0
- package/dist/components/admin/admin-parameters.d.ts.map +1 -0
- package/dist/components/admin/admin-parameters.js +560 -0
- package/dist/components/admin/admin-parameters.js.map +1 -0
- package/dist/components/admin/admin-payments.d.ts +4 -0
- package/dist/components/admin/admin-payments.d.ts.map +1 -0
- package/dist/components/admin/admin-payments.js +72 -0
- package/dist/components/admin/admin-payments.js.map +1 -0
- package/dist/components/admin/admin-router-options.d.ts +135 -0
- package/dist/components/admin/admin-router-options.d.ts.map +1 -0
- package/dist/components/admin/admin-router-options.js +29 -0
- package/dist/components/admin/admin-router-options.js.map +1 -0
- package/dist/components/admin/admin-router-page.d.ts +54 -0
- package/dist/components/admin/admin-router-page.d.ts.map +1 -0
- package/dist/components/admin/admin-router-page.js +66 -0
- package/dist/components/admin/admin-router-page.js.map +1 -0
- package/dist/components/admin/admin-router.d.ts +169 -0
- package/dist/components/admin/admin-router.d.ts.map +1 -0
- package/dist/components/admin/admin-router.js +346 -0
- package/dist/components/admin/admin-router.js.map +1 -0
- package/dist/components/admin/admin-sessions.d.ts +4 -0
- package/dist/components/admin/admin-sessions.d.ts.map +1 -0
- package/dist/components/admin/admin-sessions.js +124 -0
- package/dist/components/admin/admin-sessions.js.map +1 -0
- package/dist/components/admin/admin-user-cell.d.ts +37 -0
- package/dist/components/admin/admin-user-cell.d.ts.map +1 -0
- package/dist/components/admin/admin-user-cell.js +35 -0
- package/dist/components/admin/admin-user-cell.js.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js +55 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +14 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js +162 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts +26 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js +60 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js +47 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts +10 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.js +13 -0
- package/dist/components/admin/admin-user-detail-password-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts +56 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js +73 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts +18 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js +21 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts +20 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.js +70 -0
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +25 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js +64 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail.d.ts +39 -0
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail.js +386 -0
- package/dist/components/admin/admin-user-detail.js.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts +23 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.js +77 -0
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -0
- package/dist/components/admin/admin-users-status-filter.d.ts +13 -0
- package/dist/components/admin/admin-users-status-filter.d.ts.map +1 -0
- package/dist/components/admin/admin-users-status-filter.js +41 -0
- package/dist/components/admin/admin-users-status-filter.js.map +1 -0
- package/dist/components/admin/admin-users.d.ts +16 -0
- package/dist/components/admin/admin-users.d.ts.map +1 -0
- package/dist/components/admin/admin-users.js +325 -0
- package/dist/components/admin/admin-users.js.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +11 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js +190 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +9 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.js +153 -0
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts +12 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.js +30 -0
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -0
- package/dist/components/admin/admin-workflows.d.ts +4 -0
- package/dist/components/admin/admin-workflows.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows.js +145 -0
- package/dist/components/admin/admin-workflows.js.map +1 -0
- package/dist/components/admin/diff-lines.d.ts +13 -0
- package/dist/components/admin/diff-lines.d.ts.map +1 -0
- package/dist/components/admin/diff-lines.js +57 -0
- package/dist/components/admin/diff-lines.js.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts +36 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.js +58 -0
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -0
- package/dist/components/admin/parameter-history-item.d.ts +17 -0
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -0
- package/dist/components/admin/parameter-history-item.js +177 -0
- package/dist/components/admin/parameter-history-item.js.map +1 -0
- package/dist/components/admin/parameter-json-dialog.d.ts +13 -0
- package/dist/components/admin/parameter-json-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-json-dialog.js +63 -0
- package/dist/components/admin/parameter-json-dialog.js.map +1 -0
- package/dist/components/admin/parameter-save-dialog.d.ts +26 -0
- package/dist/components/admin/parameter-save-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-save-dialog.js +74 -0
- package/dist/components/admin/parameter-save-dialog.js.map +1 -0
- package/dist/components/admin/use-confirmed-action.d.ts +53 -0
- package/dist/components/admin/use-confirmed-action.d.ts.map +1 -0
- package/dist/components/admin/use-confirmed-action.js +50 -0
- package/dist/components/admin/use-confirmed-action.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +218 -0
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table.js +565 -0
- package/dist/components/alepha-table/alepha-table.js.map +1 -0
- package/dist/components/alepha-table/use-table-selection.d.ts +34 -0
- package/dist/components/alepha-table/use-table-selection.d.ts.map +1 -0
- package/dist/components/alepha-table/use-table-selection.js +45 -0
- package/dist/components/alepha-table/use-table-selection.js.map +1 -0
- package/dist/components/app-actions/app-actions.d.ts +74 -0
- package/dist/components/app-actions/app-actions.d.ts.map +1 -0
- package/dist/components/app-actions/app-actions.js +77 -0
- package/dist/components/app-actions/app-actions.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +135 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +276 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/auth/auth-login.d.ts +40 -0
- package/dist/components/auth/auth-login.d.ts.map +1 -0
- package/dist/components/auth/auth-login.js +237 -0
- package/dist/components/auth/auth-login.js.map +1 -0
- package/dist/components/auth/auth-register.d.ts +35 -0
- package/dist/components/auth/auth-register.d.ts.map +1 -0
- package/dist/components/auth/auth-register.js +478 -0
- package/dist/components/auth/auth-register.js.map +1 -0
- package/dist/components/auth/auth-reset-password.d.ts +21 -0
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -0
- package/dist/components/auth/auth-reset-password.js +283 -0
- package/dist/components/auth/auth-reset-password.js.map +1 -0
- package/dist/components/auth/auth-router.d.ts +245 -0
- package/dist/components/auth/auth-router.d.ts.map +1 -0
- package/dist/components/auth/auth-router.js +117 -0
- package/dist/components/auth/auth-router.js.map +1 -0
- package/dist/components/auth/auth-verify-email.d.ts +19 -0
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -0
- package/dist/components/auth/auth-verify-email.js +124 -0
- package/dist/components/auth/auth-verify-email.js.map +1 -0
- package/dist/components/auth/provider-labels.d.ts +9 -0
- package/dist/components/auth/provider-labels.d.ts.map +1 -0
- package/dist/components/auth/provider-labels.js +20 -0
- package/dist/components/auth/provider-labels.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts +219 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -0
- package/dist/components/auto-form/auto-form.js +412 -0
- package/dist/components/auto-form/auto-form.js.map +1 -0
- package/dist/components/brand-icon/brand-icon.d.ts +18 -0
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -0
- package/dist/components/brand-icon/brand-icon.js +84 -0
- package/dist/components/brand-icon/brand-icon.js.map +1 -0
- package/dist/components/button-dark/button-dark.d.ts +25 -0
- package/dist/components/button-dark/button-dark.d.ts.map +1 -0
- package/dist/components/button-dark/button-dark.js +44 -0
- package/dist/components/button-dark/button-dark.js.map +1 -0
- package/dist/components/button-language/button-language.d.ts +24 -0
- package/dist/components/button-language/button-language.d.ts.map +1 -0
- package/dist/components/button-language/button-language.js +50 -0
- package/dist/components/button-language/button-language.js.map +1 -0
- package/dist/components/button-theme/button-theme.d.ts +33 -0
- package/dist/components/button-theme/button-theme.d.ts.map +1 -0
- package/dist/components/button-theme/button-theme.js +90 -0
- package/dist/components/button-theme/button-theme.js.map +1 -0
- package/dist/components/button-user/button-user.d.ts +147 -0
- package/dist/components/button-user/button-user.d.ts.map +1 -0
- package/dist/components/button-user/button-user.js +147 -0
- package/dist/components/button-user/button-user.js.map +1 -0
- package/dist/components/captcha/turnstile-widget.d.ts +59 -0
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -0
- package/dist/components/captcha/turnstile-widget.js +97 -0
- package/dist/components/captcha/turnstile-widget.js.map +1 -0
- package/dist/components/control/control.d.ts +200 -0
- package/dist/components/control/control.d.ts.map +1 -0
- package/dist/components/control/control.js +300 -0
- package/dist/components/control/control.js.map +1 -0
- package/dist/components/control-array/control-array.d.ts +77 -0
- package/dist/components/control-array/control-array.d.ts.map +1 -0
- package/dist/components/control-array/control-array.js +444 -0
- package/dist/components/control-array/control-array.js.map +1 -0
- package/dist/components/control-base/field-i18n.d.ts +30 -0
- package/dist/components/control-base/field-i18n.d.ts.map +1 -0
- package/dist/components/control-base/field-i18n.js +27 -0
- package/dist/components/control-base/field-i18n.js.map +1 -0
- package/dist/components/control-base/form-field.d.ts +128 -0
- package/dist/components/control-base/form-field.d.ts.map +1 -0
- package/dist/components/control-base/form-field.js +208 -0
- package/dist/components/control-base/form-field.js.map +1 -0
- package/dist/components/control-base/grid.d.ts +18 -0
- package/dist/components/control-base/grid.d.ts.map +1 -0
- package/dist/components/control-base/grid.js +46 -0
- package/dist/components/control-base/grid.js.map +1 -0
- package/dist/components/control-base/icon-hint.d.ts +9 -0
- package/dist/components/control-base/icon-hint.d.ts.map +1 -0
- package/dist/components/control-base/icon-hint.js +35 -0
- package/dist/components/control-base/icon-hint.js.map +1 -0
- package/dist/components/control-date/control-date.d.ts +34 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -0
- package/dist/components/control-date/control-date.js +111 -0
- package/dist/components/control-date/control-date.js.map +1 -0
- package/dist/components/control-number/control-number.d.ts +38 -0
- package/dist/components/control-number/control-number.d.ts.map +1 -0
- package/dist/components/control-number/control-number.js +77 -0
- package/dist/components/control-number/control-number.js.map +1 -0
- package/dist/components/control-object/control-object.d.ts +45 -0
- package/dist/components/control-object/control-object.d.ts.map +1 -0
- package/dist/components/control-object/control-object.js +110 -0
- package/dist/components/control-object/control-object.js.map +1 -0
- package/dist/components/control-password/control-password.d.ts +28 -0
- package/dist/components/control-password/control-password.d.ts.map +1 -0
- package/dist/components/control-password/control-password.js +65 -0
- package/dist/components/control-password/control-password.js.map +1 -0
- package/dist/components/control-select/control-select.d.ts +128 -0
- package/dist/components/control-select/control-select.d.ts.map +1 -0
- package/dist/components/control-select/control-select.js +363 -0
- package/dist/components/control-select/control-select.js.map +1 -0
- package/dist/components/control-upload/control-upload.d.ts +67 -0
- package/dist/components/control-upload/control-upload.d.ts.map +1 -0
- package/dist/components/control-upload/control-upload.js +294 -0
- package/dist/components/control-upload/control-upload.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts +31 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -0
- package/dist/components/file-image/file-image.js +27 -0
- package/dist/components/file-image/file-image.js.map +1 -0
- package/dist/components/language-toggle/language-toggle.d.ts +8 -0
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -0
- package/dist/components/language-toggle/language-toggle.js +49 -0
- package/dist/components/language-toggle/language-toggle.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.css +114 -0
- package/dist/components/markdown-view/markdown-view.d.ts +21 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -0
- package/dist/components/markdown-view/markdown-view.js +104 -0
- package/dist/components/markdown-view/markdown-view.js.map +1 -0
- package/dist/components/nav-shell/nav-page.d.ts +24 -0
- package/dist/components/nav-shell/nav-page.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-page.js +28 -0
- package/dist/components/nav-shell/nav-page.js.map +1 -0
- package/dist/components/nav-shell/nav-shell.d.ts +26 -0
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-shell.js +53 -0
- package/dist/components/nav-shell/nav-shell.js.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts +65 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.js +87 -0
- package/dist/components/nav-shell/nav-tree-util.js.map +1 -0
- package/dist/components/nav-shell/spotlight.d.ts +37 -0
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -0
- package/dist/components/nav-shell/spotlight.js +102 -0
- package/dist/components/nav-shell/spotlight.js.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts +24 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js +36 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts +45 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.js +60 -0
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts +21 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.js +48 -0
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts +35 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -0
- package/dist/components/settings/settings-danger-section.js +42 -0
- package/dist/components/settings/settings-danger-section.js.map +1 -0
- package/dist/components/settings/settings-heading.d.ts +36 -0
- package/dist/components/settings/settings-heading.d.ts.map +1 -0
- package/dist/components/settings/settings-heading.js +39 -0
- package/dist/components/settings/settings-heading.js.map +1 -0
- package/dist/components/settings/settings-layout.d.ts +81 -0
- package/dist/components/settings/settings-layout.d.ts.map +1 -0
- package/dist/components/settings/settings-layout.js +56 -0
- package/dist/components/settings/settings-layout.js.map +1 -0
- package/dist/components/settings/settings-nav.d.ts +85 -0
- package/dist/components/settings/settings-nav.d.ts.map +1 -0
- package/dist/components/settings/settings-nav.js +91 -0
- package/dist/components/settings/settings-nav.js.map +1 -0
- package/dist/components/settings/settings-row.d.ts +45 -0
- package/dist/components/settings/settings-row.d.ts.map +1 -0
- package/dist/components/settings/settings-row.js +44 -0
- package/dist/components/settings/settings-row.js.map +1 -0
- package/dist/components/settings/settings-section.d.ts +36 -0
- package/dist/components/settings/settings-section.d.ts.map +1 -0
- package/dist/components/settings/settings-section.js +36 -0
- package/dist/components/settings/settings-section.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +55 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +96 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +44 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +15 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +52 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +8 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +31 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +73 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +43 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +18 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +60 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +119 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +12 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +134 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +45 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +151 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +22 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +26 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +25 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +164 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.d.ts +20 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +89 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +134 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +93 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.d.ts.map +1 -0
- package/dist/components/ui/direction.js +3 -0
- package/dist/components/ui/drawer.d.ts +17 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +125 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +138 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +61 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +38 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +19 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +80 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +49 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +16 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +15 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +137 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +84 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +18 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +87 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +56 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +8 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +46 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +29 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +30 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +38 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +46 -0
- package/dist/components/ui/segmented.d.ts.map +1 -0
- package/dist/components/ui/segmented.js +119 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +99 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +17 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +15 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +90 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +64 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +388 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +14 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +35 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +33 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +17 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +68 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +47 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +54 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +38 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/use-dialog/use-dialog.d.ts +61 -0
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -0
- package/dist/components/use-dialog/use-dialog.js +139 -0
- package/dist/components/use-dialog/use-dialog.js.map +1 -0
- package/dist/components/use-toast/use-toast.d.ts +37 -0
- package/dist/components/use-toast/use-toast.d.ts.map +1 -0
- package/dist/components/use-toast/use-toast.js +32 -0
- package/dist/components/use-toast/use-toast.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +20 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/i18n-fr.d.ts +46 -0
- package/dist/lib/i18n-fr.d.ts.map +1 -0
- package/dist/lib/i18n-fr.js +505 -0
- package/dist/lib/i18n-fr.js.map +1 -0
- package/dist/lib/resize-image.d.ts +50 -0
- package/dist/lib/resize-image.d.ts.map +1 -0
- package/dist/lib/resize-image.js +68 -0
- package/dist/lib/resize-image.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +254 -0
- package/package.json +46 -15
- package/src/components/account/__tests__/account-router.spec.ts +201 -0
- package/src/components/account/account-connections.tsx +111 -0
- package/src/components/account/account-delete-dialog.tsx +184 -0
- package/src/components/account/account-header.tsx +57 -0
- package/src/components/account/account-keys.tsx +221 -0
- package/src/components/account/account-layout.tsx +66 -0
- package/src/components/account/account-password-dialog.tsx +152 -0
- package/src/components/account/account-profile.tsx +342 -0
- package/src/components/account/account-router-options.tsx +88 -0
- package/src/components/account/account-router-page.tsx +69 -0
- package/src/components/account/account-router.tsx +233 -0
- package/src/components/account/account-security.tsx +150 -0
- package/src/components/account/account-sessions.tsx +140 -0
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +62 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +82 -0
- package/src/components/admin/__tests__/admin-router-page.spec.ts +54 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +208 -0
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +99 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +29 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +149 -0
- package/src/components/admin/admin-analytics-results.tsx +95 -0
- package/src/components/admin/admin-analytics.tsx +104 -0
- package/src/components/admin/admin-audits.tsx +12 -15
- package/src/components/admin/admin-files.tsx +10 -18
- package/src/components/admin/admin-jobs-executions-panel.tsx +2 -1
- package/src/components/admin/admin-jobs.tsx +3 -1
- package/src/components/admin/admin-keys-token-dialog.tsx +123 -0
- package/src/components/admin/admin-keys.tsx +54 -3
- package/src/components/admin/admin-layout.tsx +107 -0
- package/src/components/admin/admin-payments.tsx +4 -5
- package/src/components/admin/admin-router-options.tsx +150 -0
- package/src/components/admin/admin-router-page.tsx +74 -0
- package/src/components/admin/admin-router.tsx +379 -0
- package/src/components/admin/admin-sessions.tsx +2 -16
- package/src/components/admin/admin-user-cell.tsx +70 -0
- package/src/components/admin/admin-user-detail-overview-tab.tsx +28 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +146 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +147 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -1
- package/src/components/admin/admin-user-detail.tsx +76 -32
- package/src/components/admin/admin-users-status-filter.tsx +2 -0
- package/src/components/admin/admin-workflows-execution-sheet.tsx +277 -0
- package/src/components/admin/admin-workflows-executions-panel.tsx +170 -0
- package/src/components/admin/admin-workflows-status-badge.tsx +40 -0
- package/src/components/admin/admin-workflows.tsx +207 -0
- package/src/components/alepha-table/alepha-table.tsx +91 -19
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +79 -0
- package/src/components/app-actions/app-actions.tsx +118 -0
- package/src/components/app-shell/app-shell.tsx +122 -0
- package/src/components/auth/auth-register.tsx +55 -17
- package/src/components/auth/auth-reset-password.tsx +81 -8
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +237 -0
- package/src/components/auto-form/auto-form.tsx +113 -27
- package/src/components/button-user/button-user.tsx +121 -5
- package/src/components/control/control.tsx +47 -79
- package/src/components/control-base/form-field.tsx +60 -3
- package/src/components/control-password/control-password.tsx +87 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +101 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +142 -0
- package/src/components/control-select/control-select.tsx +78 -111
- package/src/components/control-upload/control-upload.tsx +27 -1
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +48 -0
- package/src/components/markdown-view/markdown-view.tsx +14 -0
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +88 -0
- package/src/components/nav-shell/nav-page.tsx +3 -3
- package/src/components/nav-shell/nav-tree-util.ts +48 -0
- package/src/components/nav-shell/use-nav-entries.ts +11 -2
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +123 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +130 -0
- package/src/components/settings/settings-danger-section.tsx +59 -0
- package/src/components/settings/settings-heading.tsx +55 -0
- package/src/components/settings/settings-layout.tsx +115 -0
- package/src/components/settings/settings-nav.tsx +175 -0
- package/src/components/settings/settings-row.tsx +81 -0
- package/src/components/settings/settings-section.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +9 -1
- package/src/components/ui/segmented.tsx +19 -2
- package/src/lib/i18n-fr.ts +68 -0
- package/src/lib/resize-image.ts +135 -0
- package/src/styles.css +126 -1
- /package/src/components/{admin/admin-user-detail-provider-labels.ts → auth/provider-labels.ts} +0 -0
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import { $pageNav } from "@alepha/ui/components/nav-shell/nav-page";
|
|
2
|
+
import { $store } from "alepha";
|
|
3
|
+
import type { ApiKeyController } from "alepha/api/keys";
|
|
4
|
+
import type {
|
|
5
|
+
MyConnectionController,
|
|
6
|
+
MyIdentityController,
|
|
7
|
+
MyProfileController,
|
|
8
|
+
MySessionController,
|
|
9
|
+
RealmController,
|
|
10
|
+
} from "alepha/api/users";
|
|
11
|
+
import { $page } from "alepha/react/router";
|
|
12
|
+
import { $secure } from "alepha/security";
|
|
13
|
+
import { $client } from "alepha/server/links";
|
|
14
|
+
import { KeyRound, Plug, RadioTower, ShieldCheck, User } from "lucide-react";
|
|
15
|
+
import { createElement } from "react";
|
|
16
|
+
import { accountRouterOptionsAtom } from "./account-router-options.tsx";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The whole `/account` surface — five pages and their shell — mounted and
|
|
20
|
+
* wired. The user-facing counterpart of `AdminRouter`.
|
|
21
|
+
*
|
|
22
|
+
* ⚠️ **Nav icons are `createElement(Icon)`, never `<Icon />`.** Same reason as
|
|
23
|
+
* `AdminRouter`: this module is evaluated *eagerly* in the server graph, and
|
|
24
|
+
* `alepha db migrations create` imports that graph under `tsx`, which applies
|
|
25
|
+
* a tsconfig resolved from the app root. A file outside that tsconfig's
|
|
26
|
+
* `include` — which this one is, living in a sibling workspace — gets
|
|
27
|
+
* esbuild's defaults, whose JSX transform is the *classic* one. The emitted
|
|
28
|
+
* `React.createElement` then fails with `ReferenceError: React is not
|
|
29
|
+
* defined`, breaking migration generation for the whole app.
|
|
30
|
+
*
|
|
31
|
+
* ```ts
|
|
32
|
+
* import { AccountRouter } from "@alepha/ui/components/account/account-router";
|
|
33
|
+
*
|
|
34
|
+
* export const MyWeb = $module({
|
|
35
|
+
* name: "my.web",
|
|
36
|
+
* services: [MyRouter, AuthRouter, AccountRouter],
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* ### Mount it standalone, or inside your own layout
|
|
41
|
+
*
|
|
42
|
+
* {@link AccountRouter.layout} is a root `$page`, so registering the service
|
|
43
|
+
* puts `/account` at the root with only the `header` slot for chrome. An
|
|
44
|
+
* application that wants it *inside* its own header and footer adds
|
|
45
|
+
* `accountRouter.layout` to that layout's `children`:
|
|
46
|
+
*
|
|
47
|
+
* ```ts
|
|
48
|
+
* layout = $page({
|
|
49
|
+
* children: () => [this.home, this.account.layout, this.notFound],
|
|
50
|
+
* lazy: () => import("./Layout.tsx"),
|
|
51
|
+
* });
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* `ReactPageProvider` excludes an adopted page from the root set, so it
|
|
55
|
+
* renders nested. This is why the options atom has no `parent` field: a
|
|
56
|
+
* boot-time atom carrying a `PagePrimitive` would be order-fragile, and the
|
|
57
|
+
* mechanism already exists.
|
|
58
|
+
*
|
|
59
|
+
* ### Every page is mounted; none is conditionally registered
|
|
60
|
+
*
|
|
61
|
+
* A page whose backing module is not registered hides itself through `can`,
|
|
62
|
+
* which resolves an action name against `/api/_links` — a registry built from
|
|
63
|
+
* the actions the server actually registered. `permission` could not do this:
|
|
64
|
+
* `$secure` registers a permission at definition time whether or not any
|
|
65
|
+
* controller backs it, so an admin holding `*` would be granted it over a
|
|
66
|
+
* dead API. The API-keys page is the clearest case — it disappears entirely
|
|
67
|
+
* for an application that never mounts `AlephaApiKeys`.
|
|
68
|
+
*
|
|
69
|
+
* (Connections is *not* an example of that any more. `MyConnectionController`
|
|
70
|
+
* had to move from `api/oauth` into `api/users` to break a circular module
|
|
71
|
+
* dependency, so its action exists wherever `api/users` does — see that
|
|
72
|
+
* controller's own JSDoc.)
|
|
73
|
+
*
|
|
74
|
+
* There is deliberately no `pages: [...]` allowlist: a second gate on top of
|
|
75
|
+
* one that already works goes stale.
|
|
76
|
+
*
|
|
77
|
+
* ### These five route names are prefixed on purpose
|
|
78
|
+
*
|
|
79
|
+
* `AdminRouter` already claims `sessions` and `keys` globally, and
|
|
80
|
+
* `ReactPageProvider.page()` returns the *first* match on a duplicate — so
|
|
81
|
+
* bare names here would shadow the admin ones, or be shadowed by them,
|
|
82
|
+
* silently, depending on mount order. `accountProfile`, `accountSecurity`,
|
|
83
|
+
* `accountSessions`, `accountKeys` and `accountConnections` each carry an
|
|
84
|
+
* explicit `name:` so renaming a field later never changes the public route
|
|
85
|
+
* name.
|
|
86
|
+
*
|
|
87
|
+
* ### Extending the shell
|
|
88
|
+
*
|
|
89
|
+
* `$pageAccount` is the one-call way to add a page. Take `order: 100` or
|
|
90
|
+
* above, or declare your own `nav.group` — the built-ins occupy `Account`
|
|
91
|
+
* (order 1) and `Security` (orders 2-5), and `useNavEntries` sorts groups by
|
|
92
|
+
* their smallest member, so a page at a lower order silently reshuffles the
|
|
93
|
+
* shared rail.
|
|
94
|
+
*/
|
|
95
|
+
export class AccountRouter {
|
|
96
|
+
protected readonly options = $store(accountRouterOptionsAtom);
|
|
97
|
+
|
|
98
|
+
protected readonly profileApi = $client<MyProfileController>();
|
|
99
|
+
protected readonly realmApi = $client<RealmController>();
|
|
100
|
+
protected readonly identityApi = $client<MyIdentityController>();
|
|
101
|
+
protected readonly sessionApi = $client<MySessionController>();
|
|
102
|
+
protected readonly apiKeyApi = $client<ApiKeyController>();
|
|
103
|
+
protected readonly connectionApi = $client<MyConnectionController>();
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Anchors the shell. Not itself a nav entry — a shell root is excluded from
|
|
107
|
+
* its own rail.
|
|
108
|
+
*
|
|
109
|
+
* `$secure()` with no permission means signed-in only, which is both the
|
|
110
|
+
* right gate (nothing here means anything to an anonymous visitor) and what
|
|
111
|
+
* puts the subtree in CSR.
|
|
112
|
+
*
|
|
113
|
+
* Unlike `/admin` there is no index redirect: {@link profile} sits at
|
|
114
|
+
* `path: "/"`, so a bare `/account` resolves to it directly.
|
|
115
|
+
*/
|
|
116
|
+
layout = $page({
|
|
117
|
+
name: "account",
|
|
118
|
+
path: "/account",
|
|
119
|
+
use: [$secure()],
|
|
120
|
+
nav: { label: "Account" },
|
|
121
|
+
lazy: () => import("./account-layout.tsx"),
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
profile = $pageNav({
|
|
125
|
+
parent: this.layout,
|
|
126
|
+
path: "/",
|
|
127
|
+
name: "accountProfile",
|
|
128
|
+
head: { title: "Profile" },
|
|
129
|
+
can: () => this.profileApi.getMyProfile.can(),
|
|
130
|
+
nav: {
|
|
131
|
+
label: "Profile",
|
|
132
|
+
icon: createElement(User),
|
|
133
|
+
group: "Account",
|
|
134
|
+
order: 1,
|
|
135
|
+
},
|
|
136
|
+
/*
|
|
137
|
+
* `realmConfig` rides along because the page has one realm-dependent
|
|
138
|
+
* field: a realm with `username: "none"` or `"email"` has no handle to
|
|
139
|
+
* edit. It is the same call `AuthRouter.loadRealm` makes for the same
|
|
140
|
+
* reason, and the same public endpoint — cheap, and already warm from
|
|
141
|
+
* sign-in.
|
|
142
|
+
*
|
|
143
|
+
* Both are fetched together rather than in sequence: they do not depend
|
|
144
|
+
* on each other, and the account area is behind `$secure`, so this runs
|
|
145
|
+
* client-side where a waterfall is two round trips instead of one.
|
|
146
|
+
*/
|
|
147
|
+
loader: async () => {
|
|
148
|
+
const [profile, realmConfig] = await Promise.all([
|
|
149
|
+
this.profileApi.getMyProfile(),
|
|
150
|
+
this.realmApi.getRealmConfig(),
|
|
151
|
+
]);
|
|
152
|
+
return { profile, realmConfig };
|
|
153
|
+
},
|
|
154
|
+
lazy: () => import("./account-profile.tsx"),
|
|
155
|
+
props: () => this.options.pages?.profile ?? {},
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
security = $pageNav({
|
|
159
|
+
parent: this.layout,
|
|
160
|
+
path: "/security",
|
|
161
|
+
name: "accountSecurity",
|
|
162
|
+
head: { title: "Security" },
|
|
163
|
+
can: () => this.identityApi.listMyIdentities.can(),
|
|
164
|
+
nav: {
|
|
165
|
+
label: "Security",
|
|
166
|
+
icon: createElement(ShieldCheck),
|
|
167
|
+
group: "Security",
|
|
168
|
+
order: 2,
|
|
169
|
+
keywords: ["password", "identities", "sign-in", "delete account"],
|
|
170
|
+
},
|
|
171
|
+
loader: async () => ({
|
|
172
|
+
identities: await this.identityApi.listMyIdentities(),
|
|
173
|
+
}),
|
|
174
|
+
lazy: () => import("./account-security.tsx"),
|
|
175
|
+
props: () => this.options.pages?.security ?? {},
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
sessions = $pageNav({
|
|
179
|
+
parent: this.layout,
|
|
180
|
+
path: "/sessions",
|
|
181
|
+
name: "accountSessions",
|
|
182
|
+
head: { title: "Sessions" },
|
|
183
|
+
can: () => this.sessionApi.listMySessions.can(),
|
|
184
|
+
nav: {
|
|
185
|
+
label: "Sessions",
|
|
186
|
+
icon: createElement(RadioTower),
|
|
187
|
+
group: "Security",
|
|
188
|
+
order: 3,
|
|
189
|
+
keywords: ["devices", "sign out"],
|
|
190
|
+
},
|
|
191
|
+
loader: async () => ({ sessions: await this.sessionApi.listMySessions() }),
|
|
192
|
+
lazy: () => import("./account-sessions.tsx"),
|
|
193
|
+
props: () => this.options.pages?.sessions ?? {},
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
keys = $pageNav({
|
|
197
|
+
parent: this.layout,
|
|
198
|
+
path: "/keys",
|
|
199
|
+
name: "accountKeys",
|
|
200
|
+
head: { title: "API keys" },
|
|
201
|
+
can: () => this.apiKeyApi.listApiKeys.can(),
|
|
202
|
+
nav: {
|
|
203
|
+
label: "API keys",
|
|
204
|
+
icon: createElement(KeyRound),
|
|
205
|
+
group: "Security",
|
|
206
|
+
order: 4,
|
|
207
|
+
keywords: ["tokens", "credentials"],
|
|
208
|
+
},
|
|
209
|
+
loader: async () => ({ apiKeys: await this.apiKeyApi.listApiKeys() }),
|
|
210
|
+
lazy: () => import("./account-keys.tsx"),
|
|
211
|
+
props: () => this.options.pages?.keys ?? {},
|
|
212
|
+
});
|
|
213
|
+
|
|
214
|
+
connections = $pageNav({
|
|
215
|
+
parent: this.layout,
|
|
216
|
+
path: "/connections",
|
|
217
|
+
name: "accountConnections",
|
|
218
|
+
head: { title: "Connected apps" },
|
|
219
|
+
can: () => this.connectionApi.listMyConnections.can(),
|
|
220
|
+
nav: {
|
|
221
|
+
label: "Connected apps",
|
|
222
|
+
icon: createElement(Plug),
|
|
223
|
+
group: "Security",
|
|
224
|
+
order: 5,
|
|
225
|
+
keywords: ["oauth", "mcp", "integrations"],
|
|
226
|
+
},
|
|
227
|
+
loader: async () => ({
|
|
228
|
+
connections: await this.connectionApi.listMyConnections(),
|
|
229
|
+
}),
|
|
230
|
+
lazy: () => import("./account-connections.tsx"),
|
|
231
|
+
props: () => this.options.pages?.connections ?? {},
|
|
232
|
+
});
|
|
233
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { AccountDeleteDialog } from "@alepha/ui/components/account/account-delete-dialog";
|
|
2
|
+
import { AccountPasswordDialog } from "@alepha/ui/components/account/account-password-dialog";
|
|
3
|
+
import { SettingsDangerSection } from "@alepha/ui/components/settings/settings-danger-section";
|
|
4
|
+
import { SettingsRow } from "@alepha/ui/components/settings/settings-row";
|
|
5
|
+
import { SettingsSection } from "@alepha/ui/components/settings/settings-section";
|
|
6
|
+
import { Button } from "@alepha/ui/components/ui/button";
|
|
7
|
+
import { useDialog } from "@alepha/ui/components/use-dialog/use-dialog";
|
|
8
|
+
import { useToast } from "@alepha/ui/components/use-toast/use-toast";
|
|
9
|
+
import type { MyIdentity, MyIdentityController } from "alepha/api/users";
|
|
10
|
+
import { useClient } from "alepha/react";
|
|
11
|
+
import { useAuth } from "alepha/react/auth";
|
|
12
|
+
import { useI18n } from "alepha/react/i18n";
|
|
13
|
+
import { KeyRound, Trash2 } from "lucide-react";
|
|
14
|
+
import { type ReactNode, useState } from "react";
|
|
15
|
+
import { PROVIDER_LABELS } from "../auth/provider-labels.ts";
|
|
16
|
+
|
|
17
|
+
export interface AccountSecurityProps {
|
|
18
|
+
identities?: MyIdentity[];
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Rendered inside the delete-account dialog, above the confirmation field.
|
|
22
|
+
* See {@link AccountDeleteDialogProps.warning} — this is how an application
|
|
23
|
+
* states what deletion costs in *its* data.
|
|
24
|
+
*/
|
|
25
|
+
deleteWarning?: ReactNode;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* How you get in, and how to stop existing.
|
|
30
|
+
*
|
|
31
|
+
* The delete-account row lives here rather than on Profile because the
|
|
32
|
+
* re-authentication it demands is the same material as everything else on
|
|
33
|
+
* this page — and because a destructive action on the page you land on by
|
|
34
|
+
* default is a worse default than one behind a deliberate click.
|
|
35
|
+
*/
|
|
36
|
+
const AccountSecurity = (props: AccountSecurityProps) => {
|
|
37
|
+
const api = useClient<MyIdentityController>();
|
|
38
|
+
const auth = useAuth();
|
|
39
|
+
const dialog = useDialog();
|
|
40
|
+
const toaster = useToast();
|
|
41
|
+
const { l } = useI18n();
|
|
42
|
+
|
|
43
|
+
const [identities, setIdentities] = useState<MyIdentity[]>(
|
|
44
|
+
props.identities ?? [],
|
|
45
|
+
);
|
|
46
|
+
const [passwordOpen, setPasswordOpen] = useState(false);
|
|
47
|
+
const [deleteOpen, setDeleteOpen] = useState(false);
|
|
48
|
+
|
|
49
|
+
const hasPassword = identities.some((it) => it.provider === "credentials");
|
|
50
|
+
|
|
51
|
+
const reload = async () => setIdentities(await api.listMyIdentities());
|
|
52
|
+
|
|
53
|
+
const unlink = async (identity: MyIdentity) => {
|
|
54
|
+
const label = PROVIDER_LABELS[identity.provider] ?? identity.provider;
|
|
55
|
+
const ok = await dialog.confirm({
|
|
56
|
+
title: `Remove ${label}?`,
|
|
57
|
+
description: `You will no longer be able to sign in with ${label}.`,
|
|
58
|
+
confirmLabel: "Remove",
|
|
59
|
+
destructive: true,
|
|
60
|
+
});
|
|
61
|
+
if (!ok) {
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
try {
|
|
65
|
+
await api.unlinkMyIdentity({ params: { id: identity.id } });
|
|
66
|
+
await reload();
|
|
67
|
+
} catch (error: any) {
|
|
68
|
+
// Includes the last-identity refusal, whose message is the whole point.
|
|
69
|
+
toaster.show(error?.message ?? "Could not remove that method", "danger");
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
return (
|
|
74
|
+
<>
|
|
75
|
+
<SettingsSection
|
|
76
|
+
title="Sign-in methods"
|
|
77
|
+
description="At least one must remain. Removing the last would lock you out permanently."
|
|
78
|
+
>
|
|
79
|
+
{identities.map((identity) => (
|
|
80
|
+
<SettingsRow
|
|
81
|
+
key={identity.id}
|
|
82
|
+
label={PROVIDER_LABELS[identity.provider] ?? identity.provider}
|
|
83
|
+
description={`Added ${String(l(identity.createdAt, { date: "ll" }))}`}
|
|
84
|
+
>
|
|
85
|
+
{identities.length > 1 ? (
|
|
86
|
+
<Button
|
|
87
|
+
variant="ghost"
|
|
88
|
+
size="sm"
|
|
89
|
+
onClick={() => unlink(identity)}
|
|
90
|
+
aria-label={`Remove ${identity.provider}`}
|
|
91
|
+
>
|
|
92
|
+
<Trash2 className="size-4" />
|
|
93
|
+
</Button>
|
|
94
|
+
) : null}
|
|
95
|
+
</SettingsRow>
|
|
96
|
+
))}
|
|
97
|
+
|
|
98
|
+
<SettingsRow
|
|
99
|
+
label="Password"
|
|
100
|
+
description={
|
|
101
|
+
hasPassword
|
|
102
|
+
? "Changing it signs out every other device."
|
|
103
|
+
: "This account signs in without a password. Add one as a fallback."
|
|
104
|
+
}
|
|
105
|
+
>
|
|
106
|
+
<Button
|
|
107
|
+
variant="secondary"
|
|
108
|
+
size="sm"
|
|
109
|
+
onClick={() => setPasswordOpen(true)}
|
|
110
|
+
>
|
|
111
|
+
<KeyRound className="size-4" />
|
|
112
|
+
{hasPassword ? "Change password" : "Set a password"}
|
|
113
|
+
</Button>
|
|
114
|
+
</SettingsRow>
|
|
115
|
+
</SettingsSection>
|
|
116
|
+
|
|
117
|
+
<SettingsDangerSection description="This cannot be undone.">
|
|
118
|
+
<SettingsRow
|
|
119
|
+
label="Delete this account"
|
|
120
|
+
description="Removes your account, its sign-in methods and every session."
|
|
121
|
+
>
|
|
122
|
+
<Button
|
|
123
|
+
variant="destructive"
|
|
124
|
+
size="sm"
|
|
125
|
+
onClick={() => setDeleteOpen(true)}
|
|
126
|
+
>
|
|
127
|
+
Delete account
|
|
128
|
+
</Button>
|
|
129
|
+
</SettingsRow>
|
|
130
|
+
</SettingsDangerSection>
|
|
131
|
+
|
|
132
|
+
<AccountPasswordDialog
|
|
133
|
+
open={passwordOpen}
|
|
134
|
+
hasPassword={hasPassword}
|
|
135
|
+
onOpenChange={setPasswordOpen}
|
|
136
|
+
onDone={reload}
|
|
137
|
+
/>
|
|
138
|
+
|
|
139
|
+
<AccountDeleteDialog
|
|
140
|
+
open={deleteOpen}
|
|
141
|
+
hasPassword={hasPassword}
|
|
142
|
+
onOpenChange={setDeleteOpen}
|
|
143
|
+
warning={props.deleteWarning}
|
|
144
|
+
onDeleted={() => auth.logout()}
|
|
145
|
+
/>
|
|
146
|
+
</>
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export default AccountSecurity;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { SettingsRow } from "@alepha/ui/components/settings/settings-row";
|
|
2
|
+
import { SettingsSection } from "@alepha/ui/components/settings/settings-section";
|
|
3
|
+
import { Button } from "@alepha/ui/components/ui/button";
|
|
4
|
+
import { useDialog } from "@alepha/ui/components/use-dialog/use-dialog";
|
|
5
|
+
import { useToast } from "@alepha/ui/components/use-toast/use-toast";
|
|
6
|
+
import type { MySession, MySessionController } from "alepha/api/users";
|
|
7
|
+
import { DateTimeProvider } from "alepha/datetime";
|
|
8
|
+
import { useClient, useInject } from "alepha/react";
|
|
9
|
+
import { Circle, Monitor, Smartphone, Tablet } from "lucide-react";
|
|
10
|
+
import { useState } from "react";
|
|
11
|
+
|
|
12
|
+
export interface AccountSessionsProps {
|
|
13
|
+
sessions?: MySession[];
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Where you are signed in, and how to stop being.
|
|
18
|
+
*
|
|
19
|
+
* Revoking a *single* session is unconfirmed; "sign out everywhere else" is
|
|
20
|
+
* confirmed. The difference is reach, not reversibility — one session comes
|
|
21
|
+
* back by signing in again, whereas the bulk action ends every other device
|
|
22
|
+
* at once and there is no undo affordance to reach for afterwards. A prompt
|
|
23
|
+
* on the per-row action would be click-through noise, which is what makes a
|
|
24
|
+
* rare prompt worth reading.
|
|
25
|
+
*/
|
|
26
|
+
const AccountSessions = (props: AccountSessionsProps) => {
|
|
27
|
+
const api = useClient<MySessionController>();
|
|
28
|
+
const dt = useInject(DateTimeProvider);
|
|
29
|
+
const dialog = useDialog();
|
|
30
|
+
const toaster = useToast();
|
|
31
|
+
const [sessions, setSessions] = useState<MySession[]>(props.sessions ?? []);
|
|
32
|
+
|
|
33
|
+
const deviceIcon = (session: MySession) => {
|
|
34
|
+
if (session.userAgent?.device === "MOBILE") {
|
|
35
|
+
return <Smartphone className="size-4" />;
|
|
36
|
+
}
|
|
37
|
+
if (session.userAgent?.device === "TABLET") {
|
|
38
|
+
return <Tablet className="size-4" />;
|
|
39
|
+
}
|
|
40
|
+
return <Monitor className="size-4" />;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const label = (session: MySession) => {
|
|
44
|
+
const agent = session.userAgent;
|
|
45
|
+
if (!agent) {
|
|
46
|
+
return "Unknown device";
|
|
47
|
+
}
|
|
48
|
+
return `${agent.browser} on ${agent.os}`;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const revoke = async (session: MySession) => {
|
|
52
|
+
try {
|
|
53
|
+
await api.deleteMySession({ params: { id: session.id } });
|
|
54
|
+
setSessions((prev) => prev.filter((it) => it.id !== session.id));
|
|
55
|
+
} catch (error: any) {
|
|
56
|
+
toaster.show(error?.message ?? "Could not revoke that session", "danger");
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const revokeOthers = async () => {
|
|
61
|
+
const ok = await dialog.confirm({
|
|
62
|
+
title: "Sign out everywhere else?",
|
|
63
|
+
description:
|
|
64
|
+
"Every other browser and device will be signed out. This one stays signed in.",
|
|
65
|
+
confirmLabel: "Sign out everywhere else",
|
|
66
|
+
destructive: true,
|
|
67
|
+
});
|
|
68
|
+
if (!ok) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
try {
|
|
72
|
+
const { revoked } = await api.deleteMyOtherSessions();
|
|
73
|
+
setSessions((prev) => prev.filter((it) => it.current));
|
|
74
|
+
toaster.show(
|
|
75
|
+
revoked === 1
|
|
76
|
+
? "1 session signed out"
|
|
77
|
+
: `${revoked} sessions signed out`,
|
|
78
|
+
"success",
|
|
79
|
+
);
|
|
80
|
+
} catch (error: any) {
|
|
81
|
+
toaster.show(error?.message ?? "Could not sign out the others", "danger");
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
const others = sessions.filter((it) => !it.current).length;
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<SettingsSection
|
|
89
|
+
title="Active sessions"
|
|
90
|
+
description="Revoke any session you do not recognise."
|
|
91
|
+
>
|
|
92
|
+
{sessions.map((session) => (
|
|
93
|
+
<SettingsRow
|
|
94
|
+
key={session.id}
|
|
95
|
+
label={
|
|
96
|
+
<span className="flex items-center gap-2">
|
|
97
|
+
<Circle
|
|
98
|
+
aria-hidden
|
|
99
|
+
className={
|
|
100
|
+
session.current
|
|
101
|
+
? "size-2 fill-green-500 text-green-500"
|
|
102
|
+
: "size-2 fill-muted-foreground text-muted-foreground"
|
|
103
|
+
}
|
|
104
|
+
/>
|
|
105
|
+
{deviceIcon(session)}
|
|
106
|
+
{label(session)}
|
|
107
|
+
{session.current ? (
|
|
108
|
+
<span className="text-muted-foreground text-xs">
|
|
109
|
+
(this device)
|
|
110
|
+
</span>
|
|
111
|
+
) : null}
|
|
112
|
+
</span>
|
|
113
|
+
}
|
|
114
|
+
description={`${session.ip ?? "unknown IP"} · signed in ${dt
|
|
115
|
+
.of(session.createdAt)
|
|
116
|
+
.fromNow()}`}
|
|
117
|
+
>
|
|
118
|
+
{session.current ? null : (
|
|
119
|
+
<Button variant="ghost" size="sm" onClick={() => revoke(session)}>
|
|
120
|
+
Revoke
|
|
121
|
+
</Button>
|
|
122
|
+
)}
|
|
123
|
+
</SettingsRow>
|
|
124
|
+
))}
|
|
125
|
+
|
|
126
|
+
{others > 0 ? (
|
|
127
|
+
<SettingsRow
|
|
128
|
+
label="Sign out everywhere else"
|
|
129
|
+
description="Ends every session except this one."
|
|
130
|
+
>
|
|
131
|
+
<Button variant="destructive" size="sm" onClick={revokeOthers}>
|
|
132
|
+
Sign out {others} other{others === 1 ? "" : "s"}
|
|
133
|
+
</Button>
|
|
134
|
+
</SettingsRow>
|
|
135
|
+
) : null}
|
|
136
|
+
</SettingsSection>
|
|
137
|
+
);
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export default AccountSessions;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { fireEvent, render, screen } from "@testing-library/react";
|
|
2
|
+
import { Alepha } from "alepha";
|
|
3
|
+
import { AlephaContext } from "alepha/react";
|
|
4
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
5
|
+
import { setupJsdomMocks } from "alepha/react/testing";
|
|
6
|
+
import { afterEach, beforeAll, describe, expect, it, vi } from "vitest";
|
|
7
|
+
import { AdminKeysTokenDialog } from "../admin-keys-token-dialog.tsx";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The dialog is the single moment a freshly minted API key token is readable
|
|
11
|
+
* (the server stores only a hash), so what matters is that the token is
|
|
12
|
+
* actually on screen while set, that nothing renders once cleared, and that
|
|
13
|
+
* both dismissal affordances funnel through `onClose` — a token dialog that
|
|
14
|
+
* cannot close would pin a live credential on screen.
|
|
15
|
+
*/
|
|
16
|
+
describe("AdminKeysTokenDialog", () => {
|
|
17
|
+
let alepha: Alepha | undefined;
|
|
18
|
+
|
|
19
|
+
beforeAll(() => {
|
|
20
|
+
setupJsdomMocks();
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
afterEach(async () => {
|
|
24
|
+
await alepha?.stop();
|
|
25
|
+
alepha = undefined;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
const mount = async (token: string | null, onClose: () => void) => {
|
|
29
|
+
alepha = Alepha.create().with(AlephaReactI18n);
|
|
30
|
+
await alepha.start();
|
|
31
|
+
return render(
|
|
32
|
+
<AlephaContext.Provider value={alepha}>
|
|
33
|
+
<AdminKeysTokenDialog token={token} onClose={onClose} />
|
|
34
|
+
</AlephaContext.Provider>,
|
|
35
|
+
);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
it("shows the token and the one-time warning while a token is set", async () => {
|
|
39
|
+
await mount("ak_test_1234567890", () => {});
|
|
40
|
+
|
|
41
|
+
expect(screen.getByText("ak_test_1234567890")).toBeTruthy();
|
|
42
|
+
expect(screen.getByText(/shown only once/)).toBeTruthy();
|
|
43
|
+
// The copy button is icon-only; the aria-label is its accessible name
|
|
44
|
+
// (and doubles as the tooltip text).
|
|
45
|
+
expect(screen.getByRole("button", { name: "Copy" })).toBeTruthy();
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
it("renders nothing when token is null", async () => {
|
|
49
|
+
await mount(null, () => {});
|
|
50
|
+
|
|
51
|
+
expect(screen.queryByText(/shown only once/)).toBeNull();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it("calls onClose when Done is pressed", async () => {
|
|
55
|
+
const onClose = vi.fn();
|
|
56
|
+
await mount("ak_test_1234567890", onClose);
|
|
57
|
+
|
|
58
|
+
fireEvent.click(screen.getByRole("button", { name: "Done" }));
|
|
59
|
+
|
|
60
|
+
expect(onClose).toHaveBeenCalledTimes(1);
|
|
61
|
+
});
|
|
62
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { Alepha } from "alepha";
|
|
3
|
+
import { AlephaContext } from "alepha/react";
|
|
4
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
5
|
+
import { AlephaReactRouter } from "alepha/react/router";
|
|
6
|
+
import { setupJsdomMocks } from "alepha/react/testing";
|
|
7
|
+
import { afterEach, beforeAll, describe, expect, it } from "vitest";
|
|
8
|
+
import AdminLayout from "../admin-layout.tsx";
|
|
9
|
+
import { AdminRouter } from "../admin-router.tsx";
|
|
10
|
+
import {
|
|
11
|
+
type AdminRouterOptions,
|
|
12
|
+
adminRouterOptionsAtom,
|
|
13
|
+
} from "../admin-router-options.tsx";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* The three seams `adminRouterOptionsAtom` opens into the layout itself —
|
|
17
|
+
* as opposed to the routing contract, which `admin-router.spec.ts` owns.
|
|
18
|
+
*
|
|
19
|
+
* Each exists for an application whose `/admin` lives inside a document it
|
|
20
|
+
* does not fully own (a host page with fixed overlays, or a hardcoded
|
|
21
|
+
* `<html class="dark">`): `className` is the fence hook, `colorScheme:
|
|
22
|
+
* false` keeps the shell from rewriting the host's theme class, and the ⌘K
|
|
23
|
+
* search affordance surviving a `topbarActions` replacement is what makes
|
|
24
|
+
* replacing the cluster safe — the Spotlight state is local to the layout,
|
|
25
|
+
* so no replacement cluster could ever rebuild the button.
|
|
26
|
+
*/
|
|
27
|
+
describe("AdminLayout options", () => {
|
|
28
|
+
let alepha: Alepha | undefined;
|
|
29
|
+
|
|
30
|
+
beforeAll(() => {
|
|
31
|
+
setupJsdomMocks();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
afterEach(async () => {
|
|
35
|
+
await alepha?.stop();
|
|
36
|
+
alepha = undefined;
|
|
37
|
+
document.documentElement.className = "";
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const mount = async (options: AdminRouterOptions) => {
|
|
41
|
+
alepha = Alepha.create().with(AlephaReactRouter).with(AlephaReactI18n);
|
|
42
|
+
alepha.inject(AdminRouter);
|
|
43
|
+
alepha.set(adminRouterOptionsAtom, options);
|
|
44
|
+
await alepha.start();
|
|
45
|
+
return render(
|
|
46
|
+
<AlephaContext.Provider value={alepha}>
|
|
47
|
+
<AdminLayout />
|
|
48
|
+
</AlephaContext.Provider>,
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
it("merges options.className onto the shell root", async () => {
|
|
53
|
+
const { container } = await mount({ className: "admin-fence" });
|
|
54
|
+
|
|
55
|
+
const root = container.firstElementChild;
|
|
56
|
+
expect(root).not.toBeNull();
|
|
57
|
+
expect(root!.classList.contains("admin-fence")).toBe(true);
|
|
58
|
+
// Merged, not replaced — the viewport bound stays.
|
|
59
|
+
expect(root!.classList.contains("h-svh")).toBe(true);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it("colorScheme: false leaves the document's theme class alone", async () => {
|
|
63
|
+
// A host document that owns its own theme class, the way a game shell
|
|
64
|
+
// hardcodes `<html class="dark">`. `<ColorScheme />` mounted here would
|
|
65
|
+
// toggle it off (jsdom resolves the color mode light), which is exactly
|
|
66
|
+
// the rewrite the opt-out exists to prevent.
|
|
67
|
+
document.documentElement.classList.add("dark");
|
|
68
|
+
|
|
69
|
+
await mount({ colorScheme: false });
|
|
70
|
+
|
|
71
|
+
expect(document.documentElement.classList.contains("dark")).toBe(true);
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
it("keeps the ⌘K search affordance when topbarActions is replaced", async () => {
|
|
75
|
+
await mount({ topbarActions: <span>custom-cluster</span> });
|
|
76
|
+
|
|
77
|
+
expect(screen.getByText("custom-cluster")).toBeTruthy();
|
|
78
|
+
// The search button is not part of the replaceable cluster: its open
|
|
79
|
+
// state lives in the layout, so replacing the cluster must not cost it.
|
|
80
|
+
expect(screen.getByText("Search…")).toBeTruthy();
|
|
81
|
+
});
|
|
82
|
+
});
|