@nypl/design-system-react-components 0.25.13 → 0.26.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 (299) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +10 -10
  3. package/dist/components/Accordion/Accordion.d.ts +1 -1
  4. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +1 -1
  5. package/dist/components/Button/Button.d.ts +2 -2
  6. package/dist/components/Card/Card.d.ts +11 -9
  7. package/dist/components/Checkbox/Checkbox.d.ts +2 -2
  8. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +5 -4
  9. package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +1 -1
  10. package/dist/components/DatePicker/DatePicker.d.ts +5 -6
  11. package/dist/components/Fieldset/Fieldset.d.ts +5 -6
  12. package/dist/components/Form/Form.d.ts +6 -6
  13. package/dist/components/Grid/GridTypes.d.ts +7 -7
  14. package/dist/components/Grid/SimpleGrid.d.ts +1 -1
  15. package/dist/components/Heading/Heading.d.ts +1 -1
  16. package/dist/components/HelperErrorText/HelperErrorText.d.ts +9 -8
  17. package/dist/components/Hero/Hero.d.ts +2 -1
  18. package/dist/components/HorizontalRule/HorizontalRule.d.ts +2 -10
  19. package/dist/components/Icons/Icon.d.ts +2 -1
  20. package/dist/components/Image/Image.d.ts +2 -2
  21. package/dist/components/Label/Label.d.ts +7 -4
  22. package/dist/components/Link/Link.d.ts +1 -1
  23. package/dist/components/List/List.d.ts +11 -11
  24. package/dist/components/List/ListTypes.d.ts +1 -1
  25. package/dist/components/Logo/Logo.d.ts +2 -1
  26. package/dist/components/Logo/LogoSvgs.d.ts +2 -0
  27. package/dist/components/Logo/LogoTypes.d.ts +2 -0
  28. package/dist/components/Notification/Notification.d.ts +4 -4
  29. package/dist/components/Pagination/Pagination.d.ts +2 -2
  30. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +3 -3
  31. package/dist/components/Radio/Radio.d.ts +4 -6
  32. package/dist/components/RadioGroup/RadioGroup.d.ts +12 -6
  33. package/dist/components/SearchBar/SearchBar.d.ts +4 -4
  34. package/dist/components/Select/Select.d.ts +10 -6
  35. package/dist/components/Select/SelectTypes.d.ts +4 -0
  36. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -3
  37. package/dist/components/Slider/Slider.d.ts +6 -4
  38. package/dist/components/StatusBadge/StatusBadge.d.ts +5 -1
  39. package/dist/components/StructuredContent/StructuredContent.d.ts +2 -2
  40. package/dist/components/Table/Table.d.ts +1 -1
  41. package/dist/components/Tabs/Tabs.d.ts +4 -3
  42. package/dist/components/Template/Template.d.ts +4 -3
  43. package/dist/components/Text/Text.d.ts +1 -1
  44. package/dist/components/TextInput/TextInput.d.ts +5 -5
  45. package/dist/components/Toggle/Toggle.d.ts +3 -4
  46. package/dist/components/VideoPlayer/VideoPlayer.d.ts +2 -1
  47. package/dist/design-system-react-components.cjs.development.js +1663 -1139
  48. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  49. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  50. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  51. package/dist/design-system-react-components.esm.js +1667 -1143
  52. package/dist/design-system-react-components.esm.js.map +1 -1
  53. package/dist/hooks/useCarouselStyles.d.ts +3 -2
  54. package/dist/hooks/useNYPLTheme.d.ts +12 -0
  55. package/dist/index.d.ts +4 -1
  56. package/dist/styles.css +1 -1
  57. package/dist/theme/components/button.d.ts +10 -2
  58. package/dist/theme/components/card.d.ts +42 -22
  59. package/dist/theme/components/checkbox.d.ts +5 -4
  60. package/dist/theme/components/checkboxGroup.d.ts +1 -1
  61. package/dist/theme/components/componentWrapper.d.ts +2 -2
  62. package/dist/theme/components/customTable.d.ts +84 -1
  63. package/dist/theme/components/fieldset.d.ts +4 -14
  64. package/dist/theme/components/global.d.ts +23 -17
  65. package/dist/theme/components/heading.d.ts +53 -0
  66. package/dist/theme/components/helperErrorText.d.ts +1 -0
  67. package/dist/theme/components/hero.d.ts +20 -14
  68. package/dist/theme/components/label.d.ts +9 -10
  69. package/dist/theme/components/list.d.ts +99 -9
  70. package/dist/theme/components/radio.d.ts +6 -4
  71. package/dist/theme/components/radioGroup.d.ts +1 -1
  72. package/dist/theme/components/select.d.ts +34 -5
  73. package/dist/theme/components/skeletonLoader.d.ts +2 -2
  74. package/dist/theme/components/slider.d.ts +6 -3
  75. package/dist/theme/components/structuredContent.d.ts +197 -0
  76. package/dist/theme/components/textInput.d.ts +18 -6
  77. package/dist/theme/components/toggle.d.ts +7 -4
  78. package/dist/theme/foundations/global.d.ts +2 -0
  79. package/dist/theme/foundations/radii.d.ts +1 -0
  80. package/dist/theme/foundations/spacing.d.ts +46 -43
  81. package/package.json +5 -6
  82. package/src/components/Accordion/Accordion.stories.mdx +9 -9
  83. package/src/components/Accordion/Accordion.test.tsx +21 -0
  84. package/src/components/Accordion/Accordion.tsx +13 -9
  85. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +276 -27
  86. package/src/components/Autosuggest/Autosuggest.stories.mdx +4 -3
  87. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +21 -5
  88. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +52 -31
  89. package/src/components/Breadcrumbs/Breadcrumbs.tsx +8 -7
  90. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +211 -12
  91. package/src/components/Button/Button.stories.mdx +87 -23
  92. package/src/components/Button/Button.test.tsx +25 -0
  93. package/src/components/Button/Button.tsx +18 -7
  94. package/src/components/Button/__snapshots__/Button.test.tsx.snap +27 -7
  95. package/src/components/Card/Card.stories.mdx +287 -194
  96. package/src/components/Card/Card.test.tsx +102 -0
  97. package/src/components/Card/Card.tsx +73 -32
  98. package/src/components/Card/__snapshots__/Card.test.tsx.snap +195 -35
  99. package/src/components/Chakra/Grid.stories.mdx +4 -4
  100. package/src/components/Checkbox/Checkbox.stories.mdx +62 -10
  101. package/src/components/Checkbox/Checkbox.test.tsx +32 -9
  102. package/src/components/Checkbox/Checkbox.tsx +20 -15
  103. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +134 -7
  104. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +65 -17
  105. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +137 -81
  106. package/src/components/CheckboxGroup/CheckboxGroup.tsx +31 -21
  107. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +332 -97
  108. package/src/components/ComponentWrapper/ComponentWrapper.test.tsx +12 -0
  109. package/src/components/ComponentWrapper/ComponentWrapper.tsx +39 -41
  110. package/src/components/ComponentWrapper/__snapshots__/ComponentWrapper.test.tsx.snap +47 -34
  111. package/src/components/DatePicker/DatePicker.stories.mdx +63 -27
  112. package/src/components/DatePicker/DatePicker.test.tsx +89 -13
  113. package/src/components/DatePicker/DatePicker.tsx +62 -56
  114. package/src/components/DatePicker/_DatePicker.scss +71 -13
  115. package/src/components/DatePicker/__snapshots__/DatePicker.test.tsx.snap +250 -206
  116. package/src/components/Fieldset/Fieldset.stories.mdx +33 -3
  117. package/src/components/Fieldset/Fieldset.test.tsx +58 -28
  118. package/src/components/Fieldset/Fieldset.tsx +35 -30
  119. package/src/components/Fieldset/__snapshots__/Fieldset.test.tsx.snap +40 -19
  120. package/src/components/Form/Form.stories.mdx +72 -39
  121. package/src/components/Form/Form.test.tsx +58 -15
  122. package/src/components/Form/Form.tsx +89 -67
  123. package/src/components/Form/__snapshots__/Form.test.tsx.snap +83 -5
  124. package/src/components/Grid/GridTypes.tsx +7 -7
  125. package/src/components/Grid/SimpleGrid.stories.mdx +34 -6
  126. package/src/components/Grid/SimpleGrid.test.tsx +9 -0
  127. package/src/components/Grid/SimpleGrid.tsx +29 -20
  128. package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +16 -1
  129. package/src/components/Heading/Heading.stories.mdx +36 -3
  130. package/src/components/Heading/Heading.test.tsx +10 -0
  131. package/src/components/Heading/Heading.tsx +56 -50
  132. package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +26 -7
  133. package/src/components/HelperErrorText/HelperErrorText.stories.mdx +64 -42
  134. package/src/components/HelperErrorText/HelperErrorText.test.tsx +15 -0
  135. package/src/components/HelperErrorText/HelperErrorText.tsx +40 -35
  136. package/src/components/HelperErrorText/__snapshots__/HelperErrorText.test.tsx.snap +35 -4
  137. package/src/components/Hero/Hero.stories.mdx +125 -95
  138. package/src/components/Hero/Hero.test.tsx +33 -0
  139. package/src/components/Hero/Hero.tsx +135 -126
  140. package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +89 -17
  141. package/src/components/HorizontalRule/HorizontalRule.stories.mdx +26 -4
  142. package/src/components/HorizontalRule/HorizontalRule.test.tsx +9 -19
  143. package/src/components/HorizontalRule/HorizontalRule.tsx +9 -26
  144. package/src/components/HorizontalRule/__snapshots__/HorizontalRule.test.tsx.snap +18 -5
  145. package/src/components/Icons/Icon.stories.mdx +31 -6
  146. package/src/components/Icons/Icon.test.tsx +38 -0
  147. package/src/components/Icons/Icon.tsx +93 -76
  148. package/src/components/Icons/__snapshots__/Icon.test.tsx.snap +129 -0
  149. package/src/components/Image/Image.stories.mdx +29 -5
  150. package/src/components/Image/Image.test.tsx +8 -0
  151. package/src/components/Image/Image.tsx +38 -26
  152. package/src/components/Image/__snapshots__/Image.test.tsx.snap +24 -8
  153. package/src/components/Label/Label.stories.mdx +42 -20
  154. package/src/components/Label/Label.test.tsx +42 -17
  155. package/src/components/Label/Label.tsx +22 -13
  156. package/src/components/Label/__snapshots__/Label.test.tsx.snap +19 -15
  157. package/src/components/Link/Link.stories.mdx +25 -1
  158. package/src/components/Link/Link.test.tsx +21 -0
  159. package/src/components/Link/Link.tsx +8 -8
  160. package/src/components/Link/__snapshots__/Link.test.tsx.snap +37 -11
  161. package/src/components/List/List.stories.mdx +75 -40
  162. package/src/components/List/List.test.tsx +67 -19
  163. package/src/components/List/List.tsx +38 -25
  164. package/src/components/List/ListTypes.tsx +1 -1
  165. package/src/components/List/__snapshots__/List.test.tsx.snap +110 -8
  166. package/src/components/Logo/Logo.stories.mdx +30 -6
  167. package/src/components/Logo/Logo.test.tsx +17 -0
  168. package/src/components/Logo/Logo.tsx +18 -6
  169. package/src/components/Logo/LogoSvgs.tsx +4 -0
  170. package/src/components/Logo/LogoTypes.tsx +2 -0
  171. package/src/components/Logo/__snapshots__/Logo.test.tsx.snap +73 -2
  172. package/src/components/Modal/Modal.stories.mdx +13 -0
  173. package/src/components/Notification/Notification.stories.mdx +25 -1
  174. package/src/components/Notification/Notification.test.tsx +23 -0
  175. package/src/components/Notification/Notification.tsx +46 -44
  176. package/src/components/Notification/__snapshots__/Notification.test.tsx.snap +158 -29
  177. package/src/components/Pagination/Pagination.stories.mdx +24 -4
  178. package/src/components/Pagination/Pagination.test.tsx +25 -0
  179. package/src/components/Pagination/Pagination.tsx +6 -6
  180. package/src/components/Pagination/__snapshots__/Pagination.test.tsx.snap +244 -27
  181. package/src/components/Placeholder/Placeholder.tsx +3 -1
  182. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +76 -10
  183. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +81 -11
  184. package/src/components/ProgressIndicator/ProgressIndicator.tsx +17 -9
  185. package/src/components/ProgressIndicator/__snapshots__/ProgressIndicator.test.tsx.snap +101 -14
  186. package/src/components/Radio/Radio.stories.mdx +64 -12
  187. package/src/components/Radio/Radio.test.tsx +28 -8
  188. package/src/components/Radio/Radio.tsx +66 -63
  189. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +103 -6
  190. package/src/components/RadioGroup/RadioGroup.stories.mdx +224 -89
  191. package/src/components/RadioGroup/RadioGroup.test.tsx +122 -62
  192. package/src/components/RadioGroup/RadioGroup.tsx +106 -100
  193. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +1236 -1020
  194. package/src/components/SearchBar/SearchBar.stories.mdx +101 -36
  195. package/src/components/SearchBar/{SearchBar.Test.tsx → SearchBar.test.tsx} +46 -4
  196. package/src/components/SearchBar/SearchBar.tsx +17 -8
  197. package/src/components/SearchBar/__snapshots__/SearchBar.test.tsx.snap +1039 -0
  198. package/src/components/Select/Select.stories.mdx +128 -49
  199. package/src/components/Select/Select.test.tsx +63 -16
  200. package/src/components/Select/Select.tsx +125 -92
  201. package/src/components/Select/SelectTypes.tsx +5 -0
  202. package/src/components/Select/__snapshots__/Select.test.tsx.snap +749 -409
  203. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +42 -10
  204. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +8 -0
  205. package/src/components/SkeletonLoader/SkeletonLoader.tsx +76 -72
  206. package/src/components/SkeletonLoader/__snapshots__/SkeletonLoader.test.tsx.snap +169 -10
  207. package/src/components/Slider/Slider.stories.mdx +91 -42
  208. package/src/components/Slider/Slider.test.tsx +65 -17
  209. package/src/components/Slider/Slider.tsx +26 -19
  210. package/src/components/Slider/__snapshots__/Slider.test.tsx.snap +403 -226
  211. package/src/components/StatusBadge/StatusBadge.stories.mdx +19 -1
  212. package/src/components/StatusBadge/StatusBadge.test.tsx +16 -0
  213. package/src/components/StatusBadge/StatusBadge.tsx +25 -20
  214. package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +22 -3
  215. package/src/components/StructuredContent/StructuredContent.stories.mdx +131 -12
  216. package/src/components/StructuredContent/StructuredContent.test.tsx +34 -0
  217. package/src/components/StructuredContent/StructuredContent.tsx +80 -75
  218. package/src/components/StructuredContent/__snapshots__/StructuredContent.test.tsx.snap +102 -17
  219. package/src/components/StyleGuide/Bidirectionality.stories.mdx +5 -5
  220. package/src/components/StyleGuide/Breakpoints.stories.mdx +6 -6
  221. package/src/components/StyleGuide/Buttons.stories.mdx +2 -12
  222. package/src/components/StyleGuide/ColorCard.tsx +1 -1
  223. package/src/components/StyleGuide/Colors.stories.mdx +1 -2
  224. package/src/components/StyleGuide/DesignTokens.stories.mdx +56 -26
  225. package/src/components/StyleGuide/Forms.stories.mdx +27 -12
  226. package/src/components/StyleGuide/Iconography.stories.mdx +2 -12
  227. package/src/components/StyleGuide/Spacing.stories.mdx +80 -41
  228. package/src/components/StyleGuide/Typography.stories.mdx +30 -21
  229. package/src/components/Table/Table.stories.mdx +38 -11
  230. package/src/components/Table/Table.test.tsx +15 -0
  231. package/src/components/Table/Table.tsx +7 -7
  232. package/src/components/Table/__snapshots__/Table.test.tsx.snap +408 -5
  233. package/src/components/Tabs/Tabs.stories.mdx +52 -3
  234. package/src/components/Tabs/Tabs.test.tsx +16 -0
  235. package/src/components/Tabs/Tabs.tsx +10 -6
  236. package/src/components/Tabs/__snapshots__/Tabs.test.tsx.snap +394 -5
  237. package/src/components/Template/Template.stories.mdx +47 -43
  238. package/src/components/Template/Template.test.tsx +33 -0
  239. package/src/components/Template/Template.tsx +65 -60
  240. package/src/components/Template/__snapshots__/Template.test.tsx.snap +191 -20
  241. package/src/components/Text/Text.stories.mdx +20 -1
  242. package/src/components/Text/Text.test.tsx +12 -0
  243. package/src/components/Text/Text.tsx +6 -4
  244. package/src/components/Text/__snapshots__/Text.test.tsx.snap +21 -4
  245. package/src/components/TextInput/TextInput.stories.mdx +65 -19
  246. package/src/components/TextInput/TextInput.test.tsx +42 -28
  247. package/src/components/TextInput/TextInput.tsx +121 -113
  248. package/src/components/TextInput/__snapshots__/TextInput.test.tsx.snap +96 -73
  249. package/src/components/Toggle/Toggle.stories.mdx +80 -22
  250. package/src/components/Toggle/Toggle.test.tsx +27 -9
  251. package/src/components/Toggle/Toggle.tsx +22 -18
  252. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +128 -5
  253. package/src/components/VideoPlayer/VideoPlayer.stories.mdx +52 -4
  254. package/src/components/VideoPlayer/VideoPlayer.test.tsx +23 -0
  255. package/src/components/VideoPlayer/VideoPlayer.tsx +133 -126
  256. package/src/components/VideoPlayer/__snapshots__/VideoPlayer.test.tsx.snap +81 -39
  257. package/src/docs/Chakra.stories.mdx +50 -9
  258. package/src/docs/Welcome.stories.mdx +160 -41
  259. package/src/hooks/useCarouselStyles.stories.mdx +22 -2
  260. package/src/hooks/useCarouselStyles.ts +3 -2
  261. package/src/hooks/useNYPLTheme.stories.mdx +101 -0
  262. package/src/hooks/useNYPLTheme.ts +30 -6
  263. package/src/hooks/useWindowSize.stories.mdx +23 -0
  264. package/src/index.ts +4 -1
  265. package/src/styles/base/_place-holder.scss +1 -1
  266. package/src/theme/components/button.ts +15 -7
  267. package/src/theme/components/card.ts +30 -19
  268. package/src/theme/components/checkbox.ts +10 -8
  269. package/src/theme/components/checkboxGroup.ts +1 -1
  270. package/src/theme/components/componentWrapper.ts +2 -2
  271. package/src/theme/components/customTable.ts +39 -31
  272. package/src/theme/components/fieldset.ts +1 -2
  273. package/src/theme/components/global.ts +25 -20
  274. package/src/theme/components/heading.ts +1 -1
  275. package/src/theme/components/helperErrorText.ts +1 -0
  276. package/src/theme/components/hero.ts +13 -15
  277. package/src/theme/components/label.ts +4 -3
  278. package/src/theme/components/list.ts +73 -66
  279. package/src/theme/components/notification.ts +2 -2
  280. package/src/theme/components/radio.ts +9 -9
  281. package/src/theme/components/radioGroup.ts +1 -1
  282. package/src/theme/components/select.ts +35 -22
  283. package/src/theme/components/skeletonLoader.ts +3 -3
  284. package/src/theme/components/slider.ts +8 -7
  285. package/src/theme/components/statusBadge.ts +2 -2
  286. package/src/theme/components/structuredContent.ts +66 -1
  287. package/src/theme/components/tabs.ts +2 -2
  288. package/src/theme/components/template.ts +9 -9
  289. package/src/theme/components/textInput.ts +13 -12
  290. package/src/theme/components/toggle.ts +17 -10
  291. package/src/theme/components/videoPlayer.ts +1 -1
  292. package/src/theme/foundations/colors.ts +1 -1
  293. package/src/theme/foundations/radii.ts +1 -0
  294. package/src/theme/foundations/spacing.ts +70 -22
  295. package/src/theme/foundations/typography.ts +2 -2
  296. package/src/utils/componentCategories.ts +1 -2
  297. package/dist/components/SearchBar/SearchBar.Test.d.ts +0 -1
  298. package/dist/helpers/generateUUID.d.ts +0 -1
  299. package/src/helpers/generateUUID.tsx +0 -5
