@transferwise/components 0.0.0-experimental-bc13343 → 0.0.0-experimental-739bfcf
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/avatarLayout/AvatarLayout.js +9 -2
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +9 -2
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/button/Button.js +78 -79
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +79 -80
- package/build/button/Button.mjs.map +1 -1
- package/build/button/Button.resolver.js +78 -0
- package/build/button/Button.resolver.js.map +1 -0
- package/build/button/Button.resolver.mjs +76 -0
- package/build/button/Button.resolver.mjs.map +1 -0
- package/build/button/LegacyButton.js +114 -0
- package/build/button/LegacyButton.js.map +1 -0
- package/build/button/LegacyButton.mjs +112 -0
- package/build/button/LegacyButton.mjs.map +1 -0
- package/build/criticalBanner/CriticalCommsBanner.js +2 -2
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +1 -1
- package/build/header/Header.js +2 -2
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/i18n/ja.json +0 -1
- package/build/i18n/ja.json.js +0 -1
- package/build/i18n/ja.json.js.map +1 -1
- package/build/i18n/ja.json.mjs +0 -1
- package/build/i18n/ja.json.mjs.map +1 -1
- package/build/i18n/pt.json +0 -1
- package/build/i18n/pt.json.js +0 -1
- package/build/i18n/pt.json.js.map +1 -1
- package/build/i18n/pt.json.mjs +0 -1
- package/build/i18n/pt.json.mjs.map +1 -1
- package/build/i18n/ru.json +0 -1
- package/build/i18n/ru.json.js +0 -1
- package/build/i18n/ru.json.js.map +1 -1
- package/build/i18n/ru.json.mjs +0 -1
- package/build/i18n/ru.json.mjs.map +1 -1
- package/build/i18n/zh-HK.json +0 -1
- package/build/i18n/zh-HK.json.js +0 -1
- package/build/i18n/zh-HK.json.js.map +1 -1
- package/build/i18n/zh-HK.json.mjs +0 -1
- package/build/i18n/zh-HK.json.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/link/Link.js +8 -3
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +8 -3
- package/build/link/Link.mjs.map +1 -1
- package/build/main.css +250 -0
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +1 -3
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +1 -3
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +1 -4
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +1 -4
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -1
- package/build/select/Select.js +5 -3
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +4 -2
- package/build/select/Select.mjs.map +1 -1
- package/build/styles/avatarLayout/AvatarLayout.css +11 -0
- package/build/styles/button/Button.css +231 -15
- package/build/styles/button/Button.vars.css +38 -0
- package/build/styles/button/LegacyButton.css +23 -0
- package/build/styles/main.css +250 -0
- package/build/types/avatarLayout/AvatarLayout.d.ts +1 -2
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/avatarLayout/index.d.ts +1 -0
- package/build/types/avatarLayout/index.d.ts.map +1 -1
- package/build/types/button/Button.d.ts +1 -23
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.resolver.d.ts +31 -0
- package/build/types/button/Button.resolver.d.ts.map +1 -0
- package/build/types/button/Button.types.d.ts +65 -0
- package/build/types/button/Button.types.d.ts.map +1 -0
- package/build/types/button/LegacyButton.d.ts +30 -0
- package/build/types/button/LegacyButton.d.ts.map +1 -0
- package/build/types/button/index.d.ts +2 -2
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/link/Link.d.ts +2 -2
- package/build/types/link/Link.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts +5 -1
- package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +1 -1
- package/build/types/select/Select.d.ts.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +2 -2
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -1
- package/build/upload/steps/processingStep/processingStep.js +2 -2
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -1
- package/build/uploadInput/UploadInput.js +3 -3
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/package.json +3 -3
- package/src/avatarLayout/AvatarLayout.css +11 -0
- package/src/avatarLayout/AvatarLayout.less +18 -1
- package/src/avatarLayout/AvatarLayout.tsx +11 -3
- package/src/avatarLayout/index.ts +1 -0
- package/src/button/Button.css +231 -15
- package/src/button/Button.less +232 -14
- package/src/button/Button.resolver.tsx +120 -0
- package/src/button/Button.spec.tsx +54 -231
- package/src/button/Button.story.tsx +612 -137
- package/src/button/Button.tsx +88 -132
- package/src/button/Button.types.ts +86 -0
- package/src/button/Button.vars.css +38 -0
- package/src/button/Button.vars.less +46 -0
- package/src/button/LegacyButton.css +23 -0
- package/src/button/LegacyButton.less +24 -0
- package/src/button/LegacyButton.spec.tsx +146 -0
- package/src/button/LegacyButton.story.tsx +224 -0
- package/src/button/LegacyButton.tsx +161 -0
- package/src/button/index.ts +2 -3
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -1
- package/src/i18n/ja.json +0 -1
- package/src/i18n/pt.json +0 -1
- package/src/i18n/ru.json +0 -1
- package/src/i18n/zh-HK.json +0 -1
- package/src/inputs/SelectInput.story.tsx +1 -1
- package/src/link/Link.tsx +15 -6
- package/src/main.css +250 -0
- package/src/main.less +1 -0
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +1 -7
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +6 -1
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +1 -3
- package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +1 -8
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +2 -5
- package/src/select/Select.tsx +1 -0
- package/src/button/__snapshots__/Button.spec.tsx.snap +0 -309
package/src/main.css
CHANGED
|
@@ -518,10 +518,18 @@ div.critical-comms .critical-comms-body {
|
|
|
518
518
|
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) right calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
519
519
|
mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) right calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
520
520
|
}
|
|
521
|
+
[dir="rtl"] .np-avatar-layout-diagonal-mask {
|
|
522
|
+
-webkit-mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) left calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
523
|
+
mask-image: radial-gradient(circle at bottom calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)) left calc(100% - var(--np-avatar-size) - var(--np-avatar-offset)), transparent 0, transparent calc(var(--np-avatar-size) / 2 + 2px), black 0);
|
|
524
|
+
}
|
|
521
525
|
.np-avatar-layout-diagonal-child {
|
|
522
526
|
margin-left: calc(var(--np-avatar-layout-size) - var(--np-avatar-size) * 2);
|
|
523
527
|
margin-top: calc(var(--np-avatar-layout-size) - var(--np-avatar-size));
|
|
524
528
|
}
|
|
529
|
+
[dir="rtl"] .np-avatar-layout-diagonal-child {
|
|
530
|
+
margin-left: 0;
|
|
531
|
+
margin-right: calc(var(--np-avatar-layout-size) - var(--np-avatar-size) * 2);
|
|
532
|
+
}
|
|
525
533
|
.np-avatar-layout-horizontal {
|
|
526
534
|
width: calc(var(--np-avatar-size) * 2 - var(--np-avatar-offset));
|
|
527
535
|
height: var(--np-avatar-layout-size);
|
|
@@ -535,6 +543,9 @@ div.critical-comms .critical-comms-body {
|
|
|
535
543
|
.np-avatar-layout-horizontal-child {
|
|
536
544
|
margin-left: calc(var(--np-avatar-offset) * -1);
|
|
537
545
|
}
|
|
546
|
+
[dir="rtl"] .np-avatar-layout-horizontal-child {
|
|
547
|
+
margin-right: calc(var(--np-avatar-offset) * -1);
|
|
548
|
+
}
|
|
538
549
|
.np-icon-button {
|
|
539
550
|
border: none;
|
|
540
551
|
}
|
|
@@ -705,6 +716,245 @@ div.critical-comms .critical-comms-body {
|
|
|
705
716
|
.np-btn.disabled[class] {
|
|
706
717
|
pointer-events: auto;
|
|
707
718
|
}
|
|
719
|
+
.wds-Button {
|
|
720
|
+
--Button-background: var(--color-interactive-accent);
|
|
721
|
+
--Button-background-hover: var(--color-interactive-accent-hover);
|
|
722
|
+
--Button-background-active: var(--color-interactive-accent-active);
|
|
723
|
+
--Button-color: var(--color-interactive-control);
|
|
724
|
+
--Button-padding: var(--size-8) var(--size-12);
|
|
725
|
+
--Button-border-radius: var(--radius-full);
|
|
726
|
+
--Button-size-small-padding: 5px var(--size-12);
|
|
727
|
+
--Button-size-medium-padding: var(--size-8) var(--size-12);
|
|
728
|
+
--Button-size-large-padding: var(--size-12) var(--size-16);
|
|
729
|
+
--Button-transition-duration: 150ms;
|
|
730
|
+
--Button-transition-easing: ease-in-out;
|
|
731
|
+
--Button-secondary-background: var(--color-interactive-neutral);
|
|
732
|
+
--Button-secondary-background-hover: var(--color-interactive-neutral-hover);
|
|
733
|
+
--Button-secondary-background-active: var(--color-interactive-neutral-active);
|
|
734
|
+
--Button-secondary-color: var(--color-interactive-primary);
|
|
735
|
+
--Button-tertiary-background: var(--color-background-neutral);
|
|
736
|
+
--Button-tertiary-background-hover: var(--color-background-neutral-hover);
|
|
737
|
+
--Button-tertiary-background-active: var(--color-background-neutral-active);
|
|
738
|
+
--Button-tertiary-color: var(--color-content-primary);
|
|
739
|
+
--Button-minimal-background: transparent;
|
|
740
|
+
--Button-minimal-background-hover: var(--color-background-screen-hover);
|
|
741
|
+
--Button-minimal-background-active: var(--color-background-screen-active);
|
|
742
|
+
--Button-minimal-color: var(--color-interactive-primary);
|
|
743
|
+
--Button-primary-negative-background: var(--color-sentiment-negative-primary);
|
|
744
|
+
--Button-primary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
745
|
+
--Button-primary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
746
|
+
--Button-primary-negative-color: var(--color-contrast);
|
|
747
|
+
--Button-secondary-negative-background: var(--color-sentiment-negative-secondary);
|
|
748
|
+
--Button-secondary-negative-background-hover: var(--color-sentiment-negative-secondary-hover);
|
|
749
|
+
--Button-secondary-negative-background-active: var(--color-sentiment-negative-secondary-active);
|
|
750
|
+
--Button-secondary-negative-color: var(--color-sentiment-negative-primary);
|
|
751
|
+
}
|
|
752
|
+
.np-theme-personal--bright-green .wds-Button {
|
|
753
|
+
--color-contrast: #FFFFFF;
|
|
754
|
+
--Button-secondary-color: var(--color-interactive-control);
|
|
755
|
+
--Button-secondary-negative-color: var(--color-contrast);
|
|
756
|
+
}
|
|
757
|
+
/* Button Styles */
|
|
758
|
+
.wds-Button {
|
|
759
|
+
display: inline-flex;
|
|
760
|
+
flex: none;
|
|
761
|
+
width: auto;
|
|
762
|
+
align-items: center;
|
|
763
|
+
justify-content: center;
|
|
764
|
+
vertical-align: middle;
|
|
765
|
+
text-align: center;
|
|
766
|
+
-webkit-text-decoration: none;
|
|
767
|
+
text-decoration: none;
|
|
768
|
+
white-space: nowrap;
|
|
769
|
+
word-wrap: break-word;
|
|
770
|
+
-webkit-appearance: none;
|
|
771
|
+
-moz-appearance: none;
|
|
772
|
+
appearance: none;
|
|
773
|
+
background-color: var(--Button-background);
|
|
774
|
+
border: none;
|
|
775
|
+
border-radius: var(--Button-border-radius);
|
|
776
|
+
color: var(--Button-color);
|
|
777
|
+
cursor: pointer;
|
|
778
|
+
padding: var(--Button-padding);
|
|
779
|
+
transition: color, background-color var(--Button-transition-duration) var(--Button-transition-easing);
|
|
780
|
+
}
|
|
781
|
+
.wds-Button:focus {
|
|
782
|
+
-webkit-text-decoration: none;
|
|
783
|
+
text-decoration: none;
|
|
784
|
+
}
|
|
785
|
+
.wds-Button:hover {
|
|
786
|
+
background-color: var(--Button-background-hover);
|
|
787
|
+
-webkit-text-decoration: none;
|
|
788
|
+
text-decoration: none;
|
|
789
|
+
}
|
|
790
|
+
.wds-Button:active {
|
|
791
|
+
background-color: var(--Button-background-active);
|
|
792
|
+
-webkit-text-decoration: none;
|
|
793
|
+
text-decoration: none;
|
|
794
|
+
}
|
|
795
|
+
.wds-Button.wds-Button--disabled,
|
|
796
|
+
.wds-Button:disabled {
|
|
797
|
+
mix-blend-mode: luminosity;
|
|
798
|
+
opacity: 0.45;
|
|
799
|
+
cursor: not-allowed;
|
|
800
|
+
}
|
|
801
|
+
.wds-Button.wds-Button--disabled:hover,
|
|
802
|
+
.wds-Button:disabled:hover,
|
|
803
|
+
.wds-Button.wds-Button--disabled:active,
|
|
804
|
+
.wds-Button:disabled:active {
|
|
805
|
+
background-color: var(--Button-background);
|
|
806
|
+
}
|
|
807
|
+
.wds-Button--secondary {
|
|
808
|
+
--Button-background: var(--Button-secondary-background);
|
|
809
|
+
--Button-background-hover: var(--Button-secondary-background-hover);
|
|
810
|
+
--Button-background-active: var(--Button-secondary-background-active);
|
|
811
|
+
--Button-color: var(--Button-secondary-color);
|
|
812
|
+
}
|
|
813
|
+
.wds-Button--tertiary {
|
|
814
|
+
--Button-background: var(--Button-tertiary-background);
|
|
815
|
+
--Button-background-hover: var(--Button-tertiary-background-hover);
|
|
816
|
+
--Button-background-active: var(--Button-tertiary-background-active);
|
|
817
|
+
--Button-color: var(--Button-tertiary-color);
|
|
818
|
+
}
|
|
819
|
+
.wds-Button--tertiary .wds-Button-icon--end {
|
|
820
|
+
color: var(--color-interactive-primary);
|
|
821
|
+
}
|
|
822
|
+
.wds-Button--minimal {
|
|
823
|
+
--Button-background: var(--Button-minimal-background);
|
|
824
|
+
--Button-background-hover: var(--Button-minimal-background-hover);
|
|
825
|
+
--Button-background-active: var(--Button-minimal-background-active);
|
|
826
|
+
--Button-color: var(--Button-minimal-color);
|
|
827
|
+
-webkit-text-decoration: underline;
|
|
828
|
+
text-decoration: underline;
|
|
829
|
+
text-underline-offset: 3px;
|
|
830
|
+
text-decoration-thickness: 1px;
|
|
831
|
+
}
|
|
832
|
+
.wds-Button--minimal:hover,
|
|
833
|
+
.wds-Button--minimal:hover:active {
|
|
834
|
+
-webkit-text-decoration: underline;
|
|
835
|
+
text-decoration: underline;
|
|
836
|
+
}
|
|
837
|
+
.wds-Button--negative.wds-Button--primary {
|
|
838
|
+
--Button-background: var(--Button-primary-negative-background);
|
|
839
|
+
--Button-background-hover: var(--Button-primary-negative-background-hover);
|
|
840
|
+
--Button-background-active: var(--Button-primary-negative-background-active);
|
|
841
|
+
--Button-color: var(--Button-primary-negative-color);
|
|
842
|
+
}
|
|
843
|
+
.wds-Button--negative.wds-Button--secondary {
|
|
844
|
+
--Button-background: var(--Button-secondary-negative-background);
|
|
845
|
+
--Button-background-hover: var(--Button-secondary-negative-background-hover);
|
|
846
|
+
--Button-background-active: var(--Button-secondary-negative-background-active);
|
|
847
|
+
--Button-color: var(--Button-secondary-negative-color);
|
|
848
|
+
}
|
|
849
|
+
.wds-Button--small {
|
|
850
|
+
--Button-padding: var(--Button-size-small-padding);
|
|
851
|
+
}
|
|
852
|
+
.wds-Button--small .wds-Button-icon--start {
|
|
853
|
+
margin-right: 4px;
|
|
854
|
+
margin-right: var(--size-4);
|
|
855
|
+
}
|
|
856
|
+
[dir="rtl"] .wds-Button--small .wds-Button-icon--start {
|
|
857
|
+
margin-right: 0;
|
|
858
|
+
margin-left: 4px;
|
|
859
|
+
margin-left: var(--size-4);
|
|
860
|
+
}
|
|
861
|
+
.wds-Button--medium {
|
|
862
|
+
--Button-padding: var(--Button-size-medium-padding);
|
|
863
|
+
}
|
|
864
|
+
.wds-Button--large {
|
|
865
|
+
--Button-padding: var(--Button-size-large-padding);
|
|
866
|
+
}
|
|
867
|
+
.wds-Button--block {
|
|
868
|
+
width: 100%;
|
|
869
|
+
}
|
|
870
|
+
.wds-Button-avatars {
|
|
871
|
+
display: inline-flex;
|
|
872
|
+
margin-right: 5px;
|
|
873
|
+
margin-left: calc(4px * -1);
|
|
874
|
+
margin-left: calc(var(--size-4) * -1);
|
|
875
|
+
}
|
|
876
|
+
[dir="rtl"] .wds-Button-avatars {
|
|
877
|
+
margin-right: 0;
|
|
878
|
+
margin-left: 5px;
|
|
879
|
+
}
|
|
880
|
+
.wds-Button-avatars .np-avatar-view .np-avatar-view-content {
|
|
881
|
+
color: var(--Button-color);
|
|
882
|
+
}
|
|
883
|
+
.wds-Button-icon {
|
|
884
|
+
display: inline-block;
|
|
885
|
+
}
|
|
886
|
+
.wds-Button-icon--start {
|
|
887
|
+
margin-right: 8px;
|
|
888
|
+
margin-right: var(--size-8);
|
|
889
|
+
}
|
|
890
|
+
[dir="rtl"] .wds-Button-icon--start {
|
|
891
|
+
margin-right: 0;
|
|
892
|
+
margin-left: 8px;
|
|
893
|
+
margin-left: var(--size-8);
|
|
894
|
+
}
|
|
895
|
+
.wds-Button-icon--end {
|
|
896
|
+
margin-left: 4px;
|
|
897
|
+
margin-left: var(--size-4);
|
|
898
|
+
}
|
|
899
|
+
[dir="rtl"] .wds-Button-icon--end {
|
|
900
|
+
margin-left: 0;
|
|
901
|
+
margin-right: 4px;
|
|
902
|
+
margin-right: var(--size-4);
|
|
903
|
+
}
|
|
904
|
+
.wds-Button-content {
|
|
905
|
+
position: relative;
|
|
906
|
+
}
|
|
907
|
+
.wds-Button-content--loading .wds-Button-label,
|
|
908
|
+
.wds-Button-content--loading .wds-Button-media,
|
|
909
|
+
.wds-Button-content--loading .wds-Button-icon {
|
|
910
|
+
visibility: hidden;
|
|
911
|
+
opacity: 0;
|
|
912
|
+
}
|
|
913
|
+
.wds-Button-label {
|
|
914
|
+
display: flex;
|
|
915
|
+
justify-content: center;
|
|
916
|
+
align-items: center;
|
|
917
|
+
position: relative;
|
|
918
|
+
}
|
|
919
|
+
.wds-Button-loader {
|
|
920
|
+
position: absolute;
|
|
921
|
+
display: flex;
|
|
922
|
+
justify-content: center;
|
|
923
|
+
align-items: center;
|
|
924
|
+
width: 100%;
|
|
925
|
+
height: 100%;
|
|
926
|
+
}
|
|
927
|
+
.wds-Button-loader .process-circle {
|
|
928
|
+
stroke: var(--Button-color);
|
|
929
|
+
}
|
|
930
|
+
/* RTL Styles */
|
|
931
|
+
[dir="rtl"] .wds-Button .tw-icon-chevron-right,[dir="rtl"] .wds-Button .tw-icon-arrow-right {
|
|
932
|
+
transform: rotate(180deg);
|
|
933
|
+
}
|
|
934
|
+
[dir="rtl"] .wds-Button .tw-icon-chevron-left,[dir="rtl"] .wds-Button .tw-icon-arrow-left {
|
|
935
|
+
transform: rotate(180deg);
|
|
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
|
+
}
|
|
708
958
|
.np-card {
|
|
709
959
|
overflow: hidden;
|
|
710
960
|
transition-property: transform, box-shadow;
|
package/src/main.less
CHANGED
|
@@ -30,13 +30,7 @@ const PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(
|
|
|
30
30
|
},
|
|
31
31
|
ref,
|
|
32
32
|
) => {
|
|
33
|
-
const anchorClasses = clsx(
|
|
34
|
-
'wds-Anchor',
|
|
35
|
-
{
|
|
36
|
-
'wds-Anchor--disabled': disabled,
|
|
37
|
-
},
|
|
38
|
-
className,
|
|
39
|
-
);
|
|
33
|
+
const anchorClasses = clsx(className);
|
|
40
34
|
|
|
41
35
|
const handleClick = useCallback(
|
|
42
36
|
(event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
@@ -18,11 +18,16 @@ export interface PrimitiveAnchorProps
|
|
|
18
18
|
children?: ReactNode;
|
|
19
19
|
|
|
20
20
|
/** The URL to navigate to when the anchor is clicked */
|
|
21
|
-
href
|
|
21
|
+
href?: string | undefined;
|
|
22
22
|
|
|
23
23
|
/** Disable the anchor */
|
|
24
24
|
disabled?: boolean;
|
|
25
25
|
|
|
26
26
|
/** Reference to the anchor element */
|
|
27
27
|
ref?: PrimitiveAnchorElementRef;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* HTML anchor `target` attribute. If set to `_blank`, `rel="noopener noreferrer"` is automatically added to the rendered node.
|
|
31
|
+
*/
|
|
32
|
+
target?: HTMLAnchorElement['target'];
|
|
28
33
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import PrimitiveAnchor from '
|
|
2
|
+
import PrimitiveAnchor from '../src';
|
|
3
3
|
|
|
4
4
|
describe('PrimitiveAnchor', () => {
|
|
5
5
|
const defaultProps = {
|
|
@@ -27,7 +27,6 @@ describe('PrimitiveAnchor', () => {
|
|
|
27
27
|
renderAnchor(props);
|
|
28
28
|
|
|
29
29
|
const link = screen.getByRole('link');
|
|
30
|
-
expect(link).toHaveClass('wds-Anchor');
|
|
31
30
|
expect(link).toHaveClass('custom-class');
|
|
32
31
|
});
|
|
33
32
|
|
|
@@ -41,7 +40,6 @@ describe('PrimitiveAnchor', () => {
|
|
|
41
40
|
|
|
42
41
|
const link = screen.getByRole('link');
|
|
43
42
|
expect(link).toHaveAttribute('aria-disabled', 'true');
|
|
44
|
-
expect(link).toHaveClass('wds-Anchor--disabled');
|
|
45
43
|
expect(link).not.toHaveAttribute('href', 'https://example.com');
|
|
46
44
|
});
|
|
47
45
|
|
|
@@ -35,14 +35,7 @@ const PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(
|
|
|
35
35
|
ref,
|
|
36
36
|
) => {
|
|
37
37
|
const intl = useIntl();
|
|
38
|
-
const classNames = clsx(
|
|
39
|
-
'wds-Button',
|
|
40
|
-
{
|
|
41
|
-
'wds-Button--disabled': disabled,
|
|
42
|
-
'wds-Button--loading': loading,
|
|
43
|
-
},
|
|
44
|
-
className,
|
|
45
|
-
);
|
|
38
|
+
const classNames = clsx(className);
|
|
46
39
|
|
|
47
40
|
const handleClick = useCallback(
|
|
48
41
|
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import PrimitiveButton from '..';
|
|
1
|
+
import { screen } from '@testing-library/react';
|
|
2
|
+
import PrimitiveButton from '../src';
|
|
4
3
|
import messages from '../../../i18n/commonMessages/Button.messages';
|
|
5
4
|
import { render } from '../../../test-utils';
|
|
6
5
|
|
|
@@ -36,7 +35,6 @@ describe('Button', () => {
|
|
|
36
35
|
renderButton(props);
|
|
37
36
|
|
|
38
37
|
const button = screen.getByRole('button');
|
|
39
|
-
expect(button).toHaveClass('wds-Button');
|
|
40
38
|
expect(button).toHaveClass('custom-class');
|
|
41
39
|
});
|
|
42
40
|
|
|
@@ -49,7 +47,6 @@ describe('Button', () => {
|
|
|
49
47
|
renderButton(props);
|
|
50
48
|
|
|
51
49
|
const button = screen.getByRole('button');
|
|
52
|
-
expect(button).toHaveClass('wds-Button--disabled');
|
|
53
50
|
expect(button).toBeDisabled();
|
|
54
51
|
});
|
|
55
52
|
|
package/src/select/Select.tsx
CHANGED
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`Button by default renders a medium button of type accent and priority primary 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<button
|
|
6
|
-
aria-busy="false"
|
|
7
|
-
aria-disabled="false"
|
|
8
|
-
aria-live="off"
|
|
9
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-1"
|
|
10
|
-
type="button"
|
|
11
|
-
>
|
|
12
|
-
Send money
|
|
13
|
-
</button>
|
|
14
|
-
</div>
|
|
15
|
-
`;
|
|
16
|
-
|
|
17
|
-
exports[`Button by default renders an anchor tag with button styles of type accent and priority primary 1`] = `
|
|
18
|
-
<div>
|
|
19
|
-
<a
|
|
20
|
-
aria-busy="false"
|
|
21
|
-
aria-disabled="false"
|
|
22
|
-
aria-live="off"
|
|
23
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-1"
|
|
24
|
-
href="#"
|
|
25
|
-
>
|
|
26
|
-
Send money
|
|
27
|
-
</a>
|
|
28
|
-
</div>
|
|
29
|
-
`;
|
|
30
|
-
|
|
31
|
-
exports[`Button deprecated types renders danger as negative buttons with priority secondary and logs a warning 1`] = `
|
|
32
|
-
<div>
|
|
33
|
-
<button
|
|
34
|
-
aria-busy="false"
|
|
35
|
-
aria-disabled="false"
|
|
36
|
-
aria-live="off"
|
|
37
|
-
class="btn btn-md np-btn np-btn-md btn-negative btn-priority-2"
|
|
38
|
-
type="button"
|
|
39
|
-
>
|
|
40
|
-
Send money
|
|
41
|
-
</button>
|
|
42
|
-
</div>
|
|
43
|
-
`;
|
|
44
|
-
|
|
45
|
-
exports[`Button deprecated types renders link as accent buttons with priority tertiary and logs a warning 1`] = `
|
|
46
|
-
<div>
|
|
47
|
-
<button
|
|
48
|
-
aria-busy="false"
|
|
49
|
-
aria-disabled="false"
|
|
50
|
-
aria-live="off"
|
|
51
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-3"
|
|
52
|
-
type="button"
|
|
53
|
-
>
|
|
54
|
-
Send money
|
|
55
|
-
</button>
|
|
56
|
-
</div>
|
|
57
|
-
`;
|
|
58
|
-
|
|
59
|
-
exports[`Button deprecated types renders pay as positive buttons and logs a warning 1`] = `
|
|
60
|
-
<div>
|
|
61
|
-
<button
|
|
62
|
-
aria-busy="false"
|
|
63
|
-
aria-disabled="false"
|
|
64
|
-
aria-live="off"
|
|
65
|
-
class="btn btn-md np-btn np-btn-md btn-positive btn-priority-1"
|
|
66
|
-
type="button"
|
|
67
|
-
>
|
|
68
|
-
Send money
|
|
69
|
-
</button>
|
|
70
|
-
</div>
|
|
71
|
-
`;
|
|
72
|
-
|
|
73
|
-
exports[`Button deprecated types renders primary as accent buttons and logs a warning 1`] = `
|
|
74
|
-
<div>
|
|
75
|
-
<button
|
|
76
|
-
aria-busy="false"
|
|
77
|
-
aria-disabled="false"
|
|
78
|
-
aria-live="off"
|
|
79
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-1"
|
|
80
|
-
type="button"
|
|
81
|
-
>
|
|
82
|
-
Send money
|
|
83
|
-
</button>
|
|
84
|
-
</div>
|
|
85
|
-
`;
|
|
86
|
-
|
|
87
|
-
exports[`Button other states renders as block if block is true 1`] = `
|
|
88
|
-
<div>
|
|
89
|
-
<button
|
|
90
|
-
aria-busy="false"
|
|
91
|
-
aria-disabled="false"
|
|
92
|
-
aria-live="off"
|
|
93
|
-
class="btn btn-md np-btn np-btn-md btn-block np-btn-block btn-accent btn-priority-1"
|
|
94
|
-
type="button"
|
|
95
|
-
>
|
|
96
|
-
Send money
|
|
97
|
-
</button>
|
|
98
|
-
</div>
|
|
99
|
-
`;
|
|
100
|
-
|
|
101
|
-
exports[`Button priorities defaults tertiary buttons to secondary for positive buttons 1`] = `
|
|
102
|
-
<div>
|
|
103
|
-
<button
|
|
104
|
-
aria-busy="false"
|
|
105
|
-
aria-disabled="false"
|
|
106
|
-
aria-live="off"
|
|
107
|
-
class="btn btn-md np-btn np-btn-md btn-positive btn-priority-2"
|
|
108
|
-
type="button"
|
|
109
|
-
>
|
|
110
|
-
Send money
|
|
111
|
-
</button>
|
|
112
|
-
</div>
|
|
113
|
-
`;
|
|
114
|
-
|
|
115
|
-
exports[`Button priorities defaults tertiary buttons to secondary for positive buttons 2`] = `
|
|
116
|
-
<div>
|
|
117
|
-
<button
|
|
118
|
-
aria-busy="false"
|
|
119
|
-
aria-disabled="false"
|
|
120
|
-
aria-live="off"
|
|
121
|
-
class="btn btn-md np-btn np-btn-md btn-negative btn-priority-2"
|
|
122
|
-
type="button"
|
|
123
|
-
>
|
|
124
|
-
Send money
|
|
125
|
-
</button>
|
|
126
|
-
</div>
|
|
127
|
-
`;
|
|
128
|
-
|
|
129
|
-
exports[`Button priorities renders primary buttons 1`] = `
|
|
130
|
-
<div>
|
|
131
|
-
<button
|
|
132
|
-
aria-busy="false"
|
|
133
|
-
aria-disabled="false"
|
|
134
|
-
aria-live="off"
|
|
135
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-1"
|
|
136
|
-
type="button"
|
|
137
|
-
>
|
|
138
|
-
Send money
|
|
139
|
-
</button>
|
|
140
|
-
</div>
|
|
141
|
-
`;
|
|
142
|
-
|
|
143
|
-
exports[`Button priorities renders primary buttons 2`] = `
|
|
144
|
-
<div>
|
|
145
|
-
<button
|
|
146
|
-
aria-busy="false"
|
|
147
|
-
aria-disabled="false"
|
|
148
|
-
aria-live="off"
|
|
149
|
-
class="btn btn-md np-btn np-btn-md btn-positive btn-priority-1"
|
|
150
|
-
type="button"
|
|
151
|
-
>
|
|
152
|
-
Send money
|
|
153
|
-
</button>
|
|
154
|
-
</div>
|
|
155
|
-
`;
|
|
156
|
-
|
|
157
|
-
exports[`Button priorities renders primary buttons 3`] = `
|
|
158
|
-
<div>
|
|
159
|
-
<button
|
|
160
|
-
aria-busy="false"
|
|
161
|
-
aria-disabled="false"
|
|
162
|
-
aria-live="off"
|
|
163
|
-
class="btn btn-md np-btn np-btn-md btn-negative btn-priority-1"
|
|
164
|
-
type="button"
|
|
165
|
-
>
|
|
166
|
-
Send money
|
|
167
|
-
</button>
|
|
168
|
-
</div>
|
|
169
|
-
`;
|
|
170
|
-
|
|
171
|
-
exports[`Button priorities renders secondary buttons 1`] = `
|
|
172
|
-
<div>
|
|
173
|
-
<button
|
|
174
|
-
aria-busy="false"
|
|
175
|
-
aria-disabled="false"
|
|
176
|
-
aria-live="off"
|
|
177
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-2"
|
|
178
|
-
type="button"
|
|
179
|
-
>
|
|
180
|
-
Send money
|
|
181
|
-
</button>
|
|
182
|
-
</div>
|
|
183
|
-
`;
|
|
184
|
-
|
|
185
|
-
exports[`Button priorities renders secondary buttons 2`] = `
|
|
186
|
-
<div>
|
|
187
|
-
<button
|
|
188
|
-
aria-busy="false"
|
|
189
|
-
aria-disabled="false"
|
|
190
|
-
aria-live="off"
|
|
191
|
-
class="btn btn-md np-btn np-btn-md btn-positive btn-priority-2"
|
|
192
|
-
type="button"
|
|
193
|
-
>
|
|
194
|
-
Send money
|
|
195
|
-
</button>
|
|
196
|
-
</div>
|
|
197
|
-
`;
|
|
198
|
-
|
|
199
|
-
exports[`Button priorities renders secondary buttons 3`] = `
|
|
200
|
-
<div>
|
|
201
|
-
<button
|
|
202
|
-
aria-busy="false"
|
|
203
|
-
aria-disabled="false"
|
|
204
|
-
aria-live="off"
|
|
205
|
-
class="btn btn-md np-btn np-btn-md btn-negative btn-priority-2"
|
|
206
|
-
type="button"
|
|
207
|
-
>
|
|
208
|
-
Send money
|
|
209
|
-
</button>
|
|
210
|
-
</div>
|
|
211
|
-
`;
|
|
212
|
-
|
|
213
|
-
exports[`Button priorities renders tertiary buttons 1`] = `
|
|
214
|
-
<div>
|
|
215
|
-
<button
|
|
216
|
-
aria-busy="false"
|
|
217
|
-
aria-disabled="false"
|
|
218
|
-
aria-live="off"
|
|
219
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-3"
|
|
220
|
-
type="button"
|
|
221
|
-
>
|
|
222
|
-
Send money
|
|
223
|
-
</button>
|
|
224
|
-
</div>
|
|
225
|
-
`;
|
|
226
|
-
|
|
227
|
-
exports[`Button sizes renders large buttons 1`] = `
|
|
228
|
-
<div>
|
|
229
|
-
<button
|
|
230
|
-
aria-busy="false"
|
|
231
|
-
aria-disabled="false"
|
|
232
|
-
aria-live="off"
|
|
233
|
-
class="btn btn-lg np-btn np-btn-lg btn-accent btn-priority-1"
|
|
234
|
-
type="button"
|
|
235
|
-
>
|
|
236
|
-
Send money
|
|
237
|
-
</button>
|
|
238
|
-
</div>
|
|
239
|
-
`;
|
|
240
|
-
|
|
241
|
-
exports[`Button sizes renders medium buttons 1`] = `
|
|
242
|
-
<div>
|
|
243
|
-
<button
|
|
244
|
-
aria-busy="false"
|
|
245
|
-
aria-disabled="false"
|
|
246
|
-
aria-live="off"
|
|
247
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-1"
|
|
248
|
-
type="button"
|
|
249
|
-
>
|
|
250
|
-
Send money
|
|
251
|
-
</button>
|
|
252
|
-
</div>
|
|
253
|
-
`;
|
|
254
|
-
|
|
255
|
-
exports[`Button sizes renders small buttons 1`] = `
|
|
256
|
-
<div>
|
|
257
|
-
<button
|
|
258
|
-
aria-busy="false"
|
|
259
|
-
aria-disabled="false"
|
|
260
|
-
aria-live="off"
|
|
261
|
-
class="btn btn-sm np-btn np-btn-sm btn-accent btn-priority-1"
|
|
262
|
-
type="button"
|
|
263
|
-
>
|
|
264
|
-
Send money
|
|
265
|
-
</button>
|
|
266
|
-
</div>
|
|
267
|
-
`;
|
|
268
|
-
|
|
269
|
-
exports[`Button types renders accent buttons 1`] = `
|
|
270
|
-
<div>
|
|
271
|
-
<button
|
|
272
|
-
aria-busy="false"
|
|
273
|
-
aria-disabled="false"
|
|
274
|
-
aria-live="off"
|
|
275
|
-
class="btn btn-md np-btn np-btn-md btn-accent btn-priority-1"
|
|
276
|
-
type="button"
|
|
277
|
-
>
|
|
278
|
-
Send money
|
|
279
|
-
</button>
|
|
280
|
-
</div>
|
|
281
|
-
`;
|
|
282
|
-
|
|
283
|
-
exports[`Button types renders negative buttons 1`] = `
|
|
284
|
-
<div>
|
|
285
|
-
<button
|
|
286
|
-
aria-busy="false"
|
|
287
|
-
aria-disabled="false"
|
|
288
|
-
aria-live="off"
|
|
289
|
-
class="btn btn-md np-btn np-btn-md btn-negative btn-priority-1"
|
|
290
|
-
type="button"
|
|
291
|
-
>
|
|
292
|
-
Send money
|
|
293
|
-
</button>
|
|
294
|
-
</div>
|
|
295
|
-
`;
|
|
296
|
-
|
|
297
|
-
exports[`Button types renders positive buttons 1`] = `
|
|
298
|
-
<div>
|
|
299
|
-
<button
|
|
300
|
-
aria-busy="false"
|
|
301
|
-
aria-disabled="false"
|
|
302
|
-
aria-live="off"
|
|
303
|
-
class="btn btn-md np-btn np-btn-md btn-positive btn-priority-1"
|
|
304
|
-
type="button"
|
|
305
|
-
>
|
|
306
|
-
Send money
|
|
307
|
-
</button>
|
|
308
|
-
</div>
|
|
309
|
-
`;
|