How to use the @instructure/ui-react-utils.omitProps 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-elements / src / Progress / ProgressCircle / index.js View on Github external
// consolidating the label and aria-valuetext to put in aria-label because
    // NVDA does not read aria-valuetext: https://github.com/nvaccess/nvda/issues/913
    // But leaving aria-valuetext because JAWS ignores aria-label
    const labelAndValueText = `${label} ${valueText}`

    const value = (typeof formatDisplayedValue === 'function') && formatDisplayedValue(valueNow, valueMax)

    const style = this.state.animateOnMount ? null : {
      strokeDashoffset: `${this.dashOffset()}em`
    }

    const radius = this.radius()

    const passthroughProps = View.omitViewProps(
      omitProps(this.props, ProgressCircle.propTypes, ['animateOnMount']),
      ProgressCircle
    )

    return (
github instructure / instructure-ui / packages / ui-a11y / src / Dialog / index.js View on Github external
render () {
    const ElementType = getElementType(Dialog, this.props)
    return this.props.open ? (
      
        {this.props.children}
      
    ) : null
  }
}
github instructure / instructure-ui / packages / ui-focusable / src / FocusableView / index.js View on Github external
elementRef,
      focused,
      href,
      margin,
      onClick,
      role,
      shape,
      className, // eslint-disable-line react/prop-types
      to,  // eslint-disable-line react/prop-types
      width,
      tabIndex,
      ...props
    } = this.props

    const passthroughProps = View.omitViewProps(
      omitProps(props, FocusableView.propTypes),
      FocusableView
    )

    return (
github instructure / instructure-ui / packages / ui-buttons / src / Button / index.js View on Github external
if (process.env.NODE_ENV !== 'production') {
      // show warning if icon is added as a child
      if (this.hasVisibleChildren) {
        React.Children.forEach(children, (child) => {
          const icon = child && child.type && typeof child.type.glyphName !== 'undefined'
          warn(
            !icon,
            `[Button] Icons as children is deprecated. Please use the 'icon' prop instead.`
          )
        })
      }
    }

    // warn for unallowed view props
    const passthroughProps = View.omitViewProps(
      omitProps(this.props, Button.propTypes),
      Button
    )

    return (
github instructure / instructure-ui / packages / ui-forms / src / FileDrop / index.js View on Github external
const { allowMultiple, disabled, readOnly, interaction } = this.props
    const id = this.props.id || this.defaultId

    // make readonly input functionally disabled
    const functionallyDisabled = disabled || readOnly ||
      interaction === 'disabled' || interaction === 'readonly'

    const classes = {
      [styles.label]: true,
      [styles.functionallyDisabled]: functionallyDisabled,
      [styles.visuallyDisabled]: interaction === 'disabled' || disabled,
      [styles.dragRejected]: this.state.isDragRejected || this.invalid,
      [styles.dragAccepted]: this.state.isDragAccepted,
      [styles.focused]: this.state.isFocused
    }
    const props = omitProps(this.props, FileDrop.propTypes)

    return (
      <div>
        <label>
          <span>
            <span>
              {this.renderLabel()}
            </span>
          </span></label></div>
github instructure / instructure-ui / packages / ui-table / src / Table / Cell / index.js View on Github external
render () {
    const { children, textAlign, isStacked, header } = this.props

    return (
      
    )
  }
}
github instructure / instructure-ui / packages / ui-table / src / Table / Head / index.js View on Github external
render () {
    const { children, isStacked } = this.props

    return isStacked
      ? this.renderSelect()
      : (
        
          {Children.map(children, (child) =&gt; matchComponentTypes(child, [Row])
            ? child
            : null)}
        
      )
  }
}
github instructure / instructure-ui / packages / ui-tooltip / src / Tooltip / index.js View on Github external
renderTrigger () {
    const { children, as } = this.props
    const { hasFocus } = this.state
    const triggerProps = {
      'aria-describedby': this._id
    }

    if (as) {
      const Trigger = getElementType(Tooltip, this.props)
      const props = omitProps(this.props, Tooltip.propTypes)
      return (
        
          {children}
        
      )
    } else if (typeof children === 'function') {
      return children(
        {
          focused: hasFocus,
          getTriggerProps: (props) =&gt; {
            return {
              ...triggerProps,
              ...props
            }
          }
        }
github instructure / instructure-ui / packages / ui-table / src / Table / ColHeader / index.js View on Github external
render () {
    const { onRequestSort, width, textAlign, children, sortDirection } = this.props

    return (
      
        {onRequestSort &amp;&amp; (
github instructure / instructure-ui / packages / ui-forms / src / Select / SelectMultiple / index.js View on Github external
render () {
    return (
       { this._field = el }}
        inputRef={this.handleInputRef}
        editable={this.props.editable}
        options={this.state.filteredOptions}
        size={this.props.size}
        disabled={this.props.disabled}
        readOnly={this.props.readOnly}
        onSelect={this.handleSelect}
        onStaticClick={this.focus}
        onClose={this.handleClose}
        onInputChange={this.handleInputChange}
        onKeyDown={this.handleKeyDown}
        optionsMaxWidth={this.props.optionsMaxWidth}
        closeOnSelect={this.props.closeOnSelect}
      &gt;
        {this.renderTags()}