-
Notifications
You must be signed in to change notification settings - Fork 0
/
styled.js
87 lines (82 loc) · 1.87 KB
/
styled.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React from 'react'
import styled from 'styled-components'
import PropTypes from 'prop-types'
import {storiesOf} from '@storybook/react'
import {Clear, Select, Item, Label, Search, List, TagList, Tag} from '../src'
import {
rendering,
renderingList,
renderingItem,
renderingSearch,
renderingTag,
onChange,
} from './utils/dummy'
const simpleOptions = [
{value: 'paris', label: 'Paris'},
{value: 'newyork', label: 'New-York'},
{value: 'tokyo', label: 'Tokyo'},
]
const Gelect = styled(Select)`max-width: 400px;`
const Glear = styled(Clear)`background-color: yellow;`
const Gabel = styled(Label)`
user-select: none;
font-size: 1rem;
color: #232323;
padding: 5px;
border: 1px solid #232323;
`
const Gist = styled(List)`
display: flex;
flex-direction: column;
justify-content: center;
align-items: stretch;
background-color: #F1F1F1;
`
const Gtem = styled(Item)`
padding: 8px;
background-color: #E1E1E1;
cursor: pointer;
&:hover {
background-color: #FAFAFA;
}
`
const GagList = styled(TagList)`
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: flex-start;
padding: 5px;
border: 1px solid #232323;
`
const Gag = styled(Tag)`
padding: 8px;
margin: 0 4px;
background-color: #E1E1E1;
cursor: pointer;
&:hover {
background-color: #92FAFA;
}
`
const Placeholder = styled.div`
padding: 8px;
margin: 0 4px;
cursor: pointer;
`
storiesOf('Styled-components', module)
.add('Basic', () =>
<Gelect name="context" onChange={onChange} options={simpleOptions}>
<Gabel />
<Gist renderItem={Gtem} />
</Gelect>
)
.add('Multi', () =>
<Gelect
multi
name="multi"
onChange={onChange}
options={simpleOptions}
placeholder={<Placeholder>Selectless Powerness</Placeholder>}>
<GagList renderTag={Gag} />
<Gist renderItem={Gtem} />
</Gelect>
)