@rango-dev/ui 0.46.2-next.9 → 0.47.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 (135) hide show
  1. package/dist/index.js +1 -1
  2. package/dist/index.js.map +3 -3
  3. package/dist/translations/af.d.ts.map +1 -1
  4. package/dist/translations/ar.d.ts.map +1 -1
  5. package/dist/translations/bn.d.ts.map +1 -1
  6. package/dist/translations/ca.d.ts.map +1 -1
  7. package/dist/translations/da.d.ts.map +1 -1
  8. package/dist/translations/de.d.ts.map +1 -1
  9. package/dist/translations/el.d.ts.map +1 -1
  10. package/dist/translations/en.d.ts.map +1 -1
  11. package/dist/translations/es.d.ts.map +1 -1
  12. package/dist/translations/fi.d.ts.map +1 -1
  13. package/dist/translations/fil.d.ts.map +1 -1
  14. package/dist/translations/fr.d.ts.map +1 -1
  15. package/dist/translations/hi.d.ts.map +1 -1
  16. package/dist/translations/hu.d.ts.map +1 -1
  17. package/dist/translations/id.d.ts.map +1 -1
  18. package/dist/translations/it.d.ts.map +1 -1
  19. package/dist/translations/ja.d.ts.map +1 -1
  20. package/dist/translations/ko.d.ts.map +1 -1
  21. package/dist/translations/lt.d.ts.map +1 -1
  22. package/dist/translations/ms.d.ts.map +1 -1
  23. package/dist/translations/nl.d.ts.map +1 -1
  24. package/dist/translations/pl.d.ts.map +1 -1
  25. package/dist/translations/pt.d.ts.map +1 -1
  26. package/dist/translations/ru.d.ts.map +1 -1
  27. package/dist/translations/sk.d.ts.map +1 -1
  28. package/dist/translations/sr.d.ts.map +1 -1
  29. package/dist/translations/sv.d.ts.map +1 -1
  30. package/dist/translations/sw.d.ts.map +1 -1
  31. package/dist/translations/th.d.ts.map +1 -1
  32. package/dist/translations/tr.d.ts.map +1 -1
  33. package/dist/translations/uk.d.ts.map +1 -1
  34. package/dist/translations/ur.d.ts.map +1 -1
  35. package/dist/translations/vi.d.ts.map +1 -1
  36. package/dist/translations/zh-CN.d.ts.map +1 -1
  37. package/dist/translations/zh-TW.d.ts.map +1 -1
  38. package/dist/ui.build.json +1 -1
  39. package/dist/widget/ui/src/components/Alert/Alert.d.ts.map +1 -1
  40. package/dist/widget/ui/src/components/Alert/Alert.types.d.ts +1 -0
  41. package/dist/widget/ui/src/components/Alert/Alert.types.d.ts.map +1 -1
  42. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.types.d.ts +1 -0
  43. package/dist/widget/ui/src/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +1 -1
  44. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.d.ts.map +1 -1
  45. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts +2 -0
  46. package/dist/widget/ui/src/components/FullExpandedQuote/FullExpandedQuote.types.d.ts.map +1 -1
  47. package/dist/widget/ui/src/components/IconButton/IconButton.d.ts.map +1 -1
  48. package/dist/widget/ui/src/components/IconButton/IconButton.types.d.ts +1 -0
  49. package/dist/widget/ui/src/components/IconButton/IconButton.types.d.ts.map +1 -1
  50. package/dist/widget/ui/src/components/ListItemButton/ListItemButton.d.ts.map +1 -1
  51. package/dist/widget/ui/src/components/MessageBox/MessageBox.types.d.ts +1 -0
  52. package/dist/widget/ui/src/components/MessageBox/MessageBox.types.d.ts.map +1 -1
  53. package/dist/widget/ui/src/components/Modal/Modal.d.ts.map +1 -1
  54. package/dist/widget/ui/src/components/Modal/Modal.types.d.ts +1 -0
  55. package/dist/widget/ui/src/components/Modal/Modal.types.d.ts.map +1 -1
  56. package/dist/widget/ui/src/components/Select/Select.d.ts.map +1 -1
  57. package/dist/widget/ui/src/components/Select/Select.types.d.ts +1 -0
  58. package/dist/widget/ui/src/components/Select/Select.types.d.ts.map +1 -1
  59. package/dist/widget/ui/src/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -1
  60. package/dist/widget/ui/src/components/StepDetails/StepDetails.d.ts.map +1 -1
  61. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts +1 -0
  62. package/dist/widget/ui/src/components/StepDetails/StepDetails.types.d.ts.map +1 -1
  63. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.d.ts.map +1 -1
  64. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts +1 -0
  65. package/dist/widget/ui/src/components/SwapListItem/SwapListItem.types.d.ts.map +1 -1
  66. package/dist/widget/ui/src/components/TextField/TextField.d.ts +1 -0
  67. package/dist/widget/ui/src/components/TextField/TextField.d.ts.map +1 -1
  68. package/dist/widget/ui/src/components/TextField/TextField.types.d.ts +1 -0
  69. package/dist/widget/ui/src/components/TextField/TextField.types.d.ts.map +1 -1
  70. package/dist/widget/ui/src/components/Toast/Toast.d.ts.map +1 -1
  71. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.d.ts.map +1 -1
  72. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts +1 -0
  73. package/dist/widget/ui/src/components/TokenAmount/TokenAmount.types.d.ts.map +1 -1
  74. package/dist/widget/ui/src/components/Typography/Typography.d.ts +1 -1
  75. package/dist/widget/ui/src/components/Typography/Typography.d.ts.map +1 -1
  76. package/dist/widget/ui/src/components/Typography/Typography.types.d.ts +1 -0
  77. package/dist/widget/ui/src/components/Typography/Typography.types.d.ts.map +1 -1
  78. package/dist/widget/ui/src/components/Wallet/ClickableWallet.d.ts.map +1 -1
  79. package/dist/widget/ui/src/components/Wallet/SelectableWallet.d.ts.map +1 -1
  80. package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts +1 -0
  81. package/dist/widget/ui/src/components/Wallet/Wallet.types.d.ts.map +1 -1
  82. package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.d.ts.map +1 -1
  83. package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.types.d.ts +1 -0
  84. package/dist/widget/ui/src/containers/ConnectWalletsModal/ConnectWalletsModal.types.d.ts.map +1 -1
  85. package/dist/widget/ui/src/containers/Notifications/Notifications.d.ts.map +1 -1
  86. package/dist/widget/ui/src/containers/Notifications/Notifications.types.d.ts +1 -0
  87. package/dist/widget/ui/src/containers/Notifications/Notifications.types.d.ts.map +1 -1
  88. package/dist/widget/ui/src/containers/SwapInput/SwapInput.d.ts.map +1 -1
  89. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts +1 -0
  90. package/dist/widget/ui/src/containers/SwapInput/SwapInput.styles.d.ts.map +1 -1
  91. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts +1 -0
  92. package/dist/widget/ui/src/containers/SwapInput/SwapInput.types.d.ts.map +1 -1
  93. package/dist/widget/ui/src/containers/SwapInput/TokenSection.d.ts.map +1 -1
  94. package/dist/widget/ui/src/containers/SwapInput/TokenSection.types.d.ts +1 -0
  95. package/dist/widget/ui/src/containers/SwapInput/TokenSection.types.d.ts.map +1 -1
  96. package/package.json +3 -3
  97. package/src/components/Alert/Alert.tsx +2 -0
  98. package/src/components/Alert/Alert.types.ts +1 -0
  99. package/src/components/BlockchainsChip/BlockchainsChip.tsx +2 -2
  100. package/src/components/BlockchainsChip/BlockchainsChip.types.ts +1 -0
  101. package/src/components/FullExpandedQuote/FullExpandedQuote.tsx +2 -0
  102. package/src/components/FullExpandedQuote/FullExpandedQuote.types.ts +2 -0
  103. package/src/components/IconButton/IconButton.tsx +3 -2
  104. package/src/components/IconButton/IconButton.types.ts +1 -0
  105. package/src/components/ListItemButton/ListItemButton.tsx +1 -0
  106. package/src/components/MessageBox/DefaultMessageBox.tsx +2 -2
  107. package/src/components/MessageBox/MessageBox.types.tsx +1 -0
  108. package/src/components/Modal/Modal.tsx +6 -1
  109. package/src/components/Modal/Modal.types.ts +1 -0
  110. package/src/components/Select/Select.tsx +4 -2
  111. package/src/components/Select/Select.types.ts +1 -0
  112. package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +3 -0
  113. package/src/components/StepDetails/StepDetails.tsx +2 -0
  114. package/src/components/StepDetails/StepDetails.types.ts +1 -0
  115. package/src/components/SwapListItem/SwapListItem.tsx +2 -1
  116. package/src/components/SwapListItem/SwapListItem.types.ts +1 -0
  117. package/src/components/Tabs/Tabs.tsx +1 -1
  118. package/src/components/TextField/TextField.tsx +1 -0
  119. package/src/components/TextField/TextField.types.tsx +1 -0
  120. package/src/components/Toast/Toast.tsx +3 -0
  121. package/src/components/TokenAmount/TokenAmount.tsx +4 -1
  122. package/src/components/TokenAmount/TokenAmount.types.ts +1 -0
  123. package/src/components/Typography/Typography.tsx +1 -0
  124. package/src/components/Typography/Typography.types.tsx +1 -0
  125. package/src/components/Wallet/ClickableWallet.tsx +1 -0
  126. package/src/components/Wallet/SelectableWallet.tsx +2 -0
  127. package/src/components/Wallet/Wallet.types.ts +1 -0
  128. package/src/containers/ConnectWalletsModal/ConnectWalletsModal.tsx +2 -1
  129. package/src/containers/ConnectWalletsModal/ConnectWalletsModal.types.ts +1 -0
  130. package/src/containers/Notifications/Notifications.tsx +7 -1
  131. package/src/containers/Notifications/Notifications.types.ts +1 -0
  132. package/src/containers/SwapInput/SwapInput.tsx +3 -0
  133. package/src/containers/SwapInput/SwapInput.types.ts +1 -0
  134. package/src/containers/SwapInput/TokenSection.tsx +6 -1
  135. package/src/containers/SwapInput/TokenSection.types.ts +1 -0
