@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.cjs CHANGED
@@ -21,53 +21,336 @@ function _interopNamespaceDefault(e) {
21
21
 
22
22
  var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
23
23
 
24
- function _iterableToArrayLimit(r, l) {
25
- var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
26
- if (null != t) {
27
- var e,
28
- n,
29
- i,
30
- u,
31
- a = [],
32
- f = !0,
33
- o = !1;
24
+ function _regeneratorRuntime() {
25
+ _regeneratorRuntime = function () {
26
+ return e;
27
+ };
28
+ var t,
29
+ e = {},
30
+ r = Object.prototype,
31
+ n = r.hasOwnProperty,
32
+ o = Object.defineProperty || function (t, e, r) {
33
+ t[e] = r.value;
34
+ },
35
+ i = "function" == typeof Symbol ? Symbol : {},
36
+ a = i.iterator || "@@iterator",
37
+ c = i.asyncIterator || "@@asyncIterator",
38
+ u = i.toStringTag || "@@toStringTag";
39
+ function define(t, e, r) {
40
+ return Object.defineProperty(t, e, {
41
+ value: r,
42
+ enumerable: !0,
43
+ configurable: !0,
44
+ writable: !0
45
+ }), t[e];
46
+ }
47
+ try {
48
+ define({}, "");
49
+ } catch (t) {
50
+ define = function (t, e, r) {
51
+ return t[e] = r;
52
+ };
53
+ }
54
+ function wrap(t, e, r, n) {
55
+ var i = e && e.prototype instanceof Generator ? e : Generator,
56
+ a = Object.create(i.prototype),
57
+ c = new Context(n || []);
58
+ return o(a, "_invoke", {
59
+ value: makeInvokeMethod(t, r, c)
60
+ }), a;
61
+ }
62
+ function tryCatch(t, e, r) {
34
63
  try {
35
- if (i = (t = t.call(r)).next, 0 === l) {
36
- if (Object(t) !== t) return;
37
- f = !1;
38
- } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
39
- } catch (r) {
40
- o = !0, n = r;
41
- } finally {
42
- try {
43
- if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
44
- } finally {
45
- if (o) throw n;
64
+ return {
65
+ type: "normal",
66
+ arg: t.call(e, r)
67
+ };
68
+ } catch (t) {
69
+ return {
70
+ type: "throw",
71
+ arg: t
72
+ };
73
+ }
74
+ }
75
+ e.wrap = wrap;
76
+ var h = "suspendedStart",
77
+ l = "suspendedYield",
78
+ f = "executing",
79
+ s = "completed",
80
+ y = {};
81
+ function Generator() {}
82
+ function GeneratorFunction() {}
83
+ function GeneratorFunctionPrototype() {}
84
+ var p = {};
85
+ define(p, a, function () {
86
+ return this;
87
+ });
88
+ var d = Object.getPrototypeOf,
89
+ v = d && d(d(values([])));
90
+ v && v !== r && n.call(v, a) && (p = v);
91
+ var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);
92
+ function defineIteratorMethods(t) {
93
+ ["next", "throw", "return"].forEach(function (e) {
94
+ define(t, e, function (t) {
95
+ return this._invoke(e, t);
96
+ });
97
+ });
98
+ }
99
+ function AsyncIterator(t, e) {
100
+ function invoke(r, o, i, a) {
101
+ var c = tryCatch(t[r], t, o);
102
+ if ("throw" !== c.type) {
103
+ var u = c.arg,
104
+ h = u.value;
105
+ return h && "object" == typeof h && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) {
106
+ invoke("next", t, i, a);
107
+ }, function (t) {
108
+ invoke("throw", t, i, a);
109
+ }) : e.resolve(h).then(function (t) {
110
+ u.value = t, i(u);
111
+ }, function (t) {
112
+ return invoke("throw", t, i, a);
113
+ });
46
114
  }
115
+ a(c.arg);
47
116
  }
48
- return a;
117
+ var r;
118
+ o(this, "_invoke", {
119
+ value: function (t, n) {
120
+ function callInvokeWithMethodAndArg() {
121
+ return new e(function (e, r) {
122
+ invoke(t, n, e, r);
123
+ });
124
+ }
125
+ return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
126
+ }
127
+ });
128
+ }
129
+ function makeInvokeMethod(e, r, n) {
130
+ var o = h;
131
+ return function (i, a) {
132
+ if (o === f) throw new Error("Generator is already running");
133
+ if (o === s) {
134
+ if ("throw" === i) throw a;
135
+ return {
136
+ value: t,
137
+ done: !0
138
+ };
139
+ }
140
+ for (n.method = i, n.arg = a;;) {
141
+ var c = n.delegate;
142
+ if (c) {
143
+ var u = maybeInvokeDelegate(c, n);
144
+ if (u) {
145
+ if (u === y) continue;
146
+ return u;
147
+ }
148
+ }
149
+ if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) {
150
+ if (o === h) throw o = s, n.arg;
151
+ n.dispatchException(n.arg);
152
+ } else "return" === n.method && n.abrupt("return", n.arg);
153
+ o = f;
154
+ var p = tryCatch(e, r, n);
155
+ if ("normal" === p.type) {
156
+ if (o = n.done ? s : l, p.arg === y) continue;
157
+ return {
158
+ value: p.arg,
159
+ done: n.done
160
+ };
161
+ }
162
+ "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg);
163
+ }
164
+ };
165
+ }
166
+ function maybeInvokeDelegate(e, r) {
167
+ var n = r.method,
168
+ o = e.iterator[n];
169
+ 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;
170
+ var i = tryCatch(o, e.iterator, r.arg);
171
+ if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y;
172
+ var a = i.arg;
173
+ 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);
49
174
  }
