@uoguelph/react-components 1.3.11 → 1.3.12

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
  }
@@ -1,9 +1,9 @@
1
- import { jsxs as f, jsx as a } from "react/jsx-runtime";
2
- import { twMerge as b } from "tailwind-merge";
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 h = "img";
6
- function v({
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: k,
14
+ mediaClassName: C,
15
+ matchCaptionHeight: l,
15
16
  ...d
16
17
  }) {
17
- const i = e ?? h;
18
+ const i = e ?? v;
18
19
  o = (i instanceof y ? "video" : "image") === "video" && o === "small" ? "medium" : o;
19
- const l = x({
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: p, mediaWrapper: c, media: m, caption: u } = l({ size: o, position: s, background: t });
123
- return /* @__PURE__ */ f("div", { className: b(p(), n), children: [
124
- /* @__PURE__ */ a("div", { className: c(), children: /* @__PURE__ */ a(i, { ...d, src: g, className: m() }) }),
125
- /* @__PURE__ */ a("div", { className: u(), children: r })
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
- v.displayName = "MediaCaption";
132
+ k.displayName = "MediaCaption";
129
133
  export {
130
- v as MediaCaption
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.11",
3
+ "version": "1.3.12",
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": "7b145d50f6994437ccdcdbd8ad65a7fa9017073c"
79
+ "gitHead": "5a84ad72bdaeb2e42c615a263e10304dfd11b681"
80
80
  }