@h-ai/ui 0.1.0-alpha.73 → 0.1.0-alpha.75

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.
Files changed (76) hide show
  1. package/README.en.md +70 -7
  2. package/README.ja.md +71 -8
  3. package/README.md +72 -9
  4. package/auto-import.d.ts +4 -0
  5. package/auto-import.js +4 -0
  6. package/dist/components/compounds/Confirm.svelte +12 -2
  7. package/dist/components/compounds/Drawer.svelte +32 -14
  8. package/dist/components/compounds/FilterBar.svelte +77 -0
  9. package/dist/components/compounds/FilterBar.svelte.d.ts +39 -0
  10. package/dist/components/compounds/Modal.svelte +4 -37
  11. package/dist/components/compounds/PageHeader.svelte +18 -11
  12. package/dist/components/compounds/TableToolbar.svelte +1 -1
  13. package/dist/components/compounds/index.d.ts +1 -0
  14. package/dist/components/compounds/index.js +1 -0
  15. package/dist/components/primitives/Button.svelte +7 -0
  16. package/dist/components/primitives/Input.svelte +1 -1
  17. package/dist/components/primitives/Textarea.svelte +1 -1
  18. package/dist/components/scenes/app/FeedbackDetail.svelte +13 -3
  19. package/dist/components/scenes/app/FeedbackDetail.svelte.d.ts +6 -0
  20. package/dist/components/scenes/app/FeedbackForm.svelte +1 -1
  21. package/dist/components/scenes/app/FeedbackList.svelte +4 -4
  22. package/dist/components/scenes/app/SettingsLayout.svelte +4 -15
  23. package/dist/components/scenes/app/ThemeSelector.svelte +56 -16
  24. package/dist/components/scenes/app/WorkspaceLayout.svelte +64 -0
  25. package/dist/components/scenes/app/WorkspaceLayout.svelte.d.ts +36 -0
  26. package/dist/components/scenes/app/feedback-functions.d.ts +16 -0
  27. package/dist/components/scenes/app/feedback-functions.js +31 -0
  28. package/dist/components/scenes/app/index.d.ts +1 -0
  29. package/dist/components/scenes/app/index.js +1 -0
  30. package/dist/components/scenes/crud/CrudEditPanel.svelte +18 -9
  31. package/dist/components/scenes/crud/CrudFilterBar.svelte +39 -30
  32. package/dist/components/scenes/crud/CrudFilterBar.svelte.d.ts +4 -1
  33. package/dist/components/scenes/crud/CrudPage.svelte +27 -7
  34. package/dist/components/scenes/crud/CrudPage.svelte.d.ts +1 -1
  35. package/dist/components/scenes/crud/crud-types.d.ts +1 -1
  36. package/dist/components/scenes/guide/GuideHost.svelte +22 -102
  37. package/dist/components/scenes/guide/GuideHost.svelte.d.ts +5 -13
  38. package/dist/components/scenes/guide/GuideHostContent.svelte +143 -0
  39. package/dist/components/scenes/guide/GuideHostContent.svelte.d.ts +43 -0
  40. package/dist/components/scenes/guide/HelpCenter.svelte +22 -9
  41. package/dist/components/scenes/iam/AuthPanel.svelte +7 -7
  42. package/dist/components/scenes/iam/AuthShell.svelte +6 -1
  43. package/dist/components/scenes/iam/AuthShell.svelte.d.ts +2 -0
  44. package/dist/components/scenes/iam/ChangePasswordForm.svelte +1 -1
  45. package/dist/components/scenes/iam/ForgotPasswordForm.svelte +1 -1
  46. package/dist/components/scenes/iam/LoginForm.svelte +29 -3
  47. package/dist/components/scenes/iam/PasswordInput.svelte +1 -1
  48. package/dist/components/scenes/iam/RegisterForm.svelte +1 -1
  49. package/dist/components/scenes/iam/SensitiveOperationsForm.svelte +70 -0
  50. package/dist/components/scenes/iam/SensitiveOperationsForm.svelte.d.ts +21 -0
  51. package/dist/components/scenes/iam/SessionRecoveryDialog.svelte +64 -0
  52. package/dist/components/scenes/iam/SessionRecoveryDialog.svelte.d.ts +22 -0
  53. package/dist/components/scenes/iam/index.d.ts +6 -0
  54. package/dist/components/scenes/iam/index.js +4 -0
  55. package/dist/components/scenes/iam/sensitive-actions.svelte.d.ts +68 -0
  56. package/dist/components/scenes/iam/sensitive-actions.svelte.js +100 -0
  57. package/dist/components/scenes/iam/session-recovery.svelte.d.ts +44 -0
  58. package/dist/components/scenes/iam/session-recovery.svelte.js +57 -0
  59. package/dist/components/scenes/types.d.ts +9 -0
  60. package/dist/guide.svelte.js +61 -26
  61. package/dist/internal/dialog-focus.d.ts +21 -0
  62. package/dist/internal/dialog-focus.js +77 -0
  63. package/dist/internal/form-validation.svelte.d.ts +2 -1
  64. package/dist/internal/form-validation.svelte.js +9 -1
  65. package/dist/messages/en-US.json +21 -4
  66. package/dist/messages/ja-JP.json +21 -4
  67. package/dist/messages/zh-CN.json +21 -4
  68. package/dist/styles/formal.css +55 -0
  69. package/dist/styles/high-contrast.css +64 -0
  70. package/dist/styles/theme.css +2 -0
  71. package/dist/theme-config.d.ts +2 -2
  72. package/dist/theme-config.js +5 -2
  73. package/dist/types.d.ts +4 -0
  74. package/dist/workspace-context.d.ts +20 -0
  75. package/dist/workspace-context.js +9 -0
  76. package/package.json +2 -2
package/README.en.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Built-in messages support `zh-CN`, `en-US` and `ja-JP`; the language selector offers all three by default.
10
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.
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 / ja-JP) and 15 curated DaisyUI themes plus high contrast and square business themes.
12
12
 
13
13
  ## Core features
14
14
 
