@quidgest/ui 0.14.20 → 0.15.0
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/ui.css +206 -215
- package/dist/ui.esm.js +2024 -1993
- package/dist/ui.js +8 -8
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +652 -651
- package/dist/ui.scss +201 -169
- package/esm/components/QBadge/QBadge.d.ts.map +1 -1
- package/esm/components/QBadge/QBadge.vue.js +32 -33
- package/esm/components/QBadge/types.d.ts +5 -5
- package/esm/components/QBadge/types.d.ts.map +1 -1
- package/esm/components/QButton/QButton.d.ts +3 -1
- package/esm/components/QButton/QButton.d.ts.map +1 -1
- package/esm/components/QButton/QButton.vue.js +56 -61
- package/esm/components/QButton/index.d.ts +9 -3
- package/esm/components/QButton/index.d.ts.map +1 -1
- package/esm/components/QButton/types.d.ts +22 -11
- package/esm/components/QButton/types.d.ts.map +1 -1
- package/esm/components/QButtonGroup/QButtonGroup.d.ts.map +1 -1
- package/esm/components/QButtonGroup/QButtonGroup.vue.js +5 -6
- package/esm/components/QButtonToggle/QButtonToggle.d.ts.map +1 -1
- package/esm/components/QButtonToggle/QButtonToggle.vue.js +7 -8
- package/esm/components/QCollapsible/QCollapsible.d.ts.map +1 -1
- package/esm/components/QCollapsible/QCollapsible.vue.js +15 -14
- package/esm/components/QCombobox/QCombobox.d.ts +24 -12
- package/esm/components/QCombobox/QCombobox.d.ts.map +1 -1
- package/esm/components/QCombobox/QCombobox.vue.js +19 -18
- package/esm/components/QCombobox/index.d.ts +12 -6
- package/esm/components/QCombobox/index.d.ts.map +1 -1
- package/esm/components/QDialog/QDialog.vue.js +10 -10
- package/esm/components/QDialog/types.js +3 -3
- package/esm/components/QIcon/QIcon.vue.js +14 -14
- package/esm/components/QMeter/QMeter.vue.js +19 -19
- package/esm/components/QPropertyList/QPropertyListGroup.d.ts.map +1 -1
- package/esm/components/QPropertyList/QPropertyListGroup.vue.js +15 -16
- package/esm/components/QSelect/QSelect.d.ts.map +1 -1
- package/esm/components/QSelect/QSelect.vue.js +29 -28
- package/esm/components/__internal__/QClearButton/QClearButton.d.ts.map +1 -1
- package/esm/components/__internal__/QClearButton/QClearButton.vue.js +12 -11
- package/esm/composables/useColor/index.d.ts +33 -0
- package/esm/composables/useColor/index.d.ts.map +1 -0
- package/esm/composables/useColor/index.js +39 -0
- package/esm/composables/useColor/types.d.ts +36 -0
- package/esm/composables/useColor/types.d.ts.map +1 -0
- package/esm/templates/theme.d.ts.map +1 -1
- package/esm/templates/theme.js +13 -3
- package/esm/utils/color.d.ts +5 -0
- package/esm/utils/color.d.ts.map +1 -1
- package/package.json +1 -1
- package/esm/composables/useColorStyle/index.d.ts +0 -11
- package/esm/composables/useColorStyle/index.d.ts.map +0 -1
- package/esm/composables/useColorStyle/index.js +0 -33
- package/esm/composables/useColorStyle/types.d.ts +0 -36
- package/esm/composables/useColorStyle/types.d.ts.map +0 -1
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { defineComponent as X, mergeModels as I, useModel as j, ref as f, computed as b, watch as G, nextTick as J, createElementBlock as m, openBlock as n, Fragment as N, createVNode as k, unref as i, mergeProps as D, withModifiers as F, createSlots as Y, withCtx as
|
|
1
|
+
import { defineComponent as X, mergeModels as I, useModel as j, ref as f, computed as b, watch as G, nextTick as J, createElementBlock as m, openBlock as n, Fragment as N, createVNode as k, unref as i, mergeProps as D, withModifiers as F, createSlots as Y, withCtx as d, toDisplayString as O, createCommentVNode as g, createTextVNode as Z, renderSlot as c, createBlock as h, normalizeProps as ee, createElementVNode as le } from "vue";
|
|
2
2
|
import { DEFAULT_TEXTS as oe, DEFAULT_ICONS as te } from "./types.js";
|
|
3
3
|
import { QButton as ae } from "../QButton/index.js";
|
|
4
4
|
import { QField as ne } from "../QField/index.js";
|
|
5
5
|
import { QIcon as ie } from "../QIcon/index.js";
|
|
6
6
|
import { QList as se } from "../QList/index.js";
|
|
7
|
-
import { QOverlay as
|
|
8
|
-
import { QSpinnerLoader as
|
|
7
|
+
import { QOverlay as re } from "../QOverlay/index.js";
|
|
8
|
+
import { QSpinnerLoader as de } from "../QSpinnerLoader/index.js";
|
|
9
9
|
import { QChevron as ue } from "../__internal__/QChevron/index.js";
|
|
10
10
|
import { QClearButton as ce } from "../__internal__/QClearButton/index.js";
|
|
11
11
|
const fe = {
|
|
@@ -17,7 +17,7 @@ const fe = {
|
|
|
17
17
|
}, pe = ["data-key"], ve = {
|
|
18
18
|
key: 0,
|
|
19
19
|
class: "q-select__loader"
|
|
20
|
-
},
|
|
20
|
+
}, Le = /* @__PURE__ */ X({
|
|
21
21
|
inheritAttrs: !1,
|
|
22
22
|
__name: "QSelect",
|
|
23
23
|
props: /* @__PURE__ */ I({
|
|
@@ -44,8 +44,8 @@ const fe = {
|
|
|
44
44
|
modelModifiers: {}
|
|
45
45
|
}),
|
|
46
46
|
emits: /* @__PURE__ */ I(["before-show", "before-hide", "show", "hide"], ["update:modelValue"]),
|
|
47
|
-
setup(
|
|
48
|
-
const e =
|
|
47
|
+
setup(q, { emit: R }) {
|
|
48
|
+
const e = q, p = R, v = j(q, "modelValue"), t = f(!1), w = f(""), y = f(null), _ = f(null), V = f(null), A = b(() => u.value === void 0), u = b(
|
|
49
49
|
() => {
|
|
50
50
|
var l;
|
|
51
51
|
return (l = e.items) == null ? void 0 : l.find((o) => o[e.itemValue] === v.value);
|
|
@@ -56,29 +56,29 @@ const fe = {
|
|
|
56
56
|
() => e.clearable && !e.readonly && !e.disabled && !e.loading
|
|
57
57
|
);
|
|
58
58
|
function B(l) {
|
|
59
|
-
v.value = l,
|
|
59
|
+
v.value = l, L();
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function x() {
|
|
62
62
|
E.value && (B(e.emptyValue), T());
|
|
63
63
|
}
|
|
64
64
|
function U(l) {
|
|
65
65
|
var o, s, a;
|
|
66
|
-
!((o = V.value) != null && o.contains(l.relatedTarget)) && !((a = (s = y.value) == null ? void 0 : s.fieldRef) != null && a.contains(l.relatedTarget)) &&
|
|
66
|
+
!((o = V.value) != null && o.contains(l.relatedTarget)) && !((a = (s = y.value) == null ? void 0 : s.fieldRef) != null && a.contains(l.relatedTarget)) && L();
|
|
67
67
|
}
|
|
68
68
|
function K() {
|
|
69
69
|
t.value || (p("before-show"), t.value = !0);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function L() {
|
|
72
72
|
t.value && (p("before-hide"), t.value = !1);
|
|
73
73
|
}
|
|
74
74
|
function C() {
|
|
75
|
-
e.readonly || e.disabled || (t.value ?
|
|
75
|
+
e.readonly || e.disabled || (t.value ? L() : K());
|
|
76
76
|
}
|
|
77
77
|
let S;
|
|
78
78
|
function $(l) {
|
|
79
79
|
var o;
|
|
80
80
|
if (!(!l.key || e.readonly || e.disabled)) {
|
|
81
|
-
if (window.clearTimeout(S), ["Enter", " ", "ArrowDown", "ArrowUp", "Home", "End"].includes(l.key) && (l.preventDefault(), l.stopPropagation()), ["Enter", " "].includes(l.key) && (t.value = !0), ["Escape", "Tab"].includes(l.key) && (t.value ? t.value = !1 : E.value && l.key === "Escape" &&
|
|
81
|
+
if (window.clearTimeout(S), ["Enter", " ", "ArrowDown", "ArrowUp", "Home", "End"].includes(l.key) && (l.preventDefault(), l.stopPropagation()), ["Enter", " "].includes(l.key) && (t.value = !0), ["Escape", "Tab"].includes(l.key) && (t.value ? t.value = !1 : E.value && l.key === "Escape" && x()), l.key === "Delete" && e.clearable && x(), /^[a-z]$/i.test(l.key)) {
|
|
82
82
|
w.value += l.key.toLowerCase();
|
|
83
83
|
const s = ((o = e.items) == null ? void 0 : o.length) || 0;
|
|
84
84
|
for (let a = 0; a < s; a++)
|
|
@@ -149,25 +149,26 @@ const fe = {
|
|
|
149
149
|
onClick: C,
|
|
150
150
|
onKeydown: F($, ["stop"])
|
|
151
151
|
}), Y({
|
|
152
|
-
append:
|
|
152
|
+
append: d(() => [
|
|
153
153
|
c(l.$slots, "append"),
|
|
154
154
|
E.value && v.value ? (n(), h(i(ce), {
|
|
155
155
|
key: 0,
|
|
156
156
|
icons: e.icons,
|
|
157
157
|
texts: e.texts,
|
|
158
|
-
onClick:
|
|
158
|
+
onClick: x
|
|
159
159
|
}, null, 8, ["icons", "texts"])) : g("v-if", !0),
|
|
160
160
|
e.readonly ? g("v-if", !0) : (n(), h(i(ae), {
|
|
161
161
|
key: 1,
|
|
162
162
|
class: "q-select__chevron",
|
|
163
163
|
"aria-label": e.texts.showOptions,
|
|
164
|
-
|
|
164
|
+
variant: "text",
|
|
165
|
+
color: "neutral",
|
|
165
166
|
borderless: "",
|
|
166
167
|
tabindex: "-1",
|
|
167
168
|
disabled: e.disabled,
|
|
168
169
|
onClick: C
|
|
169
170
|
}, {
|
|
170
|
-
default:
|
|
171
|
+
default: d(() => [
|
|
171
172
|
k(i(ue), {
|
|
172
173
|
"model-value": t.value,
|
|
173
174
|
icons: e.icons
|
|
@@ -177,7 +178,7 @@ const fe = {
|
|
|
177
178
|
/* STABLE */
|
|
178
179
|
}, 8, ["aria-label", "disabled"]))
|
|
179
180
|
]),
|
|
180
|
-
default:
|
|
181
|
+
default: d(() => [
|
|
181
182
|
A.value ? (n(), m("span", me, [
|
|
182
183
|
!e.readonly && !e.disabled ? (n(), m(
|
|
183
184
|
N,
|
|
@@ -205,11 +206,11 @@ const fe = {
|
|
|
205
206
|
}, [
|
|
206
207
|
(s = u.value) != null && s.icon || l.$slots.prepend ? {
|
|
207
208
|
name: "prepend",
|
|
208
|
-
fn:
|
|
209
|
-
var
|
|
209
|
+
fn: d(() => {
|
|
210
|
+
var r, z;
|
|
210
211
|
return [
|
|
211
212
|
c(l.$slots, "prepend"),
|
|
212
|
-
(
|
|
213
|
+
(r = u.value) != null && r.icon ? (n(), h(
|
|
213
214
|
i(ie),
|
|
214
215
|
ee(D({ key: 0 }, (z = u.value) == null ? void 0 : z.icon)),
|
|
215
216
|
null,
|
|
@@ -222,15 +223,15 @@ const fe = {
|
|
|
222
223
|
} : void 0,
|
|
223
224
|
l.$slots.extras ? {
|
|
224
225
|
name: "extras",
|
|
225
|
-
fn:
|
|
226
|
+
fn: d(() => [
|
|
226
227
|
c(l.$slots, "extras")
|
|
227
228
|
]),
|
|
228
229
|
key: "1"
|
|
229
230
|
} : void 0
|
|
230
231
|
]), 1040, ["id", "label", "required", "tabindex", "class", "readonly", "disabled", "data-loading", "aria-expanded", "size", "invalid"]),
|
|
231
|
-
k(i(
|
|
232
|
+
k(i(re), {
|
|
232
233
|
modelValue: t.value,
|
|
233
|
-
"onUpdate:modelValue": o[0] || (o[0] = (
|
|
234
|
+
"onUpdate:modelValue": o[0] || (o[0] = (r) => t.value = r),
|
|
234
235
|
spy: "",
|
|
235
236
|
trigger: "manual",
|
|
236
237
|
placement: "bottom-start",
|
|
@@ -241,7 +242,7 @@ const fe = {
|
|
|
241
242
|
onEnter: P,
|
|
242
243
|
onLeave: H
|
|
243
244
|
}, {
|
|
244
|
-
default:
|
|
245
|
+
default: d(() => [
|
|
245
246
|
le("div", {
|
|
246
247
|
ref_key: "contentRef",
|
|
247
248
|
ref: V,
|
|
@@ -254,7 +255,7 @@ const fe = {
|
|
|
254
255
|
}, [
|
|
255
256
|
c(l.$slots, "body.prepend"),
|
|
256
257
|
e.loading ? (n(), m("div", ve, [
|
|
257
|
-
k(i(
|
|
258
|
+
k(i(de), { size: 24 })
|
|
258
259
|
])) : (n(), h(i(se), {
|
|
259
260
|
key: 1,
|
|
260
261
|
ref_key: "listRef",
|
|
@@ -268,8 +269,8 @@ const fe = {
|
|
|
268
269
|
"item-value": e.itemValue,
|
|
269
270
|
"onUpdate:modelValue": B
|
|
270
271
|
}, {
|
|
271
|
-
item:
|
|
272
|
-
c(l.$slots, "item", { item:
|
|
272
|
+
item: d(({ item: r }) => [
|
|
273
|
+
c(l.$slots, "item", { item: r })
|
|
273
274
|
]),
|
|
274
275
|
_: 3
|
|
275
276
|
/* FORWARDED */
|
|
@@ -288,5 +289,5 @@ const fe = {
|
|
|
288
289
|
}
|
|
289
290
|
});
|
|
290
291
|
export {
|
|
291
|
-
|
|
292
|
+
Le as default
|
|
292
293
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QClearButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/__internal__/QClearButton/QClearButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QClearButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/__internal__/QClearButton/QClearButton.vue"],"names":[],"mappings":"AAaA;AA0CC,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAOtD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;;;;;;;;;AAsGjD,wBASG"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { DEFAULT_TEXTS as _, DEFAULT_ICONS as
|
|
3
|
-
import { QButton as
|
|
4
|
-
import { QIcon as
|
|
5
|
-
const h = /* @__PURE__ */
|
|
1
|
+
import { defineComponent as i, createBlock as n, openBlock as s, unref as a, normalizeClass as m, withCtx as u, createVNode as p, normalizeProps as d, guardReactiveProps as f } from "vue";
|
|
2
|
+
import { DEFAULT_TEXTS as _, DEFAULT_ICONS as x } from "./types.js";
|
|
3
|
+
import { QButton as C } from "../../QButton/index.js";
|
|
4
|
+
import { QIcon as b } from "../../QIcon/index.js";
|
|
5
|
+
const h = /* @__PURE__ */ i({
|
|
6
6
|
__name: "QClearButton",
|
|
7
7
|
props: {
|
|
8
8
|
id: {},
|
|
9
9
|
class: {},
|
|
10
|
-
icons: { default: () =>
|
|
10
|
+
icons: { default: () => x },
|
|
11
11
|
texts: { default: () => _ }
|
|
12
12
|
},
|
|
13
13
|
emits: ["click"],
|
|
@@ -16,18 +16,19 @@ const h = /* @__PURE__ */ s({
|
|
|
16
16
|
function c(t) {
|
|
17
17
|
l("click", t);
|
|
18
18
|
}
|
|
19
|
-
return (t, k) => (
|
|
19
|
+
return (t, k) => (s(), n(a(C), {
|
|
20
20
|
id: e.id,
|
|
21
21
|
class: m(["q-clear-btn", e.class]),
|
|
22
22
|
"aria-label": e.texts.clearValue,
|
|
23
|
-
|
|
23
|
+
variant: "text",
|
|
24
|
+
color: "neutral",
|
|
24
25
|
borderless: "",
|
|
25
26
|
tabindex: "-1",
|
|
26
27
|
onClick: c
|
|
27
28
|
}, {
|
|
28
|
-
default:
|
|
29
|
-
|
|
30
|
-
a(
|
|
29
|
+
default: u(() => [
|
|
30
|
+
p(
|
|
31
|
+
a(b),
|
|
31
32
|
d(f(e.icons.clear)),
|
|
32
33
|
null,
|
|
33
34
|
16
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MaybeRef } from 'vue';
|
|
2
|
+
import { UseColorReturn } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A composable function that processes and returns color-related information and styles.
|
|
5
|
+
*
|
|
6
|
+
* @param color - A string representing a color value or a utility color name. Can be provided as a ref or plain string.
|
|
7
|
+
*
|
|
8
|
+
* @returns {UseColorReturn} An object containing:
|
|
9
|
+
* - isUtilityColor: A computed boolean indicating if the color is a utility color
|
|
10
|
+
* - style: A computed object containing:
|
|
11
|
+
* - mainColor: The resolved color value
|
|
12
|
+
* - onMainColor: A contrasting color suitable for text/content on the main color
|
|
13
|
+
* - hoverColor: A darker version of the main color for hover states
|
|
14
|
+
* - onHoverColor: A contrasting color suitable for text/content on the hover color
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const { isUtilityColor, style } = useColor('primary')
|
|
19
|
+
* // or
|
|
20
|
+
* const { isUtilityColor, style } = useColor(ref('#FF0000'))
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @throws Will log an error to console if color parsing fails
|
|
24
|
+
*/
|
|
25
|
+
export declare function useColor(color: MaybeRef<string | undefined>): UseColorReturn;
|
|
26
|
+
/**
|
|
27
|
+
* Checks if a given string represents a valid CSS color format.
|
|
28
|
+
*
|
|
29
|
+
* @param color - The string to check for CSS color format
|
|
30
|
+
* @returns True if the string starts with '#', 'rgb', or 'hsl', false otherwise
|
|
31
|
+
*/
|
|
32
|
+
export declare function isCssColor(color: string): boolean;
|
|
33
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useColor/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,SAAS,CAAA;AAOzD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,cAAc,CA2C5E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { computed as l, unref as m } from "vue";
|
|
2
|
+
import { parseColor as h, rgbToHsl as d, colorToHex as v, darken as p, getContrastingColor as g } from "../../utils/color.js";
|
|
3
|
+
import { useTheme as y } from "../theme.js";
|
|
4
|
+
function x(o) {
|
|
5
|
+
const t = l(() => m(o)), i = l(
|
|
6
|
+
() => t.value ? !b(t.value) : !1
|
|
7
|
+
), a = l(() => {
|
|
8
|
+
const r = t.value;
|
|
9
|
+
if (!r) return;
|
|
10
|
+
let n = r;
|
|
11
|
+
const c = y();
|
|
12
|
+
if (i.value) {
|
|
13
|
+
const s = r;
|
|
14
|
+
n = c.current.value.scheme[s] ?? r;
|
|
15
|
+
}
|
|
16
|
+
let e;
|
|
17
|
+
try {
|
|
18
|
+
if (e = h(n), !e) return;
|
|
19
|
+
} catch (s) {
|
|
20
|
+
console.error("Failed to parse color:", s);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const C = d(e), u = g(C.l), f = v(p(e, 25));
|
|
24
|
+
return {
|
|
25
|
+
mainColor: n,
|
|
26
|
+
onMainColor: u,
|
|
27
|
+
hoverColor: f,
|
|
28
|
+
onHoverColor: u
|
|
29
|
+
};
|
|
30
|
+
});
|
|
31
|
+
return { isUtilityColor: i, style: a };
|
|
32
|
+
}
|
|
33
|
+
function b(o) {
|
|
34
|
+
return o.startsWith("#") || o.startsWith("rgb") || o.startsWith("hsl");
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
b as isCssColor,
|
|
38
|
+
x as useColor
|
|
39
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the color styling configuration for a component.
|
|
4
|
+
*/
|
|
5
|
+
export interface ColorStyle {
|
|
6
|
+
/**
|
|
7
|
+
* The primary color to be used.
|
|
8
|
+
*/
|
|
9
|
+
mainColor: string;
|
|
10
|
+
/**
|
|
11
|
+
* The color to be used for content on top of the main color.
|
|
12
|
+
*/
|
|
13
|
+
onMainColor: string;
|
|
14
|
+
/**
|
|
15
|
+
* Optional color to be used when the component is in hover state.
|
|
16
|
+
*/
|
|
17
|
+
hoverColor?: string;
|
|
18
|
+
/**
|
|
19
|
+
* Optional color to be used for content when the component is in hover state.
|
|
20
|
+
*/
|
|
21
|
+
onHoverColor?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Interface representing the return type of the `useColor` composable.
|
|
25
|
+
*/
|
|
26
|
+
export interface UseColorReturn {
|
|
27
|
+
/**
|
|
28
|
+
* A computed reference indicating whether the color is a utility color.
|
|
29
|
+
*/
|
|
30
|
+
isUtilityColor: ComputedRef<boolean>;
|
|
31
|
+
/**
|
|
32
|
+
* A computed reference to the color style, which may be undefined.
|
|
33
|
+
*/
|
|
34
|
+
style: ComputedRef<ColorStyle | undefined>;
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useColor/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAEpC;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;CAC1C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/templates/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,eAAO,MAAM,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/templates/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAEhD,eAAO,MAAM,uBAAuB,EAAE,WAoCrC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,WAoCpC,CAAA"}
|
package/esm/templates/theme.js
CHANGED
|
@@ -3,7 +3,11 @@ const f = {
|
|
|
3
3
|
primaryLight: "#cde5ff",
|
|
4
4
|
primaryDark: "#006398",
|
|
5
5
|
secondary: "#001d31",
|
|
6
|
+
secondaryLight: "#e6eef3",
|
|
7
|
+
secondaryDark: "#001425",
|
|
6
8
|
highlight: "#ff8241",
|
|
9
|
+
highlightLight: "#ffe4d6",
|
|
10
|
+
highlightDark: "#cc4700",
|
|
7
11
|
info: "#17a2b8",
|
|
8
12
|
infoLight: "#bceff7",
|
|
9
13
|
infoDark: "#11798a",
|
|
@@ -28,13 +32,18 @@ const f = {
|
|
|
28
32
|
onSuccess: "#fff",
|
|
29
33
|
onWarning: "#fff",
|
|
30
34
|
onDanger: "#fff",
|
|
31
|
-
onInfo: "#fff"
|
|
35
|
+
onInfo: "#fff",
|
|
36
|
+
onNeutral: "#fff"
|
|
32
37
|
}, a = {
|
|
33
38
|
primary: "#008ad2",
|
|
34
39
|
primaryLight: "#006398",
|
|
35
40
|
primaryDark: "#cde5ff",
|
|
36
41
|
secondary: "#003552",
|
|
37
|
-
|
|
42
|
+
secondaryLight: "#001425",
|
|
43
|
+
secondaryDark: "#e6eef3",
|
|
44
|
+
highlight: "#ff8241",
|
|
45
|
+
highlightLight: "#cc4700",
|
|
46
|
+
highlightDark: "#ffe4d6",
|
|
38
47
|
info: "#17a2b8",
|
|
39
48
|
infoLight: "#11798a",
|
|
40
49
|
infoDark: "#bceff7",
|
|
@@ -59,7 +68,8 @@ const f = {
|
|
|
59
68
|
onSuccess: "#fff",
|
|
60
69
|
onWarning: "#fff",
|
|
61
70
|
onDanger: "#fff",
|
|
62
|
-
onInfo: "#fff"
|
|
71
|
+
onInfo: "#fff",
|
|
72
|
+
onNeutral: "#fff"
|
|
63
73
|
};
|
|
64
74
|
export {
|
|
65
75
|
a as defaultDarkColorScheme,
|
package/esm/utils/color.d.ts
CHANGED
|
@@ -4,8 +4,12 @@ export type ColorScheme = {
|
|
|
4
4
|
primaryDark: string;
|
|
5
5
|
onPrimary: string;
|
|
6
6
|
secondary: string;
|
|
7
|
+
secondaryLight: string;
|
|
8
|
+
secondaryDark: string;
|
|
7
9
|
onSecondary: string;
|
|
8
10
|
highlight: string;
|
|
11
|
+
highlightLight: string;
|
|
12
|
+
highlightDark: string;
|
|
9
13
|
onHighlight: string;
|
|
10
14
|
info: string;
|
|
11
15
|
infoLight: string;
|
|
@@ -29,6 +33,7 @@ export type ColorScheme = {
|
|
|
29
33
|
neutral: string;
|
|
30
34
|
neutralLight: string;
|
|
31
35
|
neutralDark: string;
|
|
36
|
+
onNeutral: string;
|
|
32
37
|
};
|
|
33
38
|
/**
|
|
34
39
|
* Represents a color in RGB space.
|
package/esm/utils/color.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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,WAAW,EAAE,MAAM,CAAA;IAEnB,SAAS,EAAE,MAAM,CAAA;IACjB,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,MAAM,CAAA;IAClB,YAAY,EAAE,MAAM,CAAA;IAEpB,SAAS,EAAE,MAAM,CAAA;IAGjB,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM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@@
|
|
|
1
|
-
import { MaybeRef } from 'vue';
|
|
2
|
-
import { UseColorStyleReturn } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* useColorStyle - Computes color styles based on a given color and variant.
|
|
5
|
-
*
|
|
6
|
-
* @param color - The base color (can be a utility color or custom color).
|
|
7
|
-
* @param variant - Determines text/background styling behavior.
|
|
8
|
-
* @returns Computed color styling properties.
|
|
9
|
-
*/
|
|
10
|
-
export declare function useColorStyle(color: MaybeRef<string | undefined>, variant: MaybeRef<string>): UseColorStyleReturn;
|
|
11
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useColorStyle/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAc,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAO9D;;;;;;GAMG;AACH,wBAAgB,aAAa,CAC5B,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,EACnC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GACvB,mBAAmB,CAqDrB"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { parseColor as C, rgbToHsl as p, colorToHex as y, darken as v, getContrastingColor as k } from "../../utils/color.js";
|
|
2
|
-
import { computed as u, unref as l } from "vue";
|
|
3
|
-
import { useTheme as T } from "../theme.js";
|
|
4
|
-
function H(i, a) {
|
|
5
|
-
const d = /* @__PURE__ */ new Set(["primary", "info", "success", "warning", "danger", "highlight"]), s = u(() => d.has(l(i) ?? "")), f = u(() => {
|
|
6
|
-
const r = l(i);
|
|
7
|
-
if (!r) return;
|
|
8
|
-
let e = r;
|
|
9
|
-
const g = T();
|
|
10
|
-
if (s.value) {
|
|
11
|
-
const t = r;
|
|
12
|
-
e = g.current.value.scheme[t] ?? r;
|
|
13
|
-
}
|
|
14
|
-
let n;
|
|
15
|
-
try {
|
|
16
|
-
if (n = C(e), !n) return;
|
|
17
|
-
} catch (t) {
|
|
18
|
-
console.error("Failed to parse color:", t);
|
|
19
|
-
return;
|
|
20
|
-
}
|
|
21
|
-
const h = p(n), c = k(h.l), m = y(v(n, 25)), o = l(a);
|
|
22
|
-
return {
|
|
23
|
-
backgroundColor: e,
|
|
24
|
-
color: o === "tonal" || o === "outlined" ? e : c,
|
|
25
|
-
hoverColor: o === "tonal" || o === "outlined" ? c : void 0,
|
|
26
|
-
hoverBackgroundColor: o !== "tonal" && o !== "outlined" ? m : void 0
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
return { isUtilityColor: s, style: f };
|
|
30
|
-
}
|
|
31
|
-
export {
|
|
32
|
-
H as useColorStyle
|
|
33
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ComputedRef } from 'vue';
|
|
2
|
-
/**
|
|
3
|
-
* Represents a style configuration for colors.
|
|
4
|
-
*/
|
|
5
|
-
export interface ColorStyle {
|
|
6
|
-
/**
|
|
7
|
-
* The background color.
|
|
8
|
-
*/
|
|
9
|
-
backgroundColor: string;
|
|
10
|
-
/**
|
|
11
|
-
* The text color.
|
|
12
|
-
*/
|
|
13
|
-
color: string;
|
|
14
|
-
/**
|
|
15
|
-
* The text color when hovered (optional).
|
|
16
|
-
*/
|
|
17
|
-
hoverColor?: string;
|
|
18
|
-
/**
|
|
19
|
-
* The background color when hovered (optional).
|
|
20
|
-
*/
|
|
21
|
-
hoverBackgroundColor?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Interface representing the return type of the `useColorStyle` composable.
|
|
25
|
-
*/
|
|
26
|
-
export interface UseColorStyleReturn {
|
|
27
|
-
/**
|
|
28
|
-
* A computed reference indicating whether the color is a utility color.
|
|
29
|
-
*/
|
|
30
|
-
isUtilityColor: ComputedRef<boolean>;
|
|
31
|
-
/**
|
|
32
|
-
* A computed reference to the color style, which may be undefined.
|
|
33
|
-
*/
|
|
34
|
-
style: ComputedRef<ColorStyle | undefined>;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useColorStyle/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,eAAe,EAAE,MAAM,CAAA;IAEvB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IACnC;;OAEG;IACH,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAEpC;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;CAC1C"}
|