@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,50 @@
1
+ import React from "react";
2
+ export declare type NotificationTypes = "standard" | "announcement" | "warning";
3
+ interface BaseProps {
4
+ /** Optional prop to control text alignment in `NotificationContent` */
5
+ alignText?: boolean;
6
+ /** Optional custom `Icon` that will override the default `Icon`. */
7
+ icon?: JSX.Element;
8
+ /** ID that other components can cross reference for accessibility purposes. */
9
+ id?: string;
10
+ /** Optional prop to control horizontal alignment of the `Notification` content */
11
+ isCentered?: boolean;
12
+ /** Optional prop to control the coloring of the `Notification` text and the
13
+ * visibility of an applicable icon. */
14
+ notificationType?: NotificationTypes;
15
+ }
16
+ declare type BasePropsWithoutAlignText = Omit<BaseProps, "alignText">;
17
+ declare type BasePropsWithoutIsCentered = Omit<BaseProps, "isCentered">;
18
+ export interface NotificationProps extends BasePropsWithoutAlignText {
19
+ /** Label used to describe the `Notification`'s aside HTML element. */
20
+ ariaLabel?: string;
21
+ /** Additional `className` to add. */
22
+ className?: string;
23
+ /** Optional prop to control whether a `Notification` can be dismissed
24
+ * (closed) by a user. */
25
+ dismissible?: boolean;
26
+ /** Optional custom `Icon` that will override the default `Icon`. */
27
+ icon?: JSX.Element;
28
+ /** Optional prop to control the margin around the `Notification` component. */
29
+ noMargin?: boolean;
30
+ /** Content to be rendered in a `NotificationContent` component. */
31
+ notificationContent: string | JSX.Element;
32
+ /** Content to be rendered in a `NotificationHeading` component. */
33
+ notificationHeading?: string;
34
+ /** Prop to display the `Notification` icon. Defaults to `true`. */
35
+ showIcon?: boolean;
36
+ }
37
+ /**
38
+ * NotificationHeading child-component.
39
+ */
40
+ export declare const NotificationHeading: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<BasePropsWithoutAlignText>) => JSX.Element, {}>;
41
+ /**
42
+ * NotificationContent child-component.
43
+ */
44
+ export declare const NotificationContent: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<BasePropsWithoutIsCentered>) => JSX.Element, {}>;
45
+ /**
46
+ * Component used to present users with three different levels of notifications:
47
+ * standard, announcement, and warning.
48
+ */
49
+ export declare const Notification: import("@chakra-ui/react").ChakraComponent<(props: NotificationProps) => JSX.Element, {}>;
50
+ export default Notification;
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ export interface PaginationProps {
3
+ /** Additional className. */
4
+ className?: string;
5
+ /** The currentPage can be used to programatically force the selected page to change
6
+ * without the user explicitly requesting it – for example, if the user should be
7
+ * brought back to the first page of a set of results after a new search. */
8
+ currentPage?: number;
9
+ /** The callback function that takes a page number and returns a string
10
+ * to use for a link's `href` attribute. This is used when the current
11
+ * page should refresh when navigating. */
12
+ getPageHref?: undefined | ((pageNumber: number) => string);
13
+ /** ID that other components can cross reference for accessibility purposes. */
14
+ id?: string;
15
+ /** The initially selected page (default value is 1). */
16
+ initialPage?: number;
17
+ /** The callback function called when an item is selected and the current
18
+ * page should not refresh. */
19
+ onPageChange?: (selected: number) => void;
20
+ /** The total number of pages. */
21
+ pageCount: number;
22
+ }
23
+ /**
24
+ * A component that provides a navigational list of page items.
25
+ */
26
+ export declare const Pagination: import("@chakra-ui/react").ChakraComponent<(props: PaginationProps) => JSX.Element, {}>;
27
+ export default Pagination;
@@ -0,0 +1,10 @@
1
+ import * as React from "react";
2
+ export interface PlaceholderProps {
3
+ /** Modifier string for the classname. */
4
+ variant?: string;
5
+ }
6
+ /** Creates a gray box with an editable string for dropping in spaces
7
+ * within components or on templates where a component will be but
8
+ * that hasn't been created yet
9
+ */
10
+ export default function Placeholder({ children, variant, }: React.PropsWithChildren<PlaceholderProps>): JSX.Element;
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ export declare type ProgressIndicatorSizes = "default" | "small";
3
+ export declare type ProgressIndicatorTypes = "circular" | "linear";
4
+ export interface ProgressIndicatorProps {
5
+ /** Flag to render the component in a dark background. */
6
+ darkMode?: boolean;
7
+ /** ID that other components can cross reference for accessibility purposes. */
8
+ id: string;
9
+ /** Whether the `ProgressIndicator` should be linear or circular. */
10
+ indicatorType?: ProgressIndicatorTypes;
11
+ /** Whether the progress animation should display because the `value` prop is
12
+ * not known. When this is set to `true`, the `value` prop will be ignored. */
13
+ isIndeterminate?: boolean;
14
+ /** The text to display in an HTML `label` element. */
15
+ labelText: string;
16
+ /** Visually show or hide the label text. When set to `false`, then the label
17
+ * text will be added to the parent component as its `aria-label` attribute. */
18
+ showLabel?: boolean;
19
+ /** The size of the linear or circular progress. */
20
+ size?: ProgressIndicatorSizes;
21
+ /** A number between 0 to 100 that defines the progress' value. */
22
+ value?: number;
23
+ }
24
+ /**
25
+ * A component that displays a progress status for any task that takes a long
26
+ * time to complete or consists of multiple steps. Examples include downloading,
27
+ * uploading, or processing.
28
+ */
29
+ export declare const ProgressIndicator: import("@chakra-ui/react").ChakraComponent<(props: ProgressIndicatorProps) => JSX.Element, {}>;
30
+ export default ProgressIndicator;
@@ -0,0 +1,43 @@
1
+ import * as React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ export interface RadioProps {
4
+ /** Additional class name. */
5
+ className?: string;
6
+ /** Optional string to populate the HelperErrorText for the standard state. */
7
+ helperText?: HelperErrorTextType;
8
+ /** ID that other components can cross reference for accessibility purposes */
9
+ id: string;
10
+ /** Optional string to populate the HelperErrorText for the error state
11
+ * when `isInvalid` is true.
12
+ */
13
+ invalidText?: HelperErrorTextType;
14
+ /** When using the Radio as a "controlled" form element, you can specify the
15
+ * `Radio`'s checked state using this prop. You must also pass an onChange prop.
16
+ * Learn more about controlled and uncontrolled form fields: https://goshakkk.name/controlled-vs-uncontrolled-inputs-react/ */
17
+ isChecked?: boolean;
18
+ /** Adds the 'disabled' and `aria-disabled` attributes to the input when true.
19
+ * This also makes the text italic and color scheme gray. */
20
+ isDisabled?: boolean;
21
+ /** Adds the 'aria-invalid' attribute to the input when true. This also makes
22
+ * the color theme "NYPL error" red for the button and text. */
23
+ isInvalid?: boolean;
24
+ /** Adds the 'required' attribute to the input when true. */
25
+ isRequired?: boolean;
26
+ /** The radio button's label. This will serve as the text content for the
27
+ * `<label>` element if `showlabel` is true, or an "aria-label" if `showLabel`
28
+ * is false. */
29
+ labelText: string | JSX.Element;
30
+ /** Used to reference the input element in forms. */
31
+ name?: string;
32
+ /** Should be passed along with `isChecked` for controlled components. */
33
+ onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
34
+ /** Offers the ability to hide the helper/invalid text. */
35
+ showHelperInvalidText?: boolean;
36
+ /** Offers the ability to show the radio's label onscreen or hide it. Refer
37
+ * to the `labelText` property for more information. */
38
+ showLabel?: boolean;
39
+ /** Populates the value of the input. */
40
+ value?: string;
41
+ }
42
+ export declare const Radio: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>, {}>;
43
+ export default Radio;
@@ -0,0 +1,51 @@
1
+ import * as React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ import { LayoutTypes } from "../../helpers/types";
4
+ export interface RadioGroupProps {
5
+ /** Additional class name. */
6
+ className?: string;
7
+ /** Populates the initial value of the input */
8
+ defaultValue?: string;
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 error state */
14
+ invalidText?: HelperErrorTextType;
15
+ /** Adds the 'disabled' prop to the input when true. */
16
+ isDisabled?: boolean;
17
+ /** Set's the `Radio`s' wrapper to be full width. */
18
+ isFullWidth?: boolean;
19
+ /** Adds the 'aria-invalid' attribute to the input and
20
+ * sets the error state when true. */
21
+ isInvalid?: boolean;
22
+ /** Adds the 'required' attribute to the input when true. */
23
+ isRequired?: boolean;
24
+ /** The radio group label displayed in a `legend` element if `showlabel` is
25
+ * true, or an "aria-label" if `showLabel` is false. */
26
+ labelText: string;
27
+ /** Renders the Radio buttons in a row or column (default). */
28
+ layout?: LayoutTypes;
29
+ /** The `name` prop indicates the form group for all the Radio children. */
30
+ name: string;
31
+ /** The action to perform on the `<input>`'s onChange function */
32
+ onChange?: (value: string) => void;
33
+ /** Offers the ability to hide the helper/invalid text. */
34
+ showHelperInvalidText?: boolean;
35
+ /** Offers the ability to show the group's legend onscreen or hide it. Refer
36
+ * to the `labelText` property for more information. */
37
+ showLabel?: boolean;
38
+ /** Whether or not to display the "(Required)" text in the label text.
39
+ * True by default. */
40
+ showRequiredLabel?: boolean;
41
+ }
42
+ /**
43
+ * RadioGroup is a wrapper for DS `Radio` components that renders as a fieldset
44
+ * HTML element along with optional helper text. The `name` prop is essential
45
+ * for this form group element and is not needed for individual DS `Radio`
46
+ * components when `RadioGroup` is used.
47
+ */
48
+ export declare const RadioGroup: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<RadioGroupProps & {
49
+ children?: React.ReactNode;
50
+ } & React.RefAttributes<HTMLInputElement>>, {}>;
51
+ export default RadioGroup;
@@ -0,0 +1,61 @@
1
+ import * as React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ interface BaseProps {
4
+ labelText: string;
5
+ name: string;
6
+ onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
7
+ value?: string;
8
+ }
9
+ export interface SelectProps extends BaseProps {
10
+ optionsData: string[];
11
+ onChange?: (event: React.FormEvent) => void;
12
+ }
13
+ export interface TextInputProps extends BaseProps {
14
+ placeholder?: string;
15
+ }
16
+ export interface SearchBarProps {
17
+ /** Adds 'action' property to the `form` element. */
18
+ action?: string;
19
+ /** The onClick callback function for the `Button` component. */
20
+ buttonOnClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
21
+ /** A class name for the `form` element. */
22
+ className?: string;
23
+ /** Optional string for the SearchBar's description above the component. */
24
+ descriptionText?: string;
25
+ /** Optional string for the SearchBar's heading text above the component. */
26
+ headingText?: string;
27
+ /** The text to display below the form in a `HelperErrorText` component. */
28
+ helperText?: HelperErrorTextType;
29
+ /** ID that other components can cross reference for accessibility purposes */
30
+ id: string;
31
+ /** Optional string to populate the `HelperErrorText` for the error state
32
+ * when `isInvalid` is true. */
33
+ invalidText?: HelperErrorTextType;
34
+ /** Sets children form components in the disabled state. */
35
+ isDisabled?: boolean;
36
+ /** Sets children form components in the error state. */
37
+ isInvalid?: boolean;
38
+ /** Sets children form components in the required state. */
39
+ isRequired?: boolean;
40
+ /** Populates the `aria-label` attribute on the form element. */
41
+ labelText: string;
42
+ /** Adds 'method' property to the `form` element. */
43
+ method?: string;
44
+ /** Sets the `Button` variant type to `noBrand` when true;
45
+ * false by default which sets the type to `primary`. */
46
+ noBrandButtonType?: boolean;
47
+ /** Handler function when the form is submitted. */
48
+ onSubmit: (event: React.FormEvent) => void;
49
+ /** Required props to render a `Select` element. */
50
+ selectProps?: SelectProps | undefined;
51
+ /** Custom input element to render instead of a `TextInput` element. */
52
+ textInputElement?: JSX.Element;
53
+ /** Required props to render a `TextInput` element. */
54
+ textInputProps?: TextInputProps | undefined;
55
+ }
56
+ /**
57
+ * Renders a wrapper `form` element to be used with `Select` (optional),
58
+ * `Input`, and `Button` components together.
59
+ */
60
+ export declare const SearchBar: import("@chakra-ui/react").ChakraComponent<(props: SearchBarProps) => JSX.Element, {}>;
61
+ export default SearchBar;
@@ -0,0 +1,57 @@
1
+ import React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ export declare type SelectTypes = "default" | "searchbar";
4
+ export declare type LabelPositions = "default" | "inline";
5
+ export interface SelectProps {
6
+ /** A class name for the `div` parent element. */
7
+ className?: string;
8
+ /** Optional string to populate the `HelperErrorText` for the standard state. */
9
+ helperText?: HelperErrorTextType;
10
+ /** ID that other components can cross reference for accessibility purposes */
11
+ id: string;
12
+ /** Optional string to populate the `HelperErrorText` for the error state
13
+ * when `isInvalid` is true. */
14
+ invalidText?: HelperErrorTextType;
15
+ /** Adds the `disabled` and `aria-disabled` attributes to the select when true */
16
+ isDisabled?: boolean;
17
+ /** Adds the `aria-invalid` attribute to the select when true. This also makes
18
+ * the color theme "NYPL error" red for the select and text. */
19
+ isInvalid?: boolean;
20
+ /** Adds the `required` and `aria-required` attributes to the input when true. */
21
+ isRequired?: boolean;
22
+ /** Optional value to render the label inline, rather than the default (on top)
23
+ * of the select element. */
24
+ labelPosition?: LabelPositions;
25
+ /** Provides text for a `Label` component if `showLabel` is set to `true`;
26
+ * populates an `aria-label` attribute on the select input if `showLabel` is
27
+ * set to `false`. */
28
+ labelText: string;
29
+ /** Used to reference the select element in forms. */
30
+ name: string;
31
+ /** The callback function to get the selected value.
32
+ * Should be passed along with `value` for controlled components. */
33
+ onChange?: (event: React.FormEvent) => void;
34
+ /** Placeholder text in the select element. */
35
+ placeholder?: string;
36
+ /** The variant to display. */
37
+ selectType?: SelectTypes;
38
+ /** Offers the ability to hide the helper/invalid text. */
39
+ showHelperInvalidText?: boolean;
40
+ /** Offers the ability to show the select's label onscreen or hide it. Refer
41
+ * to the `labelText` property for more information. */
42
+ showLabel?: boolean;
43
+ /** Whether or not to display the "(Required)" text in the label text.
44
+ * True by default. */
45
+ showRequiredLabel?: boolean;
46
+ /** The value of the selected option.
47
+ * Should be passed along with `onChange` for controlled components. */
48
+ value?: string;
49
+ }
50
+ /**
51
+ * Component that renders Chakra's `Select` component along with an accessible
52
+ * `Label` and optional `HelperErrorText` component.
53
+ */
54
+ export declare const Select: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<SelectProps & {
55
+ children?: React.ReactNode;
56
+ } & React.RefAttributes<HTMLSelectElement>>, {}>;
57
+ export default Select;
@@ -0,0 +1,39 @@
1
+ import * as React from "react";
2
+ import { LayoutTypes } from "../../helpers/types";
3
+ export declare type SkeletonLoaderImageRatios = "landscape" | "portrait" | "square";
4
+ export interface SkeletonLoaderProps {
5
+ /** Additional class name for the Skeleton component. */
6
+ className?: string;
7
+ /** Optional numeric value to control the number of lines for content
8
+ * placeholder; default value is `3`. */
9
+ contentSize?: number;
10
+ /** Optional numeric value to control the number of lines for heading
11
+ * placeholder; default value is `1`. */
12
+ headingSize?: number;
13
+ /** Optional value to control the aspect ratio of the image placeholder;
14
+ * default value is `"square"`. */
15
+ imageAspectRatio?: SkeletonLoaderImageRatios;
16
+ /** Optional boolean value to control visibility of border around skeleton loader. */
17
+ isBordered?: boolean;
18
+ /** Optional value to control the position of the image placeholder;
19
+ * default value is `"column"`. */
20
+ layout?: LayoutTypes;
21
+ /** Optional boolean value to control visibility of button placeholder. */
22
+ showButton?: boolean;
23
+ /** Optional boolean value to control visibility of content placeholder. */
24
+ showContent?: boolean;
25
+ /** Optional boolean value to control visibility of heading placeholder. */
26
+ showHeading?: boolean;
27
+ /** Optional boolean value to control visibility of image placeholder. */
28
+ showImage?: boolean;
29
+ /** Optional width value. This value should be entered with the same
30
+ * formatting as a CSS width attribute (ex. `50%`, `640px`, `20rem`).
31
+ * If omitted, the skeleton loader will have a default width of 100%. */
32
+ width?: string;
33
+ }
34
+ /**
35
+ * The `SkeletonLoader` component renders a placeholder to be used while
36
+ * dynamic content is loading.
37
+ */
38
+ export declare const SkeletonLoader: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<SkeletonLoaderProps>) => JSX.Element, {}>;
39
+ export default SkeletonLoader;
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ interface SkipNavigationProps {
3
+ /** Additional CSS class name to render in the `nav` element. */
4
+ className?: string;
5
+ /** ID that other components can cross reference for accessibility purposes */
6
+ id?: string;
7
+ /** The anchor target for the main skip link. The default is "#mainContent". */
8
+ target?: string;
9
+ }
10
+ /**
11
+ * SkipNavigation is a component that is used to provide a navigational list of
12
+ * links. The first link is used to skip to the main content of the page using
13
+ * the `#mainContent` id, and the second link points to accessibility information
14
+ * on NYPL.org. These links are visually hidden but can be read by screenreaders.
15
+ */
16
+ export declare const SkipNavigation: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<SkipNavigationProps>) => JSX.Element, {}>;
17
+ export default SkipNavigation;
@@ -0,0 +1,59 @@
1
+ import * as React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ export interface SliderProps {
4
+ /** Additional class name for the Slider component. */
5
+ className?: string;
6
+ /** The initial value for the single `Slider` or an array of two number
7
+ * values for the `isRangeSlider` case. */
8
+ defaultValue?: number | number[];
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
+ /** Adds the 'disabled' state to the slider and text input(s) when true. */
17
+ isDisabled?: boolean;
18
+ /** Adds the 'invalid' state to the slider and text input(s) when true. */
19
+ isInvalid?: boolean;
20
+ /** Offers the ability to render a slider with one value or
21
+ * a range slider with two values. */
22
+ isRangeSlider?: boolean;
23
+ /** Adds the 'required' attribute to the input(s) when true. */
24
+ isRequired?: boolean;
25
+ /** The `Slider`'s label. In the default single slider, this will be linked to
26
+ * the only `TextInput` component. In the range slider, this will be linked to
27
+ * the first `TextInput` component. If `showLabel` is false, then this value
28
+ * will be set in the `Slider`'s `aria-label` attribute. */
29
+ labelText: string;
30
+ /** Maximum value allowed. */
31
+ max?: number;
32
+ /** Minimum value allowed. */
33
+ min?: number;
34
+ /** The name prop indicates into which form this component belongs to. */
35
+ name?: string;
36
+ /** Callback function that gets the value(s) selected. */
37
+ onChange?: (val: number | number[]) => void;
38
+ /** Offers the ability to hide the `TextInput` boxes. */
39
+ showBoxes?: boolean;
40
+ /** Offers the ability to hide the helper/invalid text. */
41
+ showHelperInvalidText?: boolean;
42
+ /** Offers the ability to show the label onscreen or hide it. Refer
43
+ * to the `labelText` property for more information. */
44
+ showLabel?: boolean;
45
+ /** Whether or not to display the "(Required)" text in the label text.
46
+ * True by default. */
47
+ showRequiredLabel?: boolean;
48
+ /** Offers the ability to hide the static min/max values. */
49
+ showValues?: boolean;
50
+ /** The amount to increase or decrease when using the slider thumb(s). */
51
+ step?: number;
52
+ }
53
+ /**
54
+ * The `Slider` component renders a singular value slider or a range slider
55
+ * with a min and max value. The value(s) can be updated through the slider
56
+ * thumb(s) or through the text input(s) elements.
57
+ */
58
+ export declare const Slider: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<SliderProps>) => JSX.Element, {}>;
59
+ export default Slider;
@@ -0,0 +1,16 @@
1
+ import * as React from "react";
2
+ export declare type StatusBadgeTypes = "low" | "medium" | "high";
3
+ export interface StatusBadgeProps {
4
+ /** Additional class for the component */
5
+ className?: string;
6
+ /** ID that other components can cross reference for accessibility purposes */
7
+ id?: string;
8
+ /** Level of the status badge. Defaults to `"low"`. */
9
+ level?: StatusBadgeTypes;
10
+ }
11
+ /**
12
+ * The `StatusBadge` component is used to display a visual badge for three
13
+ * different status levels.
14
+ */
15
+ export declare const StatusBadge: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<StatusBadgeProps>) => JSX.Element, {}>;
16
+ export default StatusBadge;
@@ -0,0 +1,28 @@
1
+ import * as React from "react";
2
+ import { ComponentImageProps } from "../Image/Image";
3
+ export declare type StructuredContentImagePosition = "left" | "right" | "center";
4
+ interface StructuredContentImageProps extends ComponentImageProps {
5
+ /** Optional value to control the positioning of the internal `Image` component.
6
+ * Defaults to `"left"`. */
7
+ position?: StructuredContentImagePosition;
8
+ }
9
+ export interface StructuredContentProps {
10
+ /** Optional value to set the text for the callout heading text. */
11
+ calloutText?: string;
12
+ /** Additional class name for the `StructuredContent` component. */
13
+ className?: string;
14
+ /** Optional value to set the text for the main heading text. */
15
+ headingText?: string;
16
+ /** ID that other components can cross reference for accessibility purposes. */
17
+ id?: string;
18
+ /** Object used to create and render the `Image` component. */
19
+ imageProps?: StructuredContentImageProps;
20
+ /** Required value to set the text for the body content. */
21
+ bodyContent: string | JSX.Element;
22
+ }
23
+ /**
24
+ * The `StructuredContent` component that displays a heading, callout content,
25
+ * an image, and body content. All are optional except for body content.
26
+ */
27
+ export declare const StructuredContent: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<StructuredContentProps>) => JSX.Element, {}>;
28
+ export default StructuredContent;
@@ -0,0 +1,12 @@
1
+ import * as React from "react";
2
+ export interface ColorCardProps {
3
+ /** backgroundColor of the color card */
4
+ backgroundColor: string;
5
+ /** name of the CSS var */
6
+ colorName: string;
7
+ }
8
+ /**
9
+ * ColorCard
10
+ * Component only used for Storybook.
11
+ */
12
+ export default function ColorCard(props: React.PropsWithChildren<ColorCardProps>): JSX.Element;
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ export interface TableProps {
3
+ /** Additional class name for the `Table` component. */
4
+ className?: string;
5
+ /** Array of string values used to populate the `Table` column headers.
6
+ * For improved accessibility, column headers are required. */
7
+ columnHeaders: string[];
8
+ /** Hex value to set the background color of the column headers. */
9
+ columnHeadersBackgroundColor?: string;
10
+ /** Hex value to set the text color of the column headers. */
11
+ columnHeadersTextColor?: string;
12
+ /** ID that other components can cross reference for accessibility purposes. */
13
+ id?: string;
14
+ /** If true, a border will be displayed between each row in the `Table`
15
+ * component. The default value is false. */
16
+ showRowDividers?: boolean;
17
+ /** Two-dimensional array used to populate the table rows. */
18
+ tableData: (string | JSX.Element)[][];
19
+ /** Displays `Table` title element. */
20
+ titleText?: string;
21
+ /** If true, the first cell of each row in the `Table` component will be
22
+ * visually styled as a header. The default value is false */
23
+ useRowHeaders?: boolean;
24
+ }
25
+ /**
26
+ * Basic `Table` component used to organize and display tabular data in
27
+ * rows and columns.
28
+ */
29
+ export declare const Table: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<TableProps>) => JSX.Element, {}>;
30
+ export default Table;
@@ -0,0 +1,26 @@
1
+ import { Tab, TabList, TabPanels, TabPanel } from "@chakra-ui/react";
2
+ import * as React from "react";
3
+ export interface TabsDataProps {
4
+ label: string;
5
+ content: string | React.ReactNode;
6
+ }
7
+ export interface TabsProps {
8
+ /** The index of the tab to display for controlled situations. */
9
+ defaultIndex?: number;
10
+ /** ID that other components can cross reference for accessibility purposes */
11
+ id?: string;
12
+ /** The callback function invoked on every tab change event. */
13
+ onChange?: (index: number) => any;
14
+ /** Array of data to display */
15
+ tabsData?: TabsDataProps[];
16
+ /** Render a hash in the url for each tab. Only available when data is
17
+ * passed through the `data` props. */
18
+ useHash?: boolean;
19
+ }
20
+ /**
21
+ * Renders Chakra's `Tab` component with specific variants, props,
22
+ * and controlled styling.
23
+ */
24
+ export declare const Tabs: import("@chakra-ui/react").ChakraComponent<(props: React.PropsWithChildren<TabsProps>) => JSX.Element, {}>;
25
+ export { TabList, Tab, TabPanels, TabPanel };
26
+ export default Tabs;