@nypl/design-system-react-components 0.26.0 → 0.28.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 (306) hide show
  1. package/CHANGELOG.md +56 -0
  2. package/dist/components/Accordion/Accordion.d.ts +1 -1
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -5
  4. package/dist/components/Button/Button.d.ts +2 -10
  5. package/dist/components/ButtonGroup/ButtonGroup.d.ts +22 -0
  6. package/dist/components/Card/Card.d.ts +2 -2
  7. package/dist/components/Checkbox/Checkbox.d.ts +10 -8
  8. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +1 -1
  9. package/dist/components/DatePicker/DatePicker.d.ts +1 -1
  10. package/dist/components/Form/Form.d.ts +2 -2
  11. package/dist/components/Grid/SimpleGrid.d.ts +6 -3
  12. package/dist/components/Heading/Heading.d.ts +2 -5
  13. package/dist/components/HelperErrorText/HelperErrorText.d.ts +1 -5
  14. package/dist/components/Hero/Hero.d.ts +13 -9
  15. package/dist/components/Icons/Icon.d.ts +6 -5
  16. package/dist/components/Icons/IconSvgs.d.ts +21 -21
  17. package/dist/components/Image/Image.d.ts +8 -5
  18. package/dist/components/Link/Link.d.ts +1 -9
  19. package/dist/components/List/List.d.ts +7 -11
  20. package/dist/components/Logo/Logo.d.ts +2 -5
  21. package/dist/components/Logo/LogoSvgs.d.ts +39 -39
  22. package/dist/components/Modal/Modal.d.ts +28 -8
  23. package/dist/components/Notification/Notification.d.ts +1 -1
  24. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +2 -1
  25. package/dist/components/RadioGroup/RadioGroup.d.ts +1 -1
  26. package/dist/components/SearchBar/SearchBar.d.ts +3 -2
  27. package/dist/components/Select/Select.d.ts +2 -5
  28. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -4
  29. package/dist/components/SkipNavigation/SkipNavigation.d.ts +17 -0
  30. package/dist/components/StatusBadge/StatusBadge.d.ts +2 -3
  31. package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
  32. package/dist/components/Table/Table.d.ts +1 -1
  33. package/dist/components/Template/Template.d.ts +2 -0
  34. package/dist/components/Text/Text.d.ts +1 -1
  35. package/dist/components/TextInput/TextInput.d.ts +21 -9
  36. package/dist/components/Toggle/Toggle.d.ts +1 -5
  37. package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
  38. package/dist/design-system-react-components.cjs.development.js +977 -1213
  39. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  40. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  41. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  42. package/dist/design-system-react-components.esm.js +976 -1276
  43. package/dist/design-system-react-components.esm.js.map +1 -1
  44. package/dist/helpers/types.d.ts +1 -0
  45. package/dist/index.d.ts +27 -48
  46. package/dist/styles.css +1 -1
  47. package/dist/theme/components/buttonGroup.d.ts +11 -0
  48. package/dist/theme/components/card.d.ts +104 -8
  49. package/dist/theme/components/componentWrapper.d.ts +4 -3
  50. package/dist/theme/components/customTable.d.ts +11 -14
  51. package/dist/theme/components/fieldset.d.ts +4 -3
  52. package/dist/theme/components/helperErrorText.d.ts +4 -3
  53. package/dist/theme/components/hero.d.ts +1 -1
  54. package/dist/theme/components/horizontalRule.d.ts +4 -3
  55. package/dist/theme/components/icon.d.ts +47743 -1
  56. package/dist/theme/components/image.d.ts +563 -10
  57. package/dist/theme/components/label.d.ts +4 -3
  58. package/dist/theme/components/list.d.ts +6 -7
  59. package/dist/theme/components/logo.d.ts +474 -1
  60. package/dist/theme/components/notification.d.ts +20 -16
  61. package/dist/theme/components/progressIndicator.d.ts +6 -4
  62. package/dist/theme/components/select.d.ts +4 -10
  63. package/dist/theme/components/skeletonLoader.d.ts +14 -10
  64. package/dist/theme/components/skipNavigation.d.ts +22 -0
  65. package/dist/theme/components/slider.d.ts +7 -6
  66. package/dist/theme/components/structuredContent.d.ts +10 -9
  67. package/dist/theme/components/text.d.ts +7 -1
  68. package/dist/theme/components/toggle.d.ts +6 -4
  69. package/dist/theme/provider.d.ts +2 -4
  70. package/dist/utils/componentCategories.d.ts +1 -1
  71. package/dist/utils/interfaces.d.ts +5 -0
  72. package/dist/utils/utils.d.ts +2 -18
  73. package/package.json +15 -16
  74. package/src/__tests__/setup.ts +3 -3
  75. package/src/__tests__/utils/utils.test.ts +1 -23
  76. package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +22 -14
  77. package/src/components/Accordion/Accordion.stories.mdx +43 -44
  78. package/src/components/Accordion/Accordion.test.tsx +5 -13
  79. package/src/components/Accordion/Accordion.tsx +14 -18
  80. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +6 -6
  81. package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
  82. package/src/components/Autosuggest/Autosuggest.stories.tsx +23 -25
  83. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -37
  84. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +4 -17
  85. package/src/components/Breadcrumbs/Breadcrumbs.tsx +18 -21
  86. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +1 -100
  87. package/src/components/Button/Button.stories.mdx +89 -126
  88. package/src/components/Button/Button.test.tsx +16 -30
  89. package/src/components/Button/Button.tsx +14 -20
  90. package/src/components/ButtonGroup/ButtonGroup.stories.mdx +147 -0
  91. package/src/components/ButtonGroup/ButtonGroup.test.tsx +141 -0
  92. package/src/components/ButtonGroup/ButtonGroup.tsx +99 -0
  93. package/src/components/ButtonGroup/__snapshots__/ButtonGroup.test.tsx.snap +117 -0
  94. package/src/components/Card/Card.stories.mdx +143 -177
  95. package/src/components/Card/Card.test.tsx +36 -97
  96. package/src/components/Card/Card.tsx +78 -74
  97. package/src/components/Card/__snapshots__/Card.test.tsx.snap +1 -1
  98. package/src/components/Chakra/Box.stories.mdx +2 -6
  99. package/src/components/Chakra/Center.stories.mdx +5 -23
  100. package/src/components/Chakra/Flex.stories.mdx +4 -6
  101. package/src/components/Chakra/Stack.stories.mdx +9 -10
  102. package/src/components/Checkbox/Checkbox.stories.mdx +1 -1
  103. package/src/components/Checkbox/Checkbox.test.tsx +2 -2
  104. package/src/components/Checkbox/Checkbox.tsx +20 -13
  105. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +9 -9
  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 +24 -35
  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 +1 -1
  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 +62 -62
  193. package/src/components/StyleGuide/ColorCard.tsx +2 -4
  194. package/src/components/StyleGuide/Colors.stories.mdx +7 -8
  195. package/src/components/StyleGuide/DesignTokens.stories.mdx +5 -7
  196. package/src/components/StyleGuide/Forms.stories.mdx +0 -1
  197. package/src/components/StyleGuide/Iconography.stories.mdx +59 -77
  198. package/src/components/StyleGuide/Spacing.stories.mdx +0 -1
  199. package/src/components/StyleGuide/Typography.stories.mdx +15 -18
  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/index.ts +4 -0
  252. package/src/theme/provider.tsx +1 -1
  253. package/src/utils/componentCategories.ts +13 -5
  254. package/src/utils/interfaces.ts +5 -0
  255. package/src/utils/utils.ts +2 -32
  256. package/dist/components/Accordion/AccordionTypes.d.ts +0 -5
  257. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +0 -8
  258. package/dist/components/Button/ButtonTypes.d.ts +0 -8
  259. package/dist/components/DatePicker/DatePickerTypes.d.ts +0 -5
  260. package/dist/components/Form/FormTypes.d.ts +0 -2
  261. package/dist/components/Grid/GridTypes.d.ts +0 -9
  262. package/dist/components/Heading/HeadingTypes.d.ts +0 -14
  263. package/dist/components/Hero/HeroTypes.d.ts +0 -12
  264. package/dist/components/Icons/IconTypes.d.ts +0 -77
  265. package/dist/components/Image/ImageTypes.d.ts +0 -22
  266. package/dist/components/Link/LinkTypes.d.ts +0 -8
  267. package/dist/components/List/ListTypes.d.ts +0 -5
  268. package/dist/components/Logo/LogoTypes.d.ts +0 -54
  269. package/dist/components/Notification/NotificationTypes.d.ts +0 -5
  270. package/dist/components/ProgressIndicator/ProgressIndicatorTypes.d.ts +0 -8
  271. package/dist/components/Select/SelectTypes.d.ts +0 -8
  272. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -5
  273. package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +0 -5
  274. package/dist/components/StructuredContent/StructuredContentTypes.d.ts +0 -5
  275. package/dist/components/Text/TextTypes.d.ts +0 -6
  276. package/dist/components/TextInput/TextInputTypes.d.ts +0 -25
  277. package/dist/components/Toggle/ToggleTypes.d.ts +0 -4
  278. package/dist/components/VideoPlayer/VideoPlayerTypes.d.ts +0 -9
  279. package/dist/helpers/enums.d.ts +0 -4
  280. package/dist/utils/siteSections.d.ts +0 -2
  281. package/src/components/Accordion/AccordionTypes.tsx +0 -5
  282. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +0 -8
  283. package/src/components/Button/ButtonTypes.tsx +0 -8
  284. package/src/components/DatePicker/DatePickerTypes.tsx +0 -5
  285. package/src/components/Form/FormTypes.tsx +0 -3
  286. package/src/components/Grid/GridTypes.tsx +0 -9
  287. package/src/components/Heading/HeadingTypes.tsx +0 -15
  288. package/src/components/Hero/HeroTypes.tsx +0 -20
  289. package/src/components/Icons/IconTypes.tsx +0 -83
  290. package/src/components/Image/ImageTypes.ts +0 -24
  291. package/src/components/Link/LinkTypes.tsx +0 -8
  292. package/src/components/List/ListTypes.tsx +0 -5
  293. package/src/components/Logo/LogoTypes.tsx +0 -56
  294. package/src/components/Modal/_Modal.scss +0 -18
  295. package/src/components/Notification/NotificationTypes.tsx +0 -5
  296. package/src/components/ProgressIndicator/ProgressIndicatorTypes.ts +0 -8
  297. package/src/components/Select/SelectTypes.tsx +0 -10
  298. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
  299. package/src/components/StatusBadge/StatusBadgeTypes.tsx +0 -5
  300. package/src/components/StructuredContent/StructuredContentTypes.tsx +0 -5
  301. package/src/components/Text/TextTypes.tsx +0 -6
  302. package/src/components/TextInput/TextInputTypes.tsx +0 -48
  303. package/src/components/Toggle/ToggleTypes.tsx +0 -4
  304. package/src/components/VideoPlayer/VideoPlayerTypes.tsx +0 -10
  305. package/src/helpers/enums.ts +0 -4
  306. package/src/utils/siteSections.ts +0 -10
