@nypl/design-system-react-components 0.25.12 → 0.25.13

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.
Files changed (194) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/dist/components/Accordion/Accordion.d.ts +5 -3
  3. package/dist/components/Accordion/AccordionTypes.d.ts +5 -0
  4. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  5. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
  6. package/dist/components/Card/Card.d.ts +11 -20
  7. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  8. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +4 -2
  9. package/dist/components/Heading/Heading.d.ts +4 -4
  10. package/dist/components/Heading/HeadingTypes.d.ts +1 -1
  11. package/dist/components/Hero/Hero.d.ts +7 -4
  12. package/dist/components/Icons/IconTypes.d.ts +1 -0
  13. package/dist/components/Image/Image.d.ts +25 -7
  14. package/dist/components/Image/ImageTypes.d.ts +4 -4
  15. package/dist/components/Logo/LogoTypes.d.ts +2 -2
  16. package/dist/components/Notification/Notification.d.ts +4 -4
  17. package/dist/components/Radio/Radio.d.ts +1 -1
  18. package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
  19. package/dist/components/Select/Select.d.ts +2 -2
  20. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -3
  21. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -4
  22. package/dist/components/StructuredContent/StructuredContent.d.ts +9 -22
  23. package/dist/components/Tabs/Tabs.d.ts +3 -3
  24. package/dist/components/Template/Template.d.ts +13 -5
  25. package/dist/components/Text/Text.d.ts +3 -3
  26. package/dist/components/Text/TextTypes.d.ts +1 -1
  27. package/dist/components/TextInput/TextInput.d.ts +2 -2
  28. package/dist/components/Toggle/Toggle.d.ts +6 -7
  29. package/dist/components/Toggle/{ToggleSizes.d.ts → ToggleTypes.d.ts} +1 -1
  30. package/dist/design-system-react-components.cjs.development.js +505 -422
  31. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  32. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  33. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  34. package/dist/design-system-react-components.esm.js +514 -435
  35. package/dist/design-system-react-components.esm.js.map +1 -1
  36. package/dist/helpers/enums.d.ts +4 -0
  37. package/dist/index.d.ts +7 -8
  38. package/dist/theme/components/accordion.d.ts +7 -12
  39. package/dist/theme/components/breadcrumb.d.ts +3 -0
  40. package/dist/theme/components/card.d.ts +4 -4
  41. package/dist/theme/components/checkbox.d.ts +1 -0
  42. package/dist/theme/components/checkboxGroup.d.ts +3 -1
  43. package/dist/theme/components/global.d.ts +2 -1
  44. package/dist/theme/components/hero.d.ts +1 -1
  45. package/dist/theme/components/image.d.ts +1 -1
  46. package/dist/theme/components/notification.d.ts +4 -4
  47. package/dist/theme/components/pagination.d.ts +2 -5
  48. package/dist/theme/components/radio.d.ts +1 -0
  49. package/dist/theme/components/radioGroup.d.ts +3 -1
  50. package/dist/theme/components/select.d.ts +3 -0
  51. package/dist/theme/components/toggle.d.ts +13 -1
  52. package/package.json +1 -1
  53. package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +34 -0
  54. package/src/components/Accordion/Accordion.stories.mdx +150 -66
  55. package/src/components/Accordion/Accordion.test.tsx +44 -17
  56. package/src/components/Accordion/Accordion.tsx +50 -20
  57. package/src/components/Accordion/AccordionTypes.tsx +5 -0
  58. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +244 -2
  59. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +17 -15
  60. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +6 -6
  61. package/src/components/Breadcrumbs/Breadcrumbs.tsx +6 -6
  62. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -1
  63. package/src/components/Card/Card.stories.mdx +236 -165
  64. package/src/components/Card/Card.test.tsx +36 -18
  65. package/src/components/Card/Card.tsx +84 -59
  66. package/src/components/Card/__snapshots__/Card.test.tsx.snap +25 -65
  67. package/src/components/Chakra/Center.stories.mdx +2 -2
  68. package/src/components/Checkbox/Checkbox.stories.mdx +13 -1
  69. package/src/components/Checkbox/Checkbox.test.tsx +58 -2
  70. package/src/components/Checkbox/Checkbox.tsx +6 -1
  71. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +76 -0
  72. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +73 -9
  73. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +79 -9
  74. package/src/components/CheckboxGroup/CheckboxGroup.tsx +10 -7
  75. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +169 -0
  76. package/src/components/ComponentWrapper/ComponentWrapper.tsx +1 -1
  77. package/src/components/DatePicker/DatePicker.test.tsx +5 -2
  78. package/src/components/DatePicker/DatePicker.tsx +5 -2
  79. package/src/components/Form/Form.stories.mdx +47 -9
  80. package/src/components/Form/Form.test.tsx +1 -1
  81. package/src/components/Form/Form.tsx +3 -1
  82. package/src/components/Grid/SimpleGrid.stories.mdx +53 -35
  83. package/src/components/Grid/SimpleGrid.test.tsx +15 -9
  84. package/src/components/Heading/Heading.stories.mdx +21 -23
  85. package/src/components/Heading/Heading.test.tsx +7 -7
  86. package/src/components/Heading/Heading.tsx +10 -14
  87. package/src/components/Heading/HeadingTypes.tsx +1 -1
  88. package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +1 -1
  89. package/src/components/Hero/Hero.stories.mdx +27 -27
  90. package/src/components/Hero/Hero.test.tsx +113 -58
  91. package/src/components/Hero/Hero.tsx +43 -20
  92. package/src/components/HorizontalRule/HorizontalRule.test.tsx +6 -4
  93. package/src/components/HorizontalRule/HorizontalRule.tsx +3 -2
  94. package/src/components/Icons/Icon.stories.mdx +50 -18
  95. package/src/components/Icons/Icon.test.tsx +13 -2
  96. package/src/components/Icons/Icon.tsx +11 -6
  97. package/src/components/Icons/IconTypes.tsx +1 -0
  98. package/src/components/Image/Image.stories.mdx +133 -68
  99. package/src/components/Image/Image.test.tsx +32 -48
  100. package/src/components/Image/Image.tsx +46 -26
  101. package/src/components/Image/ImageTypes.ts +4 -4
  102. package/src/components/Image/__snapshots__/Image.test.tsx.snap +60 -13
  103. package/src/components/Link/Link.tsx +8 -1
  104. package/src/components/List/List.stories.mdx +1 -1
  105. package/src/components/List/List.test.tsx +7 -4
  106. package/src/components/List/List.tsx +7 -4
  107. package/src/components/Logo/Logo.stories.mdx +13 -13
  108. package/src/components/Logo/Logo.test.tsx +12 -2
  109. package/src/components/Logo/Logo.tsx +10 -5
  110. package/src/components/Logo/LogoTypes.tsx +1 -1
  111. package/src/components/Notification/Notification.stories.mdx +5 -5
  112. package/src/components/Notification/Notification.tsx +10 -10
  113. package/src/components/Pagination/Pagination.stories.mdx +4 -3
  114. package/src/components/Pagination/Pagination.test.tsx +30 -2
  115. package/src/components/Pagination/Pagination.tsx +6 -3
  116. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +1 -1
  117. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +6 -2
  118. package/src/components/ProgressIndicator/ProgressIndicator.tsx +3 -1
  119. package/src/components/Radio/Radio.stories.mdx +13 -1
  120. package/src/components/Radio/Radio.test.tsx +56 -2
  121. package/src/components/Radio/Radio.tsx +6 -1
  122. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +61 -0
  123. package/src/components/RadioGroup/RadioGroup.stories.mdx +73 -9
  124. package/src/components/RadioGroup/RadioGroup.test.tsx +72 -7
  125. package/src/components/RadioGroup/RadioGroup.tsx +10 -7
  126. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +140 -0
  127. package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
  128. package/src/components/SearchBar/SearchBar.tsx +3 -3
  129. package/src/components/Select/Select.stories.mdx +26 -16
  130. package/src/components/Select/Select.test.tsx +1 -36
  131. package/src/components/Select/Select.tsx +4 -16
  132. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +12 -14
  133. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +6 -8
  134. package/src/components/SkeletonLoader/SkeletonLoader.tsx +5 -7
  135. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
  136. package/src/components/Slider/Slider.stories.mdx +41 -8
  137. package/src/components/Slider/Slider.tsx +4 -4
  138. package/src/components/StatusBadge/StatusBadge.test.tsx +3 -1
  139. package/src/components/StatusBadge/StatusBadge.tsx +1 -1
  140. package/src/components/StructuredContent/StructuredContent.stories.mdx +103 -54
  141. package/src/components/StructuredContent/StructuredContent.test.tsx +129 -102
  142. package/src/components/StructuredContent/StructuredContent.tsx +43 -53
  143. package/src/components/StyleGuide/ColorCard.tsx +3 -3
  144. package/src/components/StyleGuide/Typography.stories.mdx +17 -12
  145. package/src/components/Table/Table.test.tsx +1 -1
  146. package/src/components/Table/Table.tsx +3 -1
  147. package/src/components/Tabs/Tabs.stories.mdx +8 -8
  148. package/src/components/Tabs/Tabs.test.tsx +13 -11
  149. package/src/components/Tabs/Tabs.tsx +18 -15
  150. package/src/components/Template/Template.stories.mdx +62 -25
  151. package/src/components/Template/Template.test.tsx +35 -5
  152. package/src/components/Template/Template.tsx +26 -13
  153. package/src/components/Template/__snapshots__/Template.test.tsx.snap +4 -2
  154. package/src/components/Text/Text.stories.mdx +13 -15
  155. package/src/components/Text/Text.test.tsx +6 -15
  156. package/src/components/Text/Text.tsx +7 -12
  157. package/src/components/Text/TextTypes.tsx +1 -1
  158. package/src/components/TextInput/TextInput.stories.mdx +9 -9
  159. package/src/components/TextInput/TextInput.test.tsx +28 -27
  160. package/src/components/TextInput/TextInput.tsx +4 -4
  161. package/src/components/Toggle/Toggle.stories.mdx +12 -22
  162. package/src/components/Toggle/Toggle.test.tsx +15 -2
  163. package/src/components/Toggle/Toggle.tsx +8 -9
  164. package/src/components/Toggle/{ToggleSizes.tsx → ToggleTypes.tsx} +1 -1
  165. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +64 -0
  166. package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -6
  167. package/src/components/VideoPlayer/VideoPlayer.tsx +14 -7
  168. package/src/docs/{Intro.stories.mdx → Welcome.stories.mdx} +5 -9
  169. package/src/{components/Card/CardTypes.tsx → helpers/enums.ts} +2 -2
  170. package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
  171. package/src/hooks/useCarouselStyles.stories.mdx +10 -0
  172. package/src/hooks/useNYPLTheme.ts +1 -1
  173. package/src/index.ts +7 -14
  174. package/src/theme/components/accordion.ts +7 -12
  175. package/src/theme/components/breadcrumb.ts +3 -0
  176. package/src/theme/components/card.ts +29 -20
  177. package/src/theme/components/checkboxGroup.ts +3 -1
  178. package/src/theme/components/global.ts +4 -3
  179. package/src/theme/components/hero.ts +1 -1
  180. package/src/theme/components/icon.ts +5 -2
  181. package/src/theme/components/image.ts +1 -1
  182. package/src/theme/components/list.ts +1 -1
  183. package/src/theme/components/notification.ts +5 -5
  184. package/src/theme/components/pagination.ts +2 -5
  185. package/src/theme/components/progressIndicator.ts +3 -3
  186. package/src/theme/components/radioGroup.ts +3 -1
  187. package/src/theme/components/select.ts +6 -0
  188. package/src/theme/components/toggle.ts +26 -3
  189. package/src/utils/componentCategories.ts +27 -19
  190. package/dist/components/Card/CardTypes.d.ts +0 -4
  191. package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +0 -4
  192. package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +0 -4
  193. package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +0 -4
  194. package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +0 -4
