Autodesk / orion-ui

UI Components that work seamlessly in multiple UI frameworks
https://goo.gl/shxHPB
Other
22 stars 6 forks source link

Add modal #313

Open nfiniteset opened 7 years ago

nfiniteset commented 7 years ago
As a developer
I want to add modals to my application
So that my users can focus on an important detail

Typical usage

<Modal open={this.state.open} title="Are you sure?">
  <h1>Serious warning</h1>
  <p>Are you sure you want to do this risky thing?</p>

  <ModalButton type="secondary" onClick={this.cancel} />
  <ModalButton onClick={this.doIt}>
</Modal>

Complete props

Modal = {
  body: PropTypes.string, // => hig.setBody(body)
  headerColor: PropTypes.string, // => hig.setHeaderColor(color)
  onCloseClick: PropTypes.func, // => hig.onCloseClick(fn)
  onOverlayClick: PropTypes.func, // => hig.onOverlayClick(fn)
  open: PropTypes.Boolean, // => hig.open() : hig.close()
  title: PropTypes.string, // => hig.setTitle(title)
}

TODO