@h-ai/ui 0.1.0-alpha8 → 1.0.0-beta.1
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.en.md +1036 -0
- package/README.ja.md +1036 -0
- package/README.md +670 -119
- package/auto-import.d.ts +45 -0
- package/auto-import.js +46 -69
- package/dist/components/compounds/Accordion.svelte +30 -3
- package/dist/components/compounds/Accordion.svelte.d.ts +37 -1
- package/dist/components/compounds/ActionSheet.svelte +35 -8
- package/dist/components/compounds/ActionSheet.svelte.d.ts +41 -1
- package/dist/components/compounds/Alert.svelte +24 -15
- package/dist/components/compounds/Alert.svelte.d.ts +14 -3
- package/dist/components/compounds/AppBar.svelte +37 -9
- package/dist/components/compounds/AppBar.svelte.d.ts +36 -1
- package/dist/components/compounds/BottomNav.svelte +68 -8
- package/dist/components/compounds/BottomNav.svelte.d.ts +51 -1
- package/dist/components/compounds/Breadcrumb.svelte +18 -5
- package/dist/components/compounds/Breadcrumb.svelte.d.ts +23 -2
- package/dist/components/compounds/Calendar.svelte +31 -12
- package/dist/components/compounds/Calendar.svelte.d.ts +23 -7
- package/dist/components/compounds/Card.svelte +17 -5
- package/dist/components/compounds/Card.svelte.d.ts +13 -2
- package/dist/components/compounds/Combobox.svelte +124 -42
- package/dist/components/compounds/Combobox.svelte.d.ts +42 -20
- package/dist/components/compounds/Confirm.svelte +32 -9
- package/dist/components/compounds/Confirm.svelte.d.ts +24 -2
- package/dist/components/compounds/DataTable.svelte +317 -33
- package/dist/components/compounds/DataTable.svelte.d.ts +28 -14
- package/dist/components/compounds/DatePicker.svelte +62 -18
- package/dist/components/compounds/DatePicker.svelte.d.ts +27 -8
- package/dist/components/compounds/Drawer.svelte +179 -22
- package/dist/components/compounds/Drawer.svelte.d.ts +24 -2
- package/dist/components/compounds/Dropdown.svelte +19 -5
- package/dist/components/compounds/Dropdown.svelte.d.ts +13 -2
- package/dist/components/compounds/Empty.svelte +22 -9
- package/dist/components/compounds/Empty.svelte.d.ts +23 -2
- package/dist/components/compounds/FilterBar.svelte +82 -0
- package/dist/components/compounds/FilterBar.svelte.d.ts +39 -0
- package/dist/components/compounds/Form.svelte +59 -16
- package/dist/components/compounds/Form.svelte.d.ts +23 -2
- package/dist/components/compounds/FormField.svelte +99 -16
- package/dist/components/compounds/FormField.svelte.d.ts +23 -2
- package/dist/components/compounds/FormLayout.svelte +71 -0
- package/dist/components/compounds/FormLayout.svelte.d.ts +17 -0
- package/dist/components/compounds/InfiniteScroll.svelte +34 -7
- package/dist/components/compounds/InfiniteScroll.svelte.d.ts +37 -1
- package/dist/components/compounds/JsonViewer.svelte +214 -0
- package/dist/components/compounds/JsonViewer.svelte.d.ts +26 -0
- package/dist/components/compounds/MessageBoxContainer.svelte +34 -0
- package/dist/components/compounds/MessageBoxContainer.svelte.d.ts +25 -0
- package/dist/components/compounds/MessageBoxDialog.svelte +209 -0
- package/dist/components/compounds/MessageBoxDialog.svelte.d.ts +29 -0
- package/dist/components/compounds/MessageContainer.svelte +24 -0
- package/dist/components/compounds/MessageContainer.svelte.d.ts +18 -0
- package/dist/components/compounds/Modal.svelte +348 -73
- package/dist/components/compounds/Modal.svelte.d.ts +13 -2
- package/dist/components/compounds/PageHeader.svelte +44 -20
- package/dist/components/compounds/PageHeader.svelte.d.ts +24 -9
- package/dist/components/compounds/Pagination.svelte +139 -105
- package/dist/components/compounds/Pagination.svelte.d.ts +23 -2
- package/dist/components/compounds/Popover.svelte +124 -25
- package/dist/components/compounds/Popover.svelte.d.ts +23 -2
- package/dist/components/compounds/PullRefresh.svelte +35 -8
- package/dist/components/compounds/PullRefresh.svelte.d.ts +35 -1
- package/dist/components/compounds/Result.svelte +17 -4
- package/dist/components/compounds/Result.svelte.d.ts +23 -2
- package/dist/components/compounds/SafeArea.svelte +30 -3
- package/dist/components/compounds/SafeArea.svelte.d.ts +35 -1
- package/dist/components/compounds/Skeleton.svelte +19 -7
- package/dist/components/compounds/Skeleton.svelte.d.ts +13 -2
- package/dist/components/compounds/Steps.svelte +17 -4
- package/dist/components/compounds/Steps.svelte.d.ts +23 -2
- package/dist/components/compounds/SwipeCell.svelte +30 -3
- package/dist/components/compounds/SwipeCell.svelte.d.ts +40 -1
- package/dist/components/compounds/TableToolbar.svelte +289 -0
- package/dist/components/compounds/TableToolbar.svelte.d.ts +69 -0
- package/dist/components/compounds/Tabs.svelte +84 -14
- package/dist/components/compounds/Tabs.svelte.d.ts +13 -2
- package/dist/components/compounds/TagInput.svelte +51 -33
- package/dist/components/compounds/TagInput.svelte.d.ts +23 -2
- package/dist/components/compounds/Timeline.svelte +30 -3
- package/dist/components/compounds/Timeline.svelte.d.ts +37 -1
- package/dist/components/compounds/ToastContainer.svelte +386 -28
- package/dist/components/compounds/ToastContainer.svelte.d.ts +27 -1
- package/dist/components/compounds/Tooltip.svelte +143 -9
- package/dist/components/compounds/Tooltip.svelte.d.ts +25 -2
- package/dist/components/compounds/accordion-types.d.ts +10 -1
- package/dist/components/compounds/action-sheet-types.d.ts +9 -0
- package/dist/components/compounds/bottom-nav-types.d.ts +9 -0
- package/dist/components/compounds/index.d.ts +7 -0
- package/dist/components/compounds/index.js +11 -0
- package/dist/components/compounds/swipe-cell-types.d.ts +9 -0
- package/dist/components/compounds/timeline-types.d.ts +9 -0
- package/dist/components/control-size.d.ts +35 -0
- package/dist/components/control-size.js +26 -0
- package/dist/components/primitives/Avatar.svelte +19 -5
- package/dist/components/primitives/Avatar.svelte.d.ts +13 -2
- package/dist/components/primitives/Badge.svelte +16 -4
- package/dist/components/primitives/Badge.svelte.d.ts +13 -2
- package/dist/components/primitives/BareButton.svelte +26 -12
- package/dist/components/primitives/BareButton.svelte.d.ts +23 -2
- package/dist/components/primitives/BareInput.svelte +57 -35
- package/dist/components/primitives/BareInput.svelte.d.ts +23 -2
- package/dist/components/primitives/Button.svelte +30 -9
- package/dist/components/primitives/Button.svelte.d.ts +13 -2
- package/dist/components/primitives/Checkbox.svelte +24 -5
- package/dist/components/primitives/Checkbox.svelte.d.ts +23 -2
- package/dist/components/primitives/IconButton.svelte +35 -10
- package/dist/components/primitives/IconButton.svelte.d.ts +23 -2
- package/dist/components/primitives/Input.svelte +56 -26
- package/dist/components/primitives/Input.svelte.d.ts +13 -2
- package/dist/components/primitives/Progress.svelte +17 -4
- package/dist/components/primitives/Progress.svelte.d.ts +23 -2
- package/dist/components/primitives/Radio.svelte +17 -4
- package/dist/components/primitives/Radio.svelte.d.ts +22 -2
- package/dist/components/primitives/Range.svelte +31 -4
- package/dist/components/primitives/Range.svelte.d.ts +37 -1
- package/dist/components/primitives/Rating.svelte +32 -5
- package/dist/components/primitives/Rating.svelte.d.ts +37 -1
- package/dist/components/primitives/Select.svelte +404 -47
- package/dist/components/primitives/Select.svelte.d.ts +23 -2
- package/dist/components/primitives/Spinner.svelte +17 -4
- package/dist/components/primitives/Spinner.svelte.d.ts +23 -2
- package/dist/components/primitives/Switch.svelte +22 -4
- package/dist/components/primitives/Switch.svelte.d.ts +23 -2
- package/dist/components/primitives/Tag.svelte +17 -4
- package/dist/components/primitives/Tag.svelte.d.ts +23 -2
- package/dist/components/primitives/Textarea.svelte +75 -30
- package/dist/components/primitives/Textarea.svelte.d.ts +24 -2
- package/dist/components/primitives/ToggleCheckbox.svelte +24 -10
- package/dist/components/primitives/ToggleCheckbox.svelte.d.ts +23 -2
- package/dist/components/primitives/ToggleInput.svelte +24 -10
- package/dist/components/primitives/ToggleInput.svelte.d.ts +23 -2
- package/dist/components/primitives/ToggleRadio.svelte +24 -10
- package/dist/components/primitives/ToggleRadio.svelte.d.ts +23 -2
- package/dist/components/scenes/ai/AiDocumentDownloadMenu.svelte +54 -23
- package/dist/components/scenes/ai/AiDocumentDownloadMenu.svelte.d.ts +30 -1
- package/dist/components/scenes/ai/AiDocumentEditor.svelte +3428 -693
- package/dist/components/scenes/ai/AiDocumentEditor.svelte.d.ts +26 -1
- package/dist/components/scenes/ai/MarkdownRenderer.svelte +119 -116
- package/dist/components/scenes/ai/MarkdownRenderer.svelte.d.ts +31 -1
- package/dist/components/scenes/ai/code-preview.d.ts +46 -0
- package/dist/components/scenes/ai/code-preview.js +141 -0
- package/dist/components/scenes/ai/document-download.d.ts +52 -0
- package/dist/components/scenes/ai/document-download.js +296 -77
- package/dist/components/scenes/ai/document-parse.d.ts +101 -11
- package/dist/components/scenes/ai/document-parse.js +212 -48
- package/dist/components/scenes/ai/document-types.d.ts +292 -75
- package/dist/components/scenes/ai/editor-markdown-extensions.d.ts +27 -0
- package/dist/components/scenes/ai/editor-markdown-extensions.js +215 -0
- package/dist/components/scenes/ai/highlight.d.ts +37 -0
- package/dist/components/scenes/ai/highlight.js +162 -0
- package/dist/components/scenes/ai/index.d.ts +5 -2
- package/dist/components/scenes/ai/index.js +3 -0
- package/dist/components/scenes/ai/markdown-parse.d.ts +11 -3
- package/dist/components/scenes/ai/markdown-parse.js +42 -31
- package/dist/components/scenes/ai/mermaid-host-sync.d.ts +72 -0
- package/dist/components/scenes/ai/mermaid-host-sync.js +65 -0
- package/dist/components/scenes/ai/mermaid-render.d.ts +30 -0
- package/dist/components/scenes/ai/mermaid-render.js +61 -0
- package/dist/components/scenes/ai/safe-html.d.ts +64 -0
- package/dist/components/scenes/ai/safe-html.js +345 -0
- package/dist/components/scenes/ai/table/AiTableEditor.svelte +1692 -0
- package/dist/components/scenes/ai/table/AiTableEditor.svelte.d.ts +32 -0
- package/dist/components/scenes/ai/table/table-types.d.ts +181 -0
- package/dist/components/scenes/ai/table/table-types.js +1 -0
- package/dist/components/scenes/app/FeedbackDetail.svelte +236 -0
- package/dist/components/scenes/app/FeedbackDetail.svelte.d.ts +40 -0
- package/dist/components/scenes/app/FeedbackForm.svelte +337 -0
- package/dist/components/scenes/app/FeedbackForm.svelte.d.ts +72 -0
- package/dist/components/scenes/app/FeedbackList.svelte +150 -0
- package/dist/components/scenes/app/FeedbackList.svelte.d.ts +28 -0
- package/dist/components/scenes/app/FeedbackModal.svelte +65 -139
- package/dist/components/scenes/app/FeedbackModal.svelte.d.ts +14 -39
- package/dist/components/scenes/app/FeedbackRecorder.svelte +154 -0
- package/dist/components/scenes/app/FeedbackRecorder.svelte.d.ts +9 -0
- package/dist/components/scenes/app/FeedbackReplay.svelte +142 -0
- package/dist/components/scenes/app/FeedbackReplay.svelte.d.ts +7 -0
- package/dist/components/scenes/app/FeedbackScreenshot.svelte +120 -0
- package/dist/components/scenes/app/FeedbackScreenshot.svelte.d.ts +8 -0
- package/dist/components/scenes/app/LanguageSwitch.svelte +38 -21
- package/dist/components/scenes/app/LanguageSwitch.svelte.d.ts +33 -20
- package/dist/components/scenes/app/SettingsLayout.svelte +115 -0
- package/dist/components/scenes/app/SettingsLayout.svelte.d.ts +54 -0
- package/dist/components/scenes/app/SettingsModal.svelte +33 -7
- package/dist/components/scenes/app/SettingsModal.svelte.d.ts +27 -1
- package/dist/components/scenes/app/ThemeColorPicker.svelte +240 -0
- package/dist/components/scenes/app/ThemeColorPicker.svelte.d.ts +57 -0
- package/dist/components/scenes/app/ThemeSelector.svelte +87 -26
- package/dist/components/scenes/app/ThemeSelector.svelte.d.ts +26 -7
- package/dist/components/scenes/app/ThemeToggle.svelte +27 -6
- package/dist/components/scenes/app/ThemeToggle.svelte.d.ts +24 -5
- package/dist/components/scenes/app/WorkspaceLayout.svelte +64 -0
- package/dist/components/scenes/app/WorkspaceLayout.svelte.d.ts +36 -0
- package/dist/components/scenes/app/feedback-functions.d.ts +57 -0
- package/dist/components/scenes/app/feedback-functions.js +107 -0
- package/dist/components/scenes/app/feedback-types.d.ts +224 -0
- package/dist/components/scenes/app/feedback-types.js +1 -0
- package/dist/components/scenes/app/index.d.ts +8 -1
- package/dist/components/scenes/app/index.js +7 -1
- package/dist/components/scenes/charts/Chart.svelte +163 -0
- package/dist/components/scenes/charts/Chart.svelte.d.ts +25 -0
- package/dist/components/scenes/charts/chart-theme.d.ts +47 -0
- package/dist/components/scenes/charts/chart-theme.js +68 -0
- package/dist/components/scenes/charts/chart-types.d.ts +153 -0
- package/dist/components/scenes/charts/chart-types.js +7 -0
- package/dist/components/scenes/charts/index.d.ts +8 -0
- package/dist/components/scenes/charts/index.js +7 -0
- package/dist/components/scenes/charts/renderers/AreaChart.svelte +18 -0
- package/dist/components/scenes/charts/renderers/AreaChart.svelte.d.ts +5 -0
- package/dist/components/scenes/charts/renderers/BarChart.svelte +18 -0
- package/dist/components/scenes/charts/renderers/BarChart.svelte.d.ts +5 -0
- package/dist/components/scenes/charts/renderers/LineChart.svelte +624 -0
- package/dist/components/scenes/charts/renderers/LineChart.svelte.d.ts +32 -0
- package/dist/components/scenes/charts/renderers/PieChart.svelte +18 -0
- package/dist/components/scenes/charts/renderers/PieChart.svelte.d.ts +5 -0
- package/dist/components/scenes/charts/renderers/ScatterChart.svelte +18 -0
- package/dist/components/scenes/charts/renderers/ScatterChart.svelte.d.ts +5 -0
- package/dist/components/scenes/crud/CrudDeleteConfirm.svelte +29 -11
- package/dist/components/scenes/crud/CrudDeleteConfirm.svelte.d.ts +13 -1
- package/dist/components/scenes/crud/CrudDetailDrawer.svelte +77 -22
- package/dist/components/scenes/crud/CrudDetailDrawer.svelte.d.ts +19 -4
- package/dist/components/scenes/crud/CrudDetailPanel.svelte +242 -0
- package/dist/components/scenes/crud/CrudDetailPanel.svelte.d.ts +66 -0
- package/dist/components/scenes/crud/CrudEditPanel.svelte +365 -0
- package/dist/components/scenes/crud/CrudEditPanel.svelte.d.ts +48 -0
- package/dist/components/scenes/crud/CrudFilterBar.svelte +17 -85
- package/dist/components/scenes/crud/CrudFilterBar.svelte.d.ts +13 -25
- package/dist/components/scenes/crud/CrudPage.svelte +564 -185
- package/dist/components/scenes/crud/CrudPage.svelte.d.ts +137 -51
- package/dist/components/scenes/crud/crud-controller.svelte.d.ts +335 -0
- package/dist/components/scenes/crud/crud-controller.svelte.js +276 -0
- package/dist/components/scenes/crud/crud-form-validation.d.ts +16 -0
- package/dist/components/scenes/crud/crud-form-validation.js +51 -0
- package/dist/components/scenes/crud/crud-types.d.ts +136 -43
- package/dist/components/scenes/crud/index.d.ts +9 -3
- package/dist/components/scenes/crud/index.js +8 -3
- package/dist/components/scenes/crud/nav-adapter.d.ts +50 -0
- package/dist/components/scenes/crud/nav-adapter.js +39 -0
- package/dist/components/scenes/crypto/EncryptedInput.svelte +63 -28
- package/dist/components/scenes/crypto/EncryptedInput.svelte.d.ts +38 -3
- package/dist/components/scenes/crypto/HashDisplay.svelte +30 -22
- package/dist/components/scenes/crypto/HashDisplay.svelte.d.ts +24 -1
- package/dist/components/scenes/crypto/SignatureDisplay.svelte +41 -40
- package/dist/components/scenes/crypto/SignatureDisplay.svelte.d.ts +24 -1
- package/dist/components/scenes/error/ErrorPage.svelte +135 -0
- package/dist/components/scenes/error/ErrorPage.svelte.d.ts +50 -0
- package/dist/components/scenes/error/error-presets.d.ts +60 -0
- package/dist/components/scenes/error/error-presets.js +51 -0
- package/dist/components/scenes/error/index.d.ts +8 -0
- package/dist/components/scenes/error/index.js +8 -0
- package/dist/components/scenes/guide/GuideHost.svelte +56 -0
- package/dist/components/scenes/guide/GuideHost.svelte.d.ts +35 -0
- package/dist/components/scenes/guide/GuideHostContent.svelte +136 -0
- package/dist/components/scenes/guide/GuideHostContent.svelte.d.ts +43 -0
- package/dist/components/scenes/guide/HelpCenter.svelte +135 -0
- package/dist/components/scenes/guide/HelpCenter.svelte.d.ts +40 -0
- package/dist/components/scenes/guide/index.d.ts +2 -0
- package/dist/components/scenes/guide/index.js +2 -0
- package/dist/components/scenes/iam/AgreementNotice.svelte +48 -0
- package/dist/components/scenes/iam/AgreementNotice.svelte.d.ts +7 -0
- package/dist/components/scenes/iam/AuthPanel.svelte +226 -0
- package/dist/components/scenes/iam/AuthPanel.svelte.d.ts +29 -0
- package/dist/components/scenes/iam/AuthShell.svelte +160 -0
- package/dist/components/scenes/iam/AuthShell.svelte.d.ts +56 -0
- package/dist/components/scenes/iam/ChangePasswordForm.svelte +84 -63
- package/dist/components/scenes/iam/ChangePasswordForm.svelte.d.ts +13 -1
- package/dist/components/scenes/iam/ForgotPasswordForm.svelte +113 -89
- package/dist/components/scenes/iam/ForgotPasswordForm.svelte.d.ts +24 -1
- package/dist/components/scenes/iam/LoginForm.svelte +215 -117
- package/dist/components/scenes/iam/LoginForm.svelte.d.ts +13 -1
- package/dist/components/scenes/iam/PasswordInput.svelte +79 -32
- package/dist/components/scenes/iam/PasswordInput.svelte.d.ts +30 -4
- package/dist/components/scenes/iam/PermGuard.svelte +21 -11
- package/dist/components/scenes/iam/PermGuard.svelte.d.ts +30 -0
- package/dist/components/scenes/iam/ReauthenticationDialog.svelte +68 -0
- package/dist/components/scenes/iam/ReauthenticationDialog.svelte.d.ts +17 -0
- package/dist/components/scenes/iam/RegisterForm.svelte +129 -116
- package/dist/components/scenes/iam/RegisterForm.svelte.d.ts +13 -1
- package/dist/components/scenes/iam/ResetPasswordForm.svelte +101 -88
- package/dist/components/scenes/iam/ResetPasswordForm.svelte.d.ts +13 -1
- package/dist/components/scenes/iam/SensitiveOperationsForm.svelte +76 -0
- package/dist/components/scenes/iam/SensitiveOperationsForm.svelte.d.ts +21 -0
- package/dist/components/scenes/iam/SessionRecoveryDialog.svelte +64 -0
- package/dist/components/scenes/iam/SessionRecoveryDialog.svelte.d.ts +22 -0
- package/dist/components/scenes/iam/UserProfile.svelte +47 -21
- package/dist/components/scenes/iam/UserProfile.svelte.d.ts +24 -1
- package/dist/components/scenes/iam/auth-captcha.d.ts +21 -0
- package/dist/components/scenes/iam/auth-captcha.js +23 -0
- package/dist/components/scenes/iam/auth-error-message.d.ts +13 -0
- package/dist/components/scenes/iam/auth-error-message.js +65 -0
- package/dist/components/scenes/iam/index.d.ts +10 -0
- package/dist/components/scenes/iam/index.js +9 -1
- package/dist/components/scenes/iam/password-utils.d.ts +33 -6
- package/dist/components/scenes/iam/password-utils.js +61 -8
- package/dist/components/scenes/iam/permission-context.svelte.d.ts +33 -23
- package/dist/components/scenes/iam/permission-context.svelte.js +20 -22
- package/dist/components/scenes/iam/sensitive-actions.svelte.d.ts +68 -0
- package/dist/components/scenes/iam/sensitive-actions.svelte.js +101 -0
- package/dist/components/scenes/iam/session-recovery.svelte.d.ts +44 -0
- package/dist/components/scenes/iam/session-recovery.svelte.js +57 -0
- package/dist/components/scenes/index.d.ts +3 -0
- package/dist/components/scenes/index.js +5 -0
- package/dist/components/scenes/storage/AvatarUpload.svelte +82 -68
- package/dist/components/scenes/storage/AvatarUpload.svelte.d.ts +23 -1
- package/dist/components/scenes/storage/FileList.svelte +19 -5
- package/dist/components/scenes/storage/FileList.svelte.d.ts +23 -1
- package/dist/components/scenes/storage/FileUpload.svelte +151 -96
- package/dist/components/scenes/storage/FileUpload.svelte.d.ts +24 -1
- package/dist/components/scenes/storage/ImageUpload.svelte +93 -94
- package/dist/components/scenes/storage/ImageUpload.svelte.d.ts +24 -1
- package/dist/components/scenes/types.d.ts +574 -42
- package/dist/guide-storage.d.ts +18 -0
- package/dist/guide-storage.js +79 -0
- package/dist/guide-types.d.ts +143 -0
- package/dist/guide-types.js +1 -0
- package/dist/guide.d.ts +3 -0
- package/dist/guide.js +3 -0
- package/dist/guide.svelte.d.ts +29 -0
- package/dist/guide.svelte.js +506 -0
- package/dist/i18n.svelte.d.ts +67 -4
- package/dist/i18n.svelte.js +106 -21
- package/dist/index.d.ts +6 -0
- package/dist/index.js +7 -0
- package/dist/internal/browser-safety.d.ts +88 -0
- package/dist/internal/browser-safety.js +140 -0
- package/dist/internal/dialog-focus.d.ts +21 -0
- package/dist/internal/dialog-focus.js +77 -0
- package/dist/internal/form-context.d.ts +92 -0
- package/dist/internal/form-context.js +70 -0
- package/dist/internal/form-validation.svelte.d.ts +70 -0
- package/dist/internal/form-validation.svelte.js +142 -0
- package/dist/internal/icon-safety.d.ts +14 -0
- package/dist/internal/icon-safety.js +40 -0
- package/dist/internal/locale.d.ts +21 -0
- package/dist/internal/locale.js +43 -0
- package/dist/message.svelte.d.ts +138 -0
- package/dist/message.svelte.js +149 -0
- package/dist/messagebox.svelte.d.ts +130 -0
- package/dist/messagebox.svelte.js +171 -0
- package/dist/messages/en-US.json +297 -16
- package/dist/messages/ja-JP.json +523 -0
- package/dist/messages/zh-CN.json +297 -16
- package/dist/messages.d.ts +25 -3
- package/dist/messages.js +23 -6
- package/dist/styles/design-tokens.css +4 -2
- package/dist/styles/formal.css +55 -0
- package/dist/styles/global.css +86 -18
- package/dist/styles/guide.css +88 -0
- package/dist/styles/high-contrast.css +64 -0
- package/dist/styles/mobile.css +28 -0
- package/dist/styles/theme.css +42 -0
- package/dist/theme-config.d.ts +263 -10
- package/dist/theme-config.js +252 -17
- package/dist/toast.svelte.d.ts +210 -2
- package/dist/toast.svelte.js +296 -19
- package/dist/types.d.ts +787 -63
- package/dist/utils/platform.svelte.d.ts +28 -15
- package/dist/utils/platform.svelte.js +23 -16
- package/dist/utils.d.ts +121 -1
- package/dist/utils.js +208 -13
- package/dist/workspace-context.d.ts +20 -0
- package/dist/workspace-context.js +9 -0
- package/package.json +120 -24
- package/vite.d.ts +13 -0
- package/vite.js +96 -0
- package/dist/components/scenes/crud/CrudEditDrawer.svelte +0 -225
- package/dist/components/scenes/crud/CrudEditDrawer.svelte.d.ts +0 -48
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import type { Snippet } from 'svelte';
|
|
2
|
+
import type { DataAttributes } from '../../../types.js';
|
|
3
|
+
type $$ComponentProps = {
|
|
4
|
+
/** 布局形态:'card'(居中卡片,默认)或 'split'(左右分栏) */
|
|
5
|
+
variant?: 'card' | 'split';
|
|
6
|
+
/** 嵌入已有弹窗/布局,只渲染表单内容。 */
|
|
7
|
+
embedded?: boolean;
|
|
8
|
+
/** 表单区标题 */
|
|
9
|
+
title?: string;
|
|
10
|
+
/** 表单区副标题 */
|
|
11
|
+
subtitle?: string;
|
|
12
|
+
/** split 模式品牌区主标题 */
|
|
13
|
+
brandTitle?: string;
|
|
14
|
+
/** split 模式品牌区描述文案 */
|
|
15
|
+
brandText?: string;
|
|
16
|
+
/** 配置形式的 Logo 与配图;插槽优先。 */
|
|
17
|
+
logoUrl?: string;
|
|
18
|
+
illustrationUrl?: string;
|
|
19
|
+
/** 顶部 Logo 插槽 */
|
|
20
|
+
logo?: Snippet;
|
|
21
|
+
/** split 模式品牌区插图(如大图/海报) */
|
|
22
|
+
illustration?: Snippet;
|
|
23
|
+
/** split 模式品牌区描述区(覆盖 brandText) */
|
|
24
|
+
description?: Snippet;
|
|
25
|
+
/** split 模式品牌区重点信息(如卖点列表) */
|
|
26
|
+
highlights?: Snippet;
|
|
27
|
+
/** split 模式品牌区自定义插槽(覆盖 brandTitle/brandText) */
|
|
28
|
+
brand?: Snippet;
|
|
29
|
+
/** 底部插槽(如注册/登录切换链接) */
|
|
30
|
+
footer?: Snippet;
|
|
31
|
+
/** 表单内容 */
|
|
32
|
+
children?: Snippet;
|
|
33
|
+
class?: string;
|
|
34
|
+
} & DataAttributes;
|
|
35
|
+
/**
|
|
36
|
+
* AuthShell
|
|
37
|
+
* 认证页布局场景组件
|
|
38
|
+
*
|
|
39
|
+
* 借鉴 shadcn-admin sign-in / sign-in-2:支持居中卡片(card)与左右分栏(split)两种布局。
|
|
40
|
+
* 品牌区、标题、副标题、表单内容由使用方提供。
|
|
41
|
+
*
|
|
42
|
+
* 使用 Svelte 5 Runes ($props, $derived)
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* import { mount, unmount, createRawSnippet } from 'svelte'
|
|
47
|
+
* import type { ComponentProps } from 'svelte'
|
|
48
|
+
* import { AuthShell } from '@h-ai/ui'
|
|
49
|
+
* const props: ComponentProps<typeof AuthShell> = { variant: 'card', title: '登录', subtitle: '欢迎回来', children: createRawSnippet(() => ({ render: () => "<p>在此放置登录或注册表单。</p>" })) }
|
|
50
|
+
* const component = mount(AuthShell, { target: document.body, props })
|
|
51
|
+
* await unmount(component)
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const AuthShell: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
55
|
+
type AuthShell = ReturnType<typeof AuthShell>;
|
|
56
|
+
export default AuthShell;
|
|
@@ -1,32 +1,53 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
@component ChangePasswordForm
|
|
3
3
|
修改密码表单组件。
|
|
4
|
+
|
|
5
|
+
@example
|
|
6
|
+
```ts
|
|
7
|
+
import { mount, unmount } from 'svelte'
|
|
8
|
+
import type { ComponentProps } from 'svelte'
|
|
9
|
+
import { ChangePasswordForm } from '@h-ai/ui'
|
|
10
|
+
const props: ComponentProps<typeof ChangePasswordForm> = { requireOldPassword: true, minPasswordLength: 12 }
|
|
11
|
+
const component = mount(ChangePasswordForm, { target: document.body, props })
|
|
12
|
+
await unmount(component)
|
|
13
|
+
```
|
|
4
14
|
-->
|
|
5
15
|
<script lang='ts'>
|
|
16
|
+
import type { DataAttributes } from '../../../types.js'
|
|
6
17
|
import type { ChangePasswordFormData, ChangePasswordFormProps } from '../types.js'
|
|
7
18
|
import { uiM } from '../../../messages.js'
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
19
|
+
import { useToastFeedback } from '../../../toast.svelte.js'
|
|
20
|
+
import { cn, getDataAttributes } from '../../../utils.js'
|
|
21
|
+
import FormField from '../../compounds/FormField.svelte'
|
|
22
|
+
import FormLayout from '../../compounds/FormLayout.svelte'
|
|
10
23
|
import Button from '../../primitives/Button.svelte'
|
|
11
|
-
import { arePasswordsEqual } from './password-utils.js'
|
|
24
|
+
import { arePasswordsEqual, passwordPolicyError, passwordPolicyHint } from './password-utils.js'
|
|
12
25
|
import PasswordInput from './PasswordInput.svelte'
|
|
13
26
|
|
|
14
27
|
const {
|
|
15
28
|
loading = false,
|
|
29
|
+
columns = 1,
|
|
30
|
+
labelPosition = 'top',
|
|
31
|
+
labelWidth = '8rem',
|
|
16
32
|
disabled = false,
|
|
17
33
|
requireOldPassword = true,
|
|
18
34
|
showPasswordStrength = true,
|
|
19
35
|
minPasswordLength = 8,
|
|
36
|
+
passwordPolicy,
|
|
20
37
|
submitText,
|
|
21
38
|
class: className = '',
|
|
22
39
|
errors = {},
|
|
23
40
|
onsubmit,
|
|
24
|
-
|
|
41
|
+
...restProps
|
|
42
|
+
}: ChangePasswordFormProps & DataAttributes = $props()
|
|
25
43
|
|
|
44
|
+
const dataAttributes = $derived(getDataAttributes(restProps))
|
|
26
45
|
let oldPassword = $state('')
|
|
27
46
|
let newPassword = $state('')
|
|
28
47
|
let confirmPassword = $state('')
|
|
29
48
|
|
|
49
|
+
const policyError = $derived(passwordPolicy && newPassword ? passwordPolicyError(newPassword, passwordPolicy) : '')
|
|
50
|
+
|
|
30
51
|
const formClass = $derived(
|
|
31
52
|
cn(
|
|
32
53
|
'change-password-form space-y-5',
|
|
@@ -53,7 +74,7 @@
|
|
|
53
74
|
*/
|
|
54
75
|
async function handleSubmit(e: SubmitEvent) {
|
|
55
76
|
e.preventDefault()
|
|
56
|
-
if (loading || disabled || !canSubmit)
|
|
77
|
+
if (policyError || loading || disabled || !canSubmit)
|
|
57
78
|
return
|
|
58
79
|
|
|
59
80
|
const data: ChangePasswordFormData = {
|
|
@@ -64,71 +85,71 @@
|
|
|
64
85
|
|
|
65
86
|
await onsubmit?.(data)
|
|
66
87
|
}
|
|
88
|
+
useToastFeedback(() => errors.general)
|
|
89
|
+
useToastFeedback(() => policyError)
|
|
67
90
|
</script>
|
|
68
91
|
|
|
69
|
-
<form class={formClass} onsubmit={handleSubmit}>
|
|
70
|
-
{
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
74
|
-
|
|
92
|
+
<form {...dataAttributes} class={formClass} onsubmit={handleSubmit}>
|
|
93
|
+
<FormLayout {columns} {labelPosition} {labelWidth}>
|
|
94
|
+
{#if requireOldPassword}
|
|
95
|
+
<FormField for='old-password' label={uiM('change_password_old')}>
|
|
96
|
+
<PasswordInput
|
|
97
|
+
value={oldPassword}
|
|
98
|
+
id='old-password'
|
|
99
|
+
autocomplete='current-password'
|
|
100
|
+
required
|
|
101
|
+
oninput={(e) => { oldPassword = e.currentTarget.value }}
|
|
102
|
+
placeholder={uiM('change_password_old_placeholder')}
|
|
103
|
+
{disabled}
|
|
104
|
+
error={errors.oldPassword}
|
|
105
|
+
showStrength={false}
|
|
106
|
+
/>
|
|
107
|
+
</FormField>
|
|
108
|
+
{/if}
|
|
109
|
+
|
|
110
|
+
<FormField for='new-password' label={uiM('change_password_new')}>
|
|
75
111
|
<PasswordInput
|
|
76
|
-
value={
|
|
77
|
-
|
|
78
|
-
|
|
112
|
+
value={newPassword}
|
|
113
|
+
id='new-password'
|
|
114
|
+
autocomplete='new-password'
|
|
115
|
+
required
|
|
116
|
+
oninput={(e) => { newPassword = e.currentTarget.value }}
|
|
117
|
+
placeholder={uiM('change_password_new_placeholder')}
|
|
79
118
|
{disabled}
|
|
80
|
-
error={errors.
|
|
81
|
-
showStrength={
|
|
119
|
+
error={errors.newPassword}
|
|
120
|
+
showStrength={showPasswordStrength}
|
|
121
|
+
minLength={minPasswordLength}
|
|
82
122
|
/>
|
|
83
|
-
</
|
|
84
|
-
{/if}
|
|
85
|
-
|
|
86
|
-
<div class='space-y-1.5'>
|
|
87
|
-
<label class='text-sm font-medium text-base-content/70' for='new-password'>
|
|
88
|
-
{uiM('change_password_new')}
|
|
89
|
-
</label>
|
|
90
|
-
<PasswordInput
|
|
91
|
-
value={newPassword}
|
|
92
|
-
oninput={(e) => { newPassword = e.currentTarget.value }}
|
|
93
|
-
placeholder={uiM('change_password_new_placeholder')}
|
|
94
|
-
{disabled}
|
|
95
|
-
error={errors.newPassword}
|
|
96
|
-
showStrength={showPasswordStrength}
|
|
97
|
-
minLength={minPasswordLength}
|
|
98
|
-
/>
|
|
99
|
-
</div>
|
|
123
|
+
</FormField>
|
|
100
124
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
125
|
+
<FormField for='confirm-password' label={uiM('change_password_confirm')}>
|
|
126
|
+
<PasswordInput
|
|
127
|
+
value={confirmPassword}
|
|
128
|
+
id='confirm-password'
|
|
129
|
+
autocomplete='new-password'
|
|
130
|
+
required
|
|
131
|
+
oninput={(e) => { confirmPassword = e.currentTarget.value }}
|
|
132
|
+
placeholder={uiM('change_password_confirm_placeholder')}
|
|
133
|
+
{disabled}
|
|
134
|
+
error={errors.confirmPassword || (!passwordsMatch && confirmPassword ? uiM('change_password_mismatch') : '')}
|
|
135
|
+
showStrength={false}
|
|
136
|
+
/>
|
|
137
|
+
</FormField>
|
|
114
138
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
139
|
+
<div class='rounded-lg bg-base-content/3 px-3.5 py-2.5 text-xs text-base-content/50'>
|
|
140
|
+
{uiM('change_password_relogin_hint')}
|
|
141
|
+
</div>
|
|
118
142
|
|
|
119
|
-
|
|
120
|
-
<Alert variant='error'>
|
|
121
|
-
{errors.general}
|
|
122
|
-
</Alert>
|
|
123
|
-
{/if}
|
|
143
|
+
{#if passwordPolicy}<p class='text-xs text-base-content/60'>{passwordPolicyHint(passwordPolicy)}</p>{/if}
|
|
124
144
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
145
|
+
<Button
|
|
146
|
+
type='submit'
|
|
147
|
+
variant='primary'
|
|
148
|
+
class='disabled:text-base-content/70 w-full sm:w-auto sm:min-w-40'
|
|
149
|
+
disabled={loading || disabled || !canSubmit || Boolean(policyError)}
|
|
150
|
+
{loading}
|
|
151
|
+
>
|
|
152
|
+
{submitText || uiM('change_password_submit')}
|
|
153
|
+
</Button>
|
|
154
|
+
</FormLayout>
|
|
134
155
|
</form>
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
+
import type { DataAttributes } from '../../../types.js';
|
|
1
2
|
import type { ChangePasswordFormProps } from '../types.js';
|
|
3
|
+
type $$ComponentProps = ChangePasswordFormProps & DataAttributes;
|
|
2
4
|
/**
|
|
3
5
|
* ChangePasswordForm
|
|
4
6
|
* 修改密码表单组件。
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { mount, unmount } from 'svelte'
|
|
11
|
+
* import type { ComponentProps } from 'svelte'
|
|
12
|
+
* import { ChangePasswordForm } from '@h-ai/ui'
|
|
13
|
+
* const props: ComponentProps<typeof ChangePasswordForm> = { requireOldPassword: true, minPasswordLength: 12 }
|
|
14
|
+
* const component = mount(ChangePasswordForm, { target: document.body, props })
|
|
15
|
+
* await unmount(component)
|
|
16
|
+
* ```
|
|
5
17
|
*/
|
|
6
|
-
declare const ChangePasswordForm: import("svelte").Component
|
|
18
|
+
declare const ChangePasswordForm: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
7
19
|
type ChangePasswordForm = ReturnType<typeof ChangePasswordForm>;
|
|
8
20
|
export default ChangePasswordForm;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<!--
|
|
2
|
+
@component ForgotPasswordForm
|
|
2
3
|
=============================================================================
|
|
3
4
|
@h-ai/ui - ForgotPasswordForm 组件
|
|
4
5
|
=============================================================================
|
|
@@ -7,17 +8,33 @@
|
|
|
7
8
|
使用 Svelte 5 Runes ($props, $state, $derived)
|
|
8
9
|
使用 primitives/compounds 组件:Input, Button, Alert
|
|
9
10
|
=============================================================================
|
|
11
|
+
|
|
12
|
+
@example
|
|
13
|
+
```ts
|
|
14
|
+
import { mount, unmount } from 'svelte'
|
|
15
|
+
import type { ComponentProps } from 'svelte'
|
|
16
|
+
import { ForgotPasswordForm } from '@h-ai/ui'
|
|
17
|
+
const props: ComponentProps<typeof ForgotPasswordForm> = { mode: 'email' }
|
|
18
|
+
const component = mount(ForgotPasswordForm, { target: document.body, props })
|
|
19
|
+
await unmount(component)
|
|
20
|
+
```
|
|
10
21
|
-->
|
|
11
22
|
<script lang='ts'>
|
|
23
|
+
import type { DataAttributes } from '../../../types.js'
|
|
12
24
|
import type { ForgotPasswordFormData, ForgotPasswordFormProps } from '../types.js'
|
|
13
25
|
import { uiM } from '../../../messages.js'
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
26
|
+
import { useToastFeedback } from '../../../toast.svelte.js'
|
|
27
|
+
import { cn, getDataAttributes } from '../../../utils.js'
|
|
28
|
+
import FormField from '../../compounds/FormField.svelte'
|
|
29
|
+
import FormLayout from '../../compounds/FormLayout.svelte'
|
|
16
30
|
import Button from '../../primitives/Button.svelte'
|
|
17
31
|
import Input from '../../primitives/Input.svelte'
|
|
18
32
|
|
|
19
33
|
const {
|
|
20
34
|
loading = false,
|
|
35
|
+
columns = 1,
|
|
36
|
+
labelPosition = 'top',
|
|
37
|
+
labelWidth = '8rem',
|
|
21
38
|
disabled = false,
|
|
22
39
|
showTitle = false,
|
|
23
40
|
showDescription = false,
|
|
@@ -30,8 +47,10 @@
|
|
|
30
47
|
onsubmit,
|
|
31
48
|
header,
|
|
32
49
|
footer,
|
|
33
|
-
|
|
50
|
+
...restProps
|
|
51
|
+
}: ForgotPasswordFormProps & DataAttributes = $props()
|
|
34
52
|
|
|
53
|
+
const dataAttributes = $derived(getDataAttributes(restProps))
|
|
35
54
|
let email = $state('')
|
|
36
55
|
let phone = $state('')
|
|
37
56
|
|
|
@@ -42,106 +61,111 @@
|
|
|
42
61
|
),
|
|
43
62
|
)
|
|
44
63
|
|
|
64
|
+
function getSubmittedValue(formData: FormData, key: string, fallback = ''): string | undefined {
|
|
65
|
+
const submitted = formData.get(key)
|
|
66
|
+
const value = typeof submitted === 'string' ? submitted : fallback
|
|
67
|
+
const trimmed = value.trim()
|
|
68
|
+
return trimmed || undefined
|
|
69
|
+
}
|
|
70
|
+
|
|
45
71
|
async function handleSubmit(e: SubmitEvent) {
|
|
46
72
|
e.preventDefault()
|
|
47
73
|
if (loading || disabled)
|
|
48
74
|
return
|
|
49
75
|
|
|
76
|
+
const submittedFormData = new FormData(e.currentTarget as HTMLFormElement)
|
|
77
|
+
|
|
50
78
|
const data: ForgotPasswordFormData = {
|
|
51
|
-
email: mode === 'email' ? email : undefined,
|
|
52
|
-
phone: mode === 'phone' ? phone : undefined,
|
|
79
|
+
email: mode === 'email' ? getSubmittedValue(submittedFormData, 'email', email) : undefined,
|
|
80
|
+
phone: mode === 'phone' ? getSubmittedValue(submittedFormData, 'phone', phone) : undefined,
|
|
53
81
|
}
|
|
54
82
|
|
|
55
83
|
await onsubmit?.(data)
|
|
56
84
|
}
|
|
85
|
+
useToastFeedback(() => errors.general)
|
|
57
86
|
</script>
|
|
58
87
|
|
|
59
|
-
<form class={formClass} onsubmit={handleSubmit}>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
88
|
+
<form {...dataAttributes} class={formClass} onsubmit={handleSubmit}>
|
|
89
|
+
<FormLayout {columns} {labelPosition} {labelWidth}>
|
|
90
|
+
<!-- 标题 -->
|
|
91
|
+
{#if showTitle}
|
|
92
|
+
<h2 class='text-2xl font-semibold text-center mb-4'>{uiM('forgot_password_title')}</h2>
|
|
93
|
+
{/if}
|
|
64
94
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{#if mode === 'email'}
|
|
81
|
-
<div class='fieldset'>
|
|
82
|
-
<legend class='fieldset-legend'>{uiM('forgot_password_email_label')}</legend>
|
|
83
|
-
<Input
|
|
84
|
-
id='forgot-email'
|
|
85
|
-
name='email'
|
|
86
|
-
type='email'
|
|
87
|
-
placeholder={uiM('forgot_password_email_placeholder')}
|
|
88
|
-
bind:value={email}
|
|
89
|
-
{disabled}
|
|
90
|
-
required
|
|
91
|
-
error={errors.email}
|
|
92
|
-
/>
|
|
93
|
-
</div>
|
|
94
|
-
{:else}
|
|
95
|
-
<div class='fieldset'>
|
|
96
|
-
<legend class='fieldset-legend'>{uiM('forgot_password_phone_label')}</legend>
|
|
97
|
-
<Input
|
|
98
|
-
id='forgot-phone'
|
|
99
|
-
name='phone'
|
|
100
|
-
type='tel'
|
|
101
|
-
placeholder={uiM('forgot_password_phone_placeholder')}
|
|
102
|
-
bind:value={phone}
|
|
103
|
-
{disabled}
|
|
104
|
-
required
|
|
105
|
-
error={errors.phone}
|
|
106
|
-
/>
|
|
107
|
-
</div>
|
|
108
|
-
{/if}
|
|
109
|
-
|
|
110
|
-
<!-- 提示信息 -->
|
|
111
|
-
<p class='text-sm text-base-content/60'>
|
|
95
|
+
<!-- 描述 -->
|
|
96
|
+
{#if showDescription}
|
|
97
|
+
<p class='text-center text-base-content/60 text-sm mb-6'>
|
|
98
|
+
{uiM('forgot_password_desc')}
|
|
99
|
+
</p>
|
|
100
|
+
{/if}
|
|
101
|
+
|
|
102
|
+
<!-- 自定义头部 -->
|
|
103
|
+
{#if header}
|
|
104
|
+
<div class='forgot-password-form-header'>
|
|
105
|
+
{@render header()}
|
|
106
|
+
</div>
|
|
107
|
+
{/if}
|
|
108
|
+
|
|
109
|
+
<!-- 邮箱输入 -->
|
|
112
110
|
{#if mode === 'email'}
|
|
113
|
-
{uiM('
|
|
111
|
+
<FormField for='forgot-email' label={uiM('forgot_password_email_label')}>
|
|
112
|
+
<Input
|
|
113
|
+
id='forgot-email'
|
|
114
|
+
name='email'
|
|
115
|
+
type='email'
|
|
116
|
+
placeholder={uiM('forgot_password_email_placeholder')}
|
|
117
|
+
bind:value={email}
|
|
118
|
+
{disabled}
|
|
119
|
+
required
|
|
120
|
+
error={errors.email}
|
|
121
|
+
/>
|
|
122
|
+
</FormField>
|
|
114
123
|
{:else}
|
|
115
|
-
{uiM('
|
|
124
|
+
<FormField for='forgot-phone' label={uiM('forgot_password_phone_label')}>
|
|
125
|
+
<Input
|
|
126
|
+
id='forgot-phone'
|
|
127
|
+
name='phone'
|
|
128
|
+
type='tel'
|
|
129
|
+
placeholder={uiM('forgot_password_phone_placeholder')}
|
|
130
|
+
bind:value={phone}
|
|
131
|
+
{disabled}
|
|
132
|
+
required
|
|
133
|
+
error={errors.phone}
|
|
134
|
+
/>
|
|
135
|
+
</FormField>
|
|
136
|
+
{/if}
|
|
137
|
+
|
|
138
|
+
<!-- 提示信息 -->
|
|
139
|
+
<p class='text-sm text-base-content/60'>
|
|
140
|
+
{#if mode === 'email'}
|
|
141
|
+
{uiM('forgot_password_email_hint')}
|
|
142
|
+
{:else}
|
|
143
|
+
{uiM('forgot_password_phone_hint')}
|
|
144
|
+
{/if}
|
|
145
|
+
</p>
|
|
146
|
+
|
|
147
|
+
<!-- 通用错误 -->
|
|
148
|
+
|
|
149
|
+
<!-- 提交按钮 -->
|
|
150
|
+
<Button
|
|
151
|
+
type='submit'
|
|
152
|
+
variant='primary'
|
|
153
|
+
{loading}
|
|
154
|
+
disabled={loading || disabled}
|
|
155
|
+
class='disabled:text-base-content/70 w-full'
|
|
156
|
+
>
|
|
157
|
+
{submitText || uiM('forgot_password_submit')}
|
|
158
|
+
</Button>
|
|
159
|
+
|
|
160
|
+
<!-- 自定义底部 -->
|
|
161
|
+
{#if footer}
|
|
162
|
+
<div class='forgot-password-form-footer'>
|
|
163
|
+
{@render footer()}
|
|
164
|
+
</div>
|
|
165
|
+
{:else if showBackLink}
|
|
166
|
+
<div class='text-center mt-4 text-sm'>
|
|
167
|
+
<a href={loginUrl} class='link link-primary'>← {uiM('forgot_password_back')}</a>
|
|
168
|
+
</div>
|
|
116
169
|
{/if}
|
|
117
|
-
</
|
|
118
|
-
|
|
119
|
-
<!-- 通用错误 -->
|
|
120
|
-
{#if errors.general}
|
|
121
|
-
<Alert variant='error'>
|
|
122
|
-
{errors.general}
|
|
123
|
-
</Alert>
|
|
124
|
-
{/if}
|
|
125
|
-
|
|
126
|
-
<!-- 提交按钮 -->
|
|
127
|
-
<Button
|
|
128
|
-
type='submit'
|
|
129
|
-
variant='primary'
|
|
130
|
-
{loading}
|
|
131
|
-
disabled={loading || disabled}
|
|
132
|
-
class='w-full'
|
|
133
|
-
>
|
|
134
|
-
{submitText || uiM('forgot_password_submit')}
|
|
135
|
-
</Button>
|
|
136
|
-
|
|
137
|
-
<!-- 自定义底部 -->
|
|
138
|
-
{#if footer}
|
|
139
|
-
<div class='forgot-password-form-footer'>
|
|
140
|
-
{@render footer()}
|
|
141
|
-
</div>
|
|
142
|
-
{:else if showBackLink}
|
|
143
|
-
<div class='text-center mt-4 text-sm'>
|
|
144
|
-
<a href={loginUrl} class='link link-primary'>← {uiM('forgot_password_back')}</a>
|
|
145
|
-
</div>
|
|
146
|
-
{/if}
|
|
170
|
+
</FormLayout>
|
|
147
171
|
</form>
|
|
@@ -1,4 +1,27 @@
|
|
|
1
|
+
import type { DataAttributes } from '../../../types.js';
|
|
1
2
|
import type { ForgotPasswordFormProps } from '../types.js';
|
|
2
|
-
|
|
3
|
+
type $$ComponentProps = ForgotPasswordFormProps & DataAttributes;
|
|
4
|
+
/**
|
|
5
|
+
* ForgotPasswordForm
|
|
6
|
+
* =============================================================================
|
|
7
|
+
* @h-ai/ui - ForgotPasswordForm 组件
|
|
8
|
+
* =============================================================================
|
|
9
|
+
* 找回密码表单组件
|
|
10
|
+
*
|
|
11
|
+
* 使用 Svelte 5 Runes ($props, $state, $derived)
|
|
12
|
+
* 使用 primitives/compounds 组件:Input, Button, Alert
|
|
13
|
+
* =============================================================================
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { mount, unmount } from 'svelte'
|
|
18
|
+
* import type { ComponentProps } from 'svelte'
|
|
19
|
+
* import { ForgotPasswordForm } from '@h-ai/ui'
|
|
20
|
+
* const props: ComponentProps<typeof ForgotPasswordForm> = { mode: 'email' }
|
|
21
|
+
* const component = mount(ForgotPasswordForm, { target: document.body, props })
|
|
22
|
+
* await unmount(component)
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
declare const ForgotPasswordForm: import("svelte").Component<$$ComponentProps, {}, "">;
|
|
3
26
|
type ForgotPasswordForm = ReturnType<typeof ForgotPasswordForm>;
|
|
4
27
|
export default ForgotPasswordForm;
|