@nypl/design-system-react-components 1.0.2 → 1.0.4

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 (309) hide show
  1. package/CHANGELOG.md +53 -0
  2. package/README.md +171 -135
  3. package/dist/__tests__/mediaMatchMock.d.ts +79 -0
  4. package/dist/components/Card/Card.d.ts +8 -6
  5. package/dist/components/Heading/Heading.d.ts +6 -0
  6. package/dist/components/Icons/Icon.d.ts +1 -1
  7. package/dist/components/Icons/IconSvgs.d.ts +10 -0
  8. package/dist/components/Logo/Logo.d.ts +1 -1
  9. package/dist/components/Logo/LogoSvgs.d.ts +3 -0
  10. package/dist/components/Slider/Slider.d.ts +1 -2
  11. package/dist/components/Table/Table.d.ts +3 -2
  12. package/dist/components/Text/Text.d.ts +6 -0
  13. package/dist/components/TextInput/TextInput.d.ts +2 -1
  14. package/dist/design-system-react-components.cjs.development.js +1700 -878
  15. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  16. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  17. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  18. package/dist/design-system-react-components.esm.js +1672 -881
  19. package/dist/design-system-react-components.esm.js.map +1 -1
  20. package/dist/hooks/{tests → __tests__}/useCarouselStyles.test.d.ts +0 -0
  21. package/dist/hooks/__tests__/useNYPLBreakpoints.test.d.ts +1 -0
  22. package/dist/hooks/useNYPLBreakpoints.d.ts +13 -0
  23. package/dist/index.d.ts +2 -1
  24. package/dist/resources.scss +0 -4
  25. package/dist/styles.css +3 -2
  26. package/dist/theme/components/button.d.ts +7 -2
  27. package/dist/theme/components/checkbox.d.ts +1 -0
  28. package/dist/theme/components/customTable.d.ts +522 -34
  29. package/dist/theme/components/datePicker.d.ts +1 -0
  30. package/dist/theme/components/global.d.ts +5 -2
  31. package/dist/theme/components/heading.d.ts +5 -1
  32. package/dist/theme/components/image.d.ts +18 -0
  33. package/dist/theme/components/radio.d.ts +9 -0
  34. package/dist/theme/components/searchBar.d.ts +6 -0
  35. package/dist/theme/components/select.d.ts +4 -5
  36. package/dist/theme/components/structuredContent.d.ts +117 -17
  37. package/dist/theme/components/template.d.ts +4 -1
  38. package/dist/theme/components/text.d.ts +5 -1
  39. package/dist/theme/components/textInput.d.ts +4 -0
  40. package/dist/theme/components/toggle.d.ts +1 -0
  41. package/dist/theme/provider.d.ts +2 -1
  42. package/package.json +16 -16
  43. package/src/__tests__/fileMock.ts +0 -6
  44. package/src/__tests__/setup.ts +0 -27
  45. package/src/__tests__/utils/utils.test.ts +0 -18
  46. package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +0 -42
  47. package/src/components/Accordion/Accordion.stories.mdx +0 -333
  48. package/src/components/Accordion/Accordion.test.tsx +0 -237
  49. package/src/components/Accordion/Accordion.tsx +0 -137
  50. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +0 -734
  51. package/src/components/Autosuggest/Autosuggest.stories.mdx +0 -75
  52. package/src/components/Autosuggest/Autosuggest.stories.tsx +0 -211
  53. package/src/components/Autosuggest/_Autosuggest.scss +0 -51
  54. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +0 -231
  55. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +0 -144
  56. package/src/components/Breadcrumbs/Breadcrumbs.tsx +0 -98
  57. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +0 -695
  58. package/src/components/Button/Button.stories.mdx +0 -320
  59. package/src/components/Button/Button.test.tsx +0 -184
  60. package/src/components/Button/Button.tsx +0 -95
  61. package/src/components/Button/__snapshots__/Button.test.tsx.snap +0 -106
  62. package/src/components/ButtonGroup/ButtonGroup.stories.mdx +0 -178
  63. package/src/components/ButtonGroup/ButtonGroup.test.tsx +0 -141
  64. package/src/components/ButtonGroup/ButtonGroup.tsx +0 -100
  65. package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +0 -117
  66. package/src/components/Card/Card.stories.mdx +0 -1041
  67. package/src/components/Card/Card.test.tsx +0 -388
  68. package/src/components/Card/Card.tsx +0 -346
  69. package/src/components/Card/__snapshots__/Card.test.tsx.snap +0 -568
  70. package/src/components/Chakra/Box.stories.mdx +0 -52
  71. package/src/components/Chakra/Center.stories.mdx +0 -96
  72. package/src/components/Chakra/Flex.stories.mdx +0 -111
  73. package/src/components/Chakra/Grid.stories.mdx +0 -89
  74. package/src/components/Chakra/Stack.stories.mdx +0 -109
  75. package/src/components/Checkbox/Checkbox.stories.mdx +0 -243
  76. package/src/components/Checkbox/Checkbox.test.tsx +0 -350
  77. package/src/components/Checkbox/Checkbox.tsx +0 -152
  78. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +0 -661
  79. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +0 -462
  80. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +0 -492
  81. package/src/components/CheckboxGroup/CheckboxGroup.tsx +0 -173
  82. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -1842
  83. package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +0 -163
  84. package/src/components/ComponentWrapper/ComponentWrapper.tsx +0 -76
  85. package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +0 -103
  86. package/src/components/DatePicker/DatePicker.stories.mdx +0 -452
  87. package/src/components/DatePicker/DatePicker.test.tsx +0 -940
  88. package/src/components/DatePicker/DatePicker.tsx +0 -450
  89. package/src/components/DatePicker/_DatePicker.scss +0 -100
  90. package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +0 -908
  91. package/src/components/Fieldset/Fieldset.stories.mdx +0 -96
  92. package/src/components/Fieldset/Fieldset.test.tsx +0 -155
  93. package/src/components/Fieldset/Fieldset.tsx +0 -55
  94. package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +0 -89
  95. package/src/components/Form/Form.stories.mdx +0 -426
  96. package/src/components/Form/Form.test.tsx +0 -234
  97. package/src/components/Form/Form.tsx +0 -124
  98. package/src/components/Form/__snapshots__/Form.test.tsx.snap +0 -115
  99. package/src/components/Grid/SimpleGrid.stories.mdx +0 -336
  100. package/src/components/Grid/SimpleGrid.test.tsx +0 -79
  101. package/src/components/Grid/SimpleGrid.tsx +0 -49
  102. package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +0 -23
  103. package/src/components/Heading/Heading.stories.mdx +0 -187
  104. package/src/components/Heading/Heading.test.tsx +0 -171
  105. package/src/components/Heading/Heading.tsx +0 -104
  106. package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +0 -90
  107. package/src/components/HelperErrorText/HelperErrorText.stories.mdx +0 -172
  108. package/src/components/HelperErrorText/HelperErrorText.test.tsx +0 -114
  109. package/src/components/HelperErrorText/HelperErrorText.tsx +0 -62
  110. package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +0 -93
  111. package/src/components/Hero/Hero.stories.mdx +0 -378
  112. package/src/components/Hero/Hero.test.tsx +0 -611
  113. package/src/components/Hero/Hero.tsx +0 -203
  114. package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +0 -379
  115. package/src/components/HorizontalRule/HorizontalRule.stories.mdx +0 -73
  116. package/src/components/HorizontalRule/HorizontalRule.test.tsx +0 -54
  117. package/src/components/HorizontalRule/HorizontalRule.tsx +0 -27
  118. package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +0 -44
  119. package/src/components/Icons/Icon.stories.mdx +0 -413
  120. package/src/components/Icons/Icon.test.tsx +0 -120
  121. package/src/components/Icons/Icon.tsx +0 -187
  122. package/src/components/Icons/IconSvgs.tsx +0 -64
  123. package/src/components/Icons/__snapshots__/Icon.test.tsx.snap +0 -129
  124. package/src/components/Image/Image.stories.mdx +0 -332
  125. package/src/components/Image/Image.test.tsx +0 -155
  126. package/src/components/Image/Image.tsx +0 -171
  127. package/src/components/Image/__snapshots__/Image.test.tsx.snap +0 -269
  128. package/src/components/Label/Label.stories.mdx +0 -100
  129. package/src/components/Label/Label.test.tsx +0 -116
  130. package/src/components/Label/Label.tsx +0 -55
  131. package/src/components/Label/__snapshots__/Label.test.tsx.snap +0 -45
  132. package/src/components/Link/Link.stories.mdx +0 -249
  133. package/src/components/Link/Link.test.tsx +0 -224
  134. package/src/components/Link/Link.tsx +0 -178
  135. package/src/components/Link/__snapshots__/Link.test.tsx.snap +0 -286
  136. package/src/components/List/List.stories.mdx +0 -393
  137. package/src/components/List/List.test.tsx +0 -265
  138. package/src/components/List/List.tsx +0 -156
  139. package/src/components/List/__snapshots__/List.test.tsx.snap +0 -213
  140. package/src/components/Logo/Logo.stories.mdx +0 -295
  141. package/src/components/Logo/Logo.test.tsx +0 -116
  142. package/src/components/Logo/Logo.tsx +0 -151
  143. package/src/components/Logo/LogoSvgs.tsx +0 -90
  144. package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +0 -142
  145. package/src/components/Modal/Modal.stories.mdx +0 -294
  146. package/src/components/Modal/Modal.test.tsx +0 -157
  147. package/src/components/Modal/Modal.tsx +0 -154
  148. package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +0 -25
  149. package/src/components/Notification/Notification.stories.mdx +0 -358
  150. package/src/components/Notification/Notification.test.tsx +0 -279
  151. package/src/components/Notification/Notification.tsx +0 -224
  152. package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +0 -525
  153. package/src/components/Pagination/Pagination.stories.mdx +0 -184
  154. package/src/components/Pagination/Pagination.test.tsx +0 -419
  155. package/src/components/Pagination/Pagination.tsx +0 -269
  156. package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +0 -544
  157. package/src/components/Placeholder/Placeholder.tsx +0 -19
  158. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +0 -360
  159. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +0 -298
  160. package/src/components/ProgressIndicator/ProgressIndicator.tsx +0 -132
  161. package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -434
  162. package/src/components/Radio/Radio.stories.mdx +0 -216
  163. package/src/components/Radio/Radio.test.tsx +0 -247
  164. package/src/components/Radio/Radio.tsx +0 -119
  165. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +0 -451
  166. package/src/components/RadioGroup/RadioGroup.stories.mdx +0 -479
  167. package/src/components/RadioGroup/RadioGroup.test.tsx +0 -471
  168. package/src/components/RadioGroup/RadioGroup.tsx +0 -171
  169. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +0 -1550
  170. package/src/components/SearchBar/SearchBar.stories.mdx +0 -518
  171. package/src/components/SearchBar/SearchBar.test.tsx +0 -435
  172. package/src/components/SearchBar/SearchBar.tsx +0 -210
  173. package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +0 -1049
  174. package/src/components/Select/Select.stories.mdx +0 -439
  175. package/src/components/Select/Select.test.tsx +0 -358
  176. package/src/components/Select/Select.tsx +0 -183
  177. package/src/components/Select/__snapshots__/Select.test.tsx.snap +0 -895
  178. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +0 -142
  179. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +0 -116
  180. package/src/components/SkeletonLoader/SkeletonLoader.tsx +0 -123
  181. package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +0 -898
  182. package/src/components/SkipNavigation/SkipNavigation.stories.mdx +0 -90
  183. package/src/components/SkipNavigation/SkipNavigation.test.tsx +0 -63
  184. package/src/components/SkipNavigation/SkipNavigation.tsx +0 -51
  185. package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +0 -130
  186. package/src/components/Slider/Slider.stories.mdx +0 -628
  187. package/src/components/Slider/Slider.test.tsx +0 -736
  188. package/src/components/Slider/Slider.tsx +0 -322
  189. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +0 -2186
  190. package/src/components/StatusBadge/StatusBadge.stories.mdx +0 -109
  191. package/src/components/StatusBadge/StatusBadge.test.tsx +0 -70
  192. package/src/components/StatusBadge/StatusBadge.tsx +0 -35
  193. package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +0 -47
  194. package/src/components/StructuredContent/StructuredContent.stories.mdx +0 -567
  195. package/src/components/StructuredContent/StructuredContent.test.tsx +0 -435
  196. package/src/components/StructuredContent/StructuredContent.tsx +0 -139
  197. package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +0 -368
  198. package/src/components/StyleGuide/Bidirectionality.stories.mdx +0 -206
  199. package/src/components/StyleGuide/Breakpoints.stories.mdx +0 -55
  200. package/src/components/StyleGuide/Buttons.stories.mdx +0 -194
  201. package/src/components/StyleGuide/ColorCard.tsx +0 -43
  202. package/src/components/StyleGuide/Colors.stories.mdx +0 -201
  203. package/src/components/StyleGuide/DesignTokens.stories.mdx +0 -193
  204. package/src/components/StyleGuide/Forms.stories.mdx +0 -94
  205. package/src/components/StyleGuide/Iconography.stories.mdx +0 -142
  206. package/src/components/StyleGuide/Spacing.stories.mdx +0 -116
  207. package/src/components/StyleGuide/Typography.stories.mdx +0 -419
  208. package/src/components/Table/Table.stories.mdx +0 -272
  209. package/src/components/Table/Table.test.tsx +0 -241
  210. package/src/components/Table/Table.tsx +0 -152
  211. package/src/components/Table/__snapshots__/Table.test.tsx.snap +0 -1703
  212. package/src/components/Tabs/Tabs.stories.mdx +0 -338
  213. package/src/components/Tabs/Tabs.test.tsx +0 -298
  214. package/src/components/Tabs/Tabs.tsx +0 -264
  215. package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +0 -584
  216. package/src/components/Template/Template.stories.mdx +0 -695
  217. package/src/components/Template/Template.test.tsx +0 -309
  218. package/src/components/Template/Template.tsx +0 -326
  219. package/src/components/Template/__snapshots__/Template.test.tsx.snap +0 -342
  220. package/src/components/Text/Text.stories.mdx +0 -103
  221. package/src/components/Text/Text.test.tsx +0 -63
  222. package/src/components/Text/Text.tsx +0 -50
  223. package/src/components/Text/__snapshots__/Text.test.tsx.snap +0 -50
  224. package/src/components/TextInput/TextInput.stories.mdx +0 -268
  225. package/src/components/TextInput/TextInput.test.tsx +0 -451
  226. package/src/components/TextInput/TextInput.tsx +0 -240
  227. package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +0 -274
  228. package/src/components/Toggle/Toggle.stories.mdx +0 -237
  229. package/src/components/Toggle/Toggle.test.tsx +0 -170
  230. package/src/components/Toggle/Toggle.tsx +0 -128
  231. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +0 -470
  232. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +0 -212
  233. package/src/components/VideoPlayer/VideoPlayer.test.tsx +0 -308
  234. package/src/components/VideoPlayer/VideoPlayer.tsx +0 -188
  235. package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +0 -192
  236. package/src/docs/Chakra.stories.mdx +0 -563
  237. package/src/docs/Welcome.stories.mdx +0 -148
  238. package/src/helpers/types.ts +0 -1
  239. package/src/hooks/tests/useCarouselStyles.test.ts +0 -140
  240. package/src/hooks/tests/useNYPLTheme.test.tsx +0 -36
  241. package/src/hooks/useCarouselStyles.stories.mdx +0 -30
  242. package/src/hooks/useCarouselStyles.ts +0 -35
  243. package/src/hooks/useNYPLTheme.stories.mdx +0 -98
  244. package/src/hooks/useNYPLTheme.ts +0 -91
  245. package/src/hooks/useWindowSize.stories.mdx +0 -23
  246. package/src/hooks/useWindowSize.ts +0 -40
  247. package/src/index.ts +0 -136
  248. package/src/resources.scss +0 -6
  249. package/src/styles/base/_01-breakpoints.scss +0 -27
  250. package/src/styles/base/_02-mixins.scss +0 -103
  251. package/src/styles/base/_place-holder.scss +0 -33
  252. package/src/styles/space/_space-inline.scss +0 -79
  253. package/src/styles/space/_space-inset.scss +0 -57
  254. package/src/styles/space/_space-stack.scss +0 -116
  255. package/src/styles.scss +0 -23
  256. package/src/theme/components/accordion.ts +0 -25
  257. package/src/theme/components/breadcrumb.ts +0 -94
  258. package/src/theme/components/button.ts +0 -133
  259. package/src/theme/components/buttonGroup.ts +0 -10
  260. package/src/theme/components/card.ts +0 -237
  261. package/src/theme/components/checkbox.ts +0 -110
  262. package/src/theme/components/checkboxGroup.ts +0 -10
  263. package/src/theme/components/componentWrapper.ts +0 -14
  264. package/src/theme/components/customTable.ts +0 -77
  265. package/src/theme/components/datePicker.ts +0 -17
  266. package/src/theme/components/fieldset.ts +0 -23
  267. package/src/theme/components/global.ts +0 -91
  268. package/src/theme/components/globalMixins.ts +0 -24
  269. package/src/theme/components/heading.ts +0 -79
  270. package/src/theme/components/helperErrorText.ts +0 -14
  271. package/src/theme/components/hero.ts +0 -238
  272. package/src/theme/components/horizontalRule.ts +0 -17
  273. package/src/theme/components/icon.ts +0 -88
  274. package/src/theme/components/image.ts +0 -136
  275. package/src/theme/components/label.ts +0 -15
  276. package/src/theme/components/link.ts +0 -63
  277. package/src/theme/components/list.ts +0 -88
  278. package/src/theme/components/logo.ts +0 -58
  279. package/src/theme/components/notification.ts +0 -132
  280. package/src/theme/components/pagination.ts +0 -17
  281. package/src/theme/components/progressIndicator.ts +0 -67
  282. package/src/theme/components/radio.ts +0 -103
  283. package/src/theme/components/radioGroup.ts +0 -10
  284. package/src/theme/components/searchBar.ts +0 -19
  285. package/src/theme/components/select.ts +0 -72
  286. package/src/theme/components/skeletonLoader.ts +0 -113
  287. package/src/theme/components/skipNavigation.ts +0 -29
  288. package/src/theme/components/slider.ts +0 -95
  289. package/src/theme/components/statusBadge.ts +0 -26
  290. package/src/theme/components/structuredContent.ts +0 -149
  291. package/src/theme/components/tabs.ts +0 -109
  292. package/src/theme/components/template.ts +0 -114
  293. package/src/theme/components/text.ts +0 -38
  294. package/src/theme/components/textInput.ts +0 -65
  295. package/src/theme/components/toggle.ts +0 -109
  296. package/src/theme/components/videoPlayer.ts +0 -47
  297. package/src/theme/foundations/breakpoints.ts +0 -24
  298. package/src/theme/foundations/colors.ts +0 -212
  299. package/src/theme/foundations/global.ts +0 -43
  300. package/src/theme/foundations/radii.ts +0 -7
  301. package/src/theme/foundations/shadows.ts +0 -5
  302. package/src/theme/foundations/spacing.ts +0 -136
  303. package/src/theme/foundations/typography.ts +0 -107
  304. package/src/theme/index.ts +0 -131
  305. package/src/theme/provider.tsx +0 -9
  306. package/src/theme/types.ts +0 -1
  307. package/src/utils/componentCategories.ts +0 -152
  308. package/src/utils/interfaces.ts +0 -5
  309. package/src/utils/utils.ts +0 -84
