grommet 2.23.0 → 2.24.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 (87) hide show
  1. package/components/Anchor/Anchor.js +2 -3
  2. package/components/CheckBoxGroup/index.d.ts +1 -3
  3. package/components/DataTable/stories/SpaceX.js +6 -4
  4. package/components/DataTable/stories/SpaceXUngrouped.js +4 -2
  5. package/components/Drop/DropContainer.js +6 -2
  6. package/components/FileInput/index.d.ts +6 -1
  7. package/components/Form/stories/HelpAndError.js +1 -1
  8. package/components/Grid/index.d.ts +6 -2
  9. package/components/Layer/Layer.js +1 -1
  10. package/components/Layer/LayerContainer.js +6 -2
  11. package/components/List/List.js +103 -40
  12. package/components/List/index.d.ts +3 -1
  13. package/components/List/propTypes.js +3 -1
  14. package/components/List/stories/Disabled.js +33 -0
  15. package/components/Notification/Notification.js +17 -8
  16. package/components/Notification/index.d.ts +1 -0
  17. package/components/Notification/propTypes.js +1 -0
  18. package/components/PageHeader/PageHeader.js +80 -0
  19. package/components/PageHeader/index.d.ts +26 -0
  20. package/components/PageHeader/index.js +8 -0
  21. package/components/PageHeader/propTypes.js +30 -0
  22. package/components/PageHeader/stories/Custom.js +47 -0
  23. package/components/PageHeader/stories/MultipleActions.js +79 -0
  24. package/components/PageHeader/stories/Responsive.js +37 -0
  25. package/components/PageHeader/stories/Simple.js +36 -0
  26. package/components/RadioButtonGroup/index.d.ts +2 -1
  27. package/components/Select/Select.js +0 -2
  28. package/components/Select/SelectContainer.js +9 -0
  29. package/components/Table/StyledTable.js +1 -1
  30. package/components/TextInput/TextInput.js +32 -3
  31. package/components/TextInput/stories/DefaultSuggestion.js +1 -0
  32. package/components/TextInput/stories/Suggestions.js +1 -0
  33. package/components/Tip/Tip.js +18 -6
  34. package/components/Video/Video.js +100 -46
  35. package/components/Video/index.d.ts +1 -0
  36. package/components/Video/propTypes.js +1 -1
  37. package/components/Video/stories/typescript/ControlsBelow.tsx +6 -2
  38. package/components/index.d.ts +1 -0
  39. package/components/index.js +8 -0
  40. package/es6/components/Anchor/Anchor.js +2 -3
  41. package/es6/components/CheckBoxGroup/index.d.ts +1 -3
  42. package/es6/components/DataTable/stories/SpaceX.js +6 -4
  43. package/es6/components/DataTable/stories/SpaceXUngrouped.js +4 -2
  44. package/es6/components/Drop/DropContainer.js +4 -2
  45. package/es6/components/FileInput/index.d.ts +6 -1
  46. package/es6/components/Form/stories/HelpAndError.js +1 -1
  47. package/es6/components/Grid/index.d.ts +6 -2
  48. package/es6/components/Layer/Layer.js +1 -1
  49. package/es6/components/Layer/LayerContainer.js +4 -2
  50. package/es6/components/List/List.js +104 -41
  51. package/es6/components/List/index.d.ts +3 -1
  52. package/es6/components/List/propTypes.js +3 -1
  53. package/es6/components/List/stories/Disabled.js +20 -0
  54. package/es6/components/Notification/Notification.js +17 -8
  55. package/es6/components/Notification/index.d.ts +1 -0
  56. package/es6/components/Notification/propTypes.js +1 -0
  57. package/es6/components/PageHeader/PageHeader.js +63 -0
  58. package/es6/components/PageHeader/index.d.ts +26 -0
  59. package/es6/components/PageHeader/index.js +1 -0
  60. package/es6/components/PageHeader/propTypes.js +19 -0
  61. package/es6/components/PageHeader/stories/Custom.js +32 -0
  62. package/es6/components/PageHeader/stories/MultipleActions.js +63 -0
  63. package/es6/components/PageHeader/stories/Responsive.js +25 -0
  64. package/es6/components/PageHeader/stories/Simple.js +24 -0
  65. package/es6/components/RadioButtonGroup/index.d.ts +2 -1
  66. package/es6/components/Select/Select.js +0 -2
  67. package/es6/components/Select/SelectContainer.js +9 -0
  68. package/es6/components/Table/StyledTable.js +1 -1
  69. package/es6/components/TextInput/TextInput.js +32 -3
  70. package/es6/components/TextInput/stories/DefaultSuggestion.js +1 -0
  71. package/es6/components/TextInput/stories/Suggestions.js +1 -0
  72. package/es6/components/Tip/Tip.js +18 -6
  73. package/es6/components/Video/Video.js +99 -46
  74. package/es6/components/Video/index.d.ts +1 -0
  75. package/es6/components/Video/propTypes.js +1 -1
  76. package/es6/components/Video/stories/typescript/ControlsBelow.tsx +6 -2
  77. package/es6/components/index.d.ts +1 -0
  78. package/es6/components/index.js +1 -0
  79. package/es6/languages/default.json +4 -1
  80. package/es6/themes/base.d.ts +47 -7
  81. package/es6/themes/base.js +72 -1
  82. package/grommet.min.js +1 -1
  83. package/grommet.min.js.map +1 -1
  84. package/languages/default.json +4 -1
  85. package/package.json +30 -26
  86. package/themes/base.d.ts +47 -7
  87. package/themes/base.js +73 -1