@@ -201,7 +201,7 @@ Labels connect to nested UI controls automatically; use `<FormField for="control
201
201
 
202
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.
203
203
 
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.
204
+ Text controls validate on blur after input and update errors as input is corrected. Pristine empty fields validate on submit, so leaving default focus does not shift actions. CRUD create/edit forms also validate on blur after input or on submit, 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.
205
205
 
206
206
  `UserProfile.fieldConstraints` accepts per-field `required`, `minlength`, `maxlength`, `pattern` and `validationMessage` (`pattern` applies to single-line inputs), so application rules such as username formats share blur validation. `validationMessage` also accepts a deferred translation function.
207
207
 
@@ -293,7 +293,7 @@ Client validation appears on the first blur and updates as invalid input is corr
293
293
  | ------------ | ----------- | ----------------------------------------------- |
294
294
  | `PageHeader` | Page header | `title`, `description`; supports `actions` slot |
295
295
 
296
- #### Scenes (41)
296
+ #### Scenes (43)
297
297
 
298
298
  ##### Guide (2)
299
299
 
@@ -309,7 +309,7 @@ Client validation appears on the first blur and updates as invalid input is corr
309
309
  | `FeedbackModal` | Feedback modal | `open`, `onsubmit` |
310
310
  | `FeedbackForm` | Standalone feedback form | `attachments`, `evidenceSummary`, `onsubmit`, `onfileschange` |
311
311
  | `FeedbackList` | Server pagination, filters and processing actions | `data`, `query`, `permissions`, `onquerychange`, `onstatus` |
312
- | `FeedbackDetail` | Diagnostic evidence, history and exports | `report`, `evidence`, `attachments`, `history`, `onexport` |
312
+ | `FeedbackDetail` | Diagnostic evidence, history and exports | `report`, `evidence`, `attachments`, `history`, `webhook`, `onretry`, `onexport` |
313
313
  | `FeedbackScreenshot` | Image preview, highlighting and masking | `attachment`, `onannotate` |
314
314
  | `SettingsModal` | Settings modal | `open`, `onclose` |
315
315
  | `SettingsLayout` | Settings layout (section navigation + content) | `title`, `description`, `sections`, `active`, `onselect` |
@@ -318,6 +318,8 @@ Client validation appears on the first blur and updates as invalid input is corr
318
318
  | `ThemeSelector` | Full theme selector | No props required |
319
319
  | `ThemeToggle` | Light/dark toggle | No props required |
320
320
 
321
+ Pass the type: webhook task from report jobs into FeedbackDetail.webhook to show status, attempts and safe error codes; onretry calls the authenticated retry API. The Business evidence tab paginates kind: business, and archives download from the scene tab.
322
+
321
323
  Descriptions are optional. Call `prepare()` from `@h-ai/feedback/client` before opening the modal. Connect `onfileschange` to attachment preparation and `onannotate` to image editing that burns annotations into the pixels. Failed submissions retain input and support local export. The list shows the description or server summary and requests pages through `onquerychange`; UI permissions do not replace server authorization. See the [feedback module](../feedback/README.en.md) for integration and offline tools.
322
324
 
323
325
  ##### IAM authentication (11)
@@ -335,6 +337,8 @@ Descriptions are optional. Call `prepare()` from `@h-ai/feedback/client` before
335
337
  | `ReauthenticationDialog` | Sensitive action confirmation | `open`, `loading`, `error`, `onsubmit`, `onclose` |
336
338
  | `PermGuard` | Permission guard | `permissions`, `mode`, `fallback` |
337
339
  | `UserProfile` | User profile | `user`, `editable`, `fields`, `avatarAccept`, `avatarHint`, `onsubmit` |
340
+ | `SessionRecoveryDialog` | In-place session recovery | `recovery`, `actions` |
341
+ | `SensitiveOperationsForm` | Permission operation editor | `operations`, `onsubmit`, `ondone` |
338
342
 
339
343
  ##### Storage (4)
340
344
 
@@ -700,7 +704,11 @@ npm install -D @iconify/tailwind4 @iconify-json/tabler
700
704
 
701
705
  #### Theme switching
702
706
 
703
- Manage 15 curated DaisyUI themes through built-in utilities:
707
+ Manage 15 curated DaisyUI themes plus high contrast and square business themes through built-in utilities:
708
+
709
+ `high-contrast` ships in shared theme.css with bright text on dark surfaces, clear borders/focus, and stronger muted text/placeholders. ThemeSelector has localized labels; examples and default generated projects offer it. Explicit fullstack themes lists remain host controlled. Palette checks target 7:1 for normal text; arbitrary application content still needs accessibility review.
710
+
711
+ `formal` provides square corners for business buttons, fields, cards and dialogs, with localized labels in examples and default templates. Button submitHint displays the native Enter action only for type=submit; it adds no global shortcut. LoginForm focuses its identifier on desktop when ready and no element has focus; autoFocus=false opts out. Search Enter submits immediately while respecting IME composition. Theme choices support arrows/Home/End, Enter/Space and Escape focus restoration. Confirmation dialogs initially focus Cancel and synchronize Escape cancellation.
704
712
 
705
713
  ```ts
