How to use the @pluralsight/ps-design-system-icon.sizes.small function in @pluralsight/ps-design-system-icon

To help you get started, we’ve selected a few @pluralsight/ps-design-system-icon 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 pluralsight / design-system / packages / tag / src / react / index.js View on Github external
const renderIcon = props => {
  if (!props.icon) return null

  const css = {
    cursor: props.icon.props.onClick ? 'pointer' : 'default'
  }
  const onClick = evt => {
    evt.stopPropagation()
    if (props.icon.props.onClick) props.icon.props.onClick(evt)
  }
  const size =
    props.size === vars.sizes.small ? iconSizes.small : iconSizes.medium

  return React.cloneElement(props.icon, { css, onClick, size })
}
github pluralsight / design-system / packages / button / src / react / index.js View on Github external
const mapIconSize = props => {
  const btnToIconSizes = {
    [vars.sizes.xSmall]: iconSizes.small,
    [vars.sizes.small]: iconSizes.medium,
    [vars.sizes.medium]: iconSizes.medium,
    [vars.sizes.large]: iconSizes.medium
  }
  return btnToIconSizes[props.size]
    ? btnToIconSizes[props.size]
    : iconSizes.medium
}
github pluralsight / design-system / packages / card / src / react / index.js View on Github external
const Tag = ({ children, icon, ...props }) => (
  <div>
    {icon &amp;&amp; (
      {React.cloneElement(icon, { size: iconSizes.small })}
    )}

    {children}
  </div>
)
Tag.displayName = 'Card.Tag'