@nypl/design-system-react-components 0.25.2 → 0.25.6

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 (238) hide show
  1. package/CHANGELOG.md +101 -0
  2. package/README.md +47 -11
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -0
  4. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -0
  5. package/dist/components/Button/Button.d.ts +9 -8
  6. package/dist/components/Button/ButtonTypes.d.ts +2 -1
  7. package/dist/components/Card/Card.d.ts +36 -52
  8. package/dist/components/Card/CardTypes.d.ts +0 -15
  9. package/dist/components/Checkbox/Checkbox.d.ts +8 -9
  10. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +2 -2
  11. package/dist/components/DatePicker/DatePicker.d.ts +36 -36
  12. package/dist/components/Fieldset/Fieldset.d.ts +25 -0
  13. package/dist/components/HelperErrorText/HelperErrorText.d.ts +4 -0
  14. package/dist/components/HorizontalRule/HorizontalRule.d.ts +10 -3
  15. package/dist/components/Icons/Icon.d.ts +4 -0
  16. package/dist/components/Icons/IconSvgs.d.ts +11 -0
  17. package/dist/components/Icons/IconTypes.d.ts +11 -0
  18. package/dist/components/Image/Image.d.ts +19 -9
  19. package/dist/components/Image/ImageTypes.d.ts +20 -0
  20. package/dist/components/Link/Link.d.ts +4 -0
  21. package/dist/components/List/List.d.ts +7 -1
  22. package/dist/components/Notification/Notification.d.ts +6 -4
  23. package/dist/components/Pagination/Pagination.d.ts +16 -13
  24. package/dist/components/Pagination/Pagination.stories.d.ts +2 -0
  25. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +29 -0
  26. package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +8 -0
  27. package/dist/components/RadioGroup/RadioGroup.d.ts +2 -2
  28. package/dist/components/SearchBar/SearchBar.d.ts +3 -3
  29. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +18 -14
  30. package/dist/components/Slider/Slider.d.ts +57 -0
  31. package/dist/components/Tabs/Tabs.d.ts +1 -1
  32. package/dist/components/TextInput/TextInput.d.ts +10 -0
  33. package/dist/design-system-react-components.cjs.development.js +3058 -936
  34. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  35. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  36. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  37. package/dist/design-system-react-components.esm.js +3049 -921
  38. package/dist/design-system-react-components.esm.js.map +1 -1
  39. package/dist/index.d.ts +12 -6
  40. package/dist/resources.scss +180 -170
  41. package/dist/styles.css +1 -1
  42. package/dist/theme/components/breadcrumb.d.ts +9 -0
  43. package/dist/theme/components/button.d.ts +22 -8
  44. package/dist/theme/components/card.d.ts +168 -0
  45. package/dist/theme/components/checkbox.d.ts +5 -1
  46. package/dist/theme/components/checkboxGroup.d.ts +12 -0
  47. package/dist/theme/components/datePicker.d.ts +16 -0
  48. package/dist/theme/components/fieldset.d.ts +27 -0
  49. package/dist/theme/components/global.d.ts +23 -13
  50. package/dist/theme/components/globalMixins.d.ts +9 -1
  51. package/dist/theme/components/heading.d.ts +5 -0
  52. package/dist/theme/components/image.d.ts +31 -0
  53. package/dist/theme/components/label.d.ts +5 -3
  54. package/dist/theme/components/link.d.ts +4 -0
  55. package/dist/theme/components/list.d.ts +5 -1
  56. package/dist/theme/components/notification.d.ts +4 -14
  57. package/dist/theme/components/pagination.d.ts +19 -0
  58. package/dist/theme/components/progressIndicator.d.ts +50 -0
  59. package/dist/theme/components/radioGroup.d.ts +12 -0
  60. package/dist/theme/components/select.d.ts +11 -2
  61. package/dist/theme/components/skeletonLoader.d.ts +98 -0
  62. package/dist/theme/components/slider.d.ts +51 -0
  63. package/dist/theme/components/textInput.d.ts +8 -0
  64. package/dist/theme/foundations/breakpoints.d.ts +8 -8
  65. package/dist/theme/foundations/global.d.ts +6 -1
  66. package/package.json +72 -84
  67. package/src/__tests__/setup.ts +2 -2
  68. package/src/components/Accordion/Accordion.stories.mdx +39 -42
  69. package/src/components/Autosuggest/Autosuggest.stories.mdx +3 -3
  70. package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -0
  71. package/src/components/Autosuggest/_Autosuggest.scss +5 -5
  72. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +24 -8
  73. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +33 -0
  74. package/src/components/Breadcrumbs/Breadcrumbs.tsx +5 -1
  75. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -0
  76. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +298 -1
  77. package/src/components/Button/Button.stories.mdx +15 -10
  78. package/src/components/Button/Button.test.tsx +21 -7
  79. package/src/components/Button/Button.tsx +18 -33
  80. package/src/components/Button/ButtonTypes.tsx +1 -0
  81. package/src/components/Button/__snapshots__/Button.test.tsx.snap +41 -10
  82. package/src/components/Card/Card.stories.mdx +296 -259
  83. package/src/components/Card/Card.test.tsx +156 -84
  84. package/src/components/Card/Card.tsx +195 -145
  85. package/src/components/Card/CardTypes.tsx +0 -17
  86. package/src/components/Card/__snapshots__/Card.test.tsx.snap +410 -0
  87. package/src/components/CardEdition/CardEdition.stories.tsx +15 -47
  88. package/src/components/CardEdition/_CardEdition.scss +22 -23
  89. package/src/components/Chakra/Box.stories.mdx +14 -15
  90. package/src/components/Chakra/Center.stories.mdx +15 -8
  91. package/src/components/Chakra/Grid.stories.mdx +16 -7
  92. package/src/components/Chakra/Stack.stories.mdx +35 -18
  93. package/src/components/Checkbox/Checkbox.stories.mdx +33 -11
  94. package/src/components/Checkbox/Checkbox.test.tsx +30 -3
  95. package/src/components/Checkbox/Checkbox.tsx +27 -27
  96. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +90 -2
  97. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +82 -2
  98. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -1
  99. package/src/components/CheckboxGroup/CheckboxGroup.tsx +14 -15
  100. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +44 -80
  101. package/src/components/DatePicker/DatePicker.stories.mdx +163 -62
  102. package/src/components/DatePicker/DatePicker.test.tsx +248 -65
  103. package/src/components/DatePicker/DatePicker.tsx +158 -130
  104. package/src/components/DatePicker/_DatePicker.scss +33 -67
  105. package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +818 -0
  106. package/src/components/Fieldset/Fieldset.stories.mdx +55 -0
  107. package/src/components/Fieldset/Fieldset.test.tsx +125 -0
  108. package/src/components/Fieldset/Fieldset.tsx +52 -0
  109. package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +68 -0
  110. package/src/components/Form/Form.stories.mdx +4 -5
  111. package/src/components/Form/Form.tsx +1 -0
  112. package/src/components/Grid/SimpleGrid.stories.mdx +32 -39
  113. package/src/components/Grid/SimpleGrid.test.tsx +4 -4
  114. package/src/components/Heading/Heading.stories.mdx +3 -4
  115. package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -1
  116. package/src/components/HelperErrorText/HelperErrorText.tsx +5 -1
  117. package/src/components/Hero/HeroTypes.tsx +1 -0
  118. package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +7 -7
  119. package/src/components/HorizontalRule/HorizontalRule.stories.mdx +6 -5
  120. package/src/components/HorizontalRule/HorizontalRule.test.tsx +17 -0
  121. package/src/components/HorizontalRule/HorizontalRule.tsx +21 -4
  122. package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +5 -5
  123. package/src/components/Icons/Icon.stories.mdx +11 -3
  124. package/src/components/Icons/Icon.test.tsx +18 -0
  125. package/src/components/Icons/Icon.tsx +6 -0
  126. package/src/components/Icons/IconSvgs.tsx +22 -0
  127. package/src/components/Icons/IconTypes.tsx +11 -0
  128. package/src/components/Image/Image.stories.mdx +220 -0
  129. package/src/components/Image/Image.test.tsx +131 -29
  130. package/src/components/Image/Image.tsx +84 -56
  131. package/src/components/Image/ImageTypes.ts +22 -0
  132. package/src/components/Image/__snapshots__/Image.test.tsx.snap +190 -0
  133. package/src/components/Input/Input.stories.tsx +20 -64
  134. package/src/components/Input/_Input.scss +23 -14
  135. package/src/components/Link/Link.tsx +4 -1
  136. package/src/components/List/List.stories.mdx +1 -1
  137. package/src/components/List/List.tsx +11 -4
  138. package/src/components/Modal/Modal.stories.mdx +3 -3
  139. package/src/components/Modal/_Modal.scss +2 -2
  140. package/src/components/Notification/Notification.stories.mdx +1 -3
  141. package/src/components/Notification/Notification.tsx +24 -9
  142. package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +2 -0
  143. package/src/components/Pagination/Pagination.stories.mdx +26 -27
  144. package/src/components/Pagination/Pagination.stories.tsx +11 -16
  145. package/src/components/Pagination/Pagination.test.tsx +276 -146
  146. package/src/components/Pagination/Pagination.tsx +174 -154
  147. package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +285 -0
  148. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +292 -0
  149. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +225 -0
  150. package/src/components/ProgressIndicator/ProgressIndicator.tsx +126 -0
  151. package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +8 -0
  152. package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +357 -0
  153. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +3 -0
  154. package/src/components/RadioGroup/RadioGroup.stories.mdx +3 -4
  155. package/src/components/RadioGroup/RadioGroup.tsx +11 -16
  156. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +39 -71
  157. package/src/components/SearchBar/SearchBar.Test.tsx +66 -21
  158. package/src/components/SearchBar/SearchBar.stories.mdx +114 -10
  159. package/src/components/SearchBar/SearchBar.tsx +15 -5
  160. package/src/components/Select/SelectTypes.tsx +1 -0
  161. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +28 -59
  162. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +97 -177
  163. package/src/components/SkeletonLoader/SkeletonLoader.tsx +74 -71
  164. package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +739 -0
  165. package/src/components/Slider/Slider.stories.mdx +529 -0
  166. package/src/components/Slider/Slider.test.tsx +653 -0
  167. package/src/components/Slider/Slider.tsx +303 -0
  168. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +1946 -0
  169. package/src/components/StyleGuide/Bidirectionality.stories.mdx +1 -1
  170. package/src/components/StyleGuide/Breakpoints.stories.mdx +21 -7
  171. package/src/components/StyleGuide/Buttons.stories.mdx +69 -15
  172. package/src/components/StyleGuide/ColorCard.tsx +0 -1
  173. package/src/components/StyleGuide/DesignTokens.stories.mdx +170 -0
  174. package/src/components/StyleGuide/Iconography.stories.mdx +51 -62
  175. package/src/components/Tabs/Tabs.tsx +5 -5
  176. package/src/components/Template/Template.stories.mdx +11 -16
  177. package/src/components/TextInput/TextInput.stories.mdx +1 -1
  178. package/src/components/TextInput/TextInput.tsx +23 -6
  179. package/src/components/TextInput/TextInputTypes.tsx +2 -0
  180. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +2 -3
  181. package/src/docs/Chakra.stories.mdx +2 -2
  182. package/src/index.ts +20 -12
  183. package/src/resources.scss +5 -5
  184. package/src/styles/base/{_02-breakpoints.scss → _01-breakpoints.scss} +9 -10
  185. package/src/styles/base/{_03-mixins.scss → _02-mixins.scss} +16 -5
  186. package/src/styles/base/{_04-base.scss → _03-base.scss} +7 -2
  187. package/src/styles/base/{_05-focus.scss → _04-focus.scss} +0 -15
  188. package/src/styles/base/_place-holder.scss +14 -3
  189. package/src/styles/{03-space → space}/_space-inline.scss +14 -14
  190. package/src/styles/{03-space → space}/_space-inset.scss +10 -10
  191. package/src/styles/space/_space-stack.scss +116 -0
  192. package/src/styles.scss +13 -55
  193. package/src/theme/components/breadcrumb.ts +10 -0
  194. package/src/theme/components/button.ts +18 -12
  195. package/src/theme/components/card.ts +174 -0
  196. package/src/theme/components/checkbox.ts +7 -2
  197. package/src/theme/components/checkboxGroup.ts +8 -0
  198. package/src/theme/components/datePicker.ts +17 -0
  199. package/src/theme/components/fieldset.ts +18 -0
  200. package/src/theme/components/global.ts +26 -15
  201. package/src/theme/components/globalMixins.ts +9 -1
  202. package/src/theme/components/heading.ts +5 -0
  203. package/src/theme/components/image.ts +116 -0
  204. package/src/theme/components/label.ts +3 -10
  205. package/src/theme/components/link.ts +4 -0
  206. package/src/theme/components/list.ts +6 -3
  207. package/src/theme/components/notification.ts +12 -14
  208. package/src/theme/components/pagination.ts +20 -0
  209. package/src/theme/components/progressIndicator.ts +62 -0
  210. package/src/theme/components/radioGroup.ts +8 -0
  211. package/src/theme/components/select.ts +5 -2
  212. package/src/theme/components/skeletonLoader.ts +107 -0
  213. package/src/theme/components/slider.ts +79 -0
  214. package/src/theme/components/textInput.ts +2 -0
  215. package/src/theme/foundations/breakpoints.ts +8 -8
  216. package/src/theme/foundations/global.ts +6 -1
  217. package/src/theme/index.ts +22 -4
  218. package/src/utils/componentCategories.ts +4 -3
  219. package/dist/components/Image/Image.stories.d.ts +0 -18
  220. package/dist/theme/components/customCheckboxGroup.d.ts +0 -18
  221. package/dist/theme/components/customRadioGroup.d.ts +0 -18
  222. package/src/components/Button/_Button.scss +0 -32
  223. package/src/components/Card/_Card.scss +0 -308
  224. package/src/components/Image/Image.stories.tsx +0 -54
  225. package/src/components/Image/_Image.scss +0 -38
  226. package/src/components/Pagination/_Pagination.scss +0 -40
  227. package/src/components/SkeletonLoader/_SkeletonLoader.scss +0 -142
  228. package/src/styles/01-colors/_colors-brand.scss +0 -62
  229. package/src/styles/01-colors/_colors-utility.scss +0 -67
  230. package/src/styles/02-typography/_type-scale.css +0 -11
  231. package/src/styles/02-typography/_type-weight.css +0 -7
  232. package/src/styles/02-typography/_typefaces.css +0 -4
  233. package/src/styles/03-space/_space-stack.scss +0 -116
  234. package/src/styles/03-space/_space.css +0 -30
  235. package/src/styles/base/_card-grid.scss +0 -77
  236. package/src/styles/base/_typography.scss +0 -11
  237. package/src/theme/components/customCheckboxGroup.ts +0 -12
  238. package/src/theme/components/customRadioGroup.ts +0 -12
