@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.
Files changed (148) hide show
  1. package/build/avatarLayout/AvatarLayout.js +2 -9
  2. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  3. package/build/avatarLayout/AvatarLayout.mjs +2 -9
  4. package/build/avatarLayout/AvatarLayout.mjs.map +1 -1
  5. package/build/button/Button.js +97 -76
  6. package/build/button/Button.js.map +1 -1
  7. package/build/button/Button.mjs +97 -76
  8. package/build/button/Button.mjs.map +1 -1
  9. package/build/circularButton/CircularButton.js +19 -24
  10. package/build/circularButton/CircularButton.js.map +1 -1
  11. package/build/circularButton/CircularButton.mjs +20 -25
  12. package/build/circularButton/CircularButton.mjs.map +1 -1
  13. package/build/criticalBanner/CriticalCommsBanner.js +2 -2
  14. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  15. package/build/criticalBanner/CriticalCommsBanner.mjs +1 -1
  16. package/build/definitionList/DefinitionList.js.map +1 -1
  17. package/build/definitionList/DefinitionList.mjs.map +1 -1
  18. package/build/header/Header.js +2 -2
  19. package/build/header/Header.js.map +1 -1
  20. package/build/header/Header.mjs +1 -1
  21. package/build/i18n/de.json +1 -0
  22. package/build/i18n/de.json.js +1 -0
  23. package/build/i18n/de.json.js.map +1 -1
  24. package/build/i18n/de.json.mjs +1 -0
  25. package/build/i18n/de.json.mjs.map +1 -1
  26. package/build/i18n/it.json +1 -0
  27. package/build/i18n/it.json.js +1 -0
  28. package/build/i18n/it.json.js.map +1 -1
  29. package/build/i18n/it.json.mjs +1 -0
  30. package/build/i18n/it.json.mjs.map +1 -1
  31. package/build/i18n/th.json +1 -0
  32. package/build/i18n/th.json.js +1 -0
  33. package/build/i18n/th.json.js.map +1 -1
  34. package/build/i18n/th.json.mjs +1 -0
  35. package/build/i18n/th.json.mjs.map +1 -1
  36. package/build/index.js +2 -2
  37. package/build/index.mjs +1 -1
  38. package/build/link/Link.js +3 -8
  39. package/build/link/Link.js.map +1 -1
  40. package/build/link/Link.mjs +3 -8
  41. package/build/link/Link.mjs.map +1 -1
  42. package/build/main.css +17 -431
  43. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js +3 -1
  44. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.js.map +1 -1
  45. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs +3 -1
  46. package/build/primitives/PrimitiveAnchor/src/PrimitiveAnchor.mjs.map +1 -1
  47. package/build/primitives/PrimitiveButton/src/PrimitiveButton.js +4 -1
  48. package/build/primitives/PrimitiveButton/src/PrimitiveButton.js.map +1 -1
  49. package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs +4 -1
  50. package/build/primitives/PrimitiveButton/src/PrimitiveButton.mjs.map +1 -1
  51. package/build/select/Select.js +3 -5
  52. package/build/select/Select.js.map +1 -1
  53. package/build/select/Select.mjs +2 -4
  54. package/build/select/Select.mjs.map +1 -1
  55. package/build/styles/avatarLayout/AvatarLayout.css +0 -11
  56. package/build/styles/button/Button.css +16 -255
  57. package/build/styles/circularButton/CircularButton.css +17 -158
  58. package/build/styles/main.css +17 -431
  59. package/build/types/avatarLayout/AvatarLayout.d.ts +2 -1
  60. package/build/types/avatarLayout/AvatarLayout.d.ts.map +1 -1
  61. package/build/types/avatarLayout/index.d.ts +0 -1
  62. package/build/types/avatarLayout/index.d.ts.map +1 -1
  63. package/build/types/button/Button.d.ts +23 -1
  64. package/build/types/button/Button.d.ts.map +1 -1
  65. package/build/types/button/index.d.ts +2 -2
  66. package/build/types/button/index.d.ts.map +1 -1
  67. package/build/types/circularButton/CircularButton.d.ts +11 -4
  68. package/build/types/circularButton/CircularButton.d.ts.map +1 -1
  69. package/build/types/definitionList/DefinitionList.d.ts +1 -2
  70. package/build/types/definitionList/DefinitionList.d.ts.map +1 -1
  71. package/build/types/link/Link.d.ts +2 -2
  72. package/build/types/link/Link.d.ts.map +1 -1
  73. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.d.ts.map +1 -1
  74. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts +1 -1
  75. package/build/types/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.d.ts.map +1 -1
  76. package/build/types/primitives/PrimitiveButton/src/PrimitiveButton.d.ts.map +1 -1
  77. package/build/types/select/Select.d.ts.map +1 -1
  78. package/build/upload/steps/completeStep/completeStep.js +2 -2
  79. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  80. package/build/upload/steps/completeStep/completeStep.mjs +1 -1
  81. package/build/upload/steps/processingStep/processingStep.js +2 -2
  82. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  83. package/build/upload/steps/processingStep/processingStep.mjs +1 -1
  84. package/build/uploadInput/UploadInput.js +3 -3
  85. package/build/uploadInput/UploadInput.js.map +1 -1
  86. package/build/uploadInput/UploadInput.mjs +1 -1
  87. package/package.json +3 -3
  88. package/src/avatarLayout/AvatarLayout.css +0 -11
  89. package/src/avatarLayout/AvatarLayout.less +1 -18
  90. package/src/avatarLayout/AvatarLayout.tsx +3 -11
  91. package/src/avatarLayout/index.ts +0 -1
  92. package/src/button/Button.css +16 -255
  93. package/src/button/Button.less +14 -215
  94. package/src/button/Button.spec.tsx +231 -54
  95. package/src/button/Button.story.tsx +136 -287
  96. package/src/button/Button.tsx +131 -84
  97. package/src/button/__snapshots__/{LegacyButton.spec.tsx.snap → Button.spec.tsx.snap} +22 -22
  98. package/src/button/index.ts +3 -2
  99. package/src/circularButton/CircularButton.css +17 -158
  100. package/src/circularButton/CircularButton.less +22 -91
  101. package/src/circularButton/CircularButton.story.tsx +45 -24
  102. package/src/circularButton/CircularButton.tsx +39 -28
  103. package/src/definitionList/DefinitionList.story.tsx +57 -57
  104. package/src/definitionList/DefinitionList.tsx +1 -1
  105. package/src/flowNavigation/__snapshots__/FlowNavigation.spec.js.snap +1 -1
  106. package/src/i18n/de.json +1 -0
  107. package/src/i18n/it.json +1 -0
  108. package/src/i18n/th.json +1 -0
  109. package/src/iconButton/IconButton.story.tsx +6 -6
  110. package/src/inputs/SelectInput.story.tsx +1 -1
  111. package/src/link/Link.tsx +6 -15
  112. package/src/main.css +17 -431
  113. package/src/main.less +0 -1
  114. package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.tsx +7 -1
  115. package/src/primitives/PrimitiveAnchor/src/PrimitiveAnchor.types.ts +1 -1
  116. package/src/primitives/PrimitiveAnchor/test/PrimitiveAnchor.spec.tsx +3 -1
  117. package/src/primitives/PrimitiveButton/src/PrimitiveButton.tsx +8 -1
  118. package/src/primitives/PrimitiveButton/test/PrimitiveButton.spec.tsx +5 -2
  119. package/src/select/Select.tsx +0 -1
  120. package/src/slidingPanel/SlidingPanel.spec.tsx +69 -0
  121. package/build/button/Button.resolver.js +0 -78
  122. package/build/button/Button.resolver.js.map +0 -1
  123. package/build/button/Button.resolver.mjs +0 -76
  124. package/build/button/Button.resolver.mjs.map +0 -1
  125. package/build/button/LegacyButton.js +0 -114
  126. package/build/button/LegacyButton.js.map +0 -1
  127. package/build/button/LegacyButton.mjs +0 -112
  128. package/build/button/LegacyButton.mjs.map +0 -1
  129. package/build/styles/button/Button.vars.css +0 -59
  130. package/build/styles/button/LegacyButton.css +0 -23
  131. package/build/types/button/Button.resolver.d.ts +0 -31
  132. package/build/types/button/Button.resolver.d.ts.map +0 -1
  133. package/build/types/button/Button.types.d.ts +0 -58
  134. package/build/types/button/Button.types.d.ts.map +0 -1
  135. package/build/types/button/LegacyButton.d.ts +0 -30
  136. package/build/types/button/LegacyButton.d.ts.map +0 -1
  137. package/src/button/Button.resolver.tsx +0 -120
  138. package/src/button/Button.types.ts +0 -79
  139. package/src/button/Button.vars.css +0 -59
  140. package/src/button/Button.vars.less +0 -73
  141. package/src/button/LegacyButton.css +0 -23
  142. package/src/button/LegacyButton.less +0 -24
  143. package/src/button/LegacyButton.spec.tsx +0 -245
  144. package/src/button/LegacyButton.story.tsx +0 -224
  145. package/src/button/LegacyButton.tsx +0 -161
  146. package/src/circularButton/_button-label-states.less +0 -34
  147. package/src/definitionList/DefinitionList.spec.js +0 -91
  148. 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[`LegacyButton by default renders a medium button of type accent and priority primary 1`] = `
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[`LegacyButton by default renders an anchor tag with button styles of type accent and priority primary 1`] = `
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[`LegacyButton deprecated types renders danger as negative buttons with priority secondary and logs a warning 1`] = `
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[`LegacyButton deprecated types renders link as accent buttons with priority tertiary and logs a warning 1`] = `
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[`LegacyButton deprecated types renders pay as positive buttons and logs a warning 1`] = `
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[`LegacyButton deprecated types renders primary as accent buttons and logs a warning 1`] = `
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[`LegacyButton other states renders as block if block is true 1`] = `
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[`LegacyButton priorities defaults tertiary buttons to secondary for positive buttons 1`] = `
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[`LegacyButton priorities defaults tertiary buttons to secondary for positive buttons 2`] = `
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[`LegacyButton priorities renders primary buttons 1`] = `
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[`LegacyButton priorities renders primary buttons 2`] = `
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[`LegacyButton priorities renders primary buttons 3`] = `
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[`LegacyButton priorities renders secondary buttons 1`] = `
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[`LegacyButton priorities renders secondary buttons 2`] = `
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[`LegacyButton priorities renders secondary buttons 3`] = `
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[`LegacyButton priorities renders tertiary buttons 1`] = `
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[`LegacyButton sizes renders large buttons 1`] = `
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[`LegacyButton sizes renders medium buttons 1`] = `
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[`LegacyButton sizes renders small buttons 1`] = `
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[`LegacyButton types renders accent buttons 1`] = `
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[`LegacyButton types renders negative buttons 1`] = `
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[`LegacyButton types renders positive buttons 1`] = `
297
+ exports[`Button types renders positive buttons 1`] = `
298
298
  <div>
299
299
  <button
300
300
  aria-busy="false"
@@ -1,2 +1,3 @@
1
- export { default } from './Button.resolver';
2
- export type { ButtonProps } from './Button.resolver';
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 .tw-icon {
10
- position: absolute;
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-theme-personal .np-circular-btn.accent:not(.disabled):not(:disabled):hover .np-circular-btn__label {
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-theme-personal .np-circular-btn.accent:active .np-circular-btn__label,
119
- .np-theme-personal .np-circular-btn.accent input[type="button"]:active ~ .np-circular-btn__label {
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-theme-personal .np-circular-btn.accent.secondary .tw-icon {
123
- color: var(--color-interactive-primary);
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-theme-personal .np-circular-btn.negative.secondary .tw-icon {
165
- color: var(--color-sentiment-negative);
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-theme-personal .np-circular-btn.negative.secondary:not(.disabled):not(:disabled):hover .tw-icon,
168
- .np-theme-personal .np-circular-btn.negative.secondary input[type="button"]:active + .tw-icon {
169
- color: white;
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-theme-personal .np-circular-btn.negative.secondary:active input[type="button"] + .tw-icon {
173
- color: var(--color-interactive-control);
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
- @media (--screen-400-zoom) {
22
- top: var(--size-12);
23
- }
24
-
25
- > svg {
26
- margin: 0 auto;
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
- .np-theme-personal & {
31
- /* stylelint-disable-next-line no-duplicate-selectors */
32
- .tw-icon {
33
- &,
34
- &:hover,
35
- &:active {
36
- color: var(--color-interactive-control);
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
- .button-label-states(
71
- np-circular-btn,
72
- negative,
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
- // Needs to be cast because we're mapping icon names to components
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: Priority.PRIMARY,
32
- type: ControlType.ACCENT,
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
- <div className="m-b-2">
45
- <div className="title-4 m-b-1">Accent</div>
46
- <CircularButton {...props} priority={Priority.PRIMARY} type={ControlType.ACCENT} />
47
- <CircularButton {...props} priority={Priority.SECONDARY} type={ControlType.ACCENT} />
48
- </div>
49
- <div className="m-b-2">
50
- <div className="title-4 m-b-1">Positive</div>
51
- <CircularButton {...props} priority={Priority.PRIMARY} type={ControlType.POSITIVE} />
52
- <CircularButton {...props} priority={Priority.SECONDARY} type={ControlType.POSITIVE} />
53
- </div>
54
- <div className="m-b-2">
55
- <div className="title-4 m-b-1">Negative</div>
56
- <CircularButton {...props} priority={Priority.PRIMARY} type={ControlType.NEGATIVE} />
57
- <CircularButton {...props} priority={Priority.SECONDARY} type={ControlType.NEGATIVE} />
58
- </div>
59
- <div className="m-b-2">
60
- <div className="title-4 m-b-1">Disabled</div>
61
- <CircularButton {...props} disabled />
62
- <CircularButton {...props} priority={Priority.SECONDARY} disabled />
63
- </div>
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
  },