@@ -9,13 +9,12 @@ exports[`Checkbox renders the UI snapshot correctly 1`] = `
9
9
  column
10
10
  </legend>
11
11
  <div
12
- aria-label={null}
13
12
  className="chakra-stack css-1wdv1uh"
14
13
  data-testid="checkbox-group"
15
14
  id="column"
16
15
  >
17
16
  <label
18
- className="chakra-checkbox css-1cgy6rg"
17
+ className="chakra-checkbox css-scawxr"
19
18
  onClick={[Function]}
20
19
  >
21
20
  <input
@@ -76,7 +75,7 @@ exports[`Checkbox renders the UI snapshot correctly 1`] = `
76
75
  </span>
77
76
  </label>
78
77
  <label
79
- className="chakra-checkbox css-1cgy6rg"
78
+ className="chakra-checkbox css-scawxr"
80
79
  onClick={[Function]}
81
80
  >
82
81
  <input
@@ -149,13 +148,12 @@ exports[`Checkbox renders the UI snapshot correctly 2`] = `
149
148
  row
150
149
  </legend>
151
150
  <div
152
- aria-label={null}
153
151
  className="chakra-stack css-1objuxj"
154
152
  data-testid="checkbox-group"
155
153
  id="row"
156
154
  >
157
155
  <label
158
- className="chakra-checkbox css-1cgy6rg"
156
+ className="chakra-checkbox css-scawxr"
159
157
  onClick={[Function]}
160
158
  >
161
159
  <input
@@ -216,7 +214,7 @@ exports[`Checkbox renders the UI snapshot correctly 2`] = `
216
214
  </span>
