@nypl/design-system-react-components 1.5.1 → 1.6.0-vite-rc
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 +39 -39
- package/dist/design-system-react-components.cjs +279 -0
- package/dist/design-system-react-components.js +42759 -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 +18 -18
- package/dist/{components → src/components}/Button/Button.d.ts +30 -30
- package/dist/{components → src/components}/ButtonGroup/ButtonGroup.d.ts +24 -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 +81 -81
- package/dist/{components → src/components}/FeedbackBox/FeedbackBox.d.ts +63 -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 +19 -19
- package/dist/{components → src/components}/Header/Header.d.ts +22 -22
- package/dist/{components → src/components}/Header/components/HeaderLogin.d.ts +12 -12
- package/dist/{components → src/components}/Header/components/HeaderLoginButton.d.ts +11 -11
- package/dist/{components → src/components}/Header/components/HeaderLowerNav.d.ts +7 -7
- package/dist/{components → src/components}/Header/components/HeaderMobileIconNav.d.ts +7 -7
- package/dist/{components → src/components}/Header/components/HeaderMobileNav.d.ts +7 -7
- package/dist/{components → src/components}/Header/components/HeaderMobileNavButton.d.ts +7 -7
- package/dist/{components → src/components}/Header/components/HeaderSearchButton.d.ts +10 -10
- package/dist/{components → src/components}/Header/components/HeaderSearchForm.d.ts +11 -11
- package/dist/{components → src/components}/Header/components/HeaderSitewideAlerts.d.ts +8 -8
- package/dist/{components → src/components}/Header/components/HeaderUpperNav.d.ts +8 -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 +35 -35
- package/dist/{components → src/components}/HelperErrorText/HelperErrorText.d.ts +34 -34
- package/dist/{components → src/components}/Hero/Hero.d.ts +42 -42
- package/dist/{components → src/components}/HorizontalRule/HorizontalRule.d.ts +11 -11
- package/dist/{components → src/components}/Icons/Icon.d.ts +41 -41
- package/dist/{components → src/components}/Icons/IconColors.d.ts +3 -3
- package/dist/{components → src/components}/Icons/IconNames.d.ts +3 -3
- package/dist/{components → src/components}/Icons/IconSvgs.d.ts +56 -56
- package/dist/{components → src/components}/Image/Image.d.ts +65 -65
- package/dist/{components → src/components}/Label/Label.d.ts +25 -25
- package/dist/{components → src/components}/Link/Link.d.ts +21 -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/{components → src/components}/Logo/LogoSvgs.d.ts +54 -52
- package/dist/{components → src/components}/Modal/Modal.d.ts +35 -35
- package/dist/{components → src/components}/MultiSelect/MultiSelect.d.ts +60 -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 +26 -26
- package/dist/{components → src/components}/Notification/Notification.d.ts +51 -51
- package/dist/{components → src/components}/Pagination/Pagination.d.ts +27 -27
- package/dist/{components → src/components}/ProgressIndicator/ProgressIndicator.d.ts +30 -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 +57 -57
- package/dist/{components → src/components}/SkeletonLoader/SkeletonLoader.d.ts +41 -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 +18 -18
- package/dist/{components → src/components}/StructuredContent/StructuredContent.d.ts +30 -30
- package/dist/{components → src/components}/StyleGuide/ColorCard.d.ts +46 -46
- 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 +33 -32
- package/dist/{components → src/components}/TagSet/TagSetExplore.d.ts +27 -27
- package/dist/{components → src/components}/TagSet/TagSetFilter.d.ts +26 -26
- package/dist/{components → src/components}/Template/Template.d.ts +140 -140
- package/dist/{components → src/components}/Text/Text.d.ts +24 -24
- package/dist/{components → src/components}/TextInput/TextInput.d.ts +88 -88
- package/dist/{components → src/components}/Toggle/Toggle.d.ts +42 -42
- package/dist/{components → src/components}/Tooltip/Tooltip.d.ts +17 -17
- package/dist/{components → src/components}/VideoPlayer/VideoPlayer.d.ts +40 -40
- package/dist/src/helpers/types.d.ts +1 -0
- package/dist/{hooks → src/hooks}/useCarouselStyles.d.ts +17 -17
- package/dist/{hooks → src/hooks}/useCloseDropDown.d.ts +7 -6
- 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 +90 -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 +151 -138
- 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 -85
- 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 -241
- 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 -125
- 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 -349
- 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/{utils → src/utils}/interfaces.d.ts +5 -5
- package/dist/{utils → src/utils}/utils.d.ts +39 -39
- package/dist/style.css +1 -0
- package/package.json +52 -61
- package/CHANGELOG.md +0 -1861
- 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/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/design-system-react-components.cjs.development.js +0 -17917
- 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 -17716
- 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 -65
- package/dist/index.js +0 -8
- package/dist/resources.scss +0 -382
- package/dist/styles.css +0 -4
- package/dist/theme/types.d.ts +0 -1
- package/dist/utils/componentCategories.d.ts +0 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { IconNames } from "../Icons/Icon";
|
|
3
|
-
export interface TagSetFilterDataProps {
|
|
4
|
-
/** The name of the SVG `Icon` to render before the tag label. */
|
|
5
|
-
iconName?: IconNames;
|
|
6
|
-
/** The string label to display. */
|
|
7
|
-
label: string;
|
|
8
|
-
}
|
|
9
|
-
export interface TagSetFilterProps {
|
|
10
|
-
/** ID that other components can cross reference for accessibility purposes. */
|
|
11
|
-
id?: string;
|
|
12
|
-
/** Whether the tags should be removable. */
|
|
13
|
-
isDismissible?: boolean;
|
|
14
|
-
/** The function to perform when a tag is clicked when `isDismissible` is true. */
|
|
15
|
-
onClick?: (tagLabel: string) => void;
|
|
16
|
-
/** The array of data to display as tags. */
|
|
17
|
-
tagSetData: TagSetFilterDataProps[];
|
|
18
|
-
/** The `TagSet` variant to render; "filter" by default. */
|
|
19
|
-
type: "filter";
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* The "filter" `TagSet` variant will display tags that can be removed when
|
|
23
|
-
* `isDismissible` is true and they are clicked.
|
|
24
|
-
*/
|
|
25
|
-
export declare const TagSetFilter: import("@chakra-ui/react").ChakraComponent<(props: TagSetFilterProps) => JSX.Element, {}>;
|
|
26
|
-
export default TagSetFilter;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { IconNames } from "../Icons/Icon";
|
|
3
|
+
export interface TagSetFilterDataProps {
|
|
4
|
+
/** The name of the SVG `Icon` to render before the tag label. */
|
|
5
|
+
iconName?: IconNames;
|
|
6
|
+
/** The string label to display. */
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TagSetFilterProps {
|
|
10
|
+
/** ID that other components can cross reference for accessibility purposes. */
|
|
11
|
+
id?: string;
|
|
12
|
+
/** Whether the tags should be removable. */
|
|
13
|
+
isDismissible?: boolean;
|
|
14
|
+
/** The function to perform when a tag is clicked when `isDismissible` is true. */
|
|
15
|
+
onClick?: (tagLabel: string) => void;
|
|
16
|
+
/** The array of data to display as tags. */
|
|
17
|
+
tagSetData: TagSetFilterDataProps[];
|
|
18
|
+
/** The `TagSet` variant to render; "filter" by default. */
|
|
19
|
+
type: "filter";
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The "filter" `TagSet` variant will display tags that can be removed when
|
|
23
|
+
* `isDismissible` is true and they are clicked.
|
|
24
|
+
*/
|
|
25
|
+
export declare const TagSetFilter: import("@chakra-ui/react").ChakraComponent<(props: TagSetFilterProps) => JSX.Element, {}>;
|
|
26
|
+
export default TagSetFilter;
|
|
@@ -1,140 +1,140 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface TemplateProps {
|
|
3
|
-
}
|
|
4
|
-
export interface TemplateHeaderProps {
|
|
5
|
-
/** Flag to render an HTML header element. True by default. */
|
|
6
|
-
renderHeaderElement?: boolean;
|
|
7
|
-
}
|
|
8
|
-
export interface TemplateFooterProps {
|
|
9
|
-
/** Flag to render an HTML footer element. True by default. */
|
|
10
|
-
renderFooterElement?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface TemplateSidebarProps {
|
|
13
|
-
/** Renders the `TemplateContentSidebar` component either on the left or
|
|
14
|
-
* right side of the `TemplateContentPrimary` component. */
|
|
15
|
-
sidebar?: "none" | "left" | "right";
|
|
16
|
-
}
|
|
17
|
-
export interface TemplateContentProps extends TemplateSidebarProps {
|
|
18
|
-
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
19
|
-
* anchor for the application skip navigation. */
|
|
20
|
-
id?: string;
|
|
21
|
-
}
|
|
22
|
-
export interface TemplateAppContainerProps extends TemplateFooterProps, TemplateHeaderProps, TemplateSidebarProps {
|
|
23
|
-
/** DOM that will be rendered before the rest of the components in
|
|
24
|
-
* `TemplateAppContainer` and immediately before the `TemplateHeader` component. */
|
|
25
|
-
aboveHeader?: React.ReactElement;
|
|
26
|
-
/** DOM that will be rendered in the `TemplateBreakout` component section. */
|
|
27
|
-
breakout?: React.ReactElement;
|
|
28
|
-
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
29
|
-
* anchor for the application skip navigation. */
|
|
30
|
-
contentId?: string;
|
|
31
|
-
/** DOM that will be rendered in the `TemplateContentBottom` component section. */
|
|
32
|
-
contentBottom?: React.ReactElement;
|
|
33
|
-
/** DOM that will be rendered in the `TemplateContentPrimary` component section. */
|
|
34
|
-
contentPrimary?: React.ReactElement;
|
|
35
|
-
/** DOM that will be rendered in the `TemplateContentSidebar` component section. */
|
|
36
|
-
contentSidebar?: React.ReactElement;
|
|
37
|
-
/** DOM that will be rendered in the `TemplateContentTop` component section. */
|
|
38
|
-
contentTop?: React.ReactElement;
|
|
39
|
-
/** DOM that will be rendered in the `TemplateFooter` component section. */
|
|
40
|
-
footer?: React.ReactElement;
|
|
41
|
-
/** DOM that will be rendered in the `TemplateHeader` component section. */
|
|
42
|
-
header?: React.ReactElement;
|
|
43
|
-
/** Render the `SkipNavigation` component or not. False by default. */
|
|
44
|
-
renderSkipNavigation?: boolean;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* The main top-level parent component that wraps all template-related
|
|
48
|
-
* components.
|
|
49
|
-
*/
|
|
50
|
-
declare const Template: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TemplateProps & {
|
|
51
|
-
children?: React.ReactNode;
|
|
52
|
-
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
53
|
-
/**
|
|
54
|
-
* This optional component renders its children from edge-to-edge and should
|
|
55
|
-
* be used for alerts or notifications that are typically site-wide. This must
|
|
56
|
-
* be rendered immediately before the `TemplateHeader` component. This is meant
|
|
57
|
-
* for components that render an `aside` HTML element or HTML element with the
|
|
58
|
-
* `role="complementary"` attribute. These elements should *not* be rendered
|
|
59
|
-
* in the `header` HTML section since that's an accessibility violation.
|
|
60
|
-
*/
|
|
61
|
-
declare const TemplateAboveHeader: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
62
|
-
/**
|
|
63
|
-
* This optional component should be the first child of the `Template`
|
|
64
|
-
* component. This is rendered as an HTML `<header>` element. If an HTML
|
|
65
|
-
* `<header>` element is already passed in a custom component as the children,
|
|
66
|
-
* set `renderFooterElement` to `false`. Otherwise, the parent wrapper will
|
|
67
|
-
* render an HTML `<header>` element.
|
|
68
|
-
*/
|
|
69
|
-
declare const TemplateHeader: ({ children, renderHeaderElement, }: React.PropsWithChildren<TemplateHeaderProps>) => JSX.Element;
|
|
70
|
-
/**
|
|
71
|
-
* This component should be used inside the `Template` component to contain both
|
|
72
|
-
* the `TemplateAboveHeader` and `TemplateHeader` components. This is meant to
|
|
73
|
-
* render its children from edge to edge and is most useful for the headers,
|
|
74
|
-
* `Breadcrumbs`, and `Hero` components or other banner-like components.
|
|
75
|
-
*/
|
|
76
|
-
declare const TemplateBreakout: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
77
|
-
/**
|
|
78
|
-
* This component is most useful to render content on the page. This renders an
|
|
79
|
-
* HTML `<main>` element with an id of "mainContent". The "mainContent" id should
|
|
80
|
-
* be used as the consuming application's skip navigation link. The `TemplateContent`
|
|
81
|
-
* component also takes a `sidebar` prop with optional "left" or "right" values.
|
|
82
|
-
* This will set the correct *styling* needed for the `TemplateContentPrimary`
|
|
83
|
-
* and `TemplateContentSidebar` components. Note that `TemplateContentPrimary`
|
|
84
|
-
* and `TemplateContentSidebar` must be ordered correctly as children elements
|
|
85
|
-
* for the appropriate styles to take effect.
|
|
86
|
-
*/
|
|
87
|
-
declare const TemplateContent: (props: React.PropsWithChildren<TemplateContentProps>) => JSX.Element;
|
|
88
|
-
/**
|
|
89
|
-
* This optional component must be used inside the `TemplateContent` component.
|
|
90
|
-
* This renders content in the main width of the container and will always render
|
|
91
|
-
* above the primary component and the sidebar component (if any).
|
|
92
|
-
*/
|
|
93
|
-
declare const TemplateContentTop: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
94
|
-
/**
|
|
95
|
-
* This optional component must be used inside the `TemplateContent` component
|
|
96
|
-
* and after the `TemplateContentPrimary` or `TemplateContentSidebar` component.
|
|
97
|
-
* This renders content in the main width of the container and should always
|
|
98
|
-
* render below the primary component and the sidebar component (if any).
|
|
99
|
-
*/
|
|
100
|
-
declare const TemplateContentBottom: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
101
|
-
/**
|
|
102
|
-
* This component is used to render content in a column when there must be a
|
|
103
|
-
* sidebar component on either its left or right side. It must go inside the
|
|
104
|
-
* `TemplateContent` component. An optional `sidebar` prop value of "left" or
|
|
105
|
-
* "right" can be passed to render the correct CSS styles. If the `sidebar`
|
|
106
|
-
* prop is used in the `TemplateContent` component, there is no need to pass
|
|
107
|
-
* the `sidebar` prop to this component -- `TemplateContent` will handle it.
|
|
108
|
-
*/
|
|
109
|
-
declare const TemplateContentPrimary: (props: React.PropsWithChildren<TemplateContentProps>) => JSX.Element;
|
|
110
|
-
/**
|
|
111
|
-
* This component is used to render content in a sidebar column. It must go
|
|
112
|
-
* inside the `TemplateContent` component and must be paired with the
|
|
113
|
-
* `TemplateContentPrimary` component. If this is a left sidebar, it needs to be
|
|
114
|
-
* rendered before the `TemplateContentPrimary` component. If this is a right
|
|
115
|
-
* sidebar, it needs to be rendered after the `TemplateContentPrimary` component.
|
|
116
|
-
* An optional `sidebar` prop value of "left" or "right" can be passed to render
|
|
117
|
-
* the correct CSS styles. If the `sidebar` prop is used in the `TemplateContent`
|
|
118
|
-
* component, there is no need to pass the `sidebar` prop to this component --
|
|
119
|
-
* `TemplateContent` will handle it.
|
|
120
|
-
*/
|
|
121
|
-
declare const TemplateContentSidebar: (props: React.PropsWithChildren<TemplateContentProps>) => JSX.Element;
|
|
122
|
-
/**
|
|
123
|
-
* This optional component should be the last child of the `Template`
|
|
124
|
-
* component. This is rendered as an HTML `<footer>` element and spans the full
|
|
125
|
-
* width of the page. If an HTML `<footer>` element is already passed in a
|
|
126
|
-
* custom component, set `renderFooterElement` to `false`.
|
|
127
|
-
*/
|
|
128
|
-
declare const TemplateFooter: ({ children, renderFooterElement, }: React.PropsWithChildren<TemplateFooterProps>) => JSX.Element;
|
|
129
|
-
/**
|
|
130
|
-
* This single component can be used instead of all the individual template
|
|
131
|
-
* components. Instead of importing and rendering the needed "template"
|
|
132
|
-
* components, each section is passed as a prop to the section where it should
|
|
133
|
-
* be rendered. For example, if you want to render content in the
|
|
134
|
-
* `TemplateContentPrimary` section, then pass it as a prop to `contentPrimary`.
|
|
135
|
-
*/
|
|
136
|
-
export declare const TemplateAppContainer: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TemplateAppContainerProps & {
|
|
137
|
-
children?: React.ReactNode;
|
|
138
|
-
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
139
|
-
export { Template, TemplateAboveHeader, TemplateBreakout, TemplateContent, TemplateContentBottom, TemplateContentPrimary, TemplateContentSidebar, TemplateContentTop, TemplateFooter, TemplateHeader, };
|
|
140
|
-
export default TemplateAppContainer;
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface TemplateProps {
|
|
3
|
+
}
|
|
4
|
+
export interface TemplateHeaderProps {
|
|
5
|
+
/** Flag to render an HTML header element. True by default. */
|
|
6
|
+
renderHeaderElement?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface TemplateFooterProps {
|
|
9
|
+
/** Flag to render an HTML footer element. True by default. */
|
|
10
|
+
renderFooterElement?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface TemplateSidebarProps {
|
|
13
|
+
/** Renders the `TemplateContentSidebar` component either on the left or
|
|
14
|
+
* right side of the `TemplateContentPrimary` component. */
|
|
15
|
+
sidebar?: "none" | "left" | "right";
|
|
16
|
+
}
|
|
17
|
+
export interface TemplateContentProps extends TemplateSidebarProps {
|
|
18
|
+
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
19
|
+
* anchor for the application skip navigation. */
|
|
20
|
+
id?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface TemplateAppContainerProps extends TemplateFooterProps, TemplateHeaderProps, TemplateSidebarProps {
|
|
23
|
+
/** DOM that will be rendered before the rest of the components in
|
|
24
|
+
* `TemplateAppContainer` and immediately before the `TemplateHeader` component. */
|
|
25
|
+
aboveHeader?: React.ReactElement;
|
|
26
|
+
/** DOM that will be rendered in the `TemplateBreakout` component section. */
|
|
27
|
+
breakout?: React.ReactElement;
|
|
28
|
+
/** ID used for the `main` HTML element. Defaults to "mainContent". Useful
|
|
29
|
+
* anchor for the application skip navigation. */
|
|
30
|
+
contentId?: string;
|
|
31
|
+
/** DOM that will be rendered in the `TemplateContentBottom` component section. */
|
|
32
|
+
contentBottom?: React.ReactElement;
|
|
33
|
+
/** DOM that will be rendered in the `TemplateContentPrimary` component section. */
|
|
34
|
+
contentPrimary?: React.ReactElement;
|
|
35
|
+
/** DOM that will be rendered in the `TemplateContentSidebar` component section. */
|
|
36
|
+
contentSidebar?: React.ReactElement;
|
|
37
|
+
/** DOM that will be rendered in the `TemplateContentTop` component section. */
|
|
38
|
+
contentTop?: React.ReactElement;
|
|
39
|
+
/** DOM that will be rendered in the `TemplateFooter` component section. */
|
|
40
|
+
footer?: React.ReactElement;
|
|
41
|
+
/** DOM that will be rendered in the `TemplateHeader` component section. */
|
|
42
|
+
header?: React.ReactElement;
|
|
43
|
+
/** Render the `SkipNavigation` component or not. False by default. */
|
|
44
|
+
renderSkipNavigation?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The main top-level parent component that wraps all template-related
|
|
48
|
+
* components.
|
|
49
|
+
*/
|
|
50
|
+
declare const Template: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TemplateProps & {
|
|
51
|
+
children?: React.ReactNode;
|
|
52
|
+
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
53
|
+
/**
|
|
54
|
+
* This optional component renders its children from edge-to-edge and should
|
|
55
|
+
* be used for alerts or notifications that are typically site-wide. This must
|
|
56
|
+
* be rendered immediately before the `TemplateHeader` component. This is meant
|
|
57
|
+
* for components that render an `aside` HTML element or HTML element with the
|
|
58
|
+
* `role="complementary"` attribute. These elements should *not* be rendered
|
|
59
|
+
* in the `header` HTML section since that's an accessibility violation.
|
|
60
|
+
*/
|
|
61
|
+
declare const TemplateAboveHeader: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
62
|
+
/**
|
|
63
|
+
* This optional component should be the first child of the `Template`
|
|
64
|
+
* component. This is rendered as an HTML `<header>` element. If an HTML
|
|
65
|
+
* `<header>` element is already passed in a custom component as the children,
|
|
66
|
+
* set `renderFooterElement` to `false`. Otherwise, the parent wrapper will
|
|
67
|
+
* render an HTML `<header>` element.
|
|
68
|
+
*/
|
|
69
|
+
declare const TemplateHeader: ({ children, renderHeaderElement, }: React.PropsWithChildren<TemplateHeaderProps>) => JSX.Element;
|
|
70
|
+
/**
|
|
71
|
+
* This component should be used inside the `Template` component to contain both
|
|
72
|
+
* the `TemplateAboveHeader` and `TemplateHeader` components. This is meant to
|
|
73
|
+
* render its children from edge to edge and is most useful for the headers,
|
|
74
|
+
* `Breadcrumbs`, and `Hero` components or other banner-like components.
|
|
75
|
+
*/
|
|
76
|
+
declare const TemplateBreakout: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
77
|
+
/**
|
|
78
|
+
* This component is most useful to render content on the page. This renders an
|
|
79
|
+
* HTML `<main>` element with an id of "mainContent". The "mainContent" id should
|
|
80
|
+
* be used as the consuming application's skip navigation link. The `TemplateContent`
|
|
81
|
+
* component also takes a `sidebar` prop with optional "left" or "right" values.
|
|
82
|
+
* This will set the correct *styling* needed for the `TemplateContentPrimary`
|
|
83
|
+
* and `TemplateContentSidebar` components. Note that `TemplateContentPrimary`
|
|
84
|
+
* and `TemplateContentSidebar` must be ordered correctly as children elements
|
|
85
|
+
* for the appropriate styles to take effect.
|
|
86
|
+
*/
|
|
87
|
+
declare const TemplateContent: (props: React.PropsWithChildren<TemplateContentProps>) => JSX.Element;
|
|
88
|
+
/**
|
|
89
|
+
* This optional component must be used inside the `TemplateContent` component.
|
|
90
|
+
* This renders content in the main width of the container and will always render
|
|
91
|
+
* above the primary component and the sidebar component (if any).
|
|
92
|
+
*/
|
|
93
|
+
declare const TemplateContentTop: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
94
|
+
/**
|
|
95
|
+
* This optional component must be used inside the `TemplateContent` component
|
|
96
|
+
* and after the `TemplateContentPrimary` or `TemplateContentSidebar` component.
|
|
97
|
+
* This renders content in the main width of the container and should always
|
|
98
|
+
* render below the primary component and the sidebar component (if any).
|
|
99
|
+
*/
|
|
100
|
+
declare const TemplateContentBottom: (props: React.PropsWithChildren<TemplateProps>) => JSX.Element;
|
|
101
|
+
/**
|
|
102
|
+
* This component is used to render content in a column when there must be a
|
|
103
|
+
* sidebar component on either its left or right side. It must go inside the
|
|
104
|
+
* `TemplateContent` component. An optional `sidebar` prop value of "left" or
|
|
105
|
+
* "right" can be passed to render the correct CSS styles. If the `sidebar`
|
|
106
|
+
* prop is used in the `TemplateContent` component, there is no need to pass
|
|
107
|
+
* the `sidebar` prop to this component -- `TemplateContent` will handle it.
|
|
108
|
+
*/
|
|
109
|
+
declare const TemplateContentPrimary: (props: React.PropsWithChildren<TemplateContentProps>) => JSX.Element;
|
|
110
|
+
/**
|
|
111
|
+
* This component is used to render content in a sidebar column. It must go
|
|
112
|
+
* inside the `TemplateContent` component and must be paired with the
|
|
113
|
+
* `TemplateContentPrimary` component. If this is a left sidebar, it needs to be
|
|
114
|
+
* rendered before the `TemplateContentPrimary` component. If this is a right
|
|
115
|
+
* sidebar, it needs to be rendered after the `TemplateContentPrimary` component.
|
|
116
|
+
* An optional `sidebar` prop value of "left" or "right" can be passed to render
|
|
117
|
+
* the correct CSS styles. If the `sidebar` prop is used in the `TemplateContent`
|
|
118
|
+
* component, there is no need to pass the `sidebar` prop to this component --
|
|
119
|
+
* `TemplateContent` will handle it.
|
|
120
|
+
*/
|
|
121
|
+
declare const TemplateContentSidebar: (props: React.PropsWithChildren<TemplateContentProps>) => JSX.Element;
|
|
122
|
+
/**
|
|
123
|
+
* This optional component should be the last child of the `Template`
|
|
124
|
+
* component. This is rendered as an HTML `<footer>` element and spans the full
|
|
125
|
+
* width of the page. If an HTML `<footer>` element is already passed in a
|
|
126
|
+
* custom component, set `renderFooterElement` to `false`.
|
|
127
|
+
*/
|
|
128
|
+
declare const TemplateFooter: ({ children, renderFooterElement, }: React.PropsWithChildren<TemplateFooterProps>) => JSX.Element;
|
|
129
|
+
/**
|
|
130
|
+
* This single component can be used instead of all the individual template
|
|
131
|
+
* components. Instead of importing and rendering the needed "template"
|
|
132
|
+
* components, each section is passed as a prop to the section where it should
|
|
133
|
+
* be rendered. For example, if you want to render content in the
|
|
134
|
+
* `TemplateContentPrimary` section, then pass it as a prop to `contentPrimary`.
|
|
135
|
+
*/
|
|
136
|
+
export declare const TemplateAppContainer: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TemplateAppContainerProps & {
|
|
137
|
+
children?: React.ReactNode;
|
|
138
|
+
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
139
|
+
export { Template, TemplateAboveHeader, TemplateBreakout, TemplateContent, TemplateContentBottom, TemplateContentPrimary, TemplateContentSidebar, TemplateContentTop, TemplateFooter, TemplateHeader, };
|
|
140
|
+
export default TemplateAppContainer;
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export
|
|
3
|
-
export interface TextProps {
|
|
4
|
-
/** Additional class name to render in the `Text` component. */
|
|
5
|
-
className?: string;
|
|
6
|
-
/** Optional prop used to show bolded text */
|
|
7
|
-
isBold?: boolean;
|
|
8
|
-
/** Optional prop used to show itlicized text */
|
|
9
|
-
isItalic?: boolean;
|
|
10
|
-
/** Optional prop used to show capitalized text */
|
|
11
|
-
isCapitalized?: boolean;
|
|
12
|
-
/** Optional prop used to show upper case text */
|
|
13
|
-
isUppercase?: boolean;
|
|
14
|
-
/** Optional prop used to show lower case text */
|
|
15
|
-
isLowercase?: boolean;
|
|
16
|
-
/** Optional prop used to remove default spacing */
|
|
17
|
-
noSpace?: boolean;
|
|
18
|
-
/** Optional prop to control the text styling */
|
|
19
|
-
size?: TextSizes;
|
|
20
|
-
}
|
|
21
|
-
export declare const Text: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TextProps & {
|
|
22
|
-
children?: React.ReactNode;
|
|
23
|
-
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
24
|
-
export default Text;
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type TextSizes = "caption" | "default" | "mini" | "tag";
|
|
3
|
+
export interface TextProps {
|
|
4
|
+
/** Additional class name to render in the `Text` component. */
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Optional prop used to show bolded text */
|
|
7
|
+
isBold?: boolean;
|
|
8
|
+
/** Optional prop used to show itlicized text */
|
|
9
|
+
isItalic?: boolean;
|
|
10
|
+
/** Optional prop used to show capitalized text */
|
|
11
|
+
isCapitalized?: boolean;
|
|
12
|
+
/** Optional prop used to show upper case text */
|
|
13
|
+
isUppercase?: boolean;
|
|
14
|
+
/** Optional prop used to show lower case text */
|
|
15
|
+
isLowercase?: boolean;
|
|
16
|
+
/** Optional prop used to remove default spacing */
|
|
17
|
+
noSpace?: boolean;
|
|
18
|
+
/** Optional prop to control the text styling */
|
|
19
|
+
size?: TextSizes;
|
|
20
|
+
}
|
|
21
|
+
export declare const Text: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<TextProps & {
|
|
22
|
+
children?: React.ReactNode;
|
|
23
|
+
} & React.RefAttributes<HTMLDivElement>>, {}>;
|
|
24
|
+
export default Text;
|
|
@@ -1,88 +1,88 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
-
export
|
|
4
|
-
export declare const TextInputFormats: {
|
|
5
|
-
email: string;
|
|
6
|
-
hidden: string;
|
|
7
|
-
password: string;
|
|
8
|
-
text: string;
|
|
9
|
-
tel: string;
|
|
10
|
-
textarea: string;
|
|
11
|
-
url: string;
|
|
12
|
-
};
|
|
13
|
-
export
|
|
14
|
-
export interface InputProps {
|
|
15
|
-
/** A class name for the TextInput parent div. */
|
|
16
|
-
className?: string;
|
|
17
|
-
/** The starting value of the input field. */
|
|
18
|
-
defaultValue?: string;
|
|
19
|
-
/** Populates the HelperErrorText for the standard state */
|
|
20
|
-
helperText?: HelperErrorTextType;
|
|
21
|
-
/** ID that other components can cross reference for accessibility purposes */
|
|
22
|
-
id: string;
|
|
23
|
-
/** Populates the HelperErrorText for the error state */
|
|
24
|
-
invalidText?: HelperErrorTextType;
|
|
25
|
-
/** Adds a button to clear existing text in the input field. */
|
|
26
|
-
isClearable?: boolean;
|
|
27
|
-
/** The callback function that is called when the clear button is clicked. */
|
|
28
|
-
isClearableCallback?: () => void;
|
|
29
|
-
/** Adds the `disabled` and `aria-disabled` prop to the input when true */
|
|
30
|
-
isDisabled?: boolean;
|
|
31
|
-
/** Adds errored styling to the input/textarea and helper text elements */
|
|
32
|
-
isInvalid?: boolean;
|
|
33
|
-
/** Will add `required` and `aria-required` props to the input/textarea elements */
|
|
34
|
-
isRequired?: boolean;
|
|
35
|
-
/** Provides text for a `Label` component if `showLabel` is set to true;
|
|
36
|
-
* populates an `aria-label` attribute if `showLabel` is set to false. */
|
|
37
|
-
labelText: string;
|
|
38
|
-
/** The max number for a `number` TextInput type. */
|
|
39
|
-
max?: number;
|
|
40
|
-
/** The max length of the input field. This prop is for all input types
|
|
41
|
-
* except for the `number` type. */
|
|
42
|
-
maxLength?: number;
|
|
43
|
-
/** The min number for a `number` TextInput type. */
|
|
44
|
-
min?: number;
|
|
45
|
-
/** Used to reference the input element in forms. */
|
|
46
|
-
name?: string;
|
|
47
|
-
/** The action to perform on the `input`/`textarea`'s onChange function */
|
|
48
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
49
|
-
/** The action to perform on the `input`/`textarea`'s onClick function */
|
|
50
|
-
onClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
51
|
-
/** The action to perform on the `input`/`textarea`'s onFocus function */
|
|
52
|
-
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
53
|
-
/** Regex to query the user input against. */
|
|
54
|
-
pattern?: string;
|
|
55
|
-
/** Populates the placeholder for the input/textarea elements */
|
|
56
|
-
placeholder?: string;
|
|
57
|
-
/** Allows the '(Required)' text to be changed for language purposes
|
|
58
|
-
* Note: Parenthesis will be added automatically by the component */
|
|
59
|
-
requiredLabelText?: string;
|
|
60
|
-
/** Offers the ability to hide the helper/invalid text. */
|
|
61
|
-
showHelperInvalidText?: boolean;
|
|
62
|
-
/** Offers the ability to show the label onscreen or hide it. Refer to the
|
|
63
|
-
* `labelText` property for more information. */
|
|
64
|
-
showLabel?: boolean;
|
|
65
|
-
/** Whether or not to display the "(Required)" text in the label text.
|
|
66
|
-
* True by default. */
|
|
67
|
-
showRequiredLabel?: boolean;
|
|
68
|
-
/** The amount to increase or decrease when using the number type. */
|
|
69
|
-
step?: number;
|
|
70
|
-
/** FOR INTERNAL DS USE ONLY: the input variant to display. */
|
|
71
|
-
textInputType?: TextInputVariants;
|
|
72
|
-
/** HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input */
|
|
73
|
-
type?: TextInputTypes;
|
|
74
|
-
/** Populates the value of the input/textarea elements */
|
|
75
|
-
value?: string;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* The type used for `ref`s. We want to extend both `input` and `textarea`
|
|
79
|
-
* since both are available to create through `TextInput`.
|
|
80
|
-
*/
|
|
81
|
-
export
|
|
82
|
-
/**
|
|
83
|
-
* Renders either an `input` element with a specified type or a `textarea`
|
|
84
|
-
* element. All types will render an accessible `Label` component and an
|
|
85
|
-
* optional `HelperErrorText` component.
|
|
86
|
-
*/
|
|
87
|
-
export declare const TextInput: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInputRefType>>, {}>;
|
|
88
|
-
export default TextInput;
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { HelperErrorTextType } from "../HelperErrorText/HelperErrorText";
|
|
3
|
+
export type TextInputTypes = "email" | "hidden" | "number" | "password" | "text" | "textarea" | "tel" | "url";
|
|
4
|
+
export declare const TextInputFormats: {
|
|
5
|
+
email: string;
|
|
6
|
+
hidden: string;
|
|
7
|
+
password: string;
|
|
8
|
+
text: string;
|
|
9
|
+
tel: string;
|
|
10
|
+
textarea: string;
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
13
|
+
export type TextInputVariants = "default" | "searchBar" | "searchBarSelect";
|
|
14
|
+
export interface InputProps {
|
|
15
|
+
/** A class name for the TextInput parent div. */
|
|
16
|
+
className?: string;
|
|
17
|
+
/** The starting value of the input field. */
|
|
18
|
+
defaultValue?: string;
|
|
19
|
+
/** Populates the HelperErrorText for the standard state */
|
|
20
|
+
helperText?: HelperErrorTextType;
|
|
21
|
+
/** ID that other components can cross reference for accessibility purposes */
|
|
22
|
+
id: string;
|
|
23
|
+
/** Populates the HelperErrorText for the error state */
|
|
24
|
+
invalidText?: HelperErrorTextType;
|
|
25
|
+
/** Adds a button to clear existing text in the input field. */
|
|
26
|
+
isClearable?: boolean;
|
|
27
|
+
/** The callback function that is called when the clear button is clicked. */
|
|
28
|
+
isClearableCallback?: () => void;
|
|
29
|
+
/** Adds the `disabled` and `aria-disabled` prop to the input when true */
|
|
30
|
+
isDisabled?: boolean;
|
|
31
|
+
/** Adds errored styling to the input/textarea and helper text elements */
|
|
32
|
+
isInvalid?: boolean;
|
|
33
|
+
/** Will add `required` and `aria-required` props to the input/textarea elements */
|
|
34
|
+
isRequired?: boolean;
|
|
35
|
+
/** Provides text for a `Label` component if `showLabel` is set to true;
|
|
36
|
+
* populates an `aria-label` attribute if `showLabel` is set to false. */
|
|
37
|
+
labelText: string;
|
|
38
|
+
/** The max number for a `number` TextInput type. */
|
|
39
|
+
max?: number;
|
|
40
|
+
/** The max length of the input field. This prop is for all input types
|
|
41
|
+
* except for the `number` type. */
|
|
42
|
+
maxLength?: number;
|
|
43
|
+
/** The min number for a `number` TextInput type. */
|
|
44
|
+
min?: number;
|
|
45
|
+
/** Used to reference the input element in forms. */
|
|
46
|
+
name?: string;
|
|
47
|
+
/** The action to perform on the `input`/`textarea`'s onChange function */
|
|
48
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement> | React.ChangeEvent<HTMLTextAreaElement>) => void;
|
|
49
|
+
/** The action to perform on the `input`/`textarea`'s onClick function */
|
|
50
|
+
onClick?: (event: React.MouseEvent<HTMLInputElement, MouseEvent>) => void;
|
|
51
|
+
/** The action to perform on the `input`/`textarea`'s onFocus function */
|
|
52
|
+
onFocus?: (event: React.FocusEvent<HTMLInputElement>) => void;
|
|
53
|
+
/** Regex to query the user input against. */
|
|
54
|
+
pattern?: string;
|
|
55
|
+
/** Populates the placeholder for the input/textarea elements */
|
|
56
|
+
placeholder?: string;
|
|
57
|
+
/** Allows the '(Required)' text to be changed for language purposes
|
|
58
|
+
* Note: Parenthesis will be added automatically by the component */
|
|
59
|
+
requiredLabelText?: string;
|
|
60
|
+
/** Offers the ability to hide the helper/invalid text. */
|
|
61
|
+
showHelperInvalidText?: boolean;
|
|
62
|
+
/** Offers the ability to show the label onscreen or hide it. Refer to the
|
|
63
|
+
* `labelText` property for more information. */
|
|
64
|
+
showLabel?: boolean;
|
|
65
|
+
/** Whether or not to display the "(Required)" text in the label text.
|
|
66
|
+
* True by default. */
|
|
67
|
+
showRequiredLabel?: boolean;
|
|
68
|
+
/** The amount to increase or decrease when using the number type. */
|
|
69
|
+
step?: number;
|
|
70
|
+
/** FOR INTERNAL DS USE ONLY: the input variant to display. */
|
|
71
|
+
textInputType?: TextInputVariants;
|
|
72
|
+
/** HTML Input types as defined by MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input */
|
|
73
|
+
type?: TextInputTypes;
|
|
74
|
+
/** Populates the value of the input/textarea elements */
|
|
75
|
+
value?: string;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The type used for `ref`s. We want to extend both `input` and `textarea`
|
|
79
|
+
* since both are available to create through `TextInput`.
|
|
80
|
+
*/
|
|
81
|
+
export type TextInputRefType = HTMLInputElement & HTMLTextAreaElement;
|
|
82
|
+
/**
|
|
83
|
+
* Renders either an `input` element with a specified type or a `textarea`
|
|
84
|
+
* element. All types will render an accessible `Label` component and an
|
|
85
|
+
* optional `HelperErrorText` component.
|
|
86
|
+
*/
|
|
87
|
+
export declare const TextInput: import("@chakra-ui/react").ChakraComponent<React.ForwardRefExoticComponent<InputProps & React.RefAttributes<TextInputRefType>>, {}>;
|
|
88
|
+
export default TextInput;
|