@transferwise/components 0.0.0-experimental-fb28e59 → 0.0.0-experimental-960e3a0

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 (95) 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/i18n/cs.json +9 -9
  6. package/build/i18n/cs.json.js +9 -9
  7. package/build/i18n/cs.json.mjs +9 -9
  8. package/build/index.js +4 -4
  9. package/build/index.mjs +3 -3
  10. package/build/{listItem/ListItem.js → legacylistItem/LegacyListItem.js} +3 -3
  11. package/build/legacylistItem/LegacyListItem.js.map +1 -0
  12. package/build/{listItem/ListItem.mjs → legacylistItem/LegacyListItem.mjs} +3 -3
  13. package/build/legacylistItem/LegacyListItem.mjs.map +1 -0
  14. package/build/legacylistItem/List.js.map +1 -0
  15. package/build/legacylistItem/List.mjs.map +1 -0
  16. package/build/main.css +3 -183
  17. package/build/styles/main.css +3 -183
  18. package/build/styles/switch/Switch.css +3 -0
  19. package/build/types/index.d.ts +2 -4
  20. package/build/types/index.d.ts.map +1 -1
  21. package/build/types/{listItem/ListItem.d.ts → legacylistItem/LegacyListItem.d.ts} +4 -4
  22. package/build/types/legacylistItem/LegacyListItem.d.ts.map +1 -0
  23. package/build/types/legacylistItem/List.d.ts.map +1 -0
  24. package/build/types/legacylistItem/index.d.ts +5 -0
  25. package/build/types/legacylistItem/index.d.ts.map +1 -0
  26. package/build/types/test-utils/fake-data.d.ts +0 -2
  27. package/build/types/test-utils/fake-data.d.ts.map +1 -1
  28. package/package.json +3 -3
  29. package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
  30. package/src/i18n/cs.json +9 -9
  31. package/src/index.ts +2 -4
  32. package/src/{listItem/ListItem.tests.story.tsx → legacylistItem/LegacyListItem.tests.story.tsx} +2 -2
  33. package/src/{listItem/ListItem.tsx → legacylistItem/LegacyListItem.tsx} +3 -3
  34. package/src/legacylistItem/index.ts +4 -0
  35. package/src/main.css +3 -183
  36. package/src/main.less +1 -2
  37. package/src/switch/Switch.css +3 -0
  38. package/src/switch/Switch.less +1 -0
  39. package/src/test-utils/fake-data.ts +0 -5
  40. package/build/listItem/List.js.map +0 -1
  41. package/build/listItem/List.mjs.map +0 -1
  42. package/build/listItem/ListItem.js.map +0 -1
  43. package/build/listItem/ListItem.mjs.map +0 -1
  44. package/build/styles/item/Item.css +0 -183
  45. package/build/test-utils/assets/apple-pay-logo.svg +0 -84
  46. package/build/types/item/Item.d.ts +0 -44
  47. package/build/types/item/Item.d.ts.map +0 -1
  48. package/build/types/item/ItemAdditionalInfo.d.ts +0 -9
  49. package/build/types/item/ItemAdditionalInfo.d.ts.map +0 -1
  50. package/build/types/item/ItemButton.d.ts +0 -7
  51. package/build/types/item/ItemButton.d.ts.map +0 -1
  52. package/build/types/item/ItemCheckbox.d.ts +0 -4
  53. package/build/types/item/ItemCheckbox.d.ts.map +0 -1
  54. package/build/types/item/ItemIconButton.d.ts +0 -4
  55. package/build/types/item/ItemIconButton.d.ts.map +0 -1
  56. package/build/types/item/ItemMedia.d.ts +0 -19
  57. package/build/types/item/ItemMedia.d.ts.map +0 -1
  58. package/build/types/item/ItemNavigation.d.ts +0 -4
  59. package/build/types/item/ItemNavigation.d.ts.map +0 -1
  60. package/build/types/item/ItemSwitch.d.ts +0 -3
  61. package/build/types/item/ItemSwitch.d.ts.map +0 -1
  62. package/build/types/item/index.d.ts +0 -6
  63. package/build/types/item/index.d.ts.map +0 -1
  64. package/build/types/item/prompt/Prompt.d.ts +0 -12
  65. package/build/types/item/prompt/Prompt.d.ts.map +0 -1
  66. package/build/types/listItem/List.d.ts.map +0 -1
  67. package/build/types/listItem/ListItem.d.ts.map +0 -1
  68. package/build/types/listItem/index.d.ts +0 -5
  69. package/build/types/listItem/index.d.ts.map +0 -1
  70. package/src/item/Item.css +0 -183
  71. package/src/item/Item.less +0 -177
  72. package/src/item/Item.story.tsx +0 -175
  73. package/src/item/Item.tsx +0 -177
  74. package/src/item/ItemAdditionalInfo.tsx +0 -31
  75. package/src/item/ItemButton.tsx +0 -25
  76. package/src/item/ItemCheckbox.tsx +0 -19
  77. package/src/item/ItemIconButton.tsx +0 -15
  78. package/src/item/ItemMedia.tsx +0 -52
  79. package/src/item/ItemNavigation.tsx +0 -16
  80. package/src/item/ItemSwitch.tsx +0 -13
  81. package/src/item/index.ts +0 -6
  82. package/src/item/prompt/Prompt.spec.tsx +0 -77
  83. package/src/item/prompt/Prompt.story.tsx +0 -170
  84. package/src/item/prompt/Prompt.tsx +0 -44
  85. package/src/listItem/index.ts +0 -4
  86. package/src/test-utils/assets/apple-pay-logo.svg +0 -84
  87. /package/build/{listItem → legacylistItem}/List.js +0 -0
  88. /package/build/{listItem → legacylistItem}/List.mjs +0 -0
  89. /package/build/styles/{listItem/ListItem.css → legacylistItem/LegacyListItem.css} +0 -0
  90. /package/build/types/{listItem → legacylistItem}/List.d.ts +0 -0
  91. /package/src/{listItem/ListItem.css → legacylistItem/LegacyListItem.css} +0 -0
  92. /package/src/{listItem/ListItem.less → legacylistItem/LegacyListItem.less} +0 -0
  93. /package/src/{listItem/ListItem.spec.tsx → legacylistItem/LegacyListItem.spec.tsx} +0 -0
  94. /package/src/{listItem/ListItem.story.tsx → legacylistItem/LegacyListItem.story.tsx} +0 -0
  95. /package/src/{listItem → legacylistItem}/List.tsx +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"ItemMedia.d.ts","sourceRoot":"","sources":["../../../src/item/ItemMedia.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA6B,eAAe,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAA+B,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAwB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGlE,KAAK,QAAQ,GAAG;IAAE,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAA;CAAE,CAAC;AAElD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,eAAe,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,QAAQ,CAAC;AAE3F,eAAO,MAAM,UAAU,kCAAwC,mBAAmB,gCAQjF,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,IAAI,CAAC,iBAAiB,EAAE,MAAM,GAAG,aAAa,CAAC,GAAG,QAAQ,CAAC;AAE/F,eAAO,MAAM,YAAY,kCAAwC,qBAAqB,gCAQrF,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,QAAQ,GAAG,IAAI,GAAG,KAAK,CAAC,GAChF,QAAQ,GAAG;IACT,GAAG,CAAC,EAAE,MAAM,CAAC;CACd,CAAC;AAEJ;;GAEG;AACH,eAAO,MAAM,KAAK,4BAAuC,cAAc,gCAYtE,CAAC"}
