@uoguelph/react-components 1.0.0-rc.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.
Files changed (126) hide show
  1. package/README.md +3 -0
  2. package/dist/accordion-button.d.ts +16 -0
  3. package/dist/accordion-button.js +42 -0
  4. package/dist/accordion-content.d.ts +15 -0
  5. package/dist/accordion-content.js +14 -0
  6. package/dist/accordion-context.d.ts +9 -0
  7. package/dist/accordion-context.js +5 -0
  8. package/dist/accordion.d.ts +42 -0
  9. package/dist/accordion.js +16 -0
  10. package/dist/alert-footer.d.ts +16 -0
  11. package/dist/alert-footer.js +10 -0
  12. package/dist/alert-message.d.ts +16 -0
  13. package/dist/alert-message.js +13 -0
  14. package/dist/alert-subtitle.d.ts +16 -0
  15. package/dist/alert-subtitle.js +10 -0
  16. package/dist/alert-title.d.ts +22 -0
  17. package/dist/alert-title.js +50 -0
  18. package/dist/alert.d.ts +70 -0
  19. package/dist/alert.js +18 -0
  20. package/dist/blockquote.d.ts +22 -0
  21. package/dist/blockquote.js +43 -0
  22. package/dist/breadcrumb-home.d.ts +32 -0
  23. package/dist/breadcrumb-home.js +21 -0
  24. package/dist/breadcrumb.d.ts +32 -0
  25. package/dist/breadcrumb.js +30 -0
  26. package/dist/breadcrumbs.d.ts +54 -0
  27. package/dist/breadcrumbs.js +15 -0
  28. package/dist/button.d.ts +51 -0
  29. package/dist/button.js +218 -0
  30. package/dist/card-content.d.ts +15 -0
  31. package/dist/card-content.js +20 -0
  32. package/dist/card-context.d.ts +10 -0
  33. package/dist/card-context.js +5 -0
  34. package/dist/card-footer.d.ts +16 -0
  35. package/dist/card-footer.js +20 -0
  36. package/dist/card-image.d.ts +40 -0
  37. package/dist/card-image.js +45 -0
  38. package/dist/card-title.d.ts +16 -0
  39. package/dist/card-title.js +20 -0
  40. package/dist/card.d.ts +105 -0
  41. package/dist/card.js +45 -0
  42. package/dist/carousel.d.ts +25 -0
  43. package/dist/carousel.js +113 -0
  44. package/dist/checkbox.d.ts +39 -0
  45. package/dist/checkbox.js +99 -0
  46. package/dist/contact-email.d.ts +17 -0
  47. package/dist/contact-email.js +21 -0
  48. package/dist/contact-name.d.ts +16 -0
  49. package/dist/contact-name.js +10 -0
  50. package/dist/contact-phone.d.ts +19 -0
  51. package/dist/contact-phone.js +25 -0
  52. package/dist/contact-title.d.ts +16 -0
  53. package/dist/contact-title.js +10 -0
  54. package/dist/contact.d.ts +73 -0
  55. package/dist/contact.js +18 -0
  56. package/dist/container.d.ts +32 -0
  57. package/dist/container.js +25 -0
  58. package/dist/divider.d.ts +6 -0
  59. package/dist/divider.js +30 -0
  60. package/dist/embedded-video-context.d.ts +10 -0
  61. package/dist/embedded-video-context.js +5 -0
  62. package/dist/embedded-video-modal-button.d.ts +54 -0
  63. package/dist/embedded-video-modal-button.js +25 -0
  64. package/dist/embedded-video.d.ts +81 -0
  65. package/dist/embedded-video.js +108 -0
  66. package/dist/hero-caption.d.ts +15 -0
  67. package/dist/hero-caption.js +8 -0
  68. package/dist/hero-content.d.ts +20 -0
  69. package/dist/hero-content.js +47 -0
  70. package/dist/hero-context.d.ts +9 -0
  71. package/dist/hero-context.js +5 -0
  72. package/dist/hero-link.d.ts +29 -0
  73. package/dist/hero-link.js +26 -0
  74. package/dist/hero-title.d.ts +24 -0
  75. package/dist/hero-title.js +26 -0
  76. package/dist/hero-video.d.ts +22 -0
  77. package/dist/hero-video.js +27 -0
  78. package/dist/hero.d.ts +141 -0
  79. package/dist/hero.js +52 -0
  80. package/dist/image-overlay.d.ts +66 -0
  81. package/dist/image-overlay.js +144 -0
  82. package/dist/index.css +1 -0
  83. package/dist/index.d.ts +11 -0
  84. package/dist/index.js +33 -0
  85. package/dist/info.d.ts +19 -0
  86. package/dist/info.js +24 -0
  87. package/dist/link-carousel-content.d.ts +11 -0
  88. package/dist/link-carousel-content.js +20 -0
  89. package/dist/link-carousel-context.d.ts +30 -0
  90. package/dist/link-carousel-context.js +5 -0
  91. package/dist/link-carousel-item.d.ts +15 -0
  92. package/dist/link-carousel-item.js +21 -0
  93. package/dist/link-carousel-link.d.ts +34 -0
  94. package/dist/link-carousel-link.js +39 -0
  95. package/dist/link-carousel-links.d.ts +11 -0
  96. package/dist/link-carousel-links.js +24 -0
  97. package/dist/link-carousel.d.ts +83 -0
  98. package/dist/link-carousel.js +57 -0
  99. package/dist/link.d.ts +30 -0
  100. package/dist/link.js +28 -0
  101. package/dist/list-item.d.ts +17 -0
  102. package/dist/list-item.js +9 -0
  103. package/dist/list.d.ts +39 -0
  104. package/dist/list.js +31 -0
  105. package/dist/loading-indicator.d.ts +23 -0
  106. package/dist/loading-indicator.js +75 -0
  107. package/dist/math-utils-BwzyIQRL.js +50 -0
  108. package/dist/media-caption.d.ts +110 -0
  109. package/dist/media-caption.js +129 -0
  110. package/dist/modal.d.ts +18 -0
  111. package/dist/modal.js +39 -0
  112. package/dist/navigation-link.d.ts +29 -0
  113. package/dist/navigation-link.js +40 -0
  114. package/dist/navigation.d.ts +40 -0
  115. package/dist/navigation.js +15 -0
  116. package/dist/radio-context.d.ts +9 -0
  117. package/dist/radio-context.js +5 -0
  118. package/dist/radio-group.d.ts +28 -0
  119. package/dist/radio-group.js +37 -0
  120. package/dist/radio.d.ts +13 -0
  121. package/dist/radio.js +36 -0
  122. package/dist/regular-CYeGUuiO.js +91 -0
  123. package/dist/solid-DM6GVhkF.js +80 -0
  124. package/dist/typography.d.ts +29 -0
  125. package/dist/typography.js +31 -0
  126. package/package.json +76 -0
