@nypl/design-system-react-components 0.25.12 → 0.26.1
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 +131 -1
- package/README.md +10 -10
- package/dist/components/Accordion/Accordion.d.ts +6 -4
- package/dist/components/Accordion/AccordionTypes.d.ts +5 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -4
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Card/Card.d.ts +22 -29
- package/dist/components/Checkbox/Checkbox.d.ts +3 -3
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +9 -6
- package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +5 -6
- package/dist/components/Fieldset/Fieldset.d.ts +5 -6
- package/dist/components/Form/Form.d.ts +6 -6
- package/dist/components/Grid/GridTypes.d.ts +7 -7
- package/dist/components/Grid/SimpleGrid.d.ts +1 -1
- package/dist/components/Heading/Heading.d.ts +5 -5
- package/dist/components/Heading/HeadingTypes.d.ts +1 -1
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +9 -8
- package/dist/components/Hero/Hero.d.ts +9 -5
- package/dist/components/HorizontalRule/HorizontalRule.d.ts +2 -10
- package/dist/components/Icons/Icon.d.ts +2 -1
- package/dist/components/Icons/IconTypes.d.ts +1 -0
- package/dist/components/Image/Image.d.ts +27 -9
- package/dist/components/Image/ImageTypes.d.ts +4 -4
- package/dist/components/Label/Label.d.ts +7 -4
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/List/List.d.ts +11 -11
- package/dist/components/List/ListTypes.d.ts +1 -1
- package/dist/components/Logo/Logo.d.ts +2 -1
- package/dist/components/Logo/LogoSvgs.d.ts +2 -0
- package/dist/components/Logo/LogoTypes.d.ts +4 -2
- package/dist/components/Notification/Notification.d.ts +7 -7
- package/dist/components/Pagination/Pagination.d.ts +2 -2
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +3 -3
- package/dist/components/Radio/Radio.d.ts +5 -7
- package/dist/components/RadioGroup/RadioGroup.d.ts +16 -8
- package/dist/components/SearchBar/SearchBar.d.ts +4 -4
- package/dist/components/Select/Select.d.ts +12 -8
- package/dist/components/Select/SelectTypes.d.ts +4 -0
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +8 -6
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -4
- package/dist/components/Slider/Slider.d.ts +6 -4
- package/dist/components/StatusBadge/StatusBadge.d.ts +5 -1
- package/dist/components/StructuredContent/StructuredContent.d.ts +10 -23
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +7 -6
- package/dist/components/Template/Template.d.ts +17 -8
- package/dist/components/Text/Text.d.ts +4 -4
- package/dist/components/Text/TextTypes.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +7 -7
- package/dist/components/Toggle/Toggle.d.ts +8 -10
- package/dist/components/Toggle/{ToggleSizes.d.ts → ToggleTypes.d.ts} +1 -1
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +2075 -1468
- 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 +2086 -1483
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/enums.d.ts +4 -0
- package/dist/hooks/useCarouselStyles.d.ts +3 -2
- package/dist/hooks/useNYPLTheme.d.ts +12 -0
- package/dist/index.d.ts +11 -9
- package/dist/styles.css +1 -1
- package/dist/theme/components/accordion.d.ts +7 -12
- package/dist/theme/components/breadcrumb.d.ts +3 -0
- package/dist/theme/components/button.d.ts +10 -2
- package/dist/theme/components/card.d.ts +44 -24
- package/dist/theme/components/checkbox.d.ts +6 -4
- package/dist/theme/components/checkboxGroup.d.ts +4 -2
- package/dist/theme/components/componentWrapper.d.ts +2 -2
- package/dist/theme/components/customTable.d.ts +84 -1
- package/dist/theme/components/fieldset.d.ts +4 -14
- package/dist/theme/components/global.d.ts +25 -18
- package/dist/theme/components/heading.d.ts +53 -0
- package/dist/theme/components/helperErrorText.d.ts +1 -0
- package/dist/theme/components/hero.d.ts +21 -15
- package/dist/theme/components/image.d.ts +1 -1
- package/dist/theme/components/label.d.ts +9 -10
- package/dist/theme/components/list.d.ts +99 -9
- package/dist/theme/components/notification.d.ts +4 -4
- package/dist/theme/components/pagination.d.ts +2 -5
- package/dist/theme/components/radio.d.ts +7 -4
- package/dist/theme/components/radioGroup.d.ts +4 -2
- package/dist/theme/components/select.d.ts +37 -5
- package/dist/theme/components/skeletonLoader.d.ts +2 -2
- package/dist/theme/components/slider.d.ts +6 -3
- package/dist/theme/components/structuredContent.d.ts +197 -0
- package/dist/theme/components/textInput.d.ts +18 -6
- package/dist/theme/components/toggle.d.ts +20 -5
- package/dist/theme/foundations/global.d.ts +2 -0
- package/dist/theme/foundations/radii.d.ts +1 -0
- package/dist/theme/foundations/spacing.d.ts +46 -43
- package/package.json +5 -6
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +34 -0
- package/src/components/Accordion/Accordion.stories.mdx +150 -66
- package/src/components/Accordion/Accordion.test.tsx +65 -17
- package/src/components/Accordion/Accordion.tsx +61 -27
- package/src/components/Accordion/AccordionTypes.tsx +5 -0
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +505 -14
- package/src/components/Autosuggest/Autosuggest.stories.mdx +4 -3
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +37 -19
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +57 -36
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +14 -13
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -1
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +211 -12
- package/src/components/Button/Button.stories.mdx +87 -23
- package/src/components/Button/Button.test.tsx +25 -0
- package/src/components/Button/Button.tsx +18 -7
- package/src/components/Button/__snapshots__/Button.test.tsx.snap +27 -7
- package/src/components/Card/Card.stories.mdx +493 -329
- package/src/components/Card/Card.test.tsx +138 -18
- package/src/components/Card/Card.tsx +151 -85
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +221 -101
- package/src/components/Chakra/Center.stories.mdx +2 -2
- package/src/components/Chakra/Grid.stories.mdx +4 -4
- package/src/components/Checkbox/Checkbox.stories.mdx +73 -9
- package/src/components/Checkbox/Checkbox.test.tsx +89 -10
- package/src/components/Checkbox/Checkbox.tsx +26 -16
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +209 -6
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +135 -23
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +216 -90
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +39 -26
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +493 -89
- package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +12 -0
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +39 -41
- package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +47 -34
- package/src/components/DatePicker/DatePicker.stories.mdx +63 -27
- package/src/components/DatePicker/DatePicker.test.tsx +94 -15
- package/src/components/DatePicker/DatePicker.tsx +67 -58
- package/src/components/DatePicker/_DatePicker.scss +71 -13
- package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +250 -206
- package/src/components/Fieldset/Fieldset.stories.mdx +33 -3
- package/src/components/Fieldset/Fieldset.test.tsx +58 -28
- package/src/components/Fieldset/Fieldset.tsx +35 -30
- package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +40 -19
- package/src/components/Form/Form.stories.mdx +118 -47
- package/src/components/Form/Form.test.tsx +59 -16
- package/src/components/Form/Form.tsx +89 -65
- package/src/components/Form/__snapshots__/Form.test.tsx.snap +83 -5
- package/src/components/Grid/GridTypes.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +87 -41
- package/src/components/Grid/SimpleGrid.test.tsx +24 -9
- package/src/components/Grid/SimpleGrid.tsx +29 -20
- package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +16 -1
- package/src/components/Heading/Heading.stories.mdx +56 -25
- package/src/components/Heading/Heading.test.tsx +17 -7
- package/src/components/Heading/Heading.tsx +60 -58
- package/src/components/Heading/HeadingTypes.tsx +1 -1
- package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +27 -8
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +64 -42
- package/src/components/HelperErrorText/HelperErrorText.test.tsx +15 -0
- package/src/components/HelperErrorText/HelperErrorText.tsx +40 -35
- package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +35 -4
- package/src/components/Hero/Hero.stories.mdx +143 -113
- package/src/components/Hero/Hero.test.tsx +146 -58
- package/src/components/Hero/Hero.tsx +144 -112
- package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +89 -17
- package/src/components/HorizontalRule/HorizontalRule.stories.mdx +26 -4
- package/src/components/HorizontalRule/HorizontalRule.test.tsx +9 -17
- package/src/components/HorizontalRule/HorizontalRule.tsx +9 -25
- package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +18 -5
- package/src/components/Icons/Icon.stories.mdx +80 -23
- package/src/components/Icons/Icon.test.tsx +51 -2
- package/src/components/Icons/Icon.tsx +93 -71
- package/src/components/Icons/IconTypes.tsx +1 -0
- package/src/components/Icons/__snapshots__/Icon.test.tsx.snap +129 -0
- package/src/components/Image/Image.stories.mdx +160 -71
- package/src/components/Image/Image.test.tsx +40 -48
- package/src/components/Image/Image.tsx +80 -48
- package/src/components/Image/ImageTypes.ts +4 -4
- package/src/components/Image/__snapshots__/Image.test.tsx.snap +84 -21
- package/src/components/Label/Label.stories.mdx +42 -20
- package/src/components/Label/Label.test.tsx +42 -17
- package/src/components/Label/Label.tsx +22 -13
- package/src/components/Label/__snapshots__/Label.test.tsx.snap +19 -15
- package/src/components/Link/Link.stories.mdx +25 -1
- package/src/components/Link/Link.test.tsx +21 -0
- package/src/components/Link/Link.tsx +16 -9
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +37 -11
- package/src/components/List/List.stories.mdx +75 -40
- package/src/components/List/List.test.tsx +73 -22
- package/src/components/List/List.tsx +44 -28
- package/src/components/List/ListTypes.tsx +1 -1
- package/src/components/List/__snapshots__/List.test.tsx.snap +110 -8
- package/src/components/Logo/Logo.stories.mdx +40 -16
- package/src/components/Logo/Logo.test.tsx +29 -2
- package/src/components/Logo/Logo.tsx +28 -11
- package/src/components/Logo/LogoSvgs.tsx +4 -0
- package/src/components/Logo/LogoTypes.tsx +3 -1
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +73 -2
- package/src/components/Modal/Modal.stories.mdx +13 -0
- package/src/components/Notification/Notification.stories.mdx +29 -5
- package/src/components/Notification/Notification.test.tsx +23 -0
- package/src/components/Notification/Notification.tsx +53 -51
- package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +158 -29
- package/src/components/Pagination/Pagination.stories.mdx +27 -6
- package/src/components/Pagination/Pagination.test.tsx +55 -2
- package/src/components/Pagination/Pagination.tsx +12 -9
- package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +244 -27
- package/src/components/Placeholder/Placeholder.tsx +3 -1
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +76 -10
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +87 -13
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +20 -10
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +101 -14
- package/src/components/Radio/Radio.stories.mdx +75 -11
- package/src/components/Radio/Radio.test.tsx +83 -9
- package/src/components/Radio/Radio.tsx +70 -62
- package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +163 -5
- package/src/components/RadioGroup/RadioGroup.stories.mdx +293 -94
- package/src/components/RadioGroup/RadioGroup.test.tsx +193 -68
- package/src/components/RadioGroup/RadioGroup.tsx +110 -101
- package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1258 -902
- package/src/components/SearchBar/SearchBar.stories.mdx +101 -36
- package/src/components/SearchBar/{SearchBar.Test.tsx → SearchBar.test.tsx} +46 -4
- package/src/components/SearchBar/SearchBar.tsx +20 -11
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +1039 -0
- package/src/components/Select/Select.stories.mdx +151 -62
- package/src/components/Select/Select.test.tsx +56 -44
- package/src/components/Select/Select.tsx +125 -104
- package/src/components/Select/SelectTypes.tsx +5 -0
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +749 -409
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +53 -23
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +14 -8
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +80 -78
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +169 -10
- package/src/components/Slider/Slider.stories.mdx +123 -41
- package/src/components/Slider/Slider.test.tsx +65 -17
- package/src/components/Slider/Slider.tsx +30 -23
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +403 -226
- package/src/components/StatusBadge/StatusBadge.stories.mdx +19 -1
- package/src/components/StatusBadge/StatusBadge.test.tsx +19 -1
- package/src/components/StatusBadge/StatusBadge.tsx +25 -20
- package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +22 -3
- package/src/components/StructuredContent/StructuredContent.stories.mdx +229 -61
- package/src/components/StructuredContent/StructuredContent.test.tsx +162 -101
- package/src/components/StructuredContent/StructuredContent.tsx +98 -103
- package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +102 -17
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +5 -5
- package/src/components/StyleGuide/Breakpoints.stories.mdx +6 -6
- package/src/components/StyleGuide/Buttons.stories.mdx +2 -12
- package/src/components/StyleGuide/ColorCard.tsx +4 -4
- package/src/components/StyleGuide/Colors.stories.mdx +1 -2
- package/src/components/StyleGuide/DesignTokens.stories.mdx +56 -26
- package/src/components/StyleGuide/Forms.stories.mdx +27 -12
- package/src/components/StyleGuide/Iconography.stories.mdx +2 -12
- package/src/components/StyleGuide/Spacing.stories.mdx +80 -41
- package/src/components/StyleGuide/Typography.stories.mdx +47 -33
- package/src/components/Table/Table.stories.mdx +38 -11
- package/src/components/Table/Table.test.tsx +16 -1
- package/src/components/Table/Table.tsx +10 -8
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +408 -5
- package/src/components/Tabs/Tabs.stories.mdx +59 -10
- package/src/components/Tabs/Tabs.test.tsx +29 -11
- package/src/components/Tabs/Tabs.tsx +28 -21
- package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +394 -5
- package/src/components/Template/Template.stories.mdx +73 -32
- package/src/components/Template/Template.test.tsx +68 -5
- package/src/components/Template/Template.tsx +89 -71
- package/src/components/Template/__snapshots__/Template.test.tsx.snap +195 -22
- package/src/components/Text/Text.stories.mdx +32 -15
- package/src/components/Text/Text.test.tsx +14 -11
- package/src/components/Text/Text.tsx +13 -16
- package/src/components/Text/TextTypes.tsx +1 -1
- package/src/components/Text/__snapshots__/Text.test.tsx.snap +21 -4
- package/src/components/TextInput/TextInput.stories.mdx +73 -27
- package/src/components/TextInput/TextInput.test.tsx +65 -50
- package/src/components/TextInput/TextInput.tsx +123 -115
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +96 -73
- package/src/components/Toggle/Toggle.stories.mdx +74 -26
- package/src/components/Toggle/Toggle.test.tsx +41 -10
- package/src/components/Toggle/Toggle.tsx +29 -26
- package/src/components/Toggle/{ToggleSizes.tsx → ToggleTypes.tsx} +1 -1
- package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +191 -4
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +52 -4
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +41 -6
- package/src/components/VideoPlayer/VideoPlayer.tsx +134 -120
- package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +81 -39
- package/src/docs/Chakra.stories.mdx +50 -9
- package/src/docs/Welcome.stories.mdx +168 -0
- package/src/{components/Card/CardTypes.tsx → helpers/enums.ts} +2 -2
- package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
- package/src/hooks/useCarouselStyles.stories.mdx +30 -0
- package/src/hooks/useCarouselStyles.ts +3 -2
- package/src/hooks/useNYPLTheme.stories.mdx +101 -0
- package/src/hooks/useNYPLTheme.ts +31 -7
- package/src/hooks/useWindowSize.stories.mdx +23 -0
- package/src/index.ts +11 -15
- package/src/styles/base/_place-holder.scss +1 -1
- package/src/theme/components/accordion.ts +7 -12
- package/src/theme/components/breadcrumb.ts +3 -0
- package/src/theme/components/button.ts +15 -7
- package/src/theme/components/card.ts +56 -36
- package/src/theme/components/checkbox.ts +10 -8
- package/src/theme/components/checkboxGroup.ts +4 -2
- package/src/theme/components/componentWrapper.ts +2 -2
- package/src/theme/components/customTable.ts +39 -31
- package/src/theme/components/fieldset.ts +1 -2
- package/src/theme/components/global.ts +29 -23
- package/src/theme/components/heading.ts +1 -1
- package/src/theme/components/helperErrorText.ts +1 -0
- package/src/theme/components/hero.ts +14 -16
- package/src/theme/components/icon.ts +5 -2
- package/src/theme/components/image.ts +1 -1
- package/src/theme/components/label.ts +4 -3
- package/src/theme/components/list.ts +73 -66
- package/src/theme/components/notification.ts +7 -7
- package/src/theme/components/pagination.ts +2 -5
- package/src/theme/components/progressIndicator.ts +3 -3
- package/src/theme/components/radio.ts +9 -9
- package/src/theme/components/radioGroup.ts +4 -2
- package/src/theme/components/select.ts +35 -16
- package/src/theme/components/skeletonLoader.ts +3 -3
- package/src/theme/components/slider.ts +8 -7
- package/src/theme/components/statusBadge.ts +2 -2
- package/src/theme/components/structuredContent.ts +66 -1
- package/src/theme/components/tabs.ts +2 -2
- package/src/theme/components/template.ts +9 -9
- package/src/theme/components/textInput.ts +13 -12
- package/src/theme/components/toggle.ts +43 -13
- package/src/theme/components/videoPlayer.ts +1 -1
- package/src/theme/foundations/colors.ts +1 -1
- package/src/theme/foundations/radii.ts +1 -0
- package/src/theme/foundations/spacing.ts +70 -22
- package/src/theme/foundations/typography.ts +2 -2
- package/src/utils/componentCategories.ts +28 -21
- package/dist/components/Card/CardTypes.d.ts +0 -4
- package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +0 -4
- package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +0 -4
- package/dist/components/SearchBar/SearchBar.Test.d.ts +0 -1
- package/dist/helpers/generateUUID.d.ts +0 -1
- package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +0 -4
- package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +0 -4
- package/src/docs/Intro.stories.mdx +0 -53
- package/src/helpers/generateUUID.tsx +0 -5
|
@@ -60,9 +60,18 @@ import { getCategory } from "../../utils/componentCategories";
|
|
|
60
60
|
| Component Version | DS Version |
|
|
61
61
|
| ----------------- | ---------- |
|
|
62
62
|
| Added | `0.3.6` |
|
|
63
|
-
| Latest | `0.
|
|
63
|
+
| Latest | `0.26.0` |
|
|
64
64
|
|
|
65
|
-
##
|
|
65
|
+
## Table of Contents
|
|
66
|
+
|
|
67
|
+
- [TemplateAppContainer Overview](#templateappcontainer-overview)
|
|
68
|
+
- [TemplateAppContainer Component Props](#templateappcontainer-component-props)
|
|
69
|
+
- [TemplateAppContainer Accessibility](#templateappcontainer-accessibility)
|
|
70
|
+
- [Template Children Overview](#template-children-overview)
|
|
71
|
+
- [Template Children Component Props](#template-children-component-props)
|
|
72
|
+
- [Full Example with Template Children Components](#full-example-with-template-children-components)
|
|
73
|
+
|
|
74
|
+
## TemplateAppContainer Overview
|
|
66
75
|
|
|
67
76
|
<Description of={TemplateAppContainer} />
|
|
68
77
|
|
|
@@ -74,13 +83,7 @@ Likewise, if you have a custom `Footer` component that _already_ renders an HTML
|
|
|
74
83
|
`<footer>` element, set `renderFooterElement` to false so only one `<footer>`
|
|
75
84
|
element is rendered.
|
|
76
85
|
|
|
77
|
-
|
|
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
|
-
|
|
83
|
-
<b>This is the recommended way to render an app page template.</b>
|
|
86
|
+
**This is the recommended way to render an app page template.**
|
|
84
87
|
|
|
85
88
|
```jsx
|
|
86
89
|
import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
@@ -107,6 +110,8 @@ import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
|
107
110
|
/>;
|
|
108
111
|
```
|
|
109
112
|
|
|
113
|
+
## TemplateAppContainer Component Props
|
|
114
|
+
|
|
110
115
|
<Canvas>
|
|
111
116
|
<Story
|
|
112
117
|
name="TemplateAppContainer Component"
|
|
@@ -124,6 +129,7 @@ import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
|
124
129
|
<Placeholder variant="short">More Content</Placeholder>
|
|
125
130
|
</>
|
|
126
131
|
),
|
|
132
|
+
contentId: "mainContent",
|
|
127
133
|
contentSidebar: <Placeholder>Left Sidebar</Placeholder>,
|
|
128
134
|
contentTop: <Placeholder>Content Top</Placeholder>,
|
|
129
135
|
footer: <Placeholder variant="short">Footer</Placeholder>,
|
|
@@ -152,13 +158,45 @@ import { TemplateAppContainer } from "@nypl/design-system-react-components";
|
|
|
152
158
|
|
|
153
159
|
<ArgsTable story="TemplateAppContainer Component" />
|
|
154
160
|
|
|
155
|
-
##
|
|
161
|
+
## TemplateAppContainer Accessibility
|
|
156
162
|
|
|
157
|
-
The
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
**The `TemplateAppContainer` component is the recommended way to render the entire
|
|
164
|
+
application.** Therefore, this accessibility section is specifically for the
|
|
165
|
+
`TemplateAppContainer` but the same rules apply to the individual "Template"
|
|
166
|
+
components.
|
|
167
|
+
|
|
168
|
+
The `TemplateAppContainer` component renders the header as a `<header>` element,
|
|
169
|
+
the content as a `<main>` element, and the footer as a `<footer>` element.
|
|
170
|
+
|
|
171
|
+
If you need to render an alert or notification at the top of the page with an
|
|
172
|
+
`aside` HTML element or HTML element with the `role="complementary"` attribute,
|
|
173
|
+
then pass that alert or notification component to the `aboveHeader` prop. These
|
|
174
|
+
elements should _not_ be rendered in the `header` HTML section since that's an
|
|
175
|
+
accessibility violation.
|
|
176
|
+
|
|
177
|
+
The `TemplateAppContainer` component renders a full DOM and one of the children
|
|
178
|
+
is the `main` HTML element with a default "id" of `"mainContent"`. This should
|
|
179
|
+
be used as the anchor element that the skip navigation link points to. As of
|
|
180
|
+
v0.25.13, the consuming application is responsible for adding the skip
|
|
181
|
+
navigation feature to the application. If your application is using the current
|
|
182
|
+
NYPL Header, it already contains the skip navigation feature but make sure it is
|
|
183
|
+
pointing to the correct anchor element.
|
|
184
|
+
|
|
185
|
+
Resources
|
|
186
|
+
|
|
187
|
+
- [W3C Aria Landmarks Example](https://www.w3.org/TR/wai-aria-practices/examples/landmarks/complementary.html)
|
|
188
|
+
- [Digital A11y Role=Complementary](https://www.digitala11y.com/complementary-role/)
|
|
189
|
+
- [WebAim Skip Navigation Link](https://webaim.org/techniques/skipnav/)
|
|
190
|
+
- [A11ymatters Skip Navigation Link](https://www.a11ymatters.com/pattern/skip-link/)
|
|
191
|
+
|
|
192
|
+
## Template Children Overview
|
|
193
|
+
|
|
194
|
+
The Reservoir Design System (DS) also provides a set of "template" components
|
|
195
|
+
that work together to render a consistent mobile and desktop layout. More
|
|
196
|
+
information on individual components and how they should be composed can be
|
|
197
|
+
found below. Even though these component are available for use, we recommend
|
|
198
|
+
using the `TemplateAppContainer` component and passing down children component
|
|
199
|
+
as props as needed.
|
|
162
200
|
|
|
163
201
|
Basic "template" components structure:
|
|
164
202
|
|
|
@@ -203,6 +241,8 @@ import {
|
|
|
203
241
|
</Template>
|
|
204
242
|
```
|
|
205
243
|
|
|
244
|
+
## Template Children Component Props
|
|
245
|
+
|
|
206
246
|
<Canvas>
|
|
207
247
|
<Story
|
|
208
248
|
name="Template Children Components"
|
|
@@ -212,6 +252,7 @@ import {
|
|
|
212
252
|
argTypes={{
|
|
213
253
|
aboveHeader: { table: { disable: true } },
|
|
214
254
|
breakout: { table: { disable: true } },
|
|
255
|
+
contentId: { table: { disable: true } },
|
|
215
256
|
contentPrimary: { table: { disable: true } },
|
|
216
257
|
contentSidebar: { table: { disable: true } },
|
|
217
258
|
contentTop: { table: { disable: true } },
|
|
@@ -334,7 +375,7 @@ The components consist of:
|
|
|
334
375
|
```
|
|
335
376
|
<Template>
|
|
336
377
|
<TemplateHeader>...</TemplateHeader>
|
|
337
|
-
<TemplateContent sidebar="left">
|
|
378
|
+
<TemplateContent id="mainContent" sidebar="left">
|
|
338
379
|
// ...
|
|
339
380
|
</TemplateContent>
|
|
340
381
|
<Template>
|
|
@@ -513,18 +554,14 @@ This is best viewed in the Storybook "Canvas" and not "Docs" section.
|
|
|
513
554
|
]}
|
|
514
555
|
/>
|
|
515
556
|
<Hero
|
|
557
|
+
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
516
558
|
heroType={HeroTypes.Campaign}
|
|
517
559
|
heading={
|
|
518
560
|
<Heading level={HeadingLevels.One} id="1" text="Hero Campaign" />
|
|
519
561
|
}
|
|
562
|
+
imageAlt="Image example"
|
|
563
|
+
imageSrc="https://placeimg.com/800/400/animals"
|
|
520
564
|
subHeaderText={otherSubHeaderText}
|
|
521
|
-
backgroundImageSrc="https://placeimg.com/2400/800/nature/grayscale"
|
|
522
|
-
image={
|
|
523
|
-
<Image
|
|
524
|
-
src="https://placeimg.com/800/400/animals"
|
|
525
|
-
alt="Image example"
|
|
526
|
-
/>
|
|
527
|
-
}
|
|
528
565
|
/>
|
|
529
566
|
</TemplateBreakout>
|
|
530
567
|
</TemplateHeader>
|
|
@@ -547,7 +584,7 @@ This is best viewed in the Storybook "Canvas" and not "Docs" section.
|
|
|
547
584
|
</TemplateContentTop>
|
|
548
585
|
<TemplateContentPrimary>
|
|
549
586
|
<p>This is the main content!</p>
|
|
550
|
-
<Accordion
|
|
587
|
+
<Accordion accordionData={faqContent} />
|
|
551
588
|
<HorizontalRule />
|
|
552
589
|
<p>Fill out the form!</p>
|
|
553
590
|
<Form action="/end/point">
|
|
@@ -584,11 +621,13 @@ This is best viewed in the Storybook "Canvas" and not "Docs" section.
|
|
|
584
621
|
<TemplateContentSidebar>
|
|
585
622
|
<p>Sidebar information in a `Card` component.</p>
|
|
586
623
|
<Card
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
624
|
+
imageProps={{
|
|
625
|
+
alt: "Alt text",
|
|
626
|
+
aspectRatio: ImageRatios.Square,
|
|
627
|
+
size: ImageSizes.Small,
|
|
628
|
+
src: "https://placeimg.com/400/200/animals",
|
|
629
|
+
}}
|
|
630
|
+
isCentered
|
|
592
631
|
>
|
|
593
632
|
<CardHeading level={HeadingLevels.Two} id="heading1">
|
|
594
633
|
Small Animal Image
|
|
@@ -606,9 +645,11 @@ This is best viewed in the Storybook "Canvas" and not "Docs" section.
|
|
|
606
645
|
<TemplateFooter>
|
|
607
646
|
<Card
|
|
608
647
|
id="custom-card"
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
648
|
+
imageProps={{
|
|
649
|
+
alt: "Alt text",
|
|
650
|
+
aspectRatio: ImageRatios.SixteenByNine,
|
|
651
|
+
src: "https://cdn-d8.nypl.org/s3fs-public/2020-05/NYPL_MainFacadeRev2Cam2.png",
|
|
652
|
+
}}
|
|
612
653
|
layout="horizontal"
|
|
613
654
|
backgroundColor="#616161"
|
|
614
655
|
foregroundColor="#FFF"
|
|
@@ -100,6 +100,23 @@ describe("TemplateAppContainer component", () => {
|
|
|
100
100
|
expect(screen.getByText("Footer")).toBeInTheDocument();
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
+
it("renders a #mainContent id in the `main` DOM element", () => {
|
|
104
|
+
const { container } = render(
|
|
105
|
+
<TemplateAppContainer
|
|
106
|
+
aboveHeader={aboveHeader}
|
|
107
|
+
header={header}
|
|
108
|
+
breakout={breakout}
|
|
109
|
+
sidebar={sidebar}
|
|
110
|
+
contentTop={contentTop}
|
|
111
|
+
contentSidebar={contentSidebar}
|
|
112
|
+
contentPrimary={contentPrimary}
|
|
113
|
+
footer={footer}
|
|
114
|
+
/>
|
|
115
|
+
);
|
|
116
|
+
expect(container.querySelector("#mainContent")).toBeInTheDocument();
|
|
117
|
+
expect(screen.getByRole("main")).toHaveAttribute("id", "mainContent");
|
|
118
|
+
});
|
|
119
|
+
|
|
103
120
|
it("renders only one header in a custom header component", () => {
|
|
104
121
|
const customHeader = <header>Custom header</header>;
|
|
105
122
|
render(
|
|
@@ -134,8 +151,9 @@ describe("TemplateAppContainer component", () => {
|
|
|
134
151
|
/>
|
|
135
152
|
);
|
|
136
153
|
expect(warn).toHaveBeenCalledWith(
|
|
137
|
-
"
|
|
138
|
-
"`renderHeaderElement` to `false` to avoid nested HTML
|
|
154
|
+
"NYPL Reservoir TemplateHeader: An HTML `header` element was passed " +
|
|
155
|
+
"in. Set `renderHeaderElement` to `false` to avoid nested HTML " +
|
|
156
|
+
"`header` elements."
|
|
139
157
|
);
|
|
140
158
|
});
|
|
141
159
|
|
|
@@ -172,8 +190,9 @@ describe("TemplateAppContainer component", () => {
|
|
|
172
190
|
/>
|
|
173
191
|
);
|
|
174
192
|
expect(warn).toHaveBeenCalledWith(
|
|
175
|
-
"
|
|
176
|
-
"`renderFooterElement` to `false` to avoid nested HTML
|
|
193
|
+
"NYPL Reservoir TemplateFooter: An HTML `footer` element was passed " +
|
|
194
|
+
"in. Set `renderFooterElement` to `false` to avoid nested HTML " +
|
|
195
|
+
"`footer` elements."
|
|
177
196
|
);
|
|
178
197
|
});
|
|
179
198
|
});
|
|
@@ -207,7 +226,18 @@ describe("Template components", () => {
|
|
|
207
226
|
expect(screen.getByText("Footer")).toBeInTheDocument();
|
|
208
227
|
});
|
|
209
228
|
|
|
210
|
-
it("
|
|
229
|
+
it("renders a #mainContent id in the TemplateContent component", () => {
|
|
230
|
+
const { container } = render(
|
|
231
|
+
<TemplateContent>
|
|
232
|
+
<TemplateContentPrimary>{contentPrimary}</TemplateContentPrimary>
|
|
233
|
+
</TemplateContent>
|
|
234
|
+
);
|
|
235
|
+
|
|
236
|
+
expect(container.querySelector("#mainContent")).toBeInTheDocument();
|
|
237
|
+
expect(screen.getByRole("main")).toHaveAttribute("id", "mainContent");
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
it("renders the UI snapshot correctly", () => {
|
|
211
241
|
const templateComponents = renderer
|
|
212
242
|
.create(
|
|
213
243
|
<Template>
|
|
@@ -239,8 +269,41 @@ describe("Template components", () => {
|
|
|
239
269
|
/>
|
|
240
270
|
)
|
|
241
271
|
.toJSON();
|
|
272
|
+
const withChakraProps = renderer
|
|
273
|
+
.create(
|
|
274
|
+
<TemplateAppContainer
|
|
275
|
+
aboveHeader={aboveHeader}
|
|
276
|
+
header={header}
|
|
277
|
+
breakout={breakout}
|
|
278
|
+
sidebar={sidebar}
|
|
279
|
+
contentTop={contentTop}
|
|
280
|
+
contentSidebar={contentSidebar}
|
|
281
|
+
contentPrimary={contentPrimary}
|
|
282
|
+
footer={footer}
|
|
283
|
+
p="20px"
|
|
284
|
+
color="ui.error.primary"
|
|
285
|
+
/>
|
|
286
|
+
)
|
|
287
|
+
.toJSON();
|
|
288
|
+
const withOtherProps = renderer
|
|
289
|
+
.create(
|
|
290
|
+
<TemplateAppContainer
|
|
291
|
+
aboveHeader={aboveHeader}
|
|
292
|
+
header={header}
|
|
293
|
+
breakout={breakout}
|
|
294
|
+
sidebar={sidebar}
|
|
295
|
+
contentTop={contentTop}
|
|
296
|
+
contentSidebar={contentSidebar}
|
|
297
|
+
contentPrimary={contentPrimary}
|
|
298
|
+
footer={footer}
|
|
299
|
+
data-testid="props"
|
|
300
|
+
/>
|
|
301
|
+
)
|
|
302
|
+
.toJSON();
|
|
242
303
|
|
|
243
304
|
expect(templateComponents).toMatchSnapshot();
|
|
244
305
|
expect(singleComponent).toMatchSnapshot();
|
|
306
|
+
expect(withChakraProps).toMatchSnapshot();
|
|
307
|
+
expect(withOtherProps).toMatchSnapshot();
|
|
245
308
|
});
|
|
246
309
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Box, chakra, useStyleConfig } from "@chakra-ui/react";
|
|
1
2
|
import * as React from "react";
|
|
2
|
-
import { Box, useStyleConfig } from "@chakra-ui/react";
|
|
3
3
|
|
|
4
4
|
export interface TemplateProps {}
|
|
5
5
|
export interface TemplateHeaderProps {
|
|
@@ -15,7 +15,12 @@ export interface TemplateSidebarProps {
|
|
|
15
15
|
* right side of the `TemplateContentPrimary` component. */
|
|
16
16
|
sidebar?: "none" | "left" | "right";
|
|
17
17
|
}
|
|
18
|
-
export interface TemplateContentProps extends TemplateSidebarProps {
|
|
18
|
+
export interface TemplateContentProps extends TemplateSidebarProps {
|
|
19
|
+
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
20
|
+
* anchor for the application skip navigation. */
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
export interface TemplateAppContainerProps
|
|
20
25
|
extends TemplateFooterProps,
|
|
21
26
|
TemplateHeaderProps,
|
|
@@ -25,6 +30,9 @@ export interface TemplateAppContainerProps
|
|
|
25
30
|
aboveHeader?: React.ReactElement;
|
|
26
31
|
/** DOM that will be rendered in the `TemplateBreakout` component section. */
|
|
27
32
|
breakout?: React.ReactElement;
|
|
33
|
+
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
34
|
+
* anchor for the application skip navigation. */
|
|
35
|
+
contentId?: string;
|
|
28
36
|
/** DOM that will be rendered in the `TemplateContentPrimary` component section. */
|
|
29
37
|
contentPrimary?: React.ReactElement;
|
|
30
38
|
/** DOM that will be rendered in the `TemplateContentSidebar` component section. */
|
|
@@ -41,10 +49,14 @@ export interface TemplateAppContainerProps
|
|
|
41
49
|
* The main top-level parent component that wraps all template-related
|
|
42
50
|
* components.
|
|
43
51
|
*/
|
|
44
|
-
const Template = (props: React.PropsWithChildren<TemplateProps>) => {
|
|
52
|
+
const Template = chakra((props: React.PropsWithChildren<TemplateProps>) => {
|
|
45
53
|
const styles = useStyleConfig("Template", {});
|
|
46
|
-
return
|
|
47
|
-
}
|
|
54
|
+
return (
|
|
55
|
+
<Box __css={styles} {...props}>
|
|
56
|
+
{props.children}
|
|
57
|
+
</Box>
|
|
58
|
+
);
|
|
59
|
+
});
|
|
48
60
|
|
|
49
61
|
/**
|
|
50
62
|
* This optional component renders its children from edge-to-edge and should
|
|
@@ -80,8 +92,9 @@ const TemplateHeader = ({
|
|
|
80
92
|
React.Children.map(children, (child: React.ReactElement) => {
|
|
81
93
|
if (child?.type === "header" || child?.props?.mdxType === "header") {
|
|
82
94
|
console.warn(
|
|
83
|
-
"
|
|
84
|
-
"`renderHeaderElement` to `false` to avoid nested HTML
|
|
95
|
+
"NYPL Reservoir TemplateHeader: An HTML `header` element was passed " +
|
|
96
|
+
"in. Set `renderHeaderElement` to `false` to avoid nested HTML " +
|
|
97
|
+
"`header` elements."
|
|
85
98
|
);
|
|
86
99
|
}
|
|
87
100
|
});
|
|
@@ -106,16 +119,18 @@ const TemplateBreakout = (props: React.PropsWithChildren<TemplateProps>) => {
|
|
|
106
119
|
|
|
107
120
|
/**
|
|
108
121
|
* This component is most useful to render content on the page. This renders an
|
|
109
|
-
* HTML `<main>` element
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
122
|
+
* HTML `<main>` element with an id of "mainContent". The "mainContent" id should
|
|
123
|
+
* be used as the consuming application's skip navigation link. The `TemplateContent`
|
|
124
|
+
* component also takes a `sidebar` prop with optional "left" or "right" values.
|
|
125
|
+
* This will set the correct *styling* needed for the `TemplateContentPrimary`
|
|
126
|
+
* and `TemplateContentSidebar` components. Note that `TemplateContentPrimary`
|
|
127
|
+
* and `TemplateContentSidebar` must be ordered correctly as children elements
|
|
128
|
+
* for the appropriate styles to take effect.
|
|
114
129
|
*/
|
|
115
130
|
const TemplateContent = (
|
|
116
131
|
props: React.PropsWithChildren<TemplateContentProps>
|
|
117
132
|
) => {
|
|
118
|
-
const { sidebar = "none"
|
|
133
|
+
const { children, id = "mainContent", sidebar = "none" } = props;
|
|
119
134
|
const styles = useStyleConfig("TemplateContent", {
|
|
120
135
|
variant: sidebar !== "none" ? "sidebar" : null,
|
|
121
136
|
});
|
|
@@ -139,7 +154,7 @@ const TemplateContent = (
|
|
|
139
154
|
);
|
|
140
155
|
|
|
141
156
|
return (
|
|
142
|
-
<Box as="main" __css={styles}>
|
|
157
|
+
<Box as="main" id={id} __css={styles}>
|
|
143
158
|
{newChildren}
|
|
144
159
|
</Box>
|
|
145
160
|
);
|
|
@@ -212,8 +227,9 @@ const TemplateFooter = ({
|
|
|
212
227
|
React.Children.map(children, (child: React.ReactElement) => {
|
|
213
228
|
if (child?.type === "footer" || child?.props?.mdxType === "footer") {
|
|
214
229
|
console.warn(
|
|
215
|
-
"
|
|
216
|
-
"`renderFooterElement` to `false` to avoid nested HTML
|
|
230
|
+
"NYPL Reservoir TemplateFooter: An HTML `footer` element was passed " +
|
|
231
|
+
"in. Set `renderFooterElement` to `false` to avoid nested HTML " +
|
|
232
|
+
"`footer` elements."
|
|
217
233
|
);
|
|
218
234
|
}
|
|
219
235
|
});
|
|
@@ -229,67 +245,68 @@ const TemplateFooter = ({
|
|
|
229
245
|
* be rendered. For example, if you want to render content in the
|
|
230
246
|
* `TemplateContentPrimary` section, then pass it as a prop to `contentPrimary`.
|
|
231
247
|
*/
|
|
232
|
-
const TemplateAppContainer = (
|
|
233
|
-
props: React.PropsWithChildren<TemplateAppContainerProps>
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
{
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
{
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
248
|
+
export const TemplateAppContainer = chakra(
|
|
249
|
+
(props: React.PropsWithChildren<TemplateAppContainerProps>) => {
|
|
250
|
+
const {
|
|
251
|
+
aboveHeader,
|
|
252
|
+
breakout,
|
|
253
|
+
contentId = "mainContent",
|
|
254
|
+
contentPrimary,
|
|
255
|
+
contentSidebar,
|
|
256
|
+
contentTop,
|
|
257
|
+
footer,
|
|
258
|
+
header,
|
|
259
|
+
sidebar = "none",
|
|
260
|
+
renderFooterElement = true,
|
|
261
|
+
renderHeaderElement = true,
|
|
262
|
+
...rest
|
|
263
|
+
} = props;
|
|
264
|
+
const aboveHeaderElem = aboveHeader && (
|
|
265
|
+
<TemplateAboveHeader>{aboveHeader}</TemplateAboveHeader>
|
|
266
|
+
);
|
|
267
|
+
const breakoutElem = breakout && (
|
|
268
|
+
<TemplateBreakout>{breakout}</TemplateBreakout>
|
|
269
|
+
);
|
|
270
|
+
const contentTopElem = contentTop && (
|
|
271
|
+
<TemplateContentTop>{contentTop}</TemplateContentTop>
|
|
272
|
+
);
|
|
273
|
+
const contentPrimaryElem = contentPrimary && (
|
|
274
|
+
<TemplateContentPrimary>{contentPrimary}</TemplateContentPrimary>
|
|
275
|
+
);
|
|
276
|
+
const contentSidebarElem = contentSidebar && (
|
|
277
|
+
<TemplateContentSidebar>{contentSidebar}</TemplateContentSidebar>
|
|
278
|
+
);
|
|
279
|
+
return (
|
|
280
|
+
<Template {...rest}>
|
|
281
|
+
{aboveHeaderElem}
|
|
282
|
+
{(header || breakoutElem) && (
|
|
283
|
+
<TemplateHeader renderHeaderElement={renderHeaderElement}>
|
|
284
|
+
{header}
|
|
285
|
+
{breakoutElem}
|
|
286
|
+
</TemplateHeader>
|
|
287
|
+
)}
|
|
288
|
+
{/* Note that setting `sidebar` as a prop here affects the
|
|
272
289
|
TemplateContentSidebar and TemplateContentPrimary components. */}
|
|
273
|
-
|
|
274
|
-
|
|
290
|
+
<TemplateContent id={contentId} sidebar={sidebar}>
|
|
291
|
+
{contentTopElem}
|
|
275
292
|
|
|
276
|
-
|
|
293
|
+
{sidebar === "left" && contentSidebarElem}
|
|
277
294
|
|
|
278
|
-
|
|
295
|
+
{contentPrimaryElem}
|
|
279
296
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
}
|
|
297
|
+
{sidebar === "right" && contentSidebarElem}
|
|
298
|
+
</TemplateContent>
|
|
299
|
+
{footer && (
|
|
300
|
+
<TemplateFooter renderFooterElement={renderFooterElement}>
|
|
301
|
+
{footer}
|
|
302
|
+
</TemplateFooter>
|
|
303
|
+
)}
|
|
304
|
+
</Template>
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
);
|
|
290
308
|
|
|
291
309
|
export {
|
|
292
|
-
TemplateAppContainer,
|
|
293
310
|
Template,
|
|
294
311
|
TemplateAboveHeader,
|
|
295
312
|
TemplateHeader,
|
|
@@ -300,3 +317,4 @@ export {
|
|
|
300
317
|
TemplateContentSidebar,
|
|
301
318
|
TemplateFooter,
|
|
302
319
|
};
|
|
320
|
+
export default TemplateAppContainer;
|