@sebgroup/green-react 1.0.0-beta.4 → 1.0.0-beta.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
- import { jsx, jsxs } from 'react/jsx-runtime';
2
- import { ModalRole, randomId } from '@sebgroup/extract';
3
- import React, { 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.3',
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,20 +1061,24 @@ function Button({
1009
1061
  children,
1010
1062
  variant,
1011
1063
  onClick,
1064
+ disabled,
1012
1065
  active = false,
1013
- type = 'button'
1066
+ type = 'button',
1067
+ size
1014
1068
  }) {
1015
1069
  const props = {
1016
- type
1070
+ type,
1071
+ disabled
1017
1072
  };
1018
1073
  const classNames = [];
1019
1074
  if (variant) classNames.push(variant);
1020
1075
  if (active) classNames.push('active');
1076
+ if (size) classNames.push('small');
1021
1077
  if (classNames.length) props.className = classNames.join(' ');
1022
1078
  if (onClick) props.onClick = onClick;
1023
1079
  return jsx("button", Object.assign({}, props, {
1024
1080
  children: children
1025
- }), void 0);
1081
+ }));
1026
1082
  }
1027
1083
 
1028
1084
  const ModalHeader = ({
@@ -1038,7 +1094,7 @@ const ModalHeader = ({
1038
1094
  }, {
1039
1095
  children: [jsx("h3", {
1040
1096
  children: _header
1041
- }, void 0), jsx("button", Object.assign({
1097
+ }), jsx("button", Object.assign({
1042
1098
  className: "close",
1043
1099
  onClick: handleClose
1044
1100
  }, {
@@ -1046,9 +1102,9 @@ const ModalHeader = ({
1046
1102
  className: "sr-only"
1047
1103
  }, {
1048
1104
  children: "Close"
1049
- }), void 0)
1050
- }), void 0)]
1051
- }), void 0);
1105
+ }))
1106
+ }))]
1107
+ }));
1052
1108
  };
1053
1109
 
1054
1110
  const ModalBody = ({
@@ -1058,7 +1114,7 @@ const ModalBody = ({
1058
1114
  className: "body"
1059
1115
  }, {
1060
1116
  children: children
1061
- }), void 0);
1117
+ }));
1062
1118
  };
1063
1119
 
1064
1120
  const ModalFooter = ({
@@ -1086,13 +1142,13 @@ const ModalFooter = ({
1086
1142
  onClick: handleDismiss
1087
1143
  }, {
1088
1144
  children: dismiss
1089
- }), void 0), confirm && jsx(Button, Object.assign({
1145
+ })), confirm && jsx(Button, Object.assign({
1090
1146
  variant: "primary",
1091
1147
  onClick: handleConfirm
1092
1148
  }, {
1093
1149
  children: confirm
1094
- }), void 0)]
1095
- }), void 0);
1150
+ }))]
1151
+ }));
1096
1152
  };
1097
1153
 
1098
1154
  const Modal = _a => {
@@ -1102,14 +1158,44 @@ const Modal = _a => {
1102
1158
  } = _a,
1103
1159
  props = __rest(_a, ["type", "isOpen"]);
1104
1160
 
1105
- return isOpen ? jsxs("section", Object.assign({
1106
- role: ModalRole[type]
1107
- }, {
1108
- children: [jsx(ModalHeader, Object.assign({}, props), void 0), jsx(ModalBody, Object.assign({}, props), void 0), jsx(ModalFooter, Object.assign({}, props), void 0)]
1109
- }), void 0) : null;
1161
+ const modalContent = () => {
1162
+ switch (type) {
1163
+ case 'slideout':
1164
+ {
1165
+ return jsxs("aside", Object.assign({
1166
+ role: "dialog"
1167
+ }, {
1168
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1169
+ }));
1170
+ }
1171
+
1172
+ case 'takeover':
1173
+ {
1174
+ return jsxs("main", Object.assign({
1175
+ role: "dialog"
1176
+ }, {
1177
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1178
+ }));
1179
+ }
1180
+
1181
+ default:
1182
+ {
1183
+ return jsxs("section", Object.assign({
1184
+ role: "dialog"
1185
+ }, {
1186
+ children: [jsx(ModalHeader, Object.assign({}, props)), jsx(ModalBody, Object.assign({}, props)), jsx(ModalFooter, Object.assign({}, props))]
1187
+ }));
1188
+ }
1189
+ }
1190
+ };
1191
+
1192
+ return isOpen ? modalContent() : null;
1110
1193
  };
1111
1194
 
1112
- var DESCRIPTORS = descriptors;
1195
+ var objectDefineProperties = {};
1196
+
1197
+ var DESCRIPTORS$2 = descriptors;
1198
+ var V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug;
1113
1199
  var definePropertyModule$1 = objectDefineProperty;
1114
1200
  var anObject$2 = anObject$5;
1115
1201
  var toIndexedObject$1 = toIndexedObject$5;
@@ -1117,8 +1203,8 @@ var objectKeys = objectKeys$2;
1117
1203
 
1118
1204
  // `Object.defineProperties` method
1119
1205
  // https://tc39.es/ecma262/#sec-object.defineproperties
