@nypl/design-system-react-components 4.0.0-remove-matchMedia-test → 4.0.0

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 (145) hide show
  1. package/README.md +125 -201
  2. package/dist/design-system-react-components.cjs +58 -58
  3. package/dist/design-system-react-components.js +18457 -19086
  4. package/dist/readme/componentheader.png +0 -0
  5. package/dist/src/components/Accordion/Accordion.d.ts +7 -9
  6. package/dist/src/components/AlphabetFilter/AlphabetFilter.d.ts +2 -6
  7. package/dist/src/components/AudioPlayer/AudioPlayer.d.ts +4 -13
  8. package/dist/src/components/Banner/Banner.d.ts +9 -16
  9. package/dist/src/components/Breadcrumbs/Breadcrumbs.d.ts +7 -11
  10. package/dist/src/components/Button/Button.d.ts +10 -17
  11. package/dist/src/components/ButtonGroup/ButtonGroup.d.ts +2 -6
  12. package/dist/src/components/ButtonGroup/ButtonGroupContext.d.ts +3 -0
  13. package/dist/src/components/Card/Card.d.ts +3 -7
  14. package/dist/src/components/Checkbox/Checkbox.d.ts +3 -12
  15. package/dist/src/components/CheckboxGroup/CheckboxGroup.d.ts +4 -8
  16. package/dist/src/components/CheckboxGroup/CheckboxGroupContext.d.ts +10 -0
  17. package/dist/src/components/ComponentWrapper/ComponentWrapper.d.ts +2 -7
  18. package/dist/src/components/DatePicker/DatePicker.d.ts +4 -8
  19. package/dist/src/components/FeaturedContent/FeaturedContent.d.ts +3 -7
  20. package/dist/src/components/FeedbackBox/FeedbackBox.d.ts +2 -6
  21. package/dist/src/components/Fieldset/Fieldset.d.ts +2 -6
  22. package/dist/src/components/FilterBarInline/FilterBarInline.d.ts +2 -6
  23. package/dist/src/components/FilterBarPopup/FilterBarPopup.d.ts +2 -6
  24. package/dist/src/components/Form/Form.d.ts +10 -15
  25. package/dist/src/components/Grid/SimpleGrid.d.ts +2 -6
  26. package/dist/src/components/Heading/Heading.d.ts +2 -9
  27. package/dist/src/components/HelperErrorText/HelperErrorText.d.ts +2 -7
  28. package/dist/src/components/Hero/Hero.d.ts +11 -13
  29. package/dist/src/components/HorizontalRule/HorizontalRule.d.ts +2 -6
  30. package/dist/src/components/Icons/Icon.d.ts +5 -9
  31. package/dist/src/components/Icons/IconSvgs.d.ts +3 -0
  32. package/dist/src/components/Icons/iconVariables.d.ts +3 -3
  33. package/dist/src/components/Image/Image.d.ts +2 -14
  34. package/dist/src/components/Label/Label.d.ts +3 -9
  35. package/dist/src/components/Link/Link.d.ts +8 -18
  36. package/dist/src/components/List/List.d.ts +5 -14
  37. package/dist/src/components/Logo/Logo.d.ts +2 -6
  38. package/dist/src/components/Menu/Menu.d.ts +2 -6
  39. package/dist/src/components/Modal/Modal.d.ts +8 -11
  40. package/dist/src/components/MultiSelect/MultiSelect.d.ts +9 -10
  41. package/dist/src/components/MultiSelect/MultiSelectItemsCountButton.d.ts +2 -5
  42. package/dist/src/components/MultiSelectGroup/MultiSelectGroup.d.ts +2 -6
  43. package/dist/src/components/NewsletterSignup/NewsletterSignup.d.ts +6 -11
  44. package/dist/src/components/Notification/Notification.d.ts +9 -13
  45. package/dist/src/components/Pagination/Pagination.d.ts +2 -6
  46. package/dist/src/components/ProgressIndicator/ProgressIndicator.d.ts +3 -5
  47. package/dist/src/components/Radio/Radio.d.ts +4 -13
  48. package/dist/src/components/RadioGroup/RadioGroup.d.ts +6 -9
  49. package/dist/src/components/RadioGroup/RadioGroupContext.d.ts +10 -0
  50. package/dist/src/components/SearchBar/SearchBar.d.ts +5 -15
  51. package/dist/src/components/Select/Select.d.ts +6 -18
  52. package/dist/src/components/SkeletonLoader/SkeletonLoader.d.ts +2 -6
  53. package/dist/src/components/SkipNavigation/SkipNavigation.d.ts +2 -6
  54. package/dist/src/components/Slider/Slider.d.ts +3 -7
  55. package/dist/src/components/SocialMediaLinks/SocialMediaLinks.d.ts +4 -8
  56. package/dist/src/components/StatusBadge/StatusBadge.d.ts +5 -9
  57. package/dist/src/components/StructuredContent/StructuredContent.d.ts +2 -6
  58. package/dist/src/components/StyledList/StyledList.d.ts +2 -8
  59. package/dist/src/components/SubNav/SubNav.d.ts +4 -13
  60. package/dist/src/components/Table/Table.d.ts +2 -10
  61. package/dist/src/components/Tabs/Tabs.d.ts +2 -4
  62. package/dist/src/components/TagSet/TagSet.d.ts +2 -9
  63. package/dist/src/components/TagSet/TagSetExplore.d.ts +3 -2
  64. package/dist/src/components/TagSet/TagSetFilter.d.ts +3 -4
  65. package/dist/src/components/Template/Template.d.ts +31 -41
  66. package/dist/src/components/Text/Text.d.ts +3 -11
  67. package/dist/src/components/TextInput/TextInput.d.ts +9 -34
  68. package/dist/src/components/Toggle/Toggle.d.ts +3 -10
  69. package/dist/src/components/Tooltip/Tooltip.d.ts +2 -8
  70. package/dist/src/components/VideoPlayer/VideoPlayer.d.ts +2 -6
  71. package/dist/src/hooks/useMultiSelect.d.ts +5 -1
  72. package/dist/src/hooks/useSafeId.d.ts +6 -0
  73. package/dist/src/index.d.ts +14 -16
  74. package/dist/src/theme/components/breadcrumb.d.ts +2 -2
  75. package/dist/src/theme/components/button.d.ts +12 -0
  76. package/dist/src/theme/components/datePicker.d.ts +4 -0
  77. package/dist/src/theme/components/feedbackBox.d.ts +15 -3
  78. package/dist/src/theme/components/fieldset.d.ts +1 -1
  79. package/dist/src/theme/components/global.d.ts +1 -5
  80. package/dist/src/theme/components/heading.d.ts +6 -72
  81. package/dist/src/theme/components/helperErrorText.d.ts +5 -14
  82. package/dist/src/theme/components/hero.d.ts +14 -15
  83. package/dist/src/theme/components/horizontalRule.d.ts +0 -2
  84. package/dist/src/theme/components/icon.d.ts +2 -5
  85. package/dist/src/theme/components/label.d.ts +0 -1
  86. package/dist/src/theme/components/list.d.ts +1 -11
  87. package/dist/src/theme/components/newsletterSignup.d.ts +4 -4
  88. package/dist/src/theme/components/notification.d.ts +3 -3
  89. package/dist/src/theme/components/notificationContent.d.ts +3 -3
  90. package/dist/src/theme/components/notificationHeading.d.ts +3 -3
  91. package/dist/src/theme/components/radioGroup.d.ts +1 -1
  92. package/dist/src/theme/components/searchBar.d.ts +3 -3
  93. package/dist/src/theme/components/select.d.ts +7 -3
  94. package/dist/src/theme/components/slider.d.ts +5 -1
  95. package/dist/src/theme/components/socialmedialinks.d.ts +2 -2
  96. package/dist/src/theme/components/structuredContent.d.ts +2 -69
  97. package/dist/src/theme/components/styledList.d.ts +0 -1
  98. package/dist/src/theme/components/subnav.d.ts +1 -1
  99. package/dist/src/theme/components/{customTable.d.ts → table.d.ts} +7 -13
  100. package/dist/src/theme/components/template.d.ts +86 -31
  101. package/dist/src/theme/components/text.d.ts +1 -3
  102. package/dist/src/theme/foundations/colors.d.ts +1 -1
  103. package/dist/src/theme/foundations/global.d.ts +0 -12
  104. package/dist/src/theme/foundations/spacing.d.ts +16 -0
  105. package/dist/src/theme/sharedStyles.d.ts +4 -0
  106. package/dist/src/theme/sharedTypes.d.ts +4 -0
  107. package/dist/src/utils/utils.d.ts +9 -3
  108. package/dist/styles.css +1 -1
  109. package/dist/template/templateFluidColumns1.png +0 -0
  110. package/dist/template/templateFluidColumns2.png +0 -0
  111. package/dist/template/templateFluidColumns3.png +0 -0
  112. package/dist/template/templateFluidColumns4.png +0 -0
  113. package/dist/template/templateFullPageLayout.png +0 -0
  114. package/dist/template/templateRegionsFooter.png +0 -0
  115. package/dist/template/templateRegionsHeader.png +0 -0
  116. package/dist/template/templateRegionsMain.png +0 -0
  117. package/dist/template/templateSectionBreakout.png +0 -0
  118. package/dist/template/templateSectionContent.png +0 -0
  119. package/dist/template/templateSectionFull.png +0 -0
  120. package/dist/template/templateSectionSidebar.png +0 -0
  121. package/dist/template/templateVariantFull.png +0 -0
  122. package/dist/template/templateVariantNarrow.png +0 -0
  123. package/dist/template/templateVariantSidebarLeft.png +0 -0
  124. package/dist/template/templateVariantSidebarRight.png +0 -0
  125. package/dist/useNextjsImage/aspectRatio.png +0 -0
  126. package/dist/useNextjsImage/containedImageExamples.png +0 -0
  127. package/dist/useNextjsImage/croppedImageExamples.png +0 -0
  128. package/dist/useNextjsImage/customWidth.png +0 -0
  129. package/dist/useNextjsImage/fallbackImageDark.png +0 -0
  130. package/dist/useNextjsImage/fallbackImageLight.png +0 -0
  131. package/dist/useNextjsImage/focalPointExamples01.png +0 -0
  132. package/dist/useNextjsImage/focalPointExamples02.png +0 -0
  133. package/package.json +14 -18
  134. package/dist/src/hooks/useCarouselStyles.d.ts +0 -17
  135. package/dist/src/hooks/useWindowSize.d.ts +0 -10
  136. package/dist/src/theme/components/filterBar.d.ts +0 -46
  137. package/dist/template/templateBottom.png +0 -0
  138. package/dist/template/templateBreakout.png +0 -0
  139. package/dist/template/templateMain.png +0 -0
  140. package/dist/template/templateMainNarrow.png +0 -0
  141. package/dist/template/templateMainWide.png +0 -0
  142. package/dist/template/templateSidebarLeft.png +0 -0
  143. package/dist/template/templateSidebarNone.png +0 -0
  144. package/dist/template/templateSidebarRight.png +0 -0
  145. package/dist/template/templateTop.png +0 -0
