@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/ui.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quidgest UI v0.16.34
2
+ * Quidgest UI v0.16.35
3
3
  * (c) 2025 Quidgest - Consultores de Gestão, S.A.
4
4
  * Released under the MIT License.
5
5
  */
@@ -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 { darken as d } from "../../utils/color/manipulate.js";
5
- import { getContrastingColor as y } from "../../utils/color/contrast.js";
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 = y(f.l), u = d(r, 25), h = b(u);
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' {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,SAAS,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAI1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAElD,eAAO,MAAM,eAAe,aAAa,eAAe,yBAEvD,CAAA;AAED,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAA;AAChC,cAAc,eAAe,CAAA"}
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 i } from "./composables/theme.js";
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 u } from "./composables/useToast/index.js";
7
- const a = (e = {}) => o({ components: r, ...e });
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
- a as createFramework,
11
+ s as createFramework,
11
12
  n as provideTheme,
12
13
  t as templates,
13
14
  c as useDialog,
14
- i as useTheme,
15
- u as useToast
15
+ x as useTheme,
16
+ d as useToast,
17
+ m as utils
16
18
  };
@@ -1,6 +1,13 @@
1
- function r(t) {
2
- return t > 50 ? "#000" : "#fff";
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
- r as getContrastingColor
11
+ l as getComplementaryColor,
12
+ g as getContrastingColor
6
13
  };
@@ -1,7 +1,7 @@
1
- export * from './types';
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,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA"}
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 r, hslToRgb as c } from "./conversion.js";
2
- function e(t, n) {
3
- const o = r(t), l = n / 100;
4
- return o.l = o.l + l * (100 - o.l), c(o);
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, n) {
7
- const o = r(t), l = n / 100;
8
- return o.l = o.l - l * o.l, c(o);
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
- e as lighten
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,2 @@
1
+ export * from './color';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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
+ };
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.34",
4
+ "version": "0.16.35",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",