@@ -11,6 +11,8 @@ var _useIsomorphicLayoutEffect = require("../../utils/use-isomorphic-layout-effe
11
11
 
12
12
  var _defaultProps = require("../../default-props");
13
13
 
14
+ var _AnnounceContext = require("../../contexts/AnnounceContext");
15
+
14
16
  var _Box = require("../Box");
15
17
 
16
18
  var _Button = require("../Button");
@@ -86,6 +88,8 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
86
88
  var _useContext = (0, _react.useContext)(_MessageContext.MessageContext),
87
89
  format = _useContext.format;
88
90
 
91
+ var announce = (0, _react.useContext)(_AnnounceContext.AnnounceContext);
92
+
89
93
  var _useState = (0, _react.useState)([]),
90
94
  captions = _useState[0],
91
95
  setCaptions = _useState[1];
@@ -106,29 +110,33 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
106
110
  playing = _useState5[0],
107
111
  setPlaying = _useState5[1];
108
112
 
109
- var _useState6 = (0, _react.useState)(),
110
- scrubTime = _useState6[0],
111
- setScrubTime = _useState6[1];
113
+ var _useState6 = (0, _react.useState)(false),
114
+ announceAudioDescription = _useState6[0],
115
+ setAnnounceAudioDescription = _useState6[1];
112
116
 
113
117
  var _useState7 = (0, _react.useState)(),
114
- volume = _useState7[0],
115
- setVolume = _useState7[1];
118
+ scrubTime = _useState7[0],
119
+ setScrubTime = _useState7[1];
116
120
 
117
- var _useState8 = (0, _react.useState)(false),
118
- hasPlayed = _useState8[0],
119
- setHasPlayed = _useState8[1];
121
+ var _useState8 = (0, _react.useState)(),
122
+ volume = _useState8[0],
123
+ setVolume = _useState8[1];
120
124
 
121
- var _useState9 = (0, _react.useState)(),
122
- interacting = _useState9[0],
123
- setInteracting = _useState9[1];
125
+ var _useState9 = (0, _react.useState)(false),
126
+ hasPlayed = _useState9[0],
127
+ setHasPlayed = _useState9[1];
124
128
 
125
129
  var _useState10 = (0, _react.useState)(),
126
- height = _useState10[0],
127
- setHeight = _useState10[1];
130
+ interacting = _useState10[0],
131
+ setInteracting = _useState10[1];
128
132
 
129
133
  var _useState11 = (0, _react.useState)(),
130
- width = _useState11[0],
131
- setWidth = _useState11[1];
134
+ height = _useState11[0],
135
+ setHeight = _useState11[1];
136
+
137
+ var _useState12 = (0, _react.useState)(),
138
+ width = _useState12[0],
139
+ setWidth = _useState12[1];
132
140
 
133
141
  var containerRef = (0, _react.useRef)();
134
142
  var scrubberRef = (0, _react.useRef)();
@@ -182,7 +190,12 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
182
190
  return function () {
183
191
  return clearTimeout(timer);
184
192
  };
185
- }, [interacting]);
193
+ }, [interacting]); // track which audio description track is active
194
+
195
+ var _useState13 = (0, _react.useState)(),
196
+ activeTrack = _useState13[0],
197
+ setActiveTrack = _useState13[1];
198
+
186
199
  (0, _useIsomorphicLayoutEffect.useLayoutEffect)(function () {
187
200
  var video = videoRef.current;
188
201
 
@@ -212,48 +225,66 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
212
225
 
213
226
 
214
227
  var textTracks = video.textTracks;
228
+ var nextCaptions = [];
229
+ var set = false; // iterate through all of the tracks provided
215
230
 
216
- if (textTracks.length > 0) {
217
- if (textTracks.length === 1) {
218
- // only one track was provided
219
- var track = textTracks[0];
220
- var active = track.mode === 'showing';
221
-
222
- if (!captions || !captions[0] || captions[0].active !== active) {
223
- // get label if provided and if the track is active
224
- // (currently showing) or not
225
- setCaptions([{
226
- label: track.label,
227
- active: active
228
- }]);
229
- }
230
- } else {
231
- // multiple tracks provided
232
- var nextCaptions = [];
233
- var set = false;
231
+ var _loop = function _loop(i) {
232
+ var track = textTracks[i];
233
+ var active = track.mode === 'showing';
234
234
 
235
- for (var i = 0; i < textTracks.length; i += 1) {
236
- var _track = textTracks[i];
235
+ var getActiveTrack = function getActiveTrack(currentVideoTime) {
236
+ var nextActiveTrack;
237
237
 
238
- var _active = _track.mode === 'showing';
238
+ for (var j = 0; j < track.cues.length; j += 1) {
239
+ var _track$cues$j, _track$cues$j2;
239
240
 
240
- nextCaptions.push({
241
- label: _track.label,
242
- active: _active
243
- });
241
+ if (currentVideoTime > (track == null ? void 0 : (_track$cues$j = track.cues[j]) == null ? void 0 : _track$cues$j.startTime) && currentVideoTime < (track == null ? void 0 : (_track$cues$j2 = track.cues[j]) == null ? void 0 : _track$cues$j2.endTime)) {
242
+ var _track$cues$j3;
244
243
 
245
- if (!captions || !captions[i] || captions[i].active !== _active) {
246
- set = true;
244
+ nextActiveTrack = track == null ? void 0 : (_track$cues$j3 = track.cues[j]) == null ? void 0 : _track$cues$j3.text;
247
245
  }
248
246
  }
249
247
 
248
+ return nextActiveTrack;
249
+ }; // track is an audio description
250
+
251
+
252
+ if (track.kind === 'descriptions') {
253
+ if (announceAudioDescription) {
254
+ video.ontimeupdate = function () {
255
+ var nextActiveTrack = getActiveTrack(video.currentTime);
256
+
257
+ if (activeTrack !== nextActiveTrack) {
258
+ if (nextActiveTrack) {
259
+ announce(nextActiveTrack, 'assertive');
260
+ }
261
+
262
+ setActiveTrack(nextActiveTrack);
263
+ }
264
+ };
265
+ }
266
+ } // otherwise treat as captions
267
+ else {
268
+ nextCaptions.push({
269
+ label: track.label,
270
+ active: active
271
+ });
272
+
273
+ if (!captions || !captions[i] || captions[i].active !== active) {
274
+ set = true;
275
+ }
276
+
250
277
  if (set) {
251
278
  setCaptions(nextCaptions);
252
279
  }
253
280
  }
281
+ };
282
+
283
+ for (var i = 0; i < textTracks.length; i += 1) {
284
+ _loop(i);
254
285
  }
255
286
  }
256
- }, [captions, height, videoRef, width]);
287
+ }, [activeTrack, announce, announceAudioDescription, captions, height, videoRef, width]);
257
288
  var play = (0, _react.useCallback)(function () {
258
289
  return videoRef.current.play();
259
290
  }, [videoRef]);
@@ -330,7 +361,8 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
330
361
  Pause: theme.video.icons.pause,
331
362
  Play: theme.video.icons.play,
332
363
  ReduceVolume: theme.video.icons.reduceVolume,
333
- Volume: theme.video.icons.volume
364
+ Volume: theme.video.icons.volume,
365
+ Description: theme.video.icons.description
334
366
  };
