grommet 2.49.0 → 2.51.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 (37) hide show
  1. package/components/DataTable/ExpanderCell.js +6 -3
  2. package/components/DataTable/Header.js +2 -1
  3. package/components/DataTable/Resizer.js +18 -7
  4. package/components/DataTable/stories/ResizePinned.stories.js +321 -0
  5. package/components/Grommet/index.d.ts +3 -0
  6. package/components/Grommet/propTypes.js +3 -0
  7. package/components/List/List.js +6 -4
  8. package/components/Select/Select.js +1 -0
  9. package/components/Select/SelectContainer.js +19 -2
  10. package/components/Select/index.d.ts +6 -1
  11. package/components/Select/propTypes.js +4 -1
  12. package/components/SelectMultiple/SelectMultipleContainer.js +11 -2
  13. package/components/SelectMultiple/index.d.ts +1 -0
  14. package/components/SelectMultiple/propTypes.js +1 -0
  15. package/es6/components/DataTable/ExpanderCell.js +4 -1
  16. package/es6/components/DataTable/Header.js +2 -1
  17. package/es6/components/DataTable/Resizer.js +18 -7
  18. package/es6/components/DataTable/stories/ResizePinned.stories.js +316 -0
  19. package/es6/components/Grommet/index.d.ts +3 -0
  20. package/es6/components/Grommet/propTypes.js +3 -0
  21. package/es6/components/List/List.js +6 -4
  22. package/es6/components/Select/Select.js +1 -0
  23. package/es6/components/Select/SelectContainer.js +20 -3
  24. package/es6/components/Select/index.d.ts +6 -1
  25. package/es6/components/Select/propTypes.js +4 -1
  26. package/es6/components/SelectMultiple/SelectMultipleContainer.js +11 -2
  27. package/es6/components/SelectMultiple/index.d.ts +1 -0
  28. package/es6/components/SelectMultiple/propTypes.js +1 -0
  29. package/es6/languages/default.json +3 -0
  30. package/es6/themes/base.d.ts +4 -0
  31. package/es6/themes/base.js +4 -1
  32. package/grommet.min.js +1 -1
  33. package/grommet.min.js.map +1 -1
  34. package/languages/default.json +3 -0
  35. package/package.json +42 -42
  36. package/themes/base.d.ts +4 -0
  37. package/themes/base.js +4 -1
@@ -9,7 +9,7 @@ var _Button = require("../Button");
9
9
  var _TableCell = require("../TableCell");
10
10
  var _MessageContext = require("../../contexts/MessageContext");
11
11
  var _utils = require("../../utils");
12
- var _useThemeValue2 = require("../../utils/useThemeValue");
12
+ var _useThemeValue3 = require("../../utils/useThemeValue");
13
13
  var _excluded = ["context", "expanded", "onToggle", "messages", "pad", "expandLabel"],
14
14
  _excluded2 = ["background", "border", "context", "expandLabel"];
