How to use the ui-box.propTypes function in ui-box

To help you get started, we’ve selected a few ui-box examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github segmentio / evergreen / packages / evergreen-textarea / src / components / Textarea.js View on Github external
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Box from 'ui-box'
import { TextStyles } from 'evergreen-typography'
import {
  InputAppearances,
  getBorderRadiusForTextSize
} from 'evergreen-shared-styles'

export default class Textarea extends PureComponent {
  static propTypes = {
    ...Box.propTypes,
    disabled: PropTypes.bool.isRequired,
    isInvalid: PropTypes.bool.isRequired,
    spellcheck: PropTypes.bool.isRequired,
    textSize: PropTypes.oneOf(Object.keys(TextStyles))
  }

  static defaultProps = {
    is: 'textarea',
    boxSizing: 'border-box',
    minHeight: 80,
    minWidth: 280,
    disabled: false,
    isInvalid: false,
    spellcheck: true,
    textSize: 300,
    borderRadius: 5,
github segmentio / evergreen / src / tabs / src / Tablist.js View on Github external
import React, { PureComponent } from 'react'
import Box from 'ui-box'

export default class Tablist extends PureComponent {
  static propTypes = {
    ...Box.propTypes
  }

  render() {
    return 
  }
}
github segmentio / evergreen / src / side-sheet / src / SheetClose.js View on Github external
const sheetCloseClassNameCache = {}

const getSheetCloseClassName = position => {
  if (!sheetCloseClassNameCache[position]) {
    sheetCloseClassNameCache[position] = css({
      ...sheetCloseStyles[position],
      ...sharedStyles
    }).toString()
  }

  return sheetCloseClassNameCache[position]
}

export default class SheetClose extends PureComponent {
  static propTypes = {
    ...Box.propTypes,
    isClosing: PropTypes.bool,
    position: PropTypes.oneOf([
      Position.LEFT,
      Position.RIGHT,
      Position.TOP,
      Position.BOTTOM
    ]).isRequired
  }

  render() {
    const { isClosing, position, ...props } = this.props
    return (
github segmentio / evergreen / src / icons / src / Icon.js View on Github external
const IconAim = {
  none: null,
  top: '0deg',
  up: '0deg',
  right: '90deg',
  bottom: '180deg',
  down: '180deg',
  left: '270deg'
}

export default class Icon extends PureComponent {
  static propTypes = {
    /**
     * Composes the Box component as the base.
     */
    ...Box.propTypes,

    /**
     * The aim of the icon.
     * none | up | right | down | left.
     */
    aim: PropTypes.oneOf(Object.keys(IconAim)).isRequired,

    /**
     * The size of the wrapping box of the icon (not the icon itself).
     */
    size: PropTypes.number,

    /**
     * The size of the wrapping box around the icon.
     */
    iconSize: PropTypes.number
github segmentio / evergreen / src / image / src / Image.js View on Github external
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Box from 'ui-box'

export default class Image extends PureComponent {
  static propTypes = {
    ...Box.propTypes,
    src: PropTypes.string
  }

  render() {
    return 
  }
}
github segmentio / evergreen / src / spinner / src / Spinner.js View on Github external
strokeDashoffset: 600,
    strokeDasharray: 300,
    strokeWidth: 12,
    strokeMiterlimit: 10,
    strokeLinecap: 'round',
    animation: `${loadingCircleKeyframes} 1.6s cubic-bezier(0.4, 0.15, 0.6, 0.85) infinite`,
    stroke: color,
    fill: 'transparent'
  }).toString()

class Spinner extends PureComponent {
  static propTypes = {
    /**
     * Composes the Box component as the base.
     */
    ...Box.propTypes,

    /**
     * Delay after which spinner should be visible.
     */
    delay: PropTypes.number,

    /**
     * The size of the spinner.
     */
    size: PropTypes.number.isRequired,

    /**
     * Theme provided by ThemeProvider.
     */
    theme: PropTypes.object.isRequired
  }
github segmentio / evergreen / src / typography / src / UnorderedList.js View on Github external
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Box from 'ui-box'

export default class UnorderedList extends PureComponent {
  static propTypes = {
    ...Box.propTypes,

    /**
     * Size of the text used in a list item.
     * Can be: 300, 400, 500, 600.
     */
    size: PropTypes.oneOf([300, 400, 500, 600]).isRequired,

    /**
     * When passed, adds a icon before each list item in the list
     * You can override this on a individual list item.
     */
    icon: PropTypes.string,

    /**
     * The color of the icon in each list item in the list.
     */
github segmentio / evergreen / packages / evergreen-typography / src / components / Text.js View on Github external
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Box from 'ui-box'
import FontFamilies from '../styles/FontFamilies'
import TextStyles from '../styles/TextStyles'
import TextUppercaseStyles from '../styles/TextUppercaseStyles'
import TextColors from '../styles/TextColors'

const isDev = process.env.NODE_ENV === 'development' || !process.env.NODE_ENV

export default class Text extends PureComponent {
  static propTypes = {
    ...Box.propTypes,
    size: PropTypes.oneOf(Object.keys(TextStyles).map(Number)),
    color: PropTypes.string,
    fontFamily: PropTypes.oneOf(Object.keys(FontFamilies)),
    textStyles: PropTypes.object,
    textUppercaseStyles: PropTypes.object,
    isUppercase: PropTypes.bool
  }

  static defaultProps = {
    is: 'span',
    size: 500,
    color: 'default',
    fontFamily: 'ui',
    textStyles: TextStyles,
    textUppercaseStyles: TextUppercaseStyles
  }
github segmentio / evergreen / src / typography / src / Text.js View on Github external
import cx from 'classnames'
import { css as glamorCss } from 'glamor'
import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import Box from 'ui-box'
import { withTheme } from '../../theme'

class Text extends PureComponent {
  static propTypes = {
    /**
     * Composes the Box component as the base.
     */
    ...Box.propTypes,

    /**
     * Size of the text style.
     * Can be: 300, 400, 500, 600.
     */
    size: PropTypes.oneOf([300, 400, 500, 600]).isRequired,

    /**
     * Font family.
     * Can be: `ui`, `display` or `mono` or a custom font family.
     */
    fontFamily: PropTypes.string.isRequired,

    /**
     * Theme provided by ThemeProvider.
     */
github segmentio / evergreen / src / tabs / src / TabNavigation.js View on Github external
import React, { PureComponent } from 'react'
import Box from 'ui-box'

export default class TabNavigation extends PureComponent {
  static propTypes = {
    ...Box.propTypes
  }

  render() {
    return 
  }
}