@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,27 +1,27 @@
1
- import React from "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<React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLDivElement>>, {}>;
27
- export default Pagination;
1
+ import React from "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<React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLDivElement>>, {}>;
27
+ export default Pagination;
@@ -1,30 +1,32 @@
1
- import React from "react";
2
- export declare type ProgressIndicatorSizes = "default" | "small";
3
- export declare type ProgressIndicatorTypes = "circular" | "linear";
4
- export interface ProgressIndicatorProps {
5
- /** The darkMode prop is deprecated and should no longer be used. */
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<React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLDivElement>>, {}>;
30
- export default ProgressIndicator;
1
+ import React from "react";
2
+ export declare const progressIndicatorSizesArray: readonly ["default", "small"];
3
+ export declare const progressIndicatorTypesArray: readonly ["circular", "linear"];
4
+ export type ProgressIndicatorSizes = typeof progressIndicatorSizesArray[number];
5
+ export type ProgressIndicatorTypes = typeof progressIndicatorTypesArray[number];
6
+ export interface ProgressIndicatorProps {
7
+ /** The darkMode prop is deprecated and should no longer be used. */
8
+ darkMode?: boolean;
9
+ /** ID that other components can cross reference for accessibility purposes. */
10
+ id: string;
11
+ /** Whether the `ProgressIndicator` should be linear or circular. */
12
+ indicatorType?: ProgressIndicatorTypes;
13
+ /** Whether the progress animation should display because the `value` prop is
14
+ * not known. When this is set to `true`, the `value` prop will be ignored. */
15
+ isIndeterminate?: boolean;
16
+ /** The text to display in an HTML `label` element. */
17
+ labelText: string;
18
+ /** Visually show or hide the label text. When set to `false`, then the label
19
+ * text will be added to the parent component as its `aria-label` attribute. */
20
+ showLabel?: boolean;
21
+ /** The size of the linear or circular progress. */
22
+ size?: ProgressIndicatorSizes;
23
+ /** A number between 0 to 100 that defines the progress' value. */
24
+ value?: number;
25
+ }
26
+ /**
27
+ * A component that displays a progress status for any task that takes a long
28
+ * time to complete or consists of multiple steps. Examples include downloading,
29
+ * uploading, or processing.
30
+ */
31
+ export declare const ProgressIndicator: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<ProgressIndicatorProps & React.RefAttributes<HTMLDivElement>>, {}>;
32
+ export default ProgressIndicator;
@@ -1,43 +1,43 @@
1
- import 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;
1
+ import 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;
@@ -1,51 +1,51 @@
1
- import 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<HTMLDivElement>>, {}>;
51
- export default RadioGroup;
1
+ import 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<HTMLDivElement>>, {}>;
51
+ export default RadioGroup;
@@ -1,58 +1,58 @@
1
- import React from "react";
2
- import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
- import { SelectProps as InitialSelectProps } from "../Select/Select";
4
- import { InputProps as InitialInputProps } from "../TextInput/TextInput";
5
- interface SelectOptionsProps {
6
- text: string;
7
- value: string;
8
- }
9
- export declare type SelectProps = Partial<Pick<InitialSelectProps, "id" | "labelText" | "name" | "onChange" | "value">> & {
10
- optionsData: SelectOptionsProps[];
11
- };
12
- export declare type TextInputProps = Pick<InitialInputProps, "labelText" | "name"> & Partial<Pick<InitialInputProps, "defaultValue" | "id" | "isClearable" | "isClearableCallback" | "max" | "maxLength" | "min" | "onChange" | "pattern" | "placeholder" | "value">>;
13
- export interface SearchBarProps {
14
- /** Adds 'action' property to the `form` element. */
15
- action?: string;
16
- /** The onClick callback function for the `Button` component. */
17
- buttonOnClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
18
- /** A class name for the `form` element. */
19
- className?: string;
20
- /** Optional string for the SearchBar's description above the component. */
21
- descriptionText?: string;
22
- /** Optional string for the SearchBar's heading text above the component. */
23
- headingText?: string;
24
- /** The text to display below the form in a `HelperErrorText` component. */
25
- helperText?: HelperErrorTextType;
26
- /** ID that other components can cross reference for accessibility purposes */
27
- id: string;
28
- /** Optional string to populate the `HelperErrorText` for the error state
29
- * when `isInvalid` is true. */
30
- invalidText?: HelperErrorTextType;
31
- /** Sets children form components in the disabled state. */
32
- isDisabled?: boolean;
33
- /** Sets children form components in the error state. */
34
- isInvalid?: boolean;
35
- /** Sets children form components in the required state. */
36
- isRequired?: boolean;
37
- /** Populates the `aria-label` attribute on the form element. */
38
- labelText: string;
39
- /** Adds 'method' property to the `form` element. */
40
- method?: string;
41
- /** Sets the `Button` variant type to `noBrand` when true;
42
- * false by default which sets the type to `primary`. */
43
- noBrandButtonType?: boolean;
44
- /** Handler function when the form is submitted. */
45
- onSubmit: (event: React.FormEvent) => void;
46
- /** Required props to render a `Select` element. */
47
- selectProps?: SelectProps | undefined;
48
- /** Custom input element to render instead of a `TextInput` element. */
49
- textInputElement?: JSX.Element;
50
- /** Required props to render a `TextInput` element. */
51
- textInputProps?: TextInputProps | undefined;
52
- }
53
- /**
54
- * Renders a wrapper `form` element to be used with `Select` (optional),
55
- * `Input`, and `Button` components together.
56
- */
57
- export declare const SearchBar: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLDivElement>>, {}>;
58
- export default SearchBar;
1
+ import React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ import { SelectProps as InitialSelectProps } from "../Select/Select";
4
+ import { InputProps as InitialInputProps } from "../TextInput/TextInput";
5
+ interface SelectOptionsProps {
6
+ text: string;
7
+ value: string;
8
+ }
9
+ export type SelectProps = Partial<Pick<InitialSelectProps, "id" | "labelText" | "name" | "onChange" | "value">> & {
10
+ optionsData: SelectOptionsProps[];
11
+ };
12
+ export type TextInputProps = Pick<InitialInputProps, "labelText" | "name"> & Partial<Pick<InitialInputProps, "defaultValue" | "id" | "isClearable" | "isClearableCallback" | "max" | "maxLength" | "min" | "onChange" | "pattern" | "placeholder" | "value">>;
13
+ export interface SearchBarProps {
14
+ /** Adds 'action' property to the `form` element. */
15
+ action?: string;
16
+ /** The onClick callback function for the `Button` component. */
17
+ buttonOnClick?: (event: React.MouseEvent | React.KeyboardEvent) => void;
18
+ /** A class name for the `form` element. */
19
+ className?: string;
20
+ /** Optional string for the SearchBar's description above the component. */
21
+ descriptionText?: string;
22
+ /** Optional string for the SearchBar's heading text above the component. */
23
+ headingText?: string;
24
+ /** The text to display below the form in a `HelperErrorText` component. */
25
+ helperText?: HelperErrorTextType;
26
+ /** ID that other components can cross reference for accessibility purposes */
27
+ id: string;
28
+ /** Optional string to populate the `HelperErrorText` for the error state
29
+ * when `isInvalid` is true. */
30
+ invalidText?: HelperErrorTextType;
31
+ /** Sets children form components in the disabled state. */
32
+ isDisabled?: boolean;
33
+ /** Sets children form components in the error state. */
34
+ isInvalid?: boolean;
35
+ /** Sets children form components in the required state. */
36
+ isRequired?: boolean;
37
+ /** Populates the `aria-label` attribute on the form element. */
38
+ labelText: string;
39
+ /** Adds 'method' property to the `form` element. */
40
+ method?: string;
41
+ /** Sets the `Button` variant type to `noBrand` when true;
42
+ * false by default which sets the type to `primary`. */
43
+ noBrandButtonType?: boolean;
44
+ /** Handler function when the form is submitted. */
45
+ onSubmit: (event: React.FormEvent) => void;
46
+ /** Required props to render a `Select` element. */
47
+ selectProps?: SelectProps | undefined;
48
+ /** Custom input element to render instead of a `TextInput` element. */
49
+ textInputElement?: JSX.Element;
50
+ /** Required props to render a `TextInput` element. */
51
+ textInputProps?: TextInputProps | undefined;
52
+ }
53
+ /**
54
+ * Renders a wrapper `form` element to be used with `Select` (optional),
55
+ * `Input`, and `Button` components together.
56
+ */
57
+ export declare const SearchBar: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<SearchBarProps & React.RefAttributes<HTMLDivElement>>, {}>;
58
+ export default SearchBar;
@@ -1,57 +1,59 @@
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;
1
+ import React from "react";
2
+ import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
3
+ export declare const selectTypesArray: string[];
4
+ export declare const labelPositionsArray: string[];
5
+ export type SelectTypes = typeof selectTypesArray[number];
6
+ export type LabelPositions = typeof labelPositionsArray[number];
7
+ export interface SelectProps {
8
+ /** A class name for the `div` parent element. */
9
+ className?: string;
10
+ /** Optional string to populate the `HelperErrorText` for the standard state. */
11
+ helperText?: HelperErrorTextType;
12
+ /** ID that other components can cross reference for accessibility purposes */
13
+ id: string;
14
+ /** Optional string to populate the `HelperErrorText` for the error state
15
+ * when `isInvalid` is true. */
16
+ invalidText?: HelperErrorTextType;
17
+ /** Adds the `disabled` and `aria-disabled` attributes to the select when true */
18
+ isDisabled?: boolean;
19
+ /** Adds the `aria-invalid` attribute to the select when true. This also makes
20
+ * the color theme "NYPL error" red for the select and text. */
21
+ isInvalid?: boolean;
22
+ /** Adds the `required` and `aria-required` attributes to the input when true. */
23
+ isRequired?: boolean;
24
+ /** Optional value to render the label inline, rather than the default (on top)
25
+ * of the select element. */
26
+ labelPosition?: LabelPositions;
27
+ /** Provides text for a `Label` component if `showLabel` is set to `true`;
28
+ * populates an `aria-label` attribute on the select input if `showLabel` is
29
+ * set to `false`. */
30
+ labelText: string;
31
+ /** Used to reference the select element in forms. */
32
+ name: string;
33
+ /** The callback function to get the selected value.
34
+ * Should be passed along with `value` for controlled components. */
35
+ onChange?: (event: React.FormEvent) => void;
36
+ /** Placeholder text in the select element. */
37
+ placeholder?: string;
38
+ /** The variant to display. */
39
+ selectType?: SelectTypes;
40
+ /** Offers the ability to hide the helper/invalid text. */
41
+ showHelperInvalidText?: boolean;
42
+ /** Offers the ability to show the select's 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
+ /** The value of the selected option.
49
+ * Should be passed along with `onChange` for controlled components. */
50
+ value?: string;
51
+ }
52
+ /**
53
+ * Component that renders Chakra's `Select` component along with an accessible
54
+ * `Label` and optional `HelperErrorText` component.
55
+ */
56
+ export declare const Select: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<SelectProps & {
57
+ children?: React.ReactNode;
58
+ } & React.RefAttributes<HTMLSelectElement>>, {}>;
59
+ export default Select;