@veltra/styles 1.7.12 → 1.7.15

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.
@@ -6,19 +6,18 @@
6
6
  * (dark 深底浅字 / light 浅底深字,默认 dark)与 `nav` 覆盖项注入,见 `ui-theme.ts`。
7
7
  */
8
8
  /** 与 SCSS `fn.use-var($basename, $nodes...)` 输出一致 */
9
- declare function themeTokenVar(basename: string, ...nodes: Array<string | number>): string;
9
+ export declare function themeTokenVar(basename: string, ...nodes: Array<string | number>): string;
10
10
  /** 亮色(及与暗色相同的尺寸类)下组件 token */
11
- declare const componentCssVarsLight: Record<string, string>;
11
+ export declare const componentCssVarsLight: Record<string, string>;
12
12
  /** 暗色下组件 token(含与亮色相同的尺寸项,保证暗色 html 块自洽) */
13
- declare const componentCssVarsDark: Record<string, string>;
14
- declare const componentCssVarsLightDecls: string[];
15
- declare const componentCssVarsDarkDecls: string[];
13
+ export declare const componentCssVarsDark: Record<string, string>;
14
+ export declare const componentCssVarsLightDecls: string[];
15
+ export declare const componentCssVarsDarkDecls: string[];
16
16
  /** 侧栏外观变体:dark 深底浅字 / light 浅底深字 */
17
- type NavSidebarVariant = 'dark' | 'light';
17
+ export type NavSidebarVariant = 'dark' | 'light';
18
18
  /** 某主题系列 + 侧栏变体下的 nav 外观 token(键为 `--u-nav-*`) */
19
- declare function navSidebarTokens(series: 'light' | 'dark', variant: NavSidebarVariant): Record<string, string>;
19
+ export declare function navSidebarTokens(series: 'light' | 'dark', variant: NavSidebarVariant): Record<string, string>;
20
20
  /** 解析某主题系列 + 侧栏变体下的 nav 外观 token 声明列表 */
21
- declare function resolveNavSidebarDecls(series: 'light' | 'dark', variant: NavSidebarVariant): string[];
21
+ export declare function resolveNavSidebarDecls(series: 'light' | 'dark', variant: NavSidebarVariant): string[];
22
22
  //#endregion
23
- export { NavSidebarVariant, componentCssVarsDark, componentCssVarsDarkDecls, componentCssVarsLight, componentCssVarsLightDecls, navSidebarTokens, resolveNavSidebarDecls, themeTokenVar };
24
23
  //# sourceMappingURL=component-css-vars.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { RGBColor } from "./type.js";
2
2
  //#region src/theme/helper.d.ts
3
3
  /** 实现十六进制颜色转RGB颜色,包括透明度 */
4
- declare function HEXToRGB(color: string): RGBColor;
4
+ export declare function HEXToRGB(color: string): RGBColor;
5
5
  /**
6
6
  * 混合两个颜色,并返回混合结果的十六进制表示。
7
7
  * @param color1 - 第一个颜色,格式为`#RRGGBB`。
@@ -9,21 +9,20 @@ declare function HEXToRGB(color: string): RGBColor;
9
9
  * @param ratio - 颜色混合的比例,取值范围为0到1。
10
10
  * @returns 混合结果的十六进制表示。
11
11
  */
12
- declare function mixColor(color1: `#${string}`, color2: `#${string}`, ratio: number): string;
12
+ export declare function mixColor(color1: `#${string}`, color2: `#${string}`, ratio: number): string;
13
13
  /** 将 `#RRGGBB` 转为指定不透明度百分比的 `rgba()`(等价于 color-mix N% + transparent) */
14
- declare function hexWithAlpha(hex: `#${string}`, alphaPercent: number): string;
14
+ export declare function hexWithAlpha(hex: `#${string}`, alphaPercent: number): string;
15
15
  /** 别名:`ratio` 为 0–1 时不透明度(0.08 → 8%) */
16
- declare function mixColorWithAlpha(color: `#${string}`, ratio: number): string;
16
+ export declare function mixColorWithAlpha(color: `#${string}`, ratio: number): string;
17
17
  /** 剥离 `#RRGGBBAA` 的 alpha 通道,返回 `#RRGGBB` */
18
- declare function hexRgbOnly(hex: string): `#${string}`;
18
+ export declare function hexRgbOnly(hex: string): `#${string}`;
19
19
  /** 校验是否为 `#RRGGBB` 形式的 6 位 hex 颜色 */