335
367
  var captionControls = captions.map(function (caption, index) {
336
368
  return {
@@ -339,7 +371,10 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
339
371
  }),
340
372
  label: caption.label,
341
373
  active: caption.active,
342
- a11yTitle: caption.label || 'video.captions',
374
+ a11yTitle: caption.label || format({
375
+ id: 'video.captions',
376
+ messages: messages
377
+ }),
343
378
  onClick: function onClick() {
344
379
  showCaptions(caption.active ? -1 : index);
345
380
  var updatedCaptions = [];
@@ -355,6 +390,19 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
355
390
  }
356
391
  };
357
392
  });
393
+ var descriptionControls = {
394
+ icon: /*#__PURE__*/_react["default"].createElement(Icons.Description, {
395
+ color: iconColor
396
+ }),
397
+ a11yTitle: format({
398
+ id: 'video.audioDescriptions',
399
+ messages: messages
400
+ }),
401
+ active: announceAudioDescription,
402
+ onClick: function onClick() {
403
+ return setAnnounceAudioDescription(!announceAudioDescription);
404
+ }
405
+ };
358
406
  var volumeControls = ['volume', 'reduceVolume'].map(function (control) {
359
407
  return {
360
408
  icon: control === 'volume' ? /*#__PURE__*/_react["default"].createElement(Icons.Volume, {
@@ -382,6 +430,7 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
382
430
  });
383
431
  var buttonProps = {
384
432
  captions: captionControls,
433
+ descriptions: descriptionControls,
385
434
  volume: volumeControls,
386
435
  fullScreen: {
387
436
  icon: /*#__PURE__*/_react["default"].createElement(Icons.FullScreen, {
@@ -433,6 +482,11 @@ var Video = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
433
482
  return undefined;
434
483
  }
435
484
 
485
+ if (item === 'descriptions') {
486
+ controlsMenuItems.push(buttonProps[item]);
487
+ return undefined;
488
+ }
489
+
436
490
  if (typeof item === 'string') {
437
491
  return controlsMenuItems.push(buttonProps[item]);
438
492
  }
@@ -9,6 +9,7 @@ import {
9
9
 
10
10
  type controlsItems =
11
11
  | 'captions'
12
+ | 'descriptions'
12
13
  | 'fullScreen'
13
14
  | 'play'
14
15
  | 'pause'
@@ -18,7 +18,7 @@ if (process.env.NODE_ENV !== 'production') {
18
18
  autoPlay: _propTypes["default"].bool,
19
19
  controls: _propTypes["default"].oneOfType([_propTypes["default"].oneOf([false, 'over', 'below']), _propTypes["default"].shape({
20
20
  position: _propTypes["default"].oneOf([false, 'over', 'below']),
21
- items: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].oneOf(['captions', 'fullScreen', 'play', 'pause', 'volume']), _propTypes["default"].shape({
21
+ items: _propTypes["default"].arrayOf(_propTypes["default"].oneOfType([_propTypes["default"].oneOf(['captions', 'descriptions', 'fullScreen', 'play', 'pause', 'volume']), _propTypes["default"].shape({
22
22
  icon: _propTypes["default"].element,
23
23
  a11yTitle: _propTypes["default"].string,
24
24
  onClick: _propTypes["default"].func,
@@ -6,7 +6,10 @@ export const ControlsBelow = () => (
6
6
  <Box align="center" pad="large">
7
7
  <Video
8
8
  skipInterval={2}
9
- controls={{ position: 'below', items: ['captions'] }}
9
+ controls={{
10
+ position: 'below',
11
+ items: ['captions', 'descriptions'],
12
+ }}
10
13
  >
11
14
  <source src="small.mp4" type="video/mp4" />
12
15
  <source
@@ -21,7 +24,8 @@ export const ControlsBelow = () => (
21
24
  src="http://techslides.com/demos/sample-videos/small.3gp"
22
25
  type="video/3gp"
23
26
  />
24
- <track kind="subtitles" srcLang="en" src="small-en.vtt" />
27
+ <track kind="captions" srcLang="en" src="small-en.vtt" />
28
+ <track kind="descriptions" srcLang="en" src="small-en-description.vtt" />
25
29
  </Video>
26
30
  </Box>
27
31
  );
@@ -40,6 +40,7 @@ export * from './Markdown';
40
40
  export * from './MaskedInput';
41
41
  export * from './Menu';
42
42
  export * from './Meter';
43
+ export * from './PageHeader';
43
44
  export * from './Pagination';
44
45
  export * from './Paragraph';
45
46
  export * from './Nav';
@@ -354,6 +354,14 @@ Object.keys(_PageContent).forEach(function (key) {
354
354
  exports[key] = _PageContent[key];
355
355
  });
356
356
 
357
+ var _PageHeader = require("./PageHeader");
358
+
359
+ Object.keys(_PageHeader).forEach(function (key) {
360
+ if (key === "default" || key === "__esModule") return;
361
+ if (key in exports && exports[key] === _PageHeader[key]) return;
362
+ exports[key] = _PageHeader[key];
363
+ });
364
+
357
365
  var _Pagination = require("./Pagination");
358
366
 
359
367
  Object.keys(_Pagination).forEach(function (key) {
@@ -17,8 +17,7 @@ var Anchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
17
17
  children = _ref.children,
18
18
  color = _ref.color,
19
19
  disabled = _ref.disabled,
20
- _ref$gap = _ref.gap,
21
- gap = _ref$gap === void 0 ? 'small' : _ref$gap,
20
+ gap = _ref.gap,
22
21
  href = _ref.href,
23
22
  icon = _ref.icon,
24
23
  label = _ref.label,
@@ -72,7 +71,7 @@ var Anchor = /*#__PURE__*/forwardRef(function (_ref, ref) {
72
71
  as: "span",
73
72
  direction: "row",
74
73
  align: "center",
75
- gap: gap,
74
+ gap: gap || theme.anchor.gap,
76
75
  responsive: false,
77
76
  style: {
78
77
  display: 'inline-flex'
@@ -10,9 +10,7 @@ interface OnChangeEvent {
10
10
 
11
11
  export interface CheckBoxType
12
12
  extends Omit<CheckBoxProps & JSX.IntrinsicElements['input'], 'checked'> {
13
- [key: CheckBoxGroupProps['labelKey'] | CheckBoxGroupProps['valueKey']]:
14
- | CheckBoxProps['label']
15
- | JSX.IntrinsicElements['input']['value'];
13
+ [key: string]: any;
16
14
  }
17
15
 
18
16
  export interface CheckBoxGroupProps {
@@ -1,3 +1,5 @@
1
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
2
+
1
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
4
 
3
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -127,9 +129,9 @@ export var SpaceX = function SpaceX() {
127
129
  }, [groups]);
128
130
  useEffect(function () {
129
131
  var fetchData = /*#__PURE__*/function () {
130
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
132
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
131
133
  var query;
132
- return regeneratorRuntime.wrap(function _callee$(_context) {
134
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
133
135
  while (1) {
134
136
  switch (_context.prev = _context.next) {
135
137
  case 0:
@@ -169,11 +171,11 @@ export var SpaceX = function SpaceX() {
169
171
  }, []);
170
172
  useEffect(function () {
171
173
  var fetchData = /*#__PURE__*/function () {
172
- var _ref6 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2() {
174
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
173
175
  var _sort;
174
176
 
175
177
  var query;
176
- return regeneratorRuntime.wrap(function _callee2$(_context2) {
178
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
177
179
  while (1) {
178
180
  switch (_context2.prev = _context2.next) {
179
181
  case 0:
@@ -1,3 +1,5 @@
1
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
2
+
1
3
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
2
4
 
3
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
@@ -66,11 +68,11 @@ export var SpaceXUngrouped = function SpaceXUngrouped() {
66
68
 
67
69
  useEffect(function () {
68
70
  var fetchData = /*#__PURE__*/function () {
69
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
71
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
70
72
  var _sort;
71
73
 
72
74
  var query;
73
- return regeneratorRuntime.wrap(function _callee$(_context) {
75
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
74
76
  while (1) {
75
77
  switch (_context.prev = _context.next) {
76
78
  case 0:
@@ -6,6 +6,7 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
6
6
 
7
7
  import React, { forwardRef, useContext, useEffect, useMemo, useRef } from 'react';
8
8
  import { ThemeContext } from 'styled-components';
9
+ import { ContainerTargetContext } from '../../contexts/ContainerTargetContext';
9
10
  import { FocusedContainer } from '../FocusedContainer';
10
11
  import { backgroundIsDark, findScrollParents, parseMetricToNum, PortalContext } from '../../utils';
11
12
  import { defaultProps } from '../../default-props';
@@ -50,6 +51,7 @@ var DropContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
50
51
  trapFocus = _ref.trapFocus,
51
52
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
52
53
 
54
+ var containerTarget = useContext(ContainerTargetContext);
53
55
  var theme = useContext(ThemeContext) || defaultProps.theme;
54
56
  var portalContext = useContext(PortalContext) || defaultPortalContext;
55
57
  var portalId = useMemo(function () {
@@ -260,7 +262,7 @@ var DropContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
260
262
  var onClickDocument = function onClickDocument(event) {
261
263
  // determine which portal id the target is in, if any
262
264
  var clickedPortalId = null;
263
- var node = event.target;
265
+ var node = containerTarget === document.body ? event.target : event == null ? void 0 : event.path[0];
264
266
 
265
267
  while (clickedPortalId === null && node !== document) {
266
268
  var attr = node.getAttribute('data-g-portal-id');
@@ -295,7 +297,7 @@ var DropContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
295
297
  document.removeEventListener('mousedown', onClickDocument);
296
298
  }
297
299
  };
298
- }, [align, onAlign, dropTarget, onClickOutside, portalContext, portalId, ref, responsive, restrictFocus, stretch, theme.drop]);
300
+ }, [align, containerTarget, onAlign, dropTarget, onClickOutside, portalContext, portalId, ref, responsive, restrictFocus, stretch, theme.drop]);
299
301
  useEffect(function () {
300
302
  if (restrictFocus) {
301
303
  (ref || dropRef).current.focus();
@@ -22,10 +22,15 @@ export interface FileInputProps {
22
22
  };
23
23
  multiple?: boolean | { aggregateThreshold?: number; max?: number };
24
24
  name?: string;
25
+ onChange?: (
26
+ event?: React.ChangeEvent<HTMLInputElement>,
27
+ { files }?: { files: object },
28
+ { target }?: { target: { files: object } },
29
+ ) => void;
25
30
  renderFile?: (...args: any[]) => void;
26
31
  }
27
32
 
28
- type inputProps = Omit<JSX.IntrinsicElements['input'], 'multiple'>;
33
+ type inputProps = Omit<JSX.IntrinsicElements['input'], 'multiple' | 'onChange'>;
29
34
 
30
35
  export interface FileInputExtendedProps extends FileInputProps, inputProps {}
31
36
 
@@ -20,7 +20,7 @@ export var HelpAndError = function HelpAndError() {
20
20
  onChange: function onChange() {}
21
21
  }))), /*#__PURE__*/React.createElement(Form, null, /*#__PURE__*/React.createElement(FormField, {
22
22
  label: "Email",
23
- htmlFor: "text-input",
23
+ htmlFor: "email",
24
24
  help: /*#__PURE__*/React.createElement(Text, {
25
25
  weight: "lighter",
26
26
  size: "small"
@@ -41,17 +41,21 @@ export type GridColumnsType =
41
41
  count?: 'fit' | 'fill' | number;
42
42
  size?: GridSizeType;
43
43
  };
44
+
45
+ export type GridGapType = GapType | { row?: GapType; column?: GapType };
46
+
47
+ export type AreasType = { name?: string; start?: number[]; end?: number[] }[] | string[][];
44
48
  export interface GridProps {
45
49
  a11yTitle?: A11yTitleType;
46
50
  alignSelf?: AlignSelfType;
47
51
  align?: AlignType;
48
52
  alignContent?: AlignContentType;
49
- areas?: { name?: string; start?: number[]; end?: number[] }[] | string[][];
53
+ areas?: AreasType;
50
54
  as?: PolymorphicType;
51
55
  border?: BorderType;
52
56
  columns?: GridColumnsType;
53
57
  fill?: FillType;
54
- gap?: GapType | { row?: GapType; column?: GapType };
58
+ gap?: GridGapType;
55
59
  gridArea?: GridAreaType;
56
60
  height?: HeightType;
57
61
  justify?: 'start' | 'center' | 'end' | 'stretch';
@@ -62,7 +62,7 @@ var Layer = /*#__PURE__*/forwardRef(function (props, ref) {
62
62
 
63
63
  setTimeout(function () {
64
64
  // we add the id and query here so the unit tests work
65
- var clone = document.getElementById('layerClone');
65
+ var clone = containerTarget === document.body ? document.getElementById('layerClone') : containerTarget.getElementById('layerClone');
66
66
 
67
67
  if (clone) {
68
68
  containerTarget.removeChild(clone);
@@ -11,6 +11,7 @@ import { FocusedContainer } from '../FocusedContainer';
11
11
  import { Keyboard } from '../Keyboard';
12
12
  import { ResponsiveContext } from '../../contexts/ResponsiveContext';
13
13
  import { OptionsContext } from '../../contexts/OptionsContext';
14
+ import { ContainerTargetContext } from '../../contexts/ContainerTargetContext';
14
15
  import { backgroundIsDark, findVisibleParent, PortalContext } from '../../utils';
15
16
  import { StyledLayer, StyledContainer, StyledOverlay } from './StyledLayer';
16
17
  var HiddenAnchor = styled.a.withConfig({
@@ -38,6 +39,7 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
38
39
  layerTarget = _ref.target,
39
40
  rest = _objectWithoutPropertiesLoose(_ref, _excluded);
40
41
 
42
+ var containerTarget = useContext(ContainerTargetContext);
41
43
  var theme = useContext(ThemeContext) || defaultProps.theme;
42
44
  var size = useContext(ResponsiveContext); // layerOptions was created to preserve backwards compatibility but
43
45
  // should not be supported in v3
@@ -89,7 +91,7 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
89
91
  var onClickDocument = function onClickDocument(event) {
90
92
  // determine which portal id the target is in, if any
91
93
  var clickedPortalId = null;
92
- var node = event.target;
94
+ var node = containerTarget === document.body ? event.target : event == null ? void 0 : event.path[0];
93
95
 
94
96
  while (clickedPortalId === null && node !== document && node !== null) {
95
97
  // check if user click occurred within the layer
@@ -156,7 +158,7 @@ var LayerContainer = /*#__PURE__*/forwardRef(function (_ref, ref) {
156
158
  document.removeEventListener('mousedown', onClickDocument);
157
159
  }
158
160
  };
159
- }, [layerTarget, onClickOutside, portalContext, portalId]);
161
+ }, [containerTarget, layerTarget, onClickOutside, portalContext, portalId]);
160
162
  var content = /*#__PURE__*/React.createElement(StyledContainer, _extends({
161
163
  ref: ref || containerRef,
162
164
  background: background,