@@ -10,10 +10,10 @@ import { Container, Description, IconHighlight } from './MessageBox.styles.js';
10
10
  import StatusIcon from './StatusIcon.js';
11
11
 
12
12
  export function MessageBox(props: PropsWithChildren<PropTypes>) {
13
- const { type, title, description, children, icon } = props;
13
+ const { type, title, description, children, icon, id } = props;
14
14
 
15
15
  return (
16
- <Container>
16
+ <Container id={id}>
17
17
  <IconHighlight type={type}>
18
18
  {icon || <StatusIcon type={type} />}
19
19
  </IconHighlight>
@@ -9,5 +9,6 @@ export interface PropTypes {
9
9
  type: MessageType;
10
10
  title: string;
11
11
  description?: string | ReactNode;
12
+ id?: string;
12
13
  icon?: ReactNode;
13
14
  }
@@ -32,6 +32,7 @@ export function Modal(props: PropsWithChildren<ModalPropTypes>) {
32
32
  prefix,
33
33
  header,
34
34
  dismissible = true,
35
+ id,
35
36
  children,
36
37
  suffix,
37
38
  footer,
@@ -116,6 +117,7 @@ export function Modal(props: PropsWithChildren<ModalPropTypes>) {
116
117
  return createPortal(
117
118
  <BackDrop active={active} onClick={handleBackDropClick} css={styles?.root}>
118
119
  <ModalContainer
120
+ id={id}
119
121
  active={active}
120
122
  css={styles?.container}
121
123
  anchor={anchor}
@@ -131,7 +133,10 @@ export function Modal(props: PropsWithChildren<ModalPropTypes>) {
131
133
  <Flex>
132
134
  {suffix}
133
135
  {dismissible && hasCloseIcon && (
134
- <IconButton onClick={onClose} variant="ghost">
136
+ <IconButton
137
+ id={`${id}-close-btn`}
138
+ onClick={onClose}
139
+ variant="ghost">
135
140
  <CloseIcon color="gray" size={14} />
136
141
  </IconButton>
137
142
  )}
@@ -11,6 +11,7 @@ export interface ModalPropTypes {
11
11
  onClose: () => void;
12
12
  onExit?: () => void;
13
13
  anchor?: BaseAnchor;
14
+ id?: string;
14
15
  dismissible?: boolean;
15
16
  header?: React.ReactNode;
16
17
  prefix?: React.ReactNode;
@@ -11,7 +11,8 @@ import { SelectContent, SelectItem, SelectTrigger } from './Select.styles.js';
11
11
  export function SelectComponent<T extends string>(props: SelectPropTypes<T>) {
12
12
  const [open, setOpen] = useState(false);
13
13
  const selectRef = useRef<HTMLDivElement>(null);
14
- const { options, value, container, handleItemClick, variant, styles } = props;
14
+ const { options, value, container, handleItemClick, variant, id, styles } =
15
+ props;
15
16
  const handleToggle = () => {
16
17
  setOpen((prev) => !prev);
17
18
  };
@@ -43,6 +44,7 @@ export function SelectComponent<T extends string>(props: SelectPropTypes<T>) {
43
44
  <div ref={selectRef}>
44
45
  <Select.Root value={value} open={open}>
45
46
  <SelectTrigger
47
+ id={id}
46
48
  variant={variant}
47
49
  onKeyDown={(event) => event.key === 'Enter' && handleToggle()}
48
50
  onClick={handleToggle}
@@ -69,7 +71,7 @@ export function SelectComponent<T extends string>(props: SelectPropTypes<T>) {
69
71
  {options.map((option) => (
70
72
  <SelectItem
71
73
  onClick={() => {
72
- handleItemClick && handleItemClick(option);
74
+ handleItemClick?.(option);
73
75
  handleToggle();
74
76
  }}
75
77
  key={option.value}
@@ -12,6 +12,7 @@ export type SelectPropTypes<T> = {
12
12
  handleItemClick?: (item: Item<T>) => void;
13
13
  value: string;
14
14
  container?: HTMLElement;
15
+ id: string;
15
16
  variant: Variant;
16
17
  styles?: {
17
18
  trigger?: Stitches.CSS;
@@ -43,6 +43,9 @@ export function SelectableCategoryList(props: SelectableCategoryListPropTypes) {
43
43
  return (
44
44
  hasBlockchain && (
45
45
  <BlockchainsChip
46
+ className={
47
+ 'widget-selectable-category-list-blockchains-chip-btn'
48
+ }
46
49
  selected={category === blockchainCategory}
47
50
  key={blockchainCategory}
48
51
  onClick={() => setCategory(blockchainCategory)}>
@@ -36,6 +36,7 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
36
36
  isFocused,
37
37
  tabIndex,
38
38
  tooltipContainer,
39
+ className,
39
40
  } = props;
40
41
 
41
42
  const { from, to, swapper } = step;
@@ -66,6 +67,7 @@ const StepDetailsComponent = forwardRef<HTMLDivElement, StepDetailsProps>(
66
67
  type={type}
67
68
  state={state}
68
69
  ref={containerRef}
70
+ className={className}
69
71
  tabIndex={tabIndex}>
70
72
  {type === 'quote-details' && (
71
73
  <div className={swapperItemStyles()}>
@@ -39,5 +39,6 @@ export type StepDetailsProps = {
39
39
  state?: 'default' | 'in-progress' | 'completed' | 'warning' | 'error';
40
40
  isFocused?: boolean;
41
41
  tabIndex?: number;
42
+ className: string;
42
43
  tooltipContainer?: HTMLElement;
43
44
  };
@@ -42,9 +42,10 @@ export function SwapListItem(props: PropsWithChildren<SwapListItemPropTypes>) {
42
42
  swapTokenData,
43
43
  tooltipContainer,
44
44
  currentStep,
45
+ className,
45
46
  } = props;
46
47
  return (
47
- <Main onClick={onClick.bind(null, requestId)}>
48
+ <Main onClick={onClick.bind(null, requestId)} className={className}>
48
49
  <Container>
49
50
  <Header>
50
51
  <Date>
@@ -9,6 +9,7 @@ export interface SwapListItemProps {
9
9
  onClick: (requestId: string) => void;
10
10
  swapTokenData: SwapTokenData;
11
11
  onlyShowTime?: boolean;
12
+ className: string;
12
13
  tooltipContainer?: HTMLElement;
13
14
  currentStep: PendingSwapStep | null;
14
15
  }
@@ -156,7 +156,7 @@ export function TabsComponent(props: TabsPropTypes) {
156
156
  }, [containerRef.current, showArrows, currentIndex]);
157
157
 
158
158
  return (
159
- <Container hasPadding={scrollButtons && showArrows}>
159
+ <Container hasPadding={scrollButtons && showArrows} className={className}>
160
160
  {scrollable && showArrows && scrollButtons && (
161
161
  <>
162
162
  <ArrowLeft
@@ -66,6 +66,7 @@ function TextFieldComponent(
66
66
  className="_text-field">
67
67
  {prefix || null}
68
68
  <Input
69
+ autoComplete="off"
69
70
  {...inputAttributes}
70
71
  onKeyDown={handleKeyDown}
71
72
  onPaste={handlePaste}
@@ -18,6 +18,7 @@ export type TextFieldPropTypes = {
18
18
  suffix?: React.ReactNode;
19
19
  size?: BaseSizes;
20
20
  variant?: BaseVariants;
21
+ id: string;
21
22
  fullWidth?: boolean;
22
23
  labelProps?: TypographyPropTypes;
23
24
  style?: Stitches.CSS;
@@ -92,9 +92,12 @@ export const Toast = (props: ToastPropTypes) => {
92
92
  type={type}
93
93
  variant="alarm"
94
94
  titleAlign="left"
95
+ id={id.toString()}
95
96
  action={
96
97
  hasCloseIcon ? (
98
+ // eslint-disable-next-line jsx-id-attribute-enforcement/missing-ids
97
99
  <IconButton
100
+ className="toast-close-icon-btn"
98
101
  variant="ghost"
99
102
  size="xsmall"
100
103
  onClick={handleClose}>
@@ -18,7 +18,10 @@ import {
18
18
 
19
19
  export function TokenAmount(props: PropTypes) {
20
20
  return (
21
- <Container direction={props.direction} centerAlign={props.centerAlign}>
21
+ <Container
22
+ direction={props.direction}
23
+ centerAlign={props.centerAlign}
24
+ id={props.id}>
22
25
  <div className={tokenAmountStyles()}>
23
26
  <ChainToken
24
27
  chainImage={props.chain.image}
@@ -4,6 +4,7 @@ import type { PriceImpactPropTypes } from '../PriceImpact/PriceImpact.types.js';
4
4
  type BaseProps = Pick<SwapInputPropTypes, 'token' | 'price'> & {
5
5
  chain: Pick<SwapInputPropTypes['chain'], 'image'>;
6
6
  direction?: 'vertical' | 'horizontal';
7
+ id: string;
7
8
  centerAlign?: boolean;
8
9
  label?: string;
9
10
  tooltipContainer?: HTMLElement;
@@ -7,6 +7,7 @@ import { TypographyContainer } from './Typography.styles.js';
7
7
 
8
8
  export function Typography({
9
9
  children,
10
+ id,
10
11
  className,
11
12
  color,
12
13
  ...props
@@ -11,6 +11,7 @@ export interface TypographyPropTypes {
11
11
  size: BaseSizes;
12
12
  align?: BaseAlign;
13
13
  noWrap?: boolean;
14
+ id?: string;
14
15
  className?: string;
15
16
  style?: Stitches.CSSProperties;
16
17
  color?: string;
@@ -51,6 +51,7 @@ function Wallet(props: WalletPropTypes) {
51
51
 
52
52
  return wrapComponentWithTooltip(
53
53
  <WalletButton
54
+ className={'widget-clickable-wallet-btn'}
54
55
  disabled={props.state == WalletState.CONNECTING || disabled}
55
56
  onClick={() => {
56
57
  if (props.state === WalletState.NOT_INSTALLED) {
@@ -19,6 +19,7 @@ export function SelectableWallet(props: SelectablePropTypes) {
19
19
  image,
20
20
  onClick,
21
21
  selected,
22
+ id,
22
23
  description,
23
24
  descriptionColor,
24
25
  disabled = false,
@@ -27,6 +28,7 @@ export function SelectableWallet(props: SelectablePropTypes) {
27
28
  return (
28
29
  <SelectableWalletButton
29
30
  selected={selected}
31
+ id={id}
30
32
  disabled={props.state == WalletState.CONNECTING || disabled}
31
33
  onClick={() => {
32
34
  if (props.state === WalletState.NOT_INSTALLED) {
@@ -52,5 +52,6 @@ export interface WalletPropTypes {
52
52
  export type SelectablePropTypes = WalletPropTypes & {
53
53
  selected: boolean;
54
54
  disabled?: boolean;
55
+ id: string;
55
56
  descriptionColor: string;
56
57
  };
@@ -8,13 +8,14 @@ import { Modal, Wallet } from '../../components/index.js';
8
8
  import { ModalContent } from './ConnectWalletsModal.styles.js';
9
9
 
10
10
  export function ConnectWalletsModal(props: ConnectWalletsModalPropTypes) {
11
- const { open, list, onSelect, onClose } = props;
11
+ const { open, list, onSelect, onClose, id } = props;
12
12
 
13
13
  return (
14
14
  <Modal
15
15
  title={i18n.t('Connect Wallets')}
16
16
  open={open}
17
17
  onClose={onClose}
18
+ id={id}
18
19
  styles={{
19
20
  container: { width: '75%', maxWidth: '30rem', height: '60%' },
20
21
  }}>
@@ -5,6 +5,7 @@ export interface ConnectWalletsModalPropTypes {
5
5
  open: boolean;
6
6
  list: WalletInfo[];
7
7
  onSelect: (walletType: WalletType) => void;
8
+ id: string;
8
9
  onClose: () => void;
9
10
  error?: string;
10
11
  }
@@ -25,6 +25,7 @@ export function Notifications(props: PropTypes) {
25
25
  onClickItem,
26
26
  onClearAll,
27
27
  containerStyles,
28
+ id,
28
29
  } = props;
29
30
  return (
30
31
  <Container equalPadding={list.length === 0} css={containerStyles}>
@@ -34,7 +35,11 @@ export function Notifications(props: PropTypes) {
34
35
  <Typography variant="label" size="medium">
35
36
  {i18n.t('Notifications')}
36
37
  </Typography>
37
- <ClearAllButton variant="ghost" size="xsmall" onClick={onClearAll}>
38
+ <ClearAllButton
39
+ id={`${id}-clear-all-btn`}
40
+ variant="ghost"
41
+ size="xsmall"
42
+ onClick={onClearAll}>
38
43
  <Typography variant="body" size="xsmall" color="neutral700">
39
44
  {i18n.t('Clear all')}
40
45
  </Typography>
@@ -61,6 +66,7 @@ export function Notifications(props: PropTypes) {
61
66
  <React.Fragment key={requestId}>
62
67
  {index > 0 && <Divider size={4} />}
63
68
  <ListItem
69
+ className={`${id}-list-item`}
64
70
  onClick={() => onClickItem(requestId)}
65
71
  actionRequired={event.messageSeverity === 'warning'}
66
72
  title={
@@ -9,6 +9,7 @@ type Notification = {
9
9
 
10
10
  export type PropTypes = {
11
11
  list: Notification[];
12
+ id: string;
12
13
  getBlockchainImage: (blockchain: string) => string | undefined;
13
14
  getTokenImage: (token: Asset) => string | undefined;
14
15
  onClickItem: (requestId: string) => void;
@@ -69,6 +69,7 @@ export function SwapInput(props: SwapInputPropTypes) {
69
69
  <MaxButton
70
70
  variant="default"
71
71
  size="xsmall"
72
+ id={`${props.id}-max-btn`}
72
73
  onClick={props.onSelectMaxBalance}>
73
74
  <Typography variant="body" size="xsmall">
74
75
  {i18n.t('Max')}
@@ -86,6 +87,7 @@ export function SwapInput(props: SwapInputPropTypes) {
86
87
  <div className={formStyles()}>
87
88
  <TokenSectionContainer>
88
89
  <TokenSection
90
+ id={`${props.id}-token-selection-container`}
89
91
  chain={props.chain.displayName}
90
92
  chianImageId={
91
93
  props.mode === 'To'
@@ -124,6 +126,7 @@ export function SwapInput(props: SwapInputPropTypes) {
124
126
  disabled={props.disabled || props.mode === 'To'}
125
127
  style={{ padding: 0 }}
126
128
  value={price.value}
129
+ id={`${props.id}-input`}
127
130
  type={'onInputChange' in props ? 'number' : 'text'}
128
131
  step="any"
129
132
  size="large"
@@ -1,6 +1,7 @@
1
1
  import type { PriceImpactWarningLevel } from '../../components/PriceImpact/PriceImpact.types.js';
2
2
 
3
3
  export type BaseProps = {
4
+ id: string;
4
5
  chain: {
5
6
  displayName: string;
6
7
  image?: string;
@@ -36,12 +36,17 @@ export function TokenSection(props: TokenSectionProps) {
36
36
  loading,
37
37
  warning,
38
38
  tooltipContainer,
39
+ id,
39
40
  } = props;
40
41
 
41
42
  const tokenSelected = !error && !loading && !!tokenSymbol;
42
43
 
43
44
  return (
44
- <Container variant="default" disabled={error || loading} onClick={onClick}>
45
+ <Container
46
+ id={`${id}-clear-all-btn`}
47
+ variant="default"
48
+ disabled={error || loading}
49
+ onClick={onClick}>
45
50
  <TokenSectionContainer>
46
51
  <ChainToken
47
52
  chianImageId={chianImageId}
@@ -2,6 +2,7 @@ export type TokenSectionProps = {
2
2
  chainImage?: string;
3
3
  tokenImage?: string;
4
4
  tokenSymbol: string;
5
+ id: string;
5
6
  chain: string;
6
7
  chianImageId?: string;
7
8
  error?: boolean;