@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
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
TooltipTrigger,
|
|
17
17
|
} from "@alepha/ui/components/ui/tooltip";
|
|
18
18
|
import { useAuth } from "alepha/react/auth";
|
|
19
|
-
import {
|
|
19
|
+
import { Link, useRouter } from "alepha/react/router";
|
|
20
|
+
import { CircleUser, LogIn, LogOut, Shield, User } from "lucide-react";
|
|
20
21
|
import type { ReactNode } from "react";
|
|
21
22
|
|
|
22
23
|
export interface ButtonUserProps {
|
|
@@ -135,6 +136,14 @@ const DefaultMenu = (props: DefaultMenuProps) => {
|
|
|
135
136
|
return (
|
|
136
137
|
<>
|
|
137
138
|
<Email />
|
|
139
|
+
{/*
|
|
140
|
+
Account first, admin second: the account page is where every signed-in
|
|
141
|
+
user has something to do, and the admin panel is a destination a
|
|
142
|
+
minority of them can even see. Keep the two in this order everywhere
|
|
143
|
+
the pair is composed (see `AppActions`) so the menu does not reshuffle
|
|
144
|
+
between surfaces.
|
|
145
|
+
*/}
|
|
146
|
+
<AccountMenuItem />
|
|
138
147
|
{props.onAdminClick && <AdminMenuItem onClick={props.onAdminClick} />}
|
|
139
148
|
<DropdownMenuSeparator />
|
|
140
149
|
<LogoutMenuItem />
|
|
@@ -166,9 +175,19 @@ const Email = (props: ButtonUserEmailProps) => {
|
|
|
166
175
|
|
|
167
176
|
export interface ButtonUserAdminMenuItemProps {
|
|
168
177
|
/**
|
|
169
|
-
*
|
|
178
|
+
* Route name to link to. Defaults to `"admin"`, which is what `AdminRouter`
|
|
179
|
+
* registers. Prefer this over {@link onClick}: it is what makes the item a
|
|
180
|
+
* real anchor.
|
|
170
181
|
*/
|
|
171
|
-
|
|
182
|
+
routeName?: string;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Escape hatch for a destination no route name can express. Supplying it
|
|
186
|
+
* turns the item back into a click handler on a `div`, so the entry loses
|
|
187
|
+
* ⌘-click, middle-click and "open in new tab" — see {@link AccountMenuItem}.
|
|
188
|
+
*/
|
|
189
|
+
onClick?: () => void;
|
|
190
|
+
|
|
172
191
|
/**
|
|
173
192
|
* Item label. Defaults to `"Admin Panel"`.
|
|
174
193
|
*/
|
|
@@ -182,12 +201,108 @@ export interface ButtonUserAdminMenuItemProps {
|
|
|
182
201
|
|
|
183
202
|
const AdminMenuItem = (props: ButtonUserAdminMenuItemProps) => {
|
|
184
203
|
const auth = useAuth();
|
|
204
|
+
const router = useRouter<any>();
|
|
185
205
|
const permission = props.permission ?? "admin:ui";
|
|
186
206
|
if (!auth.has(permission)) return null;
|
|
187
|
-
|
|
188
|
-
|
|
207
|
+
|
|
208
|
+
const label = (
|
|
209
|
+
<>
|
|
189
210
|
<Shield className="size-4" />
|
|
190
211
|
{props.label ?? "Admin Panel"}
|
|
212
|
+
</>
|
|
213
|
+
);
|
|
214
|
+
|
|
215
|
+
if (props.onClick) {
|
|
216
|
+
return <DropdownMenuItem onClick={props.onClick}>{label}</DropdownMenuItem>;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
const routeName = props.routeName ?? "admin";
|
|
220
|
+
// Same "is the module actually mounted" question `AccountMenuItem` asks. An
|
|
221
|
+
// unregistered name would resolve to a literal `/admin`-shaped string and
|
|
222
|
+
// give the user a link to a 404.
|
|
223
|
+
if (!router.pages?.some((page: any) => page.name === routeName)) return null;
|
|
224
|
+
|
|
225
|
+
return (
|
|
226
|
+
<DropdownMenuItem render={<Link href={router.path(routeName)} />}>
|
|
227
|
+
{label}
|
|
228
|
+
</DropdownMenuItem>
|
|
229
|
+
);
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
export interface ButtonUserAccountMenuItemProps {
|
|
233
|
+
/**
|
|
234
|
+
* Route name to link to. Defaults to `"account"`, which is what
|
|
235
|
+
* `AccountRouter` registers — set it only if you mounted the account area
|
|
236
|
+
* under a different name.
|
|
237
|
+
*/
|
|
238
|
+
routeName?: string;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Escape hatch for a destination no route name can express. Supplying it
|
|
242
|
+
* turns the item back into a click handler on a `div`, giving up everything
|
|
243
|
+
* an anchor provides.
|
|
244
|
+
*/
|
|
245
|
+
onClick?: () => void;
|
|
246
|
+
|
|
247
|
+
/**
|
|
248
|
+
* Item label. Defaults to `"User Account"`.
|
|
249
|
+
*/
|
|
250
|
+
label?: string;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Link to the signed-in user's own account area.
|
|
255
|
+
*
|
|
256
|
+
* ⚠️ **It owns its destination, unlike {@link ButtonUser.AdminMenuItem}.**
|
|
257
|
+
* That asymmetry is deliberate. Every caller that hard-coded this navigation
|
|
258
|
+
* got it wrong the moment the account area moved — `router.push("me")` kept
|
|
259
|
+
* compiling after the `me` route ceased to exist, because `router.push` falls
|
|
260
|
+
* back to a plain `string` overload, and threw only when someone clicked it.
|
|
261
|
+
* Defaulting to the route `AccountRouter` actually registers removes the whole
|
|
262
|
+
* class of bug; `onClick` stays available for an application that mounted the
|
|
263
|
+
* area itself under another name.
|
|
264
|
+
*
|
|
265
|
+
* **It hides itself when no `account` route is registered**, so an application
|
|
266
|
+
* that never mounts `AccountRouter` gets no dead entry — the same "is the
|
|
267
|
+
* module actually there" question the router's own `can` gates answer, asked
|
|
268
|
+
* the only way a menu item can ask it.
|
|
269
|
+
*
|
|
270
|
+
* ⚠️ **It renders an `<a href>`, not a click handler**, because it is a
|
|
271
|
+
* destination rather than an action. `DropdownMenuItem` is a Base UI
|
|
272
|
+
* `Menu.Item`, which defaults to a `div` — correct for Logout, wrong here: a
|
|
273
|
+
* div navigating from `onClick` cannot be ⌘-clicked, middle-clicked or opened
|
|
274
|
+
* in a new tab, shows no target on hover, and offers no "copy link address".
|
|
275
|
+
* `render` swaps the element while Base UI keeps `role="menuitem"` and its
|
|
276
|
+
* keyboard handling, so the menu semantics are unchanged.
|
|
277
|
+
*/
|
|
278
|
+
const AccountMenuItem = (props: ButtonUserAccountMenuItemProps) => {
|
|
279
|
+
const auth = useAuth();
|
|
280
|
+
const router = useRouter<any>();
|
|
281
|
+
|
|
282
|
+
if (!auth.user) {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
const label = (
|
|
287
|
+
<>
|
|
288
|
+
<CircleUser className="size-4" />
|
|
289
|
+
{props.label ?? "User Account"}
|
|
290
|
+
</>
|
|
291
|
+
);
|
|
292
|
+
|
|
293
|
+
if (props.onClick) {
|
|
294
|
+
return <DropdownMenuItem onClick={props.onClick}>{label}</DropdownMenuItem>;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
// No account area mounted → no entry, rather than one that 404s on click.
|
|
298
|
+
const routeName = props.routeName ?? "account";
|
|
299
|
+
if (!router.pages?.some((page: any) => page.name === routeName)) {
|
|
300
|
+
return null;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
return (
|
|
304
|
+
<DropdownMenuItem render={<Link href={router.path(routeName)} />}>
|
|
305
|
+
{label}
|
|
191
306
|
</DropdownMenuItem>
|
|
192
307
|
);
|
|
193
308
|
};
|
|
@@ -211,4 +326,5 @@ const LogoutMenuItem = (props: ButtonUserLogoutMenuItemProps) => {
|
|
|
211
326
|
|
|
212
327
|
ButtonUser.Email = Email;
|
|
213
328
|
ButtonUser.AdminMenuItem = AdminMenuItem;
|
|
329
|
+
ButtonUser.AccountMenuItem = AccountMenuItem;
|
|
214
330
|
ButtonUser.LogoutMenuItem = LogoutMenuItem;
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
FormField,
|
|
11
11
|
formFieldAriaProps,
|
|
12
12
|
useFormFieldAutoSave,
|
|
13
|
+
useFormFieldLayout,
|
|
13
14
|
} from "@alepha/ui/components/control-base/form-field";
|
|
14
15
|
import {
|
|
15
16
|
type IconComponent,
|
|
@@ -18,6 +19,7 @@ import {
|
|
|
18
19
|
import { ControlDate } from "@alepha/ui/components/control-date/control-date";
|
|
19
20
|
import { ControlNumber } from "@alepha/ui/components/control-number/control-number";
|
|
20
21
|
import { ControlObject } from "@alepha/ui/components/control-object/control-object";
|
|
22
|
+
import { ControlPassword } from "@alepha/ui/components/control-password/control-password";
|
|
21
23
|
import {
|
|
22
24
|
ControlSelect,
|
|
23
25
|
type SelectOption,
|
|
@@ -26,10 +28,10 @@ import {
|
|
|
26
28
|
ControlUpload,
|
|
27
29
|
type ControlUploadProps,
|
|
28
30
|
} from "@alepha/ui/components/control-upload/control-upload";
|
|
29
|
-
import { Button } from "@alepha/ui/components/ui/button";
|
|
30
31
|
import { Input } from "@alepha/ui/components/ui/input";
|
|
31
32
|
import { Switch } from "@alepha/ui/components/ui/switch";
|
|
32
33
|
import { Textarea } from "@alepha/ui/components/ui/textarea";
|
|
34
|
+
import { cn } from "@alepha/ui/lib/utils";
|
|
33
35
|
import { z } from "alepha";
|
|
34
36
|
import { useAlepha } from "alepha/react";
|
|
35
37
|
import {
|
|
@@ -39,7 +41,7 @@ import {
|
|
|
39
41
|
useFormState,
|
|
40
42
|
} from "alepha/react/form";
|
|
41
43
|
import { resolveSchemaControl, type SchemaControl } from "alepha/react/ui";
|
|
42
|
-
import { Check,
|
|
44
|
+
import { Check, X } from "lucide-react";
|
|
43
45
|
import {
|
|
44
46
|
type ComponentType,
|
|
45
47
|
type HTMLAttributes,
|
|
@@ -102,9 +104,14 @@ export interface ControlProps {
|
|
|
102
104
|
*/
|
|
103
105
|
select?: boolean;
|
|
104
106
|
/**
|
|
105
|
-
* Force a combobox (searchable select).
|
|
107
|
+
* Force a combobox (searchable select). Alias for `searchable: true`.
|
|
106
108
|
*/
|
|
107
109
|
combobox?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Force the select's search input on or off. Defaults to "auto" — on above
|
|
112
|
+
* ~20 options, off below.
|
|
113
|
+
*/
|
|
114
|
+
searchable?: boolean;
|
|
108
115
|
/**
|
|
109
116
|
* Force a `<Segmented>` control (one option visible at a time).
|
|
110
117
|
*/
|
|
@@ -201,8 +208,16 @@ export interface ControlProps {
|
|
|
201
208
|
| SelectOption[]
|
|
202
209
|
| ((query: string) => SelectOption[] | Promise<SelectOption[]>);
|
|
203
210
|
/**
|
|
204
|
-
*
|
|
205
|
-
*
|
|
211
|
+
* Whether the field offers a way back to empty.
|
|
212
|
+
*
|
|
213
|
+
* On a `ControlSelect`, `true` adds a synthetic "none" row that resets the
|
|
214
|
+
* field to `undefined` — use it for optional filter chips.
|
|
215
|
+
*
|
|
216
|
+
* On a text field the affordance is the opposite way round: an optional
|
|
217
|
+
* field already shows a clear (×) button whenever it holds a value, and
|
|
218
|
+
* `false` takes it away. Pass `false` when emptying the field is not
|
|
219
|
+
* something the API can honour — a username has no "unset" on the server,
|
|
220
|
+
* so offering the button would promise an edit that silently does nothing.
|
|
206
221
|
*/
|
|
207
222
|
clearable?: boolean;
|
|
208
223
|
/**
|
|
@@ -222,7 +237,10 @@ export interface ControlProps {
|
|
|
222
237
|
*/
|
|
223
238
|
upload?:
|
|
224
239
|
| boolean
|
|
225
|
-
| Pick<
|
|
240
|
+
| Pick<
|
|
241
|
+
ControlUploadProps,
|
|
242
|
+
"multi" | "accept" | "maxSize" | "bucket" | "image"
|
|
243
|
+
>;
|
|
226
244
|
}
|
|
227
245
|
|
|
228
246
|
/**
|
|
@@ -233,6 +251,7 @@ export interface ControlProps {
|
|
|
233
251
|
export function Control(props: ControlProps) {
|
|
234
252
|
const form = useFormState(props.input, ["error", "dirty"]);
|
|
235
253
|
const autoSaveEnabled = useFormFieldAutoSave();
|
|
254
|
+
const rowLayout = useFormFieldLayout() === "row";
|
|
236
255
|
const [value, setValue] = useFieldValue(props.input);
|
|
237
256
|
|
|
238
257
|
// Function-form `$control` reads other fields → re-render on any
|
|
@@ -376,6 +395,7 @@ export function Control(props: ControlProps) {
|
|
|
376
395
|
description={merged.description ?? props.description}
|
|
377
396
|
segmented={merged.segmented}
|
|
378
397
|
combobox={merged.combobox}
|
|
398
|
+
searchable={merged.searchable}
|
|
379
399
|
items={items as never}
|
|
380
400
|
icon={resolveIcon(merged.icon)}
|
|
381
401
|
disabled={merged.disabled}
|
|
@@ -481,6 +501,7 @@ export function Control(props: ControlProps) {
|
|
|
481
501
|
id: meta.id,
|
|
482
502
|
error: meta.error,
|
|
483
503
|
description: merged.description ?? meta.description,
|
|
504
|
+
required: meta.required,
|
|
484
505
|
})}
|
|
485
506
|
id={meta.id}
|
|
486
507
|
name={props.input.props.name}
|
|
@@ -505,7 +526,7 @@ export function Control(props: ControlProps) {
|
|
|
505
526
|
if (isPassword) {
|
|
506
527
|
return wrapWithSlots(
|
|
507
528
|
merged,
|
|
508
|
-
<
|
|
529
|
+
<ControlPassword
|
|
509
530
|
id={meta.id}
|
|
510
531
|
name={props.input.props.name}
|
|
511
532
|
label={merged.label ?? meta.label}
|
|
@@ -553,7 +574,9 @@ export function Control(props: ControlProps) {
|
|
|
553
574
|
const showSave = autoSaveEnabled && !!form.dirty && !merged.disabled;
|
|
554
575
|
const isNullable =
|
|
555
576
|
!meta.required && value != null && value !== "" && !merged.disabled;
|
|
556
|
-
|
|
577
|
+
// `clearable !== false`, not `clearable === true`: an optional text field
|
|
578
|
+
// offers the button by default and a caller opts *out* of it. See the prop.
|
|
579
|
+
const showClear = !showSave && isNullable && merged.clearable !== false;
|
|
557
580
|
// Reserve a fixed right gutter for any editable field so the tick/clear
|
|
558
581
|
// can swap in without nudging the input width.
|
|
559
582
|
const reserveGutter = !merged.disabled;
|
|
@@ -577,6 +600,7 @@ export function Control(props: ControlProps) {
|
|
|
577
600
|
id: meta.id,
|
|
578
601
|
error: meta.error,
|
|
579
602
|
description: merged.description ?? meta.description,
|
|
603
|
+
required: meta.required,
|
|
580
604
|
})}
|
|
581
605
|
id={meta.id}
|
|
582
606
|
name={props.input.props.name}
|
|
@@ -589,12 +613,22 @@ export function Control(props: ControlProps) {
|
|
|
589
613
|
minLength={meta.constraints.minLength}
|
|
590
614
|
maxLength={meta.constraints.maxLength}
|
|
591
615
|
pattern={meta.constraints.pattern}
|
|
592
|
-
|
|
616
|
+
// `cn`, not a plain join: the settings width below has to be
|
|
617
|
+
// overridable by the caller, and only tailwind-merge can decide
|
|
618
|
+
// that `sm:w-96` beats `sm:w-64` rather than both landing on the
|
|
619
|
+
// element. Order is precedence — later wins.
|
|
620
|
+
className={cn(
|
|
621
|
+
// Row layout is the settings-card shape, whose right-hand cell is
|
|
622
|
+
// an `auto` grid column: `w-full` there resolves against the
|
|
623
|
+
// input's own intrinsic size (~172px), so every card would get a
|
|
624
|
+
// slightly different control column. 256px is the width every
|
|
625
|
+
// hand-written `SettingsRow` already passes; encoded once here.
|
|
626
|
+
// Below `sm` the row stacks, and `w-full` from `<Input>` is right.
|
|
627
|
+
rowLayout && "sm:w-64",
|
|
593
628
|
merged.inputProps?.className,
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
.join(" ")}
|
|
629
|
+
Icon && "pl-9",
|
|
630
|
+
reserveGutter && "pr-9",
|
|
631
|
+
)}
|
|
598
632
|
onChange={(e) => setValue(e.target.value)}
|
|
599
633
|
/>
|
|
600
634
|
{showSave && (
|
|
@@ -667,69 +701,3 @@ const wrapWithSlots = (
|
|
|
667
701
|
</div>
|
|
668
702
|
);
|
|
669
703
|
};
|
|
670
|
-
|
|
671
|
-
interface PasswordControlProps {
|
|
672
|
-
id?: string;
|
|
673
|
-
name?: string;
|
|
674
|
-
label?: string;
|
|
675
|
-
description?: string;
|
|
676
|
-
error?: string;
|
|
677
|
-
required?: boolean;
|
|
678
|
-
disabled?: boolean;
|
|
679
|
-
autoComplete?: string;
|
|
680
|
-
autoFocus?: boolean;
|
|
681
|
-
inputProps?: HTMLAttributes<HTMLElement>;
|
|
682
|
-
icon?: IconComponent;
|
|
683
|
-
value: string;
|
|
684
|
-
onChange: (v: string) => void;
|
|
685
|
-
}
|
|
686
|
-
|
|
687
|
-
function PasswordControl(props: PasswordControlProps) {
|
|
688
|
-
const [reveal, setReveal] = useState(false);
|
|
689
|
-
const Icon = props.icon;
|
|
690
|
-
return (
|
|
691
|
-
<FormField
|
|
692
|
-
id={props.id}
|
|
693
|
-
label={props.label}
|
|
694
|
-
description={props.description}
|
|
695
|
-
error={props.error}
|
|
696
|
-
required={props.required}
|
|
697
|
-
>
|
|
698
|
-
<div className="relative">
|
|
699
|
-
{Icon && (
|
|
700
|
-
<Icon className="text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2 pointer-events-none" />
|
|
701
|
-
)}
|
|
702
|
-
<Input
|
|
703
|
-
{...props.inputProps}
|
|
704
|
-
{...formFieldAriaProps({
|
|
705
|
-
id: props.id,
|
|
706
|
-
error: props.error,
|
|
707
|
-
description: props.description,
|
|
708
|
-
})}
|
|
709
|
-
id={props.id}
|
|
710
|
-
name={props.name}
|
|
711
|
-
type={reveal ? "text" : "password"}
|
|
712
|
-
autoComplete={props.autoComplete ?? "current-password"}
|
|
713
|
-
autoFocus={props.autoFocus}
|
|
714
|
-
disabled={props.disabled}
|
|
715
|
-
value={props.value}
|
|
716
|
-
onChange={(e) => props.onChange(e.target.value)}
|
|
717
|
-
className={[props.inputProps?.className, Icon ? "pr-9 pl-9" : "pr-9"]
|
|
718
|
-
.filter(Boolean)
|
|
719
|
-
.join(" ")}
|
|
720
|
-
/>
|
|
721
|
-
<Button
|
|
722
|
-
type="button"
|
|
723
|
-
variant="ghost"
|
|
724
|
-
size="icon"
|
|
725
|
-
disabled={props.disabled}
|
|
726
|
-
onClick={() => setReveal((r) => !r)}
|
|
727
|
-
aria-label={reveal ? "Hide password" : "Show password"}
|
|
728
|
-
className="text-muted-foreground hover:text-foreground absolute top-1/2 right-1 size-7 -translate-y-1/2"
|
|
729
|
-
>
|
|
730
|
-
{reveal ? <EyeOff className="size-4" /> : <Eye className="size-4" />}
|
|
731
|
-
</Button>
|
|
732
|
-
</div>
|
|
733
|
-
</FormField>
|
|
734
|
-
);
|
|
735
|
-
}
|
|
@@ -26,6 +26,17 @@ export function FormFieldLayoutProvider(props: {
|
|
|
26
26
|
);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
/**
|
|
30
|
+
* Read the ambient layout (see {@link FormFieldLayoutProvider}).
|
|
31
|
+
*
|
|
32
|
+
* `<FormField>` reads this itself, so a widget only needs the hook when it
|
|
33
|
+
* sizes or arranges something *around* its FormField — `<Control>` uses it to
|
|
34
|
+
* give text inputs the settings-row column width.
|
|
35
|
+
*/
|
|
36
|
+
export function useFormFieldLayout(): FormFieldLayout {
|
|
37
|
+
return useContext(FormFieldLayoutContext);
|
|
38
|
+
}
|
|
39
|
+
|
|
29
40
|
/**
|
|
30
41
|
* Ambient flag enabling the inline save (tick) affordance on text Controls.
|
|
31
42
|
* Set by `<AutoForm autoSave>`; standalone Controls never show the tick
|
|
@@ -51,6 +62,39 @@ export function useFormFieldAutoSave(): boolean {
|
|
|
51
62
|
return useContext(FormFieldAutoSaveContext);
|
|
52
63
|
}
|
|
53
64
|
|
|
65
|
+
/**
|
|
66
|
+
* Ambient control over the required marker (`*`). Defaults to showing it.
|
|
67
|
+
*
|
|
68
|
+
* `<AutoForm requiredMarker={false}>` turns it off for a form where nearly
|
|
69
|
+
* every field is required and the asterisks are noise rather than news.
|
|
70
|
+
*
|
|
71
|
+
* ⚠️ **This is a purely visual switch, and must stay one.** The marker is
|
|
72
|
+
* `aria-hidden`, so it never carried the information to assistive tech in the
|
|
73
|
+
* first place — `aria-required` on the input does, and it is set from the
|
|
74
|
+
* schema regardless of this flag. Hiding the marker must never be the reason a
|
|
75
|
+
* field stops announcing that it is required.
|
|
76
|
+
*/
|
|
77
|
+
const FormFieldRequiredMarkerContext = createContext<boolean>(true);
|
|
78
|
+
|
|
79
|
+
export function FormFieldRequiredMarkerProvider(props: {
|
|
80
|
+
value: boolean;
|
|
81
|
+
children: ReactNode;
|
|
82
|
+
}) {
|
|
83
|
+
return (
|
|
84
|
+
<FormFieldRequiredMarkerContext.Provider value={props.value}>
|
|
85
|
+
{props.children}
|
|
86
|
+
</FormFieldRequiredMarkerContext.Provider>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Read the ambient required-marker flag (see
|
|
92
|
+
* {@link FormFieldRequiredMarkerProvider}).
|
|
93
|
+
*/
|
|
94
|
+
export function useFormFieldRequiredMarker(): boolean {
|
|
95
|
+
return useContext(FormFieldRequiredMarkerContext);
|
|
96
|
+
}
|
|
97
|
+
|
|
54
98
|
/**
|
|
55
99
|
* Id of the error element a `<FormField id={id} error>` renders.
|
|
56
100
|
*/
|
|
@@ -83,12 +127,21 @@ export function formFieldAriaProps(props: {
|
|
|
83
127
|
id?: string;
|
|
84
128
|
error?: string;
|
|
85
129
|
description?: string;
|
|
86
|
-
|
|
130
|
+
required?: boolean;
|
|
131
|
+
}): {
|
|
132
|
+
"aria-invalid"?: true;
|
|
133
|
+
"aria-describedby"?: string;
|
|
134
|
+
"aria-required"?: true;
|
|
135
|
+
} {
|
|
87
136
|
return {
|
|
88
137
|
"aria-invalid": props.error ? true : undefined,
|
|
89
138
|
"aria-describedby":
|
|
90
139
|
formFieldErrorId(props.id, props.error) ??
|
|
91
140
|
formFieldDescriptionId(props.id, props.description, props.error),
|
|
141
|
+
// The visible marker is `aria-hidden`, so without this a required field
|
|
142
|
+
// announced nothing at all. It is read from the schema, never from the
|
|
143
|
+
// marker flag — see {@link FormFieldRequiredMarkerProvider}.
|
|
144
|
+
"aria-required": props.required ? true : undefined,
|
|
92
145
|
};
|
|
93
146
|
}
|
|
94
147
|
|
|
@@ -171,6 +224,10 @@ export interface FormFieldProps {
|
|
|
171
224
|
export function FormField(props: FormFieldProps) {
|
|
172
225
|
const ambient = useContext(FormFieldLayoutContext);
|
|
173
226
|
const layout = props.layout ?? ambient;
|
|
227
|
+
// Hook first, `&&` after: `props.required && useFormFieldRequiredMarker()`
|
|
228
|
+
// short-circuits, which would make this a conditional hook call.
|
|
229
|
+
const requiredMarker = useFormFieldRequiredMarker();
|
|
230
|
+
const showRequiredMarker = props.required && requiredMarker;
|
|
174
231
|
const invalidClasses = props.error
|
|
175
232
|
? "[&_input]:border-destructive [&_input]:focus-visible:ring-destructive/30 [&_textarea]:border-destructive [&_textarea]:focus-visible:ring-destructive/30 [&_[role=combobox]]:border-destructive"
|
|
176
233
|
: "";
|
|
@@ -209,7 +266,7 @@ export function FormField(props: FormFieldProps) {
|
|
|
209
266
|
{props.label && (
|
|
210
267
|
<Label htmlFor={props.id} className="font-medium">
|
|
211
268
|
{props.label}
|
|
212
|
-
{
|
|
269
|
+
{showRequiredMarker && (
|
|
213
270
|
<span className="text-destructive ml-0.5" aria-hidden>
|
|
214
271
|
*
|
|
215
272
|
</span>
|
|
@@ -247,7 +304,7 @@ export function FormField(props: FormFieldProps) {
|
|
|
247
304
|
{props.label && (
|
|
248
305
|
<Label htmlFor={props.id}>
|
|
249
306
|
{props.label}
|
|
250
|
-
{
|
|
307
|
+
{showRequiredMarker && (
|
|
251
308
|
<span className="text-destructive ml-0.5" aria-hidden>
|
|
252
309
|
*
|
|
253
310
|
</span>
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import {
|
|
2
|
+
FormField,
|
|
3
|
+
formFieldAriaProps,
|
|
4
|
+
} from "@alepha/ui/components/control-base/form-field";
|
|
5
|
+
import type { IconComponent } from "@alepha/ui/components/control-base/icon-hint";
|
|
6
|
+
import { Button } from "@alepha/ui/components/ui/button";
|
|
7
|
+
import { Input } from "@alepha/ui/components/ui/input";
|
|
8
|
+
import { Eye, EyeOff } from "lucide-react";
|
|
9
|
+
import { type HTMLAttributes, useState } from "react";
|
|
10
|
+
|
|
11
|
+
export interface ControlPasswordProps {
|
|
12
|
+
id?: string;
|
|
13
|
+
name?: string;
|
|
14
|
+
label?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
error?: string;
|
|
17
|
+
required?: boolean;
|
|
18
|
+
disabled?: boolean;
|
|
19
|
+
autoComplete?: string;
|
|
20
|
+
autoFocus?: boolean;
|
|
21
|
+
minLength?: number;
|
|
22
|
+
maxLength?: number;
|
|
23
|
+
inputProps?: HTMLAttributes<HTMLElement>;
|
|
24
|
+
icon?: IconComponent;
|
|
25
|
+
value: string;
|
|
26
|
+
onChange: (v: string) => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Masked password field with a reveal toggle.
|
|
31
|
+
*
|
|
32
|
+
* Lives outside `Control` so a hand-built form — a dialog that is not driven by
|
|
33
|
+
* a schema — gets the same field the schema path renders, rather than pairing a
|
|
34
|
+
* bare `<Input type="password">` with no way to check what was typed.
|
|
35
|
+
*/
|
|
36
|
+
export const ControlPassword = (props: ControlPasswordProps) => {
|
|
37
|
+
const [reveal, setReveal] = useState(false);
|
|
38
|
+
const Icon = props.icon;
|
|
39
|
+
return (
|
|
40
|
+
<FormField
|
|
41
|
+
id={props.id}
|
|
42
|
+
label={props.label}
|
|
43
|
+
description={props.description}
|
|
44
|
+
error={props.error}
|
|
45
|
+
required={props.required}
|
|
46
|
+
>
|
|
47
|
+
<div className="relative">
|
|
48
|
+
{Icon && (
|
|
49
|
+
<Icon className="text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2 pointer-events-none" />
|
|
50
|
+
)}
|
|
51
|
+
<Input
|
|
52
|
+
{...props.inputProps}
|
|
53
|
+
{...formFieldAriaProps({
|
|
54
|
+
id: props.id,
|
|
55
|
+
error: props.error,
|
|
56
|
+
description: props.description,
|
|
57
|
+
})}
|
|
58
|
+
id={props.id}
|
|
59
|
+
name={props.name}
|
|
60
|
+
type={reveal ? "text" : "password"}
|
|
61
|
+
autoComplete={props.autoComplete ?? "current-password"}
|
|
62
|
+
autoFocus={props.autoFocus}
|
|
63
|
+
disabled={props.disabled}
|
|
64
|
+
required={props.required}
|
|
65
|
+
minLength={props.minLength}
|
|
66
|
+
maxLength={props.maxLength}
|
|
67
|
+
value={props.value}
|
|
68
|
+
onChange={(e) => props.onChange(e.target.value)}
|
|
69
|
+
className={[props.inputProps?.className, Icon ? "pr-9 pl-9" : "pr-9"]
|
|
70
|
+
.filter(Boolean)
|
|
71
|
+
.join(" ")}
|
|
72
|
+
/>
|
|
73
|
+
<Button
|
|
74
|
+
type="button"
|
|
75
|
+
variant="ghost"
|
|
76
|
+
size="icon"
|
|
77
|
+
disabled={props.disabled}
|
|
78
|
+
onClick={() => setReveal((r) => !r)}
|
|
79
|
+
aria-label={reveal ? "Hide password" : "Show password"}
|
|
80
|
+
className="text-muted-foreground hover:text-foreground absolute top-1/2 right-1 size-7 -translate-y-1/2"
|
|
81
|
+
>
|
|
82
|
+
{reveal ? <EyeOff className="size-4" /> : <Eye className="size-4" />}
|
|
83
|
+
</Button>
|
|
84
|
+
</div>
|
|
85
|
+
</FormField>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { render } from "@testing-library/react";
|
|
2
|
+
import { Alepha, z } from "alepha";
|
|
3
|
+
import { AlephaLogger } from "alepha/logger";
|
|
4
|
+
import { AlephaContext } from "alepha/react";
|
|
5
|
+
import { useForm } from "alepha/react/form";
|
|
6
|
+
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
7
|
+
import type { ReactNode } from "react";
|
|
8
|
+
import { describe, expect, it } from "vitest";
|
|
9
|
+
import { ControlSelect } from "../control-select.tsx";
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* `ControlSelect` picks between a native `Select` and a `Combobox` on option
|
|
13
|
+
* count (>20 → combobox). The two paths disagreed about what the `clearable`
|
|
14
|
+
* row's label *is*: the Select path made it a genuine selected value, the
|
|
15
|
+
* combobox passed it through as a placeholder and muted the trigger. So the
|
|
16
|
+
* same filter, meaning the same thing, changed colour the day its option list
|
|
17
|
+
* grew past 20 — which is exactly what happened to the quests board, where
|
|
18
|
+
* "All status" and "All areas" read as set and "All tags" read as unset.
|
|
19
|
+
*
|
|
20
|
+
* These assert on the render path rather than the colour of one of them: what
|
|
21
|
+
* matters is that the two agree, so a future change to either has to move both.
|
|
22
|
+
*/
|
|
23
|
+
describe("ControlSelect clear label", () => {
|
|
24
|
+
const mount = (alepha: Alepha, ui: ReactNode) =>
|
|
25
|
+
render(
|
|
26
|
+
<AlephaContext.Provider value={alepha}>{ui}</AlephaContext.Provider>,
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
const start = async () => {
|
|
30
|
+
const alepha = Alepha.create().with(AlephaLogger).with(AlephaReactI18n);
|
|
31
|
+
await alepha.start();
|
|
32
|
+
return alepha;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const items = (count: number) =>
|
|
36
|
+
Array.from({ length: count }, (_, i) => `tag-${i}`);
|
|
37
|
+
|
|
38
|
+
const Probe = (props: { count: number; clearable?: boolean }) => {
|
|
39
|
+
const form = useForm({
|
|
40
|
+
schema: z.object({ tag: z.text().optional() as never }),
|
|
41
|
+
handler: () => {},
|
|
42
|
+
});
|
|
43
|
+
return (
|
|
44
|
+
<ControlSelect
|
|
45
|
+
input={form.input.tag}
|
|
46
|
+
label="Tag"
|
|
47
|
+
clearable={props.clearable}
|
|
48
|
+
clearLabel="All tags"
|
|
49
|
+
items={items(props.count)}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Both paths render their trigger as the field's only `combobox` role — the
|
|
56
|
+
* shadcn `SelectTrigger` and the Base UI `ComboboxTrigger` alike — so one
|
|
57
|
+
* query reaches whichever one the option count selected.
|
|
58
|
+
*/
|
|
59
|
+
const trigger = (ui: ReturnType<typeof render>) =>
|
|
60
|
+
ui.getByRole("combobox") as HTMLElement;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* "Reads as greyed", asked in the one way that covers both paths. The two
|
|
64
|
+
* arrive there by different mechanisms and no stylesheet runs under jsdom to
|
|
65
|
+
* flatten them: the combobox trigger takes `text-muted-foreground` outright,
|
|
66
|
+
* while `SelectTrigger` always carries the conditional
|
|
67
|
+
* `data-placeholder:text-muted-foreground` and only greys once Base UI
|
|
68
|
+
* stamps `data-placeholder` on it — which it does exactly when `SelectValue`
|
|
69
|
+
* falls back to its placeholder instead of rendering a chosen value.
|
|
70
|
+
*/
|
|
71
|
+
const readsAsPlaceholder = (el: HTMLElement) =>
|
|
72
|
+
el.hasAttribute("data-placeholder") ||
|
|
73
|
+
el.className.split(/\s+/).includes("text-muted-foreground");
|
|
74
|
+
|
|
75
|
+
it("renders the clear label as a value on the Select path", async () => {
|
|
76
|
+
const alepha = await start();
|
|
77
|
+
const ui = mount(alepha, <Probe count={5} clearable />);
|
|
78
|
+
|
|
79
|
+
expect(trigger(ui).textContent).toContain("All tags");
|
|
80
|
+
expect(readsAsPlaceholder(trigger(ui))).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("renders the clear label the same way past the 20-option threshold", async () => {
|
|
84
|
+
const alepha = await start();
|
|
85
|
+
const ui = mount(alepha, <Probe count={25} clearable />);
|
|
86
|
+
|
|
87
|
+
expect(trigger(ui).textContent).toContain("All tags");
|
|
88
|
+
expect(readsAsPlaceholder(trigger(ui))).toBe(false);
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("still reads as a placeholder when there is no clear row", async () => {
|
|
92
|
+
const alepha = await start();
|
|
93
|
+
|
|
94
|
+
const short = mount(alepha, <Probe count={5} />);
|
|
95
|
+
expect(readsAsPlaceholder(trigger(short))).toBe(true);
|
|
96
|
+
short.unmount();
|
|
97
|
+
|
|
98
|
+
const long = mount(alepha, <Probe count={25} />);
|
|
99
|
+
expect(readsAsPlaceholder(trigger(long))).toBe(true);
|
|
100
|
+
});
|
|
101
|
+
});
|