@nypl/design-system-react-components 0.27.0 → 0.28.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/CHANGELOG.md +29 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/dist/components/Button/Button.d.ts +2 -10
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +22 -0
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +10 -8
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +2 -2
- package/dist/components/Grid/SimpleGrid.d.ts +6 -3
- package/dist/components/Heading/Heading.d.ts +2 -5
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +1 -5
- package/dist/components/Hero/Hero.d.ts +13 -9
- package/dist/components/Icons/Icon.d.ts +6 -5
- package/dist/components/Icons/IconSvgs.d.ts +21 -21
- package/dist/components/Image/Image.d.ts +8 -5
- package/dist/components/Link/Link.d.ts +1 -9
- package/dist/components/List/List.d.ts +7 -11
- package/dist/components/Logo/Logo.d.ts +2 -5
- package/dist/components/Logo/LogoSvgs.d.ts +39 -39
- package/dist/components/Notification/Notification.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +2 -5
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -4
- package/dist/components/SkipNavigation/SkipNavigation.d.ts +17 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +2 -3
- package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Template/Template.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +21 -9
- package/dist/components/Toggle/Toggle.d.ts +1 -5
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +856 -1155
- package/dist/design-system-react-components.cjs.development.js.map +1 -1
- package/dist/design-system-react-components.cjs.production.min.js +1 -1
- package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
- package/dist/design-system-react-components.esm.js +858 -1220
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/types.d.ts +1 -0
- package/dist/index.d.ts +26 -47
- package/dist/theme/components/buttonGroup.d.ts +11 -0
- package/dist/theme/components/card.d.ts +104 -8
- package/dist/theme/components/componentWrapper.d.ts +4 -3
- package/dist/theme/components/customTable.d.ts +11 -14
- package/dist/theme/components/fieldset.d.ts +4 -3
- package/dist/theme/components/helperErrorText.d.ts +4 -3
- package/dist/theme/components/hero.d.ts +1 -1
- package/dist/theme/components/horizontalRule.d.ts +4 -3
- package/dist/theme/components/icon.d.ts +47743 -1
- package/dist/theme/components/image.d.ts +563 -10
- package/dist/theme/components/label.d.ts +4 -3
- package/dist/theme/components/list.d.ts +6 -7
- package/dist/theme/components/logo.d.ts +474 -1
- package/dist/theme/components/notification.d.ts +20 -16
- package/dist/theme/components/progressIndicator.d.ts +6 -4
- package/dist/theme/components/select.d.ts +4 -4
- package/dist/theme/components/skeletonLoader.d.ts +14 -10
- package/dist/theme/components/skipNavigation.d.ts +22 -0
- package/dist/theme/components/slider.d.ts +7 -6
- package/dist/theme/components/structuredContent.d.ts +10 -9
- package/dist/theme/components/text.d.ts +7 -1
- package/dist/theme/components/toggle.d.ts +6 -4
- package/dist/theme/provider.d.ts +2 -4
- package/dist/utils/componentCategories.d.ts +1 -1
- package/dist/utils/interfaces.d.ts +5 -0
- package/dist/utils/utils.d.ts +2 -18
- package/package.json +2 -2
- package/src/__tests__/setup.ts +3 -3
- package/src/__tests__/utils/utils.test.ts +1 -23
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +22 -14
- package/src/components/Accordion/Accordion.stories.mdx +43 -44
- package/src/components/Accordion/Accordion.test.tsx +5 -13
- package/src/components/Accordion/Accordion.tsx +14 -18
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +6 -6
- package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +23 -25
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -37
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +4 -17
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +18 -21
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +1 -100
- package/src/components/Button/Button.stories.mdx +89 -126
- package/src/components/Button/Button.test.tsx +16 -30
- package/src/components/Button/Button.tsx +14 -20
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +147 -0
- package/src/components/ButtonGroup/ButtonGroup.test.tsx +141 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +99 -0
- package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +117 -0
- package/src/components/Card/Card.stories.mdx +143 -177
- package/src/components/Card/Card.test.tsx +36 -97
- package/src/components/Card/Card.tsx +78 -74
- package/src/components/Chakra/Box.stories.mdx +2 -6
- package/src/components/Chakra/Center.stories.mdx +5 -23
- package/src/components/Chakra/Flex.stories.mdx +4 -6
- package/src/components/Chakra/Stack.stories.mdx +9 -10
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +20 -13
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +6 -17
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -7
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +33 -29
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -11
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +3 -10
- package/src/components/DatePicker/DatePicker.stories.mdx +23 -37
- package/src/components/DatePicker/DatePicker.test.tsx +21 -19
- package/src/components/DatePicker/DatePicker.tsx +57 -49
- package/src/components/Form/Form.stories.mdx +46 -31
- package/src/components/Form/Form.test.tsx +1 -18
- package/src/components/Form/Form.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +73 -49
- package/src/components/Grid/SimpleGrid.test.tsx +7 -9
- package/src/components/Grid/SimpleGrid.tsx +14 -11
- package/src/components/Heading/Heading.stories.mdx +27 -72
- package/src/components/Heading/Heading.test.tsx +18 -44
- package/src/components/Heading/Heading.tsx +7 -10
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -3
- package/src/components/HelperErrorText/HelperErrorText.tsx +1 -5
- package/src/components/Hero/Hero.stories.mdx +219 -216
- package/src/components/Hero/Hero.test.tsx +107 -223
- package/src/components/Hero/Hero.tsx +63 -61
- package/src/components/Icons/Icon.stories.mdx +172 -118
- package/src/components/Icons/Icon.test.tsx +8 -16
- package/src/components/Icons/Icon.tsx +75 -29
- package/src/components/Icons/IconSvgs.tsx +42 -42
- package/src/components/Image/Image.stories.mdx +45 -132
- package/src/components/Image/Image.test.tsx +16 -31
- package/src/components/Image/Image.tsx +28 -12
- package/src/components/Link/Link.stories.mdx +30 -80
- package/src/components/Link/Link.test.tsx +25 -53
- package/src/components/Link/Link.tsx +43 -56
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +1 -2
- package/src/components/List/List.stories.mdx +20 -31
- package/src/components/List/List.test.tsx +24 -43
- package/src/components/List/List.tsx +25 -36
- package/src/components/Logo/Logo.stories.mdx +94 -50
- package/src/components/Logo/Logo.test.tsx +10 -19
- package/src/components/Logo/Logo.tsx +50 -17
- package/src/components/Logo/LogoSvgs.tsx +78 -78
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +4 -4
- package/src/components/Modal/Modal.stories.mdx +8 -9
- package/src/components/Modal/Modal.test.tsx +5 -10
- package/src/components/Modal/Modal.tsx +1 -1
- package/src/components/Notification/Notification.stories.mdx +10 -28
- package/src/components/Notification/Notification.test.tsx +9 -12
- package/src/components/Notification/Notification.tsx +34 -37
- package/src/components/Pagination/Pagination.stories.mdx +2 -2
- package/src/components/Pagination/Pagination.tsx +15 -10
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +27 -53
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +9 -10
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +17 -21
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -10
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +9 -6
- package/src/components/RadioGroup/RadioGroup.stories.mdx +15 -16
- package/src/components/RadioGroup/RadioGroup.test.tsx +2 -8
- package/src/components/RadioGroup/RadioGroup.tsx +28 -24
- package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
- package/src/components/SearchBar/SearchBar.test.tsx +1 -1
- package/src/components/SearchBar/SearchBar.tsx +14 -22
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +0 -12
- package/src/components/Select/Select.stories.mdx +8 -23
- package/src/components/Select/Select.test.tsx +6 -7
- package/src/components/Select/Select.tsx +13 -26
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +17 -56
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -21
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +9 -8
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +33 -33
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +90 -0
- package/src/components/SkipNavigation/SkipNavigation.test.tsx +63 -0
- package/src/components/SkipNavigation/SkipNavigation.tsx +51 -0
- package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +130 -0
- package/src/components/Slider/Slider.stories.mdx +19 -53
- package/src/components/Slider/Slider.test.tsx +2 -2
- package/src/components/Slider/Slider.tsx +10 -12
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +2 -9
- package/src/components/StatusBadge/StatusBadge.stories.mdx +6 -21
- package/src/components/StatusBadge/StatusBadge.test.tsx +2 -3
- package/src/components/StatusBadge/StatusBadge.tsx +3 -10
- package/src/components/StructuredContent/StructuredContent.stories.mdx +30 -58
- package/src/components/StructuredContent/StructuredContent.test.tsx +42 -44
- package/src/components/StructuredContent/StructuredContent.tsx +9 -18
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +9 -23
- package/src/components/StyleGuide/Buttons.stories.mdx +62 -62
- package/src/components/StyleGuide/ColorCard.tsx +2 -4
- package/src/components/StyleGuide/Colors.stories.mdx +7 -8
- package/src/components/StyleGuide/DesignTokens.stories.mdx +5 -7
- package/src/components/StyleGuide/Forms.stories.mdx +0 -1
- package/src/components/StyleGuide/Iconography.stories.mdx +59 -77
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
- package/src/components/StyleGuide/Typography.stories.mdx +15 -18
- package/src/components/Table/Table.stories.mdx +85 -1
- package/src/components/Table/Table.test.tsx +57 -1
- package/src/components/Table/Table.tsx +7 -4
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +121 -0
- package/src/components/Tabs/Tabs.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +26 -27
- package/src/components/Template/Template.stories.mdx +49 -54
- package/src/components/Template/Template.tsx +9 -3
- package/src/components/Text/Text.stories.mdx +5 -11
- package/src/components/Text/Text.test.tsx +3 -6
- package/src/components/Text/Text.tsx +3 -5
- package/src/components/TextInput/TextInput.stories.mdx +10 -22
- package/src/components/TextInput/TextInput.test.tsx +32 -62
- package/src/components/TextInput/TextInput.tsx +61 -30
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +1 -0
- package/src/components/Toggle/Toggle.stories.mdx +5 -16
- package/src/components/Toggle/Toggle.test.tsx +2 -3
- package/src/components/Toggle/Toggle.tsx +9 -10
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +13 -29
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -23
- package/src/components/VideoPlayer/VideoPlayer.tsx +13 -10
- package/src/docs/Chakra.stories.mdx +14 -11
- package/src/docs/Welcome.stories.mdx +23 -43
- package/src/helpers/types.ts +1 -0
- package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
- package/src/hooks/useNYPLTheme.stories.mdx +3 -6
- package/src/index.ts +51 -45
- package/src/theme/components/buttonGroup.ts +10 -0
- package/src/theme/components/card.ts +50 -15
- package/src/theme/components/componentWrapper.ts +5 -1
- package/src/theme/components/customTable.ts +8 -2
- package/src/theme/components/fieldset.ts +5 -1
- package/src/theme/components/helperErrorText.ts +5 -1
- package/src/theme/components/hero.ts +2 -2
- package/src/theme/components/horizontalRule.ts +5 -1
- package/src/theme/components/icon.ts +7 -1
- package/src/theme/components/image.ts +14 -3
- package/src/theme/components/label.ts +5 -1
- package/src/theme/components/list.ts +8 -2
- package/src/theme/components/logo.ts +5 -1
- package/src/theme/components/notification.ts +38 -14
- package/src/theme/components/progressIndicator.ts +10 -5
- package/src/theme/components/select.ts +5 -2
- package/src/theme/components/skeletonLoader.ts +8 -2
- package/src/theme/components/skipNavigation.ts +26 -0
- package/src/theme/components/slider.ts +13 -1
- package/src/theme/components/structuredContent.ts +11 -1
- package/src/theme/components/text.ts +12 -5
- package/src/theme/components/toggle.ts +9 -3
- package/src/theme/index.ts +4 -0
- package/src/theme/provider.tsx +1 -1
- package/src/utils/componentCategories.ts +13 -5
- package/src/utils/interfaces.ts +5 -0
- package/src/utils/utils.ts +2 -32
- package/dist/components/Accordion/AccordionTypes.d.ts +0 -5
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +0 -8
- package/dist/components/Button/ButtonTypes.d.ts +0 -8
- package/dist/components/DatePicker/DatePickerTypes.d.ts +0 -5
- package/dist/components/Form/FormTypes.d.ts +0 -2
- package/dist/components/Grid/GridTypes.d.ts +0 -9
- package/dist/components/Heading/HeadingTypes.d.ts +0 -14
- package/dist/components/Hero/HeroTypes.d.ts +0 -12
- package/dist/components/Icons/IconTypes.d.ts +0 -77
- package/dist/components/Image/ImageTypes.d.ts +0 -22
- package/dist/components/Link/LinkTypes.d.ts +0 -8
- package/dist/components/List/ListTypes.d.ts +0 -5
- package/dist/components/Logo/LogoTypes.d.ts +0 -54
- package/dist/components/Notification/NotificationTypes.d.ts +0 -5
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +0 -8
- package/dist/components/Select/SelectTypes.d.ts +0 -8
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -5
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +0 -5
- package/dist/components/StructuredContent/StructuredContentTypes.d.ts +0 -5
- package/dist/components/Text/TextTypes.d.ts +0 -6
- package/dist/components/TextInput/TextInputTypes.d.ts +0 -25
- package/dist/components/Toggle/ToggleTypes.d.ts +0 -4
- package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +0 -9
- package/dist/helpers/enums.d.ts +0 -4
- package/dist/utils/siteSections.d.ts +0 -2
- package/src/components/Accordion/AccordionTypes.tsx +0 -5
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +0 -8
- package/src/components/Button/ButtonTypes.tsx +0 -8
- package/src/components/DatePicker/DatePickerTypes.tsx +0 -5
- package/src/components/Form/FormTypes.tsx +0 -3
- package/src/components/Grid/GridTypes.tsx +0 -9
- package/src/components/Heading/HeadingTypes.tsx +0 -15
- package/src/components/Hero/HeroTypes.tsx +0 -20
- package/src/components/Icons/IconTypes.tsx +0 -83
- package/src/components/Image/ImageTypes.ts +0 -24
- package/src/components/Link/LinkTypes.tsx +0 -8
- package/src/components/List/ListTypes.tsx +0 -5
- package/src/components/Logo/LogoTypes.tsx +0 -56
- package/src/components/Notification/NotificationTypes.tsx +0 -5
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +0 -8
- package/src/components/Select/SelectTypes.tsx +0 -10
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
- package/src/components/StatusBadge/StatusBadgeTypes.tsx +0 -5
- package/src/components/StructuredContent/StructuredContentTypes.tsx +0 -5
- package/src/components/Text/TextTypes.tsx +0 -6
- package/src/components/TextInput/TextInputTypes.tsx +0 -48
- package/src/components/Toggle/ToggleTypes.tsx +0 -4
- package/src/components/VideoPlayer/VideoPlayerTypes.tsx +0 -10
- package/src/helpers/enums.ts +0 -4
- package/src/utils/siteSections.ts +0 -10
|
@@ -4,8 +4,6 @@ import { axe } from "jest-axe";
|
|
|
4
4
|
import renderer from "react-test-renderer";
|
|
5
5
|
|
|
6
6
|
import Heading from "../Heading/Heading";
|
|
7
|
-
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
8
|
-
import { HeroTypes } from "./HeroTypes";
|
|
9
7
|
import Hero from "./Hero";
|
|
10
8
|
|
|
11
9
|
export const subHeaderText = (
|
|
@@ -20,22 +18,18 @@ export const otherSubHeaderText =
|
|
|
20
18
|
"With 92 locations across the Bronx, Manhattan, and Staten Island, The New " +
|
|
21
19
|
"York Public Library is an essential part of neighborhoods across the city. " +
|
|
22
20
|
"Visit us today.";
|
|
23
|
-
const
|
|
24
|
-
|
|
21
|
+
const imageProps = {
|
|
22
|
+
alt: "Image example",
|
|
23
|
+
src: "https://placeimg.com/800/400/animals",
|
|
24
|
+
};
|
|
25
25
|
|
|
26
26
|
describe("Hero", () => {
|
|
27
27
|
describe("axe accessbility tests", () => {
|
|
28
28
|
it("passes for type Primary", async () => {
|
|
29
29
|
const { container } = render(
|
|
30
30
|
<Hero
|
|
31
|
-
heroType=
|
|
32
|
-
heading={
|
|
33
|
-
<Heading
|
|
34
|
-
level={HeadingLevels.One}
|
|
35
|
-
id="a11y-hero"
|
|
36
|
-
text="Hero Primary"
|
|
37
|
-
/>
|
|
38
|
-
}
|
|
31
|
+
heroType="primary"
|
|
32
|
+
heading={<Heading level="one" id="a11y-hero" text="Hero Primary" />}
|
|
39
33
|
subHeaderText="Example Subtitle"
|
|
40
34
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
41
35
|
/>
|
|
@@ -46,16 +40,9 @@ describe("Hero", () => {
|
|
|
46
40
|
it("passes for type Secondary", async () => {
|
|
47
41
|
const { container } = render(
|
|
48
42
|
<Hero
|
|
49
|
-
heroType=
|
|
50
|
-
heading={
|
|
51
|
-
|
|
52
|
-
level={HeadingLevels.One}
|
|
53
|
-
id="a11y-hero"
|
|
54
|
-
text="Hero Secondary"
|
|
55
|
-
/>
|
|
56
|
-
}
|
|
57
|
-
imageAlt={imageAlt}
|
|
58
|
-
imageSrc={imageSrc}
|
|
43
|
+
heroType="secondary"
|
|
44
|
+
heading={<Heading level="one" id="a11y-hero" text="Hero Secondary" />}
|
|
45
|
+
imageProps={imageProps}
|
|
59
46
|
subHeaderText={subHeaderText}
|
|
60
47
|
/>
|
|
61
48
|
);
|
|
@@ -65,14 +52,8 @@ describe("Hero", () => {
|
|
|
65
52
|
it("passes for type Tertiary", async () => {
|
|
66
53
|
const { container } = render(
|
|
67
54
|
<Hero
|
|
68
|
-
heroType=
|
|
69
|
-
heading={
|
|
70
|
-
<Heading
|
|
71
|
-
level={HeadingLevels.One}
|
|
72
|
-
id="a11y-hero"
|
|
73
|
-
text="Hero Tertiary"
|
|
74
|
-
/>
|
|
75
|
-
}
|
|
55
|
+
heroType="tertiary"
|
|
56
|
+
heading={<Heading level="one" id="a11y-hero" text="Hero Tertiary" />}
|
|
76
57
|
subHeaderText={otherSubHeaderText}
|
|
77
58
|
/>
|
|
78
59
|
);
|
|
@@ -83,16 +64,9 @@ describe("Hero", () => {
|
|
|
83
64
|
const { container } = render(
|
|
84
65
|
<Hero
|
|
85
66
|
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
86
|
-
heroType=
|
|
87
|
-
heading={
|
|
88
|
-
|
|
89
|
-
level={HeadingLevels.One}
|
|
90
|
-
id="a11y-hero"
|
|
91
|
-
text="Hero Campaign"
|
|
92
|
-
/>
|
|
93
|
-
}
|
|
94
|
-
imageAlt={imageAlt}
|
|
95
|
-
imageSrc={imageSrc}
|
|
67
|
+
heroType="campaign"
|
|
68
|
+
heading={<Heading level="one" id="a11y-hero" text="Hero Campaign" />}
|
|
69
|
+
imageProps={imageProps}
|
|
96
70
|
subHeaderText={otherSubHeaderText}
|
|
97
71
|
/>
|
|
98
72
|
);
|
|
@@ -102,9 +76,8 @@ describe("Hero", () => {
|
|
|
102
76
|
it("passes for type FiftyFifty", async () => {
|
|
103
77
|
const { container } = render(
|
|
104
78
|
<Hero
|
|
105
|
-
heroType=
|
|
106
|
-
|
|
107
|
-
imageSrc={imageSrc}
|
|
79
|
+
heroType="fiftyFifty"
|
|
80
|
+
imageProps={imageProps}
|
|
108
81
|
subHeaderText={otherSubHeaderText}
|
|
109
82
|
/>
|
|
110
83
|
);
|
|
@@ -115,14 +88,8 @@ describe("Hero", () => {
|
|
|
115
88
|
it("renders Primary Hero", () => {
|
|
116
89
|
render(
|
|
117
90
|
<Hero
|
|
118
|
-
heroType=
|
|
119
|
-
heading={
|
|
120
|
-
<Heading
|
|
121
|
-
level={HeadingLevels.One}
|
|
122
|
-
id="primary-hero"
|
|
123
|
-
text="Hero Primary"
|
|
124
|
-
/>
|
|
125
|
-
}
|
|
91
|
+
heroType="primary"
|
|
92
|
+
heading={<Heading level="one" id="primary-hero" text="Hero Primary" />}
|
|
126
93
|
subHeaderText="Example Subtitle"
|
|
127
94
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
128
95
|
/>
|
|
@@ -139,16 +106,11 @@ describe("Hero", () => {
|
|
|
139
106
|
it("renders Secondary Hero", () => {
|
|
140
107
|
render(
|
|
141
108
|
<Hero
|
|
142
|
-
heroType=
|
|
109
|
+
heroType="secondary"
|
|
143
110
|
heading={
|
|
144
|
-
<Heading
|
|
145
|
-
level={HeadingLevels.One}
|
|
146
|
-
id="secondary-hero"
|
|
147
|
-
text="Hero Secondary"
|
|
148
|
-
/>
|
|
111
|
+
<Heading level="one" id="secondary-hero" text="Hero Secondary" />
|
|
149
112
|
}
|
|
150
|
-
|
|
151
|
-
imageSrc={imageSrc}
|
|
113
|
+
imageProps={imageProps}
|
|
152
114
|
subHeaderText={subHeaderText}
|
|
153
115
|
/>
|
|
154
116
|
);
|
|
@@ -165,13 +127,9 @@ describe("Hero", () => {
|
|
|
165
127
|
it("renders Tertiary Hero", () => {
|
|
166
128
|
render(
|
|
167
129
|
<Hero
|
|
168
|
-
heroType=
|
|
130
|
+
heroType="tertiary"
|
|
169
131
|
heading={
|
|
170
|
-
<Heading
|
|
171
|
-
level={HeadingLevels.One}
|
|
172
|
-
id="tertiary-hero"
|
|
173
|
-
text="Hero Tertiary"
|
|
174
|
-
/>
|
|
132
|
+
<Heading level="one" id="tertiary-hero" text="Hero Tertiary" />
|
|
175
133
|
}
|
|
176
134
|
subHeaderText={otherSubHeaderText}
|
|
177
135
|
/>
|
|
@@ -186,16 +144,11 @@ describe("Hero", () => {
|
|
|
186
144
|
render(
|
|
187
145
|
<Hero
|
|
188
146
|
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
189
|
-
heroType=
|
|
147
|
+
heroType="campaign"
|
|
190
148
|
heading={
|
|
191
|
-
<Heading
|
|
192
|
-
level={HeadingLevels.One}
|
|
193
|
-
id="campaign-hero"
|
|
194
|
-
text="Hero Campaign"
|
|
195
|
-
/>
|
|
149
|
+
<Heading level="one" id="campaign-hero" text="Hero Campaign" />
|
|
196
150
|
}
|
|
197
|
-
|
|
198
|
-
imageSrc={imageSrc}
|
|
151
|
+
imageProps={imageProps}
|
|
199
152
|
subHeaderText={otherSubHeaderText}
|
|
200
153
|
/>
|
|
201
154
|
);
|
|
@@ -216,9 +169,8 @@ describe("Hero", () => {
|
|
|
216
169
|
it("renders Fifty-Fifty Hero", () => {
|
|
217
170
|
render(
|
|
218
171
|
<Hero
|
|
219
|
-
heroType=
|
|
220
|
-
|
|
221
|
-
imageSrc={imageSrc}
|
|
172
|
+
heroType="fiftyFifty"
|
|
173
|
+
imageProps={imageProps}
|
|
222
174
|
subHeaderText={otherSubHeaderText}
|
|
223
175
|
/>
|
|
224
176
|
);
|
|
@@ -234,10 +186,10 @@ describe("Hero", () => {
|
|
|
234
186
|
it("renders custom background and foreground colors for all but the Secondary type", () => {
|
|
235
187
|
const { rerender } = render(
|
|
236
188
|
<Hero
|
|
237
|
-
heroType=
|
|
189
|
+
heroType="primary"
|
|
238
190
|
heading={
|
|
239
191
|
<Heading
|
|
240
|
-
level=
|
|
192
|
+
level="one"
|
|
241
193
|
id="custom-colors-hero"
|
|
242
194
|
text="Hero with Custom Colors"
|
|
243
195
|
/>
|
|
@@ -257,9 +209,8 @@ describe("Hero", () => {
|
|
|
257
209
|
<Hero
|
|
258
210
|
backgroundColor="#654321"
|
|
259
211
|
foregroundColor="#123456"
|
|
260
|
-
heroType=
|
|
261
|
-
|
|
262
|
-
imageSrc={imageSrc}
|
|
212
|
+
heroType="fiftyFifty"
|
|
213
|
+
imageProps={imageProps}
|
|
263
214
|
subHeaderText={otherSubHeaderText}
|
|
264
215
|
/>
|
|
265
216
|
);
|
|
@@ -273,16 +224,11 @@ describe("Hero", () => {
|
|
|
273
224
|
<Hero
|
|
274
225
|
backgroundColor="#654321"
|
|
275
226
|
foregroundColor="#123456"
|
|
276
|
-
heroType=
|
|
227
|
+
heroType="secondary"
|
|
277
228
|
heading={
|
|
278
|
-
<Heading
|
|
279
|
-
level={HeadingLevels.One}
|
|
280
|
-
id="secondary-hero"
|
|
281
|
-
text="Hero Secondary"
|
|
282
|
-
/>
|
|
229
|
+
<Heading level="one" id="secondary-hero" text="Hero Secondary" />
|
|
283
230
|
}
|
|
284
|
-
|
|
285
|
-
imageSrc={imageSrc}
|
|
231
|
+
imageProps={imageProps}
|
|
286
232
|
subHeaderText={subHeaderText}
|
|
287
233
|
/>
|
|
288
234
|
);
|
|
@@ -293,106 +239,92 @@ describe("Hero", () => {
|
|
|
293
239
|
);
|
|
294
240
|
});
|
|
295
241
|
|
|
296
|
-
it("logs a warning if `
|
|
242
|
+
it("logs a warning if `imageProps.src` prop is passed but not `imageProps.alt`", () => {
|
|
297
243
|
const warn = jest.spyOn(console, "warn");
|
|
298
244
|
render(
|
|
299
245
|
<Hero
|
|
300
246
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
301
|
-
heroType=
|
|
302
|
-
|
|
247
|
+
heroType="primary"
|
|
248
|
+
imageProps={{ src: imageProps.src }}
|
|
303
249
|
/>
|
|
304
250
|
);
|
|
305
251
|
|
|
306
252
|
expect(warn).toHaveBeenCalledWith(
|
|
307
|
-
`NYPL Reservoir: The "
|
|
253
|
+
`NYPL Reservoir Hero: The "imageProps.src" prop was passed but the "imageProps.alt" props was not. This will make the rendered image inaccessible.`
|
|
308
254
|
);
|
|
309
255
|
});
|
|
310
256
|
|
|
311
257
|
it("renders Primary Hero with warnings in browser console", () => {
|
|
312
258
|
const warn = jest.spyOn(console, "warn");
|
|
313
259
|
const heading = (
|
|
314
|
-
<Heading
|
|
315
|
-
level={HeadingLevels.One}
|
|
316
|
-
id="hero-errors"
|
|
317
|
-
text="Hero with Error Warnings"
|
|
318
|
-
/>
|
|
319
|
-
);
|
|
320
|
-
const { rerender } = render(
|
|
321
|
-
<Hero heroType={HeroTypes.Primary} heading={heading} />
|
|
260
|
+
<Heading level="one" id="hero-errors" text="Hero with Error Warnings" />
|
|
322
261
|
);
|
|
262
|
+
const { rerender } = render(<Hero heroType="primary" heading={heading} />);
|
|
323
263
|
expect(warn).toHaveBeenCalledWith(
|
|
324
264
|
"NYPL Reservoir Hero: It is recommended to use the `backgroundImageSrc` " +
|
|
325
|
-
"prop for the `
|
|
265
|
+
"prop for the `'primary'` `heroType` variant."
|
|
326
266
|
);
|
|
327
267
|
|
|
328
268
|
rerender(
|
|
329
269
|
<Hero
|
|
330
270
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
331
|
-
heroType=
|
|
271
|
+
heroType="primary"
|
|
332
272
|
heading={heading}
|
|
333
|
-
|
|
334
|
-
imageSrc={imageSrc}
|
|
273
|
+
imageProps={imageProps}
|
|
335
274
|
/>
|
|
336
275
|
);
|
|
337
276
|
expect(warn).toHaveBeenCalledWith(
|
|
338
|
-
"NYPL Reservoir Hero: The `
|
|
339
|
-
"but the `
|
|
277
|
+
"NYPL Reservoir Hero: The `imageProps.src` and `imageProps.alt` props have been passed, " +
|
|
278
|
+
"but the `'primary'` `heroType` variant will not use it."
|
|
340
279
|
);
|
|
341
280
|
});
|
|
342
281
|
|
|
343
282
|
it("renders Secondary Hero with warnings in browser console", () => {
|
|
344
283
|
const warn = jest.spyOn(console, "warn");
|
|
345
284
|
const heading = (
|
|
346
|
-
<Heading
|
|
347
|
-
level={HeadingLevels.One}
|
|
348
|
-
id="hero-errors"
|
|
349
|
-
text="Hero with Error Warnings"
|
|
350
|
-
/>
|
|
285
|
+
<Heading level="one" id="hero-errors" text="Hero with Error Warnings" />
|
|
351
286
|
);
|
|
352
287
|
const { rerender } = render(
|
|
353
288
|
<Hero
|
|
354
|
-
heroType=
|
|
289
|
+
heroType="secondary"
|
|
355
290
|
heading={heading}
|
|
356
|
-
|
|
357
|
-
imageSrc={imageSrc}
|
|
291
|
+
imageProps={imageProps}
|
|
358
292
|
locationDetails={<>Some location details.</>}
|
|
359
293
|
subHeaderText={subHeaderText}
|
|
360
294
|
/>
|
|
361
295
|
);
|
|
362
296
|
expect(warn).toHaveBeenCalledWith(
|
|
363
297
|
"NYPL Reservoir Hero: The `locationDetails` prop should only be used " +
|
|
364
|
-
"with the `
|
|
298
|
+
"with the `'primary'` `heroType` variant."
|
|
365
299
|
);
|
|
366
300
|
|
|
367
301
|
rerender(
|
|
368
302
|
<Hero
|
|
369
303
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
370
|
-
heroType=
|
|
304
|
+
heroType="secondary"
|
|
371
305
|
heading={heading}
|
|
372
|
-
|
|
373
|
-
imageSrc={imageSrc}
|
|
306
|
+
imageProps={imageProps}
|
|
374
307
|
subHeaderText={subHeaderText}
|
|
375
308
|
/>
|
|
376
309
|
);
|
|
377
310
|
expect(warn).toHaveBeenCalledWith(
|
|
378
311
|
"NYPL Reservoir Hero: The `backgroundImageSrc` prop has been passed, " +
|
|
379
|
-
"but the `
|
|
312
|
+
"but the `'secondary'` `heroType` variant will not use it."
|
|
380
313
|
);
|
|
381
314
|
|
|
382
315
|
rerender(
|
|
383
316
|
<Hero
|
|
384
317
|
backgroundColor="#654321"
|
|
385
318
|
foregroundColor="#123456"
|
|
386
|
-
heroType=
|
|
319
|
+
heroType="secondary"
|
|
387
320
|
heading={heading}
|
|
388
|
-
|
|
389
|
-
imageSrc={imageSrc}
|
|
321
|
+
imageProps={imageProps}
|
|
390
322
|
subHeaderText={subHeaderText}
|
|
391
323
|
/>
|
|
392
324
|
);
|
|
393
325
|
expect(warn).toHaveBeenCalledWith(
|
|
394
326
|
"NYPL Reservoir Hero: The `foregroundColor` and/or `backgroundColor` " +
|
|
395
|
-
"props have been passed, but the `
|
|
327
|
+
"props have been passed, but the `'secondary'` `heroType` " +
|
|
396
328
|
"variant will not use them."
|
|
397
329
|
);
|
|
398
330
|
});
|
|
@@ -400,15 +332,11 @@ describe("Hero", () => {
|
|
|
400
332
|
it("renders Tertiary Hero with warnings in browser console", () => {
|
|
401
333
|
const warn = jest.spyOn(console, "warn");
|
|
402
334
|
const heading = (
|
|
403
|
-
<Heading
|
|
404
|
-
level={HeadingLevels.One}
|
|
405
|
-
id="hero-errors"
|
|
406
|
-
text="Hero with Error Warnings"
|
|
407
|
-
/>
|
|
335
|
+
<Heading level="one" id="hero-errors" text="Hero with Error Warnings" />
|
|
408
336
|
);
|
|
409
337
|
const { rerender } = render(
|
|
410
338
|
<Hero
|
|
411
|
-
heroType=
|
|
339
|
+
heroType="tertiary"
|
|
412
340
|
heading={heading}
|
|
413
341
|
subHeaderText={otherSubHeaderText}
|
|
414
342
|
locationDetails={<>Some location details.</>}
|
|
@@ -416,33 +344,32 @@ describe("Hero", () => {
|
|
|
416
344
|
);
|
|
417
345
|
expect(warn).toHaveBeenCalledWith(
|
|
418
346
|
"NYPL Reservoir Hero: The `locationDetails` prop should only be used " +
|
|
419
|
-
"with the `
|
|
347
|
+
"with the `'primary'` `heroType` variant."
|
|
420
348
|
);
|
|
421
349
|
|
|
422
350
|
rerender(
|
|
423
351
|
<Hero
|
|
424
|
-
heroType=
|
|
352
|
+
heroType="tertiary"
|
|
425
353
|
heading={heading}
|
|
426
|
-
|
|
427
|
-
imageSrc={imageSrc}
|
|
354
|
+
imageProps={imageProps}
|
|
428
355
|
subHeaderText={otherSubHeaderText}
|
|
429
356
|
/>
|
|
430
357
|
);
|
|
431
358
|
expect(warn).toHaveBeenCalledWith(
|
|
432
|
-
"NYPL Reservoir Hero: The `
|
|
359
|
+
"NYPL Reservoir Hero: The `'tertiary'` `heroType` variant hero " +
|
|
433
360
|
"will not use any of the image props."
|
|
434
361
|
);
|
|
435
362
|
|
|
436
363
|
rerender(
|
|
437
364
|
<Hero
|
|
438
365
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
439
|
-
heroType=
|
|
366
|
+
heroType="tertiary"
|
|
440
367
|
heading={heading}
|
|
441
368
|
subHeaderText={otherSubHeaderText}
|
|
442
369
|
/>
|
|
443
370
|
);
|
|
444
371
|
expect(warn).toHaveBeenCalledWith(
|
|
445
|
-
"NYPL Reservoir Hero: The `
|
|
372
|
+
"NYPL Reservoir Hero: The `'tertiary'` `heroType` variant hero " +
|
|
446
373
|
"will not use any of the image props."
|
|
447
374
|
);
|
|
448
375
|
});
|
|
@@ -450,47 +377,41 @@ describe("Hero", () => {
|
|
|
450
377
|
it("renders Campaign Hero with warnings in browser console", () => {
|
|
451
378
|
const warn = jest.spyOn(console, "warn");
|
|
452
379
|
const heading = (
|
|
453
|
-
<Heading
|
|
454
|
-
level={HeadingLevels.One}
|
|
455
|
-
id="hero-errors"
|
|
456
|
-
text="Hero with Error Warnings"
|
|
457
|
-
/>
|
|
380
|
+
<Heading level="one" id="hero-errors" text="Hero with Error Warnings" />
|
|
458
381
|
);
|
|
459
382
|
const { rerender } = render(
|
|
460
383
|
<Hero
|
|
461
384
|
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
462
|
-
heroType=
|
|
385
|
+
heroType="campaign"
|
|
463
386
|
heading={heading}
|
|
464
|
-
|
|
465
|
-
imageSrc={imageSrc}
|
|
387
|
+
imageProps={imageProps}
|
|
466
388
|
locationDetails={<>Some location details.</>}
|
|
467
389
|
subHeaderText={otherSubHeaderText}
|
|
468
390
|
/>
|
|
469
391
|
);
|
|
470
392
|
expect(warn).toHaveBeenCalledWith(
|
|
471
393
|
"NYPL Reservoir Hero: The `locationDetails` prop should only be used " +
|
|
472
|
-
"with the `
|
|
394
|
+
"with the `'primary'` `heroType` variant."
|
|
473
395
|
);
|
|
474
396
|
|
|
475
397
|
rerender(
|
|
476
398
|
<Hero
|
|
477
|
-
heroType=
|
|
399
|
+
heroType="campaign"
|
|
478
400
|
heading={heading}
|
|
479
|
-
|
|
480
|
-
imageSrc={imageSrc}
|
|
401
|
+
imageProps={imageProps}
|
|
481
402
|
subHeaderText={otherSubHeaderText}
|
|
482
403
|
locationDetails={<>Some location details.</>}
|
|
483
404
|
/>
|
|
484
405
|
);
|
|
485
406
|
expect(warn).toHaveBeenCalledWith(
|
|
486
407
|
"NYPL Reservoir Hero: It is recommended to use both the " +
|
|
487
|
-
"`backgroundImageSrc` and `
|
|
408
|
+
"`backgroundImageSrc` and `imageProps.src` props for the `'campaign'` " +
|
|
488
409
|
"`heroType` variant."
|
|
489
410
|
);
|
|
490
411
|
|
|
491
412
|
rerender(
|
|
492
413
|
<Hero
|
|
493
|
-
heroType=
|
|
414
|
+
heroType="campaign"
|
|
494
415
|
heading={heading}
|
|
495
416
|
subHeaderText={otherSubHeaderText}
|
|
496
417
|
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
@@ -499,7 +420,7 @@ describe("Hero", () => {
|
|
|
499
420
|
);
|
|
500
421
|
expect(warn).toHaveBeenCalledWith(
|
|
501
422
|
"NYPL Reservoir Hero: It is recommended to use both the " +
|
|
502
|
-
"`backgroundImageSrc` and `
|
|
423
|
+
"`backgroundImageSrc` and `imageProps.src` props for the `'campaign'` " +
|
|
503
424
|
"`heroType` variant."
|
|
504
425
|
);
|
|
505
426
|
});
|
|
@@ -508,30 +429,28 @@ describe("Hero", () => {
|
|
|
508
429
|
const warn = jest.spyOn(console, "warn");
|
|
509
430
|
const { rerender } = render(
|
|
510
431
|
<Hero
|
|
511
|
-
heroType=
|
|
432
|
+
heroType="fiftyFifty"
|
|
512
433
|
subHeaderText={otherSubHeaderText}
|
|
513
|
-
|
|
514
|
-
imageSrc={imageSrc}
|
|
434
|
+
imageProps={imageProps}
|
|
515
435
|
locationDetails={<>Some location details.</>}
|
|
516
436
|
/>
|
|
517
437
|
);
|
|
518
438
|
expect(warn).toHaveBeenCalledWith(
|
|
519
439
|
"NYPL Reservoir Hero: The `locationDetails` prop should only be used " +
|
|
520
|
-
"with the `
|
|
440
|
+
"with the `'primary'` `heroType` variant."
|
|
521
441
|
);
|
|
522
442
|
|
|
523
443
|
rerender(
|
|
524
444
|
<Hero
|
|
525
445
|
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
526
|
-
heroType=
|
|
527
|
-
|
|
528
|
-
imageSrc={imageSrc}
|
|
446
|
+
heroType="fiftyFifty"
|
|
447
|
+
imageProps={imageProps}
|
|
529
448
|
subHeaderText={otherSubHeaderText}
|
|
530
449
|
/>
|
|
531
450
|
);
|
|
532
451
|
expect(warn).toHaveBeenCalledWith(
|
|
533
452
|
"NYPL Reservoir Hero: The `backgroundImageSrc` prop has been passed, " +
|
|
534
|
-
"but the `
|
|
453
|
+
"but the `'fiftyFifty'` `heroType` variant hero will not use it."
|
|
535
454
|
);
|
|
536
455
|
});
|
|
537
456
|
|
|
@@ -539,13 +458,9 @@ describe("Hero", () => {
|
|
|
539
458
|
const primary = renderer
|
|
540
459
|
.create(
|
|
541
460
|
<Hero
|
|
542
|
-
heroType=
|
|
461
|
+
heroType="primary"
|
|
543
462
|
heading={
|
|
544
|
-
<Heading
|
|
545
|
-
level={HeadingLevels.One}
|
|
546
|
-
id="primary-hero"
|
|
547
|
-
text="Hero Primary"
|
|
548
|
-
/>
|
|
463
|
+
<Heading level="one" id="primary-hero" text="Hero Primary" />
|
|
549
464
|
}
|
|
550
465
|
subHeaderText="Example Subtitle"
|
|
551
466
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
@@ -555,16 +470,11 @@ describe("Hero", () => {
|
|
|
555
470
|
const secondary = renderer
|
|
556
471
|
.create(
|
|
557
472
|
<Hero
|
|
558
|
-
heroType=
|
|
473
|
+
heroType="secondary"
|
|
559
474
|
heading={
|
|
560
|
-
<Heading
|
|
561
|
-
level={HeadingLevels.One}
|
|
562
|
-
id="secondary-hero"
|
|
563
|
-
text="Hero Secondary"
|
|
564
|
-
/>
|
|
475
|
+
<Heading level="one" id="secondary-hero" text="Hero Secondary" />
|
|
565
476
|
}
|
|
566
|
-
|
|
567
|
-
imageSrc={imageSrc}
|
|
477
|
+
imageProps={imageProps}
|
|
568
478
|
subHeaderText={subHeaderText}
|
|
569
479
|
/>
|
|
570
480
|
)
|
|
@@ -572,16 +482,15 @@ describe("Hero", () => {
|
|
|
572
482
|
const secondaryBooksAndMore = renderer
|
|
573
483
|
.create(
|
|
574
484
|
<Hero
|
|
575
|
-
heroType=
|
|
485
|
+
heroType="secondaryBooksAndMore"
|
|
576
486
|
heading={
|
|
577
487
|
<Heading
|
|
578
|
-
level=
|
|
488
|
+
level="one"
|
|
579
489
|
id="secondary-hero"
|
|
580
490
|
text="Hero Secondary Books and More"
|
|
581
491
|
/>
|
|
582
492
|
}
|
|
583
|
-
|
|
584
|
-
imageSrc={imageSrc}
|
|
493
|
+
imageProps={imageProps}
|
|
585
494
|
subHeaderText={subHeaderText}
|
|
586
495
|
/>
|
|
587
496
|
)
|
|
@@ -589,16 +498,15 @@ describe("Hero", () => {
|
|
|
589
498
|
const secondaryLocations = renderer
|
|
590
499
|
.create(
|
|
591
500
|
<Hero
|
|
592
|
-
heroType=
|
|
501
|
+
heroType="secondaryLocations"
|
|
593
502
|
heading={
|
|
594
503
|
<Heading
|
|
595
|
-
level=
|
|
504
|
+
level="one"
|
|
596
505
|
id="secondary-hero"
|
|
597
506
|
text="Hero Secondary Locations"
|
|
598
507
|
/>
|
|
599
508
|
}
|
|
600
|
-
|
|
601
|
-
imageSrc={imageSrc}
|
|
509
|
+
imageProps={imageProps}
|
|
602
510
|
subHeaderText={subHeaderText}
|
|
603
511
|
/>
|
|
604
512
|
)
|
|
@@ -606,16 +514,11 @@ describe("Hero", () => {
|
|
|
606
514
|
const secondaryResearch = renderer
|
|
607
515
|
.create(
|
|
608
516
|
<Hero
|
|
609
|
-
heroType=
|
|
517
|
+
heroType="secondaryResearch"
|
|
610
518
|
heading={
|
|
611
|
-
<Heading
|
|
612
|
-
level={HeadingLevels.One}
|
|
613
|
-
id="secondary-hero"
|
|
614
|
-
text="Hero Secondary"
|
|
615
|
-
/>
|
|
519
|
+
<Heading level="one" id="secondary-hero" text="Hero Secondary" />
|
|
616
520
|
}
|
|
617
|
-
|
|
618
|
-
imageSrc={imageSrc}
|
|
521
|
+
imageProps={imageProps}
|
|
619
522
|
subHeaderText={subHeaderText}
|
|
620
523
|
/>
|
|
621
524
|
)
|
|
@@ -623,16 +526,15 @@ describe("Hero", () => {
|
|
|
623
526
|
const secondaryWhatsOn = renderer
|
|
624
527
|
.create(
|
|
625
528
|
<Hero
|
|
626
|
-
heroType=
|
|
529
|
+
heroType="secondaryWhatsOn"
|
|
627
530
|
heading={
|
|
628
531
|
<Heading
|
|
629
|
-
level=
|
|
532
|
+
level="one"
|
|
630
533
|
id="secondary-hero"
|
|
631
534
|
text="Hero Secondary What's On"
|
|
632
535
|
/>
|
|
633
536
|
}
|
|
634
|
-
|
|
635
|
-
imageSrc={imageSrc}
|
|
537
|
+
imageProps={imageProps}
|
|
636
538
|
subHeaderText={subHeaderText}
|
|
637
539
|
/>
|
|
638
540
|
)
|
|
@@ -641,16 +543,11 @@ describe("Hero", () => {
|
|
|
641
543
|
.create(
|
|
642
544
|
<Hero
|
|
643
545
|
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
644
|
-
heroType=
|
|
546
|
+
heroType="campaign"
|
|
645
547
|
heading={
|
|
646
|
-
<Heading
|
|
647
|
-
level={HeadingLevels.One}
|
|
648
|
-
id="campaign-hero"
|
|
649
|
-
text="Hero Campaign"
|
|
650
|
-
/>
|
|
548
|
+
<Heading level="one" id="campaign-hero" text="Hero Campaign" />
|
|
651
549
|
}
|
|
652
|
-
|
|
653
|
-
imageSrc={imageSrc}
|
|
550
|
+
imageProps={imageProps}
|
|
654
551
|
subHeaderText={otherSubHeaderText}
|
|
655
552
|
/>
|
|
656
553
|
)
|
|
@@ -658,13 +555,9 @@ describe("Hero", () => {
|
|
|
658
555
|
const tertiary = renderer
|
|
659
556
|
.create(
|
|
660
557
|
<Hero
|
|
661
|
-
heroType=
|
|
558
|
+
heroType="tertiary"
|
|
662
559
|
heading={
|
|
663
|
-
<Heading
|
|
664
|
-
level={HeadingLevels.One}
|
|
665
|
-
id="tertiary-hero"
|
|
666
|
-
text="Hero Tertiary"
|
|
667
|
-
/>
|
|
560
|
+
<Heading level="one" id="tertiary-hero" text="Hero Tertiary" />
|
|
668
561
|
}
|
|
669
562
|
subHeaderText={otherSubHeaderText}
|
|
670
563
|
/>
|
|
@@ -673,9 +566,8 @@ describe("Hero", () => {
|
|
|
673
566
|
const fiftyFifty = renderer
|
|
674
567
|
.create(
|
|
675
568
|
<Hero
|
|
676
|
-
heroType=
|
|
677
|
-
|
|
678
|
-
imageSrc={imageSrc}
|
|
569
|
+
heroType="fiftyFifty"
|
|
570
|
+
imageProps={imageProps}
|
|
679
571
|
subHeaderText={otherSubHeaderText}
|
|
680
572
|
/>
|
|
681
573
|
)
|
|
@@ -683,14 +575,8 @@ describe("Hero", () => {
|
|
|
683
575
|
const withChakraProps = renderer
|
|
684
576
|
.create(
|
|
685
577
|
<Hero
|
|
686
|
-
heroType=
|
|
687
|
-
heading={
|
|
688
|
-
<Heading
|
|
689
|
-
level={HeadingLevels.One}
|
|
690
|
-
id="chakra"
|
|
691
|
-
text="Hero Primary"
|
|
692
|
-
/>
|
|
693
|
-
}
|
|
578
|
+
heroType="primary"
|
|
579
|
+
heading={<Heading level="one" id="chakra" text="Hero Primary" />}
|
|
694
580
|
subHeaderText="Example Subtitle"
|
|
695
581
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
696
582
|
p="20px"
|
|
@@ -701,10 +587,8 @@ describe("Hero", () => {
|
|
|
701
587
|
const withOtherProps = renderer
|
|
702
588
|
.create(
|
|
703
589
|
<Hero
|
|
704
|
-
heroType=
|
|
705
|
-
heading={
|
|
706
|
-
<Heading level={HeadingLevels.One} id="props" text="Hero Primary" />
|
|
707
|
-
}
|
|
590
|
+
heroType="primary"
|
|
591
|
+
heading={<Heading level="one" id="props" text="Hero Primary" />}
|
|
708
592
|
subHeaderText="Example Subtitle"
|
|
709
593
|
backgroundImageSrc="https://placeimg.com/1600/800/arch"
|
|
710
594
|
data-testid="props"
|