@cypress-design/react-statusicon 0.0.10 → 0.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @cypress-design/react-statusicon
2
2
 
3
+ ## 0.1.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#106](https://github.com/cypress-io/cypress-design/pull/106) [`271af48`](https://github.com/cypress-io/cypress-design/commit/271af48c5ed9bc4004a60e5cfef871e614ced4e2) Thanks [@mapsandapps](https://github.com/mapsandapps)! - Fix types file location
8
+
9
+ ## 0.1.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [#105](https://github.com/cypress-io/cypress-design/pull/105) [`2f54f5b`](https://github.com/cypress-io/cypress-design/commit/2f54f5b867b60ba5ce2e40fd38870bd65187ba30) Thanks [@elevatebart](https://github.com/elevatebart)! - move animation of running status to SMIL
14
+
15
+ ### Patch Changes
16
+
17
+ - [#103](https://github.com/cypress-io/cypress-design/pull/103) [`e82d8cb`](https://github.com/cypress-io/cypress-design/commit/e82d8cb60882a379d89f86d1ff7b8f1d5b56ce66) Thanks [@mapsandapps](https://github.com/mapsandapps)! - Change the status icon for noTests; fix some icon colors
18
+
19
+ - Updated dependencies [[`2f54f5b`](https://github.com/cypress-io/cypress-design/commit/2f54f5b867b60ba5ce2e40fd38870bd65187ba30), [`e82d8cb`](https://github.com/cypress-io/cypress-design/commit/e82d8cb60882a379d89f86d1ff7b8f1d5b56ce66)]:
20
+ - @cypress-design/react-icon@0.11.0
21
+ - @cypress-design/icon-registry@0.13.0
22
+
3
23
  ## 0.0.10
4
24
 
5
25
  ### Patch Changes
@@ -7,15 +7,15 @@ import { compileProps } from './compileProps'
7
7
  export const OutlineStatusIcon: React.FC<
8
8
  VariantStatusIconProps & SVGProps<SVGSVGElement>
9
9
  > = ({ size = '24', status = 'placeholder', ...rest }) => {
10
- return React.createElement(
11
- 'svg',
12
- compileProps({
10
+ return React.createElement('svg', {
11
+ ...rest,
12
+ ...compileProps({
13
13
  status,
14
14
  statuses,
15
15
  className: rest.className,
16
16
  size,
17
- })
18
- )
17
+ }),
18
+ })
19
19
  }
20
20
 
21
21
  export default OutlineStatusIcon
@@ -7,15 +7,15 @@ import { compileProps } from './compileProps'
7
7
  export const SimpleStatusIcon: React.FC<
8
8
  VariantStatusIconProps & SVGProps<SVGSVGElement>
9
9
  > = ({ size = '24', status = 'placeholder', ...rest }) => {
10
- return React.createElement(
11
- 'svg',
12
- compileProps({
10
+ return React.createElement('svg', {
11
+ ...rest,
12
+ ...compileProps({
13
13
  status,
14
14
  statuses,
15
15
  className: rest.className,
16
16
  size,
17
- })
18
- )
17
+ }),
18
+ })
19
19
  }
20
20
 
21
21
  export default SimpleStatusIcon
@@ -7,15 +7,15 @@ import { compileProps } from './compileProps'
7
7
  export const SolidStatusIcon: React.FC<
8
8
  VariantStatusIconProps & SVGProps<SVGSVGElement>
9
9
  > = ({ size = '24', status = 'placeholder', ...rest }) => {
10
- return React.createElement(
11
- 'svg',
12
- compileProps({
10
+ return React.createElement('svg', {
11
+ ...rest,
12
+ ...compileProps({
13
13
  status,
14
14
  statuses,
15
15
  className: rest.className,
16
16
  size,
17
- })
18
- )
17
+ }),
18
+ })
19
19
  }
20
20
 
21
21
  export default SolidStatusIcon
@@ -30,9 +30,7 @@ export default () => (
30
30
  </tr>
31
31
  </thead>
32
32
  <tbody>
33
- {Object.keys(statuses).map((status) => {
34
- const statusInfo = statuses[status]
35
-
33
+ {Object.entries(statuses).map(([status, statusInfo]) => {
36
34
  return (
37
35
  <>
38
36
  {statusInfo.variants.map((variant, i) => {
@@ -64,8 +62,8 @@ export default () => (
64
62
  return (
65
63
  <td key={`${status}-${size}-${variant}`} className="py-2">
66
64
  <StatusIcon
67
- status={status}
68
- size={size}
65
+ status={status as any}
66
+ size={size as any}
69
67
  variant={variant}
70
68
  />
71
69
  </td>
@@ -10,24 +10,6 @@ describe('StatusIcon', () => {
10
10
  mount(<StatusIconStory />)
11
11
  })
12
12
 
13
- it('running icon spins', () => {
14
- mount(<StatusIcon variant="simple" size="16" status="running" />)
15
-
16
- cy.get('svg').should('have.class', 'animate-spin')
17
- })
18
-
19
- it('small running icon does not spin', () => {
20
- mount(<StatusIcon variant="simple" size="4" status="running" />)
21
-
22
- cy.get('svg').should('not.have.class', 'animate-spin')
23
- })
24
-
25
- it('other icons do not spin', () => {
26
- mount(<StatusIcon variant="simple" size="16" status="passed" />)
27
-
28
- cy.get('svg').should('not.have.class', 'animate-spin')
29
- })
30
-
31
13
  it('defaults to a variant that exists if the one provided does not exist', () => {
32
14
  mount(
33
15
  <div>
package/compileProps.ts CHANGED
@@ -18,9 +18,7 @@ export const compileProps = ({
18
18
 
19
19
  const { data: iconData, name } = statusInfo[`size${size}Icon`]
20
20
 
21
- const classes = `inline-block ${className || ''} ${
22
- iconInfo.shouldSpin && size !== '4' ? 'animate-spin' : ''
23
- }`
21
+ const classes = `inline-block ${className || ''}`
24
22
 
25
23
  const { compiledClasses } = getComponentAttributes({
26
24
  name,
@@ -7,7 +7,6 @@ declare type StatusInfo = {
7
7
  use: string;
8
8
  variants: readonly Variant[];
9
9
  secondaryColor?: WindiColor;
10
- shouldSpin?: boolean;
11
10
  };
12
11
  export declare type IconContents = {
13
12
  name: string;
@@ -29,7 +28,6 @@ declare const constStatuses: {
29
28
  readonly use: "Runs, specs, groups, test results";
30
29
  readonly variants: readonly ["outline"];
31
30
  readonly secondaryColor: "gray-100";
32
- readonly shouldSpin: true;
33
31
  };
34
32
  readonly passed: {
35
33
  readonly color: "jade-400";
@@ -59,7 +57,7 @@ declare const constStatuses: {
59
57
  readonly variants: readonly ["outline", "solid"];
60
58
  };
61
59
  readonly noTests: {
62
- readonly color: "gray-400";
60
+ readonly color: "orange-400";
63
61
  readonly use: "Runs, specs, groups";
64
62
  readonly variants: readonly ["outline", "solid"];
65
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources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
  },
95
95
  noTests: {
96
- size4Icon: cyStatusCancelledSimpleX4,
97
- size8Icon: cyStatusCancelledSimpleX8,
98
- size12Icon: cyStatusCancelledSolidX12,
99
- size16Icon: cyStatusCancelledOutlineX16,
100
- size24Icon: cyStatusCancelledOutlineX24
96
+ size4Icon: cyStatusErroredSimpleX4,
97
+ size8Icon: cyStatusErroredSimpleX8,
98
+ size12Icon: cyStatusErroredSolidX12,
99
+ size16Icon: cyStatusErroredOutlineX16,
100
+ size24Icon: cyStatusErroredOutlineX24
101
101
  },
102
102
  errored: {
103
103
  size4Icon: cyStatusErroredSimpleX4,
@@ -146,8 +146,7 @@ var constStatuses = {
146
146
  use: 'Runs, specs, groups, test results',
147
147
  variants: ['outline'],
148
148
  // <windi-keep fillColor="gray-100" />
149
- secondaryColor: 'gray-100',
150
- shouldSpin: true
149
+ secondaryColor: 'gray-100'
151
150
  },
152
151
  passed: {
153
152
  // <windi-keep strokeColor="jade-400" />
@@ -182,8 +181,8 @@ var constStatuses = {
182
181
  variants: ['outline', 'solid']
183
182
  },
184
183
  noTests: {
185
- // <windi-keep strokeColor="gray-400" />
186
- color: 'gray-400',
184
+ // <windi-keep strokeColor="orange-400" />
185
+ color: 'orange-400',
187
186
  use: 'Runs, specs, groups',
188
187
  variants: ['outline', 'solid']
189
188
  },
@@ -292,7 +291,7 @@ var compileProps = function (_a) {
292
291
  var statusInfo = status ? statuses[status] : statuses.placeholder;
293
292
  var iconInfo = status ? statuses$2[status] : statuses$2.placeholder;
294
293
  var _b = statusInfo["size" + size + "Icon"], iconData = _b.data, name = _b.name;
295
- var classes = "inline-block " + (className || '') + " " + (iconInfo.shouldSpin && size !== '4' ? 'animate-spin' : '');
294
+ var classes = "inline-block " + (className || '');
296
295
  var compiledClasses = getComponentAttributes({
297
296
  name: name,
298
297
  strokeColor: iconInfo.color,
@@ -309,12 +308,12 @@ var compileProps = function (_a) {
309
308
 
310
309
  var OutlineStatusIcon = function (_a) {
311
310
  var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest$1(_a, ["size", "status"]);
312
- return React.createElement('svg', compileProps({
311
+ return React.createElement('svg', __assign$1(__assign$1({}, rest), compileProps({
313
312
  status: status,
314
313
  statuses: statuses$3,
315
314
  className: rest.className,
316
315
  size: size
317
- }));
316
+ })));
318
317
  };
319
318
 
320
319
  var statuses$1 = {
@@ -361,11 +360,11 @@ var statuses$1 = {
361
360
  size24Icon: cyStatusCancelledSolidX24
362
361
  },
363
362
  noTests: {
364
- size4Icon: cyStatusCancelledSimpleX4,
365
- size8Icon: cyStatusCancelledSimpleX8,
366
- size12Icon: cyStatusCancelledSolidX12,
367
- size16Icon: cyStatusCancelledSolidX16,
368
- size24Icon: cyStatusCancelledSolidX24
363
+ size4Icon: cyStatusErroredSimpleX4,
364
+ size8Icon: cyStatusErroredSimpleX8,
365
+ size12Icon: cyStatusErroredSolidX12,
366
+ size16Icon: cyStatusErroredSolidX16,
367
+ size24Icon: cyStatusErroredSolidX24
369
368
  },
370
369
  errored: {
371
370
  size4Icon: cyStatusErroredSimpleX4,
@@ -406,12 +405,12 @@ var statuses$1 = {
406
405
 
407
406
  var SimpleStatusIcon = function (_a) {
408
407
  var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest$1(_a, ["size", "status"]);
409
- return React.createElement('svg', compileProps({
408
+ return React.createElement('svg', __assign$1(__assign$1({}, rest), compileProps({
410
409
  status: status,
411
410
  statuses: statuses$1,
412
411
  className: rest.className,
413
412
  size: size
414
- }));
413
+ })));
415
414
  };
416
415
 
417
416
  var statuses = {
@@ -458,11 +457,11 @@ var statuses = {
458
457
  size24Icon: cyStatusCancelledSolidX24
459
458
  },
460
459
  noTests: {
461
- size4Icon: cyStatusCancelledSimpleX4,
462
- size8Icon: cyStatusCancelledSimpleX8,
463
- size12Icon: cyStatusCancelledSolidX12,
464
- size16Icon: cyStatusCancelledSolidX16,
465
- size24Icon: cyStatusCancelledSolidX24
460
+ size4Icon: cyStatusErroredSimpleX4,
461
+ size8Icon: cyStatusErroredSimpleX8,
462
+ size12Icon: cyStatusErroredSolidX12,
463
+ size16Icon: cyStatusErroredSolidX16,
464
+ size24Icon: cyStatusErroredSolidX24
466
465
  },
467
466
  errored: {
468
467
  size4Icon: cyStatusErroredSimpleX4,
@@ -503,12 +502,12 @@ var statuses = {
503
502
 
504
503
  var SolidStatusIcon = function (_a) {
505
504
  var _b = _a.size, size = _b === void 0 ? '24' : _b, _c = _a.status, status = _c === void 0 ? 'placeholder' : _c, rest = __rest$1(_a, ["size", "status"]);
506
- return React.createElement('svg', compileProps({
505
+ return React.createElement('svg', __assign$1(__assign$1({}, rest), compileProps({
507
506
  status: status,
508
507
  statuses: statuses,
509
508
  className: rest.className,
510
509
  size: size
511
- }));
510
+ })));
512
511
  };
513
512
 
514
513
  var StatusIcon = function (_a) {
@@ -524,5 +523,5 @@ var StatusIcon = function (_a) {
524
523
 
525
524
  export { OutlineStatusIcon, SimpleStatusIcon, SolidStatusIcon, StatusIcon as default };
526
525
 
527
- /* <windicss-keep class="outline inline-block animate-spin 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-gray-400 icon-dark-orange-400"> */
526
+ /* <windicss-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"> */
528
527
  //# sourceMappingURL=index.es.mjs.map