@quidgest/ui 0.16.31 → 0.16.32

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.min.js CHANGED
@@ -1,11 +1,11 @@
1
1
  !function(e,t){"object"==typeof exports&&typeof module<"u"?t(exports,require("vue")):"function"==typeof define&&define.amd?define(["exports","vue"],t):t((e=typeof globalThis<"u"?globalThis:e||self)["Quidgest UI"]={},e.Vue)}(this,(function(e,t){"use strict"
2
2
  var a=Object.defineProperty,n=(e,t,n)=>((e,t,n)=>t in e?a(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n)
3
3
  /*!
4
- * Quidgest UI v0.16.31
4
+ * Quidgest UI v0.16.32
5
5
  * (c) 2025 Quidgest - Consultores de Gestão, S.A.
6
6
  * Released under the MIT License.
7
7
  */
8
- const o={primary:"#008ad2",primaryLight:"#cde5ff",primaryDark:"#006398",secondary:"#001d31",secondaryLight:"#e6eef3",secondaryDark:"#001425",highlight:"#ff8241",highlightLight:"#ffe4d6",highlightDark:"#cc4700",info:"#17a2b8",infoLight:"#bceff7",infoDark:"#11798a",success:"#28a745",successLight:"#c2f0cd",successDark:"#1e7d34",warning:"#ffa900",warningLight:"#ffeabf",warningDark:"#bf7f00",danger:"#b71c1c",dangerLight:"#f7cccc",dangerDark:"#891515",background:"#fff",container:"#fff",neutral:"#7c858d",neutralLight:"#c4c5ca",neutralDark:"#40474f",onBackground:"#202428",onPrimary:"#fff",onSecondary:"#fff",onHighlight:"#fff",onSuccess:"#fff",onWarning:"#fff",onDanger:"#fff",onInfo:"#fff",onNeutral:"#fff"},l={primary:"#4da6e0",primaryLight:"#2d8bc7",primaryDark:"#87c4e8",secondary:"#4a6b82",secondaryLight:"#2c4a5e",secondaryDark:"#6b8ca3",highlight:"#ff9966",highlightLight:"#e67344",highlightDark:"#ffb088",info:"#3bb5d1",infoLight:"#2a9bb8",infoDark:"#66c7dd",success:"#4caf50",successLight:"#388e3c",successDark:"#81c784",warning:"#ffb74d",warningLight:"#e67e22",warningDark:"#ffcc80",danger:"#e57373",dangerLight:"#c62828",dangerDark:"#ef9a9a",background:"#121212",container:"#1e1e1e",neutral:"#9e9e9e",neutralLight:"#666666",neutralDark:"#d0d0d0",onBackground:"#ffffff",onPrimary:"#ffffff",onSecondary:"#ffffff",onHighlight:"#ffffff",onSuccess:"#ffffff",onWarning:"#000000",onDanger:"#ffffff",onInfo:"#ffffff",onNeutral:"#000000"},r=Object.freeze(Object.defineProperty({__proto__:null,defaultDarkColorScheme:l,defaultLightColorScheme:o},Symbol.toStringTag,{value:"Module"}))
8
+ const o={primary:"#008ad2",primaryLight:"#cde5ff",primaryDark:"#006398",secondary:"#001d31",secondaryLight:"#e6eef3",secondaryDark:"#001425",highlight:"#ff8241",highlightLight:"#ffe4d6",highlightDark:"#cc4700",info:"#17a2b8",infoLight:"#bceff7",infoDark:"#11798a",success:"#28a745",successLight:"#c2f0cd",successDark:"#1e7d34",warning:"#ffa900",warningLight:"#ffeabf",warningDark:"#bf7f00",danger:"#b71c1c",dangerLight:"#f7cccc",dangerDark:"#891515",background:"#fff",container:"#fff",neutral:"#7c858d",neutralLight:"#c4c5ca",neutralDark:"#40474f",onBackground:"#202428",onPrimary:"#fff",onSecondary:"#fff",onHighlight:"#fff",onSuccess:"#fff",onWarning:"#fff",onDanger:"#fff",onInfo:"#fff",onNeutral:"#fff"},l={primary:"#4da6e0",primaryLight:"#1a2832",primaryDark:"#87c5f0",secondary:"#b8d4e6",secondaryLight:"#1a2832",secondaryDark:"#e6f2ff",highlight:"#ff9966",highlightLight:"#2d1a0f",highlightDark:"#ffb899",info:"#4cb8d1",infoLight:"#1f2a2d",infoDark:"#7dcce0",success:"#5cb85c",successLight:"#1e2a20",successDark:"#85d085",warning:"#ffcc4d",warningLight:"#332a1a",warningDark:"#ffd966",danger:"#e74c3c",dangerLight:"#2d1a1a",dangerDark:"#f17066",background:"#121212",container:"#1e1e1e",neutral:"#9ca3ab",neutralLight:"#2a2d31",neutralDark:"#c8ced6",onBackground:"#e0e0e0",onPrimary:"#000",onSecondary:"#000",onHighlight:"#000",onSuccess:"#000",onWarning:"#000",onDanger:"#000",onInfo:"#000",onNeutral:"#000"},r=Object.freeze(Object.defineProperty({__proto__:null,defaultDarkColorScheme:l,defaultLightColorScheme:o},Symbol.toStringTag,{value:"Module"}))
9
9
  function i(e){return null==e||("string"==typeof e||Array.isArray(e)?0===e.length:"object"==typeof e&&0===Object.keys(e).length)}function s(e){return null!==e&&"object"==typeof e&&!Array.isArray(e)}function u(e={},t={}){const a={},n=new Set([...Object.keys(e),...Object.keys(t)])
10
10
  for(const o of n){if("__proto__"===o||"constructor"===o||"prototype"===o)continue
11
11
  const n=e[o],l=t[o]
@@ -71,18 +71,14 @@ if(e){t+=` ${A(n)}: ${e};\n`
71
71
  const a=M(e)
72
72
  t+=` ${A(n)}-rgb: ${a.r} ${a.g} ${a.b};\n`}}return t+="}\n",t}function q(e){const t=e.map(P).join("\n"),a=function(){let e=document.getElementById(T)
73
73
  return e||(e=document.createElement("style"),e.id=T,document.head.appendChild(e)),e}()
74
- a.textContent=t}function A(e){return e?`--q-theme-${x(e)}`:""}function R(e,a){const n=t.ref(t.toValue(e)),o=t.computed((()=>{const e=a.find((e=>e.name===n.value))
75
- if(!e)throw new Error(`Theme "${n.value}" not found`)
76
- return e})),l=t.computed((()=>z(o.value.name))),r=t.computed((()=>P(o.value)))
77
- return{name:n,current:o,themes:a,class:l,css:r}}function z(e){return`q-theme--${x(e)}`}const L=Symbol.for("q-theme")
74
+ a.textContent=t}function A(e){return e?`--q-theme-${x(e)}`:""}function R(e,a){const n=t.computed((()=>{const t=a.value.find((t=>t.name===e.value))
75
+ if(!t)throw new Error(`[Quidgest UI] Theme "${e.value}" not found`)
76
+ return t})),o=t.computed((()=>z(n.value.name))),l=t.computed((()=>P(n.value)))
77
+ return{name:e,current:n,themes:a,class:o,css:l}}function z(e){return`q-theme--${x(e)}`}const L=Symbol.for("q-theme")
78
78
  function O(){const e=t.inject(L)
79
79
  if(!e)throw new Error("[Quidgest UI] Could not find theme instance")
80
- return e}function I(e){const a=O()
81
- let n,o=structuredClone(a.themes)
82
- const l=t.toValue(e)
83
- "string"!=typeof l?(o=[...o,l],n=l.name):n=l
84
- const r=R(n,o)
85
- return t.provide(L,r),r}function F(e){const a=t.computed((()=>t.unref(e))),n=t.computed((()=>!!a.value&&!function(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}(a.value))),o=t.computed((()=>{const e=a.value
80
+ return e}function I(e){const{themes:a}=O(),n=t.computed((()=>t.toValue(e))),o=t.computed((()=>"string"!=typeof n.value)),l=R(t.computed((()=>o.value?n.value.name:n.value)),t.computed((()=>o.value?[...a.value,n.value]:a.value)))
81
+ return t.provide(L,l),l}function F(e){const a=t.computed((()=>t.unref(e))),n=t.computed((()=>!!a.value&&!function(e){return e.startsWith("#")||e.startsWith("rgb")||e.startsWith("hsl")}(a.value))),o=t.computed((()=>{const e=a.value
86
82
  if(!e)return
87
83
  let t=e
88
84
  const o=O()
@@ -1559,7 +1555,7 @@ a.provide(d,t.ref(r)),function(e,a){const n=[]
1559
1555
  let r
1560
1556
  if(a)for(const e of a.themes){const t={..."light"===e.mode?o:l,...e.colors}
1561
1557
  n.push({name:e.name,mode:e.mode,scheme:t}),e.name===a.defaultTheme&&(r=e.name)}else{const e=[{name:"light",mode:"light",scheme:o},{name:"dark",mode:"dark",scheme:l}]
1562
- n.push(...e),r="light"}if(r){const a=R(t.ref(r),n)
1558
+ n.push(...e),r="light"}if(r){const a=R(t.ref(r),t.ref(n))
1563
1559
  q(n),t.watch(a.class,Np,{immediate:!0}),e.provide(L,a)}}(a,e.themes)
1564
1560
  const i=function(){const e=t.ref([])
1565
1561
  return{layers:e,register:function(t){e.value.push(t)},unregister:function(t){const a=e.value.indexOf(t);-1!==a&&e.value.splice(a,1)},isTop:function(t){return e.value[e.value.length-1]===t}}}()
package/dist/ui.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quidgest UI v0.16.31
2
+ * Quidgest UI v0.16.32
3
3
  * (c) 2025 Quidgest - Consultores de Gestão, S.A.
4
4
  * Released under the MIT License.
5
5
  */
@@ -43,7 +43,7 @@ export type ThemeInstance = {
43
43
  /** A computed reference to the current theme definition. */
44
44
  readonly current: DeepReadonly<ComputedRef<ThemeDefinition>>;
45
45
  /** An array of available theme definitions. */
46
- readonly themes: DeepReadonly<ThemeDefinition[]>;
46
+ readonly themes: DeepReadonly<Ref<ThemeDefinition[]>>;
47
47
  /** The theme class name. */
48
48
  readonly class: ComputedRef<string>;
49
49
  /** The theme CSS definition. */
@@ -56,23 +56,22 @@ export type ThemeInstance = {
56
56
  */
57
57
  export declare function useTheme(): ThemeInstance;
58
58
  /**
59
- * Provides and manages a reactive theme instance within the Vue dependency injection system.
59
+ * Provides and manages a reactive theme instance within Vue’s dependency injection system.
60
60
  *
61
- * This function retrieves the current list of available themes from the theme context,
62
- * optionally adds a new `ThemeDefinition`, and creates a reactive theme instance.
63
- * The new theme instance is then provided using Vue's `provide`, making it accessible
64
- * to all descendant components via `inject`.
61
+ * This function:
62
+ * - Retrieves the current list of available themes from the existing theme context.
63
+ * - Resolves the input (`nameOrDef`) to either a theme name or a full `ThemeDefinition`.
64
+ * - If a `ThemeDefinition` is provided, it is appended to the existing list of themes.
65
+ * - Creates a new reactive `ThemeInstance` bound to the resolved name and theme list.
66
+ * - Provides the new `ThemeInstance` under `ThemeSymbol`, making it available to descendants via `useTheme()`.
65
67
  *
66
- * @param nameOrDef - Either:
67
- * - A string (or `Ref<string>`/getter) specifying the name of the theme to activate.
68
- * - A `ThemeDefinition` (or `Ref<ThemeDefinition>`/getter) to register and activate.
68
+ * @param nameOrDef - The theme to activate, given as either:
69
+ * - A theme name (`string`), or a reactive source (`Ref<string>`/getter).
70
+ * - A `ThemeDefinition`, or a reactive source (`Ref<ThemeDefinition>`/getter).
69
71
  *
70
- * @returns The newly created and provided `ThemeInstance`, containing:
71
- * - `name`: reactive theme name (`Ref<string>`),
72
- * - `current`: computed active theme (`Ref<ThemeDefinition>`),
73
- * - `themes`: array of all available themes,
74
- * - `class`: computed CSS class string for the theme,
75
- * - `css`: computed CSS variables string for the theme.
72
+ * @returns The newly created and provided `ThemeInstance`.
73
+ *
74
+ * @throws {Error} If the resolved theme name does not exist in the available themes.
76
75
  */
77
76
  export declare function provideTheme(nameOrDef: MaybeRefOrGetter<string | ThemeDefinition>): ThemeInstance;
78
77
  //# sourceMappingURL=theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/composables/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAMjD,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,aAAa,CAAyB,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAA;IAEpB,mEAAmE;IACnE,MAAM,EAAE,KAAK,CAAC;QACb,6BAA6B;QAC7B,IAAI,EAAE,MAAM,CAAA;QAEZ,mDAAmD;QACnD,IAAI,EAAE,SAAS,CAAA;QAEf,qEAAqE;QACrE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;KAC7B,CAAC,CAAA;CACF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IAEZ,mDAAmD;IACnD,IAAI,EAAE,SAAS,CAAA;IAEf,kDAAkD;IAClD,MAAM,EAAE,WAAW,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAE1B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAA;IAE5D,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,eAAe,EAAE,CAAC,CAAA;IAEhD,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAEnC,gCAAgC;IAChC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,aAAa,CAQxC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AAEH,wBAAgB,YAAY,CAAC,SAAS,EAAE,gBAAgB,CAAC,MAAM,GAAG,eAAe,CAAC,GAAG,aAAa,CAsBjG"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/composables/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAMjD,eAAO,MAAM,WAAW,EAAE,YAAY,CAAC,aAAa,CAAyB,CAAA;AAE7E;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,MAAM,CAAA;AAExC;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG;IACvB,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAA;IAEpB,mEAAmE;IACnE,MAAM,EAAE,KAAK,CAAC;QACb,6BAA6B;QAC7B,IAAI,EAAE,MAAM,CAAA;QAEZ,mDAAmD;QACnD,IAAI,EAAE,SAAS,CAAA;QAEf,qEAAqE;QACrE,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC,CAAA;KAC7B,CAAC,CAAA;CACF,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC7B,oCAAoC;IACpC,IAAI,EAAE,MAAM,CAAA;IAEZ,mDAAmD;IACnD,IAAI,EAAE,SAAS,CAAA;IAEf,kDAAkD;IAClD,MAAM,EAAE,WAAW,CAAA;CACnB,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IAC3B,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAE1B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAC,WAAW,CAAC,eAAe,CAAC,CAAC,CAAA;IAE5D,+CAA+C;IAC/C,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,CAAA;IAErD,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;IAEnC,gCAAgC;IAChC,QAAQ,CAAC,GAAG,EAAE,WAAW,CAAC,MAAM,GAAG,SAAS,CAAC,CAAA;CAC7C,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,aAAa,CAQxC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,YAAY,CAAC,SAAS,EAAE,gBAAgB,CAAC,MAAM,GAAG,eAAe,CAAC,GAAG,aAAa,CA2CjG"}
@@ -1,22 +1,22 @@
1
- import { toValue as c, provide as i, inject as h } from "vue";
2
- import { createThemeInstance as u } from "../utils/theme.js";
1
+ import { computed as n, toValue as c, provide as a, inject as l } from "vue";
2
+ import { createThemeInstance as h } from "../utils/theme.js";
3
3
  const m = Symbol.for("q-theme");
4
- function f() {
5
- const e = h(m);
4
+ function v() {
5
+ const e = l(m);
6
6
  if (!e)
7
7
  throw new Error("[Quidgest UI] Could not find theme instance");
8
8
  return e;
9
9
  }
10
- function d(e) {
11
- const s = f();
12
- let n, o = structuredClone(s.themes);
13
- const t = c(e);
14
- typeof t != "string" ? (o = [...o, t], n = t.name) : n = t;
15
- const r = u(n, o);
16
- return i(m, r), r;
10
+ function p(e) {
11
+ const { themes: o } = v(), t = n(() => c(e)), s = n(() => typeof t.value != "string"), r = n(
12
+ () => s.value ? t.value.name : t.value
13
+ ), u = n(
14
+ () => s.value ? [...o.value, t.value] : o.value
15
+ ), i = h(r, u);
16
+ return a(m, i), i;
17
17
  }
18
18
  export {
19
19
  m as ThemeSymbol,
20
- d as provideTheme,
21
- f as useTheme
20
+ p as provideTheme,
21
+ v as useTheme
22
22
  };
package/esm/framework.js CHANGED
@@ -1,21 +1,21 @@
1
- import { DEFAULTS_SYMBOL as i } from "./composables/defaults.js";
1
+ import { DEFAULTS_SYMBOL as c } from "./composables/defaults.js";
2
2
  import { ThemeSymbol as h } from "./composables/theme.js";
3
3
  import { DismissibleLayerKey as f } from "./symbols/dismissibleLayer.js";
4
4
  import { ToastSymbol as d } from "./composables/useToast/types.js";
5
5
  import { useDismissibleLayerStack as u } from "./composables/useDismissibleLayerStack/index.js";
6
6
  import { createToastInstance as p } from "./composables/useToast/index.js";
7
- import { defaultLightColorScheme as r, defaultDarkColorScheme as l } from "./templates/theme.js";
8
- import { ref as c, watch as S } from "vue";
7
+ import { defaultLightColorScheme as l, defaultDarkColorScheme as i } from "./templates/theme.js";
8
+ import { ref as n, watch as S } from "vue";
9
9
  import { createThemeInstance as T, generateRootStyle as L } from "./utils/theme.js";
10
10
  function N(o = {}) {
11
11
  return { install: (t) => {
12
12
  const m = o.components || {};
13
- for (const n in m)
14
- t.component(n, m[n]);
13
+ for (const a in m)
14
+ t.component(a, m[a]);
15
15
  const e = o.defaults || {};
16
- t.provide(i, c(e)), y(t, o.themes);
17
- const a = u();
18
- t.provide(f, a), b(t);
16
+ t.provide(c, n(e)), y(t, o.themes);
17
+ const r = u();
18
+ t.provide(f, r), b(t);
19
19
  } };
20
20
  }
21
21
  function y(o, s) {
@@ -23,11 +23,11 @@ function y(o, s) {
23
23
  let m;
24
24
  if (s)
25
25
  for (const e of s.themes) {
26
- const n = { ...e.mode === "light" ? r : l, ...e.colors };
26
+ const a = { ...e.mode === "light" ? l : i, ...e.colors };
27
27
  t.push({
28
28
  name: e.name,
29
29
  mode: e.mode,
30
- scheme: n
30
+ scheme: a
31
31
  }), e.name === s.defaultTheme && (m = e.name);
32
32
  }
33
33
  else {
@@ -35,19 +35,19 @@ function y(o, s) {
35
35
  {
36
36
  name: "light",
37
37
  mode: "light",
38
- scheme: r
38
+ scheme: l
39
39
  },
40
40
  {
41
41
  name: "dark",
42
42
  mode: "dark",
43
- scheme: l
43
+ scheme: i
44
44
  }
45
45
  ];
46
46
  t.push(...e), m = "light";
47
47
  }
48
48
  if (m) {
49
- const e = c(m), a = T(e, t);
50
- L(t), S(a.class, k, { immediate: !0 }), o.provide(h, a);
49
+ const e = T(n(m), n(t));
50
+ L(t), S(e.class, k, { immediate: !0 }), o.provide(h, e);
51
51
  }
52
52
  }
53
53
  function b(o) {
@@ -1,4 +1,4 @@
1
- const f = {
1
+ const a = {
2
2
  primary: "#008ad2",
3
3
  primaryLight: "#cde5ff",
4
4
  primaryDark: "#006398",
@@ -34,44 +34,44 @@ const f = {
34
34
  onDanger: "#fff",
35
35
  onInfo: "#fff",
36
36
  onNeutral: "#fff"
37
- }, a = {
37
+ }, f = {
38
38
  primary: "#4da6e0",
39
- primaryLight: "#2d8bc7",
40
- primaryDark: "#87c4e8",
41
- secondary: "#4a6b82",
42
- secondaryLight: "#2c4a5e",
43
- secondaryDark: "#6b8ca3",
39
+ primaryLight: "#1a2832",
40
+ primaryDark: "#87c5f0",
41
+ secondary: "#b8d4e6",
42
+ secondaryLight: "#1a2832",
43
+ secondaryDark: "#e6f2ff",
44
44
  highlight: "#ff9966",
45
- highlightLight: "#e67344",
46
- highlightDark: "#ffb088",
47
- info: "#3bb5d1",
48
- infoLight: "#2a9bb8",
49
- infoDark: "#66c7dd",
50
- success: "#4caf50",
51
- successLight: "#388e3c",
52
- successDark: "#81c784",
53
- warning: "#ffb74d",
54
- warningLight: "#e67e22",
55
- warningDark: "#ffcc80",
56
- danger: "#e57373",
57
- dangerLight: "#c62828",
58
- dangerDark: "#ef9a9a",
45
+ highlightLight: "#2d1a0f",
46
+ highlightDark: "#ffb899",
47
+ info: "#4cb8d1",
48
+ infoLight: "#1f2a2d",
49
+ infoDark: "#7dcce0",
50
+ success: "#5cb85c",
51
+ successLight: "#1e2a20",
52
+ successDark: "#85d085",
53
+ warning: "#ffcc4d",
54
+ warningLight: "#332a1a",
55
+ warningDark: "#ffd966",
56
+ danger: "#e74c3c",
57
+ dangerLight: "#2d1a1a",
58
+ dangerDark: "#f17066",
59
59
  background: "#121212",
60
60
  container: "#1e1e1e",
61
- neutral: "#9e9e9e",
62
- neutralLight: "#666666",
63
- neutralDark: "#d0d0d0",
64
- onBackground: "#ffffff",
65
- onPrimary: "#ffffff",
66
- onSecondary: "#ffffff",
67
- onHighlight: "#ffffff",
68
- onSuccess: "#ffffff",
69
- onWarning: "#000000",
70
- onDanger: "#ffffff",
71
- onInfo: "#ffffff",
72
- onNeutral: "#000000"
61
+ neutral: "#9ca3ab",
62
+ neutralLight: "#2a2d31",
63
+ neutralDark: "#c8ced6",
64
+ onBackground: "#e0e0e0",
65
+ onPrimary: "#000",
66
+ onSecondary: "#000",
67
+ onHighlight: "#000",
68
+ onSuccess: "#000",
69
+ onWarning: "#000",
70
+ onDanger: "#000",
71
+ onInfo: "#000",
72
+ onNeutral: "#000"
73
73
  };
74
74
  export {
75
- a as defaultDarkColorScheme,
76
- f as defaultLightColorScheme
75
+ f as defaultDarkColorScheme,
76
+ a as defaultLightColorScheme
77
77
  };
@@ -1,4 +1,4 @@
1
- import { DeepReadonly, MaybeRefOrGetter } from 'vue';
1
+ import { DeepReadonly, Ref } from 'vue';
2
2
  import { ThemeDefinition, ThemeInstance } from '../composables/theme';
3
3
  export declare const THEME_NODE_ID = "q-theme";
4
4
  /**
@@ -33,24 +33,24 @@ export declare function generateRootStyle(themes: ThemeDefinition[]): void;
33
33
  */
34
34
  export declare function toProperty(color: string): string;
35
35
  /**
36
- * Creates a reactive theme instance for a given theme name.
36
+ * Creates a reactive theme instance bound to a given theme name and list of theme definitions.
37
37
  *
38
- * This provides reactive access to the currently active theme and
39
- * computed properties for applying its CSS class and CSS variables.
38
+ * This function ensures the active theme is always kept in sync with the provided `name` ref,
39
+ * and exposes reactive/computed properties for convenient use in templates and styling.
40
40
  *
41
- * @param name - The name of the theme to activate, or a getter/ref returning a string.
42
- * @param themes - A readonly array of available theme definitions.
41
+ * @param name - A reactive `Ref<string>` representing the active theme name.
42
+ * @param themes - A reactive `Ref<ThemeDefinition[]>` containing all available themes.
43
43
  *
44
- * @returns A `ThemeInstance` object containing:
45
- * - `name`: a reactive `Ref<string>` of the active theme name.
46
- * - `current`: a computed `Ref<ThemeDefinition>` of the active theme.
47
- * - `themes`: the array of all available theme definitions.
48
- * - `class`: a computed CSS class string for the active theme.
49
- * - `css`: a computed string of CSS variables for the active theme.
44
+ * @returns A `ThemeInstance` object with the following reactive properties:
45
+ * - `name`: the reactive `Ref<string>` of the active theme name.
46
+ * - `current`: a computed `Ref<ThemeDefinition>` of the active theme definition.
47
+ * - `themes`: the reactive `Ref<ThemeDefinition[]>` of all available themes.
48
+ * - `class`: a computed `Ref<string>` of the CSS class for the active theme.
49
+ * - `css`: a computed `Ref<string>` of the CSS variables for the active theme.
50
50
  *
51
- * @throws Will throw an error if no theme with the specified name exists in `themes`.
51
+ * @throws {Error} If no theme matching the active `name` exists in `themes`.
52
52
  */
53
- export declare function createThemeInstance(name: MaybeRefOrGetter<string>, themes: DeepReadonly<ThemeDefinition[]>): ThemeInstance;
53
+ export declare function createThemeInstance(name: Ref<string>, themes: DeepReadonly<Ref<ThemeDefinition[]>>): ThemeInstance;
54
54
  /**
55
55
  * Generates a CSS class name for a given theme.
56
56
  *
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAQ1E,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,gBAAgB,CAY/C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,UAoBtD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,QAM1D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,UAOvC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,gBAAgB,CAAC,MAAM,CAAC,EAC9B,MAAM,EAAE,YAAY,CAAC,eAAe,EAAE,CAAC,GACrC,aAAa,CAqBf;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,UAEzC"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAQ1E,eAAO,MAAM,aAAa,YAAY,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,YAAY,IAAI,gBAAgB,CAY/C;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,eAAe,UAoBtD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,EAAE,QAM1D;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,UAOvC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,mBAAmB,CAClC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EACjB,MAAM,EAAE,YAAY,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,GAC1C,aAAa,CAmBf;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,UAEzC"}
@@ -1,63 +1,63 @@
1
- import { ref as d, toValue as p, computed as c } from "vue";
2
- import { parseColor as $ } from "./color.js";
3
- import { toKebabCase as l } from "./string.js";
4
- const a = "q-theme";
5
- function g() {
1
+ import { computed as c } from "vue";
2
+ import { parseColor as d } from "./color.js";
3
+ import { toKebabCase as a } from "./string.js";
4
+ const m = "q-theme";
5
+ function h() {
6
6
  let e = document.getElementById(
7
- a
7
+ m
8
8
  );
9
- return e || (e = document.createElement("style"), e.id = a, document.head.appendChild(e)), e;
9
+ return e || (e = document.createElement("style"), e.id = m, document.head.appendChild(e)), e;
10
10
  }
11
11
  function i(e) {
12
- let t = `.${f(e.name)} {
12
+ let t = `.${l(e.name)} {
13
13
  `;
14
14
  const n = e.scheme;
15
15
  let o;
16
16
  for (o in n) {
17
- const r = n[o];
18
- if (r) {
19
- t += ` ${u(o)}: ${r};
17
+ const s = n[o];
18
+ if (s) {
19
+ t += ` ${u(o)}: ${s};
20
20
  `;
21
- const s = $(r);
22
- t += ` ${u(o)}-rgb: ${s.r} ${s.g} ${s.b};
21
+ const r = d(s);
22
+ t += ` ${u(o)}-rgb: ${r.r} ${r.g} ${r.b};
23
23
  `;
24
24
  }
25
25
  }
26
26
  return t += `}
27
27
  `, t;
28
28
  }
29
- function b(e) {
29
+ function C(e) {
30
30
  const t = e.map(i).join(`
31
- `), n = g();
31
+ `), n = h();
32
32
  n.textContent = t;
33
33
  }
34
34
  function u(e) {
35
- return e ? `--q-theme-${l(e)}` : "";
35
+ return e ? `--q-theme-${a(e)}` : "";
36
36
  }
37
- function v(e, t) {
38
- const n = d(p(e)), o = c(() => {
39
- const m = t.find((h) => h.name === n.value);
40
- if (!m)
41
- throw new Error(`Theme "${n.value}" not found`);
42
- return m;
43
- }), r = c(() => f(o.value.name)), s = c(() => i(o.value));
37
+ function T(e, t) {
38
+ const n = c(() => {
39
+ const r = t.value.find((f) => f.name === e.value);
40
+ if (!r)
41
+ throw new Error(`[Quidgest UI] Theme "${e.value}" not found`);
42
+ return r;
43
+ }), o = c(() => l(n.value.name)), s = c(() => i(n.value));
44
44
  return {
45
- name: n,
46
- current: o,
45
+ name: e,
46
+ current: n,
47
47
  themes: t,
48
- class: r,
48
+ class: o,
49
49
  css: s
50
50
  };
51
51
  }
52
- function f(e) {
53
- return `q-theme--${l(e)}`;
52
+ function l(e) {
53
+ return `q-theme--${a(e)}`;
54
54
  }
55
55
  export {
56
- a as THEME_NODE_ID,
57
- v as createThemeInstance,
58
- b as generateRootStyle,
56
+ m as THEME_NODE_ID,
57
+ T as createThemeInstance,
58
+ C as generateRootStyle,
59
59
  i as generateThemeCss,
60
- f as getThemeClass,
61
- g as getThemeNode,
60
+ l as getThemeClass,
61
+ h as getThemeNode,
62
62
  u as toProperty
63
63
  };
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.31",
4
+ "version": "0.16.32",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",