@nypl/design-system-react-components 3.6.1 → 4.0.0-remove-matchMedia-test
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.
- package/dist/design-system-react-components.cjs +56 -59
- package/dist/design-system-react-components.js +18925 -20667
- package/dist/filteringStyleGuide/activeFiltersList.png +0 -0
- package/dist/filteringStyleGuide/exampleColumn.png +0 -0
- package/dist/filteringStyleGuide/examplePopup.png +0 -0
- package/dist/filteringStyleGuide/exampleRow.png +0 -0
- package/dist/filteringStyleGuide/filterBar.png +0 -0
- package/dist/filteringStyleGuide/focusClearingFilters.gif +0 -0
- package/dist/filteringStyleGuide/focusKeywordSearch.gif +0 -0
- package/dist/filteringStyleGuide/focusLiveFiltering.gif +0 -0
- package/dist/filteringStyleGuide/focusPagination.gif +0 -0
- package/dist/filteringStyleGuide/focusSorting.gif +0 -0
- package/dist/filteringStyleGuide/fullPageExample.png +0 -0
- package/dist/filteringStyleGuide/keywordSearchField.png +0 -0
- package/dist/filteringStyleGuide/paginationMenu.png +0 -0
- package/dist/filteringStyleGuide/resultsList.png +0 -0
- package/dist/filteringStyleGuide/sortingMenu.png +0 -0
- package/dist/filteringStyleGuide/totalResultsHeading.png +0 -0
- package/dist/responsiveGrid/breakpointRangeDesktop.png +0 -0
- package/dist/responsiveGrid/breakpointRangeMobileLarge.png +0 -0
- package/dist/responsiveGrid/breakpointRangeMobileSmall.png +0 -0
- package/dist/responsiveGrid/breakpointRangeTabletLarge.png +0 -0
- package/dist/responsiveGrid/breakpointRangeTabletSmall.png +0 -0
- package/dist/responsiveGrid/cardGridDesktop4Cols.png +0 -0
- package/dist/responsiveGrid/cardGridLargeMobile1Col.png +0 -0
- package/dist/responsiveGrid/cardGridLargeMobile2Cols.png +0 -0
- package/dist/responsiveGrid/cardGridSmallMobile1Col.png +0 -0
- package/dist/responsiveGrid/cardGridSmallTablet1Col.png +0 -0
- package/dist/responsiveGrid/cardGridSmallTablet3Cols.png +0 -0
- package/dist/responsiveGrid/cardGridSmallTablet3ColsSidebar.png +0 -0
- package/dist/responsiveGrid/gridColumns.png +0 -0
- package/dist/responsiveGrid/gridGutters.png +0 -0
- package/dist/responsiveGrid/gridMargins.png +0 -0
- package/dist/responsiveGrid/gridPerceivedColumns1.png +0 -0
- package/dist/responsiveGrid/gridPerceivedColumns2.png +0 -0
- package/dist/responsiveGrid/gridPerceivedColumns3.png +0 -0
- package/dist/responsiveGrid/gridPerceivedColumns4.png +0 -0
- package/dist/src/components/Accordion/Accordion.d.ts +3 -5
- package/dist/src/components/Banner/Banner.d.ts +0 -2
- package/dist/src/components/Button/Button.d.ts +1 -1
- package/dist/src/components/Heading/Heading.d.ts +2 -2
- package/dist/src/components/HelperErrorText/HelperErrorText.d.ts +2 -13
- package/dist/src/components/Hero/Hero.d.ts +5 -9
- package/dist/src/components/Icons/Icon.d.ts +0 -1
- package/dist/src/components/Link/Link.d.ts +3 -3
- package/dist/src/components/Notification/Notification.d.ts +0 -4
- package/dist/src/components/ProgressIndicator/ProgressIndicator.d.ts +0 -2
- package/dist/src/components/StatusBadge/StatusBadge.d.ts +1 -6
- package/dist/src/components/StyledList/StyledList.d.ts +1 -1
- package/dist/src/components/Template/Template.d.ts +36 -115
- package/dist/src/hooks/useNYPLBreakpoints.d.ts +6 -1
- package/dist/src/hooks/useResponsiveSpacing.d.ts +23 -0
- package/dist/src/index.d.ts +6 -7
- package/dist/src/theme/components/button.d.ts +1 -4
- package/dist/src/theme/components/heading.d.ts +1 -125
- package/dist/src/theme/components/hero.d.ts +11 -11
- package/dist/src/theme/components/link.d.ts +1 -40
- package/dist/src/theme/components/newsletterSignup.d.ts +1 -1
- package/dist/src/theme/components/notification.d.ts +1 -4
- package/dist/src/theme/components/progressIndicator.d.ts +1 -2
- package/dist/src/theme/components/slider.d.ts +3 -3
- package/dist/src/theme/components/statusBadge.d.ts +1 -14
- package/dist/src/theme/components/template.d.ts +49 -125
- package/dist/src/theme/components/text.d.ts +1 -9
- package/dist/src/theme/foundations/breakpoints.d.ts +21 -8
- package/dist/src/utils/utils.d.ts +3 -0
- package/dist/styles.css +1 -1
- package/dist/template/templateBottom.png +0 -0
- package/dist/template/templateBreakout.png +0 -0
- package/dist/template/templateFluidColumns1.png +0 -0
- package/dist/template/templateFluidColumns2.png +0 -0
- package/dist/template/templateFluidColumns3.png +0 -0
- package/dist/template/templateFluidColumns4.png +0 -0
- package/dist/template/templateFullPageLayout.png +0 -0
- package/dist/template/templateMain.png +0 -0
- package/dist/template/templateMainNarrow.png +0 -0
- package/dist/template/templateMainWide.png +0 -0
- package/dist/template/templateSidebarLeft.png +0 -0
- package/dist/template/templateSidebarNone.png +0 -0
- package/dist/template/templateSidebarRight.png +0 -0
- package/dist/template/templateTop.png +0 -0
- package/package.json +1 -1
- package/dist/src/components/Header/Header.d.ts +0 -13
- package/dist/src/components/Header/components/HeaderLogin.d.ts +0 -12
- package/dist/src/components/Header/components/HeaderLoginButton.d.ts +0 -10
- package/dist/src/components/Header/components/HeaderLowerNav.d.ts +0 -6
- package/dist/src/components/Header/components/HeaderMobileIconNav.d.ts +0 -6
- package/dist/src/components/Header/components/HeaderMobileNav.d.ts +0 -6
- package/dist/src/components/Header/components/HeaderMobileNavButton.d.ts +0 -6
- package/dist/src/components/Header/components/HeaderSearchButton.d.ts +0 -9
- package/dist/src/components/Header/components/HeaderSearchForm.d.ts +0 -10
- package/dist/src/components/Header/components/HeaderSitewideAlerts.d.ts +0 -7
- package/dist/src/components/Header/components/HeaderUpperNav.d.ts +0 -7
- package/dist/src/components/Header/context/headerContext.d.ts +0 -13
- package/dist/src/components/Header/utils/encoreCatalogLogOutTimer.d.ts +0 -4
- package/dist/src/components/Header/utils/headerUtils.d.ts +0 -70
- package/dist/src/theme/components/header.d.ts +0 -100
- package/dist/src/theme/components/headerLogin.d.ts +0 -333
- package/dist/src/theme/components/headerLoginButton.d.ts +0 -72
- package/dist/src/theme/components/headerLowerNav.d.ts +0 -78
- package/dist/src/theme/components/headerMobileIconNav.d.ts +0 -28
- package/dist/src/theme/components/headerMobileNav.d.ts +0 -92
- package/dist/src/theme/components/headerMobileNavButton.d.ts +0 -36
- package/dist/src/theme/components/headerSearchButton.d.ts +0 -85
- package/dist/src/theme/components/headerSearchForm.d.ts +0 -185
- package/dist/src/theme/components/headerSitewideAlerts.d.ts +0 -43
- package/dist/src/theme/components/headerUpperNav.d.ts +0 -60
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
|
-
import React from "react";
|
|
2
|
+
import React, { ButtonHTMLAttributes } from "react";
|
|
3
3
|
export type AccordionTypes = "default" | "warning" | "error";
|
|
4
4
|
export interface AccordionDataProps {
|
|
5
5
|
accordionType?: AccordionTypes;
|
|
@@ -9,12 +9,10 @@ export interface AccordionDataProps {
|
|
|
9
9
|
label: string | JSX.Element;
|
|
10
10
|
panel: string | React.ReactNode;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
type HTMLButtonAttributes = Pick<ButtonHTMLAttributes<HTMLButtonElement>, "aria-label">;
|
|
13
|
+
export interface AccordionProps extends HTMLButtonAttributes {
|
|
13
14
|
/** Array of data to display, and an optional accordionType */
|
|
14
15
|
accordionData: AccordionDataProps[];
|
|
15
|
-
/** Global aria-label value that is applied to all accordions if individual
|
|
16
|
-
* ariaLabel props are not included with accordionData entries. */
|
|
17
|
-
ariaLabel?: string;
|
|
18
16
|
/** ID that other components can cross reference for accessibility purposes */
|
|
19
17
|
id?: string;
|
|
20
18
|
/** Whether the accordion is open by default only on its initial rendering */
|
|
@@ -7,8 +7,6 @@ export type BannerBgColors = typeof bannerBgColorsArray[number];
|
|
|
7
7
|
export declare const bannerHighlightColorsArray: readonly ["brand.primary", "section.blogs.primary", "section.books-and-more.primary", "section.connect.primary", "section.education.primary", "section.locations.primary", "section.research.primary", "section.research-library-lpa.primary", "section.research-library-schomburg.primary", "section.research-library-schwarzman.primary", "section.whats-on.primary", "dark.brand.primary", "dark.section.blogs.primary", "dark.section.books-and-more.primary", "dark.section.connect.primary", "dark.section.education.primary", "dark.section.locations.primary", "dark.section.research.secondary", "dark.section.research-library-lpa.primary", "dark.section.research-library-schomburg.primary", "dark.section.research-library-schwarzman.primary", "dark.section.whats-on.primary"];
|
|
8
8
|
export type BannerHighlightColors = typeof bannerHighlightColorsArray[number];
|
|
9
9
|
export interface BannerProps {
|
|
10
|
-
/** Label used to describe the `Banner`'s aside HTML element. */
|
|
11
|
-
ariaLabel?: string;
|
|
12
10
|
/** Used to set the color of the background for the full component.
|
|
13
11
|
* Refer to how color values are defined and typed in the DS Icon component. */
|
|
14
12
|
backgroundColor?: BannerBgColors;
|
|
@@ -2,7 +2,7 @@ import { ChakraComponent } from "@chakra-ui/react";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare const buttonElementTypeArray: readonly ["submit", "button", "reset"];
|
|
4
4
|
export declare const buttonSizesArray: readonly ["small", "medium", "large"];
|
|
5
|
-
export declare const buttonTypesArray: readonly ["primary", "secondary", "text", "callout", "pill", "noBrand"
|
|
5
|
+
export declare const buttonTypesArray: readonly ["primary", "secondary", "text", "callout", "pill", "noBrand"];
|
|
6
6
|
export type ButtonElementType = typeof buttonElementTypeArray[number];
|
|
7
7
|
export type ButtonSizes = typeof buttonSizesArray[number];
|
|
8
8
|
export type ButtonTypes = typeof buttonTypesArray[number];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ChakraComponent, HeadingProps as ChakraHeadingProps } from "@chakra-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
export declare const headingSizesArray: readonly ["display1", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "heading7", "heading8"
|
|
4
|
-
export declare const headingLevelsArray: readonly ["h1", "h2", "h3", "h4", "h5", "h6"
|
|
3
|
+
export declare const headingSizesArray: readonly ["display1", "heading1", "heading2", "heading3", "heading4", "heading5", "heading6", "heading7", "heading8"];
|
|
4
|
+
export declare const headingLevelsArray: readonly ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
5
5
|
export type HeadingSizes = typeof headingSizesArray[number];
|
|
6
6
|
export type HeadingLevels = typeof headingLevelsArray[number];
|
|
7
7
|
export interface HeadingProps extends ChakraHeadingProps {
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
3
|
-
export type AriaLiveValues = "assertive" | "off" | "polite" | undefined;
|
|
4
3
|
export type HelperErrorTextType = string | JSX.Element;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
* DOM element. When false, only changes (additionals or removals) will be
|
|
8
|
-
* read. True by default. */
|
|
9
|
-
ariaAtomic?: boolean;
|
|
10
|
-
/** Aria attribute used to handle live updates for the helper and error text.
|
|
11
|
-
* This indicates the priority of the text and when it should be presented to
|
|
12
|
-
* users using screen readers; "off" indicates that the content should not be
|
|
13
|
-
* presented, "polite" that it will be announced at the next available time
|
|
14
|
-
* slot, and "assertive" that it should be announced immediately. This is set
|
|
15
|
-
* to "polite" by default. */
|
|
16
|
-
ariaLive?: AriaLiveValues;
|
|
4
|
+
type HTMLDivAttributes = Pick<React.HTMLAttributes<HTMLDivElement>, "aria-atomic" | "aria-live">;
|
|
5
|
+
export interface HelperErrorTextProps extends HTMLDivAttributes {
|
|
17
6
|
/** Additional className to add. */
|
|
18
7
|
className?: string;
|
|
19
8
|
/** Unique ID for accessibility purposes. */
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ComponentImageProps } from "../Image/Image";
|
|
4
|
-
export declare const heroTypesArray: readonly ["primary", "
|
|
4
|
+
export declare const heroTypesArray: readonly ["primary", "tertiary", "campaign"];
|
|
5
5
|
export type HeroTypes = typeof heroTypesArray[number];
|
|
6
|
-
export declare const heroSecondaryTypes: string[];
|
|
7
6
|
export interface HeroImageProps extends Pick<ComponentImageProps, "alt" | "fallbackSrc" | "id" | "src" | "onError" | "component"> {
|
|
8
7
|
}
|
|
9
8
|
export interface HeroProps {
|
|
@@ -32,10 +31,10 @@ export interface HeroProps {
|
|
|
32
31
|
/** ID that other components can cross reference for accessibility purposes. */
|
|
33
32
|
id?: string;
|
|
34
33
|
/** Object used to create and render the `Image` component. You can pass `component`
|
|
35
|
-
* (with its own internal props, which will override) or `src`, `alt`, `id`,
|
|
36
|
-
* If `imageProps.alt` is left blank, a warning
|
|
37
|
-
* will
|
|
38
|
-
*
|
|
34
|
+
* (with its own internal props, which will override) or `src`, `alt`, `id`,
|
|
35
|
+
* `fallBackSrc`, and `onError`. If `imageProps.alt` is left blank, a warning
|
|
36
|
+
* will be logged to the console and will cause accessibility issues. For
|
|
37
|
+
* `imageProps.src`, it will only work for the "campaign" `Hero` type. */
|
|
39
38
|
imageProps?: HeroImageProps;
|
|
40
39
|
/** Optional boolean used to toggle the default text color from light to dark.
|
|
41
40
|
* Set isDarkText to `true` if the backgroundColor is set to a light color. */
|
|
@@ -44,9 +43,6 @@ export interface HeroProps {
|
|
|
44
43
|
* the "campaign" variant. If true, the background image will be converted to
|
|
45
44
|
* black & white and darkened to 60% black. */
|
|
46
45
|
isDarkBackgroundImage?: boolean;
|
|
47
|
-
/** Optional details area that contains location data.
|
|
48
|
-
* Note: not all `Hero` variations utilize this prop. */
|
|
49
|
-
locationDetails?: JSX.Element;
|
|
50
46
|
/** Optional string used for the subheader that displays
|
|
51
47
|
* underneath the heading element. */
|
|
52
48
|
subHeaderText?: string | JSX.Element;
|
|
@@ -5,7 +5,6 @@ export type IconAlign = typeof iconAlignArray[number];
|
|
|
5
5
|
export type IconColors = typeof iconColorsArray[number];
|
|
6
6
|
export type IconNames = typeof iconNamesArray[number];
|
|
7
7
|
export type IconRotations = typeof iconRotationsArray[number];
|
|
8
|
-
export type IconRotationTypes = typeof iconRotationsArray[number];
|
|
9
8
|
export type IconSizes = typeof iconSizesArray[number];
|
|
10
9
|
export type IconTypes = typeof iconTypesArray[number];
|
|
11
10
|
export interface IconProps {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChakraComponent, LinkProps as ChakraLinkProps } from "@chakra-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
export declare const linkTypesArray: readonly ["action", "backwards", "
|
|
3
|
+
export declare const linkTypesArray: readonly ["action", "backwards", "buttonPrimary", "buttonSecondary", "buttonPill", "buttonCallout", "buttonNoBrand", "buttonDisabled", "default", "external", "forwards", "standalone"];
|
|
4
4
|
export type LinkTypes = typeof linkTypesArray[number];
|
|
5
5
|
export interface LinkProps extends ChakraLinkProps {
|
|
6
6
|
/** Additional class name to render in the `Link` component. */
|
|
@@ -21,8 +21,8 @@ export interface LinkProps extends ChakraLinkProps {
|
|
|
21
21
|
screenreaderOnlyText?: string;
|
|
22
22
|
/** Prop that sets the HTML attribute to target where the link should go. */
|
|
23
23
|
target?: "_blank" | "_parent" | "_self" | "_top";
|
|
24
|
-
/** Controls the link
|
|
25
|
-
* standalone,
|
|
24
|
+
/** Controls the link's styles based on the value: action, backwards, default,
|
|
25
|
+
* external, forwards, standalone, and all "button" types. */
|
|
26
26
|
type?: LinkTypes;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
@@ -26,8 +26,6 @@ type NotificationHeadingProps = Omit<BasePropsWithoutAlignText, "showIcon">;
|
|
|
26
26
|
type NotificationContentProps = Omit<BaseProps, "icon">;
|
|
27
27
|
type BasePropsWithoutAlignText = Omit<BaseProps, "alignText">;
|
|
28
28
|
export interface NotificationProps extends BasePropsWithoutAlignText {
|
|
29
|
-
/** Label used to describe the `Notification`'s aside HTML element. */
|
|
30
|
-
ariaLabel?: string;
|
|
31
29
|
/** Additional `className` to add. */
|
|
32
30
|
className?: string;
|
|
33
31
|
/** Optional prop to control whether a `Notification` can be dismissed
|
|
@@ -35,8 +33,6 @@ export interface NotificationProps extends BasePropsWithoutAlignText {
|
|
|
35
33
|
dismissible?: boolean;
|
|
36
34
|
/** Optional custom `Icon` that will override the default `Icon`. */
|
|
37
35
|
icon?: JSX.Element;
|
|
38
|
-
/** Optional prop to control the margin around the `Notification` component. */
|
|
39
|
-
noMargin?: boolean;
|
|
40
36
|
/** Content to be rendered in a `NotificationContent` component. */
|
|
41
37
|
notificationContent: string | JSX.Element;
|
|
42
38
|
}
|
|
@@ -7,8 +7,6 @@ export type ProgressIndicatorSizes = typeof progressIndicatorSizesArray[number];
|
|
|
7
7
|
export type ProgressIndicatorTypes = typeof progressIndicatorTypesArray[number];
|
|
8
8
|
export type ProgressIndicatorLabelPlacements = typeof progressIndicatorLabelPlacementsArray[number];
|
|
9
9
|
interface BaseProgressIndicatorProps {
|
|
10
|
-
/** The darkMode prop is deprecated and should no longer be used. */
|
|
11
|
-
darkMode?: boolean;
|
|
12
10
|
/** ID that other components can cross reference for accessibility purposes. */
|
|
13
11
|
id: string;
|
|
14
12
|
/** Whether the `ProgressIndicator` should be linear or circular. */
|
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
3
|
export declare const statusBadgeFontSizeArray: readonly ["desktop.body.body1", "desktop.body.body2", "desktop.caption"];
|
|
4
|
-
export declare const
|
|
5
|
-
export type StatusBadgeLevels = typeof statusBadgeLevelArray[number];
|
|
6
|
-
export declare const statusBadgeTypeArray: readonly ["informative", "negative", "neutral", "positive", "recommendation", "warning", "low", "medium", "high"];
|
|
4
|
+
export declare const statusBadgeTypeArray: readonly ["informative", "negative", "neutral", "positive", "recommendation", "warning"];
|
|
7
5
|
export type StatusBadgeTypes = typeof statusBadgeTypeArray[number];
|
|
8
6
|
export interface StatusBadgeProps {
|
|
9
7
|
/** Additional class for the component */
|
|
10
8
|
className?: string;
|
|
11
9
|
/** ID that other components can cross reference for accessibility purposes */
|
|
12
10
|
id?: string;
|
|
13
|
-
/** Level of the status badge. This prop has been deprecated in favor of the
|
|
14
|
-
* `type` prop. */
|
|
15
|
-
level?: StatusBadgeLevels;
|
|
16
11
|
/** Semantic type of the status badge. */
|
|
17
12
|
type?: StatusBadgeTypes;
|
|
18
13
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
2
|
import React from "react";
|
|
3
|
-
export declare const textSizesArray: readonly ["default", "body1", "body2", "caption"
|
|
3
|
+
export declare const textSizesArray: readonly ["default", "body1", "body2", "caption"];
|
|
4
4
|
export type StyledListTextSizes = typeof textSizesArray[number];
|
|
5
5
|
export interface StyledListProps {
|
|
6
6
|
/** Any child node passed to the component. */
|
|
@@ -1,52 +1,18 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ChakraComponent } from "@chakra-ui/react";
|
|
2
|
-
|
|
3
|
+
export declare const sidebarPlacementArray: readonly ["none", "left", "right"];
|
|
4
|
+
export type SidebarPlacement = typeof sidebarPlacementArray[number];
|
|
3
5
|
export interface TemplateProps {
|
|
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
|
|
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 {
|
|
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
|
|
58
|
-
*
|
|
59
|
-
*
|
|
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
|
|
27
|
+
declare const TemplateBreakout: React.FC<React.PropsWithChildren>;
|
|
97
28
|
/**
|
|
98
|
-
* This optional component
|
|
99
|
-
*
|
|
100
|
-
*
|
|
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
|
|
33
|
+
declare const TemplateTop: React.FC<React.PropsWithChildren>;
|
|
104
34
|
/**
|
|
105
|
-
* This component
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
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
|
|
40
|
+
declare const TemplateMain: React.FC<React.PropsWithChildren<TemplateMainProps>>;
|
|
113
41
|
/**
|
|
114
|
-
* This component
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
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
|
|
49
|
+
declare const TemplateMainNarrow: React.FC<React.PropsWithChildren<TemplateMainProps>>;
|
|
125
50
|
/**
|
|
126
|
-
* This optional component
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
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
|
|
56
|
+
declare const TemplateSidebar: React.FC<React.PropsWithChildren>;
|
|
132
57
|
/**
|
|
133
|
-
* This
|
|
134
|
-
*
|
|
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
|
-
|
|
140
|
-
export { Template,
|
|
141
|
-
export default TemplateAppContainer;
|
|
61
|
+
declare const TemplateBottom: React.FC<React.PropsWithChildren>;
|
|
62
|
+
export { Template, TemplateBreakout, TemplateTop, TemplateMain, TemplateMainNarrow, TemplateSidebar, TemplateBottom, };
|
|
@@ -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;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -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,
|
|
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 {
|
|
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 {
|
|
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
|
|
126
|
+
export { default as useResponsiveSpacing } from "./hooks/useResponsiveSpacing";
|
|
128
127
|
export { default as useScrollFadeStyles } from "./hooks/useScrollFadeStyles";
|
|
129
|
-
export { default as
|
|
128
|
+
export { default as useWindowSize } from "./hooks/useWindowSize";
|
|
130
129
|
export type { AutoCompleteValues } from "./utils/constantValues";
|
|
@@ -178,9 +178,6 @@ declare const Button: {
|
|
|
178
178
|
text: ({ buttonSize }: any) => {
|
|
179
179
|
base: any;
|
|
180
180
|
};
|
|
181
|
-
link: ({ buttonSize }: any) => {
|
|
182
|
-
base: any;
|
|
183
|
-
};
|
|
184
181
|
pill: ({ buttonSize }: any) => {
|
|
185
182
|
base: any;
|
|
186
183
|
};
|
|
@@ -196,7 +193,7 @@ declare const Button: {
|
|
|
196
193
|
};
|
|
197
194
|
defaultProps?: {
|
|
198
195
|
size?: string | number;
|
|
199
|
-
variant?: "
|
|
196
|
+
variant?: "text" | "primary" | "secondary" | "pill" | "iconOnly" | "callout" | "noBrand";
|
|
200
197
|
colorScheme?: string;
|
|
201
198
|
};
|
|
202
199
|
parts: ("base" | "screenreaderOnly")[];
|