@symbo.ls/preview 0.0.9 → 0.0.11
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/package.json +8 -8
- package/src/app.js +1 -0
- package/src/components/ShapeSet.js +45 -0
- package/src/components/index.js +1 -0
- package/src/config/index.js +1 -1
- package/src/index.js +4 -1
- package/src/pages/Color/colors.js +29 -42
- package/src/pages/Color/documentThemes.js +65 -86
- package/src/pages/Color/index.js +8 -9
- package/src/pages/Color/themes.js +2 -2
- package/src/pages/ColorEditor/index.js +2 -2
- package/src/pages/Shapes/index.js +16 -113
- package/src/pages/Shapes/shapeSet.js +76 -0
- package/src/pages/Shapes/style.js +0 -17
- package/src/pages/Spaces/index.js +6 -19
- package/src/pages/Typography/docFonts.js +60 -90
- package/src/pages/Typography/docStyles.js +4 -1
- package/src/pages/Typography/index.js +18 -29
- package/src/pages/Typography/shared.js +1 -2
- package/src/pages/Typography/state.js +4 -2
- package/src/pages/Typography/typeScale.js +0 -3
- package/src/state.js +7 -1
- package/src/pages/Color/style.js +0 -7
- package/src/pages/Typography/style.js +0 -11
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@symbo.ls/preview",
|
|
3
3
|
"description": "",
|
|
4
4
|
"author": "",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.11",
|
|
6
6
|
"repository": "https://github.com/rackai/editor",
|
|
7
7
|
"main": "src/index.js",
|
|
8
8
|
"scripts": {
|
|
@@ -24,13 +24,13 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@domql/router": "
|
|
28
|
-
"@symbo.ls/components": "
|
|
29
|
-
"@symbo.ls/config": "
|
|
30
|
-
"@symbo.ls/icons": "
|
|
31
|
-
"@symbo.ls/init": "
|
|
32
|
-
"@symbo.ls/scratch": "
|
|
33
|
-
"@symbo.ls/utils": "
|
|
27
|
+
"@domql/router": "latest",
|
|
28
|
+
"@symbo.ls/components": "latest",
|
|
29
|
+
"@symbo.ls/config": "latest",
|
|
30
|
+
"@symbo.ls/icons": "latest",
|
|
31
|
+
"@symbo.ls/init": "latest",
|
|
32
|
+
"@symbo.ls/scratch": "latest",
|
|
33
|
+
"@symbo.ls/utils": "latest",
|
|
34
34
|
"domql": "^1.5.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
package/src/app.js
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Link, Flex, ClickableItem } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
const ShapeItem = {
|
|
6
|
+
extend: [ClickableItem, Link, Flex],
|
|
7
|
+
|
|
8
|
+
props: el => ({
|
|
9
|
+
href: `/shapes/${el.parent.parent.key}-${el.key}`,
|
|
10
|
+
padding: 'B',
|
|
11
|
+
round: 'Z',
|
|
12
|
+
background: 'white .05',
|
|
13
|
+
alignItems: 'center',
|
|
14
|
+
justifyContent: 'center',
|
|
15
|
+
|
|
16
|
+
_shape: {
|
|
17
|
+
theme: 'quaternary',
|
|
18
|
+
width: 'C',
|
|
19
|
+
height: 'C'
|
|
20
|
+
}
|
|
21
|
+
}),
|
|
22
|
+
|
|
23
|
+
_shape: {}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export const ShapeSet = {
|
|
27
|
+
props: {
|
|
28
|
+
label: {
|
|
29
|
+
display: 'block',
|
|
30
|
+
size: 'Y',
|
|
31
|
+
opacity: '.65',
|
|
32
|
+
padding: '0 0 Z 0'
|
|
33
|
+
},
|
|
34
|
+
nav: {
|
|
35
|
+
gap: 'A',
|
|
36
|
+
flexWrap: 'wrap'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
label: {},
|
|
41
|
+
nav: {
|
|
42
|
+
extend: Flex,
|
|
43
|
+
childExtend: ShapeItem
|
|
44
|
+
}
|
|
45
|
+
}
|
package/src/components/index.js
CHANGED
package/src/config/index.js
CHANGED
package/src/index.js
CHANGED
|
@@ -11,6 +11,8 @@ import App from './app'
|
|
|
11
11
|
import { Header } from './components'
|
|
12
12
|
import { Library } from './pages'
|
|
13
13
|
|
|
14
|
+
import { context } from './state'
|
|
15
|
+
|
|
14
16
|
smbls.init({ verbose: false, ...SYMBOLS_CONF })
|
|
15
17
|
|
|
16
18
|
DOM.define({
|
|
@@ -29,5 +31,6 @@ export default DOM.create({
|
|
|
29
31
|
}
|
|
30
32
|
}, undefined, 'app', {
|
|
31
33
|
extend: [smbls.Box],
|
|
32
|
-
components: { ...smbls }
|
|
34
|
+
components: { ...smbls },
|
|
35
|
+
context
|
|
33
36
|
})
|
|
@@ -1,58 +1,45 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { SectionHeader, ColorTemplate, Flex } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
const mapColors = (el, s) => {
|
|
6
|
+
if (!el.context.SYSTEM) return
|
|
7
|
+
const { COLOR } = el.context.SYSTEM
|
|
8
|
+
const colorKeys = Object.keys(COLOR)
|
|
9
|
+
Object.keys(COLOR).map(v => {
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
return colorKeys.map(v => COLOR[v])
|
|
13
|
+
}
|
|
4
14
|
|
|
5
15
|
export default {
|
|
6
|
-
tag: 'section',
|
|
7
16
|
header: {
|
|
8
17
|
extend: SectionHeader,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
18
|
+
state: {
|
|
19
|
+
title: 'Color Palette',
|
|
20
|
+
p: 'Document styling and theming',
|
|
21
|
+
nav: [{
|
|
22
|
+
icon: 'plus',
|
|
23
|
+
href: '/colors/add-color'
|
|
24
|
+
}]
|
|
13
25
|
}
|
|
14
26
|
},
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
27
|
+
|
|
28
|
+
content: {
|
|
29
|
+
extend: Flex,
|
|
30
|
+
props: {
|
|
31
|
+
gap: 'A1',
|
|
19
32
|
alignItems: 'center'
|
|
20
33
|
},
|
|
21
34
|
colors: {
|
|
22
|
-
|
|
23
|
-
display: 'flex',
|
|
24
|
-
gap: '12px'
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
content: (el, s) => {
|
|
28
|
-
if (!el.__root.state.CONFIG) return
|
|
29
|
-
const { COLOR } = el.__root.state.CONFIG
|
|
30
|
-
|
|
31
|
-
const Colors = {}
|
|
32
|
-
Object.keys(COLOR).map(v => {
|
|
33
|
-
Colors[v] = { state: COLOR[v] }
|
|
34
|
-
})
|
|
35
|
-
|
|
36
|
-
return {
|
|
37
|
-
childExtend: ColorTemplate,
|
|
38
|
-
tag: 'fragment',
|
|
39
|
-
|
|
40
|
-
...Colors
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
plus: {
|
|
45
|
-
extend: Button,
|
|
35
|
+
extend: Flex,
|
|
46
36
|
props: {
|
|
47
|
-
|
|
48
|
-
|
|
37
|
+
flow: 'row wrap',
|
|
38
|
+
gap: 'Z2'
|
|
49
39
|
},
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
background: 'rgba(255, 255, 255, .06)',
|
|
54
|
-
color: 'white'
|
|
55
|
-
}
|
|
40
|
+
|
|
41
|
+
childExtend: ColorTemplate,
|
|
42
|
+
$setCollection: mapColors
|
|
56
43
|
}
|
|
57
44
|
}
|
|
58
45
|
}
|
|
@@ -1,101 +1,80 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Notification, Flex, ClickableItem, SectionHeader,
|
|
3
|
+
import { Notification, Flex, ClickableItem, SectionHeader, IconText, Link } from '@symbo.ls/components'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const ThemeItem = {
|
|
6
|
+
extend: [Notification, ClickableItem],
|
|
7
|
+
|
|
8
|
+
// if: ({ context, state }) => {
|
|
9
|
+
// if (!context?.SYSTEM) return
|
|
10
|
+
// const { THEME } = context.SYSTEM
|
|
11
|
+
// console.log(!!THEME.document[`@${state.key}`])
|
|
12
|
+
// return !!THEME.document[`@${state.key}`]
|
|
13
|
+
// },
|
|
14
|
+
|
|
15
|
+
props: ({ state }) => ({
|
|
16
|
+
opacity: '.5',
|
|
17
|
+
textDecoration: 'none',
|
|
18
|
+
gap: 'Z',
|
|
19
|
+
round: 'Z',
|
|
20
|
+
padding: 'Z1 D2 A A1',
|
|
21
|
+
theme: `document @${state.key}`,
|
|
22
|
+
fontWeight: '400',
|
|
23
|
+
href: `/colors/document-theme/${state.key}`,
|
|
24
|
+
|
|
25
|
+
icon: {
|
|
26
|
+
size: 'Z',
|
|
27
|
+
padding: 'Z',
|
|
28
|
+
round: 'Z',
|
|
29
|
+
theme: `sepia @${state.key}`,
|
|
30
|
+
icon: state.icon
|
|
31
|
+
},
|
|
32
|
+
article: {
|
|
33
|
+
gap: 'X',
|
|
34
|
+
title: {
|
|
35
|
+
size: 'B'
|
|
36
|
+
},
|
|
37
|
+
p: {
|
|
38
|
+
fontSize: 'Y',
|
|
39
|
+
text: state.key
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}),
|
|
43
|
+
|
|
44
|
+
icon: { extend: IconText },
|
|
45
|
+
article: {
|
|
46
|
+
title: {
|
|
47
|
+
text: ({ state }) => state.title
|
|
48
|
+
},
|
|
49
|
+
p: {
|
|
50
|
+
span: ({ state }) => 'prefers-color-scheme: '
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
6
54
|
|
|
7
55
|
export default {
|
|
8
|
-
tag: 'section',
|
|
9
56
|
header: {
|
|
10
57
|
extend: SectionHeader,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
p: { text: 'Document styling and theming provides global themes of the entire app, imagine it as a <body> styling' }
|
|
58
|
+
state: {
|
|
59
|
+
title: 'Global Themes',
|
|
60
|
+
p: 'Document styling and theming provides global themes of the entire app, imagine it as a <body> styling'
|
|
15
61
|
}
|
|
16
62
|
},
|
|
17
63
|
|
|
18
|
-
|
|
64
|
+
modes: {
|
|
19
65
|
extend: Flex,
|
|
20
|
-
|
|
66
|
+
props: { gap: 'A' },
|
|
21
67
|
|
|
22
|
-
|
|
23
|
-
gap: 16
|
|
24
|
-
},
|
|
25
|
-
|
|
26
|
-
childExtend: {
|
|
27
|
-
extend: [Notification, ClickableItem, Link],
|
|
28
|
-
style: {
|
|
29
|
-
opacity: '.5',
|
|
30
|
-
textDecoration: 'none'
|
|
31
|
-
},
|
|
32
|
-
props: {
|
|
33
|
-
gap: 'Z',
|
|
34
|
-
round: 'Z',
|
|
35
|
-
padding: 'Z1 D2 A A1',
|
|
36
|
-
href: '/colors/documentThemes/addit-theme'
|
|
37
|
-
},
|
|
38
|
-
icon: {
|
|
39
|
-
extend: [Shape, Block, IconText],
|
|
40
|
-
props: {
|
|
41
|
-
size: 'Z',
|
|
42
|
-
padding: 'Z',
|
|
43
|
-
round: 'Z'
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
article: {
|
|
47
|
-
props: { gap: 'X' },
|
|
48
|
-
caption: {
|
|
49
|
-
style: { fontWeight: 'bold' },
|
|
50
|
-
props: { size: 'B' }
|
|
51
|
-
},
|
|
52
|
-
p: {
|
|
53
|
-
props: { size: 'Y' },
|
|
54
|
-
style: { '> span': { fontWeight: 'bold' } }
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
68
|
+
childExtend: [ThemeItem, Link],
|
|
58
69
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
69
|
-
article: {
|
|
70
|
-
caption: { text: 'Light' },
|
|
71
|
-
p: {
|
|
72
|
-
text: 'prefers-color-scheme:',
|
|
73
|
-
span: ' Light'
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, {
|
|
77
|
-
if: el => {
|
|
78
|
-
if (!el.__root.state.CONFIG) return
|
|
79
|
-
const { THEME } = el.__root.state.CONFIG
|
|
80
|
-
return THEME.document.variants && THEME.document.variants.dark
|
|
81
|
-
},
|
|
82
|
-
props: el => {
|
|
83
|
-
if (!el.__root.state.CONFIG) return
|
|
84
|
-
const { THEME } = el.__root.state.CONFIG
|
|
85
|
-
return { theme: THEME.document.value }
|
|
86
|
-
},
|
|
87
|
-
style: { color: 'white' },
|
|
88
|
-
icon: {
|
|
89
|
-
props: { theme: 'darkMode', icon: 'moon' }
|
|
90
|
-
},
|
|
91
|
-
article: {
|
|
92
|
-
caption: { text: 'Dark' },
|
|
93
|
-
p: {
|
|
94
|
-
text: 'prefers-color-scheme:',
|
|
95
|
-
span: ' Dark'
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
]
|
|
70
|
+
$setCollection: () => [{
|
|
71
|
+
title: 'Light',
|
|
72
|
+
key: 'light',
|
|
73
|
+
icon: 'sun'
|
|
74
|
+
}, {
|
|
75
|
+
title: 'Dark',
|
|
76
|
+
key: 'dark',
|
|
77
|
+
icon: 'moon'
|
|
78
|
+
}]
|
|
100
79
|
}
|
|
101
80
|
}
|
package/src/pages/Color/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { Line } from '@symbo.ls/components'
|
|
4
4
|
|
|
5
|
-
import { PageExtend } from '..'
|
|
6
|
-
|
|
7
|
-
import palette from './colors'
|
|
8
5
|
import documentThemes from './documentThemes'
|
|
6
|
+
import palette from './colors'
|
|
9
7
|
import themes from './themes'
|
|
10
8
|
|
|
11
9
|
export const Color = {
|
|
12
|
-
style,
|
|
13
10
|
key: 'colors',
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
props: {
|
|
12
|
+
gap: '68px'
|
|
13
|
+
},
|
|
16
14
|
|
|
17
15
|
documentThemes,
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
line: { extend: Line },
|
|
17
|
+
palette
|
|
18
|
+
// themes
|
|
20
19
|
}
|
|
@@ -114,8 +114,8 @@ export default {
|
|
|
114
114
|
},
|
|
115
115
|
|
|
116
116
|
content: (el, s) => {
|
|
117
|
-
if (!el.
|
|
118
|
-
const { THEME } = el.
|
|
117
|
+
if (!el.context.SYSTEM) return
|
|
118
|
+
const { THEME } = el.context.SYSTEM
|
|
119
119
|
|
|
120
120
|
const Themes = {}
|
|
121
121
|
Object.keys(THEME).map(v => (Themes[v] = { state: THEME[v].value }))
|
|
@@ -127,13 +127,13 @@ export const ColorEditor = {
|
|
|
127
127
|
|
|
128
128
|
on: {
|
|
129
129
|
init: (el, s) => {
|
|
130
|
-
if (!el.
|
|
130
|
+
if (!el.context.SYSTEM) return
|
|
131
131
|
|
|
132
132
|
var route = window.location.pathname
|
|
133
133
|
var routes = route.slice(1).split('/')
|
|
134
134
|
var param = routes[1]
|
|
135
135
|
|
|
136
|
-
const { THEME } = el.
|
|
136
|
+
const { THEME } = el.context.SYSTEM
|
|
137
137
|
var content = THEME[`${param}`].value
|
|
138
138
|
content.title = param
|
|
139
139
|
el.state.value = content
|
|
@@ -1,121 +1,19 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Flex, SectionHeader, Line } from '@symbo.ls/components'
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
padding: 'B',
|
|
13
|
-
round: 'Z'
|
|
14
|
-
}),
|
|
15
|
-
|
|
16
|
-
_shape: {
|
|
17
|
-
props: {
|
|
18
|
-
theme: 'quaternary',
|
|
19
|
-
width: 'C',
|
|
20
|
-
height: 'C'
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const ShapeSet = {
|
|
26
|
-
style: styleShapeSet,
|
|
27
|
-
label: {
|
|
28
|
-
props: {
|
|
29
|
-
display: 'block',
|
|
30
|
-
size: 'Y',
|
|
31
|
-
padding: '0 0 Z 0'
|
|
32
|
-
}
|
|
33
|
-
},
|
|
34
|
-
nav: {
|
|
35
|
-
extend: Flex,
|
|
36
|
-
props: { gap: 'Z1' },
|
|
37
|
-
childExtend: ShapeItem
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const rectangle = {
|
|
42
|
-
extend: ShapeSet,
|
|
43
|
-
label: {
|
|
44
|
-
text: 'Rectangle ',
|
|
45
|
-
span: 'with rounds'
|
|
46
|
-
},
|
|
47
|
-
nav: [
|
|
48
|
-
{},
|
|
49
|
-
{ _shape: { props: { round: 4 } } },
|
|
50
|
-
{ _shape: { props: { round: 6 } } },
|
|
51
|
-
{ _shape: { props: { round: 10 } } },
|
|
52
|
-
{ _shape: { props: { round: 12 } } },
|
|
53
|
-
{ _shape: { props: { round: 16 } } },
|
|
54
|
-
{ _shape: { props: { round: 26 } } }
|
|
55
|
-
]
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const circle = {
|
|
59
|
-
extend: ShapeSet,
|
|
60
|
-
label: { text: 'Circle' },
|
|
61
|
-
nav: [{
|
|
62
|
-
_shape: { props: { shape: 'circle' } }
|
|
63
|
-
}]
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const toolTip = {
|
|
67
|
-
extend: ShapeSet,
|
|
68
|
-
label: { text: 'Tooltip' },
|
|
69
|
-
nav: {
|
|
70
|
-
childExtend: {
|
|
71
|
-
childExtend: { props: { round: 'Y1' } }
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
...[
|
|
75
|
-
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'top left' } } },
|
|
76
|
-
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'top center' } } },
|
|
77
|
-
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'right' } } },
|
|
78
|
-
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'bottom' } } }
|
|
79
|
-
]
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const tagShape = {
|
|
84
|
-
extend: ShapeSet,
|
|
85
|
-
label: { text: 'Tag' },
|
|
86
|
-
nav: {
|
|
87
|
-
childExtend: {
|
|
88
|
-
childExtend: { props: { round: 6 } }
|
|
89
|
-
},
|
|
90
|
-
...[
|
|
91
|
-
{ _shape: { props: { shape: 'tag', shapeDirection: 'left' } } },
|
|
92
|
-
{ _shape: { props: { shape: 'tag', shapeDirection: 'top' } } },
|
|
93
|
-
{ _shape: { props: { shape: 'tag', shapeDirection: 'right' } } },
|
|
94
|
-
{ _shape: { props: { shape: 'tag', shapeDirection: 'bottom' } } }
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const bubble = {
|
|
100
|
-
extend: ShapeSet,
|
|
101
|
-
label: { text: 'Bubble' },
|
|
102
|
-
nav: [
|
|
103
|
-
{ _shape: { props: { round: 'X B B X' } } },
|
|
104
|
-
{ _shape: { props: { round: 'B X X B' } } },
|
|
105
|
-
{ _shape: { props: { round: 'X X B B' } } },
|
|
106
|
-
{ _shape: { props: { round: 'B B X X' } } },
|
|
107
|
-
{ _shape: { props: { round: 'B X X X' } } },
|
|
108
|
-
{ _shape: { props: { round: 'X B X X' } } },
|
|
109
|
-
{ _shape: { props: { round: 'X X B X' } } },
|
|
110
|
-
{ _shape: { props: { round: 'X X X B' } } }
|
|
111
|
-
]
|
|
112
|
-
}
|
|
5
|
+
import {
|
|
6
|
+
rectangle,
|
|
7
|
+
circle,
|
|
8
|
+
toolTip,
|
|
9
|
+
tagShape,
|
|
10
|
+
bubble
|
|
11
|
+
} from './shapeSet'
|
|
113
12
|
|
|
114
13
|
export const Shapes = {
|
|
115
14
|
extend: Flex,
|
|
116
15
|
props: {
|
|
117
|
-
flow: 'column'
|
|
118
|
-
gap: 'F'
|
|
16
|
+
flow: 'column'
|
|
119
17
|
},
|
|
120
18
|
|
|
121
19
|
childExtend: {
|
|
@@ -123,9 +21,12 @@ export const Shapes = {
|
|
|
123
21
|
props: {
|
|
124
22
|
gap: 'A',
|
|
125
23
|
flow: 'column',
|
|
24
|
+
header: {
|
|
25
|
+
margin: '- - A2'
|
|
26
|
+
},
|
|
126
27
|
section: {
|
|
127
28
|
flow: 'row wrap',
|
|
128
|
-
gap: '
|
|
29
|
+
gap: 'A2'
|
|
129
30
|
}
|
|
130
31
|
},
|
|
131
32
|
section: { extend: Flex }
|
|
@@ -149,12 +50,14 @@ export const Shapes = {
|
|
|
149
50
|
}
|
|
150
51
|
},
|
|
151
52
|
|
|
53
|
+
line: { extend: Line },
|
|
54
|
+
|
|
152
55
|
svgShapes: {
|
|
153
56
|
header: {
|
|
154
57
|
extend: SectionHeader,
|
|
155
58
|
heading: {
|
|
156
59
|
title: 'SVG Shapes',
|
|
157
|
-
p: 'TBA
|
|
60
|
+
p: 'TBA'
|
|
158
61
|
}
|
|
159
62
|
}
|
|
160
63
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { ShapeSet } from '../../components'
|
|
4
|
+
|
|
5
|
+
export const rectangle = {
|
|
6
|
+
extend: ShapeSet,
|
|
7
|
+
label: {
|
|
8
|
+
text: 'Rectangle ',
|
|
9
|
+
span: 'with rounds'
|
|
10
|
+
},
|
|
11
|
+
nav: [
|
|
12
|
+
{},
|
|
13
|
+
{ _shape: { props: { round: 4 } } },
|
|
14
|
+
{ _shape: { props: { round: 6 } } },
|
|
15
|
+
{ _shape: { props: { round: 10 } } },
|
|
16
|
+
{ _shape: { props: { round: 12 } } },
|
|
17
|
+
{ _shape: { props: { round: 16 } } },
|
|
18
|
+
{ _shape: { props: { round: 26 } } }
|
|
19
|
+
]
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export const circle = {
|
|
23
|
+
extend: ShapeSet,
|
|
24
|
+
label: { text: 'Circle' },
|
|
25
|
+
nav: [{
|
|
26
|
+
_shape: { props: { shape: 'circle' } }
|
|
27
|
+
}]
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export const toolTip = {
|
|
31
|
+
extend: ShapeSet,
|
|
32
|
+
label: { text: 'Tooltip' },
|
|
33
|
+
nav: {
|
|
34
|
+
childExtend: {
|
|
35
|
+
childExtend: { props: { round: 'Y1' } }
|
|
36
|
+
},
|
|
37
|
+
|
|
38
|
+
...[
|
|
39
|
+
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'top left' } } },
|
|
40
|
+
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'top center' } } },
|
|
41
|
+
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'right' } } },
|
|
42
|
+
{ _shape: { props: { shape: 'tooltip', shapeDirection: 'bottom' } } }
|
|
43
|
+
]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export const tagShape = {
|
|
48
|
+
extend: ShapeSet,
|
|
49
|
+
label: { text: 'Tag' },
|
|
50
|
+
nav: {
|
|
51
|
+
childExtend: {
|
|
52
|
+
childExtend: { props: { round: 6 } }
|
|
53
|
+
},
|
|
54
|
+
...[
|
|
55
|
+
{ _shape: { props: { shape: 'tag', shapeDirection: 'left' } } },
|
|
56
|
+
{ _shape: { props: { shape: 'tag', shapeDirection: 'top' } } },
|
|
57
|
+
{ _shape: { props: { shape: 'tag', shapeDirection: 'right' } } },
|
|
58
|
+
{ _shape: { props: { shape: 'tag', shapeDirection: 'bottom' } } }
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export const bubble = {
|
|
64
|
+
extend: ShapeSet,
|
|
65
|
+
label: { text: 'Bubble' },
|
|
66
|
+
nav: [
|
|
67
|
+
{ _shape: { props: { round: 'X B B X' } } },
|
|
68
|
+
{ _shape: { props: { round: 'B X X B' } } },
|
|
69
|
+
{ _shape: { props: { round: 'X X B B' } } },
|
|
70
|
+
{ _shape: { props: { round: 'B B X X' } } },
|
|
71
|
+
{ _shape: { props: { round: 'B X X X' } } },
|
|
72
|
+
{ _shape: { props: { round: 'X B X X' } } },
|
|
73
|
+
{ _shape: { props: { round: 'X X B X' } } },
|
|
74
|
+
{ _shape: { props: { round: 'X X X B' } } }
|
|
75
|
+
]
|
|
76
|
+
}
|
|
@@ -1,22 +1,5 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
export const styleShapeSet = {
|
|
4
|
-
label: {
|
|
5
|
-
display: 'block',
|
|
6
|
-
opacity: '.65',
|
|
7
|
-
span: { opacity: '.2' }
|
|
8
|
-
},
|
|
9
|
-
nav: {
|
|
10
|
-
flexWrap: 'wrap',
|
|
11
|
-
a: {
|
|
12
|
-
cursor: 'pointer',
|
|
13
|
-
background: 'rgba(255, 255, 255, .05)',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
justifyContent: 'center'
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
3
|
export const styleUploadSVG = {
|
|
21
4
|
div: {
|
|
22
5
|
background: 'rgba(255, 255, 255, .05)',
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
import { PageExtend } from '..'
|
|
3
|
+
import { SectionHeader } from '@symbo.ls/components'
|
|
5
4
|
|
|
6
5
|
import preview from './preview'
|
|
7
6
|
import sequence from './sequence'
|
|
@@ -10,11 +9,12 @@ import boxModel from './boxModel'
|
|
|
10
9
|
export const Spaces = {
|
|
11
10
|
key: 'spaces',
|
|
12
11
|
|
|
13
|
-
extend: PageExtend,
|
|
14
|
-
|
|
15
12
|
state: {
|
|
16
13
|
activePage: 'spaces',
|
|
17
|
-
activeTab: 'preview'
|
|
14
|
+
activeTab: 'preview',
|
|
15
|
+
|
|
16
|
+
title: 'Spacing',
|
|
17
|
+
p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
|
|
18
18
|
},
|
|
19
19
|
|
|
20
20
|
define: { routes: param => param },
|
|
@@ -34,20 +34,7 @@ export const Spaces = {
|
|
|
34
34
|
},
|
|
35
35
|
|
|
36
36
|
header: {
|
|
37
|
-
extend:
|
|
38
|
-
style: {
|
|
39
|
-
margin: `${42 / 16}em -2em 2em -2em`,
|
|
40
|
-
paddingLeft: '2em'
|
|
41
|
-
},
|
|
42
|
-
tabs: {
|
|
43
|
-
childExtend: {
|
|
44
|
-
extend: [Link]
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
preview: { props: { text: 'Spacing Preview' } }
|
|
48
|
-
// sequence: { props: { text: 'Sequence' } },
|
|
49
|
-
// boxModel: { props: { text: 'Box Model' } }
|
|
50
|
-
}
|
|
37
|
+
extend: SectionHeader
|
|
51
38
|
},
|
|
52
39
|
|
|
53
40
|
preview
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import { Grid, FontObject, FontFamilyObject, Line } from '@symbo.ls/components'
|
|
4
4
|
import { TypeSection } from './shared'
|
|
5
5
|
|
|
6
6
|
const mapFonts = (el, s) => {
|
|
7
|
-
if (!el.
|
|
8
|
-
const { FONT } = el.
|
|
9
|
-
|
|
7
|
+
if (!el.context.SYSTEM) return
|
|
8
|
+
const { FONT } = el.context.SYSTEM
|
|
10
9
|
const fontKeys = Object.keys(FONT)
|
|
11
10
|
|
|
12
11
|
return fontKeys.map(v => {
|
|
@@ -16,113 +15,84 @@ const mapFonts = (el, s) => {
|
|
|
16
15
|
const fontWeightCaption = weights[0] === 'variable' ? 'variable' : `${weightsLength} style${weightsLength > 1 ? 's' : ''}`
|
|
17
16
|
|
|
18
17
|
return {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
caption: {},
|
|
25
|
-
p: {},
|
|
26
|
-
description: [
|
|
27
|
-
{ props: { icon: 'variableFont', text: fontWeightCaption } }
|
|
18
|
+
title: v,
|
|
19
|
+
href: `/typography/document-fonts/font-settings/${v}`,
|
|
20
|
+
labels: [
|
|
21
|
+
{ icon: 'variableFont', text: fontWeightCaption }
|
|
28
22
|
]
|
|
29
23
|
}
|
|
30
24
|
})
|
|
31
25
|
}
|
|
32
26
|
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
const mapFontFamilies = (el, s) => {
|
|
28
|
+
if (!el.context.SYSTEM) return
|
|
29
|
+
const { FONT_FAMILY } = el.context.SYSTEM
|
|
30
|
+
const fontFamilyKeys = Object.keys(FONT_FAMILY)
|
|
31
|
+
|
|
32
|
+
return fontFamilyKeys.map(v => {
|
|
33
|
+
const val = FONT_FAMILY[v]
|
|
34
|
+
if (v === 'default') return
|
|
35
|
+
return {
|
|
36
|
+
title: v,
|
|
37
|
+
href: `/typography/font-family/${v}`,
|
|
38
|
+
val
|
|
39
|
+
}
|
|
40
|
+
}).filter(v => v)
|
|
44
41
|
}
|
|
45
42
|
|
|
46
|
-
const
|
|
47
|
-
extend:
|
|
48
|
-
props: { padding: '0 0 E 0' },
|
|
43
|
+
const Fonts = {
|
|
44
|
+
extend: TypeSection,
|
|
49
45
|
header: {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
state: {
|
|
47
|
+
title: 'Document Fonts',
|
|
48
|
+
p: 'Document @font-face, default and backup fonts',
|
|
49
|
+
nav: [{
|
|
50
|
+
icon: 'plus',
|
|
51
|
+
href: '/typography/upload-font'
|
|
52
|
+
}]
|
|
54
53
|
}
|
|
55
54
|
},
|
|
55
|
+
|
|
56
56
|
content: {
|
|
57
57
|
extend: Grid,
|
|
58
58
|
props: {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
},
|
|
63
|
-
childExtend: {
|
|
64
|
-
extend: [FontFamilyObject, Link],
|
|
65
|
-
props: { href: '/typography/document-fonts/font-family' },
|
|
66
|
-
style: { textDecoration: 'none' }
|
|
59
|
+
columns: 'repeat(2, 1fr)',
|
|
60
|
+
gap: 'A',
|
|
61
|
+
margin: '0 -Z'
|
|
67
62
|
},
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (!el.__root.state.CONFIG) return
|
|
71
|
-
const { FONT_FAMILY } = el.__root.state.CONFIG
|
|
72
|
-
|
|
73
|
-
const FAMILIES = Object.keys(FONT_FAMILY).map(v => {
|
|
74
|
-
const val = FONT_FAMILY[v]
|
|
75
|
-
if (v === 'default') return null
|
|
76
|
-
return {
|
|
77
|
-
caption: { props: { text: v } },
|
|
78
|
-
p: { props: { text: val.value } }
|
|
79
|
-
}
|
|
80
|
-
})
|
|
81
|
-
|
|
82
|
-
return {
|
|
83
|
-
tag: 'fragment',
|
|
84
|
-
...FAMILIES
|
|
85
|
-
}
|
|
86
|
-
}
|
|
63
|
+
childExtend: FontObject,
|
|
64
|
+
$setCollection: mapFonts
|
|
87
65
|
}
|
|
88
66
|
}
|
|
89
67
|
|
|
90
|
-
|
|
68
|
+
const FontFamilies = {
|
|
91
69
|
extend: TypeSection,
|
|
70
|
+
props: { padding: '0 0 E 0' },
|
|
92
71
|
header: {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
p:
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
props: {
|
|
101
|
-
icon: 'plus',
|
|
102
|
-
href: '/typography/document-fonts/upload-font'
|
|
103
|
-
}
|
|
104
|
-
}
|
|
72
|
+
state: {
|
|
73
|
+
title: 'Font Families',
|
|
74
|
+
p: 'Setup a set and fallback fonts as font families',
|
|
75
|
+
nav: [{
|
|
76
|
+
icon: 'plus',
|
|
77
|
+
href: '/typography/add-font-family'
|
|
78
|
+
}]
|
|
105
79
|
}
|
|
106
80
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
gap: 'A'
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
childExtend: FontObject,
|
|
117
|
-
|
|
118
|
-
content: (el, s) => {
|
|
119
|
-
return {
|
|
120
|
-
tag: 'fragment',
|
|
121
|
-
...mapFonts(el, s)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
81
|
+
content: {
|
|
82
|
+
extend: Grid,
|
|
83
|
+
props: {
|
|
84
|
+
columns: 'repeat(3, 1fr)',
|
|
85
|
+
gap: 'A',
|
|
86
|
+
margin: '0 -Z'
|
|
124
87
|
},
|
|
125
|
-
|
|
126
|
-
|
|
88
|
+
|
|
89
|
+
childExtend: FontFamilyObject,
|
|
90
|
+
$setCollection: mapFontFamilies
|
|
127
91
|
}
|
|
128
92
|
}
|
|
93
|
+
|
|
94
|
+
export default {
|
|
95
|
+
Fonts,
|
|
96
|
+
line: { extend: Line },
|
|
97
|
+
FontFamilies
|
|
98
|
+
}
|
|
@@ -13,8 +13,11 @@ export default {
|
|
|
13
13
|
extend: TypeSection,
|
|
14
14
|
|
|
15
15
|
header: {
|
|
16
|
+
state: {
|
|
17
|
+
p: 'Document styling and theming provides global themes of the entire app, imagine it as a :root styling'
|
|
18
|
+
},
|
|
16
19
|
heading: {
|
|
17
|
-
|
|
20
|
+
title: null
|
|
18
21
|
},
|
|
19
22
|
nav: {
|
|
20
23
|
add: {
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import { SectionHeader } from '@symbo.ls/components'
|
|
4
4
|
|
|
5
|
-
import { Link, TabHeader } from '@symbo.ls/components'
|
|
6
|
-
|
|
7
|
-
import style from './style'
|
|
8
5
|
import state from './state'
|
|
9
6
|
|
|
10
7
|
import documentFonts from './docFonts'
|
|
@@ -12,41 +9,33 @@ import documentStyle from './docStyles'
|
|
|
12
9
|
import typeScale from './typeScale'
|
|
13
10
|
|
|
14
11
|
export const Typography = {
|
|
15
|
-
extend: PageExtend,
|
|
16
|
-
|
|
17
|
-
on: {
|
|
18
|
-
init: (el, s) => {
|
|
19
|
-
const route = window.location.pathname
|
|
20
|
-
const routes = route.slice(1).split('/')
|
|
21
|
-
s.activeTab = routes[1] || state.activeTab
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
|
|
25
12
|
define: { routes: param => param },
|
|
26
13
|
|
|
27
|
-
style,
|
|
28
14
|
state,
|
|
29
15
|
|
|
30
16
|
routes: {
|
|
31
|
-
'
|
|
32
|
-
'
|
|
33
|
-
'
|
|
17
|
+
'/': documentFonts,
|
|
18
|
+
'/document-fonts': documentFonts,
|
|
19
|
+
'/type-scale': typeScale,
|
|
20
|
+
'/document-styles': documentStyle
|
|
34
21
|
},
|
|
35
22
|
|
|
36
23
|
header: {
|
|
37
|
-
extend:
|
|
38
|
-
style: {
|
|
39
|
-
paddingLeft: '2em'
|
|
40
|
-
},
|
|
41
|
-
tabs: {
|
|
42
|
-
childExtend: { extend: [Link] },
|
|
43
|
-
'document-fonts': { props: { text: 'Document Fonts' } },
|
|
44
|
-
'type-scale': { props: { text: 'Type Scale' } },
|
|
45
|
-
'document-styles': { props: { text: 'Document Styles' } }
|
|
46
|
-
}
|
|
24
|
+
extend: SectionHeader
|
|
47
25
|
},
|
|
48
26
|
|
|
49
27
|
page: {
|
|
50
|
-
content: (el, s) =>
|
|
28
|
+
content: (el, s) => {
|
|
29
|
+
const content = el.parent?.routes['/' + s.activeTab]
|
|
30
|
+
return { extend: content }
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
on: {
|
|
35
|
+
init: (el, s) => {
|
|
36
|
+
const route = window.location.pathname
|
|
37
|
+
const routes = route.slice(1).split('/')
|
|
38
|
+
s.activeTab = routes[1] || state.activeTab
|
|
39
|
+
}
|
|
51
40
|
}
|
|
52
41
|
}
|
|
@@ -9,7 +9,9 @@ export default {
|
|
|
9
9
|
sequence: {},
|
|
10
10
|
type: 'font-size',
|
|
11
11
|
|
|
12
|
+
title: 'Typography',
|
|
13
|
+
p: 'A general configuration of type properties on the document.',
|
|
14
|
+
|
|
12
15
|
sampleText: 'Today is a big day for our tribe. The year ends.',
|
|
13
|
-
|
|
14
|
-
activeTab: 'documentFonts'
|
|
16
|
+
activeTab: ''
|
|
15
17
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { styleTypeScale } from './style'
|
|
4
|
-
|
|
5
3
|
import {
|
|
6
4
|
Flex, Block, Text, Grid,
|
|
7
5
|
SequenceGraph,
|
|
@@ -49,7 +47,6 @@ const ScalingTools = {
|
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
export default {
|
|
52
|
-
style: styleTypeScale,
|
|
53
50
|
extend: TypeSection,
|
|
54
51
|
|
|
55
52
|
header: {
|
package/src/state.js
CHANGED
package/src/pages/Color/style.js
DELETED