@quidgest/ui 0.16.24 → 0.16.26

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 (65) hide show
  1. package/dist/manifest/components.json +1 -0
  2. package/dist/ui.css +17 -0
  3. package/dist/ui.esm.js +2451 -2404
  4. package/dist/ui.js +18 -17
  5. package/dist/ui.min.css +1 -1
  6. package/dist/ui.min.js +739 -732
  7. package/dist/ui.scss +17 -1
  8. package/esm/components/QAccordion/QAccordionItem.vue.js +3 -3
  9. package/esm/components/QButtonGroup/QButtonGroup.d.ts.map +1 -1
  10. package/esm/components/QButtonGroup/QButtonGroup.vue.js +10 -8
  11. package/esm/components/QButtonGroup/types.d.ts +4 -0
  12. package/esm/components/QButtonGroup/types.d.ts.map +1 -1
  13. package/esm/components/QDefaultsProvider/QDefaultsProvider.d.ts +19 -0
  14. package/esm/components/QDefaultsProvider/QDefaultsProvider.d.ts.map +1 -0
  15. package/esm/components/QDefaultsProvider/QDefaultsProvider.vue.js +16 -0
  16. package/esm/components/QDefaultsProvider/QDefaultsProvider.vue2.js +4 -0
  17. package/esm/components/QDefaultsProvider/index.d.ts +19 -0
  18. package/esm/components/QDefaultsProvider/index.d.ts.map +1 -0
  19. package/esm/components/QDefaultsProvider/index.js +6 -0
  20. package/esm/components/QDefaultsProvider/types.d.ts +13 -0
  21. package/esm/components/QDefaultsProvider/types.d.ts.map +1 -0
  22. package/esm/components/QFileUpload/QFileUpload.vue.js +45 -45
  23. package/esm/components/QList/QListItem.d.ts.map +1 -1
  24. package/esm/components/QPasswordField/QPasswordField.d.ts +0 -1
  25. package/esm/components/QPasswordField/QPasswordField.d.ts.map +1 -1
  26. package/esm/components/QPasswordField/QPasswordField.vue.js +1 -1
  27. package/esm/components/QPasswordField/index.d.ts +0 -3
  28. package/esm/components/QPasswordField/index.d.ts.map +1 -1
  29. package/esm/components/QRadioGroup/QRadioButton.vue.js +12 -12
  30. package/esm/components/QRadioGroup/QRadioGroup.vue.js +11 -11
  31. package/esm/components/QTextArea/QTextArea.vue.js +10 -10
  32. package/esm/components/QTextField/QTextField.d.ts.map +1 -1
  33. package/esm/components/QTextField/QTextField.vue.js +15 -15
  34. package/esm/components/QThemeProvider/QThemeProvider.d.ts.map +1 -1
  35. package/esm/components/QThemeProvider/QThemeProvider.vue.js +29 -11
  36. package/esm/components/QThemeProvider/types.d.ts +2 -1
  37. package/esm/components/QThemeProvider/types.d.ts.map +1 -1
  38. package/esm/components/QToggleGroup/QToggleGroup.d.ts.map +1 -1
  39. package/esm/components/QToggleGroup/QToggleGroup.vue.js +13 -11
  40. package/esm/components/QToggleGroup/QToggleGroupItem.d.ts.map +1 -1
  41. package/esm/components/QToggleGroup/QToggleGroupItem.vue.js +10 -10
  42. package/esm/components/QToggleGroup/index.d.ts +3 -0
  43. package/esm/components/QToggleGroup/index.d.ts.map +1 -1
  44. package/esm/components/QTooltip/QTooltip.vue.js +23 -23
  45. package/esm/components/index.d.ts +1 -0
  46. package/esm/components/index.d.ts.map +1 -1
  47. package/esm/components/index.js +88 -86
  48. package/esm/composables/defaults.d.ts +2 -2
  49. package/esm/composables/defaults.d.ts.map +1 -1
  50. package/esm/composables/defaults.js +12 -12
  51. package/esm/composables/theme.d.ts +19 -8
  52. package/esm/composables/theme.d.ts.map +1 -1
  53. package/esm/composables/theme.js +15 -11
  54. package/esm/composables/uid.d.ts +2 -2
  55. package/esm/composables/uid.d.ts.map +1 -1
  56. package/esm/composables/uid.js +6 -5
  57. package/esm/composables/useDialog/index.d.ts.map +1 -1
  58. package/esm/composables/useDialog/index.js +11 -11
  59. package/esm/composables/useToast/index.js +6 -6
  60. package/esm/framework.js +45 -36
  61. package/esm/index.d.ts +1 -0
  62. package/esm/utils/theme.d.ts +27 -6
  63. package/esm/utils/theme.d.ts.map +1 -1
  64. package/esm/utils/theme.js +39 -37
  65. package/package.json +1 -1
