aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/ui
diff options
context:
space:
mode:
authorFrancesco Agosti <francesco.agosti93@gmail.com>2018-11-02 04:57:29 +0800
committerGitHub <noreply@github.com>2018-11-02 04:57:29 +0800
commit0955feb0234bc90b7dcf5ad3a308570c9fa5d490 (patch)
tree623c55dddb6326cf8998619da25a82c48b87f876 /packages/instant/src/components/ui
parent44a34ee541f2c350b65005a1430072ed90fbc790 (diff)
parent935e5da78e14f78685ad9270c19f473fa193d542 (diff)
downloaddexon-0x-contracts-0955feb0234bc90b7dcf5ad3a308570c9fa5d490.tar.gz
dexon-0x-contracts-0955feb0234bc90b7dcf5ad3a308570c9fa5d490.tar.zst
dexon-0x-contracts-0955feb0234bc90b7dcf5ad3a308570c9fa5d490.zip
Merge pull request #1201 from 0xProject/feature/instant/basic-token-modal
[instant] Add `Select Token` mode, animation abstractions, and basic token selection panel
Diffstat (limited to 'packages/instant/src/components/ui')
-rw-r--r--packages/instant/src/components/ui/container.tsx4
-rw-r--r--packages/instant/src/components/ui/flex.tsx4
-rw-r--r--packages/instant/src/components/ui/icon.tsx28
-rw-r--r--packages/instant/src/components/ui/index.ts10
4 files changed, 35 insertions, 11 deletions
diff --git a/packages/instant/src/components/ui/container.tsx b/packages/instant/src/components/ui/container.tsx
index 76b570de7..7b8642761 100644
--- a/packages/instant/src/components/ui/container.tsx
+++ b/packages/instant/src/components/ui/container.tsx
@@ -28,6 +28,8 @@ export interface ContainerProps {
zIndex?: number;
whiteSpace?: string;
opacity?: number;
+ cursor?: string;
+ overflow?: string;
}
export const Container =
@@ -57,6 +59,8 @@ export const Container =
${props => cssRuleIfExists(props, 'z-index')}
${props => cssRuleIfExists(props, 'white-space')}
${props => cssRuleIfExists(props, 'opacity')}
+ ${props => cssRuleIfExists(props, 'cursor')}
+ ${props => cssRuleIfExists(props, 'overflow')}
${props => (props.hasBoxShadow ? `box-shadow: 0px 2px 10px rgba(0, 0, 0, 0.1)` : '')};
background-color: ${props => (props.backgroundColor ? props.theme[props.backgroundColor] : 'none')};
border-color: ${props => (props.borderColor ? props.theme[props.borderColor] : 'none')};
diff --git a/packages/instant/src/components/ui/flex.tsx b/packages/instant/src/components/ui/flex.tsx
index 5fa3fc95b..29c6511bb 100644
--- a/packages/instant/src/components/ui/flex.tsx
+++ b/packages/instant/src/components/ui/flex.tsx
@@ -9,14 +9,14 @@ export interface FlexProps {
width?: string;
height?: string;
backgroundColor?: ColorOption;
- className?: string;
+ inline?: boolean;
}
export const Flex =
styled.div <
FlexProps >
`
- display: flex;
+ display: ${props => (props.inline ? 'inline-flex' : 'flex')};
flex-direction: ${props => props.direction};
flex-wrap: ${props => props.flexWrap};
justify-content: ${props => props.justify};
diff --git a/packages/instant/src/components/ui/icon.tsx b/packages/instant/src/components/ui/icon.tsx
index 7373c3acd..61b382760 100644
--- a/packages/instant/src/components/ui/icon.tsx
+++ b/packages/instant/src/components/ui/icon.tsx
@@ -1,17 +1,21 @@
import * as React from 'react';
-import { ColorOption } from '../../style/theme';
-
type svgRule = 'evenodd' | 'nonzero' | 'inherit';
interface IconInfo {
viewBox: string;
+ path: string;
fillRule?: svgRule;
clipRule?: svgRule;
- path: string;
+ stroke?: string;
+ strokeOpacity?: number;
+ strokeWidth?: number;
+ strokeLinecap?: 'butt' | 'round' | 'square' | 'inherit';
+ strokeLinejoin?: 'miter' | 'round' | 'bevel' | 'inherit';
}
interface IconInfoMapping {
failed: IconInfo;
success: IconInfo;
+ chevron: IconInfo;
}
const ICONS: IconInfoMapping = {
failed: {
@@ -28,12 +32,21 @@ const ICONS: IconInfoMapping = {
path:
'M17 34C26.3887 34 34 26.3888 34 17C34 7.61121 26.3887 0 17 0C7.61133 0 0 7.61121 0 17C0 26.3888 7.61133 34 17 34ZM25.7539 13.0977C26.2969 12.4718 26.2295 11.5244 25.6035 10.9817C24.9775 10.439 24.0303 10.5063 23.4878 11.1323L15.731 20.0771L12.3936 16.7438C11.8071 16.1583 10.8574 16.1589 10.272 16.7451C9.68652 17.3313 9.6875 18.281 10.2734 18.8665L14.75 23.3373L15.8887 24.4746L16.9434 23.2587L25.7539 13.0977Z',
},
+ chevron: {
+ viewBox: '0 0 12 7',
+ path: 'M11 1L6 6L1 1',
+ stroke: 'white',
+ strokeOpacity: 0.5,
+ strokeWidth: 1.5,
+ strokeLinecap: 'round',
+ strokeLinejoin: 'round',
+ },
};
export interface IconProps {
width: number;
- height: number;
- color: ColorOption;
+ height?: number;
+ color?: string;
icon: keyof IconInfoMapping;
}
export const Icon: React.SFC<IconProps> = props => {
@@ -52,6 +65,11 @@ export const Icon: React.SFC<IconProps> = props => {
fill={props.color}
fillRule={iconInfo.fillRule || 'nonzero'}
clipRule={iconInfo.clipRule || 'nonzero'}
+ stroke={iconInfo.stroke}
+ strokeOpacity={iconInfo.strokeOpacity}
+ strokeWidth={iconInfo.strokeWidth}
+ strokeLinecap={iconInfo.strokeLinecap}
+ strokeLinejoin={iconInfo.strokeLinejoin}
/>
</svg>
);
diff --git a/packages/instant/src/components/ui/index.ts b/packages/instant/src/components/ui/index.ts
index bf5f6c700..28f76c262 100644
--- a/packages/instant/src/components/ui/index.ts
+++ b/packages/instant/src/components/ui/index.ts
@@ -1,5 +1,7 @@
export { Text, Title } from './text';
-export { Button } from './button';
-export { Flex } from './flex';
-export { Container } from './container';
-export { Input } from './input';
+export { Button, ButtonProps } from './button';
+export { Flex, FlexProps } from './flex';
+export { Container, ContainerProps } from './container';
+export { Input, InputProps } from './input';
+export { Icon, IconProps } from './icon';
+export { Spinner, SpinnerProps } from './spinner';