@@ -2,7 +2,7 @@
2
2
 
3
3
  exports[`Accordion Renders the UI snapshot correctly 1`] = `
4
4
  <div
5
- className="chakra-accordion css-0"
5
+ className="chakra-accordion css-1xdhyk6"
6
6
  id="accordian"
7
7
  >
8
8
  <div
@@ -11,7 +11,7 @@ exports[`Accordion Renders the UI snapshot correctly 1`] = `
11
11
  <button
12
12
  aria-controls="accordion-panel-accordian-item-0"
13
13
  aria-expanded={false}
14
- className="chakra-accordion__button css-1ivt2zz"
14
+ className="chakra-accordion__button css-1v42wmb"
15
15
  disabled={false}
16
16
  id="accordion-button-accordian-item-0"
17
17
  onClick={[Function]}
@@ -26,7 +26,7 @@ exports[`Accordion Renders the UI snapshot correctly 1`] = `
26
26
  </div>
27
27
  <svg
28
28
  aria-hidden={true}
29
- className="chakra-icon css-onkibi"
29
+ className="chakra-icon css-1grhd2q"
30
30
  focusable={false}
31
31
  id="accordion-accordian-icon-0"
32
32
  role="img"
@@ -75,14 +75,14 @@ exports[`Accordion Renders the UI snapshot correctly 1`] = `
75
75
  role="region"
