@nypl/design-system-react-components 1.0.1 → 1.0.3

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 (129) hide show
  1. package/CHANGELOG.md +1452 -3
  2. package/README.md +389 -3
  3. package/dist/__tests__/fileMock.d.ts +4 -0
  4. package/dist/__tests__/setup.d.ts +2 -0
  5. package/{lib/stories/0-Welcome.stories.d.ts → dist/__tests__/utils/utils.test.d.ts} +1 -1
  6. package/dist/components/Accordion/Accordion.d.ts +21 -0
  7. package/dist/components/Autosuggest/Autosuggest.stories.d.ts +4 -0
  8. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
  9. package/dist/components/Button/Button.d.ts +25 -0
  10. package/dist/components/ButtonGroup/ButtonGroup.d.ts +22 -0
  11. package/dist/components/Card/Card.d.ts +51 -0
  12. package/dist/components/Checkbox/Checkbox.d.ts +47 -0
  13. package/dist/components/CheckboxGroup/CheckboxGroup.d.ts +49 -0
  14. package/dist/components/ComponentWrapper/ComponentWrapper.d.ts +29 -0
  15. package/dist/components/DatePicker/DatePicker.d.ts +81 -0
  16. package/dist/components/Fieldset/Fieldset.d.ts +22 -0
  17. package/dist/components/Form/Form.d.ts +29 -0
  18. package/dist/components/Grid/SimpleGrid.d.ts +17 -0
  19. package/dist/components/Heading/Heading.d.ts +27 -0
  20. package/dist/components/HelperErrorText/HelperErrorText.d.ts +29 -0
  21. package/dist/components/Hero/Hero.d.ts +40 -0
  22. package/dist/components/HorizontalRule/HorizontalRule.d.ts +11 -0
  23. package/dist/components/Icons/Icon.d.ts +37 -0
  24. package/dist/components/Icons/IconSvgs.d.ts +33 -0
  25. package/dist/components/Image/Image.d.ts +61 -0
  26. package/dist/components/Label/Label.d.ts +20 -0
  27. package/dist/components/Link/Link.d.ts +20 -0
  28. package/dist/components/List/List.d.ts +35 -0
  29. package/dist/components/Logo/Logo.d.ts +26 -0
  30. package/dist/components/Logo/LogoSvgs.d.ts +48 -0
  31. package/dist/components/Modal/Modal.d.ts +33 -0
  32. package/dist/components/Notification/Notification.d.ts +50 -0
  33. package/dist/components/Pagination/Pagination.d.ts +27 -0
  34. package/dist/components/Placeholder/Placeholder.d.ts +10 -0
  35. package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +30 -0
  36. package/dist/components/Radio/Radio.d.ts +43 -0
  37. package/dist/components/RadioGroup/RadioGroup.d.ts +51 -0
  38. package/dist/components/SearchBar/SearchBar.d.ts +61 -0
  39. package/dist/components/Select/Select.d.ts +57 -0
  40. package/dist/components/SkeletonLoader/SkeletonLoader.d.ts +39 -0
  41. package/dist/components/SkipNavigation/SkipNavigation.d.ts +17 -0
  42. package/dist/components/Slider/Slider.d.ts +59 -0
  43. package/dist/components/StatusBadge/StatusBadge.d.ts +16 -0
  44. package/dist/components/StructuredContent/StructuredContent.d.ts +28 -0
  45. package/dist/components/StyleGuide/ColorCard.d.ts +12 -0
  46. package/dist/components/Table/Table.d.ts +30 -0
  47. package/dist/components/Tabs/Tabs.d.ts +26 -0
  48. package/dist/components/Template/Template.d.ts +126 -0
  49. package/dist/components/Text/Text.d.ts +16 -0
  50. package/dist/components/TextInput/TextInput.d.ts +79 -0
  51. package/dist/components/Toggle/Toggle.d.ts +42 -0
  52. package/dist/components/VideoPlayer/VideoPlayer.d.ts +38 -0
  53. package/dist/design-system-react-components.cjs.development.js +11648 -0
  54. package/dist/design-system-react-components.cjs.development.js.map +1 -0
  55. package/dist/design-system-react-components.cjs.production.min.js +2 -0
  56. package/dist/design-system-react-components.cjs.production.min.js.map +1 -0
  57. package/dist/design-system-react-components.esm.js +11493 -0
  58. package/dist/design-system-react-components.esm.js.map +1 -0
  59. package/dist/helpers/types.d.ts +1 -0
  60. package/dist/hooks/__tests__/useCarouselStyles.test.d.ts +1 -0
  61. package/dist/hooks/useCarouselStyles.d.ts +17 -0
  62. package/dist/hooks/useNYPLTheme.d.ts +66 -0
  63. package/dist/hooks/useWindowSize.d.ts +10 -0
  64. package/dist/index.d.ts +48 -0
  65. package/dist/index.js +8 -0
  66. package/dist/resources.scss +386 -0
  67. package/dist/styles.css +3 -0
  68. package/dist/theme/components/accordion.d.ts +20 -0
  69. package/dist/theme/components/breadcrumb.d.ts +105 -0
  70. package/dist/theme/components/button.d.ts +120 -0
  71. package/dist/theme/components/buttonGroup.d.ts +11 -0
  72. package/dist/theme/components/card.d.ts +381 -0
  73. package/dist/theme/components/checkbox.d.ts +95 -0
  74. package/dist/theme/components/checkboxGroup.d.ts +14 -0
  75. package/dist/theme/components/componentWrapper.d.ts +12 -0
  76. package/dist/theme/components/customTable.d.ts +624 -0
  77. package/dist/theme/components/datePicker.d.ts +16 -0
  78. package/dist/theme/components/fieldset.d.ts +20 -0
  79. package/dist/theme/components/global.d.ts +73 -0
  80. package/dist/theme/components/globalMixins.d.ts +23 -0
  81. package/dist/theme/components/heading.d.ts +160 -0
  82. package/dist/theme/components/helperErrorText.d.ts +12 -0
  83. package/dist/theme/components/hero.d.ts +499 -0
  84. package/dist/theme/components/horizontalRule.d.ts +15 -0
  85. package/dist/theme/components/icon.d.ts +47755 -0
  86. package/dist/theme/components/image.d.ts +590 -0
  87. package/dist/theme/components/label.d.ts +18 -0
  88. package/dist/theme/components/link.d.ts +62 -0
  89. package/dist/theme/components/list.d.ts +182 -0
  90. package/dist/theme/components/logo.d.ts +477 -0
  91. package/dist/theme/components/notification.d.ts +95 -0
  92. package/dist/theme/components/pagination.d.ts +16 -0
  93. package/dist/theme/components/progressIndicator.d.ts +52 -0
  94. package/dist/theme/components/radio.d.ts +107 -0
  95. package/dist/theme/components/radioGroup.d.ts +14 -0
  96. package/dist/theme/components/searchBar.d.ts +18 -0
  97. package/dist/theme/components/select.d.ts +82 -0
  98. package/dist/theme/components/skeletonLoader.d.ts +102 -0
  99. package/dist/theme/components/skipNavigation.d.ts +25 -0
  100. package/dist/theme/components/slider.d.ts +59 -0
  101. package/dist/theme/components/statusBadge.d.ts +25 -0
  102. package/dist/theme/components/structuredContent.d.ts +326 -0
  103. package/dist/theme/components/tabs.d.ts +136 -0
  104. package/dist/theme/components/template.d.ts +108 -0
  105. package/dist/theme/components/text.d.ts +26 -0
  106. package/dist/theme/components/textInput.d.ts +124 -0
  107. package/dist/theme/components/toggle.d.ts +93 -0
  108. package/dist/theme/components/videoPlayer.d.ts +40 -0
  109. package/dist/theme/foundations/breakpoints.d.ts +23 -0
  110. package/dist/theme/foundations/colors.d.ts +3 -0
  111. package/dist/theme/foundations/global.d.ts +58 -0
  112. package/dist/theme/foundations/radii.d.ts +6 -0
  113. package/dist/theme/foundations/shadows.d.ts +4 -0
  114. package/dist/theme/foundations/spacing.d.ts +82 -0
  115. package/dist/theme/foundations/typography.d.ts +8 -0
  116. package/dist/theme/index.d.ts +20 -0
  117. package/dist/theme/provider.d.ts +3 -0
  118. package/dist/theme/types.d.ts +1 -0
  119. package/dist/utils/componentCategories.d.ts +1 -0
  120. package/dist/utils/interfaces.d.ts +5 -0
  121. package/dist/utils/utils.d.ts +31 -0
  122. package/package.json +132 -20
  123. package/lib/components/Button/Button.d.ts +0 -17
  124. package/lib/components/Button/Button.js +0 -42
  125. package/lib/index.d.ts +0 -1
  126. package/lib/index.js +0 -6
  127. package/lib/stories/0-Welcome.stories.js +0 -19
  128. package/lib/stories/1-Button.stories.d.ts +0 -6
  129. package/lib/stories/1-Button.stories.js +0 -20
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ export interface ComponentWrapperProps {
4
+ /** The UI elements that will be wrapped by this component */
5
+ children: React.ReactNode;
6
+ /** A class name for the `div` parent element. */
7
+ className?: string;
8
+ /** Optional string to set the text for the component's description */
9
+ descriptionText?: string;
10
+ /** Optional string to set the text for a `Heading` component */
11
+ headingText?: string;
12
+ /** Optional string to set the text for a `HelperErrorText` component */
13
+ helperText?: HelperErrorTextType;
14
+ /** Styles that target the helper text. */
15
+ helperTextStyles?: {
16
+ [key: string]: any;
17
+ };
18
+ /** ID that other components can cross reference for accessibility purposes */
19
+ id?: string;
20
+ /** Optional string to populate the `HelperErrorText` for the error state
21
+ * when `isInvalid` is true. */
22
+ invalidText?: HelperErrorTextType;
23
+ /** Sets invalid text in the error state. */
24
+ isInvalid?: boolean;
25
+ /** Offers the ability to hide the helper/invalid text. */
26
+ showHelperInvalidText?: boolean;
27
+ }
28
+ export declare const ComponentWrapper: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<ComponentWrapperProps>) => JSX.Element, {}>;
29
+ export default ComponentWrapper;
@@ -0,0 +1,81 @@
1
+ import React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ import { TextInputRefType } from "../TextInput/TextInput";
4
+ export declare type DatePickerTypes = "full" | "month" | "year";
5
+ export interface FullDateType {
6
+ /** Date object that gets returned for the onChange
7
+ * function only for date ranges. */
8
+ endDate?: Date;
9
+ /** Date object that gets returned for the onChange function. */
10
+ startDate: Date;
11
+ }
12
+ interface DateRangeRowProps {
13
+ /** ID that other components can cross reference for accessibility purposes. */
14
+ id: string;
15
+ /** Whether to render a single date input or two for a range of two dates. */
16
+ isDateRange?: boolean;
17
+ }
18
+ interface DatePickerWrapperProps extends DateRangeRowProps {
19
+ /** Additional className. */
20
+ className?: string;
21
+ /** Adds the 'required' property to the input element(s). */
22
+ isRequired?: boolean;
23
+ /** Passed to the `TextInput` component to render a label associated with an input field. */
24
+ labelText: string;
25
+ /** Offers the ability to show the label onscreen or hide it. */
26
+ showLabel?: boolean;
27
+ /** Whether or not to display the "(Required)" text in the label text.
28
+ * True by default. */
29
+ showRequiredLabel?: boolean;
30
+ }
31
+ export interface DatePickerProps extends DatePickerWrapperProps {
32
+ /** The date format to display. Defaults to "yyyy-MM-dd".
33
+ * Must be in ISO-8601 format. */
34
+ dateFormat?: string;
35
+ /** DatePicker date types that can be rendered. */
36
+ dateType?: DatePickerTypes;
37
+ /** Populates the `HelperErrorText` component in this component. */
38
+ helperText?: HelperErrorTextType;
39
+ /** Populates the `HelperErrorText` component in the "From" `TextInput` component. */
40
+ helperTextFrom?: string;
41
+ /** Populates the `HelperErrorText` component in the "To" `TextInput` component. */
42
+ helperTextTo?: string;
43
+ /** The initial date value. This must be in the mm/dd/yyyy format. */
44
+ initialDate?: string;
45
+ /** The initialTo date value used for date ranges.
46
+ * This must be in the mm/dd/yyyy format. */
47
+ initialDateTo?: string;
48
+ /** Populates the `HelperErrorText` error state for both "From"
49
+ * and "To" input components. */
50
+ invalidText?: HelperErrorTextType;
51
+ /** Adds the 'disabled' property to the input element(s). */
52
+ isDisabled?: boolean;
53
+ /** Adds 'isInvalid' styling. */
54
+ isInvalid?: boolean;
55
+ /** Adds the 'required' property to the input element(s). */
56
+ isRequired?: boolean;
57
+ /** The maximum date value that applies to both input fields.
58
+ * This must be in the mm/dd/yyyy format. */
59
+ maxDate?: string;
60
+ /** The minimum date value that applies to both input fields.
61
+ * This must be in the mm/dd/yyyy format. */
62
+ minDate?: string;
63
+ /** Value name for the single input field or the "From" input field in a date range. */
64
+ nameFrom?: string;
65
+ /** Value name for the "To" input field */
66
+ nameTo?: string;
67
+ /** The action to perform on the `input`'s onChange function for both fields.
68
+ * This will return the data in an object with `startDate` and `endDate` keys.
69
+ */
70
+ onChange?: (data: FullDateType) => void;
71
+ /** An additional explicit React ref passed for a date range's "To"
72
+ * input field. Note that the "From" input takes the initial "ref" value. */
73
+ refTo?: React.Ref<TextInputRefType>;
74
+ /** Offers the ability to hide the helper/invalid text. */
75
+ showHelperInvalidText?: boolean;
76
+ }
77
+ /**
78
+ * Returns a single date input field or two date input fields for a date range.
79
+ */
80
+ export declare const DatePicker: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<TextInputRefType>>, {}>;
81
+ export default DatePicker;
@@ -0,0 +1,22 @@
1
+ import React from "react";
2
+ interface FieldsetProps {
3
+ /** Additional class name to add. */
4
+ className?: string;
5
+ /** ID that other components can cross reference for accessibility purposes */
6
+ id: string;
7
+ /** Flag to show or hide the text in the `legend` element. False by default. */
8
+ isLegendHidden?: boolean;
9
+ /** Flag to render "Required" in the `legend`. True by default. */
10
+ isRequired?: boolean;
11
+ /** Text to display in the `legend` element. */
12
+ legendText?: string;
13
+ /** Whether or not to display the "(Required)" text in the `legend` text.
14
+ * True by default. */
15
+ showRequiredLabel?: boolean;
16
+ }
17
+ /**
18
+ * A wrapper component that renders a `fieldset` element along with a `legend`
19
+ * element as its first child. Commonly used to wrap form components.
20
+ */
21
+ export declare const Fieldset: import("@chakra-ui/react").ChakraComponent<({ children, className, id, isLegendHidden, isRequired, legendText, showRequiredLabel, ...rest }: React.PropsWithChildren<FieldsetProps>) => JSX.Element, {}>;
22
+ export default Fieldset;
@@ -0,0 +1,29 @@
1
+ import * as React from "react";
2
+ import { GridGaps } from "../Grid/SimpleGrid";
3
+ interface FormBaseProps {
4
+ /** className to be applied to FormRow, FormField, and Form */
5
+ className?: string;
6
+ /** Optional spacing size; if omitted, the default `large` (2rem / 32px)
7
+ * spacing will be used; ```IMPORTANT: for general form layout, this prop
8
+ * should not be used``` */
9
+ gap?: GridGaps;
10
+ /** ID that other components can cross reference (internal use) */
11
+ id: string;
12
+ }
13
+ export interface FormChildProps extends Partial<FormBaseProps> {
14
+ }
15
+ export interface FormProps extends FormBaseProps {
16
+ /** Optional form `action` attribute */
17
+ action?: string;
18
+ /** Optional form `method` attribute */
19
+ method?: "get" | "post";
20
+ /** Function to call for the `onSubmit` form event. */
21
+ onSubmit?: (e: React.FormEvent<HTMLFormElement>) => void;
22
+ }
23
+ /** FormRow child-component */
24
+ export declare const FormRow: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<FormChildProps>) => JSX.Element, {}>;
25
+ /** FormField child-component */
26
+ export declare const FormField: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<FormChildProps>) => JSX.Element, {}>;
27
+ /** Main Form component */
28
+ export declare const Form: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<FormProps>) => JSX.Element, {}>;
29
+ export default Form;
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ export declare type GridGaps = "grid.xxs" | "grid.xs" | "grid.s" | "grid.m" | "grid.l" | "grid.xl" | "grid.xxl";
3
+ export interface SimpleGridProps {
4
+ /** Additional class name. */
5
+ className?: string;
6
+ /** Optional numeric value to override the default column count; the default
7
+ * column count is 3. */
8
+ columns?: number;
9
+ /** Optional gap size; if omitted, the default `large` (2rem / 32px) spacing
10
+ * will be used; `IMPORTANT: for standard grid layouts, this prop should
11
+ * not be used.` */
12
+ gap?: GridGaps;
13
+ /** ID that other components can cross reference for accessibility purposes */
14
+ id?: string;
15
+ }
16
+ export declare const SimpleGrid: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<SimpleGridProps>) => JSX.Element, {}>;
17
+ export default SimpleGrid;
@@ -0,0 +1,27 @@
1
+ import * as React from "react";
2
+ export declare type HeadingSizes = "primary" | "secondary" | "tertiary" | "callout";
3
+ export declare type HeadingLevels = "one" | "two" | "three" | "four" | "five" | "six";
4
+ export interface HeadingProps {
5
+ /** Optional className that appears in addition to `heading` */
6
+ className?: string;
7
+ /** Optional ID that other components can cross reference for accessibility purposes */
8
+ id?: string;
9
+ /** Optional number 1-6 used to create the `<h*>` tag; if prop is not passed,
10
+ * `Heading` will default to `<h2>` */
11
+ level?: HeadingLevels;
12
+ /** Optional size used to override the default styles of the semantic HTM
13
+ * `<h>` elements */
14
+ size?: HeadingSizes;
15
+ /** Optional prop used to remove default spacing */
16
+ noSpace?: boolean;
17
+ /** Inner text of the `<h*>` element */
18
+ text?: string;
19
+ /** Optional URL that header points to; when `url` prop is passed to
20
+ * `Heading`, a child `<a>` element is created and the heading text becomes
21
+ * an active link */
22
+ url?: string;
23
+ /** Optional className for the URL when the `url` prop is passed */
24
+ urlClass?: string;
25
+ }
26
+ export declare const Heading: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<HeadingProps>) => JSX.Element, {}>;
27
+ export default Heading;
@@ -0,0 +1,29 @@
1
+ /// <reference types="react" />
2
+ export declare type AriaLiveValues = "assertive" | "off" | "polite";
3
+ export declare type HelperErrorTextType = string | JSX.Element;
4
+ interface HelperErrorTextProps {
5
+ /** Aria attribute. When true, assistive technologies will
6
+ * read the entire DOM element. When false, only changes (additionals or
7
+ * removals) will be read. True by default. */
8
+ ariaAtomic?: boolean;
9
+ /** Aria attribute used in the invalid state to read error text by default.
10
+ * This indicates the priority of the text and when it should be presented to
11
+ * users using screen readers; "off" indicates that the content should not be
12
+ * presented, "polite" that it will be announced at the next available time
13
+ * slot, and "assertive" that it should be announced immediately. This is set
14
+ * to "off" by default and to "polite" by when `isInvalid` is true. */
15
+ ariaLive?: AriaLiveValues;
16
+ /** Additional className to add. */
17
+ className?: string;
18
+ /** Unique ID for accessibility purposes. */
19
+ id?: string;
20
+ /** Toggles between helper and invalid styling. */
21
+ isInvalid?: boolean;
22
+ /** The text to display. */
23
+ text: HelperErrorTextType;
24
+ }
25
+ /**
26
+ * Helper or error text for forms components.
27
+ */
28
+ export declare const HelperErrorText: import("@chakra-ui/react").ChakraComponent<({ ariaAtomic, ariaLive, className, id, isInvalid, text, ...rest }: HelperErrorTextProps) => JSX.Element, {}>;
29
+ export default HelperErrorText;
@@ -0,0 +1,40 @@
1
+ import * as React from "react";
2
+ import { ComponentImageProps } from "../Image/Image";
3
+ export declare type HeroTypes = "primary" | "secondary" | "secondaryBooksAndMore" | "secondaryLocations" | "secondaryResearch" | "secondaryWhatsOn" | "tertiary" | "campaign" | "fiftyFifty";
4
+ export declare const heroSecondaryTypes: string[];
5
+ export interface HeroImageProps extends Pick<ComponentImageProps, "alt" | "src"> {
6
+ }
7
+ export interface HeroProps {
8
+ /** Optional hex color value used to override the default background
9
+ * color for a given `Hero` variation.
10
+ * Note: not all `Hero` variations utilize this prop. */
11
+ backgroundColor?: string;
12
+ /** Optional path to an image that will be used as a background image for the
13
+ * `Hero` component.
14
+ * Note: not all `Hero` variations utilize this prop. */
15
+ backgroundImageSrc?: string;
16
+ /** Optional hex color value used to override the default text color for a
17
+ * given `Hero` variation.
18
+ * Note: not all `Hero` variations utilize this prop. */
19
+ foregroundColor?: string;
20
+ /** Optional heading element. */
21
+ heading?: JSX.Element;
22
+ /** Used to control how the `Hero` component will be rendered. */
23
+ heroType?: HeroTypes;
24
+ /** Object used to create and render the `Image` component. Note that only
25
+ * `src` and `alt` are the available attributes to pass. If `imageProps.alt`
26
+ * is left blank, a warning will be logged to the console and will cause
27
+ * accessibility issues. For `imageProps.src`, it will only work for the
28
+ * "secondary", "fiftyFifty" and "campaign" `Hero` types; Note: `imageProps.src`
29
+ * can only be used in conjunction with `backgroundImageSrc` for the "campaign"
30
+ * `Hero` type. Note: not all `Hero` variations utilize this prop. */
31
+ imageProps?: HeroImageProps;
32
+ /** Optional details area that contains location data.
33
+ * Note: not all `Hero` variations utilize this prop. */
34
+ locationDetails?: JSX.Element;
35
+ /** Optional string used for the subheader that displays
36
+ * underneath the heading element. */
37
+ subHeaderText?: string | JSX.Element;
38
+ }
39
+ export declare const Hero: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<HeroProps>) => JSX.Element, {}>;
40
+ export default Hero;
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ export interface HorizontalRuleProps {
3
+ /** Optional alignment value to align the horizontal rule to one side or the
4
+ * other when the width is less than 100%. If omitted, the horizontal rule
5
+ * will have a default center alignment. */
6
+ align?: "left" | "right";
7
+ /** ClassName you can add in addition to `horizontal-rule` */
8
+ className?: string;
9
+ }
10
+ export declare const HorizontalRule: import("@chakra-ui/react").ChakraComponent<(props: HorizontalRuleProps) => JSX.Element, {}>;
11
+ export default HorizontalRule;
@@ -0,0 +1,37 @@
1
+ import * as React from "react";
2
+ export declare type IconAlign = "left" | "right" | "none";
3
+ export declare type IconColors = "ui.black" | "ui.white" | "brand.primary" | "brand.secondary" | "section.blogs.primary" | "section.blogs.secondary" | "section.books-and-more.primary" | "section.books-and-more.secondary" | "section.education.primary" | "section.education.secondary" | "section.locations.primary" | "section.locations.secondary" | "section.research.primary" | "section.research.secondary" | "section.research-library.lpa" | "section.research-library.schomburg" | "section.research-library.schwartzman" | "section.whats-on.primary" | "section.whats-on.secondary";
4
+ export declare type IconNames = "accessibilityFull" | "accessibilityPartial" | "actionCheckCircle" | "actionHelpDefault" | "actionHelpOutline" | "actionLaunch" | "alertNotificationImportant" | "arrow" | "check" | "clock" | "close" | "download" | "errorFilled" | "errorOutline" | "fileTypeAudio" | "fileTypeDoc" | "fileTypeGenericDoc" | "fileTypeImage" | "fileTypePdf" | "fileTypeSpreadsheet" | "fileTypeVideo" | "headset" | "minus" | "plus" | "search" | "speakerNotes" | "utilityAccountFilled" | "utilityAccountUnfilled" | "utilityHamburger" | "utilitySearch";
5
+ export declare type IconRotationTypes = "rotate0" | "rotate90" | "rotate180" | "rotate270";
6
+ export declare type IconSizes = "default" | "small" | "medium" | "large" | "xlarge" | "xxlarge" | "xxxlarge";
7
+ export declare type IconTypes = "default" | "breadcrumbs";
8
+ export interface IconProps {
9
+ /** Aligns the icon. */
10
+ align?: IconAlign;
11
+ /** Optional className that will be added to the parent element */
12
+ className?: string;
13
+ /** Overrides default icon color (black). */
14
+ color?: IconColors;
15
+ /** Icons designated as decorative will be ignored by screenreaders. True
16
+ * by default. */
17
+ decorative?: boolean;
18
+ /** Rotates the icon clockwise in increments of 90deg */
19
+ iconRotation?: IconRotationTypes;
20
+ /** ID that other components can cross reference for accessibility purposes */
21
+ id?: string;
22
+ /** The name of the icon you want to use. */
23
+ name?: IconNames;
24
+ /** Sets the icon size. */
25
+ size?: IconSizes;
26
+ /** For accessibility purposes, the text passed in the `title` prop gets
27
+ * rendered in a `title` element in the SVG. This descriptive text is not
28
+ * visible but is needed for screenreaders to describe the graphic. */
29
+ title?: string;
30
+ /** FOR INTERNAL DS USE ONLY: the icon variant to display. */
31
+ type?: IconTypes;
32
+ }
33
+ /**
34
+ * Renders SVG-based icons.
35
+ */
36
+ export declare const Icon: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<IconProps>) => JSX.Element, {}>;
37
+ export default Icon;
@@ -0,0 +1,33 @@
1
+ declare const _default: {
2
+ accessibilityFull: string;
3
+ accessibilityPartial: string;
4
+ actionCheckCircle: string;
5
+ actionHelpDefault: string;
6
+ actionHelpOutline: string;
7
+ actionLaunch: string;
8
+ alertNotificationImportant: string;
9
+ arrow: string;
10
+ check: string;
11
+ clock: string;
12
+ close: string;
13
+ download: string;
14
+ errorFilled: string;
15
+ errorOutline: string;
16
+ fileTypeAudio: string;
17
+ fileTypeDoc: string;
18
+ fileTypeGenericDoc: string;
19
+ fileTypeImage: string;
20
+ fileTypePdf: string;
21
+ fileTypeSpreadsheet: string;
22
+ fileTypeVideo: string;
23
+ headset: string;
24
+ minus: string;
25
+ plus: string;
26
+ search: string;
27
+ speakerNotes: string;
28
+ utilityAccountFilled: string;
29
+ utilityAccountUnfilled: string;
30
+ utilityHamburger: string;
31
+ utilitySearch: string;
32
+ };
33
+ export default _default;
@@ -0,0 +1,61 @@
1
+ /// <reference types="react" />
2
+ export declare type ImageRatios = "fourByThree" | "oneByTwo" | "original" | "sixteenByNine" | "square" | "threeByFour" | "threeByTwo" | "twoByOne";
3
+ export declare type ImageSizes = "default" | "xxsmall" | "xsmall" | "small" | "medium" | "large";
4
+ export declare type ImageTypes = "default" | "circle";
5
+ export interface ComponentImageProps {
6
+ /** String value used to populate the `alt` attribute of the internal `Image`
7
+ * component's `img` element. @NOTE if an image is used, this value must be passed. */
8
+ alt?: string;
9
+ /** Optional value to control the aspect ratio of the internal `Image` component.
10
+ * Defaults to `ImageRatios.Square`. */
11
+ aspectRatio?: ImageRatios;
12
+ /** Optional value to render as a caption for the internal `Image` component. */
13
+ caption?: string;
14
+ /** Optional DOM element to use instead of the DS `Image` component. */
15
+ component?: JSX.Element;
16
+ /** Optional value to render as a credit for the internal `Image` component. */
17
+ credit?: string;
18
+ /** Optional value to control the size of the internal `Image` component.
19
+ * Defaults to `ImageSizes.Default`. */
20
+ size?: ImageSizes;
21
+ /** Optional value that contains the path to an image. If omitted, the internal
22
+ * DS `Image` component will not render. */
23
+ src?: string;
24
+ }
25
+ interface ImageWrapperProps {
26
+ /** Optionally pass in additional Chakra-based styles. */
27
+ additionalWrapperStyles?: {
28
+ [key: string]: any;
29
+ };
30
+ /** ClassName you can add in addition to 'image' */
31
+ className?: string;
32
+ /** Optional value to control the aspect ratio of the card image; default
33
+ * value is `"original"` */
34
+ aspectRatio?: ImageRatios;
35
+ /** Optional value to control the size of the image */
36
+ size?: ImageSizes;
37
+ }
38
+ export interface ImageProps extends ImageWrapperProps {
39
+ /** Optionally pass in additional Chakra-based styles only for the figure. */
40
+ additionalFigureStyles?: {
41
+ [key: string]: any;
42
+ };
43
+ /** Optionally pass in additional Chakra-based styles only for the image. */
44
+ additionalImageStyles?: {
45
+ [key: string]: any;
46
+ };
47
+ /** Alternate text description of the image */
48
+ alt?: string;
49
+ /** Adding will wrap the image in a <figure> */
50
+ caption?: string;
51
+ /** Custom image component */
52
+ component?: JSX.Element | null;
53
+ /** Adding will wrap the image in a <figure> */
54
+ credit?: string;
55
+ /** Optional value for the image type */
56
+ imageType?: ImageTypes;
57
+ /** The src attribute is required, and contains the path to the image you want to embed. */
58
+ src?: string;
59
+ }
60
+ export declare const Image: import("@chakra-ui/react").ChakraComponent<(props: ImageProps) => JSX.Element, {}>;
61
+ export default Image;
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ interface LabelProps {
3
+ /** Additional CSS class name to render in the `label` element. */
4
+ className?: string;
5
+ /** The id of the html element that this `Label` is describing. */
6
+ htmlFor: string;
7
+ /** ID that other components can cross reference for accessibility purposes */
8
+ id?: string;
9
+ /** Controls whether the label should be inline with the input it goes with.
10
+ * This prop should only be used internally. */
11
+ isInlined?: boolean;
12
+ /** Controls whether the "(Required)" text should be displayed alongside the
13
+ * label's text. False by default. */
14
+ isRequired?: boolean;
15
+ }
16
+ /**
17
+ * A label for form inputs. It should never be used alone.
18
+ */
19
+ export declare const Label: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<LabelProps>) => JSX.Element, {}>;
20
+ export default Label;
@@ -0,0 +1,20 @@
1
+ import * as React from "react";
2
+ export declare type LinkTypes = "action" | "backwards" | "button" | "default" | "external" | "forwards";
3
+ export interface LinkProps {
4
+ /** Any child node passed to the component. */
5
+ children: React.ReactNode;
6
+ /** Additional class name to render in the `Link` component. */
7
+ className?: string;
8
+ /** The `href` attribute for the anchor element. */
9
+ href?: string;
10
+ /** ID used for accessibility purposes. */
11
+ id?: string;
12
+ /** Controls the link visuals: action, button, backwards, forwards, or default. */
13
+ type?: LinkTypes;
14
+ }
15
+ /**
16
+ * A component that uses an `href` prop or a child anchor element, to create
17
+ * an anchor element with added styling and conventions.
18
+ */
19
+ export declare const Link: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLAnchorElement>>, {}>;
20
+ export default Link;
@@ -0,0 +1,35 @@
1
+ import * as React from "react";
2
+ export declare type ListTypes = "ol" | "ul" | "dl";
3
+ interface DescriptionProps {
4
+ term: string;
5
+ description: string | JSX.Element;
6
+ }
7
+ export interface ListProps {
8
+ /** ClassName you can add in addition to 'list' */
9
+ className?: string;
10
+ /** ID that other components can cross reference for accessibility purposes */
11
+ id?: string;
12
+ /** Display the list in a row. */
13
+ inline?: boolean;
14
+ /** Data to render if children are not passed. For `listTypes` orderd `"ol"`
15
+ * and unordered `"ul"` `List` types, the data structure is an array of strings
16
+ * to renders as `li` items. For descroption `"dl"` `List` types, the data
17
+ * structure is an array of objects with `term` and `description` properties
18
+ * to render `dt` and `dd` elements, respectively.
19
+ */
20
+ listItems?: (string | JSX.Element | DescriptionProps)[];
21
+ /** Remove list styling. */
22
+ noStyling?: boolean;
23
+ /** An optional title that will appear over the list. This prop only applies
24
+ * to Description Lists. */
25
+ title?: string;
26
+ /** The type of list: "ol", "ul", or "dl". "ul" by default. */
27
+ type: ListTypes;
28
+ }
29
+ /**
30
+ * A component that renders list item `li` elements or description item `dt`
31
+ * and `dd` elements based on the `type` prop. Note that the `title` prop will
32
+ * only display for the `Description` list type.
33
+ */
34
+ export declare const List: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<ListProps>) => any, {}>;
35
+ export default List;
@@ -0,0 +1,26 @@
1
+ import * as React from "react";
2
+ export declare type LogoNames = "appleAppStoreBlack" | "appleAppStoreWhite" | "bplBlack" | "bplWhite" | "cleverBadgeColor" | "cleverColor" | "cleverWhite" | "firstbookColor" | "firstbookColorNegative" | "googlePlayBlack" | "lpaBlack" | "lpaColor" | "lpaWhite" | "mlnBlack" | "mlnWhite" | "nyplFullBlack" | "nyplFullWhite" | "nyplLionBlack" | "nyplLionWhite" | "nyplTextBlack" | "nyplTextWhite" | "openebooksColor" | "openebooksNegative" | "openebooksWithTextColor" | "openebooksWithTextNegative" | "qplAltBlack" | "qplAltWhite" | "qplBlack" | "qplColor" | "qplWhite" | "reservoirIconColor" | "reservoirVerticalColor" | "schomburgBlack" | "schomburgCircleBlack" | "schomburgCircleColor" | "schomburgCircleWhite" | "schomburgColor" | "schomburgWhite" | "simplyeBlack" | "simplyeWhite" | "simplyeColor" | "snflBlack" | "snflWhite" | "treasuresColor" | "treasuresColorNegative";
3
+ export declare type LogoSizes = "default" | "xxsmall" | "xsmall" | "small" | "medium" | "large";
4
+ export interface LogoProps {
5
+ /** Optional className that will be added to the parent element */
6
+ className?: string;
7
+ /** Logos designated as decorative will be ignored by screenreaders. False
8
+ * by default. */
9
+ decorative?: boolean;
10
+ /** ID that other components can cross reference for accessibility purposes */
11
+ id?: string;
12
+ /** The name of the logo you want to use. */
13
+ name?: LogoNames;
14
+ /** Sets the logo size. */
15
+ size?: LogoSizes;
16
+ /** For accessibility purposes, the text passed in the `title` prop gets
17
+ * rendered in a `title` element in the SVG. This descriptive text is not
18
+ * visible but is needed for screenreaders to describe the graphic. */
19
+ title?: string;
20
+ }
21
+ /**
22
+ * The `Logo` component renders SVG-based logos and color variants that are
23
+ * commonly used by the New York Public Library.
24
+ */
25
+ export declare const Logo: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<LogoProps>) => JSX.Element, {}>;
26
+ export default Logo;
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ appleAppStoreBlack: string;
3
+ appleAppStoreWhite: string;
4
+ bplBlack: string;
5
+ bplWhite: string;
6
+ cleverBadgeColor: string;
7
+ cleverColor: string;
8
+ cleverWhite: string;
9
+ firstbookColor: string;
10
+ firstbookColorNegative: string;
11
+ googlePlayBlack: string;
12
+ lpaBlack: string;
13
+ lpaColor: string;
14
+ lpaWhite: string;
15
+ mlnBlack: string;
16
+ mlnWhite: string;
17
+ nyplFullBlack: string;
18
+ nyplFullWhite: string;
19
+ nyplLionBlack: string;
20
+ nyplLionWhite: string;
21
+ nyplTextBlack: string;
22
+ nyplTextWhite: string;
23
+ openebooksColor: string;
24
+ openebooksNegative: string;
25
+ openebooksWithTextColor: string;
26
+ openebooksWithTextNegative: string;
27
+ qplAltBlack: string;
28
+ qplAltWhite: string;
29
+ qplBlack: string;
30
+ qplColor: string;
31
+ qplWhite: string;
32
+ reservoirIconColor: string;
33
+ reservoirVerticalColor: string;
34
+ schomburgBlack: string;
35
+ schomburgCircleBlack: string;
36
+ schomburgCircleColor: string;
37
+ schomburgCircleWhite: string;
38
+ schomburgColor: string;
39
+ schomburgWhite: string;
40
+ simplyeBlack: string;
41
+ simplyeWhite: string;
42
+ simplyeColor: string;
43
+ snflBlack: string;
44
+ snflWhite: string;
45
+ treasuresColor: string;
46
+ treasuresColorNegative: string;
47
+ };
48
+ export default _default;
@@ -0,0 +1,33 @@
1
+ import * as React from "react";
2
+ interface BaseModalProps {
3
+ bodyContent?: string | JSX.Element;
4
+ closeButtonLabel?: string;
5
+ headingText?: string | JSX.Element;
6
+ /** ID that other components can cross reference for accessibility purposes */
7
+ id?: string;
8
+ isOpen?: boolean;
9
+ onClose?: () => void;
10
+ }
11
+ export interface ModalProps {
12
+ buttonText?: string;
13
+ /** ID that other components can cross reference for accessibility purposes */
14
+ id?: string;
15
+ modalProps: BaseModalProps;
16
+ }
17
+ /**
18
+ * The `ModalTrigger` component renders a button that you click to open the
19
+ * internal `Modal` component. Note that props to update the internal `Modal`
20
+ * component are passed through to the `modalProps` prop.
21
+ */
22
+ export declare const ModalTrigger: import("@chakra-ui/react").ChakraComponent<({ buttonText, id, modalProps, ...rest }: React.PropsWithChildren<ModalProps>) => JSX.Element, {}>;
23
+ /**
24
+ * This hook function can be used to render the `Modal` component with a custom
25
+ * open button(s) and optional custom close button(s). You must render your own
26
+ * button and pass the appropriate `onOpen` and ` handler for the modal to open.
27
+ */
28
+ export declare function useModal(): {
29
+ onClose: () => void;
30
+ onOpen: () => void;
31
+ Modal: import("@chakra-ui/react").ChakraComponent<({ bodyContent, closeButtonLabel, headingText, id, ...rest }: React.PropsWithChildren<BaseModalProps>) => JSX.Element, {}>;
32
+ };
33
+ export {};