1120
- // eslint-disable-next-line es/no-object-defineproperties -- safe
1121
- var objectDefineProperties = DESCRIPTORS ? Object.defineProperties : function defineProperties(O, Properties) {
1206
+ // eslint-disable-next-line es-x/no-object-defineproperties -- safe
1207
+ objectDefineProperties.f = DESCRIPTORS$2 && !V8_PROTOTYPE_DEFINE_BUG ? Object.defineProperties : function defineProperties(O, Properties) {
1122
1208
  anObject$2(O);
1123
1209
  var props = toIndexedObject$1(Properties);
1124
1210
  var keys = objectKeys(Properties);
@@ -1136,7 +1222,7 @@ var html$1 = getBuiltIn('document', 'documentElement');
1136
1222
  /* global ActiveXObject -- old IE, WSH */
1137
1223
 
1138
1224
  var anObject$1 = anObject$5;
1139
- var defineProperties = objectDefineProperties;
1225
+ var definePropertiesModule = objectDefineProperties;
1140
1226
  var enumBugKeys = enumBugKeys$3;
1141
1227
  var hiddenKeys = hiddenKeys$4;
1142
1228
  var html = html$1;
@@ -1205,6 +1291,7 @@ hiddenKeys[IE_PROTO$1] = true;
1205
1291
 
1206
1292
  // `Object.create` method
1207
1293
  // https://tc39.es/ecma262/#sec-object.create
1294
+ // eslint-disable-next-line es-x/no-object-create -- safe
1208
1295
  var objectCreate = Object.create || function create(O, Properties) {
1209
1296
  var result;
1210
1297
  if (O !== null) {
@@ -1214,7 +1301,7 @@ var objectCreate = Object.create || function create(O, Properties) {
1214
1301
  // add "__proto__" for Object.getPrototypeOf polyfill
1215
1302
  result[IE_PROTO$1] = O;
1216
1303
  } else result = NullProtoObject();
1217
- return Properties === undefined ? result : defineProperties(result, Properties);
1304
+ return Properties === undefined ? result : definePropertiesModule.f(result, Properties);
1218
1305
  };
1219
1306
 
1220
1307
  var wellKnownSymbol$6 = wellKnownSymbol$8;
@@ -1240,18 +1327,18 @@ var addToUnscopables$1 = function (key) {
1240
1327
 
1241
1328
  var iterators = {};
1242
1329
 
1243
- var fails$2 = fails$9;
1330
+ var fails$1 = fails$a;
1244
1331
 
1245
- var correctPrototypeGetter = !fails$2(function () {
1332
+ var correctPrototypeGetter = !fails$1(function () {
1246
1333
  function F() { /* empty */ }
1247
1334
  F.prototype.constructor = null;
1248
- // eslint-disable-next-line es/no-object-getprototypeof -- required for testing
1335
+ // eslint-disable-next-line es-x/no-object-getprototypeof -- required for testing
1249
1336
  return Object.getPrototypeOf(new F()) !== F.prototype;
1250
1337
  });
1251
1338
 
1252
1339
  var global$6 = global$r;
1253
- var hasOwn$1 = hasOwnProperty_1;
1254
- var isCallable$4 = isCallable$e;
1340
+ var hasOwn$2 = hasOwnProperty_1;
1341
+ var isCallable$5 = isCallable$f;
1255
1342
  var toObject = toObject$3;
1256
1343
  var sharedKey = sharedKey$3;
1257
1344
  var CORRECT_PROTOTYPE_GETTER = correctPrototypeGetter;
@@ -1264,27 +1351,27 @@ var ObjectPrototype = Object$2.prototype;
1264
1351
  // https://tc39.es/ecma262/#sec-object.getprototypeof
1265
1352
  var objectGetPrototypeOf = CORRECT_PROTOTYPE_GETTER ? Object$2.getPrototypeOf : function (O) {
1266
1353
  var object = toObject(O);
1267
- if (hasOwn$1(object, IE_PROTO)) return object[IE_PROTO];
1354
+ if (hasOwn$2(object, IE_PROTO)) return object[IE_PROTO];
1268
1355
  var constructor = object.constructor;
1269
- if (isCallable$4(constructor) && object instanceof constructor) {
1356
+ if (isCallable$5(constructor) && object instanceof constructor) {
1270
1357
  return constructor.prototype;
1271
1358
  } return object instanceof Object$2 ? ObjectPrototype : null;
1272
1359
  };
1273
1360
 
1274
- var fails$1 = fails$9;
1275
- var isCallable$3 = isCallable$e;
1361
+ var fails = fails$a;
1362
+ var isCallable$4 = isCallable$f;
1276
1363
  var getPrototypeOf$1 = objectGetPrototypeOf;
1277
1364
  var redefine$1 = redefine$3.exports;
1278
1365
  var wellKnownSymbol$5 = wellKnownSymbol$8;
1279
1366
 
1280
- var ITERATOR$3 = wellKnownSymbol$5('iterator');
1367
+ var ITERATOR$2 = wellKnownSymbol$5('iterator');
1281
1368
  var BUGGY_SAFARI_ITERATORS$1 = false;
1282
1369
 
1283
1370
  // `%IteratorPrototype%` object
1284
1371
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-object
1285
1372
  var IteratorPrototype$2, PrototypeOfArrayIteratorPrototype, arrayIterator;
1286
1373
 
1287
- /* eslint-disable es/no-array-prototype-keys -- safe */
1374
+ /* eslint-disable es-x/no-array-prototype-keys -- safe */
1288
1375
  if ([].keys) {
1289
1376
  arrayIterator = [].keys();
1290
1377
  // Safari 8 has buggy iterators w/o `next`
@@ -1295,18 +1382,18 @@ if ([].keys) {
1295
1382
  }
1296
1383
  }
1297
1384
 
1298
- var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails$1(function () {
1385
+ var NEW_ITERATOR_PROTOTYPE = IteratorPrototype$2 == undefined || fails(function () {
1299
1386
  var test = {};
1300
1387
  // FF44- legacy iterators case
1301
- return IteratorPrototype$2[ITERATOR$3].call(test) !== test;
1388
+ return IteratorPrototype$2[ITERATOR$2].call(test) !== test;
1302
1389
  });
1303
1390
 
1304
1391
  if (NEW_ITERATOR_PROTOTYPE) IteratorPrototype$2 = {};
1305
1392
 
1306
1393
  // `%IteratorPrototype%[@@iterator]()` method
1307
1394
  // https://tc39.es/ecma262/#sec-%iteratorprototype%-@@iterator
1308
- if (!isCallable$3(IteratorPrototype$2[ITERATOR$3])) {
1309
- redefine$1(IteratorPrototype$2, ITERATOR$3, function () {
1395
+ if (!isCallable$4(IteratorPrototype$2[ITERATOR$2])) {
1396
+ redefine$1(IteratorPrototype$2, ITERATOR$2, function () {
1310
1397
  return this;
1311
1398
  });
1312
1399
  }
@@ -1316,15 +1403,16 @@ var iteratorsCore = {
1316
1403
  BUGGY_SAFARI_ITERATORS: BUGGY_SAFARI_ITERATORS$1
1317
1404
  };
1318
1405
 
1319
- var defineProperty = objectDefineProperty.f;
1320
- var hasOwn = hasOwnProperty_1;
1406
+ var defineProperty$2 = objectDefineProperty.f;
1407
+ var hasOwn$1 = hasOwnProperty_1;
1321
1408
  var wellKnownSymbol$4 = wellKnownSymbol$8;
1322
1409
 
1323
1410
  var TO_STRING_TAG$3 = wellKnownSymbol$4('toStringTag');
1324
1411
 
1325
- var setToStringTag$2 = function (it, TAG, STATIC) {
1326
- if (it && !hasOwn(it = STATIC ? it : it.prototype, TO_STRING_TAG$3)) {
1327
- defineProperty(it, TO_STRING_TAG$3, { configurable: true, value: TAG });
1412
+ var setToStringTag$2 = function (target, TAG, STATIC) {
1413
+ if (target && !STATIC) target = target.prototype;
1414
+ if (target && !hasOwn$1(target, TO_STRING_TAG$3)) {
1415
+ defineProperty$2(target, TO_STRING_TAG$3, { configurable: true, value: TAG });
1328
1416
  }
1329
1417
  };
1330
1418
 
@@ -1345,33 +1433,33 @@ var createIteratorConstructor$1 = function (IteratorConstructor, NAME, next, ENU
1345
1433
  };
1346
1434
 
1347
1435
  var global$5 = global$r;
1348
- var isCallable$2 = isCallable$e;
1436
+ var isCallable$3 = isCallable$f;
1349
1437
 
1350
1438
  var String$2 = global$5.String;
1351
1439
  var TypeError$1 = global$5.TypeError;
1352
1440
 
1353
1441
  var aPossiblePrototype$1 = function (argument) {
1354
- if (typeof argument == 'object' || isCallable$2(argument)) return argument;
1442
+ if (typeof argument == 'object' || isCallable$3(argument)) return argument;
1355
1443
  throw TypeError$1("Can't set " + String$2(argument) + ' as a prototype');
1356
1444
  };
1357
1445
 
1358
1446
  /* eslint-disable no-proto -- safe */
1359
1447
 
1360
- var uncurryThis$2 = functionUncurryThis;
1448
+ var uncurryThis$1 = functionUncurryThis;
1361
1449
  var anObject = anObject$5;
1362
1450
  var aPossiblePrototype = aPossiblePrototype$1;
1363
1451
 
1364
1452
  // `Object.setPrototypeOf` method
1365
1453
  // https://tc39.es/ecma262/#sec-object.setprototypeof
1366
1454
  // Works with __proto__ only. Old v8 can't work with null proto objects.
1367
- // eslint-disable-next-line es/no-object-setprototypeof -- safe
1455
+ // eslint-disable-next-line es-x/no-object-setprototypeof -- safe
1368
1456
  var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? function () {
1369
1457
  var CORRECT_SETTER = false;
1370
1458
  var test = {};
1371
1459
  var setter;
1372
1460
  try {
1373
- // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
1374
- setter = uncurryThis$2(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1461
+ // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe
1462
+ setter = uncurryThis$1(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);
1375
1463
  setter(test, []);
1376
1464
  CORRECT_SETTER = test instanceof Array;
1377
1465
  } catch (error) { /* empty */ }
@@ -1387,7 +1475,7 @@ var objectSetPrototypeOf = Object.setPrototypeOf || ('__proto__' in {} ? functio
1387
1475
  var $$1 = _export;
1388
1476
  var call = functionCall;
1389
1477
  var FunctionName = functionName;
1390
- var isCallable$1 = isCallable$e;
1478
+ var isCallable$2 = isCallable$f;
1391
1479
  var createIteratorConstructor = createIteratorConstructor$1;
1392
1480
  var getPrototypeOf = objectGetPrototypeOf;
1393
1481
  var setPrototypeOf = objectSetPrototypeOf;
@@ -1402,7 +1490,7 @@ var PROPER_FUNCTION_NAME = FunctionName.PROPER;
1402
1490
  var CONFIGURABLE_FUNCTION_NAME = FunctionName.CONFIGURABLE;
1403
1491
  var IteratorPrototype = IteratorsCore.IteratorPrototype;
1404
1492
  var BUGGY_SAFARI_ITERATORS = IteratorsCore.BUGGY_SAFARI_ITERATORS;
1405
- var ITERATOR$2 = wellKnownSymbol$3('iterator');
1493
+ var ITERATOR$1 = wellKnownSymbol$3('iterator');
1406
1494
  var KEYS = 'keys';
1407
1495
  var VALUES = 'values';
1408
1496
  var ENTRIES = 'entries';
@@ -1425,7 +1513,7 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1425
1513
  var TO_STRING_TAG = NAME + ' Iterator';
1426
1514
  var INCORRECT_VALUES_NAME = false;
1427
1515
  var IterablePrototype = Iterable.prototype;
1428
- var nativeIterator = IterablePrototype[ITERATOR$2]
1516
+ var nativeIterator = IterablePrototype[ITERATOR$1]
1429
1517
  || IterablePrototype['@@iterator']
1430
1518
  || DEFAULT && IterablePrototype[DEFAULT];
1431
1519
  var defaultIterator = !BUGGY_SAFARI_ITERATORS && nativeIterator || getIterationMethod(DEFAULT);
@@ -1439,8 +1527,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1439
1527
  if (getPrototypeOf(CurrentIteratorPrototype) !== IteratorPrototype) {
1440
1528
  if (setPrototypeOf) {
1441
1529
  setPrototypeOf(CurrentIteratorPrototype, IteratorPrototype);
1442
- } else if (!isCallable$1(CurrentIteratorPrototype[ITERATOR$2])) {
1443
- redefine(CurrentIteratorPrototype, ITERATOR$2, returnThis);
1530
+ } else if (!isCallable$2(CurrentIteratorPrototype[ITERATOR$1])) {
1531
+ redefine(CurrentIteratorPrototype, ITERATOR$1, returnThis);
1444
1532
  }
1445
1533
  }
1446
1534
  // Set @@toStringTag to native iterators
@@ -1473,8 +1561,8 @@ var defineIterator$1 = function (Iterable, NAME, IteratorConstructor, next, DEFA
1473
1561
  }
1474
1562
 
1475
1563
  // define iterator
1476
- if (IterablePrototype[ITERATOR$2] !== defaultIterator) {
1477
- redefine(IterablePrototype, ITERATOR$2, defaultIterator, { name: DEFAULT });
1564
+ if (IterablePrototype[ITERATOR$1] !== defaultIterator) {
1565
+ redefine(IterablePrototype, ITERATOR$1, defaultIterator, { name: DEFAULT });
1478
1566
  }
1479
1567
  Iterators$1[NAME] = defaultIterator;
1480
1568
 
@@ -1485,7 +1573,9 @@ var toIndexedObject = toIndexedObject$5;
1485
1573
  var addToUnscopables = addToUnscopables$1;
1486
1574
  var Iterators = iterators;
1487
1575
  var InternalStateModule = internalState;
1576
+ var defineProperty$1 = objectDefineProperty.f;
1488
1577
  var defineIterator = defineIterator$1;
1578
+ var DESCRIPTORS$1 = descriptors;
1489
1579
 
1490
1580
  var ARRAY_ITERATOR = 'Array Iterator';
1491
1581
  var setInternalState = InternalStateModule.set;
@@ -1527,13 +1617,18 @@ var es_array_iterator = defineIterator(Array, 'Array', function (iterated, kind)
1527
1617
  // argumentsList[@@iterator] is %ArrayProto_values%
1528
1618
  // https://tc39.es/ecma262/#sec-createunmappedargumentsobject
1529
1619
  // https://tc39.es/ecma262/#sec-createmappedargumentsobject
1530
- Iterators.Arguments = Iterators.Array;
1620
+ var values = Iterators.Arguments = Iterators.Array;
1531
1621
 
1532
1622
  // https://tc39.es/ecma262/#sec-array.prototype-@@unscopables
1533
1623
  addToUnscopables('keys');
1534
1624
  addToUnscopables('values');
1535
1625
  addToUnscopables('entries');
1536
1626
 
1627
+ // V8 ~ Chrome 45- bug
1628
+ if (DESCRIPTORS$1 && values.name !== 'values') try {
1629
+ defineProperty$1(values, 'name', { value: 'values' });
1630
+ } catch (error) { /* empty */ }
1631
+
1537
1632
  // iterable DOM collections
1538
1633
  // flag - `iterable` interface - 'entries', 'keys', 'values', 'forEach' methods
1539
1634
  var domIterables = {
@@ -1585,17 +1680,17 @@ var ArrayIteratorMethods = es_array_iterator;
1585
1680
  var createNonEnumerableProperty = createNonEnumerableProperty$5;
1586
1681
  var wellKnownSymbol$2 = wellKnownSymbol$8;
1587
1682
 
1588
- var ITERATOR$1 = wellKnownSymbol$2('iterator');
1683
+ var ITERATOR = wellKnownSymbol$2('iterator');
1589
1684
  var TO_STRING_TAG$2 = wellKnownSymbol$2('toStringTag');
1590
1685
  var ArrayValues = ArrayIteratorMethods.values;
1591
1686
 
1592
1687
  var handlePrototype = function (CollectionPrototype, COLLECTION_NAME) {
1593
1688
  if (CollectionPrototype) {
1594
1689
  // some Chrome versions have non-configurable methods on DOMTokenList
1595
- if (CollectionPrototype[ITERATOR$1] !== ArrayValues) try {
1596
- createNonEnumerableProperty(CollectionPrototype, ITERATOR$1, ArrayValues);
1690
+ if (CollectionPrototype[ITERATOR] !== ArrayValues) try {
1691
+ createNonEnumerableProperty(CollectionPrototype, ITERATOR, ArrayValues);
1597
1692
  } catch (error) {
1598
- CollectionPrototype[ITERATOR$1] = ArrayValues;
1693
+ CollectionPrototype[ITERATOR] = ArrayValues;
1599
1694
  }
1600
1695
  if (!CollectionPrototype[TO_STRING_TAG$2]) {
1601
1696
  createNonEnumerableProperty(CollectionPrototype, TO_STRING_TAG$2, COLLECTION_NAME);
@@ -1617,46 +1712,45 @@ for (var COLLECTION_NAME in DOMIterables) {
1617
1712
 
1618
1713
  handlePrototype(DOMTokenListPrototype, 'DOMTokenList');
1619
1714
 
1620
- const Flexbox = ({
1621
- alignContent,
1622
- alignItems,
1623
- alignSelf,
1624
- children,
1625
- justifyContent
1626
- }) => {
1715
+ const Flexbox = _a => {
1716
+ var {
1717
+ alignContent,
1718
+ alignItems,
1719
+ alignSelf,
1720
+ children,
1721
+ justifyContent,
1722
+ flexDirection,
1723
+ flexWrap,
1724
+ className
1725
+ } = _a,
1726
+ props = __rest(_a, ["alignContent", "alignItems", "alignSelf", "children", "justifyContent", "flexDirection", "flexWrap", "className"]);
1727
+
1627
1728
  const [classes, setClasses] = useState(['d-flex']);
1628
- const [className, setClassName] = useState('d-flex'); // update className when classes change
1729
+ const [flexClassName, setFlexClassName] = useState('d-flex'); // // update className when classes change
1629
1730
 
1630
- useEffect(() => {
1731
+ useLayoutEffect(() => {
1631
1732
  const newClassName = classes.join(' ');
1632
- if (newClassName !== className) setClassName(newClassName);
1633
- }, [classes, className]); // update classes when props change
1733
+ if (newClassName !== flexClassName) setFlexClassName(newClassName);
1734
+ }, [classes, flexClassName]); // // update classes when props change
1634
1735
 
1635
- useEffect(() => {
1736
+ useLayoutEffect(() => {
1636
1737
  const newClasses = ['d-flex'];
1637
- if (alignItems) newClasses.push(`align-items-${alignItems}`);
1638
- if (alignContent) newClasses.push(`align-content-${alignContent}`);
1639
- if (alignSelf) newClasses.push(`align-content-${alignSelf}`);
1640
- if (justifyContent) newClasses.push(`justify-content-${justifyContent}`);
1738
+ alignItems && newClasses.push(`align-items-${alignItems}`);
1739
+ alignContent && newClasses.push(`align-content-${alignContent}`);
1740
+ alignSelf && newClasses.push(`align-self-${alignSelf}`);
1741
+ justifyContent && newClasses.push(`justify-content-${justifyContent}`);
1742
+ flexDirection && newClasses.push(`flex-${flexDirection}`);
1743
+ flexWrap && newClasses.push(`flex-${flexWrap}`);
1744
+ className && newClasses.push(className);
1641
1745
  setClasses(newClasses);
1642
- }, [alignContent, alignItems, alignSelf, justifyContent]);
1746
+ }, [alignContent, alignItems, alignSelf, justifyContent, flexDirection, flexWrap, className]);
1643
1747
  return jsx("div", Object.assign({
1644
- className: className
1645
- }, {
1748
+ className: flexClassName
1749
+ }, props, {
1646
1750
  children: children
1647
- }), void 0);
1751
+ }));
1648
1752
  };
1649
1753
 
1650
- function Group({
1651
- children
1652
- }) {
1653
- return jsx("div", Object.assign({
1654
- className: "group"
1655
- }, {
1656
- children: children
1657
- }), void 0);
1658
- }
1659
-
1660
1754
  function Card({
1661
1755
  children,
1662
1756
  header,
@@ -1667,12 +1761,10 @@ function Card({
1667
1761
  }, {
1668
1762
  children: [jsx("header", {
1669
1763
  children: header
1670
- }, void 0), jsx("p", {
1671
- children: children
1672
- }, void 0), jsx("footer", {
1764
+ }), children, jsx("footer", {
1673
1765
  children: footer
1674
- }, void 0)]
1675
- }), void 0);
1766
+ })]
1767
+ }));
1676
1768
  }
1677
1769
 
1678
1770
  function Alert({
@@ -1695,10 +1787,10 @@ function Alert({
1695
1787
  className: "sr-only"
1696
1788
  }, {
1697
1789
  children: closeText
1698
- }), void 0)
1699
- }), void 0));else setCloseButton(jsx("button", {
1790
+ }))
1791
+ })));else setCloseButton(jsx("button", {
1700
1792
  className: "close"
1701
- }, void 0));
1793
+ }));
1702
1794
  }
1703
1795
  }, [isCloseable, closeText]);
1704
1796
  return jsxs("div", Object.assign({
@@ -1708,13 +1800,13 @@ function Alert({
1708
1800
  children: [header && jsxs("header", {
1709
1801
  children: [/*#__PURE__*/React.isValidElement(header) ? header : jsx("h3", {
1710
1802
  children: header
1711
- }, void 0), closeButton]
1712
- }, void 0), jsx("p", {
1803
+ }), closeButton]
1804
+ }), jsx("p", {
1713
1805
  children: children
1714
- }, void 0), footer && jsx("footer", {
1806
+ }), footer && jsx("footer", {
1715
1807
  children: footer
1716
- }, void 0)]
1717
- }), void 0);
1808
+ })]
1809
+ }));
1718
1810
  }
