grommet 2.40.0 → 2.40.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/AccordionPanel/AccordionPanel.js +7 -3
- package/components/Anchor/Anchor.js +5 -3
- package/components/Anchor/StyledAnchor.js +1 -2
- package/components/Avatar/Avatar.js +7 -5
- package/components/Avatar/StyledAvatar.js +2 -3
- package/components/Box/Box.js +7 -5
- package/components/Box/StyledBox.js +2 -3
- package/components/Box/stories/BackgroundThemed.js +3 -2
- package/components/Button/Badge.js +8 -6
- package/components/Button/Button.js +6 -4
- package/components/Button/StyledButton.js +1 -2
- package/components/Button/StyledButtonKind.js +1 -2
- package/components/Calendar/Calendar.js +12 -8
- package/components/Calendar/StyledCalendar.js +4 -5
- package/components/Card/Card.js +3 -2
- package/components/CardBody/CardBody.js +3 -2
- package/components/CardFooter/CardFooter.js +3 -2
- package/components/CardHeader/CardHeader.js +3 -2
- package/components/Cards/Cards.js +3 -2
- package/components/Carousel/Carousel.js +3 -2
- package/components/Chart/Chart.js +5 -3
- package/components/Chart/StyledChart.js +1 -2
- package/components/CheckBox/CheckBox.js +8 -6
- package/components/CheckBox/StyledCheckBox.js +6 -7
- package/components/CheckBoxGroup/CheckBoxGroup.js +5 -3
- package/components/CheckBoxGroup/StyledCheckBoxGroup.js +1 -2
- package/components/Clock/Analog.js +10 -8
- package/components/Clock/Digital.js +12 -7
- package/components/Clock/StyledClock.js +5 -6
- package/components/Collapsible/Collapsible.js +3 -2
- package/components/DataChart/DataChart.js +3 -2
- package/components/DataChart/Detail.js +3 -2
- package/components/DataChart/Swatch.js +3 -2
- package/components/DataClearFilters/DataClearFilters.js +3 -2
- package/components/DataFilters/DataFilters.js +3 -2
- package/components/DataSearch/DataSearch.js +3 -2
- package/components/DataSort/DataSort.js +3 -2
- package/components/DataTable/Body.js +5 -3
- package/components/DataTable/Cell.js +5 -3
- package/components/DataTable/DataTable.js +6 -4
- package/components/DataTable/ExpanderCell.js +3 -2
- package/components/DataTable/Footer.js +5 -2
- package/components/DataTable/GroupedBody.js +4 -1
- package/components/DataTable/Header.js +11 -10
- package/components/DataTable/Resizer.js +3 -2
- package/components/DataTable/Searcher.js +3 -2
- package/components/DataTable/Sorter.js +3 -2
- package/components/DataTable/StyledDataTable.js +4 -5
- package/components/DataTableColumns/DataTableColumns.js +3 -2
- package/components/DateInput/DateInput.js +7 -6
- package/components/Diagram/Diagram.js +5 -3
- package/components/Diagram/StyledDiagram.js +1 -2
- package/components/Drop/Drop.js +3 -2
- package/components/Drop/DropContainer.js +9 -5
- package/components/Drop/StyledDrop.js +1 -2
- package/components/FileInput/FileInput.js +14 -13
- package/components/FileInput/StyledFileInput.js +1 -2
- package/components/FormField/FormField.js +13 -10
- package/components/Grid/Grid.js +5 -2
- package/components/Grid/StyledGrid.js +1 -7
- package/components/Grommet/StyledGrommet.js +1 -2
- package/components/Header/Header.js +3 -2
- package/components/Heading/Heading.js +4 -1
- package/components/Heading/HeadingSkeleton.js +3 -2
- package/components/Heading/StyledHeading.js +1 -2
- package/components/Image/Image.js +4 -1
- package/components/Image/StyledImage.js +1 -2
- package/components/Layer/LayerContainer.js +8 -6
- package/components/Layer/StyledLayer.js +3 -4
- package/components/List/List.js +10 -9
- package/components/MaskedInput/MaskedInput.js +9 -8
- package/components/MaskedInput/StyledMaskedInput.js +3 -4
- package/components/Menu/Menu.js +7 -6
- package/components/Meter/Bar.js +5 -3
- package/components/Meter/Circle.js +5 -3
- package/components/Meter/Meter.js +3 -2
- package/components/Meter/StyledMeter.js +1 -2
- package/components/NameValueList/NameValueList.js +3 -2
- package/components/NameValuePair/NameValuePair.js +3 -2
- package/components/Notification/Notification.js +3 -2
- package/components/Page/Page.js +3 -2
- package/components/PageHeader/PageHeader.js +3 -2
- package/components/Pagination/PageControl.js +8 -6
- package/components/Pagination/Pagination.js +7 -6
- package/components/Pagination/PaginationStep.js +3 -2
- package/components/Pagination/StyledPageControl.js +3 -4
- package/components/Paragraph/Paragraph.js +4 -1
- package/components/Paragraph/ParagraphSkeleton.js +3 -2
- package/components/Paragraph/StyledParagraph.js +1 -2
- package/components/RadioButton/RadioButton.js +11 -9
- package/components/RadioButton/StyledRadioButton.js +5 -6
- package/components/RadioButtonGroup/RadioButtonGroup.js +3 -2
- package/components/RangeInput/RangeInput.js +5 -3
- package/components/RangeInput/StyledRangeInput.js +1 -2
- package/components/RangeSelector/EdgeControl.js +3 -2
- package/components/RangeSelector/RangeSelector.js +3 -2
- package/components/Select/Select.js +3 -2
- package/components/Select/SelectContainer.js +12 -9
- package/components/Select/StyledSelect.js +3 -4
- package/components/SelectMultiple/SelectMultiple.js +7 -6
- package/components/SelectMultiple/SelectMultipleContainer.js +3 -2
- package/components/Skeleton/Skeleton.js +5 -3
- package/components/Skeleton/StyledSkeleton.js +1 -2
- package/components/Skeleton/stories/Group.js +3 -2
- package/components/Skeleton/stories/Individual.js +3 -2
- package/components/SkipLinks/SkipLinks.js +3 -2
- package/components/Spinner/Spinner.js +3 -2
- package/components/Stack/Stack.js +4 -1
- package/components/Stack/StyledStack.js +1 -2
- package/components/StarRating/StarRating.js +3 -2
- package/components/Tab/StyledTab.js +1 -2
- package/components/Tab/Tab.js +5 -3
- package/components/Table/StyledTable.js +3 -4
- package/components/Table/Table.js +4 -1
- package/components/TableCell/TableCell.js +5 -3
- package/components/Tabs/StyledTabs.js +3 -4
- package/components/Tabs/Tabs.js +9 -7
- package/components/Tag/StyledTag.js +2 -3
- package/components/Tag/Tag.js +6 -4
- package/components/Text/StyledText.js +1 -2
- package/components/Text/Text.js +4 -1
- package/components/Text/TextSkeleton.js +3 -2
- package/components/TextArea/StyledTextArea.js +1 -2
- package/components/TextArea/TextArea.js +4 -1
- package/components/TextInput/CopyButton.js +8 -6
- package/components/TextInput/StyledTextInput.js +5 -6
- package/components/TextInput/TextInput.js +11 -10
- package/components/ThumbsRating/ThumbsRating.js +3 -2
- package/components/Tip/Tip.js +3 -2
- package/components/ToggleGroup/StyledToggleGroup.js +1 -2
- package/components/ToggleGroup/ToggleGroup.js +6 -4
- package/components/Video/StyledVideo.js +3 -4
- package/components/Video/Video.js +7 -5
- package/components/WorldMap/StyledWorldMap.js +1 -2
- package/components/WorldMap/WorldMap.js +5 -3
- package/es6/components/AccordionPanel/AccordionPanel.js +7 -3
- package/es6/components/Anchor/Anchor.js +4 -2
- package/es6/components/Anchor/StyledAnchor.js +1 -2
- package/es6/components/Avatar/Avatar.js +6 -4
- package/es6/components/Avatar/StyledAvatar.js +2 -3
- package/es6/components/Box/Box.js +6 -4
- package/es6/components/Box/StyledBox.js +2 -3
- package/es6/components/Box/stories/BackgroundThemed.js +2 -1
- package/es6/components/Button/Badge.js +7 -5
- package/es6/components/Button/Button.js +5 -3
- package/es6/components/Button/StyledButton.js +1 -2
- package/es6/components/Button/StyledButtonKind.js +1 -2
- package/es6/components/Calendar/Calendar.js +11 -7
- package/es6/components/Calendar/StyledCalendar.js +4 -5
- package/es6/components/Card/Card.js +2 -1
- package/es6/components/CardBody/CardBody.js +2 -1
- package/es6/components/CardFooter/CardFooter.js +2 -1
- package/es6/components/CardHeader/CardHeader.js +2 -1
- package/es6/components/Cards/Cards.js +2 -1
- package/es6/components/Carousel/Carousel.js +2 -1
- package/es6/components/Chart/Chart.js +4 -2
- package/es6/components/Chart/StyledChart.js +1 -2
- package/es6/components/CheckBox/CheckBox.js +7 -5
- package/es6/components/CheckBox/StyledCheckBox.js +6 -7
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +4 -2
- package/es6/components/CheckBoxGroup/StyledCheckBoxGroup.js +1 -2
- package/es6/components/Clock/Analog.js +9 -7
- package/es6/components/Clock/Digital.js +12 -7
- package/es6/components/Clock/StyledClock.js +5 -6
- package/es6/components/Collapsible/Collapsible.js +2 -1
- package/es6/components/DataChart/DataChart.js +2 -1
- package/es6/components/DataChart/Detail.js +2 -1
- package/es6/components/DataChart/Swatch.js +2 -1
- package/es6/components/DataClearFilters/DataClearFilters.js +2 -1
- package/es6/components/DataFilters/DataFilters.js +2 -1
- package/es6/components/DataSearch/DataSearch.js +2 -1
- package/es6/components/DataSort/DataSort.js +2 -1
- package/es6/components/DataTable/Body.js +4 -2
- package/es6/components/DataTable/Cell.js +4 -2
- package/es6/components/DataTable/DataTable.js +5 -3
- package/es6/components/DataTable/ExpanderCell.js +2 -1
- package/es6/components/DataTable/Footer.js +5 -2
- package/es6/components/DataTable/GroupedBody.js +4 -1
- package/es6/components/DataTable/Header.js +10 -9
- package/es6/components/DataTable/Resizer.js +2 -1
- package/es6/components/DataTable/Searcher.js +2 -1
- package/es6/components/DataTable/Sorter.js +2 -1
- package/es6/components/DataTable/StyledDataTable.js +4 -5
- package/es6/components/DataTableColumns/DataTableColumns.js +2 -1
- package/es6/components/DateInput/DateInput.js +6 -5
- package/es6/components/Diagram/Diagram.js +4 -2
- package/es6/components/Diagram/StyledDiagram.js +1 -2
- package/es6/components/Drop/Drop.js +2 -1
- package/es6/components/Drop/DropContainer.js +8 -4
- package/es6/components/Drop/StyledDrop.js +1 -2
- package/es6/components/FileInput/FileInput.js +13 -12
- package/es6/components/FileInput/StyledFileInput.js +1 -2
- package/es6/components/FormField/FormField.js +12 -9
- package/es6/components/Grid/Grid.js +5 -2
- package/es6/components/Grid/StyledGrid.js +1 -7
- package/es6/components/Grommet/StyledGrommet.js +1 -2
- package/es6/components/Header/Header.js +2 -1
- package/es6/components/Heading/Heading.js +4 -1
- package/es6/components/Heading/HeadingSkeleton.js +2 -1
- package/es6/components/Heading/StyledHeading.js +1 -2
- package/es6/components/Image/Image.js +4 -1
- package/es6/components/Image/StyledImage.js +1 -2
- package/es6/components/Layer/LayerContainer.js +7 -5
- package/es6/components/Layer/StyledLayer.js +3 -4
- package/es6/components/List/List.js +9 -8
- package/es6/components/MaskedInput/MaskedInput.js +8 -7
- package/es6/components/MaskedInput/StyledMaskedInput.js +3 -4
- package/es6/components/Menu/Menu.js +6 -5
- package/es6/components/Meter/Bar.js +4 -2
- package/es6/components/Meter/Circle.js +4 -2
- package/es6/components/Meter/Meter.js +2 -1
- package/es6/components/Meter/StyledMeter.js +1 -2
- package/es6/components/NameValueList/NameValueList.js +2 -1
- package/es6/components/NameValuePair/NameValuePair.js +2 -1
- package/es6/components/Notification/Notification.js +2 -1
- package/es6/components/Page/Page.js +2 -1
- package/es6/components/PageHeader/PageHeader.js +2 -1
- package/es6/components/Pagination/PageControl.js +7 -5
- package/es6/components/Pagination/Pagination.js +6 -5
- package/es6/components/Pagination/PaginationStep.js +2 -1
- package/es6/components/Pagination/StyledPageControl.js +3 -4
- package/es6/components/Paragraph/Paragraph.js +4 -1
- package/es6/components/Paragraph/ParagraphSkeleton.js +2 -1
- package/es6/components/Paragraph/StyledParagraph.js +1 -2
- package/es6/components/RadioButton/RadioButton.js +10 -8
- package/es6/components/RadioButton/StyledRadioButton.js +5 -6
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +2 -1
- package/es6/components/RangeInput/RangeInput.js +4 -2
- package/es6/components/RangeInput/StyledRangeInput.js +1 -2
- package/es6/components/RangeSelector/EdgeControl.js +2 -1
- package/es6/components/RangeSelector/RangeSelector.js +2 -1
- package/es6/components/Select/Select.js +2 -1
- package/es6/components/Select/SelectContainer.js +11 -8
- package/es6/components/Select/StyledSelect.js +3 -4
- package/es6/components/SelectMultiple/SelectMultiple.js +6 -5
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +2 -1
- package/es6/components/Skeleton/Skeleton.js +4 -2
- package/es6/components/Skeleton/StyledSkeleton.js +1 -2
- package/es6/components/Skeleton/stories/Group.js +2 -1
- package/es6/components/Skeleton/stories/Individual.js +2 -1
- package/es6/components/SkipLinks/SkipLinks.js +2 -1
- package/es6/components/Spinner/Spinner.js +2 -1
- package/es6/components/Stack/Stack.js +4 -1
- package/es6/components/Stack/StyledStack.js +1 -2
- package/es6/components/StarRating/StarRating.js +2 -1
- package/es6/components/Tab/StyledTab.js +1 -2
- package/es6/components/Tab/Tab.js +4 -2
- package/es6/components/Table/StyledTable.js +3 -4
- package/es6/components/Table/Table.js +4 -1
- package/es6/components/TableCell/TableCell.js +4 -2
- package/es6/components/Tabs/StyledTabs.js +3 -4
- package/es6/components/Tabs/Tabs.js +8 -6
- package/es6/components/Tag/StyledTag.js +2 -3
- package/es6/components/Tag/Tag.js +5 -3
- package/es6/components/Text/StyledText.js +1 -2
- package/es6/components/Text/Text.js +4 -1
- package/es6/components/Text/TextSkeleton.js +2 -1
- package/es6/components/TextArea/StyledTextArea.js +1 -2
- package/es6/components/TextArea/TextArea.js +4 -1
- package/es6/components/TextInput/CopyButton.js +7 -5
- package/es6/components/TextInput/StyledTextInput.js +5 -6
- package/es6/components/TextInput/TextInput.js +10 -9
- package/es6/components/ThumbsRating/ThumbsRating.js +2 -1
- package/es6/components/Tip/Tip.js +2 -1
- package/es6/components/ToggleGroup/StyledToggleGroup.js +1 -2
- package/es6/components/ToggleGroup/ToggleGroup.js +5 -3
- package/es6/components/Video/StyledVideo.js +3 -4
- package/es6/components/Video/Video.js +6 -4
- package/es6/components/WorldMap/StyledWorldMap.js +1 -2
- package/es6/components/WorldMap/WorldMap.js +4 -2
- package/es6/utils/use-debounce.js +2 -1
- package/es6/utils/useThemeValue.js +15 -6
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +5 -4
- package/utils/use-debounce.js +3 -2
- package/utils/useThemeValue.js +12 -3
|
@@ -19,11 +19,13 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
19
19
|
name = _ref.name,
|
|
20
20
|
onChange = _ref.onChange,
|
|
21
21
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
|
-
var
|
|
22
|
+
var _useThemeValue = useThemeValue(),
|
|
23
|
+
theme = _useThemeValue.theme,
|
|
24
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
23
25
|
var _useState = useState(),
|
|
24
26
|
hover = _useState[0],
|
|
25
27
|
setHover = _useState[1];
|
|
26
|
-
var normalizedLabel = typeof label === 'string' ? /*#__PURE__*/React.createElement(StyledRadioButtonLabel,
|
|
28
|
+
var normalizedLabel = typeof label === 'string' ? /*#__PURE__*/React.createElement(StyledRadioButtonLabel, passThemeFlag, label) : label;
|
|
27
29
|
var Icon = theme.radioButton.icons.circle;
|
|
28
30
|
var borderColor = normalizeColor(theme.radioButton.border.color, theme);
|
|
29
31
|
var backgroundColor = normalizeColor((_theme$radioButton$ba = theme.radioButton.background) == null ? void 0 : _theme$radioButton$ba.color, theme);
|
|
@@ -53,12 +55,12 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
53
55
|
onMouseLeave: function onMouseLeave() {
|
|
54
56
|
return setHover(false);
|
|
55
57
|
}
|
|
56
|
-
}), /*#__PURE__*/React.createElement(StyledRadioButton, {
|
|
58
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledRadioButton, _extends({
|
|
57
59
|
flex: false,
|
|
58
60
|
margin: label ? {
|
|
59
61
|
right: theme.radioButton.gap || 'small'
|
|
60
62
|
} : undefined
|
|
61
|
-
}, /*#__PURE__*/React.createElement(StyledRadioButtonInput, _extends({
|
|
63
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledRadioButtonInput, _extends({
|
|
62
64
|
"aria-label": a11yTitle
|
|
63
65
|
}, rest, {
|
|
64
66
|
ref: ref,
|
|
@@ -73,7 +75,7 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
73
75
|
checked: checked,
|
|
74
76
|
focus: focus && focusIndicator,
|
|
75
77
|
hover: hover
|
|
76
|
-
}) : /*#__PURE__*/React.createElement(StyledRadioButtonBox, {
|
|
78
|
+
}) : /*#__PURE__*/React.createElement(StyledRadioButtonBox, _extends({
|
|
77
79
|
focus: focus && focusIndicator,
|
|
78
80
|
align: "center",
|
|
79
81
|
justify: "center",
|
|
@@ -85,13 +87,13 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
85
87
|
},
|
|
86
88
|
backgroundColor: backgroundColor,
|
|
87
89
|
round: theme.radioButton.check.radius
|
|
88
|
-
}, checked && (Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
90
|
+
}, passThemeFlag), checked && (Icon ? /*#__PURE__*/React.createElement(Icon, {
|
|
89
91
|
theme: theme,
|
|
90
92
|
as: StyledRadioButtonIcon
|
|
91
|
-
}) : /*#__PURE__*/React.createElement(StyledRadioButtonIcon, {
|
|
93
|
+
}) : /*#__PURE__*/React.createElement(StyledRadioButtonIcon, _extends({
|
|
92
94
|
viewBox: "0 0 24 24",
|
|
93
95
|
preserveAspectRatio: "xMidYMid meet"
|
|
94
|
-
}, /*#__PURE__*/React.createElement("circle", {
|
|
96
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement("circle", {
|
|
95
97
|
cx: 12,
|
|
96
98
|
cy: 12,
|
|
97
99
|
r: 6
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { focusStyle, normalizeColor, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
import { Box } from '../Box';
|
|
5
4
|
var disabledStyle = "\n opacity: 0.5;\n cursor: default;\n";
|
|
6
|
-
var StyledRadioButtonContainer = styled.label.withConfig(styledComponentsConfig).
|
|
5
|
+
var StyledRadioButtonContainer = styled.label.withConfig(styledComponentsConfig).withConfig({
|
|
7
6
|
displayName: "StyledRadioButton__StyledRadioButtonContainer",
|
|
8
7
|
componentId: "sc-g1f6ld-0"
|
|
9
8
|
})(["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) {
|
|
@@ -25,13 +24,13 @@ var StyledRadioButtonInput = styled.input.withConfig(styledComponentsConfig).wit
|
|
|
25
24
|
})(["opacity:0;-moz-appearance:none;width:0;height:0;margin:0;", ";"], function (props) {
|
|
26
25
|
return !props.disabled && 'cursor: pointer;';
|
|
27
26
|
});
|
|
28
|
-
var StyledRadioButtonLabel = styled.span.withConfig(styledComponentsConfig).
|
|
27
|
+
var StyledRadioButtonLabel = styled.span.withConfig(styledComponentsConfig).withConfig({
|
|
29
28
|
displayName: "StyledRadioButton__StyledRadioButtonLabel",
|
|
30
29
|
componentId: "sc-g1f6ld-2"
|
|
31
30
|
})(["", ""], function (props) {
|
|
32
31
|
return props.theme.radioButton.font.weight && css(["font-weight:", ";"], props.theme.radioButton.font.weight);
|
|
33
32
|
});
|
|
34
|
-
var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).
|
|
33
|
+
var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).withConfig({
|
|
35
34
|
displayName: "StyledRadioButton__StyledRadioButtonIcon",
|
|
36
35
|
componentId: "sc-g1f6ld-3"
|
|
37
36
|
})(["box-sizing:border-box;width:", ";height:", ";fill:", ";", ";"], function (props) {
|
|
@@ -43,7 +42,7 @@ var StyledRadioButtonIcon = styled.svg.withConfig(styledComponentsConfig).attrs(
|
|
|
43
42
|
}, function (props) {
|
|
44
43
|
return props.theme.radioButton.icon.extend;
|
|
45
44
|
});
|
|
46
|
-
var StyledRadioButtonBox = styled(Box).
|
|
45
|
+
var StyledRadioButtonBox = styled(Box).withConfig({
|
|
47
46
|
displayName: "StyledRadioButton__StyledRadioButtonBox",
|
|
48
47
|
componentId: "sc-g1f6ld-4"
|
|
49
48
|
})(["background-color:", ";", ";", ";"], function (props) {
|
|
@@ -53,7 +52,7 @@ var StyledRadioButtonBox = styled(Box).attrs(withTheme).withConfig({
|
|
|
53
52
|
}, function (props) {
|
|
54
53
|
return props.theme.radioButton.check.extend;
|
|
55
54
|
});
|
|
56
|
-
var StyledRadioButton = styled(Box).
|
|
55
|
+
var StyledRadioButton = styled(Box).withConfig({
|
|
57
56
|
displayName: "StyledRadioButton",
|
|
58
57
|
componentId: "sc-g1f6ld-5"
|
|
59
58
|
})(["", ";"], function (props) {
|
|
@@ -22,7 +22,8 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
22
22
|
gap = _ref.gap,
|
|
23
23
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
24
24
|
var formContext = useContext(FormContext);
|
|
25
|
-
var
|
|
25
|
+
var _useThemeValue = useThemeValue(),
|
|
26
|
+
theme = _useThemeValue.theme;
|
|
26
27
|
|
|
27
28
|
// normalize options to always use an object
|
|
28
29
|
var options = optionsProp.map(function (o) {
|
|
@@ -26,7 +26,9 @@ var RangeInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
26
26
|
_ref$max = _ref.max,
|
|
27
27
|
max = _ref$max === void 0 ? 100 : _ref$max,
|
|
28
28
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
|
-
var
|
|
29
|
+
var _useThemeValue = useThemeValue(),
|
|
30
|
+
theme = _useThemeValue.theme,
|
|
31
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
30
32
|
var formContext = useContext(FormContext);
|
|
31
33
|
var _useState = useState(focusProp),
|
|
32
34
|
focus = _useState[0],
|
|
@@ -106,7 +108,7 @@ var RangeInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
106
108
|
focus: focus,
|
|
107
109
|
focusIndicator: focusIndicator,
|
|
108
110
|
value: value || value === 0 ? value : ''
|
|
109
|
-
}, rest, {
|
|
111
|
+
}, passThemeFlag, rest, {
|
|
110
112
|
color: color,
|
|
111
113
|
onFocus: function onFocus(event) {
|
|
112
114
|
setFocus(true);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { disabledStyle, edgeStyle, focusStyle, normalizeColor, parseMetricToNum, getRGBA, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
|
|
5
4
|
// opacity of the bound trumps the track opacity
|
|
6
5
|
var getBoundOpacity = function getBoundOpacity(props, bound) {
|
|
@@ -109,7 +108,7 @@ var firefoxMicrosoftThumbStyle = css(["", " margin-top:0px;height:", ";width:",
|
|
|
109
108
|
});
|
|
110
109
|
|
|
111
110
|
/* eslint-disable max-len */
|
|
112
|
-
var StyledRangeInput = styled.input.withConfig(styledComponentsConfig).
|
|
111
|
+
var StyledRangeInput = styled.input.withConfig(styledComponentsConfig).withConfig({
|
|
113
112
|
displayName: "StyledRangeInput",
|
|
114
113
|
componentId: "sc-15st9ck-0"
|
|
115
114
|
})(["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) {
|
|
@@ -31,7 +31,8 @@ var EdgeControl = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
31
31
|
onIncrease = _ref.onIncrease,
|
|
32
32
|
thickness = _ref.thickness,
|
|
33
33
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
|
-
var
|
|
34
|
+
var _useThemeValue = useThemeValue(),
|
|
35
|
+
theme = _useThemeValue.theme;
|
|
35
36
|
var _useState = useState(false),
|
|
36
37
|
focus = _useState[0],
|
|
37
38
|
setFocus = _useState[1];
|
|
@@ -67,7 +67,8 @@ var RangeSelector = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
67
67
|
step = _ref$step === void 0 ? 1 : _ref$step,
|
|
68
68
|
valuesProp = _ref.values,
|
|
69
69
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
70
|
-
var
|
|
70
|
+
var _useThemeValue = useThemeValue(),
|
|
71
|
+
theme = _useThemeValue.theme;
|
|
71
72
|
var _useContext = useContext(MessageContext),
|
|
72
73
|
format = _useContext.format;
|
|
73
74
|
var formContext = useContext(FormContext);
|
|
@@ -65,7 +65,8 @@ var Select = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
65
65
|
valueKeyProp = _ref.valueKey,
|
|
66
66
|
valueLabel = _ref.valueLabel,
|
|
67
67
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
68
|
-
var
|
|
68
|
+
var _useThemeValue = useThemeValue(),
|
|
69
|
+
theme = _useThemeValue.theme;
|
|
69
70
|
var inputRef = useRef();
|
|
70
71
|
var formContext = useContext(FormContext);
|
|
71
72
|
var _useContext = useContext(MessageContext),
|
|
@@ -14,10 +14,9 @@ import { StyledContainer, OptionsContainer, SelectOption } from './StyledSelect'
|
|
|
14
14
|
import { applyKey, useDisabled, getOptionLabel, getOptionValue } from './utils';
|
|
15
15
|
import { EmptySearchOption } from './EmptySearchOption';
|
|
16
16
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
17
|
-
import { withTheme } from '../../default-props';
|
|
18
17
|
|
|
19
18
|
// ensure ClearButton receives visual indication of keyboard
|
|
20
|
-
var StyledButton = styled(Button).
|
|
19
|
+
var StyledButton = styled(Button).withConfig({
|
|
21
20
|
displayName: "SelectContainer__StyledButton",
|
|
22
21
|
componentId: "sc-1wi0ul8-0"
|
|
23
22
|
})(["&:focus{", "}"], function (props) {
|
|
@@ -33,13 +32,15 @@ var ClearButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
33
32
|
position = clear.position;
|
|
34
33
|
var align = position !== 'bottom' ? 'start' : 'center';
|
|
35
34
|
var buttonLabel = label || "Clear " + (name || 'selection');
|
|
35
|
+
var _useThemeValue = useThemeValue(),
|
|
36
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
36
37
|
return /*#__PURE__*/React.createElement(StyledButton, _extends({
|
|
37
38
|
a11yTitle: buttonLabel + ". Or, press " + (position === 'bottom' ? 'shift tab' : 'down arrow') + " to move to select options",
|
|
38
39
|
fill: "horizontal",
|
|
39
40
|
ref: ref,
|
|
40
41
|
onClick: onClear,
|
|
41
42
|
focusIndicator: false
|
|
42
|
-
}, rest), /*#__PURE__*/React.createElement(Box, _extends({}, theme.select.clear.container, {
|
|
43
|
+
}, passThemeFlag, rest), /*#__PURE__*/React.createElement(Box, _extends({}, theme.select.clear.container, {
|
|
43
44
|
align: align
|
|
44
45
|
}), /*#__PURE__*/React.createElement(Text, theme.select.clear.text, buttonLabel)));
|
|
45
46
|
});
|
|
@@ -73,7 +74,9 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
73
74
|
valueKey = _ref2.valueKey,
|
|
74
75
|
_ref2$replace = _ref2.replace,
|
|
75
76
|
replace = _ref2$replace === void 0 ? true : _ref2$replace;
|
|
76
|
-
var
|
|
77
|
+
var _useThemeValue2 = useThemeValue(),
|
|
78
|
+
theme = _useThemeValue2.theme,
|
|
79
|
+
passThemeFlag = _useThemeValue2.passThemeFlag;
|
|
77
80
|
var shouldShowClearButton = useCallback(function (position) {
|
|
78
81
|
var hasValue = Boolean(multiple && value ? value.length : value);
|
|
79
82
|
var showAtPosition = position === 'bottom' ? (clear == null ? void 0 : clear.position) === 'bottom' : (clear == null ? void 0 : clear.position) !== 'bottom';
|
|
@@ -264,11 +267,11 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
264
267
|
onUp: onPreviousOption,
|
|
265
268
|
onDown: onNextOption,
|
|
266
269
|
onKeyDown: onKeyDownOption
|
|
267
|
-
}, /*#__PURE__*/React.createElement(StyledContainer, {
|
|
270
|
+
}, /*#__PURE__*/React.createElement(StyledContainer, _extends({
|
|
268
271
|
ref: ref,
|
|
269
272
|
id: id ? id + "__select-drop" : undefined,
|
|
270
273
|
dropHeight: dropHeight
|
|
271
|
-
}, onSearch && /*#__PURE__*/React.createElement(Box, {
|
|
274
|
+
}, passThemeFlag), onSearch && /*#__PURE__*/React.createElement(Box, {
|
|
272
275
|
pad: !customSearchInput ? 'xsmall' : undefined,
|
|
273
276
|
flex: false
|
|
274
277
|
}, /*#__PURE__*/React.createElement(SelectTextInput, {
|
|
@@ -333,7 +336,7 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
333
336
|
// if we have a child, turn on plain, and hoverIndicator
|
|
334
337
|
return /*#__PURE__*/React.createElement(SelectOption
|
|
335
338
|
// eslint-disable-next-line react/no-array-index-key
|
|
336
|
-
, {
|
|
339
|
+
, _extends({
|
|
337
340
|
key: index
|
|
338
341
|
// merge optionRef and activeRef
|
|
339
342
|
,
|
|
@@ -365,7 +368,7 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
365
368
|
onMouseOver: !optionDisabled ? onActiveOption(index) : undefined,
|
|
366
369
|
onClick: !optionDisabled ? selectOption(index) : undefined,
|
|
367
370
|
textComponent: textComponent
|
|
368
|
-
}, child);
|
|
371
|
+
}, passThemeFlag), child);
|
|
369
372
|
})) : /*#__PURE__*/React.createElement(EmptySearchOption, {
|
|
370
373
|
emptySearchMessage: emptySearchMessage,
|
|
371
374
|
selectOptionsStyle: selectOptionsStyle,
|
|
@@ -4,8 +4,7 @@ import { Button } from '../Button';
|
|
|
4
4
|
import { DropButton } from '../DropButton';
|
|
5
5
|
import { TextInput } from '../TextInput';
|
|
6
6
|
import { getHoverIndicatorStyle, selectedStyle, controlBorderStyle, sizeStyle, styledComponentsConfig } from '../../utils';
|
|
7
|
-
|
|
8
|
-
export var StyledContainer = styled(Box).attrs(withTheme).withConfig({
|
|
7
|
+
export var StyledContainer = styled(Box).withConfig({
|
|
9
8
|
displayName: "StyledSelect__StyledContainer",
|
|
10
9
|
componentId: "sc-znp66n-0"
|
|
11
10
|
})(["@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){width:100%;}", ";", ";"], function (props) {
|
|
@@ -23,7 +22,7 @@ export var HiddenInput = styled.input.withConfig(styledComponentsConfig).withCon
|
|
|
23
22
|
displayName: "StyledSelect__HiddenInput",
|
|
24
23
|
componentId: "sc-znp66n-2"
|
|
25
24
|
})(["display:none;"]);
|
|
26
|
-
export var SelectOption = styled(Button).
|
|
25
|
+
export var SelectOption = styled(Button).withConfig({
|
|
27
26
|
displayName: "StyledSelect__SelectOption",
|
|
28
27
|
componentId: "sc-znp66n-3"
|
|
29
28
|
})(["", " ", " &:focus{", "}display:block;width:100%;", ";"], function (props) {
|
|
@@ -41,7 +40,7 @@ export var SelectTextInput = styled(TextInput).withConfig({
|
|
|
41
40
|
})(["cursor:", ";"], function (props) {
|
|
42
41
|
return props.defaultCursor ? 'default' : 'pointer';
|
|
43
42
|
});
|
|
44
|
-
export var StyledSelectDropButton = styled(DropButton).
|
|
43
|
+
export var StyledSelectDropButton = styled(DropButton).withConfig({
|
|
45
44
|
displayName: "StyledSelect__StyledSelectDropButton",
|
|
46
45
|
componentId: "sc-znp66n-5"
|
|
47
46
|
})(["", ";", ";", ";"], function (props) {
|
|
@@ -16,8 +16,7 @@ import { DefaultSelectTextInput } from '../Select/DefaultSelectTextInput';
|
|
|
16
16
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
17
17
|
import { SelectMultiplePropTypes } from './propTypes';
|
|
18
18
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
19
|
-
|
|
20
|
-
var StyledSelectBox = styled(Box).attrs(withTheme).withConfig({
|
|
19
|
+
var StyledSelectBox = styled(Box).withConfig({
|
|
21
20
|
displayName: "SelectMultiple__StyledSelectBox",
|
|
22
21
|
componentId: "sc-18zwyth-0"
|
|
23
22
|
})(["", ";", ";", ";"], function (props) {
|
|
@@ -77,7 +76,9 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
77
76
|
showSelectedInline = _ref$showSelectedInli === void 0 ? false : _ref$showSelectedInli,
|
|
78
77
|
width = _ref.width,
|
|
79
78
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
80
|
-
var
|
|
79
|
+
var _useThemeValue = useThemeValue(),
|
|
80
|
+
theme = _useThemeValue.theme,
|
|
81
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
81
82
|
var inputRef = useRef();
|
|
82
83
|
var formContext = useContext(FormContext);
|
|
83
84
|
var _useContext = useContext(MessageContext),
|
|
@@ -374,7 +375,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
374
375
|
return /*#__PURE__*/React.createElement(Keyboard, {
|
|
375
376
|
onDown: onRequestOpen,
|
|
376
377
|
onUp: onRequestOpen
|
|
377
|
-
}, showSelectedInline ? /*#__PURE__*/React.createElement(StyledSelectBox, {
|
|
378
|
+
}, showSelectedInline ? /*#__PURE__*/React.createElement(StyledSelectBox, _extends({
|
|
378
379
|
disabled: disabled === true || undefined,
|
|
379
380
|
alignSelf: alignSelf,
|
|
380
381
|
direction: "row",
|
|
@@ -384,7 +385,7 @@ var SelectMultiple = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
384
385
|
flex: false,
|
|
385
386
|
plainSelect: plain,
|
|
386
387
|
width: width
|
|
387
|
-
}, /*#__PURE__*/React.createElement(Box, {
|
|
388
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement(Box, {
|
|
388
389
|
width: "100%"
|
|
389
390
|
}, /*#__PURE__*/React.createElement(DropButton, _extends({
|
|
390
391
|
fill: "horizontal",
|
|
@@ -47,7 +47,8 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
47
47
|
value = _ref$value === void 0 ? [] : _ref$value,
|
|
48
48
|
valueKey = _ref.valueKey,
|
|
49
49
|
showSelectedInline = _ref.showSelectedInline;
|
|
50
|
-
var
|
|
50
|
+
var _useThemeValue = useThemeValue(),
|
|
51
|
+
theme = _useThemeValue.theme;
|
|
51
52
|
var _useState = useState(-1),
|
|
52
53
|
activeIndex = _useState[0],
|
|
53
54
|
setActiveIndex = _useState[1];
|
|
@@ -13,7 +13,9 @@ var Skeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
13
13
|
widthProp = _ref.width,
|
|
14
14
|
heightProp = _ref.height,
|
|
15
15
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
16
|
-
var
|
|
16
|
+
var _useThemeValue = useThemeValue(),
|
|
17
|
+
theme = _useThemeValue.theme,
|
|
18
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
17
19
|
var skeleton = useSkeleton();
|
|
18
20
|
var depth = (skeleton == null ? void 0 : skeleton.depth) || 0;
|
|
19
21
|
var colors = colorsProp || (theme == null || (_theme$skeleton = theme.skeleton) == null ? void 0 : _theme$skeleton.colors);
|
|
@@ -25,7 +27,7 @@ var Skeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
25
27
|
background: background,
|
|
26
28
|
widthProp: widthProp,
|
|
27
29
|
heightProp: heightProp
|
|
28
|
-
}, rest));
|
|
30
|
+
}, passThemeFlag, rest));
|
|
29
31
|
});
|
|
30
32
|
Skeleton.displayName = 'Skeleton';
|
|
31
33
|
Skeleton.propTypes = SkeletonPropTypes;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { backgroundStyle, edgeStyle, genericStyles, heightStyle, roundStyle, widthStyle, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
|
|
5
4
|
// Styling a div directly rather than just using
|
|
6
5
|
// a Box since Box itself will react to a SkeletonContext
|
|
7
6
|
// and we don't want that here.
|
|
8
|
-
export var StyledSkeleton = styled.div.withConfig(styledComponentsConfig).
|
|
7
|
+
export var StyledSkeleton = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
9
8
|
displayName: "StyledSkeleton",
|
|
10
9
|
componentId: "sc-1omqm6u-0"
|
|
11
10
|
})(["display:flex;box-sizing:border-box;", " ", " ", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -55,7 +55,8 @@ var Content = function Content() {
|
|
|
55
55
|
}, /*#__PURE__*/React.createElement(Item, null), /*#__PURE__*/React.createElement(Item, null), /*#__PURE__*/React.createElement(Item, null), /*#__PURE__*/React.createElement(Item, null), /*#__PURE__*/React.createElement(Item, null));
|
|
56
56
|
};
|
|
57
57
|
export var Group = function Group() {
|
|
58
|
-
var
|
|
58
|
+
var _useThemeValue = useThemeValue(),
|
|
59
|
+
theme = _useThemeValue.theme;
|
|
59
60
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grommet, {
|
|
60
61
|
theme: theme
|
|
61
62
|
}, /*#__PURE__*/React.createElement(Content, null)), /*#__PURE__*/React.createElement(Grommet, {
|
|
@@ -63,7 +63,8 @@ var Content = function Content() {
|
|
|
63
63
|
}));
|
|
64
64
|
};
|
|
65
65
|
export var Individual = function Individual() {
|
|
66
|
-
var
|
|
66
|
+
var _useThemeValue = useThemeValue(),
|
|
67
|
+
theme = _useThemeValue.theme;
|
|
67
68
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Grommet, {
|
|
68
69
|
theme: theme
|
|
69
70
|
}, /*#__PURE__*/React.createElement(Content, null)), /*#__PURE__*/React.createElement(Grommet, {
|
|
@@ -9,7 +9,8 @@ var SkipLinks = function SkipLinks(_ref) {
|
|
|
9
9
|
var children = _ref.children,
|
|
10
10
|
id = _ref.id,
|
|
11
11
|
messages = _ref.messages;
|
|
12
|
-
var
|
|
12
|
+
var _useThemeValue = useThemeValue(),
|
|
13
|
+
theme = _useThemeValue.theme;
|
|
13
14
|
var _useState = useState(false),
|
|
14
15
|
showLayer = _useState[0],
|
|
15
16
|
setShowLayer = _useState[1];
|
|
@@ -40,7 +40,8 @@ var Spinner = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
40
40
|
size = _ref2.size,
|
|
41
41
|
message = _ref2.message,
|
|
42
42
|
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
43
|
-
var
|
|
43
|
+
var _useThemeValue = useThemeValue(),
|
|
44
|
+
theme = _useThemeValue.theme;
|
|
44
45
|
var announce = useContext(AnnounceContext);
|
|
45
46
|
useEffect(function () {
|
|
46
47
|
if (message != null && message.start) announce(message.start);else if (typeof message === 'string') announce(message);
|
|
@@ -4,6 +4,7 @@ function _extends() { return _extends = Object.assign ? Object.assign.bind() : f
|
|
|
4
4
|
import React, { Children, forwardRef } from 'react';
|
|
5
5
|
import { StyledStack, StyledStackLayer } from './StyledStack';
|
|
6
6
|
import { StackPropTypes } from './propTypes';
|
|
7
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
7
8
|
var buildStyledChildren = function buildStyledChildren(_ref) {
|
|
8
9
|
var anchor = _ref.anchor,
|
|
9
10
|
fill = _ref.fill,
|
|
@@ -32,6 +33,8 @@ var Stack = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
32
33
|
guidingChild = _ref2.guidingChild,
|
|
33
34
|
interactiveChild = _ref2.interactiveChild,
|
|
34
35
|
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
36
|
+
var _useThemeValue = useThemeValue(),
|
|
37
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
35
38
|
var prunedChildren = Children.toArray(children).filter(function (c) {
|
|
36
39
|
return c;
|
|
37
40
|
});
|
|
@@ -52,7 +55,7 @@ var Stack = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
52
55
|
return /*#__PURE__*/React.createElement(StyledStack, _extends({
|
|
53
56
|
ref: ref,
|
|
54
57
|
fillContainer: fill
|
|
55
|
-
}, rest), styledChildren);
|
|
58
|
+
}, passThemeFlag, rest), styledChildren);
|
|
56
59
|
});
|
|
57
60
|
Stack.displayName = 'Stack';
|
|
58
61
|
Stack.propTypes = StackPropTypes;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { genericStyles, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
var fillStyle = css(["", " ", " flex-grow:1;display:flex;"], function (props) {
|
|
5
4
|
return props.fillContainer === true || props.fillContainer === 'horizontal' ? "\n width: 100%;\n max-width: none;\n " : '';
|
|
6
5
|
}, function (props) {
|
|
7
6
|
return props.fillContainer === true || props.fillContainer === 'vertical' ? 'height: 100%;' : '';
|
|
8
7
|
});
|
|
9
|
-
var StyledStack = styled.div.withConfig(styledComponentsConfig).
|
|
8
|
+
var StyledStack = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
10
9
|
displayName: "StyledStack",
|
|
11
10
|
componentId: "sc-ajspsk-0"
|
|
12
11
|
})(["position:relative;", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -13,7 +13,8 @@ var StarRating = function StarRating(_ref) {
|
|
|
13
13
|
valueProp = _ref.value,
|
|
14
14
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
15
|
var formContext = useContext(FormContext);
|
|
16
|
-
var
|
|
16
|
+
var _useThemeValue = useThemeValue(),
|
|
17
|
+
theme = _useThemeValue.theme;
|
|
17
18
|
var _formContext$useFormI = formContext.useFormInput({
|
|
18
19
|
name: name,
|
|
19
20
|
value: valueProp,
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { Box } from '../Box';
|
|
3
3
|
import { genericStyles, normalizeColor } from '../../utils';
|
|
4
|
-
import { withTheme } from '../../default-props';
|
|
5
4
|
var tabHoverStyle = css(["&:hover{", " ", " ", ";}&:focus{z-index:1;}"], function (props) {
|
|
6
5
|
return props.theme.tab.hover.background && css(["background:", ";"], normalizeColor(props.theme.tab.hover.background, props.theme));
|
|
7
6
|
}, function (props) {
|
|
@@ -9,7 +8,7 @@ var tabHoverStyle = css(["&:hover{", " ", " ", ";}&:focus{z-index:1;}"], functio
|
|
|
9
8
|
}, function (props) {
|
|
10
9
|
return props.theme.tab.hover.extend;
|
|
11
10
|
});
|
|
12
|
-
var StyledTab = styled(Box).
|
|
11
|
+
var StyledTab = styled(Box).withConfig({
|
|
13
12
|
displayName: "StyledTab",
|
|
14
13
|
componentId: "sc-1nnwnsb-0"
|
|
15
14
|
})(["white-space:nowrap;", " ", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -33,7 +33,9 @@ var Tab = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
33
33
|
setActiveContent = _useContext.setActiveContent,
|
|
34
34
|
setActiveTitle = _useContext.setActiveTitle,
|
|
35
35
|
setFocusIndex = _useContext.setFocusIndex;
|
|
36
|
-
var
|
|
36
|
+
var _useThemeValue = useThemeValue(),
|
|
37
|
+
theme = _useThemeValue.theme,
|
|
38
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
37
39
|
var _useState = useState(undefined),
|
|
38
40
|
over = _useState[0],
|
|
39
41
|
setOver = _useState[1];
|
|
@@ -172,7 +174,7 @@ var Tab = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
172
174
|
}), /*#__PURE__*/React.createElement(StyledTab, _extends({
|
|
173
175
|
disabled: disabled,
|
|
174
176
|
plain: plain
|
|
175
|
-
}, withIconStyles, tabStyles), first, second));
|
|
177
|
+
}, withIconStyles, tabStyles, passThemeFlag), first, second));
|
|
176
178
|
});
|
|
177
179
|
Tab.displayName = 'Tab';
|
|
178
180
|
Tab.propTypes = TabPropTypes;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { backgroundStyle, borderStyle, edgeStyle, genericStyles, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
var SIZE_MAP = {
|
|
5
4
|
'1/2': '50%',
|
|
6
5
|
'1/4': '25%',
|
|
@@ -21,7 +20,7 @@ var sizeStyle = css(["width:", ";max-width:", ";overflow:hidden;"], function (pr
|
|
|
21
20
|
}, function (props) {
|
|
22
21
|
return props.size !== 'auto' ? SIZE_MAP[props.size] || props.theme.global.size[props.size] || props.size : undefined;
|
|
23
22
|
});
|
|
24
|
-
var StyledTableCell = styled.td.withConfig(styledComponentsConfig).
|
|
23
|
+
var StyledTableCell = styled.td.withConfig(styledComponentsConfig).withConfig({
|
|
25
24
|
displayName: "StyledTable__StyledTableCell",
|
|
26
25
|
componentId: "sc-1m3u5g-0"
|
|
27
26
|
})(["margin:0;padding:0;font-weight:inherit;text-align:inherit;", " ", " ", " ", " ", " ", " ", ""], function (props) {
|
|
@@ -39,7 +38,7 @@ var StyledTableCell = styled.td.withConfig(styledComponentsConfig).attrs(withThe
|
|
|
39
38
|
}, function (props) {
|
|
40
39
|
return props.tableContextTheme && props.tableContextTheme.extend;
|
|
41
40
|
});
|
|
42
|
-
var StyledTableDataCaption = styled.caption.withConfig(styledComponentsConfig).
|
|
41
|
+
var StyledTableDataCaption = styled.caption.withConfig(styledComponentsConfig).withConfig({
|
|
43
42
|
displayName: "StyledTable__StyledTableDataCaption",
|
|
44
43
|
componentId: "sc-1m3u5g-1"
|
|
45
44
|
})(["margin-bottom:", ";"], function (props) {
|
|
@@ -61,7 +60,7 @@ var StyledTableFooter = styled.tfoot.withConfig(styledComponentsConfig).withConf
|
|
|
61
60
|
displayName: "StyledTable__StyledTableFooter",
|
|
62
61
|
componentId: "sc-1m3u5g-5"
|
|
63
62
|
})([""]);
|
|
64
|
-
var StyledTable = styled.table.withConfig(styledComponentsConfig).
|
|
63
|
+
var StyledTable = styled.table.withConfig(styledComponentsConfig).withConfig({
|
|
65
64
|
displayName: "StyledTable",
|
|
66
65
|
componentId: "sc-1m3u5g-6"
|
|
67
66
|
})(["border-spacing:0;border-collapse:collapse;width:inherit;", " ", ";"], genericStyles, function (props) {
|
|
@@ -4,13 +4,16 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
4
4
|
import React, { forwardRef } from 'react';
|
|
5
5
|
import { StyledTable, StyledTableDataCaption } from './StyledTable';
|
|
6
6
|
import { TablePropTypes } from './propTypes';
|
|
7
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
7
8
|
var Table = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
8
9
|
var caption = _ref.caption,
|
|
9
10
|
children = _ref.children,
|
|
10
11
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
12
|
+
var _useThemeValue = useThemeValue(),
|
|
13
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
11
14
|
return /*#__PURE__*/React.createElement(StyledTable, _extends({
|
|
12
15
|
ref: ref
|
|
13
|
-
}, rest), caption ? /*#__PURE__*/React.createElement(StyledTableDataCaption,
|
|
16
|
+
}, passThemeFlag, rest), caption ? /*#__PURE__*/React.createElement(StyledTableDataCaption, passThemeFlag, caption) : null, children);
|
|
14
17
|
});
|
|
15
18
|
Table.propTypes = TablePropTypes;
|
|
16
19
|
export { Table };
|
|
@@ -31,7 +31,9 @@ var TableCell = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
31
31
|
size = _ref.size,
|
|
32
32
|
verticalAlign = _ref.verticalAlign,
|
|
33
33
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
34
|
-
var
|
|
34
|
+
var _useThemeValue = useThemeValue(),
|
|
35
|
+
theme = _useThemeValue.theme,
|
|
36
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
35
37
|
var tableContext = useContext(TableContext);
|
|
36
38
|
var cellRef = useForwardedRef(ref);
|
|
37
39
|
var containerRef = useRef();
|
|
@@ -139,7 +141,7 @@ var TableCell = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
139
141
|
tableContextTheme: tableContextTheme
|
|
140
142
|
}, plain === true ? mergedProps : {}, cellProps, {
|
|
141
143
|
className: className
|
|
142
|
-
}), plain || !Object.keys(mergedProps).length ? content : /*#__PURE__*/React.createElement(Box, _extends({}, mergedProps, {
|
|
144
|
+
}, passThemeFlag), plain || !Object.keys(mergedProps).length ? content : /*#__PURE__*/React.createElement(Box, _extends({}, mergedProps, {
|
|
143
145
|
align: align,
|
|
144
146
|
justify: verticalAlignToJustify[verticalAlign]
|
|
145
147
|
}), children)));
|
|
@@ -2,8 +2,7 @@ var _FLEX_MAP;
|
|
|
2
2
|
import styled, { css } from 'styled-components';
|
|
3
3
|
import { Box } from '../Box';
|
|
4
4
|
import { genericStyles, styledComponentsConfig } from '../../utils';
|
|
5
|
-
|
|
6
|
-
var StyledTabsHeader = styled(Box).attrs(withTheme).withConfig({
|
|
5
|
+
var StyledTabsHeader = styled(Box).withConfig({
|
|
7
6
|
displayName: "StyledTabs__StyledTabsHeader",
|
|
8
7
|
componentId: "sc-a4fwxl-0"
|
|
9
8
|
})(["", ";"], function (props) {
|
|
@@ -13,7 +12,7 @@ var FLEX_MAP = (_FLEX_MAP = {}, _FLEX_MAP[true] = '1 1', _FLEX_MAP[false] = '0 0
|
|
|
13
12
|
var flexStyle = css(["flex:", ";"], function (props) {
|
|
14
13
|
return "" + FLEX_MAP[props.flex] + (props.flex !== true ? ' auto' : '');
|
|
15
14
|
});
|
|
16
|
-
var StyledTabPanel = styled.div.withConfig(styledComponentsConfig).
|
|
15
|
+
var StyledTabPanel = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
17
16
|
displayName: "StyledTabs__StyledTabPanel",
|
|
18
17
|
componentId: "sc-a4fwxl-1"
|
|
19
18
|
})(["min-height:0;", " ", ";"], function (props) {
|
|
@@ -21,7 +20,7 @@ var StyledTabPanel = styled.div.withConfig(styledComponentsConfig).attrs(withThe
|
|
|
21
20
|
}, function (props) {
|
|
22
21
|
return props.theme.tabs.panel.extend;
|
|
23
22
|
});
|
|
24
|
-
var StyledTabs = styled(Box).
|
|
23
|
+
var StyledTabs = styled(Box).withConfig({
|
|
25
24
|
displayName: "StyledTabs",
|
|
26
25
|
componentId: "sc-a4fwxl-2"
|
|
27
26
|
})(["", " ", ";"], genericStyles, function (props) {
|