@semi-kit/theme 1.2.15 → 1.2.19

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/lib/base.css ADDED
@@ -0,0 +1,16 @@
1
+ :root {
2
+ --padding: 12px;
3
+ --margin: 12px;
4
+ --border-radius-small: 4px;
5
+ --border-radius-default: 6px;
6
+ --border-radius-large: 8px;
7
+ --primary-color: #0052d9;
8
+ --info-color: #909399;
9
+ --error-color: #f56c6c;
10
+ --success-color: #67c23a;
11
+ --warning-color: #e6a23c;
12
+ --placeholder-color: #f3f3f3;
13
+ --placeholder-color-dark: #18181c;
14
+ --duration: 0.2s;
15
+ }
16
+
package/lib/base.less ADDED
@@ -0,0 +1,120 @@
1
+ html,
2
+ body,
3
+ #app,
4
+ #base-layout,
5
+ .n-config-provider {
6
+ height: 100%;
7
+ width: 100%;
8
+ }
9
+
10
+ html,
11
+ body,
12
+ #app {
13
+ overflow: hidden;
14
+ margin: 0;
15
+ padding: 0;
16
+ }
17
+
18
+ a {
19
+ text-decoration: none;
20
+ color: unset;
21
+ }
22
+
23
+ // -------------------------------------------------------------------------------------------- > Router View Transition
24
+
25
+ // Zoom Out
26
+ .zoom-out-enter-active,
27
+ .zoom-out-leave-active {
28
+ transition:
29
+ opacity 0.1s ease-in-out,
30
+ transform 0.15s ease-out;
31
+ }
32
+ .zoom-out-enter-from,
33
+ .zoom-out-leave-to {
34
+ opacity: 0;
35
+ transform: scale(0);
36
+ }
37
+
38
+ // Zoom Fade
39
+ .zoom-fade-enter-active,
40
+ .zoom-fade-leave-active {
41
+ transition:
42
+ transform 0.2s,
43
+ opacity 0.3s ease-out;
44
+ }
45
+ .zoom-fade-enter-from {
46
+ opacity: 0;
47
+ transform: scale(0.92);
48
+ }
49
+ .zoom-fade-leave-to {
50
+ opacity: 0;
51
+ transform: scale(1.06);
52
+ }
53
+
54
+ // Fade Scale
55
+ .fade-scale-leave-active,
56
+ .fade-scale-enter-active {
57
+ transition: all 0.28s;
58
+ }
59
+ .fade-scale-enter-from {
60
+ opacity: 0;
61
+ transform: scale(1.2);
62
+ }
63
+ .fade-scale-leave-to {
64
+ opacity: 0;
65
+ transform: scale(0.8);
66
+ }
67
+
68
+ // Fade Slide
69
+ .fade-slide-leave-active,
70
+ .fade-slide-enter-active {
71
+ transition: all var(--duration);
72
+ }
73
+ .fade-slide-enter-from {
74
+ opacity: 0;
75
+ transform: translateX(-30px);
76
+ }
77
+ .fade-slide-leave-to {
78
+ opacity: 0;
79
+ transform: translateX(30px);
80
+ }
81
+
82
+ // Fade Bottom
83
+ .fade-bottom-enter-active,
84
+ .fade-bottom-leave-active {
85
+ transition:
86
+ opacity 0.25s,
87
+ transform 0.3s;
88
+ }
89
+ .fade-bottom-enter-from {
90
+ opacity: 0;
91
+ transform: translateY(-10%);
92
+ }
93
+ .fade-bottom-leave-to {
94
+ opacity: 0;
95
+ transform: translateY(10%);
96
+ }
97
+
98
+ ::-webkit-scrollbar {
99
+ width: 6px;
100
+ height: 6px;
101
+ cursor: pointer;
102
+ }
103
+
104
+ ::-webkit-scrollbar-track {
105
+ background-color: transparent;
106
+ }
107
+
108
+ ::-webkit-scrollbar-thumb {
109
+ background-color: #bfbfbf;
110
+ border-radius: 6px;
111
+ }
112
+
113
+ ::-webkit-scrollbar-thumb:hover {
114
+ background-color: #999999;
115
+ }
116
+
117
+ ::-webkit-scrollbar-thumb:active {
118
+ background-color: #999999;
119
+ }
120
+
@@ -1,6 +1,72 @@
1
1
  import * as vue0 from "vue";
