@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
@@ -19,7 +19,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 1`] = `
19
19
  id="linearBasic"
20
20
  >
21
21
  <div
22
- aria-label={null}
23
22
  aria-labelledby="linearBasic-label"
24
23
  aria-valuemax={100}
25
24
  aria-valuemin={0}
@@ -51,7 +50,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 2`] = `
51
50
  className="css-0"
52
51
  >
53
52
  <div
54
- aria-label={null}
55
53
  aria-labelledby="circularBasic-label"
56
54
  aria-valuemax={100}
57
55
  aria-valuemin={0}
@@ -112,7 +110,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 3`] = `
112
110
  >
113
111
  <div
114
112
  aria-label="Linear"
115
- aria-labelledby={null}
116
113
  aria-valuemax={100}
117
114
  aria-valuemin={0}
118
115
  aria-valuenow={50}
@@ -138,7 +135,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 4`] = `
138
135
  >
139
136
  <div
140
137
  aria-label="Circular"
141
- aria-labelledby={null}
142
138
  aria-valuemax={100}
143
139
  aria-valuemin={0}
144
140
  aria-valuenow={50}
@@ -191,7 +187,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 5`] = `
191
187
  id="linearIndeterminate"
192
188
  >
193
189
  <div
194
- aria-label={null}
195
190
  aria-labelledby="linearIndeterminate-label"
196
191
  aria-valuemax={100}
197
192
  aria-valuemin={0}
@@ -217,7 +212,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 6`] = `
217
212
  className="css-0"
218
213
  >
219
214
  <div
220
- aria-label={null}
221
215
  aria-labelledby="circularIndeterminate-label"
222
216
  aria-valuemax={100}
223
217
  aria-valuemin={0}
@@ -276,7 +270,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 7`] = `
276
270
  id="linearDarkMode"
277
271
  >
278
272
  <div
279
- aria-label={null}
280
273
  aria-labelledby="linearDarkMode-label"
281
274
  aria-valuemax={100}
282
275
  aria-valuemin={0}
@@ -308,7 +301,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 8`] = `
308
301
  className="css-0"
309
302
  >
310
303
  <div
311
- aria-label={null}
312
304
  aria-labelledby="circularDarkMode-label"
313
305
  aria-valuemax={100}
314
306
  aria-valuemin={0}
@@ -375,7 +367,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 9`] = `
375
367
  id="chakra"
376
368
  >
377
369
  <div
378
- aria-label={null}
379
370
  aria-labelledby="chakra-label"
380
371
  aria-valuemax={100}
381
372
  aria-valuemin={0}