@@ -11,9 +11,8 @@ import { withDesign } from "storybook-addon-designs";
11
11
  import Button from "../Button/Button";
12
12
  import { ButtonTypes } from "../Button/ButtonTypes";
13
13
  import Card, { CardHeading, CardContent, CardActions } from "./Card";
14
- import { CardLayouts } from "./CardTypes";
15
14
  import Heading from "../Heading/Heading";
16
- import { HeadingDisplaySizes, HeadingLevels } from "../Heading/HeadingTypes";
15
+ import { HeadingSizes, HeadingLevels } from "../Heading/HeadingTypes";
17
16
  import HorizontalRule from "../HorizontalRule/HorizontalRule";
18
17
  import Icon from "../Icons/Icon";
19
18
  import Image from "../Image/Image";
@@ -21,6 +20,7 @@ import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
21
20
  import Link from "../Link/Link";
22
21
  import { LinkTypes } from "../Link/LinkTypes";
23
22
  import SimpleGrid from "../Grid/SimpleGrid";
23
+ import { LayoutTypes } from "../../helpers/enums";
24
24
  import { getCategory } from "../../utils/componentCategories";
25
25
  import DSProvider from "../../theme/provider";
26
26
  import { getStorybookEnumValues } from "../../utils/utils";
@@ -33,9 +33,9 @@ export const imageSizesEnumValues = getStorybookEnumValues(
33
33
  ImageSizes,
34
34
  "ImageSizes"
35
35
  );
