@uoguelph/react-components 1.3.13 → 1.4.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.
- package/dist/accordion-button.js +22 -22
- package/dist/accordion-content.js +5 -5
- package/dist/accordion.js +3 -3
- package/dist/alert-footer.js +6 -6
- package/dist/alert-message.js +7 -10
- package/dist/alert-subtitle.js +7 -7
- package/dist/alert-title.js +23 -23
- package/dist/alert.js +7 -7
- package/dist/blockquote-author-name.js +1 -1
- package/dist/blockquote-author-title.js +2 -2
- package/dist/blockquote-author.js +11 -11
- package/dist/blockquote-content.js +16 -16
- package/dist/breadcrumb-home.js +2 -2
- package/dist/breadcrumb.js +15 -15
- package/dist/breadcrumbs.js +9 -9
- package/dist/button.js +44 -44
- package/dist/card-content.js +10 -10
- package/dist/card-footer.js +11 -11
- package/dist/card-image.js +15 -15
- package/dist/card-title.js +5 -5
- package/dist/card.js +11 -11
- package/dist/carousel.js +51 -51
- package/dist/checkbox.js +44 -44
- package/dist/contact-email.js +7 -7
- package/dist/contact-name.js +1 -1
- package/dist/contact-phone.js +11 -11
- package/dist/contact-title.js +1 -1
- package/dist/contact.js +11 -14
- package/dist/container.js +10 -10
- package/dist/dismissible-alert.js +2 -2
- package/dist/divider.js +18 -18
- package/dist/embedded-video-modal-button.js +16 -16
- package/dist/embedded-video.js +29 -29
- package/dist/hero-caption.js +1 -1
- package/dist/hero-content.js +23 -23
- package/dist/hero-link.js +1 -1
- package/dist/hero-title.js +11 -11
- package/dist/hero-video.js +9 -9
- package/dist/hero.js +19 -19
- package/dist/image-overlay.js +48 -48
- package/dist/index.css +1 -1
- package/dist/info.js +16 -16
- package/dist/layout-content.js +3 -3
- package/dist/layout.js +44 -44
- package/dist/link-carousel-content.js +11 -11
- package/dist/link-carousel-item.js +15 -15
- package/dist/link-carousel-link.js +22 -22
- package/dist/link-carousel-links.js +14 -14
- package/dist/link-carousel.js +21 -21
- package/dist/link.js +10 -10
- package/dist/list-item.js +6 -6
- package/dist/list.js +21 -21
- package/dist/loading-indicator.js +29 -29
- package/dist/media-caption.js +34 -34
- package/dist/modal.js +25 -25
- package/dist/navigation-link.js +25 -25
- package/dist/navigation.js +8 -11
- package/dist/number-input.js +46 -46
- package/dist/pagination.js +62 -62
- package/dist/radio-group.js +8 -8
- package/dist/radio.js +19 -19
- package/dist/select-button.js +32 -32
- package/dist/select-option.js +29 -29
- package/dist/select-options.js +27 -27
- package/dist/select.js +7 -7
- package/dist/statistics-item-image.js +9 -9
- package/dist/statistics-item-represents.js +7 -7
- package/dist/statistics-item-value.js +7 -7
- package/dist/statistics-item.js +35 -35
- package/dist/statistics.js +25 -25
- package/dist/story-background-image.js +12 -12
- package/dist/story-background.js +7 -7
- package/dist/story-body.js +5 -8
- package/dist/story-footer.js +12 -12
- package/dist/story-foreground-content.js +4 -4
- package/dist/story-foreground-image.js +15 -15
- package/dist/story-foreground.js +7 -10
- package/dist/story.js +5 -5
- package/dist/tab-list.js +3 -6
- package/dist/tab-panel.js +3 -3
- package/dist/tab.js +26 -26
- package/dist/text-input.js +32 -32
- package/dist/typography.js +22 -22
- package/package.json +2 -2
package/dist/button.js
CHANGED
|
@@ -1,150 +1,150 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { twMerge as
|
|
4
|
-
import { tv as
|
|
5
|
-
const
|
|
6
|
-
function
|
|
7
|
-
as:
|
|
8
|
-
color:
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
import { twMerge as b } from "tailwind-merge";
|
|
4
|
+
import { tv as d } from "tailwind-variants";
|
|
5
|
+
const f = "button";
|
|
6
|
+
function g({
|
|
7
|
+
as: l,
|
|
8
|
+
color: o = "red",
|
|
9
9
|
outlined: s = !1,
|
|
10
|
-
children:
|
|
11
|
-
className:
|
|
12
|
-
disabled:
|
|
13
|
-
...
|
|
10
|
+
children: t,
|
|
11
|
+
className: r,
|
|
12
|
+
disabled: e = !1,
|
|
13
|
+
...c
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
16
|
-
base: "
|
|
15
|
+
const i = l ?? f, u = d({
|
|
16
|
+
base: "inline-flex cursor-pointer items-center justify-center px-6 py-4 text-lg font-medium no-underline shadow-sm transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
17
17
|
variants: {
|
|
18
18
|
color: {
|
|
19
|
-
red: "
|
|
20
|
-
yellow: "
|
|
21
|
-
blue: "
|
|
22
|
-
green: "
|
|
23
|
-
black: "
|
|
19
|
+
red: "focus-visible:ring-red",
|
|
20
|
+
yellow: "focus-visible:ring-yellow",
|
|
21
|
+
blue: "focus-visible:ring-blue",
|
|
22
|
+
green: "focus-visible:ring-green",
|
|
23
|
+
black: "focus-visible:ring-black"
|
|
24
24
|
},
|
|
25
25
|
outlined: {
|
|
26
|
-
true: "
|
|
26
|
+
true: "border-2"
|
|
27
27
|
},
|
|
28
28
|
disabled: {
|
|
29
|
-
true: "
|
|
29
|
+
true: "cursor-not-allowed opacity-50"
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
compoundVariants: [
|
|
33
33
|
{
|
|
34
34
|
color: "red",
|
|
35
35
|
outlined: !1,
|
|
36
|
-
class: "
|
|
36
|
+
class: "bg-red text-red-contrast"
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
39
|
color: "red",
|
|
40
40
|
outlined: !0,
|
|
41
|
-
class: "
|
|
41
|
+
class: "border-red text-red"
|
|
42
42
|
},
|
|
43
43
|
{
|
|
44
44
|
color: "red",
|
|
45
45
|
outlined: !1,
|
|
46
46
|
disabled: !1,
|
|
47
|
-
class: "
|
|
47
|
+
class: "hocus-visible:bg-red-focus"
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
color: "red",
|
|
51
51
|
outlined: !0,
|
|
52
52
|
disabled: !1,
|
|
53
|
-
class: "
|
|
53
|
+
class: "hocus-visible:bg-red hocus-visible:text-red-contrast"
|
|
54
54
|
},
|
|
55
55
|
{
|
|
56
56
|
color: "yellow",
|
|
57
57
|
outlined: !1,
|
|
58
|
-
class: "
|
|
58
|
+
class: "bg-yellow text-yellow-contrast"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
color: "yellow",
|
|
62
62
|
outlined: !0,
|
|
63
|
-
class: "
|
|
63
|
+
class: "border-yellow text-yellow"
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
color: "yellow",
|
|
67
67
|
outlined: !1,
|
|
68
68
|
disabled: !1,
|
|
69
|
-
class: "
|
|
69
|
+
class: "hocus-visible:bg-yellow-focus"
|
|
70
70
|
},
|
|
71
71
|
{
|
|
72
72
|
color: "yellow",
|
|
73
73
|
outlined: !0,
|
|
74
74
|
disabled: !1,
|
|
75
|
-
class: "
|
|
75
|
+
class: "hocus-visible:bg-yellow hocus-visible:text-yellow-contrast"
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
color: "blue",
|
|
79
79
|
outlined: !1,
|
|
80
|
-
class: "
|
|
80
|
+
class: "bg-blue text-blue-contrast"
|
|
81
81
|
},
|
|
82
82
|
{
|
|
83
83
|
color: "blue",
|
|
84
84
|
outlined: !0,
|
|
85
|
-
class: "
|
|
85
|
+
class: "border-blue text-blue"
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
color: "blue",
|
|
89
89
|
outlined: !1,
|
|
90
90
|
disabled: !1,
|
|
91
|
-
class: "
|
|
91
|
+
class: "hocus-visible:bg-blue-focus"
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
color: "blue",
|
|
95
95
|
outlined: !0,
|
|
96
96
|
disabled: !1,
|
|
97
|
-
class: "
|
|
97
|
+
class: "hocus-visible:bg-blue hocus-visible:text-blue-contrast"
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
color: "green",
|
|
101
101
|
outlined: !1,
|
|
102
|
-
class: "
|
|
102
|
+
class: "bg-green text-green-contrast"
|
|
103
103
|
},
|
|
104
104
|
{
|
|
105
105
|
color: "green",
|
|
106
106
|
outlined: !0,
|
|
107
|
-
class: "
|
|
107
|
+
class: "border-green text-green"
|
|
108
108
|
},
|
|
109
109
|
{
|
|
110
110
|
color: "green",
|
|
111
111
|
outlined: !1,
|
|
112
112
|
disabled: !1,
|
|
113
|
-
class: "
|
|
113
|
+
class: "hocus-visible:bg-green-focus"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
color: "green",
|
|
117
117
|
outlined: !0,
|
|
118
118
|
disabled: !1,
|
|
119
|
-
class: "
|
|
119
|
+
class: "hocus-visible:bg-green hocus-visible:text-green-contrast"
|
|
120
120
|
},
|
|
121
121
|
{
|
|
122
122
|
color: "black",
|
|
123
123
|
outlined: !1,
|
|
124
|
-
class: "
|
|
124
|
+
class: "bg-black text-black-contrast"
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
color: "black",
|
|
128
128
|
outlined: !0,
|
|
129
|
-
class: "
|
|
129
|
+
class: "border-black text-black"
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
color: "black",
|
|
133
133
|
outlined: !1,
|
|
134
134
|
disabled: !1,
|
|
135
|
-
class: "
|
|
135
|
+
class: "hocus-visible:bg-black-focus"
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
color: "black",
|
|
139
139
|
outlined: !0,
|
|
140
140
|
disabled: !1,
|
|
141
|
-
class: "
|
|
141
|
+
class: "hocus-visible:bg-black hocus-visible:text-black-contrast"
|
|
142
142
|
}
|
|
143
143
|
]
|
|
144
|
-
}),
|
|
145
|
-
return /* @__PURE__ */
|
|
144
|
+
}), a = b(u({ color: o, outlined: s, disabled: e }), r);
|
|
145
|
+
return /* @__PURE__ */ n(i, { className: `uofg-button ${a}`, disabled: e, ...c, children: t });
|
|
146
146
|
}
|
|
147
|
-
|
|
147
|
+
g.displayName = "Button";
|
|
148
148
|
export {
|
|
149
|
-
|
|
149
|
+
g as Button
|
|
150
150
|
};
|
package/dist/card-content.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as i } from "react/jsx-runtime";
|
|
3
3
|
import { useContext as n } from "react";
|
|
4
|
-
import { twMerge as
|
|
5
|
-
import { tv as
|
|
6
|
-
import { CardContext as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
base: "
|
|
4
|
+
import { twMerge as s } from "tailwind-merge";
|
|
5
|
+
import { tv as a } from "tailwind-variants";
|
|
6
|
+
import { CardContext as l } from "./card-context.js";
|
|
7
|
+
function c({ children: o, className: r }) {
|
|
8
|
+
const t = n(l), e = a({
|
|
9
|
+
base: "flex flex-1 flex-col gap-2 bg-grey-light-bg p-5 text-grey-light-contrast",
|
|
10
10
|
variants: {
|
|
11
11
|
isLink: {
|
|
12
|
-
true: "
|
|
12
|
+
true: "transition-colors group-hocus-visible:bg-yellow group-hocus-visible:text-yellow-contrast"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
return /* @__PURE__ */ i("div", { className: `uofg-card-content ${
|
|
16
|
+
return /* @__PURE__ */ i("div", { className: `uofg-card-content ${s(e({ isLink: (t == null ? void 0 : t.isLink) ?? !1 }), r)}`, children: o });
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
c.displayName = "CardContent";
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
c as CardContent
|
|
21
21
|
};
|
package/dist/card-footer.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
import { tv as
|
|
6
|
-
import { CardContext as
|
|
7
|
-
function
|
|
8
|
-
const
|
|
9
|
-
base: "
|
|
3
|
+
import { useContext as i } from "react";
|
|
4
|
+
import { twMerge as n } from "tailwind-merge";
|
|
5
|
+
import { tv as s } from "tailwind-variants";
|
|
6
|
+
import { CardContext as c } from "./card-context.js";
|
|
7
|
+
function m({ children: t, className: e }) {
|
|
8
|
+
const r = i(c), o = s({
|
|
9
|
+
base: "flex gap-2 bg-grey-light px-5 py-2 text-grey-light-contrast transition-colors",
|
|
10
10
|
variants: {
|
|
11
11
|
centered: {
|
|
12
|
-
true: "
|
|
12
|
+
true: "justify-center"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
|
-
return /* @__PURE__ */ a("div", { className: `uofg-card-footer ${
|
|
16
|
+
return /* @__PURE__ */ a("div", { className: `uofg-card-footer ${n(o({ centered: (r == null ? void 0 : r.centered) ?? !1 }), e)}`, children: t });
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
m.displayName = "CardFooter";
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
m as CardFooter
|
|
21
21
|
};
|
package/dist/card-image.js
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as
|
|
3
|
-
import { useContext as
|
|
4
|
-
import { twMerge as
|
|
2
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
+
import { useContext as g } from "react";
|
|
4
|
+
import { twMerge as u } from "tailwind-merge";
|
|
5
5
|
import { tv as w } from "tailwind-variants";
|
|
6
6
|
import { CardContext as v } from "./card-context.js";
|
|
7
7
|
const C = "img";
|
|
8
8
|
function h({
|
|
9
|
-
as:
|
|
10
|
-
src:
|
|
9
|
+
as: a,
|
|
10
|
+
src: o,
|
|
11
11
|
alt: i,
|
|
12
12
|
width: n,
|
|
13
13
|
height: t,
|
|
14
14
|
className: m,
|
|
15
15
|
...s
|
|
16
16
|
}) {
|
|
17
|
-
const
|
|
17
|
+
const l = a ?? C, r = g(v), c = w({
|
|
18
18
|
slots: {
|
|
19
|
-
container: "
|
|
20
|
-
wrapper: "
|
|
21
|
-
image: "
|
|
19
|
+
container: "w-full overflow-hidden",
|
|
20
|
+
wrapper: "w-full overflow-hidden",
|
|
21
|
+
image: "w-full"
|
|
22
22
|
},
|
|
23
23
|
variants: {
|
|
24
24
|
isLink: {
|
|
25
25
|
true: {
|
|
26
|
-
wrapper: "
|
|
26
|
+
wrapper: "transition-transform duration-200 ease-in-out group-hover:scale-110"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
}), { container:
|
|
31
|
-
return /* @__PURE__ */
|
|
32
|
-
|
|
30
|
+
}), { container: d, wrapper: f, image: p } = c({ isLink: (r == null ? void 0 : r.isLink) ?? !1 });
|
|
31
|
+
return /* @__PURE__ */ e("div", { className: `uofg-card-image-container ${d()}`, children: /* @__PURE__ */ e("div", { className: `uofg-card-image-wrapper ${f()}`, children: /* @__PURE__ */ e(
|
|
32
|
+
l,
|
|
33
33
|
{
|
|
34
34
|
...s,
|
|
35
|
-
src:
|
|
35
|
+
src: o,
|
|
36
36
|
alt: i,
|
|
37
37
|
width: n,
|
|
38
38
|
height: t,
|
|
39
|
-
className: `uofg-card-image ${p(
|
|
39
|
+
className: `uofg-card-image ${u(p(), m)}`
|
|
40
40
|
}
|
|
41
41
|
) }) });
|
|
42
42
|
}
|
package/dist/card-title.js
CHANGED
|
@@ -4,18 +4,18 @@ import { useContext as n } from "react";
|
|
|
4
4
|
import { twMerge as a } from "tailwind-merge";
|
|
5
5
|
import { tv as m } from "tailwind-variants";
|
|
6
6
|
import { CardContext as s } from "./card-context.js";
|
|
7
|
-
function
|
|
7
|
+
function c({ children: t, className: r }) {
|
|
8
8
|
const e = n(s), o = m({
|
|
9
|
-
base: "
|
|
9
|
+
base: "flex text-lg font-bold",
|
|
10
10
|
variants: {
|
|
11
11
|
centered: {
|
|
12
|
-
true: "
|
|
12
|
+
true: "items-center justify-center"
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
return /* @__PURE__ */ i("div", { className: `uofg-card-title ${a(o({ centered: (e == null ? void 0 : e.centered) ?? !1 }), r)}`, children: t });
|
|
17
17
|
}
|
|
18
|
-
|
|
18
|
+
c.displayName = "CardTitle";
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
c as CardTitle
|
|
21
21
|
};
|
package/dist/card.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
-
import { Children as
|
|
4
|
-
import { twMerge as
|
|
5
|
-
import { tv as
|
|
3
|
+
import { Children as u } from "react";
|
|
4
|
+
import { twMerge as c } from "tailwind-merge";
|
|
5
|
+
import { tv as d } from "tailwind-variants";
|
|
6
6
|
import { CardContent as w } from "./card-content.js";
|
|
7
|
-
import { CardContext as
|
|
7
|
+
import { CardContext as p } from "./card-context.js";
|
|
8
8
|
import { CardFooter as A } from "./card-footer.js";
|
|
9
|
-
import { CardImage as
|
|
9
|
+
import { CardImage as g } from "./card-image.js";
|
|
10
10
|
import { CardTitle as F } from "./card-title.js";
|
|
11
11
|
const C = "div";
|
|
12
12
|
function v({
|
|
@@ -16,8 +16,8 @@ function v({
|
|
|
16
16
|
children: o,
|
|
17
17
|
...r
|
|
18
18
|
}) {
|
|
19
|
-
const a = i ?? C,
|
|
20
|
-
base: "
|
|
19
|
+
const a = i ?? C, m = d({
|
|
20
|
+
base: "group focus-visible:ring-light-blue flex flex-col justify-center transition duration-200 ease-in-out focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none",
|
|
21
21
|
variants: {
|
|
22
22
|
isLink: {
|
|
23
23
|
true: ""
|
|
@@ -30,17 +30,17 @@ function v({
|
|
|
30
30
|
{
|
|
31
31
|
isLink: !0,
|
|
32
32
|
hasImage: !1,
|
|
33
|
-
class: "
|
|
33
|
+
class: "transition-colors group-hover:bg-yellow"
|
|
34
34
|
}
|
|
35
35
|
]
|
|
36
|
-
}), e = "href" in r,
|
|
37
|
-
return /* @__PURE__ */ t(a, { ...r, className: `uofg-card ${
|
|
36
|
+
}), e = "href" in r, f = u.toArray(o).some((l) => l.type === g);
|
|
37
|
+
return /* @__PURE__ */ t(a, { ...r, className: `uofg-card ${c(m({ isLink: e, hasImage: f }), n)}`, children: /* @__PURE__ */ t(p.Provider, { value: { isLink: e, centered: s ?? !1 }, children: o }) });
|
|
38
38
|
}
|
|
39
39
|
v.displayName = "Card";
|
|
40
40
|
export {
|
|
41
41
|
v as Card,
|
|
42
42
|
w as CardContent,
|
|
43
43
|
A as CardFooter,
|
|
44
|
-
|
|
44
|
+
g as CardImage,
|
|
45
45
|
F as CardTitle
|
|
46
46
|
};
|
package/dist/carousel.js
CHANGED
|
@@ -1,110 +1,110 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
2
|
+
import { jsxs as m, jsx as a } from "react/jsx-runtime";
|
|
3
3
|
import { b as k, c as I } from "./solid-D19hAF5t.js";
|
|
4
|
-
import { FontAwesomeIcon as
|
|
5
|
-
import { Children as $, useRef as
|
|
4
|
+
import { FontAwesomeIcon as g } from "@fortawesome/react-fontawesome";
|
|
5
|
+
import { Children as $, useRef as x, useState as A, useEffect as F } from "react";
|
|
6
6
|
import { tv as L } from "tailwind-variants";
|
|
7
7
|
import { l as S, b as q, m as w, c as M } from "./math-utils-CnAd98v6.js";
|
|
8
|
-
const R = (
|
|
9
|
-
const
|
|
8
|
+
const R = (c, h, t) => {
|
|
9
|
+
const o = c.scrollLeft, n = performance.now();
|
|
10
10
|
return new Promise((r) => {
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
11
|
+
const f = (e) => {
|
|
12
|
+
const u = e - n, i = q(Math.min(u / t, 1), 0.25, 0, 0.25, 1);
|
|
13
|
+
c.scrollLeft = S(o, h, i), u < t ? requestAnimationFrame(f) : r();
|
|
14
14
|
};
|
|
15
|
-
requestAnimationFrame(
|
|
15
|
+
requestAnimationFrame(f);
|
|
16
16
|
});
|
|
17
17
|
};
|
|
18
|
-
function G({ children:
|
|
19
|
-
const
|
|
18
|
+
function G({ children: c, display: h = 1, loop: t = "none" }) {
|
|
19
|
+
const o = $.count(c), n = Math.max(h, 1), r = x(null), f = x(0), [e, u] = A(0), i = o - n, d = x(!1);
|
|
20
20
|
F(() => {
|
|
21
|
-
var
|
|
21
|
+
var s;
|
|
22
22
|
if (!r.current)
|
|
23
23
|
return;
|
|
24
|
-
const
|
|
25
|
-
(
|
|
26
|
-
|
|
27
|
-
})),
|
|
28
|
-
}, [
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
31
|
-
let
|
|
32
|
-
switch (
|
|
24
|
+
const l = ((s = r.current) == null ? void 0 : s.offsetWidth) / n;
|
|
25
|
+
(t === "jump" || t === "none") && (d.current = !0, R(r.current, l * e, 250).then(() => {
|
|
26
|
+
d.current = !1;
|
|
27
|
+
})), f.current = e;
|
|
28
|
+
}, [e, t, i, n]);
|
|
29
|
+
const b = (l) => {
|
|
30
|
+
if (d.current) return;
|
|
31
|
+
let s;
|
|
32
|
+
switch (t) {
|
|
33
33
|
case "none":
|
|
34
|
-
|
|
34
|
+
s = M(e + l, 0, i);
|
|
35
35
|
break;
|
|
36
36
|
case "jump":
|
|
37
|
-
|
|
37
|
+
s = w(e + l, i + 1);
|
|
38
38
|
break;
|
|
39
39
|
case "continuous":
|
|
40
|
-
|
|
40
|
+
s = w(e + l, o);
|
|
41
41
|
break;
|
|
42
42
|
default:
|
|
43
|
-
|
|
43
|
+
s = 0;
|
|
44
44
|
}
|
|
45
|
-
|
|
45
|
+
u(s);
|
|
46
46
|
}, C = L({
|
|
47
47
|
slots: {
|
|
48
|
-
base: "
|
|
49
|
-
contentContainer: "
|
|
50
|
-
controlContainer: "
|
|
51
|
-
control: "
|
|
48
|
+
base: "relative flex h-fit min-h-[7rem] w-full flex-col-reverse",
|
|
49
|
+
contentContainer: "grid w-full flex-1 grid-cols-[repeat(var(--items),calc(100%/var(--display)))] overflow-x-hidden [&>*]:[grid-row:1]",
|
|
50
|
+
controlContainer: "flex h-16 w-full pt-8 md:contents",
|
|
51
|
+
control: "flex h-full w-16 flex-1 items-center justify-center text-3xl text-blue transition-[transform,color,opacity,visibility] focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none sm:text-6xl md:absolute hocus-visible:text-blue-focus"
|
|
52
52
|
},
|
|
53
53
|
variants: {
|
|
54
54
|
showControls: {
|
|
55
55
|
true: {
|
|
56
|
-
base: "
|
|
56
|
+
base: "sm:px-16"
|
|
57
57
|
},
|
|
58
58
|
false: {
|
|
59
|
-
control: "
|
|
59
|
+
control: "pointer-events-none invisible opacity-0"
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
direction: {
|
|
63
63
|
left: {
|
|
64
|
-
control: "
|
|
64
|
+
control: "left-0 focus-visible:-translate-x-1 hocus-visible:-translate-x-1"
|
|
65
65
|
},
|
|
66
66
|
right: {
|
|
67
|
-
control: "
|
|
67
|
+
control: "right-0 focus-visible:translate-x-1 hocus-visible:translate-x-1"
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
}),
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
/* @__PURE__ */
|
|
71
|
+
}), v = o > n, { base: y, contentContainer: N, controlContainer: j, control: p } = C({ showControls: v });
|
|
72
|
+
return /* @__PURE__ */ m("div", { className: `uofg-carousel ${y()}`, children: [
|
|
73
|
+
v && /* @__PURE__ */ m("div", { className: `uofg-carousel-control-container ${j()}`, children: [
|
|
74
|
+
/* @__PURE__ */ m(
|
|
75
75
|
"button",
|
|
76
76
|
{
|
|
77
|
-
onClick: () =>
|
|
78
|
-
className: `uofg-carousel-shift-left ${
|
|
77
|
+
onClick: () => b(-1),
|
|
78
|
+
className: `uofg-carousel-shift-left ${p({ showControls: !(t === "none" && e === 0), direction: "left" })}`,
|
|
79
79
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
80
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Shift left" }),
|
|
81
|
+
/* @__PURE__ */ a(g, { icon: k })
|
|
82
82
|
]
|
|
83
83
|
}
|
|
84
84
|
),
|
|
85
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ m(
|
|
86
86
|
"button",
|
|
87
87
|
{
|
|
88
|
-
onClick: () =>
|
|
89
|
-
className: `uofg-carousel-shift-right ${
|
|
88
|
+
onClick: () => b(1),
|
|
89
|
+
className: `uofg-carousel-shift-right ${p({ showControls: !(t === "none" && e === i), direction: "right" })}`,
|
|
90
90
|
children: [
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ a("span", { className: "sr-only", children: "Shift right" }),
|
|
92
|
+
/* @__PURE__ */ a(g, { icon: I })
|
|
93
93
|
]
|
|
94
94
|
}
|
|
95
95
|
)
|
|
96
96
|
] }),
|
|
97
|
-
/* @__PURE__ */
|
|
97
|
+
/* @__PURE__ */ a(
|
|
98
98
|
"div",
|
|
99
99
|
{
|
|
100
100
|
className: `uofg-carousel-content-container ${N()}`,
|
|
101
101
|
ref: r,
|
|
102
102
|
style: {
|
|
103
103
|
// Define CSS variables for the grid layout
|
|
104
|
-
"--items":
|
|
105
|
-
"--display":
|
|
104
|
+
"--items": o,
|
|
105
|
+
"--display": n
|
|
106
106
|
},
|
|
107
|
-
children:
|
|
107
|
+
children: c
|
|
108
108
|
}
|
|
109
109
|
)
|
|
110
110
|
] });
|