@nypl/design-system-react-components 0.26.0 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +56 -0
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -5
- package/dist/components/Button/Button.d.ts +2 -10
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +22 -0
- package/dist/components/Card/Card.d.ts +2 -2
- package/dist/components/Checkbox/Checkbox.d.ts +10 -8
- package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
- package/dist/components/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +2 -2
- package/dist/components/Grid/SimpleGrid.d.ts +6 -3
- package/dist/components/Heading/Heading.d.ts +2 -5
- package/dist/components/HelperErrorText/HelperErrorText.d.ts +1 -5
- package/dist/components/Hero/Hero.d.ts +13 -9
- package/dist/components/Icons/Icon.d.ts +6 -5
- package/dist/components/Icons/IconSvgs.d.ts +21 -21
- package/dist/components/Image/Image.d.ts +8 -5
- package/dist/components/Link/Link.d.ts +1 -9
- package/dist/components/List/List.d.ts +7 -11
- package/dist/components/Logo/Logo.d.ts +2 -5
- package/dist/components/Logo/LogoSvgs.d.ts +39 -39
- package/dist/components/Modal/Modal.d.ts +28 -8
- package/dist/components/Notification/Notification.d.ts +1 -1
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
- package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
- package/dist/components/SearchBar/SearchBar.d.ts +3 -2
- package/dist/components/Select/Select.d.ts +2 -5
- package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -4
- package/dist/components/SkipNavigation/SkipNavigation.d.ts +17 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +2 -3
- package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
- package/dist/components/Table/Table.d.ts +1 -1
- package/dist/components/Template/Template.d.ts +2 -0
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/TextInput/TextInput.d.ts +21 -9
- package/dist/components/Toggle/Toggle.d.ts +1 -5
- package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
- package/dist/design-system-react-components.cjs.development.js +977 -1213
- 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 +976 -1276
- package/dist/design-system-react-components.esm.js.map +1 -1
- package/dist/helpers/types.d.ts +1 -0
- package/dist/index.d.ts +27 -48
- package/dist/styles.css +1 -1
- package/dist/theme/components/buttonGroup.d.ts +11 -0
- package/dist/theme/components/card.d.ts +104 -8
- package/dist/theme/components/componentWrapper.d.ts +4 -3
- package/dist/theme/components/customTable.d.ts +11 -14
- package/dist/theme/components/fieldset.d.ts +4 -3
- package/dist/theme/components/helperErrorText.d.ts +4 -3
- package/dist/theme/components/hero.d.ts +1 -1
- package/dist/theme/components/horizontalRule.d.ts +4 -3
- package/dist/theme/components/icon.d.ts +47743 -1
- package/dist/theme/components/image.d.ts +563 -10
- package/dist/theme/components/label.d.ts +4 -3
- package/dist/theme/components/list.d.ts +6 -7
- package/dist/theme/components/logo.d.ts +474 -1
- package/dist/theme/components/notification.d.ts +20 -16
- package/dist/theme/components/progressIndicator.d.ts +6 -4
- package/dist/theme/components/select.d.ts +4 -10
- package/dist/theme/components/skeletonLoader.d.ts +14 -10
- package/dist/theme/components/skipNavigation.d.ts +22 -0
- package/dist/theme/components/slider.d.ts +7 -6
- package/dist/theme/components/structuredContent.d.ts +10 -9
- package/dist/theme/components/text.d.ts +7 -1
- package/dist/theme/components/toggle.d.ts +6 -4
- package/dist/theme/provider.d.ts +2 -4
- package/dist/utils/componentCategories.d.ts +1 -1
- package/dist/utils/interfaces.d.ts +5 -0
- package/dist/utils/utils.d.ts +2 -18
- package/package.json +15 -16
- package/src/__tests__/setup.ts +3 -3
- package/src/__tests__/utils/utils.test.ts +1 -23
- package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +22 -14
- package/src/components/Accordion/Accordion.stories.mdx +43 -44
- package/src/components/Accordion/Accordion.test.tsx +5 -13
- package/src/components/Accordion/Accordion.tsx +14 -18
- package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +6 -6
- package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
- package/src/components/Autosuggest/Autosuggest.stories.tsx +23 -25
- package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -37
- package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +4 -17
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +18 -21
- package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +1 -100
- package/src/components/Button/Button.stories.mdx +89 -126
- package/src/components/Button/Button.test.tsx +16 -30
- package/src/components/Button/Button.tsx +14 -20
- package/src/components/ButtonGroup/ButtonGroup.stories.mdx +147 -0
- package/src/components/ButtonGroup/ButtonGroup.test.tsx +141 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +99 -0
- package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +117 -0
- package/src/components/Card/Card.stories.mdx +143 -177
- package/src/components/Card/Card.test.tsx +36 -97
- package/src/components/Card/Card.tsx +78 -74
- package/src/components/Card/__snapshots__/Card.test.tsx.snap +1 -1
- package/src/components/Chakra/Box.stories.mdx +2 -6
- package/src/components/Chakra/Center.stories.mdx +5 -23
- package/src/components/Chakra/Flex.stories.mdx +4 -6
- package/src/components/Chakra/Stack.stories.mdx +9 -10
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +20 -13
- package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +9 -9
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +6 -17
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -7
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +33 -29
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +24 -35
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +3 -10
- package/src/components/DatePicker/DatePicker.stories.mdx +23 -37
- package/src/components/DatePicker/DatePicker.test.tsx +21 -19
- package/src/components/DatePicker/DatePicker.tsx +57 -49
- package/src/components/Form/Form.stories.mdx +46 -31
- package/src/components/Form/Form.test.tsx +1 -18
- package/src/components/Form/Form.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +73 -49
- package/src/components/Grid/SimpleGrid.test.tsx +7 -9
- package/src/components/Grid/SimpleGrid.tsx +14 -11
- package/src/components/Heading/Heading.stories.mdx +27 -72
- package/src/components/Heading/Heading.test.tsx +18 -44
- package/src/components/Heading/Heading.tsx +7 -10
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -3
- package/src/components/HelperErrorText/HelperErrorText.tsx +1 -5
- package/src/components/Hero/Hero.stories.mdx +219 -216
- package/src/components/Hero/Hero.test.tsx +107 -223
- package/src/components/Hero/Hero.tsx +63 -61
- package/src/components/Icons/Icon.stories.mdx +172 -118
- package/src/components/Icons/Icon.test.tsx +8 -16
- package/src/components/Icons/Icon.tsx +75 -29
- package/src/components/Icons/IconSvgs.tsx +42 -42
- package/src/components/Image/Image.stories.mdx +45 -132
- package/src/components/Image/Image.test.tsx +16 -31
- package/src/components/Image/Image.tsx +28 -12
- package/src/components/Link/Link.stories.mdx +30 -94
- package/src/components/Link/Link.test.tsx +25 -75
- package/src/components/Link/Link.tsx +43 -56
- package/src/components/Link/__snapshots__/Link.test.tsx.snap +1 -2
- package/src/components/List/List.stories.mdx +20 -31
- package/src/components/List/List.test.tsx +24 -43
- package/src/components/List/List.tsx +25 -36
- package/src/components/Logo/Logo.stories.mdx +94 -50
- package/src/components/Logo/Logo.test.tsx +10 -19
- package/src/components/Logo/Logo.tsx +50 -17
- package/src/components/Logo/LogoSvgs.tsx +78 -78
- package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +4 -4
- package/src/components/Modal/Modal.stories.mdx +245 -139
- package/src/components/Modal/Modal.test.tsx +147 -10
- package/src/components/Modal/Modal.tsx +140 -20
- package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +25 -0
- package/src/components/Notification/Notification.stories.mdx +10 -28
- package/src/components/Notification/Notification.test.tsx +9 -12
- package/src/components/Notification/Notification.tsx +34 -37
- package/src/components/Pagination/Pagination.stories.mdx +3 -4
- package/src/components/Pagination/Pagination.tsx +15 -10
- package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +27 -53
- package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +9 -10
- package/src/components/ProgressIndicator/ProgressIndicator.tsx +17 -21
- package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -10
- package/src/components/Radio/Radio.stories.mdx +1 -1
- package/src/components/Radio/Radio.tsx +9 -6
- package/src/components/RadioGroup/RadioGroup.stories.mdx +15 -16
- package/src/components/RadioGroup/RadioGroup.test.tsx +2 -8
- package/src/components/RadioGroup/RadioGroup.tsx +28 -24
- package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
- package/src/components/SearchBar/SearchBar.test.tsx +1 -1
- package/src/components/SearchBar/SearchBar.tsx +14 -22
- package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +1 -13
- package/src/components/Select/Select.stories.mdx +10 -25
- package/src/components/Select/Select.test.tsx +6 -7
- package/src/components/Select/Select.tsx +28 -35
- package/src/components/Select/__snapshots__/Select.test.tsx.snap +24 -24
- package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +17 -56
- package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -21
- package/src/components/SkeletonLoader/SkeletonLoader.tsx +9 -8
- package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +33 -33
- package/src/components/SkipNavigation/SkipNavigation.stories.mdx +90 -0
- package/src/components/SkipNavigation/SkipNavigation.test.tsx +63 -0
- package/src/components/SkipNavigation/SkipNavigation.tsx +51 -0
- package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +130 -0
- package/src/components/Slider/Slider.stories.mdx +19 -53
- package/src/components/Slider/Slider.test.tsx +2 -2
- package/src/components/Slider/Slider.tsx +10 -12
- package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +2 -9
- package/src/components/StatusBadge/StatusBadge.stories.mdx +6 -21
- package/src/components/StatusBadge/StatusBadge.test.tsx +2 -3
- package/src/components/StatusBadge/StatusBadge.tsx +3 -10
- package/src/components/StructuredContent/StructuredContent.stories.mdx +30 -58
- package/src/components/StructuredContent/StructuredContent.test.tsx +42 -44
- package/src/components/StructuredContent/StructuredContent.tsx +9 -18
- package/src/components/StyleGuide/Bidirectionality.stories.mdx +9 -23
- package/src/components/StyleGuide/Buttons.stories.mdx +62 -62
- package/src/components/StyleGuide/ColorCard.tsx +2 -4
- package/src/components/StyleGuide/Colors.stories.mdx +7 -8
- package/src/components/StyleGuide/DesignTokens.stories.mdx +5 -7
- package/src/components/StyleGuide/Forms.stories.mdx +0 -1
- package/src/components/StyleGuide/Iconography.stories.mdx +59 -77
- package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
- package/src/components/StyleGuide/Typography.stories.mdx +15 -18
- package/src/components/Table/Table.stories.mdx +85 -1
- package/src/components/Table/Table.test.tsx +57 -1
- package/src/components/Table/Table.tsx +7 -4
- package/src/components/Table/__snapshots__/Table.test.tsx.snap +121 -0
- package/src/components/Tabs/Tabs.stories.mdx +1 -1
- package/src/components/Tabs/Tabs.test.tsx +2 -2
- package/src/components/Tabs/Tabs.tsx +26 -27
- package/src/components/Template/Template.stories.mdx +49 -54
- package/src/components/Template/Template.tsx +9 -3
- package/src/components/Text/Text.stories.mdx +5 -11
- package/src/components/Text/Text.test.tsx +3 -6
- package/src/components/Text/Text.tsx +3 -5
- package/src/components/TextInput/TextInput.stories.mdx +10 -22
- package/src/components/TextInput/TextInput.test.tsx +32 -62
- package/src/components/TextInput/TextInput.tsx +61 -30
- package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +1 -0
- package/src/components/Toggle/Toggle.stories.mdx +5 -16
- package/src/components/Toggle/Toggle.test.tsx +2 -3
- package/src/components/Toggle/Toggle.tsx +9 -10
- package/src/components/VideoPlayer/VideoPlayer.stories.mdx +13 -29
- package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -23
- package/src/components/VideoPlayer/VideoPlayer.tsx +13 -10
- package/src/docs/Chakra.stories.mdx +14 -11
- package/src/docs/Welcome.stories.mdx +23 -43
- package/src/helpers/types.ts +1 -0
- package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
- package/src/hooks/useNYPLTheme.stories.mdx +3 -6
- package/src/index.ts +52 -46
- package/src/styles.scss +0 -1
- package/src/theme/components/buttonGroup.ts +10 -0
- package/src/theme/components/card.ts +50 -15
- package/src/theme/components/componentWrapper.ts +5 -1
- package/src/theme/components/customTable.ts +8 -2
- package/src/theme/components/fieldset.ts +5 -1
- package/src/theme/components/helperErrorText.ts +5 -1
- package/src/theme/components/hero.ts +2 -2
- package/src/theme/components/horizontalRule.ts +5 -1
- package/src/theme/components/icon.ts +7 -1
- package/src/theme/components/image.ts +14 -3
- package/src/theme/components/label.ts +5 -1
- package/src/theme/components/list.ts +8 -2
- package/src/theme/components/logo.ts +5 -1
- package/src/theme/components/notification.ts +38 -14
- package/src/theme/components/progressIndicator.ts +10 -5
- package/src/theme/components/select.ts +5 -6
- package/src/theme/components/skeletonLoader.ts +8 -2
- package/src/theme/components/skipNavigation.ts +26 -0
- package/src/theme/components/slider.ts +13 -1
- package/src/theme/components/structuredContent.ts +11 -1
- package/src/theme/components/text.ts +12 -5
- package/src/theme/components/toggle.ts +9 -3
- package/src/theme/index.ts +4 -0
- package/src/theme/provider.tsx +1 -1
- package/src/utils/componentCategories.ts +13 -5
- package/src/utils/interfaces.ts +5 -0
- package/src/utils/utils.ts +2 -32
- package/dist/components/Accordion/AccordionTypes.d.ts +0 -5
- package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +0 -8
- package/dist/components/Button/ButtonTypes.d.ts +0 -8
- package/dist/components/DatePicker/DatePickerTypes.d.ts +0 -5
- package/dist/components/Form/FormTypes.d.ts +0 -2
- package/dist/components/Grid/GridTypes.d.ts +0 -9
- package/dist/components/Heading/HeadingTypes.d.ts +0 -14
- package/dist/components/Hero/HeroTypes.d.ts +0 -12
- package/dist/components/Icons/IconTypes.d.ts +0 -77
- package/dist/components/Image/ImageTypes.d.ts +0 -22
- package/dist/components/Link/LinkTypes.d.ts +0 -8
- package/dist/components/List/ListTypes.d.ts +0 -5
- package/dist/components/Logo/LogoTypes.d.ts +0 -54
- package/dist/components/Notification/NotificationTypes.d.ts +0 -5
- package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +0 -8
- package/dist/components/Select/SelectTypes.d.ts +0 -8
- package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -5
- package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +0 -5
- package/dist/components/StructuredContent/StructuredContentTypes.d.ts +0 -5
- package/dist/components/Text/TextTypes.d.ts +0 -6
- package/dist/components/TextInput/TextInputTypes.d.ts +0 -25
- package/dist/components/Toggle/ToggleTypes.d.ts +0 -4
- package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +0 -9
- package/dist/helpers/enums.d.ts +0 -4
- package/dist/utils/siteSections.d.ts +0 -2
- package/src/components/Accordion/AccordionTypes.tsx +0 -5
- package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +0 -8
- package/src/components/Button/ButtonTypes.tsx +0 -8
- package/src/components/DatePicker/DatePickerTypes.tsx +0 -5
- package/src/components/Form/FormTypes.tsx +0 -3
- package/src/components/Grid/GridTypes.tsx +0 -9
- package/src/components/Heading/HeadingTypes.tsx +0 -15
- package/src/components/Hero/HeroTypes.tsx +0 -20
- package/src/components/Icons/IconTypes.tsx +0 -83
- package/src/components/Image/ImageTypes.ts +0 -24
- package/src/components/Link/LinkTypes.tsx +0 -8
- package/src/components/List/ListTypes.tsx +0 -5
- package/src/components/Logo/LogoTypes.tsx +0 -56
- package/src/components/Modal/_Modal.scss +0 -18
- package/src/components/Notification/NotificationTypes.tsx +0 -5
- package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +0 -8
- package/src/components/Select/SelectTypes.tsx +0 -10
- package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
- package/src/components/StatusBadge/StatusBadgeTypes.tsx +0 -5
- package/src/components/StructuredContent/StructuredContentTypes.tsx +0 -5
- package/src/components/Text/TextTypes.tsx +0 -6
- package/src/components/TextInput/TextInputTypes.tsx +0 -48
- package/src/components/Toggle/ToggleTypes.tsx +0 -4
- package/src/components/VideoPlayer/VideoPlayerTypes.tsx +0 -10
- package/src/helpers/enums.ts +0 -4
- package/src/utils/siteSections.ts +0 -10
|
@@ -3,9 +3,7 @@ import { render, screen } from "@testing-library/react";
|
|
|
3
3
|
import { axe } from "jest-axe";
|
|
4
4
|
import renderer from "react-test-renderer";
|
|
5
5
|
|
|
6
|
-
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
7
6
|
import StructuredContent from "./StructuredContent";
|
|
8
|
-
import { StructuredContentImagePosition } from "./StructuredContentTypes";
|
|
9
7
|
|
|
10
8
|
const htmlStringBodyContent =
|
|
11
9
|
"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do" +
|
|
@@ -88,11 +86,11 @@ describe("StructuredContent Accessibility", () => {
|
|
|
88
86
|
headingText="Heading text"
|
|
89
87
|
imageProps={{
|
|
90
88
|
alt: "Image alt text",
|
|
91
|
-
aspectRatio:
|
|
89
|
+
aspectRatio: "original",
|
|
92
90
|
caption: "Image caption",
|
|
93
91
|
credit: "Image credit",
|
|
94
|
-
position:
|
|
95
|
-
size:
|
|
92
|
+
position: "left",
|
|
93
|
+
size: "medium",
|
|
96
94
|
src: "https://placeimg.com/400/300/animals",
|
|
97
95
|
}}
|
|
98
96
|
/>
|
|
@@ -108,11 +106,11 @@ describe("StructuredContent Accessibility", () => {
|
|
|
108
106
|
headingText="Heading text"
|
|
109
107
|
imageProps={{
|
|
110
108
|
alt: "Image alt text",
|
|
111
|
-
aspectRatio:
|
|
109
|
+
aspectRatio: "original",
|
|
112
110
|
caption: "Image caption",
|
|
113
111
|
credit: "Image credit",
|
|
114
|
-
position:
|
|
115
|
-
size:
|
|
112
|
+
position: "left",
|
|
113
|
+
size: "medium",
|
|
116
114
|
src: "https://placeimg.com/400/300/animals",
|
|
117
115
|
}}
|
|
118
116
|
/>
|
|
@@ -141,11 +139,11 @@ describe("StructuredContent", () => {
|
|
|
141
139
|
headingText="Heading text"
|
|
142
140
|
imageProps={{
|
|
143
141
|
alt: "Image alt text",
|
|
144
|
-
aspectRatio:
|
|
142
|
+
aspectRatio: "original",
|
|
145
143
|
caption: "Image caption",
|
|
146
144
|
credit: "Image credit",
|
|
147
|
-
position:
|
|
148
|
-
size:
|
|
145
|
+
position: "left",
|
|
146
|
+
size: "medium",
|
|
149
147
|
src: "https://placeimg.com/400/300/animals",
|
|
150
148
|
}}
|
|
151
149
|
/>
|
|
@@ -165,11 +163,11 @@ describe("StructuredContent", () => {
|
|
|
165
163
|
bodyContent={htmlStringBodyContent}
|
|
166
164
|
imageProps={{
|
|
167
165
|
alt: "Image alt text",
|
|
168
|
-
aspectRatio:
|
|
166
|
+
aspectRatio: "original",
|
|
169
167
|
caption: "Image caption",
|
|
170
168
|
credit: "Image credit",
|
|
171
|
-
position:
|
|
172
|
-
size:
|
|
169
|
+
position: "left",
|
|
170
|
+
size: "medium",
|
|
173
171
|
src: "https://placeimg.com/400/300/animals",
|
|
174
172
|
}}
|
|
175
173
|
/>
|
|
@@ -208,11 +206,11 @@ describe("StructuredContent", () => {
|
|
|
208
206
|
calloutText="This is the callout text"
|
|
209
207
|
headingText="Heading text"
|
|
210
208
|
imageProps={{
|
|
211
|
-
aspectRatio:
|
|
209
|
+
aspectRatio: "original",
|
|
212
210
|
caption: "Image caption",
|
|
213
211
|
credit: "Image credit",
|
|
214
|
-
position:
|
|
215
|
-
size:
|
|
212
|
+
position: "left",
|
|
213
|
+
size: "medium",
|
|
216
214
|
src: "https://placeimg.com/400/300/animals",
|
|
217
215
|
}}
|
|
218
216
|
/>
|
|
@@ -233,11 +231,11 @@ describe("StructuredContent", () => {
|
|
|
233
231
|
headingText="Heading text"
|
|
234
232
|
imageProps={{
|
|
235
233
|
alt: "Image alt text",
|
|
236
|
-
aspectRatio:
|
|
234
|
+
aspectRatio: "original",
|
|
237
235
|
caption: "Image caption",
|
|
238
236
|
credit: "Image credit",
|
|
239
|
-
position:
|
|
240
|
-
size:
|
|
237
|
+
position: "left",
|
|
238
|
+
size: "medium",
|
|
241
239
|
src: "https://placeimg.com/400/300/animals",
|
|
242
240
|
}}
|
|
243
241
|
/>
|
|
@@ -255,10 +253,10 @@ describe("StructuredContent", () => {
|
|
|
255
253
|
headingText="Heading text"
|
|
256
254
|
imageProps={{
|
|
257
255
|
alt: "Image alt text",
|
|
258
|
-
aspectRatio:
|
|
256
|
+
aspectRatio: "original",
|
|
259
257
|
credit: "Image credit",
|
|
260
|
-
position:
|
|
261
|
-
size:
|
|
258
|
+
position: "left",
|
|
259
|
+
size: "medium",
|
|
262
260
|
src: "https://placeimg.com/400/300/animals",
|
|
263
261
|
}}
|
|
264
262
|
/>
|
|
@@ -277,9 +275,9 @@ describe("StructuredContent", () => {
|
|
|
277
275
|
headingText="Heading text"
|
|
278
276
|
imageProps={{
|
|
279
277
|
alt: "Image alt text",
|
|
280
|
-
aspectRatio:
|
|
281
|
-
position:
|
|
282
|
-
size:
|
|
278
|
+
aspectRatio: "original",
|
|
279
|
+
position: "left",
|
|
280
|
+
size: "medium",
|
|
283
281
|
src: "https://placeimg.com/400/300/animals",
|
|
284
282
|
}}
|
|
285
283
|
/>
|
|
@@ -300,11 +298,11 @@ describe("StructuredContent", () => {
|
|
|
300
298
|
id="withHTMLStringContent"
|
|
301
299
|
imageProps={{
|
|
302
300
|
alt: "Image alt text",
|
|
303
|
-
aspectRatio:
|
|
301
|
+
aspectRatio: "original",
|
|
304
302
|
caption: "Image caption",
|
|
305
303
|
credit: "Image credit",
|
|
306
|
-
position:
|
|
307
|
-
size:
|
|
304
|
+
position: "left",
|
|
305
|
+
size: "medium",
|
|
308
306
|
src: "https://placeimg.com/400/300/animals",
|
|
309
307
|
}}
|
|
310
308
|
/>
|
|
@@ -319,11 +317,11 @@ describe("StructuredContent", () => {
|
|
|
319
317
|
id="withHTMLDOMContent"
|
|
320
318
|
imageProps={{
|
|
321
319
|
alt: "Image alt text",
|
|
322
|
-
aspectRatio:
|
|
320
|
+
aspectRatio: "original",
|
|
323
321
|
caption: "Image caption",
|
|
324
322
|
credit: "Image credit",
|
|
325
|
-
position:
|
|
326
|
-
size:
|
|
323
|
+
position: "left",
|
|
324
|
+
size: "medium",
|
|
327
325
|
src: "https://placeimg.com/400/300/animals",
|
|
328
326
|
}}
|
|
329
327
|
/>
|
|
@@ -348,9 +346,9 @@ describe("StructuredContent", () => {
|
|
|
348
346
|
id="withImageWithoutCaptionOrCredit"
|
|
349
347
|
imageProps={{
|
|
350
348
|
alt: "Image alt text",
|
|
351
|
-
aspectRatio:
|
|
352
|
-
position:
|
|
353
|
-
size:
|
|
349
|
+
aspectRatio: "original",
|
|
350
|
+
position: "left",
|
|
351
|
+
size: "medium",
|
|
354
352
|
src: "https://placeimg.com/400/300/animals",
|
|
355
353
|
}}
|
|
356
354
|
/>
|
|
@@ -364,11 +362,11 @@ describe("StructuredContent", () => {
|
|
|
364
362
|
id="withoutHeading"
|
|
365
363
|
imageProps={{
|
|
366
364
|
alt: "Image alt text",
|
|
367
|
-
aspectRatio:
|
|
365
|
+
aspectRatio: "original",
|
|
368
366
|
caption: "Image caption",
|
|
369
367
|
credit: "Image credit",
|
|
370
|
-
position:
|
|
371
|
-
size:
|
|
368
|
+
position: "left",
|
|
369
|
+
size: "medium",
|
|
372
370
|
src: "https://placeimg.com/400/300/animals",
|
|
373
371
|
}}
|
|
374
372
|
/>
|
|
@@ -391,11 +389,11 @@ describe("StructuredContent", () => {
|
|
|
391
389
|
id="withChakraProps"
|
|
392
390
|
imageProps={{
|
|
393
391
|
alt: "Image alt text",
|
|
394
|
-
aspectRatio:
|
|
392
|
+
aspectRatio: "original",
|
|
395
393
|
caption: "Image caption",
|
|
396
394
|
credit: "Image credit",
|
|
397
|
-
position:
|
|
398
|
-
size:
|
|
395
|
+
position: "left",
|
|
396
|
+
size: "medium",
|
|
399
397
|
src: "https://placeimg.com/400/300/animals",
|
|
400
398
|
}}
|
|
401
399
|
bodyContent={htmlStringBodyContent}
|
|
@@ -412,11 +410,11 @@ describe("StructuredContent", () => {
|
|
|
412
410
|
id="withOtherProps"
|
|
413
411
|
imageProps={{
|
|
414
412
|
alt: "Image alt text",
|
|
415
|
-
aspectRatio:
|
|
413
|
+
aspectRatio: "original",
|
|
416
414
|
caption: "Image caption",
|
|
417
415
|
credit: "Image credit",
|
|
418
|
-
position:
|
|
419
|
-
size:
|
|
416
|
+
position: "left",
|
|
417
|
+
size: "medium",
|
|
420
418
|
src: "https://placeimg.com/400/300/animals",
|
|
421
419
|
}}
|
|
422
420
|
bodyContent={htmlStringBodyContent}
|
|
@@ -2,14 +2,13 @@ import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
|
|
4
4
|
import Heading from "../Heading/Heading";
|
|
5
|
-
import { HeadingSizes, HeadingLevels } from "../Heading/HeadingTypes";
|
|
6
5
|
import Image, { ComponentImageProps, ImageProps } from "../Image/Image";
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
|
|
7
|
+
export type StructuredContentImagePosition = "left" | "right" | "center";
|
|
9
8
|
|
|
10
9
|
interface StructuredContentImageProps extends ComponentImageProps {
|
|
11
10
|
/** Optional value to control the positioning of the internal `Image` component.
|
|
12
|
-
* Defaults to `
|
|
11
|
+
* Defaults to `"left"`. */
|
|
13
12
|
position?: StructuredContentImagePosition;
|
|
14
13
|
}
|
|
15
14
|
|
|
@@ -74,12 +73,12 @@ export const StructuredContent = chakra(
|
|
|
74
73
|
id,
|
|
75
74
|
imageProps = {
|
|
76
75
|
alt: "",
|
|
77
|
-
aspectRatio:
|
|
76
|
+
aspectRatio: "square",
|
|
78
77
|
caption: undefined,
|
|
79
78
|
component: undefined,
|
|
80
79
|
credit: undefined,
|
|
81
|
-
position:
|
|
82
|
-
size:
|
|
80
|
+
position: "left",
|
|
81
|
+
size: "medium",
|
|
83
82
|
src: "",
|
|
84
83
|
},
|
|
85
84
|
bodyContent,
|
|
@@ -111,17 +110,9 @@ export const StructuredContent = chakra(
|
|
|
111
110
|
|
|
112
111
|
return (
|
|
113
112
|
<Box id={id} className={className} __css={styles} {...rest}>
|
|
114
|
-
{headingText &&
|
|
115
|
-
<Heading id={`${id}-heading`} level={HeadingLevels.Two}>
|
|
116
|
-
{headingText}
|
|
117
|
-
</Heading>
|
|
118
|
-
)}
|
|
113
|
+
{headingText && <Heading id={`${id}-heading`}>{headingText}</Heading>}
|
|
119
114
|
{calloutText && (
|
|
120
|
-
<Heading
|
|
121
|
-
id={`${id}-callout`}
|
|
122
|
-
level={HeadingLevels.Three}
|
|
123
|
-
size={HeadingSizes.Callout}
|
|
124
|
-
>
|
|
115
|
+
<Heading id={`${id}-callout`} level="three" size="callout">
|
|
125
116
|
{calloutText}
|
|
126
117
|
</Heading>
|
|
127
118
|
)}
|
|
@@ -136,7 +127,7 @@ export const StructuredContent = chakra(
|
|
|
136
127
|
caption={imageProps.caption}
|
|
137
128
|
credit={imageProps.credit}
|
|
138
129
|
size={imageProps.size}
|
|
139
|
-
src={imageProps.src ? imageProps.src :
|
|
130
|
+
src={imageProps.src ? imageProps.src : undefined}
|
|
140
131
|
/>
|
|
141
132
|
)}
|
|
142
133
|
{finalBodyContent}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { Canvas, Meta } from "@storybook/addon-docs";
|
|
2
2
|
|
|
3
|
-
import SearchBar from "../SearchBar/SearchBar";
|
|
4
|
-
import Icon from "../Icons/Icon";
|
|
5
|
-
import { IconNames, IconSizes, IconAlign } from "../Icons/IconTypes";
|
|
6
3
|
import Button from "../Button/Button";
|
|
7
|
-
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
8
4
|
import HelperErrorText from "../HelperErrorText/HelperErrorText";
|
|
5
|
+
import Icon from "../Icons/Icon";
|
|
6
|
+
import SearchBar from "../SearchBar/SearchBar";
|
|
9
7
|
import { getCategory } from "../../utils/componentCategories";
|
|
10
8
|
import DSProvider from "../../theme/provider";
|
|
11
9
|
|
|
@@ -37,9 +35,9 @@ components should work appropriately in RTL configurations in any browser.
|
|
|
37
35
|
|
|
38
36
|
## Application Implementation
|
|
39
37
|
|
|
40
|
-
Components in the DS will support layout and component mirroring, but application
|
|
41
|
-
directionality should be implemented at the application level. The following are
|
|
42
|
-
general guidelines on how to set up directionality but implementation will be up
|
|
38
|
+
Components in the DS will support layout and component mirroring, but application
|
|
39
|
+
directionality should be implemented at the application level. The following are
|
|
40
|
+
general guidelines on how to set up directionality but implementation will be up
|
|
43
41
|
to the application and its architecture.
|
|
44
42
|
|
|
45
43
|
### `dir` HTML attribute
|
|
@@ -191,26 +189,14 @@ help reduce any visual mistakes.
|
|
|
191
189
|
<div style={{ display: "flex", flexDirection: "column" }}>
|
|
192
190
|
<div style={{ width: "300px" }}>
|
|
193
191
|
A regular button:
|
|
194
|
-
<Button
|
|
195
|
-
<Icon
|
|
196
|
-
name={IconNames.Search}
|
|
197
|
-
size={IconSizes.Small}
|
|
198
|
-
align={IconAlign.Left}
|
|
199
|
-
/>
|
|
192
|
+
<Button id="button-ex4" type="submit">
|
|
193
|
+
<Icon name="search" size="small" align="left" />
|
|
200
194
|
Search
|
|
201
195
|
</Button>
|
|
202
196
|
<div dir="rtl">
|
|
203
197
|
An RTL button:
|
|
204
|
-
<Button
|
|
205
|
-
|
|
206
|
-
id="button-ex5"
|
|
207
|
-
type="submit"
|
|
208
|
-
>
|
|
209
|
-
<Icon
|
|
210
|
-
name={IconNames.Search}
|
|
211
|
-
size={IconSizes.Small}
|
|
212
|
-
align={IconAlign.Left}
|
|
213
|
-
/>
|
|
198
|
+
<Button id="button-ex5" type="submit">
|
|
199
|
+
<Icon name="search" size="small" align="left" />
|
|
214
200
|
Search
|
|
215
201
|
</Button>
|
|
216
202
|
</div>
|
|
@@ -1,15 +1,8 @@
|
|
|
1
|
-
import { ButtonGroup } from "@chakra-ui/react";
|
|
2
1
|
import { Canvas, Meta } from "@storybook/addon-docs";
|
|
3
2
|
|
|
4
3
|
import Button from "../Button/Button";
|
|
5
|
-
import
|
|
4
|
+
import ButtonGroup from "../ButtonGroup/ButtonGroup";
|
|
6
5
|
import Icon from "../Icons/Icon";
|
|
7
|
-
import {
|
|
8
|
-
IconAlign,
|
|
9
|
-
IconNames,
|
|
10
|
-
IconRotationTypes,
|
|
11
|
-
IconSizes,
|
|
12
|
-
} from "../Icons/IconTypes";
|
|
13
6
|
import { getCategory } from "../../utils/componentCategories";
|
|
14
7
|
import DSProvider from "../../theme/provider";
|
|
15
8
|
|
|
@@ -32,9 +25,9 @@ Use the [Button](https://nypl.github.io/nypl-design-system/storybook-static/?pat
|
|
|
32
25
|
component to render form buttons.
|
|
33
26
|
|
|
34
27
|
```jsx
|
|
35
|
-
import { Button
|
|
28
|
+
import { Button } from "@nypl/design-system-react-components";
|
|
36
29
|
|
|
37
|
-
<Button
|
|
30
|
+
<Button id="btn">Button Text</Button>;
|
|
38
31
|
```
|
|
39
32
|
|
|
40
33
|
## Guidelines
|
|
@@ -64,26 +57,24 @@ can be achieved by using the `Form` component to wrap the `Button`s.
|
|
|
64
57
|
<Canvas>
|
|
65
58
|
<DSProvider>
|
|
66
59
|
<ButtonGroup>
|
|
67
|
-
<Button
|
|
68
|
-
<Button
|
|
69
|
-
<Icon
|
|
70
|
-
name={IconNames.Search}
|
|
71
|
-
size={IconSizes.Small}
|
|
72
|
-
align={IconAlign.Left}
|
|
73
|
-
/>
|
|
60
|
+
<Button id="basic">Button Text</Button>
|
|
61
|
+
<Button id="btn-search">
|
|
62
|
+
<Icon name="search" size="small" align="left" />
|
|
74
63
|
Button Text
|
|
75
64
|
</Button>
|
|
76
|
-
<Button
|
|
77
|
-
<Icon name=
|
|
65
|
+
<Button id="only-icon">
|
|
66
|
+
<Icon name="close" size="medium" />
|
|
67
|
+
</Button>
|
|
68
|
+
<Button buttonType="callout" id="donate">
|
|
69
|
+
Donate
|
|
78
70
|
</Button>
|
|
79
|
-
<Button buttonType=
|
|
80
|
-
<Button buttonType={ButtonTypes.Secondary}>
|
|
71
|
+
<Button buttonType="secondary" id="btn-back-to-top">
|
|
81
72
|
Back to Top
|
|
82
73
|
<Icon
|
|
83
|
-
name=
|
|
84
|
-
size=
|
|
85
|
-
align=
|
|
86
|
-
iconRotation=
|
|
74
|
+
name="arrow"
|
|
75
|
+
size="small"
|
|
76
|
+
align="right"
|
|
77
|
+
iconRotation="rotate180"
|
|
87
78
|
/>
|
|
88
79
|
</Button>
|
|
89
80
|
</ButtonGroup>
|
|
@@ -98,44 +89,56 @@ component.
|
|
|
98
89
|
<Canvas>
|
|
99
90
|
<DSProvider>
|
|
100
91
|
<ButtonGroup>
|
|
101
|
-
<Button buttonType=
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<Button buttonType=
|
|
105
|
-
|
|
106
|
-
|
|
92
|
+
<Button buttonType="primary" id="primary">
|
|
93
|
+
Primary Button
|
|
94
|
+
</Button>
|
|
95
|
+
<Button buttonType="secondary" id="secondary">
|
|
96
|
+
Secondary Button
|
|
97
|
+
</Button>
|
|
98
|
+
<Button buttonType="callout" id="callout">
|
|
99
|
+
Callout Button
|
|
100
|
+
</Button>
|
|
101
|
+
<Button buttonType="pill" id="pill">
|
|
102
|
+
Pill Button
|
|
103
|
+
</Button>
|
|
104
|
+
<Button buttonType="link" id="link">
|
|
105
|
+
Link Button
|
|
106
|
+
</Button>
|
|
107
|
+
<Button buttonType="noBrand" id="noBrand">
|
|
108
|
+
NoBrand Button
|
|
109
|
+
</Button>
|
|
107
110
|
</ButtonGroup>
|
|
108
111
|
</DSProvider>
|
|
109
112
|
</Canvas>
|
|
110
113
|
|
|
111
|
-
###
|
|
114
|
+
### Primary
|
|
112
115
|
|
|
113
116
|
- used for actions that move the user forward
|
|
114
117
|
- Visual Treatment: rectangular, filled
|
|
115
118
|
|
|
116
|
-
###
|
|
119
|
+
### Secondary
|
|
117
120
|
|
|
118
121
|
- used for actions that move the user back, such as a form cancel button
|
|
119
122
|
- often paired with a Primary button
|
|
120
123
|
- Visual Treatment: rectangular, outlined
|
|
121
124
|
|
|
122
|
-
###
|
|
125
|
+
### Callout
|
|
123
126
|
|
|
124
127
|
- used for call to actions such as donation buttons
|
|
125
128
|
- Visual Treatment: rectangular, NYPL red background
|
|
126
129
|
|
|
127
|
-
###
|
|
130
|
+
### Pill
|
|
128
131
|
|
|
129
132
|
- used for equally weighted actions
|
|
130
133
|
- should only be used for buttons that are displayed in a set (i.e. never use for a singleton button)
|
|
131
134
|
- Visual Treatment: rounded, outlined
|
|
132
135
|
|
|
133
|
-
###
|
|
136
|
+
### Link
|
|
134
137
|
|
|
135
138
|
- used for equally weighted actions
|
|
136
139
|
- Visual Treatment: text link with underline
|
|
137
140
|
|
|
138
|
-
###
|
|
141
|
+
### NoBrand
|
|
139
142
|
|
|
140
143
|
- used in cases where there is no brand color
|
|
141
144
|
- Visual Treatment: rectangular, filled with a black background
|
|
@@ -144,43 +147,40 @@ component.
|
|
|
144
147
|
|
|
145
148
|
- Buttons are blue by default.
|
|
146
149
|
- Buttons that are intended as a call out (i.e. Donation buttons) should be set
|
|
147
|
-
as `
|
|
148
|
-
- The "Back to Top" button must be set as `
|
|
149
|
-
|
|
150
|
-
- Previous and Next buttons should be set as `
|
|
151
|
-
|
|
152
|
-
- Only use the `
|
|
153
|
-
|
|
150
|
+
as `"callout"`.
|
|
151
|
+
- The "Back to Top" button must be set as `"secondary"` and must include an up
|
|
152
|
+
arrow icon.
|
|
153
|
+
- Previous and Next buttons should be set as `"secondary"` and be wrapped in a
|
|
154
|
+
`ButtonGroup`.
|
|
155
|
+
- Only use the `"noBrand"` style where there is no brand color. _This should be
|
|
156
|
+
rarely used._
|
|
154
157
|
|
|
155
158
|
<Canvas>
|
|
156
159
|
<DSProvider>
|
|
157
160
|
<ButtonGroup>
|
|
158
|
-
<Button buttonType=
|
|
159
|
-
|
|
161
|
+
<Button buttonType="callout" id="callout2">
|
|
162
|
+
Donate to this library
|
|
163
|
+
</Button>
|
|
164
|
+
<Button buttonType="secondary" id="secondary2">
|
|
160
165
|
Back to Top
|
|
161
166
|
<Icon
|
|
162
|
-
|
|
163
|
-
iconRotation=
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
align="right"
|
|
168
|
+
iconRotation="rotate180"
|
|
169
|
+
name="arrow"
|
|
170
|
+
size="small"
|
|
166
171
|
/>
|
|
167
172
|
</Button>
|
|
168
|
-
<Button buttonType=
|
|
169
|
-
<Icon
|
|
170
|
-
name={IconNames.Arrow}
|
|
171
|
-
iconRotation={IconRotationTypes.Rotate90}
|
|
172
|
-
align={IconAlign.Left}
|
|
173
|
-
size={IconSizes.Small}
|
|
174
|
-
/>
|
|
173
|
+
<Button buttonType="secondary" id="previous">
|
|
174
|
+
<Icon align="left" iconRotation="rotate90" name="arrow" size="small" />
|
|
175
175
|
Previous
|
|
176
176
|
</Button>
|
|
177
|
-
<Button buttonType=
|
|
177
|
+
<Button buttonType="secondary" id="next">
|
|
178
178
|
Next
|
|
179
179
|
<Icon
|
|
180
|
-
|
|
181
|
-
iconRotation=
|
|
182
|
-
|
|
183
|
-
size=
|
|
180
|
+
align="right"
|
|
181
|
+
iconRotation="rotate270"
|
|
182
|
+
name="arrow"
|
|
183
|
+
size="small"
|
|
184
184
|
/>
|
|
185
185
|
</Button>
|
|
186
186
|
</ButtonGroup>
|
|
@@ -2,8 +2,6 @@ import * as React from "react";
|
|
|
2
2
|
|
|
3
3
|
import Card from "../Card/Card";
|
|
4
4
|
import Heading from "../Heading/Heading";
|
|
5
|
-
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
6
|
-
import { LayoutTypes } from "../../helpers/enums";
|
|
7
5
|
|
|
8
6
|
export interface ColorCardProps {
|
|
9
7
|
/** backgroundColor of the color card */
|
|
@@ -27,10 +25,10 @@ export default function ColorCard(
|
|
|
27
25
|
backgroundColor={backgroundColor}
|
|
28
26
|
isBordered
|
|
29
27
|
isCentered
|
|
30
|
-
layout=
|
|
28
|
+
layout="column"
|
|
31
29
|
/>
|
|
32
30
|
<div style={{ marginLeft: "1rem" }}>
|
|
33
|
-
<Heading level=
|
|
31
|
+
<Heading level="four">{colorName}</Heading>
|
|
34
32
|
{/*
|
|
35
33
|
TODO:
|
|
36
34
|
This code is returning the CSS variable name. This is not what we
|
|
@@ -2,7 +2,6 @@ import { Canvas, Meta } from "@storybook/addon-docs";
|
|
|
2
2
|
|
|
3
3
|
import ColorCard from "./ColorCard";
|
|
4
4
|
import Heading from "../Heading/Heading";
|
|
5
|
-
import { HeadingLevels } from "../Heading/HeadingTypes";
|
|
6
5
|
import SimpleGrid from "../Grid/SimpleGrid";
|
|
7
6
|
import { getCategory } from "../../utils/componentCategories";
|
|
8
7
|
import DSProvider from "../../theme/provider";
|
|
@@ -115,7 +114,7 @@ Section colors are branding colors only in use at NYPL.
|
|
|
115
114
|
|
|
116
115
|
<Canvas>
|
|
117
116
|
<DSProvider>
|
|
118
|
-
<Heading
|
|
117
|
+
<Heading>Blogs</Heading>
|
|
119
118
|
<p>Blogs is used for the Blogs section.</p>
|
|
120
119
|
<SimpleGrid columns={1}>{getColorCards("blogs")}</SimpleGrid>
|
|
121
120
|
</DSProvider>
|
|
@@ -123,7 +122,7 @@ Section colors are branding colors only in use at NYPL.
|
|
|
123
122
|
|
|
124
123
|
<Canvas>
|
|
125
124
|
<DSProvider>
|
|
126
|
-
<Heading
|
|
125
|
+
<Heading>Books and More</Heading>
|
|
127
126
|
<p>
|
|
128
127
|
Books and More is used for the Catalog, Staff Picks, Recommendations, New
|
|
129
128
|
Arrivals, and E-Book Central.
|
|
@@ -134,7 +133,7 @@ Section colors are branding colors only in use at NYPL.
|
|
|
134
133
|
|
|
135
134
|
<Canvas>
|
|
136
135
|
<DSProvider>
|
|
137
|
-
<Heading
|
|
136
|
+
<Heading>Education</Heading>
|
|
138
137
|
<p>
|
|
139
138
|
Education is used for the Education section front and all associated
|
|
140
139
|
sub-sections.
|
|
@@ -145,7 +144,7 @@ Section colors are branding colors only in use at NYPL.
|
|
|
145
144
|
|
|
146
145
|
<Canvas>
|
|
147
146
|
<DSProvider>
|
|
148
|
-
<Heading
|
|
147
|
+
<Heading>Locations</Heading>
|
|
149
148
|
<p>
|
|
150
149
|
Locations is used for Location Finder and all branch pages with the
|
|
151
150
|
exceptions of some research libraries.
|
|
@@ -156,7 +155,7 @@ Section colors are branding colors only in use at NYPL.
|
|
|
156
155
|
|
|
157
156
|
<Canvas>
|
|
158
157
|
<DSProvider>
|
|
159
|
-
<Heading
|
|
158
|
+
<Heading>Research</Heading>
|
|
160
159
|
<p>Research is used for the Research Catalog and SCC.</p>
|
|
161
160
|
<SimpleGrid columns={1}>{getColorCards("research")}</SimpleGrid>
|
|
162
161
|
</DSProvider>
|
|
@@ -164,7 +163,7 @@ Section colors are branding colors only in use at NYPL.
|
|
|
164
163
|
|
|
165
164
|
<Canvas>
|
|
166
165
|
<DSProvider>
|
|
167
|
-
<Heading
|
|
166
|
+
<Heading>Research Libraries</Heading>
|
|
168
167
|
<p>Research libraries with specific brand colors to adhere to.</p>
|
|
169
168
|
<SimpleGrid columns={1}>{getColorCards("researchLibraries")}</SimpleGrid>
|
|
170
169
|
</DSProvider>
|
|
@@ -172,7 +171,7 @@ Section colors are branding colors only in use at NYPL.
|
|
|
172
171
|
|
|
173
172
|
<Canvas>
|
|
174
173
|
<DSProvider>
|
|
175
|
-
<Heading
|
|
174
|
+
<Heading>What's On</Heading>
|
|
176
175
|
<p>What's On is used for Events, Exhibitions & Audio Guides.</p>
|
|
177
176
|
<SimpleGrid columns={1}>{getColorCards("whatsOn")}</SimpleGrid>
|
|
178
177
|
</DSProvider>
|
|
@@ -126,9 +126,9 @@ That said, if a DS component does need an updated style, first contact the
|
|
|
126
126
|
Design System and UX teams about this update.
|
|
127
127
|
|
|
128
128
|
If you receive approval to make a change in a consuming app, then you can add
|
|
129
|
-
styles directly
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
styles directly as style props. For example, if the `Heading` component needs to
|
|
130
|
+
render text in Reservoir's "success primary" green color and add a bold font
|
|
131
|
+
weight, then you can do the following:
|
|
132
132
|
|
|
133
133
|
```tsx
|
|
134
134
|
const theme = useNYPLTheme();
|
|
@@ -138,10 +138,8 @@ return (
|
|
|
138
138
|
<div>
|
|
139
139
|
<Heading
|
|
140
140
|
level={2}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
fontWeight: theme.fontWeights.bold,
|
|
144
|
-
}}
|
|
141
|
+
color={theme.colors.ui.success.primary}
|
|
142
|
+
fontWeight={theme.fontWeights.bold}
|
|
145
143
|
>
|
|
146
144
|
Get a Digital Library Card Today in a Few Easy Steps
|
|
147
145
|
</Heading>
|
|
@@ -2,7 +2,6 @@ import { Meta } from "@storybook/addon-docs";
|
|
|
2
2
|
|
|
3
3
|
import Card from "../Card/Card";
|
|
4
4
|
import List from "../List/List";
|
|
5
|
-
import { ListTypes } from "../List/ListTypes";
|
|
6
5
|
import { getCategory } from "../../utils/componentCategories";
|
|
7
6
|
|
|
8
7
|
<Meta title={getCategory("Forms")} />
|