@veltra/styles 1.1.14 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/README.md +42 -0
  2. package/dist/_functions.scss +6 -5
  3. package/dist/_mixins.scss +6 -5
  4. package/dist/_vars.scss +1 -16
  5. package/dist/normalize/index.js +1 -0
  6. package/dist/{normalize2.css → normalize/normalize.css} +0 -17
  7. package/dist/theme/component-css-vars.js +1 -1
  8. package/dist/theme/component-css-vars.js.map +1 -1
  9. package/dist/theme/helper.js +1 -8
  10. package/dist/theme/helper.js.map +1 -1
  11. package/dist/theme/index.d.ts +7 -9
  12. package/dist/theme/index.js +7 -9
  13. package/dist/{load-theme.d.ts → theme/load-theme.d.ts} +2 -2
  14. package/dist/{load-theme.js → theme/load-theme.js} +4 -4
  15. package/dist/theme/load-theme.js.map +1 -0
  16. package/dist/theme/presets/dark.d.ts +6 -0
  17. package/dist/theme/{dark.js → presets/dark.js} +1 -1
  18. package/dist/theme/presets/dark.js.map +1 -0
  19. package/dist/theme/{glass.d.ts → presets/glass.d.ts} +2 -3
  20. package/dist/theme/{glass.js → presets/glass.js} +1 -1
  21. package/dist/theme/presets/glass.js.map +1 -0
  22. package/dist/theme/{hero.d.ts → presets/hero.d.ts} +2 -3
  23. package/dist/theme/{hero.js → presets/hero.js} +1 -1
  24. package/dist/theme/presets/hero.js.map +1 -0
  25. package/dist/theme/presets/light.d.ts +7 -0
  26. package/dist/theme/{light.js → presets/light.js} +3 -3
  27. package/dist/theme/presets/light.js.map +1 -0
  28. package/dist/theme/{shadcn.d.ts → presets/shadcn.d.ts} +2 -3
  29. package/dist/theme/{shadcn.js → presets/shadcn.js} +1 -1
  30. package/dist/theme/presets/shadcn.js.map +1 -0
  31. package/dist/theme/ui-theme.js.map +1 -1
  32. package/dist/transitions/fade.css +9 -0
  33. package/dist/transitions/index.js +4 -0
  34. package/dist/transitions/slide.css +18 -0
  35. package/dist/transitions/spring.css +34 -0
  36. package/dist/transitions/zoom-in.css +57 -0
  37. package/package.json +11 -36
  38. package/src/_functions.scss +6 -5
  39. package/src/_mixins.scss +6 -5
  40. package/src/_vars.scss +1 -16
  41. package/{dist → src/normalize}/normalize.scss +2 -4
  42. package/src/theme/__test__/ui-theme.test.ts +1 -1
  43. package/src/theme/index.ts +6 -15
  44. package/src/{load-theme.ts → theme/load-theme.ts} +2 -3
  45. package/src/theme/presets/index.ts +5 -0
  46. package/src/theme/{light.ts → presets/light.ts} +2 -2
  47. package/dist/index.js +0 -0
  48. package/dist/load-theme.js.map +0 -1
  49. package/dist/normalize.js +0 -1
  50. package/dist/theme/component-css-vars.d.ts +0 -16
  51. package/dist/theme/dark.d.ts +0 -7
  52. package/dist/theme/dark.js.map +0 -1
  53. package/dist/theme/glass.js.map +0 -1
  54. package/dist/theme/helper.d.ts +0 -22
  55. package/dist/theme/hero.js.map +0 -1
  56. package/dist/theme/light.d.ts +0 -7
  57. package/dist/theme/light.js.map +0 -1
  58. package/dist/theme/shadcn.js.map +0 -1
  59. package/src/index.ts +0 -2
  60. package/src/normalize.scss +0 -63
  61. /package/dist/{index.d.ts → normalize/index.d.ts} +0 -0
  62. /package/dist/{anime → transitions}/fade.scss +0 -0
  63. /package/dist/{normalize.d.ts → transitions/index.d.ts} +0 -0
  64. /package/dist/{anime → transitions}/slide.scss +0 -0
  65. /package/dist/{anime → transitions}/spring.scss +0 -0
  66. /package/dist/{anime → transitions}/zoom-in.scss +0 -0
  67. /package/src/{normalize.ts → normalize/index.ts} +0 -0
  68. /package/src/theme/{dark.ts → presets/dark.ts} +0 -0
  69. /package/src/theme/{glass.ts → presets/glass.ts} +0 -0
  70. /package/src/theme/{hero.ts → presets/hero.ts} +0 -0
  71. /package/src/theme/{shadcn.ts → presets/shadcn.ts} +0 -0
  72. /package/src/{anime → transitions}/fade.scss +0 -0
  73. /package/src/{anime → transitions}/index.ts +0 -0
  74. /package/src/{anime → transitions}/slide.scss +0 -0
  75. /package/src/{anime → transitions}/spring.scss +0 -0
  76. /package/src/{anime → transitions}/zoom-in.scss +0 -0