@@ -1,4 +0,0 @@
1
- import { ButtonProps } from '../button/Button.types';
2
- export type ItemNavigationProps = Pick<ButtonProps, 'onClick' | 'href'>;
3
- export declare const Navigation: ({ onClick }: ItemNavigationProps) => import("react").JSX.Element;
4
- //# sourceMappingURL=ItemNavigation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ItemNavigation.d.ts","sourceRoot":"","sources":["../../../src/item/ItemNavigation.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAIrD,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC,CAAC;AAExE,eAAO,MAAM,UAAU,gBAAoC,mBAAmB,gCAQ7E,CAAC"}
@@ -1,3 +0,0 @@
1
- import { SwitchProps } from '../switch';
2
- export declare const Switch: (props: SwitchProps) => import("react").JSX.Element;
3
- //# sourceMappingURL=ItemSwitch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ItemSwitch.d.ts","sourceRoot":"","sources":["../../../src/item/ItemSwitch.tsx"],"names":[],"mappings":"AACA,OAAO,EAAyB,WAAW,EAAE,MAAM,WAAW,CAAC;AAG/D,eAAO,MAAM,MAAM,UAAoB,WAAW,gCAQjD,CAAC"}
@@ -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,12 +0,0 @@
1
- import { Sentiment } from '../../common';
2
- import { LinkProps } from '../../link';
3
- export type ItemPromptProps = {
4
- type: `${Sentiment.POSITIVE | Sentiment.NEGATIVE | Sentiment.NEUTRAL | Sentiment.WARNING}` | 'discount' | 'savings';
5
- children: React.ReactNode;
6
- action?: Pick<LinkProps, 'href' | 'target' | 'onClick'> & {
7
- 'aria-label'?: string;
8
- };
9
- };
10
- export declare const ItemPrompt: ({ type, children, action }: ItemPromptProps) => import("react").JSX.Element;
11
- export default ItemPrompt;
12
- //# sourceMappingURL=Prompt.d.ts.map
@@ -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 +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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ListItem.d.ts","sourceRoot":"","sources":["../../../src/listItem/ListItem.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAInD,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,EAAE,SAAS,CAAC;IACjB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,EAAE,CAAC,EAAE,WAAW,CAAC;CAClB,CAAC;AAEF,QAAA,MAAM,QAAQ,EAAE,EAAE,CAAC,aAAa,CAmC/B,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -1,5 +0,0 @@
1
- export { List } from './List';
2
- export type { ListProps } from './List';
3
- export { default } from './ListItem';
4
- export type { ListItemProps } from './ListItem';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/listItem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,YAAY,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
package/src/item/Item.css DELETED
@@ -1,183 +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
- cursor: pointer;
11
- }
12
- .np-item:hover {
13
- background-color: var(--color-background-screen-hover);
14
- }
15
- .np-item:active {
16
- background-color: var(--color-background-screen-active);
17
- }
18
- .np-item-media-image {
19
- width: var(--item-media-image-size);
20
- height: var(--item-media-image-size);
21
- }
22
- .np-item-title {
23
- color: #37517e;
24
- color: var(--color-content-primary);
25
- }
26
- .np-item-additional-info {
27
- color: #768e9c;
28
- color: var(--color-content-tertiary);
29
- }
30
- .np-item-value {
31
- flex: 0 0 auto;
32
- }
33
- .np-item-control {
34
- flex: 0 0 auto;
35
- }
36
- .np-item-spotlight-active {
37
- background-color: rgba(134,167,189,0.10196);
38
- background-color: var(--color-background-neutral);
39
- }
40
- .np-item-spotlight-active:hover {
41
- background-color: var(--color-background-neutral-hover);
42
- }
43
- .np-item-spotlight-active:active {
44
- background-color: var(--color-background-neutral-active);
45
- }
46
- .np-item-spotlight-inactive {
47
- background-color: rgba(134, 167, 189, 0.025);
48
- border: 1px dashed rgba(0,0,0,0.10196);
49
- border: 1px dashed var(--color-border-neutral);
50
- }
51
- @supports (color: color-mix(in lch, red, blue)) {
52
- .np-item-spotlight-inactive {
53
- background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
54
- }
55
- }
56
- .np-item-spotlight-inactive:hover {
57
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
58
- }
59
- .np-item-spotlight-inactive:active {
60
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
61
- }
62
- .np-item-prompt {
63
- display: inline-flex;
64
- padding-top: calc(8px / 2);
65
- padding-top: calc(var(--padding-x-small) / 2);
66
- padding-bottom: calc(8px / 2);
67
- padding-bottom: calc(var(--padding-x-small) / 2);
68
- padding-left: calc(8px - 1px);
69
- padding-left: calc(var(--padding-x-small) - 1px);
70
- padding-right: 8px;
71
- padding-right: var(--padding-x-small);
72
- border-radius: 10px;
73
- border-radius: var(--radius-small);
74
- word-break: break-word;
75
- word-wrap: break-word;
76
- }
77
- .np-item-prompt .np-prompt-icon {
78
- padding-right: calc(12px / 2);
79
- padding-right: calc(var(--size-12) / 2);
80
- padding-top: calc(4px - 1px);
81
- padding-top: calc(var(--size-4) - 1px);
82
- padding-bottom: calc(4px - 1px);
83
- padding-bottom: calc(var(--size-4) - 1px);
84
- }
85
- .np-item-prompt .np-prompt-icon .tw-icon-tags,
86
- .np-item-prompt .np-prompt-icon .tw-icon-confetti {
87
- color: var(--color-sentiment-positive-primary);
88
- }
89
- .np-item-prompt a {
90
- text-underline-offset: calc(4px / 2);
91
- text-underline-offset: calc(var(--size-4) / 2);
92
- }
93
- .np-item-prompt.np-prompt-interactive {
94
- -webkit-text-decoration: none;
95
- text-decoration: none;
96
- cursor: pointer;
97
- border: none;
98
- }
99
- .np-item-prompt.negative {
100
- background-color: var(--color-sentiment-negative-secondary);
101
- color: var(--color-sentiment-negative-primary);
102
- }
103
- .np-item-prompt.negative a {
104
- color: var(--color-sentiment-negative-primary);
105
- }
106
- .np-item-prompt.negative a:hover {
107
- color: var(--color-sentiment-negative-primary-hover);
108
- }
109
- .np-item-prompt.negative a:active {
110
- color: var(--color-sentiment-negative-primary-active);
111
- }
112
- .np-prompt-interactive.np-item-prompt.negative:hover {
113
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 95%, var(--color-sentiment-negative-primary));
114
- }
115
- .np-prompt-interactive.np-item-prompt.negative:active {
116
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 90%, var(--color-sentiment-negative-primary));
117
- }
118
- .np-item-prompt.positive,
119
- .np-item-prompt.discount,
120
- .np-item-prompt.savings {
121
- background-color: var(--color-sentiment-positive-secondary);
122
- color: var(--color-sentiment-positive-primary);
123
- }
124
- .np-item-prompt.positive a,
125
- .np-item-prompt.discount a,
126
- .np-item-prompt.savings a {
127
- color: var(--color-sentiment-positive-primary);
128
- }
129
- .np-item-prompt.positive a:hover,
130
- .np-item-prompt.discount a:hover,
131
- .np-item-prompt.savings a:hover {
132
- color: var(--color-sentiment-positive-primary-hover);
133
- }
134
- .np-item-prompt.positive a:active,
135
- .np-item-prompt.discount a:active,
136
- .np-item-prompt.savings a:active {
137
- color: var(--color-sentiment-positive-primary-active);
138
- }
139
- .np-prompt-interactive.np-item-prompt.positive:hover,
140
- .np-prompt-interactive.np-item-prompt.discount:hover,
141
- .np-prompt-interactive.np-item-prompt.savings:hover {
142
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 95%, var(--color-sentiment-positive-primary));
143
- }
144
- .np-prompt-interactive.np-item-prompt.positive:active,
145
- .np-prompt-interactive.np-item-prompt.discount:active,
146
- .np-prompt-interactive.np-item-prompt.savings:active {
147
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 90%, var(--color-sentiment-positive-primary));
148
- }
149
- .np-item-prompt.neutral {
150
- background-color: rgba(134,167,189,0.10196);
151
- background-color: var(--color-background-neutral);
152
- color: #37517e;
153
- color: var(--color-content-primary);
154
- }
155
- .np-item-prompt.neutral a {
156
- color: #37517e;
157
- color: var(--color-content-primary);
158
- }
159
- .np-prompt-interactive.np-item-prompt.neutral:hover {
160
- background-color: var(--color-background-neutral-hover);
161
- }
162
- .np-prompt-interactive.np-item-prompt.neutral:active {
163
- background-color: var(--color-background-neutral-active);
164
- }
165
- .np-item-prompt.warning {
166
- background-color: var(--color-sentiment-warning-secondary);
167
- color: var(--color-sentiment-warning-content);
168
- }
169
- .np-item-prompt.warning a {
170
- color: var(--color-sentiment-warning-content);
171
- }
172
- .np-item-prompt.warning a:hover {
173
- color: var(--color-sentiment-warning-content-hover);
174
- }
175
- .np-item-prompt.warning a:active {
176
- color: var(--color-sentiment-warning-content-active);
177
- }
178
- .np-prompt-interactive.np-item-prompt.warning:hover {
179
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 90%, var(--color-sentiment-warning-primary));
180
- }
181
- .np-prompt-interactive.np-item-prompt.warning:active {
182
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 80%, var(--color-sentiment-warning-primary));
183
- }
@@ -1,177 +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
- cursor: pointer;
7
-
8
- &:hover {
9
- background-color: var(--color-background-screen-hover);
10
- }
11
-
12
- &:active {
13
- background-color: var(--color-background-screen-active);
14
- }
15
-
16
- &-media {
17
-
18
- &-image {
19
- width: var(--item-media-image-size);
20
- height: var(--item-media-image-size);
21
- }
22
- }
23
-
24
- &-title {
25
- color: var(--color-content-primary);
26
- }
27
-
28
- &-additional-info {
29
- color: var(--color-content-tertiary);
30
- }
31
-
32
- &-value {
33
- flex: 0 0 auto;
34
- }
35
-
36
- &-control {
37
- flex: 0 0 auto;
38
- }
39
-
40
- &-spotlight {
41
- &-active {
42
- background-color: var(--color-background-neutral);
43
-
44
- &:hover {
45
- background-color: var(--color-background-neutral-hover);
46
- }
47
- &:active {
48
- background-color: var(--color-background-neutral-active);
49
- }
50
- }
51
-
52
- &-inactive {
53
- background-color: color-mix(in srgb, var(--color-background-neutral) 25%, transparent);
54
- border: 1px dashed var(--color-border-neutral);
55
-
56
- &:hover {
57
- background-color: color-mix(in srgb, var(--color-background-neutral-hover) 25%, transparent);
58
- }
59
- &:active {
60
- background-color: color-mix(in srgb, var(--color-background-neutral-active) 25%, transparent);
61
- }
62
- }
63
- }
64
-
65
- &-prompt {
66
- display: inline-flex;
67
- padding-top: calc(var(--padding-x-small) / 2);
68
- padding-bottom: calc(var(--padding-x-small) / 2);
69
- padding-left: calc(var(--padding-x-small) - 1px);
70
- padding-right: var(--padding-x-small);
71
- border-radius: var(--radius-small);
72
- word-break: break-word;
73
- overflow-wrap: break-word;
74
-
75
- .np-prompt-icon {
76
- padding-right: calc(var(--size-12) / 2);
77
- padding-top: calc(var(--size-4) - 1px);
78
- padding-bottom: calc(var(--size-4) - 1px);
79
-
80
- .tw-icon-tags,
81
- .tw-icon-confetti {
82
- color: var(--color-sentiment-positive-primary);
83
- }
84
- }
85
-
86
- a {
87
- text-underline-offset: calc(var(--size-4) / 2);
88
- }
89
-
90
- &.np-prompt-interactive {
91
- text-decoration: none;
92
- cursor: pointer;
93
- border: none;
94
- }
95
-
96
- &.negative {
97
- background-color: var(--color-sentiment-negative-secondary);
98
- color: var(--color-sentiment-negative-primary);
99
- a {
100
- color: var(--color-sentiment-negative-primary);
101
- &:hover {
102
- color: var(--color-sentiment-negative-primary-hover);
103
- }
104
- &:active {
105
- color: var(--color-sentiment-negative-primary-active);
106
- }
107
- }
108
- .np-prompt-interactive& {
109
- &:hover {
110
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 95%, var(--color-sentiment-negative-primary));
111
- }
112
- &:active {
113
- background-color: color-mix(in srgb, var(--color-sentiment-negative-secondary) 90%, var(--color-sentiment-negative-primary));
114
- }
115
- }
116
- }
117
- &.positive,
118
- &.discount,
119
- &.savings {
120
- background-color: var(--color-sentiment-positive-secondary);
121
- color: var(--color-sentiment-positive-primary);
122
- a {
123
- color: var(--color-sentiment-positive-primary);
124
- &:hover {
125
- color: var(--color-sentiment-positive-primary-hover);
126
- }
127
- &:active {
128
- color: var(--color-sentiment-positive-primary-active);
129
- }
130
- }
131
- .np-prompt-interactive& {
132
- &:hover {
133
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 95%, var(--color-sentiment-positive-primary));
134
- }
135
- &:active {
136
- background-color: color-mix(in srgb, var(--color-sentiment-positive-secondary) 90%, var(--color-sentiment-positive-primary));
137
- }
138
- }
139
- }
140
- &.neutral {
141
- background-color: var(--color-background-neutral);
142
- color: var(--color-content-primary);
143
- a {
144
- color: var(--color-content-primary);
145
- }
146
- .np-prompt-interactive& {
147
- &:hover {
148
- background-color: var(--color-background-neutral-hover);
149
- }
150
- &:active {
151
- background-color: var(--color-background-neutral-active);
152
- }
153
- }
154
- }
155
- &.warning {
156
- background-color: var(--color-sentiment-warning-secondary);
157
- color: var(--color-sentiment-warning-content);
158
- a {
159
- color: var(--color-sentiment-warning-content);
160
- &:hover {
161
- color: var(--color-sentiment-warning-content-hover);
162
- }
163
- &:active {
164
- color: var(--color-sentiment-warning-content-active);
165
- }
166
- }
167
- .np-prompt-interactive& {
168
- &:hover {
169
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 90%, var(--color-sentiment-warning-primary));
170
- }
171
- &:active {
172
- background-color: color-mix(in srgb, var(--color-sentiment-warning-secondary) 80%, var(--color-sentiment-warning-primary));
173
- }
174
- }
175
- }
176
- }
177
- }
@@ -1,175 +0,0 @@
1
- import Item, { Props as ItemProps } from './Item';
2
- import { Meta, StoryObj } from '@storybook/react';
3
- import React, { useState } from 'react';
4
-
5
- import { lorem10, lorem20, lorem40, lorem5 } from '../test-utils';
6
- import { Flag } from '@wise/art';
7
-
8
- export default {
9
- component: Item,
10
- title: 'Content/Item',
11
- } satisfies Meta<ItemProps>;
12
-
13
- type Story = StoryObj<ItemProps>;
14
-
15
- // TODO: delete this story later when we have more peace of the List Item puzzle
16
- export const TempPlayground: Story = {
17
- render: () => {
18
- const [checked, setChecked] = useState(false);
19
-
20
- return (
21
- <div>
22
- <Item
23
- media={
24
- <Item.AvatarView badge={{ type: 'action' }}>
25
- <Flag code="BBD" />
26
- </Item.AvatarView>
27
- }
28
- title="Test title"
29
- subtitle="Test subtitle"
30
- additionalInfo={<Item.AdditionalInfo>{lorem10}</Item.AdditionalInfo>}
31
- />
32
- <Item
33
- media={
34
- <Item.AvatarLayout
35
- avatars={[{ asset: <Flag code="BBD" /> }, { asset: <Flag code="MXN" /> }]}
36
- />
37
- }
38
- title="Test title"
39
- subtitle={lorem10}
40
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
41
- />
42
- <Item
43
- media={
44
- <Item.AvatarLayout
45
- size={72}
46
- orientation="diagonal"
47
- avatars={[{ asset: <Flag code="BBD" /> }, { asset: <Flag code="MXN" /> }]}
48
- />
49
- }
50
- title="Test title"
51
- subtitle={lorem10}
52
- valueTitle="100 GBP"
53
- valueSubtitle="100 USD"
54
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
55
- />
56
- <Item
57
- media={<Item.AvatarView profileType="BUSINESS" notification />}
58
- title="Test title"
59
- subtitle="Test subtitle"
60
- additionalInfo={
61
- <Item.AdditionalInfo
62
- action={{ label: 'Learn more', href: 'https://wise.com', target: '_blank' }}
63
- >
64
- {lorem10}
65
- </Item.AdditionalInfo>
66
- }
67
- prompt={<Item.Prompt type="negative">You have done something wrong</Item.Prompt>}
68
- />
69
- <Item
70
- media={<Item.AvatarView imgSrc="../avatar-square-dude.webp" selected />}
71
- title="Test title"
72
- additionalInfo={<Item.AdditionalInfo>{lorem10}</Item.AdditionalInfo>}
73
- prompt={
74
- <Item.Prompt
75
- type="discount"
76
- action={{
77
- href: 'https://wise.com',
78
- target: '_blank',
79
- 'aria-label': 'clickable prompt',
80
- }}
81
- >
82
- The whole prompt is secretly clickable
83
- </Item.Prompt>
84
- }
85
- />
86
-
87
- <Item
88
- media={<Item.Image src="../apple-pay-logo.svg" />}
89
- title="Accepting Apple Pay"
90
- subtitle={lorem10}
91
- />
92
-
93
- <Item
94
- media={<Item.Image src="../wise-card.svg" />}
95
- title="Wise Business Card"
96
- subtitle={lorem5}
97
- />
98
-
99
- <Item
100
- title="Test title"
101
- subtitle={lorem10}
102
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
103
- control={<Item.Button priority="secondary-neutral">as Button</Item.Button>}
104
- />
105
-
106
- <Item
107
- title="Test title"
108
- subtitle={lorem10}
109
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
110
- control={
111
- <Item.Button
112
- priority="secondary-neutral"
113
- as="a"
114
- target="dfdf"
115
- aria-label="adsfasfd"
116
- href="wise.com"
117
- >
118
- as Link
119
- </Item.Button>
120
- }
121
- />
122
-
123
- <Item
124
- title="Test title"
125
- subtitle={lorem10}
126
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
127
- control={<Item.Checkbox indeterminate />}
128
- />
129
-
130
- <Item
131
- title="Test title"
132
- subtitle={lorem10}
133
- additionalInfo={<Item.AdditionalInfo>{lorem20}</Item.AdditionalInfo>}
134
- control={
135
- <Item.Switch
136
- checked={checked}
137
- onClick={() => {
138
- setChecked(!checked);
139
- }}
140
- />
141
- }
142
- />
143
- </div>
144
- );
145
- },
146
- };
147
-
148
- export const ItemRadio: Story = {
149
- render: () => (
150
- <div>
151
- {/* Basic */}
152
- {/* with additional info */}
153
- {/* with prompt */}
154
- {/* Disabled */}
155
- {/* Spotlight */}
156
- {/* Active */}
157
- </div>
158
- ),
159
- };
160
-
161
- export const ItemButton: Story = {
162
- render: () => (
163
- <div>
164
- {/* Basic */}
165
- {/* with additional info */}
166
- {/* with prompt */}
167
- {/* partially interactive */}
168
- {/* Disabled */}
169
- {/* Spotlight */}
170
- {/* Active */}
171
- </div>
172
- ),
173
- };
174
-
175
- // add intaces with dark mode