@nypl/design-system-react-components 0.25.0 → 0.25.1

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 (236) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/components/Accordion/Accordion.d.ts +14 -14
  3. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +11 -14
  4. package/dist/components/Breadcrumbs/BreadcrumbsTypes.d.ts +6 -0
  5. package/dist/components/Button/ButtonTypes.d.ts +2 -1
  6. package/dist/components/Card/Card.d.ts +1 -1
  7. package/dist/components/Card/CardTypes.d.ts +2 -2
  8. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +43 -0
  9. package/dist/components/CheckboxGroup/CheckboxGroupLayoutTypes.d.ts +4 -0
  10. package/dist/components/DatePicker/DatePicker.d.ts +3 -3
  11. package/dist/components/Form/Form.d.ts +13 -8
  12. package/dist/components/Form/FormTypes.d.ts +2 -8
  13. package/dist/components/Grid/GridTypes.d.ts +9 -0
  14. package/dist/components/Grid/SimpleGrid.d.ts +14 -0
  15. package/dist/components/Heading/Heading.d.ts +4 -4
  16. package/dist/components/Hero/Hero.d.ts +19 -14
  17. package/dist/components/Hero/HeroTypes.d.ts +10 -5
  18. package/dist/components/Icons/Icon.d.ts +13 -16
  19. package/dist/components/Icons/IconTypes.d.ts +78 -64
  20. package/dist/components/Label/Label.d.ts +5 -17
  21. package/dist/components/Link/Link.d.ts +8 -12
  22. package/dist/components/SearchBar/SearchBar.d.ts +45 -27
  23. package/dist/components/Select/Select.d.ts +32 -35
  24. package/dist/components/Select/SelectTypes.d.ts +4 -0
  25. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +1 -1
  26. package/dist/components/SkeletonLoader/SkeletonLoaderTypes.d.ts +2 -2
  27. package/dist/components/StatusBadge/StatusBadge.d.ts +8 -6
  28. package/dist/components/StatusBadge/StatusBadgeTypes.d.ts +5 -0
  29. package/dist/components/Template/Template.d.ts +91 -0
  30. package/dist/components/Text/Text.d.ts +16 -0
  31. package/dist/components/Text/TextTypes.d.ts +6 -0
  32. package/dist/components/TextInput/TextInput.d.ts +32 -31
  33. package/dist/components/TextInput/TextInputTypes.d.ts +5 -0
  34. package/dist/design-system-react-components.cjs.development.js +2597 -1170
  35. package/dist/design-system-react-components.cjs.development.js.map +1 -1
  36. package/dist/design-system-react-components.cjs.production.min.js +1 -1
  37. package/dist/design-system-react-components.cjs.production.min.js.map +1 -1
  38. package/dist/design-system-react-components.esm.js +2580 -1173
  39. package/dist/design-system-react-components.esm.js.map +1 -1
  40. package/dist/index.d.ts +8 -1
  41. package/dist/styles.css +1 -1
  42. package/dist/theme/components/accordion.d.ts +25 -0
  43. package/dist/theme/components/breadcrumb.d.ts +90 -0
  44. package/dist/theme/components/button.d.ts +17 -7
  45. package/dist/theme/components/checkbox.d.ts +7 -7
  46. package/dist/theme/components/customCheckboxGroup.d.ts +18 -0
  47. package/dist/theme/components/customRadioGroup.d.ts +4 -3
  48. package/dist/theme/components/global.d.ts +55 -0
  49. package/dist/theme/components/globalMixins.d.ts +15 -0
  50. package/dist/theme/components/heading.d.ts +50 -20
  51. package/dist/theme/components/hero.d.ts +492 -0
  52. package/dist/theme/components/icon.d.ts +13 -0
  53. package/dist/theme/components/label.d.ts +16 -0
  54. package/dist/theme/components/link.d.ts +45 -0
  55. package/dist/theme/components/radio.d.ts +8 -7
  56. package/dist/theme/components/searchBar.d.ts +20 -0
  57. package/dist/theme/components/select.d.ts +58 -0
  58. package/dist/theme/components/statusBadge.d.ts +25 -0
  59. package/dist/theme/components/tabs.d.ts +9 -9
  60. package/dist/theme/components/template.d.ts +105 -0
  61. package/dist/theme/components/text.d.ts +20 -0
  62. package/dist/theme/components/textInput.d.ts +105 -0
  63. package/dist/theme/foundations/global.d.ts +3 -0
  64. package/dist/theme/foundations/shadows.d.ts +4 -0
  65. package/dist/utils/utils.d.ts +6 -0
  66. package/package.json +3 -2
  67. package/src/components/Accordion/Accordion.stories.mdx +227 -33
  68. package/src/components/Accordion/Accordion.test.tsx +135 -19
  69. package/src/components/Accordion/Accordion.tsx +81 -56
  70. package/src/components/Autosuggest/Autosuggest.stories.mdx +1 -1
  71. package/src/components/Autosuggest/Autosuggest.stories.tsx +1 -1
  72. package/src/components/Autosuggest/_Autosuggest.scss +2 -2
  73. package/src/components/Breadcrumbs/Breadcrumbs.stories.mdx +46 -52
  74. package/src/components/Breadcrumbs/Breadcrumbs.test.tsx +31 -25
  75. package/src/components/Breadcrumbs/Breadcrumbs.tsx +71 -73
  76. package/src/components/Breadcrumbs/BreadcrumbsTypes.tsx +6 -0
  77. package/src/components/Breadcrumbs/__snapshots__/Breadcrumbs.test.tsx.snap +100 -0
  78. package/src/components/Button/Button.stories.mdx +31 -27
  79. package/src/components/Button/Button.test.tsx +17 -5
  80. package/src/components/Button/ButtonTypes.tsx +1 -0
  81. package/src/components/Button/_Button.scss +3 -27
  82. package/src/components/Button/__snapshots__/Button.test.tsx.snap +11 -0
  83. package/src/components/Card/Card.stories.mdx +24 -20
  84. package/src/components/Card/Card.test.tsx +13 -19
  85. package/src/components/Card/Card.tsx +1 -1
  86. package/src/components/Card/CardTypes.tsx +2 -2
  87. package/src/components/Card/_Card.scss +1 -1
  88. package/src/components/CardEdition/CardEdition.stories.tsx +11 -6
  89. package/src/components/CardEdition/CardEdition.test.tsx +23 -31
  90. package/src/components/CardEdition/_CardEdition.scss +2 -2
  91. package/src/components/Chakra/Center.stories.mdx +31 -14
  92. package/src/components/Chakra/Grid.stories.mdx +79 -0
  93. package/src/components/Chakra/Stack.stories.mdx +4 -4
  94. package/src/components/Checkbox/Checkbox.tsx +9 -12
  95. package/src/components/Checkbox/__snapshots__/Checkbox.test.tsx.snap +2 -5
  96. package/src/components/CheckboxGroup/CheckboxGroup.stories.mdx +249 -0
  97. package/src/components/CheckboxGroup/CheckboxGroup.test.tsx +345 -0
  98. package/src/components/CheckboxGroup/CheckboxGroup.tsx +148 -0
  99. package/src/components/CheckboxGroup/CheckboxGroupLayoutTypes.tsx +4 -0
  100. package/src/components/CheckboxGroup/__snapshots__/CheckboxGroup.test.tsx.snap +1360 -0
  101. package/src/components/DatePicker/DatePicker.test.tsx +4 -4
  102. package/src/components/DatePicker/DatePicker.tsx +13 -13
  103. package/src/components/DatePicker/_DatePicker.scss +1 -0
  104. package/src/components/Form/Form.stories.mdx +46 -21
  105. package/src/components/Form/Form.test.tsx +58 -45
  106. package/src/components/Form/Form.tsx +49 -21
  107. package/src/components/Form/FormTypes.tsx +3 -8
  108. package/src/components/Form/__snapshots__/Form.test.tsx.snap +24 -14
  109. package/src/components/Grid/GridTypes.tsx +9 -0
  110. package/src/components/Grid/SimpleGrid.stories.mdx +275 -0
  111. package/src/components/Grid/SimpleGrid.test.tsx +66 -0
  112. package/src/components/Grid/SimpleGrid.tsx +37 -0
  113. package/src/components/Grid/__snapshots__/SimpleGrid.test.tsx.snap +8 -0
  114. package/src/components/Heading/Heading.stories.mdx +1 -0
  115. package/src/components/Heading/Heading.tsx +12 -6
  116. package/src/components/HelperErrorText/_HelperErrorText.scss +1 -1
  117. package/src/components/Hero/Hero.stories.mdx +188 -121
  118. package/src/components/Hero/Hero.test.tsx +537 -107
  119. package/src/components/Hero/Hero.tsx +79 -92
  120. package/src/components/Hero/HeroTypes.tsx +17 -5
  121. package/src/components/Hero/__snapshots__/Hero.test.tsx.snap +307 -0
  122. package/src/components/HorizontalRule/_HorizontalRule.scss +1 -1
  123. package/src/components/Icons/Icon.stories.mdx +83 -74
  124. package/src/components/Icons/Icon.test.tsx +30 -22
  125. package/src/components/Icons/Icon.tsx +63 -61
  126. package/src/components/Icons/IconTypes.tsx +80 -64
  127. package/src/components/Input/_Input.scss +2 -2
  128. package/src/components/Label/Label.stories.mdx +28 -7
  129. package/src/components/Label/Label.test.tsx +43 -12
  130. package/src/components/Label/Label.tsx +21 -34
  131. package/src/components/Label/__snapshots__/Label.test.tsx.snap +41 -0
  132. package/src/components/Link/Link.stories.mdx +41 -41
  133. package/src/components/Link/Link.test.tsx +33 -44
  134. package/src/components/Link/Link.tsx +114 -100
  135. package/src/components/List/List.stories.mdx +0 -2
  136. package/src/components/List/List.stories.tsx +5 -5
  137. package/src/components/List/_List.scss +3 -3
  138. package/src/components/Modal/_Modal.scss +1 -1
  139. package/src/components/Notification/Notification.stories.mdx +12 -1
  140. package/src/components/Notification/Notification.test.tsx +3 -16
  141. package/src/components/Notification/Notification.tsx +9 -10
  142. package/src/components/Notification/_Notification.scss +4 -4
  143. package/src/components/Pagination/Pagination.test.tsx +16 -10
  144. package/src/components/RadioGroup/RadioGroup.stories.mdx +1 -1
  145. package/src/components/RadioGroup/RadioGroup.tsx +2 -10
  146. package/src/components/SearchBar/SearchBar.Test.tsx +151 -16
  147. package/src/components/SearchBar/SearchBar.stories.mdx +189 -219
  148. package/src/components/SearchBar/SearchBar.tsx +151 -46
  149. package/src/components/Select/Select.stories.mdx +188 -170
  150. package/src/components/Select/Select.test.tsx +125 -380
  151. package/src/components/Select/Select.tsx +118 -165
  152. package/src/components/Select/SelectTypes.tsx +4 -0
  153. package/src/components/SkeletonLoader/SkeletonLoader.stories.mdx +13 -25
  154. package/src/components/SkeletonLoader/SkeletonLoader.test.tsx +7 -7
  155. package/src/components/SkeletonLoader/SkeletonLoader.tsx +4 -2
  156. package/src/components/SkeletonLoader/SkeletonLoaderTypes.tsx +2 -2
  157. package/src/components/SkeletonLoader/_SkeletonLoader.scss +3 -3
  158. package/src/components/StatusBadge/StatusBadge.stories.mdx +91 -0
  159. package/src/components/StatusBadge/StatusBadge.test.tsx +35 -7
  160. package/src/components/StatusBadge/StatusBadge.tsx +24 -25
  161. package/src/components/StatusBadge/StatusBadgeTypes.tsx +5 -0
  162. package/src/components/StatusBadge/__snapshots__/StatusBadge.test.tsx.snap +28 -0
  163. package/src/components/StyleGuide/Bidirectionality.stories.mdx +16 -16
  164. package/src/components/StyleGuide/Buttons.stories.mdx +15 -15
  165. package/src/components/StyleGuide/Colors.stories.mdx +336 -0
  166. package/src/components/StyleGuide/Iconography.stories.mdx +88 -90
  167. package/src/components/StyleGuide/UIDocCard.tsx +1 -1
  168. package/src/components/Tabs/Tabs.tsx +7 -9
  169. package/src/components/Template/Template.stories.mdx +574 -0
  170. package/src/components/Template/Template.test.tsx +124 -0
  171. package/src/components/Template/Template.tsx +226 -0
  172. package/src/components/Text/Text.stories.mdx +70 -0
  173. package/src/components/Text/Text.test.tsx +63 -0
  174. package/src/components/Text/Text.tsx +55 -0
  175. package/src/components/Text/TextTypes.tsx +6 -0
  176. package/src/components/Text/__snapshots__/Text.test.tsx.snap +33 -0
  177. package/src/components/TextInput/TextInput.stories.mdx +89 -90
  178. package/src/components/TextInput/TextInput.test.tsx +65 -86
  179. package/src/components/TextInput/TextInput.tsx +101 -95
  180. package/src/components/TextInput/TextInputTypes.tsx +6 -0
  181. package/src/components/VideoPlayer/_VideoPlayer.scss +1 -1
  182. package/src/docs/Chakra.stories.mdx +4 -4
  183. package/src/docs/Intro.stories.mdx +15 -13
  184. package/src/index.ts +20 -0
  185. package/src/styles/01-colors/_colors-brand.scss +6 -0
  186. package/src/styles/01-colors/_colors-utility.scss +14 -12
  187. package/src/styles/base/_04-base.scss +2 -1
  188. package/src/styles/base/_place-holder.scss +1 -1
  189. package/src/styles.scss +10 -12
  190. package/src/theme/components/accordion.ts +30 -0
  191. package/src/theme/components/breadcrumb.ts +77 -0
  192. package/src/theme/components/button.ts +77 -63
  193. package/src/theme/components/checkbox.ts +15 -27
  194. package/src/theme/components/customCheckboxGroup.ts +12 -0
  195. package/src/theme/components/customRadioGroup.ts +4 -10
  196. package/src/theme/components/global.ts +71 -0
  197. package/src/theme/components/globalMixins.ts +16 -0
  198. package/src/theme/components/heading.ts +15 -8
  199. package/src/theme/components/hero.ts +239 -0
  200. package/src/theme/components/icon.ts +79 -0
  201. package/src/theme/components/label.ts +17 -0
  202. package/src/theme/components/link.ts +47 -0
  203. package/src/theme/components/radio.ts +20 -31
  204. package/src/theme/components/searchBar.ts +21 -0
  205. package/src/theme/components/select.ts +50 -0
  206. package/src/theme/components/statusBadge.ts +27 -0
  207. package/src/theme/components/tabs.ts +72 -69
  208. package/src/theme/components/template.ts +114 -0
  209. package/src/theme/components/text.ts +31 -0
  210. package/src/theme/components/textInput.ts +61 -0
  211. package/src/theme/foundations/colors.ts +29 -13
  212. package/src/theme/foundations/global.ts +3 -0
  213. package/src/theme/foundations/shadows.ts +5 -0
  214. package/src/theme/index.ts +37 -7
  215. package/src/utils/componentCategories.ts +8 -2
  216. package/src/utils/utils.ts +13 -0
  217. package/dist/components/Accordion/Accordion.stories.d.ts +0 -6
  218. package/dist/components/StatusBadge/StatusBadge.stories.d.ts +0 -8
  219. package/dist/components/StyleGuide/Colors.stories.d.ts +0 -25
  220. package/dist/components/Template/Template.stories.d.ts +0 -30
  221. package/src/components/Accordion/Accordion.stories.tsx +0 -66
  222. package/src/components/Accordion/_Accordion.scss +0 -81
  223. package/src/components/Breadcrumbs/_Breadcrumbs.scss +0 -97
  224. package/src/components/Form/_Form.scss +0 -67
  225. package/src/components/Hero/_Hero.scss +0 -256
  226. package/src/components/Icons/_Icons.scss +0 -116
  227. package/src/components/Label/_Label.scss +0 -22
  228. package/src/components/Link/_Link.scss +0 -73
  229. package/src/components/SearchBar/_SearchBar.scss +0 -16
  230. package/src/components/Select/_Select.scss +0 -82
  231. package/src/components/StatusBadge/StatusBadge.stories.tsx +0 -34
  232. package/src/components/StatusBadge/_StatusBadge.scss +0 -23
  233. package/src/components/StyleGuide/Colors.stories.tsx +0 -289
  234. package/src/components/Template/Template.stories.tsx +0 -86
  235. package/src/components/Template/_Template.scss +0 -63
  236. package/src/components/TextInput/_TextInput.scss +0 -59