1719
1811
 
1720
1812
  const ButtonGroup = ({
@@ -1742,149 +1834,220 @@ const ButtonGroup = ({
1742
1834
  }, [children, selected, variant]);
1743
1835
  return jsx(Group, {
1744
1836
  children: buttons.map(props => jsx(Button, Object.assign({}, props), props.key))
1745
- }, void 0);
1837
+ });
1746
1838
  };
1747
1839
 
1748
- function Form({
1749
- children,
1750
- direction = 'vertical',
1751
- formSize = 'md'
1752
- }) {
1753
- return jsx("form", Object.assign({
1754
- className: [direction, `size-${formSize}`].join(' ')
1755
- }, {
1756
- children: children
1757
- }), void 0);
1758
- }
1759
-
1760
- var wellKnownSymbol$1 = wellKnownSymbol$8;
1761
-
1762
- var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
1763
- var test = {};
1764
-
1765
- test[TO_STRING_TAG$1] = 'z';
1766
-
1767
- var toStringTagSupport = String(test) === '[object z]';
1840
+ const validateInputValue = (target, rules, setError) => {
1841
+ const errorMessage = validateInputValueErrors(rules, target);
1842
+ errorMessage ? setErrorInsert(setError, target.name) : setErrorRemove(setError, target.name);
1843
+ return errorMessage;
1844
+ };
1768
1845
 