@@ -3,7 +3,6 @@ import {
3
3
  Story,
4
4
  Canvas,
5
5
  ArgsTable,
6
- Preview,
7
6
  Description,
8
7
  } from "@storybook/addon-docs/blocks";
9
8
  import { withDesign } from "storybook-addon-designs";
@@ -11,8 +10,8 @@ import { action } from "@storybook/addon-actions";
11
10
 
12
11
  import Button from "../Button/Button";
13
12
  import { ButtonTypes } from "../Button/ButtonTypes";
14
- import Card, { CardImage, CardHeading, CardContent, CardActions } from "./Card";
15
- import { CardImageRatios, CardImageSizes, CardLayouts } from "./CardTypes";
13
+ import Card, { CardHeading, CardContent, CardActions } from "./Card";
14
+ import { CardLayouts } from "./CardTypes";
16
15
  import Link from "../Link/Link";
17
16
  import Heading from "../Heading/Heading";
18
17
  import HorizontalRule from "../HorizontalRule/HorizontalRule";
@@ -20,7 +19,10 @@ import { LinkTypes } from "../Link/LinkTypes";
20
19
  import { HeadingDisplaySizes, HeadingLevels } from "../Heading/HeadingTypes";
21
20
  import Icon from "../Icons/Icon";
22
21
  import Image from "../Image/Image";