175
+ function pushTryEntry(t) {
176
+ var e = {
177
+ tryLoc: t[0]
178
+ };
179
+ 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);
180
+ }
181
+ function resetTryEntry(t) {
182
+ var e = t.completion || {};
183
+ e.type = "normal", delete e.arg, t.completion = e;
184
+ }
185
+ function Context(t) {
186
+ this.tryEntries = [{
187
+ tryLoc: "root"
188
+ }], t.forEach(pushTryEntry, this), this.reset(!0);
189
+ }
190
+ function values(e) {
191
+ if (e || "" === e) {
192
+ var r = e[a];
193
+ if (r) return r.call(e);
194
+ if ("function" == typeof e.next) return e;
195
+ if (!isNaN(e.length)) {
196
+ var o = -1,
197
+ i = function next() {
198
+ for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;
199
+ return next.value = t, next.done = !0, next;
200
+ };
201
+ return i.next = i;
202
+ }
203
+ }
204
+ throw new TypeError(typeof e + " is not iterable");
205
+ }
206
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", {
207
+ value: GeneratorFunctionPrototype,
208
+ configurable: !0
209
+ }), o(GeneratorFunctionPrototype, "constructor", {
210
+ value: GeneratorFunction,
211
+ configurable: !0
212
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) {
213
+ var e = "function" == typeof t && t.constructor;
214
+ return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name));
215
+ }, e.mark = function (t) {
216
+ return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t;
217
+ }, e.awrap = function (t) {
218
+ return {
219
+ __await: t
220
+ };
221
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {
222
+ return this;
223
+ }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {
224
+ void 0 === i && (i = Promise);
225
+ var a = new AsyncIterator(wrap(t, r, n, o), i);
226
+ return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {
227
+ return t.done ? t.value : a.next();
228
+ });
229
+ }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () {
230
+ return this;
231
+ }), define(g, "toString", function () {
232
+ return "[object Generator]";
233
+ }), e.keys = function (t) {
234
+ var e = Object(t),
235
+ r = [];
236
+ for (var n in e) r.push(n);
237
+ return r.reverse(), function next() {
238
+ for (; r.length;) {
239
+ var t = r.pop();
240
+ if (t in e) return next.value = t, next.done = !1, next;
241
+ }
242
+ return next.done = !0, next;
243
+ };
244
+ }, e.values = values, Context.prototype = {
245
+ constructor: Context,
246
+ reset: function (e) {
247
+ 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);
248
+ },
249
+ stop: function () {
250
+ this.done = !0;
251
+ var t = this.tryEntries[0].completion;
252
+ if ("throw" === t.type) throw t.arg;
253
+ return this.rval;
254
+ },
255
+ dispatchException: function (e) {
256
+ if (this.done) throw e;
257
+ var r = this;
258
+ function handle(n, o) {
259
+ return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o;
260
+ }
261
+ for (var o = this.tryEntries.length - 1; o >= 0; --o) {
262
+ var i = this.tryEntries[o],
263
+ a = i.completion;
264
+ if ("root" === i.tryLoc) return handle("end");
265
+ if (i.tryLoc <= this.prev) {
266
+ var c = n.call(i, "catchLoc"),
267
+ u = n.call(i, "finallyLoc");
268
+ if (c && u) {
269
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
270
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
271
+ } else if (c) {
272
+ if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
273
+ } else {
274
+ if (!u) throw new Error("try statement without catch or finally");
275
+ if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
276
+ }
277
+ }
278
+ }
279
+ },
280
+ abrupt: function (t, e) {
281
+ for (var r = this.tryEntries.length - 1; r >= 0; --r) {
282
+ var o = this.tryEntries[r];
283
+ if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) {
284
+ var i = o;
285
+ break;
286
+ }
287
+ }
288
+ i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);
289
+ var a = i ? i.completion : {};
290
+ return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a);
291
+ },
292
+ complete: function (t, e) {
293
+ if ("throw" === t.type) throw t.arg;
294
+ 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;
295
+ },
296
+ finish: function (t) {
297
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
298
+ var r = this.tryEntries[e];
299
+ if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;
300
+ }
301
+ },
302
+ catch: function (t) {
303
+ for (var e = this.tryEntries.length - 1; e >= 0; --e) {
304
+ var r = this.tryEntries[e];
305
+ if (r.tryLoc === t) {
306
+ var n = r.completion;
307
+ if ("throw" === n.type) {
308
+ var o = n.arg;
309
+ resetTryEntry(r);
310
+ }
311
+ return o;
312
+ }
313
+ }
314
+ throw new Error("illegal catch attempt");
315
+ },
316
+ delegateYield: function (e, r, n) {
317
+ return this.delegate = {
318
+ iterator: values(e),
319
+ resultName: r,
320
+ nextLoc: n
321
+ }, "next" === this.method && (this.arg = t), y;
322
+ }
323
+ }, e;
50
324
  }
