@transferwise/components 0.0.0-experimental-9e19bae → 0.0.0-experimental-b762045
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 +2 -9
- package/build/avatarLayout/AvatarLayout.js.map +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +2 -9
- package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
- package/build/button/Button.js +97 -76
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +97 -76
- package/build/button/Button.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +19 -24
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +20 -25
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +2 -2
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +1 -1
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs.map +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/de.json +1 -0
- package/build/i18n/de.json.js +1 -0
- package/build/i18n/de.json.js.map +1 -1
- package/build/i18n/de.json.mjs +1 -0
- package/build/i18n/de.json.mjs.map +1 -1
- package/build/i18n/it.json +1 -0
- package/build/i18n/it.json.js +1 -0
- package/build/i18n/it.json.js.map +1 -1
- package/build/i18n/it.json.mjs +1 -0
- package/build/i18n/it.json.mjs.map +1 -1
- package/build/i18n/th.json +1 -0
- package/build/i18n/th.json.js +1 -0
- package/build/i18n/th.json.js.map +1 -1
- package/build/i18n/th.json.mjs +1 -0
- package/build/i18n/th.json.mjs.map +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/link/Link.js +3 -8
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +3 -8
- package/build/link/Link.mjs.map +1 -1
- package/build/main.css +17 -431
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +3 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +3 -1
- package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +4 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +4 -1
- package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -1
- package/build/select/Select.js +3 -5
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +2 -4
- package/build/select/Select.mjs.map +1 -1
- package/build/styles/avatarLayout/AvatarLayout.css +0 -11
- package/build/styles/button/Button.css +16 -255
- package/build/styles/circularButton/CircularButton.css +17 -158
- package/build/styles/main.css +17 -431
- package/build/types/avatarLayout/AvatarLayout.d.ts +2 -1
- package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
- package/build/types/avatarLayout/index.d.ts +0 -1
- package/build/types/avatarLayout/index.d.ts.map +1 -1
- package/build/types/button/Button.d.ts +23 -1
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/index.d.ts +2 -2
- package/build/types/button/index.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts +11 -4
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/definitionList/DefinitionList.d.ts +1 -2
- package/build/types/definitionList/DefinitionList.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 +1 -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 +0 -11
- package/src/avatarLayout/AvatarLayout.less +1 -18
- package/src/avatarLayout/AvatarLayout.tsx +3 -11
- package/src/avatarLayout/index.ts +0 -1
- package/src/button/Button.css +16 -255
- package/src/button/Button.less +14 -215
- package/src/button/Button.spec.tsx +231 -54
- package/src/button/Button.story.tsx +136 -287
- package/src/button/Button.tsx +131 -84
- package/src/button/__snapshots__/{LegacyButton.spec.tsx.snap → Button.spec.tsx.snap} +22 -22
- package/src/button/index.ts +3 -2
- package/src/circularButton/CircularButton.css +17 -158
- package/src/circularButton/CircularButton.less +22 -91
- package/src/circularButton/CircularButton.story.tsx +45 -24
- package/src/circularButton/CircularButton.tsx +39 -28
- package/src/definitionList/DefinitionList.story.tsx +57 -57
- package/src/definitionList/DefinitionList.tsx +1 -1
- package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -1
- package/src/i18n/de.json +1 -0
- package/src/i18n/it.json +1 -0
- package/src/i18n/th.json +1 -0
- package/src/iconButton/IconButton.story.tsx +6 -6
- package/src/inputs/SelectInput.story.tsx +1 -1
- package/src/link/Link.tsx +6 -15
- package/src/main.css +17 -431
- package/src/main.less +0 -1
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +7 -1
- package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +1 -1
- package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +3 -1
- package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +8 -1
- package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +5 -2
- package/src/select/Select.tsx +0 -1
- package/src/slidingPanel/SlidingPanel.spec.tsx +69 -0
- package/build/button/Button.resolver.js +0 -78
- package/build/button/Button.resolver.js.map +0 -1
- package/build/button/Button.resolver.mjs +0 -76
- package/build/button/Button.resolver.mjs.map +0 -1
- package/build/button/LegacyButton.js +0 -114
- package/build/button/LegacyButton.js.map +0 -1
- package/build/button/LegacyButton.mjs +0 -112
- package/build/button/LegacyButton.mjs.map +0 -1
- package/build/styles/button/Button.vars.css +0 -59
- package/build/styles/button/LegacyButton.css +0 -23
- package/build/types/button/Button.resolver.d.ts +0 -31
- package/build/types/button/Button.resolver.d.ts.map +0 -1
- package/build/types/button/Button.types.d.ts +0 -58
- package/build/types/button/Button.types.d.ts.map +0 -1
- package/build/types/button/LegacyButton.d.ts +0 -30
- package/build/types/button/LegacyButton.d.ts.map +0 -1
- package/src/button/Button.resolver.tsx +0 -120
- package/src/button/Button.types.ts +0 -79
- package/src/button/Button.vars.css +0 -59
- package/src/button/Button.vars.less +0 -73
- package/src/button/LegacyButton.css +0 -23
- package/src/button/LegacyButton.less +0 -24
- package/src/button/LegacyButton.spec.tsx +0 -245
- package/src/button/LegacyButton.story.tsx +0 -224
- package/src/button/LegacyButton.tsx +0 -161
- package/src/circularButton/_button-label-states.less +0 -34
- package/src/definitionList/DefinitionList.spec.js +0 -91
- package/src/slidingPanel/SlidingPanel.spec.js +0 -56
package/src/main.css
CHANGED
|
@@ -518,18 +518,10 @@ 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
|
-
}
|
|
525
521
|
.np-avatar-layout-diagonal-child {
|
|
526
522
|
margin-left: calc(var(--np-avatar-layout-size) - var(--np-avatar-size) * 2);
|
|
527
523
|
margin-top: calc(var(--np-avatar-layout-size) - var(--np-avatar-size));
|
|
528
524
|
}
|
|
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
|
-
}
|
|
533
525
|
.np-avatar-layout-horizontal {
|
|
534
526
|
width: calc(var(--np-avatar-size) * 2 - var(--np-avatar-offset) - 2px);
|
|
535
527
|
height: var(--np-avatar-layout-size);
|
|
@@ -543,9 +535,6 @@ div.critical-comms .critical-comms-body {
|
|
|
543
535
|
.np-avatar-layout-horizontal-child {
|
|
544
536
|
margin-left: calc(var(--np-avatar-offset) * -1);
|
|
545
537
|
}
|
|
546
|
-
[dir="rtl"] .np-avatar-layout-horizontal-child {
|
|
547
|
-
margin-right: calc(var(--np-avatar-offset) * -1);
|
|
548
|
-
}
|
|
549
538
|
.np-icon-button {
|
|
550
539
|
border: none;
|
|
551
540
|
}
|
|
@@ -716,268 +705,6 @@ div.critical-comms .critical-comms-body {
|
|
|
716
705
|
.np-btn.disabled[class] {
|
|
717
706
|
pointer-events: auto;
|
|
718
707
|
}
|
|
719
|
-
:root {
|
|
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-font-size: var(--font-size-16);
|
|
727
|
-
--Button-line-height: var(--size-24);
|
|
728
|
-
--Button-font-weight: var(--font-weight-semi-bold);
|
|
729
|
-
--Button-letter-spacing: -0.011em;
|
|
730
|
-
--Button-size-small-padding: 5px var(--size-12);
|
|
731
|
-
--Button-size-medium-padding: var(--size-8) var(--size-12);
|
|
732
|
-
--Button-size-large-padding: var(--size-12) var(--size-16);
|
|
733
|
-
--Button-avatar-border-color: var(--color-border-neutral);
|
|
734
|
-
--Button-transition-duration: 150ms;
|
|
735
|
-
--Button-transition-easing: ease-in-out;
|
|
736
|
-
--Button-secondary-background: var(--color-interactive-neutral);
|
|
737
|
-
--Button-secondary-background-hover: var(--color-interactive-neutral-hover);
|
|
738
|
-
--Button-secondary-background-active: var(--color-interactive-neutral-active);
|
|
739
|
-
--Button-secondary-color: var(--color-interactive-primary);
|
|
740
|
-
--Button-tertiary-background: var(--color-background-neutral);
|
|
741
|
-
--Button-tertiary-background-hover: var(--color-background-neutral-hover);
|
|
742
|
-
--Button-tertiary-background-active: var(--color-background-neutral-active);
|
|
743
|
-
--Button-tertiary-color: var(--color-content-primary);
|
|
744
|
-
--Button-minimal-background: transparent;
|
|
745
|
-
--Button-minimal-background-hover: var(--color-background-screen-hover);
|
|
746
|
-
--Button-minimal-background-active: var(--color-background-screen-active);
|
|
747
|
-
--Button-minimal-color: var(--color-interactive-primary);
|
|
748
|
-
--Button-primary-negative-background: var(--color-sentiment-negative-primary);
|
|
749
|
-
--Button-primary-negative-background-hover: var(--color-sentiment-negative-primary-hover);
|
|
750
|
-
--Button-primary-negative-background-active: var(--color-sentiment-negative-primary-active);
|
|
751
|
-
--Button-primary-negative-color: var(--color-contrast);
|
|
752
|
-
--Button-primary-netative-avatar-border-color: rgba(255,255,255,0.2);
|
|
753
|
-
--Button-secondary-negative-background: var(--color-sentiment-negative-secondary);
|
|
754
|
-
--Button-secondary-negative-background-hover: var(--color-sentiment-negative-secondary-hover);
|
|
755
|
-
--Button-secondary-negative-background-active: var(--color-sentiment-negative-secondary-active);
|
|
756
|
-
--Button-secondary-negative-color: var(--color-sentiment-negative-primary);
|
|
757
|
-
--Button-secondary-netative-avatar-border-color: rgba(168,32,13,0.12157);
|
|
758
|
-
}
|
|
759
|
-
.np-theme-personal--dark .wds-Button {
|
|
760
|
-
--Button-primary-netative-avatar-border-color: rgba(14,15,12,0.12157);
|
|
761
|
-
}
|
|
762
|
-
.np-theme-personal--forest-green .wds-Button {
|
|
763
|
-
--color-interactive-neutral: rgba(159,232,112,0.2);
|
|
764
|
-
--color-interactive-neutral-hover: rgba(205,255,173,0.2);
|
|
765
|
-
--color-interactive-neutral-active: rgba(236,255,224,0.2);
|
|
766
|
-
--color-sentiment-negative-secondary: rgba(255,196,194,0.2);
|
|
767
|
-
--color-sentiment-negative-secondary-hover: rgba(255,220,219,0.2);
|
|
768
|
-
--color-sentiment-negative-secondary-active: rgba(255,235,235,0.2);
|
|
769
|
-
--Button-primary-netative-avatar-border-color: rgba(14,15,12,0.12157);
|
|
770
|
-
--Button-secondary-netative-avatar-border-color: rgba(14,15,12,0.12157);
|
|
771
|
-
}
|
|
772
|
-
.np-theme-personal--bright-green .wds-Button {
|
|
773
|
-
--color-contrast: #FFFFFF;
|
|
774
|
-
--Button-secondary-color: var(--color-interactive-control);
|
|
775
|
-
--Button-secondary-negative-color: var(--color-contrast);
|
|
776
|
-
--Button-secondary-netative-avatar-border-color: var(--Button-primary-netative-avatar-border-color);
|
|
777
|
-
}
|
|
778
|
-
/* Button Styles */
|
|
779
|
-
.wds-Button {
|
|
780
|
-
display: inline-flex;
|
|
781
|
-
flex: none;
|
|
782
|
-
width: auto;
|
|
783
|
-
align-items: center;
|
|
784
|
-
justify-content: center;
|
|
785
|
-
vertical-align: middle;
|
|
786
|
-
font-weight: 600;
|
|
787
|
-
font-weight: var(--Button-font-weight);
|
|
788
|
-
font-size: 1rem;
|
|
789
|
-
font-size: var(--Button-font-size);
|
|
790
|
-
letter-spacing: -0.011em;
|
|
791
|
-
letter-spacing: var(--Button-letter-spacing);
|
|
792
|
-
line-height: 24px;
|
|
793
|
-
line-height: var(--Button-line-height);
|
|
794
|
-
text-align: center;
|
|
795
|
-
-webkit-text-decoration: none;
|
|
796
|
-
text-decoration: none;
|
|
797
|
-
white-space: nowrap;
|
|
798
|
-
word-wrap: break-word;
|
|
799
|
-
-webkit-appearance: none;
|
|
800
|
-
-moz-appearance: none;
|
|
801
|
-
appearance: none;
|
|
802
|
-
background-color: #00a2dd;
|
|
803
|
-
background-color: var(--Button-background);
|
|
804
|
-
border: none;
|
|
805
|
-
border-radius: 9999px;
|
|
806
|
-
border-radius: var(--Button-border-radius);
|
|
807
|
-
color: var(--Button-color);
|
|
808
|
-
cursor: pointer;
|
|
809
|
-
padding: 8px 12px;
|
|
810
|
-
padding: var(--Button-padding);
|
|
811
|
-
transition: color, background-color 150ms ease-in-out;
|
|
812
|
-
transition: color, background-color var(--Button-transition-duration) var(--Button-transition-easing);
|
|
813
|
-
}
|
|
814
|
-
.wds-Button:focus {
|
|
815
|
-
-webkit-text-decoration: none;
|
|
816
|
-
text-decoration: none;
|
|
817
|
-
}
|
|
818
|
-
.wds-Button:hover {
|
|
819
|
-
background-color: #008fc9;
|
|
820
|
-
background-color: var(--Button-background-hover);
|
|
821
|
-
-webkit-text-decoration: none;
|
|
822
|
-
text-decoration: none;
|
|
823
|
-
}
|
|
824
|
-
.wds-Button:active {
|
|
825
|
-
background-color: #0081ba;
|
|
826
|
-
background-color: var(--Button-background-active);
|
|
827
|
-
-webkit-text-decoration: none;
|
|
828
|
-
text-decoration: none;
|
|
829
|
-
}
|
|
830
|
-
.wds-Button.wds-Button--disabled,
|
|
831
|
-
.wds-Button:disabled {
|
|
832
|
-
mix-blend-mode: luminosity;
|
|
833
|
-
opacity: 0.45;
|
|
834
|
-
cursor: not-allowed;
|
|
835
|
-
}
|
|
836
|
-
.wds-Button.wds-Button--disabled:hover,
|
|
837
|
-
.wds-Button:disabled:hover,
|
|
838
|
-
.wds-Button.wds-Button--disabled:active,
|
|
839
|
-
.wds-Button:disabled:active {
|
|
840
|
-
background-color: #00a2dd;
|
|
841
|
-
background-color: var(--Button-background);
|
|
842
|
-
}
|
|
843
|
-
.wds-Button--secondary {
|
|
844
|
-
--Button-background: var(--Button-secondary-background);
|
|
845
|
-
--Button-background-hover: var(--Button-secondary-background-hover);
|
|
846
|
-
--Button-background-active: var(--Button-secondary-background-active);
|
|
847
|
-
--Button-color: var(--Button-secondary-color);
|
|
848
|
-
}
|
|
849
|
-
.wds-Button--tertiary {
|
|
850
|
-
--Button-background: var(--Button-tertiary-background);
|
|
851
|
-
--Button-background-hover: var(--Button-tertiary-background-hover);
|
|
852
|
-
--Button-background-active: var(--Button-tertiary-background-active);
|
|
853
|
-
--Button-color: var(--Button-tertiary-color);
|
|
854
|
-
}
|
|
855
|
-
.wds-Button--tertiary .wds-Button-icon--end {
|
|
856
|
-
color: var(--color-interactive-primary);
|
|
857
|
-
}
|
|
858
|
-
.wds-Button--minimal {
|
|
859
|
-
--Button-background: var(--Button-minimal-background);
|
|
860
|
-
--Button-background-hover: var(--Button-minimal-background-hover);
|
|
861
|
-
--Button-background-active: var(--Button-minimal-background-active);
|
|
862
|
-
--Button-color: var(--Button-minimal-color);
|
|
863
|
-
-webkit-text-decoration: underline;
|
|
864
|
-
text-decoration: underline;
|
|
865
|
-
text-underline-offset: 3px;
|
|
866
|
-
text-decoration-thickness: 1px;
|
|
867
|
-
}
|
|
868
|
-
.wds-Button--minimal:hover,
|
|
869
|
-
.wds-Button--minimal:hover:active {
|
|
870
|
-
-webkit-text-decoration: underline;
|
|
871
|
-
text-decoration: underline;
|
|
872
|
-
}
|
|
873
|
-
.wds-Button--negative.wds-Button--primary {
|
|
874
|
-
--Button-background: var(--Button-primary-negative-background);
|
|
875
|
-
--Button-background-hover: var(--Button-primary-negative-background-hover);
|
|
876
|
-
--Button-background-active: var(--Button-primary-negative-background-active);
|
|
877
|
-
--Button-color: var(--Button-primary-negative-color);
|
|
878
|
-
--Button-avatar-border-color: var(--Button-primary-netative-avatar-border-color);
|
|
879
|
-
}
|
|
880
|
-
.wds-Button--negative.wds-Button--secondary {
|
|
881
|
-
--Button-background: var(--Button-secondary-negative-background);
|
|
882
|
-
--Button-background-hover: var(--Button-secondary-negative-background-hover);
|
|
883
|
-
--Button-background-active: var(--Button-secondary-negative-background-active);
|
|
884
|
-
--Button-color: var(--Button-secondary-negative-color);
|
|
885
|
-
--Button-avatar-border-color: var(--Button-secondary-netative-avatar-border-color);
|
|
886
|
-
}
|
|
887
|
-
.wds-Button--small {
|
|
888
|
-
--Button-padding: var(--Button-size-small-padding);
|
|
889
|
-
--Button-line-height: 22px;
|
|
890
|
-
--Button-font-size: var(--font-size-14);
|
|
891
|
-
--Button-letter-spacing: -0.006em;
|
|
892
|
-
}
|
|
893
|
-
.wds-Button--small .wds-Button-icon--start {
|
|
894
|
-
margin-right: 4px;
|
|
895
|
-
margin-right: var(--size-4);
|
|
896
|
-
}
|
|
897
|
-
[dir="rtl"] .wds-Button--small .wds-Button-icon--start {
|
|
898
|
-
margin-right: 0;
|
|
899
|
-
margin-left: 4px;
|
|
900
|
-
margin-left: var(--size-4);
|
|
901
|
-
}
|
|
902
|
-
.wds-Button--medium {
|
|
903
|
-
--Button-padding: var(--Button-size-medium-padding);
|
|
904
|
-
}
|
|
905
|
-
.wds-Button--large {
|
|
906
|
-
--Button-padding: var(--Button-size-large-padding);
|
|
907
|
-
}
|
|
908
|
-
.wds-Button--block {
|
|
909
|
-
width: 100%;
|
|
910
|
-
}
|
|
911
|
-
.wds-Button-avatars {
|
|
912
|
-
display: inline-flex;
|
|
913
|
-
margin-right: 5px;
|
|
914
|
-
margin-left: calc(4px * -1);
|
|
915
|
-
margin-left: calc(var(--size-4) * -1);
|
|
916
|
-
}
|
|
917
|
-
[dir="rtl"] .wds-Button-avatars {
|
|
918
|
-
margin-right: 0;
|
|
919
|
-
margin-left: 5px;
|
|
920
|
-
}
|
|
921
|
-
.wds-Button-avatars .np-circle {
|
|
922
|
-
--circle-border-color: var(--Button-avatar-border-color);
|
|
923
|
-
}
|
|
924
|
-
.wds-Button-avatars .np-avatar-view .np-avatar-view-content {
|
|
925
|
-
color: var(--Button-color);
|
|
926
|
-
}
|
|
927
|
-
.wds-Button-icon {
|
|
928
|
-
display: inline-block;
|
|
929
|
-
}
|
|
930
|
-
.wds-Button-icon--start {
|
|
931
|
-
margin-right: 8px;
|
|
932
|
-
margin-right: var(--size-8);
|
|
933
|
-
}
|
|
934
|
-
[dir="rtl"] .wds-Button-icon--start {
|
|
935
|
-
margin-right: 0;
|
|
936
|
-
margin-left: 8px;
|
|
937
|
-
margin-left: var(--size-8);
|
|
938
|
-
}
|
|
939
|
-
.wds-Button-icon--end {
|
|
940
|
-
margin-left: 4px;
|
|
941
|
-
margin-left: var(--size-4);
|
|
942
|
-
}
|
|
943
|
-
[dir="rtl"] .wds-Button-icon--end {
|
|
944
|
-
margin-left: 0;
|
|
945
|
-
margin-right: 4px;
|
|
946
|
-
margin-right: var(--size-4);
|
|
947
|
-
}
|
|
948
|
-
.wds-Button-content {
|
|
949
|
-
position: relative;
|
|
950
|
-
}
|
|
951
|
-
.wds-Button-content--loading .wds-Button-label,
|
|
952
|
-
.wds-Button-content--loading .wds-Button-media,
|
|
953
|
-
.wds-Button-content--loading .wds-Button-icon {
|
|
954
|
-
visibility: hidden;
|
|
955
|
-
opacity: 0;
|
|
956
|
-
}
|
|
957
|
-
.wds-Button-label {
|
|
958
|
-
display: flex;
|
|
959
|
-
justify-content: center;
|
|
960
|
-
align-items: center;
|
|
961
|
-
position: relative;
|
|
962
|
-
}
|
|
963
|
-
.wds-Button-loader {
|
|
964
|
-
position: absolute;
|
|
965
|
-
display: flex;
|
|
966
|
-
justify-content: center;
|
|
967
|
-
align-items: center;
|
|
968
|
-
width: 100%;
|
|
969
|
-
height: 100%;
|
|
970
|
-
}
|
|
971
|
-
.wds-Button-loader .process-circle {
|
|
972
|
-
stroke: var(--Button-color);
|
|
973
|
-
}
|
|
974
|
-
/* RTL Styles */
|
|
975
|
-
[dir="rtl"] .wds-Button .tw-icon-chevron-right,[dir="rtl"] .wds-Button .tw-icon-arrow-right {
|
|
976
|
-
transform: rotate(180deg);
|
|
977
|
-
}
|
|
978
|
-
[dir="rtl"] .wds-Button .tw-icon-chevron-left,[dir="rtl"] .wds-Button .tw-icon-arrow-left {
|
|
979
|
-
transform: rotate(180deg);
|
|
980
|
-
}
|
|
981
708
|
.np-card {
|
|
982
709
|
overflow: hidden;
|
|
983
710
|
transition-property: transform, box-shadow;
|
|
@@ -1457,175 +1184,34 @@ div.critical-comms .critical-comms-body {
|
|
|
1457
1184
|
display: inline-flex;
|
|
1458
1185
|
flex-direction: column;
|
|
1459
1186
|
align-items: center;
|
|
1460
|
-
text-align: center;
|
|
1461
1187
|
cursor: pointer;
|
|
1462
|
-
position: relative;
|
|
1463
|
-
}
|
|
1464
|
-
.np-circular-btn .tw-icon {
|
|
1465
|
-
position: absolute;
|
|
1466
|
-
top: 16px;
|
|
1467
|
-
top: var(--size-16);
|
|
1468
|
-
pointer-events: none;
|
|
1469
|
-
color: white;
|
|
1470
|
-
transition: color 0.15s ease-in-out;
|
|
1471
|
-
width: 100%;
|
|
1472
|
-
left: 0;
|
|
1473
|
-
}
|
|
1474
|
-
[dir="rtl"] .np-circular-btn .tw-icon {
|
|
1475
|
-
right: 0;
|
|
1476
|
-
left: auto;
|
|
1477
|
-
left: initial;
|
|
1478
|
-
}
|
|
1479
|
-
@media (max-width: 320px) {
|
|
1480
|
-
.np-circular-btn .tw-icon {
|
|
1481
|
-
top: 12px;
|
|
1482
|
-
top: var(--size-12);
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
.np-circular-btn .tw-icon > svg {
|
|
1486
|
-
margin: 0 auto;
|
|
1487
|
-
}
|
|
1488
|
-
.np-theme-personal .np-circular-btn {
|
|
1489
|
-
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
1490
|
-
}
|
|
1491
|
-
.np-theme-personal .np-circular-btn .tw-icon,
|
|
1492
|
-
.np-theme-personal .np-circular-btn .tw-icon:hover,
|
|
1493
|
-
.np-theme-personal .np-circular-btn .tw-icon:active {
|
|
1494
|
-
color: var(--color-interactive-control);
|
|
1495
|
-
}
|
|
1496
|
-
.np-theme-personal .np-circular-btn.negative .tw-icon,
|
|
1497
|
-
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1498
|
-
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):active .tw-icon {
|
|
1499
|
-
color: var(--color-contrast) !important;
|
|
1500
|
-
}
|
|
1501
|
-
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled) .tw-icon {
|
|
1502
|
-
color: var(--color-sentiment-negative) !important;
|
|
1503
|
-
}
|
|
1504
|
-
.np-circular-btn.accent .np-circular-btn__label {
|
|
1505
|
-
color: #00a2dd;
|
|
1506
|
-
color: var(--color-interactive-accent);
|
|
1507
|
-
}
|
|
1508
|
-
.np-circular-btn.accent:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1509
|
-
color: #008fc9;
|
|
1510
|
-
color: var(--color-interactive-accent-hover);
|
|
1511
|
-
}
|
|
1512
|
-
.np-circular-btn.accent:active .np-circular-btn__label,
|
|
1513
|
-
.np-circular-btn.accent input[type="button"]:active ~ .np-circular-btn__label {
|
|
1514
|
-
color: #0081ba;
|
|
1515
|
-
color: var(--color-interactive-accent-active);
|
|
1516
|
-
}
|
|
1517
|
-
.np-circular-btn.accent.secondary .tw-icon {
|
|
1518
|
-
color: #00a2dd;
|
|
1519
|
-
color: var(--color-interactive-accent);
|
|
1520
1188
|
}
|
|
1521
|
-
.np-circular-btn
|
|
1522
|
-
.np-circular-btn
|
|
1523
|
-
color: white;
|
|
1524
|
-
}
|
|
1525
|
-
.np-circular-btn.positive .np-circular-btn__label {
|
|
1526
|
-
color: #2ead4b;
|
|
1527
|
-
color: var(--color-interactive-positive);
|
|
1528
|
-
}
|
|
1529
|
-
.np-circular-btn.positive:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1530
|
-
color: #069939;
|
|
1531
|
-
color: var(--color-interactive-positive-hover);
|
|
1532
|
-
}
|
|
1533
|
-
.np-circular-btn.positive:active .np-circular-btn__label,
|
|
1534
|
-
.np-circular-btn.positive input[type="button"]:active ~ .np-circular-btn__label {
|
|
1535
|
-
color: #008b2b;
|
|
1536
|
-
color: var(--color-interactive-positive-active);
|
|
1537
|
-
}
|
|
1538
|
-
.np-circular-btn.positive.secondary .tw-icon {
|
|
1539
|
-
color: #2ead4b;
|
|
1540
|
-
color: var(--color-interactive-positive);
|
|
1541
|
-
}
|
|
1542
|
-
.np-circular-btn.positive.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1543
|
-
.np-circular-btn.positive.secondary input[type="button"]:active + .tw-icon {
|
|
1544
|
-
color: white;
|
|
1545
|
-
}
|
|
1546
|
-
.np-circular-btn.negative .np-circular-btn__label {
|
|
1547
|
-
color: #e74848;
|
|
1548
|
-
color: var(--color-interactive-negative);
|
|
1549
|
-
}
|
|
1550
|
-
.np-circular-btn.negative:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1551
|
-
color: #d03238;
|
|
1552
|
-
color: var(--color-interactive-negative-hover);
|
|
1553
|
-
}
|
|
1554
|
-
.np-circular-btn.negative:active .np-circular-btn__label,
|
|
1555
|
-
.np-circular-btn.negative input[type="button"]:active ~ .np-circular-btn__label {
|
|
1556
|
-
color: #bf1e2c;
|
|
1557
|
-
color: var(--color-interactive-negative-active);
|
|
1558
|
-
}
|
|
1559
|
-
.np-circular-btn.negative.secondary .tw-icon {
|
|
1560
|
-
color: #e74848;
|
|
1561
|
-
color: var(--color-interactive-negative);
|
|
1562
|
-
}
|
|
1563
|
-
.np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1564
|
-
.np-circular-btn.negative.secondary input[type="button"]:active + .tw-icon {
|
|
1565
|
-
color: white;
|
|
1566
|
-
}
|
|
1567
|
-
.np-theme-personal .np-circular-btn.accent .np-circular-btn__label {
|
|
1189
|
+
.np-circular-btn-primary-default .np-circular-btn-label,
|
|
1190
|
+
.np-circular-btn-secondary-default .np-circular-btn-label {
|
|
1568
1191
|
color: var(--color-interactive-primary);
|
|
1569
1192
|
}
|
|
1570
|
-
.np-
|
|
1193
|
+
.np-circular-btn-primary-default .np-circular-btn-label:not(.disabled):not(:disabled):hover,
|
|
1194
|
+
.np-circular-btn-secondary-default .np-circular-btn-label:not(.disabled):not(:disabled):hover {
|
|
1571
1195
|
color: var(--color-interactive-primary-hover);
|
|
1572
1196
|
}
|
|
1573
|
-
.np-
|
|
1574
|
-
.np-
|
|
1197
|
+
.np-circular-btn-primary-default .np-circular-btn-label:not(.disabled):not(:disabled):active,
|
|
1198
|
+
.np-circular-btn-secondary-default .np-circular-btn-label:not(.disabled):not(:disabled):active {
|
|
1575
1199
|
color: var(--color-interactive-primary-active);
|
|
1576
1200
|
}
|
|
1577
|
-
.np-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
.np-theme-personal .np-circular-btn.accent.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1581
|
-
.np-theme-personal .np-circular-btn.accent.secondary input[type="button"]:active + .tw-icon {
|
|
1582
|
-
color: white;
|
|
1583
|
-
color: var(--color-interactive-control);
|
|
1584
|
-
}
|
|
1585
|
-
.np-theme-personal .np-circular-btn.accent.secondary:active input[type="button"] + .tw-icon {
|
|
1586
|
-
color: var(--color-interactive-control);
|
|
1587
|
-
}
|
|
1588
|
-
.np-theme-personal .np-circular-btn.positive .np-circular-btn__label {
|
|
1589
|
-
color: var(--color-interactive-primary);
|
|
1590
|
-
}
|
|
1591
|
-
.np-theme-personal .np-circular-btn.positive:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1592
|
-
color: var(--color-interactive-primary-hover);
|
|
1593
|
-
}
|
|
1594
|
-
.np-theme-personal .np-circular-btn.positive:active .np-circular-btn__label,
|
|
1595
|
-
.np-theme-personal .np-circular-btn.positive input[type="button"]:active ~ .np-circular-btn__label {
|
|
1596
|
-
color: var(--color-interactive-primary-active);
|
|
1597
|
-
}
|
|
1598
|
-
.np-theme-personal .np-circular-btn.positive.secondary .tw-icon {
|
|
1599
|
-
color: var(--color-interactive-primary);
|
|
1600
|
-
}
|
|
1601
|
-
.np-theme-personal .np-circular-btn.positive.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
1602
|
-
.np-theme-personal .np-circular-btn.positive.secondary input[type="button"]:active + .tw-icon {
|
|
1603
|
-
color: white;
|
|
1604
|
-
color: var(--color-interactive-control);
|
|
1605
|
-
}
|
|
1606
|
-
.np-theme-personal .np-circular-btn.positive.secondary:active input[type="button"] + .tw-icon {
|
|
1607
|
-
color: var(--color-interactive-control);
|
|
1608
|
-
}
|
|
1609
|
-
.np-theme-personal .np-circular-btn.negative .np-circular-btn__label {
|
|
1610
|
-
color: var(--color-sentiment-negative);
|
|
1611
|
-
}
|
|
1612
|
-
.np-theme-personal .np-circular-btn.negative:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
1613
|
-
color: var(--color-sentiment-negative-hover);
|
|
1201
|
+
.np-circular-btn-primary-negative .np-circular-btn-label,
|
|
1202
|
+
.np-circular-btn-secondary-negative .np-circular-btn-label {
|
|
1203
|
+
color: var(--color-sentiment-negative-primary);
|
|
1614
1204
|
}
|
|
1615
|
-
.np-
|
|
1616
|
-
.np-
|
|
1617
|
-
color: var(--color-sentiment-negative-
|
|
1205
|
+
.np-circular-btn-primary-negative .np-circular-btn-label:not(.disabled):not(:disabled):hover,
|
|
1206
|
+
.np-circular-btn-secondary-negative .np-circular-btn-label:not(.disabled):not(:disabled):hover {
|
|
1207
|
+
color: var(--color-sentiment-negative-primary-hover);
|
|
1618
1208
|
}
|
|
1619
|
-
.np-
|
|
1620
|
-
|
|
1209
|
+
.np-circular-btn-primary-negative .np-circular-btn-label:not(.disabled):not(:disabled):active,
|
|
1210
|
+
.np-circular-btn-secondary-negative .np-circular-btn-label:not(.disabled):not(:disabled):active {
|
|
1211
|
+
color: var(--color-sentiment-negative-primary-active);
|
|
1621
1212
|
}
|
|
1622
|
-
.np-
|
|
1623
|
-
|
|
1624
|
-
color: white;
|
|
1625
|
-
color: var(--color-interactive-control);
|
|
1626
|
-
}
|
|
1627
|
-
.np-theme-personal .np-circular-btn.negative.secondary:active input[type="button"] + .tw-icon {
|
|
1628
|
-
color: var(--color-interactive-control);
|
|
1213
|
+
.np-circular-btn-disabled {
|
|
1214
|
+
cursor: not-allowed;
|
|
1629
1215
|
}
|
|
1630
1216
|
.np-circle {
|
|
1631
1217
|
border-radius: 9999px;
|
package/src/main.less
CHANGED
|
@@ -30,7 +30,13 @@ const PrimitiveAnchor = forwardRef<HTMLAnchorElement, PrimitiveAnchorProps>(
|
|
|
30
30
|
},
|
|
31
31
|
ref,
|
|
32
32
|
) => {
|
|
33
|
-
const anchorClasses = clsx(
|
|
33
|
+
const anchorClasses = clsx(
|
|
34
|
+
'wds-Anchor',
|
|
35
|
+
{
|
|
36
|
+
'wds-Anchor--disabled': disabled,
|
|
37
|
+
},
|
|
38
|
+
className,
|
|
39
|
+
);
|
|
34
40
|
|
|
35
41
|
const handleClick = useCallback(
|
|
36
42
|
(event: React.MouseEvent<HTMLAnchorElement>) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { render, screen } from '@testing-library/react';
|
|
2
|
-
import PrimitiveAnchor from '
|
|
2
|
+
import PrimitiveAnchor from '..';
|
|
3
3
|
|
|
4
4
|
describe('PrimitiveAnchor', () => {
|
|
5
5
|
const defaultProps = {
|
|
@@ -27,6 +27,7 @@ describe('PrimitiveAnchor', () => {
|
|
|
27
27
|
renderAnchor(props);
|
|
28
28
|
|
|
29
29
|
const link = screen.getByRole('link');
|
|
30
|
+
expect(link).toHaveClass('wds-Anchor');
|
|
30
31
|
expect(link).toHaveClass('custom-class');
|
|
31
32
|
});
|
|
32
33
|
|
|
@@ -40,6 +41,7 @@ describe('PrimitiveAnchor', () => {
|
|
|
40
41
|
|
|
41
42
|
const link = screen.getByRole('link');
|
|
42
43
|
expect(link).toHaveAttribute('aria-disabled', 'true');
|
|
44
|
+
expect(link).toHaveClass('wds-Anchor--disabled');
|
|
43
45
|
expect(link).not.toHaveAttribute('href', 'https://example.com');
|
|
44
46
|
});
|
|
45
47
|
|
|
@@ -35,7 +35,14 @@ const PrimitiveButton = forwardRef<HTMLButtonElement, PrimitiveButtonProps>(
|
|
|
35
35
|
ref,
|
|
36
36
|
) => {
|
|
37
37
|
const intl = useIntl();
|
|
38
|
-
const classNames = clsx(
|
|
38
|
+
const classNames = clsx(
|
|
39
|
+
'wds-Button',
|
|
40
|
+
{
|
|
41
|
+
'wds-Button--disabled': disabled,
|
|
42
|
+
'wds-Button--loading': loading,
|
|
43
|
+
},
|
|
44
|
+
className,
|
|
45
|
+
);
|
|
39
46
|
|
|
40
47
|
const handleClick = useCallback(
|
|
41
48
|
(event: React.MouseEvent<HTMLButtonElement>) => {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { screen } from '@testing-library/react';
|
|
2
|
-
import
|
|
1
|
+
import { fireEvent, screen } from '@testing-library/react';
|
|
2
|
+
import { userEvent } from '@testing-library/user-event';
|
|
3
|
+
import PrimitiveButton from '..';
|
|
3
4
|
import messages from '../../../i18n/commonMessages/Button.messages';
|
|
4
5
|
import { render } from '../../../test-utils';
|
|
5
6
|
|
|
@@ -35,6 +36,7 @@ describe('Button', () => {
|
|
|
35
36
|
renderButton(props);
|
|
36
37
|
|
|
37
38
|
const button = screen.getByRole('button');
|
|
39
|
+
expect(button).toHaveClass('wds-Button');
|
|
38
40
|
expect(button).toHaveClass('custom-class');
|
|
39
41
|
});
|
|
40
42
|
|
|
@@ -47,6 +49,7 @@ describe('Button', () => {
|
|
|
47
49
|
renderButton(props);
|
|
48
50
|
|
|
49
51
|
const button = screen.getByRole('button');
|
|
52
|
+
expect(button).toHaveClass('wds-Button--disabled');
|
|
50
53
|
expect(button).toBeDisabled();
|
|
51
54
|
});
|
|
52
55
|
|
package/src/select/Select.tsx
CHANGED
|
@@ -0,0 +1,69 @@
|
|
|
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
|
+
});
|