@iabbb/bds-react 0.40.0-beta.2 → 0.40.0-beta.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.mjs CHANGED
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
- import ErrorSummary from '@iabbb/bds/ErrorSummary';
3
2
 
4
3
  function _iterableToArrayLimit(r, l) {
5
4
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
@@ -49,6 +48,28 @@ function _objectSpread2(e) {
49
48
  }
50
49
  return e;
51
50
  }
51
+ function _classCallCheck(instance, Constructor) {
52
+ if (!(instance instanceof Constructor)) {
53
+ throw new TypeError("Cannot call a class as a function");
54
+ }
55
+ }
56
+ function _defineProperties(target, props) {
57
+ for (var i = 0; i < props.length; i++) {
58
+ var descriptor = props[i];
59
+ descriptor.enumerable = descriptor.enumerable || false;
60
+ descriptor.configurable = true;
61
+ if ("value" in descriptor) descriptor.writable = true;
62
+ Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
63
+ }
64
+ }
65
+ function _createClass(Constructor, protoProps, staticProps) {
66
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
67
+ if (staticProps) _defineProperties(Constructor, staticProps);
68
+ Object.defineProperty(Constructor, "prototype", {
69
+ writable: false
70
+ });
71
+ return Constructor;
72
+ }
52
73
  function _defineProperty(obj, key, value) {
53
74
  key = _toPropertyKey(key);
54
75
  if (key in obj) {
@@ -77,6 +98,90 @@ function _extends() {
77
98
  };
78
99
  return _extends.apply(this, arguments);
79
100
  }
101
+ function _inherits(subClass, superClass) {
102
+ if (typeof superClass !== "function" && superClass !== null) {
103
+ throw new TypeError("Super expression must either be null or a function");
104
+ }
105
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
106
+ constructor: {
107
+ value: subClass,
108
+ writable: true,
109
+ configurable: true
110
+ }
111
+ });
112
+ Object.defineProperty(subClass, "prototype", {
113
+ writable: false
114
+ });
115
+ if (superClass) _setPrototypeOf(subClass, superClass);
116
+ }
117
+ function _getPrototypeOf(o) {
118
+ _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
119
+ return o.__proto__ || Object.getPrototypeOf(o);
120
+ };
121
+ return _getPrototypeOf(o);
122
+ }
123
+ function _setPrototypeOf(o, p) {
124
+ _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
125
+ o.__proto__ = p;
126
+ return o;
127
+ };
128
+ return _setPrototypeOf(o, p);
129
+ }
130
+ function _isNativeReflectConstruct() {
131
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
132
+ if (Reflect.construct.sham) return false;
133
+ if (typeof Proxy === "function") return true;
134
+ try {
135
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
136
+ return true;
137
+ } catch (e) {
138
+ return false;
139
+ }
140
+ }
141
+ function _construct(Parent, args, Class) {
142
+ if (_isNativeReflectConstruct()) {
143
+ _construct = Reflect.construct.bind();
144
+ } else {
145
+ _construct = function _construct(Parent, args, Class) {
146
+ var a = [null];
147
+ a.push.apply(a, args);
148
+ var Constructor = Function.bind.apply(Parent, a);
149
+ var instance = new Constructor();
150
+ if (Class) _setPrototypeOf(instance, Class.prototype);
151
+ return instance;
152
+ };
153
+ }
154
+ return _construct.apply(null, arguments);
155
+ }
156
+ function _isNativeFunction(fn) {
157
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
158
+ }
159
+ function _wrapNativeSuper(Class) {
160
+ var _cache = typeof Map === "function" ? new Map() : undefined;
161
+ _wrapNativeSuper = function _wrapNativeSuper(Class) {
162
+ if (Class === null || !_isNativeFunction(Class)) return Class;
163
+ if (typeof Class !== "function") {
164
+ throw new TypeError("Super expression must either be null or a function");
165
+ }
166
+ if (typeof _cache !== "undefined") {
167
+ if (_cache.has(Class)) return _cache.get(Class);
168
+ _cache.set(Class, Wrapper);
169
+ }
170
+ function Wrapper() {
171
+ return _construct(Class, arguments, _getPrototypeOf(this).constructor);
172
+ }
173
+ Wrapper.prototype = Object.create(Class.prototype, {
174
+ constructor: {
175
+ value: Wrapper,
176
+ enumerable: false,
177
+ writable: true,
178
+ configurable: true
179
+ }
180
+ });
181
+ return _setPrototypeOf(Wrapper, Class);
182
+ };
183
+ return _wrapNativeSuper(Class);
184
+ }
80
185
  function _objectWithoutPropertiesLoose(source, excluded) {
81
186
  if (source == null) return {};
82
187
  var target = {};
@@ -104,6 +209,34 @@ function _objectWithoutProperties(source, excluded) {
104
209
  }
105
210
  return target;
106
211
  }