51
- function ownKeys(e, r) {
52
- var t = Object.keys(e);
53
- if (Object.getOwnPropertySymbols) {
54
- var o = Object.getOwnPropertySymbols(e);
55
- r && (o = o.filter(function (r) {
56
- return Object.getOwnPropertyDescriptor(e, r).enumerable;
57
- })), t.push.apply(t, o);
325
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
326
+ try {
327
+ var info = gen[key](arg);
328
+ var value = info.value;
329
+ } catch (error) {
330
+ reject(error);
331
+ return;
332
+ }
333
+ if (info.done) {
334
+ resolve(value);
335
+ } else {
336
+ Promise.resolve(value).then(_next, _throw);
58
337
  }
59
- return t;
60
338
  }
61
- function _objectSpread2(e) {
62
- for (var r = 1; r < arguments.length; r++) {
63
- var t = null != arguments[r] ? arguments[r] : {};
64
- r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
65
- _defineProperty(e, r, t[r]);
66
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
67
- Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
339
+ function _asyncToGenerator(fn) {
340
+ return function () {
341
+ var self = this,
342
+ args = arguments;
343
+ return new Promise(function (resolve, reject) {
344
+ var gen = fn.apply(self, args);
345
+ function _next(value) {
346
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
347
+ }
348
+ function _throw(err) {
349
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
350
+ }
351
+ _next(undefined);
68
352
  });
69
- }
70
- return e;
353
+ };
71
354
  }
72
355
  function _classCallCheck(instance, Constructor) {
73
356
  if (!(instance instanceof Constructor)) {
@@ -91,20 +374,6 @@ function _createClass(Constructor, protoProps, staticProps) {
91
374
  });
92
375
  return Constructor;
93
376
  }
94
- function _defineProperty(obj, key, value) {
95
- key = _toPropertyKey(key);
96
- if (key in obj) {
97
- Object.defineProperty(obj, key, {
98
- value: value,
99
- enumerable: true,
100
- configurable: true,
101
- writable: true
102
- });
103
- } else {
104
- obj[key] = value;
105
- }
106
- return obj;
107
- }
108
377
  function _extends() {
109
378
  _extends = Object.assign ? Object.assign.bind() : function (target) {
110
379
  for (var i = 1; i < arguments.length; i++) {
@@ -258,18 +527,12 @@ function _createSuper(Derived) {
258
527
  return _possibleConstructorReturn(this, result);
259
528
  };
260
529
  }
261
- function _slicedToArray(arr, i) {
262
- return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
263
- }
264
530
  function _toConsumableArray(arr) {
265
531
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
266
532
  }
267
533
  function _arrayWithoutHoles(arr) {
268
534
  if (Array.isArray(arr)) return _arrayLikeToArray(arr);
269
535
  }
270
- function _arrayWithHoles(arr) {
271
- if (Array.isArray(arr)) return arr;
272
- }
273
536
  function _iterableToArray(iter) {
274
537
  if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
275
538
  }
@@ -289,9 +552,6 @@ function _arrayLikeToArray(arr, len) {
289
552
  function _nonIterableSpread() {
290
553
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
291
554
  }
292
- function _nonIterableRest() {
293
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
294
- }
295
555
  function _toPrimitive(input, hint) {
296
556
  if (typeof input !== "object" || input === null) return input;
297
557
  var prim = input[Symbol.toPrimitive];
@@ -386,481 +646,7 @@ var CallToAction = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref)
386
646
  }, props), children);
387
647
  });
