@transferwise/components 0.0.0-experimental-35e180c → 0.0.0-experimental-6fd476f

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/main.css CHANGED
@@ -2626,6 +2626,65 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2626
2626
  border-radius: 9999px !important;
2627
2627
  border-radius: var(--radius-full) !important;
2628
2628
  }
2629
+ .item {
2630
+ padding: 16px;
2631
+ border-radius: 16px;
2632
+ border-radius: var(--radius-medium);
2633
+ background-color: #ffffff;
2634
+ background-color: var(--color-background-screen);
2635
+ display: flex;
2636
+ gap: 16px;
2637
+ align-items: center;
2638
+ flex-direction: row;
2639
+ }
2640
+ .item:disabled {
2641
+ opacity: 0.45;
2642
+ mix-blend-mode: luminosity;
2643
+ }
2644
+ .item:hover {
2645
+ background-color: var(--color-background-screen-hover);
2646
+ }
2647
+ .item:active {
2648
+ background-color: var(--color-background-screen-active);
2649
+ }
2650
+ .item-media {
2651
+ flex: 0 0 auto;
2652
+ align-items: flex-start;
2653
+ }
2654
+ .startValue {
2655
+ flex: 1;
2656
+ }
2657
+ .endValue {
2658
+ flex: 1;
2659
+ text-align: end;
2660
+ }
2661
+ .endValue.positive {
2662
+ color: var(--color-sentiment-positive) !important;
2663
+ }
2664
+ .endValue.negative {
2665
+ color: var(--color-sentiment-negative) !important;
2666
+ }
2667
+ .endValue.positive .item-title {
2668
+ color: var(--color-sentiment-positive) !important;
2669
+ }
2670
+ .endValue.negative .item-title {
2671
+ color: var(--color-sentiment-negative) !important;
2672
+ }
2673
+ .endValue.strikethrough {
2674
+ -webkit-text-decoration: line-through;
2675
+ text-decoration: line-through;
2676
+ }
2677
+ .item-title {
2678
+ color: #37517e;
2679
+ color: var(--color-content-primary);
2680
+ }
2681
+ .item-additionalInfo {
2682
+ color: #768e9c;
2683
+ color: var(--color-content-tertiary);
2684
+ }
2685
+ .item-action {
2686
+ flex: 0 0 auto;
2687
+ }
2629
2688
  .np-field-control {
2630
2689
  margin-top: 4px;
2631
2690
  margin-top: var(--size-4);
@@ -0,0 +1,59 @@
1
+ .item {
2
+ padding: 16px;
3
+ border-radius: 16px;
4
+ border-radius: var(--radius-medium);
5
+ background-color: #ffffff;
6
+ background-color: var(--color-background-screen);
7
+ display: flex;
8
+ gap: 16px;
9
+ align-items: center;
10
+ flex-direction: row;
11
+ }
12
+ .item:disabled {
13
+ opacity: 0.45;
14
+ mix-blend-mode: luminosity;
15
+ }
16
+ .item:hover {
17
+ background-color: var(--color-background-screen-hover);
18
+ }
19
+ .item:active {
20
+ background-color: var(--color-background-screen-active);
21
+ }
22
+ .item-media {
23
+ flex: 0 0 auto;
24
+ align-items: flex-start;
25
+ }
26
+ .startValue {
27
+ flex: 1;
28
+ }
29
+ .endValue {
30
+ flex: 1;
31
+ text-align: end;
32
+ }
33
+ .endValue.positive {
34
+ color: var(--color-sentiment-positive) !important;
35
+ }
36
+ .endValue.negative {
37
+ color: var(--color-sentiment-negative) !important;
38
+ }
39
+ .endValue.positive .item-title {
40
+ color: var(--color-sentiment-positive) !important;
41
+ }
42
+ .endValue.negative .item-title {
43
+ color: var(--color-sentiment-negative) !important;
44
+ }
45
+ .endValue.strikethrough {
46
+ -webkit-text-decoration: line-through;
47
+ text-decoration: line-through;
48
+ }
49
+ .item-title {
50
+ color: #37517e;
51
+ color: var(--color-content-primary);
52
+ }
53
+ .item-additionalInfo {
54
+ color: #768e9c;
55
+ color: var(--color-content-tertiary);
56
+ }
57
+ .item-action {
58
+ flex: 0 0 auto;
59
+ }
@@ -2626,6 +2626,65 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2626
2626
  border-radius: 9999px !important;
2627
2627
  border-radius: var(--radius-full) !important;
2628
2628
  }