@@ -1,16 +1,11 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
2
- import React from "react";
1
+ import { BoxProps, ChakraComponent, ChakraProps } from "@chakra-ui/react";
2
+ import React, { InputHTMLAttributes } from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
- export interface RadioProps {
5
- /** Additional class name. */
6
- className?: string;
4
+ export interface RadioProps extends Pick<BoxProps, keyof ChakraProps>, Omit<InputHTMLAttributes<HTMLInputElement>, "color" | "height" | "width"> {
7
5
  /** Optional string to populate the HelperErrorText for the standard state. */
8
6
  helperText?: HelperErrorTextType;
9
- /** ID that other components can cross reference for accessibility purposes */
10
- id: string;
11
7
  /** Optional string to populate the HelperErrorText for the error state
12
- * when `isInvalid` is true.
13
- */
8
+ * when `isInvalid` is true. */
14
9
  invalidText?: HelperErrorTextType;
15
10
  /** When using the Radio as a "controlled" form element, you can specify the
16
11
  * `Radio`'s checked state using this prop. You must also pass an onChange prop.
@@ -28,10 +23,6 @@ export interface RadioProps {
28
23
  * `<label>` element if `showlabel` is true, or an "aria-label" if `showLabel`
29
24
  * is false. */
30
25
  labelText: string | JSX.Element;
31
- /** Used to reference the input element in forms. */
32
- name?: string;
33
- /** Should be passed along with `isChecked` for controlled components. */
34
- onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
35
26
  /** Offers the ability to hide the helper/invalid text. */
36
27
  showHelperInvalidText?: boolean;
37
28
  /** Offers the ability to show the radio's label onscreen or hide it. Refer
@@ -1,16 +1,12 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
4
  import { LayoutTypes } from "../../helpers/types";
5
- export interface RadioGroupProps {
6
- /** Additional class name. */
7
- className?: string;
5
+ export interface RadioGroupProps extends Omit<BoxProps, "onChange"> {
8
6
  /** Populates the initial value of the input */
9
7
  defaultValue?: string;
10
8
  /** Optional string to populate the HelperErrorText for standard state */
11
9
  helperText?: HelperErrorTextType;
12
- /** ID that other components can cross reference for accessibility purposes */
13
- id: string;
14
10
  /** Optional string to populate the HelperErrorText for error state */
15
11
  invalidText?: HelperErrorTextType;
16
12
  /** Adds the 'disabled' prop to the input when true. */
@@ -42,9 +38,10 @@ export interface RadioGroupProps {
42
38
  }
43
39
  /**
44
40
  * `RadioGroup` is a wrapper for DS `Radio` components that render together
45
- * along with an optional helper text. The `name` prop is essential for this
46
- * form group element and is not needed for individual DS `Radio`
47
- * components when `RadioGroup` is used.
41
+ * along with an optional helper text.
42
+ *
43
+ * The `name` prop is essential for this form group element and is not needed
44
+ * for individual DS `Radio` components when `RadioGroup` is used.
48
45
  */
49
46
  export declare const RadioGroup: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<RadioGroupProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<RadioGroupProps>>;
50
47
  export default RadioGroup;
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface RadioGroupContextValue {
3
+ isDisabled: boolean;
4
+ isInvalid: boolean;
5
+ isRequired: boolean;
6
+ name: string;
7
+ }
8
+ export declare const RadioGroupContext: import("react").Context<RadioGroupContextValue>;
9
+ export declare const useRadioGroup: () => RadioGroupContextValue;
10
+ export {};
@@ -1,5 +1,5 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
2
- import React from "react";
1
+ import { ChakraComponent, ChakraProps, BoxProps } from "@chakra-ui/react";
2
+ import React, { FormHTMLAttributes } from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
4
  import { SelectProps as InitialSelectProps } from "../Select/Select";
5
5
  import { InputProps as InitialInputProps } from "../TextInput/TextInput";
@@ -11,13 +11,9 @@ export type SelectProps = Partial<Pick<InitialSelectProps, "id" | "labelText" |
11
11
  optionsData: SelectOptionsProps[];
12
12
  };
13
13
  export type TextInputProps = Pick<InitialInputProps, "labelText" | "name"> & Partial<Pick<InitialInputProps, "defaultValue" | "id" | "isClearable" | "isClearableCallback" | "max" | "maxLength" | "min" | "onChange" | "pattern" | "placeholder" | "value">>;
14
- export interface SearchBarProps {
15
- /** Adds 'action' property to the `form` element. */
16
- action?: string;
14
+ export interface SearchBarProps extends Pick<BoxProps, keyof ChakraProps>, Omit<FormHTMLAttributes<HTMLFormElement>, "color"> {
17
15
  /** The onClick callback function for the `Button` component. */
18
16
  buttonOnClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
19
- /** A class name for the `form` element. */
20
- className?: string;
21
17
  /** Optional string for the SearchBar's description above the component. */
22
18
  descriptionText?: string;
23
19
  /** Optional string value used to set the text for a `Heading` component, or
@@ -26,8 +22,6 @@ export interface SearchBarProps {
26
22
  headingText?: string | JSX.Element;
27
23
  /** The text to display below the form in a `HelperErrorText` component. */
28
24
  helperText?: HelperErrorTextType;
29
- /** ID that other components can cross reference for accessibility purposes */
30
- id: string;
31
25
  /** Optional string to populate the `HelperErrorText` for the error state
32
26
  * when `isInvalid` is true. */
33
27
  invalidText?: HelperErrorTextType;
@@ -39,13 +33,9 @@ export interface SearchBarProps {
39
33
  isRequired?: boolean;
40
34
  /** Populates the `aria-label` attribute on the form element. */
41
35
  labelText: string;
42
- /** Adds 'method' property to the `form` element. */
43
- method?: string;
44
36
  /** Sets the `Button` variant type to `noBrand` when true;
45
37
  * false by default which sets the type to `primary`. */
46
38
  noBrandButtonType?: boolean;
47
- /** Handler function when the form is submitted. */
48
- onSubmit: (event: React.FormEvent) => void;
49
39
  /** Required props to render a `Select` element. */
50
40
  selectProps?: SelectProps | undefined;
51
41
  /** Custom input element to render instead of a `TextInput` element. */
@@ -54,8 +44,8 @@ export interface SearchBarProps {
54
44
  textInputProps?: TextInputProps | undefined;
55
45
  }
56
46
  /**
57
- * Renders a wrapper `form` element to be used with `Select` (optional),
58
- * `Input`, and `Button` components together.
47
+ * `SearchBar` renders a wrapper `form` element containing an `Input`, `Button`,
48
+ * and optional `Select`.
59
49
  */
60
50
  export declare const SearchBar: ChakraComponent<React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLDivElement>>, SearchBarProps>;
61
51
  export default SearchBar;
@@ -1,19 +1,15 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent, ChakraProps } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
- export declare const selectTypesArray: string[];
5
- export declare const labelPositionsArray: string[];
6
- export type SelectTypes = typeof selectTypesArray[number];
4
+ export declare const selectVariantsArray: readonly ["default", "searchbar"];
5
+ export declare const labelPositionsArray: readonly ["default", "inline"];
6
+ export type SelectVariants = typeof selectVariantsArray[number];
7
7
  export type LabelPositions = typeof labelPositionsArray[number];
8
- export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElement> {
9
- /** A class name for the `div` parent element. */
10
- className?: string;
8
+ export interface SelectProps extends Pick<BoxProps, keyof ChakraProps>, Omit<React.SelectHTMLAttributes<HTMLSelectElement>, "color"> {
11
9
  /** The initial value of an uncontrolled component */
12
10
  defaultValue?: string;
13
11
  /** Optional string to populate the `HelperErrorText` for the standard state. */
14
12
  helperText?: HelperErrorTextType;
15
- /** ID that other components can cross reference for accessibility purposes */
16
- id: string;
17
13
  /** Optional string to populate the `HelperErrorText` for the error state
18
14
  * when `isInvalid` is true. */
19
15
  invalidText?: HelperErrorTextType;
@@ -31,18 +27,13 @@ export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElemen
31
27
  * populates an `aria-label` attribute on the select input if `showLabel` is
32
28
  * set to `false`. */
33
29
  labelText: string;
34
- /** Used to reference the select element in forms. */
35
- name: string;
36
- /** The callback function to get the selected value.
37
- * Should be passed along with `value` for controlled components. */
38
- onChange?: (event: React.FormEvent) => void;
39
30
  /** Placeholder text in the select element. */
40
31
  placeholder?: string;
41
32
  /** Allows the '(required)' text to be changed for language purposes
42
33
  * Note: Parenthesis will be added automatically by the component */
43
34
  requiredLabelText?: string;
44
35
  /** The variant to display. */
45
- selectType?: SelectTypes;
36
+ variant?: SelectVariants;
46
37
  /** Offers the ability to hide the helper/invalid text. */
47
38
  showHelperInvalidText?: boolean;
48
39
  /** Offers the ability to show the select's label onscreen or hide it. Refer
@@ -51,9 +42,6 @@ export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElemen
51
42
  /** Whether or not to display the "(required)" text in the label text.
52
43
  * True by default. */
53
44
  showRequiredLabel?: boolean;
54
- /** The value of the selected option.
55
- * Should be passed along with `onChange` for controlled components. */
56
- value?: string;
57
45
  }
58
46
  /**
59
47
  * Component that renders Chakra's `Select` component along with an accessible
@@ -1,19 +1,15 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { LayoutTypes } from "../../helpers/types";
4
4
  export declare const skeletonLoaderImageRatiosArray: readonly ["landscape", "portrait", "square"];
5
5
  export type SkeletonLoaderImageRatios = typeof skeletonLoaderImageRatiosArray[number];
6
- export interface SkeletonLoaderProps {
7
- /** Additional class name for the Skeleton component. */
8
- className?: string;
6
+ export interface SkeletonLoaderProps extends BoxProps {
9
7
  /** Optional numeric value to control the number of lines for content
10
8
  * placeholder; default value is `3`. */
11
9
  contentSize?: number;
12
10
  /** Optional numeric value to control the number of lines for heading
13
11
  * placeholder; default value is `1`. */
14
12
  headingSize?: number;
15
- /** ID that other components can cross reference for accessibility purposes. */
16
- id?: string;
17
13
  /** Optional value to control the aspect ratio of the image placeholder;
18
14
  * default value is `"square"`. */
19
15
  imageAspectRatio?: SkeletonLoaderImageRatios;
@@ -1,10 +1,6 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
- export interface SkipNavigationProps {
4
- /** Additional CSS class name to render in the `nav` element. */
5
- className?: string;
6
- /** ID that other components can cross reference for accessibility purposes */
7
- id?: string;
3
+ export interface SkipNavigationProps extends BoxProps {
8
4
  /** The anchor target for the main skip link. The default is "#mainContent". */
9
5
  target?: string;
10
6
  }
@@ -1,16 +1,12 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
2
- import React from "react";
1
+ import { BoxProps, ChakraComponent, ChakraProps } from "@chakra-ui/react";
2
+ import React, { InputHTMLAttributes } from "react";
3
3
  import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
4
- export interface SliderProps {
5
- /** Additional class name for the Slider component. */
6
- className?: string;
4
+ export interface SliderProps extends Pick<BoxProps, keyof ChakraProps>, Omit<InputHTMLAttributes<HTMLInputElement>, "color" | "defaultValue" | "height" | "onChange" | "value" | "width"> {
7
5
  /** The initial value for the single `Slider` or an array of two number
8
6
  * values for the `isRangeSlider` case. */
9
7
  defaultValue?: number | number[];
10
8
  /** Optional string to populate the HelperErrorText for standard state */
11
9
  helperText?: HelperErrorTextType;
12
- /** ID that other components can cross reference for accessibility purposes. */
13
- id: string;
14
10
  /** Optional string to populate the `HelperErrorText` for the error state
15
11
  * when `isInvalid` is true. */
16
12
  invalidText?: HelperErrorTextType;
@@ -1,12 +1,12 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import { LayoutTypes } from "../../helpers/types";
3
3
  import React from "react";
4
+ import { sizesArray } from "../../theme/sharedTypes";
4
5
  export declare const borderTypeArray: readonly ["none", "circular", "straight"];
5
6
  export type BorderType = typeof borderTypeArray[number];
6
7
  export declare const colorTypeArray: readonly ["link", "textDefault", "textInverse"];
7
8
  export type ColorType = typeof colorTypeArray[number];
8
- export declare const sizeTypeArray: readonly ["small", "medium", "large"];
9
- export type SizeType = typeof sizeTypeArray[number];
9
+ export type SizeType = typeof sizesArray[number];
10
10
  type IconNames = "fileTypeGenericDoc" | "socialFacebook" | "socialInstagram" | "socialPinterest" | "socialSoundCloud" | "socialTikTok" | "socialTumblr" | "socialTwitter" | "socialX" | "socialYoutube";
11
11
  export interface SocialMediaLinkDataProps {
12
12
  /** Required. Label rendered on page is showLabel is true */
@@ -16,13 +16,9 @@ export interface SocialMediaLinkDataProps {
16
16
  /** Required. Url to link to the platform */
17
17
  url: string;
18
18
  }
19
- interface BaseSocialMediaLinksProps {
20
- /** Optional className you can add in addition to "social-media-links." */
21
- className?: string;
19
+ interface BaseSocialMediaLinksProps extends BoxProps {
22
20
  /** Any of three optional values that will change the color of the svg and label text (if any). */
23
21
  color?: ColorType;
24
- /** ID that other components can cross-reference for accessibility purposes. */
25
- id?: string;
26
22
  /** Optional desktop layout. Smaller viewports are always in a column if there are labels and
27
23
  * in a row if there are no labels. */
28
24
  layout?: LayoutTypes;
@@ -1,15 +1,11 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
+ import { messageVariantsArray } from "../../theme/sharedTypes";
3
4
  export declare const statusBadgeFontSizeArray: readonly ["desktop.body.body1", "desktop.body.body2", "desktop.caption"];
4
- export declare const statusBadgeTypeArray: readonly ["informative", "negative", "neutral", "positive", "recommendation", "warning"];
5
- export type StatusBadgeTypes = typeof statusBadgeTypeArray[number];
6
- export interface StatusBadgeProps {
7
- /** Additional class for the component */
8
- className?: string;
9
- /** ID that other components can cross reference for accessibility purposes */
10
- id?: string;
5
+ export type StatusBadgeVariants = typeof messageVariantsArray[number];
6
+ export interface StatusBadgeProps extends BoxProps {
11
7
  /** Semantic type of the status badge. */
12
- type?: StatusBadgeTypes;
8
+ variant?: StatusBadgeVariants;
13
9
  }
14
10
  /**
15
11
  * The `StatusBadge` component is a label that indicates status or importance.
@@ -1,4 +1,4 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { ComponentImageProps } from "../Image/Image";
4
4
  export type StructuredContentImagePosition = "left" | "right" | "center";
@@ -7,17 +7,13 @@ interface StructuredContentImageProps extends ComponentImageProps {
7
7
  * Defaults to `"left"`. */
8
8
  position?: StructuredContentImagePosition;
9
9
  }
10
- export interface StructuredContentProps {
10
+ export interface StructuredContentProps extends BoxProps {
11
11
  /** Optional value to set the text for the callout heading text. */
12
12
  calloutText?: string | JSX.Element;
13
- /** Additional class name for the `StructuredContent` component. */
14
- className?: string;
15
13
  /** Optional string value used to set the text for a `Heading` component, or
16
14
  * a DS Heading component that can be passed in.
17
15
  */
18
16
  headingText?: string | JSX.Element;
19
- /** ID that other components can cross reference for accessibility purposes. */
20
- id?: string;
21
17
  /** Object used to create and render the `Image` component. */
22
18
  imageProps?: StructuredContentImageProps;
23
19
  /** Required value to set the text for the body content. */
@@ -1,14 +1,8 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  export declare const textSizesArray: readonly ["default", "body1", "body2", "caption"];
4
4
  export type StyledListTextSizes = typeof textSizesArray[number];
5
- export interface StyledListProps {
6
- /** Any child node passed to the component. */
7
- children?: React.ReactNode;
8
- /** A class name for the StyledList parent div. */
9
- className?: string;
10
- /** ID that other components can cross reference for accessibility purposes. */
11
- id?: string;
5
+ export interface StyledListProps extends Omit<BoxProps, "style"> {
12
6
  /** Data to render if `li` children elements are not passed. It must be an
13
7
  * array of strings or JSX elements. */
14
8
  listItems?: (string | JSX.Element)[];
@@ -1,27 +1,19 @@
1
1
  import React from "react";
2
- import { ChakraComponent } from "@chakra-ui/react";
3
- export declare const actionBackgroundColorsArray: readonly ["brand.primary-05", "section.blogs.primary-05", "section.books-and-more.primary-05", "section.connect.primary-05", "section.education.primary-05", "section.locations.primary-05", "section.research.primary-05", "section.research-library.lpa-05", "section.research-library.schomburg-05", "section.research-library.schwarzman-05", "section.whats-on.primary-05", "dark.brand.primary-05", "dark.section.blogs.primary-05", "dark.section.books-and-more.primary-05", "dark.section.connect.primary-05", "dark.section.education.primary-05", "dark.section.locations.primary-05", "dark.section.research.secondary-05", "dark.section.research-library.lpa-05", "dark.section.research-library.schomburg-05", "dark.section.research-library.schwarzman-05", "dark.section.whats-on.primary-05"];
4
- export type actionBackgroundColors = typeof actionBackgroundColorsArray[number];
5
- export declare const highlightColorsArray: string[];
2
+ import { ChakraComponent, BoxProps } from "@chakra-ui/react";
3
+ import { bgColorsArray, highlightColorsArray } from "../../theme/sharedTypes";
4
+ export type actionBackgroundColors = typeof bgColorsArray[number];
6
5
  export type highlightColors = typeof highlightColorsArray[number];
7
- export interface SubNavProps {
6
+ export interface SubNavProps extends BoxProps {
8
7
  /**
9
8
  * The background color to be applied to the hover and active states
10
9
  * of the SubNavLink and SubNavButton components.
11
10
  * This allows for customization of the action items.
12
11
  */
13
12
  actionBackgroundColor?: actionBackgroundColors;
14
- /** Additional class name for the `SubNav` component. */
15
- className?: string;
16
13
  /**
17
14
  * Custom color for SubNavLink, SubNavButton, and icons.
18
15
  */
19
16
  highlightColor?: highlightColors;
20
- /**
21
- * Optional unique ID for accessibility, allowing other components
22
- * to reference this element.
23
- */
24
- id?: string;
25
17
  /**
26
18
  * Primary actions displayed on the left side of the SubNav.
27
19
  * Use SubNavButton and SubNavLink components, which mirror
@@ -37,7 +29,6 @@ export interface SubNavProps {
37
29
  }
38
30
  interface SubNavItemProps {
39
31
  id: string;
40
- children: React.ReactNode;
41
32
  isOutlined?: boolean;
42
33
  isSelected?: boolean;
43
34
  screenreaderOnlyText?: string;
@@ -1,10 +1,6 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
- export declare const tableBodyTextSizesArray: readonly ["body1", "body2"];
4
- export type TableBodyTextSizes = typeof tableBodyTextSizesArray[number];
5
- export interface TableProps {
6
- /** Additional class name for the `Table` component. */
7
- className?: string;
3
+ export interface TableProps extends BoxProps {
8
4
  /** Array of string values used to populate the `Table` column headers.
9
5
  * For improved accessibility, column headers are required. */
10
6
  columnHeaders: string[];
@@ -16,10 +12,6 @@ export interface TableProps {
16
12
  * Any style can be passed, but the most common use would be to pass "width"
17
13
  * and "maxWidth" to set custom column widths. */
18
14
  columnStyles?: object[];
19
- /** The size of the table body text. */
20
- tableTextSize?: TableBodyTextSizes;
21
- /** ID that other components can cross reference for accessibility purposes. */
22
- id?: string;
23
15
  /** If true, horizontal scrolling will be enabled for the table content. */
24
16
  isScrollable?: boolean;
25
17
  /** If true, a border will be displayed between each row in the `Table`
@@ -1,14 +1,12 @@
1
- import { Tab, TabList, TabPanels, TabPanel, ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, Tab, TabList, TabPanels, TabPanel, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  export interface TabsDataProps {
4
4
  label: string;
5
5
  content: string | React.ReactNode;
6
6
  }
7
- export interface TabsProps {
7
+ export interface TabsProps extends Omit<BoxProps, "onChange"> {
8
8
  /** The index of the tab to display on the initial render. */
9
9
  defaultIndex?: number;
10
- /** ID that other components can cross reference for accessibility purposes */
11
- id?: string;
12
10
  /** The callback function invoked after every tab change event. The argument passed to the callback is the index of the tab just selected. */
13
11
  onChange?: (index: number) => any;
14
12
  /** Array of data to display */
@@ -2,15 +2,8 @@ import { ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  import { TagSetExploreProps } from "./TagSetExplore";
4
4
  import { TagSetFilterProps } from "./TagSetFilter";
5
- export interface BaseTagSetProps {
6
- /** Additional class for the component. */
7
- className?: string;
8
- /** ID that other components can cross reference for accessibility purposes. */
9
- id?: string;
10
- }
11
- export type TagSetTypeProps = TagSetFilterProps | TagSetExploreProps;
12
- export type TagSetProps = BaseTagSetProps & TagSetTypeProps;
13
- export declare function isFilterType(type: TagSetProps["type"]): type is "filter";
5
+ export type TagSetProps = TagSetFilterProps | TagSetExploreProps;
6
+ export declare function isFilterVariant(variant: TagSetProps["variant"]): variant is "filter";
14
7
  /**
15
8
  * The `TagSet` component renders a group of individual tags which have two
16
9
  * variants: "explore" and "filter". The "explore" tags are meant to be used for
@@ -1,3 +1,4 @@
1
+ import { BoxProps } from "@chakra-ui/react";
1
2
  import React from "react";
2
3
  import { IconNames } from "../Icons/Icon";
3
4
  export interface TagSetExploreDataProps {
@@ -8,7 +9,7 @@ export interface TagSetExploreDataProps {
8
9
  /** The content to display; should be a link-type component. */
9
10
  label: JSX.Element;
10
11
  }
11
- export interface TagSetExploreProps {
12
+ export interface TagSetExploreProps extends BoxProps {
12
13
  /** Whether the tags should be removable. This prop is not used in the
13
14
  * "explore" variant. */
14
15
  isDismissible?: never;
@@ -21,7 +22,7 @@ export interface TagSetExploreProps {
21
22
  /** The array of data to display as tags. */
22
23
  tagSetData: TagSetExploreDataProps[];
23
24
  /** The `TagSet` variant to render; "filter" by default. */
24
- type: "explore";
25
+ variant?: "explore";
25
26
  }
26
27
  /**
27
28
  * The "explore" `TagSet` variant will always display the tags passed as data.
@@ -1,4 +1,5 @@
1
1
  /// <reference types="react" />
2
+ import { BoxProps } from "@chakra-ui/react";
2
3
  import { IconNames } from "../Icons/Icon";
3
4
  export interface TagSetFilterDataProps {
4
5
  /** The name of the SVG `Icon` to render before the tag label. */
@@ -10,9 +11,7 @@ export interface TagSetFilterDataProps {
10
11
  /** Any other properties the consuming app may need for app logic filtering. */
11
12
  [key: string]: string;
12
13
  }
13
- export interface TagSetFilterProps {
14
- /** ID that other components can cross reference for accessibility purposes. */
15
- id?: string;
14
+ export interface TagSetFilterProps extends Omit<BoxProps, "onClick"> {
16
15
  /** Whether the tags should be removable. */
17
16
  isDismissible?: boolean;
18
17
  /** The function to perform when a tag is clicked when `isDismissible` is true. */
@@ -20,7 +19,7 @@ export interface TagSetFilterProps {
20
19
  /** The array of data to display as tags. */
21
20
  tagSetData: TagSetFilterDataProps[];
22
21
  /** The `TagSet` variant to render; "filter" by default. */
23
- type: "filter";
22
+ variant?: "filter";
24
23
  }
25
24
  /**
26
25
  * The "filter" `TagSet` variant will display tags that can be removed when
@@ -1,18 +1,14 @@
1
1
  /// <reference types="react" />
2
- import { ChakraComponent } from "@chakra-ui/react";
3
- export declare const sidebarPlacementArray: readonly ["none", "left", "right"];
4
- export type SidebarPlacement = typeof sidebarPlacementArray[number];
2
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
3
+ export declare const templateVariantArray: readonly ["full", "narrow", "sidebarLeft", "sidebarRight"];
4
+ export type TemplateVariant = typeof templateVariantArray[number];
5
5
  export interface TemplateProps {
6
- /** ID that other components can cross reference for accessibility purposes. */
7
- id?: string;
8
- /** Renders the `TemplateSidebar` component either on the left or
9
- * right side of the `TemplateMain` component. */
10
- sidebar?: SidebarPlacement;
6
+ /** Specifies the layout and DOM structure related to the content region. */
7
+ variant?: TemplateVariant;
11
8
  }
12
- export interface TemplateMainProps {
13
- /** ID used for the `main` HTML element. Defaults to "mainContent". Useful
14
- * anchor for the application skip navigation. */
15
- id?: string;
9
+ export interface TemplateChildProps extends BoxProps {
10
+ }
11
+ export interface TemplateMainProps extends TemplateChildProps {
16
12
  }
17
13
  /**
18
14
  * The main top-level parent component that wraps all template-related
@@ -20,43 +16,37 @@ export interface TemplateMainProps {
20
16
  */
21
17
  declare const Template: ChakraComponent<React.ForwardRefExoticComponent<React.PropsWithChildren<TemplateProps> & React.RefAttributes<HTMLDivElement>>, React.PropsWithChildren<TemplateProps>>;
22
18
  /**
23
- * This optional component renders its children above the main content
24
- * and spans edge-to-edge. It is most useful for `Breadcrumbs`, `Hero`,
25
- * or other banner-like components.
19
+ * This component renders an HTML `<header>` element.
20
+ */
21
+ declare const TemplateHeader: React.FC<React.PropsWithChildren<TemplateChildProps>>;
22
+ /**
23
+ * This component renders an HTML `<footer>` element.
26
24
  */
27
- declare const TemplateBreakout: React.FC<React.PropsWithChildren>;
25
+ declare const TemplateFooter: React.FC<React.PropsWithChildren<TemplateChildProps>>;
28
26
  /**
29
- * This optional component renders content at a max width of 1280px and
30
- * will render below `TemplateBreakout` (if being used) and above the
31
- * main content and sidebar (if one exists).
27
+ * This component renders an HTML `<main>` element.
32
28
  */
33
- declare const TemplateTop: React.FC<React.PropsWithChildren>;
29
+ declare const TemplateMain: React.FC<React.PropsWithChildren<TemplateChildProps>>;
34
30
  /**
35
- * This component renders an HTML `<main>` element with an id of "mainContent".
36
- * The "mainContent" id should be used as the consuming application's skip
37
- * navigation link. The component should not be used in conjunction with
38
- * `TemplateMainNarrow`.
31
+ * This optional component spans the full width of the browser window
32
+ * (edge-to-edge). It is most useful for `Breadcrumbs`, `Hero`, or other
33
+ * banner-like components.
39
34
  */
40
- declare const TemplateMain: React.FC<React.PropsWithChildren<TemplateMainProps>>;
35
+ declare const TemplateBreakout: React.FC<React.PropsWithChildren<TemplateChildProps>>;
41
36
  /**
42
- * This component renders an HTML `<main>` element with an id of "mainContent".
43
- * The "mainContent" id should be used as the consuming application's skip
44
- * navigation link. It provides a narrower container for better readability if
45
- * the main content includes long text. This component is meant to be used in
46
- * lieu of `TemplateMain`, and should not be used in conjunction with
47
- * `TemplateSidebar`.
37
+ * This optional component will span the full width of the content area and will
38
+ * render content at a max width of 1280px.
48
39
  */
49
- declare const TemplateMainNarrow: React.FC<React.PropsWithChildren<TemplateMainProps>>;
40
+ declare const TemplateFull: React.FC<React.PropsWithChildren<TemplateChildProps>>;
50
41
  /**
51
- * This optional component is used to render content in a sidebar column.
52
- * It must be paired with the `TemplateMain` component. An optional `sidebar`
53
- * prop value of "left" or "right" must be passed to the `Template` wrapper
54
- * to render the correct CSS styles.
42
+ * The width of this component is dependent on the value of the `variant` prop.
55
43
  */
56
- declare const TemplateSidebar: React.FC<React.PropsWithChildren>;
44
+ declare const TemplateContent: React.FC<React.PropsWithChildren<TemplateMainProps>>;
57
45
  /**
58
- * This optional component renders content at a max width of 1280px and
59
- * will always render below the main content and sidebar (if one exists).
46
+ * This optional component is used to render content in a sidebar column. For
47
+ * proper rendering, this component must be paired with the `TemplateMain`
48
+ * component and the `variant` prop must be set to "sidebarLeft" or
49
+ * "sidebarRight".
60
50
  */
61
- declare const TemplateBottom: React.FC<React.PropsWithChildren>;
62
- export { Template, TemplateBreakout, TemplateTop, TemplateMain, TemplateMainNarrow, TemplateSidebar, TemplateBottom, };
51
+ declare const TemplateSidebar: React.FC<React.PropsWithChildren<TemplateChildProps>>;
52
+ export { Template, TemplateBreakout, TemplateContent, TemplateFooter, TemplateFull, TemplateHeader, TemplateMain, TemplateSidebar, };
@@ -1,15 +1,11 @@
1
- import { ChakraComponent } from "@chakra-ui/react";
1
+ import { BoxProps, ChakraComponent } from "@chakra-ui/react";
2
2
  import React from "react";
3
3
  export declare const textSizesArray: readonly ["default", "body1", "body2", "caption", "tag", "mini", "overline1", "overline2", "subtitle1", "subtitle2"];
4
4
  export type TextSizes = typeof textSizesArray[number];
5
- export interface TextProps {
6
- /** Additional class name to render in the `Text` component. */
7
- className?: string;
8
- /** ID that other components can cross reference for accessibility purposes. */
9
- id?: string;
5
+ export interface TextProps extends BoxProps {
10
6
  /** Optional prop used to show bolded text */
11
7
  isBold?: boolean;
12
- /** Optional prop used to show itlicized text */
8
+ /** Optional prop used to show italicized text */
13
9
  isItalic?: boolean;
14
10
  /** Optional prop used to show capitalized text */
15
11
  isCapitalized?: boolean;
@@ -17,10 +13,6 @@ export interface TextProps {
17
13
  isUppercase?: boolean;
18
14
  /** Optional prop used to show lower case text */
19
15
  isLowercase?: boolean;
20
- /** Optional prop used to remove default spacing */
21
- noSpace?: boolean;
22
- /** Optional prop used to explicitly set the ARIA role */
23
- role?: string;
24
16
  /** Optional prop to control the text styling */
25
17
  size?: TextSizes;
26
18
  }