@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 +0,0 @@
|
|
|
1
|
-
export {Badge as default} from '@chakra-ui/react';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import Component from './Badge';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'v2/Badge',
|
|
6
|
-
component: Component,
|
|
7
|
-
parameters: {
|
|
8
|
-
removeBaseHtmlClass: true,
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const Template = props => (
|
|
13
|
-
<>
|
|
14
|
-
<Component variant='primary'>
|
|
15
|
-
Primary
|
|
16
|
-
</Component>
|
|
17
|
-
<br/>
|
|
18
|
-
<Component variant='warningLight'>
|
|
19
|
-
Warning Light
|
|
20
|
-
</Component>
|
|
21
|
-
<br/>
|
|
22
|
-
<Component variant='solid' colorScheme='green'>
|
|
23
|
-
Success
|
|
24
|
-
</Component>
|
|
25
|
-
<br/>
|
|
26
|
-
<Component variant='subtle' colorScheme='red'>
|
|
27
|
-
Removed
|
|
28
|
-
</Component>
|
|
29
|
-
</>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
export const Badge = Template.bind({});
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import merge from 'lodash/merge';
|
|
2
|
-
import chakraDefaultTheme from '@chakra-ui/theme';
|
|
3
|
-
|
|
4
|
-
const baseStyle = {
|
|
5
|
-
px: 1,
|
|
6
|
-
textTransform: 'reset',
|
|
7
|
-
fontSize: 'xs',
|
|
8
|
-
borderRadius: 'sm',
|
|
9
|
-
fontWeight: 'bold',
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const variants = {
|
|
13
|
-
primary: {
|
|
14
|
-
bg: 'primary.default',
|
|
15
|
-
color: 'white',
|
|
16
|
-
},
|
|
17
|
-
warningLight: {
|
|
18
|
-
bg: 'yellow.100',
|
|
19
|
-
color: 'black',
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
const defaultProps = {};
|
|
24
|
-
|
|
25
|
-
export default merge(chakraDefaultTheme.components.Badge, {
|
|
26
|
-
variants,
|
|
27
|
-
baseStyle,
|
|
28
|
-
defaultProps,
|
|
29
|
-
});
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react';
|
|
2
|
-
import {Button as ChakraButton} from '@chakra-ui/react';
|
|
3
|
-
|
|
4
|
-
import ButtonProps from './button-props';
|
|
5
|
-
|
|
6
|
-
const anchorProps = (isExternal = false) => ({
|
|
7
|
-
as: 'a',
|
|
8
|
-
type: null,
|
|
9
|
-
...(isExternal && {
|
|
10
|
-
target: '_blank',
|
|
11
|
-
rel: 'noopener noreferrer',
|
|
12
|
-
}),
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
const Button = forwardRef(({asAnchor, isExternal, ...props}, ref) => (
|
|
16
|
-
<ChakraButton
|
|
17
|
-
iconSpacing={2}
|
|
18
|
-
{...props}
|
|
19
|
-
{...((asAnchor || props.as === 'a') && anchorProps(isExternal))}
|
|
20
|
-
ref={ref}
|
|
21
|
-
/>
|
|
22
|
-
));
|
|
23
|
-
|
|
24
|
-
Button.propTypes = ButtonProps;
|
|
25
|
-
|
|
26
|
-
Button.defaultProps = {
|
|
27
|
-
variant: 'primary',
|
|
28
|
-
type: 'button',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export default Button;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {render, screen} from '@testing-library/react';
|
|
3
|
-
|
|
4
|
-
import Button from './Button';
|
|
5
|
-
|
|
6
|
-
describe('Button', () => {
|
|
7
|
-
it('renders the anchor version of the button', () => {
|
|
8
|
-
render(
|
|
9
|
-
<Button asAnchor href="#">
|
|
10
|
-
Button
|
|
11
|
-
</Button>
|
|
12
|
-
);
|
|
13
|
-
|
|
14
|
-
expect(screen.getByRole('link')).toBeInTheDocument();
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it('renders with target and rel attributes on external anchor button', () => {
|
|
18
|
-
render(
|
|
19
|
-
<Button asAnchor isExternal href="#">
|
|
20
|
-
Button
|
|
21
|
-
</Button>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
const link = screen.getByRole('link');
|
|
25
|
-
|
|
26
|
-
expect(link).toHaveAttribute('target', '_blank');
|
|
27
|
-
expect(link).toHaveAttribute('rel', 'noopener noreferrer');
|
|
28
|
-
});
|
|
29
|
-
});
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import merge from 'lodash/merge';
|
|
2
|
-
import chakraDefaultTheme from '@chakra-ui/theme';
|
|
3
|
-
|
|
4
|
-
const baseStyle = {
|
|
5
|
-
px: 8,
|
|
6
|
-
py: 3,
|
|
7
|
-
fontSize: 'base',
|
|
8
|
-
fontFamily: 'body',
|
|
9
|
-
lineHeight: 0.875,
|
|
10
|
-
fontWeight: 'semibold',
|
|
11
|
-
borderWidth: '1px',
|
|
12
|
-
borderStyle: 'solid',
|
|
13
|
-
borderRadius: '1.25rem',
|
|
14
|
-
textTransform: 'capitalize',
|
|
15
|
-
transition: 'all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94)',
|
|
16
|
-
_disabled: {
|
|
17
|
-
cursor: 'not-allowed',
|
|
18
|
-
opacity: 1,
|
|
19
|
-
bg: 'gray.medium',
|
|
20
|
-
borderColor: 'gray.medium',
|
|
21
|
-
color: 'gray.dark',
|
|
22
|
-
},
|
|
23
|
-
'& svg': {
|
|
24
|
-
display: 'block',
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
// TODO: We need an active styling
|
|
28
|
-
const disabledButtonHoverStyle = {
|
|
29
|
-
_disabled: {
|
|
30
|
-
bg: 'gray.medium',
|
|
31
|
-
borderColor: 'gray.medium',
|
|
32
|
-
color: 'gray.dark',
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const destructiveButtonStyles = {
|
|
37
|
-
bg: 'white',
|
|
38
|
-
borderColor: 'red.default',
|
|
39
|
-
color: 'red.default',
|
|
40
|
-
_hover: {
|
|
41
|
-
borderColor: 'red.800',
|
|
42
|
-
color: 'red.800',
|
|
43
|
-
...disabledButtonHoverStyle,
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const variants = {
|
|
48
|
-
primary: {
|
|
49
|
-
bg: 'primary.default',
|
|
50
|
-
borderColor: 'primary.default',
|
|
51
|
-
color: 'white',
|
|
52
|
-
_hover: {
|
|
53
|
-
bg: 'primary.600',
|
|
54
|
-
borderColor: 'primary.600',
|
|
55
|
-
color: 'white',
|
|
56
|
-
...disabledButtonHoverStyle,
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
primaryOnDark: {
|
|
60
|
-
bg: 'yellow.default',
|
|
61
|
-
borderColor: 'yellow.default',
|
|
62
|
-
color: 'black',
|
|
63
|
-
_hover: {
|
|
64
|
-
bg: 'yellow.500',
|
|
65
|
-
borderColor: 'yellow.500',
|
|
66
|
-
color: 'black',
|
|
67
|
-
...disabledButtonHoverStyle,
|
|
68
|
-
},
|
|
69
|
-
_focus: {
|
|
70
|
-
boxShadow: '0 0 0 3px rgba(255, 255, 255, 0.7)',
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
secondary: {
|
|
74
|
-
bg: 'white',
|
|
75
|
-
borderColor: 'gray.medium',
|
|
76
|
-
color: 'primary.default',
|
|
77
|
-
_hover: {
|
|
78
|
-
borderColor: 'primary.600',
|
|
79
|
-
color: 'primary.600',
|
|
80
|
-
...disabledButtonHoverStyle,
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
secondaryOnDark: {
|
|
84
|
-
bg: 'none',
|
|
85
|
-
borderColor: 'white',
|
|
86
|
-
color: 'white',
|
|
87
|
-
_hover: {
|
|
88
|
-
bg: 'white',
|
|
89
|
-
borderColor: 'white',
|
|
90
|
-
color: 'black',
|
|
91
|
-
...disabledButtonHoverStyle,
|
|
92
|
-
},
|
|
93
|
-
_focus: {
|
|
94
|
-
boxShadow: '0 0 0 3px rgba(255, 255, 255, 0.7)',
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
tertiary: {
|
|
98
|
-
bg: 'none',
|
|
99
|
-
borderWidth: 'none',
|
|
100
|
-
borderRadius: 'unset',
|
|
101
|
-
color: 'primary.default',
|
|
102
|
-
h: 'unset',
|
|
103
|
-
m: 'unset',
|
|
104
|
-
minW: 'unset',
|
|
105
|
-
p: 'unset',
|
|
106
|
-
lineHeight: 1,
|
|
107
|
-
_disabled: {
|
|
108
|
-
bg: 'none',
|
|
109
|
-
color: 'gray.dark',
|
|
110
|
-
},
|
|
111
|
-
_hover: {
|
|
112
|
-
color: 'primary.600',
|
|
113
|
-
_disabled: {
|
|
114
|
-
color: 'gray.dark',
|
|
115
|
-
},
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
tertiaryOnDark: {
|
|
119
|
-
bg: 'none',
|
|
120
|
-
borderRadius: 'unset',
|
|
121
|
-
borderWidth: 'none',
|
|
122
|
-
color: 'white',
|
|
123
|
-
h: 'unset',
|
|
124
|
-
m: 'unset',
|
|
125
|
-
minW: 'unset',
|
|
126
|
-
p: 'unset',
|
|
127
|
-
_disabled: {
|
|
128
|
-
bg: 'none',
|
|
129
|
-
color: 'white',
|
|
130
|
-
opacity: '.7',
|
|
131
|
-
},
|
|
132
|
-
_hover: {
|
|
133
|
-
color: 'white',
|
|
134
|
-
opacity: '.8',
|
|
135
|
-
_disabled: {
|
|
136
|
-
opacity: '.7',
|
|
137
|
-
},
|
|
138
|
-
},
|
|
139
|
-
},
|
|
140
|
-
destructive: {
|
|
141
|
-
...destructiveButtonStyles,
|
|
142
|
-
},
|
|
143
|
-
destructiveOnDark: {
|
|
144
|
-
...destructiveButtonStyles,
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const defaultProps = {
|
|
149
|
-
size: null,
|
|
150
|
-
};
|
|
151
|
-
|
|
152
|
-
export default merge(chakraDefaultTheme.components.Button, {
|
|
153
|
-
variants,
|
|
154
|
-
baseStyle,
|
|
155
|
-
defaultProps,
|
|
156
|
-
});
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import {variants} from './Button.styles';
|
|
3
|
-
|
|
4
|
-
const props = {
|
|
5
|
-
/**
|
|
6
|
-
* Alters the underlying html tag
|
|
7
|
-
*/
|
|
8
|
-
as: PropTypes.string,
|
|
9
|
-
/**
|
|
10
|
-
* If `true`, the button will render as an anchor.
|
|
11
|
-
*/
|
|
12
|
-
asAnchor: PropTypes.bool,
|
|
13
|
-
/**
|
|
14
|
-
* If `true`, and an anchor button, target="_blank" and rel="noopener noreferrer" will be set on the anchor
|
|
15
|
-
* "isExternal" is used to maintain parity with the Link component.
|
|
16
|
-
*/
|
|
17
|
-
isExternal: PropTypes.bool,
|
|
18
|
-
/**
|
|
19
|
-
* If `true`, the button will show a spinner.
|
|
20
|
-
*/
|
|
21
|
-
isLoading: PropTypes.bool,
|
|
22
|
-
/**
|
|
23
|
-
* If `true`, the button will be styled in its active state.
|
|
24
|
-
*/
|
|
25
|
-
isActive: PropTypes.bool,
|
|
26
|
-
/**
|
|
27
|
-
* If `true`, the button will be disabled.
|
|
28
|
-
*/
|
|
29
|
-
isDisabled: PropTypes.bool,
|
|
30
|
-
/**
|
|
31
|
-
* The label to show in the button when `isLoading` is true
|
|
32
|
-
* If no text is passed, it only shows the spinner
|
|
33
|
-
*/
|
|
34
|
-
loadingText: PropTypes.string,
|
|
35
|
-
/**
|
|
36
|
-
* If `true`, the button will take up the full width of its container.
|
|
37
|
-
*/
|
|
38
|
-
isFullWidth: PropTypes.bool,
|
|
39
|
-
/**
|
|
40
|
-
* The html button type to use.
|
|
41
|
-
*/
|
|
42
|
-
type: PropTypes.oneOf(['button', 'reset', 'submit']),
|
|
43
|
-
/**
|
|
44
|
-
* If added, the button will show an icon before the button's label.
|
|
45
|
-
* @type PropTypes.node
|
|
46
|
-
*/
|
|
47
|
-
leftIcon: PropTypes.node,
|
|
48
|
-
/**
|
|
49
|
-
* If added, the button will show an icon after the button's label.
|
|
50
|
-
* @type PropTypes.node
|
|
51
|
-
*/
|
|
52
|
-
rightIcon: PropTypes.node,
|
|
53
|
-
/**
|
|
54
|
-
* The space between the button icon and label.
|
|
55
|
-
* @type SystemProps["marginRight"]
|
|
56
|
-
*/
|
|
57
|
-
iconSpacing: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
58
|
-
/**
|
|
59
|
-
* Replace the spinner component when `isLoading` is set to `true`
|
|
60
|
-
* @type PropTypes.node
|
|
61
|
-
*/
|
|
62
|
-
spinner: PropTypes.node,
|
|
63
|
-
variant: PropTypes.oneOf(Object.keys(variants)),
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
export default props;
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import capitalize from 'lodash/capitalize';
|
|
3
|
-
import {Box, Text} from '@chakra-ui/react';
|
|
4
|
-
import IconCheck from '@spothero/icons/check';
|
|
5
|
-
|
|
6
|
-
import Component from '../Button';
|
|
7
|
-
import ButtonProps from 'v2/components/Button/button-props';
|
|
8
|
-
|
|
9
|
-
const ButtonTemplate = (props, {hasDarkBackground}) => {
|
|
10
|
-
const variant = `${props.variant}${hasDarkBackground ? 'OnDark' : ''}`;
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<Box>
|
|
14
|
-
<Box mb={4}>
|
|
15
|
-
<Text
|
|
16
|
-
mb="2"
|
|
17
|
-
color={
|
|
18
|
-
hasDarkBackground
|
|
19
|
-
? 'text.primary.dark'
|
|
20
|
-
: 'text.primary.light'
|
|
21
|
-
}
|
|
22
|
-
>
|
|
23
|
-
{capitalize(props.variant)}:
|
|
24
|
-
</Text>
|
|
25
|
-
<Box>
|
|
26
|
-
<Component {...props} variant={variant} mr={4} mb={4}>
|
|
27
|
-
{props.variant} Variant
|
|
28
|
-
</Component>
|
|
29
|
-
|
|
30
|
-
<Component
|
|
31
|
-
leftIcon={<IconCheck width="1rem" />}
|
|
32
|
-
{...props}
|
|
33
|
-
variant={variant}
|
|
34
|
-
mr={4}
|
|
35
|
-
mb={4}
|
|
36
|
-
>
|
|
37
|
-
{props.variant} With Icon
|
|
38
|
-
</Component>
|
|
39
|
-
|
|
40
|
-
<Component
|
|
41
|
-
{...props}
|
|
42
|
-
variant={variant}
|
|
43
|
-
as="a"
|
|
44
|
-
href="http://spothero.com"
|
|
45
|
-
isExternal={false}
|
|
46
|
-
mr={4}
|
|
47
|
-
mb={4}
|
|
48
|
-
>
|
|
49
|
-
As Anchor
|
|
50
|
-
</Component>
|
|
51
|
-
</Box>
|
|
52
|
-
</Box>
|
|
53
|
-
</Box>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
ButtonTemplate.propTypes = ButtonProps;
|
|
58
|
-
|
|
59
|
-
export default ButtonTemplate;
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import ButtonTemplate from './button';
|
|
2
|
-
import OverviewTemplate from './overview';
|
|
3
|
-
|
|
4
|
-
import Button from '../Button';
|
|
5
|
-
import disableArgs from 'storybook/utils/disable-args';
|
|
6
|
-
import {createSelectControl} from 'storybook/utils/create-control';
|
|
7
|
-
|
|
8
|
-
export default {
|
|
9
|
-
title: 'v2/Button',
|
|
10
|
-
component: {Button},
|
|
11
|
-
parameters: {
|
|
12
|
-
importBy: 'Button',
|
|
13
|
-
removeBaseHtmlClass: true,
|
|
14
|
-
chakraLink: 'https://chakra-ui.com/docs/form/button',
|
|
15
|
-
},
|
|
16
|
-
argTypes: {
|
|
17
|
-
...disableArgs('children'),
|
|
18
|
-
onClick: {action: 'clicked'},
|
|
19
|
-
},
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const Overview = OverviewTemplate.bind({});
|
|
23
|
-
|
|
24
|
-
export const Primary = ButtonTemplate.bind({});
|
|
25
|
-
Primary.argTypes = {
|
|
26
|
-
...createSelectControl('type', ['button', 'reset', 'submit']),
|
|
27
|
-
...disableArgs('variant'),
|
|
28
|
-
onClick: {action: 'clicked'},
|
|
29
|
-
};
|
|
30
|
-
Primary.args = {
|
|
31
|
-
children: 'Primary',
|
|
32
|
-
variant: 'primary',
|
|
33
|
-
isDisabled: false,
|
|
34
|
-
isLoading: false,
|
|
35
|
-
loadingText: 'Loading',
|
|
36
|
-
isFullWidth: false,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Secondary = ButtonTemplate.bind({});
|
|
40
|
-
Secondary.argTypes = {
|
|
41
|
-
...createSelectControl('type', ['button', 'reset', 'submit']),
|
|
42
|
-
...disableArgs('variant'),
|
|
43
|
-
onClick: {action: 'clicked'},
|
|
44
|
-
};
|
|
45
|
-
Secondary.args = {
|
|
46
|
-
children: 'Secondary',
|
|
47
|
-
variant: 'secondary',
|
|
48
|
-
isDisabled: false,
|
|
49
|
-
isLoading: false,
|
|
50
|
-
loadingText: 'Loading',
|
|
51
|
-
isFullWidth: false,
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Tertiary = ButtonTemplate.bind({});
|
|
55
|
-
Tertiary.argTypes = {
|
|
56
|
-
...createSelectControl('type', ['button', 'reset', 'submit']),
|
|
57
|
-
...disableArgs('variant'),
|
|
58
|
-
onClick: {action: 'clicked'},
|
|
59
|
-
};
|
|
60
|
-
Tertiary.args = {
|
|
61
|
-
children: 'tertiary',
|
|
62
|
-
variant: 'tertiary',
|
|
63
|
-
isDisabled: false,
|
|
64
|
-
isLoading: false,
|
|
65
|
-
loadingText: 'Loading',
|
|
66
|
-
isFullWidth: false,
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Destructive = ButtonTemplate.bind({});
|
|
70
|
-
Destructive.argTypes = {
|
|
71
|
-
...createSelectControl('type', ['button', 'reset', 'submit']),
|
|
72
|
-
...disableArgs('variant'),
|
|
73
|
-
onClick: {action: 'clicked'},
|
|
74
|
-
};
|
|
75
|
-
Destructive.args = {
|
|
76
|
-
children: 'destructive',
|
|
77
|
-
variant: 'destructive',
|
|
78
|
-
isDisabled: false,
|
|
79
|
-
isLoading: false,
|
|
80
|
-
loadingText: 'Loading',
|
|
81
|
-
isFullWidth: false,
|
|
82
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import capitalize from 'lodash/capitalize';
|
|
3
|
-
import {Box} from '@chakra-ui/react';
|
|
4
|
-
|
|
5
|
-
import IconCheck from '@spothero/icons/check';
|
|
6
|
-
|
|
7
|
-
import Component from '../Button';
|
|
8
|
-
import {variants} from '../Button.styles';
|
|
9
|
-
import Text from 'v2/components/Text/Text';
|
|
10
|
-
|
|
11
|
-
const variationsArray = ({baseVariantName, hasDarkBackground}) => {
|
|
12
|
-
const variant = `${baseVariantName}${hasDarkBackground ? 'OnDark' : ''}`;
|
|
13
|
-
|
|
14
|
-
return [
|
|
15
|
-
{
|
|
16
|
-
variant,
|
|
17
|
-
children: variant,
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
variant,
|
|
21
|
-
children: `${variant} isDisabled`,
|
|
22
|
-
isDisabled: true,
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
variant,
|
|
26
|
-
children: `${variant} isLoading`,
|
|
27
|
-
isLoading: true,
|
|
28
|
-
loadingText: 'loading (optional)',
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
variant,
|
|
32
|
-
children: `leftIcon`,
|
|
33
|
-
leftIcon: <IconCheck width="1rem" />,
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
variant,
|
|
37
|
-
children: `${variant} asAnchor`,
|
|
38
|
-
asAnchor: true,
|
|
39
|
-
href: '#',
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const OverviewTemplate = (args, {hasDarkBackground}) => (
|
|
45
|
-
<Box>
|
|
46
|
-
{Object.keys(variants)
|
|
47
|
-
.filter(name => !/ondark/i.test(name))
|
|
48
|
-
.map((baseVariantName, index) => (
|
|
49
|
-
<Box key={index} mb={4}>
|
|
50
|
-
<Text
|
|
51
|
-
mb="2"
|
|
52
|
-
color={
|
|
53
|
-
hasDarkBackground
|
|
54
|
-
? 'text.primary.dark'
|
|
55
|
-
: 'text.primary.light'
|
|
56
|
-
}
|
|
57
|
-
>
|
|
58
|
-
{capitalize(baseVariantName)}:
|
|
59
|
-
</Text>
|
|
60
|
-
<Box>
|
|
61
|
-
{variationsArray({
|
|
62
|
-
baseVariantName,
|
|
63
|
-
hasDarkBackground,
|
|
64
|
-
}).map((props, key) => (
|
|
65
|
-
<Component key={key} {...props} mr={4} mb={4} />
|
|
66
|
-
))}
|
|
67
|
-
</Box>
|
|
68
|
-
</Box>
|
|
69
|
-
))}
|
|
70
|
-
</Box>
|
|
71
|
-
);
|
|
72
|
-
|
|
73
|
-
export default OverviewTemplate;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React, {forwardRef} from 'react';
|
|
2
|
-
import {Box} from '@chakra-ui/react';
|
|
3
|
-
|
|
4
|
-
const Card = forwardRef((props, ref) => (
|
|
5
|
-
<Box
|
|
6
|
-
position="relative"
|
|
7
|
-
padding={4}
|
|
8
|
-
bgColor="background.white"
|
|
9
|
-
borderRadius="lg"
|
|
10
|
-
boxShadow="md"
|
|
11
|
-
{...props}
|
|
12
|
-
ref={ref}
|
|
13
|
-
/>
|
|
14
|
-
));
|
|
15
|
-
|
|
16
|
-
export default Card;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import {Box} from '@chakra-ui/react';
|
|
4
|
-
import Component from './Card';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'v2/Card',
|
|
8
|
-
component: Component,
|
|
9
|
-
parameters: {
|
|
10
|
-
removeBaseHtmlClass: true,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
/*
|
|
15
|
-
Storybook's background is white so the Card is hard to see.
|
|
16
|
-
The Card is typically displayed against a light gray background.
|
|
17
|
-
*/
|
|
18
|
-
const Template = props => (
|
|
19
|
-
<Box backgroundColor="gray.light" padding={8}>
|
|
20
|
-
<Component {...props} />
|
|
21
|
-
</Box>
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
Template.propTypes = {
|
|
25
|
-
children: PropTypes.node,
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export const Card = Template.bind({});
|
|
29
|
-
|
|
30
|
-
Card.args = {
|
|
31
|
-
children:
|
|
32
|
-
'Bonbon lollipop tiramisu cupcake bear claw cupcake. Icing candy canes cookie caramels wafer tootsie roll soufflé halvah. Ice cream tart gummies apple pie chocolate bar. Pastry gummies macaroon fruitcake donut sweet caramels candy. Oat cake marshmallow biscuit carrot cake fruitcake brownie pastry liquorice liquorice. Topping sweet gingerbread. Chupa chups caramels brownie. Icing jujubes chupa chups cookie. Carrot cake gummi bears powder apple pie donut pudding macaroon. Icing jelly cupcake powder jelly croissant pastry. Powder jelly fruitcake gummies sweet tootsie roll candy. Icing cheesecake toffee tart pastry lemon drops lemon drops bonbon wafer. Cheesecake ice cream wafer apple pie candy canes croissant. Sweet croissant pudding carrot cake oat cake chupa chups. Gingerbread lemon drops biscuit oat cake carrot cake. Chocolate cake jelly-o cake cake candy lollipop.',
|
|
33
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {Checkbox as default} from '@chakra-ui/react';
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import Component from './Checkbox';
|
|
5
|
-
|
|
6
|
-
export default {
|
|
7
|
-
title: 'v2/Checkbox',
|
|
8
|
-
component: Component,
|
|
9
|
-
parameters: {
|
|
10
|
-
removeBaseHtmlClass: true,
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
const CheckboxTemplate = props => <Component {...props} />;
|
|
15
|
-
|
|
16
|
-
CheckboxTemplate.propTypes = {
|
|
17
|
-
isChecked: PropTypes.bool,
|
|
18
|
-
isDisabled: PropTypes.bool,
|
|
19
|
-
isIndeterminate: PropTypes.bool,
|
|
20
|
-
defaultIsChecked: PropTypes.bool,
|
|
21
|
-
size: PropTypes.oneOf(['sm', 'md', 'lg']),
|
|
22
|
-
children: PropTypes.node,
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const Checkbox = CheckboxTemplate.bind({});
|
|
26
|
-
|
|
27
|
-
Checkbox.argTypes = {
|
|
28
|
-
size: {
|
|
29
|
-
options: ['sm', 'md', 'lg'],
|
|
30
|
-
control: {type: 'select'},
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
Checkbox.args = {
|
|
35
|
-
defaultIsChecked: true,
|
|
36
|
-
isChecked: true,
|
|
37
|
-
isDisabled: false,
|
|
38
|
-
isIndeterminate: false,
|
|
39
|
-
size: 'md',
|
|
40
|
-
children: 'R U Cool',
|
|
41
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {default} from './Checkbox';
|