@h-ai/ui 0.1.0-alpha.66 → 0.1.0-alpha.68
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 +106 -55
- package/README.ja.md +106 -55
- package/README.md +137 -87
- package/dist/components/compounds/Accordion.svelte +24 -0
- package/dist/components/compounds/Accordion.svelte.d.ts +34 -0
- package/dist/components/compounds/ActionSheet.svelte +24 -0
- package/dist/components/compounds/ActionSheet.svelte.d.ts +38 -0
- package/dist/components/compounds/Alert.svelte +15 -4
- package/dist/components/compounds/Alert.svelte.d.ts +10 -0
- package/dist/components/compounds/AppBar.svelte +24 -0
- package/dist/components/compounds/AppBar.svelte.d.ts +33 -0
- package/dist/components/compounds/BottomNav.svelte +37 -0
- package/dist/components/compounds/BottomNav.svelte.d.ts +43 -0
- package/dist/components/compounds/Breadcrumb.svelte +11 -0
- package/dist/components/compounds/Breadcrumb.svelte.d.ts +20 -0
- package/dist/components/compounds/Calendar.svelte +20 -6
- package/dist/components/compounds/Calendar.svelte.d.ts +20 -6
- package/dist/components/compounds/Card.svelte +10 -0
- package/dist/components/compounds/Card.svelte.d.ts +10 -0
- package/dist/components/compounds/Combobox.svelte +35 -18
- package/dist/components/compounds/Combobox.svelte.d.ts +35 -18
- package/dist/components/compounds/Confirm.svelte +11 -0
- package/dist/components/compounds/Confirm.svelte.d.ts +21 -0
- package/dist/components/compounds/DataTable.svelte +40 -17
- package/dist/components/compounds/DataTable.svelte.d.ts +9 -13
- package/dist/components/compounds/DatePicker.svelte +20 -6
- package/dist/components/compounds/DatePicker.svelte.d.ts +20 -6
- package/dist/components/compounds/Drawer.svelte +11 -0
- package/dist/components/compounds/Drawer.svelte.d.ts +21 -0
- package/dist/components/compounds/Dropdown.svelte +10 -0
- package/dist/components/compounds/Dropdown.svelte.d.ts +10 -0
- package/dist/components/compounds/Empty.svelte +16 -5
- package/dist/components/compounds/Empty.svelte.d.ts +20 -0
- package/dist/components/compounds/Form.svelte +37 -2
- package/dist/components/compounds/Form.svelte.d.ts +20 -0
- package/dist/components/compounds/FormField.svelte +11 -0
- package/dist/components/compounds/FormField.svelte.d.ts +20 -0
- package/dist/components/compounds/FormLayout.svelte +13 -1
- package/dist/components/compounds/FormLayout.svelte.d.ts +13 -0
- package/dist/components/compounds/InfiniteScroll.svelte +24 -0
- package/dist/components/compounds/InfiniteScroll.svelte.d.ts +34 -0
- package/dist/components/compounds/MessageBoxContainer.svelte +11 -0
- package/dist/components/compounds/MessageBoxContainer.svelte.d.ts +21 -0
- package/dist/components/compounds/MessageBoxDialog.svelte +14 -0
- package/dist/components/compounds/MessageBoxDialog.svelte.d.ts +21 -0
- package/dist/components/compounds/MessageContainer.svelte +11 -0
- package/dist/components/compounds/MessageContainer.svelte.d.ts +21 -0
- package/dist/components/compounds/Modal.svelte +10 -0
- package/dist/components/compounds/Modal.svelte.d.ts +10 -0
- package/dist/components/compounds/PageHeader.svelte +21 -8
- package/dist/components/compounds/PageHeader.svelte.d.ts +21 -8
- package/dist/components/compounds/Pagination.svelte +34 -8
- package/dist/components/compounds/Pagination.svelte.d.ts +20 -0
- package/dist/components/compounds/Popover.svelte +11 -0
- package/dist/components/compounds/Popover.svelte.d.ts +20 -0
- package/dist/components/compounds/PullRefresh.svelte +24 -0
- package/dist/components/compounds/PullRefresh.svelte.d.ts +32 -0
- package/dist/components/compounds/Result.svelte +11 -0
- package/dist/components/compounds/Result.svelte.d.ts +20 -0
- package/dist/components/compounds/SafeArea.svelte +24 -0
- package/dist/components/compounds/SafeArea.svelte.d.ts +32 -0
- package/dist/components/compounds/Skeleton.svelte +10 -0
- package/dist/components/compounds/Skeleton.svelte.d.ts +10 -0
- package/dist/components/compounds/Steps.svelte +11 -0
- package/dist/components/compounds/Steps.svelte.d.ts +20 -0
- package/dist/components/compounds/SwipeCell.svelte +24 -0
- package/dist/components/compounds/SwipeCell.svelte.d.ts +37 -0
- package/dist/components/compounds/TableToolbar.svelte +66 -28
- package/dist/components/compounds/TableToolbar.svelte.d.ts +29 -19
- package/dist/components/compounds/Tabs.svelte +58 -10
- package/dist/components/compounds/Tabs.svelte.d.ts +10 -0
- package/dist/components/compounds/TagInput.svelte +11 -0
- package/dist/components/compounds/TagInput.svelte.d.ts +20 -0
- package/dist/components/compounds/Timeline.svelte +24 -0
- package/dist/components/compounds/Timeline.svelte.d.ts +34 -0
- package/dist/components/compounds/ToastContainer.svelte +11 -0
- package/dist/components/compounds/ToastContainer.svelte.d.ts +26 -0
- package/dist/components/compounds/Tooltip.svelte +11 -0
- package/dist/components/compounds/Tooltip.svelte.d.ts +22 -0
- 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/swipe-cell-types.d.ts +9 -0
- package/dist/components/compounds/timeline-types.d.ts +9 -0
- package/dist/components/control-size.d.ts +17 -0
- package/dist/components/control-size.js +8 -0
- package/dist/components/primitives/Avatar.svelte +10 -0
- package/dist/components/primitives/Avatar.svelte.d.ts +10 -0
- package/dist/components/primitives/Badge.svelte +10 -0
- package/dist/components/primitives/Badge.svelte.d.ts +10 -0
- package/dist/components/primitives/BareButton.svelte +11 -0
- package/dist/components/primitives/BareButton.svelte.d.ts +20 -0
- package/dist/components/primitives/BareInput.svelte +11 -0
- package/dist/components/primitives/BareInput.svelte.d.ts +20 -0
- package/dist/components/primitives/Button.svelte +10 -0
- package/dist/components/primitives/Button.svelte.d.ts +10 -0
- package/dist/components/primitives/Checkbox.svelte +11 -0
- package/dist/components/primitives/Checkbox.svelte.d.ts +20 -0
- package/dist/components/primitives/IconButton.svelte +11 -0
- package/dist/components/primitives/IconButton.svelte.d.ts +20 -0
- package/dist/components/primitives/Input.svelte +10 -0
- package/dist/components/primitives/Input.svelte.d.ts +10 -0
- package/dist/components/primitives/Progress.svelte +11 -0
- package/dist/components/primitives/Progress.svelte.d.ts +20 -0
- package/dist/components/primitives/Radio.svelte +11 -0
- package/dist/components/primitives/Radio.svelte.d.ts +20 -0
- package/dist/components/primitives/Range.svelte +24 -0
- package/dist/components/primitives/Range.svelte.d.ts +34 -0
- package/dist/components/primitives/Rating.svelte +24 -0
- package/dist/components/primitives/Rating.svelte.d.ts +34 -0
- package/dist/components/primitives/Select.svelte +11 -0
- package/dist/components/primitives/Select.svelte.d.ts +21 -0
- package/dist/components/primitives/Spinner.svelte +11 -0
- package/dist/components/primitives/Spinner.svelte.d.ts +20 -0
- package/dist/components/primitives/Switch.svelte +11 -0
- package/dist/components/primitives/Switch.svelte.d.ts +20 -0
- package/dist/components/primitives/Tag.svelte +11 -0
- package/dist/components/primitives/Tag.svelte.d.ts +20 -0
- package/dist/components/primitives/Textarea.svelte +11 -0
- package/dist/components/primitives/Textarea.svelte.d.ts +21 -0
- package/dist/components/primitives/ToggleCheckbox.svelte +11 -0
- package/dist/components/primitives/ToggleCheckbox.svelte.d.ts +20 -0
- package/dist/components/primitives/ToggleInput.svelte +11 -0
- package/dist/components/primitives/ToggleInput.svelte.d.ts +20 -0
- package/dist/components/primitives/ToggleRadio.svelte +11 -0
- package/dist/components/primitives/ToggleRadio.svelte.d.ts +20 -0
- package/dist/components/scenes/ai/AiDocumentDownloadMenu.svelte +27 -0
- package/dist/components/scenes/ai/AiDocumentDownloadMenu.svelte.d.ts +27 -0
- package/dist/components/scenes/ai/AiDocumentEditor.svelte +79 -0
- package/dist/components/scenes/ai/AiDocumentEditor.svelte.d.ts +23 -0
- package/dist/components/scenes/ai/MarkdownRenderer.svelte +11 -0
- package/dist/components/scenes/ai/MarkdownRenderer.svelte.d.ts +28 -0
- package/dist/components/scenes/ai/code-preview.d.ts +28 -0
- package/dist/components/scenes/ai/code-preview.js +20 -0
- package/dist/components/scenes/ai/document-download.d.ts +52 -0
- package/dist/components/scenes/ai/document-download.js +30 -2
- package/dist/components/scenes/ai/document-parse.d.ts +71 -14
- package/dist/components/scenes/ai/document-parse.js +19 -9
- package/dist/components/scenes/ai/document-types.d.ts +222 -88
- package/dist/components/scenes/ai/editor-markdown-extensions.d.ts +16 -0
- package/dist/components/scenes/ai/editor-markdown-extensions.js +16 -0
- package/dist/components/scenes/ai/highlight.d.ts +11 -0
- package/dist/components/scenes/ai/highlight.js +11 -0
- package/dist/components/scenes/ai/markdown-parse.d.ts +8 -2
- package/dist/components/scenes/ai/markdown-parse.js +2 -2
- package/dist/components/scenes/ai/mermaid-host-sync.d.ts +38 -0
- package/dist/components/scenes/ai/mermaid-host-sync.js +30 -0
- package/dist/components/scenes/ai/mermaid-render.d.ts +23 -0
- package/dist/components/scenes/ai/mermaid-render.js +23 -0
- package/dist/components/scenes/ai/safe-html.d.ts +54 -6
- package/dist/components/scenes/ai/safe-html.js +54 -6
- package/dist/components/scenes/ai/table/AiTableEditor.svelte +48 -0
- package/dist/components/scenes/ai/table/AiTableEditor.svelte.d.ts +24 -0
- package/dist/components/scenes/ai/table/table-types.d.ts +79 -0
- package/dist/components/scenes/app/FeedbackModal.svelte +45 -5
- package/dist/components/scenes/app/FeedbackModal.svelte.d.ts +45 -5
- package/dist/components/scenes/app/LanguageSwitch.svelte +29 -19
- package/dist/components/scenes/app/LanguageSwitch.svelte.d.ts +28 -19
- package/dist/components/scenes/app/SettingsLayout.svelte +21 -9
- package/dist/components/scenes/app/SettingsLayout.svelte.d.ts +21 -9
- package/dist/components/scenes/app/SettingsModal.svelte +23 -0
- package/dist/components/scenes/app/SettingsModal.svelte.d.ts +23 -0
- package/dist/components/scenes/app/ThemeColorPicker.svelte +31 -0
- package/dist/components/scenes/app/ThemeColorPicker.svelte.d.ts +31 -0
- package/dist/components/scenes/app/ThemeSelector.svelte +21 -6
- package/dist/components/scenes/app/ThemeSelector.svelte.d.ts +21 -6
- package/dist/components/scenes/app/ThemeToggle.svelte +21 -4
- package/dist/components/scenes/app/ThemeToggle.svelte.d.ts +21 -4
- package/dist/components/scenes/app/index.d.ts +1 -1
- package/dist/components/scenes/app/index.js +1 -1
- package/dist/components/scenes/charts/Chart.svelte +11 -0
- package/dist/components/scenes/charts/Chart.svelte.d.ts +20 -0
- package/dist/components/scenes/charts/chart-theme.d.ts +25 -1
- package/dist/components/scenes/charts/chart-theme.js +25 -1
- package/dist/components/scenes/charts/chart-types.d.ts +83 -7
- package/dist/components/scenes/charts/renderers/LineChart.svelte +53 -0
- package/dist/components/scenes/charts/renderers/LineChart.svelte.d.ts +13 -0
- package/dist/components/scenes/crud/CrudDeleteConfirm.svelte +10 -0
- package/dist/components/scenes/crud/CrudDeleteConfirm.svelte.d.ts +10 -0
- package/dist/components/scenes/crud/CrudDetailDrawer.svelte +8 -0
- package/dist/components/scenes/crud/CrudDetailDrawer.svelte.d.ts +8 -0
- package/dist/components/scenes/crud/CrudDetailPanel.svelte +18 -0
- package/dist/components/scenes/crud/CrudDetailPanel.svelte.d.ts +18 -0
- package/dist/components/scenes/crud/CrudEditPanel.svelte +10 -0
- package/dist/components/scenes/crud/CrudEditPanel.svelte.d.ts +10 -0
- package/dist/components/scenes/crud/CrudFilterBar.svelte +18 -0
- package/dist/components/scenes/crud/CrudFilterBar.svelte.d.ts +18 -0
- package/dist/components/scenes/crud/CrudPage.svelte +37 -5
- package/dist/components/scenes/crud/CrudPage.svelte.d.ts +35 -3
- package/dist/components/scenes/crud/crud-controller.svelte.d.ts +142 -23
- package/dist/components/scenes/crud/crud-controller.svelte.js +22 -11
- package/dist/components/scenes/crud/crud-form-validation.d.ts +12 -0
- package/dist/components/scenes/crud/crud-form-validation.js +12 -0
- package/dist/components/scenes/crud/crud-types.d.ts +79 -8
- package/dist/components/scenes/crud/nav-adapter.d.ts +14 -0
- package/dist/components/scenes/crud/nav-adapter.js +8 -0
- package/dist/components/scenes/crypto/EncryptedInput.svelte +24 -0
- package/dist/components/scenes/crypto/EncryptedInput.svelte.d.ts +34 -0
- package/dist/components/scenes/crypto/HashDisplay.svelte +11 -0
- package/dist/components/scenes/crypto/HashDisplay.svelte.d.ts +21 -0
- package/dist/components/scenes/crypto/SignatureDisplay.svelte +11 -0
- package/dist/components/scenes/crypto/SignatureDisplay.svelte.d.ts +21 -0
- package/dist/components/scenes/error/ErrorPage.svelte +8 -1
- package/dist/components/scenes/error/ErrorPage.svelte.d.ts +8 -1
- package/dist/components/scenes/error/error-presets.d.ts +40 -4
- package/dist/components/scenes/error/error-presets.js +22 -2
- package/dist/components/scenes/guide/GuideHost.svelte +27 -0
- package/dist/components/scenes/guide/GuideHost.svelte.d.ts +27 -0
- package/dist/components/scenes/guide/HelpCenter.svelte +27 -0
- package/dist/components/scenes/guide/HelpCenter.svelte.d.ts +27 -0
- package/dist/components/scenes/iam/AuthPanel.svelte +26 -2
- package/dist/components/scenes/iam/AuthPanel.svelte.d.ts +25 -0
- package/dist/components/scenes/iam/AuthShell.svelte +8 -3
- package/dist/components/scenes/iam/AuthShell.svelte.d.ts +8 -3
- package/dist/components/scenes/iam/ChangePasswordForm.svelte +10 -0
- package/dist/components/scenes/iam/ChangePasswordForm.svelte.d.ts +10 -0
- package/dist/components/scenes/iam/ForgotPasswordForm.svelte +11 -0
- package/dist/components/scenes/iam/ForgotPasswordForm.svelte.d.ts +21 -0
- package/dist/components/scenes/iam/LoginForm.svelte +24 -31
- package/dist/components/scenes/iam/LoginForm.svelte.d.ts +10 -0
- package/dist/components/scenes/iam/PasswordInput.svelte +23 -0
- package/dist/components/scenes/iam/PasswordInput.svelte.d.ts +23 -0
- 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/RegisterForm.svelte +10 -0
- package/dist/components/scenes/iam/RegisterForm.svelte.d.ts +10 -0
- package/dist/components/scenes/iam/ResetPasswordForm.svelte +10 -0
- package/dist/components/scenes/iam/ResetPasswordForm.svelte.d.ts +10 -0
- package/dist/components/scenes/iam/UserProfile.svelte +11 -0
- package/dist/components/scenes/iam/UserProfile.svelte.d.ts +21 -0
- package/dist/components/scenes/iam/auth-error-message.d.ts +10 -0
- package/dist/components/scenes/iam/auth-error-message.js +10 -0
- package/dist/components/scenes/iam/password-utils.d.ts +39 -1
- package/dist/components/scenes/iam/password-utils.js +39 -1
- 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/storage/AvatarUpload.svelte +11 -0
- package/dist/components/scenes/storage/AvatarUpload.svelte.d.ts +20 -0
- package/dist/components/scenes/storage/FileList.svelte +13 -2
- package/dist/components/scenes/storage/FileList.svelte.d.ts +20 -0
- package/dist/components/scenes/storage/FileUpload.svelte +37 -2
- package/dist/components/scenes/storage/FileUpload.svelte.d.ts +21 -0
- package/dist/components/scenes/storage/ImageUpload.svelte +11 -0
- package/dist/components/scenes/storage/ImageUpload.svelte.d.ts +21 -0
- package/dist/components/scenes/types.d.ts +352 -11
- package/dist/guide-storage.d.ts +13 -1
- package/dist/guide-storage.js +13 -1
- package/dist/guide-types.d.ts +67 -2
- package/dist/guide.svelte.d.ts +22 -1
- package/dist/guide.svelte.js +22 -1
- package/dist/i18n.svelte.d.ts +64 -3
- package/dist/i18n.svelte.js +99 -18
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -2
- package/dist/internal/browser-safety.d.ts +51 -2
- package/dist/internal/browser-safety.js +45 -7
- package/dist/internal/form-context.d.ts +73 -0
- package/dist/internal/form-context.js +57 -0
- package/dist/internal/form-validation.svelte.d.ts +42 -0
- package/dist/internal/form-validation.svelte.js +26 -0
- package/dist/internal/icon-safety.d.ts +7 -0
- package/dist/internal/icon-safety.js +7 -0
- package/dist/internal/locale.d.ts +19 -0
- package/dist/internal/locale.js +21 -0
- package/dist/message.svelte.d.ts +90 -0
- package/dist/message.svelte.js +84 -0
- package/dist/messagebox.svelte.d.ts +61 -13
- package/dist/messagebox.svelte.js +55 -13
- package/dist/messages/en-US.json +6 -1
- package/dist/messages/ja-JP.json +389 -0
- package/dist/messages/zh-CN.json +6 -1
- package/dist/messages.d.ts +24 -3
- package/dist/messages.js +18 -3
- package/dist/styles/design-tokens.css +4 -2
- package/dist/styles/global.css +28 -8
- package/dist/styles/theme.css +2 -0
- package/dist/theme-config.d.ts +173 -0
- package/dist/theme-config.js +143 -0
- package/dist/toast.svelte.d.ts +114 -4
- package/dist/toast.svelte.js +108 -4
- package/dist/types.d.ts +526 -9
- package/dist/utils/platform.svelte.d.ts +28 -15
- package/dist/utils/platform.svelte.js +19 -14
- package/dist/utils.d.ts +102 -0
- package/dist/utils.js +93 -0
- package/package.json +66 -6
package/README.en.md
CHANGED
|
@@ -4,19 +4,31 @@
|
|
|
4
4
|
|
|
5
5
|
[Framework home](../../README.en.md) · Related modules: [@h-ai/core](../core/README.en.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Introduction
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Built-in messages support `zh-CN`, `en-US` and `ja-JP`; the language selector offers all three by default.
|
|
10
|
+
|
|
11
|
+
A cross-platform Svelte 5 Runes component library with DaisyUI v5 + Tailwind CSS v4 styling and Bits UI v2 headless interactions. Includes built-in i18n (zh-CN / en-US) and 15 curated DaisyUI themes.
|
|
12
|
+
|
|
13
|
+
## Core features
|
|
14
|
+
|
|
15
|
+
- Forms, tables, dialogs, navigation, charts and application components.
|
|
16
|
+
- Authentication, CRUD, AI content, onboarding and a help center.
|
|
17
|
+
- Svelte 5, themes, responsive layouts and Chinese/English/Japanese component messages.
|
|
18
|
+
|
|
19
|
+
## Getting started
|
|
20
|
+
|
|
21
|
+
### Installation
|
|
10
22
|
|
|
11
23
|
```bash
|
|
12
|
-
npm install @h-ai/ui
|
|
24
|
+
npm install @h-ai/ui @h-ai/core
|
|
13
25
|
```
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
For a Node server, declare both UI and core as production dependencies so the adapter preserves native logging and runtime dependencies.
|
|
16
28
|
|
|
17
|
-
|
|
29
|
+
### Quick start
|
|
18
30
|
|
|
19
|
-
|
|
31
|
+
#### 1. Configure svelte.config.js
|
|
20
32
|
|
|
21
33
|
```js
|
|
22
34
|
import { autoImportHaiUi } from '@h-ai/ui/auto-import'
|
|
@@ -33,7 +45,7 @@ const config = {
|
|
|
33
45
|
export default config
|
|
34
46
|
```
|
|
35
47
|
|
|
36
|
-
|
|
48
|
+
#### 2. Configure vite.config.ts
|
|
37
49
|
|
|
38
50
|
```ts
|
|
39
51
|
import { haiOptimizeExclude, haiPrebundledDeps } from '@h-ai/ui/vite'
|
|
@@ -51,11 +63,13 @@ export default defineConfig({
|
|
|
51
63
|
// 避免首次进入业务路由时触发依赖再优化与整页刷新
|
|
52
64
|
include: [...haiPrebundledDeps],
|
|
53
65
|
},
|
|
54
|
-
ssr: { noExternal: [
|
|
66
|
+
ssr: { noExternal: ['@h-ai/ui', '@h-ai/kit'], external: ['@h-ai/core', 'sm-crypto'] },
|
|
55
67
|
})
|
|
56
68
|
```
|
|
57
69
|
|
|
58
|
-
|
|
70
|
+
When using Crypto or Kit/IAM, include `sm-crypto@0.5.7` in application production dependencies. CLI projects already do this; for manual setup, run `pnpm add sm-crypto@0.5.7`. The external option alone is insufficient: adapter-node also uses direct production dependencies to preserve native package loading.
|
|
71
|
+
|
|
72
|
+
#### 3. Configure src/app.css
|
|
59
73
|
|
|
60
74
|
```css
|
|
61
75
|
@import 'tailwindcss';
|
|
@@ -76,7 +90,7 @@ export default defineConfig({
|
|
|
76
90
|
|
|
77
91
|
> `@source` makes TailwindCSS scan classes in `@h-ai/ui`; without it, component styles are missing. In nested monorepo apps, dependencies may be hoisted to root `node_modules`, so retain both paths.
|
|
78
92
|
|
|
79
|
-
|
|
93
|
+
#### 4. Use components
|
|
80
94
|
|
|
81
95
|
```svelte
|
|
82
96
|
<script>
|
|
@@ -108,7 +122,7 @@ import { Button } from '@h-ai/ui/components/primitives/index'
|
|
|
108
122
|
import { getThemeInfo, THEMES } from '@h-ai/ui/theme'
|
|
109
123
|
```
|
|
110
124
|
|
|
111
|
-
|
|
125
|
+
#### data-\* attribute forwarding
|
|
112
126
|
|
|
113
127
|
Public Svelte components forward caller-supplied `data-*` attributes to their root or primary interactive element for tests, analytics, and automation. Other unknown attributes are not forwarded.
|
|
114
128
|
|
|
@@ -120,7 +134,7 @@ Public Svelte components forward caller-supplied `data-*` attributes to their ro
|
|
|
120
134
|
|
|
121
135
|
No extra button, input, or overlay wrappers are needed just for `data-testid`.
|
|
122
136
|
|
|
123
|
-
|
|
137
|
+
### Component architecture
|
|
124
138
|
|
|
125
139
|
Three layers (primitives → compounds → scenes):
|
|
126
140
|
|
|
@@ -137,9 +151,9 @@ components/
|
|
|
137
151
|
└── crypto/ # Cryptographic display
|
|
138
152
|
```
|
|
139
153
|
|
|
140
|
-
|
|
154
|
+
### Component catalog
|
|
141
155
|
|
|
142
|
-
|
|
156
|
+
#### Primitives (20)
|
|
143
157
|
|
|
144
158
|
| Component | Description | Key props |
|
|
145
159
|
| ---------------- | ------------------- | ------------------------------------------------------------------------------ |
|
|
@@ -166,9 +180,9 @@ components/
|
|
|
166
180
|
|
|
167
181
|
For `BareInput` with `type="file"`, read `event.currentTarget.files` in `onchange` and leave the file path `value` unbound. Other input types support `bind:value`.
|
|
168
182
|
|
|
169
|
-
|
|
183
|
+
#### Compounds (37)
|
|
170
184
|
|
|
171
|
-
|
|
185
|
+
##### Forms
|
|
172
186
|
|
|
173
187
|
| Component | Description | Key props |
|
|
174
188
|
| ----------- | -------------- | -------------------------------------------- |
|
|
@@ -177,7 +191,7 @@ For `BareInput` with `type="file"`, read `event.currentTarget.files` in `onchang
|
|
|
177
191
|
| `FormLayout` | Form layout | `columns`, `labelPosition`, `labelWidth` |
|
|
178
192
|
| `TagInput` | Tag input | `tags`, `maxTags`, `allowDuplicates`, `size` |
|
|
179
193
|
|
|
180
|
-
|
|
194
|
+
##### Form layouts and validation
|
|
181
195
|
|
|
182
196
|
`Form` and `FormLayout` (for native `<form>` elements) share `columns={1 | 2}`, `labelPosition="top" | "left"` and `labelWidth` (default `8rem`). Defaults are one column and stacked labels. Two columns collapse below a container width of `36rem`; inline labels stack below `28rem`.
|
|
183
197
|
|
|
@@ -185,7 +199,7 @@ For `BareInput` with `type="file"`, read `event.currentTarget.files` in `onchang
|
|
|
185
199
|
|
|
186
200
|
Labels connect to nested UI controls automatically; use `<FormField for="control-id">` for explicit IDs or native controls. Errors and hints use `aria-describedby`, invalid controls use `aria-invalid`, and field errors appear once. `label` / `error` / `hint` accept strings or deferred translation functions.
|
|
187
201
|
|
|
188
|
-
`Input`, `Textarea`, `Select` and `PasswordInput` provide Chinese/English native validation messages. `validationMessage` overrides failures without keeping valid input invalid. Sync locale with the UI `setGlobalLocale` / `createLocaleStore` to update visible validation errors immediately. `Textarea` supports `minlength` / `maxlength`; `Select` supports `name`, required validation and FormData serialization.
|
|
202
|
+
`Input`, `Textarea`, `Select` and `PasswordInput` provide Chinese/English/Japanese native validation messages. `validationMessage` overrides failures without keeping valid input invalid. Sync locale with the UI `setGlobalLocale` / `createLocaleStore` to update visible validation errors immediately. `Textarea` supports `minlength` / `maxlength`; `Select` supports `name`, required validation and FormData serialization.
|
|
189
203
|
|
|
190
204
|
Client validation appears on the first blur and updates as invalid input is corrected. Untouched fields are validated on submit. CRUD create/edit forms share this behavior, honor custom messages and reset validation when reopened. `Select` validates when focus leaves both its trigger and options. `PasswordInput.minLength` enforces length and informs strength; omitting it leaves login password length unrestricted while strength uses an eight-character baseline.
|
|
191
205
|
|
|
@@ -206,14 +220,14 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
206
220
|
</Form>
|
|
207
221
|
```
|
|
208
222
|
|
|
209
|
-
|
|
223
|
+
##### Feedback
|
|
210
224
|
|
|
211
225
|
| Component | Description | Key props |
|
|
212
226
|
| ---------------- | --------------- | ------------------------------------------------- |
|
|
213
227
|
| `Alert` | Alert | `variant`, `title`, `dismissible` |
|
|
214
228
|
| `ToastContainer` | Toast container | Place globally and use with the `toast` singleton |
|
|
215
229
|
|
|
216
|
-
|
|
230
|
+
##### Overlays
|
|
217
231
|
|
|
218
232
|
| Component | Description | Key props |
|
|
219
233
|
| --------- | ------------------- | ---------------------------------------------------------------------------- |
|
|
@@ -222,7 +236,7 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
222
236
|
| `Confirm` | Confirmation dialog | `open`, `title`, `message`, `variant`, `onconfirm` |
|
|
223
237
|
| `Popover` | Popover | `open`, `position`, `trigger`, `offset`, `portal` |
|
|
224
238
|
|
|
225
|
-
|
|
239
|
+
##### Data display
|
|
226
240
|
|
|
227
241
|
| Component | Description | Key props |
|
|
228
242
|
| ----------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -231,7 +245,7 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
231
245
|
| `Accordion` | Accordion | `items: AccordionItem[]` |
|
|
232
246
|
| `Timeline` | Timeline | `items: TimelineItem[]` |
|
|
233
247
|
|
|
234
|
-
|
|
248
|
+
##### Bits UI headless interactions
|
|
235
249
|
|
|
236
250
|
| Component | Description | Key props |
|
|
237
251
|
| ------------ | ----------------------------------- | ----------------------------------------------------------- |
|
|
@@ -241,7 +255,7 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
241
255
|
|
|
242
256
|
> Dates use `DateValue` / `CalendarDate` from `@internationalized/date`.
|
|
243
257
|
|
|
244
|
-
|
|
258
|
+
##### Mobile / enhanced interactions
|
|
245
259
|
|
|
246
260
|
| Component | Description | Key props |
|
|
247
261
|
| ---------------- | ------------------- | ------------------------------------------------------ |
|
|
@@ -253,7 +267,7 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
253
267
|
| `SafeArea` | Safe area container | `top`, `bottom`, `left`, `right` |
|
|
254
268
|
| `SwipeCell` | Swipe actions | `leftActions`, `rightActions`, `threshold`, `onaction` |
|
|
255
269
|
|
|
256
|
-
|
|
270
|
+
##### Navigation
|
|
257
271
|
|
|
258
272
|
| Component | Description | Key props |
|
|
259
273
|
| ------------ | ------------------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
@@ -264,7 +278,7 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
264
278
|
| `Dropdown` | Dropdown menu | `items`, `trigger`, `triggerClass`, `position` |
|
|
265
279
|
| `Tooltip` | Tooltip | `content`, `position`, `delay` |
|
|
266
280
|
|
|
267
|
-
|
|
281
|
+
##### State placeholders
|
|
268
282
|
|
|
269
283
|
| Component | Description | Key props |
|
|
270
284
|
| ---------- | ----------- | ------------------------------------- |
|
|
@@ -272,22 +286,22 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
272
286
|
| `Empty` | Empty state | `title`, `description`, `icon` |
|
|
273
287
|
| `Result` | Result page | `status`, `title`, `description` |
|
|
274
288
|
|
|
275
|
-
|
|
289
|
+
##### Page-level
|
|
276
290
|
|
|
277
291
|
| Component | Description | Key props |
|
|
278
292
|
| ------------ | ----------- | ----------------------------------------------- |
|
|
279
293
|
| `PageHeader` | Page header | `title`, `description`; supports `actions` slot |
|
|
280
294
|
|
|
281
|
-
|
|
295
|
+
#### Scenes (36)
|
|
282
296
|
|
|
283
|
-
|
|
297
|
+
##### Guide (2)
|
|
284
298
|
|
|
285
299
|
| Component | Description | Key props |
|
|
286
300
|
| --- | --- | --- |
|
|
287
301
|
| `GuideHost` | First-use invitations, tours and help dialog host | `guide`, `locale`, `scope`, `autoStart` |
|
|
288
302
|
| `HelpCenter` | Standalone searchable help center | `articles`, `tours`, `locale`, `selectedId`, `onstart` |
|
|
289
303
|
|
|
290
|
-
|
|
304
|
+
##### App (7)
|
|
291
305
|
|
|
292
306
|
| Component | Description | Key props |
|
|
293
307
|
| ------------------ | ---------------------------------------------- | -------------------------------------------------------- |
|
|
@@ -299,13 +313,13 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
299
313
|
| `ThemeSelector` | Full theme selector | No props required |
|
|
300
314
|
| `ThemeToggle` | Light/dark toggle | No props required |
|
|
301
315
|
|
|
302
|
-
|
|
316
|
+
##### IAM authentication (10)
|
|
303
317
|
|
|
304
318
|
| Component | Description | Key props |
|
|
305
319
|
| -------------------- | ------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
|
|
306
320
|
| `AuthPanel` | Configuration driven authentication | `config`, `actions`, `loginHeader/loginFields/loginFooter`, `registerHeader/registerFields/registerFooter` |
|
|
307
321
|
| `AuthShell` | Auth page layout (centered card / split columns) | `variant`, `title`, `subtitle`, `brandTitle`, `brandText`, `illustration`, `description`, `highlights` |
|
|
308
|
-
| `LoginForm` | Login form | `loading`, `errors`, `
|
|
322
|
+
| `LoginForm` | Login form | `loading`, `errors`, `showForgotPassword`, `onsubmit` |
|
|
309
323
|
| `RegisterForm` | Registration form | `loading`, `errors`, `fields`, `onsubmit` |
|
|
310
324
|
| `ForgotPasswordForm` | Forgot password | `mode`, `loading`, `errors`, `onsubmit` |
|
|
311
325
|
| `ResetPasswordForm` | Reset password | `loading`, `errors`, `showCode`, `onsubmit` |
|
|
@@ -314,7 +328,7 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
314
328
|
| `PermGuard` | Permission guard | `permissions`, `mode`, `fallback` |
|
|
315
329
|
| `UserProfile` | User profile | `user`, `editable`, `fields`, `avatarAccept`, `avatarHint`, `onsubmit` |
|
|
316
330
|
|
|
317
|
-
|
|
331
|
+
##### Storage (4)
|
|
318
332
|
|
|
319
333
|
| Component | Description | Key props |
|
|
320
334
|
| -------------- | ------------- | ------------------------------------------------------------ |
|
|
@@ -325,7 +339,7 @@ Client validation appears on the first blur and updates as invalid input is corr
|
|
|
325
339
|
|
|
326
340
|
Upload components do not embed presigning, headers, or PUT/POST protocols. Applications call their service through `uploadHandler(file, { signal, onProgress })` and return `{ url?, response? }`. Image/avatar uploads require a displayable `url`. Without a handler, `FileUpload` only selects files, and image/avatar components generate local previews only.
|
|
327
341
|
|
|
328
|
-
|
|
342
|
+
##### Crypto display (3)
|
|
329
343
|
|
|
330
344
|
Input changes immediately clear `encryptedValue`; only successful results for current input are restored. Clearing, callback replacement, and unmounting invalidate old requests. Failures show built-in errors and leave ciphertext empty. Submit encrypted inputs only when current ciphertext is nonempty.
|
|
331
345
|
|
|
@@ -339,7 +353,7 @@ Callers must connect `EncryptedInput` to a real encryption service through `onen
|
|
|
339
353
|
|
|
340
354
|
Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and `SM2` for signatures.
|
|
341
355
|
|
|
342
|
-
|
|
356
|
+
##### AI documents and spreadsheets (4)
|
|
343
357
|
|
|
344
358
|
| Component | Description | Key props / capabilities |
|
|
345
359
|
| ------------------------ | ---------------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
@@ -370,7 +384,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
370
384
|
/>
|
|
371
385
|
```
|
|
372
386
|
|
|
373
|
-
|
|
387
|
+
##### Charts
|
|
374
388
|
|
|
375
389
|
`Chart type='line'` uses LayerChart's native line chart by default. For monitoring dashboards with segmented lines, points, nearest-point hover, and vertical reference lines, use `lineVariant='segmented-point'`:
|
|
376
390
|
|
|
@@ -389,7 +403,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
389
403
|
/>
|
|
390
404
|
```
|
|
391
405
|
|
|
392
|
-
|
|
406
|
+
##### CRUD scenes (5)
|
|
393
407
|
|
|
394
408
|
| Component | Description | Key props / capabilities |
|
|
395
409
|
| ------------------- | ----------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
@@ -402,10 +416,11 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
402
416
|
> `CrudPage` defaults to the `TableToolbar` icon/popover toolbar; use `toolbarStyle='filter-bar'` for a flat filter bar. `detailColumns={['title']}` makes specified columns open details. `toolbarLeading` injects left-side titles/descriptions; `showHeader={false}` avoids duplicate titles. `toolbarActions` adds right-side actions, `card` replaces rows with cards, `tableCell` renders interactive cells by row/column key (such as Tooltip), and `sortableColumns` controls server sorting fields. Filters support `select`, `boolean`, `number`, `date`, `date-range`, and `text`.
|
|
403
417
|
>
|
|
404
418
|
> The page fills available parent height. Tables fill remaining space even without data; only the data area scrolls, with headers fixed at its top and pagination fixed at the list card bottom.
|
|
419
|
+
> Pass remaining height through every host container, for example with `flex flex-1 min-h-0 flex-col`, from the viewport shell to the content area. Intermediate wrappers must not size only to their content. Pagination stays at the bottom for empty, short and scrolling lists.
|
|
405
420
|
>
|
|
406
421
|
> Columns first shrink to 7rem and truncate long text; horizontal scrolling appears only if total width still exceeds the container. The action column stays fixed on the right.
|
|
407
422
|
|
|
408
|
-
|
|
423
|
+
##### Error pages (1)
|
|
409
424
|
|
|
410
425
|
| Component | Description | Key props / capabilities |
|
|
411
426
|
| ----------- | --------------------------------------------------- | ----------------------------------------------------------------------- |
|
|
@@ -436,9 +451,9 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
436
451
|
>
|
|
437
452
|
> `Tabs` supports lazy content. With `lazy`, never-activated panes are not rendered (`children` receives `isActivated(key)`); `onactivate(key)` runs once on first activation. Combine with `createCrudController({ autoLoad: false })` to load only when first visible.
|
|
438
453
|
|
|
439
|
-
|
|
454
|
+
### Examples
|
|
440
455
|
|
|
441
|
-
|
|
456
|
+
#### Toast notifications
|
|
442
457
|
|
|
443
458
|
```svelte
|
|
444
459
|
<script>
|
|
@@ -458,7 +473,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
458
473
|
|
|
459
474
|
> Built-in `notifySuccess` / `notifyError` / `notifyInfo` / `notifyWarning` remove the need for application toast wrappers. `notifyError(err, fallback?)` accepts `Error` or strings with a fallback message. Success lasts 3s and errors 5s by default.
|
|
460
475
|
|
|
461
|
-
|
|
476
|
+
#### Message feedback
|
|
462
477
|
|
|
463
478
|
```svelte
|
|
464
479
|
<script>
|
|
@@ -476,7 +491,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
476
491
|
<MessageContainer />
|
|
477
492
|
```
|
|
478
493
|
|
|
479
|
-
|
|
494
|
+
#### Typical CRUD page
|
|
480
495
|
|
|
481
496
|
```svelte
|
|
482
497
|
<script>
|
|
@@ -546,7 +561,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
546
561
|
|
|
547
562
|
`Modal` retains the top-right close button without a `title` / `header`, but does not render a full header row. Use `radius="1.4rem"` for rounded corners and `bodyOverflow="visible"` when internal dropdowns/overlays need to extend outside.
|
|
548
563
|
|
|
549
|
-
|
|
564
|
+
#### Declarative CRUD page (CrudPage)
|
|
550
565
|
|
|
551
566
|
```svelte
|
|
552
567
|
<script lang='ts'>
|
|
@@ -572,7 +587,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
572
587
|
|
|
573
588
|
> Use `form={{ variant: 'drawer', drawerWidth: '40rem' }}` for drawers. User resizing overrides the initial width and is remembered per resource.
|
|
574
589
|
|
|
575
|
-
|
|
590
|
+
#### Login page
|
|
576
591
|
|
|
577
592
|
```svelte
|
|
578
593
|
<script>
|
|
@@ -598,7 +613,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
598
613
|
<LoginForm {loading} {errors} onsubmit={handleLogin} showRegisterLink />
|
|
599
614
|
```
|
|
600
615
|
|
|
601
|
-
|
|
616
|
+
#### Controlled PasswordInput
|
|
602
617
|
|
|
603
618
|
```svelte
|
|
604
619
|
<script>
|
|
@@ -615,7 +630,7 @@ Defaults match `@h-ai/crypto`: `SM4` for encrypted inputs, `SM3` for hashes, and
|
|
|
615
630
|
/>
|
|
616
631
|
```
|
|
617
632
|
|
|
618
|
-
|
|
633
|
+
### Style dependencies
|
|
619
634
|
|
|
620
635
|
Components use TailwindCSS v4 + DaisyUI. Configure application `app.css` as follows:
|
|
621
636
|
|
|
@@ -654,7 +669,7 @@ On mobile pages, match `BottomNav` width to the page shell to avoid spanning the
|
|
|
654
669
|
</div>
|
|
655
670
|
```
|
|
656
671
|
|
|
657
|
-
|
|
672
|
+
#### Icons
|
|
658
673
|
|
|
659
674
|
Components use Iconify (Tabler Icons):
|
|
660
675
|
|
|
@@ -669,7 +684,7 @@ npm install -D @iconify/tailwind4 @iconify-json/tabler
|
|
|
669
684
|
}
|
|
670
685
|
```
|
|
671
686
|
|
|
672
|
-
|
|
687
|
+
#### Theme switching
|
|
673
688
|
|
|
674
689
|
Manage 15 curated DaisyUI themes through built-in utilities:
|
|
675
690
|
|
|
@@ -713,16 +728,16 @@ const themeBootstrapScript = createThemeBootstrapScript({
|
|
|
713
728
|
transformPageChunk: ({ html }) => html.replace('%theme_bootstrap%', themeBootstrapScript)
|
|
714
729
|
```
|
|
715
730
|
|
|
716
|
-
|
|
731
|
+
### Internationalization (i18n)
|
|
717
732
|
|
|
718
733
|
@h-ai/ui uses **built-in component translations**:
|
|
719
734
|
|
|
720
|
-
- Scene components (`scenes/`) include Chinese/English translations (zh-CN / en-US) out of the box.
|
|
735
|
+
- Scene components (`scenes/`) include Chinese/English/Japanese translations (zh-CN / en-US / ja-JP) out of the box.
|
|
721
736
|
- Components respond automatically to global locale changes, synchronized through `@h-ai/core`.
|
|
722
737
|
- Applications handle **page text** only; @h-ai/ui manages internal component text.
|
|
723
738
|
- Override specific text with props such as `submitText` or `labels`.
|
|
724
739
|
|
|
725
|
-
|
|
740
|
+
#### createLocaleStore
|
|
726
741
|
|
|
727
742
|
Client locale state management, automatically synchronized with the `@h-ai/core` global locale manager:
|
|
728
743
|
|
|
@@ -746,7 +761,9 @@ Client locale state management, automatically synchronized with the `@h-ai/core`
|
|
|
746
761
|
</select>
|
|
747
762
|
```
|
|
748
763
|
|
|
749
|
-
|
|
764
|
+
`createLocaleStore` from `@h-ai/ui/i18n` selects a resolvable saved locale, then the complete navigator.languages list (followed by navigator.language), then defaultLocale and the first supported entry. An unsupported candidate never triggers an early default. Matching handles case, language shorthand and progressively less specific region/script tags, returning the configured code. Same-language variants follow supportedLocales order. detectBrowserLocale returns null without an actual match; an empty supported list ultimately keeps the caller default. SSR neither reads browser candidates nor changes global locale. Paraglide applications must still synchronize their own setLocale; custom store entries do not add built-in UI dictionaries.
|
|
765
|
+
|
|
766
|
+
#### Exported i18n utilities
|
|
750
767
|
|
|
751
768
|
```ts
|
|
752
769
|
import {
|
|
@@ -762,7 +779,9 @@ import {
|
|
|
762
779
|
} from '@h-ai/ui/i18n'
|
|
763
780
|
```
|
|
764
781
|
|
|
765
|
-
|
|
782
|
+
### Configuration driven authentication
|
|
783
|
+
|
|
784
|
+
Password login submits only `identifier` and `password`; `AuthPanel` maps the `LoginForm` field `username` to `identifier`. Server settings `session.maxAge` / `session.refreshTokenMaxAge` control session lifetimes. The login form has no per-login persistent-session option.
|
|
766
785
|
|
|
767
786
|
Agreement content can be configured as `agreements.userAgreementMarkdown` and `privacyPolicyMarkdown` using YAML `|`. The modal safely renders configured Markdown and prefers it over the URL of the same agreement. URL-only content stays in a sandboxed iframe.
|
|
768
787
|
|
|
@@ -795,9 +814,9 @@ When an authentication link points to the current complete URL, AuthPanel switch
|
|
|
795
814
|
|
|
796
815
|
[完整 IAM 配置 / IAM configuration](../iam/README.en.md)
|
|
797
816
|
|
|
798
|
-
|
|
817
|
+
### Onboarding and help center
|
|
799
818
|
|
|
800
|
-
Import `createGuide`, `GuideHost` and `HelpCenter` from `@h-ai/ui/guide`. No init/close is required. The tour engine loads when a tour starts; controls follow the current theme and include Chinese/English translations. Business text uses application i18n callbacks.
|
|
819
|
+
Import `createGuide`, `GuideHost` and `HelpCenter` from `@h-ai/ui/guide`. No init/close is required. The tour engine loads when a tour starts; controls follow the current theme and include Chinese/English/Japanese translations. Business text uses application i18n callbacks.
|
|
801
820
|
|
|
802
821
|
The same entry exports `resolveGuideText(text?)` to evaluate strings or i18n callbacks; host components resolve text automatically.
|
|
803
822
|
|
|
@@ -847,7 +866,7 @@ Use `() => m.key()` for localized content and pass the current locale. Steps ren
|
|
|
847
866
|
|
|
848
867
|
HelpCenter can also render a standalone page using articles, optional tours, locale, selectedId and onstart. The admin-console example and CLI fullstack Web/App/Desktop include first-use invitations, help and profile tours by default. See the [complete integration guide](../cli/templates/skills/hai-ui/guide.md).
|
|
849
868
|
|
|
850
|
-
|
|
869
|
+
### Other exports
|
|
851
870
|
|
|
852
871
|
```ts
|
|
853
872
|
// 类型
|
|
@@ -877,3 +896,35 @@ Agreements open in a Modal and preserve form input. Pages must allow iframe embe
|
|
|
877
896
|
{/snippet}
|
|
878
897
|
</AuthPanel>
|
|
879
898
|
```
|
|
899
|
+
|
|
900
|
+
|
|
901
|
+
Component subpaths expose only explicit barrels in package.exports, such as `@h-ai/ui/components/primitives/index`. Component internals and storage helpers stay private; host clipboard registration remains public.
|
|
902
|
+
|
|
903
|
+
### Request locale isolation
|
|
904
|
+
|
|
905
|
+
Wrap Node requests and SSR in `core.i18n.runWithLocale(locale, () => handleRequest())`. SvelteKit can use `kit.i18n.runWithLocale(locale, () => resolve(event))`; serv creates the scope automatically from request headers. Async descendants inherit it. Explicit `MessageOptions.locale` takes precedence over the request locale and the startup default. Within a scope, `setGlobalLocale` only changes that request; outside a scope it configures the startup default and must not be called by request hooks.
|
|
906
|
+
|
|
907
|
+
Browsers keep application-level `setGlobalLocale` / `createLocaleStore`. During SSR, UI store initialization and setters only update the store; messages read the request scope. `runWithLocale` requires the Node entry; browser translations use explicit locale options or application state.
|
|
908
|
+
|
|
909
|
+
## Input limits and HTTP capabilities
|
|
910
|
+
|
|
911
|
+
Object keys are limited to 1024 UTF-8 bytes and reject absolute paths, backslashes, control characters and dot segments. Each public HTTP batch delete accepts 1–1000 entries. `@h-ai/storage/schemas` exposes the shared browser-safe rules. Presign expiry is an integer from 1 to 604800 seconds (Node default 3600, HTTP default 900). Upload signing accepts only key/contentType/expiresIn; contentLength/maxSize/metadata/checksum are unsupported. Invalid input returns HTTP 400 and the typed client maps it to VALIDATION_FAILED. FileUpload limits guide file selection; applications must validate actual objects on the server. Node streaming/checksum/conditional-write options have no default HTTP endpoints. See the [capability and authorization matrix (Chinese)](../storage/README.md#存储输入约束与跨端能力).
|
|
912
|
+
|
|
913
|
+
## Development and testing
|
|
914
|
+
|
|
915
|
+
```sh
|
|
916
|
+
pnpm --filter @h-ai/ui typecheck
|
|
917
|
+
pnpm --filter @h-ai/ui lint
|
|
918
|
+
pnpm --filter @h-ai/ui build
|
|
919
|
+
pnpm --filter @h-ai/ui test
|
|
920
|
+
```
|
|
921
|
+
|
|
922
|
+
## Design and interaction acceptance
|
|
923
|
+
|
|
924
|
+
Use [hai-ui-design](../cli/templates/skills/hai-ui-design/SKILL.md) for page decisions, [hai-ui](../cli/templates/skills/hai-ui/SKILL.md) for implementation, and [hai-ui-review](../cli/templates/skills/hai-ui-review/SKILL.md) for rendered UI review. See the [shared design guidance](../../.agents/instructions/ui-design.md).
|
|
925
|
+
|
|
926
|
+
Tabs support arrow/Home/End navigation, disabled items and one Tab stop. Tables expose sort/loading state and keyboard row activation. Pagination labels follow locale and external page changes update the jump input. Toolbar panels manage focus and view buttons expose selection. Empty/Alert wrap long content. theme.css imports shared tokens; focus follows the current theme and global.css respects reduced motion. Applications still implement filtering, sorting, paging and recovery.
|
|
927
|
+
|
|
928
|
+
## License
|
|
929
|
+
|
|
930
|
+
Apache-2.0
|