1769
- var global$3 = global$r;
1770
- var TO_STRING_TAG_SUPPORT = toStringTagSupport;
1771
- var isCallable = isCallable$e;
1772
- var classofRaw = classofRaw$1;
1773
- var wellKnownSymbol = wellKnownSymbol$8;
1846
+ const validateInputValueErrors = (rules, target) => {
1847
+ const {
1848
+ value
1849
+ } = target;
1774
1850
 
1775
- var TO_STRING_TAG = wellKnownSymbol('toStringTag');
1776
- var Object$1 = global$3.Object;
1851
+ if ((rules === null || rules === void 0 ? void 0 : rules.custom) instanceof Function) {
1852
+ return rules === null || rules === void 0 ? void 0 : rules.custom();
1853
+ }
1777
1854
 
1778
- // ES3 wrong here
1779
- var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
1855
+ return validateTextInputValues(value, rules);
1856
+ };
1780
1857
 
1781
- // fallback for IE11 Script Access Denied error
1782
- var tryGet = function (it, key) {
1783
- try {
1784
- return it[key];
1785
- } catch (error) { /* empty */ }
1858
+ const setErrorInsert = (setError, name) => {
1859
+ setError(errors => {
1860
+ return Object.assign(Object.assign({}, errors), {
1861
+ [name]: true
1862
+ });
1863
+ });
1786
1864
  };
1787
1865
 
1788
- // getting tag from ES6+ `Object.prototype.toString`
1789
- var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
1790
- var O, tag, result;
1791
- return it === undefined ? 'Undefined' : it === null ? 'Null'
1792
- // @@toStringTag case
1793
- : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
1794
- // builtinTag case
1795
- : CORRECT_ARGUMENTS ? classofRaw(O)
1796
- // ES3 arguments fallback
1797
- : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;
1866
+ const setErrorRemove = (setError, name) => {
1867
+ setError(errors => {
1868
+ const newError = Object.assign({}, errors);
1869
+ delete newError[name];
1870
+ return newError;
1871
+ });
1798
1872
  };
1799
1873
 
1800
- var global$2 = global$r;
1801
- var classof = classof$1;
1874
+ const validateTextInputValues = (value, rules) => {
1875
+ switch (rules === null || rules === void 0 ? void 0 : rules.type) {
1876
+ case 'Required':
1877
+ {
1878
+ return value === '' || value === undefined || value === null ? 'error' : null;
1879
+ }
1802
1880
 
1803
- var String$1 = global$2.String;
1881
+ default:
1882
+ {
1883
+ return;
1884
+ }
1885
+ }
1886
+ };
1804
1887
 
1805
- var toString$2 = function (argument) {
1806
- if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
1807
- return String$1(argument);
1888
+ const FormContext = /*#__PURE__*/React.createContext({});
1889
+ const useFormContext = () => {
1890
+ return React.useContext(FormContext);
1808
1891
  };
1892
+ const FormProvider = _a => {
1893
+ var {
1894
+ children,
1895
+ direction = 'vertical',
1896
+ formSize = 'md',
1897
+ onSubmit,
1898
+ onFormSubmit
1899
+ } = _a,
1900
+ props = __rest(_a, ["children", "direction", "formSize", "onSubmit", "onFormSubmit"]);
1901
+
1902
+ const [values, setValues] = React.useState();
1903
+ const [errors, setErrors] = React.useState();
1904
+ const [fields, setFields] = React.useState({});
1905
+
1906
+ const formSubmit = event => {
1907
+ let hasError = false;
1908
+ event.preventDefault();
1909
+ Object.keys(fields).forEach(key => {
1910
+ const errorMessage = validateInputValue({
1911
+ name: key,
1912
+ value: values === null || values === void 0 ? void 0 : values[key]
1913
+ }, fields[key], setErrors);
1914
+ hasError = hasError || !!errorMessage;
1915
+ });
1809
1916
 
1810
- // a string of all valid unicode whitespaces
1811
- var whitespaces$2 = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u2000\u2001\u2002' +
1812
- '\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028\u2029\uFEFF';
1917
+ if (!hasError) {
1918
+ onFormSubmit && onFormSubmit(values);
1919
+ }
1920
+ };
1813
1921
 
1814
- var uncurryThis$1 = functionUncurryThis;
1815
- var requireObjectCoercible = requireObjectCoercible$3;
1816
- var toString$1 = toString$2;
1817
- var whitespaces$1 = whitespaces$2;
1818
-
1819
- var replace = uncurryThis$1(''.replace);
1820
- var whitespace = '[' + whitespaces$1 + ']';
1821
- var ltrim = RegExp('^' + whitespace + whitespace + '*');
1822
- var rtrim = RegExp(whitespace + whitespace + '*$');
1823
-
1824
- // `String.prototype.{ trim, trimStart, trimEnd, trimLeft, trimRight }` methods implementation
1825
- var createMethod = function (TYPE) {
1826
- return function ($this) {
1827
- var string = toString$1(requireObjectCoercible($this));
1828
- if (TYPE & 1) string = replace(string, ltrim, '');
1829
- if (TYPE & 2) string = replace(string, rtrim, '');
1830
- return string;
1922
+ const resetForm = () => {
1923
+ setValues({});
1924
+ setErrors({});
1831
1925
  };
1926
+
1927
+ return jsx(FormContext.Provider, Object.assign({
1928
+ value: {
1929
+ setValues,
1930
+ setErrors,
1931
+ setFields,
1932
+ errors,
1933
+ values
1934
+ }
1935
+ }, {
1936
+ children: jsx("form", Object.assign({
1937
+ className: [direction, `size-${formSize}`].join(' '),
1938
+ onSubmit: formSubmit
1939
+ }, props, {
1940
+ onReset: resetForm
1941
+ }, {
1942
+ children: children
1943
+ }))
1944
+ }));
1832
1945
  };
1833
1946
 
1834
- var stringTrim = {
1835
- // `String.prototype.{ trimLeft, trimStart }` methods
1836
- // https://tc39.es/ecma262/#sec-string.prototype.trimstart
1837
- start: createMethod(1),
1838
- // `String.prototype.{ trimRight, trimEnd }` methods
1839
- // https://tc39.es/ecma262/#sec-string.prototype.trimend
1840
- end: createMethod(2),
1841
- // `String.prototype.trim` method
1842
- // https://tc39.es/ecma262/#sec-string.prototype.trim
1843
- trim: createMethod(3)
1947
+ const Form = props => {
1948
+ return jsx(FormProvider, Object.assign({}, props));
1844
1949
  };
1845
1950
 
1846
- var global$1 = global$r;
1847
- var fails = fails$9;
1848
- var uncurryThis = functionUncurryThis;
1849
- var toString = toString$2;
1850
- var trim = stringTrim.trim;
1851
- var whitespaces = whitespaces$2;
1852
-
1853
- var $parseInt$1 = global$1.parseInt;
1854
- var Symbol$1 = global$1.Symbol;
1855
- var ITERATOR = Symbol$1 && Symbol$1.iterator;
1856
- var hex = /^[+-]?0x/i;
1857
- var exec = uncurryThis(hex.exec);
1858
- var FORCED = $parseInt$1(whitespaces + '08') !== 8 || $parseInt$1(whitespaces + '0x16') !== 22
1859
- // MS Edge 18- broken with boxed symbols
1860
- || (ITERATOR && !fails(function () { $parseInt$1(Object(ITERATOR)); }));
1861
-
1862
- // `parseInt` method
1863
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1864
- var numberParseInt = FORCED ? function parseInt(string, radix) {
1865
- var S = trim(toString(string));
1866
- return $parseInt$1(S, (radix >>> 0) || (exec(hex, S) ? 16 : 10));
1867
- } : $parseInt$1;
1951
+ const FormItems = ({
1952
+ children,
1953
+ validate,
1954
+ name
1955
+ }) => {
1956
+ const {
1957
+ setValues,
1958
+ setErrors,
1959
+ setFields,
1960
+ errors
1961
+ } = useFormContext();
1962
+ React.useEffect(() => {
1963
+ setFields(fields => Object.assign(Object.assign({}, fields), {
1964
+ [name]: validate === null || validate === void 0 ? void 0 : validate.rules
1965
+ }));
1966
+
1967
+ const removeValues = values => {
1968
+ const newValues = Object.assign({}, values);
1969
+ delete newValues[name];
1970
+ return newValues;
1971
+ };
1868
1972
 
1869
- var $ = _export;
1870
- var $parseInt = numberParseInt;
1973
+ return () => {
1974
+ setFields(fields => removeValues(fields));
1975
+ setValues(values => removeValues(values));
1976
+ setErrors(errors => removeValues(errors));
1977
+ };
1978
+ }, []);
1871
1979
 
1872
- // `parseInt` method
1873
- // https://tc39.es/ecma262/#sec-parseint-string-radix
1874
- $({ global: true, forced: parseInt != $parseInt }, {
1875
- parseInt: $parseInt
1876
- });
1980
+ const onChange = event => {
1981
+ if (!event.target) return;
1982
+ const {
1983
+ value,
1984
+ name,
1985
+ type,
1986
+ checked
1987
+ } = event.target;
1988
+ let inputValue;
1989
+
1990
+ if (type === 'checkbox') {
1991
+ inputValue = checked ? value : null;
1992
+ checked ? setValues(values => Object.assign(Object.assign({}, values), {
1993
+ [name]: value
1994
+ })) : setValues(values => Object.assign(Object.assign({}, values), {
1995
+ [name]: null
1996
+ }));
1997
+ } else {
1998
+ inputValue = value;
1999
+ setValues(values => Object.assign(Object.assign({}, values), {
2000
+ [name]: value
2001
+ }));
2002
+ }
2003
+
2004
+ validateInputValue({
2005
+ value: inputValue,
2006
+ name,
2007
+ type,
2008
+ checked
2009
+ }, validate === null || validate === void 0 ? void 0 : validate.rules, setErrors);
2010
+ };
2011
+
2012
+ return /*#__PURE__*/React.cloneElement(children, {
2013
+ validator: (errors === null || errors === void 0 ? void 0 : errors[name]) && validate,
2014
+ name,
2015
+ onChange
2016
+ });
2017
+ };
2018
+
2019
+ function Group({
2020
+ children,
2021
+ error,
2022
+ groupBorder = false
2023
+ }) {
2024
+ const groupClassName = `group ${groupBorder ? 'group-border' : ''} ${error ? 'is-invalid' : ''}`;
2025
+ const errorMessage = error ? error.message || error : '';
2026
+ return jsxs("div", Object.assign({
2027
+ className: "form-group"
2028
+ }, {
2029
+ children: [jsx("div", Object.assign({
2030
+ className: groupClassName
2031
+ }, {
2032
+ children: children
2033
+ })), error && jsx("span", Object.assign({
2034
+ className: "form-info"
2035
+ }, {
2036
+ children: errorMessage
2037
+ }))]
2038
+ }));
2039
+ }
1877
2040
 
1878
- const useInput = (props, evaluator, notify) => {
2041
+ const useInput = (props, onChanges, onChangeInput) => {
1879
2042
  const id = useMemo(() => props.id || randomId(), [props.id]);
1880
2043
  const ref = useRef(null);
1881
- const [value, setValue] = useState(props.value);
1882
- const [checked, setChecked] = useState(props.checked);
2044
+ const [value, setValue] = useState(props.value ? props.value : '');
2045
+ const [checked, setChecked] = useState(props.checked ? props.checked : false);
1883
2046
  useEffect(() => {
1884
2047
  if (ref.current && ref.current.form) {
1885
2048
  const resetListener = () => {
1886
- setValue(props.value);
1887
- setChecked(props.checked);
2049
+ setValue(props.value ? props.value : '');
2050
+ setChecked(props.checked ? props.checked : false);
1888
2051
  };
1889
2052
 
1890
2053
  const form = ref.current.form;
@@ -1898,8 +2061,9 @@ const useInput = (props, evaluator, notify) => {
1898
2061
 
1899
2062
  const onChange = event => {
1900
2063
  setValue(event.target.value);
1901
- setChecked(event.target.checked);
1902
- if (notify) notify(evaluator(event.target));
2064
+ setChecked(event.currentTarget.checked);
2065
+ onChanges && onChanges(event);
2066
+ onChangeInput && onChangeInput(event.target.value);
1903
2067
  };
1904
2068
 
1905
2069
  return Object.assign(Object.assign({}, props), {
@@ -1911,8 +2075,8 @@ const useInput = (props, evaluator, notify) => {
1911
2075
  });
1912
2076
  };
1913
2077
 
1914
- const RenderInput = (type, props, evaluator, label, info, listener) => {
1915
- const _a = useInput(props, evaluator, listener),
2078
+ const RenderInput = (type, props, onChange, onChangeInput, label, info, validator) => {
2079
+ const _a = useInput(props, onChange, onChangeInput),
1916
2080
  {
1917
2081
  value
1918
2082
  } = _a,
@@ -1920,73 +2084,128 @@ const RenderInput = (type, props, evaluator, label, info, listener) => {
1920
2084
 
1921
2085
  const propsWithDescription = info ? Object.assign(Object.assign({}, inputProps), {
1922
2086
  'aria-describedby': `${inputProps.id}_info`
1923
- }) : inputProps;
2087
+ }) : inputProps; // Render naked
2088
+
2089
+ if (!label && !info) return jsx("input", Object.assign({
2090
+ type: type,
2091
+ value: value
2092
+ }, propsWithDescription));
1924
2093
  return jsxs("div", Object.assign({
1925
- className: "form-field"
2094
+ className: "form-group"
1926
2095
  }, {
1927
2096
  children: [label && jsx("label", Object.assign({
1928
2097
  htmlFor: inputProps.id
1929
2098
  }, {
1930
2099
  children: label
1931
- }), void 0), info && jsx("span", Object.assign({
2100
+ })), info && jsx("span", Object.assign({
1932
2101
  className: "form-info",
1933
- id: "{inputProps.id}_info"
2102
+ id: `${inputProps.id}_info`
1934
2103
  }, {
1935
2104
  children: info
1936
- }), void 0), jsx("input", Object.assign({
2105
+ })), jsx("input", Object.assign({
1937
2106
  type: type,
1938
2107
  value: value
1939
- }, propsWithDescription), void 0)]
1940
- }), void 0);
2108
+ }, propsWithDescription, {
2109
+ className: validator && validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator)
2110
+ })), validator && jsx("span", Object.assign({
2111
+ className: "form-info"
2112
+ }, {
2113
+ children: validator.message
2114
+ }))]
2115
+ }));
1941
2116
  };
1942
-
1943
2117
  const TextInput = _a => {
1944
2118
  var {
1945
2119
  label,
1946
2120
  info,
1947
- onChangeText
2121
+ onChange,
2122
+ onChangeInput,
2123
+ validator
1948
2124
  } = _a,
1949
- props = __rest(_a, ["label", "info", "onChangeText"]);
2125
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1950
2126
 
1951
- return RenderInput('text', props, e => e.value, label, info, onChangeText);
2127
+ return RenderInput('text', props, onChange, onChangeInput, label, info, validator);
1952
2128
  };
1953
2129
  const EmailInput = _a => {
1954
2130
  var {
1955
2131
  label,
1956
2132
  info,
1957
- onChangeText
2133
+ onChange,
2134
+ onChangeInput,
2135
+ validator
1958
2136
  } = _a,
1959
- props = __rest(_a, ["label", "info", "onChangeText"]);
2137
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1960
2138
 
1961
- return RenderInput('email', props, e => e.value, label, info, onChangeText);
2139
+ return RenderInput('email', props, onChange, onChangeInput, label, info, validator);
1962
2140
  };
1963
2141
  const NumberInput = _a => {
1964
2142
  var {
1965
2143
  label,
1966
2144
  info,
1967
- onChangeText
2145
+ onChange,
2146
+ onChangeInput,
2147
+ validator
1968
2148
  } = _a,
1969
- props = __rest(_a, ["label", "info", "onChangeText"]);
2149
+ props = __rest(_a, ["label", "info", "onChange", "onChangeInput", "validator"]);
1970
2150
 
1971
- return RenderInput('number', props, e => e.value.length ? parseInt(e.value, 10) : undefined, label, info, onChangeText);
2151
+ return RenderInput('number', props, onChange, onChangeInput, label, info, validator);
1972
2152
  };
1973
2153
  const Checkbox = _a => {
1974
2154
  var {
1975
2155
  label,
1976
- onChecked
2156
+ onChange,
2157
+ validator
1977
2158
  } = _a,
1978
- props = __rest(_a, ["label", "onChecked"]);
2159
+ props = __rest(_a, ["label", "onChange", "validator"]);
1979
2160
 
1980
- const inputProps = useInput(props, e => e.checked, onChecked);
2161
+ const inputProps = useInput(props, onChange);
2162
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2163
+ return jsx(Fragment, {
2164
+ children: jsxs("div", Object.assign({
2165
+ className: "form-group"
2166
+ }, {
2167
+ children: [jsxs("label", Object.assign({
2168
+ htmlFor: inputProps.id,
2169
+ className: `form-control ${validatorClassName}`
2170
+ }, {
2171
+ children: [label, jsx("input", Object.assign({
2172
+ type: "checkbox"
2173
+ }, inputProps, {
2174
+ className: validatorClassName
2175
+ })), jsx("i", {})]
2176
+ })), validator && jsx("span", Object.assign({
2177
+ className: "form-info"
2178
+ }, {
2179
+ children: validator.message
2180
+ }))]
2181
+ }))
2182
+ });
2183
+ };
2184
+ const RadioButton = /*#__PURE__*/React.forwardRef((_a, ref) => {
2185
+ var {
2186
+ label,
2187
+ validator
2188
+ } = _a,
2189
+ props = __rest(_a, ["label", "validator"]);
2190
+
2191
+ const {
2192
+ id
2193
+ } = useInput(props);
1981
2194
  return jsxs("label", Object.assign({
1982
- htmlFor: inputProps.id,
2195
+ htmlFor: id,
1983
2196
  className: "form-control"
1984
2197
  }, {
1985
- children: [label, jsx("input", Object.assign({
1986
- type: "checkbox"
1987
- }, inputProps), void 0), jsx("span", {}, void 0)]
1988
- }), void 0);
1989
- };
2198
+ children: [jsx("input", Object.assign({
2199
+ id: id,
2200
+ type: "radio"
2201
+ }, props, {
2202
+ className: validator,
2203
+ ref: ref
2204
+ })), jsx("span", {
2205
+ children: label
2206
+ }), jsx("i", {})]
2207
+ }));
2208
+ });
1990
2209
 
