@quidgest/ui 0.16.34 → 0.16.35
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/json/api.json +1 -1
- package/dist/ui.esm.js +2823 -2753
- package/dist/ui.js +19 -19
- package/dist/ui.min.js +773 -760
- package/dist/ui.scss +1 -1
- package/esm/composables/useColor/index.js +3 -3
- package/esm/index.d.ts +2 -1
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +8 -6
- package/esm/utils/color/contrast.js +10 -3
- package/esm/utils/color/index.d.ts +3 -3
- package/esm/utils/color/index.d.ts.map +1 -1
- package/esm/utils/color/manipulate.js +16 -8
- package/esm/utils/color/merge.js +49 -0
- package/esm/utils/index.d.ts +2 -0
- package/esm/utils/index.d.ts.map +1 -0
- package/esm/utils/index.js +20 -0
- package/package.json +1 -1
package/dist/ui.scss
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { computed as l, unref as g } from "vue";
|
|
2
2
|
import { useTheme as v } from "../theme.js";
|
|
3
3
|
import { rgbToHsl as p, rgbToHex as b, rgbToVariableString as c } from "../../utils/color/conversion.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { getContrastingColor as d } from "../../utils/color/contrast.js";
|
|
5
|
+
import { darken as y } from "../../utils/color/manipulate.js";
|
|
6
6
|
import { parseColor as T } from "../../utils/color/parse.js";
|
|
7
7
|
function K(o) {
|
|
8
8
|
const e = l(() => g(o)), i = l(
|
|
@@ -23,7 +23,7 @@ function K(o) {
|
|
|
23
23
|
console.error("Failed to parse color:", s);
|
|
24
24
|
return;
|
|
25
25
|
}
|
|
26
|
-
const f = p(r), a =
|
|
26
|
+
const f = p(r), a = d(f.l), u = y(r, 25), h = b(u);
|
|
27
27
|
return {
|
|
28
28
|
mainColor: n,
|
|
29
29
|
mainColorRgb: c(r),
|
package/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { FrameworkConfig } from './framework';
|
|
2
2
|
import * as templates from './templates';
|
|
3
3
|
import * as components from './components';
|
|
4
|
+
import * as utils from './utils';
|
|
4
5
|
export declare const createFramework: (options?: FrameworkConfig) => import('vue').Plugin;
|
|
5
|
-
export { templates, components };
|
|
6
|
+
export { templates, components, utils };
|
|
6
7
|
export * from './composables';
|
|
7
8
|
//# sourceMappingURL=index.d.ts.map
|
|
8
9
|
declare module '@vue/runtime-core' {
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAC1C,OAAO,KAAK,KAAK,MAAM,SAAS,CAAA;AAIhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe,aAAa,eAAe,yBAEvD,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;AACvC,cAAc,eAAe,CAAA"}
|
package/esm/index.js
CHANGED
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import * as t from "./templates/index.js";
|
|
2
2
|
import * as r from "./components/index.js";
|
|
3
|
+
import * as m from "./utils/index.js";
|
|
3
4
|
import { createFramework as o } from "./framework.js";
|
|
4
|
-
import { provideTheme as n, useTheme as
|
|
5
|
+
import { provideTheme as n, useTheme as x } from "./composables/theme.js";
|
|
5
6
|
import { useDialog as c } from "./composables/useDialog/index.js";
|
|
6
|
-
import { useToast as
|
|
7
|
-
const
|
|
7
|
+
import { useToast as d } from "./composables/useToast/index.js";
|
|
8
|
+
const s = (e = {}) => o({ components: r, ...e });
|
|
8
9
|
export {
|
|
9
10
|
r as components,
|
|
10
|
-
|
|
11
|
+
s as createFramework,
|
|
11
12
|
n as provideTheme,
|
|
12
13
|
t as templates,
|
|
13
14
|
c as useDialog,
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
x as useTheme,
|
|
16
|
+
d as useToast,
|
|
17
|
+
m as utils
|
|
16
18
|
};
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { rgbToHex as t } from "./conversion.js";
|
|
2
|
+
import { parseColor as e } from "./parse.js";
|
|
3
|
+
function g(o) {
|
|
4
|
+
return o > 50 ? "#000" : "#fff";
|
|
5
|
+
}
|
|
6
|
+
function l(o) {
|
|
7
|
+
const r = e(o);
|
|
8
|
+
return r.r = 255 - r.r, r.g = 255 - r.g, r.b = 255 - r.b, t(r);
|
|
3
9
|
}
|
|
4
10
|
export {
|
|
5
|
-
|
|
11
|
+
l as getComplementaryColor,
|
|
12
|
+
g as getContrastingColor
|
|
6
13
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './parse';
|
|
1
|
+
export * from './contrast';
|
|
3
2
|
export * from './conversion';
|
|
4
3
|
export * from './manipulate';
|
|
5
|
-
export * from './contrast';
|
|
6
4
|
export * from './merge';
|
|
5
|
+
export * from './parse';
|
|
6
|
+
export * from './types';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/color/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/color/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { rgbToHsl as
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { rgbToHsl as l, hslToRgb as o } from "./conversion.js";
|
|
2
|
+
function i(t, r) {
|
|
3
|
+
if (r < 0 || r > 100)
|
|
4
|
+
throw new Error("Amount must be in the range [0, 100]");
|
|
5
|
+
if (r === 0)
|
|
6
|
+
return t;
|
|
7
|
+
const e = l(t), n = r / 100;
|
|
8
|
+
return e.l = e.l + n * (100 - e.l), o(e);
|
|
5
9
|
}
|
|
6
|
-
function f(t,
|
|
7
|
-
|
|
8
|
-
|
|
10
|
+
function f(t, r) {
|
|
11
|
+
if (r < 0 || r > 100)
|
|
12
|
+
throw new Error("Amount must be in the range [0, 100]");
|
|
13
|
+
if (r === 0)
|
|
14
|
+
return t;
|
|
15
|
+
const e = l(t), n = r / 100;
|
|
16
|
+
return e.l = e.l - n * e.l, o(e);
|
|
9
17
|
}
|
|
10
18
|
export {
|
|
11
19
|
f as darken,
|
|
12
|
-
|
|
20
|
+
i as lighten
|
|
13
21
|
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { getComplementaryColor as y, getContrastingColor as C } from "./contrast.js";
|
|
2
|
+
import { rgbToHex as p, rgbToHsl as d } from "./conversion.js";
|
|
3
|
+
import { lighten as K, darken as $ } from "./manipulate.js";
|
|
4
|
+
import { parseColor as f } from "./parse.js";
|
|
5
|
+
function U(m, o) {
|
|
6
|
+
const n = { ...m }, l = (t, r) => {
|
|
7
|
+
const i = f(t), a = p(K(i, 85)), c = p($(i, 25)), e = r.toString().replace(/(Light|Dark)$/, "");
|
|
8
|
+
return {
|
|
9
|
+
[e]: t,
|
|
10
|
+
[`${e}Light`]: a,
|
|
11
|
+
[`${e}Dark`]: c
|
|
12
|
+
};
|
|
13
|
+
}, s = (t) => {
|
|
14
|
+
const r = f(t), i = d(r);
|
|
15
|
+
return C(i.l);
|
|
16
|
+
}, k = [
|
|
17
|
+
"primary",
|
|
18
|
+
"secondary",
|
|
19
|
+
"highlight",
|
|
20
|
+
"info",
|
|
21
|
+
"success",
|
|
22
|
+
"warning",
|
|
23
|
+
"danger",
|
|
24
|
+
"neutral"
|
|
25
|
+
];
|
|
26
|
+
for (const t of k) {
|
|
27
|
+
const r = t, i = `${t}Light`, a = `${t}Dark`, c = `on${t.charAt(0).toUpperCase() + t.slice(1)}`, e = `on${t.charAt(0).toUpperCase() + t.slice(1)}Light`, g = `on${t.charAt(0).toUpperCase() + t.slice(1)}Dark`;
|
|
28
|
+
if (o[r]) {
|
|
29
|
+
const h = l(o[r], r);
|
|
30
|
+
Object.assign(n, h), n[c] = s(o[r]), n[e] = s(h[i]), n[g] = s(h[a]);
|
|
31
|
+
}
|
|
32
|
+
o[r] || (o[i] && (n[i] = o[i], o[e] || (n[e] = s(o[i]))), o[a] && (n[a] = o[a], o[g] || (n[g] = s(o[a])))), o[c] && (n[c] = o[c]), o[e] && (n[e] = o[e]), o[g] && (n[g] = o[g]);
|
|
33
|
+
}
|
|
34
|
+
if (o.primary && !o.highlight) {
|
|
35
|
+
const t = y(o.primary), r = l(t, "highlight");
|
|
36
|
+
Object.assign(n, r), n.onHighlight = s(t), n.onHighlightLight = s(r.highlightLight), n.onHighlightDark = s(r.highlightDark);
|
|
37
|
+
}
|
|
38
|
+
const u = ["background", "container"];
|
|
39
|
+
for (const t of u)
|
|
40
|
+
if (o[t]) {
|
|
41
|
+
n[t] = o[t];
|
|
42
|
+
const r = `on${t.charAt(0).toUpperCase() + t.slice(1)}`;
|
|
43
|
+
o[r] || (n[r] = s(o[t]));
|
|
44
|
+
}
|
|
45
|
+
return o.onBackground && (n.onBackground = o.onBackground), o.onContainer && (n.onContainer = o.onContainer), n;
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
U as mergeColorSchemes
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { getComplementaryColor as e, getContrastingColor as t } from "./color/contrast.js";
|
|
2
|
+
import { hslToRgb as l, hueToRgb as m, rgbToHex as a, rgbToHsl as b, rgbToVariableString as p } from "./color/conversion.js";
|
|
3
|
+
import { darken as x, lighten as i } from "./color/manipulate.js";
|
|
4
|
+
import { mergeColorSchemes as C } from "./color/merge.js";
|
|
5
|
+
import { isValidHex as T, parseColor as h, tryParseRgb as H } from "./color/parse.js";
|
|
6
|
+
export {
|
|
7
|
+
x as darken,
|
|
8
|
+
e as getComplementaryColor,
|
|
9
|
+
t as getContrastingColor,
|
|
10
|
+
l as hslToRgb,
|
|
11
|
+
m as hueToRgb,
|
|
12
|
+
T as isValidHex,
|
|
13
|
+
i as lighten,
|
|
14
|
+
C as mergeColorSchemes,
|
|
15
|
+
h as parseColor,
|
|
16
|
+
a as rgbToHex,
|
|
17
|
+
b as rgbToHsl,
|
|
18
|
+
p as rgbToVariableString,
|
|
19
|
+
H as tryParseRgb
|
|
20
|
+
};
|