@nypl/design-system-react-components 1.5.4 → 1.6.0-vite-rc-2

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 (205) hide show
  1. package/README.md +24 -40
  2. package/dist/design-system-react-components.cjs +304 -0
  3. package/dist/design-system-react-components.js +42142 -0
  4. package/dist/{components → src/components}/Accordion/Accordion.d.ts +29 -29
  5. package/dist/{components → src/components}/AlphabetFilter/AlphabetFilter.d.ts +23 -23
  6. package/dist/{components → src/components}/AudioPlayer/AudioPlayer.d.ts +43 -43
  7. package/dist/{components → src/components}/Breadcrumbs/Breadcrumbs.d.ts +24 -18
  8. package/dist/{components → src/components}/Button/Button.d.ts +33 -30
  9. package/dist/{components → src/components}/ButtonGroup/ButtonGroup.d.ts +25 -24
  10. package/dist/{components → src/components}/Card/Card.d.ts +55 -55
  11. package/dist/{components → src/components}/Checkbox/Checkbox.d.ts +47 -47
  12. package/dist/{components → src/components}/CheckboxGroup/CheckboxGroup.d.ts +51 -51
  13. package/dist/{components → src/components}/ComponentWrapper/ComponentWrapper.d.ts +31 -31
  14. package/dist/{components → src/components}/DatePicker/DatePicker.d.ts +82 -81
  15. package/dist/{components → src/components}/FeedbackBox/FeedbackBox.d.ts +64 -63
  16. package/dist/{components → src/components}/FeedbackBox/useFeedbackBoxReducer.d.ts +19 -19
  17. package/dist/{components → src/components}/Fieldset/Fieldset.d.ts +24 -24
  18. package/dist/{components → src/components}/FilterBar/FilterBar.d.ts +61 -111
  19. package/dist/{components → src/components}/Footer/Footer.d.ts +14 -14
  20. package/dist/{components → src/components}/Footer/footerLinks.d.ts +12 -12
  21. package/dist/{components → src/components}/Form/Form.d.ts +31 -31
  22. package/dist/{components → src/components}/Grid/SimpleGrid.d.ts +20 -19
  23. package/dist/{components → src/components}/Header/Header.d.ts +21 -22
  24. package/dist/{components → src/components}/Header/components/HeaderLogin.d.ts +12 -12
  25. package/dist/{components → src/components}/Header/components/HeaderLoginButton.d.ts +10 -11
  26. package/dist/{components → src/components}/Header/components/HeaderLowerNav.d.ts +6 -7
  27. package/dist/{components → src/components}/Header/components/HeaderMobileIconNav.d.ts +6 -7
  28. package/dist/{components → src/components}/Header/components/HeaderMobileNav.d.ts +6 -7
  29. package/dist/{components → src/components}/Header/components/HeaderMobileNavButton.d.ts +6 -7
  30. package/dist/{components → src/components}/Header/components/HeaderSearchButton.d.ts +9 -10
  31. package/dist/{components → src/components}/Header/components/HeaderSearchForm.d.ts +10 -11
  32. package/dist/{components → src/components}/Header/components/HeaderSitewideAlerts.d.ts +7 -8
  33. package/dist/{components → src/components}/Header/components/HeaderUpperNav.d.ts +7 -8
  34. package/dist/{components → src/components}/Header/context/headerContext.d.ts +13 -13
  35. package/dist/{components → src/components}/Header/utils/googleAnalyticsUtils.d.ts +16 -16
  36. package/dist/{components → src/components}/Header/utils/headerUtils.d.ts +94 -94
  37. package/dist/{components → src/components}/Heading/Heading.d.ts +37 -35
  38. package/dist/{components → src/components}/HelperErrorText/HelperErrorText.d.ts +34 -34
  39. package/dist/{components → src/components}/Hero/Hero.d.ts +43 -42
  40. package/dist/{components → src/components}/HorizontalRule/HorizontalRule.d.ts +11 -11
  41. package/dist/{components → src/components}/Icons/Icon.d.ts +40 -41
  42. package/dist/src/components/Icons/IconSvgs.d.ts +163 -0
  43. package/dist/src/components/Icons/iconVariables.d.ts +6 -0
  44. package/dist/{components → src/components}/Image/Image.d.ts +68 -65
  45. package/dist/{components → src/components}/Label/Label.d.ts +25 -25
  46. package/dist/{components → src/components}/Link/Link.d.ts +22 -21
  47. package/dist/{components → src/components}/List/List.d.ts +42 -42
  48. package/dist/{components → src/components}/Logo/Logo.d.ts +28 -28
  49. package/dist/src/components/Logo/LogoSvgs.d.ts +157 -0
  50. package/dist/{components → src/components}/Modal/Modal.d.ts +35 -35
  51. package/dist/{components → src/components}/MultiSelect/MultiSelect.d.ts +61 -78
  52. package/dist/{components → src/components}/MultiSelect/MultiSelectDialog.d.ts +8 -8
  53. package/dist/{components → src/components}/MultiSelect/MultiSelectListbox.d.ts +9 -9
  54. package/dist/{components → src/components}/MultiSelect/MultiSelectMenuButton.d.ts +27 -27
  55. package/dist/{components → src/components}/MultiSelectGroup/MultiSelectGroup.d.ts +28 -26
  56. package/dist/{components → src/components}/Notification/Notification.d.ts +52 -51
  57. package/dist/{components → src/components}/Pagination/Pagination.d.ts +27 -27
  58. package/dist/{components → src/components}/ProgressIndicator/ProgressIndicator.d.ts +32 -30
  59. package/dist/{components → src/components}/Radio/Radio.d.ts +43 -43
  60. package/dist/{components → src/components}/RadioGroup/RadioGroup.d.ts +51 -51
  61. package/dist/{components → src/components}/SearchBar/SearchBar.d.ts +58 -58
  62. package/dist/{components → src/components}/Select/Select.d.ts +59 -57
  63. package/dist/{components → src/components}/SkeletonLoader/SkeletonLoader.d.ts +42 -41
  64. package/dist/{components → src/components}/SkipNavigation/SkipNavigation.d.ts +19 -19
  65. package/dist/{components → src/components}/Slider/Slider.d.ts +65 -65
  66. package/dist/{components → src/components}/StatusBadge/StatusBadge.d.ts +19 -18
  67. package/dist/{components → src/components}/StructuredContent/StructuredContent.d.ts +30 -30
  68. package/dist/src/components/StyleGuide/ColorCard.d.ts +342 -0
  69. package/dist/{components → src/components}/StyledList/StyledList.d.ts +25 -25
  70. package/dist/{components → src/components}/Table/Table.d.ts +32 -32
  71. package/dist/{components → src/components}/Tabs/Tabs.d.ts +28 -28
  72. package/dist/{components → src/components}/TagSet/TagSet.d.ts +24 -32
  73. package/dist/{components → src/components}/TagSet/TagSetExplore.d.ts +28 -27
  74. package/dist/{components → src/components}/TagSet/TagSetFilter.d.ts +25 -26
  75. package/dist/src/components/TagSet/TooltipWrapper.d.ts +9 -0
  76. package/dist/{components → src/components}/Template/Template.d.ts +140 -140
  77. package/dist/{components → src/components}/Text/Text.d.ts +25 -24
  78. package/dist/{components → src/components}/TextInput/TextInput.d.ts +89 -88
  79. package/dist/{components → src/components}/Toggle/Toggle.d.ts +43 -42
  80. package/dist/{components → src/components}/Tooltip/Tooltip.d.ts +17 -17
  81. package/dist/{components → src/components}/VideoPlayer/VideoPlayer.d.ts +42 -40
  82. package/dist/src/helpers/types.d.ts +2 -0
  83. package/dist/{hooks → src/hooks}/useCarouselStyles.d.ts +17 -17
  84. package/dist/{hooks → src/hooks}/useCloseDropDown.d.ts +7 -7
  85. package/dist/{hooks → src/hooks}/useFilterBar.d.ts +21 -21
  86. package/dist/{hooks → src/hooks}/useMultiSelect.d.ts +15 -15
  87. package/dist/{hooks → src/hooks}/useNYPLBreakpoints.d.ts +13 -13
  88. package/dist/{hooks → src/hooks}/useNYPLTheme.d.ts +67 -67
  89. package/dist/{hooks → src/hooks}/useStateWithDependencies.d.ts +5 -5
  90. package/dist/{hooks → src/hooks}/useWindowSize.d.ts +10 -10
  91. package/dist/src/index.d.ts +91 -0
  92. package/dist/{theme → src/theme}/components/accordion.d.ts +34 -34
  93. package/dist/{theme → src/theme}/components/alphabetFilter.d.ts +33 -33
  94. package/dist/{theme → src/theme}/components/audioPlayer.d.ts +16 -16
  95. package/dist/{theme → src/theme}/components/breadcrumb.d.ts +138 -151
  96. package/dist/{theme → src/theme}/components/button.d.ts +113 -113
  97. package/dist/{theme → src/theme}/components/buttonGroup.d.ts +11 -11
  98. package/dist/{theme → src/theme}/components/card.d.ts +421 -421
  99. package/dist/{theme → src/theme}/components/checkbox.d.ts +178 -178
  100. package/dist/{theme → src/theme}/components/checkboxGroup.d.ts +14 -14
  101. package/dist/{theme → src/theme}/components/componentWrapper.d.ts +12 -12
  102. package/dist/{theme → src/theme}/components/customTable.d.ts +733 -733
  103. package/dist/{theme → src/theme}/components/datePicker.d.ts +17 -17
  104. package/dist/{theme → src/theme}/components/feedbackBox.d.ts +92 -92
  105. package/dist/{theme → src/theme}/components/fieldset.d.ts +23 -23
  106. package/dist/{theme → src/theme}/components/filterBar.d.ts +46 -46
  107. package/dist/{theme → src/theme}/components/footer.d.ts +244 -244
  108. package/dist/{theme → src/theme}/components/global.d.ts +140 -140
  109. package/dist/{theme → src/theme}/components/globalMixins.d.ts +40 -40
  110. package/dist/{theme → src/theme}/components/header/header.d.ts +72 -72
  111. package/dist/{theme → src/theme}/components/header/headerLogin.d.ts +327 -327
  112. package/dist/{theme → src/theme}/components/header/headerLoginButton.d.ts +69 -69
  113. package/dist/{theme → src/theme}/components/header/headerLowerNav.d.ts +70 -70
  114. package/dist/{theme → src/theme}/components/header/headerMobileIconNav.d.ts +28 -28
  115. package/dist/{theme → src/theme}/components/header/headerMobileNav.d.ts +86 -86
  116. package/dist/{theme → src/theme}/components/header/headerMobileNavButton.d.ts +34 -34
  117. package/dist/{theme → src/theme}/components/header/headerSearchButton.d.ts +83 -83
  118. package/dist/{theme → src/theme}/components/header/headerSearchForm.d.ts +183 -183
  119. package/dist/{theme → src/theme}/components/header/headerSitewideAlerts.d.ts +42 -42
  120. package/dist/{theme → src/theme}/components/header/headerUpperNav.d.ts +72 -72
  121. package/dist/{theme → src/theme}/components/heading.d.ts +173 -173
  122. package/dist/{theme → src/theme}/components/helperErrorText.d.ts +15 -15
  123. package/dist/{theme → src/theme}/components/hero.d.ts +628 -628
  124. package/dist/{theme → src/theme}/components/horizontalRule.d.ts +18 -18
  125. package/dist/{theme → src/theme}/components/icon.d.ts +62251 -62251
  126. package/dist/{theme → src/theme}/components/image.d.ts +662 -662
  127. package/dist/{theme → src/theme}/components/label.d.ts +21 -21
  128. package/dist/{theme → src/theme}/components/link.d.ts +106 -106
  129. package/dist/{theme → src/theme}/components/list.d.ts +228 -228
  130. package/dist/{theme → src/theme}/components/logo.d.ts +477 -477
  131. package/dist/{theme → src/theme}/components/modal.d.ts +21 -21
  132. package/dist/{theme → src/theme}/components/multiSelect.d.ts +29 -29
  133. package/dist/{theme → src/theme}/components/multiSelectMenuButton.d.ts +95 -95
  134. package/dist/{theme → src/theme}/components/notification.d.ts +136 -136
  135. package/dist/{theme → src/theme}/components/pagination.d.ts +16 -16
  136. package/dist/{theme → src/theme}/components/progressIndicator.d.ts +68 -68
  137. package/dist/{theme → src/theme}/components/radio.d.ts +202 -202
  138. package/dist/{theme → src/theme}/components/radioGroup.d.ts +14 -14
  139. package/dist/{theme → src/theme}/components/searchBar.d.ts +34 -34
  140. package/dist/{theme → src/theme}/components/select.d.ts +125 -126
  141. package/dist/{theme → src/theme}/components/skeletonLoader.d.ts +105 -105
  142. package/dist/{theme → src/theme}/components/skipNavigation.d.ts +28 -28
  143. package/dist/{theme → src/theme}/components/slider.d.ts +78 -78
  144. package/dist/{theme → src/theme}/components/statusBadge.d.ts +37 -37
  145. package/dist/{theme → src/theme}/components/structuredContent.d.ts +385 -385
  146. package/dist/{theme → src/theme}/components/styledList.d.ts +51 -51
  147. package/dist/{theme → src/theme}/components/tabs.d.ts +172 -172
  148. package/dist/{theme → src/theme}/components/tagSet.d.ts +154 -154
  149. package/dist/{theme → src/theme}/components/template.d.ts +86 -86
  150. package/dist/{theme → src/theme}/components/text.d.ts +30 -30
  151. package/dist/{theme → src/theme}/components/textInput.d.ts +349 -355
  152. package/dist/{theme → src/theme}/components/toggle.d.ts +129 -129
  153. package/dist/{theme → src/theme}/components/tooltip.d.ts +19 -19
  154. package/dist/{theme → src/theme}/components/videoPlayer.d.ts +47 -47
  155. package/dist/{theme → src/theme}/foundations/breakpoints.d.ts +23 -23
  156. package/dist/{theme → src/theme}/foundations/colors.d.ts +3 -3
  157. package/dist/{theme → src/theme}/foundations/global.d.ts +68 -68
  158. package/dist/{theme → src/theme}/foundations/radii.d.ts +11 -11
  159. package/dist/{theme → src/theme}/foundations/shadows.d.ts +4 -4
  160. package/dist/{theme → src/theme}/foundations/spacing.d.ts +96 -96
  161. package/dist/{theme → src/theme}/foundations/typography.d.ts +8 -8
  162. package/dist/{theme → src/theme}/index.d.ts +20 -20
  163. package/dist/{theme → src/theme}/provider.d.ts +4 -4
  164. package/dist/src/theme/types.d.ts +1 -0
  165. package/dist/src/utils/colorUtils.d.ts +5 -0
  166. package/dist/{utils → src/utils}/interfaces.d.ts +5 -5
  167. package/dist/{utils → src/utils}/utils.d.ts +39 -39
  168. package/dist/styles.css +1 -4
  169. package/package.json +62 -69
  170. package/dist/__tests__/fileMock.d.ts +0 -4
  171. package/dist/__tests__/mediaMatchMock.d.ts +0 -79
  172. package/dist/__tests__/setup.d.ts +0 -2
  173. package/dist/__tests__/utils/utils.test.d.ts +0 -1
  174. package/dist/components/Autosuggest/Autosuggest.stories.d.ts +0 -4
  175. package/dist/components/FilterBar/FilterBar.stories.d.ts +0 -7
  176. package/dist/components/Header/utils/authApiMockResponse.d.ts +0 -49
  177. package/dist/components/Header/utils/encoreCatalogLogOutTimer.d.ts +0 -4
  178. package/dist/components/Header/utils/encoreCatalogLogOutTimer.test.d.ts +0 -1
  179. package/dist/components/Header/utils/googleAnalyticsUtils.test.d.ts +0 -1
  180. package/dist/components/Header/utils/headerUtils.test.d.ts +0 -1
  181. package/dist/components/Header/utils/sitewideAlertsMocks.d.ts +0 -98
  182. package/dist/components/Icons/IconColors.d.ts +0 -3
  183. package/dist/components/Icons/IconNames.d.ts +0 -3
  184. package/dist/components/Icons/IconSvgs.d.ts +0 -58
  185. package/dist/components/Logo/LogoSvgs.d.ts +0 -54
  186. package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -4
  187. package/dist/components/MultiSelectGroup/MultiSelectGroup.stories.d.ts +0 -4
  188. package/dist/components/Placeholder/Placeholder.d.ts +0 -10
  189. package/dist/components/StyleGuide/ColorCard.d.ts +0 -46
  190. package/dist/design-system-react-components.cjs.development.js +0 -18076
  191. package/dist/design-system-react-components.cjs.development.js.map +0 -1
  192. package/dist/design-system-react-components.cjs.production.min.js +0 -2
  193. package/dist/design-system-react-components.cjs.production.min.js.map +0 -1
  194. package/dist/design-system-react-components.esm.js +0 -17874
  195. package/dist/design-system-react-components.esm.js.map +0 -1
  196. package/dist/helpers/types.d.ts +0 -1
  197. package/dist/hooks/__tests__/useCarouselStyles.test.d.ts +0 -1
  198. package/dist/hooks/__tests__/useFilterBar.test.d.ts +0 -1
  199. package/dist/hooks/__tests__/useMultiSelect.test.d.ts +0 -1
  200. package/dist/hooks/__tests__/useNYPLBreakpoints.test.d.ts +0 -1
  201. package/dist/index.d.ts +0 -66
  202. package/dist/index.js +0 -8
  203. package/dist/resources.scss +0 -382
  204. package/dist/theme/types.d.ts +0 -1
  205. package/dist/utils/componentCategories.d.ts +0 -1