22
+ import { ImageRatios, ImageSizes } from "../Image/ImageTypes";
23
+ import SimpleGrid from "../Grid/SimpleGrid";
23
24
  import { getCategory } from "../../utils/componentCategories";
25
+ import DSProvider from "../../theme/provider";
24
26
 
25
27
  <Meta
26
28
  title={getCategory("Card")}
@@ -30,23 +32,13 @@ import { getCategory } from "../../utils/componentCategories";
30
32
  design: {
31
33
  type: "figma",
32
34
  url:
33
- "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Master?node-id=17167%3A58131",
35
+ "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36835%3A25747",
34
36
  },
35
37
  }}
36
38
  argTypes={{
37
- blockName: { table: { disable: true } },
38
39
  className: { table: { disable: true } },
39
- modifiers: { table: { disable: true } },
40
40
  id: { table: { disable: true } },
41
41
  imageComponent: { table: { disable: true } },
42
- layout: { table: { disable: false } },
43
- imageSrc: { table: { disable: false } },
44
- imageAlt: { table: { disable: false } },
45
- imageSize: { table: { disable: false } },
46
- imageAspectRatio: { table: { disable: false } },
47
- imageAtEnd: { table: { disable: false } },
48
- border: { table: { disable: false } },
49
- padding: { table: { disable: false } },
50
42
  backgroundColor: { control: { type: "color" } },
51
43
  foregroundColor: { control: { type: "color" } },
52
44
  }}
@@ -57,7 +49,7 @@ import { getCategory } from "../../utils/componentCategories";
57
49
  | Component Version | DS Version |
58
50
  | ----------------- | ---------- |
59
51
  | Added | `0.24.0` |
60
- | Latest | `0.24.1` |
52
+ | Latest | `0.25.3` |
61
53
 
62
54
  <Description of={Card} />
63
55
 
@@ -75,23 +67,27 @@ The `CardActions` component is used to display "call to action" (CTA) buttons an
75
67
 
76
68
  The `CardContent` component should be used to display all content other than headings and CTAs.
77
69
 
78
- <Preview withToolbar>
70
+ <Canvas withToolbar>
79
71
  <Story
80
72
  name="Card Props"
81
73
  args={{
82
74
  id: "custom-card",
83
75
  layout: CardLayouts.Row,
84
76
  imageSrc: "https://placeimg.com/400/300/animals",
85
- imageAspectRatio: CardImageRatios.ThreeByFour,
77
+ imageAspectRatio: ImageRatios.ThreeByFour,
78
+ imageSize: ImageSizes.Default,
86
79
  imageAlt: "Alt text",
80
+ imageAtEnd: false,
81
+ border: false,
82
+ center: false,
87
83
  }}
88
84
  >
