@symbo.ls/uikit 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc.json +3 -0
- package/.eslintrc.js +16 -0
- package/README.md +1 -1
- package/components/Atoms/Animation.js +53 -0
- package/components/Atoms/Block.js +151 -0
- package/components/Atoms/Collection.js +82 -0
- package/components/Atoms/Direction.js +10 -0
- package/components/Atoms/Flex.js +17 -0
- package/components/Atoms/Form.js +11 -0
- package/components/Atoms/Grid.js +30 -0
- package/components/Atoms/Iframe.js +16 -0
- package/components/Atoms/Img.js +17 -0
- package/components/Atoms/Interaction.js +9 -0
- package/components/Atoms/InteractiveComponent.js +78 -0
- package/components/Atoms/Media.js +164 -0
- package/components/Atoms/Overflow.js +7 -0
- package/components/Atoms/Picture.js +31 -0
- package/components/Atoms/Position.js +21 -0
- package/components/Atoms/Pseudo.js +7 -0
- package/components/Atoms/SVG.js +16 -0
- package/components/Atoms/Shape/index.js +42 -0
- package/components/Atoms/Shape/style.js +204 -0
- package/components/Atoms/Text.js +40 -0
- package/components/Atoms/Theme.js +136 -0
- package/components/Atoms/Timing.js +55 -0
- package/components/Atoms/Transform.js +8 -0
- package/components/Atoms/XYZ.js +7 -0
- package/components/Atoms/index.js +25 -0
- package/components/Atoms/package.json +13 -0
- package/components/Avatar/index.js +32 -0
- package/components/Avatar/package.json +12 -0
- package/components/Avatar/style.js +19 -0
- package/components/Banner/index.js +22 -0
- package/components/Banner/package.json +12 -0
- package/components/Banner/style.js +27 -0
- package/components/Box/index.js +44 -0
- package/components/Box/package.json +10 -0
- package/components/Button/README.md +11 -0
- package/components/Button/index.js +48 -0
- package/components/Button/package.json +12 -0
- package/components/ButtonSet/index.js +10 -0
- package/components/ButtonSet/package.json +12 -0
- package/components/Datepicker/index.js +156 -0
- package/components/Datepicker/package.json +13 -0
- package/components/Datepicker/style.js +18 -0
- package/components/Dropdown/index.js +52 -0
- package/components/Dropdown/package.json +12 -0
- package/components/Field/index.js +43 -0
- package/components/Field/package.json +13 -0
- package/components/Field/style.js +30 -0
- package/components/Icon/index.js +50 -0
- package/components/Icon/package.json +11 -0
- package/components/Icon/style.js +8 -0
- package/components/IconText/index.js +16 -0
- package/components/IconText/package.json +14 -0
- package/components/Input/index.js +32 -0
- package/components/Input/package.json +11 -0
- package/components/Label/index.js +25 -0
- package/components/Label/package.json +13 -0
- package/components/Link/index.js +38 -0
- package/components/Link/package.json +12 -0
- package/components/Notification/index.js +47 -0
- package/components/Notification/package.json +16 -0
- package/components/Pills/index.js +25 -0
- package/components/Pills/package.json +11 -0
- package/components/Range/index.js +131 -0
- package/components/Range/package.json +13 -0
- package/components/Select/index.js +36 -0
- package/components/Select/package.json +11 -0
- package/components/Sidebar/index.js +24 -0
- package/components/Sidebar/package.json +12 -0
- package/components/Slider/index.js +105 -0
- package/components/Slider/package.json +13 -0
- package/components/Slider/style.js +19 -0
- package/components/TextArea/index.js +15 -0
- package/components/TextArea/package.json +11 -0
- package/components/Tooltip/index.js +37 -0
- package/components/Tooltip/package.json +11 -0
- package/components/Tooltip/style.js +12 -0
- package/lerna.json +9 -0
- package/package.json +35 -32
- package/packages/react/index.js +5 -0
- package/packages/react/package.json +16 -0
- package/packages/uikit/README.md +38 -0
- package/{index.js → packages/uikit/index.js} +0 -0
- package/packages/uikit/package.json +40 -0
- package/react/box/README.md +114 -0
- package/react/box/index.d.ts +3 -0
- package/react/box/index.js +63 -0
- package/react/box/package.json +33 -0
- package/svgSprite.config.js +7 -0
- package/watch.js +12 -0
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export const styleUser = {
|
|
4
|
+
cursor: 'pointer',
|
|
5
|
+
borderRadius: '100%'
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export const styleUserBundle = {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
textTransform: 'capitalize',
|
|
12
|
+
'> div': {
|
|
13
|
+
display: 'flex',
|
|
14
|
+
marginRight: '1em',
|
|
15
|
+
'> img': {
|
|
16
|
+
marginRight: '-0.5em'
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Icon } from '@symbo.ls/icon'
|
|
4
|
+
import { AvatarBundle } from '@symbo.ls/avatar'
|
|
5
|
+
|
|
6
|
+
import { styleParentMode } from './style'
|
|
7
|
+
|
|
8
|
+
export const ParentMode = {
|
|
9
|
+
round: 10,
|
|
10
|
+
theme: 'purple',
|
|
11
|
+
style: styleParentMode,
|
|
12
|
+
icon: {
|
|
13
|
+
extend: Icon,
|
|
14
|
+
props: { icon: 'checkMedium' }
|
|
15
|
+
},
|
|
16
|
+
h2: 'Welcome to parent Mode',
|
|
17
|
+
description: {
|
|
18
|
+
extend: AvatarBundle,
|
|
19
|
+
users: { ...[{}, {}, {}] },
|
|
20
|
+
span: 'You\'ll now be able to chat with tutor privately. No other participants will see the messages.'
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/banner",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/avatar": "latest",
|
|
9
|
+
"@symbo.ls/icon": "latest"
|
|
10
|
+
},
|
|
11
|
+
"source": "src/index.js"
|
|
12
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export const styleParentMode = {
|
|
4
|
+
boxSizing: 'border-box',
|
|
5
|
+
padding: '3.6em 1.6em 4em 3.6em',
|
|
6
|
+
position: 'relative',
|
|
7
|
+
display: 'block',
|
|
8
|
+
width: '700px',
|
|
9
|
+
'> svg': {
|
|
10
|
+
position: 'absolute',
|
|
11
|
+
top: '1.2em',
|
|
12
|
+
right: '1.2em',
|
|
13
|
+
color: 'rgba(215, 100, 185, .2)'
|
|
14
|
+
},
|
|
15
|
+
'> div': {
|
|
16
|
+
alignItems: 'flex-start',
|
|
17
|
+
'> div': { marginTop: '4px' }
|
|
18
|
+
},
|
|
19
|
+
h2: {
|
|
20
|
+
margin: 0,
|
|
21
|
+
marginBottom: '10px'
|
|
22
|
+
},
|
|
23
|
+
span: {
|
|
24
|
+
maxWidth: `${314 / 14}em`,
|
|
25
|
+
lineHeight: '22px'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Shape,
|
|
5
|
+
Position,
|
|
6
|
+
Theme,
|
|
7
|
+
Block,
|
|
8
|
+
Text,
|
|
9
|
+
Overflow,
|
|
10
|
+
Timing,
|
|
11
|
+
Transform,
|
|
12
|
+
Media,
|
|
13
|
+
Interaction,
|
|
14
|
+
XYZ,
|
|
15
|
+
Animation
|
|
16
|
+
} from '@symbo.ls/atoms'
|
|
17
|
+
|
|
18
|
+
const PropsCSS = {
|
|
19
|
+
class: {
|
|
20
|
+
style: ({ props }) => props && props.style
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const Box = {
|
|
25
|
+
extend: [
|
|
26
|
+
PropsCSS,
|
|
27
|
+
Shape,
|
|
28
|
+
Position,
|
|
29
|
+
Theme,
|
|
30
|
+
Block,
|
|
31
|
+
Text,
|
|
32
|
+
Overflow,
|
|
33
|
+
Timing,
|
|
34
|
+
Transform,
|
|
35
|
+
Media,
|
|
36
|
+
Interaction,
|
|
37
|
+
XYZ,
|
|
38
|
+
Animation
|
|
39
|
+
],
|
|
40
|
+
attr: {
|
|
41
|
+
id: ({ props }) => props.id
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { FocusableComponent } from '@symbo.ls/atoms'
|
|
4
|
+
import { IconText } from '@symbo.ls/icon'
|
|
5
|
+
|
|
6
|
+
export const Button = {
|
|
7
|
+
extend: [FocusableComponent, IconText],
|
|
8
|
+
tag: 'button',
|
|
9
|
+
props: {
|
|
10
|
+
fontSize: 'A',
|
|
11
|
+
type: 'button',
|
|
12
|
+
border: 'none',
|
|
13
|
+
display: 'inline-flex',
|
|
14
|
+
align: 'center center',
|
|
15
|
+
textDecoration: 'none',
|
|
16
|
+
lineHeight: '1',
|
|
17
|
+
whiteSpace: 'nowrap',
|
|
18
|
+
padding: 'Z A1',
|
|
19
|
+
fontFamily: 'inherit',
|
|
20
|
+
round: 'C2'
|
|
21
|
+
},
|
|
22
|
+
attr: {
|
|
23
|
+
type: ({ props }) => props.type
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const SquareButton = {
|
|
28
|
+
extend: Button,
|
|
29
|
+
props: {
|
|
30
|
+
fontSize: 'A',
|
|
31
|
+
width: 'A',
|
|
32
|
+
padding: 'Z',
|
|
33
|
+
aspectRatio: '1 / 1',
|
|
34
|
+
justifyContent: 'center',
|
|
35
|
+
round: 'Z',
|
|
36
|
+
style: { boxSizing: 'content-box' }
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export const CircleButton = {
|
|
41
|
+
extend: SquareButton,
|
|
42
|
+
props: { round: 'C' }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export const KangorooButton = {
|
|
46
|
+
extend: Button,
|
|
47
|
+
childExtend: IconText
|
|
48
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/button",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/atoms": "latest",
|
|
9
|
+
"@symbo.ls/icon": "latest"
|
|
10
|
+
},
|
|
11
|
+
"source": "src/index.js"
|
|
12
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/buttonset",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/atoms": "latest",
|
|
9
|
+
"@symbo.ls/button": "latest"
|
|
10
|
+
},
|
|
11
|
+
"source": "src/index.js"
|
|
12
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
|
|
5
|
+
import { SquareButton, Button } from '@symbo.ls/button'
|
|
6
|
+
import { Flex, Grid } from '@symbo.ls/atoms'
|
|
7
|
+
|
|
8
|
+
const buttonProps = {
|
|
9
|
+
theme: 'transparent',
|
|
10
|
+
color: '--theme-quinary-dark-color',
|
|
11
|
+
':hover': {
|
|
12
|
+
theme: 'quinary .child'
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const aside = {
|
|
17
|
+
props: {
|
|
18
|
+
gap: 'X2',
|
|
19
|
+
margin: '-Z - -Z -X2',
|
|
20
|
+
padding: 'Z - Z X2',
|
|
21
|
+
minHeight: '100%',
|
|
22
|
+
height: '100%',
|
|
23
|
+
width: '--spacing-D'
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
cnt: {
|
|
27
|
+
extend: Flex,
|
|
28
|
+
props: {
|
|
29
|
+
flow: 'column',
|
|
30
|
+
overflow: 'hidden auto',
|
|
31
|
+
boxSize: '100% --spacing-D',
|
|
32
|
+
top: '0',
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
maxHeight: '100%',
|
|
35
|
+
justifyContent: 'flex-end'
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
childExtend: {
|
|
39
|
+
extend: Button,
|
|
40
|
+
props: {
|
|
41
|
+
...buttonProps,
|
|
42
|
+
fontSize: 'Z1'
|
|
43
|
+
},
|
|
44
|
+
text: ({ state }) => state.value
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const main = {
|
|
51
|
+
extend: Flex,
|
|
52
|
+
|
|
53
|
+
props: {
|
|
54
|
+
flex: 1,
|
|
55
|
+
gap: 'X2',
|
|
56
|
+
flow: 'column',
|
|
57
|
+
|
|
58
|
+
header: {
|
|
59
|
+
align: 'center space-between'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
header: {
|
|
64
|
+
extend: Flex,
|
|
65
|
+
left: {
|
|
66
|
+
extend: SquareButton,
|
|
67
|
+
props: {
|
|
68
|
+
...buttonProps,
|
|
69
|
+
round: 'C',
|
|
70
|
+
icon: 'arrowAngleLeft'
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
month: {
|
|
74
|
+
tag: 'span',
|
|
75
|
+
text: 'December'
|
|
76
|
+
},
|
|
77
|
+
right: {
|
|
78
|
+
extend: SquareButton,
|
|
79
|
+
props: {
|
|
80
|
+
...buttonProps,
|
|
81
|
+
round: 'C',
|
|
82
|
+
icon: 'arrowAngleRight'
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
},
|
|
86
|
+
days: {
|
|
87
|
+
extend: Flex,
|
|
88
|
+
props: {
|
|
89
|
+
flow: 'column',
|
|
90
|
+
gap: 'X2'
|
|
91
|
+
},
|
|
92
|
+
childExtend: {
|
|
93
|
+
extend: Grid,
|
|
94
|
+
props: {
|
|
95
|
+
columns: 'repeat(7, 1fr)',
|
|
96
|
+
gap: 'X2'
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
weekDays: {
|
|
100
|
+
childExtend: {
|
|
101
|
+
extend: Button,
|
|
102
|
+
props: {
|
|
103
|
+
...buttonProps,
|
|
104
|
+
fontSize: 'Z1',
|
|
105
|
+
padding: 'X2'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
...[
|
|
109
|
+
{ text: 'Mo' },
|
|
110
|
+
{ text: 'Tu' },
|
|
111
|
+
{ text: 'We' },
|
|
112
|
+
{ text: 'Th' },
|
|
113
|
+
{ text: 'Fr' },
|
|
114
|
+
{ text: 'Sa' },
|
|
115
|
+
{ text: 'Su' }
|
|
116
|
+
]
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
cnt: {
|
|
120
|
+
childExtend: {
|
|
121
|
+
extend: SquareButton,
|
|
122
|
+
|
|
123
|
+
props: ({ key, state }) => ({
|
|
124
|
+
...buttonProps,
|
|
125
|
+
theme: 'quaternary',
|
|
126
|
+
active: key === '18',
|
|
127
|
+
'.active': {
|
|
128
|
+
theme: 'quinary'
|
|
129
|
+
}
|
|
130
|
+
})
|
|
131
|
+
},
|
|
132
|
+
|
|
133
|
+
...new Array(31).fill(undefined).map((_, i) => ({ text: i + 1 }))
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export const DatePicker = {
|
|
139
|
+
style,
|
|
140
|
+
extend: Flex,
|
|
141
|
+
|
|
142
|
+
props: {
|
|
143
|
+
position: 'relative',
|
|
144
|
+
theme: 'quinary',
|
|
145
|
+
transition: 'A all',
|
|
146
|
+
round: 'Z',
|
|
147
|
+
padding: 'Z Z2 Z X2',
|
|
148
|
+
gap: 'X2',
|
|
149
|
+
depth: 16,
|
|
150
|
+
minHeight: '0',
|
|
151
|
+
align: 'stretch center'
|
|
152
|
+
},
|
|
153
|
+
|
|
154
|
+
aside,
|
|
155
|
+
main
|
|
156
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/datepicker",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/block": "latest",
|
|
9
|
+
"@symbo.ls/icon": "latest",
|
|
10
|
+
"@symbo.ls/shape": "latest"
|
|
11
|
+
},
|
|
12
|
+
"source": "src/index.js"
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
main: {
|
|
5
|
+
'section > header span:nth-child(6)': {
|
|
6
|
+
opacity: 0.5
|
|
7
|
+
},
|
|
8
|
+
'section > header span:nth-child(7)': {
|
|
9
|
+
opacity: 0.5
|
|
10
|
+
},
|
|
11
|
+
'section > div button:nth-child(7n)': {
|
|
12
|
+
opacity: 0.5
|
|
13
|
+
},
|
|
14
|
+
'section > div button:nth-child(7n - 1)': {
|
|
15
|
+
opacity: 0.5
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex } from '@symbo.ls/atoms'
|
|
4
|
+
import { Button } from '@symbo.ls/button'
|
|
5
|
+
|
|
6
|
+
export const DropdownList = {
|
|
7
|
+
extend: Flex,
|
|
8
|
+
|
|
9
|
+
props: {
|
|
10
|
+
padding: '0 Y',
|
|
11
|
+
maxHeight: 'G',
|
|
12
|
+
flow: 'column',
|
|
13
|
+
theme: 'quaternary',
|
|
14
|
+
overflow: 'hidden auto',
|
|
15
|
+
style: { listStyleType: 'none' }
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
childExtend: {
|
|
19
|
+
extend: Button,
|
|
20
|
+
|
|
21
|
+
props: (el, s) => ({
|
|
22
|
+
active: s.active === el.key,
|
|
23
|
+
position: 'relative',
|
|
24
|
+
round: '0',
|
|
25
|
+
align: 'center flex-end',
|
|
26
|
+
flow: 'row-reverse',
|
|
27
|
+
padding: 'Z2 C Z2 Y2',
|
|
28
|
+
margin: '0',
|
|
29
|
+
gap: 'Y2',
|
|
30
|
+
theme: 'quaternary .child',
|
|
31
|
+
|
|
32
|
+
':hover': {
|
|
33
|
+
style: {
|
|
34
|
+
svg: { opacity: '0.5' }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
icon: {
|
|
39
|
+
active: s.active === el.key,
|
|
40
|
+
name: 'checkmark',
|
|
41
|
+
opacity: '0.1',
|
|
42
|
+
'.active': { opacity: '1' }
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
':not(:first-child)': {
|
|
46
|
+
'@dark': { border: 'gray4 .65, solid' },
|
|
47
|
+
'@light': { border: 'gray11, solid' },
|
|
48
|
+
borderWidth: '1px 0 0'
|
|
49
|
+
}
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/dropdown",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/atoms": "latest",
|
|
9
|
+
"@symbo.ls/button": "latest"
|
|
10
|
+
},
|
|
11
|
+
"source": "src/index.js"
|
|
12
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Focusable } from '@symbo.ls/atoms'
|
|
4
|
+
import { IconText } from '@symbo.ls/icon'
|
|
5
|
+
import { Input } from '@symbo.ls/input'
|
|
6
|
+
|
|
7
|
+
export const Field = {
|
|
8
|
+
extend: [IconText],
|
|
9
|
+
|
|
10
|
+
props: (el, s) => ({
|
|
11
|
+
value: s[el.key],
|
|
12
|
+
|
|
13
|
+
depth: 16,
|
|
14
|
+
placeholder: '',
|
|
15
|
+
padding: 'A B',
|
|
16
|
+
round: 'C',
|
|
17
|
+
type: 'text',
|
|
18
|
+
position: 'relative',
|
|
19
|
+
width: '16em',
|
|
20
|
+
|
|
21
|
+
style: {
|
|
22
|
+
appearance: 'none',
|
|
23
|
+
outline: 0,
|
|
24
|
+
border: 'none',
|
|
25
|
+
cursor: 'pointer',
|
|
26
|
+
fontFamily: 'inherit',
|
|
27
|
+
boxSizing: 'border-box'
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
input: {
|
|
31
|
+
width: '100%',
|
|
32
|
+
height: '100%',
|
|
33
|
+
border: 'none'
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
svg: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
right: '1em'
|
|
39
|
+
}
|
|
40
|
+
}),
|
|
41
|
+
|
|
42
|
+
input: { extend: [Focusable, Input] }
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/field",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
7
|
+
"dependencies": {
|
|
8
|
+
"@symbo.ls/icon-text": "latest",
|
|
9
|
+
"@symbo.ls/input": "latest",
|
|
10
|
+
"@symbo.ls/scratch": "latest"
|
|
11
|
+
},
|
|
12
|
+
"source": "src/index.js"
|
|
13
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { TYPOGRAPHY } from '@symbo.ls/scratch'
|
|
4
|
+
|
|
5
|
+
const primaryFont = Object.keys(TYPOGRAPHY)[0]
|
|
6
|
+
const defaultFont = primaryFont || '--system-default' // eslint-disable-line
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
appearance: 'none',
|
|
10
|
+
outline: 0,
|
|
11
|
+
border: 'none',
|
|
12
|
+
cursor: 'pointer',
|
|
13
|
+
fontFamily: 'inherit',
|
|
14
|
+
boxSizing: 'border-box',
|
|
15
|
+
position: 'relative',
|
|
16
|
+
padding: 0,
|
|
17
|
+
|
|
18
|
+
width: '16em',
|
|
19
|
+
|
|
20
|
+
input: {
|
|
21
|
+
width: '100%',
|
|
22
|
+
height: '100%',
|
|
23
|
+
border: 'none'
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
svg: {
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
right: '1em'
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex, SVG } from '@symbo.ls/atoms'
|
|
4
|
+
|
|
5
|
+
export const Icon = {
|
|
6
|
+
extend: SVG,
|
|
7
|
+
props: ({ key, props, parent, context }) => {
|
|
8
|
+
const { ICONS } = context && context.system
|
|
9
|
+
const iconName = props.inheritedString || props.name || props.icon || key
|
|
10
|
+
const camelCase = toCamelCase(iconName)
|
|
11
|
+
|
|
12
|
+
const isArray = camelCase.split(/([a-z])([A-Z])/g)
|
|
13
|
+
|
|
14
|
+
let activeIconName
|
|
15
|
+
if (props.active) {
|
|
16
|
+
activeIconName = props['.active'].name || props['.active'].icon
|
|
17
|
+
}
|
|
18
|
+
if (parent.props.active && parent.props['.active'] && parent.props['.active'].icon) {
|
|
19
|
+
activeIconName = parent.props['.active'].icon.name || parent.props['.active'].icon.icon || parent.props['.active'].icon
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const iconFromLibrary = ICONS[activeIconName] || ICONS[camelCase] || (ICONS[isArray[0] + isArray[1]]) || ICONS[isArray[0]] || ICONS['noIcon']
|
|
23
|
+
|
|
24
|
+
return {
|
|
25
|
+
width: 'A',
|
|
26
|
+
height: 'A',
|
|
27
|
+
display: 'inline-block',
|
|
28
|
+
src: iconFromLibrary,
|
|
29
|
+
style: { fill: 'currentColor' }
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
attr: { viewBox: '0 0 24 24' }
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export const IconText = {
|
|
36
|
+
extend: Flex,
|
|
37
|
+
|
|
38
|
+
props: {
|
|
39
|
+
align: 'center center',
|
|
40
|
+
lineHeight: 1
|
|
41
|
+
},
|
|
42
|
+
|
|
43
|
+
icon: {
|
|
44
|
+
extend: Icon,
|
|
45
|
+
if: ({ parent }) => parent.props.icon,
|
|
46
|
+
props: 'match'
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
text: ({ props }) => props.text
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Box } from '@symbo.ls/box'
|
|
4
|
+
import { Icon } from '@symbo.ls/icon'
|
|
5
|
+
|
|
6
|
+
export const IconText = {
|
|
7
|
+
props: {
|
|
8
|
+
flexAlign: 'center center',
|
|
9
|
+
display: 'flex',
|
|
10
|
+
lineHeight: 1
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
icon: { extend: Icon, if: ({ props }, s) => props.icon },
|
|
14
|
+
|
|
15
|
+
text: ({ props }) => props.text
|
|
16
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@symbo.ls/icon-text",
|
|
3
|
+
"version": "1.2.0",
|
|
4
|
+
"main": "index.js",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@symbo.ls/block": "latest",
|
|
8
|
+
"@symbo.ls/direction": "latest",
|
|
9
|
+
"@symbo.ls/icon": "latest",
|
|
10
|
+
"@symbo.ls/text": "latest"
|
|
11
|
+
},
|
|
12
|
+
"gitHead": "54fa6500c697604b3f48ba33a573545d7bff35fa",
|
|
13
|
+
"source": "src/index.js"
|
|
14
|
+
}
|