@spothero/ui 16.0.0-beta.0 → 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.
Files changed (136) hide show
  1. package/.eslintignore +0 -1
  2. package/babel.config.js +1 -0
  3. package/jest.config.json +3 -0
  4. package/package.json +7 -6
  5. package/v2/index.js +1 -1
  6. package/v2/index.js.map +1 -1
  7. package/styles/components/Accordion/Accordion.jsx +0 -1
  8. package/styles/components/Accordion/Accordion.stories.js +0 -103
  9. package/styles/components/Accordion/index.js +0 -7
  10. package/styles/components/Accordion/styles/button.js +0 -16
  11. package/styles/components/Accordion/styles/container.js +0 -9
  12. package/styles/components/Accordion/styles/index.js +0 -19
  13. package/styles/components/Accordion/styles/panel.js +0 -7
  14. package/styles/components/Alert/Alert.jsx +0 -121
  15. package/styles/components/Alert/Alert.stories.js +0 -50
  16. package/styles/components/Alert/index.js +0 -1
  17. package/styles/components/Alert/styles/index.js +0 -166
  18. package/styles/components/AutoSuggestSelect/AutoSuggestSelect.jsx +0 -194
  19. package/styles/components/AutoSuggestSelect/index.js +0 -1
  20. package/styles/components/Badge/Badge.jsx +0 -1
  21. package/styles/components/Badge/Badge.stories.js +0 -32
  22. package/styles/components/Badge/styles/index.js +0 -29
  23. package/styles/components/Button/Button.jsx +0 -31
  24. package/styles/components/Button/Button.spec.js +0 -29
  25. package/styles/components/Button/Button.styles.js +0 -156
  26. package/styles/components/Button/button-props.js +0 -66
  27. package/styles/components/Button/index.js +0 -2
  28. package/styles/components/Button/stories/button.js +0 -59
  29. package/styles/components/Button/stories/index.stories.js +0 -82
  30. package/styles/components/Button/stories/overview.js +0 -73
  31. package/styles/components/Card/Card.jsx +0 -16
  32. package/styles/components/Card/Card.stories.js +0 -33
  33. package/styles/components/Checkbox/Checkbox.jsx +0 -1
  34. package/styles/components/Checkbox/Checkbox.stories.js +0 -41
  35. package/styles/components/Checkbox/index.js +0 -1
  36. package/styles/components/Checkbox/styles/index.js +0 -31
  37. package/styles/components/Container/Container.jsx +0 -10
  38. package/styles/components/Container/Container.stories.js +0 -52
  39. package/styles/components/Container/Container.styles.js +0 -11
  40. package/styles/components/Divider/Divider.jsx +0 -31
  41. package/styles/components/Divider/Divider.stories.js +0 -41
  42. package/styles/components/Divider/Divider.styles.js +0 -15
  43. package/styles/components/FormControl/FormControl.jsx +0 -79
  44. package/styles/components/Grid/Grid.jsx +0 -25
  45. package/styles/components/Grid/Grid.stories.js +0 -128
  46. package/styles/components/Grid/Grid.styles.js +0 -12
  47. package/styles/components/Grid/GridItem.jsx +0 -10
  48. package/styles/components/Grid/GridItem.styles.js +0 -8
  49. package/styles/components/Grid/index.js +0 -2
  50. package/styles/components/Heading/Heading.jsx +0 -23
  51. package/styles/components/Heading/Heading.stories.js +0 -40
  52. package/styles/components/Heading/Heading.styles.js +0 -61
  53. package/styles/components/Icon/Icon.jsx +0 -1
  54. package/styles/components/Icon/Icon.stories.js +0 -38
  55. package/styles/components/Image/Image.jsx +0 -118
  56. package/styles/components/Image/Image.spec.js +0 -100
  57. package/styles/components/Image/Image.stories.js +0 -142
  58. package/styles/components/Input/Input.jsx +0 -51
  59. package/styles/components/Input/Input.stories.js +0 -60
  60. package/styles/components/Input/index.js +0 -1
  61. package/styles/components/Input/styles/index.js +0 -49
  62. package/styles/components/Link/Link.jsx +0 -1
  63. package/styles/components/Link/Link.stories.js +0 -82
  64. package/styles/components/Link/Link.styles.js +0 -38
  65. package/styles/components/List/List.jsx +0 -57
  66. package/styles/components/List/List.stories.js +0 -96
  67. package/styles/components/List/index.js +0 -2
  68. package/styles/components/List/styles/index.js +0 -12
  69. package/styles/components/List/styles/item.styles.js +0 -5
  70. package/styles/components/Loader/Loader.jsx +0 -75
  71. package/styles/components/Loader/Loader.stories.js +0 -145
  72. package/styles/components/Modal/Modal.jsx +0 -70
  73. package/styles/components/Modal/Modal.stories.js +0 -278
  74. package/styles/components/Modal/index.js +0 -1
  75. package/styles/components/Modal/styles/body.js +0 -24
  76. package/styles/components/Modal/styles/closeButton.js +0 -17
  77. package/styles/components/Modal/styles/dialog.js +0 -10
  78. package/styles/components/Modal/styles/dialogContainer.js +0 -10
  79. package/styles/components/Modal/styles/footer.js +0 -5
  80. package/styles/components/Modal/styles/header.js +0 -7
  81. package/styles/components/Modal/styles/index.js +0 -47
  82. package/styles/components/Modal/styles/overlay.js +0 -4
  83. package/styles/components/Popover/Popover.jsx +0 -28
  84. package/styles/components/Popover/Popover.stories.js +0 -113
  85. package/styles/components/Popover/PopoverArrow.jsx +0 -10
  86. package/styles/components/Popover/PopoverCloseButton.jsx +0 -10
  87. package/styles/components/Popover/PopoverContent.jsx +0 -41
  88. package/styles/components/Popover/index.js +0 -3
  89. package/styles/components/Popover/styles/index.js +0 -21
  90. package/styles/components/Popover/styles/popover-arrow.js +0 -5
  91. package/styles/components/Popover/styles/popover-body.js +0 -5
  92. package/styles/components/Popover/styles/popover-close-button.js +0 -17
  93. package/styles/components/Popover/styles/popover-content.js +0 -16
  94. package/styles/components/Popover/styles/popover-header.js +0 -6
  95. package/styles/components/Popover/styles/popper.js +0 -5
  96. package/styles/components/Radio/Radio.jsx +0 -50
  97. package/styles/components/Radio/Radio.stories.js +0 -155
  98. package/styles/components/Radio/RadioGroup.jsx +0 -69
  99. package/styles/components/Radio/index.js +0 -2
  100. package/styles/components/Radio/styles/index.js +0 -52
  101. package/styles/components/Select/Select.jsx +0 -62
  102. package/styles/components/Select/Select.stories.js +0 -60
  103. package/styles/components/Select/index.js +0 -1
  104. package/styles/components/Select/styles/index.js +0 -29
  105. package/styles/components/Skeleton/Skeleton.stories.jsx +0 -34
  106. package/styles/components/Skeleton/Skeleton.styles.js +0 -3
  107. package/styles/components/Skeleton/index.js +0 -1
  108. package/styles/components/Spinner/Spinner.jsx +0 -40
  109. package/styles/components/Spinner/Spinner.stories.js +0 -98
  110. package/styles/components/Spinner/Spinner.styles.js +0 -57
  111. package/styles/components/Switch/Switch.jsx +0 -52
  112. package/styles/components/Switch/Switch.stories.js +0 -88
  113. package/styles/components/Switch/index.js +0 -1
  114. package/styles/components/Switch/styles/index.js +0 -17
  115. package/styles/components/Table/Table.jsx +0 -1
  116. package/styles/components/Table/Table.stories.js +0 -90
  117. package/styles/components/Table/Table.styles.js +0 -66
  118. package/styles/components/Table/index.js +0 -2
  119. package/styles/components/Tabs/Tabs.jsx +0 -38
  120. package/styles/components/Tabs/Tabs.stories.js +0 -47
  121. package/styles/components/Tabs/combineSizeWithVariant.js +0 -31
  122. package/styles/components/Tabs/index.js +0 -2
  123. package/styles/components/Tabs/styles/index.js +0 -40
  124. package/styles/components/Text/Text.jsx +0 -35
  125. package/styles/components/Text/Text.stories.js +0 -47
  126. package/styles/components/Text/Text.styles.js +0 -33
  127. package/styles/components/Text/combineAsWithVariant.js +0 -106
  128. package/styles/components/Text/options.js +0 -92
  129. package/styles/components/ThemeProvider/ThemeProvider.jsx +0 -39
  130. package/styles/components/ThemeProvider/ThemeProvider.stories.js +0 -85
  131. package/styles/theme/base/breakpoints.js +0 -16
  132. package/styles/theme/base/colors.js +0 -136
  133. package/styles/theme/base/index.js +0 -5
  134. package/styles/theme/base/sizes.js +0 -48
  135. package/styles/theme/base/typography.js +0 -24
  136. package/styles/theme/base/zindices.js +0 -17
@@ -1 +0,0 @@
1
- export {Accordion as default} from '@chakra-ui/react';
@@ -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 'components/Text/Text';
6
- import Heading from '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,7 +0,0 @@
1
- export {default} from './Accordion';
2
- export {
3
- AccordionIcon,
4
- AccordionItem,
5
- AccordionPanel,
6
- AccordionButton,
7
- } from '@chakra-ui/react';
@@ -1,16 +0,0 @@
1
- import {variants as headingVariants} from '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,9 +0,0 @@
1
- const container = {
2
- borderTopWidth: '1px',
3
- borderColor: 'gray.medium',
4
- _last: {
5
- borderBottomWidth: '1px',
6
- },
7
- };
8
-
9
- export default container;
@@ -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,7 +0,0 @@
1
- const panel = {
2
- pt: 0,
3
- px: 0,
4
- pb: 6,
5
- };
6
-
7
- export default panel;
@@ -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 'components/Button/Button';
16
- import Icon from '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};