@quidgest/ui 0.20.0 → 0.21.0

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 (145) hide show
  1. package/CHANGELOG.md +28 -1
  2. package/README.md +10 -0
  3. package/dist/json/api.json +312 -14
  4. package/dist/manifest/components.json +1 -0
  5. package/dist/ui.css +245 -248
  6. package/dist/ui.esm.js +805 -683
  7. package/dist/ui.js +1083 -961
  8. package/dist/ui.min.css +1 -1
  9. package/dist/ui.min.js +1083 -961
  10. package/dist/ui.scss +535 -299
  11. package/esm/components/QAccordion/QAccordionItem.vue.js +1 -1
  12. package/esm/components/QBadge/QBadge.d.ts.map +1 -1
  13. package/esm/components/QBadge/QBadge.vue.js +20 -24
  14. package/esm/components/QButton/QButton.d.ts.map +1 -1
  15. package/esm/components/QButton/QButton.vue.js +32 -29
  16. package/esm/components/QCheckbox/QCheckbox.vue.js +1 -1
  17. package/esm/components/QDialog/QDialog.d.ts +4 -2
  18. package/esm/components/QDialog/QDialog.d.ts.map +1 -1
  19. package/esm/components/QDialog/QDialog.vue.js +84 -74
  20. package/esm/components/QDialog/QDialogProvider.d.ts.map +1 -1
  21. package/esm/components/QDialog/QDialogProvider.vue.js +21 -12
  22. package/esm/components/QDialog/index.d.ts +72 -3
  23. package/esm/components/QDialog/index.d.ts.map +1 -1
  24. package/esm/components/QDialog/types.d.ts +10 -1
  25. package/esm/components/QDialog/types.d.ts.map +1 -1
  26. package/esm/components/QDismissibleLayer/QDismissibleLayer.d.ts.map +1 -1
  27. package/esm/components/QDismissibleLayer/QDismissibleLayer.vue.js +9 -8
  28. package/esm/components/QDivider/QDivider.d.ts.map +1 -1
  29. package/esm/components/QDivider/QDivider.vue.js +3 -3
  30. package/esm/components/QFileUpload/QFileUpload.vue.js +1 -1
  31. package/esm/components/QGauge/QGauge.d.ts +56 -0
  32. package/esm/components/QGauge/QGauge.d.ts.map +1 -0
  33. package/esm/components/QGauge/QGauge.vue.js +305 -0
  34. package/esm/components/QGauge/QGauge2.vue.js +5 -0
  35. package/esm/components/QGauge/constants.d.ts +6 -0
  36. package/esm/components/QGauge/constants.d.ts.map +1 -0
  37. package/esm/components/QGauge/constants.js +8 -0
  38. package/esm/components/QGauge/index.d.ts +124 -0
  39. package/esm/components/QGauge/index.d.ts.map +1 -0
  40. package/esm/components/QGauge/index.js +6 -0
  41. package/esm/components/QGauge/types.d.ts +146 -0
  42. package/esm/components/QGauge/types.d.ts.map +1 -0
  43. package/esm/components/QList/QListItem.d.ts.map +1 -1
  44. package/esm/components/QList/QListItem.vue.js +5 -2
  45. package/esm/components/QList/QListItemGroup.vue.js +1 -1
  46. package/esm/components/QObfuscation/QObfuscation.vue.js +1 -1
  47. package/esm/components/QPhoneField/QPhoneField.d.ts.map +1 -1
  48. package/esm/components/QPhoneField/QPhoneField.vue.js +1 -1
  49. package/esm/components/QPropertyList/QPropertyListGroup.vue.js +1 -1
  50. package/esm/components/QPropertyList/QPropertyListRow.vue.js +1 -1
  51. package/esm/components/QPropertyList/index.d.ts.map +1 -1
  52. package/esm/components/QRadioGroup/QRadioButton.vue.js +1 -1
  53. package/esm/components/QRadioGroup/QRadioGroup.vue.js +2 -2
  54. package/esm/components/QSelect/QSelect.d.ts.map +1 -1
  55. package/esm/components/QSelect/QSelect.vue.js +1 -1
  56. package/esm/components/QSidebar/QSidebar.d.ts.map +1 -1
  57. package/esm/components/QSidebar/QSidebar.vue.js +19 -10
  58. package/esm/components/QSidebar/QSidebarItem.d.ts.map +1 -1
  59. package/esm/components/QSidebar/QSidebarItem.vue.js +51 -49
  60. package/esm/components/QSidebar/context.d.ts +7 -0
  61. package/esm/components/QSidebar/context.d.ts.map +1 -1
  62. package/esm/components/QSwitch/QSwitch.vue.js +1 -1
  63. package/esm/components/QTabs/QTab.d.ts.map +1 -1
  64. package/esm/components/QTabs/QTab.vue.js +52 -50
  65. package/esm/components/QTabs/QTabs.d.ts.map +1 -1
  66. package/esm/components/QTabs/QTabs.vue.js +37 -12
  67. package/esm/components/QTabs/context.d.ts +7 -0
  68. package/esm/components/QTabs/context.d.ts.map +1 -1
  69. package/esm/components/QTextArea/QTextArea.vue.js +1 -1
  70. package/esm/components/QTextField/QTextField.d.ts.map +1 -1
  71. package/esm/components/QTextField/QTextField.vue.js +1 -1
  72. package/esm/components/QThemeProvider/QThemeProvider.vue.js +1 -1
  73. package/esm/components/QToast/QToast.d.ts +4 -2
  74. package/esm/components/QToast/QToast.d.ts.map +1 -1
  75. package/esm/components/QToast/QToast.vue.js +80 -67
  76. package/esm/components/QToast/QToaster.d.ts.map +1 -1
  77. package/esm/components/QToast/QToaster.vue.js +21 -16
  78. package/esm/components/QToast/index.d.ts +39 -3
  79. package/esm/components/QToast/index.d.ts.map +1 -1
  80. package/esm/components/QToast/types.d.ts +6 -2
  81. package/esm/components/QToast/types.d.ts.map +1 -1
  82. package/esm/components/QToggleGroup/QToggleGroupItem.vue.js +1 -1
  83. package/esm/components/QTooltip/QTooltip.vue.js +1 -1
  84. package/esm/components/index.d.ts +1 -0
  85. package/esm/components/index.d.ts.map +1 -1
  86. package/esm/components/index.js +64 -62
  87. package/esm/composables/index.d.ts +2 -2
  88. package/esm/composables/index.d.ts.map +1 -1
  89. package/esm/composables/useColor/index.d.ts +49 -12
  90. package/esm/composables/useColor/index.d.ts.map +1 -1
  91. package/esm/composables/useColor/index.js +56 -30
  92. package/esm/composables/useColor/types.d.ts +4 -1
  93. package/esm/composables/useColor/types.d.ts.map +1 -1
  94. package/esm/composables/useDialog/_internal.d.ts +2 -0
  95. package/esm/composables/useDialog/_internal.d.ts.map +1 -0
  96. package/esm/composables/useDialog/_internal.js +65 -0
  97. package/esm/composables/useDialog/index.d.ts +11 -3
  98. package/esm/composables/useDialog/index.d.ts.map +1 -1
  99. package/esm/composables/useDialog/index.js +38 -22
  100. package/esm/composables/useDialog/types.d.ts +25 -11
  101. package/esm/composables/useDialog/types.d.ts.map +1 -1
  102. package/esm/composables/useDismissibleLayerStack/index.d.ts +17 -2
  103. package/esm/composables/useDismissibleLayerStack/index.d.ts.map +1 -1
  104. package/esm/composables/useDismissibleLayerStack/index.js +28 -11
  105. package/esm/composables/useGroup/index.d.ts.map +1 -1
  106. package/esm/composables/useGroup/index.js +12 -1
  107. package/esm/composables/useId/index.d.ts +18 -0
  108. package/esm/composables/useId/index.d.ts.map +1 -0
  109. package/esm/composables/useId/index.js +10 -0
  110. package/esm/composables/useToast/_internal.d.ts +2 -0
  111. package/esm/composables/useToast/_internal.d.ts.map +1 -0
  112. package/esm/composables/useToast/_internal.js +142 -0
  113. package/esm/composables/useToast/index.d.ts +8 -25
  114. package/esm/composables/useToast/index.d.ts.map +1 -1
  115. package/esm/composables/useToast/index.js +29 -26
  116. package/esm/composables/useToast/types.d.ts +31 -17
  117. package/esm/composables/useToast/types.d.ts.map +1 -1
  118. package/esm/framework.d.ts.map +1 -1
  119. package/esm/framework.js +16 -12
  120. package/esm/index.d.ts +1 -0
  121. package/esm/templates/theme.js +39 -39
  122. package/esm/utils/color/contrast.d.ts +11 -4
  123. package/esm/utils/color/contrast.d.ts.map +1 -1
  124. package/esm/utils/color/contrast.js +16 -3
  125. package/esm/utils/color/index.d.ts +1 -0
  126. package/esm/utils/color/index.d.ts.map +1 -1
  127. package/esm/utils/color/merge.d.ts +9 -0
  128. package/esm/utils/color/merge.d.ts.map +1 -1
  129. package/esm/utils/color/merge.js +21 -22
  130. package/esm/utils/color/parse.d.ts +21 -5
  131. package/esm/utils/color/parse.d.ts.map +1 -1
  132. package/esm/utils/color/parse.js +88 -20
  133. package/esm/utils/color/theme-colors.d.ts +35 -0
  134. package/esm/utils/color/theme-colors.d.ts.map +1 -0
  135. package/esm/utils/color/theme-colors.js +25 -0
  136. package/esm/utils/index.js +50 -42
  137. package/package.json +3 -5
  138. package/esm/composables/uid.d.ts +0 -9
  139. package/esm/composables/uid.d.ts.map +0 -1
  140. package/esm/composables/uid.js +0 -8
  141. package/esm/composables/useToast/types.js +0 -4
  142. package/esm/vendors/uuid/dist/native.js +0 -3
  143. package/esm/vendors/uuid/dist/rng.js +0 -11
  144. package/esm/vendors/uuid/dist/stringify.js +0 -8
  145. package/esm/vendors/uuid/dist/v4.js +0 -20
