@uoguelph/web-components 2.0.8 → 2.0.9-rc.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,5 +1,5 @@
1
- import { aK as ne, aL as oe } from "./index-CEFM1xyC.js";
2
- var H = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, d = (e) => !e || typeof e != "object" || Object.keys(e).length === 0, ie = (e, f) => JSON.stringify(e) === JSON.stringify(f);
1
+ import { aH as ne, aI as oe } from "./index-BxiW26Pq.js";
2
+ var D = (e) => typeof e == "boolean" ? `${e}` : e === 0 ? "0" : e, d = (e) => !e || typeof e != "object" || Object.keys(e).length === 0, ie = (e, f) => JSON.stringify(e) === JSON.stringify(f);
3
3
  function U(e, f) {
4
4
  e.forEach(function(r) {
5
5
  Array.isArray(r) ? U(r, f) : f.push(r);
@@ -17,67 +17,67 @@ var _ = (...e) => W(e).filter(Boolean), $ = (e, f) => {
17
17
  } else r[y] = e[y];
18
18
  for (let y of k) V.includes(y) || (r[y] = f[y]);
19
19
  return r;
20
- }, I = (e) => !e || typeof e != "string" ? e : e.replace(/\s+/g, " ").trim(), se = { twMerge: !0, twMergeConfig: {}, responsiveVariants: !1 }, F = (e) => e || void 0, x = (...e) => F(W(e).filter(Boolean).join(" ")), P = null, A = {}, R = !1, C = (...e) => (f) => f.twMerge ? ((!P || R) && (R = !1, P = d(A) ? ne : oe({ ...A, extend: { theme: A.theme, classGroups: A.classGroups, conflictingClassGroupModifiers: A.conflictingClassGroupModifiers, conflictingClassGroups: A.conflictingClassGroups, ...A.extend } })), F(P(x(e)))) : x(e), Q = (e, f) => {
20
+ }, L = (e) => !e || typeof e != "string" ? e : e.replace(/\s+/g, " ").trim(), se = { twMerge: !0, twMergeConfig: {}, responsiveVariants: !1 }, F = (e) => e || void 0, x = (...e) => F(W(e).filter(Boolean).join(" ")), R = null, A = {}, B = !1, C = (...e) => (f) => f.twMerge ? ((!R || B) && (B = !1, R = d(A) ? ne : oe({ ...A, extend: { theme: A.theme, classGroups: A.classGroups, conflictingClassGroupModifiers: A.conflictingClassGroupModifiers, conflictingClassGroups: A.conflictingClassGroups, ...A.extend } })), F(R(x(e)))) : x(e), Q = (e, f) => {
21
21
  for (let r in f) e.hasOwnProperty(r) ? e[r] = x(e[r], f[r]) : e[r] = f[r];
22
22
  return e;
23
23
  }, fe = (e, f) => {
24
24
  let { extend: r = null, slots: V = {}, variants: k = {}, compoundVariants: y = [], compoundSlots: g = [], defaultVariants: h = {} } = e, v = { ...se, ...f }, T = r != null && r.base ? x(r.base, e == null ? void 0 : e.base) : e == null ? void 0 : e.base, b = r != null && r.variants && !d(r.variants) ? $(k, r.variants) : k, N = r != null && r.defaultVariants && !d(r.defaultVariants) ? { ...r.defaultVariants, ...h } : h;
25
- !d(v.twMergeConfig) && !ie(v.twMergeConfig, A) && (R = !0, A = v.twMergeConfig);
25
+ !d(v.twMergeConfig) && !ie(v.twMergeConfig, A) && (B = !0, A = v.twMergeConfig);
26
26
  let G = d(r == null ? void 0 : r.slots), E = d(V) ? {} : { base: x(e == null ? void 0 : e.base, G && (r == null ? void 0 : r.base)), ...V }, M = G ? E : Q({ ...r == null ? void 0 : r.slots }, d(E) ? { base: e == null ? void 0 : e.base } : E), w = d(r == null ? void 0 : r.compoundVariants) ? y : _(r == null ? void 0 : r.compoundVariants, y), m = (c) => {
27
27
  if (d(b) && d(V) && G) return C(T, c == null ? void 0 : c.class, c == null ? void 0 : c.className)(v);
28
28
  if (w && !Array.isArray(w)) throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof w}`);
29
29
  if (g && !Array.isArray(g)) throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof g}`);
30
30
  let Y = (t, n, l = [], i) => {
31
31
  let o = l;
32
- if (typeof n == "string") o = o.concat(I(n).split(" ").map((s) => `${t}:${s}`));
32
+ if (typeof n == "string") o = o.concat(L(n).split(" ").map((s) => `${t}:${s}`));
33
33
  else if (Array.isArray(n)) o = o.concat(n.reduce((s, a) => s.concat(`${t}:${a}`), []));
34
34
  else if (typeof n == "object" && typeof i == "string") {
35
35
  for (let s in n) if (n.hasOwnProperty(s) && s === i) {
36
36
  let a = n[s];
37
37
  if (a && typeof a == "string") {
38
- let u = I(a);
38
+ let u = L(a);
39
39
  o[i] ? o[i] = o[i].concat(u.split(" ").map((p) => `${t}:${p}`)) : o[i] = u.split(" ").map((p) => `${t}:${p}`);
40
40
  } else Array.isArray(a) && a.length > 0 && (o[i] = a.reduce((u, p) => u.concat(`${t}:${p}`), []));
41
41
  }
42
42
  }
43
43
  return o;
44
- }, B = (t, n = b, l = null, i = null) => {
44
+ }, H = (t, n = b, l = null, i = null) => {
45
45
  var o;
46
46
  let s = n[t];
47
47
  if (!s || d(s)) return null;
48
48
  let a = (o = i == null ? void 0 : i[t]) != null ? o : c == null ? void 0 : c[t];
49
49
  if (a === null) return null;
50
- let u = H(a), p = Array.isArray(v.responsiveVariants) && v.responsiveVariants.length > 0 || v.responsiveVariants === !0, O = N == null ? void 0 : N[t], j = [];
51
- if (typeof u == "object" && p) for (let [K, D] of Object.entries(u)) {
52
- let le = s[D];
53
- if (K === "initial") {
54
- O = D;
50
+ let u = D(a), p = Array.isArray(v.responsiveVariants) && v.responsiveVariants.length > 0 || v.responsiveVariants === !0, O = N == null ? void 0 : N[t], j = [];
51
+ if (typeof u == "object" && p) for (let [P, z] of Object.entries(u)) {
52
+ let le = s[z];
53
+ if (P === "initial") {
54
+ O = z;
55
55
  continue;
56
56
  }
57
- Array.isArray(v.responsiveVariants) && !v.responsiveVariants.includes(K) || (j = Y(K, le, j, l));
57
+ Array.isArray(v.responsiveVariants) && !v.responsiveVariants.includes(P) || (j = Y(P, le, j, l));
58
58
  }
59
- let S = u != null && typeof u != "object" ? u : H(O), J = s[S || "false"];
59
+ let S = u != null && typeof u != "object" ? u : D(O), J = s[S || "false"];
60
60
  return typeof j == "object" && typeof l == "string" && j[l] ? Q(j, J) : j.length > 0 ? (j.push(J), l === "base" ? j.join(" ") : j) : J;
61
- }, Z = () => b ? Object.keys(b).map((t) => B(t, b)) : null, ee = (t, n) => {
61
+ }, Z = () => b ? Object.keys(b).map((t) => H(t, b)) : null, ee = (t, n) => {
62
62
  if (!b || typeof b != "object") return null;
63
63
  let l = new Array();
64
64
  for (let i in b) {
65
- let o = B(i, b, t, n), s = t === "base" && typeof o == "string" ? o : o && o[t];
65
+ let o = H(i, b, t, n), s = t === "base" && typeof o == "string" ? o : o && o[t];
66
66
  s && (l[l.length] = s);
67
67
  }
68
68
  return l;
69
- }, L = {};
70
- for (let t in c) c[t] !== void 0 && (L[t] = c[t]);
71
- let q = (t, n) => {
69
+ }, I = {};
70
+ for (let t in c) c[t] !== void 0 && (I[t] = c[t]);
71
+ let K = (t, n) => {
72
72
  var l;
73
73
  let i = typeof (c == null ? void 0 : c[t]) == "object" ? { [t]: (l = c[t]) == null ? void 0 : l.initial } : {};
74
- return { ...N, ...L, ...i, ...n };
75
- }, z = (t = [], n) => {
74
+ return { ...N, ...I, ...i, ...n };
75
+ }, q = (t = [], n) => {
76
76
  let l = [];
77
77
  for (let { class: i, className: o, ...s } of t) {
78
78
  let a = !0;
79
79
  for (let [u, p] of Object.entries(s)) {
80
- let O = q(u, n)[u];
80
+ let O = K(u, n)[u];
81
81
  if (Array.isArray(p)) {
82
82
  if (!p.includes(O)) {
83
83
  a = !1;
@@ -96,7 +96,7 @@ var _ = (...e) => W(e).filter(Boolean), $ = (e, f) => {
96
96
  }
97
97
  return l;
98
98
  }, re = (t) => {
99
- let n = z(w, t);
99
+ let n = q(w, t);
100
100
  if (!Array.isArray(n)) return n;
101
101
  let l = {};
102
102
  for (let i of n) if (typeof i == "string" && (l.base = C(l.base, i)(v)), typeof i == "object") for (let [o, s] of Object.entries(i)) l[o] = C(l[o], s)(v);
@@ -108,7 +108,7 @@ var _ = (...e) => W(e).filter(Boolean), $ = (e, f) => {
108
108
  if (!d(s)) {
109
109
  let a = !0;
110
110
  for (let u of Object.keys(s)) {
111
- let p = q(u, t)[u];
111
+ let p = K(u, t)[u];
112
112
  if (p === void 0 || (Array.isArray(s[u]) ? !s[u].includes(p) : s[u] !== p)) {
113
113
  a = !1;
114
114
  break;
@@ -128,7 +128,7 @@ var _ = (...e) => W(e).filter(Boolean), $ = (e, f) => {
128
128
  };
129
129
  return t;
130
130
  }
131
- return C(T, Z(), z(w), c == null ? void 0 : c.class, c == null ? void 0 : c.className)(v);
131
+ return C(T, Z(), q(w), c == null ? void 0 : c.class, c == null ? void 0 : c.className)(v);
132
132
  }, X = () => {
133
133
  if (!(!b || typeof b != "object")) return Object.keys(b);
134
134
  };
@@ -1,4 +1,4 @@
1
- import { aB as t, aI as a, aJ as o, A as c, y as u } from "./index-CEFM1xyC.js";
1
+ import { ay as t, aF as a, aG as o, A as c, y as u } from "./index-BxiW26Pq.js";
2
2
  function f(e) {
3
3
  t === null && a(), o && t.l !== null ? l(t).m.push(e) : c(() => {
4
4
  const n = u(e);
@@ -0,0 +1,98 @@
1
+ import { am as E, a0 as w, an as R, t as T, $ as k, ao as A, ap as N, aq as u, ar as d, D as h, E as p, as as m, at as C, au as D, av as O, aw as M, ax as $, ay as B, az as F, A as v, aA as g, y as q, aB as z, m as b, aC as H, aD as I, aE as P } from "./index-BxiW26Pq.js";
2
+ function Y(f, s, ...a) {
3
+ var t = new R(f);
4
+ E(() => {
5
+ const r = s() ?? null;
6
+ t.ensure(r, r && ((n) => r(n, ...a)));
7
+ }, w);
8
+ }
9
+ function j(f, s, a = !1, t = !1, r = !1) {
10
+ var n = f, c = "";
11
+ T(() => {
12
+ var o = (
13
+ /** @type {Effect} */
14
+ k
15
+ );
16
+ if (c === (c = s() ?? "")) {
17
+ h && p();
18
+ return;
19
+ }
20
+ if (o.nodes !== null && (A(
21
+ o.nodes.start,
22
+ /** @type {TemplateNode} */
23
+ o.nodes.end
24
+ ), o.nodes = null), c !== "") {
25
+ if (h) {
26
+ m.data;
27
+ for (var e = p(), i = e; e !== null && (e.nodeType !== C || /** @type {Comment} */
28
+ e.data !== ""); )
29
+ i = e, e = D(e);
30
+ if (e === null)
31
+ throw O(), M;
32
+ u(m, i), n = $(e);
33
+ return;
34
+ }
35
+ var _ = c + "";
36
+ a ? _ = `<svg>${_}</svg>` : t && (_ = `<math>${_}</math>`);
37
+ var l = N(_);
38
+ if ((a || t) && (l = /** @type {Element} */
39
+ d(l)), u(
40
+ /** @type {TemplateNode} */
41
+ d(l),
42
+ /** @type {TemplateNode} */
43
+ l.lastChild
44
+ ), a || t)
45
+ for (; d(l); )
46
+ n.before(
47
+ /** @type {TemplateNode} */
48
+ d(l)
49
+ );
50
+ else
51
+ n.before(l);
52
+ }
53
+ });
54
+ }
55
+ function G(f = !1) {
56
+ const s = (
57
+ /** @type {ComponentContextLegacy} */
58
+ B
59
+ ), a = s.l.u;
60
+ if (!a) return;
61
+ let t = () => H(s.s);
62
+ if (f) {
63
+ let r = 0, n = (
64
+ /** @type {Record<string, any>} */
65
+ {}
66
+ );
67
+ const c = I(() => {
68
+ let o = !1;
69
+ const e = s.s;
70
+ for (const i in e)
71
+ e[i] !== n[i] && (n[i] = e[i], o = !0);
72
+ return o && r++, r;
73
+ });
74
+ t = () => b(c);
75
+ }
76
+ a.b.length && F(() => {
77
+ y(s, t), g(a.b);
78
+ }), v(() => {
79
+ const r = q(() => a.m.map(z));
80
+ return () => {
81
+ for (const n of r)
82
+ typeof n == "function" && n();
83
+ };
84
+ }), a.a.length && v(() => {
85
+ y(s, t), g(a.a);
86
+ });
87
+ }
88
+ function y(f, s) {
89
+ if (f.l.s)
90
+ for (const a of f.l.s) b(a);
91
+ s();
92
+ }
93
+ P();
94
+ export {
95
+ j as h,
96
+ G as i,
97
+ Y as s
98
+ };
@@ -1,4 +1,4 @@
1
- import { D as r, E as l } from "./index-CEFM1xyC.js";
1
+ import { D as r, E as l } from "./index-BxiW26Pq.js";
2
2
  function d(i, t, e, s, o) {
3
3
  var a;
4
4
  r && l();
@@ -1,16 +1,16 @@
1
- import { c as q, p as A, a as B, b as p, f as D, F as G, d as H, s as c, e as o, t as I, g as s, h as a, i as J, j as K, k as L, r as l } from "./index-CEFM1xyC.js";
2
- import { o as N } from "./index-client-Cf3Y5mtB.js";
3
- import { s as O, a as d } from "./slot-DaIvQlrl.js";
4
- import { c as P } from "./index-C6ZIYhZ_.js";
5
- var Q = D("<div><div><!> <!></div> <div><!> <span><!></span></div> <div><!></div></div>");
6
- function V(m, t) {
7
- const e = O(t);
8
- A(t, !0);
9
- let g = B(t, "color", 7, "red");
10
- N(() => {
1
+ import { c as A, p as B, a as D, b as p, f as G, F as H, d as I, s as c, e as o, t as J, g as s, h as a, i as K, j as L, k as N, r } from "./index-BxiW26Pq.js";
2
+ import { o as O } from "./index-client-DG7fHzcC.js";
3
+ import { s as P, a as d } from "./slot-DAai__2s.js";
4
+ import { c as Q } from "./index-CsiSOAU0.js";
5
+ var V = G("<div><div><!> <!></div> <div><!> <span><!></span></div> <div><!></div></div>");
6
+ function W(m, t) {
7
+ const e = P(t);
8
+ B(t, !0);
9
+ let g = D(t, "color", 7, "red");
10
+ O(() => {
11
11
  p(t.$$host.shadowRoot);
12
12
  });
13
- const y = P({
13
+ const y = Q({
14
14
  slots: {
15
15
  base: "flex flex-col",
16
16
  title: "flex items-center p-4 text-lg [&>svg]:mr-4 [&>svg]:h-[1.5em] [&>svg]:fill-current",
@@ -27,29 +27,33 @@ function V(m, t) {
27
27
  }
28
28
  }
29
29
  }), { base: w, title: E, content: F, message: R, footer: S } = y({ color: g() });
30
- var r = Q(), n = o(r), v = o(n);
31
- G(v, {
30
+ var j = {
31
+ get color() {
32
+ return g();
33
+ },
34
+ set color(b = "red") {
35
+ g(b), N();
36
+ }
37
+ }, l = V(), n = o(l), f = o(n);
38
+ H(f, {
32
39
  get icon() {
33
- return H;
40
+ return I;
34
41
  }
35
42
  });
36
- var j = c(v, 2);
37
- d(j, t, "title", {}), l(n);
43
+ var k = c(f, 2);
44
+ d(k, t, "title", {}), r(n);
38
45
  var i = c(n, 2);
39
46
  let x;
40
47
  var h = o(i);
41
48
  d(h, t, "subtitle", {});
42
- var u = c(h, 2), k = o(u);
43
- d(k, t, "message", {}), l(u), l(i);
44
- var b = c(i, 2);
49
+ var u = c(h, 2), z = o(u);
50
+ d(z, t, "message", {}), r(u), r(i);
51
+ var v = c(i, 2);
45
52
  let _;
46
- var z = o(b);
47
- return d(z, t, "footer", {}), l(b), l(r), I(
48
- (f, C, M, T, U) => {
49
- a(r, 1, f), a(n, 1, C), x = a(i, 1, M, null, x, { "border-b": !(e != null && e.footer) }), a(u, 1, T), _ = a(b, 1, U, null, _, {
50
- "px-4": e == null ? void 0 : e.footer,
51
- "py-2": e == null ? void 0 : e.footer
52
- });
53
+ var C = o(v);
54
+ return d(C, t, "footer", {}), r(v), r(l), J(
55
+ (b, M, T, U, q) => {
56
+ a(l, 1, b), a(n, 1, M), x = a(i, 1, T, null, x, { "border-b": !(e != null && e.footer) }), a(u, 1, U), _ = a(v, 1, q, null, _, { "px-4": e == null ? void 0 : e.footer, "py-2": e == null ? void 0 : e.footer });
53
57
  },
54
58
  [
55
59
  () => s(w()),
@@ -58,33 +62,13 @@ function V(m, t) {
58
62
  () => s(R()),
59
63
  () => s(S())
60
64
  ]
61
- ), J(m, r), K({
62
- get color() {
63
- return g();
64
- },
65
- set color(f = "red") {
66
- g(f), L();
67
- }
68
- });
65
+ ), K(m, l), L(j);
69
66
  }
70
- customElements.define("uofg-alert", q(
71
- V,
72
- {
73
- color: {
74
- attribute: "color",
75
- reflect: !0,
76
- type: "String"
77
- }
78
- },
79
- ["title", "subtitle", "message", "footer"],
80
- [],
81
- !0,
82
- (m) => class extends m {
83
- constructor() {
84
- super(), p(this.shadowRoot);
85
- }
67
+ customElements.define("uofg-alert", A(W, { color: { attribute: "color", reflect: !0, type: "String" } }, ["title", "subtitle", "message", "footer"], [], !0, (m) => class extends m {
68
+ constructor() {
69
+ super(), p(this.shadowRoot);
86
70
  }
87
- ));
71
+ }));
88
72
  export {
89
- V as default
73
+ W as default
90
74
  };
@@ -1,37 +1,31 @@
1
- import { l as d, c as u, p as f, f as m, F as h, t as v, m as a, i as _, j as g, n as x, g as w, u as k, h as y, o as T, q as j, e as c, r as i, v as F, b as U } from "./index-CEFM1xyC.js";
2
- import { b as q } from "./window-BAHesVQ-.js";
3
- import { c as z } from "./index-C6ZIYhZ_.js";
4
- const B = () => {
5
- window.scroll({ top: 0, left: 0, behavior: "smooth" });
6
- };
1
+ import { l as u, c as f, f as m, F as h, t as v, m as a, i as _, j as g, p as x, n as w, g as k, u as y, h as T, o as j, q as F, e as c, r as i, v as U, b as q } from "./index-BxiW26Pq.js";
2
+ import { b as z } from "./window-Br-wveUj.js";
3
+ import { c as B } from "./index-CsiSOAU0.js";
7
4
  var C = m('<button><span aria-hidden="true"><!></span> <span class="sr-only">Back to top of page</span></button>');
8
5
  function E(e, n) {
9
- f(n, !0);
10
- let s = j(0), l = k(() => a(s) > 50);
11
- const p = z({
6
+ x(n, !0);
7
+ let s = F(0), l = y(() => a(s) > 50);
8
+ const p = () => {
9
+ window.scroll({ top: 0, left: 0, behavior: "smooth" });
10
+ }, b = B({
12
11
  base: "fixed right-8 bottom-8 z-10 flex h-10 w-10 items-center justify-center border border-white bg-black text-lg text-black-contrast transition hover:bg-red hover:text-red-contrast focus:bg-red focus:text-red-contrast",
13
12
  variants: {
14
- visible: {
15
- true: "visible opacity-100",
16
- false: "invisible opacity-0"
17
- }
13
+ visible: { true: "visible opacity-100", false: "invisible opacity-0" }
18
14
  }
19
15
  });
20
16
  var t = C();
21
- t.__click = [B];
22
- var r = c(t), b = c(r);
23
- h(b, {
17
+ t.__click = p;
18
+ var r = c(t), d = c(r);
19
+ h(d, {
24
20
  get icon() {
25
- return x;
21
+ return w;
26
22
  }
27
- }), i(r), F(2), i(t), v((o) => y(t, 1, o), [
28
- () => w(p({ visible: a(l) }))
29
- ]), q("y", () => a(s), (o) => T(s, o, !0)), _(e, t), g();
23
+ }), i(r), U(2), i(t), v((o) => T(t, 1, o), [() => k(b({ visible: a(l) }))]), z("y", () => a(s), (o) => j(s, o, !0)), _(e, t), g();
30
24
  }
31
- d(["click"]);
32
- customElements.define("uofg-back-to-top", u(E, {}, [], [], !0, (e) => class extends e {
25
+ u(["click"]);
26
+ customElements.define("uofg-back-to-top", f(E, {}, [], [], !0, (e) => class extends e {
33
27
  constructor() {
34
- super(), U(this.shadowRoot);
28
+ super(), q(this.shadowRoot);
35
29
  }
36
30
  }));
37
31
  export {