@@ -0,0 +1,25 @@
1
+ import { jsxs as i, jsx as o } from "react/jsx-runtime";
2
+ import { e as s } from "./solid-DM6GVhkF.js";
3
+ import { FontAwesomeIcon as m } from "@fortawesome/react-fontawesome";
4
+ import { useContext as l } from "react";
5
+ import { twMerge as u } from "tailwind-merge";
6
+ import { Button as a } from "./button.js";
7
+ import { EmbeddedVideoContext as w } from "./embedded-video-context.js";
8
+ function p({ type: e, children: n, className: r }) {
9
+ const t = l(w);
10
+ if (e === "play-button") {
11
+ const d = u(
12
+ "tw:flex tw:aspect-square tw:w-24 tw:items-center tw:justify-center tw:rounded-full tw:bg-black/30 tw:text-4xl tw:text-white tw:transition-colors tw:hover:bg-red/30 tw:focus:bg-red/30",
13
+ r
14
+ );
15
+ return /* @__PURE__ */ i("button", { type: "button", className: d, onClick: () => t == null ? void 0 : t.setModalOpen(!0), children: [
16
+ /* @__PURE__ */ o(m, { icon: s }),
17
+ /* @__PURE__ */ o("span", { className: "sr-only", children: "Show Video" })
18
+ ] });
19
+ }
20
+ return /* @__PURE__ */ o(a, { type: "button", color: e, className: r, onClick: () => t == null ? void 0 : t.setModalOpen(!0), children: n });
21
+ }
22
+ p.displayName = "EmbeddedVideoModalButton";
23
+ export {
24
+ p as EmbeddedVideoModalButton
25
+ };
@@ -0,0 +1,81 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ import { ElementType } from 'react';
3
+ import { JSX } from 'react/jsx-runtime';
4
+ import { PropsWithChildren } from 'react';
5
+ import { ReactElement } from 'react';
6
+
7
+ declare type ButtonElementType = ElementType<{
8
+ href?: string;
9
+ }, 'a'> | 'button';
10
+
11
+ declare type ButtonProps<T extends ButtonElementType = typeof defaultElement> = PropsWithChildren<ButtonPropsAs<T> & ComponentPropsWithoutRef<T> & ButtonPropsBase>;
12
+
13
+ declare type ButtonPropsAs<T extends ButtonElementType> = {
14
+ as?: T;
15
+ };
16
+
17
+ declare type ButtonPropsBase = {
18
+ /**
19
+ * The color of the button
20
+ *
21
+ * @default 'red'
22
+ */
23
+ color?: 'red' | 'yellow' | 'blue' | 'green' | 'light-grey' | 'dark-grey' | 'black' | 'white';
24
+ /**
25
+ * Whether the button should be outlined
26
+ *
27
+ * @default false
28
+ */
29
+ outlined?: boolean;
30
+ /** Additional classes to apply to the button */
31
+ className?: string;
32
+ /**
33
+ * Whether the button is disabled
34
+ *
35
+ * @default false
36
+ */
37
+ disabled?: boolean;
38
+ };
39
+
40
+ declare const defaultElement = "button";
41
+
42
+ /**
43
+ * The EmbeddedVideo component is used for embedding videos from YouTube and Vimeo. It can be used to render a video
44
+ * directly or as a modal.
45
+ */
46
+ export declare function EmbeddedVideo({ src, title, transcript, className, children }: EmbeddedVideoProps): JSX.Element;
47
+
48
+ export declare namespace EmbeddedVideo {
49
+ var displayName: string;
50
+ }
51
+
52
+ export declare function EmbeddedVideoModalButton({ type, children, className }: EmbeddedVideoModalButtonProps): JSX.Element;
53
+
54
+ export declare namespace EmbeddedVideoModalButton {
55
+ var displayName: string;
56
+ }
57
+
58
+ declare type EmbeddedVideoModalButtonProps = PropsWithChildren<{
59
+ /** The type of button to render, either a play button or a color which will be passed to a Button component */
60
+ type: 'play-button' | ButtonProps['color'];
61
+ /** Additional classes to apply to the button */
62
+ className?: string;
63
+ }>;
64
+
65
+ declare type EmbeddedVideoProps = VideoProps & {
66
+ /** If passed the video will render as a modal, with the button being used to open the video. */
67
+ children?: ReactElement<typeof EmbeddedVideoModalButton>;
68
+ };
69
+
70
+ declare type VideoProps = {
71
+ /** The URL of the video to embed. */
72
+ src: string;
73
+ /** The title of the video. */
74
+ title?: string;
75
+ /** The URL to a human readable transcript of the video. */
76
+ transcript?: string;
77
+ /** Additional classes to apply to the video container. */
78
+ className?: string;
79
+ };
80
+
81
+ export { }
@@ -0,0 +1,108 @@
1
+ import { jsxs as c, Fragment as p, jsx as n } from "react/jsx-runtime";
2
+ import { useState as g } from "react";
3
+ import { twMerge as f } from "tailwind-merge";
4
+ import { tv as w } from "tailwind-variants";
5
+ import { Button as h } from "./button.js";
6
+ import { Modal as x } from "./modal.js";
7
+ import { EmbeddedVideoContext as y } from "./embedded-video-context.js";
8
+ import { EmbeddedVideoModalButton as D } from "./embedded-video-modal-button.js";
9
+ function b(l) {
10
+ var o;
11
+ if (!(l instanceof URL))
12
+ return null;
13
+ if (l.searchParams.has("v"))
14
+ return l.searchParams.get("v");
15
+ const e = (o = l.pathname.split("/")) == null ? void 0 : o.filter((t) => t !== "");
16
+ switch (e == null ? void 0 : e[0]) {
17
+ case "v":
18
+ case "embed":
19
+ case "watch":
20
+ case "e":
21
+ case "shorts":
22
+ case "live":
23
+ return (e == null ? void 0 : e[1]) ?? null;
24
+ case "oembed":
25
+ return b(new URL(decodeURIComponent(l.searchParams.get("url") ?? "")));
26
+ case "attribution_link":
27
+ return null;
28
+ default:
29
+ return (e == null ? void 0 : e[0]) ?? null;
30
+ }
31
+ }
32
+ function V(l) {
33
+ var o;
34
+ const e = (o = l.pathname.split("/")) == null ? void 0 : o.filter((t) => t !== "");
35
+ return (e == null ? void 0 : e[0]) ?? null;
36
+ }
37
+ function N(l) {
38
+ let e = null, o = null;
39
+ try {
40
+ const t = new URL(l);
41
+ t != null && t.hostname.includes("youtube") || t != null && t.hostname.includes("youtu.be") ? (e = "youtube", o = b(t)) : t != null && t.hostname.includes("vimeo") && (e = "vimeo", o = V(t));
42
+ } catch {
43
+ }
44
+ return { type: e, id: o };
45
+ }
46
+ function u({ src: l, title: e, transcript: o, className: t }) {
47
+ const { id: d, type: i } = N(l), r = w({
48
+ slots: {
49
+ base: f("tw:flex tw:flex-col", t),
50
+ iframe: "tw:w-full tw:h-full tw:aspect-video",
51
+ transcriptButton: "tw:p-3 tw:w-full"
52
+ }
53
+ }), { base: a, iframe: s, transcriptButton: m } = r();
54
+ return /* @__PURE__ */ c("div", { className: a(), children: [
55
+ i === "youtube" && d && /* @__PURE__ */ n(
56
+ "iframe",
57
+ {
58
+ className: s(),
59
+ allowFullScreen: !0,
60
+ src: `https://www.youtube.com/embed/${d}`,
61
+ title: e ?? "YouTube Embedded Video Player"
62
+ }
63
+ ),
64
+ i === "vimeo" && d && /* @__PURE__ */ n(
65
+ "iframe",
66
+ {
67
+ className: s(),
68
+ allowFullScreen: !0,
69
+ src: `https://player.vimeo.com/video/${d}`,
70
+ title: e ?? "Vimeo Embedded Video Player"
71
+ }
72
+ ),
73
+ o && /* @__PURE__ */ n(h, { as: "a", color: "red", className: m(), href: o, download: !0, children: "Download Transcript" })
74
+ ] });
75
+ }
76
+ function E({ src: l, title: e, transcript: o, className: t, children: d }) {
77
+ const [i, r] = g(!1);
78
+ if (d) {
79
+ const a = w({
80
+ slots: {
81
+ container: "tw:bg-dark-grey-bg tw:flex tw:w-screen tw:max-w-6xl tw:lg:max-w-7xl tw:flex-col tw:gap-4 tw:p-4 tw:text-dark-grey-contrast",
82
+ video: "tw:w-full",
83
+ title: "tw:text-xl tw:font-bold"
84
+ }
85
+ }), { container: s, video: m, title: v } = a();
86
+ return /* @__PURE__ */ c(p, { children: [
87
+ /* @__PURE__ */ n(y.Provider, { value: { modalOpen: i, setModalOpen: r }, children: d }),
88
+ /* @__PURE__ */ n(x, { open: i, onClose: () => r(!1), children: /* @__PURE__ */ c("div", { className: `uofg-embedded-video-container ${s()}`, children: [
89
+ /* @__PURE__ */ n("span", { className: `uofg-embedded-video-title ${v()}`, children: e }),
90
+ /* @__PURE__ */ n(
91
+ u,
92
+ {
93
+ src: l,
94
+ title: e,
95
+ transcript: o,
96
+ className: `uofg-embedded-video ${f(m(), t)}`
97
+ }
98
+ )
99
+ ] }) })
100
+ ] });
101
+ }
102
+ return /* @__PURE__ */ n(u, { src: l, title: e, transcript: o, className: `uofg-embedded-video ${t}` });
103
+ }
104
+ E.displayName = "EmbeddedVideo";
105
+ export {
106
+ E as EmbeddedVideo,
107
+ D as EmbeddedVideoModalButton
108
+ };
@@ -0,0 +1,15 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ export declare function HeroCaption({ children, className }: HeroCaptionProps): JSX.Element;
5
+
6
+ export declare namespace HeroCaption {
7
+ var displayName: string;
8
+ }
9
+
10
+ export declare type HeroCaptionProps = PropsWithChildren<{
11
+ /** Additional classes to apply to the caption */
12
+ className?: string;
13
+ }>;
14
+
15
+ export { }
@@ -0,0 +1,8 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ function r({ children: o, className: t }) {
3
+ return /* @__PURE__ */ e("p", { className: `uofg-hero-caption tw:text-xl ${t}`, children: o });
4
+ }
5
+ r.displayName = "HeroCaption";
6
+ export {
7
+ r as HeroCaption
8
+ };
@@ -0,0 +1,20 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ /** The HeroContent component is used to display the content of a hero. */
5
+ export declare function HeroContent({ children, alignment }: HeroContentProps): JSX.Element;
6
+
7
+ export declare namespace HeroContent {
8
+ var displayName: string;
9
+ }
10
+
11
+ export declare type HeroContentProps = PropsWithChildren<{
12
+ /**
13
+ * The alignment of the content
14
+ *
15
+ * @default 'left'
16
+ */
17
+ alignment?: 'left' | 'center' | 'right' | 'fullWidth';
18
+ }>;
19
+
20
+ export { }
@@ -0,0 +1,47 @@
1
+ import { jsx as e } from "react/jsx-runtime";
2
+ import { useContext as i } from "react";
3
+ import { tv as m } from "tailwind-variants";
4
+ import { Container as s } from "./container.js";
5
+ import { HeroContext as g } from "./hero-context.js";
6
+ function c({ children: r, alignment: o = "left" }) {
7
+ const t = i(g), l = m({
8
+ slots: {
9
+ base: "",
10
+ wrapper: "tw:lg:bg-black/80 tw:lg:backdrop-blur tw:flex tw:w-full tw:bg-black tw:p-7 tw:text-white",
11
+ container: "tw:container tw:mx-auto tw:flex tw:flex-col tw:gap-5"
12
+ },
13
+ variants: {
14
+ variant: {
15
+ spotlight: {
16
+ base: "tw:lg:container tw:lg:absolute tw:lg:bottom-0 tw:lg:left-1/2 tw:lg:max-w-max-content tw:lg:-translate-x-1/2 tw:lg:p-4 tw:flex tw:items-center"
17
+ },
18
+ basic: {
19
+ base: "tw:absolute tw:bottom-0 tw:left-1/2 tw:w-full tw:-translate-x-1/2 tw:p-0 tw:flex tw:h-full tw:items-end"
20
+ }
21
+ },
22
+ alignment: {
23
+ left: {
24
+ wrapper: "tw:mr-auto tw:lg:max-w-[50%]"
25
+ },
26
+ center: {
27
+ wrapper: "tw:mx-auto tw:lg:max-w-[50%]",
28
+ container: "tw:lg:text-center tw:lg:items-center",
29
+ link: "tw:lg:mx-auto"
30
+ },
31
+ right: {
32
+ wrapper: "tw:ml-auto tw:lg:max-w-[50%]",
33
+ container: "tw:lg:text-right tw:lg:items-end",
34
+ link: "tw:lg:ml-auto"
35
+ },
36
+ fullWidth: {
37
+ wrapper: "tw:mx-auto"
38
+ }
39
+ }
40
+ }
41
+ }), { base: a, wrapper: n, container: w } = l({ alignment: o, variant: t == null ? void 0 : t.variant });
42
+ return (t == null ? void 0 : t.variant) === "spotlight" ? /* @__PURE__ */ e("div", { className: `uofg-hero-content ${a()}`, children: /* @__PURE__ */ e("div", { className: `uofg-hero-content-wrapper ${n()}`, children: /* @__PURE__ */ e("div", { className: `uofg-hero-content-container ${w()}`, children: r }) }) }) : /* @__PURE__ */ e(s, { centered: !0, className: `uofg-hero-content ${a()}`, children: r });
43
+ }
44
+ c.displayName = "HeroContent";
45
+ export {
46
+ c as HeroContent
47
+ };
@@ -0,0 +1,9 @@
1
+ import { Context } from 'react';
2
+
3
+ export declare const HeroContext: Context<HeroContextType | null>;
4
+
5
+ export declare type HeroContextType = {
6
+ variant: 'spotlight' | 'basic';
7
+ };
8
+
9
+ export { }
@@ -0,0 +1,5 @@
1
+ import { createContext as t } from "react";
2
+ const e = t(null);
3
+ export {
4
+ e as HeroContext
5
+ };
@@ -0,0 +1,29 @@
1
+ import { ElementType } from 'react';
2
+ import { JSX } from 'react/jsx-runtime';
3
+ import { PropsWithChildren } from 'react';
4
+
5
+ /** The HeroLink component is used to display a link within a hero. */
6
+ export declare function HeroLink<T extends HeroLinkElementType = 'a'>({ as, href, children, className, ...rest }: HeroLinkProps<T>): JSX.Element;
7
+
8
+ export declare namespace HeroLink {
9
+ var displayName: string;
10
+ }
11
+
12
+ export declare type HeroLinkElementType = ElementType<{
13
+ href?: string;
14
+ }, 'a'>;
15
+
16
+ export declare type HeroLinkProps<T extends HeroLinkElementType = 'a'> = PropsWithChildren<{
17
+ /**
18
+ * The element type to render the link as
19
+ *
20
+ * @default 'a'
21
+ */
22
+ as?: T;
23
+ /** The URL to link to */
24
+ href: string;
25
+ /** Additional classes to apply to the link */
26
+ className?: string;
27
+ }>;
28
+
29
+ export { }
@@ -0,0 +1,26 @@
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import { twMerge as i } from "tailwind-merge";
3
+ import { Button as p } from "./button.js";
4
+ function a({
5
+ as: o,
6
+ href: t,
7
+ children: r,
8
+ className: e,
9
+ ...n
10
+ }) {
11
+ return /* @__PURE__ */ m(
12
+ p,
13
+ {
14
+ ...n,
15
+ as: o ?? "a",
16
+ color: "yellow",
17
+ href: t,
18
+ className: `uofg-hero-link ${i("tw:p-3 tw:w-fit", e)}`,
19
+ children: r
20
+ }
21
+ );
22
+ }
23
+ a.displayName = "HeroLink";
24
+ export {
25
+ a as HeroLink
26
+ };
@@ -0,0 +1,24 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ /** The HeroTitle component is used to display the title of a hero. */
5
+ export declare function HeroTitle<T extends HeroTitleElementType = 'h1'>({ as, children, className, ...rest }: HeroTitleProps<T>): JSX.Element;
6
+
7
+ export declare namespace HeroTitle {
8
+ var displayName: string;
9
+ }
10
+
11
+ export declare type HeroTitleElementType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
12
+
13
+ export declare type HeroTitleProps<T extends HeroTitleElementType = 'h1'> = PropsWithChildren<{
14
+ /**
15
+ * The element type to render the title as
16
+ *
17
+ * @default 'h1'
18
+ */
19
+ as?: T;
20
+ /** Additional classes to apply to the title */
21
+ className?: string;
22
+ }>;
23
+
24
+ export { }
@@ -0,0 +1,26 @@
1
+ import { jsx as l } from "react/jsx-runtime";
2
+ import { useContext as m } from "react";
3
+ import { twMerge as w } from "tailwind-merge";
4
+ import { tv as f } from "tailwind-variants";
5
+ import { HeroContext as p } from "./hero-context.js";
6
+ function x({
7
+ as: o,
8
+ children: e,
9
+ className: r,
10
+ ...i
11
+ }) {
12
+ const t = m(p), s = o ?? "h1", n = f({
13
+ base: "tw:font-serif tw:font-bold tw:text-3xl tw:w-fit",
14
+ variants: {
15
+ variant: {
16
+ spotlight: "tw:text-white",
17
+ basic: "tw:bg-yellow tw:md:text-4xl tw:text-yellow-contrast tw:p-1"
18
+ }
19
+ }
20
+ }), a = `uofg-hero-title ${w(n({ variant: t == null ? void 0 : t.variant }), r)}`;
21
+ return /* @__PURE__ */ l(s, { ...i, className: a, children: e });
22
+ }
23
+ x.displayName = "HeroTitle";
24
+ export {
25
+ x as HeroTitle
26
+ };
@@ -0,0 +1,22 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { PropsWithChildren } from 'react';
3
+
4
+ /** The HeroVideo component is used to display a video modal in a hero. */
5
+ export declare function HeroVideo({ src, title, transcript, children }: HeroVideo): JSX.Element;
6
+
7
+ export declare type HeroVideo = PropsWithChildren<{
8
+ /** The URL of the video to embed. */
9
+ src: string;
10
+ /** The title of the video. */
11
+ title: string;
12
+ /** The URL to a human readable transcript of the video. */
13
+ transcript?: string;
14
+ /** Additional classes to apply to the video container */
15
+ className?: string;
16
+ }>;
17
+
18
+ export declare namespace HeroVideo {
19
+ var displayName: string;
20
+ }
21
+
22
+ export { }
@@ -0,0 +1,27 @@
1
+ import { jsx as t, jsxs as d } from "react/jsx-runtime";
2
+ import { e as p } from "./solid-DM6GVhkF.js";
3
+ import { FontAwesomeIcon as l } from "@fortawesome/react-fontawesome";
4
+ import { useContext as f } from "react";
5
+ import { tv as w } from "tailwind-variants";
6
+ import { EmbeddedVideo as s } from "./embedded-video.js";
7
+ import { HeroContext as c } from "./hero-context.js";
8
+ import { EmbeddedVideoModalButton as m } from "./embedded-video-modal-button.js";
9
+ function h({ src: e, title: r, transcript: a, children: n }) {
10
+ const o = f(c), i = `uofg-hero-video ${w({
11
+ base: "",
12
+ variants: {
13
+ variant: {
14
+ basic: "tw:absolute tw:top-1/2 tw:left-1/2 tw:-translate-x-1/2 tw:-translate-y-1/2",
15
+ spotlight: "tw:w-fit tw:gap-2 tw:p-3"
16
+ }
17
+ }
18
+ })({ variant: o == null ? void 0 : o.variant })}`;
19
+ return (o == null ? void 0 : o.variant) === "spotlight" ? /* @__PURE__ */ t(s, { src: e, title: r, transcript: a, children: /* @__PURE__ */ d(m, { type: "yellow", className: i, children: [
20
+ /* @__PURE__ */ t(l, { icon: p }),
21
+ /* @__PURE__ */ t("span", { children: n })
22
+ ] }) }) : /* @__PURE__ */ t(s, { src: e, title: r, transcript: a, children: /* @__PURE__ */ t(m, { type: "play-button", className: i }) });
23
+ }
24
+ h.displayName = "HeroVideo";
25
+ export {
26
+ h as HeroVideo
27
+ };
package/dist/hero.d.ts ADDED
@@ -0,0 +1,141 @@
1
+ import { ComponentPropsWithoutRef } from 'react';
2
+ import { ElementType } from 'react';
3
+ import { JSX } from 'react/jsx-runtime';
4
+ import { PropsWithChildren } from 'react';
5
+
6
+ declare const defaultElement = "img";
7
+
8
+ /** The Hero component is a layout component that displays a large image with accompanying content. */
9
+ export declare function Hero<T extends HeroElementType = typeof defaultElement>({ as, variant, src, alt, width, height, alignment, children, ...rest }: HeroProps<T>): JSX.Element;
10
+
11
+ export declare namespace Hero {
12
+ var displayName: string;
13
+ }
14
+
15
+ export declare function HeroCaption({ children, className }: HeroCaptionProps): JSX.Element;
16
+
17
+ export declare namespace HeroCaption {
18
+ var displayName: string;
19
+ }
20
+
21
+ declare type HeroCaptionProps = PropsWithChildren<{
22
+ /** Additional classes to apply to the caption */
23
+ className?: string;
24
+ }>;
25
+
26
+ /** The HeroContent component is used to display the content of a hero. */
27
+ export declare function HeroContent({ children, alignment }: HeroContentProps): JSX.Element;
28
+
29
+ export declare namespace HeroContent {
30
+ var displayName: string;
31
+ }
32
+
33
+ declare type HeroContentProps = PropsWithChildren<{
34
+ /**
35
+ * The alignment of the content
36
+ *
37
+ * @default 'left'
38
+ */
39
+ alignment?: 'left' | 'center' | 'right' | 'fullWidth';
40
+ }>;
41
+
42
+ declare type HeroElementType = ElementType<{
43
+ src: string;
44
+ alt: string;
45
+ height?: number;
46
+ width?: number;
47
+ className?: string;
48
+ }, 'img'>;
49
+
50
+ /** The HeroLink component is used to display a link within a hero. */
51
+ export declare function HeroLink<T extends HeroLinkElementType = 'a'>({ as, href, children, className, ...rest }: HeroLinkProps<T>): JSX.Element;
52
+
53
+ export declare namespace HeroLink {
54
+ var displayName: string;
55
+ }
56
+
57
+ declare type HeroLinkElementType = ElementType<{
58
+ href?: string;
59
+ }, 'a'>;
60
+
61
+ declare type HeroLinkProps<T extends HeroLinkElementType = 'a'> = PropsWithChildren<{
62
+ /**
63
+ * The element type to render the link as
64
+ *
65
+ * @default 'a'
66
+ */
67
+ as?: T;
68
+ /** The URL to link to */
69
+ href: string;
70
+ /** Additional classes to apply to the link */
71
+ className?: string;
72
+ }>;
73
+
74
+ export declare type HeroProps<T extends HeroElementType = typeof defaultElement> = PropsWithChildren<{
75
+ /**
76
+ * The element type to render the hero image as
77
+ *
78
+ * @default 'img'
79
+ */
80
+ as?: T;
81
+ /**
82
+ * The variant of the hero
83
+ *
84
+ * @default 'basic'
85
+ */
86
+ variant: 'spotlight' | 'basic';
87
+ /** The URL of the image to display */
88
+ src: string;
89
+ /** The alt text for the image */
90
+ alt: string;
91
+ /** The width of the image in pixels */
92
+ width?: number;
93
+ /** The height of the image in pixels */
94
+ height?: number;
95
+ /**
96
+ * The alignment of the hero content, only applies to the spotlight variant
97
+ *
98
+ * @default 'left'
99
+ */
100
+ alignment?: 'left' | 'center' | 'right' | 'fullWidth';
101
+ } & ComponentPropsWithoutRef<T>>;
102
+
103
+ /** The HeroTitle component is used to display the title of a hero. */
104
+ export declare function HeroTitle<T extends HeroTitleElementType = 'h1'>({ as, children, className, ...rest }: HeroTitleProps<T>): JSX.Element;
105
+
106
+ export declare namespace HeroTitle {
107
+ var displayName: string;
108
+ }
109
+
110
+ declare type HeroTitleElementType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'span';
111
+
112
+ declare type HeroTitleProps<T extends HeroTitleElementType = 'h1'> = PropsWithChildren<{
113
+ /**
114
+ * The element type to render the title as
115
+ *
116
+ * @default 'h1'
117
+ */
118
+ as?: T;
119
+ /** Additional classes to apply to the title */
120
+ className?: string;
121
+ }>;
122
+
123
+ /** The HeroVideo component is used to display a video modal in a hero. */
124
+ export declare function HeroVideo({ src, title, transcript, children }: HeroVideo): JSX.Element;
125
+
126
+ export declare type HeroVideo = PropsWithChildren<{
127
+ /** The URL of the video to embed. */
128
+ src: string;
129
+ /** The title of the video. */
130
+ title: string;
131
+ /** The URL to a human readable transcript of the video. */
132
+ transcript?: string;
133
+ /** Additional classes to apply to the video container */
134
+ className?: string;
135
+ }>;
136
+
137
+ export declare namespace HeroVideo {
138
+ var displayName: string;
139
+ }
140
+
141
+ export { }
package/dist/hero.js ADDED
@@ -0,0 +1,52 @@
1
+ import { jsxs as x, jsx as e } from "react/jsx-runtime";
2
+ import { tv as d } from "tailwind-variants";
3
+ import { HeroCaption as y } from "./hero-caption.js";
4
+ import { HeroContent as h } from "./hero-content.js";
5
+ import { HeroContext as v } from "./hero-context.js";
6
+ import { HeroLink as I } from "./hero-link.js";
7
+ import { HeroTitle as P } from "./hero-title.js";
8
+ import { HeroVideo as V } from "./hero-video.js";
9
+ const H = "img";
10
+ function b({
11
+ as: o,
12
+ variant: t = "basic",
13
+ src: r,
14
+ alt: a,
15
+ width: i,
16
+ height: m,
17
+ alignment: s,
18
+ children: l,
19
+ ...c
20
+ }) {
21
+ const n = o ?? H, f = d({
22
+ slots: {
23
+ base: "tw:relative tw:flex tw:w-full tw:flex-col tw:overflow-hidden",
24
+ image: "tw:aspect-[16/9] tw:w-full tw:object-cover tw:md:aspect-[2.625]"
25
+ },
26
+ variants: {
27
+ variant: {
28
+ basic: {
29
+ base: "tw:h-fit",
30
+ image: "tw:max-h-[calc(85vh-14rem)]"
31
+ },
32
+ spotlight: {
33
+ base: "",
34
+ image: "tw:max-h-[80vh]"
35
+ }
36
+ }
37
+ }
38
+ }), { base: w, image: p } = f({ variant: t });
39
+ return /* @__PURE__ */ x("div", { className: w(), children: [
40
+ /* @__PURE__ */ e(n, { ...c, src: r, alt: a, width: i, height: m, className: p() }),
41
+ /* @__PURE__ */ e(v.Provider, { value: { variant: t }, children: /* @__PURE__ */ e(h, { alignment: s, children: l }) })
42
+ ] });
43
+ }
44
+ b.displayName = "Hero";
45
+ export {
46
+ b as Hero,
47
+ y as HeroCaption,
48
+ h as HeroContent,
49
+ I as HeroLink,
50
+ P as HeroTitle,
51
+ V as HeroVideo
52
+ };