@@ -4,44 +4,45 @@ import { QBadge as x } from "./QBadge/index.js";
4
4
  import { QBadgeIndicator as i } from "./QBadgeIndicator/index.js";
5
5
  import { QButton as l } from "./QButton/index.js";
6
6
  import { QButtonGroup as n } from "./QButtonGroup/index.js";
7
- import { QCard as s } from "./QCard/index.js";
7
+ import { QCard as c } from "./QCard/index.js";
8
8
  import { QCarousel as L } from "./QCarousel/index.js";
9
- import { QCheckbox as I, QCheckboxLabel as P } from "./QCheckbox/index.js";
9
+ import { QCheckbox as P, QCheckboxLabel as I } from "./QCheckbox/index.js";
10
10
  import { QCollapsible as b } from "./QCollapsible/index.js";
11
11
  import { QColorPicker as v } from "./QColorPicker/index.js";
12
- import { QCombobox as S } from "./QCombobox/index.js";
13
- import { QDateTimePicker as D } from "./QDateTimePicker/index.js";
14
- import { QDialog as k, QDialogProvider as w } from "./QDialog/index.js";
15
- import { QDismissibleLayer as h } from "./QDismissibleLayer/index.js";
16
- import { QDivider as R } from "./QDivider/index.js";
17
- import { QDropdownMenu as O } from "./QDropdownMenu/index.js";
18
- import { QField as j } from "./QField/index.js";
19
- import { QFileUpload as z } from "./QFileUpload/index.js";
20
- import { QFocusTrap as H } from "./QFocusTrap/index.js";
21
- import { QCol as K, QContainer as N, QRow as V, QSpacer as W } from "./QGrid/index.js";
22
- import { QIcon as Y, QIconFont as Z, QIconImg as _, QIconSvg as $ } from "./QIcon/index.js";
23
- import { QInputGroup as ro } from "./QInputGroup/index.js";
24
- import { QLabel as to } from "./QLabel/index.js";
25
- import { QLineLoader as Qo } from "./QLineLoader/index.js";
26
- import { QList as xo, QListItem as fo, QListItemGroup as io } from "./QList/index.js";
27
- import { QMeter as lo } from "./QMeter/index.js";
28
- import { QOverlay as co } from "./QOverlay/index.js";
29
- import { QPasswordField as uo } from "./QPasswordField/index.js";
30
- import { QPopover as go } from "./QPopover/index.js";
31
- import { QPropertyList as Po, QPropertyListGroup as To, QPropertyListPanel as bo, QPropertyListRow as Co } from "./QPropertyList/index.js";
32
- import { QRadioButton as Go, QRadioGroup as So } from "./QRadioGroup/index.js";
33
- import { QSelect as Do } from "./QSelect/index.js";
34
- import { QSidebar as ko } from "./QSidebar/index.js";
35
- import { QSkeletonLoader as Bo } from "./QSkeletonLoader/index.js";
36
- import { QSpinnerLoader as Ao } from "./QSpinnerLoader/index.js";
37
- import { QSwitch as Mo } from "./QSwitch/index.js";
38
- import { QTextArea as Uo } from "./QTextArea/index.js";
39
- import { QTextField as qo } from "./QTextField/index.js";
40
- import { QThemeProvider as Eo } from "./QThemeProvider/index.js";
41
- import { QToast as Jo, QToaster as Ko } from "./QToast/index.js";
42
- import { QToggle as Vo } from "./QToggle/index.js";
43
- import { QToggleGroup as Xo, QToggleGroupItem as Yo } from "./QToggleGroup/index.js";
44
- import { QTooltip as _o } from "./QTooltip/index.js";
12
+ import { QCombobox as G } from "./QCombobox/index.js";
13
+ import { QDateTimePicker as y } from "./QDateTimePicker/index.js";
14
+ import { QDefaultsProvider as k } from "./QDefaultsProvider/index.js";
15
+ import { QDialog as B, QDialogProvider as h } from "./QDialog/index.js";
16
+ import { QDismissibleLayer as R } from "./QDismissibleLayer/index.js";
17
+ import { QDivider as O } from "./QDivider/index.js";
18
+ import { QDropdownMenu as j } from "./QDropdownMenu/index.js";
19
+ import { QField as z } from "./QField/index.js";
20
+ import { QFileUpload as H } from "./QFileUpload/index.js";
21
+ import { QFocusTrap as K } from "./QFocusTrap/index.js";
22
+ import { QCol as V, QContainer as W, QRow as X, QSpacer as Y } from "./QGrid/index.js";
23
+ import { QIcon as _, QIconFont as $, QIconImg as oo, QIconSvg as ro } from "./QIcon/index.js";
24
+ import { QInputGroup as to } from "./QInputGroup/index.js";
25
+ import { QLabel as Qo } from "./QLabel/index.js";
26
+ import { QLineLoader as xo } from "./QLineLoader/index.js";
27
+ import { QList as io, QListItem as ao, QListItemGroup as lo } from "./QList/index.js";
28
+ import { QMeter as so } from "./QMeter/index.js";
29
+ import { QOverlay as uo } from "./QOverlay/index.js";
30
+ import { QPasswordField as go } from "./QPasswordField/index.js";
31
+ import { QPopover as Io } from "./QPopover/index.js";
32
+ import { QPropertyList as bo, QPropertyListGroup as Co, QPropertyListPanel as vo, QPropertyListRow as Do } from "./QPropertyList/index.js";
33
+ import { QRadioButton as So, QRadioGroup as yo } from "./QRadioGroup/index.js";
34
+ import { QSelect as ko } from "./QSelect/index.js";
35
+ import { QSidebar as Bo } from "./QSidebar/index.js";
36
+ import { QSkeletonLoader as Ao } from "./QSkeletonLoader/index.js";
37
+ import { QSpinnerLoader as Mo } from "./QSpinnerLoader/index.js";
38
+ import { QSwitch as Uo } from "./QSwitch/index.js";
39
+ import { QTextArea as qo } from "./QTextArea/index.js";
40
+ import { QTextField as Eo } from "./QTextField/index.js";
41
+ import { QThemeProvider as Jo } from "./QThemeProvider/index.js";
42
+ import { QToast as No, QToaster as Vo } from "./QToast/index.js";
43
+ import { QToggle as Xo } from "./QToggle/index.js";
44
+ import { QToggleGroup as Zo, QToggleGroupItem as _o } from "./QToggleGroup/index.js";
45
+ import { QTooltip as or } from "./QTooltip/index.js";
45
46
  export {
46
47
  e as QAccordion,
47
48
  t as QAccordionItem,
@@ -50,58 +51,59 @@ export {
50
51
  i as QBadgeIndicator,
51
52
  l as QButton,
52
53
  n as QButtonGroup,
53
- s as QCard,
54
+ c as QCard,
54
55
  L as QCarousel,
55
- I as QCheckbox,
56
- P as QCheckboxLabel,
57
- K as QCol,
56
+ P as QCheckbox,
57
+ I as QCheckboxLabel,
58
+ V as QCol,
58
59
  b as QCollapsible,
59
60
  v as QColorPicker,
60
- S as QCombobox,
61
- N as QContainer,
62
- D as QDateTimePicker,
63
- k as QDialog,
64
- w as QDialogProvider,
65
- h as QDismissibleLayer,
66
- R as QDivider,
67
- O as QDropdownMenu,
68
- j as QField,
69
- z as QFileUpload,
70
- H as QFocusTrap,
71
- Y as QIcon,
72
- Z as QIconFont,
73
- _ as QIconImg,
74
- $ as QIconSvg,
75
- ro as QInputGroup,
76
- to as QLabel,
77
- Qo as QLineLoader,
78
- xo as QList,
79
- fo as QListItem,
80
- io as QListItemGroup,
81
- lo as QMeter,
82
- co as QOverlay,
83
- uo as QPasswordField,
84
- go as QPopover,
85
- Po as QPropertyList,
86
- To as QPropertyListGroup,
87
- bo as QPropertyListPanel,
88
- Co as QPropertyListRow,
89
- Go as QRadioButton,
90
- So as QRadioGroup,
91
- V as QRow,
92
- Do as QSelect,
93
- ko as QSidebar,
94
- Bo as QSkeletonLoader,
95
- W as QSpacer,
96
- Ao as QSpinnerLoader,
97
- Mo as QSwitch,
98
- Uo as QTextArea,
99
- qo as QTextField,
100
- Eo as QThemeProvider,
101
- Jo as QToast,
102
- Ko as QToaster,
103
- Vo as QToggle,
104
- Xo as QToggleGroup,
105
- Yo as QToggleGroupItem,
106
- _o as QTooltip
61
+ G as QCombobox,
62
+ W as QContainer,
63
+ y as QDateTimePicker,
64
+ k as QDefaultsProvider,
65
+ B as QDialog,
66
+ h as QDialogProvider,
67
+ R as QDismissibleLayer,
68
+ O as QDivider,
69
+ j as QDropdownMenu,
70
+ z as QField,
71
+ H as QFileUpload,
72
+ K as QFocusTrap,
73
+ _ as QIcon,
74
+ $ as QIconFont,
75
+ oo as QIconImg,
76
+ ro as QIconSvg,
77
+ to as QInputGroup,
78
+ Qo as QLabel,
79
+ xo as QLineLoader,
80
+ io as QList,
81
+ ao as QListItem,
82
+ lo as QListItemGroup,
83
+ so as QMeter,
84
+ uo as QOverlay,
85
+ go as QPasswordField,
86
+ Io as QPopover,
87
+ bo as QPropertyList,
88
+ Co as QPropertyListGroup,
89
+ vo as QPropertyListPanel,
90
+ Do as QPropertyListRow,
91
+ So as QRadioButton,
92
+ yo as QRadioGroup,
93
+ X as QRow,
94
+ ko as QSelect,
95
+ Bo as QSidebar,
96
+ Ao as QSkeletonLoader,
97
+ Y as QSpacer,
98
+ Mo as QSpinnerLoader,
99
+ Uo as QSwitch,
100
+ qo as QTextArea,
101
+ Eo as QTextField,
102
+ Jo as QThemeProvider,
103
+ No as QToast,
104
+ Vo as QToaster,
105
+ Xo as QToggle,
106
+ Zo as QToggleGroup,
107
+ _o as QToggleGroupItem,
108
+ or as QTooltip
107
109
  };
@@ -1,4 +1,4 @@
1
- import { ComputedRef } from 'vue';
1
+ import { ComputedRef, MaybeRefOrGetter } from 'vue';
2
2
  export declare const DEFAULTS_SYMBOL = "q-defaults";
3
3
  export type Defaults = Record<string | symbol, ComponentDefaults>;
4
4
  export type ComponentDefaults = Record<string | symbol, unknown>;
@@ -10,7 +10,7 @@ export declare function useDefaults(): ComputedRef<ComponentDefaults | undefined
10
10
  *
11
11
  * @param defaults - The default values to be provided or updated.
12
12
  */
13
- export declare function provideDefaults(defaults: Defaults): void;
13
+ export declare function provideDefaults(defaults: MaybeRefOrGetter<Defaults>): void;
14
14
  /**
15
15
  * Function to inject default values using the Vue.js `inject` function.
16
16
  * It retrieves the default values from the specified symbol and ensures
@@ -1 +1 @@
1
- {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/composables/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAOtC,eAAO,MAAM,eAAe,eAAe,CAAA;AAE3C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,iBAAiB,CAAC,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhE,wBAAgB,WAAW,IAAI,WAAW,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAgBxE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAYxD;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAAC,QAAQ,CAAC,CAMtD"}
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../../src/composables/defaults.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,KAAK,CAAA;AAOxD,eAAO,MAAM,eAAe,eAAe,CAAA;AAE3C,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,iBAAiB,CAAC,CAAA;AAEjE,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAA;AAEhE,wBAAgB,WAAW,IAAI,WAAW,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAgBxE;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,CAAC,GAAG,IAAI,CAY1E;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,IAAI,WAAW,CAAC,QAAQ,CAAC,CAMtD"}
@@ -1,30 +1,30 @@
1
- import { getCurrentInstance as d, computed as f, ref as m, provide as p, inject as v } from "vue";
1
+ import { getCurrentInstance as d, computed as a, ref as m, toValue as p, provide as v, inject as D } from "vue";
2
2
  import { isEmpty as s } from "../utils/isEmpty.js";
3
- import { merge as a } from "../utils/merge.js";
3
+ import { merge as f } from "../utils/merge.js";
4
4
  const i = "q-defaults";
5
- function E() {
6
- var r, u;
5
+ function I() {
6
+ var u, r;
7
7
  const e = d();
8
8
  if (!e)
9
9
  throw new Error("[Quidgest UI] useDefaults must be called from inside a setup function");
10
10
  const t = e.type.name ?? e.type.__name;
11
11
  if (!t) throw new Error("[Quidgest UI] Could not determine component name");
12
- const n = l(), o = (r = n.value) == null ? void 0 : r.Global, c = (u = n.value) == null ? void 0 : u[t];
13
- return f(() => a(o, c));
12
+ const n = l(), o = (u = n.value) == null ? void 0 : u.Global, c = (r = n.value) == null ? void 0 : r[t];
13
+ return a(() => f(o, c));
14
14
  }
15
- function I(e) {
15
+ function U(e) {
16
16
  if (s(e)) return;
17
- const t = l(), n = m(e), o = f(() => s(n.value) ? t.value : a(t.value, n.value));
18
- p(i, o);
17
+ const t = l(), n = m(p(e)), o = a(() => s(n.value) ? t.value : f(t.value, n.value));
18
+ v(i, o);
19
19
  }
20
20
  function l() {
21
- const e = v(i, void 0);
21
+ const e = D(i, void 0);
22
22
  if (!e) throw new Error("[Quidgest UI] Could not find defaults instance");
23
23
  return e;
24
24
  }
25
25
  export {
26
26
  i as DEFAULTS_SYMBOL,
27
27
  l as injectDefaults,
28
- I as provideDefaults,
29
- E as useDefaults
28
+ U as provideDefaults,
29
+ I as useDefaults
30
30
  };
@@ -1,4 +1,4 @@
1
- import { ComputedRef, DeepReadonly, InjectionKey, Ref } from 'vue';
1
+ import { ComputedRef, DeepReadonly, InjectionKey, MaybeRefOrGetter, Ref } from 'vue';
2
2
  import { ColorScheme } from '../utils/color';
3
3
  export declare const ThemeSymbol: InjectionKey<ThemeInstance>;
4
4
  /**
@@ -44,8 +44,10 @@ export type ThemeInstance = {
44
44
  readonly current: DeepReadonly<ComputedRef<ThemeDefinition>>;
45
45
  /** An array of available theme definitions. */
46
46
  readonly themes: DeepReadonly<ThemeDefinition[]>;
47
- /** The theme class. */
47
+ /** The theme class name. */
48
48
  readonly class: ComputedRef<string>;
49
+ /** The theme CSS definition. */
50
+ readonly css: ComputedRef<string | undefined>;
49
51
  };