2
- import { GlobalThemeOverrides } from "naive-ui";
3
2
  declare const useAppTheme: () => {
4
- theme: vue0.ComputedRef<GlobalThemeOverrides>;
3
+ theme: vue0.ComputedRef<{
4
+ common: {
5
+ borderRadiusSmall: string;
6
+ scrollbarWidth: string;
7
+ scrollbarHeight: string;
8
+ scrollbarBorderRadius: string;
9
+ };
10
+ DataTable: {
11
+ thColor: string;
12
+ };
13
+ Card: {
14
+ paddingSmall: string;
15
+ paddingMedium: string;
16
+ paddingLarge: string;
17
+ paddingHuge: string;
18
+ };
19
+ Dialog: {
20
+ padding: string;
21
+ closeMargin: string;
22
+ contentMargin: string;
23
+ };
24
+ Drawer: {
25
+ bodyPadding: string;
26
+ footerPadding: string;
27
+ };
28
+ } & {
29
+ common: {
30
+ infoColor: string;
31
+ infoColorHover: string;
32
+ infoColorPressed: string;
33
+ infoColorSuppl: string;
34
+ successColor: string;
35
+ successColorHover: string;
36
+ successColorPressed: string;
37
+ successColorSuppl: string;
38
+ warningColor: string;
39
+ warningColorHover: string;
40
+ warningColorPressed: string;
41
+ warningColorSuppl: string;
42
+ errorColor: string;
43
+ errorColorHover: string;
44
+ errorColorPressed: string;
45
+ errorColorSuppl: string;
46
+ };
47
+ } & {
48
+ common: {
49
+ primaryColor: string | undefined;
50
+ primaryColorHover: string;
51
+ primaryColorPressed: string | undefined;
52
+ borderRadius: string;
53
+ };
54
+ Tag: {
55
+ borderRadius: string;
56
+ };
57
+ Layout: {
58
+ headerColor: string | undefined;
59
+ };
60
+ Menu: {
61
+ itemColorActive: string | undefined;
62
+ itemColorActiveCollapsed: string | undefined;
63
+ itemColorActiveHover: string | undefined;
64
+ itemColorHover: string;
65
+ itemTextColorActive: string;
66
+ itemTextColorActiveHover: string;
67
+ itemIconColorActive: string;
68
+ itemIconColorActiveHover: string;
69
+ };
70
+ }>;
5
71
  };
6
72
  export { useAppTheme };
