How to use the @instructure/ui-react-utils.pickProps function in @instructure/ui-react-utils

To help you get started, we’ve selected a few @instructure/ui-react-utils 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 instructure / instructure-ui / packages / ui-layout / src / Grid / GridRow / index.js View on Github external
return Children.map(children, (child, index) => {
      if (matchComponentTypes(child, [GridCol])) {
        return safeCloneElement(child, {
          ...pickProps(this.props, GridRow.propTypes),
          ...child.props, /* child props should override parent */
          isLastRow: props.isLastRow,
          isLastCol: ((index + 1) === Children.count(children))
        })
      } else {
        return child // PropType validation should handle errors
      }
    })
  }
github instructure / instructure-ui / packages / ui-layout / src / View / index.js View on Github external
get styleProps () {
    const { cursor, style } = this.props // eslint-disable-line react/prop-types
    const whitelisted = pickProps(style || {}, {}, [
      // Position/calculateElementPosition:
      'top',
      'left',
      'position',
      'display',
      'transform',
      'overflow',
      'minWidth',
      'minHeight',
      // Img:
      'filter',
      // Flex.Item:
      'flexBasis',
      // Avatar:
      'backgroundImage'
    ])
github instructure / instructure-ui / packages / ui-view / src / View / index.js View on Github external
get styleProps () {
    const { cursor, style } = this.props // eslint-disable-line react/prop-types
    const whitelisted = pickProps(style || {}, {}, [
      // Position/calculateElementPosition:
      'top',
      'left',
      'position',
      'display',
      'transform',
      'overflow',
      'minWidth',
      'minHeight',
      // Img:
      'filter',
      // Flex.Item:
      'flexBasis',
      // Avatar:
      'backgroundImage'
    ])
github instructure / instructure-ui / packages / ui-forms / src / TextInput / index.js View on Github external
[styles.disabled]: disabled
    }

    const style = width ? { width } : null

    let descriptionIds = ''
    if (props['aria-describedby']) {
      descriptionIds = `${props['aria-describedby'] }`
    }
    if (this.hasMessages) {
      descriptionIds += this._messagesId
    }

    return (
      
        <span>
          </span>
github instructure / instructure-ui / packages / ui-form-field / src / FormFieldLayout / index.js View on Github external
return (
      
        { this.elementType === 'fieldset' &amp;&amp; this.renderLegend() }
        
          
            { this.renderLabel() }
            
              { this.props.children }
            
          
          { this.renderVisibleMessages() }
        
      
    )
  }
}
github instructure / instructure-ui / packages / ui-overlays / src / Overlay / index.js View on Github external
render () {
    let content = (
      <dialog open="{this.state.open}">
        {this.props.children}
      </dialog>
    )

    if (this.props.transition) {
      content = this.renderTransition(content)
    }

    return (
github instructure / instructure-ui / packages / ui-menu / src / Menu / index.js View on Github external
render () {
    const {
      trigger,
      disabled
    } = this.props

    return trigger ? (
       {
          this._popover = el
          if (typeof this.props.popoverRef === 'function') {
            this.props.popoverRef(el)
          }
        }}
      &gt;
        
          {safeCloneElement(trigger, {
            ref: (el) =&gt; {
              this._trigger = el