@spothero/ui 15.10.9 → 16.0.0-beta.1
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/.eslintignore +1 -1
- package/babel.config.js +1 -0
- package/dex.config.js +1 -1
- package/jest.config.json +4 -2
- package/package.json +11 -26
- package/v2/index.js +1 -1
- package/v2/index.js.map +1 -1
- package/backlog/Alert/Alert.js +0 -37
- package/backlog/AutoSuggestInput/AutoSuggestInput.js +0 -474
- package/backlog/AutoSuggestInput/AutoSuggestItem.js +0 -99
- package/backlog/AutoSuggestInput/AutoSuggestList.js +0 -126
- package/backlog/Badge/Badge.js +0 -28
- package/backlog/Chart/Chart.js +0 -211
- package/backlog/Checkbox/Checkbox.js +0 -167
- package/backlog/DateTime/DatePicker.js +0 -279
- package/backlog/DateTime/DatePickerCalendar.js +0 -199
- package/backlog/DateTime/DatePickerCalendarNavigation.js +0 -102
- package/backlog/DateTime/DatePickerCalendarWithRange.js +0 -241
- package/backlog/DateTime/DateTimePicker.js +0 -216
- package/backlog/DateTime/DateTimeRangePicker.js +0 -530
- package/backlog/DateTime/TimePicker.js +0 -180
- package/backlog/DateTime/date-time-assertions.js +0 -66
- package/backlog/DateTime/index.js +0 -55
- package/backlog/ErrorBoundary/ErrorBoundary.js +0 -125
- package/backlog/Flyout/Flyout.js +0 -198
- package/backlog/Form/Form.js +0 -193
- package/backlog/Form/FormElementError.js +0 -24
- package/backlog/Form/FormGroup.js +0 -30
- package/backlog/Form/FormGroupError.js +0 -28
- package/backlog/Form/index.js +0 -39
- package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +0 -253
- package/backlog/GooglePlacesSearchInput/PoweredByGoogle.js +0 -38
- package/backlog/GooglePlacesSearchInput/index.js +0 -23
- package/backlog/HorizontalRule/HorizontalRule.js +0 -30
- package/backlog/Label/Label.js +0 -31
- package/backlog/Notification/Notification.js +0 -178
- package/backlog/Notification/NotificationContainer.js +0 -131
- package/backlog/Notification/NotificationPropTypes.js +0 -37
- package/backlog/Notification/index.js +0 -23
- package/backlog/PasswordControl/PasswordControl.js +0 -201
- package/backlog/Portal/Portal.js +0 -110
- package/backlog/PulseLoader/PulseLoader.js +0 -62
- package/backlog/Radio/Radio.js +0 -135
- package/backlog/Radio/RadioGroup.js +0 -123
- package/backlog/Radio/index.js +0 -23
- package/backlog/RenderInBody/RenderInBody.js +0 -103
- package/backlog/Select/Select.js +0 -275
- package/backlog/Select/SelectItemPropTypes.js +0 -32
- package/backlog/Select/index.js +0 -23
- package/backlog/SelectControlled/SelectControlled.js +0 -270
- package/backlog/SelectControlled/index.js +0 -15
- package/backlog/Sprite/Sprite.js +0 -24
- package/backlog/Tabs/Tab.js +0 -94
- package/backlog/Tabs/TabContent.js +0 -56
- package/backlog/Tabs/TabNavigation.js +0 -108
- package/backlog/Tabs/TabPanel.js +0 -29
- package/backlog/Tabs/Tabs.js +0 -126
- package/backlog/Tabs/index.js +0 -47
- package/backlog/TextArea/TextArea.js +0 -155
- package/backlog/TextInput/TextInput.js +0 -230
- package/backlog/TextInput/TextInputPropTypes.js +0 -114
- package/backlog/TextInput/index.js +0 -23
- package/backlog/Tooltip/Tooltip.js +0 -249
- package/backlog/index.js +0 -393
- package/backlog/v1/components/Button/Button.js +0 -64
- package/backlog/v1/components/Button/button-props.js +0 -48
- package/backlog/v1/components/Image/Image.js +0 -193
- package/backlog/v1/components/Loader/Loader.js +0 -51
- package/backlog/v1/components/Modal/Modal.js +0 -325
- package/backlog/v1/components/Modal/ModalContent.js +0 -154
- package/backlog/v1/components/Modal/ModalFooter.js +0 -89
- package/backlog/v1/components/Modal/index.js +0 -31
- package/backlog/v1/components/Panel/Panel.js +0 -209
- package/backlog/v1/components/Table/Table.js +0 -336
- package/backlog/v1/components/Table/TableCell.js +0 -28
- package/backlog/v1/components/Table/TableCellPropTypes.js +0 -22
- package/backlog/v1/components/Table/TableControls.js +0 -56
- package/backlog/v1/components/Table/TableFooter.js +0 -63
- package/backlog/v1/components/Table/TableHeading.js +0 -126
- package/backlog/v1/components/Table/TableHeadingPropTypes.js +0 -35
- package/backlog/v1/components/Table/TableSortSelector.js +0 -125
- package/backlog/v1/components/Table/TableSortType.js +0 -11
- package/backlog/v1/components/Table/index.js +0 -47
- package/backlog/v1/components/TextButton/TextButton.js +0 -74
- package/backlog/v1/components/index.js +0 -75
- package/backlog/v1/utils/deprecate.js +0 -61
- package/styles/Alert/_Alert.scss +0 -51
- package/styles/AutoSuggestInput/_AutoSuggestInput.scss +0 -116
- package/styles/Badge/_Badge.scss +0 -33
- package/styles/Chart/_Chart.scss +0 -105
- package/styles/Chart/_chartist-settings.scss +0 -131
- package/styles/Chart/_chartist.scss +0 -295
- package/styles/Checkbox/_Checkbox.scss +0 -173
- package/styles/DateTime/_DatePicker.scss +0 -61
- package/styles/DateTime/_DatePickerCalendar.scss +0 -159
- package/styles/DateTime/_DateTime.scss +0 -4
- package/styles/DateTime/_DateTimePicker.scss +0 -46
- package/styles/DateTime/_TimePicker.scss +0 -30
- package/styles/ErrorBoundary/_ErrorBoundary.scss +0 -18
- package/styles/Flyout/_Flyout.scss +0 -73
- package/styles/Form/_Form.scss +0 -53
- package/styles/GooglePlacesSearchInput/_GooglePlacesSearchInput.scss +0 -3
- package/styles/GooglePlacesSearchInput/_PoweredByGoogle.scss +0 -21
- package/styles/HorizontalRule/_HorizontalRule.scss +0 -48
- package/styles/Label/_Label.scss +0 -6
- package/styles/Notification/_Notification.scss +0 -113
- package/styles/PasswordControl/_PasswordControl.scss +0 -86
- package/styles/PulseLoader/_PulseLoader.scss +0 -60
- package/styles/Radio/_Radio.scss +0 -93
- package/styles/Select/_Select.scss +0 -94
- package/styles/Tabs/_Tabs.scss +0 -57
- package/styles/TextArea/_TextArea.scss +0 -26
- package/styles/TextInput/_TextInput.scss +0 -43
- package/styles/Tooltip/_Tooltip.scss +0 -108
- package/styles/_index.scss +0 -34
- package/styles/common/sass/_control-sizing.scss +0 -5
- package/styles/common/sass/_disable-scrolling.scss +0 -7
- package/styles/common/sass/_forms.scss +0 -72
- package/styles/index.js +0 -50
- package/styles/v1/components/Button/Button.jsx +0 -48
- package/styles/v1/components/Button/Button.spec.js +0 -76
- package/styles/v1/components/Button/_Button.scss +0 -178
- package/styles/v1/components/Button/button-props.js +0 -30
- package/styles/v1/components/Button/stories/button.js +0 -20
- package/styles/v1/components/Button/stories/index.stories.js +0 -92
- package/styles/v1/components/Button/stories/overview.js +0 -87
- package/styles/v1/components/Button/stories/types.js +0 -31
- package/styles/v1/components/Image/Image.jsx +0 -175
- package/styles/v1/components/Image/Image.spec.js +0 -113
- package/styles/v1/components/Image/_Image.scss +0 -24
- package/styles/v1/components/Image/stories/Cloudinary.stories.js +0 -39
- package/styles/v1/components/Image/stories/Display.stories.js +0 -92
- package/styles/v1/components/Loader/Loader.jsx +0 -54
- package/styles/v1/components/Loader/Loader.spec.js +0 -67
- package/styles/v1/components/Loader/_Loader.scss +0 -18
- package/styles/v1/components/Loader/stories/Display.stories.js +0 -55
- package/styles/v1/components/Modal/Modal.jsx +0 -315
- package/styles/v1/components/Modal/Modal.spec.js +0 -293
- package/styles/v1/components/Modal/ModalContent.jsx +0 -126
- package/styles/v1/components/Modal/ModalFooter.jsx +0 -53
- package/styles/v1/components/Modal/_Modal.scss +0 -262
- package/styles/v1/components/Modal/index.js +0 -3
- package/styles/v1/components/Modal/stories/Content.stories.js +0 -314
- package/styles/v1/components/Modal/stories/Display.stories.js +0 -208
- package/styles/v1/components/Modal/stories/Methods.stories.js +0 -44
- package/styles/v1/components/Modal/stories/Width.stories.js +0 -82
- package/styles/v1/components/Modal/stories/helpers/ReduxConsumer.jsx +0 -21
- package/styles/v1/components/Panel/Panel.jsx +0 -202
- package/styles/v1/components/Panel/Panel.spec.js +0 -196
- package/styles/v1/components/Panel/_Panel.scss +0 -55
- package/styles/v1/components/Panel/stories/Display.stories.js +0 -82
- package/styles/v1/components/Panel/stories/Methods.stories.js +0 -76
- package/styles/v1/components/Table/Table.jsx +0 -367
- package/styles/v1/components/Table/Table.spec.js +0 -526
- package/styles/v1/components/Table/TableCell.jsx +0 -17
- package/styles/v1/components/Table/TableCellPropTypes.js +0 -10
- package/styles/v1/components/Table/TableControls.jsx +0 -61
- package/styles/v1/components/Table/TableFooter.jsx +0 -72
- package/styles/v1/components/Table/TableHeading.jsx +0 -58
- package/styles/v1/components/Table/TableHeadingPropTypes.js +0 -20
- package/styles/v1/components/Table/TableSortSelector.jsx +0 -63
- package/styles/v1/components/Table/TableSortType.js +0 -4
- package/styles/v1/components/Table/_Table.scss +0 -263
- package/styles/v1/components/Table/index.js +0 -5
- package/styles/v1/components/Table/stories/Display.stories.js +0 -194
- package/styles/v1/components/Table/stories/Methods.stories.js +0 -141
- package/styles/v1/components/Table/stories/helpers/TableCellEmail.jsx +0 -25
- package/styles/v1/components/Table/stories/helpers/TableCustomRow.jsx +0 -35
- package/styles/v1/components/Table/stories/helpers/TableHeadingEmail.jsx +0 -20
- package/styles/v1/components/Table/stories/helpers/table-data.js +0 -26
- package/styles/v1/components/Table/stories/helpers/table-headers.js +0 -14
- package/styles/v1/components/TextButton/TextButton.jsx +0 -78
- package/styles/v1/components/TextButton/TextButton.spec.js +0 -95
- package/styles/v1/components/TextButton/_TextButton.scss +0 -114
- package/styles/v1/components/TextButton/stories/Display.stories.js +0 -46
- package/styles/v1/components/index.js +0 -7
- package/styles/v1/utils/deprecate.js +0 -45
- package/styles/v2/components/Accordion/Accordion.jsx +0 -1
- package/styles/v2/components/Accordion/Accordion.stories.js +0 -103
- package/styles/v2/components/Accordion/index.js +0 -7
- package/styles/v2/components/Accordion/styles/button.js +0 -16
- package/styles/v2/components/Accordion/styles/container.js +0 -9
- package/styles/v2/components/Accordion/styles/index.js +0 -19
- package/styles/v2/components/Accordion/styles/panel.js +0 -7
- package/styles/v2/components/Alert/Alert.jsx +0 -121
- package/styles/v2/components/Alert/Alert.stories.js +0 -50
- package/styles/v2/components/Alert/index.js +0 -1
- package/styles/v2/components/Alert/styles/index.js +0 -166
- package/styles/v2/components/AutoSuggestSelect/AutoSuggestSelect.jsx +0 -187
- package/styles/v2/components/AutoSuggestSelect/index.js +0 -1
- package/styles/v2/components/Badge/Badge.jsx +0 -1
- package/styles/v2/components/Badge/Badge.stories.js +0 -32
- package/styles/v2/components/Badge/styles/index.js +0 -29
- package/styles/v2/components/Button/Button.jsx +0 -31
- package/styles/v2/components/Button/Button.spec.js +0 -29
- package/styles/v2/components/Button/Button.styles.js +0 -156
- package/styles/v2/components/Button/button-props.js +0 -66
- package/styles/v2/components/Button/index.js +0 -2
- package/styles/v2/components/Button/stories/button.js +0 -59
- package/styles/v2/components/Button/stories/index.stories.js +0 -82
- package/styles/v2/components/Button/stories/overview.js +0 -73
- package/styles/v2/components/Card/Card.jsx +0 -16
- package/styles/v2/components/Card/Card.stories.js +0 -33
- package/styles/v2/components/Checkbox/Checkbox.jsx +0 -1
- package/styles/v2/components/Checkbox/Checkbox.stories.js +0 -41
- package/styles/v2/components/Checkbox/index.js +0 -1
- package/styles/v2/components/Checkbox/styles/index.js +0 -31
- package/styles/v2/components/Container/Container.jsx +0 -10
- package/styles/v2/components/Container/Container.stories.js +0 -52
- package/styles/v2/components/Container/Container.styles.js +0 -11
- package/styles/v2/components/Divider/Divider.jsx +0 -31
- package/styles/v2/components/Divider/Divider.stories.js +0 -41
- package/styles/v2/components/Divider/Divider.styles.js +0 -15
- package/styles/v2/components/FormControl/FormControl.jsx +0 -77
- package/styles/v2/components/Grid/Grid.jsx +0 -25
- package/styles/v2/components/Grid/Grid.stories.js +0 -128
- package/styles/v2/components/Grid/Grid.styles.js +0 -12
- package/styles/v2/components/Grid/GridItem.jsx +0 -10
- package/styles/v2/components/Grid/GridItem.styles.js +0 -8
- package/styles/v2/components/Grid/index.js +0 -2
- package/styles/v2/components/Heading/Heading.jsx +0 -23
- package/styles/v2/components/Heading/Heading.stories.js +0 -40
- package/styles/v2/components/Heading/Heading.styles.js +0 -61
- package/styles/v2/components/Icon/Icon.jsx +0 -1
- package/styles/v2/components/Icon/Icon.stories.js +0 -38
- package/styles/v2/components/Image/Image.jsx +0 -97
- package/styles/v2/components/Image/Image.spec.js +0 -100
- package/styles/v2/components/Image/Image.stories.js +0 -142
- package/styles/v2/components/Input/Input.jsx +0 -51
- package/styles/v2/components/Input/Input.stories.js +0 -60
- package/styles/v2/components/Input/index.js +0 -1
- package/styles/v2/components/Input/styles/index.js +0 -49
- package/styles/v2/components/Link/Link.jsx +0 -1
- package/styles/v2/components/Link/Link.stories.js +0 -82
- package/styles/v2/components/Link/Link.styles.js +0 -38
- package/styles/v2/components/List/List.jsx +0 -57
- package/styles/v2/components/List/List.stories.js +0 -96
- package/styles/v2/components/List/index.js +0 -2
- package/styles/v2/components/List/styles/index.js +0 -12
- package/styles/v2/components/List/styles/item.styles.js +0 -5
- package/styles/v2/components/Loader/Loader.jsx +0 -75
- package/styles/v2/components/Loader/Loader.stories.js +0 -145
- package/styles/v2/components/Modal/Modal.jsx +0 -71
- package/styles/v2/components/Modal/Modal.stories.js +0 -278
- package/styles/v2/components/Modal/index.js +0 -1
- package/styles/v2/components/Modal/styles/body.js +0 -24
- package/styles/v2/components/Modal/styles/closeButton.js +0 -17
- package/styles/v2/components/Modal/styles/dialog.js +0 -10
- package/styles/v2/components/Modal/styles/dialogContainer.js +0 -10
- package/styles/v2/components/Modal/styles/footer.js +0 -5
- package/styles/v2/components/Modal/styles/header.js +0 -7
- package/styles/v2/components/Modal/styles/index.js +0 -47
- package/styles/v2/components/Modal/styles/overlay.js +0 -4
- package/styles/v2/components/Popover/Popover.jsx +0 -28
- package/styles/v2/components/Popover/Popover.stories.js +0 -113
- package/styles/v2/components/Popover/PopoverArrow.jsx +0 -10
- package/styles/v2/components/Popover/PopoverCloseButton.jsx +0 -10
- package/styles/v2/components/Popover/PopoverContent.jsx +0 -41
- package/styles/v2/components/Popover/index.js +0 -3
- package/styles/v2/components/Popover/styles/index.js +0 -21
- package/styles/v2/components/Popover/styles/popover-arrow.js +0 -5
- package/styles/v2/components/Popover/styles/popover-body.js +0 -5
- package/styles/v2/components/Popover/styles/popover-close-button.js +0 -17
- package/styles/v2/components/Popover/styles/popover-content.js +0 -16
- package/styles/v2/components/Popover/styles/popover-header.js +0 -6
- package/styles/v2/components/Popover/styles/popper.js +0 -5
- package/styles/v2/components/Radio/Radio.jsx +0 -50
- package/styles/v2/components/Radio/Radio.stories.js +0 -155
- package/styles/v2/components/Radio/RadioGroup.jsx +0 -69
- package/styles/v2/components/Radio/index.js +0 -2
- package/styles/v2/components/Radio/styles/index.js +0 -52
- package/styles/v2/components/Select/Select.jsx +0 -62
- package/styles/v2/components/Select/Select.stories.js +0 -60
- package/styles/v2/components/Select/index.js +0 -1
- package/styles/v2/components/Select/styles/index.js +0 -29
- package/styles/v2/components/Skeleton/Skeleton.stories.jsx +0 -34
- package/styles/v2/components/Skeleton/Skeleton.styles.js +0 -3
- package/styles/v2/components/Skeleton/index.js +0 -1
- package/styles/v2/components/Spinner/Spinner.jsx +0 -40
- package/styles/v2/components/Spinner/Spinner.stories.js +0 -98
- package/styles/v2/components/Spinner/Spinner.styles.js +0 -57
- package/styles/v2/components/Switch/Switch.jsx +0 -52
- package/styles/v2/components/Switch/Switch.stories.js +0 -88
- package/styles/v2/components/Switch/index.js +0 -1
- package/styles/v2/components/Switch/styles/index.js +0 -17
- package/styles/v2/components/Table/Table.jsx +0 -1
- package/styles/v2/components/Table/Table.stories.js +0 -90
- package/styles/v2/components/Table/Table.styles.js +0 -66
- package/styles/v2/components/Table/index.js +0 -2
- package/styles/v2/components/Tabs/Tabs.jsx +0 -39
- package/styles/v2/components/Tabs/Tabs.stories.js +0 -47
- package/styles/v2/components/Tabs/combineSizeWithVariant.js +0 -29
- package/styles/v2/components/Tabs/index.js +0 -2
- package/styles/v2/components/Tabs/styles/index.js +0 -40
- package/styles/v2/components/Text/Text.jsx +0 -35
- package/styles/v2/components/Text/Text.stories.js +0 -47
- package/styles/v2/components/Text/Text.styles.js +0 -33
- package/styles/v2/components/Text/combineAsWithVariant.js +0 -106
- package/styles/v2/components/Text/options.js +0 -92
- package/styles/v2/components/ThemeProvider/ThemeProvider.jsx +0 -39
- package/styles/v2/components/ThemeProvider/ThemeProvider.stories.js +0 -85
- package/styles/v2/components/index.js +0 -70
- package/styles/v2/components/styles.js +0 -21
- package/styles/v2/theme/base/breakpoints.js +0 -16
- package/styles/v2/theme/base/colors.js +0 -136
- package/styles/v2/theme/base/index.js +0 -5
- package/styles/v2/theme/base/sizes.js +0 -48
- package/styles/v2/theme/base/typography.js +0 -24
- package/styles/v2/theme/base/zindices.js +0 -17
- package/styles/v2/theme/global.js +0 -118
- package/styles/v2/theme/index.js +0 -27
- package/styles/v2/utils/Spaces.js +0 -16
- package/v1/assets-manifest.json +0 -5
- package/v1/index.html +0 -1
- package/v1/index.js +0 -3
- package/v1/index.js.LICENSE.txt +0 -23
- package/v1/index.js.map +0 -1
|
@@ -1,103 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import {Box} from '@chakra-ui/react';
|
|
4
|
-
|
|
5
|
-
import Text from 'v2/components/Text/Text';
|
|
6
|
-
import Heading from 'v2/components/Heading/Heading';
|
|
7
|
-
|
|
8
|
-
import Component from './Accordion';
|
|
9
|
-
import {
|
|
10
|
-
AccordionIcon,
|
|
11
|
-
AccordionItem,
|
|
12
|
-
AccordionPanel,
|
|
13
|
-
AccordionButton,
|
|
14
|
-
} from './index';
|
|
15
|
-
|
|
16
|
-
export default {
|
|
17
|
-
title: 'v2/Accordion',
|
|
18
|
-
parameters: {
|
|
19
|
-
removeBaseHtmlClass: true,
|
|
20
|
-
},
|
|
21
|
-
argTypes: {
|
|
22
|
-
accordionText: {
|
|
23
|
-
control: {
|
|
24
|
-
type: 'text',
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
allowMultiple: {
|
|
28
|
-
control: {
|
|
29
|
-
type: 'boolean',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
allowToggle: {
|
|
33
|
-
control: {
|
|
34
|
-
type: 'boolean',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
index: {
|
|
38
|
-
control: {
|
|
39
|
-
type: 'number',
|
|
40
|
-
},
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const AccordionTemplate = ({
|
|
46
|
-
accordionText,
|
|
47
|
-
allowMultiple,
|
|
48
|
-
index,
|
|
49
|
-
allowToggle,
|
|
50
|
-
}) => {
|
|
51
|
-
const multipleOptions = allowMultiple
|
|
52
|
-
? {allowMultiple, defaultIndex: index}
|
|
53
|
-
: '';
|
|
54
|
-
|
|
55
|
-
const toggleOptions = allowToggle ? {allowToggle} : '';
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<Component {...toggleOptions} {...multipleOptions}>
|
|
59
|
-
<AccordionItem>
|
|
60
|
-
<Heading as="h3">
|
|
61
|
-
<AccordionButton>
|
|
62
|
-
<Box flex="1" textAlign="left">
|
|
63
|
-
Accordion Item 1 Title
|
|
64
|
-
</Box>
|
|
65
|
-
<AccordionIcon />
|
|
66
|
-
</AccordionButton>
|
|
67
|
-
</Heading>
|
|
68
|
-
<AccordionPanel>
|
|
69
|
-
<Text>{accordionText}</Text>
|
|
70
|
-
</AccordionPanel>
|
|
71
|
-
</AccordionItem>
|
|
72
|
-
<AccordionItem>
|
|
73
|
-
<Heading as="h3">
|
|
74
|
-
<AccordionButton>
|
|
75
|
-
<Box flex="1" textAlign="left">
|
|
76
|
-
Accordion Item 2 Title
|
|
77
|
-
</Box>
|
|
78
|
-
<AccordionIcon />
|
|
79
|
-
</AccordionButton>
|
|
80
|
-
</Heading>
|
|
81
|
-
<AccordionPanel>
|
|
82
|
-
<Text>{accordionText}</Text>
|
|
83
|
-
</AccordionPanel>
|
|
84
|
-
</AccordionItem>
|
|
85
|
-
</Component>
|
|
86
|
-
);
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
AccordionTemplate.propTypes = {
|
|
90
|
-
allowToggle: PropTypes.bool,
|
|
91
|
-
allowMultiple: PropTypes.bool,
|
|
92
|
-
accordionText: PropTypes.string,
|
|
93
|
-
index: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),
|
|
94
|
-
defaultIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.array]),
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
export const Accordion = AccordionTemplate.bind({});
|
|
98
|
-
Accordion.args = {
|
|
99
|
-
accordionText: `You must come along now, Artoo. There's really nothing more we can do. And my joints are freezing up. Don't say thing like that! Of course we'll see Master Luke again. He'll be quite all right, you'll see. Stupid little short-circuit. He'll be quite all right. Sir, all the patrols are in. There's still no contact from Skywalker or Solo. Mistress Leia, Artoo says he's been quite unable to pick up any signals, although he does admit that his own range is far too weak to abandon all hope. Your Highness, there's nothing more we can do tonight. The shield doors must be closed. Close the doors. Yes, sir.`,
|
|
100
|
-
allowMultiple: true,
|
|
101
|
-
allowToggle: true,
|
|
102
|
-
index: [1],
|
|
103
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {variants as headingVariants} from 'v2/components/Heading/Heading.styles';
|
|
2
|
-
|
|
3
|
-
const button = {
|
|
4
|
-
fontSize: headingVariants.h4.fontSize,
|
|
5
|
-
fontWeight: 'semibold',
|
|
6
|
-
px: 0,
|
|
7
|
-
py: {
|
|
8
|
-
base: 4,
|
|
9
|
-
tablet: 6,
|
|
10
|
-
},
|
|
11
|
-
'& svg': {
|
|
12
|
-
color: 'primary.default',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default button;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import merge from 'lodash/merge';
|
|
2
|
-
import chakraDefaultTheme from '@chakra-ui/theme';
|
|
3
|
-
|
|
4
|
-
import panel from './panel';
|
|
5
|
-
import button from './button';
|
|
6
|
-
import container from './container';
|
|
7
|
-
|
|
8
|
-
const parts = ['container', 'button', 'panel'];
|
|
9
|
-
|
|
10
|
-
const baseStyle = {
|
|
11
|
-
panel,
|
|
12
|
-
button,
|
|
13
|
-
container,
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default merge(chakraDefaultTheme.components.Accordion, {
|
|
17
|
-
parts,
|
|
18
|
-
baseStyle,
|
|
19
|
-
});
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
Alert as ChakraAlert,
|
|
4
|
-
AlertTitle,
|
|
5
|
-
AlertDescription,
|
|
6
|
-
VStack,
|
|
7
|
-
Flex,
|
|
8
|
-
useStyleConfig,
|
|
9
|
-
} from '@chakra-ui/react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
11
|
-
import IconX from '@spothero/icons/times';
|
|
12
|
-
import IconInfo from '@spothero/icons/filled-info-circle';
|
|
13
|
-
import IconExclamation from '@spothero/icons/filled-exclamation-circle';
|
|
14
|
-
import IconCheck from '@spothero/icons/filled-check-circle';
|
|
15
|
-
import Button from 'v2/components/Button/Button';
|
|
16
|
-
import Icon from 'v2/components/Icon/Icon';
|
|
17
|
-
|
|
18
|
-
export const STATUSES = {
|
|
19
|
-
NEUTRAL: 'neutral',
|
|
20
|
-
ERROR: 'error',
|
|
21
|
-
WARNING: 'warning',
|
|
22
|
-
SUCCESS: 'success',
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const statusIconMapping = {
|
|
26
|
-
[STATUSES.WARNING]: IconExclamation,
|
|
27
|
-
[STATUSES.SUCCESS]: IconCheck,
|
|
28
|
-
[STATUSES.ERROR]: IconExclamation,
|
|
29
|
-
[STATUSES.NEUTRAL]: IconInfo,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const Alert = ({
|
|
33
|
-
status,
|
|
34
|
-
title,
|
|
35
|
-
buttonProps,
|
|
36
|
-
buttonText,
|
|
37
|
-
buttonOnBottom,
|
|
38
|
-
showDismiss,
|
|
39
|
-
onDismissClick,
|
|
40
|
-
showIcon,
|
|
41
|
-
description,
|
|
42
|
-
...props
|
|
43
|
-
}) => {
|
|
44
|
-
const style = useStyleConfig('Alert', {'data-status': status});
|
|
45
|
-
const IconVariant = statusIconMapping[status];
|
|
46
|
-
|
|
47
|
-
return (
|
|
48
|
-
<ChakraAlert data-status={status} {...props}>
|
|
49
|
-
{showIcon ? <Icon sx={style.icon} as={IconVariant} /> : null}
|
|
50
|
-
<VStack spacing={0} alignItems="flex-start">
|
|
51
|
-
{title ? <AlertTitle>{title}</AlertTitle> : null}
|
|
52
|
-
{description ? (
|
|
53
|
-
<AlertDescription>{description}</AlertDescription>
|
|
54
|
-
) : null}
|
|
55
|
-
{buttonOnBottom && buttonText && buttonProps ? (
|
|
56
|
-
<Button
|
|
57
|
-
sx={style.actionButton}
|
|
58
|
-
variant="tertiary"
|
|
59
|
-
{...buttonProps}
|
|
60
|
-
>
|
|
61
|
-
{buttonText}
|
|
62
|
-
</Button>
|
|
63
|
-
) : null}
|
|
64
|
-
</VStack>
|
|
65
|
-
<Flex alignItems="center" marginLeft="auto">
|
|
66
|
-
{!buttonOnBottom && buttonText && buttonProps ? (
|
|
67
|
-
<Button
|
|
68
|
-
sx={style.actionButton}
|
|
69
|
-
variant="tertiary"
|
|
70
|
-
{...buttonProps}
|
|
71
|
-
>
|
|
72
|
-
{buttonText}
|
|
73
|
-
</Button>
|
|
74
|
-
) : null}
|
|
75
|
-
{showDismiss ? (
|
|
76
|
-
<Button sx={style.dismissButton} onClick={onDismissClick}>
|
|
77
|
-
<Icon width={3} height="auto" as={IconX} />
|
|
78
|
-
</Button>
|
|
79
|
-
) : null}
|
|
80
|
-
</Flex>
|
|
81
|
-
</ChakraAlert>
|
|
82
|
-
);
|
|
83
|
-
};
|
|
84
|
-
|
|
85
|
-
Alert.propTypes = {
|
|
86
|
-
/** Status. One of: success, neutral, warning, or error */
|
|
87
|
-
status: PropTypes.oneOf(['neutral', 'success', 'warning', 'error']),
|
|
88
|
-
/** Title Text. Will not display title if empty */
|
|
89
|
-
title: PropTypes.node,
|
|
90
|
-
/** Props to pass to button (like onClick). Will not display button if this or buttonText empty */
|
|
91
|
-
buttonProps: PropTypes.object,
|
|
92
|
-
/** Text of button. Will not display button if this or buttonProps empty */
|
|
93
|
-
buttonText: PropTypes.string,
|
|
94
|
-
/** Whether action button should be under description (as opposed to on right) */
|
|
95
|
-
buttonOnBottom: PropTypes.bool,
|
|
96
|
-
/** Whether or not to show X dismiss button */
|
|
97
|
-
showDismiss: PropTypes.bool,
|
|
98
|
-
/** Callback when X clicked */
|
|
99
|
-
onDismissClick: PropTypes.func,
|
|
100
|
-
/** Whether or not to show the icon */
|
|
101
|
-
showIcon: PropTypes.bool,
|
|
102
|
-
/** Description text. Will not display description if empty */
|
|
103
|
-
description: PropTypes.node,
|
|
104
|
-
/** Size of the text */
|
|
105
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
Alert.defaultProps = {
|
|
109
|
-
status: 'neutral',
|
|
110
|
-
title: null,
|
|
111
|
-
buttonProps: null,
|
|
112
|
-
buttonText: null,
|
|
113
|
-
buttonOnBottom: false,
|
|
114
|
-
showDismiss: false,
|
|
115
|
-
onDismissClick: null,
|
|
116
|
-
showIcon: true,
|
|
117
|
-
description: null,
|
|
118
|
-
size: 'md',
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
export default Alert;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {VStack, Text} from '@chakra-ui/react';
|
|
3
|
-
import {createSelectControl} from 'storybook/utils/create-control';
|
|
4
|
-
import disableArgs from 'storybook/utils/disable-args';
|
|
5
|
-
|
|
6
|
-
import Component from './Alert';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'v2/Alert',
|
|
10
|
-
component: Component,
|
|
11
|
-
parameters: {
|
|
12
|
-
removeBaseHtmlClass: true,
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const AlertTemplate = props => (
|
|
17
|
-
<VStack alignItems="flex-start">
|
|
18
|
-
<Text>Status: Success</Text>
|
|
19
|
-
<Component status="success" {...props} />
|
|
20
|
-
<Text>Status: Error</Text>
|
|
21
|
-
<Component status="error" {...props} />
|
|
22
|
-
<Text>Status: Warning</Text>
|
|
23
|
-
<Component status="warning" {...props} />
|
|
24
|
-
<Text>Status: Neutral</Text>
|
|
25
|
-
<Component status="neutral" {...props} />
|
|
26
|
-
</VStack>
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
AlertTemplate.propTypes = {};
|
|
30
|
-
|
|
31
|
-
export const Alert = AlertTemplate.bind({});
|
|
32
|
-
|
|
33
|
-
Alert.argTypes = {
|
|
34
|
-
...createSelectControl('size', ['sm', 'md', 'lg']),
|
|
35
|
-
...disableArgs(['buttonProps', 'onDismissClick', 'status']),
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
Alert.args = {
|
|
39
|
-
title: 'Hello',
|
|
40
|
-
buttonOnBottom: false,
|
|
41
|
-
buttonText: 'Action',
|
|
42
|
-
description: 'This is an alert.',
|
|
43
|
-
buttonProps: {
|
|
44
|
-
onClick: () => console.log('Action clicked'),
|
|
45
|
-
},
|
|
46
|
-
showDismiss: true,
|
|
47
|
-
onDismissClick: () => console.log('dismissed'),
|
|
48
|
-
showIcon: true,
|
|
49
|
-
size: 'md',
|
|
50
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {default} from './Alert';
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import merge from 'lodash/merge';
|
|
2
|
-
import chakraDefaultTheme from '@chakra-ui/theme';
|
|
3
|
-
import {STATUSES} from '../Alert';
|
|
4
|
-
|
|
5
|
-
const baseStyle = {
|
|
6
|
-
container: {
|
|
7
|
-
paddingY: 2,
|
|
8
|
-
borderRadius: 'base',
|
|
9
|
-
},
|
|
10
|
-
actionButton: {
|
|
11
|
-
fontSize: 'sm',
|
|
12
|
-
height: 'fit-content',
|
|
13
|
-
lineHeight: '1.4',
|
|
14
|
-
color: 'primary.600',
|
|
15
|
-
_hover: {
|
|
16
|
-
color: 'primary.700',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
dismissButton: {
|
|
20
|
-
color: 'gray.600',
|
|
21
|
-
borderColor: 'transparent',
|
|
22
|
-
borderWidth: '2px',
|
|
23
|
-
padding: 0,
|
|
24
|
-
width: 10,
|
|
25
|
-
height: 10,
|
|
26
|
-
backgroundColor: 'transparent',
|
|
27
|
-
borderRadius: 'base',
|
|
28
|
-
marginLeft: 2,
|
|
29
|
-
_hover: {
|
|
30
|
-
color: 'gray.700',
|
|
31
|
-
},
|
|
32
|
-
_focus: {
|
|
33
|
-
color: 'gray.700',
|
|
34
|
-
borderColor: 'white',
|
|
35
|
-
boxShadow: 'outline',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
icon: {
|
|
39
|
-
width: 6,
|
|
40
|
-
marginRight: 2,
|
|
41
|
-
height: 'auto',
|
|
42
|
-
},
|
|
43
|
-
description: {
|
|
44
|
-
lineHeight: 1.4,
|
|
45
|
-
},
|
|
46
|
-
title: {
|
|
47
|
-
lineHeight: 1.4,
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
const statusStyles = status => {
|
|
52
|
-
switch (status) {
|
|
53
|
-
case STATUSES.NEUTRAL:
|
|
54
|
-
return {
|
|
55
|
-
container: {
|
|
56
|
-
background: 'gray.light',
|
|
57
|
-
},
|
|
58
|
-
icon: {
|
|
59
|
-
color: 'gray.dark',
|
|
60
|
-
},
|
|
61
|
-
dismissButton: {
|
|
62
|
-
_hover: {
|
|
63
|
-
background: 'gray.200',
|
|
64
|
-
},
|
|
65
|
-
_focus: {
|
|
66
|
-
background: 'gray.200',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
case STATUSES.WARNING:
|
|
71
|
-
return {
|
|
72
|
-
container: {
|
|
73
|
-
background: 'yellow.100',
|
|
74
|
-
},
|
|
75
|
-
icon: {
|
|
76
|
-
color: 'yellow.500',
|
|
77
|
-
},
|
|
78
|
-
dismissButton: {
|
|
79
|
-
_hover: {
|
|
80
|
-
background: 'yellow.200',
|
|
81
|
-
},
|
|
82
|
-
_focus: {
|
|
83
|
-
background: 'yellow.200',
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
case STATUSES.ERROR:
|
|
88
|
-
return {
|
|
89
|
-
container: {
|
|
90
|
-
background: 'red.100',
|
|
91
|
-
},
|
|
92
|
-
icon: {
|
|
93
|
-
color: 'red.700',
|
|
94
|
-
},
|
|
95
|
-
dismissButton: {
|
|
96
|
-
_hover: {
|
|
97
|
-
background: 'red.200',
|
|
98
|
-
},
|
|
99
|
-
_focus: {
|
|
100
|
-
background: 'red.200',
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
};
|
|
104
|
-
case STATUSES.SUCCESS:
|
|
105
|
-
return {
|
|
106
|
-
container: {
|
|
107
|
-
background: 'green.100',
|
|
108
|
-
},
|
|
109
|
-
icon: {
|
|
110
|
-
color: 'green.700',
|
|
111
|
-
},
|
|
112
|
-
dismissButton: {
|
|
113
|
-
_hover: {
|
|
114
|
-
background: 'green.200',
|
|
115
|
-
},
|
|
116
|
-
_focus: {
|
|
117
|
-
background: 'green.200',
|
|
118
|
-
},
|
|
119
|
-
},
|
|
120
|
-
};
|
|
121
|
-
|
|
122
|
-
default:
|
|
123
|
-
return {};
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
|
|
127
|
-
const overrides = {
|
|
128
|
-
baseStyle: props => {
|
|
129
|
-
return merge(
|
|
130
|
-
{
|
|
131
|
-
...chakraDefaultTheme.components.Alert.baseStyle,
|
|
132
|
-
},
|
|
133
|
-
baseStyle,
|
|
134
|
-
statusStyles(props['data-status'])
|
|
135
|
-
);
|
|
136
|
-
},
|
|
137
|
-
variants: {},
|
|
138
|
-
sizes: {
|
|
139
|
-
sm: {
|
|
140
|
-
title: {
|
|
141
|
-
fontSize: 'xs',
|
|
142
|
-
},
|
|
143
|
-
description: {
|
|
144
|
-
fontSize: 'xs',
|
|
145
|
-
},
|
|
146
|
-
},
|
|
147
|
-
md: {
|
|
148
|
-
title: {
|
|
149
|
-
fontSize: 'sm',
|
|
150
|
-
},
|
|
151
|
-
description: {
|
|
152
|
-
fontSize: 'sm',
|
|
153
|
-
},
|
|
154
|
-
},
|
|
155
|
-
lg: {
|
|
156
|
-
title: {
|
|
157
|
-
fontSize: 'base',
|
|
158
|
-
},
|
|
159
|
-
description: {
|
|
160
|
-
fontSize: 'base',
|
|
161
|
-
},
|
|
162
|
-
},
|
|
163
|
-
},
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export default {...chakraDefaultTheme.components.Alert, ...overrides};
|
|
@@ -1,187 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import FormControl from '../FormControl/FormControl';
|
|
4
|
-
import AsyncSelect from 'react-select/async';
|
|
5
|
-
import {useTheme} from '@chakra-ui/react';
|
|
6
|
-
import IconTimesCircle from '@spothero/icons/times-circle';
|
|
7
|
-
|
|
8
|
-
const AutoSuggestSelect = forwardRef(
|
|
9
|
-
(
|
|
10
|
-
{
|
|
11
|
-
id,
|
|
12
|
-
label,
|
|
13
|
-
helperText,
|
|
14
|
-
errorMessage,
|
|
15
|
-
isInvalid,
|
|
16
|
-
isDisabled,
|
|
17
|
-
isRequired,
|
|
18
|
-
getOptions,
|
|
19
|
-
onChange,
|
|
20
|
-
iconSrc,
|
|
21
|
-
placeholder,
|
|
22
|
-
},
|
|
23
|
-
ref
|
|
24
|
-
) => {
|
|
25
|
-
const {colors, fontSizes, sizes} = useTheme();
|
|
26
|
-
|
|
27
|
-
const handleChange = selectedOption => {
|
|
28
|
-
onChange(selectedOption);
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const icon = (color = 'transparent') => ({
|
|
32
|
-
alignItems: 'center',
|
|
33
|
-
display: 'flex',
|
|
34
|
-
|
|
35
|
-
':before': {
|
|
36
|
-
backgroundColor: color,
|
|
37
|
-
content: '" "',
|
|
38
|
-
display: 'block',
|
|
39
|
-
marginRight: sizes['3'],
|
|
40
|
-
height: sizes['4'],
|
|
41
|
-
width: sizes['5'],
|
|
42
|
-
mask: `url(${iconSrc}) no-repeat 50% 50%`,
|
|
43
|
-
maskSize: 'contain',
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const baseText = {
|
|
48
|
-
fontSize: fontSizes.base,
|
|
49
|
-
color: colors.black,
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/** React Select doesn't use Chakra but it does use Emotion so it's not too difficult to use values from our Chakra theme. Here is the documentation for React Select styling: https://react-select.com/styles */
|
|
53
|
-
const customStyles = {
|
|
54
|
-
menu: provided => ({
|
|
55
|
-
...provided,
|
|
56
|
-
...baseText,
|
|
57
|
-
}),
|
|
58
|
-
control: (provided, state) => ({
|
|
59
|
-
...provided,
|
|
60
|
-
borderColor: isInvalid
|
|
61
|
-
? colors.error
|
|
62
|
-
: state.isFocused
|
|
63
|
-
? colors.primary.default
|
|
64
|
-
: colors.gray['200'],
|
|
65
|
-
borderWidth: '1px',
|
|
66
|
-
boxShadow: 'none',
|
|
67
|
-
'&:hover': {
|
|
68
|
-
borderColor: isInvalid
|
|
69
|
-
? colors.error
|
|
70
|
-
: state.isFocused
|
|
71
|
-
? colors.primary.default
|
|
72
|
-
: colors.gray['200'],
|
|
73
|
-
},
|
|
74
|
-
}),
|
|
75
|
-
input: (provided, state) => ({
|
|
76
|
-
...provided,
|
|
77
|
-
...baseText,
|
|
78
|
-
padding: sizes['2'],
|
|
79
|
-
backgroundColor: state.isDisabled
|
|
80
|
-
? colors.gray['200']
|
|
81
|
-
: 'transparent',
|
|
82
|
-
...(iconSrc && icon(colors.gray['600'])),
|
|
83
|
-
}),
|
|
84
|
-
placeholder: provided => ({
|
|
85
|
-
...provided,
|
|
86
|
-
padding: sizes['2'],
|
|
87
|
-
fontSize: fontSizes.base,
|
|
88
|
-
color: colors.gray['600'],
|
|
89
|
-
...(iconSrc && icon()),
|
|
90
|
-
}),
|
|
91
|
-
singleValue: provided => ({
|
|
92
|
-
...provided,
|
|
93
|
-
...baseText,
|
|
94
|
-
padding: sizes['2'],
|
|
95
|
-
...(iconSrc && icon()),
|
|
96
|
-
}),
|
|
97
|
-
option: (provided, state) => ({
|
|
98
|
-
...provided,
|
|
99
|
-
backgroundColor: state.isSelected
|
|
100
|
-
? colors.gray['200']
|
|
101
|
-
: state.isFocused
|
|
102
|
-
? colors.gray['50']
|
|
103
|
-
: 'transparent',
|
|
104
|
-
color: colors.black,
|
|
105
|
-
}),
|
|
106
|
-
clearIndicator: provided => ({
|
|
107
|
-
...provided,
|
|
108
|
-
color: colors.gray['600'],
|
|
109
|
-
}),
|
|
110
|
-
dropdownIndicator: provided => ({
|
|
111
|
-
...provided,
|
|
112
|
-
color: colors.gray['600'],
|
|
113
|
-
}),
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
const clearIndicatorStyles = {
|
|
117
|
-
width: sizes['5'],
|
|
118
|
-
display: 'flex',
|
|
119
|
-
marginRight: sizes['3'],
|
|
120
|
-
color: colors.gray['600'],
|
|
121
|
-
cursor: 'pointer',
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
/** React Select allows you to override the clear indicator with your own custom component: https://react-select.com/components */
|
|
125
|
-
const ClearIndicator = ({innerRef, innerProps}) => (
|
|
126
|
-
<div style={clearIndicatorStyles} ref={innerRef} {...innerProps}>
|
|
127
|
-
<IconTimesCircle />
|
|
128
|
-
</div>
|
|
129
|
-
);
|
|
130
|
-
|
|
131
|
-
return (
|
|
132
|
-
<FormControl
|
|
133
|
-
errorMessage={errorMessage}
|
|
134
|
-
isRequired={isRequired}
|
|
135
|
-
helperText={helperText}
|
|
136
|
-
label={label}
|
|
137
|
-
inputId={id}
|
|
138
|
-
>
|
|
139
|
-
<AsyncSelect
|
|
140
|
-
closeMenuOnSelect
|
|
141
|
-
isClearable
|
|
142
|
-
cacheOptions
|
|
143
|
-
components={{
|
|
144
|
-
DropdownIndicator: () => null,
|
|
145
|
-
IndicatorSeparator: () => null,
|
|
146
|
-
ClearIndicator,
|
|
147
|
-
}}
|
|
148
|
-
openMenuOnClick={false}
|
|
149
|
-
loadOptions={getOptions}
|
|
150
|
-
onChange={handleChange}
|
|
151
|
-
isDisabled={isDisabled}
|
|
152
|
-
id={id}
|
|
153
|
-
placeholder={placeholder}
|
|
154
|
-
styles={customStyles}
|
|
155
|
-
ref={ref}
|
|
156
|
-
/>
|
|
157
|
-
</FormControl>
|
|
158
|
-
);
|
|
159
|
-
}
|
|
160
|
-
);
|
|
161
|
-
|
|
162
|
-
AutoSuggestSelect.propTypes = {
|
|
163
|
-
/** ID applied to the select and label */
|
|
164
|
-
id: PropTypes.string.isRequired,
|
|
165
|
-
/** Label that describes the select */
|
|
166
|
-
label: PropTypes.string,
|
|
167
|
-
/** Text to use as placeholder in the input */
|
|
168
|
-
placeholder: PropTypes.string,
|
|
169
|
-
/** Optional helper text displayed below the select */
|
|
170
|
-
helperText: PropTypes.string,
|
|
171
|
-
/** Error message that would display under the select */
|
|
172
|
-
errorMessage: PropTypes.string,
|
|
173
|
-
/** Boolean that sets whether the select is valid */
|
|
174
|
-
isInvalid: PropTypes.bool,
|
|
175
|
-
/** Boolean that sets whether the select is disabled */
|
|
176
|
-
isDisabled: PropTypes.bool,
|
|
177
|
-
/** Boolean that sets whether the select is required */
|
|
178
|
-
isRequired: PropTypes.bool,
|
|
179
|
-
/** Function that is called with the value typed into the input that returns a list of options for the select */
|
|
180
|
-
getOptions: PropTypes.func.isRequired,
|
|
181
|
-
/** Function that is called when an option is selected, it returns the label and value of the selection */
|
|
182
|
-
onChange: PropTypes.func.isRequired,
|
|
183
|
-
/** Optional src to SVG to use as search icon */
|
|
184
|
-
iconSrc: PropTypes.string,
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
export default AutoSuggestSelect;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {default as AutoSuggestSelect} from './AutoSuggestSelect';
|