package/CHANGELOG.md CHANGED
@@ -8,6 +8,36 @@ Currently, this repo is in Prerelease. When it is released, this project will ad
8
8
 
9
9
  ## Prerelease
10
10
 
11
+ ## 0.25.1 (October 14, 2021)
12
+
13
+ ### Adds
14
+
15
+ - Updates the `Accordion` component to internally use Chakra components.
16
+ - Adds DS `SimpleGrid` component composed from Chakra's `Simplegrid` component.
17
+ - Adds DS `Text` component composed from Chakra's `Text` component.
18
+ - Update the NYPL Colors with updated color names and values.
19
+ - Composes the DS `TextInput` component from Chakra's `Input` and `Textarea` components.
20
+ - Composes the DS `Select` component from Chakra's `Select` component.
21
+ - Composes the DS `Hero` component from Chakra's component.
22
+ - Composes the DS `CheckboxGroup` component from Chakra's `CheckboxGroup` component.
23
+ - Composes the DS "Template" components (`Template`, `TemplateHeader`, `TemplateBreakout`, `TemplateContent`, `TemplateContentPrimary`, `TemplateContentSidebar`, `TemplateFooter`) from Chakra's `Box` component for page layouts through children components.
24
+ - Composes the DS `TemplateAppContainer` component from Chakra's `Box` component for page layouts through props.
25
+ - Composes the DS `Link` component with Chakra component and fixes the `Button` type.
26
+ - Exports Chakra's `Grid` and `GridItem` components.
27
+ - Composes the DS `Label` component with Chakra component and updates the font size.
28
+ - Composes the DS `StatusBadge` component from Chakra's component.
29
+ - Composes the DS `Forms` component using DS and Chakra components.
30
+ - Composes the DS `Icon` component with Chakra's `Icon` component. Added new props for `Icon` sizing, alignment, name, and rotation.
31
+ - Composes the DS `SearchBar` component from DS `Select`, `TextInput`, `Button`, and `HelperErrorText` components.
32
+ - Composes the DS `Breadcrumbs` component from Chakra's `Breadcumb`, `BreadcrumbItem` and `BreadcrumbLink` components.
33
+
34
+ ### Changes
35
+
36
+ - Updates spacing values to use NYPL spacing rather than "em"s.
37
+ - Updates the `SkeletonLoaderLayouts` enum values from `Horizontal` and `Vertical` to `Row` and `Column`, respectively.
38
+ - Updates the `CardLayouts` enum values from `Horizontal` and `Vertical` to `Row` and `Column`, respectively.
39
+ - Updates font size of the `legend` element used in `CheckboxGroup`, `DatePicker` and `RadioGroup`.
40
+
11
41
  ## 0.25.0
