@cypress-design/react-statusicon 1.0.0 → 1.0.2
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/.turbo/turbo-build.log +3 -1
- package/CHANGELOG.md +15 -0
- package/dist/index.es.mjs +16 -107
- package/dist/index.es.mjs.map +1 -1
- package/dist/index.umd.js +213 -304
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
- package/rollup.config.mjs +5 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
$ yarn build:module && yarn build:types
|
|
2
2
|
$ rollup -c ./rollup.config.mjs
|
|
3
|
+
(node:4229) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
|
|
4
|
+
(Use `node --trace-warnings ...` to show where the warning was created)
|
|
3
5
|
[36m
|
|
4
6
|
[1m./index.ts[22m → [1m./dist/index.umd.js, ./dist/index.es.mjs[22m...[39m
|
|
5
7
|
[1m[33m(!) Mixing named and default exports[39m[22m
|
|
@@ -8,5 +10,5 @@ $ rollup -c ./rollup.config.mjs
|
|
|
8
10
|
index.ts
|
|
9
11
|
|
|
10
12
|
Consumers of your bundle will have to use chunk.default to access their default export, which may not be what you want. Use `output.exports: "named"` to disable this warning.
|
|
11
|
-
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [
|
|
13
|
+
[32mcreated [1m./dist/index.umd.js, ./dist/index.es.mjs[22m in [1m12.4s[22m[39m
|
|
12
14
|
$ tsc --project ./tsconfig.build.json
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @cypress-design/react-statusicon
|
|
2
2
|
|
|
3
|
+
## 1.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#454](https://github.com/cypress-io/cypress-design/pull/454) [`48a3f6c`](https://github.com/cypress-io/cypress-design/commit/48a3f6cc5957844de2a5164137a8cedc31abe673) Thanks [@elevatebart](https://github.com/elevatebart)! - make sure the constant packages roll up in the react components for tailwind class detection
|
|
8
|
+
|
|
9
|
+
## 1.0.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#450](https://github.com/cypress-io/cypress-design/pull/450) [`927097f`](https://github.com/cypress-io/cypress-design/commit/927097f409235ac78c98b281c4d9b2ec70dfe01d) Thanks [@elevatebart](https://github.com/elevatebart)! - optim: do not package dependencies
|
|
14
|
+
|
|
15
|
+
- Updated dependencies [[`927097f`](https://github.com/cypress-io/cypress-design/commit/927097f409235ac78c98b281c4d9b2ec70dfe01d), [`927097f`](https://github.com/cypress-io/cypress-design/commit/927097f409235ac78c98b281c4d9b2ec70dfe01d)]:
|
|
16
|
+
- @cypress-design/react-icon@1.1.0
|
|
17
|
+
|
|
3
18
|
## 1.0.0
|
|
4
19
|
|
|
5
20
|
### Major Changes
|
package/dist/index.es.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { cyStatusRunningSimpleX4, cyStatusRunningSimpleX8, cyStatusRunningOutlineX12, cyStatusRunningOutlineX16, cyStatusRunningOutlineX24, cyStatusFailingOutlineX16, cyStatusFailingOutlineX24, cyStatusPassedSimpleX4, cyStatusPassedSimpleX8, cyStatusPassedSimpleX12, cyStatusPassedOutlineX16, cyStatusPassedOutlineX24, cyStatusFailedSimpleX4, cyStatusFailedSimpleX8, cyStatusFailedSimpleX12, cyStatusFailedOutlineX16, cyStatusFailedOutlineX24, cyStatusQueuedSimpleX4, cyStatusQueuedSimpleX8, cyStatusQueuedOutlineX12, cyStatusQueuedOutlineX16, cyStatusQueuedOutlineX24, cyStatusPlaceholderSimpleX4, cyStatusPlaceholderSimpleX8, cyStatusPlaceholderSolidX12, cyStatusPlaceholderSolidX16, cyStatusPlaceholderSolidX24, cyStatusCancelledSimpleX4, cyStatusCancelledSimpleX8, cyStatusCancelledSolidX12, cyStatusCancelledOutlineX16, cyStatusCancelledOutlineX24, cyStatusErroredSimpleX4, cyStatusErroredSimpleX8, cyStatusErroredSolidX12, cyStatusErroredOutlineX16, cyStatusErroredOutlineX24, cyStatusSkippedSimpleX4, cyStatusSkippedSimpleX8, cyStatusSkippedOutlineX12, cyStatusSkippedOutlineX16, cyStatusSkippedOutlineX24, cyStatusPendingSimpleX4, cyStatusPendingSimpleX8, cyStatusPendingOutlineX12, cyStatusPendingOutlineX16, cyStatusPendingOutlineX24, cyStatusPassedSimpleX16, cyStatusPassedSimpleX24, cyStatusFailedSimpleX16, cyStatusFailedSimpleX24, cyStatusCancelledSolidX16, cyStatusCancelledSolidX24, cyStatusErroredSolidX16, cyStatusErroredSolidX24, cyStatusPassedSolidX16, cyStatusPassedSolidX24, cyStatusFailedSolidX16, cyStatusFailedSolidX24,
|
|
3
|
-
import '
|
|
2
|
+
import { cyStatusRunningSimpleX4, cyStatusRunningSimpleX8, cyStatusRunningOutlineX12, cyStatusRunningOutlineX16, cyStatusRunningOutlineX24, cyStatusFailingOutlineX16, cyStatusFailingOutlineX24, cyStatusPassedSimpleX4, cyStatusPassedSimpleX8, cyStatusPassedSimpleX12, cyStatusPassedOutlineX16, cyStatusPassedOutlineX24, cyStatusFailedSimpleX4, cyStatusFailedSimpleX8, cyStatusFailedSimpleX12, cyStatusFailedOutlineX16, cyStatusFailedOutlineX24, cyStatusQueuedSimpleX4, cyStatusQueuedSimpleX8, cyStatusQueuedOutlineX12, cyStatusQueuedOutlineX16, cyStatusQueuedOutlineX24, cyStatusPlaceholderSimpleX4, cyStatusPlaceholderSimpleX8, cyStatusPlaceholderSolidX12, cyStatusPlaceholderSolidX16, cyStatusPlaceholderSolidX24, cyStatusCancelledSimpleX4, cyStatusCancelledSimpleX8, cyStatusCancelledSolidX12, cyStatusCancelledOutlineX16, cyStatusCancelledOutlineX24, cyStatusErroredSimpleX4, cyStatusErroredSimpleX8, cyStatusErroredSolidX12, cyStatusErroredOutlineX16, cyStatusErroredOutlineX24, cyStatusSkippedSimpleX4, cyStatusSkippedSimpleX8, cyStatusSkippedOutlineX12, cyStatusSkippedOutlineX16, cyStatusSkippedOutlineX24, cyStatusPendingSimpleX4, cyStatusPendingSimpleX8, cyStatusPendingOutlineX12, cyStatusPendingOutlineX16, cyStatusPendingOutlineX24, cyStatusPassedSimpleX16, cyStatusPassedSimpleX24, cyStatusFailedSimpleX16, cyStatusFailedSimpleX24, cyStatusCancelledSolidX16, cyStatusCancelledSolidX24, cyStatusErroredSolidX16, cyStatusErroredSolidX24, cyStatusPassedSolidX16, cyStatusPassedSolidX24, cyStatusFailedSolidX16, cyStatusFailedSolidX24, getComponentAttributes } from '@cypress-design/icon-registry';
|
|
3
|
+
import { compileReactIconProperties } from '@cypress-design/react-icon';
|
|
4
4
|
|
|
5
5
|
/******************************************************************************
|
|
6
6
|
Copyright (c) Microsoft Corporation.
|
|
@@ -19,18 +19,18 @@ PERFORMANCE OF THIS SOFTWARE.
|
|
|
19
19
|
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
20
20
|
|
|
21
21
|
|
|
22
|
-
var __assign
|
|
23
|
-
__assign
|
|
22
|
+
var __assign = function() {
|
|
23
|
+
__assign = Object.assign || function __assign(t) {
|
|
24
24
|
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
25
25
|
s = arguments[i];
|
|
26
26
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
27
27
|
}
|
|
28
28
|
return t;
|
|
29
29
|
};
|
|
30
|
-
return __assign
|
|
30
|
+
return __assign.apply(this, arguments);
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
-
function __rest
|
|
33
|
+
function __rest(s, e) {
|
|
34
34
|
var t = {};
|
|
35
35
|
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
36
36
|
t[p] = s[p];
|
|
@@ -436,97 +436,6 @@ const statuses = {
|
|
|
436
436
|
},
|
|
437
437
|
};
|
|
438
438
|
|
|
439
|
-
/******************************************************************************
|
|
440
|
-
Copyright (c) Microsoft Corporation.
|
|
441
|
-
|
|
442
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
443
|
-
purpose with or without fee is hereby granted.
|
|
444
|
-
|
|
445
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
446
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
447
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
448
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
449
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
450
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
451
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
452
|
-
***************************************************************************** */
|
|
453
|
-
/* global Reflect, Promise, SuppressedError, Symbol */
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
var __assign = function() {
|
|
457
|
-
__assign = Object.assign || function __assign(t) {
|
|
458
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
459
|
-
s = arguments[i];
|
|
460
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
461
|
-
}
|
|
462
|
-
return t;
|
|
463
|
-
};
|
|
464
|
-
return __assign.apply(this, arguments);
|
|
465
|
-
};
|
|
466
|
-
|
|
467
|
-
function __rest(s, e) {
|
|
468
|
-
var t = {};
|
|
469
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
470
|
-
t[p] = s[p];
|
|
471
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
472
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
473
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
474
|
-
t[p[i]] = s[p[i]];
|
|
475
|
-
}
|
|
476
|
-
return t;
|
|
477
|
-
}
|
|
478
|
-
|
|
479
|
-
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
480
|
-
var e = new Error(message);
|
|
481
|
-
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
482
|
-
};
|
|
483
|
-
|
|
484
|
-
var compileReactIconProperties = function (_a) {
|
|
485
|
-
var body = _a.body, defs = _a.defs, compiledClasses = _a.compiledClasses, size = _a.size, name = _a.name, alt = _a.alt, attributes = __rest(_a, ["body", "defs", "compiledClasses", "size", "name", "alt"]);
|
|
486
|
-
var filteredAttributes = Object.keys(attributes).reduce(function (newAttributes, attrName) {
|
|
487
|
-
if (!ICON_COLOR_PROP_NAMES.includes(attrName) &&
|
|
488
|
-
attrName !== 'name') {
|
|
489
|
-
// @ts-expect-error the ky of React's SVGProps is too broad and
|
|
490
|
-
// breaks here. Since we do not need to check for it. We keep the expect error
|
|
491
|
-
newAttributes[attrName] =
|
|
492
|
-
attributes[attrName];
|
|
493
|
-
}
|
|
494
|
-
return newAttributes;
|
|
495
|
-
}, {});
|
|
496
|
-
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
497
|
-
React.useEffect(function () {
|
|
498
|
-
var iconFileId = "".concat(name, "_").concat(size);
|
|
499
|
-
if (defs) {
|
|
500
|
-
if (document.querySelector("[data-cy-svg-defs=\"".concat(iconFileId, "\"]"))) {
|
|
501
|
-
return;
|
|
502
|
-
}
|
|
503
|
-
var svgElement = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
|
504
|
-
svgElement.setAttribute('data-cy-svg-defs', iconFileId);
|
|
505
|
-
svgElement.setAttribute('width', '0');
|
|
506
|
-
svgElement.setAttribute('height', '0');
|
|
507
|
-
svgElement.innerHTML = defs;
|
|
508
|
-
document.body.appendChild(svgElement);
|
|
509
|
-
}
|
|
510
|
-
}, [defs, name, size]);
|
|
511
|
-
var componentProps = __assign({ width: size, height: size, viewBox: "0 0 ".concat(size, " ").concat(size), fill: 'none', dangerouslySetInnerHTML: {
|
|
512
|
-
__html: alt
|
|
513
|
-
? "<title>".concat(alt.replace(/[><]/g, function (s) {
|
|
514
|
-
return s === '>' ? '>' : '<';
|
|
515
|
-
}), "</title>").concat(body)
|
|
516
|
-
: body,
|
|
517
|
-
}, className: undefined }, filteredAttributes);
|
|
518
|
-
if (attributes.className) {
|
|
519
|
-
compiledClasses.push(attributes.className);
|
|
520
|
-
}
|
|
521
|
-
if (compiledClasses.length) {
|
|
522
|
-
componentProps.className = compiledClasses.join(' ');
|
|
523
|
-
}
|
|
524
|
-
return componentProps;
|
|
525
|
-
};
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
/* <wind-keep class="filter icon-light-secondary icon-dark-secondary"> */
|
|
529
|
-
|
|
530
439
|
var compileProps = function (_a) {
|
|
531
440
|
var status = _a.status, statuses = _a.statuses, className = _a.className, size = _a.size, variantName = _a.variantName;
|
|
532
441
|
var statusInfo = status ? statuses[status] : statuses.placeholder;
|
|
@@ -548,8 +457,8 @@ var compileProps = function (_a) {
|
|
|
548
457
|
};
|
|
549
458
|
|
|
550
459
|
var OutlineStatusIcon = function (_a) {
|
|
551
|
-
var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest
|
|
552
|
-
return React.createElement('svg', __assign
|
|
460
|
+
var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest(_a, ["size", "status"]);
|
|
461
|
+
return React.createElement('svg', __assign(__assign({}, rest), compileProps({
|
|
553
462
|
status: status,
|
|
554
463
|
statuses: statuses$2,
|
|
555
464
|
className: rest.className,
|
|
@@ -559,8 +468,8 @@ var OutlineStatusIcon = function (_a) {
|
|
|
559
468
|
};
|
|
560
469
|
|
|
561
470
|
var SimpleStatusIcon = function (_a) {
|
|
562
|
-
var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest
|
|
563
|
-
return React.createElement('svg', __assign
|
|
471
|
+
var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest(_a, ["size", "status"]);
|
|
472
|
+
return React.createElement('svg', __assign(__assign({}, rest), compileProps({
|
|
564
473
|
status: status,
|
|
565
474
|
statuses: statuses$1,
|
|
566
475
|
className: rest.className,
|
|
@@ -570,8 +479,8 @@ var SimpleStatusIcon = function (_a) {
|
|
|
570
479
|
};
|
|
571
480
|
|
|
572
481
|
var SolidStatusIcon = function (_a) {
|
|
573
|
-
var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest
|
|
574
|
-
return React.createElement('svg', __assign
|
|
482
|
+
var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest(_a, ["size", "status"]);
|
|
483
|
+
return React.createElement('svg', __assign(__assign({}, rest), compileProps({
|
|
575
484
|
status: status,
|
|
576
485
|
statuses: statuses,
|
|
577
486
|
className: rest.className,
|
|
@@ -581,14 +490,14 @@ var SolidStatusIcon = function (_a) {
|
|
|
581
490
|
};
|
|
582
491
|
|
|
583
492
|
var StatusIcon = function (_a) {
|
|
584
|
-
var _b = _a.size, size = _b === void 0 ? '24' : _b, status = _a.status, _c = _a.variant, variant = _c === void 0 ? 'simple' : _c, rest = __rest
|
|
493
|
+
var _b = _a.size, size = _b === void 0 ? '24' : _b, status = _a.status, _c = _a.variant, variant = _c === void 0 ? 'simple' : _c, rest = __rest(_a, ["size", "status", "variant"]);
|
|
585
494
|
if (variant === 'outline') {
|
|
586
|
-
return React.createElement(OutlineStatusIcon, __assign
|
|
495
|
+
return React.createElement(OutlineStatusIcon, __assign({ size: size, status: status }, rest));
|
|
587
496
|
}
|
|
588
497
|
if (variant === 'simple') {
|
|
589
|
-
return React.createElement(SimpleStatusIcon, __assign
|
|
498
|
+
return React.createElement(SimpleStatusIcon, __assign({ size: size, status: status }, rest));
|
|
590
499
|
}
|
|
591
|
-
return React.createElement(SolidStatusIcon, __assign
|
|
500
|
+
return React.createElement(SolidStatusIcon, __assign({ size: size, status: status }, rest));
|
|
592
501
|
};
|
|
593
502
|
|
|
594
503
|
export { OutlineStatusIcon, SimpleStatusIcon, SolidStatusIcon, StatusIcon as default };
|