50
52
  /**
51
53
  * Custom hook for accessing the theme configuration in context.
@@ -54,14 +56,23 @@ export type ThemeInstance = {
54
56
  */
55
57
  export declare function useTheme(): ThemeInstance;
56
58
  /**
57
- * Provides and manages a theme instance based on the specified theme name.
59
+ * Provides and manages a reactive theme instance within the Vue dependency injection system.
58
60
  *
59
- * This function retrieves the available themes from the current theme context,
60
- * creates a new theme instance, and provides it to the Vue dependency injection system.
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
65
  *
62
- * @param name - A reactive reference (`Ref<string>`) representing the name of the theme to activate.
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.
63
69
  *
64
- * @returns The newly created and provided `ThemeInstance`.
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.
65
76
  */
66
- export declare function provideTheme(name: Ref<string>): ThemeInstance;
77
+ export declare function provideTheme(nameOrDef: MaybeRefOrGetter<string | ThemeDefinition>): ThemeInstance;
67
78
  //# 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,GAAG,EAAE,MAAM,KAAK,CAAA;AACvE,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;I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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,18 +1,22 @@
1
- import { provide as r, inject as c } from "vue";
2
- import { createThemeInstance as h } from "../utils/theme.js";
3
- const n = Symbol.for("q-theme");
4
- function s() {
5
- const e = c(n);
1
+ import { toValue as c, provide as i, inject as h } from "vue";
2
+ import { createThemeInstance as u } from "../utils/theme.js";
3
+ const m = Symbol.for("q-theme");
4
+ function f() {
5
+ const e = h(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 u(e) {
11
- const o = s(), m = o.themes, t = h(e, m);
12
- return r(n, t), t;
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;
13
17
  }
14
18
  export {
15
- n as ThemeSymbol,
16
- u as provideTheme,
17
- s as useTheme
19
+ m as ThemeSymbol,
20
+ d as provideTheme,
21
+ f as useTheme
18
22
  };
@@ -1,9 +1,9 @@
1
- import { MaybeRef, Ref } from 'vue';
1
+ import { MaybeRefOrGetter, Ref } from 'vue';
2
2
  /**
3
3
  * Custom hook to generate unique IDs.
4
4
  *
5
5
  * @param [componentId] - Optional component-specific ID.
6
6
  * @returns A unique ID as a string or a ref containing a string
7
7
  */
8
- export declare function useId<T extends MaybeRef<string | undefined>>(componentId?: T): T extends Ref<string | undefined> ? Ref<string> : string;
8
+ export declare function useId(componentId?: MaybeRefOrGetter<string | undefined>): Ref<string>;
9
9
  //# sourceMappingURL=uid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../src/composables/uid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAQxC;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,CAAC,SAAS,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,EAC3D,WAAW,CAAC,EAAE,CAAC,GACb,CAAC,SAAS,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAK1D"}
1
+ {"version":3,"file":"uid.d.ts","sourceRoot":"","sources":["../../src/composables/uid.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,GAAG,EAAE,MAAM,KAAK,CAAA;AAQhD;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,CAGrF"}
@@ -1,8 +1,9 @@
1
- import { unref as r } from "vue";
2
- let o = 0;
3
- function n(e) {
4
- return r(e) || `uid-${++o}`;
1
+ import { toValue as r, ref as t } from "vue";
2
+ let u = 0;
3
+ function d(e) {
4
+ const o = r(e);
5
+ return t(o || `uid-${++u}`);
5
6
  }
6
7
  export {
7
- n as useId
8
+ d as useId
8
9
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AASrF;;;;GAIG;AACH,wBAAgB,SAAS;uBASE,YAAY,OAAO,MAAM,YAAY,cAAc;uBAgBnD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAasC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EADvE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;AASrF;;;;GAIG;AACH,wBAAgB,SAAS;uBASE,YAAY,OAAO,MAAM,YAAY,cAAc;uBAgBnD,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAagC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EADjE"}
@@ -1,21 +1,21 @@
1
- import { reactive as a } from "vue";
1
+ import { reactive as s } from "vue";
2
2
  import { useId as r } from "../uid.js";
3
- const o = a({ dialogs: [] });
4
- function g() {
5
- function e(d, i, n) {
6
- const t = r(i);
7
- return o.dialogs.push({ id: t, props: d, options: n }), t;
3
+ const o = s({ dialogs: [] });
4
+ function c() {
5
+ function t(d, i, e) {
6
+ const n = r(i).value;
7
+ return o.dialogs.push({ id: n, props: d, options: e }), n;
8
8
  }
9
- function s(d) {
10
- const i = o.dialogs.findIndex((n) => n.id === d);
9
+ function a(d) {
10
+ const i = o.dialogs.findIndex((e) => e.id === d);
11
11
  i !== -1 && o.dialogs.splice(i, 1);
12
12
  }
13
13
  return {
14
14
  ...o,
15
- addDialog: e,
16
- removeDialog: s
15
+ addDialog: t,
16
+ removeDialog: a
17
17
  };
18
18
  }
19
19
  export {
20
- g as useDialog
20
+ c as useDialog
21
21
  };
@@ -1,10 +1,10 @@
1
1
  import { ToastSymbol as a } from "./types.js";
2
- import { inject as i, ref as u } from "vue";
2
+ import { inject as u, ref as i } from "vue";
3
3
  import { useId as c } from "../uid.js";
4
4
  function p() {
5
5
  const { toasts: t } = f();
6
6
  function s(n, o) {
7
- const e = c(o);
7
+ const e = c(o).value;
8
8
  return t.value.push({ id: e, props: n }), e;
9
9
  }
10
10
  function r(n) {
@@ -17,19 +17,19 @@ function p() {
17
17
  removeToast: r
18
18
  };
19
19
  }
20
- function I() {
20
+ function l() {
21
21
  return {
22
- toasts: u([])
22
+ toasts: i([])
23
23
  };
24
24
  }
25
25
  function f() {
26
- const t = i(a);
26
+ const t = u(a);
27
27
  if (!t)
28
28
  throw new Error("useInjectedToast must be used after provideToast");
29
29
  return t;
30
30
  }
31
31
  export {
32
- I as createToastInstance,
32
+ l as createToastInstance,
33
33
  f as injectToastInstance,
34
34
  p as useToast
35
35
  };
package/esm/framework.js CHANGED
@@ -1,54 +1,63 @@
1
- import { DEFAULTS_SYMBOL as i } from "./composables/defaults.js";
2
- import { ThemeSymbol as c } from "./composables/theme.js";
1
+ import { DEFAULTS_SYMBOL as c } from "./composables/defaults.js";
2
+ import { ThemeSymbol as h } from "./composables/theme.js";
3
3
  import { DismissibleLayerKey as f } from "./symbols/dismissibleLayer.js";
4
- import { ToastSymbol as h } from "./composables/useToast/types.js";
5
- import { useDismissibleLayerStack as d } from "./composables/useDismissibleLayerStack/index.js";
6
- import { createToastInstance as u } from "./composables/useToast/index.js";
7
- import { defaultLightColorScheme as r, defaultDarkColorScheme as p } from "./templates/theme.js";
8
- import { ref as l, watch as S } from "vue";
9
- import { createThemeInstance as L, generateRootStyle as T } from "./utils/theme.js";
10
- function N(m = {}) {
4
+ import { ToastSymbol as d } from "./composables/useToast/types.js";
5
+ import { useDismissibleLayerStack as u } from "./composables/useDismissibleLayerStack/index.js";
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 i, watch as S } from "vue";
9
+ import { createThemeInstance as T, generateRootStyle as L } from "./utils/theme.js";
10
+ function F(s = {}) {
11
11
  return { install: (t) => {
12
- const s = m.components || {};
13
- for (const a in s)
14
- t.component(a, s[a]);
15
- const e = m.defaults || {};
16
- t.provide(i, l(e)), y(t, m.themes);
17
- const n = d();
12
+ const m = s.components || {};
13
+ for (const a in m)
14
+ t.component(a, m[a]);
15
+ const e = s.defaults || {};
16
+ t.provide(c, i(e)), y(t, s.themes);
17
+ const n = u();
18
18
  t.provide(f, n), b(t);
19
19
  } };
20
20
  }
21
- function y(m, o) {
21
+ function y(s, o) {
22
22
  const t = [];
23
- let s;
24
- if (!o)
25
- s = "default", t.push({
26
- name: s,
27
- mode: "light",
28
- scheme: r
29
- });
30
- else
23
+ let m;
24
+ if (o)
31
25
  for (const e of o.themes) {
32
- const a = { ...e.mode === "light" ? r : p, ...e.colors };
26
+ const a = { ...e.mode === "light" ? r : l, ...e.colors };
33
27
  t.push({
34
28
  name: e.name,
35
29
  mode: e.mode,
36
30
  scheme: a
37
- }), e.name === o.defaultTheme && (s = e.name);
31
+ }), e.name === o.defaultTheme && (m = e.name);
38
32
  }
39
- if (s) {
40
- const e = l(s), n = L(e, t);
41
- T(t), S(n.name, C, { immediate: !0 }), m.provide(c, n);
33
+ else {
34
+ const e = [
35
+ {
36
+ name: "light",
37
+ mode: "light",
38
+ scheme: r
39
+ },
40
+ {
41
+ name: "dark",
42
+ mode: "dark",
43
+ scheme: l
44
+ }
45
+ ];
46
+ t.push(...e), m = "light";
47
+ }
48
+ if (m) {
49
+ const e = i(m), n = T(e, t);
50
+ L(t), S(n.name, k, { immediate: !0 }), s.provide(h, n);
42
51
  }
43
52
  }
44
- function b(m) {
45
- const o = u();
46
- m.provide(h, o);
53
+ function b(s) {
54
+ const o = p();
55
+ s.provide(d, o);
47
56
  }
48
- function C(m) {
49
- const o = document.documentElement, s = Array.from(o.classList).filter((e) => !e.startsWith("q-theme"));
50
- o.className = s.join(" "), o.classList.add(`q-theme--${m}`);
57
+ function k(s) {
58
+ const o = document.documentElement, m = Array.from(o.classList).filter((e) => !e.startsWith("q-theme"));
59
+ o.className = m.join(" "), o.classList.add(`q-theme--${s}`);
51
60
  }
52
61
  export {
53
- N as createFramework
62
+ F as createFramework
54
63
  };
package/esm/index.d.ts CHANGED
@@ -22,6 +22,7 @@ declare module '@vue/runtime-core' {
22
22
  QColorPicker: typeof import('@quidgest/ui/components')['QColorPicker']
23
23
  QCombobox: typeof import('@quidgest/ui/components')['QCombobox']
24
24
  QDateTimePicker: typeof import('@quidgest/ui/components')['QDateTimePicker']
25
+ QDefaultsProvider: typeof import('@quidgest/ui/components')['QDefaultsProvider']
25
26
  QDialog: typeof import('@quidgest/ui/components')['QDialog']
26
27
  QDialogProvider: typeof import('@quidgest/ui/components')['QDialogProvider']
27
28
  QDismissibleLayer: typeof import('@quidgest/ui/components')['QDismissibleLayer']
@@ -1,4 +1,4 @@
1
- import { DeepReadonly, Ref } from 'vue';
1
+ import { DeepReadonly, MaybeRefOrGetter } from 'vue';
2
2
  import { ThemeDefinition, ThemeInstance } from '../composables/theme';
3
3
  export declare const THEME_NODE_ID = "q-theme";
4
4
  /**
@@ -7,6 +7,18 @@ export declare const THEME_NODE_ID = "q-theme";
7
7
  * @returns The style node used for dynamic themes.
8
8
  */
9
9
  export declare function getThemeNode(): HTMLStyleElement;
10
+ /**
11
+ * Generates a CSS class definition for a given theme.
12
+ *
13
+ * This function creates a CSS block scoped to the theme’s class
14
+ * (e.g., `.q-theme--light`), where each color in the theme’s color
15
+ * scheme is exposed as both a HEX and an RGB CSS custom property.
16
+ *
17
+ * @param theme - The `ThemeDefinition` containing the name and color scheme.
18
+ *
19
+ * @returns A string of CSS text defining the theme’s variables.
20
+ */
21
+ export declare function generateThemeCss(theme: ThemeDefinition): string;
10
22
  /**
11
23
  * Generates and applies dynamic root-level styles based on the provided themes.
12
24
  *
@@ -21,13 +33,22 @@ export declare function generateRootStyle(themes: ThemeDefinition[]): void;
21
33
  */
22
34
  export declare function toProperty(color: string): string;
23
35
  /**
24
- * Creates a theme instance that allows reactive access to a specific theme.
36
+ * Creates a reactive theme instance for a given theme name.
37
+ *
38
+ * This provides reactive access to the currently active theme and
39
+ * computed properties for applying its CSS class and CSS variables.
25
40
  *
26
- * @param name - The name of the theme to use.
41
+ * @param name - The name of the theme to activate, or a getter/ref returning a string.
27
42
  * @param themes - A readonly array of available theme definitions.
28
- * @returns A ThemeInstance object containing the current theme and metadata.
29
43
  *
30
- * @throws Will throw an error if the specified theme name is not found.
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.
50
+ *
51
+ * @throws Will throw an error if no theme with the specified name exists in `themes`.
31
52
  */
32
- export declare function createThemeInstance(name: Ref<string>, themes: DeepReadonly<ThemeDefinition[]>): ThemeInstance;
53
+ export declare function createThemeInstance(name: MaybeRefOrGetter<string>, themes: DeepReadonly<ThemeDefinition[]>): ThemeInstance;
33
54
  //# sourceMappingURL=theme.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/utils/theme.ts"],"names":[],"mappings":"AACA,OAAO,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