@conduction/components 2.2.20 → 2.2.21

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/README.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  - **Version 2.2 (breaking changes from 2.1.x)**
6
6
 
7
+ - 2.2.21:
8
+ - Removed warning from HorizontalOverflowWrapper.
9
+ - Added Jumbotron component.
10
+ - Updated card-header to align hover states.
7
11
  - 2.2.20: Updated primary top nav to have more types.
8
12
  - 2.2.19: Refactored primary top nav to simplify sub-items.
9
13
  - 2.2.18:
@@ -24,6 +24,16 @@
24
24
  border-bottom-color: var(--conduction-card-header-hover-border-bottom-color);
25
25
  }
26
26
 
27
+ .container:before {
28
+ z-index: 1;
29
+ content: "";
30
+ position: absolute;
31
+ top: 0;
32
+ right: 0;
33
+ bottom: 0;
34
+ left: 0;
35
+ }
36
+
27
37
  .title > * {
28
38
  color: var(--conduction-card-header-title-color) !important;
29
39
  }
@@ -33,6 +33,7 @@
33
33
  border-bottom: var(--conduction-card-wrapper-border-bottom-width, var(--conduction-card-wrapper-border-width))
34
34
  var(--conduction-card-wrapper-border-bottom-style, var(--conduction-card-wrapper-border-style))
35
35
  var(--conduction-card-wrapper-border-bottom-color, var(--conduction-card-wrapper-border-color));
36
+ position: relative;
36
37
  }
37
38
 
38
39
  .container:hover {
@@ -32,5 +32,5 @@ export const HorizontalOverflowWrapper = ({ children, ariaLabels }) => {
32
32
  setCanScrollRight(wrapperRef.current.scrollLeft + wrapperRef.current.clientWidth < wrapperRef.current.scrollWidth);
33
33
  setCanScrollLeft(wrapperRef.current.scrollLeft > 0);
34
34
  };
35
- return (_jsxs("div", { className: styles.container, children: [canScrollLeft && (_jsx(Button, { className: clsx(styles.scrollButton, styles.left), onClick: scrollLeft, appearance: "secondary-action-button", "aria-label": ariaLabels.scrollLeftButton, children: _jsx(FontAwesomeIcon, { icon: faChevronLeft }) })), canScrollRight && (_jsx(Button, { className: clsx(styles.scrollButton, styles.right), onClick: scrollRight, appearance: "secondary-action-button", "aria-label": ariaLabels.scrollRightButton, children: _jsx(FontAwesomeIcon, { icon: faChevronRight }) })), _jsx("div", { ref: wrapperRef, className: styles.wrapper, onScroll: checkScrollDirections, children: children })] }));
35
+ return (_jsxs("div", { className: styles.container, children: [canScrollLeft && (_jsx(Button, { className: clsx(styles.scrollButton), onClick: scrollLeft, appearance: "secondary-action-button", "aria-label": ariaLabels.scrollLeftButton, children: _jsx(FontAwesomeIcon, { icon: faChevronLeft }) })), canScrollRight && (_jsx(Button, { className: clsx(styles.scrollButton, styles.right), onClick: scrollRight, appearance: "secondary-action-button", "aria-label": ariaLabels.scrollRightButton, children: _jsx(FontAwesomeIcon, { icon: faChevronRight }) })), _jsx("div", { ref: wrapperRef, className: styles.wrapper, onScroll: checkScrollDirections, children: children })] }));
36
36
  };
