@transferwise/components 0.0.0-experimental-4533565 → 0.0.0-experimental-feb2ddf

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 (121) hide show
  1. package/build/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
  2. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  3. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +1 -1
  4. package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
  5. package/build/index.js +3 -3
  6. package/build/index.mjs +2 -2
  7. package/build/{listItem/ListItem.js → legacylistItem/LegacyListItem.js} +3 -3
  8. package/build/legacylistItem/LegacyListItem.js.map +1 -0
  9. package/build/{listItem/ListItem.mjs → legacylistItem/LegacyListItem.mjs} +3 -3
  10. package/build/legacylistItem/LegacyListItem.mjs.map +1 -0
  11. package/build/legacylistItem/List.js.map +1 -0
  12. package/build/legacylistItem/List.mjs.map +1 -0
  13. package/build/main.css +60 -57
  14. package/build/phoneNumberInput/PhoneNumberInput.js +1 -1
  15. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  16. package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -1
  17. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  18. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
  19. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js.map +1 -1
  20. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs +2 -2
  21. package/build/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.mjs.map +1 -1
  22. package/build/styles/legacylistItem/LegacyListItem.css +6 -0
  23. package/build/styles/listItem/ListItem.css +185 -3
  24. package/build/styles/main.css +60 -57
  25. package/build/styles/switch/Switch.css +3 -0
  26. package/build/types/index.d.ts +3 -3
  27. package/build/types/index.d.ts.map +1 -1
  28. package/build/types/legacylistItem/LegacyListItem.d.ts +13 -0
  29. package/build/types/legacylistItem/LegacyListItem.d.ts.map +1 -0
  30. package/build/types/legacylistItem/List.d.ts.map +1 -0
  31. package/build/types/legacylistItem/index.d.ts +5 -0
  32. package/build/types/legacylistItem/index.d.ts.map +1 -0
  33. package/build/types/listItem/ListItem.d.ts +38 -8
  34. package/build/types/listItem/ListItem.d.ts.map +1 -1
  35. package/build/types/{item/ItemAdditionalInfo.d.ts → listItem/ListItemAdditionalInfo.d.ts} +1 -1
  36. package/build/types/listItem/ListItemAdditionalInfo.d.ts.map +1 -0
  37. package/build/types/{item/ItemButton.d.ts → listItem/ListItemButton.d.ts} +1 -1
  38. package/build/types/listItem/ListItemButton.d.ts.map +1 -0
  39. package/build/types/{item/ItemCheckbox.d.ts → listItem/ListItemCheckbox.d.ts} +1 -1
  40. package/build/types/listItem/ListItemCheckbox.d.ts.map +1 -0
  41. package/build/types/{item/ItemIconButton.d.ts → listItem/ListItemIconButton.d.ts} +1 -1
  42. package/build/types/listItem/ListItemIconButton.d.ts.map +1 -0
  43. package/build/types/{item/ItemMedia.d.ts → listItem/ListItemMedia.d.ts} +1 -1
  44. package/build/types/listItem/ListItemMedia.d.ts.map +1 -0
  45. package/build/types/{item/ItemNavigation.d.ts → listItem/ListItemNavigation.d.ts} +1 -1
  46. package/build/types/listItem/ListItemNavigation.d.ts.map +1 -0
  47. package/build/types/{item/ItemSwitch.d.ts → listItem/ListItemSwitch.d.ts} +1 -1
  48. package/build/types/listItem/ListItemSwitch.d.ts.map +1 -0
  49. package/build/types/listItem/index.d.ts +4 -3
  50. package/build/types/listItem/index.d.ts.map +1 -1
  51. package/build/types/listItem/prompt/Prompt.d.ts.map +1 -0
  52. package/build/types/listItem/useItemControl.d.ts +5 -0
  53. package/build/types/listItem/useItemControl.d.ts.map +1 -0
  54. package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts +2 -2
  55. package/build/types/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.d.ts.map +1 -1
  56. package/package.json +3 -3
  57. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
  58. package/src/index.ts +3 -3
  59. package/src/legacylistItem/LegacyListItem.css +6 -0
  60. package/src/legacylistItem/LegacyListItem.less +7 -0
  61. package/src/legacylistItem/LegacyListItem.story.tsx +120 -0
  62. package/src/{listItem/ListItem.tests.story.tsx → legacylistItem/LegacyListItem.tests.story.tsx} +2 -2
  63. package/src/legacylistItem/LegacyListItem.tsx +53 -0
  64. package/src/legacylistItem/index.ts +4 -0
  65. package/src/listItem/ListItem.css +185 -3
  66. package/src/listItem/ListItem.less +180 -5
  67. package/src/listItem/ListItem.story.tsx +250 -97
  68. package/src/listItem/ListItem.tsx +167 -37
  69. package/src/{item/ItemAdditionalInfo.tsx → listItem/ListItemAdditionalInfo.tsx} +2 -2
  70. package/src/{item/ItemButton.spec.tsx → listItem/ListItemButton.spec.tsx} +4 -4
  71. package/src/listItem/index.ts +5 -3
  72. package/src/listItem/useItemControl.tsx +12 -0
  73. package/src/main.css +60 -57
  74. package/src/main.less +2 -2
  75. package/src/phoneNumberInput/PhoneNumberInput.spec.tsx +4 -4
  76. package/src/phoneNumberInput/PhoneNumberInput.story.tsx +22 -0
  77. package/src/phoneNumberInput/PhoneNumberInput.tsx +1 -1
  78. package/src/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.ts +4 -3
  79. package/src/switch/Switch.css +3 -0
  80. package/src/switch/Switch.less +1 -0
  81. package/build/listItem/List.js.map +0 -1
  82. package/build/listItem/List.mjs.map +0 -1
  83. package/build/listItem/ListItem.js.map +0 -1
  84. package/build/listItem/ListItem.mjs.map +0 -1
  85. package/build/styles/item/Item.css +0 -188
  86. package/build/types/item/Item.d.ts +0 -43
  87. package/build/types/item/Item.d.ts.map +0 -1
  88. package/build/types/item/ItemAdditionalInfo.d.ts.map +0 -1
  89. package/build/types/item/ItemButton.d.ts.map +0 -1
  90. package/build/types/item/ItemCheckbox.d.ts.map +0 -1
  91. package/build/types/item/ItemIconButton.d.ts.map +0 -1
  92. package/build/types/item/ItemMedia.d.ts.map +0 -1
  93. package/build/types/item/ItemNavigation.d.ts.map +0 -1
  94. package/build/types/item/ItemSwitch.d.ts.map +0 -1
  95. package/build/types/item/index.d.ts +0 -6
  96. package/build/types/item/index.d.ts.map +0 -1
  97. package/build/types/item/prompt/Prompt.d.ts.map +0 -1
  98. package/build/types/item/useItemControl.d.ts +0 -5
  99. package/build/types/item/useItemControl.d.ts.map +0 -1
  100. package/build/types/listItem/List.d.ts.map +0 -1
  101. package/src/item/Item.css +0 -188
  102. package/src/item/Item.less +0 -182
  103. package/src/item/Item.story.tsx +0 -273
  104. package/src/item/Item.tsx +0 -181
  105. package/src/item/index.ts +0 -6
  106. package/src/item/useItemControl.tsx +0 -12
  107. /package/build/{listItem → legacylistItem}/List.js +0 -0
  108. /package/build/{listItem → legacylistItem}/List.mjs +0 -0
  109. /package/build/types/{listItem → legacylistItem}/List.d.ts +0 -0
  110. /package/build/types/{item → listItem}/prompt/Prompt.d.ts +0 -0
  111. /package/src/{listItem/ListItem.spec.tsx → legacylistItem/LegacyListItem.spec.tsx} +0 -0
  112. /package/src/{listItem → legacylistItem}/List.tsx +0 -0
  113. /package/src/{item/ItemButton.tsx → listItem/ListItemButton.tsx} +0 -0
  114. /package/src/{item/ItemCheckbox.tsx → listItem/ListItemCheckbox.tsx} +0 -0
  115. /package/src/{item/ItemIconButton.tsx → listItem/ListItemIconButton.tsx} +0 -0
  116. /package/src/{item/ItemMedia.tsx → listItem/ListItemMedia.tsx} +0 -0
  117. /package/src/{item/ItemNavigation.tsx → listItem/ListItemNavigation.tsx} +0 -0
  118. /package/src/{item/ItemSwitch.tsx → listItem/ListItemSwitch.tsx} +0 -0
  119. /package/src/{item → listItem}/prompt/Prompt.spec.tsx +0 -0
  120. /package/src/{item → listItem}/prompt/Prompt.story.tsx +0 -0
  121. /package/src/{item → listItem}/prompt/Prompt.tsx +0 -0
