@rango-dev/ui 0.29.1-next.9 → 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.
Files changed (145) hide show
  1. package/dist/index.js +6 -6
  2. package/dist/index.js.map +4 -4
  3. package/dist/translations/de.d.ts +2 -0
  4. package/dist/translations/de.d.ts.map +1 -0
  5. package/dist/translations/el.d.ts +2 -0
  6. package/dist/translations/el.d.ts.map +1 -0
  7. package/dist/translations/en.d.ts.map +1 -1
  8. package/dist/translations/es.d.ts.map +1 -1
  9. package/dist/translations/fi.d.ts +2 -0
  10. package/dist/translations/fi.d.ts.map +1 -0
  11. package/dist/translations/fr.d.ts.map +1 -1
  12. package/dist/translations/it.d.ts +2 -0
  13. package/dist/translations/it.d.ts.map +1 -0
  14. package/dist/translations/ja.d.ts.map +1 -1
  15. package/dist/translations/nl.d.ts +2 -0
  16. package/dist/translations/nl.d.ts.map +1 -0
  17. package/dist/translations/pl.d.ts +2 -0
  18. package/dist/translations/pl.d.ts.map +1 -0
  19. package/dist/translations/pt.d.ts.map +1 -1
  20. package/dist/translations/ru.d.ts +2 -0
  21. package/dist/translations/ru.d.ts.map +1 -0
  22. package/dist/translations/sv.d.ts +2 -0
  23. package/dist/translations/sv.d.ts.map +1 -0
  24. package/dist/translations/uk.d.ts +2 -0
  25. package/dist/translations/uk.d.ts.map +1 -0
  26. package/dist/translations/zh.d.ts +2 -0
  27. package/dist/translations/zh.d.ts.map +1 -0
  28. package/dist/widget/ui/src/components/Alert/Alert.d.ts.map +1 -1
  29. package/dist/widget/ui/src/components/ChainToken/ChainToken.constants.d.ts.map +1 -1
  30. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts +1 -1
  31. package/dist/widget/ui/src/components/ChainToken/ChainToken.styles.d.ts.map +1 -1
  32. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts +1 -1
  33. package/dist/widget/ui/src/components/Divider/Divider.styles.d.ts.map +1 -1
  34. package/dist/widget/ui/src/components/Flags/Bengali.d.ts +4 -0
  35. package/dist/widget/ui/src/components/Flags/Bengali.d.ts.map +1 -0
  36. package/dist/widget/ui/src/components/Flags/Chinese.d.ts +4 -0
  37. package/dist/widget/ui/src/components/Flags/Chinese.d.ts.map +1 -0
  38. package/dist/widget/ui/src/components/Flags/Finland.d.ts +4 -0
  39. package/dist/widget/ui/src/components/Flags/Finland.d.ts.map +1 -0
  40. package/dist/widget/ui/src/components/Flags/German.d.ts +4 -0
  41. package/dist/widget/ui/src/components/Flags/German.d.ts.map +1 -0
  42. package/dist/widget/ui/src/components/Flags/Greece.d.ts +4 -0
  43. package/dist/widget/ui/src/components/Flags/Greece.d.ts.map +1 -0
  44. package/dist/widget/ui/src/components/Flags/Hindi.d.ts +4 -0
  45. package/dist/widget/ui/src/components/Flags/Hindi.d.ts.map +1 -0
  46. package/dist/widget/ui/src/components/Flags/Indonesian.d.ts +4 -0
  47. package/dist/widget/ui/src/components/Flags/Indonesian.d.ts.map +1 -0
  48. package/dist/widget/ui/src/components/Flags/Italian.d.ts +4 -0
  49. package/dist/widget/ui/src/components/Flags/Italian.d.ts.map +1 -0
  50. package/dist/widget/ui/src/components/Flags/Malay.d.ts +4 -0
  51. package/dist/widget/ui/src/components/Flags/Malay.d.ts.map +1 -0
  52. package/dist/widget/ui/src/components/Flags/Netherlands.d.ts +4 -0
  53. package/dist/widget/ui/src/components/Flags/Netherlands.d.ts.map +1 -0
  54. package/dist/widget/ui/src/components/Flags/Poland.d.ts +4 -0
  55. package/dist/widget/ui/src/components/Flags/Poland.d.ts.map +1 -0
  56. package/dist/widget/ui/src/components/Flags/Russian.d.ts +4 -0
  57. package/dist/widget/ui/src/components/Flags/Russian.d.ts.map +1 -0
  58. package/dist/widget/ui/src/components/Flags/Swedish.d.ts +4 -0
  59. package/dist/widget/ui/src/components/Flags/Swedish.d.ts.map +1 -0
  60. package/dist/widget/ui/src/components/Flags/Thai.d.ts +4 -0
  61. package/dist/widget/ui/src/components/Flags/Thai.d.ts.map +1 -0
  62. package/dist/widget/ui/src/components/Flags/Turkish.d.ts +4 -0
  63. package/dist/widget/ui/src/components/Flags/Turkish.d.ts.map +1 -0
  64. package/dist/widget/ui/src/components/Flags/Ukrainian.d.ts +4 -0
  65. package/dist/widget/ui/src/components/Flags/Ukrainian.d.ts.map +1 -0
  66. package/dist/widget/ui/src/components/Flags/Vietnamese.d.ts +4 -0
  67. package/dist/widget/ui/src/components/Flags/Vietnamese.d.ts.map +1 -0
  68. package/dist/widget/ui/src/components/Flags/index.d.ts +18 -1
  69. package/dist/widget/ui/src/components/Flags/index.d.ts.map +1 -1
  70. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.d.ts.map +1 -1
  71. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.styles.d.ts.map +1 -1
  72. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts +1 -0
  73. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts.map +1 -1
  74. package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts +10 -0
  75. package/dist/widget/ui/src/components/I18nManager/I18nManager.d.ts.map +1 -1
  76. package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts +2 -0
  77. package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts.map +1 -1
  78. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.d.ts.map +1 -1
  79. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +2 -2
  80. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  81. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.types.d.ts +0 -1
  82. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.types.d.ts.map +1 -1
  83. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
  84. package/dist/widget/ui/src/components/Select/Select.d.ts +1 -1
  85. package/dist/widget/ui/src/components/Select/Select.d.ts.map +1 -1
  86. package/dist/widget/ui/src/components/Select/Select.types.d.ts +8 -6
  87. package/dist/widget/ui/src/components/Select/Select.types.d.ts.map +1 -1
  88. package/dist/widget/ui/src/components/Select/select.styles.d.ts +1 -0
  89. package/dist/widget/ui/src/components/Select/select.styles.d.ts.map +1 -1
  90. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  91. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  92. package/dist/widget/ui/src/icons/BorderRadius.d.ts.map +1 -1
  93. package/dist/widget/ui/src/icons/Font.d.ts.map +1 -1
  94. package/dist/widget/ui/src/icons/Language.d.ts.map +1 -1
  95. package/dist/widget/ui/src/icons/Widget.d.ts +5 -0
  96. package/dist/widget/ui/src/icons/Widget.d.ts.map +1 -0
  97. package/dist/widget/ui/src/icons/index.d.ts +1 -0
  98. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  99. package/package.json +3 -3
  100. package/src/components/Alert/Alert.tsx +6 -1
  101. package/src/components/ChainToken/ChainToken.constants.ts +1 -0
  102. package/src/components/ChainToken/ChainToken.styles.ts +4 -0
  103. package/src/components/Divider/Divider.styles.ts +8 -0
  104. package/src/components/Flags/Bengali.tsx +25 -0
  105. package/src/components/Flags/Chinese.tsx +28 -0
  106. package/src/components/Flags/Finland.tsx +31 -0
  107. package/src/components/Flags/German.tsx +26 -0
  108. package/src/components/Flags/Greece.tsx +31 -0
  109. package/src/components/Flags/Hindi.tsx +29 -0
  110. package/src/components/Flags/Indonesian.tsx +25 -0
  111. package/src/components/Flags/Italian.tsx +26 -0
  112. package/src/components/Flags/Malay.tsx +29 -0
  113. package/src/components/Flags/Netherlands.tsx +29 -0
  114. package/src/components/Flags/Poland.tsx +25 -0
  115. package/src/components/Flags/Russian.tsx +26 -0
  116. package/src/components/Flags/Swedish.tsx +31 -0
  117. package/src/components/Flags/Thai.tsx +32 -0
  118. package/src/components/Flags/Turkish.tsx +28 -0
  119. package/src/components/Flags/Ukrainian.tsx +25 -0
  120. package/src/components/Flags/Vietnamese.tsx +28 -0
  121. package/src/components/Flags/index.ts +41 -1
  122. package/src/components/FullExpandedQuote/FullExpandedQuote.Skeletons.tsx +1 -1
  123. package/src/components/FullExpandedQuote/FullExpandedQuote.styles.ts +15 -9
  124. package/src/components/FullExpandedQuote/FullExpandedQuote.tsx +10 -6
  125. package/src/components/FullExpandedQuote/FullExpandedQuote.types.ts +1 -0
  126. package/src/components/Header/Header.styles.ts +1 -1
  127. package/src/components/I18nManager/I18nManager.tsx +20 -0
  128. package/src/components/ListItem/ListItem.types.ts +2 -0
  129. package/src/components/ListItemButton/ListItemButton.styles.ts +14 -30
  130. package/src/components/ListItemButton/ListItemButton.tsx +10 -8
  131. package/src/components/ListItemButton/ListItemButton.types.ts +0 -1
  132. package/src/components/Popover/Popover.styles.ts +7 -1
  133. package/src/components/Select/Select.tsx +10 -7
  134. package/src/components/Select/Select.types.ts +10 -6
  135. package/src/components/Select/select.styles.ts +33 -13
  136. package/src/components/StepDetails/StepDetails.styles.ts +1 -1
  137. package/src/components/Tooltip/Tooltip.styles.ts +6 -4
  138. package/src/containers/SwapInput/SwapInput.styles.ts +6 -0
  139. package/src/containers/SwapInput/SwapInput.tsx +1 -1
  140. package/src/containers/SwapInput/TokenSection.styles.ts +1 -1
  141. package/src/icons/BorderRadius.tsx +10 -7
  142. package/src/icons/Font.tsx +17 -13
  143. package/src/icons/Language.tsx +44 -40
  144. package/src/icons/Widget.tsx +24 -0
  145. package/src/icons/index.ts +1 -0
