@nypl/design-system-react-components 3.6.2 → 4.0.0-alpha-rc

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 (158) hide show
  1. package/dist/design-system-react-components.cjs +61 -64
  2. package/dist/design-system-react-components.js +22341 -24139
  3. package/dist/filteringStyleGuide/activeFiltersList.png +0 -0
  4. package/dist/filteringStyleGuide/exampleColumn.png +0 -0
  5. package/dist/filteringStyleGuide/examplePopup.png +0 -0
  6. package/dist/filteringStyleGuide/exampleRow.png +0 -0
  7. package/dist/filteringStyleGuide/filterBar.png +0 -0
  8. package/dist/filteringStyleGuide/focusClearingFilters.gif +0 -0
  9. package/dist/filteringStyleGuide/focusKeywordSearch.gif +0 -0
  10. package/dist/filteringStyleGuide/focusLiveFiltering.gif +0 -0
  11. package/dist/filteringStyleGuide/focusPagination.gif +0 -0
  12. package/dist/filteringStyleGuide/focusSorting.gif +0 -0
  13. package/dist/filteringStyleGuide/fullPageExample.png +0 -0
  14. package/dist/filteringStyleGuide/keywordSearchField.png +0 -0
  15. package/dist/filteringStyleGuide/paginationMenu.png +0 -0
  16. package/dist/filteringStyleGuide/resultsList.png +0 -0
  17. package/dist/filteringStyleGuide/sortingMenu.png +0 -0
  18. package/dist/filteringStyleGuide/totalResultsHeading.png +0 -0
  19. package/dist/responsiveGrid/breakpointRangeDesktop.png +0 -0
  20. package/dist/responsiveGrid/breakpointRangeMobileLarge.png +0 -0
  21. package/dist/responsiveGrid/breakpointRangeMobileSmall.png +0 -0
  22. package/dist/responsiveGrid/breakpointRangeTabletLarge.png +0 -0
  23. package/dist/responsiveGrid/breakpointRangeTabletSmall.png +0 -0
  24. package/dist/responsiveGrid/cardGridDesktop4Cols.png +0 -0
  25. package/dist/responsiveGrid/cardGridLargeMobile1Col.png +0 -0
  26. package/dist/responsiveGrid/cardGridLargeMobile2Cols.png +0 -0
  27. package/dist/responsiveGrid/cardGridSmallMobile1Col.png +0 -0
  28. package/dist/responsiveGrid/cardGridSmallTablet1Col.png +0 -0
  29. package/dist/responsiveGrid/cardGridSmallTablet3Cols.png +0 -0
  30. package/dist/responsiveGrid/cardGridSmallTablet3ColsSidebar.png +0 -0
  31. package/dist/responsiveGrid/gridColumns.png +0 -0
  32. package/dist/responsiveGrid/gridGutters.png +0 -0
  33. package/dist/responsiveGrid/gridMargins.png +0 -0
  34. package/dist/responsiveGrid/gridPerceivedColumns1.png +0 -0
  35. package/dist/responsiveGrid/gridPerceivedColumns2.png +0 -0
  36. package/dist/responsiveGrid/gridPerceivedColumns3.png +0 -0
  37. package/dist/responsiveGrid/gridPerceivedColumns4.png +0 -0
  38. package/dist/src/components/Accordion/Accordion.d.ts +2 -5
  39. package/dist/src/components/AlphabetFilter/AlphabetFilter.d.ts +2 -4
  40. package/dist/src/components/AudioPlayer/AudioPlayer.d.ts +2 -4
  41. package/dist/src/components/Banner/Banner.d.ts +6 -12
  42. package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +3 -5
  43. package/dist/src/components/Button/Button.d.ts +6 -12
  44. package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +2 -4
  45. package/dist/src/components/Card/Card.d.ts +2 -4
  46. package/dist/src/components/Checkbox/Checkbox.d.ts +3 -10
  47. package/dist/src/components/CheckboxGroup/CheckboxGroup.d.ts +2 -4
  48. package/dist/src/components/ComponentWrapper/ComponentWrapper.d.ts +2 -5
  49. package/dist/src/components/DatePicker/DatePicker.d.ts +2 -4
  50. package/dist/src/components/FeaturedContent/FeaturedContent.d.ts +3 -5
  51. package/dist/src/components/FeedbackBox/FeedbackBox.d.ts +2 -4
  52. package/dist/src/components/Fieldset/Fieldset.d.ts +2 -4
  53. package/dist/src/components/FilterBarInline/FilterBarInline.d.ts +2 -4
  54. package/dist/src/components/FilterBarPopup/FilterBarPopup.d.ts +2 -4
  55. package/dist/src/components/Form/Form.d.ts +4 -12
  56. package/dist/src/components/Grid/SimpleGrid.d.ts +2 -4
  57. package/dist/src/components/Heading/Heading.d.ts +4 -6
  58. package/dist/src/components/HelperErrorText/HelperErrorText.d.ts +2 -16
  59. package/dist/src/components/Hero/Hero.d.ts +7 -11
  60. package/dist/src/components/HorizontalRule/HorizontalRule.d.ts +2 -4
  61. package/dist/src/components/Icons/Icon.d.ts +2 -5
  62. package/dist/src/components/Icons/iconVariables.d.ts +1 -1
  63. package/dist/src/components/Image/Image.d.ts +2 -10
  64. package/dist/src/components/Label/Label.d.ts +3 -7
  65. package/dist/src/components/Link/Link.d.ts +8 -16
  66. package/dist/src/components/List/List.d.ts +7 -5
  67. package/dist/src/components/Logo/Logo.d.ts +2 -4
  68. package/dist/src/components/Menu/Menu.d.ts +2 -4
  69. package/dist/src/components/Modal/Modal.d.ts +4 -3
  70. package/dist/src/components/MultiSelect/MultiSelect.d.ts +2 -2
  71. package/dist/src/components/MultiSelectGroup/MultiSelectGroup.d.ts +2 -4
  72. package/dist/src/components/NewsletterSignup/NewsletterSignup.d.ts +5 -8
  73. package/dist/src/components/Notification/Notification.d.ts +2 -8
  74. package/dist/src/components/Pagination/Pagination.d.ts +2 -4
  75. package/dist/src/components/ProgressIndicator/ProgressIndicator.d.ts +2 -4
  76. package/dist/src/components/Radio/Radio.d.ts +3 -9
  77. package/dist/src/components/RadioGroup/RadioGroup.d.ts +2 -4
  78. package/dist/src/components/SearchBar/SearchBar.d.ts +3 -11
  79. package/dist/src/components/Select/Select.d.ts +2 -12
  80. package/dist/src/components/SkeletonLoader/SkeletonLoader.d.ts +2 -4
  81. package/dist/src/components/SkipNavigation/SkipNavigation.d.ts +2 -4
  82. package/dist/src/components/Slider/Slider.d.ts +3 -5
  83. package/dist/src/components/SocialMediaLinks/SocialMediaLinks.d.ts +4 -6
  84. package/dist/src/components/StatusBadge/StatusBadge.d.ts +4 -11
  85. package/dist/src/components/StructuredContent/StructuredContent.d.ts +2 -4
  86. package/dist/src/components/StyledList/StyledList.d.ts +3 -7
  87. package/dist/src/components/SubNav/SubNav.d.ts +4 -8
  88. package/dist/src/components/Table/Table.d.ts +3 -5
  89. package/dist/src/components/Tabs/Tabs.d.ts +2 -2
  90. package/dist/src/components/TagSet/TagSet.d.ts +2 -4
  91. package/dist/src/components/Template/Template.d.ts +38 -117
  92. package/dist/src/components/Text/Text.d.ts +2 -6
  93. package/dist/src/components/TextInput/TextInput.d.ts +8 -31
  94. package/dist/src/components/Toggle/Toggle.d.ts +3 -8
  95. package/dist/src/components/Tooltip/Tooltip.d.ts +2 -6
  96. package/dist/src/components/VideoPlayer/VideoPlayer.d.ts +2 -4
  97. package/dist/src/hooks/useMultiSelect.d.ts +5 -1
  98. package/dist/src/hooks/useNYPLBreakpoints.d.ts +6 -1
  99. package/dist/src/hooks/useResponsiveSpacing.d.ts +23 -0
  100. package/dist/src/index.d.ts +6 -7
  101. package/dist/src/theme/components/breadcrumb.d.ts +1 -1
  102. package/dist/src/theme/components/button.d.ts +1 -4
  103. package/dist/src/theme/components/heading.d.ts +1 -125
  104. package/dist/src/theme/components/hero.d.ts +11 -11
  105. package/dist/src/theme/components/link.d.ts +1 -40
  106. package/dist/src/theme/components/newsletterSignup.d.ts +3 -3
  107. package/dist/src/theme/components/notification.d.ts +1 -4
  108. package/dist/src/theme/components/progressIndicator.d.ts +1 -2
  109. package/dist/src/theme/components/slider.d.ts +8 -4
  110. package/dist/src/theme/components/statusBadge.d.ts +1 -14
  111. package/dist/src/theme/components/structuredContent.d.ts +2 -5
  112. package/dist/src/theme/components/{customTable.d.ts → table.d.ts} +6 -6
  113. package/dist/src/theme/components/template.d.ts +49 -125
  114. package/dist/src/theme/components/text.d.ts +1 -9
  115. package/dist/src/theme/foundations/breakpoints.d.ts +21 -8
  116. package/dist/src/theme/sharedTypes.d.ts +4 -0
  117. package/dist/src/utils/utils.d.ts +8 -1
  118. package/dist/styles.css +1 -1
  119. package/dist/template/templateBottom.png +0 -0
  120. package/dist/template/templateBreakout.png +0 -0
  121. package/dist/template/templateFluidColumns1.png +0 -0
  122. package/dist/template/templateFluidColumns2.png +0 -0
  123. package/dist/template/templateFluidColumns3.png +0 -0
  124. package/dist/template/templateFluidColumns4.png +0 -0
  125. package/dist/template/templateFullPageLayout.png +0 -0
  126. package/dist/template/templateMain.png +0 -0
  127. package/dist/template/templateMainNarrow.png +0 -0
  128. package/dist/template/templateMainWide.png +0 -0
  129. package/dist/template/templateSidebarLeft.png +0 -0
  130. package/dist/template/templateSidebarNone.png +0 -0
  131. package/dist/template/templateSidebarRight.png +0 -0
  132. package/dist/template/templateTop.png +0 -0
  133. package/package.json +1 -1
  134. package/dist/src/components/Header/Header.d.ts +0 -13
  135. package/dist/src/components/Header/components/HeaderLogin.d.ts +0 -12
  136. package/dist/src/components/Header/components/HeaderLoginButton.d.ts +0 -10
  137. package/dist/src/components/Header/components/HeaderLowerNav.d.ts +0 -6
  138. package/dist/src/components/Header/components/HeaderMobileIconNav.d.ts +0 -6
  139. package/dist/src/components/Header/components/HeaderMobileNav.d.ts +0 -6
  140. package/dist/src/components/Header/components/HeaderMobileNavButton.d.ts +0 -6
  141. package/dist/src/components/Header/components/HeaderSearchButton.d.ts +0 -9
  142. package/dist/src/components/Header/components/HeaderSearchForm.d.ts +0 -10
  143. package/dist/src/components/Header/components/HeaderSitewideAlerts.d.ts +0 -7
  144. package/dist/src/components/Header/components/HeaderUpperNav.d.ts +0 -7
  145. package/dist/src/components/Header/context/headerContext.d.ts +0 -13
  146. package/dist/src/components/Header/utils/encoreCatalogLogOutTimer.d.ts +0 -4
  147. package/dist/src/components/Header/utils/headerUtils.d.ts +0 -70
  148. package/dist/src/theme/components/header.d.ts +0 -100
  149. package/dist/src/theme/components/headerLogin.d.ts +0 -333
  150. package/dist/src/theme/components/headerLoginButton.d.ts +0 -72
  151. package/dist/src/theme/components/headerLowerNav.d.ts +0 -78
  152. package/dist/src/theme/components/headerMobileIconNav.d.ts +0 -28
  153. package/dist/src/theme/components/headerMobileNav.d.ts +0 -92
  154. package/dist/src/theme/components/headerMobileNavButton.d.ts +0 -36
  155. package/dist/src/theme/components/headerSearchButton.d.ts +0 -85
  156. package/dist/src/theme/components/headerSearchForm.d.ts +0 -185
  157. package/dist/src/theme/components/headerSitewideAlerts.d.ts +0 -43
  158. package/dist/src/theme/components/headerUpperNav.d.ts +0 -60
