mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 11:41:44 +00:00
adds a few missing prop typing
This commit is contained in:
Vendored
+12
-4
@@ -42,6 +42,8 @@ export interface ButtonProps extends BaseProps<ButtonClass> {
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
variant?: string;
|
||||
bg?: string;
|
||||
color?: string;
|
||||
}
|
||||
type ButtonClass = React.StatelessComponent<ButtonProps>;
|
||||
export declare const Button: ButtonClass;
|
||||
@@ -51,20 +53,25 @@ export interface CardProps extends BaseProps<CardClass> {
|
||||
borderColor?: string;
|
||||
borderRadius?: number;
|
||||
boxShadow?: string;
|
||||
bg?: string;
|
||||
backgroundImage?: string;
|
||||
backgroundSize?: string;
|
||||
backgroundPosition?: string;
|
||||
backgroundRepeat?: string;
|
||||
opacity?: number;
|
||||
fontSize?: number | number[];
|
||||
fontWeight?: string;
|
||||
width?: number | number[];
|
||||
}
|
||||
type CardClass = React.StatelessComponent<CardProps>;
|
||||
export declare const Card: CardClass;
|
||||
|
||||
export interface FlexProps extends BaseProps<FlexClass> {
|
||||
height?: number;
|
||||
borderRadius?: number;
|
||||
src?: string;
|
||||
alt?: string;
|
||||
alignItems?: string;
|
||||
justifyContent?: string,
|
||||
flexDirection?: string,
|
||||
flexWrap?: string,
|
||||
width?: number | number[];
|
||||
}
|
||||
type FlexClass = React.StatelessComponent<FlexProps>
|
||||
export declare const Flex: FlexClass;
|
||||
@@ -86,6 +93,7 @@ export interface ImageProps extends BaseProps<ImageClass> {
|
||||
borderRadius?: number;
|
||||
src?: string;
|
||||
alt?: string;
|
||||
width?: number | number[];
|
||||
}
|
||||
type ImageClass = React.StatelessComponent<ImageProps>
|
||||
export declare const Image: ImageClass;
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import * as React from 'react';
|
||||
import { Box, Flex, Text, Heading, Button, Link, Image, Card } from 'rebass';
|
||||
|
||||
const RebassTests = () => (
|
||||
<Box width={1} css={{ height: '100vh' }}>
|
||||
<Flex width={1} alignItems="center" justifyContent="center">
|
||||
<Heading fontSize={5} fontWeight="bold">Hi, I'm a heading.</Heading>
|
||||
<Text fontSize={3}>Hi, I'm text.</Text>
|
||||
<Card
|
||||
fontSize={6}
|
||||
fontWeight='bold'
|
||||
width={[ 1, 1, 1/2 ]}
|
||||
p={5}
|
||||
my={5}
|
||||
bg='#f6f6ff'
|
||||
borderRadius={8}
|
||||
boxShadow='0 2px 16px rgba(0, 0, 0, 0.25)'
|
||||
>
|
||||
Card
|
||||
</Card>
|
||||
<Image
|
||||
width={[ 1, 1, 1/2 ]}
|
||||
src='https://source.unsplash.com/random/1280x720'
|
||||
borderRadius={8}
|
||||
/>
|
||||
<Link href='https://rebassjs.org'>Link</Link>
|
||||
<Button bg='magenta'>Button</Button>
|
||||
</Flex>
|
||||
</Box>
|
||||
);
|
||||
Reference in New Issue
Block a user