@nypl/design-system-react-components 0.25.8 → 0.25.11
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 +110 -1
- package/README.md +1 -1
- package/dist/components/Button/Button.d.ts +6 -6
- package/dist/components/Button/ButtonTypes.d.ts +0 -1
- package/dist/components/Card/Card.d.ts +6 -4
- package/dist/components/Checkbox/Checkbox.d.ts +3 -2
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +3 -2
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +8 -2
- package/dist/components/DatePicker/DatePicker.d.ts +4 -3
- package/dist/components/Fieldset/Fieldset.d.ts +1 -3
- package/dist/components/Form/Form.d.ts +15 -14
- package/dist/components/Form/FormTypes.d.ts +2 -2
- package/dist/components/Heading/Heading.d.ts +7 -3
- package/dist/components/Heading/HeadingTypes.d.ts +6 -6
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +5 -2
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +3 -3
- package/dist/components/Icons/Icon.d.ts +4 -4
- package/dist/components/Icons/IconSvgs.d.ts +0 -21
- package/dist/components/Icons/IconTypes.d.ts +0 -23
- package/dist/components/Image/Image.d.ts +11 -3
- package/dist/components/List/List.d.ts +1 -1
- package/dist/components/Logo/Logo.d.ts +28 -0
- package/dist/components/Logo/LogoSvgs.d.ts +34 -0
- package/dist/components/Logo/LogoTypes.d.ts +46 -0
- package/dist/components/Modal/Modal.d.ts +0 -4
- package/dist/components/Notification/Notification.d.ts +4 -2
- package/dist/components/Placeholder/Placeholder.d.ts +3 -5
- package/dist/components/Radio/Radio.d.ts +6 -5
- package/dist/components/RadioGroup/RadioGroup.d.ts +6 -5
- package/dist/components/SearchBar/SearchBar.d.ts +15 -7
- package/dist/components/Select/Select.d.ts +7 -2
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +8 -4
- package/dist/components/Slider/Slider.d.ts +3 -2
- package/dist/components/StatusBadge/StatusBadge.d.ts +2 -1
- package/dist/components/StructuredContent/StructuredContent.d.ts +41 -0
- package/dist/components/StructuredContent/StructuredContentTypes.d.ts +5 -0
- package/dist/components/Table/Table.d.ts +29 -0
- package/dist/components/Template/Template.d.ts +30 -6
- package/dist/components/Text/Text.d.ts +2 -2
- package/dist/components/TextInput/TextInput.d.ts +4 -3
- package/dist/components/Toggle/Toggle.d.ts +3 -2
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +14 -5
- package/dist/design-system-react-components.cjs.development.js +6721 -5777
- 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 +6774 -5839
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +10 -8
- package/dist/resources.scss +0 -2
- package/dist/styles.css +2 -2
- package/dist/theme/components/breadcrumb.d.ts +1 -1
- package/dist/theme/components/button.d.ts +0 -12
- package/dist/theme/components/card.d.ts +14 -2
- package/dist/theme/components/customTable.d.ts +56 -0
- package/dist/theme/components/fieldset.d.ts +2 -2
- package/dist/theme/components/global.d.ts +1 -1
- package/dist/theme/components/heading.d.ts +4 -0
- package/dist/theme/components/label.d.ts +1 -1
- package/dist/theme/components/link.d.ts +14 -1
- package/dist/theme/components/list.d.ts +0 -2
- package/dist/theme/components/logo.d.ts +4 -0
- package/dist/theme/components/notification.d.ts +13 -4
- package/dist/theme/components/searchBar.d.ts +9 -11
- package/dist/theme/components/select.d.ts +1 -0
- package/dist/theme/components/structuredContent.d.ts +33 -0
- package/dist/theme/components/template.d.ts +10 -10
- package/dist/theme/components/textInput.d.ts +4 -0
- package/dist/theme/components/toggle.d.ts +8 -5
- package/dist/utils/utils.d.ts +10 -0
- package/package.json +40 -37
- package/src/__tests__/utils/utils.test.ts +23 -1
- package/src/components/Accordion/Accordion.stories.mdx +15 -13
- package/src/components/Accordion/Accordion.test.tsx +45 -1
- package/src/components/Accordion/Accordion.tsx +20 -8
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +243 -0
- package/src/components/Autosuggest/Autosuggest.stories.mdx +2 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +24 -48
- package/src/components/Autosuggest/_Autosuggest.scss +2 -6
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +43 -13
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +15 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -3
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +5 -5
- package/src/components/Button/Button.stories.mdx +93 -48
- package/src/components/Button/Button.test.tsx +0 -12
- package/src/components/Button/Button.tsx +7 -7
- package/src/components/Button/ButtonTypes.tsx +0 -1
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +0 -12
- package/src/components/Card/Card.stories.mdx +186 -71
- package/src/components/Card/Card.test.tsx +45 -22
- package/src/components/Card/Card.tsx +21 -6
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +9 -3
- package/src/components/Chakra/Box.stories.mdx +3 -3
- package/src/components/Chakra/Center.stories.mdx +5 -5
- package/src/components/Chakra/Flex.stories.mdx +113 -0
- package/src/components/Chakra/Grid.stories.mdx +3 -3
- package/src/components/Chakra/Stack.stories.mdx +2 -2
- package/src/components/Checkbox/Checkbox.stories.mdx +37 -15
- package/src/components/Checkbox/Checkbox.tsx +13 -8
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +48 -16
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +14 -10
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +6 -3
- package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +151 -0
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +36 -23
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +85 -0
- package/src/components/DatePicker/DatePicker.stories.mdx +63 -18
- package/src/components/DatePicker/DatePicker.test.tsx +6 -6
- package/src/components/DatePicker/DatePicker.tsx +17 -11
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +50 -24
- package/src/components/Fieldset/Fieldset.stories.mdx +20 -9
- package/src/components/Fieldset/Fieldset.tsx +2 -4
- package/src/components/Form/Form.stories.mdx +75 -49
- package/src/components/Form/Form.test.tsx +92 -3
- package/src/components/Form/Form.tsx +28 -23
- package/src/components/Form/FormTypes.tsx +2 -2
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +0 -1
- package/src/components/Grid/SimpleGrid.stories.mdx +26 -26
- package/src/components/Heading/Heading.stories.mdx +59 -23
- package/src/components/Heading/Heading.test.tsx +82 -18
- package/src/components/Heading/Heading.tsx +31 -31
- package/src/components/Heading/HeadingTypes.tsx +6 -6
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +71 -0
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +55 -27
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +42 -15
- package/src/components/HelperErrorText/HelperErrorText.tsx +24 -24
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +41 -4
- package/src/components/Hero/Hero.stories.mdx +72 -53
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +11 -9
- package/src/components/HorizontalRule/HorizontalRule.tsx +4 -6
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +4 -4
- package/src/components/Icons/Icon.stories.mdx +78 -77
- package/src/components/Icons/Icon.test.tsx +1 -1
- package/src/components/Icons/Icon.tsx +5 -6
- package/src/components/Icons/IconSvgs.tsx +0 -42
- package/src/components/Icons/IconTypes.tsx +0 -24
- package/src/components/Image/Image.stories.mdx +66 -18
- package/src/components/Image/Image.tsx +21 -10
- package/src/components/Label/Label.stories.mdx +20 -19
- package/src/components/Link/Link.stories.mdx +102 -51
- package/src/components/Link/Link.test.tsx +38 -8
- package/src/components/Link/Link.tsx +19 -12
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +60 -0
- package/src/components/List/List.stories.mdx +60 -29
- package/src/components/List/List.test.tsx +1 -1
- package/src/components/List/List.tsx +2 -2
- package/src/components/List/__snapshots__/List.test.tsx.snap +3 -1
- package/src/components/Logo/Logo.stories.mdx +222 -0
- package/src/components/Logo/Logo.test.tsx +98 -0
- package/src/components/Logo/Logo.tsx +97 -0
- package/src/components/Logo/LogoSvgs.tsx +66 -0
- package/src/components/Logo/LogoTypes.tsx +48 -0
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +71 -0
- package/src/components/Modal/Modal.stories.mdx +20 -5
- package/src/components/Modal/Modal.tsx +2 -8
- package/src/components/Notification/Notification.stories.mdx +128 -38
- package/src/components/Notification/Notification.test.tsx +49 -1
- package/src/components/Notification/Notification.tsx +25 -12
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +4 -0
- package/src/components/Pagination/Pagination.stories.mdx +18 -7
- package/src/components/Pagination/Pagination.tsx +3 -3
- package/src/components/Placeholder/Placeholder.tsx +7 -14
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +72 -43
- package/src/components/Radio/Radio.stories.mdx +39 -19
- package/src/components/Radio/Radio.tsx +13 -9
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +5 -5
- package/src/components/RadioGroup/RadioGroup.stories.mdx +50 -16
- package/src/components/RadioGroup/RadioGroup.test.tsx +13 -11
- package/src/components/RadioGroup/RadioGroup.tsx +97 -94
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +24 -21
- package/src/components/SearchBar/SearchBar.Test.tsx +160 -34
- package/src/components/SearchBar/SearchBar.stories.mdx +115 -33
- package/src/components/SearchBar/SearchBar.tsx +72 -51
- package/src/components/Select/Select.stories.mdx +48 -14
- package/src/components/Select/Select.test.tsx +89 -0
- package/src/components/Select/Select.tsx +27 -12
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +545 -0
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +50 -16
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +8 -4
- package/src/components/Slider/Slider.stories.mdx +72 -22
- package/src/components/Slider/Slider.tsx +15 -10
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +67 -30
- package/src/components/StatusBadge/StatusBadge.stories.mdx +33 -18
- package/src/components/StatusBadge/StatusBadge.tsx +2 -1
- package/src/components/StructuredContent/StructuredContent.stories.mdx +427 -0
- package/src/components/StructuredContent/StructuredContent.test.tsx +376 -0
- package/src/components/StructuredContent/StructuredContent.tsx +153 -0
- package/src/components/StructuredContent/StructuredContentTypes.tsx +5 -0
- package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +283 -0
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +32 -83
- package/src/components/StyleGuide/Breakpoints.stories.mdx +1 -11
- package/src/components/StyleGuide/Buttons.stories.mdx +3 -18
- package/src/components/StyleGuide/ColorCard.tsx +1 -2
- package/src/components/StyleGuide/Colors.stories.mdx +3 -11
- package/src/components/StyleGuide/DesignTokens.stories.mdx +3 -8
- package/src/components/StyleGuide/Forms.stories.mdx +2 -10
- package/src/components/StyleGuide/Iconography.stories.mdx +8 -34
- package/src/components/StyleGuide/Spacing.stories.mdx +3 -14
- package/src/components/StyleGuide/Typography.stories.mdx +64 -76
- package/src/components/Table/Table.stories.mdx +165 -0
- package/src/components/Table/Table.test.tsx +137 -0
- package/src/components/Table/Table.tsx +126 -0
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +1179 -0
- package/src/components/Tabs/Tabs.stories.mdx +20 -14
- package/src/components/Tabs/Tabs.test.tsx +21 -5
- package/src/components/Tabs/Tabs.tsx +35 -20
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +195 -0
- package/src/components/Template/Template.stories.mdx +132 -48
- package/src/components/Template/Template.test.tsx +128 -6
- package/src/components/Template/Template.tsx +93 -13
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +169 -0
- package/src/components/Text/Text.stories.mdx +33 -11
- package/src/components/Text/Text.tsx +2 -2
- package/src/components/TextInput/TextInput.stories.mdx +84 -17
- package/src/components/TextInput/TextInput.test.tsx +96 -0
- package/src/components/TextInput/TextInput.tsx +12 -8
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +240 -0
- package/src/components/Toggle/Toggle.stories.mdx +33 -9
- package/src/components/Toggle/Toggle.tsx +14 -9
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +4 -4
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +64 -14
- package/src/components/VideoPlayer/VideoPlayer.tsx +17 -7
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +12 -6
- package/src/docs/Chakra.stories.mdx +5 -8
- package/src/docs/Intro.stories.mdx +2 -2
- package/src/index.ts +13 -6
- package/src/styles/base/_03-base.scss +1 -1
- package/src/styles/base/_place-holder.scss +7 -7
- package/src/styles.scss +1 -5
- package/src/theme/components/breadcrumb.ts +4 -4
- package/src/theme/components/button.ts +5 -12
- package/src/theme/components/card.ts +5 -2
- package/src/theme/components/checkbox.ts +1 -1
- package/src/theme/components/customTable.ts +63 -0
- package/src/theme/components/datePicker.ts +1 -1
- package/src/theme/components/global.ts +7 -7
- package/src/theme/components/heading.ts +13 -11
- package/src/theme/components/helperErrorText.ts +1 -1
- package/src/theme/components/image.ts +1 -1
- package/src/theme/components/link.ts +17 -5
- package/src/theme/components/list.ts +3 -5
- package/src/theme/components/logo.ts +54 -0
- package/src/theme/components/notification.ts +19 -9
- package/src/theme/components/searchBar.ts +11 -13
- package/src/theme/components/select.ts +1 -0
- package/src/theme/components/statusBadge.ts +1 -1
- package/src/theme/components/structuredContent.ts +74 -0
- package/src/theme/components/template.ts +10 -10
- package/src/theme/components/text.ts +6 -6
- package/src/theme/components/textInput.ts +2 -0
- package/src/theme/components/toggle.ts +10 -6
- package/src/theme/components/videoPlayer.ts +0 -2
- package/src/theme/foundations/global.ts +2 -2
- package/src/theme/foundations/typography.ts +84 -12
- package/src/theme/index.ts +6 -0
- package/src/utils/componentCategories.ts +2 -1
- package/src/utils/utils.ts +17 -0
- package/dist/__tests__/utils/bem.test.d.ts +0 -1
- package/dist/components/CardEdition/CardEdition.d.ts +0 -21
- package/dist/components/CardEdition/CardEdition.stories.d.ts +0 -27
- package/dist/components/Input/Input.d.ts +0 -36
- package/dist/components/Input/Input.stories.d.ts +0 -29
- package/dist/components/Input/InputTypes.d.ts +0 -6
- package/dist/components/StyleGuide/UIDocCard.d.ts +0 -11
- package/dist/helpers/CSSVariablesHelper.d.ts +0 -3
- package/dist/helpers/getCSSVariable.d.ts +0 -1
- package/dist/interfaces.d.ts +0 -3
- package/dist/utils/bem.d.ts +0 -1
- package/src/__tests__/utils/bem.test.ts +0 -37
- package/src/components/CardEdition/CardEdition.stories.tsx +0 -122
- package/src/components/CardEdition/CardEdition.test.tsx +0 -395
- package/src/components/CardEdition/CardEdition.tsx +0 -60
- package/src/components/CardEdition/_CardEdition.scss +0 -137
- package/src/components/Input/Input.stories.tsx +0 -133
- package/src/components/Input/Input.test.tsx +0 -266
- package/src/components/Input/Input.tsx +0 -81
- package/src/components/Input/InputTypes.tsx +0 -8
- package/src/components/Input/_Input.scss +0 -78
- package/src/components/StyleGuide/UIDocCard.tsx +0 -36
- package/src/helpers/CSSVariablesHelper.tsx +0 -34
- package/src/helpers/getCSSVariable.tsx +0 -5
- package/src/interfaces.ts +0 -3
- package/src/utils/bem.ts +0 -44
|
@@ -1,14 +1,35 @@
|
|
|
1
1
|
import {
|
|
2
|
-
Meta,
|
|
3
|
-
Story,
|
|
4
|
-
Canvas,
|
|
5
2
|
ArgsTable,
|
|
3
|
+
Canvas,
|
|
6
4
|
Description,
|
|
7
|
-
|
|
5
|
+
Meta,
|
|
6
|
+
Story,
|
|
7
|
+
} from "@storybook/addon-docs";
|
|
8
8
|
import { withDesign } from "storybook-addon-designs";
|
|
9
9
|
|
|
10
|
+
import Accordion from "../Accordion/Accordion";
|
|
11
|
+
import { faqContent } from "../Accordion/Accordion.stories.mdx";
|
|
12
|
+
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
|
13
|
+
import Button from "../Button/Button";
|
|
14
|
+
import Card, { CardHeading, CardContent, CardActions } from "../Card/Card";
|
|
15
|
+
import Form, { FormRow, FormField } from "../Form/Form";
|
|
16
|
+
import Heading from "../Heading/Heading";
|
|
17
|
+
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
18
|
+
import Hero from "../Hero/Hero";
|
|
19
|
+
import HorizontalRule from "../HorizontalRule/HorizontalRule";
|
|
20
|
+
import { HeroTypes } from "../Hero/HeroTypes";
|
|
21
|
+
import Image from "../Image/Image";
|
|
22
|
+
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
23
|
+
import Link from "../Link/Link";
|
|
24
|
+
import Notification, {
|
|
25
|
+
NotificationContent,
|
|
26
|
+
NotificationHeading,
|
|
27
|
+
NotificationProps,
|
|
28
|
+
} from "../Notification/Notification";
|
|
29
|
+
import Placeholder from "../Placeholder/Placeholder";
|
|
10
30
|
import {
|
|
11
31
|
Template,
|
|
32
|
+
TemplateAboveHeader,
|
|
12
33
|
TemplateHeader,
|
|
13
34
|
TemplateBreakout,
|
|
14
35
|
TemplateContent,
|
|
@@ -18,27 +39,7 @@ import {
|
|
|
18
39
|
TemplateFooter,
|
|
19
40
|
TemplateAppContainer,
|
|
20
41
|
} from "./Template";
|
|
21
|
-
import Placeholder from "../Placeholder/Placeholder";
|
|
22
|
-
import Hero from "../Hero/Hero";
|
|
23
|
-
import { HeroTypes } from "../Hero/HeroTypes";
|
|
24
|
-
import Image from "../Image/Image";
|
|
25
|
-
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
26
|
-
import Breadcrumbs from "../Breadcrumbs/Breadcrumbs";
|
|
27
|
-
import HorizontalRule from "../HorizontalRule/HorizontalRule";
|
|
28
|
-
import Heading from "../Heading/Heading";
|
|
29
|
-
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
30
|
-
import Notification, {
|
|
31
|
-
NotificationContent,
|
|
32
|
-
NotificationHeading,
|
|
33
|
-
NotificationProps,
|
|
34
|
-
} from "../Notification/Notification";
|
|
35
|
-
import Form, { FormRow, FormField } from "../Form/Form";
|
|
36
42
|
import TextInput from "../TextInput/TextInput";
|
|
37
|
-
import Button from "../Button/Button";
|
|
38
|
-
import Link from "../Link/Link";
|
|
39
|
-
import Card, { CardHeading, CardContent, CardActions } from "../Card/Card";
|
|
40
|
-
import Accordion from "../Accordion/Accordion";
|
|
41
|
-
import { faqContent } from "../Accordion/Accordion.stories.mdx";
|
|
42
43
|
import { NotificationTypes } from "../Notification/NotificationTypes";
|
|
43
44
|
import { getCategory } from "../../utils/componentCategories";
|
|
44
45
|
|
|
@@ -49,7 +50,7 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
49
50
|
parameters={{
|
|
50
51
|
design: {
|
|
51
52
|
type: "figma",
|
|
52
|
-
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/
|
|
53
|
+
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36835%3A26688",
|
|
53
54
|
},
|
|
54
55
|
}}
|
|
55
56
|
/>
|
|
@@ -59,23 +60,38 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
59
60
|
| Component Version | DS Version |
|
|
60
61
|
| ----------------- | ---------- |
|
|
61
62
|
| Added | `0.3.6` |
|
|
62
|
-
| Latest | `0.25.
|
|
63
|
+
| Latest | `0.25.10` |
|
|
63
64
|
|
|
64
65
|
## TemplateAppContainer Component
|
|
65
66
|
|
|
66
67
|
<Description of={TemplateAppContainer} />
|
|
67
68
|
|
|
69
|
+
If you have a custom `Header` component that _already_ renders an HTML `<header>`
|
|
70
|
+
element, set `renderHeaderElement` to false so only one `<header>` element is
|
|
71
|
+
rendered.
|
|
72
|
+
|
|
73
|
+
Likewise, if you have a custom `Footer` component that _already_ renders an HTML
|
|
74
|
+
`<footer>` element, set `renderFooterElement` to false so only one `<footer>`
|
|
75
|
+
element is rendered.
|
|
76
|
+
|
|
77
|
+
If you need to render an alert or notification at the top of the page with an
|
|
78
|
+
`aside` HTML element or HTML element with the `role="complementary"` attribute,
|
|
79
|
+
then pass that alert or notification component to the `aboveHeader` prop. These
|
|
80
|
+
elements should _not_ be rendered in the `header` HTML section since that's an
|
|
81
|
+
accessibility violation.
|
|
82
|
+
|
|
68
83
|
<b>This is the recommended way to render an app page template.</b>
|
|
69
84
|
|
|
70
85
|
```jsx
|
|
71
86
|
import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
72
87
|
|
|
73
88
|
<TemplateAppContainer
|
|
74
|
-
|
|
89
|
+
aboveHeader={<Placeholder variant="short">Above Header</Placeholder>}
|
|
90
|
+
header={<Placeholder variant="short">NYPL Header</Placeholder>}
|
|
75
91
|
breakout={
|
|
76
92
|
<>
|
|
77
|
-
<Placeholder
|
|
78
|
-
<Placeholder
|
|
93
|
+
<Placeholder variant="short">Breadcrumbs</Placeholder>
|
|
94
|
+
<Placeholder variant="short">Hero</Placeholder>
|
|
79
95
|
</>
|
|
80
96
|
}
|
|
81
97
|
sidebar="left"
|
|
@@ -84,10 +100,10 @@ import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
|
84
100
|
contentPrimary={
|
|
85
101
|
<>
|
|
86
102
|
<Placeholder>Main Content</Placeholder>
|
|
87
|
-
<Placeholder
|
|
103
|
+
<Placeholder variant="short">More Content</Placeholder>
|
|
88
104
|
</>
|
|
89
105
|
}
|
|
90
|
-
footer={<Placeholder
|
|
106
|
+
footer={<Placeholder variant="short">Footer</Placeholder>}
|
|
91
107
|
/>;
|
|
92
108
|
```
|
|
93
109
|
|
|
@@ -95,31 +111,39 @@ import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
|
95
111
|
<Story
|
|
96
112
|
name="TemplateAppContainer Component"
|
|
97
113
|
args={{
|
|
98
|
-
|
|
114
|
+
aboveHeader: <Placeholder variant="short">Above Header</Placeholder>,
|
|
99
115
|
breakout: (
|
|
100
116
|
<>
|
|
101
|
-
<Placeholder
|
|
102
|
-
<Placeholder
|
|
117
|
+
<Placeholder variant="short">Breadcrumbs</Placeholder>
|
|
118
|
+
<Placeholder variant="short">Hero</Placeholder>
|
|
103
119
|
</>
|
|
104
120
|
),
|
|
105
|
-
sidebar: "left",
|
|
106
|
-
contentTop: <Placeholder>Content Top</Placeholder>,
|
|
107
|
-
contentSidebar: <Placeholder>Left Sidebar</Placeholder>,
|
|
108
121
|
contentPrimary: (
|
|
109
122
|
<>
|
|
110
123
|
<Placeholder>Main Content</Placeholder>
|
|
111
|
-
<Placeholder
|
|
124
|
+
<Placeholder variant="short">More Content</Placeholder>
|
|
112
125
|
</>
|
|
113
126
|
),
|
|
114
|
-
|
|
127
|
+
contentSidebar: <Placeholder>Left Sidebar</Placeholder>,
|
|
128
|
+
contentTop: <Placeholder>Content Top</Placeholder>,
|
|
129
|
+
footer: <Placeholder variant="short">Footer</Placeholder>,
|
|
130
|
+
header: <Placeholder variant="short">NYPL Header</Placeholder>,
|
|
131
|
+
sidebar: "left",
|
|
132
|
+
renderFooterElement: true,
|
|
133
|
+
renderHeaderElement: true,
|
|
115
134
|
}}
|
|
116
135
|
argTypes={{
|
|
117
|
-
|
|
136
|
+
aboveHeader: { control: false },
|
|
118
137
|
breakout: { control: false },
|
|
119
|
-
contentTop: { control: false },
|
|
120
|
-
contentSidebar: { control: false },
|
|
121
138
|
contentPrimary: { control: false },
|
|
139
|
+
contentSidebar: { control: false },
|
|
140
|
+
contentTop: { control: false },
|
|
122
141
|
footer: { control: false },
|
|
142
|
+
header: { control: false },
|
|
143
|
+
sidebar: {
|
|
144
|
+
control: false,
|
|
145
|
+
table: { defaultValue: { summary: "none" } },
|
|
146
|
+
},
|
|
123
147
|
}}
|
|
124
148
|
>
|
|
125
149
|
{(args) => <TemplateAppContainer {...args} />}
|
|
@@ -141,6 +165,7 @@ Basic "template" components structure:
|
|
|
141
165
|
```
|
|
142
166
|
import {
|
|
143
167
|
Template,
|
|
168
|
+
TemplateAboveHeader,
|
|
144
169
|
TemplateHeader,
|
|
145
170
|
TemplateBreakout,
|
|
146
171
|
TemplateContent,
|
|
@@ -152,6 +177,9 @@ import {
|
|
|
152
177
|
|
|
153
178
|
|
|
154
179
|
<Template>
|
|
180
|
+
<TemplateAboveHeader>
|
|
181
|
+
// ...
|
|
182
|
+
</TemplateAboveHeader>
|
|
155
183
|
<TemplateHeader>
|
|
156
184
|
// ...
|
|
157
185
|
<TemplateBreakout>
|
|
@@ -159,7 +187,7 @@ import {
|
|
|
159
187
|
</TemplateBreakout>
|
|
160
188
|
</TemplateHeader>
|
|
161
189
|
|
|
162
|
-
<TemplateContent>
|
|
190
|
+
<TemplateContent sidebar="...">
|
|
163
191
|
<TemplateContentTop>
|
|
164
192
|
// ...
|
|
165
193
|
</TemplateContentTop>
|
|
@@ -182,21 +210,26 @@ import {
|
|
|
182
210
|
sidebar: "left",
|
|
183
211
|
}}
|
|
184
212
|
argTypes={{
|
|
213
|
+
aboveHeader: { table: { disable: true } },
|
|
185
214
|
breakout: { table: { disable: true } },
|
|
186
215
|
contentPrimary: { table: { disable: true } },
|
|
187
216
|
contentSidebar: { table: { disable: true } },
|
|
188
217
|
contentTop: { table: { disable: true } },
|
|
189
218
|
footer: { table: { disable: true } },
|
|
190
219
|
header: { table: { disable: true } },
|
|
220
|
+
sidebar: { description: "Only used in Storybook." },
|
|
191
221
|
}}
|
|
192
222
|
>
|
|
193
223
|
{(args) => (
|
|
194
224
|
<Template>
|
|
225
|
+
<TemplateAboveHeader>
|
|
226
|
+
<Placeholder variant="short">Above Header</Placeholder>
|
|
227
|
+
</TemplateAboveHeader>
|
|
195
228
|
<TemplateHeader>
|
|
196
|
-
<Placeholder
|
|
229
|
+
<Placeholder variant="short">NYPL Header</Placeholder>
|
|
197
230
|
<TemplateBreakout>
|
|
198
|
-
<Placeholder
|
|
199
|
-
<Placeholder
|
|
231
|
+
<Placeholder variant="short">Breadcrumbs</Placeholder>
|
|
232
|
+
<Placeholder variant="short">Hero</Placeholder>
|
|
200
233
|
</TemplateBreakout>
|
|
201
234
|
</TemplateHeader>
|
|
202
235
|
<TemplateContent sidebar={args.sidebar}>
|
|
@@ -210,7 +243,7 @@ import {
|
|
|
210
243
|
)}
|
|
211
244
|
<TemplateContentPrimary>
|
|
212
245
|
<Placeholder>Main Content</Placeholder>
|
|
213
|
-
<Placeholder
|
|
246
|
+
<Placeholder variant="short">More Content</Placeholder>
|
|
214
247
|
</TemplateContentPrimary>
|
|
215
248
|
{args.sidebar === "right" && (
|
|
216
249
|
<TemplateContentSidebar>
|
|
@@ -219,7 +252,7 @@ import {
|
|
|
219
252
|
)}
|
|
220
253
|
</TemplateContent>
|
|
221
254
|
<TemplateFooter>
|
|
222
|
-
<Placeholder
|
|
255
|
+
<Placeholder variant="short">Footer</Placeholder>
|
|
223
256
|
</TemplateFooter>
|
|
224
257
|
</Template>
|
|
225
258
|
)}
|
|
@@ -233,6 +266,7 @@ import {
|
|
|
233
266
|
The components consist of:
|
|
234
267
|
|
|
235
268
|
- `Template`
|
|
269
|
+
- `TemplateAboveHeader`
|
|
236
270
|
- `TemplateHeader`
|
|
237
271
|
- `TemplateBreakout`
|
|
238
272
|
- `TemplateContent`
|
|
@@ -251,10 +285,25 @@ The components consist of:
|
|
|
251
285
|
|
|
252
286
|
<Description of={Template} />
|
|
253
287
|
|
|
288
|
+
#### TemplateAboveHeader
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
<Template>
|
|
292
|
+
<TemplateAboveHeader>
|
|
293
|
+
// ...
|
|
294
|
+
</TemplateAboveHeader>
|
|
295
|
+
<Template>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
<Description of={TemplateAboveHeader} />
|
|
299
|
+
|
|
254
300
|
#### TemplateHeader
|
|
255
301
|
|
|
256
302
|
```
|
|
257
303
|
<Template>
|
|
304
|
+
<TemplateAboveHeader>
|
|
305
|
+
// ...
|
|
306
|
+
</TemplateAboveHeader>
|
|
258
307
|
<TemplateHeader>
|
|
259
308
|
// ...
|
|
260
309
|
</TemplateHeader>
|
|
@@ -267,6 +316,9 @@ The components consist of:
|
|
|
267
316
|
|
|
268
317
|
```
|
|
269
318
|
<Template>
|
|
319
|
+
<TemplateAboveHeader>
|
|
320
|
+
// ...
|
|
321
|
+
</TemplateAboveHeader>
|
|
270
322
|
<TemplateHeader>
|
|
271
323
|
<TemplateBreakout>
|
|
272
324
|
// ...
|
|
@@ -294,6 +346,9 @@ The components consist of:
|
|
|
294
346
|
|
|
295
347
|
```
|
|
296
348
|
<Template>
|
|
349
|
+
<TemplateAboveHeader>
|
|
350
|
+
// ...
|
|
351
|
+
</TemplateAboveHeader>
|
|
297
352
|
<TemplateHeader>...</TemplateHeader>
|
|
298
353
|
<TemplateContent>
|
|
299
354
|
<TemplateContentTop>
|
|
@@ -309,6 +364,9 @@ The components consist of:
|
|
|
309
364
|
|
|
310
365
|
```
|
|
311
366
|
<Template>
|
|
367
|
+
<TemplateAboveHeader>
|
|
368
|
+
// ...
|
|
369
|
+
</TemplateAboveHeader>
|
|
312
370
|
<TemplateHeader>...</TemplateHeader>
|
|
313
371
|
<TemplateContent>
|
|
314
372
|
<TemplateContentPrimary>
|
|
@@ -324,6 +382,9 @@ The components consist of:
|
|
|
324
382
|
|
|
325
383
|
```
|
|
326
384
|
<Template>
|
|
385
|
+
<TemplateAboveHeader>
|
|
386
|
+
// ...
|
|
387
|
+
</TemplateAboveHeader>
|
|
327
388
|
<TemplateHeader>...</TemplateHeader>
|
|
328
389
|
<TemplateContent sidebar="right">
|
|
329
390
|
<TemplateContentPrimary>
|
|
@@ -336,6 +397,9 @@ The components consist of:
|
|
|
336
397
|
<Template>
|
|
337
398
|
|
|
338
399
|
<Template>
|
|
400
|
+
<TemplateAboveHeader>
|
|
401
|
+
// ...
|
|
402
|
+
</TemplateAboveHeader>
|
|
339
403
|
<TemplateHeader>...</TemplateHeader>
|
|
340
404
|
<TemplateContent sidebar="left">
|
|
341
405
|
<TemplateContentSidebar>
|
|
@@ -354,6 +418,9 @@ The components consist of:
|
|
|
354
418
|
|
|
355
419
|
```
|
|
356
420
|
<Template>
|
|
421
|
+
<TemplateAboveHeader>
|
|
422
|
+
// ...
|
|
423
|
+
</TemplateAboveHeader>
|
|
357
424
|
<TemplateHeader>
|
|
358
425
|
// ...
|
|
359
426
|
</TemplateHeader>
|
|
@@ -416,6 +483,23 @@ This is best viewed in the Storybook "Canvas" and not "Docs" section.
|
|
|
416
483
|
<Canvas>
|
|
417
484
|
<Story name="Full Example with Template Children Components">
|
|
418
485
|
<Template>
|
|
486
|
+
<TemplateAboveHeader>
|
|
487
|
+
<Notification
|
|
488
|
+
notificationType={NotificationTypes.Standard}
|
|
489
|
+
notificationHeading="Standard Notification"
|
|
490
|
+
notificationContent={
|
|
491
|
+
<>
|
|
492
|
+
This is an "announcement" Notification with a heading. Cras mattis
|
|
493
|
+
consectetur purus sit amet fermentum. Maecenas faucibus mollis
|
|
494
|
+
interdum. Morbi leo risus, porta ac consectetur ac, vestibulum at
|
|
495
|
+
eros. Cum sociis natoque penatibus et magnis dis parturient
|
|
496
|
+
montes, nascetur ridiculus mus. Vivamus sagittis lacus vel augue
|
|
497
|
+
laoreet rutrum faucibus dolor auctor.
|
|
498
|
+
</>
|
|
499
|
+
}
|
|
500
|
+
showIcon={false}
|
|
501
|
+
/>
|
|
502
|
+
</TemplateAboveHeader>
|
|
419
503
|
<TemplateHeader>
|
|
420
504
|
<TemplateBreakout>
|
|
421
505
|
<Breadcrumbs
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { render, screen } from "@testing-library/react";
|
|
3
3
|
import { axe } from "jest-axe";
|
|
4
|
+
import renderer from "react-test-renderer";
|
|
4
5
|
|
|
5
6
|
import {
|
|
6
7
|
Template,
|
|
8
|
+
TemplateAboveHeader,
|
|
7
9
|
TemplateHeader,
|
|
8
10
|
TemplateBreakout,
|
|
9
11
|
TemplateContent,
|
|
@@ -15,11 +17,12 @@ import {
|
|
|
15
17
|
} from "./Template";
|
|
16
18
|
import Placeholder from "../Placeholder/Placeholder";
|
|
17
19
|
|
|
18
|
-
const
|
|
20
|
+
const aboveHeader = <Placeholder variant="short">Above Header</Placeholder>;
|
|
21
|
+
const header = <Placeholder variant="short">NYPL Header</Placeholder>;
|
|
19
22
|
const breakout = (
|
|
20
23
|
<>
|
|
21
|
-
<Placeholder
|
|
22
|
-
<Placeholder
|
|
24
|
+
<Placeholder variant="short">Breadcrumbs</Placeholder>
|
|
25
|
+
<Placeholder variant="short">Hero</Placeholder>
|
|
23
26
|
</>
|
|
24
27
|
);
|
|
25
28
|
const sidebar = "left";
|
|
@@ -28,15 +31,16 @@ const contentSidebar = <Placeholder>Left Sidebar</Placeholder>;
|
|
|
28
31
|
const contentPrimary = (
|
|
29
32
|
<>
|
|
30
33
|
<Placeholder>Main Content</Placeholder>
|
|
31
|
-
<Placeholder
|
|
34
|
+
<Placeholder variant="short">More Content</Placeholder>
|
|
32
35
|
</>
|
|
33
36
|
);
|
|
34
|
-
const footer = <Placeholder
|
|
37
|
+
const footer = <Placeholder variant="short">Footer</Placeholder>;
|
|
35
38
|
|
|
36
39
|
describe("TemplateAppContainer accessibility", () => {
|
|
37
40
|
it("passes axe accessibility test", async () => {
|
|
38
41
|
const { container } = render(
|
|
39
42
|
<TemplateAppContainer
|
|
43
|
+
aboveHeader={aboveHeader}
|
|
40
44
|
header={header}
|
|
41
45
|
breakout={breakout}
|
|
42
46
|
sidebar={sidebar}
|
|
@@ -54,6 +58,7 @@ describe("Template components accessibility", () => {
|
|
|
54
58
|
it("passes axe accessibility test", async () => {
|
|
55
59
|
const { container } = render(
|
|
56
60
|
<Template>
|
|
61
|
+
<TemplateAboveHeader>{aboveHeader}</TemplateAboveHeader>
|
|
57
62
|
<TemplateHeader>
|
|
58
63
|
{header}
|
|
59
64
|
<TemplateBreakout>{breakout}</TemplateBreakout>
|
|
@@ -74,6 +79,7 @@ describe("TemplateAppContainer component", () => {
|
|
|
74
79
|
it("renders each section", () => {
|
|
75
80
|
render(
|
|
76
81
|
<TemplateAppContainer
|
|
82
|
+
aboveHeader={aboveHeader}
|
|
77
83
|
header={header}
|
|
78
84
|
breakout={breakout}
|
|
79
85
|
sidebar={sidebar}
|
|
@@ -83,7 +89,7 @@ describe("TemplateAppContainer component", () => {
|
|
|
83
89
|
footer={footer}
|
|
84
90
|
/>
|
|
85
91
|
);
|
|
86
|
-
|
|
92
|
+
expect(screen.getByText("Above Header")).toBeInTheDocument();
|
|
87
93
|
expect(screen.getByText("NYPL Header")).toBeInTheDocument();
|
|
88
94
|
expect(screen.getByText("Breadcrumbs")).toBeInTheDocument();
|
|
89
95
|
expect(screen.getByText("Hero")).toBeInTheDocument();
|
|
@@ -93,12 +99,90 @@ describe("TemplateAppContainer component", () => {
|
|
|
93
99
|
expect(screen.getByText("More Content")).toBeInTheDocument();
|
|
94
100
|
expect(screen.getByText("Footer")).toBeInTheDocument();
|
|
95
101
|
});
|
|
102
|
+
|
|
103
|
+
it("renders only one header in a custom header component", () => {
|
|
104
|
+
const customHeader = <header>Custom header</header>;
|
|
105
|
+
render(
|
|
106
|
+
<TemplateAppContainer
|
|
107
|
+
header={customHeader}
|
|
108
|
+
renderHeaderElement={false}
|
|
109
|
+
breakout={breakout}
|
|
110
|
+
sidebar={sidebar}
|
|
111
|
+
contentTop={contentTop}
|
|
112
|
+
contentSidebar={contentSidebar}
|
|
113
|
+
contentPrimary={contentPrimary}
|
|
114
|
+
footer={footer}
|
|
115
|
+
/>
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// The `<header>` HTML element has the same meaning as `role="banner"`.
|
|
119
|
+
expect(screen.getAllByRole("banner")).toHaveLength(1);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("consoles a warning when a header element was passed without setting `renderHeaderElement` to false", () => {
|
|
123
|
+
const warn = jest.spyOn(console, "warn");
|
|
124
|
+
const customHeader = <header>Custom header</header>;
|
|
125
|
+
render(
|
|
126
|
+
<TemplateAppContainer
|
|
127
|
+
header={customHeader}
|
|
128
|
+
breakout={breakout}
|
|
129
|
+
sidebar={sidebar}
|
|
130
|
+
contentTop={contentTop}
|
|
131
|
+
contentSidebar={contentSidebar}
|
|
132
|
+
contentPrimary={contentPrimary}
|
|
133
|
+
footer={footer}
|
|
134
|
+
/>
|
|
135
|
+
);
|
|
136
|
+
expect(warn).toHaveBeenCalledWith(
|
|
137
|
+
"`TemplateHeader`: An HTML `header` element was passed in. Set " +
|
|
138
|
+
"`renderHeaderElement` to `false` to avoid nested HTML `header` elements."
|
|
139
|
+
);
|
|
140
|
+
});
|
|
141
|
+
|
|
142
|
+
it("renders only one footer in a custom footer component", () => {
|
|
143
|
+
const customFooter = <footer>Custom Footer</footer>;
|
|
144
|
+
render(
|
|
145
|
+
<TemplateAppContainer
|
|
146
|
+
header={header}
|
|
147
|
+
breakout={breakout}
|
|
148
|
+
sidebar={sidebar}
|
|
149
|
+
contentTop={contentTop}
|
|
150
|
+
contentSidebar={contentSidebar}
|
|
151
|
+
contentPrimary={contentPrimary}
|
|
152
|
+
footer={customFooter}
|
|
153
|
+
renderFooterElement={false}
|
|
154
|
+
/>
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
expect(screen.getAllByRole("contentinfo")).toHaveLength(1);
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
it("consoles a warning when a footer element was passed without setting `renderFooterElement` to false", () => {
|
|
161
|
+
const warn = jest.spyOn(console, "warn");
|
|
162
|
+
const customFooter = <footer>Custom Footer</footer>;
|
|
163
|
+
render(
|
|
164
|
+
<TemplateAppContainer
|
|
165
|
+
header={header}
|
|
166
|
+
breakout={breakout}
|
|
167
|
+
sidebar={sidebar}
|
|
168
|
+
contentTop={contentTop}
|
|
169
|
+
contentSidebar={contentSidebar}
|
|
170
|
+
contentPrimary={contentPrimary}
|
|
171
|
+
footer={customFooter}
|
|
172
|
+
/>
|
|
173
|
+
);
|
|
174
|
+
expect(warn).toHaveBeenCalledWith(
|
|
175
|
+
"`TemplateFooter`: An HTML `footer` element was passed in. Set " +
|
|
176
|
+
"`renderFooterElement` to `false` to avoid nested HTML `footer` elements."
|
|
177
|
+
);
|
|
178
|
+
});
|
|
96
179
|
});
|
|
97
180
|
|
|
98
181
|
describe("Template components", () => {
|
|
99
182
|
it("renders each section", () => {
|
|
100
183
|
render(
|
|
101
184
|
<Template>
|
|
185
|
+
<TemplateAboveHeader>{aboveHeader}</TemplateAboveHeader>
|
|
102
186
|
<TemplateHeader>
|
|
103
187
|
{header}
|
|
104
188
|
<TemplateBreakout>{breakout}</TemplateBreakout>
|
|
@@ -112,6 +196,7 @@ describe("Template components", () => {
|
|
|
112
196
|
</Template>
|
|
113
197
|
);
|
|
114
198
|
|
|
199
|
+
expect(screen.getByText("Above Header")).toBeInTheDocument();
|
|
115
200
|
expect(screen.getByText("NYPL Header")).toBeInTheDocument();
|
|
116
201
|
expect(screen.getByText("Breadcrumbs")).toBeInTheDocument();
|
|
117
202
|
expect(screen.getByText("Hero")).toBeInTheDocument();
|
|
@@ -121,4 +206,41 @@ describe("Template components", () => {
|
|
|
121
206
|
expect(screen.getByText("More Content")).toBeInTheDocument();
|
|
122
207
|
expect(screen.getByText("Footer")).toBeInTheDocument();
|
|
123
208
|
});
|
|
209
|
+
|
|
210
|
+
it("Renders the UI snapshot correctly", () => {
|
|
211
|
+
const templateComponents = renderer
|
|
212
|
+
.create(
|
|
213
|
+
<Template>
|
|
214
|
+
<TemplateAboveHeader>{aboveHeader}</TemplateAboveHeader>
|
|
215
|
+
<TemplateHeader>
|
|
216
|
+
{header}
|
|
217
|
+
<TemplateBreakout>{breakout}</TemplateBreakout>
|
|
218
|
+
</TemplateHeader>
|
|
219
|
+
<TemplateContent sidebar={sidebar}>
|
|
220
|
+
<TemplateContentTop>{contentTop}</TemplateContentTop>
|
|
221
|
+
<TemplateContentSidebar>{contentSidebar}</TemplateContentSidebar>
|
|
222
|
+
<TemplateContentPrimary>{contentPrimary}</TemplateContentPrimary>
|
|
223
|
+
</TemplateContent>
|
|
224
|
+
<TemplateFooter>{footer}</TemplateFooter>
|
|
225
|
+
</Template>
|
|
226
|
+
)
|
|
227
|
+
.toJSON();
|
|
228
|
+
const singleComponent = renderer
|
|
229
|
+
.create(
|
|
230
|
+
<TemplateAppContainer
|
|
231
|
+
aboveHeader={aboveHeader}
|
|
232
|
+
header={header}
|
|
233
|
+
breakout={breakout}
|
|
234
|
+
sidebar={sidebar}
|
|
235
|
+
contentTop={contentTop}
|
|
236
|
+
contentSidebar={contentSidebar}
|
|
237
|
+
contentPrimary={contentPrimary}
|
|
238
|
+
footer={footer}
|
|
239
|
+
/>
|
|
240
|
+
)
|
|
241
|
+
.toJSON();
|
|
242
|
+
|
|
243
|
+
expect(templateComponents).toMatchSnapshot();
|
|
244
|
+
expect(singleComponent).toMatchSnapshot();
|
|
245
|
+
});
|
|
124
246
|
});
|