@nypl/design-system-react-components 0.25.12 → 0.25.13

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 (194) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/dist/components/Accordion/Accordion.d.ts +5 -3
  3. package/dist/components/Accordion/AccordionTypes.d.ts +5 -0
  4. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +3 -3
  5. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +1 -1
  6. package/dist/components/Card/Card.d.ts +11 -20
  7. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  8. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +4 -2
  9. package/dist/components/Heading/Heading.d.ts +4 -4
  10. package/dist/components/Heading/HeadingTypes.d.ts +1 -1
  11. package/dist/components/Hero/Hero.d.ts +7 -4
  12. package/dist/components/Icons/IconTypes.d.ts +1 -0
  13. package/dist/components/Image/Image.d.ts +25 -7
  14. package/dist/components/Image/ImageTypes.d.ts +4 -4
  15. package/dist/components/Logo/LogoTypes.d.ts +2 -2
  16. package/dist/components/Notification/Notification.d.ts +4 -4
  17. package/dist/components/Radio/Radio.d.ts +1 -1
  18. package/dist/components/RadioGroup/RadioGroup.d.ts +4 -2
  19. package/dist/components/Select/Select.d.ts +2 -2
  20. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +4 -3
  21. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +0 -4
  22. package/dist/components/StructuredContent/StructuredContent.d.ts +9 -22
  23. package/dist/components/Tabs/Tabs.d.ts +3 -3
  24. package/dist/components/Template/Template.d.ts +13 -5
  25. package/dist/components/Text/Text.d.ts +3 -3
  26. package/dist/components/Text/TextTypes.d.ts +1 -1
  27. package/dist/components/TextInput/TextInput.d.ts +2 -2
  28. package/dist/components/Toggle/Toggle.d.ts +6 -7
  29. package/dist/components/Toggle/{ToggleSizes.d.ts → ToggleTypes.d.ts} +1 -1
  30. package/dist/design-system-react-components.cjs.development.js +505 -422
  31. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  32. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  33. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  34. package/dist/design-system-react-components.esm.js +514 -435
  35. package/dist/design-system-react-components.esm.js.map +1 -1
  36. package/dist/helpers/enums.d.ts +4 -0
  37. package/dist/index.d.ts +7 -8
  38. package/dist/theme/components/accordion.d.ts +7 -12
  39. package/dist/theme/components/breadcrumb.d.ts +3 -0
  40. package/dist/theme/components/card.d.ts +4 -4
  41. package/dist/theme/components/checkbox.d.ts +1 -0
  42. package/dist/theme/components/checkboxGroup.d.ts +3 -1
  43. package/dist/theme/components/global.d.ts +2 -1
  44. package/dist/theme/components/hero.d.ts +1 -1
  45. package/dist/theme/components/image.d.ts +1 -1
  46. package/dist/theme/components/notification.d.ts +4 -4
  47. package/dist/theme/components/pagination.d.ts +2 -5
  48. package/dist/theme/components/radio.d.ts +1 -0
  49. package/dist/theme/components/radioGroup.d.ts +3 -1
  50. package/dist/theme/components/select.d.ts +3 -0
  51. package/dist/theme/components/toggle.d.ts +13 -1
  52. package/package.json +1 -1
  53. package/src/components/AccessibilityGuide/SkipNavigation.stories.mdx +34 -0
  54. package/src/components/Accordion/Accordion.stories.mdx +150 -66
  55. package/src/components/Accordion/Accordion.test.tsx +44 -17
  56. package/src/components/Accordion/Accordion.tsx +50 -20
  57. package/src/components/Accordion/AccordionTypes.tsx +5 -0
  58. package/src/components/Accordion/__snapshots__/Accordion.test.tsx.snap +244 -2
  59. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +17 -15
  60. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +6 -6
  61. package/src/components/Breadcrumbs/Breadcrumbs.tsx +6 -6
  62. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +1 -1
  63. package/src/components/Card/Card.stories.mdx +236 -165
  64. package/src/components/Card/Card.test.tsx +36 -18
  65. package/src/components/Card/Card.tsx +84 -59
  66. package/src/components/Card/__snapshots__/Card.test.tsx.snap +25 -65
  67. package/src/components/Chakra/Center.stories.mdx +2 -2
  68. package/src/components/Checkbox/Checkbox.stories.mdx +13 -1
  69. package/src/components/Checkbox/Checkbox.test.tsx +58 -2
  70. package/src/components/Checkbox/Checkbox.tsx +6 -1
  71. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +76 -0
  72. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +73 -9
  73. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +79 -9
  74. package/src/components/CheckboxGroup/CheckboxGroup.tsx +10 -7
  75. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +169 -0
  76. package/src/components/ComponentWrapper/ComponentWrapper.tsx +1 -1
  77. package/src/components/DatePicker/DatePicker.test.tsx +5 -2
  78. package/src/components/DatePicker/DatePicker.tsx +5 -2
  79. package/src/components/Form/Form.stories.mdx +47 -9
  80. package/src/components/Form/Form.test.tsx +1 -1
  81. package/src/components/Form/Form.tsx +3 -1
  82. package/src/components/Grid/SimpleGrid.stories.mdx +53 -35
  83. package/src/components/Grid/SimpleGrid.test.tsx +15 -9
  84. package/src/components/Heading/Heading.stories.mdx +21 -23
  85. package/src/components/Heading/Heading.test.tsx +7 -7
  86. package/src/components/Heading/Heading.tsx +10 -14
  87. package/src/components/Heading/HeadingTypes.tsx +1 -1
  88. package/src/components/Heading/__snapshots__/Heading.test.tsx.snap +1 -1
  89. package/src/components/Hero/Hero.stories.mdx +27 -27
  90. package/src/components/Hero/Hero.test.tsx +113 -58
  91. package/src/components/Hero/Hero.tsx +43 -20
  92. package/src/components/HorizontalRule/HorizontalRule.test.tsx +6 -4
  93. package/src/components/HorizontalRule/HorizontalRule.tsx +3 -2
  94. package/src/components/Icons/Icon.stories.mdx +50 -18
  95. package/src/components/Icons/Icon.test.tsx +13 -2
  96. package/src/components/Icons/Icon.tsx +11 -6
  97. package/src/components/Icons/IconTypes.tsx +1 -0
  98. package/src/components/Image/Image.stories.mdx +133 -68
  99. package/src/components/Image/Image.test.tsx +32 -48
  100. package/src/components/Image/Image.tsx +46 -26
  101. package/src/components/Image/ImageTypes.ts +4 -4
  102. package/src/components/Image/__snapshots__/Image.test.tsx.snap +60 -13
  103. package/src/components/Link/Link.tsx +8 -1
  104. package/src/components/List/List.stories.mdx +1 -1
  105. package/src/components/List/List.test.tsx +7 -4
  106. package/src/components/List/List.tsx +7 -4
  107. package/src/components/Logo/Logo.stories.mdx +13 -13
  108. package/src/components/Logo/Logo.test.tsx +12 -2
  109. package/src/components/Logo/Logo.tsx +10 -5
  110. package/src/components/Logo/LogoTypes.tsx +1 -1
  111. package/src/components/Notification/Notification.stories.mdx +5 -5
  112. package/src/components/Notification/Notification.tsx +10 -10
  113. package/src/components/Pagination/Pagination.stories.mdx +4 -3
  114. package/src/components/Pagination/Pagination.test.tsx +30 -2
  115. package/src/components/Pagination/Pagination.tsx +6 -3
  116. package/src/components/ProgressIndicator/ProgressIndicator.stories.mdx +1 -1
  117. package/src/components/ProgressIndicator/ProgressIndicator.test.tsx +6 -2
  118. package/src/components/ProgressIndicator/ProgressIndicator.tsx +3 -1
  119. package/src/components/Radio/Radio.stories.mdx +13 -1
  120. package/src/components/Radio/Radio.test.tsx +56 -2
  121. package/src/components/Radio/Radio.tsx +6 -1
  122. package/src/components/Radio/__snapshots__/Radio.test.tsx.snap +61 -0
  123. package/src/components/RadioGroup/RadioGroup.stories.mdx +73 -9
  124. package/src/components/RadioGroup/RadioGroup.test.tsx +72 -7
  125. package/src/components/RadioGroup/RadioGroup.tsx +10 -7
  126. package/src/components/RadioGroup/__snapshots__/RadioGroup.test.tsx.snap +140 -0
  127. package/src/components/SearchBar/SearchBar.stories.mdx +1 -1
  128. package/src/components/SearchBar/SearchBar.tsx +3 -3
  129. package/src/components/Select/Select.stories.mdx +26 -16
  130. package/src/components/Select/Select.test.tsx +1 -36
  131. package/src/components/Select/Select.tsx +4 -16
  132. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +12 -14
  133. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +6 -8
  134. package/src/components/SkeletonLoader/SkeletonLoader.tsx +5 -7
  135. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +0 -5
  136. package/src/components/Slider/Slider.stories.mdx +41 -8
  137. package/src/components/Slider/Slider.tsx +4 -4
  138. package/src/components/StatusBadge/StatusBadge.test.tsx +3 -1
  139. package/src/components/StatusBadge/StatusBadge.tsx +1 -1
  140. package/src/components/StructuredContent/StructuredContent.stories.mdx +103 -54
  141. package/src/components/StructuredContent/StructuredContent.test.tsx +129 -102
  142. package/src/components/StructuredContent/StructuredContent.tsx +43 -53
  143. package/src/components/StyleGuide/ColorCard.tsx +3 -3
  144. package/src/components/StyleGuide/Typography.stories.mdx +17 -12
  145. package/src/components/Table/Table.test.tsx +1 -1
  146. package/src/components/Table/Table.tsx +3 -1
  147. package/src/components/Tabs/Tabs.stories.mdx +8 -8
  148. package/src/components/Tabs/Tabs.test.tsx +13 -11
  149. package/src/components/Tabs/Tabs.tsx +18 -15
  150. package/src/components/Template/Template.stories.mdx +62 -25
  151. package/src/components/Template/Template.test.tsx +35 -5
  152. package/src/components/Template/Template.tsx +26 -13
  153. package/src/components/Template/__snapshots__/Template.test.tsx.snap +4 -2
  154. package/src/components/Text/Text.stories.mdx +13 -15
  155. package/src/components/Text/Text.test.tsx +6 -15
  156. package/src/components/Text/Text.tsx +7 -12
  157. package/src/components/Text/TextTypes.tsx +1 -1
  158. package/src/components/TextInput/TextInput.stories.mdx +9 -9
  159. package/src/components/TextInput/TextInput.test.tsx +28 -27
  160. package/src/components/TextInput/TextInput.tsx +4 -4
  161. package/src/components/Toggle/Toggle.stories.mdx +12 -22
  162. package/src/components/Toggle/Toggle.test.tsx +15 -2
  163. package/src/components/Toggle/Toggle.tsx +8 -9
  164. package/src/components/Toggle/{ToggleSizes.tsx → ToggleTypes.tsx} +1 -1
  165. package/src/components/Toggle/__snapshots__/Toggle.test.tsx.snap +64 -0
  166. package/src/components/VideoPlayer/VideoPlayer.test.tsx +18 -6
  167. package/src/components/VideoPlayer/VideoPlayer.tsx +14 -7
  168. package/src/docs/{Intro.stories.mdx → Welcome.stories.mdx} +5 -9
  169. package/src/{components/Card/CardTypes.tsx → helpers/enums.ts} +2 -2
  170. package/src/hooks/tests/useNYPLTheme.test.tsx +1 -1
  171. package/src/hooks/useCarouselStyles.stories.mdx +10 -0
  172. package/src/hooks/useNYPLTheme.ts +1 -1
  173. package/src/index.ts +7 -14
  174. package/src/theme/components/accordion.ts +7 -12
  175. package/src/theme/components/breadcrumb.ts +3 -0
  176. package/src/theme/components/card.ts +29 -20
  177. package/src/theme/components/checkboxGroup.ts +3 -1
  178. package/src/theme/components/global.ts +4 -3
  179. package/src/theme/components/hero.ts +1 -1
  180. package/src/theme/components/icon.ts +5 -2
  181. package/src/theme/components/image.ts +1 -1
  182. package/src/theme/components/list.ts +1 -1
  183. package/src/theme/components/notification.ts +5 -5
  184. package/src/theme/components/pagination.ts +2 -5
  185. package/src/theme/components/progressIndicator.ts +3 -3
  186. package/src/theme/components/radioGroup.ts +3 -1
  187. package/src/theme/components/select.ts +6 -0
  188. package/src/theme/components/toggle.ts +26 -3
  189. package/src/utils/componentCategories.ts +27 -19
  190. package/dist/components/Card/CardTypes.d.ts +0 -4
  191. package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +0 -4
  192. package/dist/components/RadioGroup/RadioGroupLayoutTypes.d.ts +0 -4
  193. package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +0 -4
  194. package/src/components/RadioGroup/RadioGroupLayoutTypes.tsx +0 -4