76
76
  >
77
77
  <div
78
- className="css-0"
78
+ className="css-1xdhyk6"
79
79
  id="card"
80
80
  >
81
81
  <div
82
82
  className="css-0"
83
83
  >
84
84
  <div
85
- className="the-wrap css-0"
85
+ className="the-wrap css-1u8qly9"
86
86
  >
87
87
  <div
88
88
  className="the-crop css-0"
@@ -99,13 +99,14 @@ exports[`Accordion Renders the UI snapshot correctly 1`] = `
99
99
  className="card-body css-0"
100
100
  >
101
101
  <h4
102
- className="chakra-heading css-0"
102
+ className="chakra-heading css-1xdhyk6"
103
103
  id="heading1"
104
+ layout="row"
104
105
  >
105
106
  Gerry Kellman
106
107
  </h4>
107
108
  <div
108
- className="css-0"
109
+ className="css-1xdhyk6"
109
110
  >
110
111
  Gerri is
111
112
  <b>
@@ -123,7 +124,7 @@ exports[`Accordion Renders the UI snapshot correctly 1`] = `
123
124
 
124
125
  exports[`Accordion Renders the UI snapshot correctly 2`] = `
125
126
  <div
126
- className="chakra-accordion css-0"
127
+ className="chakra-accordion css-1xdhyk6"
127
128
  id="accordian"
128
129
  >
129
130
  <div
@@ -132,7 +133,7 @@ exports[`Accordion Renders the UI snapshot correctly 2`] = `
132
133
  <button
