@quidgest/ui 0.16.33 → 0.16.34
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 +996 -962
- package/dist/ui.js +5 -5
- package/dist/ui.min.js +867 -867
- package/dist/ui.scss +1 -1
- package/esm/components/QColorPicker/QColorPicker.vue.js +1 -1
- package/esm/components/QToast/QToast.vue.js +44 -42
- package/esm/composables/useColor/index.js +23 -20
- package/esm/templates/theme.d.ts.map +1 -1
- package/esm/templates/theme.js +44 -10
- package/esm/utils/color/contrast.d.ts +18 -0
- package/esm/utils/color/contrast.d.ts.map +1 -0
- package/esm/utils/color/contrast.js +6 -0
- package/esm/utils/color/conversion.d.ts +41 -0
- package/esm/utils/color/conversion.d.ts.map +1 -0
- package/esm/utils/color/conversion.js +59 -0
- package/esm/utils/color/index.d.ts +7 -0
- package/esm/utils/color/index.d.ts.map +1 -0
- package/esm/utils/color/manipulate.d.ts +18 -0
- package/esm/utils/color/manipulate.d.ts.map +1 -0
- package/esm/utils/color/manipulate.js +13 -0
- package/esm/utils/color/merge.d.ts +19 -0
- package/esm/utils/color/merge.d.ts.map +1 -0
- package/esm/utils/color/parse.d.ts +24 -0
- package/esm/utils/color/parse.d.ts.map +1 -0
- package/esm/utils/color/parse.js +26 -0
- package/esm/utils/color/types.d.ts +51 -0
- package/esm/utils/color/types.d.ts.map +1 -0
- package/esm/utils/theme.js +1 -1
- package/package.json +3 -1
- package/esm/utils/color.d.ts +0 -123
- package/esm/utils/color.d.ts.map +0 -1
- package/esm/utils/color.js +0 -97
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
export type BaseColorScheme = {
|
|
2
|
+
primary: string;
|
|
3
|
+
primaryLight: string;
|
|
4
|
+
primaryDark: string;
|
|
5
|
+
secondary: string;
|
|
6
|
+
secondaryLight: string;
|
|
7
|
+
secondaryDark: string;
|
|
8
|
+
highlight: string;
|
|
9
|
+
highlightLight: string;
|
|
10
|
+
highlightDark: string;
|
|
11
|
+
info: string;
|
|
12
|
+
infoLight: string;
|
|
13
|
+
infoDark: string;
|
|
14
|
+
success: string;
|
|
15
|
+
successLight: string;
|
|
16
|
+
successDark: string;
|
|
17
|
+
warning: string;
|
|
18
|
+
warningLight: string;
|
|
19
|
+
warningDark: string;
|
|
20
|
+
danger: string;
|
|
21
|
+
dangerLight: string;
|
|
22
|
+
dangerDark: string;
|
|
23
|
+
background: string;
|
|
24
|
+
container: string;
|
|
25
|
+
neutral: string;
|
|
26
|
+
neutralLight: string;
|
|
27
|
+
neutralDark: string;
|
|
28
|
+
};
|
|
29
|
+
type Capitalize<S extends string> = S extends `${infer F}${infer R}` ? `${Uppercase<F>}${R}` : S;
|
|
30
|
+
type OnVariants<T> = {
|
|
31
|
+
[K in keyof T as `on${Capitalize<string & K>}`]: string;
|
|
32
|
+
};
|
|
33
|
+
export type ColorScheme = BaseColorScheme & OnVariants<BaseColorScheme>;
|
|
34
|
+
/**
|
|
35
|
+
* Represents a color in RGB space.
|
|
36
|
+
*/
|
|
37
|
+
export type RGB = {
|
|
38
|
+
r: number;
|
|
39
|
+
g: number;
|
|
40
|
+
b: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Represents a color in HSL space.
|
|
44
|
+
*/
|
|
45
|
+
export type HSL = {
|
|
46
|
+
h: number;
|
|
47
|
+
s: number;
|
|
48
|
+
l: number;
|
|
49
|
+
};
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/color/types.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,eAAe,GAAG;IAE7B,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IAEnB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM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jB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;CACT,CAAA"}
|
package/esm/utils/theme.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quidgest/ui",
|
|
3
3
|
"description": "Quidgest's UI framework",
|
|
4
|
-
"version": "0.16.
|
|
4
|
+
"version": "0.16.34",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"author": "Quidgest",
|
|
@@ -39,6 +39,8 @@
|
|
|
39
39
|
"./templates/*": "./esm/templates/*.js",
|
|
40
40
|
"./components": "./esm/components/index.js",
|
|
41
41
|
"./components/*": "./esm/components/*/index.js",
|
|
42
|
+
"./utils": "./esm/utils/index.js",
|
|
43
|
+
"./utils/*": "./esm/utils/*/index.js",
|
|
42
44
|
"./*": "./*"
|
|
43
45
|
},
|
|
44
46
|
"devDependencies": {
|
package/esm/utils/color.d.ts
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export type ColorScheme = {
|
|
2
|
-
primary: string;
|
|
3
|
-
primaryLight: string;
|
|
4
|
-
primaryDark: string;
|
|
5
|
-
onPrimary: string;
|
|
6
|
-
secondary: string;
|
|
7
|
-
secondaryLight: string;
|
|
8
|
-
secondaryDark: string;
|
|
9
|
-
onSecondary: string;
|
|
10
|
-
highlight: string;
|
|
11
|
-
highlightLight: string;
|
|
12
|
-
highlightDark: string;
|
|
13
|
-
onHighlight: string;
|
|
14
|
-
info: string;
|
|
15
|
-
infoLight: string;
|
|
16
|
-
infoDark: string;
|
|
17
|
-
onInfo: string;
|
|
18
|
-
success: string;
|
|
19
|
-
successLight: string;
|
|
20
|
-
successDark: string;
|
|
21
|
-
onSuccess: string;
|
|
22
|
-
warning: string;
|
|
23
|
-
warningLight: string;
|
|
24
|
-
warningDark: string;
|
|
25
|
-
onWarning: string;
|
|
26
|
-
danger: string;
|
|
27
|
-
dangerLight: string;
|
|
28
|
-
dangerDark: string;
|
|
29
|
-
onDanger: string;
|
|
30
|
-
background: string;
|
|
31
|
-
onBackground: string;
|
|
32
|
-
container: string;
|
|
33
|
-
neutral: string;
|
|
34
|
-
neutralLight: string;
|
|
35
|
-
neutralDark: string;
|
|
36
|
-
onNeutral: string;
|
|
37
|
-
};
|
|
38
|
-
/**
|
|
39
|
-
* Represents a color in RGB space.
|
|
40
|
-
*/
|
|
41
|
-
export type RGB = {
|
|
42
|
-
r: number;
|
|
43
|
-
g: number;
|
|
44
|
-
b: number;
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Represents a color in HSL space.
|
|
48
|
-
*/
|
|
49
|
-
export type HSL = {
|
|
50
|
-
h: number;
|
|
51
|
-
s: number;
|
|
52
|
-
l: number;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Checks if the given string represents a valid hexadecimal color code.
|
|
56
|
-
* @param hexColorCode - The color code to validate.
|
|
57
|
-
* @param enforceSixChars - Whether to enforce only the 6-character format (default is false).
|
|
58
|
-
* @returns True if the color code is valid, false otherwise.
|
|
59
|
-
*/
|
|
60
|
-
export declare function isValidHex(hexColorCode: string, enforceSixChars?: boolean): boolean;
|
|
61
|
-
/**
|
|
62
|
-
* Tries to parse a string in the format 'rgb(r, g, b)' to an RGB object.
|
|
63
|
-
* @param tr The input string to parse, expected in the format 'rgb(r, g, b)'.
|
|
64
|
-
* @returns An object containing parsed RGB values if the input string is valid, otherwise undefined.
|
|
65
|
-
*/
|
|
66
|
-
export declare function tryParseRgb(str: string): RGB | undefined;
|
|
67
|
-
/**
|
|
68
|
-
* Parses a color from a hex string.
|
|
69
|
-
* @param color A hex string representing the color, e.g., "#aabbcc".
|
|
70
|
-
* @returns A `RGB` object representing the parsed color.
|
|
71
|
-
*/
|
|
72
|
-
export declare function parseColor(color: string): RGB;
|
|
73
|
-
/**
|
|
74
|
-
* Lightens a color by a specified amount.
|
|
75
|
-
* @param rgb The color to lighten.
|
|
76
|
-
* @param amount The amount to lighten the color by, in the range [0, 100].
|
|
77
|
-
* @returns The lightened color.
|
|
78
|
-
*/
|
|
79
|
-
export declare function lighten(rgb: RGB, amount: number): RGB;
|
|
80
|
-
/**
|
|
81
|
-
* Darkens a color by a specified amount.
|
|
82
|
-
* @param rgb The color to darken.
|
|
83
|
-
* @param amount The amount to darken the color by, in the range [0, 100].
|
|
84
|
-
* @returns The darkened color.
|
|
85
|
-
*/
|
|
86
|
-
export declare function darken(rgb: RGB, amount: number): RGB;
|
|
87
|
-
/**
|
|
88
|
-
* Converts a `Color` object to a hex string.
|
|
89
|
-
* @param rgb The color to convert.
|
|
90
|
-
* @returns A hex string representing the color.
|
|
91
|
-
*/
|
|
92
|
-
export declare function colorToHex(rgb: RGB): string;
|
|
93
|
-
/**
|
|
94
|
-
* Converts an RGB object to a string in the format 'r g b'.
|
|
95
|
-
* @param rgb The RGB object to convert.
|
|
96
|
-
* @returns A string representing the color in 'r g b' format.
|
|
97
|
-
*/
|
|
98
|
-
export declare function rgbToVariableString(rgb: RGB): string;
|
|
99
|
-
/**
|
|
100
|
-
* Converts a color from RGB to HSL space.
|
|
101
|
-
* @param color The color to convert.
|
|
102
|
-
* @returns An object representing the color in HSL space.
|
|
103
|
-
*/
|
|
104
|
-
export declare function rgbToHsl(rgb: RGB): HSL;
|
|
105
|
-
/**
|
|
106
|
-
* Converts a color from HSL to RGB space.
|
|
107
|
-
* @param h The hue component of the color, in the range [0, 1].
|
|
108
|
-
* @param s The saturation component of the color, in the range [0, 1].
|
|
109
|
-
* @param l The lightness component of the color, in the range [0, 1].
|
|
110
|
-
* @returns A `RGB` object representing the color in RGB space.
|
|
111
|
-
*/
|
|
112
|
-
export declare function hslToRgb(hsl: HSL): RGB;
|
|
113
|
-
/**
|
|
114
|
-
* Helper function to convert a hue value to a corresponding RGB value.
|
|
115
|
-
* @param p The first RGB component.
|
|
116
|
-
* @param q The second RGB component.
|
|
117
|
-
* @param t The hue value.
|
|
118
|
-
* @returns The corresponding RGB value.
|
|
119
|
-
*/
|
|
120
|
-
export declare function hueToRgb(p: number, q: number, t: number): number;
|
|
121
|
-
export declare function getContrastingColor(luminance: number): "#000" | "#fff";
|
|
122
|
-
export declare function getComplementaryColor(color: string): string;
|
|
123
|
-
//# sourceMappingURL=color.d.ts.map
|
package/esm/utils/color.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../src/utils/color.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG;IAEzB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IAEnB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;IAGnB,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IAEd,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IAEjB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAGhB,UAAU,EAAE,MAA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C,GAAG,EAAE,GAAG,GAAG,GAAG,CAuBtC;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAOhE;AAED,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,mBAIpD;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAU3D"}
|
package/esm/utils/color.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
function d(t, r = !1) {
|
|
2
|
-
return r ? /^#[a-fA-F0-9]{6}$/.test(t) : /^#([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$/.test(t);
|
|
3
|
-
}
|
|
4
|
-
function g(t) {
|
|
5
|
-
const r = t.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
|
|
6
|
-
if (r) {
|
|
7
|
-
const n = parseInt(r[1], 10), s = parseInt(r[2], 10), e = parseInt(r[3], 10);
|
|
8
|
-
return { r: n, g: s, b: e };
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
function b(t) {
|
|
12
|
-
if (d(t)) {
|
|
13
|
-
t.length === 4 && (t = "#" + t[1] + t[1] + t[2] + t[2] + t[3] + t[3]);
|
|
14
|
-
const r = parseInt(t.slice(1, 3), 16), n = parseInt(t.slice(3, 5), 16), s = parseInt(t.slice(5, 7), 16);
|
|
15
|
-
return { r, g: n, b: s };
|
|
16
|
-
} else {
|
|
17
|
-
const r = g(t);
|
|
18
|
-
if (r) return r;
|
|
19
|
-
}
|
|
20
|
-
throw new Error("Invalid color format");
|
|
21
|
-
}
|
|
22
|
-
function $(t, r) {
|
|
23
|
-
const n = h(t), s = r / 100;
|
|
24
|
-
return n.l = n.l + s * (100 - n.l), l(n);
|
|
25
|
-
}
|
|
26
|
-
function p(t, r) {
|
|
27
|
-
const n = h(t), s = r / 100;
|
|
28
|
-
return n.l = n.l - s * n.l, l(n);
|
|
29
|
-
}
|
|
30
|
-
function M(t) {
|
|
31
|
-
const r = t.r.toString(16).padStart(2, "0"), n = t.g.toString(16).padStart(2, "0"), s = t.b.toString(16).padStart(2, "0");
|
|
32
|
-
return `#${r}${n}${s}`;
|
|
33
|
-
}
|
|
34
|
-
function m(t) {
|
|
35
|
-
return `${t.r} ${t.g} ${t.b}`;
|
|
36
|
-
}
|
|
37
|
-
function h(t) {
|
|
38
|
-
const r = t.r / 255, n = t.g / 255, s = t.b / 255, e = Math.max(r, n, s), o = Math.min(r, n, s);
|
|
39
|
-
let a = 0, c;
|
|
40
|
-
const i = (e + o) / 2;
|
|
41
|
-
if (e === o)
|
|
42
|
-
a = c = 0;
|
|
43
|
-
else {
|
|
44
|
-
const u = e - o;
|
|
45
|
-
switch (c = i > 0.5 ? u / (2 - e - o) : u / (e + o), e) {
|
|
46
|
-
case r:
|
|
47
|
-
a = (n - s) / u + (n < s ? 6 : 0);
|
|
48
|
-
break;
|
|
49
|
-
case n:
|
|
50
|
-
a = (s - r) / u + 2;
|
|
51
|
-
break;
|
|
52
|
-
case s:
|
|
53
|
-
a = (r - n) / u + 4;
|
|
54
|
-
break;
|
|
55
|
-
}
|
|
56
|
-
a /= 6;
|
|
57
|
-
}
|
|
58
|
-
return {
|
|
59
|
-
h: Math.round(a * 360),
|
|
60
|
-
s: Math.round(c * 100),
|
|
61
|
-
l: Math.round(i * 100)
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
function l(t) {
|
|
65
|
-
const r = t.h / 360, n = t.s / 100, s = t.l / 100;
|
|
66
|
-
let e, o, a;
|
|
67
|
-
if (n === 0)
|
|
68
|
-
e = o = a = s;
|
|
69
|
-
else {
|
|
70
|
-
const c = s < 0.5 ? s * (1 + n) : s + n - s * n, i = 2 * s - c;
|
|
71
|
-
e = f(i, c, r + 1 / 3), o = f(i, c, r), a = f(i, c, r - 1 / 3);
|
|
72
|
-
}
|
|
73
|
-
return {
|
|
74
|
-
r: Math.round(e * 255),
|
|
75
|
-
g: Math.round(o * 255),
|
|
76
|
-
b: Math.round(a * 255)
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
function f(t, r, n) {
|
|
80
|
-
return n < 0 && (n += 1), n > 1 && (n -= 1), n < 1 / 6 ? t + (r - t) * 6 * n : n < 1 / 2 ? r : n < 2 / 3 ? t + (r - t) * (2 / 3 - n) * 6 : t;
|
|
81
|
-
}
|
|
82
|
-
function I(t) {
|
|
83
|
-
return t > 50 ? "#000" : "#fff";
|
|
84
|
-
}
|
|
85
|
-
export {
|
|
86
|
-
M as colorToHex,
|
|
87
|
-
p as darken,
|
|
88
|
-
I as getContrastingColor,
|
|
89
|
-
l as hslToRgb,
|
|
90
|
-
f as hueToRgb,
|
|
91
|
-
d as isValidHex,
|
|
92
|
-
$ as lighten,
|
|
93
|
-
b as parseColor,
|
|
94
|
-
h as rgbToHsl,
|
|
95
|
-
m as rgbToVariableString,
|
|
96
|
-
g as tryParseRgb
|
|
97
|
-
};
|