@uoguelph/react-components 1.2.1 → 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/components/loading-indicator/loading-indicator.d.ts +4 -3
- package/dist/components/select/select-button.d.ts +10 -0
- package/dist/components/select/select-option.d.ts +10 -0
- package/dist/components/select/select-options.d.ts +10 -0
- package/dist/components/select/select.d.ts +7 -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/loading-indicator.js +28 -39
- package/dist/modal.js +1 -1
- package/dist/{regular-BRNZck7j.js → regular-23gOebKJ.js} +5 -5
- package/dist/select-button.d.ts +2 -0
- package/dist/select-button.js +40 -0
- package/dist/select-option.d.ts +2 -0
- package/dist/select-option.js +48 -0
- package/dist/select-options.d.ts +2 -0
- package/dist/select-options.js +31 -0
- package/dist/select.d.ts +2 -0
- package/dist/select.js +9 -0
- package/dist/{solid-DM6GVhkF.js → solid-D4xgBves.js} +16 -5
- 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,40 @@
|
|
|
1
|
+
import { jsx as t, jsxs as m, Fragment as c } from "react/jsx-runtime";
|
|
2
|
+
import { h as a } from "./solid-D4xgBves.js";
|
|
3
|
+
import { FontAwesomeIcon as f } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { ListboxButton as p } from "@headlessui/react";
|
|
5
|
+
import { twMerge as l } from "tailwind-merge";
|
|
6
|
+
import { tv as b } from "tailwind-variants";
|
|
7
|
+
function d({ children: o, className: e, ...n }) {
|
|
8
|
+
const r = b({
|
|
9
|
+
slots: {
|
|
10
|
+
button: [
|
|
11
|
+
"uofg-select-button",
|
|
12
|
+
"ui-open:rounded-b-none",
|
|
13
|
+
"ui-open:border-blue",
|
|
14
|
+
"flex",
|
|
15
|
+
"w-full",
|
|
16
|
+
"items-center",
|
|
17
|
+
"justify-between",
|
|
18
|
+
"rounded-md",
|
|
19
|
+
"border",
|
|
20
|
+
"border-gray-300",
|
|
21
|
+
"bg-white",
|
|
22
|
+
"px-4",
|
|
23
|
+
"py-2",
|
|
24
|
+
"shadow-sm",
|
|
25
|
+
"transition-colors",
|
|
26
|
+
"group-focus-within:border-blue",
|
|
27
|
+
"group-focus-within:outline-none"
|
|
28
|
+
],
|
|
29
|
+
icon: "ui-open:rotate-180 h-5 w-5 text-gray-400 transition-transform"
|
|
30
|
+
}
|
|
31
|
+
}), { button: s, icon: i } = r();
|
|
32
|
+
return /* @__PURE__ */ t(p, { ...n, className: l(s(), e), children: (u) => /* @__PURE__ */ m(c, { children: [
|
|
33
|
+
typeof o == "function" ? o(u) : o,
|
|
34
|
+
/* @__PURE__ */ t(f, { className: i(), icon: a })
|
|
35
|
+
] }) });
|
|
36
|
+
}
|
|
37
|
+
d.displayName = "SelectButton";
|
|
38
|
+
export {
|
|
39
|
+
d as SelectButton
|
|
40
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
2
|
+
import { d as l } from "./regular-23gOebKJ.js";
|
|
3
|
+
import { FontAwesomeIcon as m } from "@fortawesome/react-fontawesome";
|
|
4
|
+
import { ListboxOption as p } from "@headlessui/react";
|
|
5
|
+
import { twMerge as f } from "tailwind-merge";
|
|
6
|
+
import { tv as b } from "tailwind-variants";
|
|
7
|
+
function x({ children: o, className: r, ...i }) {
|
|
8
|
+
const s = b({
|
|
9
|
+
slots: {
|
|
10
|
+
option: [
|
|
11
|
+
"uofg-select-option",
|
|
12
|
+
"uog:relative",
|
|
13
|
+
"uog:cursor-pointer",
|
|
14
|
+
"uog:select-none",
|
|
15
|
+
"uog:border-b",
|
|
16
|
+
"uog:border-gray-300",
|
|
17
|
+
"uog:px-4",
|
|
18
|
+
"uog:py-2",
|
|
19
|
+
"uog:text-gray-900",
|
|
20
|
+
"uog:transition-colors",
|
|
21
|
+
"uog:last:border-b-0",
|
|
22
|
+
"uog:hover:bg-gray-100",
|
|
23
|
+
"uog:focus:bg-gray-100",
|
|
24
|
+
"uog:focus:outline-none",
|
|
25
|
+
"uog:ui-active:bg-gray-100"
|
|
26
|
+
],
|
|
27
|
+
icon: "uog:h-5 uog:w-5 uog:text-blue-600"
|
|
28
|
+
},
|
|
29
|
+
variants: {
|
|
30
|
+
selected: {
|
|
31
|
+
true: {
|
|
32
|
+
icon: "uog:visible"
|
|
33
|
+
},
|
|
34
|
+
false: {
|
|
35
|
+
icon: "uog:invisible"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}), { option: n, icon: u } = s();
|
|
40
|
+
return /* @__PURE__ */ e(p, { ...i, className: f(n(), r), children: ({ focus: g, selected: t, ...c }) => /* @__PURE__ */ a("div", { className: "flex items-center", children: [
|
|
41
|
+
/* @__PURE__ */ e("span", { className: "flex-1", children: typeof o == "function" ? o({ focus: g, selected: t, ...c }) : o }),
|
|
42
|
+
/* @__PURE__ */ e(m, { icon: l, className: u({ selected: t }) })
|
|
43
|
+
] }) });
|
|
44
|
+
}
|
|
45
|
+
x.displayName = "SelectOptions";
|
|
46
|
+
export {
|
|
47
|
+
x as SelectOption
|
|
48
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { ListboxOptions as g } from "@headlessui/react";
|
|
3
|
+
import { twMerge as i } from "tailwind-merge";
|
|
4
|
+
function s({ children: o, className: u, ...e }) {
|
|
5
|
+
const r = i(
|
|
6
|
+
"uog:z-10",
|
|
7
|
+
"uog:max-h-[20rem]",
|
|
8
|
+
"uog:w-full",
|
|
9
|
+
"uog:overflow-auto",
|
|
10
|
+
"uog:rounded-b-md",
|
|
11
|
+
"uog:border",
|
|
12
|
+
"uog:border-t-0",
|
|
13
|
+
"uog:border-gray-300",
|
|
14
|
+
"uog:bg-white",
|
|
15
|
+
"uog:shadow-md",
|
|
16
|
+
"uog:group-focus-within:border-blue",
|
|
17
|
+
"uog:group-focus-within:outline-none",
|
|
18
|
+
"uog:ui-open:border-blue",
|
|
19
|
+
"uog:md:absolute",
|
|
20
|
+
"uog:transition",
|
|
21
|
+
"uog:duration-300",
|
|
22
|
+
"uog:ease-out",
|
|
23
|
+
"uog:data-[closed]:opacity-0",
|
|
24
|
+
u
|
|
25
|
+
);
|
|
26
|
+
return /* @__PURE__ */ t(g, { ...e, className: r, children: o });
|
|
27
|
+
}
|
|
28
|
+
s.displayName = "SelectOptions";
|
|
29
|
+
export {
|
|
30
|
+
s as SelectOptions
|
|
31
|
+
};
|
package/dist/select.d.ts
ADDED
package/dist/select.js
ADDED
|
@@ -38,7 +38,17 @@ var a = {
|
|
|
38
38
|
"f00d",
|
|
39
39
|
"M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"
|
|
40
40
|
]
|
|
41
|
-
}, f = c,
|
|
41
|
+
}, f = c, o = {
|
|
42
|
+
prefix: "fas",
|
|
43
|
+
iconName: "chevron-down",
|
|
44
|
+
icon: [
|
|
45
|
+
512,
|
|
46
|
+
512,
|
|
47
|
+
[],
|
|
48
|
+
"f078",
|
|
49
|
+
"M233.4 406.6c12.5 12.5 32.8 12.5 45.3 0l192-192c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L256 338.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l192 192z"
|
|
50
|
+
]
|
|
51
|
+
}, s = {
|
|
42
52
|
prefix: "fas",
|
|
43
53
|
iconName: "play",
|
|
44
54
|
icon: [
|
|
@@ -58,7 +68,7 @@ var a = {
|
|
|
58
68
|
"f10e",
|
|
59
69
|
"M448 296c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72zm-256 0c0 66.3-53.7 120-120 120l-8 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l8 0c30.9 0 56-25.1 56-56l0-8-64 0c-35.3 0-64-28.7-64-64l0-64c0-35.3 28.7-64 64-64l64 0c35.3 0 64 28.7 64 64l0 32 0 32 0 72z"
|
|
60
70
|
]
|
|
61
|
-
},
|
|
71
|
+
}, r = {
|
|
62
72
|
prefix: "fas",
|
|
63
73
|
iconName: "phone",
|
|
64
74
|
icon: [
|
|
@@ -73,8 +83,9 @@ export {
|
|
|
73
83
|
i as a,
|
|
74
84
|
l as b,
|
|
75
85
|
a as c,
|
|
76
|
-
|
|
77
|
-
|
|
86
|
+
r as d,
|
|
87
|
+
f as e,
|
|
78
88
|
e as f,
|
|
79
|
-
|
|
89
|
+
s as g,
|
|
90
|
+
o as h
|
|
80
91
|
};
|
package/dist/statistics.js
CHANGED
|
@@ -1,24 +1,14 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { tv as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { useState as g } from "react";
|
|
3
|
+
import { tv as d } from "tailwind-variants";
|
|
4
|
+
import { u as a } from "./use-resize-observer-DmddO4OQ.js";
|
|
5
|
+
import { StatisticsContext as m } from "./statistics-context.js";
|
|
6
|
+
import { StatisticsItem as h } from "./statistics-item.js";
|
|
7
|
+
import { StatisticsItemImage as w } from "./statistics-item-image.js";
|
|
8
|
+
import { StatisticsItemRepresents as I } from "./statistics-item-represents.js";
|
|
8
9
|
import { StatisticsItemValue as C } from "./statistics-item-value.js";
|
|
9
|
-
function
|
|
10
|
-
const [i, s] =
|
|
11
|
-
return g(() => {
|
|
12
|
-
if (!e.current) return;
|
|
13
|
-
const o = new ResizeObserver((l, t) => {
|
|
14
|
-
const r = l[0];
|
|
15
|
-
r && s(r);
|
|
16
|
-
});
|
|
17
|
-
return o.observe(e.current), () => o.disconnect();
|
|
18
|
-
}, [e.current]), [e, i];
|
|
19
|
-
}
|
|
20
|
-
function v({ children: i, variant: s }) {
|
|
21
|
-
const [e, o] = c(0), [l, t] = m(), r = a({
|
|
10
|
+
function f({ children: e, variant: o }) {
|
|
11
|
+
const [i, r] = g(0), [l, s] = a(), u = d({
|
|
22
12
|
base: "uofg-statistics uog:mx-auto uog:my-4 uog:flex uog:flex-col uog:flex-wrap uog:sm:flex-row",
|
|
23
13
|
variants: {
|
|
24
14
|
divisibleByTwo: {
|
|
@@ -56,38 +46,38 @@ function v({ children: i, variant: s }) {
|
|
|
56
46
|
}
|
|
57
47
|
]
|
|
58
48
|
});
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
|
|
49
|
+
return /* @__PURE__ */ t(
|
|
50
|
+
m.Provider,
|
|
61
51
|
{
|
|
62
52
|
value: {
|
|
63
|
-
variant:
|
|
64
|
-
incrementCount: () =>
|
|
53
|
+
variant: o,
|
|
54
|
+
incrementCount: () => r((c) => c + 1)
|
|
65
55
|
},
|
|
66
|
-
children: /* @__PURE__ */
|
|
56
|
+
children: /* @__PURE__ */ t(
|
|
67
57
|
"dl",
|
|
68
58
|
{
|
|
69
|
-
className:
|
|
70
|
-
variant:
|
|
71
|
-
divisibleByTwo:
|
|
72
|
-
divisibleByThree:
|
|
73
|
-
divisibleByFour:
|
|
59
|
+
className: u({
|
|
60
|
+
variant: o,
|
|
61
|
+
divisibleByTwo: i % 2 === 0,
|
|
62
|
+
divisibleByThree: i % 3 === 0,
|
|
63
|
+
divisibleByFour: i % 4 === 0
|
|
74
64
|
}),
|
|
75
65
|
style: (
|
|
76
66
|
/* @ts-expect-error TypeScript doesn't like CSS Variables */
|
|
77
|
-
|
|
67
|
+
o === "solid-colors-full" ? { "--statistic-bg-width": (s == null ? void 0 : s.contentRect.width) + "px" } : void 0
|
|
78
68
|
),
|
|
79
69
|
ref: l,
|
|
80
|
-
children:
|
|
70
|
+
children: e
|
|
81
71
|
}
|
|
82
72
|
)
|
|
83
73
|
}
|
|
84
74
|
);
|
|
85
75
|
}
|
|
86
|
-
|
|
76
|
+
f.displayName = "Statistics";
|
|
87
77
|
export {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
78
|
+
f as Statistics,
|
|
79
|
+
h as StatisticsItem,
|
|
80
|
+
w as StatisticsItemImage,
|
|
81
|
+
I as StatisticsItemRepresents,
|
|
92
82
|
C as StatisticsItemValue
|
|
93
83
|
};
|
package/dist/text-input.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as s, jsx as u } from "react/jsx-runtime";
|
|
2
|
-
import { h as v } from "./regular-
|
|
2
|
+
import { h as v } from "./regular-23gOebKJ.js";
|
|
3
3
|
import { FontAwesomeIcon as w } from "@fortawesome/react-fontawesome";
|
|
4
4
|
import { Field as h, Label as y, Input as N } from "@headlessui/react";
|
|
5
5
|
import { useState as j, useRef as B } from "react";
|
|
@@ -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
|
}
|