grommet 2.40.0 → 2.40.2
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 +17 -5
- 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 +17 -4
- 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
|
@@ -26,7 +26,9 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
26
26
|
_ref$responsive = _ref.responsive,
|
|
27
27
|
responsive = _ref$responsive === void 0 ? true : _ref$responsive,
|
|
28
28
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
29
|
-
var
|
|
29
|
+
var _useThemeValue = useThemeValue(),
|
|
30
|
+
theme = _useThemeValue.theme,
|
|
31
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
30
32
|
var _useContext = useContext(MessageContext),
|
|
31
33
|
format = _useContext.format;
|
|
32
34
|
var propsActiveIndex = rest.activeIndex,
|
|
@@ -265,7 +267,7 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
265
267
|
ref: ref,
|
|
266
268
|
flex: flex,
|
|
267
269
|
responsive: responsive
|
|
268
|
-
}, rest, {
|
|
270
|
+
}, passThemeFlag, rest, {
|
|
269
271
|
background: theme.tabs.background
|
|
270
272
|
}), /*#__PURE__*/React.createElement(Box, _extends({
|
|
271
273
|
alignSelf: alignControls || ((_theme$tabs$header = theme.tabs.header) == null ? void 0 : _theme$tabs$header.alignSelf),
|
|
@@ -288,7 +290,7 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
288
290
|
}
|
|
289
291
|
}, /*#__PURE__*/React.createElement(Previous, {
|
|
290
292
|
color: disableLeftArrow ? theme.button.disabled.color : theme.global.colors.text
|
|
291
|
-
}))), /*#__PURE__*/React.createElement(StyledTabsHeader, {
|
|
293
|
+
}))), /*#__PURE__*/React.createElement(StyledTabsHeader, _extends({
|
|
292
294
|
ref: headerRef,
|
|
293
295
|
direction: "row",
|
|
294
296
|
justify: overflow ? 'start' : justify,
|
|
@@ -299,7 +301,7 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
299
301
|
gap: theme.tabs.gap,
|
|
300
302
|
pad: overflow ? '2px' : undefined,
|
|
301
303
|
margin: overflow ? '-2px' : undefined
|
|
302
|
-
}, tabs), overflow && /*#__PURE__*/React.createElement(Button, {
|
|
304
|
+
}, passThemeFlag), tabs), overflow && /*#__PURE__*/React.createElement(Button, {
|
|
303
305
|
a11yTitle: "Next Tab",
|
|
304
306
|
disabled: disableRightArrow
|
|
305
307
|
// removed from tabIndex, button is redundant for keyboard users
|
|
@@ -315,11 +317,11 @@ var Tabs = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
315
317
|
}
|
|
316
318
|
}, /*#__PURE__*/React.createElement(Next, {
|
|
317
319
|
color: disableRightArrow ? theme.button.disabled.color : theme.global.colors.text
|
|
318
|
-
})))), /*#__PURE__*/React.createElement(StyledTabPanel, {
|
|
320
|
+
})))), /*#__PURE__*/React.createElement(StyledTabPanel, _extends({
|
|
319
321
|
flex: flex,
|
|
320
322
|
"aria-label": tabContentTitle,
|
|
321
323
|
role: "tabpanel"
|
|
322
|
-
}, activeContent));
|
|
324
|
+
}, passThemeFlag), activeContent));
|
|
323
325
|
});
|
|
324
326
|
Tabs.displayName = 'Tabs';
|
|
325
327
|
Tabs.propTypes = TabsPropTypes;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { borderStyle, roundStyle } from '../../utils';
|
|
3
3
|
import { Button } from '../Button';
|
|
4
|
-
|
|
5
|
-
export var StyledTagButton = styled(Button).attrs(withTheme).withConfig({
|
|
4
|
+
export var StyledTagButton = styled(Button).withConfig({
|
|
6
5
|
displayName: "StyledTag__StyledTagButton",
|
|
7
6
|
componentId: "sc-cb9fl2-0"
|
|
8
7
|
})(["", " ", ""], function (props) {
|
|
@@ -10,7 +9,7 @@ export var StyledTagButton = styled(Button).attrs(withTheme).withConfig({
|
|
|
10
9
|
}, function (props) {
|
|
11
10
|
return props.round && roundStyle(props.round, true, props.theme);
|
|
12
11
|
});
|
|
13
|
-
export var StyledRemoveButton = styled(Button).
|
|
12
|
+
export var StyledRemoveButton = styled(Button).withConfig({
|
|
14
13
|
displayName: "StyledTag__StyledRemoveButton",
|
|
15
14
|
componentId: "sc-cb9fl2-1"
|
|
16
15
|
})(["", ""], function (props) {
|
|
@@ -16,7 +16,9 @@ var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
16
16
|
onRemove = _ref.onRemove,
|
|
17
17
|
onClick = _ref.onClick,
|
|
18
18
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
19
|
-
var
|
|
19
|
+
var _useThemeValue = useThemeValue(),
|
|
20
|
+
theme = _useThemeValue.theme,
|
|
21
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
20
22
|
var RemoveIcon = ((_theme$tag$icons = theme.tag.icons) == null ? void 0 : _theme$tag$icons.remove) || FormClose;
|
|
21
23
|
var containerProps = _extends({
|
|
22
24
|
ref: ref,
|
|
@@ -55,13 +57,13 @@ var Tag = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
55
57
|
focusIndicator: true,
|
|
56
58
|
icon: /*#__PURE__*/React.createElement(RemoveIcon, (_theme$tag$size3 = theme.tag.size) == null || (_theme$tag$size3 = _theme$tag$size3[size]) == null ? void 0 : _theme$tag$size3.icon),
|
|
57
59
|
round: ((_theme$tag$size4 = theme.tag.size) == null || (_theme$tag$size4 = _theme$tag$size4[size]) == null ? void 0 : _theme$tag$size4.round) || theme.tag.round
|
|
58
|
-
}, theme.tag.remove))) : /*#__PURE__*/React.createElement(StyledTagButton, _extends({
|
|
60
|
+
}, theme.tag.remove, passThemeFlag))) : /*#__PURE__*/React.createElement(StyledTagButton, _extends({
|
|
59
61
|
flex: false,
|
|
60
62
|
plain: true,
|
|
61
63
|
onClick: onClick,
|
|
62
64
|
hoverIndicator: true,
|
|
63
65
|
focusIndicator: true
|
|
64
|
-
}, containerProps), contents);
|
|
66
|
+
}, containerProps, passThemeFlag), contents);
|
|
65
67
|
});
|
|
66
68
|
Tag.displayName = 'Tag';
|
|
67
69
|
Tag.prototype = TagPropTypes;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { genericStyles, normalizeColor, textAlignStyle, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
var sizeStyle = function sizeStyle(props) {
|
|
5
4
|
var size = props.size || 'medium';
|
|
6
5
|
var data = props.theme.text[size];
|
|
@@ -22,7 +21,7 @@ var wordBreakStyle = css(["word-break:", ";"], function (props) {
|
|
|
22
21
|
var fontFamily = css(["font-family:", ";"], function (props) {
|
|
23
22
|
return props.theme.text.font.family;
|
|
24
23
|
});
|
|
25
|
-
var StyledText = styled('span').
|
|
24
|
+
var StyledText = styled('span').withConfig(styledComponentsConfig).withConfig({
|
|
26
25
|
displayName: "StyledText",
|
|
27
26
|
componentId: "sc-1sadyjn-0"
|
|
28
27
|
})(["", " ", " ", " ", " ", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -10,6 +10,7 @@ import { TextPropTypes } from './propTypes';
|
|
|
10
10
|
import { useSkeleton } from '../Skeleton';
|
|
11
11
|
import { TextSkeleton } from './TextSkeleton';
|
|
12
12
|
import { TextContext } from './TextContext';
|
|
13
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
13
14
|
var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
14
15
|
var children = _ref.children,
|
|
15
16
|
color = _ref.color,
|
|
@@ -24,6 +25,8 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
24
25
|
_ref$level = _ref.level,
|
|
25
26
|
level = _ref$level === void 0 ? 1 : _ref$level,
|
|
26
27
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
28
|
+
var _useThemeValue = useThemeValue(),
|
|
29
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
27
30
|
var textRef = useForwardedRef(ref);
|
|
28
31
|
var _useState = useState(false),
|
|
29
32
|
textTruncated = _useState[0],
|
|
@@ -64,7 +67,7 @@ var Text = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
64
67
|
level: level,
|
|
65
68
|
truncate: truncate,
|
|
66
69
|
size: size
|
|
67
|
-
}, rest, {
|
|
70
|
+
}, passThemeFlag, rest, {
|
|
68
71
|
ref: textRef
|
|
69
72
|
}), children !== undefined ? /*#__PURE__*/React.createElement(TextContext.Provider, {
|
|
70
73
|
value: textContextValue
|
|
@@ -8,7 +8,8 @@ var TextSkeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
8
8
|
var as = _ref.as,
|
|
9
9
|
sizeProp = _ref.size,
|
|
10
10
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11
|
-
var
|
|
11
|
+
var _useThemeValue = useThemeValue(),
|
|
12
|
+
theme = _useThemeValue.theme;
|
|
12
13
|
var size = sizeProp || 'medium';
|
|
13
14
|
var data = theme.text[size];
|
|
14
15
|
var height = data ? data.size : sizeProp;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { disabledStyle, inputStyle, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
var plainStyle = css(["outline:none;border:none;width:100%;-webkit-appearance:none;"]);
|
|
5
4
|
var resizeStyle = function resizeStyle(resize) {
|
|
6
5
|
if (resize === 'horizontal') {
|
|
@@ -14,7 +13,7 @@ var resizeStyle = function resizeStyle(resize) {
|
|
|
14
13
|
}
|
|
15
14
|
return 'resize: none;';
|
|
16
15
|
};
|
|
17
|
-
var StyledTextArea = styled.textarea.withConfig(styledComponentsConfig).
|
|
16
|
+
var StyledTextArea = styled.textarea.withConfig(styledComponentsConfig).withConfig({
|
|
18
17
|
displayName: "StyledTextArea",
|
|
19
18
|
componentId: "sc-17i3mwp-0"
|
|
20
19
|
})(["", " ", " ", " ", " ", " ", ";max-width:100%;"], inputStyle, function (props) {
|
|
@@ -6,6 +6,7 @@ import { FormContext } from '../Form/FormContext';
|
|
|
6
6
|
import { Keyboard } from '../Keyboard';
|
|
7
7
|
import { StyledTextArea } from './StyledTextArea';
|
|
8
8
|
import { TextAreaPropTypes } from './propTypes';
|
|
9
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
9
10
|
var TextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
10
11
|
var a11yTitle = _ref.a11yTitle,
|
|
11
12
|
fill = _ref.fill,
|
|
@@ -18,6 +19,8 @@ var TextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
18
19
|
onKeyDown = _ref.onKeyDown,
|
|
19
20
|
valueProp = _ref.value,
|
|
20
21
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
22
|
+
var _useThemeValue = useThemeValue(),
|
|
23
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
21
24
|
var formContext = useContext(FormContext);
|
|
22
25
|
var _formContext$useFormI = formContext.useFormInput({
|
|
23
26
|
name: name,
|
|
@@ -44,7 +47,7 @@ var TextArea = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
44
47
|
focus: focus,
|
|
45
48
|
value: value,
|
|
46
49
|
focusIndicator: focusIndicator
|
|
47
|
-
}, rest, {
|
|
50
|
+
}, passThemeFlag, rest, {
|
|
48
51
|
onFocus: function onFocus(event) {
|
|
49
52
|
setFocus(true);
|
|
50
53
|
if (_onFocus) _onFocus(event);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import { Copy } from 'grommet-icons/icons/Copy';
|
|
4
5
|
import { Button } from '../Button';
|
|
5
6
|
import { Tip } from '../Tip';
|
|
6
7
|
import { edgeStyle } from '../../utils/styles';
|
|
7
|
-
import { withTheme } from '../../default-props';
|
|
8
8
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
9
9
|
|
|
10
10
|
// to overcome `plain` styling due to (icon && !label) condition
|
|
11
11
|
// in buttons without theme.button.default, apply the padding here
|
|
12
|
-
var StyledButton = styled(Button).
|
|
12
|
+
var StyledButton = styled(Button).withConfig({
|
|
13
13
|
displayName: "CopyButton__StyledButton",
|
|
14
14
|
componentId: "sc-1bp1m18-0"
|
|
15
15
|
})(["border-radius:", ";", ""], function (props) {
|
|
@@ -24,7 +24,9 @@ export var CopyButton = function CopyButton(_ref) {
|
|
|
24
24
|
readOnlyCopyPrompt = _ref.readOnlyCopyPrompt,
|
|
25
25
|
tip = _ref.tip,
|
|
26
26
|
value = _ref.value;
|
|
27
|
-
var
|
|
27
|
+
var _useThemeValue = useThemeValue(),
|
|
28
|
+
theme = _useThemeValue.theme,
|
|
29
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
28
30
|
return /*#__PURE__*/React.createElement(Tip, {
|
|
29
31
|
dropProps: {
|
|
30
32
|
align: {
|
|
@@ -32,7 +34,7 @@ export var CopyButton = function CopyButton(_ref) {
|
|
|
32
34
|
}
|
|
33
35
|
},
|
|
34
36
|
content: tip
|
|
35
|
-
}, /*#__PURE__*/React.createElement(StyledButton, {
|
|
37
|
+
}, /*#__PURE__*/React.createElement(StyledButton, _extends({
|
|
36
38
|
onClick: onClickCopy,
|
|
37
39
|
icon: /*#__PURE__*/React.createElement(Copy, null),
|
|
38
40
|
pad: {
|
|
@@ -47,5 +49,5 @@ export var CopyButton = function CopyButton(_ref) {
|
|
|
47
49
|
onBlur: onBlurCopy,
|
|
48
50
|
onMouseOut: onBlurCopy,
|
|
49
51
|
"aria-label": readOnlyCopyPrompt + " " + value
|
|
50
|
-
}));
|
|
52
|
+
}, passThemeFlag)));
|
|
51
53
|
};
|
|
@@ -2,14 +2,13 @@ import styled, { css } from 'styled-components';
|
|
|
2
2
|
import { controlBorderStyle, disabledStyle, getInputPadBySide, inputStyle, parseMetricToNum, plainInputStyle, textAlignStyle, widthStyle, styledComponentsConfig } from '../../utils';
|
|
3
3
|
import { inputPadForIcon } from '../../utils/styles';
|
|
4
4
|
import { readOnlyStyle } from '../../utils/readOnly';
|
|
5
|
-
import { withTheme } from '../../default-props';
|
|
6
5
|
var getPlainStyle = function getPlainStyle(plain) {
|
|
7
6
|
if (plain === 'full') {
|
|
8
7
|
return css(["", " padding:0;"], plainInputStyle);
|
|
9
8
|
}
|
|
10
9
|
return plain && plainInputStyle;
|
|
11
10
|
};
|
|
12
|
-
var StyledTextInput = styled.input.withConfig(styledComponentsConfig).
|
|
11
|
+
var StyledTextInput = styled.input.withConfig(styledComponentsConfig).withConfig({
|
|
13
12
|
displayName: "StyledTextInput",
|
|
14
13
|
componentId: "sc-1x30a0s-0"
|
|
15
14
|
})(["", " ", " ", " ", " ", " ", " ", " ", " ", ";"], inputStyle, function (props) {
|
|
@@ -29,7 +28,7 @@ var StyledTextInput = styled.input.withConfig(styledComponentsConfig).attrs(with
|
|
|
29
28
|
}, function (props) {
|
|
30
29
|
return props.theme.textInput && props.theme.textInput.extend;
|
|
31
30
|
});
|
|
32
|
-
var StyledTextInputContainer = styled.div.withConfig(styledComponentsConfig).
|
|
31
|
+
var StyledTextInputContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
33
32
|
displayName: "StyledTextInput__StyledTextInputContainer",
|
|
34
33
|
componentId: "sc-1x30a0s-1"
|
|
35
34
|
})(["position:relative;width:100%;", ";", ";", " ", ";"], function (props) {
|
|
@@ -41,7 +40,7 @@ var StyledTextInputContainer = styled.div.withConfig(styledComponentsConfig).att
|
|
|
41
40
|
}, function (props) {
|
|
42
41
|
return props.theme.textInput && props.theme.textInput.container && props.theme.textInput.container.extend;
|
|
43
42
|
});
|
|
44
|
-
var StyledPlaceholder = styled.div.withConfig(styledComponentsConfig).
|
|
43
|
+
var StyledPlaceholder = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
45
44
|
displayName: "StyledTextInput__StyledPlaceholder",
|
|
46
45
|
componentId: "sc-1x30a0s-2"
|
|
47
46
|
})(["position:absolute;left:", "px;top:50%;transform:translateY(-50%);display:flex;justify-content:center;pointer-events:none;", ";"], function (props) {
|
|
@@ -49,13 +48,13 @@ var StyledPlaceholder = styled.div.withConfig(styledComponentsConfig).attrs(with
|
|
|
49
48
|
}, function (props) {
|
|
50
49
|
return props.theme.textInput && props.theme.textInput.placeholder && props.theme.textInput.placeholder.extend;
|
|
51
50
|
});
|
|
52
|
-
var StyledIcon = styled.div.withConfig(styledComponentsConfig).
|
|
51
|
+
var StyledIcon = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
53
52
|
displayName: "StyledTextInput__StyledIcon",
|
|
54
53
|
componentId: "sc-1x30a0s-3"
|
|
55
54
|
})(["position:absolute;display:flex;justify:center;top:50%;transform:translateY(-50%);pointer-events:none;", ""], function (props) {
|
|
56
55
|
return props.reverse ? "right: " + getInputPadBySide(props, 'right') + ";" : "left: " + getInputPadBySide(props, 'left') + ";";
|
|
57
56
|
});
|
|
58
|
-
var StyledSuggestions = styled.ol.withConfig(styledComponentsConfig).
|
|
57
|
+
var StyledSuggestions = styled.ol.withConfig(styledComponentsConfig).withConfig({
|
|
59
58
|
displayName: "StyledTextInput__StyledSuggestions",
|
|
60
59
|
componentId: "sc-1x30a0s-4"
|
|
61
60
|
})(["border-top-left-radius:0;border-top-right-radius:0;margin:0;padding:0;list-style-type:none;", ";"], function (props) {
|
|
@@ -16,7 +16,6 @@ import { MessageContext } from '../../contexts/MessageContext';
|
|
|
16
16
|
import { TextInputPropTypes } from './propTypes';
|
|
17
17
|
import { CopyButton } from './CopyButton';
|
|
18
18
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
19
|
-
import { withTheme } from '../../default-props';
|
|
20
19
|
var renderLabel = function renderLabel(suggestion) {
|
|
21
20
|
if (suggestion && typeof suggestion === 'object') {
|
|
22
21
|
return suggestion.label || suggestion.value;
|
|
@@ -32,7 +31,7 @@ var stringLabel = function stringLabel(suggestion) {
|
|
|
32
31
|
}
|
|
33
32
|
return suggestion;
|
|
34
33
|
};
|
|
35
|
-
var ContainerBox = styled(Box).
|
|
34
|
+
var ContainerBox = styled(Box).withConfig({
|
|
36
35
|
displayName: "TextInput__ContainerBox",
|
|
37
36
|
componentId: "sc-1ai0c08-0"
|
|
38
37
|
})(["", ";@media screen and (-ms-high-contrast:active),(-ms-high-contrast:none){width:100%;}"], function (props) {
|
|
@@ -76,7 +75,9 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
76
75
|
valueProp = _ref.value,
|
|
77
76
|
widthProp = _ref.width,
|
|
78
77
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
79
|
-
var
|
|
78
|
+
var _useThemeValue = useThemeValue(),
|
|
79
|
+
theme = _useThemeValue.theme,
|
|
80
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
80
81
|
var _useContext = useContext(MessageContext),
|
|
81
82
|
format = _useContext.format;
|
|
82
83
|
var announce = useContext(AnnounceContext);
|
|
@@ -275,7 +276,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
275
276
|
target: dropTarget || inputRef.current,
|
|
276
277
|
onClickOutside: clickOutside,
|
|
277
278
|
onEsc: closeDrop
|
|
278
|
-
}, dropProps), /*#__PURE__*/React.createElement(ContainerBox, {
|
|
279
|
+
}, dropProps), /*#__PURE__*/React.createElement(ContainerBox, _extends({
|
|
279
280
|
id: id ? "listbox__" + id : undefined,
|
|
280
281
|
role: "listbox",
|
|
281
282
|
overflow: "auto",
|
|
@@ -283,9 +284,9 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
283
284
|
onMouseMove: function onMouseMove() {
|
|
284
285
|
return setMouseMovedSinceLastKey(true);
|
|
285
286
|
}
|
|
286
|
-
}, /*#__PURE__*/React.createElement(StyledSuggestions, {
|
|
287
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledSuggestions, _extends({
|
|
287
288
|
ref: suggestionsRef
|
|
288
|
-
}, /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
289
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement(InfiniteScroll, {
|
|
289
290
|
items: suggestions,
|
|
290
291
|
step: theme.select.step,
|
|
291
292
|
show: activeSuggestionIndex !== -1 ? activeSuggestionIndex : undefined
|
|
@@ -376,13 +377,13 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
376
377
|
tip: tip,
|
|
377
378
|
value: value
|
|
378
379
|
});
|
|
379
|
-
return /*#__PURE__*/React.createElement(StyledTextInputContainer, {
|
|
380
|
+
return /*#__PURE__*/React.createElement(StyledTextInputContainer, _extends({
|
|
380
381
|
readOnlyProp: readOnly // readOnlyProp to avoid passing to DOM
|
|
381
382
|
,
|
|
382
383
|
readOnlyCopy: readOnlyCopy,
|
|
383
384
|
plain: plain,
|
|
384
385
|
border: !plain
|
|
385
|
-
}, reverse && readOnlyCopy && ReadOnlyCopyButton, showStyledPlaceholder && /*#__PURE__*/React.createElement(StyledPlaceholder,
|
|
386
|
+
}, passThemeFlag), reverse && readOnlyCopy && ReadOnlyCopyButton, showStyledPlaceholder && /*#__PURE__*/React.createElement(StyledPlaceholder, passThemeFlag, placeholder), textInputIcon && !readOnly && /*#__PURE__*/React.createElement(StyledIcon, {
|
|
386
387
|
reverse: reverse,
|
|
387
388
|
theme: theme
|
|
388
389
|
}, textInputIcon), /*#__PURE__*/React.createElement(Keyboard, _extends({
|
|
@@ -401,7 +402,7 @@ var TextInput = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
401
402
|
focusIndicator: focusIndicator,
|
|
402
403
|
textAlign: textAlign,
|
|
403
404
|
widthProp: widthProp
|
|
404
|
-
}, rest, extraProps, comboboxProps, {
|
|
405
|
+
}, passThemeFlag, rest, extraProps, comboboxProps, {
|
|
405
406
|
defaultValue: renderLabel(defaultValue),
|
|
406
407
|
value: renderLabel(value),
|
|
407
408
|
readOnly: readOnly,
|
|
@@ -9,7 +9,8 @@ import { RadioButtonGroup } from '../RadioButtonGroup';
|
|
|
9
9
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
10
10
|
var ThumbsRating = function ThumbsRating(_ref) {
|
|
11
11
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
12
|
-
var
|
|
12
|
+
var _useThemeValue = useThemeValue(),
|
|
13
|
+
theme = _useThemeValue.theme;
|
|
13
14
|
return /*#__PURE__*/React.createElement(RadioButtonGroup, _extends({
|
|
14
15
|
direction: "row",
|
|
15
16
|
options: ['like', 'dislike']
|
|
@@ -12,7 +12,8 @@ var Tip = /*#__PURE__*/forwardRef(function (_ref, tipRef) {
|
|
|
12
12
|
defaultVisible = _ref$defaultVisible === void 0 ? false : _ref$defaultVisible,
|
|
13
13
|
dropProps = _ref.dropProps,
|
|
14
14
|
plain = _ref.plain;
|
|
15
|
-
var
|
|
15
|
+
var _useThemeValue = useThemeValue(),
|
|
16
|
+
theme = _useThemeValue.theme;
|
|
16
17
|
var _useState = useState(false),
|
|
17
18
|
over = _useState[0],
|
|
18
19
|
setOver = _useState[1];
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { Button } from '../Button';
|
|
3
3
|
import { roundStyle, edgeStyle, parseMetricToNum } from '../../utils';
|
|
4
|
-
import { withTheme } from '../../default-props';
|
|
5
4
|
var adjustPad = function adjustPad(value, theme) {
|
|
6
5
|
// resolve t-shirt size if it exists
|
|
7
6
|
var vertical = typeof value === 'string' ? value : value == null ? void 0 : value.vertical;
|
|
@@ -16,7 +15,7 @@ var adjustPad = function adjustPad(value, theme) {
|
|
|
16
15
|
horizontal: horizontal
|
|
17
16
|
};
|
|
18
17
|
};
|
|
19
|
-
export var StyledButton = styled(Button).
|
|
18
|
+
export var StyledButton = styled(Button).withConfig({
|
|
20
19
|
displayName: "StyledToggleGroup__StyledButton",
|
|
21
20
|
componentId: "sc-13k5sx8-0"
|
|
22
21
|
})(["border-radius:0;border:none;", ";", " &:hover{border:none;box-shadow:none;}"], function (props) {
|
|
@@ -42,7 +42,9 @@ var ToggleGroup = function ToggleGroup(_ref2) {
|
|
|
42
42
|
_useControlled$ = _useControlled[0],
|
|
43
43
|
value = _useControlled$ === void 0 ? multiple ? [] : '' : _useControlled$,
|
|
44
44
|
setValue = _useControlled[1];
|
|
45
|
-
var
|
|
45
|
+
var _useThemeValue = useThemeValue(),
|
|
46
|
+
theme = _useThemeValue.theme,
|
|
47
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
46
48
|
var ref = useRef();
|
|
47
49
|
var buttonRefs = useRef([]);
|
|
48
50
|
var values = options == null ? void 0 : options.map(function (option) {
|
|
@@ -139,7 +141,7 @@ var ToggleGroup = function ToggleGroup(_ref2) {
|
|
|
139
141
|
color: theme.toggleGroup.divider.color
|
|
140
142
|
} : undefined,
|
|
141
143
|
key: optionValue || index
|
|
142
|
-
}, /*#__PURE__*/React.createElement(StyledButton, {
|
|
144
|
+
}, /*#__PURE__*/React.createElement(StyledButton, _extends({
|
|
143
145
|
active: active,
|
|
144
146
|
"aria-pressed": multiple && active,
|
|
145
147
|
"aria-checked": !multiple && active,
|
|
@@ -155,7 +157,7 @@ var ToggleGroup = function ToggleGroup(_ref2) {
|
|
|
155
157
|
role: !multiple ? 'radio' : undefined,
|
|
156
158
|
round: round,
|
|
157
159
|
tabIndex: index === focusableIndex ? '0' : '-1'
|
|
158
|
-
}));
|
|
160
|
+
}, passThemeFlag)));
|
|
159
161
|
})));
|
|
160
162
|
};
|
|
161
163
|
ToggleGroup.displayName = 'ToggleGroup';
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { focusStyle, genericStyles, normalizeColor, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
var FIT_MAP = {
|
|
5
4
|
cover: 'cover',
|
|
6
5
|
contain: 'contain'
|
|
@@ -10,7 +9,7 @@ var fitStyle = css(["flex:1 1;min-height:0;object-fit:", ";"], function (props)
|
|
|
10
9
|
});
|
|
11
10
|
|
|
12
11
|
// z-index is for Safari so controls aren't hidden
|
|
13
|
-
var StyledVideo = styled.video.withConfig(styledComponentsConfig).
|
|
12
|
+
var StyledVideo = styled.video.withConfig(styledComponentsConfig).withConfig({
|
|
14
13
|
displayName: "StyledVideo",
|
|
15
14
|
componentId: "sc-w4v8h9-0"
|
|
16
15
|
})(["max-width:100%;z-index:1;", " ::cue{background:", ";}", ";"], function (props) {
|
|
@@ -20,7 +19,7 @@ var StyledVideo = styled.video.withConfig(styledComponentsConfig).attrs(withThem
|
|
|
20
19
|
}, function (props) {
|
|
21
20
|
return props.theme.video && props.theme.video.extend;
|
|
22
21
|
});
|
|
23
|
-
var StyledVideoContainer = styled.div.withConfig(styledComponentsConfig).
|
|
22
|
+
var StyledVideoContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
24
23
|
displayName: "StyledVideo__StyledVideoContainer",
|
|
25
24
|
componentId: "sc-w4v8h9-1"
|
|
26
25
|
})(["flex:1 1;display:flex;flex-direction:column;overflow:hidden;position:relative;", ";&:focus{", "}"], genericStyles, focusStyle());
|
|
@@ -42,7 +41,7 @@ var headStyle = css(["::after{content:'';height:100%;width:", ";background:", ";
|
|
|
42
41
|
}, function (props) {
|
|
43
42
|
return props.value + "%";
|
|
44
43
|
});
|
|
45
|
-
var StyledVideoScrubber = styled.div.withConfig(styledComponentsConfig).
|
|
44
|
+
var StyledVideoScrubber = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
46
45
|
displayName: "StyledVideo__StyledVideoScrubber",
|
|
47
46
|
componentId: "sc-w4v8h9-3"
|
|
48
47
|
})(["cursor:pointer;width:100%;height:100%;", ";&:focus{", "}"], function (props) {
|
|
@@ -48,7 +48,9 @@ var Video = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
48
48
|
_onVolumeChange = _ref.onVolumeChange,
|
|
49
49
|
skipInterval = _ref.skipInterval,
|
|
50
50
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
51
|
-
var
|
|
51
|
+
var _useThemeValue = useThemeValue(),
|
|
52
|
+
theme = _useThemeValue.theme,
|
|
53
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
52
54
|
var _useContext = useContext(MessageContext),
|
|
53
55
|
format = _useContext.format;
|
|
54
56
|
var announce = useContext(AnnounceContext);
|
|
@@ -460,7 +462,7 @@ var Video = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
460
462
|
values: [{
|
|
461
463
|
value: percentagePlayed || 0
|
|
462
464
|
}]
|
|
463
|
-
}), /*#__PURE__*/React.createElement(StyledVideoScrubber, {
|
|
465
|
+
}), /*#__PURE__*/React.createElement(StyledVideoScrubber, _extends({
|
|
464
466
|
"aria-label": format({
|
|
465
467
|
id: 'video.scrubber',
|
|
466
468
|
messages: messages
|
|
@@ -477,7 +479,7 @@ var Video = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
477
479
|
onFocus: function onFocus() {
|
|
478
480
|
return setInteracting(true);
|
|
479
481
|
}
|
|
480
|
-
}))), /*#__PURE__*/React.createElement(Box, {
|
|
482
|
+
}, passThemeFlag)))), /*#__PURE__*/React.createElement(Box, {
|
|
481
483
|
pad: {
|
|
482
484
|
horizontal: 'small'
|
|
483
485
|
}
|
|
@@ -547,7 +549,7 @@ var Video = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
547
549
|
margin: margin,
|
|
548
550
|
style: style,
|
|
549
551
|
tabIndex: "-1"
|
|
550
|
-
}), /*#__PURE__*/React.createElement(StyledVideo, _extends({}, rest, {
|
|
552
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledVideo, _extends({}, passThemeFlag, rest, {
|
|
551
553
|
ref: videoRef,
|
|
552
554
|
onDurationChange: function onDurationChange(event) {
|
|
553
555
|
var video = videoRef.current;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { genericStyles, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
var fillStyle = function fillStyle(fillProp) {
|
|
5
4
|
if (fillProp === 'horizontal') {
|
|
6
5
|
return "\n width: 100%;\n height: unset;\n ";
|
|
@@ -15,7 +14,7 @@ var fillStyle = function fillStyle(fillProp) {
|
|
|
15
14
|
};
|
|
16
15
|
|
|
17
16
|
// undefined fillProp has width for backwards compatibility
|
|
18
|
-
var StyledWorldMap = styled.svg.withConfig(styledComponentsConfig).
|
|
17
|
+
var StyledWorldMap = styled.svg.withConfig(styledComponentsConfig).withConfig({
|
|
19
18
|
displayName: "StyledWorldMap",
|
|
20
19
|
componentId: "sc-had4c3-0"
|
|
21
20
|
})(["", " ", " ", ";"], genericStyles, function (props) {
|
|
@@ -199,7 +199,9 @@ var WorldMap = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
199
199
|
onSelectPlace = _ref5.onSelectPlace,
|
|
200
200
|
placesProp = _ref5.places,
|
|
201
201
|
rest = _objectWithoutPropertiesLoose(_ref5, _excluded);
|
|
202
|
-
var
|
|
202
|
+
var _useThemeValue = useThemeValue(),
|
|
203
|
+
theme = _useThemeValue.theme,
|
|
204
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
203
205
|
var world = React.useMemo(buildWorld, []);
|
|
204
206
|
var _React$useState = React.useState({}),
|
|
205
207
|
continents = _React$useState[0],
|
|
@@ -376,7 +378,7 @@ var WorldMap = /*#__PURE__*/forwardRef(function (_ref5, ref) {
|
|
|
376
378
|
fillProp: fill,
|
|
377
379
|
width: world.width,
|
|
378
380
|
height: world.height
|
|
379
|
-
}, interactiveProps, rest), /*#__PURE__*/React.createElement("g", {
|
|
381
|
+
}, interactiveProps, passThemeFlag, rest), /*#__PURE__*/React.createElement("g", {
|
|
380
382
|
ref: containerRef,
|
|
381
383
|
stroke: "none",
|
|
382
384
|
fill: "none",
|
|
@@ -4,7 +4,8 @@ export var useDebounce = function useDebounce(debounceDelay) {
|
|
|
4
4
|
var _useState = useState(),
|
|
5
5
|
func = _useState[0],
|
|
6
6
|
setFunc = _useState[1];
|
|
7
|
-
var
|
|
7
|
+
var _useThemeValue = useThemeValue(),
|
|
8
|
+
theme = _useThemeValue.theme;
|
|
8
9
|
var delay = debounceDelay || theme.global.debounceDelay;
|
|
9
10
|
useEffect(function () {
|
|
10
11
|
var timer;
|
|
@@ -1,12 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
2
|
+
import { useContext } from 'react';
|
|
3
|
+
import { ThemeContext } from 'styled-components';
|
|
4
|
+
import { defaultProps } from '../default-props';
|
|
4
5
|
|
|
5
6
|
/*
|
|
6
|
-
Hook that returns theme value
|
|
7
|
-
|
|
7
|
+
Hook that returns theme value along with a flag to determine if we are
|
|
8
|
+
outside of a theme context provider, if so pass the base theme.
|
|
9
|
+
If used outside of `<Grommet>` wrapper, falls back to base theme.
|
|
8
10
|
*/
|
|
9
11
|
var useThemeValue = function useThemeValue() {
|
|
10
|
-
|
|
12
|
+
var context = useContext(ThemeContext);
|
|
13
|
+
var theme = context || defaultProps.theme;
|
|
14
|
+
return {
|
|
15
|
+
theme: theme,
|
|
16
|
+
passThemeFlag: _extends({}, context === undefined ? {
|
|
17
|
+
theme: theme
|
|
18
|
+
} : {})
|
|
19
|
+
};
|
|
11
20
|
};
|
|
12
21
|
export { useThemeValue };
|