15
15
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
@@ -25,7 +25,7 @@ var ExpanderControl = function ExpanderControl(_ref) {
25
25
  pad = _ref.pad,
26
26
  expandLabel = _ref.expandLabel,
27
27
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
28
- var _useThemeValue = (0, _useThemeValue2.useThemeValue)(),
28
+ var _useThemeValue = (0, _useThemeValue3.useThemeValue)(),
29
29
  theme = _useThemeValue.theme;
30
30
  var _useContext = (0, _react.useContext)(_MessageContext.MessageContext),
31
31
  format = _useContext.format;
@@ -100,15 +100,18 @@ var ExpanderControl = function ExpanderControl(_ref) {
100
100
  return content;
101
101
  };
102
102
  var ExpanderCell = exports.ExpanderCell = function ExpanderCell(_ref2) {
103
+ var _theme$dataTable$expa;
103
104
  var background = _ref2.background,
104
105
  border = _ref2.border,
105
106
  context = _ref2.context,
106
107
  expandLabel = _ref2.expandLabel,
107
108
  rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
109
+ var _useThemeValue2 = (0, _useThemeValue3.useThemeValue)(),
110
+ theme = _useThemeValue2.theme;
108
111
  return /*#__PURE__*/_react["default"].createElement(_TableCell.TableCell, {
109
112
  background: background,
110
113
  border: border,
111
- size: "xxsmall",
114
+ size: (_theme$dataTable$expa = theme.dataTable.expand) == null ? void 0 : _theme$dataTable$expa.size,
112
115
  plain: "noPad",
113
116
  verticalAlign: context === 'groupEnd' ? 'bottom' : 'top'
114
117
  }, /*#__PURE__*/_react["default"].createElement(ExpanderControl, _extends({
@@ -402,7 +402,8 @@ var Header = exports.Header = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
402
402
  style: {
403
403
  width: widths != null && widths[property] ? widths[property] + "px" : undefined,
404
404
  boxSizing: _onResize ? 'border-box' : undefined,
405
- position: _onResize ? 'relative' : undefined,
405
+ // Don't override positioning when DataTable has pin prop
406
+ position: _onResize && !columnPin && !pinProp ? 'relative' : undefined,
406
407
  overflow: _onResize ? 'visible' : undefined
407
408
  },
408
409
  onResize: _onResize,
@@ -12,24 +12,34 @@ var _DropButton = require("../DropButton");
12
12
  var _Keyboard = require("../Keyboard");
13
13
  var _useThemeValue2 = require("../../utils/useThemeValue");
14
14
  var _MessageContext = require("../../contexts/MessageContext");
15
+ var _styles = require("../../utils/styles");
15
16
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
16
17
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
17
18
  // We determined 12 empirically as being wide enough to hit but
18
19
  // not too wide to cause false hits.
19
20
  var STEP = 12; // Used to determine the width change on resize
21
+ var resizerWidth = 24; // minimum width required for WCAG compliance
20
22
 
21
23
  var StyledResizer = (0, _styledComponents["default"])(_DropButton.DropButton).withConfig({
22
24
  displayName: "Resizer__StyledResizer",
23
25
  componentId: "sc-8l808w-0"
24
- })(["display:flex;justify-content:center;padding-top:", ";padding-bottom:", ";margin-right:-", ";position:absolute;right:0;width:24px;height:100%;top:0;cursor:col-resize;z-index:1;"], function (props) {
25
- return props.theme.global.edgeSize.xsmall;
26
+ })(["display:flex;justify-content:center;", ";", ";", " ", " ", " ", " position:absolute;width:", "px;height:100%;top:0;cursor:col-resize;z-index:1;"], function (props) {
27
+ var _props$theme$dataTabl;
28
+ return (0, _styles.edgeStyle)('padding-top', (_props$theme$dataTabl = props.theme.dataTable) == null || (_props$theme$dataTabl = _props$theme$dataTabl.resize) == null || (_props$theme$dataTabl = _props$theme$dataTabl.padding) == null ? void 0 : _props$theme$dataTabl.vertical, false, props.theme.global.edgeSize.responsiveBreakpoint, props.theme);
26
29
  }, function (props) {
27
- return props.theme.global.edgeSize.xsmall;
30
+ var _props$theme$dataTabl2;
31
+ return (0, _styles.edgeStyle)('padding-bottom', (_props$theme$dataTabl2 = props.theme.dataTable) == null || (_props$theme$dataTabl2 = _props$theme$dataTabl2.resize) == null || (_props$theme$dataTabl2 = _props$theme$dataTabl2.padding) == null ? void 0 : _props$theme$dataTabl2.vertical, false, props.theme.global.edgeSize.responsiveBreakpoint, props.theme);
28
32
  }, function (props) {
29
- return props.theme.global.edgeSize.small;
30
- });
33
+ return props.side === 'start' && "margin-left: -" + (resizerWidth / 2 - props.theme.global.borderSize.xsmall.replace('px', '')) + "px;";
34
+ }, function (props) {
35
+ return props.side === 'start' && "left: 0;";
36
+ }, function (props) {
37
+ return props.side === 'end' && "margin-right: -" + (resizerWidth / 2 - props.theme.global.borderSize.xsmall.replace('px', '')) + "px;";
38
+ }, function (props) {
39
+ return props.side === 'end' && "right: 0;";
40
+ }, resizerWidth);
31
41
  var Resizer = exports.Resizer = function Resizer(_ref) {
32
- var _theme$dataTable$icon, _theme$dataTable$icon2;
42
+ var _theme$dataTable$icon, _theme$dataTable$icon2, _border;
33
43
  var onResize = _ref.onResize,
34
44
  property = _ref.property,
35
45
  headerText = _ref.headerText,
@@ -219,7 +229,8 @@ var Resizer = exports.Resizer = function Resizer(_ref) {
219
229
  })),
220
230
  dropAlign: {
221
231
  top: 'bottom'
222
- }
232
+ },
233
+ side: (_border = border) == null ? void 0 : _border.side
223
234
  }, /*#__PURE__*/_react["default"].createElement(_Box.Box, {
224
235
  border: hover || active ? hoverBorder : border,
225
236
  height: "100%",
@@ -0,0 +1,321 @@
1
+ "use strict";
2
+
3
+ exports.__esModule = true;
4
+ exports["default"] = exports.ResizablePinnedDataTable = void 0;
5
+ var _react = _interopRequireDefault(require("react"));
6
+ var _grommet = require("grommet");
7
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
8
+ var data = [{
9
+ id: 'b0:2a:43:52:48:c5',
10
+ macAddress: 'b0:2a:43:52:48:c5',
11
+ ipAddress: '192.168.0.20',
12
+ hostname: 'wh7-dureal50',
13
+ connectionType: 'Wireless',
14
+ category: 'Network',
15
+ status: 'Active',
16
+ deviceName: 'Chromecast',
17
+ networkBand: {
18
+ value: 2.4,
19
+ unit: 'GHz'
20
+ },
21
+ linkRate: {
22
+ value: 72,
23
+ unit: 'Mbps'
24
+ }
25
+ }, {
26
+ id: '00:d0:2d:32:b6:cd',
27
+ macAddress: '00:d0:2d:32:b6:cd',
28
+ ipAddress: '192.168.0.24',
29
+ hostname: 'wh7-dureal50',
30
+ connectionType: 'Wireless',
31
+ category: 'Network',
32
+ status: 'Active',
33
+ deviceName: 'Gateway32B6CD',
34
+ networkBand: {
35
+ value: 2.4,
36
+ unit: 'GHz'
37
+ },
38
+ linkRate: {
39
+ value: 72,
40
+ unit: 'Mbps'
41
+ }
42
+ }, {
43
+ id: 'd8:6c:63:46:13:03',
44
+ macAddress: 'd8:6c:63:46:13:03',
45
+ ipAddress: '192.168.0.19',
46
+ hostname: 'wh7-dureal50',
47
+ connectionType: 'Wireless',
48
+ category: 'Network',
49
+ status: 'Active',
50
+ deviceName: 'Amazon-Firestick',
51
+ networkBand: {
52
+ value: 2.4,
53
+ unit: 'GHz'
54
+ },
55
+ linkRate: {
56
+ value: 72,
57
+ unit: 'Mbps'
58
+ }
59
+ }, {
60
+ id: 'f4:f5:d8:c0:e2:9c',
61
+ macAddress: 'f4:f5:d8:c0:e2:9c',
62
+ ipAddress: '192.168.0.21',
63
+ hostname: 'wh7-dureal50',
64
+ connectionType: 'Wireless',
65
+ category: 'Network',
66
+ status: 'Active',
67
+ deviceName: 'Google-Home',
68
+ networkBand: {
69
+ value: 2.4,
70
+ unit: 'GHz'
71
+ },
72
+ linkRate: {
73
+ value: 72,
74
+ unit: 'Mbps'
75
+ }
76
+ }, {
77
+ id: '38:f9:d3:b7:09:4e',
78
+ macAddress: '38:f9:d3:b7:09:4e',
79
+ ipAddress: '192.168.0.21',
80
+ hostname: 'wh7-dureal50',
81
+ connectionType: 'Wireless',
82
+ category: 'Network',
83
+ status: 'Active',
84
+ deviceName: 'Daras-MBP',
85
+ networkBand: {
86
+ value: 5,
87
+ unit: 'GHz'
88
+ },
89
+ linkRate: {
90
+ value: 702,
91
+ unit: 'Mbps'
92
+ }
93
+ }, {
94
+ id: '10:40:f3:85:67:44',
95
+ macAddress: '10:40:f3:85:67:44',
96
+ ipAddress: '192.168.0.13',
97
+ hostname: 'wh7-dureal50',
98
+ connectionType: 'Wireless',
99
+ category: 'Network',
100
+ status: 'Active',
101
+ deviceName: 'Daras-Air',
102
+ networkBand: {
103
+ value: 2.4,
104
+ unit: 'GHz'
105
+ },
106
+ linkRate: {
107
+ value: 78,
108
+ unit: 'Mbps'
109
+ }
110
+ }, {
111
+ id: 'a4:f1:e8:27:e7:1c',
112
+ macAddress: 'a4:f1:e8:27:e7:1c',
113
+ ipAddress: '192.168.0.11',
114
+ hostname: 'wh7-dureal50',
115
+ connectionType: 'Wireless',
116
+ category: 'Network',
117
+ status: 'Active',
118
+ deviceName: 'iPhone',
119
+ networkBand: {
120
+ value: 2.4,
121
+ unit: 'GHz'
122
+ },
123
+ linkRate: {
124
+ value: 24,
125
+ unit: 'Mbps'
126
+ }
127
+ }, {
128
+ id: '10:e7:c6:cb:f8:58',
129
+ macAddress: '10:e7:c6:cb:f8:58',
130
+ ipAddress: '192.168.0.22',
131
+ hostname: 'wh7-dureal50',
132
+ connectionType: 'Wireless',
133
+ category: 'Network',
134
+ status: 'Active',
135
+ deviceName: 'HPCBF857',
136
+ networkBand: {
137
+ value: 2.4,
138
+ unit: 'GHz'
139
+ },
140
+ linkRate: {
141
+ value: 24,
142
+ unit: 'Mbps'
143
+ }
144
+ }, {
145
+ id: '44:07:0b:ba:1e:eb',
146
+ macAddress: '44:07:0b:ba:1e:eb',
147
+ ipAddress: '192.168.0.18',
148
+ hostname: 'wh7-dureal50',
149
+ connectionType: 'Wireless',
150
+ category: 'Network',
151
+ status: 'Active',
152
+ deviceName: 'Google-Home-Mini',
153
+ networkBand: {
154
+ value: 2.4,
155
+ unit: 'GHz'
156
+ },
157
+ linkRate: {
158
+ value: 72,
159
+ unit: 'Mbps'
160
+ }
161
+ }, {
162
+ id: '00:f6:20:60:15:d0',
163
+ macAddress: '00:f6:20:60:15:d0',
164
+ ipAddress: '192.168.0.17',
165
+ hostname: 'wh7-dureal50',
166
+ connectionType: 'Wireless',
167
+ category: 'Network',
168
+ status: 'Active',
169
+ deviceName: 'Amazon-Alexa',
170
+ networkBand: {
171
+ value: 2.4,
172
+ unit: 'GHz'
173
+ },
174
+ linkRate: {
175
+ value: 72,
176
+ unit: 'Mbps'
177
+ }
178
+ }, {
179
+ id: '30:fd:38:88:49:f4',
180
+ macAddress: '30:fd:38:88:49:f4',
181
+ ipAddress: '192.168.0.16',
182
+ hostname: 'wh7-dureal50',
183
+ connectionType: 'Wireless',
184
+ category: 'Network',
185
+ status: 'Active',
186
+ deviceName: 'Google-Home-Mini',
187
+ networkBand: {
188
+ value: 2.4,
189
+ unit: 'GHz'
190
+ },
191
+ linkRate: {
192
+ value: 292,
193
+ unit: 'Mbps'
194
+ }
195
+ }, {
196
+ id: '7c:b0:c2:5c:94:a5',
197
+ macAddress: '7c:b0:c2:5c:94:a5',
198
+ ipAddress: '192.168.0.26',
199
+ hostname: 'wh7-dureal50',
200
+ connectionType: 'Wireless',
201
+ category: 'Network',
202
+ status: 'Active',
203
+ deviceName: 'N/A',
204
+ networkBand: {
205
+ value: 2.4,
206
+ unit: 'GHz'
207
+ },
208
+ linkRate: {
209
+ value: 6,
210
+ unit: 'Mbps'
211
+ }
212
+ }, {
213
+ id: 'E0:5F:45:96:F4:DD',
214
+ macAddress: 'E0:5F:45:96:F4:DD',
215
+ ipAddress: '192.168.0.25',
216
+ hostname: 'wh7-dureal50',
217
+ connectionType: 'Wireless',
218
+ category: 'Network',
219
+ status: 'Active',
220
+ deviceName: 'N/A',
221
+ networkBand: {
222
+ value: 2.4,
223
+ unit: 'GHz'
224
+ },
225
+ linkRate: {
226
+ value: 1,
227
+ unit: 'Mbps'
228
+ }
229
+ }];
230
+ var columns = [{
231
+ primary: true,
232
+ property: 'macAddress',
233
+ header: 'MAC address',
234
+ render: function render(datum) {
235
+ return datum.macAddress;
236
+ },
237
+ pin: true
238
+ }, {
239
+ property: 'ipAddress',
240
+ header: 'IP V4',
241
+ render: function render(datum) {
242
+ return /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
243
+ truncate: "tip"
244
+ }, datum.ipAddress);
245
+ },
246
+ size: 'xsmall',
247
+ align: 'end'
248
+ }, {
249
+ property: 'hostname',
250
+ header: 'Hostname',
251
+ render: function render(datum) {
252
+ return /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
253
+ truncate: "tip"
254
+ }, datum.hostname);
255
+ },
256
+ size: 'xsmall'
257
+ }, {
258
+ property: 'connectionType',
259
+ header: 'Connection type'
260
+ }, {
261
+ property: 'category',
262
+ header: 'Category'
263
+ }, {
264
+ property: 'deviceName',
265
+ header: 'Device name',
266
+ render: function render(datum) {
267
+ return /*#__PURE__*/_react["default"].createElement(_grommet.Text, {
268
+ truncate: "tip"
269
+ }, datum.deviceName);
270
+ },
271
+ size: 'xsmall'
272
+ }, {
273
+ property: 'status',
274
+ header: 'Status'
275
+ }, {
276
+ property: 'networkBand.value',
277
+ header: 'Network band',
278
+ units: 'GHz',
279
+ render: function render(datum) {
280
+ return datum.networkBand.value;
281
+ },
282
+ align: 'end'
283
+ }, {
284
+ property: 'linkRate.value',
285
+ header: 'Link rate',
286
+ units: 'Mbps',
287
+ render: function render(datum) {
288
+ return datum.linkRate.value;
289
+ },
290
+ align: 'end'
291
+ }];
292
+ var ResizablePinnedDataTable = exports.ResizablePinnedDataTable = function ResizablePinnedDataTable() {
293
+ return /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
294
+ align: "center",
295
+ pad: "large"
296
+ }, /*#__PURE__*/_react["default"].createElement(_grommet.Heading, {
297
+ level: "3"
298
+ }, "Table with resizable & column sizes"), /*#__PURE__*/_react["default"].createElement(_grommet.Box, {
299
+ align: "start",
300
+ height: "medium"
301
+ // restricting width to demonstrate pinned column behavior
302
+ ,
303
+ width: {
304
+ width: 'xxlarge',
305
+ max: '100%'
306
+ },
307
+ overflow: "auto"
308
+ }, /*#__PURE__*/_react["default"].createElement(_grommet.DataTable, {
309
+ "aria-describedby": "connected-heading",
310
+ data: data,
311
+ columns: columns,
312
+ pin: true,
313
+ resizeable: true
314
+ })))
315
+ // </Grommet>
316
+ ;
317
+ };
318
+ ResizablePinnedDataTable.storyName = 'Resizable pinned columns';
319
+ var _default = exports["default"] = {
320
+ title: 'Visualizations/DataTable/Resizable pinned columns'
321
+ };
@@ -188,7 +188,9 @@ export interface GrommetProps {
188
188
  };