@@ -1,5 +1,16 @@
1
1
  declare const QToast: {
2
- new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('./types').QToastProps> & Readonly<{
2
+ new (...args: any[]): import('vue').CreateComponentPublicInstanceWithMixins<Readonly<import('../../types/component').QBaseComponentProps & {
3
+ title?: string;
4
+ text?: string;
5
+ block?: boolean;
6
+ color?: string;
7
+ elevation?: import('..').QCardElevation;
8
+ variant?: import('./types').QToastVariant;
9
+ timeout?: number;
10
+ icons?: typeof import('./constants').DEFAULT_ICONS;
11
+ } & {
12
+ entryKey?: string;
13
+ }> & Readonly<{
3
14
  onDismiss?: (() => any) | undefined;
4
15
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
5
16
  dismiss: () => any;
@@ -8,6 +19,7 @@ declare const QToast: {
8
19
  color: string;
9
20
  elevation: import('..').QCardElevation;
10
21
  icons: typeof import('./constants').DEFAULT_ICONS;
22
+ entryKey: string;
11
23
  timeout: number;
12
24
  }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
13
25
  P: {};
@@ -16,19 +28,42 @@ declare const QToast: {
16
28
  C: {};
17
29
  M: {};
18
30
  Defaults: {};
19
- }, Readonly<import('./types').QToastProps> & Readonly<{
31
+ }, Readonly<import('../../types/component').QBaseComponentProps & {
32
+ title?: string;
33
+ text?: string;
34
+ block?: boolean;
35
+ color?: string;
36
+ elevation?: import('..').QCardElevation;
37
+ variant?: import('./types').QToastVariant;
38
+ timeout?: number;
39
+ icons?: typeof import('./constants').DEFAULT_ICONS;
40
+ } & {
41
+ entryKey?: string;
42
+ }> & Readonly<{
20
43
  onDismiss?: (() => any) | undefined;
21
44
  }>, {}, {}, {}, {}, {
22
45
  variant: import('./types').QToastVariant;
23
46
  color: string;
24
47
  elevation: import('..').QCardElevation;
25
48
  icons: typeof import('./constants').DEFAULT_ICONS;
49
+ entryKey: string;
26
50
  timeout: number;
27
51
  }>;
28
52
  __isFragment?: never;
29
53
  __isTeleport?: never;
30
54
  __isSuspense?: never;
31
- } & import('vue').ComponentOptionsBase<Readonly<import('./types').QToastProps> & Readonly<{
55
+ } & import('vue').ComponentOptionsBase<Readonly<import('../../types/component').QBaseComponentProps & {
56
+ title?: string;
57
+ text?: string;
58
+ block?: boolean;
59
+ color?: string;
60
+ elevation?: import('..').QCardElevation;
61
+ variant?: import('./types').QToastVariant;
62
+ timeout?: number;
63
+ icons?: typeof import('./constants').DEFAULT_ICONS;
64
+ } & {
65
+ entryKey?: string;
66
+ }> & Readonly<{
32
67
  onDismiss?: (() => any) | undefined;
33
68
  }>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
34
69
  dismiss: () => any;
@@ -37,6 +72,7 @@ declare const QToast: {
37
72
  color: string;
38
73
  elevation: import('..').QCardElevation;
39
74
  icons: typeof import('./constants').DEFAULT_ICONS;
75
+ entryKey: string;
40
76
  timeout: number;
41
77
  }, {}, string, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, import('vue').ComponentProvideOptions> & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps & (new () => {
42
78
  $slots: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QToast/index.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2B,CAAA;AACvC,QAAA,MAAM,QAAQ;;6EAA6B,CAAA;AAG3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;AAG3B,cAAc,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/QToast/index.ts"],"names":[],"mappings":"AAOA,QAAA,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2B,CAAA;AACvC,QAAA,MAAM,QAAQ;;6EAA6B,CAAA;AAG3C,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;AAG3B,cAAc,SAAS,CAAA"}
@@ -3,7 +3,11 @@ import { QCardElevation } from '../QCard/types';
3
3
  import { DEFAULT_ICONS } from './constants';
4
4
  export type QToastVariant = 'bold' | 'tonal' | 'outlined';
5
5
  /**
6
- * Props for the QToaster component.
6
+ * Hosts programmatic toasts created with `useToast`.
7
+ *
8
+ * Mount exactly one `QToaster` per app (typically in the root layout).
9
+ * The toast store is app-scoped via `createFramework`; mounting a second
10
+ * toaster for the same app throws.
7
11
  */
8
12
  export type QToasterProps = QBaseComponentProps & {
9
13
  /**
@@ -14,7 +18,7 @@ export type QToasterProps = QBaseComponentProps & {
14
18
  placement?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'top-center' | 'bottom-center';
15
19
  /**
16
20
  * Maximum number of toasts displayed at once.
17
- * Additional toasts will be queued.
21
+ * Additional toasts wait in a queue (unmounted); `addToast` stays pending until a slot opens and the toast registers during setup.
18
22
  *
19
23
  * @category Behavior
20
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QToast/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAA;AAEzD;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IACjD;;;;OAIG;IACH,SAAS,CAAC,EACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,CAAA;IAElB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG;IAC/C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAA;IAE1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAA;IAEvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/QToast/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,OAAO,GAAG,UAAU,CAAA;AAEzD;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,mBAAmB,GAAG;IACjD;;;;OAIG;IACH,SAAS,CAAC,EACP,UAAU,GACV,WAAW,GACX,aAAa,GACb,cAAc,GACd,YAAY,GACZ,eAAe,CAAA;IAElB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAElB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAA;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG;IAC/C;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;IAEb;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAA;IAEf;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,MAAM,CAAA;IAEd;;;;OAIG;IACH,SAAS,CAAC,EAAE,cAAc,CAAA;IAE1B;;;;OAIG;IACH,OAAO,CAAC,EAAE,aAAa,CAAA;IAEvB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,aAAa,CAAA;CAC5B,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { useGroupItem as e } from "../../composables/useGroup/index.js";
2
- import { useId as t } from "../../composables/uid.js";
2
+ import { useId as t } from "../../composables/useId/index.js";
3
3
  import { QToggle as n } from "../QToggle/index.js";
4
4
  import { createBlock as r, defineComponent as i, mergeProps as a, openBlock as o, renderSlot as s, toRef as c, unref as l, withCtx as u } from "vue";
5
5
  //#region src/components/QToggleGroup/QToggleGroupItem.vue?vue&type=script&setup=true&lang.ts
@@ -1,5 +1,5 @@
1
1
  import { QIcon as e } from "../QIcon/index.js";
2
- import { useId as t } from "../../composables/uid.js";
2
+ import { useId as t } from "../../composables/useId/index.js";
3
3
  import { getElement as n } from "../../utils/getElement.js";
4
4
  import { QOverlay as r } from "../QOverlay/index.js";
5
5
  import { Fragment as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, mergeModels as f, mergeProps as p, normalizeClass as m, normalizeProps as h, onUnmounted as g, openBlock as _, renderSlot as v, toDisplayString as y, toRef as b, unref as x, useModel as S, watch as C, withCtx as w } from "vue";
@@ -19,6 +19,7 @@ export * from './QDropdownMenu';
19
19
  export * from './QField';
20
20
  export * from './QFileUpload';
21
21
  export * from './QFocusWrap';
22
+ export * from './QGauge';
22
23
  export * from './QGrid';
23
24
  export * from './QIcon';
24
25
  export * from './QInputGroup';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,mBAAmB,CAAA;AACjC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA;AACjC,cAAc,qBAAqB,CAAA;AACnC,cAAc,WAAW,CAAA;AACzB,cAAc,qBAAqB,CAAA;AACnC,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,eAAe,CAAA;AAC7B,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,kBAAkB,CAAA;AAChC,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,aAAa,CAAA;AAC3B,cAAc,cAAc,CAAA;AAC5B,cAAc,kBAAkB,CAAA;AAChC,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA"}
@@ -24,33 +24,34 @@ import { QOverlay as O } from "./QOverlay/index.js";
24
24
  import { QCombobox as k } from "./QCombobox/index.js";
25
25
  import { QSwitch as A } from "./QSwitch/index.js";
26
26
  import { QDateTimePicker as j } from "./QDateTimePicker/index.js";
27
- import { QDefaultsProvider as M } from "./QDefaultsProvider/index.js";
28
- import { QDialog as N, QDialogProvider as P } from "./QDialog/index.js";
29
- import { QDivider as F } from "./QDivider/index.js";
30
- import { QDropdownMenu as te } from "./QDropdownMenu/index.js";
27
+ import { QDefaultsProvider as te } from "./QDefaultsProvider/index.js";
28
+ import { QDialog as M, QDialogProvider as N } from "./QDialog/index.js";
29
+ import { QDivider as P } from "./QDivider/index.js";
30
+ import { QDropdownMenu as F } from "./QDropdownMenu/index.js";
31
31
  import { QFileUpload as I } from "./QFileUpload/index.js";
32
- import { QCol as L, QContainer as R, QRow as z, QSpacer as B } from "./QGrid/index.js";
33
- import { QInputGroup as V } from "./QInputGroup/index.js";
34
- import { QLineLoader as H } from "./QLineLoader/index.js";
35
- import { QMeter as U } from "./QMeter/index.js";
36
- import { QObfuscation as W } from "./QObfuscation/index.js";
37
- import { QPasswordField as G } from "./QPasswordField/index.js";
38
- import { QPopover as K } from "./QPopover/index.js";
39
- import { QSelect as q } from "./QSelect/index.js";
40
- import { QPhoneField as J } from "./QPhoneField/index.js";
41
- import { QPropertyList as Y, QPropertyListGroup as X, QPropertyListPanel as Z, QPropertyListRow as Q } from "./QPropertyList/index.js";
42
- import { QRadioButton as $, QRadioGroup as ne } from "./QRadioGroup/index.js";
43
- import { QSection as re } from "./QSection/index.js";
44
- import { QToggle as ie } from "./QToggle/index.js";
45
- import { QSidebar as ae, QSidebarItem as oe } from "./QSidebar/index.js";
46
- import { QTab as se, QTabs as ce } from "./QTabs/index.js";
47
- import { QTextArea as le } from "./QTextArea/index.js";
48
- import { QThemeProvider as ue } from "./QThemeProvider/index.js";
49
- import { QToast as de, QToaster as fe } from "./QToast/index.js";
50
- import { QToggleGroup as pe, QToggleGroupItem as me } from "./QToggleGroup/index.js";
51
- import { QTooltip as he } from "./QTooltip/index.js";
32
+ import { QGauge as L } from "./QGauge/index.js";
33
+ import { QCol as R, QContainer as z, QRow as B, QSpacer as V } from "./QGrid/index.js";
34
+ import { QInputGroup as H } from "./QInputGroup/index.js";
35
+ import { QLineLoader as U } from "./QLineLoader/index.js";
36
+ import { QMeter as W } from "./QMeter/index.js";
37
+ import { QObfuscation as G } from "./QObfuscation/index.js";
38
+ import { QPasswordField as K } from "./QPasswordField/index.js";
39
+ import { QPopover as q } from "./QPopover/index.js";
40
+ import { QSelect as J } from "./QSelect/index.js";
41
+ import { QPhoneField as Y } from "./QPhoneField/index.js";
42
+ import { QPropertyList as X, QPropertyListGroup as Z, QPropertyListPanel as Q, QPropertyListRow as $ } from "./QPropertyList/index.js";
43
+ import { QRadioButton as ne, QRadioGroup as re } from "./QRadioGroup/index.js";
44
+ import { QSection as ie } from "./QSection/index.js";
45
+ import { QToggle as ae } from "./QToggle/index.js";
46
+ import { QSidebar as oe, QSidebarItem as se } from "./QSidebar/index.js";
47
+ import { QTab as ce, QTabs as le } from "./QTabs/index.js";
48
+ import { QTextArea as ue } from "./QTextArea/index.js";
49
+ import { QThemeProvider as de } from "./QThemeProvider/index.js";
50
+ import { QToast as fe, QToaster as pe } from "./QToast/index.js";
51
+ import { QToggleGroup as me, QToggleGroupItem as he } from "./QToggleGroup/index.js";
52
+ import { QTooltip as ge } from "./QTooltip/index.js";
52
53
  //#region src/components/index.ts
53
- var ge = /* @__PURE__ */ ee({
54
+ var _e = /* @__PURE__ */ ee({
54
55
  DEFAULT_TEXTS: () => b,
55
56
  QAccordion: () => c,
56
57
  QAccordionItem: () => l,
@@ -63,63 +64,64 @@ var ge = /* @__PURE__ */ ee({
63
64
  QCarousel: () => h,
64
65
  QCheckbox: () => _,
65
66
  QCheckboxLabel: () => v,
66
- QCol: () => L,
67
+ QCol: () => R,
67
68
  QCollapsible: () => s,
68
69
  QColorPicker: () => S,
69
70
  QCombobox: () => k,
70
- QContainer: () => R,
71
+ QContainer: () => z,
71
72
  QDateTimePicker: () => j,
72
- QDefaultsProvider: () => M,
73
- QDialog: () => N,
74
- QDialogProvider: () => P,
73
+ QDefaultsProvider: () => te,
74
+ QDialog: () => M,
75
+ QDialogProvider: () => N,
75
76
  QDismissibleLayer: () => E,
76
- QDivider: () => F,
77
- QDropdownMenu: () => te,
77
+ QDivider: () => P,
78
+ QDropdownMenu: () => F,
78
79
  QField: () => y,
79
80
  QFileUpload: () => I,
80
81
  QFocusWrap: () => D,
82
+ QGauge: () => L,
81
83
  QIcon: () => r,
82
84
  QIconFont: () => i,
83
85
  QIconImg: () => a,
84
86
  QIconSvg: () => o,
85
- QInputGroup: () => V,
87
+ QInputGroup: () => H,
86
88
  QLabel: () => g,
87
- QLineLoader: () => H,
89
+ QLineLoader: () => U,
88
90
  QList: () => C,
89
91
  QListItem: () => w,
90
92
  QListItemGroup: () => T,
91
- QMeter: () => U,
92
- QObfuscation: () => W,
93
+ QMeter: () => W,
94
+ QObfuscation: () => G,
93
95
  QOverlay: () => O,
94
- QPasswordField: () => G,
95
- QPhoneField: () => J,
96
- QPopover: () => K,
97
- QPropertyList: () => Y,
98
- QPropertyListGroup: () => X,
99
- QPropertyListPanel: () => Z,
100
- QPropertyListRow: () => Q,
101
- QRadioButton: () => $,
102
- QRadioGroup: () => ne,
103
- QRow: () => z,
104
- QSection: () => re,
105
- QSelect: () => q,
106
- QSidebar: () => ae,
107
- QSidebarItem: () => oe,
96
+ QPasswordField: () => K,
97
+ QPhoneField: () => Y,
98
+ QPopover: () => q,
99
+ QPropertyList: () => X,
100
+ QPropertyListGroup: () => Z,
101
+ QPropertyListPanel: () => Q,
102
+ QPropertyListRow: () => $,
103
+ QRadioButton: () => ne,
104
+ QRadioGroup: () => re,
105
+ QRow: () => B,
106
+ QSection: () => ie,
107
+ QSelect: () => J,
108
+ QSidebar: () => oe,
109
+ QSidebarItem: () => se,
108
110
  QSkeletonLoader: () => m,
109
- QSpacer: () => B,
111
+ QSpacer: () => V,
110
112
  QSpinnerLoader: () => e,
111
113
  QSwitch: () => A,
112
- QTab: () => se,
113
- QTabs: () => ce,
114
- QTextArea: () => le,
114
+ QTab: () => ce,
115
+ QTabs: () => le,
116
+ QTextArea: () => ue,
115
117
  QTextField: () => x,
116
- QThemeProvider: () => ue,
117
- QToast: () => de,
118
- QToaster: () => fe,
119
- QToggle: () => ie,
120
- QToggleGroup: () => pe,
121
- QToggleGroupItem: () => me,
122
- QTooltip: () => he
118
+ QThemeProvider: () => de,
119
+ QToast: () => fe,
120
+ QToaster: () => pe,
121
+ QToggle: () => ae,
122
+ QToggleGroup: () => me,
123
+ QToggleGroupItem: () => he,
124
+ QTooltip: () => ge
123
125
  });
124
126
  //#endregion
125
- export { b as DEFAULT_TEXTS, c as QAccordion, l as QAccordionItem, u as QAvatar, f as QBadge, p as QBadgeIndicator, t as QButton, d as QButtonGroup, n as QCard, h as QCarousel, _ as QCheckbox, v as QCheckboxLabel, L as QCol, s as QCollapsible, S as QColorPicker, k as QCombobox, R as QContainer, j as QDateTimePicker, M as QDefaultsProvider, N as QDialog, P as QDialogProvider, E as QDismissibleLayer, F as QDivider, te as QDropdownMenu, y as QField, I as QFileUpload, D as QFocusWrap, r as QIcon, i as QIconFont, a as QIconImg, o as QIconSvg, V as QInputGroup, g as QLabel, H as QLineLoader, C as QList, w as QListItem, T as QListItemGroup, U as QMeter, W as QObfuscation, O as QOverlay, G as QPasswordField, J as QPhoneField, K as QPopover, Y as QPropertyList, X as QPropertyListGroup, Z as QPropertyListPanel, Q as QPropertyListRow, $ as QRadioButton, ne as QRadioGroup, z as QRow, re as QSection, q as QSelect, ae as QSidebar, oe as QSidebarItem, m as QSkeletonLoader, B as QSpacer, e as QSpinnerLoader, A as QSwitch, se as QTab, ce as QTabs, le as QTextArea, x as QTextField, ue as QThemeProvider, de as QToast, fe as QToaster, ie as QToggle, pe as QToggleGroup, me as QToggleGroupItem, he as QTooltip, ge as components_exports };
127
+ export { b as DEFAULT_TEXTS, c as QAccordion, l as QAccordionItem, u as QAvatar, f as QBadge, p as QBadgeIndicator, t as QButton, d as QButtonGroup, n as QCard, h as QCarousel, _ as QCheckbox, v as QCheckboxLabel, R as QCol, s as QCollapsible, S as QColorPicker, k as QCombobox, z as QContainer, j as QDateTimePicker, te as QDefaultsProvider, M as QDialog, N as QDialogProvider, E as QDismissibleLayer, P as QDivider, F as QDropdownMenu, y as QField, I as QFileUpload, D as QFocusWrap, L as QGauge, r as QIcon, i as QIconFont, a as QIconImg, o as QIconSvg, H as QInputGroup, g as QLabel, U as QLineLoader, C as QList, w as QListItem, T as QListItemGroup, W as QMeter, G as QObfuscation, O as QOverlay, K as QPasswordField, Y as QPhoneField, q as QPopover, X as QPropertyList, Z as QPropertyListGroup, Q as QPropertyListPanel, $ as QPropertyListRow, ne as QRadioButton, re as QRadioGroup, B as QRow, ie as QSection, J as QSelect, oe as QSidebar, se as QSidebarItem, m as QSkeletonLoader, V as QSpacer, e as QSpinnerLoader, A as QSwitch, ce as QTab, le as QTabs, ue as QTextArea, x as QTextField, de as QThemeProvider, fe as QToast, pe as QToaster, ae as QToggle, me as QToggleGroup, he as QToggleGroupItem, ge as QTooltip, _e as components_exports };
@@ -15,6 +15,6 @@
15
15
  * consumed by applications or other packages.
16
16
  */
17
17
  export { provideTheme, useTheme, type ThemeDefinition } from './theme';
18
- export { useDialog } from './useDialog';
19
- export { useToast } from './useToast';
18
+ export { useDialog, type DialogItem, type UseDialogReturn } from './useDialog';
19
+ export { useToast, type ToastItem, type UseToastReturn } from './useToast';
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAGtE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composables/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAA;AAGtE,OAAO,EAAE,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAA;AAG9E,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAA"}
@@ -1,17 +1,47 @@
1
1
  import { MaybeRef } from 'vue';
2
- import { UseColorReturn } from './types';
2
+ import { ColorStyle, UseColorReturn } from './types';
3
+ import { ColorScheme, RGB } from '../../utils/color';
4
+ type HoverStyle = Pick<ColorStyle, 'hoverColor' | 'hoverColorRgb' | 'onHoverColor'>;
5
+ /**
6
+ * Resolves hover colors for `useColor`.
7
+ *
8
+ * Theme utility keys with a matching `*Dark` scheme token use that token (and `on*Dark`
9
+ * when present). Custom CSS colors, utilities without `*Dark` (e.g. `background`), and
10
+ * unparsable `*Dark` overrides fall back to `darken(main, COLOR_SCHEME_DARKEN_AMOUNT)` with WCAG `onHover`.
11
+ *
12
+ * @param rawColor - The original color input (utility key or CSS color).
13
+ * @param isUtilityColor - Whether `rawColor` is a BEM theme utility key.
14
+ * @param scheme - The active color scheme.
15
+ * @param mainRgb - Parsed RGB of the resolved main color.
16
+ */
17
+ export declare function resolveHoverStyle(rawColor: string, isUtilityColor: boolean, scheme: Readonly<ColorScheme>, mainRgb: RGB): HoverStyle;
3
18
  /**
4
19
  * A composable function that processes and returns color-related information and styles.
5
20
  *
6
- * @param color - A string representing a color value or a utility color name. Can be provided as a ref or plain string.
21
+ * Theme utility colors (e.g. `primary`, `success`) resolve against the active theme.
22
+ * Custom colors are parsed from supported CSS formats: hex, `rgb`/`rgba`, and `hsl`/`hsla`.
23
+ * Values such as `var(...)`, `transparent`, `currentColor`, and `inherit`
24
+ * are rejected with a dev warning.
25
+ *
26
+ * `style.onMainColor` is always derived with WCAG relative luminance.
27
+ * For theme utility keys that have a scheme `*Dark` token, `hoverColor` / `onHoverColor`
28
+ * come from `*Dark` / `on*Dark`. Custom CSS colors, utilities without `*Dark` (such as
29
+ * `background`), and unparsable `*Dark` overrides use `darken(main, COLOR_SCHEME_DARKEN_AMOUNT)` with WCAG
30
+ * `onHover`. Components bind those values as
31
+ * CSS variables for both utility and custom colors. `isUtilityColor` still marks
32
+ * theme keys for hover resolution (`*Dark` / `on*Dark`). Exception: `QButton` with
33
+ * `color="background"` omits inline vars so its SCSS `--background` modifier
34
+ * (primary-dark hover) wins.
35
+ *
36
+ * @param color - A theme utility key or CSS color value. Can be provided as a ref or plain string.
7
37
  *
8
38
  * @returns {UseColorReturn} An object containing:
9
- * - isUtilityColor: A computed boolean indicating if the color is a utility color
39
+ * - isUtilityColor: A computed boolean indicating if the color is a theme utility key
10
40
  * - style: A computed object containing:
11
41
  * - mainColor: The resolved color value
12
- * - onMainColor: A contrasting color suitable for text/content on the main color
13
- * - hoverColor: A darker version of the main color for hover states
14
- * - onHoverColor: A contrasting color suitable for text/content on the hover color
42
+ * - onMainColor: A WCAG contrasting color for content on the main color
43
+ * - hoverColor: Scheme `*Dark` for utilities, otherwise a darkened main color
44
+ * - onHoverColor: Scheme `on*Dark` for utilities when present, otherwise WCAG on hover
15
45
  *
16
46
  * @example
17
47
  * ```ts
@@ -19,15 +49,22 @@ import { UseColorReturn } from './types';
19
49
  * // or
20
50
  * const { isUtilityColor, style } = useColor(ref('#FF0000'))
21
51
  * ```
22
- *
23
- * @throws Will log an error to console if color parsing fails
24
52
  */
25
53
  export declare function useColor(color: MaybeRef<string | undefined>): UseColorReturn;
26
54
  /**
27
- * Checks if a given string represents a valid CSS color format.
55
+ * Resolves a color scheme key against a color scheme while preserving CSS and custom colors.
56
+ *
57
+ * Looks up any key present on the scheme (base, Light/Dark variants, and `on*` tokens).
58
+ * {@link isThemeColor} remains narrower and is only used for theme-key classification
59
+ * (`isUtilityColor` / hover `*Dark` resolution).
60
+ *
61
+ * This pure variant is useful when a component needs to resolve a dynamic collection of
62
+ * colors and therefore cannot create one `useColor` instance per collection entry.
28
63
  *
29
- * @param color - The string to check for CSS color format
30
- * @returns True if the string starts with '#', 'rgb', or 'hsl', false otherwise
64
+ * @param color - A scheme key or CSS color string.
65
+ * @param scheme - The active color scheme.
66
+ * @returns The scheme value when `color` is a scheme key; otherwise the original string.
31
67
  */
32
- export declare function isCssColor(color: string): boolean;
68
+ export declare function resolveColor(color: string, scheme: Readonly<ColorScheme>): string;
69
+ export {};
33
70
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useColor/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,SAAS,CAAA;AAczD;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,cAAc,CA8C5E;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/composables/useColor/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAA;AACnC,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAuBzD,KAAK,UAAU,GAAG,IAAI,CAAC,UAAU,EAAE,YAAY,GAAG,eAAe,GAAG,cAAc,CAAC,CAAA;AAYnF;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAChC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,OAAO,EACvB,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,EAC7B,OAAO,EAAE,GAAG,GACV,UAAU,CA4BZ;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,GAAG,SAAS,CAAC,GAAG,cAAc,CA4C5E;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,WAAW,CAAC,GAAG,MAAM,CAQjF"}
@@ -1,43 +1,69 @@
1
- import { rgbToHex as e, rgbToHsl as t, rgbToVariableString as n } from "../../utils/color/conversion.js";
2
- import { parseColor as r } from "../../utils/color/parse.js";
3
- import { getContrastingColor as i } from "../../utils/color/contrast.js";
4
- import { darken as a } from "../../utils/color/manipulate.js";
5
- import { useTheme as o } from "../theme.js";
6
- import { computed as s, unref as c } from "vue";
1
+ import { rgbToHex as e, rgbToVariableString as t } from "../../utils/color/conversion.js";
2
+ import { parseColor as n } from "../../utils/color/parse.js";
3
+ import { getContrastingColor as r } from "../../utils/color/contrast.js";
4
+ import { darken as i } from "../../utils/color/manipulate.js";
5
+ import { isThemeColor as a, isUnsupportedColor as o } from "../../utils/color/theme-colors.js";
6
+ import { useTheme as s } from "../theme.js";
7
+ import { computed as c, unref as l } from "vue";
7
8
  //#region src/composables/useColor/index.ts
8
- function l(l) {
9
- let d = s(() => c(l)), f = s(() => d.value ? !u(d.value) : !1);
9
+ function u(e) {
10
+ typeof process < "u" && process.env.NODE_ENV === "production" || console.warn(`[Quidgest UI] useColor: unable to resolve color "${e}"`);
11
+ }
12
+ function d(n) {
13
+ let a = i(n, 25);
14
+ return {
15
+ hoverColor: e(a),
16
+ hoverColorRgb: t(a),
17
+ onHoverColor: r(a)
18
+ };
19
+ }
20
+ function f(e, i, a, o) {
21
+ if (i) {
22
+ let i = e, o = a[`${i}Dark`];
23
+ if (typeof o == "string") try {
24
+ let e = n(o), s = a[`on${i.charAt(0).toUpperCase()}${i.slice(1)}Dark`];
25
+ return {
26
+ hoverColor: o,
27
+ hoverColorRgb: t(e),
28
+ onHoverColor: typeof s == "string" ? s : r(e)
29
+ };
30
+ } catch {
31
+ u(o);
32
+ }
33
+ }
34
+ return d(o);
35
+ }
36
+ function p(e) {
37
+ let i = c(() => l(e)), d = s(), p = c(() => i.value ? a(i.value) : !1);
10
38
  return {
11
- isUtilityColor: f,
12
- style: s(() => {
13
- let s = d.value;
14
- if (!s) return;
15
- let c = s, l = o();
16
- if (f.value) {
17
- let e = s;
18
- c = l.current.value.scheme[e] ?? s;
39
+ isUtilityColor: p,
40
+ style: c(() => {
41
+ let e = i.value;
42
+ if (!e) return;
43
+ if (!p.value && o(e)) {
44
+ u(e);
45
+ return;
19
46
  }
20
- let u;
47
+ let a = m(e, d.current.value.scheme), s;
21
48
  try {
22
- if (u = r(c), !u) return;
23
- } catch (e) {
24
- console.error("Failed to parse color:", e);
49
+ s = n(a);
50
+ } catch {
51
+ u(e);
25
52
  return;
26
53
  }
27
- let p = i(t(u).l), m = a(u, 25), h = e(m);
54
+ let c = r(s), l = f(e, p.value, d.current.value.scheme, s);
28
55
  return {
29
- mainColor: c,
30
- mainColorRgb: n(u),
31
- onMainColor: p,
32
- hoverColor: h,
33
- hoverColorRgb: n(m),
34
- onHoverColor: p
56
+ mainColor: a,
57
+ mainColorRgb: t(s),
58
+ onMainColor: c,
59
+ ...l
35
60
  };
36
61
  })
37
62
  };
38
63
  }
39
- function u(e) {
40
- return e.startsWith("#") || e.startsWith("rgb") || e.startsWith("hsl");
64
+ function m(e, t) {
65
+ let n = e.trim();
66
+ return Object.prototype.hasOwnProperty.call(t, n) ? t[n] ?? e : e;
41
67
  }
42
68
  //#endregion
43
- export { u as isCssColor, l as useColor };
69
+ export { m as resolveColor, f as resolveHoverStyle, p as useColor };
@@ -13,10 +13,12 @@ export interface ColorStyle {
13
13
  mainColorRgb: string;
14
14
  /**
15
15
  * The color to be used for content on top of the main color.
16
+ * Computed using WCAG relative luminance.
16
17
  */
17
18
  onMainColor: string;
18
19
  /**
19
20
  * Optional color to be used when the component is in hover state.
21
+ * Scheme `*Dark` for theme utilities when present; otherwise `darken(main, COLOR_SCHEME_DARKEN_AMOUNT)`.
20
22
  */
21
23
  hoverColor?: string;
22
24
  /**
@@ -25,6 +27,7 @@ export interface ColorStyle {
25
27
  hoverColorRgb?: string;
26
28
  /**
27
29
  * Optional color to be used for content when the component is in hover state.
30
+ * Scheme `on*Dark` for theme utilities when present; otherwise WCAG against the hover background.
28
31
  */
29
32
  onHoverColor?: string;
30
33
  }
@@ -33,7 +36,7 @@ export interface ColorStyle {
33
36
  */
34
37
  export interface UseColorReturn {
35
38
  /**
36
- * A computed reference indicating whether the color is a utility color.
39
+ * A computed reference indicating whether the color is a theme utility key.
37
40
  */
38
41
  isUtilityColor: ComputedRef<boolean>;
39
42
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useColor/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;OAEG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAEpC;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;CAC1C"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/composables/useColor/types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,KAAK,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,UAAU;IAC1B;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAA;IAEpB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAA;IAEnB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IAEnB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IAEtB;;;OAGG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC9B;;OAEG;IACH,cAAc,EAAE,WAAW,CAAC,OAAO,CAAC,CAAA;IAEpC;;OAEG;IACH,KAAK,EAAE,WAAW,CAAC,UAAU,GAAG,SAAS,CAAC,CAAA;CAC1C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=_internal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_internal.d.ts","sourceRoot":"","sources":["../../../src/composables/useDialog/_internal.ts"],"names":[],"mappings":""}
@@ -0,0 +1,65 @@
1
+ import { inject as e, ref as t } from "vue";
2
+ //#region src/composables/useDialog/_internal.ts
3
+ var n = Symbol.for("q-dialog");
4
+ function r(e, t) {
5
+ let n = e.dialogs.value[t];
6
+ if (!n) return;
7
+ let r = e.pendingByKey.get(n.entryKey);
8
+ r && !r.settled && (r.reject(/* @__PURE__ */ Error("Dialog removed before it was ready")), e.pendingByKey.delete(n.entryKey)), (n.handlers?.onLeave?.() ?? !0) && e.dialogs.value.splice(t, 1);
9
+ }
10
+ function i(e, t) {
11
+ return e.dialogs.value.some((e) => e.id === t || e.props.id === t);
12
+ }
13
+ function a(e, t) {
14
+ let n = e.dialogs.value.findIndex((e) => e.props.id === t && e.id === void 0);
15
+ if (n === -1) return;
16
+ let r = e.dialogs.value[n], i = e.pendingByKey.get(r.entryKey);
17
+ i && !i.settled && (i.reject(/* @__PURE__ */ Error("Dialog canceled")), e.pendingByKey.delete(r.entryKey)), e.dialogs.value.splice(n, 1);
18
+ }
19
+ function o() {
20
+ let e = t([]), n = /* @__PURE__ */ new Map(), r = 0, i = 0;
21
+ function a(t, r) {
22
+ let i = e.value.find((e) => e.entryKey === t);
23
+ if (!i) return;
24
+ i.id = r;
25
+ let a = n.get(t);
26
+ !a || a.settled || (a.settled = !0, a.resolve(r), n.delete(t), i.handlers?.onEnter?.());
27
+ }
28
+ function o(t, n) {
29
+ let r = e.value.find((e) => e.entryKey === t);
30
+ !r || r.id === n || (r.id = n);
31
+ }
32
+ function s() {
33
+ return `dialog-${++r}`;
34
+ }
35
+ function c() {
36
+ return i > 0;
37
+ }
38
+ function l() {
39
+ if (i > 0) throw Error("Only one QDialogProvider may be mounted per app.");
40
+ i++;
41
+ }
42
+ function u() {
43
+ if (i = Math.max(0, i - 1), !(i > 0)) {
44
+ for (let [, e] of n) e.settled || e.reject(/* @__PURE__ */ Error("Dialog provider unmounted before the dialog was ready"));
45
+ n.clear(), e.value = [];
46
+ }
47
+ }
48
+ return {
49
+ dialogs: e,
50
+ pendingByKey: n,
51
+ registerDialogEntry: a,
52
+ updateDialogEntryId: o,
53
+ nextEntryKey: s,
54
+ hasProvider: c,
55
+ registerProvider: l,
56
+ unregisterProvider: u
57
+ };
58
+ }
59
+ function s() {
60
+ let t = e(n);
61
+ if (!t) throw Error("useDialog() requires a provided dialog instance (e.g. via createFramework)");
62
+ return t;
63
+ }
64
+ //#endregion
65
+ export { n as DialogSymbol, a as cancelDialogByPropsId, o as createDialogInstance, i as hasDialogWithId, s as injectDialogInstance, r as removeDialogEntry };