@onereach/ui-components-common 20.5.0 → 20.6.0-beta.5312.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.
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-w0RCHARs.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-kkhz92Hf.js";
2
2
  export {
3
3
  a as useControlAttributes,
4
4
  u as useDateFormat,
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { D as e, a as E } from "./dropdown-open-k6cFnrqA.js";
2
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 D, d as l, e as S, f as m, g as N, h as n, i as X, j as u, k as P, l as g, m as L, u as M, n as I } from "./useValidationAttributes-w0RCHARs.js";
3
+ import { D as r, L as A, T as C, a as O, b as i, c as D, d as l, e as S, f as m, g as N, h as n, i as X, j as u, k as P, l as g, m as L, u as M, n as I } from "./useValidationAttributes-kkhz92Hf.js";
4
4
  import { D as f, T as d } from "./TimeFormat-CdFMIbra.js";
5
5
  import { Spacing as H } from "./types.js";
6
6
  import { C as F, a as b, b as B, c as v, d as y, e as G, f as h, g as U, h as V, i as k, j as w, k as j, l as q, m as W, H as K, p as Y, o as z, t as Q, s as Z, r as J, q as $, n as aa, P as sa, Q as ea, R as Ea, u as ta, S as _a, T as Ra, v as Ta, W as oa, X as ra, w as Aa, x as Ca, y as Oa, V as ia, z as Da, A as la, _ as Sa, B as ma, D as Na, E as na, Y as Xa, F as ua, Z as Pa, G as ga, I as La, J as Ma, K as Ia, U as pa, L as fa, M as da, N as xa, O as Ha, $ as ca, am as Fa, a5 as ba, a4 as Ba, a2 as va, a9 as ya, a6 as Ga, a0 as ha, a3 as Ua, aa as Va, ab as ka, ac as wa, ad as ja, ae as qa, af as Wa, ag as Ka, ah as Ya, ai as za, aj as Qa, ak as Za, a7 as Ja, a8 as $a, a1 as as, al as ss } from "./extractCssVarName-FgXy_HI0.js";
@@ -1,6 +1,6 @@
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 { D as x, T as b } from "./TimeFormat-CdFMIbra.js";
3
- import { r as C } from "./dom-DzNS5tBj.js";
2
+ import { D as C, T as b } from "./TimeFormat-CdFMIbra.js";
3
+ import { r as x } from "./dom-DzNS5tBj.js";
4
4
  import { g as E } from "./getPageElevations-BuZyM94T.js";
5
5
  import { useMutationObserver as $, useResizeObserver as F, refDebounced as S, useMediaQuery as P } from "@vueuse/core";
6
6
  import O from "@onereach/styles/screens.json";