89
85
  {(args) => (
90
86
  <Card {...args}>
91
- <CardHeading level={HeadingLevels.Two} id="heading1">
87
+ <CardHeading level={HeadingLevels.Two} id="main-heading1">
92
88
  Optional Header
93
89
  </CardHeading>
94
- <CardHeading level={HeadingLevels.Four} id="heading2">
90
+ <CardHeading level={HeadingLevels.Three} id="main-heading2">
95
91
  Sollicitudin Lorem Tortor Purus Ornare
96
92
  </CardHeading>
97
93
  <CardContent>
@@ -102,7 +98,7 @@ The `CardContent` component should be used to display all content other than hea
102
98
  <CardActions topBorder bottomBorder>
103
99
  <Button
104
100
  onClick={action("clicked")}
105
- id="button1"
101
+ id="main-button1"
106
102
  buttonType={ButtonTypes.Primary}
107
103
  type="submit"
108
104
  >
@@ -110,7 +106,7 @@ The `CardContent` component should be used to display all content other than hea
110
106
  </Button>
111
107
  <Button
112
108
  onClick={action("clicked")}
113
- id="button2"
109
+ id="main-button2"
114
110
  buttonType={ButtonTypes.Secondary}
115
111
  type="submit"
116
112
  >
@@ -125,7 +121,7 @@ The `CardContent` component should be used to display all content other than hea
125
121
  </Card>
126
122
  )}
127
123
  </Story>
128
- </Preview>
124
+ </Canvas>
129
125
 
130
126
  <ArgsTable story="Card Props" />
131
127
 
@@ -138,21 +134,15 @@ the default placement and move the image to the last element within a `Card`.
138
134
 
139
135
  ### Column Cards
140
136
 
141
- <Preview>
137
+ <Canvas>
142
138
  <Story name="Card Image Position">
143
- <div
144
- style={{
145
- display: "grid",
146
- "grid-gap": "2rem",
147
- "grid-template-columns": "repeat(2, 1fr)",
148
- }}
149
- >
139
+ <SimpleGrid columns={2}>
150
140
  <Card
151
141
  imageSrc="https://placeimg.com/400/200/animals"
152
142
  imageAlt="Alt text"
153
- imageAspectRatio={CardImageRatios.TwoByOne}
143
+ imageAspectRatio={ImageRatios.TwoByOne}
154
144
  >
155
- <CardHeading level={HeadingLevels.Three} id="heading1">
145
+ <CardHeading level={HeadingLevels.Three} id="props-heading1">
156
146
  Image on Top (default)
157
147
  </CardHeading>
158
148
  <CardContent>
@@ -163,10 +153,10 @@ the default placement and move the image to the last element within a `Card`.
163
153
  <Card
164
154
  imageSrc="https://placeimg.com/410/210/animals"
165
155
  imageAlt="Alt text"
166
- imageAspectRatio={CardImageRatios.TwoByOne}
156
+ imageAspectRatio={ImageRatios.TwoByOne}
167
157
  imageAtEnd
168
158
  >
169
- <CardHeading level={HeadingLevels.Three} id="heading1">
159
+ <CardHeading level={HeadingLevels.Three} id="props-heading2">
170
160
  Image on Bottom
171
161
  </CardHeading>
172
162
  <CardContent>
@@ -174,55 +164,51 @@ the default placement and move the image to the last element within a `Card`.
174
164
  libero, a pharetra augue.
175
165
  </CardContent>
176
166
  </Card>
177
- </div>
167
+ </SimpleGrid>
178
168
  </Story>
179
- </Preview>
169
+ </Canvas>
180
170
 
181
171
  ### Row Cards
182
172
 
183
- <Preview>
184
- <div
185
- style={{
186
- display: "grid",
187
- "grid-gap": "2rem",
188
- "grid-template-columns": "repeat(1, 1fr)",
189
- }}
190
- >
191
- <Card
192
- layout={CardLayouts.Row}
193
- center
194
- imageSrc="https://placeimg.com/400/200/animals"
195
- imageAlt="Alt text"
196
- imageAspectRatio={CardImageRatios.TwoByOne}
197
- >
198
- <CardHeading level={HeadingLevels.Four} id="heading1">
199
- Image on Left (default)
200
- </CardHeading>
201
- <CardContent>
202
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Sed
203
- posuere consectetur est at lobortis. Cras justo odio, dapibus ac
204
- facilisis in, egestas eget quam.
205
- </CardContent>
206
- </Card>
207
- <Card
208
- layout={CardLayouts.Row}
209
- center
210
- imageSrc="https://placeimg.com/410/210/animals"
211
- imageAlt="Alt text"
212
- imageAspectRatio={CardImageRatios.TwoByOne}
213
- imageAtEnd
214
- >
215
- <CardHeading level={HeadingLevels.Four} id="heading2">
216
- Image on Right
217
- </CardHeading>
218
- <CardContent>
219
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Sed
220
- posuere consectetur est at lobortis. Cras justo odio, dapibus ac
221
- facilisis in, egestas eget quam.
222
- </CardContent>
223
- </Card>
224
- </div>
225
- </Preview>
173
+ <Canvas>
174
+ <DSProvider>
175
+ <SimpleGrid columns={1}>
176
+ <Card
177
+ layout={CardLayouts.Row}
178
+ center
179
+ imageSrc="https://placeimg.com/400/200/animals"
180
+ imageAlt="Alt text"
181
+ imageAspectRatio={ImageRatios.TwoByOne}
182
+ >
183
+ <CardHeading level={HeadingLevels.Four} id="row-heading1">
184
+ Image on Left (default)
185
+ </CardHeading>
186
+ <CardContent>
187
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
188
+ Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
189
+ facilisis in, egestas eget quam.
190
+ </CardContent>
191
+ </Card>
192
+ <Card
193
+ layout={CardLayouts.Row}
194
+ center
195
+ imageSrc="https://placeimg.com/410/210/animals"
196
+ imageAlt="Alt text"
197
+ imageAspectRatio={ImageRatios.TwoByOne}
198
+ imageAtEnd
199
+ >
200
+ <CardHeading level={HeadingLevels.Four} id="row-heading2">
201
+ Image on Right
202
+ </CardHeading>
203
+ <CardContent>
204
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
205
+ Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
206
+ facilisis in, egestas eget quam.
207
+ </CardContent>
208
+ </Card>
209
+ </SimpleGrid>
210
+ </DSProvider>
211
+ </Canvas>
226
212
 
227
213
  ## Image Size
228
214
 
@@ -232,26 +218,20 @@ prop to override the default width.
232
218
 
233
219
  ### Column Cards
234
220
 