@@ -1 +1 @@
1
- import{darkTheme}from"../../themes/dark.mjs";import{lightTheme}from"../../themes/light.mjs";import"../../themes/index.mjs";import{getAppProvider}from"@semi-kit/component";import{computed}from"vue";import{merge}from"es-toolkit/compat";import{usePreferredDark}from"@vueuse/core";const useAppTheme=()=>{let o=computed(()=>usePreferredDark().value);return{theme:computed(()=>{let i=o.value?darkTheme:lightTheme,{primaryColor:a,radius:s}=getAppProvider()?.theme?.value??{};return merge({},i,{common:{primaryColor:a,primaryColorHover:`${a}D9`,primaryColorPressed:a,borderRadius:`${s}px`},Tag:{borderRadius:`${s}px`},Layout:{headerColor:a},Menu:{itemColorActive:a,itemColorActiveCollapsed:a,itemColorActiveHover:a,itemColorHover:`${a}13`,itemTextColorActive:`white`,itemTextColorActiveHover:`white`,itemIconColorActive:`white`,itemIconColorActiveHover:`white`}})})}};export{useAppTheme};
1
+ import{darkTheme}from"../../themes/dark.mjs";import{lightTheme}from"../../themes/light.mjs";import"../../themes/index.mjs";import{merge}from"es-toolkit/compat";import{getAppProvider}from"@semi-kit/component";import{computed}from"vue";import{usePreferredDark}from"@vueuse/core";const useAppTheme=()=>{let o=computed(()=>usePreferredDark().value);return{theme:computed(()=>{let i=o.value?darkTheme:lightTheme,{primaryColor:a,radius:s}=getAppProvider()?.theme?.value??{};return merge({},i,{common:{primaryColor:a,primaryColorHover:`${a}D9`,primaryColorPressed:a,borderRadius:`${s}px`},Tag:{borderRadius:`${s}px`},Layout:{headerColor:a},Menu:{itemColorActive:a,itemColorActiveCollapsed:a,itemColorActiveHover:a,itemColorHover:`${a}13`,itemTextColorActive:`white`,itemTextColorActiveHover:`white`,itemIconColorActive:`white`,itemIconColorActiveHover:`white`}})})}};export{useAppTheme};
package/lib/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  import { useAppTheme } from "./hooks/use-app-theme/index.mjs";
2
2
  import "./hooks/index.mjs";
3
- import { AppVarsType } from "./vars/type.mjs";
4
3
  import { appVars } from "./vars/index.mjs";
5
- export { type AppVarsType, appVars, useAppTheme };
4
+ export { appVars, useAppTheme };
@@ -1,3 +1,27 @@
1
- import { GlobalThemeOverrides } from "naive-ui";
2
- declare const _commonTheme: GlobalThemeOverrides;
1
+ declare const _commonTheme: {
2
+ common: {
3
+ borderRadiusSmall: string;
4
+ scrollbarWidth: string;
5
+ scrollbarHeight: string;
6
+ scrollbarBorderRadius: string;
7
+ };
8
+ DataTable: {
9
+ thColor: string;
10
+ };
11
+ Card: {
12
+ paddingSmall: string;
13
+ paddingMedium: string;
14
+ paddingLarge: string;
15
+ paddingHuge: string;
16
+ };
17
+ Dialog: {
18
+ padding: string;
19
+ closeMargin: string;
20
+ contentMargin: string;
21
+ };
22
+ Drawer: {
23
+ bodyPadding: string;
24
+ footerPadding: string;
25
+ };
26
+ };
3
27
  export { _commonTheme };
@@ -1,3 +1,46 @@
1
- import { GlobalThemeOverrides } from "naive-ui";
2
- declare const darkTheme: GlobalThemeOverrides;
1
+ declare const darkTheme: {
2
+ common: {
3
+ borderRadiusSmall: string;
4
+ scrollbarWidth: string;
5
+ scrollbarHeight: string;
6
+ scrollbarBorderRadius: string;
7
+ };
8
+ DataTable: {
9
+ thColor: string;
10
+ };
11
+ Card: {
12
+ paddingSmall: string;
13
+ paddingMedium: string;
14
+ paddingLarge: string;
15
+ paddingHuge: string;
16
+ };
17
+ Dialog: {
18
+ padding: string;
19
+ closeMargin: string;
20
+ contentMargin: string;
21
+ };
22
+ Drawer: {
23
+ bodyPadding: string;
24
+ footerPadding: string;
25
+ };
26
+ } & {
27
+ common: {
28
+ infoColor: string;
29
+ infoColorHover: string;
30
+ infoColorPressed: string;
31
+ infoColorSuppl: string;
32
+ successColor: string;
33
+ successColorHover: string;
34
+ successColorPressed: string;
35
+ successColorSuppl: string;
36
+ warningColor: string;
37
+ warningColorHover: string;
38
+ warningColorPressed: string;
39
+ warningColorSuppl: string;
40
+ errorColor: string;
41
+ errorColorHover: string;
42
+ errorColorPressed: string;
43
+ errorColorSuppl: string;
44
+ };
45
+ };
3
46
  export { darkTheme };