388
648
 
389
- // Shim the global element internals object
390
- // Methods should be fine as noops and properties can generally
391
- // be while on the server.
392
- var ElementInternalsShim = /*#__PURE__*/function () {
393
- function ElementInternals(_host) {
394
- _classCallCheck(this, ElementInternals);
395
- this.ariaAtomic = '';
396
- this.ariaAutoComplete = '';
397
- this.ariaBraileLabel = '';
398
- this.ariaBraileRoleDescription = '';
399
- this.ariaBusy = '';
400
- this.ariaChecked = '';
401
- this.ariaColCount = '';
402
- this.ariaColIndex = '';
403
- this.ariaColSpan = '';
404
- this.ariaCurrent = '';
405
- this.ariaDescription = '';
406
- this.ariaDisabled = '';
407
- this.ariaExpanded = '';
408
- this.ariaHasPopup = '';
409
- this.ariaHidden = '';
410
- this.ariaInvalid = '';
411
- this.ariaKeyShortcuts = '';
412
- this.ariaLabel = '';
413
- this.ariaLevel = '';
414
- this.ariaLive = '';
415
- this.ariaModal = '';
416
- this.ariaMultiLine = '';
417
- this.ariaMultiSelectable = '';
418
- this.ariaOrientation = '';
419
- this.ariaPlaceholder = '';
420
- this.ariaPosInSet = '';
421
- this.ariaPressed = '';
422
- this.ariaReadOnly = '';
423
- this.ariaRequired = '';
424
- this.ariaRoleDescription = '';
425
- this.ariaRowCount = '';
426
- this.ariaRowIndex = '';
427
- this.ariaRowSpan = '';
428
- this.ariaSelected = '';
429
- this.ariaSetSize = '';
430
- this.ariaSort = '';
431
- this.ariaValueMax = '';
432
- this.ariaValueMin = '';
433
- this.ariaValueNow = '';
434
- this.ariaValueText = '';
435
- this.role = '';
436
- this.form = null;
437
- this.labels = [];
438
- this.states = new Set();
439
- this.validationMessage = '';
440
- this.validity = {};
441
- this.willValidate = true;
442
- this.__host = _host;
443
- }
444
- _createClass(ElementInternals, [{
445
- key: "shadowRoot",
446
- get: function get() {
447
- // Grab the shadow root instance from the Element shim
448
- // to ensure that the shadow root is always available
449
- // to the internals instance even if the mode is 'closed'
450
- return this.__host.__shadowRoot;
451
- }
452
- }, {
453
- key: "checkValidity",
454
- value: function checkValidity() {
455
- // TODO(augustjk) Consider actually implementing logic.
456
- // See https://github.com/lit/lit/issues/3740
457
- console.warn('`ElementInternals.checkValidity()` was called on the server.' + 'This method always returns true.');
458
- return true;
459
- }
460
- }, {
461
- key: "reportValidity",
462
- value: function reportValidity() {
463
- return true;
464
- }
465
- }, {
466
- key: "setFormValue",
467
- value: function setFormValue() {}
468
- }, {
469
- key: "setValidity",
470
- value: function setValidity() {}
471
- }]);
472
- return ElementInternals;
473
- }();
474
-
475
- var attributes = new WeakMap();
476
- var attributesForElement = function attributesForElement(element) {
477
- var attrs = attributes.get(element);
478
- if (attrs === undefined) {
479
- attributes.set(element, attrs = new Map());
480
- }
481
- return attrs;
482
- };
483
- // The typings around the exports below are a little funky:
484
- //
485
- // 1. We want the `name` of the shim classes to match the real ones at runtime,
486
- // hence e.g. `class Element`.
487
- // 2. We can't shadow the global types with a simple class declaration, because
488
- // then we can't reference the global types for casting, hence e.g.
489
- // `const ElementShim = class Element`.
490
- // 3. We want to export the classes typed as the real ones, hence e.g.
491
- // `const ElementShimWithRealType = ElementShim as object as typeof Element;`.
492
- // 4. We want the exported names to match the real ones, hence e.g.
493
- // `export {ElementShimWithRealType as Element}`.
494
- var ElementShim = /*#__PURE__*/function () {
495
- function Element() {
496
- _classCallCheck(this, Element);
497
- this.__shadowRootMode = null;
498
- this.__shadowRoot = null;
499
- this.__internals = null;
500
- }
501
- _createClass(Element, [{
502
- key: "attributes",
503
- get: function get() {
504
- return Array.from(attributesForElement(this)).map(function (_ref) {
505
- var _ref2 = _slicedToArray(_ref, 2),
506
- name = _ref2[0],
507
- value = _ref2[1];
508
- return {
509
- name: name,
510
- value: value
511
- };
512
- });
513
- }
514
- }, {
515
- key: "shadowRoot",
516
- get: function get() {
517
- if (this.__shadowRootMode === 'closed') {
518
- return null;
519
- }
520
- return this.__shadowRoot;
521
- }
522
- }, {
523
- key: "setAttribute",
524
- value: function setAttribute(name, value) {
525
- // Emulate browser behavior that silently casts all values to string. E.g.
526
- // `42` becomes `"42"` and `{}` becomes `"[object Object]""`.
527
- attributesForElement(this).set(name, String(value));
528
- }
529
- }, {
530
- key: "removeAttribute",
531
- value: function removeAttribute(name) {
532
- attributesForElement(this)["delete"](name);
533
- }
534
- }, {
535
- key: "hasAttribute",
536
- value: function hasAttribute(name) {
537
- return attributesForElement(this).has(name);
538
- }
539
- }, {
540
- key: "attachShadow",
541
- value: function attachShadow(init) {
542
- var shadowRoot = {
543
- host: this
544
- };
545
- this.__shadowRootMode = init.mode;
546
- if (init && init.mode === 'open') {
547
- this.__shadowRoot = shadowRoot;
548
- }
549
- return shadowRoot;
550
- }
551
- }, {
552
- key: "attachInternals",
553
- value: function attachInternals() {
554
- if (this.__internals !== null) {
555
- throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': " + "ElementInternals for the specified element was already attached.");
556
- }
557
- var internals = new ElementInternalsShim(this);
558
- this.__internals = internals;
559
- return internals;
560
- }
561
- }, {
562
- key: "getAttribute",
563
- value: function getAttribute(name) {
564
- var value = attributesForElement(this).get(name);
565
- return value !== null && value !== void 0 ? value : null;
566
- }
567
- }]);
568
- return Element;
569
- }();
570
- var ElementShimWithRealType = ElementShim;
571
- var HTMLElementShim = /*#__PURE__*/function (_ElementShim) {
572
- _inherits(HTMLElement, _ElementShim);
573
- var _super = _createSuper(HTMLElement);
574
- function HTMLElement() {
575
- _classCallCheck(this, HTMLElement);
576
- return _super.apply(this, arguments);
577
- }
578
- return _createClass(HTMLElement);
579
- }(ElementShim);
580
- var HTMLElementShimWithRealType = HTMLElementShim;
581
- var CustomElementRegistryShim = /*#__PURE__*/function () {
582
- function CustomElementRegistry() {
583
- _classCallCheck(this, CustomElementRegistry);
584
- this.__definitions = new Map();
585
- }
586
- _createClass(CustomElementRegistry, [{
587
- key: "define",
588
- value: function define(name, ctor) {
589
- var _ctor$observedAttribu;
590
- if (this.__definitions.has(name)) {
591
- if (process.env.NODE_ENV === 'development') {
592
- 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.");
593
- } else {
594
- throw new Error("Failed to execute 'define' on 'CustomElementRegistry': " + "the name \"".concat(name, "\" has already been used with this registry"));
595
- }
596
- }
597
- this.__definitions.set(name, {
598
- ctor: ctor,
599
- // Note it's important we read `observedAttributes` in case it is a getter
600
- // with side-effects, as is the case in Lit, where it triggers class
601
- // finalization.
602
- //
603
- // TODO(aomarks) To be spec compliant, we should also capture the
604
- // registration-time lifecycle methods like `connectedCallback`. For them
605
- // to be actually accessible to e.g. the Lit SSR element renderer, though,
606
- // we'd need to introduce a new API for accessing them (since `get` only
607
- // returns the constructor).
608
- observedAttributes: (_ctor$observedAttribu = ctor.observedAttributes) !== null && _ctor$observedAttribu !== void 0 ? _ctor$observedAttribu : []
609
- });
610
- }
611
- }, {
612
- key: "get",
613
- value: function get(name) {
614
- var definition = this.__definitions.get(name);
615
- return definition === null || definition === void 0 ? void 0 : definition.ctor;
616
- }
617
- }]);
618
- return CustomElementRegistry;
619
- }();
620
- var CustomElementRegistryShimWithRealType = CustomElementRegistryShim;
621
- new CustomElementRegistryShimWithRealType();
622
-
623
- /**
624
- * Constructs a fresh instance of the "window" vm context to use for evaluating
625
- * user SSR code. Includes a minimal shim of DOM APIs.
626
- *
627
- * @param includeJSBuiltIns Whether certain standard JS context globals like
628
- * `console` and `setTimeout` should also be added to the global. Should
629
- * generally only be true when adding window to a fresh VM context that
630
- * starts with nothing.
631
- * @param props Additional properties to add to the window global
632
- */
633
- var getWindow = function getWindow(_ref) {
634
- var _ref$includeJSBuiltIn = _ref.includeJSBuiltIns,
635
- includeJSBuiltIns = _ref$includeJSBuiltIn === void 0 ? false : _ref$includeJSBuiltIn,
636
- _ref$props = _ref.props,
637
- props = _ref$props === void 0 ? {} : _ref$props;
638
- var ShadowRoot = /*#__PURE__*/_createClass(function ShadowRoot() {
639
- _classCallCheck(this, ShadowRoot);
640
- });
641
- var Document = /*#__PURE__*/function () {
642
- function Document() {
643
- _classCallCheck(this, Document);
644
- }
645
- _createClass(Document, [{
646
- key: "adoptedStyleSheets",
647
- get: function get() {
648
- return [];
649
- }
650
- }, {
651
- key: "createTreeWalker",
652
- value: function createTreeWalker() {
653
- return {};
654
- }
655
- }, {
656
- key: "createTextNode",
657
- value: function createTextNode() {
658
- return {};
659
- }
660
- }, {
661
- key: "createElement",
662
- value: function createElement() {
663
- return {};
664
- }
665
- }]);
666
- return Document;
667
- }();
668
- var CSSStyleSheet = /*#__PURE__*/function () {
669
- function CSSStyleSheet() {
670
- _classCallCheck(this, CSSStyleSheet);
671
- }
672
- _createClass(CSSStyleSheet, [{
673
- key: "replace",
674
- value: function replace() {}
675
- }]);
676
- return CSSStyleSheet;
677
- }();
678
- var window = _objectSpread2({
679
- Element: ElementShimWithRealType,
680
- HTMLElement: HTMLElementShimWithRealType,
681
- Document: Document,
682
- document: new Document(),
683
- CSSStyleSheet: CSSStyleSheet,
684
- ShadowRoot: ShadowRoot,
685
- CustomElementRegistry: CustomElementRegistryShimWithRealType,
686
- customElements: new CustomElementRegistryShimWithRealType(),
687
- btoa: function btoa(s) {
688
- return Buffer.from(s, 'binary').toString('base64');
689
- },
690
- location: new URL('http://localhost'),
691
- MutationObserver: /*#__PURE__*/function () {
692
- function MutationObserver() {
693
- _classCallCheck(this, MutationObserver);
694
- }
695
- _createClass(MutationObserver, [{
696
- key: "observe",
697
- value: function observe() {}
698
- }]);
699
- return MutationObserver;
700
- }(),
701
- // No-op any async tasks
702
- requestAnimationFrame: function requestAnimationFrame() {},
703
- // Set below
704
- window: undefined
705
- }, props);
706
- if (includeJSBuiltIns) {
707
- Object.assign(window, {
708
- // No-op any async tasks
709
- setTimeout: function setTimeout() {},
710
- clearTimeout: function clearTimeout() {},
711
- // Required for node-fetch
712
- Buffer: Buffer,
713
- URL: URL,
714
- URLSearchParams: URLSearchParams,
715
- console: {
716
- log: function log() {
717
- var _console;
718
- (_console = console).log.apply(_console, arguments);
719
- },
720
- info: function info() {
721
- var _console2;
722
- (_console2 = console).info.apply(_console2, arguments);
723
- },
724
- warn: function warn() {
725
- var _console3;
726
- (_console3 = console).warn.apply(_console3, arguments);
727
- },
728
- debug: function debug() {
729
- var _console4;
730
- (_console4 = console).debug.apply(_console4, arguments);
731
- },
732
- error: function error() {
733
- var _console5;
734
- (_console5 = console).error.apply(_console5, arguments);
735
- },
736
- assert: function assert(bool, msg) {
737
- if (!bool) {
738
- throw new Error(msg);
739
- }
740
- }
741
- }
742
- });
743
- }
744
- return window;
745
- };
746
- var installWindowOnGlobal = function installWindowOnGlobal() {
747
- var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
748
- // Avoid installing the DOM shim if one already exists
749
- if (globalThis.window === undefined) {
750
- var window = getWindow({
751
- props: props
752
- });
753
- // Copy initial window globals to node global
754
- Object.assign(globalThis, window);
755
- }
756
- };
757
- installWindowOnGlobal();
758
-
759
- var _e = /*#__PURE__*/new WeakSet();
760
- var _t = /*#__PURE__*/new WeakSet();
761
- var e$1 = /*#__PURE__*/function (_HTMLElement) {
762
- _inherits(e, _HTMLElement);
763
- var _super = _createSuper(e);
764
- function e() {
765
- var _this;
766
- _classCallCheck(this, e);
767
- (_this = _super.call(this), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _t), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _e)), _this.addEventListener("click", function (_e5) {
768
- var t = _e5.target.closest("a");
769
- if (!t) return;
770
- var n = _classPrivateMethodGet(_assertThisInitialized(_this), _e, _e2).call(_assertThisInitialized(_this), t.href);
771
- if (!n) return;
772
- var r = document.getElementById(n);
773
- if (!r) return;
774
- var o = _classPrivateMethodGet(_assertThisInitialized(_this), _t, _t2).call(_assertThisInitialized(_this), r);
775
- o && (_e5.preventDefault(), o.scrollIntoView(), r.focus({
776
- preventScroll: !0
777
- }));
778
- });
779
- return _this;
780
- }
781
- return _createClass(e);
782
- }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
783
- function _e2(_e3) {
784
- return _e3.includes("#") ? _e3.split("#").pop() : void 0;
785
- }
786
- function _t2(_e4) {
787
- var _document$querySelect;
788
- var t = _e4.closest("fieldset");
789
- if (t) {
790
- var n = t.getElementsByTagName("legend");
791
- if (n.length) {
792
- var _t3 = n[0];
793
- if (_e4 instanceof HTMLInputElement && ("checkbox" === _e4.type || "radio" === _e4.type)) return _t3;
794
- var r = _t3.getBoundingClientRect().top,
795
- o = _e4.getBoundingClientRect();
796
- if (o.height && window.innerHeight) {
797
- if (o.top + o.height - r < window.innerHeight / 2) return _t3;
798
- }
799
- }
800
- }
801
- return (_document$querySelect = document.querySelector("label[for='".concat(_e4.getAttribute("id"), "']"))) !== null && _document$querySelect !== void 0 ? _document$querySelect : _e4.closest("label");
802
- }
803
- window && "customElements" in window && customElements.define("bds-error-summary", e$1);
804
-
805
- /**
806
- * @license
807
- * Copyright 2018 Google LLC
808
- * SPDX-License-Identifier: BSD-3-Clause
809
- */
810
- var e = new Set(["children", "localName", "ref", "style", "className"]),
811
- n = new WeakMap(),
812
- l = function l(e, _l, t, o, a) {
813
- var i = null == a ? void 0 : a[_l];
814
- void 0 === i || t === o ? (e[_l] = t, null == t && _l in HTMLElement.prototype && e.removeAttribute(_l)) : function (e, l, t) {
815
- var o = n.get(e);
816
- void 0 === o && n.set(e, o = new Map());
817
- var a = o.get(l);
818
- void 0 !== t ? void 0 === a ? (o.set(l, a = {
819
- handleEvent: t
820
- }), e.addEventListener(l, a)) : a.handleEvent = t : void 0 !== a && (o["delete"](l), e.removeEventListener(l, a));
821
- }(e, i, t);
822
- },
823
- t = function t(_ref) {
824
- var n = _ref.react,
825
- t = _ref.tagName,
826
- o = _ref.elementClass,
827
- a = _ref.events,
828
- i = _ref.displayName;
829
- var s = new Set(Object.keys(null != a ? a : {})),
830
- c = n.forwardRef(function (i, c) {
831
- var r = n.useRef(null),
832
- d = n.useRef(null),
833
- u = {},
834
- v = {};
835
- for (var _i = 0, _Object$entries = Object.entries(i); _i < _Object$entries.length; _i++) {
836
- var _Object$entries$_i = _slicedToArray(_Object$entries[_i], 2),
837
- _n = _Object$entries$_i[0],
838
- _l2 = _Object$entries$_i[1];
839
- e.has(_n) ? u["className" === _n ? "class" : _n] = _l2 : s.has(_n) || _n in o.prototype ? v[_n] = _l2 : u[_n] = _l2;
840
- }
841
- return n.useLayoutEffect(function () {
842
- if (null !== d.current) {
843
- for (var _e in v) l(d.current, _e, i[_e], r.current ? r.current[_e] : void 0, a);
844
- r.current = i;
845
- }
846
- }), n.useLayoutEffect(function () {
847
- var e;
848
- null === (e = d.current) || void 0 === e || e.removeAttribute("defer-hydration");
849
- }, []), u.suppressHydrationWarning = !0, n.createElement(t, _objectSpread2(_objectSpread2({}, u), {}, {
850
- ref: function ref(e) {
851
- d.current = e, "function" == typeof c ? c(e) : null !== c && (c.current = e);
852
- }
853
- }));
854
- });
855
- return c.displayName = null != i ? i : o.name, c;
856
- };
857
-
858
649
  var _excluded$3 = ["className", "errors", "mapNameToId"];