133
134
  aria-controls="accordion-panel-accordian-item-0"
134
135
  aria-expanded={false}
135
- className="chakra-accordion__button css-1ivt2zz"
136
+ className="chakra-accordion__button css-1v42wmb"
136
137
  disabled={false}
137
138
  id="accordion-button-accordian-item-0"
138
139
  onClick={[Function]}
@@ -147,7 +148,7 @@ exports[`Accordion Renders the UI snapshot correctly 2`] = `
147
148
  </div>
148
149
  <svg
149
150
  aria-hidden={true}
150
- className="chakra-icon css-onkibi"
151
+ className="chakra-icon css-1grhd2q"
151
152
  focusable={false}
152
153
  id="accordion-accordian-icon-0"
153
154
  role="img"
@@ -196,14 +197,14 @@ exports[`Accordion Renders the UI snapshot correctly 2`] = `
196
197
  role="region"
197
198
  >
198
199
  <div
199
- className="css-0"
200
+ className="css-1xdhyk6"
200
201
  id="card"
201
202
  >
202
203
  <div
203
204
  className="css-0"
204
205
  >
205
206
  <div
206
- className="the-wrap css-0"
207
+ className="the-wrap css-1u8qly9"
207
208
  >
208
209
  <div
209
210
  className="the-crop css-0"