@@ -419,7 +410,6 @@ exports[`ProgressIndicator Renders the UI snapshot correctly 10`] = `
419
410
  id="props"
420
411
  >
421
412
  <div
422
- aria-label={null}
423
413
  aria-labelledby="props-label"
424
414
  aria-valuemax={100}
425
415
  aria-valuemin={0}
@@ -53,7 +53,7 @@ import DSProvider from "../../theme/provider";
53
53
  | Component Version | DS Version |
54
54
  | ----------------- | ---------- |
55
55
  | Added | `0.22.0` |
56
- | Latest | `0.26.0` |
56
+ | Latest | `0.28.0` |
57
57
 
58
58
  ## Table of Contents
59
59
 
@@ -4,6 +4,7 @@ import {
4
4
  useMultiStyleConfig,
5
5
  } from "@chakra-ui/react";
6
6
  import * as React from "react";
7
+ import { AriaAttributes } from "../../utils/interfaces";
7
8
 
8
9
  import HelperErrorText, {
9
10
  HelperErrorTextType,
@@ -69,7 +70,7 @@ export const Radio = chakra(
69
70
  } = props;
70
71
  const styles = useMultiStyleConfig("Radio", {});
71
72
  const footnote = isInvalid ? invalidText : helperText;
72
- const attributes = {};
73
+ const ariaAttributes: AriaAttributes = {};
73
74
 
74
75
  if (!id) {
75
76
  console.warn(
@@ -83,10 +84,12 @@ export const Radio = chakra(
83
84
  "NYPL Reservoir Radio: `labelText` must be a string when `showLabel` is false."
84
85
  );
85
86
  }
86
- attributes["aria-label"] =
87
- labelText && footnote ? `${labelText} - ${footnote}` : labelText;
87
+ ariaAttributes["aria-label"] =
88
+ labelText && footnote
89
+ ? `${labelText} - ${footnote}`
90
+ : (labelText as string);
88
91
  } else if (footnote) {
89
- attributes["aria-describedby"] = `${id}-helperText`;
92
+ ariaAttributes["aria-describedby"] = `${id}-helperText`;
90
93
  }
91
94
 
92
95
  return (
@@ -104,17 +107,17 @@ export const Radio = chakra(
104
107
  ref={ref}
105
108
  alignItems="flex-start"
106
109
  __css={styles}
107
- {...attributes}
110
+ {...ariaAttributes}
108
111
  {...rest}
109
112
  >
110
113
  {showLabel && labelText}
111
114
  </ChakraRadio>
112
115
  {footnote && showHelperInvalidText && (
113
116
  <HelperErrorText
114
- additionalStyles={styles.helperErrorText}
115
117
  id={`${id}-helperText`}
116
118
  isInvalid={isInvalid}
117
119
  text={footnote}
120
+ __css={styles.helperErrorText}
118
121
  />
119
122
  )}
120
123
  </>
@@ -1,4 +1,4 @@
1
- import { ButtonGroup, Flex, Spacer } from "@chakra-ui/react";
1
+ import { Flex, Spacer } from "@chakra-ui/react";
2
2
  import {
3
3
  ArgsTable,
4
4
  Canvas,
@@ -9,16 +9,13 @@ import {
9
9
  import { withDesign } from "storybook-addon-designs";
10
10
 
11
11
  import Button from "../Button/Button";
12
+ import ButtonGroup from "../ButtonGroup/ButtonGroup";
12
13
  import Form from "../Form/Form";
13
14
  import Radio from "../Radio/Radio";
14
15
  import RadioGroup from "./RadioGroup";
15
- import { LayoutTypes } from "../../helpers/enums";
16
16
  import SimpleGrid from "../Grid/SimpleGrid";
17
17
  import { getCategory } from "../../utils/componentCategories";
18
18
  import DSProvider from "../../theme/provider";
19
- import { getStorybookEnumValues } from "../../utils/utils";
20
-
21
- export const enumValues = getStorybookEnumValues(LayoutTypes, "LayoutTypes");
22
19
 
23
20
  <Meta
24
21
  title={getCategory("RadioGroup")}
@@ -48,9 +45,7 @@ export const enumValues = getStorybookEnumValues(LayoutTypes, "LayoutTypes");
48
45
  table: { defaultValue: { summary: false } },
49
46
  },
50
47
  layout: {
51
- control: { type: "select" },
52
- table: { defaultValue: { summary: "LayoutTypes.Column" } },
53
- options: enumValues.options,
48
+ table: { defaultValue: { summary: "column" } },
54
49
  },
55
50
  key: { table: { disable: true } },
56
51
  onChange: { control: false },
@@ -72,7 +67,7 @@ export const enumValues = getStorybookEnumValues(LayoutTypes, "LayoutTypes");
72
67
  | Component Version | DS Version |
73
68
  | ----------------- | ---------- |
74
69
  | Added | `0.25.0` |
75
- | Latest | `0.26.0` |
70
+ | Latest | `0.28.0` |
76
71
 
77
72
  ## Table of Contents
78
73
 
@@ -106,7 +101,7 @@ export const enumValues = getStorybookEnumValues(LayoutTypes, "LayoutTypes");
106
101
  isInvalid: false,
107
102
  isRequired: false,
108
103
  labelText: "Standard Radio Group",
109
- layout: "LayoutTypes.Column",
104
+ layout: "column",
110
105
  name: "radio-story",
111
106
  onChange: undefined,
112
107
  showHelperInvalidText: true,
@@ -115,7 +110,7 @@ export const enumValues = getStorybookEnumValues(LayoutTypes, "LayoutTypes");
115
110
  }}
116
111
  >
117
112
  {(args) => (
118
- <RadioGroup {...args} layout={enumValues.getValue(args.layout)}>
113
+ <RadioGroup {...args}>
119
114
  <Radio id="main-2" labelText="Radio 2" value="2" />
120
115
  <Radio id="main-3" labelText="Radio 3" value="3" />
121
116
  <Radio id="main-4" labelText="Radio 4" value="4" />
@@ -163,7 +158,7 @@ a row.
163
158
  id="row"
164
159
  labelText="Row"
165
160
  name="row-example"
166
- layout={LayoutTypes.Row}
161
+ layout="row"
167
162
  >
168
163
  <Radio id="row-2" labelText="Radio 2" value="2" />
169
164
  <Radio id="row-3" labelText="Radio 3" value="3" />
@@ -420,7 +415,7 @@ export function RadioGroupUncontrolledExample() {
420
415
  console.log(`Uncontrolled example. Selected: ${radioGroupValue}`);
421
416
  };
422
417
  return (
423
- <Form onSubmit={onSubmit}>
418
+ <Form id="form" onSubmit={onSubmit}>
424
419
  <SimpleGrid columns="1">
425
420
  <RadioGroup
426
421
  defaultValue="3"
@@ -434,7 +429,9 @@ export function RadioGroupUncontrolledExample() {
434
429
  <Radio id="4" labelText="Radio 4" value="4" />
435
430
  </RadioGroup>
436
431
  <ButtonGroup>
437
- <Button type="submit">Submit</Button>
432
+ <Button id="submit" type="submit">
433
+ Submit
434
+ </Button>
438
435
  </ButtonGroup>
439
436
  </SimpleGrid>
440
437
  </Form>
@@ -451,7 +448,7 @@ export function RadioGroupUncontrolledExample() {
451
448
  console.log(`Uncontrolled example. Selected: ${radioGroupValue}`);
452
449
  };
453
450
  return (
454
- <Form onSubmit={onSubmit}>
451
+ <Form id="form" onSubmit={onSubmit}>
455
452
  <SimpleGrid columns="1">
456
453
  <RadioGroup
457
454
  defaultValue="3"
@@ -465,7 +462,9 @@ export function RadioGroupUncontrolledExample() {
465
462
  <Radio id="4" labelText="Radio 4" value="4" />
466
463
  </RadioGroup>
467
464
  <ButtonGroup>
468
- <Button type="submit">Submit</Button>
465
+ <Button id="submit" type="submit">
466
+ Submit
467
+ </Button>
469
468
  </ButtonGroup>
470
469
  </SimpleGrid>
471
470
  </Form>
@@ -7,7 +7,6 @@ import renderer from "react-test-renderer";
7
7
 
8
8
  import Radio from "../Radio/Radio";
9
9
  import RadioGroup from "./RadioGroup";
10
- import { LayoutTypes } from "../../helpers/enums";
11
10
 
12
11
  describe("Radio Accessibility", () => {
13
12
  it("passes axe accessibility with string labels", async () => {
@@ -154,7 +153,7 @@ describe("Radio Button", () => {
154
153
 
155
154
  it("sets the next value through the onChange function", () => {
156
155
  let newValue = "";
157
- const onChange = (value) => {
156
+ const onChange = (value: string) => {
158
157
  newValue = value;
159
158
  };
160
159
  render(
@@ -275,12 +274,7 @@ describe("Radio Button", () => {
275
274
  .toJSON();
276
275
  const row = renderer
277
276
  .create(
278
- <RadioGroup
279
- labelText="row"
280
- name="row"
281
- id="row"
282
- layout={LayoutTypes.Row}
283
- >
277
+ <RadioGroup labelText="row" name="row" id="row" layout="row">
284
278
  <Radio value="2" labelText="Radio 2" id="radio-2" />
285
279
  <Radio value="3" labelText="Radio 3" id="radio-3" />
286
280
  </RadioGroup>
@@ -12,7 +12,8 @@ import HelperErrorText, {
12
12
  } from "../HelperErrorText/HelperErrorText";
13
13
  import { spacing } from "../../theme/foundations/spacing";
14
14
  import Radio from "../Radio/Radio";
15
- import { LayoutTypes } from "../../helpers/enums";
15
+ import { LayoutTypes } from "../../helpers/types";
16
+
16
17
  export interface RadioGroupProps {
17
18
  /** Additional class name. */
18
19
  className?: string;
@@ -75,7 +76,7 @@ export const RadioGroup = chakra(
75
76
  isInvalid = false,
76
77
  isRequired = false,
77
78
  labelText,
78
- layout = LayoutTypes.Column,
79
+ layout = "column",
79
80
  name,
80
81
  onChange,
81
82
  showHelperInvalidText = true,
@@ -87,7 +88,7 @@ export const RadioGroup = chakra(
87
88
  const footnote: HelperErrorTextType = isInvalid
88
89
  ? invalidText
89
90
  : helperText;
90
- const spacingProp = layout === LayoutTypes.Column ? spacing.s : spacing.l;
91
+ const spacingProp = layout === "column" ? spacing.s : spacing.l;
91
92
  const newChildren: JSX.Element[] = [];
92
93
  // Get the Chakra-based styles for the custom elements in this component.
93
94
  const styles = useMultiStyleConfig("RadioGroup", { isFullWidth });
@@ -110,29 +111,32 @@ export const RadioGroup = chakra(
110
111
  }
111
112
 
112
113
  // Go through the Radio children and update them as needed.
113
- React.Children.map(children, (child: React.ReactElement, key) => {
114
- if (child?.type !== Radio) {
115
- // Special case for Storybook MDX documentation.
116
- if (child.props?.mdxType && child.props?.mdxType === "Radio") {
117
- noop();
118
- } else {
119
- console.warn(
120
- "NYPL Reservoir RadioGroup: Only `Radio` components are allowed " +
121
- "inside the `RadioGroup` component."
122
- );
114
+ React.Children.map(
115
+ children as JSX.Element,
116
+ (child: React.ReactElement, key) => {
117
+ if (child?.type !== Radio) {
118
+ // Special case for Storybook MDX documentation.
119
+ if (child.props?.mdxType && child.props?.mdxType === "Radio") {
120
+ noop();
121
+ } else {
122
+ console.warn(
123
+ "NYPL Reservoir RadioGroup: Only `Radio` components are allowed " +
124
+ "inside the `RadioGroup` component."
125
+ );
126
+ }
123
127
  }
124
- }
125
128
 
126
- if (child !== undefined && child !== null) {
127
- const newProps = {
128
- key,
129
- isDisabled,
130
- isInvalid,
131
- isRequired,
132
- };
133
- newChildren.push(React.cloneElement(child, newProps));
129
+ if (child !== undefined && child !== null) {
130
+ const newProps = {
131
+ key,
132
+ isDisabled,
133
+ isInvalid,
134
+ isRequired,
135
+ };
136
+ newChildren.push(React.cloneElement(child, newProps));
137
+ }
134
138
  }
135
- });
139
+ );
136
140
 
137
141
  return (
138
142
  <Fieldset
@@ -151,10 +155,10 @@ export const RadioGroup = chakra(
151
155
  </ChakraRadioGroup>
152
156
  {footnote && showHelperInvalidText && (
153
157
  <HelperErrorText
154
- additionalStyles={styles.helperErrorText}
155
158
  id={`${id}-helperErrorText`}
156
159
  isInvalid={isInvalid}
157
160
  text={footnote}
161
+ __css={styles.helperErrorText}
158
162
  />
159
163
  )}
160
164
  </Fieldset>
@@ -60,7 +60,7 @@ import DSProvider from "../../theme/provider";
60
60
  | Component Version | DS Version |
61
61
  | ----------------- | ---------- |
62
62
  | Added | `0.0.4` |
63
- | Latest | `0.26.0` |
63
+ | Latest | `0.28.0` |
64
64
 
65
65
  ## Table of Contents
66
66
 
@@ -164,7 +164,7 @@ describe("SearchBar", () => {
164
164
 
165
165
  it("calls the Select onChange callback function", () => {
166
166
  let selectValue = "Songs";
167
- selectProps.onChange = (e) => (selectValue = e.target.value);
167
+ selectProps.onChange = (e) => (selectValue = (e.target as any).value);
168
168
  selectProps.value = selectValue;
169
169
 
170
170
  render(
@@ -2,15 +2,12 @@ import { Box, chakra, useMultiStyleConfig } from "@chakra-ui/react";
2
2
  import * as React from "react";
3
3
 
4
4
  import Button from "../Button/Button";
5
- import { ButtonTypes } from "../Button/ButtonTypes";
6
5
  import ComponentWrapper from "../ComponentWrapper/ComponentWrapper";
7
6
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
8
7
  import Icon from "../Icons/Icon";
9
- import { IconAlign, IconNames, IconSizes } from "../Icons/IconTypes";
10
8
  import Select from "../Select/Select";
11
- import { SelectTypes } from "../Select/SelectTypes";
12
9
  import TextInput from "../TextInput/TextInput";
13
- import { TextInputTypes, TextInputVariants } from "../TextInput/TextInputTypes";
10
+
14
11
  interface BaseProps {
15
12
  labelText: string;
16
13
  name: string;
@@ -24,6 +21,7 @@ interface BaseProps {
24
21
  // Internal interfaces that are used only for `SearchBar` props.
25
22
  export interface SelectProps extends BaseProps {
26
23
  optionsData: string[];
24
+ onChange?: (event: React.FormEvent) => void;
27
25
  }
28
26
  export interface TextInputProps extends BaseProps {
29
27
  placeholder?: string;
@@ -57,8 +55,8 @@ export interface SearchBarProps {
57
55
  labelText: string;
58
56
  /** Adds 'method' property to the `form` element. */
59
57
  method?: string;
60
- /** Sets the `Button` variant type to `ButtonTypes.NoBrand` when true;
61
- * false by default which sets the type to `ButtonTypes.Primary`. */
58
+ /** Sets the `Button` variant type to `noBrand` when true;
59
+ * false by default which sets the type to `primary`. */
62
60
  noBrandButtonType?: boolean;
63
61
  /** Handler function when the form is submitted. */
64
62
  onSubmit: (event: React.FormEvent) => void;
@@ -77,7 +75,7 @@ export interface SearchBarProps {
77
75
  export const SearchBar = chakra((props: SearchBarProps) => {
78
76
  const {
79
77
  action,
80
- buttonOnClick = null,
78
+ buttonOnClick,
81
79
  className,
82
80
  descriptionText,
83
81
  headingText,
@@ -111,9 +109,7 @@ export const SearchBar = chakra((props: SearchBarProps) => {
111
109
  const textInputPlaceholder = `${inputPlaceholder} ${
112
110
  isRequired ? "(Required)" : ""
113
111
  }`;
114
- const buttonType = noBrandButtonType
115
- ? ButtonTypes.NoBrand
116
- : ButtonTypes.Primary;
112
+ const buttonType = noBrandButtonType ? "noBrand" : "primary";
117
113
  const searchBarButtonStyles = {
118
114
  borderLeftRadius: "none",
119
115
  borderRightRadius: { base: "none", md: "sm" },
@@ -129,13 +125,13 @@ export const SearchBar = chakra((props: SearchBarProps) => {
129
125
  // Render the `Select` component.
130
126
  const selectElem = selectProps && (
131
127
  <Select
132
- additionalStyles={styles.select}
133
128
  id={`searchbar-select-${id}`}
134
129
  labelText={selectProps?.labelText}
135
130
  name={selectProps?.name}
136
131
  onChange={selectProps?.onChange}
137
- selectType={SelectTypes.SearchBar}
132
+ selectType="searchbar"
138
133
  value={selectProps?.value}
134
+ __css={styles.select}
139
135
  {...stateProps}
140
136
  >
141
137
  {selectProps?.optionsData.map((option) => (
@@ -153,12 +149,8 @@ export const SearchBar = chakra((props: SearchBarProps) => {
153
149
  name={textInputProps?.name}
154
150
  onChange={textInputProps?.onChange}
155
151
  placeholder={textInputPlaceholder}
156
- textInputType={
157
- selectElem
158
- ? TextInputVariants.SearchBarSelect
159
- : TextInputVariants.SearchBar
160
- }
161
- type={TextInputTypes.text}
152
+ textInputType={selectElem ? "searchBarSelect" : "searchBar"}
153
+ type="text"
162
154
  value={textInputProps?.value}
163
155
  {...stateProps}
164
156
  />
@@ -166,18 +158,18 @@ export const SearchBar = chakra((props: SearchBarProps) => {
166
158
  // Render the `Button` component.
167
159
  const buttonElem = (
168
160
  <Button
169
- additionalStyles={searchBarButtonStyles}
170
161
  buttonType={buttonType}
171
162
  id={`searchbar-button-${id}`}
172
163
  isDisabled={isDisabled}
173
164
  onClick={buttonOnClick}
174
165
  type="submit"
166
+ __css={searchBarButtonStyles}
175
167
  >
176
168
  <Icon
177
- align={IconAlign.Left}
169
+ align="left"
178
170
  id={`searchbar-icon-${id}`}
179
- name={IconNames.Search}
180
- size={IconSizes.Small}
171
+ name="search"
172
+ size="small"
181
173
  />
182
174
  Search
183
175
  </Button>
@@ -34,7 +34,6 @@ exports[`SearchBar renders the UI snapshot correctly 1`] = `
34
34
  className="chakra-button css-1me3d5y"
