33/* eslint-disable import/no-extraneous-dependencies */
44import React , { useState } from 'react' ;
55import { action } from '@storybook/addon-actions' ;
6+ import Button from '@material-ui/core/Button' ;
67import { ColorPicker } from '../src' ;
78
89const paletteObj = {
@@ -34,7 +35,7 @@ Basic.story = {
3435} ;
3536
3637export const Palette = ( ) => (
37- < div style = { style } >
38+ < div >
3839 < ColorPicker defaultValue = "transparent" palette = { paletteObj } />
3940 </ div >
4041) ;
@@ -59,18 +60,34 @@ const Controller = ({ value }) => {
5960 action ( 'changed' ) ( newValue ) ;
6061 } ;
6162 return (
62- < div style = { style } >
63- < ColorPicker value = { color } onChange = { handleChange } />
64- < button onClick = { ( ) => handleChange ( 'rgb(255, 0, 0)' ) } > set rgb(255, 0, 0)</ button >
63+ < div style = { { display : 'flex' , flexDirection : 'row' } } >
64+ < div >
65+ < div style = { { marginLeft : '-28px' , marginTop : '-8px' , paddingBottom : '28px' , color : '#777' , fontSize : '10px' } } >
66+ < h1 > material-ui-color-components</ h1 >
67+ < h2 > ColorPicker example</ h2 >
68+ </ div >
69+ < ColorPicker value = { color } palette = { paletteObj } onChange = { handleChange } />
70+ < Button variant = "outlined" style = { { marginTop : '100px' } } onClick = { ( ) => handleChange ( 'rgb(255, 0, 0)' ) } >
71+ set rgb(255, 0, 0)
72+ </ Button >
73+ < div style = { { paddingTop : '180px' , marginLeft : '-28px' , color : '#999' , fontSize : '12px' } } >
74+ https://github.com/mikbry/material-ui-color-components
75+ </ div >
76+ </ div >
77+ < div
78+ style = { {
79+ color : '#777' ,
80+ marginLeft : '24px' ,
81+ width : '400px' ,
82+ height : '480px' ,
83+ backgroundColor : color . hex ? `#${ color . hex } ` : color ,
84+ } }
85+ />
6586 </ div >
6687 ) ;
6788} ;
6889
69- export const Controlled = ( ) => (
70- < div style = { style } >
71- < Controller value = "#fff" />
72- </ div >
73- ) ;
90+ export const Controlled = ( ) => < Controller value = "#0fe" /> ;
7491Controlled . story = {
7592 parameters : { defaultValue : 'red' , palette : paletteObj , deferred : true } ,
7693} ;
0 commit comments