@@ -0,0 +1,22 @@
1
+ import * as React from "react";
2
+ interface JumbotronProps {
3
+ title: string;
4
+ ariaLabel: {
5
+ container: string;
6
+ card: string;
7
+ };
8
+ role: string;
9
+ subTitle?: string;
10
+ description?: string;
11
+ image?: {
12
+ placement: "false" | "background" | "right";
13
+ url: string;
14
+ };
15
+ isCard?: boolean;
16
+ searchForm?: {
17
+ element: JSX.Element;
18
+ show: boolean;
19
+ };
20
+ }
21
+ export declare const Jumbotron: React.FC<JumbotronProps>;
22
+ export {};
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as styles from "./Jumbotron.module.css";
3
+ import clsx from "clsx";
4
+ import { Paragraph, Page, PageContent, Heading1, Image } from "@utrecht/component-library-react/dist/css-module";
5
+ import { CardWrapper } from "../card";
6
+ import { Container } from "../container/Container";
7
+ export const Jumbotron = ({ title, ariaLabel, role, subTitle, description, image, isCard, searchForm, }) => {
8
+ return (_jsx("div", { "aria-label": ariaLabel.container, role: role, style: {
9
+ backgroundImage: image?.placement === "background" ? `url(${image.url})` : "",
10
+ }, className: clsx(image?.placement === "background" && styles.backgroundImageWrapper, image?.placement === "right" && styles.rightImageWrapper, (!image || image.placement === "false") && styles.wrapper), children: _jsx(Page, { children: _jsxs(PageContent, { children: [isCard && (_jsx(JumbotronCard, { ...{ title, ariaLabel, role, subTitle, description, image, isCard, searchForm } })), !isCard && (_jsx(JumbotronContent, { ...{ title, ariaLabel, role, subTitle, description, image, isCard, searchForm } }))] }) }) }));
11
+ };
12
+ const JumbotronCard = ({ title, ariaLabel, subTitle, description, image }) => {
13
+ if (image?.placement === "right")
14
+ return (_jsxs("div", { className: styles.imageRightContainer, children: [_jsxs(CardWrapper, { "aria-label": ariaLabel.card, role: "contentinfo", className: styles.card, children: [_jsxs(Heading1, { className: styles.cardAndImageTitle, children: [title, " "] }), _jsx("span", { className: styles.cardSubTitle, children: subTitle }), _jsx(Paragraph, { className: styles.cardDescription, children: description })] }), _jsx(Image, { src: image?.url, alt: "jumbotron-image", className: styles.image })] }));
15
+ return (_jsxs(CardWrapper, { "aria-label": ariaLabel.card, role: "contentinfo", className: styles.card, children: [_jsxs(Heading1, { className: styles.cardTitle, children: [title, " "] }), _jsx("span", { className: styles.cardSubTitle, children: subTitle }), _jsx(Paragraph, { className: styles.cardDescription, children: description })] }));
16
+ };
17
+ const JumbotronContent = ({ title, subTitle, description, image, searchForm }) => {
18
+ if (image?.placement === "right")
19
+ return (_jsxs("div", { className: styles.imageRightContainer, children: [_jsxs("div", { children: [_jsx(Heading1, { className: styles.title, children: title }), subTitle && _jsx("span", { className: styles.subTitle, children: subTitle }), description && _jsx(Paragraph, { className: styles.description, children: description })] }), image?.placement === "right" && _jsx(Image, { src: image?.url, alt: "jumbotron-image", className: styles.image })] }));
20
+ return (_jsx(Container, { layoutClassName: styles.wrapper, children: _jsxs("section", { className: clsx(searchForm?.show && styles.headerSearchForm), children: [_jsxs("div", { children: [_jsx(Heading1, { className: styles.title, children: title }), subTitle && _jsx("span", { className: styles.subTitle, children: subTitle }), description && _jsx(Paragraph, { className: styles.description, children: description })] }), searchForm?.show && searchForm.element] }) }));
21
+ };
@@ -0,0 +1,93 @@
1
+ .backgroundImageWrapper {
2
+ background-size: cover;
3
+ background-position: 48% 39%;
4
+ max-width: 100%;
5
+ padding: 5rem 0 10rem;
6
+ }
7
+
8
+ .rightImageWrapper {
9
+ padding-block: 48px;
10
+ background-color: var(--utrecht-page-header-background-color) !important;
11
+ }
12
+
13
+ .wrapper {
14
+ padding-block-start: 72px;
15
+ padding-block-end: 72px;
16
+ width: auto !important;
17
+ }
18
+
19
+ .card {
20
+ width: fit-content;
21
+ padding-inline-start: 48px;
22
+ padding-inline-end: 48px;
23
+ padding-block-start: 40px;
24
+ padding-block-end: 40px;
25
+ border-bottom: var(--conduction-card-wrapper-border-width) var(--conduction-card-wrapper-border-style) var(--conduction-card-wrapper-border-color);
26
+ }
27
+
28
+ .card:hover {
29
+ background-color: var(--conduction-card-wrapper-background-color);
30
+ cursor: default;
31
+ border-bottom: var(--conduction-card-wrapper-border-width) var(--conduction-card-wrapper-border-style) var(--conduction-card-wrapper-border-color);
32
+ }
33
+
34
+ .cardTitle,
35
+ .cardAndImageTitle {
36
+ border-block-end: var(--conduction-card-wrapper-header-border-block-end);
37
+ color: var(--conduction-card-header-title-color, var(--conduction-card-wrapper-color)) !important;
38
+ }
39
+
40
+ .cardAndImageTitle {
41
+ width: max-content;
42
+ }
43
+
44
+ .cardDescription {
45
+ color: var(--conduction-card-wrapper-color) !important;
46
+ }
47
+
48
+ .cardSubTitle,
49
+ .subTitle {
50
+ position: relative;
51
+ font-style: italic;
52
+ display: block;
53
+ margin-block-end: var(--utrecht-space-block-md);
54
+ font-size: var(--utrecht-document-font-size);
55
+ }
56
+
57
+ .imageRightContainer {
58
+ display: flex;
59
+ margin: auto;
60
+ justify-content: space-between;
61
+ gap: var(--utrecht-space-inline-xl);
62
+ align-items: center;
63
+ }
64
+
65
+ .image {
66
+ width: 50% !important;
67
+ object-fit: contain;
68
+ }
69
+
70
+ .title,
71
+ .description,
72
+ .subTitle {
73
+ color: var(--utrecht-page-header-color) !important;
74
+ }
75
+
76
+ .title {
77
+ margin-block-end: var(--utrecht-space-block-md);
78
+ }
79
+
80
+ .headerSearchForm > *:not(:last-child) {
81
+ margin-block-end: 32px;
82
+ }
83
+
84
+ .headerSearchForm > .subHeading2 {
85
+ width: 100%;
86
+ max-width: 800px;
87
+ margin-block-end: 48px;
88
+ }
89
+
90
+ .searchFormContainer {
91
+ width: 100%;
92
+ max-width: 650px;
93
+ }
package/lib/index.d.ts CHANGED
@@ -24,4 +24,5 @@ import { ToolTip } from "./components/toolTip/ToolTip";
24
24
  import { Pagination } from "./components/Pagination/Pagination";