@@ -220,13 +221,14 @@ exports[`Accordion Renders the UI snapshot correctly 2`] = `
220
221
  className="card-body css-0"
221
222
  >
222
223
  <h4
223
- className="chakra-heading css-0"
224
+ className="chakra-heading css-1xdhyk6"
224
225
  id="heading1"
226
+ layout="row"
225
227
  >
226
228
  Gerry Kellman
227
229
  </h4>
228
230
  <div
229
- className="css-0"
231
+ className="css-1xdhyk6"
230
232
  >
231
233
  Gerri is
232
234
  <b>
@@ -244,7 +246,7 @@ exports[`Accordion Renders the UI snapshot correctly 2`] = `
244
246
 
245
247
  exports[`Accordion Renders the UI snapshot correctly 3`] = `
246
248
  <div
247
- className="chakra-accordion css-0"
249
+ className="chakra-accordion css-1t0bvx9"
248
250
  id="accordian"
249
251
  >
250
252
  <div
@@ -253,7 +255,7 @@ exports[`Accordion Renders the UI snapshot correctly 3`] = `
253
255
  <button
254
256
  aria-controls="accordion-panel-accordian-item-0"
255
257
  aria-expanded={false}
256
- className="chakra-accordion__button css-1m4sr3t"
258
+ className="chakra-accordion__button css-1v42wmb"
257
259
  disabled={false}
258
260
  id="accordion-button-accordian-item-0"
259
261
  onClick={[Function]}
@@ -268,7 +270,7 @@ exports[`Accordion Renders the UI snapshot correctly 3`] = `
268
270
  </div>
269
271
  <svg
270
272
  aria-hidden={true}
271
- className="chakra-icon css-onkibi"
273
+ className="chakra-icon css-1grhd2q"
272
274
  focusable={false}
273
275
  id="accordion-accordian-icon-0"
274
276
  role="img"
@@ -317,14 +319,14 @@ exports[`Accordion Renders the UI snapshot correctly 3`] = `
317
319
  role="region"
318
320
  >
319
321
  <div
320
- className="css-0"
322
+ className="css-1xdhyk6"
321
323
  id="card"
322
324
  >
323
325
  <div
324
326
  className="css-0"
325
327
  >
326
328
  <div
327
- className="the-wrap css-0"
329
+ className="the-wrap css-1u8qly9"
328
330
  >
329
331
  <div
330
332
  className="the-crop css-0"
@@ -341,13 +343,14 @@ exports[`Accordion Renders the UI snapshot correctly 3`] = `
341
343
  className="card-body css-0"
342
344
  >
343
345
  <h4
344
- className="chakra-heading css-0"
346
+ className="chakra-heading css-1xdhyk6"
345
347
  id="heading1"
348
+ layout="row"
346
349
  >
347
350
  Gerry Kellman
348
351
  </h4>
349
352
  <div
350
- className="css-0"
353
+ className="css-1xdhyk6"
351
354
  >
352
355
  Gerri is
353
356
  <b>
@@ -365,7 +368,252 @@ exports[`Accordion Renders the UI snapshot correctly 3`] = `
365
368
 
