@sebgroup/green-react 2.3.0 → 2.5.0

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
@@ -2230,10 +2230,10 @@ $$8({ target: 'String', proto: true, forced: !correctIsRegExpLogic('includes') }
2230
2230
  * Copyright 2018 Google LLC
2231
2231
  * SPDX-License-Identifier: BSD-3-Clause
2232
2232
  */
2233
- const t=new Set(["children","localName","ref","style","className"]),e=new WeakMap,n=(t,n,s,i,o)=>{const l=null==o?void 0:o[n];void 0===l||s===i?null==s&&n in HTMLElement.prototype?t.removeAttribute(n):t[n]=s:((t,n,s)=>{let i=e.get(t);void 0===i&&e.set(t,i=new Map);let o=i.get(n);void 0!==s?void 0===o?(i.set(n,o={handleEvent:s}),t.addEventListener(n,o)):o.handleEvent=s:void 0!==o&&(i.delete(n),t.removeEventListener(n,o));})(t,l,s);},s=(t,e)=>{"function"==typeof t?t(e):t.current=e;};function i(e=window.React,i,o,l,d){let a,c,r;if(void 0===i){const t=e;(({tagName:c,elementClass:r,events:l,displayName:d}=t)),a=t.react;}else a=e,r=o,c=i;const h=a.Component,u=a.createElement,f=new Set(Object.keys(null!=l?l:{}));class v extends h{constructor(){super(...arguments),this.o=null;}t(t){if(null!==this.o)for(const e in this.i)n(this.o,e,this.props[e],t?t[e]:void 0,l);}componentDidMount(){var t;this.t(),null===(t=this.o)||void 0===t||t.removeAttribute("defer-hydration");}componentDidUpdate(t){this.t(t);}render(){const{_$Gl:e,...n}=this.props;this.h!==e&&(this.u=t=>{null!==e&&s(e,t),this.o=t,this.h=e;}),this.i={};const i={ref:this.u};for(const[e,s]of Object.entries(n))t.has(e)?i["className"===e?"class":e]=s:f.has(e)||e in r.prototype?this.i[e]=s:i[e]=s;return i.suppressHydrationWarning=!0,u(c,i)}}v.displayName=null!=d?d:r.name;const m=a.forwardRef(((t,e)=>u(v,{...t,_$Gl:e},null==t?void 0:t.children)));return m.displayName=v.displayName,m}
2233
+ const e=new Set(["children","localName","ref","style","className"]),n=new WeakMap,t=(e,t,l,o,a)=>{const s=a?.[t];void 0===s||l===o?(e[t]=l,null==l&&t in HTMLElement.prototype&&e.removeAttribute(t)):((e,t,l)=>{let o=n.get(e);void 0===o&&n.set(e,o=new Map);let a=o.get(t);void 0!==l?void 0===a?(o.set(t,a={handleEvent:l}),e.addEventListener(t,a)):a.handleEvent=l:void 0!==a&&(o.delete(t),e.removeEventListener(t,a));})(e,s,l);},l=({react:n,tagName:l,elementClass:o,events:a,displayName:s})=>{const c=new Set(Object.keys(a??{})),i=n.forwardRef(((s,i)=>{const r=n.useRef(null),d=n.useRef(null),f={},u={};for(const[n,t]of Object.entries(s))e.has(n)?f["className"===n?"class":n]=t:c.has(n)||n in o.prototype?u[n]=t:f[n]=t;return n.useLayoutEffect((()=>{if(null!==d.current){for(const e in u)t(d.current,e,s[e],r.current?r.current[e]:void 0,a);r.current=s;}})),n.useLayoutEffect((()=>{d.current?.removeAttribute("defer-hydration");}),[]),f.suppressHydrationWarning=!0,n.createElement(l,{...f,ref:n.useCallback((e=>{d.current=e,"function"==typeof i?i(e):null!==i&&(i.current=e);}),[i])})}));return i.displayName=s??o.name,i};
2234
2234
 
2235
2235
  registerTransitionalStyles();
2236
- const CoreDropdown = i({
2236
+ const CoreDropdown = l({
2237
2237
  tagName: getScopedTagName('gds-dropdown'),
2238
2238
  elementClass: GdsDropdown,
2239
2239
  events: {
@@ -2241,7 +2241,7 @@ const CoreDropdown = i({
2241
2241
  },
2242
2242
  react: React
2243
2243
  });
2244
- const CoreOption = i({
2244
+ const CoreOption = l({
2245
2245
  tagName: getScopedTagName('gds-option'),
2246
2246
  elementClass: GdsOption,
2247
2247
  react: React
@@ -2461,6 +2461,63 @@ const Datepicker = (options = {}) => {
2461
2461
  });
2462
2462
  };
2463
2463
 
2464
+ var anObject$6 = anObject$c;
2465
+
2466
+ // `RegExp.prototype.flags` getter implementation
2467
+ // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
2468
+ var regexpFlags = function () {
2469
+ var that = anObject$6(this);
2470
+ var result = '';
2471
+ if (that.hasIndices) result += 'd';
2472
+ if (that.global) result += 'g';
2473
+ if (that.ignoreCase) result += 'i';
2474
+ if (that.multiline) result += 'm';
2475
+ if (that.dotAll) result += 's';
2476
+ if (that.unicode) result += 'u';
2477
+ if (that.unicodeSets) result += 'v';
2478
+ if (that.sticky) result += 'y';
2479
+ return result;
2480
+ };
2481
+
2482
+ var call$8 = functionCall;
2483
+ var hasOwn$2 = hasOwnProperty_1;
2484
+ var isPrototypeOf$3 = objectIsPrototypeOf;
2485
+ var regExpFlags = regexpFlags;
2486
+
2487
+ var RegExpPrototype$1 = RegExp.prototype;
2488
+
2489
+ var regexpGetFlags = function (R) {
2490
+ var flags = R.flags;
2491
+ return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn$2(R, 'flags') && isPrototypeOf$3(RegExpPrototype$1, R)
2492
+ ? call$8(regExpFlags, R) : flags;
2493
+ };
2494
+
2495
+ var PROPER_FUNCTION_NAME = functionName.PROPER;
2496
+ var defineBuiltIn$2 = defineBuiltIn$6;
2497
+ var anObject$5 = anObject$c;
2498
+ var $toString = toString$4;
2499
+ var fails$3 = fails$g;
2500
+ var getRegExpFlags = regexpGetFlags;
2501
+
2502
+ var TO_STRING = 'toString';
2503
+ var RegExpPrototype = RegExp.prototype;
2504
+ var nativeToString = RegExpPrototype[TO_STRING];
2505
+
2506
+ var NOT_GENERIC = fails$3(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
2507
+ // FF44- RegExp#toString has a wrong name
2508
+ var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
2509
+
2510
+ // `RegExp.prototype.toString` method
2511
+ // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
2512
+ if (NOT_GENERIC || INCORRECT_NAME) {
2513
+ defineBuiltIn$2(RegExp.prototype, TO_STRING, function toString() {
2514
+ var R = anObject$5(this);
2515
+ var pattern = $toString(R.source);
2516
+ var flags = $toString(getRegExpFlags(R));
2517
+ return '/' + pattern + '/' + flags;
2518
+ }, { unsafe: true });
2519
+ }
2520
+
2464
2521
  function Button({
2465
2522
  children,
2466
2523
  variant,
@@ -2468,8 +2525,10 @@ function Button({
2468
2525
  disabled,
2469
2526
  active = false,
2470
2527
  type = 'button',
2471
- size
2528
+ size,
2529
+ testId
2472
2530
  }) {
2531
+ var _a;
2473
2532
  const props = {
2474
2533
  type,
2475
2534
  disabled
@@ -2480,7 +2539,14 @@ function Button({
2480
2539
  if (size) classNames.push(size);
2481
2540
  if (classNames.length) props.className = classNames.join(' ');
2482
2541
  if (onClick) props.onClick = onClick;
2483
- return jsx("button", Object.assign({}, props, {
2542
+ return variant == 'close' ? jsx("button", Object.assign({}, props, {
2543
+ "aria-label": (_a = children === null || children === void 0 ? void 0 : children.toString()) !== null && _a !== void 0 ? _a : 'Close',
2544
+ "data-testid": testId
2545
+ }, {
2546
+ children: jsx("i", {})
2547
+ })) : jsx("button", Object.assign({}, props, {
2548
+ "data-testid": testId
2549
+ }, {
2484
2550
  children: children
2485
2551
  }));
2486
2552
  }
@@ -2785,17 +2851,17 @@ var setSpecies$1 = function (CONSTRUCTOR_NAME) {
2785
2851
  }
2786
2852
  };
2787
2853
 
2788
- var isPrototypeOf$3 = objectIsPrototypeOf;
2854
+ var isPrototypeOf$2 = objectIsPrototypeOf;
2789
2855
 
2790
2856
  var $TypeError$5 = TypeError;
2791
2857
 
2792
2858
  var anInstance$1 = function (it, Prototype) {
2793
- if (isPrototypeOf$3(Prototype, it)) return it;
2859
+ if (isPrototypeOf$2(Prototype, it)) return it;
2794
2860
  throw new $TypeError$5('Incorrect invocation');
2795
2861
  };
2796
2862
 
2797
2863
  var uncurryThis$6 = functionUncurryThis;
2798
- var fails$3 = fails$g;
2864
+ var fails$2 = fails$g;
2799
2865
  var isCallable$5 = isCallable$l;
2800
2866
  var classof$1 = classof$4;
2801
2867
  var getBuiltIn$2 = getBuiltIn$7;
@@ -2839,7 +2905,7 @@ isConstructorLegacy.sham = true;
2839
2905
 
2840
2906
  // `IsConstructor` abstract operation
2841
2907
  // https://tc39.es/ecma262/#sec-isconstructor
2842
- var isConstructor$1 = !construct || fails$3(function () {
2908
+ var isConstructor$1 = !construct || fails$2(function () {
2843
2909
  var called;
2844
2910
  return isConstructorModern(isConstructorModern.call)
2845
2911
  || !isConstructorModern(Object)
@@ -2858,7 +2924,7 @@ var aConstructor$1 = function (argument) {
2858
2924
  throw new $TypeError$4(tryToString$2(argument) + ' is not a constructor');
2859
2925
  };
2860
2926
 
2861
- var anObject$6 = anObject$c;
2927
+ var anObject$4 = anObject$c;
2862
2928
  var aConstructor = aConstructor$1;
2863
2929
  var isNullOrUndefined$1 = isNullOrUndefined$4;
2864
2930
  var wellKnownSymbol$4 = wellKnownSymbol$g;
@@ -2868,20 +2934,20 @@ var SPECIES$1 = wellKnownSymbol$4('species');
2868
2934
  // `SpeciesConstructor` abstract operation
2869
2935
  // https://tc39.es/ecma262/#sec-speciesconstructor
2870
2936
  var speciesConstructor$1 = function (O, defaultConstructor) {
2871
- var C = anObject$6(O).constructor;
2937
+ var C = anObject$4(O).constructor;
2872
2938
  var S;
2873
- return C === undefined || isNullOrUndefined$1(S = anObject$6(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
2939
+ return C === undefined || isNullOrUndefined$1(S = anObject$4(C)[SPECIES$1]) ? defaultConstructor : aConstructor(S);
2874
2940
  };
2875
2941
 
2876
2942
  var NATIVE_BIND$1 = functionBindNative;
2877
2943
 
2878
2944
  var FunctionPrototype = Function.prototype;
2879
2945
  var apply$1 = FunctionPrototype.apply;
2880
- var call$8 = FunctionPrototype.call;
2946
+ var call$7 = FunctionPrototype.call;
2881
2947
 
2882
2948
  // eslint-disable-next-line es/no-reflect -- safe
2883
- var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$8.bind(apply$1) : function () {
2884
- return call$8.apply(apply$1, arguments);
2949
+ var functionApply = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND$1 ? call$7.bind(apply$1) : function () {
2950
+ return call$7.apply(apply$1, arguments);
2885
2951
  });
2886
2952
 
2887
2953
  var classofRaw = classofRaw$2;
@@ -2928,8 +2994,8 @@ var global$7 = global$k;
2928
2994
  var apply = functionApply;
2929
2995
  var bind$3 = functionBindContext;
2930
2996
  var isCallable$4 = isCallable$l;
2931
- var hasOwn$2 = hasOwnProperty_1;
2932
- var fails$2 = fails$g;
2997
+ var hasOwn$1 = hasOwnProperty_1;
2998
+ var fails$1 = fails$g;
2933
2999
  var html = html$2;
2934
3000
  var arraySlice = arraySlice$1;
2935
3001
  var createElement = documentCreateElement$2;
@@ -2949,13 +3015,13 @@ var queue$2 = {};
2949
3015
  var ONREADYSTATECHANGE = 'onreadystatechange';
2950
3016
  var $location, defer, channel, port;
2951
3017
 
2952
- fails$2(function () {
3018
+ fails$1(function () {
2953
3019
  // Deno throws a ReferenceError on `location` access without `--location` flag
2954
3020
  $location = global$7.location;
2955
3021
  });
2956
3022
 
2957
3023
  var run = function (id) {
2958
- if (hasOwn$2(queue$2, id)) {
3024
+ if (hasOwn$1(queue$2, id)) {
2959
3025
  var fn = queue$2[id];
2960
3026
  delete queue$2[id];
2961
3027
  fn();
@@ -3016,7 +3082,7 @@ if (!set || !clear) {
3016
3082
  isCallable$4(global$7.postMessage) &&
3017
3083
  !global$7.importScripts &&
3018
3084
  $location && $location.protocol !== 'file:' &&
3019
- !fails$2(globalPostMessageDefer)
3085
+ !fails$1(globalPostMessageDefer)
3020
3086
  ) {
3021
3087
  defer = globalPostMessageDefer;
3022
3088
  global$7.addEventListener('message', eventListener, false);
@@ -3255,8 +3321,8 @@ newPromiseCapability$2.f = function (C) {
3255
3321
  var $$7 = _export;
3256
3322
  var IS_NODE = engineIsNode;
3257
3323
  var global$3 = global$k;
3258
- var call$7 = functionCall;
3259
- var defineBuiltIn$2 = defineBuiltIn$6;
3324
+ var call$6 = functionCall;
3325
+ var defineBuiltIn$1 = defineBuiltIn$6;
3260
3326
  var setPrototypeOf = objectSetPrototypeOf;
3261
3327
  var setToStringTag = setToStringTag$3;
3262
3328
  var setSpecies = setSpecies$1;
@@ -3333,7 +3399,7 @@ var callReaction = function (reaction, state) {
3333
3399
  if (result === reaction.promise) {
3334
3400
  reject(new TypeError$1('Promise-chain cycle'));
3335
3401
  } else if (then = isThenable(result)) {
3336
- call$7(then, result, resolve, reject);
3402
+ call$6(then, result, resolve, reject);
3337
3403
  } else resolve(result);
3338
3404
  } else reject(value);
3339
3405
  } catch (error) {
@@ -3370,7 +3436,7 @@ var dispatchEvent = function (name, promise, reason) {
3370
3436
  };
3371
3437
 
3372
3438
  var onUnhandled = function (state) {
3373
- call$7(task, global$3, function () {
3439
+ call$6(task, global$3, function () {
3374
3440
  var promise = state.facade;
3375
3441
  var value = state.value;
3376
3442
  var IS_UNHANDLED = isUnhandled(state);
@@ -3393,7 +3459,7 @@ var isUnhandled = function (state) {
3393
3459
  };
3394
3460
 
3395
3461
  var onHandleUnhandled = function (state) {
3396
- call$7(task, global$3, function () {
3462
+ call$6(task, global$3, function () {
3397
3463
  var promise = state.facade;
3398
3464
  if (IS_NODE) {
3399
3465
  process.emit('rejectionHandled', promise);
@@ -3427,7 +3493,7 @@ var internalResolve = function (state, value, unwrap) {
3427
3493
  microtask(function () {
3428
3494
  var wrapper = { done: false };
3429
3495
  try {
3430
- call$7(then, value,
3496
+ call$6(then, value,
3431
3497
  bind$1(internalResolve, wrapper, state),
3432
3498
  bind$1(internalReject, wrapper, state)
3433
3499
  );
@@ -3451,7 +3517,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
3451
3517
  PromiseConstructor = function Promise(executor) {
3452
3518
  anInstance(this, PromisePrototype);
3453
3519
  aCallable$3(executor);
3454
- call$7(Internal, this);
3520
+ call$6(Internal, this);
3455
3521
  var state = getInternalPromiseState(this);
3456
3522
  try {
3457
3523
  executor(bind$1(internalResolve, state), bind$1(internalReject, state));
@@ -3478,7 +3544,7 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
3478
3544
 
3479
3545
  // `Promise.prototype.then` method
3480
3546
  // https://tc39.es/ecma262/#sec-promise.prototype.then
3481
- Internal.prototype = defineBuiltIn$2(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
3547
+ Internal.prototype = defineBuiltIn$1(PromisePrototype, 'then', function then(onFulfilled, onRejected) {
3482
3548
  var state = getInternalPromiseState(this);
3483
3549
  var reaction = newPromiseCapability$1(speciesConstructor(this, PromiseConstructor));
3484
3550
  state.parent = true;
@@ -3511,10 +3577,10 @@ if (FORCED_PROMISE_CONSTRUCTOR$4) {
3511
3577
 
3512
3578
  if (!NATIVE_PROMISE_SUBCLASSING) {
3513
3579
  // make `Promise#then` return a polyfilled `Promise` for native promise-based APIs
3514
- defineBuiltIn$2(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
3580
+ defineBuiltIn$1(NativePromisePrototype$1, 'then', function then(onFulfilled, onRejected) {
3515
3581
  var that = this;
3516
3582
  return new PromiseConstructor(function (resolve, reject) {
3517
- call$7(nativeThen, that, resolve, reject);
3583
+ call$6(nativeThen, that, resolve, reject);
3518
3584
  }).then(onFulfilled, onRejected);
3519
3585
  // https://github.com/zloirock/core-js/issues/640
3520
3586
  }, { unsafe: true });
@@ -3564,9 +3630,9 @@ var getIteratorMethod$2 = function (it) {
3564
3630
  || Iterators[classof(it)];
3565
3631
  };
3566
3632
 
3567
- var call$6 = functionCall;
3633
+ var call$5 = functionCall;
3568
3634
  var aCallable$2 = aCallable$8;
3569
- var anObject$5 = anObject$c;
3635
+ var anObject$3 = anObject$c;
3570
3636
  var tryToString$1 = tryToString$4;
3571
3637
  var getIteratorMethod$1 = getIteratorMethod$2;
3572
3638
 
@@ -3574,41 +3640,41 @@ var $TypeError$1 = TypeError;
3574
3640
 
3575
3641
  var getIterator$1 = function (argument, usingIterator) {
3576
3642
  var iteratorMethod = arguments.length < 2 ? getIteratorMethod$1(argument) : usingIterator;
3577
- if (aCallable$2(iteratorMethod)) return anObject$5(call$6(iteratorMethod, argument));
3643
+ if (aCallable$2(iteratorMethod)) return anObject$3(call$5(iteratorMethod, argument));
3578
3644
  throw new $TypeError$1(tryToString$1(argument) + ' is not iterable');
3579
3645
  };
3580
3646
 
3581
- var call$5 = functionCall;
3582
- var anObject$4 = anObject$c;
3647
+ var call$4 = functionCall;
3648
+ var anObject$2 = anObject$c;
3583
3649
  var getMethod = getMethod$3;
3584
3650
 
3585
3651
  var iteratorClose$1 = function (iterator, kind, value) {
3586
3652
  var innerResult, innerError;
3587
- anObject$4(iterator);
3653
+ anObject$2(iterator);
3588
3654
  try {
3589
3655
  innerResult = getMethod(iterator, 'return');
3590
3656
  if (!innerResult) {
3591
3657
  if (kind === 'throw') throw value;
3592
3658
  return value;
3593
3659
  }
3594
- innerResult = call$5(innerResult, iterator);
3660
+ innerResult = call$4(innerResult, iterator);
3595
3661
  } catch (error) {
3596
3662
  innerError = true;
3597
3663
  innerResult = error;
3598
3664
  }
3599
3665
  if (kind === 'throw') throw value;
3600
3666
  if (innerError) throw innerResult;
3601
- anObject$4(innerResult);
3667
+ anObject$2(innerResult);
3602
3668
  return value;
3603
3669
  };
3604
3670
 
3605
3671
  var bind = functionBindContext;
3606
- var call$4 = functionCall;
3607
- var anObject$3 = anObject$c;
3672
+ var call$3 = functionCall;
3673
+ var anObject$1 = anObject$c;
3608
3674
  var tryToString = tryToString$4;
3609
3675
  var isArrayIteratorMethod = isArrayIteratorMethod$1;
3610
3676
  var lengthOfArrayLike = lengthOfArrayLike$2;
3611
- var isPrototypeOf$2 = objectIsPrototypeOf;
3677
+ var isPrototypeOf$1 = objectIsPrototypeOf;
3612
3678
  var getIterator = getIterator$1;
3613
3679
  var getIteratorMethod = getIteratorMethod$2;
3614
3680
  var iteratorClose = iteratorClose$1;
@@ -3638,7 +3704,7 @@ var iterate$2 = function (iterable, unboundFunction, options) {
3638
3704
 
3639
3705
  var callFn = function (value) {
3640
3706
  if (AS_ENTRIES) {
3641
- anObject$3(value);
3707
+ anObject$1(value);
3642
3708
  return INTERRUPTED ? fn(value[0], value[1], stop) : fn(value[0], value[1]);
3643
3709
  } return INTERRUPTED ? fn(value, stop) : fn(value);
3644
3710
  };
@@ -3654,20 +3720,20 @@ var iterate$2 = function (iterable, unboundFunction, options) {
3654
3720
  if (isArrayIteratorMethod(iterFn)) {
3655
3721
  for (index = 0, length = lengthOfArrayLike(iterable); length > index; index++) {
3656
3722
  result = callFn(iterable[index]);
3657
- if (result && isPrototypeOf$2(ResultPrototype, result)) return result;
3723
+ if (result && isPrototypeOf$1(ResultPrototype, result)) return result;
3658
3724
  } return new Result(false);
3659
3725
  }
3660
3726
  iterator = getIterator(iterable, iterFn);
3661
3727
  }
3662
3728
 
3663
3729
  next = IS_RECORD ? iterable.next : iterator.next;
3664
- while (!(step = call$4(next, iterator)).done) {
3730
+ while (!(step = call$3(next, iterator)).done) {
3665
3731
  try {
3666
3732
  result = callFn(step.value);
3667
3733
  } catch (error) {
3668
3734
  iteratorClose(iterator, 'throw', error);
3669
3735
  }
3670
- if (typeof result == 'object' && result && isPrototypeOf$2(ResultPrototype, result)) return result;
3736
+ if (typeof result == 'object' && result && isPrototypeOf$1(ResultPrototype, result)) return result;
3671
3737
  } return new Result(false);
3672
3738
  };
3673
3739
 
@@ -3721,7 +3787,7 @@ var promiseStaticsIncorrectIteration = FORCED_PROMISE_CONSTRUCTOR$3 || !checkCor
3721
3787
  });
3722
3788
 
3723
3789
  var $$6 = _export;
3724
- var call$3 = functionCall;
3790
+ var call$2 = functionCall;
3725
3791
  var aCallable$1 = aCallable$8;
3726
3792
  var newPromiseCapabilityModule$2 = newPromiseCapability$2;
3727
3793
  var perform$1 = perform$3;
@@ -3745,7 +3811,7 @@ $$6({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
3745
3811
  var index = counter++;
3746
3812
  var alreadyCalled = false;
3747
3813
  remaining++;
3748
- call$3($promiseResolve, C, promise).then(function (value) {
3814
+ call$2($promiseResolve, C, promise).then(function (value) {
3749
3815
  if (alreadyCalled) return;
3750
3816
  alreadyCalled = true;
3751
3817
  values[index] = value;
@@ -3764,7 +3830,7 @@ var FORCED_PROMISE_CONSTRUCTOR$2 = promiseConstructorDetection.CONSTRUCTOR;
3764
3830
  var NativePromiseConstructor = promiseNativeConstructor;
3765
3831
  var getBuiltIn$1 = getBuiltIn$7;
3766
3832
  var isCallable$1 = isCallable$l;
3767
- var defineBuiltIn$1 = defineBuiltIn$6;
3833
+ var defineBuiltIn = defineBuiltIn$6;
3768
3834
 
3769
3835
  var NativePromisePrototype = NativePromiseConstructor && NativePromiseConstructor.prototype;
3770
3836
 
@@ -3780,12 +3846,12 @@ $$5({ target: 'Promise', proto: true, forced: FORCED_PROMISE_CONSTRUCTOR$2, real
3780
3846
  if (isCallable$1(NativePromiseConstructor)) {
3781
3847
  var method = getBuiltIn$1('Promise').prototype['catch'];
3782
3848
  if (NativePromisePrototype['catch'] !== method) {
3783
- defineBuiltIn$1(NativePromisePrototype, 'catch', method, { unsafe: true });
3849
+ defineBuiltIn(NativePromisePrototype, 'catch', method, { unsafe: true });
3784
3850
  }
3785
3851
  }
3786
3852
 
3787
3853
  var $$4 = _export;
3788
- var call$2 = functionCall;
3854
+ var call$1 = functionCall;
3789
3855
  var aCallable = aCallable$8;
3790
3856
  var newPromiseCapabilityModule$1 = newPromiseCapability$2;
3791
3857
  var perform = perform$3;
@@ -3802,7 +3868,7 @@ $$4({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
3802
3868
  var result = perform(function () {
3803
3869
  var $promiseResolve = aCallable(C.resolve);
3804
3870
  iterate(iterable, function (promise) {
3805
- call$2($promiseResolve, C, promise).then(capability.resolve, reject);
3871
+ call$1($promiseResolve, C, promise).then(capability.resolve, reject);
3806
3872
  });
3807
3873
  });
3808
3874
  if (result.error) reject(result.value);
@@ -3811,7 +3877,7 @@ $$4({ target: 'Promise', stat: true, forced: PROMISE_STATICS_INCORRECT_ITERATION
3811
3877
  });
3812
3878
 
3813
3879
  var $$3 = _export;
3814
- var call$1 = functionCall;
3880
+ var call = functionCall;
3815
3881
  var newPromiseCapabilityModule = newPromiseCapability$2;
3816
3882
  var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
3817
3883
 
@@ -3820,17 +3886,17 @@ var FORCED_PROMISE_CONSTRUCTOR$1 = promiseConstructorDetection.CONSTRUCTOR;
3820
3886
  $$3({ target: 'Promise', stat: true, forced: FORCED_PROMISE_CONSTRUCTOR$1 }, {
3821
3887
  reject: function reject(r) {
3822
3888
  var capability = newPromiseCapabilityModule.f(this);
3823
- call$1(capability.reject, undefined, r);
3889
+ call(capability.reject, undefined, r);
3824
3890
  return capability.promise;
3825
3891
  }
3826
3892
  });
3827
3893
 
3828
- var anObject$2 = anObject$c;
3894
+ var anObject = anObject$c;
3829
3895
  var isObject = isObject$9;
3830
3896
  var newPromiseCapability = newPromiseCapability$2;
3831
3897
 
3832
3898
  var promiseResolve$1 = function (C, x) {
3833
- anObject$2(C);
3899
+ anObject(C);
3834
3900
  if (isObject(x) && x.constructor === C) return x;
3835
3901
  var promiseCapability = newPromiseCapability.f(C);
3836
3902
  var resolve = promiseCapability.resolve;
@@ -4119,9 +4185,9 @@ var $$1 = _export;
4119
4185
  var DESCRIPTORS = descriptors;
4120
4186
  var global$2 = global$k;
4121
4187
  var uncurryThis$2 = functionUncurryThis;
4122
- var hasOwn$1 = hasOwnProperty_1;
4188
+ var hasOwn = hasOwnProperty_1;
4123
4189
  var isCallable = isCallable$l;
4124
- var isPrototypeOf$1 = objectIsPrototypeOf;
4190
+ var isPrototypeOf = objectIsPrototypeOf;
4125
4191
  var toString$2 = toString$4;
4126
4192
  var defineBuiltInAccessor = defineBuiltInAccessor$2;
4127
4193
  var copyConstructorProperties = copyConstructorProperties$2;
@@ -4137,7 +4203,7 @@ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototy
4137
4203
  // wrap Symbol constructor for correct work with undefined description
4138
4204
  var SymbolWrapper = function Symbol() {
4139
4205
  var description = arguments.length < 1 || arguments[0] === undefined ? undefined : toString$2(arguments[0]);
4140
- var result = isPrototypeOf$1(SymbolPrototype, this)
4206
+ var result = isPrototypeOf(SymbolPrototype, this)
4141
4207
  ? new NativeSymbol(description)
4142
4208
  // in Edge 13, String(Symbol(undefined)) === 'Symbol(undefined)'
4143
4209
  : description === undefined ? NativeSymbol() : NativeSymbol(description);
@@ -4160,7 +4226,7 @@ if (DESCRIPTORS && isCallable(NativeSymbol) && (!('description' in SymbolPrototy
4160
4226
  configurable: true,
4161
4227
  get: function description() {
4162
4228
  var symbol = thisSymbolValue(this);
4163
- if (hasOwn$1(EmptyStringDescriptionStore, symbol)) return '';
4229
+ if (hasOwn(EmptyStringDescriptionStore, symbol)) return '';
4164
4230
  var string = symbolDescriptiveString(symbol);
4165
4231
  var desc = NATIVE_SYMBOL ? stringSlice(string, 7, -1) : replace$1(string, regexp, '$1');
4166
4232
  return desc === '' ? undefined : desc;
@@ -4665,63 +4731,6 @@ const OptionGroup = ({
4665
4731
  }));
4666
4732
  };
4667
4733
 
4668
- var anObject$1 = anObject$c;
4669
-
4670
- // `RegExp.prototype.flags` getter implementation
4671
- // https://tc39.es/ecma262/#sec-get-regexp.prototype.flags
4672
- var regexpFlags = function () {
4673
- var that = anObject$1(this);
4674
- var result = '';
4675
- if (that.hasIndices) result += 'd';
4676
- if (that.global) result += 'g';
4677
- if (that.ignoreCase) result += 'i';
4678
- if (that.multiline) result += 'm';
4679
- if (that.dotAll) result += 's';
4680
- if (that.unicode) result += 'u';
4681
- if (that.unicodeSets) result += 'v';
4682
- if (that.sticky) result += 'y';
4683
- return result;
4684
- };
4685
-
4686
- var call = functionCall;
4687
- var hasOwn = hasOwnProperty_1;
4688
- var isPrototypeOf = objectIsPrototypeOf;
4689
- var regExpFlags = regexpFlags;
4690
-
4691
- var RegExpPrototype$1 = RegExp.prototype;
4692
-
4693
- var regexpGetFlags = function (R) {
4694
- var flags = R.flags;
4695
- return flags === undefined && !('flags' in RegExpPrototype$1) && !hasOwn(R, 'flags') && isPrototypeOf(RegExpPrototype$1, R)
4696
- ? call(regExpFlags, R) : flags;
4697
- };
4698
-
4699
- var PROPER_FUNCTION_NAME = functionName.PROPER;
4700
- var defineBuiltIn = defineBuiltIn$6;
4701
- var anObject = anObject$c;
4702
- var $toString = toString$4;
4703
- var fails$1 = fails$g;
4704
- var getRegExpFlags = regexpGetFlags;
4705
-
4706
- var TO_STRING = 'toString';
4707
- var RegExpPrototype = RegExp.prototype;
4708
- var nativeToString = RegExpPrototype[TO_STRING];
4709
-
4710
- var NOT_GENERIC = fails$1(function () { return nativeToString.call({ source: 'a', flags: 'b' }) !== '/a/b'; });
4711
- // FF44- RegExp#toString has a wrong name
4712
- var INCORRECT_NAME = PROPER_FUNCTION_NAME && nativeToString.name !== TO_STRING;
4713
-
4714
- // `RegExp.prototype.toString` method
4715
- // https://tc39.es/ecma262/#sec-regexp.prototype.tostring
4716
- if (NOT_GENERIC || INCORRECT_NAME) {
4717
- defineBuiltIn(RegExp.prototype, TO_STRING, function toString() {
4718
- var R = anObject(this);
4719
- var pattern = $toString(R.source);
4720
- var flags = $toString(getRegExpFlags(R));
4721
- return '/' + pattern + '/' + flags;
4722
- }, { unsafe: true });
4723
- }
4724
-
4725
4734
  const InputWrapper = ({
4726
4735
  children,
4727
4736
  unitLabel
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@sebgroup/green-react",
3
- "version": "2.3.0",
3
+ "version": "2.5.0",
4
4
  "peerDependencies": {
5
5
  "react": "^17 || ^18",
6
6
  "react-dom": "^17 || ^18"
7
7
  },
8
8
  "dependencies": {
9
- "@sebgroup/green-core": "^1.1.0",
9
+ "@sebgroup/green-core": "^1.2.0",
10
10
  "@sebgroup/chlorophyll": "^2.2.1",
11
- "@sebgroup/extract": "^2.0.0",
11
+ "@sebgroup/extract": "^2.1.0",
12
12
  "classnames": "^2.3.2"
13
13
  },
14
14
  "description": "React components built on top of @sebgroup/chlorophyll.",
@@ -0,0 +1,8 @@
1
+ import { GdsContextMenu, GdsMenuItem } from '@sebgroup/green-core';
2
+ export declare const ContextMenu: import("@lit/react").ReactWebComponent<GdsContextMenu, {
3
+ onMenuItemClick: string;
4
+ onUiStateChange: string;
5
+ }>;
6
+ export declare const MenuItem: import("@lit/react").ReactWebComponent<GdsMenuItem, {
7
+ onMenuItemClick: string;
8
+ }>;
@@ -38,10 +38,10 @@ export interface DropdownOption {
38
38
  selected?: boolean;
39
39
  [key: string]: any;
40
40
  }
41
- export declare const CoreDropdown: import("@lit-labs/react").ReactWebComponent<GdsDropdown<any>, {
41
+ export declare const CoreDropdown: import("@lit/react").ReactWebComponent<GdsDropdown<any>, {
42
42
  onchange: string;
43
43
  }>;
44
- export declare const CoreOption: import("@lit-labs/react").ReactWebComponent<GdsOption, {}>;
44
+ export declare const CoreOption: import("@lit/react").ReactWebComponent<GdsOption, {}>;
45
45
  export interface DropdownProps extends DropdownArgs {
46
46
  onChange?: OnChange;
47
47
  }
@@ -8,6 +8,7 @@ export interface ButtonProps {
8
8
  onClick?: MouseEventHandler<HTMLButtonElement>;
9
9
  disabled?: boolean;
10
10
  size?: ButtonSize;
11
+ testId?: string;
11
12
  }
12
- export declare function Button({ children, variant, onClick, disabled, active, type, size }: ButtonProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function Button({ children, variant, onClick, disabled, active, type, size, testId }: ButtonProps): import("react/jsx-runtime").JSX.Element;
13
14
  export default Button;