217
215
  </label>
218
216
  <label
219
- className="chakra-checkbox css-1cgy6rg"
217
+ className="chakra-checkbox css-scawxr"
220
218
  onClick={[Function]}
221
219
  >
222
220
  <input
@@ -295,7 +293,7 @@ exports[`Checkbox renders the UI snapshot correctly 3`] = `
295
293
  id="noLabel"
296
294
  >
297
295
  <label
298
- className="chakra-checkbox css-1cgy6rg"
296
+ className="chakra-checkbox css-scawxr"
299
297
  onClick={[Function]}
300
298
  >
301
299
  <input
@@ -356,7 +354,7 @@ exports[`Checkbox renders the UI snapshot correctly 3`] = `
356
354
  </span>
357
355
  </label>
358
356
  <label
359
- className="chakra-checkbox css-1cgy6rg"
357
+ className="chakra-checkbox css-scawxr"
360
358
  onClick={[Function]}
361
359
  >
362
360
  <input
@@ -429,13 +427,12 @@ exports[`Checkbox renders the UI snapshot correctly 4`] = `
429
427
  helperText
430
428
  </legend>
431
429
  <div
432
- aria-label={null}
433
430
  className="chakra-stack css-1wdv1uh"
434
431
  data-testid="checkbox-group"
435
432
  id="helperText"
436
433
  >
437
434
  <label
438
- className="chakra-checkbox css-1cgy6rg"
435
+ className="chakra-checkbox css-scawxr"
439
436
  onClick={[Function]}
440
437
  >
441
438
  <input
@@ -496,7 +493,7 @@ exports[`Checkbox renders the UI snapshot correctly 4`] = `
496
493
  </span>
497
494
  </label>
498
495
  <label
499
- className="chakra-checkbox css-1cgy6rg"
496
+ className="chakra-checkbox css-scawxr"
500
497
  onClick={[Function]}
501
498
  >
502
499
  <input