25
25
  import { Tabs, TabList, Tab, TabPanel } from "./components/tabs/Tabs";
26
26
  import { HorizontalOverflowWrapper } from "./components/horizontalOverflowWrapper/HorizontalOverflowWrapper";
27
- export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, };
27
+ import { Jumbotron } from "./components/jumbotron/Jumbotron";
28
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, Jumbotron, };
package/lib/index.js CHANGED
@@ -17,4 +17,5 @@ import { ToolTip } from "./components/toolTip/ToolTip";
17
17
  import { Pagination } from "./components/Pagination/Pagination";
18
18
  import { Tabs, TabList, Tab, TabPanel } from "./components/tabs/Tabs";
19
19
  import { HorizontalOverflowWrapper } from "./components/horizontalOverflowWrapper/HorizontalOverflowWrapper";
20
- export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, };
20
+ import { Jumbotron } from "./components/jumbotron/Jumbotron";
21
+ export { DownloadCard, HorizontalImageCard, ImageAndDetailsCard, DetailsCard, InfoCard, Container, Breadcrumbs, InputText, InputPassword, InputEmail, InputDate, InputNumber, InputFile, Textarea, InputCheckbox, SelectMultiple, SelectSingle, ImageDivider, AuthenticatedLogo, UnauthenticatedLogo, MetaIcon, PrivateRoute, PrimaryTopNav, SecondaryTopNav, Tag, NotificationPopUp, QuoteWrapper, Pagination, BadgeCounter, CodeBlock, ToolTip, CardWrapper, CardHeader, CardHeaderTitle, CardHeaderDate, Tabs, TabList, Tab, TabPanel, HorizontalOverflowWrapper, Jumbotron, };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conduction/components",
3
- "version": "2.2.20",
3
+ "version": "2.2.21",
4
4
  "description": "React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -24,6 +24,16 @@
24
24
  border-bottom-color: var(--conduction-card-header-hover-border-bottom-color);
25
25
  }
26
26
 
27
+ .container:before {
28
+ z-index: 1;
29
+ content: "";
30
+ position: absolute;
31
+ top: 0;
32
+ right: 0;
33
+ bottom: 0;
34
+ left: 0;
35
+ }
36
+
27
37
  .title > * {
28
38
  color: var(--conduction-card-header-title-color) !important;
29
39
  }
@@ -33,6 +33,7 @@
33
33
  border-bottom: var(--conduction-card-wrapper-border-bottom-width, var(--conduction-card-wrapper-border-width))
34
34
  var(--conduction-card-wrapper-border-bottom-style, var(--conduction-card-wrapper-border-style))
35
35
  var(--conduction-card-wrapper-border-bottom-color, var(--conduction-card-wrapper-border-color));
36
+ position: relative;
36
37
  }
37
38
 
