@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.
- package/.eslintignore +0 -1
- package/babel.config.js +1 -0
- package/jest.config.json +3 -0
- package/package.json +7 -6
- package/v2/index.js +1 -1
- package/v2/index.js.map +1 -1
- package/styles/components/Accordion/Accordion.jsx +0 -1
- package/styles/components/Accordion/Accordion.stories.js +0 -103
- package/styles/components/Accordion/index.js +0 -7
- package/styles/components/Accordion/styles/button.js +0 -16
- package/styles/components/Accordion/styles/container.js +0 -9
- package/styles/components/Accordion/styles/index.js +0 -19
- package/styles/components/Accordion/styles/panel.js +0 -7
- package/styles/components/Alert/Alert.jsx +0 -121
- package/styles/components/Alert/Alert.stories.js +0 -50
- package/styles/components/Alert/index.js +0 -1
- package/styles/components/Alert/styles/index.js +0 -166
- package/styles/components/AutoSuggestSelect/AutoSuggestSelect.jsx +0 -194
- package/styles/components/AutoSuggestSelect/index.js +0 -1
- package/styles/components/Badge/Badge.jsx +0 -1
- package/styles/components/Badge/Badge.stories.js +0 -32
- package/styles/components/Badge/styles/index.js +0 -29
- package/styles/components/Button/Button.jsx +0 -31
- package/styles/components/Button/Button.spec.js +0 -29
- package/styles/components/Button/Button.styles.js +0 -156
- package/styles/components/Button/button-props.js +0 -66
- package/styles/components/Button/index.js +0 -2
- package/styles/components/Button/stories/button.js +0 -59
- package/styles/components/Button/stories/index.stories.js +0 -82
- package/styles/components/Button/stories/overview.js +0 -73
- package/styles/components/Card/Card.jsx +0 -16
- package/styles/components/Card/Card.stories.js +0 -33
- package/styles/components/Checkbox/Checkbox.jsx +0 -1
- package/styles/components/Checkbox/Checkbox.stories.js +0 -41
- package/styles/components/Checkbox/index.js +0 -1
- package/styles/components/Checkbox/styles/index.js +0 -31
- package/styles/components/Container/Container.jsx +0 -10
- package/styles/components/Container/Container.stories.js +0 -52
- package/styles/components/Container/Container.styles.js +0 -11
- package/styles/components/Divider/Divider.jsx +0 -31
- package/styles/components/Divider/Divider.stories.js +0 -41
- package/styles/components/Divider/Divider.styles.js +0 -15
- package/styles/components/FormControl/FormControl.jsx +0 -79
- package/styles/components/Grid/Grid.jsx +0 -25
- package/styles/components/Grid/Grid.stories.js +0 -128
- package/styles/components/Grid/Grid.styles.js +0 -12
- package/styles/components/Grid/GridItem.jsx +0 -10
- package/styles/components/Grid/GridItem.styles.js +0 -8
- package/styles/components/Grid/index.js +0 -2
- package/styles/components/Heading/Heading.jsx +0 -23
- package/styles/components/Heading/Heading.stories.js +0 -40
- package/styles/components/Heading/Heading.styles.js +0 -61
- package/styles/components/Icon/Icon.jsx +0 -1
- package/styles/components/Icon/Icon.stories.js +0 -38
- package/styles/components/Image/Image.jsx +0 -118
- package/styles/components/Image/Image.spec.js +0 -100
- package/styles/components/Image/Image.stories.js +0 -142
- package/styles/components/Input/Input.jsx +0 -51
- package/styles/components/Input/Input.stories.js +0 -60
- package/styles/components/Input/index.js +0 -1
- package/styles/components/Input/styles/index.js +0 -49
- package/styles/components/Link/Link.jsx +0 -1
- package/styles/components/Link/Link.stories.js +0 -82
- package/styles/components/Link/Link.styles.js +0 -38
- package/styles/components/List/List.jsx +0 -57
- package/styles/components/List/List.stories.js +0 -96
- package/styles/components/List/index.js +0 -2
- package/styles/components/List/styles/index.js +0 -12
- package/styles/components/List/styles/item.styles.js +0 -5
- package/styles/components/Loader/Loader.jsx +0 -75
- package/styles/components/Loader/Loader.stories.js +0 -145
- package/styles/components/Modal/Modal.jsx +0 -70
- package/styles/components/Modal/Modal.stories.js +0 -278
- package/styles/components/Modal/index.js +0 -1
- package/styles/components/Modal/styles/body.js +0 -24
- package/styles/components/Modal/styles/closeButton.js +0 -17
- package/styles/components/Modal/styles/dialog.js +0 -10
- package/styles/components/Modal/styles/dialogContainer.js +0 -10
- package/styles/components/Modal/styles/footer.js +0 -5
- package/styles/components/Modal/styles/header.js +0 -7
- package/styles/components/Modal/styles/index.js +0 -47
- package/styles/components/Modal/styles/overlay.js +0 -4
- package/styles/components/Popover/Popover.jsx +0 -28
- package/styles/components/Popover/Popover.stories.js +0 -113
- package/styles/components/Popover/PopoverArrow.jsx +0 -10
- package/styles/components/Popover/PopoverCloseButton.jsx +0 -10
- package/styles/components/Popover/PopoverContent.jsx +0 -41
- package/styles/components/Popover/index.js +0 -3
- package/styles/components/Popover/styles/index.js +0 -21
- package/styles/components/Popover/styles/popover-arrow.js +0 -5
- package/styles/components/Popover/styles/popover-body.js +0 -5
- package/styles/components/Popover/styles/popover-close-button.js +0 -17
- package/styles/components/Popover/styles/popover-content.js +0 -16
- package/styles/components/Popover/styles/popover-header.js +0 -6
- package/styles/components/Popover/styles/popper.js +0 -5
- package/styles/components/Radio/Radio.jsx +0 -50
- package/styles/components/Radio/Radio.stories.js +0 -155
- package/styles/components/Radio/RadioGroup.jsx +0 -69
- package/styles/components/Radio/index.js +0 -2
- package/styles/components/Radio/styles/index.js +0 -52
- package/styles/components/Select/Select.jsx +0 -62
- package/styles/components/Select/Select.stories.js +0 -60
- package/styles/components/Select/index.js +0 -1
- package/styles/components/Select/styles/index.js +0 -29
- package/styles/components/Skeleton/Skeleton.stories.jsx +0 -34
- package/styles/components/Skeleton/Skeleton.styles.js +0 -3
- package/styles/components/Skeleton/index.js +0 -1
- package/styles/components/Spinner/Spinner.jsx +0 -40
- package/styles/components/Spinner/Spinner.stories.js +0 -98
- package/styles/components/Spinner/Spinner.styles.js +0 -57
- package/styles/components/Switch/Switch.jsx +0 -52
- package/styles/components/Switch/Switch.stories.js +0 -88
- package/styles/components/Switch/index.js +0 -1
- package/styles/components/Switch/styles/index.js +0 -17
- package/styles/components/Table/Table.jsx +0 -1
- package/styles/components/Table/Table.stories.js +0 -90
- package/styles/components/Table/Table.styles.js +0 -66
- package/styles/components/Table/index.js +0 -2
- package/styles/components/Tabs/Tabs.jsx +0 -38
- package/styles/components/Tabs/Tabs.stories.js +0 -47
- package/styles/components/Tabs/combineSizeWithVariant.js +0 -31
- package/styles/components/Tabs/index.js +0 -2
- package/styles/components/Tabs/styles/index.js +0 -40
- package/styles/components/Text/Text.jsx +0 -35
- package/styles/components/Text/Text.stories.js +0 -47
- package/styles/components/Text/Text.styles.js +0 -33
- package/styles/components/Text/combineAsWithVariant.js +0 -106
- package/styles/components/Text/options.js +0 -92
- package/styles/components/ThemeProvider/ThemeProvider.jsx +0 -39
- package/styles/components/ThemeProvider/ThemeProvider.stories.js +0 -85
- package/styles/theme/base/breakpoints.js +0 -16
- package/styles/theme/base/colors.js +0 -136
- package/styles/theme/base/index.js +0 -5
- package/styles/theme/base/sizes.js +0 -48
- package/styles/theme/base/typography.js +0 -24
- package/styles/theme/base/zindices.js +0 -17
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import Component from './Text';
|
|
5
|
-
|
|
6
|
-
import asOptions from './options';
|
|
7
|
-
import {variants} from './Text.styles';
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
title: 'v2/Text',
|
|
11
|
-
component: Component,
|
|
12
|
-
parameters: {
|
|
13
|
-
removeBaseHtmlClass: true,
|
|
14
|
-
},
|
|
15
|
-
argTypes: {
|
|
16
|
-
variant: {
|
|
17
|
-
control: {
|
|
18
|
-
type: 'select',
|
|
19
|
-
options: Object.keys(variants),
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
as: {
|
|
23
|
-
control: {
|
|
24
|
-
type: 'select',
|
|
25
|
-
options: asOptions,
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
children: {
|
|
29
|
-
control: {
|
|
30
|
-
type: 'text',
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
const Template = props => <Component {...props} />;
|
|
37
|
-
|
|
38
|
-
Template.propTypes = {
|
|
39
|
-
children: PropTypes.node,
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Text = Template.bind({});
|
|
43
|
-
|
|
44
|
-
Text.args = {
|
|
45
|
-
children:
|
|
46
|
-
'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.',
|
|
47
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import merge from 'lodash/merge';
|
|
2
|
-
import chakraDefaultTheme from '@chakra-ui/theme';
|
|
3
|
-
import {fontSizes, fontWeights} from 'theme/base/typography';
|
|
4
|
-
|
|
5
|
-
const baseStyle = {
|
|
6
|
-
lineHeight: 1.5,
|
|
7
|
-
fontWeight: fontWeights.normal,
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export const variants = {
|
|
11
|
-
body: {
|
|
12
|
-
...baseStyle,
|
|
13
|
-
fontSize: {base: fontSizes.base, desktop: fontSizes.base},
|
|
14
|
-
},
|
|
15
|
-
body2: {
|
|
16
|
-
...baseStyle,
|
|
17
|
-
fontSize: {base: fontSizes.sm, desktop: fontSizes.sm},
|
|
18
|
-
},
|
|
19
|
-
caption: {
|
|
20
|
-
...baseStyle,
|
|
21
|
-
fontSize: {base: fontSizes.xs, desktop: fontSizes.xs},
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const defaultProps = {
|
|
26
|
-
variant: variants.body,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export default merge(chakraDefaultTheme.components.Text, {
|
|
30
|
-
variants,
|
|
31
|
-
baseStyle,
|
|
32
|
-
defaultProps,
|
|
33
|
-
});
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import {variants} from './Text.styles';
|
|
2
|
-
import {fontWeights} from 'theme/base/typography';
|
|
3
|
-
|
|
4
|
-
// Create list of commonly used html text elements
|
|
5
|
-
const asOptions = Object.freeze({
|
|
6
|
-
bold: 'b',
|
|
7
|
-
strong: 'strong',
|
|
8
|
-
italic: 'i',
|
|
9
|
-
emphasis: 'em',
|
|
10
|
-
small: 'small',
|
|
11
|
-
strikethrough: 's',
|
|
12
|
-
underline: 'u',
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* ### `combineAsWithVariant`
|
|
17
|
-
* A function that takes in the `as` value (the HTML element to render the Text component as), and the
|
|
18
|
-
* `variant` value. The default-like styling for the `as` prop is merged with the styling from the
|
|
19
|
-
* `variant` and a combined styleProp object is returned.
|
|
20
|
-
*
|
|
21
|
-
* By default the `as` property only effects the underlying semantics of the markup, whereas the
|
|
22
|
-
* `variant` only effects the visual styling of the text. In order for the text component to be built
|
|
23
|
-
* with accessibility and ease-of-use in mind, these two properties _should_ be interconnected. Having
|
|
24
|
-
* the style and markup unified allows an experience that is accessible to those using screen-readers
|
|
25
|
-
* (or any other assistive technology) that matches (or is at least a close approximation) of the
|
|
26
|
-
* "standard" visual experience.
|
|
27
|
-
*
|
|
28
|
-
* @function combineAsWithVariant
|
|
29
|
-
* @param {string} args.as - The HTML element to render the Text component as
|
|
30
|
-
* @param {string} args.variant - The style variant for the Text component
|
|
31
|
-
* @returns {Object} An object containing the merged styleProps from the `variant` and the `as` props
|
|
32
|
-
*/
|
|
33
|
-
|
|
34
|
-
const combineAsWithVariant = ({as, variant}) => {
|
|
35
|
-
const variantFontSizeBase = Number(
|
|
36
|
-
variants[`${variant}`].fontSize.base.replace('rem', '')
|
|
37
|
-
);
|
|
38
|
-
const variantFontSizeDesktop = Number(
|
|
39
|
-
variants[`${variant}`].fontSize.desktop.replace('rem', '')
|
|
40
|
-
);
|
|
41
|
-
let styleProps;
|
|
42
|
-
|
|
43
|
-
switch (as) {
|
|
44
|
-
case asOptions.bold:
|
|
45
|
-
styleProps = {
|
|
46
|
-
...variants[`${variant}`],
|
|
47
|
-
fontWeight: fontWeights.semibold,
|
|
48
|
-
};
|
|
49
|
-
break;
|
|
50
|
-
|
|
51
|
-
case asOptions.strong:
|
|
52
|
-
styleProps = {
|
|
53
|
-
...variants[`${variant}`],
|
|
54
|
-
fontWeight: fontWeights.semibold,
|
|
55
|
-
};
|
|
56
|
-
break;
|
|
57
|
-
|
|
58
|
-
case asOptions.italic:
|
|
59
|
-
styleProps = {
|
|
60
|
-
...variants[`${variant}`],
|
|
61
|
-
fontStyle: 'italic',
|
|
62
|
-
};
|
|
63
|
-
break;
|
|
64
|
-
|
|
65
|
-
case asOptions.emphasis:
|
|
66
|
-
styleProps = {
|
|
67
|
-
...variants[`${variant}`],
|
|
68
|
-
fontStyle: 'italic',
|
|
69
|
-
};
|
|
70
|
-
break;
|
|
71
|
-
|
|
72
|
-
case asOptions.underline:
|
|
73
|
-
styleProps = {
|
|
74
|
-
...variants[`${variant}`],
|
|
75
|
-
textDecoration: 'underline',
|
|
76
|
-
};
|
|
77
|
-
break;
|
|
78
|
-
|
|
79
|
-
case asOptions.strikethrough:
|
|
80
|
-
styleProps = {
|
|
81
|
-
...variants[`${variant}`],
|
|
82
|
-
textDecoration: 'line-through',
|
|
83
|
-
};
|
|
84
|
-
break;
|
|
85
|
-
|
|
86
|
-
case asOptions.small:
|
|
87
|
-
styleProps = {
|
|
88
|
-
...variants[`${variant}`],
|
|
89
|
-
fontSize: {
|
|
90
|
-
base: `${variantFontSizeBase * 0.8}rem`,
|
|
91
|
-
desktop: `${variantFontSizeDesktop * 0.8}rem`,
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
break;
|
|
95
|
-
|
|
96
|
-
default:
|
|
97
|
-
styleProps = {
|
|
98
|
-
...variants[`${variant}`],
|
|
99
|
-
};
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
return styleProps;
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
export default combineAsWithVariant;
|
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
const options = [
|
|
2
|
-
'a',
|
|
3
|
-
'abbr',
|
|
4
|
-
'address',
|
|
5
|
-
'article',
|
|
6
|
-
'aside',
|
|
7
|
-
'b',
|
|
8
|
-
'bdi',
|
|
9
|
-
'bdo',
|
|
10
|
-
'blockquote',
|
|
11
|
-
'button',
|
|
12
|
-
'caption',
|
|
13
|
-
'cite',
|
|
14
|
-
'code',
|
|
15
|
-
'colgroup',
|
|
16
|
-
'data',
|
|
17
|
-
'datalist',
|
|
18
|
-
'dd',
|
|
19
|
-
'del',
|
|
20
|
-
'details',
|
|
21
|
-
'dfn',
|
|
22
|
-
'dialog',
|
|
23
|
-
'div',
|
|
24
|
-
'dl',
|
|
25
|
-
'dt',
|
|
26
|
-
'em',
|
|
27
|
-
'fieldset',
|
|
28
|
-
'figure',
|
|
29
|
-
'footer',
|
|
30
|
-
'form',
|
|
31
|
-
'header',
|
|
32
|
-
'hgroup',
|
|
33
|
-
'i',
|
|
34
|
-
'input',
|
|
35
|
-
'ins',
|
|
36
|
-
'kbd',
|
|
37
|
-
'label',
|
|
38
|
-
'legend',
|
|
39
|
-
'li',
|
|
40
|
-
'link',
|
|
41
|
-
'main',
|
|
42
|
-
'map',
|
|
43
|
-
'mark',
|
|
44
|
-
'menu',
|
|
45
|
-
'meter',
|
|
46
|
-
'nav',
|
|
47
|
-
'noscript',
|
|
48
|
-
'object',
|
|
49
|
-
'ol',
|
|
50
|
-
'optgroup',
|
|
51
|
-
'option',
|
|
52
|
-
'output',
|
|
53
|
-
'p',
|
|
54
|
-
'pre',
|
|
55
|
-
'progress',
|
|
56
|
-
'q',
|
|
57
|
-
'rb',
|
|
58
|
-
'rp',
|
|
59
|
-
'rt',
|
|
60
|
-
'rtc',
|
|
61
|
-
'ruby',
|
|
62
|
-
's',
|
|
63
|
-
'samp',
|
|
64
|
-
'script',
|
|
65
|
-
'section',
|
|
66
|
-
'select',
|
|
67
|
-
'small',
|
|
68
|
-
'span',
|
|
69
|
-
'strong',
|
|
70
|
-
'style',
|
|
71
|
-
'sub',
|
|
72
|
-
'summary',
|
|
73
|
-
'sup',
|
|
74
|
-
'table',
|
|
75
|
-
'tbody',
|
|
76
|
-
'td',
|
|
77
|
-
'template',
|
|
78
|
-
'textarea',
|
|
79
|
-
'tfoot',
|
|
80
|
-
'th',
|
|
81
|
-
'thead',
|
|
82
|
-
'time',
|
|
83
|
-
'title',
|
|
84
|
-
'tr',
|
|
85
|
-
'track',
|
|
86
|
-
'u',
|
|
87
|
-
'ul',
|
|
88
|
-
'var',
|
|
89
|
-
'video',
|
|
90
|
-
];
|
|
91
|
-
|
|
92
|
-
export default options;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
import React, {forwardRef} from 'react';
|
|
3
|
-
import {ChakraProvider} from '@chakra-ui/react';
|
|
4
|
-
|
|
5
|
-
import THEME from 'theme';
|
|
6
|
-
import {Fonts, LegacyOverrides} from 'theme/global';
|
|
7
|
-
import merge from 'lodash/merge';
|
|
8
|
-
|
|
9
|
-
const ThemeProvider = forwardRef(
|
|
10
|
-
(
|
|
11
|
-
{
|
|
12
|
-
theme,
|
|
13
|
-
useLegacyOverrides,
|
|
14
|
-
disableExternalFonts = false,
|
|
15
|
-
children,
|
|
16
|
-
...props
|
|
17
|
-
},
|
|
18
|
-
ref
|
|
19
|
-
) => (
|
|
20
|
-
<ChakraProvider {...props} ref={ref} theme={merge(THEME, theme)}>
|
|
21
|
-
{disableExternalFonts ? null : <Fonts />}
|
|
22
|
-
<LegacyOverrides useLegacyOverrides={useLegacyOverrides} />
|
|
23
|
-
{children}
|
|
24
|
-
</ChakraProvider>
|
|
25
|
-
)
|
|
26
|
-
);
|
|
27
|
-
|
|
28
|
-
ThemeProvider.propTypes = {
|
|
29
|
-
/** If true, this will use the old `spothero-html` base styles */
|
|
30
|
-
useLegacyOverrides: PropTypes.bool,
|
|
31
|
-
/** If true, this will not load the `Fonts` global styles */
|
|
32
|
-
disableExternalFonts: PropTypes.bool,
|
|
33
|
-
/** The React node (generally your entire App) that will be provided the theme */
|
|
34
|
-
children: PropTypes.node,
|
|
35
|
-
/** Adds additional themeing on top of SpotHero's default configuration */
|
|
36
|
-
theme: PropTypes.object,
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export default ThemeProvider;
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {Box, Code} from '@chakra-ui/react';
|
|
3
|
-
|
|
4
|
-
import Component from './ThemeProvider';
|
|
5
|
-
import Spaces from 'utils/Spaces';
|
|
6
|
-
import Text from 'components/Text/Text';
|
|
7
|
-
import disableArgs from 'storybook/utils/disable-args';
|
|
8
|
-
|
|
9
|
-
const Usage = () => {
|
|
10
|
-
return (
|
|
11
|
-
<>
|
|
12
|
-
// RootComponent.jsx
|
|
13
|
-
<br />
|
|
14
|
-
...
|
|
15
|
-
<br />
|
|
16
|
-
return (
|
|
17
|
-
<br />
|
|
18
|
-
<Spaces />
|
|
19
|
-
<ThemeProvider>
|
|
20
|
-
<br />
|
|
21
|
-
<Spaces spaces={6} />
|
|
22
|
-
<App/>
|
|
23
|
-
<br />
|
|
24
|
-
<Spaces />
|
|
25
|
-
</ThemeProvider>
|
|
26
|
-
<br />
|
|
27
|
-
);
|
|
28
|
-
<br />
|
|
29
|
-
...
|
|
30
|
-
</>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export default {
|
|
35
|
-
title: 'v2/ThemeProvider',
|
|
36
|
-
component: Component,
|
|
37
|
-
parameters: {
|
|
38
|
-
removeBaseHtmlClass: true,
|
|
39
|
-
usage: [<Usage key={1} />],
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const Template = (props, {hasDarkBackground}) => {
|
|
44
|
-
const contentTextColor = hasDarkBackground
|
|
45
|
-
? 'text.primary.dark'
|
|
46
|
-
: 'text.primary.light';
|
|
47
|
-
|
|
48
|
-
return (
|
|
49
|
-
<Box>
|
|
50
|
-
<Text mb={8} color={contentTextColor}>
|
|
51
|
-
As the name implies, this is a theme context provider that all
|
|
52
|
-
of your v2 components utilize. It is required by all apps moving
|
|
53
|
-
to v2
|
|
54
|
-
</Text>
|
|
55
|
-
<Text />
|
|
56
|
-
<Text mb={8} color={contentTextColor}>
|
|
57
|
-
ThemeProvider has a <Code>theme</Code> prop that takes a theme
|
|
58
|
-
object. Unlike how we are both overriding and extending
|
|
59
|
-
Chakra's default theme, this property only extends our
|
|
60
|
-
default theme configuration.
|
|
61
|
-
</Text>{' '}
|
|
62
|
-
<Text mb={8} color={contentTextColor}>
|
|
63
|
-
ThemeProvider has a <Code>useLegacyOverrides</Code> prop that is
|
|
64
|
-
a boolean. If true, the ThemeProvider will insert the typography
|
|
65
|
-
styling from .spothero-html
|
|
66
|
-
</Text>{' '}
|
|
67
|
-
<Text mb={8} color={contentTextColor}>
|
|
68
|
-
ThemeProvider also has a <Code>disableExternalFonts</Code> prop
|
|
69
|
-
that is a boolean. If true, the ThemeProvider will not load the
|
|
70
|
-
font files from Google's CDN, and you will be able to handle
|
|
71
|
-
fonts on a project-level.
|
|
72
|
-
</Text>{' '}
|
|
73
|
-
</Box>
|
|
74
|
-
);
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const ThemeProvider = Template.bind({});
|
|
78
|
-
ThemeProvider.parameters = {
|
|
79
|
-
importBy: 'ThemeProvider',
|
|
80
|
-
};
|
|
81
|
-
ThemeProvider.argTypes = disableArgs([
|
|
82
|
-
'theme',
|
|
83
|
-
'children',
|
|
84
|
-
'useLegacyOverrides',
|
|
85
|
-
]);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {createBreakpoints} from '@chakra-ui/theme-tools';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* The "base" breakpoint is Chakra's default non-responsive value (from 0 upwards).
|
|
5
|
-
* While we don't explicitly enable a "mobile" breakpoint, we can consider "base" and
|
|
6
|
-
* "mobile" the same for all intents and purposes for mobile-first responsive styling.
|
|
7
|
-
* @see https://chakra-ui.com/docs/features/responsive-styles#customizing-breakpoints
|
|
8
|
-
*/
|
|
9
|
-
const breakpoints = createBreakpoints({
|
|
10
|
-
mobileXL: '30rem', // 480px
|
|
11
|
-
tablet: '48rem', // 768px
|
|
12
|
-
desktop: '64rem', // 1024px
|
|
13
|
-
desktopXL: '90rem', // 1440px
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export default breakpoints;
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
const white = '#ffffff';
|
|
2
|
-
const black = '#000000';
|
|
3
|
-
const brandBlue = '#0082ff';
|
|
4
|
-
|
|
5
|
-
const gray = {
|
|
6
|
-
50: '#f6f7f9',
|
|
7
|
-
100: '#e1e6ec',
|
|
8
|
-
200: '#cbd4de',
|
|
9
|
-
300: '#afbdcc',
|
|
10
|
-
400: '#94a7ba',
|
|
11
|
-
500: '#7890a8',
|
|
12
|
-
600: '#537495',
|
|
13
|
-
700: '#3b5261',
|
|
14
|
-
800: '#2f3f4b',
|
|
15
|
-
900: '#26323c',
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
const blue = {
|
|
19
|
-
50: '#f6fbfd',
|
|
20
|
-
100: '#e6f8fd',
|
|
21
|
-
200: '#c0e9fb',
|
|
22
|
-
300: '#96d3fa',
|
|
23
|
-
400: '#5baafa',
|
|
24
|
-
500: '#1271eb',
|
|
25
|
-
600: '#1d58f2',
|
|
26
|
-
700: '#1b46da',
|
|
27
|
-
800: '#1735a6',
|
|
28
|
-
900: '#132b7f',
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
const navy = {
|
|
32
|
-
50: '#f4fafc',
|
|
33
|
-
100: '#e4f7fb',
|
|
34
|
-
200: '#bfebf6',
|
|
35
|
-
300: '#92d9f4',
|
|
36
|
-
400: '#51b7f0',
|
|
37
|
-
500: '#2590ea',
|
|
38
|
-
600: '#1a6cda',
|
|
39
|
-
700: '#1b55b6',
|
|
40
|
-
800: '#194185',
|
|
41
|
-
900: '#002d5b',
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
const green = {
|
|
45
|
-
50: '#ecf8f7',
|
|
46
|
-
100: '#d3f7ef',
|
|
47
|
-
200: '#a4f3d9',
|
|
48
|
-
300: '#65eabf',
|
|
49
|
-
400: '#1edb96',
|
|
50
|
-
500: '#09c66a',
|
|
51
|
-
600: '#08ad50',
|
|
52
|
-
700: '#008547',
|
|
53
|
-
800: '#11703e',
|
|
54
|
-
900: '#115a35',
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const yellow = {
|
|
58
|
-
50: '#f9f5e5',
|
|
59
|
-
100: '#faf0bd',
|
|
60
|
-
200: '#f6e67c',
|
|
61
|
-
300: '#f1d439',
|
|
62
|
-
400: '#ffbf02',
|
|
63
|
-
500: '#e19706',
|
|
64
|
-
600: '#cf7404',
|
|
65
|
-
700: '#ae5708',
|
|
66
|
-
800: '#8e440e',
|
|
67
|
-
900: '#743710',
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const red = {
|
|
71
|
-
50: '#fdf9f8',
|
|
72
|
-
100: '#fdeef3',
|
|
73
|
-
200: '#fbcee6',
|
|
74
|
-
300: '#fba4d1',
|
|
75
|
-
400: '#fc6bad',
|
|
76
|
-
500: '#fc4086',
|
|
77
|
-
600: '#f7265f',
|
|
78
|
-
700: '#e01438',
|
|
79
|
-
800: '#b4193c',
|
|
80
|
-
900: '#901530',
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const colors = {
|
|
84
|
-
primary: {
|
|
85
|
-
...blue,
|
|
86
|
-
default: blue['500'],
|
|
87
|
-
},
|
|
88
|
-
secondary: {
|
|
89
|
-
...navy,
|
|
90
|
-
default: navy['900'],
|
|
91
|
-
},
|
|
92
|
-
gray: {
|
|
93
|
-
...gray,
|
|
94
|
-
light: gray['50'],
|
|
95
|
-
medium: gray['200'],
|
|
96
|
-
dark: gray['600'],
|
|
97
|
-
},
|
|
98
|
-
red: {
|
|
99
|
-
...red,
|
|
100
|
-
default: red['700'],
|
|
101
|
-
},
|
|
102
|
-
green: {
|
|
103
|
-
...green,
|
|
104
|
-
default: green['700'],
|
|
105
|
-
},
|
|
106
|
-
yellow: {
|
|
107
|
-
...yellow,
|
|
108
|
-
default: yellow['400'],
|
|
109
|
-
},
|
|
110
|
-
success: green['700'],
|
|
111
|
-
warning: yellow['400'],
|
|
112
|
-
error: red['700'],
|
|
113
|
-
accent: gray['200'],
|
|
114
|
-
text: {
|
|
115
|
-
primary: {
|
|
116
|
-
light: black,
|
|
117
|
-
dark: white,
|
|
118
|
-
},
|
|
119
|
-
secondary: {
|
|
120
|
-
light: gray['600'],
|
|
121
|
-
},
|
|
122
|
-
link: {
|
|
123
|
-
light: blue['500'],
|
|
124
|
-
dark: white,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
background: {
|
|
128
|
-
gray: gray['50'],
|
|
129
|
-
white,
|
|
130
|
-
},
|
|
131
|
-
white,
|
|
132
|
-
black,
|
|
133
|
-
brandBlue,
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
export default colors;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
const container = {
|
|
2
|
-
base: '100%', // 640px
|
|
3
|
-
tablet: '45rem', // 720px
|
|
4
|
-
desktop: '72rem', // 1152px
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
const sizes = {
|
|
8
|
-
container,
|
|
9
|
-
0: '0',
|
|
10
|
-
0.5: '0.125rem', // 2px
|
|
11
|
-
1: '0.25rem', // 4px
|
|
12
|
-
1.5: '0.375rem', // 6px
|
|
13
|
-
2: '0.5rem', // 8px
|
|
14
|
-
2.5: '0.625rem', // 10px
|
|
15
|
-
3: '0.75rem', // 12px
|
|
16
|
-
3.5: '0.875rem', // 14px
|
|
17
|
-
4: '1rem', // 16px
|
|
18
|
-
5: '1.25rem', // 20px
|
|
19
|
-
6: '1.5rem', // 24px
|
|
20
|
-
7: '1.75rem', // 28px
|
|
21
|
-
8: '2rem', // 32px
|
|
22
|
-
9: '2.25rem', // 36px
|
|
23
|
-
10: '2.5rem', // 40px
|
|
24
|
-
12: '3rem', // 48px
|
|
25
|
-
14: '3.5rem', // 56px
|
|
26
|
-
16: '4rem', // 64px
|
|
27
|
-
20: '5rem', // 80px
|
|
28
|
-
24: '6rem', // 96px
|
|
29
|
-
28: '7rem', // 112px
|
|
30
|
-
32: '8rem', // 128px
|
|
31
|
-
36: '9rem', // 144px
|
|
32
|
-
40: '10rem', // 160px
|
|
33
|
-
44: '11rem', // 176px
|
|
34
|
-
48: '12rem', // 192px
|
|
35
|
-
52: '13rem', // 208px
|
|
36
|
-
56: '14rem', // 224px
|
|
37
|
-
60: '15rem', // 240px
|
|
38
|
-
64: '16rem', // 256px
|
|
39
|
-
72: '18rem', // 272px
|
|
40
|
-
80: '20rem', // 288px
|
|
41
|
-
96: '24rem', // 384px
|
|
42
|
-
px: '1px',
|
|
43
|
-
full: '100%',
|
|
44
|
-
max: 'max-content',
|
|
45
|
-
min: 'min-content',
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export default sizes;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const fonts = {
|
|
2
|
-
heading: `"Open Sans", sans-serif`,
|
|
3
|
-
body: `"Open Sans", sans-serif`,
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
export const fontSizes = {
|
|
7
|
-
'5xl': '3.5rem', // 56px
|
|
8
|
-
'4xl': '3rem', // 48px
|
|
9
|
-
'3xl': '2.5rem', // 40px
|
|
10
|
-
'2xl': '2rem', // 32px
|
|
11
|
-
xl: '1.5rem', // 24px
|
|
12
|
-
lg: '1.25rem', // 20px
|
|
13
|
-
md: '1.125rem', // 18px
|
|
14
|
-
base: '1rem', // 16px
|
|
15
|
-
sm: '0.875rem', // 14px
|
|
16
|
-
xs: '0.75rem', // 12px
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const fontWeights = {
|
|
20
|
-
light: 300,
|
|
21
|
-
normal: 400,
|
|
22
|
-
semibold: 600,
|
|
23
|
-
bold: 700,
|
|
24
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
const indices = {
|
|
2
|
-
hide: -100, // equivalent to $z-index-negative in fe-core (https://github.com/spothero/fe-core/blob/main/utils/_defaults.scss)
|
|
3
|
-
auto: 'auto',
|
|
4
|
-
base: 0, // equivalent to $z-index-back in fe-core
|
|
5
|
-
layer1: 100, // equivalent to $z-index-mid in fe-core
|
|
6
|
-
layer2: 200, // equivalent to $z-index-fore in fe-core
|
|
7
|
-
layer3: 300, // equivalent to $z-index-layer1 in fe-core
|
|
8
|
-
layer4: 400, // equivalent to $z-index-layer2 in fe-core
|
|
9
|
-
layer5: 500, // equivalent to $z-index-layer3 in fe-core
|
|
10
|
-
layer6: 600, // equivalent to $z-index-layer4 in fe-core
|
|
11
|
-
layer7: 700, // equivalent to $z-index-modal-shim in fe-core
|
|
12
|
-
layer8: 800, // equivalent to $z-index-modal in fe-core
|
|
13
|
-
layer9: 900, // equivalent to $z-index-notification in fe-core
|
|
14
|
-
layer10: 1000, // equivalent to $z-index-top in fe-core
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export default indices;
|