189
189
  };
190
190
  select?: {
191
+ optionsA11y?: string;
191
192
  multiple?: string;
193
+ searchA11y?: string;
192
194
  selected?: string;
193
195
  };
194
196
  selectMultiple?: {
@@ -197,6 +199,7 @@ export interface GrommetProps {
197
199
  open?: string;
198
200
  optionNotSelected?: string;
199
201
  optionSelected?: string;
202
+ optionsA11y?: string;
200
203
  search?: string;
201
204
  selectAll?: string;
202
205
  selectAllA11y?: string;
@@ -189,7 +189,9 @@ if (process.env.NODE_ENV !== 'production') {
189
189
  upper: _propTypes["default"].string
190
190
  }),
191
191
  select: _propTypes["default"].shape({
192
+ optionsA11y: _propTypes["default"].string,
192
193
  multiple: _propTypes["default"].string,
194
+ searchA11y: _propTypes["default"].string,
193
195
  selected: _propTypes["default"].string
194
196
  }),
195
197
  selectMultiple: _propTypes["default"].shape({
@@ -198,6 +200,7 @@ if (process.env.NODE_ENV !== 'production') {
198
200
  open: _propTypes["default"].string,
199
201
  optionSelected: _propTypes["default"].string,
200
202
  optionNotSelected: _propTypes["default"].string,
203
+ optionsA11y: _propTypes["default"].string,
201
204
  search: _propTypes["default"].string,
202
205
  selectAll: _propTypes["default"].string,
203
206
  selectAllA11y: _propTypes["default"].string,
@@ -259,15 +259,17 @@ var List = exports.List = /*#__PURE__*/_react["default"].forwardRef(function (_r
259
259
  event.persist();
260
260
  updateFocused(nextFocused);
261
261
  var adjustedEvent = event;
262
- adjustedEvent.item = data[nextFocused];
263
- adjustedEvent.index = nextFocused;
262
+ // When paginated, use 'items'
263
+ var currentItems = !paginate ? orderingData || data : items;
264
+ adjustedEvent.item = currentItems[nextFocused];
265
+ adjustedEvent.index = !paginate ? nextFocused : (paginationProps.page - 1) * step + nextFocused;
264
266
  onClickItem(adjustedEvent);
265
267
  sendAnalytics({
266
268
  type: 'listItemClick',
267
269
  element: listRef.current,
268
270
  event: adjustedEvent,
269
- item: data[nextFocused],
270
- index: nextFocused
271
+ item: adjustedEvent.item,
272
+ index: adjustedEvent.index
271
273
  });
272
274
  }
273
275
  }
@@ -306,6 +306,7 @@ var Select = exports.Select = /*#__PURE__*/(0, _react.forwardRef)(function (_ref
306
306
  emptySearchMessage: emptySearchMessage,
307
307
  id: id,
308
308
  labelKey: labelKey,
309
+ messages: messages,
309
310
  multiple: multiple,
310
311
  name: name,
311
312
  onChange: onSelectChange,
@@ -4,7 +4,9 @@ exports.__esModule = true;
4
4
  exports.SelectContainer = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
6
  var _styledComponents = _interopRequireDefault(require("styled-components"));
7
+ var _Search = require("grommet-icons/icons/Search");
7
8
  var _utils = require("../../utils");
9
+ var _MessageContext = require("../../contexts/MessageContext");
8
10
  var _Box = require("../Box");
9
11
  var _Button = require("../Button");
10
12
  var _InfiniteScroll = require("../InfiniteScroll");
@@ -76,7 +78,7 @@ var ClearButton = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
76
78
  });
77
79
  });
78
80
  var SelectContainer = exports.SelectContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref3, ref) {
79
- var _theme$select;
81
+ var _theme$select$icons, _theme$select;
80
82
  var clear = _ref3.clear,
81
83
  _ref3$children = _ref3.children,
82
84
  children = _ref3$children === void 0 ? null : _ref3$children,
@@ -87,6 +89,7 @@ var SelectContainer = exports.SelectContainer = /*#__PURE__*/(0, _react.forwardR
87
89
  emptySearchMessage = _ref3$emptySearchMess === void 0 ? 'No matches found' : _ref3$emptySearchMess,
88
90
  id = _ref3.id,
89
91
  labelKey = _ref3.labelKey,
92
+ messages = _ref3.messages,
90
93
  multiple = _ref3.multiple,
91
94
  name = _ref3.name,
92
95
  onChange = _ref3.onChange,
@@ -125,6 +128,11 @@ var SelectContainer = exports.SelectContainer = /*#__PURE__*/(0, _react.forwardR
125
128
  var optionsRef = (0, _react.useRef)();
126
129
  var clearRef = (0, _react.useRef)();
127
130
  var activeRef = (0, _react.useRef)();
131
+ var _useContext = (0, _react.useContext)(_MessageContext.MessageContext),
132
+ format = _useContext.format;
133
+ var searchIcon = ((_theme$select$icons = theme.select.icons) == null ? void 0 : _theme$select$icons.search) || /*#__PURE__*/_react["default"].createElement(_Search.Search, {
134
+ "aria-hidden": true
135
+ });
128
136
 
129
137
  // for keyboard/screenreader, keep the active option in focus
130
138
  (0, _react.useEffect)(function () {
@@ -307,6 +315,10 @@ var SelectContainer = exports.SelectContainer = /*#__PURE__*/(0, _react.forwardR
307
315
  pad: !customSearchInput ? (_theme$select = theme.select) == null || (_theme$select = _theme$select.search) == null ? void 0 : _theme$select.pad : undefined,
308
316
  flex: false
309
317
  }, /*#__PURE__*/_react["default"].createElement(SelectTextInput, {
318
+ "aria-label": format({
319
+ id: 'select.searchA11y',
320
+ messages: messages
321
+ }),
310
322
  focusIndicator: !customSearchInput,
311
323
  size: "small",
312
324
  ref: searchRef,
@@ -321,7 +333,8 @@ var SelectContainer = exports.SelectContainer = /*#__PURE__*/(0, _react.forwardR
321
333
  },
322
334
  onFocus: function onFocus() {
323
335
  return setActiveIndex(-1);
324
- }
336
+ },
337
+ icon: searchIcon
325
338
  })), shouldShowClearButton('top') && /*#__PURE__*/_react["default"].createElement(ClearButton, {
326
339
  ref: clearRef,
327
340
  clear: clear,
@@ -335,6 +348,10 @@ var SelectContainer = exports.SelectContainer = /*#__PURE__*/(0, _react.forwardR
335
348
  },
336
349
  theme: theme
337
350
  }), options.length > 0 ? /*#__PURE__*/_react["default"].createElement(_StyledSelect.OptionsContainer, {
351
+ "aria-label": format({
352
+ id: 'select.optionsA11y',
353
+ messages: messages
354
+ }),
338
355
  role: "listbox",
339
356
  tabIndex: "-1",
340
357
  ref: optionsRef,
@@ -30,7 +30,12 @@ export interface BasicSelectProps {
30
30
  id?: string;
31
31
  labelKey?: string | ((...args: any[]) => string | React.ReactNode);
32
32
  margin?: MarginType;
33
- messages?: { multiple?: string };
33
+ messages?: {
34
+ optionsA11y?: string;
35
+ multiple?: string;
36
+ searchA11y?: string;
37
+ selected?: string;
38
+ };
34
39
  name?: string;
35
40
  onChange?: (...args: any[]) => void;
36
41
  onClose?: (...args: any[]) => any;
@@ -24,7 +24,10 @@ var genericSelectProps = exports.genericSelectProps = _extends({}, _generalPropT
24
24
  icon: _propTypes["default"].oneOfType([_propTypes["default"].bool, _propTypes["default"].func, _propTypes["default"].node, _propTypes["default"].elementType]),
25
25
  labelKey: _propTypes["default"].oneOfType([_propTypes["default"].string, _propTypes["default"].func]),
26
26
  messages: _propTypes["default"].shape({
27
- multiple: _propTypes["default"].string
27
+ optionsA11y: _propTypes["default"].string,
28
+ multiple: _propTypes["default"].string,
29
+ searchA11y: _propTypes["default"].string,
30
+ selected: _propTypes["default"].string
28
31
  }),
29
32
  name: _propTypes["default"].string,
30
33
  onChange: _propTypes["default"].func,
@@ -3,6 +3,7 @@
3
3
  exports.__esModule = true;
4
4
  exports.SelectMultipleContainer = void 0;
5
5
  var _react = _interopRequireWildcard(require("react"));
6
+ var _Search = require("grommet-icons/icons/Search");
6
7
  var _utils = require("../../utils");
7
8
  var _Box = require("../Box");
8
9
  var _Button = require("../Button");
@@ -20,7 +21,7 @@ var _useThemeValue2 = require("../../utils/useThemeValue");
20
21
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
21
22
  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); }
22
23
  var SelectMultipleContainer = exports.SelectMultipleContainer = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
23
- var _theme$selectMultiple2;
24
+ var _theme$select$icons, _theme$selectMultiple2;
24
25
  var allOptions = _ref.allOptions,
25
26
  _ref$children = _ref.children,
26
27
  children = _ref$children === void 0 ? null : _ref$children,
@@ -79,6 +80,9 @@ var SelectMultipleContainer = exports.SelectMultipleContainer = /*#__PURE__*/(0,
79
80
  setShowA11yLimit = _useState4[1];
80
81
  var clearRef = (0, _react.useRef)();
81
82
  var isDisabled = (0, _utils2.useDisabled)(disabled, disabledKey, options, valueKey || labelKey);
83
+ var searchIcon = ((_theme$select$icons = theme.select.icons) == null ? void 0 : _theme$select$icons.search) || /*#__PURE__*/_react["default"].createElement(_Search.Search, {
84
+ "aria-hidden": true
85
+ });
82
86
 
83
87
  // for keyboard/screenreader, keep the active option in focus
84
88
  (0, _react.useEffect)(function () {
@@ -336,8 +340,13 @@ var SelectMultipleContainer = exports.SelectMultipleContainer = /*#__PURE__*/(0,
336
340
  },
337
341
  onFocus: function onFocus() {
338
342
  return setActiveIndex(-1);
339
- }
343
+ },
344
+ icon: searchIcon
340
345
  }))), helpContent, (options == null ? void 0 : options.length) > 0 ? /*#__PURE__*/_react["default"].createElement(_StyledSelect.OptionsContainer, {
346
+ "aria-label": format({
347
+ id: 'selectMultiple.optionsA11y',
348
+ messages: messages
349
+ }),
341
350
  role: "listbox",
342
351
  tabIndex: "-1",
343
352
  ref: optionsRef,
@@ -15,6 +15,7 @@ export interface SelectMultipleProps extends BasicSelectProps {
15
15
  open?: string;
16
16
  optionNotSelected?: string;
17
17
  optionSelected?: string;
18
+ optionsA11y?: string;
18
19
  search?: string;
19
20
  selectAll?: string;
20
21
  selectAllA11y?: string;
@@ -21,6 +21,7 @@ if (process.env.NODE_ENV !== 'production') {
21
21
  open: _propTypes["default"].string,
22
22
  optionNotSelected: _propTypes["default"].string,
23
23
  optionSelected: _propTypes["default"].string,
24
+ optionsA11y: _propTypes["default"].string,
24
25
  search: _propTypes["default"].string,
25
26
  selectAll: _propTypes["default"].string,
26
27
  selectAllA11y: _propTypes["default"].string,
@@ -96,15 +96,18 @@ var ExpanderControl = function ExpanderControl(_ref) {
96
96
  return content;
97
97
  };
98
98
  var ExpanderCell = function ExpanderCell(_ref2) {
99
+ var _theme$dataTable$expa;
99
100
  var background = _ref2.background,
100
101
  border = _ref2.border,
101
102
  context = _ref2.context,
102
103
  expandLabel = _ref2.expandLabel,
103
104
  rest = _objectWithoutPropertiesLoose(_ref2, _excluded2);
105
+ var _useThemeValue2 = useThemeValue(),
106
+ theme = _useThemeValue2.theme;
104
107
  return /*#__PURE__*/React.createElement(TableCell, {
105
108
  background: background,
106
109
  border: border,
107
- size: "xxsmall",
110
+ size: (_theme$dataTable$expa = theme.dataTable.expand) == null ? void 0 : _theme$dataTable$expa.size,
108
111
  plain: "noPad",
109
112
  verticalAlign: context === 'groupEnd' ? 'bottom' : 'top'
110
113
  }, /*#__PURE__*/React.createElement(ExpanderControl, _extends({