@@ -1,1041 +0,0 @@
1
- import { action } from "@storybook/addon-actions";
2
- import {
3
- ArgsTable,
4
- Canvas,
5
- Description,
6
- Meta,
7
- Story,
8
- } from "@storybook/addon-docs";
9
- import { withDesign } from "storybook-addon-designs";
10
-
11
- import Button from "../Button/Button";
12
- import Card, { CardHeading, CardContent, CardActions } from "./Card";
13
- import Heading from "../Heading/Heading";
14
- import HorizontalRule from "../HorizontalRule/HorizontalRule";
15
- import Icon from "../Icons/Icon";
16
- import Image from "../Image/Image";
17
- import Link from "../Link/Link";
18
- import SimpleGrid from "../Grid/SimpleGrid";
19
- import { getCategory } from "../../utils/componentCategories";
20
- import DSProvider from "../../theme/provider";
21
-
22
- <Meta
23
- title={getCategory("Card")}
24
- component={Card}
25
- decorators={[withDesign]}
26
- parameters={{
27
- design: {
28
- type: "figma",
29
- url: "https://www.figma.com/file/qShodlfNCJHb8n03IFyApM/Main?node-id=36835%3A25747",
30
- },
31
- jest: ["Card.test.tsx"],
32
- }}
33
- argTypes={{
34
- backgroundColor: { control: { type: "color" } },
35
- className: { control: false },
36
- foregroundColor: { control: { type: "color" } },
37
- id: { control: false },
38
- imageProps: { disable: true },
39
- "imageProps.alt": {
40
- control: { type: "text" },
41
- table: { defaultValue: { summary: "" } },
42
- },
43
- "imageProps.aspectRatio": {
44
- table: { defaultValue: { summary: "square" } },
45
- },
46
- "imageProps.caption": { control: false },
47
- "imageProps.component": { control: false },
48
- "imageProps.credit": { control: false },
49
- "imageProps.isAtEnd": {
50
- table: { defaultValue: { summary: false } },
51
- },
52
- "imageProps.size": {
53
- table: { defaultValue: { summary: "default" } },
54
- },
55
- "imageProps.src": {
56
- table: { defaultValue: { summary: "" } },
57
- },
58
- isAlignedRightActions: {
59
- table: { defaultValue: { summary: false } },
60
- },
61
- isBordered: {
62
- table: { defaultValue: { summary: false } },
63
- },
64
- isCentered: {
65
- table: { defaultValue: { summary: false } },
66
- },
67
- layout: {
68
- table: { defaultValue: { summary: "column" } },
69
- },
70
- }}
71
- />
72
-
73
- # Card
74
-
75
- | Component Version | DS Version |
76
- | ----------------- | ---------- |
77
- | Added | `0.24.0` |
78
- | Latest | `1.0.2` |
79
-
80
- ## Table of Contents
81
-
82
- - [Overview](#overview)
83
- - [Component Props](#component-props)
84
- - [Accessibility](#accessibility)
85
- - [Image Position](#image-position)
86
- - [Image Size](#image-size)
87
- - [Custom Image Component](#custom-image-component)
88
- - [Card With Link Heading](#card-with-link-heading)
89
- - [Card With Full-Click Functionality](#card-with-full-click-functionality)
90
- - [Card with Right Side CardActions](#card-with-right-side-cardactions)
91
- - [Cards in a Grid](#cards-in-a-grid)
92
- - [Cards in a Stack](#cards-in-a-stack)
93
- - [Card Without Images](#card-without-images)
94
-
95
- ## Overview
96
-
97
- <Description of={Card} />
98
-
99
- The `Card` component is viewed as a contained, stand-alone element. It is highly
100
- configurable and composable. It can be shown with or without an image and the
101
- content area is composed using Card-specific child components: `CardHeading`,
102
- `CardActions` and `CardContent`. These child components can be arranged in any
103
- order and each child component may be used multiple times within the content
104
- area. Although a `Card` is a self-contained unit, `Card` components are often
105
- grouped together and displayed in some type of grid layout.
106
-
107
- ### CardHeading
108
-
109
- The `CardHeading` component mirrors the standard Reservoir Design System (DS)
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).
111
-
112
- ### CardActions
113
-
114
- The `CardActions` component is used to display "call to action" (CTA) buttons
115
- and links for the card. The DS `Button` and `Link` components should be passed
116
- as children into the `CardActions` component.
117
-
118
- Set the `isAlignedRightActions` prop to true in the `Card` component to align the
119
- `CardActions` to the right of the the main content area. This is only applicable
120
- in the row layout of the `Card` component.
121
-
122
- ### CardContent
123
-
124
- The `CardContent` component should be used to display all content other than
125
- headings and CTAs.
126
-
127
- ## Component Props
128
-
129
- <Canvas withToolbar>
130
- <Story
131
- name="Card with Controls"
132
- args={{
133
- backgroundColor: undefined,
134
- className: undefined,
135
- foregroundColor: undefined,
136
- id: "card-id",
137
- "imageProps.alt": "Alt text",
138
- "imageProps.aspectRatio": "square",
139
- "imageProps.component": undefined,
140
- "imageProps.isAtEnd": false,
141
- "imageProps.size": "default",
142
- "imageProps.src": "https://placeimg.com/400/300/animals",
143
- isAlignedRightActions: false,
144
- isBordered: false,
145
- isCentered: false,
146
- layout: "row",
147
- mainActionLink: undefined,
148
- }}
149
- >
150
- {(args) => (
151
- <Card
152
- backgroundColor={args.backgroundColor}
153
- className={args.className}
154
- foregroundColor={args.foregroundColor}
155
- id={args.id}
156
- imageProps={{
157
- alt: args["imageProps.alt"],
158
- aspectRatio: args["imageProps.aspectRatio"],
159
- component: args["imageProps.component"],
160
- isAtEnd: args["imageProps.isAtEnd"],
161
- size: args["imageProps.size"],
162
- src: args["imageProps.src"],
163
- }}
164
- isAlignedRightActions={args.isAlignedRightActions}
165
- isBordered={args.isBordered}
166
- isCentered={args.isCentered}
167
- layout={args.layout}
168
- mainActionLink={args.mainActionLink}
169
- >
170
- <CardHeading level="two" id="main-heading1">
171
- Optional Header
172
- </CardHeading>
173
- <CardHeading level="three" id="main-heading2">
174
- Sollicitudin Lorem Tortor Purus Ornare
175
- </CardHeading>
176
- <CardContent>
177
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
178
- libero, a pharetra augue. Nullam quis risus eget urna mollis ornare
179
- vel eu leo. Nulla vitae elit libero, a pharetra augue.
180
- </CardContent>
181
- <CardActions topBorder bottomBorder>
182
- <Button id="main-button1" onClick={action("clicked")} type="submit">
183
- Primary
184
- </Button>
185
- <Button
186
- buttonType="secondary"
187
- id="main-button2"
188
- onClick={action("clicked")}
189
- type="submit"
190
- >
191
- Secondary
192
- </Button>
193
- </CardActions>
194
- <CardActions>
195
- <Link href="#">#hash1</Link>,<Link href="#">#hash2</Link>,
196
- <Link href="#">#hash3</Link>
197
- </CardActions>
198
- </Card>
199
- )}
200
- </Story>
201
- </Canvas>
202
-
203
- <ArgsTable story="Card with Controls" />
204
-
205
- ## Accessibility
206
-
207
- ### Headings
208
-
209
- In general, headings from `h1` through `h6` must be in sequential order in the
210
- DOM tree. Rendering an `h4` following an `h2` will throw an accessibility error.
211
- Therefore, when adding `CardHeading` components, make sure to add them in
212
- sequential order with the proper `level` prop.
213
-
214
- ```tsx
215
- // Correct
216
- <CardHeading level="three" id="headingthree">
217
- Heading level three
218
- </CardHeading>
219
- <CardHeading level="four" id="headingfour">
220
- Heading level four
221
- </CardHeading>
222
-
223
- // Incorrect
224
- <CardHeading level="two" id="headingtwo">
225
- Heading level Two
226
- </CardHeading>
227
- <CardHeading level="four" id="headingfour">
228
- Heading level four
229
- </CardHeading>
230
- ```
231
-
232
- ### Full-Click Functionality
233
-
234
- Passing in a URL in the `mainActionLink` prop will make the entire `Card`
235
- clickable. Other links in the `CardActions` component can still be accessed by
236
- tabbing through and pressing "enter" or by clicking as you normally would on a
237
- link.
238
-
239
- ## Image Position
240
-
241
- By default, the image is always the first element within a `Card`. This means
242
- the image is at the top of a `Card` with a column layout and on the left side of
243
- a `Card` with a row layout. However, you can use the `imageProps.isAtEnd` boolean prop
244
- to override the default placement and move the image to the last element within
245
- a `Card`.
246
-
247
- ### Column Cards
248
-
249
- <Canvas>
250
- <Story name="Card Image Position">
251
- <SimpleGrid columns={2}>
252
- <Card
253
- imageProps={{
254
- alt: "Alt text",
255
- aspectRatio: "twoByOne",
256
- src: "https://placeimg.com/400/200/animals",
257
- }}
258
- >
259
- <CardHeading level="three" id="props-heading1">
260
- Image on Top (default)
261
- </CardHeading>
262
- <CardContent>
263
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
264
- libero, a pharetra augue.
265
- </CardContent>
266
- </Card>
267
- <Card
268
- imageProps={{
269
- alt: "Alt text",
270
- aspectRatio: "twoByOne",
271
- isAtEnd: true,
272
- src: "https://placeimg.com/400/200/animals",
273
- }}
274
- >
275
- <CardHeading level="three" id="props-heading2">
276
- Image on Bottom
277
- </CardHeading>
278
- <CardContent>
279
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
280
- libero, a pharetra augue.
281
- </CardContent>
282
- </Card>
283
- </SimpleGrid>
284
- </Story>
285
- </Canvas>
286
-
287
- ### Row Cards
288
-
289
- <Canvas>
290
- <DSProvider>
291
- <SimpleGrid columns={1}>
292
- <Card
293
- imageProps={{
294
- alt: "Alt text",
295
- aspectRatio: "twoByOne",
296
- src: "https://placeimg.com/400/200/animals",
297
- }}
298
- isCentered
299
- layout="row"
300
- >
301
- <CardHeading level="four" id="row-heading1">
302
- Image on Left (default)
303
- </CardHeading>
304
- <CardContent>
305
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
306
- Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
307
- facilisis in, egestas eget quam.
308
- </CardContent>
309
- </Card>
310
- <Card
311
- imageProps={{
312
- alt: "Alt text",
313
- aspectRatio: "twoByOne",
314
- isAtEnd: true,
315
- src: "https://placeimg.com/400/200/animals",
316
- }}
317
- isCentered
318
- layout="row"
319
- >
320
- <CardHeading level="four" id="row-heading2">
321
- Image on Right
322
- </CardHeading>
323
- <CardContent>
324
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
325
- Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
326
- facilisis in, egestas eget quam.
327
- </CardContent>
328
- </Card>
329
- </SimpleGrid>
330
- </DSProvider>
331
- </Canvas>
332
-
333
- ## Image Size
334
-
335
- By default, the image width is `100%` for a `Card` with a column layout and
336
- `225px` for a `Card` with a row layout. However, you can use the `imageProps.size`
337
- prop to override the default width.
338
-
339
- ### Column Cards
340
-
341
- <Canvas>
342
- <Story name="Card Image Size">
343
- <SimpleGrid columns={1}>
344
- <Card
345
- imageProps={{
346
- alt: "Alt text",
347
- aspectRatio: "square",
348
- size: "xxsmall",
349
- src: "https://placeimg.com/400/200/animals",
350
- }}
351
- isCentered
352
- >
353
- <CardHeading level="three" id="column-heading1">
354
- Extra Extra Small Image
355
- </CardHeading>
356
- <CardHeading level="four" id="column-heading2">
357
- Max-Width: 64px
358
- </CardHeading>
359
- <CardContent>
360
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
361
- libero, a pharetra augue.
362
- </CardContent>
363
- </Card>
364
- <HorizontalRule />
365
- <Card
366
- imageProps={{
367
- alt: "Alt text",
368
- aspectRatio: "square",
369
- size: "xsmall",
370
- src: "https://placeimg.com/400/200/animals",
371
- }}
372
- isCentered
373
- >
374
- <CardHeading level="three" id="column-heading1">
375
- Extra Small Image
376
- </CardHeading>
377
- <CardHeading level="four" id="column-heading2">
378
- Max-Width: 96px
379
- </CardHeading>
380
- <CardContent>
381
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
382
- libero, a pharetra augue.
383
- </CardContent>
384
- </Card>
385
- <HorizontalRule />
386
- <Card
387
- imageProps={{
388
- alt: "Alt text",
389
- aspectRatio: "square",
390
- size: "small",
391
- src: "https://placeimg.com/400/200/animals",
392
- }}
393
- isCentered
394
- >
395
- <CardHeading level="three" id="column-heading1">
396
- Small Image
397
- </CardHeading>
398
- <CardHeading level="four" id="column-heading2">
399
- Max-Width: 165px
400
- </CardHeading>
401
- <CardContent>
402
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
403
- libero, a pharetra augue.
404
- </CardContent>
405
- </Card>
406
- <HorizontalRule />
407
- <Card
408
- imageProps={{
409
- alt: "Alt text",
410
- aspectRatio: "square",
411
- size: "medium",
412
- src: "https://placeimg.com/400/200/animals",
413
- }}
414
- isCentered
415
- >
416
- <CardHeading level="three" id="column2-heading1">
417
- Medium Image
418
- </CardHeading>
419
- <CardHeading level="four" id="column2-heading2">
420
- Max-Width: 225px
421
- </CardHeading>
422
- <CardContent>
423
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
424
- libero, a pharetra augue.
425
- </CardContent>
426
- </Card>
427
- <HorizontalRule />
428
- <Card
429
- imageProps={{
430
- alt: "Alt text",
431
- aspectRatio: "square",
432
- size: "large",
433
- src: "https://placeimg.com/400/200/animals",
434
- }}
435
- isCentered
436
- >
437
- <CardHeading level="three" id="column3-heading1">
438
- Large Image
439
- </CardHeading>
440
- <CardHeading level="four" id="column3-heading2">
441
- Max-Width: 360px
442
- </CardHeading>
443
- <CardContent>
444
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
445
- libero, a pharetra augue.
446
- </CardContent>
447
- </Card>
448
- <HorizontalRule />
449
- <Card
450
- imageProps={{
451
- alt: "Alt text",
452
- aspectRatio: "square",
453
- src: "https://placeimg.com/400/200/animals",
454
- }}
455
- isCentered
456
- >
457
- <CardHeading level="three" id="column-4heading1">
458
- Default Image
459
- </CardHeading>
460
- <CardHeading level="four" id="column-4heading2">
461
- Width: 100%
462
- </CardHeading>
463
- <CardContent>
464
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
465
- libero, a pharetra augue.
466
- </CardContent>
467
- </Card>
468
- </SimpleGrid>
469
- </Story>
470
- </Canvas>
471
-
472
- ### Row Cards
473
-
474
- <Canvas>
475
- <DSProvider>
476
- <SimpleGrid columns={1}>
477
- <Card
478
- imageProps={{
479
- alt: "Alt text",
480
- aspectRatio: "twoByOne",
481
- size: "xxsmall",
482
- src: "https://placeimg.com/400/200/animals",
483
- }}
484
- isCentered
485
- layout="row"
486
- >
487
- <CardHeading level="three" id="row2-heading1">
488
- Extra Extra Small Image
489
- </CardHeading>
490
- <CardHeading level="four" id="row2-heading2">
491
- Max-Width: 64px
492
- </CardHeading>
493
- <CardContent>
494
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
495
- </CardContent>
496
- </Card>
497
- <Card
498
- imageProps={{
499
- alt: "Alt text",
500
- aspectRatio: "twoByOne",
501
- size: "xsmall",
502
- src: "https://placeimg.com/400/200/animals",
503
- }}
504
- isCentered
505
- layout="row"
506
- >
507
- <CardHeading level="three" id="row2-heading1">
508
- Extra Small Image
509
- </CardHeading>
510
- <CardHeading level="four" id="row2-heading2">
511
- Max-Width: 96px
512
- </CardHeading>
513
- <CardContent>
514
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
515
- </CardContent>
516
- </Card>
517
- <Card
518
- imageProps={{
519
- alt: "Alt text",
520
- aspectRatio: "twoByOne",
521
- size: "small",
522
- src: "https://placeimg.com/400/200/animals",
523
- }}
524
- isCentered
525
- layout="row"
526
- >
527
- <CardHeading level="three" id="row2-heading1">
528
- Small Image
529
- </CardHeading>
530
- <CardHeading level="four" id="row2-heading2">
531
- Max-Width: 165px
532
- </CardHeading>
533
- <CardContent>
534
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
535
- </CardContent>
536
- </Card>
537
- <Card
538
- imageProps={{
539
- alt: "Alt text",
540
- aspectRatio: "twoByOne",
541
- size: "medium",
542
- src: "https://placeimg.com/400/200/animals",
543
- }}
544
- isCentered
545
- layout="row"
546
- >
547
- <CardHeading level="three" id="row3-heading2">
548
- Medium Image
549
- </CardHeading>
550
- <CardHeading level="four" id="row3-heading2">
551
- Max-Width: 225px
552
- </CardHeading>
553
- <CardContent>
554
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
555
- Sed posuere consectetur est at lobortis.
556
- </CardContent>
557
- </Card>
558
- <Card
559
- imageProps={{
560
- alt: "Alt text",
561
- aspectRatio: "twoByOne",
562
- size: "large",
563
- src: "https://placeimg.com/400/200/animals",
564
- }}
565
- isCentered
566
- layout="row"
567
- >
568
- <CardHeading level="three" id="row4-heading1">
569
- Large Image
570
- </CardHeading>
571
- <CardHeading level="four" id="row4-heading2">
572
- Max-Width: 360px
573
- </CardHeading>
574
- <CardContent>
575
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
576
- Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
577
- facilisis in, egestas eget quam.
578
- </CardContent>
579
- </Card>
580
- <Card
581
- imageProps={{
582
- alt: "Alt text",
583
- aspectRatio: "twoByOne",
584
- src: "https://placeimg.com/400/200/animals",
585
- }}
586
- isCentered
587
- layout="row"
588
- >
589
- <CardHeading level="three" id="row5-heading2">
590
- Default Image
591
- </CardHeading>
592
- <CardHeading level="four" id="row5-heading2">
593
- Max-Width: 225px
594
- </CardHeading>
595
- <CardContent>
596
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
597
- Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
598
- facilisis in, egestas eget quam.
599
- </CardContent>
600
- </Card>
601
- </SimpleGrid>
602
- </DSProvider>
603
- </Canvas>
604
-
605
- ## Custom Image Component
606
-
607
- Instead of passing a path for the `imageProps.src` prop, you can pass a custom
608
- image component in using the `imageProps.component` prop.
609
-
610
- <Canvas withToolbar>
611
- <Story name="Custom Image Component">
612
- <Card
613
- imageProps={{
614
- alt: "Alt text",
615
- component: (
616
- <Image src="https://placeimg.com/400/400/animals" alt="Alt text" />
617
- ),
618
- }}
619
- >
620
- <CardHeading level="two" id="img1-heading1">
621
- Card Component with Custom Image Component
622
- </CardHeading>
623
- <CardHeading level="three" id="img2-heading2">
624
- Secondary Heading
625
- </CardHeading>
626
- <CardContent>
627
- Nulla vitae elit libero, a pharetra augue. Lorem ipsum dolor sit amet,
628
- consectetur adipiscing elit. Aenean lacinia bibendum nulla sed
629
- consectetur. Vestibulum id ligula porta felis euismod semper. Cras justo
630
- odio, dapibus ac facilisis in, egestas eget quam. Sed posuere
631
- consectetur est at lobortis.
632
- </CardContent>
633
- <CardActions>
634
- <Link type="button" href="#">
635
- Reserve
636
- </Link>
637
- <Link href="#url" type="forwards">
638
- View Book Details
639
- </Link>
640
- </CardActions>
641
- </Card>
642
- </Story>
643
- </Canvas>
644
-
645
- ## Card with Link Heading
646
-
647
- The `CardHeading` component works just like the DS `Heading` component. This
648
- means that a URL can be passed in the `url` prop for `CardHeading` or a `Link`
649
- component can be used as a child. Click on "Show code" in the example below to
650
- see both patterns.
651
-
652
- <Canvas>
653
- <Story name="Card With Link Heading">
654
- <Card
655
- imageProps={{
656
- alt: "Alt text",
657
- aspectRatio: "twoByOne",
658
- src: "https://placeimg.com/400/200/animals",
659
- }}
660
- >
661
- <CardHeading level="three" id="link-heading1" url="http://nypl.org">
662
- Go to NYPL home page.
663
- </CardHeading>
664
- <CardHeading level="four" id="link-heading2">
665
- <>
666
- Go to NYPL <Link href="http://nypl.org">home page</Link>.
667
- </>
668
- </CardHeading>
669
- <CardContent>
670
- This entire `Card` component is clickable, but the links below are still
671
- accessible by tabbing through the `Card` and pressing `enter` or
672
- clicking with a mouse.
673
- </CardContent>
674
- <CardActions>
675
- <Link href="#" type="button">
676
- Button
677
- </Link>
678
- <Link href="#" type="forwards">
679
- Other link
680
- </Link>
681
- </CardActions>
682
- </Card>
683
- </Story>
684
- </Canvas>
685
-
686
- ## Card With Full-Click Functionality
687
-
688
- To enable the full-click functionality in the `Card` component, pass a URL in
689
- the `mainActionLink` prop. This will make the entire `Card` component clickable.
690
- If the `Card` has action links or buttons, they can still be accessed by tabbing
691
- through the `Card` and pressing `enter` or clicking like a regular link.
692
-
693
- Internally, if multiple `CardHeading` components are passed, only the first one
694
- will have the full-click link. This, however, does not affect the `Card` itself
695
- from being having the full-click functionality.
696
-
697
- <Canvas>
698
- <Story name="Card With Full-Click Functionality">
699
- <SimpleGrid columns={2}>
700
- <Card
701
- imageProps={{
702
- alt: "Alt text",
703
- aspectRatio: "twoByOne",
704
- src: "https://placeimg.com/400/200/animals",
705
- }}
706
- mainActionLink="http://nypl.org"
707
- >
708
- <CardHeading level="three" id="fullclick1-heading1">
709
- Go to NYPL home page.
710
- </CardHeading>
711
- <CardHeading level="four" id="fullclick1-heading2">
712
- Some other heading.
713
- </CardHeading>
714
- <CardContent>
715
- This entire `Card` component is clickable, but the links below are
716
- still accessible by tabbing through the `Card` and pressing `enter` or
717
- clicking with a mouse.
718
- </CardContent>
719
- <CardActions>
720
- <Link href="#" type="button">
721
- Button
722
- </Link>
723
- <Link href="#" type="forwards">
724
- Other link
725
- </Link>
726
- </CardActions>
727
- </Card>
728
- <Card
729
- imageProps={{
730
- alt: "Alt text",
731
- aspectRatio: "twoByOne",
732
- isAtEnd: true,
733
- src: "https://placeimg.com/410/210/animals",
734
- }}
735
- mainActionLink="http://nypl.org"
736
- >
737
- <CardHeading level="three" id="fullclick2-heading1">
738
- Go to NYPL home page.
739
- </CardHeading>
740
- <CardContent>
741
- This `Card` component does not have any extra links.
742
- </CardContent>
743
- </Card>
744
- </SimpleGrid>
745
- </Story>
746
- </Canvas>
747
-
748
- ## Card with Right Side CardActions
749
-
750
- It's possible to set only the `CardActions` component on the right side of the
751
- main content area of the `Card`. This is possible only in the `layout="row"`
752
- layout and through the `Card` component's `isAlignedRightActions` prop which
753
- must be set to `true`.
754
-
755
- <Canvas>
756
- <Story name="Card with Right Side CardActions">
757
- <Card
758
- imageProps={{
759
- alt: "Alt text",
760
- aspectRatio: "twoByOne",
761
- size: "medium",
762
- src: "https://placeimg.com/400/200/animals",
763
- }}
764
- isAlignedRightActions
765
- isCentered
766
- layout="row"
767
- >
768
- <CardHeading level="two" id="main-heading1">
769
- Optional Header
770
- </CardHeading>
771
- <CardHeading level="three" id="main-heading2">
772
- Sollicitudin Lorem Tortor Purus Ornare
773
- </CardHeading>
774
- <CardContent>
775
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
776
- libero, a pharetra augue. Nullam quis risus eget urna mollis ornare vel
777
- eu leo. Nulla vitae elit libero, a pharetra augue.
778
- </CardContent>
779
- <CardActions topBorder bottomBorder>
780
- <Button onClick={action("clicked")} id="main-button1" type="submit">
781
- Primary
782
- </Button>
783
- <Button
784
- onClick={action("clicked")}
785
- id="main-button2"
786
- buttonType="secondary"
787
- type="submit"
788
- >
789
- Secondary
790
- </Button>
791
- </CardActions>
792
- <CardActions>
793
- <Link href="#">#hash1</Link>,<Link href="#">#hash2</Link>,
794
- <Link href="#">#hash3</Link>
795
- </CardActions>
796
- </Card>
797
- </Story>
798
- </Canvas>
799
-
800
- ## Cards in a Grid
801
-
802
- <Canvas>
803
- <Story name="Cards in a Grid">
804
- <SimpleGrid columns={3}>
805
- <Card
806
- imageProps={{
807
- alt: "Alt text",
808
- aspectRatio: "twoByOne",
809
- src: "https://placeimg.com/400/200/animals",
810
- }}
811
- >
812
- <CardHeading level="three" id="grid1-heading1">
813
- Card Heading
814
- </CardHeading>
815
- <CardContent>
816
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
817
- libero, a pharetra augue.
818
- </CardContent>
819
- </Card>
820
- <Card
821
- imageProps={{
822
- alt: "Alt text",
823
- aspectRatio: "twoByOne",
824
- src: "https://placeimg.com/410/210/animals",
825
- }}
826
- >
827
- <CardHeading level="three" id="grid2-heading1">
828
- Card Heading
829
- </CardHeading>
830
- <CardContent>
831
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
832
- libero, a pharetra augue.
833
- </CardContent>
834
- </Card>
835
- <Card
836
- imageProps={{
837
- alt: "Alt text",
838
- aspectRatio: "twoByOne",
839
- src: "https://placeimg.com/420/220/animals",
840
- }}
841
- >
842
- <CardHeading level="three" id="grid3-heading1">
843
- Card Heading
844
- </CardHeading>
845
- <CardContent>
846
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
847
- libero, a pharetra augue.
848
- </CardContent>
849
- </Card>
850
- <Card
851
- imageProps={{
852
- alt: "Alt text",
853
- aspectRatio: "twoByOne",
854
- src: "https://placeimg.com/430/230/animals",
855
- }}
856
- >
857
- <CardHeading level="three" id="grid4-heading1">
858
- Card Heading
859
- </CardHeading>
860
- <CardContent>
861
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
862
- libero, a pharetra augue.
863
- </CardContent>
864
- </Card>
865
- <Card
866
- imageProps={{
867
- alt: "Alt text",
868
- aspectRatio: "twoByOne",
869
- src: "https://placeimg.com/440/200/animals",
870
- }}
871
- >
872
- <CardHeading level="three" id="grid5-heading1">
873
- Card Heading
874
- </CardHeading>
875
- <CardContent>
876
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
877
- libero, a pharetra augue.
878
- </CardContent>
879
- </Card>
880
- <Card
881
- imageProps={{
882
- alt: "Alt text",
883
- aspectRatio: "twoByOne",
884
- src: "https://placeimg.com/450/200/animals",
885
- }}
886
- >
887
- <CardHeading level="three" id="grid6-heading1">
888
- Card Heading
889
- </CardHeading>
890
- <CardContent>
891
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
892
- libero, a pharetra augue.
893
- </CardContent>
894
- </Card>
895
- </SimpleGrid>
896
- </Story>
897
- </Canvas>
898
-
899
- ## Cards in a Stack
900
-
901
- <Canvas>
902
- <Story name="Cards in a Stack">
903
- <SimpleGrid columns={1}>
904
- <Card
905
- imageProps={{
906
- alt: "Alt text",
907
- aspectRatio: "twoByOne",
908
- src: "https://placeimg.com/400/200/animals",
909
- }}
910
- isCentered
911
- layout="row"
912
- >
913
- <CardHeading level="four" id="stack1-heading1">
914
- Card Heading
915
- </CardHeading>
916
- <CardContent>
917
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
918
- Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
919
- facilisis in, egestas eget quam.
920
- </CardContent>
921
- </Card>
922
- <Card
923
- imageProps={{
924
- alt: "Alt text",
925
- aspectRatio: "twoByOne",
926
- src: "https://placeimg.com/410/210/animals",
927
- }}
928
- isCentered
929
- layout="row"
930
- >
931
- <CardHeading level="four" id="stack2-heading2">
932
- Card Heading
933
- </CardHeading>
934
- <CardContent>
935
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
936
- Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
937
- facilisis in, egestas eget quam.
938
- </CardContent>
939
- </Card>
940
- <Card
941
- imageProps={{
942
- alt: "Alt text",
943
- aspectRatio: "twoByOne",
944
- src: "https://placeimg.com/420/220/animals",
945
- }}
946
- isCentered
947
- layout="row"
948
- >
949
- <CardHeading level="four" id="stack3-heading3">
950
- Card Heading
951
- </CardHeading>
952
- <CardContent>
953
- Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
954
- Sed posuere consectetur est at lobortis. Cras justo odio, dapibus ac
955
- facilisis in, egestas eget quam.
956
- </CardContent>
957
- </Card>
958
- </SimpleGrid>
959
- </Story>
960
- </Canvas>
961
-
962
- ## Cards Without Images
963
-
964
- <Canvas>
965
- <Story name="Cards Without Images">
966
- <SimpleGrid columns={3}>
967
- <Card isBordered>
968
- <CardHeading level="three" id="no-img1-heading1">
969
- Card Heading
970
- </CardHeading>
971
- <CardContent>
972
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
973
- libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue.
974
- Praesent commodo cursus magna, vel scelerisque nisl.
975
- </CardContent>
976
- </Card>
977
- <Card isBordered>
978
- <CardHeading level="three" id="no-img2-heading1">
979
- Card Heading
980
- </CardHeading>
981
- <CardContent>
982
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
983
- libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue.
984
- Praesent commodo cursus magna, vel scelerisque nisl.
985
- </CardContent>
986
- </Card>
987
- <Card isBordered>
988
- <CardHeading level="three" id="no-img3-heading1">
989
- Card Heading
990
- </CardHeading>
991
- <CardContent>
992
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
993
- libero, a pharetra augue. Nulla vitae elit libero, a pharetra augue.
994
- Praesent commodo cursus magna, vel scelerisque nisl.
995
- </CardContent>
996
- </Card>
997
- </SimpleGrid>
998
- <br />
999
- <SimpleGrid columns={1}>
1000
- <Card layout="row" isBordered>
1001
- <CardHeading level="three" id="no-img4-heading1">
1002
- Card Heading
1003
- </CardHeading>
1004
- <CardContent>
1005
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
1006
- libero, a pharetra augue. Vestibulum id ligula porta felis euismod
1007
- semper. Nulla vitae elit libero, a pharetra augue. Nulla vitae elit
1008
- libero, a pharetra augue. Praesent commodo cursus magna, vel
1009
- scelerisque nisl consectetur et. Donec id elit non mi porta gravida at
1010
- eget metus.
1011
- </CardContent>
1012
- </Card>
1013
- <Card layout="row" isBordered>
1014
- <CardHeading level="three" id="no-img5-heading1">
1015
- Card Heading
1016
- </CardHeading>
1017
- <CardContent>
1018
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
1019
- libero, a pharetra augue. Vestibulum id ligula porta felis euismod
1020
- semper. Nulla vitae elit libero, a pharetra augue. Nulla vitae elit
1021
- libero, a pharetra augue. Praesent commodo cursus magna, vel
1022
- scelerisque nisl consectetur et. Donec id elit non mi porta gravida at
1023
- eget metus.
1024
- </CardContent>
1025
- </Card>
1026
- <Card layout="row" isBordered>
1027
- <CardHeading level="three" id="no-img6-heading1">
1028
- Card Heading
1029
- </CardHeading>
1030
- <CardContent>
1031
- Vestibulum id ligula porta felis euismod semper. Nulla vitae elit
1032
- libero, a pharetra augue. Vestibulum id ligula porta felis euismod
1033
- semper. Nulla vitae elit libero, a pharetra augue. Nulla vitae elit
1034
- libero, a pharetra augue. Praesent commodo cursus magna, vel
1035
- scelerisque nisl consectetur et. Donec id elit non mi porta gravida at
1036
- eget metus.
1037
- </CardContent>
1038
- </Card>
1039
- </SimpleGrid>
1040
- </Story>
1041
- </Canvas>