@rango-dev/ui 0.29.1-next.8 → 0.30.0
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/dist/index.js +6 -6
- package/dist/index.js.map +4 -4
- package/dist/translations/de.d.ts +2 -0
- package/dist/translations/de.d.ts.map +1 -0
- package/dist/translations/el.d.ts +2 -0
- package/dist/translations/el.d.ts.map +1 -0
- package/dist/translations/en.d.ts.map +1 -1
- package/dist/translations/es.d.ts.map +1 -1
- package/dist/translations/fi.d.ts +2 -0
- package/dist/translations/fi.d.ts.map +1 -0
- package/dist/translations/fr.d.ts.map +1 -1
- package/dist/translations/it.d.ts +2 -0
- package/dist/translations/it.d.ts.map +1 -0
- package/dist/translations/ja.d.ts.map +1 -1
- package/dist/translations/nl.d.ts +2 -0
- package/dist/translations/nl.d.ts.map +1 -0
- package/dist/translations/pl.d.ts +2 -0
- package/dist/translations/pl.d.ts.map +1 -0
- package/dist/translations/pt.d.ts.map +1 -1
- package/dist/translations/ru.d.ts +2 -0
- package/dist/translations/ru.d.ts.map +1 -0
- package/dist/translations/sv.d.ts +2 -0
- package/dist/translations/sv.d.ts.map +1 -0
- package/dist/translations/uk.d.ts +2 -0
- package/dist/translations/uk.d.ts.map +1 -0
- package/dist/translations/zh.d.ts +2 -0
- package/dist/translations/zh.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Alert/Alert.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.constants.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +1 -1
- package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts +1 -1
- package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Flags/Bengali.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Bengali.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Chinese.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Chinese.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Finland.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Finland.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/German.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/German.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Greece.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Greece.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Hindi.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Hindi.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Indonesian.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Indonesian.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Italian.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Italian.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Malay.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Malay.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Netherlands.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Netherlands.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Poland.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Poland.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Russian.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Russian.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Swedish.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Swedish.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Thai.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Thai.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Turkish.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Turkish.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Ukrainian.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Ukrainian.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/Vietnamese.d.ts +4 -0
- package/dist/widget/ui/src/components/Flags/Vietnamese.d.ts.map +1 -0
- package/dist/widget/ui/src/components/Flags/index.d.ts +18 -1
- package/dist/widget/ui/src/components/Flags/index.d.ts.map +1 -1
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.d.ts.map +1 -1
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts +1 -0
- package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts +10 -0
- package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts +2 -0
- package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +2 -2
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.types.d.ts +0 -1
- package/dist/widget/ui/src/components/ListItemButton/ListItemButton.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Select/Select.d.ts +1 -1
- package/dist/widget/ui/src/components/Select/Select.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Select/Select.types.d.ts +8 -6
- package/dist/widget/ui/src/components/Select/Select.types.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Select/select.styles.d.ts +1 -0
- package/dist/widget/ui/src/components/Select/select.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/BorderRadius.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/Font.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/InProgress.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/Language.d.ts.map +1 -1
- package/dist/widget/ui/src/icons/Widget.d.ts +5 -0
- package/dist/widget/ui/src/icons/Widget.d.ts.map +1 -0
- package/dist/widget/ui/src/icons/index.d.ts +12 -11
- package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/components/Alert/Alert.tsx +6 -1
- package/src/components/ChainToken/ChainToken.constants.ts +1 -0
- package/src/components/ChainToken/ChainToken.styles.ts +4 -0
- package/src/components/Divider/Divider.styles.ts +8 -0
- package/src/components/Flags/Bengali.tsx +25 -0
- package/src/components/Flags/Chinese.tsx +28 -0
- package/src/components/Flags/Finland.tsx +31 -0
- package/src/components/Flags/German.tsx +26 -0
- package/src/components/Flags/Greece.tsx +31 -0
- package/src/components/Flags/Hindi.tsx +29 -0
- package/src/components/Flags/Indonesian.tsx +25 -0
- package/src/components/Flags/Italian.tsx +26 -0
- package/src/components/Flags/Malay.tsx +29 -0
- package/src/components/Flags/Netherlands.tsx +29 -0
- package/src/components/Flags/Poland.tsx +25 -0
- package/src/components/Flags/Russian.tsx +26 -0
- package/src/components/Flags/Swedish.tsx +31 -0
- package/src/components/Flags/Thai.tsx +32 -0
- package/src/components/Flags/Turkish.tsx +28 -0
- package/src/components/Flags/Ukrainian.tsx +25 -0
- package/src/components/Flags/Vietnamese.tsx +28 -0
- package/src/components/Flags/index.ts +41 -1
- package/src/components/FullExpandedQuote/FullExpandedQuote.Skeletons.tsx +1 -1
- package/src/components/FullExpandedQuote/FullExpandedQuote.styles.ts +15 -9
- package/src/components/FullExpandedQuote/FullExpandedQuote.tsx +10 -6
- package/src/components/FullExpandedQuote/FullExpandedQuote.types.ts +1 -0
- package/src/components/Header/Header.styles.ts +1 -1
- package/src/components/I18nManager/I18nManager.tsx +20 -0
- package/src/components/ListItem/ListItem.styles.ts +1 -0
- package/src/components/ListItem/ListItem.types.ts +2 -0
- package/src/components/ListItemButton/ListItemButton.styles.ts +14 -30
- package/src/components/ListItemButton/ListItemButton.tsx +10 -8
- package/src/components/ListItemButton/ListItemButton.types.ts +0 -1
- package/src/components/Popover/Popover.styles.ts +7 -1
- package/src/components/Select/Select.tsx +10 -7
- package/src/components/Select/Select.types.ts +10 -6
- package/src/components/Select/select.styles.ts +33 -13
- package/src/components/StepDetails/StepDetails.styles.ts +1 -1
- package/src/components/Tooltip/Tooltip.styles.ts +6 -4
- package/src/containers/SwapInput/SwapInput.styles.ts +6 -0
- package/src/containers/SwapInput/SwapInput.tsx +1 -1
- package/src/containers/SwapInput/TokenSection.styles.ts +1 -1
- package/src/icons/BorderRadius.tsx +10 -7
- package/src/icons/Font.tsx +17 -13
- package/src/icons/InProgress.tsx +13 -8
- package/src/icons/Language.tsx +44 -40
- package/src/icons/Widget.tsx +24 -0
- package/src/icons/index.ts +12 -11
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FlagPropTypes } from './Flags.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_SIZE } from './Flags.constants';
|
|
6
|
+
|
|
7
|
+
export default function Turkish(props: FlagPropTypes) {
|
|
8
|
+
const { size = DEFAULT_SIZE } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width={size}
|
|
13
|
+
height={size}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 512 512">
|
|
16
|
+
<mask id="a">
|
|
17
|
+
<circle cx={256} cy={256} r={256} fill="#fff" />
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#a)">
|
|
20
|
+
<path fill="#d80027" d="M0 0h512v512H0z" />
|
|
21
|
+
<g fill="#eee">
|
|
22
|
+
<path d="m245.5 209.2 21 29 34-11.1-21 29 21 28.9-34-11.1-21 29V267l-34-11.1 34-11z" />
|
|
23
|
+
<path d="M188.2 328.3a72.3 72.3 0 1 1 34.4-136 89 89 0 1 0 0 127.3 72 72 0 0 1-34.4 8.7z" />
|
|
24
|
+
</g>
|
|
25
|
+
</g>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { FlagPropTypes } from './Flags.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_SIZE } from './Flags.constants';
|
|
6
|
+
|
|
7
|
+
export default function Ukrainian(props: FlagPropTypes) {
|
|
8
|
+
const { size = DEFAULT_SIZE } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width={size}
|
|
13
|
+
height={size}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 512 512">
|
|
16
|
+
<mask id="a">
|
|
17
|
+
<circle cx={256} cy={256} r={256} fill="#fff" />
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#a)">
|
|
20
|
+
<path fill="#ffda44" d="m0 256 258-39.4L512 256v256H0z" />
|
|
21
|
+
<path fill="#338af3" d="M0 0h512v256H0z" />
|
|
22
|
+
</g>
|
|
23
|
+
</svg>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { FlagPropTypes } from './Flags.types';
|
|
2
|
+
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { DEFAULT_SIZE } from './Flags.constants';
|
|
6
|
+
|
|
7
|
+
export default function Vietnamese(props: FlagPropTypes) {
|
|
8
|
+
const { size = DEFAULT_SIZE } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<svg
|
|
12
|
+
width={size}
|
|
13
|
+
height={size}
|
|
14
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
15
|
+
viewBox="0 0 512 512">
|
|
16
|
+
<mask id="a">
|
|
17
|
+
<circle cx={256} cy={256} r={256} fill="#fff" />
|
|
18
|
+
</mask>
|
|
19
|
+
<g mask="url(#a)">
|
|
20
|
+
<path fill="#d80027" d="M0 0h512v512H0z" />
|
|
21
|
+
<path
|
|
22
|
+
fill="#ffda44"
|
|
23
|
+
d="m256 133.6 27.6 85H373L300.7 271l27.6 85-72.3-52.5-72.3 52.6 27.6-85-72.3-52.6h89.4z"
|
|
24
|
+
/>
|
|
25
|
+
</g>
|
|
26
|
+
</svg>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
@@ -1,9 +1,49 @@
|
|
|
1
|
+
import Bengali from './Bengali';
|
|
2
|
+
import Chinese from './Chinese';
|
|
1
3
|
import English from './English';
|
|
4
|
+
import Finland from './Finland';
|
|
2
5
|
import French from './French';
|
|
6
|
+
import German from './German';
|
|
7
|
+
import Greece from './Greece';
|
|
8
|
+
import Hindi from './Hindi';
|
|
9
|
+
import Indonesian from './Indonesian';
|
|
10
|
+
import Italian from './Italian';
|
|
3
11
|
import Japanese from './Japanese';
|
|
12
|
+
import Malay from './Malay';
|
|
13
|
+
import Netherlands from './Netherlands';
|
|
14
|
+
import Poland from './Poland';
|
|
4
15
|
import Portuguese from './Portuguese';
|
|
16
|
+
import Russian from './Russian';
|
|
5
17
|
import Spanish from './Spanish';
|
|
18
|
+
import Swedish from './Swedish';
|
|
19
|
+
import Thai from './Thai';
|
|
20
|
+
import Turkish from './Turkish';
|
|
21
|
+
import Ukrainian from './Ukrainian';
|
|
22
|
+
import Vietnamese from './Vietnamese';
|
|
6
23
|
|
|
7
24
|
export type { FlagPropTypes } from './Flags.types';
|
|
8
25
|
|
|
9
|
-
export {
|
|
26
|
+
export {
|
|
27
|
+
English,
|
|
28
|
+
Spanish,
|
|
29
|
+
Japanese,
|
|
30
|
+
French,
|
|
31
|
+
Portuguese,
|
|
32
|
+
Hindi,
|
|
33
|
+
Chinese,
|
|
34
|
+
Bengali,
|
|
35
|
+
Russian,
|
|
36
|
+
Indonesian,
|
|
37
|
+
German,
|
|
38
|
+
Malay,
|
|
39
|
+
Swedish,
|
|
40
|
+
Thai,
|
|
41
|
+
Turkish,
|
|
42
|
+
Ukrainian,
|
|
43
|
+
Vietnamese,
|
|
44
|
+
Finland,
|
|
45
|
+
Netherlands,
|
|
46
|
+
Greece,
|
|
47
|
+
Italian,
|
|
48
|
+
Poland,
|
|
49
|
+
};
|
|
@@ -20,6 +20,12 @@ export const RouteContainer = styled('div', {
|
|
|
20
20
|
[`.${darkTheme} &`]: {
|
|
21
21
|
backgroundColor: '$neutral500',
|
|
22
22
|
},
|
|
23
|
+
'&:hover': {
|
|
24
|
+
backgroundColor: '$neutral300',
|
|
25
|
+
[`.${darkTheme} &`]: {
|
|
26
|
+
backgroundColor: '$neutral400',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
23
29
|
variants: {
|
|
24
30
|
selected: {
|
|
25
31
|
true: {
|
|
@@ -55,7 +61,7 @@ export const TagsContainer = styled('div', {
|
|
|
55
61
|
|
|
56
62
|
export const Steps = styled('div', {
|
|
57
63
|
display: 'flex',
|
|
58
|
-
height: '
|
|
64
|
+
height: '102px',
|
|
59
65
|
});
|
|
60
66
|
|
|
61
67
|
export const StepItem = styled('div', {
|
|
@@ -109,8 +115,8 @@ export const SwapperContainer = styled(FlexCenter, {
|
|
|
109
115
|
export const SwapperImage = styled(FlexCenter, {
|
|
110
116
|
borderRadius: '$lg',
|
|
111
117
|
position: 'relative',
|
|
112
|
-
width: '$
|
|
113
|
-
height: '$
|
|
118
|
+
width: '$24',
|
|
119
|
+
height: '$24',
|
|
114
120
|
border: '1px solid transparent',
|
|
115
121
|
variants: {
|
|
116
122
|
state: {
|
|
@@ -127,10 +133,10 @@ export const SwapperImage = styled(FlexCenter, {
|
|
|
127
133
|
export const IconHighlight = styled(FlexCenter, {
|
|
128
134
|
borderRadius: '$lg',
|
|
129
135
|
position: 'absolute',
|
|
130
|
-
width: '$
|
|
131
|
-
height: '$
|
|
132
|
-
bottom: -
|
|
133
|
-
right: -
|
|
136
|
+
width: '$10',
|
|
137
|
+
height: '$10',
|
|
138
|
+
bottom: -3,
|
|
139
|
+
right: -3,
|
|
134
140
|
variants: {
|
|
135
141
|
type: {
|
|
136
142
|
warning: {
|
|
@@ -153,12 +159,12 @@ export const IconHighlight = styled(FlexCenter, {
|
|
|
153
159
|
|
|
154
160
|
export const OutputSection = styled(FlexCenter, {
|
|
155
161
|
flexDirection: 'column',
|
|
156
|
-
paddingLeft: '$
|
|
162
|
+
paddingLeft: '$8',
|
|
157
163
|
});
|
|
158
164
|
|
|
159
165
|
export const VerticalLine = styled('div', {
|
|
160
166
|
display: 'flex',
|
|
161
|
-
width: '50%',
|
|
167
|
+
width: 'calc(50% + 1px)',
|
|
162
168
|
borderRight: '1px dashed',
|
|
163
169
|
height: '$10',
|
|
164
170
|
borderColor: '$info300',
|
|
@@ -45,7 +45,8 @@ export function FullExpandedQuote(props: PropTypes) {
|
|
|
45
45
|
warningLevel,
|
|
46
46
|
tooltipContainer,
|
|
47
47
|
onClick,
|
|
48
|
-
|
|
48
|
+
feeWarning,
|
|
49
|
+
selected = false,
|
|
49
50
|
} = props;
|
|
50
51
|
|
|
51
52
|
const steps: DataLoadedProps['steps'] = loading
|
|
@@ -64,6 +65,7 @@ export function FullExpandedQuote(props: PropTypes) {
|
|
|
64
65
|
fee={props.fee}
|
|
65
66
|
time={props.time}
|
|
66
67
|
steps={numberOfSteps}
|
|
68
|
+
feeWarning={feeWarning}
|
|
67
69
|
/>
|
|
68
70
|
<TagsContainer>
|
|
69
71
|
{props.tags.map((tag) => (
|
|
@@ -85,7 +87,7 @@ export function FullExpandedQuote(props: PropTypes) {
|
|
|
85
87
|
) : (
|
|
86
88
|
<LeftSection>
|
|
87
89
|
<ChainToken
|
|
88
|
-
size="
|
|
90
|
+
size="xmedium"
|
|
89
91
|
chainImage={step.from.chain.image}
|
|
90
92
|
tokenImage={step.from.token.image}
|
|
91
93
|
/>
|
|
@@ -116,20 +118,21 @@ export function FullExpandedQuote(props: PropTypes) {
|
|
|
116
118
|
<SwapperContainer>
|
|
117
119
|
<SwapperImage state={step.state}>
|
|
118
120
|
<Image
|
|
119
|
-
size={
|
|
121
|
+
size={22}
|
|
120
122
|
type="circular"
|
|
121
123
|
src={step.swapper.image}
|
|
122
124
|
/>
|
|
123
125
|
{step.state && (
|
|
124
126
|
<IconHighlight type={step.state}>
|
|
125
127
|
{step.state === 'error' ? (
|
|
126
|
-
<ErrorIcon size={
|
|
128
|
+
<ErrorIcon size={8} color="error" />
|
|
127
129
|
) : (
|
|
128
|
-
<WarningIcon size={
|
|
130
|
+
<WarningIcon size={8} color="warning" />
|
|
129
131
|
)}
|
|
130
132
|
</IconHighlight>
|
|
131
133
|
)}
|
|
132
134
|
</SwapperImage>
|
|
135
|
+
<Divider size={2} />
|
|
133
136
|
<Typography size="xsmall" variant="body" align="center">
|
|
134
137
|
{step.swapper.displayName}
|
|
135
138
|
</Typography>
|
|
@@ -149,6 +152,7 @@ export function FullExpandedQuote(props: PropTypes) {
|
|
|
149
152
|
tokenImage={steps[numberOfSteps - 1].to.token.image}
|
|
150
153
|
size="medium"
|
|
151
154
|
/>
|
|
155
|
+
<Divider size={4} />
|
|
152
156
|
<div>
|
|
153
157
|
<Tooltip
|
|
154
158
|
content={props.outputPrice.realValue}
|
|
@@ -158,7 +162,7 @@ export function FullExpandedQuote(props: PropTypes) {
|
|
|
158
162
|
{props.outputPrice.value}
|
|
159
163
|
</Typography>
|
|
160
164
|
<Divider size={4} direction="horizontal" />
|
|
161
|
-
<Typography size="
|
|
165
|
+
<Typography size="xmedium" variant="title">
|
|
162
166
|
{steps[numberOfSteps - 1].to.token.displayName}
|
|
163
167
|
</Typography>
|
|
164
168
|
</Tooltip>
|
|
@@ -16,7 +16,7 @@ export const Container = styled('div', {
|
|
|
16
16
|
display: 'flex',
|
|
17
17
|
justifyContent: 'space-between',
|
|
18
18
|
alignItems: 'center',
|
|
19
|
-
padding: '$15 $20',
|
|
19
|
+
padding: '$20 $20 $15 $20',
|
|
20
20
|
$$color: '$colors$neutral100',
|
|
21
21
|
[`.${darkTheme} &`]: {
|
|
22
22
|
$$color: '$colors$neutral300',
|
|
@@ -11,11 +11,21 @@ import React, { useEffect, useReducer } from 'react';
|
|
|
11
11
|
* "translations/*": ["../../translations/*"]
|
|
12
12
|
*}
|
|
13
13
|
*/
|
|
14
|
+
import { messages as deMessages } from '../../../../../translations/de';
|
|
15
|
+
import { messages as elMessages } from '../../../../../translations/el';
|
|
14
16
|
import { messages as enMessages } from '../../../../../translations/en';
|
|
15
17
|
import { messages as esMessages } from '../../../../../translations/es';
|
|
18
|
+
import { messages as fiMessages } from '../../../../../translations/fi';
|
|
16
19
|
import { messages as frMessages } from '../../../../../translations/fr';
|
|
20
|
+
import { messages as itMessages } from '../../../../../translations/it';
|
|
17
21
|
import { messages as jaMessages } from '../../../../../translations/ja';
|
|
22
|
+
import { messages as nlMessages } from '../../../../../translations/nl';
|
|
23
|
+
import { messages as plMessages } from '../../../../../translations/pl';
|
|
18
24
|
import { messages as ptMessages } from '../../../../../translations/pt';
|
|
25
|
+
import { messages as ruMessages } from '../../../../../translations/ru';
|
|
26
|
+
import { messages as svMessages } from '../../../../../translations/sv';
|
|
27
|
+
import { messages as ukMessages } from '../../../../../translations/uk';
|
|
28
|
+
import { messages as zhMessages } from '../../../../../translations/zh';
|
|
19
29
|
|
|
20
30
|
const messages = {
|
|
21
31
|
en: enMessages,
|
|
@@ -23,6 +33,16 @@ const messages = {
|
|
|
23
33
|
ja: jaMessages,
|
|
24
34
|
fr: frMessages,
|
|
25
35
|
pt: ptMessages,
|
|
36
|
+
zh: zhMessages,
|
|
37
|
+
ru: ruMessages,
|
|
38
|
+
de: deMessages,
|
|
39
|
+
uk: ukMessages,
|
|
40
|
+
sv: svMessages,
|
|
41
|
+
fi: fiMessages,
|
|
42
|
+
nl: nlMessages,
|
|
43
|
+
el: elMessages,
|
|
44
|
+
it: itMessages,
|
|
45
|
+
pl: plMessages,
|
|
26
46
|
};
|
|
27
47
|
|
|
28
48
|
i18n.load(messages);
|
|
@@ -1,26 +1,10 @@
|
|
|
1
1
|
import { darkTheme, styled } from '../../theme';
|
|
2
|
+
import { ListItem } from '../ListItem/ListItem';
|
|
2
3
|
|
|
3
|
-
export const BaseListItemButton = styled(
|
|
4
|
+
export const BaseListItemButton = styled(ListItem, {
|
|
4
5
|
transition: 'all 0.35s',
|
|
5
|
-
border: 0,
|
|
6
|
-
width: '100%',
|
|
7
|
-
backgroundColor: 'transparent',
|
|
8
|
-
fontFamily: 'inherit',
|
|
9
|
-
padding: 'unset',
|
|
10
|
-
'&:focus-visible': {
|
|
11
|
-
borderRadius: '$xs',
|
|
12
|
-
|
|
13
|
-
outline: 0,
|
|
14
|
-
$$color: '$colors$info100',
|
|
15
|
-
[`.${darkTheme} &`]: {
|
|
16
|
-
$$color: '$colors$info700',
|
|
17
|
-
},
|
|
18
|
-
backgroundColor: '$$color',
|
|
19
|
-
},
|
|
20
6
|
'&:hover': {
|
|
21
7
|
$$color: '$colors$info100',
|
|
22
|
-
borderRadius: '$xs',
|
|
23
|
-
|
|
24
8
|
[`.${darkTheme} &`]: {
|
|
25
9
|
$$color: '$colors$neutral100',
|
|
26
10
|
},
|
|
@@ -30,19 +14,19 @@ export const BaseListItemButton = styled('button', {
|
|
|
30
14
|
'&:active': {
|
|
31
15
|
transform: 'scale(0.99)',
|
|
32
16
|
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
borderColor: '$$color',
|
|
42
|
-
borderBottomRightRadius: 0,
|
|
43
|
-
borderBottomLeftRadius: 0,
|
|
44
|
-
},
|
|
17
|
+
|
|
18
|
+
'&:focus-visible': {
|
|
19
|
+
borderRadius: '$xs',
|
|
20
|
+
|
|
21
|
+
outline: 0,
|
|
22
|
+
$$color: '$colors$info100',
|
|
23
|
+
[`.${darkTheme} &`]: {
|
|
24
|
+
$$color: '$colors$info700',
|
|
45
25
|
},
|
|
26
|
+
backgroundColor: '$$color',
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
variants: {
|
|
46
30
|
selected: {
|
|
47
31
|
true: { outline: '1px solid $secondary500' },
|
|
48
32
|
false: { outline: 0 },
|
|
@@ -2,25 +2,27 @@ import type { ListItemButtonProps } from './ListItemButton.types';
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import { ListItem } from '../ListItem/ListItem';
|
|
6
|
-
|
|
7
5
|
import { BaseListItemButton } from './ListItemButton.styles';
|
|
8
6
|
|
|
9
7
|
function ListItemButton(props: ListItemButtonProps) {
|
|
10
|
-
const { onClick, id,
|
|
8
|
+
const { onClick, id, selected, ...restProps } = props;
|
|
11
9
|
const onClickWithKey = () => {
|
|
12
10
|
if (onClick) {
|
|
13
11
|
onClick(id);
|
|
14
12
|
}
|
|
15
13
|
};
|
|
14
|
+
|
|
16
15
|
return (
|
|
17
16
|
<BaseListItemButton
|
|
18
|
-
hasDivider={hasDivider}
|
|
19
|
-
selected={selected}
|
|
20
17
|
onClick={onClickWithKey}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
aria-label="button"
|
|
19
|
+
selected={selected}
|
|
20
|
+
onKeyUp={(e: { key: string }) => {
|
|
21
|
+
e.key === 'Enter' && onClickWithKey();
|
|
22
|
+
}}
|
|
23
|
+
tabIndex={0}
|
|
24
|
+
{...restProps}
|
|
25
|
+
/>
|
|
24
26
|
);
|
|
25
27
|
}
|
|
26
28
|
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import * as RadixPopover from '@radix-ui/react-popover';
|
|
2
2
|
|
|
3
|
-
import { styled } from '../../theme';
|
|
3
|
+
import { darkTheme, styled } from '../../theme';
|
|
4
4
|
|
|
5
5
|
export const PopoverContainer = styled(RadixPopover.Content, {
|
|
6
6
|
borderRadius: '$sm',
|
|
7
7
|
filter: 'drop-shadow(0px 5px 20px rgba(130, 130, 130, 0.20))',
|
|
8
8
|
backgroundColor: '$neutral100',
|
|
9
|
+
[`.${darkTheme} &`]: {
|
|
10
|
+
backgroundColor: '$neutral300',
|
|
11
|
+
},
|
|
9
12
|
});
|
|
10
13
|
|
|
11
14
|
export const PopoverArrow = styled(RadixPopover.Arrow, {
|
|
12
15
|
fill: '$neutral100',
|
|
16
|
+
[`.${darkTheme} &`]: {
|
|
17
|
+
fill: '$neutral300',
|
|
18
|
+
},
|
|
13
19
|
width: '$16',
|
|
14
20
|
height: '$8',
|
|
15
21
|
});
|
|
@@ -8,10 +8,10 @@ import { Typography } from '../Typography';
|
|
|
8
8
|
|
|
9
9
|
import { SelectContent, SelectItem, SelectTrigger } from './select.styles';
|
|
10
10
|
|
|
11
|
-
export function SelectComponent(props: PropTypes) {
|
|
11
|
+
export function SelectComponent<T extends string>(props: PropTypes<T>) {
|
|
12
12
|
const [open, setOpen] = useState(false);
|
|
13
13
|
const selectRef = useRef<HTMLDivElement>(null);
|
|
14
|
-
const { options, value, container, handleItemClick } = props;
|
|
14
|
+
const { options, value, container, handleItemClick, variant } = props;
|
|
15
15
|
const handleToggle = () => {
|
|
16
16
|
setOpen((prev) => !prev);
|
|
17
17
|
};
|
|
@@ -29,17 +29,20 @@ export function SelectComponent(props: PropTypes) {
|
|
|
29
29
|
};
|
|
30
30
|
}, []);
|
|
31
31
|
|
|
32
|
+
const selectedLabel = options.find((option) => option.value === value)?.label;
|
|
33
|
+
|
|
32
34
|
return (
|
|
33
35
|
<div ref={selectRef}>
|
|
34
|
-
<Select.Root value={value
|
|
36
|
+
<Select.Root value={value} open={open}>
|
|
35
37
|
<SelectTrigger
|
|
38
|
+
variant={variant}
|
|
36
39
|
onKeyDown={(event) => event.key === 'Enter' && handleToggle()}
|
|
37
40
|
onClick={handleToggle}
|
|
38
41
|
open={open}
|
|
39
|
-
aria-label={
|
|
42
|
+
aria-label={selectedLabel}>
|
|
40
43
|
<Select.Value>
|
|
41
44
|
<Typography variant="body" size="small">
|
|
42
|
-
{
|
|
45
|
+
{selectedLabel}
|
|
43
46
|
</Typography>
|
|
44
47
|
</Select.Value>
|
|
45
48
|
|
|
@@ -63,11 +66,11 @@ export function SelectComponent(props: PropTypes) {
|
|
|
63
66
|
key={option.value}
|
|
64
67
|
value={option.value}>
|
|
65
68
|
<Select.ItemText>
|
|
66
|
-
<Typography variant="body" size="small">
|
|
69
|
+
<Typography variant="body" size="small" className="_text">
|
|
67
70
|
{option.label}
|
|
68
71
|
</Typography>
|
|
69
72
|
</Select.ItemText>
|
|
70
|
-
{option.value === value
|
|
73
|
+
{option.value === value && (
|
|
71
74
|
<DoneIcon size={14} color="secondary" />
|
|
72
75
|
)}
|
|
73
76
|
</SelectItem>
|
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
type Item = {
|
|
2
|
-
value:
|
|
1
|
+
type Item<T> = {
|
|
2
|
+
value: T;
|
|
3
3
|
label: string;
|
|
4
4
|
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
|
|
6
|
+
type Variant = 'filled' | 'outlined';
|
|
7
|
+
|
|
8
|
+
export type PropTypes<T> = {
|
|
9
|
+
options: Item<T>[];
|
|
10
|
+
handleItemClick?: (item: Item<T>) => void;
|
|
11
|
+
value: string;
|
|
9
12
|
container?: HTMLElement;
|
|
13
|
+
variant: Variant;
|
|
10
14
|
};
|
|
@@ -9,22 +9,9 @@ export const SelectTrigger = styled(Select.Trigger, {
|
|
|
9
9
|
justifyContent: 'space-between',
|
|
10
10
|
alignItems: 'center',
|
|
11
11
|
cursor: 'pointer',
|
|
12
|
-
padding: '$5 $10',
|
|
13
|
-
border: 0,
|
|
14
12
|
outline: 0,
|
|
15
13
|
whiteSpace: 'nowrap',
|
|
16
|
-
borderRadius: '$sm',
|
|
17
|
-
backgroundColor: '$neutral300',
|
|
18
|
-
[`.${darkTheme} &`]: {
|
|
19
|
-
backgroundColor: '$neutral400',
|
|
20
|
-
},
|
|
21
14
|
width: '100%',
|
|
22
|
-
'&:hover': {
|
|
23
|
-
backgroundColor: '$info100',
|
|
24
|
-
[`.${darkTheme} &`]: {
|
|
25
|
-
backgroundColor: '$neutral',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
15
|
'& svg': {
|
|
29
16
|
transition: `all ${EXPANDABLE_QUOTE_TRANSITION_DURATION}ms ease`,
|
|
30
17
|
},
|
|
@@ -44,6 +31,35 @@ export const SelectTrigger = styled(Select.Trigger, {
|
|
|
44
31
|
},
|
|
45
32
|
},
|
|
46
33
|
},
|
|
34
|
+
variant: {
|
|
35
|
+
filled: {
|
|
36
|
+
border: 0,
|
|
37
|
+
borderRadius: '$sm',
|
|
38
|
+
padding: '$5 $10',
|
|
39
|
+
backgroundColor: '$neutral300',
|
|
40
|
+
[`.${darkTheme} &`]: {
|
|
41
|
+
backgroundColor: '$neutral400',
|
|
42
|
+
},
|
|
43
|
+
'&:hover': {
|
|
44
|
+
backgroundColor: '$info100',
|
|
45
|
+
[`.${darkTheme} &`]: {
|
|
46
|
+
backgroundColor: '$neutral',
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
outlined: {
|
|
51
|
+
backgroundColor: 'transparent',
|
|
52
|
+
padding: '$10',
|
|
53
|
+
border: '1px solid $neutral300',
|
|
54
|
+
borderRadius: '$xm',
|
|
55
|
+
'&:hover': {
|
|
56
|
+
borderColor: '$info300',
|
|
57
|
+
'& svg': {
|
|
58
|
+
color: '$secondary500',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
47
63
|
},
|
|
48
64
|
});
|
|
49
65
|
|
|
@@ -69,8 +85,12 @@ export const SelectItem = styled(Select.Item, {
|
|
|
69
85
|
|
|
70
86
|
'&:hover': {
|
|
71
87
|
backgroundColor: '$info100',
|
|
88
|
+
'& ._text': {
|
|
89
|
+
color: '$secondary500',
|
|
90
|
+
},
|
|
72
91
|
[`.${darkTheme} &`]: {
|
|
73
92
|
backgroundColor: '$neutral',
|
|
93
|
+
color: '$secondary500',
|
|
74
94
|
},
|
|
75
95
|
},
|
|
76
96
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
2
2
|
|
|
3
|
-
import { styled } from '../../theme';
|
|
3
|
+
import { darkTheme, styled } from '../../theme';
|
|
4
4
|
import { Typography } from '../Typography';
|
|
5
5
|
|
|
6
6
|
export const TooltipContent = styled(RadixTooltip.Content, {
|
|
@@ -17,9 +17,11 @@ export const TooltipContent = styled(RadixTooltip.Content, {
|
|
|
17
17
|
export const TooltipTypography = styled(Typography, {
|
|
18
18
|
borderRadius: '$md',
|
|
19
19
|
padding: '$5 $10',
|
|
20
|
-
boxShadow:
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
boxShadow: '5px 5px 10px 0px rgba(0, 0, 0, 0.10)',
|
|
21
|
+
backgroundColor: '$neutral200',
|
|
22
|
+
[`.${darkTheme} &`]: {
|
|
23
|
+
backgroundColor: '$neutral500',
|
|
24
|
+
},
|
|
23
25
|
});
|
|
24
26
|
|
|
25
27
|
export const TriggerContent = styled('div', {
|
|
@@ -45,6 +45,12 @@ export const MaxButton = styled(Button, {
|
|
|
45
45
|
$$color: '$colors$secondary800',
|
|
46
46
|
},
|
|
47
47
|
backgroundColor: '$$color',
|
|
48
|
+
'& ._typography': {
|
|
49
|
+
color: '$colors$secondary500',
|
|
50
|
+
[`.${darkTheme} &`]: {
|
|
51
|
+
color: '$colors$secondary400',
|
|
52
|
+
},
|
|
53
|
+
},
|
|
48
54
|
});
|
|
49
55
|
|
|
50
56
|
export const ValueTypography = styled('div', {
|