@@ -0,0 +1,18 @@
1
+ .slide-down-enter-from, .slide-down-leave-to,
2
+ .slide-up-enter-from,
3
+ .slide-up-leave-to {
4
+ opacity: 0;
5
+ }
6
+ .slide-down-enter-active, .slide-down-leave-active,
7
+ .slide-up-enter-active,
8
+ .slide-up-leave-active {
9
+ transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1), opacity 0.2s cubic-bezier(0, 0, 0.2, 1);
10
+ }
11
+
12
+ .slide-down-enter-from, .slide-down-leave-to {
13
+ transform: translateY(-10px);
14
+ }
15
+
16
+ .slide-up-enter-from, .slide-up-leave-to {
17
+ transform: translateY(10px);
18
+ }
@@ -0,0 +1,34 @@
1
+ @keyframes spring-in {
2
+ 0% {
3
+ scale: 0;
4
+ }
5
+ 40% {
6
+ scale: 1.1;
7
+ }
8
+ 60% {
9
+ scale: 1;
10
+ }
11
+ 80% {
12
+ scale: 1.02;
13
+ }
14
+ 100% {
15
+ scale: 1;
16
+ }
17
+ }
18
+ .spring-enter-active {
19
+ transform-origin: center;
20
+ will-change: scale;
21
+ animation: spring-in 0.5s ease-in-out;
22
+ }
23
+
24
+ .spring-leave-active {
25
+ transform-origin: center;
26
+ will-change: scale, translate, opacity;
27
+ transition: scale 0.4s cubic-bezier(0.64, -0.32, 0.66, 1.06), translate 0.4s cubic-bezier(0.64, -0.32, 0.66, 1.06), opacity 0.4s cubic-bezier(0.64, -0.32, 0.66, 1.06);
28
+ }
29
+
30
+ .spring-leave-to {
31
+ scale: 0;
32
+ translate: 0 0 !important;
33
+ opacity: 0;
34
+ }
@@ -0,0 +1,57 @@
1
+ .zoom-in-enter-from, .zoom-in-leave-to,
2
+ .zoom-in-left-enter-from,
3
+ .zoom-in-left-leave-to,
4
+ .zoom-in-right-enter-from,
5
+ .zoom-in-right-leave-to,
6
+ .zoom-in-top-enter-from,
7
+ .zoom-in-top-leave-to,
8
+ .zoom-in-bottom-enter-from,
9
+ .zoom-in-bottom-leave-to {
10
+ opacity: 0;
11
+ }
12
+ .zoom-in-enter-active,
13
+ .zoom-in-left-enter-active,
14
+ .zoom-in-right-enter-active,
15
+ .zoom-in-top-enter-active,
16
+ .zoom-in-bottom-enter-active {
17
+ transition: opacity 0.15s ease-in, transform 0.15s ease-in;
18
+ }
19
+ .zoom-in-leave-active,
20
+ .zoom-in-left-leave-active,
21
+ .zoom-in-right-leave-active,
22
+ .zoom-in-top-leave-active,
23
+ .zoom-in-bottom-leave-active {
24
+ transition: opacity 0.15s ease-out, transform 0.15s ease-out;
25
+ }
26
+
27
+ .zoom-in-left-enter-from, .zoom-in-left-leave-to,
28
+ .zoom-in-right-enter-from,
29
+ .zoom-in-right-leave-to {
30
+ transform: scaleX(0.8);
31
+ }
32
+
33
+ .zoom-in-top-enter-from, .zoom-in-top-leave-to,
34
+ .zoom-in-bottom-enter-from,
35
+ .zoom-in-bottom-leave-to {
36
+ transform: scaleY(0.8);
37
+ }
38
+
39
+ .zoom-in-enter-from, .zoom-in-leave-to {
40
+ transform: scale(0.8);
41
+ }
42
+
43
+ .zoom-in-left-enter-active, .zoom-in-left-leave-active {
44
+ transform-origin: left center;
45
+ }
46
+
47
+ .zoom-in-right-enter-active, .zoom-in-right-leave-active {
48
+ transform-origin: right center;
49
+ }
50
+
51
+ .zoom-in-top-enter-active, .zoom-in-top-leave-active {
52
+ transform-origin: center top;
53
+ }
54
+
55
+ .zoom-in-bottom-enter-active, .zoom-in-bottom-leave-active {
56
+ transform-origin: center bottom;
57
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veltra/styles",
3
- "version": "1.1.14",
3
+ "version": "1.1.18",
4
4
  "files": [
5
5
  "dist",
6
6
  "src"
@@ -14,35 +14,13 @@
14
14
  "src/theme/index.ts"
15
15
  ],
16
16
  "exports": {
17
- ".": {
18
- "types": "./dist/index.d.ts",
19
- "import": "./dist/index.js",
20
- "default": "./dist/index.js"
17
+ "./transitions": {
18
+ "import": "./dist/transitions/index.js",
19
+ "default": "./dist/transitions/index.js"
21
20
  },
22
21
  "./normalize": {
23
- "sass": "./src/normalize.scss",
24
- "import": "./dist/normalize.js",
25
- "default": "./dist/normalize.js"
26
- },
27
- "./mixins": {
28
- "sass": "./src/_mixins.scss",
29
- "import": "./src/_mixins.scss",
30
- "default": "./src/_mixins.scss"
31
- },
32
- "./vars": {
33
- "sass": "./src/_vars.scss",
34
- "import": "./src/_vars.scss",
35
- "default": "./src/_vars.scss"
36
- },
37
- "./functions": {
38
- "sass": "./src/_functions.scss",
39
- "import": "./src/_functions.scss",
40
- "default": "./src/_functions.scss"
41
- },
42
- "./anime/*": {
43
- "sass": "./src/anime/*",
44
- "import": "./src/anime/*",
45
- "default": "./src/anime/*"
22
+ "import": "./dist/normalize/index.js",
23
+ "default": "./dist/normalize/index.js"
46
24
  },
47
25
  "./theme": {
48
26
  "types": "./dist/theme/index.d.ts",
@@ -56,15 +34,12 @@
56
34
  }
57
35
  },
58
36
  "scripts": {
59
- "build": "tsdown",
60
- "check-types": "tsc -p tsconfig.json --noEmit"
61
- },
62
- "dependencies": {
63
- "@cat-kit/core": "^1.1.3",
64
- "@veltra/compositions": "1.1.14",
65
- "@veltra/utils": "1.1.14"
37
+ "build": "vp pack"
66
38
  },
67
39
  "peerDependencies": {
68
- "vue": "^3.5.33"
40
+ "@cat-kit/core": ">=1.1.0",
41
+ "@veltra/compositions": "1.1.18",
42
+ "@veltra/utils": "1.1.18",
43
+ "vue": ">=3.5.0"
69
44
  }
70
45
  }
@@ -1,5 +1,6 @@
1
- @use 'vars';
1
+ @forward 'vars';
2
2
  @use 'sass:list';
3
+ @use 'vars' as *;
3
4
 
4
5
  // 使用单个变量(全局主题 token,`--u-*`)
5
6
  @function use-var($basename, $nodes...) {
@@ -9,16 +10,16 @@
9
10
  $suffix: $suffix + '-' + $node;
10
11
  }
11
12
 
12
- @return var(--u-#{$basename}#{$suffix});
13
+ @return var(--#{$namespace}-#{$basename}#{$suffix});
13
14
  }
14
15
 
15
16
  // 组件级 token:`var(--u-{component}-{property}[, fallback])`
16
17
  @function component-var($component, $property, $fallback: null) {
17
18
  @if $fallback == null {
18
- @return var(--u-#{$component}-#{$property});
19
+ @return var(--#{$namespace}-#{$component}-#{$property});
19
20
  }
20
21
 
21
- @return var(--u-#{$component}-#{$property}, #{$fallback});
22
+ @return var(--#{$namespace}-#{$component}-#{$property}, #{$fallback});
22
23
  }
23
24
 
24
25
  // 使用多个变量
@@ -36,7 +37,7 @@
36
37
 
37
38
  // bem的函数
38
39
  @function bem($b, $e: null, $m: null) {
39
- $b: '.' + vars.$namespace + $b;
40
+ $b: '.' + $namespace + '-' + $b;
40
41
  @if ($e != null) {
41
42
  $b: $b + '__' + $e;
42
43
  }
package/src/_mixins.scss CHANGED
@@ -1,6 +1,7 @@
1
- @use 'vars';
1
+ @forward 'vars';
2
2
  @use 'sass:list';
3
3
  @use 'sass:map';
4
+ @use 'vars' as *;
4
5
  @use 'functions' as fn;
5
6
 
6
7
  /** flex布局 */
@@ -12,7 +13,7 @@
12
13
  }
13
14
 
14
15
  @mixin size {
15
- @each $size in vars.$sizes {
16
+ @each $size in $sizes {
16
17
  &--#{$size} {
17
18
  @content ($size);
18
19
  }
@@ -21,7 +22,7 @@
21
22
 
22
23
  @mixin b($blocks...) {
23
24
  @each $block in $blocks {
24
- .#{vars.$namespace}#{$block} {
25
+ .#{$namespace}-#{$block} {
25
26
  @content;
26
27
  }
27
28
  }
@@ -87,7 +88,7 @@
87
88
  }
88
89
 
89
90
  @mixin bem($b, $e: null, $m: null) {
90
- $b: '.' + vars.$namespace + $b;
91
+ $b: '.' + $namespace + '-' + $b;
91
92
 
92
93
  @if ($e != null) {
93
94
  @each $ei in $e {
@@ -142,7 +143,7 @@
142
143
  }
143
144
 
144
145
  @function breakpoint($point) {
145
- @return var(--u-breakpoint-#{$point});
146
+ @return var(--#{$namespace}-breakpoint-#{$point});
146
147
  }
147
148
 
148
149
  /** 暗色:data-theme 与系统偏好,与 UITheme.injectBuiltInThemes 选择器策略一致 */
package/src/_vars.scss CHANGED
@@ -1,6 +1,6 @@
1
1
  @use 'sass:map';
2
2
 
3
- $namespace: 'u-';
3
+ $namespace: 'u' !default;
4
4
 
5
5
  // 与全局 CSS 变量对齐的语义化别名(便于 SCSS 中直接引用)
6
6
  $color-primary: var(--u-color-primary);
@@ -9,21 +9,6 @@ $border-color: var(--u-border-color);
9
9
  $border-muted-color: var(--u-border-muted-color);
10
10
  $bg-color-top: var(--u-bg-color-top);
11
11
 
12
- // 定义size映射的函数, 保证尺寸的统一性, size-vars(small, default, large)
13
- // 例子:
14
- // size-vars((height: 24px), (height: 32px), (height: 40px))
15
- // 生成:
16
- // (small: (height: 24px), default: (height: 32px), large: (height: 40px))
17
- @function size-vars($sizes...) {
18
- $size-types: (small, default, large);
19
- $size-result: ();
20
-
21
- @for $i from 1 through length($size-types) {
22
- $size-result: map.merge($size-result, (#{nth($size-types, $i)}: nth($sizes, $i)));
23
- }
24
- @return $size-result;
25
- }
26
-
27
12
  $sizes: (small, default, large);
28
13
 
29
14
  // 颜色类别
@@ -1,9 +1,7 @@
1
- // 生成css变量
2
1
  // 主题主要由色彩, 大小, 圆角, 阴影, 字体, 边框构成
3
2
  // 其中色彩又分为文字颜色, 背景颜色
4
- @use 'mixins' as m;
5
- @use 'functions' as fn;
6
- @use 'vars';
3
+ @use '../functions' as fn;
4
+ @use '../vars';
7
5
 
8
6
  // 初始化
9
7
  html {
@@ -1,7 +1,7 @@
1
1
  import { describe, expect, it } from 'vitest'
2
2
 
3
3
  import { componentCssVarsDark, componentCssVarsLight } from '../component-css-vars'
4
- import { lightTheme } from '../light'
4
+ import { lightTheme } from '../presets'
5
5
  import { UITheme } from '../ui-theme'
6
6
 
7
7
  describe('UITheme', () => {
@@ -1,16 +1,7 @@
1
- export {
2
- componentCssVarsDark,
3
- componentCssVarsDarkDecls,
4
- componentCssVarsLight,
5
- componentCssVarsLightDecls,
6
- themeTokenVar
7
- } from './component-css-vars'
8
- export { UITheme } from './ui-theme'
9
- export { lightTheme } from './light'
10
- export { darkTheme } from './dark'
11
- export { shadcnLightTheme, shadcnDarkTheme } from './shadcn'
12
- export { heroLightTheme, heroDarkTheme } from './hero'
13
- export { glassLightTheme, glassDarkTheme } from './glass'
14
1
  export type * from './type'
15
- export { cssVar, defineBySize, HEXToRGB, mixColor } from './helper'
16
- export { currentTheme, loadTheme, setTheme } from '../load-theme'
2
+
3
+ export * from './ui-theme'
4
+
5
+ export * from './presets'
6
+
7
+ export * from './load-theme'
@@ -1,9 +1,8 @@
1
1
  import { useConfig } from '@veltra/compositions'
2
2
  import { shallowRef, type ShallowRef } from 'vue'
3
3
 
4
- import { darkTheme } from './theme/dark'
5
- import { lightTheme } from './theme/light'
6
- import { UITheme } from './theme/ui-theme'
4
+ import { lightTheme, darkTheme } from './presets'
5
+ import { UITheme } from './ui-theme'
7
6
 
8
7
  export const currentTheme: ShallowRef<UITheme | undefined> = shallowRef<UITheme>()
9
8
 
@@ -0,0 +1,5 @@
1
+ export { lightTheme } from './light'
2
+ export { darkTheme } from './dark'
3
+ export { heroDarkTheme, heroLightTheme } from './hero'
4
+ export { shadcnLightTheme, shadcnDarkTheme } from './shadcn'
5
+ export { glassDarkTheme, glassLightTheme } from './glass'
@@ -1,5 +1,5 @@
1
- import { defineBySize } from './helper'
2
- import { UITheme } from './ui-theme'
1
+ import { defineBySize } from '../helper'
2
+ import { UITheme } from '../ui-theme'
3
3
 
4
4
  export const lightTheme: UITheme = new UITheme(
5
5
  {
package/dist/index.js DELETED
File without changes
@@ -1 +0,0 @@
1
- {"version":3,"file":"load-theme.js","names":[],"sources":["../src/load-theme.ts"],"sourcesContent":["import { useConfig } from '@veltra/compositions'\nimport { shallowRef, type ShallowRef } from 'vue'\n\nimport { darkTheme } from './theme/dark'\nimport { lightTheme } from './theme/light'\nimport { UITheme } from './theme/ui-theme'\n\nexport const currentTheme: ShallowRef<UITheme | undefined> = shallowRef<UITheme>()\n\nexport function setTheme(mode: 'light' | 'dark' | 'auto'): void {\n UITheme.setTheme(mode)\n}\n\n/**\n * @description 加载主题, 如果你是 SSR 环境,\n * 请在 `onMounted` 中调用,否则你可以在\n * 项目的入口环境(通常是 main.ts)或其他全局环境中调用。\n *\n * 不传 `theme` 时注入内置 light/dark 变量(支持 `setTheme` 与系统暗色偏好)。\n * 传入自定义 `UITheme` 时使用单次 `html { }` 注入。\n */\nexport function loadTheme(theme?: UITheme): void {\n currentTheme.value = theme ?? lightTheme\n\n const { config } = useConfig()\n if (typeof document !== 'undefined') {\n document.documentElement.classList.add(config.size)\n }\n\n if (typeof document === 'undefined') return\n\n if (!theme) {\n currentTheme.value = lightTheme\n UITheme.injectBuiltInThemes(lightTheme, darkTheme)\n return\n }\n\n currentTheme.value = theme\n\n if (theme === lightTheme || theme === darkTheme) {\n UITheme.injectBuiltInThemes(lightTheme, darkTheme)\n UITheme.setTheme(theme === darkTheme ? 'dark' : 'light')\n } else {\n theme.render()\n }\n}\n"],"mappings":";;;;;;AAOA,MAAa,eAAgD,YAAqB;AAElF,SAAgB,SAAS,MAAuC;AAC9D,SAAQ,SAAS,KAAK;;;;;;;;;;AAWxB,SAAgB,UAAU,OAAuB;AAC/C,cAAa,QAAQ,SAAS;CAE9B,MAAM,EAAE,WAAW,WAAW;AAC9B,KAAI,OAAO,aAAa,YACtB,UAAS,gBAAgB,UAAU,IAAI,OAAO,KAAK;AAGrD,KAAI,OAAO,aAAa,YAAa;AAErC,KAAI,CAAC,OAAO;AACV,eAAa,QAAQ;AACrB,UAAQ,oBAAoB,YAAY,UAAU;AAClD;;AAGF,cAAa,QAAQ;AAErB,KAAI,UAAU,cAAc,UAAU,WAAW;AAC/C,UAAQ,oBAAoB,YAAY,UAAU;AAClD,UAAQ,SAAS,UAAU,YAAY,SAAS,QAAQ;OAExD,OAAM,QAAQ"}
package/dist/normalize.js DELETED
@@ -1 +0,0 @@
1
- import "./normalize2.css";
@@ -1,16 +0,0 @@
1
- //#region src/theme/component-css-vars.d.ts
2
- /**
3
- * 桌面组件级 `--u-*` token,与内置主题一起在 `UITheme.injectBuiltInThemes` 中注入 `html`。
4
- * 修改此处即可在 TS 侧统一调整组件外观,无需在各组件 `style.scss` 重复声明。
5
- */
6
- /** 与 SCSS `fn.use-var($basename, $nodes...)` 输出一致 */
7
- declare function themeTokenVar(basename: string, ...nodes: Array<string | number>): string;
8
- /** 亮色(及与暗色相同的尺寸类)下组件 token */
9
- declare const componentCssVarsLight: Record<string, string>;
10
- /** 暗色下组件 token(含与亮色相同的尺寸项,保证暗色 html 块自洽) */
11
- declare const componentCssVarsDark: Record<string, string>;
12
- declare const componentCssVarsLightDecls: string[];
13
- declare const componentCssVarsDarkDecls: string[];
14
- //#endregion
15
- export { componentCssVarsDark, componentCssVarsDarkDecls, componentCssVarsLight, componentCssVarsLightDecls, themeTokenVar };
16
- //# sourceMappingURL=component-css-vars.d.ts.map
@@ -1,7 +0,0 @@
1
- import { UITheme } from "./ui-theme.js";
2
-
3
- //#region src/theme/dark.d.ts
4
- declare const darkTheme: UITheme;
5
- //#endregion
6
- export { darkTheme };
7
- //# sourceMappingURL=dark.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dark.js","names":[],"sources":["../../src/theme/dark.ts"],"sourcesContent":["import { lightTheme } from './light'\n\nexport const darkTheme = lightTheme.new({\n color: {\n primary: '#4f8ff7',\n success: '#52c41a',\n warning: '#faad14',\n danger: '#ff4d4f',\n info: '#13c2c2',\n disabled: '#212020',\n default: '#595959'\n },\n\n bg: {\n color: {\n bottom: '#0f0f0f',\n middle: '#1a1a1a',\n top: '#262626',\n hover: '#303030',\n black: '#000000'\n },\n filter: { blur: 'none', saturate: 'none' }\n },\n\n 'text-color': {\n title: '#f0f0f0',\n main: '#d9d9d9',\n second: '#a6a6a6',\n placeholder: '#737373',\n assist: '#595959',\n disabled: '#434343',\n white: '#ffffff'\n },\n\n border: { color: '#404040', mutedColor: '#404040' },\n\n shadow: { color: 'rgba(255, 255, 255, 0.2)', x: 0, y: 2, blur: 8, spread: 0, emboss: 'none' }\n})\n"],"mappings":";;AAEA,MAAa,YAAY,WAAW,IAAI;CACtC,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,SAAS;EACV;CAED,IAAI;EACF,OAAO;GACL,QAAQ;GACR,QAAQ;GACR,KAAK;GACL,OAAO;GACP,OAAO;GACR;EACD,QAAQ;GAAE,MAAM;GAAQ,UAAU;GAAQ;EAC3C;CAED,cAAc;EACZ,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACb,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CAED,QAAQ;EAAE,OAAO;EAAW,YAAY;EAAW;CAEnD,QAAQ;EAAE,OAAO;EAA4B,GAAG;EAAG,GAAG;EAAG,MAAM;EAAG,QAAQ;EAAG,QAAQ;EAAQ;CAC9F,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"glass.js","names":[],"sources":["../../src/theme/glass.ts"],"sourcesContent":["import { lightTheme } from './light'\n\nexport const glassLightTheme = lightTheme.new({\n color: {\n primary: '#3B82F6',\n success: '#10B981',\n warning: '#F59E0B',\n danger: '#EF4444',\n info: '#06B6D4',\n disabled: '#E5E7EB',\n default: '#F3F4F6'\n },\n bg: {\n color: {\n bottom: 'rgba(255, 255, 255, 0.45)',\n middle: 'rgba(255, 255, 255, 0.55)',\n top: 'rgba(255, 255, 255, 0.6)',\n hover: 'rgba(255, 255, 255, 0.75)',\n black: '#000000'\n },\n filter: { blur: 'blur(24px)', saturate: 'saturate(180%)' }\n },\n border: {\n color: 'rgba(255, 255, 255, 0.5)',\n mutedColor: 'rgba(255, 255, 255, 0.5)',\n width: 1,\n style: 'solid'\n },\n 'text-color': {\n title: '#1E293B',\n main: '#334155',\n placeholder: '#94A3B8',\n second: '#64748B',\n assist: '#CBD5E1',\n disabled: '#94A3B8',\n white: '#FFFFFF'\n },\n shadow: { color: 'rgba(0, 0, 0, 0.08)', x: 0, y: 4, blur: 24, spread: 0, emboss: 'none' }\n})\n\nexport const glassDarkTheme = glassLightTheme.new({\n color: { disabled: '#374151', default: '#1E293B' },\n bg: {\n color: {\n bottom: 'rgba(15, 23, 42, 0.6)',\n middle: 'rgba(15, 23, 42, 0.7)',\n top: 'rgba(15, 23, 42, 0.75)',\n hover: 'rgba(30, 41, 59, 0.85)',\n black: '#000000'\n },\n filter: { blur: 'blur(20px)', saturate: 'saturate(200%)' }\n },\n border: { color: 'rgba(255, 255, 255, 0.12)', mutedColor: 'rgba(255, 255, 255, 0.12)' },\n 'text-color': {\n title: '#F8FAFC',\n main: '#F1F5F9',\n second: '#94A3B8',\n placeholder: '#64748B',\n assist: '#64748B',\n disabled: '#475569',\n white: '#ffffff'\n },\n shadow: { color: 'rgba(0, 0, 0, 0.35)', x: 0, y: 4, blur: 32, spread: 0, emboss: 'none' }\n})\n"],"mappings":";;AAEA,MAAa,kBAAkB,WAAW,IAAI;CAC5C,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,SAAS;EACV;CACD,IAAI;EACF,OAAO;GACL,QAAQ;GACR,QAAQ;GACR,KAAK;GACL,OAAO;GACP,OAAO;GACR;EACD,QAAQ;GAAE,MAAM;GAAc,UAAU;GAAkB;EAC3D;CACD,QAAQ;EACN,OAAO;EACP,YAAY;EACZ,OAAO;EACP,OAAO;EACR;CACD,cAAc;EACZ,OAAO;EACP,MAAM;EACN,aAAa;EACb,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CACD,QAAQ;EAAE,OAAO;EAAuB,GAAG;EAAG,GAAG;EAAG,MAAM;EAAI,QAAQ;EAAG,QAAQ;EAAQ;CAC1F,CAAC;AAEF,MAAa,iBAAiB,gBAAgB,IAAI;CAChD,OAAO;EAAE,UAAU;EAAW,SAAS;EAAW;CAClD,IAAI;EACF,OAAO;GACL,QAAQ;GACR,QAAQ;GACR,KAAK;GACL,OAAO;GACP,OAAO;GACR;EACD,QAAQ;GAAE,MAAM;GAAc,UAAU;GAAkB;EAC3D;CACD,QAAQ;EAAE,OAAO;EAA6B,YAAY;EAA6B;CACvF,cAAc;EACZ,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACb,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CACD,QAAQ;EAAE,OAAO;EAAuB,GAAG;EAAG,GAAG;EAAG,MAAM;EAAI,QAAQ;EAAG,QAAQ;EAAQ;CAC1F,CAAC"}
@@ -1,22 +0,0 @@
1
- import { RGBColor } from "./type.js";
2
-
3
- //#region src/theme/helper.d.ts
4
- /** 实现十六进制颜色转RGB颜色,包括透明度 */
5
- declare function HEXToRGB(color: string): RGBColor;
6
- /**
7
- * 混合两个颜色,并返回混合结果的十六进制表示。
8
- * @param color1 - 第一个颜色,格式为`#RRGGBB`。
9
- * @param color2 - 第二个颜色,格式为`#RRGGBB`。
10
- * @param ratio - 颜色混合的比例,取值范围为0到1。
11
- * @returns 混合结果的十六进制表示。
12
- */
13
- declare function mixColor(color1: `#${string}`, color2: `#${string}`, ratio: number): string;
14
- declare function defineBySize(variable: Record<'small' | 'default' | 'large', number>): Record<'small' | 'default' | 'large', number>;
15
- /**
16
- * 引用全局主题 CSS 变量(`--u-*` 命名空间)
17
- * @param prop - 与 Theme 结构对应的连字符路径,如 `text-color-title`、`bg-color-hover`
18
- */
19
- declare function cssVar(prop: string): string;
20
- //#endregion
21
- export { HEXToRGB, cssVar, defineBySize, mixColor };
22
- //# sourceMappingURL=helper.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hero.js","names":[],"sources":["../../src/theme/hero.ts"],"sourcesContent":["import { lightTheme } from './light'\n\nexport const heroLightTheme = lightTheme.new({\n color: {\n primary: '#7828c8', // purple\n success: '#17c964',\n warning: '#f5a524',\n danger: '#f31260',\n info: '#006fee',\n disabled: '#f4f4f5',\n default: '#f4f4f5'\n },\n border: { width: 2, color: '#dcdfe6', mutedColor: 'transparent' },\n 'text-color': {\n title: '#11181C',\n main: '#11181C',\n second: '#71717A',\n placeholder: '#A1A1AA',\n assist: '#A1A1AA',\n disabled: '#A1A1AA',\n white: '#FFFFFF'\n },\n radius: { small: 8, default: 12, large: 14 },\n shadow: {\n color: 'rgba(0, 0, 0, 0.08)',\n x: 0,\n y: 4,\n blur: 14,\n spread: 0,\n emboss: '0 2px 4px 0 #0000000a,0 1px 2px 0 #0000000f,0 0 3px 0px #0000000f'\n },\n button: { 'default-bg': '#ebebec' }\n})\n\nexport const heroDarkTheme = heroLightTheme.new({\n color: { primary: '#9353d3', disabled: '#27272a', default: '#27272a' },\n bg: {\n color: {\n bottom: '#000000',\n middle: '#18181b',\n top: '#27272a',\n hover: '#3f3f46',\n black: '#000000'\n }\n },\n border: { color: '#3f3f46', mutedColor: 'transparent' },\n 'text-color': {\n title: '#ECEDEE',\n main: '#ECEDEE',\n second: '#A1A1AA',\n placeholder: '#71717A',\n assist: '#71717A',\n disabled: '#71717A',\n white: '#FFFFFF'\n },\n shadow: {\n color: 'rgba(0, 0, 0, 0.2)',\n x: 0,\n y: 4,\n blur: 14,\n spread: 0,\n emboss: '0 2px 4px 0 #0000000a,0 1px 2px 0 #0000000f,0 0 1px 0 #0000000f'\n },\n button: { 'default-bg': 'var(--u-bg-color-top)' }\n})\n"],"mappings":";;AAEA,MAAa,iBAAiB,WAAW,IAAI;CAC3C,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,SAAS;EACV;CACD,QAAQ;EAAE,OAAO;EAAG,OAAO;EAAW,YAAY;EAAe;CACjE,cAAc;EACZ,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACb,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CACD,QAAQ;EAAE,OAAO;EAAG,SAAS;EAAI,OAAO;EAAI;CAC5C,QAAQ;EACN,OAAO;EACP,GAAG;EACH,GAAG;EACH,MAAM;EACN,QAAQ;EACR,QAAQ;EACT;CACD,QAAQ,EAAE,cAAc,WAAW;CACpC,CAAC;AAEF,MAAa,gBAAgB,eAAe,IAAI;CAC9C,OAAO;EAAE,SAAS;EAAW,UAAU;EAAW,SAAS;EAAW;CACtE,IAAI,EACF,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,KAAK;EACL,OAAO;EACP,OAAO;EACR,EACF;CACD,QAAQ;EAAE,OAAO;EAAW,YAAY;EAAe;CACvD,cAAc;EACZ,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACb,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CACD,QAAQ;EACN,OAAO;EACP,GAAG;EACH,GAAG;EACH,MAAM;EACN,QAAQ;EACR,QAAQ;EACT;CACD,QAAQ,EAAE,cAAc,yBAAyB;CAClD,CAAC"}
@@ -1,7 +0,0 @@
1
- import { UITheme } from "./ui-theme.js";
2
-
3
- //#region src/theme/light.d.ts
4
- declare const lightTheme: UITheme;
5
- //#endregion
6
- export { lightTheme };
7
- //# sourceMappingURL=light.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"light.js","names":[],"sources":["../../src/theme/light.ts"],"sourcesContent":["import { defineBySize } from './helper'\nimport { UITheme } from './ui-theme'\n\nexport const lightTheme: UITheme = new UITheme(\n {\n color: {\n primary: '#1E88E5',\n success: '#2ba471',\n warning: '#e37318',\n danger: '#d54941',\n info: '#009688',\n disabled: '#f5f7fa',\n default: '#f1f5f9'\n },\n\n bg: {\n color: {\n bottom: '#f5f5f5',\n middle: '#fafafa',\n top: '#ffffff',\n hover: '#f5f7fa',\n black: '#000000'\n },\n\n filter: { blur: 'none', saturate: 'none' }\n },\n\n border: { color: '#dcdfe6', mutedColor: '#dcdfe6', width: 1, style: 'solid' },\n\n 'text-color': {\n title: '#303133',\n main: '#606266',\n placeholder: '#a8abb2',\n second: '#979797',\n assist: '#c0c4cc',\n disabled: '#a8abb2',\n white: '#fff'\n },\n\n radius: defineBySize({ small: 4, default: 6, large: 8 }),\n\n 'form-component-height': defineBySize({ small: 24, default: 32, large: 40 }),\n\n 'font-family':\n 'system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"PingFang SC\", \"Hiragino Sans GB\", \"Microsoft YaHei\", sans-serif',\n\n 'font-size-title': defineBySize({ small: 16, default: 16, large: 18 }),\n\n 'font-size-main': defineBySize({ small: 12, default: 14, large: 16 }),\n\n 'font-size-assist': defineBySize({ small: 12, default: 12, large: 14 }),\n\n shadow: { color: '#0000001a', x: 0, y: 0, blur: 4, spread: 1, emboss: 'none' },\n\n gap: defineBySize({ small: 6, default: 8, large: 12 }),\n\n breakpoint: { xs: 600, sm: 960, md: 1280, lg: 1920 },\n\n button: { 'default-bg': 'var(--u-bg-color-top)' }\n },\n { reactive: false }\n)\n"],"mappings":";;;AAGA,MAAa,aAAsB,IAAI,QACrC;CACE,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,SAAS;EACV;CAED,IAAI;EACF,OAAO;GACL,QAAQ;GACR,QAAQ;GACR,KAAK;GACL,OAAO;GACP,OAAO;GACR;EAED,QAAQ;GAAE,MAAM;GAAQ,UAAU;GAAQ;EAC3C;CAED,QAAQ;EAAE,OAAO;EAAW,YAAY;EAAW,OAAO;EAAG,OAAO;EAAS;CAE7E,cAAc;EACZ,OAAO;EACP,MAAM;EACN,aAAa;EACb,QAAQ;EACR,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CAED,QAAQ,aAAa;EAAE,OAAO;EAAG,SAAS;EAAG,OAAO;EAAG,CAAC;CAExD,yBAAyB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;EAAI,CAAC;CAE5E,eACE;CAEF,mBAAmB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;EAAI,CAAC;CAEtE,kBAAkB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;EAAI,CAAC;CAErE,oBAAoB,aAAa;EAAE,OAAO;EAAI,SAAS;EAAI,OAAO;EAAI,CAAC;CAEvE,QAAQ;EAAE,OAAO;EAAa,GAAG;EAAG,GAAG;EAAG,MAAM;EAAG,QAAQ;EAAG,QAAQ;EAAQ;CAE9E,KAAK,aAAa;EAAE,OAAO;EAAG,SAAS;EAAG,OAAO;EAAI,CAAC;CAEtD,YAAY;EAAE,IAAI;EAAK,IAAI;EAAK,IAAI;EAAM,IAAI;EAAM;CAEpD,QAAQ,EAAE,cAAc,yBAAyB;CAClD,EACD,EAAE,UAAU,OAAO,CACpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"shadcn.js","names":[],"sources":["../../src/theme/shadcn.ts"],"sourcesContent":["import { lightTheme } from './light'\n\nexport const shadcnLightTheme = lightTheme.new({\n color: {\n primary: '#18181b', // zinc-900\n success: '#22c55e',\n warning: '#f59e0b',\n danger: '#ef4444',\n info: '#3b82f6',\n disabled: '#f4f4f5',\n default: '#fafafa'\n },\n bg: {\n color: {\n bottom: '#f4f4f5',\n middle: '#fafafa',\n top: '#ffffff',\n hover: '#f4f4f5',\n black: '#000000'\n }\n },\n border: { color: '#e4e4e7', mutedColor: '#e4e4e7' },\n 'text-color': {\n title: '#09090b',\n main: '#09090b',\n second: '#71717a',\n placeholder: '#a1a1aa',\n assist: '#a1a1aa',\n disabled: '#a1a1aa',\n white: '#ffffff'\n },\n radius: { small: 4, default: 6, large: 8 },\n shadow: { color: 'rgba(0, 0, 0, 0.05)', x: 0, y: 1, blur: 2, spread: 0, emboss: 'none' },\n button: {\n 'primary-text-color': '#ffffff',\n 'primary-hover-bg': '#27272a',\n 'primary-hover-color': '#ffffff'\n }\n})\n\nexport const shadcnDarkTheme = shadcnLightTheme.new({\n color: {\n primary: '#fafafa', // zinc-50\n disabled: '#27272a',\n default: '#18181b'\n },\n bg: {\n color: {\n bottom: '#09090b',\n middle: '#18181b',\n top: '#27272a',\n hover: '#27272a',\n black: '#000000'\n }\n },\n border: { color: '#3f3f46', mutedColor: '#27272a' },\n 'text-color': {\n title: '#fafafa',\n main: '#fafafa',\n second: '#a1a1aa',\n placeholder: '#71717a',\n assist: '#71717a',\n disabled: '#71717a',\n white: '#ffffff'\n },\n shadow: { color: 'rgba(0, 0, 0, 0.4)', x: 0, y: 1, blur: 2, spread: 0, emboss: 'none' },\n button: {\n 'primary-text-color': '#000000',\n 'primary-hover-bg': '#e4e4e7',\n 'primary-hover-color': '#000000',\n 'primary-plain-color': '#fafafa'\n },\n checkbox: { color: '#000000' },\n tag: { 'primary-dark-color': '#000000' }\n})\n"],"mappings":";;AAEA,MAAa,mBAAmB,WAAW,IAAI;CAC7C,OAAO;EACL,SAAS;EACT,SAAS;EACT,SAAS;EACT,QAAQ;EACR,MAAM;EACN,UAAU;EACV,SAAS;EACV;CACD,IAAI,EACF,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,KAAK;EACL,OAAO;EACP,OAAO;EACR,EACF;CACD,QAAQ;EAAE,OAAO;EAAW,YAAY;EAAW;CACnD,cAAc;EACZ,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACb,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CACD,QAAQ;EAAE,OAAO;EAAG,SAAS;EAAG,OAAO;EAAG;CAC1C,QAAQ;EAAE,OAAO;EAAuB,GAAG;EAAG,GAAG;EAAG,MAAM;EAAG,QAAQ;EAAG,QAAQ;EAAQ;CACxF,QAAQ;EACN,sBAAsB;EACtB,oBAAoB;EACpB,uBAAuB;EACxB;CACF,CAAC;AAEF,MAAa,kBAAkB,iBAAiB,IAAI;CAClD,OAAO;EACL,SAAS;EACT,UAAU;EACV,SAAS;EACV;CACD,IAAI,EACF,OAAO;EACL,QAAQ;EACR,QAAQ;EACR,KAAK;EACL,OAAO;EACP,OAAO;EACR,EACF;CACD,QAAQ;EAAE,OAAO;EAAW,YAAY;EAAW;CACnD,cAAc;EACZ,OAAO;EACP,MAAM;EACN,QAAQ;EACR,aAAa;EACb,QAAQ;EACR,UAAU;EACV,OAAO;EACR;CACD,QAAQ;EAAE,OAAO;EAAsB,GAAG;EAAG,GAAG;EAAG,MAAM;EAAG,QAAQ;EAAG,QAAQ;EAAQ;CACvF,QAAQ;EACN,sBAAsB;EACtB,oBAAoB;EACpB,uBAAuB;EACvB,uBAAuB;EACxB;CACD,UAAU,EAAE,OAAO,WAAW;CAC9B,KAAK,EAAE,sBAAsB,WAAW;CACzC,CAAC"}
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- import './normalize'
2
- import './anime'
@@ -1,63 +0,0 @@
1
- // 生成css变量
2
- // 主题主要由色彩, 大小, 圆角, 阴影, 字体, 边框构成
3
- // 其中色彩又分为文字颜色, 背景颜色
4
- @use 'mixins' as m;
5
- @use 'functions' as fn;
6
- @use 'vars';
7
-
8
- // 初始化
9
- html {
10
- font-family: fn.use-var(font-family);
11
- font-weight: normal;
12
- color: fn.use-var(text-color, main);
13
- line-height: 1.4;
14
-
15
- @each $size in vars.$sizes {
16
- &.#{$size} {
17
- font-size: fn.use-var(font-size-main, $size);
18
- }
19
- }
20
- }
21
-
22
- body,
23
- ul,
24
- h1,
25
- h2,
26
- h3,
27
- h4,
28
- h5,
29
- h6 {
30
- margin: 0;
31
- }
32
-
33
- div,
34
- section,
35
- head,
36
- aside,
37
- body,
38
- main,
39
- h1,
40
- h2,
41
- h3,
42
- h4,
43
- h5,
44
- h6,
45
- p,
46
- article,
47
- button,
48
- input,
49
- textarea {
50
- box-sizing: border-box;
51
- }
52
-
53
- a {
54
- text-decoration: none;
55
- color: inherit;
56
- }
57
-
58
- ul {
59
- padding: 0;
60
- }
61
- li {
62
- list-style: none;
63
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes