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

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,52 +1,335 @@
1
1
  import * as React from 'react';
2
2
 
3
- function _iterableToArrayLimit(r, l) {
4
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
5
- if (null != t) {
6
- var e,
7
- n,
8
- i,
9
- u,
10
- a = [],
11
- f = !0,
12
- o = !1;
3
+ function _regeneratorRuntime() {
4
+ _regeneratorRuntime = function () {
5
+ return e;
6
+ };
7
+ var t,
8
+ e = {},
9
+ r = Object.prototype,
10
+ n = r.hasOwnProperty,
11
+ o = Object.defineProperty || function (t, e, r) {
12
+ t[e] = r.value;
13
+ },
14
+ i = "function" == typeof Symbol ? Symbol : {},
15
+ a = i.iterator || "@@iterator",
16
+ c = i.asyncIterator || "@@asyncIterator",
17
+ u = i.toStringTag || "@@toStringTag";
18
+ function define(t, e, r) {
19
+ return Object.defineProperty(t, e, {
20
+ value: r,
21
+ enumerable: !0,
22
+ configurable: !0,
23
+ writable: !0
24
+ }), t[e];
25
+ }
26
+ try {
27
+ define({}, "");
28
+ } catch (t) {
29
+ define = function (t, e, r) {
30
+ return t[e] = r;
31
+ };
32
+ }
33
+ function wrap(t, e, r, n) {
34
+ var i = e && e.prototype instanceof Generator ? e : Generator,
35
+ a = Object.create(i.prototype),
36
+ c = new Context(n || []);
37
+ return o(a, "_invoke", {
38
+ value: makeInvokeMethod(t, r, c)
39
+ }), a;
40
+ }
41
+ function tryCatch(t, e, r) {
13
42
  try {
14
- if (i = (t = t.call(r)).next, 0 === l) {
15
- if (Object(t) !== t) return;
16
- f = !1;
17
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
18
- } catch (r) {
19
- o = !0, n = r;
20
- } finally {
21
- try {
22
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
23
- } finally {
24
- if (o) throw n;
43
+ return {
44
+ type: "normal",
45
+ arg: t.call(e, r)
46
+ };
47
+ } catch (t) {
48
+ return {
49
+ type: "throw",
50
+ arg: t
51
+ };
52
+ }
53
+ }
54
+ e.wrap = wrap;
55
+ var h = "suspendedStart",
56
+ l = "suspendedYield",
57
+ f = "executing",
58
+ s = "completed",
59
+ y = {};
60
+ function Generator() {}
61
+ function GeneratorFunction() {}
62
+ function GeneratorFunctionPrototype() {}
63
+ var p = {};
64
+ define(p, a, function () {
65
+ return this;
66
+ });
67
+ var d = Object.getPrototypeOf,
68
+ v = d && d(d(values([])));
69
+ v && v !== r && n.call(v, a) && (p = v);
70
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
71
+ function defineIteratorMethods(t) {
72
+ ["next", "throw", "return"].forEach(function (e) {
73
+ define(t, e, function (t) {
74
+ return this._invoke(e, t);
75
+ });
76
+ });
77
+ }
78
+ function AsyncIterator(t, e) {
79
+ function invoke(r, o, i, a) {
80
+ var c = tryCatch(t[r], t, o);
81
+ if ("throw" !== c.type) {
82
+ var u = c.arg,
83
+ h = u.value;
84
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
85
+ invoke("next", t, i, a);
86
+ }, function (t) {
87
+ invoke("throw", t, i, a);
88
+ }) : e.resolve(h).then(function (t) {
89
+ u.value = t, i(u);
90
+ }, function (t) {
91
+ return invoke("throw", t, i, a);
92
+ });
93
+ }
94
+ a(c.arg);
95
+ }
96
+ var r;
97
+ o(this, "_invoke", {
98
+ value: function (t, n) {
99
+ function callInvokeWithMethodAndArg() {
100
+ return new e(function (e, r) {
101
+ invoke(t, n, e, r);
102
+ });
103
+ }
104
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
105
+ }
106
+ });
107
+ }
108
+ function makeInvokeMethod(e, r, n) {
109
+ var o = h;
110
+ return function (i, a) {
111
+ if (o === f) throw new Error("Generator is already running");
112
+ if (o === s) {
113
+ if ("throw" === i) throw a;
114
+ return {
115
+ value: t,
116
+ done: !0
117
+ };
118
+ }
119
+ for (n.method = i, n.arg = a;;) {
120
+ var c = n.delegate;
121
+ if (c) {
122
+ var u = maybeInvokeDelegate(c, n);
123
+ if (u) {
124
+ if (u === y) continue;
125
+ return u;
126
+ }
127
+ }
128
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
129
+ if (o === h) throw o = s, n.arg;
130
+ n.dispatchException(n.arg);
131
+ } else "return" === n.method && n.abrupt("return", n.arg);
132
+ o = f;
133
+ var p = tryCatch(e, r, n);
134
+ if ("normal" === p.type) {
135
+ if (o = n.done ? s : l, p.arg === y) continue;
136
+ return {
137
+ value: p.arg,
138
+ done: n.done
139
+ };
140
+ }
141
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
142
+ }
143
+ };
144
+ }
145
+ function maybeInvokeDelegate(e, r) {
146
+ var n = r.method,
147
+ o = e.iterator[n];
148
+ if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y;
149
+ var i = tryCatch(o, e.iterator, r.arg);
150
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
151
+ var a = i.arg;
152
+ return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y);
153
+ }
154
+ function pushTryEntry(t) {
155
+ var e = {
156
+ tryLoc: t[0]
157
+ };
158
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
159
+ }
160
+ function resetTryEntry(t) {
161
+ var e = t.completion || {};
162
+ e.type = "normal", delete e.arg, t.completion = e;
163
+ }
164
+ function Context(t) {
165
+ this.tryEntries = [{
166
+ tryLoc: "root"
167
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
168
+ }
169
+ function values(e) {
170
+ if (e || "" === e) {
171
+ var r = e[a];
172
+ if (r) return r.call(e);
173
+ if ("function" == typeof e.next) return e;
174
+ if (!isNaN(e.length)) {
175
+ var o = -1,
176
+ i = function next() {
177
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
178
+ return next.value = t, next.done = !0, next;
179
+ };
180
+ return i.next = i;
25
181
  }
26
182
  }
27
- return a;
183
+ throw new TypeError(typeof e + " is not iterable");
28
184
  }
185
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
186
+ value: GeneratorFunctionPrototype,
187
+ configurable: !0
188
+ }), o(GeneratorFunctionPrototype, "constructor", {
189
+ value: GeneratorFunction,
190
+ configurable: !0
191
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
192
+ var e = "function" == typeof t && t.constructor;
193
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
194
+ }, e.mark = function (t) {
195
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
196
+ }, e.awrap = function (t) {
197
+ return {
198
+ __await: t
199
+ };
200
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
201
+ return this;
202
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
203
+ void 0 === i && (i = Promise);
204
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
205
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
206
+ return t.done ? t.value : a.next();
207
+ });
208
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
209
+ return this;
210
+ }), define(g, "toString", function () {
211
+ return "[object Generator]";
212
+ }), e.keys = function (t) {
213
+ var e = Object(t),
214
+ r = [];
215
+ for (var n in e) r.push(n);
216
+ return r.reverse(), function next() {
217
+ for (; r.length;) {
218
+ var t = r.pop();
219
+ if (t in e) return next.value = t, next.done = !1, next;
220
+ }
221
+ return next.done = !0, next;
222
+ };
223
+ }, e.values = values, Context.prototype = {
224
+ constructor: Context,
225
+ reset: function (e) {
226
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);
227
+ },
228
+ stop: function () {
229
+ this.done = !0;
230
+ var t = this.tryEntries[0].completion;
231
+ if ("throw" === t.type) throw t.arg;
232
+ return this.rval;
233
+ },
234
+ dispatchException: function (e) {
235
+ if (this.done) throw e;
236
+ var r = this;
237
+ function handle(n, o) {
238
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
239
+ }
240
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
241
+ var i = this.tryEntries[o],
242
+ a = i.completion;
243
+ if ("root" === i.tryLoc) return handle("end");
244
+ if (i.tryLoc <= this.prev) {
245
+ var c = n.call(i, "catchLoc"),
246
+ u = n.call(i, "finallyLoc");
247
+ if (c && u) {
248
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
249
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
250
+ } else if (c) {
251
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
252
+ } else {
253
+ if (!u) throw new Error("try statement without catch or finally");
254
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
255
+ }
256
+ }
257
+ }
258
+ },
259
+ abrupt: function (t, e) {
260
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
261
+ var o = this.tryEntries[r];
262
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
263
+ var i = o;
264
+ break;
265
+ }
266
+ }
267
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
268
+ var a = i ? i.completion : {};
269
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
270
+ },
271
+ complete: function (t, e) {
272
+ if ("throw" === t.type) throw t.arg;
273
+ return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y;
274
+ },
275
+ finish: function (t) {
276
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
277
+ var r = this.tryEntries[e];
278
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
279
+ }
280
+ },
281
+ catch: function (t) {
282
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
283
+ var r = this.tryEntries[e];
284
+ if (r.tryLoc === t) {
285
+ var n = r.completion;
286
+ if ("throw" === n.type) {
287
+ var o = n.arg;
288
+ resetTryEntry(r);
289
+ }
290
+ return o;
291
+ }
292
+ }
293
+ throw new Error("illegal catch attempt");
294
+ },
295
+ delegateYield: function (e, r, n) {
296
+ return this.delegate = {
297
+ iterator: values(e),
298
+ resultName: r,
299
+ nextLoc: n
300
+ }, "next" === this.method && (this.arg = t), y;
301
+ }
302
+ }, e;
29
303
  }
