@quidgest/ui 0.16.34 → 0.16.36
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.css +24 -6
- package/dist/ui.esm.js +2940 -2872
- package/dist/ui.js +19 -19
- package/dist/ui.min.css +1 -1
- package/dist/ui.min.js +774 -761
- package/dist/ui.scss +23 -5
- package/esm/components/QPropertyList/QPropertyList.d.ts.map +1 -1
- package/esm/components/QPropertyList/QPropertyList.vue.js +58 -60
- 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,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Quidgest UI v0.16.
|
|
2
|
+
* Quidgest UI v0.16.36
|
|
3
3
|
* (c) 2025 Quidgest - Consultores de Gestão, S.A.
|
|
4
4
|
* Released under the MIT License.
|
|
5
5
|
*/
|
|
@@ -2355,35 +2355,48 @@ $arrow-tip-radius: 0.1rem;
|
|
|
2355
2355
|
$table-header-bg: rgb(var(--q-theme-neutral-light-rgb) / 25%);
|
|
2356
2356
|
$row-hover-bg: rgb(var(--q-theme-primary-light-rgb) / 50%);
|
|
2357
2357
|
$row-selected-bg: rgb(var(--q-theme-primary-rgb) / 15%);
|
|
2358
|
-
$base-border: 1px solid rgb(
|
|
2358
|
+
$base-border: 1px solid rgb(var(--q-theme-neutral-light-rgb) / 50%);
|
|
2359
2359
|
.q-property-list {
|
|
2360
2360
|
margin: 0;
|
|
2361
2361
|
font-size: 0.9rem;
|
|
2362
|
-
display: flex;
|
|
2362
|
+
display: inline-flex;
|
|
2363
|
+
width: auto;
|
|
2363
2364
|
flex-direction: column;
|
|
2364
2365
|
border: $base-border;
|
|
2365
2366
|
&-panel {
|
|
2366
2367
|
padding: 0.4rem;
|
|
2367
2368
|
display: flex;
|
|
2368
2369
|
flex-direction: column;
|
|
2370
|
+
overflow-y: auto;
|
|
2369
2371
|
min-height: 50px;
|
|
2372
|
+
max-height: 80px;
|
|
2370
2373
|
gap: 1rem;
|
|
2371
2374
|
}
|
|
2372
2375
|
&--side-panel {
|
|
2373
2376
|
flex-direction: row;
|
|
2374
2377
|
.q-property-list-panel {
|
|
2375
2378
|
border-left: $base-border;
|
|
2376
|
-
width:
|
|
2379
|
+
width: 250px;
|
|
2380
|
+
max-height: unset;
|
|
2377
2381
|
}
|
|
2378
2382
|
}
|
|
2379
2383
|
&-panel__label {
|
|
2380
2384
|
font-weight: bold;
|
|
2381
2385
|
}
|
|
2382
2386
|
&__table {
|
|
2383
|
-
width: 100%;
|
|
2384
2387
|
border-spacing: 0;
|
|
2388
|
+
table-layout: fixed;
|
|
2385
2389
|
margin: 0;
|
|
2386
2390
|
}
|
|
2391
|
+
&--block {
|
|
2392
|
+
display: flex;
|
|
2393
|
+
width: 100%;
|
|
2394
|
+
max-width: 100%;
|
|
2395
|
+
flex: 1;
|
|
2396
|
+
.q-property-list__table {
|
|
2397
|
+
width: 100%;
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2387
2400
|
&__header {
|
|
2388
2401
|
background: $table-header-bg;
|
|
2389
2402
|
height: 25px;
|
|
@@ -2410,6 +2423,11 @@ $base-border: 1px solid rgb(0 0 0 / 10%);
|
|
|
2410
2423
|
text-wrap: nowrap;
|
|
2411
2424
|
opacity: 0.8;
|
|
2412
2425
|
}
|
|
2426
|
+
.q-field {
|
|
2427
|
+
max-width: 100%;
|
|
2428
|
+
width: 100%;
|
|
2429
|
+
box-sizing: border-box;
|
|
2430
|
+
}
|
|
2413
2431
|
}
|
|
2414
2432
|
&-field__container {
|
|
2415
2433
|
display: flex;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QPropertyList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QPropertyList/QPropertyList.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"QPropertyList.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QPropertyList/QPropertyList.vue"],"names":[],"mappings":"AAyDA;AA4NC,OAAO,KAAK,EAAE,kBAAkB,EAA2B,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAI9F,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AA8JvD,iBAAS,cAAc;WAiIT,OAAO,IAA6B;;;UAbqC,GAAG;;;;;;;;;;YAE9D,GAAG;;;;;;EAgB9B;AAwBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;kBAUnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { QPropertyListGroup as
|
|
3
|
-
import { DEFAULT_TEXTS as
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent as A, ref as p, computed as g, watch as G, nextTick as Q, createElementBlock as u, openBlock as s, normalizeClass as h, createElementVNode as a, createBlock as f, createCommentVNode as c, Fragment as y, renderList as k, unref as m, withCtx as _, renderSlot as F } from "vue";
|
|
2
|
+
import { QPropertyListGroup as W, QPropertyListRow as N, QPropertyListPanel as O } from "./index.js";
|
|
3
|
+
import { DEFAULT_TEXTS as V, DEFAULT_ICONS as $ } from "./types.js";
|
|
4
|
+
const D = ["id"], U = { class: "q-property-list__table" }, j = /* @__PURE__ */ A({
|
|
5
5
|
__name: "QPropertyList",
|
|
6
6
|
props: {
|
|
7
7
|
id: {},
|
|
@@ -13,14 +13,14 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
|
|
|
13
13
|
noPanel: { type: Boolean },
|
|
14
14
|
noToggle: { type: Boolean },
|
|
15
15
|
readonly: { type: Boolean },
|
|
16
|
-
icons: { default: () =>
|
|
17
|
-
texts: { default: () =>
|
|
16
|
+
icons: { default: () => $ },
|
|
17
|
+
texts: { default: () => V }
|
|
18
18
|
},
|
|
19
19
|
emits: ["field-change", "select-field"],
|
|
20
|
-
setup(
|
|
21
|
-
const t =
|
|
20
|
+
setup(C, { emit: b }) {
|
|
21
|
+
const t = C, v = b, d = p(t.groups.map((e) => e.id)), n = p(void 0), r = p(null), x = g(() => t.groups.length ? t.groups.filter(
|
|
22
22
|
(e) => t.fields.some((o) => o.group === e.id)
|
|
23
|
-
) : [{ id: "", title: "" }]),
|
|
23
|
+
) : [{ id: "", title: "" }]), P = g(() => [
|
|
24
24
|
"q-property-list",
|
|
25
25
|
{
|
|
26
26
|
"q-property-list--side-panel": t.panelPosition === "right",
|
|
@@ -28,54 +28,52 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
|
|
|
28
28
|
},
|
|
29
29
|
t.class
|
|
30
30
|
]);
|
|
31
|
-
function
|
|
32
|
-
if (!r.value) return;
|
|
33
|
-
const e = r.value.offsetWidth;
|
|
34
|
-
r.value.style.width = `${e}px`;
|
|
35
|
-
}
|
|
36
|
-
function q() {
|
|
31
|
+
function B() {
|
|
37
32
|
var e;
|
|
38
|
-
(e = r.value) != null && e.contains(document.activeElement) || (
|
|
39
|
-
}
|
|
40
|
-
function B(e) {
|
|
41
|
-
return e ? t.fields.filter((o) => o.group === e) : t.fields;
|
|
33
|
+
(e = r.value) != null && e.contains(document.activeElement) || (n.value = void 0);
|
|
42
34
|
}
|
|
43
35
|
function L(e) {
|
|
44
|
-
|
|
45
|
-
o === -1 ? u.value.push(e) : u.value.splice(o, 1);
|
|
36
|
+
return e ? t.fields.filter((o) => o.group === e) : t.fields;
|
|
46
37
|
}
|
|
47
38
|
function T(e) {
|
|
39
|
+
const o = d.value.indexOf(e);
|
|
40
|
+
o === -1 ? d.value.push(e) : d.value.splice(o, 1);
|
|
41
|
+
}
|
|
42
|
+
function q(e) {
|
|
48
43
|
var l;
|
|
49
|
-
const o = e.group && !u.value.includes(e.group), n = ((l = s.value) == null ? void 0 : l.id) === e.id;
|
|
50
44
|
return [
|
|
51
45
|
{
|
|
52
|
-
"q-property-list__row--
|
|
53
|
-
"q-property-list__row--selected": n
|
|
46
|
+
"q-property-list__row--selected": ((l = n.value) == null ? void 0 : l.id) === e.id
|
|
54
47
|
}
|
|
55
48
|
];
|
|
56
49
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
50
|
+
function w(e) {
|
|
51
|
+
n.value = e, v("select-field", n.value.id);
|
|
59
52
|
}
|
|
60
|
-
function
|
|
53
|
+
function E(e, o) {
|
|
61
54
|
t.readonly || (e.props.readonly ?? !1) || v("field-change", e, o);
|
|
62
55
|
}
|
|
63
|
-
|
|
56
|
+
function R() {
|
|
57
|
+
if (!r.value) return;
|
|
58
|
+
const e = r.value.offsetWidth;
|
|
59
|
+
r.value.style.minWidth = `${e}px`;
|
|
60
|
+
}
|
|
61
|
+
return G(
|
|
64
62
|
() => t.block,
|
|
65
63
|
async (e) => {
|
|
66
64
|
var o;
|
|
67
|
-
await
|
|
65
|
+
await Q(), e ? (o = r.value) == null || o.removeAttribute("style") : R();
|
|
68
66
|
},
|
|
69
67
|
{ immediate: !0 }
|
|
70
|
-
), (e, o) => (
|
|
68
|
+
), (e, o) => (s(), u("div", {
|
|
71
69
|
id: t.id,
|
|
72
70
|
ref_key: "componentRoot",
|
|
73
71
|
ref: r,
|
|
74
72
|
tabindex: "0",
|
|
75
|
-
class: h(
|
|
76
|
-
onFocusout:
|
|
73
|
+
class: h(P.value),
|
|
74
|
+
onFocusout: B
|
|
77
75
|
}, [
|
|
78
|
-
a("table",
|
|
76
|
+
a("table", U, [
|
|
79
77
|
o[0] || (o[0] = a(
|
|
80
78
|
"thead",
|
|
81
79
|
{ class: "q-property-list__header" },
|
|
@@ -88,44 +86,44 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
|
|
|
88
86
|
/* HOISTED */
|
|
89
87
|
)),
|
|
90
88
|
a("tbody", null, [
|
|
91
|
-
(
|
|
89
|
+
(s(!0), u(
|
|
92
90
|
y,
|
|
93
91
|
null,
|
|
94
|
-
|
|
92
|
+
k(x.value, (l) => (s(), u(
|
|
95
93
|
y,
|
|
96
94
|
{
|
|
97
|
-
key:
|
|
95
|
+
key: l.id
|
|
98
96
|
},
|
|
99
97
|
[
|
|
100
|
-
|
|
98
|
+
l.title ? (s(), f(m(W), {
|
|
101
99
|
key: 0,
|
|
102
|
-
"data-key":
|
|
103
|
-
title:
|
|
100
|
+
"data-key": l.id,
|
|
101
|
+
title: l.title,
|
|
104
102
|
icons: t.icons,
|
|
105
103
|
"no-toggle": t.noToggle,
|
|
106
|
-
onClick: () =>
|
|
107
|
-
}, null, 8, ["data-key", "title", "icons", "no-toggle", "onClick"])) :
|
|
108
|
-
(
|
|
104
|
+
onClick: () => T(l.id)
|
|
105
|
+
}, null, 8, ["data-key", "title", "icons", "no-toggle", "onClick"])) : c("v-if", !0),
|
|
106
|
+
l.id === "" || d.value.includes(l.id) ? (s(!0), u(
|
|
109
107
|
y,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
key:
|
|
113
|
-
class: h(
|
|
114
|
-
field:
|
|
115
|
-
"model-value":
|
|
108
|
+
{ key: 1 },
|
|
109
|
+
k(L(l.id), (i) => (s(), f(m(N), {
|
|
110
|
+
key: i.id,
|
|
111
|
+
class: h(q(i)),
|
|
112
|
+
field: i,
|
|
113
|
+
"model-value": i.props.modelValue,
|
|
116
114
|
readonly: t.readonly,
|
|
117
|
-
onFocus:
|
|
118
|
-
onFieldChange: (
|
|
115
|
+
onFocus: w,
|
|
116
|
+
onFieldChange: (S) => E(i, S)
|
|
119
117
|
}, {
|
|
120
|
-
default:
|
|
121
|
-
|
|
118
|
+
default: _(() => [
|
|
119
|
+
F(e.$slots, i.id, { field: i })
|
|
122
120
|
]),
|
|
123
121
|
_: 2
|
|
124
122
|
/* DYNAMIC */
|
|
125
123
|
}, 1032, ["class", "field", "model-value", "readonly", "onFieldChange"]))),
|
|
126
124
|
128
|
|
127
125
|
/* KEYED_FRAGMENT */
|
|
128
|
-
))
|
|
126
|
+
)) : c("v-if", !0)
|
|
129
127
|
],
|
|
130
128
|
64
|
|
131
129
|
/* STABLE_FRAGMENT */
|
|
@@ -135,21 +133,21 @@ const U = ["id"], W = { class: "q-property-list__table" }, j = /* @__PURE__ */ G
|
|
|
135
133
|
))
|
|
136
134
|
])
|
|
137
135
|
]),
|
|
138
|
-
t.noPanel ?
|
|
136
|
+
t.noPanel ? c("v-if", !0) : (s(), f(m(O), {
|
|
139
137
|
key: 0,
|
|
140
|
-
field:
|
|
138
|
+
field: n.value,
|
|
141
139
|
texts: t.texts
|
|
142
140
|
}, {
|
|
143
|
-
default:
|
|
144
|
-
|
|
141
|
+
default: _(() => [
|
|
142
|
+
n.value ? F(e.$slots, "panel", {
|
|
145
143
|
key: 0,
|
|
146
|
-
field:
|
|
147
|
-
}) :
|
|
144
|
+
field: n.value
|
|
145
|
+
}) : c("v-if", !0)
|
|
148
146
|
]),
|
|
149
147
|
_: 3
|
|
150
148
|
/* FORWARDED */
|
|
151
149
|
}, 8, ["field", "texts"]))
|
|
152
|
-
], 42,
|
|
150
|
+
], 42, D));
|
|
153
151
|
}
|
|
154
152
|
});
|
|
155
153
|
export {
|
|
@@ -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
|
+
};
|