@quidgest/ui 0.16.32 → 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.
Files changed (44) hide show
  1. package/dist/json/api.json +25 -1
  2. package/dist/ui.css +20 -11
  3. package/dist/ui.esm.js +6788 -6641
  4. package/dist/ui.js +27 -27
  5. package/dist/ui.min.css +1 -1
  6. package/dist/ui.min.js +169 -154
  7. package/dist/ui.scss +54 -37
  8. package/esm/components/QColorPicker/QColorPicker.vue.js +1 -1
  9. package/esm/components/QList/QList.d.ts.map +1 -1
  10. package/esm/components/QList/QList.vue.js +75 -73
  11. package/esm/components/QSelect/QSelect.d.ts +160 -13
  12. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  13. package/esm/components/QSelect/QSelect.vue.js +326 -138
  14. package/esm/components/QSelect/index.d.ts +82 -3
  15. package/esm/components/QSelect/index.d.ts.map +1 -1
  16. package/esm/components/QSelect/types.d.ts +12 -0
  17. package/esm/components/QSelect/types.d.ts.map +1 -1
  18. package/esm/components/QToast/QToast.vue.js +44 -42
  19. package/esm/composables/useColor/index.js +23 -20
  20. package/esm/templates/theme.d.ts.map +1 -1
  21. package/esm/templates/theme.js +44 -10
  22. package/esm/utils/color/contrast.d.ts +18 -0
  23. package/esm/utils/color/contrast.d.ts.map +1 -0
  24. package/esm/utils/color/contrast.js +6 -0
  25. package/esm/utils/color/conversion.d.ts +41 -0
  26. package/esm/utils/color/conversion.d.ts.map +1 -0
  27. package/esm/utils/color/conversion.js +59 -0
  28. package/esm/utils/color/index.d.ts +7 -0
  29. package/esm/utils/color/index.d.ts.map +1 -0
  30. package/esm/utils/color/manipulate.d.ts +18 -0
  31. package/esm/utils/color/manipulate.d.ts.map +1 -0
  32. package/esm/utils/color/manipulate.js +13 -0
  33. package/esm/utils/color/merge.d.ts +19 -0
  34. package/esm/utils/color/merge.d.ts.map +1 -0
  35. package/esm/utils/color/parse.d.ts +24 -0
  36. package/esm/utils/color/parse.d.ts.map +1 -0
  37. package/esm/utils/color/parse.js +26 -0
  38. package/esm/utils/color/types.d.ts +51 -0
  39. package/esm/utils/color/types.d.ts.map +1 -0
  40. package/esm/utils/theme.js +1 -1
  41. package/package.json +3 -1
  42. package/esm/utils/color.d.ts +0 -123
  43. package/esm/utils/color.d.ts.map +0 -1
  44. package/esm/utils/color.js +0 -97