30
- function ownKeys(e, r) {
31
- var t = Object.keys(e);
32
- if (Object.getOwnPropertySymbols) {
33
- var o = Object.getOwnPropertySymbols(e);
34
- r && (o = o.filter(function (r) {
35
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
36
- })), t.push.apply(t, o);
304
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
305
+ try {
306
+ var info = gen[key](arg);
307
+ var value = info.value;
308
+ } catch (error) {
309
+ reject(error);
310
+ return;
311
+ }
312
+ if (info.done) {
313
+ resolve(value);
314
+ } else {
315
+ Promise.resolve(value).then(_next, _throw);
37
316
  }
38
- return t;
39
317
  }
40
- function _objectSpread2(e) {
41
- for (var r = 1; r < arguments.length; r++) {
42
- var t = null != arguments[r] ? arguments[r] : {};
43
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
44
- _defineProperty(e, r, t[r]);
45
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
46
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
318
+ function _asyncToGenerator(fn) {
319
+ return function () {
320
+ var self = this,
321
+ args = arguments;
322
+ return new Promise(function (resolve, reject) {
323
+ var gen = fn.apply(self, args);
324
+ function _next(value) {
325
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
326
+ }
327
+ function _throw(err) {
328
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
329
+ }
330
+ _next(undefined);
47
331
  });
48
- }
49
- return e;
332
+ };
50
333
  }
51
334
  function _classCallCheck(instance, Constructor) {
52
335
  if (!(instance instanceof Constructor)) {
@@ -70,20 +353,6 @@ function _createClass(Constructor, protoProps, staticProps) {
70
353
  });
71
354
  return Constructor;
72
355
  }
73
- function _defineProperty(obj, key, value) {
74
- key = _toPropertyKey(key);
75
- if (key in obj) {
76
- Object.defineProperty(obj, key, {
77
- value: value,
78
- enumerable: true,
79
- configurable: true,
80
- writable: true
81
- });
82
- } else {
83
- obj[key] = value;
84
- }
85
- return obj;
86
- }
87
356
  function _extends() {
88
357
  _extends = Object.assign ? Object.assign.bind() : function (target) {
89
358
  for (var i = 1; i < arguments.length; i++) {
@@ -237,18 +506,12 @@ function _createSuper(Derived) {
237
506
  return _possibleConstructorReturn(this, result);
238
507
  };
239
508
  }
240
- function _slicedToArray(arr, i) {
241
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
242
- }
243
509
  function _toConsumableArray(arr) {
244
510
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
245
511
  }
246
512
  function _arrayWithoutHoles(arr) {
247
513
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
248
514
  }
249
- function _arrayWithHoles(arr) {
250
- if (Array.isArray(arr)) return arr;
251
- }
252
515
  function _iterableToArray(iter) {
253
516
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
254
517
  }
@@ -268,9 +531,6 @@ function _arrayLikeToArray(arr, len) {
268
531
  function _nonIterableSpread() {
269
532
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
270
533
  }
271
- function _nonIterableRest() {
272
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
273
- }
274
534
  function _toPrimitive(input, hint) {
275
535
  if (typeof input !== "object" || input === null) return input;
276
536
  var prim = input[Symbol.toPrimitive];
@@ -365,481 +625,7 @@ var CallToAction = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
365
625
  }, props), children);
366
626
  });
367
627
 
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
-
784
- /**
785
- * @license
786
- * Copyright 2018 Google LLC
787
- * SPDX-License-Identifier: BSD-3-Clause
788
- */
789
- var e = new Set(["children", "localName", "ref", "style", "className"]),
790
- n = new WeakMap(),
791
- l = function l(e, _l, t, o, a) {
792
- var i = null == a ? void 0 : a[_l];
793
- void 0 === i || t === o ? (e[_l] = t, null == t && _l in HTMLElement.prototype && e.removeAttribute(_l)) : function (e, l, t) {
794
- var o = n.get(e);
795
- void 0 === o && n.set(e, o = new Map());
796
- var a = o.get(l);
797
- void 0 !== t ? void 0 === a ? (o.set(l, a = {
798
- handleEvent: t
799
- }), e.addEventListener(l, a)) : a.handleEvent = t : void 0 !== a && (o["delete"](l), e.removeEventListener(l, a));
800
- }(e, i, t);
801
- },
802
- t = function t(_ref) {
803
- var n = _ref.react,
804
- t = _ref.tagName,
805
- o = _ref.elementClass,
806
- a = _ref.events,
807
- i = _ref.displayName;
808
- var s = new Set(Object.keys(null != a ? a : {})),
809
- c = n.forwardRef(function (i, c) {
810
- var r = n.useRef(null),
811
- d = n.useRef(null),
812
- u = {},
813
- v = {};
814
- for (var _i = 0, _Object$entries = Object.entries(i); _i < _Object$entries.length; _i++) {
815
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
816
- _n = _Object$entries$_i[0],
817
- _l2 = _Object$entries$_i[1];
818
- e.has(_n) ? u["className" === _n ? "class" : _n] = _l2 : s.has(_n) || _n in o.prototype ? v[_n] = _l2 : u[_n] = _l2;
819
- }
820
- return n.useLayoutEffect(function () {
821
- if (null !== d.current) {
822
- for (var _e in v) l(d.current, _e, i[_e], r.current ? r.current[_e] : void 0, a);
823
- r.current = i;
824
- }
825
- }), n.useLayoutEffect(function () {
826
- var e;
827
- null === (e = d.current) || void 0 === e || e.removeAttribute("defer-hydration");
828
- }, []), u.suppressHydrationWarning = !0, n.createElement(t, _objectSpread2(_objectSpread2({}, u), {}, {
829
- ref: function ref(e) {
830
- d.current = e, "function" == typeof c ? c(e) : null !== c && (c.current = e);
831
- }
832
- }));
833
- });
834
- return c.displayName = null != i ? i : o.name, c;
835
- };
836
-
837
628
  var _excluded$3 = ["className", "errors", "mapNameToId"];
838
- var ReactErrorSummary = t({
839
- tagName: 'bds-error-summary',
840
- elementClass: e$1,
841
- react: React
842
- });
843
629
  var FormErrorKey = '_form';
844
630
  var FINAL_FORM_ERROR = 'FINAL_FORM/form-error';
845
631
  function BdsErrorSummary(_ref) {
@@ -852,13 +638,33 @@ function BdsErrorSummary(_ref) {
852
638
  props = _objectWithoutProperties(_ref, _excluded$3);
853
639
  var headingId = React.useId();
854
640
  var groupRef = React.useRef(null);
641
+ React.useEffect(function () {
642
+ var loadWebComponent = /*#__PURE__*/function () {
643
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
644
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
645
+ while (1) switch (_context.prev = _context.next) {
646
+ case 0:
647
+ _context.next = 2;
648
+ return Promise.resolve().then(function () { return index; });
649
+ case 2:
650
+ case "end":
651
+ return _context.stop();
652
+ }
653
+ }, _callee);
654
+ }));
655
+ return function loadWebComponent() {
656
+ return _ref2.apply(this, arguments);
657
+ };
658
+ }();
659
+ loadWebComponent();
660
+ });
855
661
  React.useEffect(function () {
856
662
  if (!errors || Object.keys(errors).length === 0) return;
857
663
  if (!groupRef.current) return;
858
664
  groupRef.current.focus();
859
665
  }, [errors]);