@@ -1,3 +1,46 @@
1
- import { GlobalThemeOverrides } from "naive-ui";
2
- declare const lightTheme: GlobalThemeOverrides;
1
+ declare const lightTheme: {
2
+ common: {
3
+ borderRadiusSmall: string;
4
+ scrollbarWidth: string;
5
+ scrollbarHeight: string;
6
+ scrollbarBorderRadius: string;
7
+ };
8
+ DataTable: {
9
+ thColor: string;
10
+ };
11
+ Card: {
12
+ paddingSmall: string;
13
+ paddingMedium: string;
14
+ paddingLarge: string;
15
+ paddingHuge: string;
16
+ };
17
+ Dialog: {
18
+ padding: string;
19
+ closeMargin: string;
20
+ contentMargin: string;
21
+ };
22
+ Drawer: {
23
+ bodyPadding: string;
24
+ footerPadding: string;
25
+ };
26
+ } & {
27
+ common: {
28
+ infoColor: string;
29
+ infoColorHover: string;
30
+ infoColorPressed: string;
31
+ infoColorSuppl: string;
32
+ successColor: string;
33
+ successColorHover: string;
34
+ successColorPressed: string;
35
+ successColorSuppl: string;
36
+ warningColor: string;
37
+ warningColorHover: string;
38
+ warningColorPressed: string;
39
+ warningColorSuppl: string;
40
+ errorColor: string;
41
+ errorColorHover: string;
42
+ errorColorPressed: string;
43
+ errorColorSuppl: string;
44
+ };
45
+ };
3
46
  export { lightTheme };
@@ -1,3 +1,18 @@
1
- import { AppVarsType } from "./type.mjs";
2
- declare const appVars: AppVarsType;
1
+ declare const appVars: {
2
+ spacing: number;
3
+ borderRadiusSmall: number;
4
+ borderRadiusMiddle: number;
5
+ borderRadiusLarge: number;
6
+ placeholderColor: string;
7
+ placeholderColorDark: string;
8
+ margin: string;
9
+ padding: string;
10
+ scrollbarSize: number;
11
+ defaultPrimaryColor: string;
12
+ sidePanelWidth: number;
13
+ formItemFixedWidth: number;
14
+ componentWidth: number;
15
+ componentWidthMiddle: number;
16
+ componentWidthLarge: number;
17
+ };
3
18
  export { appVars };
@@ -1,18 +1 @@
1
- type AppVarsType = {
2
- margin: string;
3
- padding: string;
4
- placeholderColor: string;
5
- placeholderColorDark: string;
6
- borderRadiusSmall: number;
7
- borderRadiusMiddle: number;
8
- borderRadiusLarge: number;
9
- scrollbarSize: number;
10
- spacing: number;
11
- defaultPrimaryColor: string;
12
- sidePanelWidth: number;
13
- formItemFixedWidth: number;
14
- componentWidth: number;
15
- componentWidthMiddle: number;
16
- componentWidthLarge: number;
17
- };
18
- export { AppVarsType };
1
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@semi-kit/theme",
3
- "version": "1.2.15",
3
+ "version": "1.2.19",
4
4
  "description": "Theme and style presets",
5
5
  "type": "module",
6
6
  "author": "lijiaheng <jahnli@163.com>",
@@ -24,7 +24,9 @@
24
24
  "./themes/light": "./lib/themes/light.mjs",
25
25
  "./vars": "./lib/vars/index.mjs",
26
26
  "./vars/type": "./lib/vars/type.mjs",
27
- "./package.json": "./package.json"
27
+ "./package.json": "./package.json",
28
+ "./base.css": "./lib/base.css",
29
+ "./base.less": "./lib/base.less"
28
30
  },
29
31
  "scripts": {
30
32
  "build": "tsdown",