859
- var ReactErrorSummary = t({
860
- tagName: 'bds-error-summary',
861
- elementClass: e$1,
862
- react: React__namespace
863
- });
864
650
  var FormErrorKey = '_form';
865
651
  var FINAL_FORM_ERROR = 'FINAL_FORM/form-error';
866
652
  function BdsErrorSummary(_ref) {
@@ -873,13 +659,33 @@ function BdsErrorSummary(_ref) {
873
659
  props = _objectWithoutProperties(_ref, _excluded$3);
874
660
  var headingId = React__namespace.useId();
875
661
  var groupRef = React__namespace.useRef(null);
662
+ React__namespace.useEffect(function () {
663
+ var loadWebComponent = /*#__PURE__*/function () {
664
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
665
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
666
+ while (1) switch (_context.prev = _context.next) {
667
+ case 0:
668
+ _context.next = 2;
669
+ return Promise.resolve().then(function () { return index; });
670
+ case 2:
671
+ case "end":
672
+ return _context.stop();
673
+ }
674
+ }, _callee);
675
+ }));
676
+ return function loadWebComponent() {
677
+ return _ref2.apply(this, arguments);
678
+ };
679
+ }();
680
+ loadWebComponent();
681
+ });
876
682
  React__namespace.useEffect(function () {
877
683
  if (!errors || Object.keys(errors).length === 0) return;
878
684
  if (!groupRef.current) return;
879
685
  groupRef.current.focus();
880
686
  }, [errors]);