1991
2210
  const Text = ({
1992
2211
  children
@@ -1994,7 +2213,183 @@ const Text = ({
1994
2213
  className: "form-text"
1995
2214
  }, {
1996
2215
  children: children
1997
- }), void 0);
2216
+ }));
2217
+
2218
+ var wellKnownSymbol$1 = wellKnownSymbol$8;
2219
+
2220
+ var TO_STRING_TAG$1 = wellKnownSymbol$1('toStringTag');
2221
+ var test = {};
2222
+
2223
+ test[TO_STRING_TAG$1] = 'z';
2224
+
2225
+ var toStringTagSupport = String(test) === '[object z]';
2226
+
2227
+ var global$3 = global$r;
2228
+ var TO_STRING_TAG_SUPPORT = toStringTagSupport;
2229
+ var isCallable$1 = isCallable$f;
2230
+ var classofRaw = classofRaw$1;
2231
+ var wellKnownSymbol = wellKnownSymbol$8;
2232
+
2233
+ var TO_STRING_TAG = wellKnownSymbol('toStringTag');
2234
+ var Object$1 = global$3.Object;
2235
+
2236
+ // ES3 wrong here
2237
+ var CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';
2238
+
2239
+ // fallback for IE11 Script Access Denied error
2240
+ var tryGet = function (it, key) {
2241
+ try {
2242
+ return it[key];
2243
+ } catch (error) { /* empty */ }
2244
+ };
2245
+
2246
+ // getting tag from ES6+ `Object.prototype.toString`
2247
+ var classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {
2248
+ var O, tag, result;
2249
+ return it === undefined ? 'Undefined' : it === null ? 'Null'
2250
+ // @@toStringTag case
2251
+ : typeof (tag = tryGet(O = Object$1(it), TO_STRING_TAG)) == 'string' ? tag
2252
+ // builtinTag case
2253
+ : CORRECT_ARGUMENTS ? classofRaw(O)
2254
+ // ES3 arguments fallback
2255
+ : (result = classofRaw(O)) == 'Object' && isCallable$1(O.callee) ? 'Arguments' : result;
2256
+ };
2257
+
2258
+ var global$2 = global$r;
2259
+ var classof = classof$1;
2260
+
2261
+ var String$1 = global$2.String;
2262
+
2263
+ var toString$1 = function (argument) {
2264
+ if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');
2265
+ return String$1(argument);
2266
+ };
2267
+
2268
+ var $ = _export;
2269
+ var DESCRIPTORS = descriptors;
2270
+ var global$1 = global$r;
2271
+ var uncurryThis = functionUncurryThis;
2272
+ var hasOwn = hasOwnProperty_1;
2273
+ var isCallable = isCallable$f;
2274
+ var isPrototypeOf = objectIsPrototypeOf;
2275
+ var toString = toString$1;
2276
+ var defineProperty = objectDefineProperty.f;
2277
+ var copyConstructorProperties = copyConstructorProperties$2;
2278
+
2279
+ var NativeSymbol = global$1.Symbol;
2280
+ var SymbolPrototype = NativeSymbol && NativeSymbol.prototype;
2281
+
2282
+ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototype) ||
2283
+ // Safari 12 bug
2284
+ NativeSymbol().description !== undefined
2285
+ )) {
2286
+ var EmptyStringDescriptionStore = {};
2287
+ // wrap Symbol constructor for correct work with undefined description
2288
+ var SymbolWrapper = function Symbol() {
2289
+ var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString(arguments[0]);
2290
+ var result = isPrototypeOf(SymbolPrototype, this)
2291
+ ? new NativeSymbol(description)
2292
+ // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
2293
+ : description === undefined ? NativeSymbol() : NativeSymbol(description);
2294
+ if (description === '') EmptyStringDescriptionStore[result] = true;
2295
+ return result;
2296
+ };
2297
+
2298
+ copyConstructorProperties(SymbolWrapper, NativeSymbol);
2299
+ SymbolWrapper.prototype = SymbolPrototype;
2300
+ SymbolPrototype.constructor = SymbolWrapper;
2301
+
2302
+ var NATIVE_SYMBOL = String(NativeSymbol('test')) == 'Symbol(test)';
2303
+ var symbolToString = uncurryThis(SymbolPrototype.toString);
2304
+ var symbolValueOf = uncurryThis(SymbolPrototype.valueOf);
2305
+ var regexp = /^Symbol\((.*)\)[^)]+$/;
2306
+ var replace = uncurryThis(''.replace);
2307
+ var stringSlice = uncurryThis(''.slice);
2308
+
2309
+ defineProperty(SymbolPrototype, 'description', {
2310
+ configurable: true,
2311
+ get: function description() {
2312
+ var symbol = symbolValueOf(this);
2313
+ var string = symbolToString(symbol);
2314
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
2315
+ var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace(string, regexp, '$1');
2316
+ return desc === '' ? undefined : desc;
2317
+ }
2318
+ });
2319
+
2320
+ $({ global: true, forced: true }, {
2321
+ Symbol: SymbolWrapper
2322
+ });
2323
+ }
2324
+
2325
+ const RadioGroup = ({
2326
+ defaultSelected,
2327
+ description,
2328
+ title,
2329
+ validator,
2330
+ onChangeRadio,
2331
+ onChange,
2332
+ name,
2333
+ children
2334
+ }) => {
2335
+ const [checked, setChecked] = React.useState();
2336
+ const validatorClassName = validateClassName(validator === null || validator === void 0 ? void 0 : validator.indicator);
2337
+
2338
+ const onChanges = event => {
2339
+ setChecked(event.target.value);
2340
+ onChangeRadio && onChangeRadio(event.target.value);
2341
+ onChange && onChange(event);
2342
+ };
2343
+
2344
+ const radioBtnRef = React.useRef(null);
2345
+ React.useEffect(() => {
2346
+ var _a;
2347
+
2348
+ if (radioBtnRef && radioBtnRef.current) {
2349
+ if (defaultSelected) setChecked(defaultSelected);
2350
+ const form = (_a = radioBtnRef === null || radioBtnRef === void 0 ? void 0 : radioBtnRef.current) === null || _a === void 0 ? void 0 : _a.form;
2351
+
2352
+ const resetListner = () => {
2353
+ setChecked(undefined);
2354
+ };
2355
+
2356
+ form === null || form === void 0 ? void 0 : form.addEventListener('reset', resetListner);
2357
+ return () => form === null || form === void 0 ? void 0 : form.removeEventListener('reset', resetListner);
2358
+ } else {
2359
+ // eslint-disable-next-line @typescript-eslint/no-empty-function
2360
+ return () => {};
2361
+ }
2362
+ }, []);
2363
+ return jsxs("div", Object.assign({
2364
+ className: "form-group"
2365
+ }, {
2366
+ children: [jsxs("fieldset", Object.assign({
2367
+ className: validatorClassName
2368
+ }, {
2369
+ children: [title && jsx("legend", {
2370
+ children: title
2371
+ }), description && jsx("span", Object.assign({
2372
+ className: "form-info"
2373
+ }, {
2374
+ children: description
2375
+ })), jsx("div", {
2376
+ children: React.Children.map(children, Child => {
2377
+ return /*#__PURE__*/React.isValidElement(Child) ? /*#__PURE__*/React.cloneElement(Child, {
2378
+ validator: validatorClassName,
2379
+ onChange: onChanges,
2380
+ checked: checked === Child.props.value,
2381
+ name,
2382
+ ref: radioBtnRef
2383
+ }) : Child;
2384
+ })
2385
+ })]
2386
+ })), (validator === null || validator === void 0 ? void 0 : validator.message) && jsx("span", Object.assign({
2387
+ className: "form-info"
2388
+ }, {
2389
+ children: validator === null || validator === void 0 ? void 0 : validator.message
2390
+ }))]
2391
+ }));
2392
+ };
1998
2393
 