366
369
  exports[`Accordion Renders the UI snapshot correctly 4`] = `
367
370
  <div
368
- className="chakra-accordion css-0"
371
+ className="chakra-accordion css-1xdhyk6"
372
+ data-testid="testid"
373
+ id="accordian"
374
+ >
375
+ <div
376
+ className="chakra-accordion__item css-1fsnuue"
377
+ >
378
+ <button
379
+ aria-controls="accordion-panel-accordian-item-0"
380
+ aria-expanded={false}
381
+ className="chakra-accordion__button css-1v42wmb"
382
+ disabled={false}
383
+ id="accordion-button-accordian-item-0"
384
+ onClick={[Function]}
385
+ onFocus={[Function]}
386
+ onKeyDown={[Function]}
387
+ type="button"
388
+ >
389
+ <div
390
+ className="css-1eziwv"
391
+ >
392
+ Gerry Kellman
393
+ </div>
394
+ <svg
395
+ aria-hidden={true}
396
+ className="chakra-icon css-1grhd2q"
397
+ focusable={false}
398
+ id="accordion-accordian-icon-0"
399
+ role="img"
400
+ title="plus icon"
401
+ viewBox="0 0 24 24"
402
+ >
403
+ <g
404
+ stroke="currentColor"
405
+ strokeWidth="1.5"
406
+ >
407
+ <path
408
+ d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
409
+ fill="none"
410
+ strokeLinecap="round"
411
+ />
412
+ <path
413
+ d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
414
+ fill="currentColor"
415
+ strokeLinecap="round"
416
+ />
417
+ <circle
418
+ cx="12"
419
+ cy="12"
420
+ fill="none"
421
+ r="11.25"
422
+ strokeMiterlimit="10"
423
+ />
424
+ </g>
425
+ </svg>
426
+ </button>
427
+ <div
428
+ className="chakra-collapse"
429
+ style={
430
+ Object {
431
+ "display": "none",
432
+ "height": "0px",
433
+ "opacity": 0,
434
+ "overflow": "hidden",
435
+ }
436
+ }
437
+ >
438
+ <div
439
+ aria-labelledby="accordion-button-accordian-item-0"
440
+ className="chakra-accordion__panel css-0"
441
+ id="accordion-panel-accordian-item-0"
442
+ role="region"
443
+ >
444
+ <div
445
+ className="css-1xdhyk6"
446
+ id="card"
447
+ >
448
+ <div
449
+ className="css-0"
450
+ >
451
+ <div
452
+ className="the-wrap css-1u8qly9"
453
+ >
454
+ <div
455
+ className="the-crop css-0"
456
+ >
457
+ <img
458
+ alt="Alt text"
459
+ className="css-0"
460
+ src="https://cdn.onebauer.media/one/media/6176/76fd/405b/ab5f/f20f/2d52/gerri-1500-1.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit"
461
+ />
462
+ </div>
463
+ </div>
464
+ </div>
465
+ <div
466
+ className="card-body css-0"
467
+ >
468
+ <h4
469
+ className="chakra-heading css-1xdhyk6"
470
+ id="heading1"
471
+ layout="row"
472
+ >
473
+ Gerry Kellman
474
+ </h4>
475
+ <div
476
+ className="css-1xdhyk6"
477
+ >
478
+ Gerri is
479
+ <b>
480
+ one of Logan's most trusted confidantes
481
+ </b>
482
+ , one who serves many roles within the company. She's one of the most powerful people at Waystar Royco outside of the family itself.
483
+ </div>
484
+ </div>
485
+ </div>
486
+ </div>
487
+ </div>
488
+ </div>
489
+ </div>
490
+ `;
491
+
492
+ exports[`Accordion Renders the UI snapshot correctly 5`] = `
493
+ <div
494
+ className="chakra-accordion css-1xdhyk6"
495
+ id="accordian"
496
+ >
497
+ <div
498
+ className="chakra-accordion__item css-1fsnuue"
499
+ >
500
+ <button
501
+ aria-controls="accordion-panel-accordian-item-0"
502
+ aria-expanded={false}
503
+ className="chakra-accordion__button css-1m4sr3t"
504
+ disabled={false}
505
+ id="accordion-button-accordian-item-0"
506
+ onClick={[Function]}
507
+ onFocus={[Function]}
508
+ onKeyDown={[Function]}
509
+ type="button"
510
+ >
511
+ <div
512
+ className="css-1eziwv"
513
+ >
514
+ Gerry Kellman
515
+ </div>
516
+ <svg
517
+ aria-hidden={true}
518
+ className="chakra-icon css-1grhd2q"
519
+ focusable={false}
520
+ id="accordion-accordian-icon-0"
521
+ role="img"
522
+ title="plus icon"
523
+ viewBox="0 0 24 24"
524
+ >
525
+ <g
526
+ stroke="currentColor"
527
+ strokeWidth="1.5"
528
+ >
529
+ <path
530
+ d="M9,9a3,3,0,1,1,4,2.829,1.5,1.5,0,0,0-1,1.415V14.25"
531
+ fill="none"
532
+ strokeLinecap="round"
533
+ />
534
+ <path
535
+ d="M12,17.25a.375.375,0,1,0,.375.375A.375.375,0,0,0,12,17.25h0"
536
+ fill="currentColor"
537
+ strokeLinecap="round"
538
+ />
539
+ <circle
540
+ cx="12"
541
+ cy="12"
542
+ fill="none"
543
+ r="11.25"
544
+ strokeMiterlimit="10"
545
+ />
546
+ </g>
547
+ </svg>
548
+ </button>
549
+ <div
550
+ className="chakra-collapse"
551
+ style={
552
+ Object {
553
+ "display": "none",
554
+ "height": "0px",
555
+ "opacity": 0,
556
+ "overflow": "hidden",
557
+ }
558
+ }
559
+ >
560
+ <div
561
+ aria-labelledby="accordion-button-accordian-item-0"
562
+ className="chakra-accordion__panel css-0"
563
+ id="accordion-panel-accordian-item-0"
564
+ role="region"
565
+ >
566
+ <div
567
+ className="css-1xdhyk6"
568
+ id="card"
569
+ >
570
+ <div
571
+ className="css-0"
572
+ >
573
+ <div
574
+ className="the-wrap css-1u8qly9"
575
+ >
576
+ <div
577
+ className="the-crop css-0"
578
+ >
579
+ <img
580
+ alt="Alt text"
581
+ className="css-0"
582
+ src="https://cdn.onebauer.media/one/media/6176/76fd/405b/ab5f/f20f/2d52/gerri-1500-1.jpg?format=jpg&quality=80&width=850&ratio=1-1&resize=aspectfit"
583
+ />
584
+ </div>
585
+ </div>
586
+ </div>
587
+ <div
588
+ className="card-body css-0"
589
+ >
590
+ <h4
591
+ className="chakra-heading css-1xdhyk6"
592
+ id="heading1"
593
+ layout="row"
594
+ >
595
+ Gerry Kellman
596
+ </h4>
597
+ <div
598
+ className="css-1xdhyk6"
599
+ >
600
+ Gerri is
601
+ <b>
602
+ one of Logan's most trusted confidantes
603
+ </b>
604
+ , one who serves many roles within the company. She's one of the most powerful people at Waystar Royco outside of the family itself.
605
+ </div>
606
+ </div>
607
+ </div>
608
+ </div>
609
+ </div>
610
+ </div>
611
+ </div>
612
+ `;
613
+
614
+ exports[`Accordion Renders the UI snapshot correctly 6`] = `
615
+ <div
616
+ className="chakra-accordion css-1xdhyk6"
369
617
  id="accordian"
370
618
  >
371
619
  <div
@@ -389,7 +637,7 @@ exports[`Accordion Renders the UI snapshot correctly 4`] = `
389
637
  </div>
