@varo-ui/theme 2.1.0 → 3.0.0

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.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @varo-ui/theme
2
2
 
3
- Token-driven themes and providers for Varo H5 and mini-program components.
3
+ Theme tokens and providers for Varo H5 and mini-program components.
4
4
 
5
5
  ## Install
6
6
 
@@ -8,9 +8,20 @@ Token-driven themes and providers for Varo H5 and mini-program components.
8
8
  pnpm add @varo-ui/theme
9
9
  ```
10
10
 
11
+ ## Entrypoints and style ownership
12
+
13
+ - `@varo-ui/theme` provides H5 Vue providers plus theme/token helpers.
14
+ - `@varo-ui/theme/weapp` provides native-safe pure theme/CSS helpers without the H5 provider or DOM binding.
15
+ - `@varo-ui/theme/weapp-vite` is a build-time plugin, not a native component runtime.
16
+ - Source subpaths `/source`, `/source/theme`, `/source/weapp`, and `/source/weapp-vite` remain declared exports. Native product code must use the native-safe branch, not the H5 root/provider.
17
+
18
+ The theme engine resolves CSS variables. Component styles are installed separately: Registry `themes/base` contains tokens and foundation rules, component manifests declare CSS from `registry/themes/components/**`, and optional Agent tokens and native helpers come from `themes/agent`, which depends on the base.
19
+
20
+ To change repository styles, edit `registry/themes/base/seed.json`, `foundation.css`, component CSS, or Agent token/helper sources, then run `pnpm sync:registry`. This generates base and Agent CSS for each target, package stylesheets, renderer imports, and installed copies. Use `pnpm check:generated` to check for drift; fix component styles in their source files before regenerating.
21
+
11
22
  ## H5 application theme
12
23
 
13
- Use `VaroConfigProvider` when one theme owns the application-level CSS variables:
24
+ Use `VaroConfigProvider` to apply one theme's CSS variables across the application:
14
25
 
15
26
  ```ts
16
27
  import { createTheme, VaroConfigProvider } from '@varo-ui/theme'
@@ -62,7 +73,7 @@ const sectionTheme = createTheme({
62
73
 
63
74
  ## Injection-only theme context
64
75
 
65
- `provideVaroTheme({ theme, overrides })` only provides the resolved theme for descendants that call `useVaroTheme()`. It does not bind CSS variables or render a themed wrapper, so it is not a replacement for `VaroConfigProvider` or `VaroThemeProvider` when components need visual theme variables.
76
+ `provideVaroTheme({ theme, overrides })` makes the resolved theme available to descendants through `useVaroTheme()`. It neither binds CSS variables nor renders a wrapper. Use `VaroConfigProvider` or `VaroThemeProvider` when components also need those variables applied to the page.
66
77
 
67
78
  ## Weapp build-time theme
68
79
 
@@ -82,7 +93,11 @@ export default defineConfig({
82
93
  })
83
94
  ```
84
95
 
85
- The plugin appends `page { --varo-ui-* }` declarations to the app stylesheet.
96
+ The plugin transforms source CSS before preprocessing and appends `page { --varo-ui-* }` declarations after native CSS emission, so styles loaded through native sidecars retain the configured theme overrides.
97
+
98
+ The plugin generates theme variables; you still need the component styles. Repository builds use `weapp-vite`/`wevu` 7.5.0. For Registry installations, configure `weapp.styles` to load every installed `src/styles/*.css` file in `app.vue`, starting with `varo.css` and ending with your application overrides. For native npm components, put `@import "@varo-ui/weapp/style.css";` in local `src/package.css` and register `{ source: 'package.css', include: 'app.vue' }` globally. `weapp.styles.source` does not accept an absolute package path.
99
+
100
+ Keep page and global CSS out of component-local WXSS in `apply-shared` SFCs. H5 source imports dependency CSS automatically; native applications load it globally. See the [native stylesheet configuration](../ui-weapp/README.md#global-npm-stylesheet) and `apps/platform-smoke/vite.config.mjs`.
86
101
 
87
102
  ## Weapp runtime theme switching
88
103
 
@@ -119,4 +134,6 @@ const activeTheme = shallowRef(createTheme({
119
134
 
120
135
  Pass `mode: 'dark'` to generate the dark text, border, fill, background, shadow, and semantic soft-color scales.
121
136
 
122
- [Theme documentation](https://daguanren21.github.io/Varo/guide/theme) · [Repository](https://github.com/daguanren21/Varo)
137
+ Check platform support for the components using the theme. `h5` and `weapp` are stable installation profiles. `alipay`, `tt`, `xhs`, and the three Donut profiles are experimental: each component and all its dependencies must declare support in their manifests. A theme helper or provider example alone does not establish that support. SDK packaging, signing, and device theme behavior need verification beyond compiler and artifact checks.
138
+
139
+ [Theme documentation](https://varo.weapp.dev/guide/theme) · [Repository](https://github.com/daguanren21/Varo)
@@ -159,6 +159,8 @@ interface ThemeCssVariables {
159
159
  '--varo-ui-shadow-sm': string;
160
160
  '--varo-ui-shadow-md': string;
161
161
  '--varo-ui-motion-feedback': string;
162
+ '--varo-ui-motion-press': string;
163
+ '--varo-ui-motion-indicator': string;
162
164
  '--varo-ui-motion-state': string;
163
165
  '--varo-ui-motion-enter': string;
164
166
  '--varo-ui-motion-exit': string;
@@ -173,4 +175,4 @@ declare function createThemeCssVariables(theme: ThemeDefinition, overrides?: The
173
175
  declare function renderThemeCssVariables(selector: string, variables: ThemeCssVariables): string;
174
176
  //#endregion
175
177
  export { renderThemeCssVariables as a, ThemeDefinition as c, ThemeSeed as d, createThemeCssVariables as i, ThemeOverrides as l, ThemeCssVariables as n, ComponentTokens as o, contrastSafeForeground as r, SemanticTokens as s, ThemeCssVariableOverrides as t, ThemePalette as u };
176
- //# sourceMappingURL=css-CbtCWXft.d.mts.map
178
+ //# sourceMappingURL=css-CAChx3dE.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"css-CAChx3dE.d.mts","names":[],"sources":["../src/types.ts","../src/css.ts"],"mappings":";UAAiB;EACf;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf,SAAS;EACT,SAAS;EACT,SAAS;EACT,SAAS;EACT,OAAO;EACP,MAAM;;UAGS;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;;UAGe;EACf;IACE;IACA;IACA;IACA;;EAEF;IACE;IACA;;EAEF;IACE;IACA;IACA;IACA;;;UAIa;EACf,MAAM;EACN,SAAS;EACT,UAAU;EACV,YAAY;;UAGG;EACf,WAAW,QAAQ;EACnB,aAAa;IACX,QAAQ,QAAQ;IAChB,QAAQ,QAAQ;IAChB,OAAO,QAAQ;;;;;UCtFF;EACf;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;GACC;;KAGS,4BAA4B,QAAQ;iBA8DhC,uBAAuB;iBASvB,wBACd,OAAO,iBACP,YAAW,4BACV;iBA+Fa,wBAAwB,kBAAkB,WAAW"}
package/dist/index.d.mts CHANGED
@@ -1,18 +1,17 @@
1
- import { a as renderThemeCssVariables, c as ThemeDefinition, d as ThemeSeed, i as createThemeCssVariables, l as ThemeOverrides, n as ThemeCssVariables, o as ComponentTokens, r as contrastSafeForeground, s as SemanticTokens, t as ThemeCssVariableOverrides, u as ThemePalette } from "./css-CbtCWXft.mjs";
2
- import { a as mergeThemeOverrides, i as createTheme, n as createPalette, r as createSemanticTokens, t as createComponentTokens } from "./theme-DHkZjLNs.mjs";
1
+ import { a as renderThemeCssVariables, c as ThemeDefinition, d as ThemeSeed, i as createThemeCssVariables, l as ThemeOverrides, n as ThemeCssVariables, o as ComponentTokens, r as contrastSafeForeground, s as SemanticTokens, t as ThemeCssVariableOverrides, u as ThemePalette } from "./css-CAChx3dE.mjs";
2
+ import { a as mergeThemeOverrides, i as createTheme, n as createPalette, r as createSemanticTokens, t as createComponentTokens } from "./theme-DQCQ0lNT.mjs";
3
3
  import { App, ComputedRef, MaybeRefOrGetter, PropType } from "vue";
4
-
5
4
  //#region src/types-runtime.d.ts
6
- interface ThemeConfig {
5
+ export interface ThemeConfig {
7
6
  theme: MaybeRefOrGetter<ThemeDefinition>;
8
7
  overrides?: MaybeRefOrGetter<ThemeOverrides | undefined>;
9
8
  target?: HTMLElement;
10
9
  }
11
10
  //#endregion
12
11
  //#region src/provider.d.ts
13
- declare function provideVaroTheme(config: ThemeConfig): void;
14
- declare function useVaroTheme(): ComputedRef<ThemeDefinition>;
15
- declare const VaroThemeProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
12
+ export declare function provideVaroTheme(config: ThemeConfig): void;
13
+ export declare function useVaroTheme(): ComputedRef<ThemeDefinition>;
14
+ export declare const VaroThemeProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
16
15
  theme: {
17
16
  type: PropType<ThemeDefinition>;
18
17
  required: true;
@@ -35,9 +34,9 @@ declare const VaroThemeProvider: import("vue").DefineComponent<import("vue").Ext
35
34
  }>> & Readonly<{}>, {
36
35
  overrides: ThemeOverrides;
37
36
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
38
- declare const VaroConfigProvider: {
37
+ export declare const VaroConfigProvider: {
39
38
  install(app: App, config?: ThemeConfig): void;
40
39
  };
41
40
  //#endregion
42
- export { ComponentTokens, SemanticTokens, ThemeConfig, ThemeCssVariableOverrides, ThemeCssVariables, ThemeDefinition, ThemeOverrides, ThemePalette, ThemeSeed, VaroConfigProvider, VaroThemeProvider, contrastSafeForeground, createComponentTokens, createPalette, createSemanticTokens, createTheme, createThemeCssVariables, mergeThemeOverrides, provideVaroTheme, renderThemeCssVariables, useVaroTheme };
41
+ export { ComponentTokens, SemanticTokens, ThemeCssVariableOverrides, ThemeCssVariables, ThemeDefinition, ThemeOverrides, ThemePalette, ThemeSeed, contrastSafeForeground, createComponentTokens, createPalette, createSemanticTokens, createTheme, createThemeCssVariables, mergeThemeOverrides, renderThemeCssVariables };
43
42
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types-runtime.ts","../src/provider.ts"],"mappings":";;;;;UAGiB,WAAA;EACf,KAAA,EAAO,gBAAA,CAAiB,eAAA;EACxB,SAAA,GAAY,gBAAA,CAAiB,cAAA;EAC7B,MAAA,GAAS,WAAA;AAAA;;;iBC0GK,gBAAA,CAAiB,MAAmB,EAAX,WAAW;AAAA,iBAIpC,YAAA,IAAgB,WAAW,CAAC,eAAA;AAAA,cAI/B,iBAAA,gBAAiB,eAAA,eAAA,gBAAA;;UAKR,QAAA,CAAS,eAAA;;;;UAIT,QAAA,CAAS,cAAA;;;;;;;UAJT,QAAA,CAAS,eAAA;;;;UAIT,QAAA,CAAS,cAAA;;;;;;cAuBlB,kBAAA;eACE,GAAA,EAAG,MAAA,GAAW,WAAW;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/types-runtime.ts","../src/provider.ts"],"mappings":";;;;iBAGiB;EACf,OAAO,iBAAiB;EACxB,YAAY,iBAAiB;EAC7B,SAAS;;;;wBC0GK,iBAAiB,QAAQ;wBAIzB,gBAAgB,YAAY;qBAI/B,iCAAiB,8BAAA;;IAKR,MAAA,SAAS;;;;IAIT,MAAA,SAAS;;;;;;;IAJT,MAAA,SAAS;;;;IAIT,MAAA,SAAS;;;;;qCAqB7B;qBAEW;EACE,QAAA,KAAA,KAAG,SAAW"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as mergeThemeOverrides, c as renderThemeCssVariables, i as createTheme, n as createPalette, o as contrastSafeForeground, r as createSemanticTokens, s as createThemeCssVariables, t as createComponentTokens } from "./theme-DFqneHw9.mjs";
1
+ import { a as mergeThemeOverrides, c as renderThemeCssVariables, i as createTheme, n as createPalette, o as contrastSafeForeground, r as createSemanticTokens, s as createThemeCssVariables, t as createComponentTokens } from "./theme-CMZi-Bw1.mjs";
2
2
  import { computed, defineComponent, h, inject, provide, toValue, watchEffect } from "vue";
3
3
  //#region src/provider.ts
4
4
  const ThemeKey = Symbol("varo-theme");
@@ -27,25 +27,20 @@ function relativeLuminance(color) {
27
27
  };
28
28
  return channelLuminance(0) * .2126 + channelLuminance(2) * .7152 + channelLuminance(4) * .0722;
29
29
  }
30
- function isChromatic(color) {
31
- const value = color.slice(1);
32
- const normalized = value.length === 3 ? value.split("").map((part) => `${part}${part}`).join("") : value;
33
- if (!color.startsWith("#") || !/^[\da-f]{6}$/i.test(normalized)) return false;
34
- const red = Number.parseInt(normalized.slice(0, 2), 16);
35
- const green = Number.parseInt(normalized.slice(2, 4), 16);
36
- const blue = Number.parseInt(normalized.slice(4, 6), 16);
37
- return Math.max(red, green, blue) - Math.min(red, green, blue) >= 40;
30
+ function foregroundFromLuminance(backgroundLuminance) {
31
+ return (backgroundLuminance + .05) / .05 >= 1.05 / (backgroundLuminance + .05) ? "#000000" : "#ffffff";
38
32
  }
39
33
  function contrastSafeForeground(background) {
40
34
  const backgroundLuminance = relativeLuminance(background);
41
35
  if (backgroundLuminance == null) throw new Error(`Contrast-safe foreground requires a hex color (#RGB or #RRGGBB): ${background}`);
42
- const blackContrast = (backgroundLuminance + .05) / .05;
43
- const whiteContrast = 1.05 / (backgroundLuminance + .05);
44
- if (backgroundLuminance >= .55) return "#000000";
45
- if (isChromatic(background)) return "#ffffff";
46
- return blackContrast >= whiteContrast ? "#000000" : "#ffffff";
36
+ return foregroundFromLuminance(backgroundLuminance);
47
37
  }
48
38
  function createThemeCssVariables(theme, overrides = {}) {
39
+ function foregroundFor(fill, fallback) {
40
+ const override = overrides[fill];
41
+ const luminance = override == null ? void 0 : relativeLuminance(override);
42
+ return luminance == null ? contrastSafeForeground(fallback) : foregroundFromLuminance(luminance);
43
+ }
49
44
  return {
50
45
  "--varo-ui-white": theme.palette.neutral.white,
51
46
  "--varo-ui-black": theme.palette.neutral.black,
@@ -74,36 +69,36 @@ function createThemeCssVariables(theme, overrides = {}) {
74
69
  "--varo-ui-primary-dark": theme.semantic.primaryDark,
75
70
  "--varo-ui-primary-hover": theme.semantic.primaryHover,
76
71
  "--varo-ui-primary-soft": theme.semantic.primarySoft,
77
- "--varo-ui-primary-foreground": contrastSafeForeground(theme.semantic.primaryBase),
78
- "--varo-ui-primary-hover-foreground": contrastSafeForeground(theme.semantic.primaryHover),
72
+ "--varo-ui-primary-foreground": foregroundFor("--varo-ui-primary", theme.semantic.primaryBase),
73
+ "--varo-ui-primary-hover-foreground": foregroundFor("--varo-ui-primary-hover", theme.semantic.primaryHover),
79
74
  "--varo-ui-primary-text": semanticTextColor(theme.semantic.primaryBase, theme.semantic.textBase),
80
75
  "--varo-ui-success": theme.semantic.successBase,
81
76
  "--varo-ui-success-dark": theme.semantic.successDark,
82
77
  "--varo-ui-success-hover": theme.semantic.successHover,
83
78
  "--varo-ui-success-soft": theme.semantic.successSoft,
84
- "--varo-ui-success-foreground": contrastSafeForeground(theme.semantic.successBase),
85
- "--varo-ui-success-hover-foreground": contrastSafeForeground(theme.semantic.successHover),
79
+ "--varo-ui-success-foreground": foregroundFor("--varo-ui-success", theme.semantic.successBase),
80
+ "--varo-ui-success-hover-foreground": foregroundFor("--varo-ui-success-hover", theme.semantic.successHover),
86
81
  "--varo-ui-success-text": semanticTextColor(theme.semantic.successBase, theme.semantic.textBase),
87
82
  "--varo-ui-warning": theme.semantic.warningBase,
88
83
  "--varo-ui-warning-dark": theme.semantic.warningDark,
89
84
  "--varo-ui-warning-hover": theme.semantic.warningHover,
90
85
  "--varo-ui-warning-soft": theme.semantic.warningSoft,
91
- "--varo-ui-warning-foreground": contrastSafeForeground(theme.semantic.warningBase),
92
- "--varo-ui-warning-hover-foreground": contrastSafeForeground(theme.semantic.warningHover),
86
+ "--varo-ui-warning-foreground": foregroundFor("--varo-ui-warning", theme.semantic.warningBase),
87
+ "--varo-ui-warning-hover-foreground": foregroundFor("--varo-ui-warning-hover", theme.semantic.warningHover),
93
88
  "--varo-ui-warning-text": semanticTextColor(theme.semantic.warningBase, theme.semantic.textBase),
94
89
  "--varo-ui-danger": theme.semantic.dangerBase,
95
90
  "--varo-ui-danger-dark": theme.semantic.dangerDark,
96
91
  "--varo-ui-danger-hover": theme.semantic.dangerHover,
97
92
  "--varo-ui-danger-soft": theme.semantic.dangerSoft,
98
- "--varo-ui-danger-foreground": contrastSafeForeground(theme.semantic.dangerBase),
99
- "--varo-ui-danger-hover-foreground": contrastSafeForeground(theme.semantic.dangerHover),
93
+ "--varo-ui-danger-foreground": foregroundFor("--varo-ui-danger", theme.semantic.dangerBase),
94
+ "--varo-ui-danger-hover-foreground": foregroundFor("--varo-ui-danger-hover", theme.semantic.dangerHover),
100
95
  "--varo-ui-danger-text": semanticTextColor(theme.semantic.dangerBase, theme.semantic.textBase),
101
96
  "--varo-ui-info": theme.semantic.infoBase,
102
97
  "--varo-ui-info-dark": theme.semantic.infoDark,
103
98
  "--varo-ui-info-hover": theme.semantic.infoHover,
104
99
  "--varo-ui-info-soft": theme.semantic.infoSoft,
105
- "--varo-ui-info-foreground": contrastSafeForeground(theme.semantic.infoBase),
106
- "--varo-ui-info-hover-foreground": contrastSafeForeground(theme.semantic.infoHover),
100
+ "--varo-ui-info-foreground": foregroundFor("--varo-ui-info", theme.semantic.infoBase),
101
+ "--varo-ui-info-hover-foreground": foregroundFor("--varo-ui-info-hover", theme.semantic.infoHover),
107
102
  "--varo-ui-info-text": semanticTextColor(theme.semantic.infoBase, theme.semantic.textBase),
108
103
  "--varo-ui-button-radius": theme.components.button.borderRadius,
109
104
  "--varo-ui-button-height-sm": theme.components.button.heightSm,
@@ -118,12 +113,14 @@ function createThemeCssVariables(theme, overrides = {}) {
118
113
  "--varo-ui-shadow-sm": theme.seed.mode === "dark" ? "0 1px 2px rgb(0 0 0 / 46%)" : "0 1px 2px rgb(48 49 51 / 6%)",
119
114
  "--varo-ui-shadow-md": theme.seed.mode === "dark" ? "0 12px 32px 4px rgb(0 0 0 / 36%), 0 8px 20px rgb(0 0 0 / 72%)" : "0 12px 32px 4px rgb(0 0 0 / 4%), 0 8px 20px rgb(0 0 0 / 8%)",
120
115
  "--varo-ui-motion-feedback": "140ms",
116
+ "--varo-ui-motion-press": "90ms",
117
+ "--varo-ui-motion-indicator": "140ms",
121
118
  "--varo-ui-motion-state": "180ms",
122
119
  "--varo-ui-motion-enter": "220ms",
123
120
  "--varo-ui-motion-exit": "160ms",
124
121
  "--varo-ui-motion-ease": "cubic-bezier(0.2, 0.8, 0.2, 1)",
125
122
  "--varo-ui-ring": colorWithAlpha(theme.semantic.primaryBase, 16),
126
- "--varo-ui-focus": contrastSafeForeground(theme.semantic.surfaceBase),
123
+ "--varo-ui-focus": foregroundFor("--varo-ui-surface", theme.semantic.surfaceBase),
127
124
  ...overrides
128
125
  };
129
126
  }
@@ -386,4 +383,4 @@ function mergeThemeOverrides(theme, overrides = {}) {
386
383
  //#endregion
387
384
  export { mergeThemeOverrides as a, renderThemeCssVariables as c, createTheme as i, createPalette as n, contrastSafeForeground as o, createSemanticTokens as r, createThemeCssVariables as s, createComponentTokens as t };
388
385
 
389
- //# sourceMappingURL=theme-DFqneHw9.mjs.map
386
+ //# sourceMappingURL=theme-CMZi-Bw1.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-CMZi-Bw1.mjs","names":[],"sources":["../src/css.ts","../src/theme.ts"],"sourcesContent":["import type { ThemeDefinition } from './types'\n\nexport interface ThemeCssVariables {\n '--varo-ui-white': string\n '--varo-ui-black': string\n '--varo-ui-bg': string\n '--varo-ui-surface': string\n '--varo-ui-surface-muted': string\n '--varo-ui-surface-overlay': string\n '--varo-ui-text': string\n '--varo-ui-text-regular': string\n '--varo-ui-text-muted': string\n '--varo-ui-text-placeholder': string\n '--varo-ui-text-disabled': string\n '--varo-ui-border': string\n '--varo-ui-border-strong': string\n '--varo-ui-border-dark': string\n '--varo-ui-border-light': string\n '--varo-ui-border-lighter': string\n '--varo-ui-border-extra-light': string\n '--varo-ui-fill': string\n '--varo-ui-fill-darker': string\n '--varo-ui-fill-dark': string\n '--varo-ui-fill-light': string\n '--varo-ui-fill-lighter': string\n '--varo-ui-fill-extra-light': string\n '--varo-ui-primary': string\n '--varo-ui-primary-dark': string\n '--varo-ui-primary-hover': string\n '--varo-ui-primary-soft': string\n '--varo-ui-primary-foreground': string\n '--varo-ui-primary-hover-foreground': string\n '--varo-ui-primary-text': string\n '--varo-ui-success': string\n '--varo-ui-success-dark': string\n '--varo-ui-success-hover': string\n '--varo-ui-success-soft': string\n '--varo-ui-success-foreground': string\n '--varo-ui-success-hover-foreground': string\n '--varo-ui-success-text': string\n '--varo-ui-warning': string\n '--varo-ui-warning-dark': string\n '--varo-ui-warning-hover': string\n '--varo-ui-warning-soft': string\n '--varo-ui-warning-foreground': string\n '--varo-ui-warning-hover-foreground': string\n '--varo-ui-warning-text': string\n '--varo-ui-danger': string\n '--varo-ui-danger-dark': string\n '--varo-ui-danger-hover': string\n '--varo-ui-danger-soft': string\n '--varo-ui-danger-foreground': string\n '--varo-ui-danger-hover-foreground': string\n '--varo-ui-danger-text': string\n '--varo-ui-info': string\n '--varo-ui-info-dark': string\n '--varo-ui-info-hover': string\n '--varo-ui-info-soft': string\n '--varo-ui-info-foreground': string\n '--varo-ui-info-hover-foreground': string\n '--varo-ui-info-text': string\n '--varo-ui-radius': string\n '--varo-ui-radius-sm': string\n '--varo-ui-button-radius': string\n '--varo-ui-button-height-sm': string\n '--varo-ui-button-height-md': string\n '--varo-ui-button-height-lg': string\n '--varo-ui-input-radius': string\n '--varo-ui-input-height-sm': string\n '--varo-ui-input-height-md': string\n '--varo-ui-input-height-lg': string\n '--varo-ui-shadow-sm': string\n '--varo-ui-shadow-md': string\n '--varo-ui-motion-feedback': string\n '--varo-ui-motion-press': string\n '--varo-ui-motion-indicator': string\n '--varo-ui-motion-state': string\n '--varo-ui-motion-enter': string\n '--varo-ui-motion-exit': string\n '--varo-ui-motion-ease': string\n '--varo-ui-ring': string\n '--varo-ui-focus': string\n [name: `--${string}`]: string\n}\n\nexport type ThemeCssVariableOverrides = Partial<ThemeCssVariables>\n\nfunction colorWithAlpha(color: string, alpha: number): string {\n const value = color.slice(1)\n const normalized = value.length === 3\n ? value.split('').map(part => `${part}${part}`).join('')\n : value\n\n if (!color.startsWith('#') || !/^[\\da-f]{6}$/i.test(normalized)) {\n return color\n }\n\n const red = Number.parseInt(normalized.slice(0, 2), 16)\n const green = Number.parseInt(normalized.slice(2, 4), 16)\n const blue = Number.parseInt(normalized.slice(4, 6), 16)\n return `rgb(${red} ${green} ${blue} / ${alpha}%)`\n}\n\nfunction semanticTextColor(base: string, text: string): string {\n if (!/^#[\\da-f]{6}$/i.test(base) || !/^#[\\da-f]{6}$/i.test(text)) {\n return text\n }\n\n const channels = [1, 3, 5].map((offset) => {\n const baseChannel = Number.parseInt(base.slice(offset, offset + 2), 16)\n const textChannel = Number.parseInt(text.slice(offset, offset + 2), 16)\n return Math.round((baseChannel + textChannel) / 2)\n .toString(16)\n .padStart(2, '0')\n })\n\n return `#${channels.join('')}`\n}\n\nfunction relativeLuminance(color: string): number | undefined {\n const value = color.slice(1)\n const normalized = value.length === 3\n ? value.split('').map(part => `${part}${part}`).join('')\n : value\n\n if (!color.startsWith('#') || !/^[\\da-f]{6}$/i.test(normalized)) {\n return undefined\n }\n\n const channelLuminance = (offset: number) => {\n const channel = Number.parseInt(normalized.slice(offset, offset + 2), 16) / 255\n return channel <= 0.04045\n ? channel / 12.92\n : ((channel + 0.055) / 1.055) ** 2.4\n }\n return channelLuminance(0) * 0.2126\n + channelLuminance(2) * 0.7152\n + channelLuminance(4) * 0.0722\n}\n\nfunction foregroundFromLuminance(backgroundLuminance: number): '#000000' | '#ffffff' {\n const blackContrast = (backgroundLuminance + 0.05) / 0.05\n const whiteContrast = 1.05 / (backgroundLuminance + 0.05)\n\n return blackContrast >= whiteContrast ? '#000000' : '#ffffff'\n}\n\nexport function contrastSafeForeground(background: string): '#000000' | '#ffffff' {\n const backgroundLuminance = relativeLuminance(background)\n if (backgroundLuminance == null) {\n throw new Error(`Contrast-safe foreground requires a hex color (#RGB or #RRGGBB): ${background}`)\n }\n\n return foregroundFromLuminance(backgroundLuminance)\n}\n\nexport function createThemeCssVariables(\n theme: ThemeDefinition,\n overrides: ThemeCssVariableOverrides = {},\n): ThemeCssVariables {\n function foregroundFor(fill: keyof ThemeCssVariables, fallback: string): string {\n const override = overrides[fill]\n const luminance = override == null ? undefined : relativeLuminance(override)\n return luminance == null ? contrastSafeForeground(fallback) : foregroundFromLuminance(luminance)\n }\n\n return {\n '--varo-ui-white': theme.palette.neutral.white,\n '--varo-ui-black': theme.palette.neutral.black,\n '--varo-ui-bg': theme.semantic.surfaceElevated,\n '--varo-ui-surface': theme.semantic.surfaceBase,\n '--varo-ui-surface-muted': theme.semantic.fillLight,\n '--varo-ui-surface-overlay': theme.semantic.surfaceOverlay,\n '--varo-ui-text': theme.semantic.textBase,\n '--varo-ui-text-regular': theme.semantic.textRegular,\n '--varo-ui-text-muted': theme.semantic.textMuted,\n '--varo-ui-text-placeholder': theme.semantic.textPlaceholder,\n '--varo-ui-text-disabled': theme.semantic.textDisabled,\n '--varo-ui-border': theme.semantic.borderBase,\n '--varo-ui-border-strong': theme.semantic.borderStrong,\n '--varo-ui-border-dark': theme.palette.neutral['border-dark'],\n '--varo-ui-border-light': theme.semantic.borderLight,\n '--varo-ui-border-lighter': theme.semantic.borderLighter,\n '--varo-ui-border-extra-light': theme.palette.neutral['border-extra-light'],\n '--varo-ui-fill': theme.semantic.fillBase,\n '--varo-ui-fill-darker': theme.palette.neutral['fill-darker'],\n '--varo-ui-fill-dark': theme.palette.neutral['fill-dark'],\n '--varo-ui-fill-light': theme.semantic.fillLight,\n '--varo-ui-fill-lighter': theme.semantic.fillLighter,\n '--varo-ui-fill-extra-light': theme.palette.neutral['fill-extra-light'],\n '--varo-ui-primary': theme.semantic.primaryBase,\n '--varo-ui-primary-dark': theme.semantic.primaryDark,\n '--varo-ui-primary-hover': theme.semantic.primaryHover,\n '--varo-ui-primary-soft': theme.semantic.primarySoft,\n '--varo-ui-primary-foreground': foregroundFor('--varo-ui-primary', theme.semantic.primaryBase),\n '--varo-ui-primary-hover-foreground': foregroundFor('--varo-ui-primary-hover', theme.semantic.primaryHover),\n '--varo-ui-primary-text': semanticTextColor(theme.semantic.primaryBase, theme.semantic.textBase),\n '--varo-ui-success': theme.semantic.successBase,\n '--varo-ui-success-dark': theme.semantic.successDark,\n '--varo-ui-success-hover': theme.semantic.successHover,\n '--varo-ui-success-soft': theme.semantic.successSoft,\n '--varo-ui-success-foreground': foregroundFor('--varo-ui-success', theme.semantic.successBase),\n '--varo-ui-success-hover-foreground': foregroundFor('--varo-ui-success-hover', theme.semantic.successHover),\n '--varo-ui-success-text': semanticTextColor(theme.semantic.successBase, theme.semantic.textBase),\n '--varo-ui-warning': theme.semantic.warningBase,\n '--varo-ui-warning-dark': theme.semantic.warningDark,\n '--varo-ui-warning-hover': theme.semantic.warningHover,\n '--varo-ui-warning-soft': theme.semantic.warningSoft,\n '--varo-ui-warning-foreground': foregroundFor('--varo-ui-warning', theme.semantic.warningBase),\n '--varo-ui-warning-hover-foreground': foregroundFor('--varo-ui-warning-hover', theme.semantic.warningHover),\n '--varo-ui-warning-text': semanticTextColor(theme.semantic.warningBase, theme.semantic.textBase),\n '--varo-ui-danger': theme.semantic.dangerBase,\n '--varo-ui-danger-dark': theme.semantic.dangerDark,\n '--varo-ui-danger-hover': theme.semantic.dangerHover,\n '--varo-ui-danger-soft': theme.semantic.dangerSoft,\n '--varo-ui-danger-foreground': foregroundFor('--varo-ui-danger', theme.semantic.dangerBase),\n '--varo-ui-danger-hover-foreground': foregroundFor('--varo-ui-danger-hover', theme.semantic.dangerHover),\n '--varo-ui-danger-text': semanticTextColor(theme.semantic.dangerBase, theme.semantic.textBase),\n '--varo-ui-info': theme.semantic.infoBase,\n '--varo-ui-info-dark': theme.semantic.infoDark,\n '--varo-ui-info-hover': theme.semantic.infoHover,\n '--varo-ui-info-soft': theme.semantic.infoSoft,\n '--varo-ui-info-foreground': foregroundFor('--varo-ui-info', theme.semantic.infoBase),\n '--varo-ui-info-hover-foreground': foregroundFor('--varo-ui-info-hover', theme.semantic.infoHover),\n '--varo-ui-info-text': semanticTextColor(theme.semantic.infoBase, theme.semantic.textBase),\n '--varo-ui-button-radius': theme.components.button.borderRadius,\n '--varo-ui-button-height-sm': theme.components.button.heightSm,\n '--varo-ui-button-height-md': theme.components.button.heightMd,\n '--varo-ui-button-height-lg': theme.components.button.heightLg,\n '--varo-ui-input-radius': theme.components.input.borderRadius,\n '--varo-ui-input-height-sm': theme.components.input.heightSm,\n '--varo-ui-input-height-md': theme.components.input.heightMd,\n '--varo-ui-input-height-lg': theme.components.input.heightLg,\n '--varo-ui-radius': 'var(--varo-ui-button-radius)',\n '--varo-ui-radius-sm': 'var(--varo-ui-input-radius)',\n '--varo-ui-shadow-sm': theme.seed.mode === 'dark'\n ? '0 1px 2px rgb(0 0 0 / 46%)'\n : '0 1px 2px rgb(48 49 51 / 6%)',\n '--varo-ui-shadow-md': theme.seed.mode === 'dark'\n ? '0 12px 32px 4px rgb(0 0 0 / 36%), 0 8px 20px rgb(0 0 0 / 72%)'\n : '0 12px 32px 4px rgb(0 0 0 / 4%), 0 8px 20px rgb(0 0 0 / 8%)',\n '--varo-ui-motion-feedback': '140ms',\n '--varo-ui-motion-press': '90ms',\n '--varo-ui-motion-indicator': '140ms',\n '--varo-ui-motion-state': '180ms',\n '--varo-ui-motion-enter': '220ms',\n '--varo-ui-motion-exit': '160ms',\n '--varo-ui-motion-ease': 'cubic-bezier(0.2, 0.8, 0.2, 1)',\n '--varo-ui-ring': colorWithAlpha(theme.semantic.primaryBase, 16),\n '--varo-ui-focus': foregroundFor('--varo-ui-surface', theme.semantic.surfaceBase),\n ...overrides,\n }\n}\n\nexport function renderThemeCssVariables(selector: string, variables: ThemeCssVariables): string {\n const normalizedSelector = selector.trim()\n if (!normalizedSelector || /[{}]/.test(normalizedSelector)) {\n throw new Error(`Invalid theme CSS selector: ${selector}`)\n }\n\n const declarations = Object.entries(variables).map(([name, value]) => {\n if (/[;{}\\r\\n]/.test(value)) {\n throw new Error(`Invalid theme CSS variable value for ${name}`)\n }\n return ` ${name}: ${value};`\n })\n\n return `${normalizedSelector} {\\n${declarations.join('\\n')}\\n}`\n}\n","import type {\n ComponentTokens,\n SemanticTokens,\n ThemeDefinition,\n ThemeOverrides,\n ThemePalette,\n ThemeSeed,\n} from './types'\n\ninterface ColorScale {\n dark: string\n base: string\n light: string\n soft: string\n}\n\nconst REFERENCE_SCALES: Record<string, Omit<ColorScale, 'base'>> = {\n '#07c160': { dark: '#06ad56', light: '#38cd80', soft: '#e6f9ef' },\n '#007dff': { dark: '#006ad9', light: '#3397ff', soft: '#e5f2ff' },\n '#13b248': { dark: '#10973d', light: '#42c16d', soft: '#e7f7ec' },\n '#fa9200': { dark: '#d57c00', light: '#fba833', soft: '#fef4e5' },\n '#eb3437': { dark: '#c82c2f', light: '#ef5d5f', soft: '#fdeaeb' },\n '#73767a': { dark: '#5c5e62', light: '#8f9195', soft: '#f1f1f2' },\n}\n\nconst DARK_SOFT_COLORS: Record<string, string> = {\n '#07c160': '#122c1f',\n '#007dff': '#112335',\n '#13b248': '#142a1b',\n '#fa9200': '#342611',\n '#eb3437': '#321819',\n '#73767a': '#212222',\n}\n\nfunction mixHex(base: string, target: string, targetWeight: number): string {\n const normalizedBase = base.toLowerCase()\n if (!/^#[\\da-f]{6}$/.test(normalizedBase) || !/^#[\\da-f]{6}$/.test(target)) {\n return base\n }\n\n const channels = [1, 3, 5].map((offset) => {\n const baseChannel = Number.parseInt(normalizedBase.slice(offset, offset + 2), 16)\n const targetChannel = Number.parseInt(target.slice(offset, offset + 2), 16)\n return Math.round(baseChannel * (1 - targetWeight) + targetChannel * targetWeight)\n .toString(16)\n .padStart(2, '0')\n })\n\n return `#${channels.join('')}`\n}\n\nfunction createColorScale(base: string, mode: 'light' | 'dark'): Record<string, string> {\n const normalized = base.toLowerCase()\n const reference = REFERENCE_SCALES[normalized]\n const lightScale: ColorScale = reference\n ? { base, ...reference }\n : {\n base,\n dark: mixHex(base, '#000000', 0.15),\n light: mixHex(base, '#ffffff', 0.2),\n soft: mixHex(base, '#ffffff', 0.9),\n }\n const scale = mode === 'dark'\n ? {\n ...lightScale,\n soft: DARK_SOFT_COLORS[normalized] ?? mixHex(base, '#141414', 0.86),\n }\n : lightScale\n\n return {\n ...scale,\n 50: scale.soft,\n 500: scale.base,\n 600: scale.dark,\n }\n}\n\nexport function createPalette(seed: ThemeSeed): ThemePalette {\n const mode = seed.mode ?? 'light'\n const neutral = mode === 'dark'\n ? {\n '0': '#141414',\n '50': '#1d1d1d',\n '100': '#262727',\n '200': '#4c4d4f',\n '300': '#636466',\n '400': '#8d9095',\n '500': '#a3a6ad',\n '600': '#cfd3dc',\n '900': '#e5eaf3',\n '1000': '#e5eaf3',\n 'white': '#ffffff',\n 'black': '#000000',\n 'text-primary': '#e5eaf3',\n 'text-regular': '#cfd3dc',\n 'text-secondary': '#a3a6ad',\n 'text-placeholder': '#8d9095',\n 'text-disabled': '#6c6e72',\n 'border-darker': '#636466',\n 'border-dark': '#58585a',\n 'border-base': '#4c4d4f',\n 'border-light': '#414243',\n 'border-lighter': '#363637',\n 'border-extra-light': '#2a2b2c',\n 'fill-darker': '#424243',\n 'fill-dark': '#39393a',\n 'fill-base': '#303030',\n 'fill-light': '#262727',\n 'fill-lighter': '#1d1d1d',\n 'fill-extra-light': '#191919',\n 'bg-page': '#0a0a0a',\n 'bg-base': '#141414',\n 'bg-overlay': '#1d1e1f',\n }\n : {\n '0': '#ffffff',\n '50': '#fafafa',\n '100': '#f5f7fa',\n '200': '#dcdfe6',\n '300': '#cdd0d6',\n '400': '#a8abb2',\n '500': '#909399',\n '600': '#606266',\n '900': seed.neutral,\n '1000': seed.neutral,\n 'white': '#ffffff',\n 'black': '#000000',\n 'text-primary': seed.neutral,\n 'text-regular': '#606266',\n 'text-secondary': '#909399',\n 'text-placeholder': '#a8abb2',\n 'text-disabled': '#c0c4cc',\n 'border-darker': '#cdd0d6',\n 'border-dark': '#d4d7de',\n 'border-base': '#dcdfe6',\n 'border-light': '#e4e7ed',\n 'border-lighter': '#ebeef5',\n 'border-extra-light': '#f2f6fc',\n 'fill-darker': '#e6e8eb',\n 'fill-dark': '#ebedf0',\n 'fill-base': '#f0f2f5',\n 'fill-light': '#f5f7fa',\n 'fill-lighter': '#fafafa',\n 'fill-extra-light': '#fafcff',\n 'bg-page': '#f2f3f5',\n 'bg-base': '#ffffff',\n 'bg-overlay': '#ffffff',\n }\n\n return {\n primary: createColorScale(seed.primary, mode),\n success: createColorScale(seed.success, mode),\n warning: createColorScale(seed.warning, mode),\n error: createColorScale(seed.error, mode),\n info: createColorScale(seed.info ?? '#73767a', mode),\n neutral,\n }\n}\n\nexport function createSemanticTokens(palette: ThemePalette): SemanticTokens {\n return {\n textBase: palette.neutral['text-primary'],\n textRegular: palette.neutral['text-regular'],\n textMuted: palette.neutral['text-secondary'],\n textPlaceholder: palette.neutral['text-placeholder'],\n textDisabled: palette.neutral['text-disabled'],\n surfaceBase: palette.neutral['bg-base'],\n surfaceElevated: palette.neutral['bg-page'],\n surfaceOverlay: palette.neutral['bg-overlay'],\n fillBase: palette.neutral['fill-base'],\n fillLight: palette.neutral['fill-light'],\n fillLighter: palette.neutral['fill-lighter'],\n borderBase: palette.neutral['border-base'],\n borderStrong: palette.neutral['border-darker'],\n borderLight: palette.neutral['border-light'],\n borderLighter: palette.neutral['border-lighter'],\n primaryBase: palette.primary.base,\n primaryDark: palette.primary.dark,\n primaryHover: palette.primary.light,\n primarySoft: palette.primary.soft,\n successBase: palette.success.base,\n successDark: palette.success.dark,\n successHover: palette.success.light,\n successSoft: palette.success.soft,\n warningBase: palette.warning.base,\n warningDark: palette.warning.dark,\n warningHover: palette.warning.light,\n warningSoft: palette.warning.soft,\n dangerBase: palette.error.base,\n dangerDark: palette.error.dark,\n dangerHover: palette.error.light,\n dangerSoft: palette.error.soft,\n infoBase: palette.info.base,\n infoDark: palette.info.dark,\n infoHover: palette.info.light,\n infoSoft: palette.info.soft,\n }\n}\n\nexport function createComponentTokens(semantic: SemanticTokens): ComponentTokens {\n return {\n button: {\n borderRadius: '12px',\n heightSm: '36px',\n heightMd: '44px',\n heightLg: '48px',\n },\n dialog: {\n borderRadius: '16px',\n overlayColor: semantic.borderStrong,\n },\n input: {\n borderRadius: '12px',\n heightSm: '36px',\n heightMd: '44px',\n heightLg: '48px',\n },\n }\n}\n\nexport function createTheme(seed: ThemeSeed): ThemeDefinition {\n const palette = createPalette(seed)\n const semantic = createSemanticTokens(palette)\n const components = createComponentTokens(semantic)\n\n return {\n seed,\n palette,\n semantic,\n components,\n }\n}\n\nexport function mergeThemeOverrides(theme: ThemeDefinition, overrides: ThemeOverrides = {}): ThemeDefinition {\n return {\n ...theme,\n semantic: {\n ...theme.semantic,\n ...overrides.semantic,\n },\n components: {\n button: {\n ...theme.components.button,\n ...overrides.components?.button,\n },\n dialog: {\n ...theme.components.dialog,\n ...overrides.components?.dialog,\n },\n input: {\n ...theme.components.input,\n ...overrides.components?.input,\n },\n },\n }\n}\n"],"mappings":";AAuFA,SAAS,eAAe,OAAe,OAAuB;CAC5D,MAAM,QAAQ,MAAM,MAAM,CAAC;CAC3B,MAAM,aAAa,MAAM,WAAW,IAChC,MAAM,MAAM,EAAE,CAAC,CAAC,KAAI,SAAQ,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK,EAAE,IACrD;CAEJ,IAAI,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,gBAAgB,KAAK,UAAU,GAC5D,OAAO;CAMT,OAAO,OAHK,OAAO,SAAS,WAAW,MAAM,GAAG,CAAC,GAAG,EAGpC,EAAE,GAFJ,OAAO,SAAS,WAAW,MAAM,GAAG,CAAC,GAAG,EAE7B,EAAE,GADd,OAAO,SAAS,WAAW,MAAM,GAAG,CAAC,GAAG,EACpB,EAAE,KAAK,MAAM;AAChD;AAEA,SAAS,kBAAkB,MAAc,MAAsB;CAC7D,IAAI,CAAC,iBAAiB,KAAK,IAAI,KAAK,CAAC,iBAAiB,KAAK,IAAI,GAC7D,OAAO;CAWT,OAAO,IARU;EAAC;EAAG;EAAG;CAAC,CAAC,CAAC,K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 +1,4 @@
1
- import { c as ThemeDefinition, d as ThemeSeed, l as ThemeOverrides, o as ComponentTokens, s as SemanticTokens, u as ThemePalette } from "./css-CbtCWXft.mjs";
2
-
1
+ import { c as ThemeDefinition, d as ThemeSeed, l as ThemeOverrides, o as ComponentTokens, s as SemanticTokens, u as ThemePalette } from "./css-CAChx3dE.mjs";
3
2
  //#region src/theme.d.ts
4
3
  declare function createPalette(seed: ThemeSeed): ThemePalette;
5
4
  declare function createSemanticTokens(palette: ThemePalette): SemanticTokens;
@@ -8,4 +7,4 @@ declare function createTheme(seed: ThemeSeed): ThemeDefinition;
8
7
  declare function mergeThemeOverrides(theme: ThemeDefinition, overrides?: ThemeOverrides): ThemeDefinition;
9
8
  //#endregion
10
9
  export { mergeThemeOverrides as a, createTheme as i, createPalette as n, createSemanticTokens as r, createComponentTokens as t };
11
- //# sourceMappingURL=theme-DHkZjLNs.d.mts.map
10
+ //# sourceMappingURL=theme-DQCQ0lNT.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme-DQCQ0lNT.d.mts","names":[],"sources":["../src/theme.ts"],"mappings":";;iBA6EgB,cAAc,MAAM,YAAY;iBAkFhC,qBAAqB,SAAS,eAAe;iBAwC7C,sBAAsB,UAAU,iBAAiB;iBAqBjD,YAAY,MAAM,YAAY;iBAa9B,oBAAoB,OAAO,iBAAiB,YAAW,iBAAsB"}
@@ -1,13 +1,11 @@
1
- import { c as ThemeDefinition, t as ThemeCssVariableOverrides } from "./css-CbtCWXft.mjs";
1
+ import { c as ThemeDefinition, t as ThemeCssVariableOverrides } from "./css-CAChx3dE.mjs";
2
2
  import { Plugin } from "vite";
3
-
4
3
  //#region src/weapp-vite.d.ts
5
- interface VaroWeappThemePluginOptions {
4
+ export interface VaroWeappThemePluginOptions {
6
5
  appStyle: string;
7
6
  theme: ThemeDefinition;
8
7
  variables?: ThemeCssVariableOverrides;
9
8
  }
10
- declare function createVaroWeappThemePlugin(options: VaroWeappThemePluginOptions): Plugin;
9
+ export declare function createVaroWeappThemePlugin(options: VaroWeappThemePluginOptions): Plugin;
11
10
  //#endregion
12
- export { VaroWeappThemePluginOptions, createVaroWeappThemePlugin };
13
11
  //# sourceMappingURL=weapp-vite.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"weapp-vite.d.mts","names":[],"sources":["../src/weapp-vite.ts"],"mappings":";;;;UAMiB,2BAAA;EACf,QAAA;EACA,KAAA,EAAO,eAAA;EACP,SAAA,GAAY,yBAAyB;AAAA;AAAA,iBAGvB,0BAAA,CAA2B,OAAA,EAAS,2BAAA,GAA8B,MAAM"}
1
+ {"version":3,"file":"weapp-vite.d.mts","names":[],"sources":["../src/weapp-vite.ts"],"mappings":";;;iBAMiB;EACf;EACA,OAAO;EACP,YAAY;;wBAGE,2BAA2B,SAAS,8BAA8B"}
@@ -6,15 +6,18 @@ function createVaroWeappThemePlugin(options) {
6
6
  const themeCss = () => renderWeappThemeCss(options.theme, { variables: options.variables });
7
7
  return {
8
8
  name: "varo:weapp-theme",
9
- enforce: "pre",
10
- transform(source, id) {
11
- const [pathname, query = ""] = id.split("?");
12
- if (resolve(pathname) !== appStylePath) return;
13
- if (query.includes("weapp-vite-sidecar") || /(?:^|&)lang\.(?:js|ts|jsx|tsx)(?:&|$)/.test(query)) return;
14
- return {
15
- code: `${source}\n${themeCss()}\n`,
16
- map: null
17
- };
9
+ enforce: "post",
10
+ transform: {
11
+ order: "pre",
12
+ handler(source, id) {
13
+ const [pathname, query = ""] = id.split("?");
14
+ if (resolve(pathname) !== appStylePath) return;
15
+ if (query.includes("weapp-vite-sidecar") || /(?:^|&)lang\.(?:js|ts|jsx|tsx)(?:&|$)/.test(query)) return;
16
+ return {
17
+ code: `${source}\n${themeCss()}\n`,
18
+ map: null
19
+ };
20
+ }
18
21
  },
19
22
  generateBundle: {
20
23
  order: "post",
@@ -1 +1 @@
1
- {"version":3,"file":"weapp-vite.mjs","names":[],"sources":["../src/weapp-vite.ts"],"sourcesContent":["import type { Plugin } from 'vite'\nimport type { ThemeCssVariableOverrides } from './css.ts'\nimport type { ThemeDefinition } from './types.ts'\nimport { resolve } from 'node:path'\nimport { renderWeappThemeCss } from './weapp.ts'\n\nexport interface VaroWeappThemePluginOptions {\n appStyle: string\n theme: ThemeDefinition\n variables?: ThemeCssVariableOverrides\n}\n\nexport function createVaroWeappThemePlugin(options: VaroWeappThemePluginOptions): Plugin {\n const appStylePath = resolve(options.appStyle)\n const themeCss = () => renderWeappThemeCss(options.theme, { variables: options.variables })\n\n return {\n name: 'varo:weapp-theme',\n enforce: 'pre',\n transform(source, id) {\n const [pathname, query = ''] = id.split('?')\n if (resolve(pathname) !== appStylePath) {\n return\n }\n if (query.includes('weapp-vite-sidecar') || /(?:^|&)lang\\.(?:js|ts|jsx|tsx)(?:&|$)/.test(query)) {\n return\n }\n\n return {\n code: `${source}\\n${themeCss()}\\n`,\n map: null,\n }\n },\n generateBundle: {\n order: 'post',\n handler(_outputOptions, bundle) {\n const appStyle = Object.values(bundle).find(output => output.type === 'asset' && output.fileName === 'app.wxss')\n if (!appStyle || appStyle.type !== 'asset') {\n return\n }\n\n const source = typeof appStyle.source === 'string'\n ? appStyle.source\n : new TextDecoder().decode(appStyle.source)\n const extra = themeCss()\n if (source.includes(extra)) {\n return\n }\n appStyle.source = `${source}\\n${extra}\\n`\n },\n },\n }\n}\n"],"mappings":";;;AAYA,SAAgB,2BAA2B,SAA8C;CACvF,MAAM,eAAe,QAAQ,QAAQ,QAAQ;CAC7C,MAAM,iBAAiB,oBAAoB,QAAQ,OAAO,EAAE,WAAW,QAAQ,UAAU,CAAC;CAE1F,OAAO;EACL,MAAM;EACN,SAAS;EACT,UAAU,QAAQ,IAAI;GACpB,MAAM,CAAC,UAAU,QAAQ,MAAM,GAAG,MAAM,GAAG;GAC3C,IAAI,QAAQ,QAAQ,MAAM,cACxB;GAEF,IAAI,MAAM,SAAS,oBAAoB,KAAK,wCAAwC,KAAK,KAAK,GAC5F;GAGF,OAAO;IACL,MAAM,GAAG,OAAO,IAAI,SAAS,EAAE;IAC/B,KAAK;GACP;EACF;EACA,gBAAgB;GACd,OAAO;GACP,QAAQ,gBAAgB,QAAQ;IAC9B,MAAM,WAAW,OAAO,OAAO,MAAM,CAAC,CAAC,MAAK,WAAU,OAAO,SAAS,WAAW,OAAO,aAAa,UAAU;IAC/G,IAAI,CAAC,YAAY,SAAS,SAAS,SACjC;IAGF,MAAM,SAAS,OAAO,SAAS,WAAW,WACtC,SAAS,SACT,IAAI,YAAY,CAAC,CAAC,OAAO,SAAS,MAAM;IAC5C,MAAM,QAAQ,SAAS;IACvB,IAAI,OAAO,SAAS,KAAK,GACvB;IAEF,SAAS,SAAS,GAAG,OAAO,IAAI,MAAM;GACxC;EACF;CACF;AACF"}
1
+ {"version":3,"file":"weapp-vite.mjs","names":[],"sources":["../src/weapp-vite.ts"],"sourcesContent":["import type { Plugin } from 'vite'\nimport type { ThemeCssVariableOverrides } from './css.ts'\nimport type { ThemeDefinition } from './types.ts'\nimport { resolve } from 'node:path'\nimport { renderWeappThemeCss } from './weapp.ts'\n\nexport interface VaroWeappThemePluginOptions {\n appStyle: string\n theme: ThemeDefinition\n variables?: ThemeCssVariableOverrides\n}\n\nexport function createVaroWeappThemePlugin(options: VaroWeappThemePluginOptions): Plugin {\n const appStylePath = resolve(options.appStyle)\n const themeCss = () => renderWeappThemeCss(options.theme, { variables: options.variables })\n\n return {\n name: 'varo:weapp-theme',\n // Emit after native CSS generation while keeping source preprocessing early.\n enforce: 'post',\n transform: {\n order: 'pre',\n handler(source, id) {\n const [pathname, query = ''] = id.split('?')\n if (resolve(pathname) !== appStylePath) {\n return\n }\n if (query.includes('weapp-vite-sidecar') || /(?:^|&)lang\\.(?:js|ts|jsx|tsx)(?:&|$)/.test(query)) {\n return\n }\n\n return {\n code: `${source}\\n${themeCss()}\\n`,\n map: null,\n }\n },\n },\n generateBundle: {\n order: 'post',\n handler(_outputOptions, bundle) {\n const appStyle = Object.values(bundle).find(output => output.type === 'asset' && output.fileName === 'app.wxss')\n if (!appStyle || appStyle.type !== 'asset') {\n return\n }\n\n const source = typeof appStyle.source === 'string'\n ? appStyle.source\n : new TextDecoder().decode(appStyle.source)\n const extra = themeCss()\n if (source.includes(extra)) {\n return\n }\n appStyle.source = `${source}\\n${extra}\\n`\n },\n },\n }\n}\n"],"mappings":";;;AAYA,SAAgB,2BAA2B,SAA8C;CACvF,MAAM,eAAe,QAAQ,QAAQ,QAAQ;CAC7C,MAAM,iBAAiB,oBAAoB,QAAQ,OAAO,EAAE,WAAW,QAAQ,UAAU,CAAC;CAE1F,OAAO;EACL,MAAM;EAEN,SAAS;EACT,WAAW;GACT,OAAO;GACP,QAAQ,QAAQ,IAAI;IAClB,MAAM,CAAC,UAAU,QAAQ,MAAM,GAAG,MAAM,GAAG;IAC3C,IAAI,QAAQ,QAAQ,MAAM,cACxB;IAEF,IAAI,MAAM,SAAS,oBAAoB,KAAK,wCAAwC,KAAK,KAAK,GAC5F;IAGF,OAAO;KACL,MAAM,GAAG,OAAO,IAAI,SAAS,EAAE;KAC/B,KAAK;IACP;GACF;EACF;EACA,gBAAgB;GACd,OAAO;GACP,QAAQ,gBAAgB,QAAQ;IAC9B,MAAM,WAAW,OAAO,OAAO,MAAM,CAAC,CAAC,MAAK,WAAU,OAAO,SAAS,WAAW,OAAO,aAAa,UAAU;IAC/G,IAAI,CAAC,YAAY,SAAS,SAAS,SACjC;IAGF,MAAM,SAAS,OAAO,SAAS,WAAW,WACtC,SAAS,SACT,IAAI,YAAY,CAAC,CAAC,OAAO,SAAS,MAAM;IAC5C,MAAM,QAAQ,SAAS;IACvB,IAAI,OAAO,SAAS,KAAK,GACvB;IAEF,SAAS,SAAS,GAAG,OAAO,IAAI,MAAM;GACxC;EACF;CACF;AACF"}
package/dist/weapp.d.mts CHANGED
@@ -1,12 +1,11 @@
1
- import { c as ThemeDefinition, n as ThemeCssVariables, r as contrastSafeForeground, t as ThemeCssVariableOverrides } from "./css-CbtCWXft.mjs";
2
- import { a as mergeThemeOverrides, i as createTheme } from "./theme-DHkZjLNs.mjs";
3
-
1
+ import { c as ThemeDefinition, n as ThemeCssVariables, r as contrastSafeForeground, t as ThemeCssVariableOverrides } from "./css-CAChx3dE.mjs";
2
+ import { a as mergeThemeOverrides, i as createTheme } from "./theme-DQCQ0lNT.mjs";
4
3
  //#region src/weapp.d.ts
5
- interface WeappThemeCssOptions {
6
- variables?: ThemeCssVariableOverrides;
4
+ export interface WeappThemeCssOptions {
5
+ variables?: ThemeCssVariableOverrides | null;
7
6
  }
8
- declare function createWeappThemeStyle(theme: ThemeDefinition, options?: WeappThemeCssOptions): ThemeCssVariables;
9
- declare function renderWeappThemeCss(theme: ThemeDefinition, options?: WeappThemeCssOptions): string;
7
+ export declare function createWeappThemeStyle(theme: ThemeDefinition, options?: WeappThemeCssOptions): ThemeCssVariables;
8
+ export declare function renderWeappThemeCss(theme: ThemeDefinition, options?: WeappThemeCssOptions): string;
10
9
  //#endregion
11
- export { type ThemeCssVariableOverrides, type ThemeCssVariables, type ThemeDefinition, WeappThemeCssOptions, contrastSafeForeground, createTheme, createWeappThemeStyle, mergeThemeOverrides, renderWeappThemeCss };
10
+ export { type ThemeCssVariableOverrides, type ThemeCssVariables, type ThemeDefinition, contrastSafeForeground, createTheme, mergeThemeOverrides };
12
11
  //# sourceMappingURL=weapp.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"weapp.d.mts","names":[],"sources":["../src/weapp.ts"],"mappings":";;;;UAIiB,oBAAA;EACf,SAAA,GAAY,yBAAyB;AAAA;AAAA,iBAGvB,qBAAA,CACd,KAAA,EAAO,eAAA,EACP,OAAA,GAAS,oBAAA,GACR,iBAAA;AAAA,iBAIa,mBAAA,CACd,KAAA,EAAO,eAAA,EACP,OAAA,GAAS,oBAAyB"}
1
+ {"version":3,"file":"weapp.d.mts","names":[],"sources":["../src/weapp.ts"],"mappings":";;;iBAIiB;EACf,YAAY;;wBAGE,sBACd,OAAO,iBACP,UAAS,uBACR;wBAIa,oBACd,OAAO,iBACP,UAAS"}
package/dist/weapp.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { a as mergeThemeOverrides, c as renderThemeCssVariables, i as createTheme, o as contrastSafeForeground, s as createThemeCssVariables } from "./theme-DFqneHw9.mjs";
1
+ import { a as mergeThemeOverrides, c as renderThemeCssVariables, i as createTheme, o as contrastSafeForeground, s as createThemeCssVariables } from "./theme-CMZi-Bw1.mjs";
2
2
  //#region src/weapp.ts
3
3
  function createWeappThemeStyle(theme, options = {}) {
4
- return createThemeCssVariables(theme, options.variables);
4
+ return createThemeCssVariables(theme, options.variables ?? void 0);
5
5
  }
6
6
  function renderWeappThemeCss(theme, options = {}) {
7
7
  return renderThemeCssVariables("page", createWeappThemeStyle(theme, options));
@@ -1 +1 @@
1
- {"version":3,"file":"weapp.mjs","names":[],"sources":["../src/weapp.ts"],"sourcesContent":["import type { ThemeCssVariableOverrides, ThemeCssVariables } from './css.ts'\nimport type { ThemeDefinition } from './types.ts'\nimport { createThemeCssVariables, renderThemeCssVariables } from './css.ts'\n\nexport interface WeappThemeCssOptions {\n variables?: ThemeCssVariableOverrides\n}\n\nexport function createWeappThemeStyle(\n theme: ThemeDefinition,\n options: WeappThemeCssOptions = {},\n): ThemeCssVariables {\n return createThemeCssVariables(theme, options.variables)\n}\n\nexport function renderWeappThemeCss(\n theme: ThemeDefinition,\n options: WeappThemeCssOptions = {},\n): string {\n return renderThemeCssVariables('page', createWeappThemeStyle(theme, options))\n}\n\nexport type { ThemeCssVariableOverrides, ThemeCssVariables } from './css.ts'\nexport { contrastSafeForeground } from './css.ts'\nexport { createTheme, mergeThemeOverrides } from './theme.ts'\nexport type { ThemeDefinition } from './types.ts'\n"],"mappings":";;AAQA,SAAgB,sBACd,OACA,UAAgC,CAAC,GACd;CACnB,OAAO,wBAAwB,OAAO,QAAQ,SAAS;AACzD;AAEA,SAAgB,oBACd,OACA,UAAgC,CAAC,GACzB;CACR,OAAO,wBAAwB,QAAQ,sBAAsB,OAAO,OAAO,CAAC;AAC9E"}
1
+ {"version":3,"file":"weapp.mjs","names":[],"sources":["../src/weapp.ts"],"sourcesContent":["import type { ThemeCssVariableOverrides, ThemeCssVariables } from './css.ts'\nimport type { ThemeDefinition } from './types.ts'\nimport { createThemeCssVariables, renderThemeCssVariables } from './css.ts'\n\nexport interface WeappThemeCssOptions {\n variables?: ThemeCssVariableOverrides | null\n}\n\nexport function createWeappThemeStyle(\n theme: ThemeDefinition,\n options: WeappThemeCssOptions = {},\n): ThemeCssVariables {\n return createThemeCssVariables(theme, options.variables ?? undefined)\n}\n\nexport function renderWeappThemeCss(\n theme: ThemeDefinition,\n options: WeappThemeCssOptions = {},\n): string {\n return renderThemeCssVariables('page', createWeappThemeStyle(theme, options))\n}\n\nexport type { ThemeCssVariableOverrides, ThemeCssVariables } from './css.ts'\nexport { contrastSafeForeground } from './css.ts'\nexport { createTheme, mergeThemeOverrides } from './theme.ts'\nexport type { ThemeDefinition } from './types.ts'\n"],"mappings":";;AAQA,SAAgB,sBACd,OACA,UAAgC,CAAC,GACd;CACnB,OAAO,wBAAwB,OAAO,QAAQ,aAAa,KAAA,CAAS;AACtE;AAEA,SAAgB,oBACd,OACA,UAAgC,CAAC,GACzB;CACR,OAAO,wBAAwB,QAAQ,sBAAsB,OAAO,OAAO,CAAC;AAC9E"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@varo-ui/theme",
3
3
  "type": "module",
4
- "version": "2.1.0",
4
+ "version": "3.0.0",
5
5
  "description": "Token-driven themes and providers for Varo H5 and mini-program components.",
6
6
  "author": "daguanren21 <1363917353@qq.com>",
7
7
  "license": "MIT",
@@ -57,10 +57,10 @@
57
57
  "src"
58
58
  ],
59
59
  "dependencies": {
60
- "vue": "^3.5.42"
60
+ "vue": "^3.5.45"
61
61
  },
62
62
  "devDependencies": {
63
- "vite": "8.2.2"
63
+ "vite": "8.3.0"
64
64
  },
65
65
  "scripts": {
66
66
  "build": "tsdown",
@@ -68,7 +68,6 @@
68
68
  "dev": "tsdown --watch",
69
69
  "lint": "echo theme lint pending",
70
70
  "typecheck": "tsc -p tsconfig.json --noEmit",
71
- "test": "vitest run --passWithNoTests",
72
- "test:e2e": "echo theme has no e2e"
71
+ "test": "vitest run --config ../../vitest.config.ts --dir . --passWithNoTests"
73
72
  }
74
73
  }
package/src/css.ts CHANGED
@@ -72,6 +72,8 @@ export interface ThemeCssVariables {
72
72
  '--varo-ui-shadow-sm': string
73
73
  '--varo-ui-shadow-md': string
74
74
  '--varo-ui-motion-feedback': string
75
+ '--varo-ui-motion-press': string
76
+ '--varo-ui-motion-indicator': string
75
77
  '--varo-ui-motion-state': string
76
78
  '--varo-ui-motion-enter': string
77
79
  '--varo-ui-motion-exit': string
@@ -136,20 +138,11 @@ function relativeLuminance(color: string): number | undefined {
136
138
  + channelLuminance(4) * 0.0722
137
139
  }
138
140
 
139
- function isChromatic(color: string): boolean {
140
- const value = color.slice(1)
141
- const normalized = value.length === 3
142
- ? value.split('').map(part => `${part}${part}`).join('')
143
- : value
144
-
145
- if (!color.startsWith('#') || !/^[\da-f]{6}$/i.test(normalized)) {
146
- return false
147
- }
141
+ function foregroundFromLuminance(backgroundLuminance: number): '#000000' | '#ffffff' {
142
+ const blackContrast = (backgroundLuminance + 0.05) / 0.05
143
+ const whiteContrast = 1.05 / (backgroundLuminance + 0.05)
148
144
 
149
- const red = Number.parseInt(normalized.slice(0, 2), 16)
150
- const green = Number.parseInt(normalized.slice(2, 4), 16)
151
- const blue = Number.parseInt(normalized.slice(4, 6), 16)
152
- return Math.max(red, green, blue) - Math.min(red, green, blue) >= 40
145
+ return blackContrast >= whiteContrast ? '#000000' : '#ffffff'
153
146
  }
154
147
 
155
148
  export function contrastSafeForeground(background: string): '#000000' | '#ffffff' {
@@ -158,24 +151,19 @@ export function contrastSafeForeground(background: string): '#000000' | '#ffffff
158
151
  throw new Error(`Contrast-safe foreground requires a hex color (#RGB or #RRGGBB): ${background}`)
159
152
  }
160
153
 
161
- const blackContrast = (backgroundLuminance + 0.05) / 0.05
162
- const whiteContrast = 1.05 / (backgroundLuminance + 0.05)
163
-
164
- if (backgroundLuminance >= 0.55) {
165
- return '#000000'
166
- }
167
-
168
- if (isChromatic(background)) {
169
- return '#ffffff'
170
- }
171
-
172
- return blackContrast >= whiteContrast ? '#000000' : '#ffffff'
154
+ return foregroundFromLuminance(backgroundLuminance)
173
155
  }
174
156
 
175
157
  export function createThemeCssVariables(
176
158
  theme: ThemeDefinition,
177
159
  overrides: ThemeCssVariableOverrides = {},
178
160
  ): ThemeCssVariables {
161
+ function foregroundFor(fill: keyof ThemeCssVariables, fallback: string): string {
162
+ const override = overrides[fill]
163
+ const luminance = override == null ? undefined : relativeLuminance(override)
164
+ return luminance == null ? contrastSafeForeground(fallback) : foregroundFromLuminance(luminance)
165
+ }
166
+
179
167
  return {
180
168
  '--varo-ui-white': theme.palette.neutral.white,
181
169
  '--varo-ui-black': theme.palette.neutral.black,
@@ -204,36 +192,36 @@ export function createThemeCssVariables(
204
192
  '--varo-ui-primary-dark': theme.semantic.primaryDark,
205
193
  '--varo-ui-primary-hover': theme.semantic.primaryHover,
206
194
  '--varo-ui-primary-soft': theme.semantic.primarySoft,
207
- '--varo-ui-primary-foreground': contrastSafeForeground(theme.semantic.primaryBase),
208
- '--varo-ui-primary-hover-foreground': contrastSafeForeground(theme.semantic.primaryHover),
195
+ '--varo-ui-primary-foreground': foregroundFor('--varo-ui-primary', theme.semantic.primaryBase),
196
+ '--varo-ui-primary-hover-foreground': foregroundFor('--varo-ui-primary-hover', theme.semantic.primaryHover),
209
197
  '--varo-ui-primary-text': semanticTextColor(theme.semantic.primaryBase, theme.semantic.textBase),
210
198
  '--varo-ui-success': theme.semantic.successBase,
211
199
  '--varo-ui-success-dark': theme.semantic.successDark,
212
200
  '--varo-ui-success-hover': theme.semantic.successHover,
213
201
  '--varo-ui-success-soft': theme.semantic.successSoft,
214
- '--varo-ui-success-foreground': contrastSafeForeground(theme.semantic.successBase),
215
- '--varo-ui-success-hover-foreground': contrastSafeForeground(theme.semantic.successHover),
202
+ '--varo-ui-success-foreground': foregroundFor('--varo-ui-success', theme.semantic.successBase),
203
+ '--varo-ui-success-hover-foreground': foregroundFor('--varo-ui-success-hover', theme.semantic.successHover),
216
204
  '--varo-ui-success-text': semanticTextColor(theme.semantic.successBase, theme.semantic.textBase),
217
205
  '--varo-ui-warning': theme.semantic.warningBase,
218
206
  '--varo-ui-warning-dark': theme.semantic.warningDark,
219
207
  '--varo-ui-warning-hover': theme.semantic.warningHover,
220
208
  '--varo-ui-warning-soft': theme.semantic.warningSoft,
221
- '--varo-ui-warning-foreground': contrastSafeForeground(theme.semantic.warningBase),
222
- '--varo-ui-warning-hover-foreground': contrastSafeForeground(theme.semantic.warningHover),
209
+ '--varo-ui-warning-foreground': foregroundFor('--varo-ui-warning', theme.semantic.warningBase),
210
+ '--varo-ui-warning-hover-foreground': foregroundFor('--varo-ui-warning-hover', theme.semantic.warningHover),
223
211
  '--varo-ui-warning-text': semanticTextColor(theme.semantic.warningBase, theme.semantic.textBase),
224
212
  '--varo-ui-danger': theme.semantic.dangerBase,
225
213
  '--varo-ui-danger-dark': theme.semantic.dangerDark,
226
214
  '--varo-ui-danger-hover': theme.semantic.dangerHover,
227
215
  '--varo-ui-danger-soft': theme.semantic.dangerSoft,
228
- '--varo-ui-danger-foreground': contrastSafeForeground(theme.semantic.dangerBase),
229
- '--varo-ui-danger-hover-foreground': contrastSafeForeground(theme.semantic.dangerHover),
216
+ '--varo-ui-danger-foreground': foregroundFor('--varo-ui-danger', theme.semantic.dangerBase),
217
+ '--varo-ui-danger-hover-foreground': foregroundFor('--varo-ui-danger-hover', theme.semantic.dangerHover),
230
218
  '--varo-ui-danger-text': semanticTextColor(theme.semantic.dangerBase, theme.semantic.textBase),
231
219
  '--varo-ui-info': theme.semantic.infoBase,
232
220
  '--varo-ui-info-dark': theme.semantic.infoDark,
233
221
  '--varo-ui-info-hover': theme.semantic.infoHover,
234
222
  '--varo-ui-info-soft': theme.semantic.infoSoft,
235
- '--varo-ui-info-foreground': contrastSafeForeground(theme.semantic.infoBase),
236
- '--varo-ui-info-hover-foreground': contrastSafeForeground(theme.semantic.infoHover),
223
+ '--varo-ui-info-foreground': foregroundFor('--varo-ui-info', theme.semantic.infoBase),
224
+ '--varo-ui-info-hover-foreground': foregroundFor('--varo-ui-info-hover', theme.semantic.infoHover),
237
225
  '--varo-ui-info-text': semanticTextColor(theme.semantic.infoBase, theme.semantic.textBase),
238
226
  '--varo-ui-button-radius': theme.components.button.borderRadius,
239
227
  '--varo-ui-button-height-sm': theme.components.button.heightSm,
@@ -252,12 +240,14 @@ export function createThemeCssVariables(
252
240
  ? '0 12px 32px 4px rgb(0 0 0 / 36%), 0 8px 20px rgb(0 0 0 / 72%)'
253
241
  : '0 12px 32px 4px rgb(0 0 0 / 4%), 0 8px 20px rgb(0 0 0 / 8%)',
254
242
  '--varo-ui-motion-feedback': '140ms',
243
+ '--varo-ui-motion-press': '90ms',
244
+ '--varo-ui-motion-indicator': '140ms',
255
245
  '--varo-ui-motion-state': '180ms',
256
246
  '--varo-ui-motion-enter': '220ms',
257
247
  '--varo-ui-motion-exit': '160ms',
258
248
  '--varo-ui-motion-ease': 'cubic-bezier(0.2, 0.8, 0.2, 1)',
259
249
  '--varo-ui-ring': colorWithAlpha(theme.semantic.primaryBase, 16),
260
- '--varo-ui-focus': contrastSafeForeground(theme.semantic.surfaceBase),
250
+ '--varo-ui-focus': foregroundFor('--varo-ui-surface', theme.semantic.surfaceBase),
261
251
  ...overrides,
262
252
  }
263
253
  }
package/src/weapp-vite.ts CHANGED
@@ -16,20 +16,24 @@ export function createVaroWeappThemePlugin(options: VaroWeappThemePluginOptions)
16
16
 
17
17
  return {
18
18
  name: 'varo:weapp-theme',
19
- enforce: 'pre',
20
- transform(source, id) {
21
- const [pathname, query = ''] = id.split('?')
22
- if (resolve(pathname) !== appStylePath) {
23
- return
24
- }
25
- if (query.includes('weapp-vite-sidecar') || /(?:^|&)lang\.(?:js|ts|jsx|tsx)(?:&|$)/.test(query)) {
26
- return
27
- }
19
+ // Emit after native CSS generation while keeping source preprocessing early.
20
+ enforce: 'post',
21
+ transform: {
22
+ order: 'pre',
23
+ handler(source, id) {
24
+ const [pathname, query = ''] = id.split('?')
25
+ if (resolve(pathname) !== appStylePath) {
26
+ return
27
+ }
28
+ if (query.includes('weapp-vite-sidecar') || /(?:^|&)lang\.(?:js|ts|jsx|tsx)(?:&|$)/.test(query)) {
29
+ return
30
+ }
28
31
 
29
- return {
30
- code: `${source}\n${themeCss()}\n`,
31
- map: null,
32
- }
32
+ return {
33
+ code: `${source}\n${themeCss()}\n`,
34
+ map: null,
35
+ }
36
+ },
33
37
  },
34
38
  generateBundle: {
35
39
  order: 'post',
package/src/weapp.ts CHANGED
@@ -3,14 +3,14 @@ import type { ThemeDefinition } from './types.ts'
3
3
  import { createThemeCssVariables, renderThemeCssVariables } from './css.ts'
4
4
 
5
5
  export interface WeappThemeCssOptions {
6
- variables?: ThemeCssVariableOverrides
6
+ variables?: ThemeCssVariableOverrides | null
7
7
  }
8
8
 
9
9
  export function createWeappThemeStyle(
10
10
  theme: ThemeDefinition,
11
11
  options: WeappThemeCssOptions = {},
12
12
  ): ThemeCssVariables {
13
- return createThemeCssVariables(theme, options.variables)
13
+ return createThemeCssVariables(theme, options.variables ?? undefined)
14
14
  }
15
15
 
16
16
  export function renderWeappThemeCss(
@@ -1 +0,0 @@
1
- {"version":3,"file":"css-CbtCWXft.d.mts","names":[],"sources":["../src/types.ts","../src/css.ts"],"mappings":";UAAiB,SAAA;EACf,OAAA;EACA,OAAA;EACA,OAAA;EACA,KAAA;EACA,OAAA;EACA,IAAA;EACA,IAAA;AAAA;AAAA,UAGe,YAAA;EACf,OAAA,EAAS,MAAA;EACT,OAAA,EAAS,MAAA;EACT,OAAA,EAAS,MAAA;EACT,OAAA,EAAS,MAAA;EACT,KAAA,EAAO,MAAA;EACP,IAAA,EAAM,MAAA;AAAA;AAAA,U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,wBAAA;EACA,8BAAA;EACA,oCAAA;EACA,wBAAA;EACA,mBAAA;EACA,wBAAA;EACA,yBAAA;EACA,wBAAA;EACA,8BAAA;EACA,oCAAA;EACA,wBAAA;EACA,mBAAA;EACA,wBAAA;EACA,yBAAA;EACA,wBAAA;EACA,8BAAA;EACA,oCAAA;EACA,wBAAA;EACA,kBAAA;EACA,uBAAA;EACA,wBAAA;EACA,uBAAA;EACA,6BAAA;EACA,mCAAA;EACA,uBAAA;EACA,gBAAA;EACA,qBAAA;EACA,sBAAA;EACA,qBAAA;EACA,2BAAA;EACA,iCAAA;EACA,qBAAA;EACA,kBAAA;EACA,qBAAA;EACA,yBAAA;EACA,4BAAA;EACA,4BAAA;EACA,4BAAA;EACA,wBAAA;EACA,2BAAA;EACA,2BAAA;EACA,2BAAA;EACA,qBAAA;EACA,qBAAA;EACA,2BAAA;EACA,wBAAA;EACA,wBAAA;EACA,uBAAA;EACA,uBAAA;EACA,gBAAA;EACA,iBAAA;EAAA,CACC,IAAA;AAAA;AAAA,KAGS,yBAAA,GAA4B,OAAO,CAAC,iBAAA;AAAA,iBAuEhC,sBAAA,CAAuB,UAAkB;AAAA,iBAoBzC,uBAAA,CACd,KAAA,EAAO,eAAA,EACP,SAAA,GAAW,yBAAA,GACV,iBAAA;AAAA,iBAuFa,uBAAA,CAAwB,QAAA,UAAkB,SAAA,EAAW,iBAAiB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme-DFqneHw9.mjs","names":[],"sources":["../src/css.ts","../src/theme.ts"],"sourcesContent":["import type { ThemeDefinition } from './types'\n\nexport interface ThemeCssVariables {\n '--varo-ui-white': string\n '--varo-ui-black': string\n '--varo-ui-bg': string\n '--varo-ui-surface': string\n '--varo-ui-surface-muted': string\n '--varo-ui-surface-overlay': string\n '--varo-ui-text': string\n '--varo-ui-text-regular': string\n '--varo-ui-text-muted': string\n '--varo-ui-text-placeholder': string\n '--varo-ui-text-disabled': string\n '--varo-ui-border': string\n '--varo-ui-border-strong': string\n '--varo-ui-border-dark': string\n '--varo-ui-border-light': string\n '--varo-ui-border-lighter': string\n '--varo-ui-border-extra-light': string\n '--varo-ui-fill': string\n '--varo-ui-fill-darker': string\n '--varo-ui-fill-dark': string\n '--varo-ui-fill-light': string\n '--varo-ui-fill-lighter': string\n '--varo-ui-fill-extra-light': string\n '--varo-ui-primary': string\n '--varo-ui-primary-dark': string\n '--varo-ui-primary-hover': string\n '--varo-ui-primary-soft': string\n '--varo-ui-primary-foreground': string\n '--varo-ui-primary-hover-foreground': string\n '--varo-ui-primary-text': string\n '--varo-ui-success': string\n '--varo-ui-success-dark': string\n '--varo-ui-success-hover': string\n '--varo-ui-success-soft': string\n '--varo-ui-success-foreground': string\n '--varo-ui-success-hover-foreground': string\n '--varo-ui-success-text': string\n '--varo-ui-warning': string\n '--varo-ui-warning-dark': string\n '--varo-ui-warning-hover': string\n '--varo-ui-warning-soft': string\n '--varo-ui-warning-foreground': string\n '--varo-ui-warning-hover-foreground': string\n '--varo-ui-warning-text': string\n '--varo-ui-danger': string\n '--varo-ui-danger-dark': string\n '--varo-ui-danger-hover': string\n '--varo-ui-danger-soft': string\n '--varo-ui-danger-foreground': string\n '--varo-ui-danger-hover-foreground': string\n '--varo-ui-danger-text': string\n '--varo-ui-info': string\n '--varo-ui-info-dark': string\n '--varo-ui-info-hover': string\n '--varo-ui-info-soft': string\n '--varo-ui-info-foreground': string\n '--varo-ui-info-hover-foreground': string\n '--varo-ui-info-text': string\n '--varo-ui-radius': string\n '--varo-ui-radius-sm': string\n '--varo-ui-button-radius': string\n '--varo-ui-button-height-sm': string\n '--varo-ui-button-height-md': string\n '--varo-ui-button-height-lg': string\n '--varo-ui-input-radius': string\n '--varo-ui-input-height-sm': string\n '--varo-ui-input-height-md': string\n '--varo-ui-input-height-lg': string\n '--varo-ui-shadow-sm': string\n '--varo-ui-shadow-md': string\n '--varo-ui-motion-feedback': string\n '--varo-ui-motion-state': string\n '--varo-ui-motion-enter': string\n '--varo-ui-motion-exit': string\n '--varo-ui-motion-ease': string\n '--varo-ui-ring': string\n '--varo-ui-focus': string\n [name: `--${string}`]: string\n}\n\nexport type ThemeCssVariableOverrides = Partial<ThemeCssVariables>\n\nfunction colorWithAlpha(color: string, alpha: number): string {\n const value = color.slice(1)\n const normalized = value.length === 3\n ? value.split('').map(part => `${part}${part}`).join('')\n : value\n\n if (!color.startsWith('#') || !/^[\\da-f]{6}$/i.test(normalized)) {\n return color\n }\n\n const red = Number.parseInt(normalized.slice(0, 2), 16)\n const green = Number.parseInt(normalized.slice(2, 4), 16)\n const blue = Number.parseInt(normalized.slice(4, 6), 16)\n return `rgb(${red} ${green} ${blue} / ${alpha}%)`\n}\n\nfunction semanticTextColor(base: string, text: string): string {\n if (!/^#[\\da-f]{6}$/i.test(base) || !/^#[\\da-f]{6}$/i.test(text)) {\n return text\n }\n\n const channels = [1, 3, 5].map((offset) => {\n const baseChannel = Number.parseInt(base.slice(offset, offset + 2), 16)\n const textChannel = Number.parseInt(text.slice(offset, offset + 2), 16)\n return Math.round((baseChannel + textChannel) / 2)\n .toString(16)\n .padStart(2, '0')\n })\n\n return `#${channels.join('')}`\n}\n\nfunction relativeLuminance(color: string): number | undefined {\n const value = color.slice(1)\n const normalized = value.length === 3\n ? value.split('').map(part => `${part}${part}`).join('')\n : value\n\n if (!color.startsWith('#') || !/^[\\da-f]{6}$/i.test(normalized)) {\n return undefined\n }\n\n const channelLuminance = (offset: number) => {\n const channel = Number.parseInt(normalized.slice(offset, offset + 2), 16) / 255\n return channel <= 0.04045\n ? channel / 12.92\n : ((channel + 0.055) / 1.055) ** 2.4\n }\n return channelLuminance(0) * 0.2126\n + channelLuminance(2) * 0.7152\n + channelLuminance(4) * 0.0722\n}\n\nfunction isChromatic(color: string): boolean {\n const value = color.slice(1)\n const normalized = value.length === 3\n ? value.split('').map(part => `${part}${part}`).join('')\n : value\n\n if (!color.startsWith('#') || !/^[\\da-f]{6}$/i.test(normalized)) {\n return false\n }\n\n const red = Number.parseInt(normalized.slice(0, 2), 16)\n const green = Number.parseInt(normalized.slice(2, 4), 16)\n const blue = Number.parseInt(normalized.slice(4, 6), 16)\n return Math.max(red, green, blue) - Math.min(red, green, blue) >= 40\n}\n\nexport function contrastSafeForeground(background: string): '#000000' | '#ffffff' {\n const backgroundLuminance = relativeLuminance(background)\n if (backgroundLuminance == null) {\n throw new Error(`Contrast-safe foreground requires a hex color (#RGB or #RRGGBB): ${background}`)\n }\n\n const blackContrast = (backgroundLuminance + 0.05) / 0.05\n const whiteContrast = 1.05 / (backgroundLuminance + 0.05)\n\n if (backgroundLuminance >= 0.55) {\n return '#000000'\n }\n\n if (isChromatic(background)) {\n return '#ffffff'\n }\n\n return blackContrast >= whiteContrast ? '#000000' : '#ffffff'\n}\n\nexport function createThemeCssVariables(\n theme: ThemeDefinition,\n overrides: ThemeCssVariableOverrides = {},\n): ThemeCssVariables {\n return {\n '--varo-ui-white': theme.palette.neutral.white,\n '--varo-ui-black': theme.palette.neutral.black,\n '--varo-ui-bg': theme.semantic.surfaceElevated,\n '--varo-ui-surface': theme.semantic.surfaceBase,\n '--varo-ui-surface-muted': theme.semantic.fillLight,\n '--varo-ui-surface-overlay': theme.semantic.surfaceOverlay,\n '--varo-ui-text': theme.semantic.textBase,\n '--varo-ui-text-regular': theme.semantic.textRegular,\n '--varo-ui-text-muted': theme.semantic.textMuted,\n '--varo-ui-text-placeholder': theme.semantic.textPlaceholder,\n '--varo-ui-text-disabled': theme.semantic.textDisabled,\n '--varo-ui-border': theme.semantic.borderBase,\n '--varo-ui-border-strong': theme.semantic.borderStrong,\n '--varo-ui-border-dark': theme.palette.neutral['border-dark'],\n '--varo-ui-border-light': theme.semantic.borderLight,\n '--varo-ui-border-lighter': theme.semantic.borderLighter,\n '--varo-ui-border-extra-light': theme.palette.neutral['border-extra-light'],\n '--varo-ui-fill': theme.semantic.fillBase,\n '--varo-ui-fill-darker': theme.palette.neutral['fill-darker'],\n '--varo-ui-fill-dark': theme.palette.neutral['fill-dark'],\n '--varo-ui-fill-light': theme.semantic.fillLight,\n '--varo-ui-fill-lighter': theme.semantic.fillLighter,\n '--varo-ui-fill-extra-light': theme.palette.neutral['fill-extra-light'],\n '--varo-ui-primary': theme.semantic.primaryBase,\n '--varo-ui-primary-dark': theme.semantic.primaryDark,\n '--varo-ui-primary-hover': theme.semantic.primaryHover,\n '--varo-ui-primary-soft': theme.semantic.primarySoft,\n '--varo-ui-primary-foreground': contrastSafeForeground(theme.semantic.primaryBase),\n '--varo-ui-primary-hover-foreground': contrastSafeForeground(theme.semantic.primaryHover),\n '--varo-ui-primary-text': semanticTextColor(theme.semantic.primaryBase, theme.semantic.textBase),\n '--varo-ui-success': theme.semantic.successBase,\n '--varo-ui-success-dark': theme.semantic.successDark,\n '--varo-ui-success-hover': theme.semantic.successHover,\n '--varo-ui-success-soft': theme.semantic.successSoft,\n '--varo-ui-success-foreground': contrastSafeForeground(theme.semantic.successBase),\n '--varo-ui-success-hover-foreground': contrastSafeForeground(theme.semantic.successHover),\n '--varo-ui-success-text': semanticTextColor(theme.semantic.successBase, theme.semantic.textBase),\n '--varo-ui-warning': theme.semantic.warningBase,\n '--varo-ui-warning-dark': theme.semantic.warningDark,\n '--varo-ui-warning-hover': theme.semantic.warningHover,\n '--varo-ui-warning-soft': theme.semantic.warningSoft,\n '--varo-ui-warning-foreground': contrastSafeForeground(theme.semantic.warningBase),\n '--varo-ui-warning-hover-foreground': contrastSafeForeground(theme.semantic.warningHover),\n '--varo-ui-warning-text': semanticTextColor(theme.semantic.warningBase, theme.semantic.textBase),\n '--varo-ui-danger': theme.semantic.dangerBase,\n '--varo-ui-danger-dark': theme.semantic.dangerDark,\n '--varo-ui-danger-hover': theme.semantic.dangerHover,\n '--varo-ui-danger-soft': theme.semantic.dangerSoft,\n '--varo-ui-danger-foreground': contrastSafeForeground(theme.semantic.dangerBase),\n '--varo-ui-danger-hover-foreground': contrastSafeForeground(theme.semantic.dangerHover),\n '--varo-ui-danger-text': semanticTextColor(theme.semantic.dangerBase, theme.semantic.textBase),\n '--varo-ui-info': theme.semantic.infoBase,\n '--varo-ui-info-dark': theme.semantic.infoDark,\n '--varo-ui-info-hover': theme.semantic.infoHover,\n '--varo-ui-info-soft': theme.semantic.infoSoft,\n '--varo-ui-info-foreground': contrastSafeForeground(theme.semantic.infoBase),\n '--varo-ui-info-hover-foreground': contrastSafeForeground(theme.semantic.infoHover),\n '--varo-ui-info-text': semanticTextColor(theme.semantic.infoBase, theme.semantic.textBase),\n '--varo-ui-button-radius': theme.components.button.borderRadius,\n '--varo-ui-button-height-sm': theme.components.button.heightSm,\n '--varo-ui-button-height-md': theme.components.button.heightMd,\n '--varo-ui-button-height-lg': theme.components.button.heightLg,\n '--varo-ui-input-radius': theme.components.input.borderRadius,\n '--varo-ui-input-height-sm': theme.components.input.heightSm,\n '--varo-ui-input-height-md': theme.components.input.heightMd,\n '--varo-ui-input-height-lg': theme.components.input.heightLg,\n '--varo-ui-radius': 'var(--varo-ui-button-radius)',\n '--varo-ui-radius-sm': 'var(--varo-ui-input-radius)',\n '--varo-ui-shadow-sm': theme.seed.mode === 'dark'\n ? '0 1px 2px rgb(0 0 0 / 46%)'\n : '0 1px 2px rgb(48 49 51 / 6%)',\n '--varo-ui-shadow-md': theme.seed.mode === 'dark'\n ? '0 12px 32px 4px rgb(0 0 0 / 36%), 0 8px 20px rgb(0 0 0 / 72%)'\n : '0 12px 32px 4px rgb(0 0 0 / 4%), 0 8px 20px rgb(0 0 0 / 8%)',\n '--varo-ui-motion-feedback': '140ms',\n '--varo-ui-motion-state': '180ms',\n '--varo-ui-motion-enter': '220ms',\n '--varo-ui-motion-exit': '160ms',\n '--varo-ui-motion-ease': 'cubic-bezier(0.2, 0.8, 0.2, 1)',\n '--varo-ui-ring': colorWithAlpha(theme.semantic.primaryBase, 16),\n '--varo-ui-focus': contrastSafeForeground(theme.semantic.surfaceBase),\n ...overrides,\n }\n}\n\nexport function renderThemeCssVariables(selector: string, variables: ThemeCssVariables): string {\n const normalizedSelector = selector.trim()\n if (!normalizedSelector || /[{}]/.test(normalizedSelector)) {\n throw new Error(`Invalid theme CSS selector: ${selector}`)\n }\n\n const declarations = Object.entries(variables).map(([name, value]) => {\n if (/[;{}\\r\\n]/.test(value)) {\n throw new Error(`Invalid theme CSS variable value for ${name}`)\n }\n return ` ${name}: ${value};`\n })\n\n return `${normalizedSelector} {\\n${declarations.join('\\n')}\\n}`\n}\n","import type {\n ComponentTokens,\n SemanticTokens,\n ThemeDefinition,\n ThemeOverrides,\n ThemePalette,\n ThemeSeed,\n} from './types'\n\ninterface ColorScale {\n dark: string\n base: string\n light: string\n soft: string\n}\n\nconst REFERENCE_SCALES: Record<string, Omit<ColorScale, 'base'>> = {\n '#07c160': { dark: '#06ad56', light: '#38cd80', soft: '#e6f9ef' },\n '#007dff': { dark: '#006ad9', light: '#3397ff', soft: '#e5f2ff' },\n '#13b248': { dark: '#10973d', light: '#42c16d', soft: '#e7f7ec' },\n '#fa9200': { dark: '#d57c00', light: '#fba833', soft: '#fef4e5' },\n '#eb3437': { dark: '#c82c2f', light: '#ef5d5f', soft: '#fdeaeb' },\n '#73767a': { dark: '#5c5e62', light: '#8f9195', soft: '#f1f1f2' },\n}\n\nconst DARK_SOFT_COLORS: Record<string, string> = {\n '#07c160': '#122c1f',\n '#007dff': '#112335',\n '#13b248': '#142a1b',\n '#fa9200': '#342611',\n '#eb3437': '#321819',\n '#73767a': '#212222',\n}\n\nfunction mixHex(base: string, target: string, targetWeight: number): string {\n const normalizedBase = base.toLowerCase()\n if (!/^#[\\da-f]{6}$/.test(normalizedBase) || !/^#[\\da-f]{6}$/.test(target)) {\n return base\n }\n\n const channels = [1, 3, 5].map((offset) => {\n const baseChannel = Number.parseInt(normalizedBase.slice(offset, offset + 2), 16)\n const targetChannel = Number.parseInt(target.slice(offset, offset + 2), 16)\n return Math.round(baseChannel * (1 - targetWeight) + targetChannel * targetWeight)\n .toString(16)\n .padStart(2, '0')\n })\n\n return `#${channels.join('')}`\n}\n\nfunction createColorScale(base: string, mode: 'light' | 'dark'): Record<string, string> {\n const normalized = base.toLowerCase()\n const reference = REFERENCE_SCALES[normalized]\n const lightScale: ColorScale = reference\n ? { base, ...reference }\n : {\n base,\n dark: mixHex(base, '#000000', 0.15),\n light: mixHex(base, '#ffffff', 0.2),\n soft: mixHex(base, '#ffffff', 0.9),\n }\n const scale = mode === 'dark'\n ? {\n ...lightScale,\n soft: DARK_SOFT_COLORS[normalized] ?? mixHex(base, '#141414', 0.86),\n }\n : lightScale\n\n return {\n ...scale,\n 50: scale.soft,\n 500: scale.base,\n 600: scale.dark,\n }\n}\n\nexport function createPalette(seed: ThemeSeed): ThemePalette {\n const mode = seed.mode ?? 'light'\n const neutral = mode === 'dark'\n ? {\n '0': '#141414',\n '50': '#1d1d1d',\n '100': '#262727',\n '200': '#4c4d4f',\n '300': '#636466',\n '400': '#8d9095',\n '500': '#a3a6ad',\n '600': '#cfd3dc',\n '900': '#e5eaf3',\n '1000': '#e5eaf3',\n 'white': '#ffffff',\n 'black': '#000000',\n 'text-primary': '#e5eaf3',\n 'text-regular': '#cfd3dc',\n 'text-secondary': '#a3a6ad',\n 'text-placeholder': '#8d9095',\n 'text-disabled': '#6c6e72',\n 'border-darker': '#636466',\n 'border-dark': '#58585a',\n 'border-base': '#4c4d4f',\n 'border-light': '#414243',\n 'border-lighter': '#363637',\n 'border-extra-light': '#2a2b2c',\n 'fill-darker': '#424243',\n 'fill-dark': '#39393a',\n 'fill-base': '#303030',\n 'fill-light': '#262727',\n 'fill-lighter': '#1d1d1d',\n 'fill-extra-light': '#191919',\n 'bg-page': '#0a0a0a',\n 'bg-base': '#141414',\n 'bg-overlay': '#1d1e1f',\n }\n : {\n '0': '#ffffff',\n '50': '#fafafa',\n '100': '#f5f7fa',\n '200': '#dcdfe6',\n '300': '#cdd0d6',\n '400': '#a8abb2',\n '500': '#909399',\n '600': '#606266',\n '900': seed.neutral,\n '1000': seed.neutral,\n 'white': '#ffffff',\n 'black': '#000000',\n 'text-primary': seed.neutral,\n 'text-regular': '#606266',\n 'text-secondary': '#909399',\n 'text-placeholder': '#a8abb2',\n 'text-disabled': '#c0c4cc',\n 'border-darker': '#cdd0d6',\n 'border-dark': '#d4d7de',\n 'border-base': '#dcdfe6',\n 'border-light': '#e4e7ed',\n 'border-lighter': '#ebeef5',\n 'border-extra-light': '#f2f6fc',\n 'fill-darker': '#e6e8eb',\n 'fill-dark': '#ebedf0',\n 'fill-base': '#f0f2f5',\n 'fill-light': '#f5f7fa',\n 'fill-lighter': '#fafafa',\n 'fill-extra-light': '#fafcff',\n 'bg-page': '#f2f3f5',\n 'bg-base': '#ffffff',\n 'bg-overlay': '#ffffff',\n }\n\n return {\n primary: createColorScale(seed.primary, mode),\n success: createColorScale(seed.success, mode),\n warning: createColorScale(seed.warning, mode),\n error: createColorScale(seed.error, mode),\n info: createColorScale(seed.info ?? '#73767a', mode),\n neutral,\n }\n}\n\nexport function createSemanticTokens(palette: ThemePalette): SemanticTokens {\n return {\n textBase: palette.neutral['text-primary'],\n textRegular: palette.neutral['text-regular'],\n textMuted: palette.neutral['text-secondary'],\n textPlaceholder: palette.neutral['text-placeholder'],\n textDisabled: palette.neutral['text-disabled'],\n surfaceBase: palette.neutral['bg-base'],\n surfaceElevated: palette.neutral['bg-page'],\n surfaceOverlay: palette.neutral['bg-overlay'],\n fillBase: palette.neutral['fill-base'],\n fillLight: palette.neutral['fill-light'],\n fillLighter: palette.neutral['fill-lighter'],\n borderBase: palette.neutral['border-base'],\n borderStrong: palette.neutral['border-darker'],\n borderLight: palette.neutral['border-light'],\n borderLighter: palette.neutral['border-lighter'],\n primaryBase: palette.primary.base,\n primaryDark: palette.primary.dark,\n primaryHover: palette.primary.light,\n primarySoft: palette.primary.soft,\n successBase: palette.success.base,\n successDark: palette.success.dark,\n successHover: palette.success.light,\n successSoft: palette.success.soft,\n warningBase: palette.warning.base,\n warningDark: palette.warning.dark,\n warningHover: palette.warning.light,\n warningSoft: palette.warning.soft,\n dangerBase: palette.error.base,\n dangerDark: palette.error.dark,\n dangerHover: palette.error.light,\n dangerSoft: palette.error.soft,\n infoBase: palette.info.base,\n infoDark: palette.info.dark,\n infoHover: palette.info.light,\n infoSoft: palette.info.soft,\n }\n}\n\nexport function createComponentTokens(semantic: SemanticTokens): ComponentTokens {\n return {\n button: {\n borderRadius: '12px',\n heightSm: '36px',\n heightMd: '44px',\n heightLg: '48px',\n },\n dialog: {\n borderRadius: '16px',\n overlayColor: semantic.borderStrong,\n },\n input: {\n borderRadius: '12px',\n heightSm: '36px',\n heightMd: '44px',\n heightLg: '48px',\n },\n }\n}\n\nexport function createTheme(seed: ThemeSeed): ThemeDefinition {\n const palette = createPalette(seed)\n const semantic = createSemanticTokens(palette)\n const components = createComponentTokens(semantic)\n\n return {\n seed,\n palette,\n semantic,\n components,\n }\n}\n\nexport function mergeThemeOverrides(theme: ThemeDefinition, overrides: ThemeOverrides = {}): ThemeDefinition {\n return {\n ...theme,\n semantic: {\n ...theme.semantic,\n ...overrides.semantic,\n },\n components: {\n button: {\n ...theme.components.button,\n ...overrides.components?.button,\n },\n dialog: {\n ...theme.components.dialog,\n ...overrides.components?.dialog,\n },\n input: {\n ...theme.components.input,\n ...overrides.components?.input,\n },\n },\n }\n}\n"],"mappings":";AAqFA,SAAS,eAAe,OAAe,OAAuB;CAC5D,MAAM,QAAQ,MAAM,MAAM,CAAC;CAC3B,MAAM,aAAa,MAAM,WAAW,IAChC,MAAM,MAAM,EAAE,CAAC,CAAC,KAAI,SAAQ,GAAG,OAAO,MAAM,CAAC,CAAC,KAAK,EAAE,IACrD;CAEJ,IAAI,CAAC,MAAM,WAAW,GAAG,KAAK,CAAC,gBAAgB,KAAK,UAAU,GAC5D,OAAO;CAMT,OAAO,OAHK,OAAO,SAAS,WAAW,MAAM,GAAG,CAAC,GAAG,EAGpC,EAAE,GAFJ,OAAO,SAAS,WAAW,MAAM,GAAG,CAAC,GAAG,EAE7B,EAAE,GADd,OAAO,SAAS,WAAW,MAAM,GAAG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