@@ -581,13 +578,12 @@ exports[`Checkbox renders the UI snapshot correctly 5`] = `
581
578
  invalidText
582
579
  </legend>
583
580
  <div
584
- aria-label={null}
585
581
  className="chakra-stack css-1wdv1uh"
586
582
  data-testid="checkbox-group"
587
583
  id="invalidText"
588
584
  >
589
585
  <label
590
- className="chakra-checkbox css-1cgy6rg"
586
+ className="chakra-checkbox css-scawxr"
591
587
  onClick={[Function]}
592
588
  >
593
589
  <input
@@ -648,7 +644,7 @@ exports[`Checkbox renders the UI snapshot correctly 5`] = `
648
644
  </span>
649
645
  </label>
650
646
  <label
651
- className="chakra-checkbox css-1cgy6rg"
647
+ className="chakra-checkbox css-scawxr"
652
648
  onClick={[Function]}
653
649
  >
654
650
  <input
@@ -721,13 +717,12 @@ exports[`Checkbox renders the UI snapshot correctly 6`] = `
721
717
  no optional or required label
722
718
  </legend>
723
719
  <div
724
- aria-label={null}
725
720
  className="chakra-stack css-1wdv1uh"
726
721
  data-testid="checkbox-group"
727
722
  id="noRequiredLabel"
728
723
  >
729
724
  <label
730
- className="chakra-checkbox css-1cgy6rg"
725
+ className="chakra-checkbox css-scawxr"
731
726
  onClick={[Function]}
732
727
  >
733
728
  <input
@@ -788,7 +783,7 @@ exports[`Checkbox renders the UI snapshot correctly 6`] = `
788
783
  </span>
789
784
  </label>
790
785
  <label
791
- className="chakra-checkbox css-1cgy6rg"
786
+ className="chakra-checkbox css-scawxr"
792
787
  onClick={[Function]}
793
788
  >
794
789
  <input
@@ -864,13 +859,12 @@ exports[`Checkbox renders the UI snapshot correctly 7`] = `
864
859
  </span>
865
860
  </legend>
866
861
  <div
867
- aria-label={null}
868
862
  className="chakra-stack css-1wdv1uh"
869
863
  data-testid="checkbox-group"
870
864
  id="required"
871
865
  >
872
866
  <label
873
- className="chakra-checkbox css-1cgy6rg"
867
+ className="chakra-checkbox css-scawxr"
874
868
  onClick={[Function]}
875
869
  >
876
870
  <input
@@ -931,7 +925,7 @@ exports[`Checkbox renders the UI snapshot correctly 7`] = `
931
925
  </span>
932
926
  </label>
933
927
  <label
934
- className="chakra-checkbox css-1cgy6rg"
928
+ className="chakra-checkbox css-scawxr"
935
929
  onClick={[Function]}
936
930
  >
937
931
  <input
@@ -1004,13 +998,12 @@ exports[`Checkbox renders the UI snapshot correctly 8`] = `
1004
998
  invalid
1005
999
  </legend>
1006
1000
  <div
1007
- aria-label={null}
1008
1001
  className="chakra-stack css-1wdv1uh"
1009
1002
  data-testid="checkbox-group"
1010
1003
  id="invalid"
1011
1004
  >
1012
1005
  <label
1013
- className="chakra-checkbox css-1cgy6rg"
1006
+ className="chakra-checkbox css-scawxr"
1014
1007
  data-invalid=""
1015
1008
  onClick={[Function]}
1016
1009
  >
@@ -1074,7 +1067,7 @@ exports[`Checkbox renders the UI snapshot correctly 8`] = `
1074
1067
  </span>
1075
1068
  </label>
1076
1069
  <label
1077
- className="chakra-checkbox css-1cgy6rg"
1070
+ className="chakra-checkbox css-scawxr"
1078
1071
  data-invalid=""
1079
1072
  onClick={[Function]}
1080
1073
  >
@@ -1150,13 +1143,12 @@ exports[`Checkbox renders the UI snapshot correctly 9`] = `
1150
1143
  disabled
1151
1144
  </legend>
1152
1145
  <div
1153
- aria-label={null}
1154
1146
  className="chakra-stack css-1wdv1uh"
1155
1147
  data-testid="checkbox-group"
1156
1148
  id="disabled"
1157
1149
  >
1158
1150
  <label
1159
- className="chakra-checkbox css-1cgy6rg"
1151
+ className="chakra-checkbox css-scawxr"
1160
1152
  data-disabled=""
1161
1153
  onClick={[Function]}
1162
1154
  >
@@ -1220,7 +1212,7 @@ exports[`Checkbox renders the UI snapshot correctly 9`] = `
1220
1212
  </span>
1221
1213
  </label>
1222
1214
  <label
1223
- className="chakra-checkbox css-1cgy6rg"
1215
+ className="chakra-checkbox css-scawxr"
1224
1216
  data-disabled=""
1225
1217
  onClick={[Function]}
1226
1218
  >