390
638
  <svg
391
639
  aria-hidden={true}
392
- className="chakra-icon css-onkibi"
640
+ className="chakra-icon css-1grhd2q"
393
641
  focusable={false}
394
642
  id="accordion-accordian-icon-0"
395
643
  role="img"
@@ -438,14 +686,14 @@ exports[`Accordion Renders the UI snapshot correctly 4`] = `
438
686
  role="region"
439
687
  >
440
688
  <div
441
- className="css-0"
689
+ className="css-1xdhyk6"
442
690
  id="card"
443
691
  >
444
692
  <div
445
693
  className="css-0"
446
694
  >
447
695
  <div
448
- className="the-wrap css-0"
696
+ className="the-wrap css-1u8qly9"
449
697
  >
450
698
  <div
451
699
  className="the-crop css-0"
@@ -462,13 +710,14 @@ exports[`Accordion Renders the UI snapshot correctly 4`] = `
462
710
  className="card-body css-0"
463
711
  >
464
712
  <h4
465
- className="chakra-heading css-0"
713
+ className="chakra-heading css-1xdhyk6"
466
714
  id="heading1"
715
+ layout="row"
467
716
  >
468
717
  Gerry Kellman
469
718
  </h4>
470
719
  <div
471
- className="css-0"
720
+ className="css-1xdhyk6"
472
721
  >
473
722
  Gerri is
474
723
  <b>
@@ -8,12 +8,13 @@ import { getCategory } from "../../utils/componentCategories";
8
8
 
9
9
  # Autosuggest
10
10
 
11
- The NYPL Design System does not have its own `Autosuggest` component. Instead,
11
+ The Reservoir Design System (DS) does not have its own `Autosuggest` component. Instead,
12
12
  we are currently using the