36
- export const cardLayoutsEnumValues = getStorybookEnumValues(
37
- CardLayouts,
38
- "CardLayouts"
36
+ export const LayoutTypesEnumValues = getStorybookEnumValues(
37
+ LayoutTypes,
38
+ "LayoutTypes"
39
39
  );
40
40
 
41
41
  <Meta
@@ -54,36 +54,40 @@ export const cardLayoutsEnumValues = getStorybookEnumValues(
54
54
  border: {
55
55
  table: { defaultValue: { summary: false } },
56
56
  },
57
- center: {
58
- table: { defaultValue: { summary: false } },
59
- },
60
57
  className: { control: false },
61
58
  foregroundColor: { control: { type: "color" } },
62
59
  id: { control: false },
63
- imageAlt: {
60
+ imageProps: { disable: true },
61
+ "imageProps.alt": {
62
+ control: { type: "text" },
64
63
  table: { defaultValue: { summary: "" } },
65
64
  },
66
- imageAspectRatio: {
65
+ "imageProps.aspectRatio": {
67
66
  control: { type: "select" },
68
67
  table: { defaultValue: { summary: "ImageRatios.Square" } },
69
68
  options: imageRatiosEnumValues.options,
70
69
  },
71
- imageAtEnd: {
70
+ "imageProps.caption": { control: false },
71
+ "imageProps.component": { control: false },
72
+ "imageProps.credit": { control: false },
73
+ "imageProps.isAtEnd": {
72
74
  table: { defaultValue: { summary: false } },
73
75
  },
74
- imageComponent: { control: false },
75
- imageSize: {
76
+ "imageProps.size": {
76
77
  control: { type: "select" },
77
78
  table: { defaultValue: { summary: "ImageSizes.Default" } },
78
79
  options: imageSizesEnumValues.options,
79
80
  },
80
- imageSrc: {
81
+ "imageProps.src": {
81
82
  table: { defaultValue: { summary: "" } },
82
83
  },
84
+ isCentered: {
85
+ table: { defaultValue: { summary: false } },
86
+ },
83
87
  layout: {
84
88
  control: { type: "radio" },
85
- table: { defaultValue: { summary: "CardLayouts.Column" } },
86
- options: cardLayoutsEnumValues.options,
89
+ table: { defaultValue: { summary: "LayoutTypes.Column" } },
90
+ options: LayoutTypesEnumValues.options,
87
91
  },
88
92
  }}
89
93
  />
@@ -93,7 +97,7 @@ export const cardLayoutsEnumValues = getStorybookEnumValues(
93
97
  | Component Version | DS Version |
94
98
  | ----------------- | ---------- |
95
99
  | Added | `0.24.0` |
96
- | Latest | `0.25.10` |
100
+ | Latest | `0.25.13` |
97
101
 
98
102
  <Description of={Card} />
99
103
 
@@ -127,26 +131,34 @@ headings and CTAs.
127
131
  args={{
128
132
  backgroundColor: undefined,
129
133
  border: false,
130
- center: false,
131
134
  className: undefined,
132
135
  foregroundColor: undefined,
133
136
  id: "card-id",
134
- imageAlt: "Alt text",
135
- imageAspectRatio: "ImageRatios.Square",
136
- imageAtEnd: false,
137
- imageComponent: undefined,
138
- imageSize: "ImageSizes.Default",
139
- imageSrc: "https://placeimg.com/400/300/animals",
140
- layout: "CardLayouts.Row",
137
+ "imageProps.alt": "Alt text",
138
+ "imageProps.aspectRatio": "ImageRatios.Square",
139
+ "imageProps.component": undefined,
140
+ "imageProps.isAtEnd": false,
141
+ "imageProps.size": "ImageSizes.Default",
142
+ "imageProps.src": "https://placeimg.com/400/300/animals",
143
+ isCentered: false,
144
+ layout: "LayoutTypes.Row",
141
145
  mainActionLink: undefined,
142
146
  }}
143
147
  >
144
148
  {(args) => (
145
149
  <Card
146
150
  {...args}
147
- imageAspectRatio={imageRatiosEnumValues.getValue(args.imageAspectRatio)}
148
- imageSize={imageSizesEnumValues.getValue(args.imageSize)}
149
- layout={cardLayoutsEnumValues.getValue(args.layout)}
151
+ imageProps={{
152
+ alt: args["imageProps.alt"],
153
+ aspectRatio: imageRatiosEnumValues.getValue(
154
+ args["imageProps.aspectRatio"]
155
+ ),
156
+ component: args["imageProps.component"],
157
+ isAtEnd: args["imageProps.isAtEnd"],
158
+ size: imageSizesEnumValues.getValue(args["imageProps.size"]),
159
+ src: args["imageProps.src"],
160
+ }}
161
+ layout={LayoutTypesEnumValues.getValue(args.layout)}
150
162
  >
151
163
  <CardHeading level={HeadingLevels.Two} id="main-heading1">
152
164
  Optional Header
@@ -192,7 +204,7 @@ headings and CTAs.
192
204
 
193
205
  By default, the image is always the first element within a `Card`. This means
194
206
  the image is at the top of a `Card` with a column layout and on the left side of
195
- a `Card` with a row layout. However, you can use the `imageAtEnd` boolean prop
207
+ a `Card` with a row layout. However, you can use the `imageProps.isAtEnd` boolean prop
196
208
  to override the default placement and move the image to the last element within
197
209
  a `Card`.
198
210
 
@@ -202,9 +214,11 @@ a `Card`.
202
214
  <Story name="Card Image Position">
203
215
  <SimpleGrid columns={2}>
204
216
  <Card
205
- imageAlt="Alt text"
206
- imageAspectRatio={ImageRatios.TwoByOne}
207
- imageSrc="https://placeimg.com/400/200/animals"
217
+ imageProps={{
218
+ alt: "Alt text",
219
+ aspectRatio: ImageRatios.TwoByOne,
220
+ src: "https://placeimg.com/400/200/animals",
221
+ }}
208
222
  >
209
223
  <CardHeading level={HeadingLevels.Three} id="props-heading1">
210
224
  Image on Top (default)
@@ -215,10 +229,12 @@ a `Card`.
215
229
  </CardContent>
216
230
  </Card>
217
231
  <Card
218
- imageAlt="Alt text"
219
- imageAspectRatio={ImageRatios.TwoByOne}
220
- imageAtEnd
221
- imageSrc="https://placeimg.com/410/210/animals"
232
+ imageProps={{
233
+ alt: "Alt text",
234
+ aspectRatio: ImageRatios.TwoByOne,
235
+ isAtEnd: true,
236
+ src: "https://placeimg.com/400/200/animals",
237
+ }}
222
238
  >
223
239
  <CardHeading level={HeadingLevels.Three} id="props-heading2">
224
240
  Image on Bottom
@@ -238,11 +254,13 @@ a `Card`.
238
254
  <DSProvider>
239
255
  <SimpleGrid columns={1}>
240
256
  <Card
241
- center
242
- imageAlt="Alt text"
243
- imageAspectRatio={ImageRatios.TwoByOne}
244
- imageSrc="https://placeimg.com/400/200/animals"
245
- layout={CardLayouts.Row}
257
+ imageProps={{
258
+ alt: "Alt text",
259
+ aspectRatio: ImageRatios.TwoByOne,
260
+ src: "https://placeimg.com/400/200/animals",
261
+ }}
262
+ isCentered
263
+ layout={LayoutTypes.Row}
246
264
  >
247
265
  <CardHeading level={HeadingLevels.Four} id="row-heading1">
248
266
  Image on Left (default)
@@ -254,12 +272,14 @@ a `Card`.
254
272
  </CardContent>
255
273
  </Card>
256
274
  <Card
257
- center
258
- imageAlt="Alt text"
259
- imageAspectRatio={ImageRatios.TwoByOne}
260
- imageAtEnd
261
- imageSrc="https://placeimg.com/410/210/animals"
262
- layout={CardLayouts.Row}
275
+ imageProps={{
276
+ alt: "Alt text",
277
+ aspectRatio: ImageRatios.TwoByOne,
278
+ isAtEnd: true,
279
+ src: "https://placeimg.com/400/200/animals",
280
+ }}
281
+ isCentered
282
+ layout={LayoutTypes.Row}
263
283
  >
264
284
  <CardHeading level={HeadingLevels.Four} id="row-heading2">
265
285
  Image on Right
@@ -277,7 +297,7 @@ a `Card`.
277
297
  ## Image Size
278
298
 
279
299
  By default, the image width is `100%` for a `Card` with a column layout and
280
- `225px` for a `Card` with a row layout. However, you can use the `imageSize`
300
+ `225px` for a `Card` with a row layout. However, you can use the `imageProps.size`
281
301
  prop to override the default width.
282
302
 
283
303
  ### Column Cards
@@ -286,11 +306,13 @@ prop to override the default width.
286
306
  <Story name="Card Image Size">
287
307
  <SimpleGrid columns={1}>
288
308
  <Card
289
- center
290
- imageAlt="Alt text"
291
- imageAspectRatio={ImageRatios.Square}
292
- imageSize={ImageSizes.ExtraExtraSmall}
293
- imageSrc="https://placeimg.com/400/200/animals"
309
+ imageProps={{
310
+ alt: "Alt text",
311
+ aspectRatio: ImageRatios.Square,
312
+ size: ImageSizes.ExtraExtraSmall,
313
+ src: "https://placeimg.com/400/200/animals",
314
+ }}
315
+ isCentered
294
316
  >
295
317
  <CardHeading level={HeadingLevels.Three} id="column-heading1">
296
318
  Extra Extra Small Image
@@ -305,11 +327,13 @@ prop to override the default width.
305
327
  </Card>
306
328
  <HorizontalRule />
307
329
  <Card
308
- center
309
- imageAlt="Alt text"
310
- imageAspectRatio={ImageRatios.Square}
311
- imageSize={ImageSizes.ExtraSmall}
312
- imageSrc="https://placeimg.com/400/200/animals"
330
+ imageProps={{
331
+ alt: "Alt text",
332
+ aspectRatio: ImageRatios.Square,
333
+ size: ImageSizes.ExtraSmall,
334
+ src: "https://placeimg.com/400/200/animals",
335
+ }}
336
+ isCentered
313
337
  >
314
338
  <CardHeading level={HeadingLevels.Three} id="column-heading1">
315
339
  Extra Small Image
@@ -324,11 +348,13 @@ prop to override the default width.
324
348
  </Card>
325
349
  <HorizontalRule />
326
350
  <Card
327
- center
328
- imageAlt="Alt text"
329
- imageAspectRatio={ImageRatios.Square}
330
- imageSize={ImageSizes.Small}
331
- imageSrc="https://placeimg.com/400/200/animals"
351
+ imageProps={{
352
+ alt: "Alt text",
353
+ aspectRatio: ImageRatios.Square,
354
+ size: ImageSizes.Small,
355
+ src: "https://placeimg.com/400/200/animals",
356
+ }}
357
+ isCentered
332
358
  >
333
359
  <CardHeading level={HeadingLevels.Three} id="column-heading1">
334
360
  Small Image
@@ -343,11 +369,13 @@ prop to override the default width.
343
369
  </Card>
344
370
  <HorizontalRule />
345
371
  <Card
346
- center
347
- imageAlt="Alt text"
348
- imageAspectRatio={ImageRatios.Square}
349
- imageSize={ImageSizes.Medium}
350
- imageSrc="https://placeimg.com/400/200/animals"
372
+ imageProps={{
373
+ alt: "Alt text",
374
+ aspectRatio: ImageRatios.Square,
375
+ size: ImageSizes.Medium,
376
+ src: "https://placeimg.com/400/200/animals",
377
+ }}
378
+ isCentered
351
379
  >
352
380
  <CardHeading level={HeadingLevels.Three} id="column2-heading1">
353
381
  Medium Image
@@ -362,11 +390,13 @@ prop to override the default width.
362
390
  </Card>
363
391
  <HorizontalRule />
364
392
  <Card
365
- center
366
- imageAlt="Alt text"
367
- imageAspectRatio={ImageRatios.Square}
368
- imageSize={ImageSizes.Large}
369
- imageSrc="https://placeimg.com/410/210/animals"
393
+ imageProps={{
394
+ alt: "Alt text",
395
+ aspectRatio: ImageRatios.Square,
396
+ size: ImageSizes.Large,
397
+ src: "https://placeimg.com/400/200/animals",
398
+ }}
399
+ isCentered
370
400
  >
371
401
  <CardHeading level={HeadingLevels.Three} id="column3-heading1">
372
402
  Large Image
@@ -381,10 +411,12 @@ prop to override the default width.
381
411
  </Card>
382
412
  <HorizontalRule />
383
413
  <Card
384
- center
385
- imageAlt="Alt text"
386
- imageAspectRatio={ImageRatios.Square}
387
- imageSrc="https://placeimg.com/410/210/animals"
414
+ imageProps={{
415
+ alt: "Alt text",
416
+ aspectRatio: ImageRatios.Square,
417
+ src: "https://placeimg.com/400/200/animals",
418
+ }}
419
+ isCentered
388
420
  >
389
421
  <CardHeading level={HeadingLevels.Three} id="column-4heading1">
390
422
  Default Image
@@ -407,12 +439,14 @@ prop to override the default width.
407
439
  <DSProvider>
408
440
  <SimpleGrid columns={1}>
409
441
  <Card
410
- center
411
- imageAlt="Alt text"
412
- imageAspectRatio={ImageRatios.TwoByOne}
413
- imageSize={ImageSizes.ExtraExtraSmall}
414
- imageSrc="https://placeimg.com/400/200/animals"
415
- layout={CardLayouts.Row}
442
+ imageProps={{
443
+ alt: "Alt text",
444
+ aspectRatio: ImageRatios.TwoByOne,
445
+ size: ImageSizes.ExtraExtraSmall,
446
+ src: "https://placeimg.com/400/200/animals",
447
+ }}
448
+ isCentered
449
+ layout={LayoutTypes.Row}
416
450
  >
417
451
  <CardHeading level={HeadingLevels.Three} id="row2-heading1">
418
452
  Extra Extra Small Image
@@ -425,12 +459,14 @@ prop to override the default width.
425
459
  </CardContent>
426
460
  </Card>
427
461
  <Card
428
- center
429
- imageAlt="Alt text"
430
- imageAspectRatio={ImageRatios.TwoByOne}
431
- imageSize={ImageSizes.ExtraSmall}
432
- imageSrc="https://placeimg.com/400/200/animals"
433
- layout={CardLayouts.Row}
462
+ imageProps={{
463
+ alt: "Alt text",
464
+ aspectRatio: ImageRatios.TwoByOne,
465
+ size: ImageSizes.ExtraSmall,
466
+ src: "https://placeimg.com/400/200/animals",
467
+ }}
468
+ isCentered
469
+ layout={LayoutTypes.Row}
434
470
  >
435
471
  <CardHeading level={HeadingLevels.Three} id="row2-heading1">
436
472
  Extra Small Image
@@ -443,12 +479,14 @@ prop to override the default width.
443
479
  </CardContent>
444
480
  </Card>
445
481
  <Card
446
- center
447
- imageAlt="Alt text"
448
- imageAspectRatio={ImageRatios.TwoByOne}
449
- imageSize={ImageSizes.Small}
450
- imageSrc="https://placeimg.com/400/200/animals"
451
- layout={CardLayouts.Row}
482
+ imageProps={{
483
+ alt: "Alt text",
484
+ aspectRatio: ImageRatios.TwoByOne,
485
+ size: ImageSizes.Small,
486
+ src: "https://placeimg.com/400/200/animals",
487
+ }}
488
+ isCentered
489
+ layout={LayoutTypes.Row}
452
490
  >
453
491
  <CardHeading level={HeadingLevels.Three} id="row2-heading1">
454
492
  Small Image
@@ -461,12 +499,14 @@ prop to override the default width.
461
499
  </CardContent>
462
500
  </Card>
463
501
  <Card
464
- center
465
- imageAlt="Alt text"
466
- imageAspectRatio={ImageRatios.TwoByOne}
467
- imageSize={ImageSizes.Medium}
468
- imageSrc="https://placeimg.com/410/210/animals"
469
- layout={CardLayouts.Row}
502
+ imageProps={{
503
+ alt: "Alt text",
504
+ aspectRatio: ImageRatios.TwoByOne,
505
+ size: ImageSizes.Medium,
506
+ src: "https://placeimg.com/400/200/animals",
507
+ }}
508
+ isCentered
509
+ layout={LayoutTypes.Row}
470
510
  >
471
511
  <CardHeading level={HeadingLevels.Three} id="row3-heading2">
472
512
  Medium Image
@@ -480,12 +520,14 @@ prop to override the default width.
480
520
  </CardContent>
481
521
  </Card>
482
522
  <Card
483
- center
484
- imageAlt="Alt text"
485
- imageAspectRatio={ImageRatios.TwoByOne}
486
- imageSize={ImageSizes.Large}
487
- imageSrc="https://placeimg.com/400/250/animals"
488
- layout={CardLayouts.Row}
523
+ imageProps={{
524
+ alt: "Alt text",
525
+ aspectRatio: ImageRatios.TwoByOne,
526
+ size: ImageSizes.Large,
527
+ src: "https://placeimg.com/400/200/animals",
528
+ }}
529
+ isCentered
530
+ layout={LayoutTypes.Row}
489
531
  >
490
532
  <CardHeading level={HeadingLevels.Three} id="row4-heading1">
491
533
  Large Image
@@ -500,11 +542,13 @@ prop to override the default width.
500
542
  </CardContent>
501
543
  </Card>
502
544
  <Card
503
- center
504
- imageAlt="Alt text"
505
- imageAspectRatio={ImageRatios.TwoByOne}
506
- imageSrc="https://placeimg.com/450/250/animals"
507
- layout={CardLayouts.Row}
545
+ imageProps={{
546
+ alt: "Alt text",
547
+ aspectRatio: ImageRatios.TwoByOne,
548
+ src: "https://placeimg.com/400/200/animals",
549
+ }}
550
+ isCentered
551
+ layout={LayoutTypes.Row}
508
552
  >
509
553
  <CardHeading level={HeadingLevels.Three} id="row5-heading2">
510
554
  Default Image
@@ -528,9 +572,11 @@ prop to override the default width.
528
572
  <Story name="Cards in a Grid">
529
573
  <SimpleGrid columns={3}>
530
574
  <Card
531
- imageAlt="Alt text"
532
- imageAspectRatio={ImageRatios.TwoByOne}
533
- imageSrc="https://placeimg.com/400/200/animals"
575
+ imageProps={{
576
+ alt: "Alt text",
577
+ aspectRatio: ImageRatios.TwoByOne,
578
+ src: "https://placeimg.com/400/200/animals",
579
+ }}
534
580
  >
535
581
  <CardHeading level={HeadingLevels.Three} id="grid1-heading1">
536
582
  Card Heading
@@ -541,9 +587,11 @@ prop to override the default width.
541
587
  </CardContent>
542
588
  </Card>
543
589
  <Card
544
- imageAlt="Alt text"
545
- imageAspectRatio={ImageRatios.TwoByOne}
546
- imageSrc="https://placeimg.com/410/210/animals"
590
+ imageProps={{
591
+ alt: "Alt text",
592
+ aspectRatio: ImageRatios.TwoByOne,
593
+ src: "https://placeimg.com/410/210/animals",
594
+ }}
547
595
  >
548
596
  <CardHeading level={HeadingLevels.Three} id="grid2-heading1">
549
597
  Card Heading
@@ -554,9 +602,11 @@ prop to override the default width.
554
602
  </CardContent>
555
603
  </Card>
556
604
  <Card
557
- imageAlt="Alt text"
558
- imageAspectRatio={ImageRatios.TwoByOne}
559
- imageSrc="https://placeimg.com/420/220/animals"
605
+ imageProps={{
606
+ alt: "Alt text",
607
+ aspectRatio: ImageRatios.TwoByOne,
608
+ src: "https://placeimg.com/420/220/animals",
609
+ }}
560
610
  >
561
611
  <CardHeading level={HeadingLevels.Three} id="grid3-heading1">
562
612
  Card Heading
@@ -567,9 +617,11 @@ prop to override the default width.
567
617
  </CardContent>
568
618
  </Card>
569
619
  <Card
570
- imageAlt="Alt text"
571
- imageAspectRatio={ImageRatios.TwoByOne}
572
- imageSrc="https://placeimg.com/430/230/animals"
620
+ imageProps={{
621
+ alt: "Alt text",
622
+ aspectRatio: ImageRatios.TwoByOne,
623
+ src: "https://placeimg.com/430/230/animals",
624
+ }}
573
625
  >
574
626
  <CardHeading level={HeadingLevels.Three} id="grid4-heading1">
575
627
  Card Heading
@@ -580,9 +632,11 @@ prop to override the default width.
580
632
  </CardContent>
581
633
  </Card>
582
634
  <Card
583
- imageAlt="Alt text"
584
- imageAspectRatio={ImageRatios.TwoByOne}
585
- imageSrc="https://placeimg.com/440/240/animals"
635
+ imageProps={{
636
+ alt: "Alt text",
637
+ aspectRatio: ImageRatios.TwoByOne,
638
+ src: "https://placeimg.com/440/200/animals",
639
+ }}
586
640
  >
587
641
  <CardHeading level={HeadingLevels.Three} id="grid5-heading1">
588
642
  Card Heading
@@ -593,9 +647,11 @@ prop to override the default width.
593
647
  </CardContent>
594
648
  </Card>
595
649
  <Card
596
- imageAlt="Alt text"
597
- imageAspectRatio={ImageRatios.TwoByOne}
598
- imageSrc="https://placeimg.com/450/250/animals"
650
+ imageProps={{
651
+ alt: "Alt text",
652
+ aspectRatio: ImageRatios.TwoByOne,
653
+ src: "https://placeimg.com/450/200/animals",
654
+ }}
599
655
  >
600
656
  <CardHeading level={HeadingLevels.Three} id="grid6-heading1">
601
657
  Card Heading
@@ -615,11 +671,13 @@ prop to override the default width.
615
671
  <Story name="Cards in a Stack">
616
672
  <SimpleGrid columns={1}>
617
673
  <Card
618
- center
619
- imageAlt="Alt text"
620
- imageAspectRatio={ImageRatios.TwoByOne}
621
- imageSrc="https://placeimg.com/400/200/animals"
622
- layout={CardLayouts.Row}
674
+ imageProps={{
675
+ alt: "Alt text",
676
+ aspectRatio: ImageRatios.TwoByOne,
677
+ src: "https://placeimg.com/400/200/animals",
678
+ }}
679
+ isCentered
680
+ layout={LayoutTypes.Row}
623
681
  >
624
682
  <CardHeading level={HeadingLevels.Four} id="stack1-heading1">
625
683
  Card Heading
@@ -631,11 +689,13 @@ prop to override the default width.
631
689
  </CardContent>
632
690
  </Card>
633
691
  <Card
634
- center
635
- imageAlt="Alt text"
636
- imageAspectRatio={ImageRatios.TwoByOne}
637
- imageSrc="https://placeimg.com/410/210/animals"
638
- layout={CardLayouts.Row}
692
+ imageProps={{
693
+ alt: "Alt text",
694
+ aspectRatio: ImageRatios.TwoByOne,
695
+ src: "https://placeimg.com/410/210/animals",
696
+ }}
697
+ isCentered
698
+ layout={LayoutTypes.Row}
639
699
  >
640
700
  <CardHeading level={HeadingLevels.Four} id="stack2-heading2">
641
701
  Card Heading
@@ -647,11 +707,13 @@ prop to override the default width.
647
707
  </CardContent>
648
708
  </Card>
649
709
  <Card
650
- center
651
- imageAlt="Alt text"
652
- imageAspectRatio={ImageRatios.TwoByOne}
653
- imageSrc="https://placeimg.com/420/220/animals"
654
- layout={CardLayouts.Row}
710
+ imageProps={{
711
+ alt: "Alt text",
712
+ aspectRatio: ImageRatios.TwoByOne,
713
+ src: "https://placeimg.com/420/220/animals",
714
+ }}
715
+ isCentered
716
+ layout={LayoutTypes.Row}
655
717
  >
656
718
  <CardHeading level={HeadingLevels.Four} id="stack3-heading3">
657
719
  Card Heading
@@ -668,17 +730,20 @@ prop to override the default width.
668
730
 
669
731
  ## Custom Image Component
670
732
 
671
- Instead of passing a path for the `imageSrc` prop, you can pass a custom image
672
- component in using the `imageComponent` prop.
733
+ Instead of passing a path for the `imageProps.src` prop, you can pass a custom
734
+ image component in using the `imageProps.component` prop.
673
735
 
674
736
  <Canvas withToolbar>
675
737
  <Story name="Custom Image Component">
676
738
  <Card
677
- imageAlt="Alt text"
678
- imageAspectRatio={ImageRatios.SixteenByNine}
679
- imageComponent={
680
- <Image src="https://placeimg.com/400/400/animals" alt="Alt text" />
681
- }
739
+ imageProps={{
740
+ alt: "Alt text",
741
+ aspectRatio: ImageRatios.SixteenByNine,
742
+ component: (
743
+ <Image src="https://placeimg.com/400/400/animals" alt="Alt text" />
744
+ ),
745
+ src: "https://placeimg.com/400/200/animals",
746
+ }}
682
747
  >
683
748
  <CardHeading level={HeadingLevels.Two} id="img1-heading1">
684
749
  Card Component with Custom Image Component
@@ -743,7 +808,7 @@ component in using the `imageComponent` prop.
743
808
  </SimpleGrid>
744
809
  <br />
745
810
  <SimpleGrid columns={1}>
746
- <Card layout={CardLayouts.Row} border>
811
+ <Card layout={LayoutTypes.Row} border>
747
812
  <CardHeading level={HeadingLevels.Three} id="no-img4-heading1">
748
813
  Card Heading
749
814
  </CardHeading>
@@ -756,7 +821,7 @@ component in using the `imageComponent` prop.
756
821
  eget metus.
757
822
  </CardContent>
758
823
  </Card>
759
- <Card layout={CardLayouts.Row} border>
824
+ <Card layout={LayoutTypes.Row} border>
760
825
  <CardHeading level={HeadingLevels.Three} id="no-img5-heading1">
761
826
  Card Heading
762
827
  </CardHeading>
@@ -769,7 +834,7 @@ component in using the `imageComponent` prop.
769
834
  eget metus.
770
835
  </CardContent>
771
836
  </Card>
772
- <Card layout={CardLayouts.Row} border>
837
+ <Card layout={LayoutTypes.Row} border>
773
838
  <CardHeading level={HeadingLevels.Three} id="no-img6-heading1">
774
839
  Card Heading
775
840
  </CardHeading>
@@ -796,9 +861,11 @@ see both patterns.
796
861
  <Canvas>
797
862
  <Story name="Card With Link Heading">
798
863
  <Card
799
- imageSrc="https://placeimg.com/400/200/animals"
800
- imageAlt="Alt text"
801
- imageAspectRatio={ImageRatios.TwoByOne}
864
+ imageProps={{
865
+ alt: "Alt text",
866
+ aspectRatio: ImageRatios.TwoByOne,
867
+ src: "https://placeimg.com/400/200/animals",
868
+ }}
802
869
  >
803
870
  <CardHeading
804
871
  level={HeadingLevels.Three}
@@ -844,9 +911,11 @@ from being having the full-click functionality.
844
911
  <Story name="Card With Full-Click Functionality">
845
912
  <SimpleGrid columns={2}>
846
913
  <Card
847
- imageAlt="Alt text"
848
- imageAspectRatio={ImageRatios.TwoByOne}
849
- imageSrc="https://placeimg.com/400/200/animals"
914
+ imageProps={{
915
+ alt: "Alt text",
916
+ aspectRatio: ImageRatios.TwoByOne,
917
+ src: "https://placeimg.com/400/200/animals",
918
+ }}
850
919
  mainActionLink="http://nypl.org"
851
920
  >
852
921
  <CardHeading level={HeadingLevels.Three} id="fullclick1-heading1">
@@ -870,10 +939,12 @@ from being having the full-click functionality.
870
939
  </CardActions>
871
940
  </Card>
872
941
  <Card
873
- imageAlt="Alt text"
874
- imageAspectRatio={ImageRatios.TwoByOne}
875
- imageAtEnd
876
- imageSrc="https://placeimg.com/410/210/animals"
942
+ imageProps={{
943
+ alt: "Alt text",
944
+ aspectRatio: ImageRatios.TwoByOne,
945
+ isAtEnd: true,
946
+ src: "https://placeimg.com/410/210/animals",
947
+ }}
877
948
  mainActionLink="http://nypl.org"
878
949
  >
879
950
  <CardHeading level={HeadingLevels.Three} id="fullclick2-heading1">