@rango-dev/ui 0.1.10-next.86 → 0.1.10-next.89

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/ui",
3
- "version": "0.1.10-next.86",
3
+ "version": "0.1.10-next.89",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",
@@ -72,7 +72,7 @@
72
72
  "@radix-ui/react-radio-group": "^1.1.1",
73
73
  "@radix-ui/react-switch": "^1.0.1",
74
74
  "@radix-ui/react-tooltip": "^1.0.2",
75
- "@rango-dev/wallets-shared": "^0.1.11-next.77",
75
+ "@rango-dev/wallets-shared": "^0.1.11-next.78",
76
76
  "@stitches/react": "^1.2.8",
77
77
  "@types/react-color": "^3.0.6",
78
78
  "rango-sdk": "^0.1.18",
@@ -396,6 +396,7 @@ export function Button({
396
396
  ml={!!prefix}
397
397
  mr={!!suffix && !loading}
398
398
  flexContent={flexContent}
399
+ className="_text"
399
400
  >
400
401
  {children}
401
402
  </Content>
@@ -13,7 +13,7 @@ const CheckboxRoot = styled(RadixCheckbox.Root, {
13
13
  width: 20,
14
14
  padding: 0,
15
15
  height: 20,
16
- border: '1px solid',
16
+ border: '1px solid $foreground',
17
17
  display: 'flex',
18
18
  alignItems: 'center',
19
19
  justifyContent: 'center',
@@ -21,7 +21,7 @@ const CheckboxRoot = styled(RadixCheckbox.Root, {
21
21
  backgroundColor: '$neutral-100',
22
22
  });
23
23
  const Label = styled('label', {
24
- color: '$text',
24
+ color: '$foreground',
25
25
  fontSize: '$m',
26
26
  marginLeft: '$8',
27
27
  });
@@ -48,7 +48,9 @@ export function Checkbox({
48
48
  <CheckIcon size={20} />
49
49
  </RadixCheckbox.Indicator>
50
50
  </CheckboxRoot>
51
- <Label htmlFor={id}>{label} </Label>
51
+ <Label className="_text" htmlFor={id}>
52
+ {label}
53
+ </Label>
52
54
  </CheckboxContainer>
53
55
  );
54
56
  }
@@ -2,7 +2,6 @@ import React, { useState } from 'react';
2
2
  import { ChromePicker, ColorResult } from 'react-color';
3
3
  import { styled } from '../../theme';
4
4
  import { Button } from '../Button';
5
- import { Typography } from '../Typography';
6
5
 
7
6
  const Container = styled('div', {
8
7
  position: 'relative',
@@ -51,14 +50,19 @@ export interface PropTypes {
51
50
  label?: string;
52
51
  }
53
52
 
53
+ const Label = styled('label', {
54
+ display: 'inline-block',
55
+ fontSize: '$14',
56
+ marginBottom: '$4',
57
+ color: '$foreground',
58
+ });
59
+
54
60
  export function ColorPicker({ color, onChangeColor, label, place }: PropTypes) {
55
61
  const [displayColorPicker, setDisplayColorPicker] = useState<boolean>(false);
56
62
 
57
63
  return (
58
64
  <Container>
59
- <Typography mb={4} variant="body2">
60
- {label}
61
- </Typography>
65
+ <Label className="_text">{label}</Label>
62
66
  <Button
63
67
  variant="outlined"
64
68
  prefix={<Color style={{ backgroundColor: color }} />}
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties } from '@stitches/react';
2
- import React from 'react';
2
+ import React, { useEffect } from 'react';
3
3
  import { createPortal } from 'react-dom';
4
4
  import { styled } from '../../theme';
5
5
  import { CloseIcon } from '../Icon/CloseIcon';
@@ -64,6 +64,10 @@ export function Modal(props: PropTypes) {
64
64
  const handleBackDropClick = (event: React.MouseEvent<HTMLDivElement>) => {
65
65
  if (event.target === event.currentTarget) onClose();
66
66
  };
67
+ useEffect(() => {
68
+ if (open) document.body.style.overflow = 'hidden';
69
+ else document.body.style.overflow = 'unset';
70
+ }, [open]);
67
71
  return (
68
72
  <>
69
73
  {open &&
@@ -62,23 +62,24 @@ const StyledIndicator = styled(RadioGroup.Indicator, {
62
62
  const Label = styled('label', {
63
63
  paddingLeft: '$8',
64
64
  cursor: 'pointer',
65
+ color: '$foreground',
65
66
  });
66
67
 
67
68
  export interface PropTypes {
68
69
  options: { label: string; value: string }[];
69
- defaultValue: string;
70
+ value: string;
70
71
  onChange: (value: string) => void;
71
72
  direction?: 'vertical' | 'horizontal';
72
73
  style?: CSSProperties;
73
74
  }
74
75
 
75
76
  export function Radio(props: PropTypes) {
76
- const { defaultValue, onChange, direction = 'vertical', style } = props;
77
+ const { value, onChange, direction = 'vertical', style } = props;
77
78
  return (
78
79
  <Container>
79
80
  <StyledRoot
80
81
  onValueChange={onChange}
81
- defaultValue={defaultValue}
82
+ value={value}
82
83
  direction={direction}
83
84
  style={style}
84
85
  >
@@ -87,7 +88,7 @@ export function Radio(props: PropTypes) {
87
88
  <StyledItem value={option.value} id={option.value}>
88
89
  <StyledIndicator />
89
90
  </StyledItem>
90
- <Label htmlFor={option.value}>
91
+ <Label className="_text" htmlFor={option.value}>
91
92
  <Typography variant="body2">{option.label}</Typography>
92
93
  </Label>
93
94
  </ItemContainer>
@@ -140,7 +140,7 @@ export function Settings(props: PropTypes) {
140
140
  <ThemesContainer>
141
141
  <Title variant="body2">Theme</Title>
142
142
  <Radio
143
- defaultValue={selectedTheme}
143
+ value={selectedTheme}
144
144
  options={[
145
145
  { value: 'dark', label: 'Dark' },
146
146
  { value: 'light', label: 'Light' },
@@ -34,7 +34,7 @@ const StyledSwitchThumb = styled(RadixSwitch.Thumb, {
34
34
  willChange: 'transform',
35
35
  '&[data-state="checked"]': {
36
36
  transform: 'translateX(20px)',
37
- backgroundColor: '$primary500',
37
+ backgroundColor: '$primary',
38
38
  },
39
39
  });
40
40
 
@@ -15,7 +15,7 @@ const InputContainer = styled('div', {
15
15
  color: '$foreground',
16
16
  transition: 'border-color ease .3s',
17
17
  '&:focus-within': {
18
- borderColor: '$primary500',
18
+ borderColor: '$primary',
19
19
  },
20
20
  variants: {
21
21
  size: {
@@ -59,7 +59,7 @@ const InputContainer = styled('div', {
59
59
  });
60
60
 
61
61
  const Input = styled('input', {
62
- color: '$text',
62
+ color: '$foreground',
63
63
  paddingLeft: '$16',
64
64
  paddingRight: '$16',
65
65
  flexGrow: 1,
@@ -78,6 +78,7 @@ const Input = styled('input', {
78
78
  const Label = styled('label', {
79
79
  display: 'inline-block',
80
80
  fontSize: '$14',
81
+ color: '$foreground',
81
82
  marginBottom: '$4',
82
83
  });
83
84
 
@@ -108,7 +109,10 @@ export const TextField = React.forwardRef(
108
109
  return (
109
110
  <>
110
111
  {label && (
111
- <Label {...(inputAttributes.id && { htmlFor: inputAttributes.id })}>
112
+ <Label
113
+ className="_text"
114
+ {...(inputAttributes.id && { htmlFor: inputAttributes.id })}
115
+ >
112
116
  {label}
113
117
  </Label>
114
118
  )}
@@ -118,9 +122,15 @@ export const TextField = React.forwardRef(
118
122
  suffix={!!suffix}
119
123
  size={size}
120
124
  style={style}
125
+ className="_text"
121
126
  >
122
127
  {prefix || null}
123
- <Input {...inputAttributes} spellCheck={false} ref={ref} />
128
+ <Input
129
+ className="_text"
130
+ {...inputAttributes}
131
+ spellCheck={false}
132
+ ref={ref}
133
+ />
124
134
  {suffix || null}
125
135
  </InputContainer>
126
136
  </>
@@ -23,7 +23,6 @@ export interface PropTypes {
23
23
 
24
24
  export function TokenList(props: PropTypes) {
25
25
  const { list, searchedText, onChange, multiSelect, selectedList } = props;
26
-
27
26
  const [selected, setSelected] = useState(props.selected);
28
27
 
29
28
  const changeSelected = (token: TokenWithAmount) => {
@@ -1,3 +1,4 @@
1
+ import { CSSProperties } from '@stitches/react';
1
2
  import React, { PropsWithChildren } from 'react';
2
3
  import { styled } from '../../theme';
3
4
 
@@ -184,14 +185,18 @@ export interface PropTypes {
184
185
  mb?: 2 | 4 | 8 | 12;
185
186
  ml?: 2 | 4 | 8 | 12;
186
187
  mr?: 2 | 4 | 8 | 12;
188
+ className?: string;
189
+ style?: CSSProperties;
190
+
187
191
  }
188
192
 
189
193
  export function Typography({
190
194
  children,
195
+ className,
191
196
  ...props
192
197
  }: PropsWithChildren<PropTypes>) {
193
198
  return (
194
- <TypographyContainer className="_typography" {...props}>
199
+ <TypographyContainer className={`_typography _text ${className}`} {...props}>
195
200
  {children}
196
201
  </TypographyContainer>
197
202
  );
@@ -7,7 +7,6 @@ import { WalletState } from '../../types/wallet';
7
7
  import { InstallObjects, detectInstallLink } from '@rango-dev/wallets-shared';
8
8
 
9
9
  const StateIconContainer = styled('span', {
10
- width: '$28',
11
10
  display: 'flex',
12
11
  justifyContent: 'center',
13
12
  alignItems: 'center',
@@ -3,6 +3,6 @@ import { styled } from '../../theme';
3
3
  export const FilledCircle = styled('span', {
4
4
  width: '10px',
5
5
  height: '10px',
6
- backgroundColor: '$primary500',
6
+ backgroundColor: '$primary',
7
7
  borderRadius: '99999px',
8
8
  });