235
- <Preview>
221
+ <Canvas>
236
222
  <Story name="Card Image Size">
237
- <div
238
- style={{
239
- display: "grid",
240
- "grid-gap": "4rem",
241
- "grid-template-columns": "repeat(1, 1fr)",
242
- }}
243
- >
223
+ <SimpleGrid columns={1}>
244
224
  <Card
245
225
  center
246
226
  imageSrc="https://placeimg.com/400/200/animals"
247
227
  imageAlt="Alt text"
248
- imageAspectRatio={CardImageRatios.Square}
249
- imageSize={CardImageSizes.Small}
228
+ imageAspectRatio={ImageRatios.Square}
229
+ imageSize={ImageSizes.Small}
250
230
  >
251
- <CardHeading level={HeadingLevels.Three} id="heading1">
231
+ <CardHeading level={HeadingLevels.Three} id="column-heading1">
252
232
  Small Image
253
233
  </CardHeading>
254
- <CardHeading level={HeadingLevels.Five} id="heading2">
234
+ <CardHeading level={HeadingLevels.Four} id="column-heading2">
255
235
  Max-Width: 165px
256
236
  </CardHeading>
257
237
  <CardContent>
@@ -264,13 +244,13 @@ prop to override the default width.
264
244
  center
265
245
  imageSrc="https://placeimg.com/400/200/animals"
266
246
  imageAlt="Alt text"
267
- imageAspectRatio={CardImageRatios.Square}
268
- imageSize={CardImageSizes.Medium}
247
+ imageAspectRatio={ImageRatios.Square}
248
+ imageSize={ImageSizes.Medium}
269
249
  >
270
- <CardHeading level={HeadingLevels.Three} id="heading1">
250
+ <CardHeading level={HeadingLevels.Three} id="column2-heading1">
271
251
  Medium Image
272
252
  </CardHeading>
273
- <CardHeading level={HeadingLevels.Five} id="heading2">
253
+ <CardHeading level={HeadingLevels.Four} id="column2-heading2">
274
254
  Max-Width: 225px
275
255
  </CardHeading>
276
256
  <CardContent>
@@ -278,17 +258,18 @@ prop to override the default width.
278
258
  libero, a pharetra augue.
279
259
  </CardContent>
280
260
  </Card>
261
+ <HorizontalRule />
281
262
  <Card
282
263
  center
283
264
  imageSrc="https://placeimg.com/410/210/animals"
284
265
  imageAlt="Alt text"
285
- imageAspectRatio={CardImageRatios.Square}
286
- imageSize={CardImageSizes.Large}
266
+ imageAspectRatio={ImageRatios.Square}
267
+ imageSize={ImageSizes.Large}
287
268
  >
288
- <CardHeading level={HeadingLevels.Three} id="heading1">
269
+ <CardHeading level={HeadingLevels.Three} id="column3-heading1">
289
270
  Large Image
290
271
  </CardHeading>
291
- <CardHeading level={HeadingLevels.Five} id="heading2">
272
+ <CardHeading level={HeadingLevels.Four} id="column3-heading2">
292
273
  Max-Width: 360px
293
274
  </CardHeading>
294
275
  <CardContent>
@@ -296,16 +277,17 @@ prop to override the default width.
296
277
  libero, a pharetra augue.
297
278
  </CardContent>
298
279
  </Card>
280
+ <HorizontalRule />
299
281
  <Card
300
282
  center
301
283
  imageSrc="https://placeimg.com/410/210/animals"
302
284
  imageAlt="Alt text"
303
- imageAspectRatio={CardImageRatios.Square}
285
+ imageAspectRatio={ImageRatios.Square}
304
286
  >
305
- <CardHeading level={HeadingLevels.Three} id="heading1">
287
+ <CardHeading level={HeadingLevels.Three} id="column-4heading1">
306
288
  Default Image
307
289
  </CardHeading>
308
- <CardHeading level={HeadingLevels.Five} id="heading2">
290
+ <CardHeading level={HeadingLevels.Four} id="column-4heading2">
309
291
  Width: 100%
310
292
  </CardHeading>
311
293
  <CardContent>
@@ -313,116 +295,106 @@ prop to override the default width.
313
295
  libero, a pharetra augue.
314
296
  </CardContent>
315
297
  </Card>
316
- </div>
298
+ </SimpleGrid>
317
299
  </Story>
318
- </Preview>
300
+ </Canvas>
319
301
 
320
302
  ### Row Cards
321
303
 
