@nypl/design-system-react-components 0.25.7 → 0.25.10
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 +119 -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 +1 -21
- package/dist/components/Icons/IconTypes.d.ts +1 -23
- package/dist/components/Image/Image.d.ts +11 -3
- package/dist/components/Image/ImageTypes.d.ts +3 -1
- package/dist/components/Link/LinkTypes.d.ts +1 -0
- package/dist/components/Logo/Logo.d.ts +28 -0
- package/dist/components/Logo/LogoSvgs.d.ts +18 -0
- package/dist/components/Logo/LogoTypes.d.ts +30 -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 +5 -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 +48 -0
- package/dist/components/Toggle/ToggleSizes.d.ts +4 -0
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +17 -6
- package/dist/design-system-react-components.cjs.development.js +4698 -4405
- 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 +5862 -5573
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/index.d.ts +13 -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 +8 -4
- package/dist/theme/components/searchBar.d.ts +7 -13
- 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 +2 -0
- package/dist/theme/components/toggle.d.ts +71 -0
- package/dist/theme/foundations/spacing.d.ts +2 -0
- 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 +16 -15
- 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 +25 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -3
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +103 -4
- 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 -8
- 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 +246 -64
- package/src/components/Card/Card.test.tsx +45 -22
- package/src/components/Card/Card.tsx +30 -14
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +75 -37
- 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 +14 -17
- 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 +14 -12
- package/src/components/DatePicker/DatePicker.tsx +13 -10
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +41 -22
- 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 +77 -75
- package/src/components/Icons/Icon.tsx +4 -5
- package/src/components/Icons/IconSvgs.tsx +2 -42
- package/src/components/Icons/IconTypes.tsx +1 -24
- package/src/components/Image/Image.stories.mdx +214 -104
- package/src/components/Image/Image.test.tsx +10 -0
- package/src/components/Image/Image.tsx +21 -10
- package/src/components/Image/ImageTypes.ts +2 -0
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +24 -8
- package/src/components/Label/Label.stories.mdx +21 -20
- package/src/components/Link/Link.stories.mdx +103 -53
- package/src/components/Link/Link.test.tsx +108 -7
- package/src/components/Link/Link.tsx +58 -19
- package/src/components/Link/LinkTypes.tsx +1 -0
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +261 -0
- package/src/components/List/List.stories.mdx +37 -25
- package/src/components/List/List.tsx +1 -1
- package/src/components/Logo/Logo.stories.mdx +220 -0
- package/src/components/Logo/Logo.test.tsx +98 -0
- package/src/components/Logo/Logo.tsx +97 -0
- package/src/components/Logo/LogoSvgs.tsx +34 -0
- package/src/components/Logo/LogoTypes.tsx +32 -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 +96 -40
- package/src/components/Notification/Notification.test.tsx +62 -16
- package/src/components/Notification/Notification.tsx +26 -9
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +121 -0
- package/src/components/Pagination/Pagination.stories.mdx +19 -9
- package/src/components/Pagination/Pagination.tsx +3 -3
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +42 -0
- package/src/components/Placeholder/Placeholder.tsx +7 -14
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +74 -46
- 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 +116 -34
- package/src/components/SearchBar/SearchBar.tsx +70 -50
- package/src/components/Select/Select.stories.mdx +177 -66
- package/src/components/Select/Select.test.tsx +91 -2
- package/src/components/Select/Select.tsx +29 -13
- 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 +74 -23
- package/src/components/Slider/Slider.test.tsx +35 -0
- package/src/components/Slider/Slider.tsx +22 -11
- 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 +33 -18
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +195 -0
- package/src/components/Template/Template.stories.mdx +132 -49
- 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 +200 -0
- package/src/components/Toggle/Toggle.test.tsx +140 -0
- package/src/components/Toggle/Toggle.tsx +123 -0
- package/src/components/Toggle/ToggleSizes.tsx +4 -0
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +255 -0
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +96 -25
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +103 -1
- package/src/components/VideoPlayer/VideoPlayer.tsx +72 -22
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +57 -3
- package/src/docs/Chakra.stories.mdx +5 -8
- package/src/docs/Intro.stories.mdx +2 -2
- package/src/index.ts +19 -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 +5 -5
- package/src/theme/components/button.ts +5 -12
- package/src/theme/components/card.ts +9 -7
- 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/icon.ts +2 -2
- package/src/theme/components/image.ts +9 -1
- package/src/theme/components/link.ts +17 -5
- package/src/theme/components/list.ts +1 -3
- package/src/theme/components/logo.ts +54 -0
- package/src/theme/components/notification.ts +9 -7
- package/src/theme/components/searchBar.ts +7 -13
- package/src/theme/components/select.ts +1 -0
- package/src/theme/components/statusBadge.ts +1 -1
- package/src/theme/components/structuredContent.ts +54 -0
- package/src/theme/components/template.ts +10 -10
- package/src/theme/components/text.ts +6 -6
- package/src/theme/components/textInput.ts +1 -0
- package/src/theme/components/toggle.ts +69 -0
- package/src/theme/components/videoPlayer.ts +0 -2
- package/src/theme/foundations/global.ts +2 -2
- package/src/theme/foundations/spacing.ts +3 -0
- package/src/theme/foundations/typography.ts +84 -12
- package/src/theme/index.ts +8 -0
- package/src/utils/componentCategories.ts +5 -2
- 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,8 +50,7 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
49
50
|
parameters={{
|
|
50
51
|
design: {
|
|
51
52
|
type: "figma",
|
|
52
|
-
url:
|
|
53
|
-
"https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=11982%3A47778",
|
|
53
|
+
url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36835%3A26688",
|
|
54
54
|
},
|
|
55
55
|
}}
|
|
56
56
|
/>
|
|
@@ -60,23 +60,38 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
60
60
|
| Component Version | DS Version |
|
|
61
61
|
| ----------------- | ---------- |
|
|
62
62
|
| Added | `0.3.6` |
|
|
63
|
-
| Latest | `0.25.
|
|
63
|
+
| Latest | `0.25.10` |
|
|
64
64
|
|
|
65
65
|
## TemplateAppContainer Component
|
|
66
66
|
|
|
67
67
|
<Description of={TemplateAppContainer} />
|
|
68
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
|
+
|
|
69
83
|
<b>This is the recommended way to render an app page template.</b>
|
|
70
84
|
|
|
71
85
|
```jsx
|
|
72
86
|
import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
73
87
|
|
|
74
88
|
<TemplateAppContainer
|
|
75
|
-
|
|
89
|
+
aboveHeader={<Placeholder variant="short">Above Header</Placeholder>}
|
|
90
|
+
header={<Placeholder variant="short">NYPL Header</Placeholder>}
|
|
76
91
|
breakout={
|
|
77
92
|
<>
|
|
78
|
-
<Placeholder
|
|
79
|
-
<Placeholder
|
|
93
|
+
<Placeholder variant="short">Breadcrumbs</Placeholder>
|
|
94
|
+
<Placeholder variant="short">Hero</Placeholder>
|
|
80
95
|
</>
|
|
81
96
|
}
|
|
82
97
|
sidebar="left"
|
|
@@ -85,10 +100,10 @@ import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
|
85
100
|
contentPrimary={
|
|
86
101
|
<>
|
|
87
102
|
<Placeholder>Main Content</Placeholder>
|
|
88
|
-
<Placeholder
|
|
103
|
+
<Placeholder variant="short">More Content</Placeholder>
|
|
89
104
|
</>
|
|
90
105
|
}
|
|
91
|
-
footer={<Placeholder
|
|
106
|
+
footer={<Placeholder variant="short">Footer</Placeholder>}
|
|
92
107
|
/>;
|
|
93
108
|
```
|
|
94
109
|
|
|
@@ -96,31 +111,39 @@ import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
|
96
111
|
<Story
|
|
97
112
|
name="TemplateAppContainer Component"
|
|
98
113
|
args={{
|
|
99
|
-
|
|
114
|
+
aboveHeader: <Placeholder variant="short">Above Header</Placeholder>,
|
|
100
115
|
breakout: (
|
|
101
116
|
<>
|
|
102
|
-
<Placeholder
|
|
103
|
-
<Placeholder
|
|
117
|
+
<Placeholder variant="short">Breadcrumbs</Placeholder>
|
|
118
|
+
<Placeholder variant="short">Hero</Placeholder>
|
|
104
119
|
</>
|
|
105
120
|
),
|
|
106
|
-
sidebar: "left",
|
|
107
|
-
contentTop: <Placeholder>Content Top</Placeholder>,
|
|
108
|
-
contentSidebar: <Placeholder>Left Sidebar</Placeholder>,
|
|
109
121
|
contentPrimary: (
|
|
110
122
|
<>
|
|
111
123
|
<Placeholder>Main Content</Placeholder>
|
|
112
|
-
<Placeholder
|
|
124
|
+
<Placeholder variant="short">More Content</Placeholder>
|
|
113
125
|
</>
|
|
114
126
|
),
|
|
115
|
-
|
|
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,
|
|
116
134
|
}}
|
|
117
135
|
argTypes={{
|
|
118
|
-
|
|
136
|
+
aboveHeader: { control: false },
|
|
119
137
|
breakout: { control: false },
|
|
120
|
-
contentTop: { control: false },
|
|
121
|
-
contentSidebar: { control: false },
|
|
122
138
|
contentPrimary: { control: false },
|
|
139
|
+
contentSidebar: { control: false },
|
|
140
|
+
contentTop: { control: false },
|
|
123
141
|
footer: { control: false },
|
|
142
|
+
header: { control: false },
|
|
143
|
+
sidebar: {
|
|
144
|
+
control: false,
|
|
145
|
+
table: { defaultValue: { summary: "none" } },
|
|
146
|
+
},
|
|
124
147
|
}}
|
|
125
148
|
>
|
|
126
149
|
{(args) => <TemplateAppContainer {...args} />}
|
|
@@ -142,6 +165,7 @@ Basic "template" components structure:
|
|
|
142
165
|
```
|
|
143
166
|
import {
|
|
144
167
|
Template,
|
|
168
|
+
TemplateAboveHeader,
|
|
145
169
|
TemplateHeader,
|
|
146
170
|
TemplateBreakout,
|
|
147
171
|
TemplateContent,
|
|
@@ -153,6 +177,9 @@ import {
|
|
|
153
177
|
|
|
154
178
|
|
|
155
179
|
<Template>
|
|
180
|
+
<TemplateAboveHeader>
|
|
181
|
+
// ...
|
|
182
|
+
</TemplateAboveHeader>
|
|
156
183
|
<TemplateHeader>
|
|
157
184
|
// ...
|
|
158
185
|
<TemplateBreakout>
|
|
@@ -160,7 +187,7 @@ import {
|
|
|
160
187
|
</TemplateBreakout>
|
|
161
188
|
</TemplateHeader>
|
|
162
189
|
|
|
163
|
-
<TemplateContent>
|
|
190
|
+
<TemplateContent sidebar="...">
|
|
164
191
|
<TemplateContentTop>
|
|
165
192
|
// ...
|
|
166
193
|
</TemplateContentTop>
|
|
@@ -183,21 +210,26 @@ import {
|
|
|
183
210
|
sidebar: "left",
|
|
184
211
|
}}
|
|
185
212
|
argTypes={{
|
|
213
|
+
aboveHeader: { table: { disable: true } },
|
|
186
214
|
breakout: { table: { disable: true } },
|
|
187
215
|
contentPrimary: { table: { disable: true } },
|
|
188
216
|
contentSidebar: { table: { disable: true } },
|
|
189
217
|
contentTop: { table: { disable: true } },
|
|
190
218
|
footer: { table: { disable: true } },
|
|
191
219
|
header: { table: { disable: true } },
|
|
220
|
+
sidebar: { description: "Only used in Storybook." },
|
|
192
221
|
}}
|
|
193
222
|
>
|
|
194
223
|
{(args) => (
|
|
195
224
|
<Template>
|
|
225
|
+
<TemplateAboveHeader>
|
|
226
|
+
<Placeholder variant="short">Above Header</Placeholder>
|
|
227
|
+
</TemplateAboveHeader>
|
|
196
228
|
<TemplateHeader>
|
|
197
|
-
<Placeholder
|
|
229
|
+
<Placeholder variant="short">NYPL Header</Placeholder>
|
|
198
230
|
<TemplateBreakout>
|
|
199
|
-
<Placeholder
|
|
200
|
-
<Placeholder
|
|
231
|
+
<Placeholder variant="short">Breadcrumbs</Placeholder>
|
|
232
|
+
<Placeholder variant="short">Hero</Placeholder>
|
|
201
233
|
</TemplateBreakout>
|
|
202
234
|
</TemplateHeader>
|
|
203
235
|
<TemplateContent sidebar={args.sidebar}>
|
|
@@ -211,7 +243,7 @@ import {
|
|
|
211
243
|
)}
|
|
212
244
|
<TemplateContentPrimary>
|
|
213
245
|
<Placeholder>Main Content</Placeholder>
|
|
214
|
-
<Placeholder
|
|
246
|
+
<Placeholder variant="short">More Content</Placeholder>
|
|
215
247
|
</TemplateContentPrimary>
|
|
216
248
|
{args.sidebar === "right" && (
|
|
217
249
|
<TemplateContentSidebar>
|
|
@@ -220,7 +252,7 @@ import {
|
|
|
220
252
|
)}
|
|
221
253
|
</TemplateContent>
|
|
222
254
|
<TemplateFooter>
|
|
223
|
-
<Placeholder
|
|
255
|
+
<Placeholder variant="short">Footer</Placeholder>
|
|
224
256
|
</TemplateFooter>
|
|
225
257
|
</Template>
|
|
226
258
|
)}
|
|
@@ -234,6 +266,7 @@ import {
|
|
|
234
266
|
The components consist of:
|
|
235
267
|
|
|
236
268
|
- `Template`
|
|
269
|
+
- `TemplateAboveHeader`
|
|
237
270
|
- `TemplateHeader`
|
|
238
271
|
- `TemplateBreakout`
|
|
239
272
|
- `TemplateContent`
|
|
@@ -252,10 +285,25 @@ The components consist of:
|
|
|
252
285
|
|
|
253
286
|
<Description of={Template} />
|
|
254
287
|
|
|
288
|
+
#### TemplateAboveHeader
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
<Template>
|
|
292
|
+
<TemplateAboveHeader>
|
|
293
|
+
// ...
|
|
294
|
+
</TemplateAboveHeader>
|
|
295
|
+
<Template>
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
<Description of={TemplateAboveHeader} />
|
|
299
|
+
|
|
255
300
|
#### TemplateHeader
|
|
256
301
|
|
|
257
302
|
```
|
|
258
303
|
<Template>
|
|
304
|
+
<TemplateAboveHeader>
|
|
305
|
+
// ...
|
|
306
|
+
</TemplateAboveHeader>
|
|
259
307
|
<TemplateHeader>
|
|
260
308
|
// ...
|
|
261
309
|
</TemplateHeader>
|
|
@@ -268,6 +316,9 @@ The components consist of:
|
|
|
268
316
|
|
|
269
317
|
```
|
|
270
318
|
<Template>
|
|
319
|
+
<TemplateAboveHeader>
|
|
320
|
+
// ...
|
|
321
|
+
</TemplateAboveHeader>
|
|
271
322
|
<TemplateHeader>
|
|
272
323
|
<TemplateBreakout>
|
|
273
324
|
// ...
|
|
@@ -295,6 +346,9 @@ The components consist of:
|
|
|
295
346
|
|
|
296
347
|
```
|
|
297
348
|
<Template>
|
|
349
|
+
<TemplateAboveHeader>
|
|
350
|
+
// ...
|
|
351
|
+
</TemplateAboveHeader>
|
|
298
352
|
<TemplateHeader>...</TemplateHeader>
|
|
299
353
|
<TemplateContent>
|
|
300
354
|
<TemplateContentTop>
|
|
@@ -310,6 +364,9 @@ The components consist of:
|
|
|
310
364
|
|
|
311
365
|
```
|
|
312
366
|
<Template>
|
|
367
|
+
<TemplateAboveHeader>
|
|
368
|
+
// ...
|
|
369
|
+
</TemplateAboveHeader>
|
|
313
370
|
<TemplateHeader>...</TemplateHeader>
|
|
314
371
|
<TemplateContent>
|
|
315
372
|
<TemplateContentPrimary>
|
|
@@ -325,6 +382,9 @@ The components consist of:
|
|
|
325
382
|
|
|
326
383
|
```
|
|
327
384
|
<Template>
|
|
385
|
+
<TemplateAboveHeader>
|
|
386
|
+
// ...
|
|
387
|
+
</TemplateAboveHeader>
|
|
328
388
|
<TemplateHeader>...</TemplateHeader>
|
|
329
389
|
<TemplateContent sidebar="right">
|
|
330
390
|
<TemplateContentPrimary>
|
|
@@ -337,6 +397,9 @@ The components consist of:
|
|
|
337
397
|
<Template>
|
|
338
398
|
|
|
339
399
|
<Template>
|
|
400
|
+
<TemplateAboveHeader>
|
|
401
|
+
// ...
|
|
402
|
+
</TemplateAboveHeader>
|
|
340
403
|
<TemplateHeader>...</TemplateHeader>
|
|
341
404
|
<TemplateContent sidebar="left">
|
|
342
405
|
<TemplateContentSidebar>
|
|
@@ -355,6 +418,9 @@ The components consist of:
|
|
|
355
418
|
|
|
356
419
|
```
|
|
357
420
|
<Template>
|
|
421
|
+
<TemplateAboveHeader>
|
|
422
|
+
// ...
|
|
423
|
+
</TemplateAboveHeader>
|
|
358
424
|
<TemplateHeader>
|
|
359
425
|
// ...
|
|
360
426
|
</TemplateHeader>
|
|
@@ -417,6 +483,23 @@ This is best viewed in the Storybook "Canvas" and not "Docs" section.
|
|
|
417
483
|
<Canvas>
|
|
418
484
|
<Story name="Full Example with Template Children Components">
|
|
419
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>
|
|
420
503
|
<TemplateHeader>
|
|
421
504
|
<TemplateBreakout>
|
|
422
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
|
});
|