Sha256: b5f72b59637f8d7d1a9caa03d15af7ccf4633ed524957a3d13880f1e6d8ef9a2

Contents?: true

Size: 616 Bytes

Versions: 5

Compression:

Stored size: 616 Bytes

Contents

import React from "react"
import ColorPickerInput from './ColorPickerInput'

class Wrapper extends React.Component {
  state = {
    color: '#000'
  }

  handleOnChange = (color) => {
    this.setState({color})
  }

  render() {
    const {
      color,
    } = this.state

    const child = React.cloneElement(this.props.children, {
      color,
      onChange: this.handleOnChange,
    })

    return child
  }
}

export default function ColorPickerStory(stories) {
  stories.add("ColorPickerInput",
    () => {
      return (
        <Wrapper>
          <ColorPickerInput/>
        </Wrapper>
      )
    }
  )
}

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
playbook_ui-2.7.2 components/ColorPickerInput/ColorPickerInputStory.jsx
playbook_ui-2.7.1 components/ColorPickerInput/ColorPickerInputStory.jsx
playbook_ui-2.7.0 components/ColorPickerInput/ColorPickerInputStory.jsx
playbook_ui-2.6.0 components/ColorPickerInput/ColorPickerInputStory.jsx
playbook_ui-2.5.0 components/ColorPickerInput/ColorPickerInputStory.jsx