@@ -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 { English, Spanish, Japanese, French, Portuguese };
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
+ };
@@ -53,7 +53,7 @@ export function SkeletonItemLeft() {
53
53
  <div
54
54
  style={{
55
55
  display: 'flex',
56
- alignItems: 'end',
56
+ alignItems: 'center',
57
57
  }}>
58
58
  <Skeleton variant="rounded" width={42} height={49} />
59
59
  </div>
@@ -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: '85px',
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: '$18',
113
- height: '$18',
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: '$8',
131
- height: '$8',
132
- bottom: -2,
133
- right: -2,
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: '$4',
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
- selected,
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="small"
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={15}
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={6} color="error" />
128
+ <ErrorIcon size={8} color="error" />
127
129
  ) : (
128
- <WarningIcon size={6} color="warning" />
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="large" variant="body">
165
+ <Typography size="xmedium" variant="title">
162
166
  {steps[numberOfSteps - 1].to.token.displayName}
163
167
  </Typography>
164
168
  </Tooltip>
@@ -10,6 +10,7 @@ type BaseProps = {
10
10
  tooltipContainer?: HTMLElement;
11
11
  onClick?: () => void;
12
12
  selected?: boolean;
13
+ feeWarning?: boolean;
13
14
  };
14
15
 
15
16
  export type DataLoadedProps = {
@@ -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);
@@ -5,5 +5,7 @@ export type ListItemProps = {
5
5
  end?: React.ReactNode;
6
6
  as?: 'div' | 'li';
7
7
  onClick?: () => void;
8
+ onKeyUp?: React.KeyboardEventHandler<HTMLLIElement>;
8
9
  hasDivider?: boolean;
10
+ tabIndex?: number;
9
11
  };
@@ -1,26 +1,10 @@
1
1
  import { darkTheme, styled } from '../../theme';
2
+ import { ListItem } from '../ListItem/ListItem';
2
3
 
3
- export const BaseListItemButton = styled('button', {
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
- variants: {
34
- hasDivider: {
35
- true: {
36
- borderBottom: '1px solid',
37
- $$color: '$colors$neutral300',
38
- [`.${darkTheme} &`]: {
39
- $$color: '$colors$neutral400',
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, style, hasDivider, selected, ...restProps } = props;
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
- style={style}>
22
- <ListItem {...restProps} />
23
- </BaseListItemButton>
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
 
@@ -5,6 +5,5 @@ export type ListItemButtonProps = Omit<ListItemProps, 'onClick'> & {
5
5
  id: string;
6
6
  onClick: (id: string) => void;
7
7
  style?: CSSProperties;
8
- hasDivider?: boolean;
9
8
  selected?: boolean;
10
9
  };
@@ -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?.value} open={open}>
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={value?.label}>
42
+ aria-label={selectedLabel}>
40
43
  <Select.Value>
41
44
  <Typography variant="body" size="small">
42
- {value?.label}
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?.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: string;
1
+ type Item<T> = {
2
+ value: T;
3
3
  label: string;
4
4
  };
5
- export type PropTypes = {
6
- options: Item[];
7
- handleItemClick?: (item: Item) => void;
8
- value: Item;
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
  });
@@ -69,7 +69,7 @@ export const Alerts = styled('div', {
69
69
  });
70
70
 
71
71
  export const DashedLine = styled('div', {
72
- borderLeft: '1px dashed black',
72
+ borderLeft: '1px dashed $foreground',
73
73
  minHeight: '64px',
74
74
  margin: '0 11.5px',
75
75
  alignSelf: 'stretch',
@@ -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
- 'inset 0 0 0.5px 1px rgba(255, 255, 255, 0.075), 0 0 0 1px rgba(0, 0, 0, 0.05), 0 0.3px 0.4px rgba(0, 0, 0, 0.02), 0.9px 1.5px rgba(0, 0, 0, 0.045), 0 3.5px 6px rgba(0, 0, 0, 0.09)',
22
- backgroundColor: '$neutral100',
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', {
@@ -58,7 +58,7 @@ export function SwapInput(props: SwapInputProps) {
58
58
  variant="default"
59
59
  size="xsmall"
60
60
  onClick={props.onSelectMaxBalance}>
61
- <Typography variant="body" size="xsmall" color="secondary500">
61
+ <Typography variant="body" size="xsmall">
62
62
  {i18n.t('Max')}
63
63
  </Typography>
64
64
  </MaxButton>
@@ -24,7 +24,7 @@ export const Container = styled(Button, {
24
24
  '&:hover': {
25
25
  $$color: '$colors$info100',
26
26
  [`.${darkTheme} &`]: {
27
- $$color: '$colors$neutral400',
27
+ $$color: '$colors$neutral100',
28
28
  },
29
29
  backgroundColor: '$$color !important',
30
30
  },
@@ -8,13 +8,16 @@ function SvgBorderRadius(props: SvgIconPropsWithChildren) {
8
8
  return createElement(
9
9
  SvgIcon,
10
10
  props,
11
- <svg viewBox="0 0 19 18" xmlns="http://www.w3.org/2000/svg">
12
- <path
13
- fillRule="evenodd"
14
- clipRule="evenodd"
15
- d="M0.489258 4.74652C0.489258 2.15304 2.592 0 5.24997 0C5.53793 0 5.77138 0.22074 5.77138 0.493036C5.77138 0.765333 5.53793 0.986072 5.24997 0.986072C3.22533 0.986072 1.53208 2.64173 1.53208 4.74652C1.53208 5.01881 1.29864 5.23955 1.01067 5.23955C0.722702 5.23955 0.489258 5.01881 0.489258 4.74652ZM13.2071 0.493036C13.2071 0.22074 13.4406 0 13.7286 0C16.3865 0 18.4893 2.15304 18.4893 4.74652C18.4893 5.01882 18.2558 5.23956 17.9678 5.23956C17.6799 5.23956 17.4464 5.01882 17.4464 4.74652C17.4464 2.64173 15.7532 0.986072 13.7286 0.986072C13.4406 0.986072 13.2071 0.765333 13.2071 0.493036ZM2.60885 4.74638C2.60885 3.32747 3.76259 2.1266 5.24991 2.1266L13.7285 2.1266C15.2158 2.1266 16.3696 3.32747 16.3696 4.74638L16.3696 13.2533C16.3696 14.6722 15.2158 15.8731 13.7285 15.8731L5.2499 15.8731C3.76259 15.8731 2.60885 14.6722 2.60885 13.2533L2.60885 4.74638ZM5.24991 3.11267C4.39592 3.11267 3.65167 3.81615 3.65167 4.74638L3.65167 13.2533C3.65167 14.1836 4.39592 14.887 5.2499 14.887L13.7285 14.887C14.5825 14.887 15.3267 14.1836 15.3267 13.2533L15.3267 4.74638C15.3267 3.81616 14.5825 3.11267 13.7285 3.11267L5.24991 3.11267ZM1.01067 12.7604C1.29864 12.7604 1.53208 12.9812 1.53208 13.2535C1.53208 15.3583 3.22533 17.0139 5.24996 17.0139C5.53793 17.0139 5.77138 17.2347 5.77138 17.507C5.77138 17.7793 5.53793 18 5.24996 18C2.592 18 0.489258 15.847 0.489258 13.2535C0.489258 12.9812 0.722702 12.7604 1.01067 12.7604ZM17.9678 12.7604C18.2558 12.7604 18.4893 12.9812 18.4893 13.2535C18.4893 15.847 16.3865 18 13.7285 18C13.4406 18 13.2071 17.7793 13.2071 17.507C13.2071 17.2347 13.4406 17.0139 13.7285 17.0139C15.7532 17.0139 17.4464 15.3583 17.4464 13.2535C17.4464 12.9812 17.6799 12.7604 17.9678 12.7604Z"
16
- fill="#727272"
17
- />
11
+ <svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
12
+ <g id="Icons">
13
+ <path
14
+ id="Border-Radius"
15
+ fillRule="evenodd"
16
+ clipRule="evenodd"
17
+ d="M3.48926 7.74652C3.48926 5.15304 5.592 3 8.24997 3C8.53793 3 8.77138 3.22074 8.77138 3.49304C8.77138 3.76533 8.53793 3.98607 8.24997 3.98607C6.22533 3.98607 4.53208 5.64173 4.53208 7.74652C4.53208 8.01881 4.29864 8.23955 4.01067 8.23955C3.7227 8.23955 3.48926 8.01881 3.48926 7.74652ZM16.2071 3.49304C16.2071 3.22074 16.4406 3 16.7286 3C19.3865 3 21.4893 5.15304 21.4893 7.74652C21.4893 8.01882 21.2558 8.23956 20.9678 8.23956C20.6799 8.23956 20.4464 8.01882 20.4464 7.74652C20.4464 5.64173 18.7532 3.98607 16.7286 3.98607C16.4406 3.98607 16.2071 3.76533 16.2071 3.49304ZM5.60885 7.74638C5.60885 6.32747 6.76259 5.1266 8.24991 5.1266L16.7285 5.1266C18.2158 5.1266 19.3696 6.32747 19.3696 7.74638L19.3696 16.2533C19.3696 17.6722 18.2158 18.8731 16.7285 18.8731L8.2499 18.8731C6.76259 18.8731 5.60885 17.6722 5.60885 16.2533L5.60885 7.74638ZM8.24991 6.11267C7.39592 6.11267 6.65167 6.81615 6.65167 7.74638L6.65167 16.2533C6.65167 17.1836 7.39592 17.887 8.2499 17.887L16.7285 17.887C17.5825 17.887 18.3267 17.1836 18.3267 16.2533L18.3267 7.74638C18.3267 6.81616 17.5825 6.11267 16.7285 6.11267L8.24991 6.11267ZM4.01067 15.7604C4.29864 15.7604 4.53208 15.9812 4.53208 16.2535C4.53208 18.3583 6.22533 20.0139 8.24996 20.0139C8.53793 20.0139 8.77138 20.2347 8.77138 20.507C8.77138 20.7793 8.53793 21 8.24996 21C5.592 21 3.48926 18.847 3.48926 16.2535C3.48926 15.9812 3.7227 15.7604 4.01067 15.7604ZM20.9678 15.7604C21.2558 15.7604 21.4893 15.9812 21.4893 16.2535C21.4893 18.847 19.3865 21 16.7285 21C16.4406 21 16.2071 20.7793 16.2071 20.507C16.2071 20.2347 16.4406 20.0139 16.7285 20.0139C18.7532 20.0139 20.4464 18.3583 20.4464 16.2535C20.4464 15.9812 20.6799 15.7604 20.9678 15.7604Z"
18
+ fill="#727272"
19
+ />
20
+ </g>
18
21
  </svg>
19
22
  );
20
23
  }