20
- declare function isHexColor(value: string): value is `#${string}`;
21
- declare function defineBySize(variable: Record<'small' | 'default' | 'large', number>): Record<'small' | 'default' | 'large', number>;
20
+ export declare function isHexColor(value: string): value is `#${string}`;
21
+ export declare function defineBySize(variable: Record<'small' | 'default' | 'large', number>): Record<'small' | 'default' | 'large', number>;
22
22
  /**
23
23
  * 引用全局主题 CSS 变量(`--u-*` 命名空间)
24
24
  * @param prop - 与 Theme 结构对应的连字符路径,如 `text-color-title`、`bg-color-hover`
25
25
  */
26
- declare function cssVar(prop: string): string;
26
+ export declare function cssVar(prop: string): string;
27
27
  //#endregion
28
- export { HEXToRGB, cssVar, defineBySize, hexRgbOnly, hexWithAlpha, isHexColor, mixColor, mixColorWithAlpha };
29
28
  //# sourceMappingURL=helper.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import { UITheme } from "./ui-theme.js";
2
2
  import { ShallowRef } from "vue";
3
3
  //#region src/theme/load-theme.d.ts
4
- declare const currentTheme: ShallowRef<UITheme | undefined>;
4
+ export declare const currentTheme: ShallowRef<UITheme | undefined>;
5
5
  /**
6
6
  * @description 加载主题, 如果你是 SSR 环境,
7
7
  * 请在 `onMounted` 中调用,否则你可以在
@@ -10,7 +10,6 @@ declare const currentTheme: ShallowRef<UITheme | undefined>;
10
10
  * 主题自带系列(`theme.series`),应用时会注入全局 token 与
11
11
  * 同系列的组件级 token,并把 `html[data-theme]` 置为对应系列。
12
12
  */
13
- declare function loadTheme(theme?: UITheme): void;
13
+ export declare function loadTheme(theme?: UITheme): void;
14
14
  //#endregion
15
- export { currentTheme, loadTheme };
16
15
  //# sourceMappingURL=load-theme.d.ts.map
@@ -2,7 +2,6 @@ import { UITheme } from "../ui-theme.js";
2
2
  import "../index.js";
3
3
  //#region src/theme/presets/ancient.d.ts
4
4
  /** 古风(松烟绿 + 宣纸底),天生适合浅色 */
5
- declare const ancientTheme: UITheme;
5
+ export declare const ancientTheme: UITheme;
6
6
  //#endregion
7
- export { ancientTheme };
8
7
  //# sourceMappingURL=ancient.d.ts.map
@@ -1,7 +1,6 @@
1
1
  import { UITheme } from "../ui-theme.js";
2
2
  import "../index.js";
3
3
  //#region src/theme/presets/dark.d.ts
4
- declare const darkTheme: UITheme;
4
+ export declare const darkTheme: UITheme;
5
5
  //#endregion
6
- export { darkTheme };
7
6
  //# sourceMappingURL=dark.d.ts.map
@@ -6,7 +6,6 @@ import "../index.js";
6
6
  * 背景为 rgba() 时派生 token(kbd / batch-edit 混合色)无法自动推导,
7
7
  * 需通过组件级扩展键显式声明。
8
8
  */
9
- declare const glassTheme: UITheme;
9
+ export declare const glassTheme: UITheme;
10
10
  //#endregion
11
- export { glassTheme };
12
11
  //# sourceMappingURL=glass.d.ts.map
@@ -2,7 +2,6 @@ import { UITheme } from "../ui-theme.js";
2
2
  import "../index.js";
3
3
  //#region src/theme/presets/hero.d.ts
4
4
  /** HeroUI 风格,天生适合浅色 */
5
- declare const heroTheme: UITheme;
5
+ export declare const heroTheme: UITheme;
6
6
  //#endregion
7
- export { heroTheme };
8
7
  //# sourceMappingURL=hero.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { UITheme } from "../ui-theme.js";
2
2
  //#region src/theme/presets/light.d.ts
3
- declare const lightTheme: UITheme;
3
+ export declare const lightTheme: UITheme;
4
4
  //#endregion
5
- export { lightTheme };
6
5
  //# sourceMappingURL=light.d.ts.map
@@ -2,7 +2,6 @@ import { UITheme } from "../ui-theme.js";
2
2
  import "../index.js";
3
3
  //#region src/theme/presets/midnight.d.ts
4
4
  /** 午夜(靛蓝 + 深空底,宽松间距、舒缓缓动),天生适合深色 */
