aot-ui 0.2.29 → 0.2.34

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 (39) hide show
  1. package/dist-lib/aot-ui.css +1 -1
  2. package/dist-lib/aot-ui.js +8117 -7519
  3. package/dist-lib/index.d.ts +1 -0
  4. package/dist-lib/modules/bubble-chart/constants.d.ts +3 -3
  5. package/dist-lib/modules/check-in-confetti/constants.d.ts +1 -1
  6. package/dist-lib/modules/color/types.d.ts +1 -1
  7. package/dist-lib/modules/comment-react/constants.d.ts +2 -2
  8. package/dist-lib/modules/config-provider/components/ConfigProvider.d.ts +1 -1
  9. package/dist-lib/modules/config-provider/index.d.ts +3 -1
  10. package/dist-lib/modules/config-provider/themeColor.d.ts +14 -1
  11. package/dist-lib/modules/config-provider/themes/applyTheme.d.ts +24 -0
  12. package/dist-lib/modules/config-provider/themes/default.d.ts +3 -0
  13. package/dist-lib/modules/config-provider/themes/index.d.ts +5 -0
  14. package/dist-lib/modules/config-provider/themes/koharu.d.ts +2 -0
  15. package/dist-lib/modules/config-provider/themes/types.d.ts +12 -0
  16. package/dist-lib/modules/config-provider/types.d.ts +22 -2
  17. package/dist-lib/modules/donut-chart/constants.d.ts +2 -2
  18. package/dist-lib/modules/feed-new-tip/constants.d.ts +5 -5
  19. package/dist-lib/modules/fluid-progress/constants.d.ts +1 -1
  20. package/dist-lib/modules/image-detail/constants.d.ts +2 -2
  21. package/dist-lib/modules/like-burst/constants.d.ts +1 -1
  22. package/dist-lib/modules/liquid-progress/constants.d.ts +1 -1
  23. package/dist-lib/modules/mention-suggest/constants.d.ts +2 -2
  24. package/dist-lib/modules/message-banner/constants.d.ts +4 -4
  25. package/dist-lib/modules/offline-banner/constants.d.ts +2 -2
  26. package/dist-lib/modules/photo-upload/constants.d.ts +2 -2
  27. package/dist-lib/modules/product-story/constants.d.ts +3 -3
  28. package/dist-lib/modules/proportion-bar/constants.d.ts +2 -2
  29. package/dist-lib/modules/radio/types.d.ts +1 -1
  30. package/dist-lib/modules/rate/types.d.ts +3 -3
  31. package/dist-lib/modules/semi-gauge/constants.d.ts +3 -3
  32. package/dist-lib/modules/theme-switcher/components/ThemeSwitcher.d.ts +7 -0
  33. package/dist-lib/modules/theme-switcher/index.d.ts +2 -0
  34. package/dist-lib/modules/theme-switcher/types.d.ts +27 -0
  35. package/dist-lib/modules/thread-expand/constants.d.ts +9 -9
  36. package/dist-lib/modules/window-shell/AppShell.d.ts +6 -3
  37. package/dist-lib/modules/window-shell/components/TitleBar.d.ts +8 -4
  38. package/dist-lib/modules/window-shell/index.d.ts +2 -0
  39. package/package.json +1 -1
@@ -157,6 +157,7 @@ export * from './modules/target-bars';
157
157
  export * from './modules/task-checklist';
158
158
  export * from './modules/text';
159
159
  export * from './modules/theme-reveal';
160
+ export * from './modules/theme-switcher';
160
161
  export * from './modules/thread-expand';
161
162
  export * from './modules/time-picker';
162
163
  export * from './modules/time-select';