@@ -13,7 +13,7 @@ const k = () => {
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
+ }, V = Symbol(), U = Symbol(), q = Symbol(), G = (e) => u(() => e.value ?? g(V, C.Short)), J = (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) => {
@@ -37,27 +37,27 @@ const k = () => {
37
37
  return r + n.value;
38
38
  }
39
39
  }, "") : e.value(void 0, t.value)), K = (e, t) => {
40
- const s = p(e) ? e : c(e), r = p(t) ? t : c();
40
+ const o = p(e) ? e : c(e), r = p(t) ? t : c();
41
41
  function n(a) {
42
42
  a.style.zIndex = String(Math.max(0, ...E(a)) + 1);
43
43
  }
44
- v([s, r], ([a]) => {
44
+ v([o, r], ([a]) => {
45
45
  a && n(a);
46
46
  }, { immediate: !0 });
47
47
  }, N = () => {
48
48
  const e = h(), t = M();
49
49
  return u(() => e.id ?? (t == null ? void 0 : t.uid.toString()));
50
50
  }, X = (e) => u(() => e.value ?? g(U, navigator.language)), ee = (e, t = {}) => {
51
- const { hide: s = !0, threshold: r = 0 } = t, n = p(e) ? e : c(e), a = c([]), l = c([]);
52
- function o() {
51
+ const { hide: o = !0, threshold: r = 0 } = t, n = p(e) ? e : c(e), a = c([]), l = c([]);
52
+ function s() {
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 ? (s && f.style.setProperty("visibility", "hidden"), {
57
+ return D + I > w + A + r ? (o && f.style.setProperty("visibility", "hidden"), {
58
58
  innerItems: m,
59
59
  outerItems: [...y, f]
60
- }) : (s && f.style.removeProperty("visibility"), {
60
+ }) : (o && 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, o, {
72
+ return v(n, s, {
73
73
  immediate: !0
74
- }), $(n, o, {
74
+ }), $(n, s, {
75
75
  childList: !0
76
- }), F(n, () => C(o)), {
76
+ }), F(n, () => x(s)), {
77
77
  innerItems: a,
78
78
  outerItems: l
79
79
  };
80
- }, te = (e, t, s = {}) => {
80
+ }, te = (e, t, o = {}) => {
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, s.debounce ?? 0);
85
+ const n = S(r, o.debounce ?? 0);
86
86
  v(n, (i) => {
87
87
  switch (t("update:state", i), i) {
88
88
  case "open":
@@ -94,23 +94,23 @@ const k = () => {
94
94
  }
95
95
  });
96
96
  function a() {
97
- r.value = "open";
97
+ console.log("Change state to open!"), r.value = "open";
98
98
  }
99
99
  function l() {
100
100
  r.value = "closed";
101
101
  }
102
- function o() {
102
+ function s() {
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: o
109
+ toggle: s
110
110
  };
111
111
  };
112
- function re(e, t, s = {}) {
113
- const { defaultValue: r } = s;
112
+ function re(e, t, o = {}) {
113
+ const { defaultValue: r } = o;
114
114
  return r ? u({
115
115
  get: () => e.value ?? r.value,
116
116
  set: (n) => {
@@ -124,29 +124,29 @@ function re(e, t, s = {}) {
124
124
  });
125
125
  }
126
126
  function ne(e) {
127
- const t = M(), s = c();
128
- e ? v(e, (o) => {
129
- s.value = o;
127
+ const t = M(), o = c();
128
+ e ? v(e, (s) => {
129
+ o.value = s;
130
130
  }) : R(() => {
131
131
  if (t) {
132
- const o = t.vnode[Y ? "el" : "elm"];
133
- o instanceof Element && (s.value = o);
132
+ const s = t.vnode[Y ? "el" : "elm"];
133
+ s instanceof Element && (o.value = s);
134
134
  }
135
135
  });
136
- const r = u(() => l(s.value) || a.value), n = u(() => !r.value), a = P(`(min-width: ${O.md})`);
137
- function l(o) {
136
+ const r = u(() => l(o.value) || a.value), n = u(() => !r.value), a = P(`(min-width: ${O.md})`);
137
+ function l(s) {
138
138
  var d;
139
- if (!o)
139
+ if (!s)
140
140
  return !1;
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);
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);
143
143
  }
144
144
  return {
145
145
  isDesktop: r,
146
146
  isMobile: n
147
147
  };
148
148
  }
149
- const ue = () => L.theme, se = (e) => u(() => e.value ?? g(q, b.Auto)), oe = (e, t) => u(() => typeof e.value != "function" ? new Intl.DateTimeFormat(t.value, {
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, {
150
150
  timeStyle: "short",
151
151
  hourCycle: e.value !== b.Auto ? e.value : void 0,
152
152
  timeZone: "UTC"
@@ -164,7 +164,7 @@ const ue = () => L.theme, se = (e) => u(() => e.value ?? g(q, b.Auto)), oe = (e,
164
164
  }, "") : e.value(void 0, t.value));
165
165
  function ae(e = !1) {
166
166
  const t = c(e);
167
- function s() {
167
+ function o() {
168
168
  t.value = !0;
169
169
  }
170
170
  function r() {
@@ -175,7 +175,7 @@ function ae(e = !1) {
175
175
  }
176
176
  return {
177
177
  isActiveToggle: t,
178
- show: s,
178
+ show: o,
179
179
  hide: r,
180
180
  toggle: n
181
181
  };
@@ -207,8 +207,8 @@ export {
207
207
  re as i,
208
208
  ne as j,
209
209
  ue as k,
210
- se as l,
211
- oe as m,
210
+ oe as l,
211
+ se as m,
212
212
  ie as n,
213
213
  ae as u
214
214
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-common",
3
- "version": "20.5.0",
3
+ "version": "20.6.0-beta.5312.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -59,7 +59,7 @@
59
59
  "prepare": "pnpm build"
60
60
  },
61
61
  "dependencies": {
62
- "@onereach/styles": "^20.5.0",
62
+ "@onereach/styles": "^20.6.0-beta.5312.0",
63
63
  "@vueuse/core": "9.13.0",
64
64
  "lodash": "^4.17.21"
65
65
  },
@@ -72,5 +72,5 @@
72
72
  "peerDependencies": {
73
73
  "vue": "3.3.4 || 2.6.14"
74
74
  },
75
- "gitHead": "133b4d56fdf3542c0eca19ffff605f0a0fc41986"
75
+ "npmUnpacked": "20.1.2"
76
76
  }
@@ -46,6 +46,7 @@ export const usePopoverState = (
46
46
 
47
47
  // Methods
48
48
  function open(): void {
49
+ console.log('Change state to open!');
49
50
  state.value = 'open';
50
51
  }
51
52