212
+ function _assertThisInitialized(self) {
213
+ if (self === void 0) {
214
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
215
+ }
216
+ return self;
217
+ }
218
+ function _possibleConstructorReturn(self, call) {
219
+ if (call && (typeof call === "object" || typeof call === "function")) {
220
+ return call;
221
+ } else if (call !== void 0) {
222
+ throw new TypeError("Derived constructors may only return object or undefined");
223
+ }
224
+ return _assertThisInitialized(self);
225
+ }
226
+ function _createSuper(Derived) {
227
+ var hasNativeReflectConstruct = _isNativeReflectConstruct();
228
+ return function _createSuperInternal() {
229
+ var Super = _getPrototypeOf(Derived),
230
+ result;
231
+ if (hasNativeReflectConstruct) {
232
+ var NewTarget = _getPrototypeOf(this).constructor;
233
+ result = Reflect.construct(Super, arguments, NewTarget);
234
+ } else {
235
+ result = Super.apply(this, arguments);
236
+ }
237
+ return _possibleConstructorReturn(this, result);
238
+ };
239
+ }
107
240
  function _slicedToArray(arr, i) {
108
241
  return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
109
242
  }
@@ -152,6 +285,21 @@ function _toPropertyKey(arg) {
152
285
  var key = _toPrimitive(arg, "string");
153
286
  return typeof key === "symbol" ? key : String(key);
154
287
  }
288
+ function _classPrivateMethodGet(receiver, privateSet, fn) {
289
+ if (!privateSet.has(receiver)) {
290
+ throw new TypeError("attempted to get private field on non-instance");
291
+ }
292
+ return fn;
293
+ }
294
+ function _checkPrivateRedeclaration(obj, privateCollection) {
295
+ if (privateCollection.has(obj)) {
296
+ throw new TypeError("Cannot initialize the same private elements twice on an object");
297
+ }
298
+ }
299
+ function _classPrivateMethodInitSpec(obj, privateSet) {
300
+ _checkPrivateRedeclaration(obj, privateSet);
301
+ privateSet.add(obj);
302
+ }
155
303
 
156
304
  var _excluded$5 = ["children", "className", "onClick", "preventDoubleClick", "variant"];
157
305
  var DEBOUNCE_TIMEOUT_IN_SECONDS = 1;
@@ -217,6 +365,422 @@ var CallToAction = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
217
365
  }, props), children);
218
366
  });
219
367
 
