@cypress-design/react-statusicon 0.4.6 → 0.4.8

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/dist/index.umd.js CHANGED
@@ -39,7 +39,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
39
39
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
40
40
  PERFORMANCE OF THIS SOFTWARE.
41
41
  ***************************************************************************** */
42
- /* global Reflect, Promise */
42
+ /* global Reflect, Promise, SuppressedError, Symbol */
43
43
 
44
44
 
45
45
  var __assign$1 = function() {
@@ -73,7 +73,12 @@ function __spreadArray(to, from, pack) {
73
73
  }
74
74
  }
75
75
  return to.concat(ar || Array.prototype.slice.call(from));
76
- }
76
+ }
77
+
78
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
79
+ var e = new Error(message);
80
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
81
+ };
77
82
 
78
83
  /**
79
84
  * This "const" is used to create the list of statuses
@@ -439,7 +444,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
439
444
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
440
445
  PERFORMANCE OF THIS SOFTWARE.
441
446
  ***************************************************************************** */
442
- /* global Reflect, Promise */
447
+ /* global Reflect, Promise, SuppressedError, Symbol */
443
448
 
444
449
 
445
450
  var __assign = function() {
@@ -463,10 +468,15 @@ function __rest(s, e) {
463
468
  t[p[i]] = s[p[i]];
464
469
  }
465
470
  return t;
466
- }
471
+ }
472
+
473
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
474
+ var e = new Error(message);
475
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
476
+ };
467
477
 
468
478
  var compileReactIconProperties = function (_a) {
469
- var body = _a.body, compiledClasses = _a.compiledClasses, size = _a.size, attributes = __rest(_a, ["body", "compiledClasses", "size"]);
479
+ var body = _a.body, defs = _a.defs, compiledClasses = _a.compiledClasses, size = _a.size, name = _a.name, attributes = __rest(_a, ["body", "defs", "compiledClasses", "size", "name"]);
470
480
  var filteredAttributes = Object.keys(attributes).reduce(function (newAttributes, attrName) {
471
481
  if (!iconsRegistry.ICON_COLOR_PROP_NAMES.includes(attrName) &&
472
482
  attrName !== 'name') {
@@ -477,6 +487,20 @@ var compileReactIconProperties = function (_a) {
477
487
  }
478
488
  return newAttributes;
479
489
  }, {});
490
+ React__namespace.useEffect(function () {
491
+ var iconFileId = "".concat(name, "_").concat(size);
492
+ if (defs) {
493
+ if (document.querySelector("[data-cy-svg-defs=\"".concat(iconFileId, "\"]"))) {
494
+ return;
495
+ }
496
+ var svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
497
+ svgElement.setAttribute('data-cy-svg-defs', iconFileId);
498
+ svgElement.setAttribute('width', '0');
499
+ svgElement.setAttribute('height', '0');
500
+ svgElement.innerHTML = defs;
501
+ document.body.appendChild(svgElement);
502
+ }
503
+ }, [defs]);
480
504
  var componentProps = __assign({ width: size, height: size, viewBox: "0 0 ".concat(size, " ").concat(size), fill: 'none', dangerouslySetInnerHTML: {
481
505
  __html: body,
482
506
  }, className: undefined }, filteredAttributes);
@@ -490,10 +514,10 @@ var compileReactIconProperties = function (_a) {
490
514
  };
491
515
 
492
516
 
493
- /* <wind-keep class="filter"> */
517
+ /* <wind-keep class="filter icon-light-secondary icon-dark-secondary"> */
494
518
 
495
519
  var compileProps = function (_a) {
496
- var status = _a.status, statuses = _a.statuses, className = _a.className, size = _a.size;
520
+ var status = _a.status, statuses = _a.statuses, className = _a.className, size = _a.size, variantName = _a.variantName;
497
521
  var statusInfo = status ? statuses[status] : statuses.placeholder;
498
522
  var iconInfo = status ? statuses$3[status] : statuses$3.placeholder;
499
523
  var iconData = statusInfo["size".concat(size, "Icon")].data;
@@ -508,6 +532,7 @@ var compileProps = function (_a) {
508
532
  body: iconData,
509
533
  compiledClasses: __spreadArray(__spreadArray([], compiledClasses, true), [classes], false),
510
534
  size: size,
535
+ name: "status_".concat(status, "_").concat(size, "_").concat(variantName),
511
536
  });
512
537
  };
513
538
 
@@ -518,6 +543,7 @@ var OutlineStatusIcon = function (_a) {
518
543
  statuses: statuses$2,
519
544
  className: rest.className,
520
545
  size: size,
546
+ variantName: 'outline',
521
547
  })));
522
548
  };
523
549
 
@@ -528,6 +554,7 @@ var SimpleStatusIcon = function (_a) {
528
554
  statuses: statuses$1,
529
555
  className: rest.className,
530
556
  size: size,
557
+ variantName: 'simple',
531
558
  })));
532
559
  };
533
560
 
@@ -538,6 +565,7 @@ var SolidStatusIcon = function (_a) {
538
565
  statuses: statuses,
539
566
  className: rest.className,
540
567
  size: size,
568
+ variantName: 'solid',
541
569
  })));
542
570
  };
543
571
 
@@ -558,4 +586,4 @@ exports.SolidStatusIcon = SolidStatusIcon;
558
586
  exports.default = StatusIcon;
559
587
  //# sourceMappingURL=index.umd.js.map
560
588
 
561
- /* <wind-keep class="outline inline-block"> */
589
+ /* <wind-keep class="outline inline-block icon-dark-indigo-400 icon-light-gray-100 icon-dark-jade-400 icon-dark-red-400 icon-dark-gray-100 icon-dark-gray-300 icon-dark-orange-400 icon-dark-gray-400"> */