@alepha/ui 0.25.2 → 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/account-connections.tsx +9 -1
- package/src/components/account/account-keys.tsx +1 -1
- package/src/components/account/account-layout.tsx +6 -3
- package/src/components/account/account-profile.tsx +238 -125
- package/src/components/account/account-router-options.tsx +14 -0
- package/src/components/account/account-router.tsx +20 -1
- package/src/components/account/account-security.tsx +1 -1
- package/src/components/admin/admin-router-options.tsx +20 -0
- package/src/components/alepha-table/alepha-table.tsx +23 -7
- package/src/components/app-actions/app-actions.tsx +7 -2
- package/src/components/auth/auth-register.tsx +55 -17
- 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 +76 -17
- package/src/components/control/control.tsx +33 -8
- package/src/components/control-base/form-field.tsx +60 -3
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +48 -0
- package/src/components/markdown-view/markdown-view.tsx +14 -6
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +88 -0
- 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/settings-heading.tsx +55 -0
- package/src/components/settings/settings-layout.tsx +66 -7
- package/src/components/settings/settings-nav.tsx +48 -4
- package/src/components/settings/settings-section.tsx +2 -14
- package/src/components/ui/segmented.tsx +19 -2
- package/src/lib/__tests__/rehype-safe-img.spec.ts +0 -121
- package/src/lib/rehype-safe-img.ts +0 -150
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { navLabel } from "./nav-tree-util.js";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useRouterState } from "alepha/react/router";
|
|
4
|
+
//#region src/components/nav-shell/use-nav-breadcrumbs.ts
|
|
5
|
+
/**
|
|
6
|
+
* Derive the breadcrumb trail from the active route layers. Each rendered
|
|
7
|
+
* layer that carries a route becomes a crumb (labelled via {@link navLabel});
|
|
8
|
+
* the last one is the current page and is rendered without a link.
|
|
9
|
+
*
|
|
10
|
+
* Because the trail is the genuine nested-route chain, a detail page mounted
|
|
11
|
+
* directly under the shell layout (rather than under its list page) yields
|
|
12
|
+
* `Shell > Detail` — there is no synthetic "list" crumb in between.
|
|
13
|
+
*/
|
|
14
|
+
function useNavBreadcrumbs(options) {
|
|
15
|
+
const state = useRouterState();
|
|
16
|
+
return useMemo(() => {
|
|
17
|
+
const layers = state.layers ?? [];
|
|
18
|
+
const rootIndex = layers.findIndex((l) => l.route?.name === options.root);
|
|
19
|
+
const chain = rootIndex >= 0 ? layers.slice(rootIndex) : layers;
|
|
20
|
+
const crumbs = [];
|
|
21
|
+
for (const layer of chain) {
|
|
22
|
+
const route = layer.route;
|
|
23
|
+
if (!route) continue;
|
|
24
|
+
crumbs.push({
|
|
25
|
+
label: navLabel(route),
|
|
26
|
+
href: route.match
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
if (crumbs.length > 0) crumbs[crumbs.length - 1] = { label: crumbs[crumbs.length - 1].label };
|
|
30
|
+
return crumbs;
|
|
31
|
+
}, [state.layers, options.root]);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
export { useNavBreadcrumbs };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=use-nav-breadcrumbs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nav-breadcrumbs.js","names":[],"sources":["../../../src/components/nav-shell/use-nav-breadcrumbs.ts"],"sourcesContent":["import { useRouterState } from \"alepha/react/router\";\nimport type { ReactNode } from \"react\";\nimport { useMemo } from \"react\";\nimport { navLabel } from \"./nav-tree-util.ts\";\n\nexport interface UseNavBreadcrumbsOptions {\n /**\n * Route name anchoring the shell. The trail starts at this layer and walks\n * down to the active leaf; ancestors above it (e.g. the global app layout)\n * are dropped.\n */\n root: string;\n}\n\nexport interface NavCrumb {\n label: ReactNode;\n href?: string;\n}\n\n/**\n * Derive the breadcrumb trail from the active route layers. Each rendered\n * layer that carries a route becomes a crumb (labelled via {@link navLabel});\n * the last one is the current page and is rendered without a link.\n *\n * Because the trail is the genuine nested-route chain, a detail page mounted\n * directly under the shell layout (rather than under its list page) yields\n * `Shell > Detail` — there is no synthetic \"list\" crumb in between.\n */\nexport function useNavBreadcrumbs(\n options: UseNavBreadcrumbsOptions,\n): NavCrumb[] {\n const state = useRouterState();\n\n return useMemo(() => {\n const layers = state.layers ?? [];\n const rootIndex = layers.findIndex((l) => l.route?.name === options.root);\n const chain = rootIndex >= 0 ? layers.slice(rootIndex) : layers;\n\n const crumbs: NavCrumb[] = [];\n for (const layer of chain) {\n const route = layer.route;\n if (!route) continue;\n crumbs.push({ label: navLabel(route), href: route.match });\n }\n\n // The current page is a label, not a link.\n if (crumbs.length > 0) {\n crumbs[crumbs.length - 1] = { label: crumbs[crumbs.length - 1].label };\n }\n return crumbs;\n }, [state.layers, options.root]);\n}\n"],"mappings":";;;;;;;;;;;;;AA4BA,SAAgB,kBACd,SACY;CACZ,MAAM,QAAQ,eAAe;CAE7B,OAAO,cAAc;EACnB,MAAM,SAAS,MAAM,UAAU,CAAC;EAChC,MAAM,YAAY,OAAO,WAAW,MAAM,EAAE,OAAO,SAAS,QAAQ,IAAI;EACxE,MAAM,QAAQ,aAAa,IAAI,OAAO,MAAM,SAAS,IAAI;EAEzD,MAAM,SAAqB,CAAC;EAC5B,KAAK,MAAM,SAAS,OAAO;GACzB,MAAM,QAAQ,MAAM;GACpB,IAAI,CAAC,OAAO;GACZ,OAAO,KAAK;IAAE,OAAO,SAAS,KAAK;IAAG,MAAM,MAAM;GAAM,CAAC;EAC3D;EAGA,IAAI,OAAO,SAAS,GAClB,OAAO,OAAO,SAAS,KAAK,EAAE,OAAO,OAAO,OAAO,SAAS,EAAE,CAAC,MAAM;EAEvE,OAAO;CACT,GAAG,CAAC,MAAM,QAAQ,QAAQ,IAAI,CAAC;AACjC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface UseNavEntriesOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Route name anchoring the shell — only descendant pages contribute entries.
|
|
5
|
+
* See {@link UseNavTreeOptions}.
|
|
6
|
+
*/
|
|
7
|
+
root: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* A single resolved navigation entry derived from a `$page`'s `nav` metadata.
|
|
11
|
+
* Shared by the sidebar ({@link useNavTree}) and the command palette
|
|
12
|
+
* ({@link Spotlight}) so both stay in sync from one source.
|
|
13
|
+
*/
|
|
14
|
+
export interface NavEntry {
|
|
15
|
+
/** Route name — used for navigation (`router.push(name)`) and as a stable key. */
|
|
16
|
+
name: string;
|
|
17
|
+
/** Resolved pathname (the page's full `match`). */
|
|
18
|
+
href: string;
|
|
19
|
+
label: ReactNode;
|
|
20
|
+
icon?: ReactNode;
|
|
21
|
+
group?: string;
|
|
22
|
+
/** `nav.order` within the group. */
|
|
23
|
+
order: number;
|
|
24
|
+
/** Smallest `order` in this entry's group — drives group ordering. */
|
|
25
|
+
groupOrder: number;
|
|
26
|
+
keywords?: string[];
|
|
27
|
+
description?: ReactNode;
|
|
28
|
+
badge?: ReactNode;
|
|
29
|
+
/** `can()` returned `"disabled"` — show muted, block navigation. */
|
|
30
|
+
disabled: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The current route is on or under this entry, and no sibling entry matched
|
|
33
|
+
* it more specifically. At most one entry in a list is active — see
|
|
34
|
+
* {@link keepDeepestActive}.
|
|
35
|
+
*/
|
|
36
|
+
active: boolean;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Flat, filtered, sorted list of nav entries for the subtree under `root`.
|
|
40
|
+
* Filtering (hidden / permission / `can`), labelling and active-state matching
|
|
41
|
+
* are applied here; consumers decide how to present them. Entries are sorted by
|
|
42
|
+
* group order, then by item order.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useNavEntries(options: UseNavEntriesOptions): NavEntry[];
|
|
45
|
+
//# sourceMappingURL=use-nav-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nav-entries.d.ts","sourceRoot":"","sources":["../../../src/components/nav-shell/use-nav-entries.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAUvC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,QAAQ;IACvB,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,oEAAoE;IACpE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,MAAM,EAAE,OAAO,CAAC;CACjB;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,QAAQ,EAAE,CAqDvE"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { hasNavPermission, isActivePath, isDescendantOf, keepDeepestActive, navLabel } from "./nav-tree-util.js";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useRouter, useRouterState } from "alepha/react/router";
|
|
4
|
+
import { useAuth } from "alepha/react/auth";
|
|
5
|
+
//#region src/components/nav-shell/use-nav-entries.ts
|
|
6
|
+
/**
|
|
7
|
+
* Flat, filtered, sorted list of nav entries for the subtree under `root`.
|
|
8
|
+
* Filtering (hidden / permission / `can`), labelling and active-state matching
|
|
9
|
+
* are applied here; consumers decide how to present them. Entries are sorted by
|
|
10
|
+
* group order, then by item order.
|
|
11
|
+
*/
|
|
12
|
+
function useNavEntries(options) {
|
|
13
|
+
const router = useRouter();
|
|
14
|
+
const state = useRouterState();
|
|
15
|
+
const { has } = useAuth();
|
|
16
|
+
const pages = router.pages;
|
|
17
|
+
const current = state.url?.pathname ?? "/";
|
|
18
|
+
return useMemo(() => {
|
|
19
|
+
const entries = [];
|
|
20
|
+
const groupOrders = /* @__PURE__ */ new Map();
|
|
21
|
+
for (const page of pages) {
|
|
22
|
+
const nav = page.nav;
|
|
23
|
+
if (!nav || nav.hidden) continue;
|
|
24
|
+
if (!isDescendantOf(page, options.root)) continue;
|
|
25
|
+
if (!hasNavPermission(nav.permission, has)) continue;
|
|
26
|
+
const canResult = page.can ? page.can({ has }) : true;
|
|
27
|
+
if (canResult === false) continue;
|
|
28
|
+
const order = nav.order ?? 0;
|
|
29
|
+
const key = nav.group ?? "";
|
|
30
|
+
const prev = groupOrders.get(key);
|
|
31
|
+
if (prev === void 0 || order < prev) groupOrders.set(key, order);
|
|
32
|
+
entries.push({
|
|
33
|
+
name: page.name,
|
|
34
|
+
href: page.match,
|
|
35
|
+
label: navLabel(page),
|
|
36
|
+
icon: nav.icon,
|
|
37
|
+
group: nav.group,
|
|
38
|
+
order,
|
|
39
|
+
groupOrder: 0,
|
|
40
|
+
keywords: nav.keywords,
|
|
41
|
+
description: nav.description,
|
|
42
|
+
badge: nav.badge,
|
|
43
|
+
disabled: canResult === "disabled",
|
|
44
|
+
active: isActivePath(current, page.match)
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
for (const entry of entries) entry.groupOrder = groupOrders.get(entry.group ?? "") ?? 0;
|
|
48
|
+
entries.sort((a, b) => a.groupOrder - b.groupOrder || a.order - b.order);
|
|
49
|
+
return keepDeepestActive(entries);
|
|
50
|
+
}, [
|
|
51
|
+
pages,
|
|
52
|
+
current,
|
|
53
|
+
has,
|
|
54
|
+
options.root
|
|
55
|
+
]);
|
|
56
|
+
}
|
|
57
|
+
//#endregion
|
|
58
|
+
export { useNavEntries };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=use-nav-entries.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nav-entries.js","names":[],"sources":["../../../src/components/nav-shell/use-nav-entries.ts"],"sourcesContent":["import { useAuth } from \"alepha/react/auth\";\nimport { useRouter, useRouterState } from \"alepha/react/router\";\nimport type { ReactNode } from \"react\";\nimport { useMemo } from \"react\";\nimport {\n hasNavPermission,\n isActivePath,\n isDescendantOf,\n keepDeepestActive,\n navLabel,\n} from \"./nav-tree-util.ts\";\n\nexport interface UseNavEntriesOptions {\n /**\n * Route name anchoring the shell — only descendant pages contribute entries.\n * See {@link UseNavTreeOptions}.\n */\n root: string;\n}\n\n/**\n * A single resolved navigation entry derived from a `$page`'s `nav` metadata.\n * Shared by the sidebar ({@link useNavTree}) and the command palette\n * ({@link Spotlight}) so both stay in sync from one source.\n */\nexport interface NavEntry {\n /** Route name — used for navigation (`router.push(name)`) and as a stable key. */\n name: string;\n /** Resolved pathname (the page's full `match`). */\n href: string;\n label: ReactNode;\n icon?: ReactNode;\n group?: string;\n /** `nav.order` within the group. */\n order: number;\n /** Smallest `order` in this entry's group — drives group ordering. */\n groupOrder: number;\n keywords?: string[];\n description?: ReactNode;\n badge?: ReactNode;\n /** `can()` returned `\"disabled\"` — show muted, block navigation. */\n disabled: boolean;\n /**\n * The current route is on or under this entry, and no sibling entry matched\n * it more specifically. At most one entry in a list is active — see\n * {@link keepDeepestActive}.\n */\n active: boolean;\n}\n\n/**\n * Flat, filtered, sorted list of nav entries for the subtree under `root`.\n * Filtering (hidden / permission / `can`), labelling and active-state matching\n * are applied here; consumers decide how to present them. Entries are sorted by\n * group order, then by item order.\n */\nexport function useNavEntries(options: UseNavEntriesOptions): NavEntry[] {\n const router = useRouter<any>();\n const state = useRouterState();\n const { has } = useAuth();\n const pages = router.pages;\n const current = state.url?.pathname ?? \"/\";\n\n return useMemo(() => {\n const entries: NavEntry[] = [];\n // Smallest order seen per group, so a group sorts by its earliest item.\n const groupOrders = new Map<string, number>();\n\n for (const page of pages) {\n const nav = page.nav;\n if (!nav || nav.hidden) continue;\n if (!isDescendantOf(page, options.root)) continue;\n if (!hasNavPermission(nav.permission, has)) continue;\n\n // `can` escape hatch: `false` hides, `\"disabled\"` shows muted.\n const canResult = page.can ? page.can({ has }) : true;\n if (canResult === false) continue;\n\n const order = nav.order ?? 0;\n const key = nav.group ?? \"\";\n const prev = groupOrders.get(key);\n if (prev === undefined || order < prev) groupOrders.set(key, order);\n\n entries.push({\n name: page.name,\n href: page.match,\n label: navLabel(page),\n icon: nav.icon,\n group: nav.group,\n order,\n groupOrder: 0,\n keywords: nav.keywords,\n description: nav.description,\n badge: nav.badge,\n disabled: canResult === \"disabled\",\n active: isActivePath(current, page.match),\n });\n }\n\n for (const entry of entries) {\n entry.groupOrder = groupOrders.get(entry.group ?? \"\") ?? 0;\n }\n entries.sort((a, b) => a.groupOrder - b.groupOrder || a.order - b.order);\n\n // `isActivePath` sees one entry at a time and so cannot tell that another\n // matched more specifically. Only now, with the whole set in hand, can the\n // shallower matches be dropped.\n return keepDeepestActive(entries);\n }, [pages, current, has, options.root]);\n}\n"],"mappings":";;;;;;;;;;;AAwDA,SAAgB,cAAc,SAA2C;CACvE,MAAM,SAAS,UAAe;CAC9B,MAAM,QAAQ,eAAe;CAC7B,MAAM,EAAE,QAAQ,QAAQ;CACxB,MAAM,QAAQ,OAAO;CACrB,MAAM,UAAU,MAAM,KAAK,YAAY;CAEvC,OAAO,cAAc;EACnB,MAAM,UAAsB,CAAC;EAE7B,MAAM,8BAAc,IAAI,IAAoB;EAE5C,KAAK,MAAM,QAAQ,OAAO;GACxB,MAAM,MAAM,KAAK;GACjB,IAAI,CAAC,OAAO,IAAI,QAAQ;GACxB,IAAI,CAAC,eAAe,MAAM,QAAQ,IAAI,GAAG;GACzC,IAAI,CAAC,iBAAiB,IAAI,YAAY,GAAG,GAAG;GAG5C,MAAM,YAAY,KAAK,MAAM,KAAK,IAAI,EAAE,IAAI,CAAC,IAAI;GACjD,IAAI,cAAc,OAAO;GAEzB,MAAM,QAAQ,IAAI,SAAS;GAC3B,MAAM,MAAM,IAAI,SAAS;GACzB,MAAM,OAAO,YAAY,IAAI,GAAG;GAChC,IAAI,SAAS,KAAA,KAAa,QAAQ,MAAM,YAAY,IAAI,KAAK,KAAK;GAElE,QAAQ,KAAK;IACX,MAAM,KAAK;IACX,MAAM,KAAK;IACX,OAAO,SAAS,IAAI;IACpB,MAAM,IAAI;IACV,OAAO,IAAI;IACX;IACA,YAAY;IACZ,UAAU,IAAI;IACd,aAAa,IAAI;IACjB,OAAO,IAAI;IACX,UAAU,cAAc;IACxB,QAAQ,aAAa,SAAS,KAAK,KAAK;GAC1C,CAAC;EACH;EAEA,KAAK,MAAM,SAAS,SAClB,MAAM,aAAa,YAAY,IAAI,MAAM,SAAS,EAAE,KAAK;EAE3D,QAAQ,MAAM,GAAG,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,KAAK;EAKvE,OAAO,kBAAkB,OAAO;CAClC,GAAG;EAAC;EAAO;EAAS;EAAK,QAAQ;CAAI,CAAC;AACxC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NavGroup } from "@alepha/ui/components/app-shell/app-shell";
|
|
2
|
+
export interface UseNavTreeOptions {
|
|
3
|
+
/**
|
|
4
|
+
* Route name that anchors the shell (e.g. the `/admin` layout page). Only
|
|
5
|
+
* its descendant pages with `nav` metadata become entries — this is what
|
|
6
|
+
* lets an app host several shells (a `/` app shell and a `/admin` shell),
|
|
7
|
+
* each scoped to its own subtree.
|
|
8
|
+
*/
|
|
9
|
+
root: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Derive sidebar navigation groups from the route tree. Built on the shared
|
|
13
|
+
* {@link useNavEntries} (which handles filtering, permissions, `can`, labelling
|
|
14
|
+
* and active-state); this hook only buckets the already-sorted entries into
|
|
15
|
+
* `nav.group` sections for {@link AppShell}.
|
|
16
|
+
*
|
|
17
|
+
* This replaces the hand-synced nav list that used to live alongside the
|
|
18
|
+
* router and breadcrumb definitions.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useNavTree(options: UseNavTreeOptions): NavGroup[];
|
|
21
|
+
//# sourceMappingURL=use-nav-tree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nav-tree.d.ts","sourceRoot":"","sources":["../../../src/components/nav-shell/use-nav-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,QAAQ,EAET,MAAM,2CAA2C,CAAC;AAInD,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,iBAAiB,GAAG,QAAQ,EAAE,CAsBjE"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { useNavEntries } from "./use-nav-entries.js";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
//#region src/components/nav-shell/use-nav-tree.ts
|
|
4
|
+
/**
|
|
5
|
+
* Derive sidebar navigation groups from the route tree. Built on the shared
|
|
6
|
+
* {@link useNavEntries} (which handles filtering, permissions, `can`, labelling
|
|
7
|
+
* and active-state); this hook only buckets the already-sorted entries into
|
|
8
|
+
* `nav.group` sections for {@link AppShell}.
|
|
9
|
+
*
|
|
10
|
+
* This replaces the hand-synced nav list that used to live alongside the
|
|
11
|
+
* router and breadcrumb definitions.
|
|
12
|
+
*/
|
|
13
|
+
function useNavTree(options) {
|
|
14
|
+
const entries = useNavEntries(options);
|
|
15
|
+
return useMemo(() => {
|
|
16
|
+
const groups = [];
|
|
17
|
+
const byKey = /* @__PURE__ */ new Map();
|
|
18
|
+
for (const entry of entries) {
|
|
19
|
+
const key = entry.group ?? "";
|
|
20
|
+
let items = byKey.get(key);
|
|
21
|
+
if (!items) {
|
|
22
|
+
items = [];
|
|
23
|
+
byKey.set(key, items);
|
|
24
|
+
groups.push({
|
|
25
|
+
label: entry.group || void 0,
|
|
26
|
+
items
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
items.push(toNavItem(entry));
|
|
30
|
+
}
|
|
31
|
+
return groups;
|
|
32
|
+
}, [entries]);
|
|
33
|
+
}
|
|
34
|
+
function toNavItem(entry) {
|
|
35
|
+
return {
|
|
36
|
+
label: entry.label,
|
|
37
|
+
href: entry.href,
|
|
38
|
+
icon: entry.icon,
|
|
39
|
+
badge: entry.badge,
|
|
40
|
+
tooltip: entry.description,
|
|
41
|
+
disabled: entry.disabled,
|
|
42
|
+
active: entry.active
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
//#endregion
|
|
46
|
+
export { useNavTree };
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=use-nav-tree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-nav-tree.js","names":[],"sources":["../../../src/components/nav-shell/use-nav-tree.ts"],"sourcesContent":["import type {\n NavGroup,\n NavItem,\n} from \"@alepha/ui/components/app-shell/app-shell\";\nimport { useMemo } from \"react\";\nimport { type NavEntry, useNavEntries } from \"./use-nav-entries.ts\";\n\nexport interface UseNavTreeOptions {\n /**\n * Route name that anchors the shell (e.g. the `/admin` layout page). Only\n * its descendant pages with `nav` metadata become entries — this is what\n * lets an app host several shells (a `/` app shell and a `/admin` shell),\n * each scoped to its own subtree.\n */\n root: string;\n}\n\n/**\n * Derive sidebar navigation groups from the route tree. Built on the shared\n * {@link useNavEntries} (which handles filtering, permissions, `can`, labelling\n * and active-state); this hook only buckets the already-sorted entries into\n * `nav.group` sections for {@link AppShell}.\n *\n * This replaces the hand-synced nav list that used to live alongside the\n * router and breadcrumb definitions.\n */\nexport function useNavTree(options: UseNavTreeOptions): NavGroup[] {\n const entries = useNavEntries(options);\n\n return useMemo(() => {\n const groups: NavGroup[] = [];\n const byKey = new Map<string, NavItem[]>();\n\n for (const entry of entries) {\n const key = entry.group ?? \"\";\n let items = byKey.get(key);\n if (!items) {\n items = [];\n byKey.set(key, items);\n // Entries are pre-sorted by (groupOrder, order), so the first time we\n // see a group it lands in the right position.\n groups.push({ label: entry.group || undefined, items });\n }\n items.push(toNavItem(entry));\n }\n\n return groups;\n }, [entries]);\n}\n\nfunction toNavItem(entry: NavEntry): NavItem {\n return {\n label: entry.label,\n href: entry.href,\n icon: entry.icon,\n badge: entry.badge,\n tooltip: entry.description,\n disabled: entry.disabled,\n active: entry.active,\n };\n}\n"],"mappings":";;;;;;;;;;;;AA0BA,SAAgB,WAAW,SAAwC;CACjE,MAAM,UAAU,cAAc,OAAO;CAErC,OAAO,cAAc;EACnB,MAAM,SAAqB,CAAC;EAC5B,MAAM,wBAAQ,IAAI,IAAuB;EAEzC,KAAK,MAAM,SAAS,SAAS;GAC3B,MAAM,MAAM,MAAM,SAAS;GAC3B,IAAI,QAAQ,MAAM,IAAI,GAAG;GACzB,IAAI,CAAC,OAAO;IACV,QAAQ,CAAC;IACT,MAAM,IAAI,KAAK,KAAK;IAGpB,OAAO,KAAK;KAAE,OAAO,MAAM,SAAS,KAAA;KAAW;IAAM,CAAC;GACxD;GACA,MAAM,KAAK,UAAU,KAAK,CAAC;EAC7B;EAEA,OAAO;CACT,GAAG,CAAC,OAAO,CAAC;AACd;AAEA,SAAS,UAAU,OAA0B;CAC3C,OAAO;EACL,OAAO,MAAM;EACb,MAAM,MAAM;EACZ,MAAM,MAAM;EACZ,OAAO,MAAM;EACb,SAAS,MAAM;EACf,UAAU,MAAM;EAChB,QAAQ,MAAM;CAChB;AACF"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SettingsDangerSectionProps {
|
|
3
|
+
/**
|
|
4
|
+
* Heading above the card.
|
|
5
|
+
*
|
|
6
|
+
* @default "Danger zone"
|
|
7
|
+
*/
|
|
8
|
+
title?: ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* One line under the title.
|
|
11
|
+
*/
|
|
12
|
+
description?: ReactNode;
|
|
13
|
+
/**
|
|
14
|
+
* {@link SettingsRow}s, each holding a `variant="destructive"` control.
|
|
15
|
+
*/
|
|
16
|
+
children: ReactNode;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* {@link SettingsSection} for irreversible actions — delete, leave, revoke
|
|
21
|
+
* everything.
|
|
22
|
+
*
|
|
23
|
+
* Identical in structure, with a destructive-tinted border and title. The
|
|
24
|
+
* colour is doing real work rather than decorating: these rows sit in the
|
|
25
|
+
* same visual rhythm as every harmless row above them, and without a boundary
|
|
26
|
+
* the only thing separating "change your display name" from "delete your
|
|
27
|
+
* account" is the button colour at the moment of the click.
|
|
28
|
+
*
|
|
29
|
+
* The tint stays at 30–40% opacity on purpose. A full-strength destructive
|
|
30
|
+
* border reads as *"something is wrong"* rather than *"be careful here"*, and
|
|
31
|
+
* a settings page that looks like it is erroring every time you open it
|
|
32
|
+
* teaches people to ignore the colour.
|
|
33
|
+
*/
|
|
34
|
+
export declare const SettingsDangerSection: (props: SettingsDangerSectionProps) => import("react").JSX.Element;
|
|
35
|
+
//# sourceMappingURL=settings-danger-section.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-danger-section.d.ts","sourceRoot":"","sources":["../../../src/components/settings/settings-danger-section.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,0BAA0B;IACzC;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;OAEG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,qBAAqB,UAAW,0BAA0B,gCAkBtE,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { Card } from "../ui/card.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/settings/settings-danger-section.tsx
|
|
5
|
+
/**
|
|
6
|
+
* {@link SettingsSection} for irreversible actions — delete, leave, revoke
|
|
7
|
+
* everything.
|
|
8
|
+
*
|
|
9
|
+
* Identical in structure, with a destructive-tinted border and title. The
|
|
10
|
+
* colour is doing real work rather than decorating: these rows sit in the
|
|
11
|
+
* same visual rhythm as every harmless row above them, and without a boundary
|
|
12
|
+
* the only thing separating "change your display name" from "delete your
|
|
13
|
+
* account" is the button colour at the moment of the click.
|
|
14
|
+
*
|
|
15
|
+
* The tint stays at 30–40% opacity on purpose. A full-strength destructive
|
|
16
|
+
* border reads as *"something is wrong"* rather than *"be careful here"*, and
|
|
17
|
+
* a settings page that looks like it is erroring every time you open it
|
|
18
|
+
* teaches people to ignore the colour.
|
|
19
|
+
*/
|
|
20
|
+
const SettingsDangerSection = (props) => {
|
|
21
|
+
const { title = "Danger zone" } = props;
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
23
|
+
className: cn("flex flex-col gap-2", props.className),
|
|
24
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
25
|
+
className: "flex flex-col gap-0.5",
|
|
26
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
27
|
+
className: "text-destructive text-sm",
|
|
28
|
+
children: title
|
|
29
|
+
}), props.description != null ? /* @__PURE__ */ jsx("span", {
|
|
30
|
+
className: "text-muted-foreground text-xs",
|
|
31
|
+
children: props.description
|
|
32
|
+
}) : null]
|
|
33
|
+
}), /* @__PURE__ */ jsx(Card, {
|
|
34
|
+
className: "gap-0 divide-y divide-destructive/20 rounded-lg border border-destructive/30 bg-card py-0",
|
|
35
|
+
children: props.children
|
|
36
|
+
})]
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { SettingsDangerSection };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=settings-danger-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-danger-section.js","names":[],"sources":["../../../src/components/settings/settings-danger-section.tsx"],"sourcesContent":["import { Card } from \"@alepha/ui/components/ui/card\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport type { ReactNode } from \"react\";\n\nexport interface SettingsDangerSectionProps {\n /**\n * Heading above the card.\n *\n * @default \"Danger zone\"\n */\n title?: ReactNode;\n\n /**\n * One line under the title.\n */\n description?: ReactNode;\n\n /**\n * {@link SettingsRow}s, each holding a `variant=\"destructive\"` control.\n */\n children: ReactNode;\n\n className?: string;\n}\n\n/**\n * {@link SettingsSection} for irreversible actions — delete, leave, revoke\n * everything.\n *\n * Identical in structure, with a destructive-tinted border and title. The\n * colour is doing real work rather than decorating: these rows sit in the\n * same visual rhythm as every harmless row above them, and without a boundary\n * the only thing separating \"change your display name\" from \"delete your\n * account\" is the button colour at the moment of the click.\n *\n * The tint stays at 30–40% opacity on purpose. A full-strength destructive\n * border reads as *\"something is wrong\"* rather than *\"be careful here\"*, and\n * a settings page that looks like it is erroring every time you open it\n * teaches people to ignore the colour.\n */\nexport const SettingsDangerSection = (props: SettingsDangerSectionProps) => {\n const { title = \"Danger zone\" } = props;\n\n return (\n <div className={cn(\"flex flex-col gap-2\", props.className)}>\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"text-destructive text-sm\">{title}</span>\n {props.description != null ? (\n <span className=\"text-muted-foreground text-xs\">\n {props.description}\n </span>\n ) : null}\n </div>\n <Card className=\"gap-0 divide-y divide-destructive/20 rounded-lg border border-destructive/30 bg-card py-0\">\n {props.children}\n </Card>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAwCA,MAAa,yBAAyB,UAAsC;CAC1E,MAAM,EAAE,QAAQ,kBAAkB;CAElC,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,uBAAuB,MAAM,SAAS;EAAzD,UAAA,CACE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,oBAAC,QAAD;IAAM,WAAU;IAA4B,UAAA;GAAY,CAAA,GACvD,MAAM,eAAe,OACpB,oBAAC,QAAD;IAAM,WAAU;IACb,UAAA,MAAM;GACH,CAAA,IACJ,IACD;EACL,CAAA,GAAA,oBAAC,MAAD;GAAM,WAAU;GACb,UAAA,MAAM;EACH,CAAA,CACH;;AAET"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SettingsHeadingProps {
|
|
3
|
+
/**
|
|
4
|
+
* What this block of the page is. A noun phrase naming the thing, not a verb
|
|
5
|
+
* phrase describing the action: "Active sessions", not "Manage sessions".
|
|
6
|
+
*/
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* One line under the title. The place to put what the reader needs to know
|
|
10
|
+
* before touching anything below it — a consequence, a constraint, a limit.
|
|
11
|
+
* Skip it rather than restate the title in more words.
|
|
12
|
+
*/
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
className?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The title + description pair that sits above a settings block.
|
|
18
|
+
*
|
|
19
|
+
* It exists so there is exactly one of it. {@link SettingsSection} renders this
|
|
20
|
+
* for the common case (a heading over a card of {@link SettingsRow}s), and a
|
|
21
|
+
* page whose content is not a card of rows — a table, a list of invitations —
|
|
22
|
+
* uses it directly instead of hand-rolling the markup.
|
|
23
|
+
*
|
|
24
|
+
* That hand-rolling is the failure this prevents, and it had already happened:
|
|
25
|
+
* `apps/lore`'s account pages grew an `<h2 className="text-base font-semibold">`
|
|
26
|
+
* on one page and a bare `<span className="text-xs">` with no title at all on
|
|
27
|
+
* another, so the `/account` rail led to three different type scales depending
|
|
28
|
+
* on which entry you clicked. Nothing was broken and nothing could have failed
|
|
29
|
+
* — it just read as three pages from three different applications.
|
|
30
|
+
*
|
|
31
|
+
* ⚠️ **No em dash in these strings.** House rule across every user-facing
|
|
32
|
+
* string, in this component and everywhere else: use a comma, a semicolon, a
|
|
33
|
+
* full stop, or split the sentence in two.
|
|
34
|
+
*/
|
|
35
|
+
export declare const SettingsHeading: (props: SettingsHeadingProps) => import("react").JSX.Element | null;
|
|
36
|
+
//# sourceMappingURL=settings-heading.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-heading.d.ts","sourceRoot":"","sources":["../../../src/components/settings/settings-heading.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,oBAAoB;IACnC;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;;OAIG;IACH,WAAW,CAAC,EAAE,SAAS,CAAC;IAExB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,eAAe,UAAW,oBAAoB,uCAe1D,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/settings/settings-heading.tsx
|
|
4
|
+
/**
|
|
5
|
+
* The title + description pair that sits above a settings block.
|
|
6
|
+
*
|
|
7
|
+
* It exists so there is exactly one of it. {@link SettingsSection} renders this
|
|
8
|
+
* for the common case (a heading over a card of {@link SettingsRow}s), and a
|
|
9
|
+
* page whose content is not a card of rows — a table, a list of invitations —
|
|
10
|
+
* uses it directly instead of hand-rolling the markup.
|
|
11
|
+
*
|
|
12
|
+
* That hand-rolling is the failure this prevents, and it had already happened:
|
|
13
|
+
* `apps/lore`'s account pages grew an `<h2 className="text-base font-semibold">`
|
|
14
|
+
* on one page and a bare `<span className="text-xs">` with no title at all on
|
|
15
|
+
* another, so the `/account` rail led to three different type scales depending
|
|
16
|
+
* on which entry you clicked. Nothing was broken and nothing could have failed
|
|
17
|
+
* — it just read as three pages from three different applications.
|
|
18
|
+
*
|
|
19
|
+
* ⚠️ **No em dash in these strings.** House rule across every user-facing
|
|
20
|
+
* string, in this component and everywhere else: use a comma, a semicolon, a
|
|
21
|
+
* full stop, or split the sentence in two.
|
|
22
|
+
*/
|
|
23
|
+
const SettingsHeading = (props) => {
|
|
24
|
+
if (props.title == null && props.description == null) return null;
|
|
25
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
26
|
+
className: cn("flex flex-col gap-0.5", props.className),
|
|
27
|
+
children: [props.title != null ? /* @__PURE__ */ jsx("span", {
|
|
28
|
+
className: "text-sm",
|
|
29
|
+
children: props.title
|
|
30
|
+
}) : null, props.description != null ? /* @__PURE__ */ jsx("span", {
|
|
31
|
+
className: "text-muted-foreground text-xs",
|
|
32
|
+
children: props.description
|
|
33
|
+
}) : null]
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { SettingsHeading };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=settings-heading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-heading.js","names":[],"sources":["../../../src/components/settings/settings-heading.tsx"],"sourcesContent":["import { cn } from \"@alepha/ui/lib/utils\";\nimport type { ReactNode } from \"react\";\n\nexport interface SettingsHeadingProps {\n /**\n * What this block of the page is. A noun phrase naming the thing, not a verb\n * phrase describing the action: \"Active sessions\", not \"Manage sessions\".\n */\n title?: ReactNode;\n\n /**\n * One line under the title. The place to put what the reader needs to know\n * before touching anything below it — a consequence, a constraint, a limit.\n * Skip it rather than restate the title in more words.\n */\n description?: ReactNode;\n\n className?: string;\n}\n\n/**\n * The title + description pair that sits above a settings block.\n *\n * It exists so there is exactly one of it. {@link SettingsSection} renders this\n * for the common case (a heading over a card of {@link SettingsRow}s), and a\n * page whose content is not a card of rows — a table, a list of invitations —\n * uses it directly instead of hand-rolling the markup.\n *\n * That hand-rolling is the failure this prevents, and it had already happened:\n * `apps/lore`'s account pages grew an `<h2 className=\"text-base font-semibold\">`\n * on one page and a bare `<span className=\"text-xs\">` with no title at all on\n * another, so the `/account` rail led to three different type scales depending\n * on which entry you clicked. Nothing was broken and nothing could have failed\n * — it just read as three pages from three different applications.\n *\n * ⚠️ **No em dash in these strings.** House rule across every user-facing\n * string, in this component and everywhere else: use a comma, a semicolon, a\n * full stop, or split the sentence in two.\n */\nexport const SettingsHeading = (props: SettingsHeadingProps) => {\n if (props.title == null && props.description == null) return null;\n\n return (\n <div className={cn(\"flex flex-col gap-0.5\", props.className)}>\n {props.title != null ? (\n <span className=\"text-sm\">{props.title}</span>\n ) : null}\n {props.description != null ? (\n <span className=\"text-muted-foreground text-xs\">\n {props.description}\n </span>\n ) : null}\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAa,mBAAmB,UAAgC;CAC9D,IAAI,MAAM,SAAS,QAAQ,MAAM,eAAe,MAAM,OAAO;CAE7D,OACE,qBAAC,OAAD;EAAK,WAAW,GAAG,yBAAyB,MAAM,SAAS;EAA3D,UAAA,CACG,MAAM,SAAS,OACd,oBAAC,QAAD;GAAM,WAAU;GAAW,UAAA,MAAM;EAAY,CAAA,IAC3C,MACH,MAAM,eAAe,OACpB,oBAAC,QAAD;GAAM,WAAU;GACb,UAAA,MAAM;EACH,CAAA,IACJ,IACD;;AAET"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export interface SettingsLayoutProps {
|
|
3
|
+
/**
|
|
4
|
+
* The left rail — normally a {@link SettingsNav}. Omit for a settings page
|
|
5
|
+
* with a single screen and nothing to navigate between.
|
|
6
|
+
*/
|
|
7
|
+
nav?: ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Full-width block above both columns: an identity card, a page title, a
|
|
10
|
+
* back link. Rendered inside the centred container, so it lines up with the
|
|
11
|
+
* content rather than the viewport.
|
|
12
|
+
*/
|
|
13
|
+
header?: ReactNode;
|
|
14
|
+
/**
|
|
15
|
+
* The routed content — normally a `NestedView`.
|
|
16
|
+
*/
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
/**
|
|
19
|
+
* Bound the shell to its parent's height and give the content column its
|
|
20
|
+
* own scrollbar, instead of letting the document scroll.
|
|
21
|
+
*
|
|
22
|
+
* Turn it on when this layout is mounted inside a host that has already
|
|
23
|
+
* taken the viewport height and hidden its own overflow — an application
|
|
24
|
+
* shell built as `h-svh … overflow-hidden`, which is the usual shape for an
|
|
25
|
+
* app with a fixed header. In that host the default (below) has no scrollbar
|
|
26
|
+
* to give: the document cannot scroll, so anything past the fold is simply
|
|
27
|
+
* unreachable.
|
|
28
|
+
*
|
|
29
|
+
* The mode is deliberately not auto-detected. Reading the ancestor chain for
|
|
30
|
+
* a clipping parent is a layout-effect away from a flash of the wrong shape
|
|
31
|
+
* on every mount, and the host already knows the answer at boot.
|
|
32
|
+
*
|
|
33
|
+
* It serves both kinds of page at once, which is why there is one flag
|
|
34
|
+
* rather than two:
|
|
35
|
+
*
|
|
36
|
+
* - A natural-height page (a stack of {@link SettingsSection} cards) exceeds
|
|
37
|
+
* the column and scrolls it — the same reading experience as the default,
|
|
38
|
+
* just against a nearer scroll root.
|
|
39
|
+
* - A page that opts into `flex-1 min-h-0` is bounded by the column instead,
|
|
40
|
+
* so it can hand the scroll to a child. That is what lets a table keep its
|
|
41
|
+
* filters and pagination bar pinned while only its rows move.
|
|
42
|
+
*/
|
|
43
|
+
fill?: boolean;
|
|
44
|
+
className?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Centred two-column shell for a settings area: sticky rail on the left,
|
|
48
|
+
* content on the right, stacked on small screens.
|
|
49
|
+
*
|
|
50
|
+
* `min-w-0` on the content column is load-bearing. A grid/flex child defaults
|
|
51
|
+
* to `min-width: auto`, which is the *content's* intrinsic width — so one
|
|
52
|
+
* unbreakable string (an API key, a long email, a `<pre>` block) makes the
|
|
53
|
+
* column refuse to shrink and pushes the whole page into horizontal scroll,
|
|
54
|
+
* rail included. `min-w-0` lets it shrink and lets the child's own
|
|
55
|
+
* `overflow` handle it.
|
|
56
|
+
*
|
|
57
|
+
* By default there is no scroll container here and the page scrolls, because
|
|
58
|
+
* a nested `overflow-auto` would strand the sticky rail against the wrong
|
|
59
|
+
* scroll root. Pass {@link SettingsLayoutProps.fill} when the host has already
|
|
60
|
+
* claimed the viewport height and clipped its own overflow, so there is no
|
|
61
|
+
* page scroll left to inherit.
|
|
62
|
+
*
|
|
63
|
+
* `md:items-start` becomes `md:items-stretch` under `fill` so the content
|
|
64
|
+
* column is as tall as the row rather than as tall as its content — a column
|
|
65
|
+
* sized by its content can never be the thing that scrolls. The rail is
|
|
66
|
+
* unaffected either way: it carries its own `md:self-start`, which outranks
|
|
67
|
+
* whatever the row aligns to.
|
|
68
|
+
*
|
|
69
|
+
* ⚠️ **`fill` engages at `md` and up only, and the root keeps a scrollbar at
|
|
70
|
+
* every width.** Below `md` the rail is not a rail: it stacks above the
|
|
71
|
+
* content as a full list of links, which on a phone is most of the viewport.
|
|
72
|
+
* Splitting what little is left into a second bounded pane gives a page a few
|
|
73
|
+
* hundred pixels it cannot grow out of — a table lands in a box too short to
|
|
74
|
+
* show a row, and because that table owns its own scroll, nothing above it can
|
|
75
|
+
* scroll to make room. So the mobile shape stays the default one: the root
|
|
76
|
+
* scrolls, rail and content together. At `md` and up the row is bounded, so
|
|
77
|
+
* the root's scrollbar never has anything to show and the content column is
|
|
78
|
+
* the scroll root instead.
|
|
79
|
+
*/
|
|
80
|
+
export declare const SettingsLayout: (props: SettingsLayoutProps) => import("react").JSX.Element;
|
|
81
|
+
//# sourceMappingURL=settings-layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-layout.d.ts","sourceRoot":"","sources":["../../../src/components/settings/settings-layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,GAAG,CAAC,EAAE,SAAS,CAAC;IAEhB;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;IAEpB;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,cAAc,UAAW,mBAAmB,gCA4BxD,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
//#region src/components/settings/settings-layout.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Centred two-column shell for a settings area: sticky rail on the left,
|
|
6
|
+
* content on the right, stacked on small screens.
|
|
7
|
+
*
|
|
8
|
+
* `min-w-0` on the content column is load-bearing. A grid/flex child defaults
|
|
9
|
+
* to `min-width: auto`, which is the *content's* intrinsic width — so one
|
|
10
|
+
* unbreakable string (an API key, a long email, a `<pre>` block) makes the
|
|
11
|
+
* column refuse to shrink and pushes the whole page into horizontal scroll,
|
|
12
|
+
* rail included. `min-w-0` lets it shrink and lets the child's own
|
|
13
|
+
* `overflow` handle it.
|
|
14
|
+
*
|
|
15
|
+
* By default there is no scroll container here and the page scrolls, because
|
|
16
|
+
* a nested `overflow-auto` would strand the sticky rail against the wrong
|
|
17
|
+
* scroll root. Pass {@link SettingsLayoutProps.fill} when the host has already
|
|
18
|
+
* claimed the viewport height and clipped its own overflow, so there is no
|
|
19
|
+
* page scroll left to inherit.
|
|
20
|
+
*
|
|
21
|
+
* `md:items-start` becomes `md:items-stretch` under `fill` so the content
|
|
22
|
+
* column is as tall as the row rather than as tall as its content — a column
|
|
23
|
+
* sized by its content can never be the thing that scrolls. The rail is
|
|
24
|
+
* unaffected either way: it carries its own `md:self-start`, which outranks
|
|
25
|
+
* whatever the row aligns to.
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ **`fill` engages at `md` and up only, and the root keeps a scrollbar at
|
|
28
|
+
* every width.** Below `md` the rail is not a rail: it stacks above the
|
|
29
|
+
* content as a full list of links, which on a phone is most of the viewport.
|
|
30
|
+
* Splitting what little is left into a second bounded pane gives a page a few
|
|
31
|
+
* hundred pixels it cannot grow out of — a table lands in a box too short to
|
|
32
|
+
* show a row, and because that table owns its own scroll, nothing above it can
|
|
33
|
+
* scroll to make room. So the mobile shape stays the default one: the root
|
|
34
|
+
* scrolls, rail and content together. At `md` and up the row is bounded, so
|
|
35
|
+
* the root's scrollbar never has anything to show and the content column is
|
|
36
|
+
* the scroll root instead.
|
|
37
|
+
*/
|
|
38
|
+
const SettingsLayout = (props) => {
|
|
39
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
40
|
+
className: cn("mx-auto w-full max-w-5xl p-4 md:pt-10", props.fill && "flex h-full min-h-0 flex-col overflow-y-auto", props.className),
|
|
41
|
+
children: [props.header ? /* @__PURE__ */ jsx("div", {
|
|
42
|
+
className: "mb-6",
|
|
43
|
+
children: props.header
|
|
44
|
+
}) : null, /* @__PURE__ */ jsxs("div", {
|
|
45
|
+
className: cn("flex flex-col gap-6 md:flex-row md:items-start", props.fill && "md:min-h-0 md:flex-1 md:items-stretch"),
|
|
46
|
+
children: [props.nav, /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: cn("flex min-w-0 flex-1 flex-col gap-8", props.fill && "md:min-h-0 md:overflow-y-auto"),
|
|
48
|
+
children: props.children
|
|
49
|
+
})]
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
//#endregion
|
|
54
|
+
export { SettingsLayout };
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=settings-layout.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-layout.js","names":[],"sources":["../../../src/components/settings/settings-layout.tsx"],"sourcesContent":["import { cn } from \"@alepha/ui/lib/utils\";\nimport type { ReactNode } from \"react\";\n\nexport interface SettingsLayoutProps {\n /**\n * The left rail — normally a {@link SettingsNav}. Omit for a settings page\n * with a single screen and nothing to navigate between.\n */\n nav?: ReactNode;\n\n /**\n * Full-width block above both columns: an identity card, a page title, a\n * back link. Rendered inside the centred container, so it lines up with the\n * content rather than the viewport.\n */\n header?: ReactNode;\n\n /**\n * The routed content — normally a `NestedView`.\n */\n children: ReactNode;\n\n /**\n * Bound the shell to its parent's height and give the content column its\n * own scrollbar, instead of letting the document scroll.\n *\n * Turn it on when this layout is mounted inside a host that has already\n * taken the viewport height and hidden its own overflow — an application\n * shell built as `h-svh … overflow-hidden`, which is the usual shape for an\n * app with a fixed header. In that host the default (below) has no scrollbar\n * to give: the document cannot scroll, so anything past the fold is simply\n * unreachable.\n *\n * The mode is deliberately not auto-detected. Reading the ancestor chain for\n * a clipping parent is a layout-effect away from a flash of the wrong shape\n * on every mount, and the host already knows the answer at boot.\n *\n * It serves both kinds of page at once, which is why there is one flag\n * rather than two:\n *\n * - A natural-height page (a stack of {@link SettingsSection} cards) exceeds\n * the column and scrolls it — the same reading experience as the default,\n * just against a nearer scroll root.\n * - A page that opts into `flex-1 min-h-0` is bounded by the column instead,\n * so it can hand the scroll to a child. That is what lets a table keep its\n * filters and pagination bar pinned while only its rows move.\n */\n fill?: boolean;\n\n className?: string;\n}\n\n/**\n * Centred two-column shell for a settings area: sticky rail on the left,\n * content on the right, stacked on small screens.\n *\n * `min-w-0` on the content column is load-bearing. A grid/flex child defaults\n * to `min-width: auto`, which is the *content's* intrinsic width — so one\n * unbreakable string (an API key, a long email, a `<pre>` block) makes the\n * column refuse to shrink and pushes the whole page into horizontal scroll,\n * rail included. `min-w-0` lets it shrink and lets the child's own\n * `overflow` handle it.\n *\n * By default there is no scroll container here and the page scrolls, because\n * a nested `overflow-auto` would strand the sticky rail against the wrong\n * scroll root. Pass {@link SettingsLayoutProps.fill} when the host has already\n * claimed the viewport height and clipped its own overflow, so there is no\n * page scroll left to inherit.\n *\n * `md:items-start` becomes `md:items-stretch` under `fill` so the content\n * column is as tall as the row rather than as tall as its content — a column\n * sized by its content can never be the thing that scrolls. The rail is\n * unaffected either way: it carries its own `md:self-start`, which outranks\n * whatever the row aligns to.\n *\n * ⚠️ **`fill` engages at `md` and up only, and the root keeps a scrollbar at\n * every width.** Below `md` the rail is not a rail: it stacks above the\n * content as a full list of links, which on a phone is most of the viewport.\n * Splitting what little is left into a second bounded pane gives a page a few\n * hundred pixels it cannot grow out of — a table lands in a box too short to\n * show a row, and because that table owns its own scroll, nothing above it can\n * scroll to make room. So the mobile shape stays the default one: the root\n * scrolls, rail and content together. At `md` and up the row is bounded, so\n * the root's scrollbar never has anything to show and the content column is\n * the scroll root instead.\n */\nexport const SettingsLayout = (props: SettingsLayoutProps) => {\n return (\n <div\n className={cn(\n \"mx-auto w-full max-w-5xl p-4 md:pt-10\",\n props.fill && \"flex h-full min-h-0 flex-col overflow-y-auto\",\n props.className,\n )}\n >\n {props.header ? <div className=\"mb-6\">{props.header}</div> : null}\n <div\n className={cn(\n \"flex flex-col gap-6 md:flex-row md:items-start\",\n props.fill && \"md:min-h-0 md:flex-1 md:items-stretch\",\n )}\n >\n {props.nav}\n <div\n className={cn(\n \"flex min-w-0 flex-1 flex-col gap-8\",\n props.fill && \"md:min-h-0 md:overflow-y-auto\",\n )}\n >\n {props.children}\n </div>\n </div>\n </div>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFA,MAAa,kBAAkB,UAA+B;CAC5D,OACE,qBAAC,OAAD;EACE,WAAW,GACT,yCACA,MAAM,QAAQ,gDACd,MAAM,SACR;EALF,UAAA,CAOG,MAAM,SAAS,oBAAC,OAAD;GAAK,WAAU;GAAQ,UAAA,MAAM;EAAY,CAAA,IAAI,MAC7D,qBAAC,OAAD;GACE,WAAW,GACT,kDACA,MAAM,QAAQ,uCAChB;GAJF,UAAA,CAMG,MAAM,KACP,oBAAC,OAAD;IACE,WAAW,GACT,sCACA,MAAM,QAAQ,+BAChB;IAEC,UAAA,MAAM;GACJ,CAAA,CACF;EACF,CAAA,CAAA;;AAET"}
|