@sebgroup/green-react 1.0.0-beta.3 → 1.0.0-beta.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/index.d.ts +6 -0
  2. package/{react.esm.js → index.esm.js} +1342 -404
  3. package/index.umd.js +2953 -0
  4. package/lib/alert/alert.d.ts +3 -2
  5. package/lib/badge/badge.d.ts +12 -0
  6. package/lib/card/card.d.ts +3 -4
  7. package/lib/datepicker/datepicker.d.ts +2 -0
  8. package/lib/datepicker/hook.d.ts +12 -0
  9. package/lib/dropdown/dropdown.d.ts +4 -7
  10. package/lib/dropdown/hooks.d.ts +18 -8
  11. package/lib/form/{button.d.ts → button/button.d.ts} +2 -1
  12. package/lib/form/{buttonGroup.d.ts → buttonGroup/buttonGroup.d.ts} +2 -2
  13. package/lib/form/form.d.ts +5 -4
  14. package/lib/form/formContext.d.ts +13 -0
  15. package/lib/form/formItems.d.ts +9 -0
  16. package/lib/form/group/group.d.ts +9 -0
  17. package/lib/form/index.d.ts +7 -4
  18. package/lib/form/input/input.d.ts +11 -0
  19. package/lib/form/radioButton/radioGroup.d.ts +13 -0
  20. package/lib/form/{text.d.ts → text/text.d.ts} +1 -1
  21. package/lib/form/types.d.ts +14 -16
  22. package/lib/form/useInput.d.ts +2 -3
  23. package/lib/form/validateInput.d.ts +9 -0
  24. package/lib/layout/flexbox/flexbox.d.ts +13 -0
  25. package/lib/layout/flexbox/types.d.ts +5 -0
  26. package/lib/layout/index.d.ts +1 -2
  27. package/lib/link/link.d.ts +7 -0
  28. package/lib/list/list.d.ts +14 -0
  29. package/lib/list/listItem.d.ts +10 -0
  30. package/lib/modal/modal.d.ts +2 -1
  31. package/lib/navbar/navbar.d.ts +12 -0
  32. package/lib/stepper/hook.d.ts +3 -0
  33. package/lib/stepper/stepper.d.ts +8 -0
  34. package/lib/tabs/tabs.d.ts +13 -0
  35. package/package.json +7 -10
  36. package/lib/form/input.d.ts +0 -5
  37. package/lib/layout/flexbox.d.ts +0 -9
  38. package/lib/layout/group.d.ts +0 -6
  39. package/react.umd.js +0 -1456
@@ -1,6 +1,6 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { ModalRole, randomId } from '@sebgroup/extract';
3
- import { useState, useEffect, useMemo, useRef } from 'react';
1
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
+ import React, { useState, useLayoutEffect, useEffect, useMemo, useRef } from 'react';
3
+ import { randomId, validateClassName, createStepper, createDropdown, dropdownValues } from '@sebgroup/extract';
4
4
 
5
5
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
6
6
 
