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