orion-ui icon indicating copy to clipboard operation
orion-ui copied to clipboard

Add modal

Open nfiniteset opened this issue 8 years ago • 0 comments

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

  • [ ] Add PropTypes
  • [ ] Add docgenInfo
  • [ ] Add unit test coverage
  • [ ] Add to playground
  • [ ] Add to storybook
    • [ ] With code sample
    • [ ] With props table
  • [ ] Canary build on NPM

nfiniteset avatar Aug 09 '17 23:08 nfiniteset