@nypl/design-system-react-components 0.26.1 → 1.0.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 +54 -0
- package/README.md +7 -7
- 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 +983 -1222
- 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 +982 -1285
- 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 +144 -178
- package/src/components/Card/Card.test.tsx +36 -97
- package/src/components/Card/Card.tsx +78 -74
- package/src/components/Chakra/Box.stories.mdx +3 -7
- package/src/components/Chakra/Center.stories.mdx +6 -24
- package/src/components/Chakra/Flex.stories.mdx +5 -7
- package/src/components/Chakra/Grid.stories.mdx +1 -1
- package/src/components/Chakra/Stack.stories.mdx +10 -11
- package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
- package/src/components/Checkbox/Checkbox.test.tsx +2 -2
- package/src/components/Checkbox/Checkbox.tsx +20 -13
- package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +6 -17
- package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -7
- package/src/components/CheckboxGroup/CheckboxGroup.tsx +33 -29
- package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -11
- package/src/components/ComponentWrapper/ComponentWrapper.tsx +3 -10
- package/src/components/DatePicker/DatePicker.stories.mdx +23 -37
- package/src/components/DatePicker/DatePicker.test.tsx +21 -19
- package/src/components/DatePicker/DatePicker.tsx +57 -49
- package/src/components/Form/Form.stories.mdx +46 -31
- package/src/components/Form/Form.test.tsx +1 -18
- package/src/components/Form/Form.tsx +7 -7
- package/src/components/Grid/SimpleGrid.stories.mdx +73 -49
- package/src/components/Grid/SimpleGrid.test.tsx +7 -9
- package/src/components/Grid/SimpleGrid.tsx +14 -11
- package/src/components/Heading/Heading.stories.mdx +27 -72
- package/src/components/Heading/Heading.test.tsx +18 -44
- package/src/components/Heading/Heading.tsx +7 -10
- package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -3
- package/src/components/HelperErrorText/HelperErrorText.tsx +1 -5
- package/src/components/Hero/Hero.stories.mdx +219 -216
- package/src/components/Hero/Hero.test.tsx +107 -223
- package/src/components/Hero/Hero.tsx +63 -61
- package/src/components/Icons/Icon.stories.mdx +172 -118
- package/src/components/Icons/Icon.test.tsx +8 -16
- package/src/components/Icons/Icon.tsx +75 -29
- package/src/components/Icons/IconSvgs.tsx +42 -42
- package/src/components/Image/Image.stories.mdx +45 -132
- package/src/components/Image/Image.test.tsx +16 -31
- package/src/components/Image/Image.tsx +28 -12
- package/src/components/Link/Link.stories.mdx +30 -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 +4 -4
- 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 +63 -63
- package/src/components/StyleGuide/ColorCard.tsx +2 -4
- package/src/components/StyleGuide/Colors.stories.mdx +9 -10
- package/src/components/StyleGuide/DesignTokens.stories.mdx +5 -7
- package/src/components/StyleGuide/Forms.stories.mdx +2 -2
- package/src/components/StyleGuide/Iconography.stories.mdx +60 -78
- package/src/components/StyleGuide/Spacing.stories.mdx +1 -2
- package/src/components/StyleGuide/Typography.stories.mdx +16 -19
- 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/foundations/colors.ts +6 -9
- 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
|
@@ -9,34 +9,15 @@ import {
|
|
|
9
9
|
import { withDesign } from "storybook-addon-designs";
|
|
10
10
|
|
|
11
11
|
import Button from "../Button/Button";
|
|
12
|
-
import { ButtonTypes } from "../Button/ButtonTypes";
|
|
13
12
|
import Card, { CardHeading, CardContent, CardActions } from "./Card";
|
|
14
13
|
import Heading from "../Heading/Heading";
|
|
15
|
-
import { HeadingSizes, HeadingLevels } from "../Heading/HeadingTypes";
|
|
16
14
|
import HorizontalRule from "../HorizontalRule/HorizontalRule";
|
|
17
15
|
import Icon from "../Icons/Icon";
|
|
18
16
|
import Image from "../Image/Image";
|
|
19
|
-
import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
|
|
20
17
|
import Link from "../Link/Link";
|
|
21
|
-
import { LinkTypes } from "../Link/LinkTypes";
|
|
22
18
|
import SimpleGrid from "../Grid/SimpleGrid";
|
|
23
|
-
import { LayoutTypes } from "../../helpers/enums";
|
|
24
19
|
import { getCategory } from "../../utils/componentCategories";
|
|
25
20
|
import DSProvider from "../../theme/provider";
|
|
26
|
-
import { getStorybookEnumValues } from "../../utils/utils";
|
|
27
|
-
|
|
28
|
-
export const imageRatiosEnumValues = getStorybookEnumValues(
|
|
29
|
-
ImageRatios,
|
|
30
|
-
"ImageRatios"
|
|
31
|
-
);
|
|
32
|
-
export const imageSizesEnumValues = getStorybookEnumValues(
|
|
33
|
-
ImageSizes,
|
|
34
|
-
"ImageSizes"
|
|
35
|
-
);
|
|
36
|
-
export const LayoutTypesEnumValues = getStorybookEnumValues(
|
|
37
|
-
LayoutTypes,
|
|
38
|
-
"LayoutTypes"
|
|
39
|
-
);
|
|
40
21
|
|
|
41
22
|
<Meta
|
|
42
23
|
title={getCategory("Card")}
|
|
@@ -60,9 +41,7 @@ export const LayoutTypesEnumValues = getStorybookEnumValues(
|
|
|
60
41
|
table: { defaultValue: { summary: "" } },
|
|
61
42
|
},
|
|
62
43
|
"imageProps.aspectRatio": {
|
|
63
|
-
|
|
64
|
-
table: { defaultValue: { summary: "ImageRatios.Square" } },
|
|
65
|
-
options: imageRatiosEnumValues.options,
|
|
44
|
+
table: { defaultValue: { summary: "square" } },
|
|
66
45
|
},
|
|
67
46
|
"imageProps.caption": { control: false },
|
|
68
47
|
"imageProps.component": { control: false },
|
|
@@ -71,9 +50,7 @@ export const LayoutTypesEnumValues = getStorybookEnumValues(
|
|
|
71
50
|
table: { defaultValue: { summary: false } },
|
|
72
51
|
},
|
|
73
52
|
"imageProps.size": {
|
|
74
|
-
|
|
75
|
-
table: { defaultValue: { summary: "ImageSizes.Default" } },
|
|
76
|
-
options: imageSizesEnumValues.options,
|
|
53
|
+
table: { defaultValue: { summary: "default" } },
|
|
77
54
|
},
|
|
78
55
|
"imageProps.src": {
|
|
79
56
|
table: { defaultValue: { summary: "" } },
|
|
@@ -88,9 +65,7 @@ export const LayoutTypesEnumValues = getStorybookEnumValues(
|
|
|
88
65
|
table: { defaultValue: { summary: false } },
|
|
89
66
|
},
|
|
90
67
|
layout: {
|
|
91
|
-
|
|
92
|
-
table: { defaultValue: { summary: "LayoutTypes.Column" } },
|
|
93
|
-
options: LayoutTypesEnumValues.options,
|
|
68
|
+
table: { defaultValue: { summary: "column" } },
|
|
94
69
|
},
|
|
95
70
|
}}
|
|
96
71
|
/>
|
|
@@ -100,7 +75,7 @@ export const LayoutTypesEnumValues = getStorybookEnumValues(
|
|
|
100
75
|
| Component Version | DS Version |
|
|
101
76
|
| ----------------- | ---------- |
|
|
102
77
|
| Added | `0.24.0` |
|
|
103
|
-
| Latest | `0.
|
|
78
|
+
| Latest | `0.28.0` |
|
|
104
79
|
|
|
105
80
|
## Table of Contents
|
|
106
81
|
|
|
@@ -132,7 +107,7 @@ grouped together and displayed in some type of grid layout.
|
|
|
132
107
|
### CardHeading
|
|
133
108
|
|
|
134
109
|
The `CardHeading` component mirrors the standard Reservoir Design System (DS)
|
|
135
|
-
`Heading` component and accepts the [same props](https://nypl.github.io/nypl-design-system/
|
|
110
|
+
`Heading` component and accepts the [same props](https://nypl.github.io/nypl-design-system/reservoir/v1/?path=/story/components-typography-styles-heading--heading-with-controls).
|
|
136
111
|
|
|
137
112
|
### CardActions
|
|
138
113
|
|
|
@@ -160,37 +135,42 @@ headings and CTAs.
|
|
|
160
135
|
foregroundColor: undefined,
|
|
161
136
|
id: "card-id",
|
|
162
137
|
"imageProps.alt": "Alt text",
|
|
163
|
-
"imageProps.aspectRatio": "
|
|
138
|
+
"imageProps.aspectRatio": "square",
|
|
164
139
|
"imageProps.component": undefined,
|
|
165
140
|
"imageProps.isAtEnd": false,
|
|
166
|
-
"imageProps.size": "
|
|
141
|
+
"imageProps.size": "default",
|
|
167
142
|
"imageProps.src": "https://placeimg.com/400/300/animals",
|
|
168
143
|
isAlignedRightActions: false,
|
|
169
144
|
isBordered: false,
|
|
170
145
|
isCentered: false,
|
|
171
|
-
layout: "
|
|
146
|
+
layout: "row",
|
|
172
147
|
mainActionLink: undefined,
|
|
173
148
|
}}
|
|
174
149
|
>
|
|
175
150
|
{(args) => (
|
|
176
151
|
<Card
|
|
177
|
-
{
|
|
152
|
+
backgroundColor={args.backgroundColor}
|
|
153
|
+
className={args.className}
|
|
154
|
+
foregroundColor={args.foregroundColor}
|
|
155
|
+
id={args.id}
|
|
178
156
|
imageProps={{
|
|
179
157
|
alt: args["imageProps.alt"],
|
|
180
|
-
aspectRatio:
|
|
181
|
-
args["imageProps.aspectRatio"]
|
|
182
|
-
),
|
|
158
|
+
aspectRatio: args["imageProps.aspectRatio"],
|
|
183
159
|
component: args["imageProps.component"],
|
|
184
160
|
isAtEnd: args["imageProps.isAtEnd"],
|
|
185
|
-
size:
|
|
161
|
+
size: args["imageProps.size"],
|
|
186
162
|
src: args["imageProps.src"],
|
|
187
163
|
}}
|
|
188
|
-
|
|
164
|
+
isAlignedRightActions={args.isAlignedRightActions}
|
|
165
|
+
isBordered={args.isBordered}
|
|
166
|
+
isCentered={args.isCentered}
|
|
167
|
+
layout={args.layout}
|
|
168
|
+
mainActionLink={args.mainActionLink}
|
|
189
169
|
>
|
|
190
|
-
<CardHeading level=
|
|
170
|
+
<CardHeading level="two" id="main-heading1">
|
|
191
171
|
Optional Header
|
|
192
172
|
</CardHeading>
|
|
193
|
-
<CardHeading level=
|
|
173
|
+
<CardHeading level="three" id="main-heading2">
|
|
194
174
|
Sollicitudin Lorem Tortor Purus Ornare
|
|
195
175
|
</CardHeading>
|
|
196
176
|
<CardContent>
|
|
@@ -199,16 +179,11 @@ headings and CTAs.
|
|
|
199
179
|
vel eu leo. Nulla vitae elit libero, a pharetra augue.
|
|
200
180
|
</CardContent>
|
|
201
181
|
<CardActions topBorder bottomBorder>
|
|
202
|
-
<Button
|
|
203
|
-
buttonType={ButtonTypes.Primary}
|
|
204
|
-
id="main-button1"
|
|
205
|
-
onClick={action("clicked")}
|
|
206
|
-
type="submit"
|
|
207
|
-
>
|
|
182
|
+
<Button id="main-button1" onClick={action("clicked")} type="submit">
|
|
208
183
|
Primary
|
|
209
184
|
</Button>
|
|
210
185
|
<Button
|
|
211
|
-
buttonType=
|
|
186
|
+
buttonType="secondary"
|
|
212
187
|
id="main-button2"
|
|
213
188
|
onClick={action("clicked")}
|
|
214
189
|
type="submit"
|
|
@@ -238,18 +213,18 @@ sequential order with the proper `level` prop.
|
|
|
238
213
|
|
|
239
214
|
```tsx
|
|
240
215
|
// Correct
|
|
241
|
-
<CardHeading level=
|
|
216
|
+
<CardHeading level="three" id="headingthree">
|
|
242
217
|
Heading level three
|
|
243
218
|
</CardHeading>
|
|
244
|
-
<CardHeading level=
|
|
219
|
+
<CardHeading level="four" id="headingfour">
|
|
245
220
|
Heading level four
|
|
246
221
|
</CardHeading>
|
|
247
222
|
|
|
248
223
|
// Incorrect
|
|
249
|
-
<CardHeading level=
|
|
224
|
+
<CardHeading level="two" id="headingtwo">
|
|
250
225
|
Heading level Two
|
|
251
226
|
</CardHeading>
|
|
252
|
-
<CardHeading level=
|
|
227
|
+
<CardHeading level="four" id="headingfour">
|
|
253
228
|
Heading level four
|
|
254
229
|
</CardHeading>
|
|
255
230
|
```
|
|
@@ -277,11 +252,11 @@ a `Card`.
|
|
|
277
252
|
<Card
|
|
278
253
|
imageProps={{
|
|
279
254
|
alt: "Alt text",
|
|
280
|
-
aspectRatio:
|
|
255
|
+
aspectRatio: "twoByOne",
|
|
281
256
|
src: "https://placeimg.com/400/200/animals",
|
|
282
257
|
}}
|
|
283
258
|
>
|
|
284
|
-
<CardHeading level=
|
|
259
|
+
<CardHeading level="three" id="props-heading1">
|
|
285
260
|
Image on Top (default)
|
|
286
261
|
</CardHeading>
|
|
287
262
|
<CardContent>
|
|
@@ -292,12 +267,12 @@ a `Card`.
|
|
|
292
267
|
<Card
|
|
293
268
|
imageProps={{
|
|
294
269
|
alt: "Alt text",
|
|
295
|
-
aspectRatio:
|
|
270
|
+
aspectRatio: "twoByOne",
|
|
296
271
|
isAtEnd: true,
|
|
297
272
|
src: "https://placeimg.com/400/200/animals",
|
|
298
273
|
}}
|
|
299
274
|
>
|
|
300
|
-
<CardHeading level=
|
|
275
|
+
<CardHeading level="three" id="props-heading2">
|
|
301
276
|
Image on Bottom
|
|
302
277
|
</CardHeading>
|
|
303
278
|
<CardContent>
|
|
@@ -317,13 +292,13 @@ a `Card`.
|
|
|
317
292
|
<Card
|
|
318
293
|
imageProps={{
|
|
319
294
|
alt: "Alt text",
|
|
320
|
-
aspectRatio:
|
|
295
|
+
aspectRatio: "twoByOne",
|
|
321
296
|
src: "https://placeimg.com/400/200/animals",
|
|
322
297
|
}}
|
|
323
298
|
isCentered
|
|
324
|
-
layout=
|
|
299
|
+
layout="row"
|
|
325
300
|
>
|
|
326
|
-
<CardHeading level=
|
|
301
|
+
<CardHeading level="four" id="row-heading1">
|
|
327
302
|
Image on Left (default)
|
|
328
303
|
</CardHeading>
|
|
329
304
|
<CardContent>
|
|
@@ -335,14 +310,14 @@ a `Card`.
|
|
|
335
310
|
<Card
|
|
336
311
|
imageProps={{
|
|
337
312
|
alt: "Alt text",
|
|
338
|
-
aspectRatio:
|
|
313
|
+
aspectRatio: "twoByOne",
|
|
339
314
|
isAtEnd: true,
|
|
340
315
|
src: "https://placeimg.com/400/200/animals",
|
|
341
316
|
}}
|
|
342
317
|
isCentered
|
|
343
|
-
layout=
|
|
318
|
+
layout="row"
|
|
344
319
|
>
|
|
345
|
-
<CardHeading level=
|
|
320
|
+
<CardHeading level="four" id="row-heading2">
|
|
346
321
|
Image on Right
|
|
347
322
|
</CardHeading>
|
|
348
323
|
<CardContent>
|
|
@@ -369,16 +344,16 @@ prop to override the default width.
|
|
|
369
344
|
<Card
|
|
370
345
|
imageProps={{
|
|
371
346
|
alt: "Alt text",
|
|
372
|
-
aspectRatio:
|
|
373
|
-
size:
|
|
347
|
+
aspectRatio: "square",
|
|
348
|
+
size: "xxsmall",
|
|
374
349
|
src: "https://placeimg.com/400/200/animals",
|
|
375
350
|
}}
|
|
376
351
|
isCentered
|
|
377
352
|
>
|
|
378
|
-
<CardHeading level=
|
|
353
|
+
<CardHeading level="three" id="column-heading1">
|
|
379
354
|
Extra Extra Small Image
|
|
380
355
|
</CardHeading>
|
|
381
|
-
<CardHeading level=
|
|
356
|
+
<CardHeading level="four" id="column-heading2">
|
|
382
357
|
Max-Width: 64px
|
|
383
358
|
</CardHeading>
|
|
384
359
|
<CardContent>
|
|
@@ -390,16 +365,16 @@ prop to override the default width.
|
|
|
390
365
|
<Card
|
|
391
366
|
imageProps={{
|
|
392
367
|
alt: "Alt text",
|
|
393
|
-
aspectRatio:
|
|
394
|
-
size:
|
|
368
|
+
aspectRatio: "square",
|
|
369
|
+
size: "xsmall",
|
|
395
370
|
src: "https://placeimg.com/400/200/animals",
|
|
396
371
|
}}
|
|
397
372
|
isCentered
|
|
398
373
|
>
|
|
399
|
-
<CardHeading level=
|
|
374
|
+
<CardHeading level="three" id="column-heading1">
|
|
400
375
|
Extra Small Image
|
|
401
376
|
</CardHeading>
|
|
402
|
-
<CardHeading level=
|
|
377
|
+
<CardHeading level="four" id="column-heading2">
|
|
403
378
|
Max-Width: 96px
|
|
404
379
|
</CardHeading>
|
|
405
380
|
<CardContent>
|
|
@@ -411,16 +386,16 @@ prop to override the default width.
|
|
|
411
386
|
<Card
|
|
412
387
|
imageProps={{
|
|
413
388
|
alt: "Alt text",
|
|
414
|
-
aspectRatio:
|
|
415
|
-
size:
|
|
389
|
+
aspectRatio: "square",
|
|
390
|
+
size: "small",
|
|
416
391
|
src: "https://placeimg.com/400/200/animals",
|
|
417
392
|
}}
|
|
418
393
|
isCentered
|
|
419
394
|
>
|
|
420
|
-
<CardHeading level=
|
|
395
|
+
<CardHeading level="three" id="column-heading1">
|
|
421
396
|
Small Image
|
|
422
397
|
</CardHeading>
|
|
423
|
-
<CardHeading level=
|
|
398
|
+
<CardHeading level="four" id="column-heading2">
|
|
424
399
|
Max-Width: 165px
|
|
425
400
|
</CardHeading>
|
|
426
401
|
<CardContent>
|
|
@@ -432,16 +407,16 @@ prop to override the default width.
|
|
|
432
407
|
<Card
|
|
433
408
|
imageProps={{
|
|
434
409
|
alt: "Alt text",
|
|
435
|
-
aspectRatio:
|
|
436
|
-
size:
|
|
410
|
+
aspectRatio: "square",
|
|
411
|
+
size: "medium",
|
|
437
412
|
src: "https://placeimg.com/400/200/animals",
|
|
438
413
|
}}
|
|
439
414
|
isCentered
|
|
440
415
|
>
|
|
441
|
-
<CardHeading level=
|
|
416
|
+
<CardHeading level="three" id="column2-heading1">
|
|
442
417
|
Medium Image
|
|
443
418
|
</CardHeading>
|
|
444
|
-
<CardHeading level=
|
|
419
|
+
<CardHeading level="four" id="column2-heading2">
|
|
445
420
|
Max-Width: 225px
|
|
446
421
|
</CardHeading>
|
|
447
422
|
<CardContent>
|
|
@@ -453,16 +428,16 @@ prop to override the default width.
|
|
|
453
428
|
<Card
|
|
454
429
|
imageProps={{
|
|
455
430
|
alt: "Alt text",
|
|
456
|
-
aspectRatio:
|
|
457
|
-
size:
|
|
431
|
+
aspectRatio: "square",
|
|
432
|
+
size: "large",
|
|
458
433
|
src: "https://placeimg.com/400/200/animals",
|
|
459
434
|
}}
|
|
460
435
|
isCentered
|
|
461
436
|
>
|
|
462
|
-
<CardHeading level=
|
|
437
|
+
<CardHeading level="three" id="column3-heading1">
|
|
463
438
|
Large Image
|
|
464
439
|
</CardHeading>
|
|
465
|
-
<CardHeading level=
|
|
440
|
+
<CardHeading level="four" id="column3-heading2">
|
|
466
441
|
Max-Width: 360px
|
|
467
442
|
</CardHeading>
|
|
468
443
|
<CardContent>
|
|
@@ -474,15 +449,15 @@ prop to override the default width.
|
|
|
474
449
|
<Card
|
|
475
450
|
imageProps={{
|
|
476
451
|
alt: "Alt text",
|
|
477
|
-
aspectRatio:
|
|
452
|
+
aspectRatio: "square",
|
|
478
453
|
src: "https://placeimg.com/400/200/animals",
|
|
479
454
|
}}
|
|
480
455
|
isCentered
|
|
481
456
|
>
|
|
482
|
-
<CardHeading level=
|
|
457
|
+
<CardHeading level="three" id="column-4heading1">
|
|
483
458
|
Default Image
|
|
484
459
|
</CardHeading>
|
|
485
|
-
<CardHeading level=
|
|
460
|
+
<CardHeading level="four" id="column-4heading2">
|
|
486
461
|
Width: 100%
|
|
487
462
|
</CardHeading>
|
|
488
463
|
<CardContent>
|
|
@@ -502,17 +477,17 @@ prop to override the default width.
|
|
|
502
477
|
<Card
|
|
503
478
|
imageProps={{
|
|
504
479
|
alt: "Alt text",
|
|
505
|
-
aspectRatio:
|
|
506
|
-
size:
|
|
480
|
+
aspectRatio: "twoByOne",
|
|
481
|
+
size: "xxsmall",
|
|
507
482
|
src: "https://placeimg.com/400/200/animals",
|
|
508
483
|
}}
|
|
509
484
|
isCentered
|
|
510
|
-
layout=
|
|
485
|
+
layout="row"
|
|
511
486
|
>
|
|
512
|
-
<CardHeading level=
|
|
487
|
+
<CardHeading level="three" id="row2-heading1">
|
|
513
488
|
Extra Extra Small Image
|
|
514
489
|
</CardHeading>
|
|
515
|
-
<CardHeading level=
|
|
490
|
+
<CardHeading level="four" id="row2-heading2">
|
|
516
491
|
Max-Width: 64px
|
|
517
492
|
</CardHeading>
|
|
518
493
|
<CardContent>
|
|
@@ -522,17 +497,17 @@ prop to override the default width.
|
|
|
522
497
|
<Card
|
|
523
498
|
imageProps={{
|
|
524
499
|
alt: "Alt text",
|
|
525
|
-
aspectRatio:
|
|
526
|
-
size:
|
|
500
|
+
aspectRatio: "twoByOne",
|
|
501
|
+
size: "xsmall",
|
|
527
502
|
src: "https://placeimg.com/400/200/animals",
|
|
528
503
|
}}
|
|
529
504
|
isCentered
|
|
530
|
-
layout=
|
|
505
|
+
layout="row"
|
|
531
506
|
>
|
|
532
|
-
<CardHeading level=
|
|
507
|
+
<CardHeading level="three" id="row2-heading1">
|
|
533
508
|
Extra Small Image
|
|
534
509
|
</CardHeading>
|
|
535
|
-
<CardHeading level=
|
|
510
|
+
<CardHeading level="four" id="row2-heading2">
|
|
536
511
|
Max-Width: 96px
|
|
537
512
|
</CardHeading>
|
|
538
513
|
<CardContent>
|
|
@@ -542,17 +517,17 @@ prop to override the default width.
|
|
|
542
517
|
<Card
|
|
543
518
|
imageProps={{
|
|
544
519
|
alt: "Alt text",
|
|
545
|
-
aspectRatio:
|
|
546
|
-
size:
|
|
520
|
+
aspectRatio: "twoByOne",
|
|
521
|
+
size: "small",
|
|
547
522
|
src: "https://placeimg.com/400/200/animals",
|
|
548
523
|
}}
|
|
549
524
|
isCentered
|
|
550
|
-
layout=
|
|
525
|
+
layout="row"
|
|
551
526
|
>
|
|
552
|
-
<CardHeading level=
|
|
527
|
+
<CardHeading level="three" id="row2-heading1">
|
|
553
528
|
Small Image
|
|
554
529
|
</CardHeading>
|
|
555
|
-
<CardHeading level=
|
|
530
|
+
<CardHeading level="four" id="row2-heading2">
|
|
556
531
|
Max-Width: 165px
|
|
557
532
|
</CardHeading>
|
|
558
533
|
<CardContent>
|
|
@@ -562,17 +537,17 @@ prop to override the default width.
|
|
|
562
537
|
<Card
|
|
563
538
|
imageProps={{
|
|
564
539
|
alt: "Alt text",
|
|
565
|
-
aspectRatio:
|
|
566
|
-
size:
|
|
540
|
+
aspectRatio: "twoByOne",
|
|
541
|
+
size: "medium",
|
|
567
542
|
src: "https://placeimg.com/400/200/animals",
|
|
568
543
|
}}
|
|
569
544
|
isCentered
|
|
570
|
-
layout=
|
|
545
|
+
layout="row"
|
|
571
546
|
>
|
|
572
|
-
<CardHeading level=
|
|
547
|
+
<CardHeading level="three" id="row3-heading2">
|
|
573
548
|
Medium Image
|
|
574
549
|
</CardHeading>
|
|
575
|
-
<CardHeading level=
|
|
550
|
+
<CardHeading level="four" id="row3-heading2">
|
|
576
551
|
Max-Width: 225px
|
|
577
552
|
</CardHeading>
|
|
578
553
|
<CardContent>
|
|
@@ -583,17 +558,17 @@ prop to override the default width.
|
|
|
583
558
|
<Card
|
|
584
559
|
imageProps={{
|
|
585
560
|
alt: "Alt text",
|
|
586
|
-
aspectRatio:
|
|
587
|
-
size:
|
|
561
|
+
aspectRatio: "twoByOne",
|
|
562
|
+
size: "large",
|
|
588
563
|
src: "https://placeimg.com/400/200/animals",
|
|
589
564
|
}}
|
|
590
565
|
isCentered
|
|
591
|
-
layout=
|
|
566
|
+
layout="row"
|
|
592
567
|
>
|
|
593
|
-
<CardHeading level=
|
|
568
|
+
<CardHeading level="three" id="row4-heading1">
|
|
594
569
|
Large Image
|
|
595
570
|
</CardHeading>
|
|
596
|
-
<CardHeading level=
|
|
571
|
+
<CardHeading level="four" id="row4-heading2">
|
|
597
572
|
Max-Width: 360px
|
|
598
573
|
</CardHeading>
|
|
599
574
|
<CardContent>
|
|
@@ -605,16 +580,16 @@ prop to override the default width.
|
|
|
605
580
|
<Card
|
|
606
581
|
imageProps={{
|
|
607
582
|
alt: "Alt text",
|
|
608
|
-
aspectRatio:
|
|
583
|
+
aspectRatio: "twoByOne",
|
|
609
584
|
src: "https://placeimg.com/400/200/animals",
|
|
610
585
|
}}
|
|
611
586
|
isCentered
|
|
612
|
-
layout=
|
|
587
|
+
layout="row"
|
|
613
588
|
>
|
|
614
|
-
<CardHeading level=
|
|
589
|
+
<CardHeading level="three" id="row5-heading2">
|
|
615
590
|
Default Image
|
|
616
591
|
</CardHeading>
|
|
617
|
-
<CardHeading level=
|
|
592
|
+
<CardHeading level="four" id="row5-heading2">
|
|
618
593
|
Max-Width: 225px
|
|
619
594
|
</CardHeading>
|
|
620
595
|
<CardContent>
|
|
@@ -637,17 +612,17 @@ image component in using the `imageProps.component` prop.
|
|
|
637
612
|
<Card
|
|
638
613
|
imageProps={{
|
|
639
614
|
alt: "Alt text",
|
|
640
|
-
aspectRatio:
|
|
615
|
+
aspectRatio: "sixteenByNine",
|
|
641
616
|
component: (
|
|
642
617
|
<Image src="https://placeimg.com/400/400/animals" alt="Alt text" />
|
|
643
618
|
),
|
|
644
619
|
src: "https://placeimg.com/400/200/animals",
|
|
645
620
|
}}
|
|
646
621
|
>
|
|
647
|
-
<CardHeading level=
|
|
622
|
+
<CardHeading level="two" id="img1-heading1">
|
|
648
623
|
Card Component with Custom Image Component
|
|
649
624
|
</CardHeading>
|
|
650
|
-
<CardHeading level=
|
|
625
|
+
<CardHeading level="three" id="img2-heading2">
|
|
651
626
|
Secondary Heading
|
|
652
627
|
</CardHeading>
|
|
653
628
|
<CardContent>
|
|
@@ -658,10 +633,10 @@ image component in using the `imageProps.component` prop.
|
|
|
658
633
|
consectetur est at lobortis.
|
|
659
634
|
</CardContent>
|
|
660
635
|
<CardActions>
|
|
661
|
-
<Link type=
|
|
636
|
+
<Link type="button" href="#">
|
|
662
637
|
Reserve
|
|
663
638
|
</Link>
|
|
664
|
-
<Link href="#url" type=
|
|
639
|
+
<Link href="#url" type="forwards">
|
|
665
640
|
View Book Details
|
|
666
641
|
</Link>
|
|
667
642
|
</CardActions>
|
|
@@ -681,18 +656,14 @@ see both patterns.
|
|
|
681
656
|
<Card
|
|
682
657
|
imageProps={{
|
|
683
658
|
alt: "Alt text",
|
|
684
|
-
aspectRatio:
|
|
659
|
+
aspectRatio: "twoByOne",
|
|
685
660
|
src: "https://placeimg.com/400/200/animals",
|
|
686
661
|
}}
|
|
687
662
|
>
|
|
688
|
-
<CardHeading
|
|
689
|
-
level={HeadingLevels.Three}
|
|
690
|
-
id="link-heading1"
|
|
691
|
-
url="http://nypl.org"
|
|
692
|
-
>
|
|
663
|
+
<CardHeading level="three" id="link-heading1" url="http://nypl.org">
|
|
693
664
|
Go to NYPL home page.
|
|
694
665
|
</CardHeading>
|
|
695
|
-
<CardHeading level=
|
|
666
|
+
<CardHeading level="four" id="link-heading2">
|
|
696
667
|
<>
|
|
697
668
|
Go to NYPL <Link href="http://nypl.org">home page</Link>.
|
|
698
669
|
</>
|
|
@@ -703,10 +674,10 @@ see both patterns.
|
|
|
703
674
|
clicking with a mouse.
|
|
704
675
|
</CardContent>
|
|
705
676
|
<CardActions>
|
|
706
|
-
<Link href="#" type=
|
|
677
|
+
<Link href="#" type="button">
|
|
707
678
|
Button
|
|
708
679
|
</Link>
|
|
709
|
-
<Link href="#" type=
|
|
680
|
+
<Link href="#" type="forwards">
|
|
710
681
|
Other link
|
|
711
682
|
</Link>
|
|
712
683
|
</CardActions>
|
|
@@ -731,15 +702,15 @@ from being having the full-click functionality.
|
|
|
731
702
|
<Card
|
|
732
703
|
imageProps={{
|
|
733
704
|
alt: "Alt text",
|
|
734
|
-
aspectRatio:
|
|
705
|
+
aspectRatio: "twoByOne",
|
|
735
706
|
src: "https://placeimg.com/400/200/animals",
|
|
736
707
|
}}
|
|
737
708
|
mainActionLink="http://nypl.org"
|
|
738
709
|
>
|
|
739
|
-
<CardHeading level=
|
|
710
|
+
<CardHeading level="three" id="fullclick1-heading1">
|
|
740
711
|
Go to NYPL home page.
|
|
741
712
|
</CardHeading>
|
|
742
|
-
<CardHeading level=
|
|
713
|
+
<CardHeading level="four" id="fullclick1-heading2">
|
|
743
714
|
Some other heading.
|
|
744
715
|
</CardHeading>
|
|
745
716
|
<CardContent>
|
|
@@ -748,10 +719,10 @@ from being having the full-click functionality.
|
|
|
748
719
|
clicking with a mouse.
|
|
749
720
|
</CardContent>
|
|
750
721
|
<CardActions>
|
|
751
|
-
<Link href="#" type=
|
|
722
|
+
<Link href="#" type="button">
|
|
752
723
|
Button
|
|
753
724
|
</Link>
|
|
754
|
-
<Link href="#" type=
|
|
725
|
+
<Link href="#" type="forwards">
|
|
755
726
|
Other link
|
|
756
727
|
</Link>
|
|
757
728
|
</CardActions>
|
|
@@ -759,13 +730,13 @@ from being having the full-click functionality.
|
|
|
759
730
|
<Card
|
|
760
731
|
imageProps={{
|
|
761
732
|
alt: "Alt text",
|
|
762
|
-
aspectRatio:
|
|
733
|
+
aspectRatio: "twoByOne",
|
|
763
734
|
isAtEnd: true,
|
|
764
735
|
src: "https://placeimg.com/410/210/animals",
|
|
765
736
|
}}
|
|
766
737
|
mainActionLink="http://nypl.org"
|
|
767
738
|
>
|
|
768
|
-
<CardHeading level=
|
|
739
|
+
<CardHeading level="three" id="fullclick2-heading1">
|
|
769
740
|
Go to NYPL home page.
|
|
770
741
|
</CardHeading>
|
|
771
742
|
<CardContent>
|
|
@@ -779,7 +750,7 @@ from being having the full-click functionality.
|
|
|
779
750
|
## Card with Right Side CardActions
|
|
780
751
|
|
|
781
752
|
It's possible to set only the `CardActions` component on the right side of the
|
|
782
|
-
main content area of the `Card`. This is possible only in the "
|
|
753
|
+
main content area of the `Card`. This is possible only in the `layout="row"`
|
|
783
754
|
layout and through the `Card` component's `isAlignedRightActions` prop which
|
|
784
755
|
must be set to `true`.
|
|
785
756
|
|
|
@@ -788,18 +759,18 @@ must be set to `true`.
|
|
|
788
759
|
<Card
|
|
789
760
|
imageProps={{
|
|
790
761
|
alt: "Alt text",
|
|
791
|
-
aspectRatio:
|
|
792
|
-
size:
|
|
762
|
+
aspectRatio: "twoByOne",
|
|
763
|
+
size: "medium",
|
|
793
764
|
src: "https://placeimg.com/400/200/animals",
|
|
794
765
|
}}
|
|
795
766
|
isAlignedRightActions
|
|
796
767
|
isCentered
|
|
797
|
-
layout=
|
|
768
|
+
layout="row"
|
|
798
769
|
>
|
|
799
|
-
<CardHeading level=
|
|
770
|
+
<CardHeading level="two" id="main-heading1">
|
|
800
771
|
Optional Header
|
|
801
772
|
</CardHeading>
|
|
802
|
-
<CardHeading level=
|
|
773
|
+
<CardHeading level="three" id="main-heading2">
|
|
803
774
|
Sollicitudin Lorem Tortor Purus Ornare
|
|
804
775
|
</CardHeading>
|
|
805
776
|
<CardContent>
|
|
@@ -808,18 +779,13 @@ must be set to `true`.
|
|
|
808
779
|
eu leo. Nulla vitae elit libero, a pharetra augue.
|
|
809
780
|
</CardContent>
|
|
810
781
|
<CardActions topBorder bottomBorder>
|
|
811
|
-
<Button
|
|
812
|
-
onClick={action("clicked")}
|
|
813
|
-
id="main-button1"
|
|
814
|
-
buttonType={ButtonTypes.Primary}
|
|
815
|
-
type="submit"
|
|
816
|
-
>
|
|
782
|
+
<Button onClick={action("clicked")} id="main-button1" type="submit">
|
|
817
783
|
Primary
|
|
818
784
|
</Button>
|
|
819
785
|
<Button
|
|
820
786
|
onClick={action("clicked")}
|
|
821
787
|
id="main-button2"
|
|
822
|
-
buttonType=
|
|
788
|
+
buttonType="secondary"
|
|
823
789
|
type="submit"
|
|
824
790
|
>
|
|
825
791
|
Secondary
|
|
@@ -841,11 +807,11 @@ must be set to `true`.
|
|
|
841
807
|
<Card
|
|
842
808
|
imageProps={{
|
|
843
809
|
alt: "Alt text",
|
|
844
|
-
aspectRatio:
|
|
810
|
+
aspectRatio: "twoByOne",
|
|
845
811
|
src: "https://placeimg.com/400/200/animals",
|
|
846
812
|
}}
|
|
847
813
|
>
|
|
848
|
-
<CardHeading level=
|
|
814
|
+
<CardHeading level="three" id="grid1-heading1">
|
|
849
815
|
Card Heading
|
|
850
816
|
</CardHeading>
|
|
851
817
|
<CardContent>
|
|
@@ -856,11 +822,11 @@ must be set to `true`.
|
|
|
856
822
|
<Card
|
|
857
823
|
imageProps={{
|
|
858
824
|
alt: "Alt text",
|
|
859
|
-
aspectRatio:
|
|
825
|
+
aspectRatio: "twoByOne",
|
|
860
826
|
src: "https://placeimg.com/410/210/animals",
|
|
861
827
|
}}
|
|
862
828
|
>
|
|
863
|
-
<CardHeading level=
|
|
829
|
+
<CardHeading level="three" id="grid2-heading1">
|
|
864
830
|
Card Heading
|
|
865
831
|
</CardHeading>
|
|
866
832
|
<CardContent>
|
|
@@ -871,11 +837,11 @@ must be set to `true`.
|
|
|
871
837
|
<Card
|
|
872
838
|
imageProps={{
|
|
873
839
|
alt: "Alt text",
|
|
874
|
-
aspectRatio:
|
|
840
|
+
aspectRatio: "twoByOne",
|
|
875
841
|
src: "https://placeimg.com/420/220/animals",
|
|
876
842
|
}}
|
|
877
843
|
>
|
|
878
|
-
<CardHeading level=
|
|
844
|
+
<CardHeading level="three" id="grid3-heading1">
|
|
879
845
|
Card Heading
|
|
880
846
|
</CardHeading>
|
|
881
847
|
<CardContent>
|
|
@@ -886,11 +852,11 @@ must be set to `true`.
|
|
|
886
852
|
<Card
|
|
887
853
|
imageProps={{
|
|
888
854
|
alt: "Alt text",
|
|
889
|
-
aspectRatio:
|
|
855
|
+
aspectRatio: "twoByOne",
|
|
890
856
|
src: "https://placeimg.com/430/230/animals",
|
|
891
857
|
}}
|
|
892
858
|
>
|
|
893
|
-
<CardHeading level=
|
|
859
|
+
<CardHeading level="three" id="grid4-heading1">
|
|
894
860
|
Card Heading
|
|
895
861
|
</CardHeading>
|
|
896
862
|
<CardContent>
|
|
@@ -901,11 +867,11 @@ must be set to `true`.
|
|
|
901
867
|
<Card
|
|
902
868
|
imageProps={{
|
|
903
869
|
alt: "Alt text",
|
|
904
|
-
aspectRatio:
|
|
870
|
+
aspectRatio: "twoByOne",
|
|
905
871
|
src: "https://placeimg.com/440/200/animals",
|
|
906
872
|
}}
|
|
907
873
|
>
|
|
908
|
-
<CardHeading level=
|
|
874
|
+
<CardHeading level="three" id="grid5-heading1">
|
|
909
875
|
Card Heading
|
|
910
876
|
</CardHeading>
|
|
911
877
|
<CardContent>
|
|
@@ -916,11 +882,11 @@ must be set to `true`.
|
|
|
916
882
|
<Card
|
|
917
883
|
imageProps={{
|
|
918
884
|
alt: "Alt text",
|
|
919
|
-
aspectRatio:
|
|
885
|
+
aspectRatio: "twoByOne",
|
|
920
886
|
src: "https://placeimg.com/450/200/animals",
|
|
921
887
|
}}
|
|
922
888
|
>
|
|
923
|
-
<CardHeading level=
|
|
889
|
+
<CardHeading level="three" id="grid6-heading1">
|
|
924
890
|
Card Heading
|
|
925
891
|
</CardHeading>
|
|
926
892
|
<CardContent>
|
|
@@ -940,13 +906,13 @@ must be set to `true`.
|
|
|
940
906
|
<Card
|
|
941
907
|
imageProps={{
|
|
942
908
|
alt: "Alt text",
|
|
943
|
-
aspectRatio:
|
|
909
|
+
aspectRatio: "twoByOne",
|
|
944
910
|
src: "https://placeimg.com/400/200/animals",
|
|
945
911
|
}}
|
|
946
912
|
isCentered
|
|
947
|
-
layout=
|
|
913
|
+
layout="row"
|
|
948
914
|
>
|
|
949
|
-
<CardHeading level=
|
|
915
|
+
<CardHeading level="four" id="stack1-heading1">
|
|
950
916
|
Card Heading
|
|
951
917
|
</CardHeading>
|
|
952
918
|
<CardContent>
|
|
@@ -958,13 +924,13 @@ must be set to `true`.
|
|
|
958
924
|
<Card
|
|
959
925
|
imageProps={{
|
|
960
926
|
alt: "Alt text",
|
|
961
|
-
aspectRatio:
|
|
927
|
+
aspectRatio: "twoByOne",
|
|
962
928
|
src: "https://placeimg.com/410/210/animals",
|
|
963
929
|
}}
|
|
964
930
|
isCentered
|
|
965
|
-
layout=
|
|
931
|
+
layout="row"
|
|
966
932
|
>
|
|
967
|
-
<CardHeading level=
|
|
933
|
+
<CardHeading level="four" id="stack2-heading2">
|
|
968
934
|
Card Heading
|
|
969
935
|
</CardHeading>
|
|
970
936
|
<CardContent>
|
|
@@ -976,13 +942,13 @@ must be set to `true`.
|
|
|
976
942
|
<Card
|
|
977
943
|
imageProps={{
|
|
978
944
|
alt: "Alt text",
|
|
979
|
-
aspectRatio:
|
|
945
|
+
aspectRatio: "twoByOne",
|
|
980
946
|
src: "https://placeimg.com/420/220/animals",
|
|
981
947
|
}}
|
|
982
948
|
isCentered
|
|
983
|
-
layout=
|
|
949
|
+
layout="row"
|
|
984
950
|
>
|
|
985
|
-
<CardHeading level=
|
|
951
|
+
<CardHeading level="four" id="stack3-heading3">
|
|
986
952
|
Card Heading
|
|
987
953
|
</CardHeading>
|
|
988
954
|
<CardContent>
|
|
@@ -1001,7 +967,7 @@ must be set to `true`.
|
|
|
1001
967
|
<Story name="Cards Without Images">
|
|
1002
968
|
<SimpleGrid columns={3}>
|
|
1003
969
|
<Card isBordered>
|
|
1004
|
-
<CardHeading level=
|
|
970
|
+
<CardHeading level="three" id="no-img1-heading1">
|
|
1005
971
|
Card Heading
|
|
1006
972
|
</CardHeading>
|
|
1007
973
|
<CardContent>
|
|
@@ -1011,7 +977,7 @@ must be set to `true`.
|
|
|
1011
977
|
</CardContent>
|
|
1012
978
|
</Card>
|
|
1013
979
|
<Card isBordered>
|
|
1014
|
-
<CardHeading level=
|
|
980
|
+
<CardHeading level="three" id="no-img2-heading1">
|
|
1015
981
|
Card Heading
|
|
1016
982
|
</CardHeading>
|
|
1017
983
|
<CardContent>
|
|
@@ -1021,7 +987,7 @@ must be set to `true`.
|
|
|
1021
987
|
</CardContent>
|
|
1022
988
|
</Card>
|
|
1023
989
|
<Card isBordered>
|
|
1024
|
-
<CardHeading level=
|
|
990
|
+
<CardHeading level="three" id="no-img3-heading1">
|
|
1025
991
|
Card Heading
|
|
1026
992
|
</CardHeading>
|
|
1027
993
|
<CardContent>
|
|
@@ -1033,8 +999,8 @@ must be set to `true`.
|
|
|
1033
999
|
</SimpleGrid>
|
|
1034
1000
|
<br />
|
|
1035
1001
|
<SimpleGrid columns={1}>
|
|
1036
|
-
<Card layout=
|
|
1037
|
-
<CardHeading level=
|
|
1002
|
+
<Card layout="row" isBordered>
|
|
1003
|
+
<CardHeading level="three" id="no-img4-heading1">
|
|
1038
1004
|
Card Heading
|
|
1039
1005
|
</CardHeading>
|
|
1040
1006
|
<CardContent>
|
|
@@ -1046,8 +1012,8 @@ must be set to `true`.
|
|
|
1046
1012
|
eget metus.
|
|
1047
1013
|
</CardContent>
|
|
1048
1014
|
</Card>
|
|
1049
|
-
<Card layout=
|
|
1050
|
-
<CardHeading level=
|
|
1015
|
+
<Card layout="row" isBordered>
|
|
1016
|
+
<CardHeading level="three" id="no-img5-heading1">
|
|
1051
1017
|
Card Heading
|
|
1052
1018
|
</CardHeading>
|
|
1053
1019
|
<CardContent>
|
|
@@ -1059,8 +1025,8 @@ must be set to `true`.
|
|
|
1059
1025
|
eget metus.
|
|
1060
1026
|
</CardContent>
|
|
1061
1027
|
</Card>
|
|
1062
|
-
<Card layout=
|
|
1063
|
-
<CardHeading level=
|
|
1028
|
+
<Card layout="row" isBordered>
|
|
1029
|
+
<CardHeading level="three" id="no-img6-heading1">
|
|
1064
1030
|
Card Heading
|
|
1065
1031
|
</CardHeading>
|
|
1066
1032
|
<CardContent>
|