Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
chore(types): expose PropsType (flow) to consumers
Browse files Browse the repository at this point in the history
  • Loading branch information
Meril Pilon committed Jan 15, 2019
1 parent a38c28b commit 210a604
Show file tree
Hide file tree
Showing 77 changed files with 226 additions and 99 deletions.
2 changes: 1 addition & 1 deletion src/Atoms/Brand/BrandLogo.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import React from 'react'
import styled, { type ReactComponentFunctional } from 'styled-components'

type PropsType = {
export type PropsType = {
+size?: string,
}

Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Brand/BrandName.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled, { type ReactComponentFunctional } from 'styled-components'

import { prop, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+height?: string,
}

Expand Down
6 changes: 6 additions & 0 deletions src/Atoms/Brand/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// @flow strict
import type { PropsType as IBrandLogoPropsType } from './BrandLogo'
import type { PropsType as IBrandNamePropsType } from './BrandName'

export type BrandLogoPropsType = IBrandLogoPropsType
export type BrandNamePropsType = IBrandNamePropsType

export { default as BrandLogo } from './BrandLogo'
export { default as BrandName } from './BrandName'
2 changes: 1 addition & 1 deletion src/Atoms/Buttons/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { fontSize, theme, type ThemePropType } from '../../Tools/interpolation'

type HtmlButtonType = 'button' | 'reset' | 'submit'

type PropsType = {
export type PropsType = {
+bounced?: boolean,
+children?: React.Node,
+disabled?: boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Buttons/ButtonGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import * as React from 'react'
import styled from 'styled-components'

type PropsType = {
export type PropsType = {
+children?: React.Node,
}

Expand Down
6 changes: 6 additions & 0 deletions src/Atoms/Buttons/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// @flow strict
import type { PropsType as IButtonPropsType } from './Button'
import type { PropsType as IButtonGroupPropsType } from './ButtonGroup'

export type ButtonPropsType = IButtonPropsType
export type ButtonGroupPropsType = IButtonGroupPropsType

export { default as Button } from './Button'
export { default as ButtonGroup } from './ButtonGroup'
2 changes: 1 addition & 1 deletion src/Atoms/Containers/Container.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'

import { prop, screenSize } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
+height?: string,
}
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Containers/Panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'

import { prop, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
+height?: string,
+width?: string,
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Containers/Section.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/Atoms/Containers/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
// @flow strict
import type { PropsType as IContainerPropsType } from './Container'
import type { PropsType as IPanelPropsType } from './Panel'
import type { PropsType as ISectionPropsType } from './Section'

export type ContainerPropsType = IContainerPropsType
export type PanelPropsType = IPanelPropsType
export type SectionPropsType = ISectionPropsType

export { default as Container } from './Container'
export { default as Panel } from './Panel'
export { default as Section } from './Section'
1 change: 1 addition & 0 deletions src/Atoms/Icons/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import type { PropsType } from './withStyle'

export type IconPropsType = PropsType

export * from './crypto'
export * from './custom'
export * from './fa/brands'
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Inputs/TextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
} from '../../Tools/interpolation'
import { InputLabel, type PropsType as InputPropsType } from './Input'

type PropsType = InputPropsType & { +height?: string }
export type PropsType = InputPropsType & { +height?: string }

const Container = styled.div`
display: flex;
Expand Down
6 changes: 6 additions & 0 deletions src/Atoms/Inputs/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
// @flow strict
import type { PropsType as IInputPropsType } from './Input'
import type { PropsType as ITextAreaPropsType } from './TextArea'

export type InputPropsType = IInputPropsType
export type TextAreaPropsType = ITextAreaPropsType

export { CheckboxLabel } from './Checkbox'
export { InputLabel, default as Input } from './Input'
export { default as Password } from './Password'
Expand Down
4 changes: 4 additions & 0 deletions src/Atoms/Links/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// @flow strict
import type { PropsType as ILinkPropsType } from './Link'

export type LinkPropsType = ILinkPropsType

export { default as Link } from './Link'
2 changes: 1 addition & 1 deletion src/Atoms/Loaders/BlockchainLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled, { keyframes } from 'styled-components'

import { prop } from '../../Tools/interpolation'

type PropsType = { +size?: string }
export type PropsType = { +size?: string }

const scaleDelay = keyframes`
0%,
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Loaders/FlatLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled, { keyframes } from 'styled-components'

import { prop, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+height?: string,
+width?: string,
}
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Loaders/FlatLoader2.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled, { keyframes } from 'styled-components'

import { prop, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+height?: string,
+width?: string,
}
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Loaders/HeartbeatLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const Circle2 = styled(Circle1)`
animation-delay: -1s;
`

type PropsType = { +size?: string }
export type PropsType = { +size?: string }

const HeartbeatLoader = (props: PropsType) => (
<Container {...props}>
Expand Down
10 changes: 10 additions & 0 deletions src/Atoms/Loaders/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
// @flow strict
import type { PropsType as IBlockchainLoaderPropsType } from './BlockchainLoader'
import type { PropsType as IFlatLoaderPropsType } from './FlatLoader'
import type { PropsType as IFlatLoader2PropsType } from './FlatLoader2'
import type { PropsType as IHeartbeatLoaderPropsType } from './HeartbeatLoader'

export type BlockchainLoaderPropsType = IBlockchainLoaderPropsType
export type FlatLoaderPropsType = IFlatLoaderPropsType
export type FlatLoader2PropsType = IFlatLoader2PropsType
export type HeartbeatLoaderPropsType = IHeartbeatLoaderPropsType

export { default as BlockchainLoader } from './BlockchainLoader'
export { default as FlatLoader } from './FlatLoader'
export { default as FlatLoader2 } from './FlatLoader2'
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Paginations/Pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const Wrapper = styled.div`
margin: 10px 0;
`

type PropsType = {
export type PropsType = {
+children?: React.Node,
}

Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Paginations/PaginationItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const Wrapper: ReactComponentFunctional<E2ePropType> = styled.a.attrs({
}
`

type PropsType = {
export type PropsType = {
+children?: React.Node,
+e2e?: string,
+selected?: boolean,
Expand Down
6 changes: 6 additions & 0 deletions src/Atoms/Paginations/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// @flow strict
import type { PropsType as IPaginationPropsType } from './Pagination'
import type { PropsType as IPaginationItemPropsType } from './PaginationItem'

export type PaginationPropsType = IPaginationPropsType
export type PaginationItemPropsType = IPaginationItemPropsType

export { default as Pagination } from './Pagination'
export { default as PaginationItem } from './PaginationItem'
2 changes: 1 addition & 1 deletion src/Atoms/Tables/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'

import { theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
}

Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Tables/TableCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { prop } from '../../Tools/interpolation'

type AlignType = 'center' | 'left' | 'right'

type PropsType = {
export type PropsType = {
+align?: AlignType,
+children?: React.Node,
+shrunk?: boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Tables/TableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'
import * as React from 'react'
import styled from 'styled-components'

type PropsType = {
export type PropsType = {
+children?: React.Node,
}

Expand Down
8 changes: 8 additions & 0 deletions src/Atoms/Tables/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
// @flow strict
import type { PropsType as ITablePropsType } from './Table'
import type { PropsType as ITableCellPropsType } from './TableCell'
import type { PropsType as ITableRowPropsType } from './TableRow'

export type TablePropsType = ITablePropsType
export type TableCellPropsType = ITableCellPropsType
export type TableRowPropsType = ITableRowPropsType

export { default as Table } from './Table'
export { default as TableCell } from './TableCell'
export { default as TableRow } from './TableRow'
2 changes: 1 addition & 1 deletion src/Atoms/Tabs/TabMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'

import { prop, screenSize, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
+height?: string,
+toggled?: boolean,
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Tabs/TabMenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled, { type ReactComponentFunctional } from 'styled-components'
import injectE2E, { type E2ePropType } from '../../Tools/injectE2E'
import { screenSize, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
+className?: string,
+e2e?: string,
Expand Down
2 changes: 1 addition & 1 deletion src/Atoms/Tabs/TabMenuToggler.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import styled, { type ReactComponentFunctional } from 'styled-components'
import { FasBars, type IconPropsType } from '../../Atoms/Icons'
import { screenSize } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
+onToggle?: (SyntheticEvent<HTMLDivElement>) => void,
}
Expand Down
8 changes: 8 additions & 0 deletions src/Atoms/Tabs/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
// @flow strict
import type { PropsType as ITabMenuPropsType } from './TabMenu'
import type { PropsType as ITabMenuItemPropsType } from './TabMenuItem'
import type { PropsType as ITabMenuTogglerPropsType } from './TabMenuToggler'

export type TabMenuPropsType = ITabMenuPropsType
export type TabMenuItemPropsType = ITabMenuItemPropsType
export type TabMenuTogglerPropsType = ITabMenuTogglerPropsType

export { default as TabMenu } from './TabMenu'
export { default as TabMenuItem } from './TabMenuItem'
export { default as TabMenuToggler } from './TabMenuToggler'
2 changes: 1 addition & 1 deletion src/Atoms/Typography/TextGroup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import styled from 'styled-components'

import { prop } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+align?: 'center' | 'justify' | 'left' | 'right',
+capitalize?: boolean,
+children?: React.Node,
Expand Down
6 changes: 6 additions & 0 deletions src/Atoms/Typography/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
// @flow strict
import type { PropsType as ITextPropsType } from './Text'
import type { PropsType as ITextGroupPropsType } from './TextGroup'

export type TextPropsType = ITextPropsType
export type TextGroupPropsType = ITextGroupPropsType

export { default as Text } from './Text'
export { default as TextGroup } from './TextGroup'
2 changes: 1 addition & 1 deletion src/Molecules/Badges/CircleBadge.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const WhiteTwitter: ReactComponentFunctional<IconPropsType> = styled(
}
`

type PropsType = {
export type PropsType = {
+name?: 'facebook' | 'linkedin' | 'twitter',
+size?: string,
}
Expand Down
4 changes: 4 additions & 0 deletions src/Molecules/Badges/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// @flow strict
import type { PropsType as ICircleBadgePropsType } from './CircleBadge'

export type CircleBadgePropsType = ICircleBadgePropsType

export { default as CircleBadge } from './CircleBadge'
2 changes: 1 addition & 1 deletion src/Molecules/Cartridges/Cartridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const Wrapper = styled.span`
border-radius: 2px;
`

type PropsType = {
export type PropsType = {
+children?: React.Node,
}

Expand Down
4 changes: 4 additions & 0 deletions src/Molecules/Cartridges/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// @flow strict
import type { PropsType as ICartridgePropsType } from './Cartridge'

export type CartridgePropsType = ICartridgePropsType

export { default as Cartridge } from './Cartridge'
2 changes: 1 addition & 1 deletion src/Molecules/Dropdowns/SingleDropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
type ThemePropType,
} from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+capitalize?: boolean,
+className?: string,
+disabled?: boolean,
Expand Down
4 changes: 4 additions & 0 deletions src/Molecules/Dropdowns/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// @flow strict
import type { PropsType as ISingleDropdownPropsType } from './SingleDropdown'

export type SingleDropdownPropsType = ISingleDropdownPropsType

export { default as SingleDropdown } from './SingleDropdown'
2 changes: 1 addition & 1 deletion src/Molecules/SearchBars/SearchBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Input } from '../../Atoms/Inputs'
import injectE2E from '../../Tools/injectE2E'
import { fontSize, prop, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
+e2e?: string,
+onChange?: (SyntheticEvent<HTMLInputElement>) => void,
Expand Down
2 changes: 1 addition & 1 deletion src/Molecules/SearchBars/SearchBarUnderlined.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { Input } from '../../Atoms/Inputs'
import injectE2E from '../../Tools/injectE2E'
import { prop, theme } from '../../Tools/interpolation'

type PropsType = {
export type PropsType = {
+children?: React.Node,
+e2e?: string,
+onChange?: (SyntheticEvent<HTMLInputElement>) => void,
Expand Down
2 changes: 1 addition & 1 deletion src/Molecules/Toasts/Toast.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ const IndicatorDanger = styled(IndicatorWarning)`
}
`

type PropsType = {
export type PropsType = {
+description?: string,
+e2e?: string,
+onClose?: (SyntheticEvent<HTMLDivElement>) => void,
Expand Down
4 changes: 4 additions & 0 deletions src/Molecules/Toasts/index.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
// @flow strict
import type { PropsType as IToastPropsType } from './Toast'

export type ToastPropsType = IToastPropsType

export { default as Toast } from './Toast'
2 changes: 1 addition & 1 deletion src/Molecules/Togglers/Toggler.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const Wrapper = styled.div`
}
`

type PropsType = { +children: React.Node }
export type PropsType = { +children: React.Node }

const Toggler = ({ children }: PropsType) => <Wrapper>{children}</Wrapper>

Expand Down
Loading

0 comments on commit 210a604

Please sign in to comment.