@semi-kit/theme 1.2.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.
@@ -0,0 +1,2 @@
1
+ import { useAppTheme } from "./use-app-theme/index.mjs";
2
+ export { useAppTheme };
@@ -0,0 +1 @@
1
+ import{useAppTheme}from"./use-app-theme/index.mjs";export{useAppTheme};
@@ -0,0 +1,6 @@
1
+ import * as vue0 from "vue";
2
+ import { GlobalThemeOverrides } from "naive-ui";
3
+ declare const useAppTheme: () => {
4
+ theme: vue0.ComputedRef<GlobalThemeOverrides>;
5
+ };
6
+ export { useAppTheme };
@@ -0,0 +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};
@@ -0,0 +1,5 @@
1
+ import { useAppTheme } from "./hooks/use-app-theme/index.mjs";
2
+ import "./hooks/index.mjs";
3
+ import { AppVarsType } from "./vars/type.mjs";
4
+ import { appVars } from "./vars/index.mjs";
5
+ export { type AppVarsType, appVars, useAppTheme };
package/lib/index.mjs ADDED
@@ -0,0 +1 @@
1
+ import{appVars}from"./vars/index.mjs";import{useAppTheme}from"./hooks/use-app-theme/index.mjs";import"./hooks/index.mjs";export{appVars,useAppTheme};
@@ -0,0 +1,3 @@
1
+ import { GlobalThemeOverrides } from "naive-ui";
2
+ declare const _commonTheme: GlobalThemeOverrides;
3
+ export { _commonTheme };
@@ -0,0 +1 @@
1
+ import{appVars}from"../vars/index.mjs";const _commonTheme={common:{borderRadiusSmall:`${appVars.borderRadiusSmall}px`,scrollbarWidth:`${appVars.scrollbarSize}px`,scrollbarHeight:`${appVars.scrollbarSize}px`,scrollbarBorderRadius:`${appVars.scrollbarSize}px`},DataTable:{thColor:`#f2f3f5`},Card:{paddingSmall:`16px`,paddingMedium:`16px`,paddingLarge:`16px`,paddingHuge:`16px`},Dialog:{padding:`16px`,closeMargin:`16px`,contentMargin:`16px 0`},Drawer:{bodyPadding:`10px`,footerPadding:`10px`}};export{_commonTheme};
@@ -0,0 +1,3 @@
1
+ import { GlobalThemeOverrides } from "naive-ui";
2
+ declare const darkTheme: GlobalThemeOverrides;
3
+ export { darkTheme };
@@ -0,0 +1 @@
1
+ import{_commonTheme}from"./_common.mjs";import{merge}from"es-toolkit/compat";const darkTheme=merge({},_commonTheme,{common:{infoColor:`#70C0E8`,infoColorHover:`#8ACBEC`,infoColorPressed:`#5AADE0`,infoColorSuppl:`#8ACBEC`,successColor:`#63e2b7`,successColorHover:`#7fe7c4`,successColorPressed:`#52d9a6`,successColorSuppl:`#7fe7c4`,warningColor:`#f2c97d`,warningColorHover:`#f5d599`,warningColorPressed:`#e6be6e`,warningColorSuppl:`#f5d599`,errorColor:`#e88080`,errorColorHover:`#ed9b9b`,errorColorPressed:`#d47373`,errorColorSuppl:`#ed9b9b`}});export{darkTheme};
@@ -0,0 +1,4 @@
1
+ import { _commonTheme } from "./_common.mjs";
2
+ import { darkTheme } from "./dark.mjs";
3
+ import { lightTheme } from "./light.mjs";
4
+ export { _commonTheme, darkTheme, lightTheme };
@@ -0,0 +1 @@
1
+ import{_commonTheme}from"./_common.mjs";import{darkTheme}from"./dark.mjs";import{lightTheme}from"./light.mjs";export{_commonTheme,darkTheme,lightTheme};
@@ -0,0 +1,3 @@
1
+ import { GlobalThemeOverrides } from "naive-ui";
2
+ declare const lightTheme: GlobalThemeOverrides;
3
+ export { lightTheme };
@@ -0,0 +1 @@
1
+ import{_commonTheme}from"./_common.mjs";import{merge}from"es-toolkit/compat";const lightTheme=merge({},_commonTheme,{common:{infoColor:`#2080F0`,infoColorHover:`#4098FC`,infoColorPressed:`#1060C9`,infoColorSuppl:`#4098FC`,successColor:`#67c23a`,successColorHover:`#85ce61`,successColorPressed:`#5daf34`,successColorSuppl:`#85ce61`,warningColor:`#e6a23c`,warningColorHover:`#ebb563`,warningColorPressed:`#cf9236`,warningColorSuppl:`#ebb563`,errorColor:`#f56c6c`,errorColorHover:`#f78989`,errorColorPressed:`#dd6161`,errorColorSuppl:`#f78989`}});export{lightTheme};
@@ -0,0 +1,3 @@
1
+ import { AppVarsType } from "./type.mjs";
2
+ declare const appVars: AppVarsType;
3
+ export { appVars };
@@ -0,0 +1 @@
1
+ const appVars={spacing:12,borderRadiusSmall:6,borderRadiusMiddle:8,borderRadiusLarge:10,placeholderColor:`#F3F3F3`,placeholderColorDark:`#18181c`,margin:`12px`,padding:`12px`,scrollbarSize:6,defaultPrimaryColor:`#0052d9`,sidePanelWidth:320,formItemFixedWidth:386,componentWidth:246,componentWidthMiddle:280,componentWidthLarge:320};export{appVars};
@@ -0,0 +1,18 @@
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 };
@@ -0,0 +1 @@
1
+ export{};
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@semi-kit/theme",
3
+ "version": "1.2.15",
4
+ "description": "Theme and style presets",
5
+ "type": "module",
6
+ "author": "lijiaheng <jahnli@163.com>",
7
+ "license": "ISC",
8
+ "main": "./lib/index.mjs",
9
+ "module": "./lib/index.mjs",
10
+ "types": "./lib/index.d.mts",
11
+ "files": [
12
+ "lib"
13
+ ],
14
+ "publishConfig": {
15
+ "access": "public"
16
+ },
17
+ "exports": {
18
+ ".": "./lib/index.mjs",
19
+ "./hooks": "./lib/hooks/index.mjs",
20
+ "./hooks/use-app-theme": "./lib/hooks/use-app-theme/index.mjs",
21
+ "./themes": "./lib/themes/index.mjs",
22
+ "./themes/_common": "./lib/themes/_common.mjs",
23
+ "./themes/dark": "./lib/themes/dark.mjs",
24
+ "./themes/light": "./lib/themes/light.mjs",
25
+ "./vars": "./lib/vars/index.mjs",
26
+ "./vars/type": "./lib/vars/type.mjs",
27
+ "./package.json": "./package.json"
28
+ },
29
+ "scripts": {
30
+ "build": "tsdown",
31
+ "dev": "tsdown --watch",
32
+ "typecheck": "tsc --noEmit",
33
+ "prepublishOnly": "pnpm run build",
34
+ "release": "npm publish"
35
+ },
36
+ "devDependencies": {
37
+ "vue": "catalog:",
38
+ "naive-ui": "catalog:",
39
+ "@vueuse/core": "catalog:",
40
+ "@semi-kit/component": "workspace:*",
41
+ "es-toolkit": "catalog:"
42
+ },
43
+ "peerDependencies": {
44
+ "vue": "*",
45
+ "naive-ui": "*",
46
+ "@vueuse/core": "*",
47
+ "@semi-kit/component": "*",
48
+ "es-toolkit": "*"
49
+ },
50
+ "peerDependenciesMeta": {
51
+ "vue": {
52
+ "optional": true
53
+ },
54
+ "naive-ui": {
55
+ "optional": true
56
+ },
57
+ "@vueuse/core": {
58
+ "optional": true
59
+ },
60
+ "@semi-kit/component": {
61
+ "optional": true
62
+ },
63
+ "es-toolkit": {
64
+ "optional": true
65
+ }
66
+ }
67
+ }