@nypl/design-system-react-components 2.0.0 → 2.1.0-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.
- package/README.md +466 -17
- package/dist/design-system-react-components.cjs +528 -0
- package/dist/design-system-react-components.js +37957 -0
- package/dist/src/components/Accordion/Accordion.d.ts +29 -0
- package/dist/src/components/AlphabetFilter/AlphabetFilter.d.ts +23 -0
- package/dist/src/components/AudioPlayer/AudioPlayer.d.ts +43 -0
- package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +24 -0
- package/dist/src/components/Button/Button.d.ts +35 -0
- package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +25 -0
- package/dist/src/components/Card/Card.d.ts +55 -0
- package/dist/src/components/Checkbox/Checkbox.d.ts +47 -0
- package/dist/src/components/CheckboxGroup/CheckboxGroup.d.ts +51 -0
- package/dist/src/components/ComponentWrapper/ComponentWrapper.d.ts +31 -0
- package/dist/src/components/DatePicker/DatePicker.d.ts +82 -0
- package/dist/src/components/FeaturedContent/FeaturedContent.d.ts +29 -0
- package/dist/src/components/FeedbackBox/FeedbackBox.d.ts +64 -0
- package/dist/src/components/FeedbackBox/useFeedbackBoxReducer.d.ts +19 -0
- package/dist/src/components/Fieldset/Fieldset.d.ts +24 -0
- package/dist/src/components/Form/Form.d.ts +31 -0
- package/dist/src/components/Grid/SimpleGrid.d.ts +20 -0
- package/dist/src/components/Heading/Heading.d.ts +42 -0
- package/dist/src/components/HelperErrorText/HelperErrorText.d.ts +34 -0
- package/dist/src/components/Hero/Hero.d.ts +49 -0
- package/dist/src/components/HorizontalRule/HorizontalRule.d.ts +11 -0
- package/dist/src/components/Icons/Icon.d.ts +41 -0
- package/dist/src/components/Icons/IconSvgs.d.ts +196 -0
- package/dist/src/components/Icons/iconVariables.d.ts +6 -0
- package/dist/src/components/Image/Image.d.ts +68 -0
- package/dist/src/components/Label/Label.d.ts +25 -0
- package/dist/src/components/Link/Link.d.ts +32 -0
- package/dist/src/components/List/List.d.ts +43 -0
- package/dist/src/components/Logo/Logo.d.ts +29 -0
- package/dist/src/components/Logo/LogoSvgs.d.ts +166 -0
- package/dist/src/components/Logo/logoVariables.d.ts +2 -0
- package/dist/src/components/Modal/Modal.d.ts +35 -0
- package/dist/src/components/NewsletterSignup/NewsletterSignup.d.ts +46 -0
- package/dist/src/components/Notification/Notification.d.ts +52 -0
- package/dist/src/components/Pagination/Pagination.d.ts +27 -0
- package/dist/src/components/ProgressIndicator/ProgressIndicator.d.ts +32 -0
- package/dist/src/components/Radio/Radio.d.ts +43 -0
- package/dist/src/components/RadioGroup/RadioGroup.d.ts +51 -0
- package/dist/src/components/SearchBar/SearchBar.d.ts +58 -0
- package/dist/src/components/Select/Select.d.ts +59 -0
- package/dist/src/components/SkeletonLoader/SkeletonLoader.d.ts +42 -0
- package/dist/src/components/SkipNavigation/SkipNavigation.d.ts +19 -0
- package/dist/src/components/Slider/Slider.d.ts +65 -0
- package/dist/src/components/SocialMediaLinks/SocialMediaLinks.d.ts +42 -0
- package/dist/src/components/SocialMediaLinks/SocialMediaLinksUtils.d.ts +7 -0
- package/dist/src/components/StatusBadge/StatusBadge.d.ts +19 -0
- package/dist/src/components/StructuredContent/StructuredContent.d.ts +30 -0
- package/dist/src/components/StyleGuide/ColorCard.d.ts +348 -0
- package/dist/src/components/StyledList/StyledList.d.ts +26 -0
- package/dist/src/components/Table/Table.d.ts +32 -0
- package/dist/src/components/Tabs/Tabs.d.ts +28 -0
- package/dist/src/components/TagSet/TagSet.d.ts +24 -0
- package/dist/src/components/TagSet/TagSetExplore.d.ts +28 -0
- package/dist/src/components/TagSet/TagSetFilter.d.ts +25 -0
- package/dist/src/components/TagSet/TooltipWrapper.d.ts +9 -0
- package/dist/src/components/Template/Template.d.ts +140 -0
- package/dist/src/components/Text/Text.d.ts +27 -0
- package/dist/src/components/TextInput/TextInput.d.ts +92 -0
- package/dist/src/components/Toggle/Toggle.d.ts +43 -0
- package/dist/src/components/Tooltip/Tooltip.d.ts +17 -0
- package/dist/src/components/VideoPlayer/VideoPlayer.d.ts +42 -0
- package/dist/src/helpers/getSectionColors.d.ts +8 -0
- package/dist/src/helpers/types.d.ts +50 -0
- package/dist/src/hooks/useCarouselStyles.d.ts +17 -0
- package/dist/src/hooks/useCloseDropDown.d.ts +7 -0
- package/dist/src/hooks/useNYPLBreakpoints.d.ts +13 -0
- package/dist/src/hooks/useNYPLTheme.d.ts +75 -0
- package/dist/src/hooks/useStateWithDependencies.d.ts +8 -0
- package/dist/src/hooks/useWindowSize.d.ts +10 -0
- package/dist/src/index.d.ts +87 -0
- package/dist/src/theme/components/accordion.d.ts +34 -0
- package/dist/src/theme/components/alphabetFilter.d.ts +40 -0
- package/dist/src/theme/components/audioPlayer.d.ts +16 -0
- package/dist/src/theme/components/breadcrumb.d.ts +158 -0
- package/dist/src/theme/components/button.d.ts +152 -0
- package/dist/src/theme/components/buttonGroup.d.ts +11 -0
- package/dist/src/theme/components/card.d.ts +485 -0
- package/dist/src/theme/components/checkbox.d.ts +178 -0
- package/dist/src/theme/components/checkboxGroup.d.ts +14 -0
- package/dist/src/theme/components/componentWrapper.d.ts +12 -0
- package/dist/src/theme/components/customTable.d.ts +739 -0
- package/dist/src/theme/components/datePicker.d.ts +17 -0
- package/dist/src/theme/components/featuredContent.d.ts +70 -0
- package/dist/src/theme/components/feedbackBox.d.ts +100 -0
- package/dist/src/theme/components/fieldset.d.ts +24 -0
- package/dist/src/theme/components/filterBar.d.ts +46 -0
- package/dist/src/theme/components/global.d.ts +141 -0
- package/dist/src/theme/components/globalMixins.d.ts +40 -0
- package/dist/src/theme/components/heading.d.ts +372 -0
- package/dist/src/theme/components/helperErrorText.d.ts +18 -0
- package/dist/src/theme/components/hero.d.ts +639 -0
- package/dist/src/theme/components/horizontalRule.d.ts +18 -0
- package/dist/src/theme/components/icon.d.ts +62251 -0
- package/dist/src/theme/components/image.d.ts +754 -0
- package/dist/src/theme/components/label.d.ts +22 -0
- package/dist/src/theme/components/link.d.ts +152 -0
- package/dist/src/theme/components/list.d.ts +230 -0
- package/dist/src/theme/components/logo.d.ts +477 -0
- package/dist/src/theme/components/modal.d.ts +27 -0
- package/dist/src/theme/components/multiSelect.d.ts +29 -0
- package/dist/src/theme/components/multiSelectMenuButton.d.ts +99 -0
- package/dist/src/theme/components/newsletterSignup.d.ts +93 -0
- package/dist/src/theme/components/notification.d.ts +137 -0
- package/dist/src/theme/components/pagination.d.ts +19 -0
- package/dist/src/theme/components/progressIndicator.d.ts +69 -0
- package/dist/src/theme/components/radio.d.ts +202 -0
- package/dist/src/theme/components/radioGroup.d.ts +14 -0
- package/dist/src/theme/components/searchBar.d.ts +34 -0
- package/dist/src/theme/components/select.d.ts +126 -0
- package/dist/src/theme/components/skeletonLoader.d.ts +105 -0
- package/dist/src/theme/components/skipNavigation.d.ts +28 -0
- package/dist/src/theme/components/slider.d.ts +78 -0
- package/dist/src/theme/components/socialmedialinks.d.ts +192 -0
- package/dist/src/theme/components/statusBadge.d.ts +37 -0
- package/dist/src/theme/components/structuredContent.d.ts +454 -0
- package/dist/src/theme/components/styledList.d.ts +51 -0
- package/dist/src/theme/components/tabs.d.ts +172 -0
- package/dist/src/theme/components/tagSet.d.ts +154 -0
- package/dist/src/theme/components/template.d.ts +98 -0
- package/dist/src/theme/components/text.d.ts +59 -0
- package/dist/src/theme/components/textInput.d.ts +360 -0
- package/dist/src/theme/components/toggle.d.ts +129 -0
- package/dist/src/theme/components/tooltip.d.ts +21 -0
- package/dist/src/theme/components/videoPlayer.d.ts +47 -0
- package/dist/src/theme/foundations/breakpoints.d.ts +23 -0
- package/dist/src/theme/foundations/colors.d.ts +3 -0
- package/dist/src/theme/foundations/global.d.ts +68 -0
- package/dist/src/theme/foundations/radii.d.ts +11 -0
- package/dist/src/theme/foundations/shadows.d.ts +4 -0
- package/dist/src/theme/foundations/spacing.d.ts +96 -0
- package/dist/src/theme/foundations/typography.d.ts +8 -0
- package/dist/src/theme/index.d.ts +20 -0
- package/dist/src/theme/internalChakraProvider.d.ts +67 -0
- package/dist/src/theme/provider.d.ts +4 -0
- package/dist/src/theme/types.d.ts +1 -0
- package/dist/src/utils/colorUtils.d.ts +5 -0
- package/dist/src/utils/interfaces.d.ts +5 -0
- package/dist/src/utils/utils.d.ts +42 -0
- package/dist/styles.css +1 -0
- package/package.json +132 -24
- package/CHANGELOG.md +0 -139
- package/dist/design-system-react-components.min.js +0 -23
- package/dist/design-system-react-components.min.js.map +0 -1
- package/lib/components/00-base/Container/Container.d.ts +0 -6
- package/lib/components/00-base/Container/Container.js +0 -19
- package/lib/components/00-base/Container/Modal.d.ts +0 -12
- package/lib/components/00-base/Container/Modal.js +0 -29
- package/lib/components/00-base/Container/Modal.stories.d.ts +0 -7
- package/lib/components/00-base/Container/Modal.stories.js +0 -20
- package/lib/components/00-base/Placeholder.d.ts +0 -10
- package/lib/components/00-base/Placeholder.js +0 -23
- package/lib/components/00-base/SectionName.d.ts +0 -4
- package/lib/components/00-base/SectionName.js +0 -16
- package/lib/components/01-atoms/Button/Button.d.ts +0 -52
- package/lib/components/01-atoms/Button/Button.js +0 -76
- package/lib/components/01-atoms/Button/Button.stories.d.ts +0 -14
- package/lib/components/01-atoms/Button/Button.stories.js +0 -33
- package/lib/components/01-atoms/Button/ButtonTypes.d.ts +0 -10
- package/lib/components/01-atoms/Button/ButtonTypes.js +0 -14
- package/lib/components/01-atoms/Forms/Checkbox.d.ts +0 -21
- package/lib/components/01-atoms/Forms/Checkbox.js +0 -27
- package/lib/components/01-atoms/Forms/Checkbox.stories.d.ts +0 -7
- package/lib/components/01-atoms/Forms/Checkbox.stories.js +0 -23
- package/lib/components/01-atoms/Forms/DateRangeForm.d.ts +0 -31
- package/lib/components/01-atoms/Forms/DateRangeForm.js +0 -27
- package/lib/components/01-atoms/Forms/DateRangeForm.stories.d.ts +0 -9
- package/lib/components/01-atoms/Forms/DateRangeForm.stories.js +0 -23
- package/lib/components/01-atoms/Forms/FormDropdown.d.ts +0 -22
- package/lib/components/01-atoms/Forms/FormDropdown.js +0 -64
- package/lib/components/01-atoms/Forms/FormDropdown.stories.d.ts +0 -8
- package/lib/components/01-atoms/Forms/FormDropdown.stories.js +0 -22
- package/lib/components/01-atoms/Forms/HelperErrorText.d.ts +0 -26
- package/lib/components/01-atoms/Forms/HelperErrorText.js +0 -29
- package/lib/components/01-atoms/Forms/HelperErrorText.stories.d.ts +0 -9
- package/lib/components/01-atoms/Forms/HelperErrorText.stories.js +0 -23
- package/lib/components/01-atoms/Forms/Input.d.ts +0 -47
- package/lib/components/01-atoms/Forms/Input.js +0 -39
- package/lib/components/01-atoms/Forms/Input.stories.d.ts +0 -10
- package/lib/components/01-atoms/Forms/Input.stories.js +0 -22
- package/lib/components/01-atoms/Forms/Label.d.ts +0 -19
- package/lib/components/01-atoms/Forms/Label.js +0 -22
- package/lib/components/01-atoms/Forms/Label.stories.d.ts +0 -7
- package/lib/components/01-atoms/Forms/Label.stories.js +0 -20
- package/lib/components/01-atoms/Forms/TextField.d.ts +0 -26
- package/lib/components/01-atoms/Forms/TextField.js +0 -36
- package/lib/components/01-atoms/Forms/TextField.stories.d.ts +0 -7
- package/lib/components/01-atoms/Forms/TextField.stories.js +0 -20
- package/lib/components/01-atoms/Images/Icons/Icon.d.ts +0 -14
- package/lib/components/01-atoms/Images/Icons/Icon.js +0 -38
- package/lib/components/01-atoms/Images/Image/Image.d.ts +0 -8
- package/lib/components/01-atoms/Images/Image/Image.js +0 -32
- package/lib/components/01-atoms/Images/Image/Image.stories.d.ts +0 -8
- package/lib/components/01-atoms/Images/Image/Image.stories.js +0 -24
- package/lib/components/01-atoms/Links/BasicLink.d.ts +0 -15
- package/lib/components/01-atoms/Links/BasicLink.js +0 -50
- package/lib/components/01-atoms/Links/BasicLink.stories.d.ts +0 -8
- package/lib/components/01-atoms/Links/BasicLink.stories.js +0 -21
- package/lib/components/01-atoms/Links/IconLink.d.ts +0 -13
- package/lib/components/01-atoms/Links/IconLink.js +0 -44
- package/lib/components/01-atoms/Links/IconLink.stories.d.ts +0 -10
- package/lib/components/01-atoms/Links/IconLink.stories.js +0 -24
- package/lib/components/01-atoms/Links/Link.d.ts +0 -13
- package/lib/components/01-atoms/Links/Link.js +0 -51
- package/lib/components/01-atoms/Links/UnderlineLink.d.ts +0 -11
- package/lib/components/01-atoms/Links/UnderlineLink.js +0 -29
- package/lib/components/01-atoms/Links/UnderlineLink.stories.d.ts +0 -8
- package/lib/components/01-atoms/Links/UnderlineLink.stories.js +0 -21
- package/lib/components/01-atoms/Text/Headings/Heading.d.ts +0 -16
- package/lib/components/01-atoms/Text/Headings/Heading.js +0 -40
- package/lib/components/01-atoms/Text/Headings/Heading.stories.d.ts +0 -12
- package/lib/components/01-atoms/Text/Headings/Heading.stories.js +0 -35
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.d.ts +0 -2
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.js +0 -18
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.stories.d.ts +0 -7
- package/lib/components/01-atoms/Text/Headings/RNSectionTitle.stories.js +0 -24
- package/lib/components/01-atoms/Text/Text/BodyText.d.ts +0 -12
- package/lib/components/01-atoms/Text/Text/BodyText.js +0 -73
- package/lib/components/01-atoms/Text/Text/BodyText.stories.d.ts +0 -14
- package/lib/components/01-atoms/Text/Text/BodyText.stories.js +0 -54
- package/lib/components/02-molecules/Cards/EditionCard.d.ts +0 -31
- package/lib/components/02-molecules/Cards/EditionCard.js +0 -51
- package/lib/components/02-molecules/Cards/EditionCard.stories.d.ts +0 -13
- package/lib/components/02-molecules/Cards/EditionCard.stories.js +0 -26
- package/lib/components/02-molecules/Cards/SearchResultItem.d.ts +0 -17
- package/lib/components/02-molecules/Cards/SearchResultItem.js +0 -40
- package/lib/components/02-molecules/Cards/SearchResultItem.stories.d.ts +0 -8
- package/lib/components/02-molecules/Cards/SearchResultItem.stories.js +0 -31
- package/lib/components/02-molecules/Dropdown/Dropdown.d.ts +0 -21
- package/lib/components/02-molecules/Dropdown/Dropdown.js +0 -55
- package/lib/components/02-molecules/Dropdown/Dropdown.stories.d.ts +0 -14
- package/lib/components/02-molecules/Dropdown/Dropdown.stories.js +0 -33
- package/lib/components/02-molecules/Headings/SectionTitle.d.ts +0 -17
- package/lib/components/02-molecules/Headings/SectionTitle.js +0 -42
- package/lib/components/02-molecules/Headings/SectionTitle.stories.d.ts +0 -8
- package/lib/components/02-molecules/Headings/SectionTitle.stories.js +0 -20
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.d.ts +0 -14
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.js +0 -51
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -8
- package/lib/components/02-molecules/Menus/Breadcrumbs/Breadcrumbs.stories.js +0 -30
- package/lib/components/02-molecules/Menus/Pagination/Pagination.d.ts +0 -11
- package/lib/components/02-molecules/Menus/Pagination/Pagination.js +0 -57
- package/lib/components/02-molecules/Menus/Pagination/Pagination.stories.d.ts +0 -7
- package/lib/components/02-molecules/Menus/Pagination/Pagination.stories.js +0 -20
- package/lib/components/02-molecules/SearchBar/SearchBar.d.ts +0 -26
- package/lib/components/02-molecules/SearchBar/SearchBar.js +0 -69
- package/lib/components/02-molecules/SearchBar/SearchBar.stories.d.ts +0 -11
- package/lib/components/02-molecules/SearchBar/SearchBar.stories.js +0 -24
- package/lib/components/03-organisms/Accordion/Accordion.d.ts +0 -19
- package/lib/components/03-organisms/Accordion/Accordion.js +0 -41
- package/lib/components/03-organisms/Accordion/Accordion.stories.d.ts +0 -7
- package/lib/components/03-organisms/Accordion/Accordion.stories.js +0 -30
- package/lib/components/03-organisms/Headers/HeaderImgRight.d.ts +0 -12
- package/lib/components/03-organisms/Headers/HeaderImgRight.js +0 -32
- package/lib/components/03-organisms/Headers/HeaderImgRight.stories.d.ts +0 -7
- package/lib/components/03-organisms/Headers/HeaderImgRight.stories.js +0 -19
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.d.ts +0 -19
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.js +0 -27
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.stories.d.ts +0 -7
- package/lib/components/03-organisms/Headers/RNHeaderWithSearch.stories.js +0 -26
- package/lib/components/03-organisms/Hero/Hero.d.ts +0 -31
- package/lib/components/03-organisms/Hero/Hero.js +0 -62
- package/lib/components/03-organisms/Hero/Hero.stories.d.ts +0 -11
- package/lib/components/03-organisms/Hero/Hero.stories.js +0 -35
- package/lib/components/03-organisms/Hero/HeroTypes.d.ts +0 -6
- package/lib/components/03-organisms/Hero/HeroTypes.js +0 -9
- package/lib/components/03-organisms/List/UnorderedList.d.ts +0 -18
- package/lib/components/03-organisms/List/UnorderedList.js +0 -28
- package/lib/components/03-organisms/List/UnorderedList.stories.d.ts +0 -11
- package/lib/components/03-organisms/List/UnorderedList.stories.js +0 -73
- package/lib/components/03-organisms/SearchPromo/SearchPromo.d.ts +0 -22
- package/lib/components/03-organisms/SearchPromo/SearchPromo.js +0 -30
- package/lib/components/03-organisms/SearchPromo/SearchPromo.stories.d.ts +0 -8
- package/lib/components/03-organisms/SearchPromo/SearchPromo.stories.js +0 -28
- package/lib/helpers/hoc/WithOneChild.d.ts +0 -8
- package/lib/helpers/hoc/WithOneChild.js +0 -63
- package/lib/index.d.ts +0 -24
- package/lib/index.js +0 -51
- package/lib/utils/bem.d.ts +0 -1
- package/lib/utils/bem.js +0 -35
- package/tsd.d.ts +0 -4
- package/webpack.prod.js +0 -38
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IconNames } from "../Icons/Icon";
|
|
2
|
+
export interface TagSetFilterDataProps {
|
|
3
|
+
/** The name of the SVG `Icon` to render before the tag label. */
|
|
4
|
+
iconName?: IconNames;
|
|
5
|
+
/** The string label to display. */
|
|
6
|
+
label: string;
|
|
7
|
+
}
|
|
8
|
+
export interface TagSetFilterProps {
|
|
9
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
10
|
+
id?: string;
|
|
11
|
+
/** Whether the tags should be removable. */
|
|
12
|
+
isDismissible?: boolean;
|
|
13
|
+
/** The function to perform when a tag is clicked when `isDismissible` is true. */
|
|
14
|
+
onClick?: (tagLabel: string) => void;
|
|
15
|
+
/** The array of data to display as tags. */
|
|
16
|
+
tagSetData: TagSetFilterDataProps[];
|
|
17
|
+
/** The `TagSet` variant to render; "filter" by default. */
|
|
18
|
+
type: "filter";
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* The "filter" `TagSet` variant will display tags that can be removed when
|
|
22
|
+
* `isDismissible` is true and they are clicked.
|
|
23
|
+
*/
|
|
24
|
+
export declare const TagSetFilter: import("@chakra-ui/react").ChakraComponent<(props: TagSetFilterProps) => import("@emotion/react/jsx-runtime").JSX.Element, {}>;
|
|
25
|
+
export default TagSetFilter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
/**
|
|
3
|
+
* This helper component wrapper renders a DS `Tooltip` component if the text is
|
|
4
|
+
* long or a React fragment. This assumes that the `label` prop is a rather
|
|
5
|
+
* simple single root JSX element, such as `<Link ...>....</Link>`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const TooltipWrapper: ({ label, children, }: React.PropsWithChildren<{
|
|
8
|
+
label: any;
|
|
9
|
+
}>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TemplateProps {
|
|
3
|
+
}
|
|
4
|
+
export interface TemplateHeaderProps {
|
|
5
|
+
/** Flag to render an HTML header element. True by default. */
|
|
6
|
+
renderHeaderElement?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface TemplateFooterProps {
|
|
9
|
+
/** Flag to render an HTML footer element. True by default. */
|
|
10
|
+
renderFooterElement?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface TemplateSidebarProps {
|
|
13
|
+
/** Renders the `TemplateContentSidebar` component either on the left or
|
|
14
|
+
* right side of the `TemplateContentPrimary` component. */
|
|
15
|
+
sidebar?: "none" | "left" | "right";
|
|
16
|
+
}
|
|
17
|
+
export interface TemplateContentProps extends TemplateSidebarProps {
|
|
18
|
+
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
19
|
+
* anchor for the application skip navigation. */
|
|
20
|
+
id?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TemplateAppContainerProps extends TemplateFooterProps, TemplateHeaderProps, TemplateSidebarProps {
|
|
23
|
+
/** DOM that will be rendered before the rest of the components in
|
|
24
|
+
* `TemplateAppContainer` and immediately before the `TemplateHeader` component. */
|
|
25
|
+
aboveHeader?: React.ReactElement;
|
|
26
|
+
/** DOM that will be rendered in the `TemplateBreakout` component section. */
|
|
27
|
+
breakout?: React.ReactElement;
|
|
28
|
+
/** DOM that will be rendered in the `TemplateContentBottom` component section. */
|
|
29
|
+
contentBottom?: React.ReactElement;
|
|
30
|
+
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
31
|
+
* anchor for the application skip navigation. */
|
|
32
|
+
contentId?: string;
|
|
33
|
+
/** DOM that will be rendered in the `TemplateContentPrimary` component section. */
|
|
34
|
+
contentPrimary?: React.ReactElement;
|
|
35
|
+
/** DOM that will be rendered in the `TemplateContentSidebar` component section. */
|
|
36
|
+
contentSidebar?: React.ReactElement;
|
|
37
|
+
/** DOM that will be rendered in the `TemplateContentTop` component section. */
|
|
38
|
+
contentTop?: React.ReactElement;
|
|
39
|
+
/** DOM that will be rendered in the `TemplateFooter` component section. */
|
|
40
|
+
footer?: React.ReactElement;
|
|
41
|
+
/** DOM that will be rendered in the `TemplateHeader` component section. */
|
|
42
|
+
header?: React.ReactElement;
|
|
43
|
+
/** Render the `SkipNavigation` component or not. False by default. */
|
|
44
|
+
renderSkipNavigation?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The main top-level parent component that wraps all template-related
|
|
48
|
+
* components.
|
|
49
|
+
*/
|
|
50
|
+
declare const Template: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TemplateProps & {
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
53
|
+
/**
|
|
54
|
+
* This optional component renders its children from edge-to-edge and should
|
|
55
|
+
* be used for alerts or notifications that are typically site-wide. This must
|
|
56
|
+
* be rendered immediately before the `TemplateHeader` component. This is meant
|
|
57
|
+
* for components that render an `aside` HTML element or HTML element with the
|
|
58
|
+
* `role="complementary"` attribute. These elements should *not* be rendered
|
|
59
|
+
* in the `header` HTML section since that's an accessibility violation.
|
|
60
|
+
*/
|
|
61
|
+
declare const TemplateAboveHeader: (props: React.PropsWithChildren<TemplateProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
62
|
+
/**
|
|
63
|
+
* This optional component should be the first child of the `Template`
|
|
64
|
+
* component. This is rendered as an HTML `<header>` element. If an HTML
|
|
65
|
+
* `<header>` element is already passed in a custom component as the children,
|
|
66
|
+
* set `renderFooterElement` to `false`. Otherwise, the parent wrapper will
|
|
67
|
+
* render an HTML `<header>` element.
|
|
68
|
+
*/
|
|
69
|
+
declare const TemplateHeader: ({ children, renderHeaderElement, }: React.PropsWithChildren<TemplateHeaderProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
70
|
+
/**
|
|
71
|
+
* This component should be used inside the `Template` component to contain both
|
|
72
|
+
* the `TemplateAboveHeader` and `TemplateHeader` components. This is meant to
|
|
73
|
+
* render its children from edge to edge and is most useful for the headers,
|
|
74
|
+
* `Breadcrumbs`, and `Hero` components or other banner-like components.
|
|
75
|
+
*/
|
|
76
|
+
declare const TemplateBreakout: (props: React.PropsWithChildren<TemplateProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
77
|
+
/**
|
|
78
|
+
* This component is most useful to render content on the page. This renders an
|
|
79
|
+
* HTML `<main>` element with an id of "mainContent". The "mainContent" id should
|
|
80
|
+
* be used as the consuming application's skip navigation link. The `TemplateContent`
|
|
81
|
+
* component also takes a `sidebar` prop with optional "left" or "right" values.
|
|
82
|
+
* This will set the correct *styling* needed for the `TemplateContentPrimary`
|
|
83
|
+
* and `TemplateContentSidebar` components. Note that `TemplateContentPrimary`
|
|
84
|
+
* and `TemplateContentSidebar` must be ordered correctly as children elements
|
|
85
|
+
* for the appropriate styles to take effect.
|
|
86
|
+
*/
|
|
87
|
+
declare const TemplateContent: (props: React.PropsWithChildren<TemplateContentProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
88
|
+
/**
|
|
89
|
+
* This optional component must be used inside the `TemplateContent` component.
|
|
90
|
+
* This renders content in the main width of the container and will always render
|
|
91
|
+
* above the primary component and the sidebar component (if any).
|
|
92
|
+
*/
|
|
93
|
+
declare const TemplateContentTop: (props: React.PropsWithChildren<TemplateProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
94
|
+
/**
|
|
95
|
+
* This optional component must be used inside the `TemplateContent` component
|
|
96
|
+
* and after the `TemplateContentPrimary` or `TemplateContentSidebar` component.
|
|
97
|
+
* This renders content in the main width of the container and should always
|
|
98
|
+
* render below the primary component and the sidebar component (if any).
|
|
99
|
+
*/
|
|
100
|
+
declare const TemplateContentBottom: (props: React.PropsWithChildren<TemplateProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
101
|
+
/**
|
|
102
|
+
* This component is used to render content in a column when there must be a
|
|
103
|
+
* sidebar component on either its left or right side. It must go inside the
|
|
104
|
+
* `TemplateContent` component. An optional `sidebar` prop value of "left" or
|
|
105
|
+
* "right" can be passed to render the correct CSS styles. If the `sidebar`
|
|
106
|
+
* prop is used in the `TemplateContent` component, there is no need to pass
|
|
107
|
+
* the `sidebar` prop to this component -- `TemplateContent` will handle it.
|
|
108
|
+
*/
|
|
109
|
+
declare const TemplateContentPrimary: (props: React.PropsWithChildren<TemplateContentProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
110
|
+
/**
|
|
111
|
+
* This component is used to render content in a sidebar column. It must go
|
|
112
|
+
* inside the `TemplateContent` component and must be paired with the
|
|
113
|
+
* `TemplateContentPrimary` component. If this is a left sidebar, it needs to be
|
|
114
|
+
* rendered before the `TemplateContentPrimary` component. If this is a right
|
|
115
|
+
* sidebar, it needs to be rendered after the `TemplateContentPrimary` component.
|
|
116
|
+
* An optional `sidebar` prop value of "left" or "right" can be passed to render
|
|
117
|
+
* the correct CSS styles. If the `sidebar` prop is used in the `TemplateContent`
|
|
118
|
+
* component, there is no need to pass the `sidebar` prop to this component --
|
|
119
|
+
* `TemplateContent` will handle it.
|
|
120
|
+
*/
|
|
121
|
+
declare const TemplateContentSidebar: (props: React.PropsWithChildren<TemplateContentProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
122
|
+
/**
|
|
123
|
+
* This optional component should be the last child of the `Template`
|
|
124
|
+
* component. This is rendered as an HTML `<footer>` element and spans the full
|
|
125
|
+
* width of the page. If an HTML `<footer>` element is already passed in a
|
|
126
|
+
* custom component, set `renderFooterElement` to `false`.
|
|
127
|
+
*/
|
|
128
|
+
declare const TemplateFooter: ({ children, renderFooterElement, }: React.PropsWithChildren<TemplateFooterProps>) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
129
|
+
/**
|
|
130
|
+
* This single component can be used instead of all the individual template
|
|
131
|
+
* components. Instead of importing and rendering the needed "template"
|
|
132
|
+
* components, each section is passed as a prop to the section where it should
|
|
133
|
+
* be rendered. For example, if you want to render content in the
|
|
134
|
+
* `TemplateContentPrimary` section, then pass it as a prop to `contentPrimary`.
|
|
135
|
+
*/
|
|
136
|
+
export declare const TemplateAppContainer: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TemplateAppContainerProps & {
|
|
137
|
+
children?: React.ReactNode;
|
|
138
|
+
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
139
|
+
export { Template, TemplateAboveHeader, TemplateBreakout, TemplateContent, TemplateContentBottom, TemplateContentPrimary, TemplateContentSidebar, TemplateContentTop, TemplateFooter, TemplateHeader, };
|
|
140
|
+
export default TemplateAppContainer;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const textSizesArray: readonly ["default", "body1", "body2", "caption", "tag", "mini", "overline1", "overline2", "subtitle1", "subtitle2"];
|
|
3
|
+
export type TextSizes = typeof textSizesArray[number];
|
|
4
|
+
export interface TextProps {
|
|
5
|
+
/** Additional class name to render in the `Text` component. */
|
|
6
|
+
className?: string;
|
|
7
|
+
/** Optional prop used to show bolded text */
|
|
8
|
+
isBold?: boolean;
|
|
9
|
+
/** Optional prop used to show itlicized text */
|
|
10
|
+
isItalic?: boolean;
|
|
11
|
+
/** Optional prop used to show capitalized text */
|
|
12
|
+
isCapitalized?: boolean;
|
|
13
|
+
/** Optional prop used to show upper case text */
|
|
14
|
+
isUppercase?: boolean;
|
|
15
|
+
/** Optional prop used to show lower case text */
|
|
16
|
+
isLowercase?: boolean;
|
|
17
|
+
/** Optional prop used to remove default spacing */
|
|
18
|
+
noSpace?: boolean;
|
|
19
|
+
/** Optional prop used to explicitly set the ARIA role */
|
|
20
|
+
role?: string;
|
|
21
|
+
/** Optional prop to control the text styling */
|
|
22
|
+
size?: TextSizes;
|
|
23
|
+
}
|
|
24
|
+
export declare const Text: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TextProps & {
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
27
|
+
export default Text;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
+
export declare const textInputTypesArray: readonly ["email", "hidden", "number", "password", "text", "textarea", "tel", "url"];
|
|
4
|
+
export type TextInputTypes = typeof textInputTypesArray[number];
|
|
5
|
+
export declare const TextInputFormats: {
|
|
6
|
+
email: string;
|
|
7
|
+
hidden: string;
|
|
8
|
+
password: string;
|
|
9
|
+
text: string;
|
|
10
|
+
tel: string;
|
|
11
|
+
textarea: string;
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
export type TextInputVariants = "default" | "searchBar" | "searchBarSelect";
|
|
15
|
+
export interface InputProps {
|
|
16
|
+
/** FOR INTERNAL DS USE ONLY: additional helper text id(s) to be used for the input's `aria-describedby` value.
|
|
17
|
+
* If more than one, separate each with a space */
|
|
18
|
+
additionalHelperTextIds?: string;
|
|
19
|
+
/** A class name for the TextInput parent div. */
|
|
20
|
+
className?: string;
|
|
21
|
+
/** The starting value of the input field. */
|
|
22
|
+
defaultValue?: string;
|
|
23
|
+
/** Populates the HelperErrorText for the standard state */
|
|
24
|
+
helperText?: HelperErrorTextType;
|
|
25
|
+
/** ID that other components can cross reference for accessibility purposes */
|
|
26
|
+
id: string;
|
|
27
|
+
/** Populates the HelperErrorText for the error state */
|
|
28
|
+
invalidText?: HelperErrorTextType;
|
|
29
|
+
/** Adds a button to clear existing text in the input field. */
|
|
30
|
+
isClearable?: boolean;
|
|
31
|
+
/** The callback function that is called when the clear button is clicked. */
|
|
32
|
+
isClearableCallback?: () => void;
|
|
33
|
+
/** Adds the `disabled` and `aria-disabled` prop to the input when true */
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
/** Adds errored styling to the input/textarea and helper text elements */
|
|
36
|
+
isInvalid?: boolean;
|
|
37
|
+
/** Will add `required` and `aria-required` props to the input/textarea elements */
|
|
38
|
+
isRequired?: boolean;
|
|
39
|
+
/** Provides text for a `Label` component if `showLabel` is set to true;
|
|
40
|
+
* populates an `aria-label` attribute if `showLabel` is set to false. */
|
|
41
|
+
labelText: string;
|
|
42
|
+
/** The max number for a `number` TextInput type. */
|
|
43
|
+
max?: number;
|
|
44
|
+
/** The max length of the input field. This prop is for all input types
|
|
45
|
+
* except for the `number` type. */
|
|
46
|
+
maxLength?: number;
|
|
47
|
+
/** The min number for a `number` TextInput type. */
|
|
48
|
+
min?: number;
|
|
49
|
+
/** Used to reference the input element in forms. */
|
|
50
|
+
name?: string;
|
|
51
|
+
/** The action to perform on the `input`/`textarea`'s onChange function */
|
|
52
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
53
|
+
/** The action to perform on the `input`/`textarea`'s onClick function */
|
|
54
|
+
onClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
55
|
+
/** The action to perform on the `input`/`textarea`'s onFocus function */
|
|
56
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
57
|
+
/** Regex to query the user input against. */
|
|
58
|
+
pattern?: string;
|
|
59
|
+
/** Populates the placeholder for the input/textarea elements */
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
/** Allows the '(Required)' text to be changed for language purposes
|
|
62
|
+
* Note: Parenthesis will be added automatically by the component */
|
|
63
|
+
requiredLabelText?: string;
|
|
64
|
+
/** Offers the ability to hide the helper/invalid text. */
|
|
65
|
+
showHelperInvalidText?: boolean;
|
|
66
|
+
/** Offers the ability to show the label onscreen or hide it. Refer to the
|
|
67
|
+
* `labelText` property for more information. */
|
|
68
|
+
showLabel?: boolean;
|
|
69
|
+
/** Whether or not to display the "(Required)" text in the label text.
|
|
70
|
+
* True by default. */
|
|
71
|
+
showRequiredLabel?: boolean;
|
|
72
|
+
/** The amount to increase or decrease when using the number type. */
|
|
73
|
+
step?: number;
|
|
74
|
+
/** FOR INTERNAL DS USE ONLY: the input variant to display. */
|
|
75
|
+
textInputType?: TextInputVariants;
|
|
76
|
+
/** HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input */
|
|
77
|
+
type?: TextInputTypes;
|
|
78
|
+
/** Populates the value of the input/textarea elements */
|
|
79
|
+
value?: string;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* The type used for `ref`s. We want to extend both `input` and `textarea`
|
|
83
|
+
* since both are available to create through `TextInput`.
|
|
84
|
+
*/
|
|
85
|
+
export type TextInputRefType = HTMLInputElement & HTMLTextAreaElement;
|
|
86
|
+
/**
|
|
87
|
+
* Renders either an `input` element with a specified type or a `textarea`
|
|
88
|
+
* element. All types will render an accessible `Label` component and an
|
|
89
|
+
* optional `HelperErrorText` component.
|
|
90
|
+
*/
|
|
91
|
+
export declare const TextInput: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInputRefType>>, {}>;
|
|
92
|
+
export default TextInput;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
+
export declare const toggleSizesArray: readonly ["default", "small"];
|
|
4
|
+
export type ToggleSizes = typeof toggleSizesArray[number];
|
|
5
|
+
export interface ToggleProps {
|
|
6
|
+
/** Used for uncontrolled scenarios. Sets the state of the Toggle when the page first loads.
|
|
7
|
+
* If true, the toggle will be initially set to the "on" position. */
|
|
8
|
+
defaultChecked?: boolean;
|
|
9
|
+
/** Optional string to populate the HelperErrorText for standard state */
|
|
10
|
+
helperText?: HelperErrorTextType;
|
|
11
|
+
/** ID that other components can cross reference for accessibility purposes */
|
|
12
|
+
id: string;
|
|
13
|
+
/** Optional string to populate the HelperErrorText for the error state
|
|
14
|
+
* when `isInvalid` is true. */
|
|
15
|
+
invalidText?: HelperErrorTextType;
|
|
16
|
+
/** When using the Toggle as a "controlled" form element, you can specify
|
|
17
|
+
* the Toggle's checked state using this prop.
|
|
18
|
+
* Learn more about controlled and uncontrolled form fields:
|
|
19
|
+
* https://goshakkk.name/controlled-vs-uncontrolled-inputs-react/ */
|
|
20
|
+
isChecked?: boolean;
|
|
21
|
+
/** Adds the 'disabled' and `aria-disabled` attributes to the input when true.
|
|
22
|
+
* This also makes the text italic and color scheme gray. */
|
|
23
|
+
isDisabled?: boolean;
|
|
24
|
+
/** Adds the 'aria-invalid' attribute to the input when true. */
|
|
25
|
+
isInvalid?: boolean;
|
|
26
|
+
/** Adds the 'required' attribute to the input when true. */
|
|
27
|
+
isRequired?: boolean;
|
|
28
|
+
/** The toggle's label. This will serve as the text content for the `<label>` element */
|
|
29
|
+
labelText: string;
|
|
30
|
+
/** The name prop indicates the `Toggle`'s form element name. If none is
|
|
31
|
+
* specified, 'default' will be used. */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** The action to perform on the `<input>`'s onChange function */
|
|
34
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
35
|
+
/** The size of the Toggle. Defaults to "large". */
|
|
36
|
+
size?: ToggleSizes;
|
|
37
|
+
}
|
|
38
|
+
export declare const onChangeDefault: () => void;
|
|
39
|
+
/**
|
|
40
|
+
* Component that renders Chakra's `Switch` component along with NYPL defaults.
|
|
41
|
+
*/
|
|
42
|
+
export declare const Toggle: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<ToggleProps & React.RefAttributes<HTMLInputElement>>, {}>;
|
|
43
|
+
export default Toggle;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TooltipProps {
|
|
3
|
+
/** Any child node passed to the component. */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Value used to populate the tooltip content. */
|
|
6
|
+
content: string | number | React.ReactNode;
|
|
7
|
+
/** A class name for the Tooltip parent div. */
|
|
8
|
+
className?: string;
|
|
9
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
10
|
+
id?: string;
|
|
11
|
+
/** Adds the `disabled` prop to the Tooltip when true. */
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
/** Wraps the children of the tooltip in `ComponentWrapper` with `tabIndex=0` when true. */
|
|
14
|
+
shouldWrapChildren?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const Tooltip: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
17
|
+
export default Tooltip;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
+
export declare const VideoPlayerAspectRatiosArray: readonly ["fourByThree", "sixteenByNine", "square"];
|
|
4
|
+
export declare const VideoPlayerTypesArray: readonly ["vimeo", "youtube"];
|
|
5
|
+
export type VideoPlayerAspectRatios = typeof VideoPlayerAspectRatiosArray[number];
|
|
6
|
+
export type VideoPlayerTypes = typeof VideoPlayerTypesArray[number];
|
|
7
|
+
export interface VideoPlayerProps {
|
|
8
|
+
/** Optional aspect ratio prop to control the sizing of the video player; if
|
|
9
|
+
* omitted, the video player defaults to `sixteen-by-nine` */
|
|
10
|
+
aspectRatio?: VideoPlayerAspectRatios;
|
|
11
|
+
/** Optional className you can add in addition to `video-player` */
|
|
12
|
+
className?: string;
|
|
13
|
+
/** Optional string to set the text for a video description */
|
|
14
|
+
descriptionText?: string;
|
|
15
|
+
/** Optional string to set a code snippet provided by YouTube or Vimeo; the
|
|
16
|
+
* `videoPlayer` component will accept the `embedCode` prop or the `videoId`
|
|
17
|
+
* and `videoType` props */
|
|
18
|
+
embedCode?: string;
|
|
19
|
+
/** Optional string to set the text for a `Heading` component */
|
|
20
|
+
headingText?: string;
|
|
21
|
+
/** Optional string to set the text for a `HelperErrorText` component */
|
|
22
|
+
helperText?: HelperErrorTextType;
|
|
23
|
+
/** ID that other components can cross reference for accessibility purposes */
|
|
24
|
+
id?: string;
|
|
25
|
+
/** Optional title to be added to the `<iframe>` element for improved
|
|
26
|
+
* accessibility; this title should describe in a few words the content of
|
|
27
|
+
* the video; if omitted, a generic title will be added; if a `title`
|
|
28
|
+
* attribute is already present in the `embedCode` prop, this prop will be
|
|
29
|
+
* ignored */
|
|
30
|
+
iframeTitle?: string;
|
|
31
|
+
/** Offers the ability to hide the helper/invalid text. */
|
|
32
|
+
showHelperInvalidText?: boolean;
|
|
33
|
+
/** Required YouTube or Vimeo video ID. This value can be pulled from a
|
|
34
|
+
* video's YouTube or Vimeo URL. */
|
|
35
|
+
videoId?: string;
|
|
36
|
+
/** Required. Used to specify which video service is being used. */
|
|
37
|
+
videoType?: VideoPlayerTypes;
|
|
38
|
+
}
|
|
39
|
+
export declare const VideoPlayer: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<VideoPlayerProps & {
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
42
|
+
export default VideoPlayer;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SectionTypes } from "./types";
|
|
2
|
+
type ColorSection = {
|
|
3
|
+
primary: string;
|
|
4
|
+
secondary: string | null;
|
|
5
|
+
};
|
|
6
|
+
type ColorVal = string;
|
|
7
|
+
export declare function getSectionColors(type: SectionTypes, colorVal?: "primary" | "secondary"): ColorSection | ColorVal;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export declare const layoutTypesArray: readonly ["column", "row"];
|
|
2
|
+
export type LayoutTypes = typeof layoutTypesArray[number];
|
|
3
|
+
export declare const sectionDataMap: {
|
|
4
|
+
blogs: {
|
|
5
|
+
primary: string;
|
|
6
|
+
secondary: string;
|
|
7
|
+
};
|
|
8
|
+
booksAndMore: {
|
|
9
|
+
primary: string;
|
|
10
|
+
secondary: string;
|
|
11
|
+
};
|
|
12
|
+
brand: {
|
|
13
|
+
primary: string;
|
|
14
|
+
secondary: string;
|
|
15
|
+
};
|
|
16
|
+
connect: {
|
|
17
|
+
primary: string;
|
|
18
|
+
secondary: string;
|
|
19
|
+
};
|
|
20
|
+
education: {
|
|
21
|
+
primary: string;
|
|
22
|
+
secondary: string;
|
|
23
|
+
};
|
|
24
|
+
locations: {
|
|
25
|
+
primary: string;
|
|
26
|
+
secondary: string;
|
|
27
|
+
};
|
|
28
|
+
research: {
|
|
29
|
+
primary: string;
|
|
30
|
+
secondary: string;
|
|
31
|
+
};
|
|
32
|
+
researchLibraryLpa: {
|
|
33
|
+
primary: string;
|
|
34
|
+
secondary: any;
|
|
35
|
+
};
|
|
36
|
+
researchLibrarySchomburg: {
|
|
37
|
+
primary: string;
|
|
38
|
+
secondary: any;
|
|
39
|
+
};
|
|
40
|
+
researchLibrarySchwarzman: {
|
|
41
|
+
primary: string;
|
|
42
|
+
secondary: any;
|
|
43
|
+
};
|
|
44
|
+
whatsOn: {
|
|
45
|
+
primary: string;
|
|
46
|
+
secondary: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare const sectionTypeArray: string[];
|
|
50
|
+
export type SectionTypes = typeof sectionTypeArray[number];
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook that controls the sliding function for the carousel wrapper.
|
|
3
|
+
* This returns functions to use for the "previous" and "next" buttons as well
|
|
4
|
+
* as a CSS style object that should be use to transition between slides. There
|
|
5
|
+
* is also a function to programmatically slide to the first slide.
|
|
6
|
+
* Inspired by: https://codesandbox.io/s/fxjeo
|
|
7
|
+
*/
|
|
8
|
+
export declare const useCarouselStyles: (slidesCount?: number, slideWidth?: number) => {
|
|
9
|
+
prevSlide: () => void;
|
|
10
|
+
nextSlide: () => void;
|
|
11
|
+
carouselStyle: {
|
|
12
|
+
transition: string;
|
|
13
|
+
marginStart: string;
|
|
14
|
+
};
|
|
15
|
+
goToStart: () => void;
|
|
16
|
+
};
|
|
17
|
+
export default useCarouselStyles;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Close dropdowns when clicking outside of them or by pressing
|
|
3
|
+
* the escape key. It expects an action callback that will set
|
|
4
|
+
* the dropdown state to false (close).
|
|
5
|
+
*/
|
|
6
|
+
declare const useCloseDropDown: (actionCb: (val: boolean) => void, ref: React.RefObject<HTMLDivElement>) => void;
|
|
7
|
+
export default useCloseDropDown;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This hook is used to determine if the current screen size is larger than
|
|
3
|
+
* the specific NYPL breakpoint values. The returned value is an object with
|
|
4
|
+
* boolean values for each breakpoint.
|
|
5
|
+
*/
|
|
6
|
+
declare const useNYPLBreakpoints: () => {
|
|
7
|
+
isLargerThanSmall: any;
|
|
8
|
+
isLargerThanMedium: any;
|
|
9
|
+
isLargerThanMobile: any;
|
|
10
|
+
isLargerThanLarge: any;
|
|
11
|
+
isLargerThanXLarge: any;
|
|
12
|
+
};
|
|
13
|
+
export default useNYPLBreakpoints;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom hook that returns the Chakra-based NYPL theme object. This must be
|
|
3
|
+
* used inside a component that is wrapped in the `DSProvider` component, so
|
|
4
|
+
* that the theme object can be available to use.
|
|
5
|
+
*/
|
|
6
|
+
declare function useNYPLTheme(): {
|
|
7
|
+
breakpoints?: undefined;
|
|
8
|
+
colors?: undefined;
|
|
9
|
+
fontSizes?: undefined;
|
|
10
|
+
fontWeights?: undefined;
|
|
11
|
+
fonts?: undefined;
|
|
12
|
+
radii?: undefined;
|
|
13
|
+
space?: undefined;
|
|
14
|
+
} | {
|
|
15
|
+
breakpoints: any;
|
|
16
|
+
colors: {
|
|
17
|
+
brand: any;
|
|
18
|
+
dark: any;
|
|
19
|
+
section: any;
|
|
20
|
+
transparent: any;
|
|
21
|
+
ui: any;
|
|
22
|
+
};
|
|
23
|
+
fontSizes: {
|
|
24
|
+
"-3": any;
|
|
25
|
+
"-2": any;
|
|
26
|
+
"-1": any;
|
|
27
|
+
"0": any;
|
|
28
|
+
"1": any;
|
|
29
|
+
"2": any;
|
|
30
|
+
"3": any;
|
|
31
|
+
"4": any;
|
|
32
|
+
breadcrumbs: any;
|
|
33
|
+
button: any;
|
|
34
|
+
desktop: any;
|
|
35
|
+
heading: any;
|
|
36
|
+
helper: any;
|
|
37
|
+
label: any;
|
|
38
|
+
mobile: any;
|
|
39
|
+
text: any;
|
|
40
|
+
};
|
|
41
|
+
fontWeights: {
|
|
42
|
+
light: any;
|
|
43
|
+
regular: any;
|
|
44
|
+
medium: any;
|
|
45
|
+
semibold: any;
|
|
46
|
+
bold: any;
|
|
47
|
+
body: any;
|
|
48
|
+
breadcrumbs: any;
|
|
49
|
+
button: any;
|
|
50
|
+
caption: any;
|
|
51
|
+
default: any;
|
|
52
|
+
heading: any;
|
|
53
|
+
helper: any;
|
|
54
|
+
label: any;
|
|
55
|
+
overline: any;
|
|
56
|
+
subtitle: any;
|
|
57
|
+
text: any;
|
|
58
|
+
};
|
|
59
|
+
fonts: {
|
|
60
|
+
body: any;
|
|
61
|
+
heading: any;
|
|
62
|
+
};
|
|
63
|
+
radii: any;
|
|
64
|
+
space: {
|
|
65
|
+
xxs: any;
|
|
66
|
+
xs: any;
|
|
67
|
+
s: any;
|
|
68
|
+
m: any;
|
|
69
|
+
l: any;
|
|
70
|
+
xl: any;
|
|
71
|
+
xxl: any;
|
|
72
|
+
xxxl: any;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
export default useNYPLTheme;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DS internal helper hook to use state with prop dependencies.
|
|
3
|
+
*
|
|
4
|
+
* This hook should NOT be used by consuming apps. DS components should use this hook rather than useState() whenever
|
|
5
|
+
* a change in state is expected for a given prop from a consuming app. The hook updates the DS component with useEffect().
|
|
6
|
+
*/
|
|
7
|
+
declare function useStateWithDependencies(initialValue: any): typeof initialValue;
|
|
8
|
+
export default useStateWithDependencies;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
interface WindowSize {
|
|
2
|
+
width: number;
|
|
3
|
+
height: number;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* React hook used to get the window size on device resizing.
|
|
7
|
+
* Based on https://usehooks-typescript.com/react-hook/use-window-size
|
|
8
|
+
*/
|
|
9
|
+
declare function useWindowSize(): WindowSize;
|
|
10
|
+
export default useWindowSize;
|