2629
+ .item {
2630
+ padding: 16px;
2631
+ border-radius: 16px;
2632
+ border-radius: var(--radius-medium);
2633
+ background-color: #ffffff;
2634
+ background-color: var(--color-background-screen);
2635
+ display: flex;
2636
+ gap: 16px;
2637
+ align-items: center;
2638
+ flex-direction: row;
2639
+ }
2640
+ .item:disabled {
2641
+ opacity: 0.45;
2642
+ mix-blend-mode: luminosity;
2643
+ }
2644
+ .item:hover {
2645
+ background-color: var(--color-background-screen-hover);
2646
+ }
2647
+ .item:active {
2648
+ background-color: var(--color-background-screen-active);
2649
+ }
2650
+ .item-media {
2651
+ flex: 0 0 auto;
2652
+ align-items: flex-start;
2653
+ }
2654
+ .startValue {
2655
+ flex: 1;
2656
+ }
2657
+ .endValue {
2658
+ flex: 1;
2659
+ text-align: end;
2660
+ }
2661
+ .endValue.positive {
2662
+ color: var(--color-sentiment-positive) !important;
2663
+ }
2664
+ .endValue.negative {
2665
+ color: var(--color-sentiment-negative) !important;
2666
+ }
2667
+ .endValue.positive .item-title {
2668
+ color: var(--color-sentiment-positive) !important;
2669
+ }
2670
+ .endValue.negative .item-title {
2671
+ color: var(--color-sentiment-negative) !important;
2672
+ }
2673
+ .endValue.strikethrough {
2674
+ -webkit-text-decoration: line-through;
2675
+ text-decoration: line-through;
2676
+ }
2677
+ .item-title {
2678
+ color: #37517e;
2679
+ color: var(--color-content-primary);
2680
+ }
2681
+ .item-additionalInfo {
2682
+ color: #768e9c;
2683
+ color: var(--color-content-tertiary);
2684
+ }
2685
+ .item-action {
2686
+ flex: 0 0 auto;
2687
+ }
2629
2688
  .np-field-control {
2630
2689
  margin-top: 4px;
2631
2690
  margin-top: var(--size-4);
@@ -0,0 +1,3 @@
1
+ import { ItemProps } from './Item.types';
2
+ export declare const Item: ({ type, title, subtitle, additionalInfo, inverted, media, endValue, }: ItemProps) => import("react").JSX.Element;
3
+ //# sourceMappingURL=Item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Item.d.ts","sourceRoot":"","sources":["../../../src/item/Item.tsx"],"names":[],"mappings":"AAQA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzC,eAAO,MAAM,IAAI,0EAQd,SAAS,gCAmEX,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { ReactNode } from 'react';
2
+ import { Sentiment } from '../common';
3
+ export type ItemTypes = 'NonInteractive' | 'Navigation' | 'Radio' | 'Checkbox' | 'Switch' | 'Button' | 'IconButton';
4
+ export type EndValueProps = {
5
+ title?: string;
6
+ subtitle?: string;
7
+ inverted?: boolean;
8
+ sentiment?: Sentiment.POSITIVE | Sentiment.NEGATIVE;
9
+ strikethrough?: boolean;
10
+ bold?: boolean;
11
+ };
12
+ export interface ItemProps {
13
+ type: ItemTypes;
14
+ media?: {
15
+ value: ReactNode;
16
+ };
17
+ title: string;
18
+ subtitle?: string;
19
+ additionalInfo?: string;
20
+ inverted?: boolean;
21
+ endValue?: EndValueProps;
22
+ }
23
+ //# sourceMappingURL=Item.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Item.types.d.ts","sourceRoot":"","sources":["../../../src/item/Item.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,MAAM,SAAS,GACjB,gBAAgB,GAChB,YAAY,GACZ,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,YAAY,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,QAAQ,CAAC;IACpD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,SAAS,CAAC;IAEhB,KAAK,CAAC,EAAE;QAEN,KAAK,EAAE,SAAS,CAAC;KAClB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAI1B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-35e180c",
3
+ "version": "0.0.0-experimental-6fd476f",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -91,9 +91,9 @@
91
91
  "rollup": "^4.18.1",
92
92
  "rollup-preserve-directives": "^1.1.1",
93
93
  "storybook": "^8.2.2",
94
- "@transferwise/less-config": "3.1.0",
95
94
  "@transferwise/neptune-css": "14.22.0",
96
- "@wise/components-theming": "1.6.1"
95
+ "@wise/components-theming": "1.6.1",
96
+ "@transferwise/less-config": "3.1.0"
97
97
  },
