@h-ai/ui 0.1.0-alpha.74 → 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.
- package/README.en.md +36 -4
- package/README.ja.md +36 -4
- package/README.md +36 -4
- package/auto-import.d.ts +2 -0
- package/auto-import.js +2 -0
- package/dist/components/compounds/Confirm.svelte +12 -2
- package/dist/components/compounds/Drawer.svelte +32 -14
- package/dist/components/compounds/FilterBar.svelte +77 -0
- package/dist/components/compounds/FilterBar.svelte.d.ts +39 -0
- package/dist/components/compounds/Modal.svelte +4 -37
- package/dist/components/compounds/PageHeader.svelte +18 -11
- package/dist/components/compounds/TableToolbar.svelte +1 -1
- package/dist/components/compounds/index.d.ts +1 -0
- package/dist/components/compounds/index.js +1 -0
- package/dist/components/primitives/Button.svelte +7 -0
- package/dist/components/primitives/Input.svelte +1 -1
- package/dist/components/primitives/Textarea.svelte +1 -1
- package/dist/components/scenes/app/FeedbackDetail.svelte +2 -2
- package/dist/components/scenes/app/FeedbackList.svelte +4 -4
- package/dist/components/scenes/app/SettingsLayout.svelte +4 -15
- package/dist/components/scenes/app/ThemeSelector.svelte +56 -16
- 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 +16 -0
- package/dist/components/scenes/app/feedback-functions.js +31 -0
- package/dist/components/scenes/app/index.d.ts +1 -0
- package/dist/components/scenes/app/index.js +1 -0
- package/dist/components/scenes/crud/CrudEditPanel.svelte +18 -9
- package/dist/components/scenes/crud/CrudFilterBar.svelte +39 -30
- package/dist/components/scenes/crud/CrudFilterBar.svelte.d.ts +4 -1
- package/dist/components/scenes/crud/CrudPage.svelte +27 -7
- package/dist/components/scenes/crud/CrudPage.svelte.d.ts +1 -1
- package/dist/components/scenes/crud/crud-types.d.ts +1 -1
- package/dist/components/scenes/guide/GuideHost.svelte +22 -102
- package/dist/components/scenes/guide/GuideHost.svelte.d.ts +5 -13
- package/dist/components/scenes/guide/GuideHostContent.svelte +143 -0
- package/dist/components/scenes/guide/GuideHostContent.svelte.d.ts +43 -0
- package/dist/components/scenes/guide/HelpCenter.svelte +22 -9
- package/dist/components/scenes/iam/LoginForm.svelte +25 -1
- package/dist/components/scenes/iam/PasswordInput.svelte +1 -1
- package/dist/components/scenes/types.d.ts +2 -0
- package/dist/guide.svelte.js +61 -26
- package/dist/internal/dialog-focus.d.ts +21 -0
- package/dist/internal/dialog-focus.js +77 -0
- package/dist/internal/form-validation.svelte.d.ts +2 -1
- package/dist/internal/form-validation.svelte.js +9 -1
- package/dist/messages/en-US.json +9 -2
- package/dist/messages/ja-JP.json +9 -2
- package/dist/messages/zh-CN.json +9 -2
- package/dist/styles/formal.css +55 -0
- package/dist/styles/high-contrast.css +64 -0
- package/dist/styles/theme.css +2 -0
- package/dist/theme-config.d.ts +2 -2
- package/dist/theme-config.js +5 -2
- package/dist/types.d.ts +4 -0
- package/dist/workspace-context.d.ts +20 -0
- package/dist/workspace-context.js +9 -0
- package/package.json +2 -2
package/dist/theme-config.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { readStoredValue, writeStoredValue } from './internal/browser-safety.js';
|
|
8
8
|
/**
|
|
9
|
-
* DaisyUI
|
|
9
|
+
* 精选 DaisyUI 主题及 UI 共享样式提供的高对比、直角商务主题。
|
|
10
10
|
*
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
@@ -23,6 +23,7 @@ export const THEMES = [
|
|
|
23
23
|
{ id: 'lofi', name: 'Lo-Fi', dark: false, primaryColor: '#0d0d0d', bgColor: '#ffffff' },
|
|
24
24
|
{ id: 'winter', name: 'Winter', dark: false, primaryColor: '#047aff', bgColor: '#ffffff' },
|
|
25
25
|
{ id: 'nord', name: 'Nord', dark: false, primaryColor: '#5e81ac', bgColor: '#eceff4' },
|
|
26
|
+
{ id: 'formal', name: 'Formal', dark: false, primaryColor: '#123d70', bgColor: '#ffffff' },
|
|
26
27
|
// 暗色主题
|
|
27
28
|
{ id: 'dark', name: 'Dark', dark: true, primaryColor: '#661ae6', bgColor: '#1d232a' },
|
|
28
29
|
{ id: 'dracula', name: 'Dracula', dark: true, primaryColor: '#ff79c6', bgColor: '#282a36' },
|
|
@@ -32,6 +33,7 @@ export const THEMES = [
|
|
|
32
33
|
{ id: 'sunset', name: 'Sunset', dark: true, primaryColor: '#ff865b', bgColor: '#1a1919' },
|
|
33
34
|
{ id: 'luxury', name: 'Luxury', dark: true, primaryColor: '#c9a53d', bgColor: '#171618' },
|
|
34
35
|
{ id: 'coffee', name: 'Coffee', dark: true, primaryColor: '#db924b', bgColor: '#20161f' },
|
|
36
|
+
{ id: 'high-contrast', name: 'High contrast', dark: true, primaryColor: '#ffe04d', bgColor: '#000000' },
|
|
35
37
|
];
|
|
36
38
|
/**
|
|
37
39
|
* 主题分组配置
|
|
@@ -278,7 +280,7 @@ export function getThemeInitScript() {
|
|
|
278
280
|
});
|
|
279
281
|
}
|
|
280
282
|
/**
|
|
281
|
-
*
|
|
283
|
+
* 应用主题,并同步原生表单控件配色;自定义主题由宿主 CSS 决定配色。
|
|
282
284
|
* @param theme - 主题 ID
|
|
283
285
|
* @param persist - 是否持久化到 localStorage
|
|
284
286
|
* @returns {void} 无返回值;更新当前文档,并按 persist 决定是否保存偏好。
|
|
@@ -294,6 +296,7 @@ export function applyTheme(theme, persist = true) {
|
|
|
294
296
|
if (typeof document === 'undefined')
|
|
295
297
|
return;
|
|
296
298
|
document.documentElement.setAttribute('data-theme', theme);
|
|
299
|
+
document.documentElement.style.setProperty('color-scheme', getThemeInfo(theme) ? resolveThemeTone(theme) : '');
|
|
297
300
|
if (persist) {
|
|
298
301
|
writeStoredValue(THEME_STORAGE_KEY, theme);
|
|
299
302
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -102,6 +102,8 @@ export interface ButtonProps extends DataAttributes {
|
|
|
102
102
|
circle?: boolean;
|
|
103
103
|
/** 按钮类型 */
|
|
104
104
|
type?: 'button' | 'submit' | 'reset';
|
|
105
|
+
/** type=submit 时显示原生表单 Enter 提示;不注册全局快捷键。 */
|
|
106
|
+
submitHint?: boolean;
|
|
105
107
|
/** 点击事件 */
|
|
106
108
|
onclick?: (e: MouseEvent) => void;
|
|
107
109
|
/** 子内容 */
|
|
@@ -713,6 +715,8 @@ export interface DrawerProps extends DataAttributes {
|
|
|
713
715
|
widthStorageKey?: string;
|
|
714
716
|
/** 是否可通过点击遮罩关闭 */
|
|
715
717
|
closeOnBackdrop?: boolean;
|
|
718
|
+
/** 是否允许 Esc 关闭;提交期间可显式关闭。 */
|
|
719
|
+
closeOnEscape?: boolean;
|
|
716
720
|
/** 是否显示关闭按钮 */
|
|
717
721
|
showClose?: boolean;
|
|
718
722
|
/** 自定义类名 */
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作区导航标题按实例共享,读取 getter 以跟随路由及语言变化。
|
|
3
|
+
* @example 模块内部上下文
|
|
4
|
+
* ```ts
|
|
5
|
+
* const context: WorkspaceContext = { title: '用户管理' }
|
|
6
|
+
* void context
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
9
|
+
export interface WorkspaceContext {
|
|
10
|
+
readonly title: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 仅供布局和标题组件协作,不属于公开 API。
|
|
14
|
+
* @example 模块内部上下文
|
|
15
|
+
* ```ts
|
|
16
|
+
* const key: symbol = workspaceContextKey
|
|
17
|
+
* void key
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
export declare const workspaceContextKey: unique symbol;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-ai/ui",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-alpha.
|
|
4
|
+
"version": "0.1.0-alpha.75",
|
|
5
5
|
"description": "Hai Framework UI component library for Svelte 5 Runes.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"svelte": "./dist/index.js",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"svelte": "^5.57.2"
|
|
120
120
|
},
|
|
121
121
|
"dependencies": {
|
|
122
|
-
"@h-ai/core": "0.1.0-alpha.
|
|
122
|
+
"@h-ai/core": "0.1.0-alpha.75",
|
|
123
123
|
"@internationalized/date": "^3.12.4",
|
|
124
124
|
"@rrweb/replay": "^2.1.7",
|
|
125
125
|
"@shikijs/langs": "^4.5.0",
|