13
13
  [react-autosuggest](https://www.npmjs.com/package/react-autosuggest) package.
14
14
  We recommend using this package in your application and wrapping it in a [custom
15
- component](#code-implementation). The NYPL Design System does have custom styling that targets the
16
- classes from the `react-autosuggest` package, so the look and feel will be consistent.
15
+ component](#code-implementation). The Reservoir Design System (DS) does have custom
16
+ styling that targets the classes from the `react-autosuggest` package, so the look
17
+ and feel will be consistent.
17
18
 
18
19
  In the following previews, you'll notice that there is a lot of white space underneath
19
20
  every input element. Since the suggestion dropdown will appear on top of page content,
@@ -49,7 +49,17 @@ export const enumValues = getStorybookEnumValues(
49
49
  | Component Version | DS Version |
50
50
  | ----------------- | ---------- |
51
51
  | Added | `0.0.3` |
52
- | Latest | `0.25.13` |
52
+ | Latest | `0.26.0` |
53
+
54
+ ## Table of Contents
55
+
56
+ - [Overview](#overview)
57
+ - [Component Props](#component-props)
58
+ - [Accessibility](#accessibility)
59
+ - [Long Titles](#long-titles)
60
+ - [Color Variations](#color-variations)
61
+
62
+ ## Overview
53
63
 
54
64
  <Description of={Breadcrumbs} />
55
65
 
@@ -57,6 +67,8 @@ The `Breadcrumbs` component is a navigation element that provides a breadcrumb
57
67
  path that reflects the site structure and allows a user to navigate to any page
58
68
  available in the breadcrumb hierarchy.
59
69
 
70
+ ## Component Props
71
+
60
72
  <Canvas withToolbar>
61
73
  <Story
62
74
  name="Breadcrumbs with Controls"
@@ -86,13 +98,17 @@ available in the breadcrumb hierarchy.
86
98
  ### Accessibility
87
99
 
88
100
  Only one `Breadcrumbs` component should be rendered on a page. This is because
89
- only one HTML `<nav>` element with `aria-label` attribute of "Breadcrumbs"
90
- should be rendered. The DS `Breadcrumbs` component renders this HTML landmark
91
- so only one component must be rendered on a page.
101
+ only one HTML `<nav>` element with an `aria-label` attribute value of
102
+ "Breadcrumbs" should be rendered on a page. The DS `Breadcrumbs` component
103
+ renders this HTML landmark so only one component must be rendered on a page.
104
+
105
+ Internally, links are organized in a `ul` list element. The current page link is
106
+ denoted by an `aria-current` attribute value of "page".
92
107
 
93
108
  - [W3 Breadcrumbs Practice](https://www.w3.org/TR/wai-aria-practices/examples/breadcrumb/index.html)
109
+ - [Chakra UI Breadcrumb](https://chakra-ui.com/docs/components/navigation/breadcrumb)
94
110
 
95
- ### Long Titles
111
+ ## Long Titles
96
112
 
97
113
  <Canvas>
98
114
  <DSProvider>
@@ -34,6 +34,37 @@ describe("Breadcrumbs Accessibility", () => {
34
34
  });
35
35
  });
36
36
 
37
+ describe("Breadcrumbs", () => {
38
+ const breadcrumbsData = [
39
+ { url: "#string1", text: "string1" },
40
+ { url: "#string2", text: "string2" },
41
+ { url: "#string3", text: "string3" },
42
+ ];
43
+
44
+ it("Renders a tag with custom text", () => {
45
+ render(<Breadcrumbs breadcrumbsData={breadcrumbsData} />);
46
+
47
+ // The last breadcrumb (the active page) is not a link.
48
+ expect(screen.getAllByRole("link")).toHaveLength(2);
49
+ expect(screen.getAllByRole("link")[0]).toHaveTextContent("string1");
50
+ expect(screen.getAllByRole("link")[1]).toHaveTextContent("string2");
51
+ expect(screen.getByText(/string3/)).toBeInTheDocument();
52
+ });
53
+
54
+ it("Renders icon", () => {
55
+ const { container } = render(
56
+ <Breadcrumbs breadcrumbsData={breadcrumbsData} />
57
+ );
58
+ expect(container.querySelector(".breadcrumbs-icon")).toBeInTheDocument();
59
+ });
60
+
61
+ it("Throws error when nothing is passed into Breadcrumb", () => {
62
+ expect(() => render(<Breadcrumbs breadcrumbsData={[]} />)).toThrowError(
63
+ "NYPL Reservoir Breadcrumbs: No data was passed to the `breadcrumbsData` prop."
64
+ );
65
+ });
66
+ });
67
+
37
68
  describe("Breadcrumbs Snapshot", () => {
38
69
  it("Renders the UI snapshot correctly", () => {
39
70
  const breadcrumbsData = [
@@ -94,6 +125,25 @@ describe("Breadcrumbs Snapshot", () => {
94
125
  />
95
126
  )
96
127
  .toJSON();
128
+ const withChakraProps = renderer
129
+ .create(
130
+ <Breadcrumbs
131
+ breadcrumbsData={breadcrumbsData}
132
+ id="breadcrumbs-test"
133
+ p="s"
134
+ color="ui.error.primary"
135
+ />
136
+ )
137
+ .toJSON();
138
+ const withOtherProps = renderer
139
+ .create(
140
+ <Breadcrumbs
141
+ breadcrumbsData={breadcrumbsData}
142
+ id="breadcrumbs-test"
143
+ data-testid="testid"
144
+ />
145
+ )
146
+ .toJSON();
97
147
 
98
148
  expect(breadcrumbsSnapshot).toMatchSnapshot();
99
149
  expect(breadcrumbsVariantColor).toMatchSnapshot();
@@ -101,36 +151,7 @@ describe("Breadcrumbs Snapshot", () => {
101
151
  expect(breadcrumbsLocationsVariant).toMatchSnapshot();
102
152
  expect(breadcrumbsEducationVariant).toMatchSnapshot();
103
153
  expect(breadcrumbsAdditionalStyles).toMatchSnapshot();
104
- });
105
- });
106
-
107
- describe("Breadcrumbs Testing", () => {
108
- const breadcrumbsData = [
109
- { url: "#string1", text: "string1" },
110
- { url: "#string2", text: "string2" },
111
- { url: "#string3", text: "string3" },
112
- ];
113
-
114
- it("Renders a tag with custom text", () => {
115
- render(<Breadcrumbs breadcrumbsData={breadcrumbsData} />);
116
-
117
- // The last breadcrumb (the active page) is not a link.
118
- expect(screen.getAllByRole("link")).toHaveLength(2);
119
- expect(screen.getAllByRole("link")[0]).toHaveTextContent("string1");
120
- expect(screen.getAllByRole("link")[1]).toHaveTextContent("string2");
121
- expect(screen.getByText(/string3/)).toBeInTheDocument();
122
- });
123
-
124
- it("Renders icon", () => {
125
- const { container } = render(
126
- <Breadcrumbs breadcrumbsData={breadcrumbsData} />
127
- );
128
- expect(container.querySelector(".breadcrumbs-icon")).toBeInTheDocument();
129
- });
130
-
131
- it("Throws error when nothing is passed into Breadcrumb", () => {
132
- expect(() => render(<Breadcrumbs breadcrumbsData={[]} />)).toThrowError(
133
- "NYPL Reservoir Breadcrumbs: No data was passed to the `breadcrumbsData` prop."
134
- );
154
+ expect(withChakraProps).toMatchSnapshot();
155
+ expect(withOtherProps).toMatchSnapshot();
135
156
  });
136
157
  });