@nmorph/nmorph-ui-kit 3.0.14 → 3.0.16
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/components/basic/nmorph-text/NmorphText.vue.js +15 -9
- package/dist/components/basic/nmorph-text/NmorphText.vue2.js +4 -2
- package/dist/components/form/nmorph-select/components/nmorph-select-option/NmorphSelectOption.css +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/outside-hooks/use-nmorph-theme.js +23 -23
- package/dist/package.json.js +1 -1
- package/dist/src/components/basic/nmorph-text/NmorphText.vue.d.ts +1 -0
- package/dist/src/components/basic/nmorph-text/types.d.ts +1 -0
- package/dist/src/types/common.types.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/common.types.js +1 -0
- package/package.json +1 -1
|
@@ -16,9 +16,9 @@ const $ = {
|
|
|
16
16
|
black: "#000000",
|
|
17
17
|
overlay: "#00000095"
|
|
18
18
|
}, V = {
|
|
19
|
-
darkShade: "#
|
|
19
|
+
darkShade: "#c4c8ca",
|
|
20
20
|
main: "#e9ecec",
|
|
21
|
-
lightShade: "#
|
|
21
|
+
lightShade: "#fcfcfc",
|
|
22
22
|
text: "#687b9e",
|
|
23
23
|
scrollThumb: "#687b9e",
|
|
24
24
|
accent: "#4a90e2",
|
|
@@ -27,9 +27,9 @@ const $ = {
|
|
|
27
27
|
semiContrastText: "#8a9dc0",
|
|
28
28
|
contrastText: "#b4c4de"
|
|
29
29
|
}, F = {
|
|
30
|
-
darkShade: "#
|
|
30
|
+
darkShade: "#131415",
|
|
31
31
|
main: "#1c1f21",
|
|
32
|
-
lightShade: "#
|
|
32
|
+
lightShade: "#242728",
|
|
33
33
|
text: "#778288",
|
|
34
34
|
scrollThumb: "#778288",
|
|
35
35
|
accent: "#006cb6",
|
|
@@ -48,7 +48,7 @@ const $ = {
|
|
|
48
48
|
darkShadeGeneratorCoefficient: -45,
|
|
49
49
|
lightShadeGeneratorCoefficient: 45,
|
|
50
50
|
other: {
|
|
51
|
-
baseShadowWidth: "
|
|
51
|
+
baseShadowWidth: "2px",
|
|
52
52
|
baseShadowBlurCoefficient: "2"
|
|
53
53
|
}
|
|
54
54
|
}, U = (r) => /^#[0-9A-Fa-f]{6}$/.test(r), L = (r) => {
|
|
@@ -64,8 +64,8 @@ const $ = {
|
|
|
64
64
|
}, y = (r, e) => {
|
|
65
65
|
let n = parseInt(r.substring(1, 3), 16), a = parseInt(r.substring(3, 5), 16), s = parseInt(r.substring(5, 7), 16);
|
|
66
66
|
n = Math.round(n * (1 + e / 100)), a = Math.round(a * (1 + e / 100)), s = Math.round(s * (1 + e / 100)), n = Math.min(255, Math.max(0, n)), a = Math.min(255, Math.max(0, a)), s = Math.min(255, Math.max(0, s));
|
|
67
|
-
const
|
|
68
|
-
return `#${
|
|
67
|
+
const c = n.toString(16).padStart(2, "0"), i = a.toString(16).padStart(2, "0"), d = s.toString(16).padStart(2, "0");
|
|
68
|
+
return `#${c}${i}${d}`;
|
|
69
69
|
}, G = (r) => ({
|
|
70
70
|
themes: r?.themes ?? C.themes,
|
|
71
71
|
defaultTheme: r?.defaultTheme ?? C.defaultTheme,
|
|
@@ -87,14 +87,14 @@ const $ = {
|
|
|
87
87
|
name: `--nmorph-${E(e)}-color`,
|
|
88
88
|
color: n
|
|
89
89
|
})), P = (r, e) => {
|
|
90
|
-
const n = (
|
|
91
|
-
return Object.entries(r).forEach(([
|
|
92
|
-
const
|
|
93
|
-
if (
|
|
90
|
+
const n = (c) => c.map((i) => `${i.name}: ${i.color};`).join(" "), a = Object.entries(e).map(([c, i]) => `--${E(c)}: ${i};`).join(" "), s = [];
|
|
91
|
+
return Object.entries(r).forEach(([c, i]) => {
|
|
92
|
+
const d = x($);
|
|
93
|
+
if (c === "common") s.push(n(A(d, i)));
|
|
94
94
|
else {
|
|
95
95
|
const S = `
|
|
96
|
-
&[${T}='${
|
|
97
|
-
${n(
|
|
96
|
+
&[${T}='${c}'] {
|
|
97
|
+
${n(i)}
|
|
98
98
|
}
|
|
99
99
|
`;
|
|
100
100
|
s.push(S);
|
|
@@ -109,8 +109,8 @@ const $ = {
|
|
|
109
109
|
const e = {};
|
|
110
110
|
return Object.entries(r.themes).forEach(([n, a]) => {
|
|
111
111
|
e[n] = [];
|
|
112
|
-
const s = !!a.darkShade,
|
|
113
|
-
!!a.main && !s && !
|
|
112
|
+
const s = !!a.darkShade, c = !!a.lightShade;
|
|
113
|
+
!!a.main && !s && !c && a.main && (e[n] = x(N(r, a.main))), e[n] = [...e[n], ...x(a)];
|
|
114
114
|
}), e;
|
|
115
115
|
}, J = (r) => {
|
|
116
116
|
const e = G(r);
|
|
@@ -133,7 +133,7 @@ const $ = {
|
|
|
133
133
|
}, s = (o) => Object.entries(o).filter(([, t]) => typeof t == "string").map(([t, h]) => ({
|
|
134
134
|
name: `--nmorph-${E(t)}-color`,
|
|
135
135
|
color: h
|
|
136
|
-
})),
|
|
136
|
+
})), c = (o, t) => {
|
|
137
137
|
const h = (f) => f.map((u) => `${u.name}: ${u.color};`).join(" "), m = Object.entries(t).map(([f, u]) => `--${E(f)}: ${u};`).join(" "), b = [];
|
|
138
138
|
return Object.entries(o).forEach(([f, u]) => {
|
|
139
139
|
const k = s($);
|
|
@@ -152,20 +152,20 @@ const $ = {
|
|
|
152
152
|
${m}
|
|
153
153
|
}
|
|
154
154
|
`;
|
|
155
|
-
},
|
|
155
|
+
}, i = (o) => {
|
|
156
156
|
const t = {};
|
|
157
157
|
return Object.entries(o).forEach(([h, m]) => {
|
|
158
158
|
t[h] = [];
|
|
159
159
|
const b = !!m.darkShade, f = !!m.lightShade;
|
|
160
160
|
!!m.main && !b && !f && m.main && (t[h] = a(m.main)), t[h] = [...t[h], ...s(m)];
|
|
161
161
|
}), t;
|
|
162
|
-
},
|
|
163
|
-
let g =
|
|
164
|
-
|
|
162
|
+
}, d = typeof document < "u", S = H(e.defaultTheme);
|
|
163
|
+
let g = i(e.themes), l = null;
|
|
164
|
+
d && (l = document.getElementById("nmorph-theme-styles"), l || (l = document.createElement("style"), l.id = "nmorph-theme-styles", l.type = "text/css", document.head.appendChild(l)), l.innerHTML = c(g, e.other));
|
|
165
165
|
const D = () => {
|
|
166
|
-
g =
|
|
166
|
+
g = i(e.themes), l && (l.innerHTML = c(g, e.other));
|
|
167
167
|
}, p = (o) => {
|
|
168
|
-
S.value = o,
|
|
168
|
+
S.value = o, d && (document.documentElement.setAttribute(T, S.value), !(typeof localStorage > "u") && (e.saveCurrentThemeToLS ? localStorage.setItem(T, o) : localStorage.removeItem(T)));
|
|
169
169
|
}, M = (o, t) => {
|
|
170
170
|
const h = t.main && !t.darkShade && !t.lightShade ? n(t.main) : {};
|
|
171
171
|
e.themes[o] = { ...e.themes[o], ...t, ...h }, D();
|
|
@@ -175,7 +175,7 @@ const $ = {
|
|
|
175
175
|
const o = document.documentElement.getAttribute(T), t = typeof localStorage < "u" ? localStorage.getItem(T) : null, h = t ? g[t] : void 0, m = o ? g[o] : void 0;
|
|
176
176
|
return e.saveCurrentThemeToLS && t && h ? t : o && m ? o : S.value;
|
|
177
177
|
};
|
|
178
|
-
|
|
178
|
+
d ? document.documentElement.hasAttribute(T) ? window.requestAnimationFrame(() => p(v())) : p(v()) : p(S.value);
|
|
179
179
|
const j = e;
|
|
180
180
|
return {
|
|
181
181
|
setTheme: p,
|
package/dist/package.json.js
CHANGED
|
@@ -2,6 +2,7 @@ import { INmorphTextProps, NmorphTextTag } from './types';
|
|
|
2
2
|
import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
|
|
3
3
|
declare const _default: __VLS_WithTemplateSlots< DefineComponent<INmorphTextProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<INmorphTextProps> & Readonly<{}>, {
|
|
4
4
|
color: string;
|
|
5
|
+
text: string | number;
|
|
5
6
|
align: "left" | "right" | "inherit" | "center" | "justify";
|
|
6
7
|
as: NmorphTextTag;
|
|
7
8
|
variant: "body" | "caption" | "body-small" | "body-large" | "label" | "title-small" | "title" | "title-large" | "display-large" | "display-medium" | "control-large" | "control" | "control-small" | "control-tiny";
|
|
@@ -2,6 +2,7 @@ import { NmorphTextAlignType, NmorphTypographyColorType, NmorphTypographyVariant
|
|
|
2
2
|
export type NmorphTextTag = 'span' | 'p' | 'div' | 'label' | 'strong' | 'em' | 'small' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
3
3
|
export interface INmorphTextProps {
|
|
4
4
|
as?: NmorphTextTag;
|
|
5
|
+
text?: string | number;
|
|
5
6
|
variant?: NmorphTypographyVariantType;
|
|
6
7
|
weight?: NmorphTypographyWeightType;
|
|
7
8
|
color?: NmorphTypographyColorType | string;
|
|
@@ -76,6 +76,7 @@ export declare const NmorphTypographyWeight: {
|
|
|
76
76
|
export type NmorphTypographyWeightType = keyof typeof NmorphTypographyWeight;
|
|
77
77
|
export declare const NmorphTypographyColor: {
|
|
78
78
|
readonly text: "text";
|
|
79
|
+
readonly contrast: "contrast";
|
|
79
80
|
readonly 'semi-contrast': "semi-contrast";
|
|
80
81
|
readonly placeholder: "placeholder";
|
|
81
82
|
readonly focus: "focus";
|