@@ -10,7 +10,7 @@ var check = function (it) {
10
10
 
11
11
  // https://github.com/zloirock/core-js/issues/86#issuecomment-115759028
12
12
  var global$r =
13
- // eslint-disable-next-line es/no-global-this -- safe
13
+ // eslint-disable-next-line es-x/no-global-this -- safe
14
14
  check(typeof globalThis == 'object' && globalThis) ||
15
15
  check(typeof window == 'object' && window) ||
16
16
  // eslint-disable-next-line no-restricted-globals -- safe
@@ -21,7 +21,7 @@ var global$r =
21
21
 
22
22
  var objectGetOwnPropertyDescriptor = {};
23
23
 
24
- var fails$9 = function (exec) {
24
+ var fails$a = function (exec) {
25
25
  try {
26
26
  return !!exec();
27
27
  } catch (error) {
@@ -29,24 +29,35 @@ var fails$9 = function (exec) {
29
29
  }
30
30
  };
31
31
 
32
- var fails$8 = fails$9;
32
+ var fails$9 = fails$a;
33
33
 
34
34
  // Detect IE8's incomplete defineProperty implementation
35
- var descriptors = !fails$8(function () {
36
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
35
+ var descriptors = !fails$9(function () {
36
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
37
37
  return Object.defineProperty({}, 1, { get: function () { return 7; } })[1] != 7;
38
38
  });
39
39
 
40
+ var fails$8 = fails$a;
41
+
42
+ var functionBindNative = !fails$8(function () {
43
+ // eslint-disable-next-line es-x/no-function-prototype-bind -- safe
44
+ var test = (function () { /* empty */ }).bind();
45
+ // eslint-disable-next-line no-prototype-builtins -- safe
46
+ return typeof test != 'function' || test.hasOwnProperty('prototype');
47
+ });
48
+
49
+ var NATIVE_BIND$1 = functionBindNative;
50
+
40
51
  var call$6 = Function.prototype.call;
41
52
 
42
- var functionCall = call$6.bind ? call$6.bind(call$6) : function () {
53
+ var functionCall = NATIVE_BIND$1 ? call$6.bind(call$6) : function () {
43
54
  return call$6.apply(call$6, arguments);
44
55
  };
45
56
 
46
57
  var objectPropertyIsEnumerable = {};
47
58
 
48
59
  var $propertyIsEnumerable = {}.propertyIsEnumerable;
49
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
60
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
50
61
  var getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
51
62
 
52
63
  // Nashorn ~ JDK8 bug
@@ -68,35 +79,37 @@ var createPropertyDescriptor$3 = function (bitmap, value) {
68
79
  };
69
80
  };
70
81
 
82
+ var NATIVE_BIND = functionBindNative;
83
+
71
84
  var FunctionPrototype$1 = Function.prototype;
72
85
  var bind = FunctionPrototype$1.bind;
73
86
  var call$5 = FunctionPrototype$1.call;
74
- var callBind = bind && bind.bind(call$5);
87
+ var uncurryThis$c = NATIVE_BIND && bind.bind(call$5, call$5);
75
88
 
76
- var functionUncurryThis = bind ? function (fn) {
77
- return fn && callBind(call$5, fn);
89
+ var functionUncurryThis = NATIVE_BIND ? function (fn) {
90
+ return fn && uncurryThis$c(fn);
78
91
  } : function (fn) {
79
92
  return fn && function () {
80
93
  return call$5.apply(fn, arguments);
81
94
  };
82
95
  };
83
96
 
84
- var uncurryThis$c = functionUncurryThis;
97
+ var uncurryThis$b = functionUncurryThis;
85
98
 
86
- var toString$4 = uncurryThis$c({}.toString);
87
- var stringSlice = uncurryThis$c(''.slice);
99
+ var toString$3 = uncurryThis$b({}.toString);
100
+ var stringSlice$1 = uncurryThis$b(''.slice);
88
101
 
89
102
  var classofRaw$1 = function (it) {
90
- return stringSlice(toString$4(it), 8, -1);
103
+ return stringSlice$1(toString$3(it), 8, -1);
91
104
  };
92
105
 
93
106
  var global$q = global$r;
94
- var uncurryThis$b = functionUncurryThis;
95
- var fails$7 = fails$9;
107
+ var uncurryThis$a = functionUncurryThis;
108
+ var fails$7 = fails$a;
96
109
  var classof$2 = classofRaw$1;
97
110
 
98
111
  var Object$5 = global$q.Object;
99
- var split = uncurryThis$b(''.split);
112
+ var split = uncurryThis$a(''.split);
100
113
 
101
114
  // fallback for non-array-like ES3 and non-enumerable old V8 strings
102
115
  var indexedObject = fails$7(function () {
@@ -113,45 +126,45 @@ var TypeError$8 = global$p.TypeError;
113
126
 
114
127
  // `RequireObjectCoercible` abstract operation
115
128
  // https://tc39.es/ecma262/#sec-requireobjectcoercible
116
- var requireObjectCoercible$3 = function (it) {
129
+ var requireObjectCoercible$2 = function (it) {
117
130
  if (it == undefined) throw TypeError$8("Can't call method on " + it);
118
131
  return it;
119
132
  };
120
133
 
121
134
  // toObject with fallback for non-array-like ES3 strings
122
135
  var IndexedObject$1 = indexedObject;
123
- var requireObjectCoercible$2 = requireObjectCoercible$3;
136
+ var requireObjectCoercible$1 = requireObjectCoercible$2;
124
137
 
125
138
  var toIndexedObject$5 = function (it) {
126
- return IndexedObject$1(requireObjectCoercible$2(it));
139
+ return IndexedObject$1(requireObjectCoercible$1(it));
127
140
  };
128
141
 
129
142
  // `IsCallable` abstract operation
130
143
  // https://tc39.es/ecma262/#sec-iscallable
131
- var isCallable$e = function (argument) {
144
+ var isCallable$f = function (argument) {
132
145
  return typeof argument == 'function';
133
146
  };
134
147
 
135
- var isCallable$d = isCallable$e;
148
+ var isCallable$e = isCallable$f;
136
149
 
137
150
  var isObject$5 = function (it) {
138
- return typeof it == 'object' ? it !== null : isCallable$d(it);
151
+ return typeof it == 'object' ? it !== null : isCallable$e(it);
139
152
  };
140
153
 
141
154
  var global$o = global$r;
142
- var isCallable$c = isCallable$e;
155
+ var isCallable$d = isCallable$f;
143
156
 
144
157
  var aFunction = function (argument) {
145
- return isCallable$c(argument) ? argument : undefined;
158
+ return isCallable$d(argument) ? argument : undefined;
146
159
  };
147
160
 
148
161
  var getBuiltIn$4 = function (namespace, method) {
149
162
  return arguments.length < 2 ? aFunction(global$o[namespace]) : global$o[namespace] && global$o[namespace][method];
150
163
  };
151
164
 
152
- var uncurryThis$a = functionUncurryThis;
165
+ var uncurryThis$9 = functionUncurryThis;
153
166
 
154
- var objectIsPrototypeOf = uncurryThis$a({}.isPrototypeOf);
167
+ var objectIsPrototypeOf = uncurryThis$9({}.isPrototypeOf);
155
168
 
156
169
  var getBuiltIn$3 = getBuiltIn$4;
157
170
 
@@ -185,12 +198,12 @@ if (!version && userAgent) {
185
198
 
186
199
  var engineV8Version = version;
187
200
 
188
- /* eslint-disable es/no-symbol -- required for testing */
201
+ /* eslint-disable es-x/no-symbol -- required for testing */
189
202
 
190
203
  var V8_VERSION = engineV8Version;
191
- var fails$6 = fails$9;
204
+ var fails$6 = fails$a;
192
205
 
193
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- required for testing
206
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- required for testing
194
207
  var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
195
208
  var symbol = Symbol();
196
209
  // Chrome 38 Symbol has incorrect toString conversion
@@ -200,18 +213,18 @@ var nativeSymbol = !!Object.getOwnPropertySymbols && !fails$6(function () {
200
213
  !Symbol.sham && V8_VERSION && V8_VERSION < 41;
201
214
  });
202
215
 
203
- /* eslint-disable es/no-symbol -- required for testing */
216
+ /* eslint-disable es-x/no-symbol -- required for testing */
204
217
 
205
- var NATIVE_SYMBOL$1 = nativeSymbol;
218
+ var NATIVE_SYMBOL$2 = nativeSymbol;
206
219
 
207
- var useSymbolAsUid = NATIVE_SYMBOL$1
220
+ var useSymbolAsUid = NATIVE_SYMBOL$2
208
221
  && !Symbol.sham
209
222
  && typeof Symbol.iterator == 'symbol';
210
223
 
211
224
  var global$m = global$r;
212
225
  var getBuiltIn$2 = getBuiltIn$4;
213
- var isCallable$b = isCallable$e;
214
- var isPrototypeOf = objectIsPrototypeOf;
226
+ var isCallable$c = isCallable$f;
227
+ var isPrototypeOf$1 = objectIsPrototypeOf;
215
228
  var USE_SYMBOL_AS_UID$1 = useSymbolAsUid;
216
229
 
217
230
  var Object$4 = global$m.Object;
@@ -220,7 +233,7 @@ var isSymbol$2 = USE_SYMBOL_AS_UID$1 ? function (it) {
220
233
  return typeof it == 'symbol';
221
234
  } : function (it) {
222
235
  var $Symbol = getBuiltIn$2('Symbol');
223
- return isCallable$b($Symbol) && isPrototypeOf($Symbol.prototype, Object$4(it));
236
+ return isCallable$c($Symbol) && isPrototypeOf$1($Symbol.prototype, Object$4(it));
224
237
  };
225
238
 
226
239
  var global$l = global$r;
@@ -236,14 +249,14 @@ var tryToString$1 = function (argument) {
236
249
  };
237
250
 
238
251
  var global$k = global$r;
239
- var isCallable$a = isCallable$e;
252
+ var isCallable$b = isCallable$f;
240
253
  var tryToString = tryToString$1;
241
254
 
242
255
  var TypeError$7 = global$k.TypeError;
243
256
 
244
257
  // `Assert: IsCallable(argument) is true`
245
258
  var aCallable$1 = function (argument) {
246
- if (isCallable$a(argument)) return argument;
259
+ if (isCallable$b(argument)) return argument;
247
260
  throw TypeError$7(tryToString(argument) + ' is not a function');
248
261
  };
249
262
 
@@ -258,7 +271,7 @@ var getMethod$1 = function (V, P) {
258
271
 
259
272
  var global$j = global$r;
260
273
  var call$4 = functionCall;
261
- var isCallable$9 = isCallable$e;
274
+ var isCallable$a = isCallable$f;
262
275
  var isObject$4 = isObject$5;
263
276
 
264
277
  var TypeError$6 = global$j.TypeError;
@@ -267,9 +280,9 @@ var TypeError$6 = global$j.TypeError;
267
280
  // https://tc39.es/ecma262/#sec-ordinarytoprimitive
268
281
  var ordinaryToPrimitive$1 = function (input, pref) {
269
282
  var fn, val;
270
- if (pref === 'string' && isCallable$9(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
271
- if (isCallable$9(fn = input.valueOf) && !isObject$4(val = call$4(fn, input))) return val;
272
- if (pref !== 'string' && isCallable$9(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
283
+ if (pref === 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
284
+ if (isCallable$a(fn = input.valueOf) && !isObject$4(val = call$4(fn, input))) return val;
285
+ if (pref !== 'string' && isCallable$a(fn = input.toString) && !isObject$4(val = call$4(fn, input))) return val;
273
286
  throw TypeError$6("Can't convert object to primitive value");
274
287
  };
275
288
 
@@ -277,12 +290,12 @@ var shared$3 = {exports: {}};
277
290
 
278
291
  var global$i = global$r;
279
292
 
280
- // eslint-disable-next-line es/no-object-defineproperty -- safe
281
- var defineProperty$2 = Object.defineProperty;
293
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
294
+ var defineProperty$4 = Object.defineProperty;
282
295
 
283
296
  var setGlobal$3 = function (key, value) {
284
297
  try {
285
- defineProperty$2(global$i, key, { value: value, configurable: true, writable: true });
298
+ defineProperty$4(global$i, key, { value: value, configurable: true, writable: true });
286
299
  } catch (error) {
287
300
  global$i[key] = value;
288
301
  } return value;
@@ -301,60 +314,63 @@ var store$2 = sharedStore;
301
314
  (shared$3.exports = function (key, value) {
302
315
  return store$2[key] || (store$2[key] = value !== undefined ? value : {});
303
316
  })('versions', []).push({
304
- version: '3.19.0',
317
+ version: '3.22.2',
305
318
  mode: 'global',
306
- copyright: '© 2021 Denis Pushkarev (zloirock.ru)'
319
+ copyright: '© 2014-2022 Denis Pushkarev (zloirock.ru)',
320
+ license: 'https://github.com/zloirock/core-js/blob/v3.22.2/LICENSE',
321
+ source: 'https://github.com/zloirock/core-js'
307
322
  });
308
323
 
309
324
  var global$g = global$r;
310
- var requireObjectCoercible$1 = requireObjectCoercible$3;
325
+ var requireObjectCoercible = requireObjectCoercible$2;
311
326
 
312
327
  var Object$3 = global$g.Object;
313
328
 
314
329
  // `ToObject` abstract operation
315
330
  // https://tc39.es/ecma262/#sec-toobject
316
331
  var toObject$3 = function (argument) {
317
- return Object$3(requireObjectCoercible$1(argument));
332
+ return Object$3(requireObjectCoercible(argument));
318
333
  };
319
334
 
320
- var uncurryThis$9 = functionUncurryThis;
335
+ var uncurryThis$8 = functionUncurryThis;
321
336
  var toObject$2 = toObject$3;
322
337
 
323
- var hasOwnProperty = uncurryThis$9({}.hasOwnProperty);
338
+ var hasOwnProperty = uncurryThis$8({}.hasOwnProperty);
324
339
 
325
340
  // `HasOwnProperty` abstract operation
326
341
  // https://tc39.es/ecma262/#sec-hasownproperty
342
+ // eslint-disable-next-line es-x/no-object-hasown -- safe
327
343
  var hasOwnProperty_1 = Object.hasOwn || function hasOwn(it, key) {
328
344
  return hasOwnProperty(toObject$2(it), key);
329
345
  };
330
346
 
331
- var uncurryThis$8 = functionUncurryThis;
347
+ var uncurryThis$7 = functionUncurryThis;
332
348
 
333
349
  var id = 0;
334
350
  var postfix = Math.random();
335
- var toString$3 = uncurryThis$8(1.0.toString);
351
+ var toString$2 = uncurryThis$7(1.0.toString);
336
352
 
337
353
  var uid$2 = function (key) {
338
- return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$3(++id + postfix, 36);
354
+ return 'Symbol(' + (key === undefined ? '' : key) + ')_' + toString$2(++id + postfix, 36);
339
355
  };
340
356
 
341
357
  var global$f = global$r;
342
358
  var shared$2 = shared$3.exports;
343
- var hasOwn$8 = hasOwnProperty_1;
359
+ var hasOwn$9 = hasOwnProperty_1;
344
360
  var uid$1 = uid$2;
345
- var NATIVE_SYMBOL = nativeSymbol;
361
+ var NATIVE_SYMBOL$1 = nativeSymbol;
346
362
  var USE_SYMBOL_AS_UID = useSymbolAsUid;
347
363
 
348
364
  var WellKnownSymbolsStore = shared$2('wks');
349
- var Symbol$2 = global$f.Symbol;
350
- var symbolFor = Symbol$2 && Symbol$2['for'];
351
- var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$2 : Symbol$2 && Symbol$2.withoutSetter || uid$1;
365
+ var Symbol$1 = global$f.Symbol;
366
+ var symbolFor = Symbol$1 && Symbol$1['for'];
367
+ var createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || uid$1;
352
368
 
353
369
  var wellKnownSymbol$8 = function (name) {
354
- if (!hasOwn$8(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL || typeof WellKnownSymbolsStore[name] == 'string')) {
370
+ if (!hasOwn$9(WellKnownSymbolsStore, name) || !(NATIVE_SYMBOL$1 || typeof WellKnownSymbolsStore[name] == 'string')) {
355
371
  var description = 'Symbol.' + name;
356
- if (NATIVE_SYMBOL && hasOwn$8(Symbol$2, name)) {
357
- WellKnownSymbolsStore[name] = Symbol$2[name];
372
+ if (NATIVE_SYMBOL$1 && hasOwn$9(Symbol$1, name)) {
373
+ WellKnownSymbolsStore[name] = Symbol$1[name];
358
374
  } else if (USE_SYMBOL_AS_UID && symbolFor) {
359
375
  WellKnownSymbolsStore[name] = symbolFor(description);
360
376
  } else {
@@ -411,43 +427,56 @@ var documentCreateElement$2 = function (it) {
411
427
  return EXISTS$1 ? document$1.createElement(it) : {};
412
428
  };
413
429
 
414
- var DESCRIPTORS$6 = descriptors;
415
- var fails$5 = fails$9;
430
+ var DESCRIPTORS$9 = descriptors;
431
+ var fails$5 = fails$a;
416
432
  var createElement = documentCreateElement$2;
417
433
 
418
- // Thank's IE8 for his funny defineProperty
419
- var ie8DomDefine = !DESCRIPTORS$6 && !fails$5(function () {
420
- // eslint-disable-next-line es/no-object-defineproperty -- requied for testing
434
+ // Thanks to IE8 for its funny defineProperty
435
+ var ie8DomDefine = !DESCRIPTORS$9 && !fails$5(function () {
436
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
421
437
  return Object.defineProperty(createElement('div'), 'a', {
422
438
  get: function () { return 7; }
423
439
  }).a != 7;
424
440
  });
425
441
 
426
- var DESCRIPTORS$5 = descriptors;
442
+ var DESCRIPTORS$8 = descriptors;
427
443
  var call$2 = functionCall;
428
444
  var propertyIsEnumerableModule$1 = objectPropertyIsEnumerable;
429
445
  var createPropertyDescriptor$2 = createPropertyDescriptor$3;
430
446
  var toIndexedObject$4 = toIndexedObject$5;
431
447
  var toPropertyKey$1 = toPropertyKey$2;
432
- var hasOwn$7 = hasOwnProperty_1;
448
+ var hasOwn$8 = hasOwnProperty_1;
433
449
  var IE8_DOM_DEFINE$1 = ie8DomDefine;
434
450
 
435
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
436
- var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
451
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
452
+ var $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
437
453
 
438
454
  // `Object.getOwnPropertyDescriptor` method
439
455
  // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
440
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$5 ? $getOwnPropertyDescriptor : function getOwnPropertyDescriptor(O, P) {
456
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$8 ? $getOwnPropertyDescriptor$1 : function getOwnPropertyDescriptor(O, P) {
441
457
  O = toIndexedObject$4(O);
442
458
  P = toPropertyKey$1(P);
443
459
  if (IE8_DOM_DEFINE$1) try {
444
- return $getOwnPropertyDescriptor(O, P);
460
+ return $getOwnPropertyDescriptor$1(O, P);
445
461
  } catch (error) { /* empty */ }
446
- if (hasOwn$7(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
462
+ if (hasOwn$8(O, P)) return createPropertyDescriptor$2(!call$2(propertyIsEnumerableModule$1.f, O, P), O[P]);
447
463
  };
448
464
 
449
465
  var objectDefineProperty = {};
450
466
 
467
+ var DESCRIPTORS$7 = descriptors;
468
+ var fails$4 = fails$a;
469
+
470
+ // V8 ~ Chrome 36-
471
+ // https://bugs.chromium.org/p/v8/issues/detail?id=3334
472
+ var v8PrototypeDefineBug = DESCRIPTORS$7 && fails$4(function () {
473
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
474
+ return Object.defineProperty(function () { /* empty */ }, 'prototype', {
475
+ value: 42,
476
+ writable: false
477
+ }).prototype != 42;
478
+ });
479
+
451
480
  var global$c = global$r;
452
481
  var isObject$1 = isObject$5;
453
482
 
@@ -461,18 +490,39 @@ var anObject$5 = function (argument) {
461
490
  };
462
491
 
463
492
  var global$b = global$r;
464
- var DESCRIPTORS$4 = descriptors;
493
+ var DESCRIPTORS$6 = descriptors;
465
494
  var IE8_DOM_DEFINE = ie8DomDefine;
495
+ var V8_PROTOTYPE_DEFINE_BUG$1 = v8PrototypeDefineBug;
466
496
  var anObject$4 = anObject$5;
467
497
  var toPropertyKey = toPropertyKey$2;
468
498
 
469
499
  var TypeError$3 = global$b.TypeError;
470
- // eslint-disable-next-line es/no-object-defineproperty -- safe
500
+ // eslint-disable-next-line es-x/no-object-defineproperty -- safe
471
501
  var $defineProperty = Object.defineProperty;
502
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
503
+ var $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
504
+ var ENUMERABLE = 'enumerable';
505
+ var CONFIGURABLE$1 = 'configurable';
506
+ var WRITABLE = 'writable';
472
507
 
473
508
  // `Object.defineProperty` method
474
509
  // https://tc39.es/ecma262/#sec-object.defineproperty
475
- objectDefineProperty.f = DESCRIPTORS$4 ? $defineProperty : function defineProperty(O, P, Attributes) {
510
+ objectDefineProperty.f = DESCRIPTORS$6 ? V8_PROTOTYPE_DEFINE_BUG$1 ? function defineProperty(O, P, Attributes) {
511
+ anObject$4(O);
512
+ P = toPropertyKey(P);
513
+ anObject$4(Attributes);
514
+ if (typeof O === 'function' && P === 'prototype' && 'value' in Attributes && WRITABLE in Attributes && !Attributes[WRITABLE]) {
515
+ var current = $getOwnPropertyDescriptor(O, P);
516
+ if (current && current[WRITABLE]) {
517
+ O[P] = Attributes.value;
518
+ Attributes = {
519
+ configurable: CONFIGURABLE$1 in Attributes ? Attributes[CONFIGURABLE$1] : current[CONFIGURABLE$1],
520
+ enumerable: ENUMERABLE in Attributes ? Attributes[ENUMERABLE] : current[ENUMERABLE],
521
+ writable: false
522
+ };
523
+ }
524
+ } return $defineProperty(O, P, Attributes);
525
+ } : $defineProperty : function defineProperty(O, P, Attributes) {
476
526
  anObject$4(O);
477
527
  P = toPropertyKey(P);
478
528
  anObject$4(Attributes);
@@ -484,11 +534,11 @@ objectDefineProperty.f = DESCRIPTORS$4 ? $defineProperty : function defineProper
484
534
  return O;
485
535
  };
486
536
 
487
- var DESCRIPTORS$3 = descriptors;
537
+ var DESCRIPTORS$5 = descriptors;
488
538
  var definePropertyModule$3 = objectDefineProperty;
489
539
  var createPropertyDescriptor$1 = createPropertyDescriptor$3;
490
540
 
491
- var createNonEnumerableProperty$5 = DESCRIPTORS$3 ? function (object, key, value) {
541
+ var createNonEnumerableProperty$5 = DESCRIPTORS$5 ? function (object, key, value) {
492
542
  return definePropertyModule$3.f(object, key, createPropertyDescriptor$1(1, value));
493
543
  } : function (object, key, value) {
494
544
  object[key] = value;
@@ -497,14 +547,14 @@ var createNonEnumerableProperty$5 = DESCRIPTORS$3 ? function (object, key, value
497
547
 
498
548
  var redefine$3 = {exports: {}};
499
549
 
500
- var uncurryThis$7 = functionUncurryThis;
501
- var isCallable$8 = isCallable$e;
550
+ var uncurryThis$6 = functionUncurryThis;
551
+ var isCallable$9 = isCallable$f;
502
552
  var store$1 = sharedStore;
503
553
 
504
- var functionToString = uncurryThis$7(Function.toString);
554
+ var functionToString = uncurryThis$6(Function.toString);
505
555
 
506
556
  // this helper broken in `core-js@3.4.1-3.4.4`, so we can't use `shared` helper
507
- if (!isCallable$8(store$1.inspectSource)) {
557
+ if (!isCallable$9(store$1.inspectSource)) {
508
558
  store$1.inspectSource = function (it) {
509
559
  return functionToString(it);
510
560
  };
@@ -513,12 +563,12 @@ if (!isCallable$8(store$1.inspectSource)) {
513
563
  var inspectSource$2 = store$1.inspectSource;
514
564
 
515
565
  var global$a = global$r;
516
- var isCallable$7 = isCallable$e;
566
+ var isCallable$8 = isCallable$f;
517
567
  var inspectSource$1 = inspectSource$2;
518
568
 
519
569
  var WeakMap$1 = global$a.WeakMap;
520
570
 
521
- var nativeWeakMap = isCallable$7(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
571
+ var nativeWeakMap = isCallable$8(WeakMap$1) && /native code/.test(inspectSource$1(WeakMap$1));
522
572
 
523
573
  var shared$1 = shared$3.exports;
524
574
  var uid = uid$2;
@@ -533,10 +583,10 @@ var hiddenKeys$4 = {};
533
583
 
534
584
  var NATIVE_WEAK_MAP = nativeWeakMap;
535
585
  var global$9 = global$r;
536
- var uncurryThis$6 = functionUncurryThis;
586
+ var uncurryThis$5 = functionUncurryThis;
537
587
  var isObject = isObject$5;
538
588
  var createNonEnumerableProperty$4 = createNonEnumerableProperty$5;
539
- var hasOwn$6 = hasOwnProperty_1;
589
+ var hasOwn$7 = hasOwnProperty_1;
540
590
  var shared = sharedStore;
541
591
  var sharedKey$2 = sharedKey$3;
542
592
  var hiddenKeys$3 = hiddenKeys$4;
@@ -561,9 +611,9 @@ var getterFor = function (TYPE) {
561
611
 
562
612
  if (NATIVE_WEAK_MAP || shared.state) {
563
613
  var store = shared.state || (shared.state = new WeakMap());
564
- var wmget = uncurryThis$6(store.get);
565
- var wmhas = uncurryThis$6(store.has);
566
- var wmset = uncurryThis$6(store.set);
614
+ var wmget = uncurryThis$5(store.get);
615
+ var wmhas = uncurryThis$5(store.has);
616
+ var wmset = uncurryThis$5(store.set);
567
617
  set = function (it, metadata) {
568
618
  if (wmhas(store, it)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
569
619
  metadata.facade = it;
@@ -580,16 +630,16 @@ if (NATIVE_WEAK_MAP || shared.state) {
580
630
  var STATE = sharedKey$2('state');
581
631
  hiddenKeys$3[STATE] = true;
582
632
  set = function (it, metadata) {
583
- if (hasOwn$6(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
633
+ if (hasOwn$7(it, STATE)) throw new TypeError$2(OBJECT_ALREADY_INITIALIZED);
584
634
  metadata.facade = it;
585
635
  createNonEnumerableProperty$4(it, STATE, metadata);
586
636
  return metadata;
587
637
  };
588
638
  get = function (it) {
589
- return hasOwn$6(it, STATE) ? it[STATE] : {};
639
+ return hasOwn$7(it, STATE) ? it[STATE] : {};
590
640
  };
591
641
  has = function (it) {
592
- return hasOwn$6(it, STATE);
642
+ return hasOwn$7(it, STATE);
593
643
  };
594
644
  }
595
645
 
@@ -601,17 +651,17 @@ var internalState = {
601
651
  getterFor: getterFor
602
652
  };
603
653
 
604
- var DESCRIPTORS$2 = descriptors;
605
- var hasOwn$5 = hasOwnProperty_1;
654
+ var DESCRIPTORS$4 = descriptors;
655
+ var hasOwn$6 = hasOwnProperty_1;
606
656
 
607
657
  var FunctionPrototype = Function.prototype;
608
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
609
- var getDescriptor = DESCRIPTORS$2 && Object.getOwnPropertyDescriptor;
658
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
659
+ var getDescriptor = DESCRIPTORS$4 && Object.getOwnPropertyDescriptor;
610
660
 
611
- var EXISTS = hasOwn$5(FunctionPrototype, 'name');
661
+ var EXISTS = hasOwn$6(FunctionPrototype, 'name');
612
662
  // additional protection from minified / mangled / dropped function names
613
663
  var PROPER = EXISTS && (function something() { /* empty */ }).name === 'something';
614
- var CONFIGURABLE = EXISTS && (!DESCRIPTORS$2 || (DESCRIPTORS$2 && getDescriptor(FunctionPrototype, 'name').configurable));
664
+ var CONFIGURABLE = EXISTS && (!DESCRIPTORS$4 || (DESCRIPTORS$4 && getDescriptor(FunctionPrototype, 'name').configurable));
615
665
 
616
666
  var functionName = {
617
667
  EXISTS: EXISTS,
@@ -620,8 +670,8 @@ var functionName = {
620
670
  };
621
671
 
622
672
  var global$8 = global$r;
623
- var isCallable$6 = isCallable$e;
624
- var hasOwn$4 = hasOwnProperty_1;
673
+ var isCallable$7 = isCallable$f;
674
+ var hasOwn$5 = hasOwnProperty_1;
625
675
  var createNonEnumerableProperty$3 = createNonEnumerableProperty$5;
626
676
  var setGlobal$1 = setGlobal$3;
627
677
  var inspectSource = inspectSource$2;
@@ -638,11 +688,11 @@ var TEMPLATE = String(String).split('String');
638
688
  var noTargetGet = options ? !!options.noTargetGet : false;
639
689
  var name = options && options.name !== undefined ? options.name : key;
640
690
  var state;
641
- if (isCallable$6(value)) {
691
+ if (isCallable$7(value)) {
642
692
  if (String(name).slice(0, 7) === 'Symbol(') {
643
693
  name = '[' + String(name).replace(/^Symbol\(([^)]*)\)/, '$1') + ']';
644
694
  }
645
- if (!hasOwn$4(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
695
+ if (!hasOwn$5(value, 'name') || (CONFIGURABLE_FUNCTION_NAME$1 && value.name !== name)) {
646
696
  createNonEnumerableProperty$3(value, 'name', name);
647
697
  }
648
698
  state = enforceInternalState(value);
@@ -663,7 +713,7 @@ var TEMPLATE = String(String).split('String');
663
713
  else createNonEnumerableProperty$3(O, key, value);
664
714
  // add fake Function#toString for correct work wrapped methods / constructors with methods like LoDash isNative
665
715
  })(Function.prototype, 'toString', function toString() {
666
- return isCallable$6(this) && getInternalState$1(this).source || inspectSource(this);
716
+ return isCallable$7(this) && getInternalState$1(this).source || inspectSource(this);
667
717
  });
668
718
 
669
719
  var objectGetOwnPropertyNames = {};
@@ -715,7 +765,7 @@ var toAbsoluteIndex = toAbsoluteIndex$1;
715
765
  var lengthOfArrayLike = lengthOfArrayLike$1;
716
766
 
717
767
  // `Array.prototype.{ indexOf, includes }` methods implementation
718
- var createMethod$1 = function (IS_INCLUDES) {
768
+ var createMethod = function (IS_INCLUDES) {
719
769
  return function ($this, el, fromIndex) {
720
770
  var O = toIndexedObject$3($this);
721
771
  var length = lengthOfArrayLike(O);
@@ -737,28 +787,28 @@ var createMethod$1 = function (IS_INCLUDES) {
737
787
  var arrayIncludes = {
738
788
  // `Array.prototype.includes` method
739
789
  // https://tc39.es/ecma262/#sec-array.prototype.includes
740
- includes: createMethod$1(true),
790
+ includes: createMethod(true),
741
791
  // `Array.prototype.indexOf` method
742
792
  // https://tc39.es/ecma262/#sec-array.prototype.indexof
743
- indexOf: createMethod$1(false)
793
+ indexOf: createMethod(false)
744
794
  };
745
795
 
746
- var uncurryThis$5 = functionUncurryThis;
747
- var hasOwn$3 = hasOwnProperty_1;
796
+ var uncurryThis$4 = functionUncurryThis;
797
+ var hasOwn$4 = hasOwnProperty_1;
748
798
  var toIndexedObject$2 = toIndexedObject$5;
749
799
  var indexOf = arrayIncludes.indexOf;
750
800
  var hiddenKeys$2 = hiddenKeys$4;
751
801
 
752
- var push = uncurryThis$5([].push);
802
+ var push = uncurryThis$4([].push);
753
803
 
754
804
  var objectKeysInternal = function (object, names) {
755
805
  var O = toIndexedObject$2(object);
756
806
  var i = 0;
757
807
  var result = [];
758
808
  var key;
759
- for (key in O) !hasOwn$3(hiddenKeys$2, key) && hasOwn$3(O, key) && push(result, key);
809
+ for (key in O) !hasOwn$4(hiddenKeys$2, key) && hasOwn$4(O, key) && push(result, key);
760
810
  // Don't enum bug & hidden keys
761
- while (names.length > i) if (hasOwn$3(O, key = names[i++])) {
811
+ while (names.length > i) if (hasOwn$4(O, key = names[i++])) {
762
812
  ~indexOf(result, key) || push(result, key);
763
813
  }
764
814
  return result;
@@ -782,23 +832,23 @@ var hiddenKeys$1 = enumBugKeys$2.concat('length', 'prototype');
782
832
 
783
833
  // `Object.getOwnPropertyNames` method
784
834
  // https://tc39.es/ecma262/#sec-object.getownpropertynames
785
- // eslint-disable-next-line es/no-object-getownpropertynames -- safe
835
+ // eslint-disable-next-line es-x/no-object-getownpropertynames -- safe
786
836
  objectGetOwnPropertyNames.f = Object.getOwnPropertyNames || function getOwnPropertyNames(O) {
787
837
  return internalObjectKeys$1(O, hiddenKeys$1);
788
838
  };
789
839
 
790
840
  var objectGetOwnPropertySymbols = {};
791
841
 
792
- // eslint-disable-next-line es/no-object-getownpropertysymbols -- safe
842
+ // eslint-disable-next-line es-x/no-object-getownpropertysymbols -- safe
793
843
  objectGetOwnPropertySymbols.f = Object.getOwnPropertySymbols;
794
844
 
795
845
  var getBuiltIn$1 = getBuiltIn$4;
796
- var uncurryThis$4 = functionUncurryThis;
846
+ var uncurryThis$3 = functionUncurryThis;
797
847
  var getOwnPropertyNamesModule = objectGetOwnPropertyNames;
798
848
  var getOwnPropertySymbolsModule$1 = objectGetOwnPropertySymbols;
799
849
  var anObject$3 = anObject$5;
800
850
 
801
- var concat$1 = uncurryThis$4([].concat);
851
+ var concat$1 = uncurryThis$3([].concat);
802
852
 
803
853
  // all object keys, includes non-enumerable and symbols
804
854
  var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
@@ -807,23 +857,25 @@ var ownKeys$1 = getBuiltIn$1('Reflect', 'ownKeys') || function ownKeys(it) {
807
857
  return getOwnPropertySymbols ? concat$1(keys, getOwnPropertySymbols(it)) : keys;
808
858
  };
809
859
 
810
- var hasOwn$2 = hasOwnProperty_1;
860
+ var hasOwn$3 = hasOwnProperty_1;
811
861
  var ownKeys = ownKeys$1;
812
862
  var getOwnPropertyDescriptorModule = objectGetOwnPropertyDescriptor;
813
863
  var definePropertyModule$2 = objectDefineProperty;
814
864
 
815
- var copyConstructorProperties$1 = function (target, source) {
865
+ var copyConstructorProperties$2 = function (target, source, exceptions) {
816
866
  var keys = ownKeys(source);
817
867
  var defineProperty = definePropertyModule$2.f;
818
868
  var getOwnPropertyDescriptor = getOwnPropertyDescriptorModule.f;
819
869
  for (var i = 0; i < keys.length; i++) {
820
870
  var key = keys[i];
821
- if (!hasOwn$2(target, key)) defineProperty(target, key, getOwnPropertyDescriptor(source, key));
871
+ if (!hasOwn$3(target, key) && !(exceptions && hasOwn$3(exceptions, key))) {
872
+ defineProperty(target, key, getOwnPropertyDescriptor(source, key));
873
+ }
822
874
  }
823
875
  };
824
876
 
825
- var fails$4 = fails$9;
826
- var isCallable$5 = isCallable$e;
877
+ var fails$3 = fails$a;
878
+ var isCallable$6 = isCallable$f;
827
879
 
828
880
  var replacement = /#|\.prototype\./;
829
881
 
@@ -831,7 +883,7 @@ var isForced$1 = function (feature, detection) {
831
883
  var value = data[normalize(feature)];
832
884
  return value == POLYFILL ? true
833
885
  : value == NATIVE ? false
834
- : isCallable$5(detection) ? fails$4(detection)
886
+ : isCallable$6(detection) ? fails$3(detection)
835
887
  : !!detection;
836
888
  };
837
889
 
@@ -850,7 +902,7 @@ var getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f;
850
902
  var createNonEnumerableProperty$2 = createNonEnumerableProperty$5;
851
903
  var redefine$2 = redefine$3.exports;
852
904
  var setGlobal = setGlobal$3;
853
- var copyConstructorProperties = copyConstructorProperties$1;
905
+ var copyConstructorProperties$1 = copyConstructorProperties$2;
854
906
  var isForced = isForced_1;
855
907
 
856
908
  /*
@@ -890,7 +942,7 @@ var _export = function (options, source) {
890
942
  // contained in target
891
943
  if (!FORCED && targetProperty !== undefined) {
892
944
  if (typeof sourceProperty == typeof targetProperty) continue;
893
- copyConstructorProperties(sourceProperty, targetProperty);
945
+ copyConstructorProperties$1(sourceProperty, targetProperty);
894
946
  }
895
947
  // add a flag to not completely full polyfills
896
948
  if (options.sham || (targetProperty && targetProperty.sham)) {
@@ -906,35 +958,35 @@ var enumBugKeys$1 = enumBugKeys$3;
906
958
 
907
959
  // `Object.keys` method
908
960
  // https://tc39.es/ecma262/#sec-object.keys
909
- // eslint-disable-next-line es/no-object-keys -- safe
961
+ // eslint-disable-next-line es-x/no-object-keys -- safe
910
962
  var objectKeys$2 = Object.keys || function keys(O) {
911
963
  return internalObjectKeys(O, enumBugKeys$1);
912
964
  };
913
965
 
914
- var DESCRIPTORS$1 = descriptors;
915
- var uncurryThis$3 = functionUncurryThis;
966
+ var DESCRIPTORS$3 = descriptors;
967
+ var uncurryThis$2 = functionUncurryThis;
916
968
  var call$1 = functionCall;
917
- var fails$3 = fails$9;
969
+ var fails$2 = fails$a;
918
970
  var objectKeys$1 = objectKeys$2;
919
971
  var getOwnPropertySymbolsModule = objectGetOwnPropertySymbols;
920
972
  var propertyIsEnumerableModule = objectPropertyIsEnumerable;
921
973
  var toObject$1 = toObject$3;
922
974
  var IndexedObject = indexedObject;
923
975
 
924
- // eslint-disable-next-line es/no-object-assign -- safe
976
+ // eslint-disable-next-line es-x/no-object-assign -- safe
925
977
  var $assign = Object.assign;
926
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
927
- var defineProperty$1 = Object.defineProperty;
928
- var concat = uncurryThis$3([].concat);
978
+ // eslint-disable-next-line es-x/no-object-defineproperty -- required for testing
979
+ var defineProperty$3 = Object.defineProperty;
980
+ var concat = uncurryThis$2([].concat);
929
981
 
930
982
  // `Object.assign` method
931
983
  // https://tc39.es/ecma262/#sec-object.assign
932
- var objectAssign = !$assign || fails$3(function () {
984
+ var objectAssign = !$assign || fails$2(function () {
933
985
  // should have correct order of operations (Edge bug)
934
- if (DESCRIPTORS$1 && $assign({ b: 1 }, $assign(defineProperty$1({}, 'a', {
986
+ if (DESCRIPTORS$3 && $assign({ b: 1 }, $assign(defineProperty$3({}, 'a', {
935
987
  enumerable: true,
936
988
  get: function () {
937
- defineProperty$1(this, 'b', {
989
+ defineProperty$3(this, 'b', {
938
990
  value: 3,
939
991
  enumerable: false
940
992
  });
@@ -943,7 +995,7 @@ var objectAssign = !$assign || fails$3(function () {
943
995
  // should work with symbols and should have deterministic property order (V8 bug)
944
996
  var A = {};
945
997
  var B = {};
946
- // eslint-disable-next-line es/no-symbol -- safe
998
+ // eslint-disable-next-line es-x/no-symbol -- safe
947
999
  var symbol = Symbol();
948
1000
  var alphabet = 'abcdefghijklmnopqrst';
949
1001
  A[symbol] = 7;
@@ -963,7 +1015,7 @@ var objectAssign = !$assign || fails$3(function () {
963
1015
  var key;
964
1016
  while (length > j) {
965
1017
  key = keys[j++];
966
- if (!DESCRIPTORS$1 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
1018
+ if (!DESCRIPTORS$3 || call$1(propertyIsEnumerable, S, key)) T[key] = S[key];
967
1019
  }
968
1020
  } return T;
969
1021
  } : $assign;
@@ -973,12 +1025,12 @@ var assign = objectAssign;
973
1025
 
974
1026
  // `Object.assign` method
975
1027
  // https://tc39.es/ecma262/#sec-object.assign
976
- // eslint-disable-next-line es/no-object-assign -- required for testing
1028
+ // eslint-disable-next-line es-x/no-object-assign -- required for testing
977
1029
  $$2({ target: 'Object', stat: true, forced: Object.assign !== assign }, {
978
1030
  assign: assign
979
1031
  });
980
1032
 
981
- /*! *****************************************************************************
1033
+ /******************************************************************************
982
1034
  Copyright (c) Microsoft Corporation.
983
1035
 
984
1036
  Permission to use, copy, modify, and/or distribute this software for any
@@ -1009,11 +1061,13 @@ function Button({
1009
1061
  children,
1010
1062
  variant,
1011
1063
  onClick,
1064
+ disabled,
1012
1065
  active = false,
1013
1066
  type = 'button'
1014
1067
  }) {
1015
1068
  const props = {
1016
- type
1069
+ type,
1070
+ disabled
1017
1071
  };
1018
1072
  const classNames = [];
1019
1073
  if (variant) classNames.push(variant);
@@ -1022,7 +1076,7 @@ function Button({
1022
1076
  if (onClick) props.onClick = onClick;
1023
1077
  return jsx("button", Object.assign({}, props, {
1024
1078
  children: children
1025
- }), void 0);
1079
+ }));
1026
1080
  }
1027
1081
 
1028
1082
  const ModalHeader = ({
@@ -1038,7 +1092,7 @@ const ModalHeader = ({
1038
1092
  }, {
1039
1093
  children: [jsx("h3", {
1040
1094
  children: _header
1041
- }, void 0), jsx("button", Object.assign({
1095
+ }), jsx("button", Object.assign({
1042
1096
  className: "close",
1043
1097
  onClick: handleClose
1044
1098
  }, {
@@ -1046,9 +1100,9 @@ const ModalHeader = ({
1046
1100
  className: "sr-only"
1047
1101
  }, {
1048
1102
  children: "Close"
1049
- }), void 0)
1050
- }), void 0)]
1051
- }), void 0);
1103
+ }))
1104
+ }))]
1105
+ }));
1052
1106
  };
1053
1107
 
1054
1108
  const ModalBody = ({
@@ -1058,7 +1112,7 @@ const ModalBody = ({
1058
1112
  className: "body"
1059
1113
  }, {
1060
1114
  children: children
1061
- }), void 0);
1115
+ }));
1062
1116
  };
1063
1117
 
1064
1118
  const ModalFooter = ({
@@ -1086,29 +1140,60 @@ const ModalFooter = ({
1086
1140
  onClick: handleDismiss
1087
1141
  }, {
1088
1142
  children: dismiss
1089
- }), void 0), confirm && jsx(Button, Object.assign({
1143
+ })), confirm && jsx(Button, Object.assign({
1090
1144
  variant: "primary",
1091
1145
  onClick: handleConfirm
1092
1146
  }, {
1093
1147
  children: confirm
1094
- }), void 0)]
1095
- }), void 0);
1148
+ }))]
1149
+ }));
1096
1150
  };
1097
1151
 
1098
1152
  const Modal = _a => {
1099
1153
  var {
1100
- type = 'default'
1154
+ type = 'default',
1155
+ isOpen
1101
1156
  } = _a,
1102
- props = __rest(_a, ["type"]);
1157
+ props = __rest(_a, ["type", "isOpen"]);
1103
1158
 
1104
- return jsxs("section", Object.assign({
1105
- role: ModalRole[type]
1106
- }, {
1107
- children: [jsx(ModalHeader, Object.assign({}, props), void 0), jsx(ModalBody, Object.assign({}, props), void 0), jsx(ModalFooter, Object.assign({}, props), void 0)]
1108
- }), void 0);
1159
+ const modalContent = () => {
1160
+ switch (type) {
1161
+ case 'slideout':
1162
+ {
1163
+ return jsxs("aside", Object.assign({
1164
+ role: "dialog"
1165
+ }, {
1166
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1167
+ }));
1168
+ }
1169
+
1170
+ case 'takeover':
1171
+ {
1172
+ return jsxs("main", Object.assign({
1173
+ role: "dialog"
1174
+ }, {
1175
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1176
+ }));
1177
+ }
1178
+
1179
+ default:
1180
+ {
1181
+ return jsxs("section", Object.assign({
1182
+ role: "dialog"
1183
+ }, {
1184
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1185
+ }));
1186
+ }
1187
+ }
1188
+ };
1189
+
1190
+ return isOpen ? modalContent() : null;
1109
1191
  };
1110
1192
 
1111
- var DESCRIPTORS = descriptors;
1193
+ var objectDefineProperties = {};
1194
+
1195
+ var DESCRIPTORS$2 = descriptors;
1196
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1112
1197
  var definePropertyModule$1 = objectDefineProperty;
1113
1198
  var anObject$2 = anObject$5;
1114
1199
  var toIndexedObject$1 = toIndexedObject$5;
@@ -1116,8 +1201,8 @@ var objectKeys = objectKeys$2;
1116
1201
 
1117
1202
  // `Object.defineProperties` method
1118
1203
  // https://tc39.es/ecma262/#sec-object.defineproperties
1119
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1120
- var objectDefineProperties = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
1204
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1205
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1121
1206
  anObject$2(O);
1122
1207
  var props = toIndexedObject$1(Properties);
1123
1208
  var keys = objectKeys(Properties);
@@ -1135,7 +1220,7 @@ var html$1 = getBuiltIn('document', 'documentElement');
1135
1220
  /* global ActiveXObject -- old IE, WSH */
1136
1221
 
1137
1222
  var anObject$1 = anObject$5;
1138
- var defineProperties = objectDefineProperties;
1223
+ var definePropertiesModule = objectDefineProperties;
1139
1224
  var enumBugKeys = enumBugKeys$3;
1140
1225
  var hiddenKeys = hiddenKeys$4;
1141
1226
  var html = html$1;
@@ -1204,6 +1289,7 @@ hiddenKeys[IE_PROTO$1] = true;
1204
1289
 
1205
1290
  // `Object.create` method
1206
1291
  // https://tc39.es/ecma262/#sec-object.create
1292
+ // eslint-disable-next-line es-x/no-object-create -- safe
1207
1293
  var objectCreate = Object.create || function create(O, Properties) {
1208
1294
  var result;
1209
1295
  if (O !== null) {
@@ -1213,7 +1299,7 @@ var objectCreate = Object.create || function create(O, Properties) {
1213
1299
  // add "__proto__" for Object.getPrototypeOf polyfill
1214
1300
  result[IE_PROTO$1] = O;
1215
1301
  } else result = NullProtoObject();
1216
- return Properties === undefined ? result : defineProperties(result, Properties);
1302
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1217
1303
  };
1218
1304
 
1219
1305
  var wellKnownSymbol$6 = wellKnownSymbol$8;
@@ -1239,18 +1325,18 @@ var addToUnscopables$1 = function (key) {
1239
1325
 
1240
1326
  var iterators = {};
1241
1327
 
1242
- var fails$2 = fails$9;
1328
+ var fails$1 = fails$a;
1243
1329
 
1244
- var correctPrototypeGetter = !fails$2(function () {
1330
+ var correctPrototypeGetter = !fails$1(function () {
1245
1331
  function F() { /* empty */ }
1246
1332
  F.prototype.constructor = null;
1247
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1333
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
1248
1334
  return Object.getPrototypeOf(new F()) !== F.prototype;
1249
1335
  });
1250
1336
 
1251
1337
  var global$6 = global$r;
1252
- var hasOwn$1 = hasOwnProperty_1;
1253
- var isCallable$4 = isCallable$e;
1338
+ var hasOwn$2 = hasOwnProperty_1;
1339
+ var isCallable$5 = isCallable$f;
1254
1340
  var toObject = toObject$3;
1255
1341
  var sharedKey = sharedKey$3;
1256
1342
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
@@ -1263,27 +1349,27 @@ var ObjectPrototype = Object$2.prototype;
1263
1349
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1264
1350
  var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
1265
1351
  var object = toObject(O);
1266
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1352
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1267
1353
  var constructor = object.constructor;
1268
- if (isCallable$4(constructor) && object instanceof constructor) {
1354
+ if (isCallable$5(constructor) && object instanceof constructor) {
1269
1355
  return constructor.prototype;
1270
1356
  } return object instanceof Object$2 ? ObjectPrototype : null;
1271
1357
  };
1272
1358
 
1273
- var fails$1 = fails$9;
1274
- var isCallable$3 = isCallable$e;
1359
+ var fails = fails$a;
1360
+ var isCallable$4 = isCallable$f;
1275
1361
  var getPrototypeOf$1 = objectGetPrototypeOf;
1276
1362
  var redefine$1 = redefine$3.exports;
1277
1363
  var wellKnownSymbol$5 = wellKnownSymbol$8;
1278
1364
 
1279
- var ITERATOR$3 = wellKnownSymbol$5('iterator');
1365
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
1280
1366
  var BUGGY_SAFARI_ITERATORS$1 = false;
1281
1367
 
1282
1368
  // `%IteratorPrototype%` object
1283
1369
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1284
1370
  var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1285
1371
 
1286
- /* eslint-disable es/no-array-prototype-keys -- safe */
1372
+ /* eslint-disable es-x/no-array-prototype-keys -- safe */
1287
1373
  if ([].keys) {
1288
1374
  arrayIterator = [].keys();
1289
1375
  // Safari 8 has buggy iterators w/o `next`
@@ -1294,18 +1380,18 @@ if ([].keys) {
1294
1380
  }
1295
1381
  }
1296
1382
 
1297
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$1(function () {
1383
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
1298
1384
  var test = {};
1299
1385
  // FF44- legacy iterators case
1300
- return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
1386
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1301
1387
  });
1302
1388
 
1303
1389
  if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1304
1390
 
1305
1391
  // `%IteratorPrototype%[@@iterator]()` method
1306
1392
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1307
- if (!isCallable$3(IteratorPrototype$2[ITERATOR$3])) {
1308
- redefine$1(IteratorPrototype$2, ITERATOR$3, function () {
1393
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1394
+ redefine$1(IteratorPrototype$2, ITERATOR$2, function () {
1309
1395
  return this;
1310
1396
  });
1311
1397
  }
@@ -1315,15 +1401,16 @@ var iteratorsCore = {
1315
1401
  BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1316
1402
  };
1317
1403
 
1318
- var defineProperty = objectDefineProperty.f;
1319
- var hasOwn = hasOwnProperty_1;
1404
+ var defineProperty$2 = objectDefineProperty.f;
1405
+ var hasOwn$1 = hasOwnProperty_1;
1320
1406
  var wellKnownSymbol$4 = wellKnownSymbol$8;
1321
1407
 
1322
1408
  var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1323
1409
 
1324
- var setToStringTag$2 = function (it, TAG, STATIC) {
1325
- if (it && !hasOwn(it = STATIC ? it : it.prototype, TO_STRING_TAG$3)) {
1326
- defineProperty(it, TO_STRING_TAG$3, { configurable: true, value: TAG });
1410
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1411
+ if (target && !STATIC) target = target.prototype;
1412
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1413
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1327
1414
  }
1328
1415
  };
1329
1416
 
@@ -1335,42 +1422,42 @@ var Iterators$2 = iterators;
1335
1422
 
1336
1423
  var returnThis$1 = function () { return this; };
1337
1424
 
1338
- var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next) {
1425
+ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENUMERABLE_NEXT) {
1339
1426
  var TO_STRING_TAG = NAME + ' Iterator';
1340
- IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(1, next) });
1427
+ IteratorConstructor.prototype = create(IteratorPrototype$1, { next: createPropertyDescriptor(+!ENUMERABLE_NEXT, next) });
1341
1428
  setToStringTag$1(IteratorConstructor, TO_STRING_TAG, false);
1342
1429
  Iterators$2[TO_STRING_TAG] = returnThis$1;
1343
1430
  return IteratorConstructor;
1344
1431
  };
1345
1432
 
1346
1433
  var global$5 = global$r;
1347
- var isCallable$2 = isCallable$e;
1434
+ var isCallable$3 = isCallable$f;
1348
1435
 
1349
1436
  var String$2 = global$5.String;
1350
1437
  var TypeError$1 = global$5.TypeError;
1351
1438
 
1352
1439
  var aPossiblePrototype$1 = function (argument) {
1353
- if (typeof argument == 'object' || isCallable$2(argument)) return argument;
1440
+ if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1354
1441
  throw TypeError$1("Can't set " + String$2(argument) + ' as a prototype');
1355
1442
  };
1356
1443
 
1357
1444
  /* eslint-disable no-proto -- safe */
1358
1445
 
1359
- var uncurryThis$2 = functionUncurryThis;
1446
+ var uncurryThis$1 = functionUncurryThis;
1360
1447
  var anObject = anObject$5;
1361
1448
  var aPossiblePrototype = aPossiblePrototype$1;
1362
1449
 
1363
1450
  // `Object.setPrototypeOf` method
1364
1451
  // https://tc39.es/ecma262/#sec-object.setprototypeof
1365
1452
  // Works with __proto__ only. Old v8 can't work with null proto objects.
1366
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1453
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
1367
1454
  var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1368
1455
  var CORRECT_SETTER = false;
1369
1456
  var test = {};
1370
1457
  var setter;
1371
1458
  try {
1372
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1373
- setter = uncurryThis$2(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1459
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1460
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1374
1461
  setter(test, []);
1375
1462
  CORRECT_SETTER = test instanceof Array;
1376
1463
  } catch (error) { /* empty */ }
@@ -1386,7 +1473,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1386
1473
  var $$1 = _export;
1387
1474
  var call = functionCall;
1388
1475
  var FunctionName = functionName;
1389
- var isCallable$1 = isCallable$e;
1476
+ var isCallable$2 = isCallable$f;
1390
1477
  var createIteratorConstructor = createIteratorConstructor$1;
1391
1478
  var getPrototypeOf = objectGetPrototypeOf;
1392
1479
  var setPrototypeOf = objectSetPrototypeOf;
@@ -1401,7 +1488,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1401
1488
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1402
1489
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1403
1490
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1404
- var ITERATOR$2 = wellKnownSymbol$3('iterator');
1491
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
1405
1492
  var KEYS = 'keys';
1406
1493
  var VALUES = 'values';
1407
1494
  var ENTRIES = 'entries';
@@ -1424,7 +1511,7 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1424
1511
  var TO_STRING_TAG = NAME + ' Iterator';
1425
1512
  var INCORRECT_VALUES_NAME = false;
1426
1513
  var IterablePrototype = Iterable.prototype;
1427
- var nativeIterator = IterablePrototype[ITERATOR$2]
1514
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1428
1515
  || IterablePrototype['@@iterator']
1429
1516
  || DEFAULT && IterablePrototype[DEFAULT];
1430
1517
  var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
@@ -1438,8 +1525,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1438
1525
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1439
1526
  if (setPrototypeOf) {
1440
1527
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1441
- } else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$2])) {
1442
- redefine(CurrentIteratorPrototype, ITERATOR$2, returnThis);
1528
+ } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1529
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1443
1530
  }
1444
1531
  }
1445
1532
  // Set @@toStringTag to native iterators
@@ -1472,8 +1559,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1472
1559
  }
1473
1560
 
1474
1561
  // define iterator
1475
- if (IterablePrototype[ITERATOR$2] !== defaultIterator) {
1476
- redefine(IterablePrototype, ITERATOR$2, defaultIterator, { name: DEFAULT });
1562
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1563
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1477
1564
  }
1478
1565
  Iterators$1[NAME] = defaultIterator;
1479
1566
 
@@ -1484,7 +1571,9 @@ var toIndexedObject = toIndexedObject$5;
1484
1571
  var addToUnscopables = addToUnscopables$1;
1485
1572
  var Iterators = iterators;
1486
1573
  var InternalStateModule = internalState;
1574
+ var defineProperty$1 = objectDefineProperty.f;
1487
1575
  var defineIterator = defineIterator$1;
1576
+ var DESCRIPTORS$1 = descriptors;
1488
1577
 
1489
1578
  var ARRAY_ITERATOR = 'Array Iterator';
1490
1579
  var setInternalState = InternalStateModule.set;
@@ -1526,13 +1615,18 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
1526
1615
  // argumentsList[@@iterator] is %ArrayProto_values%
1527
1616
  // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1528
1617
  // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1529
- Iterators.Arguments = Iterators.Array;
1618
+ var values = Iterators.Arguments = Iterators.Array;
1530
1619
 
1531
1620
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1532
1621
  addToUnscopables('keys');
1533
1622
  addToUnscopables('values');
1534
1623
  addToUnscopables('entries');
1535
1624
 
1625
+ // V8 ~ Chrome 45- bug
1626
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1627
+ defineProperty$1(values, 'name', { value: 'values' });
1628
+ } catch (error) { /* empty */ }
1629
+
1536
1630
  // iterable DOM collections
1537
1631
  // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1538
1632
  var domIterables = {
@@ -1584,17 +1678,17 @@ var ArrayIteratorMethods = es_array_iterator;
1584
1678
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
1585
1679
  var wellKnownSymbol$2 = wellKnownSymbol$8;
1586
1680
 
1587
- var ITERATOR$1 = wellKnownSymbol$2('iterator');
1681
+ var ITERATOR = wellKnownSymbol$2('iterator');
1588
1682
  var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1589
1683
  var ArrayValues = ArrayIteratorMethods.values;
1590
1684
 
1591
1685
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1592
1686
  if (CollectionPrototype) {
1593
1687
  // some Chrome versions have non-configurable methods on DOMTokenList
1594
- if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
1595
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$1, ArrayValues);
1688
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1689
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1596
1690
  } catch (error) {
1597
- CollectionPrototype[ITERATOR$1] = ArrayValues;
1691
+ CollectionPrototype[ITERATOR] = ArrayValues;
1598
1692
  }
1599
1693
  if (!CollectionPrototype[TO_STRING_TAG$2]) {
1600
1694
  createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
@@ -1616,71 +1710,65 @@ for (var COLLECTION_NAME in DOMIterables) {
1616
1710
 
1617
1711
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1618
1712
 
1619
- const Flexbox = ({
1620
- alignContent,
1621
- alignItems,
1622
- alignSelf,
1623
- children,
1624
- justifyContent
1625
- }) => {
1713
+ const Flexbox = _a => {
1714
+ var {
1715
+ alignContent,
1716
+ alignItems,
1717
+ alignSelf,
1718
+ children,
1719
+ justifyContent,
1720
+ flexDirection,
1721
+ flexWrap,
1722
+ className
1723
+ } = _a,
1724
+ props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
1725
+
1626
1726
  const [classes, setClasses] = useState(['d-flex']);
1627
- const [className, setClassName] = useState('d-flex'); // update className when classes change
1727
+ const [flexClassName, setFlexClassName] = useState('d-flex'); // // update className when classes change
1628
1728
 
1629
- useEffect(() => {
1729
+ useLayoutEffect(() => {
1630
1730
  const newClassName = classes.join(' ');
1631
- if (newClassName !== className) setClassName(newClassName);
1632
- }, [classes, className]); // update classes when props change
1731
+ if (newClassName !== flexClassName) setFlexClassName(newClassName);
1732
+ }, [classes, flexClassName]); // // update classes when props change
1633
1733
 
1634
- useEffect(() => {
1734
+ useLayoutEffect(() => {
1635
1735
  const newClasses = ['d-flex'];
1636
- if (alignItems) newClasses.push(`align-items-${alignItems}`);
1637
- if (alignContent) newClasses.push(`align-content-${alignContent}`);
1638
- if (alignSelf) newClasses.push(`align-content-${alignSelf}`);
1639
- if (justifyContent) newClasses.push(`justify-content-${justifyContent}`);
1736
+ alignItems && newClasses.push(`align-items-${alignItems}`);
1737
+ alignContent && newClasses.push(`align-content-${alignContent}`);
1738
+ alignSelf && newClasses.push(`align-self-${alignSelf}`);
1739
+ justifyContent && newClasses.push(`justify-content-${justifyContent}`);
1740
+ flexDirection && newClasses.push(`flex-${flexDirection}`);
1741
+ flexWrap && newClasses.push(`flex-${flexWrap}`);
1742
+ className && newClasses.push(className);
1640
1743
  setClasses(newClasses);
1641
- }, [alignContent, alignItems, alignSelf, justifyContent]);
1744
+ }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
1642
1745
  return jsx("div", Object.assign({
1643
- className: className
1644
- }, {
1746
+ className: flexClassName
1747
+ }, props, {
1645
1748
  children: children
1646
- }), void 0);
1749
+ }));
1647
1750
  };
1648
1751
 
1649
- function Group({
1650
- children
1651
- }) {
1652
- return jsx("div", Object.assign({
1653
- className: "group"
1654
- }, {
1655
- children: children
1656
- }), void 0);
1657
- }
1658
-
1659
1752
  function Card({
1660
1753
  children,
1661
- headline,
1662
- buttons
1754
+ header,
1755
+ footer
1663
1756
  }) {
1664
- return jsx("section", Object.assign({
1757
+ return jsxs("section", Object.assign({
1665
1758
  className: "card"
1666
1759
  }, {
1667
- children: jsxs("div", Object.assign({
1668
- className: "card-body"
1669
- }, {
1670
- children: [headline && jsx("h2", {
1671
- children: headline
1672
- }, void 0), jsx("p", {
1673
- children: children
1674
- }, void 0), buttons && jsx("footer", {
1675
- children: buttons
1676
- }, void 0)]
1677
- }), void 0)
1678
- }), void 0);
1760
+ children: [jsx("header", {
1761
+ children: header
1762
+ }), children, jsx("footer", {
1763
+ children: footer
1764
+ })]
1765
+ }));
1679
1766
  }
1680
1767
 
1681
1768
  function Alert({
1682
1769
  type,
1683
- heading,
1770
+ header,
1771
+ footer,
1684
1772
  children,
1685
1773
  closeText,
1686
1774
  isCloseable = true
@@ -1690,23 +1778,33 @@ function Alert({
1690
1778
  if (!isCloseable) {
1691
1779
  setCloseButton(null);
1692
1780
  } else {
1693
- if (closeText) setCloseButton(jsx(Button, {
1694
- children: closeText
1695
- }, void 0));else setCloseButton(jsx("button", {
1781
+ if (closeText) setCloseButton(jsx(Button, Object.assign({
1782
+ variant: "ghost"
1783
+ }, {
1784
+ children: jsx("span", Object.assign({
1785
+ className: "sr-only"
1786
+ }, {
1787
+ children: closeText
1788
+ }))
1789
+ })));else setCloseButton(jsx("button", {
1696
1790
  className: "close"
1697
- }, void 0));
1791
+ }));
1698
1792
  }
1699
1793
  }, [isCloseable, closeText]);
1700
1794
  return jsxs("div", Object.assign({
1701
1795
  role: "alert",
1702
1796
  className: type
1703
1797
  }, {
1704
- children: [heading && jsx("h3", {
1705
- children: heading
1706
- }, void 0), jsx("p", {
1798
+ children: [header && jsxs("header", {
1799
+ children: [/*#__PURE__*/React.isValidElement(header) ? header : jsx("h3", {
1800
+ children: header
1801
+ }), closeButton]
1802
+ }), jsx("p", {
1707
1803
  children: children
1708
- }, void 0), closeButton]
1709
- }), void 0);
1804
+ }), footer && jsx("footer", {
1805
+ children: footer
1806
+ })]
1807
+ }));
1710
1808
  }
1711
1809
 
1712
1810
  const ButtonGroup = ({
@@ -1734,149 +1832,220 @@ const ButtonGroup = ({
1734
1832
  }, [children, selected, variant]);
1735
1833
  return jsx(Group, {
1736
1834
  children: buttons.map(props => jsx(Button, Object.assign({}, props), props.key))
1737
- }, void 0);
1835
+ });
1738
1836
  };
1739
1837
 
1740
- function Form({
1741
- children,
1742
- direction = 'vertical',
1743
- size = 'md'
1744
- }) {
1745
- return jsx("form", Object.assign({
1746
- className: [direction, `size-${size}`].join(' ')
1747
- }, {
1748
- children: children
1749
- }), void 0);
1750
- }
1751
-
1752
- var wellKnownSymbol$1 = wellKnownSymbol$8;
1753
-
1754
- var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1755
- var test = {};
1756
-
1757
- test[TO_STRING_TAG$1] = 'z';
1758
-
1759
- var toStringTagSupport = String(test) === '[object z]';
1838
+ const validateInputValue = (target, rules, setError) => {
1839
+ const errorMessage = validateInputValueErrors(rules, target);
1840
+ errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
1841
+ return errorMessage;
1842
+ };
1760
1843
 
1761
- var global$3 = global$r;
1762
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1763
- var isCallable = isCallable$e;
1764
- var classofRaw = classofRaw$1;
1765
- var wellKnownSymbol = wellKnownSymbol$8;
1844
+ const validateInputValueErrors = (rules, target) => {
1845
+ const {
1846
+ value
1847
+ } = target;
1766
1848
 
1767
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1768
- var Object$1 = global$3.Object;
1849
+ if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
1850
+ return rules === null || rules === void 0 ? void 0 : rules.custom();
1851
+ }
1769
1852
 
1770
- // ES3 wrong here
1771
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1853
+ return validateTextInputValues(value, rules);
1854
+ };
1772
1855
 
1773
- // fallback for IE11 Script Access Denied error
1774
- var tryGet = function (it, key) {
1775
- try {
1776
- return it[key];
1777
- } catch (error) { /* empty */ }
1856
+ const setErrorInsert = (setError, name) => {
1857
+ setError(errors => {
1858
+ return Object.assign(Object.assign({}, errors), {
1859
+ [name]: true
1860
+ });
1861
+ });
1778
1862
  };
1779
1863
 
1780
- // getting tag from ES6+ `Object.prototype.toString`
1781
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1782
- var O, tag, result;
1783
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1784
- // @@toStringTag case
1785
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1786
- // builtinTag case
1787
- : CORRECT_ARGUMENTS ? classofRaw(O)
1788
- // ES3 arguments fallback
1789
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1864
+ const setErrorRemove = (setError, name) => {
1865
+ setError(errors => {
1866
+ const newError = Object.assign({}, errors);
1867
+ delete newError[name];
1868
+ return newError;
1869
+ });
1790
1870
  };
1791
1871
 
1792
- var global$2 = global$r;
1793
- var classof = classof$1;
1872
+ const validateTextInputValues = (value, rules) => {
1873
+ switch (rules === null || rules === void 0 ? void 0 : rules.type) {
1874
+ case 'Required':
1875
+ {
1876
+ return value === '' || value === undefined || value === null ? 'error' : null;
1877
+ }
1794
1878
 
1795
- var String$1 = global$2.String;
1879
+ default:
1880
+ {
1881
+ return;
1882
+ }
1883
+ }
1884
+ };
1796
1885
 
1797
- var toString$2 = function (argument) {
1798
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1799
- return String$1(argument);
1886
+ const FormContext = /*#__PURE__*/React.createContext({});
1887
+ const useFormContext = () => {
1888
+ return React.useContext(FormContext);
1800
1889
  };
1890
+ const FormProvider = _a => {
1891
+ var {
1892
+ children,
1893
+ direction = 'vertical',
1894
+ formSize = 'md',
1895
+ onSubmit,
1896
+ onFormSubmit
1897
+ } = _a,
1898
+ props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
1899
+
1900
+ const [values, setValues] = React.useState();
1901
+ const [errors, setErrors] = React.useState();
1902
+ const [fields, setFields] = React.useState({});
1903
+
1904
+ const formSubmit = event => {
1905
+ let hasError = false;
1906
+ event.preventDefault();
1907
+ Object.keys(fields).forEach(key => {
1908
+ const errorMessage = validateInputValue({
1909
+ name: key,
1910
+ value: values === null || values === void 0 ? void 0 : values[key]
1911
+ }, fields[key], setErrors);
1912
+ hasError = hasError || !!errorMessage;
1913
+ });
1801
1914
 
1802
- // a string of all valid unicode whitespaces
1803
- var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1804
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1915
+ if (!hasError) {
1916
+ onFormSubmit && onFormSubmit(values);
1917
+ }
1918
+ };
1805
1919
 
1806
- var uncurryThis$1 = functionUncurryThis;
1807
- var requireObjectCoercible = requireObjectCoercible$3;
1808
- var toString$1 = toString$2;
1809
- var whitespaces$1 = whitespaces$2;
1810
-
1811
- var replace = uncurryThis$1(''.replace);
1812
- var whitespace = '[' + whitespaces$1 + ']';
1813
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1814
- var rtrim = RegExp(whitespace + whitespace + '*$');
1815
-
1816
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1817
- var createMethod = function (TYPE) {
1818
- return function ($this) {
1819
- var string = toString$1(requireObjectCoercible($this));
1820
- if (TYPE & 1) string = replace(string, ltrim, '');
1821
- if (TYPE & 2) string = replace(string, rtrim, '');
1822
- return string;
1920
+ const resetForm = () => {
1921
+ setValues({});
1922
+ setErrors({});
1823
1923
  };
1924
+
1925
+ return jsx(FormContext.Provider, Object.assign({
1926
+ value: {
1927
+ setValues,
1928
+ setErrors,
1929
+ setFields,
1930
+ errors,
1931
+ values
1932
+ }
1933
+ }, {
1934
+ children: jsx("form", Object.assign({
1935
+ className: [direction, `size-${formSize}`].join(' '),
1936
+ onSubmit: formSubmit
1937
+ }, props, {
1938
+ onReset: resetForm
1939
+ }, {
1940
+ children: children
1941
+ }))
1942
+ }));
1824
1943
  };
1825
1944
 
1826
- var stringTrim = {
1827
- // `String.prototype.{ trimLeft, trimStart }` methods
1828
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1829
- start: createMethod(1),
1830
- // `String.prototype.{ trimRight, trimEnd }` methods
1831
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
1832
- end: createMethod(2),
1833
- // `String.prototype.trim` method
1834
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1835
- trim: createMethod(3)
1945
+ const Form = props => {
1946
+ return jsx(FormProvider, Object.assign({}, props));
1836
1947
  };
1837
1948
 
1838
- var global$1 = global$r;
1839
- var fails = fails$9;
1840
- var uncurryThis = functionUncurryThis;
1841
- var toString = toString$2;
1842
- var trim = stringTrim.trim;
1843
- var whitespaces = whitespaces$2;
1844
-
1845
- var $parseInt$1 = global$1.parseInt;
1846
- var Symbol$1 = global$1.Symbol;
1847
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
1848
- var hex = /^[+-]?0x/i;
1849
- var exec = uncurryThis(hex.exec);
1850
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
1851
- // MS Edge 18- broken with boxed symbols
1852
- || (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
1853
-
1854
- // `parseInt` method
1855
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1856
- var numberParseInt = FORCED ? function parseInt(string, radix) {
1857
- var S = trim(toString(string));
1858
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
1859
- } : $parseInt$1;
1949
+ const FormItems = ({
1950
+ children,
1951
+ validate,
1952
+ name
1953
+ }) => {
1954
+ const {
1955
+ setValues,
1956
+ setErrors,
1957
+ setFields,
1958
+ errors
1959
+ } = useFormContext();
1960
+ React.useEffect(() => {
1961
+ setFields(fields => Object.assign(Object.assign({}, fields), {
1962
+ [name]: validate === null || validate === void 0 ? void 0 : validate.rules
1963
+ }));
1964
+
1965
+ const removeValues = values => {
1966
+ const newValues = Object.assign({}, values);
1967
+ delete newValues[name];
1968
+ return newValues;
1969
+ };
1860
1970
 
1861
- var $ = _export;
1862
- var $parseInt = numberParseInt;
1971
+ return () => {
1972
+ setFields(fields => removeValues(fields));
1973
+ setValues(values => removeValues(values));
1974
+ setErrors(errors => removeValues(errors));
1975
+ };
1976
+ }, []);
1863
1977
 
1864
- // `parseInt` method
1865
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1866
- $({ global: true, forced: parseInt != $parseInt }, {
1867
- parseInt: $parseInt
1868
- });
1978
+ const onChange = event => {
1979
+ if (!event.target) return;
1980
+ const {
1981
+ value,
1982
+ name,
1983
+ type,
1984
+ checked
1985
+ } = event.target;
1986
+ let inputValue;
1987
+
1988
+ if (type === 'checkbox') {
1989
+ inputValue = checked ? value : null;
1990
+ checked ? setValues(values => Object.assign(Object.assign({}, values), {
1991
+ [name]: value
1992
+ })) : setValues(values => Object.assign(Object.assign({}, values), {
1993
+ [name]: null
1994
+ }));
1995
+ } else {
1996
+ inputValue = value;
1997
+ setValues(values => Object.assign(Object.assign({}, values), {
1998
+ [name]: value
1999
+ }));
2000
+ }
1869
2001
 
1870
- const useInput = (props, evaluator, notify) => {
2002
+ validateInputValue({
2003
+ value: inputValue,
2004
+ name,
2005
+ type,
2006
+ checked
2007
+ }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
2008
+ };
2009
+
2010
+ return /*#__PURE__*/React.cloneElement(children, {
2011
+ validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
2012
+ name,
2013
+ onChange
2014
+ });
2015
+ };
2016
+
2017
+ function Group({
2018
+ children,
2019
+ error,
2020
+ groupBorder = false
2021
+ }) {
2022
+ const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
2023
+ const errorMessage = error ? error.message || error : '';
2024
+ return jsxs("div", Object.assign({
2025
+ className: "form-group"
2026
+ }, {
2027
+ children: [jsx("div", Object.assign({
2028
+ className: groupClassName
2029
+ }, {
2030
+ children: children
2031
+ })), error && jsx("span", Object.assign({
2032
+ className: "form-info"
2033
+ }, {
2034
+ children: errorMessage
2035
+ }))]
2036
+ }));
2037
+ }
2038
+
2039
+ const useInput = (props, onChanges, onChangeInput) => {
1871
2040
  const id = useMemo(() => props.id || randomId(), [props.id]);
1872
2041
  const ref = useRef(null);
1873
- const [value, setValue] = useState(props.value);
1874
- const [checked, setChecked] = useState(props.checked);
2042
+ const [value, setValue] = useState(props.value ? props.value : '');
2043
+ const [checked, setChecked] = useState(props.checked ? props.checked : false);
1875
2044
  useEffect(() => {
1876
2045
  if (ref.current && ref.current.form) {
1877
2046
  const resetListener = () => {
1878
- setValue(props.value);
1879
- setChecked(props.checked);
2047
+ setValue(props.value ? props.value : '');
2048
+ setChecked(props.checked ? props.checked : false);
1880
2049
  };
1881
2050
 
1882
2051
  const form = ref.current.form;
@@ -1890,8 +2059,9 @@ const useInput = (props, evaluator, notify) => {
1890
2059
 
1891
2060
  const onChange = event => {
1892
2061
  setValue(event.target.value);
1893
- setChecked(event.target.checked);
1894
- if (notify) notify(evaluator(event.target));
2062
+ setChecked(event.currentTarget.checked);
2063
+ onChanges && onChanges(event);
2064
+ onChangeInput && onChangeInput(event.target.value);
1895
2065
  };
1896
2066
 
1897
2067
  return Object.assign(Object.assign({}, props), {
@@ -1903,8 +2073,8 @@ const useInput = (props, evaluator, notify) => {
1903
2073
  });
1904
2074
  };
1905
2075
 
1906
- const RenderInput = (type, props, evaluator, label, info, listener) => {
1907
- const _a = useInput(props, evaluator, listener),
2076
+ const RenderInput = (type, props, onChange, onChangeInput, label, info, validator) => {
2077
+ const _a = useInput(props, onChange, onChangeInput),
1908
2078
  {
1909
2079
  value
1910
2080
  } = _a,
@@ -1912,72 +2082,840 @@ const RenderInput = (type, props, evaluator, label, info, listener) => {
1912
2082
 
1913
2083
  const propsWithDescription = info ? Object.assign(Object.assign({}, inputProps), {
1914
2084
  'aria-describedby': `${inputProps.id}_info`
1915
- }) : inputProps;
2085
+ }) : inputProps; // Render naked
2086
+
2087
+ if (!label && !info) return jsx("input", Object.assign({
2088
+ type: type,
2089
+ value: value
2090
+ }, propsWithDescription));
1916
2091
  return jsxs("div", Object.assign({
1917
- className: "form-field"
2092
+ className: "form-group"
1918
2093
  }, {
1919
2094
  children: [label && jsx("label", Object.assign({
1920
2095
  htmlFor: inputProps.id
1921
2096
  }, {
1922
2097
  children: label
1923
- }), void 0), info && jsx("span", Object.assign({
2098
+ })), info && jsx("span", Object.assign({
1924
2099
  className: "form-info",
1925
- id: "{inputProps.id}_info"
2100
+ id: `${inputProps.id}_info`
1926
2101
  }, {
1927
2102
  children: info
1928
- }), void 0), jsx("input", Object.assign({
2103
+ })), jsx("input", Object.assign({
1929
2104
  type: type,
1930
2105
  value: value
1931
- }, propsWithDescription), void 0)]
1932
- }), void 0);
2106
+ }, propsWithDescription, {
2107
+ className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
2108
+ })), validator && jsx("span", Object.assign({
2109
+ className: "form-info"
2110
+ }, {
2111
+ children: validator.message
2112
+ }))]
2113
+ }));
1933
2114
  };
1934
-
1935
2115
  const TextInput = _a => {
1936
2116
  var {
1937
2117
  label,
1938
2118
  info,
1939
- onChangeText
2119
+ onChange,
2120
+ onChangeInput,
2121
+ validator
1940
2122
  } = _a,
1941
- props = __rest(_a, ["label", "info", "onChangeText"]);
2123
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1942
2124
 
1943
- return RenderInput('text', props, e => e.value, label, info, onChangeText);
2125
+ return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
1944
2126
  };
1945
2127
  const EmailInput = _a => {
1946
2128
  var {
1947
2129
  label,
1948
2130
  info,
1949
- onChangeText
2131
+ onChange,
2132
+ onChangeInput,
2133
+ validator
1950
2134
  } = _a,
1951
- props = __rest(_a, ["label", "info", "onChangeText"]);
2135
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1952
2136
 
1953
- return RenderInput('email', props, e => e.value, label, info, onChangeText);
2137
+ return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
1954
2138
  };
1955
2139
  const NumberInput = _a => {
1956
2140
  var {
1957
2141
  label,
1958
2142
  info,
1959
- onChangeText
2143
+ onChange,
2144
+ onChangeInput,
2145
+ validator
1960
2146
  } = _a,
1961
- props = __rest(_a, ["label", "info", "onChangeText"]);
2147
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1962
2148
 
1963
- return RenderInput('number', props, e => e.value.length ? parseInt(e.value, 10) : undefined, label, info, onChangeText);
2149
+ return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
1964
2150
  };
1965
2151
  const Checkbox = _a => {
1966
2152
  var {
1967
2153
  label,
1968
- onChecked
2154
+ onChange,
2155
+ validator
2156
+ } = _a,
2157
+ props = __rest(_a, ["label", "onChange", "validator"]);
2158
+
2159
+ const inputProps = useInput(props, onChange);
2160
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2161
+ return jsxs(Fragment, {
2162
+ children: [jsxs("label", Object.assign({
2163
+ htmlFor: inputProps.id,
2164
+ className: `form-control ${validatorClassName}`
2165
+ }, {
2166
+ children: [label, jsx("input", Object.assign({
2167
+ type: "checkbox"
2168
+ }, inputProps)), jsx("span", {}), jsx("i", {})]
2169
+ })), validator && jsx("span", Object.assign({
2170
+ className: "form-info"
2171
+ }, {
2172
+ children: validator.message
2173
+ }))]
2174
+ });
2175
+ };
2176
+ const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
2177
+ var {
2178
+ label,
2179
+ validator
1969
2180
  } = _a,
1970
- props = __rest(_a, ["label", "onChecked"]);
2181
+ props = __rest(_a, ["label", "validator"]);
1971
2182
 
1972
- const inputProps = useInput(props, e => e.checked, onChecked);
2183
+ const {
2184
+ id
2185
+ } = useInput(props);
1973
2186
  return jsxs("label", Object.assign({
1974
- htmlFor: inputProps.id,
2187
+ htmlFor: id,
1975
2188
  className: "form-control"
1976
2189
  }, {
1977
- children: [label, jsx("input", Object.assign({
1978
- type: "checkbox"
1979
- }, inputProps), void 0), jsx("span", {}, void 0)]
1980
- }), void 0);
2190
+ children: [jsx("input", Object.assign({
2191
+ id: id,
2192
+ type: "radio"
2193
+ }, props, {
2194
+ className: validator,
2195
+ ref: ref
2196
+ })), jsx("span", {
2197
+ children: label
2198
+ }), jsx("i", {})]
2199
+ }));
2200
+ });
2201
+
2202
+ const Text = ({
2203
+ children
2204
+ }) => jsx("span", Object.assign({
2205
+ className: "form-text"
2206
+ }, {
2207
+ children: children
2208
+ }));
2209
+
2210
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
2211
+
2212
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
2213
+ var test = {};
2214
+
2215
+ test[TO_STRING_TAG$1] = 'z';
2216
+
2217
+ var toStringTagSupport = String(test) === '[object z]';
2218
+
2219
+ var global$3 = global$r;
2220
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2221
+ var isCallable$1 = isCallable$f;
2222
+ var classofRaw = classofRaw$1;
2223
+ var wellKnownSymbol = wellKnownSymbol$8;
2224
+
2225
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2226
+ var Object$1 = global$3.Object;
2227
+
2228
+ // ES3 wrong here
2229
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2230
+
2231
+ // fallback for IE11 Script Access Denied error
2232
+ var tryGet = function (it, key) {
2233
+ try {
2234
+ return it[key];
2235
+ } catch (error) { /* empty */ }
2236
+ };
2237
+
2238
+ // getting tag from ES6+ `Object.prototype.toString`
2239
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2240
+ var O, tag, result;
2241
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
2242
+ // @@toStringTag case
2243
+ : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
2244
+ // builtinTag case
2245
+ : CORRECT_ARGUMENTS ? classofRaw(O)
2246
+ // ES3 arguments fallback
2247
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
2248
+ };
2249
+
2250
+ var global$2 = global$r;
2251
+ var classof = classof$1;
2252
+
2253
+ var String$1 = global$2.String;
2254
+
2255
+ var toString$1 = function (argument) {
2256
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2257
+ return String$1(argument);
2258
+ };
2259
+
2260
+ var $ = _export;
2261
+ var DESCRIPTORS = descriptors;
2262
+ var global$1 = global$r;
2263
+ var uncurryThis = functionUncurryThis;
2264
+ var hasOwn = hasOwnProperty_1;
2265
+ var isCallable = isCallable$f;
2266
+ var isPrototypeOf = objectIsPrototypeOf;
2267
+ var toString = toString$1;
2268
+ var defineProperty = objectDefineProperty.f;
2269
+ var copyConstructorProperties = copyConstructorProperties$2;
2270
+
2271
+ var NativeSymbol = global$1.Symbol;
2272
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
2273
+
2274
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
2275
+ // Safari 12 bug
2276
+ NativeSymbol().description !== undefined
2277
+ )) {
2278
+ var EmptyStringDescriptionStore = {};
2279
+ // wrap Symbol constructor for correct work with undefined description
2280
+ var SymbolWrapper = function Symbol() {
2281
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
2282
+ var result = isPrototypeOf(SymbolPrototype, this)
2283
+ ? new NativeSymbol(description)
2284
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
2285
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
2286
+ if (description === '') EmptyStringDescriptionStore[result] = true;
2287
+ return result;
2288
+ };
2289
+
2290
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
2291
+ SymbolWrapper.prototype = SymbolPrototype;
2292
+ SymbolPrototype.constructor = SymbolWrapper;
2293
+
2294
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
2295
+ var symbolToString = uncurryThis(SymbolPrototype.toString);
2296
+ var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
2297
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
2298
+ var replace = uncurryThis(''.replace);
2299
+ var stringSlice = uncurryThis(''.slice);
2300
+
2301
+ defineProperty(SymbolPrototype, 'description', {
2302
+ configurable: true,
2303
+ get: function description() {
2304
+ var symbol = symbolValueOf(this);
2305
+ var string = symbolToString(symbol);
2306
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
2307
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
2308
+ return desc === '' ? undefined : desc;
2309
+ }
2310
+ });
2311
+
2312
+ $({ global: true, forced: true }, {
2313
+ Symbol: SymbolWrapper
2314
+ });
2315
+ }
2316
+
2317
+ const RadioGroup = ({
2318
+ defaultSelected,
2319
+ description,
2320
+ title,
2321
+ validator,
2322
+ onChangeRadio,
2323
+ onChange,
2324
+ name,
2325
+ children
2326
+ }) => {
2327
+ const [checked, setChecked] = React.useState();
2328
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2329
+
2330
+ const onChanges = event => {
2331
+ setChecked(event.target.value);
2332
+ onChangeRadio && onChangeRadio(event.target.value);
2333
+ onChange && onChange(event);
2334
+ };
2335
+
2336
+ const radioBtnRef = React.useRef(null);
2337
+ React.useEffect(() => {
2338
+ var _a;
2339
+
2340
+ if (radioBtnRef && radioBtnRef.current) {
2341
+ if (defaultSelected) setChecked(defaultSelected);
2342
+ const form = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
2343
+
2344
+ const resetListner = () => {
2345
+ setChecked(undefined);
2346
+ };
2347
+
2348
+ form === null || form === void 0 ? void 0 : form.addEventListener('reset', resetListner);
2349
+ return () => form === null || form === void 0 ? void 0 : form.removeEventListener('reset', resetListner);
2350
+ } else {
2351
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2352
+ return () => {};
2353
+ }
2354
+ }, []);
2355
+ return jsxs("div", Object.assign({
2356
+ className: "form-group"
2357
+ }, {
2358
+ children: [jsxs("fieldset", Object.assign({
2359
+ className: validatorClassName
2360
+ }, {
2361
+ children: [jsx("legend", {
2362
+ children: title
2363
+ }), jsx("span", Object.assign({
2364
+ className: "form-info"
2365
+ }, {
2366
+ children: description
2367
+ })), React.Children.map(children, Child => {
2368
+ return /*#__PURE__*/React.isValidElement(Child) ? /*#__PURE__*/React.cloneElement(Child, {
2369
+ validator: validatorClassName,
2370
+ onChange: onChanges,
2371
+ checked: checked === Child.props.value,
2372
+ name,
2373
+ ref: radioBtnRef
2374
+ }) : Child;
2375
+ })]
2376
+ })), (validator === null || validator === void 0 ? void 0 : validator.message) && jsx("span", Object.assign({
2377
+ className: "form-info"
2378
+ }, {
2379
+ children: validator === null || validator === void 0 ? void 0 : validator.message
2380
+ }))]
2381
+ }));
2382
+ };
2383
+
2384
+ const ListItem = _a => {
2385
+ var {
2386
+ listType,
2387
+ tableRowData,
2388
+ children
2389
+ } = _a,
2390
+ props = __rest(_a, ["listType", "tableRowData", "children"]);
2391
+
2392
+ if (listType === 'table') {
2393
+ return jsx("dl", {
2394
+ children: jsxs("div", {
2395
+ children: [jsx("dt", {
2396
+ children: tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.title
2397
+ }), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map((item, index) => jsx("dd", {
2398
+ children: item
2399
+ }, index))]
2400
+ })
2401
+ });
2402
+ } else {
2403
+ return jsx("li", Object.assign({}, props, {
2404
+ children: children
2405
+ }));
2406
+ }
2407
+ };
2408
+
2409
+ const List = _a => {
2410
+ var {
2411
+ listType,
2412
+ tableCaption,
2413
+ tableData,
2414
+ children
2415
+ } = _a,
2416
+ props = __rest(_a, ["listType", "tableCaption", "tableData", "children"]);
2417
+
2418
+ if (listType === 'ordered') {
2419
+ return jsx("ol", Object.assign({}, props, {
2420
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
2421
+ children: child
2422
+ }, index))
2423
+ }));
2424
+ } else if (listType !== 'table') {
2425
+ return jsx("ul", Object.assign({}, props, {
2426
+ className: listType
2427
+ }, {
2428
+ children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
2429
+ children: child
2430
+ }, index))
2431
+ }));
2432
+ } else {
2433
+ return jsxs("figure", {
2434
+ children: [jsx("figcaption", Object.assign({
2435
+ className: "table-list-caption"
2436
+ }, {
2437
+ children: tableCaption
2438
+ })), jsx("dl", {
2439
+ children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsx(ListItem, {
2440
+ listType: listType,
2441
+ tableRowData: data
2442
+ }, index))
2443
+ })]
2444
+ });
2445
+ }
2446
+ };
2447
+
2448
+ const Link = _a => {
2449
+ var {
2450
+ button,
2451
+ children
2452
+ } = _a,
2453
+ props = __rest(_a, ["button", "children"]);
2454
+
2455
+ const [anchorProps, setAnchorProps] = useState({});
2456
+ useEffect(() => {
2457
+ const className = button ? typeof button === 'string' ? `button ${button}` : 'button' : undefined;
2458
+ const newProps = Object.assign({
2459
+ role: button ? 'button' : undefined,
2460
+ className: className
2461
+ }, props);
2462
+ setAnchorProps(newProps);
2463
+ }, [button]);
2464
+ return jsx("a", Object.assign({}, anchorProps, {
2465
+ children: children
2466
+ }));
2467
+ };
2468
+
2469
+ const Navbar = ({
2470
+ children,
2471
+ variant,
2472
+ title,
2473
+ titleLink,
2474
+ brandLink: _brandLink = 'https://www.seb.se',
2475
+ brandAriaLabel: _brandAriaLabel = 'Open seb.se in new tab'
2476
+ }) => {
2477
+ const [props, setProps] = useState({});
2478
+ useEffect(() => {
2479
+ const classNames = [];
2480
+ if (variant) classNames.push(variant);
2481
+ setProps(Object.assign(Object.assign({}, props), {
2482
+ className: classNames.join(' ')
2483
+ })); // eslint-disable-next-line react-hooks/exhaustive-deps
2484
+ }, [variant]);
2485
+ return jsxs("nav", Object.assign({
2486
+ role: "navigation"
2487
+ }, props, {
2488
+ children: [jsx(Link, {
2489
+ "aria-label": _brandAriaLabel,
2490
+ href: _brandLink,
2491
+ target: "_blank",
2492
+ className: "brand"
2493
+ }), jsx("div", Object.assign({
2494
+ className: "container-fluid"
2495
+ }, {
2496
+ children: jsxs("div", Object.assign({
2497
+ className: "row justify-content-between align-items-center"
2498
+ }, {
2499
+ children: [jsx("div", Object.assign({
2500
+ className: "col-auto"
2501
+ }, {
2502
+ children: titleLink ? jsx(Link, Object.assign({
2503
+ className: "mx-4",
2504
+ href: titleLink
2505
+ }, {
2506
+ children: jsx("h1", {
2507
+ children: title
2508
+ })
2509
+ })) : jsx("h1", {
2510
+ children: title
2511
+ })
2512
+ })), jsx("div", Object.assign({
2513
+ className: "col-auto"
2514
+ }, {
2515
+ children: jsx("div", Object.assign({
2516
+ className: "group size-sm"
2517
+ }, {
2518
+ children: children
2519
+ }))
2520
+ }))]
2521
+ }))
2522
+ }))]
2523
+ }));
2524
+ };
2525
+
2526
+ function Badge(_a) {
2527
+ var {
2528
+ children,
2529
+ badgeType,
2530
+ isCloseable,
2531
+ closeText,
2532
+ customColor,
2533
+ customBackgroundColor
2534
+ } = _a,
2535
+ props = __rest(_a, ["children", "badgeType", "isCloseable", "closeText", "customColor", "customBackgroundColor"]);
2536
+
2537
+ const [isClosed, setIsClosed] = React.useState(false);
2538
+ const [type, setType] = React.useState('');
2539
+ React.useEffect(() => {
2540
+ if (badgeType) {
2541
+ setType(badgeType);
2542
+ }
2543
+
2544
+ if (!!customColor || !!customBackgroundColor) {
2545
+ setType('');
2546
+ }
2547
+ }, []);
2548
+ return !isClosed ? jsxs("span", Object.assign({}, props, {
2549
+ className: `badge ${type}`,
2550
+ style: {
2551
+ color: customColor,
2552
+ backgroundColor: customBackgroundColor
2553
+ }
2554
+ }, {
2555
+ children: [jsx("strong", {
2556
+ children: children
2557
+ }), isCloseable && jsx("button", Object.assign({
2558
+ type: "button",
2559
+ className: "close",
2560
+ onClick: () => setIsClosed(true)
2561
+ }, {
2562
+ children: closeText
2563
+ }))]
2564
+ })) : null;
2565
+ }
2566
+
2567
+ const noop = () => {};
2568
+
2569
+ const useStepper = ({
2570
+ min,
2571
+ max,
2572
+ value: _value = 0,
2573
+ step: _step = 1,
2574
+ id: _id = randomId()
2575
+ }) => {
2576
+ const pStepper = {
2577
+ down: noop,
2578
+ setMax: noop,
2579
+ setMin: noop,
2580
+ setStep: noop,
2581
+ setValue: noop,
2582
+ up: noop
2583
+ };
2584
+ const [stepper, setStepper] = useState(pStepper);
2585
+ const [data, setData] = useState({
2586
+ id: _id,
2587
+ value: _value,
2588
+ min,
2589
+ max,
2590
+ step: _step
2591
+ });
2592
+ useEffect(() => {
2593
+ if (max !== data.max) stepper.setMax(max);
2594
+ }, [stepper, max]);
2595
+ useEffect(() => {
2596
+ if (min !== data.min) stepper.setMin(min);
2597
+ }, [stepper, min]);
2598
+ useEffect(() => {
2599
+ if (_step !== data.step) stepper.setStep(_step || 1);
2600
+ }, [stepper, _step]);
2601
+ useEffect(() => {
2602
+ if (_value !== data.value) stepper.setValue(_value || 0);
2603
+ }, [stepper, _value]);
2604
+ useEffect(() => {
2605
+ setStepper(createStepper({
2606
+ id: _id,
2607
+ value: _value,
2608
+ min,
2609
+ max,
2610
+ step: _step
2611
+ }, setData));
2612
+ }, []);
2613
+ return [stepper, data];
2614
+ };
2615
+
2616
+ function Stepper(_a) {
2617
+ var {
2618
+ label,
2619
+ description,
2620
+ statusMessage,
2621
+ onChange
2622
+ } = _a,
2623
+ props = __rest(_a, ["label", "description", "statusMessage", "onChange"]);
2624
+
2625
+ const [stepper, data] = useStepper(props);
2626
+ useEffect(() => {
2627
+ if (typeof data.value === 'undefined') return;
2628
+ if (onChange) onChange(data.value);
2629
+ }, [data.value]);
2630
+
2631
+ const onChangeEvent = e => {
2632
+ stepper.setValue(e.target.valueAsNumber);
2633
+ };
2634
+
2635
+ return jsxs("div", Object.assign({
2636
+ className: "form-group"
2637
+ }, {
2638
+ children: [label && jsx("label", Object.assign({
2639
+ htmlFor: data.id
2640
+ }, {
2641
+ children: label
2642
+ })), description && jsx("span", Object.assign({
2643
+ className: "form-info"
2644
+ }, {
2645
+ children: description
2646
+ })), jsxs("div", Object.assign({
2647
+ className: "group group-border group-stepper"
2648
+ }, {
2649
+ children: [jsx("button", Object.assign({
2650
+ onClick: () => stepper.down()
2651
+ }, {
2652
+ children: "-"
2653
+ })), jsx("input", {
2654
+ id: data.id,
2655
+ type: "number",
2656
+ onChange: onChangeEvent,
2657
+ onFocus: ({
2658
+ target
2659
+ }) => target.select(),
2660
+ placeholder: "0",
2661
+ value: data.value
2662
+ }), jsx("button", Object.assign({
2663
+ onClick: () => stepper.up()
2664
+ }, {
2665
+ children: "+"
2666
+ }))]
2667
+ })), statusMessage && jsx("span", Object.assign({
2668
+ className: "form-info"
2669
+ }, {
2670
+ children: statusMessage
2671
+ }))]
2672
+ }));
2673
+ }
2674
+
2675
+ const useDropdown = ({
2676
+ id,
2677
+ value,
2678
+ texts,
2679
+ options,
2680
+ loop,
2681
+ multiSelect,
2682
+ searchable,
2683
+ searchFilter,
2684
+ compareWith,
2685
+ useValue,
2686
+ display,
2687
+ togglerRef,
2688
+ listboxRef,
2689
+ onChange,
2690
+ validator
2691
+ }) => {
2692
+ const [handler, setHandler] = useState();
2693
+ const [dropdown, setDropdown] = useState();
2694
+ const [togglerProps, setTogglerProps] = useState({});
2695
+ const [listboxProps, setListboxProps] = useState({});
2696
+ const [listItems, setListItems] = useState([]);
2697
+ const [multiSelectProps, setMultiSelectProps] = useState({}); // When dropdown data changes
2698
+
2699
+ useEffect(() => {
2700
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2701
+
2702
+ if (!dropdown) return;
2703
+ const {
2704
+ elements: {
2705
+ toggler,
2706
+ listbox
2707
+ }
2708
+ } = dropdown;
2709
+ const newToggleProps = Object.assign(Object.assign({}, toggler === null || toggler === void 0 ? void 0 : toggler.attributes), {
2710
+ className: (_a = toggler === null || toggler === void 0 ? void 0 : toggler.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2711
+ children: (_b = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _b === void 0 ? void 0 : _b.select,
2712
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.toggle()
2713
+ });
2714
+ setTogglerProps(newToggleProps);
2715
+ const newListboxProps = Object.assign(Object.assign({}, listbox === null || listbox === void 0 ? void 0 : listbox.attributes), {
2716
+ className: (_c = listbox === null || listbox === void 0 ? void 0 : listbox.classes) === null || _c === void 0 ? void 0 : _c.join(' ')
2717
+ });
2718
+ setListboxProps(newListboxProps);
2719
+
2720
+ if (!dropdown.isMultiSelect) {
2721
+ const newListItems = dropdown.options.map(o => {
2722
+ var _a;
2723
+
2724
+ return Object.assign(Object.assign({}, o.attributes), {
2725
+ className: (_a = o.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2726
+ children: o[dropdown.display],
2727
+ selected: o.selected,
2728
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o)
2729
+ });
2730
+ });
2731
+ setListItems(newListItems);
2732
+ } else {
2733
+ const checkboxes = dropdown.options.map(o => ({
2734
+ labelProps: Object.assign(Object.assign({}, o.attributes), {
2735
+ className: ['form-control', ...o.classes].join(' ')
2736
+ }),
2737
+ inputProps: {
2738
+ defaultChecked: o.selected,
2739
+ type: 'checkbox',
2740
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o, false)
2741
+ },
2742
+ spanProps: {
2743
+ children: o[dropdown.display]
2744
+ }
2745
+ }));
2746
+ const newMultiselect = {
2747
+ fieldsetProps: {
2748
+ 'aria-describedby': (_f = (_e = (_d = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _d === void 0 ? void 0 : _d.fieldset) === null || _e === void 0 ? void 0 : _e.attributes) === null || _f === void 0 ? void 0 : _f.id,
2749
+ 'aria-multiselectable': true,
2750
+ role: 'listbox',
2751
+ tabIndex: -1
2752
+ },
2753
+ legendProps: {
2754
+ className: 'sr-only',
2755
+ id: (_j = (_h = (_g = dropdown === null || dropdown === void 0 ? void 0 : dropdown.elements) === null || _g === void 0 ? void 0 : _g.fieldset) === null || _h === void 0 ? void 0 : _h.attributes) === null || _j === void 0 ? void 0 : _j.id,
2756
+ children: dropdown.texts.optionsDescription
2757
+ },
2758
+ checkboxes
2759
+ };
2760
+ setMultiSelectProps(newMultiselect);
2761
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
2762
+
2763
+ }, [dropdown]); // When dropdown properties change
2764
+
2765
+ useEffect(() => {
2766
+ if (!dropdown) return;
2767
+ handler === null || handler === void 0 ? void 0 : handler.update({
2768
+ id,
2769
+ value,
2770
+ texts,
2771
+ options,
2772
+ loop,
2773
+ multiSelect,
2774
+ searchable,
2775
+ searchFilter,
2776
+ compareWith,
2777
+ useValue,
2778
+ display,
2779
+ validator
2780
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
2781
+ }, [id, texts, options, loop, multiSelect, searchable, searchFilter, compareWith, useValue, display]);
2782
+ useEffect(() => {
2783
+ if (!dropdown) return;
2784
+ handler === null || handler === void 0 ? void 0 : handler.selectByValue(value);
2785
+ console.log('new value'); // eslint-disable-next-line react-hooks/exhaustive-deps
2786
+ }, [value]); // When validator changes
2787
+
2788
+ useEffect(() => {
2789
+ if (!dropdown) return;
2790
+ if (validator) handler === null || handler === void 0 ? void 0 : handler.validate(validator); // eslint-disable-next-line react-hooks/exhaustive-deps
2791
+ }, [validator]); // Create dropdown handler
2792
+
2793
+ useEffect(() => {
2794
+ if (!handler && togglerRef.current && listboxRef.current) {
2795
+ setHandler(createDropdown({
2796
+ id,
2797
+ value,
2798
+ texts,
2799
+ options,
2800
+ loop,
2801
+ multiSelect,
2802
+ searchable,
2803
+ searchFilter,
2804
+ compareWith,
2805
+ useValue,
2806
+ display,
2807
+ validator
2808
+ }, togglerRef.current, listboxRef.current, listboxRef.current, dd => setDropdown(dd), value => onChange === null || onChange === void 0 ? void 0 : onChange(value)));
2809
+ }
2810
+
2811
+ return () => handler === null || handler === void 0 ? void 0 : handler.destroy(); // eslint-disable-next-line react-hooks/exhaustive-deps
2812
+ }, [togglerRef, listboxRef]);
2813
+ return {
2814
+ dropdown: handler,
2815
+ togglerProps,
2816
+ listboxProps,
2817
+ listItems,
2818
+ multiSelectProps
2819
+ };
2820
+ };
2821
+
2822
+ const Dropdown = ({
2823
+ id,
2824
+ value,
2825
+ options,
2826
+ loop,
2827
+ multiSelect,
2828
+ searchable,
2829
+ searchFilter,
2830
+ compareWith,
2831
+ useValue,
2832
+ display,
2833
+ texts,
2834
+ onChange,
2835
+ validator
2836
+ }) => {
2837
+ var _a;
2838
+
2839
+ const togglerRef = useRef(null);
2840
+ const listboxRef = useRef(null);
2841
+ const {
2842
+ dropdown,
2843
+ listboxProps,
2844
+ togglerProps,
2845
+ listItems,
2846
+ multiSelectProps
2847
+ } = useDropdown({
2848
+ id,
2849
+ value,
2850
+ options,
2851
+ loop,
2852
+ multiSelect,
2853
+ searchable,
2854
+ searchFilter,
2855
+ compareWith,
2856
+ useValue,
2857
+ display,
2858
+ togglerRef,
2859
+ listboxRef,
2860
+ texts,
2861
+ onChange,
2862
+ validator
2863
+ });
2864
+
2865
+ const getListBoxProps = props => {
2866
+ var _a, _b, _c;
2867
+
2868
+ if (Object.keys(props).length === 0) return {
2869
+ role: 'listbox',
2870
+ tabIndex: -1,
2871
+ className: (_c = (_b = (_a = dropdownValues.elements) === null || _a === void 0 ? void 0 : _a.listbox) === null || _b === void 0 ? void 0 : _b.classes) === null || _c === void 0 ? void 0 : _c.join(' ')
2872
+ };
2873
+ return props;
2874
+ };
2875
+
2876
+ return jsxs("div", Object.assign({
2877
+ className: "form-group"
2878
+ }, {
2879
+ children: [jsx("button", Object.assign({
2880
+ type: "button"
2881
+ }, togglerProps, {
2882
+ ref: togglerRef
2883
+ }, {
2884
+ children: jsx("span", {
2885
+ children: togglerProps.children
2886
+ })
2887
+ })), jsxs("div", Object.assign({}, getListBoxProps(listboxProps), {
2888
+ ref: listboxRef
2889
+ }, {
2890
+ children: [jsx("button", Object.assign({
2891
+ type: "button",
2892
+ className: "close m-4 m-sm-2 d-block d-sm-none",
2893
+ onClick: dropdown === null || dropdown === void 0 ? void 0 : dropdown.close
2894
+ }, {
2895
+ children: jsx("span", Object.assign({
2896
+ className: "sr-only"
2897
+ }, {
2898
+ children: dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.texts.close
2899
+ }))
2900
+ })), (dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.isMultiSelect) ? jsx("div", Object.assign({
2901
+ className: "sg-fieldset-container"
2902
+ }, {
2903
+ children: jsxs("fieldset", Object.assign({}, multiSelectProps.fieldsetProps, {
2904
+ children: [jsx("legend", Object.assign({}, multiSelectProps.legendProps)), (_a = multiSelectProps.checkboxes) === null || _a === void 0 ? void 0 : _a.map(checkboxItem => jsxs("label", Object.assign({}, checkboxItem.labelProps, {
2905
+ children: [jsx("input", Object.assign({}, checkboxItem.inputProps)), jsx("span", Object.assign({}, checkboxItem.spanProps)), jsx("i", {})]
2906
+ }), checkboxItem.labelProps.id))]
2907
+ }))
2908
+ })) : jsx("ul", Object.assign({
2909
+ role: "listbox"
2910
+ }, {
2911
+ children: listItems.map(liProps => jsx("li", Object.assign({}, liProps), liProps.id))
2912
+ }))]
2913
+ })), validator && jsx("span", Object.assign({
2914
+ className: "form-info"
2915
+ }, {
2916
+ children: validator === null || validator === void 0 ? void 0 : validator.message
2917
+ }))]
2918
+ }));
1981
2919
  };
1982
2920
 
1983
- export { Alert, Button, ButtonGroup, Card, Checkbox, EmailInput, Flexbox, Form, Group, Modal, NumberInput, TextInput };
2921
+ export { Alert, Badge, Button, ButtonGroup, Card, Checkbox, Dropdown, EmailInput, Flexbox, Form, FormItems, Group, Link, List, Modal, Navbar, NumberInput, RadioButton, RadioGroup, RenderInput, Stepper, Text, TextInput };