706
714
  import {
@@ -713,7 +721,7 @@ import {
713
721
  normalizeHexColor, // 归一化 #RGB / #RRGGBB 主题色
714
722
  normalizeThemeId, // 校验主题 ID 并自动回退
715
723
  THEME_GROUPS, // 按亮色/暗色分组
716
- THEMES, // ThemeInfo[] — 15 个精选主题元数据
724
+ THEMES, // ThemeInfo[] — 17 个主题元数据
717
725
  } from '@h-ai/ui/theme'
718
726
  ```
719
727
 
@@ -826,7 +834,34 @@ AuthPanel disables native form controls during SSR and enables input after clien
826
834
 
827
835
  When an authentication link points to the current complete URL, AuthPanel switches scenes without navigating again, so input entered after returning to login is preserved. Links with a different path, query, or hash use application routing. Modified clicks such as Ctrl/Cmd retain browser behavior.
828
836
 
829
- `ReauthenticationDialog` renders password confirmation through `open/loading/error/onsubmit/onclose`. The service calls `actions.reauthenticate(password, operation)` and passes the short-lived single-use proof only to the intended request; cancellation, closing and submission clear input, and proofs never grant permissions. `Input` supports `datetime-local`: convert its browser-local value to an explicit timestamp in the service layer.
837
+ `createSensitiveActions` can refresh database rules before an action through standard `actions.publicConfig()`. `SensitiveOperationsForm` shares line-based input, deduplication, validation and errors. Pass `operations`, async `onsubmit(operations)` returning HaiResult, and optional `ondone` for successful saves. Clearing database additions does not remove file rules.
838
+
839
+ Use `createSessionRecovery()` with `SessionRecoveryDialog` for expired sessions. Configure it with the public config and original `{ id, username }`, pass `recovery.recover` as Kit/API client's `recoverSession`, and give the dialog the same controller and standard actions. Call `cancel()` on teardown. The UI stores no passwords or business requests. `expectedUserId` restricts server session issuance to the original principal; captcha, lockout, access and password-renewal policies remain active. Cancellation preserves input and stops continuation; ambiguous network writes are never replayed. Reloaded/closed documents cannot recover lost in-memory drafts.
840
+
841
+ `createSensitiveActions(actions)` accepts Kit/API client authentication actions and shares confirmation, cancellation, retry, duplicate-submit and late-response handling. Create one per application root layout, update it with `configure(publicPolicy)`, and call `cancel()` on teardown. `authorize(operation)` returns undefined when confirmation is unnecessary, null when cancelled/busy, or the proof for that action. Do not send the business request on cancellation; pass a proof only to its intended request, never to global headers or persistent storage. Bind `ReauthenticationDialog` to the controller’s `open/loading/error/submit/cancel`; confirmation grants no permissions. `Input` supports `datetime-local`: convert its browser-local value to an explicit timestamp in the service layer.
842
+
843
+ ```svelte
844
+ <!-- actions comes from Kit/API client; policy is the public IAM reauthentication policy. -->
845
+ <script lang='ts'>
846
+ import type { SensitiveActionsOptions } from '@h-ai/ui'
847
+ import { createSensitiveActions, ReauthenticationDialog } from '@h-ai/ui'
848
+
849
+ const { actions, policy }: { actions: SensitiveActionsOptions, policy: { enabled: boolean, operations: string[] } } = $props()
850
+ const confirmation = createSensitiveActions(actions)
851
+ $effect(() => {
852
+ confirmation.configure(policy)
853
+ return () => confirmation.cancel()
854
+ })
855
+ // Await confirmation.authorize(operation) in the business action; stop on null.
856
+ </script>
857
+ <ReauthenticationDialog
858
+ open={confirmation.open}
859
+ loading={confirmation.loading}
860
+ error={confirmation.error}
861
+ onsubmit={password => confirmation.submit(password)}
862
+ onclose={() => confirmation.cancel()}
863
+ />
864
+ ```
830
865
 
831
866
  [完整 IAM 配置 / IAM configuration](../iam/README.en.md)
832
867
 
@@ -926,6 +961,34 @@ Browsers keep application-level `setGlobalLocale` / `createLocaleStore`. During
926
961
 
927
962
  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#存储输入约束与跨端能力).
928
963
 
964
+ ## Compact workspaces and collapsible filters
965
+
966
+ `WorkspaceLayout` shares a compact navigation header, a content area with 12/16px padding and an optional footer. An omitted footer reserves no space. title is the page title in navigation; leading/actions/footer are snippets. data-* attributes reach the content main. The host must pass down available height and min-height: 0.
967
+
968
+ A matching `PageHeader` omits the repeated title and retains its description and actions; `SettingsLayout` shares this behavior. Inside a workspace, `CrudPage` defaults to one navigation title and keeps actions in its toolbar. Standalone usage retains its title; showHeader explicitly overrides the default.
969
+
970
+ `FilterBar` keeps leading and actions visible, with children collapsed by default. bind:expanded controls disclosure, activeCount reports active conditions, and onreset supplies the built-in localized reset button. Collapsing preserves controls and values. The host resets state and performs queries. `CrudFilterBar` reuses it, supports custom actions and cancels pending debounce queries when destroyed.
971
+
972
+ In this example, m, statusOptions, clearFilters and loadRows belong to the host application. The reset callback must clear search and all conditions.
973
+
974
+ ```svelte
975
+ <script lang="ts">
976
+ import { Button, FilterBar, Input, Select, WorkspaceLayout } from '@h-ai/ui'
977
+ let search = $state('')
978
+ let status = $state('')
979
+ </script>
980
+
981
+ <div class="flex h-dvh min-h-0">
982
+ <WorkspaceLayout title={m.page_title()}>
983
+ <FilterBar activeCount={status ? 1 : 0} onreset={clearFilters}>
984
+ {#snippet leading()}<Input size="sm" bind:value={search} placeholder={m.search()} />{/snippet}
985
+ {#snippet actions()}<Button size="sm" onclick={loadRows}>{m.search()}</Button>{/snippet}
986
+ <div class="w-40"><Select size="sm" bind:value={status} options={statusOptions} /></div>
987
+ </FilterBar>
988
+ </WorkspaceLayout>
989
+ </div>
990
+ ```
991
+
929
992
  ## Design and interaction acceptance
930
993
 
931
994
  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).
package/README.ja.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  内蔵メッセージは `zh-CN`、`en-US`、`ja-JP` に対応し、言語セレクターは既定で3言語を表示します。
10
10
 
11
- Svelte 5 Runes のクロスプラットフォーム UI ライブラリーです。DaisyUI v5 + Tailwind CSS v4 のスタイル、Bits UI v2 のヘッドレス UI、内蔵 i18n(zh-CN / en-US)、15 種類の厳選テーマを提供します。
11
+ Svelte 5 Runes のクロスプラットフォーム UI ライブラリーです。DaisyUI v5 + Tailwind CSS v4 のスタイル、Bits UI v2 のヘッドレス UI、内蔵 i18n(zh-CN / en-US / ja-JP)、15 種類の厳選テーマ、ハイコントラストと直角のビジネステーマを提供します。
12
12
 
13
13
  ## 主な機能
14
14
 
@@ -201,7 +201,7 @@ components/
201
201
 
202
202
  `Input`、`Textarea`、`Select`、`PasswordInput` のネイティブ検証は中国語・英語・日本語に対応します。`validationMessage` は失敗時だけ適用され、有効な入力を無効にし続けません。UI の `setGlobalLocale` / `createLocaleStore` で言語を同期すると表示中のエラーも更新されます。`Textarea` は `minlength` / `maxlength`、`Select` は `name`・必須検証・FormData に対応します。
203
203
 
204
- 初回のフォーカス離脱時にエラーを表示し、修正中も更新します。未操作の項目は送信時に検証します。CRUD の新規作成・編集も同じ動作とカスタムメッセージに対応し、再表示時に検証状態をリセットします。`Select` はトリガーと選択肢の両方からフォーカスが離れた時に検証します。`PasswordInput.minLength` は長さ制約と強度計算に使い、省略時はログイン用の長さ制限を設けず、強度のみ8文字を基準にします。
204
+ テキスト入力後のフォーカス離脱時に検証し、修正中も更新します。未入力の空欄は送信時に検証し、初期フォーカスの移動で操作を押し下げません。CRUD も入力後のフォーカス離脱時または送信時に検証し、カスタムメッセージに対応して再表示時に検証状態をリセットします。`Select` はトリガーと選択肢の両方からフォーカスが離れた時に検証します。`PasswordInput.minLength` は長さ制約と強度計算に使い、省略時はログイン用の長さ制限を設けず、強度のみ8文字を基準にします。
205
205
 
206
206
  `UserProfile.fieldConstraints` は項目別に `required`、`minlength`、`maxlength`、`pattern`、`validationMessage` を受け取り、ユーザー名などの業務ルールをフォーカス離脱時に検証します。`pattern` は単一行の入力に適用し、`validationMessage` は翻訳関数にも対応します。
207
207
 
@@ -302,14 +302,14 @@ components/
302
302
  | `GuideHost` | 初回案内・ガイド・ヘルプダイアログ | `guide`, `locale`, `scope`, `autoStart` |
303
303
  | `HelpCenter` | 独立して使える検索付きヘルプ | `articles`, `tours`, `locale`, `selectedId`, `onstart` |
304
304
 
305
- ##### App:アプリ全体(11)
305
+ ##### App:アプリ全体(13)
306
306
 
307
307
  | コンポーネント | 説明 | 主なプロパティ |
308
308
  | ------------------ | ------------------------------------------- | -------------------------------------------------------- |
309
309
  | `FeedbackModal` | フィードバックモーダル | `open`, `onsubmit` |
310
310
  | `FeedbackForm` | 独立したフィードバックフォーム | `attachments`, `evidenceSummary`, `onsubmit`, `onfileschange` |
311
311
  | `FeedbackList` | サーバー側ページング・絞り込み・処理操作 | `data`, `query`, `permissions`, `onquerychange`, `onstatus` |
312
- | `FeedbackDetail` | 診断情報・処理履歴・エクスポート | `report`, `evidence`, `attachments`, `history`, `onexport` |
312
+ | `FeedbackDetail` | 診断情報・処理履歴・エクスポート | `report`, `evidence`, `attachments`, `history`, `webhook`, `onretry`, `onexport` |
313
313
  | `FeedbackScreenshot` | 画像のプレビュー・強調・マスキング | `attachment`, `onannotate` |
314
314
  | `SettingsModal` | 設定モーダル | `open`, `onclose` |
315
315
  | `SettingsLayout` | 設定レイアウト(区分ナビゲーション + 本文) | `title`, `description`, `sections`, `active`, `onselect` |
@@ -318,9 +318,11 @@ components/
318
318
  | `ThemeSelector` | テーマ選択パネル | プロパティ不要 |
319
319
  | `ThemeToggle` | ライト・ダーク切り替え | プロパティ不要 |
320
320
 
321
+ 詳細 jobs の type: webhook を FeedbackDetail.webhook に渡すと状態・試行回数・安全なエラーコードを表示し、onretry から認可付き retry API を呼びます。「業務情報」タブは kind: business をページ取得し、圧縮添付は操作現場からダウンロードします。
322
+
321
323
  説明は任意です。モーダルを開く前に `@h-ai/feedback/client` の `prepare()` で現場を固定します。`onfileschange` で添付を準備し、`onannotate` で注釈を画像のピクセルに反映します。送信失敗時は入力を保持し、ローカルに出力できます。一覧は説明またはサーバーの要約を表示し、`onquerychange` でページを取得します。UI の権限表示とは別にサーバーの認可が必要です。接続方法とオフラインツールは [feedback モジュール](../feedback/README.ja.md) を参照してください。
322
324
 
323
- ##### IAM:認証(11)
325
+ ##### IAM:認証(13)
324
326
 
325
327
  | コンポーネント | 説明 | 主なプロパティ |
326
328
  | -------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------ |
@@ -335,6 +337,8 @@ components/
335
337
  | `ReauthenticationDialog` | 機密操作の確認 | `open`, `loading`, `error`, `onsubmit`, `onclose` |
336
338
  | `PermGuard` | 権限ガード | `permissions`, `mode`, `fallback` |
337
339
  | `UserProfile` | ユーザープロフィール | `user`, `editable`, `fields`, `avatarAccept`, `avatarHint`, `onsubmit` |
340
+ | `SessionRecoveryDialog` | 画面内のセッション復帰 | `recovery`, `actions` |
341
+ | `SensitiveOperationsForm` | 権限の重要操作編集 | `operations`, `onsubmit`, `ondone` |
338
342
 
339
343
  ##### Storage:ストレージ(4)
340
344
 
@@ -700,7 +704,11 @@ npm install -D @iconify/tailwind4 @iconify-json/tabler
700
704
 
701
705
  #### テーマ切り替え
702
706
 
703
- 内蔵ツールで 15 種類の厳選 DaisyUI テーマを管理します:
707
+ 内蔵ツールで 15 種類の厳選 DaisyUI テーマ、ハイコントラストと直角のビジネステーマを管理します:
708
+
709
+ `high-contrast` は共有 theme.css に含まれます。暗い背景と明るい文字、明確な境界線・フォーカス、補助文字とプレースホルダーの強いコントラストを提供します。ThemeSelector は3言語に対応し、サンプルと既定の生成プロジェクトで選択できます。fullstack の明示的な themes はホスト設定を尊重します。通常文字の配色目標は7:1ですが、各業務コンテンツは別途アクセシビリティ確認が必要です。
710
+
711
+ `formal` はボタン・入力欄・カード・ダイアログを直角にし、サンプルと既定テンプレートで選択できます。Button の submitHint は type=submit のネイティブ Enter 操作だけを表示します。LoginForm はデスクトップで準備完了時に既存のフォーカスがなければ識別子へ移動し、autoFocus=false で無効化できます。検索の Enter は IME 確定を除いて即時実行します。テーマは方向キー/Home/End、Enter/Space、Esc とフォーカス復帰に対応し、確認画面は取消を初期選択して Esc の状態を同期します。
704
712
 
705
713
  ```ts
706
714
  import {
@@ -713,7 +721,7 @@ import {
713
721
  normalizeHexColor, // 归一化 #RGB / #RRGGBB 主题色
714
722
  normalizeThemeId, // 校验主题 ID 并自动回退
715
723
  THEME_GROUPS, // 按亮色/暗色分组
716
- THEMES, // ThemeInfo[] — 15 个精选主题元数据
724
+ THEMES, // ThemeInfo[] — 17 个主题元数据
717
725
  } from '@h-ai/ui/theme'
718
726
  ```
719
727
 
@@ -826,7 +834,34 @@ AuthPanel は SSR 中のフォーム操作を無効にし、クライアント
826
834
 
827
835
  認証リンクが現在の完全な URL を指す場合、AuthPanel は再ナビゲーションせずに画面だけを切り替え、ログインに戻った直後の入力を保持します。パス、クエリー、hash が異なる場合はアプリのルーターに任せます。Ctrl/Cmd などの修飾キーを使ったクリックはブラウザーの動作を維持します。
828
836
 
829
- `ReauthenticationDialog` は `open/loading/error/onsubmit/onclose` でパスワード確認を表示します。サービスが `actions.reauthenticate(password, operation)` を呼び、短期・一回限りの証明を対象リクエストだけに渡します。取消・終了・送信で入力を消去し、証明自体は権限を付与しません。`Input` の `datetime-local` はブラウザーのローカル時刻のため、サービスで明確なタイムスタンプへ変換して送信します。
837
+ `createSensitiveActions` は標準 actions の `publicConfig()` で操作前に DB 規則を更新できます。`SensitiveOperationsForm` は行入力・重複除去・検証・エラー表示を共通化します。`operations` と HaiResult を返す非同期 `onsubmit(operations)` を渡し、成功時のみ `ondone` を呼びます。DB の追加を空にしてもファイルの規則は解除しません。
838
+
839
+ 期限切れの画面内復帰は `createSessionRecovery()` と `SessionRecoveryDialog` を使います。公開設定と元の `{ id, username }` を configure し、`recovery.recover` を Kit/API client の `recoverSession` に渡します。ダイアログに同じ controller と標準 actions を渡し、破棄時に `cancel()` します。UI にパスワードや業務要求を保存しません。`expectedUserId` は発行前に元の本人を検証し、通常の CAPTCHA・ロック・アクセス・改密方針を適用します。取消は入力を保持し、結果不明の通信障害では書込を再送しません。再読込や終了で失われたメモリの入力は復元できません。
840
+
841
+ `createSensitiveActions(actions)` はKit/API clientの認証アクションを受け取り、ログイン済み利用者の確認・取消・再試行・重複送信・遅延応答を共通処理します。アプリのルートレイアウトごとに生成し、`configure(公開設定)` で更新、破棄時は `cancel()` を呼びます。`authorize(operation)` は確認不要ならundefined、取消/処理中ならnull、成功なら当該操作の証明を返します。取消時は業務リクエストを送らず、証明は対象リクエストにのみ渡します。共有ヘッダーや永続ストレージには保存しません。`ReauthenticationDialog` に `open/loading/error/submit/cancel` を接続します。確認は権限を増やしません。`Input` の `datetime-local` はブラウザーのローカル時刻のため、サービスで明確なタイムスタンプへ変換して送信します。
842
+
843
+ ```svelte
844
+ <!-- actionsはKit/API clientの認証アクション、policyはIAMの公開再認証設定です。 -->
845
+ <script lang='ts'>
846
+ import type { SensitiveActionsOptions } from '@h-ai/ui'
847
+ import { createSensitiveActions, ReauthenticationDialog } from '@h-ai/ui'
848
+
849
+ const { actions, policy }: { actions: SensitiveActionsOptions, policy: { enabled: boolean, operations: string[] } } = $props()
850
+ const confirmation = createSensitiveActions(actions)
851
+ $effect(() => {
852
+ confirmation.configure(policy)
853
+ return () => confirmation.cancel()
854
+ })
855
+ // 業務操作でconfirmation.authorize(operation)を待ち、nullなら中止します。
856
+ </script>
857
+ <ReauthenticationDialog
858
+ open={confirmation.open}
859
+ loading={confirmation.loading}
860
+ error={confirmation.error}
861
+ onsubmit={password => confirmation.submit(password)}
862
+ onclose={() => confirmation.cancel()}
863
+ />
864
+ ```
830
865
 
831
866
  [完整 IAM 配置 / IAM configuration](../iam/README.ja.md)
832
867
 
@@ -926,6 +961,34 @@ Node リクエストと SSR は `core.i18n.runWithLocale(locale, () => handleReq
926
961
 
927
962
  キーは UTF-8 で最大 1024 バイトで、絶対パス、バックスラッシュ、制御文字、ドットセグメントを拒否します。公開 HTTP 一括削除は一度に 1–1000 件です。共通規則はブラウザー対応の `@h-ai/storage/schemas` から参照できます。署名有効期限は整数 1–604800 秒(Node 既定 3600、HTTP 既定 900)。アップロード署名の入力は key/contentType/expiresIn のみで、contentLength/maxSize/metadata/checksum は未対応です。不正入力は HTTP 400、typed client では VALIDATION_FAILED です。FileUpload の制限は選択時の補助であり、実際のオブジェクトはサーバーで検証してください。Node のストリーム/checksum/条件付き書き込みには既定の HTTP エンドポイントがありません。[機能と認可の対応表(中国語)](../storage/README.md#存储输入约束与跨端能力)を参照してください。
928
963
 
964
+ ## コンパクトな作業領域と折りたたみ式の絞り込み
965
+
966
+ `WorkspaceLayout` はコンパクトなナビゲーション、12/16px の余白を持つ本文、任意のフッターを統一します。フッターを省略すると高さを確保しません。title はナビゲーションのページ名、leading/actions/footer は snippet です。data-* は本文の main に渡します。親レイアウトから残りの高さと min-height: 0 を引き継いでください。
967
+
968
+ 同名の `PageHeader` は重複する見出しを省略し、説明と操作を保持します。`SettingsLayout` も同じ動作です。作業領域内の `CrudPage` は既定でナビゲーションの見出しだけを表示し、操作をツールバーに残します。単独利用時は見出しを表示し、showHeader で明示的に変更できます。
969
+
970
+ `FilterBar` は leading と actions を常に表示し、children を既定で折りたたみます。bind:expanded は開閉、activeCount は適用中の件数、onreset は3言語対応のリセットボタンです。折りたたんでも入力を保持し、条件の初期化と問い合わせは業務側のコールバックが担当します。`CrudFilterBar` もこれを利用し、actions を追加でき、破棄時に未送信の遅延検索を取り消します。
971
+
972
+ 例の m、statusOptions、clearFilters、loadRows は業務アプリが提供します。リセット時は検索語と全条件を初期化してください。
973
+
974
+ ```svelte
975
+ <script lang="ts">
976
+ import { Button, FilterBar, Input, Select, WorkspaceLayout } from '@h-ai/ui'
977
+ let search = $state('')
978
+ let status = $state('')
979
+ </script>
980
+
981
+ <div class="flex h-dvh min-h-0">
982
+ <WorkspaceLayout title={m.page_title()}>
983
+ <FilterBar activeCount={status ? 1 : 0} onreset={clearFilters}>
984
+ {#snippet leading()}<Input size="sm" bind:value={search} placeholder={m.search()} />{/snippet}
985
+ {#snippet actions()}<Button size="sm" onclick={loadRows}>{m.search()}</Button>{/snippet}
986
+ <div class="w-40"><Select size="sm" bind:value={status} options={statusOptions} /></div>
987
+ </FilterBar>
988
+ </WorkspaceLayout>
989
+ </div>
990
+ ```
991
+
929
992
  ## デザインと操作の検証
930
993
 
931
994
  画面設計は [hai-ui-design](../cli/templates/skills/hai-ui-design/SKILL.md)、実装は [hai-ui](../cli/templates/skills/hai-ui/SKILL.md)、実画面の確認は [hai-ui-review](../cli/templates/skills/hai-ui-review/SKILL.md) を参照してください。[共通設計指針](../../.agents/instructions/ui-design.md) も利用できます。
package/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  内置中英日文消息(`zh-CN` / `en-US` / `ja-JP`),语言选择器默认提供三种语言。
10
10
 
11
- 基于 Svelte 5 Runes 的多端 UI 组件库,采用 DaisyUI v5 + Tailwind CSS v4 样式 + Bits UI v2 headless 交互,内置 i18n(zh-CN / en-US),内置 15 个精选 DaisyUI 主题。
11
+ 基于 Svelte 5 Runes 的多端 UI 组件库,采用 DaisyUI v5 + Tailwind CSS v4 样式 + Bits UI v2 headless 交互,内置 i18n(zh-CN / en-US / ja-JP),内置 15 个精选 DaisyUI 主题、高对比及直角商务主题。
12
12
 
13
13
  ## 核心功能清单
14
14
 
@@ -201,7 +201,7 @@ components/
201
201
 
202
202
  `Input`、`Textarea`、`Select` 和 `PasswordInput` 的原生校验使用内置中英日文提示;`validationMessage` 只覆盖失败提示,不让有效输入一直无效。应用通过 UI 的 `setGlobalLocale` / `createLocaleStore` 同步语言,已显示的校验错误即时更新。`Textarea` 支持 `minlength` / `maxlength`,`Select` 支持 `name`、必填校验和 FormData 序列化。
203
203
 
204
- 字段首次失焦后显示前端校验错误,修正输入时即时更新;未访问的字段在提交时统一校验。CRUD 新增/编辑复用该行为,支持自定义校验文案,关闭重开清空校验状态。`Select` 在焦点离开触发器和选项后校验。`PasswordInput.minLength` 同时约束长度并用于强度计算;省略时不限制登录密码长度,强度计算仍以 8 位为基准。
204
+ 文本控件输入后失焦显示前端校验错误,修正输入时即时更新;未输入的空字段留到提交时校验,避免默认焦点离开时挤动操作。CRUD 新增/编辑同样在输入后失焦或提交时校验,支持自定义校验文案,关闭重开清空校验状态。`Select` 在焦点离开触发器和选项后校验。`PasswordInput.minLength` 同时约束长度并用于强度计算;省略时不限制登录密码长度,强度计算仍以 8 位为基准。
205
205
 
206
206
  `UserProfile.fieldConstraints` 按字段接收 `required`、`minlength`、`maxlength`、`pattern` 和 `validationMessage`(`pattern` 用于单行输入),让应用的用户名等业务规则复用失焦校验;`validationMessage` 支持延迟翻译函数。
207
207
 
@@ -293,7 +293,7 @@ components/
293
293
  | ------------ | -------- | ------------------------------------------- |
294
294
  | `PageHeader` | 页面头部 | `title`, `description`,支持 `actions` 插槽 |
295
295
 
296
- #### 场景组件 Scenes(41 个)
296
+ #### 场景组件 Scenes(43 个)
297
297
 
298
298
  ##### Guide 引导与帮助(2 个)
299
299
 
@@ -302,14 +302,14 @@ components/
302
302
  | `GuideHost` | 首次邀请、页面导览与帮助弹窗宿主 | `guide`, `locale`, `scope`, `autoStart` |
303
303
  | `HelpCenter` | 可独立使用的帮助中心 | `articles`, `tours`, `locale`, `selectedId`, `onstart` |
304
304
 
305
- ##### App 应用级(11 个)
305
+ ##### App 应用级(13 个)
306
306
 
307
307
  | 组件 | 描述 | 主要属性 |
308
308
  | ---------------- | ---------------- | ------------------ |
309
309
  | `FeedbackModal` | 反馈模态框 | `open`, `onsubmit` |
310
310
  | `FeedbackForm` | 独立反馈表单 | `attachments`, `evidenceSummary`, `onsubmit`, `onfileschange` |
311
311
  | `FeedbackList` | 服务端分页、筛选与处理操作 | `data`, `query`, `permissions`, `onquerychange`, `onstatus` |
312
- | `FeedbackDetail` | 诊断材料、处理历史与导出 | `report`, `evidence`, `attachments`, `history`, `onexport` |
312
+ | `FeedbackDetail` | 诊断材料、处理历史与导出 | `report`, `evidence`, `attachments`, `history`, `webhook`, `onretry`, `onexport` |
313
313
  | `FeedbackScreenshot` | 图片预览、圈选与遮挡 | `attachment`, `onannotate` |
314
314
  | `SettingsModal` | 设置模态框 | `open`, `onclose` |
315
315
  | `SettingsLayout` | 设置页布局(分区导航 + 内容区) | `title`, `description`, `sections`, `active`, `onselect` |
@@ -318,9 +318,11 @@ components/
318
318
  | `ThemeSelector` | 完整主题选择面板 | 无需 Props |
319
319
  | `ThemeToggle` | 明/暗主题切换 | 无需 Props |
320
320
 
321
+ 将详情 jobs 中 type: webhook 的任务传给 FeedbackDetail.webhook,显示状态、尝试次数及安全错误码;onretry 负责调用受权 retry API。业务异步证据在“业务信息”页签分页查询 kind: business,压缩附件在“操作现场”下载。
322
+
321
323
  反馈说明可为空;宿主先用 `@h-ai/feedback/client` 的 `prepare()` 固定现场,再打开弹窗。表单通过 `onfileschange` 准备主动附件、通过 `onannotate` 将标注烧录到图片;受理失败保留输入并可本地导出。列表展示说明或服务端事实摘要,以 `onquerychange` 取得分页数据;界面权限不代替服务端授权。完整接入与离线工具见 [feedback 模块](../feedback/README.md)。
322
324
 
323
- ##### IAM 身份认证(11 个)
325
+ ##### IAM 身份认证(13 个)
324
326
 
325
327
  | 组件 | 描述 | 主要属性 |
326
328
  | -------------------- | ---------- | ----------------------------------------------------- |
@@ -335,6 +337,8 @@ components/
335
337
  | `ReauthenticationDialog` | 敏感操作再认证 | `open`, `loading`, `error`, `onsubmit`, `onclose` |
336
338
  | `PermGuard` | 权限守卫 | `permissions`, `mode`, `fallback` |
337
339
  | `UserProfile` | 用户资料 | `user`, `editable`, `fields`, `avatarAccept`, `avatarHint`, `onsubmit` |
340
+ | `SessionRecoveryDialog` | 原地会话恢复 | `recovery`, `actions` |
341
+ | `SensitiveOperationsForm` | 权限敏感操作编辑 | `operations`, `onsubmit`, `ondone` |
338
342
 
339
343
  ##### Storage 存储(4 个)
340
344
 
@@ -699,7 +703,11 @@ npm install -D @iconify/tailwind4 @iconify-json/tabler
699
703
 
700
704
  #### 主题切换
701
705
 
702
- 使用内置的主题工具函数管理 15 个精选 DaisyUI 主题:
706
+ 使用内置的主题工具函数管理 15 个精选 DaisyUI 主题、高对比及直角商务主题:
707
+
708
+ `high-contrast` 随共享 theme.css 提供:黑底亮字、清晰边框/焦点、增强次要文字及占位符对比度。ThemeSelector 提供三语名称;示例与默认生成工程可选择,fullstack 的显式 themes 列表仍由宿主决定。配色按普通文字 7:1 的目标验收,不代表任意业务内容已通过整站无障碍认证。
709
+
710
+ `formal` 提供直角的商务外观,按钮、输入框、卡片与弹窗不使用装饰性圆角;主题选择器提供三语名称,示例和默认模板可选择。Button 的 submitHint 仅在 type=submit 时显示原生 Enter 提示,不绑定全局快捷键;LoginForm 默认在桌面首次就绪且页面无焦点时聚焦标识,autoFocus=false 可关闭。筛选 Enter 即时查询且忽略输入法确认;主题菜单支持方向键/Home/End、Enter/Space 及 Esc 恢复焦点;确认框默认聚焦取消,Esc 同步取消状态。
703
711
 
704
712
  ```ts
705
713
  import {
@@ -712,7 +720,7 @@ import {
712
720
  normalizeHexColor, // 归一化 #RGB / #RRGGBB 主题色
713
721
  normalizeThemeId, // 校验主题 ID 并自动回退
714
722
  THEME_GROUPS, // 按亮色/暗色分组
715
- THEMES, // ThemeInfo[] — 15 个精选主题元数据
723
+ THEMES, // ThemeInfo[] — 17 个主题元数据
716
724
  } from '@h-ai/ui/theme'
717
725
  ```
718
726
 
@@ -842,7 +850,34 @@ AuthPanel 在 SSR 阶段禁用原生表单控件,客户端挂载并绑定事
842
850
 
843
851
  认证链接指向当前完整 URL 时,AuthPanel 只切换场景并阻止重复导航,返回登录后可立即输入。路径、查询串或 hash 不同时交给应用路由处理;Ctrl/Cmd 等修改键点击保留浏览器行为。
844
852
 
845
- `ReauthenticationDialog` 只展示密码确认框,通过 `open/loading/error/onsubmit/onclose` 接入服务层。服务调用 `actions.reauthenticate(password, operation)`,拿到短期单次凭据后仅传给本次敏感请求;取消、关闭和提交会清除输入,凭据不提升原有权限。`Input` 支持 `datetime-local`,其值为浏览器本地时间,服务层转换为明确时间戳后提交。
853
+ `createSensitiveActions` 可利用标准 actions 的 `publicConfig()` 在操作前更新数据库规则。`SensitiveOperationsForm` 复用逐行输入、去重、校验与错误状态;传入 `operations`、异步 `onsubmit(operations)`(返回 HaiResult),`ondone` 只在保存成功后调用。数据库规则与文件规则取并集,表单清空不能取消文件规则。
854
+
855
+ 会话过期后的重新登录使用 `createSessionRecovery()` + `SessionRecoveryDialog`。根布局通过 `configure(publicConfig, { id, username })` 绑定原用户,把 `recovery.recover` 传给 Kit/API client 的 `recoverSession`;弹窗传入同一份 controller 和标准 actions,布局卸载时 `cancel()`。UI 不保存密码或业务请求,不切换页面。登录携带 `expectedUserId`,服务端在发会话前限制原主体;验证码、锁定、登录限制和改密流程仍按正常登录执行。取消保留当前输入并结束本次续接;真实网络失败不重放写入。整页刷新/关闭后的内存输入无法恢复。
856
+
857
+ `createSensitiveActions(actions)` 复用 Kit/API client 的认证动作,统一管理已登录用户的二次确认、取消、错误重试、重复提交与迟到响应。每个应用根布局创建一份,用 `configure(公开策略)` 更新清单;布局卸载时 `cancel()`。`authorize(operation)` 返回 undefined 表示不需确认、null 表示取消/忙、字符串为本次操作凭据;取消时不要发业务请求。有凭据时只传给本次请求,不放全局 header 或持久存储。`ReauthenticationDialog` 绑定控制器的 `open/loading/error/submit/cancel`,不会增加权限。`Input` 支持 `datetime-local`,其值为浏览器本地时间,服务层转换为明确时间戳后提交。
858
+
859
+ ```svelte
860
+ <!-- actions 为 Kit/API client 的标准认证动作;policy 为 IAM 公开再认证策略。 -->
861
+ <script lang='ts'>
862
+ import type { SensitiveActionsOptions } from '@h-ai/ui'
863
+ import { createSensitiveActions, ReauthenticationDialog } from '@h-ai/ui'
864
+
865
+ const { actions, policy }: { actions: SensitiveActionsOptions, policy: { enabled: boolean, operations: string[] } } = $props()
866
+ const confirmation = createSensitiveActions(actions)
867
+ $effect(() => {
868
+ confirmation.configure(policy)
869
+ return () => confirmation.cancel()
870
+ })
871
+ // 业务动作 await confirmation.authorize(operation);null 时中止该动作。
872
+ </script>
873
+ <ReauthenticationDialog
874
+ open={confirmation.open}
875
+ loading={confirmation.loading}
876
+ error={confirmation.error}
877
+ onsubmit={password => confirmation.submit(password)}
878
+ onclose={() => confirmation.cancel()}
879
+ />
880
+ ```
846
881
 
847
882
  [完整 IAM 配置 / IAM configuration](../iam/README.md)
848
883
 
@@ -929,6 +964,34 @@ Node 请求与 SSR 使用 `core.i18n.runWithLocale(locale, () => handleRequest()
929
964
 
930
965
  存储 key 按 UTF-8 最多 1024 字节,并拒绝绝对路径、反斜线、控制字符及点路径段;公开 HTTP 批量删除每次 1–1000 项。`@h-ai/storage/schemas` 提供浏览器安全的共同规则。预签名有效期为整数 1–604800 秒(Node 默认 3600,HTTP 默认 900);HTTP 上传仅接受 key/contentType/expiresIn,不支持 contentLength/maxSize/metadata/checksum。无效输入返回 HTTP 400,typed client 映射 VALIDATION_FAILED。FileUpload 的大小/类型限制仅为前端体验,实际对象须由应用服务端复核。Node 流式读写/checksum/条件写等没有默认 HTTP 端点。完整映射与授权边界见 [存储 API 能力](../storage/README.md#存储输入约束与跨端能力)。
931
966
 
967
+ ## 紧凑工作区与可收起筛选
968
+
969
+ `WorkspaceLayout` 统一导航、内容区和可选页脚:顶栏采用紧凑高度,主内容使用 12/16px 内边距;没有页脚时不预留高度。通过 `title` 提供导航中的页面标题,`leading/actions/footer` 为 snippet,`data-*` 透传内容 main。父布局需传递剩余高度及 min-height: 0。
970
+
971
+ 同名 `PageHeader` 自动省略重复标题,保留说明和操作;`SettingsLayout` 复用该行为。工作区中的 `CrudPage` 默认不重复显示页面标题,操作并入工具栏;独立使用仍显示标题,可用 `showHeader` 显式覆盖。
972
+
973
+ `FilterBar` 的 leading 和 actions 保持可见,children 默认收起,`bind:expanded` 控制展开,`activeCount` 提示已启用条件,`onreset` 提供内置三语重置按钮。收起保留控件和值;重置和请求逻辑由宿主回调处理。`CrudFilterBar` 已复用它,支持自定义 actions,卸载时取消待发出的防抖查询。
974
+
975
+ 下例的 m、statusOptions、clearFilters 和 loadRows 由业务应用提供;清空回调须重置搜索及全部条件。
976
+
977
+ ```svelte
978
+ <script lang="ts">
979
+ import { Button, FilterBar, Input, Select, WorkspaceLayout } from '@h-ai/ui'
980
+ let search = $state('')
981
+ let status = $state('')
982
+ </script>
983
+
984
+ <div class="flex h-dvh min-h-0">
985
+ <WorkspaceLayout title={m.page_title()}>
986
+ <FilterBar activeCount={status ? 1 : 0} onreset={clearFilters}>
987
+ {#snippet leading()}<Input size="sm" bind:value={search} placeholder={m.search()} />{/snippet}
988
+ {#snippet actions()}<Button size="sm" onclick={loadRows}>{m.search()}</Button>{/snippet}
989
+ <div class="w-40"><Select size="sm" bind:value={status} options={statusOptions} /></div>
990
+ </FilterBar>
991
+ </WorkspaceLayout>
992
+ </div>
993
+ ```
994
+
932
995
  ## 设计与交互验收
933
996
 
934
997
  页面设计使用 [hai-ui-design](../cli/templates/skills/hai-ui-design/SKILL.md),组件实现使用 [hai-ui](../cli/templates/skills/hai-ui/SKILL.md),真实界面走查使用 [hai-ui-review](../cli/templates/skills/hai-ui-review/SKILL.md)。[设计约定](../../.agents/instructions/ui-design.md) 说明布局、状态和示例。
package/auto-import.d.ts CHANGED
@@ -66,6 +66,8 @@ declare global {
66
66
  const MessageBoxDialog: typeof import('@h-ai/ui')['MessageBoxDialog']
67
67
  const Modal: typeof import('@h-ai/ui')['Modal']
68
68
  const PageHeader: typeof import('@h-ai/ui')['PageHeader']
69
+ const FilterBar: typeof import('@h-ai/ui')['FilterBar']
70
+ const WorkspaceLayout: typeof import('@h-ai/ui')['WorkspaceLayout']
69
71
  const Pagination: typeof import('@h-ai/ui')['Pagination']
70
72
  const Popover: typeof import('@h-ai/ui')['Popover']
71
73
  const PullRefresh: typeof import('@h-ai/ui')['PullRefresh']
@@ -104,6 +106,8 @@ declare global {
104
106
  const ReauthenticationDialog: typeof import('@h-ai/ui')['ReauthenticationDialog']
105
107
  const RegisterForm: typeof import('@h-ai/ui')['RegisterForm']
106
108
  const ResetPasswordForm: typeof import('@h-ai/ui')['ResetPasswordForm']
109
+ const SensitiveOperationsForm: typeof import('@h-ai/ui')['SensitiveOperationsForm']
110
+ const SessionRecoveryDialog: typeof import('@h-ai/ui')['SessionRecoveryDialog']
107
111
  const UserProfile: typeof import('@h-ai/ui')['UserProfile']
108
112
 
109
113
  // scenes - storage
package/auto-import.js CHANGED
@@ -57,6 +57,8 @@ const UI_COMPONENTS = new Set([
57
57
  'MessageBoxDialog',
58
58
  'Modal',
59
59
  'PageHeader',
60
+ 'FilterBar',
61
+ 'WorkspaceLayout',
60
62
  'Pagination',
61
63
  'Popover',
62
64
  'PullRefresh',
@@ -95,6 +97,8 @@ const UI_COMPONENTS = new Set([
95
97
  'ReauthenticationDialog',
96
98
  'RegisterForm',
97
99
  'ResetPasswordForm',
100
+ 'SensitiveOperationsForm',
101
+ 'SessionRecoveryDialog',
98
102
  'UserProfile',
99
103
  // scenes - storage
100
104
  'AvatarUpload',
@@ -40,6 +40,8 @@
40
40
  }: ConfirmProps & DataAttributes = $props()
41
41
 
42
42
  const dataAttributes = $derived(getDataAttributes(restProps))
43
+ const titleId = $props.id()
44
+ const messageId = `${titleId}-message`
43
45
  /** 响应式 i18n 显示值 */
44
46
  const displayTitle = $derived(title ?? uiM('confirm_title'))
45
47
  const displayMessage = $derived(message ?? uiM('confirm_message'))
@@ -63,6 +65,8 @@
63
65
  }
64
66
 
65
67
  function handleCancel() {
68
+ if (loading)
69
+ return
66
70
  oncancel?.()
67
71
  open = false
68
72
  }
@@ -78,10 +82,16 @@
78
82
  bind:this={modalElement}
79
83
  class={cn('modal', className)}
80
84
  onclick={handleBackdropClick}
85
+ aria-labelledby={titleId}
86
+ aria-describedby={messageId}
87
+ oncancel={(event) => {
88
+ event.preventDefault()
89
+ handleCancel()
90
+ }}
81
91
  >
82
92
  <div class='modal-box'>
83
- <h3 class='font-bold text-lg'>{displayTitle}</h3>
84
- <p class='py-4'>{displayMessage}</p>
93
+ <h3 id={titleId} class='font-bold text-lg'>{displayTitle}</h3>
94
+ <p id={messageId} class='py-4'>{displayMessage}</p>
85
95
  <div class='modal-action'>
86
96
  <Button
87
97
  variant='ghost'