@alepha/ui 0.26.0 → 0.27.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/README.md +86 -12
- package/dist/components/account/account-connections.js +5 -5
- package/dist/components/account/account-connections.js.map +1 -1
- package/dist/components/account/account-delete-dialog.js +4 -4
- package/dist/components/account/account-header.d.ts.map +1 -1
- package/dist/components/account/account-header.js +3 -1
- package/dist/components/account/account-header.js.map +1 -1
- package/dist/components/account/account-keys.js +7 -7
- package/dist/components/account/account-keys.js.map +1 -1
- package/dist/components/account/account-layout.d.ts.map +1 -1
- package/dist/components/account/account-layout.js +7 -4
- package/dist/components/account/account-layout.js.map +1 -1
- package/dist/components/account/account-password-dialog.js +3 -3
- package/dist/components/account/account-profile.js +8 -8
- package/dist/components/account/account-profile.js.map +1 -1
- package/dist/components/account/account-router-options.d.ts.map +1 -1
- package/dist/components/account/account-router-options.js.map +1 -1
- package/dist/components/account/account-router-page.d.ts.map +1 -1
- package/dist/components/account/account-router-page.js.map +1 -1
- package/dist/components/account/account-router.d.ts +3 -2
- package/dist/components/account/account-router.d.ts.map +1 -1
- package/dist/components/account/account-router.js +4 -3
- package/dist/components/account/account-router.js.map +1 -1
- package/dist/components/account/account-security.d.ts.map +1 -1
- package/dist/components/account/account-security.js +6 -6
- package/dist/components/account/account-security.js.map +1 -1
- package/dist/components/account/account-sessions.d.ts.map +1 -1
- package/dist/components/account/account-sessions.js +19 -6
- package/dist/components/account/account-sessions.js.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts +1 -1
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-query-panel.js +5 -5
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts +1 -1
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics-results.js +2 -2
- package/dist/components/admin/admin-analytics-results.js.map +1 -1
- package/dist/components/admin/admin-analytics.d.ts +1 -1
- package/dist/components/admin/admin-analytics.d.ts.map +1 -1
- package/dist/components/admin/admin-analytics.js +3 -3
- package/dist/components/admin/admin-analytics.js.map +1 -1
- package/dist/components/admin/admin-audits.d.ts +1 -1
- package/dist/components/admin/admin-audits.d.ts.map +1 -1
- package/dist/components/admin/admin-audits.js +4 -4
- package/dist/components/admin/admin-audits.js.map +1 -1
- package/dist/components/admin/admin-dashboard-card.d.ts +42 -0
- package/dist/components/admin/admin-dashboard-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-card.js +0 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts +34 -0
- package/dist/components/admin/admin-dashboard-count-card.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard-count-card.js +42 -0
- package/dist/components/admin/admin-dashboard-count-card.js.map +1 -0
- package/dist/components/admin/admin-dashboard.d.ts +20 -0
- package/dist/components/admin/admin-dashboard.d.ts.map +1 -0
- package/dist/components/admin/admin-dashboard.js +32 -0
- package/dist/components/admin/admin-dashboard.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +1 -1
- package/dist/components/admin/admin-files.d.ts.map +1 -1
- package/dist/components/admin/admin-files.js +3 -3
- package/dist/components/admin/admin-files.js.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-executions-panel.js +16 -31
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs-status-badge.js +2 -2
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -1
- package/dist/components/admin/admin-jobs.d.ts +1 -1
- package/dist/components/admin/admin-jobs.d.ts.map +1 -1
- package/dist/components/admin/admin-jobs.js +5 -5
- package/dist/components/admin/admin-jobs.js.map +1 -1
- package/dist/components/admin/admin-keys-token-dialog.js +3 -3
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -1
- package/dist/components/admin/admin-keys.d.ts +1 -1
- package/dist/components/admin/admin-keys.d.ts.map +1 -1
- package/dist/components/admin/admin-keys.js +4 -4
- package/dist/components/admin/admin-keys.js.map +1 -1
- package/dist/components/admin/admin-layout.d.ts.map +1 -1
- package/dist/components/admin/admin-layout.js +1 -3
- package/dist/components/admin/admin-layout.js.map +1 -1
- package/dist/components/admin/admin-notifications.d.ts +1 -1
- package/dist/components/admin/admin-notifications.d.ts.map +1 -1
- package/dist/components/admin/admin-notifications.js +3 -3
- package/dist/components/admin/admin-notifications.js.map +1 -1
- package/dist/components/admin/admin-parameters.d.ts +1 -1
- package/dist/components/admin/admin-parameters.d.ts.map +1 -1
- package/dist/components/admin/admin-parameters.js +10 -10
- package/dist/components/admin/admin-parameters.js.map +1 -1
- package/dist/components/admin/admin-payments.d.ts +1 -1
- package/dist/components/admin/admin-payments.d.ts.map +1 -1
- package/dist/components/admin/admin-payments.js +3 -3
- package/dist/components/admin/admin-payments.js.map +1 -1
- package/dist/components/admin/admin-router-options.d.ts +13 -10
- package/dist/components/admin/admin-router-options.d.ts.map +1 -1
- package/dist/components/admin/admin-router-options.js.map +1 -1
- package/dist/components/admin/admin-router-page.d.ts +7 -5
- package/dist/components/admin/admin-router-page.d.ts.map +1 -1
- package/dist/components/admin/admin-router-page.js +7 -5
- package/dist/components/admin/admin-router-page.js.map +1 -1
- package/dist/components/admin/admin-router.d.ts +72 -27
- package/dist/components/admin/admin-router.d.ts.map +1 -1
- package/dist/components/admin/admin-router.js +103 -40
- package/dist/components/admin/admin-router.js.map +1 -1
- package/dist/components/admin/admin-sessions.d.ts +1 -1
- package/dist/components/admin/admin-sessions.d.ts.map +1 -1
- package/dist/components/admin/admin-sessions.js +12 -4
- package/dist/components/admin/admin-sessions.js.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +4 -3
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-identity-aside.js +13 -69
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-security-tab.js +2 -2
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +2 -2
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -1
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -1
- package/dist/components/admin/admin-user-detail.js +68 -111
- package/dist/components/admin/admin-user-detail.js.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts +6 -1
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -1
- package/dist/components/admin/admin-users-roles-picker.js +11 -8
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -1
- package/dist/components/admin/admin-users.d.ts.map +1 -1
- package/dist/components/admin/admin-users.js +9 -12
- package/dist/components/admin/admin-users.js.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +2 -2
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-execution-sheet.js +10 -10
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +2 -2
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-executions-panel.js +20 -44
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.d.ts +2 -2
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows-status-badge.js +2 -2
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -1
- package/dist/components/admin/admin-workflows.d.ts +1 -1
- package/dist/components/admin/admin-workflows.d.ts.map +1 -1
- package/dist/components/admin/admin-workflows.js +5 -5
- package/dist/components/admin/admin-workflows.js.map +1 -1
- package/dist/components/admin/diff-lines.js +1 -1
- package/dist/components/admin/diff-lines.js.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -1
- package/dist/components/admin/parameter-diff-dialog.js +1 -1
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -1
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -1
- package/dist/components/admin/parameter-history-item.js +4 -4
- package/dist/components/admin/parameter-history-item.js.map +1 -1
- package/dist/components/admin/parameter-json-dialog.js +1 -1
- package/dist/components/admin/parameter-save-dialog.js +2 -2
- package/dist/components/admin/use-confirmed-action.js +1 -1
- package/dist/components/alepha-table/alepha-table.d.ts +103 -8
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -1
- package/dist/components/alepha-table/alepha-table.js +128 -26
- package/dist/components/alepha-table/alepha-table.js.map +1 -1
- package/dist/components/alepha-table/paginate-local.d.ts +43 -0
- package/dist/components/alepha-table/paginate-local.d.ts.map +1 -0
- package/dist/components/alepha-table/paginate-local.js +84 -0
- package/dist/components/alepha-table/paginate-local.js.map +1 -0
- package/dist/components/app-actions/app-actions.js +1 -1
- package/dist/components/app-shell/app-shell.d.ts +10 -1
- package/dist/components/app-shell/app-shell.d.ts.map +1 -1
- package/dist/components/app-shell/app-shell.js +27 -20
- package/dist/components/app-shell/app-shell.js.map +1 -1
- package/dist/components/auth/auth-login.d.ts +1 -1
- package/dist/components/auth/auth-login.d.ts.map +1 -1
- package/dist/components/auth/auth-login.js +7 -18
- package/dist/components/auth/auth-login.js.map +1 -1
- package/dist/components/auth/auth-register.d.ts +1 -1
- package/dist/components/auth/auth-register.d.ts.map +1 -1
- package/dist/components/auth/auth-register.js +20 -21
- package/dist/components/auth/auth-register.js.map +1 -1
- package/dist/components/auth/auth-reset-password.d.ts +1 -1
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -1
- package/dist/components/auth/auth-reset-password.js +16 -13
- package/dist/components/auth/auth-reset-password.js.map +1 -1
- package/dist/components/auth/auth-router.d.ts +3 -3
- package/dist/components/auth/auth-router.d.ts.map +1 -1
- package/dist/components/auth/auth-router.js +3 -3
- package/dist/components/auth/auth-router.js.map +1 -1
- package/dist/components/auth/auth-verify-email.d.ts +1 -1
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -1
- package/dist/components/auth/auth-verify-email.js +8 -8
- package/dist/components/auth/auth-verify-email.js.map +1 -1
- package/dist/components/auth/safe-redirect.d.ts +9 -0
- package/dist/components/auth/safe-redirect.d.ts.map +1 -0
- package/dist/components/auth/safe-redirect.js +19 -0
- package/dist/components/auth/safe-redirect.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -1
- package/dist/components/auto-form/auto-form.js +32 -32
- package/dist/components/auto-form/auto-form.js.map +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts +1 -1
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -1
- package/dist/components/brand-icon/brand-icon.js +2 -2
- package/dist/components/brand-icon/brand-icon.js.map +1 -1
- package/dist/components/button-dark/button-dark.d.ts +1 -1
- package/dist/components/button-dark/button-dark.d.ts.map +1 -1
- package/dist/components/button-dark/button-dark.js +2 -2
- package/dist/components/button-dark/button-dark.js.map +1 -1
- package/dist/components/button-language/button-language.d.ts +1 -1
- package/dist/components/button-language/button-language.d.ts.map +1 -1
- package/dist/components/button-language/button-language.js +2 -2
- package/dist/components/button-language/button-language.js.map +1 -1
- package/dist/components/button-theme/button-theme.d.ts +1 -1
- package/dist/components/button-theme/button-theme.d.ts.map +1 -1
- package/dist/components/button-theme/button-theme.js +3 -3
- package/dist/components/button-theme/button-theme.js.map +1 -1
- package/dist/components/button-user/button-user.d.ts +2 -20
- package/dist/components/button-user/button-user.d.ts.map +1 -1
- package/dist/components/button-user/button-user.js +3 -3
- package/dist/components/button-user/button-user.js.map +1 -1
- package/dist/components/captcha/turnstile-widget.d.ts +2 -2
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -1
- package/dist/components/captcha/turnstile-widget.js +5 -4
- package/dist/components/captcha/turnstile-widget.js.map +1 -1
- package/dist/components/control/control.d.ts +1 -1
- package/dist/components/control/control.d.ts.map +1 -1
- package/dist/components/control/control.js +8 -11
- package/dist/components/control/control.js.map +1 -1
- package/dist/components/control-array/control-array.d.ts +1 -1
- package/dist/components/control-array/control-array.d.ts.map +1 -1
- package/dist/components/control-array/control-array.js +23 -16
- package/dist/components/control-array/control-array.js.map +1 -1
- package/dist/components/control-base/field-i18n.d.ts +5 -3
- package/dist/components/control-base/field-i18n.d.ts.map +1 -1
- package/dist/components/control-base/field-i18n.js +4 -2
- package/dist/components/control-base/field-i18n.js.map +1 -1
- package/dist/components/control-base/form-field.d.ts +7 -7
- package/dist/components/control-base/form-field.d.ts.map +1 -1
- package/dist/components/control-base/form-field.js +10 -10
- package/dist/components/control-base/form-field.js.map +1 -1
- package/dist/components/control-base/icon-hint.d.ts +1 -1
- package/dist/components/control-base/icon-hint.d.ts.map +1 -1
- package/dist/components/control-base/icon-hint.js.map +1 -1
- package/dist/components/control-date/control-date.d.ts +1 -1
- package/dist/components/control-date/control-date.d.ts.map +1 -1
- package/dist/components/control-date/control-date.js +23 -7
- package/dist/components/control-date/control-date.js.map +1 -1
- package/dist/components/control-number/control-number.d.ts +2 -2
- package/dist/components/control-number/control-number.d.ts.map +1 -1
- package/dist/components/control-number/control-number.js +3 -3
- package/dist/components/control-number/control-number.js.map +1 -1
- package/dist/components/control-object/control-object.d.ts +4 -2
- package/dist/components/control-object/control-object.d.ts.map +1 -1
- package/dist/components/control-object/control-object.js +8 -8
- package/dist/components/control-object/control-object.js.map +1 -1
- package/dist/components/control-password/control-password.js +2 -3
- package/dist/components/control-password/control-password.js.map +1 -1
- package/dist/components/control-select/control-select.d.ts +2 -2
- package/dist/components/control-select/control-select.d.ts.map +1 -1
- package/dist/components/control-select/control-select.js +17 -17
- package/dist/components/control-select/control-select.js.map +1 -1
- package/dist/components/control-upload/control-upload.d.ts +1 -1
- package/dist/components/control-upload/control-upload.d.ts.map +1 -1
- package/dist/components/control-upload/control-upload.js +11 -11
- package/dist/components/control-upload/control-upload.js.map +1 -1
- package/dist/components/detail/detail-aside.d.ts +58 -0
- package/dist/components/detail/detail-aside.d.ts.map +1 -0
- package/dist/components/detail/detail-aside.js +95 -0
- package/dist/components/detail/detail-aside.js.map +1 -0
- package/dist/components/detail/detail-layout.d.ts +90 -0
- package/dist/components/detail/detail-layout.d.ts.map +1 -0
- package/dist/components/detail/detail-layout.js +102 -0
- package/dist/components/detail/detail-layout.js.map +1 -0
- package/dist/components/detail/use-detail-tab.d.ts +15 -0
- package/dist/components/detail/use-detail-tab.d.ts.map +1 -0
- package/dist/components/detail/use-detail-tab.js +37 -0
- package/dist/components/detail/use-detail-tab.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -1
- package/dist/components/file-image/file-image.js.map +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts +1 -1
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -1
- package/dist/components/language-toggle/language-toggle.js +2 -2
- package/dist/components/language-toggle/language-toggle.js.map +1 -1
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts +28 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js +25 -0
- package/dist/components/markdown-view/diagram/DiagramErrorBoundary.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts +44 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js +98 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagram.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts +14 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js +45 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramCluster.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts +19 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js +69 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramEdge.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts +23 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js +34 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramLabel.js.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts +17 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js +63 -0
- package/dist/components/markdown-view/diagram/FlowchartDiagramNode.js.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js +30 -0
- package/dist/components/markdown-view/diagram/MermaidFence.js.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts +18 -0
- package/dist/components/markdown-view/diagram/flowchartParser.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js +370 -0
- package/dist/components/markdown-view/diagram/flowchartParser.js.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts +67 -0
- package/dist/components/markdown-view/diagram/graphModel.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/graphModel.js +0 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts +109 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js +185 -0
- package/dist/components/markdown-view/diagram/layoutFlowchart.js.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts +63 -0
- package/dist/components/markdown-view/diagram/textMetrics.d.ts.map +1 -0
- package/dist/components/markdown-view/diagram/textMetrics.js +228 -0
- package/dist/components/markdown-view/diagram/textMetrics.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.d.ts +32 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -1
- package/dist/components/markdown-view/markdown-view.js +85 -9
- package/dist/components/markdown-view/markdown-view.js.map +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts +1 -1
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -1
- package/dist/components/nav-shell/nav-shell.js +1 -1
- package/dist/components/nav-shell/nav-shell.js.map +1 -1
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -1
- package/dist/components/nav-shell/spotlight.js.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.d.ts +15 -5
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-entries.js +1 -1
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -1
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -1
- package/dist/components/settings/settings-card-edge.d.ts +25 -0
- package/dist/components/settings/settings-card-edge.d.ts.map +1 -0
- package/dist/components/settings/settings-card-edge.js +29 -0
- package/dist/components/settings/settings-card-edge.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -1
- package/dist/components/settings/settings-danger-section.js +2 -1
- package/dist/components/settings/settings-danger-section.js.map +1 -1
- package/dist/components/settings/settings-layout.d.ts.map +1 -1
- package/dist/components/settings/settings-layout.js +1 -1
- package/dist/components/settings/settings-layout.js.map +1 -1
- package/dist/components/settings/settings-nav.d.ts.map +1 -1
- package/dist/components/settings/settings-nav.js +3 -3
- package/dist/components/settings/settings-nav.js.map +1 -1
- package/dist/components/settings/settings-row.js +2 -2
- package/dist/components/settings/settings-row.js.map +1 -1
- package/dist/components/settings/settings-section.d.ts.map +1 -1
- package/dist/components/settings/settings-section.js +3 -2
- package/dist/components/settings/settings-section.js.map +1 -1
- package/dist/components/ui/accordion.js +3 -3
- package/dist/components/ui/accordion.js.map +1 -1
- package/dist/components/ui/alert-dialog.js +5 -5
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.js +2 -2
- package/dist/components/ui/alert.js.map +1 -1
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +13 -2
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/badge.js +51 -12
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +3 -3
- package/dist/components/ui/breadcrumb.js.map +1 -1
- package/dist/components/ui/button-group.js +2 -2
- package/dist/components/ui/button-group.js.map +1 -1
- package/dist/components/ui/button.js +2 -2
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +8 -8
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/card.js +3 -3
- package/dist/components/ui/card.js.map +1 -1
- package/dist/components/ui/carousel.d.ts.map +1 -1
- package/dist/components/ui/carousel.js +20 -10
- package/dist/components/ui/carousel.js.map +1 -1
- package/dist/components/ui/chart.d.ts.map +1 -1
- package/dist/components/ui/chart.js +7 -6
- package/dist/components/ui/chart.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts.map +1 -1
- package/dist/components/ui/combobox.js +8 -8
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/command.d.ts.map +1 -1
- package/dist/components/ui/command.js +6 -6
- package/dist/components/ui/command.js.map +1 -1
- package/dist/components/ui/context-menu.js +8 -8
- package/dist/components/ui/context-menu.js.map +1 -1
- package/dist/components/ui/dialog.js +4 -4
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/drawer.js +4 -4
- package/dist/components/ui/drawer.js.map +1 -1
- package/dist/components/ui/dropdown-menu.js +9 -9
- package/dist/components/ui/dropdown-menu.js.map +1 -1
- package/dist/components/ui/empty.js +2 -2
- package/dist/components/ui/empty.js.map +1 -1
- package/dist/components/ui/hover-card.js +1 -1
- package/dist/components/ui/hover-card.js.map +1 -1
- package/dist/components/ui/input-group.d.ts.map +1 -1
- package/dist/components/ui/input-group.js +3 -3
- package/dist/components/ui/input-group.js.map +1 -1
- package/dist/components/ui/input-otp.js +3 -3
- package/dist/components/ui/input-otp.js.map +1 -1
- package/dist/components/ui/input.js +1 -1
- package/dist/components/ui/input.js.map +1 -1
- package/dist/components/ui/item.js +3 -3
- package/dist/components/ui/item.js.map +1 -1
- package/dist/components/ui/kbd.js +1 -1
- package/dist/components/ui/kbd.js.map +1 -1
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/label.js.map +1 -1
- package/dist/components/ui/menubar.js +9 -9
- package/dist/components/ui/menubar.js.map +1 -1
- package/dist/components/ui/navigation-menu.js +7 -7
- package/dist/components/ui/navigation-menu.js.map +1 -1
- package/dist/components/ui/pagination.d.ts.map +1 -1
- package/dist/components/ui/pagination.js.map +1 -1
- package/dist/components/ui/popover.js +1 -1
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.js +3 -3
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +2 -2
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/resizable.js +2 -2
- package/dist/components/ui/resizable.js.map +1 -1
- package/dist/components/ui/scroll-area.js +2 -2
- package/dist/components/ui/scroll-area.js.map +1 -1
- package/dist/components/ui/segmented.d.ts.map +1 -1
- package/dist/components/ui/segmented.js +1 -1
- package/dist/components/ui/segmented.js.map +1 -1
- package/dist/components/ui/select.js +8 -8
- package/dist/components/ui/select.js.map +1 -1
- package/dist/components/ui/separator.js +1 -1
- package/dist/components/ui/separator.js.map +1 -1
- package/dist/components/ui/sheet.js +3 -3
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/components/ui/sidebar.js +17 -17
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/skeleton.js +1 -1
- package/dist/components/ui/skeleton.js.map +1 -1
- package/dist/components/ui/slider.js +2 -2
- package/dist/components/ui/slider.js.map +1 -1
- package/dist/components/ui/sonner.js +1 -1
- package/dist/components/ui/switch.js +2 -2
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/table.js +5 -5
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- package/dist/components/ui/textarea.js +1 -1
- package/dist/components/ui/textarea.js.map +1 -1
- package/dist/components/ui/toggle-group.d.ts.map +1 -1
- package/dist/components/ui/toggle-group.js +13 -7
- package/dist/components/ui/toggle-group.js.map +1 -1
- package/dist/components/ui/toggle.js +2 -2
- package/dist/components/ui/toggle.js.map +1 -1
- package/dist/components/ui/tooltip.d.ts +10 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/components/ui/tooltip.js +13 -3
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/components/use-dialog/use-dialog.d.ts +2 -2
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -1
- package/dist/components/use-dialog/use-dialog.js +10 -6
- package/dist/components/use-dialog/use-dialog.js.map +1 -1
- package/dist/components/use-toast/use-toast.d.ts +9 -3
- package/dist/components/use-toast/use-toast.d.ts.map +1 -1
- package/dist/components/use-toast/use-toast.js +23 -22
- package/dist/components/use-toast/use-toast.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +10 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -1
- package/dist/hooks/use-mobile.js +19 -12
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/lib/i18n-fr.d.ts +3 -3
- package/dist/lib/i18n-fr.d.ts.map +1 -1
- package/dist/lib/i18n-fr.js +13 -8
- package/dist/lib/i18n-fr.js.map +1 -1
- package/dist/styles.css +5 -5
- package/package.json +46 -45
- package/src/components/account/__tests__/account-router.spec.ts +4 -2
- package/src/components/account/account-connections.tsx +1 -1
- package/src/components/account/account-header.tsx +6 -1
- package/src/components/account/account-keys.tsx +1 -1
- package/src/components/account/account-layout.tsx +8 -1
- package/src/components/account/account-profile.tsx +3 -3
- package/src/components/account/account-router-options.tsx +1 -0
- package/src/components/account/account-router-page.tsx +1 -0
- package/src/components/account/account-router.tsx +4 -2
- package/src/components/account/account-security.tsx +1 -0
- package/src/components/account/account-sessions.tsx +21 -4
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +2 -1
- package/src/components/admin/__tests__/admin-router-page.spec.ts +2 -1
- package/src/components/admin/__tests__/admin-router.spec.ts +57 -1
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +1 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +1 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +4 -3
- package/src/components/admin/admin-analytics-results.tsx +2 -2
- package/src/components/admin/admin-analytics.tsx +3 -3
- package/src/components/admin/admin-audits.tsx +3 -3
- package/src/components/admin/admin-dashboard-card.tsx +45 -0
- package/src/components/admin/admin-dashboard-count-card.tsx +89 -0
- package/src/components/admin/admin-dashboard.tsx +60 -0
- package/src/components/admin/admin-files.tsx +2 -2
- package/src/components/admin/admin-jobs-executions-panel.tsx +19 -12
- package/src/components/admin/admin-jobs-status-badge.tsx +2 -2
- package/src/components/admin/admin-jobs.tsx +4 -4
- package/src/components/admin/admin-keys-token-dialog.tsx +2 -2
- package/src/components/admin/admin-keys.tsx +2 -2
- package/src/components/admin/admin-layout.tsx +1 -2
- package/src/components/admin/admin-notifications.tsx +2 -2
- package/src/components/admin/admin-parameters.tsx +16 -9
- package/src/components/admin/admin-payments.tsx +2 -2
- package/src/components/admin/admin-router-options.tsx +14 -10
- package/src/components/admin/admin-router-page.tsx +8 -5
- package/src/components/admin/admin-router.tsx +112 -40
- package/src/components/admin/admin-sessions.tsx +13 -2
- package/src/components/admin/admin-user-detail-audits-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail-identity-aside.tsx +16 -93
- package/src/components/admin/admin-user-detail-overview-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-password-dialog.tsx +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +1 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +1 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -0
- package/src/components/admin/admin-user-detail-sessions-tab.tsx +5 -2
- package/src/components/admin/admin-user-detail.tsx +49 -87
- package/src/components/admin/admin-users-roles-picker.tsx +22 -15
- package/src/components/admin/admin-users.tsx +8 -14
- package/src/components/admin/admin-workflows-execution-sheet.tsx +18 -10
- package/src/components/admin/admin-workflows-executions-panel.tsx +24 -17
- package/src/components/admin/admin-workflows-status-badge.tsx +4 -2
- package/src/components/admin/admin-workflows.tsx +6 -4
- package/src/components/admin/diff-lines.spec.ts +1 -0
- package/src/components/admin/diff-lines.ts +1 -1
- package/src/components/admin/parameter-diff-dialog.tsx +3 -2
- package/src/components/admin/parameter-history-item.tsx +6 -5
- package/src/components/alepha-table/__tests__/alepha-table-static.browser.spec.tsx +190 -0
- package/src/components/alepha-table/__tests__/paginate-local.spec.ts +286 -0
- package/src/components/alepha-table/__tests__/use-table-selection.browser.spec.tsx +1 -0
- package/src/components/alepha-table/alepha-table.tsx +362 -79
- package/src/components/alepha-table/paginate-local.ts +174 -0
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +1 -0
- package/src/components/app-shell/app-shell.tsx +42 -19
- package/src/components/auth/__tests__/auth-router.spec.ts +2 -1
- package/src/components/auth/auth-login.tsx +5 -16
- package/src/components/auth/auth-register.tsx +26 -25
- package/src/components/auth/auth-reset-password.tsx +24 -17
- package/src/components/auth/auth-router.tsx +4 -3
- package/src/components/auth/auth-verify-email.tsx +7 -7
- package/src/components/auth/safe-redirect.ts +14 -0
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +1 -0
- package/src/components/auto-form/auto-form.tsx +60 -39
- package/src/components/brand-icon/brand-icon.tsx +2 -2
- package/src/components/button-dark/button-dark.tsx +2 -2
- package/src/components/button-language/button-language.tsx +2 -2
- package/src/components/button-theme/button-theme.tsx +2 -2
- package/src/components/button-user/button-user.tsx +4 -4
- package/src/components/captcha/turnstile-widget.tsx +6 -5
- package/src/components/control/control.tsx +6 -6
- package/src/components/control-array/control-array.tsx +28 -15
- package/src/components/control-base/__tests__/form-field-a11y.browser.spec.tsx +1 -0
- package/src/components/control-base/field-i18n.ts +5 -3
- package/src/components/control-base/form-field.tsx +13 -13
- package/src/components/control-base/icon-hint.tsx +1 -1
- package/src/components/control-date/control-date.tsx +29 -6
- package/src/components/control-number/control-number.tsx +3 -3
- package/src/components/control-object/control-object.tsx +11 -8
- package/src/components/control-password/control-password.tsx +2 -2
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-deselect.browser.spec.tsx +1 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +1 -0
- package/src/components/control-select/control-select.tsx +32 -18
- package/src/components/control-upload/control-upload.tsx +16 -10
- package/src/components/detail/__tests__/detail-aside.browser.spec.tsx +135 -0
- package/src/components/detail/__tests__/detail-layout.browser.spec.tsx +151 -0
- package/src/components/detail/detail-aside.tsx +198 -0
- package/src/components/detail/detail-layout.tsx +181 -0
- package/src/components/detail/use-detail-tab.tsx +41 -0
- package/src/components/file-image/file-image.tsx +4 -2
- package/src/components/language-toggle/language-toggle.tsx +2 -2
- package/src/components/markdown-view/__tests__/markdown-view-mermaid.browser.spec.tsx +148 -0
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +1 -0
- package/src/components/markdown-view/diagram/DiagramErrorBoundary.tsx +42 -0
- package/src/components/markdown-view/diagram/FlowchartDiagram.tsx +136 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramCluster.tsx +59 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramEdge.tsx +95 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramLabel.tsx +58 -0
- package/src/components/markdown-view/diagram/FlowchartDiagramNode.tsx +78 -0
- package/src/components/markdown-view/diagram/MermaidFence.tsx +46 -0
- package/src/components/markdown-view/diagram/__tests__/flowchart-diagram.browser.spec.tsx +210 -0
- package/src/components/markdown-view/diagram/flowchartParser.spec.ts +379 -0
- package/src/components/markdown-view/diagram/flowchartParser.ts +475 -0
- package/src/components/markdown-view/diagram/graphModel.ts +72 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.spec.ts +235 -0
- package/src/components/markdown-view/diagram/layoutFlowchart.ts +324 -0
- package/src/components/markdown-view/diagram/textMetrics.spec.ts +128 -0
- package/src/components/markdown-view/diagram/textMetrics.ts +296 -0
- package/src/components/markdown-view/markdown-view.tsx +128 -9
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +1 -0
- package/src/components/nav-shell/nav-shell.tsx +6 -3
- package/src/components/nav-shell/spotlight.tsx +2 -1
- package/src/components/nav-shell/use-nav-breadcrumbs.ts +1 -0
- package/src/components/nav-shell/use-nav-entries.ts +16 -5
- package/src/components/nav-shell/use-nav-tree.ts +1 -0
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +1 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +1 -0
- package/src/components/settings/settings-card-edge.ts +24 -0
- package/src/components/settings/settings-danger-section.tsx +7 -1
- package/src/components/settings/settings-layout.tsx +16 -1
- package/src/components/settings/settings-nav.tsx +12 -3
- package/src/components/settings/settings-row.tsx +2 -2
- package/src/components/settings/settings-section.tsx +2 -1
- package/src/components/ui/accordion.tsx +3 -3
- package/src/components/ui/alert-dialog.tsx +5 -5
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/avatar.tsx +5 -5
- package/src/components/ui/badge.tsx +48 -2
- package/src/components/ui/breadcrumb.tsx +3 -3
- package/src/components/ui/button-group.tsx +2 -2
- package/src/components/ui/button.tsx +2 -2
- package/src/components/ui/calendar.tsx +8 -8
- package/src/components/ui/card.tsx +3 -3
- package/src/components/ui/carousel.tsx +30 -13
- package/src/components/ui/chart.tsx +18 -6
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/combobox.tsx +8 -9
- package/src/components/ui/command.tsx +6 -7
- package/src/components/ui/context-menu.tsx +8 -8
- package/src/components/ui/dialog.tsx +4 -4
- package/src/components/ui/drawer.tsx +4 -4
- package/src/components/ui/dropdown-menu.tsx +9 -9
- package/src/components/ui/empty.tsx +2 -2
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +6 -3
- package/src/components/ui/input-otp.tsx +3 -3
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/label.tsx +3 -0
- package/src/components/ui/menubar.tsx +9 -9
- package/src/components/ui/navigation-menu.tsx +7 -7
- package/src/components/ui/pagination.tsx +0 -1
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +3 -3
- package/src/components/ui/radio-group.tsx +2 -2
- package/src/components/ui/resizable.tsx +2 -2
- package/src/components/ui/scroll-area.tsx +2 -2
- package/src/components/ui/segmented.tsx +8 -3
- package/src/components/ui/select.tsx +8 -8
- package/src/components/ui/separator.tsx +1 -1
- package/src/components/ui/sheet.tsx +3 -3
- package/src/components/ui/sidebar.tsx +20 -20
- package/src/components/ui/skeleton.tsx +1 -1
- package/src/components/ui/slider.tsx +2 -2
- package/src/components/ui/switch.tsx +2 -2
- package/src/components/ui/table.tsx +10 -5
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +9 -4
- package/src/components/ui/toggle.tsx +2 -2
- package/src/components/ui/tooltip.tsx +13 -3
- package/src/components/use-dialog/use-dialog.tsx +19 -6
- package/src/components/use-toast/__tests__/use-toast.browser.spec.tsx +19 -0
- package/src/components/use-toast/use-toast.tsx +38 -26
- package/src/hooks/use-mobile.ts +27 -14
- package/src/lib/__tests__/i18n-fr.spec.ts +5 -1
- package/src/lib/i18n-fr.ts +18 -10
- package/src/styles.css +5 -5
|
@@ -6,8 +6,8 @@ import {
|
|
|
6
6
|
TurnstileWidget,
|
|
7
7
|
type TurnstileWidgetHandle,
|
|
8
8
|
} from "@alepha/ui/components/captcha/turnstile-widget";
|
|
9
|
-
import { Control } from "@alepha/ui/components/control/control";
|
|
10
9
|
import { iconFor } from "@alepha/ui/components/control-base/icon-hint";
|
|
10
|
+
import { Control } from "@alepha/ui/components/control/control";
|
|
11
11
|
import { Alert, AlertDescription } from "@alepha/ui/components/ui/alert";
|
|
12
12
|
import { Button } from "@alepha/ui/components/ui/button";
|
|
13
13
|
import { Card, CardContent } from "@alepha/ui/components/ui/card";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
InputOTPSlot,
|
|
18
18
|
} from "@alepha/ui/components/ui/input-otp";
|
|
19
19
|
import { Label } from "@alepha/ui/components/ui/label";
|
|
20
|
-
import { AlephaError, z } from "alepha";
|
|
20
|
+
import { AlephaError, SchemaValidationError, z } from "alepha";
|
|
21
21
|
import type {
|
|
22
22
|
PasswordResetIntentResponse,
|
|
23
23
|
RealmConfig,
|
|
@@ -31,6 +31,8 @@ import { useRouter } from "alepha/react/router";
|
|
|
31
31
|
import { AlertCircle, CheckCircle2, Info } from "lucide-react";
|
|
32
32
|
import { type ReactNode, useEffect, useRef, useState } from "react";
|
|
33
33
|
|
|
34
|
+
import { safeRedirect } from "./safe-redirect.ts";
|
|
35
|
+
|
|
34
36
|
export interface AuthResetPasswordProps {
|
|
35
37
|
/**
|
|
36
38
|
* Realm configuration (controls verification channel and password rules).
|
|
@@ -57,7 +59,7 @@ interface State {
|
|
|
57
59
|
code?: string;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
export
|
|
62
|
+
export const AuthResetPassword = (props: AuthResetPasswordProps) => {
|
|
61
63
|
const router = useRouter();
|
|
62
64
|
const { tr } = useI18n();
|
|
63
65
|
const userCtrl = useClient<UserController>();
|
|
@@ -65,7 +67,7 @@ export function AuthResetPassword(props: AuthResetPasswordProps) {
|
|
|
65
67
|
const [error, setError] = useState<string | null>(null);
|
|
66
68
|
const [submitting, setSubmitting] = useState(false);
|
|
67
69
|
const [code, setCode] = useState("");
|
|
68
|
-
const redirect = router.query.redirect
|
|
70
|
+
const redirect = safeRedirect(router.query.redirect);
|
|
69
71
|
|
|
70
72
|
const settings = props.realmConfig.settings;
|
|
71
73
|
const allowed = settings?.resetPasswordAllowed !== false;
|
|
@@ -94,10 +96,9 @@ export function AuthResetPassword(props: AuthResetPasswordProps) {
|
|
|
94
96
|
const [captchaToken, setCaptchaToken] = useState<string | undefined>();
|
|
95
97
|
const captchaRef = useRef<TurnstileWidgetHandle | null>(null);
|
|
96
98
|
/*
|
|
97
|
-
*
|
|
98
|
-
*
|
|
99
|
-
*
|
|
100
|
-
* time. Same reason, same fix as `auth-register.tsx`.
|
|
99
|
+
* The handler reads the token the widget issued last through a ref, so a
|
|
100
|
+
* submit never posts a token captured by an earlier render. Same shape as
|
|
101
|
+
* `auth-register.tsx`.
|
|
101
102
|
*/
|
|
102
103
|
const captchaTokenRef = useRef<string | undefined>(undefined);
|
|
103
104
|
useEffect(() => {
|
|
@@ -167,10 +168,16 @@ export function AuthResetPassword(props: AuthResetPasswordProps) {
|
|
|
167
168
|
[state.intent, state.code],
|
|
168
169
|
);
|
|
169
170
|
|
|
170
|
-
const
|
|
171
|
-
const
|
|
172
|
-
|
|
173
|
-
|
|
171
|
+
const emailState = useFormState(emailForm, ["loading", "error"]);
|
|
172
|
+
const passwordState = useFormState(passwordForm, ["loading", "error"]);
|
|
173
|
+
const emailSubmitting = emailState.loading;
|
|
174
|
+
const passwordSubmitting = passwordState.loading;
|
|
175
|
+
// A handler that throws (mismatched passwords, a wrong code, a refused
|
|
176
|
+
// captcha) lands in the form's error state, not in `error`; reading only
|
|
177
|
+
// `loading` showed nothing at all after a failed submit.
|
|
178
|
+
const submitError = [passwordState.error, emailState.error].find(
|
|
179
|
+
(err) => err && !(err instanceof SchemaValidationError),
|
|
180
|
+
)?.message;
|
|
174
181
|
|
|
175
182
|
const handleCodeSubmit = () => {
|
|
176
183
|
if (code.length === 6) {
|
|
@@ -213,15 +220,15 @@ export function AuthResetPassword(props: AuthResetPasswordProps) {
|
|
|
213
220
|
<img
|
|
214
221
|
src={settings.logoUrl}
|
|
215
222
|
alt={settings.displayName || props.realmConfig.realmName}
|
|
216
|
-
className="size-16 rounded-xl border
|
|
223
|
+
className="bg-muted size-16 rounded-xl border object-cover shadow-sm"
|
|
217
224
|
/>
|
|
218
225
|
) : null)}
|
|
219
226
|
<Card className="w-full">
|
|
220
227
|
<CardContent className="flex flex-col gap-4">
|
|
221
|
-
{error && (
|
|
228
|
+
{(error ?? submitError) && (
|
|
222
229
|
<Alert variant="destructive">
|
|
223
230
|
<AlertCircle className="size-4" />
|
|
224
|
-
<AlertDescription>{error}</AlertDescription>
|
|
231
|
+
<AlertDescription>{error ?? submitError}</AlertDescription>
|
|
225
232
|
</Alert>
|
|
226
233
|
)}
|
|
227
234
|
{!allowed ? (
|
|
@@ -302,7 +309,7 @@ export function AuthResetPassword(props: AuthResetPasswordProps) {
|
|
|
302
309
|
<InputOTP
|
|
303
310
|
id="code"
|
|
304
311
|
maxLength={6}
|
|
305
|
-
|
|
312
|
+
|
|
306
313
|
value={code}
|
|
307
314
|
onChange={(value) => setCode(value.replace(/\D/g, ""))}
|
|
308
315
|
>
|
|
@@ -419,4 +426,4 @@ export function AuthResetPassword(props: AuthResetPasswordProps) {
|
|
|
419
426
|
</div>
|
|
420
427
|
</div>
|
|
421
428
|
);
|
|
422
|
-
}
|
|
429
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { RealmController } from "alepha/api/users";
|
|
2
2
|
import { $page } from "alepha/react/router";
|
|
3
3
|
import { $client } from "alepha/server/links";
|
|
4
|
+
|
|
4
5
|
import { AuthLogin } from "./auth-login.tsx";
|
|
5
6
|
import { AuthRegister } from "./auth-register.tsx";
|
|
6
7
|
import { AuthResetPassword } from "./auth-reset-password.tsx";
|
|
@@ -28,8 +29,8 @@ import { AuthVerifyEmail } from "./auth-verify-email.tsx";
|
|
|
28
29
|
* `@alepha/mantine/auth/AuthRouter` used to do exactly this, and was deleted with
|
|
29
30
|
* Mantine without being ported. What survived were the components — the bricks
|
|
30
31
|
* without the thing that assembled them — so every application rebuilt the same
|
|
31
|
-
* four pages by hand: `apps/lore` in 414 lines across two files, `apps/shop` in
|
|
32
|
-
* three more. `apps/shop` has since been moved onto this router and deleted its
|
|
32
|
+
* four pages by hand: `apps/lore` in 414 lines across two files, `apps/examples/shop` in
|
|
33
|
+
* three more. `apps/examples/shop` has since been moved onto this router and deleted its
|
|
33
34
|
* three; `apps/lore` still has its own.
|
|
34
35
|
*
|
|
35
36
|
* Worse, the components kept the old router's paths as their fallbacks
|
|
@@ -45,7 +46,7 @@ import { AuthVerifyEmail } from "./auth-verify-email.tsx";
|
|
|
45
46
|
* `/compte/connexion` for a French storefront — writes its own router and passes
|
|
46
47
|
* the components' path props itself; that stays entirely supported, and this
|
|
47
48
|
* class is a readable reference for what wiring it by hand involves. It is a real
|
|
48
|
-
* trade rather than a free one: `apps/shop` made exactly that choice, then gave
|
|
49
|
+
* trade rather than a free one: `apps/examples/shop` made exactly that choice, then gave
|
|
49
50
|
* it up for this router, because the French URLs also cost it a bespoke auth
|
|
50
51
|
* layout, four hand-kept cross-links and the `verify-email` page it never got
|
|
51
52
|
* round to writing.
|
|
@@ -29,16 +29,16 @@ export interface AuthVerifyEmailProps {
|
|
|
29
29
|
logo?: ReactNode;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
export
|
|
32
|
+
export const AuthVerifyEmail = (props: AuthVerifyEmailProps) => {
|
|
33
33
|
if (props.step) {
|
|
34
34
|
return (
|
|
35
35
|
<View step={props.step} loginPath={props.loginPath} logo={props.logo} />
|
|
36
36
|
);
|
|
37
37
|
}
|
|
38
38
|
return <Stateful loginPath={props.loginPath} logo={props.logo} />;
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const Stateful = (props: { loginPath?: string; logo?: ReactNode }) => {
|
|
42
42
|
const state = useRouterState();
|
|
43
43
|
const { tr } = useI18n();
|
|
44
44
|
const userCtrl = useClient<UserController>();
|
|
@@ -85,14 +85,14 @@ function Stateful(props: { loginPath?: string; logo?: ReactNode }) {
|
|
|
85
85
|
logo={props.logo}
|
|
86
86
|
/>
|
|
87
87
|
);
|
|
88
|
-
}
|
|
88
|
+
};
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
const View = (props: {
|
|
91
91
|
step: VerifyEmailStep;
|
|
92
92
|
error?: string | null;
|
|
93
93
|
loginPath?: string;
|
|
94
94
|
logo?: ReactNode;
|
|
95
|
-
}) {
|
|
95
|
+
}) => {
|
|
96
96
|
const { tr } = useI18n();
|
|
97
97
|
return (
|
|
98
98
|
<div className="flex min-h-svh flex-1 items-center justify-center p-6">
|
|
@@ -176,4 +176,4 @@ function View(props: {
|
|
|
176
176
|
</div>
|
|
177
177
|
</div>
|
|
178
178
|
);
|
|
179
|
-
}
|
|
179
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Filter a `?redirect=` query value to a safe in-app destination:
|
|
3
|
+
* - only a same-origin absolute path (a single leading `/`);
|
|
4
|
+
* - never `//evil.example`, a full URL, or a backslash a browser would
|
|
5
|
+
* normalise into one (the open-redirect surface);
|
|
6
|
+
* - never `/auth/*`, which would bounce the user back into the auth flow.
|
|
7
|
+
*/
|
|
8
|
+
export const safeRedirect = (raw: string | string[] | undefined): string => {
|
|
9
|
+
if (typeof raw !== "string" || raw.length === 0) return "/";
|
|
10
|
+
if (!raw.startsWith("/") || raw.startsWith("//")) return "/";
|
|
11
|
+
if (raw.includes("\\")) return "/";
|
|
12
|
+
if (raw.startsWith("/auth/")) return "/";
|
|
13
|
+
return raw;
|
|
14
|
+
};
|
|
@@ -6,6 +6,7 @@ import { useForm } from "alepha/react/form";
|
|
|
6
6
|
import { AlephaReactI18n } from "alepha/react/i18n";
|
|
7
7
|
import type { ReactNode } from "react";
|
|
8
8
|
import { describe, expect, it } from "vitest";
|
|
9
|
+
|
|
9
10
|
import { AutoForm, type AutoFormProps } from "../auto-form.tsx";
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -2,10 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
void React;
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
Control,
|
|
7
|
-
type ControlProps,
|
|
8
|
-
} from "@alepha/ui/components/control/control";
|
|
9
5
|
import {
|
|
10
6
|
FormFieldAutoSaveProvider,
|
|
11
7
|
FormFieldLayoutProvider,
|
|
@@ -13,6 +9,10 @@ import {
|
|
|
13
9
|
} from "@alepha/ui/components/control-base/form-field";
|
|
14
10
|
import { spanClass, widthFor } from "@alepha/ui/components/control-base/grid";
|
|
15
11
|
import { iconFor } from "@alepha/ui/components/control-base/icon-hint";
|
|
12
|
+
import {
|
|
13
|
+
Control,
|
|
14
|
+
type ControlProps,
|
|
15
|
+
} from "@alepha/ui/components/control/control";
|
|
16
16
|
import { SettingsHeading } from "@alepha/ui/components/settings/settings-heading";
|
|
17
17
|
import { Button } from "@alepha/ui/components/ui/button";
|
|
18
18
|
import {
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
PopoverTrigger,
|
|
29
29
|
} from "@alepha/ui/components/ui/popover";
|
|
30
30
|
import { cn } from "@alepha/ui/lib/utils";
|
|
31
|
-
import { type ZObject, z } from "alepha";
|
|
31
|
+
import { type ZObject, type ZType, z } from "alepha";
|
|
32
32
|
import { useAlepha } from "alepha/react";
|
|
33
33
|
import {
|
|
34
34
|
type BaseInputField,
|
|
@@ -46,9 +46,13 @@ import { type ReactNode, useEffect, useMemo, useState } from "react";
|
|
|
46
46
|
*/
|
|
47
47
|
function isStringSchema(schema: unknown): boolean {
|
|
48
48
|
if (!schema || typeof schema !== "object") return false;
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
// Zod, not JSON Schema: `z.string().optional()` has no `type: "string"`,
|
|
50
|
+
// so the optional text fields of a form used to auto-save every keystroke.
|
|
51
|
+
const inner = z.schema.unwrap(schema as ZType);
|
|
52
|
+
if (z.schema.isString(inner)) return true;
|
|
53
|
+
if (z.schema.isUnion(inner)) {
|
|
54
|
+
return z.schema.options(inner).some(isStringSchema);
|
|
55
|
+
}
|
|
52
56
|
return false;
|
|
53
57
|
}
|
|
54
58
|
|
|
@@ -59,9 +63,11 @@ function isStringSchema(schema: unknown): boolean {
|
|
|
59
63
|
*/
|
|
60
64
|
function isEnumSchema(schema: unknown): boolean {
|
|
61
65
|
if (!schema || typeof schema !== "object") return false;
|
|
62
|
-
const
|
|
63
|
-
if (
|
|
64
|
-
if (
|
|
66
|
+
const inner = z.schema.unwrap(schema as ZType);
|
|
67
|
+
if (z.schema.isEnum(inner)) return true;
|
|
68
|
+
if (z.schema.isUnion(inner)) {
|
|
69
|
+
return z.schema.options(inner).some(isEnumSchema);
|
|
70
|
+
}
|
|
65
71
|
return false;
|
|
66
72
|
}
|
|
67
73
|
|
|
@@ -528,7 +534,7 @@ export function AutoForm<T extends ZObject>(props: AutoFormProps<T>) {
|
|
|
528
534
|
<form {...props.form.props} className={props.className}>
|
|
529
535
|
<div className="flex flex-col gap-4">
|
|
530
536
|
{hasHeader && (
|
|
531
|
-
<div className="bg-muted/40
|
|
537
|
+
<div className="bg-muted/40 flex items-start gap-3 rounded-md border p-4">
|
|
532
538
|
{HeaderIcon && (
|
|
533
539
|
<div className="bg-primary/10 text-primary flex size-10 shrink-0 items-center justify-center rounded-full">
|
|
534
540
|
<HeaderIcon className="size-5" />
|
|
@@ -581,7 +587,7 @@ interface GroupBlockProps {
|
|
|
581
587
|
bottomBar?: ReactNode;
|
|
582
588
|
}
|
|
583
589
|
|
|
584
|
-
|
|
590
|
+
const GroupBlock = (props: GroupBlockProps) => {
|
|
585
591
|
const { group } = props;
|
|
586
592
|
const { tr } = useI18n();
|
|
587
593
|
const Icon = group.icon ? iconFor(group.icon) : undefined;
|
|
@@ -728,7 +734,7 @@ function GroupBlock(props: GroupBlockProps) {
|
|
|
728
734
|
</div>
|
|
729
735
|
</div>
|
|
730
736
|
);
|
|
731
|
-
}
|
|
737
|
+
};
|
|
732
738
|
|
|
733
739
|
// ──────────────────────────────────────────────────────────────────────
|
|
734
740
|
|
|
@@ -750,14 +756,14 @@ interface BottomBarProps {
|
|
|
750
756
|
bare?: boolean;
|
|
751
757
|
}
|
|
752
758
|
|
|
753
|
-
|
|
759
|
+
const BottomBar = (props: BottomBarProps) => {
|
|
754
760
|
const { tr } = useI18n();
|
|
755
761
|
return (
|
|
756
762
|
<div
|
|
757
763
|
className={
|
|
758
764
|
props.bare
|
|
759
765
|
? "flex w-full items-center gap-2"
|
|
760
|
-
: "bg-card flex items-center gap-2
|
|
766
|
+
: "bg-card flex items-center gap-2 rounded-md border p-2"
|
|
761
767
|
}
|
|
762
768
|
>
|
|
763
769
|
{props.onCancel && (
|
|
@@ -767,7 +773,7 @@ function BottomBar(props: BottomBarProps) {
|
|
|
767
773
|
onClick={props.onCancel}
|
|
768
774
|
disabled={props.disabled}
|
|
769
775
|
>
|
|
770
|
-
<X className="size-4
|
|
776
|
+
<X className="mr-1 size-4" />
|
|
771
777
|
{tr("autoForm.cancel", { default: "Cancel" })}
|
|
772
778
|
</Button>
|
|
773
779
|
)}
|
|
@@ -797,7 +803,7 @@ function BottomBar(props: BottomBarProps) {
|
|
|
797
803
|
onClick={() => action.onClick()}
|
|
798
804
|
disabled={props.disabled || action.disabled}
|
|
799
805
|
>
|
|
800
|
-
{Icon && <Icon className="size-4
|
|
806
|
+
{Icon && <Icon className="mr-1 size-4" />}
|
|
801
807
|
{action.label}
|
|
802
808
|
</Button>
|
|
803
809
|
);
|
|
@@ -819,7 +825,7 @@ function BottomBar(props: BottomBarProps) {
|
|
|
819
825
|
</div>
|
|
820
826
|
</div>
|
|
821
827
|
);
|
|
822
|
-
}
|
|
828
|
+
};
|
|
823
829
|
|
|
824
830
|
// ──────────────────────────────────────────────────────────────────────
|
|
825
831
|
|
|
@@ -827,14 +833,15 @@ interface FormErrorPopoverProps {
|
|
|
827
833
|
form: FormModel<ZObject>;
|
|
828
834
|
}
|
|
829
835
|
|
|
830
|
-
|
|
836
|
+
const FormErrorPopover = (props: FormErrorPopoverProps) => {
|
|
831
837
|
const { error } = useFormState(props.form, ["error"]);
|
|
832
838
|
const { tr } = useI18n();
|
|
833
839
|
const [open, setOpen] = useState(false);
|
|
834
|
-
//
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
840
|
+
// Close the popover when the error clears. Guarded on `open`, so it settles
|
|
841
|
+
// in one pass and does not need an effect.
|
|
842
|
+
if (!error && open) {
|
|
843
|
+
setOpen(false);
|
|
844
|
+
}
|
|
838
845
|
|
|
839
846
|
if (!error) return null;
|
|
840
847
|
|
|
@@ -856,7 +863,7 @@ function FormErrorPopover(props: FormErrorPopoverProps) {
|
|
|
856
863
|
<AlertCircle className="size-4" />
|
|
857
864
|
</PopoverTrigger>
|
|
858
865
|
<PopoverContent align="end" className="w-80 p-2">
|
|
859
|
-
<p className="text-destructive text-sm font-medium
|
|
866
|
+
<p className="text-destructive px-2 py-1 text-sm font-medium">
|
|
860
867
|
{items.length === 1
|
|
861
868
|
? tr("autoForm.error", { default: "Error" })
|
|
862
869
|
: tr("autoForm.errors", { default: "Errors" })}
|
|
@@ -867,7 +874,7 @@ function FormErrorPopover(props: FormErrorPopoverProps) {
|
|
|
867
874
|
<button
|
|
868
875
|
type="button"
|
|
869
876
|
onClick={() => focusError(it.path, props.form.id)}
|
|
870
|
-
className="hover:bg-accent w-full rounded text-left text-xs
|
|
877
|
+
className="hover:bg-accent w-full rounded px-2 py-1 text-left text-xs"
|
|
871
878
|
>
|
|
872
879
|
<span className="font-medium">
|
|
873
880
|
{it.path || tr("autoForm.formLabel", { default: "Form" })}
|
|
@@ -880,7 +887,7 @@ function FormErrorPopover(props: FormErrorPopoverProps) {
|
|
|
880
887
|
</PopoverContent>
|
|
881
888
|
</Popover>
|
|
882
889
|
);
|
|
883
|
-
}
|
|
890
|
+
};
|
|
884
891
|
|
|
885
892
|
interface ErrorItem {
|
|
886
893
|
path: string;
|
|
@@ -897,11 +904,25 @@ const collectErrors = (error: Error): ErrorItem[] => {
|
|
|
897
904
|
};
|
|
898
905
|
|
|
899
906
|
const focusError = (path: string, formId: string) => {
|
|
900
|
-
const
|
|
901
|
-
if (
|
|
907
|
+
const segments = path.split("/").filter(Boolean);
|
|
908
|
+
if (segments.length === 0) return;
|
|
909
|
+
const dotted = segments.join(".");
|
|
910
|
+
// ControlArray names its item fields `items[0].email` and joins their ids
|
|
911
|
+
// with `-`; the dotted forms are what every other control renders.
|
|
912
|
+
const bracketed = segments
|
|
913
|
+
.map((segment, i) =>
|
|
914
|
+
i === 0
|
|
915
|
+
? segment
|
|
916
|
+
: /^\d+$/.test(segment)
|
|
917
|
+
? `[${segment}]`
|
|
918
|
+
: `.${segment}`,
|
|
919
|
+
)
|
|
920
|
+
.join("");
|
|
902
921
|
const el =
|
|
903
|
-
document.getElementById(`${formId}-${
|
|
904
|
-
document.
|
|
922
|
+
document.getElementById(`${formId}-${dotted}`) ??
|
|
923
|
+
document.getElementById(`${formId}-${segments.join("-")}`) ??
|
|
924
|
+
document.querySelector<HTMLElement>(`[name="${dotted}"]`) ??
|
|
925
|
+
document.querySelector<HTMLElement>(`[name="${bracketed}"]`);
|
|
905
926
|
el?.focus();
|
|
906
927
|
};
|
|
907
928
|
|
|
@@ -912,7 +933,9 @@ const autoGroupSchema = (
|
|
|
912
933
|
opts: {
|
|
913
934
|
defaultTitle?: string;
|
|
914
935
|
defaultIcon?: string;
|
|
915
|
-
/**
|
|
936
|
+
/**
|
|
937
|
+
* Translator for the fallback group title (the helper is hook-free).
|
|
938
|
+
*/
|
|
916
939
|
tr?: (key: string, options?: { default?: string }) => string;
|
|
917
940
|
},
|
|
918
941
|
): AutoFormGroup[] => {
|
|
@@ -927,17 +950,15 @@ const autoGroupSchema = (
|
|
|
927
950
|
const groups: AutoFormGroup[] = [];
|
|
928
951
|
|
|
929
952
|
for (const [key, prop] of Object.entries(z.schema.shape(schema))) {
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
element?: unknown;
|
|
934
|
-
};
|
|
935
|
-
const isObject = p.type === "object";
|
|
953
|
+
// Classify the unwrapped schema: an optional object is still an object.
|
|
954
|
+
const inner = z.schema.unwrap(prop);
|
|
955
|
+
const isObject = z.schema.isObject(inner);
|
|
936
956
|
// An array of a UNION of objects is a complex field too — without this it
|
|
937
957
|
// lands in the "General" grid and gets a third of a row to render a list
|
|
938
958
|
// of object editors in.
|
|
939
959
|
const isArrayOfObjects =
|
|
940
|
-
|
|
960
|
+
z.schema.isArray(inner) &&
|
|
961
|
+
isObjectOrUnionOfObjects(z.schema.element(inner));
|
|
941
962
|
if (isObject || isArrayOfObjects) {
|
|
942
963
|
// Solo complex fields render their own header (label + description +
|
|
943
964
|
// chevron + add/init), so we skip the group bar to avoid a
|
|
@@ -20,7 +20,7 @@ export interface BrandIconProps extends SVGProps<SVGSVGElement> {
|
|
|
20
20
|
* color and read on both light and dark surfaces. Google uses its official
|
|
21
21
|
* multicolor mark. Unknown providers fall back to a `currentColor` globe.
|
|
22
22
|
*/
|
|
23
|
-
export
|
|
23
|
+
export const BrandIcon = (props: BrandIconProps) => {
|
|
24
24
|
const { provider, className, ...rest } = props;
|
|
25
25
|
const cls = cn("size-4 shrink-0", className);
|
|
26
26
|
|
|
@@ -101,4 +101,4 @@ export function BrandIcon(props: BrandIconProps) {
|
|
|
101
101
|
</svg>
|
|
102
102
|
);
|
|
103
103
|
}
|
|
104
|
-
}
|
|
104
|
+
};
|
|
@@ -47,7 +47,7 @@ const NEXT: Record<"light" | "dark" | "system", "light" | "dark" | "system"> = {
|
|
|
47
47
|
* three-state `light → dark → system` cycle with `withSystem`.
|
|
48
48
|
* Reads/writes the persisted UI cookie via `useColorMode()`.
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export const ButtonDark = (props: ButtonDarkProps) => {
|
|
51
51
|
const { mode, resolved, setMode } = useColorMode();
|
|
52
52
|
const onClick = () => {
|
|
53
53
|
if (props.withSystem) {
|
|
@@ -75,4 +75,4 @@ export function ButtonDark(props: ButtonDarkProps) {
|
|
|
75
75
|
<TooltipContent>{label}</TooltipContent>
|
|
76
76
|
</Tooltip>
|
|
77
77
|
);
|
|
78
|
-
}
|
|
78
|
+
};
|
|
@@ -39,7 +39,7 @@ export interface ButtonLanguageProps {
|
|
|
39
39
|
*
|
|
40
40
|
* Renders nothing when only one language is registered.
|
|
41
41
|
*/
|
|
42
|
-
export
|
|
42
|
+
export const ButtonLanguage = (props: ButtonLanguageProps) => {
|
|
43
43
|
const i18n = useI18n();
|
|
44
44
|
const languages = i18n.languages;
|
|
45
45
|
|
|
@@ -95,4 +95,4 @@ export function ButtonLanguage(props: ButtonLanguageProps) {
|
|
|
95
95
|
</DropdownMenuContent>
|
|
96
96
|
</DropdownMenu>
|
|
97
97
|
);
|
|
98
|
-
}
|
|
98
|
+
};
|
|
@@ -55,7 +55,7 @@ export interface ButtonThemeProps {
|
|
|
55
55
|
* `<head>` (id `alepha-theme-fonts`); switching themes swaps it. No effect
|
|
56
56
|
* when the list has 0 or 1 entries.
|
|
57
57
|
*/
|
|
58
|
-
export
|
|
58
|
+
export const ButtonTheme = (props: ButtonThemeProps) => {
|
|
59
59
|
const { theme, setTheme } = useTheme();
|
|
60
60
|
const [list] = useStore(uiThemeListAtom);
|
|
61
61
|
const themes = list ?? [];
|
|
@@ -127,7 +127,7 @@ export function ButtonTheme(props: ButtonThemeProps) {
|
|
|
127
127
|
</DropdownMenuContent>
|
|
128
128
|
</DropdownMenu>
|
|
129
129
|
);
|
|
130
|
-
}
|
|
130
|
+
};
|
|
131
131
|
|
|
132
132
|
interface ThemeSwatchProps {
|
|
133
133
|
colors: string[];
|
|
@@ -23,8 +23,8 @@ import type { ReactNode } from "react";
|
|
|
23
23
|
export interface ButtonUserProps {
|
|
24
24
|
/**
|
|
25
25
|
* Custom menu items rendered between the email header and the logout
|
|
26
|
-
* footer. When omitted, a default menu is rendered: email + admin
|
|
27
|
-
* permitted) + logout. When provided, the consumer is responsible for the
|
|
26
|
+
* footer. When omitted, a default menu is rendered: email + account + admin
|
|
27
|
+
* (when permitted) + logout. When provided, the consumer is responsible for the
|
|
28
28
|
* full layout — use `ButtonUser.Email`, `ButtonUser.AdminMenuItem`,
|
|
29
29
|
* `ButtonUser.LogoutMenuItem` as building blocks.
|
|
30
30
|
*/
|
|
@@ -75,7 +75,7 @@ export interface ButtonUserProps {
|
|
|
75
75
|
* <ButtonUser.LogoutMenuItem />
|
|
76
76
|
* </ButtonUser>
|
|
77
77
|
*/
|
|
78
|
-
export
|
|
78
|
+
export const ButtonUser = (props: ButtonUserProps) => {
|
|
79
79
|
const auth = useAuth();
|
|
80
80
|
|
|
81
81
|
if (!auth.user) {
|
|
@@ -126,7 +126,7 @@ export function ButtonUser(props: ButtonUserProps) {
|
|
|
126
126
|
</DropdownMenuContent>
|
|
127
127
|
</DropdownMenu>
|
|
128
128
|
);
|
|
129
|
-
}
|
|
129
|
+
};
|
|
130
130
|
|
|
131
131
|
interface DefaultMenuProps {
|
|
132
132
|
onAdminClick?: () => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { AlephaError } from "alepha";
|
|
1
2
|
import { type Ref, useEffect, useImperativeHandle, useRef } from "react";
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -39,7 +40,7 @@ const loadTurnstile = (): Promise<void> => {
|
|
|
39
40
|
existing.addEventListener("load", () => resolve());
|
|
40
41
|
existing.addEventListener("error", () => {
|
|
41
42
|
turnstileLoader = undefined;
|
|
42
|
-
reject(new
|
|
43
|
+
reject(new AlephaError("Turnstile script failed to load"));
|
|
43
44
|
});
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
@@ -51,7 +52,7 @@ const loadTurnstile = (): Promise<void> => {
|
|
|
51
52
|
s.onload = () => resolve();
|
|
52
53
|
s.onerror = () => {
|
|
53
54
|
turnstileLoader = undefined;
|
|
54
|
-
reject(new
|
|
55
|
+
reject(new AlephaError("Turnstile script failed to load"));
|
|
55
56
|
};
|
|
56
57
|
document.head.appendChild(s);
|
|
57
58
|
});
|
|
@@ -96,9 +97,9 @@ export interface TurnstileWidgetProps {
|
|
|
96
97
|
* // on submit failure: widget.current?.reset();
|
|
97
98
|
* ```
|
|
98
99
|
*/
|
|
99
|
-
export
|
|
100
|
+
export const TurnstileWidget = (
|
|
100
101
|
props: TurnstileWidgetProps & { ref?: Ref<TurnstileWidgetHandle> },
|
|
101
|
-
) {
|
|
102
|
+
) => {
|
|
102
103
|
const containerRef = useRef<HTMLDivElement | null>(null);
|
|
103
104
|
const widgetIdRef = useRef<string | undefined>(undefined);
|
|
104
105
|
// The render effect must not re-run when the parent passes a fresh
|
|
@@ -154,4 +155,4 @@ export function TurnstileWidget(
|
|
|
154
155
|
return (
|
|
155
156
|
<div ref={containerRef} data-testid="captcha" className={props.className} />
|
|
156
157
|
);
|
|
157
|
-
}
|
|
158
|
+
};
|
|
@@ -248,7 +248,7 @@ export interface ControlProps {
|
|
|
248
248
|
* `useForm`, evaluates `schema.$control` (object or function), merges the
|
|
249
249
|
* result with explicit props, and dispatches to the right sub-control.
|
|
250
250
|
*/
|
|
251
|
-
export
|
|
251
|
+
export const Control = (props: ControlProps) => {
|
|
252
252
|
const form = useFormState(props.input, ["error", "dirty"]);
|
|
253
253
|
const autoSaveEnabled = useFormFieldAutoSave();
|
|
254
254
|
const rowLayout = useFormFieldLayout() === "row";
|
|
@@ -509,7 +509,7 @@ export function Control(props: ControlProps) {
|
|
|
509
509
|
disabled={merged.disabled}
|
|
510
510
|
maxLength={maxLength || undefined}
|
|
511
511
|
autoComplete={merged.autoComplete}
|
|
512
|
-
|
|
512
|
+
|
|
513
513
|
placeholder={merged.placeholder}
|
|
514
514
|
value={String(value ?? "")}
|
|
515
515
|
onChange={(e) => setValue(e.target.value)}
|
|
@@ -535,7 +535,7 @@ export function Control(props: ControlProps) {
|
|
|
535
535
|
required={meta.required}
|
|
536
536
|
disabled={merged.disabled}
|
|
537
537
|
autoComplete={merged.autoComplete}
|
|
538
|
-
|
|
538
|
+
|
|
539
539
|
inputProps={merged.inputProps}
|
|
540
540
|
icon={resolveIcon(merged.icon, "password")}
|
|
541
541
|
value={String(value ?? "")}
|
|
@@ -592,7 +592,7 @@ export function Control(props: ControlProps) {
|
|
|
592
592
|
>
|
|
593
593
|
<div className="relative">
|
|
594
594
|
{Icon && (
|
|
595
|
-
<Icon className="text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2
|
|
595
|
+
<Icon className="text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2" />
|
|
596
596
|
)}
|
|
597
597
|
<Input
|
|
598
598
|
{...merged.inputProps}
|
|
@@ -607,7 +607,7 @@ export function Control(props: ControlProps) {
|
|
|
607
607
|
type={htmlType}
|
|
608
608
|
disabled={merged.disabled}
|
|
609
609
|
autoComplete={autoComplete}
|
|
610
|
-
|
|
610
|
+
|
|
611
611
|
placeholder={merged.placeholder}
|
|
612
612
|
value={String(value ?? "")}
|
|
613
613
|
minLength={meta.constraints.minLength}
|
|
@@ -654,7 +654,7 @@ export function Control(props: ControlProps) {
|
|
|
654
654
|
</div>
|
|
655
655
|
</FormField>,
|
|
656
656
|
);
|
|
657
|
-
}
|
|
657
|
+
};
|
|
658
658
|
|
|
659
659
|
const useDynamicControlRefresh = (input: BaseInputField | undefined) => {
|
|
660
660
|
const alepha = useAlepha();
|