@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.
- package/README.md +24 -40
- package/dist/design-system-react-components.cjs +304 -0
- package/dist/design-system-react-components.js +42142 -0
- package/dist/{components → src/components}/Accordion/Accordion.d.ts +29 -29
- package/dist/{components → src/components}/AlphabetFilter/AlphabetFilter.d.ts +23 -23
- package/dist/{components → src/components}/AudioPlayer/AudioPlayer.d.ts +43 -43
- package/dist/{components → src/components}/Breadcrumbs/Breadcrumbs.d.ts +24 -18
- package/dist/{components → src/components}/Button/Button.d.ts +33 -30
- package/dist/{components → src/components}/ButtonGroup/ButtonGroup.d.ts +25 -24
- package/dist/{components → src/components}/Card/Card.d.ts +55 -55
- package/dist/{components → src/components}/Checkbox/Checkbox.d.ts +47 -47
- package/dist/{components → src/components}/CheckboxGroup/CheckboxGroup.d.ts +51 -51
- package/dist/{components → src/components}/ComponentWrapper/ComponentWrapper.d.ts +31 -31
- package/dist/{components → src/components}/DatePicker/DatePicker.d.ts +82 -81
- package/dist/{components → src/components}/FeedbackBox/FeedbackBox.d.ts +64 -63
- package/dist/{components → src/components}/FeedbackBox/useFeedbackBoxReducer.d.ts +19 -19
- package/dist/{components → src/components}/Fieldset/Fieldset.d.ts +24 -24
- package/dist/{components → src/components}/FilterBar/FilterBar.d.ts +61 -111
- package/dist/{components → src/components}/Footer/Footer.d.ts +14 -14
- package/dist/{components → src/components}/Footer/footerLinks.d.ts +12 -12
- package/dist/{components → src/components}/Form/Form.d.ts +31 -31
- package/dist/{components → src/components}/Grid/SimpleGrid.d.ts +20 -19
- package/dist/{components → src/components}/Header/Header.d.ts +21 -22
- package/dist/{components → src/components}/Header/components/HeaderLogin.d.ts +12 -12
- package/dist/{components → src/components}/Header/components/HeaderLoginButton.d.ts +10 -11
- package/dist/{components → src/components}/Header/components/HeaderLowerNav.d.ts +6 -7
- package/dist/{components → src/components}/Header/components/HeaderMobileIconNav.d.ts +6 -7
- package/dist/{components → src/components}/Header/components/HeaderMobileNav.d.ts +6 -7
- package/dist/{components → src/components}/Header/components/HeaderMobileNavButton.d.ts +6 -7
- package/dist/{components → src/components}/Header/components/HeaderSearchButton.d.ts +9 -10
- package/dist/{components → src/components}/Header/components/HeaderSearchForm.d.ts +10 -11
- package/dist/{components → src/components}/Header/components/HeaderSitewideAlerts.d.ts +7 -8
- package/dist/{components → src/components}/Header/components/HeaderUpperNav.d.ts +7 -8
- package/dist/{components → src/components}/Header/context/headerContext.d.ts +13 -13
- package/dist/{components → src/components}/Header/utils/googleAnalyticsUtils.d.ts +16 -16
- package/dist/{components → src/components}/Header/utils/headerUtils.d.ts +94 -94
- package/dist/{components → src/components}/Heading/Heading.d.ts +37 -35
- package/dist/{components → src/components}/HelperErrorText/HelperErrorText.d.ts +34 -34
- package/dist/{components → src/components}/Hero/Hero.d.ts +43 -42
- package/dist/{components → src/components}/HorizontalRule/HorizontalRule.d.ts +11 -11
- package/dist/{components → src/components}/Icons/Icon.d.ts +40 -41
- package/dist/src/components/Icons/IconSvgs.d.ts +163 -0
- package/dist/src/components/Icons/iconVariables.d.ts +6 -0
- package/dist/{components → src/components}/Image/Image.d.ts +68 -65
- package/dist/{components → src/components}/Label/Label.d.ts +25 -25
- package/dist/{components → src/components}/Link/Link.d.ts +22 -21
- package/dist/{components → src/components}/List/List.d.ts +42 -42
- package/dist/{components → src/components}/Logo/Logo.d.ts +28 -28
- package/dist/src/components/Logo/LogoSvgs.d.ts +157 -0
- package/dist/{components → src/components}/Modal/Modal.d.ts +35 -35
- package/dist/{components → src/components}/MultiSelect/MultiSelect.d.ts +61 -78
- package/dist/{components → src/components}/MultiSelect/MultiSelectDialog.d.ts +8 -8
- package/dist/{components → src/components}/MultiSelect/MultiSelectListbox.d.ts +9 -9
- package/dist/{components → src/components}/MultiSelect/MultiSelectMenuButton.d.ts +27 -27
- package/dist/{components → src/components}/MultiSelectGroup/MultiSelectGroup.d.ts +28 -26
- package/dist/{components → src/components}/Notification/Notification.d.ts +52 -51
- package/dist/{components → src/components}/Pagination/Pagination.d.ts +27 -27
- package/dist/{components → src/components}/ProgressIndicator/ProgressIndicator.d.ts +32 -30
- package/dist/{components → src/components}/Radio/Radio.d.ts +43 -43
- package/dist/{components → src/components}/RadioGroup/RadioGroup.d.ts +51 -51
- package/dist/{components → src/components}/SearchBar/SearchBar.d.ts +58 -58
- package/dist/{components → src/components}/Select/Select.d.ts +59 -57
- package/dist/{components → src/components}/SkeletonLoader/SkeletonLoader.d.ts +42 -41
- package/dist/{components → src/components}/SkipNavigation/SkipNavigation.d.ts +19 -19
- package/dist/{components → src/components}/Slider/Slider.d.ts +65 -65
- package/dist/{components → src/components}/StatusBadge/StatusBadge.d.ts +19 -18
- package/dist/{components → src/components}/StructuredContent/StructuredContent.d.ts +30 -30
- package/dist/src/components/StyleGuide/ColorCard.d.ts +342 -0
- package/dist/{components → src/components}/StyledList/StyledList.d.ts +25 -25
- package/dist/{components → src/components}/Table/Table.d.ts +32 -32
- package/dist/{components → src/components}/Tabs/Tabs.d.ts +28 -28
- package/dist/{components → src/components}/TagSet/TagSet.d.ts +24 -32
- package/dist/{components → src/components}/TagSet/TagSetExplore.d.ts +28 -27
- package/dist/{components → src/components}/TagSet/TagSetFilter.d.ts +25 -26
- package/dist/src/components/TagSet/TooltipWrapper.d.ts +9 -0
- package/dist/{components → src/components}/Template/Template.d.ts +140 -140
- package/dist/{components → src/components}/Text/Text.d.ts +25 -24
- package/dist/{components → src/components}/TextInput/TextInput.d.ts +89 -88
- package/dist/{components → src/components}/Toggle/Toggle.d.ts +43 -42
- package/dist/{components → src/components}/Tooltip/Tooltip.d.ts +17 -17
- package/dist/{components → src/components}/VideoPlayer/VideoPlayer.d.ts +42 -40
- package/dist/src/helpers/types.d.ts +2 -0
- package/dist/{hooks → src/hooks}/useCarouselStyles.d.ts +17 -17
- package/dist/{hooks → src/hooks}/useCloseDropDown.d.ts +7 -7
- package/dist/{hooks → src/hooks}/useFilterBar.d.ts +21 -21
- package/dist/{hooks → src/hooks}/useMultiSelect.d.ts +15 -15
- package/dist/{hooks → src/hooks}/useNYPLBreakpoints.d.ts +13 -13
- package/dist/{hooks → src/hooks}/useNYPLTheme.d.ts +67 -67
- package/dist/{hooks → src/hooks}/useStateWithDependencies.d.ts +5 -5
- package/dist/{hooks → src/hooks}/useWindowSize.d.ts +10 -10
- package/dist/src/index.d.ts +91 -0
- package/dist/{theme → src/theme}/components/accordion.d.ts +34 -34
- package/dist/{theme → src/theme}/components/alphabetFilter.d.ts +33 -33
- package/dist/{theme → src/theme}/components/audioPlayer.d.ts +16 -16
- package/dist/{theme → src/theme}/components/breadcrumb.d.ts +138 -151
- package/dist/{theme → src/theme}/components/button.d.ts +113 -113
- package/dist/{theme → src/theme}/components/buttonGroup.d.ts +11 -11
- package/dist/{theme → src/theme}/components/card.d.ts +421 -421
- package/dist/{theme → src/theme}/components/checkbox.d.ts +178 -178
- package/dist/{theme → src/theme}/components/checkboxGroup.d.ts +14 -14
- package/dist/{theme → src/theme}/components/componentWrapper.d.ts +12 -12
- package/dist/{theme → src/theme}/components/customTable.d.ts +733 -733
- package/dist/{theme → src/theme}/components/datePicker.d.ts +17 -17
- package/dist/{theme → src/theme}/components/feedbackBox.d.ts +92 -92
- package/dist/{theme → src/theme}/components/fieldset.d.ts +23 -23
- package/dist/{theme → src/theme}/components/filterBar.d.ts +46 -46
- package/dist/{theme → src/theme}/components/footer.d.ts +244 -244
- package/dist/{theme → src/theme}/components/global.d.ts +140 -140
- package/dist/{theme → src/theme}/components/globalMixins.d.ts +40 -40
- package/dist/{theme → src/theme}/components/header/header.d.ts +72 -72
- package/dist/{theme → src/theme}/components/header/headerLogin.d.ts +327 -327
- package/dist/{theme → src/theme}/components/header/headerLoginButton.d.ts +69 -69
- package/dist/{theme → src/theme}/components/header/headerLowerNav.d.ts +70 -70
- package/dist/{theme → src/theme}/components/header/headerMobileIconNav.d.ts +28 -28
- package/dist/{theme → src/theme}/components/header/headerMobileNav.d.ts +86 -86
- package/dist/{theme → src/theme}/components/header/headerMobileNavButton.d.ts +34 -34
- package/dist/{theme → src/theme}/components/header/headerSearchButton.d.ts +83 -83
- package/dist/{theme → src/theme}/components/header/headerSearchForm.d.ts +183 -183
- package/dist/{theme → src/theme}/components/header/headerSitewideAlerts.d.ts +42 -42
- package/dist/{theme → src/theme}/components/header/headerUpperNav.d.ts +72 -72
- package/dist/{theme → src/theme}/components/heading.d.ts +173 -173
- package/dist/{theme → src/theme}/components/helperErrorText.d.ts +15 -15
- package/dist/{theme → src/theme}/components/hero.d.ts +628 -628
- package/dist/{theme → src/theme}/components/horizontalRule.d.ts +18 -18
- package/dist/{theme → src/theme}/components/icon.d.ts +62251 -62251
- package/dist/{theme → src/theme}/components/image.d.ts +662 -662
- package/dist/{theme → src/theme}/components/label.d.ts +21 -21
- package/dist/{theme → src/theme}/components/link.d.ts +106 -106
- package/dist/{theme → src/theme}/components/list.d.ts +228 -228
- package/dist/{theme → src/theme}/components/logo.d.ts +477 -477
- package/dist/{theme → src/theme}/components/modal.d.ts +21 -21
- package/dist/{theme → src/theme}/components/multiSelect.d.ts +29 -29
- package/dist/{theme → src/theme}/components/multiSelectMenuButton.d.ts +95 -95
- package/dist/{theme → src/theme}/components/notification.d.ts +136 -136
- package/dist/{theme → src/theme}/components/pagination.d.ts +16 -16
- package/dist/{theme → src/theme}/components/progressIndicator.d.ts +68 -68
- package/dist/{theme → src/theme}/components/radio.d.ts +202 -202
- package/dist/{theme → src/theme}/components/radioGroup.d.ts +14 -14
- package/dist/{theme → src/theme}/components/searchBar.d.ts +34 -34
- package/dist/{theme → src/theme}/components/select.d.ts +125 -126
- package/dist/{theme → src/theme}/components/skeletonLoader.d.ts +105 -105
- package/dist/{theme → src/theme}/components/skipNavigation.d.ts +28 -28
- package/dist/{theme → src/theme}/components/slider.d.ts +78 -78
- package/dist/{theme → src/theme}/components/statusBadge.d.ts +37 -37
- package/dist/{theme → src/theme}/components/structuredContent.d.ts +385 -385
- package/dist/{theme → src/theme}/components/styledList.d.ts +51 -51
- package/dist/{theme → src/theme}/components/tabs.d.ts +172 -172
- package/dist/{theme → src/theme}/components/tagSet.d.ts +154 -154
- package/dist/{theme → src/theme}/components/template.d.ts +86 -86
- package/dist/{theme → src/theme}/components/text.d.ts +30 -30
- package/dist/{theme → src/theme}/components/textInput.d.ts +349 -355
- package/dist/{theme → src/theme}/components/toggle.d.ts +129 -129
- package/dist/{theme → src/theme}/components/tooltip.d.ts +19 -19
- package/dist/{theme → src/theme}/components/videoPlayer.d.ts +47 -47
- package/dist/{theme → src/theme}/foundations/breakpoints.d.ts +23 -23
- package/dist/{theme → src/theme}/foundations/colors.d.ts +3 -3
- package/dist/{theme → src/theme}/foundations/global.d.ts +68 -68
- package/dist/{theme → src/theme}/foundations/radii.d.ts +11 -11
- package/dist/{theme → src/theme}/foundations/shadows.d.ts +4 -4
- package/dist/{theme → src/theme}/foundations/spacing.d.ts +96 -96
- package/dist/{theme → src/theme}/foundations/typography.d.ts +8 -8
- package/dist/{theme → src/theme}/index.d.ts +20 -20
- package/dist/{theme → src/theme}/provider.d.ts +4 -4
- package/dist/src/theme/types.d.ts +1 -0
- package/dist/src/utils/colorUtils.d.ts +5 -0
- package/dist/{utils → src/utils}/interfaces.d.ts +5 -5
- package/dist/{utils → src/utils}/utils.d.ts +39 -39
- package/dist/styles.css +1 -4
- package/package.json +62 -69
- package/dist/__tests__/fileMock.d.ts +0 -4
- package/dist/__tests__/mediaMatchMock.d.ts +0 -79
- package/dist/__tests__/setup.d.ts +0 -2
- package/dist/__tests__/utils/utils.test.d.ts +0 -1
- package/dist/components/Autosuggest/Autosuggest.stories.d.ts +0 -4
- package/dist/components/FilterBar/FilterBar.stories.d.ts +0 -7
- package/dist/components/Header/utils/authApiMockResponse.d.ts +0 -49
- package/dist/components/Header/utils/encoreCatalogLogOutTimer.d.ts +0 -4
- package/dist/components/Header/utils/encoreCatalogLogOutTimer.test.d.ts +0 -1
- package/dist/components/Header/utils/googleAnalyticsUtils.test.d.ts +0 -1
- package/dist/components/Header/utils/headerUtils.test.d.ts +0 -1
- package/dist/components/Header/utils/sitewideAlertsMocks.d.ts +0 -98
- package/dist/components/Icons/IconColors.d.ts +0 -3
- package/dist/components/Icons/IconNames.d.ts +0 -3
- package/dist/components/Icons/IconSvgs.d.ts +0 -58
- package/dist/components/Logo/LogoSvgs.d.ts +0 -54
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +0 -4
- package/dist/components/MultiSelectGroup/MultiSelectGroup.stories.d.ts +0 -4
- package/dist/components/Placeholder/Placeholder.d.ts +0 -10
- package/dist/components/StyleGuide/ColorCard.d.ts +0 -46
- package/dist/design-system-react-components.cjs.development.js +0 -18076
- package/dist/design-system-react-components.cjs.development.js.map +0 -1
- package/dist/design-system-react-components.cjs.production.min.js +0 -2
- package/dist/design-system-react-components.cjs.production.min.js.map +0 -1
- package/dist/design-system-react-components.esm.js +0 -17874
- package/dist/design-system-react-components.esm.js.map +0 -1
- package/dist/helpers/types.d.ts +0 -1
- package/dist/hooks/__tests__/useCarouselStyles.test.d.ts +0 -1
- package/dist/hooks/__tests__/useFilterBar.test.d.ts +0 -1
- package/dist/hooks/__tests__/useMultiSelect.test.d.ts +0 -1
- package/dist/hooks/__tests__/useNYPLBreakpoints.test.d.ts +0 -1
- package/dist/index.d.ts +0 -66
- package/dist/index.js +0 -8
- package/dist/resources.scss +0 -382
- package/dist/theme/types.d.ts +0 -1
- 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
|
|
3
|
-
export declare
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/** Whether the
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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
|
|
10
|
-
optionsData: SelectOptionsProps[];
|
|
11
|
-
};
|
|
12
|
-
export
|
|
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
|
|
4
|
-
export declare
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
/** Adds the `aria-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
|
|
40
|
-
/** Offers the ability to
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
value
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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;
|