@transferwise/components 0.0.0-experimental-6fa7ff3 → 0.0.0-experimental-f341b41
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/build/avatarView/AvatarView.js +1 -12
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +1 -12
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +21 -18
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +22 -19
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/i18n/de.json +0 -1
- package/build/i18n/de.json.js +0 -1
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +0 -1
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/it.json +0 -1
- package/build/i18n/it.json.js +0 -1
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +0 -1
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/th.json +0 -1
- package/build/i18n/th.json.js +0 -1
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +0 -1
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/main.css +180 -47
- package/build/styles/button/Button.css +22 -30
- package/build/styles/button/Button.vars.css +1 -18
- package/build/styles/circularButton/CircularButton.css +158 -17
- package/build/styles/main.css +180 -47
- package/build/types/avatarView/AvatarView.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts +4 -11
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/definitionList/DefinitionList.d.ts +2 -1
- package/build/types/definitionList/DefinitionList.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/avatarView/AvatarView.tsx +1 -15
- package/src/button/Button.css +22 -30
- package/src/button/Button.less +30 -6
- package/src/button/Button.vars.css +1 -18
- package/src/button/Button.vars.less +1 -24
- package/src/circularButton/CircularButton.css +158 -17
- package/src/circularButton/CircularButton.less +91 -22
- package/src/circularButton/CircularButton.story.tsx +24 -45
- package/src/circularButton/CircularButton.tsx +25 -38
- package/src/circularButton/_button-label-states.less +34 -0
- package/src/dateInput/DateInput.spec.tsx +26 -45
- package/src/definitionList/DefinitionList.spec.js +91 -0
- package/src/definitionList/DefinitionList.story.tsx +57 -57
- package/src/definitionList/DefinitionList.tsx +1 -1
- package/src/i18n/de.json +0 -1
- package/src/i18n/it.json +0 -1
- package/src/i18n/th.json +0 -1
- package/src/iconButton/IconButton.story.tsx +6 -6
- package/src/main.css +180 -47
- package/src/slidingPanel/SlidingPanel.spec.js +56 -0
- package/src/slidingPanel/SlidingPanel.spec.tsx +0 -69
package/src/main.css
CHANGED
|
@@ -716,7 +716,7 @@ div.critical-comms .critical-comms-body {
|
|
|
716
716
|
.np-btn.disabled[class] {
|
|
717
717
|
pointer-events: auto;
|
|
718
718
|
}
|
|
719
|
-
|
|
719
|
+
.wds-Button {
|
|
720
720
|
--Button-background: var(--color-interactive-accent);
|
|
721
721
|
--Button-background-hover: var(--color-interactive-accent-hover);
|
|
722
722
|
--Button-background-active: var(--color-interactive-accent-active);
|
|
@@ -726,7 +726,6 @@ div.critical-comms .critical-comms-body {
|
|
|
726
726
|
--Button-size-small-padding: 5px var(--size-12);
|
|
727
727
|
--Button-size-medium-padding: var(--size-8) var(--size-12);
|
|
728
728
|
--Button-size-large-padding: var(--size-12) var(--size-16);
|
|
729
|
-
--Button-avatar-border-color: var(--color-border-neutral);
|
|
730
729
|
--Button-transition-duration: 150ms;
|
|
731
730
|
--Button-transition-easing: ease-in-out;
|
|
732
731
|
--Button-secondary-background: var(--color-interactive-neutral);
|
|
@@ -745,31 +744,15 @@ div.critical-comms .critical-comms-body {
|
|
|
745
744
|
--Button-primary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
746
745
|
--Button-primary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
747
746
|
--Button-primary-negative-color: var(--color-contrast);
|
|
748
|
-
--Button-primary-netative-avatar-border-color: rgba(255,255,255,0.2);
|
|
749
747
|
--Button-secondary-negative-background: var(--color-sentiment-negative-secondary);
|
|
750
748
|
--Button-secondary-negative-background-hover: var(--color-sentiment-negative-secondary-hover);
|
|
751
749
|
--Button-secondary-negative-background-active: var(--color-sentiment-negative-secondary-active);
|
|
752
750
|
--Button-secondary-negative-color: var(--color-sentiment-negative-primary);
|
|
753
|
-
--Button-secondary-netative-avatar-border-color: rgba(168,32,13,0.12157);
|
|
754
|
-
}
|
|
755
|
-
.np-theme-personal--dark .wds-Button {
|
|
756
|
-
--Button-primary-netative-avatar-border-color: rgba(14,15,12,0.12157);
|
|
757
|
-
}
|
|
758
|
-
.np-theme-personal--forest-green .wds-Button {
|
|
759
|
-
--color-interactive-neutral: rgba(159,232,112,0.2);
|
|
760
|
-
--color-interactive-neutral-hover: rgba(205,255,173,0.2);
|
|
761
|
-
--color-interactive-neutral-active: rgba(236,255,224,0.2);
|
|
762
|
-
--color-sentiment-negative-secondary: rgba(255,196,194,0.2);
|
|
763
|
-
--color-sentiment-negative-secondary-hover: rgba(255,220,219,0.2);
|
|
764
|
-
--color-sentiment-negative-secondary-active: rgba(255,235,235,0.2);
|
|
765
|
-
--Button-primary-netative-avatar-border-color: rgba(14,15,12,0.12157);
|
|
766
|
-
--Button-secondary-netative-avatar-border-color: rgba(14,15,12,0.12157);
|
|
767
751
|
}
|
|
768
752
|
.np-theme-personal--bright-green .wds-Button {
|
|
769
753
|
--color-contrast: #FFFFFF;
|
|
770
754
|
--Button-secondary-color: var(--color-interactive-control);
|
|
771
755
|
--Button-secondary-negative-color: var(--color-contrast);
|
|
772
|
-
--Button-secondary-netative-avatar-border-color: var(--Button-primary-netative-avatar-border-color);
|
|
773
756
|
}
|
|
774
757
|
/* Button Styles */
|
|
775
758
|
.wds-Button {
|
|
@@ -787,16 +770,12 @@ div.critical-comms .critical-comms-body {
|
|
|
787
770
|
-webkit-appearance: none;
|
|
788
771
|
-moz-appearance: none;
|
|
789
772
|
appearance: none;
|
|
790
|
-
background-color: #00a2dd;
|
|
791
773
|
background-color: var(--Button-background);
|
|
792
774
|
border: none;
|
|
793
|
-
border-radius: 9999px;
|
|
794
775
|
border-radius: var(--Button-border-radius);
|
|
795
776
|
color: var(--Button-color);
|
|
796
777
|
cursor: pointer;
|
|
797
|
-
padding: 8px 12px;
|
|
798
778
|
padding: var(--Button-padding);
|
|
799
|
-
transition: color, background-color 150ms ease-in-out;
|
|
800
779
|
transition: color, background-color var(--Button-transition-duration) var(--Button-transition-easing);
|
|
801
780
|
}
|
|
802
781
|
.wds-Button:focus {
|
|
@@ -804,13 +783,11 @@ div.critical-comms .critical-comms-body {
|
|
|
804
783
|
text-decoration: none;
|
|
805
784
|
}
|
|
806
785
|
.wds-Button:hover {
|
|
807
|
-
background-color: #008fc9;
|
|
808
786
|
background-color: var(--Button-background-hover);
|
|
809
787
|
-webkit-text-decoration: none;
|
|
810
788
|
text-decoration: none;
|
|
811
789
|
}
|
|
812
790
|
.wds-Button:active {
|
|
813
|
-
background-color: #0081ba;
|
|
814
791
|
background-color: var(--Button-background-active);
|
|
815
792
|
-webkit-text-decoration: none;
|
|
816
793
|
text-decoration: none;
|
|
@@ -825,7 +802,6 @@ div.critical-comms .critical-comms-body {
|
|
|
825
802
|
.wds-Button:disabled:hover,
|
|
826
803
|
.wds-Button.wds-Button--disabled:active,
|
|
827
804
|
.wds-Button:disabled:active {
|
|
828
|
-
background-color: #00a2dd;
|
|
829
805
|
background-color: var(--Button-background);
|
|
830
806
|
}
|
|
831
807
|
.wds-Button--secondary {
|
|
@@ -863,14 +839,12 @@ div.critical-comms .critical-comms-body {
|
|
|
863
839
|
--Button-background-hover: var(--Button-primary-negative-background-hover);
|
|
864
840
|
--Button-background-active: var(--Button-primary-negative-background-active);
|
|
865
841
|
--Button-color: var(--Button-primary-negative-color);
|
|
866
|
-
--Button-avatar-border-color: var(--Button-primary-netative-avatar-border-color);
|
|
867
842
|
}
|
|
868
843
|
.wds-Button--negative.wds-Button--secondary {
|
|
869
844
|
--Button-background: var(--Button-secondary-negative-background);
|
|
870
845
|
--Button-background-hover: var(--Button-secondary-negative-background-hover);
|
|
871
846
|
--Button-background-active: var(--Button-secondary-negative-background-active);
|
|
872
847
|
--Button-color: var(--Button-secondary-negative-color);
|
|
873
|
-
--Button-avatar-border-color: var(--Button-secondary-netative-avatar-border-color);
|
|
874
848
|
}
|
|
875
849
|
.wds-Button--small {
|
|
876
850
|
--Button-padding: var(--Button-size-small-padding);
|
|
@@ -903,9 +877,6 @@ div.critical-comms .critical-comms-body {
|
|
|
903
877
|
margin-right: 0;
|
|
904
878
|
margin-left: 5px;
|
|
905
879
|
}
|
|
906
|
-
.wds-Button-avatars .np-circle {
|
|
907
|
-
--circle-border-color: var(--Button-avatar-border-color);
|
|
908
|
-
}
|
|
909
880
|
.wds-Button-avatars .np-avatar-view .np-avatar-view-content {
|
|
910
881
|
color: var(--Button-color);
|
|
911
882
|
}
|
|
@@ -963,6 +934,27 @@ div.critical-comms .critical-comms-body {
|
|
|
963
934
|
[dir="rtl"] .wds-Button .tw-icon-chevron-left,[dir="rtl"] .wds-Button .tw-icon-arrow-left {
|
|
964
935
|
transform: rotate(180deg);
|
|
965
936
|
}
|
|
937
|
+
/* Avatar border transparency */
|
|
938
|
+
/* dark buttons get 20% transparency, light buttons get 12% */
|
|
939
|
+
.wds-Button-avatars .np-circle {
|
|
940
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 20%, transparent);
|
|
941
|
+
}
|
|
942
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--secondary.wds-Button--negative .wds-Button-avatars .np-circle,
|
|
943
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--secondary .wds-Button-avatars .np-circle,
|
|
944
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--tertiary .wds-Button-avatars .np-circle,
|
|
945
|
+
.np-theme-personal:not(.np-theme-personal--dark):not(.np-theme-personal--forest-green):not(.np-theme-personal--bright-green) .wds-Button--minimal .wds-Button-avatars .np-circle {
|
|
946
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
947
|
+
}
|
|
948
|
+
.np-theme-personal--dark .wds-Button--primary .wds-Button-avatars .np-circle,
|
|
949
|
+
.np-theme-personal--dark .wds-Button--primary.wds-Button--negative .wds-Button-avatars .np-circle,
|
|
950
|
+
.np-theme-personal--forest-green .wds-Button--primary .wds-Button-avatars .np-circle,
|
|
951
|
+
.np-theme-personal--forest-green .wds-Button--primary.wds-Button--negative .wds-Button-avatars .np-circle {
|
|
952
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
953
|
+
}
|
|
954
|
+
.np-theme-personal--bright-green .wds-Button--tertiary .wds-Button-avatars .np-circle,
|
|
955
|
+
.np-theme-personal--bright-green .wds-Button--minimal .wds-Button-avatars .np-circle {
|
|
956
|
+
--circle-border-color: color-mix(in srgb, var(--Button-color) 12%, transparent);
|
|
957
|
+
}
|
|
966
958
|
.np-card {
|
|
967
959
|
overflow: hidden;
|
|
968
960
|
transition-property: transform, box-shadow;
|
|
@@ -1442,34 +1434,175 @@ div.critical-comms .critical-comms-body {
|
|
|
1442
1434
|
display: inline-flex;
|
|
1443
1435
|
flex-direction: column;
|
|
1444
1436
|
align-items: center;
|
|
1437
|
+
text-align: center;
|
|
1445
1438
|
cursor: pointer;
|
|
1439
|
+
position: relative;
|
|
1440
|
+
}
|
|
1441
|
+
.np-circular-btn .tw-icon {
|
|
1442
|
+
position: absolute;
|
|
1443
|
+
top: 16px;
|
|
1444
|
+
top: var(--size-16);
|
|
1445
|
+
pointer-events: none;
|
|
1446
|
+
color: white;
|
|
1447
|
+
transition: color 0.15s ease-in-out;
|
|
1448
|
+
width: 100%;
|
|
1449
|
+
left: 0;
|
|
1450
|
+
}
|
|
1451
|
+
[dir="rtl"] .np-circular-btn .tw-icon {
|
|
1452
|
+
right: 0;
|
|
1453
|
+
left: auto;
|
|
1454
|
+
left: initial;
|
|
1455
|
+
}
|
|
1456
|
+
@media (max-width: 320px) {
|
|
1457
|
+
.np-circular-btn .tw-icon {
|
|
1458
|
+
top: 12px;
|
|
1459
|
+
top: var(--size-12);
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
.np-circular-btn .tw-icon > svg {
|
|
1463
|
+
margin: 0 auto;
|
|
1464
|
+
}
|
|
1465
|
+
.np-theme-personal .np-circular-btn {
|
|
1466
|
+
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
1467
|
+
}
|
|
1468
|
+
.np-theme-personal .np-circular-btn .tw-icon,
|
|
1469
|
+
.np-theme-personal .np-circular-btn .tw-icon:hover,
|
|
1470
|
+
.np-theme-personal .np-circular-btn .tw-icon:active {
|
|
1471
|
+
color: var(--color-interactive-control);
|
|
1472
|
+
}
|
|
1473
|
+
.np-theme-personal .np-circular-btn.negative .tw-icon,
|
|
1474
|
+
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1475
|
+
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):active .tw-icon {
|
|
1476
|
+
color: var(--color-contrast) !important;
|
|
1477
|
+
}
|
|
1478
|
+
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled) .tw-icon {
|
|
1479
|
+
color: var(--color-sentiment-negative) !important;
|
|
1480
|
+
}
|
|
1481
|
+
.np-circular-btn.accent .np-circular-btn__label {
|
|
1482
|
+
color: #00a2dd;
|
|
1483
|
+
color: var(--color-interactive-accent);
|
|
1484
|
+
}
|
|
1485
|
+
.np-circular-btn.accent:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1486
|
+
color: #008fc9;
|
|
1487
|
+
color: var(--color-interactive-accent-hover);
|
|
1488
|
+
}
|
|
1489
|
+
.np-circular-btn.accent:active .np-circular-btn__label,
|
|
1490
|
+
.np-circular-btn.accent input[type="button"]:active ~ .np-circular-btn__label {
|
|
1491
|
+
color: #0081ba;
|
|
1492
|
+
color: var(--color-interactive-accent-active);
|
|
1446
1493
|
}
|
|
1447
|
-
.np-circular-btn
|
|
1448
|
-
|
|
1494
|
+
.np-circular-btn.accent.secondary .tw-icon {
|
|
1495
|
+
color: #00a2dd;
|
|
1496
|
+
color: var(--color-interactive-accent);
|
|
1497
|
+
}
|
|
1498
|
+
.np-circular-btn.accent.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1499
|
+
.np-circular-btn.accent.secondary input[type="button"]:active + .tw-icon {
|
|
1500
|
+
color: white;
|
|
1501
|
+
}
|
|
1502
|
+
.np-circular-btn.positive .np-circular-btn__label {
|
|
1503
|
+
color: #2ead4b;
|
|
1504
|
+
color: var(--color-interactive-positive);
|
|
1505
|
+
}
|
|
1506
|
+
.np-circular-btn.positive:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1507
|
+
color: #069939;
|
|
1508
|
+
color: var(--color-interactive-positive-hover);
|
|
1509
|
+
}
|
|
1510
|
+
.np-circular-btn.positive:active .np-circular-btn__label,
|
|
1511
|
+
.np-circular-btn.positive input[type="button"]:active ~ .np-circular-btn__label {
|
|
1512
|
+
color: #008b2b;
|
|
1513
|
+
color: var(--color-interactive-positive-active);
|
|
1514
|
+
}
|
|
1515
|
+
.np-circular-btn.positive.secondary .tw-icon {
|
|
1516
|
+
color: #2ead4b;
|
|
1517
|
+
color: var(--color-interactive-positive);
|
|
1518
|
+
}
|
|
1519
|
+
.np-circular-btn.positive.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1520
|
+
.np-circular-btn.positive.secondary input[type="button"]:active + .tw-icon {
|
|
1521
|
+
color: white;
|
|
1522
|
+
}
|
|
1523
|
+
.np-circular-btn.negative .np-circular-btn__label {
|
|
1524
|
+
color: #e74848;
|
|
1525
|
+
color: var(--color-interactive-negative);
|
|
1526
|
+
}
|
|
1527
|
+
.np-circular-btn.negative:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1528
|
+
color: #d03238;
|
|
1529
|
+
color: var(--color-interactive-negative-hover);
|
|
1530
|
+
}
|
|
1531
|
+
.np-circular-btn.negative:active .np-circular-btn__label,
|
|
1532
|
+
.np-circular-btn.negative input[type="button"]:active ~ .np-circular-btn__label {
|
|
1533
|
+
color: #bf1e2c;
|
|
1534
|
+
color: var(--color-interactive-negative-active);
|
|
1535
|
+
}
|
|
1536
|
+
.np-circular-btn.negative.secondary .tw-icon {
|
|
1537
|
+
color: #e74848;
|
|
1538
|
+
color: var(--color-interactive-negative);
|
|
1539
|
+
}
|
|
1540
|
+
.np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1541
|
+
.np-circular-btn.negative.secondary input[type="button"]:active + .tw-icon {
|
|
1542
|
+
color: white;
|
|
1543
|
+
}
|
|
1544
|
+
.np-theme-personal .np-circular-btn.accent .np-circular-btn__label {
|
|
1449
1545
|
color: var(--color-interactive-primary);
|
|
1450
1546
|
}
|
|
1451
|
-
.np-
|
|
1452
|
-
.np-circular-btn-secondary-default .np-circular-btn-label:not(.disabled):not(:disabled):hover {
|
|
1547
|
+
.np-theme-personal .np-circular-btn.accent:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1453
1548
|
color: var(--color-interactive-primary-hover);
|
|
1454
1549
|
}
|
|
1455
|
-
.np-
|
|
1456
|
-
.np-
|
|
1550
|
+
.np-theme-personal .np-circular-btn.accent:active .np-circular-btn__label,
|
|
1551
|
+
.np-theme-personal .np-circular-btn.accent input[type="button"]:active ~ .np-circular-btn__label {
|
|
1457
1552
|
color: var(--color-interactive-primary-active);
|
|
1458
1553
|
}
|
|
1459
|
-
.np-
|
|
1460
|
-
|
|
1461
|
-
|
|
1554
|
+
.np-theme-personal .np-circular-btn.accent.secondary .tw-icon {
|
|
1555
|
+
color: var(--color-interactive-primary);
|
|
1556
|
+
}
|
|
1557
|
+
.np-theme-personal .np-circular-btn.accent.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1558
|
+
.np-theme-personal .np-circular-btn.accent.secondary input[type="button"]:active + .tw-icon {
|
|
1559
|
+
color: white;
|
|
1560
|
+
color: var(--color-interactive-control);
|
|
1462
1561
|
}
|
|
1463
|
-
.np-
|
|
1464
|
-
|
|
1465
|
-
color: var(--color-sentiment-negative-primary-hover);
|
|
1562
|
+
.np-theme-personal .np-circular-btn.accent.secondary:active input[type="button"] + .tw-icon {
|
|
1563
|
+
color: var(--color-interactive-control);
|
|
1466
1564
|
}
|
|
1467
|
-
.np-circular-btn
|
|
1468
|
-
|
|
1469
|
-
color: var(--color-sentiment-negative-primary-active);
|
|
1565
|
+
.np-theme-personal .np-circular-btn.positive .np-circular-btn__label {
|
|
1566
|
+
color: var(--color-interactive-primary);
|
|
1470
1567
|
}
|
|
1471
|
-
.np-circular-btn
|
|
1472
|
-
|
|
1568
|
+
.np-theme-personal .np-circular-btn.positive:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1569
|
+
color: var(--color-interactive-primary-hover);
|
|
1570
|
+
}
|
|
1571
|
+
.np-theme-personal .np-circular-btn.positive:active .np-circular-btn__label,
|
|
1572
|
+
.np-theme-personal .np-circular-btn.positive input[type="button"]:active ~ .np-circular-btn__label {
|
|
1573
|
+
color: var(--color-interactive-primary-active);
|
|
1574
|
+
}
|
|
1575
|
+
.np-theme-personal .np-circular-btn.positive.secondary .tw-icon {
|
|
1576
|
+
color: var(--color-interactive-primary);
|
|
1577
|
+
}
|
|
1578
|
+
.np-theme-personal .np-circular-btn.positive.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1579
|
+
.np-theme-personal .np-circular-btn.positive.secondary input[type="button"]:active + .tw-icon {
|
|
1580
|
+
color: white;
|
|
1581
|
+
color: var(--color-interactive-control);
|
|
1582
|
+
}
|
|
1583
|
+
.np-theme-personal .np-circular-btn.positive.secondary:active input[type="button"] + .tw-icon {
|
|
1584
|
+
color: var(--color-interactive-control);
|
|
1585
|
+
}
|
|
1586
|
+
.np-theme-personal .np-circular-btn.negative .np-circular-btn__label {
|
|
1587
|
+
color: var(--color-sentiment-negative);
|
|
1588
|
+
}
|
|
1589
|
+
.np-theme-personal .np-circular-btn.negative:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1590
|
+
color: var(--color-sentiment-negative-hover);
|
|
1591
|
+
}
|
|
1592
|
+
.np-theme-personal .np-circular-btn.negative:active .np-circular-btn__label,
|
|
1593
|
+
.np-theme-personal .np-circular-btn.negative input[type="button"]:active ~ .np-circular-btn__label {
|
|
1594
|
+
color: var(--color-sentiment-negative-active);
|
|
1595
|
+
}
|
|
1596
|
+
.np-theme-personal .np-circular-btn.negative.secondary .tw-icon {
|
|
1597
|
+
color: var(--color-sentiment-negative);
|
|
1598
|
+
}
|
|
1599
|
+
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1600
|
+
.np-theme-personal .np-circular-btn.negative.secondary input[type="button"]:active + .tw-icon {
|
|
1601
|
+
color: white;
|
|
1602
|
+
color: var(--color-interactive-control);
|
|
1603
|
+
}
|
|
1604
|
+
.np-theme-personal .np-circular-btn.negative.secondary:active input[type="button"] + .tw-icon {
|
|
1605
|
+
color: var(--color-interactive-control);
|
|
1473
1606
|
}
|
|
1474
1607
|
.np-circle {
|
|
1475
1608
|
border-radius: 9999px;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { shallow, mount } from 'enzyme';
|
|
2
|
+
|
|
3
|
+
import SlidingPanel from './SlidingPanel';
|
|
4
|
+
|
|
5
|
+
describe('SlidingPanel', () => {
|
|
6
|
+
let component;
|
|
7
|
+
const props = {
|
|
8
|
+
open: true,
|
|
9
|
+
position: 'left',
|
|
10
|
+
children: null,
|
|
11
|
+
className: undefined,
|
|
12
|
+
slidingPanelPositionFixed: false,
|
|
13
|
+
showSlidingPanelBorder: false,
|
|
14
|
+
testId: undefined,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
it('renders with right props', () => {
|
|
18
|
+
component = mount(<SlidingPanel {...props} />);
|
|
19
|
+
expect(component.find(SlidingPanel)).toHaveLength(1);
|
|
20
|
+
expect(component.find(SlidingPanel).props()).toStrictEqual({ ...props });
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('renders CSSTransition with right props', () => {
|
|
24
|
+
component = shallow(<SlidingPanel {...props} />);
|
|
25
|
+
|
|
26
|
+
expect(cssTransition()).toHaveLength(1);
|
|
27
|
+
|
|
28
|
+
expect(cssTransition().props()).toEqual({
|
|
29
|
+
className: 'sliding-panel sliding-panel--open-left',
|
|
30
|
+
children: null,
|
|
31
|
+
});
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('adds fixed class', () => {
|
|
35
|
+
component = shallow(<SlidingPanel {...props} slidingPanelPositionFixed />);
|
|
36
|
+
expect(cssTransition().prop('className')).toBe(
|
|
37
|
+
'sliding-panel sliding-panel--open-left sliding-panel--fixed',
|
|
38
|
+
);
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
it('adds border classes if showSlidingPanelBorder is set to true', () => {
|
|
42
|
+
component = shallow(<SlidingPanel {...props} showSlidingPanelBorder />);
|
|
43
|
+
expect(cssTransition().prop('className')).toBe(
|
|
44
|
+
'sliding-panel sliding-panel--open-left sliding-panel--border-left',
|
|
45
|
+
);
|
|
46
|
+
component = shallow(<SlidingPanel {...props} showSlidingPanelBorder={false} position="left" />);
|
|
47
|
+
expect(cssTransition().prop('className')).toBe('sliding-panel sliding-panel--open-left');
|
|
48
|
+
|
|
49
|
+
component = shallow(<SlidingPanel {...props} showSlidingPanelBorder position="top" />);
|
|
50
|
+
expect(cssTransition().prop('className')).toBe(
|
|
51
|
+
'sliding-panel sliding-panel--open-top sliding-panel--border-top',
|
|
52
|
+
);
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const cssTransition = () => component.find('div');
|
|
56
|
+
});
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { render, screen } from '../test-utils';
|
|
2
|
-
import SlidingPanel, { SlidingPanelProps } from './SlidingPanel';
|
|
3
|
-
|
|
4
|
-
describe('SlidingPanel', () => {
|
|
5
|
-
const initialProps: SlidingPanelProps = {
|
|
6
|
-
open: true,
|
|
7
|
-
children: <div data-testid="content">Content</div>,
|
|
8
|
-
testId: 'wrapper',
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const customRender = (overrides: Partial<SlidingPanelProps> = {}) =>
|
|
12
|
-
render(<SlidingPanel {...initialProps} {...overrides} />);
|
|
13
|
-
|
|
14
|
-
describe('open', () => {
|
|
15
|
-
it('should respect open=false', () => {
|
|
16
|
-
customRender({ open: false });
|
|
17
|
-
expect(screen.queryByTestId('wrapper')).not.toBeInTheDocument();
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it('should respect open=true', () => {
|
|
21
|
-
customRender();
|
|
22
|
-
expect(screen.getByTestId('wrapper')).toBeInTheDocument();
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
describe('position', () => {
|
|
27
|
-
it(`should default to 'left'`, () => {
|
|
28
|
-
customRender();
|
|
29
|
-
expect(screen.queryByTestId('wrapper')).toHaveClass(`sliding-panel--open-left`);
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
(['left', 'right', 'top', 'bottom'] as const).forEach((position) => {
|
|
33
|
-
describe(position, () => {
|
|
34
|
-
it(`should add the classname`, () => {
|
|
35
|
-
customRender({ position });
|
|
36
|
-
expect(screen.queryByTestId('wrapper')).toHaveClass(`sliding-panel--open-${position}`);
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
it(`should add the classname for 'showSlidingPanelBorder'`, () => {
|
|
40
|
-
customRender({ position, showSlidingPanelBorder: true });
|
|
41
|
-
expect(screen.queryByTestId('wrapper')).toHaveClass(`sliding-panel--border-${position}`);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it('should render children', () => {
|
|
48
|
-
customRender();
|
|
49
|
-
expect(screen.getByTestId('content')).toBeInTheDocument();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('should respect className', () => {
|
|
53
|
-
const className = 'customClass';
|
|
54
|
-
customRender({ className });
|
|
55
|
-
expect(screen.getByTestId('wrapper')).toHaveClass(className);
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
describe('slidingPanelPositionFixed', () => {
|
|
59
|
-
it('should not be fixed by default', () => {
|
|
60
|
-
customRender();
|
|
61
|
-
expect(screen.getByTestId('wrapper')).not.toHaveClass('sliding-panel--fixed');
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
it('should respect slidingPanelPositionFixed=true', () => {
|
|
65
|
-
customRender({ slidingPanelPositionFixed: true });
|
|
66
|
-
expect(screen.getByTestId('wrapper')).toHaveClass('sliding-panel--fixed');
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
});
|