@rango-dev/ui 0.28.2-next.9 → 0.29.1-next.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 (66) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/index.js +6 -6
  3. package/dist/index.js.map +4 -4
  4. package/dist/translations/en.d.ts.map +1 -1
  5. package/dist/translations/es.d.ts.map +1 -1
  6. package/dist/translations/fr.d.ts.map +1 -1
  7. package/dist/translations/ja.d.ts.map +1 -1
  8. package/dist/translations/pt.d.ts.map +1 -1
  9. package/dist/widget/ui/src/components/Alert/Alert.types.d.ts +1 -1
  10. package/dist/widget/ui/src/components/Alert/Alert.types.d.ts.map +1 -1
  11. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.d.ts +4 -0
  12. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.d.ts.map +1 -0
  13. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.stories.d.ts +7 -0
  14. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.stories.d.ts.map +1 -0
  15. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.styles.d.ts +3566 -0
  16. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.styles.d.ts.map +1 -0
  17. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.types.d.ts +18 -0
  18. package/dist/widget/ui/src/components/ExpandedRoute/ExpandedRoute.types.d.ts.map +1 -0
  19. package/dist/widget/ui/src/components/ExpandedRoute/index.d.ts +2 -0
  20. package/dist/widget/ui/src/components/ExpandedRoute/index.d.ts.map +1 -0
  21. package/dist/widget/ui/src/components/ExpandedRoute/mock.d.ts +7 -0
  22. package/dist/widget/ui/src/components/ExpandedRoute/mock.d.ts.map +1 -0
  23. package/dist/widget/ui/src/components/Modal/Modal.d.ts.map +1 -1
  24. package/dist/widget/ui/src/components/Popover/Popover.d.ts.map +1 -1
  25. package/dist/widget/ui/src/components/Popover/Popover.types.d.ts +4 -0
  26. package/dist/widget/ui/src/components/Popover/Popover.types.d.ts.map +1 -1
  27. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.d.ts.map +1 -1
  28. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts +2 -1
  29. package/dist/widget/ui/src/components/PriceImpact/PriceImpact.types.d.ts.map +1 -1
  30. package/dist/widget/ui/src/components/QuoteTag/QuoteTag.d.ts +4 -0
  31. package/dist/widget/ui/src/components/QuoteTag/QuoteTag.d.ts.map +1 -0
  32. package/dist/widget/ui/src/components/QuoteTag/QuoteTag.styles.d.ts +327 -0
  33. package/dist/widget/ui/src/components/QuoteTag/QuoteTag.styles.d.ts.map +1 -0
  34. package/dist/widget/ui/src/components/QuoteTag/index.d.ts +2 -0
  35. package/dist/widget/ui/src/components/QuoteTag/index.d.ts.map +1 -0
  36. package/dist/widget/ui/src/components/TextField/TextField.styles.d.ts.map +1 -1
  37. package/dist/widget/ui/src/components/index.d.ts +2 -1
  38. package/dist/widget/ui/src/components/index.d.ts.map +1 -1
  39. package/dist/widget/ui/src/icons/Tune.d.ts +5 -0
  40. package/dist/widget/ui/src/icons/Tune.d.ts.map +1 -0
  41. package/dist/widget/ui/src/icons/index.d.ts +1 -0
  42. package/dist/widget/ui/src/icons/index.d.ts.map +1 -1
  43. package/dist/widget/ui/src/types/index.d.ts +1 -0
  44. package/dist/widget/ui/src/types/index.d.ts.map +1 -1
  45. package/package.json +3 -3
  46. package/src/components/Alert/Alert.types.ts +1 -1
  47. package/src/components/ExpandedRoute/ExpandedRoute.stories.tsx +29 -0
  48. package/src/components/ExpandedRoute/ExpandedRoute.styles.ts +186 -0
  49. package/src/components/ExpandedRoute/ExpandedRoute.tsx +147 -0
  50. package/src/components/ExpandedRoute/ExpandedRoute.types.ts +18 -0
  51. package/src/components/ExpandedRoute/index.ts +1 -0
  52. package/src/components/ExpandedRoute/mock.ts +236 -0
  53. package/src/components/Modal/Modal.tsx +17 -7
  54. package/src/components/Popover/Popover.tsx +5 -3
  55. package/src/components/Popover/Popover.types.ts +4 -0
  56. package/src/components/PriceImpact/PriceImpact.tsx +5 -7
  57. package/src/components/PriceImpact/PriceImpact.types.ts +2 -1
  58. package/src/components/QuoteTag/QuoteTag.styles.ts +44 -0
  59. package/src/components/QuoteTag/QuoteTag.tsx +19 -0
  60. package/src/components/QuoteTag/index.ts +1 -0
  61. package/src/components/TextField/TextField.styles.ts +1 -0
  62. package/src/components/index.ts +2 -1
  63. package/src/containers/SwapInput/SwapInput.tsx +1 -1
  64. package/src/icons/Tune.tsx +51 -0
  65. package/src/icons/index.ts +1 -0
  66. package/src/types/index.ts +4 -0
