@alepha/ui 0.25.1 → 0.26.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +136 -2
- package/dist/components/account/account-connections.d.ts +16 -0
- package/dist/components/account/account-connections.d.ts.map +1 -0
- package/dist/components/account/account-connections.js +76 -0
- package/dist/components/account/account-connections.js.map +1 -0
- package/dist/components/account/account-delete-dialog.d.ts +44 -0
- package/dist/components/account/account-delete-dialog.d.ts.map +1 -0
- package/dist/components/account/account-delete-dialog.js +126 -0
- package/dist/components/account/account-delete-dialog.js.map +1 -0
- package/dist/components/account/account-header.d.ts +33 -0
- package/dist/components/account/account-header.d.ts.map +1 -0
- package/dist/components/account/account-header.js +41 -0
- package/dist/components/account/account-header.js.map +1 -0
- package/dist/components/account/account-keys.d.ts +23 -0
- package/dist/components/account/account-keys.d.ts.map +1 -0
- package/dist/components/account/account-keys.js +168 -0
- package/dist/components/account/account-keys.js.map +1 -0
- package/dist/components/account/account-layout.d.ts +32 -0
- package/dist/components/account/account-layout.d.ts.map +1 -0
- package/dist/components/account/account-layout.js +53 -0
- package/dist/components/account/account-layout.js.map +1 -0
- package/dist/components/account/account-password-dialog.d.ts +31 -0
- package/dist/components/account/account-password-dialog.d.ts.map +1 -0
- package/dist/components/account/account-password-dialog.js +120 -0
- package/dist/components/account/account-password-dialog.js.map +1 -0
- package/dist/components/account/account-profile.d.ts +27 -0
- package/dist/components/account/account-profile.d.ts.map +1 -0
- package/dist/components/account/account-profile.js +217 -0
- package/dist/components/account/account-profile.js.map +1 -0
- package/dist/components/account/account-router-options.d.ts +77 -0
- package/dist/components/account/account-router-options.d.ts.map +1 -0
- package/dist/components/account/account-router-options.js +22 -0
- package/dist/components/account/account-router-options.js.map +1 -0
- package/dist/components/account/account-router-page.d.ts +49 -0
- package/dist/components/account/account-router-page.d.ts.map +1 -0
- package/dist/components/account/account-router-page.js +61 -0
- package/dist/components/account/account-router-page.js.map +1 -0
- package/dist/components/account/account-router.d.ts +214 -0
- package/dist/components/account/account-router.d.ts.map +1 -0
- package/dist/components/account/account-router.js +216 -0
- package/dist/components/account/account-router.js.map +1 -0
- package/dist/components/account/account-security.d.ts +22 -0
- package/dist/components/account/account-security.d.ts.map +1 -0
- package/dist/components/account/account-security.js +107 -0
- package/dist/components/account/account-security.js.map +1 -0
- package/dist/components/account/account-sessions.d.ts +17 -0
- package/dist/components/account/account-sessions.d.ts.map +1 -0
- package/dist/components/account/account-sessions.js +108 -0
- package/dist/components/account/account-sessions.js.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts +39 -0
- package/dist/components/action-error-toaster/action-error-toaster.d.ts.map +1 -0
- package/dist/components/action-error-toaster/action-error-toaster.js +40 -0
- package/dist/components/action-error-toaster/action-error-toaster.js.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts +16 -0
- package/dist/components/admin/admin-analytics-query-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-query-panel.js +117 -0
- package/dist/components/admin/admin-analytics-query-panel.js.map +1 -0
- package/dist/components/admin/admin-analytics-results.d.ts +15 -0
- package/dist/components/admin/admin-analytics-results.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics-results.js +56 -0
- package/dist/components/admin/admin-analytics-results.js.map +1 -0
- package/dist/components/admin/admin-analytics.d.ts +9 -0
- package/dist/components/admin/admin-analytics.d.ts.map +1 -0
- package/dist/components/admin/admin-analytics.js +66 -0
- package/dist/components/admin/admin-analytics.js.map +1 -0
- package/dist/components/admin/admin-audits.d.ts +4 -0
- package/dist/components/admin/admin-audits.d.ts.map +1 -0
- package/dist/components/admin/admin-audits.js +173 -0
- package/dist/components/admin/admin-audits.js.map +1 -0
- package/dist/components/admin/admin-files.d.ts +4 -0
- package/dist/components/admin/admin-files.d.ts.map +1 -0
- package/dist/components/admin/admin-files.js +237 -0
- package/dist/components/admin/admin-files.js.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts +11 -0
- package/dist/components/admin/admin-jobs-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-executions-panel.js +200 -0
- package/dist/components/admin/admin-jobs-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts +9 -0
- package/dist/components/admin/admin-jobs-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs-status-badge.js +26 -0
- package/dist/components/admin/admin-jobs-status-badge.js.map +1 -0
- package/dist/components/admin/admin-jobs.d.ts +4 -0
- package/dist/components/admin/admin-jobs.d.ts.map +1 -0
- package/dist/components/admin/admin-jobs.js +248 -0
- package/dist/components/admin/admin-jobs.js.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts +15 -0
- package/dist/components/admin/admin-keys-token-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-keys-token-dialog.js +66 -0
- package/dist/components/admin/admin-keys-token-dialog.js.map +1 -0
- package/dist/components/admin/admin-keys.d.ts +4 -0
- package/dist/components/admin/admin-keys.d.ts.map +1 -0
- package/dist/components/admin/admin-keys.js +161 -0
- package/dist/components/admin/admin-keys.js.map +1 -0
- package/dist/components/admin/admin-layout.d.ts +33 -0
- package/dist/components/admin/admin-layout.d.ts.map +1 -0
- package/dist/components/admin/admin-layout.js +101 -0
- package/dist/components/admin/admin-layout.js.map +1 -0
- package/dist/components/admin/admin-notifications.d.ts +4 -0
- package/dist/components/admin/admin-notifications.d.ts.map +1 -0
- package/dist/components/admin/admin-notifications.js +99 -0
- package/dist/components/admin/admin-notifications.js.map +1 -0
- package/dist/components/admin/admin-page.d.ts +16 -0
- package/dist/components/admin/admin-page.d.ts.map +1 -0
- package/dist/components/admin/admin-page.js +15 -0
- package/dist/components/admin/admin-page.js.map +1 -0
- package/dist/components/admin/admin-parameters.d.ts +26 -0
- package/dist/components/admin/admin-parameters.d.ts.map +1 -0
- package/dist/components/admin/admin-parameters.js +560 -0
- package/dist/components/admin/admin-parameters.js.map +1 -0
- package/dist/components/admin/admin-payments.d.ts +4 -0
- package/dist/components/admin/admin-payments.d.ts.map +1 -0
- package/dist/components/admin/admin-payments.js +72 -0
- package/dist/components/admin/admin-payments.js.map +1 -0
- package/dist/components/admin/admin-router-options.d.ts +135 -0
- package/dist/components/admin/admin-router-options.d.ts.map +1 -0
- package/dist/components/admin/admin-router-options.js +29 -0
- package/dist/components/admin/admin-router-options.js.map +1 -0
- package/dist/components/admin/admin-router-page.d.ts +54 -0
- package/dist/components/admin/admin-router-page.d.ts.map +1 -0
- package/dist/components/admin/admin-router-page.js +66 -0
- package/dist/components/admin/admin-router-page.js.map +1 -0
- package/dist/components/admin/admin-router.d.ts +169 -0
- package/dist/components/admin/admin-router.d.ts.map +1 -0
- package/dist/components/admin/admin-router.js +346 -0
- package/dist/components/admin/admin-router.js.map +1 -0
- package/dist/components/admin/admin-sessions.d.ts +4 -0
- package/dist/components/admin/admin-sessions.d.ts.map +1 -0
- package/dist/components/admin/admin-sessions.js +124 -0
- package/dist/components/admin/admin-sessions.js.map +1 -0
- package/dist/components/admin/admin-user-cell.d.ts +37 -0
- package/dist/components/admin/admin-user-cell.d.ts.map +1 -0
- package/dist/components/admin/admin-user-cell.js +35 -0
- package/dist/components/admin/admin-user-cell.js.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-audits-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js +55 -0
- package/dist/components/admin/admin-user-detail-audits-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts +14 -0
- package/dist/components/admin/admin-user-detail-identity-aside.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js +162 -0
- package/dist/components/admin/admin-user-detail-identity-aside.js.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts +26 -0
- package/dist/components/admin/admin-user-detail-overview-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js +60 -0
- package/dist/components/admin/admin-user-detail-overview-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts +15 -0
- package/dist/components/admin/admin-user-detail-password-dialog.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js +47 -0
- package/dist/components/admin/admin-user-detail-password-dialog.js.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts +10 -0
- package/dist/components/admin/admin-user-detail-password-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-password-schema.js +13 -0
- package/dist/components/admin/admin-user-detail-password-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts +56 -0
- package/dist/components/admin/admin-user-detail-profile-policy.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js +73 -0
- package/dist/components/admin/admin-user-detail-profile-policy.js.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts +18 -0
- package/dist/components/admin/admin-user-detail-profile-schema.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js +21 -0
- package/dist/components/admin/admin-user-detail-profile-schema.js.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts +20 -0
- package/dist/components/admin/admin-user-detail-security-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-security-tab.js +70 -0
- package/dist/components/admin/admin-user-detail-security-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts +25 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js +64 -0
- package/dist/components/admin/admin-user-detail-sessions-tab.js.map +1 -0
- package/dist/components/admin/admin-user-detail.d.ts +39 -0
- package/dist/components/admin/admin-user-detail.d.ts.map +1 -0
- package/dist/components/admin/admin-user-detail.js +386 -0
- package/dist/components/admin/admin-user-detail.js.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts +23 -0
- package/dist/components/admin/admin-users-roles-picker.d.ts.map +1 -0
- package/dist/components/admin/admin-users-roles-picker.js +77 -0
- package/dist/components/admin/admin-users-roles-picker.js.map +1 -0
- package/dist/components/admin/admin-users-status-filter.d.ts +13 -0
- package/dist/components/admin/admin-users-status-filter.d.ts.map +1 -0
- package/dist/components/admin/admin-users-status-filter.js +41 -0
- package/dist/components/admin/admin-users-status-filter.js.map +1 -0
- package/dist/components/admin/admin-users.d.ts +16 -0
- package/dist/components/admin/admin-users.d.ts.map +1 -0
- package/dist/components/admin/admin-users.js +325 -0
- package/dist/components/admin/admin-users.js.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts +11 -0
- package/dist/components/admin/admin-workflows-execution-sheet.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js +190 -0
- package/dist/components/admin/admin-workflows-execution-sheet.js.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts +9 -0
- package/dist/components/admin/admin-workflows-executions-panel.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-executions-panel.js +153 -0
- package/dist/components/admin/admin-workflows-executions-panel.js.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts +12 -0
- package/dist/components/admin/admin-workflows-status-badge.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows-status-badge.js +30 -0
- package/dist/components/admin/admin-workflows-status-badge.js.map +1 -0
- package/dist/components/admin/admin-workflows.d.ts +4 -0
- package/dist/components/admin/admin-workflows.d.ts.map +1 -0
- package/dist/components/admin/admin-workflows.js +145 -0
- package/dist/components/admin/admin-workflows.js.map +1 -0
- package/dist/components/admin/diff-lines.d.ts +13 -0
- package/dist/components/admin/diff-lines.d.ts.map +1 -0
- package/dist/components/admin/diff-lines.js +57 -0
- package/dist/components/admin/diff-lines.js.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts +36 -0
- package/dist/components/admin/parameter-diff-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-diff-dialog.js +58 -0
- package/dist/components/admin/parameter-diff-dialog.js.map +1 -0
- package/dist/components/admin/parameter-history-item.d.ts +17 -0
- package/dist/components/admin/parameter-history-item.d.ts.map +1 -0
- package/dist/components/admin/parameter-history-item.js +177 -0
- package/dist/components/admin/parameter-history-item.js.map +1 -0
- package/dist/components/admin/parameter-json-dialog.d.ts +13 -0
- package/dist/components/admin/parameter-json-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-json-dialog.js +63 -0
- package/dist/components/admin/parameter-json-dialog.js.map +1 -0
- package/dist/components/admin/parameter-save-dialog.d.ts +26 -0
- package/dist/components/admin/parameter-save-dialog.d.ts.map +1 -0
- package/dist/components/admin/parameter-save-dialog.js +74 -0
- package/dist/components/admin/parameter-save-dialog.js.map +1 -0
- package/dist/components/admin/use-confirmed-action.d.ts +53 -0
- package/dist/components/admin/use-confirmed-action.d.ts.map +1 -0
- package/dist/components/admin/use-confirmed-action.js +50 -0
- package/dist/components/admin/use-confirmed-action.js.map +1 -0
- package/dist/components/alepha-table/alepha-table.d.ts +218 -0
- package/dist/components/alepha-table/alepha-table.d.ts.map +1 -0
- package/dist/components/alepha-table/alepha-table.js +565 -0
- package/dist/components/alepha-table/alepha-table.js.map +1 -0
- package/dist/components/alepha-table/use-table-selection.d.ts +34 -0
- package/dist/components/alepha-table/use-table-selection.d.ts.map +1 -0
- package/dist/components/alepha-table/use-table-selection.js +45 -0
- package/dist/components/alepha-table/use-table-selection.js.map +1 -0
- package/dist/components/app-actions/app-actions.d.ts +74 -0
- package/dist/components/app-actions/app-actions.d.ts.map +1 -0
- package/dist/components/app-actions/app-actions.js +77 -0
- package/dist/components/app-actions/app-actions.js.map +1 -0
- package/dist/components/app-shell/app-shell.d.ts +135 -0
- package/dist/components/app-shell/app-shell.d.ts.map +1 -0
- package/dist/components/app-shell/app-shell.js +276 -0
- package/dist/components/app-shell/app-shell.js.map +1 -0
- package/dist/components/auth/auth-login.d.ts +40 -0
- package/dist/components/auth/auth-login.d.ts.map +1 -0
- package/dist/components/auth/auth-login.js +237 -0
- package/dist/components/auth/auth-login.js.map +1 -0
- package/dist/components/auth/auth-register.d.ts +35 -0
- package/dist/components/auth/auth-register.d.ts.map +1 -0
- package/dist/components/auth/auth-register.js +478 -0
- package/dist/components/auth/auth-register.js.map +1 -0
- package/dist/components/auth/auth-reset-password.d.ts +21 -0
- package/dist/components/auth/auth-reset-password.d.ts.map +1 -0
- package/dist/components/auth/auth-reset-password.js +283 -0
- package/dist/components/auth/auth-reset-password.js.map +1 -0
- package/dist/components/auth/auth-router.d.ts +245 -0
- package/dist/components/auth/auth-router.d.ts.map +1 -0
- package/dist/components/auth/auth-router.js +117 -0
- package/dist/components/auth/auth-router.js.map +1 -0
- package/dist/components/auth/auth-verify-email.d.ts +19 -0
- package/dist/components/auth/auth-verify-email.d.ts.map +1 -0
- package/dist/components/auth/auth-verify-email.js +124 -0
- package/dist/components/auth/auth-verify-email.js.map +1 -0
- package/dist/components/auth/provider-labels.d.ts +9 -0
- package/dist/components/auth/provider-labels.d.ts.map +1 -0
- package/dist/components/auth/provider-labels.js +20 -0
- package/dist/components/auth/provider-labels.js.map +1 -0
- package/dist/components/auto-form/auto-form.d.ts +219 -0
- package/dist/components/auto-form/auto-form.d.ts.map +1 -0
- package/dist/components/auto-form/auto-form.js +412 -0
- package/dist/components/auto-form/auto-form.js.map +1 -0
- package/dist/components/brand-icon/brand-icon.d.ts +18 -0
- package/dist/components/brand-icon/brand-icon.d.ts.map +1 -0
- package/dist/components/brand-icon/brand-icon.js +84 -0
- package/dist/components/brand-icon/brand-icon.js.map +1 -0
- package/dist/components/button-dark/button-dark.d.ts +25 -0
- package/dist/components/button-dark/button-dark.d.ts.map +1 -0
- package/dist/components/button-dark/button-dark.js +44 -0
- package/dist/components/button-dark/button-dark.js.map +1 -0
- package/dist/components/button-language/button-language.d.ts +24 -0
- package/dist/components/button-language/button-language.d.ts.map +1 -0
- package/dist/components/button-language/button-language.js +50 -0
- package/dist/components/button-language/button-language.js.map +1 -0
- package/dist/components/button-theme/button-theme.d.ts +33 -0
- package/dist/components/button-theme/button-theme.d.ts.map +1 -0
- package/dist/components/button-theme/button-theme.js +90 -0
- package/dist/components/button-theme/button-theme.js.map +1 -0
- package/dist/components/button-user/button-user.d.ts +147 -0
- package/dist/components/button-user/button-user.d.ts.map +1 -0
- package/dist/components/button-user/button-user.js +147 -0
- package/dist/components/button-user/button-user.js.map +1 -0
- package/dist/components/captcha/turnstile-widget.d.ts +59 -0
- package/dist/components/captcha/turnstile-widget.d.ts.map +1 -0
- package/dist/components/captcha/turnstile-widget.js +97 -0
- package/dist/components/captcha/turnstile-widget.js.map +1 -0
- package/dist/components/control/control.d.ts +200 -0
- package/dist/components/control/control.d.ts.map +1 -0
- package/dist/components/control/control.js +300 -0
- package/dist/components/control/control.js.map +1 -0
- package/dist/components/control-array/control-array.d.ts +77 -0
- package/dist/components/control-array/control-array.d.ts.map +1 -0
- package/dist/components/control-array/control-array.js +444 -0
- package/dist/components/control-array/control-array.js.map +1 -0
- package/dist/components/control-base/field-i18n.d.ts +30 -0
- package/dist/components/control-base/field-i18n.d.ts.map +1 -0
- package/dist/components/control-base/field-i18n.js +27 -0
- package/dist/components/control-base/field-i18n.js.map +1 -0
- package/dist/components/control-base/form-field.d.ts +128 -0
- package/dist/components/control-base/form-field.d.ts.map +1 -0
- package/dist/components/control-base/form-field.js +208 -0
- package/dist/components/control-base/form-field.js.map +1 -0
- package/dist/components/control-base/grid.d.ts +18 -0
- package/dist/components/control-base/grid.d.ts.map +1 -0
- package/dist/components/control-base/grid.js +46 -0
- package/dist/components/control-base/grid.js.map +1 -0
- package/dist/components/control-base/icon-hint.d.ts +9 -0
- package/dist/components/control-base/icon-hint.d.ts.map +1 -0
- package/dist/components/control-base/icon-hint.js +35 -0
- package/dist/components/control-base/icon-hint.js.map +1 -0
- package/dist/components/control-date/control-date.d.ts +34 -0
- package/dist/components/control-date/control-date.d.ts.map +1 -0
- package/dist/components/control-date/control-date.js +111 -0
- package/dist/components/control-date/control-date.js.map +1 -0
- package/dist/components/control-number/control-number.d.ts +38 -0
- package/dist/components/control-number/control-number.d.ts.map +1 -0
- package/dist/components/control-number/control-number.js +77 -0
- package/dist/components/control-number/control-number.js.map +1 -0
- package/dist/components/control-object/control-object.d.ts +45 -0
- package/dist/components/control-object/control-object.d.ts.map +1 -0
- package/dist/components/control-object/control-object.js +110 -0
- package/dist/components/control-object/control-object.js.map +1 -0
- package/dist/components/control-password/control-password.d.ts +28 -0
- package/dist/components/control-password/control-password.d.ts.map +1 -0
- package/dist/components/control-password/control-password.js +65 -0
- package/dist/components/control-password/control-password.js.map +1 -0
- package/dist/components/control-select/control-select.d.ts +128 -0
- package/dist/components/control-select/control-select.d.ts.map +1 -0
- package/dist/components/control-select/control-select.js +363 -0
- package/dist/components/control-select/control-select.js.map +1 -0
- package/dist/components/control-upload/control-upload.d.ts +67 -0
- package/dist/components/control-upload/control-upload.d.ts.map +1 -0
- package/dist/components/control-upload/control-upload.js +294 -0
- package/dist/components/control-upload/control-upload.js.map +1 -0
- package/dist/components/file-image/file-image.d.ts +31 -0
- package/dist/components/file-image/file-image.d.ts.map +1 -0
- package/dist/components/file-image/file-image.js +27 -0
- package/dist/components/file-image/file-image.js.map +1 -0
- package/dist/components/language-toggle/language-toggle.d.ts +8 -0
- package/dist/components/language-toggle/language-toggle.d.ts.map +1 -0
- package/dist/components/language-toggle/language-toggle.js +49 -0
- package/dist/components/language-toggle/language-toggle.js.map +1 -0
- package/dist/components/markdown-view/markdown-view.css +114 -0
- package/dist/components/markdown-view/markdown-view.d.ts +21 -0
- package/dist/components/markdown-view/markdown-view.d.ts.map +1 -0
- package/dist/components/markdown-view/markdown-view.js +104 -0
- package/dist/components/markdown-view/markdown-view.js.map +1 -0
- package/dist/components/nav-shell/nav-page.d.ts +24 -0
- package/dist/components/nav-shell/nav-page.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-page.js +28 -0
- package/dist/components/nav-shell/nav-page.js.map +1 -0
- package/dist/components/nav-shell/nav-shell.d.ts +26 -0
- package/dist/components/nav-shell/nav-shell.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-shell.js +53 -0
- package/dist/components/nav-shell/nav-shell.js.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts +65 -0
- package/dist/components/nav-shell/nav-tree-util.d.ts.map +1 -0
- package/dist/components/nav-shell/nav-tree-util.js +87 -0
- package/dist/components/nav-shell/nav-tree-util.js.map +1 -0
- package/dist/components/nav-shell/spotlight.d.ts +37 -0
- package/dist/components/nav-shell/spotlight.d.ts.map +1 -0
- package/dist/components/nav-shell/spotlight.js +102 -0
- package/dist/components/nav-shell/spotlight.js.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts +24 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js +36 -0
- package/dist/components/nav-shell/use-nav-breadcrumbs.js.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts +45 -0
- package/dist/components/nav-shell/use-nav-entries.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-entries.js +60 -0
- package/dist/components/nav-shell/use-nav-entries.js.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts +21 -0
- package/dist/components/nav-shell/use-nav-tree.d.ts.map +1 -0
- package/dist/components/nav-shell/use-nav-tree.js +48 -0
- package/dist/components/nav-shell/use-nav-tree.js.map +1 -0
- package/dist/components/settings/settings-danger-section.d.ts +35 -0
- package/dist/components/settings/settings-danger-section.d.ts.map +1 -0
- package/dist/components/settings/settings-danger-section.js +42 -0
- package/dist/components/settings/settings-danger-section.js.map +1 -0
- package/dist/components/settings/settings-heading.d.ts +36 -0
- package/dist/components/settings/settings-heading.d.ts.map +1 -0
- package/dist/components/settings/settings-heading.js +39 -0
- package/dist/components/settings/settings-heading.js.map +1 -0
- package/dist/components/settings/settings-layout.d.ts +81 -0
- package/dist/components/settings/settings-layout.d.ts.map +1 -0
- package/dist/components/settings/settings-layout.js +56 -0
- package/dist/components/settings/settings-layout.js.map +1 -0
- package/dist/components/settings/settings-nav.d.ts +85 -0
- package/dist/components/settings/settings-nav.d.ts.map +1 -0
- package/dist/components/settings/settings-nav.js +91 -0
- package/dist/components/settings/settings-nav.js.map +1 -0
- package/dist/components/settings/settings-row.d.ts +45 -0
- package/dist/components/settings/settings-row.d.ts.map +1 -0
- package/dist/components/settings/settings-row.js +44 -0
- package/dist/components/settings/settings-row.js.map +1 -0
- package/dist/components/settings/settings-section.d.ts +36 -0
- package/dist/components/settings/settings-section.d.ts.map +1 -0
- package/dist/components/settings/settings-section.js +36 -0
- package/dist/components/settings/settings-section.js.map +1 -0
- package/dist/components/ui/accordion.d.ts +7 -0
- package/dist/components/ui/accordion.d.ts.map +1 -0
- package/dist/components/ui/accordion.js +55 -0
- package/dist/components/ui/accordion.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +19 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert-dialog.js +96 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +11 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/alert.js +44 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/aspect-ratio.d.ts +5 -0
- package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
- package/dist/components/ui/aspect-ratio.js +15 -0
- package/dist/components/ui/aspect-ratio.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +12 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/avatar.js +52 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +8 -0
- package/dist/components/ui/badge.d.ts.map +1 -0
- package/dist/components/ui/badge.js +31 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +11 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.js +73 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +11 -0
- package/dist/components/ui/button-group.d.ts.map +1 -0
- package/dist/components/ui/button-group.js +43 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +18 -0
- package/dist/components/ui/button.d.ts.map +1 -0
- package/dist/components/ui/button.js +60 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/components/ui/calendar.d.ts +11 -0
- package/dist/components/ui/calendar.d.ts.map +1 -0
- package/dist/components/ui/calendar.js +119 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +12 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/carousel.d.ts +29 -0
- package/dist/components/ui/carousel.d.ts.map +1 -0
- package/dist/components/ui/carousel.js +134 -0
- package/dist/components/ui/carousel.js.map +1 -0
- package/dist/components/ui/chart.d.ts +45 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/chart.js +151 -0
- package/dist/components/ui/chart.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +4 -0
- package/dist/components/ui/checkbox.d.ts.map +1 -0
- package/dist/components/ui/checkbox.js +22 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +6 -0
- package/dist/components/ui/collapsible.d.ts.map +1 -0
- package/dist/components/ui/collapsible.js +26 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +25 -0
- package/dist/components/ui/combobox.d.ts.map +1 -0
- package/dist/components/ui/combobox.js +164 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/command.d.ts +20 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/command.js +89 -0
- package/dist/components/ui/command.js.map +1 -0
- package/dist/components/ui/context-menu.d.ts +30 -0
- package/dist/components/ui/context-menu.d.ts.map +1 -0
- package/dist/components/ui/context-menu.js +134 -0
- package/dist/components/ui/context-menu.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +18 -0
- package/dist/components/ui/dialog.d.ts.map +1 -0
- package/dist/components/ui/dialog.js +93 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/direction.d.ts +2 -0
- package/dist/components/ui/direction.d.ts.map +1 -0
- package/dist/components/ui/direction.js +3 -0
- package/dist/components/ui/drawer.d.ts +17 -0
- package/dist/components/ui/drawer.d.ts.map +1 -0
- package/dist/components/ui/drawer.js +125 -0
- package/dist/components/ui/drawer.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +30 -0
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
- package/dist/components/ui/dropdown-menu.js +138 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +12 -0
- package/dist/components/ui/empty.d.ts.map +1 -0
- package/dist/components/ui/empty.js +61 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/hover-card.d.ts +6 -0
- package/dist/components/ui/hover-card.d.ts.map +1 -0
- package/dist/components/ui/hover-card.js +38 -0
- package/dist/components/ui/hover-card.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +19 -0
- package/dist/components/ui/input-group.d.ts.map +1 -0
- package/dist/components/ui/input-group.js +80 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input-otp.d.ts +12 -0
- package/dist/components/ui/input-otp.d.ts.map +1 -0
- package/dist/components/ui/input-otp.js +49 -0
- package/dist/components/ui/input-otp.js.map +1 -0
- package/dist/components/ui/input.d.ts +4 -0
- package/dist/components/ui/input.d.ts.map +1 -0
- package/dist/components/ui/input.js +16 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +23 -0
- package/dist/components/ui/item.d.ts.map +1 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +4 -0
- package/dist/components/ui/kbd.d.ts.map +1 -0
- package/dist/components/ui/kbd.js +21 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +4 -0
- package/dist/components/ui/label.d.ts.map +1 -0
- package/dist/components/ui/label.js +15 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/menubar.d.ts +30 -0
- package/dist/components/ui/menubar.d.ts.map +1 -0
- package/dist/components/ui/menubar.js +137 -0
- package/dist/components/ui/menubar.js.map +1 -0
- package/dist/components/ui/navigation-menu.d.ts +12 -0
- package/dist/components/ui/navigation-menu.d.ts.map +1 -0
- package/dist/components/ui/navigation-menu.js +84 -0
- package/dist/components/ui/navigation-menu.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +18 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/pagination.js +87 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +10 -0
- package/dist/components/ui/popover.d.ts.map +1 -0
- package/dist/components/ui/popover.js +56 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +8 -0
- package/dist/components/ui/progress.d.ts.map +1 -0
- package/dist/components/ui/progress.js +46 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +6 -0
- package/dist/components/ui/radio-group.d.ts.map +1 -0
- package/dist/components/ui/radio-group.js +29 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/resizable.d.ts +8 -0
- package/dist/components/ui/resizable.d.ts.map +1 -0
- package/dist/components/ui/resizable.js +30 -0
- package/dist/components/ui/resizable.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +5 -0
- package/dist/components/ui/scroll-area.d.ts.map +1 -0
- package/dist/components/ui/scroll-area.js +38 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/segmented.d.ts +46 -0
- package/dist/components/ui/segmented.d.ts.map +1 -0
- package/dist/components/ui/segmented.js +119 -0
- package/dist/components/ui/segmented.js.map +1 -0
- package/dist/components/ui/select.d.ts +16 -0
- package/dist/components/ui/select.d.ts.map +1 -0
- package/dist/components/ui/select.js +99 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +4 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/separator.js +17 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +15 -0
- package/dist/components/ui/sheet.d.ts.map +1 -0
- package/dist/components/ui/sheet.js +90 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +64 -0
- package/dist/components/ui/sidebar.d.ts.map +1 -0
- package/dist/components/ui/sidebar.js +388 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +3 -0
- package/dist/components/ui/skeleton.d.ts.map +1 -0
- package/dist/components/ui/skeleton.js +14 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +4 -0
- package/dist/components/ui/slider.d.ts.map +1 -0
- package/dist/components/ui/slider.js +35 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/sonner.js +33 -0
- package/dist/components/ui/sonner.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +3 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/spinner.js +17 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.d.ts.map +1 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +11 -0
- package/dist/components/ui/table.d.ts.map +1 -0
- package/dist/components/ui/table.js +68 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +11 -0
- package/dist/components/ui/tabs.d.ts.map +1 -0
- package/dist/components/ui/tabs.js +47 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +12 -0
- package/dist/components/ui/toggle-group.d.ts.map +1 -0
- package/dist/components/ui/toggle-group.js +54 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +9 -0
- package/dist/components/ui/toggle.d.ts.map +1 -0
- package/dist/components/ui/toggle.js +38 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +7 -0
- package/dist/components/ui/tooltip.d.ts.map +1 -0
- package/dist/components/ui/tooltip.js +43 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/components/use-dialog/use-dialog.d.ts +61 -0
- package/dist/components/use-dialog/use-dialog.d.ts.map +1 -0
- package/dist/components/use-dialog/use-dialog.js +139 -0
- package/dist/components/use-dialog/use-dialog.js.map +1 -0
- package/dist/components/use-toast/use-toast.d.ts +37 -0
- package/dist/components/use-toast/use-toast.d.ts.map +1 -0
- package/dist/components/use-toast/use-toast.js +32 -0
- package/dist/components/use-toast/use-toast.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +2 -0
- package/dist/hooks/use-mobile.d.ts.map +1 -0
- package/dist/hooks/use-mobile.js +20 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/lib/i18n-fr.d.ts +46 -0
- package/dist/lib/i18n-fr.d.ts.map +1 -0
- package/dist/lib/i18n-fr.js +505 -0
- package/dist/lib/i18n-fr.js.map +1 -0
- package/dist/lib/resize-image.d.ts +50 -0
- package/dist/lib/resize-image.d.ts.map +1 -0
- package/dist/lib/resize-image.js +68 -0
- package/dist/lib/resize-image.js.map +1 -0
- package/dist/lib/utils.d.ts +3 -0
- package/dist/lib/utils.d.ts.map +1 -0
- package/dist/lib/utils.js +10 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/styles.css +254 -0
- package/package.json +46 -15
- package/src/components/account/__tests__/account-router.spec.ts +201 -0
- package/src/components/account/account-connections.tsx +111 -0
- package/src/components/account/account-delete-dialog.tsx +184 -0
- package/src/components/account/account-header.tsx +57 -0
- package/src/components/account/account-keys.tsx +221 -0
- package/src/components/account/account-layout.tsx +66 -0
- package/src/components/account/account-password-dialog.tsx +152 -0
- package/src/components/account/account-profile.tsx +342 -0
- package/src/components/account/account-router-options.tsx +88 -0
- package/src/components/account/account-router-page.tsx +69 -0
- package/src/components/account/account-router.tsx +233 -0
- package/src/components/account/account-security.tsx +150 -0
- package/src/components/account/account-sessions.tsx +140 -0
- package/src/components/admin/__tests__/admin-keys-token-dialog.browser.spec.tsx +62 -0
- package/src/components/admin/__tests__/admin-layout.browser.spec.tsx +82 -0
- package/src/components/admin/__tests__/admin-router-page.spec.ts +54 -0
- package/src/components/admin/__tests__/admin-router.spec.ts +208 -0
- package/src/components/admin/__tests__/admin-user-cell.browser.spec.tsx +99 -0
- package/src/components/admin/__tests__/admin-user-detail.spec.ts +29 -0
- package/src/components/admin/admin-analytics-query-panel.tsx +149 -0
- package/src/components/admin/admin-analytics-results.tsx +95 -0
- package/src/components/admin/admin-analytics.tsx +104 -0
- package/src/components/admin/admin-audits.tsx +12 -15
- package/src/components/admin/admin-files.tsx +10 -18
- package/src/components/admin/admin-jobs-executions-panel.tsx +2 -1
- package/src/components/admin/admin-jobs.tsx +3 -1
- package/src/components/admin/admin-keys-token-dialog.tsx +123 -0
- package/src/components/admin/admin-keys.tsx +54 -3
- package/src/components/admin/admin-layout.tsx +107 -0
- package/src/components/admin/admin-payments.tsx +4 -5
- package/src/components/admin/admin-router-options.tsx +150 -0
- package/src/components/admin/admin-router-page.tsx +74 -0
- package/src/components/admin/admin-router.tsx +379 -0
- package/src/components/admin/admin-sessions.tsx +2 -16
- package/src/components/admin/admin-user-cell.tsx +70 -0
- package/src/components/admin/admin-user-detail-overview-tab.tsx +28 -0
- package/src/components/admin/admin-user-detail-profile-policy.spec.ts +146 -0
- package/src/components/admin/admin-user-detail-profile-policy.ts +147 -0
- package/src/components/admin/admin-user-detail-security-tab.tsx +1 -1
- package/src/components/admin/admin-user-detail.tsx +76 -32
- package/src/components/admin/admin-users-status-filter.tsx +2 -0
- package/src/components/admin/admin-workflows-execution-sheet.tsx +277 -0
- package/src/components/admin/admin-workflows-executions-panel.tsx +170 -0
- package/src/components/admin/admin-workflows-status-badge.tsx +40 -0
- package/src/components/admin/admin-workflows.tsx +207 -0
- package/src/components/alepha-table/alepha-table.tsx +91 -19
- package/src/components/app-actions/__tests__/app-actions.browser.spec.tsx +79 -0
- package/src/components/app-actions/app-actions.tsx +118 -0
- package/src/components/app-shell/app-shell.tsx +122 -0
- package/src/components/auth/auth-register.tsx +55 -17
- package/src/components/auth/auth-reset-password.tsx +81 -8
- package/src/components/auto-form/__tests__/auto-form-settings-card.browser.spec.tsx +237 -0
- package/src/components/auto-form/auto-form.tsx +113 -27
- package/src/components/button-user/button-user.tsx +121 -5
- package/src/components/control/control.tsx +47 -79
- package/src/components/control-base/form-field.tsx +60 -3
- package/src/components/control-password/control-password.tsx +87 -0
- package/src/components/control-select/__tests__/control-select-clear-label.browser.spec.tsx +101 -0
- package/src/components/control-select/__tests__/control-select-searchable.browser.spec.tsx +142 -0
- package/src/components/control-select/control-select.tsx +78 -111
- package/src/components/control-upload/control-upload.tsx +27 -1
- package/src/components/markdown-view/__tests__/markdown-view-raw-html.browser.spec.tsx +48 -0
- package/src/components/markdown-view/markdown-view.tsx +14 -0
- package/src/components/nav-shell/__tests__/nav-tree-util.spec.ts +88 -0
- package/src/components/nav-shell/nav-page.tsx +3 -3
- package/src/components/nav-shell/nav-tree-util.ts +48 -0
- package/src/components/nav-shell/use-nav-entries.ts +11 -2
- package/src/components/settings/__tests__/settings-nav.browser.spec.tsx +123 -0
- package/src/components/settings/__tests__/settings-section.browser.spec.tsx +130 -0
- package/src/components/settings/settings-danger-section.tsx +59 -0
- package/src/components/settings/settings-heading.tsx +55 -0
- package/src/components/settings/settings-layout.tsx +115 -0
- package/src/components/settings/settings-nav.tsx +175 -0
- package/src/components/settings/settings-row.tsx +81 -0
- package/src/components/settings/settings-section.tsx +52 -0
- package/src/components/ui/dropdown-menu.tsx +9 -1
- package/src/components/ui/segmented.tsx +19 -2
- package/src/lib/i18n-fr.ts +68 -0
- package/src/lib/resize-image.ts +135 -0
- package/src/styles.css +126 -1
- /package/src/components/{admin/admin-user-detail-provider-labels.ts → auth/provider-labels.ts} +0 -0
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type ReactNode } from "react";
|
|
3
|
+
export type FormFieldLayout = "stack" | "row";
|
|
4
|
+
export declare function FormFieldLayoutProvider(props: {
|
|
5
|
+
value: FormFieldLayout;
|
|
6
|
+
children: ReactNode;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* Read the ambient layout (see {@link FormFieldLayoutProvider}).
|
|
10
|
+
*
|
|
11
|
+
* `<FormField>` reads this itself, so a widget only needs the hook when it
|
|
12
|
+
* sizes or arranges something *around* its FormField — `<Control>` uses it to
|
|
13
|
+
* give text inputs the settings-row column width.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useFormFieldLayout(): FormFieldLayout;
|
|
16
|
+
export declare function FormFieldAutoSaveProvider(props: {
|
|
17
|
+
value: boolean;
|
|
18
|
+
children: ReactNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
/**
|
|
21
|
+
* Read the ambient auto-save flag (see {@link FormFieldAutoSaveProvider}).
|
|
22
|
+
*/
|
|
23
|
+
export declare function useFormFieldAutoSave(): boolean;
|
|
24
|
+
export declare function FormFieldRequiredMarkerProvider(props: {
|
|
25
|
+
value: boolean;
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
}): React.JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Read the ambient required-marker flag (see
|
|
30
|
+
* {@link FormFieldRequiredMarkerProvider}).
|
|
31
|
+
*/
|
|
32
|
+
export declare function useFormFieldRequiredMarker(): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Id of the error element a `<FormField id={id} error>` renders.
|
|
35
|
+
*/
|
|
36
|
+
export declare function formFieldErrorId(id?: string, error?: string): string | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Id of the description element a `<FormField id={id} description>` renders
|
|
39
|
+
* (the description is replaced by the error when both are set).
|
|
40
|
+
*/
|
|
41
|
+
export declare function formFieldDescriptionId(id?: string, description?: string, error?: string): string | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* The aria attributes a control spreads on its native element when it
|
|
44
|
+
* renders its own `<FormField>` (id/error/description in hand). Widgets
|
|
45
|
+
* nested under someone else's FormField use {@link useFormFieldA11y}
|
|
46
|
+
* instead.
|
|
47
|
+
*/
|
|
48
|
+
export declare function formFieldAriaProps(props: {
|
|
49
|
+
id?: string;
|
|
50
|
+
error?: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
required?: boolean;
|
|
53
|
+
}): {
|
|
54
|
+
"aria-invalid"?: true;
|
|
55
|
+
"aria-describedby"?: string;
|
|
56
|
+
"aria-required"?: true;
|
|
57
|
+
};
|
|
58
|
+
export interface FormFieldA11y {
|
|
59
|
+
/**
|
|
60
|
+
* `true` when the surrounding FormField carries an error — mirror it
|
|
61
|
+
* onto the widget's `aria-invalid`.
|
|
62
|
+
*/
|
|
63
|
+
invalid?: true;
|
|
64
|
+
/**
|
|
65
|
+
* Id of the FormField's error (or description) element — mirror it
|
|
66
|
+
* onto the widget's `aria-describedby`.
|
|
67
|
+
*/
|
|
68
|
+
describedBy?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Read the surrounding FormField's accessibility wiring. Leaf widgets
|
|
72
|
+
* spread the result onto their native element so screen readers announce
|
|
73
|
+
* the invalid state and the error/description text:
|
|
74
|
+
*
|
|
75
|
+
* ```tsx
|
|
76
|
+
* const a11y = useFormFieldA11y();
|
|
77
|
+
* <input aria-invalid={a11y.invalid} aria-describedby={a11y.describedBy} />
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function useFormFieldA11y(): FormFieldA11y;
|
|
81
|
+
export interface FormFieldProps {
|
|
82
|
+
/**
|
|
83
|
+
* `id` linked to the inner control's `htmlFor`.
|
|
84
|
+
*/
|
|
85
|
+
id?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Label text rendered above the control.
|
|
88
|
+
*/
|
|
89
|
+
label?: string;
|
|
90
|
+
/**
|
|
91
|
+
* Helper text rendered below the control.
|
|
92
|
+
*/
|
|
93
|
+
description?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Error message. When set, marks descendant inputs invalid via `data-invalid`.
|
|
96
|
+
*/
|
|
97
|
+
error?: string;
|
|
98
|
+
/**
|
|
99
|
+
* Show a required marker (`*`) next to the label.
|
|
100
|
+
*/
|
|
101
|
+
required?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Extra classes applied to the wrapper.
|
|
104
|
+
*/
|
|
105
|
+
className?: string;
|
|
106
|
+
/**
|
|
107
|
+
* Layout variant.
|
|
108
|
+
* - `"stack"` (default): label on top, control below, description under.
|
|
109
|
+
* - `"row"`: settings-style — label/description on the left, control on
|
|
110
|
+
* the right. Stacks on narrow viewports.
|
|
111
|
+
*
|
|
112
|
+
* When omitted, falls back to the ambient `<FormFieldLayoutProvider>`.
|
|
113
|
+
*/
|
|
114
|
+
layout?: FormFieldLayout;
|
|
115
|
+
/**
|
|
116
|
+
* The control to wrap.
|
|
117
|
+
*/
|
|
118
|
+
children: ReactNode;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Label + description + error wrapper shared by every Control variant.
|
|
122
|
+
*
|
|
123
|
+
* When `error` is set, applies a red ring to any descendant `<input>`,
|
|
124
|
+
* `<textarea>`, or trigger button via the `data-invalid` attribute (so we
|
|
125
|
+
* don't have to thread `error` through every leaf widget).
|
|
126
|
+
*/
|
|
127
|
+
export declare function FormField(props: FormFieldProps): React.JSX.Element;
|
|
128
|
+
//# sourceMappingURL=form-field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"form-field.d.ts","sourceRoot":"","sources":["../../../src/components/control-base/form-field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAiB,KAAK,SAAS,EAAuB,MAAM,OAAO,CAAC;AAE3E,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,KAAK,CAAC;AAS9C,wBAAgB,uBAAuB,CAAC,KAAK,EAAE;IAC7C,KAAK,EAAE,eAAe,CAAC;IACvB,QAAQ,EAAE,SAAS,CAAC;CACrB,qBAMA;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AASD,wBAAgB,yBAAyB,CAAC,KAAK,EAAE;IAC/C,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;CACrB,qBAMA;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAE9C;AAgBD,wBAAgB,+BAA+B,CAAC,KAAK,EAAE;IACrD,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,SAAS,CAAC;CACrB,qBAMA;AAED;;;GAGG;AACH,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,CAAC,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,GAAG,SAAS,CAEpB;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,CAAC,EAAE,MAAM,EACX,WAAW,CAAC,EAAE,MAAM,EACpB,KAAK,CAAC,EAAE,MAAM,GACb,MAAM,GAAG,SAAS,CAEpB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE;IACxC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,GAAG;IACF,cAAc,CAAC,EAAE,IAAI,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,IAAI,CAAC;CACxB,CAWA;AAED,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,OAAO,CAAC,EAAE,IAAI,CAAC;IACf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAID;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,IAAI,aAAa,CAEhD;AAED,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,qBA4G9C"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { Label } from "../ui/label.js";
|
|
3
|
+
import { createContext, useContext, useMemo } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/control-base/form-field.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Ambient layout for every nested `<FormField>`. Defaults to `"stack"`.
|
|
8
|
+
* `<AutoForm layout="row">` wraps its tree in this context so every Control
|
|
9
|
+
* variant renders as a settings-style row without prop drilling.
|
|
10
|
+
*/
|
|
11
|
+
const FormFieldLayoutContext = createContext("stack");
|
|
12
|
+
function FormFieldLayoutProvider(props) {
|
|
13
|
+
return /* @__PURE__ */ jsx(FormFieldLayoutContext.Provider, {
|
|
14
|
+
value: props.value,
|
|
15
|
+
children: props.children
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Read the ambient layout (see {@link FormFieldLayoutProvider}).
|
|
20
|
+
*
|
|
21
|
+
* `<FormField>` reads this itself, so a widget only needs the hook when it
|
|
22
|
+
* sizes or arranges something *around* its FormField — `<Control>` uses it to
|
|
23
|
+
* give text inputs the settings-row column width.
|
|
24
|
+
*/
|
|
25
|
+
function useFormFieldLayout() {
|
|
26
|
+
return useContext(FormFieldLayoutContext);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Ambient flag enabling the inline save (tick) affordance on text Controls.
|
|
30
|
+
* Set by `<AutoForm autoSave>`; standalone Controls never show the tick
|
|
31
|
+
* unless explicitly placed inside this provider.
|
|
32
|
+
*/
|
|
33
|
+
const FormFieldAutoSaveContext = createContext(false);
|
|
34
|
+
function FormFieldAutoSaveProvider(props) {
|
|
35
|
+
return /* @__PURE__ */ jsx(FormFieldAutoSaveContext.Provider, {
|
|
36
|
+
value: props.value,
|
|
37
|
+
children: props.children
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Read the ambient auto-save flag (see {@link FormFieldAutoSaveProvider}).
|
|
42
|
+
*/
|
|
43
|
+
function useFormFieldAutoSave() {
|
|
44
|
+
return useContext(FormFieldAutoSaveContext);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Ambient control over the required marker (`*`). Defaults to showing it.
|
|
48
|
+
*
|
|
49
|
+
* `<AutoForm requiredMarker={false}>` turns it off for a form where nearly
|
|
50
|
+
* every field is required and the asterisks are noise rather than news.
|
|
51
|
+
*
|
|
52
|
+
* ⚠️ **This is a purely visual switch, and must stay one.** The marker is
|
|
53
|
+
* `aria-hidden`, so it never carried the information to assistive tech in the
|
|
54
|
+
* first place — `aria-required` on the input does, and it is set from the
|
|
55
|
+
* schema regardless of this flag. Hiding the marker must never be the reason a
|
|
56
|
+
* field stops announcing that it is required.
|
|
57
|
+
*/
|
|
58
|
+
const FormFieldRequiredMarkerContext = createContext(true);
|
|
59
|
+
function FormFieldRequiredMarkerProvider(props) {
|
|
60
|
+
return /* @__PURE__ */ jsx(FormFieldRequiredMarkerContext.Provider, {
|
|
61
|
+
value: props.value,
|
|
62
|
+
children: props.children
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Read the ambient required-marker flag (see
|
|
67
|
+
* {@link FormFieldRequiredMarkerProvider}).
|
|
68
|
+
*/
|
|
69
|
+
function useFormFieldRequiredMarker() {
|
|
70
|
+
return useContext(FormFieldRequiredMarkerContext);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Id of the error element a `<FormField id={id} error>` renders.
|
|
74
|
+
*/
|
|
75
|
+
function formFieldErrorId(id, error) {
|
|
76
|
+
return id && error ? `${id}-error` : void 0;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Id of the description element a `<FormField id={id} description>` renders
|
|
80
|
+
* (the description is replaced by the error when both are set).
|
|
81
|
+
*/
|
|
82
|
+
function formFieldDescriptionId(id, description, error) {
|
|
83
|
+
return id && description && !error ? `${id}-description` : void 0;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* The aria attributes a control spreads on its native element when it
|
|
87
|
+
* renders its own `<FormField>` (id/error/description in hand). Widgets
|
|
88
|
+
* nested under someone else's FormField use {@link useFormFieldA11y}
|
|
89
|
+
* instead.
|
|
90
|
+
*/
|
|
91
|
+
function formFieldAriaProps(props) {
|
|
92
|
+
return {
|
|
93
|
+
"aria-invalid": props.error ? true : void 0,
|
|
94
|
+
"aria-describedby": formFieldErrorId(props.id, props.error) ?? formFieldDescriptionId(props.id, props.description, props.error),
|
|
95
|
+
"aria-required": props.required ? true : void 0
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
const FormFieldA11yContext = createContext({});
|
|
99
|
+
/**
|
|
100
|
+
* Read the surrounding FormField's accessibility wiring. Leaf widgets
|
|
101
|
+
* spread the result onto their native element so screen readers announce
|
|
102
|
+
* the invalid state and the error/description text:
|
|
103
|
+
*
|
|
104
|
+
* ```tsx
|
|
105
|
+
* const a11y = useFormFieldA11y();
|
|
106
|
+
* <input aria-invalid={a11y.invalid} aria-describedby={a11y.describedBy} />
|
|
107
|
+
* ```
|
|
108
|
+
*/
|
|
109
|
+
function useFormFieldA11y() {
|
|
110
|
+
return useContext(FormFieldA11yContext);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Label + description + error wrapper shared by every Control variant.
|
|
114
|
+
*
|
|
115
|
+
* When `error` is set, applies a red ring to any descendant `<input>`,
|
|
116
|
+
* `<textarea>`, or trigger button via the `data-invalid` attribute (so we
|
|
117
|
+
* don't have to thread `error` through every leaf widget).
|
|
118
|
+
*/
|
|
119
|
+
function FormField(props) {
|
|
120
|
+
const ambient = useContext(FormFieldLayoutContext);
|
|
121
|
+
const layout = props.layout ?? ambient;
|
|
122
|
+
const requiredMarker = useFormFieldRequiredMarker();
|
|
123
|
+
const showRequiredMarker = props.required && requiredMarker;
|
|
124
|
+
const invalidClasses = props.error ? "[&_input]:border-destructive [&_input]:focus-visible:ring-destructive/30 [&_textarea]:border-destructive [&_textarea]:focus-visible:ring-destructive/30 [&_[role=combobox]]:border-destructive" : "";
|
|
125
|
+
const dataInvalid = props.error ? true : void 0;
|
|
126
|
+
const errorId = formFieldErrorId(props.id, props.error);
|
|
127
|
+
const descriptionId = formFieldDescriptionId(props.id, props.description, props.error);
|
|
128
|
+
const a11y = useMemo(() => ({
|
|
129
|
+
invalid: props.error ? true : void 0,
|
|
130
|
+
describedBy: errorId ?? descriptionId
|
|
131
|
+
}), [
|
|
132
|
+
props.error,
|
|
133
|
+
errorId,
|
|
134
|
+
descriptionId
|
|
135
|
+
]);
|
|
136
|
+
const children = /* @__PURE__ */ jsx(FormFieldA11yContext.Provider, {
|
|
137
|
+
value: a11y,
|
|
138
|
+
children: props.children
|
|
139
|
+
});
|
|
140
|
+
if (layout === "row") return /* @__PURE__ */ jsxs("div", {
|
|
141
|
+
className: cn("flex flex-col gap-3 px-4 py-3 sm:grid sm:grid-cols-[minmax(0,1fr)_auto] sm:items-center sm:gap-6", invalidClasses, props.className),
|
|
142
|
+
"data-invalid": dataInvalid,
|
|
143
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
144
|
+
className: "flex flex-col gap-0.5",
|
|
145
|
+
children: [
|
|
146
|
+
props.label && /* @__PURE__ */ jsxs(Label, {
|
|
147
|
+
htmlFor: props.id,
|
|
148
|
+
className: "font-medium",
|
|
149
|
+
children: [props.label, showRequiredMarker && /* @__PURE__ */ jsx("span", {
|
|
150
|
+
className: "text-destructive ml-0.5",
|
|
151
|
+
"aria-hidden": true,
|
|
152
|
+
children: "*"
|
|
153
|
+
})]
|
|
154
|
+
}),
|
|
155
|
+
props.description && !props.error && /* @__PURE__ */ jsx("p", {
|
|
156
|
+
id: descriptionId,
|
|
157
|
+
className: "text-muted-foreground text-xs",
|
|
158
|
+
children: props.description
|
|
159
|
+
}),
|
|
160
|
+
props.error && /* @__PURE__ */ jsxs("p", {
|
|
161
|
+
id: errorId,
|
|
162
|
+
className: "text-destructive text-xs flex items-center gap-1",
|
|
163
|
+
role: "alert",
|
|
164
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
165
|
+
"aria-hidden": true,
|
|
166
|
+
children: "⚠"
|
|
167
|
+
}), props.error]
|
|
168
|
+
})
|
|
169
|
+
]
|
|
170
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
171
|
+
className: "flex min-w-0 justify-start sm:justify-end",
|
|
172
|
+
children
|
|
173
|
+
})]
|
|
174
|
+
});
|
|
175
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
176
|
+
className: cn("flex flex-col gap-1.5", invalidClasses, props.className),
|
|
177
|
+
"data-invalid": dataInvalid,
|
|
178
|
+
children: [
|
|
179
|
+
props.label && /* @__PURE__ */ jsxs(Label, {
|
|
180
|
+
htmlFor: props.id,
|
|
181
|
+
children: [props.label, showRequiredMarker && /* @__PURE__ */ jsx("span", {
|
|
182
|
+
className: "text-destructive ml-0.5",
|
|
183
|
+
"aria-hidden": true,
|
|
184
|
+
children: "*"
|
|
185
|
+
})]
|
|
186
|
+
}),
|
|
187
|
+
children,
|
|
188
|
+
props.description && !props.error && /* @__PURE__ */ jsx("p", {
|
|
189
|
+
id: descriptionId,
|
|
190
|
+
className: "text-muted-foreground text-xs",
|
|
191
|
+
children: props.description
|
|
192
|
+
}),
|
|
193
|
+
props.error && /* @__PURE__ */ jsxs("p", {
|
|
194
|
+
id: errorId,
|
|
195
|
+
className: "text-destructive text-xs flex items-center gap-1",
|
|
196
|
+
role: "alert",
|
|
197
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
198
|
+
"aria-hidden": true,
|
|
199
|
+
children: "⚠"
|
|
200
|
+
}), props.error]
|
|
201
|
+
})
|
|
202
|
+
]
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
//#endregion
|
|
206
|
+
export { FormField, FormFieldAutoSaveProvider, FormFieldLayoutProvider, FormFieldRequiredMarkerProvider, formFieldAriaProps, formFieldDescriptionId, formFieldErrorId, useFormFieldA11y, useFormFieldAutoSave, useFormFieldLayout, useFormFieldRequiredMarker };
|
|
207
|
+
|
|
208
|
+
//# sourceMappingURL=form-field.js.map
|
|
@@ -0,0 +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;AAElE,SAAgB,gCAAgC,OAG7C;CACD,OACE,oBAAC,+BAA+B,UAAhC;EAAyC,OAAO,MAAM;EACnD,UAAA,MAAM;CACgC,CAAA;AAE7C;;;;;AAMA,SAAgB,6BAAsC;CACpD,OAAO,WAAW,8BAA8B;AAClD;;;;AAKA,SAAgB,iBACd,IACA,OACoB;CACpB,OAAO,MAAM,QAAQ,GAAG,GAAG,UAAU,KAAA;AACvC;;;;;AAMA,SAAgB,uBACd,IACA,aACA,OACoB;CACpB,OAAO,MAAM,eAAe,CAAC,QAAQ,GAAG,GAAG,gBAAgB,KAAA;AAC7D;;;;;;;AAQA,SAAgB,mBAAmB,OASjC;CACA,OAAO;EACL,gBAAgB,MAAM,QAAQ,OAAO,KAAA;EACrC,oBACE,iBAAiB,MAAM,IAAI,MAAM,KAAK,KACtC,uBAAuB,MAAM,IAAI,MAAM,aAAa,MAAM,KAAK;EAIjE,iBAAiB,MAAM,WAAW,OAAO,KAAA;CAC3C;AACF;AAeA,MAAM,uBAAuB,cAA6B,CAAC,CAAC;;;;;;;;;;;AAY5D,SAAgB,mBAAkC;CAChD,OAAO,WAAW,oBAAoB;AACxC;;;;;;;;AAiDA,SAAgB,UAAU,OAAuB;CAC/C,MAAM,UAAU,WAAW,sBAAsB;CACjD,MAAM,SAAS,MAAM,UAAU;CAG/B,MAAM,iBAAiB,2BAA2B;CAClD,MAAM,qBAAqB,MAAM,YAAY;CAC7C,MAAM,iBAAiB,MAAM,QACzB,mMACA;CACJ,MAAM,cAAc,MAAM,QAAQ,OAAO,KAAA;CAEzC,MAAM,UAAU,iBAAiB,MAAM,IAAI,MAAM,KAAK;CACtD,MAAM,gBAAgB,uBACpB,MAAM,IACN,MAAM,aACN,MAAM,KACR;CACA,MAAM,OAAO,eACJ;EACL,SAAS,MAAM,QAAQ,OAAO,KAAA;EAC9B,aAAa,WAAW;CAC1B,IACA;EAAC,MAAM;EAAO;EAAS;CAAa,CACtC;CACA,MAAM,WACJ,oBAAC,qBAAqB,UAAtB;EAA+B,OAAO;EACnC,UAAA,MAAM;CACsB,CAAA;CAGjC,IAAI,WAAW,OACb,OACE,qBAAC,OAAD;EACE,WAAW,GACT,oGACA,gBACA,MAAM,SACR;EACA,gBAAc;EANhB,UAAA,CAQE,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACG,MAAM,SACL,qBAAC,OAAD;KAAO,SAAS,MAAM;KAAI,WAAU;KAApC,UAAA,CACG,MAAM,OACN,sBACC,oBAAC,QAAD;MAAM,WAAU;MAA0B,eAAA;MAAY,UAAA;KAEhD,CAAA,CAEH;;IAER,MAAM,eAAe,CAAC,MAAM,SAC3B,oBAAC,KAAD;KAAG,IAAI;KAAe,WAAU;KAC7B,UAAA,MAAM;IACN,CAAA;IAEJ,MAAM,SACL,qBAAC,KAAD;KACE,IAAI;KACJ,WAAU;KACV,MAAK;KAHP,UAAA,CAKE,oBAAC,QAAD;MAAM,eAAA;MAAY,UAAA;KAAO,CAAA,GACxB,MAAM,KACN;;GAEF;EACL,CAAA,GAAA,oBAAC,OAAD;GAAK,WAAU;GACZ;EACE,CAAA,CACF;;CAIT,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"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { BaseInputField } from "alepha/react/form";
|
|
2
|
+
/**
|
|
3
|
+
* Decides the column-span (out of 12) for a control inside a 12-col grid.
|
|
4
|
+
*
|
|
5
|
+
* Rules (mirroring the legacy `CreateFormGroup.getBestSizeForInput`):
|
|
6
|
+
* - explicit `$control.width` or per-field `width` override → use it
|
|
7
|
+
* - `$control.area` / `file` / `upload` preset → 100% (full row)
|
|
8
|
+
* - long text (`maxLength >= 256`) → 100%
|
|
9
|
+
* - nested object / array of objects → 100%
|
|
10
|
+
* - array of primitives → 66% (2/3 row)
|
|
11
|
+
* - default → 33% (1/3 row)
|
|
12
|
+
*/
|
|
13
|
+
export declare const widthFor: (input: BaseInputField, override?: number) => number;
|
|
14
|
+
/**
|
|
15
|
+
* Maps a percentage width to a Tailwind `col-span-N` class on a 12-col grid.
|
|
16
|
+
*/
|
|
17
|
+
export declare const spanClass: (width: number) => string;
|
|
18
|
+
//# sourceMappingURL=grid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.d.ts","sourceRoot":"","sources":["../../../src/components/control-base/grid.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAExD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,UAAW,cAAc,aAAa,MAAM,KAAG,MA2BnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,UAAW,MAAM,KAAG,MAQzC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { z } from "alepha";
|
|
3
|
+
//#region src/components/control-base/grid.tsx
|
|
4
|
+
/**
|
|
5
|
+
* Decides the column-span (out of 12) for a control inside a 12-col grid.
|
|
6
|
+
*
|
|
7
|
+
* Rules (mirroring the legacy `CreateFormGroup.getBestSizeForInput`):
|
|
8
|
+
* - explicit `$control.width` or per-field `width` override → use it
|
|
9
|
+
* - `$control.area` / `file` / `upload` preset → 100% (full row)
|
|
10
|
+
* - long text (`maxLength >= 256`) → 100%
|
|
11
|
+
* - nested object / array of objects → 100%
|
|
12
|
+
* - array of primitives → 66% (2/3 row)
|
|
13
|
+
* - default → 33% (1/3 row)
|
|
14
|
+
*/
|
|
15
|
+
const widthFor = (input, override) => {
|
|
16
|
+
if (override) return override;
|
|
17
|
+
const schema = z.schema.unwrap(input.schema);
|
|
18
|
+
const control = schema?.meta?.()?.$control;
|
|
19
|
+
if (typeof control?.width === "number") return control.width;
|
|
20
|
+
if (control?.area || control?.file || control?.upload) return 100;
|
|
21
|
+
if ((schema?.maxLength ?? 0) >= 256) return 100;
|
|
22
|
+
if (z.schema.isObject(schema)) return 100;
|
|
23
|
+
if (z.schema.isArray(schema)) {
|
|
24
|
+
const element = z.schema.unwrap(schema.element);
|
|
25
|
+
if (z.schema.isObject(element)) return 100;
|
|
26
|
+
if (z.schema.isString(element) || z.schema.isNumber(element)) return 66;
|
|
27
|
+
return 100;
|
|
28
|
+
}
|
|
29
|
+
return 33;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Maps a percentage width to a Tailwind `col-span-N` class on a 12-col grid.
|
|
33
|
+
*/
|
|
34
|
+
const spanClass = (width) => {
|
|
35
|
+
if (width >= 100) return "col-span-12";
|
|
36
|
+
if (width >= 75) return "col-span-9";
|
|
37
|
+
if (width >= 66) return "col-span-8";
|
|
38
|
+
if (width >= 50) return "col-span-6";
|
|
39
|
+
if (width >= 33) return "col-span-4";
|
|
40
|
+
if (width >= 25) return "col-span-3";
|
|
41
|
+
return "col-span-4";
|
|
42
|
+
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { spanClass, widthFor };
|
|
45
|
+
|
|
46
|
+
//# sourceMappingURL=grid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid.js","names":[],"sources":["../../../src/components/control-base/grid.tsx"],"sourcesContent":["import * as React from \"react\";\n\nvoid React;\n\nimport { z } from \"alepha\";\nimport type { BaseInputField } from \"alepha/react/form\";\n\n/**\n * Decides the column-span (out of 12) for a control inside a 12-col grid.\n *\n * Rules (mirroring the legacy `CreateFormGroup.getBestSizeForInput`):\n * - explicit `$control.width` or per-field `width` override → use it\n * - `$control.area` / `file` / `upload` preset → 100% (full row)\n * - long text (`maxLength >= 256`) → 100%\n * - nested object / array of objects → 100%\n * - array of primitives → 66% (2/3 row)\n * - default → 33% (1/3 row)\n */\nexport const widthFor = (input: BaseInputField, override?: number): number => {\n if (override) return override;\n // Peel optional/nullable/default wrappers; `$control` rides on `.meta()`.\n const schema = z.schema.unwrap(input.schema) as {\n maxLength?: number;\n element?: unknown;\n meta?: () => {\n $control?: {\n width?: number;\n area?: boolean;\n file?: boolean;\n upload?: unknown;\n };\n };\n };\n const control = schema?.meta?.()?.$control;\n if (typeof control?.width === \"number\") return control.width;\n if (control?.area || control?.file || control?.upload) return 100;\n if ((schema?.maxLength ?? 0) >= 256) return 100;\n if (z.schema.isObject(schema)) return 100;\n if (z.schema.isArray(schema)) {\n const element = z.schema.unwrap(schema.element);\n if (z.schema.isObject(element)) return 100;\n if (z.schema.isString(element) || z.schema.isNumber(element)) return 66;\n return 100;\n }\n return 33;\n};\n\n/**\n * Maps a percentage width to a Tailwind `col-span-N` class on a 12-col grid.\n */\nexport const spanClass = (width: number): string => {\n if (width >= 100) return \"col-span-12\";\n if (width >= 75) return \"col-span-9\";\n if (width >= 66) return \"col-span-8\";\n if (width >= 50) return \"col-span-6\";\n if (width >= 33) return \"col-span-4\";\n if (width >= 25) return \"col-span-3\";\n return \"col-span-4\";\n};\n"],"mappings":";;;;;;;;;;;;;;AAkBA,MAAa,YAAY,OAAuB,aAA8B;CAC5E,IAAI,UAAU,OAAO;CAErB,MAAM,SAAS,EAAE,OAAO,OAAO,MAAM,MAAM;CAY3C,MAAM,UAAU,QAAQ,OAAO,CAAC,EAAE;CAClC,IAAI,OAAO,SAAS,UAAU,UAAU,OAAO,QAAQ;CACvD,IAAI,SAAS,QAAQ,SAAS,QAAQ,SAAS,QAAQ,OAAO;CAC9D,KAAK,QAAQ,aAAa,MAAM,KAAK,OAAO;CAC5C,IAAI,EAAE,OAAO,SAAS,MAAM,GAAG,OAAO;CACtC,IAAI,EAAE,OAAO,QAAQ,MAAM,GAAG;EAC5B,MAAM,UAAU,EAAE,OAAO,OAAO,OAAO,OAAO;EAC9C,IAAI,EAAE,OAAO,SAAS,OAAO,GAAG,OAAO;EACvC,IAAI,EAAE,OAAO,SAAS,OAAO,KAAK,EAAE,OAAO,SAAS,OAAO,GAAG,OAAO;EACrE,OAAO;CACT;CACA,OAAO;AACT;;;;AAKA,MAAa,aAAa,UAA0B;CAClD,IAAI,SAAS,KAAK,OAAO;CACzB,IAAI,SAAS,IAAI,OAAO;CACxB,IAAI,SAAS,IAAI,OAAO;CACxB,IAAI,SAAS,IAAI,OAAO;CACxB,IAAI,SAAS,IAAI,OAAO;CACxB,IAAI,SAAS,IAAI,OAAO;CACxB,OAAO;AACT"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { IconHint } from "alepha/react/form";
|
|
2
|
+
import type { ComponentType, SVGProps } from "react";
|
|
3
|
+
export type IconComponent = ComponentType<SVGProps<SVGSVGElement>>;
|
|
4
|
+
/**
|
|
5
|
+
* Maps a semantic {@link IconHint} or an icon name string to a lucide
|
|
6
|
+
* component. Returns `undefined` if not found.
|
|
7
|
+
*/
|
|
8
|
+
export declare const iconFor: (hint?: IconHint | string | null) => IconComponent | undefined;
|
|
9
|
+
//# sourceMappingURL=icon-hint.d.ts.map
|
|
@@ -0,0 +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,KAC9B,aAAa,GAAG,SAGlB,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { AtSign, Calendar, Clock, Cog, Download, File, Hash, Key, Link, List, Lock, Phone, RotateCcw, ToggleLeft, Type, Upload, User, Wrench } from "lucide-react";
|
|
3
|
+
//#region src/components/control-base/icon-hint.tsx
|
|
4
|
+
const namedIcons = {
|
|
5
|
+
email: AtSign,
|
|
6
|
+
password: Lock,
|
|
7
|
+
phone: Phone,
|
|
8
|
+
url: Link,
|
|
9
|
+
number: Hash,
|
|
10
|
+
calendar: Calendar,
|
|
11
|
+
clock: Clock,
|
|
12
|
+
list: List,
|
|
13
|
+
text: Type,
|
|
14
|
+
user: User,
|
|
15
|
+
file: File,
|
|
16
|
+
switch: ToggleLeft,
|
|
17
|
+
key: Key,
|
|
18
|
+
cog: Cog,
|
|
19
|
+
download: Download,
|
|
20
|
+
upload: Upload,
|
|
21
|
+
wrench: Wrench,
|
|
22
|
+
"rotate-ccw": RotateCcw
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Maps a semantic {@link IconHint} or an icon name string to a lucide
|
|
26
|
+
* component. Returns `undefined` if not found.
|
|
27
|
+
*/
|
|
28
|
+
const iconFor = (hint) => {
|
|
29
|
+
if (!hint) return void 0;
|
|
30
|
+
return namedIcons[hint];
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { iconFor };
|
|
34
|
+
|
|
35
|
+
//# sourceMappingURL=icon-hint.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { type BaseInputField } from "alepha/react/form";
|
|
3
|
+
export interface ControlDateProps {
|
|
4
|
+
/**
|
|
5
|
+
* Bound `InputField` from `useForm`. Stores an ISO string.
|
|
6
|
+
*/
|
|
7
|
+
input: BaseInputField;
|
|
8
|
+
/**
|
|
9
|
+
* Field label. Falls back to schema `title`.
|
|
10
|
+
*/
|
|
11
|
+
label?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Helper text shown below the picker.
|
|
14
|
+
*/
|
|
15
|
+
description?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Force date-only mode regardless of schema format.
|
|
18
|
+
*/
|
|
19
|
+
date?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Force date-time mode regardless of schema format.
|
|
22
|
+
*/
|
|
23
|
+
datetime?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Force time-only mode regardless of schema format.
|
|
26
|
+
*/
|
|
27
|
+
time?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Disable the picker.
|
|
30
|
+
*/
|
|
31
|
+
disabled?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare function ControlDate(props: ControlDateProps): React.JSX.Element | null;
|
|
34
|
+
//# sourceMappingURL=control-date.d.ts.map
|
|
@@ -0,0 +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,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,4BAyDlD"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { cn } from "../../lib/utils.js";
|
|
2
|
+
import { Button } from "../ui/button.js";
|
|
3
|
+
import { FormField } from "../control-base/form-field.js";
|
|
4
|
+
import { Calendar as Calendar$1 } from "../ui/calendar.js";
|
|
5
|
+
import { Input } from "../ui/input.js";
|
|
6
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../ui/popover.js";
|
|
7
|
+
import { useState } from "react";
|
|
8
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
9
|
+
import { Calendar, Clock } from "lucide-react";
|
|
10
|
+
import { parseField, useFieldValue, useFormState } from "alepha/react/form";
|
|
11
|
+
//#region src/components/control-date/control-date.tsx
|
|
12
|
+
function ControlDate(props) {
|
|
13
|
+
const form = useFormState(props.input, ["error"]);
|
|
14
|
+
const [value, setValue] = useFieldValue(props.input);
|
|
15
|
+
if (!props.input?.props) return null;
|
|
16
|
+
const meta = parseField(props.input, {
|
|
17
|
+
label: props.label,
|
|
18
|
+
description: props.description,
|
|
19
|
+
error: form.error
|
|
20
|
+
});
|
|
21
|
+
const isDateTime = props.datetime || meta.format === "date-time";
|
|
22
|
+
if (props.time || meta.format === "time") return /* @__PURE__ */ jsx(FormField, {
|
|
23
|
+
id: meta.id,
|
|
24
|
+
label: meta.label,
|
|
25
|
+
description: meta.description,
|
|
26
|
+
error: meta.error,
|
|
27
|
+
required: meta.required,
|
|
28
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
29
|
+
className: "relative",
|
|
30
|
+
children: [/* @__PURE__ */ jsx(Clock, { className: "text-muted-foreground absolute top-1/2 left-3 size-4 -translate-y-1/2" }), /* @__PURE__ */ jsx(Input, {
|
|
31
|
+
id: meta.id,
|
|
32
|
+
name: props.input.props.name,
|
|
33
|
+
type: "time",
|
|
34
|
+
className: "pl-9",
|
|
35
|
+
disabled: props.disabled,
|
|
36
|
+
value: value ?? "",
|
|
37
|
+
onChange: (e) => setValue(e.target.value)
|
|
38
|
+
})]
|
|
39
|
+
})
|
|
40
|
+
});
|
|
41
|
+
return /* @__PURE__ */ jsx(FormField, {
|
|
42
|
+
id: meta.id,
|
|
43
|
+
label: meta.label,
|
|
44
|
+
description: meta.description,
|
|
45
|
+
error: meta.error,
|
|
46
|
+
required: meta.required,
|
|
47
|
+
children: /* @__PURE__ */ jsx(DatePopover, {
|
|
48
|
+
id: meta.id,
|
|
49
|
+
value,
|
|
50
|
+
withTime: isDateTime,
|
|
51
|
+
disabled: props.disabled,
|
|
52
|
+
onChange: (v) => setValue(v)
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function DatePopover(props) {
|
|
57
|
+
const [open, setOpen] = useState(false);
|
|
58
|
+
const date = props.value ? new Date(props.value) : void 0;
|
|
59
|
+
const formatted = date ? props.withTime ? date.toLocaleString() : date.toLocaleDateString() : "";
|
|
60
|
+
const handleDate = (d) => {
|
|
61
|
+
if (!d) {
|
|
62
|
+
props.onChange(void 0);
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
if (props.withTime) props.onChange(d.toISOString());
|
|
66
|
+
else {
|
|
67
|
+
props.onChange(d.toISOString().slice(0, 10));
|
|
68
|
+
setOpen(false);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
const handleTime = (timeStr) => {
|
|
72
|
+
if (!date) return;
|
|
73
|
+
const [h, m] = timeStr.split(":").map(Number);
|
|
74
|
+
const next = new Date(date);
|
|
75
|
+
next.setHours(h ?? 0, m ?? 0, 0, 0);
|
|
76
|
+
props.onChange(next.toISOString());
|
|
77
|
+
};
|
|
78
|
+
const timeValue = date && props.withTime ? `${String(date.getHours()).padStart(2, "0")}:${String(date.getMinutes()).padStart(2, "0")}` : "";
|
|
79
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
80
|
+
open,
|
|
81
|
+
onOpenChange: setOpen,
|
|
82
|
+
children: [/* @__PURE__ */ jsxs(PopoverTrigger, {
|
|
83
|
+
render: /* @__PURE__ */ jsx(Button, {
|
|
84
|
+
id: props.id,
|
|
85
|
+
variant: "outline",
|
|
86
|
+
disabled: props.disabled,
|
|
87
|
+
className: cn("w-full justify-start text-left font-normal", !date && "text-muted-foreground")
|
|
88
|
+
}),
|
|
89
|
+
children: [/* @__PURE__ */ jsx(Calendar, { className: "mr-2 size-4" }), formatted || "Pick a date"]
|
|
90
|
+
}), /* @__PURE__ */ jsxs(PopoverContent, {
|
|
91
|
+
className: "w-auto p-0",
|
|
92
|
+
align: "start",
|
|
93
|
+
children: [/* @__PURE__ */ jsx(Calendar$1, {
|
|
94
|
+
mode: "single",
|
|
95
|
+
selected: date,
|
|
96
|
+
onSelect: handleDate
|
|
97
|
+
}), props.withTime && /* @__PURE__ */ jsx("div", {
|
|
98
|
+
className: "border-t p-3",
|
|
99
|
+
children: /* @__PURE__ */ jsx(Input, {
|
|
100
|
+
type: "time",
|
|
101
|
+
value: timeValue,
|
|
102
|
+
onChange: (e) => handleTime(e.target.value)
|
|
103
|
+
})
|
|
104
|
+
})]
|
|
105
|
+
})]
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
//#endregion
|
|
109
|
+
export { ControlDate };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=control-date.js.map
|