@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
|
@@ -9,12 +9,12 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
* variant renders as a settings-style row without prop drilling.
|
|
10
10
|
*/
|
|
11
11
|
const FormFieldLayoutContext = createContext("stack");
|
|
12
|
-
|
|
12
|
+
const FormFieldLayoutProvider = (props) => {
|
|
13
13
|
return /* @__PURE__ */ jsx(FormFieldLayoutContext.Provider, {
|
|
14
14
|
value: props.value,
|
|
15
15
|
children: props.children
|
|
16
16
|
});
|
|
17
|
-
}
|
|
17
|
+
};
|
|
18
18
|
/**
|
|
19
19
|
* Read the ambient layout (see {@link FormFieldLayoutProvider}).
|
|
20
20
|
*
|
|
@@ -31,12 +31,12 @@ function useFormFieldLayout() {
|
|
|
31
31
|
* unless explicitly placed inside this provider.
|
|
32
32
|
*/
|
|
33
33
|
const FormFieldAutoSaveContext = createContext(false);
|
|
34
|
-
|
|
34
|
+
const FormFieldAutoSaveProvider = (props) => {
|
|
35
35
|
return /* @__PURE__ */ jsx(FormFieldAutoSaveContext.Provider, {
|
|
36
36
|
value: props.value,
|
|
37
37
|
children: props.children
|
|
38
38
|
});
|
|
39
|
-
}
|
|
39
|
+
};
|
|
40
40
|
/**
|
|
41
41
|
* Read the ambient auto-save flag (see {@link FormFieldAutoSaveProvider}).
|
|
42
42
|
*/
|
|
@@ -56,12 +56,12 @@ function useFormFieldAutoSave() {
|
|
|
56
56
|
* field stops announcing that it is required.
|
|
57
57
|
*/
|
|
58
58
|
const FormFieldRequiredMarkerContext = createContext(true);
|
|
59
|
-
|
|
59
|
+
const FormFieldRequiredMarkerProvider = (props) => {
|
|
60
60
|
return /* @__PURE__ */ jsx(FormFieldRequiredMarkerContext.Provider, {
|
|
61
61
|
value: props.value,
|
|
62
62
|
children: props.children
|
|
63
63
|
});
|
|
64
|
-
}
|
|
64
|
+
};
|
|
65
65
|
/**
|
|
66
66
|
* Read the ambient required-marker flag (see
|
|
67
67
|
* {@link FormFieldRequiredMarkerProvider}).
|
|
@@ -116,7 +116,7 @@ function useFormFieldA11y() {
|
|
|
116
116
|
* `<textarea>`, or trigger button via the `data-invalid` attribute (so we
|
|
117
117
|
* don't have to thread `error` through every leaf widget).
|
|
118
118
|
*/
|
|
119
|
-
|
|
119
|
+
const FormField = (props) => {
|
|
120
120
|
const ambient = useContext(FormFieldLayoutContext);
|
|
121
121
|
const layout = props.layout ?? ambient;
|
|
122
122
|
const requiredMarker = useFormFieldRequiredMarker();
|
|
@@ -159,7 +159,7 @@ function FormField(props) {
|
|
|
159
159
|
}),
|
|
160
160
|
props.error && /* @__PURE__ */ jsxs("p", {
|
|
161
161
|
id: errorId,
|
|
162
|
-
className: "text-destructive
|
|
162
|
+
className: "text-destructive flex items-center gap-1 text-xs",
|
|
163
163
|
role: "alert",
|
|
164
164
|
children: [/* @__PURE__ */ jsx("span", {
|
|
165
165
|
"aria-hidden": true,
|
|
@@ -192,7 +192,7 @@ function FormField(props) {
|
|
|
192
192
|
}),
|
|
193
193
|
props.error && /* @__PURE__ */ jsxs("p", {
|
|
194
194
|
id: errorId,
|
|
195
|
-
className: "text-destructive
|
|
195
|
+
className: "text-destructive flex items-center gap-1 text-xs",
|
|
196
196
|
role: "alert",
|
|
197
197
|
children: [/* @__PURE__ */ jsx("span", {
|
|
198
198
|
"aria-hidden": true,
|
|
@@ -201,7 +201,7 @@ function FormField(props) {
|
|
|
201
201
|
})
|
|
202
202
|
]
|
|
203
203
|
});
|
|
204
|
-
}
|
|
204
|
+
};
|
|
205
205
|
//#endregion
|
|
206
206
|
export { FormField, FormFieldAutoSaveProvider, FormFieldLayoutProvider, FormFieldRequiredMarkerProvider, formFieldAriaProps, formFieldDescriptionId, formFieldErrorId, useFormFieldA11y, useFormFieldAutoSave, useFormFieldLayout, useFormFieldRequiredMarker };
|
|
207
207
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-field.js","names":[],"sources":["../../../src/components/control-base/form-field.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { Label } from \"@alepha/ui/components/ui/label\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\nexport type FormFieldLayout = \"stack\" | \"row\";\n\n/**\n * Ambient layout for every nested `<FormField>`. Defaults to `\"stack\"`.\n * `<AutoForm layout=\"row\">` wraps its tree in this context so every Control\n * variant renders as a settings-style row without prop drilling.\n */\nconst FormFieldLayoutContext = createContext<FormFieldLayout>(\"stack\");\n\nexport function FormFieldLayoutProvider(props: {\n value: FormFieldLayout;\n children: ReactNode;\n}) {\n return (\n <FormFieldLayoutContext.Provider value={props.value}>\n {props.children}\n </FormFieldLayoutContext.Provider>\n );\n}\n\n/**\n * Read the ambient layout (see {@link FormFieldLayoutProvider}).\n *\n * `<FormField>` reads this itself, so a widget only needs the hook when it\n * sizes or arranges something *around* its FormField — `<Control>` uses it to\n * give text inputs the settings-row column width.\n */\nexport function useFormFieldLayout(): FormFieldLayout {\n return useContext(FormFieldLayoutContext);\n}\n\n/**\n * Ambient flag enabling the inline save (tick) affordance on text Controls.\n * Set by `<AutoForm autoSave>`; standalone Controls never show the tick\n * unless explicitly placed inside this provider.\n */\nconst FormFieldAutoSaveContext = createContext<boolean>(false);\n\nexport function FormFieldAutoSaveProvider(props: {\n value: boolean;\n children: ReactNode;\n}) {\n return (\n <FormFieldAutoSaveContext.Provider value={props.value}>\n {props.children}\n </FormFieldAutoSaveContext.Provider>\n );\n}\n\n/**\n * Read the ambient auto-save flag (see {@link FormFieldAutoSaveProvider}).\n */\nexport function useFormFieldAutoSave(): boolean {\n return useContext(FormFieldAutoSaveContext);\n}\n\n/**\n * Ambient control over the required marker (`*`). Defaults to showing it.\n *\n * `<AutoForm requiredMarker={false}>` turns it off for a form where nearly\n * every field is required and the asterisks are noise rather than news.\n *\n * ⚠️ **This is a purely visual switch, and must stay one.** The marker is\n * `aria-hidden`, so it never carried the information to assistive tech in the\n * first place — `aria-required` on the input does, and it is set from the\n * schema regardless of this flag. Hiding the marker must never be the reason a\n * field stops announcing that it is required.\n */\nconst FormFieldRequiredMarkerContext = createContext<boolean>(true);\n\nexport function FormFieldRequiredMarkerProvider(props: {\n value: boolean;\n children: ReactNode;\n}) {\n return (\n <FormFieldRequiredMarkerContext.Provider value={props.value}>\n {props.children}\n </FormFieldRequiredMarkerContext.Provider>\n );\n}\n\n/**\n * Read the ambient required-marker flag (see\n * {@link FormFieldRequiredMarkerProvider}).\n */\nexport function useFormFieldRequiredMarker(): boolean {\n return useContext(FormFieldRequiredMarkerContext);\n}\n\n/**\n * Id of the error element a `<FormField id={id} error>` renders.\n */\nexport function formFieldErrorId(\n id?: string,\n error?: string,\n): string | undefined {\n return id && error ? `${id}-error` : undefined;\n}\n\n/**\n * Id of the description element a `<FormField id={id} description>` renders\n * (the description is replaced by the error when both are set).\n */\nexport function formFieldDescriptionId(\n id?: string,\n description?: string,\n error?: string,\n): string | undefined {\n return id && description && !error ? `${id}-description` : undefined;\n}\n\n/**\n * The aria attributes a control spreads on its native element when it\n * renders its own `<FormField>` (id/error/description in hand). Widgets\n * nested under someone else's FormField use {@link useFormFieldA11y}\n * instead.\n */\nexport function formFieldAriaProps(props: {\n id?: string;\n error?: string;\n description?: string;\n required?: boolean;\n}): {\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n \"aria-required\"?: true;\n} {\n return {\n \"aria-invalid\": props.error ? true : undefined,\n \"aria-describedby\":\n formFieldErrorId(props.id, props.error) ??\n formFieldDescriptionId(props.id, props.description, props.error),\n // The visible marker is `aria-hidden`, so without this a required field\n // announced nothing at all. It is read from the schema, never from the\n // marker flag — see {@link FormFieldRequiredMarkerProvider}.\n \"aria-required\": props.required ? true : undefined,\n };\n}\n\nexport interface FormFieldA11y {\n /**\n * `true` when the surrounding FormField carries an error — mirror it\n * onto the widget's `aria-invalid`.\n */\n invalid?: true;\n /**\n * Id of the FormField's error (or description) element — mirror it\n * onto the widget's `aria-describedby`.\n */\n describedBy?: string;\n}\n\nconst FormFieldA11yContext = createContext<FormFieldA11y>({});\n\n/**\n * Read the surrounding FormField's accessibility wiring. Leaf widgets\n * spread the result onto their native element so screen readers announce\n * the invalid state and the error/description text:\n *\n * ```tsx\n * const a11y = useFormFieldA11y();\n * <input aria-invalid={a11y.invalid} aria-describedby={a11y.describedBy} />\n * ```\n */\nexport function useFormFieldA11y(): FormFieldA11y {\n return useContext(FormFieldA11yContext);\n}\n\nexport interface FormFieldProps {\n /**\n * `id` linked to the inner control's `htmlFor`.\n */\n id?: string;\n /**\n * Label text rendered above the control.\n */\n label?: string;\n /**\n * Helper text rendered below the control.\n */\n description?: string;\n /**\n * Error message. When set, marks descendant inputs invalid via `data-invalid`.\n */\n error?: string;\n /**\n * Show a required marker (`*`) next to the label.\n */\n required?: boolean;\n /**\n * Extra classes applied to the wrapper.\n */\n className?: string;\n /**\n * Layout variant.\n * - `\"stack\"` (default): label on top, control below, description under.\n * - `\"row\"`: settings-style — label/description on the left, control on\n * the right. Stacks on narrow viewports.\n *\n * When omitted, falls back to the ambient `<FormFieldLayoutProvider>`.\n */\n layout?: FormFieldLayout;\n /**\n * The control to wrap.\n */\n children: ReactNode;\n}\n\n/**\n * Label + description + error wrapper shared by every Control variant.\n *\n * When `error` is set, applies a red ring to any descendant `<input>`,\n * `<textarea>`, or trigger button via the `data-invalid` attribute (so we\n * don't have to thread `error` through every leaf widget).\n */\nexport function FormField(props: FormFieldProps) {\n const ambient = useContext(FormFieldLayoutContext);\n const layout = props.layout ?? ambient;\n // Hook first, `&&` after: `props.required && useFormFieldRequiredMarker()`\n // short-circuits, which would make this a conditional hook call.\n const requiredMarker = useFormFieldRequiredMarker();\n const showRequiredMarker = props.required && requiredMarker;\n const invalidClasses = props.error\n ? \"[&_input]:border-destructive [&_input]:focus-visible:ring-destructive/30 [&_textarea]:border-destructive [&_textarea]:focus-visible:ring-destructive/30 [&_[role=combobox]]:border-destructive\"\n : \"\";\n const dataInvalid = props.error ? true : undefined;\n\n const errorId = formFieldErrorId(props.id, props.error);\n const descriptionId = formFieldDescriptionId(\n props.id,\n props.description,\n props.error,\n );\n const a11y = useMemo<FormFieldA11y>(\n () => ({\n invalid: props.error ? true : undefined,\n describedBy: errorId ?? descriptionId,\n }),\n [props.error, errorId, descriptionId],\n );\n const children = (\n <FormFieldA11yContext.Provider value={a11y}>\n {props.children}\n </FormFieldA11yContext.Provider>\n );\n\n if (layout === \"row\") {\n return (\n <div\n className={cn(\n \"flex flex-col gap-3 px-4 py-3 sm:grid sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center sm:gap-6\",\n invalidClasses,\n props.className,\n )}\n data-invalid={dataInvalid}\n >\n <div className=\"flex flex-col gap-0.5\">\n {props.label && (\n <Label htmlFor={props.id} className=\"font-medium\">\n {props.label}\n {showRequiredMarker && (\n <span className=\"text-destructive ml-0.5\" aria-hidden>\n *\n </span>\n )}\n </Label>\n )}\n {props.description && !props.error && (\n <p id={descriptionId} className=\"text-muted-foreground text-xs\">\n {props.description}\n </p>\n )}\n {props.error && (\n <p\n id={errorId}\n className=\"text-destructive text-xs flex items-center gap-1\"\n role=\"alert\"\n >\n <span aria-hidden>⚠</span>\n {props.error}\n </p>\n )}\n </div>\n <div className=\"flex min-w-0 justify-start sm:justify-end\">\n {children}\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={cn(\"flex flex-col gap-1.5\", invalidClasses, props.className)}\n data-invalid={dataInvalid}\n >\n {props.label && (\n <Label htmlFor={props.id}>\n {props.label}\n {showRequiredMarker && (\n <span className=\"text-destructive ml-0.5\" aria-hidden>\n *\n </span>\n )}\n </Label>\n )}\n {children}\n {props.description && !props.error && (\n <p id={descriptionId} className=\"text-muted-foreground text-xs\">\n {props.description}\n </p>\n )}\n {props.error && (\n <p\n id={errorId}\n className=\"text-destructive text-xs flex items-center gap-1\"\n role=\"alert\"\n >\n <span aria-hidden>⚠</span>\n {props.error}\n </p>\n )}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;;AAeA,MAAM,yBAAyB,cAA+B,OAAO;AAErE,SAAgB,wBAAwB,OAGrC;CACD,OACE,oBAAC,uBAAuB,UAAxB;EAAiC,OAAO,MAAM;EAC3C,UAAA,MAAM;CACwB,CAAA;AAErC;;;;;;;;AASA,SAAgB,qBAAsC;CACpD,OAAO,WAAW,sBAAsB;AAC1C;;;;;;AAOA,MAAM,2BAA2B,cAAuB,KAAK;AAE7D,SAAgB,0BAA0B,OAGvC;CACD,OACE,oBAAC,yBAAyB,UAA1B;EAAmC,OAAO,MAAM;EAC7C,UAAA,MAAM;CAC0B,CAAA;AAEvC;;;;AAKA,SAAgB,uBAAgC;CAC9C,OAAO,WAAW,wBAAwB;AAC5C;;;;;;;;;;;;;AAcA,MAAM,iCAAiC,cAAuB,IAAI;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"form-field.js","names":[],"sources":["../../../src/components/control-base/form-field.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { Label } from \"@alepha/ui/components/ui/label\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\nexport type FormFieldLayout = \"stack\" | \"row\";\n\n/**\n * Ambient layout for every nested `<FormField>`. Defaults to `\"stack\"`.\n * `<AutoForm layout=\"row\">` wraps its tree in this context so every Control\n * variant renders as a settings-style row without prop drilling.\n */\nconst FormFieldLayoutContext = createContext<FormFieldLayout>(\"stack\");\n\nexport const FormFieldLayoutProvider = (props: {\n value: FormFieldLayout;\n children: ReactNode;\n}) => {\n return (\n <FormFieldLayoutContext.Provider value={props.value}>\n {props.children}\n </FormFieldLayoutContext.Provider>\n );\n};\n\n/**\n * Read the ambient layout (see {@link FormFieldLayoutProvider}).\n *\n * `<FormField>` reads this itself, so a widget only needs the hook when it\n * sizes or arranges something *around* its FormField — `<Control>` uses it to\n * give text inputs the settings-row column width.\n */\nexport function useFormFieldLayout(): FormFieldLayout {\n return useContext(FormFieldLayoutContext);\n}\n\n/**\n * Ambient flag enabling the inline save (tick) affordance on text Controls.\n * Set by `<AutoForm autoSave>`; standalone Controls never show the tick\n * unless explicitly placed inside this provider.\n */\nconst FormFieldAutoSaveContext = createContext<boolean>(false);\n\nexport const FormFieldAutoSaveProvider = (props: {\n value: boolean;\n children: ReactNode;\n}) => {\n return (\n <FormFieldAutoSaveContext.Provider value={props.value}>\n {props.children}\n </FormFieldAutoSaveContext.Provider>\n );\n};\n\n/**\n * Read the ambient auto-save flag (see {@link FormFieldAutoSaveProvider}).\n */\nexport function useFormFieldAutoSave(): boolean {\n return useContext(FormFieldAutoSaveContext);\n}\n\n/**\n * Ambient control over the required marker (`*`). Defaults to showing it.\n *\n * `<AutoForm requiredMarker={false}>` turns it off for a form where nearly\n * every field is required and the asterisks are noise rather than news.\n *\n * ⚠️ **This is a purely visual switch, and must stay one.** The marker is\n * `aria-hidden`, so it never carried the information to assistive tech in the\n * first place — `aria-required` on the input does, and it is set from the\n * schema regardless of this flag. Hiding the marker must never be the reason a\n * field stops announcing that it is required.\n */\nconst FormFieldRequiredMarkerContext = createContext<boolean>(true);\n\nexport const FormFieldRequiredMarkerProvider = (props: {\n value: boolean;\n children: ReactNode;\n}) => {\n return (\n <FormFieldRequiredMarkerContext.Provider value={props.value}>\n {props.children}\n </FormFieldRequiredMarkerContext.Provider>\n );\n};\n\n/**\n * Read the ambient required-marker flag (see\n * {@link FormFieldRequiredMarkerProvider}).\n */\nexport function useFormFieldRequiredMarker(): boolean {\n return useContext(FormFieldRequiredMarkerContext);\n}\n\n/**\n * Id of the error element a `<FormField id={id} error>` renders.\n */\nexport function formFieldErrorId(\n id?: string,\n error?: string,\n): string | undefined {\n return id && error ? `${id}-error` : undefined;\n}\n\n/**\n * Id of the description element a `<FormField id={id} description>` renders\n * (the description is replaced by the error when both are set).\n */\nexport function formFieldDescriptionId(\n id?: string,\n description?: string,\n error?: string,\n): string | undefined {\n return id && description && !error ? `${id}-description` : undefined;\n}\n\n/**\n * The aria attributes a control spreads on its native element when it\n * renders its own `<FormField>` (id/error/description in hand). Widgets\n * nested under someone else's FormField use {@link useFormFieldA11y}\n * instead.\n */\nexport function formFieldAriaProps(props: {\n id?: string;\n error?: string;\n description?: string;\n required?: boolean;\n}): {\n \"aria-invalid\"?: true;\n \"aria-describedby\"?: string;\n \"aria-required\"?: true;\n} {\n return {\n \"aria-invalid\": props.error ? true : undefined,\n \"aria-describedby\":\n formFieldErrorId(props.id, props.error) ??\n formFieldDescriptionId(props.id, props.description, props.error),\n // The visible marker is `aria-hidden`, so without this a required field\n // announced nothing at all. It is read from the schema, never from the\n // marker flag — see {@link FormFieldRequiredMarkerProvider}.\n \"aria-required\": props.required ? true : undefined,\n };\n}\n\nexport interface FormFieldA11y {\n /**\n * `true` when the surrounding FormField carries an error — mirror it\n * onto the widget's `aria-invalid`.\n */\n invalid?: true;\n /**\n * Id of the FormField's error (or description) element — mirror it\n * onto the widget's `aria-describedby`.\n */\n describedBy?: string;\n}\n\nconst FormFieldA11yContext = createContext<FormFieldA11y>({});\n\n/**\n * Read the surrounding FormField's accessibility wiring. Leaf widgets\n * spread the result onto their native element so screen readers announce\n * the invalid state and the error/description text:\n *\n * ```tsx\n * const a11y = useFormFieldA11y();\n * <input aria-invalid={a11y.invalid} aria-describedby={a11y.describedBy} />\n * ```\n */\nexport function useFormFieldA11y(): FormFieldA11y {\n return useContext(FormFieldA11yContext);\n}\n\nexport interface FormFieldProps {\n /**\n * `id` linked to the inner control's `htmlFor`.\n */\n id?: string;\n /**\n * Label text rendered above the control.\n */\n label?: string;\n /**\n * Helper text rendered below the control.\n */\n description?: string;\n /**\n * Error message. When set, marks descendant inputs invalid via `data-invalid`.\n */\n error?: string;\n /**\n * Show a required marker (`*`) next to the label.\n */\n required?: boolean;\n /**\n * Extra classes applied to the wrapper.\n */\n className?: string;\n /**\n * Layout variant.\n * - `\"stack\"` (default): label on top, control below, description under.\n * - `\"row\"`: settings-style — label/description on the left, control on\n * the right. Stacks on narrow viewports.\n *\n * When omitted, falls back to the ambient `<FormFieldLayoutProvider>`.\n */\n layout?: FormFieldLayout;\n /**\n * The control to wrap.\n */\n children: ReactNode;\n}\n\n/**\n * Label + description + error wrapper shared by every Control variant.\n *\n * When `error` is set, applies a red ring to any descendant `<input>`,\n * `<textarea>`, or trigger button via the `data-invalid` attribute (so we\n * don't have to thread `error` through every leaf widget).\n */\nexport const FormField = (props: FormFieldProps) => {\n const ambient = useContext(FormFieldLayoutContext);\n const layout = props.layout ?? ambient;\n // Hook first, `&&` after: `props.required && useFormFieldRequiredMarker()`\n // short-circuits, which would make this a conditional hook call.\n const requiredMarker = useFormFieldRequiredMarker();\n const showRequiredMarker = props.required && requiredMarker;\n const invalidClasses = props.error\n ? \"[&_input]:border-destructive [&_input]:focus-visible:ring-destructive/30 [&_textarea]:border-destructive [&_textarea]:focus-visible:ring-destructive/30 [&_[role=combobox]]:border-destructive\"\n : \"\";\n const dataInvalid = props.error ? true : undefined;\n\n const errorId = formFieldErrorId(props.id, props.error);\n const descriptionId = formFieldDescriptionId(\n props.id,\n props.description,\n props.error,\n );\n const a11y = useMemo<FormFieldA11y>(\n () => ({\n invalid: props.error ? true : undefined,\n describedBy: errorId ?? descriptionId,\n }),\n [props.error, errorId, descriptionId],\n );\n const children = (\n <FormFieldA11yContext.Provider value={a11y}>\n {props.children}\n </FormFieldA11yContext.Provider>\n );\n\n if (layout === \"row\") {\n return (\n <div\n className={cn(\n \"flex flex-col gap-3 px-4 py-3 sm:grid sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center sm:gap-6\",\n invalidClasses,\n props.className,\n )}\n data-invalid={dataInvalid}\n >\n <div className=\"flex flex-col gap-0.5\">\n {props.label && (\n <Label htmlFor={props.id} className=\"font-medium\">\n {props.label}\n {showRequiredMarker && (\n <span className=\"text-destructive ml-0.5\" aria-hidden>\n *\n </span>\n )}\n </Label>\n )}\n {props.description && !props.error && (\n <p id={descriptionId} className=\"text-muted-foreground text-xs\">\n {props.description}\n </p>\n )}\n {props.error && (\n <p\n id={errorId}\n className=\"text-destructive flex items-center gap-1 text-xs\"\n role=\"alert\"\n >\n <span aria-hidden>⚠</span>\n {props.error}\n </p>\n )}\n </div>\n <div className=\"flex min-w-0 justify-start sm:justify-end\">\n {children}\n </div>\n </div>\n );\n }\n\n return (\n <div\n className={cn(\"flex flex-col gap-1.5\", invalidClasses, props.className)}\n data-invalid={dataInvalid}\n >\n {props.label && (\n <Label htmlFor={props.id}>\n {props.label}\n {showRequiredMarker && (\n <span className=\"text-destructive ml-0.5\" aria-hidden>\n *\n </span>\n )}\n </Label>\n )}\n {children}\n {props.description && !props.error && (\n <p id={descriptionId} className=\"text-muted-foreground text-xs\">\n {props.description}\n </p>\n )}\n {props.error && (\n <p\n id={errorId}\n className=\"text-destructive flex items-center gap-1 text-xs\"\n role=\"alert\"\n >\n <span aria-hidden>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T,OACE,qBAAC,OAAD;EACE,WAAW,GAAG,yBAAyB,gBAAgB,MAAM,SAAS;EACtE,gBAAc;EAFhB,UAAA;GAIG,MAAM,SACL,qBAAC,OAAD;IAAO,SAAS,MAAM;IAAtB,UAAA,CACG,MAAM,OACN,sBACC,oBAAC,QAAD;KAAM,WAAU;KAA0B,eAAA;KAAY,UAAA;IAEhD,CAAA,CAEH;;GAER;GACA,MAAM,eAAe,CAAC,MAAM,SAC3B,oBAAC,KAAD;IAAG,IAAI;IAAe,WAAU;IAC7B,UAAA,MAAM;GACN,CAAA;GAEJ,MAAM,SACL,qBAAC,KAAD;IACE,IAAI;IACJ,WAAU;IACV,MAAK;IAHP,UAAA,CAKE,oBAAC,QAAD;KAAM,eAAA;KAAY,UAAA;IAAO,CAAA,GACxB,MAAM,KACN;;EAEF;;AAET"}
|
|
@@ -5,5 +5,5 @@ export type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;
|
|
|
5
5
|
* Maps a semantic {@link IconHint} or an icon name string to a lucide
|
|
6
6
|
* component. Returns `undefined` if not found.
|
|
7
7
|
*/
|
|
8
|
-
export declare const iconFor: (hint?: IconHint | string | null) => IconComponent | undefined;
|
|
8
|
+
export declare const iconFor: (hint?: IconHint | (string & {}) | null) => IconComponent | undefined;
|
|
9
9
|
//# sourceMappingURL=icon-hint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-hint.d.ts","sourceRoot":"","sources":["../../../src/components/control-base/icon-hint.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAqBlD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AA2BnE;;;GAGG;AACH,eAAO,MAAM,OAAO,UACX,QAAQ,GAAG,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"icon-hint.d.ts","sourceRoot":"","sources":["../../../src/components/control-base/icon-hint.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAqBlD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;AA2BnE;;;GAGG;AACH,eAAO,MAAM,OAAO,UACX,QAAQ,GAAG,CAAC,MAAM,GAAG,EAAE,CAAC,GAAG,IAAI,KACrC,aAAa,GAAG,SAGlB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon-hint.js","names":[],"sources":["../../../src/components/control-base/icon-hint.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport type { IconHint } from \"alepha/react/form\";\nimport {\n AtSign,\n Calendar,\n Clock,\n Cog,\n Download,\n File,\n Hash,\n Key,\n Link,\n List,\n Lock,\n Phone,\n RotateCcw,\n ToggleLeft,\n Type,\n Upload,\n User,\n Wrench,\n} from \"lucide-react\";\nimport type { ComponentType, SVGProps } from \"react\";\n\nexport type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;\n\nconst map: Record<IconHint, IconComponent> = {\n email: AtSign,\n password: Lock,\n phone: Phone,\n url: Link,\n number: Hash,\n calendar: Calendar,\n clock: Clock,\n list: List,\n text: Type,\n user: User,\n file: File,\n switch: ToggleLeft,\n};\n\nconst namedIcons: Record<string, IconComponent> = {\n ...map,\n key: Key,\n cog: Cog,\n download: Download,\n upload: Upload,\n wrench: Wrench,\n \"rotate-ccw\": RotateCcw,\n};\n\n/**\n * Maps a semantic {@link IconHint} or an icon name string to a lucide\n * component. Returns `undefined` if not found.\n */\nexport const iconFor = (\n hint?: IconHint | string | null,\n): IconComponent | undefined => {\n if (!hint) return undefined;\n return namedIcons[hint as string];\n};\n"],"mappings":";;;AA4CA,MAAM,aAA4C;CAdhD,OAAO;CACP,UAAU;CACV,OAAO;CACP,KAAK;CACL,QAAQ;CACR,UAAU;CACV,OAAO;CACP,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,QAAQ;CAKR,KAAK;CACL,KAAK;CACL,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,cAAc;AAChB;;;;;AAMA,MAAa,WACX,SAC8B;CAC9B,IAAI,CAAC,MAAM,OAAO,KAAA;CAClB,OAAO,WAAW;AACpB"}
|
|
1
|
+
{"version":3,"file":"icon-hint.js","names":[],"sources":["../../../src/components/control-base/icon-hint.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport type { IconHint } from \"alepha/react/form\";\nimport {\n AtSign,\n Calendar,\n Clock,\n Cog,\n Download,\n File,\n Hash,\n Key,\n Link,\n List,\n Lock,\n Phone,\n RotateCcw,\n ToggleLeft,\n Type,\n Upload,\n User,\n Wrench,\n} from \"lucide-react\";\nimport type { ComponentType, SVGProps } from \"react\";\n\nexport type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;\n\nconst map: Record<IconHint, IconComponent> = {\n email: AtSign,\n password: Lock,\n phone: Phone,\n url: Link,\n number: Hash,\n calendar: Calendar,\n clock: Clock,\n list: List,\n text: Type,\n user: User,\n file: File,\n switch: ToggleLeft,\n};\n\nconst namedIcons: Record<string, IconComponent> = {\n ...map,\n key: Key,\n cog: Cog,\n download: Download,\n upload: Upload,\n wrench: Wrench,\n \"rotate-ccw\": RotateCcw,\n};\n\n/**\n * Maps a semantic {@link IconHint} or an icon name string to a lucide\n * component. Returns `undefined` if not found.\n */\nexport const iconFor = (\n hint?: IconHint | (string & {}) | null,\n): IconComponent | undefined => {\n if (!hint) return undefined;\n return namedIcons[hint as string];\n};\n"],"mappings":";;;AA4CA,MAAM,aAA4C;CAdhD,OAAO;CACP,UAAU;CACV,OAAO;CACP,KAAK;CACL,QAAQ;CACR,UAAU;CACV,OAAO;CACP,MAAM;CACN,MAAM;CACN,MAAM;CACN,MAAM;CACN,QAAQ;CAKR,KAAK;CACL,KAAK;CACL,UAAU;CACV,QAAQ;CACR,QAAQ;CACR,cAAc;AAChB;;;;;AAMA,MAAa,WACX,SAC8B;CAC9B,IAAI,CAAC,MAAM,OAAO,KAAA;CAClB,OAAO,WAAW;AACpB"}
|
|
@@ -30,5 +30,5 @@ export interface ControlDateProps {
|
|
|
30
30
|
*/
|
|
31
31
|
disabled?: boolean;
|
|
32
32
|
}
|
|
33
|
-
export declare
|
|
33
|
+
export declare const ControlDate: (props: ControlDateProps) => React.JSX.Element | null;
|
|
34
34
|
//# sourceMappingURL=control-date.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-date.d.ts","sourceRoot":"","sources":["../../../src/components/control-date/control-date.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,
|
|
1
|
+
{"version":3,"file":"control-date.d.ts","sourceRoot":"","sources":["../../../src/components/control-date/control-date.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAc/B,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAI3B,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,UAAW,gBAAgB,6BAyDlD,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { cn } from "../../lib/utils.js";
|
|
2
2
|
import { Button } from "../ui/button.js";
|
|
3
|
+
import { Input } from "../ui/input.js";
|
|
3
4
|
import { FormField } from "../control-base/form-field.js";
|
|
4
5
|
import { Calendar as Calendar$1 } from "../ui/calendar.js";
|
|
5
|
-
import { Input } from "../ui/input.js";
|
|
6
6
|
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
9
|
import { Calendar, Clock } from "lucide-react";
|
|
10
10
|
import { parseField, useFieldValue, useFormState } from "alepha/react/form";
|
|
11
11
|
//#region src/components/control-date/control-date.tsx
|
|
12
|
-
|
|
12
|
+
const ControlDate = (props) => {
|
|
13
13
|
const form = useFormState(props.input, ["error"]);
|
|
14
14
|
const [value, setValue] = useFieldValue(props.input);
|
|
15
15
|
if (!props.input?.props) return null;
|
|
@@ -52,10 +52,26 @@ function ControlDate(props) {
|
|
|
52
52
|
onChange: (v) => setValue(v)
|
|
53
53
|
})
|
|
54
54
|
});
|
|
55
|
-
}
|
|
56
|
-
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* A date-only value (`YYYY-MM-DD`) names a calendar day, so it is parsed
|
|
58
|
+
* and formatted in local parts: `new Date("2026-08-23")` is UTC midnight,
|
|
59
|
+
* which displays as the 22nd west of Greenwich, and `toISOString()` on a
|
|
60
|
+
* local midnight stores the previous day east of it.
|
|
61
|
+
*/
|
|
62
|
+
const parseDateOnly = (value) => {
|
|
63
|
+
const [year, month, day] = value.split("-").map(Number);
|
|
64
|
+
return new Date(year, month - 1, day);
|
|
65
|
+
};
|
|
66
|
+
const formatDateOnly = (date) => {
|
|
67
|
+
const month = String(date.getMonth() + 1).padStart(2, "0");
|
|
68
|
+
const day = String(date.getDate()).padStart(2, "0");
|
|
69
|
+
return `${date.getFullYear()}-${month}-${day}`;
|
|
70
|
+
};
|
|
71
|
+
const DATE_ONLY = /^\d{4}-\d{2}-\d{2}$/;
|
|
72
|
+
const DatePopover = (props) => {
|
|
57
73
|
const [open, setOpen] = useState(false);
|
|
58
|
-
const date = props.value ? new Date(props.value) : void 0;
|
|
74
|
+
const date = props.value ? !props.withTime && DATE_ONLY.test(props.value) ? parseDateOnly(props.value) : new Date(props.value) : void 0;
|
|
59
75
|
const formatted = date ? props.withTime ? date.toLocaleString() : date.toLocaleDateString() : "";
|
|
60
76
|
const handleDate = (d) => {
|
|
61
77
|
if (!d) {
|
|
@@ -64,7 +80,7 @@ function DatePopover(props) {
|
|
|
64
80
|
}
|
|
65
81
|
if (props.withTime) props.onChange(d.toISOString());
|
|
66
82
|
else {
|
|
67
|
-
props.onChange(d
|
|
83
|
+
props.onChange(formatDateOnly(d));
|
|
68
84
|
setOpen(false);
|
|
69
85
|
}
|
|
70
86
|
};
|
|
@@ -104,7 +120,7 @@ function DatePopover(props) {
|
|
|
104
120
|
})]
|
|
105
121
|
})]
|
|
106
122
|
});
|
|
107
|
-
}
|
|
123
|
+
};
|
|
108
124
|
//#endregion
|
|
109
125
|
export { ControlDate };
|
|
110
126
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-date.js","names":["CalendarIcon","Calendar"],"sources":["../../../src/components/control-date/control-date.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { FormField } from \"@alepha/ui/components/control-base/form-field\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Calendar } from \"@alepha/ui/components/ui/calendar\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@alepha/ui/components/ui/popover\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport {\n type BaseInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport { Calendar as CalendarIcon, Clock } from \"lucide-react\";\nimport { useState } from \"react\";\n\nexport interface ControlDateProps {\n /**\n * Bound `InputField` from `useForm`. Stores an ISO string.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the picker.\n */\n description?: string;\n /**\n * Force date-only mode regardless of schema format.\n */\n date?: boolean;\n /**\n * Force date-time mode regardless of schema format.\n */\n datetime?: boolean;\n /**\n * Force time-only mode regardless of schema format.\n */\n time?: boolean;\n /**\n * Disable the picker.\n */\n disabled?: boolean;\n}\n\nexport
|
|
1
|
+
{"version":3,"file":"control-date.js","names":["CalendarIcon","Calendar"],"sources":["../../../src/components/control-date/control-date.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { FormField } from \"@alepha/ui/components/control-base/form-field\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Calendar } from \"@alepha/ui/components/ui/calendar\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport {\n Popover,\n PopoverContent,\n PopoverTrigger,\n} from \"@alepha/ui/components/ui/popover\";\nimport { cn } from \"@alepha/ui/lib/utils\";\nimport {\n type BaseInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport { Calendar as CalendarIcon, Clock } from \"lucide-react\";\nimport { useState } from \"react\";\n\nexport interface ControlDateProps {\n /**\n * Bound `InputField` from `useForm`. Stores an ISO string.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the picker.\n */\n description?: string;\n /**\n * Force date-only mode regardless of schema format.\n */\n date?: boolean;\n /**\n * Force date-time mode regardless of schema format.\n */\n datetime?: boolean;\n /**\n * Force time-only mode regardless of schema format.\n */\n time?: boolean;\n /**\n * Disable the picker.\n */\n disabled?: boolean;\n}\n\nexport const ControlDate = (props: ControlDateProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n const isDateTime = props.datetime || meta.format === \"date-time\";\n const isTime = props.time || meta.format === \"time\";\n\n if (isTime) {\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <div className=\"relative\">\n <Clock className=\"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2\" />\n <Input\n id={meta.id}\n name={props.input.props.name}\n type=\"time\"\n className=\"pl-9\"\n disabled={props.disabled}\n value={value ?? \"\"}\n onChange={(e) => setValue(e.target.value)}\n />\n </div>\n </FormField>\n );\n }\n\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <DatePopover\n id={meta.id}\n value={value}\n withTime={isDateTime}\n disabled={props.disabled}\n onChange={(v) => setValue(v)}\n />\n </FormField>\n );\n};\n\ninterface DatePopoverProps {\n id?: string;\n value?: string;\n withTime: boolean;\n disabled?: boolean;\n onChange: (value: string | undefined) => void;\n}\n\n/**\n * A date-only value (`YYYY-MM-DD`) names a calendar day, so it is parsed\n * and formatted in local parts: `new Date(\"2026-08-23\")` is UTC midnight,\n * which displays as the 22nd west of Greenwich, and `toISOString()` on a\n * local midnight stores the previous day east of it.\n */\nconst parseDateOnly = (value: string): Date => {\n const [year, month, day] = value.split(\"-\").map(Number);\n return new Date(year, month - 1, day);\n};\n\nconst formatDateOnly = (date: Date): string => {\n const month = String(date.getMonth() + 1).padStart(2, \"0\");\n const day = String(date.getDate()).padStart(2, \"0\");\n return `${date.getFullYear()}-${month}-${day}`;\n};\n\nconst DATE_ONLY = /^\\d{4}-\\d{2}-\\d{2}$/;\n\nconst DatePopover = (props: DatePopoverProps) => {\n const [open, setOpen] = useState(false);\n const date = props.value\n ? !props.withTime && DATE_ONLY.test(props.value)\n ? parseDateOnly(props.value)\n : new Date(props.value)\n : undefined;\n\n const formatted = date\n ? props.withTime\n ? date.toLocaleString()\n : date.toLocaleDateString()\n : \"\";\n\n const handleDate = (d: Date | undefined) => {\n if (!d) {\n props.onChange(undefined);\n return;\n }\n if (props.withTime) {\n props.onChange(d.toISOString());\n } else {\n props.onChange(formatDateOnly(d));\n setOpen(false);\n }\n };\n\n const handleTime = (timeStr: string) => {\n if (!date) return;\n const [h, m] = timeStr.split(\":\").map(Number);\n const next = new Date(date);\n next.setHours(h ?? 0, m ?? 0, 0, 0);\n props.onChange(next.toISOString());\n };\n\n const timeValue =\n date && props.withTime\n ? `${String(date.getHours()).padStart(2, \"0\")}:${String(date.getMinutes()).padStart(2, \"0\")}`\n : \"\";\n\n return (\n <Popover open={open} onOpenChange={setOpen}>\n <PopoverTrigger\n render={\n <Button\n id={props.id}\n variant=\"outline\"\n disabled={props.disabled}\n className={cn(\n \"w-full justify-start text-left font-normal\",\n !date && \"text-muted-foreground\",\n )}\n />\n }\n >\n <CalendarIcon className=\"mr-2 size-4\" />\n {formatted || \"Pick a date\"}\n </PopoverTrigger>\n <PopoverContent className=\"w-auto p-0\" align=\"start\">\n <Calendar mode=\"single\" selected={date} onSelect={handleDate} />\n {props.withTime && (\n <div className=\"border-t p-3\">\n <Input\n type=\"time\"\n value={timeValue}\n onChange={(e) => handleTime(e.target.value)}\n />\n </div>\n )}\n </PopoverContent>\n </Popover>\n );\n};\n"],"mappings":";;;;;;;;;;;AAsDA,MAAa,eAAe,UAA4B;CACtD,MAAM,OA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AAW,GACT,8CACA,CAAC,QAAQ,uBACX;GACD,CAAA;GAVL,UAAA,CAaE,oBAACA,UAAD,EAAc,WAAU,cAAe,CAAA,GACtC,aAAa,aACA;EAChB,CAAA,GAAA,qBAAC,gBAAD;GAAgB,WAAU;GAAa,OAAM;GAA7C,UAAA,CACE,oBAACC,YAAD;IAAU,MAAK;IAAS,UAAU;IAAM,UAAU;GAAa,CAAA,GAC9D,MAAM,YACL,oBAAC,OAAD;IAAK,WAAU;IACb,UAAA,oBAAC,OAAD;KACE,MAAK;KACL,OAAO;KACP,WAAW,MAAM,WAAW,EAAE,OAAO,KAAK;IAC3C,CAAA;GACE,CAAA,CAEO;EACT,CAAA,CAAA;;AAEb"}
|
|
@@ -26,7 +26,7 @@ export interface ControlNumberProps {
|
|
|
26
26
|
*/
|
|
27
27
|
max?: number;
|
|
28
28
|
/**
|
|
29
|
-
* Step size.
|
|
29
|
+
* Step size. Defaults to 1.
|
|
30
30
|
*/
|
|
31
31
|
step?: number;
|
|
32
32
|
/**
|
|
@@ -34,5 +34,5 @@ export interface ControlNumberProps {
|
|
|
34
34
|
*/
|
|
35
35
|
disabled?: boolean;
|
|
36
36
|
}
|
|
37
|
-
export declare
|
|
37
|
+
export declare const ControlNumber: (props: ControlNumberProps) => React.JSX.Element | null;
|
|
38
38
|
//# sourceMappingURL=control-number.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-number.d.ts","sourceRoot":"","sources":["../../../src/components/control-number/control-number.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,
|
|
1
|
+
{"version":3,"file":"control-number.d.ts","sourceRoot":"","sources":["../../../src/components/control-number/control-number.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,aAAa,UAAW,kBAAkB,6BAqFtD,CAAC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { Input } from "../ui/input.js";
|
|
1
2
|
import { FormField } from "../control-base/form-field.js";
|
|
2
3
|
import { iconFor } from "../control-base/icon-hint.js";
|
|
3
|
-
import { Input } from "../ui/input.js";
|
|
4
4
|
import { Slider } from "../ui/slider.js";
|
|
5
5
|
import "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { parseField, useFieldValue, useFormState } from "alepha/react/form";
|
|
8
8
|
//#region src/components/control-number/control-number.tsx
|
|
9
|
-
|
|
9
|
+
const ControlNumber = (props) => {
|
|
10
10
|
const form = useFormState(props.input, ["error"]);
|
|
11
11
|
const [value, setValue] = useFieldValue(props.input);
|
|
12
12
|
if (!props.input?.props) return null;
|
|
@@ -70,7 +70,7 @@ function ControlNumber(props) {
|
|
|
70
70
|
})]
|
|
71
71
|
})
|
|
72
72
|
});
|
|
73
|
-
}
|
|
73
|
+
};
|
|
74
74
|
//#endregion
|
|
75
75
|
export { ControlNumber };
|
|
76
76
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-number.js","names":[],"sources":["../../../src/components/control-number/control-number.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { FormField } from \"@alepha/ui/components/control-base/form-field\";\nimport { iconFor } from \"@alepha/ui/components/control-base/icon-hint\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport { Slider } from \"@alepha/ui/components/ui/slider\";\nimport {\n type BaseInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\n\nexport interface ControlNumberProps {\n /**\n * Bound numeric `InputField` from `useForm`.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the input.\n */\n description?: string;\n /**\n * Render as a slider instead of a number input.\n */\n slider?: boolean;\n /**\n * Minimum allowed value. Falls back to schema `minimum`.\n */\n min?: number;\n /**\n * Maximum allowed value. Falls back to schema `maximum`.\n */\n max?: number;\n /**\n * Step size.
|
|
1
|
+
{"version":3,"file":"control-number.js","names":[],"sources":["../../../src/components/control-number/control-number.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { FormField } from \"@alepha/ui/components/control-base/form-field\";\nimport { iconFor } from \"@alepha/ui/components/control-base/icon-hint\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport { Slider } from \"@alepha/ui/components/ui/slider\";\nimport {\n type BaseInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\n\nexport interface ControlNumberProps {\n /**\n * Bound numeric `InputField` from `useForm`.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the input.\n */\n description?: string;\n /**\n * Render as a slider instead of a number input.\n */\n slider?: boolean;\n /**\n * Minimum allowed value. Falls back to schema `minimum`.\n */\n min?: number;\n /**\n * Maximum allowed value. Falls back to schema `maximum`.\n */\n max?: number;\n /**\n * Step size. Defaults to 1.\n */\n step?: number;\n /**\n * Disable the input.\n */\n disabled?: boolean;\n}\n\nexport const ControlNumber = (props: ControlNumberProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n const min = props.min ?? meta.constraints.minimum;\n const max = props.max ?? meta.constraints.maximum;\n\n if (props.slider) {\n const lo = min ?? 0;\n const hi = max ?? 100;\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <div className=\"flex items-center gap-3 py-2\">\n <Slider\n id={meta.id}\n min={lo}\n max={hi}\n step={props.step ?? 1}\n disabled={props.disabled}\n value={[Number(value ?? lo)]}\n onValueChange={(v) => setValue(Array.isArray(v) ? v[0] : v)}\n className=\"flex-1\"\n />\n <span className=\"text-muted-foreground w-10 text-right text-sm tabular-nums\">\n {value ?? lo}\n </span>\n </div>\n </FormField>\n );\n }\n\n const Icon = iconFor(meta.iconHint);\n return (\n <FormField\n id={meta.id}\n label={meta.label}\n description={meta.description}\n error={meta.error}\n required={meta.required}\n >\n <div className=\"relative\">\n {Icon && (\n <Icon className=\"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2\" />\n )}\n <Input\n id={meta.id}\n /*\n * Text controls carry the field name; numeric ones did not, so a number\n * rendered as `<input type=\"number\">` with no `name` at all. Two things\n * depended on it: `AutoForm`'s scroll-to-first-error looks the field up\n * with `document.querySelector('[name=\"…\"]')`, so it silently gave up on\n * numeric fields, and the browser cannot label an unnamed field for\n * autofill. Found while writing e2e tests against a price field that no\n * selector could reach.\n */\n name={props.input.props.name}\n type=\"number\"\n min={min}\n max={max}\n step={props.step}\n disabled={props.disabled}\n value={value ?? \"\"}\n onChange={(e) => {\n const v = e.target.value;\n setValue(v === \"\" ? undefined : Number(v));\n }}\n className={Icon ? \"pl-9\" : undefined}\n />\n </div>\n </FormField>\n );\n};\n"],"mappings":";;;;;;;;AAkDA,MAAa,iBAAiB,UAA8B;CAC1D,MAAM,OAAO,aAAa,MAAM,OAAO,CAAC,OAAO,CAAC;CAChD,MAAM,CAAC,OAAO,YAAY,cAAc,MAAM,KAAK;CAEnD,IAAI,CAAC,MAAM,OAAO,OAAO,OAAO;CAEhC,MAAM,OAAO,WAAW,MAAM,OAAO;EACnC,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,OAAO,KAAK;CACd,CAAC;CAED,MAAM,MAAM,MAAM,OAAO,KAAK,YAAY;CAC1C,MAAM,MAAM,MAAM,OAAO,KAAK,YAAY;CAE1C,IAAI,MAAM,QAAQ;EAChB,MAAM,KAAK,OAAO;EAClB,MAAM,KAAK,OAAO;EAClB,OACE,oBAAC,WAAD;GACE,IAAI,KAAK;GACT,OAAO,KAAK;GACZ,aAAa,KAAK;GAClB,OAAO,KAAK;GACZ,UAAU,KAAK;GAEf,UAAA,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACE,oBAAC,QAAD;KACE,IAAI,KAAK;KACT,KAAK;KACL,KAAK;KACL,MAAM,MAAM,QAAQ;KACpB,UAAU,MAAM;KAChB,OAAO,CAAC,OAAO,SAAS,EAAE,CAAC;KAC3B,gBAAgB,MAAM,SAAS,MAAM,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;KAC1D,WAAU;IACX,CAAA,GACD,oBAAC,QAAD;KAAM,WAAU;KACb,UAAA,SAAS;IACN,CAAA,CACH;;EACI,CAAA;CAEf;CAEA,MAAM,OAAO,QAAQ,KAAK,QAAQ;CAClC,OACE,oBAAC,WAAD;EACE,IAAI,KAAK;EACT,OAAO,KAAK;EACZ,aAAa,KAAK;EAClB,OAAO,KAAK;EACZ,UAAU,KAAK;EAEf,UAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG,QACC,oBAAC,MAAD,EAAM,WAAU,wEAAyE,CAAA,GAE3F,oBAAC,OAAD;IACE,IAAI,KAAK;IAUT,MAAM,MAAM,MAAM,MAAM;IACxB,MAAK;IACA;IACA;IACL,MAAM,MAAM;IACZ,UAAU,MAAM;IAChB,OAAO,SAAS;IAChB,WAAW,MAAM;KACf,MAAM,IAAI,EAAE,OAAO;KACnB,SAAS,MAAM,KAAK,KAAA,IAAY,OAAO,CAAC,CAAC;IAC3C;IACA,WAAW,OAAO,SAAS,KAAA;GAC5B,CAAA,CACE;;CACI,CAAA;AAEf"}
|
|
@@ -34,12 +34,14 @@ export interface ControlObjectProps {
|
|
|
34
34
|
* Default expanded state. @default true
|
|
35
35
|
*/
|
|
36
36
|
defaultExpanded?: boolean;
|
|
37
|
-
/**
|
|
37
|
+
/**
|
|
38
|
+
* Dictionary prefix for this object's children (see `resolveFieldI18n`).
|
|
39
|
+
*/
|
|
38
40
|
i18nPrefix?: string;
|
|
39
41
|
/**
|
|
40
42
|
* Allow the user to clear the object (sets value to undefined).
|
|
41
43
|
*/
|
|
42
44
|
clearable?: boolean;
|
|
43
45
|
}
|
|
44
|
-
export declare
|
|
46
|
+
export declare const ControlObject: (props: ControlObjectProps) => React.JSX.Element | null;
|
|
45
47
|
//# sourceMappingURL=control-object.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-object.d.ts","sourceRoot":"","sources":["../../../src/components/control-object/control-object.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"control-object.d.ts","sourceRoot":"","sources":["../../../src/components/control-object/control-object.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAEL,KAAK,YAAY,EAClB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EACL,KAAK,cAAc,EAKpB,MAAM,mBAAmB,CAAC;AAU3B,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,KAAK,EAAE,cAAc,CAAC;IACtB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACxB;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC/B;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,IAAI,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;IACpE;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,eAAO,MAAM,aAAa,UAAW,kBAAkB,6BAoItD,CAAC"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Button } from "../ui/button.js";
|
|
2
|
-
import { childI18nPrefix, resolveFieldI18n } from "../control-base/field-i18n.js";
|
|
3
2
|
import { spanClass, widthFor } from "../control-base/grid.js";
|
|
3
|
+
import { childI18nPrefix, resolveFieldI18n } from "../control-base/field-i18n.js";
|
|
4
4
|
import { Control } from "../control/control.js";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
import { ChevronDown, ChevronRight, Plus, Trash2 } from "lucide-react";
|
|
8
8
|
import { z } from "alepha";
|
|
9
|
-
import { parseField, useFieldValue, useFormState } from "alepha/react/form";
|
|
10
9
|
import { useI18n } from "alepha/react/i18n";
|
|
10
|
+
import { parseField, useFieldValue, useFormState } from "alepha/react/form";
|
|
11
11
|
//#region src/components/control-object/control-object.tsx
|
|
12
|
-
|
|
12
|
+
const ControlObject = (props) => {
|
|
13
13
|
const form = useFormState(props.input, ["error"]);
|
|
14
14
|
const [value, setValue] = useFieldValue(props.input);
|
|
15
15
|
const [expanded, setExpanded] = useState(props.defaultExpanded ?? true);
|
|
@@ -26,12 +26,12 @@ function ControlObject(props) {
|
|
|
26
26
|
const fieldNames = Object.keys(z.schema.shape(schema));
|
|
27
27
|
const nestedItems = props.input.items;
|
|
28
28
|
const grid = /* @__PURE__ */ jsx("div", {
|
|
29
|
-
className: "grid
|
|
29
|
+
className: "grid grid-cols-12 gap-3",
|
|
30
30
|
children: fieldNames.map((name) => {
|
|
31
31
|
const field = nestedItems?.[name];
|
|
32
32
|
if (!field) return null;
|
|
33
33
|
const fieldProps = {
|
|
34
|
-
...props.controlProps?.[name]
|
|
34
|
+
...props.controlProps?.[name],
|
|
35
35
|
...resolveFieldI18n(tr, props.i18nPrefix, name, props.controlProps?.[name] ?? {}),
|
|
36
36
|
i18nPrefix: childI18nPrefix(props.i18nPrefix, name)
|
|
37
37
|
};
|
|
@@ -69,10 +69,10 @@ function ControlObject(props) {
|
|
|
69
69
|
children: /* @__PURE__ */ jsx(Trash2, { className: "size-4" })
|
|
70
70
|
}) : /* @__PURE__ */ jsx("div", { className: "size-8 shrink-0" }),
|
|
71
71
|
/* @__PURE__ */ jsxs("div", {
|
|
72
|
-
className: "flex
|
|
72
|
+
className: "flex min-w-0 flex-1 flex-col",
|
|
73
73
|
children: [
|
|
74
74
|
meta.label && /* @__PURE__ */ jsxs("legend", {
|
|
75
|
-
className: "text-sm font-medium
|
|
75
|
+
className: "text-sm leading-tight font-medium",
|
|
76
76
|
children: [meta.label, meta.required && /* @__PURE__ */ jsx("span", {
|
|
77
77
|
className: "text-destructive ml-0.5",
|
|
78
78
|
children: "*"
|
|
@@ -103,7 +103,7 @@ function ControlObject(props) {
|
|
|
103
103
|
children: grid
|
|
104
104
|
})]
|
|
105
105
|
});
|
|
106
|
-
}
|
|
106
|
+
};
|
|
107
107
|
//#endregion
|
|
108
108
|
export { ControlObject };
|
|
109
109
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-object.js","names":[],"sources":["../../../src/components/control-object/control-object.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport {
|
|
1
|
+
{"version":3,"file":"control-object.js","names":[],"sources":["../../../src/components/control-object/control-object.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { spanClass, widthFor } from \"@alepha/ui/components/control-base/grid\";\nimport {\n Control,\n type ControlProps,\n} from \"@alepha/ui/components/control/control\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { type ZObject, z } from \"alepha\";\nimport {\n type BaseInputField,\n type ObjectInputField,\n parseField,\n useFieldValue,\n useFormState,\n} from \"alepha/react/form\";\nimport { useI18n } from \"alepha/react/i18n\";\nimport { ChevronDown, ChevronRight, Plus, Trash2 } from \"lucide-react\";\nimport { useState } from \"react\";\n\nimport {\n childI18nPrefix,\n resolveFieldI18n,\n} from \"../control-base/field-i18n.ts\";\n\nexport interface ControlObjectProps {\n /**\n * Bound object `InputField` from `useForm`.\n */\n input: BaseInputField;\n /**\n * Field label. Falls back to schema `title`.\n */\n label?: string;\n /**\n * Helper text shown below the group.\n */\n description?: string;\n /**\n * Number of grid columns. @default 1\n */\n columns?: 1 | 2 | 3 | 4;\n /**\n * \"fieldset\" wraps in a bordered container with legend. \"plain\" renders fields only.\n */\n variant?: \"fieldset\" | \"plain\";\n /**\n * Per-field control props override, keyed by field name.\n */\n controlProps?: Record<string, Partial<Omit<ControlProps, \"input\">>>;\n /**\n * Disable the group and all inner controls.\n */\n disabled?: boolean;\n /**\n * Default expanded state. @default true\n */\n defaultExpanded?: boolean;\n /**\n * Dictionary prefix for this object's children (see `resolveFieldI18n`).\n */\n i18nPrefix?: string;\n /**\n * Allow the user to clear the object (sets value to undefined).\n */\n clearable?: boolean;\n}\n\nexport const ControlObject = (props: ControlObjectProps) => {\n const form = useFormState(props.input, [\"error\"]);\n const [value, setValue] = useFieldValue(props.input);\n const [expanded, setExpanded] = useState(props.defaultExpanded ?? true);\n const { tr } = useI18n();\n\n if (!props.input?.props) return null;\n\n const meta = parseField(props.input, {\n label: props.label,\n description: props.description,\n error: form.error,\n });\n\n // The field schema may be wrapped (optional/nullable/default); peel to the\n // ZodObject before reading its shape.\n const schema = z.schema.unwrap(props.input.schema) as ZObject;\n if (!z.schema.isObject(schema)) return null;\n\n // ── Init / clear ────────────────────────────────────────────────\n const isInitialized = value != null && typeof value === \"object\";\n\n const fieldNames = Object.keys(z.schema.shape(schema));\n const nestedItems = (props.input as ObjectInputField<ZObject>).items as\n | Record<string, BaseInputField>\n | undefined;\n\n const grid = (\n <div className=\"grid grid-cols-12 gap-3\">\n {fieldNames.map((name) => {\n const field = nestedItems?.[name];\n if (!field) return null;\n const fieldProps = {\n ...props.controlProps?.[name],\n ...resolveFieldI18n(\n tr as never,\n props.i18nPrefix,\n name,\n props.controlProps?.[name] ?? {},\n ),\n i18nPrefix: childI18nPrefix(props.i18nPrefix, name),\n };\n const width = widthFor(field, fieldProps.width as number | undefined);\n return (\n <div key={name} className={spanClass(width)}>\n <Control input={field} disabled={props.disabled} {...fieldProps} />\n </div>\n );\n })}\n </div>\n );\n\n if (props.variant === \"plain\") return grid;\n\n return (\n <fieldset\n className={`rounded-md border p-3 ${\n meta.error ? \"border-destructive\" : \"border-border\"\n }`}\n >\n <div className=\"flex items-start gap-3\">\n {!isInitialized && !props.disabled ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={tr(\"controlObject.initialize\", {\n default: \"Initialize\",\n })}\n onClick={() => setValue({})}\n >\n <Plus className=\"size-4\" />\n </Button>\n ) : props.clearable && !props.disabled ? (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={tr(\"controlObject.clear\", { default: \"Clear\" })}\n onClick={() => setValue(undefined)}\n >\n <Trash2 className=\"size-4\" />\n </Button>\n ) : (\n <div className=\"size-8 shrink-0\" />\n )}\n <div className=\"flex min-w-0 flex-1 flex-col\">\n {meta.label && (\n <legend className=\"text-sm leading-tight font-medium\">\n {meta.label}\n {meta.required && (\n <span className=\"text-destructive ml-0.5\">*</span>\n )}\n </legend>\n )}\n {meta.description && (\n <p className=\"text-muted-foreground text-xs leading-tight\">\n {meta.description}\n </p>\n )}\n {meta.error && (\n <p className=\"text-destructive text-xs leading-tight\">\n {meta.error}\n </p>\n )}\n </div>\n {isInitialized && (\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 shrink-0\"\n aria-label={\n expanded\n ? tr(\"controlObject.collapse\", { default: \"Collapse\" })\n : tr(\"controlObject.expand\", { default: \"Expand\" })\n }\n onClick={() => setExpanded((e) => !e)}\n >\n {expanded ? (\n <ChevronDown className=\"size-4\" />\n ) : (\n <ChevronRight className=\"size-4\" />\n )}\n </Button>\n )}\n </div>\n {expanded && isInitialized && <div className=\"mt-3\">{grid}</div>}\n </fieldset>\n );\n};\n"],"mappings":";;;;;;;;;;;AAsEA,MAAa,iBAAiB,UAA8B;CAC1D,MAAM,OAAO,aAAa,MAAM,OAAO,CAAC,OAAO,CAAC;CAChD,MAAM,CAAC,OAAO,YAAY,cAAc,MAAM,KAAK;CACnD,MAAM,CAAC,UAAU,eAAe,SAAS,MAAM,mBAAmB,IAAI;CACtE,MAAM,EAAE,OAAO,QAAQ;CAEvB,IAAI,CAAC,MAAM,OAAO,OAAO,OAAO;CAEhC,MAAM,OAAO,WAAW,MAAM,OAAO;EACnC,OAAO,MAAM;EACb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R,MAAK;KACL,WAAU;KACV,cAAY,GAAG,uBAAuB,EAAE,SAAS,QAAQ,CAAC;KAC1D,eAAe,SAAS,KAAA,CAAS;KAEjC,UAAA,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA;IACtB,CAAA,IAER,oBAAC,OAAD,EAAK,WAAU,kBAAmB,CAAA;IAEpC,qBAAC,OAAD;KAAK,WAAU;KAAf,UAAA;MACG,KAAK,SACJ,qBAAC,UAAD;OAAQ,WAAU;OAAlB,UAAA,CACG,KAAK,OACL,KAAK,YACJ,oBAAC,QAAD;QAAM,WAAU;QAA0B,UAAA;OAAO,CAAA,CAE7C;;MAET,KAAK,eACJ,oBAAC,KAAD;OAAG,WAAU;OACV,UAAA,KAAK;MACL,CAAA;MAEJ,KAAK,SACJ,oBAAC,KAAD;OAAG,WAAU;OACV,UAAA,KAAK;MACL,CAAA;KAEF;;IACJ,iBACC,oBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,WAAU;KACV,cACE,WACI,GAAG,0BAA0B,EAAE,SAAS,WAAW,CAAC,IACpD,GAAG,wBAAwB,EAAE,SAAS,SAAS,CAAC;KAEtD,eAAe,aAAa,MAAM,CAAC,CAAC;KAEnC,UAAA,WACC,oBAAC,aAAD,EAAa,WAAU,SAAU,CAAA,IAEjC,oBAAC,cAAD,EAAc,WAAU,SAAU,CAAA;IAE9B,CAAA;GAEP;EACJ,CAAA,GAAA,YAAY,iBAAiB,oBAAC,OAAD;GAAK,WAAU;GAAQ,UAAA;EAAU,CAAA,CACvD;;AAEd"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Button } from "../ui/button.js";
|
|
2
|
-
import { FormField, formFieldAriaProps } from "../control-base/form-field.js";
|
|
3
2
|
import { Input } from "../ui/input.js";
|
|
3
|
+
import { FormField, formFieldAriaProps } from "../control-base/form-field.js";
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { Eye, EyeOff } from "lucide-react";
|
|
@@ -24,7 +24,7 @@ const ControlPassword = (props) => {
|
|
|
24
24
|
children: /* @__PURE__ */ jsxs("div", {
|
|
25
25
|
className: "relative",
|
|
26
26
|
children: [
|
|
27
|
-
Icon && /* @__PURE__ */ jsx(Icon, { className: "text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2
|
|
27
|
+
Icon && /* @__PURE__ */ jsx(Icon, { className: "text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2" }),
|
|
28
28
|
/* @__PURE__ */ jsx(Input, {
|
|
29
29
|
...props.inputProps,
|
|
30
30
|
...formFieldAriaProps({
|
|
@@ -36,7 +36,6 @@ const ControlPassword = (props) => {
|
|
|
36
36
|
name: props.name,
|
|
37
37
|
type: reveal ? "text" : "password",
|
|
38
38
|
autoComplete: props.autoComplete ?? "current-password",
|
|
39
|
-
autoFocus: props.autoFocus,
|
|
40
39
|
disabled: props.disabled,
|
|
41
40
|
required: props.required,
|
|
42
41
|
minLength: props.minLength,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-password.js","names":[],"sources":["../../../src/components/control-password/control-password.tsx"],"sourcesContent":["import {\n FormField,\n formFieldAriaProps,\n} from \"@alepha/ui/components/control-base/form-field\";\nimport type { IconComponent } from \"@alepha/ui/components/control-base/icon-hint\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport { Eye, EyeOff } from \"lucide-react\";\nimport { type HTMLAttributes, useState } from \"react\";\n\nexport interface ControlPasswordProps {\n id?: string;\n name?: string;\n label?: string;\n description?: string;\n error?: string;\n required?: boolean;\n disabled?: boolean;\n autoComplete?: string;\n autoFocus?: boolean;\n minLength?: number;\n maxLength?: number;\n inputProps?: HTMLAttributes<HTMLElement>;\n icon?: IconComponent;\n value: string;\n onChange: (v: string) => void;\n}\n\n/**\n * Masked password field with a reveal toggle.\n *\n * Lives outside `Control` so a hand-built form — a dialog that is not driven by\n * a schema — gets the same field the schema path renders, rather than pairing a\n * bare `<Input type=\"password\">` with no way to check what was typed.\n */\nexport const ControlPassword = (props: ControlPasswordProps) => {\n const [reveal, setReveal] = useState(false);\n const Icon = props.icon;\n return (\n <FormField\n id={props.id}\n label={props.label}\n description={props.description}\n error={props.error}\n required={props.required}\n >\n <div className=\"relative\">\n {Icon && (\n <Icon className=\"text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2
|
|
1
|
+
{"version":3,"file":"control-password.js","names":[],"sources":["../../../src/components/control-password/control-password.tsx"],"sourcesContent":["import {\n FormField,\n formFieldAriaProps,\n} from \"@alepha/ui/components/control-base/form-field\";\nimport type { IconComponent } from \"@alepha/ui/components/control-base/icon-hint\";\nimport { Button } from \"@alepha/ui/components/ui/button\";\nimport { Input } from \"@alepha/ui/components/ui/input\";\nimport { Eye, EyeOff } from \"lucide-react\";\nimport { type HTMLAttributes, useState } from \"react\";\n\nexport interface ControlPasswordProps {\n id?: string;\n name?: string;\n label?: string;\n description?: string;\n error?: string;\n required?: boolean;\n disabled?: boolean;\n autoComplete?: string;\n autoFocus?: boolean;\n minLength?: number;\n maxLength?: number;\n inputProps?: HTMLAttributes<HTMLElement>;\n icon?: IconComponent;\n value: string;\n onChange: (v: string) => void;\n}\n\n/**\n * Masked password field with a reveal toggle.\n *\n * Lives outside `Control` so a hand-built form — a dialog that is not driven by\n * a schema — gets the same field the schema path renders, rather than pairing a\n * bare `<Input type=\"password\">` with no way to check what was typed.\n */\nexport const ControlPassword = (props: ControlPasswordProps) => {\n const [reveal, setReveal] = useState(false);\n const Icon = props.icon;\n return (\n <FormField\n id={props.id}\n label={props.label}\n description={props.description}\n error={props.error}\n required={props.required}\n >\n <div className=\"relative\">\n {Icon && (\n <Icon className=\"text-muted-foreground pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2\" />\n )}\n <Input\n {...props.inputProps}\n {...formFieldAriaProps({\n id: props.id,\n error: props.error,\n description: props.description,\n })}\n id={props.id}\n name={props.name}\n type={reveal ? \"text\" : \"password\"}\n autoComplete={props.autoComplete ?? \"current-password\"}\n\n disabled={props.disabled}\n required={props.required}\n minLength={props.minLength}\n maxLength={props.maxLength}\n value={props.value}\n onChange={(e) => props.onChange(e.target.value)}\n className={[props.inputProps?.className, Icon ? \"pr-9 pl-9\" : \"pr-9\"]\n .filter(Boolean)\n .join(\" \")}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={props.disabled}\n onClick={() => setReveal((r) => !r)}\n aria-label={reveal ? \"Hide password\" : \"Show password\"}\n className=\"text-muted-foreground hover:text-foreground absolute top-1/2 right-1 size-7 -translate-y-1/2\"\n >\n {reveal ? <EyeOff className=\"size-4\" /> : <Eye className=\"size-4\" />}\n </Button>\n </div>\n </FormField>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;AAmCA,MAAa,mBAAmB,UAAgC;CAC9D,MAAM,CAAC,QAAQ,aAAa,SAAS,KAAK;CAC1C,MAAM,OAAO,MAAM;CACnB,OACE,oBAAC,WAAD;EACE,IAAI,MAAM;EACV,OAAO,MAAM;EACb,aAAa,MAAM;EACnB,OAAO,MAAM;EACb,UAAU,MAAM;EAEhB,UAAA,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACG,QACC,oBAAC,MAAD,EAAM,WAAU,4FAA6F,CAAA;IAE/G,oBAAC,OAAD;KACE,GAAI,MAAM;KACV,GAAI,mBAAmB;MACrB,IAAI,MAAM;MACV,OAAO,MAAM;MACb,aAAa,MAAM;KACrB,CAAC;KACD,IAAI,MAAM;KACV,MAAM,MAAM;KACZ,MAAM,SAAS,SAAS;KACxB,cAAc,MAAM,gBAAgB;KAEpC,UAAU,MAAM;KAChB,UAAU,MAAM;KAChB,WAAW,MAAM;KACjB,WAAW,MAAM;KACjB,OAAO,MAAM;KACb,WAAW,MAAM,MAAM,SAAS,EAAE,OAAO,KAAK;KAC9C,WAAW,CAAC,MAAM,YAAY,WAAW,OAAO,cAAc,MAAM,CAAC,CAClE,OAAO,OAAO,CAAC,CACf,KAAK,GAAG;IACZ,CAAA;IACD,oBAAC,QAAD;KACE,MAAK;KACL,SAAQ;KACR,MAAK;KACL,UAAU,MAAM;KAChB,eAAe,WAAW,MAAM,CAAC,CAAC;KAClC,cAAY,SAAS,kBAAkB;KACvC,WAAU;KAET,UAAA,SAAS,oBAAC,QAAD,EAAQ,WAAU,SAAU,CAAA,IAAI,oBAAC,KAAD,EAAK,WAAU,SAAU,CAAA;IAC7D,CAAA;GACL;;CACI,CAAA;AAEf"}
|
|
@@ -61,7 +61,7 @@ export interface ControlSelectProps {
|
|
|
61
61
|
*/
|
|
62
62
|
loader?: (search: string, resolve?: string[]) => Async<SelectOption[]>;
|
|
63
63
|
/**
|
|
64
|
-
* Option count above which `loader` is invoked on every search instead of once. Defaults to
|
|
64
|
+
* Option count above which `loader` is invoked on every search instead of once. Defaults to 100.
|
|
65
65
|
*/
|
|
66
66
|
loaderThreshold?: number;
|
|
67
67
|
/**
|
|
@@ -124,5 +124,5 @@ export interface ControlSelectProps {
|
|
|
124
124
|
*/
|
|
125
125
|
icon?: IconComponent;
|
|
126
126
|
}
|
|
127
|
-
export declare
|
|
127
|
+
export declare const ControlSelect: (props: ControlSelectProps) => React.JSX.Element | null;
|
|
128
128
|
//# sourceMappingURL=control-select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"control-select.d.ts","sourceRoot":"","sources":["../../../src/components/control-select/control-select.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAgBlF,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"control-select.d.ts","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