12
42
 
13
43
  ### Breaking Changes
@@ -1,19 +1,19 @@
1
1
  import * as React from "react";
2
+ export interface AccordionContentDataProps {
3
+ label: string;
4
+ panel: string | React.ReactNode;
5
+ }
2
6
  export interface AccordionProps {
3
- /** Inner label on the button that opens the accordion */
4
- accordionLabel?: React.ReactNode;
5
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
6
- blockName?: string;
7
- /** className you can add in addition to 'input' */
8
- className?: string;
9
- /** Whether the accordion is open by default */
10
- defaultOpen?: boolean;
7
+ /** Array of data to display */
8
+ contentData: AccordionContentDataProps[];
11
9
  /** ID that other components can cross reference for accessibility purposes */
12
10
  id?: string;
13
- /** accordionLabel's input ID */
14
- inputId?: string;
15
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
16
- modifiers?: string[];
11
+ /** Whether the accordion is open by default only on its initial rendering */
12
+ isDefaultOpen?: boolean;
17
13
  }
18
- /** Accordion component that shows content on toggle */
19
- export default function Accordion(props: React.PropsWithChildren<AccordionProps>): JSX.Element;
14
+ /**
15
+ * Accordion component that shows content on toggle. Can be used to display
16
+ * multiple accordion items together.
17
+ */
18
+ declare function Accordion(props: React.PropsWithChildren<AccordionProps>): JSX.Element;
19
+ export default Accordion;
@@ -1,21 +1,18 @@
1
1
  import * as React from "react";
