@uoguelph/web-components 1.9.1-rc.5 → 1.9.1-rc.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.
@@ -1,42 +1,42 @@
1
- import { y as q, z as D, A as F, B as T, S as z, m as j, c as R, e as U, p as l, u as E, t as J, C as y, h as w, F as K, D as L, g as M, a as N, i as Y, s as _, j as G, b as H, d as I, k as o, r as x, l as P } from "./bundle-mjs-XDpZcCQJ.js";
2
- import { a as Q } from "./slot-YHqkDhIT.js";
3
- function B(a, e) {
4
- return a === e || (a == null ? void 0 : a[z]) === e;
1
+ import { x as z, y as j, z as R, A as U, S as K, l as L, c as M, p as N, a as o, B as _, t as V, C as y, d as k, F as Y, D as G, s as H, e as I, g as x, h as w, i as J, j as P, k as l, r as E, b as Q } from "./index-3NMKGd5b.js";
2
+ import { a as W } from "./slot-B1Z_DMrF.js";
3
+ function B(n, t) {
4
+ return n === t || (n == null ? void 0 : n[K]) === t;
5
5
  }
6
- function A(a = {}, e, s, c) {
7
- return q(() => {
8
- var i, r;
9
- return D(() => {
10
- i = r, r = [], F(() => {
11
- a !== s(...r) && (e(a, ...r), i && B(s(...i), a) && e(null, ...i));
6
+ function A(n = {}, t, s, u) {
7
+ return z(() => {
8
+ var i, a;
9
+ return j(() => {
10
+ i = a, a = [], R(() => {
11
+ n !== s(...a) && (t(n, ...a), i && B(s(...i), n) && t(null, ...i));
12
12
  });
13
13
  }), () => {
14
- T(() => {
15
- r && B(s(...r), a) && e(null, ...r);
14
+ U(() => {
15
+ a && B(s(...a), n) && t(null, ...a);
16
16
  });
17
17
  };
18
- }), a;
18
+ }), n;
19
19
  }
20
- const V = (a) => Array.from(a.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [contenteditable], audio[controls], video[controls], details, summary, [tabindex]:not([tabindex="-1"])')), W = (a, e, s) => {
21
- !e() && a.target === a.currentTarget && s(!1);
22
- }, X = (a, e) => {
23
- a.key === "Escape" && e(!1);
24
- }, Z = (a, e, s, c, i) => {
25
- var r;
26
- if (e() && !s().contains(a.relatedTarget) && !c().contains(a.relatedTarget))
27
- if (a.preventDefault(), a.target === i()) {
28
- const d = V(c());
29
- (r = d[d.length - 1]) == null || r.focus();
20
+ const X = (n) => Array.from(n.querySelectorAll('a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, [contenteditable], audio[controls], video[controls], details, summary, [tabindex]:not([tabindex="-1"])')), Z = (n, t, s) => {
21
+ !t() && n.target === n.currentTarget && s(!1);
22
+ }, $ = (n, t) => {
23
+ n.key === "Escape" && t(!1);
24
+ }, ee = (n, t, s, u, i) => {
25
+ var a;
26
+ if (t() && !s().contains(n.relatedTarget) && !u().contains(n.relatedTarget))
27
+ if (n.preventDefault(), n.target === i()) {
28
+ const d = X(u());
29
+ (a = d[d.length - 1]) == null || a.focus();
30
30
  } else
31
31
  i().focus();
32
32
  };
33
- var $ = (a, e) => e(!1), tt = J('<div><div part="content"><button class="absolute top-0 right-0 z-[2] flex aspect-square w-8 -translate-x-1/2 translate-y-1/2 items-center justify-center rounded-full border border-black/30 bg-black p-2 text-lg text-black-contrast transition-colors hover:bg-red hover:text-red-contrast focus:bg-red focus:text-red-contrast" aria-label="Close modal"><!></button> <!></div></div>');
34
- function et(a, e) {
35
- U(e, !0);
36
- let s = l(e, "isOpen", 15), c = l(e, "centered", 7), i = l(e, "autoOpen", 7), r = l(e, "label", 7), d = l(e, "alertDialog", 7), k = l(e, "staticBackdrop", 7), m = l(e, "dismissButton", 7), f = l(e, "container", 7), b = l(e, "el", 7), p = l(e, "inertElements", 7);
37
- E(() => {
33
+ var te = (n, t) => t(!1), ne = V('<div><div part="content"><button aria-label="Close modal"><!></button> <!></div></div>');
34
+ function se(n, t) {
35
+ N(t, !0);
36
+ let s = o(t, "isOpen", 15), u = o(t, "centered", 7), i = o(t, "autoOpen", 7), a = o(t, "label", 7), d = o(t, "alertDialog", 7), v = o(t, "staticBackdrop", 7), g = o(t, "dismissButton", 7), f = o(t, "container", 7), b = o(t, "el", 7), h = o(t, "inertElements", 7);
37
+ _(() => {
38
38
  i() && s(!0);
39
- }), E(() => {
39
+ }), _(() => {
40
40
  if (s()) {
41
41
  window.requestAnimationFrame(() => {
42
42
  window.requestAnimationFrame(() => {
@@ -45,121 +45,159 @@ function et(a, e) {
45
45
  });
46
46
  });
47
47
  });
48
- let t = b();
49
- for (; t !== null && t !== document.body; ) {
50
- const h = t.parentElement;
51
- if (h === null) {
52
- const u = t.getRootNode();
53
- if (u instanceof ShadowRoot) {
54
- t = u.host;
48
+ let e = b();
49
+ for (; e !== null && e !== document.body; ) {
50
+ const m = e.parentElement;
51
+ if (m === null) {
52
+ const c = e.getRootNode();
53
+ if (c instanceof ShadowRoot) {
54
+ e = c.host;
55
55
  continue;
56
56
  }
57
57
  }
58
- if (h !== null)
59
- for (const u of h.children)
60
- u !== t && !u.inert && (u.inert = !0, p().push(u));
61
- t = h;
58
+ if (m !== null)
59
+ for (const c of m.children)
60
+ c !== e && !c.inert && (c.inert = !0, h().push(c));
61
+ e = m;
62
62
  }
63
63
  b().dispatchEvent(new CustomEvent("opened", { bubbles: !0, composed: !0 }));
64
64
  } else {
65
- for (const t of p())
66
- t.removeAttribute("inert");
67
- p([]), b().dispatchEvent(new CustomEvent("closed", { bubbles: !0, composed: !0 }));
65
+ for (const e of h())
66
+ e.removeAttribute("inert");
67
+ h([]), b().dispatchEvent(new CustomEvent("closed", { bubbles: !0, composed: !0 }));
68
68
  }
69
69
  document.body.style.overflow = s() ? "hidden" : "";
70
70
  });
71
- var n = tt();
72
- let O;
73
- y(n, "tabindex", -1), n.__click = [W, k, s], n.__keyup = [X, s], n.__focusout = [
74
- Z,
71
+ const S = tv({
72
+ slots: {
73
+ base: "bg-opacity-50 fixed top-0 left-0 z-[1000] flex h-screen w-screen bg-black transition-[opacity,visibility]",
74
+ content: "absolute left-1/2 z-1 h-fit max-h-full w-full max-w-full -translate-x-1/2 overflow-auto transition-transform motion-reduce:transition-none sm:w-fit sm:p-8",
75
+ button: "absolute top-0 right-0 z-[2] flex aspect-square w-8 -translate-x-1/2 translate-y-1/2 items-center justify-center rounded-full border border-black/30 bg-black p-2 text-lg text-black-contrast transition-colors hover:bg-red hover:text-red-contrast focus:bg-red focus:text-red-contrast"
76
+ },
77
+ variants: {
78
+ isOpen: {
79
+ true: {
80
+ base: "visible opacity-100",
81
+ content: "visible opacity-100"
82
+ },
83
+ false: {
84
+ base: "invisible opacity-0",
85
+ content: "invisible opacity-0"
86
+ }
87
+ },
88
+ centered: { true: "" }
89
+ },
90
+ compoundVariants: [
91
+ {
92
+ isOpen: !0,
93
+ centered: !0,
94
+ class: { content: "top-1/2 translate-y-[-50%]" }
95
+ },
96
+ {
97
+ isOpen: !1,
98
+ centered: !1,
99
+ class: { content: "translate-y-[-50px]" }
100
+ },
101
+ {
102
+ isOpen: !1,
103
+ centered: !0,
104
+ class: {
105
+ content: "top-1/2 translate-y-[calc(-50%_-_50px)]"
106
+ }
107
+ }
108
+ ]
109
+ }), { base: q, content: D, button: F } = S({
110
+ isOpen: s(),
111
+ centered: u()
112
+ });
113
+ var r = ne();
114
+ y(r, "tabindex", -1), r.__click = [Z, v, s], r.__keyup = [$, s], r.__focusout = [
115
+ ee,
75
116
  s,
76
117
  f,
77
118
  b,
78
- m
119
+ g
79
120
  ];
80
- var v = w(n), g = w(v);
81
- g.__click = [$, s];
82
- var S = w(g);
83
- K(S, { icon: L }), x(g), A(g, (t) => m(t), () => m());
84
- var C = M(g, 2);
85
- return Q(C, e, "default", {}), x(v), x(n), A(n, (t) => f(t), () => f()), N(
86
- (t) => {
87
- O = _(n, 1, "bg-opacity-50 fixed top-0 left-0 z-[1000] flex h-screen w-screen bg-black transition-[opacity,visibility]", null, O, {
88
- visible: s(),
89
- "opacity-100": s(),
90
- invisible: !s(),
91
- "opacity-0": !s()
92
- }), y(n, "role", d() ? "alertdialog" : "dialog"), y(n, "aria-modal", s() ? "true" : ""), y(n, "aria-label", r()), _(v, 1, G(t));
121
+ var O = k(r), p = k(O);
122
+ p.__click = [te, s];
123
+ var T = k(p);
124
+ Y(T, { icon: G }), E(p), A(p, (e) => g(e), () => g());
125
+ var C = H(p, 2);
126
+ return W(C, t, "default", {}), E(O), E(r), A(r, (e) => f(e), () => f()), I(
127
+ (e, m, c) => {
128
+ w(r, 1, e), y(r, "role", d() ? "alertdialog" : "dialog"), y(r, "aria-modal", s() ? "true" : ""), y(r, "aria-label", a()), w(O, 1, m), w(p, 1, c);
93
129
  },
94
130
  [
95
- () => Y("absolute left-1/2 z-1 h-fit max-h-full w-full max-w-full -translate-x-1/2 overflow-auto transition-transform motion-reduce:transition-none sm:w-fit sm:p-8", s() && "visible opacity-100", !s() && !c() && "translate-y-[-50px]", !s() && c() && "top-1/2 translate-y-[calc(-50%_-_50px)]", s() && c() && "top-1/2 translate-y-[-50%]")
131
+ () => x(q()),
132
+ () => x(D()),
133
+ () => x(F())
96
134
  ]
97
- ), H(a, n), I({
135
+ ), J(n, r), P({
98
136
  get isOpen() {
99
137
  return s();
100
138
  },
101
- set isOpen(t) {
102
- s(t), o();
139
+ set isOpen(e) {
140
+ s(e), l();
103
141
  },
104
142
  get centered() {
105
- return c();
143
+ return u();
106
144
  },
107
- set centered(t) {
108
- c(t), o();
145
+ set centered(e) {
146
+ u(e), l();
109
147
  },
110
148
  get autoOpen() {
111
149
  return i();
112
150
  },
113
- set autoOpen(t) {
114
- i(t), o();
151
+ set autoOpen(e) {
152
+ i(e), l();
115
153
  },
116
154
  get label() {
117
- return r();
155
+ return a();
118
156
  },
119
- set label(t) {
120
- r(t), o();
157
+ set label(e) {
158
+ a(e), l();
121
159
  },
122
160
  get alertDialog() {
123
161
  return d();
124
162
  },
125
- set alertDialog(t) {
126
- d(t), o();
163
+ set alertDialog(e) {
164
+ d(e), l();
127
165
  },
128
166
  get staticBackdrop() {
129
- return k();
167
+ return v();
130
168
  },
131
- set staticBackdrop(t) {
132
- k(t), o();
169
+ set staticBackdrop(e) {
170
+ v(e), l();
133
171
  },
134
172
  get dismissButton() {
135
- return m();
173
+ return g();
136
174
  },
137
- set dismissButton(t) {
138
- m(t), o();
175
+ set dismissButton(e) {
176
+ g(e), l();
139
177
  },
140
178
  get container() {
141
179
  return f();
142
180
  },
143
- set container(t) {
144
- f(t), o();
181
+ set container(e) {
182
+ f(e), l();
145
183
  },
146
184
  get el() {
147
185
  return b();
148
186
  },
149
- set el(t) {
150
- b(t), o();
187
+ set el(e) {
188
+ b(e), l();
151
189
  },
152
190
  get inertElements() {
153
- return p();
191
+ return h();
154
192
  },
155
- set inertElements(t) {
156
- p(t), o();
193
+ set inertElements(e) {
194
+ h(e), l();
157
195
  }
158
196
  });
159
197
  }
160
- j(["click", "keyup", "focusout"]);
161
- customElements.define("uofg-modal", R(
162
- et,
198
+ L(["click", "keyup", "focusout"]);
199
+ customElements.define("uofg-modal", M(
200
+ se,
163
201
  {
164
202
  label: {
165
203
  attribute: "label",
@@ -195,23 +233,19 @@ customElements.define("uofg-modal", R(
195
233
  ["default"],
196
234
  [],
197
235
  !0,
198
- (a) => class extends a {
236
+ (n) => class extends n {
199
237
  constructor() {
200
- super(), P(this.shadowRoot), this.el = this, this.inertElements = [];
201
- }
202
- connectedCallback() {
203
- super.connectedCallback();
238
+ super(), Q(this.shadowRoot), this.el = this, this.inertElements = [], this.isOpen = !1;
204
239
  }
205
240
  disconnectedCallback() {
206
- super.disconnectedCallback();
207
- for (const e of this.inertElements)
208
- e.removeAttribute("inert");
241
+ for (const t of this.inertElements)
242
+ t.removeAttribute("inert");
209
243
  }
210
244
  getState() {
211
245
  return this.isOpen;
212
246
  }
213
- setState(e) {
214
- this.isOpen = e;
247
+ setState(t) {
248
+ this.isOpen = t;
215
249
  }
216
250
  toggle() {
217
251
  return this.isOpen = !this.isOpen, this.isOpen;
@@ -225,5 +259,5 @@ customElements.define("uofg-modal", R(
225
259
  }
226
260
  ));
227
261
  export {
228
- et as default
262
+ se as default
229
263
  };
@@ -1,9 +1,7 @@
1
- import o from "./uofg-alert.esm.js";
2
- import f from "./uofg-back-to-top.esm.js";
3
- import r from "./uofg-footer.esm.js";
4
- import t from "./uofg-header.esm.js";
5
- import m from "./uofg-modal.esm.js";
6
- const i = { UofGHeader: t, UofGFooter: r, UofGModal: m, UofGAlert: o, UofGBackToTop: f };
1
+ import o from "./uofg-back-to-top.esm.js";
2
+ import f from "./uofg-footer.esm.js";
3
+ import r from "./uofg-header.esm.js";
4
+ const m = { UofGHeader: r, UofGFooter: f, UofGBackToTop: o };
7
5
  export {
8
- i as default
6
+ m as default
9
7
  };
@@ -1,4 +1,4 @@
1
- import { aj as n, z as w, y as d, aD as f, aE as v } from "./bundle-mjs-XDpZcCQJ.js";
1
+ import { a6 as n, y as w, x as d, ao as f, ap as v } from "./index-3NMKGd5b.js";
2
2
  function m(a, e, c = e) {
3
3
  var u = a === "x", s = () => n(() => {
4
4
  r = !0, clearTimeout(t), t = setTimeout(l, 100), c(window[u ? "scrollX" : "scrollY"]);
@@ -8,18 +8,18 @@ function m(a, e, c = e) {
8
8
  });
9
9
  var r = !1, t, l = () => {
10
10
  r = !1;
11
- }, i = !0;
11
+ }, o = !0;
12
12
  w(() => {
13
- var o = e();
14
- i ? i = !1 : !r && o != null && (r = !0, clearTimeout(t), scrollTo(window.scrollX, o), t = setTimeout(l, 100));
13
+ var i = e();
14
+ o ? o = !1 : !r && i != null && (r = !0, clearTimeout(t), scrollTo(window.scrollX, i), t = setTimeout(l, 100));
15
15
  }), d(s), f(() => {
16
16
  removeEventListener("scroll", s);
17
17
  });
18
18
  }
19
- function T(a, e) {
19
+ function x(a, e) {
20
20
  v(window, ["resize"], () => n(() => e(window[a])));
21
21
  }
22
22
  export {
23
- T as a,
23
+ x as a,
24
24
  m as b
25
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uoguelph/web-components",
3
- "version": "1.9.1-rc.5",
3
+ "version": "1.9.1-rc.8",
4
4
  "description": "University of Guelph Web Components Library",
5
5
  "type": "module",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  "@fortawesome/free-solid-svg-icons": "^6.4.0",
28
28
  "@sveltejs/vite-plugin-svelte": "^5.0.3",
29
29
  "@tailwindcss/vite": "^4.0.6",
30
- "@uoguelph/tailwind-theme": "^1.0.0-rc.2",
30
+ "@uoguelph/tailwind-theme": "^1.0.0-rc.5",
31
31
  "autoprefixer": "^10.4.18",
32
32
  "eslint": "^9.19.0",
33
33
  "eslint-plugin-storybook": "^0.11.2",
@@ -49,5 +49,5 @@
49
49
  "bugs": {
50
50
  "url": "https://github.com/ccswbs/uofg-components/issues"
51
51
  },
52
- "gitHead": "ddab87b44bebf976f03f427e350c94b974339e31"
52
+ "gitHead": "70034c85d1e492583cf3850319ebabb47c06f771"
53
53
  }