98
98
  "peerDependencies": {
99
99
  "@transferwise/icons": "^3.13.1",
@@ -0,0 +1,59 @@
1
+ .item {
2
+ padding: 16px;
3
+ border-radius: 16px;
4
+ border-radius: var(--radius-medium);
5
+ background-color: #ffffff;
6
+ background-color: var(--color-background-screen);
7
+ display: flex;
8
+ gap: 16px;
9
+ align-items: center;
10
+ flex-direction: row;
11
+ }
12
+ .item:disabled {
13
+ opacity: 0.45;
14
+ mix-blend-mode: luminosity;
15
+ }
16
+ .item:hover {
17
+ background-color: var(--color-background-screen-hover);
18
+ }
19
+ .item:active {
20
+ background-color: var(--color-background-screen-active);
21
+ }
22
+ .item-media {
23
+ flex: 0 0 auto;
24
+ align-items: flex-start;
25
+ }
26
+ .startValue {
27
+ flex: 1;
28
+ }
29
+ .endValue {
30
+ flex: 1;
31
+ text-align: end;
32
+ }
33
+ .endValue.positive {
34
+ color: var(--color-sentiment-positive) !important;
35
+ }
36
+ .endValue.negative {
37
+ color: var(--color-sentiment-negative) !important;
38
+ }
39
+ .endValue.positive .item-title {
40
+ color: var(--color-sentiment-positive) !important;
41
+ }
42
+ .endValue.negative .item-title {
43
+ color: var(--color-sentiment-negative) !important;
44
+ }
45
+ .endValue.strikethrough {
46
+ -webkit-text-decoration: line-through;
47
+ text-decoration: line-through;
48
+ }
49
+ .item-title {
50
+ color: #37517e;
51
+ color: var(--color-content-primary);
52
+ }
53
+ .item-additionalInfo {
54
+ color: #768e9c;
55
+ color: var(--color-content-tertiary);
56
+ }
57
+ .item-action {
58
+ flex: 0 0 auto;
59
+ }
@@ -0,0 +1,68 @@
1
+ .item {
2
+ padding: 16px;
3
+ border-radius: var(--radius-medium);
4
+ background-color: var(--color-background-screen);
5
+ display: flex;
6
+ gap: 16px;
7
+ align-items: center;
8
+ flex-direction: row;
9
+
10
+ &:disabled {
11
+ opacity: 0.45;
12
+ mix-blend-mode: luminosity;
13
+ }
14
+
15
+ &:hover {
16
+ background-color: var(--color-background-screen-hover);
17
+ }
18
+
19
+ &:active {
20
+ background-color: var(--color-background-screen-active);
21
+ }
22
+ }
23
+
24
+ .item-media {
25
+ flex: 0 0 auto;
26
+ align-items: flex-start;
27
+ }
28
+
29
+ .startValue {
30
+ flex: 1;
31
+ }
32
+
33
+ .endValue {
34
+ flex: 1;
35
+ text-align: end;
36
+
37
+ &.positive {
38
+ color: var(--color-sentiment-positive) !important;
39
+ }
40
+ &.negative {
41
+ color: var(--color-sentiment-negative) !important;
42
+ }
43
+ }
44
+ .endValue.positive {
45
+ .item-title {
46
+ color: var(--color-sentiment-positive) !important;
47
+ }
48
+ }
49
+ .endValue.negative {
50
+ .item-title {
51
+ color: var(--color-sentiment-negative) !important;
52
+ }
53
+ }
54
+ .endValue.strikethrough {
55
+ text-decoration: line-through;
56
+ }
57
+
58
+ .item-title {
59
+ color: var(--color-content-primary)
60
+ }
61
+
62
+ .item-additionalInfo {
63
+ color: var(--color-content-tertiary)
64
+ }
65
+
66
+ .item-action {
67
+ flex: 0 0 auto;
68
+ }
@@ -0,0 +1,212 @@
1
+ import { Item } from './Item';
2
+ import { Meta, StoryObj } from '@storybook/react';
3
+ import AvatarView from '../avatarView';
4
+ import { Sentiment } from '../common';
5
+ import React from 'react';
6
+ import { ItemProps } from './Item.types';
7
+
8
+ type ItemStoryProps = Omit<ItemProps, 'media'> & {
9
+ mediaSize?: number;
10
+ media?: {
11
+ value: React.ReactElement;
12
+ };
13
+ endValueTitle?: string;
14
+ endValueSubtitle?: string;
15
+ endValueInverted?: boolean;
16
+ endValueStrikethrough?: boolean;
17
+ endValueSentiment?: Sentiment.NEGATIVE | Sentiment.POSITIVE | undefined;
18
+ };
19
+
20
+ export default {
21
+ component: Item,
22
+ title: 'Content/Item',
23
+ args: {
24
+ type: 'Navigation',
25
+ title: 'Title',
26
+ subtitle: 'Subtitle',
27
+ additionalInfo: 'Additional Info',
28
+ inverted: false,
29
+ media: {
30
+ value: <AvatarView profileName="H D" />,
31
+ },
32
+ mediaSize: 48,
33
+ endValueTitle: '427,386.39 JPY',
34
+ endValueSubtitle: '2197.06 GBP',
35
+ endValueInverted: false,
36
+ endValueStrikethrough: false,
37
+ endValueSentiment: undefined,
38
+ },
39
+ } satisfies Meta<ItemStoryProps>;
40
+
41
+ type Story = StoryObj<ItemStoryProps>;
42
+
43
+ export const Playground: Story = {
44
+ parameters: {
45
+ controls: {
46
+ exclude: ['media', 'endValue'],
47
+ },
48
+ },
49
+ argTypes: {
50
+ type: {
51
+ control: 'radio',
52
+ options: ['NonInteractive', 'Navigation', 'Switch', 'Checkbox', 'Radio', 'IconButton'],
53
+ table: {
54
+ category: 'Type',
55
+ },
56
+ },
57
+ mediaSize: {
58
+ control: 'radio',
59
+ options: [0, 32, 40, 48, 56, 72],
60
+ defaultValue: 48,
61
+ },
62
+ title: {
63
+ control: 'text',
64
+ table: {
65
+ category: 'Start Value Controls',
66
+ },
67
+ },
68
+ subtitle: {
69
+ control: 'text',
70
+ table: {
71
+ category: 'Start Value Controls',
72
+ },
73
+ },
74
+ additionalInfo: {
75
+ control: 'text',
76
+ table: {
77
+ category: 'Start Value Controls',
78
+ },
79
+ },
80
+ inverted: {
81
+ control: 'boolean',
82
+ table: {
83
+ category: 'Start Value Controls',
84
+ },
85
+ },
86
+
87
+ endValueTitle: {
88
+ control: 'text',
89
+ table: {
90
+ category: 'End Value Controls',
91
+ },
92
+ },
93
+ endValueSubtitle: {
94
+ control: 'text',
95
+ table: {
96
+ category: 'End Value Controls',
97
+ },
98
+ },
99
+ endValueInverted: {
100
+ control: 'boolean',
101
+ table: {
102
+ category: 'End Value Controls',
103
+ },
104
+ },
105
+ endValueStrikethrough: {
106
+ control: 'boolean',
107
+ table: {
108
+ category: 'End Value Controls',
109
+ },
110
+ },
111
+ endValueSentiment: {
112
+ control: 'radio',
113
+ options: ['POSITIVE', 'NEGATIVE', 'none'],
114
+ defaultValue: 'none',
115
+ mapping: {
116
+ POSITIVE: Sentiment.POSITIVE,
117
+ NEGATIVE: Sentiment.NEGATIVE,
118
+ none: undefined,
119
+ },
120
+ table: {
121
+ category: 'End Value Controls',
122
+ },
123
+ },
124
+ },
125
+ render: (args) => {
126
+ const {
127
+ mediaSize,
128
+ media,
129
+ endValueTitle,
130
+ endValueSubtitle,
131
+ endValueInverted,
132
+ endValueStrikethrough,
133
+ endValueSentiment,
134
+ ...restProps
135
+ } = args;
136
+
137
+ return (
138
+ <Item
139
+ {...restProps}
140
+ media={
141
+ mediaSize === 0 || !media
142
+ ? undefined
143
+ : {
144
+ value: React.cloneElement(media.value, { size: mediaSize }),
145
+ }
146
+ }
147
+ endValue={{
148
+ title: endValueTitle,
149
+ subtitle: endValueSubtitle,
150
+ inverted: endValueInverted,
151
+ strikethrough: endValueStrikethrough,
152
+ sentiment: endValueSentiment,
153
+ }}
154
+ />
155
+ );
156
+ },
157
+ };
158
+ export const Variants: Story = {
159
+ render: () => (
160
+ <>
161
+ <Item type="NonInteractive" title="Title" />
162
+ <Item
163
+ media={{ value: <AvatarView size={48} profileName="H D" /> }}
164
+ type="Navigation"
165
+ title="Title"
166
+ />
167
+ <Item
168
+ type="Navigation"
169
+ title="Title"
170
+ subtitle="Subtitle"
171
+ media={{ value: <AvatarView size={32} profileName="H D" /> }}
172
+ endValue={{ title: '427,386.39 JPY', sentiment: Sentiment.NEGATIVE }}
173
+ />
174
+ <Item
175
+ type="Switch"
176
+ title="Title"
177
+ subtitle="Subtitle"
178
+ additionalInfo="Additional Info"
179
+ media={{ value: <AvatarView size={40} profileName="H D" /> }}
180
+ endValue={{
181
+ title: '427,386.39 JPY',
182
+ subtitle: '2197.06 GBP',
183
+ sentiment: Sentiment.POSITIVE,
184
+ }}
185
+ />
186
+ <Item
187
+ type="Checkbox"
188
+ title="Title Inverted"
189
+ subtitle="Subtitle"
190
+ additionalInfo="Additional Info"
191
+ inverted
192
+ media={{ value: <AvatarView size={48} profileName="H D" /> }}
193
+ endValue={{ title: 'Title Inverted', subtitle: 'Subtitle', inverted: true }}
194
+ />
195
+ <Item
196
+ type="Radio"
197
+ title="Title Inverted"
198
+ subtitle="Subtitle"
199
+ inverted
200
+ media={{ value: <AvatarView size={56} profileName="H D" /> }}
201
+ endValue={{ title: 'Title Inverted', inverted: true }}
202
+ />
203
+ <Item
204
+ type="IconButton"
205
+ title="Title Inverted"
206
+ inverted
207
+ media={{ value: <AvatarView size={72} profileName="H D" /> }}
208
+ endValue={{ subtitle: 'Subtitle Inverted', inverted: true }}
209
+ />
210
+ </>
211
+ ),
212
+ };
@@ -0,0 +1,88 @@
1
+ import { ReactNode } from 'react';
2
+ import RadioButton from '../common/RadioButton';
3
+ import { Position, Sentiment, Typography } from '../common';
4
+ import Button from '../button';
5
+ import CheckboxButton from '../checkboxButton';
6
+ import Chevron from '../chevron';
7
+ import IconButton from '../iconButton';
8
+ import Switch from '../switch';
9
+ import { ItemProps } from './Item.types';
10
+ import Body from '../body';
11
+ import { InfoCircle } from '@transferwise/icons';
12
+
13
+ export const Item = ({
14
+ type,
15
+ title,
16
+ subtitle,
17
+ additionalInfo,
18
+ inverted,
19
+ media,
20
+ endValue,
21
+ }: ItemProps) => {
22
+ const returnType = (): ReactNode => {
23
+ switch (type) {
24
+ case 'Navigation':
25
+ return <Chevron orientation={Position.RIGHT} disabled />;
26
+ case 'Radio':
27
+ return <RadioButton name="Hello" checked />;
28
+ case 'Checkbox':
29
+ return <CheckboxButton name="Hello" checked />;
30
+ case 'Switch':
31
+ return <Switch onClick={() => console.log('clicked')} />;
32
+ case 'Button':
33
+ return <Button v2>Hello</Button>;
34
+ case 'IconButton':
35
+ return (
36
+ <IconButton priority="minimal">
37
+ <InfoCircle />
38
+ </IconButton>
39
+ );
40
+ case 'NonInteractive':
41
+ default:
42
+ return <></>;
43
+ }
44
+ };
45
+
46
+ // clean up how classes are applied
47
+ return (
48
+ <div className="item">
49
+ {media && <div className="item-media">{media?.value}</div>}
50
+ <div className="startValue">
51
+ <Body
52
+ className={!inverted ? 'item-title' : ''}
53
+ type={!inverted ? Typography.BODY_LARGE_BOLD : Typography.BODY_DEFAULT}
54
+ >
55
+ {title}
56
+ </Body>
57
+ <Body
58
+ className={inverted ? 'item-title' : ''}
59
+ type={!inverted ? Typography.BODY_DEFAULT : Typography.BODY_LARGE_BOLD}
60
+ >
61
+ {subtitle}
62
+ </Body>
63
+ <Body className="item-additionalInfo" type={Typography.BODY_DEFAULT}>
64
+ {subtitle && additionalInfo}
65
+ </Body>
66
+ </div>
67
+ {endValue && (
68
+ <div
69
+ className={`endValue ${endValue.sentiment} ${endValue.strikethrough ? 'strikethrough' : ''}`}
70
+ >
71
+ <Body
72
+ className={!endValue.inverted ? 'item-title' : endValue.sentiment}
73
+ type={!endValue.inverted ? Typography.BODY_LARGE_BOLD : Typography.BODY_DEFAULT}
74
+ >
75
+ {endValue.title}
76
+ </Body>
77
+ <Body
78
+ className={endValue.inverted ? 'item-title' : endValue.sentiment}
79
+ type={!endValue.inverted ? Typography.BODY_DEFAULT : Typography.BODY_LARGE_BOLD}
80
+ >
81
+ {endValue.subtitle}
82
+ </Body>
83
+ </div>
84
+ )}
85
+ {type !== 'NonInteractive' && <div className="item-action">{returnType()}</div>}
86
+ </div>
87
+ );
88
+ };
@@ -0,0 +1,40 @@
1
+ import { ReactNode } from 'react';
2
+ import { Sentiment } from '../common';
3
+
4
+ export type ItemTypes =
5
+ | 'NonInteractive'
6
+ | 'Navigation'
7
+ | 'Radio'
8
+ | 'Checkbox'
9
+ | 'Switch'
10
+ | 'Button'
11
+ | 'IconButton';
12
+
13
+ export type EndValueProps = {
14
+ title?: string;
15
+ subtitle?: string;
16
+ inverted?: boolean;
17
+ sentiment?: Sentiment.POSITIVE | Sentiment.NEGATIVE;
18
+ strikethrough?: boolean;
19
+ bold?: boolean;
20
+ };
21
+
22
+ export interface ItemProps {
23
+ type: ItemTypes;
24
+ // as: NonInteractive | Interactive; // is this enough to handle Interaction
25
+ media?: {
26
+ // type?: 'Image' | 'Avatar';
27
+ value: ReactNode; // should we restrict sizes?? how to set default to 48
28
+ };
29
+ title: string;
30
+ subtitle?: string;
31
+ additionalInfo?: string;
32
+ inverted?: boolean;
33
+ endValue?: EndValueProps;
34
+ // prompt?: any; // a lot of work to do here. start with this?
35
+ // spotlight?: 'Active' | 'Inactive';
36
+ // children?: ReactNode;
37
+ }
38
+
39
+ // type NonInteractive = 'div' | 'span';
40
+ // type Interactive = 'a' | 'button';
package/src/main.css CHANGED
@@ -2626,6 +2626,65 @@ html:not([dir="rtl"]) .np-flow-navigation--sm .np-flow-navigation__stepper {
2626
2626
  border-radius: 9999px !important;
2627
2627
  border-radius: var(--radius-full) !important;
2628
2628
  }
2629
+ .item {
2630
+ padding: 16px;
2631
+ border-radius: 16px;
2632
+ border-radius: var(--radius-medium);
2633
+ background-color: #ffffff;
2634
+ background-color: var(--color-background-screen);
2635
+ display: flex;
2636
+ gap: 16px;
2637
+ align-items: center;
2638
+ flex-direction: row;
2639
+ }
2640
+ .item:disabled {
2641
+ opacity: 0.45;
2642
+ mix-blend-mode: luminosity;
2643
+ }
2644
+ .item:hover {
2645
+ background-color: var(--color-background-screen-hover);
2646
+ }
2647
+ .item:active {
2648
+ background-color: var(--color-background-screen-active);
2649
+ }
2650
+ .item-media {
2651
+ flex: 0 0 auto;
2652
+ align-items: flex-start;
2653
+ }
2654
+ .startValue {
2655
+ flex: 1;
2656
+ }
2657
+ .endValue {
2658
+ flex: 1;
2659
+ text-align: end;
2660
+ }
2661
+ .endValue.positive {
2662
+ color: var(--color-sentiment-positive) !important;
2663
+ }
2664
+ .endValue.negative {
2665
+ color: var(--color-sentiment-negative) !important;
2666
+ }
2667
+ .endValue.positive .item-title {
2668
+ color: var(--color-sentiment-positive) !important;
2669
+ }
2670
+ .endValue.negative .item-title {
2671
+ color: var(--color-sentiment-negative) !important;
2672
+ }
2673
+ .endValue.strikethrough {
2674
+ -webkit-text-decoration: line-through;
2675
+ text-decoration: line-through;
2676
+ }
2677
+ .item-title {
2678
+ color: #37517e;
2679
+ color: var(--color-content-primary);
2680
+ }
2681
+ .item-additionalInfo {
2682
+ color: #768e9c;
2683
+ color: var(--color-content-tertiary);
2684
+ }
2685
+ .item-action {
2686
+ flex: 0 0 auto;
2687
+ }
2629
2688
  .np-field-control {
2630
2689
  margin-top: 4px;
2631
2690
  margin-top: var(--size-4);
package/src/main.less CHANGED
@@ -38,6 +38,7 @@
38
38
  @import "./image/Image.less";
39
39
  @import "./info/Info.less";
40
40
  @import "./inputs/Input.less";
41
+ @import "./item/Item.less";
41
42
  @import "./field/Field.less";
42
43
  @import "./inputs/InputGroup.less";
43
44
  @import "./inputs/SelectInput.less";