@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.
Files changed (52) hide show
  1. package/dist/accordion-button.js +1 -1
  2. package/dist/alert-title.js +4 -4
  3. package/dist/blockquote-content.js +1 -1
  4. package/dist/breadcrumb-home.js +6 -6
  5. package/dist/breadcrumb.js +5 -5
  6. package/dist/carousel.js +1 -1
  7. package/dist/checkbox.js +7 -7
  8. package/dist/components/dismissible-alert/dismissible-alert.d.ts +10 -0
  9. package/dist/components/footer/footer-link.d.ts +6 -0
  10. package/dist/components/footer/footer.d.ts +15 -0
  11. package/dist/components/header/header-link.d.ts +6 -0
  12. package/dist/components/header/header-menu-item.d.ts +3 -0
  13. package/dist/components/header/header-menu.d.ts +6 -0
  14. package/dist/components/header/header.d.ts +28 -0
  15. package/dist/components/layout/layout-content.d.ts +12 -0
  16. package/dist/components/layout/layout.d.ts +13 -0
  17. package/dist/contact-email.js +1 -1
  18. package/dist/contact-phone.js +1 -1
  19. package/dist/dismissible-alert.d.ts +2 -0
  20. package/dist/dismissible-alert.js +827 -0
  21. package/dist/embedded-video-modal-button.js +8 -8
  22. package/dist/footer-link.d.ts +2 -0
  23. package/dist/footer-link.js +7 -0
  24. package/dist/footer.d.ts +2 -0
  25. package/dist/footer.js +9 -0
  26. package/dist/header-link.d.ts +2 -0
  27. package/dist/header-link.js +7 -0
  28. package/dist/header-menu-item.d.ts +2 -0
  29. package/dist/header-menu-item.js +7 -0
  30. package/dist/header-menu.d.ts +2 -0
  31. package/dist/header-menu.js +7 -0
  32. package/dist/header.d.ts +2 -0
  33. package/dist/header.js +13 -0
  34. package/dist/hero-video.js +1 -1
  35. package/dist/index.css +1 -1
  36. package/dist/index.d.ts +4 -1
  37. package/dist/index.js +25 -11
  38. package/dist/layout-content.d.ts +2 -0
  39. package/dist/layout-content.js +10 -0
  40. package/dist/layout.d.ts +2 -0
  41. package/dist/layout.js +55 -0
  42. package/dist/modal.js +1 -1
  43. package/dist/{regular-BRNZck7j.js → regular-23gOebKJ.js} +5 -5
  44. package/dist/select-button.js +1 -1
  45. package/dist/select-option.js +1 -1
  46. package/dist/{solid-DyAB2_Ed.js → solid-D4xgBves.js} +2 -2
  47. package/dist/statistics.js +27 -37
  48. package/dist/text-input.js +1 -1
  49. package/dist/use-dismissible-CWEoUQGp.js +26 -0
  50. package/dist/use-resize-observer-DmddO4OQ.js +15 -0
  51. package/dist/utils/use-dismissible.d.ts +5 -0
  52. 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
+ };
@@ -0,0 +1,5 @@
1
+ export declare const useDismissible: (id: string, hash?: string, container?: "local" | "session") => {
2
+ dismissed: boolean;
3
+ dismiss: () => void;
4
+ clear: () => void;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uoguelph/react-components",
3
- "version": "1.2.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": "453ece1338d763a7f9af963568cc2a97e8493818"
77
+ "gitHead": "70f7986f7c6dec6a462009594c4c76640a5b2c5e"
76
78
  }