@@ -16,6 +16,8 @@ declare const QSelect: {
16
16
  groups?: import('../QList/types').Group[];
17
17
  clearable?: boolean;
18
18
  inline?: boolean;
19
+ multiple?: boolean;
20
+ badges?: boolean;
19
21
  loading?: boolean;
20
22
  emptyValue?: any;
21
23
  itemValue?: string;
@@ -42,7 +44,7 @@ declare const QSelect: {
42
44
  itemValue: string;
43
45
  itemLabel: string;
44
46
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
45
- triggerEl: ({
47
+ trigger: ({
46
48
  $: import('vue').ComponentInternalInstance;
47
49
  $data: {};
48
50
  $props: {
@@ -111,8 +113,81 @@ declare const QSelect: {
111
113
  extras?(_: {}): any;
112
114
  };
113
115
  }) | null;
114
- contentRef: HTMLDivElement;
115
- listRef: ({
116
+ badgesContainer: HTMLSpanElement;
117
+ allBadges: (({
118
+ $: import('vue').ComponentInternalInstance;
119
+ $data: {};
120
+ $props: {
121
+ readonly id?: string | undefined;
122
+ readonly class?: string | unknown[] | undefined;
123
+ readonly variant?: import('../QBadge/types').QBadgeVariant | undefined;
124
+ readonly color?: string | undefined;
125
+ readonly pill?: boolean | undefined;
126
+ readonly size?: import('../QBadge/types').QBadgeSize | undefined;
127
+ readonly removable?: boolean | undefined;
128
+ readonly icons?: typeof import('../QBadge/types').DEFAULT_ICONS | undefined;
129
+ readonly texts?: typeof import('../QBadge/types').DEFAULT_TEXTS | undefined;
130
+ readonly "onClick:remove"?: (() => any) | undefined;
131
+ } & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps;
132
+ $attrs: {
133
+ [x: string]: unknown;
134
+ };
135
+ $refs: {
136
+ [x: string]: unknown;
137
+ };
138
+ $slots: Readonly<{
139
+ [name: string]: import('vue').Slot<any> | undefined;
140
+ }>;
141
+ $root: import('vue').ComponentPublicInstance | null;
142
+ $parent: import('vue').ComponentPublicInstance | null;
143
+ $host: Element | null;
144
+ $emit: (event: "click:remove") => void;
145
+ $el: HTMLSpanElement;
146
+ $options: import('vue').ComponentOptionsBase<Readonly<import('../QBadge/types').QBadgeProps> & Readonly<{
147
+ "onClick:remove"?: (() => any) | undefined;
148
+ }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
149
+ "click:remove": () => any;
150
+ }, string, {
151
+ size: import('../QBadge/types').QBadgeSize;
152
+ color: string;
153
+ variant: import('../QBadge/types').QBadgeVariant;
154
+ icons: typeof import('../QBadge/types').DEFAULT_ICONS;
155
+ texts: typeof import('../QBadge/types').DEFAULT_TEXTS;
156
+ }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & {
157
+ beforeCreate?: (() => void) | (() => void)[];
158
+ created?: (() => void) | (() => void)[];
159
+ beforeMount?: (() => void) | (() => void)[];
160
+ mounted?: (() => void) | (() => void)[];
161
+ beforeUpdate?: (() => void) | (() => void)[];
162
+ updated?: (() => void) | (() => void)[];
163
+ activated?: (() => void) | (() => void)[];
164
+ deactivated?: (() => void) | (() => void)[];
165
+ beforeDestroy?: (() => void) | (() => void)[];
166
+ beforeUnmount?: (() => void) | (() => void)[];
167
+ destroyed?: (() => void) | (() => void)[];
168
+ unmounted?: (() => void) | (() => void)[];
169
+ renderTracked?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
170
+ renderTriggered?: ((e: import('vue').DebuggerEvent) => void) | ((e: import('vue').DebuggerEvent) => void)[];
171
+ errorCaptured?: ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: import('vue').ComponentPublicInstance | null, info: string) => boolean | void)[];
172
+ };
173
+ $forceUpdate: () => void;
174
+ $nextTick: typeof import('vue').nextTick;
175
+ $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, import('@vue/reactivity').OnCleanup]) => any : (...args: [any, any, import('@vue/reactivity').OnCleanup]) => any, options?: import('vue').WatchOptions): import('vue').WatchStopHandle;
176
+ } & Readonly<{
177
+ size: import('../QBadge/types').QBadgeSize;
178
+ color: string;
179
+ variant: import('../QBadge/types').QBadgeVariant;
180
+ icons: typeof import('../QBadge/types').DEFAULT_ICONS;
181
+ texts: typeof import('../QBadge/types').DEFAULT_TEXTS;
182
+ }> & Omit<Readonly<import('../QBadge/types').QBadgeProps> & Readonly<{
183
+ "onClick:remove"?: (() => any) | undefined;
184
+ }>, "size" | "color" | "variant" | "icons" | "texts"> & import('vue').ShallowUnwrapRef<{}> & {} & import('vue').ComponentCustomProperties & {} & {
185
+ $slots: {
186
+ default?(_: {}): any;
187
+ };
188
+ }) | null)[];
189
+ content: HTMLDivElement;
190
+ list: ({
116
191
  $: import('vue').ComponentInternalInstance;
117
192
  $data: {};
118
193
  $props: {
@@ -312,6 +387,8 @@ declare const QSelect: {
312
387
  groups?: import('../QList/types').Group[];
313
388
  clearable?: boolean;
314
389
  inline?: boolean;
390
+ multiple?: boolean;
391
+ badges?: boolean;
315
392
  loading?: boolean;
316
393
  emptyValue?: any;
317
394
  itemValue?: string;
@@ -351,6 +428,8 @@ declare const QSelect: {
351
428
  groups?: import('../QList/types').Group[];
352
429
  clearable?: boolean;
353
430
  inline?: boolean;
431
+ multiple?: boolean;
432
+ badges?: boolean;
354
433
  loading?: boolean;
355
434
  emptyValue?: any;
356
435
  itemValue?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/index.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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B,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAAtH,GAAG,8CAA8C,GAAG,yBAAyB,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAJj2zB,CAAA;AAGzC,OAAO,EAAE,OAAO,EAAE,CAAA"}
@@ -25,6 +25,18 @@ export type QSelectProps = QFieldProps & {
25
25
  * @category Behavior
26
26
  */
27
27
  inline?: boolean;
28
+ /**
29
+ * Whether multiple options can be selected.
30
+ *
31
+ * @category Behavior
32
+ */
33
+ multiple?: boolean;
34
+ /**
35
+ * Whether to display the selected option(s) as badge(s).
36
+ *
37
+ * @category Presentation
38
+ */
39
+ badges?: boolean;
28
40
  /**
29
41
  * Whether the items of the list are being loaded.
30
42
  *
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QSelect/types.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAE5C,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAEjD,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC;;;;OAIG;IACH,KAAK,CAAC,EAAE,IAAI,EAAE,CAAA;IAEd;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IAEH,UAAU,CAAC,EAAE,GAAG,CAAA;IAEhB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a;;;;CAIQ,CAAA;AAGlC,eAAO,MAAM,aAAa;;;;;;;CAGM,CAAA"}
@@ -1,4 +1,4 @@
1
- import { defineComponent as U, toRef as j, computed as d, onMounted as A, onUnmounted as D, createBlock as h, openBlock as y, unref as e, normalizeStyle as E, normalizeClass as H, createSlots as M, withCtx as l, createVNode as s, createCommentVNode as v, renderSlot as r, createElementVNode as p, toDisplayString as b, normalizeProps as k, guardReactiveProps as q } from "vue";
1
+ import { defineComponent as U, toRef as j, computed as d, onMounted as A, onUnmounted as D, createBlock as b, openBlock as h, unref as e, normalizeStyle as E, normalizeClass as H, createSlots as M, withCtx as l, createVNode as i, createCommentVNode as p, renderSlot as r, createElementVNode as v, toDisplayString as y, normalizeProps as k, guardReactiveProps as q } from "vue";
2
2
  import { DEFAULT_ICONS as P } from "./types.js";
3
3
  import { QButton as w } from "../QButton/index.js";
4
4
  import { QCard as F } from "../QCard/index.js";
@@ -6,8 +6,10 @@ import { QContainer as T, QRow as $, QCol as c } from "../QGrid/index.js";
6
6
  import { QIcon as g } from "../QIcon/index.js";
7
7
  import { useTheme as L } from "../../composables/theme.js";
8
8
  import { useColor as O } from "../../composables/useColor/index.js";
9
- import { parseColor as x, colorToHex as G, lighten as J } from "../../utils/color.js";
10
- const K = { class: "q-toast__title" }, nt = /* @__PURE__ */ U({
9
+ import { lighten as x } from "../../utils/color/manipulate.js";
10
+ import { parseColor as G } from "../../utils/color/parse.js";
11
+ import { rgbToHex as J } from "../../utils/color/conversion.js";
12
+ const K = { class: "q-toast__title" }, at = /* @__PURE__ */ U({
11
13
  __name: "QToast",
12
14
  props: {
13
15
  id: {},
@@ -23,50 +25,50 @@ const K = { class: "q-toast__title" }, nt = /* @__PURE__ */ U({
23
25
  },
24
26
  emits: ["dismiss"],
25
27
  setup(Q, { emit: V }) {
26
- const t = Q, S = V, B = L(), { isUtilityColor: f, style: u } = O(j(t, "color")), N = d(() => {
27
- const o = f.value ? `q-toast--${t.color}` : void 0, n = t.block ? "q-toast--block" : void 0, i = t.title ? "q-toast--vertical" : void 0;
28
+ const t = Q, S = V, B = L(), { isUtilityColor: m, style: u } = O(j(t, "color")), N = d(() => {
29
+ const o = m.value ? `q-toast--${t.color}` : void 0, s = t.block ? "q-toast--block" : void 0, n = t.title ? "q-toast--vertical" : void 0;
28
30
  return [
29
31
  "q-toast",
30
32
  `q-toast--${t.variant}`,
31
33
  o,
34
+ s,
32
35
  n,
33
- i,
34
36
  t.class
35
37
  ];
36
38
  }), C = d(() => {
37
- var i;
38
- const o = f.value ? R(t.color) : (i = u.value) == null ? void 0 : i.mainColor;
39
+ var n;
40
+ const o = m.value ? R(t.color) : (n = u.value) == null ? void 0 : n.mainColor;
39
41
  if (!o) return;
40
- const n = x(o);
41
- return G(J(n, 88));
42
+ const s = G(o);
43
+ return J(x(s, 88));
42
44
  }), z = d(() => {
43
- var o, n, i;
44
- return f.value ? {
45
+ var o, s, n;
46
+ return m.value ? {
45
47
  "--q-toast-tonal-color": C.value
46
48
  } : {
47
49
  "--q-toast-main-color": (o = u.value) == null ? void 0 : o.mainColor,
48
- "--q-toast-on-main-color": (n = u.value) == null ? void 0 : n.onMainColor,
49
- "--q-toast-hover-color": (i = u.value) == null ? void 0 : i.hoverColor,
50
+ "--q-toast-on-main-color": (s = u.value) == null ? void 0 : s.onMainColor,
51
+ "--q-toast-hover-color": (n = u.value) == null ? void 0 : n.hoverColor,
50
52
  "--q-toast-tonal-color": C.value
51
53
  };
52
54
  }), _ = d(() => t.variant === "bold" ? "bold" : "ghost");
53
55
  let a;
54
- function m() {
56
+ function f() {
55
57
  a !== void 0 && window.clearTimeout(a), S("dismiss");
56
58
  }
57
59
  function I() {
58
- a = window.setTimeout(m, t.timeout);
60
+ a = window.setTimeout(f, t.timeout);
59
61
  }
60
62
  function R(o) {
61
- const n = B.current.value.scheme;
62
- if (o in n)
63
- return n[o];
63
+ const s = B.current.value.scheme;
64
+ if (o in s)
65
+ return s[o];
64
66
  }
65
67
  return A(() => {
66
68
  t.timeout > 0 && I();
67
69
  }), D(() => {
68
70
  a !== void 0 && window.clearTimeout(a);
69
- }), (o, n) => (y(), h(e(F), {
71
+ }), (o, s) => (h(), b(e(F), {
70
72
  id: t.id,
71
73
  elevation: t.elevation,
72
74
  width: t.block ? "block" : void 0,
@@ -74,23 +76,23 @@ const K = { class: "q-toast__title" }, nt = /* @__PURE__ */ U({
74
76
  style: E(z.value)
75
77
  }, M({
76
78
  default: l(() => [
77
- s(e(T), {
79
+ i(e(T), {
78
80
  fluid: "",
79
81
  class: "q-toast__body"
80
82
  }, {
81
83
  default: l(() => [
82
- s(e($), {
84
+ i(e($), {
83
85
  align: "center",
84
86
  justify: "between"
85
87
  }, {
86
88
  default: l(() => [
87
- s(e(c), null, {
89
+ i(e(c), null, {
88
90
  default: l(() => [
89
91
  r(o.$slots, "default", {}, () => [
90
- p(
92
+ v(
91
93
  "span",
92
94
  null,
93
- b(t.text),
95
+ y(t.text),
94
96
  1
95
97
  /* TEXT */
96
98
  )
@@ -99,20 +101,20 @@ const K = { class: "q-toast__title" }, nt = /* @__PURE__ */ U({
99
101
  _: 3
100
102
  /* FORWARDED */
101
103
  }),
102
- t.title ? v("v-if", !0) : (y(), h(e(c), {
104
+ t.title ? p("v-if", !0) : (h(), b(e(c), {
103
105
  key: 0,
104
106
  cols: "auto"
105
107
  }, {
106
108
  default: l(() => [
107
109
  r(o.$slots, "dismiss", {}, () => [
108
- s(e(w), {
110
+ i(e(w), {
109
111
  class: "q-toast__dismiss",
110
112
  variant: _.value,
111
113
  color: t.color,
112
- onClick: m
114
+ onClick: f
113
115
  }, {
114
116
  default: l(() => [
115
- s(
117
+ i(
116
118
  e(g),
117
119
  k(q(t.icons.close)),
118
120
  null,
@@ -143,41 +145,41 @@ const K = { class: "q-toast__title" }, nt = /* @__PURE__ */ U({
143
145
  t.title ? {
144
146
  name: "header",
145
147
  fn: l(() => [
146
- s(e(T), { fluid: "" }, {
148
+ i(e(T), { fluid: "" }, {
147
149
  default: l(() => [
148
- s(e($), {
150
+ i(e($), {
149
151
  align: "center",
150
152
  justify: "between"
151
153
  }, {
152
154
  default: l(() => [
153
- s(e(c), null, {
155
+ i(e(c), null, {
154
156
  default: l(() => [
155
- p("div", K, [
156
- o.$slots["title.prepend"] ? r(o.$slots, "title.prepend", { key: 0 }) : v("v-if", !0),
157
- p(
157
+ v("div", K, [
158
+ o.$slots["title.prepend"] ? r(o.$slots, "title.prepend", { key: 0 }) : p("v-if", !0),
159
+ v(
158
160
  "h4",
159
161
  null,
160
- b(t.title),
162
+ y(t.title),
161
163
  1
162
164
  /* TEXT */
163
165
  ),
164
- o.$slots["title.append"] ? r(o.$slots, "title.append", { key: 1 }) : v("v-if", !0)
166
+ o.$slots["title.append"] ? r(o.$slots, "title.append", { key: 1 }) : p("v-if", !0)
165
167
  ])
166
168
  ]),
167
169
  _: 3
168
170
  /* FORWARDED */
169
171
  }),
170
- s(e(c), { cols: "auto" }, {
172
+ i(e(c), { cols: "auto" }, {
171
173
  default: l(() => [
172
174
  r(o.$slots, "dismiss", {}, () => [
173
- s(e(w), {
175
+ i(e(w), {
174
176
  class: "q-toast__dismiss",
175
177
  variant: _.value,
176
178
  color: t.color,
177
- onClick: m
179
+ onClick: f
178
180
  }, {
179
181
  default: l(() => [
180
- s(
182
+ i(
181
183
  e(g),
182
184
  k(q(t.icons.close)),
183
185
  null,
@@ -208,5 +210,5 @@ const K = { class: "q-toast__title" }, nt = /* @__PURE__ */ U({
208
210
  }
209
211
  });
210
212
  export {
211
- nt as default
213
+ at as default
212
214
  };
@@ -1,41 +1,44 @@
1
- import { computed as s, unref as v } from "vue";
2
- import { parseColor as g, rgbToHsl as d, darken as b, colorToHex as p, getContrastingColor as y, rgbToVariableString as c } from "../../utils/color.js";
3
- import { useTheme as T } from "../theme.js";
4
- function k(o) {
5
- const t = s(() => v(o)), i = s(
6
- () => t.value ? !H(t.value) : !1
7
- ), C = s(() => {
8
- const e = t.value;
9
- if (!e) return;
10
- let n = e;
11
- const f = T();
1
+ import { computed as l, unref as g } from "vue";
2
+ import { useTheme as v } from "../theme.js";
3
+ import { rgbToHsl as p, rgbToHex as b, rgbToVariableString as c } from "../../utils/color/conversion.js";
4
+ import { darken as d } from "../../utils/color/manipulate.js";
5
+ import { getContrastingColor as y } from "../../utils/color/contrast.js";
6
+ import { parseColor as T } from "../../utils/color/parse.js";
7
+ function K(o) {
8
+ const e = l(() => g(o)), i = l(
9
+ () => e.value ? !H(e.value) : !1
10
+ ), m = l(() => {
11
+ const t = e.value;
12
+ if (!t) return;
13
+ let n = t;
14
+ const C = v();
12
15
  if (i.value) {
13
- const l = e;
14
- n = f.current.value.scheme[l] ?? e;
16
+ const s = t;
17
+ n = C.current.value.scheme[s] ?? t;
15
18
  }
16
19
  let r;
17
20
  try {
18
- if (r = g(n), !r) return;
19
- } catch (l) {
20
- console.error("Failed to parse color:", l);
21
+ if (r = T(n), !r) return;
22
+ } catch (s) {
23
+ console.error("Failed to parse color:", s);
21
24
  return;
22
25
  }
23
- const h = d(r), a = y(h.l), u = b(r, 25), m = p(u);
26
+ const f = p(r), a = y(f.l), u = d(r, 25), h = b(u);
24
27
  return {
25
28
  mainColor: n,
26
29
  mainColorRgb: c(r),
27
30
  onMainColor: a,
28
- hoverColor: m,
31
+ hoverColor: h,
29
32
  hoverColorRgb: c(u),
30
33
  onHoverColor: a
31
34
  };
32
35
  });
33
- return { isUtilityColor: i, style: C };
36
+ return { isUtilityColor: i, style: m };
34
37
  }
35
38
  function H(o) {
36
39
  return o.startsWith("#") || o.startsWith("rgb") || o.startsWith("hsl");
37
40
  }
38
41
  export {
39
42
  H as isCssColor,
40
- k as useColor
43
+ K as useColor
41
44
  };
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/templates/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,eAAO,MAAM,uBAAuB,EAAE,WAoCrC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,WAoCpC,CAAA"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/templates/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,eAAO,MAAM,uBAAuB,EAAE,WAsDrC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,WAsDpC,CAAA"}
@@ -1,4 +1,4 @@
1
- const a = {
1
+ const n = {
2
2
  primary: "#008ad2",
3
3
  primaryLight: "#cde5ff",
4
4
  primaryDark: "#006398",
@@ -25,16 +25,33 @@ const a = {
25
25
  neutral: "#7c858d",
26
26
  neutralLight: "#c4c5ca",
27
27
  neutralDark: "#40474f",
28
- onBackground: "#202428",
29
28
  onPrimary: "#fff",
29
+ onPrimaryLight: "#202428",
30
+ onPrimaryDark: "#fff",
30
31
  onSecondary: "#fff",
32
+ onSecondaryLight: "#202428",
33
+ onSecondaryDark: "#fff",
31
34
  onHighlight: "#fff",
35
+ onHighlightLight: "#202428",
36
+ onHighlightDark: "#fff",
37
+ onInfo: "#fff",
38
+ onInfoLight: "#202428",
39
+ onInfoDark: "#fff",
32
40
  onSuccess: "#fff",
41
+ onSuccessLight: "#202428",
42
+ onSuccessDark: "#fff",
33
43
  onWarning: "#fff",
44
+ onWarningLight: "#202428",
45
+ onWarningDark: "#fff",
34
46
  onDanger: "#fff",
35
- onInfo: "#fff",
36
- onNeutral: "#fff"
37
- }, f = {
47
+ onDangerLight: "#202428",
48
+ onDangerDark: "#fff",
49
+ onBackground: "#202428",
50
+ onContainer: "#202428",
51
+ onNeutral: "#fff",
52
+ onNeutralLight: "#202428",
53
+ onNeutralDark: "#fff"
54
+ }, a = {
38
55
  primary: "#4da6e0",
39
56
  primaryLight: "#1a2832",
40
57
  primaryDark: "#87c5f0",
@@ -61,17 +78,34 @@ const a = {
61
78
  neutral: "#9ca3ab",
62
79
  neutralLight: "#2a2d31",
63
80
  neutralDark: "#c8ced6",
64
- onBackground: "#e0e0e0",
65
81
  onPrimary: "#000",
82
+ onPrimaryLight: "#e0e0e0",
83
+ onPrimaryDark: "#000",
66
84
  onSecondary: "#000",
85
+ onSecondaryLight: "#e0e0e0",
86
+ onSecondaryDark: "#000",
67
87
  onHighlight: "#000",
88
+ onHighlightLight: "#e0e0e0",
89
+ onHighlightDark: "#000",
90
+ onInfo: "#000",
91
+ onInfoLight: "#e0e0e0",
92
+ onInfoDark: "#000",
68
93
  onSuccess: "#000",
94
+ onSuccessLight: "#e0e0e0",
95
+ onSuccessDark: "#000",
69
96
  onWarning: "#000",
97
+ onWarningLight: "#e0e0e0",
98
+ onWarningDark: "#000",
70
99
  onDanger: "#000",
71
- onInfo: "#000",
72
- onNeutral: "#000"
100
+ onDangerLight: "#e0e0e0",
101
+ onDangerDark: "#000",
102
+ onBackground: "#e0e0e0",
103
+ onContainer: "#e0e0e0",
104
+ onNeutral: "#000",
105
+ onNeutralLight: "#e0e0e0",
106
+ onNeutralDark: "#000"
73
107
  };
74
108
  export {
75
- f as defaultDarkColorScheme,
76
- a as defaultLightColorScheme
109
+ a as defaultDarkColorScheme,
110
+ n as defaultLightColorScheme
77
111
  };
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Determines a contrasting color (black or white) based on the given luminance.
3
+ * Useful for ensuring text readability against a background color with the given luminance.
4
+ *
5
+ * @param luminance - The luminance value (between 0 and 100) of the background color.
6
+ * @returns A hex string representing either black ('#000') or white ('#fff').
7
+ */
8
+ export declare function getContrastingColor(luminance: number): '#000' | '#fff';
9
+ /**
10
+ * Calculates the complementary color for a given color string.
11
+ * The complementary color is the color directly opposite on the color wheel,
12
+ * often used for strong visual contrast.
13
+ *
14
+ * @param color - The color string to convert. Can be in various formats (e.g., hex, rgb, rgba, hsl, hsla).
15
+ * @returns A hex string representing the complementary color.
16
+ */
17
+ export declare function getComplementaryColor(color: string): string;
18
+ //# sourceMappingURL=contrast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../../src/utils/color/contrast.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAMtE;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAW3D"}
@@ -0,0 +1,6 @@
1
+ function r(t) {
2
+ return t > 50 ? "#000" : "#fff";
3
+ }
4
+ export {
5
+ r as getContrastingColor
6
+ };
@@ -0,0 +1,41 @@
1
+ import { RGB, HSL } from './types';
2
+ /**
3
+ * Converts a color from RGB to HSL space.
4
+ *
5
+ * @param color The color to convert.
6
+ * @returns An object representing the color in HSL space.
7
+ */
8
+ export declare function rgbToHsl(rgb: RGB): HSL;
9
+ /**
10
+ * Converts a color from HSL to RGB space.
11
+ *
12
+ * @param h The hue component of the color, in the range [0, 1].
13
+ * @param s The saturation component of the color, in the range [0, 1].
14
+ * @param l The lightness component of the color, in the range [0, 1].
15
+ * @returns A `RGB` object representing the color in RGB space.
16
+ */
17
+ export declare function hslToRgb(hsl: HSL): RGB;
18
+ /**
19
+ * Converts a hue value to a corresponding RGB value.
20
+ *
21
+ * @param p The first RGB component.
22
+ * @param q The second RGB component.
23
+ * @param t The hue value.
24
+ * @returns The corresponding RGB value.
25
+ */
26
+ export declare function hueToRgb(p: number, q: number, t: number): number;
27
+ /**
28
+ * Converts a RGB value to a hex string.
29
+ *
30
+ * @param rgb The color to convert.
31
+ * @returns A hex string representing the color.
32
+ */
33
+ export declare function rgbToHex(rgb: RGB): string;
34
+ /**
35
+ * Converts an RGB object to a string in the format 'r g b'.
36
+ *
37
+ * @param rgb The RGB object to convert.
38
+ * @returns A string representing the color in 'r g b' format.
39
+ */
40
+ export declare function rgbToVariableString(rgb: RGB): string;
41
+ //# sourceMappingURL=conversion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversion.d.ts","sourceRoot":"","sources":["../../../src/utils/color/conversion.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAEvC;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAqCtC;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAuBtC;AAED;;;;;;;GAOG;AACH,wBAAgB,QAAQ,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAOhE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAMzC;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,GAAG,GAAG,MAAM,CAEpD"}
@@ -0,0 +1,59 @@
1
+ function f(t) {
2
+ const r = t.r / 255, n = t.g / 255, o = t.b / 255, s = Math.max(r, n, o), c = Math.min(r, n, o);
3
+ let a = 0, e;
4
+ const i = (s + c) / 2;
5
+ if (s === c)
6
+ a = e = 0;
7
+ else {
8
+ const u = s - c;
9
+ switch (e = i > 0.5 ? u / (2 - s - c) : u / (s + c), s) {
10
+ case r:
11
+ a = (n - o) / u + (n < o ? 6 : 0);
12
+ break;
13
+ case n:
14
+ a = (o - r) / u + 2;
15
+ break;
16
+ case o:
17
+ a = (r - n) / u + 4;
18
+ break;
19
+ }
20
+ a /= 6;
21
+ }
22
+ return {
23
+ h: Math.round(a * 360),
24
+ s: Math.round(e * 100),
25
+ l: Math.round(i * 100)
26
+ };
27
+ }
28
+ function b(t) {
29
+ const r = t.h / 360, n = t.s / 100, o = t.l / 100;
30
+ let s, c, a;
31
+ if (n === 0)
32
+ s = c = a = o;
33
+ else {
34
+ const e = o < 0.5 ? o * (1 + n) : o + n - o * n, i = 2 * o - e;
35
+ s = h(i, e, r + 1 / 3), c = h(i, e, r), a = h(i, e, r - 1 / 3);
36
+ }
37
+ return {
38
+ r: Math.round(s * 255),
39
+ g: Math.round(c * 255),
40
+ b: Math.round(a * 255)
41
+ };
42
+ }
43
+ function h(t, r, n) {
44
+ 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;
45
+ }
46
+ function d(t) {
47
+ const r = t.r.toString(16).padStart(2, "0"), n = t.g.toString(16).padStart(2, "0"), o = t.b.toString(16).padStart(2, "0");
48
+ return `#${r}${n}${o}`;
49
+ }
50
+ function g(t) {
51
+ return `${t.r} ${t.g} ${t.b}`;
52
+ }
53
+ export {
54
+ b as hslToRgb,
55
+ h as hueToRgb,
56
+ d as rgbToHex,
57
+ f as rgbToHsl,
58
+ g as rgbToVariableString
59
+ };
@@ -0,0 +1,7 @@
1
+ export * from './types';
2
+ export * from './parse';
3
+ export * from './conversion';
4
+ export * from './manipulate';
5
+ export * from './contrast';
6
+ export * from './merge';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/color/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}