5
- declare const midnightTheme: UITheme;
5
+ export declare const midnightTheme: UITheme;
6
6
  //#endregion
7
- export { midnightTheme };
8
7
  //# sourceMappingURL=midnight.d.ts.map
@@ -2,7 +2,6 @@ import { UITheme } from "../ui-theme.js";
2
2
  import "../index.js";
3
3
  //#region src/theme/presets/neon.d.ts
4
4
  /** 霓虹(品红 + 夜紫底 + 辉光阴影,小圆角、急速缓动),天生适合深色 */
5
- declare const neonTheme: UITheme;
5
+ export declare const neonTheme: UITheme;
6
6
  //#endregion
7
- export { neonTheme };
8
7
  //# sourceMappingURL=neon.d.ts.map
@@ -2,7 +2,6 @@ import { UITheme } from "../ui-theme.js";
2
2
  import "../index.js";
3
3
  //#region src/theme/presets/ocean.d.ts
4
4
  /** 海盐(松石青 + 冷白底,利落的快缓动),天生适合浅色 */
5
- declare const oceanTheme: UITheme;
5
+ export declare const oceanTheme: UITheme;
6
6
  //#endregion
7
- export { oceanTheme };
8
7
  //# sourceMappingURL=ocean.d.ts.map
@@ -2,7 +2,6 @@ import { UITheme } from "../ui-theme.js";
2
2
  import "../index.js";
3
3
  //#region src/theme/presets/sakura.d.ts
4
4
  /** 樱花(柔粉 + 花瓣底,大圆角、弹性缓动),天生适合浅色 */
5
- declare const sakuraTheme: UITheme;
5
+ export declare const sakuraTheme: UITheme;
6
6
  //#endregion
7
- export { sakuraTheme };
8
7
  //# sourceMappingURL=sakura.d.ts.map
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * RGB颜色[红,绿,蓝]
4
4
  */
5
- type RGBColor = [number, number, number];
5
+ export type RGBColor = [number, number, number];
6
6
  /** 仅含全局 token;组件级 `--u-*` 由 `theme/component-css-vars.ts` 随 `loadTheme` 注入 */
7
- type Theme = {
7
+ export type Theme = {
8
8
  /** 主题色 */
9
9
  color: {
10
10
  /** 主要颜色 */
@@ -195,5 +195,4 @@ type Theme = {
195
195
  [key: string]: any;
196
196
  };
197
197
  //#endregion
198
- export { RGBColor, Theme };
199
198
  //# sourceMappingURL=type.d.ts.map
@@ -2,14 +2,14 @@ import { Theme } from "./type.js";
2
2
  //#region src/theme/ui-theme.d.ts
3
3
  type RecursivePartial<T> = { [P in keyof T]?: T[P] extends object ? RecursivePartial<T[P]> : T[P]; };
4
4
  /** 主题系列:浅色或深色。决定组件级 token 与 html[data-theme] */
5
- type ThemeSeries = 'light' | 'dark';
6
- interface UIThemeOptions {
5
+ export type ThemeSeries = 'light' | 'dark';
6
+ export interface UIThemeOptions {
7
7
  /** 主题变更时是否自动重渲染,默认 true */
8
8
  reactive?: boolean;
9
9
  /** 主题所属系列,默认 'light' */
10
10
  series?: ThemeSeries;
11
11
  }
12
- declare class UITheme {
12
+ export declare class UITheme {
13
13
  static themeID: string;
14
14
  private static adoptedSheet;
15
15
  readonly theme: Theme;
@@ -44,5 +44,4 @@ declare class UITheme {
44
44
  }): UITheme;
45
45
  }
46
46
  //#endregion
47
- export { ThemeSeries, UITheme, UIThemeOptions };
48
47
  //# sourceMappingURL=ui-theme.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/styles",
3
- "version": "1.7.12",
3
+ "version": "1.7.15",
4
4
  "homepage": "https://github.com/cabinet-fe/ultra-ui#readme",
5
5
  "bugs": {
6
6
  "url": "https://github.com/cabinet-fe/ultra-ui/issues"
@@ -51,8 +51,8 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@cat-kit/core": ">=1.2.1",
54
- "@veltra/compositions": "^1.7.12",
55
- "@veltra/utils": "^1.7.12",
54
+ "@veltra/compositions": "^1.7.14",
55
+ "@veltra/utils": "^1.7.14",
56
56
  "vue": ">=3.5.42"
57
57
  }
58
58
  }