@symbo.ls/uikit 2.7.7 → 2.7.16
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/README.md +3 -6
- package/package.json +30 -39
- package/src/Banner/index.js +23 -0
- package/src/Banner/style.js +27 -0
- package/src/Box.js +16 -0
- package/src/Button.js +48 -0
- package/src/ButtonSet.js +9 -0
- package/src/Collection.js +82 -0
- package/src/DatePicker/index.js +155 -0
- package/src/DatePicker/style.js +18 -0
- package/src/Dropdown.js +51 -0
- package/src/Field.js +41 -0
- package/src/GridLayouts/index.js +20 -0
- package/src/GridLayouts/style.js +47 -0
- package/src/Icon.js +34 -0
- package/src/IconText.js +20 -0
- package/src/Input.js +32 -0
- package/src/Label.js +25 -0
- package/src/Link.js +20 -0
- package/src/Notification.js +46 -0
- package/src/Pills.js +25 -0
- package/src/Range.js +132 -0
- package/src/Select.js +36 -0
- package/src/Sidebar.js +23 -0
- package/src/TextArea.js +15 -0
- package/src/Tooltip.js +37 -0
- package/src/User.js +32 -0
- package/src/__/Media copy.js +121 -0
- package/src/atoms/Animation.js +52 -0
- package/src/atoms/Block.js +151 -0
- package/src/atoms/Direction.js +10 -0
- package/src/atoms/Flex.js +17 -0
- package/src/atoms/Form.js +11 -0
- package/src/atoms/Grid.js +30 -0
- package/src/atoms/Iframe.js +16 -0
- package/src/atoms/Img.js +17 -0
- package/src/atoms/Interaction.js +9 -0
- package/src/atoms/InteractiveComponent.js +78 -0
- package/src/atoms/Media.js +164 -0
- package/src/atoms/Overflow.js +7 -0
- package/src/atoms/Picture.js +31 -0
- package/src/atoms/Position.js +21 -0
- package/src/atoms/Pseudo.js +7 -0
- package/src/atoms/SVG.js +16 -0
- package/src/atoms/Shape/index.js +42 -0
- package/src/atoms/Shape/style.js +204 -0
- package/src/atoms/Text.js +40 -0
- package/src/atoms/Theme.js +136 -0
- package/src/atoms/Timing.js +55 -0
- package/src/atoms/Transform.js +8 -0
- package/src/atoms/XYZ.js +7 -0
- package/src/atoms/index.js +24 -0
- package/src/index.js +29 -0
- package/src/styles.js +6 -0
- package/index.js +0 -30
- package/react.js +0 -8
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Symbols
|
|
2
2
|
|
|
3
|
-
UI Library in composition of [Scratch](https://github.com/symbo.ls/scratch) and [DOMQL](https://github.com/symbo.ls/domql) or [
|
|
3
|
+
UI Library in composition of [Scratch](https://github.com/symbo.ls/scratch) and [DOMQL](https://github.com/symbo.ls/domql) or [React](https://github.com/symbo-ls/smbls/tree/main/packages/all/react.js)
|
|
4
4
|
|
|
5
5
|
Check out the [documentation page](https://docs.symbols.app/).
|
|
6
6
|
|
|
@@ -15,7 +15,7 @@ Library consists with packages. Components can be invoked individually.
|
|
|
15
15
|
|
|
16
16
|
1. Installation
|
|
17
17
|
```
|
|
18
|
-
yarn add
|
|
18
|
+
yarn add smbls@^1.1.1
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
2. Import the component from Symbols
|
|
@@ -26,10 +26,7 @@ import { Box } from 'smbls'
|
|
|
26
26
|
3. Use it inside your DOMQL code
|
|
27
27
|
### DOMQL
|
|
28
28
|
```javascript
|
|
29
|
-
const Header = {
|
|
30
|
-
proto: Box,
|
|
31
|
-
// ...Other Properties
|
|
32
|
-
}
|
|
29
|
+
const Header = { props }
|
|
33
30
|
```
|
|
34
31
|
|
|
35
32
|
### React
|
package/package.json
CHANGED
|
@@ -1,53 +1,44 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/uikit",
|
|
3
3
|
"description": "UI Library built on Scratch and DOMQL",
|
|
4
|
-
"
|
|
4
|
+
"private": false,
|
|
5
5
|
"author": "symbo.ls",
|
|
6
|
+
"version": "2.7.16",
|
|
6
7
|
"repository": "https://github.com/symbo-ls/smbls",
|
|
7
|
-
"main": "index.js",
|
|
8
|
+
"main": "src/index.js",
|
|
8
9
|
"files": [
|
|
9
|
-
"
|
|
10
|
-
"react.js"
|
|
10
|
+
"src"
|
|
11
11
|
],
|
|
12
12
|
"publishConfig": {
|
|
13
13
|
"registry": "https://registry.npmjs.org"
|
|
14
14
|
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"start": "parcel showcase/index.html",
|
|
17
|
+
"build": "parcel build showcase/index.html --public-url .",
|
|
18
|
+
"deploy": "yarn build && gh-pages -d dist",
|
|
19
|
+
"clean": "rm yarn.lock && rm -rf node_modules && rm -rf dist && rm -rf .cache",
|
|
20
|
+
"reinstall": "rm yarn.lock && rm -rf node_modules/rackai && yarn"
|
|
21
|
+
},
|
|
15
22
|
"dependencies": {
|
|
16
|
-
"@
|
|
17
|
-
"@symbo.ls/block": "latest",
|
|
18
|
-
"@symbo.ls/box": "latest",
|
|
19
|
-
"@symbo.ls/button": "latest",
|
|
20
|
-
"@symbo.ls/buttonset": "latest",
|
|
21
|
-
"@symbo.ls/config-default": "latest",
|
|
22
|
-
"@symbo.ls/datepicker": "latest",
|
|
23
|
-
"@symbo.ls/direction": "latest",
|
|
24
|
-
"@symbo.ls/dropdown": "latest",
|
|
25
|
-
"@symbo.ls/field": "latest",
|
|
26
|
-
"@symbo.ls/flex": "latest",
|
|
27
|
-
"@symbo.ls/grid": "latest",
|
|
28
|
-
"@symbo.ls/icon": "latest",
|
|
29
|
-
"@symbo.ls/icon-text": "latest",
|
|
30
|
-
"@symbo.ls/img": "latest",
|
|
23
|
+
"@domql/utils": "latest",
|
|
31
24
|
"@symbo.ls/init": "latest",
|
|
32
|
-
"@symbo.ls/
|
|
33
|
-
"@symbo.ls/
|
|
34
|
-
"@symbo.ls/
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"@symbo.ls/
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"@symbo.ls/tooltip": "latest",
|
|
48
|
-
"@symbo.ls/user": "latest"
|
|
25
|
+
"@symbo.ls/utils": "latest",
|
|
26
|
+
"@symbo.ls/cli": "latest",
|
|
27
|
+
"@symbo.ls/socket": "latest"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@symbo.ls/scratch": "latest"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@babel/core": "^7.11.5",
|
|
34
|
+
"@emotion/css": "^11.5.0",
|
|
35
|
+
"babel-eslint": "^10.0.3",
|
|
36
|
+
"eslint": "^6.1.0",
|
|
37
|
+
"parcel-bundler": "^1.12.4",
|
|
38
|
+
"parcel-plugin-svg-sprite": "^1.4.1",
|
|
39
|
+
"standard": "^13.1.0"
|
|
49
40
|
},
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
"standard": {
|
|
42
|
+
"parser": "babel-eslint"
|
|
43
|
+
}
|
|
53
44
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { styleParentMode } from './style'
|
|
4
|
+
|
|
5
|
+
import { Shape, Icon } from '..'
|
|
6
|
+
import { UserBundle } from '../User'
|
|
7
|
+
|
|
8
|
+
export const ParentMode = {
|
|
9
|
+
extend: Shape,
|
|
10
|
+
round: 10,
|
|
11
|
+
theme: 'purple',
|
|
12
|
+
style: styleParentMode,
|
|
13
|
+
icon: {
|
|
14
|
+
extend: Icon,
|
|
15
|
+
props: { icon: 'checkMedium' }
|
|
16
|
+
},
|
|
17
|
+
h2: 'Welcome to parent Mode',
|
|
18
|
+
description: {
|
|
19
|
+
extend: UserBundle,
|
|
20
|
+
users: { ...[{}, {}, {}] },
|
|
21
|
+
span: 'You\'ll now be able to chat with tutor privately. No other participants will see the messages.'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -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
|
+
}
|
package/src/Box.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Media, Interaction, XYZ, Animation } from './atoms'
|
|
4
|
+
|
|
5
|
+
const PropsCSS = {
|
|
6
|
+
class: {
|
|
7
|
+
style: ({ props }) => props && props.style
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export const Box = {
|
|
12
|
+
extend: [Shape, Position, Theme, Block, Text, Overflow, Timing, Transform, Media, PropsCSS, Interaction, XYZ, Animation],
|
|
13
|
+
attr: {
|
|
14
|
+
id: ({ props }) => props.id
|
|
15
|
+
}
|
|
16
|
+
}
|
package/src/Button.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { FocusableComponent } from './atoms'
|
|
4
|
+
import { IconText } from '.'
|
|
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
|
+
}
|
package/src/ButtonSet.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { isNot, isArray, isObject, isObjectLike, diff, deepClone } from '@domql/utils'
|
|
4
|
+
|
|
5
|
+
export const Collection = {
|
|
6
|
+
define: {
|
|
7
|
+
$setCollection: (param, el, state) => {
|
|
8
|
+
if (!param) return
|
|
9
|
+
|
|
10
|
+
let data = isArray(param) ? param : []
|
|
11
|
+
|
|
12
|
+
if (isObject(param)) {
|
|
13
|
+
for (const obj in param) { data.push(param[obj]) }
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
data = data.map(item => !isObjectLike(item) ? {
|
|
17
|
+
props: { value: item }
|
|
18
|
+
} : item)
|
|
19
|
+
|
|
20
|
+
if (data.length) {
|
|
21
|
+
const t = setTimeout(() => {
|
|
22
|
+
el.set({ tag: 'fragment', ...data }, { preventDefineUpdate: '$setCollection' })
|
|
23
|
+
clearTimeout(t)
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
return data
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
$setStateCollection: (param, el, state) => {
|
|
31
|
+
if (!param) return
|
|
32
|
+
if (param.parse) param = param.parse()
|
|
33
|
+
if (isNot(param)('array', 'object')) return
|
|
34
|
+
|
|
35
|
+
if (el.key === 'cnt') {
|
|
36
|
+
if (el.__stateCollectionCache) {
|
|
37
|
+
const d = diff(param, el.__stateCollectionCache) // eslint-disable-line
|
|
38
|
+
} else {
|
|
39
|
+
el.__stateCollectionCache = deepClone(param)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const obj = { tag: 'fragment' }
|
|
44
|
+
|
|
45
|
+
for (const key in param) {
|
|
46
|
+
const value = param[key]
|
|
47
|
+
obj[key] = { state: isObjectLike(value) ? value : { value } }
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const set = () => {
|
|
51
|
+
el.set(obj, { preventDefineUpdate: '$setStateCollection' })
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (el.props.lazyLoad) {
|
|
55
|
+
window.requestAnimationFrame(set)
|
|
56
|
+
} else set()
|
|
57
|
+
|
|
58
|
+
return obj
|
|
59
|
+
},
|
|
60
|
+
|
|
61
|
+
$setPropsCollection: (param, el, state) => {
|
|
62
|
+
if (!param) return
|
|
63
|
+
if (isNot(param)('array', 'object')) return
|
|
64
|
+
|
|
65
|
+
const obj = { tag: 'fragment' }
|
|
66
|
+
for (const key in param) {
|
|
67
|
+
const value = param[key]
|
|
68
|
+
obj[key] = { props: isObjectLike(value) ? value : { value } }
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const set = () => {
|
|
72
|
+
el.set(obj, { preventDefineUpdate: '$setStateCollection' })
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
if (el.props.lazyLoad) {
|
|
76
|
+
window.requestAnimationFrame(set)
|
|
77
|
+
} else set()
|
|
78
|
+
|
|
79
|
+
return obj
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import style from './style'
|
|
4
|
+
|
|
5
|
+
import { SquareButton, Flex, Button, Grid } from '..'
|
|
6
|
+
|
|
7
|
+
const buttonProps = {
|
|
8
|
+
theme: 'transparent',
|
|
9
|
+
color: '--theme-quinary-dark-color',
|
|
10
|
+
':hover': {
|
|
11
|
+
theme: 'quinary .child'
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const aside = {
|
|
16
|
+
props: {
|
|
17
|
+
gap: 'X2',
|
|
18
|
+
margin: '-Z - -Z -X2',
|
|
19
|
+
padding: 'Z - Z X2',
|
|
20
|
+
minHeight: '100%',
|
|
21
|
+
height: '100%',
|
|
22
|
+
width: '--spacing-D'
|
|
23
|
+
},
|
|
24
|
+
|
|
25
|
+
cnt: {
|
|
26
|
+
extend: Flex,
|
|
27
|
+
props: {
|
|
28
|
+
flow: 'column',
|
|
29
|
+
overflow: 'hidden auto',
|
|
30
|
+
boxSize: '100% --spacing-D',
|
|
31
|
+
top: '0',
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
maxHeight: '100%',
|
|
34
|
+
justifyContent: 'flex-end'
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
childExtend: {
|
|
38
|
+
extend: Button,
|
|
39
|
+
props: {
|
|
40
|
+
...buttonProps,
|
|
41
|
+
fontSize: 'Z1'
|
|
42
|
+
},
|
|
43
|
+
text: ({ state }) => state.value
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const main = {
|
|
50
|
+
extend: Flex,
|
|
51
|
+
|
|
52
|
+
props: {
|
|
53
|
+
flex: 1,
|
|
54
|
+
gap: 'X2',
|
|
55
|
+
flow: 'column',
|
|
56
|
+
|
|
57
|
+
header: {
|
|
58
|
+
align: 'center space-between'
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
header: {
|
|
63
|
+
extend: Flex,
|
|
64
|
+
left: {
|
|
65
|
+
extend: SquareButton,
|
|
66
|
+
props: {
|
|
67
|
+
...buttonProps,
|
|
68
|
+
round: 'C',
|
|
69
|
+
icon: 'arrowAngleLeft'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
month: {
|
|
73
|
+
tag: 'span',
|
|
74
|
+
text: 'December'
|
|
75
|
+
},
|
|
76
|
+
right: {
|
|
77
|
+
extend: SquareButton,
|
|
78
|
+
props: {
|
|
79
|
+
...buttonProps,
|
|
80
|
+
round: 'C',
|
|
81
|
+
icon: 'arrowAngleRight'
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
days: {
|
|
86
|
+
extend: Flex,
|
|
87
|
+
props: {
|
|
88
|
+
flow: 'column',
|
|
89
|
+
gap: 'X2'
|
|
90
|
+
},
|
|
91
|
+
childExtend: {
|
|
92
|
+
extend: Grid,
|
|
93
|
+
props: {
|
|
94
|
+
columns: 'repeat(7, 1fr)',
|
|
95
|
+
gap: 'X2'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
weekDays: {
|
|
99
|
+
childExtend: {
|
|
100
|
+
extend: Button,
|
|
101
|
+
props: {
|
|
102
|
+
...buttonProps,
|
|
103
|
+
fontSize: 'Z1',
|
|
104
|
+
padding: 'X2'
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
...[
|
|
108
|
+
{ text: 'Mo' },
|
|
109
|
+
{ text: 'Tu' },
|
|
110
|
+
{ text: 'We' },
|
|
111
|
+
{ text: 'Th' },
|
|
112
|
+
{ text: 'Fr' },
|
|
113
|
+
{ text: 'Sa' },
|
|
114
|
+
{ text: 'Su' }
|
|
115
|
+
]
|
|
116
|
+
},
|
|
117
|
+
|
|
118
|
+
cnt: {
|
|
119
|
+
childExtend: {
|
|
120
|
+
extend: SquareButton,
|
|
121
|
+
|
|
122
|
+
props: ({ key, state }) => ({
|
|
123
|
+
...buttonProps,
|
|
124
|
+
theme: 'quaternary',
|
|
125
|
+
active: key === '18',
|
|
126
|
+
'.active': {
|
|
127
|
+
theme: 'quinary'
|
|
128
|
+
}
|
|
129
|
+
})
|
|
130
|
+
},
|
|
131
|
+
|
|
132
|
+
...new Array(31).fill(undefined).map((_, i) => ({ text: i + 1 }))
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export const DatePicker = {
|
|
138
|
+
style,
|
|
139
|
+
extend: Flex,
|
|
140
|
+
|
|
141
|
+
props: {
|
|
142
|
+
position: 'relative',
|
|
143
|
+
theme: 'quinary',
|
|
144
|
+
transition: 'A all',
|
|
145
|
+
round: 'Z',
|
|
146
|
+
padding: 'Z Z2 Z X2',
|
|
147
|
+
gap: 'X2',
|
|
148
|
+
depth: 16,
|
|
149
|
+
minHeight: '0',
|
|
150
|
+
align: 'stretch center'
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
aside,
|
|
154
|
+
main
|
|
155
|
+
}
|
|
@@ -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
|
+
}
|
package/src/Dropdown.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Flex, Button } from '.'
|
|
4
|
+
|
|
5
|
+
export const DropdownList = {
|
|
6
|
+
extend: Flex,
|
|
7
|
+
|
|
8
|
+
props: {
|
|
9
|
+
padding: '0 Y',
|
|
10
|
+
maxHeight: 'G',
|
|
11
|
+
flow: 'column',
|
|
12
|
+
theme: 'quaternary',
|
|
13
|
+
overflow: 'hidden auto',
|
|
14
|
+
style: { listStyleType: 'none' }
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
childExtend: {
|
|
18
|
+
extend: Button,
|
|
19
|
+
|
|
20
|
+
props: (el, s) => ({
|
|
21
|
+
active: s.active === el.key,
|
|
22
|
+
position: 'relative',
|
|
23
|
+
round: '0',
|
|
24
|
+
align: 'center flex-end',
|
|
25
|
+
flow: 'row-reverse',
|
|
26
|
+
padding: 'Z2 C Z2 Y2',
|
|
27
|
+
margin: '0',
|
|
28
|
+
gap: 'Y2',
|
|
29
|
+
theme: 'quaternary .child',
|
|
30
|
+
|
|
31
|
+
':hover': {
|
|
32
|
+
style: {
|
|
33
|
+
svg: { opacity: '0.5' }
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
icon: {
|
|
38
|
+
active: s.active === el.key,
|
|
39
|
+
name: 'checkmark',
|
|
40
|
+
opacity: '0.1',
|
|
41
|
+
'.active': { opacity: '1' }
|
|
42
|
+
},
|
|
43
|
+
|
|
44
|
+
':not(:first-child)': {
|
|
45
|
+
'@dark': { border: 'gray4 .65, solid' },
|
|
46
|
+
'@light': { border: 'gray11, solid' },
|
|
47
|
+
borderWidth: '1px 0 0'
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
}
|
|
51
|
+
}
|
package/src/Field.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { IconText, Input, Focusable } from '.'
|
|
4
|
+
|
|
5
|
+
export const Field = {
|
|
6
|
+
extend: [IconText],
|
|
7
|
+
|
|
8
|
+
props: (el, s) => ({
|
|
9
|
+
value: s[el.key],
|
|
10
|
+
|
|
11
|
+
depth: 16,
|
|
12
|
+
placeholder: '',
|
|
13
|
+
padding: 'A B',
|
|
14
|
+
round: 'C',
|
|
15
|
+
type: 'text',
|
|
16
|
+
position: 'relative',
|
|
17
|
+
width: '16em',
|
|
18
|
+
|
|
19
|
+
style: {
|
|
20
|
+
appearance: 'none',
|
|
21
|
+
outline: 0,
|
|
22
|
+
border: 'none',
|
|
23
|
+
cursor: 'pointer',
|
|
24
|
+
fontFamily: 'inherit',
|
|
25
|
+
boxSizing: 'border-box'
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
input: {
|
|
29
|
+
width: '100%',
|
|
30
|
+
height: '100%',
|
|
31
|
+
border: 'none'
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
svg: {
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
right: '1em'
|
|
37
|
+
}
|
|
38
|
+
}),
|
|
39
|
+
|
|
40
|
+
input: { extend: [Focusable, Input] }
|
|
41
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Button, Link } from '..'
|
|
4
|
+
|
|
5
|
+
import { styleGrid, styleGrid2 } from './style'
|
|
6
|
+
|
|
7
|
+
const componentLink = {
|
|
8
|
+
extend: Link,
|
|
9
|
+
attr: {
|
|
10
|
+
href: '#'
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const grid = {
|
|
15
|
+
style: styleGrid
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export const grid2 = {
|
|
19
|
+
style: styleGrid2
|
|
20
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
export const styleGrid = {
|
|
4
|
+
display: 'grid',
|
|
5
|
+
gridTemplateColumns: 'repeat(15, 1fr)',
|
|
6
|
+
boxSizing: 'border-box',
|
|
7
|
+
padding: '0 8em',
|
|
8
|
+
marginBottom: '2em',
|
|
9
|
+
rowGap: '10px',
|
|
10
|
+
gridAutoColumns: 'auto',
|
|
11
|
+
gridAutoRows: 'auto',
|
|
12
|
+
gridAutoFlow: 'column',
|
|
13
|
+
'> a': {
|
|
14
|
+
padding: '70px 0',
|
|
15
|
+
display: 'flex',
|
|
16
|
+
justifyContent: 'center',
|
|
17
|
+
background: 'rgba(255, 255, 255, .05)',
|
|
18
|
+
borderRadius: '12px',
|
|
19
|
+
alignItems: 'center'
|
|
20
|
+
},
|
|
21
|
+
'> a:first-child': {
|
|
22
|
+
gridColumn: '1 / span 15'
|
|
23
|
+
},
|
|
24
|
+
'> a:nth-child(2)': {
|
|
25
|
+
gridRow: '2',
|
|
26
|
+
gridColumn: '1 / span 3',
|
|
27
|
+
marginRight: '10px'
|
|
28
|
+
},
|
|
29
|
+
'> a:nth-child(3)': {
|
|
30
|
+
gridRow: '2',
|
|
31
|
+
gridColumn: '4 / span 6',
|
|
32
|
+
marginRight: '10px'
|
|
33
|
+
},
|
|
34
|
+
'> a:nth-child(4)': {
|
|
35
|
+
gridRow: '2',
|
|
36
|
+
gridColumn: '10 / span 15'
|
|
37
|
+
},
|
|
38
|
+
'> a:nth-child(5)': {
|
|
39
|
+
gridRow: '3',
|
|
40
|
+
gridColumn: '1 / span 6',
|
|
41
|
+
marginRight: '10px'
|
|
42
|
+
},
|
|
43
|
+
'> a:nth-child(6)': {
|
|
44
|
+
gridRow: '3',
|
|
45
|
+
gridColumn: '7 / span 15'
|
|
46
|
+
}
|
|
47
|
+
}
|
package/src/Icon.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { SVG } from './atoms'
|
|
4
|
+
import { toCamelCase } from '@symbo.ls/utils'
|
|
5
|
+
|
|
6
|
+
export const Icon = {
|
|
7
|
+
extend: SVG,
|
|
8
|
+
props: ({ key, props, parent, context }) => {
|
|
9
|
+
const { ICONS } = context && context.system
|
|
10
|
+
const iconName = props.inheritedString || props.name || props.icon || key
|
|
11
|
+
const camelCase = toCamelCase(iconName)
|
|
12
|
+
|
|
13
|
+
const isArray = camelCase.split(/([a-z])([A-Z])/g)
|
|
14
|
+
|
|
15
|
+
let activeIconName
|
|
16
|
+
if (props.active) {
|
|
17
|
+
activeIconName = props['.active'].name || props['.active'].icon
|
|
18
|
+
}
|
|
19
|
+
if (parent.props.active && parent.props['.active'] && parent.props['.active'].icon) {
|
|
20
|
+
activeIconName = parent.props['.active'].icon.name || parent.props['.active'].icon.icon || parent.props['.active'].icon
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const iconFromLibrary = ICONS[activeIconName] || ICONS[camelCase] || (ICONS[isArray[0] + isArray[1]]) || ICONS[isArray[0]] || ICONS['noIcon']
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
width: 'A',
|
|
27
|
+
height: 'A',
|
|
28
|
+
display: 'inline-block',
|
|
29
|
+
src: iconFromLibrary,
|
|
30
|
+
style: { fill: 'currentColor' }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
attr: { viewBox: '0 0 24 24' }
|
|
34
|
+
}
|