322
- <Preview>
323
- <div
324
- style={{
325
- display: "grid",
326
- "grid-gap": "2rem",
327
- "grid-template-columns": "repeat(1, 1fr)",
328
- }}
329
- >
330
- <Card
331
- layout={CardLayouts.Row}
332
- center
333
- imageSrc="https://placeimg.com/400/200/animals"
334
- imageAlt="Alt text"
335
- imageAspectRatio={CardImageRatios.TwoByOne}
336
- imageSize={CardImageSizes.Small}
337
- >
338
- <CardHeading level={HeadingLevels.Three} id="heading1">
339
- Small Image
340
- </CardHeading>
341
- <CardHeading level={HeadingLevels.Five} id="heading2">
342
- Max-Width: 165px
343
- </CardHeading>
344
- <CardContent>
345
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
346
- </CardContent>
347
- </Card>
348
- <Card
349
- layout={CardLayouts.Row}
350
- center
351
- imageSrc="https://placeimg.com/410/210/animals"
352
- imageAlt="Alt text"
353
- imageAspectRatio={CardImageRatios.TwoByOne}
354
- imageSize={CardImageSizes.Medium}
355
- >
356
- <CardHeading level={HeadingLevels.Three} id="heading2">
357
- Medium Image
358
- </CardHeading>
359
- <CardHeading level={HeadingLevels.Five} id="heading2">
360
- Max-Width: 225px
361
- </CardHeading>
362
- <CardContent>
363
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Sed
364
- posuere consectetur est at lobortis.
365
- </CardContent>
366
- </Card>
367
- <Card
368
- layout={CardLayouts.Row}
369
- center
370
- imageSrc="https://placeimg.com/400/250/animals"
371
- imageAlt="Alt text"
372
- imageAspectRatio={CardImageRatios.TwoByOne}
373
- imageSize={CardImageSizes.Large}
374
- >
375
- <CardHeading level={HeadingLevels.Three} id="heading1">
376
- Large Image
377
- </CardHeading>
378
- <CardHeading level={HeadingLevels.Five} id="heading2">
379
- Max-Width: 360px
380
- </CardHeading>
381
- <CardContent>
382
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Sed
383
- posuere consectetur est at lobortis. Cras justo odio, dapibus ac
384
- facilisis in, egestas eget quam.
385
- </CardContent>
386
- </Card>
387
- <Card
388
- layout={CardLayouts.Row}
389
- center
390
- imageSrc="https://placeimg.com/450/250/animals"
391
- imageAlt="Alt text"
392
- imageAspectRatio={CardImageRatios.TwoByOne}
393
- >
394
- <CardHeading level={HeadingLevels.Three} id="heading2">
395
- Default Image
396
- </CardHeading>
397
- <CardHeading level={HeadingLevels.Five} id="heading2">
398
- Max-Width: 225px
399
- </CardHeading>
400
- <CardContent>
401
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Sed
402
- posuere consectetur est at lobortis. Cras justo odio, dapibus ac
403
- facilisis in, egestas eget quam.
404
- </CardContent>
405
- </Card>
406
- </div>
407
- </Preview>
304
+ <Canvas>
305
+ <DSProvider>
306
+ <SimpleGrid columns={1}>
307
+ <Card
308
+ layout={CardLayouts.Row}
309
+ center
310
+ imageSrc="https://placeimg.com/400/200/animals"
311
+ imageAlt="Alt text"
312
+ imageAspectRatio={ImageRatios.TwoByOne}
313
+ imageSize={ImageSizes.Small}
314
+ >
315
+ <CardHeading level={HeadingLevels.Three} id="row2-heading1">
316
+ Small Image
317
+ </CardHeading>
318
+ <CardHeading level={HeadingLevels.Four} id="row2-heading2">
319
+ Max-Width: 165px
320
+ </CardHeading>
321
+ <CardContent>
322
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
323
+ </CardContent>
324
+ </Card>
325
+ <Card
326
+ layout={CardLayouts.Row}
327
+ center
328
+ imageSrc="https://placeimg.com/410/210/animals"
329
+ imageAlt="Alt text"
330
+ imageAspectRatio={ImageRatios.TwoByOne}
331
+ imageSize={ImageSizes.Medium}
332
+ >
333
+ <CardHeading level={HeadingLevels.Three} id="row3-heading2">
334
+ Medium Image
335
+ </CardHeading>
336
+ <CardHeading level={HeadingLevels.Four} id="row3-heading2">
337
+ Max-Width: 225px
338
+ </CardHeading>
339
+ <CardContent>
340
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
341
+ Sed posuere consectetur est at lobortis.
342
+ </CardContent>
343
+ </Card>
344
+ <Card
345
+ layout={CardLayouts.Row}
346
+ center
347
+ imageSrc="https://placeimg.com/400/250/animals"
348
+ imageAlt="Alt text"
349
+ imageAspectRatio={ImageRatios.TwoByOne}
350
+ imageSize={ImageSizes.Large}
351
+ >
352
+ <CardHeading level={HeadingLevels.Three} id="row4-heading1">
353
+ Large Image
354
+ </CardHeading>
355
+ <CardHeading level={HeadingLevels.Four} id="row4-heading2">
356
+ Max-Width: 360px
357
+ </CardHeading>
358
+ <CardContent>
359
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
360
+ Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
361
+ facilisis in, egestas eget quam.
362
+ </CardContent>
363
+ </Card>
364
+ <Card
365
+ layout={CardLayouts.Row}
366
+ center
367
+ imageSrc="https://placeimg.com/450/250/animals"
368
+ imageAlt="Alt text"
369
+ imageAspectRatio={ImageRatios.TwoByOne}
370
+ >
371
+ <CardHeading level={HeadingLevels.Three} id="row5-heading2">
372
+ Default Image
373
+ </CardHeading>
374
+ <CardHeading level={HeadingLevels.Four} id="row5-heading2">
375
+ Max-Width: 225px
376
+ </CardHeading>
377
+ <CardContent>
378
+ Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
379
+ Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
380
+ facilisis in, egestas eget quam.
381
+ </CardContent>
382
+ </Card>
383
+ </SimpleGrid>
384
+ </DSProvider>
385
+ </Canvas>
408
386
 
409
387
  ## Cards in a Grid
410
388
 
411
- <Preview>
389
+ <Canvas>
412
390
  <Story name="Cards in a Grid">
413
- <div
414
- style={{
415
- display: "grid",
416
- "grid-gap": "2rem",
417
- "grid-template-columns": "repeat(3, 1fr)",
418
- }}
419
- >
391
+ <SimpleGrid columns={3}>
420
392
  <Card
421
393
  imageSrc="https://placeimg.com/400/200/animals"
422
394
  imageAlt="Alt text"
423
- imageAspectRatio={CardImageRatios.TwoByOne}
395
+ imageAspectRatio={ImageRatios.TwoByOne}
424
396
  >
425
- <CardHeading level={HeadingLevels.Three} id="heading1">
397
+ <CardHeading level={HeadingLevels.Three} id="grid1-heading1">
426
398
  Card Heading
427
399
  </CardHeading>
428
400
  <CardContent>
@@ -433,9 +405,9 @@ prop to override the default width.
433
405
  <Card
434
406
  imageSrc="https://placeimg.com/410/210/animals"
435
407
  imageAlt="Alt text"
436
- imageAspectRatio={CardImageRatios.TwoByOne}
408
+ imageAspectRatio={ImageRatios.TwoByOne}
437
409
  >
438
- <CardHeading level={HeadingLevels.Three} id="heading1">
410
+ <CardHeading level={HeadingLevels.Three} id="grid2-heading1">
439
411
  Card Heading
440
412
  </CardHeading>
441
413
  <CardContent>
@@ -446,9 +418,9 @@ prop to override the default width.
446
418
  <Card
447
419
  imageSrc="https://placeimg.com/420/220/animals"
448
420
  imageAlt="Alt text"
449
- imageAspectRatio={CardImageRatios.TwoByOne}
421
+ imageAspectRatio={ImageRatios.TwoByOne}
450
422
  >
451
- <CardHeading level={HeadingLevels.Three} id="heading1">
423
+ <CardHeading level={HeadingLevels.Three} id="grid3-heading1">
452
424
  Card Heading
453
425
  </CardHeading>
454
426
  <CardContent>
@@ -459,9 +431,9 @@ prop to override the default width.
459
431
  <Card
460
432
  imageSrc="https://placeimg.com/430/230/animals"
