@quidgest/ui 0.16.31 → 0.16.33

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.
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAIuwzB,GAAG,8CAA8C,GAAG,yBAAyB,GAA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C,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;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;;;CAIQ,CAAA;AAGlC,eAAO,MAAM,aAAa;;;;;;;CAGM,CAAA"}
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,QAAQ,CAAC,EAAE,OAAO,CAAA;IAElB;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAEhB;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,CAAA;IAEjB;;;;;OAKG;IAEH,UAAU,CAAC,EAAE,GAAG,CAAA;IAEhB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;IAE5B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA;AAGD,eAAO,MAAM,aAAa;;;;CAIQ,CAAA;AAGlC,eAAO,MAAM,aAAa;;;;;;;CAGM,CAAA"}
@@ -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,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AM,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,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AAM,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.33",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",