@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,24 +0,0 @@
|
|
|
1
|
-
export default ({footer, header, hideCloseButton}) => {
|
|
2
|
-
const scrollingHeaderStyles =
|
|
3
|
-
header || !hideCloseButton
|
|
4
|
-
? {
|
|
5
|
-
// The following adapted from https://lea.verou.me/2012/04/background-attachment-local/
|
|
6
|
-
background:
|
|
7
|
-
'linear-gradient(white 30%, white), linear-gradient(rgb(0 0 0 / 10%) 0%, white)',
|
|
8
|
-
backgroundRepeat: 'no-repeat',
|
|
9
|
-
backgroundColor: 'white',
|
|
10
|
-
backgroundSize: '100% 30px, 100% 10px',
|
|
11
|
-
backgroundAttachment: 'local, scroll',
|
|
12
|
-
}
|
|
13
|
-
: {};
|
|
14
|
-
|
|
15
|
-
return {
|
|
16
|
-
borderBottomRadius: footer ? null : 'md',
|
|
17
|
-
paddingX: 4,
|
|
18
|
-
paddingBottom: 4,
|
|
19
|
-
flex: 1,
|
|
20
|
-
overflow: 'auto',
|
|
21
|
-
display: 'flex',
|
|
22
|
-
...scrollingHeaderStyles,
|
|
23
|
-
};
|
|
24
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default ({header}) => ({
|
|
2
|
-
position: 'absolute',
|
|
3
|
-
top: header ? 4 : 2,
|
|
4
|
-
insetEnd: header ? 4 : 2,
|
|
5
|
-
color: 'gray.dark',
|
|
6
|
-
borderRadius: 'sm',
|
|
7
|
-
width: 8,
|
|
8
|
-
height: 8,
|
|
9
|
-
|
|
10
|
-
_focus: {
|
|
11
|
-
boxShadow: 'outline',
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
_hover: {
|
|
15
|
-
bg: 'gray.50',
|
|
16
|
-
},
|
|
17
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import merge from 'lodash/merge';
|
|
2
|
-
import chakraDefaultTheme from '@chakra-ui/theme';
|
|
3
|
-
|
|
4
|
-
import overlay from './overlay';
|
|
5
|
-
import dialogContainer from './dialogContainer';
|
|
6
|
-
import dialog from './dialog';
|
|
7
|
-
import header from './header';
|
|
8
|
-
import closeButton from './closeButton';
|
|
9
|
-
import body from './body';
|
|
10
|
-
import footer from './footer';
|
|
11
|
-
|
|
12
|
-
const baseStyle = props => ({
|
|
13
|
-
overlay,
|
|
14
|
-
dialogContainer,
|
|
15
|
-
dialog: dialog(props),
|
|
16
|
-
header: header(props),
|
|
17
|
-
closeButton: closeButton(props),
|
|
18
|
-
body: body(props),
|
|
19
|
-
footer,
|
|
20
|
-
});
|
|
21
|
-
|
|
22
|
-
const sizes = {
|
|
23
|
-
sm: {
|
|
24
|
-
dialog: {
|
|
25
|
-
// Would have preferred object syntax here and below, but wasn't working for whatever reason
|
|
26
|
-
maxWidth: ['100%', '100%', '48%', '32%', '24%'],
|
|
27
|
-
maxHeight: ['100%', '100%', '60%', '48%', '32%'],
|
|
28
|
-
minHeight: ['auto', 'auto', '32%', '32%', '24%'],
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
md: {
|
|
32
|
-
dialog: {
|
|
33
|
-
maxWidth: ['100%', '100%', '84%', '60%', '48%'],
|
|
34
|
-
maxHeight: ['100%', '100%', '96%', '84%', '60%'],
|
|
35
|
-
minHeight: ['auto', 'auto', '84%', '60%', '48%'],
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
lg: {
|
|
39
|
-
dialog: {
|
|
40
|
-
maxWidth: ['100%', '100%', '96%', '84%', '72%'],
|
|
41
|
-
maxHeight: ['100%', '100%', '96%', '96%', '84%'],
|
|
42
|
-
minHeight: ['auto', 'auto', '96%', '84%', '72%'],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default merge(chakraDefaultTheme.components.Modal, {baseStyle, sizes});
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef, cloneElement, Children} from 'react';
|
|
2
|
-
import {Popover as ChakraPopover} from '@chakra-ui/react';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
const Popover = forwardRef((props, ref) => {
|
|
6
|
-
const {children, ...rest} = props;
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<ChakraPopover {...rest} ref={ref}>
|
|
10
|
-
{Children.toArray(children).map((child, index) =>
|
|
11
|
-
cloneElement(child, {
|
|
12
|
-
ref,
|
|
13
|
-
variant: props.variant,
|
|
14
|
-
key: `Popover-child-${index}`,
|
|
15
|
-
})
|
|
16
|
-
)}
|
|
17
|
-
</ChakraPopover>
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
Popover.propTypes = {
|
|
22
|
-
/** React children */
|
|
23
|
-
children: PropTypes.node,
|
|
24
|
-
/** Styles the Popover */
|
|
25
|
-
variant: PropTypes.oneOf(['light', 'dark']),
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export default Popover;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import disableArgs from 'storybook/utils/disable-args';
|
|
5
|
-
import {createSelectControl} from 'storybook/utils/create-control';
|
|
6
|
-
|
|
7
|
-
import {Popover, PopoverContent, PopoverTrigger} from './index';
|
|
8
|
-
|
|
9
|
-
import {Flex} from '@chakra-ui/react';
|
|
10
|
-
import Button from 'v2/components/Button/Button';
|
|
11
|
-
|
|
12
|
-
export default {
|
|
13
|
-
title: 'v2/Popover',
|
|
14
|
-
component: Popover,
|
|
15
|
-
subcomponents: {
|
|
16
|
-
PopoverContent,
|
|
17
|
-
PopoverTrigger,
|
|
18
|
-
},
|
|
19
|
-
parameters: {
|
|
20
|
-
importBy: 'Popover',
|
|
21
|
-
removeBaseHtmlClass: true,
|
|
22
|
-
chakraLink: 'https://chakra-ui.com/docs/overlay/popover',
|
|
23
|
-
},
|
|
24
|
-
argTypes: {
|
|
25
|
-
...disableArgs('children'),
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const OverviewTemplate = props => (
|
|
30
|
-
<Popover defaultIsOpen {...props}>
|
|
31
|
-
<Flex justifyContent="center" alignItems="center">
|
|
32
|
-
<PopoverTrigger>
|
|
33
|
-
<Button>Trigger</Button>
|
|
34
|
-
</PopoverTrigger>
|
|
35
|
-
</Flex>
|
|
36
|
-
|
|
37
|
-
<PopoverContent header="Confirmation!">
|
|
38
|
-
Are you sure you want to have that milkshake?
|
|
39
|
-
</PopoverContent>
|
|
40
|
-
</Popover>
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
OverviewTemplate.propTypes = {
|
|
44
|
-
variant: PropTypes.oneOf(['light', 'dark']),
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const Variant = OverviewTemplate.bind({});
|
|
48
|
-
Variant.argTypes = {
|
|
49
|
-
...createSelectControl('variant', ['light', 'dark']),
|
|
50
|
-
};
|
|
51
|
-
Variant.args = {
|
|
52
|
-
variant: 'light',
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export const Placement = OverviewTemplate.bind({});
|
|
56
|
-
Placement.argTypes = {
|
|
57
|
-
...createSelectControl('placement', [
|
|
58
|
-
'top',
|
|
59
|
-
'right',
|
|
60
|
-
'bottom',
|
|
61
|
-
'left',
|
|
62
|
-
'auto',
|
|
63
|
-
'auto-start',
|
|
64
|
-
'auto-end',
|
|
65
|
-
'top-start',
|
|
66
|
-
'top-end',
|
|
67
|
-
'bottom-start',
|
|
68
|
-
'bottom-end',
|
|
69
|
-
'right-start',
|
|
70
|
-
'right-end',
|
|
71
|
-
'left-start',
|
|
72
|
-
'left-end',
|
|
73
|
-
]),
|
|
74
|
-
|
|
75
|
-
...disableArgs('variant'),
|
|
76
|
-
};
|
|
77
|
-
Placement.args = {
|
|
78
|
-
placement: 'bottom',
|
|
79
|
-
};
|
|
80
|
-
const NoHeaderTemplate = props => (
|
|
81
|
-
<Popover defaultIsOpen {...props}>
|
|
82
|
-
<PopoverTrigger>
|
|
83
|
-
<Button>Trigger</Button>
|
|
84
|
-
</PopoverTrigger>
|
|
85
|
-
|
|
86
|
-
<PopoverContent>
|
|
87
|
-
Are you sure you want to have that milkshake?
|
|
88
|
-
</PopoverContent>
|
|
89
|
-
</Popover>
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
export const NoHeader = NoHeaderTemplate.bind({});
|
|
93
|
-
|
|
94
|
-
NoHeader.argTypes = {
|
|
95
|
-
...disableArgs(['variant', 'placement']),
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const NoCloseButtonTemplate = props => (
|
|
99
|
-
<Popover defaultIsOpen {...props}>
|
|
100
|
-
<PopoverTrigger>
|
|
101
|
-
<Button>Trigger</Button>
|
|
102
|
-
</PopoverTrigger>
|
|
103
|
-
|
|
104
|
-
<PopoverContent hideCloseButton header="Confirmation!">
|
|
105
|
-
Are you sure you want to have that milkshake?
|
|
106
|
-
</PopoverContent>
|
|
107
|
-
</Popover>
|
|
108
|
-
);
|
|
109
|
-
|
|
110
|
-
export const NoCloseButton = NoCloseButtonTemplate.bind({});
|
|
111
|
-
NoCloseButton.argTypes = {
|
|
112
|
-
...disableArgs(['variant', 'placement']),
|
|
113
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react';
|
|
2
|
-
import {PopoverArrow as ChakraPopoverArrow} from '@chakra-ui/react';
|
|
3
|
-
|
|
4
|
-
import styles from './styles/popover-arrow';
|
|
5
|
-
|
|
6
|
-
const PopoverArrow = forwardRef((props, ref) => {
|
|
7
|
-
return <ChakraPopoverArrow ref={ref} {...props} {...styles(props)} />;
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export default PopoverArrow;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react';
|
|
2
|
-
import {PopoverCloseButton as ChakraPopoverCloseButton} from '@chakra-ui/react';
|
|
3
|
-
|
|
4
|
-
import styles from './styles/popover-close-button';
|
|
5
|
-
|
|
6
|
-
const PopoverCloseButton = forwardRef((props, ref) => {
|
|
7
|
-
return <ChakraPopoverCloseButton ref={ref} {...props} {...styles(props)} />;
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
export default PopoverCloseButton;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
4
|
-
PopoverBody,
|
|
5
|
-
PopoverHeader,
|
|
6
|
-
PopoverContent as ChakraPopoverContent,
|
|
7
|
-
} from '@chakra-ui/react';
|
|
8
|
-
|
|
9
|
-
import PopoverArrow from './PopoverArrow';
|
|
10
|
-
import PopoverCloseButton from './PopoverCloseButton';
|
|
11
|
-
|
|
12
|
-
const PopoverContent = forwardRef((props, ref) => {
|
|
13
|
-
const {header, variant, children, hideCloseButton, ...rest} = props;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<ChakraPopoverContent {...rest} ref={ref}>
|
|
17
|
-
<PopoverArrow variant={variant} />
|
|
18
|
-
{hideCloseButton ? null : <PopoverCloseButton variant={variant} />}
|
|
19
|
-
{header ? <PopoverHeader>{header}</PopoverHeader> : null}
|
|
20
|
-
<PopoverBody>{children}</PopoverBody>
|
|
21
|
-
</ChakraPopoverContent>
|
|
22
|
-
);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
PopoverContent.propTypes = {
|
|
26
|
-
/** React children */
|
|
27
|
-
children: PropTypes.node,
|
|
28
|
-
/** Whether or not to hide the close button */
|
|
29
|
-
hideCloseButton: PropTypes.bool,
|
|
30
|
-
/** Styles the Popover */
|
|
31
|
-
variant: PropTypes.oneOf(['light', 'dark']),
|
|
32
|
-
/** The string or node for the header (optional) */
|
|
33
|
-
header: PropTypes.oneOfType([PropTypes.node, PropTypes.string]),
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
PopoverContent.defaultProps = {
|
|
37
|
-
variant: 'light',
|
|
38
|
-
hideCloseButton: false,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export default PopoverContent;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import merge from 'lodash/merge';
|
|
2
|
-
import chakraDefaultTheme from '@chakra-ui/theme';
|
|
3
|
-
|
|
4
|
-
import popper from './popper';
|
|
5
|
-
import body from './popover-body';
|
|
6
|
-
import header from './popover-header';
|
|
7
|
-
import content from './popover-content';
|
|
8
|
-
|
|
9
|
-
const parts = ['popper', 'content', 'header', 'body'];
|
|
10
|
-
|
|
11
|
-
const baseStyle = props => ({
|
|
12
|
-
header,
|
|
13
|
-
content: content(props),
|
|
14
|
-
body: body(props),
|
|
15
|
-
popper,
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export default merge(chakraDefaultTheme.components.Popover, {
|
|
19
|
-
parts,
|
|
20
|
-
baseStyle,
|
|
21
|
-
});
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const pseudoStyles = variant => ({
|
|
2
|
-
bgColor: variant === 'dark' ? 'gray.600' : 'gray.50',
|
|
3
|
-
});
|
|
4
|
-
|
|
5
|
-
const closeButtonStyles = ({variant}) => ({
|
|
6
|
-
color: variant === 'dark' ? 'white' : 'black',
|
|
7
|
-
fontSize: '0.5rem',
|
|
8
|
-
position: 'absolute',
|
|
9
|
-
top: 0,
|
|
10
|
-
right: 0,
|
|
11
|
-
padding: 4,
|
|
12
|
-
borderTopRightRadius: 4,
|
|
13
|
-
_hover: pseudoStyles(variant),
|
|
14
|
-
_focus: pseudoStyles(variant),
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
export default closeButtonStyles;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
const popoverContentStyles = ({variant}) => ({
|
|
2
|
-
padding: 4,
|
|
3
|
-
marginBottom: 0,
|
|
4
|
-
maxWidth: '20rem',
|
|
5
|
-
borderRadius: 'base',
|
|
6
|
-
background: variant === 'dark' ? 'secondary.default' : 'white',
|
|
7
|
-
boxShadow: '2px 2px 4px 0 rgba(0,45,91,0.1)',
|
|
8
|
-
color: variant === 'dark' ? 'white' : 'black',
|
|
9
|
-
borderColor: 'gray.100',
|
|
10
|
-
borderWidth: '1px',
|
|
11
|
-
borderStyle: 'solid',
|
|
12
|
-
'--popper-arrow-shadow-color': t => t.colors.gray['100'],
|
|
13
|
-
zIndex: 'layer10',
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export default popoverContentStyles;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import {Box, Radio as ChakraRadio} from '@chakra-ui/react';
|
|
4
|
-
|
|
5
|
-
const Radio = forwardRef(
|
|
6
|
-
(
|
|
7
|
-
{
|
|
8
|
-
defaultChecked,
|
|
9
|
-
isChecked,
|
|
10
|
-
isDisabled,
|
|
11
|
-
value,
|
|
12
|
-
helperText,
|
|
13
|
-
children,
|
|
14
|
-
...props
|
|
15
|
-
},
|
|
16
|
-
ref
|
|
17
|
-
) => {
|
|
18
|
-
return (
|
|
19
|
-
<ChakraRadio
|
|
20
|
-
ref={ref}
|
|
21
|
-
defaultChecked={defaultChecked}
|
|
22
|
-
isChecked={isChecked}
|
|
23
|
-
isDisabled={isDisabled}
|
|
24
|
-
isFocusable={!isDisabled}
|
|
25
|
-
value={value}
|
|
26
|
-
alignItems="start"
|
|
27
|
-
{...props}
|
|
28
|
-
>
|
|
29
|
-
{children}
|
|
30
|
-
{helperText && (
|
|
31
|
-
<Box color="gray.600" fontSize="xs">
|
|
32
|
-
{helperText}
|
|
33
|
-
</Box>
|
|
34
|
-
)}
|
|
35
|
-
</ChakraRadio>
|
|
36
|
-
);
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
Radio.propTypes = {
|
|
41
|
-
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
42
|
-
.isRequired,
|
|
43
|
-
defaultChecked: PropTypes.bool,
|
|
44
|
-
isChecked: PropTypes.bool,
|
|
45
|
-
isDisabled: PropTypes.bool,
|
|
46
|
-
value: PropTypes.string.isRequired,
|
|
47
|
-
helperText: PropTypes.string,
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export default Radio;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import Radio from './Radio';
|
|
4
|
-
import RadioGroup from './RadioGroup';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'v2/Radio',
|
|
8
|
-
component: Radio,
|
|
9
|
-
parameters: {
|
|
10
|
-
importBy: 'Radio',
|
|
11
|
-
removeBaseHtmlClass: true,
|
|
12
|
-
chakraLink: 'https://chakra-ui.com/docs/components/radio',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export const Individual = props => {
|
|
17
|
-
return (
|
|
18
|
-
<Radio value="1" {...props}>
|
|
19
|
-
Option 1
|
|
20
|
-
</Radio>
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
Individual.argTypes = {
|
|
25
|
-
helperText: {
|
|
26
|
-
control: {type: 'text'},
|
|
27
|
-
},
|
|
28
|
-
isDisabled: {
|
|
29
|
-
control: {
|
|
30
|
-
type: 'boolean',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
isChecked: {
|
|
34
|
-
control: {
|
|
35
|
-
type: 'boolean',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
children: {
|
|
39
|
-
table: {
|
|
40
|
-
disable: true,
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
defaultChecked: {
|
|
44
|
-
table: {
|
|
45
|
-
disable: true,
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
value: {
|
|
49
|
-
table: {
|
|
50
|
-
disable: true,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
Individual.args = {
|
|
56
|
-
helperText: 'Helper text',
|
|
57
|
-
isDisabled: false,
|
|
58
|
-
isChecked: false,
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
Individual.propTypes = {
|
|
62
|
-
children: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
|
|
63
|
-
.isRequired,
|
|
64
|
-
defaultChecked: PropTypes.bool,
|
|
65
|
-
isChecked: PropTypes.bool,
|
|
66
|
-
isDisabled: PropTypes.bool,
|
|
67
|
-
value: PropTypes.string.isRequired,
|
|
68
|
-
helperText: PropTypes.string,
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
export const Group = props => {
|
|
72
|
-
return (
|
|
73
|
-
<RadioGroup
|
|
74
|
-
name="example1"
|
|
75
|
-
defaultValue="3"
|
|
76
|
-
id="example1"
|
|
77
|
-
label="Which option?"
|
|
78
|
-
{...props}
|
|
79
|
-
>
|
|
80
|
-
<Radio value="1">Option 1</Radio>
|
|
81
|
-
<Radio value="2">Option 2</Radio>
|
|
82
|
-
<Radio value="3">Option 3</Radio>
|
|
83
|
-
<Radio value="4">Option 4</Radio>
|
|
84
|
-
</RadioGroup>
|
|
85
|
-
);
|
|
86
|
-
};
|
|
87
|
-
|
|
88
|
-
Group.title = 'v2/RadioGroup';
|
|
89
|
-
Group.component = RadioGroup;
|
|
90
|
-
Group.parameters = {
|
|
91
|
-
importBy: 'RadioGroup',
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
Group.argTypes = {
|
|
95
|
-
direction: {
|
|
96
|
-
options: ['column', 'row'],
|
|
97
|
-
control: {
|
|
98
|
-
type: 'radio',
|
|
99
|
-
},
|
|
100
|
-
},
|
|
101
|
-
isDisabled: {
|
|
102
|
-
control: {
|
|
103
|
-
type: 'boolean',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
children: {
|
|
107
|
-
table: {
|
|
108
|
-
disable: true,
|
|
109
|
-
},
|
|
110
|
-
},
|
|
111
|
-
defaultChecked: {
|
|
112
|
-
table: {
|
|
113
|
-
disable: true,
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
value: {
|
|
117
|
-
table: {
|
|
118
|
-
disable: true,
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
isChecked: {
|
|
122
|
-
table: {
|
|
123
|
-
disable: true,
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
helperText: {
|
|
127
|
-
table: {
|
|
128
|
-
disable: true,
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
Group.args = {
|
|
134
|
-
direction: 'column',
|
|
135
|
-
isDisabled: false,
|
|
136
|
-
isInvalid: false,
|
|
137
|
-
isRequired: false,
|
|
138
|
-
label: 'Label',
|
|
139
|
-
errorMessage: 'Error message',
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
Group.propTypes = {
|
|
143
|
-
children: PropTypes.node,
|
|
144
|
-
defaultValue: PropTypes.string,
|
|
145
|
-
id: PropTypes.string.isRequired,
|
|
146
|
-
label: PropTypes.string,
|
|
147
|
-
errorMessage: PropTypes.string,
|
|
148
|
-
isDisabled: PropTypes.bool,
|
|
149
|
-
isInvalid: PropTypes.bool,
|
|
150
|
-
isRequired: PropTypes.bool,
|
|
151
|
-
name: PropTypes.string,
|
|
152
|
-
onChange: PropTypes.func,
|
|
153
|
-
value: PropTypes.string,
|
|
154
|
-
direction: PropTypes.oneOf(['row', 'column']),
|
|
155
|
-
};
|