461
433
  imageAlt="Alt text"
462
- imageAspectRatio={CardImageRatios.TwoByOne}
434
+ imageAspectRatio={ImageRatios.TwoByOne}
463
435
  >
464
- <CardHeading level={HeadingLevels.Three} id="heading1">
436
+ <CardHeading level={HeadingLevels.Three} id="grid4-heading1">
465
437
  Card Heading
466
438
  </CardHeading>
467
439
  <CardContent>
@@ -472,9 +444,9 @@ prop to override the default width.
472
444
  <Card
473
445
  imageSrc="https://placeimg.com/440/240/animals"
474
446
  imageAlt="Alt text"
475
- imageAspectRatio={CardImageRatios.TwoByOne}
447
+ imageAspectRatio={ImageRatios.TwoByOne}
476
448
  >
477
- <CardHeading level={HeadingLevels.Three} id="heading1">
449
+ <CardHeading level={HeadingLevels.Three} id="grid5-heading1">
478
450
  Card Heading
479
451
  </CardHeading>
480
452
  <CardContent>
@@ -485,9 +457,9 @@ prop to override the default width.
485
457
  <Card
486
458
  imageSrc="https://placeimg.com/450/250/animals"
487
459
  imageAlt="Alt text"
488
- imageAspectRatio={CardImageRatios.TwoByOne}
460
+ imageAspectRatio={ImageRatios.TwoByOne}
489
461
  >
490
- <CardHeading level={HeadingLevels.Three} id="heading1">
462
+ <CardHeading level={HeadingLevels.Three} id="grid6-heading1">
491
463
  Card Heading
492
464
  </CardHeading>
493
465
  <CardContent>
@@ -495,29 +467,23 @@ prop to override the default width.
495
467
  libero, a pharetra augue.
496
468
  </CardContent>
497
469
  </Card>
498
- </div>
470
+ </SimpleGrid>
499
471
  </Story>
500
- </Preview>
472
+ </Canvas>
501
473
 
502
474
  ## Cards in a Stack
503
475
 
504
- <Preview>
476
+ <Canvas>
505
477
  <Story name="Cards in a Stack">
506
- <div
507
- style={{
508
- display: "grid",
509
- "grid-gap": "2rem",
510
- "grid-template-columns": "repeat(1, 1fr)",
511
- }}
512
- >
478
+ <SimpleGrid columns={1}>
513
479
  <Card
514
480
  layout={CardLayouts.Row}
515
481
  center
516
482
  imageSrc="https://placeimg.com/400/200/animals"
517
483
  imageAlt="Alt text"
518
- imageAspectRatio={CardImageRatios.TwoByOne}
484
+ imageAspectRatio={ImageRatios.TwoByOne}
519
485
  >
520
- <CardHeading level={HeadingLevels.Four} id="heading1">
486
+ <CardHeading level={HeadingLevels.Four} id="stack1-heading1">
521
487
  Card Heading
522
488
  </CardHeading>
523
489
  <CardContent>
@@ -531,9 +497,9 @@ prop to override the default width.
531
497
  center
532
498
  imageSrc="https://placeimg.com/410/210/animals"
533
499
  imageAlt="Alt text"
534
- imageAspectRatio={CardImageRatios.TwoByOne}
500
+ imageAspectRatio={ImageRatios.TwoByOne}
535
501
  >
536
- <CardHeading level={HeadingLevels.Four} id="heading2">
502
+ <CardHeading level={HeadingLevels.Four} id="stack2-heading2">
537
503
  Card Heading
538
504
  </CardHeading>
539
505
  <CardContent>
@@ -547,9 +513,9 @@ prop to override the default width.
547
513
  center
548
514
  imageSrc="https://placeimg.com/420/220/animals"
549
515
  imageAlt="Alt text"
550
- imageAspectRatio={CardImageRatios.TwoByOne}
516
+ imageAspectRatio={ImageRatios.TwoByOne}
551
517
  >
552
- <CardHeading level={HeadingLevels.Four} id="heading3">
518
+ <CardHeading level={HeadingLevels.Four} id="stack3-heading3">
553
519
  Card Heading
554
520
  </CardHeading>
555
521
  <CardContent>
@@ -558,27 +524,27 @@ prop to override the default width.
558
524
  facilisis in, egestas eget quam.
559
525
  </CardContent>
560
526
  </Card>
561
- </div>
527
+ </SimpleGrid>
562
528
  </Story>
563
- </Preview>
529
+ </Canvas>
564
530
 
565
531
  ## Custom Image Component
566
532
 
567
533
  Instead of passing a path for the `imageSrc` prop, you can pass a custom image component in using the `imageComponent` prop.
568
534
 
569
- <Preview withToolbar>
535
+ <Canvas withToolbar>
570
536
  <Story name="Custom Image Component">
571
537
  <Card
572
538
  imageAlt="Alt text"
573
- imageAspectRatio={CardImageRatios.SixteenByNine}
539
+ imageAspectRatio={ImageRatios.SixteenByNine}
574
540
  imageComponent={
575
541
  <Image src="https://placeimg.com/400/400/animals" alt="Alt text" />
576
542
  }
577
543
  >
578
- <CardHeading level={HeadingLevels.Two} id="heading1">
544
+ <CardHeading level={HeadingLevels.Two} id="img1-heading1">
579
545
  Card Component with Custom Image Component
580
546
  </CardHeading>
581
- <CardHeading level={HeadingLevels.Four} id="heading2">
547
+ <CardHeading level={HeadingLevels.Three} id="img2-heading2">
582
548
  Secondary Heading
583
549
  </CardHeading>
584
550
  <CardContent>
@@ -589,7 +555,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
589
555
  consectetur est at lobortis.
590
556
  </CardContent>
591
557
  <CardActions>
592
- <Link type={LinkTypes.Button} href="blah">
558
+ <Link type={LinkTypes.Button} href="#">
593
559
  Reserve
594
560
  </Link>
595
561
  <Link href="#url" type={LinkTypes.Forwards}>
@@ -598,22 +564,15 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
598
564
  </CardActions>
599
565
  </Card>
600
566
  </Story>
601
- </Preview>
567
+ </Canvas>
602
568
 
603
569
  ## Cards Without Images
604
570
 
605
- <Preview>
571
+ <Canvas>
606
572
  <Story name="Cards Without Images">