881
687
  if (!errors || Object.keys(errors).length === 0) return null;
882
- return /*#__PURE__*/React__namespace.createElement(ReactErrorSummary, _extends({
688
+ return /*#__PURE__*/React__namespace.createElement("bds-error-summary", _extends({
883
689
  className: ['stack', className].filter(function (x) {
884
690
  return x;
885
691
  }).join(' '),
@@ -1087,6 +893,57 @@ var Typography = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
1087
893
  }, props));
1088
894
  });
1089
895
 
896
+ var _e = /*#__PURE__*/new WeakSet();
897
+ var _t = /*#__PURE__*/new WeakSet();
898
+ var e = /*#__PURE__*/function (_HTMLElement) {
899
+ _inherits(e, _HTMLElement);
900
+ var _super = _createSuper(e);
901
+ function e() {
902
+ var _this;
903
+ _classCallCheck(this, e);
904
+ (_this = _super.call(this), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _t), _classPrivateMethodInitSpec(_assertThisInitialized(_this), _e)), _this.addEventListener("click", function (_e5) {
905
+ var t = _e5.target.closest("a");
906
+ if (!t) return;
907
+ var n = _classPrivateMethodGet(_assertThisInitialized(_this), _e, _e2).call(_assertThisInitialized(_this), t.href);
908
+ if (!n) return;
909
+ var r = document.getElementById(n);
910
+ if (!r) return;
911
+ var o = _classPrivateMethodGet(_assertThisInitialized(_this), _t, _t2).call(_assertThisInitialized(_this), r);
912
+ o && (_e5.preventDefault(), o.scrollIntoView(), r.focus({
913
+ preventScroll: !0
914
+ }));
915
+ });
916
+ return _this;
917
+ }
918
+ return _createClass(e);
919
+ }( /*#__PURE__*/_wrapNativeSuper(HTMLElement));
920
+ function _e2(_e3) {
921
+ return _e3.includes("#") ? _e3.split("#").pop() : void 0;
922
+ }
923
+ function _t2(_e4) {
924
+ var _document$querySelect;
925
+ var t = _e4.closest("fieldset");
926
+ if (t) {
927
+ var n = t.getElementsByTagName("legend");
928
+ if (n.length) {
929
+ var _t3 = n[0];
930
+ if (_e4 instanceof HTMLInputElement && ("checkbox" === _e4.type || "radio" === _e4.type)) return _t3;
931
+ var r = _t3.getBoundingClientRect().top,
932
+ o = _e4.getBoundingClientRect();
933
+ if (o.height && window.innerHeight) {
934
+ if (o.top + o.height - r < window.innerHeight / 2) return _t3;
935
+ }
936
+ }
937
+ }
938
+ return (_document$querySelect = document.querySelector("label[for='".concat(_e4.getAttribute("id"), "']"))) !== null && _document$querySelect !== void 0 ? _document$querySelect : _e4.closest("label");
939
+ }
940
+ window && "customElements" in window && customElements.define("bds-error-summary", e);
941
+
942
+ var index = /*#__PURE__*/Object.freeze({
943
+ __proto__: null,
944
+ default: e
945
+ });
946
+
1090
947
  exports.Button = Button;
1091
948
  exports.CallToAction = CallToAction;
1092
949
  exports.ErrorSummary = BdsErrorSummary;