@uoguelph/react-components 1.2.2 → 1.2.3
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/accordion-button.js +1 -1
- package/dist/alert-title.js +4 -4
- package/dist/blockquote-content.js +1 -1
- package/dist/breadcrumb-home.js +6 -6
- package/dist/breadcrumb.js +5 -5
- package/dist/carousel.js +1 -1
- package/dist/checkbox.js +7 -7
- package/dist/components/dismissible-alert/dismissible-alert.d.ts +10 -0
- package/dist/components/footer/footer-link.d.ts +6 -0
- package/dist/components/footer/footer.d.ts +15 -0
- package/dist/components/header/header-link.d.ts +6 -0
- package/dist/components/header/header-menu-item.d.ts +3 -0
- package/dist/components/header/header-menu.d.ts +6 -0
- package/dist/components/header/header.d.ts +28 -0
- package/dist/components/layout/layout-content.d.ts +12 -0
- package/dist/components/layout/layout.d.ts +13 -0
- package/dist/contact-email.js +1 -1
- package/dist/contact-phone.js +1 -1
- package/dist/dismissible-alert.d.ts +2 -0
- package/dist/dismissible-alert.js +827 -0
- package/dist/embedded-video-modal-button.js +8 -8
- package/dist/footer-link.d.ts +2 -0
- package/dist/footer-link.js +7 -0
- package/dist/footer.d.ts +2 -0
- package/dist/footer.js +9 -0
- package/dist/header-link.d.ts +2 -0
- package/dist/header-link.js +7 -0
- package/dist/header-menu-item.d.ts +2 -0
- package/dist/header-menu-item.js +7 -0
- package/dist/header-menu.d.ts +2 -0
- package/dist/header-menu.js +7 -0
- package/dist/header.d.ts +2 -0
- package/dist/header.js +13 -0
- package/dist/hero-video.js +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +25 -11
- package/dist/layout-content.d.ts +2 -0
- package/dist/layout-content.js +10 -0
- package/dist/layout.d.ts +2 -0
- package/dist/layout.js +55 -0
- package/dist/modal.js +1 -1
- package/dist/{regular-BRNZck7j.js → regular-23gOebKJ.js} +5 -5
- package/dist/select-button.js +1 -1
- package/dist/select-option.js +1 -1
- package/dist/{solid-DyAB2_Ed.js → solid-D4xgBves.js} +2 -2
- package/dist/statistics.js +27 -37
- package/dist/text-input.js +1 -1
- package/dist/use-dismissible-CWEoUQGp.js +26 -0
- package/dist/use-resize-observer-DmddO4OQ.js +15 -0
- package/dist/utils/use-dismissible.d.ts +5 -0
- package/package.json +4 -2
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useState as l, useEffect as c } from "react";
|
|
2
|
+
const w = (r, t, m = "local") => {
|
|
3
|
+
const s = `${r}-use-dismissible-hash`, e = typeof window == "object" ? m === "session" ? window.sessionStorage : window.localStorage : null, [u, i] = l(!0);
|
|
4
|
+
return c(() => {
|
|
5
|
+
const o = (d) => {
|
|
6
|
+
d.key === s && e !== null && i(e.getItem(s) === t);
|
|
7
|
+
};
|
|
8
|
+
if (!t)
|
|
9
|
+
return;
|
|
10
|
+
const n = e == null ? void 0 : e.getItem(s);
|
|
11
|
+
return i(n === t), n && n !== t && (e == null || e.removeItem(s)), window.addEventListener("storage", o), () => {
|
|
12
|
+
window.removeEventListener("storage", o);
|
|
13
|
+
};
|
|
14
|
+
}, [t, s, e]), {
|
|
15
|
+
dismissed: u,
|
|
16
|
+
dismiss: () => {
|
|
17
|
+
t && (i(!0), e == null || e.setItem(s, t));
|
|
18
|
+
},
|
|
19
|
+
clear: () => {
|
|
20
|
+
i(!1), e == null || e.removeItem(s);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export {
|
|
25
|
+
w as u
|
|
26
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { useState as o, useRef as c, useEffect as f } from "react";
|
|
2
|
+
function v() {
|
|
3
|
+
const [n, s] = o(null), e = c(null);
|
|
4
|
+
return f(() => {
|
|
5
|
+
if (!e.current) return;
|
|
6
|
+
const r = new ResizeObserver((u, i) => {
|
|
7
|
+
const t = u[0];
|
|
8
|
+
t && s(t);
|
|
9
|
+
});
|
|
10
|
+
return r.observe(e.current), () => r.disconnect();
|
|
11
|
+
}, [e.current]), [e, n];
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
v as u
|
|
15
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uoguelph/react-components",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "University of Guelph React Components Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"@fortawesome/react-fontawesome": "^0.2.2",
|
|
36
36
|
"@headlessui/react": "^2.2.0",
|
|
37
37
|
"@headlessui/tailwindcss": "^0.2.2",
|
|
38
|
+
"object-hash": "^3.0.0",
|
|
38
39
|
"react": "^19.0.0",
|
|
39
40
|
"react-animate-height": "^3.2.3",
|
|
40
41
|
"react-dom": "^19.0.0",
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
"@eslint/js": "^9.19.0",
|
|
47
48
|
"@tailwindcss/vite": "^4.0.9",
|
|
48
49
|
"@types/node": "^22.13.1",
|
|
50
|
+
"@types/object-hash": "^3.0.6",
|
|
49
51
|
"@types/react": "^19.0.8",
|
|
50
52
|
"@types/react-dom": "^19.0.3",
|
|
51
53
|
"@uoguelph/tailwind-theme": "^1.0.0",
|
|
@@ -72,5 +74,5 @@
|
|
|
72
74
|
"bugs": {
|
|
73
75
|
"url": "https://github.com/ccswbs/uofg-components/issues"
|
|
74
76
|
},
|
|
75
|
-
"gitHead": "
|
|
77
|
+
"gitHead": "70f7986f7c6dec6a462009594c4c76640a5b2c5e"
|
|
76
78
|
}
|