@quidgest/ui 0.16.7 → 0.16.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/ui.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Quidgest UI v0.16.7
2
+ * Quidgest UI v0.16.8
3
3
  * (c) 2025 Quidgest - Consultores de Gestão, S.A.
4
4
  * Released under the MIT License.
5
5
  */
@@ -639,50 +639,60 @@ $transition-duration: 0.2s !default;
639
639
  background-color: var(--q-button-main-color);
640
640
  border-color: var(--q-button-main-color);
641
641
  color: var(--q-button-on-main-color);
642
- &:hover:not(:disabled) {
643
- background-color: var(--q-button-hover-color);
644
- border-color: var(--q-button-hover-color);
645
- color: var(--q-button-on-hover-color);
642
+ @media (hover: hover) {
643
+ &:hover:not(:disabled) {
644
+ background-color: var(--q-button-hover-color);
645
+ border-color: var(--q-button-hover-color);
646
+ color: var(--q-button-on-hover-color);
647
+ }
646
648
  }
647
649
  }
648
650
  &--tonal {
649
651
  background-color: rgb(var(--q-button-main-color-rgb) / 12%);
650
652
  border-color: transparent;
651
653
  color: var(--q-button-main-color);
652
- &:hover:not(:disabled) {
653
- background-color: var(--q-button-hover-color);
654
- border-color: var(--q-button-hover-color);
655
- color: var(--q-button-on-hover-color);
654
+ @media (hover: hover) {
655
+ &:hover:not(:disabled) {
656
+ background-color: var(--q-button-hover-color);
657
+ border-color: var(--q-button-hover-color);
658
+ color: var(--q-button-on-hover-color);
659
+ }
656
660
  }
657
661
  }
658
662
  &--outlined {
659
663
  background-color: transparent;
660
664
  border-color: var(--q-button-main-color);
661
665
  color: var(--q-button-main-color);
662
- &:hover:not(:disabled) {
663
- background-color: var(--q-button-hover-color);
664
- color: var(--q-button-on-hover-color);
665
- border-color: var(--q-button-hover-color);
666
+ @media (hover: hover) {
667
+ &:hover:not(:disabled) {
668
+ background-color: var(--q-button-hover-color);
669
+ color: var(--q-button-on-hover-color);
670
+ border-color: var(--q-button-hover-color);
671
+ }
666
672
  }
667
673
  }
668
674
  &--ghost {
669
675
  background-color: transparent;
670
676
  border-color: transparent;
671
677
  color: var(--q-button-main-color);
672
- &:hover:not(:disabled) {
673
- background-color: rgb(var(--q-button-hover-color-rgb) / 6%);
674
- border-color: transparent;
675
- color: var(--q-button-hover-color);
678
+ @media (hover: hover) {
679
+ &:hover:not(:disabled) {
680
+ background-color: rgb(var(--q-button-hover-color-rgb) / 6%);
681
+ border-color: transparent;
682
+ color: var(--q-button-hover-color);
683
+ }
676
684
  }
677
685
  }
678
686
  &--text {
679
687
  background-color: transparent;
680
688
  border-color: transparent;
681
689
  color: var(--q-button-main-color);
682
- &:hover:not(:disabled) {
683
- background-color: transparent;
684
- border-color: transparent;
685
- color: var(--q-button-hover-color);
690
+ @media (hover: hover) {
691
+ &:hover:not(:disabled) {
692
+ background-color: transparent;
693
+ border-color: transparent;
694
+ color: var(--q-button-hover-color);
695
+ }
686
696
  }
687
697
  }
688
698
  &--pill {
@@ -1 +1 @@
1
- {"version":3,"file":"QDismissibleLayer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QDismissibleLayer/QDismissibleLayer.vue"],"names":[],"mappings":"AAKA;AAyIC,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAyH1E,iBAAS,cAAc;WA0BT,OAAO,IAA6B;;yBAXrB,GAAG;;;;;;EAgB/B;AASD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;kBAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
1
+ {"version":3,"file":"QDismissibleLayer.vue.d.ts","sourceRoot":"","sources":["../../../src/components/QDismissibleLayer/QDismissibleLayer.vue"],"names":[],"mappings":"AAKA;AAsKC,OAAO,KAAK,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAwJ1E,iBAAS,cAAc;WA0BT,OAAO,IAA6B;;yBAXrB,GAAG;;;;;;EAgB/B;AAQD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;kBAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAEpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
@@ -1,46 +1,67 @@
1
- import { defineComponent as a, ref as c, useId as f, onMounted as m, onUnmounted as p, createElementBlock as v, openBlock as E, renderSlot as y } from "vue";
2
- import { onClickOutside as b } from "../../vendors/@vueuse/core/index.js";
3
- import { useDismissibleLayerStackItem as w } from "../../composables/useDismissibleLayerStack/index.js";
4
- const h = /* @__PURE__ */ a({
1
+ import { defineComponent as p, useTemplateRef as m, useId as v, onMounted as E, onUnmounted as w, createElementBlock as y, openBlock as b, renderSlot as h } from "vue";
2
+ import { useDismissibleLayerStackItem as g } from "../../composables/useDismissibleLayerStack/index.js";
3
+ const C = /* @__PURE__ */ p({
5
4
  __name: "QDismissibleLayer",
6
5
  emits: ["escape-key-down", "pointer-down-outside", "focus-outside", "interact-outside", "dismiss"],
7
- setup(_, { emit: u }) {
8
- const o = u, i = c(null), l = f(), e = w(l);
9
- function r(n) {
10
- n.key === "Escape" && (e != null && e.isTop()) && (o("escape-key-down", n), n.defaultPrevented || o("dismiss", n));
6
+ setup(L, { emit: c }) {
7
+ const o = c, i = m("layerRef"), l = v(), e = g(l);
8
+ let u = [];
9
+ function r(t) {
10
+ t.key === "Escape" && (e != null && e.isTop()) && (o("escape-key-down", t), t.defaultPrevented || o("dismiss", t));
11
11
  }
12
- function d(n) {
12
+ function d(t) {
13
13
  if (!i.value) return;
14
- const t = n.target;
15
- if (!i.value.contains(t) && (e != null && e.isTop())) {
16
- const s = new CustomEvent("focus-outside", {
14
+ const s = t.target;
15
+ if (!i.value.contains(s) && (e != null && e.isTop())) {
16
+ const n = new CustomEvent("focus-outside", {
17
17
  bubbles: !1,
18
18
  cancelable: !0,
19
- detail: { originalEvent: n }
19
+ detail: { originalEvent: t }
20
20
  });
21
- o("focus-outside", s), o("interact-outside", s), s.defaultPrevented || o("dismiss", s);
21
+ o("focus-outside", n), o("interact-outside", n), n.defaultPrevented || o("dismiss", n);
22
22
  }
23
23
  }
24
- return m(() => {
25
- e == null || e.register(), document.addEventListener("keydown", r), document.addEventListener("focusin", d), b(i, (n) => {
26
- if (!(e != null && e.isTop())) return;
27
- const t = new CustomEvent("pointer-down-outside", {
24
+ function a(t) {
25
+ if (!i.value || !(e != null && e.isTop())) return;
26
+ const s = t.target;
27
+ if (!i.value.contains(s)) {
28
+ const n = new CustomEvent("pointer-down-outside", {
28
29
  bubbles: !1,
29
30
  cancelable: !0,
30
- detail: { originalEvent: n }
31
+ detail: { originalEvent: t }
32
+ });
33
+ o("pointer-down-outside", n), o("interact-outside", n), n.defaultPrevented || o("dismiss", n);
34
+ }
35
+ }
36
+ function f() {
37
+ ["mousedown", "touchstart"].forEach((s) => {
38
+ document.addEventListener(s, a, {
39
+ passive: !0,
40
+ capture: !0
41
+ // Use capture phase to ensure we catch the event
42
+ }), u.push(() => {
43
+ document.removeEventListener(s, a, {
44
+ capture: !0
45
+ });
31
46
  });
32
- o("pointer-down-outside", t), o("interact-outside", t), t.defaultPrevented || o("dismiss", t);
33
47
  });
34
- }), p(() => {
35
- e == null || e.unregister(), document.removeEventListener("keydown", r), document.removeEventListener("focusin", d);
36
- }), (n, t) => (E(), v(
48
+ }
49
+ return E(() => {
50
+ e == null || e.register(), document.addEventListener("keydown", r), u.push(() => {
51
+ document.removeEventListener("keydown", r);
52
+ }), document.addEventListener("focusin", d), u.push(() => {
53
+ document.removeEventListener("focusin", d);
54
+ }), f();
55
+ }), w(() => {
56
+ e == null || e.unregister(), u.forEach((t) => t()), u = [];
57
+ }), (t, s) => (b(), y(
37
58
  "div",
38
59
  {
39
60
  ref_key: "layerRef",
40
61
  ref: i
41
62
  },
42
63
  [
43
- y(n.$slots, "default")
64
+ h(t.$slots, "default")
44
65
  ],
45
66
  512
46
67
  /* NEED_PATCH */
@@ -48,5 +69,5 @@ const h = /* @__PURE__ */ a({
48
69
  }
49
70
  });
50
71
  export {
51
- h as default
72
+ C as default
52
73
  };
@@ -1,191 +1,85 @@
1
- import { noop as g, isIOS as $, toRef as w, isClient as C, toArray as x, watchImmediate as F, tryOnScopeDispose as I, isObject as W } from "../shared/index.js";
2
- import { shallowRef as M, watch as O, nextTick as q, computed as P, toValue as v, unref as L, getCurrentInstance as _, onMounted as B } from "vue";
3
- const E = C ? window : void 0;
4
- function y(e) {
5
- var r;
6
- const a = v(e);
7
- return (r = a == null ? void 0 : a.$el) != null ? r : a;
1
+ import { toRef as y, isClient as x, tryOnScopeDispose as _ } from "../shared/index.js";
2
+ import { noop as C } from "../shared/index.js";
3
+ import { shallowRef as m, watch as v, nextTick as b, toValue as h, computed as w, getCurrentInstance as R, onMounted as z } from "vue";
4
+ const p = x ? window : void 0;
5
+ function g(e) {
6
+ var t;
7
+ const r = h(e);
8
+ return (t = r == null ? void 0 : r.$el) != null ? t : r;
8
9
  }
9
- function A(...e) {
10
- const r = [], a = () => {
11
- r.forEach((u) => u()), r.length = 0;
12
- }, o = (u, n, i, s) => (u.addEventListener(n, i, s), () => u.removeEventListener(n, i, s)), c = P(() => {
13
- const u = x(v(e[0])).filter((n) => n != null);
14
- return u.every((n) => typeof n != "string") ? u : void 0;
15
- }), f = F(
16
- () => {
17
- var u, n;
18
- return [
19
- (n = (u = c.value) == null ? void 0 : u.map((i) => y(i))) != null ? n : [E].filter((i) => i != null),
20
- x(v(c.value ? e[1] : e[0])),
21
- x(L(c.value ? e[2] : e[1])),
22
- // @ts-expect-error - TypeScript gets the correct types, but somehow still complains
23
- v(c.value ? e[3] : e[2])
24
- ];
25
- },
26
- ([u, n, i, s]) => {
27
- if (a(), !(u != null && u.length) || !(n != null && n.length) || !(i != null && i.length))
28
- return;
29
- const d = W(s) ? { ...s } : s;
30
- r.push(
31
- ...u.flatMap(
32
- (m) => n.flatMap(
33
- (b) => i.map((R) => o(m, b, R, d))
34
- )
35
- )
36
- );
37
- },
38
- { flush: "post" }
39
- ), h = () => {
40
- f(), a();
41
- };
42
- return I(a), h;
43
- }
44
- let z = !1;
45
- function J(e, r, a = {}) {
46
- const { window: o = E, ignore: c = [], capture: f = !0, detectIframe: h = !1, controls: u = !1 } = a;
47
- if (!o)
48
- return u ? { stop: g, cancel: g, trigger: g } : g;
49
- if ($ && !z) {
50
- z = !0;
51
- const t = { passive: !0 };
52
- Array.from(o.document.body.children).forEach((l) => A(l, "click", g, t)), A(o.document.documentElement, "click", g, t);
53
- }
54
- let n = !0;
55
- const i = (t) => v(c).some((l) => {
56
- if (typeof l == "string")
57
- return Array.from(o.document.querySelectorAll(l)).some((p) => p === t.target || t.composedPath().includes(p));
58
- {
59
- const p = y(l);
60
- return p && (t.target === p || t.composedPath().includes(p));
61
- }
62
- });
63
- function s(t) {
64
- const l = v(t);
65
- return l && l.$.subTree.shapeFlag === 16;
66
- }
67
- function d(t, l) {
68
- const p = v(t), T = p.$.subTree && p.$.subTree.children;
69
- return T == null || !Array.isArray(T) ? !1 : T.some((S) => S.el === l.target || l.composedPath().includes(S.el));
70
- }
71
- const m = (t) => {
72
- const l = y(e);
73
- if (t.target != null && !(!(l instanceof Element) && s(e) && d(e, t)) && !(!l || l === t.target || t.composedPath().includes(l))) {
74
- if ("detail" in t && t.detail === 0 && (n = !i(t)), !n) {
75
- n = !0;
76
- return;
77
- }
78
- r(t);
79
- }
80
- };
81
- let b = !1;
82
- const R = [
83
- A(o, "click", (t) => {
84
- b || (b = !0, setTimeout(() => {
85
- b = !1;
86
- }, 0), m(t));
87
- }, { passive: !0, capture: f }),
88
- A(o, "pointerdown", (t) => {
89
- const l = y(e);
90
- n = !i(t) && !!(l && !t.composedPath().includes(l));
91
- }, { passive: !0 }),
92
- h && A(o, "blur", (t) => {
93
- setTimeout(() => {
94
- var l;
95
- const p = y(e);
96
- ((l = o.document.activeElement) == null ? void 0 : l.tagName) === "IFRAME" && !(p != null && p.contains(o.document.activeElement)) && r(t);
97
- }, 0);
98
- }, { passive: !0 })
99
- ].filter(Boolean), k = () => R.forEach((t) => t());
100
- return u ? {
101
- stop: k,
102
- cancel: () => {
103
- n = !1;
104
- },
105
- trigger: (t) => {
106
- n = !0, m(t), n = !1;
107
- }
108
- } : k;
109
- }
110
- function H() {
111
- const e = M(!1), r = _();
112
- return r && B(() => {
10
+ function A() {
11
+ const e = m(!1), t = R();
12
+ return t && z(() => {
113
13
  e.value = !0;
114
- }, r), e;
14
+ }, t), e;
115
15
  }
116
- function j(e) {
117
- const r = H();
118
- return P(() => (r.value, !!e()));
16
+ function O(e) {
17
+ const t = A();
18
+ return w(() => (t.value, !!e()));
119
19
  }
120
- function D(e, r, a = {}) {
121
- const { window: o = E, ...c } = a;
122
- let f;
123
- const h = j(() => o && "ResizeObserver" in o), u = () => {
124
- f && (f.disconnect(), f = void 0);
125
- }, n = P(() => {
126
- const d = v(e);
127
- return Array.isArray(d) ? d.map((m) => y(m)) : [y(d)];
128
- }), i = O(
129
- n,
130
- (d) => {
131
- if (u(), h.value && o) {
132
- f = new ResizeObserver(r);
133
- for (const m of d)
134
- m && f.observe(m, c);
20
+ function M(e, t, r = {}) {
21
+ const { window: d = p, ...u } = r;
22
+ let l;
23
+ const o = O(() => d && "ResizeObserver" in d), a = () => {
24
+ l && (l.disconnect(), l = void 0);
25
+ }, f = w(() => {
26
+ const i = h(e);
27
+ return Array.isArray(i) ? i.map((s) => g(s)) : [g(i)];
28
+ }), c = v(
29
+ f,
30
+ (i) => {
31
+ if (a(), o.value && d) {
32
+ l = new ResizeObserver(t);
33
+ for (const s of i)
34
+ s && l.observe(s, u);
135
35
  }
136
36
  },
137
37
  { immediate: !0, flush: "post" }
138
- ), s = () => {
139
- u(), i();
38
+ ), n = () => {
39
+ a(), c();
140
40
  };
141
- return I(s), {
142
- isSupported: h,
143
- stop: s
41
+ return _(n), {
42
+ isSupported: o,
43
+ stop: n
144
44
  };
145
45
  }
146
- function N(e = E, r) {
147
- e && typeof e.requestAnimationFrame == "function" ? e.requestAnimationFrame(r) : r();
46
+ function S(e = p, t) {
47
+ e && typeof e.requestAnimationFrame == "function" ? e.requestAnimationFrame(t) : t();
148
48
  }
149
- function K(e = {}) {
150
- var r, a;
151
- const { window: o = E } = e, c = w(e == null ? void 0 : e.element), f = w((r = e == null ? void 0 : e.input) != null ? r : ""), h = (a = e == null ? void 0 : e.styleProp) != null ? a : "height", u = M(1), n = M(0);
152
- function i() {
153
- var s;
154
- if (!c.value)
49
+ function F(e = {}) {
50
+ var t, r;
51
+ const { window: d = p } = e, u = y(e == null ? void 0 : e.element), l = y((t = e == null ? void 0 : e.input) != null ? t : ""), o = (r = e == null ? void 0 : e.styleProp) != null ? r : "height", a = m(1), f = m(0);
52
+ function c() {
53
+ var n;
54
+ if (!u.value)
155
55
  return;
156
- let d = "";
157
- c.value.style[h] = "1px", u.value = (s = c.value) == null ? void 0 : s.scrollHeight;
158
- const m = v(e == null ? void 0 : e.styleTarget);
159
- m ? m.style[h] = `${u.value}px` : d = `${u.value}px`, c.value.style[h] = d;
56
+ let i = "";
57
+ u.value.style[o] = "1px", a.value = (n = u.value) == null ? void 0 : n.scrollHeight;
58
+ const s = h(e == null ? void 0 : e.styleTarget);
59
+ s ? s.style[o] = `${a.value}px` : i = `${a.value}px`, u.value.style[o] = i;
160
60
  }
161
- return O([f, c], () => q(i), { immediate: !0 }), O(u, () => {
162
- var s;
163
- return (s = e == null ? void 0 : e.onResize) == null ? void 0 : s.call(e);
164
- }), D(c, ([{ contentRect: s }]) => {
165
- n.value !== s.width && N(o, () => {
166
- n.value = s.width, i();
61
+ return v([l, u], () => b(c), { immediate: !0 }), v(a, () => {
62
+ var n;
63
+ return (n = e == null ? void 0 : e.onResize) == null ? void 0 : n.call(e);
64
+ }), M(u, ([{ contentRect: n }]) => {
65
+ f.value !== n.width && S(d, () => {
66
+ f.value = n.width, c();
167
67
  });
168
- }), e != null && e.watch && O(e.watch, i, { immediate: !0, deep: !0 }), {
169
- textarea: c,
170
- input: f,
171
- triggerResize: i
68
+ }), e != null && e.watch && v(e.watch, c, { immediate: !0, deep: !0 }), {
69
+ textarea: u,
70
+ input: l,
71
+ triggerResize: c
172
72
  };
173
73
  }
174
74
  export {
175
- E as defaultWindow,
176
- C as isClient,
177
- $ as isIOS,
178
- W as isObject,
179
- g as noop,
180
- J as onClickOutside,
181
- x as toArray,
182
- w as toRef,
183
- I as tryOnScopeDispose,
184
- y as unrefElement,
185
- A as useEventListener,
186
- H as useMounted,
187
- D as useResizeObserver,
188
- j as useSupported,
189
- K as useTextareaAutosize,
190
- F as watchImmediate
75
+ p as defaultWindow,
76
+ x as isClient,
77
+ C as noop,
78
+ y as toRef,
79
+ _ as tryOnScopeDispose,
80
+ g as unrefElement,
81
+ A as useMounted,
82
+ M as useResizeObserver,
83
+ O as useSupported,
84
+ F as useTextareaAutosize
191
85
  };
@@ -1,41 +1,20 @@
1
- import { toRef as o, readonly as i, ref as r, customRef as u, watch as d, getCurrentScope as c, onScopeDispose as f } from "vue";
2
- function g(n) {
3
- return c() ? (f(n), !0) : !1;
1
+ import { toRef as n, readonly as t, ref as f, customRef as r, getCurrentScope as i, onScopeDispose as c } from "vue";
2
+ function s(e) {
3
+ return i() ? (c(e), !0) : !1;
4
4
  }
5
- const s = typeof window < "u" && typeof document < "u";
5
+ const l = typeof window < "u" && typeof document < "u";
6
6
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
7
- const a = Object.prototype.toString, y = (n) => a.call(n) === "[object Object]", l = () => {
8
- }, m = /* @__PURE__ */ w();
9
- function w() {
10
- var n, e;
11
- return s && ((n = window == null ? void 0 : window.navigator) == null ? void 0 : n.userAgent) && (/iP(?:ad|hone|od)/.test(window.navigator.userAgent) || ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
12
- }
13
- function S(...n) {
14
- if (n.length !== 1)
15
- return o(...n);
16
- const e = n[0];
17
- return typeof e == "function" ? i(u(() => ({ get: e, set: l }))) : r(e);
18
- }
19
- function b(n) {
20
- return Array.isArray(n) ? n : [n];
21
- }
22
- function h(n, e, t) {
23
- return d(
24
- n,
25
- e,
26
- {
27
- ...t,
28
- immediate: !0
29
- }
30
- );
7
+ const p = () => {
8
+ };
9
+ function d(...e) {
10
+ if (e.length !== 1)
11
+ return n(...e);
12
+ const o = e[0];
13
+ return typeof o == "function" ? t(r(() => ({ get: o, set: p }))) : f(o);
31
14
  }
32
15
  export {
33
- s as isClient,
34
- m as isIOS,
35
- y as isObject,
36
- l as noop,
37
- b as toArray,
38
- S as toRef,
39
- g as tryOnScopeDispose,
40
- h as watchImmediate
16
+ l as isClient,
17
+ p as noop,
18
+ d as toRef,
19
+ s as tryOnScopeDispose
41
20
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@quidgest/ui",
3
3
  "description": "Quidgest's UI framework",
4
- "version": "0.16.7",
4
+ "version": "0.16.8",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "author": "Quidgest",