@transferwise/components 0.0.0-experimental-305fdc6 → 0.0.0-experimental-1605d4e
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/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs +1 -1
- package/build/flowNavigation/animatedLabel/AnimatedLabel.mjs.map +1 -1
- package/build/index.js +4 -4
- package/build/index.mjs +3 -3
- package/build/listItem/List.js.map +1 -0
- package/build/listItem/List.mjs.map +1 -0
- package/build/{legacylistItem/LegacyListItem.js → listItem/ListItem.js} +3 -3
- package/build/listItem/ListItem.js.map +1 -0
- package/build/{legacylistItem/LegacyListItem.mjs → listItem/ListItem.mjs} +3 -3
- package/build/listItem/ListItem.mjs.map +1 -0
- package/build/main.css +183 -3
- package/build/styles/item/Item.css +183 -0
- package/build/styles/main.css +183 -3
- package/build/styles/switch/Switch.css +0 -3
- package/build/test-utils/assets/apple-pay-logo.svg +84 -0
- package/build/types/index.d.ts +4 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/item/Item.d.ts +44 -0
- package/build/types/item/Item.d.ts.map +1 -0
- package/build/types/item/ItemAdditionalInfo.d.ts +9 -0
- package/build/types/item/ItemAdditionalInfo.d.ts.map +1 -0
- package/build/types/item/ItemButton.d.ts +7 -0
- package/build/types/item/ItemButton.d.ts.map +1 -0
- package/build/types/item/ItemCheckbox.d.ts +4 -0
- package/build/types/item/ItemCheckbox.d.ts.map +1 -0
- package/build/types/item/ItemIconButton.d.ts +4 -0
- package/build/types/item/ItemIconButton.d.ts.map +1 -0
- package/build/types/item/ItemMedia.d.ts +19 -0
- package/build/types/item/ItemMedia.d.ts.map +1 -0
- package/build/types/item/ItemNavigation.d.ts +4 -0
- package/build/types/item/ItemNavigation.d.ts.map +1 -0
- package/build/types/item/ItemSwitch.d.ts +3 -0
- package/build/types/item/ItemSwitch.d.ts.map +1 -0
- package/build/types/item/index.d.ts +6 -0
- package/build/types/item/index.d.ts.map +1 -0
- package/build/types/item/prompt/Prompt.d.ts +12 -0
- package/build/types/item/prompt/Prompt.d.ts.map +1 -0
- package/build/types/listItem/List.d.ts.map +1 -0
- package/build/types/{legacylistItem/LegacyListItem.d.ts → listItem/ListItem.d.ts} +4 -4
- package/build/types/listItem/ListItem.d.ts.map +1 -0
- package/build/types/listItem/index.d.ts +5 -0
- package/build/types/listItem/index.d.ts.map +1 -0
- package/build/types/test-utils/fake-data.d.ts +2 -0
- package/build/types/test-utils/fake-data.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/flowNavigation/animatedLabel/AnimatedLabel.tsx +1 -1
- package/src/index.ts +4 -2
- package/src/item/Item.css +183 -0
- package/src/item/Item.less +177 -0
- package/src/item/Item.story.tsx +175 -0
- package/src/item/Item.tsx +177 -0
- package/src/item/ItemAdditionalInfo.tsx +31 -0
- package/src/item/ItemButton.tsx +25 -0
- package/src/item/ItemCheckbox.tsx +16 -0
- package/src/item/ItemIconButton.tsx +15 -0
- package/src/item/ItemMedia.tsx +52 -0
- package/src/item/ItemNavigation.tsx +16 -0
- package/src/item/ItemSwitch.tsx +13 -0
- package/src/item/index.ts +6 -0
- package/src/item/prompt/Prompt.spec.tsx +77 -0
- package/src/item/prompt/Prompt.story.tsx +170 -0
- package/src/item/prompt/Prompt.tsx +44 -0
- package/src/{legacylistItem/LegacyListItem.tests.story.tsx → listItem/ListItem.tests.story.tsx} +2 -2
- package/src/{legacylistItem/LegacyListItem.tsx → listItem/ListItem.tsx} +3 -3
- package/src/listItem/index.ts +4 -0
- package/src/main.css +183 -3
- package/src/main.less +2 -1
- package/src/switch/Switch.css +0 -3
- package/src/switch/Switch.less +0 -1
- package/src/test-utils/assets/apple-pay-logo.svg +84 -0
- package/src/test-utils/fake-data.ts +5 -0
- package/build/legacylistItem/LegacyListItem.js.map +0 -1
- package/build/legacylistItem/LegacyListItem.mjs.map +0 -1
- package/build/legacylistItem/List.js.map +0 -1
- package/build/legacylistItem/List.mjs.map +0 -1
- package/build/types/legacylistItem/LegacyListItem.d.ts.map +0 -1
- package/build/types/legacylistItem/List.d.ts.map +0 -1
- package/build/types/legacylistItem/index.d.ts +0 -5
- package/build/types/legacylistItem/index.d.ts.map +0 -1
- package/src/legacylistItem/index.ts +0 -4
- /package/build/{legacylistItem → listItem}/List.js +0 -0
- /package/build/{legacylistItem → listItem}/List.mjs +0 -0
- /package/build/styles/{legacylistItem/LegacyListItem.css → listItem/ListItem.css} +0 -0
- /package/build/types/{legacylistItem → listItem}/List.d.ts +0 -0
- /package/src/{legacylistItem → listItem}/List.tsx +0 -0
- /package/src/{legacylistItem/LegacyListItem.css → listItem/ListItem.css} +0 -0
- /package/src/{legacylistItem/LegacyListItem.less → listItem/ListItem.less} +0 -0
- /package/src/{legacylistItem/LegacyListItem.spec.tsx → listItem/ListItem.spec.tsx} +0 -0
- /package/src/{legacylistItem/LegacyListItem.story.tsx → listItem/ListItem.story.tsx} +0 -0
|
@@ -6,7 +6,7 @@ import BottomSheet from '../../common/bottomSheet';
|
|
|
6
6
|
import Option from '../../common/Option';
|
|
7
7
|
import { Check, ChevronDown } from '@transferwise/icons';
|
|
8
8
|
import { OverlayIdContext, OverlayIdProvider } from '../../provider/overlay/OverlayIdProvider';
|
|
9
|
-
import { List } from '../../
|
|
9
|
+
import { List } from '../../listItem';
|
|
10
10
|
|
|
11
11
|
export interface AnimatedLabelProps {
|
|
12
12
|
activeLabel: number;
|
package/src/index.ts
CHANGED
|
@@ -51,7 +51,7 @@ export type {
|
|
|
51
51
|
export type { TextAreaProps } from './inputs/TextArea';
|
|
52
52
|
export type { InstructionsListProps } from './instructionsList';
|
|
53
53
|
export type { LabelProps, LabelOptionalProps, LabelDescriptionProps } from './label/Label';
|
|
54
|
-
export type { ListProps,
|
|
54
|
+
export type { ListProps, ListItemProps } from './listItem';
|
|
55
55
|
export type { LoaderProps } from './loader';
|
|
56
56
|
export type { MarkdownProps } from './markdown';
|
|
57
57
|
export type { ModalProps } from './modal';
|
|
@@ -109,6 +109,7 @@ export type {
|
|
|
109
109
|
TableCellStatus,
|
|
110
110
|
TableCellType,
|
|
111
111
|
} from './table';
|
|
112
|
+
export type { ItemProps, ItemAdditionalInfoProps, ItemCheckboxProps } from './item';
|
|
112
113
|
|
|
113
114
|
/**
|
|
114
115
|
* Components
|
|
@@ -167,7 +168,7 @@ export { TextArea } from './inputs/TextArea';
|
|
|
167
168
|
export { default as InstructionsList } from './instructionsList';
|
|
168
169
|
export { Label } from './label/Label';
|
|
169
170
|
export { default as Link } from './link';
|
|
170
|
-
export { List, default as ListItem
|
|
171
|
+
export { List, default as ListItem } from './listItem';
|
|
171
172
|
export { default as Loader } from './loader';
|
|
172
173
|
export { default as Logo } from './logo';
|
|
173
174
|
export { default as Markdown } from './markdown';
|
|
@@ -211,6 +212,7 @@ export { default as Typeahead } from './typeahead';
|
|
|
211
212
|
export { default as Upload } from './upload';
|
|
212
213
|
export { default as UploadInput } from './uploadInput';
|
|
213
214
|
export { default as Table } from './table';
|
|
215
|
+
export { default as Item } from './table';
|
|
214
216
|
|
|
215
217
|
/**
|
|
216
218
|
* Hooks
|
|
@@ -0,0 +1,183 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,177 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
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
|