2
- declare type breadcrumb = {
2
+ import { ColorVariants } from "./BreadcrumbsTypes";
3
+ export interface BreadcrumbsDataProps {
3
4
  url: string;
4
- text: string;
5
- };
5
+ text: string | React.ReactNode;
6
+ }
6
7
  export interface BreadcrumbProps {
7
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
8
- blockName?: string;
9
8
  /** Breadcrumb links as an array */
10
- breadcrumbs: breadcrumb[] | JSX.Element[];
9
+ breadcrumbsData: BreadcrumbsDataProps[];
11
10
  /** className you can add in addition to 'input' */
12
11
  className?: string;
13
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
14
- modifiers?: string[];
15
- }
16
- export default class Breadcrumbs extends React.Component<BreadcrumbProps, any> {
17
- static defaultProps: {};
18
- constructor(props: BreadcrumbProps);
19
- render(): JSX.Element;
12
+ /** ID that other components can cross reference for accessibility purposes */
13
+ id?: string;
14
+ /** Used to control how the `Hero` component will be rendered. */
15
+ colorVariant?: ColorVariants;
20
16
  }
21
- export {};
17
+ declare function Breadcrumbs(props: React.PropsWithChildren<BreadcrumbProps>): JSX.Element;
18
+ export default Breadcrumbs;
@@ -0,0 +1,6 @@
1
+ export declare enum ColorVariants {
2
+ BooksAndMore = "booksAndMore",
3
+ Locations = "locations",
4
+ Research = "research",
5
+ WhatsOn = "whatsOn"
6
+ }
@@ -3,5 +3,6 @@ export declare enum ButtonTypes {
3
3
  Secondary = "secondary",
4
4
  Callout = "callout",
5
5
  Pill = "pill",
6
- Link = "link"
6
+ Link = "link",
7
+ SearchBar = "searchBar"
7
8
  }