@@ -9,7 +9,7 @@ export declare const BB_ITEMS: readonly [{
9
9
  readonly id: "b2";
10
10
  readonly label: "设计";
11
11
  readonly value: 54;
12
- readonly color: "#8b5cf6";
12
+ readonly color: "var(--aot-config-primary, #8b5cf6)";
13
13
  readonly x: 58;
14
14
  readonly y: 30;
15
15
  }, {
@@ -23,7 +23,7 @@ export declare const BB_ITEMS: readonly [{
23
23
  readonly id: "b4";
24
24
  readonly label: "运营";
25
25
  readonly value: 40;
26
- readonly color: "#f59e0b";
26
+ readonly color: "var(--aot-color-warning, #f59e0b)";
27
27
  readonly x: 40;
28
28
  readonly y: 70;
29
29
  }, {
@@ -37,7 +37,7 @@ export declare const BB_ITEMS: readonly [{
37
37
  readonly id: "b6";
38
38
  readonly label: "支持";
39
39
  readonly value: 25;
40
- readonly color: "#64748b";
40
+ readonly color: "var(--aot-color-info, #64748b)";
41
41
  readonly x: 82;
42
42
  readonly y: 28;
43
43
  }];
@@ -10,4 +10,4 @@ export declare const FRAME_MS: number;
10
10
  export declare const SHAPES: readonly ["strip", "circle", "square"];
11
11
  export type ConfettiShape = (typeof SHAPES)[number];
12
12
  /** Fallback theme colors if CSS vars unavailable. */
13
- export declare const CONFETTI_COLORS: readonly ["#ef4444", "#f59e0b", "#22c55e", "var(--aot-config-primary)", "#a855f7"];
13
+ export declare const CONFETTI_COLORS: readonly ["var(--aot-color-danger, #ef4444)", "var(--aot-color-warning, #f59e0b)", "var(--aot-color-success, #22c55e)", "var(--aot-config-primary)", "var(--aot-config-primary, #a855f7)"];
@@ -23,7 +23,7 @@ export type ColorProps = {
23
23
  groups?: ColorGroup[];
24
24
  /**
25
25
  * 覆盖默认主色(仅默认 groups 时生效)
26
- * @default "#2563eb"
26
+ * @default "var(--aot-config-primary, #2563eb)"
27
27
  */
28
28
  primary?: string;
29
29
  /** 覆盖 Success */
@@ -19,13 +19,13 @@ export declare const CR_SEED: readonly [{
19
19
  }, {
20
20
  readonly id: "cr-2";
21
21
  readonly name: "老周";
22
- readonly color: "#34d399";
22
+ readonly color: "var(--aot-color-success, #34d399)";
23
23
  readonly text: "长按阈值调成 400ms 挺合适,误触少了很多。";
24
24
  readonly time: "8 分钟前";
25
25
  }, {
26
26
  readonly id: "cr-3";
27
27
  readonly name: "小林";
28
- readonly color: "#fbbf24";
28
+ readonly color: "var(--aot-color-warning, #fbbf24)";
29
29
  readonly text: "旁边表情轻微放大这点很加分,像放大镜扫过去。";
30
30
  readonly time: "15 分钟前";
31
31
  }, {
@@ -9,4 +9,4 @@ export declare function useEmptyValues(): {
9
9
  };
10
10
  /** Resolve component size: explicit prop wins, else ConfigProvider.size. */
11
11
  export declare function useComponentSize(size?: ConfigContextValue["size"]): ConfigContextValue["size"];
12
- export declare function ConfigProvider({ children, size, primaryColor, borderRadius, locale, zIndex, namespace, button, link, card, dialog, message, table, experimentalFeatures, emptyValues, valueOnClear, applyToRoot, className, }: ConfigProviderProps): import('react').JSX.Element;
12
+ export declare function ConfigProvider({ children, size, theme, colorScheme, tokens, primaryColor, borderRadius, locale, zIndex, namespace, button, link, card, dialog, message, table, experimentalFeatures, emptyValues, valueOnClear, applyToRoot, className, }: ConfigProviderProps): import('react').JSX.Element;
@@ -1,5 +1,7 @@
1
1
  export { ConfigProvider, useComponentSize, useConfig, useEmptyValues, } from './components/ConfigProvider';
2
2
  export { zhCN } from './locale/zhCN';
3
3
  export { enUS } from './locale/enUS';
4
- export { THEME_PRIMARY, THEME_PRIMARY_BORDER, THEME_PRIMARY_FALLBACK, THEME_PRIMARY_HOVER, THEME_PRIMARY_SOFT, THEME_PRIMARY_SOFT_2, readThemePrimary, themedPalette, } from './themeColor';
4
+ export { THEME_PRIMARY, THEME_PRIMARY_BORDER, THEME_PRIMARY_FALLBACK, THEME_PRIMARY_HOVER, THEME_PRIMARY_SOFT, THEME_PRIMARY_SOFT_2, readCssVar, readStatusColors, readThemePrimary, themedPalette, } from './themeColor';
5
+ export { AOT_THEMES, AOT_THEME_NAMES, applyThemePreset, clearThemePreset, defaultTheme, getThemePreset, getThemeTokens, koharuTheme, resolveColorScheme, } from './themes';
6
+ export type { ApplyThemePresetOptions, AotColorScheme, AotThemeName, AotThemePreset, AotThemeTokens, } from './themes';
5
7
  export type { ConfigButton, ConfigCard, ConfigContextValue, ConfigDialog, ConfigEmptyValue, ConfigLink, ConfigLocale, ConfigMessage, ConfigProviderProps, ConfigSize, ConfigTable, } from './types';
@@ -4,7 +4,20 @@ export declare const THEME_PRIMARY_HOVER = "var(--aot-config-primary-hover)";
4
4
  export declare const THEME_PRIMARY_SOFT = "var(--aot-config-primary-soft)";
5
5
  export declare const THEME_PRIMARY_SOFT_2 = "var(--aot-config-primary-soft-2)";
6
6
  export declare const THEME_PRIMARY_BORDER = "var(--aot-config-primary-border)";
7
- export declare const THEME_PRIMARY_FALLBACK = "#2563eb";
7
+ export declare const THEME_PRIMARY_FALLBACK = "var(--aot-config-primary, #2563eb)";
8
8
  /** Resolved concrete color for Canvas / particle systems. */
9
9
  export declare function readThemePrimary(fallback?: string): string;
10
+ /** Read a computed `--aot-*` (or any) CSS variable from an element / document. */
11
+ export declare function readCssVar(name: string, fallback: string, el?: Element | null): string;
12
+ /** Semantic status colors resolved for Canvas / SVG that cannot use CSS `var()`. */
13
+ export declare function readStatusColors(el?: Element | null): {
14
+ primary: string;
15
+ success: string;
16
+ warning: string;
17
+ danger: string;
18
+ info: string;
19
+ track: string;
20
+ surface: string;
21
+ text: string;
22
+ };
10
23
  export declare function themedPalette(colors: readonly string[], primary?: string): string[];
@@ -0,0 +1,24 @@
1
+ import { AotColorScheme, AotThemeName, AotThemePreset, AotThemeTokens } from './types';
2
+ export declare const AOT_THEMES: Record<AotThemeName, AotThemePreset>;
3
+ export declare const AOT_THEME_NAMES: AotThemeName[];
4
+ /** Resolve colorScheme against OS preference. */
5
+ export declare function resolveColorScheme(colorScheme?: AotColorScheme): "light" | "dark";
6
+ export declare function getThemePreset(theme?: AotThemeName): AotThemePreset;
7
+ export declare function getThemeTokens(theme?: AotThemeName, colorScheme?: AotColorScheme): AotThemeTokens;
8
+ export type ApplyThemePresetOptions = {
9
+ theme?: AotThemeName;
10
+ colorScheme?: AotColorScheme;
11
+ /** Highest priority token overrides (must be `--aot-*` keys). */
12
+ tokens?: AotThemeTokens;
13
+ /** Explicit primary overrides preset primary when set. */
14
+ primaryColor?: string;
15
+ /** Explicit radius (px) overrides preset radius when set. */
16
+ borderRadius?: number;
17
+ };
18
+ /**
19
+ * Apply theme preset CSS variables + data attributes onto an element.
20
+ * Returns the list of inline keys written (for cleanup).
21
+ */
22
+ export declare function applyThemePreset(el: HTMLElement | null, options?: ApplyThemePresetOptions): string[];
23
+ /** Remove previously applied theme inline vars and data attributes. */
24
+ export declare function clearThemePreset(el: HTMLElement | null): void;
@@ -0,0 +1,3 @@
1
+ import { AotThemePreset } from './types';
2
+ /** Default AOT light / dark semantic tokens (matches tokens.css light defaults). */
3
+ export declare const defaultTheme: AotThemePreset;
@@ -0,0 +1,5 @@
1
+ export { AOT_THEMES, AOT_THEME_NAMES, applyThemePreset, clearThemePreset, getThemePreset, getThemeTokens, resolveColorScheme, } from './applyTheme';
2
+ export type { ApplyThemePresetOptions } from './applyTheme';
3
+ export { defaultTheme } from './default';
4
+ export { koharuTheme } from './koharu';
5
+ export type { AotColorScheme, AotThemeName, AotThemePreset, AotThemeTokens, } from './types';
@@ -0,0 +1,2 @@
1
+ import { AotThemePreset } from './types';
2
+ export declare const koharuTheme: AotThemePreset;
@@ -0,0 +1,12 @@
1
+ /** Built-in theme preset ids. */
2
+ export type AotThemeName = "default" | "koharu";
3
+ /** Light / dark / follow OS. */
4
+ export type AotColorScheme = "light" | "dark" | "system";
5
+ /** CSS custom property map applied by a theme preset. */
6
+ export type AotThemeTokens = Record<string, string>;
7
+ export type AotThemePreset = {
8
+ name: AotThemeName;
9
+ label: string;
10
+ light: AotThemeTokens;
11
+ dark: AotThemeTokens;
12
+ };
@@ -1,5 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
+ import { AotColorScheme, AotThemeName, AotThemeTokens } from './themes/types';
2
3
  export type ConfigSize = "sm" | "md" | "lg";
4
+ export type { AotColorScheme, AotThemeName, AotThemeTokens };
3
5
  export type ConfigLocale = {
4
6
  locale: string;
5
7
  Pagination?: {
@@ -73,9 +75,24 @@ export type ConfigProviderProps = {
73
75
  children?: ReactNode;
74
76
  /** 组件尺寸种子 */
75
77
  size?: ConfigSize;
76
- /** 品牌主色 */
78
+ /**
79
+ * 主题预设(整体换肤)
80
+ * @default "default"
81
+ */
82
+ theme?: AotThemeName;
83
+ /**
84
+ * 明暗方案;`system` 跟随系统
85
+ * @default "light"
86
+ */
87
+ colorScheme?: AotColorScheme;
88
+ /**
89
+ * 任意 `--aot-*` 覆盖,优先级高于预设与 primaryColor
90
+ * (便于宿主局部改色而不 fork 组件)
91
+ */
92
+ tokens?: AotThemeTokens;
93
+ /** 品牌主色(覆盖预设主色) */
77
94
  primaryColor?: string;
78
- /** 圆角种子(px) */
95
+ /** 圆角种子(px;覆盖预设圆角) */
79
96
  borderRadius?: number;
80
97
  /** i18n 文案 */
81
98
  locale?: ConfigLocale;
@@ -116,6 +133,9 @@ export type ConfigProviderProps = {
116
133
  };
117
134
  export type ConfigContextValue = {
118
135
  size: ConfigSize;
136
+ theme: AotThemeName;
137
+ colorScheme: AotColorScheme;
138
+ tokens?: AotThemeTokens;
119
139
  primaryColor: string;
120
140
  borderRadius: number;
121
141
  locale: ConfigLocale;
@@ -17,12 +17,12 @@ export declare const DC_SEGMENTS: readonly [{
17
17
  readonly id: "d";
18
18
  readonly label: "邮件";
19
19
  readonly value: 12;
20
- readonly color: "#f59e0b";
20
+ readonly color: "var(--aot-color-warning, #f59e0b)";
21
21
  }, {
22
22
  readonly id: "e";
23
23
  readonly label: "其他";
24
24
  readonly value: 6;
25
- readonly color: "#94a3b8";
25
+ readonly color: "var(--aot-color-text-muted, #94a3b8)";
26
26
  }];
27
27
  export declare const DC_SIZE = 200;
28
28
  export declare const DC_STROKE = 28;
@@ -13,13 +13,13 @@ export declare const FN_SEED: readonly [{
13
13
  }, {
14
14
  readonly id: "fn-o2";
15
15
  readonly name: "老周";
16
- readonly color: "#34d399";
16
+ readonly color: "var(--aot-color-success, #34d399)";
17
17
  readonly text: "灰度第二波已推,错误率还稳。";
18
18
  readonly time: "1 小时前";
19
19
  }, {
20
20
  readonly id: "fn-o3";
21
21
  readonly name: "小林";
22
- readonly color: "#fbbf24";
22
+ readonly color: "var(--aot-color-warning, #fbbf24)";
23
23
  readonly text: "封面改成横构图了,链接在评论。";
24
24
  readonly time: "2 小时前";
25
25
  }, {
@@ -43,13 +43,13 @@ export declare const FN_SEED: readonly [{
43
43
  }, {
44
44
  readonly id: "fn-o7";
45
45
  readonly name: "老周";
46
- readonly color: "#34d399";
46
+ readonly color: "var(--aot-color-success, #34d399)";
47
47
  readonly text: "压测报告:P99 掉到 180ms,可放行。";
48
48
  readonly time: "前天";
49
49
  }, {
50
50
  readonly id: "fn-o8";
51
51
  readonly name: "小林";
52
- readonly color: "#fbbf24";
52
+ readonly color: "var(--aot-color-warning, #fbbf24)";
53
53
  readonly text: "动效时长统一了一轮,PR 在路上。";
54
54
  readonly time: "前天";
55
55
  }];
@@ -62,7 +62,7 @@ export declare const FN_INCOMING: readonly [{
62
62
  }, {
63
63
  readonly id: "fn-n2";
64
64
  readonly name: "老周";
65
- readonly color: "#34d399";
65
+ readonly color: "var(--aot-color-success, #34d399)";
66
66
  readonly text: "发布窗口确认:今晚 21:00。";
67
67
  readonly time: "刚刚";
68
68
  }, {
@@ -1,3 +1,3 @@
1
1
  export declare const FL_DEFAULT_HEIGHT = 36;
2
- export declare const FL_DEFAULT_COLOR = "#22d3ee";
2
+ export declare const FL_DEFAULT_COLOR = "var(--aot-config-primary, #22d3ee)";
3
3
  export declare const FL_DURATION_MS = 3200;
@@ -3,7 +3,7 @@ export declare const ID_CARDS: readonly [{
3
3
  readonly id: "id-1";
4
4
  readonly title: "海边日落";
5
5
  readonly body: "金色余晖铺在海面,晚风带着一点咸味。点开后可下拉跟手收回。";
6
- readonly tone: "#f97316";
6
+ readonly tone: "var(--aot-color-warning, #f97316)";
7
7
  }, {
8
8
  readonly id: "id-2";
9
9
  readonly title: "山间晨雾";
@@ -13,5 +13,5 @@ export declare const ID_CARDS: readonly [{
13
13
  readonly id: "id-3";
14
14
  readonly title: "城市夜景";
15
15
  readonly body: "霓虹与车流拉出长曝光轨迹,沉浸阅读后再轻轻下拉离开。";
16
- readonly tone: "#8b5cf6";
16
+ readonly tone: "var(--aot-config-primary, #8b5cf6)";
17
17
  }];
@@ -1,4 +1,4 @@
1
1
  /** 8 burst dots around the heart (degrees). */
2
2
  export declare const PARTICLE_ANGLES: readonly [0, 45, 90, 135, 180, 225, 270, 315];
3
3
  /** Colorful particle palette (blue slot tracks theme primary). */
4
- export declare const PARTICLE_COLORS: readonly ["#ef4444", "#f59e0b", "#84cc16", "#22c55e", "#06b6d4", "var(--aot-config-primary)", "#a855f7", "#ec4899"];
4
+ export declare const PARTICLE_COLORS: readonly ["var(--aot-color-danger, #ef4444)", "var(--aot-color-warning, #f59e0b)", "#84cc16", "var(--aot-color-success, #22c55e)", "#06b6d4", "var(--aot-config-primary)", "var(--aot-config-primary, #a855f7)", "var(--aot-config-primary, #ec4899)"];
@@ -1,2 +1,2 @@
1
1
  export declare const LP_DEFAULT_SIZE = 148;
2
- export declare const LP_DEFAULT_COLOR = "#0ea5e9";
2
+ export declare const LP_DEFAULT_COLOR = "var(--aot-config-primary, #0ea5e9)";
@@ -11,13 +11,13 @@ export declare const MS_FRIENDS: readonly [{
11
11
  readonly id: "ms-2";
12
12
  readonly name: "老周";
13
13
  readonly handle: "zhou";
14
- readonly color: "#34d399";
14
+ readonly color: "var(--aot-color-success, #34d399)";
15
15
  readonly note: "客户端 · 刚活跃";
16
16
  }, {
17
17
  readonly id: "ms-3";
18
18
  readonly name: "小林";
19
19
  readonly handle: "lin";
20
- readonly color: "#fbbf24";
20
+ readonly color: "var(--aot-color-warning, #fbbf24)";
21
21
  readonly note: "动效 · 本周值班";
22
22
  }, {
23
23
  readonly id: "ms-4";
@@ -13,21 +13,21 @@ export declare const MB_DEMO_MESSAGES: readonly [{
13
13
  }, {
14
14
  readonly id: "m2";
15
15
  readonly name: "阿宁";
16
- readonly color: "#34d399";
16
+ readonly color: "var(--aot-color-success, #34d399)";
17
17
  readonly text: "设计稿第二版发你邮箱了";
18
18
  }, {
19
19
  readonly id: "m3";
20
20
  readonly name: "老周";
21
- readonly color: "#fbbf24";
21
+ readonly color: "var(--aot-color-warning, #fbbf24)";
22
22
  readonly text: "报表核对完了,麻烦看一眼";
23
23
  }, {
24
24
  readonly id: "m4";
25
25
  readonly name: "小满";
26
- readonly color: "#f472b6";
26
+ readonly color: "var(--aot-color-danger, #f472b6)";
27
27
  readonly text: "晚上一起评审一下交互稿?";
28
28
  }, {
29
29
  readonly id: "m5";
30
30
  readonly name: "Kiki";
31
- readonly color: "#a78bfa";
31
+ readonly color: "var(--aot-color-info, #a78bfa)";
32
32
  readonly text: "客户确认了方案,可以开工";
33
33
  }];
@@ -18,7 +18,7 @@ export declare const OB_FEED: readonly [{
18
18
  readonly title: "周报摘要";
19
19
  readonly body: "本周关闭 12 个缺陷,还剩 3 个 P1。";
20
20
  readonly kind: "cached";
21
- readonly tone: "#dcfce7";
21
+ readonly tone: "var(--aot-color-success-soft-border, #dcfce7)";
22
22
  }, {
23
23
  readonly id: "ob-4";
24
24
  readonly title: "视觉素材";
@@ -30,5 +30,5 @@ export declare const OB_FEED: readonly [{
30
30
  readonly title: "发布备忘";
31
31
  readonly body: "灰度已推 5%,观察错误率与崩溃。";
32
32
  readonly kind: "cached";
33
- readonly tone: "#fef3c7";
33
+ readonly tone: "var(--aot-color-warning-soft-border, #fef3c7)";
34
34
  }];
@@ -7,11 +7,11 @@ export declare const PU_MIN_MAX = 1;
7
7
  export declare const PU_HARD_MAX = 20;
8
8
  export declare const PU_PHOTOS: readonly [{
9
9
  readonly id: "pu-1";
10
- readonly hue: "linear-gradient(145deg, #fda4af, #fb7185)";
10
+ readonly hue: "linear-gradient(145deg, var(--aot-color-danger-soft-border, #fda4af), var(--aot-color-danger, #fb7185))";
11
11
  }, {
12
12
  readonly id: "pu-2";
13
13
  readonly hue: "linear-gradient(145deg, var(--aot-config-primary-border), var(--aot-config-primary))";
14
14
  }, {
15
15
  readonly id: "pu-3";
16
- readonly hue: "linear-gradient(145deg, #86efac, #22c55e)";
16
+ readonly hue: "linear-gradient(145deg, var(--aot-color-success-soft-border, #86efac), var(--aot-color-success, #22c55e))";
17
17
  }];
@@ -7,15 +7,15 @@ export declare const PS_SECTIONS: readonly [{
7
7
  readonly id: "ps-2";
8
8
  readonly title: "指尖有回声";
9
9
  readonly body: "每个按压缩一点、弹回来,反馈跟着手感走。";
10
- readonly hue: "linear-gradient(145deg, #a78bfa, #6d28d9)";
10
+ readonly hue: "linear-gradient(145deg, var(--aot-config-primary-border), var(--aot-config-primary-hover))";
11
11
  }, {
12
12
  readonly id: "ps-3";
13
13
  readonly title: "内容自己排队";
14
14
  readonly body: "新动态不打断阅读,提示轻轻落在肩上。";
15
- readonly hue: "linear-gradient(145deg, #34d399, #047857)";
15
+ readonly hue: "linear-gradient(145deg, var(--aot-color-success, #34d399), var(--aot-color-success-hover, #047857))";
16
16
  }, {
17
17
  readonly id: "ps-4";
18
18
  readonly title: "桌面也讲究";
19
19
  readonly body: "为 1440×900 的工作台留出呼吸感与对齐。";
20
- readonly hue: "linear-gradient(145deg, #fb7185, #be123c)";
20
+ readonly hue: "linear-gradient(145deg, var(--aot-color-danger, #fb7185), var(--aot-color-danger-hover, #be123c))";
21
21
  }];
@@ -7,7 +7,7 @@ export declare const PR_SEGMENTS: readonly [{
7
7
  readonly id: "design";
8
8
  readonly label: "设计";
9
9
  readonly value: 22;
10
- readonly color: "#8b5cf6";
10
+ readonly color: "var(--aot-config-primary, #8b5cf6)";
11
11
  }, {
12
12
  readonly id: "eng";
13
13
  readonly label: "研发";
@@ -17,5 +17,5 @@ export declare const PR_SEGMENTS: readonly [{
17
17
  readonly id: "ops";
18
18
  readonly label: "运营";
19
19
  readonly value: 16;
20
- readonly color: "#f59e0b";
20
+ readonly color: "var(--aot-color-warning, #f59e0b)";
21
21
  }];
@@ -91,7 +91,7 @@ export type RadioGroupProps = {
91
91
  fill?: string;
92
92
  /**
93
93
  * 按钮形态激活文字色
94
- * @default #ffffff
94
+ * @default var(--aot-color-surface, #ffffff)
95
95
  */
96
96
  textColor?: string;
97
97
  className?: string;
@@ -57,17 +57,17 @@ export type RateProps = {
57
57
  highThreshold?: number;
58
58
  /**
59
59
  * 选中 icon 颜色;数组 3 段或对象分段
60
- * @default ["#f7ba2a", "#f7ba2a", "#f7ba2a"]
60
+ * @default ["var(--aot-color-warning, #f7ba2a)", ...]
61
61
  */
62
62
  colors?: RateColors;
63
63
  /**
64
64
  * 未选中 icon 颜色
65
- * @default #c6d1de
65
+ * @default var(--aot-color-border-1, #c6d1de)
66
66
  */
67
67
  voidColor?: string;
68
68
  /**
69
69
  * 只读时未选中 icon 颜色
70
- * @default #eff2f7
70
+ * @default var(--aot-color-border-4, #eff2f7)
71
71
  */
72
72
  disabledVoidColor?: string;
73
73
  /**
@@ -8,16 +8,16 @@ export declare const SG_BOUNCE = 1.08;
8
8
  export declare const SG_ZONES: readonly [{
9
9
  readonly from: 0;
10
10
  readonly to: 40;
11
- readonly color: "#ef4444";
11
+ readonly color: "var(--aot-color-danger, #ef4444)";
12
12
  readonly label: "偏低";
13
13
  }, {
14
14
  readonly from: 40;
15
15
  readonly to: 70;
16
- readonly color: "#f59e0b";
16
+ readonly color: "var(--aot-color-warning, #f59e0b)";
17
17
  readonly label: "适中";
18
18
  }, {
19
19
  readonly from: 70;
20
20
  readonly to: 100;
21
- readonly color: "#22c55e";
21
+ readonly color: "var(--aot-color-success, #22c55e)";
22
22
  readonly label: "良好";
23
23
  }];
@@ -0,0 +1,7 @@
1
+ import { ThemeSwitcherProps } from '../types';
2
+ /**
3
+ * Drop-in theme + color-scheme control.
4
+ * Pair with ConfigProvider: pass `theme` / `colorScheme` from onChange,
5
+ * or lift state at the app root.
6
+ */
7
+ export declare function ThemeSwitcher({ theme: themeProp, defaultTheme, colorScheme: schemeProp, defaultColorScheme, themes, showColorScheme, size, className, onChange, label, }: ThemeSwitcherProps): import('react').JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { ThemeSwitcher } from './components/ThemeSwitcher';
2
+ export type { ThemeSwitcherProps, ThemeSwitcherValue } from './types';
@@ -0,0 +1,27 @@
1
+ import { ReactNode } from 'react';
2
+ import { AotColorScheme, AotThemeName } from '../config-provider/themes/types';
3
+ export type ThemeSwitcherValue = {
4
+ theme: AotThemeName;
5
+ colorScheme: AotColorScheme;
6
+ };
7
+ export type ThemeSwitcherProps = {
8
+ /** Controlled theme id */
9
+ theme?: AotThemeName;
10
+ /** Uncontrolled default */
11
+ defaultTheme?: AotThemeName;
12
+ /** Controlled color scheme */
13
+ colorScheme?: AotColorScheme;
14
+ /** Uncontrolled default */
15
+ defaultColorScheme?: AotColorScheme;
16
+ /** Theme options to show; defaults to all built-in presets */
17
+ themes?: AotThemeName[];
18
+ /** Show light / dark / system segmented control */
19
+ showColorScheme?: boolean;
20
+ /** Compact size for Segmented */
21
+ size?: "sm" | "md" | "lg";
22
+ className?: string;
23
+ /** Fires when either theme or scheme changes */
24
+ onChange?: (next: ThemeSwitcherValue) => void;
25
+ /** Optional label before controls */
26
+ label?: ReactNode;
27
+ };
@@ -21,7 +21,7 @@ export declare const TE_THREADS: readonly [{
21
21
  readonly replies: readonly [{
22
22
  readonly id: "te-1-r1";
23
23
  readonly name: "老周";
24
- readonly color: "#34d399";
24
+ readonly color: "var(--aot-color-success, #34d399)";
25
25
  readonly text: "同意,间隔 70ms 刚好能看清一条条垂下来。";
26
26
  readonly time: "2 分钟前";
27
27
  readonly likes: 4;
@@ -33,7 +33,7 @@ export declare const TE_THREADS: readonly [{
33
33
  }, {
34
34
  readonly id: "te-1-r2";
35
35
  readonly name: "小林";
36
- readonly color: "#fbbf24";
36
+ readonly color: "var(--aot-color-warning, #fbbf24)";
37
37
  readonly text: "收起要从下往上收,别一起消失。";
38
38
  readonly time: "2 分钟前";
39
39
  readonly likes: 2;
@@ -42,7 +42,7 @@ export declare const TE_THREADS: readonly [{
42
42
  }, {
43
43
  readonly id: "te-1-r3";
44
44
  readonly name: "小满";
45
- readonly color: "#f472b6";
45
+ readonly color: "var(--aot-color-danger, #f472b6)";
46
46
  readonly text: "下面评论让位也要平滑,不然会跳。";
47
47
  readonly time: "1 分钟前";
48
48
  readonly likes: 6;
@@ -51,7 +51,7 @@ export declare const TE_THREADS: readonly [{
51
51
  }, {
52
52
  readonly id: "te-1-r4";
53
53
  readonly name: "Kiki";
54
- readonly color: "#a78bfa";
54
+ readonly color: "var(--aot-color-info, #a78bfa)";
55
55
  readonly text: "箭头转 180° 这点小反馈别漏。";
56
56
  readonly time: "1 分钟前";
57
57
  readonly likes: 1;
@@ -60,7 +60,7 @@ export declare const TE_THREADS: readonly [{
60
60
  }, {
61
61
  readonly id: "te-1-r5";
62
62
  readonly name: "阿北";
63
- readonly color: "#fb7185";
63
+ readonly color: "var(--aot-color-danger-hover, #fb7185)";
64
64
  readonly text: "竖线颜色淡一点,别抢正文。";
65
65
  readonly time: "刚刚";
66
66
  readonly likes: 3;
@@ -70,7 +70,7 @@ export declare const TE_THREADS: readonly [{
70
70
  }, {
71
71
  readonly id: "te-2";
72
72
  readonly name: "米粒";
73
- readonly color: "#2dd4bf";
73
+ readonly color: "var(--aot-color-success, #2dd4bf)";
74
74
  readonly text: "这条没有回复,点「回复」可以直接盖楼。";
75
75
  readonly time: "12 分钟前";
76
76
  readonly likes: 5;
@@ -89,7 +89,7 @@ export declare const TE_THREADS: readonly [{
89
89
  readonly replies: readonly [{
90
90
  readonly id: "te-self-r1";
91
91
  readonly name: "老周";
92
- readonly color: "#34d399";
92
+ readonly color: "var(--aot-color-success, #34d399)";
93
93
  readonly text: "别人的回复你可以举报,删不掉。";
94
94
  readonly time: "7 分钟前";
95
95
  readonly likes: 0;
@@ -117,7 +117,7 @@ export declare const TE_THREADS: readonly [{
117
117
  readonly replies: readonly [{
118
118
  readonly id: "te-3-r1";
119
119
  readonly name: "老周";
120
- readonly color: "#34d399";
120
+ readonly color: "var(--aot-color-success, #34d399)";
121
121
  readonly text: "短串也能看出垂落感。";
122
122
  readonly time: "18 分钟前";
123
123
  readonly likes: 2;
@@ -126,7 +126,7 @@ export declare const TE_THREADS: readonly [{
126
126
  }, {
127
127
  readonly id: "te-3-r2";
128
128
  readonly name: "小林";
129
- readonly color: "#fbbf24";
129
+ readonly color: "var(--aot-color-warning, #fbbf24)";
130
130
  readonly text: "两条就够试收起倒序了。";
131
131
  readonly time: "16 分钟前";
132
132
  readonly likes: 0;
@@ -1,5 +1,5 @@
1
1
  import { MouseEventHandler, ReactNode } from 'react';
2
- type AppShellProps = {
2
+ export type AppShellProps = {
3
3
  title?: string;
4
4
  /**
5
5
  * Brand logo for the titlebar (local asset URL / data URL).
@@ -8,7 +8,10 @@ type AppShellProps = {
8
8
  logoSrc?: string;
9
9
  /** Fired when the titlebar logo is clicked (e.g. secret gestures). */
10
10
  onLogoClick?: MouseEventHandler<HTMLButtonElement>;
11
+ /**
12
+ * Titlebar trailing actions (before min/max/close), e.g. CommandPalette + ThemeSwitcher.
13
+ */
14
+ actions?: ReactNode;
11
15
  children: ReactNode;
12
16
  };
13
- export declare function AppShell({ title, logoSrc, onLogoClick, children, }: AppShellProps): import('react').JSX.Element;
14
- export {};
17
+ export declare function AppShell({ title, logoSrc, onLogoClick, actions, children, }: AppShellProps): import('react').JSX.Element;
@@ -1,10 +1,14 @@
1
- import { MouseEventHandler } from 'react';
2
- type TitleBarProps = {
1
+ import { MouseEventHandler, ReactNode } from 'react';
2
+ export type TitleBarProps = {
3
3
  title?: string;
4
4
  isMaximized: boolean;
5
5
  /** Host brand logo URL (local asset / data URL). Falls back to built-in mark. */
6
6
  logoSrc?: string;
7
7
  onLogoClick?: MouseEventHandler<HTMLButtonElement>;
8
+ /**
9
+ * Extra chrome before window controls (command palette, theme switcher, …).
10
+ * Marked no-drag so clicks work on frameless windows.
11
+ */
12
+ actions?: ReactNode;
8
13
  };
9
- export declare function TitleBar({ title, isMaximized, logoSrc, onLogoClick, }: TitleBarProps): import('react').JSX.Element;
10
- export {};
14
+ export declare function TitleBar({ title, isMaximized, logoSrc, onLogoClick, actions, }: TitleBarProps): import('react').JSX.Element;
@@ -1,4 +1,6 @@
1
1
  export { AppShell } from './AppShell';
2
+ export type { AppShellProps } from './AppShell';
2
3
  export { TitleBar } from './components/TitleBar';
4
+ export type { TitleBarProps } from './components/TitleBar';
3
5
  export { ResizeHandles } from './components/ResizeHandles';
4
6
  export { useWindowMaximized } from './hooks/useWindowMaximized';