1999
2394
  const ListItem = _a => {
2000
2395
  var {
@@ -2009,15 +2404,15 @@ const ListItem = _a => {
2009
2404
  children: jsxs("div", {
2010
2405
  children: [jsx("dt", {
2011
2406
  children: tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.title
2012
- }, void 0), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map((item, index) => jsx("dd", {
2407
+ }), tableRowData === null || tableRowData === void 0 ? void 0 : tableRowData.definition.map((item, index) => jsx("dd", {
2013
2408
  children: item
2014
2409
  }, index))]
2015
- }, void 0)
2016
- }, void 0);
2410
+ })
2411
+ });
2017
2412
  } else {
2018
2413
  return jsx("li", Object.assign({}, props, {
2019
2414
  children: children
2020
- }), void 0);
2415
+ }));
2021
2416
  }
2022
2417
  };
2023
2418
 
@@ -2035,7 +2430,7 @@ const List = _a => {
2035
2430
  children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
2036
2431
  children: child
2037
2432
  }, index))
2038
- }), void 0);
2433
+ }));
2039
2434
  } else if (listType !== 'table') {
2040
2435
  return jsx("ul", Object.assign({}, props, {
2041
2436
  className: listType
@@ -2043,20 +2438,20 @@ const List = _a => {
2043
2438
  children: children === null || children === void 0 ? void 0 : children.map((child, index) => jsx(ListItem, {
2044
2439
  children: child
2045
2440
  }, index))
2046
- }), void 0);
2441
+ }));
2047
2442
  } else {
2048
2443
  return jsxs("figure", {
2049
2444
  children: [jsx("figcaption", Object.assign({
2050
2445
  className: "table-list-caption"
2051
2446
  }, {
2052
2447
  children: tableCaption
2053
- }), void 0), jsx("dl", {
2448
+ })), jsx("dl", {
2054
2449
  children: tableData === null || tableData === void 0 ? void 0 : tableData.map((data, index) => jsx(ListItem, {
2055
2450
  listType: listType,
2056
2451
  tableRowData: data
2057
2452
  }, index))
2058
- }, void 0)]
2059
- }, void 0);
2453
+ })]
2454
+ });
2060
2455
  }