@@ -55,7 +55,7 @@ export interface CardProps {
55
55
  imageSize?: CardImageSizes;
56
56
  /** The path to the image displayed with the card */
57
57
  imageSrc?: string;
58
- /** Optional value to control the position of the image placeholder; default value is `vertical` */
58
+ /** Optional value to control the position of the image placeholder; default value is `column` */
59
59
  layout?: CardLayouts;
60
60
  /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
61
61
  modifiers?: string[];
@@ -1,6 +1,6 @@
1
1
  export declare enum CardLayouts {
2
- Horizontal = "horizontal",
3
- Vertical = "vertical"
2
+ Row = "row",
3
+ Column = "column"
4
4
  }
5
5
  export declare enum CardImageRatios {
6
6
  FourByThree = "four-by-three",
@@ -0,0 +1,43 @@
1
+ import * as React from "react";
2
+ import { CheckboxGroupLayoutTypes } from "./CheckboxGroupLayoutTypes";
3
+ export interface CheckboxGroupProps {
4
+ /** Any child node passed to the component. */
5
+ children: React.ReactNode;
6
+ /** Populates the initial value of the input */
7
+ defaultValue?: string[];
8
+ /** Optional string to populate the HelperErrorText for error state */
9
+ invalidText?: string;
10
+ /** Optional string to populate the HelperErrorText for standard state */
11
+ helperText?: string;
12
+ /** ID that other components can cross reference for accessibility purposes */
13
+ id?: string;
14
+ /** Adds the 'disabled' prop to the input when true. */
15
+ isDisabled?: boolean;
16
+ /** A`dds the 'aria-invalid' attribute to the input and
17
+ * sets the error state when true. */
18
+ isInvalid?: boolean;
19
+ /** Adds the 'required' attribute to the input when true. */
20
+ isRequired?: boolean;
21
+ /** The checkbox group label displayed in a `legend` element if `showlabel` is
22
+ * true, or an "aria-label" if `showLabel` is false. */
23
+ labelText: string;
24
+ /** Renders the checkbox buttons in a row or column (default). */
25
+ layout?: CheckboxGroupLayoutTypes;
26
+ /** The `name` prop indicates the form group for all the `Checkbox` children. */
27
+ name: string;
28
+ /** The action to perform on the `<input>`'s onChange function */
29
+ onChange?: (value: string[]) => void;
30
+ /** Whether or not to display "Required"/"Optional" in the label text. */
31
+ optReqFlag?: boolean;
32
+ /** Offers the ability to show the group's legend onscreen or hide it. Refer
33
+ * to the `labelText` property for more information. */
34
+ showLabel?: boolean;
35
+ }
36
+ /**
37
+ * Wrapper component to wrap `Checkbox` components. Can be displayed in a
38
+ * column or in a row. The `CheckboxGroup` component renders all the necessary
39
+ * wrapping and associated text elements, but the checkbox input elements
40
+ * _need_ to be child `Checkbox` components from the NYPL Design System.
41
+ */
42
+ declare const CheckboxGroup: React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLInputElement>>;
43
+ export default CheckboxGroup;
@@ -0,0 +1,4 @@
1
+ export declare enum CheckboxGroupLayoutTypes {
2
+ Column = "column",
3
+ Row = "row"
4
+ }
@@ -47,14 +47,14 @@ export interface DatePickerProps extends DatePickerWrapperProps {
47
47
  maxDate?: string;
48
48
  /** Populates the `HelperErrorText` error state for both "From" and "To" input components. */
49
49
  invalidText?: string;
50
- /** Helper for modifiers array; adds 'errored' styling. */
51
- errored?: boolean;
50
+ /** Helper for modifiers array; adds 'isInvalid' styling. */
51
+ isInvalid?: boolean;
52
52
  /** Adds the 'required' property to the input element(s). */
53
53
  required?: boolean;
54
54
  /** Whether or not to display the "Required"/"Optional" text in the label text. */
55
55
  showOptReqLabel?: boolean;
56
56
  /** Adds the 'disabled' property to the input element(s). */
57
- disabled?: boolean;
57
+ isDisabled?: boolean;
58
58
  /** Modifiers array for use with BEM. See how to work with modifiers and BEM
59
59
  * here: http://getbem.com/introduction/ */
60
60
  modifiers?: string[];
@@ -1,23 +1,28 @@
1
1
  import * as React from "react";
2
2
  import { FormSpacing } from "./FormTypes";
3
+ export interface FormChildProps {
4
+ /** className to be applied to FormRow */
5
+ className?: string;
6
+ /** Spacing size (internal use) */
7
+ gap?: FormSpacing;
8
+ /** ID that other components can cross reference (internal use) */
9
+ id?: string;
10
+ }
3
11
  export interface FormProps {
4
12
  /** Optional form `action` attribute */
5
13
  action?: string;
6
- /** Optional additional attributes passed to the `<form>` element */
7
- attributes?: {
8
- [key: string]: any;
9
- };
10
14
  /** Optional className you can add in addition to `form` */
11
15
  className?: string;
12
16
  /** Optional ID that other components can cross reference */
13
17
  id?: string;
14
18
  /** Optional form `method` attribute */
15
19
  method?: "get" | "post";
16
- /** Optional modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
17
- modifiers?: string[];
18
20
  /** Optional spacing size; if omitted, the default `large` (2rem / 32px) spacing will be used; ```IMPORTANT: for general form layout, this prop should not be used``` */
19
21
  spacing?: FormSpacing;
20
22
  }
21
- export declare function FormRow(props: any): JSX.Element;
22
- export declare function FormField(props: any): JSX.Element;
23
+ /** FormRow child-component */
24
+ export declare function FormRow(props: React.PropsWithChildren<FormChildProps>): JSX.Element;
25
+ /** FormField child-component */
26
+ export declare function FormField(props: React.PropsWithChildren<FormChildProps>): JSX.Element;
27
+ /** main Form component */
23
28
  export default function Form(props: React.ComponentProps<"form"> & FormProps): JSX.Element;
@@ -1,8 +1,2 @@
1
- export declare enum FormSpacing {
2
- ExtraExtraSmall = "extra-extra-small",
3
- ExtraSmall = "extra-small",
4
- Small = "small",
5
- Medium = "medium",
6
- Large = "large",
7
- ExtraLarge = "extra-large"
8
- }
1
+ import { GridGaps as FormSpacing } from "../Grid/GridTypes";
2
+ export { FormSpacing };
@@ -0,0 +1,9 @@
1
+ export declare enum GridGaps {
2
+ ExtraExtraSmall = "xxs",
3
+ ExtraSmall = "xs",
4
+ Small = "s",
5
+ Medium = "m",
6
+ Large = "l",
7
+ ExtraLarge = "xl",
8
+ ExtraExtraLarge = "xxl"
9
+ }
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import { GridGaps } from "./GridTypes";
3
+ export interface SimpleGridProps {
4
+ /** Additional class name. */
5
+ className?: string;
6
+ /** Optional numeric value to override the default column count; the default column count is 3 */
7
+ columns?: number;
8
+ /** Optional gap size; if omitted, the default `large` (2rem / 32px) spacing will be used; ```IMPORTANT: for standard grid layouts, this prop should not be used``` */
9
+ gap?: GridGaps;
10
+ /** ID that other components can cross reference for accessibility purposes */
11
+ id?: string;
12
+ }
13
+ declare function SimpleGrid(props: React.PropsWithChildren<SimpleGridProps>): JSX.Element;
14
+ export default SimpleGrid;
@@ -1,8 +1,6 @@
1
1
  import * as React from "react";
2
2
  import { HeadingDisplaySizes, HeadingLevels } from "./HeadingTypes";
3
3
  export interface HeadingProps {
4
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
5
- blockName?: string;
6
4
  /** Optional className that appears in addition to `heading` */
7
5
  className?: string;
8
6
  /** Optional size used to override the default styles of the semantic HTML `<h>` elements */
@@ -11,8 +9,10 @@ export interface HeadingProps {
11
9
  id?: string;
12
10
  /** Optional number 1-6 used to create the `<h*>` tag; if prop is not passed, `Heading` will default to `<h2>` */
13
11
  level?: HeadingLevels;
14
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
15
- modifiers?: string[];
12
+ /** Optionally pass in additional Chakra-based styles. */
13
+ sx?: {
14
+ [key: string]: any;
15
+ };
16
16
  /** Inner text of the `<h*>` element */
17
17
  text?: string;
18
18
  /** Optional URL that header points to; when `url` prop is passed to `Heading`, a child `<a>` element is created and the heading text becomes an active link */
@@ -1,27 +1,32 @@
1
1
  import * as React from "react";
2
2
  import { HeroTypes } from "./HeroTypes";
3
3
  export interface HeroProps {
4
- /** Optional hex color value used to override the default background color for a given `Hero` variation; Note: not all `Hero` variations utilize this prop */
4
+ /** Optional hex color value used to override the default background
5
+ * color for a given `Hero` variation.
6
+ * Note: not all `Hero` variations utilize this prop. */
5
7
  backgroundColor?: string;
6
- /** Optional path to an image that will be used as a background image for the `Hero` component; Note: not all `Hero` variations utilize this prop */
8
+ /** Optional path to an image that will be used as a background image for the
9
+ * `Hero` component.
10
+ * Note: not all `Hero` variations utilize this prop. */
7
11
  backgroundImageSrc?: string;
8
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
9
- blockName?: string;
10
- /** Optional className that appears in addition to `hero` */
11
- className?: string;
12
- /** Optional hex color value used to override the default text color for a given `Hero` variation; Note: not all `Hero` variations utilize this prop */
12
+ /** Optional hex color value used to override the default text color for a
13
+ * given `Hero` variation.
14
+ * Note: not all `Hero` variations utilize this prop. */
13
15
  foregroundColor?: string;
14
- /** Required heading element. */
16
+ /** Optional heading element. */
15
17
  heading?: JSX.Element;
16
18
  /** Used to control how the `Hero` component will be rendered. */
17
19
  heroType?: HeroTypes;
18
- /** Optional `Image` component used for SECONDARY, FIFTYFIFTY and CAMPAIGN `Hero` types; Note: `image` can only be used in conjunction with `backgroundImageSrc` for CAMPAIGN Hero type; Note: not all `Hero` variations utilize this prop */
20
+ /** Optional `Image` component used for SECONDARY, FIFTYFIFTY and CAMPAIGN
21
+ * `Hero` types; Note: `image` can only be used in conjunction with
22
+ * `backgroundImageSrc` for CAMPAIGN the `Hero` type.
23
+ * Note: not all `Hero` variations utilize this prop. */
19
24
  image?: JSX.Element;
20
- /** Optional details area that contains location data; Note: not all `Hero` variations utilize this prop */
25
+ /** Optional details area that contains location data.
26
+ * Note: not all `Hero` variations utilize this prop. */
21
27
  locationDetails?: JSX.Element;
22
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
23
- modifiers?: string[];
24
- /** Optional string used for the subheader that displays underneath the heading element */
25
- subHeaderText?: JSX.Element;
28
+ /** Optional string used for the subheader that displays
29
+ * underneath the heading element. */
30
+ subHeaderText?: string | JSX.Element;
26
31
  }
27
32
  export default function Hero(props: React.PropsWithChildren<HeroProps>): JSX.Element;
@@ -1,7 +1,12 @@
1
1
  export declare enum HeroTypes {
2
- Campaign = "CAMPAIGN",
3
- FiftyFifty = "FIFTYFIFTY",
4
- Primary = "PRIMARY",
5
- Secondary = "SECONDARY",
6
- Tertiary = "TERTIARY"
2
+ Primary = "primary",
3
+ Secondary = "secondary",
4
+ SecondaryBooksAndMore = "secondaryBooksAndMore",
5
+ SecondaryLocations = "secondaryLocations",
6
+ SecondaryResearch = "secondaryResearch",
7
+ SecondaryWhatsOn = "secondaryWhatsOn",
8
+ Tertiary = "tertiary",
9
+ Campaign = "campaign",
10
+ FiftyFifty = "fiftyfifty"
7
11
  }
12
+ export declare const HeroSecondaryTypes: HeroTypes[];
@@ -1,28 +1,25 @@
1
1
  import * as React from "react";
2
- import { IconRotationTypes, IconNames, LogoNames, IconColors, IconSizes } from "./IconTypes";
2
+ import { IconAlign, IconColors, IconNames, IconRotationTypes, IconSizes, IconTypes, LogoNames } from "./IconTypes";
3
3
  export interface IconProps {
4
- /** Additional attributes to pass to the `<svg>` tag. */
5
- attributes?: {
6
- [key: string]: any;
7
- };
8
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
9
- blockName?: string;
10
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
11
- modifiers?: string[];
4
+ /** Aligns the icon. */
5
+ align?: IconAlign;
12
6
  /** className that appears in addition to "icon" */
13
7
  className?: string;
14
- /** Icons designated as decorative will be ignored by screenreaders */
8
+ /** Overrides default icon color (black). */
9
+ color?: IconColors;
10
+ /** Icons designated as decorative will be ignored by screenreaders. True
11
+ * by default. */
15
12
  decorative?: boolean;
16
- /** This text will be added as a child `<title>` element inside the `<svg>` tag. It is recommended to do this for increased accessibility. */
17
- titleText?: string;
18
13
  /** Rotates the icon clockwise in increments of 90deg */
19
14
  iconRotation?: IconRotationTypes;
20
- /** Overrides default icon color (black). */
21
- color?: IconColors;
22
- /** Sets the icon size. */
23
- size?: IconSizes;
15
+ /** ID that other components can cross reference for accessibility purposes */
16
+ id?: string;
24
17
  /** The name of the icon you want to use. */
25
18
  name?: IconNames | LogoNames;
19
+ /** Sets the icon size. */
20
+ size?: IconSizes;
21
+ /** Sets the icon variant type. */
22
+ type?: IconTypes;
26
23
  }
27
24
  /**
28
25
  * Renders SVG-based icons.
@@ -1,71 +1,85 @@
1
- export declare enum IconRotationTypes {
2
- rotate0 = "rotate-0",
3
- rotate90 = "rotate-90",
4
- rotate180 = "rotate-180",
5
- rotate270 = "rotate-270"
1
+ export declare enum IconAlign {
2
+ Left = "left",
3
+ Right = "right",
4
+ None = "none"
6
5
  }
7
- export declare enum IconNames {
8
- accessibility_full = "accessibility_full",
9
- accessibility_partial = "accessibility_partial",
10
- arrow = "arrow",
11
- check = "check",
12
- clock = "clock",
13
- close = "close",
14
- download = "download",
15
- error_filled = "error_filled",
16
- error_outline = "error_outline",
17
- headset = "headset",
18
- minus = "minus",
19
- plus = "plus",
20
- search = "search",
21
- speaker_notes = "speaker_notes",
22
- utility_account_filled = "utility_account_filled",
23
- utility_account_unfilled = "utility_account_unfilled",
24
- utility_hamburger = "utility_hamburger",
25
- utility_search = "utility_search"
6
+ export declare enum IconTypes {
7
+ Default = "default",
8
+ Breadcrumbs = "breadcrumbs"
26
9
  }
27
- export declare enum LogoNames {
28
- brooklyn = "brooklyn",
29
- logo_brooklyn = "logo_brooklyn",
30
- logo_nypl = "logo_nypl",
31
- logo_nypl_negative = "logo_nypl_negative",
32
- logo_queens = "logo_queens",
33
- lpa_negative = "lpa_negative",
34
- lpa_positive = "lpa_positive",
35
- nypl_circle_negative = "nypl_circle_negative",
36
- nypl_circle_positive = "nypl_circle_positive",
37
- nypl_full_lock_up_negative = "nypl_full_lock_up_negative",
38
- nypl_full_lock_up = "nypl_full_lock_up",
39
- nypl_no_lion_negative = "nypl_no_lion_negative",
40
- nypl_no_lion_positive = "nypl_no_lion_positive",
41
- queens_long = "queens_long",
42
- queens_stacked = "queens_stacked",
43
- schomburg_circle = "schomburg_circle",
44
- schomburg_positive = "schomburg_positive",
45
- simplye_black = "simplye_black",
46
- simplye_color = "simplye_color",
47
- snfl_negative = "snfl_negative",
48
- snfl_positive = "snfl_positive"
10
+ export declare enum IconRotationTypes {
11
+ Rotate0 = "rotate0",
12
+ Rotate90 = "rotate90",
13
+ Rotate180 = "rotate180",
14
+ Rotate270 = "rotate270"
49
15
  }
50
16
  export declare enum IconColors {
51
- ui_black = "ui-black",
52
- ui_white = "ui-white",
53
- brand_primary = "brand-primary",
54
- brand_secondary = "brand-secondary",
55
- section_whats_on_primary = "section-whats-on-primary",
56
- section_books_and_more_primary = "section-books-and-more-primary",
57
- section_research_primary = "section-research-primary",
58
- section_research_secondary = "section-research-secondary",
59
- section_locations_primary = "section-locations-primary",
60
- section_research_library_lpa = "section-research-library-lpa",
61
- section_research_library_schomburg = "section-research-library-schomburg",
62
- section_research_library_schwartzman = "section-research-library-schwartzman"
17
+ UiBlack = "ui.black",
18
+ UiWhite = "ui.white",
19
+ BrandPrimary = "brand.primary",
20
+ BrandSecondary = "brand.secondary",
21
+ SectionWhatsOnPrimary = "section.whats-on.primary",
22
+ SectionWhatsOnSecondary = "section.whats-on.secondary",
23
+ SectionBooksAndMorePrimary = "section.books-and-more.primary",
24
+ SectionBooksAndMoreSecondary = "section.books-and-more.secondary",
25
+ SectionResearchPrimary = "section.research.primary",
26
+ SectionResearchSecondary = "section.research.secondary",
27
+ SectionLocationsPrimary = "section.locations.primary",
28
+ SectionLocationsSecondary = "section.locations.secondary",
29
+ SectionBlogsPrimary = "section.blogs.primary",
30
+ SectionBlogsSecondary = "section.blogs.secondary",
31
+ SectionResearchLibraryLpa = "section.research-library.lpa",
32
+ SectionResearchLibrarySchomburg = "section.research-library.schomburg",
33
+ SectionResearchLibrarySchwartzman = "section.research-library.schwartzman"
63
34
  }
64
35
  export declare enum IconSizes {
65
- small = "small",
66
- medium = "medium",
67
- large = "large",
68
- xlarge = "xlarge",
69
- xxlarge = "xxlarge",
70
- xxxlarge = "xxxlarge"
36
+ Small = "small",
37
+ Medium = "medium",
38
+ Large = "large",
39
+ ExtraLarge = "xlarge",
40
+ ExtraExtraLarge = "xxlarge",
41
+ ExtraExtraExtraLarge = "xxxlarge"
42
+ }
43
+ export declare enum IconNames {
44
+ AccessibilityFull = "accessibility_full",
45
+ AccessibilityPartial = "accessibility_partial",
46
+ Arrow = "arrow",
47
+ Check = "check",
48
+ Clock = "clock",
49
+ Close = "close",
50
+ Download = "download",
51
+ ErrorFilled = "error_filled",
52
+ ErrorOutline = "error_outline",
53
+ Headset = "headset",
54
+ Minus = "minus",
55
+ Plus = "plus",
56
+ Search = "search",
57
+ SpeakerNotes = "speaker_notes",
58
+ UtilityAccountFilled = "utility_account_filled",
59
+ UtilityAccountUnfilled = "utility_account_unfilled",
60
+ UtilityHamburger = "utility_hamburger",
61
+ UtilitySearch = "utility_search"
62
+ }
63
+ export declare enum LogoNames {
64
+ Brooklyn = "brooklyn",
65
+ LogoBrooklyn = "logo_brooklyn",
66
+ LogoNypl = "logo_nypl",
67
+ LogoNyplNegative = "logo_nypl_negative",
68
+ LogoQueens = "logo_queens",
69
+ LpaNegative = "lpa_negative",
70
+ LpaPositive = "lpa_positive",
71
+ NyplCircleNegative = "nypl_circle_negative",
72
+ NyplCirclePositive = "nypl_circle_positive",
73
+ NyplFullLockUpNegative = "nypl_full_lock_up_negative",
74
+ NyplFullLockUp = "nypl_full_lock_up",
75
+ NyplNoLionNegative = "nypl_no_lion_negative",
76
+ NyplNoLionPositive = "nypl_no_lion_positive",
77
+ QueensLong = "queens_long",
78
+ QueensStacked = "queens_stacked",
79
+ SchomburgCircle = "schomburg_circle",
80
+ SchomburgPositive = "schomburg_positive",
81
+ SimplyeBlack = "simplye_black",
82
+ SimplyeColor = "simplye_color",
83
+ SnflNegative = "snfl_negative",
84
+ SnflPositive = "snfl_positive"
71
85
  }
@@ -1,29 +1,17 @@
1
1
  import * as React from "react";
2
2
  declare type optReqFlagType = "Required" | "Optional" | "" | undefined;
3
3
  interface LabelProps {
4
- /** Additional attributes to pass to the <label> tag */
5
- attributes?: {
6
- [key: string]: any;
7
- };
8
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
9
- blockName?: string;
10
- /** className that appears in addition to "label" */
4
+ /** Additional CSS class name to render in the `label` element. */
11
5
  className?: string;
12
- /** The id of the html element that this `Label` is describing */
13
- htmlFor?: string;
6
+ /** The id of the html element that this `Label` is describing. */
7
+ htmlFor: string;
14
8
  /** ID that other components can cross reference for accessibility purposes */
15
9
  id?: string;
16
- /** Modifiers for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
17
- modifiers?: string[];
18
10
  /** Displays "Required" or "Optional" string alongside the label */
19
11
  optReqFlag?: optReqFlagType;
20
12
  }
21
13
  /**
22
14
  * A label for form inputs. It should never be used alone.
23
15
  */
24
- export default function Label(props: React.PropsWithChildren<LabelProps>): React.DetailedReactHTMLElement<{
25
- className: string;
26
- htmlFor: string;
27
- id: string;
28
- }, HTMLElement>;
29
- export {};
16
+ declare function Label(props: React.PropsWithChildren<LabelProps>): JSX.Element;
17
+ export default Label;
@@ -5,24 +5,20 @@ export interface LinkProps {
5
5
  attributes?: {
6
6
  [key: string]: any;
7
7
  };
8
- /** BlockName for use with BEM. See how to work with blockNames and BEM here: http://getbem.com/introduction/ */
9
- blockName?: string;
10
- /** className that appears in addition to "link" */
8
+ /** Any child node passed to the component. */
9
+ children: React.ReactNode;
10
+ /** Additional class name to render in the `Link` component. */
11
11
  className?: string;
12
- /** Href attribute */
12
+ /** The `href` attribute for the anchor element. */
13
13
  href?: string;
14
- /** ID */
14
+ /** ID used for accessibility purposes. */
15
15
  id?: string;
16
- /** Controls the link visualsaction, button, or default. */
16
+ /** Controls the link visuals: action, button, backwards, forwards, or default. */
17
17
  type?: LinkTypes;
18
- /** Modifiers array for use with BEM. See how to work with modifiers and BEM here: http://getbem.com/introduction/ */
19
- modifiers?: string[];
20
- /** Any child node passed to the component. */
21
- children: React.ReactNode;
22
18
  }
23
19
  /**
24
- * A component that uses an `href` prop or a child anchor element, to create an
25
- * anchor element with added styling and conventions.
20
+ * A component that uses an `href` prop or a child anchor element, to create
21
+ * an anchor element with added styling and conventions.
26
22
  */
27
23
  declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>;
28
24
  export default Link;