607
- <div
608
- style={{
609
- display: "grid",
610
- gridGap: "2rem",
611
- gridTemplateColumns: "repeat(3, 1fr)",
612
- marginBottom: "2rem",
613
- }}
614
- >
573
+ <SimpleGrid columns={3}>
615
574
  <Card border>
616
- <CardHeading level={HeadingLevels.Three} id="heading1">
575
+ <CardHeading level={HeadingLevels.Three} id="no-img1-heading1">
617
576
  Card Heading
618
577
  </CardHeading>
619
578
  <CardContent>
@@ -623,7 +582,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
623
582
  </CardContent>
624
583
  </Card>
625
584
  <Card border>
626
- <CardHeading level={HeadingLevels.Three} id="heading1">
585
+ <CardHeading level={HeadingLevels.Three} id="no-img2-heading1">
627
586
  Card Heading
628
587
  </CardHeading>
629
588
  <CardContent>
@@ -633,7 +592,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
633
592
  </CardContent>
634
593
  </Card>
635
594
  <Card border>
636
- <CardHeading level={HeadingLevels.Three} id="heading1">
595
+ <CardHeading level={HeadingLevels.Three} id="no-img3-heading1">
637
596
  Card Heading
638
597
  </CardHeading>
639
598
  <CardContent>
@@ -642,16 +601,11 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
642
601
  Praesent commodo cursus magna, vel scelerisque nisl.
643
602
  </CardContent>
644
603
  </Card>
645
- </div>
646
- <div
647
- style={{
648
- display: "grid",
649
- "grid-gap": "2rem",
650
- "grid-template-columns": "repeat(1, 1fr)",
651
- }}
652
- >
604
+ </SimpleGrid>
605
+ <br />
606
+ <SimpleGrid columns={1}>
653
607
  <Card layout={CardLayouts.Row} border>
654
- <CardHeading level={HeadingLevels.Three} id="heading1">
608
+ <CardHeading level={HeadingLevels.Three} id="no-img4-heading1">
655
609
  Card Heading
656
610
  </CardHeading>
657
611
  <CardContent>
@@ -664,7 +618,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
664
618
  </CardContent>
665
619
  </Card>
666
620
  <Card layout={CardLayouts.Row} border>
667
- <CardHeading level={HeadingLevels.Three} id="heading1">
621
+ <CardHeading level={HeadingLevels.Three} id="no-img5-heading1">
668
622
  Card Heading
669
623
  </CardHeading>
670
624
  <CardContent>
@@ -677,7 +631,7 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
677
631
  </CardContent>
678
632
  </Card>
679
633
  <Card layout={CardLayouts.Row} border>
680
- <CardHeading level={HeadingLevels.Three} id="heading1">
634
+ <CardHeading level={HeadingLevels.Three} id="no-img6-heading1">
681
635
  Card Heading
682
636
  </CardHeading>
683
637
  <CardContent>
@@ -689,6 +643,89 @@ Instead of passing a path for the `imageSrc` prop, you can pass a custom image c
689
643
  eget metus.
690
644
  </CardContent>
691
645
  </Card>
692
- </div>
646
+ </SimpleGrid>
693
647
  </Story>
694
- </Preview>
648
+ </Canvas>
649
+
650
+ ## Card With Full-Click Functionality
651
+
652
+ To enable the full-click functionality in the `Card` component, pass a URL in
653
+ the `mainActionLink` prop. This will make the entire `Card` component clickable.
654
+ If the `Card` has action links or buttons, they can still be accessed by tabbing
655
+ through the `Card` and pressing `enter` or clicking like a regular link.
656
+
657
+ Internally, if multiple `CardHeading` components are passed, only the first one
658
+ will have the full-click link. This, however, does not affect the `Card` itself
659
+ from being having the full-click functionality.
660
+
661
+ <Canvas>
662
+ <Story name="Card With Full-Click Functionality">
663
+ <SimpleGrid columns={2}>
664
+ <Card
665
+ imageSrc="https://placeimg.com/400/200/animals"
666
+ imageAlt="Alt text"
667
+ imageAspectRatio={ImageRatios.TwoByOne}
668
+ mainActionLink="http://nypl.org"
669
+ >
670
+ <CardHeading level={HeadingLevels.Three} id="fullclick1-heading1">
671
+ Go to NYPL home page.
672
+ </CardHeading>
673
+ <CardHeading level={HeadingLevels.Four} id="fullclick1-heading2">
674
+ Some other heading.
675
+ </CardHeading>
676
+ <CardContent>
677
+ This entire `Card` component is clickable, but the links below are
678
+ still accessible by tabbing through the `Card` and pressing `enter` or
679
+ clicking with a mouse.
680
+ </CardContent>
681
+ <CardActions>
682
+ <Link href="#" type={LinkTypes.Button}>
683
+ Button
684
+ </Link>
685
+ <Link href="#" type={LinkTypes.Forwards}>
686
+ Other link
687
+ </Link>
688
+ </CardActions>
689
+ </Card>
690
+ <Card
691
+ imageSrc="https://placeimg.com/410/210/animals"
692
+ imageAlt="Alt text"
693
+ imageAspectRatio={ImageRatios.TwoByOne}
694
+ mainActionLink="http://nypl.org"
695
+ imageAtEnd
696
+ >
697
+ <CardHeading level={HeadingLevels.Three} id="fullclick2-heading1">
698
+ Go to NYPL home page.
699
+ </CardHeading>
700
+ <CardContent>
701
+ This `Card` component does not have any extra links.
702
+ </CardContent>
703
+ </Card>
704
+ </SimpleGrid>
705
+ </Story>
706
+ </Canvas>
707
+
708
+ ## Accessibility
709
+
710
+ ### Headings
711
+
712
+ In general, headings from `h1` through `h6` must be in sequential order in the
713
+ DOM tree. Rendering an `h4` following an `h2` will throw an error. Therefore,
714
+ when adding `CardHeading` components, make sure to add them in sequential order
715
+ with the `level` prop.
716
+
717
+ ```tsx
718
+ <CardHeading level={HeadingLevels.Three} id="headingthree">
719
+ Heading level three
720
+ </CardHeading>
721
+ <CardHeading level={HeadingLevels.Four} id="headingfour">
722
+ Heading level four
723
+ </CardHeading>
724
+ ```
725
+
726
+ ### Full-Click Functionality
727
+
728
+ Passing in a URL in the `mainActionLink` prop will make the entire `Card`
729
+ clickable. Other links in the `CardActions` component can still be accessed by
730
+ tabbing through and pressing "enter" or by clicking as you normally would on a
731
+ link.