grommet 2.34.0 → 2.35.0-alpha.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/components/Anchor/StyledAnchor.js +1 -7
- package/components/Box/StyledBox.js +2 -2
- package/components/Button/BusyAnimation.js +2 -1
- package/components/Button/StyledButton.js +2 -1
- package/components/Button/StyledButtonKind.js +4 -4
- package/components/Calendar/StyledCalendar.js +6 -6
- package/components/Chart/StyledChart.js +1 -1
- package/components/CheckBox/CheckBox.js +0 -3
- package/components/CheckBox/StyledCheckBox.js +11 -10
- package/components/Clock/StyledClock.js +7 -7
- package/components/DataTable/StyledDataTable.js +1 -1
- package/components/DataTable/stories/CustomThemed/Custom.js +1 -1
- package/components/Diagram/StyledDiagram.js +2 -1
- package/components/Drop/DropContainer.js +0 -2
- package/components/Drop/StyledDrop.js +2 -1
- package/components/FileInput/StyledFileInput.js +1 -1
- package/components/Grid/StyledGrid.js +1 -1
- package/components/Grommet/StyledGrommet.js +1 -1
- package/components/Heading/StyledHeading.js +1 -1
- package/components/Image/StyledImage.js +1 -1
- package/components/Layer/LayerContainer.js +1 -1
- package/components/Layer/StyledLayer.js +6 -6
- package/components/List/List.js +1 -1
- package/components/Markdown/stories/Override.js +2 -1
- package/components/MaskedInput/StyledMaskedInput.js +3 -3
- package/components/Menu/Menu.js +1 -1
- package/components/Meter/StyledMeter.js +1 -1
- package/components/Pagination/StyledPageControl.js +2 -1
- package/components/Paragraph/StyledParagraph.js +1 -1
- package/components/RadioButton/RadioButton.js +0 -3
- package/components/RadioButton/StyledRadioButton.js +8 -7
- package/components/RangeInput/RangeInput.js +1 -1
- package/components/RangeInput/StyledRangeInput.js +1 -1
- package/components/Select/SelectContainer.js +0 -1
- package/components/Select/StyledSelect.js +4 -3
- package/components/SelectMultiple/SelectMultipleContainer.js +0 -1
- package/components/Skeleton/StyledSkeleton.js +1 -1
- package/components/Stack/StyledStack.js +2 -2
- package/components/Tab/StyledTab.js +2 -1
- package/components/Tab/Tab.js +0 -2
- package/components/Table/StyledTable.js +7 -7
- package/components/Tabs/StyledTabs.js +4 -3
- package/components/Tabs/Tabs.js +0 -2
- package/components/Text/StyledText.js +1 -5
- package/components/TextArea/StyledTextArea.js +1 -1
- package/components/TextInput/StyledTextInput.js +5 -5
- package/components/Video/StyledVideo.js +4 -4
- package/components/WorldMap/StyledWorldMap.js +1 -1
- package/es6/components/Anchor/StyledAnchor.js +2 -8
- package/es6/components/Box/StyledBox.js +3 -3
- package/es6/components/Button/BusyAnimation.js +2 -1
- package/es6/components/Button/StyledButton.js +2 -1
- package/es6/components/Button/StyledButtonKind.js +3 -4
- package/es6/components/Calendar/StyledCalendar.js +7 -7
- package/es6/components/Chart/StyledChart.js +2 -2
- package/es6/components/CheckBox/CheckBox.js +0 -3
- package/es6/components/CheckBox/StyledCheckBox.js +12 -11
- package/es6/components/Clock/StyledClock.js +8 -8
- package/es6/components/DataTable/StyledDataTable.js +2 -2
- package/es6/components/DataTable/stories/CustomThemed/Custom.js +1 -1
- package/es6/components/Diagram/StyledDiagram.js +2 -1
- package/es6/components/Drop/DropContainer.js +0 -2
- package/es6/components/Drop/StyledDrop.js +2 -1
- package/es6/components/FileInput/StyledFileInput.js +2 -2
- package/es6/components/Grid/StyledGrid.js +2 -2
- package/es6/components/Grommet/StyledGrommet.js +2 -2
- package/es6/components/Heading/StyledHeading.js +2 -2
- package/es6/components/Image/StyledImage.js +2 -2
- package/es6/components/Layer/LayerContainer.js +2 -2
- package/es6/components/Layer/StyledLayer.js +6 -7
- package/es6/components/List/List.js +2 -2
- package/es6/components/Markdown/stories/Override.js +2 -1
- package/es6/components/MaskedInput/StyledMaskedInput.js +4 -4
- package/es6/components/Menu/Menu.js +1 -1
- package/es6/components/Meter/StyledMeter.js +2 -2
- package/es6/components/Pagination/StyledPageControl.js +2 -1
- package/es6/components/Paragraph/StyledParagraph.js +2 -2
- package/es6/components/RadioButton/RadioButton.js +0 -3
- package/es6/components/RadioButton/StyledRadioButton.js +9 -8
- package/es6/components/RangeInput/RangeInput.js +1 -1
- package/es6/components/RangeInput/StyledRangeInput.js +2 -2
- package/es6/components/Select/SelectContainer.js +0 -1
- package/es6/components/Select/StyledSelect.js +5 -4
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +0 -1
- package/es6/components/Skeleton/StyledSkeleton.js +2 -2
- package/es6/components/Stack/StyledStack.js +3 -3
- package/es6/components/Tab/StyledTab.js +2 -1
- package/es6/components/Tab/Tab.js +0 -2
- package/es6/components/Table/StyledTable.js +8 -8
- package/es6/components/Tabs/StyledTabs.js +5 -4
- package/es6/components/Tabs/Tabs.js +0 -2
- package/es6/components/Text/StyledText.js +2 -6
- package/es6/components/TextArea/StyledTextArea.js +2 -2
- package/es6/components/TextInput/StyledTextInput.js +6 -6
- package/es6/components/Video/StyledVideo.js +5 -5
- package/es6/components/WorldMap/StyledWorldMap.js +2 -2
- package/es6/utils/styles.js +6 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +8 -4
- package/utils/styles.js +7 -1
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { focusStyle, normalizeColor } from '../../utils';
|
|
2
|
+
import { focusStyle, normalizeColor, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
|
+
import { Box } from '../Box';
|
|
4
5
|
var disabledStyle = "\n opacity: 0.5;\n cursor: default;\n";
|
|
5
|
-
var StyledRadioButtonContainer = styled.label.withConfig({
|
|
6
|
+
var StyledRadioButtonContainer = styled.label.withConfig(styledComponentsConfig).withConfig({
|
|
6
7
|
displayName: "StyledRadioButton__StyledRadioButtonContainer",
|
|
7
8
|
componentId: "sc-g1f6ld-0"
|
|
8
|
-
})(["display:flex;flex-direction:row;align-items:center;user-select:none;width:fit-content;", " ", "
|
|
9
|
+
})(["display:flex;flex-direction:row;align-items:center;user-select:none;width:fit-content;", " ", " &:hover input:not([disabled]) + div,&:hover input:not([disabled]) + span{border-color:", ";}&:hover{background-color:", ";}", " ", ";"], function (props) {
|
|
9
10
|
return props.disabled && disabledStyle;
|
|
10
11
|
}, function (props) {
|
|
11
12
|
return !props.disabled && 'cursor: pointer;';
|
|
@@ -20,7 +21,7 @@ var StyledRadioButtonContainer = styled.label.withConfig({
|
|
|
20
21
|
});
|
|
21
22
|
StyledRadioButtonContainer.defaultProps = {};
|
|
22
23
|
Object.setPrototypeOf(StyledRadioButtonContainer.defaultProps, defaultProps);
|
|
23
|
-
var StyledRadioButtonInput = styled.input.withConfig({
|
|
24
|
+
var StyledRadioButtonInput = styled.input.withConfig(styledComponentsConfig).withConfig({
|
|
24
25
|
displayName: "StyledRadioButton__StyledRadioButtonInput",
|
|
25
26
|
componentId: "sc-g1f6ld-1"
|
|
26
27
|
})(["opacity:0;-moz-appearance:none;width:0;height:0;margin:0;", ";"], function (props) {
|
|
@@ -28,7 +29,7 @@ var StyledRadioButtonInput = styled.input.withConfig({
|
|
|
28
29
|
});
|
|
29
30
|
StyledRadioButtonInput.defaultProps = {};
|
|
30
31
|
Object.setPrototypeOf(StyledRadioButtonInput.defaultProps, defaultProps);
|
|
31
|
-
var StyledRadioButtonLabel = styled.span.withConfig({
|
|
32
|
+
var StyledRadioButtonLabel = styled.span.withConfig(styledComponentsConfig).withConfig({
|
|
32
33
|
displayName: "StyledRadioButton__StyledRadioButtonLabel",
|
|
33
34
|
componentId: "sc-g1f6ld-2"
|
|
34
35
|
})(["", ""], function (props) {
|
|
@@ -36,7 +37,7 @@ var StyledRadioButtonLabel = styled.span.withConfig({
|
|
|
36
37
|
});
|
|
37
38
|
StyledRadioButtonLabel.defaultProps = {};
|
|
38
39
|
Object.setPrototypeOf(StyledRadioButtonLabel.defaultProps, defaultProps);
|
|
39
|
-
var StyledRadioButtonIcon = styled.svg.withConfig({
|
|
40
|
+
var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).withConfig({
|
|
40
41
|
displayName: "StyledRadioButton__StyledRadioButtonIcon",
|
|
41
42
|
componentId: "sc-g1f6ld-3"
|
|
42
43
|
})(["box-sizing:border-box;width:", ";height:", ";fill:", ";", ";"], function (props) {
|
|
@@ -50,7 +51,7 @@ var StyledRadioButtonIcon = styled.svg.withConfig({
|
|
|
50
51
|
});
|
|
51
52
|
StyledRadioButtonIcon.defaultProps = {};
|
|
52
53
|
Object.setPrototypeOf(StyledRadioButtonIcon.defaultProps, defaultProps);
|
|
53
|
-
var StyledRadioButtonBox = styled.
|
|
54
|
+
var StyledRadioButtonBox = styled(Box).withConfig({
|
|
54
55
|
displayName: "StyledRadioButton__StyledRadioButtonBox",
|
|
55
56
|
componentId: "sc-g1f6ld-4"
|
|
56
57
|
})(["background-color:", ";", ";", ";"], function (props) {
|
|
@@ -62,7 +63,7 @@ var StyledRadioButtonBox = styled.div.withConfig({
|
|
|
62
63
|
});
|
|
63
64
|
StyledRadioButtonBox.defaultProps = {};
|
|
64
65
|
Object.setPrototypeOf(StyledRadioButtonBox.defaultProps, defaultProps);
|
|
65
|
-
var StyledRadioButton = styled.
|
|
66
|
+
var StyledRadioButton = styled(Box).withConfig({
|
|
66
67
|
displayName: "StyledRadioButton",
|
|
67
68
|
componentId: "sc-g1f6ld-5"
|
|
68
69
|
})(["", ";"], function (props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { disabledStyle, edgeStyle, focusStyle, normalizeColor, parseMetricToNum, getRGBA } from '../../utils';
|
|
2
|
+
import { disabledStyle, edgeStyle, focusStyle, normalizeColor, parseMetricToNum, getRGBA, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
|
|
5
5
|
// opacity of the bound trumps the track opacity
|
|
@@ -109,7 +109,7 @@ var firefoxMicrosoftThumbStyle = css(["", " margin-top:0px;height:", ";width:",
|
|
|
109
109
|
});
|
|
110
110
|
|
|
111
111
|
/* eslint-disable max-len */
|
|
112
|
-
var StyledRangeInput = styled.input.withConfig({
|
|
112
|
+
var StyledRangeInput = styled.input.withConfig(styledComponentsConfig).withConfig({
|
|
113
113
|
displayName: "StyledRangeInput",
|
|
114
114
|
componentId: "sc-15st9ck-0"
|
|
115
115
|
})(["box-sizing:border-box;position:relative;-webkit-appearance:none;border-color:transparent;height:", ";width:100%;padding:0px;cursor:", ";background:transparent;margin:0px;", " &::-moz-focus-inner{border:none;}&::-moz-focus-outer{border:none;}&::-webkit-slider-runnable-track{", "}&::-webkit-slider-thumb{margin-top:-", "px;", " ", " ", "}&::-moz-range-track{", "}&::-moz-range-thumb{", "}&::-ms-thumb{", "}", " &::-ms-track{", " border-color:transparent;color:transparent;}&::-ms-fill-lower{", ";border-color:transparent;}&::-ms-fill-upper{", ";border-color:transparent;}&:focus::-webkit-slider-thumb{", "}&:focus-visible{outline:0;}&:focus{outline:none;}", ""], function (props) {
|
|
@@ -265,7 +265,6 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
265
265
|
onKeyDown: onKeyDownOption
|
|
266
266
|
}, /*#__PURE__*/React.createElement(StyledContainer, {
|
|
267
267
|
ref: ref,
|
|
268
|
-
as: Box,
|
|
269
268
|
id: id ? id + "__select-drop" : undefined,
|
|
270
269
|
dropHeight: dropHeight
|
|
271
270
|
}, onSearch && /*#__PURE__*/React.createElement(Box, {
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
+
import { Box } from '../Box';
|
|
2
3
|
import { Button } from '../Button';
|
|
3
4
|
import { DropButton } from '../DropButton';
|
|
4
5
|
import { TextInput } from '../TextInput';
|
|
5
|
-
import { getHoverIndicatorStyle, selectedStyle, controlBorderStyle, sizeStyle } from '../../utils';
|
|
6
|
-
export var StyledContainer = styled.
|
|
6
|
+
import { getHoverIndicatorStyle, selectedStyle, controlBorderStyle, sizeStyle, styledComponentsConfig } from '../../utils';
|
|
7
|
+
export var StyledContainer = styled(Box).withConfig({
|
|
7
8
|
displayName: "StyledSelect__StyledContainer",
|
|
8
9
|
componentId: "sc-znp66n-0"
|
|
9
10
|
})(["@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){width:100%;}", ";", ";"], function (props) {
|
|
@@ -13,11 +14,11 @@ export var StyledContainer = styled.div.withConfig({
|
|
|
13
14
|
});
|
|
14
15
|
|
|
15
16
|
// position relative is so scroll can be managed correctly
|
|
16
|
-
export var OptionsContainer = styled.div.withConfig({
|
|
17
|
+
export var OptionsContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
17
18
|
displayName: "StyledSelect__OptionsContainer",
|
|
18
19
|
componentId: "sc-znp66n-1"
|
|
19
20
|
})(["position:relative;scroll-behavior:smooth;overflow:auto;outline:none;"]);
|
|
20
|
-
export var HiddenInput = styled.input.withConfig({
|
|
21
|
+
export var HiddenInput = styled.input.withConfig(styledComponentsConfig).withConfig({
|
|
21
22
|
displayName: "StyledSelect__HiddenInput",
|
|
22
23
|
componentId: "sc-znp66n-2"
|
|
23
24
|
})(["display:none;"]);
|
|
@@ -287,7 +287,6 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
287
287
|
onEsc: onClose
|
|
288
288
|
}, /*#__PURE__*/React.createElement(StyledContainer, {
|
|
289
289
|
ref: ref,
|
|
290
|
-
as: Box,
|
|
291
290
|
id: id ? id + "__select-drop" : undefined,
|
|
292
291
|
dropHeight: dropHeight,
|
|
293
292
|
a11yTitle: "Select dropdown"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { backgroundStyle, edgeStyle, genericStyles, heightStyle, roundStyle, widthStyle } from '../../utils';
|
|
2
|
+
import { backgroundStyle, edgeStyle, genericStyles, heightStyle, roundStyle, widthStyle, styledComponentsConfig } from '../../utils';
|
|
3
3
|
|
|
4
4
|
// Styling a div directly rather than just using
|
|
5
5
|
// a Box since Box itself will react to a SkeletonContext
|
|
6
6
|
// and we don't want that here.
|
|
7
|
-
export var StyledSkeleton = styled.div.withConfig({
|
|
7
|
+
export var StyledSkeleton = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
8
8
|
displayName: "StyledSkeleton",
|
|
9
9
|
componentId: "sc-1omqm6u-0"
|
|
10
10
|
})(["display:flex;box-sizing:border-box;", " ", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { genericStyles } from '../../utils';
|
|
2
|
+
import { genericStyles, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var fillStyle = css(["", " ", " flex-grow:1;display:flex;"], function (props) {
|
|
5
5
|
return props.fillContainer === true || props.fillContainer === 'horizontal' ? "\n width: 100%;\n max-width: none;\n " : '';
|
|
6
6
|
}, function (props) {
|
|
7
7
|
return props.fillContainer === true || props.fillContainer === 'vertical' ? 'height: 100%;' : '';
|
|
8
8
|
});
|
|
9
|
-
var StyledStack = styled.div.withConfig({
|
|
9
|
+
var StyledStack = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
10
10
|
displayName: "StyledStack",
|
|
11
11
|
componentId: "sc-ajspsk-0"
|
|
12
12
|
})(["position:relative;", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -28,7 +28,7 @@ var styleMap = {
|
|
|
28
28
|
'top-right': "\n top: 0;\n right: 0;\n ",
|
|
29
29
|
'bottom-right': "\n bottom: 0;\n right: 0;\n "
|
|
30
30
|
};
|
|
31
|
-
var StyledStackLayer = styled.div.withConfig({
|
|
31
|
+
var StyledStackLayer = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
32
32
|
displayName: "StyledStack__StyledStackLayer",
|
|
33
33
|
componentId: "sc-ajspsk-1"
|
|
34
34
|
})(["position:", ";", " ", " ", " ", ""], function (props) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
+
import { Box } from '../Box';
|
|
2
3
|
import { genericStyles, normalizeColor } from '../../utils';
|
|
3
4
|
import { defaultProps } from '../../default-props';
|
|
4
5
|
var tabHoverStyle = css(["&:hover{", " ", " ", ";}&:focus{z-index:1;}"], function (props) {
|
|
@@ -8,7 +9,7 @@ var tabHoverStyle = css(["&:hover{", " ", " ", ";}&:focus{z-index:1;}"], functio
|
|
|
8
9
|
}, function (props) {
|
|
9
10
|
return props.theme.tab.hover.extend;
|
|
10
11
|
});
|
|
11
|
-
var StyledTab = styled.
|
|
12
|
+
var StyledTab = styled(Box).withConfig({
|
|
12
13
|
displayName: "StyledTab",
|
|
13
14
|
componentId: "sc-1nnwnsb-0"
|
|
14
15
|
})(["white-space:nowrap;", " ", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -4,7 +4,6 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
4
4
|
import React, { forwardRef, useContext, useEffect, useState } from 'react';
|
|
5
5
|
import { ThemeContext } from 'styled-components';
|
|
6
6
|
import { defaultProps } from '../../default-props';
|
|
7
|
-
import { Box } from '../Box';
|
|
8
7
|
import { Button } from '../Button';
|
|
9
8
|
import { Text } from '../Text';
|
|
10
9
|
import { TabsContext } from '../Tabs/TabsContext';
|
|
@@ -172,7 +171,6 @@ var Tab = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
172
171
|
setFocusIndex(-1);
|
|
173
172
|
}
|
|
174
173
|
}), /*#__PURE__*/React.createElement(StyledTab, _extends({
|
|
175
|
-
as: Box,
|
|
176
174
|
disabled: disabled,
|
|
177
175
|
plain: plain
|
|
178
176
|
}, withIconStyles, tabStyles), first, second));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { backgroundStyle, borderStyle, edgeStyle, genericStyles } from '../../utils';
|
|
2
|
+
import { backgroundStyle, borderStyle, edgeStyle, genericStyles, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var SIZE_MAP = {
|
|
5
5
|
'1/2': '50%',
|
|
@@ -21,7 +21,7 @@ var sizeStyle = css(["width:", ";max-width:", ";overflow:hidden;"], function (pr
|
|
|
21
21
|
}, function (props) {
|
|
22
22
|
return props.size !== 'auto' ? SIZE_MAP[props.size] || props.theme.global.size[props.size] || props.size : undefined;
|
|
23
23
|
});
|
|
24
|
-
var StyledTableCell = styled.td.withConfig({
|
|
24
|
+
var StyledTableCell = styled.td.withConfig(styledComponentsConfig).withConfig({
|
|
25
25
|
displayName: "StyledTable__StyledTableCell",
|
|
26
26
|
componentId: "sc-1m3u5g-0"
|
|
27
27
|
})(["margin:0;padding:0;font-weight:inherit;text-align:inherit;", " ", " ", " ", " ", " ", " ", ""], function (props) {
|
|
@@ -41,7 +41,7 @@ var StyledTableCell = styled.td.withConfig({
|
|
|
41
41
|
});
|
|
42
42
|
StyledTableCell.defaultProps = {};
|
|
43
43
|
Object.setPrototypeOf(StyledTableCell.defaultProps, defaultProps);
|
|
44
|
-
var StyledTableDataCaption = styled.caption.withConfig({
|
|
44
|
+
var StyledTableDataCaption = styled.caption.withConfig(styledComponentsConfig).withConfig({
|
|
45
45
|
displayName: "StyledTable__StyledTableDataCaption",
|
|
46
46
|
componentId: "sc-1m3u5g-1"
|
|
47
47
|
})(["margin-bottom:", ";"], function (props) {
|
|
@@ -49,31 +49,31 @@ var StyledTableDataCaption = styled.caption.withConfig({
|
|
|
49
49
|
});
|
|
50
50
|
StyledTableDataCaption.defaultProps = {};
|
|
51
51
|
Object.setPrototypeOf(StyledTableDataCaption.defaultProps, defaultProps);
|
|
52
|
-
var StyledTableRow = styled.tr.withConfig({
|
|
52
|
+
var StyledTableRow = styled.tr.withConfig(styledComponentsConfig).withConfig({
|
|
53
53
|
displayName: "StyledTable__StyledTableRow",
|
|
54
54
|
componentId: "sc-1m3u5g-2"
|
|
55
55
|
})([""]);
|
|
56
56
|
StyledTableRow.defaultProps = {};
|
|
57
57
|
Object.setPrototypeOf(StyledTableRow.defaultProps, defaultProps);
|
|
58
|
-
var StyledTableBody = styled.tbody.withConfig({
|
|
58
|
+
var StyledTableBody = styled.tbody.withConfig(styledComponentsConfig).withConfig({
|
|
59
59
|
displayName: "StyledTable__StyledTableBody",
|
|
60
60
|
componentId: "sc-1m3u5g-3"
|
|
61
61
|
})([""]);
|
|
62
62
|
StyledTableBody.defaultProps = {};
|
|
63
63
|
Object.setPrototypeOf(StyledTableBody.defaultProps, defaultProps);
|
|
64
|
-
var StyledTableHeader = styled.thead.withConfig({
|
|
64
|
+
var StyledTableHeader = styled.thead.withConfig(styledComponentsConfig).withConfig({
|
|
65
65
|
displayName: "StyledTable__StyledTableHeader",
|
|
66
66
|
componentId: "sc-1m3u5g-4"
|
|
67
67
|
})([""]);
|
|
68
68
|
StyledTableHeader.defaultProps = {};
|
|
69
69
|
Object.setPrototypeOf(StyledTableHeader.defaultProps, defaultProps);
|
|
70
|
-
var StyledTableFooter = styled.tfoot.withConfig({
|
|
70
|
+
var StyledTableFooter = styled.tfoot.withConfig(styledComponentsConfig).withConfig({
|
|
71
71
|
displayName: "StyledTable__StyledTableFooter",
|
|
72
72
|
componentId: "sc-1m3u5g-5"
|
|
73
73
|
})([""]);
|
|
74
74
|
StyledTableFooter.defaultProps = {};
|
|
75
75
|
Object.setPrototypeOf(StyledTableFooter.defaultProps, defaultProps);
|
|
76
|
-
var StyledTable = styled.table.withConfig({
|
|
76
|
+
var StyledTable = styled.table.withConfig(styledComponentsConfig).withConfig({
|
|
77
77
|
displayName: "StyledTable",
|
|
78
78
|
componentId: "sc-1m3u5g-6"
|
|
79
79
|
})(["border-spacing:0;border-collapse:collapse;width:inherit;", " ", ";"], genericStyles, function (props) {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
var _FLEX_MAP;
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
|
-
import {
|
|
3
|
+
import { Box } from '../Box';
|
|
4
|
+
import { genericStyles, styledComponentsConfig } from '../../utils';
|
|
4
5
|
import { defaultProps } from '../../default-props';
|
|
5
|
-
var StyledTabsHeader = styled.
|
|
6
|
+
var StyledTabsHeader = styled(Box).withConfig({
|
|
6
7
|
displayName: "StyledTabs__StyledTabsHeader",
|
|
7
8
|
componentId: "sc-a4fwxl-0"
|
|
8
9
|
})(["", ";"], function (props) {
|
|
@@ -14,7 +15,7 @@ var FLEX_MAP = (_FLEX_MAP = {}, _FLEX_MAP[true] = '1 1', _FLEX_MAP[false] = '0 0
|
|
|
14
15
|
var flexStyle = css(["flex:", ";"], function (props) {
|
|
15
16
|
return "" + FLEX_MAP[props.flex] + (props.flex !== true ? ' auto' : '');
|
|
16
17
|
});
|
|
17
|
-
var StyledTabPanel = styled.div.withConfig({
|
|
18
|
+
var StyledTabPanel = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
18
19
|
displayName: "StyledTabs__StyledTabPanel",
|
|
19
20
|
componentId: "sc-a4fwxl-1"
|
|
20
21
|
})(["min-height:0;", " ", ";"], function (props) {
|
|
@@ -24,7 +25,7 @@ var StyledTabPanel = styled.div.withConfig({
|
|
|
24
25
|
});
|
|
25
26
|
StyledTabPanel.defaultProps = {};
|
|
26
27
|
Object.setPrototypeOf(StyledTabPanel.defaultProps, defaultProps);
|
|
27
|
-
var StyledTabs = styled.
|
|
28
|
+
var StyledTabs = styled(Box).withConfig({
|
|
28
29
|
displayName: "StyledTabs",
|
|
29
30
|
componentId: "sc-a4fwxl-2"
|
|
30
31
|
})(["", " ", ";"], genericStyles, function (props) {
|
|
@@ -264,7 +264,6 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
264
264
|
});
|
|
265
265
|
return /*#__PURE__*/React.createElement(StyledTabs, _extends({
|
|
266
266
|
ref: ref,
|
|
267
|
-
as: Box,
|
|
268
267
|
flex: flex,
|
|
269
268
|
responsive: responsive
|
|
270
269
|
}, rest, {
|
|
@@ -292,7 +291,6 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
292
291
|
color: disableLeftArrow ? theme.button.disabled.color : theme.global.colors.text
|
|
293
292
|
}))), /*#__PURE__*/React.createElement(StyledTabsHeader, {
|
|
294
293
|
ref: headerRef,
|
|
295
|
-
as: Box,
|
|
296
294
|
direction: "row",
|
|
297
295
|
justify: overflow ? 'start' : justify,
|
|
298
296
|
flex: !!overflow,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { genericStyles, normalizeColor, textAlignStyle } from '../../utils';
|
|
2
|
+
import { genericStyles, normalizeColor, textAlignStyle, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var sizeStyle = function sizeStyle(props) {
|
|
5
5
|
var size = props.size || 'medium';
|
|
@@ -22,11 +22,7 @@ var wordBreakStyle = css(["word-break:", ";"], function (props) {
|
|
|
22
22
|
var fontFamily = css(["font-family:", ";"], function (props) {
|
|
23
23
|
return props.theme.text.font.family;
|
|
24
24
|
});
|
|
25
|
-
var StyledText = styled('span').withConfig({
|
|
26
|
-
shouldForwardProp: function shouldForwardProp(prop, defaultValidatorFn) {
|
|
27
|
-
return defaultValidatorFn(prop) && prop !== 'size';
|
|
28
|
-
}
|
|
29
|
-
}).withConfig({
|
|
25
|
+
var StyledText = styled('span').withConfig(styledComponentsConfig).withConfig({
|
|
30
26
|
displayName: "StyledText",
|
|
31
27
|
componentId: "sc-1sadyjn-0"
|
|
32
28
|
})(["", " ", " ", " ", " ", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { disabledStyle, inputStyle } from '../../utils';
|
|
2
|
+
import { disabledStyle, inputStyle, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var plainStyle = css(["outline:none;border:none;width:100%;-webkit-appearance:none;"]);
|
|
5
5
|
var resizeStyle = function resizeStyle(resize) {
|
|
@@ -14,7 +14,7 @@ var resizeStyle = function resizeStyle(resize) {
|
|
|
14
14
|
}
|
|
15
15
|
return 'resize: none;';
|
|
16
16
|
};
|
|
17
|
-
var StyledTextArea = styled.textarea.withConfig({
|
|
17
|
+
var StyledTextArea = styled.textarea.withConfig(styledComponentsConfig).withConfig({
|
|
18
18
|
displayName: "StyledTextArea",
|
|
19
19
|
componentId: "sc-17i3mwp-0"
|
|
20
20
|
})(["", " ", " ", " ", " ", " ", ";max-width:100%;"], inputStyle, function (props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { disabledStyle, getInputPadBySide, inputStyle, parseMetricToNum, plainInputStyle, textAlignStyle, widthStyle } from '../../utils';
|
|
2
|
+
import { disabledStyle, getInputPadBySide, inputStyle, parseMetricToNum, plainInputStyle, textAlignStyle, widthStyle, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
import { inputPadForIcon } from '../../utils/styles';
|
|
5
5
|
var getPlainStyle = function getPlainStyle(plain) {
|
|
@@ -8,7 +8,7 @@ var getPlainStyle = function getPlainStyle(plain) {
|
|
|
8
8
|
}
|
|
9
9
|
return plain && plainInputStyle;
|
|
10
10
|
};
|
|
11
|
-
var StyledTextInput = styled.input.withConfig({
|
|
11
|
+
var StyledTextInput = styled.input.withConfig(styledComponentsConfig).withConfig({
|
|
12
12
|
displayName: "StyledTextInput",
|
|
13
13
|
componentId: "sc-1x30a0s-0"
|
|
14
14
|
})(["", " ", " ", " ", " ", " ", " ", ";"], inputStyle, function (props) {
|
|
@@ -26,7 +26,7 @@ var StyledTextInput = styled.input.withConfig({
|
|
|
26
26
|
});
|
|
27
27
|
StyledTextInput.defaultProps = {};
|
|
28
28
|
Object.setPrototypeOf(StyledTextInput.defaultProps, defaultProps);
|
|
29
|
-
var StyledTextInputContainer = styled.div.withConfig({
|
|
29
|
+
var StyledTextInputContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
30
30
|
displayName: "StyledTextInput__StyledTextInputContainer",
|
|
31
31
|
componentId: "sc-1x30a0s-1"
|
|
32
32
|
})(["position:relative;width:100%;", ";"], function (props) {
|
|
@@ -34,7 +34,7 @@ var StyledTextInputContainer = styled.div.withConfig({
|
|
|
34
34
|
});
|
|
35
35
|
StyledTextInputContainer.defaultProps = {};
|
|
36
36
|
Object.setPrototypeOf(StyledTextInputContainer.defaultProps, defaultProps);
|
|
37
|
-
var StyledPlaceholder = styled.div.withConfig({
|
|
37
|
+
var StyledPlaceholder = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
38
38
|
displayName: "StyledTextInput__StyledPlaceholder",
|
|
39
39
|
componentId: "sc-1x30a0s-2"
|
|
40
40
|
})(["position:absolute;left:", "px;top:50%;transform:translateY(-50%);display:flex;justify-content:center;pointer-events:none;", ";"], function (props) {
|
|
@@ -44,13 +44,13 @@ var StyledPlaceholder = styled.div.withConfig({
|
|
|
44
44
|
});
|
|
45
45
|
StyledPlaceholder.defaultProps = {};
|
|
46
46
|
Object.setPrototypeOf(StyledPlaceholder.defaultProps, defaultProps);
|
|
47
|
-
var StyledIcon = styled.div.withConfig({
|
|
47
|
+
var StyledIcon = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
48
48
|
displayName: "StyledTextInput__StyledIcon",
|
|
49
49
|
componentId: "sc-1x30a0s-3"
|
|
50
50
|
})(["position:absolute;display:flex;justify:center;top:50%;transform:translateY(-50%);pointer-events:none;", ""], function (props) {
|
|
51
51
|
return props.reverse ? "right: " + getInputPadBySide(props, 'right') + ";" : "left: " + getInputPadBySide(props, 'left') + ";";
|
|
52
52
|
});
|
|
53
|
-
var StyledSuggestions = styled.ol.withConfig({
|
|
53
|
+
var StyledSuggestions = styled.ol.withConfig(styledComponentsConfig).withConfig({
|
|
54
54
|
displayName: "StyledTextInput__StyledSuggestions",
|
|
55
55
|
componentId: "sc-1x30a0s-4"
|
|
56
56
|
})(["border-top-left-radius:0;border-top-right-radius:0;margin:0;padding:0;list-style-type:none;", ";"], function (props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
|
-
import { focusStyle, genericStyles, normalizeColor } from '../../utils';
|
|
2
|
+
import { focusStyle, genericStyles, normalizeColor, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var FIT_MAP = {
|
|
5
5
|
cover: 'cover',
|
|
@@ -10,7 +10,7 @@ var fitStyle = css(["flex:1 1;min-height:0;object-fit:", ";"], function (props)
|
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
// z-index is for Safari so controls aren't hidden
|
|
13
|
-
var StyledVideo = styled.video.withConfig({
|
|
13
|
+
var StyledVideo = styled.video.withConfig(styledComponentsConfig).withConfig({
|
|
14
14
|
displayName: "StyledVideo",
|
|
15
15
|
componentId: "sc-w4v8h9-0"
|
|
16
16
|
})(["max-width:100%;z-index:1;", "::cue{background:", ";}", ";"], function (props) {
|
|
@@ -22,7 +22,7 @@ var StyledVideo = styled.video.withConfig({
|
|
|
22
22
|
});
|
|
23
23
|
StyledVideo.defaultProps = {};
|
|
24
24
|
Object.setPrototypeOf(StyledVideo.defaultProps, defaultProps);
|
|
25
|
-
var StyledVideoContainer = styled.div.withConfig({
|
|
25
|
+
var StyledVideoContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
26
26
|
displayName: "StyledVideo__StyledVideoContainer",
|
|
27
27
|
componentId: "sc-w4v8h9-1"
|
|
28
28
|
})(["flex:1 1;display:flex;flex-direction:column;overflow:hidden;position:relative;", ";&:focus{", "}"], genericStyles, focusStyle());
|
|
@@ -31,7 +31,7 @@ Object.setPrototypeOf(StyledVideoContainer.defaultProps, defaultProps);
|
|
|
31
31
|
|
|
32
32
|
// z-index is for Safari so controls aren't hidden
|
|
33
33
|
var positionStyle = css(["position:absolute;left:0;right:0;bottom:0;z-index:1;"]);
|
|
34
|
-
var StyledVideoControls = styled.div.withConfig({
|
|
34
|
+
var StyledVideoControls = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
35
35
|
displayName: "StyledVideo__StyledVideoControls",
|
|
36
36
|
componentId: "sc-w4v8h9-2"
|
|
37
37
|
})(["flex:0 0;", " opacity:0;transition:opacity 0.3s;", ";"], function (props) {
|
|
@@ -48,7 +48,7 @@ var headStyle = css(["::after{content:'';height:100%;width:", ";background:", ";
|
|
|
48
48
|
}, function (props) {
|
|
49
49
|
return props.value + "%";
|
|
50
50
|
});
|
|
51
|
-
var StyledVideoScrubber = styled.div.withConfig({
|
|
51
|
+
var StyledVideoScrubber = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
52
52
|
displayName: "StyledVideo__StyledVideoScrubber",
|
|
53
53
|
componentId: "sc-w4v8h9-3"
|
|
54
54
|
})(["cursor:pointer;width:100%;height:100%;", ";&:focus{", "}"], function (props) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
|
-
import { genericStyles } from '../../utils';
|
|
2
|
+
import { genericStyles, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { defaultProps } from '../../default-props';
|
|
4
4
|
var fillStyle = function fillStyle(fillProp) {
|
|
5
5
|
if (fillProp === 'horizontal') {
|
|
@@ -15,7 +15,7 @@ var fillStyle = function fillStyle(fillProp) {
|
|
|
15
15
|
};
|
|
16
16
|
|
|
17
17
|
// undefined fillProp has width for backwards compatibility
|
|
18
|
-
var StyledWorldMap = styled.svg.withConfig({
|
|
18
|
+
var StyledWorldMap = styled.svg.withConfig(styledComponentsConfig).withConfig({
|
|
19
19
|
displayName: "StyledWorldMap",
|
|
20
20
|
componentId: "sc-had4c3-0"
|
|
21
21
|
})(["", " ", " ", ";"], genericStyles, function (props) {
|
package/es6/utils/styles.js
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { css } from 'styled-components';
|
|
2
|
+
import isPropValid from '@emotion/is-prop-valid';
|
|
2
3
|
import { backgroundStyle } from './background';
|
|
3
4
|
import { normalizeColor } from './colors';
|
|
4
5
|
import { getBreakpointStyle } from './responsive';
|
|
5
6
|
import { breakpointStyle, parseMetricToNum } from './mixins';
|
|
7
|
+
|
|
8
|
+
// ensure only valid DOM attributes are forwarded onto DOM
|
|
9
|
+
export var styledComponentsConfig = {
|
|
10
|
+
shouldForwardProp: isPropValid
|
|
11
|
+
};
|
|
6
12
|
export var baseStyle = css(["font-family:", ";font-size:", ";line-height:", ";font-weight:", ";", " ", " box-sizing:border-box;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;"], function (props) {
|
|
7
13
|
return props.theme.global.font.family;
|
|
8
14
|
}, function (props) {
|