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.
Files changed (157) hide show
  1. package/components/AccordionPanel/AccordionPanel.js +3 -6
  2. package/components/Anchor/StyledAnchor.js +1 -1
  3. package/components/Box/StyledBox.js +1 -1
  4. package/components/Button/BusyAnimation.js +5 -1
  5. package/components/Button/Button.js +3 -1
  6. package/components/Calendar/Calendar.js +7 -10
  7. package/components/Cards/Cards.js +3 -4
  8. package/components/Chart/Chart.js +11 -9
  9. package/components/Chart/calcs.js +21 -13
  10. package/components/CheckBox/CheckBox.js +1 -1
  11. package/components/CheckBoxGroup/CheckBoxGroup.js +2 -3
  12. package/components/Data/Data.js +5 -1
  13. package/components/Data/DataForm.js +6 -4
  14. package/components/Data/stories/Infinite.stories.js +10 -15
  15. package/components/Data/stories/OnSelect.stories.js +10 -15
  16. package/components/Data/stories/SpaceX.stories.js +10 -15
  17. package/components/Data/stories/StarWars.stories.js +6 -8
  18. package/components/DataChart/DataChart.js +14 -12
  19. package/components/DataChart/Detail.js +2 -2
  20. package/components/DataChart/Legend.js +8 -9
  21. package/components/DataChart/utils.js +15 -8
  22. package/components/DataFilter/DataFilter.js +10 -9
  23. package/components/DataFilters/DataFilters.js +9 -10
  24. package/components/DataSearch/DataSearch.js +5 -4
  25. package/components/DataSort/DataSort.js +4 -3
  26. package/components/DataSummary/DataSummary.js +6 -6
  27. package/components/DataTable/ExpanderCell.js +6 -3
  28. package/components/DataTable/Footer.js +6 -3
  29. package/components/DataTable/Header.js +6 -3
  30. package/components/DataTable/Resizer.js +22 -8
  31. package/components/DataTable/Searcher.js +5 -7
  32. package/components/DataTable/stories/ResizePinned.stories.js +321 -0
  33. package/components/DataTable/stories/SpaceX.stories.js +15 -16
  34. package/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
  35. package/components/DataTable/stories/rowDetails.stories.js +6 -8
  36. package/components/DataTableColumns/DataTableColumns.js +24 -22
  37. package/components/DateInput/DateInput.js +7 -6
  38. package/components/Distribution/Distribution.js +8 -5
  39. package/components/FileInput/FileInput.js +41 -36
  40. package/components/Footer/Footer.js +5 -1
  41. package/components/Header/Header.js +2 -2
  42. package/components/Layer/Layer.js +10 -5
  43. package/components/Layer/StyledLayer.js +2 -2
  44. package/components/List/List.js +5 -4
  45. package/components/MaskedInput/MaskedInput.js +6 -1
  46. package/components/Menu/Menu.js +13 -1
  47. package/components/Meter/Bar.js +38 -17
  48. package/components/Meter/Circle.js +31 -46
  49. package/components/Meter/stories/Circle.stories.js +6 -8
  50. package/components/Meter/utils.js +15 -1
  51. package/components/Nav/Nav.js +5 -1
  52. package/components/Notification/Notification.js +6 -8
  53. package/components/Pagination/Pagination.js +5 -10
  54. package/components/Pagination/PaginationStep.js +2 -1
  55. package/components/Paragraph/ParagraphSkeleton.js +2 -1
  56. package/components/RadioButton/RadioButton.js +1 -1
  57. package/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
  58. package/components/RangeSelector/RangeSelector.js +2 -6
  59. package/components/Select/SelectContainer.js +2 -1
  60. package/components/SelectMultiple/SelectMultipleContainer.js +8 -4
  61. package/components/SelectMultiple/SelectMultipleValue.js +5 -7
  62. package/components/SelectMultiple/SelectionSummary.js +7 -8
  63. package/components/Sidebar/Sidebar.js +6 -3
  64. package/components/Spinner/Spinner.js +7 -4
  65. package/components/StarRating/StarRating.js +8 -5
  66. package/components/Tab/Tab.js +2 -1
  67. package/components/Table/StyledTable.js +2 -2
  68. package/components/Tabs/Tabs.js +8 -12
  69. package/components/Tag/StyledTag.js +9 -1
  70. package/components/TextInput/CopyButton.js +3 -2
  71. package/components/TextInput/TextInput.js +5 -0
  72. package/components/ThumbsRating/ThumbsRating.js +15 -10
  73. package/components/Toolbar/Toolbar.js +15 -11
  74. package/components/Video/Video.js +3 -5
  75. package/es6/components/AccordionPanel/AccordionPanel.js +3 -6
  76. package/es6/components/Anchor/StyledAnchor.js +2 -2
  77. package/es6/components/Box/StyledBox.js +1 -1
  78. package/es6/components/Button/BusyAnimation.js +5 -1
  79. package/es6/components/Button/Button.js +3 -1
  80. package/es6/components/Calendar/Calendar.js +7 -10
  81. package/es6/components/Cards/Cards.js +3 -4
  82. package/es6/components/Chart/Chart.js +11 -9
  83. package/es6/components/Chart/calcs.js +21 -13
  84. package/es6/components/CheckBox/CheckBox.js +1 -1
  85. package/es6/components/CheckBoxGroup/CheckBoxGroup.js +2 -3
  86. package/es6/components/Data/Data.js +5 -1
  87. package/es6/components/Data/DataForm.js +6 -4
  88. package/es6/components/Data/stories/Infinite.stories.js +10 -15
  89. package/es6/components/Data/stories/OnSelect.stories.js +10 -15
  90. package/es6/components/Data/stories/SpaceX.stories.js +10 -15
  91. package/es6/components/Data/stories/StarWars.stories.js +6 -8
  92. package/es6/components/DataChart/DataChart.js +14 -12
  93. package/es6/components/DataChart/Detail.js +2 -2
  94. package/es6/components/DataChart/Legend.js +8 -9
  95. package/es6/components/DataChart/utils.js +15 -8
  96. package/es6/components/DataFilter/DataFilter.js +10 -9
  97. package/es6/components/DataFilters/DataFilters.js +9 -10
  98. package/es6/components/DataSearch/DataSearch.js +5 -4
  99. package/es6/components/DataSort/DataSort.js +4 -3
  100. package/es6/components/DataSummary/DataSummary.js +6 -6
  101. package/es6/components/DataTable/ExpanderCell.js +4 -1
  102. package/es6/components/DataTable/Footer.js +4 -1
  103. package/es6/components/DataTable/Header.js +6 -3
  104. package/es6/components/DataTable/Resizer.js +22 -8
  105. package/es6/components/DataTable/Searcher.js +5 -7
  106. package/es6/components/DataTable/stories/ResizePinned.stories.js +316 -0
  107. package/es6/components/DataTable/stories/SpaceX.stories.js +15 -16
  108. package/es6/components/DataTable/stories/SpaceXUngrouped.stories.js +7 -7
  109. package/es6/components/DataTable/stories/rowDetails.stories.js +6 -8
  110. package/es6/components/DataTableColumns/DataTableColumns.js +23 -21
  111. package/es6/components/DateInput/DateInput.js +6 -5
  112. package/es6/components/Distribution/Distribution.js +8 -5
  113. package/es6/components/FileInput/FileInput.js +42 -37
  114. package/es6/components/Footer/Footer.js +5 -1
  115. package/es6/components/Header/Header.js +2 -2
  116. package/es6/components/Layer/Layer.js +10 -5
  117. package/es6/components/Layer/StyledLayer.js +3 -3
  118. package/es6/components/List/List.js +5 -4
  119. package/es6/components/MaskedInput/MaskedInput.js +6 -1
  120. package/es6/components/Menu/Menu.js +13 -1
  121. package/es6/components/Meter/Bar.js +39 -18
  122. package/es6/components/Meter/Circle.js +33 -48
  123. package/es6/components/Meter/stories/Circle.stories.js +7 -9
  124. package/es6/components/Meter/utils.js +14 -0
  125. package/es6/components/Nav/Nav.js +5 -1
  126. package/es6/components/Notification/Notification.js +6 -8
  127. package/es6/components/Pagination/Pagination.js +5 -10
  128. package/es6/components/Pagination/PaginationStep.js +2 -1
  129. package/es6/components/Paragraph/ParagraphSkeleton.js +2 -1
  130. package/es6/components/RadioButton/RadioButton.js +1 -1
  131. package/es6/components/RadioButtonGroup/RadioButtonGroup.js +2 -2
  132. package/es6/components/RangeSelector/RangeSelector.js +2 -6
  133. package/es6/components/Select/SelectContainer.js +2 -1
  134. package/es6/components/SelectMultiple/SelectMultipleContainer.js +8 -4
  135. package/es6/components/SelectMultiple/SelectMultipleValue.js +5 -7
  136. package/es6/components/SelectMultiple/SelectionSummary.js +7 -8
  137. package/es6/components/Sidebar/Sidebar.js +6 -3
  138. package/es6/components/Spinner/Spinner.js +6 -3
  139. package/es6/components/StarRating/StarRating.js +8 -5
  140. package/es6/components/Tab/Tab.js +2 -1
  141. package/es6/components/Table/StyledTable.js +2 -2
  142. package/es6/components/Tabs/Tabs.js +8 -12
  143. package/es6/components/Tag/StyledTag.js +10 -2
  144. package/es6/components/TextInput/CopyButton.js +3 -2
  145. package/es6/components/TextInput/TextInput.js +5 -0
  146. package/es6/components/ThumbsRating/ThumbsRating.js +15 -10
  147. package/es6/components/Toolbar/Toolbar.js +15 -11
  148. package/es6/components/Video/Video.js +3 -5
  149. package/es6/themes/base.d.ts +284 -4
  150. package/es6/themes/base.js +369 -21
  151. package/es6/utils/graphics.js +123 -0
  152. package/grommet.min.js +1 -1
  153. package/grommet.min.js.map +1 -1
  154. package/package.json +46 -46
  155. package/themes/base.d.ts +284 -4
  156. package/themes/base.js +369 -21
  157. 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 = type === 'semicircle' ? 270 : 0;
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 = type === 'semicircle' ? 90 : 360;
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
- if (round) {
71
- var d1 = arcCommands(centerX, centerY, radius, startAngle, endAngle);
72
- paths.unshift(/*#__PURE__*/React.createElement("path", _extends({
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
- // To handle situations where the last values are small, redraw
82
- // a dot at the end. Give just a bit of angle to avoid anti-aliasing
83
- // leakage around the edge.
84
- var d2 = arcCommands(centerX, centerY, radius, endAngle - 0.5, endAngle);
85
- var pathCap = /*#__PURE__*/React.createElement("path", _extends({
86
- key: key + "-",
87
- d: d2,
88
- fill: "none"
89
- }, stroke, {
90
- strokeWidth: strokeWidth,
91
- strokeLinecap: "round"
92
- }, hoverProps, pathRest));
93
- // If we are on a large enough path to not need re-drawing previous
94
- // ones, clear the pathCaps we've collected already.
95
- if (endAngle - startAngle > 2 * anglePer) {
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, pathCaps);
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, useRef } from 'react';
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
- clearTimeout(timer.current);
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 ? 'accent-2' : 'accent-1'
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: "medium"
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: "small",
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, passThemeFlag, rest), paginationControls);
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: "xsmall"
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: "xsmall",
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 || 'small'
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 || (theme.radioButtonGroup.container && theme.radioButtonGroup.container.gap ? theme.radioButtonGroup.container.gap : 'small')
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 ? 'xsmall' : undefined,
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: "xsmall"
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 ? 'xsmall' : undefined,
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: "xsmall",
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: "xsmall",
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: "xsmall",
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: "small",
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 _useThemeValue = useThemeValue(),
44
- theme = _useThemeValue.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$starRating, _theme$starRating2;
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(Star, {
52
- color: (_theme$starRating = theme.starRating) == null ? void 0 : _theme$starRating.color
53
- }) : /*#__PURE__*/React.createElement(StarOutline, {
54
- color: (_theme$starRating2 = theme.starRating) == null ? void 0 : _theme$starRating2.color
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
  };