@@ -1,10 +1,10 @@
1
- import { Tab, TabList, TabPanels, TabPanel, ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, Tab, TabList, TabPanels, TabPanel, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  export interface TabsDataProps {
4
4
  label: string;
5
5
  content: string | React.ReactNode;
6
6
  }
7
- export interface TabsProps {
7
+ export interface TabsProps extends Omit<BoxProps, "onChange"> {
8
8
  /** The index of the tab to display on the initial render. */
9
9
  defaultIndex?: number;
10
10
  /** ID that other components can cross reference for accessibility purposes */
@@ -1,10 +1,8 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { TagSetExploreProps } from "./TagSetExplore";
4
4
  import { TagSetFilterProps } from "./TagSetFilter";
5
- export interface BaseTagSetProps {
6
- /** Additional class for the component. */
7
- className?: string;
5
+ export interface BaseTagSetProps extends BoxProps {
8
6
  /** ID that other components can cross reference for accessibility purposes. */
9
7
  id?: string;
10
8
  }
@@ -1,52 +1,18 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
2
- import React from "react";
3
- export interface TemplateProps {
1
+ /// <reference types="react" />
2
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
3
+ export declare const sidebarPlacementArray: readonly ["none", "left", "right"];
4
+ export type SidebarPlacement = typeof sidebarPlacementArray[number];
5
+ export interface TemplateProps extends BoxProps {
4
6
  /** ID that other components can cross reference for accessibility purposes. */
5
7
  id?: string;
8
+ /** Renders the `TemplateSidebar` component either on the left or
9
+ * right side of the `TemplateMain` component. */
10
+ sidebar?: SidebarPlacement;
6
11
  }
7
- export interface TemplateHeaderProps {
8
- /** Flag to render an HTML header element. True by default. */
9
- renderHeaderElement?: boolean;
10
- }
11
- export interface TemplateFooterProps {
12
- /** Flag to render an HTML footer element. True by default. */
13
- renderFooterElement?: boolean;
14
- }
15
- export interface TemplateSidebarProps {
16
- /** Renders the `TemplateContentSidebar` component either on the left or
17
- * right side of the `TemplateContentPrimary` component. */
18
- sidebar?: "none" | "left" | "right";
19
- }
20
- export interface TemplateContentProps extends TemplateSidebarProps {
21
- /** ID used for the `main` HTML element. Defaults to "mainContent". Useful
22
- * anchor for the application skip navigation. */
23
- id?: string;
24
- }
25
- export interface TemplateAppContainerProps extends TemplateFooterProps, TemplateHeaderProps, TemplateSidebarProps {
26
- /** DOM that will be rendered before the rest of the components in
27
- * `TemplateAppContainer` and immediately before the `TemplateHeader` component. */
28
- aboveHeader?: React.ReactElement;
29
- /** DOM that will be rendered in the `TemplateBreakout` component section. */
30
- breakout?: React.ReactElement;
31
- /** DOM that will be rendered in the `TemplateContentBottom` component section. */
32
- contentBottom?: React.ReactElement;
12
+ export interface TemplateMainProps extends BoxProps {
33
13
  /** ID used for the `main` HTML element. Defaults to "mainContent". Useful
34
14
  * anchor for the application skip navigation. */
35
- contentId?: string;
36
- /** DOM that will be rendered in the `TemplateContentPrimary` component section. */
37
- contentPrimary?: React.ReactElement;
38
- /** DOM that will be rendered in the `TemplateContentSidebar` component section. */
39
- contentSidebar?: React.ReactElement;
40
- /** DOM that will be rendered in the `TemplateContentTop` component section. */
41
- contentTop?: React.ReactElement;
42
- /** DOM that will be rendered in the `TemplateFooter` component section. */
43
- footer?: React.ReactElement;
44
- /** DOM that will be rendered in the `TemplateHeader` component section. */
45
- header?: React.ReactElement;
46
- /** ID that other components can cross reference for accessibility purposes. */
47
15
  id?: string;
48
- /** Render the `SkipNavigation` component or not. False by default. */
49
- renderSkipNavigation?: boolean;
50
16
  }
51
17
  /**
52
18
  * The main top-level parent component that wraps all template-related
@@ -54,88 +20,43 @@ export interface TemplateAppContainerProps extends TemplateFooterProps, Template
54
20
  */
55
21
  declare const Template: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<TemplateProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<TemplateProps>>;
56
22
  /**
57
- * This optional component renders its children from edge-to-edge and should
58
- * be used for alerts or notifications that are typically site-wide. This must
59
- * be rendered immediately before the `TemplateHeader` component. This is meant
60
- * for components that render an `aside` HTML element or HTML element with the
61
- * `role="complementary"` attribute. These elements should *not* be rendered
62
- * in the `header` HTML section since that's an accessibility violation.
63
- */
64
- declare const TemplateAboveHeader: React.FC<any>;
65
- /**
66
- * This optional component should be the first child of the `Template`
67
- * component. This is rendered as an HTML `<header>` element. If an HTML
68
- * `<header>` element is already passed in a custom component as the children,
69
- * set `renderFooterElement` to `false`. Otherwise, the parent wrapper will
70
- * render an HTML `<header>` element.
71
- */
72
- declare const TemplateHeader: React.FC<any>;
73
- /**
74
- * This component should be used inside the `Template` component to contain both
75
- * the `TemplateAboveHeader` and `TemplateHeader` components. This is meant to
76
- * render its children from edge to edge and is most useful for the headers,
77
- * `Breadcrumbs`, and `Hero` components or other banner-like components.
78
- */
79
- declare const TemplateBreakout: React.FC<any>;
80
- /**
81
- * This component is most useful to render content on the page. This renders an
82
- * HTML `<main>` element with an id of "mainContent". The "mainContent" id should
83
- * be used as the consuming application's skip navigation link. The `TemplateContent`
84
- * component also takes a `sidebar` prop with optional "left" or "right" values.
85
- * This will set the correct *styling* needed for the `TemplateContentPrimary`
86
- * and `TemplateContentSidebar` components. Note that `TemplateContentPrimary`
87
- * and `TemplateContentSidebar` must be ordered correctly as children elements
88
- * for the appropriate styles to take effect.
89
- */
90
- declare const TemplateContent: React.FC<any>;
91
- /**
92
- * This optional component must be used inside the `TemplateContent` component.
93
- * This renders content in the main width of the container and will always render
94
- * above the primary component and the sidebar component (if any).
23
+ * This optional component renders its children above the main content
24
+ * and spans edge-to-edge. It is most useful for `Breadcrumbs`, `Hero`,
25
+ * or other banner-like components.
95
26
  */
96
- declare const TemplateContentTop: React.FC<any>;
27
+ declare const TemplateBreakout: React.FC<React.PropsWithChildren<BoxProps>>;
97
28
  /**
98
- * This optional component must be used inside the `TemplateContent` component
99
- * and after the `TemplateContentPrimary` or `TemplateContentSidebar` component.
100
- * This renders content in the main width of the container and should always
101
- * render below the primary component and the sidebar component (if any).
29
+ * This optional component renders content at a max width of 1280px and
30
+ * will render below `TemplateBreakout` (if being used) and above the
31
+ * main content and sidebar (if one exists).
102
32
  */
103
- declare const TemplateContentBottom: React.FC<any>;
33
+ declare const TemplateTop: React.FC<React.PropsWithChildren<BoxProps>>;
104
34
  /**
105
- * This component is used to render content in a column when there must be a
106
- * sidebar component on either its left or right side. It must go inside the
107
- * `TemplateContent` component. An optional `sidebar` prop value of "left" or
108
- * "right" can be passed to render the correct CSS styles. If the `sidebar`
109
- * prop is used in the `TemplateContent` component, there is no need to pass
110
- * the `sidebar` prop to this component -- `TemplateContent` will handle it.
35
+ * This component renders an HTML `<main>` element with an id of "mainContent".
36
+ * The "mainContent" id should be used as the consuming application's skip
37
+ * navigation link. The component should not be used in conjunction with
38
+ * `TemplateMainNarrow`.
111
39
  */
112
- declare const TemplateContentPrimary: React.FC<any>;
40
+ declare const TemplateMain: React.FC<React.PropsWithChildren<TemplateMainProps>>;
113
41
  /**
114
- * This component is used to render content in a sidebar column. It must go
115
- * inside the `TemplateContent` component and must be paired with the
116
- * `TemplateContentPrimary` component. If this is a left sidebar, it needs to be
117
- * rendered before the `TemplateContentPrimary` component. If this is a right
118
- * sidebar, it needs to be rendered after the `TemplateContentPrimary` component.
119
- * An optional `sidebar` prop value of "left" or "right" can be passed to render
120
- * the correct CSS styles. If the `sidebar` prop is used in the `TemplateContent`
121
- * component, there is no need to pass the `sidebar` prop to this component --
122
- * `TemplateContent` will handle it.
42
+ * This component renders an HTML `<main>` element with an id of "mainContent".
43
+ * The "mainContent" id should be used as the consuming application's skip
44
+ * navigation link. It provides a narrower container for better readability if
45
+ * the main content includes long text. This component is meant to be used in
46
+ * lieu of `TemplateMain`, and should not be used in conjunction with
47
+ * `TemplateSidebar`.
123
48
  */
124
- declare const TemplateContentSidebar: React.FC<any>;
49
+ declare const TemplateMainNarrow: React.FC<React.PropsWithChildren<TemplateMainProps>>;
125
50
  /**
126
- * This optional component should be the last child of the `Template`
127
- * component. This is rendered as an HTML `<footer>` element and spans the full
128
- * width of the page. If an HTML `<footer>` element is already passed in a
129
- * custom component, set `renderFooterElement` to `false`.
51
+ * This optional component is used to render content in a sidebar column.
52
+ * It must be paired with the `TemplateMain` component. An optional `sidebar`
53
+ * prop value of "left" or "right" must be passed to the `Template` wrapper
54
+ * to render the correct CSS styles.
130
55
  */
131
- declare const TemplateFooter: React.FC<any>;
56
+ declare const TemplateSidebar: React.FC<React.PropsWithChildren<BoxProps>>;
132
57
  /**
133
- * This single component can be used instead of all the individual template
134
- * components. Instead of importing and rendering the needed "template"
135
- * components, each section is passed as a prop to the section where it should
136
- * be rendered. For example, if you want to render content in the
137
- * `TemplateContentPrimary` section, then pass it as a prop to `contentPrimary`.
58
+ * This optional component renders content at a max width of 1280px and
59
+ * will always render below the main content and sidebar (if one exists).
138
60
  */
139
- export declare const TemplateAppContainer: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<TemplateAppContainerProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<TemplateAppContainerProps>>;
140
- export { Template, TemplateAboveHeader, TemplateBreakout, TemplateContent, TemplateContentBottom, TemplateContentPrimary, TemplateContentSidebar, TemplateContentTop, TemplateFooter, TemplateHeader, };
141
- export default TemplateAppContainer;
61
+ declare const TemplateBottom: React.FC<React.PropsWithChildren<BoxProps>>;
62
+ export { Template, TemplateBreakout, TemplateTop, TemplateMain, TemplateMainNarrow, TemplateSidebar, TemplateBottom, };
@@ -1,10 +1,8 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  export declare const textSizesArray: readonly ["default", "body1", "body2", "caption", "tag", "mini", "overline1", "overline2", "subtitle1", "subtitle2"];
4
4
  export type TextSizes = typeof textSizesArray[number];
5
- export interface TextProps {
6
- /** Additional class name to render in the `Text` component. */
7
- className?: string;
5
+ export interface TextProps extends BoxProps {
8
6
  /** ID that other components can cross reference for accessibility purposes. */
9
7
  id?: string;
10
8
  /** Optional prop used to show bolded text */
@@ -19,8 +17,6 @@ export interface TextProps {
19
17
  isLowercase?: boolean;
20
18
  /** Optional prop used to remove default spacing */
21
19
  noSpace?: boolean;
22
- /** Optional prop used to explicitly set the ARIA role */
23
- role?: string;
24
20
  /** Optional prop to control the text styling */
25
21
  size?: TextSizes;
26
22
  }
@@ -1,4 +1,4 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent, ChakraProps } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
4
  import type { AutoCompleteValues } from "../../utils/constantValues";
@@ -14,7 +14,13 @@ export declare const TextInputFormats: {
14
14
  url: string;
15
15
  };
16
16
  export type TextInputVariants = "default" | "searchBar" | "searchBarSelect";
17
- export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
17
+ type InputElementProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "color" | "height" | "width">;
18
+ type TextAreaElementProps = Omit<React.TextareaHTMLAttributes<HTMLTextAreaElement>, "color" | "height" | "width">;
19
+ interface BaseTextInputProps extends Pick<BoxProps, keyof ChakraProps> {
20
+ type?: TextInputTypes;
21
+ }
22
+ export type TextInputPropsWithHTML = BaseTextInputProps & (BaseTextInputProps["type"] extends "textarea" ? TextAreaElementProps : InputElementProps);
23
+ export interface InputProps extends TextInputPropsWithHTML {
18
24
  /** FOR INTERNAL DS USE ONLY: Adds an aria-label or appends to an existing aria-label for screen readers.*/
19
25
  additionalAriaLabel?: string;
20
26
  /** FOR INTERNAL DS USE ONLY: additional helper text id(s) to be used for the input's `aria-describedby` value.
@@ -22,10 +28,6 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
22
28
  additionalHelperTextIds?: string;
23
29
  /** String value used to set the autocomplete attribute. */
24
30
  autoComplete?: AutoCompleteValues;
25
- /** A class name for the TextInput parent div. */
26
- className?: string;
27
- /** The starting value of the input field. */
28
- defaultValue?: string;
29
31
  /** Populates the HelperErrorText for the standard state */
30
32
  helperText?: HelperErrorTextType;
31
33
  /** ID that other components can cross reference for accessibility purposes */
@@ -45,25 +47,6 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
45
47
  /** Provides text for a `Label` component if `showLabel` is set to true;
46
48
  * populates an `aria-label` attribute if `showLabel` is set to false. */
47
49
  labelText: string | JSX.Element;
48
- /** The max number for a `number` TextInput type. */
49
- max?: number;
50
- /** The max length of the input field. This prop is for all input types
51
- * except for the `number` type. */
52
- maxLength?: number;
53
- /** The min number for a `number` TextInput type. */
54
- min?: number;
55
- /** Used to reference the input element in forms. */
56
- name?: string;
57
- /** The action to perform on the `input`/`textarea`'s onChange function */
58
- onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
59
- /** The action to perform on the `input`/`textarea`'s onClick function */
60
- onClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
61
- /** The action to perform on the `input`/`textarea`'s onFocus function */
62
- onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
63
- /** Regex to query the user input against. */
64
- pattern?: string;
65
- /** Populates the placeholder for the input/textarea elements */
66
- placeholder?: string;
67
50
  /** Allows the '(required)' text to be changed for language purposes
68
51
  * Note: Parenthesis will be added automatically by the component */
69
52
  requiredLabelText?: string;
@@ -75,14 +58,8 @@ export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement>
75
58
  /** Whether or not to display the "(required)" text in the label text.
76
59
  * True by default. */
77
60
  showRequiredLabel?: boolean;
78
- /** The amount to increase or decrease when using the number type. */
79
- step?: number;
80
61
  /** FOR INTERNAL DS USE ONLY: the input variant to display. */
81
62
  textInputType?: TextInputVariants;
82
- /** HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input */
83
- type?: TextInputTypes;
84
- /** Populates the value of the input/textarea elements */
85
- value?: string;
86
63
  }
87
64
  /**
88
65
  * The type used for `ref`s. We want to extend both `input` and `textarea`
@@ -1,9 +1,9 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
2
- import React from "react";
1
+ import { BoxProps, ChakraComponent, ChakraProps } from "@chakra-ui/react";
2
+ import React, { InputHTMLAttributes } from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
4
  export declare const toggleSizesArray: readonly ["default", "small"];
5
5
  export type ToggleSizes = typeof toggleSizesArray[number];
6
- export interface ToggleProps {
6
+ export interface ToggleProps extends Pick<BoxProps, keyof ChakraProps>, Omit<InputHTMLAttributes<HTMLInputElement>, "color" | "height" | "size" | "width"> {
7
7
  /** Used for uncontrolled scenarios. Sets the state of the Toggle when the page first loads.
8
8
  * If true, the toggle will be initially set to the "on" position. */
9
9
  defaultChecked?: boolean;
@@ -28,11 +28,6 @@ export interface ToggleProps {
28
28
  isRequired?: boolean;
29
29
  /** The toggle's label. This will serve as the text content for the `<label>` element */
30
30
  labelText: string;
31
- /** The name prop indicates the `Toggle`'s form element name. If none is
32
- * specified, 'default' will be used. */
33
- name?: string;
34
- /** The action to perform on the `<input>`'s onChange function */
35
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
36
31
  /** The size of the Toggle. Defaults to "large". */
37
32
  size?: ToggleSizes;
38
33
  }
@@ -1,12 +1,8 @@
1
1
  import React from "react";
2
- import { ChakraComponent } from "@chakra-ui/react";
3
- export interface TooltipProps {
4
- /** Any child node passed to the component. */
5
- children: React.ReactNode;
2
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
3
+ export interface TooltipProps extends Omit<BoxProps, "content"> {
6
4
  /** Value used to populate the tooltip content. */
7
5
  content: string | number | React.ReactNode;
8
- /** A class name for the Tooltip parent div. */
9
- className?: string;
10
6
  /** ID that other components can cross reference for accessibility purposes. */
11
7
  id?: string;
12
8
  /** Adds the `disabled` prop to the Tooltip when true. */
@@ -1,16 +1,14 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
4
  export declare const VideoPlayerAspectRatiosArray: readonly ["fourByThree", "sixteenByNine", "square"];
5
5
  export declare const VideoPlayerTypesArray: readonly ["vimeo", "youtube"];
6
6
  export type VideoPlayerAspectRatios = typeof VideoPlayerAspectRatiosArray[number];
7
7
  export type VideoPlayerTypes = typeof VideoPlayerTypesArray[number];
8
- export interface VideoPlayerProps {
8
+ export interface VideoPlayerProps extends BoxProps {
9
9
  /** Optional aspect ratio prop to control the sizing of the video player; if
10
10
  * omitted, the video player defaults to `sixteen-by-nine` */
11
11
  aspectRatio?: VideoPlayerAspectRatios;
12
- /** Optional className you can add in addition to `video-player` */
13
- className?: string;
14
12
  /** Optional string to set the text for a video description */
15
13
  descriptionText?: string;
16
14
  /** Optional string to set a code snippet provided by YouTube or Vimeo; the
@@ -12,7 +12,11 @@ export default function useMultiSelect(initialState?: SelectedItems): {
12
12
  selectedItems: {} | SelectedItems;
13
13
  setSelectedItems: (newState: SelectedItems) => void;
14
14
  onChange: (itemId: string, multiSelectId: string) => void;
15
- onMixedStateChange: (parentId: string, multiSelectId: string, items: MultiSelectItem[]) => void;
15
+ onMixedStateChange: ({ parentId, multiSelectId, items, }: {
16
+ parentId: string;
17
+ multiSelectId: string;
18
+ items: MultiSelectItem[];
19
+ }) => void;
16
20
  onClear: (multiSelectId: string) => void;
17
21
  onClearAll: () => void;
18
22
  };
@@ -6,8 +6,13 @@
6
6
  declare const useNYPLBreakpoints: () => {
7
7
  isLargerThanSmall: any;
8
8
  isLargerThanMedium: any;
9
- isLargerThanMobile: any;
10
9
  isLargerThanLarge: any;
11
10
  isLargerThanXLarge: any;
11
+ isLargerThanSmallMobile: any;
12
+ isLargerThanLargeMobile: any;
13
+ isLargerThanSmallTablet: any;
14
+ isLargerThanLargeTablet: any;
15
+ isLargerThanMobile: any;
16
+ isLargerThanTablet: any;
12
17
  };
13
18
  export default useNYPLBreakpoints;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * A custom hook This hook returns responsive gap and padding values that align
3
+ * with NYPL design standards for responsive grids and columns. The values will
4
+ * adjust based on the width of the viewport.
5
+ */
6
+ declare function useResponsiveSpacing(): {
7
+ responsiveGap: {
8
+ base: string;
9
+ md: string;
10
+ xl: string;
11
+ };
12
+ responsiveMargin: {
13
+ base: string;
14
+ md: string;
15
+ xl: string;
16
+ };
17
+ responsivePadding: {
18
+ base: string;
19
+ md: string;
20
+ xl: string;
21
+ };
22
+ };
23
+ export default useResponsiveSpacing;
@@ -35,7 +35,6 @@ export { default as FilterBarPopup, useFilterBarPopup, } from "./components/Filt
35
35
  export type { FilterBarPopupProps } from "./components/FilterBarPopup/FilterBarPopup";
36
36
  export { default as Form, FormField, FormRow } from "./components/Form/Form";
37
37
  export type { FormProps } from "./components/Form/Form";
38
- export { default as Header } from "./components/Header/Header";
39
38
  export { default as Heading } from "./components/Heading/Heading";
40
39
  export type { HeadingLevels, HeadingProps, HeadingSizes, } from "./components/Heading/Heading";
41
40
  export { default as HelperErrorText } from "./components/HelperErrorText/HelperErrorText";
@@ -45,7 +44,7 @@ export type { HeroProps, HeroTypes } from "./components/Hero/Hero";
45
44
  export { default as HorizontalRule } from "./components/HorizontalRule/HorizontalRule";
46
45
  export type { HorizontalRuleProps } from "./components/HorizontalRule/HorizontalRule";
47
46
  export { default as Icon } from "./components/Icons/Icon";
48
- export type { IconAlign, IconColors, IconNames, IconRotations, IconRotationTypes, IconSizes, IconTypes, IconProps, } from "./components/Icons/Icon";
47
+ export type { IconAlign, IconColors, IconNames, IconRotations, IconSizes, IconTypes, IconProps, } from "./components/Icons/Icon";
49
48
  export { default as Image } from "./components/Image/Image";
50
49
  export type { ComponentImageProps, ImageProps, ImageRatios, ImageSizes, ImageTypes, } from "./components/Image/Image";
51
50
  export { default as Label } from "./components/Label/Label";
@@ -93,7 +92,7 @@ export type { SliderProps } from "./components/Slider/Slider";
93
92
  export { default as SocialMediaLinks } from "./components/SocialMediaLinks/SocialMediaLinks";
94
93
  export type { SocialMediaLinkDataProps } from "./components/SocialMediaLinks/SocialMediaLinks";
95
94
  export { default as StatusBadge } from "./components/StatusBadge/StatusBadge";
96
- export type { StatusBadgeLevels, StatusBadgeProps, StatusBadgeTypes, } from "./components/StatusBadge/StatusBadge";
95
+ export type { StatusBadgeProps, StatusBadgeTypes, } from "./components/StatusBadge/StatusBadge";
97
96
  export { default as StructuredContent } from "./components/StructuredContent/StructuredContent";
98
97
  export type { StructuredContentImagePosition, StructuredContentProps, } from "./components/StructuredContent/StructuredContent";
99
98
  export { default as StyledList } from "./components/StyledList/StyledList";
@@ -107,8 +106,7 @@ export { default as TagSet } from "./components/TagSet/TagSet";
107
106
  export type { TagSetProps, TagSetTypeProps } from "./components/TagSet/TagSet";
108
107
  export type { TagSetExploreDataProps, TagSetExploreProps, } from "./components/TagSet/TagSetExplore";
109
108
  export type { TagSetFilterDataProps, TagSetFilterProps, } from "./components/TagSet/TagSetFilter";
110
- export { TemplateAppContainer, Template, TemplateAboveHeader, TemplateHeader, TemplateBreakout, TemplateContent, TemplateContentTop, TemplateContentPrimary, TemplateContentSidebar, TemplateFooter, } from "./components/Template/Template";
111
- export type { TemplateAppContainerProps, TemplateProps, TemplateContentProps, TemplateFooterProps, TemplateHeaderProps, TemplateSidebarProps, } from "./components/Template/Template";
109
+ export { Template, TemplateBreakout, TemplateTop, TemplateMain, TemplateMainNarrow, TemplateSidebar, TemplateBottom, } from "./components/Template/Template";
112
110
  export { default as Text } from "./components/Text/Text";
113
111
  export type { TextProps, TextSizes } from "./components/Text/Text";
114
112
  export { default as TextInput } from "./components/TextInput/TextInput";
@@ -121,10 +119,11 @@ export { default as VideoPlayer } from "./components/VideoPlayer/VideoPlayer";
121
119
  export type { VideoPlayerAspectRatios, VideoPlayerProps, VideoPlayerTypes, } from "./components/VideoPlayer/VideoPlayer";
122
120
  export { default as useCarouselStyles } from "./hooks/useCarouselStyles";
123
121
  export { default as useCloseDropDown } from "./hooks/useCloseDropDown";
122
+ export { default as useFormatNumber } from "./hooks/useFormatNumber";
124
123
  export { default as useMultiSelect } from "./hooks/useMultiSelect";
125
124
  export { default as useNYPLBreakpoints } from "./hooks/useNYPLBreakpoints";
126
125
  export { default as useNYPLTheme } from "./hooks/useNYPLTheme";
127
- export { default as useWindowSize } from "./hooks/useWindowSize";
126
+ export { default as useResponsiveSpacing } from "./hooks/useResponsiveSpacing";
128
127
  export { default as useScrollFadeStyles } from "./hooks/useScrollFadeStyles";
129
- export { default as useFormatNumber } from "./hooks/useFormatNumber";
128
+ export { default as useWindowSize } from "./hooks/useWindowSize";
130
129
  export type { AutoCompleteValues } from "./utils/constantValues";
@@ -257,7 +257,7 @@ declare const Breadcrumb: {
257
257
  };
258
258
  defaultProps?: {
259
259
  size?: string | number;
260
- variant?: "blogs" | "booksAndMore" | "brand" | "connect" | "digitalCollections" | "education" | "locations" | "research" | "whatsOn";
260
+ variant?: "blogs" | "research" | "whatsOn" | "connect" | "booksAndMore" | "brand" | "digitalCollections" | "education" | "locations";
261
261
  colorScheme?: string;
262
262
  };
263
263
  };
@@ -181,9 +181,6 @@ declare const Button: {
181
181
  text: ({ buttonSize }: any) => {
182
182
  base: any;
183
183
  };
184
- link: ({ buttonSize }: any) => {
185
- base: any;
186
- };
187
184
  pill: ({ buttonSize }: any) => {
188
185
  base: any;
189
186
  };
@@ -199,7 +196,7 @@ declare const Button: {
199
196
  };
200
197
  defaultProps?: {
201
198
  size?: string | number;
202
- variant?: "link" | "text" | "primary" | "secondary" | "callout" | "pill" | "iconOnly" | "noBrand";
199
+ variant?: "text" | "primary" | "secondary" | "pill" | "iconOnly" | "callout" | "noBrand";
203
200
  colorScheme?: string;
204
201
  };
205
202
  parts: ("base" | "screenreaderOnly")[];
@@ -353,79 +353,6 @@ declare const Heading: {
353
353
  width: string;
354
354
  };
355
355
  };
356
- one: {
357
- base: {
358
- width: string;
359
- a: {
360
- textUnderlineOffset: string;
361
- };
362
- marginTop: string;
363
- marginStart: string;
364
- marginEnd: string;
365
- fontSize: string;
366
- fontWeight: string;
367
- letterSpacing: string;
368
- lineHeight: string;
369
- };
370
- };
371
- two: {
372
- base: {
373
- width: string;
374
- a: {
375
- textUnderlineOffset: string;
376
- };
377
- marginTop: string;
378
- marginStart: string;
379
- marginEnd: string;
380
- fontSize: string;
381
- fontWeight: string;
382
- lineHeight: string;
383
- };
384
- };
385
- three: {
386
- base: {
387
- width: string;
388
- marginTop: string;
389
- marginStart: string;
390
- marginEnd: string;
391
- fontSize: string;
392
- fontWeight: string;
393
- lineHeight: string;
394
- };
395
- };
396
- four: {
397
- base: {
398
- width: string;
399
- marginTop: string;
400
- marginStart: string;
401
- marginEnd: string;
402
- fontSize: string;
403
- fontWeight: string;
404
- lineHeight: string;
405
- };
406
- };
407
- five: {
408
- base: {
409
- width: string;
410
- marginTop: string;
411
- marginStart: string;
412
- marginEnd: string;
413
- fontSize: string;
414
- fontWeight: string;
415
- lineHeight: string;
416
- };
417
- };
418
- six: {
419
- base: {
420
- width: string;
421
- marginTop: string;
422
- marginStart: string;
423
- marginEnd: string;
424
- fontSize: string;
425
- fontWeight: string;
426
- lineHeight: string;
427
- };
428
- };
429
356
  display1: {
430
357
  base: {
431
358
  fontSize: {
@@ -573,61 +500,10 @@ declare const Heading: {
573
500
  width: string;
574
501
  };
575
502
  };
576
- primary: {
577
- base: {
578
- width: string;
579
- a: {
580
- textUnderlineOffset: string;
581
- };
582
- marginTop: string;
583
- marginStart: string;
584
- marginEnd: string;
585
- fontSize: string;
586
- fontWeight: string;
587
- letterSpacing: string;
588
- lineHeight: string;
589
- };
590
- };
591
- secondary: {
592
- base: {
593
- width: string;
594
- a: {
595
- textUnderlineOffset: string;
596
- };
597
- marginTop: string;
598
- marginStart: string;
599
- marginEnd: string;
600
- fontSize: string;
601
- fontWeight: string;
602
- lineHeight: string;
603
- };
604
- };
605
- tertiary: {
606
- base: {
607
- width: string;
608
- marginTop: string;
609
- marginStart: string;
610
- marginEnd: string;
611
- fontSize: string;
612
- fontWeight: string;
613
- lineHeight: string;
614
- };
615
- };
616
- callout: {
617
- base: {
618
- width: string;
619
- marginTop: string;
620
- marginStart: string;
621
- marginEnd: string;
622
- fontSize: string;
623
- fontWeight: string;
624
- lineHeight: string;
625
- };
626
- };
627
503
  };
628
504
  defaultProps?: {
629
505
  size?: string | number;
630
- variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "display1" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "heading7" | "heading8" | "primary" | "secondary" | "tertiary" | "callout" | "one" | "two" | "three" | "four" | "five" | "six";
506
+ variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "display1" | "heading1" | "heading2" | "heading3" | "heading4" | "heading5" | "heading6" | "heading7" | "heading8";
631
507
  colorScheme?: string;
632
508
  };
633
509
  parts: ("base" | "headingWrapper")[];