@@ -1,51 +1,51 @@
1
- import React from "react";
2
- import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
- import { LayoutTypes } from "../../helpers/types";
4
- export interface CheckboxGroupProps {
5
- /** Any child node passed to the component. */
6
- children: React.ReactNode;
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 `Checkbox`s' wrapper to be full width. */
18
- isFullWidth?: boolean;
19
- /** A`dds 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 checkbox 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 checkbox buttons in a row or column (default). */
28
- layout?: LayoutTypes;
29
- /** The `name` prop indicates the form group for all the `Checkbox` 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
- /** The values to programmatically update the selected `Checkbox`es. */
42
- value?: string[];
43
- }
44
- /**
45
- * Wrapper component to wrap `Checkbox` components. Can be displayed in a
46
- * column or in a row. The `CheckboxGroup` component renders all the necessary
47
- * wrapping and associated text elements, but the checkbox input elements
48
- * _need_ to be child `Checkbox` components from the NYPL Design System.
49
- */
50
- export declare const CheckboxGroup: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>, {}>;
51
- export default CheckboxGroup;
1
+ import React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ import { LayoutTypes } from "../../helpers/types";
4
+ export interface CheckboxGroupProps {
5
+ /** Any child node passed to the component. */
6
+ children: React.ReactNode;
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 `Checkbox`s' wrapper to be full width. */
18
+ isFullWidth?: boolean;
19
+ /** A`dds 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 checkbox 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 checkbox buttons in a row or column (default). */
28
+ layout?: LayoutTypes;
29
+ /** The `name` prop indicates the form group for all the `Checkbox` 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
+ /** The values to programmatically update the selected `Checkbox`es. */
42
+ value?: string[];
43
+ }
44
+ /**
45
+ * Wrapper component to wrap `Checkbox` components. Can be displayed in a
46
+ * column or in a row. The `CheckboxGroup` component renders all the necessary
47
+ * wrapping and associated text elements, but the checkbox input elements
48
+ * _need_ to be child `Checkbox` components from the NYPL Design System.
49
+ */
50
+ export declare const CheckboxGroup: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<CheckboxGroupProps & React.RefAttributes<HTMLDivElement>>, {}>;
51
+ export default CheckboxGroup;
@@ -1,31 +1,31 @@
1
- import 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 | JSX.Element;
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<React.ForwardRefExoticComponent<ComponentWrapperProps & {
29
- children?: React.ReactNode;
30
- } & React.RefAttributes<HTMLDivElement>>, {}>;
31
- export default ComponentWrapper;
1
+ import 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 | JSX.Element;
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<React.ForwardRefExoticComponent<ComponentWrapperProps & {
29
+ children?: React.ReactNode;
30
+ } & React.RefAttributes<HTMLDivElement>>, {}>;
31
+ export default ComponentWrapper;
@@ -1,81 +1,82 @@
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;
1
+ import React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ import { TextInputRefType } from "../TextInput/TextInput";
4
+ export declare const datePickerTypesArray: readonly ["full", "month", "year"];
5
+ export type DatePickerTypes = typeof datePickerTypesArray[number];
6
+ export interface FullDateType {
7
+ /** Date object that gets returned for the onChange
8
+ * function only for date ranges. */
9
+ endDate?: Date;
10
+ /** Date object that gets returned for the onChange function. */
11
+ startDate: Date;
12
+ }
13
+ interface DateRangeRowProps {
14
+ /** ID that other components can cross reference for accessibility purposes. */
15
+ id: string;
16
+ /** Whether to render a single date input or two for a range of two dates. */
17
+ isDateRange?: boolean;
18
+ }
19
+ interface DatePickerWrapperProps extends DateRangeRowProps {
20
+ /** Additional className. */
21
+ className?: string;
22
+ /** Adds the 'required' property to the input element(s). */
23
+ isRequired?: boolean;
24
+ /** Passed to the `TextInput` component to render a label associated with an input field. */
25
+ labelText: string;
26
+ /** Offers the ability to show the label onscreen or hide it. */
27
+ showLabel?: boolean;
28
+ /** Whether or not to display the "(Required)" text in the label text.
29
+ * True by default. */
30
+ showRequiredLabel?: boolean;
31
+ }
32
+ export interface DatePickerProps extends DatePickerWrapperProps {
33
+ /** The date format to display. Defaults to "yyyy-MM-dd".
34
+ * Must be in ISO-8601 format. */
35
+ dateFormat?: string;
36
+ /** DatePicker date types that can be rendered. */
37
+ dateType?: DatePickerTypes;
38
+ /** Populates the `HelperErrorText` component in this component. */
39
+ helperText?: HelperErrorTextType;
40
+ /** Populates the `HelperErrorText` component in the "From" `TextInput` component. */
41
+ helperTextFrom?: string;
42
+ /** Populates the `HelperErrorText` component in the "To" `TextInput` component. */
43
+ helperTextTo?: string;
44
+ /** The initial date value. This must be in the mm/dd/yyyy format. */
45
+ initialDate?: string;
46
+ /** The initialTo date value used for date ranges.
47
+ * This must be in the mm/dd/yyyy format. */
48
+ initialDateTo?: string;
49
+ /** Populates the `HelperErrorText` error state for both "From"
50
+ * and "To" input components. */
51
+ invalidText?: HelperErrorTextType;
52
+ /** Adds the 'disabled' property to the input element(s). */
53
+ isDisabled?: boolean;
54
+ /** Adds 'isInvalid' styling. */
55
+ isInvalid?: boolean;
56
+ /** Adds the 'required' property to the input element(s). */
57
+ isRequired?: boolean;
58
+ /** The maximum date value that applies to both input fields.
59
+ * This must be in the mm/dd/yyyy format. */
60
+ maxDate?: string;
61
+ /** The minimum date value that applies to both input fields.
62
+ * This must be in the mm/dd/yyyy format. */
63
+ minDate?: string;
64
+ /** Value name for the single input field or the "From" input field in a date range. */
65
+ nameFrom?: string;
66
+ /** Value name for the "To" input field */
67
+ nameTo?: string;
68
+ /** The action to perform on the `input`'s onChange function for both fields.
69
+ * This will return the data in an object with `startDate` and `endDate` keys.
70
+ */
71
+ onChange?: (data: FullDateType) => void;
72
+ /** An additional explicit React ref passed for a date range's "To"
73
+ * input field. Note that the "From" input takes the initial "ref" value. */
74
+ refTo?: React.Ref<TextInputRefType>;
75
+ /** Offers the ability to hide the helper/invalid text. */
76
+ showHelperInvalidText?: boolean;
77
+ }
78
+ /**
79
+ * Returns a single date input field or two date input fields for a date range.
80
+ */
81
+ export declare const DatePicker: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<DatePickerProps & React.RefAttributes<TextInputRefType>>, {}>;
82
+ export default DatePicker;
@@ -1,63 +1,64 @@
1
- import React from "react";
2
- declare type ViewType = "form" | "confirmation" | "error";
3
- interface FeedbackBoxProps {
4
- /** Additional class name to add. */
5
- className?: string;
6
- /** Used to add additional information to the default confirmation message in
7
- * the confirmation view. */
8
- confirmationText?: string | JSX.Element;
9
- /** Used to add description text above the form input fields in
10
- * the initial/form view. */
11
- descriptionText?: string | JSX.Element;
12
- /** A data object containing key/value pairs that will be added to the form
13
- * field submitted data. */
14
- hiddenFields?: any;
15
- /** ID that other components can cross reference for accessibility purposes */
16
- id?: string;
17
- /** Toggles the invalid state for the email field. */
18
- isInvalidComment?: boolean;
19
- /** Toggles the invalid state for the comment field. */
20
- isInvalidEmail?: boolean;
21
- /** Only used for internal purposes. */
22
- isOpen?: boolean;
23
- /** Used to add a notification above the description in the
24
- * initial/form view.*/
25
- notificationText?: string | JSX.Element;
26
- /** Only used for internal purposes. */
27
- onClose?: any;
28
- /** Only used for internal purposes. */
29
- onOpen?: any;
30
- /** Callback function that will be invoked when the form is submitted.
31
- * The returned data object contains key/value pairs including the
32
- * values from the `hiddenFields` prop.
33
- */
34
- onSubmit: (values: {
35
- [key: string]: string;
36
- }) => any;
37
- /** Toggles the category radio group field. */
38
- showCategoryField?: boolean;
39
- /** Toggles the email input field. When set to `true`, an additional
40
- * confirmation message will be rendered. */
41
- showEmailField?: boolean;
42
- /** Used to populate the label on the open button and the `Drawer`'s
43
- * header title. */
44
- title: string;
45
- /** Used to specify what screen should be displayed. */
46
- view?: ViewType;
47
- }
48
- /**
49
- * The `FeedbackBox` component renders a fixed-positioned button on the bottom
50
- * right corner of a page that opens a Chakra `Drawer` popup component. Inside
51
- * of the popup, a form is rendered with fields that allows users to provide
52
- * feedback. The `FeedbackBox` component does *not* call any API with the
53
- * submitted data; that feature is the responsibility of the consuming
54
- * application.
55
- */
56
- export declare const FeedbackBox: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<FeedbackBoxProps & React.RefAttributes<any>>, {}>;
57
- export declare function useFeedbackBox(): {
58
- isOpen: boolean;
59
- onClose: () => void;
60
- onOpen: () => void;
61
- FeedbackBox: import("@chakra-ui/react").ChakraComponent<(props: any) => JSX.Element, {}>;
62
- };
63
- export default FeedbackBox;
1
+ import React from "react";
2
+ export declare const feedbackBoxViewTypeArray: readonly ["form", "confirmation", "error"];
3
+ export type FeedbackBoxViewType = typeof feedbackBoxViewTypeArray[number];
4
+ interface FeedbackBoxProps {
5
+ /** Additional class name to add. */
6
+ className?: string;
7
+ /** Used to add additional information to the default confirmation message in
8
+ * the confirmation view. */
9
+ confirmationText?: string | JSX.Element;
10
+ /** Used to add description text above the form input fields in
11
+ * the initial/form view. */
12
+ descriptionText?: string | JSX.Element;
13
+ /** A data object containing key/value pairs that will be added to the form
14
+ * field submitted data. */
15
+ hiddenFields?: any;
16
+ /** ID that other components can cross reference for accessibility purposes */
17
+ id?: string;
18
+ /** Toggles the invalid state for the comment field. */
19
+ isInvalidComment?: boolean;
20
+ /** Toggles the invalid state for the email field. */
21
+ isInvalidEmail?: boolean;
22
+ /** Only used for internal purposes. */
23
+ isOpen?: boolean;
24
+ /** Used to add a notification above the description in the
25
+ * initial/form view.*/
26
+ notificationText?: string | JSX.Element;
27
+ /** Only used for internal purposes. */
28
+ onClose?: any;
29
+ /** Only used for internal purposes. */
30
+ onOpen?: any;
31
+ /** Callback function that will be invoked when the form is submitted.
32
+ * The returned data object contains key/value pairs including the
33
+ * values from the `hiddenFields` prop.
34
+ */
35
+ onSubmit: (values: {
36
+ [key: string]: string;
37
+ }) => any;
38
+ /** Toggles the category radio group field. */
39
+ showCategoryField?: boolean;
40
+ /** Toggles the email input field. When set to `true`, an additional
41
+ * confirmation message will be rendered. */
42
+ showEmailField?: boolean;
43
+ /** Used to populate the label on the open button and the `Drawer`'s
44
+ * header title. */
45
+ title: string;
46
+ /** Used to specify what screen should be displayed. */
47
+ view?: FeedbackBoxViewType;
48
+ }
49
+ /**
50
+ * The `FeedbackBox` component renders a fixed-positioned button on the bottom
51
+ * right corner of a page that opens a Chakra `Drawer` popup component. Inside
52
+ * of the popup, a form is rendered with fields that allows users to provide
53
+ * feedback. The `FeedbackBox` component does *not* call any API with the
54
+ * submitted data; that feature is the responsibility of the consuming
55
+ * application.
56
+ */
57
+ export declare const FeedbackBox: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<FeedbackBoxProps & React.RefAttributes<any>>, {}>;
58
+ export declare function useFeedbackBox(): {
59
+ isOpen: boolean;
60
+ onClose: () => void;
61
+ onOpen: () => void;
62
+ FeedbackBox: import("@chakra-ui/react").ChakraComponent<(props: any) => import("@emotion/react/jsx-runtime").JSX.Element, {}>;
63
+ };
64
+ export default FeedbackBox;
@@ -1,19 +1,19 @@
1
- interface FeedbackBoxState {
2
- category?: string;
3
- comment: string;
4
- email?: string;
5
- }
6
- /**
7
- * DS internal helper reducer hook to manage internal state for the FeedbackBox
8
- * component. Note: this custom hook is not tested directly as it's an
9
- * implementation detail of the FeedbackBox component, following the guidance
10
- * of RTL: https://testing-library.com/docs/example-react-hooks-useReducer
11
- */
12
- declare function useFeedbackBoxReducer(): {
13
- state: FeedbackBoxState;
14
- setCategory: (category: string) => void;
15
- setComment: (comment: string) => void;
16
- setEmail: (email: string) => void;
17
- clearValues: () => void;
18
- };
19
- export default useFeedbackBoxReducer;
1
+ interface FeedbackBoxState {
2
+ category?: string;
3
+ comment: string;
4
+ email?: string;
5
+ }
6
+ /**
7
+ * DS internal helper reducer hook to manage internal state for the FeedbackBox
8
+ * component. Note: this custom hook is not tested directly as it's an
9
+ * implementation detail of the FeedbackBox component, following the guidance
10
+ * of RTL: https://testing-library.com/docs/example-react-hooks-useReducer
11
+ */
12
+ declare function useFeedbackBoxReducer(): {
13
+ state: FeedbackBoxState;
14
+ setCategory: (category: string) => void;
15
+ setComment: (comment: string) => void;
16
+ setEmail: (email: string) => void;
17
+ clearValues: () => void;
18
+ };
19
+ export default useFeedbackBoxReducer;
@@ -1,24 +1,24 @@
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<React.ForwardRefExoticComponent<FieldsetProps & {
22
- children?: React.ReactNode;
23
- } & React.RefAttributes<HTMLDivElement & HTMLFieldSetElement>>, {}>;
24
- export default Fieldset;
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<React.ForwardRefExoticComponent<FieldsetProps & {
22
+ children?: React.ReactNode;
23
+ } & React.RefAttributes<HTMLDivElement & HTMLFieldSetElement>>, {}>;
24
+ export default Fieldset;