@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
@@ -1,9 +1,28 @@
1
1
  import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
2
2
  import * as React from "react";
3
3
 
4
- import { HeroTypes, HeroSecondaryTypes } from "./HeroTypes";
5
- import Image from "../Image/Image";
4
+ import Image, { ComponentImageProps } from "../Image/Image";
6
5
 
6
+ export type HeroTypes =
7
+ | "primary"
8
+ | "secondary"
9
+ | "secondaryBooksAndMore"
10
+ | "secondaryLocations"
11
+ | "secondaryResearch"
12
+ | "secondaryWhatsOn"
13
+ | "tertiary"
14
+ | "campaign"
15
+ | "fiftyFifty";
16
+ // Only used for internal purposes.
17
+ export const heroSecondaryTypes = [
18
+ "secondary",
19
+ "secondaryBooksAndMore",
20
+ "secondaryLocations",
21
+ "secondaryResearch",
22
+ "secondaryWhatsOn",
23
+ ];
24
+ export interface HeroImageProps
25
+ extends Pick<ComponentImageProps, "alt" | "src"> {}
7
26
  export interface HeroProps {
8
27
  /** Optional hex color value used to override the default background
9
28
  * color for a given `Hero` variation.
@@ -21,14 +40,14 @@ export interface HeroProps {
21
40
  heading?: JSX.Element;
22
41
  /** Used to control how the `Hero` component will be rendered. */
23
42
  heroType?: HeroTypes;
24
- /** Text description of the image; to follow best practices for accessibility,
25
- * this prop should not be left blank if `imageSrc` is passed. */
26
- imageAlt?: string;
27
- /** Optional `imageSrc` used for SECONDARY, FIFTYFIFTY and CAMPAIGN
28
- * `Hero` types; Note: `imageSrc` can only be used in conjunction with
29
- * `backgroundImageSrc` for the CAMPAIGN `Hero` type.
30
- * Note: not all `Hero` variations utilize this prop. */
31
- imageSrc?: string;
43
+ /** Object used to create and render the `Image` component. Note that only
44
+ * `src` and `alt` are the available attributes to pass. If `imageProps.alt`
45
+ * is left blank, a warning will be logged to the console and will cause
46
+ * accessibility issues. For `imageProps.src`, it will only work for the
47
+ * "secondary", "fiftyFifty" and "campaign" `Hero` types; Note: `imageProps.src`
48
+ * can only be used in conjunction with `backgroundImageSrc` for the "campaign"
49
+ * `Hero` type. Note: not all `Hero` variations utilize this prop. */
50
+ imageProps?: HeroImageProps;
32
51
  /** Optional details area that contains location data.
33
52
  * Note: not all `Hero` variations utilize this prop. */
34
53
  locationDetails?: JSX.Element;
@@ -37,18 +56,6 @@ export interface HeroProps {
37
56
  subHeaderText?: string | JSX.Element;
38
57
  }
39
58
 
40
- // Used to map between HeroTypes enum values and Chakra variant options.
41
- const variantMap = {};
42
- for (const type in HeroTypes) {
43
- variantMap[HeroTypes[type]] = HeroTypes[type];
44
- }
45
- /**
46
- * Map the HeroTypes to the Hero Chakra theme variant object. If a wrong
47
- * value is passed (typically in non-Typescript scenarios), then the default
48
- * is the "primary" variant.
49
- */
50
- const getVariant = (type) => variantMap[type] || HeroTypes.Primary;
51
-
52
59
  export const Hero = chakra(
53
60
  (props: React.PropsWithChildren<HeroProps>) => {
54
61
  const {
@@ -57,89 +64,86 @@ export const Hero = chakra(
57
64
  foregroundColor,
58
65
  heading,
59
66
  heroType,
60
- imageAlt,
61
- imageSrc,
67
+ imageProps = {
68
+ alt: "",
69
+ src: "",
70
+ },
62
71
  locationDetails,
63
72
  subHeaderText,
64
73
  ...rest
65
74
  } = props;
66
- const variant = getVariant(heroType);
67
- const styles = useMultiStyleConfig("Hero", { variant });
75
+ const styles = useMultiStyleConfig("Hero", { variant: heroType });
68
76
  const headingStyles = styles.heading;
69
77
  // We want to add `Hero`-specific styling to the `Heading` component.
70
78
  const finalHeading =
71
- heading &&
72
- React.cloneElement(heading, { additionalStyles: headingStyles });
79
+ heading && React.cloneElement(heading, { __css: headingStyles });
73
80
  let backgroundImageStyle = {};
74
81
  let contentBoxStyling = {};
75
82
 
76
- if (imageSrc && !imageAlt) {
83
+ if (imageProps.src && !imageProps.alt) {
77
84
  console.warn(
78
- `NYPL Reservoir: The "imageSrc" prop was passed but the "imageAlt" props was not. This will make the rendered image inaccessible.`
85
+ `NYPL Reservoir Hero: The "imageProps.src" prop was passed but the "imageProps.alt" props was not. This will make the rendered image inaccessible.`
79
86
  );
80
87
  }
81
88
 
82
- if (heroType === HeroTypes.Primary) {
89
+ if (heroType === "primary") {
83
90
  if (!backgroundImageSrc) {
84
91
  console.warn(
85
92
  "NYPL Reservoir Hero: It is recommended to use the `backgroundImageSrc` " +
86
- "prop for the `HeroTypes.Primary` `heroType` variant."
93
+ "prop for the `'primary'` `heroType` variant."
87
94
  );
88
95
  }
89
- if (imageAlt && imageSrc) {
96
+ if (imageProps.alt && imageProps.src) {
90
97
  console.warn(
91
- "NYPL Reservoir Hero: The `imageSrc` and `imageAlt` props have been " +
92
- "passed, but the `HeroTypes.Primary` `heroType` variant will not use it."
98
+ "NYPL Reservoir Hero: The `imageProps.src` and `imageProps.alt` props have been " +
99
+ "passed, but the `'primary'` `heroType` variant will not use it."
93
100
  );
94
101
  }
95
102
  } else if (locationDetails) {
96
103
  console.warn(
97
104
  "NYPL Reservoir Hero: The `locationDetails` prop should only be used " +
98
- "with the `HeroTypes.Primary` `heroType` variant."
105
+ "with the `'primary'` `heroType` variant."
99
106
  );
100
107
  }
101
- if (HeroSecondaryTypes.includes(heroType) && backgroundImageSrc) {
108
+ if (heroSecondaryTypes.includes(heroType) && backgroundImageSrc) {
102
109
  console.warn(
103
110
  "NYPL Reservoir Hero: The `backgroundImageSrc` prop has been passed, " +
104
- "but the `HeroTypes.Secondary` `heroType` variant will not use it."
111
+ "but the `'secondary'` `heroType` variant will not use it."
105
112
  );
106
113
  }
107
- if (heroType === HeroTypes.Tertiary && (backgroundImageSrc || imageSrc)) {
114
+ if (heroType === "tertiary" && (backgroundImageSrc || imageProps.src)) {
108
115
  console.warn(
109
- "NYPL Reservoir Hero: The `HeroTypes.Tertiary` `heroType` variant hero " +
116
+ "NYPL Reservoir Hero: The `'tertiary'` `heroType` variant hero " +
110
117
  "will not use any of the image props."
111
118
  );
112
119
  }
113
- if (heroType === HeroTypes.Campaign && (!backgroundImageSrc || !imageSrc)) {
120
+ if (heroType === "campaign" && (!backgroundImageSrc || !imageProps.src)) {
114
121
  console.warn(
115
122
  "NYPL Reservoir Hero: It is recommended to use both the " +
116
- "`backgroundImageSrc` and `imageSrc` props for the " +
117
- "`HeroTypes.Campaign` `heroType` variant."
123
+ "`backgroundImageSrc` and `imageProps.src` props for the " +
124
+ "`'campaign'` `heroType` variant."
118
125
  );
119
126
  }
120
- if (heroType === HeroTypes.FiftyFifty && backgroundImageSrc) {
127
+ if (heroType === "fiftyFifty" && backgroundImageSrc) {
121
128
  console.warn(
122
129
  "NYPL Reservoir Hero: The `backgroundImageSrc` prop has been passed, " +
123
- "but the `HeroTypes.FiftyFifty` `heroType` variant hero will not use it."
130
+ "but the `'fiftyFifty'` `heroType` variant hero will not use it."
124
131
  );
125
132
  }
126
133
 
127
- if (heroType === HeroTypes.Primary) {
134
+ if (heroType === "primary") {
128
135
  backgroundImageStyle = backgroundImageSrc
129
136
  ? { backgroundImage: `url(${backgroundImageSrc})` }
130
137
  : {};
131
- } else if (heroType === HeroTypes.Campaign) {
138
+ } else if (heroType === "campaign") {
132
139
  backgroundImageStyle = backgroundImageSrc
133
140
  ? { backgroundImage: `url(${backgroundImageSrc})` }
134
141
  : { backgroundColor };
135
- } else if (
136
- heroType === HeroTypes.Tertiary ||
137
- heroType === HeroTypes.FiftyFifty
138
- ) {
142
+ } else if (heroType === "tertiary" || heroType === "fiftyFifty") {
139
143
  backgroundImageStyle = { backgroundColor };
140
144
  }
141
145
 
142
- if (!HeroSecondaryTypes.includes(heroType)) {
146
+ if (!heroSecondaryTypes.includes(heroType)) {
143
147
  contentBoxStyling = {
144
148
  color: foregroundColor,
145
149
  backgroundColor,
@@ -147,15 +151,15 @@ export const Hero = chakra(
147
151
  } else if (foregroundColor || backgroundColor) {
148
152
  console.warn(
149
153
  "NYPL Reservoir Hero: The `foregroundColor` and/or `backgroundColor` " +
150
- "props have been passed, but the `HeroTypes.Secondary` `heroType` " +
154
+ "props have been passed, but the `'secondary'` `heroType` " +
151
155
  "variant will not use them."
152
156
  );
153
157
  }
154
158
 
155
159
  const childrenToRender =
156
- heroType === HeroTypes.Campaign ? (
160
+ heroType === "campaign" ? (
157
161
  <>
158
- <Image alt={imageAlt} src={imageSrc} />
162
+ <Image alt={imageProps.alt} src={imageProps.src} />
159
163
  <Box __css={styles.interior}>
160
164
  {finalHeading}
161
165
  {subHeaderText}
@@ -163,12 +167,11 @@ export const Hero = chakra(
163
167
  </>
164
168
  ) : (
165
169
  <>
166
- {heroType !== HeroTypes.Primary &&
167
- heroType !== HeroTypes.Tertiary && (
168
- <Image alt={imageAlt} src={imageSrc} />
169
- )}
170
+ {heroType !== "primary" && heroType !== "tertiary" && (
171
+ <Image alt={imageProps.alt} src={imageProps.src} />
172
+ )}
170
173
  {finalHeading}
171
- {heroType === HeroTypes.Tertiary && subHeaderText ? (
174
+ {heroType === "tertiary" && subHeaderText ? (
172
175
  <p>{subHeaderText}</p>
173
176
  ) : (
174
177
  <Box __css={styles.bodyText}>{subHeaderText}</Box>
@@ -191,7 +194,6 @@ export const Hero = chakra(
191
194
  >
192
195
  {childrenToRender}
193
196
  </Box>
194
- {locationDetails}
195
197
  </Box>
196
198
  );
197
199
  },
@@ -8,33 +8,9 @@ import {
8
8
  import { withDesign } from "storybook-addon-designs";
9
9
 
10
10
  import Heading from "../Heading/Heading";
11
- import { HeadingLevels } from "../Heading/HeadingTypes";
12
11
  import Icon from "./Icon";
13
- import {
14
- IconAlign,
15
- IconColors,
16
- IconNames,
17
- IconRotationTypes,
18
- IconSizes,
19
- IconTypes,
20
- } from "./IconTypes";
21
12
  import iconSvgs from "./IconSvgs";
22
- import List from "../List/List";
23
- import { ListTypes } from "../List/ListTypes";
24
13
  import { getCategory } from "../../utils/componentCategories";
25
- import { getStorybookEnumValues } from "../../utils/utils";
26
-
27
- export const alignEnumValues = getStorybookEnumValues(IconAlign, "IconAlign");
28
- export const namesEnumValues = getStorybookEnumValues(IconNames, "IconNames");
29
- export const colorsEnumValues = getStorybookEnumValues(
30
- IconColors,
31
- "IconColors"
32
- );
33
- export const sizesEnumValues = getStorybookEnumValues(IconSizes, "IconSizes");
34
- export const rotationEnumValues = getStorybookEnumValues(
35
- IconRotationTypes,
36
- "IconRotationTypes"
37
- );
38
14
 
39
15
  <Meta
40
16
  title={getCategory("Icon")}
@@ -49,31 +25,42 @@ export const rotationEnumValues = getStorybookEnumValues(
49
25
  }}
50
26
  argTypes={{
51
27
  align: {
52
- control: { type: "select" },
53
- table: { defaultValue: { summary: "IconAlign.None" } },
54
- options: alignEnumValues.options,
28
+ table: { defaultValue: { summary: "none" } },
55
29
  },
56
30
  children: { table: { disable: true } },
57
31
  className: { control: false },
58
32
  color: {
59
33
  control: { type: "select" },
60
- table: { defaultValue: { summary: "IconColors.UiBlack" } },
61
- options: colorsEnumValues.options,
34
+ table: { defaultValue: { summary: "ui.black" } },
35
+ options: [
36
+ "ui.black",
37
+ "ui.white",
38
+ "brand.primary",
39
+ "brand.secondary",
40
+ "section.blogs.primary",
41
+ "section.blogs.secondary",
42
+ "section.books-and-more.primary",
43
+ "section.books-and-more.secondary",
44
+ "section.education.primary",
45
+ "section.education.secondary",
46
+ "section.locations.primary",
47
+ "section.locations.secondary",
48
+ "section.research.primary",
49
+ "section.research.secondary",
50
+ "section.research-library.lpa",
51
+ "section.research-library.schomburg",
52
+ "section.research-library.schwartzman",
53
+ "section.whats-on.primary",
54
+ "section.whats-on.secondary",
55
+ ],
62
56
  },
63
57
  iconRotation: {
64
- control: { type: "select" },
65
- table: { defaultValue: { summary: "IconRotationTypes.Rotate0" } },
66
- options: rotationEnumValues.options,
58
+ table: { defaultValue: { summary: "rotate0" } },
67
59
  },
68
60
  id: { control: false },
69
- name: {
70
- control: { type: "select" },
71
- options: namesEnumValues.options,
72
- },
61
+ name: {},
73
62
  size: {
74
- control: { type: "select" },
75
- table: { defaultValue: { summary: "IconSizes.Medium" } },
76
- options: sizesEnumValues.options,
63
+ table: { defaultValue: { summary: "medium" } },
77
64
  },
78
65
  title: {
79
66
  control: false,
@@ -81,7 +68,7 @@ export const rotationEnumValues = getStorybookEnumValues(
81
68
  },
82
69
  type: {
83
70
  control: false,
84
- table: { defaultValue: { summary: "IconTypes.Default" } },
71
+ table: { defaultValue: { summary: "default" } },
85
72
  },
86
73
  }}
87
74
  />
@@ -91,7 +78,7 @@ export const rotationEnumValues = getStorybookEnumValues(
91
78
  | Component Version | DS Version |
92
79
  | ----------------- | ---------- |
93
80
  | Added | `0.0.4` |
94
- | Latest | `0.26.0` |
81
+ | Latest | `0.28.0` |
95
82
 
96
83
  ## Table of Contents
97
84
 
@@ -114,57 +101,47 @@ export const rotationEnumValues = getStorybookEnumValues(
114
101
  <Story
115
102
  name="Icon with Controls"
116
103
  args={{
117
- additionalStyles: undefined,
118
- align: "IconAlign.None",
104
+ align: "none",
119
105
  className: undefined,
120
- color: "IconColors.UiBlack",
106
+ color: "ui.black",
121
107
  decorative: true,
122
- iconRotation: "IconRotationTypes.Rotate0",
108
+ iconRotation: "rotate0",
123
109
  id: "icon-id",
124
- name: "IconNames.Check",
125
- size: "IconSizes.ExtraExtraLarge",
110
+ name: "check",
111
+ size: "xxlarge",
126
112
  title: undefined,
127
- type: IconTypes.Default,
113
+ type: "default",
128
114
  }}
129
115
  >
130
- {(args) => (
131
- <Icon
132
- align={alignEnumValues.getValue(args.align)}
133
- color={colorsEnumValues.getValue(args.color)}
134
- iconRotation={rotationEnumValues.getValue(args.iconRotation)}
135
- name={namesEnumValues.getValue(args.name)}
136
- size={sizesEnumValues.getValue(args.size)}
137
- title={args.title}
138
- />
139
- )}
116
+ {(args) => <Icon {...args} />}
140
117
  </Story>
141
118
  </Canvas>
142
119
 
143
120
  <ArgsTable story="Icon with Controls" />
144
121
 
145
- export const iconRow = (icon, iconType = IconNames, opts = {}) => {
122
+ export const iconRow = (iconName, opts = {}) => {
146
123
  // We'll use this setup function to render all the icons in a list item.
147
124
  // Some icons display better with a dark background.
148
125
  const styles = { display: "block" };
149
126
  const {
150
- size = IconSizes.Large,
151
- iconRotation = IconRotationTypes.Rotate0,
152
- color = IconColors.UiBlack,
153
- displayValue = icon,
127
+ size = "large",
128
+ iconRotation = "rotate0",
129
+ color = "ui.black",
130
+ displayValue = iconName,
154
131
  } = opts;
155
- let key = icon;
156
- if (icon.indexOf("Negative") !== -1 || color.indexOf("white") !== -1) {
132
+ let key = iconName;
133
+ if (iconName.indexOf("Negative") !== -1 || color.indexOf("White") !== -1) {
157
134
  styles.backgroundColor = "#000";
158
135
  styles.padding = "1rem";
159
136
  }
160
137
  // The following is just to fix duplicate React key issues.
161
- if (iconRotation !== IconRotationTypes.Rotate0) {
138
+ if (iconRotation !== "rotate0") {
162
139
  key += `-${iconRotation}`;
163
140
  }
164
- if (color !== IconColors.UiBlack) {
141
+ if (color !== "ui.black") {
165
142
  key += `-${color}`;
166
143
  }
167
- if (size !== IconSizes.Large) {
144
+ if (size !== "large") {
168
145
  key += `-${size}`;
169
146
  }
170
147
  return (
@@ -172,10 +149,10 @@ export const iconRow = (icon, iconType = IconNames, opts = {}) => {
172
149
  key={key}
173
150
  style={{ marginBottom: "var(--nypl-space-l)", textAlign: "center" }}
174
151
  >
175
- <Heading level={HeadingLevels.Four}>{displayValue}</Heading>
152
+ <Heading level="four">{displayValue}</Heading>
176
153
  <span style={styles}>
177
154
  <Icon
178
- name={iconType[icon]}
155
+ name={iconName}
179
156
  size={size}
180
157
  iconRotation={iconRotation}
181
158
  color={color}
@@ -188,37 +165,105 @@ export const icons = [];
188
165
  export const rotations = [];
189
166
  export const colors = [];
190
167
  export const sizes = [];
191
- for (const icon in IconNames) {
168
+ export const iconColorsValues = [
169
+ "ui.black",
170
+ "ui.white",
171
+ "brand.primary",
172
+ "brand.secondary",
173
+ "section.blogs.primary",
174
+ "section.blogs.secondary",
175
+ "section.books-and-more.primary",
176
+ "section.books-and-more.secondary",
177
+ "section.education.primary",
178
+ "section.education.secondary",
179
+ "section.locations.primary",
180
+ "section.locations.secondary",
181
+ "section.research.primary",
182
+ "section.research.secondary",
183
+ "section.research-library.lpa",
184
+ "section.research-library.schomburg",
185
+ "section.research-library.schwartzman",
186
+ "section.whats-on.primary",
187
+ "section.whats-on.secondary",
188
+ ];
189
+ export const iconNamesValues = [
190
+ "accessibilityFull",
191
+ "accessibilityPartial",
192
+ "actionCheckCircle",
193
+ "actionHelpDefault",
194
+ "actionHelpOutline",
195
+ "alertNotificationImportant",
196
+ "actionLaunch",
197
+ "arrow",
198
+ "check",
199
+ "clock",
200
+ "close",
201
+ "download",
202
+ "errorFilled",
203
+ "errorOutline",
204
+ "fileTypeAudio",
205
+ "fileTypeDoc",
206
+ "fileTypeGenericDoc",
207
+ "fileTypeImage",
208
+ "fileTypePdf",
209
+ "fileTypeSpreadsheet",
210
+ "fileTypeVideo",
211
+ "headset",
212
+ "minus",
213
+ "plus",
214
+ "search",
215
+ "speakerNotes",
216
+ "utilityAccountFilled",
217
+ "utilityAccountUnfilled",
218
+ "utilityHamburger",
219
+ "utilitySearch",
220
+ ];
221
+ export const iconRotationTypesValues = [
222
+ "rotate0",
223
+ "rotate90",
224
+ "rotate180",
225
+ "rotate270",
226
+ ];
227
+ export const iconSizesValues = [
228
+ "default",
229
+ "small",
230
+ "medium",
231
+ "large",
232
+ "xlarge",
233
+ "xxlarge",
234
+ "xxxlarge",
235
+ ];
236
+ for (const icon in iconNamesValues) {
192
237
  icons.push(
193
- iconRow(icon, IconNames, {
194
- displayValue: `IconNames.${icon}`,
195
- size: IconSizes.ExtraExtraLarge,
238
+ iconRow(iconNamesValues[icon], {
239
+ displayValue: iconNamesValues[icon],
240
+ size: "xxlarge",
196
241
  })
197
242
  );
198
243
  }
199
- for (const iconRotation in IconRotationTypes) {
244
+ for (const iconRotation in iconRotationTypesValues) {
200
245
  rotations.push(
201
- iconRow("Arrow", IconNames, {
202
- displayValue: `IconRotationTypes.${iconRotation}`,
203
- iconRotation: IconRotationTypes[iconRotation],
204
- size: IconSizes.ExtraExtraLarge,
246
+ iconRow("arrow", {
247
+ displayValue: iconRotationTypesValues[iconRotation],
248
+ iconRotation: iconRotationTypesValues[iconRotation],
249
+ size: "xxlarge",
205
250
  })
206
251
  );
207
252
  }
208
- for (const iconColor in IconColors) {
253
+ for (const iconColor in iconColorsValues) {
209
254
  colors.push(
210
- iconRow("ErrorFilled", IconNames, {
211
- color: IconColors[iconColor],
212
- displayValue: `IconColors.${iconColor}`,
213
- size: IconSizes.ExtraExtraLarge,
255
+ iconRow("errorFilled", {
256
+ color: iconColorsValues[iconColor],
257
+ displayValue: iconColorsValues[iconColor],
258
+ size: "xxlarge",
214
259
  })
215
260
  );
216
261
  }
217
- for (const iconSize in IconSizes) {
262
+ for (const iconSize in iconSizesValues) {
218
263
  sizes.push(
219
- iconRow("ActionCheckCircle", IconNames, {
220
- displayValue: `IconSizes.${iconSize}`,
221
- size: IconSizes[iconSize],
264
+ iconRow("actionCheckCircle", {
265
+ displayValue: iconSizesValues[iconSize],
266
+ size: iconSizesValues[iconSize],
222
267
  })
223
268
  );
224
269
  }
@@ -229,10 +274,10 @@ export const allIconsType = (list) => (
229
274
 
230
275
  ## Accessibility
231
276
 
232
- For accessibility purposes, every Reservoir Design System (DS) `Icon` will
233
- render the `svg` element with its icon name in the `title` element. The default
234
- text in the `title` element is the icon's code name. Pass in better descriptive
235
- text in the `title` prop when using the `Icon` component in your application.
277
+ For accessibility purposes, every Reservoir Design System (DS) `Icon` will
278
+ render the `svg` element with its icon name in the `title` element. The default
279
+ text in the `title` element is the icon's code name. Pass in better descriptive
280
+ text in the `title` prop when using the `Icon` component in your application.
236
281
  This will give screenreaders a better descriptive title for the `svg` graphic.
237
282
 
238
283
  `Icon`s are decorative by default. This means that they are presentational and
@@ -248,19 +293,15 @@ Resources:
248
293
  ## Rotation Types
249
294
 
250
295
  Passing an `iconRotation` prop with a value from `IconRotationTypes` allows
251
- the icon to be rotated when it is rendered. The `IconRotationTypes` enum
252
- can be found in `src/components/Icons/IconTypes.tsx`.
296
+ the icon to be rotated when it is rendered. The values are:
297
+ `"rotate0"`, `"rotate90"`, `"rotate180"`, and `"rotate270"`.
253
298
 
254
299
  Note: All of the examples below have been rendered with the `size` prop set to
255
- `IconSizes.ExtraExtraLarge`.
300
+ `xxlarge`.
256
301
 
257
302
  ```jsx
258
303
  // Example
259
- <Icon
260
- iconRotation={IconRotationTypes.Rotate180}
261
- name={IconNames.Arrow}
262
- size={IconSizes.ExtraExtraLarge}
263
- />
304
+ <Icon iconRotation="rotate180" name="arrow" size="xxlarge" />
264
305
  ```
265
306
 
266
307
  <Canvas>
@@ -269,19 +310,23 @@ Note: All of the examples below have been rendered with the `size` prop set to
269
310
 
270
311
  ## IconColors Types
271
312
 
272
- Update an SVG icon by passing a `color` prop with a value from `IconColors`.
273
- The `IconColors` enum can be found in `src/components/Icons/IconTypes.tsx`.
313
+ Update an SVG icon by passing a `color` prop with a value from the `IconColors`
314
+ type. The values are: `"ui.black"`, `"ui.white"`, `"brand.primary"`,
315
+ `"brand.secondary"`, `"section.blogs.primary"`, `"section.blogs.secondary"`,
316
+ `"section.books-and-more.primary"`, `"section.books-and-more.secondary"`,
317
+ `"section.education.primary"`, `"section.education.secondary"`,
318
+ `"section.locations.primary"`, `"section.locations.secondary"`,
319
+ `"section.research.primary"`, `"section.research.secondary"`,
320
+ `"section.research-library.lpa"`, `"section.research-library.schomburg"`,
321
+ `"section.research-library.schwartzman"`, `"section.whats-on.primary"`,
322
+ `"section.whats-on.secondary"`.
274
323
 
275
324
  Note: All of the examples below have been rendered with the `size` prop set to
276
- `IconSizes.ExtraExtraLarge`.
325
+ `xxlarge`.
277
326
 
278
327
  ```jsx
279
328
  // Example
280
- <Icon
281
- color={IconColors.BrandPrimary}
282
- name={IconNames.ErrorFilled}
283
- size={IconSizes.ExtraExtraLarge}
284
- />
329
+ <Icon color="brand.primary" name="errorFilled" size="xxlarge" />
285
330
  ```
286
331
 
287
332
  <Canvas>
@@ -290,15 +335,16 @@ Note: All of the examples below have been rendered with the `size` prop set to
290
335
 
291
336
  ## IconSizes Types
292
337
 
293
- Update an SVG icon by passing a `size` prop with a value from `IconSizes`.
294
- The `IconSizes` enum can be found in`src/components/Icons/IconTypes.tsx`.
338
+ Update an SVG icon by passing a `size` prop with a value from `IconSizes`. The
339
+ values are: `"default"`, `"small"`, `"medium"`, `"large"`, `"xlarge"`,
340
+ `"xxlarge"`, `"xxxlarge"`.
295
341
 
296
- Note: `IconSizes.Default` sets the width to `100%` and the rendered icon will
297
- expand to fill the full width of the parent element.
342
+ Note: `"default"` sets the width to `100%` and the rendered icon will expand to
343
+ fill the full width of the parent element.
298
344
 
299
345
  ```jsx
300
346
  // Example
301
- <Icon name={IconNames.ActionCheckCircle} size={IconSizes.ExtraExtraLarge} />
347
+ <Icon name="actionCheckCircle" size="xxlarge" />
302
348
  ```
303
349
 
304
350
  <Canvas>
@@ -308,10 +354,18 @@ expand to fill the full width of the parent element.
308
354
  ## All Display Icons
309
355
 
310
356
  The following icons are for generic purposes. All the available icon names can
311
- be found in the `IconNames` enum in `src/components/Icons/IconTypes.tsx`.
357
+ be found in the `IconNames` type. They are: `"accessibilityFull"`,
358
+ `"accessibilityPartial"`, `"actionCheckCircle"`, `"actionHelpDefault"`,
359
+ `"actionHelpOutline"`, `"alertNotificationImportant"`, `"actionLaunch"`,
360
+ `"arrow"`, `"check"`, `"clock"`, `"close"`, `"download"`, `"errorFilled"`,
361
+ `"errorOutline"`, `"fileTypeAudio"`, `"fileTypeDoc"`,
362
+ `"fileTypeGenericDoc"`, `"fileTypeImage"`, `"fileTypePdf"`,
363
+ `"fileTypeSpreadsheet"`, `"fileTypeVideo"`, `"headset"`, `"minus"`,
364
+ `"plus"`, `"search"`, `"speakerNotes"`, `"utilityAccountFilled"`,
365
+ `"utilityAccountUnfilled"`, `"utilityHamburger"`, `"utilitySearch"`.
312
366
 
313
367
  Note: All of the examples below have been rendered with the `size` prop set to
314
- `IconSizes.ExtraExtraLarge`.
368
+ `xxlarge`.
315
369
 
316
370
  <Canvas withToolbar>
317
371
  <Story name="All Icons">{allIconsType(icons)}</Story>
@@ -336,9 +390,9 @@ child to the `Icon` component.
336
390
  <Story
337
391
  name="Custom Icons"
338
392
  args={{
339
- color: IconColors.UiBlack,
340
- size: IconSizes.ExtraExtraExtraLarge,
341
- iconRotation: IconRotationTypes.Rotate0,
393
+ color: "ui.black",
394
+ size: "xxxlarge",
395
+ iconRotation: "rotate0",
342
396
  decorative: true,
343
397
  }}
344
398
  >