@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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Button by default renders a medium button of type accent and priority primary 1`] = `
|
|
4
4
|
<div>
|
|
5
5
|
<button
|
|
6
6
|
aria-busy="false"
|
|
@@ -14,7 +14,7 @@ exports[`LegacyButton by default renders a medium button of type accent and prio
|
|
|
14
14
|
</div>
|
|
15
15
|
`;
|
|
16
16
|
|
|
17
|
-
exports[`
|
|
17
|
+
exports[`Button by default renders an anchor tag with button styles of type accent and priority primary 1`] = `
|
|
18
18
|
<div>
|
|
19
19
|
<a
|
|
20
20
|
aria-busy="false"
|
|
@@ -28,7 +28,7 @@ exports[`LegacyButton by default renders an anchor tag with button styles of typ
|
|
|
28
28
|
</div>
|
|
29
29
|
`;
|
|
30
30
|
|
|
31
|
-
exports[`
|
|
31
|
+
exports[`Button deprecated types renders danger as negative buttons with priority secondary and logs a warning 1`] = `
|
|
32
32
|
<div>
|
|
33
33
|
<button
|
|
34
34
|
aria-busy="false"
|
|
@@ -42,7 +42,7 @@ exports[`LegacyButton deprecated types renders danger as negative buttons with p
|
|
|
42
42
|
</div>
|
|
43
43
|
`;
|
|
44
44
|
|
|
45
|
-
exports[`
|
|
45
|
+
exports[`Button deprecated types renders link as accent buttons with priority tertiary and logs a warning 1`] = `
|
|
46
46
|
<div>
|
|
47
47
|
<button
|
|
48
48
|
aria-busy="false"
|
|
@@ -56,7 +56,7 @@ exports[`LegacyButton deprecated types renders link as accent buttons with prior
|
|
|
56
56
|
</div>
|
|
57
57
|
`;
|
|
58
58
|
|
|
59
|
-
exports[`
|
|
59
|
+
exports[`Button deprecated types renders pay as positive buttons and logs a warning 1`] = `
|
|
60
60
|
<div>
|
|
61
61
|
<button
|
|
62
62
|
aria-busy="false"
|
|
@@ -70,7 +70,7 @@ exports[`LegacyButton deprecated types renders pay as positive buttons and logs
|
|
|
70
70
|
</div>
|
|
71
71
|
`;
|
|
72
72
|
|
|
73
|
-
exports[`
|
|
73
|
+
exports[`Button deprecated types renders primary as accent buttons and logs a warning 1`] = `
|
|
74
74
|
<div>
|
|
75
75
|
<button
|
|
76
76
|
aria-busy="false"
|
|
@@ -84,7 +84,7 @@ exports[`LegacyButton deprecated types renders primary as accent buttons and log
|
|
|
84
84
|
</div>
|
|
85
85
|
`;
|
|
86
86
|
|
|
87
|
-
exports[`
|
|
87
|
+
exports[`Button other states renders as block if block is true 1`] = `
|
|
88
88
|
<div>
|
|
89
89
|
<button
|
|
90
90
|
aria-busy="false"
|
|
@@ -98,7 +98,7 @@ exports[`LegacyButton other states renders as block if block is true 1`] = `
|
|
|
98
98
|
</div>
|
|
99
99
|
`;
|
|
100
100
|
|
|
101
|
-
exports[`
|
|
101
|
+
exports[`Button priorities defaults tertiary buttons to secondary for positive buttons 1`] = `
|
|
102
102
|
<div>
|
|
103
103
|
<button
|
|
104
104
|
aria-busy="false"
|
|
@@ -112,7 +112,7 @@ exports[`LegacyButton priorities defaults tertiary buttons to secondary for posi
|
|
|
112
112
|
</div>
|
|
113
113
|
`;
|
|
114
114
|
|
|
115
|
-
exports[`
|
|
115
|
+
exports[`Button priorities defaults tertiary buttons to secondary for positive buttons 2`] = `
|
|
116
116
|
<div>
|
|
117
117
|
<button
|
|
118
118
|
aria-busy="false"
|
|
@@ -126,7 +126,7 @@ exports[`LegacyButton priorities defaults tertiary buttons to secondary for posi
|
|
|
126
126
|
</div>
|
|
127
127
|
`;
|
|
128
128
|
|
|
129
|
-
exports[`
|
|
129
|
+
exports[`Button priorities renders primary buttons 1`] = `
|
|
130
130
|
<div>
|
|
131
131
|
<button
|
|
132
132
|
aria-busy="false"
|
|
@@ -140,7 +140,7 @@ exports[`LegacyButton priorities renders primary buttons 1`] = `
|
|
|
140
140
|
</div>
|
|
141
141
|
`;
|
|
142
142
|
|
|
143
|
-
exports[`
|
|
143
|
+
exports[`Button priorities renders primary buttons 2`] = `
|
|
144
144
|
<div>
|
|
145
145
|
<button
|
|
146
146
|
aria-busy="false"
|
|
@@ -154,7 +154,7 @@ exports[`LegacyButton priorities renders primary buttons 2`] = `
|
|
|
154
154
|
</div>
|
|
155
155
|
`;
|
|
156
156
|
|
|
157
|
-
exports[`
|
|
157
|
+
exports[`Button priorities renders primary buttons 3`] = `
|
|
158
158
|
<div>
|
|
159
159
|
<button
|
|
160
160
|
aria-busy="false"
|
|
@@ -168,7 +168,7 @@ exports[`LegacyButton priorities renders primary buttons 3`] = `
|
|
|
168
168
|
</div>
|
|
169
169
|
`;
|
|
170
170
|
|
|
171
|
-
exports[`
|
|
171
|
+
exports[`Button priorities renders secondary buttons 1`] = `
|
|
172
172
|
<div>
|
|
173
173
|
<button
|
|
174
174
|
aria-busy="false"
|
|
@@ -182,7 +182,7 @@ exports[`LegacyButton priorities renders secondary buttons 1`] = `
|
|
|
182
182
|
</div>
|
|
183
183
|
`;
|
|
184
184
|
|
|
185
|
-
exports[`
|
|
185
|
+
exports[`Button priorities renders secondary buttons 2`] = `
|
|
186
186
|
<div>
|
|
187
187
|
<button
|
|
188
188
|
aria-busy="false"
|
|
@@ -196,7 +196,7 @@ exports[`LegacyButton priorities renders secondary buttons 2`] = `
|
|
|
196
196
|
</div>
|
|
197
197
|
`;
|
|
198
198
|
|
|
199
|
-
exports[`
|
|
199
|
+
exports[`Button priorities renders secondary buttons 3`] = `
|
|
200
200
|
<div>
|
|
201
201
|
<button
|
|
202
202
|
aria-busy="false"
|
|
@@ -210,7 +210,7 @@ exports[`LegacyButton priorities renders secondary buttons 3`] = `
|
|
|
210
210
|
</div>
|
|
211
211
|
`;
|
|
212
212
|
|
|
213
|
-
exports[`
|
|
213
|
+
exports[`Button priorities renders tertiary buttons 1`] = `
|
|
214
214
|
<div>
|
|
215
215
|
<button
|
|
216
216
|
aria-busy="false"
|
|
@@ -224,7 +224,7 @@ exports[`LegacyButton priorities renders tertiary buttons 1`] = `
|
|
|
224
224
|
</div>
|
|
225
225
|
`;
|
|
226
226
|
|
|
227
|
-
exports[`
|
|
227
|
+
exports[`Button sizes renders large buttons 1`] = `
|
|
228
228
|
<div>
|
|
229
229
|
<button
|
|
230
230
|
aria-busy="false"
|
|
@@ -238,7 +238,7 @@ exports[`LegacyButton sizes renders large buttons 1`] = `
|
|
|
238
238
|
</div>
|
|
239
239
|
`;
|
|
240
240
|
|
|
241
|
-
exports[`
|
|
241
|
+
exports[`Button sizes renders medium buttons 1`] = `
|
|
242
242
|
<div>
|
|
243
243
|
<button
|
|
244
244
|
aria-busy="false"
|
|
@@ -252,7 +252,7 @@ exports[`LegacyButton sizes renders medium buttons 1`] = `
|
|
|
252
252
|
</div>
|
|
253
253
|
`;
|
|
254
254
|
|
|
255
|
-
exports[`
|
|
255
|
+
exports[`Button sizes renders small buttons 1`] = `
|
|
256
256
|
<div>
|
|
257
257
|
<button
|
|
258
258
|
aria-busy="false"
|
|
@@ -266,7 +266,7 @@ exports[`LegacyButton sizes renders small buttons 1`] = `
|
|
|
266
266
|
</div>
|
|
267
267
|
`;
|
|
268
268
|
|
|
269
|
-
exports[`
|
|
269
|
+
exports[`Button types renders accent buttons 1`] = `
|
|
270
270
|
<div>
|
|
271
271
|
<button
|
|
272
272
|
aria-busy="false"
|
|
@@ -280,7 +280,7 @@ exports[`LegacyButton types renders accent buttons 1`] = `
|
|
|
280
280
|
</div>
|
|
281
281
|
`;
|
|
282
282
|
|
|
283
|
-
exports[`
|
|
283
|
+
exports[`Button types renders negative buttons 1`] = `
|
|
284
284
|
<div>
|
|
285
285
|
<button
|
|
286
286
|
aria-busy="false"
|
|
@@ -294,7 +294,7 @@ exports[`LegacyButton types renders negative buttons 1`] = `
|
|
|
294
294
|
</div>
|
|
295
295
|
`;
|
|
296
296
|
|
|
297
|
-
exports[`
|
|
297
|
+
exports[`Button types renders positive buttons 1`] = `
|
|
298
298
|
<div>
|
|
299
299
|
<button
|
|
300
300
|
aria-busy="false"
|
package/src/button/index.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { default } from './Button
|
|
2
|
-
|
|
1
|
+
export { default } from './Button';
|
|
2
|
+
|
|
3
|
+
export type { Props as ButtonProps } from './Button';
|
|
@@ -2,173 +2,32 @@
|
|
|
2
2
|
display: inline-flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
align-items: center;
|
|
5
|
-
text-align: center;
|
|
6
5
|
cursor: pointer;
|
|
7
|
-
position: relative;
|
|
8
6
|
}
|
|
9
|
-
.np-circular-btn .
|
|
10
|
-
|
|
11
|
-
top: 16px;
|
|
12
|
-
top: var(--size-16);
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
color: white;
|
|
15
|
-
transition: color 0.15s ease-in-out;
|
|
16
|
-
width: 100%;
|
|
17
|
-
left: 0;
|
|
18
|
-
}
|
|
19
|
-
[dir="rtl"] .np-circular-btn .tw-icon {
|
|
20
|
-
right: 0;
|
|
21
|
-
left: auto;
|
|
22
|
-
left: initial;
|
|
23
|
-
}
|
|
24
|
-
@media (max-width: 320px) {
|
|
25
|
-
.np-circular-btn .tw-icon {
|
|
26
|
-
top: 12px;
|
|
27
|
-
top: var(--size-12);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
.np-circular-btn .tw-icon > svg {
|
|
31
|
-
margin: 0 auto;
|
|
32
|
-
}
|
|
33
|
-
.np-theme-personal .np-circular-btn {
|
|
34
|
-
/* stylelint-disable-next-line no-duplicate-selectors */
|
|
35
|
-
}
|
|
36
|
-
.np-theme-personal .np-circular-btn .tw-icon,
|
|
37
|
-
.np-theme-personal .np-circular-btn .tw-icon:hover,
|
|
38
|
-
.np-theme-personal .np-circular-btn .tw-icon:active {
|
|
39
|
-
color: var(--color-interactive-control);
|
|
40
|
-
}
|
|
41
|
-
.np-theme-personal .np-circular-btn.negative .tw-icon,
|
|
42
|
-
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
43
|
-
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):active .tw-icon {
|
|
44
|
-
color: var(--color-contrast) !important;
|
|
45
|
-
}
|
|
46
|
-
.np-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled) .tw-icon {
|
|
47
|
-
color: var(--color-sentiment-negative) !important;
|
|
48
|
-
}
|
|
49
|
-
.np-circular-btn.accent .np-circular-btn__label {
|
|
50
|
-
color: #00a2dd;
|
|
51
|
-
color: var(--color-interactive-accent);
|
|
52
|
-
}
|
|
53
|
-
.np-circular-btn.accent:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
54
|
-
color: #008fc9;
|
|
55
|
-
color: var(--color-interactive-accent-hover);
|
|
56
|
-
}
|
|
57
|
-
.np-circular-btn.accent:active .np-circular-btn__label,
|
|
58
|
-
.np-circular-btn.accent input[type="button"]:active ~ .np-circular-btn__label {
|
|
59
|
-
color: #0081ba;
|
|
60
|
-
color: var(--color-interactive-accent-active);
|
|
61
|
-
}
|
|
62
|
-
.np-circular-btn.accent.secondary .tw-icon {
|
|
63
|
-
color: #00a2dd;
|
|
64
|
-
color: var(--color-interactive-accent);
|
|
65
|
-
}
|
|
66
|
-
.np-circular-btn.accent.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
67
|
-
.np-circular-btn.accent.secondary input[type="button"]:active + .tw-icon {
|
|
68
|
-
color: white;
|
|
69
|
-
}
|
|
70
|
-
.np-circular-btn.positive .np-circular-btn__label {
|
|
71
|
-
color: #2ead4b;
|
|
72
|
-
color: var(--color-interactive-positive);
|
|
73
|
-
}
|
|
74
|
-
.np-circular-btn.positive:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
75
|
-
color: #069939;
|
|
76
|
-
color: var(--color-interactive-positive-hover);
|
|
77
|
-
}
|
|
78
|
-
.np-circular-btn.positive:active .np-circular-btn__label,
|
|
79
|
-
.np-circular-btn.positive input[type="button"]:active ~ .np-circular-btn__label {
|
|
80
|
-
color: #008b2b;
|
|
81
|
-
color: var(--color-interactive-positive-active);
|
|
82
|
-
}
|
|
83
|
-
.np-circular-btn.positive.secondary .tw-icon {
|
|
84
|
-
color: #2ead4b;
|
|
85
|
-
color: var(--color-interactive-positive);
|
|
86
|
-
}
|
|
87
|
-
.np-circular-btn.positive.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
88
|
-
.np-circular-btn.positive.secondary input[type="button"]:active + .tw-icon {
|
|
89
|
-
color: white;
|
|
90
|
-
}
|
|
91
|
-
.np-circular-btn.negative .np-circular-btn__label {
|
|
92
|
-
color: #e74848;
|
|
93
|
-
color: var(--color-interactive-negative);
|
|
94
|
-
}
|
|
95
|
-
.np-circular-btn.negative:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
96
|
-
color: #d03238;
|
|
97
|
-
color: var(--color-interactive-negative-hover);
|
|
98
|
-
}
|
|
99
|
-
.np-circular-btn.negative:active .np-circular-btn__label,
|
|
100
|
-
.np-circular-btn.negative input[type="button"]:active ~ .np-circular-btn__label {
|
|
101
|
-
color: #bf1e2c;
|
|
102
|
-
color: var(--color-interactive-negative-active);
|
|
103
|
-
}
|
|
104
|
-
.np-circular-btn.negative.secondary .tw-icon {
|
|
105
|
-
color: #e74848;
|
|
106
|
-
color: var(--color-interactive-negative);
|
|
107
|
-
}
|
|
108
|
-
.np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
109
|
-
.np-circular-btn.negative.secondary input[type="button"]:active + .tw-icon {
|
|
110
|
-
color: white;
|
|
111
|
-
}
|
|
112
|
-
.np-theme-personal .np-circular-btn.accent .np-circular-btn__label {
|
|
7
|
+
.np-circular-btn-primary-default .np-circular-btn-label,
|
|
8
|
+
.np-circular-btn-secondary-default .np-circular-btn-label {
|
|
113
9
|
color: var(--color-interactive-primary);
|
|
114
10
|
}
|
|
115
|
-
.np-
|
|
11
|
+
.np-circular-btn-primary-default .np-circular-btn-label:not(.disabled):not(:disabled):hover,
|
|
12
|
+
.np-circular-btn-secondary-default .np-circular-btn-label:not(.disabled):not(:disabled):hover {
|
|
116
13
|
color: var(--color-interactive-primary-hover);
|
|
117
14
|
}
|
|
118
|
-
.np-
|
|
119
|
-
.np-
|
|
15
|
+
.np-circular-btn-primary-default .np-circular-btn-label:not(.disabled):not(:disabled):active,
|
|
16
|
+
.np-circular-btn-secondary-default .np-circular-btn-label:not(.disabled):not(:disabled):active {
|
|
120
17
|
color: var(--color-interactive-primary-active);
|
|
121
18
|
}
|
|
122
|
-
.np-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
.np-theme-personal .np-circular-btn.accent.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
126
|
-
.np-theme-personal .np-circular-btn.accent.secondary input[type="button"]:active + .tw-icon {
|
|
127
|
-
color: white;
|
|
128
|
-
color: var(--color-interactive-control);
|
|
129
|
-
}
|
|
130
|
-
.np-theme-personal .np-circular-btn.accent.secondary:active input[type="button"] + .tw-icon {
|
|
131
|
-
color: var(--color-interactive-control);
|
|
132
|
-
}
|
|
133
|
-
.np-theme-personal .np-circular-btn.positive .np-circular-btn__label {
|
|
134
|
-
color: var(--color-interactive-primary);
|
|
135
|
-
}
|
|
136
|
-
.np-theme-personal .np-circular-btn.positive:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
137
|
-
color: var(--color-interactive-primary-hover);
|
|
138
|
-
}
|
|
139
|
-
.np-theme-personal .np-circular-btn.positive:active .np-circular-btn__label,
|
|
140
|
-
.np-theme-personal .np-circular-btn.positive input[type="button"]:active ~ .np-circular-btn__label {
|
|
141
|
-
color: var(--color-interactive-primary-active);
|
|
142
|
-
}
|
|
143
|
-
.np-theme-personal .np-circular-btn.positive.secondary .tw-icon {
|
|
144
|
-
color: var(--color-interactive-primary);
|
|
145
|
-
}
|
|
146
|
-
.np-theme-personal .np-circular-btn.positive.secondary:not(.disabled):not(:disabled):hover .tw-icon,
|
|
147
|
-
.np-theme-personal .np-circular-btn.positive.secondary input[type="button"]:active + .tw-icon {
|
|
148
|
-
color: white;
|
|
149
|
-
color: var(--color-interactive-control);
|
|
150
|
-
}
|
|
151
|
-
.np-theme-personal .np-circular-btn.positive.secondary:active input[type="button"] + .tw-icon {
|
|
152
|
-
color: var(--color-interactive-control);
|
|
153
|
-
}
|
|
154
|
-
.np-theme-personal .np-circular-btn.negative .np-circular-btn__label {
|
|
155
|
-
color: var(--color-sentiment-negative);
|
|
156
|
-
}
|
|
157
|
-
.np-theme-personal .np-circular-btn.negative:not(.disabled):not(:disabled):hover .np-circular-btn__label {
|
|
158
|
-
color: var(--color-sentiment-negative-hover);
|
|
159
|
-
}
|
|
160
|
-
.np-theme-personal .np-circular-btn.negative:active .np-circular-btn__label,
|
|
161
|
-
.np-theme-personal .np-circular-btn.negative input[type="button"]:active ~ .np-circular-btn__label {
|
|
162
|
-
color: var(--color-sentiment-negative-active);
|
|
19
|
+
.np-circular-btn-primary-negative .np-circular-btn-label,
|
|
20
|
+
.np-circular-btn-secondary-negative .np-circular-btn-label {
|
|
21
|
+
color: var(--color-sentiment-negative-primary);
|
|
163
22
|
}
|
|
164
|
-
.np-
|
|
165
|
-
|
|
23
|
+
.np-circular-btn-primary-negative .np-circular-btn-label:not(.disabled):not(:disabled):hover,
|
|
24
|
+
.np-circular-btn-secondary-negative .np-circular-btn-label:not(.disabled):not(:disabled):hover {
|
|
25
|
+
color: var(--color-sentiment-negative-primary-hover);
|
|
166
26
|
}
|
|
167
|
-
.np-
|
|
168
|
-
.np-
|
|
169
|
-
color:
|
|
170
|
-
color: var(--color-interactive-control);
|
|
27
|
+
.np-circular-btn-primary-negative .np-circular-btn-label:not(.disabled):not(:disabled):active,
|
|
28
|
+
.np-circular-btn-secondary-negative .np-circular-btn-label:not(.disabled):not(:disabled):active {
|
|
29
|
+
color: var(--color-sentiment-negative-primary-active);
|
|
171
30
|
}
|
|
172
|
-
.np-
|
|
173
|
-
|
|
31
|
+
.np-circular-btn-disabled {
|
|
32
|
+
cursor: not-allowed;
|
|
174
33
|
}
|
|
@@ -1,105 +1,36 @@
|
|
|
1
|
-
@import (reference) "../../node_modules/@transferwise/neptune-css/src/less/mixins/_logical-properties.less";
|
|
2
|
-
@import "./_button-label-states.less";
|
|
3
|
-
|
|
4
1
|
.np-circular-btn {
|
|
5
2
|
display: inline-flex;
|
|
6
3
|
flex-direction: column;
|
|
7
4
|
align-items: center;
|
|
8
|
-
text-align: center;
|
|
9
5
|
cursor: pointer;
|
|
10
|
-
position: relative;
|
|
11
|
-
|
|
12
|
-
.tw-icon {
|
|
13
|
-
position: absolute;
|
|
14
|
-
top: var(--size-16);
|
|
15
|
-
pointer-events: none;
|
|
16
|
-
color: white;
|
|
17
|
-
transition: color 0.15s ease-in-out;
|
|
18
|
-
width: 100%;
|
|
19
|
-
.left(0);
|
|
20
6
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
7
|
+
&-primary-default,
|
|
8
|
+
&-secondary-default {
|
|
9
|
+
.np-circular-btn-label {
|
|
10
|
+
color: var(--color-interactive-primary);
|
|
11
|
+
&:not(.disabled, :disabled):hover {
|
|
12
|
+
color: var(--color-interactive-primary-hover);
|
|
13
|
+
}
|
|
14
|
+
&:not(.disabled, :disabled):active {
|
|
15
|
+
color: var(--color-interactive-primary-active);
|
|
16
|
+
}
|
|
27
17
|
}
|
|
28
18
|
}
|
|
29
19
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
.
|
|
33
|
-
|
|
34
|
-
&:hover
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
&-primary-negative,
|
|
21
|
+
&-secondary-negative {
|
|
22
|
+
.np-circular-btn-label {
|
|
23
|
+
color: var(--color-sentiment-negative-primary);
|
|
24
|
+
&:not(.disabled, :disabled):hover {
|
|
25
|
+
color: var(--color-sentiment-negative-primary-hover);
|
|
26
|
+
}
|
|
27
|
+
&:not(.disabled, :disabled):active {
|
|
28
|
+
color: var(--color-sentiment-negative-primary-active);
|
|
37
29
|
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
&.negative .tw-icon,
|
|
41
|
-
&.negative.secondary:not(.disabled, :disabled):hover .tw-icon,
|
|
42
|
-
&.negative.secondary:not(.disabled, :disabled):active .tw-icon {
|
|
43
|
-
// TODO, this will need to be removed when we update our CSS architecture
|
|
44
|
-
color: var(--color-contrast) !important;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
&.negative.secondary:not(.disabled, :disabled) .tw-icon {
|
|
48
|
-
// TODO, this will need to be removed when we update our CSS architecture
|
|
49
|
-
color: var(--color-sentiment-negative) !important;
|
|
50
30
|
}
|
|
51
31
|
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.button-label-states(
|
|
55
|
-
np-circular-btn,
|
|
56
|
-
accent,
|
|
57
|
-
var(--color-interactive-accent),
|
|
58
|
-
var(--color-interactive-accent-hover),
|
|
59
|
-
var(--color-interactive-accent-active)
|
|
60
|
-
);
|
|
61
|
-
|
|
62
|
-
.button-label-states(
|
|
63
|
-
np-circular-btn,
|
|
64
|
-
positive,
|
|
65
|
-
var(--color-interactive-positive),
|
|
66
|
-
var(--color-interactive-positive-hover),
|
|
67
|
-
var(--color-interactive-positive-active)
|
|
68
|
-
);
|
|
69
32
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
var(--color-interactive-negative),
|
|
74
|
-
var(--color-interactive-negative-hover),
|
|
75
|
-
var(--color-interactive-negative-active)
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
.np-theme-personal {
|
|
79
|
-
.button-label-states(
|
|
80
|
-
np-circular-btn,
|
|
81
|
-
accent,
|
|
82
|
-
var(--color-interactive-primary),
|
|
83
|
-
var(--color-interactive-primary-hover),
|
|
84
|
-
var(--color-interactive-primary-active),
|
|
85
|
-
true
|
|
86
|
-
);
|
|
87
|
-
|
|
88
|
-
.button-label-states(
|
|
89
|
-
np-circular-btn,
|
|
90
|
-
positive,
|
|
91
|
-
var(--color-interactive-primary),
|
|
92
|
-
var(--color-interactive-primary-hover),
|
|
93
|
-
var(--color-interactive-primary-active),
|
|
94
|
-
true
|
|
95
|
-
);
|
|
96
|
-
|
|
97
|
-
.button-label-states(
|
|
98
|
-
np-circular-btn,
|
|
99
|
-
negative,
|
|
100
|
-
var(--color-sentiment-negative),
|
|
101
|
-
var(--color-sentiment-negative-hover),
|
|
102
|
-
var(--color-sentiment-negative-active),
|
|
103
|
-
true
|
|
104
|
-
);
|
|
33
|
+
&-disabled {
|
|
34
|
+
cursor: not-allowed;
|
|
35
|
+
}
|
|
105
36
|
}
|
|
@@ -5,14 +5,16 @@ import { ControlType, Priority } from '../common';
|
|
|
5
5
|
import { Meta, StoryObj } from '@storybook/react';
|
|
6
6
|
import CircularButton from './CircularButton';
|
|
7
7
|
import { storyConfig } from '../test-utils';
|
|
8
|
+
import Title from '../title';
|
|
9
|
+
import Body from '../body';
|
|
8
10
|
|
|
9
11
|
export default {
|
|
10
12
|
component: CircularButton,
|
|
11
13
|
title: 'Actions/CircularButton',
|
|
14
|
+
tags: ['autodocs'],
|
|
12
15
|
args: {
|
|
13
16
|
children: 'Button text',
|
|
14
|
-
|
|
15
|
-
icon: 'Freeze' as unknown as React.ReactElement,
|
|
17
|
+
icon: <Icons.Freeze />,
|
|
16
18
|
},
|
|
17
19
|
argTypes: {
|
|
18
20
|
icon: {
|
|
@@ -28,8 +30,8 @@ type Story = StoryObj<typeof CircularButton>;
|
|
|
28
30
|
|
|
29
31
|
export const Basic: Story = {
|
|
30
32
|
args: {
|
|
31
|
-
priority:
|
|
32
|
-
type:
|
|
33
|
+
priority: 'primary',
|
|
34
|
+
type: 'default',
|
|
33
35
|
disabled: false,
|
|
34
36
|
},
|
|
35
37
|
};
|
|
@@ -41,26 +43,45 @@ export const All: Story = {
|
|
|
41
43
|
render: (props) => {
|
|
42
44
|
return (
|
|
43
45
|
<>
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<
|
|
51
|
-
<CircularButton {...props} priority=
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
<
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
<CircularButton {...props} disabled />
|
|
62
|
-
|
|
63
|
-
|
|
46
|
+
<Title type="title-subsection" className="m-y-2">
|
|
47
|
+
Default (Primary and secondary)
|
|
48
|
+
</Title>
|
|
49
|
+
<Body>
|
|
50
|
+
<CircularButton {...props} priority="primary" type="default" />
|
|
51
|
+
<CircularButton {...props} priority="secondary" type="default" />
|
|
52
|
+
<CircularButton {...props} priority="primary" type="default" disabled />
|
|
53
|
+
<CircularButton {...props} priority="secondary" type="default" disabled />
|
|
54
|
+
</Body>
|
|
55
|
+
|
|
56
|
+
<Title type="title-subsection" className="m-y-2">
|
|
57
|
+
Negative (Primary and secondary)
|
|
58
|
+
</Title>
|
|
59
|
+
<Body>
|
|
60
|
+
<CircularButton {...props} priority="primary" type="negative" />
|
|
61
|
+
<CircularButton {...props} priority="secondary" type="negative" />
|
|
62
|
+
<CircularButton {...props} priority="primary" type="negative" disabled />
|
|
63
|
+
<CircularButton {...props} priority="secondary" type="negative" disabled />
|
|
64
|
+
</Body>
|
|
65
|
+
|
|
66
|
+
<Title type="title-body" className="m-y-2">
|
|
67
|
+
Accent (Deprecated)
|
|
68
|
+
</Title>
|
|
69
|
+
<Body>
|
|
70
|
+
<CircularButton {...props} priority="primary" type="accent" />
|
|
71
|
+
<CircularButton {...props} priority="secondary" type="accent" />
|
|
72
|
+
<CircularButton {...props} priority="primary" type="accent" disabled />
|
|
73
|
+
<CircularButton {...props} priority="secondary" type="accent" disabled />
|
|
74
|
+
</Body>
|
|
75
|
+
|
|
76
|
+
<Title type="title-body" className="m-y-2">
|
|
77
|
+
Positive (Deprecated)
|
|
78
|
+
</Title>
|
|
79
|
+
<Body>
|
|
80
|
+
<CircularButton {...props} priority="primary" type="positive" />
|
|
81
|
+
<CircularButton {...props} priority="secondary" type="positive" />
|
|
82
|
+
<CircularButton {...props} priority="primary" type="positive" disabled />
|
|
83
|
+
<CircularButton {...props} priority="secondary" type="positive" disabled />
|
|
84
|
+
</Body>
|
|
64
85
|
</>
|
|
65
86
|
);
|
|
66
87
|
},
|