860
666
  if (!errors || Object.keys(errors).length === 0) return null;
861
- return /*#__PURE__*/React.createElement(ReactErrorSummary, _extends({
667
+ return /*#__PURE__*/React.createElement("bds-error-summary", _extends({
862
668
  className: ['stack', className].filter(function (x) {
863
669
  return x;
864
670
  }).join(' '),
@@ -1066,5 +872,56 @@ var Typography = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
1066
872
  }, props));
1067
873
  });
1068
874
 
875
+ var _e = /*#__PURE__*/new WeakSet();
876
+ var _t = /*#__PURE__*/new WeakSet();
877
+ var e = /*#__PURE__*/function (_HTMLElement) {
878
+ _inherits(e, _HTMLElement);
879
+ var _super = _createSuper(e);
880
+ function e() {
881
+ var _this;
882
+ _classCallCheck(this, e);
883
+ (_this = _super.call(this), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _t), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _e)), _this.addEventListener("click", function (_e5) {
884
+ var t = _e5.target.closest("a");
885
+ if (!t) return;
886
+ var n = _classPrivateMethodGet(_assertThisInitialized(_this), _e, _e2).call(_assertThisInitialized(_this), t.href);
887
+ if (!n) return;
888
+ var r = document.getElementById(n);
889
+ if (!r) return;
890
+ var o = _classPrivateMethodGet(_assertThisInitialized(_this), _t, _t2).call(_assertThisInitialized(_this), r);
891
+ o && (_e5.preventDefault(), o.scrollIntoView(), r.focus({
892
+ preventScroll: !0
893
+ }));
894
+ });
895
+ return _this;
896
+ }
897
+ return _createClass(e);
898
+ }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
899
+ function _e2(_e3) {
900
+ return _e3.includes("#") ? _e3.split("#").pop() : void 0;
901
+ }
902
+ function _t2(_e4) {
903
+ var _document$querySelect;
904
+ var t = _e4.closest("fieldset");
905
+ if (t) {
906
+ var n = t.getElementsByTagName("legend");
907
+ if (n.length) {
908
+ var _t3 = n[0];
909
+ if (_e4 instanceof HTMLInputElement && ("checkbox" === _e4.type || "radio" === _e4.type)) return _t3;
910
+ var r = _t3.getBoundingClientRect().top,
911
+ o = _e4.getBoundingClientRect();
912
+ if (o.height && window.innerHeight) {
913
+ if (o.top + o.height - r < window.innerHeight / 2) return _t3;
914
+ }
915
+ }
916
+ }
917
+ return (_document$querySelect = document.querySelector("label[for='".concat(_e4.getAttribute("id"), "']"))) !== null && _document$querySelect !== void 0 ? _document$querySelect : _e4.closest("label");
918
+ }
919
+ window && "customElements" in window && customElements.define("bds-error-summary", e);
920
+
921
+ var index = /*#__PURE__*/Object.freeze({
922
+ __proto__: null,
923
+ default: e
924
+ });
925
+
1069
926
  export { Button, CallToAction, BdsErrorSummary as ErrorSummary, FieldTextInput, Pagination, Typography };
1070
927
  //# sourceMappingURL=index.mjs.map