38
39
  .container:hover {
@@ -52,7 +52,7 @@ export const HorizontalOverflowWrapper: React.FC<HorizontalOverflowWrapperProps>
52
52
  <div className={styles.container}>
53
53
  {canScrollLeft && (
54
54
  <Button
55
- className={clsx(styles.scrollButton, styles.left)}
55
+ className={clsx(styles.scrollButton)}
56
56
  onClick={scrollLeft}
57
57
  appearance="secondary-action-button"
58
58
  aria-label={ariaLabels.scrollLeftButton}
@@ -0,0 +1,93 @@
1
+ .backgroundImageWrapper {
2
+ background-size: cover;
3
+ background-position: 48% 39%;
4
+ max-width: 100%;
5
+ padding: 5rem 0 10rem;
6
+ }
7
+
8
+ .rightImageWrapper {
9
+ padding-block: 48px;
10
+ background-color: var(--utrecht-page-header-background-color) !important;
11
+ }
12
+
13
+ .wrapper {
14
+ padding-block-start: 72px;
15
+ padding-block-end: 72px;
16
+ width: auto !important;
17
+ }
18
+
19
+ .card {
20
+ width: fit-content;
21
+ padding-inline-start: 48px;
22
+ padding-inline-end: 48px;
23
+ padding-block-start: 40px;
24
+ padding-block-end: 40px;
25
+ border-bottom: var(--conduction-card-wrapper-border-width) var(--conduction-card-wrapper-border-style) var(--conduction-card-wrapper-border-color);
26
+ }
27
+
28
+ .card:hover {
29
+ background-color: var(--conduction-card-wrapper-background-color);
30
+ cursor: default;
31
+ border-bottom: var(--conduction-card-wrapper-border-width) var(--conduction-card-wrapper-border-style) var(--conduction-card-wrapper-border-color);
32
+ }
33
+
34
+ .cardTitle,
35
+ .cardAndImageTitle {
36
+ border-block-end: var(--conduction-card-wrapper-header-border-block-end);
37
+ color: var(--conduction-card-header-title-color, var(--conduction-card-wrapper-color)) !important;
38
+ }
39
+
40
+ .cardAndImageTitle {
41
+ width: max-content;
42
+ }
43
+
44
+ .cardDescription {
45
+ color: var(--conduction-card-wrapper-color) !important;
46
+ }
47
+
48
+ .cardSubTitle,
49
+ .subTitle {
50
+ position: relative;
51
+ font-style: italic;
52
+ display: block;
53
+ margin-block-end: var(--utrecht-space-block-md);
54
+ font-size: var(--utrecht-document-font-size);
55
+ }
56
+
57
+ .imageRightContainer {
58
+ display: flex;
59
+ margin: auto;
60
+ justify-content: space-between;
61
+ gap: var(--utrecht-space-inline-xl);
62
+ align-items: center;
63
+ }
64
+
65
+ .image {
66
+ width: 50% !important;
67
+ object-fit: contain;
68
+ }
69
+
70
+ .title,
71
+ .description,
72
+ .subTitle {
73
+ color: var(--utrecht-page-header-color) !important;
74
+ }
75
+
76
+ .title {
77
+ margin-block-end: var(--utrecht-space-block-md);
78
+ }
79
+
80
+ .headerSearchForm > *:not(:last-child) {
81
+ margin-block-end: 32px;
82
+ }
83
+
84
+ .headerSearchForm > .subHeading2 {
85
+ width: 100%;
86
+ max-width: 800px;
87
+ margin-block-end: 48px;
88
+ }
89
+
90
+ .searchFormContainer {
91
+ width: 100%;
92
+ max-width: 650px;
93
+ }
@@ -0,0 +1,119 @@
1
+ import * as React from "react";
2
+ import * as styles from "./Jumbotron.module.css";
3
+ import clsx from "clsx";
4
+ import { Paragraph, Page, PageContent, Heading1, Image } from "@utrecht/component-library-react/dist/css-module";
5
+ import { CardWrapper } from "../card";
6
+ import { Container } from "../container/Container";
7
+
8
+ interface JumbotronProps {
9
+ title: string;
10
+ ariaLabel: {
11
+ container: string;
12
+ card: string;
13
+ };
14
+ role: string;
15
+ subTitle?: string;
16
+ description?: string;
17
+ image?: {
18
+ placement: "false" | "background" | "right";
19
+ url: string;
20
+ };
21
+ isCard?: boolean;
22
+ searchForm?: {
23
+ element: JSX.Element;
24
+ show: boolean;
25
+ };
26
+ }
27
+
28
+ export const Jumbotron: React.FC<JumbotronProps> = ({
29
+ title,
30
+ ariaLabel,
31
+ role,
32
+ subTitle,
33
+ description,
34
+ image,
35
+ isCard,
36
+ searchForm,
37
+ }) => {
38
+ return (
39
+ <div
40
+ aria-label={ariaLabel.container}
41
+ role={role}
42
+ style={{
43
+ backgroundImage: image?.placement === "background" ? `url(${image.url})` : "",
44
+ }}
45
+ className={clsx(
46
+ image?.placement === "background" && styles.backgroundImageWrapper,
47
+ image?.placement === "right" && styles.rightImageWrapper,
48
+ (!image || image.placement === "false") && styles.wrapper,
49
+ )}
50
+ >
51
+ <Page>
52
+ <PageContent>
53
+ {isCard && (
54
+ <JumbotronCard {...{ title, ariaLabel, role, subTitle, description, image, isCard, searchForm }} />
55
+ )}
56
+ {!isCard && (
57
+ <JumbotronContent {...{ title, ariaLabel, role, subTitle, description, image, isCard, searchForm }} />
58
+ )}
59
+ </PageContent>
60
+ </Page>
61
+ </div>
62
+ );
63
+ };
64
+
65
+ const JumbotronCard: React.FC<JumbotronProps> = ({ title, ariaLabel, subTitle, description, image }) => {
66
+ if (image?.placement === "right")
67
+ return (
68
+ <div className={styles.imageRightContainer}>
69
+ <CardWrapper aria-label={ariaLabel.card} role="contentinfo" className={styles.card}>
70
+ <Heading1 className={styles.cardAndImageTitle}>{title} </Heading1>
71
+ <span className={styles.cardSubTitle}>{subTitle}</span>
72
+
73
+ <Paragraph className={styles.cardDescription}>{description}</Paragraph>
74
+ </CardWrapper>
75
+ <Image src={image?.url} alt={"jumbotron-image"} className={styles.image} />
76
+ </div>
77
+ );
78
+
79
+ return (
80
+ <CardWrapper aria-label={ariaLabel.card} role="contentinfo" className={styles.card}>
81
+ <Heading1 className={styles.cardTitle}>{title} </Heading1>
82
+ <span className={styles.cardSubTitle}>{subTitle}</span>
83
+
84
+ <Paragraph className={styles.cardDescription}>{description}</Paragraph>
85
+ </CardWrapper>
86
+ );
87
+ };
88
+
89
+ const JumbotronContent: React.FC<JumbotronProps> = ({ title, subTitle, description, image, searchForm }) => {
90
+ if (image?.placement === "right")
91
+ return (
92
+ <div className={styles.imageRightContainer}>
93
+ <div>
94
+ <Heading1 className={styles.title}>{title}</Heading1>
95
+
96
+ {subTitle && <span className={styles.subTitle}>{subTitle}</span>}
97
+
98
+ {description && <Paragraph className={styles.description}>{description}</Paragraph>}
99
+ </div>
100
+
101
+ {image?.placement === "right" && <Image src={image?.url} alt={"jumbotron-image"} className={styles.image} />}
102
+ </div>
103
+ );
104
+
105
+ return (
106
+ <Container layoutClassName={styles.wrapper}>
107
+ <section className={clsx(searchForm?.show && styles.headerSearchForm)}>
108
+ <div>
109
+ <Heading1 className={styles.title}>{title}</Heading1>
110
+
111
+ {subTitle && <span className={styles.subTitle}>{subTitle}</span>}
112
+
113
+ {description && <Paragraph className={styles.description}>{description}</Paragraph>}
114
+ </div>
115
+ {searchForm?.show && searchForm.element}
116
+ </section>
117
+ </Container>
118
+ );
119
+ };
package/src/index.ts CHANGED
@@ -41,6 +41,7 @@ import { ToolTip } from "./components/toolTip/ToolTip";
41
41
  import { Pagination } from "./components/Pagination/Pagination";
42
42
  import { Tabs, TabList, Tab, TabPanel } from "./components/tabs/Tabs";
43
43
  import { HorizontalOverflowWrapper } from "./components/horizontalOverflowWrapper/HorizontalOverflowWrapper";
44
+ import { Jumbotron } from "./components/jumbotron/Jumbotron";
44
45
 
45
46
  export {
46
47
  DownloadCard,
@@ -83,4 +84,5 @@ export {
83
84
  Tab,
84
85
  TabPanel,
85
86
  HorizontalOverflowWrapper,
87
+ Jumbotron,
86
88
  };