@@ -181,17 +181,20 @@ describe("VideoPlayer", () => {
181
181
 
182
182
  render(<VideoPlayer />);
183
183
  expect(warn).toHaveBeenCalledWith(
184
- "VideoPlayer requires either the `embedCode` prop or both the `videoType` and `videoId` props."
184
+ "NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
185
+ "both the `videoType` and `videoId` props; none were passed."
185
186
  );
186
187
 
187
188
  render(<VideoPlayer videoId="http://vimeo.com/474719268" />);
188
189
  expect(warn).toHaveBeenCalledWith(
189
- "VideoPlayer also requires the `videoType` prop. You have only set the `videoId` prop."
190
+ "NYPL Reservoir VideoPlayer: The `videoType` prop is also required. " +
191
+ "Only the `videoId` prop was set."
190
192
  );
191
193
 
192
194
  render(<VideoPlayer videoType={VideoPlayerTypes.Vimeo} />);
193
195
  expect(warn).toHaveBeenCalledWith(
194
- "VideoPlayer also requires the `videoId` prop. You have only set the `videoType` prop."
196
+ "NYPL Reservoir VideoPlayer: The `videoId` prop is also required. " +
197
+ "Only the `videoType` prop was set."
195
198
  );
196
199
 
197
200
  render(
@@ -202,7 +205,8 @@ describe("VideoPlayer", () => {
202
205
  />
203
206
  );
204
207
  expect(warn).toHaveBeenCalledWith(
205
- "VideoPlayer can accept the `embedCode` prop or the `videoType` and `videoId` props. You have set both."
208
+ "NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
209
+ "both the `videoType` and `videoId` props; all were set."
206
210
  );
207
211
 
208
212
  render(
@@ -212,7 +216,8 @@ describe("VideoPlayer", () => {
212
216
  />
213
217
  );
214
218
  expect(warn).toHaveBeenCalledWith(
215
- "VideoPlayer can accept the `embedCode` prop or the `videoType` and `videoId` props. You have set both."
219
+ "NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
220
+ "both the `videoType` and `videoId` props; all were set."
216
221
  );
217
222
 
218
223
  render(
@@ -222,7 +227,14 @@ describe("VideoPlayer", () => {
222
227
  />
223
228
  );
224
229
  expect(warn).toHaveBeenCalledWith(
225
- "VideoPlayer can accept the `embedCode` prop or the `videoType` and `videoId` props. You have set both."
230
+ "NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
231
+ "both the `videoType` and `videoId` props; all were set."
232
+ );
233
+
234
+ const embedCode = `<iframe src="https://player./video/421404144?h=5467db7edd"></iframe>`;
235
+ render(<VideoPlayer embedCode={embedCode} />);
236
+ expect(warn).toHaveBeenCalledWith(
237
+ "NYPL Reservoir VideoPlayer: The `embedCode` prop is not configured properly."
226
238
  );
227
239
  });
228
240
  });
@@ -78,27 +78,32 @@ export default function VideoPlayer(
78
78
  : embedCode;
79
79
 
80
80
  const errorMessage =
81
- "<strong>Error:</strong> This video player has not been configured properly. Please contact the site administrator.";
81
+ "<strong>Error:</strong> This video player has not been configured " +
82
+ "properly. Please contact the site administrator.";
82
83
 
83
84
  let isInvalid = false;
84
85
  if (!embedCodeFinal && !videoType && !videoId) {
85
86
  console.warn(
86
- "VideoPlayer requires either the `embedCode` prop or both the `videoType` and `videoId` props."
87
+ "NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
88
+ "both the `videoType` and `videoId` props; none were passed."
87
89
  );
88
90
  isInvalid = true;
89
91
  } else if (!embedCodeFinal && !videoType) {
90
92
  console.warn(
91
- "VideoPlayer also requires the `videoType` prop. You have only set the `videoId` prop."
93
+ "NYPL Reservoir VideoPlayer: The `videoType` prop is also required. " +
94
+ "Only the `videoId` prop was set."
92
95
  );
93
96
  isInvalid = true;
94
97
  } else if (!embedCodeFinal && !videoId) {
95
98
  console.warn(
96
- "VideoPlayer also requires the `videoId` prop. You have only set the `videoType` prop."
99
+ "NYPL Reservoir VideoPlayer: The `videoId` prop is also required. " +
100
+ "Only the `videoType` prop was set."
97
101
  );
98
102
  isInvalid = true;
99
103
  } else if (embedCodeFinal && (videoType || videoId)) {
100
104
  console.warn(
101
- "VideoPlayer can accept the `embedCode` prop or the `videoType` and `videoId` props. You have set both."
105
+ "NYPL Reservoir VideoPlayer: Pass in either the `embedCode` prop or " +
106
+ "both the `videoType` and `videoId` props; all were set."
102
107
  );
103
108
  isInvalid = true;
104
109
  }
@@ -111,7 +116,9 @@ export default function VideoPlayer(
111
116
  videoId.includes("youtube") ||
112
117
  videoId.includes("vimeo"))
113
118
  ) {
114
- console.warn("The VideoPlayer `videoId` prop is not configured properly.");
119
+ console.warn(
120
+ "NYPL Reservoir VideoPlayer: The `videoId` prop is not configured properly."
121
+ );
115
122
  isInvalid = true;
116
123
  }
117
124
 
@@ -123,7 +130,7 @@ export default function VideoPlayer(
123
130
  !embedCodeFinal.includes("</iframe"))
124
131
  ) {
125
132
  console.warn(
126
- "The VideoPlayer `embedCode` prop is not configured properly."
133
+ "NYPL Reservoir VideoPlayer: The `embedCode` prop is not configured properly."
127
134
  );
128
135
  isInvalid = true;
129
136
  }
@@ -6,7 +6,7 @@ import Heading from "../components/Heading/Heading.tsx";
6
6
  import Image from "../components/Image/Image.tsx";
7
7
  import DSProvider from "../theme/provider";
8
8
 
9
- <Meta title="Introduction" />
9
+ <Meta title="Welcome" />
10
10
 
11
11
  # NYPL Design System
12
12
 
@@ -15,16 +15,12 @@ export const heroForegroundColor = `var(--nypl-colors-ui-white)`;
15
15
 
16
16
  <DSProvider>
17
17
  <Hero
18
- heroType={HeroTypes.FiftyFifty}
19
- subHeaderText="With 92 locations across the Bronx, Manhattan, and Staten Island, The New York Public Library is an essential part of neighborhoods across the city. Visit us today."
20
- image={
21
- <Image
22
- src="https://cdn-d8.nypl.org/s3fs-public/styles/2_1_960/public/2020-07/SASB_06_29_2020_Lions_mask-00207%20copy_0.jpeg?h=c8e955ed&itok=n_GLQgoe"
23
- alt=""
24
- />
25
- }
26
18
  backgroundColor={heroBackgroundColor}
27
19
  foregroundColor={heroForegroundColor}
20
+ heroType={HeroTypes.FiftyFifty}
21
+ imageAlt="NYPL Lion with mask on"
22
+ imageSrc="https://cdn-d8.nypl.org/s3fs-public/styles/2_1_960/public/2020-07/SASB_06_29_2020_Lions_mask-00207%20copy_0.jpeg?h=c8e955ed&itok=n_GLQgoe"
23
+ subHeaderText="With 92 locations across the Bronx, Manhattan, and Staten Island, The New York Public Library is an essential part of neighborhoods across the city. Visit us today."
28
24
  />
29
25
  </DSProvider>
30
26
 
@@ -1,4 +1,4 @@
1
- export enum CardLayouts {
2
- Row = "row",
1
+ export enum LayoutTypes {
3
2
  Column = "column",
3
+ Row = "row",
4
4
  }
@@ -10,7 +10,7 @@ describe("useNYPLTheme", () => {
10
10
  const { result } = renderHook(() => useNYPLTheme());
11
11
 
12
12
  expect(warn).toHaveBeenCalledWith(
13
- "The `useNYPLTheme` hook must be used inside of `<DSProvider />`."
13
+ "NYPL Reservoir useNYPLTheme: hook must be used inside of `<DSProvider />`."
14
14
  );
15
15
  expect(result.current).toEqual({});
16
16
  });
@@ -0,0 +1,10 @@
1
+ import { getCategory } from "../utils/componentCategories";
2
+
3
+ <Meta title={getCategory("useCarouselStyles")} />
4
+
5
+ # useCarouselStyles
6
+
7
+ | Hook Version | DS Version |
8
+ | ------------ | ---------- |
9
+ | Added | `?` |
10
+ | Latest | `?` |
@@ -9,7 +9,7 @@ function useNYPLTheme() {
9
9
  const theme = useTheme();
10
10
  if (!theme || Object.keys(theme).length === 0) {
11
11
  console.warn(
12
- "The `useNYPLTheme` hook must be used inside of `<DSProvider />`."
12
+ "NYPL Reservoir useNYPLTheme: hook must be used inside of `<DSProvider />`."
13
13
  );
14
14
  return {};
15
15
  }
package/src/index.ts CHANGED
@@ -17,8 +17,9 @@ export {
17
17
  VStack,
18
18
  } from "@chakra-ui/react";
19
19
  export { default as Accordion } from "./components/Accordion/Accordion";
20
+ export { AccordionTypes } from "./components/Accordion/AccordionTypes";
20
21
  export { default as Breadcrumbs } from "./components/Breadcrumbs/Breadcrumbs";
21
- export { ColorVariants } from "./components/Breadcrumbs/BreadcrumbsTypes";
22
+ export { BreadcrumbsTypes } from "./components/Breadcrumbs/BreadcrumbsTypes";
22
23
  export { default as Button } from "./components/Button/Button";
23
24
  export { ButtonTypes } from "./components/Button/ButtonTypes";
24
25
  export {
@@ -27,10 +28,8 @@ export {
27
28
  CardContent,
28
29
  CardHeading,
29
30
  } from "./components/Card/Card";
30
- export { CardLayouts } from "./components/Card/CardTypes";
31
31
  export { default as Checkbox } from "./components/Checkbox/Checkbox";
32
32
  export { default as CheckboxGroup } from "./components/CheckboxGroup/CheckboxGroup";
33
- export { CheckboxGroupLayoutTypes } from "./components/CheckboxGroup/CheckboxGroupLayoutTypes";
34
33
  export {
35
34
  default as DatePicker,
36
35
  FullDateType,
@@ -42,10 +41,7 @@ export { default as Form, FormField, FormRow } from "./components/Form/Form";
42
41
  export { FormGaps } from "./components/Form/FormTypes";
43
42
  export { GridGaps } from "./components/Grid/GridTypes";
44
43
  export { default as Heading } from "./components/Heading/Heading";
45
- export {
46
- HeadingDisplaySizes,
47
- HeadingLevels,
48
- } from "./components/Heading/HeadingTypes";
44
+ export { HeadingSizes, HeadingLevels } from "./components/Heading/HeadingTypes";
49
45
  export { default as HelperErrorText } from "./components/HelperErrorText/HelperErrorText";
50
46
  export { default as Hero } from "./components/Hero/Hero";
51
47
  export { HeroTypes } from "./components/Hero/HeroTypes";
@@ -66,6 +62,7 @@ export {
66
62
  ImageTypes,
67
63
  } from "./components/Image/ImageTypes";
68
64
  export { default as Label } from "./components/Label/Label";
65
+ export { LayoutTypes } from "./helpers/enums";
69
66
  export { default as Link } from "./components/Link/Link";
70
67
  export { LinkTypes } from "./components/Link/LinkTypes";
71
68
  export { default as List } from "./components/List/List";
@@ -83,15 +80,11 @@ export {
83
80
  } from "./components/ProgressIndicator/ProgressIndicatorTypes";
84
81
  export { default as Radio } from "./components/Radio/Radio";
85
82
  export { default as RadioGroup } from "./components/RadioGroup/RadioGroup";
86
- export { RadioGroupLayoutTypes } from "./components/RadioGroup/RadioGroupLayoutTypes";
87
83
  export { default as SearchBar } from "./components/SearchBar/SearchBar";
88
84
  export { default as Select } from "./components/Select/Select";
89
85
  export { default as SimpleGrid } from "./components/Grid/SimpleGrid";
90
86
  export { default as SkeletonLoader } from "./components/SkeletonLoader/SkeletonLoader";
91
- export {
92
- SkeletonLoaderImageRatios,
93
- SkeletonLoaderLayouts,
94
- } from "./components/SkeletonLoader/SkeletonLoaderTypes";
87
+ export { SkeletonLoaderImageRatios } from "./components/SkeletonLoader/SkeletonLoaderTypes";
95
88
  export { default as Slider } from "./components/Slider/Slider";
96
89
  export { default as StatusBadge } from "./components/StatusBadge/StatusBadge";
97
90
  export { StatusBadgeTypes } from "./components/StatusBadge/StatusBadgeTypes";
@@ -117,14 +110,14 @@ export {
117
110
  TemplateFooter,
118
111
  } from "./components/Template/Template";
119
112
  export { default as Text } from "./components/Text/Text";
120
- export { TextDisplaySizes } from "./components/Text/TextTypes";
113
+ export { TextSizes } from "./components/Text/TextTypes";
121
114
  export {
122
115
  default as TextInput,
123
116
  TextInputRefType,
124
117
  } from "./components/TextInput/TextInput";
125
118
  export { TextInputTypes } from "./components/TextInput/TextInputTypes";
126
119
  export { default as Toggle } from "./components/Toggle/Toggle";
127
- export { ToggleSizes } from "./components/Toggle/ToggleSizes";
120
+ export { ToggleSizes } from "./components/Toggle/ToggleTypes";
128
121
  export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
129
122
  export { default as VideoPlayer } from "./components/VideoPlayer/VideoPlayer";
130
123
  export {
@@ -1,21 +1,16 @@
1
1
  const containerStyles = {
2
- borderLeftWidth: "1px",
3
- borderRightWidth: "1px",
4
- borderColor: "ui.gray.medium",
2
+ border: "none",
5
3
  width: "100%",
6
4
  };
7
5
  const buttonStyles = {
8
- border: "none",
9
- fontWeight: 500,
10
- _hover: {
11
- bg: "ui.gray.light-cool",
12
- },
6
+ borderWidth: "1px",
7
+ fontWeight: "medium",
13
8
  };
14
9
  const panelStyles = {
15
- paddingTop: "xs",
16
- paddingRight: "xxxl",
17
- paddingLeft: "s",
18
- paddingBottom: "xs",
10
+ padding: "s",
11
+ borderLeftWidth: "1px",
12
+ borderRightWidth: "1px",
13
+ borderBottomWidth: "1px",
19
14
  };
20
15
 
21
16
  const Accordion = {
@@ -7,6 +7,9 @@ const blogs = {
7
7
  color: "ui.gray.xdark",
8
8
  },
9
9
  },
10
+ svg: {
11
+ fill: "ui.black",
12
+ },
10
13
  };
11
14
  const booksAndMore = {
12
15
  bg: "section.books-and-more.secondary",
@@ -6,7 +6,7 @@ const imageSizes = {
6
6
  large: { flex: { md: "0 0 360px" } },
7
7
  };
8
8
  // This is complicated and can be refactored later...
9
- const getBodyPaddingStyles = ({ border, hasImage, imageAtEnd, isRow }) => {
9
+ const getBodyPaddingStyles = ({ border, hasImage, imageIsAtEnd, isRow }) => {
10
10
  let bodyPadding = null;
11
11
  if (border) {
12
12
  bodyPadding = "s";
@@ -22,7 +22,7 @@ const getBodyPaddingStyles = ({ border, hasImage, imageAtEnd, isRow }) => {
22
22
  base: "0 var(--nypl-space-s) var(--nypl-space-s)",
23
23
  md: "var(--nypl-space-s) var(--nypl-space-s) var(--nypl-space-s) 0",
24
24
  };
25
- if (imageAtEnd) {
25
+ if (imageIsAtEnd) {
26
26
  bodyPadding = {
27
27
  base: "var(--nypl-space-s) var(--nypl-space-s) 0",
28
28
  md: "var(--nypl-space-s) 0 var(--nypl-space-s) var(--nypl-space-s)",
@@ -34,8 +34,14 @@ const getBodyPaddingStyles = ({ border, hasImage, imageAtEnd, isRow }) => {
34
34
  const Card = {
35
35
  parts: ["body", "heading"],
36
36
  baseStyle: (props) => {
37
- const { border, center, hasImage, imageAtEnd, layout, mainActionLink } =
38
- props;
37
+ const {
38
+ border,
39
+ hasImage,
40
+ imageIsAtEnd,
41
+ isCentered,
42
+ layout,
43
+ mainActionLink,
44
+ } = props;
39
45
  const isRow = layout === "row";
40
46
  const layoutStyles = isRow
41
47
  ? {
@@ -46,7 +52,7 @@ const Card = {
46
52
  },
47
53
  maxWidth: "100%",
48
54
  textAlign: "left",
49
- alignItems: center ? "center" : null,
55
+ alignItems: isCentered ? "center" : null,
50
56
  }
51
57
  : {};
52
58
  const baseBorderStyles = border
@@ -58,11 +64,11 @@ const Card = {
58
64
  const bodyPadding = getBodyPaddingStyles({
59
65
  border,
60
66
  hasImage,
61
- imageAtEnd,
67
+ imageIsAtEnd,
62
68
  isRow,
63
69
  });
64
70
  let bodyMargin = null;
65
- if (center) {
71
+ if (isCentered) {
66
72
  bodyMargin = "auto";
67
73
  if (isRow) {
68
74
  bodyMargin = "0";
@@ -72,7 +78,7 @@ const Card = {
72
78
  alignItems: "flex-start",
73
79
  display: "flex",
74
80
  flexFlow: "column wrap",
75
- textAlign: center ? "center" : null,
81
+ textAlign: isCentered ? "center" : null,
76
82
  heading: {
77
83
  marginBottom: "xs",
78
84
  a: mainActionLink ? { color: "ui.black" } : null,
@@ -91,13 +97,15 @@ const Card = {
91
97
 
92
98
  const CardActions = {
93
99
  baseStyle: (props) => {
94
- const { bottomBorder, center, layout, topBorder } = props;
100
+ const { bottomBorder, isCentered, layout, topBorder } = props;
95
101
  let justifyContent = null;
96
- if (center) {
97
- justifyContent = "center";
98
- } else if (layout === "row") {
102
+ // Only center in the column layout.
103
+ if (layout === "row") {
99
104
  justifyContent = "left";
105
+ } else if (isCentered) {
106
+ justifyContent = "center";
100
107
  }
108
+
101
109
  const topBorderStyles = topBorder
102
110
  ? {
103
111
  borderTop: "1px solid",
@@ -135,30 +143,31 @@ const CardContent = {
135
143
  };
136
144
 
137
145
  const CardImage = {
138
- baseStyle: ({ center, imageAtEnd, imageSize, layout }) => {
146
+ baseStyle: ({ imageIsAtEnd, isCentered, size, layout }) => {
139
147
  // These sizes are only for the "row" layout.
140
- const size = imageSizes[imageSize] || {};
148
+ const imageSize = imageSizes[size] || {};
141
149
  const layoutStyles =
142
150
  layout === "row"
143
151
  ? {
144
152
  flex: { md: "0 0 225px" },
145
153
  maxWidth: { base: "100%", md: "50%" },
146
154
  textAlign: "left",
147
- alignItems: center ? "center" : null,
155
+ alignItems: isCentered ? "center" : null,
148
156
  margin: {
149
- base: imageAtEnd ? "var(--nypl-space-m) 0 0" : null,
150
- md: imageAtEnd
157
+ base: imageIsAtEnd ? "var(--nypl-space-m) 0 0" : null,
158
+ md: imageIsAtEnd
151
159
  ? "0 0 0 var(--nypl-space-m)"
152
160
  : "0 var(--nypl-space-m) 0 0",
153
161
  },
154
162
  width: { base: "100%", md: null },
155
- ...size,
163
+ marginBottom: ["xs", "xs"],
164
+ ...imageSize,
156
165
  }
157
166
  : {
158
167
  marginBottom: "xs",
159
168
  width: "100%",
160
169
  };
161
- const imageAtEndStyles = imageAtEnd
170
+ const imageIsAtEndStyles = imageIsAtEnd
162
171
  ? {
163
172
  marginBottom: "0",
164
173
  marginTop: "s",
@@ -167,7 +176,7 @@ const CardImage = {
167
176
  : {};
168
177
 
169
178
  return {
170
- ...imageAtEndStyles,
179
+ ...imageIsAtEndStyles,
171
180
  ...layoutStyles,
172
181
  };
173
182
  },
@@ -2,7 +2,9 @@ import { checkboxRadioGroupStyles } from "./global";
2
2
 
3
3
  const CheckboxGroup = {
4
4
  parts: ["helper", "stack"],
5
- baseStyle: checkboxRadioGroupStyles,
5
+ baseStyle: ({ isFullWidth = false }) => ({
6
+ ...checkboxRadioGroupStyles(isFullWidth),
7
+ }),
6
8
  };
7
9
 
8
10
  export default CheckboxGroup;
@@ -21,6 +21,7 @@ const checkboxRadioLabelStyles = {
21
21
  fontWeight: "text.default",
22
22
  marginBottom: "0",
23
23
  marginLeft: "xs",
24
+ width: "100%",
24
25
  _disabled: {
25
26
  color: "ui.gray.dark",
26
27
  opacity: 1,
@@ -44,14 +45,14 @@ const checkboxRadioHelperStyle = {
44
45
  fontStyle: "italic",
45
46
  },
46
47
  };
47
- const checkboxRadioGroupStyles = {
48
+ const checkboxRadioGroupStyles = (isFullWidth = false) => ({
48
49
  helper: {
49
50
  marginTop: "s",
50
51
  },
51
52
  stack: {
52
- width: "fit-content",
53
+ width: isFullWidth ? "100%" : "fit-content",
53
54
  },
54
- };
55
+ });
55
56
  // Used in `Label` and `Fieldset`.
56
57
  const labelLegendText = {
57
58
  alignItems: "baseline",
@@ -143,7 +143,7 @@ const campaign = {
143
143
  alignItems: "center",
144
144
  display: "flex",
145
145
  justifyContent: "center",
146
- marginBottom: "xxl",
146
+ marginBottom: ["0", "0", "xxl"],
147
147
  minHeight: "300px",
148
148
  overflow: "visible",
149
149
  padding: {
@@ -1,8 +1,8 @@
1
1
  const svgBase = {
2
2
  display: "inline-block",
3
3
  fill: "currentColor",
4
- width: "24px",
5
- height: "24px",
4
+ width: "auto",
5
+ height: "100%",
6
6
  };
7
7
  const align = {
8
8
  none: {},
@@ -40,6 +40,9 @@ const size = {
40
40
  height: "var(--nypl-space-m)",
41
41
  width: "var(--nypl-space-m)",
42
42
  },
43
+ default: {
44
+ width: "100%",
45
+ },
43
46
  medium: {
44
47
  height: "1.125rem",
45
48
  width: "1.125rem",
@@ -85,6 +85,7 @@ const CustomImage = {
85
85
  },
86
86
  figcaption: {
87
87
  fontStyle: "italic",
88
+ fontSize: "text.tag",
88
89
  },
89
90
  img: {
90
91
  display: "block",
@@ -96,7 +97,6 @@ const CustomImage = {
96
97
  },
97
98
  captionWrappers: {
98
99
  marginBottom: "xxs",
99
- fontSize: "text.caption",
100
100
  },
101
101
  }),
102
102
  };
@@ -10,7 +10,7 @@ const List = {
10
10
  padding: noStyling ? "0" : null,
11
11
  display: inline ? "flex" : null,
12
12
  li: {
13
- marginRight: inline ? "m" : null,
13
+ marginRight: inline ? "xs" : null,
14
14
  listStyleType: inline ? "none" : null,
15
15
  _notFirst: {
16
16
  marginTop: inline ? null : "xxs",
@@ -2,7 +2,7 @@ import { NotificationTypes } from "../../components/Notification/NotificationTyp
2
2
 
3
3
  const Notification = {
4
4
  parts: ["container", "dismissibleButton", "icon"],
5
- baseStyle: ({ centered, dismissible, noMargin, notificationType }) => {
5
+ baseStyle: ({ dismissible, isCentered, noMargin, notificationType }) => {
6
6
  let bg = "ui.status.primary";
7
7
  if (
8
8
  notificationType === NotificationTypes.Announcement ||
@@ -15,7 +15,7 @@ const Notification = {
15
15
  display: "flex",
16
16
  fontSize: "-1", // slightly smaller than the default size
17
17
  position: "relative",
18
- textAlign: centered ? "center" : null,
18
+ textAlign: isCentered ? "center" : null,
19
19
  borderRadius: noMargin ? "0" : "4px",
20
20
  margin: noMargin ? "0" : "s",
21
21
  container: {
@@ -23,7 +23,7 @@ const Notification = {
23
23
  maxWidth: "var(--nypl-breakpoint-xl)",
24
24
  padding: "s",
25
25
  paddingRight: dismissible ? "l" : null,
26
- paddingLeft: centered && dismissible ? "l" : null,
26
+ paddingLeft: isCentered && dismissible ? "l" : null,
27
27
  width: "100%",
28
28
  },
29
29
  dismissibleButton: {
@@ -81,7 +81,7 @@ const NotificationContent = {
81
81
 
82
82
  const NotificationHeading = {
83
83
  parts: ["heading"],
84
- baseStyle: ({ centered, icon, notificationType }) => {
84
+ baseStyle: ({ icon, isCentered, notificationType }) => {
85
85
  let color = "ui.black";
86
86
  if (notificationType === NotificationTypes.Announcement) {
87
87
  color = "section.research.secondary";
@@ -91,7 +91,7 @@ const NotificationHeading = {
91
91
  return {
92
92
  display: "flex",
93
93
  marginBottom: "xxs",
94
- justifyContent: centered ? "center" : null,
94
+ justifyContent: isCentered ? "center" : null,
95
95
  heading: {
96
96
  marginBottom: "0",
97
97
  marginTop: icon ? "xxxs" : "0",
@@ -1,7 +1,6 @@
1
1
  const Pagination = {
2
2
  parts: ["link"],
3
3
  baseStyle: {
4
- marginBottom: "l",
5
4
  alignItems: "stretch",
6
5
  display: "flex",
7
6
  width: "100%",
@@ -9,10 +8,8 @@ const Pagination = {
9
8
  lineHeight: "1.15",
10
9
  textDecoration: "none",
11
10
  },
12
- li: {
13
- _first: {
14
- marginTop: "xxs",
15
- },
11
+ ul: {
12
+ marginBottom: "0",
16
13
  },
17
14
  },
18
15
  };
@@ -15,8 +15,8 @@ const ProgressIndicator = {
15
15
  // Note: we have to target the SVG HTMl elements in order
16
16
  // to override the default styles.
17
17
  svg: {
18
- height: size === ProgressIndicatorSizes.Small ? "24px" : "48px",
19
- width: size === ProgressIndicatorSizes.Small ? "24px" : "48px",
18
+ height: size === ProgressIndicatorSizes.Default ? "48px" : "24px",
19
+ width: size === ProgressIndicatorSizes.Default ? "48px" : "24px",
20
20
  display: "block",
21
21
  circle: {
22
22
  _first: {
@@ -44,7 +44,7 @@ const ProgressIndicator = {
44
44
  bg: darkMode ? "ui.gray.dark" : "ui.gray.light-cool",
45
45
  height: {
46
46
  base: "4px",
47
- md: size === ProgressIndicatorSizes.Small ? "4px" : "8px",
47
+ md: size === ProgressIndicatorSizes.Default ? "8px" : "4px",
48
48
  },
49
49
  },
50
50
  linearContainer: {
@@ -2,7 +2,9 @@ import { checkboxRadioGroupStyles } from "./global";
2
2
 
3
3
  const RadioGroup = {
4
4
  parts: ["helper", "stack"],
5
- baseStyle: checkboxRadioGroupStyles,
5
+ baseStyle: ({ isFullWidth = false }) => ({
6
+ ...checkboxRadioGroupStyles(isFullWidth),
7
+ }),
6
8
  };
7
9
 
8
10
  export default RadioGroup;
@@ -29,6 +29,12 @@ const Select = {
29
29
  parts: ["select", "helper"],
30
30
  baseStyle: {
31
31
  marginBottom: "xs",
32
+ // The backgroundColor set to "ui.white" hides the arrow SVG icon when
33
+ // the component is focused. The background is added for dark mode and
34
+ // so we need to add specific selector.
35
+ ".chakra-select__icon-wrapper": {
36
+ zIndex: "9999",
37
+ },
32
38
  helper: {
33
39
  ...helperTextMargin,
34
40
  },