2061
2456
  };
2062
2457
 
@@ -2078,7 +2473,7 @@ const Link = _a => {
2078
2473
  }, [button]);
2079
2474
  return jsx("a", Object.assign({}, anchorProps, {
2080
2475
  children: children
2081
- }), void 0);
2476
+ }));
2082
2477
  };
2083
2478
 
2084
2479
  const Navbar = ({
@@ -2105,7 +2500,7 @@ const Navbar = ({
2105
2500
  href: _brandLink,
2106
2501
  target: "_blank",
2107
2502
  className: "brand"
2108
- }, void 0), jsx("div", Object.assign({
2503
+ }), jsx("div", Object.assign({
2109
2504
  className: "container-fluid"
2110
2505
  }, {
2111
2506
  children: jsxs("div", Object.assign({
@@ -2120,22 +2515,424 @@ const Navbar = ({
2120
2515
  }, {
2121
2516
  children: jsx("h1", {
2122
2517
  children: title
2123
- }, void 0)
2124
- }), void 0) : jsx("h1", {
2518
+ })
2519
+ })) : jsx("h1", {
2125
2520
  children: title
2126
- }, void 0)
2127
- }), void 0), jsx("div", Object.assign({
2521
+ })
2522
+ })), jsx("div", Object.assign({
2128
2523
  className: "col-auto"
2129
2524
  }, {
2130
2525
  children: jsx("div", Object.assign({
2131
2526
  className: "group size-sm"
2132
2527
  }, {
2133
2528
  children: children
2134
- }), void 0)
2135
- }), void 0)]
2136
- }), void 0)
2137
- }), void 0)]
2138
- }), void 0);
2529
+ }))
2530
+ }))]
2531
+ }))
2532
+ }))]
2533
+ }));
2534
+ };
2535
+
2536
+ function Badge(_a) {
2537
+ var {
2538
+ children,
2539
+ badgeType,
2540
+ isCloseable,
2541
+ closeText,
2542
+ customColor,
2543
+ customBackgroundColor
2544
+ } = _a,
2545
+ props = __rest(_a, ["children", "badgeType", "isCloseable", "closeText", "customColor", "customBackgroundColor"]);
2546
+
2547
+ const [isClosed, setIsClosed] = React.useState(false);
2548
+ const [type, setType] = React.useState('');
2549
+ React.useEffect(() => {
2550
+ if (badgeType) {
2551
+ setType(badgeType);
2552
+ }
2553
+
2554
+ if (!!customColor || !!customBackgroundColor) {
2555
+ setType('');
2556
+ }
2557
+ }, []);
2558
+ return !isClosed ? jsxs("span", Object.assign({}, props, {
2559
+ className: `badge ${type}`,
2560
+ style: {
2561
+ color: customColor,
2562
+ backgroundColor: customBackgroundColor
2563
+ }
2564
+ }, {
2565
+ children: [jsx("strong", {
2566
+ children: children
2567
+ }), isCloseable && jsx("button", Object.assign({
2568
+ type: "button",
2569
+ className: "close",
2570
+ onClick: () => setIsClosed(true)
2571
+ }, {
2572
+ children: closeText
2573
+ }))]
2574
+ })) : null;
2575
+ }
2576
+
2577
+ const noop = () => {};
2578
+
2579
+ const useStepper = ({
2580
+ min,
2581
+ max,
2582
+ value: _value = 0,
2583
+ step: _step = 1,
2584
+ id: _id = randomId(),
2585
+ onChange
2586
+ }) => {
2587
+ const pStepper = {
2588
+ down: noop,
2589
+ setMax: noop,
2590
+ setMin: noop,
2591
+ setStep: noop,
2592
+ setValue: noop,
2593
+ up: noop
2594
+ };
2595
+ const [stepper, setStepper] = useState(pStepper);
2596
+ const [data, setData] = useState({
2597
+ id: _id,
2598
+ value: _value,
2599
+ min,
2600
+ max,
2601
+ step: _step
2602
+ });
2603
+ useEffect(() => {
2604
+ if (max !== data.max) stepper.setMax(max);
2605
+ }, [stepper, max]);
2606
+ useEffect(() => {
2607
+ if (min !== data.min) stepper.setMin(min);
2608
+ }, [stepper, min]);
2609
+ useEffect(() => {
2610
+ if (_step !== data.step) stepper.setStep(_step || 1);
2611
+ }, [stepper, _step]);
2612
+ useEffect(() => {
2613
+ if (_value !== data.value) stepper.setValue(_value || 0, false);
2614
+ }, [stepper, _value]);
2615
+ useEffect(() => {
2616
+ setStepper(createStepper({
2617
+ id: _id,
2618
+ value: _value,
2619
+ min,
2620
+ max,
2621
+ step: _step,
2622
+ onChange
2623
+ }, setData));
2624
+ }, []);
2625
+ return [stepper, data];
2626
+ };
2627
+
2628
+ function Stepper(_a) {
2629
+ var {
2630
+ label,
2631
+ description,
2632
+ statusMessage
2633
+ } = _a,
2634
+ stepperArgs = __rest(_a, ["label", "description", "statusMessage"]);
2635
+
2636
+ const [stepper, data] = useStepper(stepperArgs);
2637
+
2638
+ const onChangeEvent = e => {
2639
+ stepper.setValue(e.target.valueAsNumber);
2640
+ };
2641
+
2642
+ return jsxs("div", Object.assign({
2643
+ className: "form-group"
2644
+ }, {
2645
+ children: [label && jsx("label", Object.assign({
2646
+ htmlFor: data.id
2647
+ }, {
2648
+ children: label
2649
+ })), description && jsx("span", Object.assign({
2650
+ className: "form-info"
2651
+ }, {
2652
+ children: description
2653
+ })), jsxs("div", Object.assign({
2654
+ className: "group group-border group-stepper"
2655
+ }, {
2656
+ children: [jsx("button", Object.assign({
2657
+ onClick: () => stepper.down()
2658
+ }, {
2659
+ children: "-"
2660
+ })), jsx("input", {
2661
+ id: data.id,
2662
+ type: "number",
2663
+ onChange: onChangeEvent,
2664
+ onFocus: ({
2665
+ target
2666
+ }) => target.select(),
2667
+ placeholder: "0",
2668
+ value: data.value
2669
+ }), jsx("button", Object.assign({
2670
+ onClick: () => stepper.up()
2671
+ }, {
2672
+ children: "+"
2673
+ }))]
2674
+ })), statusMessage && jsx("span", Object.assign({
2675
+ className: "form-info"
2676
+ }, {
2677
+ children: statusMessage
2678
+ }))]
2679
+ }));
2680
+ }
2681
+
2682
+ const useDropdown = ({
2683
+ id,
2684
+ value,
2685
+ texts,
2686
+ options,
2687
+ loop,
2688
+ multiSelect,
2689
+ searchable,
2690
+ searchFilter,
2691
+ compareWith,
2692
+ useValue,
2693
+ display,
2694
+ togglerRef,
2695
+ listboxRef,
2696
+ onChange,
2697
+ validator
2698
+ }) => {
2699
+ const [handler, setHandler] = useState();
2700
+ const [dropdown, setDropdown] = useState();
2701
+ const [togglerProps, setTogglerProps] = useState({});
2702
+ const [listboxProps, setListboxProps] = useState({});
2703
+ const [listItems, setListItems] = useState([]);
2704
+ const [multiSelectProps, setMultiSelectProps] = useState({}); // When dropdown data changes
2705
+
2706
+ useEffect(() => {
2707
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2708
+
2709
+ if (!dropdown) return;
2710
+ const {
2711
+ elements: {
2712
+ toggler,
2713
+ listbox
2714
+ }
2715
+ } = dropdown;
2716
+ const newToggleProps = Object.assign(Object.assign({}, toggler === null || toggler === void 0 ? void 0 : toggler.attributes), {
2717
+ className: (_a = toggler === null || toggler === void 0 ? void 0 : toggler.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2718
+ children: (_b = dropdown === null || dropdown === void 0 ? void 0 : dropdown.texts) === null || _b === void 0 ? void 0 : _b.select,
2719
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.toggle()
2720
+ });
2721
+ setTogglerProps(newToggleProps);
2722
+ const newListboxProps = Object.assign(Object.assign({}, listbox === null || listbox === void 0 ? void 0 : listbox.attributes), {
2723
+ className: (_c = listbox === null || listbox === void 0 ? void 0 : listbox.classes) === null || _c === void 0 ? void 0 : _c.join(' ')
2724
+ });
2725
+ setListboxProps(newListboxProps);
2726
+
2727
+ if (!dropdown.isMultiSelect) {
2728
+ const newListItems = dropdown.options.map(o => {
2729
+ var _a;
2730
+
2731
+ return Object.assign(Object.assign({}, o.attributes), {
2732
+ className: (_a = o.classes) === null || _a === void 0 ? void 0 : _a.join(' '),
2733
+ children: o[dropdown.display],
2734
+ selected: o.selected,
2735
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o)
2736
+ });
2737
+ });
2738
+ setListItems(newListItems);
2739
+ } else {
2740
+ const checkboxes = dropdown.options.map(o => ({
2741
+ labelProps: Object.assign(Object.assign({}, o.attributes), {
2742
+ className: ['form-control', ...o.classes].join(' ')
2743
+ }),
2744
+ inputProps: {
2745
+ defaultChecked: o.selected,
2746
+ type: 'checkbox',
2747
+ onClick: () => handler === null || handler === void 0 ? void 0 : handler.select(o, false)
2748
+ },
2749
+ spanProps: {
2750
+ children: o[dropdown.display]
2751
+ }
2752
+ }));
2753
+ const newMultiselect = {
2754
+ fieldsetProps: {
2755
+ '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,
2756
+ 'aria-multiselectable': true,
2757
+ role: 'listbox',
2758
+ tabIndex: -1
2759
+ },
2760
+ legendProps: {
2761
+ className: 'sr-only',
2762
+ 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,
2763
+ children: dropdown.texts.optionsDescription
2764
+ },
2765
+ checkboxes
2766
+ };
2767
+ setMultiSelectProps(newMultiselect);
2768
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
2769
+
2770
+ }, [dropdown]); // When dropdown properties change
2771
+
2772
+ useEffect(() => {
2773
+ if (!dropdown) return;
2774
+ handler === null || handler === void 0 ? void 0 : handler.update({
2775
+ id,
2776
+ value,
2777
+ texts,
2778
+ options,
2779
+ loop,
2780
+ multiSelect,
2781
+ searchable,
2782
+ searchFilter,
2783
+ compareWith,
2784
+ useValue,
2785
+ display,
2786
+ validator
2787
+ }); // eslint-disable-next-line react-hooks/exhaustive-deps
2788
+ }, [id, texts, options, loop, multiSelect, searchable, searchFilter, compareWith, useValue, display]);
2789
+ useEffect(() => {
2790
+ if (!dropdown) return;
2791
+ handler === null || handler === void 0 ? void 0 : handler.selectByValue(value);
2792
+ console.log('new value'); // eslint-disable-next-line react-hooks/exhaustive-deps
2793
+ }, [value]); // When validator changes
2794
+
2795
+ useEffect(() => {
2796
+ if (!dropdown) return;
2797
+ if (validator) handler === null || handler === void 0 ? void 0 : handler.validate(validator); // eslint-disable-next-line react-hooks/exhaustive-deps
2798
+ }, [validator]); // Create dropdown handler
2799
+
2800
+ useEffect(() => {
2801
+ if (!handler && togglerRef.current && listboxRef.current) {
2802
+ setHandler(createDropdown({
2803
+ id,
2804
+ value,
2805
+ texts,
2806
+ options,
2807
+ loop,
2808
+ multiSelect,
2809
+ searchable,
2810
+ searchFilter,
2811
+ compareWith,
2812
+ useValue,
2813
+ display,
2814
+ validator
2815
+ }, togglerRef.current, listboxRef.current, listboxRef.current, dd => setDropdown(dd), value => onChange === null || onChange === void 0 ? void 0 : onChange(value)));
2816
+ }
2817
+
2818
+ return () => handler === null || handler === void 0 ? void 0 : handler.destroy(); // eslint-disable-next-line react-hooks/exhaustive-deps
2819
+ }, [togglerRef, listboxRef]);
2820
+ return {
2821
+ dropdown: handler,
2822
+ togglerProps,
2823
+ listboxProps,
2824
+ listItems,
2825
+ multiSelectProps
2826
+ };
2827
+ };
2828
+
2829
+ const Dropdown = ({
2830
+ compareWith,
2831
+ display,
2832
+ id,
2833
+ informationLabel,
2834
+ label,
2835
+ loop,
2836
+ multiSelect,
2837
+ onChange,
2838
+ options,
2839
+ searchFilter,
2840
+ searchable,
2841
+ texts,
2842
+ useValue,
2843
+ validator,
2844
+ value
2845
+ }) => {
2846
+ var _a;
2847
+
2848
+ const togglerRef = useRef(null);
2849
+ const listboxRef = useRef(null);
2850
+ const {
2851
+ dropdown,
2852
+ listboxProps,
2853
+ togglerProps,
2854
+ listItems,
2855
+ multiSelectProps
2856
+ } = useDropdown({
2857
+ id,
2858
+ value,
2859
+ options,
2860
+ loop,
2861
+ multiSelect,
2862
+ searchable,
2863
+ searchFilter,
2864
+ compareWith,
2865
+ useValue,
2866
+ display,
2867
+ togglerRef,
2868
+ listboxRef,
2869
+ texts,
2870
+ onChange,
2871
+ validator
2872
+ });
2873
+
2874
+ const getListBoxProps = props => {
2875
+ var _a, _b, _c;
2876
+
2877
+ if (Object.keys(props).length === 0) return {
2878
+ role: 'listbox',
2879
+ tabIndex: -1,
2880
+ 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(' ')
2881
+ };
2882
+ return props;
2883
+ };
2884
+
2885
+ return jsxs("div", Object.assign({
2886
+ className: "form-group"
2887
+ }, {
2888
+ children: [label && jsx("label", {
2889
+ children: label
2890
+ }), informationLabel && jsx("div", Object.assign({
2891
+ className: "form-info"
2892
+ }, {
2893
+ children: informationLabel
2894
+ })), jsx("button", Object.assign({
2895
+ type: "button"
2896
+ }, togglerProps, {
2897
+ ref: togglerRef
2898
+ }, {
2899
+ children: jsx("span", {
2900
+ children: togglerProps.children
2901
+ })
2902
+ })), jsxs("div", Object.assign({}, getListBoxProps(listboxProps), {
2903
+ ref: listboxRef
2904
+ }, {
2905
+ children: [jsxs("button", Object.assign({
2906
+ type: "button",
2907
+ className: "close m-4 m-sm-2 d-block d-sm-none",
2908
+ onClick: dropdown === null || dropdown === void 0 ? void 0 : dropdown.close
2909
+ }, {
2910
+ children: [jsx("span", Object.assign({
2911
+ className: "sr-only"
2912
+ }, {
2913
+ children: dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.texts.close
2914
+ })), jsx("i", {})]
2915
+ })), (dropdown === null || dropdown === void 0 ? void 0 : dropdown.dropdown.isMultiSelect) ? jsx("div", Object.assign({
2916
+ className: "sg-fieldset-container"
2917
+ }, {
2918
+ children: jsxs("fieldset", Object.assign({}, multiSelectProps.fieldsetProps, {
2919
+ children: [jsx("legend", Object.assign({}, multiSelectProps.legendProps)), jsx("div", {
2920
+ children: (_a = multiSelectProps.checkboxes) === null || _a === void 0 ? void 0 : _a.map(checkboxItem => jsxs("label", Object.assign({}, checkboxItem.labelProps, {
2921
+ children: [jsx("input", Object.assign({}, checkboxItem.inputProps)), jsx("span", Object.assign({}, checkboxItem.spanProps)), jsx("i", {})]
2922
+ }), checkboxItem.labelProps.id))
2923
+ })]
2924
+ }))
2925
+ })) : jsx("ul", Object.assign({
2926
+ role: "listbox"
2927
+ }, {
2928
+ children: listItems.map(liProps => jsx("li", Object.assign({}, liProps), liProps.id))
2929
+ }))]
2930
+ })), validator && jsx("span", Object.assign({
2931
+ className: "form-info"
2932
+ }, {
2933
+ children: validator === null || validator === void 0 ? void 0 : validator.message
2934
+ }))]
2935
+ }));
2139
2936
  };
2140
2937
 
2141
- export { Alert, Button, ButtonGroup, Card, Checkbox, EmailInput, Flexbox, Form, Group, Link, List, Modal, Navbar, NumberInput, Text, TextInput };
2938
+ export { Alert, Badge, Button, ButtonGroup, Card, Checkbox, Dropdown, EmailInput, Flexbox, Form, FormItems, Group, Link, List, Modal, Navbar, NumberInput, RadioButton, RadioGroup, RenderInput, Stepper, Text, TextInput };