@@ -1296,13 +1288,12 @@ exports[`Checkbox renders the UI snapshot correctly 10`] = `
1296
1288
  jsxLabels
1297
1289
  </legend>
1298
1290
  <div
1299
- aria-label={null}
1300
1291
  className="chakra-stack css-1wdv1uh"
1301
1292
  data-testid="checkbox-group"
1302
1293
  id="jsxLabels"
1303
1294
  >
1304
1295
  <label
1305
- className="chakra-checkbox css-1cgy6rg"
1296
+ className="chakra-checkbox css-scawxr"
1306
1297
  onClick={[Function]}
1307
1298
  >
1308
1299
  <input
@@ -1375,7 +1366,7 @@ exports[`Checkbox renders the UI snapshot correctly 10`] = `
1375
1366
  </span>
1376
1367
  </label>
1377
1368
  <label
1378
- className="chakra-checkbox css-1cgy6rg"
1369
+ className="chakra-checkbox css-scawxr"
1379
1370
  onClick={[Function]}
1380
1371
  >
1381
1372
  <input
@@ -1460,13 +1451,12 @@ exports[`Checkbox renders the UI snapshot correctly 11`] = `
1460
1451
  chakraProps
1461
1452
  </legend>
1462
1453
  <div
1463
- aria-label={null}
1464
1454
  className="chakra-stack css-1wdv1uh"
1465
1455
  data-testid="checkbox-group"
1466
1456
  id="chakraProps"
1467
1457
  >
1468
1458
  <label
1469
- className="chakra-checkbox css-1cgy6rg"
1459
+ className="chakra-checkbox css-scawxr"
1470
1460
  onClick={[Function]}
1471
1461
  >
1472
1462
  <input
@@ -1527,7 +1517,7 @@ exports[`Checkbox renders the UI snapshot correctly 11`] = `
1527
1517
  </span>
1528
1518
  </label>
1529
1519
  <label
1530
- className="chakra-checkbox css-1cgy6rg"
1520
+ className="chakra-checkbox css-scawxr"
1531
1521
  onClick={[Function]}
1532
1522
  >
1533
1523
  <input
@@ -1601,13 +1591,12 @@ exports[`Checkbox renders the UI snapshot correctly 12`] = `
1601
1591
  otherProps
1602
1592
  </legend>
1603
1593
  <div
1604
- aria-label={null}
1605
1594
  className="chakra-stack css-1wdv1uh"
1606
1595
  data-testid="checkbox-group"
1607
1596
  id="otherProps"
1608
1597
  >
1609
1598
  <label
1610
- className="chakra-checkbox css-1cgy6rg"
1599
+ className="chakra-checkbox css-scawxr"
1611
1600
  onClick={[Function]}
1612
1601
  >
1613
1602
  <input
@@ -1668,7 +1657,7 @@ exports[`Checkbox renders the UI snapshot correctly 12`] = `
1668
1657
  </span>
1669
1658
  </label>
1670
1659
  <label
1671
- className="chakra-checkbox css-1cgy6rg"
1660
+ className="chakra-checkbox css-scawxr"
1672
1661
  onClick={[Function]}
1673
1662
  >
1674
1663
  <input
@@ -2,7 +2,6 @@ import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
2
2
  import * as React from "react";
3
3
 
4
4
  import Heading from "../Heading/Heading";
5
- import { HeadingLevels } from "../Heading/HeadingTypes";
6
5
  import HelperErrorText, {
7
6
  HelperErrorTextType,
8
7
  } from "../HelperErrorText/HelperErrorText";
@@ -39,7 +38,7 @@ export const ComponentWrapper = chakra(
39
38
  } = props;
40
39
  const hasChildren = !!children;
41
40
  const styles = useMultiStyleConfig("ComponentWrapper", { hasChildren });
42
- const footnote: HelperErrorTextType = isInvalid ? invalidText : helperText;
41
+ const footnote = isInvalid ? invalidText : helperText;
43
42
 
44
43
  // Note: Typescript warns when there are no children passed and
45
44
  // doesn't compile. This is meant to log in non-Typescript apps.
