How to use the @instructure/uid.uid function in @instructure/uid

To help you get started, we’ve selected a few @instructure/uid 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-tabs / src / TabList / index.js View on Github external
get tabIds () {
    // cache tab ids for better performance and to prevent errors with animations
    const ids = this._tabIds || []
    let diff = ids.length - this.tabs.length

    while (diff++ < 0) {
      ids.push(uid('Tab'))
    }

    this._tabIds = ids

    return ids
  }
github instructure / instructure-ui / packages / ui-alerts / src / Alert / index.js View on Github external
createScreenreaderAlert () {
    const liveRegion = this.getLiveRegion()
    if (liveRegion) {
      this.srid = uid('Alert')

      const div = document.createElement('div')
      div.setAttribute('id', this.srid)

      const content = this.createScreenreaderContentNode()
      ReactDOM.render(content, div)
      liveRegion.appendChild(div)
    }
  }
github instructure / instructure-ui / packages / ui-code-editor / src / CodeEditor / index.js View on Github external
constructor (props) {
    super()
    this._id = uid('CodeEditor')

    if (typeof props.value === 'undefined') {
      this.state = {
        value: props.defaultValue
      }
    }
  }
github instructure / instructure-ui / packages / ui-svg-images / src / InlineSVG / index.js View on Github external
constructor () {
    super()

    this.titleId = uid('InlineSVG-title')
    this.descId = uid('InlineSVG-desc')
  }
github instructure / instructure-ui / packages / ui-file-drop / src / FileDrop / index.js View on Github external
constructor (props) {
    super(props)

    this.defaultId = uid('FileDrop')
    this.messagesId = uid('FileDrop-messages')
  }
github instructure / instructure-ui / packages / ui-forms / src / Select / SelectField / index.js View on Github external
constructor (props) {
    super(props)

    this.state = {
      focus: false,
      highlightedIndex: this.getSelectedIndex(props),
      expanded: false,
      positioned: false
    }

    this._defaultId = uid('Select')
    this._optionsId = uid('Select-Options')
    this._assistId = uid('Select-assistiveText')
  }
github instructure / instructure-ui / packages / ui-svg-images / src / InlineSVG / index.js View on Github external
constructor () {
    super()

    this.titleId = uid('InlineSVG-title')
    this.descId = uid('InlineSVG-desc')
  }
github instructure / instructure-ui / packages / ui-forms / src / FileDrop / index.js View on Github external
constructor (props) {
    super(props)

    this.defaultId = uid('FileDrop')
    this.messagesId = uid('FileDrop-messages')
  }
github instructure / instructure-ui / packages / ui-a11y / src / FocusRegion.js View on Github external
constructor (element, options) {
    this._options = options || {
      shouldCloseOnDocumentClick: true,
      shouldCloseOnEscape: true,
      onDismiss: (event) => {}
    }
    this._contextElement = element
    this._screenReaderFocusRegion = new ScreenReaderFocusRegion(element, options)
    this._keyboardFocusRegion = new KeyboardFocusRegion(element, options)
    this._id = uid()
  }
github instructure / instructure-ui / packages / ui-menu / src / Menu / index.js View on Github external
constructor (props) {
    super(props)
    this._id = this.props.id || uid('Menu')
  }

@instructure/uid

A unique (CSS-safe) id generator made by Instructure Inc.

MIT
Latest version published 7 days ago

Package Health Score

87 / 100
Full package analysis

Popular @instructure/uid functions

Similar packages