@duxweb/dvha-core 0.1.16 → 0.1.17
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/dist/cjs/hooks/theme.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@vueuse/core"),F=require("colorizr"),H=require("pinia"),f=require("vue");require("lodash-es");const J=require("../stores/theme.cjs"),K=require("./manage.cjs"),Q=require("./themeColor.cjs");function U(){var V,B;const d=J.useThemeStore(),{mode:E}=H.storeToRefs(d),v=C.useColorMode({storageRef:E}),m=K.useManage(),{state:p,next:M}=C.useCycleList(["dark","light","auto"],{initialValue:v.store.value});f.watchEffect(()=>{v.value=p.value});const g=f.computed(()=>{const{system:o,store:e}=v;return e.value==="auto"?o.value==="dark":e.value==="dark"}),I=f.computed(()=>{var o,e,t,s,r,i,n,u;return g.value?{logo:(e=(o=m.config)==null?void 0:o.theme)==null?void 0:e.darkLogo,banner:(s=(t=m.config)==null?void 0:t.theme)==null?void 0:s.darkBanner}:{logo:(i=(r=m.config)==null?void 0:r.theme)==null?void 0:i.logo,banner:(u=(n=m.config)==null?void 0:n.theme)==null?void 0:u.banner}}),c={...{colors:Q.themeColor,colorTypes:["primary","info","success","warning","error","gray"],colorShades:["50","100","200","300","400","500","600","700","800","900","950"],colorScenes:{light:{default:{default:"500",hover:"600",pressed:"700",focus:"500",disabled:"300"}},dark:{default:{default:"500",hover:"400",pressed:"300",focus:"500",disabled:"600"}}},colorSemantic:{light:{text:{dimmed:"400",muted:"500",toned:"600",base:"700",highlighted:"900",inverted:"white"},bg:{base:"white",muted:"50",elevated:"100",accented:"200",inverted:"900"},border:{base:"200",muted:"200",accented:"300",inverted:"900"}},dark:{text:{dimmed:"600",muted:"500",toned:"400",base:"300",highlighted:"100",inverted:"black"},bg:{base:"950",muted:"900",elevated:"800",accented:"700",inverted:"100"},border:{base:"800",muted:"800",accented:"700",inverted:"100"}}},colorBase:{white:"#ffffff",black:"#000000"}},...(B=(V=m.config)==null?void 0:V.theme)==null?void 0:B.config},{colorShades:k,colorTypes:x}=c,b=f.computed(()=>d.theme),T=f.computed(()=>Object.keys(c.colors)),w=["default","hover","pressed","focus","disabled"];function L(){return g.value?c.colorScenes.dark:c.colorScenes.light}function y(o,e){var r;const t=L(),s=t.default;if((r=t.overrides)!=null&&r[o]){const i=t.overrides[o],n=i==null?void 0:i[e];if(n)return n}return s[e]||"500"}function j(o,e){var s;const t=b.value[o];return((s=c.colors[t])==null?void 0:s[e])||""}function a(o,e,t){const r=(g.value?c.colorSemantic.dark:c.colorSemantic.light)[o][e];return r==="white"||r==="black"?`var(--color-${r})`:`var(--base-color-${t}-${r})`}const $=o=>{const e=F.hex2rgb(o);return`${e.r} ${e.g} ${e.b}`};function S(){var r,i;const o=[];Object.entries(c.colors).forEach(([n,u])=>{typeof u=="object"&&Object.entries(u).forEach(([l,h])=>{try{o.push(`--base-color-${n}-${l}: ${$(h)};`)}catch{o.push(`--base-color-${n}-${l}: ${h};`)}})});const e=[];x.forEach(n=>{const u=b.value[n];k.forEach(l=>{e.push(`--ui-color-${n}-${l}: var(--base-color-${u}-${l});`)}),w.forEach(l=>{const h=y(n,l);l==="default"?e.push(`--ui-color-${n}: var(--base-color-${u}-${h});`):e.push(`--ui-color-${n}-${l}: var(--base-color-${u}-${h});`)})});const t=b.value.gray,s=[`--color-white: ${$(((r=c.colorBase)==null?void 0:r.white)||"#ffffff")};`,`--color-black: ${$(((i=c.colorBase)==null?void 0:i.black)||"#000000")};`,`--ui-text-dimmed: ${a("text","dimmed",t)};`,`--ui-text-muted: ${a("text","muted",t)};`,`--ui-text-toned: ${a("text","toned",t)};`,`--ui-text: ${a("text","base",t)};`,`--ui-text-highlighted: ${a("text","highlighted",t)};`,`--ui-text-inverted: ${a("text","inverted",t)};`,`--ui-bg: ${a("bg","base",t)};`,`--ui-bg-muted: ${a("bg","muted",t)};`,`--ui-bg-elevated: ${a("bg","elevated",t)};`,`--ui-bg-accented: ${a("bg","accented",t)};`,`--ui-bg-inverted: ${a("bg","inverted",t)};`,`--ui-border: ${a("border","base",t)};`,`--ui-border-muted: ${a("border","muted",t)};`,`--ui-border-accented: ${a("border","accented",t)};`,`--ui-border-inverted: ${a("border","inverted",t)};`];return`:root {
|
|
2
2
|
${o.join(`
|
|
3
3
|
`)}
|
|
4
|
-
${
|
|
4
|
+
${e.join(`
|
|
5
5
|
`)}
|
|
6
|
-
${
|
|
6
|
+
${s.join(`
|
|
7
7
|
`)}
|
|
8
|
-
}`}const{css:
|
|
8
|
+
}`}const{css:q}=C.useStyleTag(S(),{id:"theme-variables"});function O(){d.cssInit||(d.setCssInit(),q.value=S())}f.watch([b,g],()=>{d.cssInit&&(q.value=S())},{deep:!0,immediate:!1});function R(o,e){T.value.includes(e)?d.setThemeColor(o,e):console.warn(`Color "${e}" is not available`)}function z(o){d.setThemeColors(o)}function D(){d.resetTheme()}function G(o,e){return j(o,e)}function P(o,e){e||(e="default");const t=y(o,e);return j(o,t)}function A(o,e){var i,n;const t=b.value.gray,r=(g.value?c.colorSemantic.dark:c.colorSemantic.light)[o][e];return r==="white"?"#ffffff":r==="black"?((i=c.colorBase)==null?void 0:i.black)||"#000000":((n=c.colors[t])==null?void 0:n[r])||""}return{toggle:M,mode:p,isDark:g,resources:I,config:f.readonly(c),colorMapping:f.readonly(b),colors:T,colorShades:k,colorTypes:x,colorScenes:w,cssInit:O,cssReset:D,setColor:R,setColors:z,getSceneColor:P,getShadeColor:G,getSemanticColor:A}}exports.useTheme=U;
|
package/dist/cjs/utils/theme.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(c){return`rgb(var(${c}))`}function s(c){const t={},i=["50","100","200","300","400","500","600","700","800","900","950"],n=["primary","info","success","warning","error","gray"],l=["hover","pressed","focus","disabled"];t.white={DEFAULT:e("--color-white")},t.black={DEFAULT:e("--color-black")},Object.keys(c).forEach(r=>{t[r]={},i.forEach(o=>{t[r][o]=e(`--base-color-${r}-${o}`)})}),n.forEach(r=>{t[r]={},t[r].DEFAULT=e(`--ui-color-${r}`),i.forEach(o=>{t[r][o]=e(`--ui-color-${r}-${o}`)}),l.forEach(o=>{t[r][o]=e(`--ui-color-${r}-${o}`)})});const d={text:{color:e("--ui-text")},"text-dimmed":{color:e("--ui-text-dimmed")},"text-muted":{color:e("--ui-text-muted")},"text-toned":{color:e("--ui-text-toned")},"text-highlighted":{color:e("--ui-text-highlighted")},"text-inverted":{color:e("--ui-text-inverted")},bg:{"background-color":e("--ui-bg")},"bg-muted":{"background-color":e("--ui-bg-muted")},"bg-elevated":{"background-color":e("--ui-bg-elevated")},"bg-accented":{"background-color":e("--ui-bg-accented")},"bg-inverted":{"background-color":e("--ui-bg-inverted")},border:{"border-color":e("--ui-border")},"border-muted":{"border-color":e("--ui-border-muted")},"border-accented":{"border-color":e("--ui-border-accented")},"border-inverted":{"border-color":e("--ui-border-inverted")}},u={};Object.entries(d).forEach(([r,o])=>{u[`.${r}`]=o});const b=[];return Object.entries(d).forEach(([r,o])=>{b.push([r,o])}),{colors:t,classes:d,rules:b,utilities:u}}exports.themePreset=s;
|
package/dist/esm/hooks/theme.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { useColorMode as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { useColorMode as H, useCycleList as J, useStyleTag as K } from "@vueuse/core";
|
|
2
|
+
import { hex2rgb as P } from "colorizr";
|
|
3
|
+
import { storeToRefs as Q } from "pinia";
|
|
4
|
+
import { watchEffect as U, computed as h, watch as W, readonly as E } from "vue";
|
|
5
5
|
import "lodash-es";
|
|
6
|
-
import { useThemeStore as
|
|
6
|
+
import { useThemeStore as X } from "../stores/theme.js";
|
|
7
|
+
import { useManage as Y } from "./manage.js";
|
|
7
8
|
import { themeColor as Z } from "./themeColor.js";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const d = Y(), { mode: M } = X(d), v = J({
|
|
9
|
+
function ie() {
|
|
10
|
+
var V, B;
|
|
11
|
+
const d = X(), { mode: M } = Q(d), v = H({
|
|
12
12
|
storageRef: M
|
|
13
|
-
}), g =
|
|
13
|
+
}), g = Y(), { state: C, next: I } = J(["dark", "light", "auto"], {
|
|
14
14
|
initialValue: v.store.value
|
|
15
15
|
});
|
|
16
|
-
|
|
17
|
-
v.value =
|
|
16
|
+
U(() => {
|
|
17
|
+
v.value = C.value;
|
|
18
18
|
});
|
|
19
19
|
const f = h(() => {
|
|
20
|
-
const { system: t, store:
|
|
21
|
-
return
|
|
20
|
+
const { system: t, store: e } = v;
|
|
21
|
+
return e.value === "auto" ? t.value === "dark" : e.value === "dark";
|
|
22
22
|
}), L = h(() => {
|
|
23
|
-
var t,
|
|
23
|
+
var t, e, o, s, r, i, n, l;
|
|
24
24
|
return f.value ? {
|
|
25
|
-
logo: (
|
|
26
|
-
banner: (
|
|
25
|
+
logo: (e = (t = g.config) == null ? void 0 : t.theme) == null ? void 0 : e.darkLogo,
|
|
26
|
+
banner: (s = (o = g.config) == null ? void 0 : o.theme) == null ? void 0 : s.darkBanner
|
|
27
27
|
} : {
|
|
28
28
|
logo: (i = (r = g.config) == null ? void 0 : r.theme) == null ? void 0 : i.logo,
|
|
29
|
-
banner: (
|
|
29
|
+
banner: (l = (n = g.config) == null ? void 0 : n.theme) == null ? void 0 : l.banner
|
|
30
30
|
};
|
|
31
31
|
}), c = { ...{
|
|
32
32
|
colors: Z,
|
|
@@ -57,89 +57,92 @@ function le() {
|
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
colorBase: { white: "#ffffff", black: "#000000" }
|
|
60
|
-
}, ...(
|
|
60
|
+
}, ...(B = (V = g.config) == null ? void 0 : V.theme) == null ? void 0 : B.config }, { colorShades: S, colorTypes: k } = c, m = h(() => d.theme), x = h(() => Object.keys(c.colors)), w = ["default", "hover", "pressed", "focus", "disabled"];
|
|
61
61
|
function O() {
|
|
62
62
|
return f.value ? c.colorScenes.dark : c.colorScenes.light;
|
|
63
63
|
}
|
|
64
|
-
function
|
|
64
|
+
function T(t, e) {
|
|
65
65
|
var r;
|
|
66
|
-
const
|
|
67
|
-
if ((r =
|
|
68
|
-
const i =
|
|
66
|
+
const o = O(), s = o.default;
|
|
67
|
+
if ((r = o.overrides) != null && r[t]) {
|
|
68
|
+
const i = o.overrides[t], n = i == null ? void 0 : i[e];
|
|
69
69
|
if (n)
|
|
70
70
|
return n;
|
|
71
71
|
}
|
|
72
|
-
return
|
|
72
|
+
return s[e] || "500";
|
|
73
73
|
}
|
|
74
|
-
function
|
|
75
|
-
var
|
|
76
|
-
const
|
|
77
|
-
return ((
|
|
74
|
+
function y(t, e) {
|
|
75
|
+
var s;
|
|
76
|
+
const o = m.value[t];
|
|
77
|
+
return ((s = c.colors[o]) == null ? void 0 : s[e]) || "";
|
|
78
78
|
}
|
|
79
|
-
function a(t,
|
|
80
|
-
const r = (f.value ? c.colorSemantic.dark : c.colorSemantic.light)[t][
|
|
81
|
-
return r === "white" || r === "black" ? `var(--color-${r})` : `var(--base-color-${
|
|
79
|
+
function a(t, e, o) {
|
|
80
|
+
const r = (f.value ? c.colorSemantic.dark : c.colorSemantic.light)[t][e];
|
|
81
|
+
return r === "white" || r === "black" ? `var(--color-${r})` : `var(--base-color-${o}-${r})`;
|
|
82
82
|
}
|
|
83
|
-
|
|
83
|
+
const $ = (t) => {
|
|
84
|
+
const e = P(t);
|
|
85
|
+
return `${e.r} ${e.g} ${e.b}`;
|
|
86
|
+
};
|
|
87
|
+
function p() {
|
|
84
88
|
var r, i;
|
|
85
89
|
const t = [];
|
|
86
|
-
Object.entries(c.colors).forEach(([n,
|
|
87
|
-
typeof
|
|
90
|
+
Object.entries(c.colors).forEach(([n, l]) => {
|
|
91
|
+
typeof l == "object" && Object.entries(l).forEach(([u, b]) => {
|
|
88
92
|
try {
|
|
89
|
-
|
|
90
|
-
t.push(`--base-color-${n}-${u}: ${H};`);
|
|
93
|
+
t.push(`--base-color-${n}-${u}: ${$(b)};`);
|
|
91
94
|
} catch {
|
|
92
95
|
t.push(`--base-color-${n}-${u}: ${b};`);
|
|
93
96
|
}
|
|
94
97
|
});
|
|
95
98
|
});
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
const
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
}),
|
|
102
|
-
const b =
|
|
103
|
-
u === "default" ?
|
|
99
|
+
const e = [];
|
|
100
|
+
k.forEach((n) => {
|
|
101
|
+
const l = m.value[n];
|
|
102
|
+
S.forEach((u) => {
|
|
103
|
+
e.push(`--ui-color-${n}-${u}: var(--base-color-${l}-${u});`);
|
|
104
|
+
}), w.forEach((u) => {
|
|
105
|
+
const b = T(n, u);
|
|
106
|
+
u === "default" ? e.push(`--ui-color-${n}: var(--base-color-${l}-${b});`) : e.push(`--ui-color-${n}-${u}: var(--base-color-${l}-${b});`);
|
|
104
107
|
});
|
|
105
108
|
});
|
|
106
|
-
const
|
|
107
|
-
`--color-white: ${((r = c.colorBase) == null ? void 0 : r.white) || "#ffffff"};`,
|
|
108
|
-
`--color-black: ${((i = c.colorBase) == null ? void 0 : i.black) || "#000000"};`,
|
|
109
|
-
`--ui-text-dimmed: ${a("text", "dimmed",
|
|
110
|
-
`--ui-text-muted: ${a("text", "muted",
|
|
111
|
-
`--ui-text-toned: ${a("text", "toned",
|
|
112
|
-
`--ui-text: ${a("text", "base",
|
|
113
|
-
`--ui-text-highlighted: ${a("text", "highlighted",
|
|
114
|
-
`--ui-text-inverted: ${a("text", "inverted",
|
|
115
|
-
`--ui-bg: ${a("bg", "base",
|
|
116
|
-
`--ui-bg-muted: ${a("bg", "muted",
|
|
117
|
-
`--ui-bg-elevated: ${a("bg", "elevated",
|
|
118
|
-
`--ui-bg-accented: ${a("bg", "accented",
|
|
119
|
-
`--ui-bg-inverted: ${a("bg", "inverted",
|
|
120
|
-
`--ui-border: ${a("border", "base",
|
|
121
|
-
`--ui-border-muted: ${a("border", "muted",
|
|
122
|
-
`--ui-border-accented: ${a("border", "accented",
|
|
123
|
-
`--ui-border-inverted: ${a("border", "inverted",
|
|
109
|
+
const o = m.value.gray, s = [
|
|
110
|
+
`--color-white: ${$(((r = c.colorBase) == null ? void 0 : r.white) || "#ffffff")};`,
|
|
111
|
+
`--color-black: ${$(((i = c.colorBase) == null ? void 0 : i.black) || "#000000")};`,
|
|
112
|
+
`--ui-text-dimmed: ${a("text", "dimmed", o)};`,
|
|
113
|
+
`--ui-text-muted: ${a("text", "muted", o)};`,
|
|
114
|
+
`--ui-text-toned: ${a("text", "toned", o)};`,
|
|
115
|
+
`--ui-text: ${a("text", "base", o)};`,
|
|
116
|
+
`--ui-text-highlighted: ${a("text", "highlighted", o)};`,
|
|
117
|
+
`--ui-text-inverted: ${a("text", "inverted", o)};`,
|
|
118
|
+
`--ui-bg: ${a("bg", "base", o)};`,
|
|
119
|
+
`--ui-bg-muted: ${a("bg", "muted", o)};`,
|
|
120
|
+
`--ui-bg-elevated: ${a("bg", "elevated", o)};`,
|
|
121
|
+
`--ui-bg-accented: ${a("bg", "accented", o)};`,
|
|
122
|
+
`--ui-bg-inverted: ${a("bg", "inverted", o)};`,
|
|
123
|
+
`--ui-border: ${a("border", "base", o)};`,
|
|
124
|
+
`--ui-border-muted: ${a("border", "muted", o)};`,
|
|
125
|
+
`--ui-border-accented: ${a("border", "accented", o)};`,
|
|
126
|
+
`--ui-border-inverted: ${a("border", "inverted", o)};`
|
|
124
127
|
];
|
|
125
128
|
return `:root {
|
|
126
129
|
${t.join(`
|
|
127
130
|
`)}
|
|
128
|
-
${
|
|
131
|
+
${e.join(`
|
|
129
132
|
`)}
|
|
130
|
-
${
|
|
133
|
+
${s.join(`
|
|
131
134
|
`)}
|
|
132
135
|
}`;
|
|
133
136
|
}
|
|
134
|
-
const { css:
|
|
137
|
+
const { css: j } = K(p(), { id: "theme-variables" });
|
|
135
138
|
function R() {
|
|
136
|
-
d.cssInit || (d.setCssInit(),
|
|
139
|
+
d.cssInit || (d.setCssInit(), j.value = p());
|
|
137
140
|
}
|
|
138
|
-
|
|
139
|
-
d.cssInit && (
|
|
141
|
+
W([m, f], () => {
|
|
142
|
+
d.cssInit && (j.value = p());
|
|
140
143
|
}, { deep: !0, immediate: !1 });
|
|
141
|
-
function D(t,
|
|
142
|
-
|
|
144
|
+
function D(t, e) {
|
|
145
|
+
x.value.includes(e) ? d.setThemeColor(t, e) : console.warn(`Color "${e}" is not available`);
|
|
143
146
|
}
|
|
144
147
|
function G(t) {
|
|
145
148
|
d.setThemeColors(t);
|
|
@@ -147,30 +150,30 @@ function le() {
|
|
|
147
150
|
function q() {
|
|
148
151
|
d.resetTheme();
|
|
149
152
|
}
|
|
150
|
-
function z(t,
|
|
151
|
-
return
|
|
153
|
+
function z(t, e) {
|
|
154
|
+
return y(t, e);
|
|
152
155
|
}
|
|
153
|
-
function A(t,
|
|
154
|
-
|
|
155
|
-
const
|
|
156
|
-
return
|
|
156
|
+
function A(t, e) {
|
|
157
|
+
e || (e = "default");
|
|
158
|
+
const o = T(t, e);
|
|
159
|
+
return y(t, o);
|
|
157
160
|
}
|
|
158
|
-
function F(t,
|
|
159
|
-
var i, n
|
|
160
|
-
const
|
|
161
|
-
return r === "white" ?
|
|
161
|
+
function F(t, e) {
|
|
162
|
+
var i, n;
|
|
163
|
+
const o = m.value.gray, r = (f.value ? c.colorSemantic.dark : c.colorSemantic.light)[t][e];
|
|
164
|
+
return r === "white" ? "#ffffff" : r === "black" ? ((i = c.colorBase) == null ? void 0 : i.black) || "#000000" : ((n = c.colors[o]) == null ? void 0 : n[r]) || "";
|
|
162
165
|
}
|
|
163
166
|
return {
|
|
164
167
|
toggle: I,
|
|
165
|
-
mode:
|
|
168
|
+
mode: C,
|
|
166
169
|
isDark: f,
|
|
167
170
|
resources: L,
|
|
168
171
|
config: E(c),
|
|
169
172
|
colorMapping: E(m),
|
|
170
|
-
colors:
|
|
171
|
-
colorShades:
|
|
172
|
-
colorTypes:
|
|
173
|
-
colorScenes:
|
|
173
|
+
colors: x,
|
|
174
|
+
colorShades: S,
|
|
175
|
+
colorTypes: k,
|
|
176
|
+
colorScenes: w,
|
|
174
177
|
cssInit: R,
|
|
175
178
|
cssReset: q,
|
|
176
179
|
setColor: D,
|
|
@@ -181,5 +184,5 @@ function le() {
|
|
|
181
184
|
};
|
|
182
185
|
}
|
|
183
186
|
export {
|
|
184
|
-
|
|
187
|
+
ie as useTheme
|
|
185
188
|
};
|
package/dist/esm/utils/theme.js
CHANGED
|
@@ -1,82 +1,85 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
function r(c) {
|
|
2
|
+
return `rgb(var(${c}))`;
|
|
3
|
+
}
|
|
4
|
+
function s(c) {
|
|
5
|
+
const t = {}, i = ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900", "950"], n = ["primary", "info", "success", "warning", "error", "gray"], l = ["hover", "pressed", "focus", "disabled"];
|
|
6
|
+
t.white = { DEFAULT: r("--color-white") }, t.black = { DEFAULT: r("--color-black") }, Object.keys(c).forEach((o) => {
|
|
7
|
+
t[o] = {}, i.forEach((e) => {
|
|
8
|
+
t[o][e] = r(`--base-color-${o}-${e}`);
|
|
6
9
|
});
|
|
7
|
-
}),
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}),
|
|
11
|
-
|
|
10
|
+
}), n.forEach((o) => {
|
|
11
|
+
t[o] = {}, t[o].DEFAULT = r(`--ui-color-${o}`), i.forEach((e) => {
|
|
12
|
+
t[o][e] = r(`--ui-color-${o}-${e}`);
|
|
13
|
+
}), l.forEach((e) => {
|
|
14
|
+
t[o][e] = r(`--ui-color-${o}-${e}`);
|
|
12
15
|
});
|
|
13
16
|
});
|
|
14
|
-
const
|
|
17
|
+
const d = {
|
|
15
18
|
// 文字颜色
|
|
16
19
|
text: {
|
|
17
|
-
color: "
|
|
20
|
+
color: r("--ui-text")
|
|
18
21
|
},
|
|
19
22
|
"text-dimmed": {
|
|
20
|
-
color: "
|
|
23
|
+
color: r("--ui-text-dimmed")
|
|
21
24
|
},
|
|
22
25
|
"text-muted": {
|
|
23
|
-
color: "
|
|
26
|
+
color: r("--ui-text-muted")
|
|
24
27
|
},
|
|
25
28
|
"text-toned": {
|
|
26
|
-
color: "
|
|
29
|
+
color: r("--ui-text-toned")
|
|
27
30
|
},
|
|
28
31
|
"text-highlighted": {
|
|
29
|
-
color: "
|
|
32
|
+
color: r("--ui-text-highlighted")
|
|
30
33
|
},
|
|
31
34
|
"text-inverted": {
|
|
32
|
-
color: "
|
|
35
|
+
color: r("--ui-text-inverted")
|
|
33
36
|
},
|
|
34
37
|
// 背景颜色
|
|
35
38
|
bg: {
|
|
36
|
-
"background-color": "
|
|
39
|
+
"background-color": r("--ui-bg")
|
|
37
40
|
},
|
|
38
41
|
"bg-muted": {
|
|
39
|
-
"background-color": "
|
|
42
|
+
"background-color": r("--ui-bg-muted")
|
|
40
43
|
},
|
|
41
44
|
"bg-elevated": {
|
|
42
|
-
"background-color": "
|
|
45
|
+
"background-color": r("--ui-bg-elevated")
|
|
43
46
|
},
|
|
44
47
|
"bg-accented": {
|
|
45
|
-
"background-color": "
|
|
48
|
+
"background-color": r("--ui-bg-accented")
|
|
46
49
|
},
|
|
47
50
|
"bg-inverted": {
|
|
48
|
-
"background-color": "
|
|
51
|
+
"background-color": r("--ui-bg-inverted")
|
|
49
52
|
},
|
|
50
53
|
// 边框颜色
|
|
51
54
|
border: {
|
|
52
|
-
"border-color": "
|
|
55
|
+
"border-color": r("--ui-border")
|
|
53
56
|
},
|
|
54
57
|
"border-muted": {
|
|
55
|
-
"border-color": "
|
|
58
|
+
"border-color": r("--ui-border-muted")
|
|
56
59
|
},
|
|
57
60
|
"border-accented": {
|
|
58
|
-
"border-color": "
|
|
61
|
+
"border-color": r("--ui-border-accented")
|
|
59
62
|
},
|
|
60
63
|
"border-inverted": {
|
|
61
|
-
"border-color": "
|
|
64
|
+
"border-color": r("--ui-border-inverted")
|
|
62
65
|
}
|
|
63
|
-
},
|
|
64
|
-
Object.entries(
|
|
65
|
-
|
|
66
|
+
}, u = {};
|
|
67
|
+
Object.entries(d).forEach(([o, e]) => {
|
|
68
|
+
u[`.${o}`] = e;
|
|
66
69
|
});
|
|
67
|
-
const
|
|
68
|
-
return Object.entries(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
const b = [];
|
|
71
|
+
return Object.entries(d).forEach(([o, e]) => {
|
|
72
|
+
b.push([
|
|
73
|
+
o,
|
|
74
|
+
e
|
|
72
75
|
]);
|
|
73
76
|
}), {
|
|
74
|
-
colors:
|
|
75
|
-
classes:
|
|
76
|
-
rules:
|
|
77
|
-
utilities:
|
|
77
|
+
colors: t,
|
|
78
|
+
classes: d,
|
|
79
|
+
rules: b,
|
|
80
|
+
utilities: u
|
|
78
81
|
};
|
|
79
|
-
}
|
|
82
|
+
}
|
|
80
83
|
export {
|
|
81
|
-
|
|
84
|
+
s as themePreset
|
|
82
85
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
colors: Record<string, Record<string,
|
|
1
|
+
export declare function themePreset(themeColor: Record<string, any>): {
|
|
2
|
+
colors: Record<string, Record<string, any>>;
|
|
3
3
|
classes: {
|
|
4
4
|
text: {
|
|
5
5
|
color: string;
|