@@ -49,21 +48,15 @@ export const ComponentWrapper = chakra(
49
48
 
50
49
  return (
51
50
  <Box __css={styles} {...rest}>
52
- {headingText && (
53
- <Heading
54
- id={`${id}-heading`}
55
- level={HeadingLevels.Two}
56
- text={headingText}
57
- />
58
- )}
51
+ {headingText && <Heading id={`${id}-heading`} text={headingText} />}
59
52
  {descriptionText && <Text>{descriptionText}</Text>}
60
53
  {children}
61
54
  {footnote && (
62
55
  <HelperErrorText
63
- additionalStyles={styles.helperErrorText}
64
56
  id={`${id}-helperText`}
65
57
  isInvalid={isInvalid}
66
58
  text={footnote}
59
+ __css={styles.helperErrorText}
67
60
  />
68
61
  )}
69
62
  </Box>
@@ -8,15 +8,8 @@ import {
8
8
  import { withDesign } from "storybook-addon-designs";
9
9
 
10
10
  import DatePicker from "./DatePicker";
11
- import { DatePickerTypes } from "./DatePickerTypes";
12
11
  import { getCategory } from "../../utils/componentCategories";
13
12
  import DSProvider from "../../theme/provider";
14
- import { getStorybookEnumValues } from "../../utils/utils";
15
-
16
- export const enumValues = getStorybookEnumValues(
17
- DatePickerTypes,
18
- "DatePickerTypes"
19
- );
20
13
 
21
14
  <Meta
22
15
  title={getCategory("DatePicker")}
@@ -36,8 +29,7 @@ export const enumValues = getStorybookEnumValues(
36
29
  },
37
30
  dateType: {
38
31
  control: { type: "select" },
39
- table: { defaultValue: { summary: "DatePickerTypes.Full" } },
40
- options: enumValues.options,
32
+ table: { defaultValue: { summary: "full" } },
41
33
  },
42
34
  id: { control: false },
43
35
  isDateRange: {
@@ -78,7 +70,7 @@ export const enumValues = getStorybookEnumValues(
78
70
  | Component Version | DS Version |
79
71
  | ----------------- | ---------- |
80
72
  | Added | `0.24.0` |
81
- | Latest | `0.26.0` |
73
+ | Latest | `0.28.0` |
82
74
 
83
75
  ## Table of Contents
84
76
 
@@ -107,7 +99,7 @@ also be added through props.
107
99
  args={{
108
100
  className: undefined,
109
101
  dateFormat: "yyyy-MM-dd",
110
- dateType: "DatePickerTypes.Full",
102
+ dateType: "full",
111
103
  helperText: "Note that the Library may be closed on Sundays.",
112
104
  helperTextFrom: "Select start date.",
113
105
  helperTextTo: "Select end date.",
@@ -131,13 +123,7 @@ also be added through props.
131
123
  showRequiredLabel: true,
132
124
  }}
133
125
  >
134
- {(args) => (
135
- <DatePicker
136
- {...args}
137
- dateType={enumValues.getValue(args.dateType)}
138
- onChange={undefined}
139
- />
140
- )}
126
+ {(args) => <DatePicker {...args} onChange={undefined} />}
141
127
  </Story>
142
128
  </Canvas>
143
129
 
@@ -182,7 +168,7 @@ popup calendar.
182
168
  <DatePicker
183
169
  id="date-range"
184
170
  dateFormat="yyyy-MM-dd"
185
- dateType={DatePickerTypes.Full}
171
+ dateType="full"
186
172
  minDate="1/1/2022"
187
173
  maxDate="7/1/2022"
188
174
  labelText="Select the date range you want to visit NYPL"
@@ -204,19 +190,19 @@ popup calendar.
204
190
  By default, the `DatePicker` will display the input date value in the full
205
191
  format that contains the year, month, and day such as "2021-01-30". Although
206
192
  this is the default, it can be explicitly set through the `dateType` prop with
207
- value of `DatePickerTypes.Full`.
193
+ value of `"full"`.
208
194
 
209
195
  ### Month Date Input
210
196
 
211
197
  It's possible to select dates by skipping the day value and only selecting
212
- the month and the year when `dateType` is set to `DatePickerTypes.Month`. Note
198
+ the month and the year when `dateType` is set to `"month"`. Note
213
199
  that all 12 months will appear in the popup calendar with their abbreviated names.
214
200
 
215
201
  <Canvas withToolbar>
216
202
  <Story name="Month Date Input">
217
203
  <DatePicker
218
204
  id="month-date"
219
- dateType={DatePickerTypes.Month}
205
+ dateType="month"
220
206
  labelText="Select the month you want to visit NYPL"
221
207
  helperText="Note that the Library may be closed on Sundays."
222
208
  invalidText="Please select a valid month."
@@ -227,14 +213,14 @@ that all 12 months will appear in the popup calendar with their abbreviated name
227
213
  ### Year Date Input
228
214
 
229
215
  It's possible to select dates by only the year when `dateType` is set to
230
- `DatePickerTypes.Year`. Note that only 12 values will appear in the popup
231
- calendar; the four previous years, the current year, and the next seven years.
216
+ `"year"`. Note that only 12 values will appear in the popup calendar; the four
217
+ previous years, the current year, and the next seven years.
232
218
 
233
219
  <Canvas withToolbar>
234
220
  <Story name="Year Date Input">
235
221
  <DatePicker
236
222
  id="year-date"
237
- dateType={DatePickerTypes.Year}
223
+ dateType="year"
238
224
  labelText="Select the year you want to visit NYPL"
239
225
  helperText="Note that the Library may be closed on Sundays."
240
226
  />
@@ -249,7 +235,7 @@ calendar; the four previous years, the current year, and the next seven years.
249
235
  <DSProvider>
250
236
  <DatePicker
251
237
  id="invalid-date"
252
- dateType={DatePickerTypes.Full}
238
+ dateType="full"
253
239
  labelText="Select the year you want to visit NYPL"
254
240
  helperText="Note that the Library may be closed on Sundays."
255
241
  invalidText="Please select a valid date."
@@ -265,7 +251,7 @@ calendar; the four previous years, the current year, and the next seven years.
265
251
  <DSProvider>
266
252
  <DatePicker
267
253
  id="disabled-date"
268
- dateType={DatePickerTypes.Full}
254
+ dateType="full"
269
255
  labelText="Select the year you want to visit NYPL"
270
256
  isDateRange
271
257
  isDisabled
@@ -281,8 +267,8 @@ date input, can be hidden when `showRequiredLabel` is set to `false`.
281
267
  <Canvas>
282
268
  <DSProvider>
283
269
  <DatePicker
284
- id="disabled-date"
285
- dateType={DatePickerTypes.Full}
270
+ id="required-date"
271
+ dateType="full"
286
272
  labelText="Select the year you want to visit NYPL"
287
273
  isDateRange
288
274
  isRequired
@@ -305,7 +291,7 @@ styleguide, we display dates as "year-month-day" by default.
305
291
  <DSProvider>
306
292
  <DatePicker
307
293
  id="init-dates"
308
- dateType={DatePickerTypes.Full}
294
+ dateType="full"
309
295
  labelText="Select the date you want to visit NYPL"
310
296
  initialDate="12/1/21"
311
297
  initialDateTo="12/10/21"
@@ -325,7 +311,7 @@ written in [ISO-8601 format](https://www.w3.org/TR/NOTE-datetime).
325
311
  <DatePicker
326
312
  id="format-date"
327
313
  dateFormat="MM-dd-yyyy"
328
- dateType={DatePickerTypes.Full}
314
+ dateType="full"
329
315
  labelText="Select the date you want to visit NYPL"
330
316
  initialDate="12/1/21"
331
317
  initialDateTo="12/10/21"
@@ -345,7 +331,7 @@ February to see the dates that are available to select in 2022.
345
331
  <DatePicker
346
332
  id="max-min-dates"
347
333
  dateFormat="MM-dd-yyyy"
348
- dateType={DatePickerTypes.Full}
334
+ dateType="full"
349
335
  labelText="Select the date you want to visit NYPL"
350
336
  minDate="1/1/2022"
351
337
  maxDate="3/1/2022"
@@ -358,10 +344,10 @@ February to see the dates that are available to select in 2022.
358
344
 
359
345
  ### Controlled Component Using `onChange` prop
360
346
 
361
- If your application uses controlled React components and the Reservoir Design
347
+ If your application uses controlled React components and the Reservoir Design
362
348
  System (DS) DatePicker must be controlled, you can extract the data through the
363
349
  `onChange` prop function. This will be called every time the date is updated in
364
- either the start date input field or the end date input field. The returned
350
+ either the start date input field or the end date input field. The returned
365
351
  data is an object with `startDate` and `endDate` keys and `Date` object values.
366
352
 
367
353
  ```tsx
@@ -381,7 +367,7 @@ const onChange = (data) => {
381
367
  // Example of the DS DatePicker instance with the function above:
382
368
  <DatePicker
383
369
  id="date-range"
384
- dateType={DatePickerTypes.Full}
370
+ dateType="full"
385
371
  labelText="Select the date range you want to visit NYPL"
386
372
  invalidText="Please select a valid date range."
387
373
  onChange={onChange}
@@ -425,7 +411,7 @@ const submitForm = (formData) => {
425
411
  >
426
412
  <DatePicker
427
413
  id="date-range"
428
- dateType={DatePickerTypes.Full}
414
+ dateType="full"
429
415
  labelText="Select the date range you want to visit NYPL"
430
416
  nameFrom="visitDateFrom"
431
417
  nameTo="visitDateTo"
@@ -446,7 +432,7 @@ const refEnd = React.createRef<TextInputRefType>();
446
432
  // ...
447
433
  <DatePicker
448
434
  id="date-range"
449
- dateType={DatePickerTypes.Full}
435
+ dateType="full"
450
436
  labelText="Select the date range you want to visit NYPL"
451
437
  nameFrom="visitDateFrom"
452
438
  nameTo="visitDateTo"
@@ -4,13 +4,12 @@ import { axe } from "jest-axe";
4
4
  import userEvent from "@testing-library/user-event";
5
5
  import renderer from "react-test-renderer";
6
6
 
7
- import DatePicker from "./DatePicker";
8
- import { DatePickerTypes } from "./DatePickerTypes";
7
+ import DatePicker, { DatePickerTypes, FullDateType } from "./DatePicker";
9
8
  import { TextInputRefType } from "../TextInput/TextInput";
10
9
 
11
10
  /** This adds a "0" padding for date values under "10". */
12
- const strPad = (n) => String("0" + n).slice(-2);
13
- const monthArray = [
11
+ const strPad = (n: number) => String("0" + n).slice(-2);
12
+ const monthArray: string[] = [
14
13
  "January",
15
14
  "February",
16
15
  "March",
@@ -58,11 +57,11 @@ describe("DatePicker", () => {
58
57
  return [year, month, day];
59
58
  };
60
59
  /** Returns today's date in string format based on the DatePicker type. */
61
- const getTodaysDateDisplay = (type?) => {
60
+ const getTodaysDateDisplay = (type?: DatePickerTypes) => {
62
61
  const [year, month, day] = getTodaysValues();
63
- if (DatePickerTypes.Year === type) {
62
+ if ("year" === type) {
64
63
  return `${year}`;
65
- } else if (DatePickerTypes.Month === type) {
64
+ } else if ("month" === type) {
66
65
  return `${month}-${year}`;
67
66
  }
68
67
  return `${year}-${month}-${day}`;
@@ -106,12 +105,12 @@ describe("DatePicker", () => {
106
105
  render(
107
106
  <DatePicker
108
107
  id="datePicker"
109
- dateType={DatePickerTypes.Month}
108
+ dateType="month"
110
109
  labelText="Select the month you want to visit NYPL"
111
110
  />
112
111
  );
113
112
  const [year, month] = getTodaysValues();
114
- const date = getTodaysDateDisplay(DatePickerTypes.Month);
113
+ const date = getTodaysDateDisplay("month");
115
114
 
116
115
  expect(
117
116
  screen.getByLabelText(/Select the month you want to visit NYPL/i)
@@ -125,12 +124,12 @@ describe("DatePicker", () => {
125
124
  render(
126
125
  <DatePicker
127
126
  id="datePicker"
128
- dateType={DatePickerTypes.Year}
127
+ dateType="year"
129
128
  labelText="Select the month you want to visit NYPL"
130
129
  />
131
130
  );
132
131
  const [year] = getTodaysValues();
133
- const date = getTodaysDateDisplay(DatePickerTypes.Year);
132
+ const date = getTodaysDateDisplay("year");
134
133
 
135
134
  expect(
136
135
  screen.getByLabelText(/Select the month you want to visit NYPL/i)
@@ -316,8 +315,11 @@ describe("DatePicker", () => {
316
315
  });
317
316
 
318
317
  it("should pass the value to the `onChange` function", () => {
319
- let dateObject: any = {};
320
- const onChange = (data) => {
318
+ let dateObject: FullDateType = {
319
+ startDate: new Date(),
320
+ endDate: new Date(),
321
+ };
322
+ const onChange = (data: FullDateType) => {
321
323
  dateObject = data;
322
324
  };
323
325
  render(
@@ -370,7 +372,7 @@ describe("DatePicker", () => {
370
372
  it("should throw a warning when `onChange` is passed as well as a `ref` prop.", () => {
371
373
  const warn = jest.spyOn(console, "warn");
372
374
  const ref = React.createRef<TextInputRefType>();
373
- const onChange = (_data) => {};
375
+ const onChange = (_data: {}) => {};
374
376
  render(
375
377
  <DatePicker
376
378
  id="datePicker"
@@ -788,7 +790,7 @@ describe("DatePicker", () => {
788
790
  userEvent.click(screen.getByText(midMonthDay));
789
791
  // So only the month should change accordingly.
790
792
  const newMonthValue = `${newDayValue.substr(0, 5)}${strPad(
791
- "10"
793
+ 10
792
794
  )}${newDayValue.substr(7)}`;
793
795
  expect(screen.getByDisplayValue(newMonthValue)).toBeInTheDocument();
794
796
  });
@@ -797,7 +799,7 @@ describe("DatePicker", () => {
797
799
  render(
798
800
  <DatePicker
799
801
  id="datePicker"
800
- dateType={DatePickerTypes.Month}
802
+ dateType="month"
801
803
  labelText="Select the month you want to visit NYPL"
802
804
  />
803
805
  );
@@ -824,7 +826,7 @@ describe("DatePicker", () => {
824
826
  render(
825
827
  <DatePicker
826
828
  id="datePicker"
827
- dateType={DatePickerTypes.Month}
829
+ dateType="month"
828
830
  initialDate="4/1/1988"
829
831
  labelText="Select the month you want to visit NYPL"
830
832
  />
@@ -864,7 +866,7 @@ describe("DatePicker", () => {
864
866
  render(
865
867
  <DatePicker
866
868
  id="datePicker"
867
- dateType={DatePickerTypes.Year}
869
+ dateType="year"
868
870
  labelText="Select the year you want to visit NYPL"
869
871
  />
870
872
  );
@@ -902,7 +904,7 @@ describe("DatePicker", () => {
902
904
  render(
903
905
  <DatePicker
904
906
  id="datePicker"
905
- dateType={DatePickerTypes.Year}
907
+ dateType="year"
906
908
  labelText="Select the year you want to visit NYPL"
907
909
  />
908
910
  );