@nypl/design-system-react-components 0.26.1 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (307) hide show
  1. package/CHANGELOG.md +54 -0
  2. package/README.md +7 -7
  3. package/dist/components/Accordion/Accordion.d.ts +1 -1
  4. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -5
  5. package/dist/components/Button/Button.d.ts +2 -10
  6. package/dist/components/ButtonGroup/ButtonGroup.d.ts +22 -0
  7. package/dist/components/Card/Card.d.ts +2 -2
  8. package/dist/components/Checkbox/Checkbox.d.ts +10 -8
  9. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  10. package/dist/components/DatePicker/DatePicker.d.ts +1 -1
  11. package/dist/components/Form/Form.d.ts +2 -2
  12. package/dist/components/Grid/SimpleGrid.d.ts +6 -3
  13. package/dist/components/Heading/Heading.d.ts +2 -5
  14. package/dist/components/HelperErrorText/HelperErrorText.d.ts +1 -5
  15. package/dist/components/Hero/Hero.d.ts +13 -9
  16. package/dist/components/Icons/Icon.d.ts +6 -5
  17. package/dist/components/Icons/IconSvgs.d.ts +21 -21
  18. package/dist/components/Image/Image.d.ts +8 -5
  19. package/dist/components/Link/Link.d.ts +1 -9
  20. package/dist/components/List/List.d.ts +7 -11
  21. package/dist/components/Logo/Logo.d.ts +2 -5
  22. package/dist/components/Logo/LogoSvgs.d.ts +39 -39
  23. package/dist/components/Modal/Modal.d.ts +28 -8
  24. package/dist/components/Notification/Notification.d.ts +1 -1
  25. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
  26. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  27. package/dist/components/SearchBar/SearchBar.d.ts +3 -2
  28. package/dist/components/Select/Select.d.ts +2 -5
  29. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -4
  30. package/dist/components/SkipNavigation/SkipNavigation.d.ts +17 -0
  31. package/dist/components/StatusBadge/StatusBadge.d.ts +2 -3
  32. package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
  33. package/dist/components/Table/Table.d.ts +1 -1
  34. package/dist/components/Template/Template.d.ts +2 -0
  35. package/dist/components/Text/Text.d.ts +1 -1
  36. package/dist/components/TextInput/TextInput.d.ts +21 -9
  37. package/dist/components/Toggle/Toggle.d.ts +1 -5
  38. package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
  39. package/dist/design-system-react-components.cjs.development.js +983 -1222
  40. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  41. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  42. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  43. package/dist/design-system-react-components.esm.js +982 -1285
  44. package/dist/design-system-react-components.esm.js.map +1 -1
  45. package/dist/helpers/types.d.ts +1 -0
  46. package/dist/index.d.ts +27 -48
  47. package/dist/styles.css +1 -1
  48. package/dist/theme/components/buttonGroup.d.ts +11 -0
  49. package/dist/theme/components/card.d.ts +104 -8
  50. package/dist/theme/components/componentWrapper.d.ts +4 -3
  51. package/dist/theme/components/customTable.d.ts +11 -14
  52. package/dist/theme/components/fieldset.d.ts +4 -3
  53. package/dist/theme/components/helperErrorText.d.ts +4 -3
  54. package/dist/theme/components/hero.d.ts +1 -1
  55. package/dist/theme/components/horizontalRule.d.ts +4 -3
  56. package/dist/theme/components/icon.d.ts +47743 -1
  57. package/dist/theme/components/image.d.ts +563 -10
  58. package/dist/theme/components/label.d.ts +4 -3
  59. package/dist/theme/components/list.d.ts +6 -7
  60. package/dist/theme/components/logo.d.ts +474 -1
  61. package/dist/theme/components/notification.d.ts +20 -16
  62. package/dist/theme/components/progressIndicator.d.ts +6 -4
  63. package/dist/theme/components/select.d.ts +4 -10
  64. package/dist/theme/components/skeletonLoader.d.ts +14 -10
  65. package/dist/theme/components/skipNavigation.d.ts +22 -0
  66. package/dist/theme/components/slider.d.ts +7 -6
  67. package/dist/theme/components/structuredContent.d.ts +10 -9
  68. package/dist/theme/components/text.d.ts +7 -1
  69. package/dist/theme/components/toggle.d.ts +6 -4
  70. package/dist/theme/provider.d.ts +2 -4
  71. package/dist/utils/componentCategories.d.ts +1 -1
  72. package/dist/utils/interfaces.d.ts +5 -0
  73. package/dist/utils/utils.d.ts +2 -18
  74. package/package.json +15 -16
  75. package/src/__tests__/setup.ts +3 -3
  76. package/src/__tests__/utils/utils.test.ts +1 -23
  77. package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +22 -14
  78. package/src/components/Accordion/Accordion.stories.mdx +43 -44
  79. package/src/components/Accordion/Accordion.test.tsx +5 -13
  80. package/src/components/Accordion/Accordion.tsx +14 -18
  81. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +6 -6
  82. package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
  83. package/src/components/Autosuggest/Autosuggest.stories.tsx +23 -25
  84. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -37
  85. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +4 -17
  86. package/src/components/Breadcrumbs/Breadcrumbs.tsx +18 -21
  87. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +1 -100
  88. package/src/components/Button/Button.stories.mdx +89 -126
  89. package/src/components/Button/Button.test.tsx +16 -30
  90. package/src/components/Button/Button.tsx +14 -20
  91. package/src/components/ButtonGroup/ButtonGroup.stories.mdx +147 -0
  92. package/src/components/ButtonGroup/ButtonGroup.test.tsx +141 -0
  93. package/src/components/ButtonGroup/ButtonGroup.tsx +99 -0
  94. package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +117 -0
  95. package/src/components/Card/Card.stories.mdx +144 -178
  96. package/src/components/Card/Card.test.tsx +36 -97
  97. package/src/components/Card/Card.tsx +78 -74
  98. package/src/components/Chakra/Box.stories.mdx +3 -7
  99. package/src/components/Chakra/Center.stories.mdx +6 -24
  100. package/src/components/Chakra/Flex.stories.mdx +5 -7
  101. package/src/components/Chakra/Grid.stories.mdx +1 -1
  102. package/src/components/Chakra/Stack.stories.mdx +10 -11
  103. package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
  104. package/src/components/Checkbox/Checkbox.test.tsx +2 -2
  105. package/src/components/Checkbox/Checkbox.tsx +20 -13
  106. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +6 -17
  107. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +1 -7
  108. package/src/components/CheckboxGroup/CheckboxGroup.tsx +33 -29
  109. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +0 -11
  110. package/src/components/ComponentWrapper/ComponentWrapper.tsx +3 -10
  111. package/src/components/DatePicker/DatePicker.stories.mdx +23 -37
  112. package/src/components/DatePicker/DatePicker.test.tsx +21 -19
  113. package/src/components/DatePicker/DatePicker.tsx +57 -49
  114. package/src/components/Form/Form.stories.mdx +46 -31
  115. package/src/components/Form/Form.test.tsx +1 -18
  116. package/src/components/Form/Form.tsx +7 -7
  117. package/src/components/Grid/SimpleGrid.stories.mdx +73 -49
  118. package/src/components/Grid/SimpleGrid.test.tsx +7 -9
  119. package/src/components/Grid/SimpleGrid.tsx +14 -11
  120. package/src/components/Heading/Heading.stories.mdx +27 -72
  121. package/src/components/Heading/Heading.test.tsx +18 -44
  122. package/src/components/Heading/Heading.tsx +7 -10
  123. package/src/components/HelperErrorText/HelperErrorText.stories.mdx +1 -3
  124. package/src/components/HelperErrorText/HelperErrorText.tsx +1 -5
  125. package/src/components/Hero/Hero.stories.mdx +219 -216
  126. package/src/components/Hero/Hero.test.tsx +107 -223
  127. package/src/components/Hero/Hero.tsx +63 -61
  128. package/src/components/Icons/Icon.stories.mdx +172 -118
  129. package/src/components/Icons/Icon.test.tsx +8 -16
  130. package/src/components/Icons/Icon.tsx +75 -29
  131. package/src/components/Icons/IconSvgs.tsx +42 -42
  132. package/src/components/Image/Image.stories.mdx +45 -132
  133. package/src/components/Image/Image.test.tsx +16 -31
  134. package/src/components/Image/Image.tsx +28 -12
  135. package/src/components/Link/Link.stories.mdx +30 -94
  136. package/src/components/Link/Link.test.tsx +25 -75
  137. package/src/components/Link/Link.tsx +43 -56
  138. package/src/components/Link/__snapshots__/Link.test.tsx.snap +1 -2
  139. package/src/components/List/List.stories.mdx +20 -31
  140. package/src/components/List/List.test.tsx +24 -43
  141. package/src/components/List/List.tsx +25 -36
  142. package/src/components/Logo/Logo.stories.mdx +94 -50
  143. package/src/components/Logo/Logo.test.tsx +10 -19
  144. package/src/components/Logo/Logo.tsx +50 -17
  145. package/src/components/Logo/LogoSvgs.tsx +78 -78
  146. package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +4 -4
  147. package/src/components/Modal/Modal.stories.mdx +245 -139
  148. package/src/components/Modal/Modal.test.tsx +147 -10
  149. package/src/components/Modal/Modal.tsx +140 -20
  150. package/src/components/Modal/__snapshots__/Modal.test.tsx.snap +25 -0
  151. package/src/components/Notification/Notification.stories.mdx +10 -28
  152. package/src/components/Notification/Notification.test.tsx +9 -12
  153. package/src/components/Notification/Notification.tsx +34 -37
  154. package/src/components/Pagination/Pagination.stories.mdx +3 -4
  155. package/src/components/Pagination/Pagination.tsx +15 -10
  156. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +27 -53
  157. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +9 -10
  158. package/src/components/ProgressIndicator/ProgressIndicator.tsx +17 -21
  159. package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +0 -10
  160. package/src/components/Radio/Radio.stories.mdx +1 -1
  161. package/src/components/Radio/Radio.tsx +9 -6
  162. package/src/components/RadioGroup/RadioGroup.stories.mdx +15 -16
  163. package/src/components/RadioGroup/RadioGroup.test.tsx +2 -8
  164. package/src/components/RadioGroup/RadioGroup.tsx +28 -24
  165. package/src/components/SearchBar/SearchBar.stories.mdx +4 -4
  166. package/src/components/SearchBar/SearchBar.test.tsx +1 -1
  167. package/src/components/SearchBar/SearchBar.tsx +14 -22
  168. package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +1 -13
  169. package/src/components/Select/Select.stories.mdx +10 -25
  170. package/src/components/Select/Select.test.tsx +6 -7
  171. package/src/components/Select/Select.tsx +28 -35
  172. package/src/components/Select/__snapshots__/Select.test.tsx.snap +24 -24
  173. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +17 -56
  174. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -21
  175. package/src/components/SkeletonLoader/SkeletonLoader.tsx +9 -8
  176. package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +33 -33
  177. package/src/components/SkipNavigation/SkipNavigation.stories.mdx +90 -0
  178. package/src/components/SkipNavigation/SkipNavigation.test.tsx +63 -0
  179. package/src/components/SkipNavigation/SkipNavigation.tsx +51 -0
  180. package/src/components/SkipNavigation/__snapshots__/SkipNavigation.test.tsx.snap +130 -0
  181. package/src/components/Slider/Slider.stories.mdx +19 -53
  182. package/src/components/Slider/Slider.test.tsx +2 -2
  183. package/src/components/Slider/Slider.tsx +10 -12
  184. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +2 -9
  185. package/src/components/StatusBadge/StatusBadge.stories.mdx +6 -21
  186. package/src/components/StatusBadge/StatusBadge.test.tsx +2 -3
  187. package/src/components/StatusBadge/StatusBadge.tsx +3 -10
  188. package/src/components/StructuredContent/StructuredContent.stories.mdx +30 -58
  189. package/src/components/StructuredContent/StructuredContent.test.tsx +42 -44
  190. package/src/components/StructuredContent/StructuredContent.tsx +9 -18
  191. package/src/components/StyleGuide/Bidirectionality.stories.mdx +9 -23
  192. package/src/components/StyleGuide/Buttons.stories.mdx +63 -63
  193. package/src/components/StyleGuide/ColorCard.tsx +2 -4
  194. package/src/components/StyleGuide/Colors.stories.mdx +9 -10
  195. package/src/components/StyleGuide/DesignTokens.stories.mdx +5 -7
  196. package/src/components/StyleGuide/Forms.stories.mdx +2 -2
  197. package/src/components/StyleGuide/Iconography.stories.mdx +60 -78
  198. package/src/components/StyleGuide/Spacing.stories.mdx +1 -2
  199. package/src/components/StyleGuide/Typography.stories.mdx +16 -19
  200. package/src/components/Table/Table.stories.mdx +85 -1
  201. package/src/components/Table/Table.test.tsx +57 -1
  202. package/src/components/Table/Table.tsx +7 -4
  203. package/src/components/Table/__snapshots__/Table.test.tsx.snap +121 -0
  204. package/src/components/Tabs/Tabs.stories.mdx +1 -1
  205. package/src/components/Tabs/Tabs.test.tsx +2 -2
  206. package/src/components/Tabs/Tabs.tsx +26 -27
  207. package/src/components/Template/Template.stories.mdx +49 -54
  208. package/src/components/Template/Template.tsx +9 -3
  209. package/src/components/Text/Text.stories.mdx +5 -11
  210. package/src/components/Text/Text.test.tsx +3 -6
  211. package/src/components/Text/Text.tsx +3 -5
  212. package/src/components/TextInput/TextInput.stories.mdx +10 -22
  213. package/src/components/TextInput/TextInput.test.tsx +32 -62
  214. package/src/components/TextInput/TextInput.tsx +61 -30
  215. package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +1 -0
  216. package/src/components/Toggle/Toggle.stories.mdx +5 -16
  217. package/src/components/Toggle/Toggle.test.tsx +2 -3
  218. package/src/components/Toggle/Toggle.tsx +9 -10
  219. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +13 -29
  220. package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -23
  221. package/src/components/VideoPlayer/VideoPlayer.tsx +13 -10
  222. package/src/docs/Chakra.stories.mdx +14 -11
  223. package/src/docs/Welcome.stories.mdx +23 -43
  224. package/src/helpers/types.ts +1 -0
  225. package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
  226. package/src/hooks/useNYPLTheme.stories.mdx +3 -6
  227. package/src/index.ts +52 -46
  228. package/src/styles.scss +0 -1
  229. package/src/theme/components/buttonGroup.ts +10 -0
  230. package/src/theme/components/card.ts +50 -15
  231. package/src/theme/components/componentWrapper.ts +5 -1
  232. package/src/theme/components/customTable.ts +8 -2
  233. package/src/theme/components/fieldset.ts +5 -1
  234. package/src/theme/components/helperErrorText.ts +5 -1
  235. package/src/theme/components/hero.ts +2 -2
  236. package/src/theme/components/horizontalRule.ts +5 -1
  237. package/src/theme/components/icon.ts +7 -1
  238. package/src/theme/components/image.ts +14 -3
  239. package/src/theme/components/label.ts +5 -1
  240. package/src/theme/components/list.ts +8 -2
  241. package/src/theme/components/logo.ts +5 -1
  242. package/src/theme/components/notification.ts +38 -14
  243. package/src/theme/components/progressIndicator.ts +10 -5
  244. package/src/theme/components/select.ts +5 -6
  245. package/src/theme/components/skeletonLoader.ts +8 -2
  246. package/src/theme/components/skipNavigation.ts +26 -0
  247. package/src/theme/components/slider.ts +13 -1
  248. package/src/theme/components/structuredContent.ts +11 -1
  249. package/src/theme/components/text.ts +12 -5
  250. package/src/theme/components/toggle.ts +9 -3
  251. package/src/theme/foundations/colors.ts +6 -9
  252. package/src/theme/index.ts +4 -0
  253. package/src/theme/provider.tsx +1 -1
  254. package/src/utils/componentCategories.ts +13 -5
  255. package/src/utils/interfaces.ts +5 -0
  256. package/src/utils/utils.ts +2 -32
  257. package/dist/components/Accordion/AccordionTypes.d.ts +0 -5
  258. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +0 -8
  259. package/dist/components/Button/ButtonTypes.d.ts +0 -8
  260. package/dist/components/DatePicker/DatePickerTypes.d.ts +0 -5
  261. package/dist/components/Form/FormTypes.d.ts +0 -2
  262. package/dist/components/Grid/GridTypes.d.ts +0 -9
  263. package/dist/components/Heading/HeadingTypes.d.ts +0 -14
  264. package/dist/components/Hero/HeroTypes.d.ts +0 -12
  265. package/dist/components/Icons/IconTypes.d.ts +0 -77
  266. package/dist/components/Image/ImageTypes.d.ts +0 -22
  267. package/dist/components/Link/LinkTypes.d.ts +0 -8
  268. package/dist/components/List/ListTypes.d.ts +0 -5
  269. package/dist/components/Logo/LogoTypes.d.ts +0 -54
  270. package/dist/components/Notification/NotificationTypes.d.ts +0 -5
  271. package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +0 -8
  272. package/dist/components/Select/SelectTypes.d.ts +0 -8
  273. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -5
  274. package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +0 -5
  275. package/dist/components/StructuredContent/StructuredContentTypes.d.ts +0 -5
  276. package/dist/components/Text/TextTypes.d.ts +0 -6
  277. package/dist/components/TextInput/TextInputTypes.d.ts +0 -25
  278. package/dist/components/Toggle/ToggleTypes.d.ts +0 -4
  279. package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +0 -9
  280. package/dist/helpers/enums.d.ts +0 -4
  281. package/dist/utils/siteSections.d.ts +0 -2
  282. package/src/components/Accordion/AccordionTypes.tsx +0 -5
  283. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +0 -8
  284. package/src/components/Button/ButtonTypes.tsx +0 -8
  285. package/src/components/DatePicker/DatePickerTypes.tsx +0 -5
  286. package/src/components/Form/FormTypes.tsx +0 -3
  287. package/src/components/Grid/GridTypes.tsx +0 -9
  288. package/src/components/Heading/HeadingTypes.tsx +0 -15
  289. package/src/components/Hero/HeroTypes.tsx +0 -20
  290. package/src/components/Icons/IconTypes.tsx +0 -83
  291. package/src/components/Image/ImageTypes.ts +0 -24
  292. package/src/components/Link/LinkTypes.tsx +0 -8
  293. package/src/components/List/ListTypes.tsx +0 -5
  294. package/src/components/Logo/LogoTypes.tsx +0 -56
  295. package/src/components/Modal/_Modal.scss +0 -18
  296. package/src/components/Notification/NotificationTypes.tsx +0 -5
  297. package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +0 -8
  298. package/src/components/Select/SelectTypes.tsx +0 -10
  299. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
  300. package/src/components/StatusBadge/StatusBadgeTypes.tsx +0 -5
  301. package/src/components/StructuredContent/StructuredContentTypes.tsx +0 -5
  302. package/src/components/Text/TextTypes.tsx +0 -6
  303. package/src/components/TextInput/TextInputTypes.tsx +0 -48
  304. package/src/components/Toggle/ToggleTypes.tsx +0 -4
  305. package/src/components/VideoPlayer/VideoPlayerTypes.tsx +0 -10
  306. package/src/helpers/enums.ts +0 -4
  307. package/src/utils/siteSections.ts +0 -10