35
35
  data-testid="button"
36
36
  id="searchbar-button-basic"
37
- onClick={null}
38
37
  type="submit"
39
38
  >
40
39
  <svg
@@ -214,8 +213,8 @@ exports[`SearchBar renders the UI snapshot correctly 2`] = `
214
213
  </svg>
215
214
  </div>
216
215
  </div>
217
-
218
216
  </div>
217
+
219
218
  </div>
220
219
  <div
221
220
  className="css-1xdhyk6"
@@ -240,7 +239,6 @@ exports[`SearchBar renders the UI snapshot correctly 2`] = `
240
239
  className="chakra-button css-1me3d5y"
241
240
  data-testid="button"
242
241
  id="searchbar-button-withSelect"
243
- onClick={null}
244
242
  type="submit"
245
243
  >
246
244
  <svg
@@ -327,7 +325,6 @@ exports[`SearchBar renders the UI snapshot correctly 3`] = `
327
325
  className="chakra-button css-1me3d5y"
328
326
  data-testid="button"
329
327
  id="searchbar-button-withoutHelperText"
330
- onClick={null}
331
328
  type="submit"
332
329
  >
333
330
  <svg
@@ -402,7 +399,6 @@ exports[`SearchBar renders the UI snapshot correctly 4`] = `
402
399
  className="chakra-button css-1me3d5y"