368
+ // Shim the global element internals object
369
+ // Methods should be fine as noops and properties can generally
370
+ // be while on the server.
371
+ var ElementInternalsShim = /*#__PURE__*/function () {
372
+ function ElementInternals(_host) {
373
+ _classCallCheck(this, ElementInternals);
374
+ this.ariaAtomic = '';
375
+ this.ariaAutoComplete = '';
376
+ this.ariaBraileLabel = '';
377
+ this.ariaBraileRoleDescription = '';
378
+ this.ariaBusy = '';
379
+ this.ariaChecked = '';
380
+ this.ariaColCount = '';
381
+ this.ariaColIndex = '';
382
+ this.ariaColSpan = '';
383
+ this.ariaCurrent = '';
384
+ this.ariaDescription = '';
385
+ this.ariaDisabled = '';
386
+ this.ariaExpanded = '';
387
+ this.ariaHasPopup = '';
388
+ this.ariaHidden = '';
389
+ this.ariaInvalid = '';
390
+ this.ariaKeyShortcuts = '';
391
+ this.ariaLabel = '';
392
+ this.ariaLevel = '';
393
+ this.ariaLive = '';
394
+ this.ariaModal = '';
395
+ this.ariaMultiLine = '';
396
+ this.ariaMultiSelectable = '';
397
+ this.ariaOrientation = '';
398
+ this.ariaPlaceholder = '';
399
+ this.ariaPosInSet = '';
400
+ this.ariaPressed = '';
401
+ this.ariaReadOnly = '';
402
+ this.ariaRequired = '';
403
+ this.ariaRoleDescription = '';
404
+ this.ariaRowCount = '';
405
+ this.ariaRowIndex = '';
406
+ this.ariaRowSpan = '';
407
+ this.ariaSelected = '';
408
+ this.ariaSetSize = '';
409
+ this.ariaSort = '';
410
+ this.ariaValueMax = '';
411
+ this.ariaValueMin = '';
412
+ this.ariaValueNow = '';
413
+ this.ariaValueText = '';
414
+ this.role = '';
415
+ this.form = null;
416
+ this.labels = [];
417
+ this.states = new Set();
418
+ this.validationMessage = '';
419
+ this.validity = {};
420
+ this.willValidate = true;
421
+ this.__host = _host;
422
+ }
423
+ _createClass(ElementInternals, [{
424
+ key: "shadowRoot",
425
+ get: function get() {
426
+ // Grab the shadow root instance from the Element shim
427
+ // to ensure that the shadow root is always available
428
+ // to the internals instance even if the mode is 'closed'
429
+ return this.__host.__shadowRoot;
430
+ }
431
+ }, {
432
+ key: "checkValidity",
433
+ value: function checkValidity() {
434
+ // TODO(augustjk) Consider actually implementing logic.
435
+ // See https://github.com/lit/lit/issues/3740
436
+ console.warn('`ElementInternals.checkValidity()` was called on the server.' + 'This method always returns true.');
437
+ return true;
438
+ }
439
+ }, {
440
+ key: "reportValidity",
441
+ value: function reportValidity() {
442
+ return true;
443
+ }
444
+ }, {
445
+ key: "setFormValue",
446
+ value: function setFormValue() {}
447
+ }, {
448
+ key: "setValidity",
449
+ value: function setValidity() {}
450
+ }]);
451
+ return ElementInternals;
452
+ }();
453
+
454
+ var attributes = new WeakMap();
455
+ var attributesForElement = function attributesForElement(element) {
456
+ var attrs = attributes.get(element);
457
+ if (attrs === undefined) {
458
+ attributes.set(element, attrs = new Map());
459
+ }
460
+ return attrs;
461
+ };
462
+ // The typings around the exports below are a little funky:
463
+ //
464
+ // 1. We want the `name` of the shim classes to match the real ones at runtime,
465
+ // hence e.g. `class Element`.
466
+ // 2. We can't shadow the global types with a simple class declaration, because
467
+ // then we can't reference the global types for casting, hence e.g.
468
+ // `const ElementShim = class Element`.
469
+ // 3. We want to export the classes typed as the real ones, hence e.g.
470
+ // `const ElementShimWithRealType = ElementShim as object as typeof Element;`.
471
+ // 4. We want the exported names to match the real ones, hence e.g.
472
+ // `export {ElementShimWithRealType as Element}`.
473
+ var ElementShim = /*#__PURE__*/function () {
474
+ function Element() {
475
+ _classCallCheck(this, Element);
476
+ this.__shadowRootMode = null;
477
+ this.__shadowRoot = null;
478
+ this.__internals = null;
479
+ }
480
+ _createClass(Element, [{
481
+ key: "attributes",
482
+ get: function get() {
483
+ return Array.from(attributesForElement(this)).map(function (_ref) {
484
+ var _ref2 = _slicedToArray(_ref, 2),
485
+ name = _ref2[0],
486
+ value = _ref2[1];
487
+ return {
488
+ name: name,
489
+ value: value
490
+ };
491
+ });
492
+ }
493
+ }, {
494
+ key: "shadowRoot",
495
+ get: function get() {
496
+ if (this.__shadowRootMode === 'closed') {
497
+ return null;
498
+ }
499
+ return this.__shadowRoot;
500
+ }
501
+ }, {
502
+ key: "setAttribute",
503
+ value: function setAttribute(name, value) {
504
+ // Emulate browser behavior that silently casts all values to string. E.g.
505
+ // `42` becomes `"42"` and `{}` becomes `"[object Object]""`.
506
+ attributesForElement(this).set(name, String(value));
507
+ }
508
+ }, {
509
+ key: "removeAttribute",
510
+ value: function removeAttribute(name) {
511
+ attributesForElement(this)["delete"](name);
512
+ }
513
+ }, {
514
+ key: "hasAttribute",
515
+ value: function hasAttribute(name) {
516
+ return attributesForElement(this).has(name);
517
+ }
518
+ }, {
519
+ key: "attachShadow",
520
+ value: function attachShadow(init) {
521
+ var shadowRoot = {
522
+ host: this
523
+ };
524
+ this.__shadowRootMode = init.mode;
525
+ if (init && init.mode === 'open') {
526
+ this.__shadowRoot = shadowRoot;
527
+ }
528
+ return shadowRoot;
529
+ }
530
+ }, {
531
+ key: "attachInternals",
532
+ value: function attachInternals() {
533
+ if (this.__internals !== null) {
534
+ throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': " + "ElementInternals for the specified element was already attached.");
535
+ }
536
+ var internals = new ElementInternalsShim(this);
537
+ this.__internals = internals;
538
+ return internals;
539
+ }
540
+ }, {
541
+ key: "getAttribute",
542
+ value: function getAttribute(name) {
543
+ var value = attributesForElement(this).get(name);
544
+ return value !== null && value !== void 0 ? value : null;
545
+ }
546
+ }]);
547
+ return Element;
548
+ }();
549
+ var ElementShimWithRealType = ElementShim;
550
+ var HTMLElementShim = /*#__PURE__*/function (_ElementShim) {
551
+ _inherits(HTMLElement, _ElementShim);
552
+ var _super = _createSuper(HTMLElement);
553
+ function HTMLElement() {
554
+ _classCallCheck(this, HTMLElement);
555
+ return _super.apply(this, arguments);
556
+ }
557
+ return _createClass(HTMLElement);
558
+ }(ElementShim);
559
+ var HTMLElementShimWithRealType = HTMLElementShim;
560
+ var CustomElementRegistryShim = /*#__PURE__*/function () {
561
+ function CustomElementRegistry() {
562
+ _classCallCheck(this, CustomElementRegistry);
563
+ this.__definitions = new Map();
564
+ }
565
+ _createClass(CustomElementRegistry, [{
566
+ key: "define",
567
+ value: function define(name, ctor) {
568
+ var _ctor$observedAttribu;
569
+ if (this.__definitions.has(name)) {
570
+ if (process.env.NODE_ENV === 'development') {
571
+ console.warn("'CustomElementRegistry' already has \"".concat(name, "\" defined. ") + "This may have been caused by live reload or hot module " + "replacement in which case it can be safely ignored.\n" + "Make sure to test your application with a production build as " + "repeat registrations will throw in production.");
572
+ } else {
573
+ throw new Error("Failed to execute 'define' on 'CustomElementRegistry': " + "the name \"".concat(name, "\" has already been used with this registry"));
574
+ }
575
+ }
576
+ this.__definitions.set(name, {
577
+ ctor: ctor,
578
+ // Note it's important we read `observedAttributes` in case it is a getter
579
+ // with side-effects, as is the case in Lit, where it triggers class
580
+ // finalization.
581
+ //
582
+ // TODO(aomarks) To be spec compliant, we should also capture the
583
+ // registration-time lifecycle methods like `connectedCallback`. For them
584
+ // to be actually accessible to e.g. the Lit SSR element renderer, though,
585
+ // we'd need to introduce a new API for accessing them (since `get` only
586
+ // returns the constructor).
587
+ observedAttributes: (_ctor$observedAttribu = ctor.observedAttributes) !== null && _ctor$observedAttribu !== void 0 ? _ctor$observedAttribu : []
588
+ });
589
+ }
590
+ }, {
591
+ key: "get",
592
+ value: function get(name) {
593
+ var definition = this.__definitions.get(name);
594
+ return definition === null || definition === void 0 ? void 0 : definition.ctor;
595
+ }
596
+ }]);
597
+ return CustomElementRegistry;
598
+ }();
599
+ var CustomElementRegistryShimWithRealType = CustomElementRegistryShim;
600
+ new CustomElementRegistryShimWithRealType();
601
+
602
+ /**
603
+ * Constructs a fresh instance of the "window" vm context to use for evaluating
604
+ * user SSR code. Includes a minimal shim of DOM APIs.
605
+ *
606
+ * @param includeJSBuiltIns Whether certain standard JS context globals like
607
+ * `console` and `setTimeout` should also be added to the global. Should
608
+ * generally only be true when adding window to a fresh VM context that
609
+ * starts with nothing.
610
+ * @param props Additional properties to add to the window global
611
+ */
612
+ var getWindow = function getWindow(_ref) {
613
+ var _ref$includeJSBuiltIn = _ref.includeJSBuiltIns,
614
+ includeJSBuiltIns = _ref$includeJSBuiltIn === void 0 ? false : _ref$includeJSBuiltIn,
615
+ _ref$props = _ref.props,
616
+ props = _ref$props === void 0 ? {} : _ref$props;
617
+ var ShadowRoot = /*#__PURE__*/_createClass(function ShadowRoot() {
618
+ _classCallCheck(this, ShadowRoot);
619
+ });
620
+ var Document = /*#__PURE__*/function () {
621
+ function Document() {
622
+ _classCallCheck(this, Document);
623
+ }
624
+ _createClass(Document, [{
625
+ key: "adoptedStyleSheets",
626
+ get: function get() {
627
+ return [];
628
+ }
629
+ }, {
630
+ key: "createTreeWalker",
631
+ value: function createTreeWalker() {
632
+ return {};
633
+ }
634
+ }, {
635
+ key: "createTextNode",
636
+ value: function createTextNode() {
637
+ return {};
638
+ }
639
+ }, {
640
+ key: "createElement",
641
+ value: function createElement() {
642
+ return {};
643
+ }
644
+ }]);
645
+ return Document;
646
+ }();
647
+ var CSSStyleSheet = /*#__PURE__*/function () {
648
+ function CSSStyleSheet() {
649
+ _classCallCheck(this, CSSStyleSheet);
650
+ }
651
+ _createClass(CSSStyleSheet, [{
652
+ key: "replace",
653
+ value: function replace() {}
654
+ }]);
655
+ return CSSStyleSheet;
656
+ }();
657
+ var window = _objectSpread2({
658
+ Element: ElementShimWithRealType,
659
+ HTMLElement: HTMLElementShimWithRealType,
660
+ Document: Document,
661
+ document: new Document(),
662
+ CSSStyleSheet: CSSStyleSheet,
663
+ ShadowRoot: ShadowRoot,
664
+ CustomElementRegistry: CustomElementRegistryShimWithRealType,
665
+ customElements: new CustomElementRegistryShimWithRealType(),
666
+ btoa: function btoa(s) {
667
+ return Buffer.from(s, 'binary').toString('base64');
668
+ },
669
+ location: new URL('http://localhost'),
670
+ MutationObserver: /*#__PURE__*/function () {
671
+ function MutationObserver() {
672
+ _classCallCheck(this, MutationObserver);
673
+ }
674
+ _createClass(MutationObserver, [{
675
+ key: "observe",
676
+ value: function observe() {}
677
+ }]);
678
+ return MutationObserver;
679
+ }(),
680
+ // No-op any async tasks
681
+ requestAnimationFrame: function requestAnimationFrame() {},
682
+ // Set below
683
+ window: undefined
684
+ }, props);
685
+ if (includeJSBuiltIns) {
686
+ Object.assign(window, {
687
+ // No-op any async tasks
688
+ setTimeout: function setTimeout() {},
689
+ clearTimeout: function clearTimeout() {},
690
+ // Required for node-fetch
691
+ Buffer: Buffer,
692
+ URL: URL,
693
+ URLSearchParams: URLSearchParams,
694
+ console: {
695
+ log: function log() {
696
+ var _console;
697
+ (_console = console).log.apply(_console, arguments);
698
+ },
699
+ info: function info() {
700
+ var _console2;
701
+ (_console2 = console).info.apply(_console2, arguments);
702
+ },
703
+ warn: function warn() {
704
+ var _console3;
705
+ (_console3 = console).warn.apply(_console3, arguments);
706
+ },
707
+ debug: function debug() {
708
+ var _console4;
709
+ (_console4 = console).debug.apply(_console4, arguments);
710
+ },
711
+ error: function error() {
712
+ var _console5;
713
+ (_console5 = console).error.apply(_console5, arguments);
714
+ },
715
+ assert: function assert(bool, msg) {
716
+ if (!bool) {
717
+ throw new Error(msg);
718
+ }
719
+ }
720
+ }
721
+ });
722
+ }
723
+ return window;
724
+ };
725
+ var installWindowOnGlobal = function installWindowOnGlobal() {
726
+ var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
727
+ // Avoid installing the DOM shim if one already exists
728
+ if (globalThis.window === undefined) {
729
+ var window = getWindow({
730
+ props: props
731
+ });
732
+ // Copy initial window globals to node global
733
+ Object.assign(globalThis, window);
734
+ }
735
+ };
736
+ installWindowOnGlobal();
737
+
738
+ var _e = /*#__PURE__*/new WeakSet();
739
+ var _t = /*#__PURE__*/new WeakSet();
740
+ var e$1 = /*#__PURE__*/function (_HTMLElement) {
741
+ _inherits(e, _HTMLElement);
742
+ var _super = _createSuper(e);
743
+ function e() {
744
+ var _this;
745
+ _classCallCheck(this, e);
746
+ (_this = _super.call(this), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _t), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _e)), _this.addEventListener("click", function (_e5) {
747
+ var t = _e5.target.closest("a");
748
+ if (!t) return;
749
+ var n = _classPrivateMethodGet(_assertThisInitialized(_this), _e, _e2).call(_assertThisInitialized(_this), t.href);
750
+ if (!n) return;
751
+ var r = document.getElementById(n);
752
+ if (!r) return;
753
+ var o = _classPrivateMethodGet(_assertThisInitialized(_this), _t, _t2).call(_assertThisInitialized(_this), r);
754
+ o && (_e5.preventDefault(), o.scrollIntoView(), r.focus({
755
+ preventScroll: !0
756
+ }));
757
+ });
758
+ return _this;
759
+ }
760
+ return _createClass(e);
761
+ }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
762
+ function _e2(_e3) {
763
+ return _e3.includes("#") ? _e3.split("#").pop() : void 0;
764
+ }
765
+ function _t2(_e4) {
766
+ var _document$querySelect;
767
+ var t = _e4.closest("fieldset");
768
+ if (t) {
769
+ var n = t.getElementsByTagName("legend");
770
+ if (n.length) {
771
+ var _t3 = n[0];
772
+ if (_e4 instanceof HTMLInputElement && ("checkbox" === _e4.type || "radio" === _e4.type)) return _t3;
773
+ var r = _t3.getBoundingClientRect().top,
774
+ o = _e4.getBoundingClientRect();
775
+ if (o.height && window.innerHeight) {
776
+ if (o.top + o.height - r < window.innerHeight / 2) return _t3;
777
+ }
778
+ }
779
+ }
780
+ return (_document$querySelect = document.querySelector("label[for='".concat(_e4.getAttribute("id"), "']"))) !== null && _document$querySelect !== void 0 ? _document$querySelect : _e4.closest("label");
781
+ }
782
+ window && "customElements" in window && customElements.define("bds-error-summary", e$1);
783
+
220
784
  /**
221
785
  * @license
222
786
  * Copyright 2018 Google LLC
@@ -273,7 +837,7 @@ var e = new Set(["children", "localName", "ref", "style", "className"]),
273
837
  var _excluded$3 = ["className", "errors", "mapNameToId"];
274
838
  var ReactErrorSummary = t({
275
839
  tagName: 'bds-error-summary',
276
- elementClass: ErrorSummary,
840
+ elementClass: e$1,
277
841
  react: React
278
842
  });
279
843
  var FormErrorKey = '_form';