@@ -4,7 +4,6 @@ import { axe } from "jest-axe";
4
4
  import renderer from "react-test-renderer";
5
5
 
6
6
  import Image from "./Image";
7
- import { ImageRatios, ImageSizes, ImageTypes } from "./ImageTypes";
8
7
 
9
8
  describe("Image Accessibility", () => {
10
9
  it("passes axe accessibility for regular img element", async () => {
@@ -76,66 +75,52 @@ describe("Image", () => {
76
75
  .create(<Image src="test.png" alt="" caption="Caption" credit="Credit" />)
77
76
  .toJSON();
78
77
  const sizeExtraExtraSmall = renderer
79
- .create(<Image src="test.png" alt="" size={ImageSizes.ExtraExtraSmall} />)
78
+ .create(<Image src="test.png" alt="" size="xxsmall" />)
80
79
  .toJSON();
81
80
  const sizeExtraSmall = renderer
82
- .create(<Image src="test.png" alt="" size={ImageSizes.ExtraSmall} />)
81
+ .create(<Image src="test.png" alt="" size="xsmall" />)
83
82
  .toJSON();
84
83
  const sizeSmall = renderer
85
- .create(<Image src="test.png" alt="" size={ImageSizes.Small} />)
84
+ .create(<Image src="test.png" alt="" size="small" />)
86
85
  .toJSON();
87
86
  const sizeMedium = renderer
88
- .create(<Image src="test.png" alt="" size={ImageSizes.Medium} />)
87
+ .create(<Image src="test.png" alt="" size="medium" />)
89
88
  .toJSON();
90
89
  const sizeLarge = renderer
91
- .create(<Image src="test.png" alt="" size={ImageSizes.Large} />)
90
+ .create(<Image src="test.png" alt="" size="large" />)
92
91
  .toJSON();
93
92
  const ratioFourByThree = renderer
94
- .create(
95
- <Image src="test.png" alt="" aspectRatio={ImageRatios.FourByThree} />
96
- )
93
+ .create(<Image src="test.png" alt="" aspectRatio="fourByThree" />)
97
94
  .toJSON();
98
95
  const ratioOneByTwo = renderer
99
- .create(
100
- <Image src="test.png" alt="" aspectRatio={ImageRatios.OneByTwo} />
101
- )
96
+ .create(<Image src="test.png" alt="" aspectRatio="oneByTwo" />)
102
97
  .toJSON();
103
98
  const ratioOriginal = renderer
104
- .create(
105
- <Image src="test.png" alt="" aspectRatio={ImageRatios.Original} />
106
- )
99
+ .create(<Image src="test.png" alt="" aspectRatio="original" />)
107
100
  .toJSON();
108
101
  const ratioSixteenByNine = renderer
109
- .create(
110
- <Image src="test.png" alt="" aspectRatio={ImageRatios.SixteenByNine} />
111
- )
102
+ .create(<Image src="test.png" alt="" aspectRatio="sixteenByNine" />)
112
103
  .toJSON();
113
104
  const ratioSquare = renderer
114
- .create(<Image src="test.png" alt="" aspectRatio={ImageRatios.Square} />)
105
+ .create(<Image src="test.png" alt="" aspectRatio="square" />)
115
106
  .toJSON();
116
107
  const ratioThreeByFour = renderer
117
- .create(
118
- <Image src="test.png" alt="" aspectRatio={ImageRatios.ThreeByFour} />
119
- )
108
+ .create(<Image src="test.png" alt="" aspectRatio="threeByFour" />)
120
109
  .toJSON();
121
110
  const ratioThreeByTwo = renderer
122
- .create(
123
- <Image src="test.png" alt="" aspectRatio={ImageRatios.ThreeByTwo} />
124
- )
111
+ .create(<Image src="test.png" alt="" aspectRatio="threeByTwo" />)
125
112
  .toJSON();
126
113
  const ratioTwoByOne = renderer
127
- .create(
128
- <Image src="test.png" alt="" aspectRatio={ImageRatios.TwoByOne} />
129
- )
114
+ .create(<Image src="test.png" alt="" aspectRatio="twoByOne" />)
130
115
  .toJSON();
131
116
  const typeCircle = renderer
132
117
  .create(
133
118
  <Image
134
119
  src="test.png"
135
120
  alt=""
136
- aspectRatio={ImageRatios.Square}
137
- size={ImageSizes.Small}
138
- imageType={ImageTypes.Circle}
121
+ aspectRatio="square"
122
+ size="small"
123
+ imageType="circle"
139
124
  />
140
125
  )
141
126
  .toJSON();
@@ -1,8 +1,23 @@
1
1
  import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
2
2
  import * as React from "react";
3
3
 
4
- import { ImageRatios, ImageSizes, ImageTypes } from "./ImageTypes";
5
-
4
+ export type ImageRatios =
5
+ | "fourByThree"
6
+ | "oneByTwo"
7
+ | "original"
8
+ | "sixteenByNine"
9
+ | "square"
10
+ | "threeByFour"
11
+ | "threeByTwo"
12
+ | "twoByOne";
13
+ export type ImageSizes =
14
+ | "default"
15
+ | "xxsmall"
16
+ | "xsmall"
17
+ | "small"
18
+ | "medium"
19
+ | "large";
20
+ export type ImageTypes = "default" | "circle";
6
21
  // Used for components that have an `imageProps` prop.
7
22
  export interface ComponentImageProps {
8
23
  /** String value used to populate the `alt` attribute of the internal `Image`
@@ -18,7 +33,7 @@ export interface ComponentImageProps {
18
33
  /** Optional value to render as a credit for the internal `Image` component. */
19
34
  credit?: string;
20
35
  /** Optional value to control the size of the internal `Image` component.
21
- * Defaults to `ImageSizes.Medium`. */
36
+ * Defaults to `ImageSizes.Default`. */
22
37
  size?: ImageSizes;
23
38
  /** Optional value that contains the path to an image. If omitted, the internal
24
39
  * DS `Image` component will not render. */
@@ -30,7 +45,8 @@ interface ImageWrapperProps {
30
45
  additionalWrapperStyles?: { [key: string]: any };
31
46
  /** ClassName you can add in addition to 'image' */
32
47
  className?: string;
33
- /** Optional value to control the aspect ratio of the cartd image; default value is `square` */
48
+ /** Optional value to control the aspect ratio of the card image; default
49
+ * value is `"original"` */
34
50
  aspectRatio?: ImageRatios;
35
51
  /** Optional value to control the size of the image */
36
52
  size?: ImageSizes;
@@ -42,7 +58,7 @@ export interface ImageProps extends ImageWrapperProps {
42
58
  /** Optionally pass in additional Chakra-based styles only for the image. */
43
59
  additionalImageStyles?: { [key: string]: any };
44
60
  /** Alternate text description of the image */
45
- alt: string;
61
+ alt?: string;
46
62
  /** Adding will wrap the image in a <figure> */
47
63
  caption?: string;
48
64
  /** Custom image component */
@@ -52,7 +68,7 @@ export interface ImageProps extends ImageWrapperProps {
52
68
  /** Optional value for the image type */
53
69
  imageType?: ImageTypes;
54
70
  /** The src attribute is required, and contains the path to the image you want to embed. */
55
- src: string;
71
+ src?: string;
56
72
  }
57
73
 
58
74
  const ImageWrapper = chakra(
@@ -61,8 +77,8 @@ const ImageWrapper = chakra(
61
77
  additionalWrapperStyles = {},
62
78
  className = "",
63
79
  children,
64
- aspectRatio = ImageRatios.Original,
65
- size = ImageSizes.Default,
80
+ aspectRatio = "original",
81
+ size = "default",
66
82
  ...rest
67
83
  } = props;
68
84
  const styles = useMultiStyleConfig("CustomImageWrapper", {
@@ -89,17 +105,17 @@ export const Image = chakra((props: ImageProps) => {
89
105
  additionalImageStyles = {},
90
106
  additionalWrapperStyles = {},
91
107
  alt,
92
- aspectRatio = ImageRatios.Original,
108
+ aspectRatio = "original",
93
109
  caption,
94
110
  className = "",
95
111
  component,
96
112
  credit,
97
- imageType = ImageTypes.Default,
98
- size = ImageSizes.Default,
113
+ imageType = "default",
114
+ size = "default",
99
115
  src,
100
116
  ...rest
101
117
  } = props;
102
- const useImageWrapper = aspectRatio !== ImageRatios.Original;
118
+ const useImageWrapper = aspectRatio !== "original";
103
119
  const styles = useMultiStyleConfig("CustomImage", {
104
120
  variant: imageType,
105
121
  size,
@@ -6,21 +6,12 @@ import {
6
6
  Meta,
7
7
  Story,
8
8
  } from "@storybook/addon-docs";
9
- import {
10
- BrowserRouter as Router,
11
- Link as ReactRouterLink,
12
- } from "react-router-dom";
13
9
  import { withDesign } from "storybook-addon-designs";
14
10
 
15
11
  import Link from "./Link";
16
- import { LinkTypes } from "./LinkTypes";
17
12
  import Icon from "../Icons/Icon";
18
- import { IconAlign, IconNames, IconSizes } from "../Icons/IconTypes";
19
13
  import { getCategory } from "../../utils/componentCategories";
20
14
  import DSProvider from "../../theme/provider";
21
- import { getStorybookEnumValues } from "../../utils/utils";
22
-
23
- export const enumValues = getStorybookEnumValues(LinkTypes, "LinkTypes");
24
15
 
25
16
  <Meta
26
17
  title={getCategory("Link")}
@@ -34,15 +25,11 @@ export const enumValues = getStorybookEnumValues(LinkTypes, "LinkTypes");
34
25
  jest: ["Link.test.tsx"],
35
26
  }}
36
27
  argTypes={{
37
- additionalStyles: { control: false },
38
- attributes: { control: false },
39
28
  children: { table: { disable: true } },
40
29
  key: { table: { disable: true } },
41
30
  ref: { table: { disable: true } },
42
31
  type: {
43
- control: { type: "select" },
44
- table: { defaultValue: { summary: "LinkTypes.Default" } },
45
- options: enumValues.options,
32
+ table: { defaultValue: { summary: "default" } },
46
33
  },
47
34
  }}
48
35
  />
@@ -52,7 +39,7 @@ export const enumValues = getStorybookEnumValues(LinkTypes, "LinkTypes");
52
39
  | Component Version | DS Version |
53
40
  | ----------------- | ---------- |
54
41
  | Added | `0.0.4` |
55
- | Latest | `0.26.0` |
42
+ | Latest | `0.28.0` |
56
43
 
57
44
  ## Table of Contents
58
45
 
@@ -73,22 +60,13 @@ export const enumValues = getStorybookEnumValues(LinkTypes, "LinkTypes");
73
60
  <Story
74
61
  name="Link with Controls"
75
62
  args={{
76
- additionalStyles: undefined,
77
- attributes: {
78
- rel: "nofollow",
79
- onClick: (e) => e.preventDefault(),
80
- },
81
63
  className: "custom-class",
82
64
  href: "https://nypl.org",
83
65
  id: "nypl-link",
84
- type: "LinkTypes.Action",
66
+ type: "action",
85
67
  }}
86
68
  >
87
- {(args) => (
88
- <Link {...args} type={enumValues.getValue(args.type)}>
89
- Link
90
- </Link>
91
- )}
69
+ {(args) => <Link {...args}>Link</Link>}
92
70
  </Story>
93
71
  </Canvas>
94
72
 
@@ -108,35 +86,27 @@ Resources:
108
86
  ## Links With Icons
109
87
 
110
88
  To render an `Icon` as part of the link, make sure that the `Link` component
111
- wraps the `Icon`. Use `type={LinkTypes.Action}` to apply appropriate styling to
89
+ wraps the `Icon`. Use `type="action"` to apply appropriate styling to
112
90
  links with icons. Icons can be rendered to the left or right of the link text.
113
91
 
114
92
  <Canvas>
115
93
  <Story name="With Icons">
116
94
  <VStack spacing="xs" align="flex-start">
117
- <Link type={LinkTypes.Action} href="#passed-in-link">
118
- <Icon name="headset" align={IconAlign.Left} size={IconSizes.Small} />
95
+ <Link type="action" href="#passed-in-link">
96
+ <Icon name="headset" align="left" size="small" />
119
97
  Headset Link
120
98
  </Link>
121
- <Link type={LinkTypes.Action} href="#passed-in-link">
122
- <Icon name="clock" align={IconAlign.Left} size={IconSizes.Small} />
99
+ <Link type="action" href="#passed-in-link">
100
+ <Icon name="clock" align="left" size="small" />
123
101
  Clock Link
124
102
  </Link>
125
- <Link type={LinkTypes.Action} href="#passed-in-link">
126
- <Icon
127
- name={IconNames.Check}
128
- align={IconAlign.Left}
129
- size={IconSizes.Small}
130
- />
103
+ <Link type="action" href="#passed-in-link">
104
+ <Icon name="check" align="left" size="small" />
131
105
  Check Link
132
106
  </Link>
133
- <Link type={LinkTypes.Action} href="#passed-in-link-right">
107
+ <Link type="action" href="#passed-in-link-right">
134
108
  Check Link Right
135
- <Icon
136
- name={IconNames.Check}
137
- align={IconAlign.Right}
138
- size={IconSizes.Small}
139
- />
109
+ <Icon name="check" align="right" size="small" />
140
110
  </Link>
141
111
  </VStack>
142
112
  </Story>
@@ -149,21 +119,21 @@ can use the `href` prop to generate an `<a>` element.
149
119
 
150
120
  ```jsx
151
121
  // Existing anchor element
152
- <Link type={LinkTypes.Action}>
122
+ <Link type="action">
153
123
  <a href="#existing-anchor-tag">link</a>
154
124
  </Link>
155
125
 
156
126
  // Also works with an icon component. Make sure to wrap the icon and anchor
157
127
  // in a single element for this pattern.
158
- <Link type={LinkTypes.Action}>
128
+ <Link type="action">
159
129
  <>
160
- <Icon name={IconNames.Check} align={IconAlign.Left} size={IconSizes.Small} />
130
+ <Icon name="check" align="left" size="small" />
161
131
  <a href="#existing-anchor-tag">check link</a>
162
132
  </>
163
133
  </Link>
164
134
 
165
135
  // Otherwise, the `href` prop will generate an `<a>` tag.
166
- <Link type={LinkTypes.Action} href="#passed-in-link">
136
+ <Link type="action" href="#passed-in-link">
167
137
  link
168
138
  </Link>
169
139
  ```
@@ -172,22 +142,18 @@ can use the `href` prop to generate an `<a>` element.
172
142
  <Story name="Anchor Element Rendering">
173
143
  <>
174
144
  This is a{" "}
175
- <Link type={LinkTypes.Action}>
145
+ <Link type="action">
176
146
  <a href="#existing-anchor-tag">link</a>
177
147
  </Link>{" "}
178
148
  with the &lt;a&gt; element as a child of the `Link` component. This is a{" "}
179
- <Link type={LinkTypes.Action} href="#passed-in-link">
149
+ <Link type="action" href="#passed-in-link">
180
150
  link
181
151
  </Link>{" "}
182
152
  where the `Link` component uses the `href` prop and has a string-only
183
153
  child. Finally, this is a{" "}
184
- <Link type={LinkTypes.Action}>
154
+ <Link type="action">
185
155
  <>
186
- <Icon
187
- name={IconNames.Check}
188
- align={IconAlign.Left}
189
- size={IconSizes.Small}
190
- />
156
+ <Icon name="check" align="left" size="small" />
191
157
  <a href="#existing-anchor-tag">link</a>
192
158
  </>
193
159
  </Link>{" "}
@@ -198,23 +164,6 @@ can use the `href` prop to generate an `<a>` element.
198
164
 
199
165
  ## Link with Routers
200
166
 
201
- <Canvas>
202
- <Story name="Link with Routers">
203
- <div>With React Router</div>
204
- <Router>
205
- <Link type={LinkTypes.Action}>
206
- <ReactRouterLink to="#">Next Page</ReactRouterLink>
207
- </Link>
208
- </Router>
209
- <br />
210
- <br />
211
- <div>With NextJS</div>
212
- <NextJsLink href="#" passHref>
213
- <Link type={LinkTypes.Action}>Next Page</Link>
214
- </NextJsLink>
215
- </Story>
216
- </Canvas>
217
-
218
167
  ### React Router
219
168
 
220
169
  The Design System's `Link` component should wrap around `react-router`'s own
@@ -228,9 +177,9 @@ import {
228
177
  BrowserRouter as Router,
229
178
  Link as ReactRouterLink,
230
179
  } from "react-router-dom";
231
- import { Link, LinkTypes } from "@nypl/design-system-react-components";
180
+ import { Link } from "@nypl/design-system-react-components";
232
181
 
233
- <Link type={LinkTypes.Action}>
182
+ <Link type="action">
234
183
  <ReactRouterLink to="#">Next Page</ReactRouterLink>
235
184
  </Link>;
236
185
 
@@ -238,12 +187,9 @@ import { Link, LinkTypes } from "@nypl/design-system-react-components";
238
187
  // is not renamed but the DS's `Link` component is renamed
239
188
  // to `DSLink`.
240
189
  import { BrowserRouter, Link } from "react-router-dom";
241
- import {
242
- Link as DSLink,
243
- LinkTypes,
244
- } from "@nypl/design-system-react-components";
190
+ import { Link as DSLink } from "@nypl/design-system-react-components";
245
191
 
246
- <DSLink type={LinkTypes.Action}>
192
+ <DSLink type="action">
247
193
  <Link to="#">Next Page</Link>
248
194
  </DSLink>;
249
195
 
@@ -253,21 +199,11 @@ import {
253
199
  import { BrowserRouter, Link } from "react-router-dom";
254
200
  import DS from "@nypl/design-system-react-components";
255
201
 
256
- <DS.Link type={DS.LinkTypes.Action}>
202
+ <DS.Link type="action">
257
203
  <Link to="#">Next Page</Link>
258
204
  </DS.Link>;
259
205
  ```
260
206
 
261
- <Canvas>
262
- <DSProvider>
263
- <Router>
264
- <Link type={LinkTypes.Action}>
265
- <ReactRouterLink to="#">Next Page</ReactRouterLink>
266
- </Link>
267
- </Router>
268
- </DSProvider>
269
- </Canvas>
270
-
271
207
  ### NextJS
272
208
 
273
209
  NextJS's `Link` component should wrap the Design System's `Link` component.
@@ -277,7 +213,7 @@ These props, along with an implicit `ref` from NextJS and the Design System's
277
213
  pages in a NextJS app.
278
214
 
279
215
  ```jsx
280
- import { Link, LinkTypes } from "@nypl/design-system-react-components";
216
+ import { Link } from "@nypl/design-system-react-components";
281
217
 
282
218
  /**
283
219
  * This is just an example wrapper that works similarly to NextJS' `Link`
@@ -293,21 +229,21 @@ export const NextJsLink = (props: HTMLAnchorElement) =>
293
229
 
294
230
  // Note that NextJS' `href` and `passHref` props are required.
295
231
  <NextJsLink href="#" passHref>
296
- <Link type={LinkTypes.Action}>Next Page</Link>
232
+ <Link type="action">Next Page</Link>
297
233
  </NextJsLink>;
298
234
  ```
299
235
 
300
236
  export const NextJsLink = (props) =>
301
237
  React.cloneElement(
302
238
  props.children,
303
- { ...props },
239
+ { href: props.href },
304
240
  props.children.props.children
305
241
  );
306
242
 
307
243
  <Canvas>
308
244
  <DSProvider>
309
245
  <NextJsLink href="#" passHref>
310
- <Link type={LinkTypes.Action}>Next Page</Link>
246
+ <Link type="action">Next Page</Link>
311
247
  </NextJsLink>
312
248
  </DSProvider>
313
249
  </Canvas>
@@ -1,21 +1,10 @@
1
1
  import { render, screen } from "@testing-library/react";
2
2
  import { axe } from "jest-axe";
3
3
  import * as React from "react";
4
- import {
5
- BrowserRouter as Router,
6
- Link as ReactRouterLink,
7
- } from "react-router-dom";
8
4
  import renderer from "react-test-renderer";
9
5
 
10
6
  import Link from "./Link";
11
- import { LinkTypes } from "./LinkTypes";
12
7
  import Icon from "../Icons/Icon";
13
- import {
14
- IconAlign,
15
- IconNames,
16
- IconRotationTypes,
17
- IconSizes,
18
- } from "../Icons/IconTypes";
19
8
 
20
9
  describe("Link Accessibility", () => {
21
10
  it("passes axe accessibility test for children component", async () => {
@@ -36,12 +25,12 @@ describe("Link Accessibility", () => {
36
25
  describe("Link", () => {
37
26
  it("Can pass in an icon and text as children and url as prop", () => {
38
27
  const utils = render(
39
- <Link href="#passed-in-link" type={LinkTypes.Action}>
28
+ <Link href="#passed-in-link" type="action">
40
29
  <Icon
41
30
  className="more-link"
42
- name={IconNames.Download}
43
- align={IconAlign.Left}
44
- iconRotation={IconRotationTypes.Rotate0}
31
+ name="download"
32
+ align="left"
33
+ iconRotation="rotate0"
45
34
  />
46
35
  Download
47
36
  </Link>
@@ -61,13 +50,13 @@ describe("Link", () => {
61
50
 
62
51
  it("Can pass a link with <a> tag and an icon", () => {
63
52
  const utils = render(
64
- <Link type={LinkTypes.Action}>
53
+ <Link type="action">
65
54
  <a href="#test2">
66
55
  <Icon
67
56
  className="more-link"
68
- name={IconNames.Download}
69
- align={IconAlign.Left}
70
- iconRotation={IconRotationTypes.Rotate0}
57
+ name="download"
58
+ align="left"
59
+ iconRotation="rotate0"
71
60
  />
72
61
  Test
73
62
  </a>
@@ -79,25 +68,25 @@ describe("Link", () => {
79
68
 
80
69
  it("Generated back link has icon", () => {
81
70
  const utils = render(
82
- <Link href="#passed-in-link" type={LinkTypes.Backwards}>
71
+ <Link href="#passed-in-link" type="backwards">
83
72
  content
84
73
  </Link>
85
74
  );
86
75
  expect(utils.container.querySelector(".more-link")).toBeInTheDocument();
87
76
  expect(
88
- utils.container.querySelector(".more-link").getAttribute("class")
77
+ utils.container.querySelector(".more-link")?.getAttribute("class")
89
78
  ).toContain("chakra-icon more-link");
90
79
  });
91
80
 
92
81
  it("Generated forwards link has icon", () => {
93
82
  const utils = render(
94
- <Link href="#passed-in-link" type={LinkTypes.Forwards}>
83
+ <Link href="#passed-in-link" type="forwards">
95
84
  content
96
85
  </Link>
97
86
  );
98
87
  expect(utils.container.querySelector(".more-link")).toBeInTheDocument();
99
88
  expect(
100
- utils.container.querySelector(".more-link").getAttribute("class")
89
+ utils.container.querySelector(".more-link")?.getAttribute("class")
101
90
  ).toContain("chakra-icon more-link");
102
91
  });
103
92
 
@@ -106,24 +95,6 @@ describe("Link", () => {
106
95
  expect(screen.getByRole("link")).toBeInTheDocument();
107
96
  });
108
97
 
109
- it("Can pass in a ReactRouter Link", () => {
110
- render(
111
- <Router>
112
- <Link type={LinkTypes.Action}>
113
- <ReactRouterLink to="#">
114
- <Icon
115
- name={IconNames.Download}
116
- align={IconAlign.Left}
117
- iconRotation={IconRotationTypes.Rotate0}
118
- />
119
- Download
120
- </ReactRouterLink>
121
- </Link>
122
- </Router>
123
- );
124
- expect(screen.getByRole("link")).toBeInTheDocument();
125
- });
126
-
127
98
  it("throws an error if text is passed but no url is passed", () => {
128
99
  expect(() => render(<Link>Test</Link>)).toThrowError(
129
100
  "`Link` needs the `href` prop."
@@ -134,11 +105,7 @@ describe("Link", () => {
134
105
  expect(() =>
135
106
  render(
136
107
  <Link>
137
- <Icon
138
- name={IconNames.Download}
139
- align={IconAlign.Left}
140
- iconRotation={IconRotationTypes.Rotate0}
141
- />
108
+ <Icon name="download" align="left" iconRotation="rotate0" />
142
109
  <a href="#test">Test</a>
143
110
  </Link>
144
111
  )
@@ -148,60 +115,48 @@ describe("Link", () => {
148
115
  it("renders the UI snapshot correctly", () => {
149
116
  const standard = renderer
150
117
  .create(
151
- <Link href="#passed-in-link" id="standard-link" type={LinkTypes.Action}>
118
+ <Link href="#passed-in-link" id="standard-link" type="action">
152
119
  Standard
153
120
  </Link>
154
121
  )
155
122
  .toJSON();
156
123
  const typeForwards = renderer
157
124
  .create(
158
- <Link
159
- href="#passed-in-link"
160
- id="forwards-link"
161
- type={LinkTypes.Forwards}
162
- >
125
+ <Link href="#passed-in-link" id="forwards-link" type="forwards">
163
126
  Forwards
164
127
  </Link>
165
128
  )
166
129
  .toJSON();
167
130
  const typeBackwards = renderer
168
131
  .create(
169
- <Link
170
- href="#passed-in-link"
171
- id="backwards-link"
172
- type={LinkTypes.Backwards}
173
- >
132
+ <Link href="#passed-in-link" id="backwards-link" type="backwards">
174
133
  Backwards
175
134
  </Link>
176
135
  )
177
136
  .toJSON();
178
137
  const typeExternal = renderer
179
138
  .create(
180
- <Link
181
- href="#passed-in-link"
182
- id="external-link"
183
- type={LinkTypes.External}
184
- >
139
+ <Link href="#passed-in-link" id="external-link" type="external">
185
140
  External
186
141
  </Link>
187
142
  )
188
143
  .toJSON();
189
144
  const typeButton = renderer
190
145
  .create(
191
- <Link href="#passed-in-link" id="button-link" type={LinkTypes.Button}>
146
+ <Link href="#passed-in-link" id="button-link" type="button">
192
147
  Button
193
148
  </Link>
194
149
  )
195
150
  .toJSON();
196
151
  const withIconChild = renderer
197
152
  .create(
198
- <Link href="#passed-in-link" id="icon-link" type={LinkTypes.Action}>
153
+ <Link href="#passed-in-link" id="icon-link" type="action">
199
154
  <Icon
200
- align={IconAlign.Left}
155
+ align="left"
201
156
  className="more-link"
202
- iconRotation={IconRotationTypes.Rotate0}
157
+ iconRotation="rotate0"
203
158
  id="link-icon"
204
- name={IconNames.Download}
159
+ name="download"
205
160
  />
206
161
  Download
207
162
  </Link>
@@ -209,21 +164,16 @@ describe("Link", () => {
209
164
  .toJSON();
210
165
  const withAchorChild = renderer
211
166
  .create(
212
- <Link id="anchor-link" type={LinkTypes.Action}>
167
+ <Link id="anchor-link" type="action">
213
168
  <a href="#existing-anchor-tag">check link</a>
214
169
  </Link>
215
170
  )
216
171
  .toJSON();
217
172
  const withAchorChildAndIcon = renderer
218
173
  .create(
219
- <Link id="anchor-icon-link" type={LinkTypes.Action}>
174
+ <Link id="anchor-icon-link" type="action">
220
175
  <>
221
- <Icon
222
- align={IconAlign.Left}
223
- id="link-icon"
224
- name={IconNames.Check}
225
- size={IconSizes.Small}
226
- />
176
+ <Icon align="left" id="link-icon" name="check" size="small" />
227
177
  <a href="#existing-anchor-tag">check link</a>
228
178
  </>
229
179
  </Link>