403
400
  data-testid="button"
404
401
  id="searchbar-button-invalidState"
405
- onClick={null}
406
402
  type="submit"
407
403
  >
408
404
  <svg
@@ -478,7 +474,6 @@ exports[`SearchBar renders the UI snapshot correctly 5`] = `
478
474
  data-testid="button"
479
475
  disabled={true}
480
476
  id="searchbar-button-disabledState"
481
- onClick={null}
482
477
  type="submit"
483
478
  >
484
479
  <svg
@@ -555,7 +550,6 @@ exports[`SearchBar renders the UI snapshot correctly 6`] = `
555
550
  data-testid="button"
556
551
  disabled={true}
557
552
  id="searchbar-button-requiredState"
558
- onClick={null}
559
553
  type="submit"
560
554
  >
561
555
  <svg
@@ -632,7 +626,6 @@ exports[`SearchBar renders the UI snapshot correctly 7`] = `
632
626
  data-testid="button"
633
627
  disabled={true}
634
628
  id="searchbar-button-noBrandButtonType"
635
- onClick={null}
636
629
  type="submit"
637
630
  >
638
631
  <svg
@@ -694,7 +687,6 @@ exports[`SearchBar renders the UI snapshot correctly 8`] = `
694
687
  className="chakra-button css-1me3d5y"
