grommet 2.48.0 → 2.50.0
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 +3 -6
- package/components/Anchor/StyledAnchor.js +1 -1
- package/components/Box/StyledBox.js +1 -1
- package/components/Button/BusyAnimation.js +5 -1
- package/components/Button/Button.js +3 -1
- package/components/Calendar/Calendar.js +7 -10
- package/components/Cards/Cards.js +3 -4
- package/components/Chart/Chart.js +11 -9
- package/components/Chart/calcs.js +21 -13
- package/components/CheckBox/CheckBox.js +1 -1
- package/components/CheckBoxGroup/CheckBoxGroup.js +2 -3
- package/components/Data/Data.js +5 -1
- package/components/Data/DataForm.js +6 -4
- package/components/Data/stories/Infinite.stories.js +10 -15
- package/components/Data/stories/OnSelect.stories.js +10 -15
- package/components/Data/stories/SpaceX.stories.js +10 -15
- package/components/Data/stories/StarWars.stories.js +6 -8
- package/components/DataChart/DataChart.js +14 -12
- package/components/DataChart/Detail.js +2 -2
- package/components/DataChart/Legend.js +8 -9
- package/components/DataChart/utils.js +15 -8
- package/components/DataFilter/DataFilter.js +10 -9
- package/components/DataFilters/DataFilters.js +9 -10
- package/components/DataSearch/DataSearch.js +5 -4
- package/components/DataSort/DataSort.js +4 -3
- package/components/DataSummary/DataSummary.js +6 -6
- package/components/DataTable/ExpanderCell.js +6 -3
- package/components/DataTable/Footer.js +6 -3
- package/components/DataTable/Header.js +6 -3
- package/components/DataTable/Resizer.js +22 -8
- package/components/DataTable/Searcher.js +5 -7
- package/components/DataTable/stories/ResizePinned.stories.js +321 -0
- package/components/DataTable/stories/SpaceX.stories.js +15 -16
- package/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
- package/components/DataTable/stories/rowDetails.stories.js +6 -8
- package/components/DataTableColumns/DataTableColumns.js +24 -22
- package/components/DateInput/DateInput.js +7 -6
- package/components/Distribution/Distribution.js +8 -5
- package/components/FileInput/FileInput.js +41 -36
- package/components/Footer/Footer.js +5 -1
- package/components/Header/Header.js +2 -2
- package/components/Layer/Layer.js +10 -5
- package/components/Layer/StyledLayer.js +2 -2
- package/components/List/List.js +5 -4
- package/components/MaskedInput/MaskedInput.js +6 -1
- package/components/Menu/Menu.js +13 -1
- package/components/Meter/Bar.js +38 -17
- package/components/Meter/Circle.js +31 -46
- package/components/Meter/stories/Circle.stories.js +6 -8
- package/components/Meter/utils.js +15 -1
- package/components/Nav/Nav.js +5 -1
- package/components/Notification/Notification.js +6 -8
- package/components/Pagination/Pagination.js +5 -10
- package/components/Pagination/PaginationStep.js +2 -1
- package/components/Paragraph/ParagraphSkeleton.js +2 -1
- package/components/RadioButton/RadioButton.js +1 -1
- package/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
- package/components/RangeSelector/RangeSelector.js +2 -6
- package/components/Select/SelectContainer.js +2 -1
- package/components/SelectMultiple/SelectMultipleContainer.js +8 -4
- package/components/SelectMultiple/SelectMultipleValue.js +5 -7
- package/components/SelectMultiple/SelectionSummary.js +7 -8
- package/components/Sidebar/Sidebar.js +6 -3
- package/components/Spinner/Spinner.js +7 -4
- package/components/StarRating/StarRating.js +8 -5
- package/components/Tab/Tab.js +2 -1
- package/components/Table/StyledTable.js +2 -2
- package/components/Tabs/Tabs.js +8 -12
- package/components/Tag/StyledTag.js +9 -1
- package/components/TextInput/CopyButton.js +3 -2
- package/components/TextInput/TextInput.js +5 -0
- package/components/ThumbsRating/ThumbsRating.js +15 -10
- package/components/Toolbar/Toolbar.js +15 -11
- package/components/Video/Video.js +3 -5
- package/es6/components/AccordionPanel/AccordionPanel.js +3 -6
- package/es6/components/Anchor/StyledAnchor.js +2 -2
- package/es6/components/Box/StyledBox.js +1 -1
- package/es6/components/Button/BusyAnimation.js +5 -1
- package/es6/components/Button/Button.js +3 -1
- package/es6/components/Calendar/Calendar.js +7 -10
- package/es6/components/Cards/Cards.js +3 -4
- package/es6/components/Chart/Chart.js +11 -9
- package/es6/components/Chart/calcs.js +21 -13
- package/es6/components/CheckBox/CheckBox.js +1 -1
- package/es6/components/CheckBoxGroup/CheckBoxGroup.js +2 -3
- package/es6/components/Data/Data.js +5 -1
- package/es6/components/Data/DataForm.js +6 -4
- package/es6/components/Data/stories/Infinite.stories.js +10 -15
- package/es6/components/Data/stories/OnSelect.stories.js +10 -15
- package/es6/components/Data/stories/SpaceX.stories.js +10 -15
- package/es6/components/Data/stories/StarWars.stories.js +6 -8
- package/es6/components/DataChart/DataChart.js +14 -12
- package/es6/components/DataChart/Detail.js +2 -2
- package/es6/components/DataChart/Legend.js +8 -9
- package/es6/components/DataChart/utils.js +15 -8
- package/es6/components/DataFilter/DataFilter.js +10 -9
- package/es6/components/DataFilters/DataFilters.js +9 -10
- package/es6/components/DataSearch/DataSearch.js +5 -4
- package/es6/components/DataSort/DataSort.js +4 -3
- package/es6/components/DataSummary/DataSummary.js +6 -6
- package/es6/components/DataTable/ExpanderCell.js +4 -1
- package/es6/components/DataTable/Footer.js +4 -1
- package/es6/components/DataTable/Header.js +6 -3
- package/es6/components/DataTable/Resizer.js +22 -8
- package/es6/components/DataTable/Searcher.js +5 -7
- package/es6/components/DataTable/stories/ResizePinned.stories.js +316 -0
- package/es6/components/DataTable/stories/SpaceX.stories.js +15 -16
- package/es6/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
- package/es6/components/DataTable/stories/rowDetails.stories.js +6 -8
- package/es6/components/DataTableColumns/DataTableColumns.js +23 -21
- package/es6/components/DateInput/DateInput.js +6 -5
- package/es6/components/Distribution/Distribution.js +8 -5
- package/es6/components/FileInput/FileInput.js +42 -37
- package/es6/components/Footer/Footer.js +5 -1
- package/es6/components/Header/Header.js +2 -2
- package/es6/components/Layer/Layer.js +10 -5
- package/es6/components/Layer/StyledLayer.js +3 -3
- package/es6/components/List/List.js +5 -4
- package/es6/components/MaskedInput/MaskedInput.js +6 -1
- package/es6/components/Menu/Menu.js +13 -1
- package/es6/components/Meter/Bar.js +39 -18
- package/es6/components/Meter/Circle.js +33 -48
- package/es6/components/Meter/stories/Circle.stories.js +7 -9
- package/es6/components/Meter/utils.js +14 -0
- package/es6/components/Nav/Nav.js +5 -1
- package/es6/components/Notification/Notification.js +6 -8
- package/es6/components/Pagination/Pagination.js +5 -10
- package/es6/components/Pagination/PaginationStep.js +2 -1
- package/es6/components/Paragraph/ParagraphSkeleton.js +2 -1
- package/es6/components/RadioButton/RadioButton.js +1 -1
- package/es6/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
- package/es6/components/RangeSelector/RangeSelector.js +2 -6
- package/es6/components/Select/SelectContainer.js +2 -1
- package/es6/components/SelectMultiple/SelectMultipleContainer.js +8 -4
- package/es6/components/SelectMultiple/SelectMultipleValue.js +5 -7
- package/es6/components/SelectMultiple/SelectionSummary.js +7 -8
- package/es6/components/Sidebar/Sidebar.js +6 -3
- package/es6/components/Spinner/Spinner.js +6 -3
- package/es6/components/StarRating/StarRating.js +8 -5
- package/es6/components/Tab/Tab.js +2 -1
- package/es6/components/Table/StyledTable.js +2 -2
- package/es6/components/Tabs/Tabs.js +8 -12
- package/es6/components/Tag/StyledTag.js +10 -2
- package/es6/components/TextInput/CopyButton.js +3 -2
- package/es6/components/TextInput/TextInput.js +5 -0
- package/es6/components/ThumbsRating/ThumbsRating.js +15 -10
- package/es6/components/Toolbar/Toolbar.js +15 -11
- package/es6/components/Video/Video.js +3 -5
- package/es6/themes/base.d.ts +284 -4
- package/es6/themes/base.js +369 -21
- package/es6/utils/graphics.js +123 -0
- package/grommet.min.js +1 -1
- package/grommet.min.js.map +1 -1
- package/package.json +46 -46
- package/themes/base.d.ts +284 -4
- package/themes/base.js +369 -21
- package/utils/graphics.js +124 -1
|
@@ -3,11 +3,12 @@ var _excluded = ["background", "max", "round", "size", "thickness", "type", "val
|
|
|
3
3
|
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); }
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
5
5
|
import React, { forwardRef } from 'react';
|
|
6
|
-
import { arcCommands, parseMetricToNum, translateEndAngle } from '../../utils';
|
|
6
|
+
import { arcCommands, wedgeCommands, parseMetricToNum, translateEndAngle } from '../../utils';
|
|
7
7
|
import { StyledMeter } from './StyledMeter';
|
|
8
|
-
import { strokeProps, defaultColor } from './utils';
|
|
8
|
+
import { strokeProps, defaultColor, fillProps } from './utils';
|
|
9
9
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
10
10
|
var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
11
|
+
var _theme$meter$gap, _theme$meter;
|
|
11
12
|
var background = props.background,
|
|
12
13
|
max = props.max,
|
|
13
14
|
round = props.round,
|
|
@@ -20,7 +21,7 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
20
21
|
theme = _useThemeValue.theme,
|
|
21
22
|
passThemeFlag = _useThemeValue.passThemeFlag;
|
|
22
23
|
var width = size === 'full' ? 288 : parseMetricToNum(theme.global.size[size] || size);
|
|
23
|
-
var strokeWidth = type === 'pie' ? width / 2 : parseMetricToNum(theme.global.edgeSize[thickness] || thickness);
|
|
24
|
+
var strokeWidth = type === 'pie' ? width / 2 : Math.min(width / 2 - 8, parseMetricToNum(theme.global.edgeSize[thickness] || thickness));
|
|
24
25
|
var centerX = width / 2;
|
|
25
26
|
var centerY = width / 2;
|
|
26
27
|
var radius = width / 2 - strokeWidth / 2;
|
|
@@ -30,17 +31,22 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
30
31
|
var scalePower = Math.max(5, Math.ceil(Math.log10(max)) + 3);
|
|
31
32
|
var scale = Math.pow(10, scalePower);
|
|
32
33
|
var anglePer = Math.floor((type === 'semicircle' ? 180 : 360) / max * scale) / scale;
|
|
33
|
-
// (type === 'semicircle' ? 180 : 360) / max;
|
|
34
34
|
var someHighlight = (values || []).some(function (v) {
|
|
35
35
|
return v.highlight;
|
|
36
36
|
});
|
|
37
|
+
var gapTheme = (_theme$meter$gap = (_theme$meter = theme.meter) == null ? void 0 : _theme$meter.gap) != null ? _theme$meter$gap : '0';
|
|
38
|
+
var gap = parseMetricToNum(theme.global.edgeSize[gapTheme] || gapTheme);
|
|
39
|
+
var isSemi = type === 'semicircle';
|
|
40
|
+
var isFull = values.reduce(function (total, currentValue) {
|
|
41
|
+
return total + currentValue.value;
|
|
42
|
+
}, 0) >= max;
|
|
37
43
|
var startValue = 0;
|
|
38
|
-
var startAngle =
|
|
44
|
+
var startAngle = isSemi ? 270 : 0;
|
|
39
45
|
var paths = [];
|
|
40
|
-
var pathCaps = [];
|
|
41
46
|
(values || []).filter(function (v) {
|
|
42
47
|
return v.value > 0;
|
|
43
|
-
}).forEach(function (valueArg, index) {
|
|
48
|
+
}).forEach(function (valueArg, index, _ref) {
|
|
49
|
+
var length = _ref.length;
|
|
44
50
|
var color = valueArg.color,
|
|
45
51
|
highlight = valueArg.highlight,
|
|
46
52
|
label = valueArg.label,
|
|
@@ -51,7 +57,7 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
51
57
|
var colorName = color || defaultColor(index, theme, values ? values.length : 0);
|
|
52
58
|
var endAngle;
|
|
53
59
|
if (startValue + value >= max) {
|
|
54
|
-
endAngle =
|
|
60
|
+
endAngle = isSemi ? 90 : 360;
|
|
55
61
|
} else {
|
|
56
62
|
endAngle = translateEndAngle(startAngle, anglePer, value);
|
|
57
63
|
}
|
|
@@ -67,46 +73,25 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
67
73
|
};
|
|
68
74
|
}
|
|
69
75
|
var stroke = strokeProps(someHighlight && !highlight ? background : colorName, theme);
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
key: key,
|
|
74
|
-
d: d1,
|
|
75
|
-
fill: "none"
|
|
76
|
-
}, stroke, {
|
|
77
|
-
strokeWidth: strokeWidth,
|
|
78
|
-
strokeLinecap: "round"
|
|
79
|
-
}, hoverProps, pathRest)));
|
|
76
|
+
var fill = fillProps(someHighlight && !highlight ? background : colorName, theme);
|
|
77
|
+
var outerRadius = width / 2;
|
|
78
|
+
var innerRadius = type === 'pie' ? 0 : width / 2 - strokeWidth;
|
|
80
79
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
pathCaps = [];
|
|
97
|
-
}
|
|
98
|
-
pathCaps.unshift(pathCap);
|
|
99
|
-
} else {
|
|
100
|
-
var d = arcCommands(centerX, centerY, radius, startAngle, endAngle);
|
|
101
|
-
paths.push(/*#__PURE__*/React.createElement("path", _extends({
|
|
102
|
-
key: key,
|
|
103
|
-
d: d,
|
|
104
|
-
fill: "none"
|
|
105
|
-
}, stroke, {
|
|
106
|
-
strokeWidth: strokeWidth,
|
|
107
|
-
strokeLinecap: "butt"
|
|
108
|
-
}, hoverProps, pathRest)));
|
|
109
|
-
}
|
|
80
|
+
// We want a start gap if there's another segment before this one.
|
|
81
|
+
// A circle's last segment can bump against the first segment if at max.
|
|
82
|
+
var startGap = index === 0 && (isSemi || length === 1 || length > 1 && !isFull) ? 0 : gap / 2;
|
|
83
|
+
|
|
84
|
+
// Similarly, we only need an end gap if there's a segment after this one.
|
|
85
|
+
var endGap = index === length - 1 && (isSemi || length === 1) ? 0 : -gap / 2;
|
|
86
|
+
var startRound = index === 0 && isSemi ? false : round;
|
|
87
|
+
var d = wedgeCommands(centerX, centerY, outerRadius, innerRadius, startAngle, endAngle, startGap, endGap, startRound, round, index === 0 ? 1 : 0);
|
|
88
|
+
paths.push(/*#__PURE__*/React.createElement("path", _extends({
|
|
89
|
+
key: key,
|
|
90
|
+
d: d
|
|
91
|
+
}, fill, stroke, {
|
|
92
|
+
strokeWidth: 0,
|
|
93
|
+
strokeLinecap: "butt"
|
|
94
|
+
}, hoverProps, pathRest)));
|
|
110
95
|
startValue += value;
|
|
111
96
|
startAngle = endAngle;
|
|
112
97
|
});
|
|
@@ -137,7 +122,7 @@ var Circle = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
137
122
|
viewBox: "0 0 " + width + " " + viewBoxHeight,
|
|
138
123
|
width: size === 'full' ? '100%' : width,
|
|
139
124
|
height: size === 'full' ? '100%' : viewBoxHeight
|
|
140
|
-
}, passThemeFlag, rest), track, paths
|
|
125
|
+
}, passThemeFlag, rest), track, paths);
|
|
141
126
|
});
|
|
142
127
|
Circle.displayName = 'Circle';
|
|
143
128
|
export { Circle };
|
|
@@ -1,19 +1,17 @@
|
|
|
1
|
-
import React, { useState, useEffect
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
|
2
2
|
import { Box, Meter } from 'grommet';
|
|
3
3
|
export var Circle = function Circle() {
|
|
4
4
|
var _useState = useState(20),
|
|
5
5
|
value = _useState[0],
|
|
6
6
|
setValue = _useState[1];
|
|
7
|
-
var timer = useRef();
|
|
8
|
-
clearTimeout(timer.current);
|
|
9
|
-
timer.current = setTimeout(function () {
|
|
10
|
-
setValue(value < 100 ? value + 8 : 20);
|
|
11
|
-
}, 2000);
|
|
12
7
|
useEffect(function () {
|
|
8
|
+
var interval = setInterval(function () {
|
|
9
|
+
setValue(value < 60 ? value + 8 : 20);
|
|
10
|
+
}, 2000);
|
|
13
11
|
return function () {
|
|
14
|
-
|
|
12
|
+
return clearInterval(interval);
|
|
15
13
|
};
|
|
16
|
-
}, []);
|
|
14
|
+
}, [value]);
|
|
17
15
|
return (
|
|
18
16
|
/*#__PURE__*/
|
|
19
17
|
// Uncomment <Grommet> lines when using outside of storybook
|
|
@@ -26,7 +24,7 @@ export var Circle = function Circle() {
|
|
|
26
24
|
background: "light-2",
|
|
27
25
|
values: [{
|
|
28
26
|
value: value,
|
|
29
|
-
color: value > 50 ? '
|
|
27
|
+
color: value > 50 ? 'status-critical' : 'status-ok'
|
|
30
28
|
}]
|
|
31
29
|
}))
|
|
32
30
|
// </Grommet>
|
|
@@ -13,6 +13,20 @@ export var strokeProps = function strokeProps(color, theme) {
|
|
|
13
13
|
}
|
|
14
14
|
return result;
|
|
15
15
|
};
|
|
16
|
+
export var fillProps = function fillProps(color, theme) {
|
|
17
|
+
var result = {};
|
|
18
|
+
if (color) {
|
|
19
|
+
if (typeof color === 'object') {
|
|
20
|
+
result.fill = normalizeColor(color.color, theme);
|
|
21
|
+
if (color.opacity) {
|
|
22
|
+
result.fillOpacity = "" + (color.opacity === true ? theme.global.opacity.medium : theme.global.opacity[color.opacity] || color.opacity);
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
result.fill = normalizeColor(color, theme);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
16
30
|
var neutralExp = /^neutral-\d+/;
|
|
17
31
|
export var defaultColor = function defaultColor(index, theme, valuesLength) {
|
|
18
32
|
if (index === valuesLength - 1 && theme.meter.color) {
|
|
@@ -2,12 +2,16 @@ function _objectDestructuringEmpty(t) { if (null == t) throw new TypeError("Cann
|
|
|
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
|
import React from 'react';
|
|
4
4
|
import { Box } from '../Box';
|
|
5
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
5
6
|
var Nav = function Nav(_ref) {
|
|
7
|
+
var _theme$nav;
|
|
6
8
|
var rest = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
9
|
+
var _useThemeValue = useThemeValue(),
|
|
10
|
+
theme = _useThemeValue.theme;
|
|
7
11
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
8
12
|
as: "nav",
|
|
9
13
|
flex: false,
|
|
10
|
-
gap:
|
|
14
|
+
gap: (_theme$nav = theme.nav) == null ? void 0 : _theme$nav.gap
|
|
11
15
|
}, rest));
|
|
12
16
|
};
|
|
13
17
|
export { Nav };
|
|
@@ -68,7 +68,7 @@ var NotificationAnchor = styled(Anchor).withConfig({
|
|
|
68
68
|
componentId: "sc-1yq09yz-0"
|
|
69
69
|
})(["white-space:nowrap;"]);
|
|
70
70
|
var Notification = function Notification(_ref2) {
|
|
71
|
-
var _theme$notification6, _theme$notification7, _theme$notification8, _theme$notification9, _theme$notification0;
|
|
71
|
+
var _theme$notification6, _theme$notification7, _theme$notification8, _theme$notification9, _theme$notification0, _theme$notification1;
|
|
72
72
|
var actionsProp = _ref2.actions,
|
|
73
73
|
messageProp = _ref2.message,
|
|
74
74
|
messages = _ref2.messages,
|
|
@@ -149,25 +149,23 @@ var Notification = function Notification(_ref2) {
|
|
|
149
149
|
var messageColor = getTextColor('message', status, kind, theme);
|
|
150
150
|
var titleColor = getTextColor('title', status, kind, theme);
|
|
151
151
|
if (actionsProp) actions = actionsProp.map(function (action) {
|
|
152
|
+
var _theme$notification$a;
|
|
152
153
|
return /*#__PURE__*/React.createElement(Fragment, {
|
|
153
154
|
key: action.label
|
|
154
155
|
}, /*#__PURE__*/React.createElement(NotificationAnchor
|
|
155
156
|
// create space between first anchor and
|
|
156
157
|
// text content and next anchor
|
|
157
158
|
, _extends({
|
|
158
|
-
margin:
|
|
159
|
-
right: 'xsmall'
|
|
160
|
-
}
|
|
159
|
+
margin: (_theme$notification$a = theme.notification.actions) == null ? void 0 : _theme$notification$a.margin
|
|
161
160
|
}, action, theme.notification.actions)), ' ');
|
|
162
161
|
});
|
|
163
162
|
if (message || actions) {
|
|
163
|
+
var _theme$notification$m;
|
|
164
164
|
message = typeof message === 'string' ? /*#__PURE__*/React.createElement(Message, _extends({}, theme.notification.message, {
|
|
165
165
|
color: messageColor,
|
|
166
166
|
direction: direction
|
|
167
167
|
}), /*#__PURE__*/React.createElement(Text, {
|
|
168
|
-
margin:
|
|
169
|
-
right: 'xsmall'
|
|
170
|
-
}
|
|
168
|
+
margin: (_theme$notification$m = theme.notification.message) == null || (_theme$notification$m = _theme$notification$m.text) == null ? void 0 : _theme$notification$m.margin
|
|
171
169
|
}, message), actions) : message;
|
|
172
170
|
}
|
|
173
171
|
var iconDimension = ((_theme$notification0 = theme.notification) == null || (_theme$notification0 = _theme$notification0.message) == null ? void 0 : _theme$notification0.size) || 'medium';
|
|
@@ -177,7 +175,7 @@ var Notification = function Notification(_ref2) {
|
|
|
177
175
|
,
|
|
178
176
|
pad: undefined,
|
|
179
177
|
direction: "row",
|
|
180
|
-
gap:
|
|
178
|
+
gap: (_theme$notification1 = theme.notification) == null ? void 0 : _theme$notification1.gap,
|
|
181
179
|
id: toast ? undefined : id
|
|
182
180
|
}, rest), /*#__PURE__*/React.createElement(Box, {
|
|
183
181
|
direction: "row",
|
|
@@ -25,7 +25,7 @@ var getPageIndices = function getPageIndices(begin, end) {
|
|
|
25
25
|
return indices;
|
|
26
26
|
};
|
|
27
27
|
var Pagination = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
28
|
-
var _ref2;
|
|
28
|
+
var _ref2, _theme$pagination$con;
|
|
29
29
|
var a11yTitle = _ref.a11yTitle,
|
|
30
30
|
ariaLabel = _ref['aria-label'],
|
|
31
31
|
numberItems = _ref.numberItems,
|
|
@@ -201,14 +201,12 @@ var Pagination = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
201
201
|
// for backwards compatibility
|
|
202
202
|
if (!summary && !stepOptions) return /*#__PURE__*/React.createElement(StyledPaginationContainer, _extends({
|
|
203
203
|
flex: false
|
|
204
|
-
}, theme.pagination.container,
|
|
204
|
+
}, _extends({}, theme.pagination.container, {
|
|
205
|
+
gap: undefined
|
|
206
|
+
}), passThemeFlag, rest), paginationControls);
|
|
205
207
|
return /*#__PURE__*/React.createElement(StyledPaginationContainer, _extends({
|
|
206
208
|
direction: "row",
|
|
207
209
|
align: "center",
|
|
208
|
-
gap: {
|
|
209
|
-
column: 'xsmall',
|
|
210
|
-
row: 'small'
|
|
211
|
-
},
|
|
212
210
|
wrap: true,
|
|
213
211
|
flex: false
|
|
214
212
|
}, theme.pagination.container, passThemeFlag, rest), /*#__PURE__*/React.createElement(Box, {
|
|
@@ -221,10 +219,7 @@ var Pagination = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
221
219
|
})), /*#__PURE__*/React.createElement(Box, {
|
|
222
220
|
align: "center",
|
|
223
221
|
direction: "row",
|
|
224
|
-
gap:
|
|
225
|
-
column: 'xsmall',
|
|
226
|
-
row: 'small'
|
|
227
|
-
},
|
|
222
|
+
gap: (_theme$pagination$con = theme.pagination.container) == null ? void 0 : _theme$pagination$con.gap,
|
|
228
223
|
wrap: true
|
|
229
224
|
}, stepOptions && /*#__PURE__*/React.createElement(PaginationStep, {
|
|
230
225
|
messages: messages,
|
|
@@ -8,6 +8,7 @@ import { Text } from '../Text';
|
|
|
8
8
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
9
9
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
10
10
|
export var PaginationStep = function PaginationStep(_ref) {
|
|
11
|
+
var _theme$pagination;
|
|
11
12
|
var messages = _ref.messages,
|
|
12
13
|
onChange = _ref.onChange,
|
|
13
14
|
_ref$options = _ref.options,
|
|
@@ -21,7 +22,7 @@ export var PaginationStep = function PaginationStep(_ref) {
|
|
|
21
22
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
22
23
|
direction: "row",
|
|
23
24
|
align: "center",
|
|
24
|
-
gap:
|
|
25
|
+
gap: (_theme$pagination = theme.pagination) == null || (_theme$pagination = _theme$pagination.step) == null || (_theme$pagination = _theme$pagination.container) == null ? void 0 : _theme$pagination.gap
|
|
25
26
|
}, rest), /*#__PURE__*/React.createElement(Text, null, formatMessage({
|
|
26
27
|
id: 'pagination.stepLabel',
|
|
27
28
|
messages: messages
|
|
@@ -3,6 +3,7 @@ import { Skeleton } from '../Skeleton';
|
|
|
3
3
|
import { Box } from '../Box';
|
|
4
4
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
5
5
|
var ParagraphSkeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
6
|
+
var _theme$paragraph;
|
|
6
7
|
var fill = _ref.fill,
|
|
7
8
|
sizeProp = _ref.size;
|
|
8
9
|
var _useThemeValue = useThemeValue(),
|
|
@@ -12,7 +13,7 @@ var ParagraphSkeleton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
12
13
|
var height = data ? data.size : size;
|
|
13
14
|
return /*#__PURE__*/React.createElement(Box, {
|
|
14
15
|
ref: ref,
|
|
15
|
-
gap:
|
|
16
|
+
gap: (_theme$paragraph = theme.paragraph) == null || (_theme$paragraph = _theme$paragraph.skeleton) == null ? void 0 : _theme$paragraph.gap,
|
|
16
17
|
width: {
|
|
17
18
|
max: fill ? 'none' : data && data.maxWidth
|
|
18
19
|
}
|
|
@@ -69,7 +69,7 @@ var RadioButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
69
69
|
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledRadioButton, _extends({
|
|
70
70
|
flex: false,
|
|
71
71
|
margin: label ? {
|
|
72
|
-
right: theme.radioButton.gap
|
|
72
|
+
right: theme.radioButton.gap
|
|
73
73
|
} : undefined
|
|
74
74
|
}, passThemeFlag), /*#__PURE__*/React.createElement(StyledRadioButtonInput, _extends({
|
|
75
75
|
"aria-label": a11yTitle
|
|
@@ -10,7 +10,7 @@ import { RadioButton } from '../RadioButton';
|
|
|
10
10
|
import { RadioButtonGroupPropTypes } from './propTypes';
|
|
11
11
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
12
12
|
var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
13
|
-
var _formContext$useFormF;
|
|
13
|
+
var _formContext$useFormF, _theme$radioButtonGro;
|
|
14
14
|
var ariaLabelProp = _ref['aria-label'],
|
|
15
15
|
ariaLabelledByProp = _ref['aria-labelledby'],
|
|
16
16
|
children = _ref.children,
|
|
@@ -119,7 +119,7 @@ var RadioButtonGroup = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
119
119
|
ref: ref,
|
|
120
120
|
role: "radiogroup"
|
|
121
121
|
}, theme.radioButtonGroup.container, {
|
|
122
|
-
gap: gap || (
|
|
122
|
+
gap: gap || ((_theme$radioButtonGro = theme.radioButtonGroup.container) == null ? void 0 : _theme$radioButtonGro.gap)
|
|
123
123
|
}, rest), options.map(function (_ref2, index) {
|
|
124
124
|
var optionDisabled = _ref2.disabled,
|
|
125
125
|
optionId = _ref2.id,
|
|
@@ -332,15 +332,11 @@ var RangeSelector = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
332
332
|
ref: minRef,
|
|
333
333
|
textAlign: "end",
|
|
334
334
|
size: "small",
|
|
335
|
-
margin:
|
|
336
|
-
horizontal: 'small'
|
|
337
|
-
}
|
|
335
|
+
margin: theme.rangeSelector.label.margin
|
|
338
336
|
}, typeof label === 'function' ? label(lower) : lower), content, /*#__PURE__*/React.createElement(Text, {
|
|
339
337
|
ref: maxRef,
|
|
340
338
|
size: "small",
|
|
341
|
-
margin:
|
|
342
|
-
horizontal: 'small'
|
|
343
|
-
}
|
|
339
|
+
margin: theme.rangeSelector.label.margin
|
|
344
340
|
}, typeof label === 'function' ? label(upper) : upper));
|
|
345
341
|
}
|
|
346
342
|
return content;
|
|
@@ -71,6 +71,7 @@ var ClearButton = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
var SelectContainer = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
74
|
+
var _theme$select;
|
|
74
75
|
var clear = _ref3.clear,
|
|
75
76
|
_ref3$children = _ref3.children,
|
|
76
77
|
children = _ref3$children === void 0 ? null : _ref3$children,
|
|
@@ -298,7 +299,7 @@ var SelectContainer = /*#__PURE__*/forwardRef(function (_ref3, ref) {
|
|
|
298
299
|
id: id ? id + "__select-drop" : undefined,
|
|
299
300
|
dropHeight: dropHeight
|
|
300
301
|
}, passThemeFlag), onSearch && /*#__PURE__*/React.createElement(Box, {
|
|
301
|
-
pad: !customSearchInput ?
|
|
302
|
+
pad: !customSearchInput ? (_theme$select = theme.select) == null || (_theme$select = _theme$select.search) == null ? void 0 : _theme$select.pad : undefined,
|
|
302
303
|
flex: false
|
|
303
304
|
}, /*#__PURE__*/React.createElement(SelectTextInput, {
|
|
304
305
|
focusIndicator: !customSearchInput,
|
|
@@ -15,6 +15,7 @@ import { EmptySearchOption } from '../Select/EmptySearchOption';
|
|
|
15
15
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
16
16
|
import { useThemeValue } from '../../utils/useThemeValue';
|
|
17
17
|
var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
18
|
+
var _theme$selectMultiple2;
|
|
18
19
|
var allOptions = _ref.allOptions,
|
|
19
20
|
_ref$children = _ref.children,
|
|
20
21
|
children = _ref$children === void 0 ? null : _ref$children,
|
|
@@ -270,9 +271,10 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
270
271
|
});
|
|
271
272
|
var helpContent;
|
|
272
273
|
if (help) {
|
|
274
|
+
var _theme$selectMultiple;
|
|
273
275
|
if (typeof help === 'string') helpContent = /*#__PURE__*/React.createElement(Box, {
|
|
274
276
|
flex: false,
|
|
275
|
-
pad:
|
|
277
|
+
pad: (_theme$selectMultiple = theme.selectMultiple) == null || (_theme$selectMultiple = _theme$selectMultiple.help) == null || (_theme$selectMultiple = _theme$selectMultiple.container) == null ? void 0 : _theme$selectMultiple.pad
|
|
276
278
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
277
279
|
size: "small"
|
|
278
280
|
}, help));else helpContent = /*#__PURE__*/React.createElement(Box, {
|
|
@@ -304,7 +306,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
304
306
|
messages: messages
|
|
305
307
|
})
|
|
306
308
|
}, summaryContent, onSearch && /*#__PURE__*/React.createElement(Box, {
|
|
307
|
-
pad: !customSearchInput ?
|
|
309
|
+
pad: !customSearchInput ? (_theme$selectMultiple2 = theme.selectMultiple) == null || (_theme$selectMultiple2 = _theme$selectMultiple2.search) == null ? void 0 : _theme$selectMultiple2.pad : undefined,
|
|
308
310
|
flex: false
|
|
309
311
|
}, /*#__PURE__*/React.createElement(Keyboard, {
|
|
310
312
|
onEnter: function onEnter(event) {
|
|
@@ -363,13 +365,14 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
363
365
|
});
|
|
364
366
|
if (typeof child === 'string' || child.props && child.props.children && typeof child.props.children === 'string') textComponent = true;
|
|
365
367
|
} else {
|
|
368
|
+
var _theme$selectMultiple3;
|
|
366
369
|
child = /*#__PURE__*/React.createElement(CheckBox, {
|
|
367
370
|
label: /*#__PURE__*/React.createElement(Box, {
|
|
368
371
|
alignSelf: "center",
|
|
369
372
|
width: "100%",
|
|
370
373
|
align: "start"
|
|
371
374
|
}, optionLabel),
|
|
372
|
-
pad:
|
|
375
|
+
pad: (_theme$selectMultiple3 = theme.selectMultiple) == null || (_theme$selectMultiple3 = _theme$selectMultiple3.option) == null ? void 0 : _theme$selectMultiple3.pad,
|
|
373
376
|
tabIndex: "-1",
|
|
374
377
|
checked: optionSelected,
|
|
375
378
|
disabled: optionDisabled,
|
|
@@ -390,6 +393,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
390
393
|
if (!children && search) {
|
|
391
394
|
var searchText = search.toLowerCase();
|
|
392
395
|
if (typeof optionLabel === 'string' && optionLabel.toLowerCase().indexOf(searchText) >= 0) {
|
|
396
|
+
var _theme$selectMultiple4;
|
|
393
397
|
// code to bold search term in matching options
|
|
394
398
|
var boldIndex = optionLabel.toLowerCase().indexOf(searchText);
|
|
395
399
|
var childBeginning = optionLabel.substring(0, boldIndex);
|
|
@@ -403,7 +407,7 @@ var SelectMultipleContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
403
407
|
align: "start",
|
|
404
408
|
direction: "row"
|
|
405
409
|
}, /*#__PURE__*/React.createElement(Text, null, childBeginning, childBold, childEnd)),
|
|
406
|
-
pad:
|
|
410
|
+
pad: (_theme$selectMultiple4 = theme.selectMultiple) == null || (_theme$selectMultiple4 = _theme$selectMultiple4.option) == null ? void 0 : _theme$selectMultiple4.pad,
|
|
407
411
|
tabIndex: "-1",
|
|
408
412
|
checked: optionSelected,
|
|
409
413
|
disabled: optionDisabled,
|
|
@@ -6,6 +6,7 @@ import { SelectOption } from '../Select/StyledSelect';
|
|
|
6
6
|
import { applyKey, getOptionLabel, useDisabled, arrayIncludes, getOptionIndex, inertTrueValue } from '../Select/utils';
|
|
7
7
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
8
8
|
var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
9
|
+
var _theme$selectMultiple2, _theme$selectMultiple3;
|
|
9
10
|
var allOptions = _ref.allOptions,
|
|
10
11
|
children = _ref.children,
|
|
11
12
|
disabled = _ref.disabled,
|
|
@@ -32,6 +33,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
|
32
33
|
var optionDisabled = isDisabled(indexOptions);
|
|
33
34
|
var valueIndex = getOptionIndex(value, optionValue, valueKey || labelKey);
|
|
34
35
|
if (valueIndex < theme.selectMultiple.maxInline) {
|
|
36
|
+
var _theme$selectMultiple;
|
|
35
37
|
var child;
|
|
36
38
|
if (children) {
|
|
37
39
|
child = children(i, indexOptions, allOptions, {
|
|
@@ -98,7 +100,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
|
98
100
|
align: "start"
|
|
99
101
|
}, optionLabel),
|
|
100
102
|
key: optionLabel,
|
|
101
|
-
pad:
|
|
103
|
+
pad: (_theme$selectMultiple = theme.selectMultiple) == null || (_theme$selectMultiple = _theme$selectMultiple.option) == null ? void 0 : _theme$selectMultiple.pad,
|
|
102
104
|
tabIndex: "-1",
|
|
103
105
|
checked: optionSelected,
|
|
104
106
|
inert: inertTrueValue,
|
|
@@ -116,7 +118,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
|
116
118
|
}));
|
|
117
119
|
}
|
|
118
120
|
return undefined;
|
|
119
|
-
}, [allOptions, children, dropButtonRef, format, isDisabled, labelKey, messages, onSelectChange, theme.selectMultiple.maxInline, value, valueKey]);
|
|
121
|
+
}, [allOptions, children, dropButtonRef, format, isDisabled, labelKey, messages, onSelectChange, theme.selectMultiple.maxInline, (_theme$selectMultiple2 = theme.selectMultiple) == null || (_theme$selectMultiple2 = _theme$selectMultiple2.option) == null ? void 0 : _theme$selectMultiple2.pad, value, valueKey]);
|
|
120
122
|
|
|
121
123
|
// After announcing set showA11yDiv to undefined so it won't
|
|
122
124
|
// be read out again
|
|
@@ -148,11 +150,7 @@ var SelectMultipleValue = function SelectMultipleValue(_ref) {
|
|
|
148
150
|
"aria-live": "assertive",
|
|
149
151
|
role: "alert"
|
|
150
152
|
}, showA11yDiv)), value && value.length > theme.selectMultiple.maxInline && /*#__PURE__*/React.createElement(Box, {
|
|
151
|
-
pad:
|
|
152
|
-
horizontal: 'small',
|
|
153
|
-
bottom: 'small',
|
|
154
|
-
top: 'xsmall'
|
|
155
|
-
},
|
|
153
|
+
pad: (_theme$selectMultiple3 = theme.selectMultiple) == null || (_theme$selectMultiple3 = _theme$selectMultiple3.showMore) == null ? void 0 : _theme$selectMultiple3.pad,
|
|
156
154
|
alignSelf: "start"
|
|
157
155
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
158
156
|
onClick: onRequestOpen,
|
|
@@ -4,7 +4,9 @@ import { Button } from '../Button';
|
|
|
4
4
|
import { Text } from '../Text';
|
|
5
5
|
import { applyKey, getOptionValue, useDisabled, arrayIncludes } from '../Select/utils';
|
|
6
6
|
import { MessageContext } from '../../contexts/MessageContext';
|
|
7
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
7
8
|
var SelectionSummary = function SelectionSummary(_ref) {
|
|
9
|
+
var _theme$selectMultiple, _theme$selectMultiple2, _theme$selectMultiple3, _theme$selectMultiple4;
|
|
8
10
|
var allOptions = _ref.allOptions,
|
|
9
11
|
clearRef = _ref.clearRef,
|
|
10
12
|
disabled = _ref.disabled,
|
|
@@ -23,6 +25,8 @@ var SelectionSummary = function SelectionSummary(_ref) {
|
|
|
23
25
|
valueKey = _ref.valueKey;
|
|
24
26
|
var _useContext = useContext(MessageContext),
|
|
25
27
|
format = _useContext.format;
|
|
28
|
+
var _useThemeValue = useThemeValue(),
|
|
29
|
+
theme = _useThemeValue.theme;
|
|
26
30
|
var isDisabled = useDisabled(disabled, disabledKey, options, valueKey || labelKey);
|
|
27
31
|
var selectedValuesDisabled = useCallback(function () {
|
|
28
32
|
var disabledSelected = 0;
|
|
@@ -77,19 +81,14 @@ var SelectionSummary = function SelectionSummary(_ref) {
|
|
|
77
81
|
if (limit && !showSelectAll) setActiveIndex(0);
|
|
78
82
|
};
|
|
79
83
|
return /*#__PURE__*/React.createElement(Box, {
|
|
80
|
-
pad: showSelectedInline ?
|
|
81
|
-
left: 'xsmall',
|
|
82
|
-
vertical: 'xsmall'
|
|
83
|
-
} : 'xsmall',
|
|
84
|
+
pad: showSelectedInline ? (_theme$selectMultiple = theme.selectMultiple) == null || (_theme$selectMultiple = _theme$selectMultiple.summary) == null || (_theme$selectMultiple = _theme$selectMultiple.showSelectedInline) == null ? void 0 : _theme$selectMultiple.pad : (_theme$selectMultiple2 = theme.selectMultiple) == null || (_theme$selectMultiple2 = _theme$selectMultiple2.summary) == null ? void 0 : _theme$selectMultiple2.pad,
|
|
84
85
|
direction: "row",
|
|
85
86
|
justify: "between",
|
|
86
|
-
gap:
|
|
87
|
+
gap: (_theme$selectMultiple3 = theme.selectMultiple) == null || (_theme$selectMultiple3 = _theme$selectMultiple3.summary) == null ? void 0 : _theme$selectMultiple3.gap,
|
|
87
88
|
fill: "horizontal",
|
|
88
89
|
flex: showSelectedInline,
|
|
89
90
|
align: "center",
|
|
90
|
-
height:
|
|
91
|
-
min: 'xxsmall'
|
|
92
|
-
}
|
|
91
|
+
height: (_theme$selectMultiple4 = theme.selectMultiple) == null || (_theme$selectMultiple4 = _theme$selectMultiple4.summary) == null ? void 0 : _theme$selectMultiple4.height
|
|
93
92
|
}, /*#__PURE__*/React.createElement(Text, {
|
|
94
93
|
size: "small"
|
|
95
94
|
}, summaryText), (options.length && (!limit || !(!value || (value == null ? void 0 : value.length) === 0 && selectedValuesDisabled()))) > 0 && (!onMore || onMore && (value == null ? void 0 : value.length) !== 0) && /*#__PURE__*/React.createElement(Button, {
|
|
@@ -4,17 +4,20 @@ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t =
|
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Box } from '../Box';
|
|
6
6
|
import { SidebarPropTypes } from './propTypes';
|
|
7
|
+
import { useThemeValue } from '../../utils/useThemeValue';
|
|
7
8
|
export var Sidebar = function Sidebar(_ref) {
|
|
8
9
|
var children = _ref.children,
|
|
9
10
|
footer = _ref.footer,
|
|
10
11
|
header = _ref.header,
|
|
11
12
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
13
|
+
var _useThemeValue = useThemeValue(),
|
|
14
|
+
theme = _useThemeValue.theme;
|
|
12
15
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
13
|
-
pad: "small",
|
|
14
|
-
gap: "large",
|
|
15
16
|
height: {
|
|
16
17
|
min: '100%'
|
|
17
|
-
}
|
|
18
|
+
},
|
|
19
|
+
gap: theme.sidebar.gap,
|
|
20
|
+
pad: theme.sidebar.pad
|
|
18
21
|
}, rest), header, /*#__PURE__*/React.createElement(Box, {
|
|
19
22
|
flex: true
|
|
20
23
|
}, children), footer);
|
|
@@ -12,11 +12,14 @@ var BasicSpinner = function BasicSpinner(_ref) {
|
|
|
12
12
|
var ref = _ref.ref,
|
|
13
13
|
size = _ref.size,
|
|
14
14
|
rest = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
15
|
+
var _useThemeValue = useThemeValue(),
|
|
16
|
+
theme = _useThemeValue.theme;
|
|
15
17
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
16
18
|
flex: false,
|
|
17
19
|
height: size,
|
|
18
20
|
width: size,
|
|
19
|
-
ref: ref
|
|
21
|
+
ref: ref,
|
|
22
|
+
responsive: theme.spinner.responsive
|
|
20
23
|
}, rest));
|
|
21
24
|
};
|
|
22
25
|
/**
|
|
@@ -40,8 +43,8 @@ var Spinner = /*#__PURE__*/forwardRef(function (_ref2, ref) {
|
|
|
40
43
|
size = _ref2.size,
|
|
41
44
|
message = _ref2.message,
|
|
42
45
|
rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
|
|
43
|
-
var
|
|
44
|
-
theme =
|
|
46
|
+
var _useThemeValue2 = useThemeValue(),
|
|
47
|
+
theme = _useThemeValue2.theme;
|
|
45
48
|
var announce = useContext(AnnounceContext);
|
|
46
49
|
useEffect(function () {
|
|
47
50
|
if (message != null && message.start) announce(message.start);else if (typeof message === 'string') announce(message);
|
|
@@ -17,6 +17,7 @@ var StyledStarRatingBox = styled(Box).withConfig({
|
|
|
17
17
|
return props.focus && focusStyle();
|
|
18
18
|
});
|
|
19
19
|
var StarRating = function StarRating(_ref) {
|
|
20
|
+
var _theme$starRating, _theme$starRating2;
|
|
20
21
|
var name = _ref.name,
|
|
21
22
|
defaultValue = _ref.defaultValue,
|
|
22
23
|
valueProp = _ref.value,
|
|
@@ -32,6 +33,8 @@ var StarRating = function StarRating(_ref) {
|
|
|
32
33
|
}),
|
|
33
34
|
value = _formContext$useFormI[0],
|
|
34
35
|
setValue = _formContext$useFormI[1];
|
|
36
|
+
var SelectedIcon = ((_theme$starRating = theme.starRating) == null || (_theme$starRating = _theme$starRating.icons) == null ? void 0 : _theme$starRating.selected) || Star;
|
|
37
|
+
var UnselectedIcon = ((_theme$starRating2 = theme.starRating) == null || (_theme$starRating2 = _theme$starRating2.icons) == null ? void 0 : _theme$starRating2.unselected) || StarOutline;
|
|
35
38
|
var options = [];
|
|
36
39
|
for (var i = 1; i < 6; i += 1) {
|
|
37
40
|
options.push(i);
|
|
@@ -44,14 +47,14 @@ var StarRating = function StarRating(_ref) {
|
|
|
44
47
|
setValue(event.value);
|
|
45
48
|
}
|
|
46
49
|
}, rest), function (option, _ref2) {
|
|
47
|
-
var _theme$
|
|
50
|
+
var _theme$starRating3, _theme$starRating4;
|
|
48
51
|
var focus = _ref2.focus;
|
|
49
52
|
return /*#__PURE__*/React.createElement(StyledStarRatingBox, {
|
|
50
53
|
focus: focus && usingKeyboard
|
|
51
|
-
}, option <= value ? /*#__PURE__*/React.createElement(
|
|
52
|
-
color: (_theme$
|
|
53
|
-
}) : /*#__PURE__*/React.createElement(
|
|
54
|
-
color: (_theme$
|
|
54
|
+
}, option <= value ? /*#__PURE__*/React.createElement(SelectedIcon, {
|
|
55
|
+
color: (_theme$starRating3 = theme.starRating) == null ? void 0 : _theme$starRating3.color
|
|
56
|
+
}) : /*#__PURE__*/React.createElement(UnselectedIcon, {
|
|
57
|
+
color: (_theme$starRating4 = theme.starRating) == null ? void 0 : _theme$starRating4.color
|
|
55
58
|
}));
|
|
56
59
|
});
|
|
57
60
|
};
|