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
|
@@ -7,7 +7,7 @@ var _Box = require("../Box");
|
|
|
7
7
|
var _Keyboard = require("../Keyboard");
|
|
8
8
|
var _propTypes = require("./propTypes");
|
|
9
9
|
var _StyledToggleGroup = require("./StyledToggleGroup");
|
|
10
|
-
var
|
|
10
|
+
var _useThemeValue2 = require("../../utils/useThemeValue");
|
|
11
11
|
var _excluded = ["defaultValue", "multiple", "options", "onToggle", "value"];
|
|
12
12
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
13
13
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -48,7 +48,9 @@ var ToggleGroup = exports.ToggleGroup = function ToggleGroup(_ref2) {
|
|
|
48
48
|
_useControlled$ = _useControlled[0],
|
|
49
49
|
value = _useControlled$ === void 0 ? multiple ? [] : '' : _useControlled$,
|
|
50
50
|
setValue = _useControlled[1];
|
|
51
|
-
var
|
|
51
|
+
var _useThemeValue = (0, _useThemeValue2.useThemeValue)(),
|
|
52
|
+
theme = _useThemeValue.theme,
|
|
53
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
52
54
|
var ref = (0, _react.useRef)();
|
|
53
55
|
var buttonRefs = (0, _react.useRef)([]);
|
|
54
56
|
var values = options == null ? void 0 : options.map(function (option) {
|
|
@@ -145,7 +147,7 @@ var ToggleGroup = exports.ToggleGroup = function ToggleGroup(_ref2) {
|
|
|
145
147
|
color: theme.toggleGroup.divider.color
|
|
146
148
|
} : undefined,
|
|
147
149
|
key: optionValue || index
|
|
148
|
-
}, /*#__PURE__*/_react["default"].createElement(_StyledToggleGroup.StyledButton, {
|
|
150
|
+
}, /*#__PURE__*/_react["default"].createElement(_StyledToggleGroup.StyledButton, _extends({
|
|
149
151
|
active: active,
|
|
150
152
|
"aria-pressed": multiple && active,
|
|
151
153
|
"aria-checked": !multiple && active,
|
|
@@ -161,7 +163,7 @@ var ToggleGroup = exports.ToggleGroup = function ToggleGroup(_ref2) {
|
|
|
161
163
|
role: !multiple ? 'radio' : undefined,
|
|
162
164
|
round: round,
|
|
163
165
|
tabIndex: index === focusableIndex ? '0' : '-1'
|
|
164
|
-
}));
|
|
166
|
+
}, passThemeFlag)));
|
|
165
167
|
})));
|
|
166
168
|
};
|
|
167
169
|
ToggleGroup.displayName = 'ToggleGroup';
|
|
@@ -4,7 +4,6 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.StyledVideoScrubber = exports.StyledVideoControls = exports.StyledVideoContainer = exports.StyledVideo = void 0;
|
|
5
5
|
var _styledComponents = _interopRequireWildcard(require("styled-components"));
|
|
6
6
|
var _utils = require("../../utils");
|
|
7
|
-
var _defaultProps = require("../../default-props");
|
|
8
7
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
9
8
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
10
9
|
var FIT_MAP = {
|
|
@@ -16,7 +15,7 @@ var fitStyle = (0, _styledComponents.css)(["flex:1 1;min-height:0;object-fit:",
|
|
|
16
15
|
});
|
|
17
16
|
|
|
18
17
|
// z-index is for Safari so controls aren't hidden
|
|
19
|
-
var StyledVideo = exports.StyledVideo = _styledComponents["default"].video.withConfig(_utils.styledComponentsConfig).
|
|
18
|
+
var StyledVideo = exports.StyledVideo = _styledComponents["default"].video.withConfig(_utils.styledComponentsConfig).withConfig({
|
|
20
19
|
displayName: "StyledVideo",
|
|
21
20
|
componentId: "sc-w4v8h9-0"
|
|
22
21
|
})(["max-width:100%;z-index:1;", " ::cue{background:", ";}", ";"], function (props) {
|
|
@@ -26,7 +25,7 @@ var StyledVideo = exports.StyledVideo = _styledComponents["default"].video.withC
|
|
|
26
25
|
}, function (props) {
|
|
27
26
|
return props.theme.video && props.theme.video.extend;
|
|
28
27
|
});
|
|
29
|
-
var StyledVideoContainer = exports.StyledVideoContainer = _styledComponents["default"].div.withConfig(_utils.styledComponentsConfig).
|
|
28
|
+
var StyledVideoContainer = exports.StyledVideoContainer = _styledComponents["default"].div.withConfig(_utils.styledComponentsConfig).withConfig({
|
|
30
29
|
displayName: "StyledVideo__StyledVideoContainer",
|
|
31
30
|
componentId: "sc-w4v8h9-1"
|
|
32
31
|
})(["flex:1 1;display:flex;flex-direction:column;overflow:hidden;position:relative;", ";&:focus{", "}"], _utils.genericStyles, (0, _utils.focusStyle)());
|
|
@@ -48,7 +47,7 @@ var headStyle = (0, _styledComponents.css)(["::after{content:'';height:100%;widt
|
|
|
48
47
|
}, function (props) {
|
|
49
48
|
return props.value + "%";
|
|
50
49
|
});
|
|
51
|
-
var StyledVideoScrubber = exports.StyledVideoScrubber = _styledComponents["default"].div.withConfig(_utils.styledComponentsConfig).
|
|
50
|
+
var StyledVideoScrubber = exports.StyledVideoScrubber = _styledComponents["default"].div.withConfig(_utils.styledComponentsConfig).withConfig({
|
|
52
51
|
displayName: "StyledVideo__StyledVideoScrubber",
|
|
53
52
|
componentId: "sc-w4v8h9-3"
|
|
54
53
|
})(["cursor:pointer;width:100%;height:100%;", ";&:focus{", "}"], function (props) {
|
|
@@ -16,7 +16,7 @@ var _utils = require("../../utils");
|
|
|
16
16
|
var _StyledVideo = require("./StyledVideo");
|
|
17
17
|
var _MessageContext = require("../../contexts/MessageContext");
|
|
18
18
|
var _propTypes = require("./propTypes");
|
|
19
|
-
var
|
|
19
|
+
var _useThemeValue2 = require("../../utils/useThemeValue");
|
|
20
20
|
var _excluded = ["alignSelf", "autoPlay", "children", "controls", "gridArea", "loop", "margin", "messages", "mute", "onDurationChange", "onEnded", "onPause", "onPlay", "onTimeUpdate", "onVolumeChange", "skipInterval"];
|
|
21
21
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
22
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
@@ -53,7 +53,9 @@ var Video = exports.Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
|
53
53
|
_onVolumeChange = _ref.onVolumeChange,
|
|
54
54
|
skipInterval = _ref.skipInterval,
|
|
55
55
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
56
|
-
var
|
|
56
|
+
var _useThemeValue = (0, _useThemeValue2.useThemeValue)(),
|
|
57
|
+
theme = _useThemeValue.theme,
|
|
58
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
57
59
|
var _useContext = (0, _react.useContext)(_MessageContext.MessageContext),
|
|
58
60
|
format = _useContext.format;
|
|
59
61
|
var announce = (0, _react.useContext)(_AnnounceContext.AnnounceContext);
|
|
@@ -465,7 +467,7 @@ var Video = exports.Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
|
465
467
|
values: [{
|
|
466
468
|
value: percentagePlayed || 0
|
|
467
469
|
}]
|
|
468
|
-
}), /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideoScrubber, {
|
|
470
|
+
}), /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideoScrubber, _extends({
|
|
469
471
|
"aria-label": format({
|
|
470
472
|
id: 'video.scrubber',
|
|
471
473
|
messages: messages
|
|
@@ -482,7 +484,7 @@ var Video = exports.Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
|
482
484
|
onFocus: function onFocus() {
|
|
483
485
|
return setInteracting(true);
|
|
484
486
|
}
|
|
485
|
-
}))), /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
487
|
+
}, passThemeFlag)))), /*#__PURE__*/_react["default"].createElement(_Box.Box, {
|
|
486
488
|
pad: {
|
|
487
489
|
horizontal: 'small'
|
|
488
490
|
}
|
|
@@ -552,7 +554,7 @@ var Video = exports.Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref,
|
|
|
552
554
|
margin: margin,
|
|
553
555
|
style: style,
|
|
554
556
|
tabIndex: "-1"
|
|
555
|
-
}), /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideo, _extends({}, rest, {
|
|
557
|
+
}, passThemeFlag), /*#__PURE__*/_react["default"].createElement(_StyledVideo.StyledVideo, _extends({}, passThemeFlag, rest, {
|
|
556
558
|
ref: videoRef,
|
|
557
559
|
onDurationChange: function onDurationChange(event) {
|
|
558
560
|
var video = videoRef.current;
|
|
@@ -4,7 +4,6 @@ exports.__esModule = true;
|
|
|
4
4
|
exports.StyledWorldMap = void 0;
|
|
5
5
|
var _styledComponents = _interopRequireDefault(require("styled-components"));
|
|
6
6
|
var _utils = require("../../utils");
|
|
7
|
-
var _defaultProps = require("../../default-props");
|
|
8
7
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
|
|
9
8
|
var fillStyle = function fillStyle(fillProp) {
|
|
10
9
|
if (fillProp === 'horizontal') {
|
|
@@ -20,7 +19,7 @@ var fillStyle = function fillStyle(fillProp) {
|
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
// undefined fillProp has width for backwards compatibility
|
|
23
|
-
var StyledWorldMap = exports.StyledWorldMap = _styledComponents["default"].svg.withConfig(_utils.styledComponentsConfig).
|
|
22
|
+
var StyledWorldMap = exports.StyledWorldMap = _styledComponents["default"].svg.withConfig(_utils.styledComponentsConfig).withConfig({
|
|
24
23
|
displayName: "StyledWorldMap",
|
|
25
24
|
componentId: "sc-had4c3-0"
|
|
26
25
|
})(["", " ", " ", ";"], _utils.genericStyles, function (props) {
|
|
@@ -7,7 +7,7 @@ var _Drop = require("../Drop");
|
|
|
7
7
|
var _utils = require("../../utils");
|
|
8
8
|
var _StyledWorldMap = require("./StyledWorldMap");
|
|
9
9
|
var _propTypes = require("./propTypes");
|
|
10
|
-
var
|
|
10
|
+
var _useThemeValue2 = require("../../utils/useThemeValue");
|
|
11
11
|
var _excluded = ["fill", "color", "continents", "hoverColor", "onSelectPlace", "places"],
|
|
12
12
|
_excluded2 = ["location"],
|
|
13
13
|
_excluded3 = ["color", "onClick", "onHover"],
|
|
@@ -204,7 +204,9 @@ var WorldMap = exports.WorldMap = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
|
204
204
|
onSelectPlace = _ref5.onSelectPlace,
|
|
205
205
|
placesProp = _ref5.places,
|
|
206
206
|
rest = _objectWithoutPropertiesLoose(_ref5, _excluded);
|
|
207
|
-
var
|
|
207
|
+
var _useThemeValue = (0, _useThemeValue2.useThemeValue)(),
|
|
208
|
+
theme = _useThemeValue.theme,
|
|
209
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
208
210
|
var world = _react["default"].useMemo(buildWorld, []);
|
|
209
211
|
var _React$useState = _react["default"].useState({}),
|
|
210
212
|
continents = _React$useState[0],
|
|
@@ -381,7 +383,7 @@ var WorldMap = exports.WorldMap = /*#__PURE__*/(0, _react.forwardRef)(function (
|
|
|
381
383
|
fillProp: fill,
|
|
382
384
|
width: world.width,
|
|
383
385
|
height: world.height
|
|
384
|
-
}, interactiveProps, rest), /*#__PURE__*/_react["default"].createElement("g", {
|
|
386
|
+
}, interactiveProps, passThemeFlag, rest), /*#__PURE__*/_react["default"].createElement("g", {
|
|
385
387
|
ref: containerRef,
|
|
386
388
|
stroke: "none",
|
|
387
389
|
fill: "none",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _excluded = ["children", "header", "label", "onClick", "onMouseOut", "onMouseOver", "onFocus", "onBlur"];
|
|
1
|
+
var _excluded = ["children", "header", "id", "label", "onClick", "onMouseOut", "onMouseOver", "onFocus", "onBlur"];
|
|
2
2
|
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); }
|
|
3
3
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
|
|
4
4
|
import React, { forwardRef, useContext, useMemo, useState } from 'react';
|
|
@@ -10,9 +10,17 @@ import { Heading } from '../Heading';
|
|
|
10
10
|
import { AccordionContext } from '../Accordion/AccordionContext';
|
|
11
11
|
import { AccordionPanelPropTypes } from './propTypes';
|
|
12
12
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
13
|
+
|
|
14
|
+
// Ideally we should use `useId` from react but this is only available
|
|
15
|
+
// in React 18 and we want to keep compatibility with React 17 and 16.
|
|
16
|
+
function getUID() {
|
|
17
|
+
var timestamp = Date.now() + Math.random();
|
|
18
|
+
return "grommet-accordion-button-" + timestamp;
|
|
19
|
+
}
|
|
13
20
|
var AccordionPanel = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
14
21
|
var children = _ref.children,
|
|
15
22
|
header = _ref.header,
|
|
23
|
+
id = _ref.id,
|
|
16
24
|
label = _ref.label,
|
|
17
25
|
onClick = _ref.onClick,
|
|
18
26
|
_onMouseOut = _ref.onMouseOut,
|
|
@@ -20,7 +28,9 @@ var AccordionPanel = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
20
28
|
_onFocus = _ref.onFocus,
|
|
21
29
|
_onBlur = _ref.onBlur,
|
|
22
30
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
23
|
-
var
|
|
31
|
+
var panelButtonId = id ? "grommet_accordion_button_" + id : getUID();
|
|
32
|
+
var _useThemeValue = useThemeValue(),
|
|
33
|
+
theme = _useThemeValue.theme;
|
|
24
34
|
var _useContext = useContext(AccordionContext),
|
|
25
35
|
active = _useContext.active,
|
|
26
36
|
animate = _useContext.animate,
|
|
@@ -70,6 +80,7 @@ var AccordionPanel = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
70
80
|
border: panelBorder,
|
|
71
81
|
margin: abutMargin
|
|
72
82
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
83
|
+
id: panelButtonId,
|
|
73
84
|
"aria-expanded": active,
|
|
74
85
|
plain: theme.button["default"] ? true : undefined,
|
|
75
86
|
onClick: onPanelChange,
|
|
@@ -98,7 +109,8 @@ var AccordionPanel = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
98
109
|
}, header || /*#__PURE__*/React.createElement(Box, _extends({
|
|
99
110
|
align: "center",
|
|
100
111
|
direction: "row",
|
|
101
|
-
justify: "between"
|
|
112
|
+
justify: "between",
|
|
113
|
+
id: id
|
|
102
114
|
}, rest), typeof label === 'string' ? /*#__PURE__*/React.createElement(Box, {
|
|
103
115
|
pad: {
|
|
104
116
|
horizontal: 'xsmall'
|
|
@@ -118,7 +130,8 @@ var AccordionPanel = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
118
130
|
color: iconColor
|
|
119
131
|
})))), /*#__PURE__*/React.createElement(Box, {
|
|
120
132
|
role: "region",
|
|
121
|
-
border: contentBorder
|
|
133
|
+
border: contentBorder,
|
|
134
|
+
"aria-labelledby": panelButtonId
|
|
122
135
|
}, animate ? /*#__PURE__*/React.createElement(Collapsible, {
|
|
123
136
|
open: active
|
|
124
137
|
}, children) : active && children));
|
|
@@ -25,7 +25,9 @@ var Anchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
25
25
|
reverse = _ref.reverse,
|
|
26
26
|
sizeProp = _ref.size,
|
|
27
27
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
28
|
-
var
|
|
28
|
+
var _useThemeValue = useThemeValue(),
|
|
29
|
+
theme = _useThemeValue.theme,
|
|
30
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
29
31
|
var _useState = useState(),
|
|
30
32
|
focus = _useState[0],
|
|
31
33
|
setFocus = _useState[1];
|
|
@@ -77,7 +79,7 @@ var Anchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
77
79
|
if (_onBlur) _onBlur(event);
|
|
78
80
|
},
|
|
79
81
|
size: sizeProp || size
|
|
80
|
-
}), first && second ? /*#__PURE__*/React.createElement(Box, {
|
|
82
|
+
}, passThemeFlag), first && second ? /*#__PURE__*/React.createElement(Box, {
|
|
81
83
|
as: "span",
|
|
82
84
|
direction: "row",
|
|
83
85
|
align: "center",
|
|
@@ -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 disabledStyle = "\n opacity: 0.3;\n cursor: default;\n text-decoration: none;\n";
|
|
5
4
|
var sizeStyle = function sizeStyle(props) {
|
|
6
5
|
if (props.size) {
|
|
@@ -10,7 +9,7 @@ var sizeStyle = function sizeStyle(props) {
|
|
|
10
9
|
}
|
|
11
10
|
return css(["font-size:inherit;line-height:inherit;"]);
|
|
12
11
|
};
|
|
13
|
-
var StyledAnchor = styled.a.withConfig(styledComponentsConfig).
|
|
12
|
+
var StyledAnchor = styled.a.withConfig(styledComponentsConfig).withConfig({
|
|
14
13
|
displayName: "StyledAnchor",
|
|
15
14
|
componentId: "sc-1rp7lwl-0"
|
|
16
15
|
})(["box-sizing:border-box;display:inline-flex;", " color:", ";", " text-decoration:", ";cursor:pointer;", " ", " ", " ", " ", " ", ""], function (props) {
|
|
@@ -22,7 +22,9 @@ var Avatar = function Avatar(_ref) {
|
|
|
22
22
|
src = _ref.src,
|
|
23
23
|
width = _ref.width,
|
|
24
24
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
25
|
-
var
|
|
25
|
+
var _useThemeValue = useThemeValue(),
|
|
26
|
+
theme = _useThemeValue.theme,
|
|
27
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
26
28
|
var avatarSize = theme.avatar.size[size] || size;
|
|
27
29
|
var avatarTextSize = theme.avatar.text.size[size] || 'large';
|
|
28
30
|
var avatarProps = useMemo(function () {
|
|
@@ -43,10 +45,10 @@ var Avatar = function Avatar(_ref) {
|
|
|
43
45
|
}
|
|
44
46
|
var content;
|
|
45
47
|
if (typeof children === 'string') {
|
|
46
|
-
content = /*#__PURE__*/React.createElement(StyledAvatarText, {
|
|
48
|
+
content = /*#__PURE__*/React.createElement(StyledAvatarText, _extends({
|
|
47
49
|
alignSelf: "center",
|
|
48
50
|
size: avatarTextSize
|
|
49
|
-
}, children);
|
|
51
|
+
}, passThemeFlag), children);
|
|
50
52
|
} else if (typeof src === 'string') {
|
|
51
53
|
content = /*#__PURE__*/React.createElement(Image, {
|
|
52
54
|
role: "presentation",
|
|
@@ -58,7 +60,7 @@ var Avatar = function Avatar(_ref) {
|
|
|
58
60
|
return /*#__PURE__*/React.createElement(StyledAvatar, _extends({
|
|
59
61
|
role: typeof src === 'string' ? 'figure' : undefined,
|
|
60
62
|
a11yTitle: a11yTitle || ariaLabel
|
|
61
|
-
}, avatarProps, rest), content);
|
|
63
|
+
}, avatarProps, passThemeFlag, rest), content);
|
|
62
64
|
}
|
|
63
65
|
return /*#__PURE__*/React.createElement(AvatarChildren, null);
|
|
64
66
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import styled from 'styled-components';
|
|
2
2
|
import { Box } from '../Box';
|
|
3
3
|
import { Text } from '../Text';
|
|
4
|
-
|
|
5
|
-
var StyledAvatarText = styled(Text).attrs(withTheme).withConfig({
|
|
4
|
+
var StyledAvatarText = styled(Text).withConfig({
|
|
6
5
|
displayName: "StyledAvatar__StyledAvatarText",
|
|
7
6
|
componentId: "sc-1suyamb-0"
|
|
8
7
|
})(["", " ", ""], function (props) {
|
|
@@ -10,7 +9,7 @@ var StyledAvatarText = styled(Text).attrs(withTheme).withConfig({
|
|
|
10
9
|
}, function (props) {
|
|
11
10
|
return props.theme.avatar.text && props.theme.avatar.text.extend;
|
|
12
11
|
});
|
|
13
|
-
var StyledAvatar = styled(Box).
|
|
12
|
+
var StyledAvatar = styled(Box).withConfig({
|
|
14
13
|
displayName: "StyledAvatar",
|
|
15
14
|
componentId: "sc-1suyamb-1"
|
|
16
15
|
})(["", ""], function (props) {
|
|
@@ -38,7 +38,9 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
38
38
|
tabIndex = _ref.tabIndex,
|
|
39
39
|
skeletonProp = _ref.skeleton,
|
|
40
40
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
41
|
-
var
|
|
41
|
+
var _useThemeValue = useThemeValue(),
|
|
42
|
+
theme = _useThemeValue.theme,
|
|
43
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
42
44
|
// boxOptions was created to preserve backwards compatibility but
|
|
43
45
|
// should not be supported in v3
|
|
44
46
|
var _useContext = useContext(OptionsContext),
|
|
@@ -110,14 +112,14 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
110
112
|
} else {
|
|
111
113
|
contents.push( /*#__PURE__*/React.createElement(StyledBoxGap
|
|
112
114
|
// eslint-disable-next-line react/no-array-index-key
|
|
113
|
-
, {
|
|
115
|
+
, _extends({
|
|
114
116
|
key: "gap-" + index,
|
|
115
117
|
as: boxAs === 'span' ? boxAs : 'div',
|
|
116
118
|
gap: gap,
|
|
117
119
|
directionProp: direction,
|
|
118
120
|
responsive: responsive,
|
|
119
121
|
border: styledBoxGapBorder
|
|
120
|
-
}));
|
|
122
|
+
}, passThemeFlag)));
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
contents.push(child);
|
|
@@ -195,7 +197,7 @@ var Box = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
195
197
|
heightProp: height,
|
|
196
198
|
responsive: responsive,
|
|
197
199
|
tabIndex: adjustedTabIndex
|
|
198
|
-
}, clickProps, rest, skeletonProps), /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
200
|
+
}, clickProps, passThemeFlag, rest, skeletonProps), /*#__PURE__*/React.createElement(ThemeContext.Provider, {
|
|
199
201
|
value: nextTheme
|
|
200
202
|
}, contents));
|
|
201
203
|
if (onClick) {
|
|
@@ -4,7 +4,6 @@ import styled, { css } from 'styled-components';
|
|
|
4
4
|
import { alignContentStyle, alignStyle, backgroundStyle, borderStyle, breakpointStyle, edgeStyle, fillStyle, focusStyle, genericStyles, getBreakpointStyle, getHoverIndicatorStyle, heightStyle, overflowStyle, parseMetricToNum, responsiveBorderStyle, widthStyle } from '../../utils';
|
|
5
5
|
import { roundStyle, styledComponentsConfig } from '../../utils/styles';
|
|
6
6
|
import { animationBounds, animationObjectStyle } from '../../utils/animation';
|
|
7
|
-
import { withTheme } from '../../default-props';
|
|
8
7
|
var BASIS_MAP = {
|
|
9
8
|
auto: 'auto',
|
|
10
9
|
full: '100%',
|
|
@@ -164,7 +163,7 @@ var gapStyle = function gapStyle(directionProp, gap, responsive, wrap, theme) {
|
|
|
164
163
|
};
|
|
165
164
|
|
|
166
165
|
// NOTE: basis must be after flex! Otherwise, flex overrides basis
|
|
167
|
-
var StyledBox = styled.div.withConfig(styledComponentsConfig).
|
|
166
|
+
var StyledBox = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
168
167
|
displayName: "StyledBox",
|
|
169
168
|
componentId: "sc-13pk1d4-0"
|
|
170
169
|
})(["display:flex;box-sizing:border-box;", ";", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", " ", ""], function (props) {
|
|
@@ -267,7 +266,7 @@ var gapGapStyle = function gapGapStyle(directionProp, gap, responsive, border, t
|
|
|
267
266
|
}
|
|
268
267
|
return styles;
|
|
269
268
|
};
|
|
270
|
-
var StyledBoxGap = styled.div.withConfig(styledComponentsConfig).
|
|
269
|
+
var StyledBoxGap = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
271
270
|
displayName: "StyledBox__StyledBoxGap",
|
|
272
271
|
componentId: "sc-13pk1d4-1"
|
|
273
272
|
})(["flex:0 0 auto;align-self:stretch;", ";"], function (props) {
|
|
@@ -3,7 +3,8 @@ import { Box, Paragraph, Text } from 'grommet';
|
|
|
3
3
|
import { Grid } from '../../Grid';
|
|
4
4
|
import { useThemeValue } from '../../../utils/useThemeValue';
|
|
5
5
|
export var BackgroundThemed = function BackgroundThemed() {
|
|
6
|
-
var
|
|
6
|
+
var _useThemeValue = useThemeValue(),
|
|
7
|
+
theme = _useThemeValue.theme;
|
|
7
8
|
var backgrounds = theme.global.backgrounds;
|
|
8
9
|
return (
|
|
9
10
|
// Uncomment <Grommet> lines when using outside of storybook
|
|
@@ -1,3 +1,4 @@
|
|
|
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, { useRef } from 'react';
|
|
2
3
|
import styled from 'styled-components';
|
|
3
4
|
import { parseMetricToNum } from '../../utils';
|
|
@@ -5,9 +6,8 @@ import { useLayoutEffect } from '../../utils/use-isomorphic-layout-effect';
|
|
|
5
6
|
import { Box } from '../Box';
|
|
6
7
|
import { Stack } from '../Stack';
|
|
7
8
|
import { Text } from '../Text';
|
|
8
|
-
import { withTheme } from '../../default-props';
|
|
9
9
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
10
|
-
var StyledBadgeContainer = styled(Box).
|
|
10
|
+
var StyledBadgeContainer = styled(Box).withConfig({
|
|
11
11
|
displayName: "Badge__StyledBadgeContainer",
|
|
12
12
|
componentId: "sc-1es4ws1-0"
|
|
13
13
|
})(["", ""], function (props) {
|
|
@@ -16,7 +16,9 @@ var StyledBadgeContainer = styled(Box).attrs(withTheme).withConfig({
|
|
|
16
16
|
export var Badge = function Badge(_ref) {
|
|
17
17
|
var children = _ref.children,
|
|
18
18
|
content = _ref.content;
|
|
19
|
-
var
|
|
19
|
+
var _useThemeValue = useThemeValue(),
|
|
20
|
+
theme = _useThemeValue.theme,
|
|
21
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
20
22
|
var containerRef = useRef();
|
|
21
23
|
var contentRef = useRef();
|
|
22
24
|
var stackRef = useRef();
|
|
@@ -104,7 +106,7 @@ export var Badge = function Badge(_ref) {
|
|
|
104
106
|
ref: contentRef
|
|
105
107
|
}, value > max ? max + "+" : value);
|
|
106
108
|
}
|
|
107
|
-
badge = /*#__PURE__*/React.createElement(StyledBadgeContainer, {
|
|
109
|
+
badge = /*#__PURE__*/React.createElement(StyledBadgeContainer, _extends({
|
|
108
110
|
ref: containerRef,
|
|
109
111
|
align: "center",
|
|
110
112
|
background: content.background || theme.button.badge.container.background,
|
|
@@ -112,7 +114,7 @@ export var Badge = function Badge(_ref) {
|
|
|
112
114
|
justify: "center",
|
|
113
115
|
round: true,
|
|
114
116
|
pad: !(typeof value === 'boolean' || typeof content === 'boolean') ? theme.button.badge.container.pad : undefined
|
|
115
|
-
}, badge);
|
|
117
|
+
}, passThemeFlag), badge);
|
|
116
118
|
// caller has provided their own JSX and we will just render that
|
|
117
119
|
} else badge = /*#__PURE__*/React.createElement(Box, {
|
|
118
120
|
ref: contentRef
|
|
@@ -179,7 +179,9 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
179
179
|
a11yTitle = _ref$a11yTitle === void 0 ? typeof tip === 'string' ? tip : undefined : _ref$a11yTitle,
|
|
180
180
|
as = _ref.as,
|
|
181
181
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
182
|
-
var
|
|
182
|
+
var _useThemeValue = useThemeValue(),
|
|
183
|
+
theme = _useThemeValue.theme,
|
|
184
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
183
185
|
var _useState = useState(),
|
|
184
186
|
focus = _useState[0],
|
|
185
187
|
setFocus = _useState[1];
|
|
@@ -427,7 +429,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
427
429
|
sizeProp: size,
|
|
428
430
|
success: success,
|
|
429
431
|
type: !href ? type : undefined
|
|
430
|
-
}), contents);
|
|
432
|
+
}, passThemeFlag), contents);
|
|
431
433
|
} else {
|
|
432
434
|
styledButtonResult = /*#__PURE__*/React.createElement(StyledButton, _extends({}, rest, {
|
|
433
435
|
as: domTag,
|
|
@@ -464,7 +466,7 @@ var Button = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
464
466
|
sizeProp: size,
|
|
465
467
|
success: success,
|
|
466
468
|
type: !href ? type : undefined
|
|
467
|
-
}), contents);
|
|
469
|
+
}, passThemeFlag), contents);
|
|
468
470
|
}
|
|
469
471
|
if (tip) {
|
|
470
472
|
if (typeof tip === 'string') {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { activeStyle, backgroundStyle, disabledStyle, edgeStyle, focusStyle, unfocusStyle, genericStyles, getHoverIndicatorStyle, normalizeColor } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
import { styledComponentsConfig } from '../../utils/styles';
|
|
5
4
|
var radiusStyle = function radiusStyle(props) {
|
|
6
5
|
// border.radius shouldn't impact an only-icon rendering.
|
|
@@ -69,7 +68,7 @@ var disabledButtonStyle = function disabledButtonStyle(props) {
|
|
|
69
68
|
};
|
|
70
69
|
|
|
71
70
|
// Deprecate props.theme.button.disabled.opacity in V3
|
|
72
|
-
var StyledButton = styled.button.withConfig(styledComponentsConfig).
|
|
71
|
+
var StyledButton = styled.button.withConfig(styledComponentsConfig).withConfig({
|
|
73
72
|
displayName: "StyledButton",
|
|
74
73
|
componentId: "sc-323bzc-0"
|
|
75
74
|
})(["display:inline-block;box-sizing:border-box;cursor:pointer;font:inherit;text-decoration:none;margin:0;background:transparent;overflow:visible;text-transform:none;", " ", " ", " ", " ", " ", " ", " &:focus{", "}&:focus:not(:focus-visible){", "}", " ", " ", " ", " ", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import isPropValid from '@emotion/is-prop-valid';
|
|
3
3
|
import { activeStyle, disabledStyle, edgeStyle, focusStyle, unfocusStyle, genericStyles, kindPartStyles, parseMetricToNum } from '../../utils';
|
|
4
|
-
import { withTheme } from '../../default-props';
|
|
5
4
|
var radiusStyle = function radiusStyle(props) {
|
|
6
5
|
var size = props.sizeProp;
|
|
7
6
|
// caller has specified a themeObj to use for styling
|
|
@@ -165,7 +164,7 @@ var fillStyle = function fillStyle(fillContainer) {
|
|
|
165
164
|
var plainStyle = function plainStyle(props) {
|
|
166
165
|
return css(["outline:none;border:none;padding:0;text-align:inherit;color:inherit;", " ", ""], props.icon && "\n > svg {\n display: flex;\n align-self: center;\n vertical-align: middle;\n }\n ", props.hasIcon && !props.hasLabel && "line-height: 0;");
|
|
167
166
|
};
|
|
168
|
-
var StyledButtonKind = styled.button.
|
|
167
|
+
var StyledButtonKind = styled.button.withConfig({
|
|
169
168
|
shouldForwardProp: function shouldForwardProp(prop) {
|
|
170
169
|
return isPropValid(prop) && !['kind'].includes(prop);
|
|
171
170
|
}
|
|
@@ -164,20 +164,22 @@ var CalendarDay = function CalendarDay(_ref) {
|
|
|
164
164
|
otherMonth = _ref.otherMonth,
|
|
165
165
|
_ref$buttonProps = _ref.buttonProps,
|
|
166
166
|
buttonProps = _ref$buttonProps === void 0 ? {} : _ref$buttonProps;
|
|
167
|
+
var _useThemeValue = useThemeValue(),
|
|
168
|
+
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
167
169
|
return /*#__PURE__*/React.createElement(StyledDayContainer, {
|
|
168
170
|
role: "gridcell",
|
|
169
171
|
sizeProp: size,
|
|
170
172
|
fillContainer: fill
|
|
171
173
|
}, /*#__PURE__*/React.createElement(CalendarDayButton, _extends({
|
|
172
174
|
fill: fill
|
|
173
|
-
}, buttonProps), /*#__PURE__*/React.createElement(StyledDay, {
|
|
175
|
+
}, buttonProps), /*#__PURE__*/React.createElement(StyledDay, _extends({
|
|
174
176
|
disabledProp: buttonProps.disabled,
|
|
175
177
|
inRange: isInRange,
|
|
176
178
|
otherMonth: otherMonth,
|
|
177
179
|
isSelected: isSelected,
|
|
178
180
|
sizeProp: size,
|
|
179
181
|
fillContainer: fill
|
|
180
|
-
}, children)));
|
|
182
|
+
}, passThemeFlag), children)));
|
|
181
183
|
};
|
|
182
184
|
var CalendarCustomDay = function CalendarCustomDay(_ref2) {
|
|
183
185
|
var children = _ref2.children,
|
|
@@ -227,7 +229,9 @@ var Calendar = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
227
229
|
size = _ref3$size === void 0 ? 'medium' : _ref3$size,
|
|
228
230
|
timestampProp = _ref3.timestamp,
|
|
229
231
|
rest = _objectWithoutPropertiesLoose(_ref3, _excluded);
|
|
230
|
-
var
|
|
232
|
+
var _useThemeValue2 = useThemeValue(),
|
|
233
|
+
theme = _useThemeValue2.theme,
|
|
234
|
+
passThemeFlag = _useThemeValue2.passThemeFlag;
|
|
231
235
|
var announce = useContext(AnnounceContext);
|
|
232
236
|
var _useContext = useContext(MessageContext),
|
|
233
237
|
format = _useContext.format;
|
|
@@ -715,7 +719,7 @@ var Calendar = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
715
719
|
ref: ref,
|
|
716
720
|
sizeProp: size,
|
|
717
721
|
fillContainer: fill
|
|
718
|
-
}, rest), /*#__PURE__*/React.createElement(Box, {
|
|
722
|
+
}, passThemeFlag, rest), /*#__PURE__*/React.createElement(Box, {
|
|
719
723
|
fill: fill
|
|
720
724
|
}, header ? header({
|
|
721
725
|
date: reference,
|
|
@@ -780,7 +784,7 @@ var Calendar = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
780
784
|
changeReference(active);
|
|
781
785
|
}
|
|
782
786
|
}
|
|
783
|
-
}, /*#__PURE__*/React.createElement(StyledWeeksContainer, {
|
|
787
|
+
}, /*#__PURE__*/React.createElement(StyledWeeksContainer, _extends({
|
|
784
788
|
tabIndex: 0,
|
|
785
789
|
role: "grid",
|
|
786
790
|
"aria-label": reference.toLocaleDateString(locale, {
|
|
@@ -802,11 +806,11 @@ var Calendar = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
802
806
|
setFocus(false);
|
|
803
807
|
setActive(undefined);
|
|
804
808
|
}
|
|
805
|
-
}, /*#__PURE__*/React.createElement(StyledWeeks, {
|
|
809
|
+
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledWeeks, _extends({
|
|
806
810
|
slide: slide,
|
|
807
811
|
sizeProp: size,
|
|
808
812
|
fillContainer: fill
|
|
809
|
-
}, weeks)))));
|
|
813
|
+
}, passThemeFlag), weeks)))));
|
|
810
814
|
});
|
|
811
815
|
Calendar.displayName = 'Calendar';
|
|
812
816
|
Calendar.propTypes = CalendarPropTypes;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import styled, { css, keyframes } from 'styled-components';
|
|
2
2
|
import { backgroundStyle, focusStyle, genericStyles, kindPartStyles, parseMetricToNum, styledComponentsConfig } from '../../utils';
|
|
3
|
-
import { withTheme } from '../../default-props';
|
|
4
3
|
var sizeStyle = function sizeStyle(props) {
|
|
5
4
|
var data = props.theme.calendar[props.sizeProp];
|
|
6
5
|
var width = props.fillContainer ? '100%' : props.theme.global.size[props.sizeProp];
|
|
@@ -8,7 +7,7 @@ var sizeStyle = function sizeStyle(props) {
|
|
|
8
7
|
return p.fillContainer && 'height: 100%;';
|
|
9
8
|
});
|
|
10
9
|
};
|
|
11
|
-
var StyledCalendar = styled.div.withConfig(styledComponentsConfig).
|
|
10
|
+
var StyledCalendar = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
12
11
|
displayName: "StyledCalendar",
|
|
13
12
|
componentId: "sc-1y4xhmp-0"
|
|
14
13
|
})(["", " ", " ", ""], genericStyles, function (props) {
|
|
@@ -20,7 +19,7 @@ var weeksContainerSizeStyle = function weeksContainerSizeStyle(props) {
|
|
|
20
19
|
var height = props.fillContainer ? '100%' : parseMetricToNum(props.theme.calendar[props.sizeProp].daySize) * 6 + "px";
|
|
21
20
|
return "\n height: " + height + ";\n\n ";
|
|
22
21
|
};
|
|
23
|
-
var StyledWeeksContainer = styled.div.withConfig(styledComponentsConfig).
|
|
22
|
+
var StyledWeeksContainer = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
24
23
|
displayName: "StyledCalendar__StyledWeeksContainer",
|
|
25
24
|
componentId: "sc-1y4xhmp-1"
|
|
26
25
|
})(["overflow:hidden;", " ", ";"], function (props) {
|
|
@@ -46,7 +45,7 @@ var slideStyle = function slideStyle(props) {
|
|
|
46
45
|
var weeksSizeStyle = function weeksSizeStyle() {
|
|
47
46
|
return css(["display:flex;flex-direction:column;height:100%;"]);
|
|
48
47
|
};
|
|
49
|
-
var StyledWeeks = styled.div.withConfig(styledComponentsConfig).
|
|
48
|
+
var StyledWeeks = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
50
49
|
displayName: "StyledCalendar__StyledWeeks",
|
|
51
50
|
componentId: "sc-1y4xhmp-2"
|
|
52
51
|
})(["position:relative;", " ", ";"], function (props) {
|
|
@@ -73,7 +72,7 @@ var daySizeStyle = function daySizeStyle(props) {
|
|
|
73
72
|
var data = props.theme.calendar[props.sizeProp];
|
|
74
73
|
return css(["width:", ";height:", ";"], props.fillContainer ? '100%' : data.daySize, props.fillContainer ? '100%' : data.daySize);
|
|
75
74
|
};
|
|
76
|
-
var StyledDay = styled.div.withConfig(styledComponentsConfig).
|
|
75
|
+
var StyledDay = styled.div.withConfig(styledComponentsConfig).withConfig({
|
|
77
76
|
displayName: "StyledCalendar__StyledDay",
|
|
78
77
|
componentId: "sc-1y4xhmp-5"
|
|
79
78
|
})(["display:flex;justify-content:center;align-items:center;", " ", " ", " ", " ", " ", ""], function (props) {
|
|
@@ -6,7 +6,8 @@ import { useThemeValue } from '../../utils/useThemeValue';
|
|
|
6
6
|
var Card = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
7
7
|
var _theme$card$hover;
|
|
8
8
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
9
|
-
var
|
|
9
|
+
var _useThemeValue = useThemeValue(),
|
|
10
|
+
theme = _useThemeValue.theme;
|
|
10
11
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
11
12
|
overflow: "hidden",
|
|
12
13
|
kind: _extends({
|
|
@@ -5,7 +5,8 @@ import { Box } from '../Box';
|
|
|
5
5
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
6
6
|
var CardBody = function CardBody(_ref) {
|
|
7
7
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
8
|
-
var
|
|
8
|
+
var _useThemeValue = useThemeValue(),
|
|
9
|
+
theme = _useThemeValue.theme;
|
|
9
10
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
10
11
|
flex: true
|
|
11
12
|
}, theme.card.body, rest));
|