@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.
Files changed (149) 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.styles.d.ts.map +1 -1
  77. package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts +2 -0
  78. package/dist/widget/ui/src/components/ListItem/ListItem.types.d.ts.map +1 -1
  79. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.d.ts.map +1 -1
  80. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts +2 -2
  81. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.styles.d.ts.map +1 -1
  82. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.types.d.ts +0 -1
  83. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.types.d.ts.map +1 -1
  84. package/dist/widget/ui/src/components/Popover/Popover.styles.d.ts.map +1 -1
  85. package/dist/widget/ui/src/components/Select/Select.d.ts +1 -1
  86. package/dist/widget/ui/src/components/Select/Select.d.ts.map +1 -1
  87. package/dist/widget/ui/src/components/Select/Select.types.d.ts +8 -6
  88. package/dist/widget/ui/src/components/Select/Select.types.d.ts.map +1 -1
  89. package/dist/widget/ui/src/components/Select/select.styles.d.ts +1 -0
  90. package/dist/widget/ui/src/components/Select/select.styles.d.ts.map +1 -1
  91. package/dist/widget/ui/src/components/Tooltip/Tooltip.styles.d.ts.map +1 -1
  92. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  93. package/dist/widget/ui/src/icons/BorderRadius.d.ts.map +1 -1
  94. package/dist/widget/ui/src/icons/Font.d.ts.map +1 -1
  95. package/dist/widget/ui/src/icons/InProgress.d.ts.map +1 -1
  96. package/dist/widget/ui/src/icons/Language.d.ts.map +1 -1
  97. package/dist/widget/ui/src/icons/Widget.d.ts +5 -0
  98. package/dist/widget/ui/src/icons/Widget.d.ts.map +1 -0
  99. package/dist/widget/ui/src/icons/index.d.ts +12 -11
  100. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  101. package/package.json +2 -2
  102. package/src/components/Alert/Alert.tsx +6 -1
  103. package/src/components/ChainToken/ChainToken.constants.ts +1 -0
  104. package/src/components/ChainToken/ChainToken.styles.ts +4 -0
  105. package/src/components/Divider/Divider.styles.ts +8 -0
  106. package/src/components/Flags/Bengali.tsx +25 -0
  107. package/src/components/Flags/Chinese.tsx +28 -0
  108. package/src/components/Flags/Finland.tsx +31 -0
  109. package/src/components/Flags/German.tsx +26 -0
  110. package/src/components/Flags/Greece.tsx +31 -0
  111. package/src/components/Flags/Hindi.tsx +29 -0
  112. package/src/components/Flags/Indonesian.tsx +25 -0
  113. package/src/components/Flags/Italian.tsx +26 -0
  114. package/src/components/Flags/Malay.tsx +29 -0
  115. package/src/components/Flags/Netherlands.tsx +29 -0
  116. package/src/components/Flags/Poland.tsx +25 -0
  117. package/src/components/Flags/Russian.tsx +26 -0
  118. package/src/components/Flags/Swedish.tsx +31 -0
  119. package/src/components/Flags/Thai.tsx +32 -0
  120. package/src/components/Flags/Turkish.tsx +28 -0
  121. package/src/components/Flags/Ukrainian.tsx +25 -0
  122. package/src/components/Flags/Vietnamese.tsx +28 -0
  123. package/src/components/Flags/index.ts +41 -1
  124. package/src/components/FullExpandedQuote/FullExpandedQuote.Skeletons.tsx +1 -1
  125. package/src/components/FullExpandedQuote/FullExpandedQuote.styles.ts +15 -9
  126. package/src/components/FullExpandedQuote/FullExpandedQuote.tsx +10 -6
  127. package/src/components/FullExpandedQuote/FullExpandedQuote.types.ts +1 -0
  128. package/src/components/Header/Header.styles.ts +1 -1
  129. package/src/components/I18nManager/I18nManager.tsx +20 -0
  130. package/src/components/ListItem/ListItem.styles.ts +1 -0
  131. package/src/components/ListItem/ListItem.types.ts +2 -0
  132. package/src/components/ListItemButton/ListItemButton.styles.ts +14 -30
  133. package/src/components/ListItemButton/ListItemButton.tsx +10 -8
  134. package/src/components/ListItemButton/ListItemButton.types.ts +0 -1
  135. package/src/components/Popover/Popover.styles.ts +7 -1
  136. package/src/components/Select/Select.tsx +10 -7
  137. package/src/components/Select/Select.types.ts +10 -6
  138. package/src/components/Select/select.styles.ts +33 -13
  139. package/src/components/StepDetails/StepDetails.styles.ts +1 -1
  140. package/src/components/Tooltip/Tooltip.styles.ts +6 -4
  141. package/src/containers/SwapInput/SwapInput.styles.ts +6 -0
  142. package/src/containers/SwapInput/SwapInput.tsx +1 -1
  143. package/src/containers/SwapInput/TokenSection.styles.ts +1 -1
  144. package/src/icons/BorderRadius.tsx +10 -7
  145. package/src/icons/Font.tsx +17 -13
  146. package/src/icons/InProgress.tsx +13 -8
  147. package/src/icons/Language.tsx +44 -40
  148. package/src/icons/Widget.tsx +24 -0
  149. 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 { 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);
@@ -44,6 +44,7 @@ export const BaseListItem = styled('li', {
44
44
  alignItems: 'center',
45
45
  paddingLeft: '$10',
46
46
  overflow: 'hidden',
47
+ flexShrink: 0,
47
48
  },
48
49
  variants: {
49
50
  hasDivider: {
@@ -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', {