695
688
  data-testid="button"
696
689
  id="searchbar-button-withHeading"
697
- onClick={null}
698
690
  type="submit"
699
691
  >
700
692
  <svg
@@ -755,7 +747,6 @@ exports[`SearchBar renders the UI snapshot correctly 9`] = `
755
747
  className="chakra-button css-1me3d5y"
756
748
  data-testid="button"
757
749
  id="searchbar-button-withDescription"
758
- onClick={null}
759
750
  type="submit"
760
751
  >
761
752
  <svg
@@ -822,7 +813,6 @@ exports[`SearchBar renders the UI snapshot correctly 10`] = `
822
813
  className="chakra-button css-1me3d5y"
823
814
  data-testid="button"
824
815
  id="searchbar-button-withHeadingAndDescription"
825
- onClick={null}
826
816
  type="submit"
827
817
  >
828
818
  <svg
@@ -897,7 +887,6 @@ exports[`SearchBar renders the UI snapshot correctly 11`] = `
897
887
  className="chakra-button css-1me3d5y"
898
888
  data-testid="button"
899
889
  id="searchbar-button-chakra"
900
- onClick={null}
901
890
  type="submit"
902
891
  >
903
892
  <svg
@@ -985,7 +974,6 @@ exports[`SearchBar renders the UI snapshot correctly 12`] = `
985
974
  className="chakra-button css-1me3d5y"
986
975
  data-testid="button"
987
976
  id="searchbar-button-props"
988
- onClick={null}
989
977
  type="submit"
990
978
  >
991
979
  <svg