@@ -1,6 +0,0 @@
1
- export type { Props as ItemProps } from './Item';
2
- export type { ItemAdditionalInfoProps } from './ItemAdditionalInfo';
3
- export type { ItemCheckboxProps } from './ItemCheckbox';
4
- export type { ItemImageProps, ItemAvatarViewProps, ItemAvatarLayoutProps } from './ItemMedia';
5
- export { default } from './Item';
6
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/item/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,QAAQ,CAAC;AACjD,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,YAAY,EAAE,cAAc,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAE9F,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Prompt.d.ts","sourceRoot":"","sources":["../../../../src/item/prompt/Prompt.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGzC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAGvC,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EACA,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,OAAO,GAAG,SAAS,CAAC,OAAO,EAAE,GACpF,UAAU,GACV,SAAS,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,MAAM,CAAC,EAAE,IAAI,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC,GAAG;QAAE,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACrF,CAAC;AAEF,eAAO,MAAM,UAAU,+BAAgC,eAAe,gCAyBrE,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -1,5 +0,0 @@
1
- import { ItemTypes } from './Item';
2
- export declare function useItemControl(controlType: ItemTypes): {
3
- baseItemProps: Pick<import("./Item").Props, "as" | "disabled" | "inverted">;
4
- };
5
- //# sourceMappingURL=useItemControl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useItemControl.d.ts","sourceRoot":"","sources":["../../../src/item/useItemControl.tsx"],"names":[],"mappings":"AACA,OAAO,EAAgC,SAAS,EAAE,MAAM,QAAQ,CAAC;AAEjE,wBAAgB,cAAc,CAAC,WAAW,EAAE,SAAS;;EAQpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../../src/listItem/List.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,SAAS;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,wBAAgB,IAAI,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,SAAS,+BAEtD"}
package/src/item/Item.css DELETED
@@ -1,188 +0,0 @@
1
- .np-item {
2
- padding: 16px;
3
- padding: var(--size-16);
4
- border-radius: 24px;
5
- border-radius: var(--radius-large);
6
- background-color: #ffffff;
7
- background-color: var(--color-background-screen);
8
- gap: 16px;
9
- gap: var(--size-16);
10
- }
11
- .np-item-interactive {
12
- cursor: pointer;
13
- }
14
- .np-item-interactive:hover {
15
- background-color: var(--color-background-screen-hover);
16
- }
17
- .np-item-interactive:active {
18
- background-color: var(--color-background-screen-active);
19
- }
20
- .np-item-media-image {
21
- width: var(--item-media-image-size);
22
- height: var(--item-media-image-size);
23
- }
24
- .np-item-body {
25
- width: 100%;
26
- }
27
- .np-item-title {
28
- color: #37517e;
29
- color: var(--color-content-primary);
30
- }
31
- .np-item-additional-info {
32
- color: #768e9c;
33
- color: var(--color-content-tertiary);
34
- }
35
- .np-item-value {
36
- flex: 0 0 auto;
37
- }
38
- .np-item-control {
39
- flex: 0 0 auto;
40
- }
41
- .np-item-spotlight-active {
42
- background-color: rgba(134,167,189,0.10196);
43
- background-color: var(--color-background-neutral);
44
- }
45
- .np-item-spotlight-active:hover {
46
- background-color: var(--color-background-neutral-hover);
47
- }
48
- .np-item-spotlight-active:active {
49
- background-color: var(--color-background-neutral-active);
50
- }
51
- .np-item-spotlight-inactive {
52
- background-color: rgba(134, 167, 189, 0.025);
53
- border: 1px dashed rgba(0,0,0,0.10196);
54
- border: 1px dashed var(--color-border-neutral);
55
- }
56
- @supports (color: color-mix(in lch, red, blue)) {
57
- .np-item-spotlight-inactive {
58
- background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
59
- }
60
- }
61
- .np-item-spotlight-inactive:hover {
62
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
63
- }
64
- .np-item-spotlight-inactive:active {
65
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
66
- }
67
- .np-item-prompt {
68
- display: inline-flex;
69
- padding-top: calc(8px / 2);
70
- padding-top: calc(var(--padding-x-small) / 2);
71
- padding-bottom: calc(8px / 2);
72
- padding-bottom: calc(var(--padding-x-small) / 2);
73
- padding-left: calc(8px - 1px);
74
- padding-left: calc(var(--padding-x-small) - 1px);
75
- padding-right: 8px;
76
- padding-right: var(--padding-x-small);
77
- border-radius: 10px;
78
- border-radius: var(--radius-small);
79
- word-break: break-word;
80
- word-wrap: break-word;
81
- }
82
- .np-item-prompt .np-prompt-icon {
83
- padding-right: calc(12px / 2);
84
- padding-right: calc(var(--size-12) / 2);
85
- padding-top: calc(4px - 1px);
86
- padding-top: calc(var(--size-4) - 1px);
87
- padding-bottom: calc(4px - 1px);
88
- padding-bottom: calc(var(--size-4) - 1px);
89
- }
90
- .np-item-prompt .np-prompt-icon .tw-icon-tags,
91
- .np-item-prompt .np-prompt-icon .tw-icon-confetti {
92
- color: var(--color-sentiment-positive-primary);
93
- }
94
- .np-item-prompt a {
95
- text-underline-offset: calc(4px / 2);
96
- text-underline-offset: calc(var(--size-4) / 2);
97
- }
98
- .np-item-prompt.np-prompt-interactive {
99
- -webkit-text-decoration: none;
100
- text-decoration: none;
101
- cursor: pointer;
102
- border: none;
103
- }
104
- .np-item-prompt.negative {
105
- background-color: var(--color-sentiment-negative-secondary);
106
- color: var(--color-sentiment-negative-primary);
107
- }
108
- .np-item-prompt.negative a {
109
- color: var(--color-sentiment-negative-primary);
110
- }
111
- .np-item-prompt.negative a:hover {
112
- color: var(--color-sentiment-negative-primary-hover);
113
- }
114
- .np-item-prompt.negative a:active {
115
- color: var(--color-sentiment-negative-primary-active);
116
- }
117
- .np-prompt-interactive.np-item-prompt.negative:hover {
118
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 95%, var(--color-sentiment-negative-primary));
119
- }
120
- .np-prompt-interactive.np-item-prompt.negative:active {
121
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 90%, var(--color-sentiment-negative-primary));
122
- }
123
- .np-item-prompt.positive,
124
- .np-item-prompt.discount,
125
- .np-item-prompt.savings {
126
- background-color: var(--color-sentiment-positive-secondary);
127
- color: var(--color-sentiment-positive-primary);
128
- }
129
- .np-item-prompt.positive a,
130
- .np-item-prompt.discount a,
131
- .np-item-prompt.savings a {
132
- color: var(--color-sentiment-positive-primary);
133
- }
134
- .np-item-prompt.positive a:hover,
135
- .np-item-prompt.discount a:hover,
136
- .np-item-prompt.savings a:hover {
137
- color: var(--color-sentiment-positive-primary-hover);
138
- }
139
- .np-item-prompt.positive a:active,
140
- .np-item-prompt.discount a:active,
141
- .np-item-prompt.savings a:active {
142
- color: var(--color-sentiment-positive-primary-active);
143
- }
144
- .np-prompt-interactive.np-item-prompt.positive:hover,
145
- .np-prompt-interactive.np-item-prompt.discount:hover,
146
- .np-prompt-interactive.np-item-prompt.savings:hover {
147
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 95%, var(--color-sentiment-positive-primary));
148
- }
149
- .np-prompt-interactive.np-item-prompt.positive:active,
150
- .np-prompt-interactive.np-item-prompt.discount:active,
151
- .np-prompt-interactive.np-item-prompt.savings:active {
152
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 90%, var(--color-sentiment-positive-primary));
153
- }
154
- .np-item-prompt.neutral {
155
- background-color: rgba(134,167,189,0.10196);
156
- background-color: var(--color-background-neutral);
157
- color: #37517e;
158
- color: var(--color-content-primary);
159
- }
160
- .np-item-prompt.neutral a {
161
- color: #37517e;
162
- color: var(--color-content-primary);
163
- }
164
- .np-prompt-interactive.np-item-prompt.neutral:hover {
165
- background-color: var(--color-background-neutral-hover);
166
- }
167
- .np-prompt-interactive.np-item-prompt.neutral:active {
168
- background-color: var(--color-background-neutral-active);
169
- }
170
- .np-item-prompt.warning {
171
- background-color: var(--color-sentiment-warning-secondary);
172
- color: var(--color-sentiment-warning-content);
173
- }
174
- .np-item-prompt.warning a {
175
- color: var(--color-sentiment-warning-content);
176
- }
177
- .np-item-prompt.warning a:hover {
178
- color: var(--color-sentiment-warning-content-hover);
179
- }
180
- .np-item-prompt.warning a:active {
181
- color: var(--color-sentiment-warning-content-active);
182
- }
183
- .np-prompt-interactive.np-item-prompt.warning:hover {
184
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 90%, var(--color-sentiment-warning-primary));
185
- }
186
- .np-prompt-interactive.np-item-prompt.warning:active {
187
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 80%, var(--color-sentiment-warning-primary));
188
- }
@@ -1,182 +0,0 @@
1
- .np-item {
2
- padding: var(--size-16);
3
- border-radius: var(--radius-large);
4
- background-color: var(--color-background-screen);
5
- gap: var(--size-16);
6
-
7
- &-interactive {
8
- cursor: pointer;
9
- &:hover {
10
- background-color: var(--color-background-screen-hover);
11
- }
12
- &:active {
13
- background-color: var(--color-background-screen-active);
14
- }
15
- }
16
-
17
- &-media {
18
-
19
- &-image {
20
- width: var(--item-media-image-size);
21
- height: var(--item-media-image-size);
22
- }
23
- }
24
-
25
- &-body {
26
- width: 100%;
27
- }
28
-
29
- &-title {
30
- color: var(--color-content-primary);
31
- }
32
-
33
- &-additional-info {
34
- color: var(--color-content-tertiary);
35
- }
36
-
37
- &-value {
38
- flex: 0 0 auto;
39
- }
40
-
41
- &-control {
42
- flex: 0 0 auto;
43
- }
44
-
45
- &-spotlight {
46
- &-active {
47
- background-color: var(--color-background-neutral);
48
-
49
- &:hover {
50
- background-color: var(--color-background-neutral-hover);
51
- }
52
- &:active {
53
- background-color: var(--color-background-neutral-active);
54
- }
55
- }
56
-
57
- &-inactive {
58
- background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
59
- border: 1px dashed var(--color-border-neutral);
60
-
61
- &:hover {
62
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
63
- }
64
- &:active {
65
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
66
- }
67
- }
68
- }
69
-
70
- &-prompt {
71
- display: inline-flex;
72
- padding-top: calc(var(--padding-x-small) / 2);
73
- padding-bottom: calc(var(--padding-x-small) / 2);
74
- padding-left: calc(var(--padding-x-small) - 1px);
75
- padding-right: var(--padding-x-small);
76
- border-radius: var(--radius-small);
77
- word-break: break-word;
78
- overflow-wrap: break-word;
79
-
80
- .np-prompt-icon {
81
- padding-right: calc(var(--size-12) / 2);
82
- padding-top: calc(var(--size-4) - 1px);
83
- padding-bottom: calc(var(--size-4) - 1px);
84
-
85
- .tw-icon-tags,
86
- .tw-icon-confetti {
87
- color: var(--color-sentiment-positive-primary);
88
- }
89
- }
90
-
91
- a {
92
- text-underline-offset: calc(var(--size-4) / 2);
93
- }
94
-
95
- &.np-prompt-interactive {
96
- text-decoration: none;
97
- cursor: pointer;
98
- border: none;
99
- }
100
-
101
- &.negative {
102
- background-color: var(--color-sentiment-negative-secondary);
103
- color: var(--color-sentiment-negative-primary);
104
- a {
105
- color: var(--color-sentiment-negative-primary);
106
- &:hover {
107
- color: var(--color-sentiment-negative-primary-hover);
108
- }
109
- &:active {
110
- color: var(--color-sentiment-negative-primary-active);
111
- }
112
- }
113
- .np-prompt-interactive& {
114
- &:hover {
115
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 95%, var(--color-sentiment-negative-primary));
116
- }
117
- &:active {
118
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 90%, var(--color-sentiment-negative-primary));
119
- }
120
- }
121
- }
122
- &.positive,
123
- &.discount,
124
- &.savings {
125
- background-color: var(--color-sentiment-positive-secondary);
126
- color: var(--color-sentiment-positive-primary);
127
- a {
128
- color: var(--color-sentiment-positive-primary);
129
- &:hover {
130
- color: var(--color-sentiment-positive-primary-hover);
131
- }
132
- &:active {
133
- color: var(--color-sentiment-positive-primary-active);
134
- }
135
- }
136
- .np-prompt-interactive& {
137
- &:hover {
138
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 95%, var(--color-sentiment-positive-primary));
139
- }
140
- &:active {
141
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 90%, var(--color-sentiment-positive-primary));
142
- }
143
- }
144
- }
145
- &.neutral {
146
- background-color: var(--color-background-neutral);
147
- color: var(--color-content-primary);
148
- a {
149
- color: var(--color-content-primary);
150
- }
151
- .np-prompt-interactive& {
152
- &:hover {
153
- background-color: var(--color-background-neutral-hover);
154
- }
155
- &:active {
156
- background-color: var(--color-background-neutral-active);
157
- }
158
- }
159
- }
160
- &.warning {
161
- background-color: var(--color-sentiment-warning-secondary);
162
- color: var(--color-sentiment-warning-content);
163
- a {
164
- color: var(--color-sentiment-warning-content);
165
- &:hover {
166
- color: var(--color-sentiment-warning-content-hover);
167
- }
168
- &:active {
169
- color: var(--color-sentiment-warning-content-active);
170
- }
171
- }
172
- .np-prompt-interactive& {
173
- &:hover {
174
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 90%, var(--color-sentiment-warning-primary));
175
- }
176
- &:active {
177
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 80%, var(--color-sentiment-warning-primary));
178
- }
179
- }
180
- }
181
- }
182
- }
@@ -1,273 +0,0 @@
1
- import Item, { Props as ItemProps } from './Item';
2
- import { Meta, StoryObj } from '@storybook/react';
3
- import React, { useState } from 'react';
4
- import { FastFlag, MultiCurrency, Plus, Receipt, Savings } from '@transferwise/icons';
5
-
6
- import { lorem10, lorem20, lorem40, lorem5 } from '../test-utils';
7
- import { Flag } from '@wise/art';
8
- import { List } from '../listItem';
9
- import Money from '../money';
10
- import Section from '../section';
11
- import Header from '../header';
12
-
13
- export default {
14
- component: Item,
15
- title: 'Content/Item',
16
- } satisfies Meta<ItemProps>;
17
-
18
- type Story = StoryObj<ItemProps>;
19
-
20
- // TODO: delete this story later when we have more peace of the List Item puzzle
21
- export const TempPlayground: Story = {
22
- render: () => {
23
- const [checked, setChecked] = useState(false);
24
-
25
- return (
26
- <div>
27
- <Item
28
- media={
29
- <Item.AvatarView badge={{ type: 'action' }}>
30
- <Flag code="BBD" />
31
- </Item.AvatarView>
32
- }
33
- title="Test title"
34
- subtitle="Test subtitle"
35
- additionalInfo={<Item.AdditionalInfo>{lorem10}</Item.AdditionalInfo>}
36
- />
37
- <Item
38
- media={
39
- <Item.AvatarLayout
40
- avatars={[{ asset: <Flag code="BBD" /> }, { asset: <Flag code="MXN" /> }]}
41
- />
42
- }
43
- title="Test title"
44
- subtitle={lorem10}
45
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
46
- />
47
- <Item
48
- media={
49
- <Item.AvatarLayout
50
- size={72}
51
- orientation="diagonal"
52
- avatars={[{ asset: <Flag code="BBD" /> }, { asset: <Flag code="MXN" /> }]}
53
- />
54
- }
55
- title="Test title"
56
- subtitle={lorem10}
57
- valueTitle="100 GBP"
58
- valueSubtitle="100 USD"
59
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
60
- />
61
- <Item
62
- media={<Item.AvatarView profileType="BUSINESS" notification />}
63
- title="Test title"
64
- subtitle="Test subtitle"
65
- additionalInfo={
66
- <Item.AdditionalInfo
67
- action={{ label: 'Learn more', href: 'https://wise.com', target: '_blank' }}
68
- >
69
- {lorem10}
70
- </Item.AdditionalInfo>
71
- }
72
- prompt={<Item.Prompt type="negative">You have done something wrong</Item.Prompt>}
73
- />
74
- <Item
75
- media={<Item.AvatarView imgSrc="../avatar-square-dude.webp" selected />}
76
- title="Test title"
77
- additionalInfo={<Item.AdditionalInfo>{lorem10}</Item.AdditionalInfo>}
78
- prompt={
79
- <Item.Prompt
80
- type="discount"
81
- action={{
82
- href: 'https://wise.com',
83
- target: '_blank',
84
- 'aria-label': 'clickable prompt',
85
- }}
86
- >
87
- The whole prompt is secretly clickable
88
- </Item.Prompt>
89
- }
90
- />
91
-
92
- <Item
93
- media={<Item.Image src="../apple-pay-logo.svg" />}
94
- title="Accepting Apple Pay"
95
- subtitle={lorem10}
96
- />
97
-
98
- <Item
99
- media={<Item.Image src="../wise-card.svg" />}
100
- title="Wise Business Card"
101
- subtitle={lorem5}
102
- />
103
-
104
- <Item
105
- title="Test title"
106
- disabled
107
- subtitle={lorem10}
108
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
109
- control={<Item.Button priority="secondary-neutral">as Button</Item.Button>}
110
- />
111
- <Item
112
- title="Test title"
113
- disabled
114
- subtitle={lorem10}
115
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
116
- control={
117
- <Item.IconButton>
118
- <Plus />
119
- </Item.IconButton>
120
- }
121
- />
122
-
123
- <Item
124
- title="Test title"
125
- subtitle={lorem10}
126
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
127
- control={
128
- <Item.Button
129
- priority="secondary-neutral"
130
- as="a"
131
- target="dfdf"
132
- aria-label="adsfasfd"
133
- href="wise.com"
134
- >
135
- as Link
136
- </Item.Button>
137
- }
138
- />
139
-
140
- <Item
141
- title="Test title"
142
- subtitle={lorem10}
143
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
144
- control={<Item.Checkbox indeterminate />}
145
- />
146
-
147
- <Item
148
- title="Test title"
149
- subtitle={lorem10}
150
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
151
- control={
152
- <Item.Switch
153
- checked={checked}
154
- onClick={() => {
155
- setChecked(!checked);
156
- }}
157
- />
158
- }
159
- />
160
- </div>
161
- );
162
- },
163
- };
164
-
165
- export const ItemRadio: Story = {
166
- render: () => (
167
- <div>
168
- {/* Basic */}
169
- {/* with additional info */}
170
- {/* with prompt */}
171
- {/* Disabled */}
172
- {/* Spotlight */}
173
- {/* Active */}
174
- </div>
175
- ),
176
- };
177
-
178
- export const ItemButton: Story = {
179
- render: () => (
180
- <div>
181
- {/* Basic */}
182
- {/* with additional info */}
183
- {/* with prompt */}
184
- {/* partially interactive */}
185
- {/* Disabled */}
186
- {/* Spotlight */}
187
- {/* Active */}
188
- </div>
189
- ),
190
- };
191
-
192
- export const ItemNonInteractive: Story = {
193
- render: () => (
194
- <div>
195
- <Section>
196
- <Header title="Transcation Details" />
197
- <List>
198
- <Item
199
- media={
200
- <Item.AvatarView>
201
- <MultiCurrency />
202
- </Item.AvatarView>
203
- }
204
- title="Estimated costs"
205
- subtitle="Other providers"
206
- valueTitle={<Money amount={100} currency="GBP" />}
207
- />
208
- <Item
209
- media={
210
- <Item.AvatarView>
211
- <FastFlag />
212
- </Item.AvatarView>
213
- }
214
- title="Total paid"
215
- subtitle="Wise"
216
- valueTitle={<Money amount={12.15} currency="GBP" />}
217
- valueSubtitle={<Money amount={100.9} currency="GBP" />}
218
- />
219
- <Item
220
- media={
221
- <Item.AvatarView>
222
- <Receipt />
223
- </Item.AvatarView>
224
- }
225
- title="Total fees"
226
- subtitle={lorem5}
227
- valueSubtitle={<Money amount={5.5} currency="GBP" />}
228
- />
229
- <Item
230
- media={
231
- <Item.AvatarView>
232
- <Savings />
233
- </Item.AvatarView>
234
- }
235
- title="You saved"
236
- valueSubtitle={<Money amount={1000} currency="GBP" />}
237
- />
238
- </List>
239
- </Section>
240
-
241
- <Item
242
- as="div"
243
- title="Bank name and address"
244
- subtitle="Bank Ltd, 2 Street Boulevard, Singapore, 1213423"
245
- additionalInfo={
246
- <Item.AdditionalInfo
247
- action={{ label: 'Learn more', href: 'https://wise.com', target: '_blank' }}
248
- >
249
- This is our partner bank in Singapore.
250
- </Item.AdditionalInfo>
251
- }
252
- />
253
- <Item
254
- as="div"
255
- title="Bank name and address"
256
- subtitle="Capital Ltd, 2 Canal Street, London, E14 111"
257
- additionalInfo={
258
- <Item.AdditionalInfo
259
- action={{ label: 'Learn more', href: 'https://wise.com', target: '_blank' }}
260
- />
261
- }
262
- />
263
- {/* Basic */}
264
- {/* with additional info */}
265
- {/* with prompt */}
266
- {/* Disabled */}
267
- {/* Spotlight */}
268
- {/* Active */}
269
- </div>
270
- ),
271
- };
272
-
273
- // add intaces with dark mode