How to use the @pluralsight/ps-design-system-theme.withTheme function in @pluralsight/ps-design-system-theme

To help you get started, we’ve selected a few @pluralsight/ps-design-system-theme 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 / row / src / react / index.js View on Github external
words: props => {
    const imgWidth = formatImageWidth(props)
    const actionBarWidth = formatActionBarWidth(props)

    return compose(
      css(stylesheet['.psds-row__words']),
      css({ maxWidth: `calc(100% - ${imgWidth} - ${actionBarWidth})` })
    )
  }
}

const ActionBar = props => (
  <div>
)

const ActionBarAction = withTheme(
  React.forwardRef((props, ref) =&gt; {
    // eslint-disable-next-line react/prop-types
    const { icon, ...rest } = props
    const filteredProps = filterReactProps(rest, { tagName: 'button' })

    return (
      <button>
        {icon}
      </button>
    )
  })
)

ActionBarAction.displayName = 'Row.Action'
ActionBarAction.propTypes = { icon: PropTypes.element.isRequired }
</div>
github pluralsight / design-system / packages / drawer / src / react / index.js View on Github external
Drawer.propTypes = {
  base: PropTypes.node.isRequired,
  children: PropTypes.node.isRequired,
  isOpen: PropTypes.bool,
  onToggle: PropTypes.func,
  startOpen: PropTypes.bool,
  themeName: PropTypes.oneOf(Object.values(themeNames)),
  toggleButtonAriaLabel: PropTypes.string
}

Drawer.defaultProps = {
  startOpen: false
}

export default withTheme(Drawer)
github pluralsight / design-system / packages / row / src / react / index.js View on Github external
return (
    <div aria-label="{`${percent}">
  )
}
ProgressBar.propTypes = {
  progress: PropTypes.number
}

const Text = props =&gt; <span>
Text.displayName = 'Row.Text'

const TextLink = withTheme(props =&gt; {
  const { children, truncated } = props

  const anchor = React.Children.only(children)
  const anchorText = anchor.props.children
  const childIsString = typeof anchorText === 'string'

  return (
    <span>
      <a>
         {c}}
        &gt;</a></span></span></div>
github pluralsight / design-system / packages / row / src / react / index.js View on Github external
{anchorText}
        
      
    
  )
})
TextLink.displayName = 'Row.TextLink'
TextLink.defaultProps = {
  truncated: false
}
TextLink.propTypes = {
  children: PropTypes.oneOfType([elementOfType('a')]).isRequired,
  truncated: PropTypes.bool
}

const Title = withTheme(({ truncated, children, ...rest }) =&gt; {
  const childIsString = typeof children === 'string'

  const wrapAsLink = c =&gt; React.cloneElement(c, { truncated })
  const wrapWithShave = child =&gt; (
     {c}}
    &gt;
      {child}
    
  )

  return (
    <div>
      {childIsString ? wrapWithShave(children) : wrapAsLink(children)}
    </div>
github pluralsight / design-system / packages / halo / src / react / index.js View on Github external
visible: false,
  visibleOnFocus: true
}

Halo.propTypes = {
  className: PropTypes.string,
  error: PropTypes.bool,
  gapSize: PropTypes.oneOf(Object.values(vars.gapSizes)),
  inline: PropTypes.bool,
  shape: PropTypes.oneOf(Object.values(vars.shapes)),
  themeName: PropTypes.string,
  visible: PropTypes.bool,
  visibleOnFocus: PropTypes.bool
}

export default withTheme(Halo)
github pluralsight / design-system / packages / row / src / react / index.js View on Github external
const Image = props =&gt; (
  <div>
)
Image.displayName = 'Row.Image'
Image.propTypes = { src: PropTypes.string.isRequired }

const ImageLink = props =&gt; (
  <span>
)
ImageLink.displayName = 'Row.ImageLink'

const Metadata = withTheme(props =&gt; (
  <div>
))
Metadata.propTypes = {
  size: PropTypes.any
}

const MetadataDatum = props =&gt; (
  <span>
)

const MetadataDot = props =&gt; (
  </span></div></span></div>
github pluralsight / design-system / packages / linearprogress / src / react / index.js View on Github external
}

const LinearProgress = props =&gt; (
  <div>
    <div>
  </div>
)

LinearProgress.propTypes = {
  value: PropTypes.number
}
LinearProgress.defaultProps = {
  value: 0
}

export default withTheme(LinearProgress)
</div>