@uoguelph/react-components 1.3.11 → 1.3.13
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.
|
@@ -8,11 +8,13 @@ type MediaCaptionPropsBase = {
|
|
|
8
8
|
size?: 'small' | 'medium' | 'large';
|
|
9
9
|
position?: 'left' | 'right' | 'above';
|
|
10
10
|
background?: 'none' | 'grey-light' | 'grey-dark';
|
|
11
|
+
/** Whether the media should expand to match the height of the caption. */
|
|
12
|
+
matchCaptionHeight?: boolean;
|
|
11
13
|
className?: string;
|
|
12
14
|
mediaClassName?: string;
|
|
13
15
|
};
|
|
14
16
|
export type MediaCaptionProps<T extends MediaCaptionElementType = typeof defaultElement> = PropsWithChildren<MediaCaptionPropsAs<T> & ComponentPropsWithoutRef<T> & MediaCaptionPropsBase>;
|
|
15
|
-
export declare function MediaCaption<T extends MediaCaptionElementType = typeof defaultElement>({ as, size, position, background, children, src, className, mediaClassName, ...rest }: MediaCaptionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function MediaCaption<T extends MediaCaptionElementType = typeof defaultElement>({ as, size, position, background, children, src, className, mediaClassName, matchCaptionHeight, ...rest }: MediaCaptionProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
16
18
|
export declare namespace MediaCaption {
|
|
17
19
|
var displayName: string;
|
|
18
20
|
}
|
package/dist/image-overlay.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { twMerge as
|
|
1
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge as A } from "tailwind-merge";
|
|
3
3
|
import { tv as w } from "tailwind-variants";
|
|
4
4
|
const z = "img";
|
|
5
5
|
function x({
|
|
@@ -12,7 +12,7 @@ function x({
|
|
|
12
12
|
className: u,
|
|
13
13
|
verticalAlignment: s = "center",
|
|
14
14
|
horizontalAlignment: c = "center",
|
|
15
|
-
overlay:
|
|
15
|
+
overlay: a = "none",
|
|
16
16
|
blurred: m = !1,
|
|
17
17
|
...v
|
|
18
18
|
}) {
|
|
@@ -32,12 +32,14 @@ function x({
|
|
|
32
32
|
},
|
|
33
33
|
overlay: {
|
|
34
34
|
dark: {
|
|
35
|
+
base: "dark",
|
|
35
36
|
overlay: "uog:bg-black/60"
|
|
36
37
|
},
|
|
37
38
|
light: {
|
|
38
39
|
overlay: "uog:bg-white/60"
|
|
39
40
|
},
|
|
40
41
|
"dark-gradient": {
|
|
42
|
+
base: "dark",
|
|
41
43
|
overlay: "uog:from-black/50 uog:via-30% uog:via-black/20 uog:to-transparent"
|
|
42
44
|
},
|
|
43
45
|
"light-gradient": {
|
|
@@ -117,15 +119,15 @@ function x({
|
|
|
117
119
|
imageWrapper: h,
|
|
118
120
|
image: b,
|
|
119
121
|
overlay: p,
|
|
120
|
-
container:
|
|
121
|
-
} = f({ blurred: m, overlay:
|
|
122
|
-
return /* @__PURE__ */
|
|
123
|
-
/* @__PURE__ */
|
|
122
|
+
container: k
|
|
123
|
+
} = f({ blurred: m, overlay: a, verticalAlignment: s, horizontalAlignment: c });
|
|
124
|
+
return /* @__PURE__ */ o("div", { className: `uofg-image-overlay ${y()}`, children: [
|
|
125
|
+
/* @__PURE__ */ o("div", { className: `uofg-image-overlay-wrapper ${h()}`, children: [
|
|
124
126
|
/* @__PURE__ */ e(
|
|
125
127
|
d,
|
|
126
128
|
{
|
|
127
129
|
...v,
|
|
128
|
-
className: `uofg-image-overlay-image ${
|
|
130
|
+
className: `uofg-image-overlay-image ${A(b(), u)}`,
|
|
129
131
|
src: r,
|
|
130
132
|
width: g,
|
|
131
133
|
height: l,
|
|
@@ -133,9 +135,9 @@ function x({
|
|
|
133
135
|
sizes: "100vw"
|
|
134
136
|
}
|
|
135
137
|
),
|
|
136
|
-
|
|
138
|
+
a !== "none" && /* @__PURE__ */ e("div", { className: `uofg-image-overlay-overlay ${p()}` })
|
|
137
139
|
] }),
|
|
138
|
-
/* @__PURE__ */ e("div", { className: `uofg-image-overlay-content ${
|
|
140
|
+
/* @__PURE__ */ e("div", { className: `uofg-image-overlay-content ${k()}`, children: n })
|
|
139
141
|
] });
|
|
140
142
|
}
|
|
141
143
|
x.displayName = "ImageOverlay";
|
package/dist/media-caption.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { twMerge as
|
|
1
|
+
import { jsxs as b, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge as h } from "tailwind-merge";
|
|
3
3
|
import { tv as x } from "tailwind-variants";
|
|
4
4
|
import { EmbeddedVideo as y } from "./embedded-video.js";
|
|
5
|
-
const
|
|
6
|
-
function
|
|
5
|
+
const v = "img";
|
|
6
|
+
function k({
|
|
7
7
|
as: e,
|
|
8
8
|
size: o = "small",
|
|
9
9
|
position: s = "left",
|
|
@@ -11,12 +11,13 @@ function v({
|
|
|
11
11
|
children: r,
|
|
12
12
|
src: g,
|
|
13
13
|
className: n,
|
|
14
|
-
mediaClassName:
|
|
14
|
+
mediaClassName: C,
|
|
15
|
+
matchCaptionHeight: l,
|
|
15
16
|
...d
|
|
16
17
|
}) {
|
|
17
|
-
const i = e ??
|
|
18
|
+
const i = e ?? v;
|
|
18
19
|
o = (i instanceof y ? "video" : "image") === "video" && o === "small" ? "medium" : o;
|
|
19
|
-
const
|
|
20
|
+
const p = x({
|
|
20
21
|
slots: {
|
|
21
22
|
base: "uofg-media-caption uog:flex uog:flex-col",
|
|
22
23
|
mediaWrapper: "uofg-media-caption-wrapper",
|
|
@@ -44,14 +45,17 @@ function v({
|
|
|
44
45
|
},
|
|
45
46
|
background: {
|
|
46
47
|
"grey-light": {
|
|
47
|
-
base: "light"
|
|
48
|
-
caption: "uog:bg-grey-light-bg uog:text-body-copy"
|
|
48
|
+
base: "light uog:bg-grey-light-bg uog:text-body-copy"
|
|
49
49
|
},
|
|
50
50
|
"grey-dark": {
|
|
51
|
-
base: "dark"
|
|
52
|
-
caption: "uog:bg-grey-dark-bg uog:text-body-copy-on-dark"
|
|
51
|
+
base: "dark uog:bg-grey-dark-bg uog:text-body-copy-on-dark"
|
|
53
52
|
},
|
|
54
53
|
none: {}
|
|
54
|
+
},
|
|
55
|
+
matchCaptionHeight: {
|
|
56
|
+
true: {
|
|
57
|
+
media: "uog:h-full"
|
|
58
|
+
}
|
|
55
59
|
}
|
|
56
60
|
},
|
|
57
61
|
compoundVariants: [
|
|
@@ -119,13 +123,13 @@ function v({
|
|
|
119
123
|
}
|
|
120
124
|
}
|
|
121
125
|
]
|
|
122
|
-
}), { base:
|
|
123
|
-
return /* @__PURE__ */
|
|
124
|
-
/* @__PURE__ */ a("div", { className:
|
|
125
|
-
/* @__PURE__ */ a("div", { className:
|
|
126
|
+
}), { base: c, mediaWrapper: m, media: u, caption: f } = p({ size: o, position: s, background: t, matchCaptionHeight: l });
|
|
127
|
+
return /* @__PURE__ */ b("div", { className: h(c(), n), children: [
|
|
128
|
+
/* @__PURE__ */ a("div", { className: m(), children: /* @__PURE__ */ a(i, { ...d, src: g, className: u() }) }),
|
|
129
|
+
/* @__PURE__ */ a("div", { className: f(), children: r })
|
|
126
130
|
] });
|
|
127
131
|
}
|
|
128
|
-
|
|
132
|
+
k.displayName = "MediaCaption";
|
|
129
133
|
export {
|
|
130
|
-
|
|
134
|
+
k as MediaCaption
|
|
131
135
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uoguelph/react-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.13",
|
|
4
4
|
"description": "University of Guelph React Components Library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
"bugs": {
|
|
77
77
|
"url": "https://github.com/ccswbs/uofg-components/issues"
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "c05a7bc222922450ffa1f751b53444d41bcc85e0"
|
|
80
80
|
}
|