@alepha/ui 0.25.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +136 -2
- package/dist/components/account/account-connections.d.ts +16 -0
- package/dist/components/account/account-connections.d.ts.map +1 -0
- package/dist/components/account/account-connections.js +76 -0
- package/dist/components/account/account-connections.js.map +1 -0
- package/dist/components/account/account-delete-dialog.d.ts +44 -0
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -0
- package/dist/components/account/account-delete-dialog.js +126 -0
- package/dist/components/account/account-delete-dialog.js.map +1 -0
- package/dist/components/account/account-header.d.ts +33 -0
- package/dist/components/account/account-header.d.ts.map +1 -0
- package/dist/components/account/account-header.js +41 -0
- package/dist/components/account/account-header.js.map +1 -0
- package/dist/components/account/account-keys.d.ts +23 -0
- package/dist/components/account/account-keys.d.ts.map +1 -0
- package/dist/components/account/account-keys.js +168 -0
- package/dist/components/account/account-keys.js.map +1 -0
- package/dist/components/account/account-layout.d.ts +32 -0
- package/dist/components/account/account-layout.d.ts.map +1 -0
- package/dist/components/account/account-layout.js +53 -0
- package/dist/components/account/account-layout.js.map +1 -0
- package/dist/components/account/account-password-dialog.d.ts +31 -0
- package/dist/components/account/account-password-dialog.d.ts.map +1 -0
- package/dist/components/account/account-password-dialog.js +120 -0
- package/dist/components/account/account-password-dialog.js.map +1 -0
- package/dist/components/account/account-profile.d.ts +27 -0
- package/dist/components/account/account-profile.d.ts.map +1 -0
- package/dist/components/account/account-profile.js +217 -0
- package/dist/components/account/account-profile.js.map +1 -0
- package/dist/components/account/account-router-options.d.ts +77 -0
- package/dist/components/account/account-router-options.d.ts.map +1 -0
- package/dist/components/account/account-router-options.js +22 -0
- package/dist/components/account/account-router-options.js.map +1 -0
- package/dist/components/account/account-router-page.d.ts +49 -0
- package/dist/components/account/account-router-page.d.ts.map +1 -0
- package/dist/components/account/account-router-page.js +61 -0
- package/dist/components/account/account-router-page.js.map +1 -0
- package/dist/components/account/account-router.d.ts +214 -0
- package/dist/components/account/account-router.d.ts.map +1 -0
- package/dist/components/account/account-router.js +216 -0
- package/dist/components/account/account-router.js.map +1 -0
- package/dist/components/account/account-security.d.ts +22 -0
- package/dist/components/account/account-security.d.ts.map +1 -0
- package/dist/components/account/account-security.js +107 -0
- package/dist/components/account/account-security.js.map +1 -0
- package/dist/components/account/account-sessions.d.ts +17 -0
- package/dist/components/account/account-sessions.d.ts.map +1 -0
- package/dist/components/account/account-sessions.js +108 -0
- package/dist/components/account/account-sessions.js.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts +39 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.js +40 -0
- package/dist/components/action-error-toaster/action-error-toaster.js.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts +16 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.js +117 -0
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -0
- package/dist/components/admin/admin-analytics-results.d.ts +15 -0
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-results.js +56 -0
- package/dist/components/admin/admin-analytics-results.js.map +1 -0
- package/dist/components/admin/admin-analytics.d.ts +9 -0
- package/dist/components/admin/admin-analytics.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics.js +66 -0
- package/dist/components/admin/admin-analytics.js.map +1 -0
- package/dist/components/admin/admin-audits.d.ts +4 -0
- package/dist/components/admin/admin-audits.d.ts.map +1 -0
- package/dist/components/admin/admin-audits.js +173 -0
- package/dist/components/admin/admin-audits.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +4 -0
- package/dist/components/admin/admin-files.d.ts.map +1 -0
- package/dist/components/admin/admin-files.js +237 -0
- package/dist/components/admin/admin-files.js.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +11 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.js +200 -0
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts +9 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.js +26 -0
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -0
- package/dist/components/admin/admin-jobs.d.ts +4 -0
- package/dist/components/admin/admin-jobs.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs.js +248 -0
- package/dist/components/admin/admin-jobs.js.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts +15 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.js +66 -0
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -0
- package/dist/components/admin/admin-keys.d.ts +4 -0
- package/dist/components/admin/admin-keys.d.ts.map +1 -0
- package/dist/components/admin/admin-keys.js +161 -0
- package/dist/components/admin/admin-keys.js.map +1 -0
- package/dist/components/admin/admin-layout.d.ts +33 -0
- package/dist/components/admin/admin-layout.d.ts.map +1 -0
- package/dist/components/admin/admin-layout.js +101 -0
- package/dist/components/admin/admin-layout.js.map +1 -0
- package/dist/components/admin/admin-notifications.d.ts +4 -0
- package/dist/components/admin/admin-notifications.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications.js +99 -0
- package/dist/components/admin/admin-notifications.js.map +1 -0
- package/dist/components/admin/admin-page.d.ts +16 -0
- package/dist/components/admin/admin-page.d.ts.map +1 -0
- package/dist/components/admin/admin-page.js +15 -0
- package/dist/components/admin/admin-page.js.map +1 -0
- package/dist/components/admin/admin-parameters.d.ts +26 -0
- package/dist/components/admin/admin-parameters.d.ts.map +1 -0
- package/dist/components/admin/admin-parameters.js +560 -0
- package/dist/components/admin/admin-parameters.js.map +1 -0
- package/dist/components/admin/admin-payments.d.ts +4 -0
- package/dist/components/admin/admin-payments.d.ts.map +1 -0
- package/dist/components/admin/admin-payments.js +72 -0
- package/dist/components/admin/admin-payments.js.map +1 -0
- package/dist/components/admin/admin-router-options.d.ts +135 -0
- package/dist/components/admin/admin-router-options.d.ts.map +1 -0
- package/dist/components/admin/admin-router-options.js +29 -0
- package/dist/components/admin/admin-router-options.js.map +1 -0
- package/dist/components/admin/admin-router-page.d.ts +54 -0
- package/dist/components/admin/admin-router-page.d.ts.map +1 -0
- package/dist/components/admin/admin-router-page.js +66 -0
- package/dist/components/admin/admin-router-page.js.map +1 -0
- package/dist/components/admin/admin-router.d.ts +169 -0
- package/dist/components/admin/admin-router.d.ts.map +1 -0
- package/dist/components/admin/admin-router.js +346 -0
- package/dist/components/admin/admin-router.js.map +1 -0
- package/dist/components/admin/admin-sessions.d.ts +4 -0
- package/dist/components/admin/admin-sessions.d.ts.map +1 -0
- package/dist/components/admin/admin-sessions.js +124 -0
- package/dist/components/admin/admin-sessions.js.map +1 -0
- package/dist/components/admin/admin-user-cell.d.ts +37 -0
- package/dist/components/admin/admin-user-cell.d.ts.map +1 -0
- package/dist/components/admin/admin-user-cell.js +35 -0
- package/dist/components/admin/admin-user-cell.js.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js +55 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +14 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js +162 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts +26 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js +60 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js +47 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts +10 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.js +13 -0
- package/dist/components/admin/admin-user-detail-password-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts +56 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js +73 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts +18 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js +21 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts +20 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.js +70 -0
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +25 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js +64 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail.d.ts +39 -0
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail.js +386 -0
- package/dist/components/admin/admin-user-detail.js.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts +23 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.js +77 -0
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -0
- package/dist/components/admin/admin-users-status-filter.d.ts +13 -0
- package/dist/components/admin/admin-users-status-filter.d.ts.map +1 -0
- package/dist/components/admin/admin-users-status-filter.js +41 -0
- package/dist/components/admin/admin-users-status-filter.js.map +1 -0
- package/dist/components/admin/admin-users.d.ts +16 -0
- package/dist/components/admin/admin-users.d.ts.map +1 -0
- package/dist/components/admin/admin-users.js +325 -0
- package/dist/components/admin/admin-users.js.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +11 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js +190 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +9 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.js +153 -0
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts +12 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.js +30 -0
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -0
- package/dist/components/admin/admin-workflows.d.ts +4 -0
- package/dist/components/admin/admin-workflows.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows.js +145 -0
- package/dist/components/admin/admin-workflows.js.map +1 -0
- package/dist/components/admin/diff-lines.d.ts +13 -0
- package/dist/components/admin/diff-lines.d.ts.map +1 -0
- package/dist/components/admin/diff-lines.js +57 -0
- package/dist/components/admin/diff-lines.js.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts +36 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.js +58 -0
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -0
- package/dist/components/admin/parameter-history-item.d.ts +17 -0
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -0
- package/dist/components/admin/parameter-history-item.js +177 -0
- package/dist/components/admin/parameter-history-item.js.map +1 -0
- package/dist/components/admin/parameter-json-dialog.d.ts +13 -0
- package/dist/components/admin/parameter-json-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-json-dialog.js +63 -0
- package/dist/components/admin/parameter-json-dialog.js.map +1 -0
- package/dist/components/admin/parameter-save-dialog.d.ts +26 -0
- package/dist/components/admin/parameter-save-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-save-dialog.js +74 -0
- package/dist/components/admin/parameter-save-dialog.js.map +1 -0
- package/dist/components/admin/use-confirmed-action.d.ts +53 -0
- package/dist/components/admin/use-confirmed-action.d.ts.map +1 -0
- package/dist/components/admin/use-confirmed-action.js +50 -0
- package/dist/components/admin/use-confirmed-action.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +218 -0
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table.js +565 -0
- package/dist/components/alepha-table/alepha-table.js.map +1 -0
- package/dist/components/alepha-table/use-table-selection.d.ts +34 -0
- package/dist/components/alepha-table/use-table-selection.d.ts.map +1 -0
- package/dist/components/alepha-table/use-table-selection.js +45 -0
- package/dist/components/alepha-table/use-table-selection.js.map +1 -0
- package/dist/components/app-actions/app-actions.d.ts +74 -0
- package/dist/components/app-actions/app-actions.d.ts.map +1 -0
- package/dist/components/app-actions/app-actions.js +77 -0
- package/dist/components/app-actions/app-actions.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +135 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +276 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/auth/auth-login.d.ts +40 -0
- package/dist/components/auth/auth-login.d.ts.map +1 -0
- package/dist/components/auth/auth-login.js +237 -0
- package/dist/components/auth/auth-login.js.map +1 -0
- package/dist/components/auth/auth-register.d.ts +35 -0
- package/dist/components/auth/auth-register.d.ts.map +1 -0
- package/dist/components/auth/auth-register.js +478 -0
- package/dist/components/auth/auth-register.js.map +1 -0
- package/dist/components/auth/auth-reset-password.d.ts +21 -0
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -0
- package/dist/components/auth/auth-reset-password.js +283 -0
- package/dist/components/auth/auth-reset-password.js.map +1 -0
- package/dist/components/auth/auth-router.d.ts +245 -0
- package/dist/components/auth/auth-router.d.ts.map +1 -0
- package/dist/components/auth/auth-router.js +117 -0
- package/dist/components/auth/auth-router.js.map +1 -0
- package/dist/components/auth/auth-verify-email.d.ts +19 -0
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -0
- package/dist/components/auth/auth-verify-email.js +124 -0
- package/dist/components/auth/auth-verify-email.js.map +1 -0
- package/dist/components/auth/provider-labels.d.ts +9 -0
- package/dist/components/auth/provider-labels.d.ts.map +1 -0
- package/dist/components/auth/provider-labels.js +20 -0
- package/dist/components/auth/provider-labels.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts +219 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -0
- package/dist/components/auto-form/auto-form.js +412 -0
- package/dist/components/auto-form/auto-form.js.map +1 -0
- package/dist/components/brand-icon/brand-icon.d.ts +18 -0
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -0
- package/dist/components/brand-icon/brand-icon.js +84 -0
- package/dist/components/brand-icon/brand-icon.js.map +1 -0
- package/dist/components/button-dark/button-dark.d.ts +25 -0
- package/dist/components/button-dark/button-dark.d.ts.map +1 -0
- package/dist/components/button-dark/button-dark.js +44 -0
- package/dist/components/button-dark/button-dark.js.map +1 -0
- package/dist/components/button-language/button-language.d.ts +24 -0
- package/dist/components/button-language/button-language.d.ts.map +1 -0
- package/dist/components/button-language/button-language.js +50 -0
- package/dist/components/button-language/button-language.js.map +1 -0
- package/dist/components/button-theme/button-theme.d.ts +33 -0
- package/dist/components/button-theme/button-theme.d.ts.map +1 -0
- package/dist/components/button-theme/button-theme.js +90 -0
- package/dist/components/button-theme/button-theme.js.map +1 -0
- package/dist/components/button-user/button-user.d.ts +147 -0
- package/dist/components/button-user/button-user.d.ts.map +1 -0
- package/dist/components/button-user/button-user.js +147 -0
- package/dist/components/button-user/button-user.js.map +1 -0
- package/dist/components/captcha/turnstile-widget.d.ts +59 -0
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -0
- package/dist/components/captcha/turnstile-widget.js +97 -0
- package/dist/components/captcha/turnstile-widget.js.map +1 -0
- package/dist/components/control/control.d.ts +200 -0
- package/dist/components/control/control.d.ts.map +1 -0
- package/dist/components/control/control.js +300 -0
- package/dist/components/control/control.js.map +1 -0
- package/dist/components/control-array/control-array.d.ts +77 -0
- package/dist/components/control-array/control-array.d.ts.map +1 -0
- package/dist/components/control-array/control-array.js +444 -0
- package/dist/components/control-array/control-array.js.map +1 -0
- package/dist/components/control-base/field-i18n.d.ts +30 -0
- package/dist/components/control-base/field-i18n.d.ts.map +1 -0
- package/dist/components/control-base/field-i18n.js +27 -0
- package/dist/components/control-base/field-i18n.js.map +1 -0
- package/dist/components/control-base/form-field.d.ts +128 -0
- package/dist/components/control-base/form-field.d.ts.map +1 -0
- package/dist/components/control-base/form-field.js +208 -0
- package/dist/components/control-base/form-field.js.map +1 -0
- package/dist/components/control-base/grid.d.ts +18 -0
- package/dist/components/control-base/grid.d.ts.map +1 -0
- package/dist/components/control-base/grid.js +46 -0
- package/dist/components/control-base/grid.js.map +1 -0
- package/dist/components/control-base/icon-hint.d.ts +9 -0
- package/dist/components/control-base/icon-hint.d.ts.map +1 -0
- package/dist/components/control-base/icon-hint.js +35 -0
- package/dist/components/control-base/icon-hint.js.map +1 -0
- package/dist/components/control-date/control-date.d.ts +34 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -0
- package/dist/components/control-date/control-date.js +111 -0
- package/dist/components/control-date/control-date.js.map +1 -0
- package/dist/components/control-number/control-number.d.ts +38 -0
- package/dist/components/control-number/control-number.d.ts.map +1 -0
- package/dist/components/control-number/control-number.js +77 -0
- package/dist/components/control-number/control-number.js.map +1 -0
- package/dist/components/control-object/control-object.d.ts +45 -0
- package/dist/components/control-object/control-object.d.ts.map +1 -0
- package/dist/components/control-object/control-object.js +110 -0
- package/dist/components/control-object/control-object.js.map +1 -0
- package/dist/components/control-password/control-password.d.ts +28 -0
- package/dist/components/control-password/control-password.d.ts.map +1 -0
- package/dist/components/control-password/control-password.js +65 -0
- package/dist/components/control-password/control-password.js.map +1 -0
- package/dist/components/control-select/control-select.d.ts +128 -0
- package/dist/components/control-select/control-select.d.ts.map +1 -0
- package/dist/components/control-select/control-select.js +363 -0
- package/dist/components/control-select/control-select.js.map +1 -0
- package/dist/components/control-upload/control-upload.d.ts +67 -0
- package/dist/components/control-upload/control-upload.d.ts.map +1 -0
- package/dist/components/control-upload/control-upload.js +294 -0
- package/dist/components/control-upload/control-upload.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts +31 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -0
- package/dist/components/file-image/file-image.js +27 -0
- package/dist/components/file-image/file-image.js.map +1 -0
- package/dist/components/language-toggle/language-toggle.d.ts +8 -0
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -0
- package/dist/components/language-toggle/language-toggle.js +49 -0
- package/dist/components/language-toggle/language-toggle.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.css +114 -0
- package/dist/components/markdown-view/markdown-view.d.ts +21 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -0
- package/dist/components/markdown-view/markdown-view.js +104 -0
- package/dist/components/markdown-view/markdown-view.js.map +1 -0
- package/dist/components/nav-shell/nav-page.d.ts +24 -0
- package/dist/components/nav-shell/nav-page.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-page.js +28 -0
- package/dist/components/nav-shell/nav-page.js.map +1 -0
- package/dist/components/nav-shell/nav-shell.d.ts +26 -0
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-shell.js +53 -0
- package/dist/components/nav-shell/nav-shell.js.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts +65 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.js +87 -0
- package/dist/components/nav-shell/nav-tree-util.js.map +1 -0
- package/dist/components/nav-shell/spotlight.d.ts +37 -0
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -0
- package/dist/components/nav-shell/spotlight.js +102 -0
- package/dist/components/nav-shell/spotlight.js.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts +24 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js +36 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts +45 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.js +60 -0
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts +21 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.js +48 -0
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts +35 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -0
- package/dist/components/settings/settings-danger-section.js +42 -0
- package/dist/components/settings/settings-danger-section.js.map +1 -0
- package/dist/components/settings/settings-heading.d.ts +36 -0
- package/dist/components/settings/settings-heading.d.ts.map +1 -0
- package/dist/components/settings/settings-heading.js +39 -0
- package/dist/components/settings/settings-heading.js.map +1 -0
- package/dist/components/settings/settings-layout.d.ts +81 -0
- package/dist/components/settings/settings-layout.d.ts.map +1 -0
- package/dist/components/settings/settings-layout.js +56 -0
- package/dist/components/settings/settings-layout.js.map +1 -0
- package/dist/components/settings/settings-nav.d.ts +85 -0
- package/dist/components/settings/settings-nav.d.ts.map +1 -0
- package/dist/components/settings/settings-nav.js +91 -0
- package/dist/components/settings/settings-nav.js.map +1 -0
- package/dist/components/settings/settings-row.d.ts +45 -0
- package/dist/components/settings/settings-row.d.ts.map +1 -0
- package/dist/components/settings/settings-row.js +44 -0
- package/dist/components/settings/settings-row.js.map +1 -0
- package/dist/components/settings/settings-section.d.ts +36 -0
- package/dist/components/settings/settings-section.d.ts.map +1 -0
- package/dist/components/settings/settings-section.js +36 -0
- package/dist/components/settings/settings-section.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +55 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +96 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +44 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +15 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +52 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +8 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +31 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +73 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +43 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +18 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +60 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +119 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +12 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +134 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +45 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +151 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +22 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +26 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +25 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +164 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.d.ts +20 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +89 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +134 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +93 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.d.ts.map +1 -0
- package/dist/components/ui/direction.js +3 -0
- package/dist/components/ui/drawer.d.ts +17 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +125 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +138 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +61 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +38 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +19 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +80 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +49 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +16 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +15 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +137 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +84 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +18 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +87 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +56 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +8 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +46 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +29 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +30 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +38 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +46 -0
- package/dist/components/ui/segmented.d.ts.map +1 -0
- package/dist/components/ui/segmented.js +119 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +99 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +17 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +15 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +90 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +64 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +388 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +14 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +35 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +33 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +17 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +68 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +47 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +54 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +38 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/use-dialog/use-dialog.d.ts +61 -0
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -0
- package/dist/components/use-dialog/use-dialog.js +139 -0
- package/dist/components/use-dialog/use-dialog.js.map +1 -0
- package/dist/components/use-toast/use-toast.d.ts +37 -0
- package/dist/components/use-toast/use-toast.d.ts.map +1 -0
- package/dist/components/use-toast/use-toast.js +32 -0
- package/dist/components/use-toast/use-toast.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +20 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/i18n-fr.d.ts +46 -0
- package/dist/lib/i18n-fr.d.ts.map +1 -0
- package/dist/lib/i18n-fr.js +505 -0
- package/dist/lib/i18n-fr.js.map +1 -0
- package/dist/lib/resize-image.d.ts +50 -0
- package/dist/lib/resize-image.d.ts.map +1 -0
- package/dist/lib/resize-image.js +68 -0
- package/dist/lib/resize-image.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +254 -0
- package/package.json +46 -15
- package/src/components/account/__tests__/account-router.spec.ts +201 -0
- package/src/components/account/account-connections.tsx +111 -0
- package/src/components/account/account-delete-dialog.tsx +184 -0
- package/src/components/account/account-header.tsx +57 -0
- package/src/components/account/account-keys.tsx +221 -0
- package/src/components/account/account-layout.tsx +66 -0
- package/src/components/account/account-password-dialog.tsx +152 -0
- package/src/components/account/account-profile.tsx +342 -0
- package/src/components/account/account-router-options.tsx +88 -0
- package/src/components/account/account-router-page.tsx +69 -0
- package/src/components/account/account-router.tsx +233 -0
- package/src/components/account/account-security.tsx +150 -0
- package/src/components/account/account-sessions.tsx +140 -0
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +62 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +82 -0
- package/src/components/admin/__tests__/admin-router-page.spec.ts +54 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +208 -0
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +99 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +29 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +149 -0
- package/src/components/admin/admin-analytics-results.tsx +95 -0
- package/src/components/admin/admin-analytics.tsx +104 -0
- package/src/components/admin/admin-audits.tsx +12 -15
- package/src/components/admin/admin-files.tsx +10 -18
- package/src/components/admin/admin-jobs-executions-panel.tsx +2 -1
- package/src/components/admin/admin-jobs.tsx +3 -1
- package/src/components/admin/admin-keys-token-dialog.tsx +123 -0
- package/src/components/admin/admin-keys.tsx +54 -3
- package/src/components/admin/admin-layout.tsx +107 -0
- package/src/components/admin/admin-payments.tsx +4 -5
- package/src/components/admin/admin-router-options.tsx +150 -0
- package/src/components/admin/admin-router-page.tsx +74 -0
- package/src/components/admin/admin-router.tsx +379 -0
- package/src/components/admin/admin-sessions.tsx +2 -16
- package/src/components/admin/admin-user-cell.tsx +70 -0
- package/src/components/admin/admin-user-detail-overview-tab.tsx +28 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +146 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +147 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -1
- package/src/components/admin/admin-user-detail.tsx +76 -32
- package/src/components/admin/admin-users-status-filter.tsx +2 -0
- package/src/components/admin/admin-workflows-execution-sheet.tsx +277 -0
- package/src/components/admin/admin-workflows-executions-panel.tsx +170 -0
- package/src/components/admin/admin-workflows-status-badge.tsx +40 -0
- package/src/components/admin/admin-workflows.tsx +207 -0
- package/src/components/alepha-table/alepha-table.tsx +91 -19
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +79 -0
- package/src/components/app-actions/app-actions.tsx +118 -0
- package/src/components/app-shell/app-shell.tsx +122 -0
- package/src/components/auth/auth-register.tsx +55 -17
- package/src/components/auth/auth-reset-password.tsx +81 -8
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +237 -0
- package/src/components/auto-form/auto-form.tsx +113 -27
- package/src/components/button-user/button-user.tsx +121 -5
- package/src/components/control/control.tsx +47 -79
- package/src/components/control-base/form-field.tsx +60 -3
- package/src/components/control-password/control-password.tsx +87 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +101 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +142 -0
- package/src/components/control-select/control-select.tsx +78 -111
- package/src/components/control-upload/control-upload.tsx +27 -1
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +48 -0
- package/src/components/markdown-view/markdown-view.tsx +14 -0
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +88 -0
- package/src/components/nav-shell/nav-page.tsx +3 -3
- package/src/components/nav-shell/nav-tree-util.ts +48 -0
- package/src/components/nav-shell/use-nav-entries.ts +11 -2
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +123 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +130 -0
- package/src/components/settings/settings-danger-section.tsx +59 -0
- package/src/components/settings/settings-heading.tsx +55 -0
- package/src/components/settings/settings-layout.tsx +115 -0
- package/src/components/settings/settings-nav.tsx +175 -0
- package/src/components/settings/settings-row.tsx +81 -0
- package/src/components/settings/settings-section.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +9 -1
- package/src/components/ui/segmented.tsx +19 -2
- package/src/lib/i18n-fr.ts +68 -0
- package/src/lib/resize-image.ts +135 -0
- package/src/styles.css +126 -1
- /package/src/components/{admin/admin-user-detail-provider-labels.ts → auth/provider-labels.ts} +0 -0
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { fireEvent, render, waitFor } from "@testing-library/react";
|
|
2
|
+
import { Alepha, z } from "alepha";
|
|
3
|
+
import { AlephaLogger } from "alepha/logger";
|
|
4
|
+
import { AlephaContext } from "alepha/react";
|
|
5
|
+
import { type BaseInputField, useFieldValue, 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 used to pick a *primitive* by option count: a native `Select`
|
|
13
|
+
* below ~20 options, a `Combobox` above. That made per-option `description`,
|
|
14
|
+
* `tag` and `disabled` — plus `triggerClassName` and deselection — appear or
|
|
15
|
+
* vanish depending on how many siblings an option happened to have. Now a
|
|
16
|
+
* single Combobox renders every list and the count only decides whether the
|
|
17
|
+
* popup carries a search field.
|
|
18
|
+
*/
|
|
19
|
+
describe("ControlSelect searchable", () => {
|
|
20
|
+
const mount = (alepha: Alepha, ui: ReactNode) =>
|
|
21
|
+
render(
|
|
22
|
+
<AlephaContext.Provider value={alepha}>{ui}</AlephaContext.Provider>,
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const start = async () => {
|
|
26
|
+
const alepha = Alepha.create().with(AlephaLogger).with(AlephaReactI18n);
|
|
27
|
+
await alepha.start();
|
|
28
|
+
return alepha;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const SHORT = [
|
|
32
|
+
{ value: "user", label: "User", description: "Everyone", disabled: true },
|
|
33
|
+
{ value: "editor", label: "Editor", tag: "write" },
|
|
34
|
+
];
|
|
35
|
+
|
|
36
|
+
const LONG = Array.from({ length: 30 }, (_, i) => `opt-${i}`);
|
|
37
|
+
|
|
38
|
+
const Probe = (props: {
|
|
39
|
+
searchable?: boolean;
|
|
40
|
+
items?: (typeof SHORT)[number][] | string[];
|
|
41
|
+
}) => {
|
|
42
|
+
const form = useForm({
|
|
43
|
+
schema: z.object({ role: z.text().optional() as never }),
|
|
44
|
+
handler: () => {},
|
|
45
|
+
});
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<ControlSelect
|
|
49
|
+
input={form.input.role}
|
|
50
|
+
label="Role"
|
|
51
|
+
searchable={props.searchable}
|
|
52
|
+
items={(props.items ?? SHORT) as never}
|
|
53
|
+
/>
|
|
54
|
+
<Reporter input={form.input.role} />
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Reads the bound value rather than the trigger label, which falls back to
|
|
61
|
+
* the placeholder and would pass for the wrong reason.
|
|
62
|
+
*/
|
|
63
|
+
const Reporter = (props: { input: BaseInputField }) => {
|
|
64
|
+
const [value] = useFieldValue(props.input);
|
|
65
|
+
return (
|
|
66
|
+
<span data-testid="value">
|
|
67
|
+
{value === undefined ? "∅" : String(value)}
|
|
68
|
+
</span>
|
|
69
|
+
);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const openPopup = (ui: ReturnType<typeof render>) => {
|
|
73
|
+
fireEvent.keyDown(ui.getByRole("combobox"), { key: "ArrowDown" });
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const searchInput = (ui: ReturnType<typeof render>) =>
|
|
77
|
+
ui.queryByPlaceholderText("Search…");
|
|
78
|
+
|
|
79
|
+
it("omits the search field on a short list", async () => {
|
|
80
|
+
const alepha = await start();
|
|
81
|
+
const ui = mount(alepha, <Probe />);
|
|
82
|
+
|
|
83
|
+
openPopup(ui);
|
|
84
|
+
await ui.findByRole("option", { name: /Editor/ });
|
|
85
|
+
expect(searchInput(ui)).toBeNull();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it("adds the search field above the threshold", async () => {
|
|
89
|
+
const alepha = await start();
|
|
90
|
+
const ui = mount(alepha, <Probe items={LONG} />);
|
|
91
|
+
|
|
92
|
+
openPopup(ui);
|
|
93
|
+
await ui.findByRole("option", { name: "opt-0" });
|
|
94
|
+
expect(searchInput(ui)).not.toBeNull();
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it("honors an explicit `searchable` in both directions", async () => {
|
|
98
|
+
const alepha = await start();
|
|
99
|
+
|
|
100
|
+
const forcedOn = mount(alepha, <Probe searchable />);
|
|
101
|
+
openPopup(forcedOn);
|
|
102
|
+
await forcedOn.findByRole("option", { name: /Editor/ });
|
|
103
|
+
expect(forcedOn.queryByPlaceholderText("Search…")).not.toBeNull();
|
|
104
|
+
forcedOn.unmount();
|
|
105
|
+
|
|
106
|
+
const forcedOff = mount(alepha, <Probe searchable={false} items={LONG} />);
|
|
107
|
+
openPopup(forcedOff);
|
|
108
|
+
await forcedOff.findByRole("option", { name: "opt-0" });
|
|
109
|
+
expect(forcedOff.queryByPlaceholderText("Search…")).toBeNull();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
it("still renders description and tag on a short list", async () => {
|
|
113
|
+
const alepha = await start();
|
|
114
|
+
const ui = mount(alepha, <Probe />);
|
|
115
|
+
|
|
116
|
+
openPopup(ui);
|
|
117
|
+
// Both were silently dropped by the native-`Select` path.
|
|
118
|
+
expect(await ui.findByText("Everyone")).toBeTruthy();
|
|
119
|
+
expect(await ui.findByText("write")).toBeTruthy();
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("selects without a search field, and refuses a disabled row", async () => {
|
|
123
|
+
const alepha = await start();
|
|
124
|
+
const ui = mount(alepha, <Probe />);
|
|
125
|
+
|
|
126
|
+
openPopup(ui);
|
|
127
|
+
fireEvent.click(await ui.findByRole("option", { name: /Editor/ }));
|
|
128
|
+
await waitFor(() => {
|
|
129
|
+
expect(ui.getByTestId("value").textContent).toBe("editor");
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
// Pressed second, so "still editor" proves the row is inert rather than
|
|
133
|
+
// matching the state the field started in. `disabled` reached the row only
|
|
134
|
+
// on the combobox path, so a mandatory option used to be selectable as
|
|
135
|
+
// soon as its list was short enough.
|
|
136
|
+
openPopup(ui);
|
|
137
|
+
fireEvent.click(await ui.findByRole("option", { name: /User/ }));
|
|
138
|
+
await waitFor(() => {
|
|
139
|
+
expect(ui.getByTestId("value").textContent).toBe("editor");
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
});
|
|
@@ -18,14 +18,6 @@ import {
|
|
|
18
18
|
useComboboxAnchor,
|
|
19
19
|
} from "@alepha/ui/components/ui/combobox";
|
|
20
20
|
import { Segmented } from "@alepha/ui/components/ui/segmented";
|
|
21
|
-
import {
|
|
22
|
-
Select,
|
|
23
|
-
SelectContent,
|
|
24
|
-
SelectItem,
|
|
25
|
-
SelectSeparator,
|
|
26
|
-
SelectTrigger,
|
|
27
|
-
SelectValue,
|
|
28
|
-
} from "@alepha/ui/components/ui/select";
|
|
29
21
|
import { cn } from "@alepha/ui/lib/utils";
|
|
30
22
|
import type { Async } from "alepha";
|
|
31
23
|
import { useAction } from "alepha/react";
|
|
@@ -85,9 +77,18 @@ export interface ControlSelectProps {
|
|
|
85
77
|
*/
|
|
86
78
|
segmented?: boolean;
|
|
87
79
|
/**
|
|
88
|
-
*
|
|
80
|
+
* Force the search input on. Kept as the historical name for
|
|
81
|
+
* `searchable: true` — every select is a combobox now, the flag only
|
|
82
|
+
* decides whether it carries a search field.
|
|
89
83
|
*/
|
|
90
84
|
combobox?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether the dropdown carries a search input. Defaults to "auto": on for
|
|
87
|
+
* multi-select, for a long-mode `loader`, and for static lists longer than
|
|
88
|
+
* `SEARCH_THRESHOLD`. Set explicitly to search a short list or to drop the
|
|
89
|
+
* search field from a long one.
|
|
90
|
+
*/
|
|
91
|
+
searchable?: boolean;
|
|
91
92
|
/**
|
|
92
93
|
* Async option loader. Triggers long-mode (server-side search) above `loaderThreshold` options.
|
|
93
94
|
*/
|
|
@@ -166,6 +167,13 @@ export interface ControlSelectProps {
|
|
|
166
167
|
*/
|
|
167
168
|
const CLEAR_VALUE = "__alepha_clear__";
|
|
168
169
|
|
|
170
|
+
/**
|
|
171
|
+
* Static option count above which the dropdown grows a search input. Below it
|
|
172
|
+
* the very same combobox renders without one — the threshold decides whether
|
|
173
|
+
* you can type, never which control you get.
|
|
174
|
+
*/
|
|
175
|
+
const SEARCH_THRESHOLD = 20;
|
|
176
|
+
|
|
169
177
|
const optValue = (o: SelectOption) => (typeof o === "string" ? o : o.value);
|
|
170
178
|
const optLabel = (o: SelectOption) => (typeof o === "string" ? o : o.label);
|
|
171
179
|
const optDesc = (o: SelectOption) =>
|
|
@@ -289,52 +297,17 @@ export function ControlSelect(props: ControlSelectProps) {
|
|
|
289
297
|
const clearLabel =
|
|
290
298
|
props.clearLabel ?? tr("controlSelect.none", { default: "None" });
|
|
291
299
|
|
|
292
|
-
//
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
>
|
|
302
|
-
<Combobox
|
|
303
|
-
id={meta.id}
|
|
304
|
-
data={data}
|
|
305
|
-
loading={loading}
|
|
306
|
-
multi={isArray}
|
|
307
|
-
disabled={props.disabled}
|
|
308
|
-
value={value}
|
|
309
|
-
onChange={(v) => setValue(v)}
|
|
310
|
-
coerce={coerce}
|
|
311
|
-
onSearch={mode === "long" ? search.run : undefined}
|
|
312
|
-
createNewEntry={props.createNewEntry}
|
|
313
|
-
icon={props.icon}
|
|
314
|
-
// `clearable` used to reach this path as a placeholder and nothing
|
|
315
|
-
// else, so a filter chip that had switched to the combobox (>20
|
|
316
|
-
// options) could be set but never put back to "All …".
|
|
317
|
-
clearable={props.clearable}
|
|
318
|
-
clearLabel={clearLabel}
|
|
319
|
-
// An optional field must also be able to go back to empty without a
|
|
320
|
-
// dedicated row: Base UI never emits `null`, so re-pressing the
|
|
321
|
-
// selected row deselects (see `handleSingle`). A required field keeps
|
|
322
|
-
// its value — clearing it would only produce a validation error the
|
|
323
|
-
// user cannot see yet.
|
|
324
|
-
deselectable={props.clearable || !meta.required}
|
|
325
|
-
placeholder={props.clearable ? clearLabel : undefined}
|
|
326
|
-
/>
|
|
327
|
-
</FormField>
|
|
328
|
-
);
|
|
329
|
-
}
|
|
300
|
+
// One control for every list. The option count decides whether the popup
|
|
301
|
+
// carries a search field — it no longer decides which primitive renders.
|
|
302
|
+
// The native `Select` path this replaced silently dropped `description`,
|
|
303
|
+
// `tag`, per-option `disabled` and `deselectable`, and styled its trigger
|
|
304
|
+
// differently, purely because a list happened to be short.
|
|
305
|
+
// Multi-select is never search-less: the chips input IS its trigger.
|
|
306
|
+
const searchable =
|
|
307
|
+
isArray ||
|
|
308
|
+
(props.searchable ??
|
|
309
|
+
(props.combobox || mode === "long" || data.length > SEARCH_THRESHOLD));
|
|
330
310
|
|
|
331
|
-
// Infer / short — native Select
|
|
332
|
-
const labelFor = (raw: string) => {
|
|
333
|
-
const found = data.find((o) => optValue(o) === raw);
|
|
334
|
-
return found ? optLabel(found) : raw;
|
|
335
|
-
};
|
|
336
|
-
const selectedValue =
|
|
337
|
-
value != null ? String(value) : props.clearable ? CLEAR_VALUE : undefined;
|
|
338
311
|
return (
|
|
339
312
|
<FormField
|
|
340
313
|
id={meta.id}
|
|
@@ -343,62 +316,35 @@ export function ControlSelect(props: ControlSelectProps) {
|
|
|
343
316
|
error={meta.error}
|
|
344
317
|
required={meta.required}
|
|
345
318
|
>
|
|
346
|
-
<
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
}
|
|
353
|
-
setValue(coerce(v ?? ""));
|
|
354
|
-
}}
|
|
319
|
+
<Combobox
|
|
320
|
+
id={meta.id}
|
|
321
|
+
data={data}
|
|
322
|
+
loading={loading}
|
|
323
|
+
multi={isArray}
|
|
324
|
+
searchable={searchable}
|
|
355
325
|
disabled={props.disabled}
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
<SelectContent>
|
|
379
|
-
{props.clearable && (
|
|
380
|
-
<>
|
|
381
|
-
<SelectItem value={CLEAR_VALUE}>{clearLabel}</SelectItem>
|
|
382
|
-
<SelectSeparator />
|
|
383
|
-
</>
|
|
384
|
-
)}
|
|
385
|
-
{data.map((o) => {
|
|
386
|
-
const icon = optIcon(o);
|
|
387
|
-
return (
|
|
388
|
-
<SelectItem key={optValue(o)} value={optValue(o)}>
|
|
389
|
-
{icon ? (
|
|
390
|
-
<span className="flex items-center gap-2">
|
|
391
|
-
<span className="flex shrink-0 items-center">{icon}</span>
|
|
392
|
-
<span>{optLabel(o)}</span>
|
|
393
|
-
</span>
|
|
394
|
-
) : (
|
|
395
|
-
optLabel(o)
|
|
396
|
-
)}
|
|
397
|
-
</SelectItem>
|
|
398
|
-
);
|
|
399
|
-
})}
|
|
400
|
-
</SelectContent>
|
|
401
|
-
</Select>
|
|
326
|
+
value={value}
|
|
327
|
+
onChange={(v) => setValue(v)}
|
|
328
|
+
coerce={coerce}
|
|
329
|
+
onSearch={mode === "long" ? search.run : undefined}
|
|
330
|
+
createNewEntry={props.createNewEntry}
|
|
331
|
+
icon={props.icon}
|
|
332
|
+
// Used to be dropped on this path, so a filter chip sized `w-40` lost
|
|
333
|
+
// its width as soon as its list crossed the threshold.
|
|
334
|
+
triggerClassName={props.triggerClassName}
|
|
335
|
+
// `clearable` used to reach this path as a placeholder and nothing
|
|
336
|
+
// else, so a filter chip that had switched to the combobox (>20
|
|
337
|
+
// options) could be set but never put back to "All …".
|
|
338
|
+
clearable={props.clearable}
|
|
339
|
+
clearLabel={clearLabel}
|
|
340
|
+
// An optional field must also be able to go back to empty without a
|
|
341
|
+
// dedicated row: Base UI never emits `null`, so re-pressing the
|
|
342
|
+
// selected row deselects (see `handleSingle`). A required field keeps
|
|
343
|
+
// its value — clearing it would only produce a validation error the
|
|
344
|
+
// user cannot see yet.
|
|
345
|
+
deselectable={props.clearable || !meta.required}
|
|
346
|
+
placeholder={props.clearable ? clearLabel : undefined}
|
|
347
|
+
/>
|
|
402
348
|
</FormField>
|
|
403
349
|
);
|
|
404
350
|
}
|
|
@@ -408,6 +354,12 @@ interface ComboboxProps {
|
|
|
408
354
|
data: SelectOption[];
|
|
409
355
|
loading: boolean;
|
|
410
356
|
multi: boolean;
|
|
357
|
+
/**
|
|
358
|
+
* Render the search input. When false the popup is the list alone — the
|
|
359
|
+
* shape a short static list gets. Multi-select ignores it: its input is the
|
|
360
|
+
* chips box itself, and it is the only way to open and type.
|
|
361
|
+
*/
|
|
362
|
+
searchable: boolean;
|
|
411
363
|
disabled?: boolean;
|
|
412
364
|
value: unknown;
|
|
413
365
|
onChange: (v: unknown) => void;
|
|
@@ -415,6 +367,7 @@ interface ComboboxProps {
|
|
|
415
367
|
onSearch?: (q: string) => void;
|
|
416
368
|
createNewEntry?: ControlSelectProps["createNewEntry"];
|
|
417
369
|
icon?: IconComponent;
|
|
370
|
+
triggerClassName?: string;
|
|
418
371
|
/**
|
|
419
372
|
* Trigger text when nothing is selected. Mirrors the native-Select path,
|
|
420
373
|
* where a `clearable` field shows its `clearLabel` (e.g. "All zones") as the
|
|
@@ -703,6 +656,7 @@ function Combobox(props: ComboboxProps) {
|
|
|
703
656
|
className={cn(
|
|
704
657
|
"w-full",
|
|
705
658
|
props.disabled && "pointer-events-none opacity-50",
|
|
659
|
+
props.triggerClassName,
|
|
706
660
|
)}
|
|
707
661
|
>
|
|
708
662
|
{props.icon && (
|
|
@@ -732,7 +686,18 @@ function Combobox(props: ComboboxProps) {
|
|
|
732
686
|
disabled={props.disabled}
|
|
733
687
|
className={cn(
|
|
734
688
|
"flex h-8 w-full items-center justify-between gap-1.5 rounded-lg border border-input bg-transparent py-2 pr-2 pl-2.5 text-sm whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-input/30 dark:hover:bg-input/50",
|
|
735
|
-
|
|
689
|
+
// Muted means "nothing chosen yet", which is only true without
|
|
690
|
+
// a clear row. WITH one, empty is a selected value — the popup
|
|
691
|
+
// already puts the check mark on it (see `cbValue`), and the
|
|
692
|
+
// native `Select` path renders the same state in full contrast
|
|
693
|
+
// because it makes the clear label a genuine `selectedValue`.
|
|
694
|
+
// Muting here made one `clearable` filter look unset and its
|
|
695
|
+
// neighbour look set for the same meaning, purely because the
|
|
696
|
+
// option count crossed the 20 that picks between the two paths.
|
|
697
|
+
selected.length === 0 &&
|
|
698
|
+
!props.clearable &&
|
|
699
|
+
"text-muted-foreground",
|
|
700
|
+
props.triggerClassName,
|
|
736
701
|
)}
|
|
737
702
|
>
|
|
738
703
|
<span className="flex min-w-0 items-center gap-2">
|
|
@@ -743,7 +708,9 @@ function Combobox(props: ComboboxProps) {
|
|
|
743
708
|
</span>
|
|
744
709
|
</ComboboxTrigger>
|
|
745
710
|
<ComboboxContent>
|
|
746
|
-
|
|
711
|
+
{props.searchable && (
|
|
712
|
+
<ComboboxInput showTrigger={false} placeholder="Search…" />
|
|
713
|
+
)}
|
|
747
714
|
{popupBody}
|
|
748
715
|
</ComboboxContent>
|
|
749
716
|
</>
|
|
@@ -35,6 +35,10 @@ import {
|
|
|
35
35
|
useRef,
|
|
36
36
|
useState,
|
|
37
37
|
} from "react";
|
|
38
|
+
import {
|
|
39
|
+
type ResizeImageOptions,
|
|
40
|
+
resizeImage,
|
|
41
|
+
} from "../../lib/resize-image.ts";
|
|
38
42
|
|
|
39
43
|
export interface ControlUploadProps {
|
|
40
44
|
/**
|
|
@@ -63,6 +67,24 @@ export interface ControlUploadProps {
|
|
|
63
67
|
* Max size per file (bytes). Files over the limit are rejected.
|
|
64
68
|
*/
|
|
65
69
|
maxSize?: number;
|
|
70
|
+
/**
|
|
71
|
+
* Downscale images to these bounds before uploading.
|
|
72
|
+
*
|
|
73
|
+
* Set it wherever the result is rendered small — the bytes never leave the
|
|
74
|
+
* machine, so it speeds up the upload as well as every later fetch. Applied
|
|
75
|
+
* before {@link maxSize}, so a photo that would have been rejected for being
|
|
76
|
+
* too large is resized and accepted instead.
|
|
77
|
+
*
|
|
78
|
+
* Best-effort by design: a browser without `OffscreenCanvas`, an SVG, or an
|
|
79
|
+
* image the decoder chokes on is uploaded as-is, and the storage's own
|
|
80
|
+
* `maxSize` remains what actually bounds it. That trade is deliberate — a
|
|
81
|
+
* server-side codec able to close the gap costs more bundle than the case is
|
|
82
|
+
* worth on an edge runtime, and encodes worse (see `files:beforeUpload` in
|
|
83
|
+
* `alepha/api/files` for where it would attach if you want it anyway).
|
|
84
|
+
*
|
|
85
|
+
* @example { maxWidth: 256 }
|
|
86
|
+
*/
|
|
87
|
+
image?: ResizeImageOptions;
|
|
66
88
|
/**
|
|
67
89
|
* Bucket name passed to the upload endpoint.
|
|
68
90
|
*/
|
|
@@ -170,7 +192,11 @@ export function ControlUpload(props: ControlUploadProps) {
|
|
|
170
192
|
|
|
171
193
|
try {
|
|
172
194
|
for (let i = 0; i < files.length; i++) {
|
|
173
|
-
|
|
195
|
+
// Ahead of the size check on purpose: a 4 MB photo destined for a 32px
|
|
196
|
+
// avatar should become a few kilobytes, not an error.
|
|
197
|
+
const file = props.image
|
|
198
|
+
? await resizeImage(files[i], props.image)
|
|
199
|
+
: files[i];
|
|
174
200
|
|
|
175
201
|
if (props.maxSize && file.size > props.maxSize) {
|
|
176
202
|
toast.error(
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { render, screen } from "@testing-library/react";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { MarkdownView } from "../markdown-view.tsx";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* `rehypeSafeImg` promoted a lone `<img …>` raw node to a real element, and
|
|
7
|
+
* existed for exactly one reason: MDXEditor serialised a *resized* image as
|
|
8
|
+
* `<img width="…" src="…" />`. With the resize handles gone nothing produces
|
|
9
|
+
* that markup, so the plugin was deleted and react-markdown's default —
|
|
10
|
+
* escape every raw node to text — is restored.
|
|
11
|
+
*
|
|
12
|
+
* These pin that default. It is the entire raw-HTML posture of every
|
|
13
|
+
* markdown surface in every app built on this package: content is authored
|
|
14
|
+
* by one user and rendered to another, so a raw tag becoming live markup is
|
|
15
|
+
* an injection point. A future change that reaches for `rehype-raw`, or
|
|
16
|
+
* re-adds a promoting plugin, turns these red — which is the point.
|
|
17
|
+
*/
|
|
18
|
+
describe("MarkdownView raw HTML", () => {
|
|
19
|
+
it("escapes a raw img instead of promoting it to an element", () => {
|
|
20
|
+
const { container } = render(
|
|
21
|
+
<MarkdownView content={'<img src="assets/a.webp" width="600" />'} />,
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
expect(container.querySelector("img")).toBeNull();
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
it("escapes an img carrying an event handler", () => {
|
|
28
|
+
const { container } = render(
|
|
29
|
+
<MarkdownView content={'<img src="x" onerror="alert(1)" />'} />,
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
expect(container.querySelector("img")).toBeNull();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it("escapes every other raw tag too", () => {
|
|
36
|
+
const { container } = render(
|
|
37
|
+
<MarkdownView content={'<button onclick="alert(1)">hi</button>'} />,
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
expect(container.querySelector("button")).toBeNull();
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
it("still renders real markdown around the escaped HTML", () => {
|
|
44
|
+
render(<MarkdownView content={"# Title\n\n<img src='a' />"} />);
|
|
45
|
+
|
|
46
|
+
expect(screen.getByRole("heading", { level: 1 }).textContent).toBe("Title");
|
|
47
|
+
});
|
|
48
|
+
});
|
|
@@ -11,6 +11,20 @@ export interface MarkdownViewProps {
|
|
|
11
11
|
content: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Renders markdown as formatted prose.
|
|
16
|
+
*
|
|
17
|
+
* No raw HTML is ever rendered as markup: react-markdown's default is to
|
|
18
|
+
* escape a raw node to text, and this component deliberately mounts no
|
|
19
|
+
* plugin that changes that. A narrow `rehypeSafeImg` plugin used to promote
|
|
20
|
+
* a lone `<img …>` — the one thing MDXEditor emitted for a *resized* image —
|
|
21
|
+
* and was deleted along with the editor that produced it, since nothing
|
|
22
|
+
* writes that markup anymore.
|
|
23
|
+
*
|
|
24
|
+
* Do not reach for `rehype-raw` to bring the capability back: this renders
|
|
25
|
+
* content authored by one user to another, so every raw tag becoming live
|
|
26
|
+
* markup turns every markdown surface in every app into an injection point.
|
|
27
|
+
*/
|
|
14
28
|
export const MarkdownView = (props: MarkdownViewProps) => {
|
|
15
29
|
return (
|
|
16
30
|
<div className="max-w-none text-sm leading-relaxed">
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { isActivePath, keepDeepestActive } from "../nav-tree-util.ts";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Entries as `useNavEntries` builds them: `href` is the page's resolved
|
|
6
|
+
* `match`, `active` is whatever `isActivePath` said about it in isolation.
|
|
7
|
+
*/
|
|
8
|
+
const entriesFor = (current: string, hrefs: string[]) =>
|
|
9
|
+
hrefs.map((href) => ({ href, active: isActivePath(current, href) }));
|
|
10
|
+
|
|
11
|
+
const activeHrefs = (current: string, hrefs: string[]) =>
|
|
12
|
+
keepDeepestActive(entriesFor(current, hrefs))
|
|
13
|
+
.filter((entry) => entry.active)
|
|
14
|
+
.map((entry) => entry.href);
|
|
15
|
+
|
|
16
|
+
describe("isActivePath", () => {
|
|
17
|
+
it("matches the page itself and anything below it", () => {
|
|
18
|
+
expect(isActivePath("/admin/users", "/admin/users")).toBe(true);
|
|
19
|
+
expect(isActivePath("/admin/users/42", "/admin/users")).toBe(true);
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
it("does not match a sibling that merely shares a prefix", () => {
|
|
23
|
+
// Without the trailing separator, "/admin/users-import" would look like a
|
|
24
|
+
// descendant of "/admin/users".
|
|
25
|
+
expect(isActivePath("/admin/users-import", "/admin/users")).toBe(false);
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
describe("keepDeepestActive", () => {
|
|
30
|
+
/*
|
|
31
|
+
The account rail's regression. `AccountRouter.profile` sits at `path: "/"`
|
|
32
|
+
under the `/account` shell, and `createMatch` collapses that to `/account`
|
|
33
|
+
— the shell's own path — so the entry is a prefix of every sibling and lit
|
|
34
|
+
up on all of them.
|
|
35
|
+
*/
|
|
36
|
+
it("drops an index entry whose match is a prefix of its siblings", () => {
|
|
37
|
+
const rail = [
|
|
38
|
+
"/account", // Profile
|
|
39
|
+
"/account/security",
|
|
40
|
+
"/account/sessions",
|
|
41
|
+
"/account/feedback",
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
expect(activeHrefs("/account/security", rail)).toEqual([
|
|
45
|
+
"/account/security",
|
|
46
|
+
]);
|
|
47
|
+
expect(activeHrefs("/account/feedback", rail)).toEqual([
|
|
48
|
+
"/account/feedback",
|
|
49
|
+
]);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
it("keeps the index entry on the index route itself", () => {
|
|
53
|
+
expect(activeHrefs("/account", ["/account", "/account/security"])).toEqual([
|
|
54
|
+
"/account",
|
|
55
|
+
]);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("keeps a section lit while one of its detail routes is open", () => {
|
|
59
|
+
/*
|
|
60
|
+
The behaviour the loose predicate exists for, and the reason this is
|
|
61
|
+
deepest-wins rather than "an index entry must match exactly": nothing
|
|
62
|
+
else in the rail matches `/admin/users/42`, so the section stays active.
|
|
63
|
+
*/
|
|
64
|
+
const rail = ["/admin/users", "/admin/sessions", "/admin/keys"];
|
|
65
|
+
|
|
66
|
+
expect(activeHrefs("/admin/users/42", rail)).toEqual(["/admin/users"]);
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
it("keeps an index entry lit on a child route it genuinely owns", () => {
|
|
70
|
+
// Same shape as the first case, except no sibling claims the child — so
|
|
71
|
+
// the index entry is still the deepest match and must survive.
|
|
72
|
+
expect(
|
|
73
|
+
activeHrefs("/account/photo", ["/account", "/account/security"]),
|
|
74
|
+
).toEqual(["/account"]);
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it("marks nothing active when the current path is outside the shell", () => {
|
|
78
|
+
expect(activeHrefs("/projects", ["/account", "/account/security"])).toEqual(
|
|
79
|
+
[],
|
|
80
|
+
);
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it("leaves a list with a single active entry untouched", () => {
|
|
84
|
+
expect(activeHrefs("/admin/keys", ["/admin/users", "/admin/keys"])).toEqual(
|
|
85
|
+
["/admin/keys"],
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
});
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "alepha/react/router";
|
|
9
9
|
import { $secure } from "alepha/security";
|
|
10
10
|
|
|
11
|
-
export interface
|
|
11
|
+
export interface PageNavOptions<
|
|
12
12
|
TConfig extends PageConfigSchema = PageConfigSchema,
|
|
13
13
|
TProps extends object = TPropsDefault,
|
|
14
14
|
TPropsParent extends object = TPropsParentDefault,
|
|
@@ -34,12 +34,12 @@ export interface NavPageOptions<
|
|
|
34
34
|
* Pages declared this way are picked up by {@link useNavTree} /
|
|
35
35
|
* {@link NavShell} purely from their `nav` field — no separate nav list.
|
|
36
36
|
*/
|
|
37
|
-
export const
|
|
37
|
+
export const $pageNav = <
|
|
38
38
|
TConfig extends PageConfigSchema = PageConfigSchema,
|
|
39
39
|
TProps extends object = TPropsDefault,
|
|
40
40
|
TPropsParent extends object = TPropsParentDefault,
|
|
41
41
|
>(
|
|
42
|
-
options:
|
|
42
|
+
options: PageNavOptions<TConfig, TProps, TPropsParent>,
|
|
43
43
|
): PagePrimitive<TConfig, TProps, TPropsParent> => {
|
|
44
44
|
const { permission, use, nav, ...rest } = options;
|
|
45
45
|
const permissions = permission
|