@@ -8,13 +8,14 @@ import { Container, OutputUsdValue } from './PriceImpact.styles';
8
8
 
9
9
  export function PriceImpact(props: PriceImpactProps) {
10
10
  const {
11
- size,
11
+ size = 'medium',
12
12
  outputUsdValue,
13
13
  realOutputUsdValue,
14
14
  percentageChange,
15
15
  warningLevel,
16
16
  error,
17
17
  tooltipProps,
18
+ ...rest
18
19
  } = props;
19
20
 
20
21
  let percentageChangeColor = '$neutral600';
@@ -25,7 +26,7 @@ export function PriceImpact(props: PriceImpactProps) {
25
26
  }
26
27
 
27
28
  return (
28
- <Container>
29
+ <Container {...rest}>
29
30
  {outputUsdValue && (
30
31
  <Tooltip
31
32
  content={realOutputUsdValue}
@@ -36,17 +37,14 @@ export function PriceImpact(props: PriceImpactProps) {
36
37
  : undefined
37
38
  }
38
39
  side={tooltipProps?.side}>
39
- <OutputUsdValue
40
- size={size === 'small' ? 'small' : 'medium'}
41
- variant="body"
42
- color="$neutral600">
40
+ <OutputUsdValue size={size} variant="body" color="$neutral600">
43
41
  {`~$${outputUsdValue}`}
44
42
  </OutputUsdValue>
45
43
  </Tooltip>
46
44
  )}
47
45
  {((outputUsdValue && percentageChange) || !outputUsdValue) && (
48
46
  <Typography
49
- size={size === 'small' ? 'small' : 'medium'}
47
+ size={size}
50
48
  variant="body"
51
49
  ml={4}
52
50
  color={percentageChangeColor}>
@@ -1,9 +1,10 @@
1
1
  import type { PropTypes as TooltipPropTypes } from '../Tooltip/Tooltip.types';
2
+ import type { TypographyPropTypes } from '../Typography';
2
3
 
3
4
  export type PriceImpactWarningLevel = 'low' | 'high' | undefined;
4
5
 
5
6
  export type PriceImpactProps = {
6
- size: 'small' | 'large';
7
+ size: TypographyPropTypes['size'];
7
8
  outputUsdValue?: string;
8
9
  realOutputUsdValue?: string;
9
10
  error?: string;
@@ -0,0 +1,44 @@
1
+ import { css, darkTheme, styled } from '../../theme';
2
+
3
+ export const getLabelStyles = css({});
4
+
5
+ export const TagContainer = styled('div', {
6
+ backgroundColor: '$neutral400',
7
+ borderRadius: '$xs',
8
+ padding: '$2 $5',
9
+ display: 'flex',
10
+ justifyContent: 'center',
11
+ alignItems: 'center',
12
+ variants: {
13
+ type: {
14
+ RECOMMENDED: {
15
+ [`& .${getLabelStyles}`]: {
16
+ color: '$secondary500',
17
+ [`.${darkTheme} &`]: {
18
+ color: '$secondary400',
19
+ },
20
+ },
21
+ },
22
+ FASTEST: {
23
+ [`& .${getLabelStyles}`]: {
24
+ color: '$success500',
25
+ },
26
+ },
27
+ HIGH_IMPACT: {
28
+ [`& .${getLabelStyles}`]: {
29
+ color: '$error500',
30
+ },
31
+ },
32
+ LOWEST_FEE: {
33
+ [`& .${getLabelStyles}`]: {
34
+ color: '#FF4DAD',
35
+ },
36
+ },
37
+ CENTRALIZED: {
38
+ [`& .${getLabelStyles}`]: {
39
+ color: '$warning500',
40
+ },
41
+ },
42
+ },
43
+ },
44
+ });
@@ -0,0 +1,19 @@
1
+ import type { RouteTag, Tag } from 'rango-sdk';
2
+
3
+ import React from 'react';
4
+
5
+ import { Typography } from '../Typography';
6
+
7
+ import { getLabelStyles, TagContainer } from './QuoteTag.styles';
8
+
9
+ export const QuoteTag = (props: RouteTag) => {
10
+ const { value, label } = props;
11
+
12
+ return (
13
+ <TagContainer type={value as Tag}>
14
+ <Typography variant="body" size="small" className={getLabelStyles()}>
15
+ {label}
16
+ </Typography>
17
+ </TagContainer>
18
+ );
19
+ };
@@ -0,0 +1 @@
1
+ export { QuoteTag } from './QuoteTag';
@@ -91,6 +91,7 @@ export const Input = styled('input', {
91
91
  border: 'none',
92
92
  outline: 'none',
93
93
  fontFamily: 'inherit',
94
+ maxWidth: '100%',
94
95
  variants: {
95
96
  suffix: {
96
97
  true: { marginRight: '$10' },
@@ -11,6 +11,7 @@ export * from './Chip';
11
11
  export * from './common';
12
12
  export * from './Divider';
13
13
  export * from './Drawer';
14
+ export * from './ExpandedRoute';
14
15
  export * from './Header';
15
16
  export * from './Modal';
16
17
  export * from './MessageBox';
@@ -20,7 +21,6 @@ export * from './RefreshProgressButton';
20
21
  export * from './RoutesOverview';
21
22
  export * from './SecondaryPage';
22
23
  export * from './SelectableWalletList';
23
- export * from './Wallet';
24
24
  export * from './SelectableCategoryList';
25
25
  export * from './Spinner';
26
26
  export * from './StepDetail';
@@ -52,3 +52,4 @@ export * from './StepDetails';
52
52
  export * from './Popover';
53
53
  export * from './Flags';
54
54
  export * from './Select';
55
+ export * from './QuoteTag';
@@ -120,7 +120,7 @@ export function SwapInput(props: SwapInputProps) {
120
120
  </Tooltip>
121
121
  {'percentageChange' in props ? (
122
122
  <PriceImpact
123
- size="large"
123
+ size="medium"
124
124
  tooltipProps={{
125
125
  container: props.tooltipContainer,
126
126
  side: 'bottom',
@@ -0,0 +1,51 @@
1
+ import type { SvgIconPropsWithChildren } from '../components/SvgIcon';
2
+
3
+ import React, { createElement } from 'react';
4
+
5
+ import { SvgIcon } from '../components/SvgIcon';
6
+
7
+ function SvgTune(props: SvgIconPropsWithChildren) {
8
+ return createElement(
9
+ SvgIcon,
10
+ props,
11
+ <svg viewBox="0 0 24 25" xmlns="http://www.w3.org/2000/svg">
12
+ <path
13
+ fillRule="evenodd"
14
+ clipRule="evenodd"
15
+ d="M10.3143 10.9429C11.7029 10.9429 12.8286 9.81717 12.8286 8.42857C12.8286 7.03997 11.7029 5.91429 10.3143 5.91429C8.92568 5.91429 7.8 7.03997 7.8 8.42857C7.8 9.81717 8.92568 10.9429 10.3143 10.9429ZM10.3143 11.8571C12.2078 11.8571 13.7429 10.3221 13.7429 8.42857C13.7429 6.53502 12.2078 5 10.3143 5C8.42074 5 6.88571 6.53502 6.88571 8.42857C6.88571 10.3221 8.42074 11.8571 10.3143 11.8571Z"
16
+ fill="currentColor"
17
+ />
18
+ <path
19
+ fillRule="evenodd"
20
+ clipRule="evenodd"
21
+ d="M13.7429 20.0857C15.1315 20.0857 16.2571 18.96 16.2571 17.5714C16.2571 16.1828 15.1315 15.0571 13.7429 15.0571C12.3543 15.0571 11.2286 16.1828 11.2286 17.5714C11.2286 18.96 12.3543 20.0857 13.7429 20.0857ZM13.7429 21C15.6364 21 17.1714 19.465 17.1714 17.5714C17.1714 15.6779 15.6364 14.1429 13.7429 14.1429C11.8493 14.1429 10.3143 15.6779 10.3143 17.5714C10.3143 19.465 11.8493 21 13.7429 21Z"
22
+ fill="currentColor"
23
+ />
24
+ <path
25
+ fillRule="evenodd"
26
+ clipRule="evenodd"
27
+ d="M3 8.42857C3 8.1761 3.20467 7.97143 3.45714 7.97143H6.88571C7.13819 7.97143 7.34286 8.1761 7.34286 8.42857C7.34286 8.68104 7.13819 8.88571 6.88571 8.88571H3.45714C3.20467 8.88571 3 8.68104 3 8.42857Z"
28
+ fill="currentColor"
29
+ />
30
+ <path
31
+ fillRule="evenodd"
32
+ clipRule="evenodd"
33
+ d="M16.7143 17.5714C16.7143 17.319 16.919 17.1143 17.1714 17.1143H20.6C20.8525 17.1143 21.0571 17.319 21.0571 17.5714C21.0571 17.8239 20.8525 18.0286 20.6 18.0286H17.1714C16.919 18.0286 16.7143 17.8239 16.7143 17.5714Z"
34
+ fill="currentColor"
35
+ />
36
+ <path
37
+ fillRule="evenodd"
38
+ clipRule="evenodd"
39
+ d="M14.4286 8.42857C14.4286 8.1761 14.6332 7.97143 14.8857 7.97143H20.6C20.8525 7.97143 21.0571 8.1761 21.0571 8.42857C21.0571 8.68104 20.8525 8.88571 20.6 8.88571H14.8857C14.6332 8.88571 14.4286 8.68104 14.4286 8.42857Z"
40
+ fill="currentColor"
41
+ />
42
+ <path
43
+ fillRule="evenodd"
44
+ clipRule="evenodd"
45
+ d="M3 17.5714C3 17.319 3.20467 17.1143 3.45714 17.1143H9.17143C9.4239 17.1143 9.62857 17.319 9.62857 17.5714C9.62857 17.8239 9.4239 18.0286 9.17143 18.0286H3.45714C3.20467 18.0286 3 17.8239 3 17.5714Z"
46
+ fill="currentColor"
47
+ />
48
+ </svg>
49
+ );
50
+ }
51
+ export default SvgTune;
@@ -46,6 +46,7 @@ export { default as SearchIcon } from './Search';
46
46
  export { default as SwapIcon } from './Swap';
47
47
  export { default as TimeIcon } from './Time';
48
48
  export { default as TransactionIcon } from './Transaction';
49
+ export { default as TuneIcon } from './Tune';
49
50
  export { default as UtxoCategoryIcon } from './UtxoCategory';
50
51
  export { default as WalletIcon } from './Wallet';
51
52
  export { default as WarningIcon } from './Warning';
@@ -1 +1,5 @@
1
1
  export type { ConnectedWallet } from './wallet';
2
+ export type {
3
+ SimulationAssetAndAmount,
4
+ SimulationValidationStatus,
5
+ } from './swaps';