@onereach/ui-components-common 20.2.0-beta.5173.0 → 20.2.0-beta.5175.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.
@@ -1,22 +1,23 @@
1
1
  import r from "lodash/get";
2
2
  import n from "lodash/isElement";
3
- const s = typeof window < "u" ? window : null, g = (s == null ? void 0 : s.MutationObserver) || (s == null ? void 0 : s.WebKitMutationObserver) || (s == null ? void 0 : s.MozMutationObserver) || null, A = ((s == null ? void 0 : s.requestAnimationFrame) || (s == null ? void 0 : s.webkitRequestAnimationFrame) || (s == null ? void 0 : s.mozRequestAnimationFrame) || (s == null ? void 0 : s.msRequestAnimationFrame) || (s == null ? void 0 : s.oRequestAnimationFrame) || // Fallback, but not a true polyfill
3
+ const s = typeof window < "u" ? window : null, g = (s == null ? void 0 : s.MutationObserver) || (s == null ? void 0 : s.WebKitMutationObserver) || (s == null ? void 0 : s.MozMutationObserver) || null, b = ((s == null ? void 0 : s.requestAnimationFrame) || (s == null ? void 0 : s.webkitRequestAnimationFrame) || (s == null ? void 0 : s.mozRequestAnimationFrame) || (s == null ? void 0 : s.msRequestAnimationFrame) || (s == null ? void 0 : s.oRequestAnimationFrame) || // Fallback, but not a true polyfill
4
4
  // Only needed for Opera Mini
5
- ((t) => setTimeout(t, 16))).bind(s), y = ((s == null ? void 0 : s.cancelAnimationFrame) || (s == null ? void 0 : s.mozCancelAnimationFrame)).bind(s), b = (t) => {
5
+ ((t) => setTimeout(t, 16))).bind(s), A = ((s == null ? void 0 : s.requestIdleCallback) || // Fallback, but not a true polyfill
6
+ ((t) => setTimeout(t, 1))).bind(s), y = ((s == null ? void 0 : s.cancelAnimationFrame) || (s == null ? void 0 : s.mozCancelAnimationFrame)).bind(s), w = (t) => {
6
7
  t && t.parentNode && t.parentNode.removeChild(t);
7
- }, w = (t) => r(t, ["offsetHeight"], null), F = (t, e) => [...(e && n(e) ? e : document).querySelectorAll(t)], h = (t, e) => (e && n(e) ? e : document).querySelector(t) || null, v = (t, e) => t && typeof t.contains == "function" ? t.contains(e) : !1, C = (t) => document.getElementById(/^#/.test(t) ? t.slice(1) : t) || null, S = (t, e) => {
8
+ }, C = (t) => r(t, ["offsetHeight"], null), F = (t, e) => [...(e && n(e) ? e : document).querySelectorAll(t)], h = (t, e) => (e && n(e) ? e : document).querySelector(t) || null, q = (t, e) => t && typeof t.contains == "function" ? t.contains(e) : !1, v = (t) => document.getElementById(/^#/.test(t) ? t.slice(1) : t) || null, S = (t, e) => {
8
9
  e && n(t) && t.classList && t.classList.add(e);
9
- }, q = (t, e) => {
10
+ }, x = (t, e) => {
10
11
  e && n(t) && t.classList && t.classList.remove(e);
11
12
  }, E = (t, e) => e && n(t) && t.classList ? t.classList.contains(e) : !1, L = (t, e, o) => {
12
13
  e && n(t) && t.setAttribute(e, o);
13
- }, x = (t, e) => {
14
+ }, M = (t, e) => {
14
15
  e && n(t) && t.removeAttribute(e);
15
- }, M = (t, e) => e && n(t) ? t.getAttribute(e) : null, R = (t, e) => e && n(t) ? t.hasAttribute(e) : null, z = (t, e, o) => {
16
+ }, R = (t, e) => e && n(t) ? t.getAttribute(e) : null, T = (t, e) => e && n(t) ? t.hasAttribute(e) : null, z = (t, e, o) => {
16
17
  e && n(t) && (t.style[e] = o);
17
- }, T = (t, e) => {
18
+ }, B = (t, e) => {
18
19
  e && n(t) && (t.style[e] = "");
19
- }, B = (t, e) => e && n(t) && t.style[e] || null, m = (t) => n(t) ? t.getBoundingClientRect() : null, c = (t) => r(s, "getComputedStyle", null) && n(t) ? getComputedStyle(t) : {}, u = (t) => {
20
+ }, k = (t, e) => e && n(t) && t.style[e] || null, m = (t) => n(t) ? t.getBoundingClientRect() : null, c = (t) => r(s, "getComputedStyle", null) && n(t) ? getComputedStyle(t) : {}, u = (t) => {
20
21
  const e = {
21
22
  top: 0,
22
23
  left: 0
@@ -45,14 +46,14 @@ const s = typeof window < "u" ? window : null, g = (s == null ? void 0 : s.Mutat
45
46
  e = m(t) || e;
46
47
  else {
47
48
  e = u(t);
48
- const f = t.ownerDocument;
49
- let a = t.offsetParent || f.documentElement;
50
- for (; a && (a === f.body || a === f.documentElement) && c(a).position === "static"; )
49
+ const l = t.ownerDocument;
50
+ let a = t.offsetParent || l.documentElement;
51
+ for (; a && (a === l.body || a === l.documentElement) && c(a).position === "static"; )
51
52
  a = a.parentNode;
52
53
  if (a && a !== t && a.nodeType === Node.ELEMENT_NODE) {
53
54
  o = u(a);
54
- const l = c(a);
55
- o.top += parseFloat(l.borderTopWidth), o.left += parseFloat(l.borderLeftWidth);
55
+ const f = c(a);
56
+ o.top += parseFloat(f.borderTopWidth), o.left += parseFloat(f.borderLeftWidth);
56
57
  }
57
58
  }
58
59
  return {
@@ -69,27 +70,28 @@ const s = typeof window < "u" ? window : null, g = (s == null ? void 0 : s.Mutat
69
70
  };
70
71
  export {
71
72
  g as M,
72
- b as a,
73
+ A as a,
73
74
  w as b,
74
75
  y as c,
75
- h as d,
76
- v as e,
77
- S as f,
78
- C as g,
79
- q as h,
80
- E as i,
81
- L as j,
82
- x as k,
76
+ C as d,
77
+ h as e,
78
+ q as f,
79
+ v as g,
80
+ S as h,
81
+ x as i,
82
+ E as j,
83
+ L as k,
83
84
  M as l,
84
85
  R as m,
85
- z as n,
86
- T as o,
86
+ T as n,
87
+ z as o,
87
88
  B as p,
88
- m as q,
89
- A as r,
89
+ k as q,
90
+ b as r,
90
91
  F as s,
91
- c as t,
92
- u,
93
- P as v,
94
- _ as w
92
+ m as t,
93
+ c as u,
94
+ u as v,
95
+ P as w,
96
+ _ as x
95
97
  };
@@ -1,4 +1,4 @@
1
- import "./dom-CwV-xS38.js";
1
+ import "./dom-DzNS5tBj.js";
2
2
  import { i as O } from "./isUndefined-B5qXrATz.js";
3
3
  const R = {
4
4
  h: {
@@ -0,0 +1,19 @@
1
+ function f(e) {
2
+ return e.offsetWidth > 0 && e.offsetHeight > 0;
3
+ }
4
+ function l(e) {
5
+ const i = document.body.querySelectorAll("*"), o = [];
6
+ for (const t of i)
7
+ if (!t.isEqualNode(e) && f(t)) {
8
+ const n = t.style;
9
+ if (n && n.zIndex !== "") {
10
+ const s = Number.parseInt(n.zIndex, 10);
11
+ (s || s !== 0) && o.push(s);
12
+ }
13
+ }
14
+ return o;
15
+ }
16
+ export {
17
+ l as g,
18
+ f as i
19
+ };
package/dist/helpers.js CHANGED
@@ -1,4 +1,4 @@
1
- import { g as s, a as t, s as m } from "./searchItemsByLabel-BhinsABA.js";
1
+ import { g as s, a as t, s as m } from "./searchItemsByLabel-CPGAoUEr.js";
2
2
  export {
3
3
  s as getItemByValue,
4
4
  t as getItemsByValue,
package/dist/hooks.js CHANGED
@@ -1,4 +1,4 @@
1
- import { a, b as u, c as t, d as o, e as r, f as i, g as l, h as m, i as n, j as b, k as d, l as v, m as T, u as f, n as g } from "./useValidationAttributes-BSXZbWP4.js";
1
+ import { a, b as u, c as t, d as o, e as r, f as i, g as l, h as m, i as n, j as b, k as d, l as v, m as T, u as f, n as g } from "./useValidationAttributes-UaCQNb1-.js";
2
2
  export {
3
3
  a as useControlAttributes,
4
4
  u as useDateFormat,
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
1
  import { D as e, a as E } from "./dropdown-open-k6cFnrqA.js";
2
- import { g as _, a as R, s as T } from "./searchItemsByLabel-BhinsABA.js";
3
- import { D as r, L as A, T as O, a as C, b as i, c as l, d as D, e as S, f as N, g as m, h as X, i as n, j as P, k as u, l as L, m as M, u as g, n as I } from "./useValidationAttributes-BSXZbWP4.js";
2
+ import { g as _, a as R, s as T } from "./searchItemsByLabel-CPGAoUEr.js";
3
+ import { D as r, L as A, T as C, a as O, b as i, c as l, d as D, e as S, f as N, g as m, h as X, i as n, j as u, k as P, l as L, m as M, u as g, n as I } from "./useValidationAttributes-UaCQNb1-.js";
4
4
  import { DateFormat as f, TimeFormat as p } from "./types.js";
5
- import { C as F, a as c, b as x, c as b, d as B, e as v, f as y, g as G, h, i as U, j as V, k, l as w, m as j, H as W, p as q, o as K, t as Y, s as z, r as Q, q as Z, n as J, P as $, Q as aa, R as sa, u as ea, S as Ea, T as ta, v as _a, W as Ra, X as Ta, w as oa, x as ra, y as Aa, V as Oa, z as Ca, A as ia, _ as la, B as Da, D as Sa, E as Na, Y as ma, F as Xa, Z as na, G as Pa, I as ua, J as La, K as Ma, U as ga, L as Ia, M as da, N as fa, O as pa, $ as Ha, am as Fa, a5 as ca, a4 as xa, a2 as ba, a9 as Ba, a6 as va, a0 as ya, a3 as Ga, aa as ha, ab as Ua, ac as Va, ad as ka, ae as wa, af as ja, ag as Wa, ah as qa, ai as Ka, aj as Ya, ak as za, a7 as Qa, a8 as Za, a1 as Ja, al as $a } from "./extractCssVarName-IHa2pGlF.js";
6
- import { M as ss, f as es, c as Es, e as ts, l as _s, q as Rs, g as Ts, t as os, w as rs, p as As, m as Os, i as Cs, u as is, v as ls, b as Ds, k as Ss, h as Ns, a as ms, o as Xs, r as ns, d as Ps, s as us, j as Ls, n as Ms } from "./dom-CwV-xS38.js";
7
- import { i as Is } from "./isUndefined-B5qXrATz.js";
8
- import { g as fs, i as ps } from "./getPageElevations-ZXU9P3qj.js";
5
+ import { C as x, a as F, b as c, c as b, d as B, e as v, f as y, g as G, h, i as U, j as V, k, l as w, m as j, H as q, p as W, o as K, t as Y, s as z, r as Q, q as Z, n as J, P as $, Q as aa, R as sa, u as ea, S as Ea, T as ta, v as _a, W as Ra, X as Ta, w as oa, x as ra, y as Aa, V as Ca, z as Oa, A as ia, _ as la, B as Da, D as Sa, E as Na, Y as ma, F as Xa, Z as na, G as ua, I as Pa, J as La, K as Ma, U as ga, L as Ia, M as da, N as fa, O as pa, $ as Ha, am as xa, a5 as Fa, a4 as ca, a2 as ba, a9 as Ba, a6 as va, a0 as ya, a3 as Ga, aa as ha, ab as Ua, ac as Va, ad as ka, ae as wa, af as ja, ag as qa, ah as Wa, ai as Ka, aj as Ya, ak as za, a7 as Qa, a8 as Za, a1 as Ja, al as $a } from "./extractCssVarName-FgXy_HI0.js";
6
+ import { M as ss, h as es, c as Es, f as ts, m as _s, t as Rs, g as Ts, u as os, x as rs, q as As, n as Cs, j as Os, v as is, w as ls, d as Ds, l as Ss, i as Ns, b as ms, p as Xs, r as ns, a as us, e as Ps, s as Ls, k as Ms, o as gs } from "./dom-DzNS5tBj.js";
7
+ import { i as ds } from "./isUndefined-B5qXrATz.js";
8
+ import { g as ps, i as Hs } from "./getPageElevations-Bw0hYzn6.js";
9
9
  export {
10
- F as CODE_BACKSPACE,
11
- c as CODE_BREAK,
12
- x as CODE_DELETE,
10
+ x as CODE_BACKSPACE,
11
+ F as CODE_BREAK,
12
+ c as CODE_DELETE,
13
13
  b as CODE_DOWN,
14
14
  B as CODE_END,
15
15
  v as CODE_ENTER,
@@ -25,10 +25,10 @@ export {
25
25
  f as DateFormat,
26
26
  e as DropdownClose,
27
27
  E as DropdownOpen,
28
- W as HSL_LIMITS,
28
+ q as HSL_LIMITS,
29
29
  A as LOCALE,
30
30
  ss as MutationObs,
31
- q as PLACEMENT_BOTTOM_END,
31
+ W as PLACEMENT_BOTTOM_END,
32
32
  K as PLACEMENT_BOTTOM_START,
33
33
  Y as PLACEMENT_LEFT_END,
34
34
  z as PLACEMENT_LEFT_START,
@@ -47,8 +47,8 @@ export {
47
47
  oa as RX_EXTENSION,
48
48
  ra as RX_HASH,
49
49
  Aa as RX_HASH_ID,
50
- Oa as RX_HREF,
51
- Ca as RX_HTML_TAGS,
50
+ Ca as RX_HREF,
51
+ Oa as RX_HTML_TAGS,
52
52
  ia as RX_HYPHENATE,
53
53
  la as RX_LONG_COLOR,
54
54
  Da as RX_LOWER_UPPER,
@@ -57,8 +57,8 @@ export {
57
57
  ma as RX_QUERY_START,
58
58
  Xa as RX_REGEXP_REPLACE,
59
59
  na as RX_SHORT_COLOR,
60
- Pa as RX_SPACES,
61
- ua as RX_SPACE_SPLIT,
60
+ ua as RX_SPACES,
61
+ Pa as RX_SPACE_SPLIT,
62
62
  La as RX_STAR,
63
63
  Ma as RX_START_SPACE_WORD,
64
64
  ga as RX_TIME,
@@ -66,15 +66,15 @@ export {
66
66
  da as RX_TRIM_RIGHT,
67
67
  fa as RX_UNDERSCORE,
68
68
  pa as RX_UN_KEBAB,
69
- O as TIME_FORMAT,
69
+ C as TIME_FORMAT,
70
70
  p as TimeFormat,
71
71
  es as addClass,
72
72
  Es as cancelAF,
73
73
  ts as contains,
74
74
  Ha as exclude,
75
- Fa as extractCssVarName,
76
- ca as flattenDeep,
77
- xa as generateColorFromString,
75
+ xa as extractCssVarName,
76
+ Fa as flattenDeep,
77
+ ca as generateColorFromString,
78
78
  ba as generateHslFromString,
79
79
  Ba as getAbbreviation,
80
80
  _s as getAttr,
@@ -85,10 +85,10 @@ export {
85
85
  _ as getItemByValue,
86
86
  R as getItemsByValue,
87
87
  rs as getMaxZIndex,
88
- fs as getPageElevations,
88
+ ps as getPageElevations,
89
89
  As as getStyle,
90
- Os as hasAttr,
91
- Cs as hasClass,
90
+ Cs as hasAttr,
91
+ Os as hasClass,
92
92
  ya as hexToRgb,
93
93
  Ga as hslToColorString,
94
94
  ha as include,
@@ -97,13 +97,13 @@ export {
97
97
  ka as isDescendant,
98
98
  wa as isEmpty,
99
99
  ja as isEqual,
100
- Wa as isNil,
101
- qa as isNull,
100
+ qa as isNil,
101
+ Wa as isNull,
102
102
  Ka as isNumber,
103
103
  Ya as isObject,
104
104
  za as isString,
105
- Is as isUndefined,
106
- ps as isVisible,
105
+ ds as isUndefined,
106
+ Hs as isVisible,
107
107
  Qa as normalize,
108
108
  is as offset,
109
109
  ls as position,
@@ -114,14 +114,15 @@ export {
114
114
  ms as removeNode,
115
115
  Xs as removeStyle,
116
116
  ns as requestAF,
117
+ us as requestIC,
117
118
  Ja as rgbToHex,
118
119
  T as searchItemsByLabel,
119
120
  Ps as select,
120
- us as selectAll,
121
- Ls as setAttr,
122
- Ms as setStyle,
121
+ Ls as selectAll,
122
+ Ms as setAttr,
123
+ gs as setStyle,
123
124
  $a as toArray,
124
- C as useControlAttributes,
125
+ O as useControlAttributes,
125
126
  i as useDateFormat,
126
127
  l as useDateMask,
127
128
  D as useElevation,
@@ -130,8 +131,8 @@ export {
130
131
  m as useOverflow,
131
132
  X as usePopoverState,
132
133
  n as useProxyModelValue,
133
- P as useResponsive,
134
- u as useTheme,
134
+ u as useResponsive,
135
+ P as useTheme,
135
136
  L as useTimeFormat,
136
137
  M as useTimeMask,
137
138
  g as useToggle,
@@ -1,4 +1,4 @@
1
- import "./dom-CwV-xS38.js";
1
+ import "./dom-DzNS5tBj.js";
2
2
  import { i as s } from "./isUndefined-B5qXrATz.js";
3
3
  const a = (t, r) => {
4
4
  const e = r.find((n) => t === n.value);
@@ -1,19 +1,19 @@
1
1
  import { useAttrs as h, computed as u, inject as g, isRef as p, ref as c, watch as v, getCurrentInstance as M, onMounted as R } from "vue";
2
- import { DateFormat as x, TimeFormat as b } from "./types.js";
3
- import { r as C } from "./dom-CwV-xS38.js";
4
- import { g as E } from "./getPageElevations-ZXU9P3qj.js";
5
- import { useMutationObserver as $, useResizeObserver as F, refDebounced as S, useMediaQuery as P } from "@vueuse/core";
6
- import O from "@onereach/styles/screens.json";
7
- import { isVue3 as Y } from "@/constants";
8
- import L from "@onereach/styles/tailwind.config.json";
9
- const k = () => {
2
+ import { DateFormat as C, TimeFormat as b } from "./types.js";
3
+ import { a as x, r as E } from "./dom-DzNS5tBj.js";
4
+ import { g as $ } from "./getPageElevations-Bw0hYzn6.js";
5
+ import { useMutationObserver as F, useResizeObserver as S, refDebounced as P, useMediaQuery as O } from "@vueuse/core";
6
+ import Y from "@onereach/styles/screens.json";
7
+ import { isVue3 as L } from "@/constants";
8
+ import V from "@onereach/styles/tailwind.config.json";
9
+ const G = () => {
10
10
  const e = h();
11
11
  return {
12
12
  readonly: u(() => e.readonly),
13
13
  disabled: u(() => e.disabled),
14
14
  "force-state": u(() => e["force-state"])
15
15
  };
16
- }, V = Symbol(), U = Symbol(), q = Symbol(), G = (e) => u(() => e.value ?? g(V, x.Short)), J = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
16
+ }, q = Symbol(), U = Symbol(), H = Symbol(), J = (e) => u(() => e.value ?? g(q, C.Short)), K = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
17
17
  dateStyle: e.value,
18
18
  timeZone: "UTC"
19
19
  }).formatToParts(Date.UTC(1, 0, 1, 1, 1)).reduce((r, n) => {
@@ -36,28 +36,28 @@ const k = () => {
36
36
  default:
37
37
  return r + n.value;
38
38
  }
39
- }, "") : e.value(void 0, t.value)), K = (e, t) => {
40
- const o = p(e) ? e : c(e), r = p(t) ? t : c();
39
+ }, "") : e.value(void 0, t.value)), N = (e, t) => {
40
+ const s = p(e) ? e : c(e), r = p(t) ? t : c();
41
41
  function n(a) {
42
- a.style.zIndex = String(Math.max(0, ...E(a)) + 1);
42
+ a.style.zIndex = String(Math.max(0, ...$(a)) + 1);
43
43
  }
44
- v([o, r], ([a]) => {
45
- a && n(a);
44
+ v([s, r], ([a]) => {
45
+ a && x(() => n(a));
46
46
  }, { immediate: !0 });
47
- }, N = () => {
47
+ }, X = () => {
48
48
  const e = h(), t = M();
49
49
  return u(() => e.id ?? (t == null ? void 0 : t.uid.toString()));
50
- }, X = (e) => u(() => e.value ?? g(U, navigator.language)), ee = (e, t = {}) => {
51
- const { hide: o = !0, threshold: r = 0 } = t, n = p(e) ? e : c(e), a = c([]), l = c([]);
52
- function s() {
50
+ }, ee = (e) => u(() => e.value ?? g(U, navigator.language)), te = (e, t = {}) => {
51
+ const { hide: s = !0, threshold: r = 0 } = t, n = p(e) ? e : c(e), a = c([]), l = c([]);
52
+ function o() {
53
53
  const i = n.value;
54
54
  if (i) {
55
55
  const d = [...i.children].reduce(({ innerItems: m, outerItems: y }, T) => {
56
56
  const f = T, { x: D, width: I } = f.getBoundingClientRect(), { x: w, width: A } = i.getBoundingClientRect();
57
- return D + I > w + A + r ? (o && f.style.setProperty("visibility", "hidden"), {
57
+ return D + I > w + A + r ? (s && f.style.setProperty("visibility", "hidden"), {
58
58
  innerItems: m,
59
59
  outerItems: [...y, f]
60
- }) : (o && f.style.removeProperty("visibility"), {
60
+ }) : (s && f.style.removeProperty("visibility"), {
61
61
  innerItems: [...m, f],
62
62
  outerItems: y
63
63
  });
@@ -69,20 +69,20 @@ const k = () => {
69
69
  } else
70
70
  a.value = [], l.value = [];
71
71
  }
72
- return v(n, s, {
72
+ return v(n, o, {
73
73
  immediate: !0
74
- }), $(n, s, {
74
+ }), F(n, o, {
75
75
  childList: !0
76
- }), F(n, () => C(s)), {
76
+ }), S(n, () => E(o)), {
77
77
  innerItems: a,
78
78
  outerItems: l
79
79
  };
80
- }, te = (e, t, o = {}) => {
80
+ }, re = (e, t, s = {}) => {
81
81
  const r = c(e.value ? "open" : "closed");
82
82
  v(e, (i) => {
83
83
  r.value = i ? "open" : "closed";
84
84
  });
85
- const n = S(r, o.debounce ?? 0);
85
+ const n = P(r, s.debounce ?? 0);
86
86
  v(n, (i) => {
87
87
  switch (t("update:state", i), i) {
88
88
  case "open":
@@ -99,18 +99,18 @@ const k = () => {
99
99
  function l() {
100
100
  r.value = "closed";
101
101
  }
102
- function s() {
102
+ function o() {
103
103
  r.value = r.value === "open" ? "closed" : "open";
104
104
  }
105
105
  return {
106
106
  state: n,
107
107
  open: a,
108
108
  close: l,
109
- toggle: s
109
+ toggle: o
110
110
  };
111
111
  };
112
- function re(e, t, o = {}) {
113
- const { defaultValue: r } = o;
112
+ function ne(e, t, s = {}) {
113
+ const { defaultValue: r } = s;
114
114
  return r ? u({
115
115
  get: () => e.value ?? r.value,
116
116
  set: (n) => {
@@ -123,30 +123,30 @@ function re(e, t, o = {}) {
123
123
  }
124
124
  });
125
125
  }
126
- function ne(e) {
127
- const t = M(), o = c();
128
- e ? v(e, (s) => {
129
- o.value = s;
126
+ function ue(e) {
127
+ const t = M(), s = c();
128
+ e ? v(e, (o) => {
129
+ s.value = o;
130
130
  }) : R(() => {
131
131
  if (t) {
132
- const s = t.vnode[Y ? "el" : "elm"];
133
- s instanceof Element && (o.value = s);
132
+ const o = t.vnode[L ? "el" : "elm"];
133
+ o instanceof Element && (s.value = o);
134
134
  }
135
135
  });
136
- const r = u(() => l(o.value) || a.value), n = u(() => !r.value), a = P(`(min-width: ${O.md})`);
137
- function l(s) {
136
+ const r = u(() => l(s.value) || a.value), n = u(() => !r.value), a = O(`(min-width: ${Y.md})`);
137
+ function l(o) {
138
138
  var d;
139
- if (!s)
139
+ if (!o)
140
140
  return !1;
141
- const i = (d = s.getAttribute("force-screen")) == null ? void 0 : d.split(/\s+/);
142
- return i != null && i.some((m) => ["md", "lg", "xl"].includes(m)) ? !0 : l(s.parentElement ?? void 0);
141
+ const i = (d = o.getAttribute("force-screen")) == null ? void 0 : d.split(/\s+/);
142
+ return i != null && i.some((m) => ["md", "lg", "xl"].includes(m)) ? !0 : l(o.parentElement ?? void 0);
143
143
  }
144
144
  return {
145
145
  isDesktop: r,
146
146
  isMobile: n
147
147
  };
148
148
  }
149
- const ue = () => L.theme, oe = (e) => u(() => e.value ?? g(q, b.Auto)), se = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
149
+ const se = () => V.theme, oe = (e) => u(() => e.value ?? g(H, b.Auto)), ae = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
150
150
  timeStyle: "short",
151
151
  hourCycle: e.value !== b.Auto ? e.value : void 0,
152
152
  timeZone: "UTC"
@@ -162,9 +162,9 @@ const ue = () => L.theme, oe = (e) => u(() => e.value ?? g(q, b.Auto)), se = (e,
162
162
  return r + n.value;
163
163
  }
164
164
  }, "") : e.value(void 0, t.value));
165
- function ae(e = !1) {
165
+ function ie(e = !1) {
166
166
  const t = c(e);
167
- function o() {
167
+ function s() {
168
168
  t.value = !0;
169
169
  }
170
170
  function r() {
@@ -175,12 +175,12 @@ function ae(e = !1) {
175
175
  }
176
176
  return {
177
177
  isActiveToggle: t,
178
- show: o,
178
+ show: s,
179
179
  hide: r,
180
180
  toggle: n
181
181
  };
182
182
  }
183
- const ie = () => {
183
+ const le = () => {
184
184
  const e = h();
185
185
  return {
186
186
  required: u(() => e.required),
@@ -193,22 +193,22 @@ const ie = () => {
193
193
  };
194
194
  };
195
195
  export {
196
- V as D,
196
+ q as D,
197
197
  U as L,
198
- q as T,
199
- k as a,
200
- G as b,
201
- J as c,
202
- K as d,
203
- N as e,
204
- X as f,
205
- ee as g,
206
- te as h,
207
- re as i,
208
- ne as j,
209
- ue as k,
198
+ H as T,
199
+ G as a,
200
+ J as b,
201
+ K as c,
202
+ N as d,
203
+ X as e,
204
+ ee as f,
205
+ te as g,
206
+ re as h,
207
+ ne as i,
208
+ ue as j,
209
+ se as k,
210
210
  oe as l,
211
- se as m,
212
- ie as n,
213
- ae as u
211
+ ae as m,
212
+ le as n,
213
+ ie as u
214
214
  };
@@ -1,5 +1,6 @@
1
1
  export declare const MutationObs: MutationObserver;
2
2
  export declare const requestAF: any;
3
+ export declare const requestIC: (((callback: IdleRequestCallback, options?: IdleRequestOptions | undefined) => number) & typeof requestIdleCallback) | ((cb: () => void) => number);
3
4
  export declare const cancelAF: any;
4
5
  export declare const removeNode: (el: HTMLElement) => void;
5
6
  export declare const reflow: (el: HTMLElement) => number | null;
package/dist/utils.js CHANGED
@@ -1,12 +1,12 @@
1
- import { C as E, a as _, b as R, c as e, d as T, e as t, f as A, g as C, h as O, i as r, j as S, k as o, l as i, m as N, H as D, p as X, o as P, t as l, s as n, r as L, q as M, n as g, P as I, Q as H, R as m, u as c, S as d, T as f, v as B, W as x, X as F, w as G, x as b, y as p, V as U, z as u, A as h, _ as v, B as y, D as V, E as W, Y as j, F as q, Z as K, G as Y, I as k, J as w, K as z, U as Q, L as Z, M as J, N as $, O as aa, $ as sa, am as Ea, a5 as _a, a4 as Ra, a2 as ea, a9 as Ta, a6 as ta, a0 as Aa, a3 as Ca, aa as Oa, ab as ra, ac as Sa, ad as oa, ae as ia, af as Na, ag as Da, ah as Xa, ai as Pa, aj as la, ak as na, a7 as La, a8 as Ma, a1 as ga, al as Ia } from "./extractCssVarName-IHa2pGlF.js";
2
- import { M as ma, f as ca, c as da, e as fa, l as Ba, q as xa, g as Fa, t as Ga, w as ba, p as pa, m as Ua, i as ua, u as ha, v as va, b as ya, k as Va, h as Wa, a as ja, o as qa, r as Ka, d as Ya, s as ka, j as wa, n as za } from "./dom-CwV-xS38.js";
3
- import { i as Za } from "./isUndefined-B5qXrATz.js";
4
- import { g as $a, i as as } from "./getPageElevations-ZXU9P3qj.js";
1
+ import { C as E, a as _, b as e, c as R, d as T, e as t, f as A, g as C, h as O, i as r, j as S, k as o, l as i, m as N, H as D, p as X, o as P, t as l, s as n, r as L, q as I, n as M, P as g, Q as H, R as m, u as c, S as d, T as f, v as x, W as B, X as F, w as G, x as b, y as p, V as u, z as U, A as h, _ as v, B as y, D as V, E as q, Y as W, F as j, Z as K, G as Y, I as k, J as w, K as z, U as Q, L as Z, M as J, N as $, O as aa, $ as sa, am as Ea, a5 as _a, a4 as ea, a2 as Ra, a9 as Ta, a6 as ta, a0 as Aa, a3 as Ca, aa as Oa, ab as ra, ac as Sa, ad as oa, ae as ia, af as Na, ag as Da, ah as Xa, ai as Pa, aj as la, ak as na, a7 as La, a8 as Ia, a1 as Ma, al as ga } from "./extractCssVarName-FgXy_HI0.js";
2
+ import { M as ma, h as ca, c as da, f as fa, m as xa, t as Ba, g as Fa, u as Ga, x as ba, q as pa, n as ua, j as Ua, v as ha, w as va, d as ya, l as Va, i as qa, b as Wa, p as ja, r as Ka, a as Ya, e as ka, s as wa, k as za, o as Qa } from "./dom-DzNS5tBj.js";
3
+ import { i as Ja } from "./isUndefined-B5qXrATz.js";
4
+ import { g as as, i as ss } from "./getPageElevations-Bw0hYzn6.js";
5
5
  export {
6
6
  E as CODE_BACKSPACE,
7
7
  _ as CODE_BREAK,
8
- R as CODE_DELETE,
9
- e as CODE_DOWN,
8
+ e as CODE_DELETE,
9
+ R as CODE_DOWN,
10
10
  T as CODE_END,
11
11
  t as CODE_ENTER,
12
12
  A as CODE_ESC,
@@ -24,29 +24,29 @@ export {
24
24
  l as PLACEMENT_LEFT_END,
25
25
  n as PLACEMENT_LEFT_START,
26
26
  L as PLACEMENT_RIGHT_END,
27
- M as PLACEMENT_RIGHT_START,
28
- g as PLACEMENT_TOP_END,
29
- I as PLACEMENT_TOP_START,
27
+ I as PLACEMENT_RIGHT_START,
28
+ M as PLACEMENT_TOP_END,
29
+ g as PLACEMENT_TOP_START,
30
30
  H as RX_ABBREVIATION_FROM_STRING,
31
31
  m as RX_ARRAY_NOTATION,
32
32
  c as RX_BV_PREFIX,
33
33
  d as RX_DATE,
34
34
  f as RX_DATE_SPLIT,
35
- B as RX_DIGITS,
36
- x as RX_ENCODED_COMMA,
35
+ x as RX_DIGITS,
36
+ B as RX_ENCODED_COMMA,
37
37
  F as RX_ENCODE_REVERSE,
38
38
  G as RX_EXTENSION,
39
39
  b as RX_HASH,
40
40
  p as RX_HASH_ID,
41
- U as RX_HREF,
42
- u as RX_HTML_TAGS,
41
+ u as RX_HREF,
42
+ U as RX_HTML_TAGS,
43
43
  h as RX_HYPHENATE,
44
44
  v as RX_LONG_COLOR,
45
45
  y as RX_LOWER_UPPER,
46
46
  V as RX_NUMBER,
47
- W as RX_PLUS,
48
- j as RX_QUERY_START,
49
- q as RX_REGEXP_REPLACE,
47
+ q as RX_PLUS,
48
+ W as RX_QUERY_START,
49
+ j as RX_REGEXP_REPLACE,
50
50
  K as RX_SHORT_COLOR,
51
51
  Y as RX_SPACES,
52
52
  k as RX_SPACE_SPLIT,
@@ -63,19 +63,19 @@ export {
63
63
  sa as exclude,
64
64
  Ea as extractCssVarName,
65
65
  _a as flattenDeep,
66
- Ra as generateColorFromString,
67
- ea as generateHslFromString,
66
+ ea as generateColorFromString,
67
+ Ra as generateHslFromString,
68
68
  Ta as getAbbreviation,
69
- Ba as getAttr,
70
- xa as getBCR,
69
+ xa as getAttr,
70
+ Ba as getBCR,
71
71
  Fa as getById,
72
72
  Ga as getCS,
73
73
  ta as getHashOfString,
74
74
  ba as getMaxZIndex,
75
- $a as getPageElevations,
75
+ as as getPageElevations,
76
76
  pa as getStyle,
77
- Ua as hasAttr,
78
- ua as hasClass,
77
+ ua as hasAttr,
78
+ Ua as hasClass,
79
79
  Aa as hexToRgb,
80
80
  Ca as hslToColorString,
81
81
  Oa as include,
@@ -89,22 +89,23 @@ export {
89
89
  Pa as isNumber,
90
90
  la as isObject,
91
91
  na as isString,
92
- Za as isUndefined,
93
- as as isVisible,
92
+ Ja as isUndefined,
93
+ ss as isVisible,
94
94
  La as normalize,
95
95
  ha as offset,
96
96
  va as position,
97
- Ma as pxToRem,
97
+ Ia as pxToRem,
98
98
  ya as reflow,
99
99
  Va as removeAttr,
100
- Wa as removeClass,
101
- ja as removeNode,
102
- qa as removeStyle,
100
+ qa as removeClass,
101
+ Wa as removeNode,
102
+ ja as removeStyle,
103
103
  Ka as requestAF,
104
- ga as rgbToHex,
105
- Ya as select,
106
- ka as selectAll,
107
- wa as setAttr,
108
- za as setStyle,
109
- Ia as toArray
104
+ Ya as requestIC,
105
+ Ma as rgbToHex,
106
+ ka as select,
107
+ wa as selectAll,
108
+ za as setAttr,
109
+ Qa as setStyle,
110
+ ga as toArray
110
111
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-common",
3
- "version": "20.2.0-beta.5173.0",
3
+ "version": "20.2.0-beta.5175.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -1,6 +1,6 @@
1
1
  import { MaybeElementRef } from '@vueuse/core';
2
2
  import { isRef, Ref, ref, watch } from 'vue';
3
- import { getPageElevations } from '../utils';
3
+ import { getPageElevations, requestIC } from '../utils';
4
4
 
5
5
  export const useElevation = (
6
6
  element: MaybeElementRef<HTMLElement | undefined>,
@@ -17,7 +17,7 @@ export const useElevation = (
17
17
  // Effects
18
18
  watch([elementRef, triggerRef], ([element]) => {
19
19
  if (element) {
20
- setElementElevation(element as HTMLElement);
20
+ requestIC(() => setElementElevation(element as HTMLElement));
21
21
  }
22
22
  }, { immediate: true });
23
23
  };
@@ -20,6 +20,12 @@ export const requestAF = (
20
20
  ((cb: () => void) => setTimeout(cb, 16))
21
21
  ).bind(WINDOW);
22
22
 
23
+ export const requestIC = (
24
+ WINDOW?.requestIdleCallback ||
25
+ // Fallback, but not a true polyfill
26
+ ((cb: () => void) => setTimeout(cb, 1))
27
+ ).bind(WINDOW);
28
+
23
29
  // eslint-disable-next-line no-unsafe-optional-chaining
24
30
  export const cancelAF = (WINDOW?.cancelAnimationFrame || (WINDOW as any)?.mozCancelAnimationFrame).bind(WINDOW);
25
31
 
@@ -8,7 +8,7 @@ export function getPageElevations(currentElement: HTMLElement): number[] {
8
8
  if (!element.isEqualNode(currentElement) && isVisible(element as HTMLElement)) {
9
9
  const style = (element as HTMLElement).style;
10
10
  if (style && style.zIndex !== '') {
11
- const zIndex = Number.parseInt(el.style.zIndex, 10);
11
+ const zIndex = Number.parseInt(style.zIndex, 10);
12
12
  if (zIndex || zIndex !== 0) {
13
13
  elevations.push(zIndex);
14
14
  }
@@ -1,19 +0,0 @@
1
- function l(e) {
2
- return e.offsetWidth > 0 && e.offsetHeight > 0;
3
- }
4
- function f(e) {
5
- const i = document.body.querySelectorAll("*"), n = [];
6
- for (const t of i)
7
- if (!t.isEqualNode(e) && l(t)) {
8
- const o = t.style;
9
- if (o && o.zIndex !== "") {
10
- const s = Number.parseInt(el.style.zIndex, 10);
11
- (s || s !== 0) && n.push(s);
12
- }
13
- }
14
- return n;
15
- }
16
- export {
17
- f as g,
18
- l as i
19
- };