@symbo.ls/preview 0.0.39 → 0.0.41
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/.symbols/library.js +1 -1
- package/package.json +1 -1
- package/src/pages/DesignSystem/index.js +0 -6
- package/src/pages/Export/index.js +1 -11
- package/src/pages/Export/scene.js +2 -1
- package/src/pages/Export/tools.js +46 -7
- package/src/pages/Theme/index.js +56 -39
- package/src/pages/Theme/preview.js +153 -0
- package/src/pages/Theme/style.js +1 -12
- package/src/pages/Typography/documentStyles.js +0 -5
- package/src/pages/Typography/fontFaces.js +50 -0
- package/src/pages/Typography/fontFamilies.js +45 -0
- package/src/pages/Typography/index.js +24 -2
- package/src/pages/Typography/stylesHelpers.js +32 -24
- package/src/state.js +2 -0
- package/src/pages/ColorEditor/colorTone.js +0 -163
- package/src/pages/ColorEditor/friendTheme.js +0 -30
- package/src/pages/ColorEditor/index.js +0 -178
- package/src/pages/ColorEditor/interactivity.js +0 -116
- package/src/pages/ColorEditor/ntc.js +0 -1689
- package/src/pages/ColorEditor/style.js +0 -49
- package/src/pages/ColorEditor/themingTools.js +0 -107
- package/src/pages/Theme/colorTone.js +0 -163
package/.symbols/library.js
CHANGED
package/package.json
CHANGED
|
@@ -43,11 +43,6 @@ const NAV = [{
|
|
|
43
43
|
icon: 'icons colored'
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
|
-
}, {
|
|
47
|
-
props: {
|
|
48
|
-
icon: 'fontFace colored',
|
|
49
|
-
href: '/fonts'
|
|
50
|
-
}
|
|
51
46
|
}, {
|
|
52
47
|
props: {
|
|
53
48
|
icon: 'device mobile half fill',
|
|
@@ -81,7 +76,6 @@ export const DesignSystem = {
|
|
|
81
76
|
'/colors': Color,
|
|
82
77
|
'/theme': Theme,
|
|
83
78
|
'/typography': Typography,
|
|
84
|
-
'/fonts': Fonts,
|
|
85
79
|
'/space': Spaces,
|
|
86
80
|
'/shape': Shapes,
|
|
87
81
|
'/icons': Icons,
|
|
@@ -1,14 +1,53 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Flex,
|
|
5
|
+
SequenceSliders,
|
|
6
|
+
ClickableItem,
|
|
7
|
+
SquareButton
|
|
8
|
+
} from '@symbo.ls/components'
|
|
4
9
|
|
|
5
10
|
export default {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
props: {
|
|
12
|
+
padding: 'Z2 0 0',
|
|
13
|
+
flexAlign: 'center space-between'
|
|
14
|
+
},
|
|
9
15
|
|
|
10
|
-
|
|
11
|
-
extend:
|
|
12
|
-
|
|
16
|
+
tools: {
|
|
17
|
+
extend: Flex,
|
|
18
|
+
props: { gap: 'B1' },
|
|
19
|
+
// theme: { extend: ThemeSwitcher },
|
|
20
|
+
|
|
21
|
+
sliders: {
|
|
22
|
+
extend: SequenceSliders,
|
|
23
|
+
childExtend: { title: null }
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
responsive: {
|
|
28
|
+
extend: Flex,
|
|
29
|
+
props: { gap: 'A2' },
|
|
30
|
+
|
|
31
|
+
direction: {
|
|
32
|
+
extend: [ClickableItem, SquareButton],
|
|
33
|
+
props: {
|
|
34
|
+
icon: 'languageDirection'
|
|
35
|
+
},
|
|
36
|
+
on: {
|
|
37
|
+
click: (ev, el, s) => {
|
|
38
|
+
console.log(s.direction)
|
|
39
|
+
s.update({
|
|
40
|
+
direction: s.direction === 'rtl' ? 'ltr' : 'rtl'
|
|
41
|
+
})
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
VerticalLine: {
|
|
47
|
+
margin: 'auto 0',
|
|
48
|
+
height: 'A2'
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
ResponsiveToolBar: {}
|
|
13
52
|
}
|
|
14
53
|
}
|
package/src/pages/Theme/index.js
CHANGED
|
@@ -6,34 +6,53 @@ import {
|
|
|
6
6
|
Flex,
|
|
7
7
|
SectionHeader,
|
|
8
8
|
AccessibilityCheck,
|
|
9
|
-
SceneThemingBar
|
|
9
|
+
SceneThemingBar,
|
|
10
|
+
Pseudo,
|
|
11
|
+
CommonField
|
|
10
12
|
} from '@symbo.ls/components'
|
|
11
13
|
|
|
12
|
-
import
|
|
13
|
-
import { themingTools } from './themingTools'
|
|
14
|
-
import { interactivity } from './interactivity'
|
|
15
|
-
import { friendTheme } from './friendTheme'
|
|
14
|
+
import preview from './preview'
|
|
15
|
+
// import { themingTools } from './themingTools'
|
|
16
|
+
// import { interactivity } from './interactivity'
|
|
17
|
+
// import { friendTheme } from './friendTheme'
|
|
16
18
|
|
|
17
|
-
import style
|
|
19
|
+
import style from './style'
|
|
18
20
|
|
|
19
|
-
const
|
|
21
|
+
const ThemeNameField = {
|
|
20
22
|
tag: 'label',
|
|
21
|
-
style: styleLabel,
|
|
22
23
|
attr: { for: 'name-it' },
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
span: {
|
|
31
|
-
tag: 'span',
|
|
32
|
-
props: {
|
|
33
|
-
text: (el, s) => s.value,
|
|
34
|
-
size: 'E'
|
|
24
|
+
extend: CommonField,
|
|
25
|
+
|
|
26
|
+
props: ({ state }) => ({
|
|
27
|
+
gap: '0',
|
|
28
|
+
|
|
29
|
+
caption: {
|
|
30
|
+
text: 'Name the theme'
|
|
35
31
|
},
|
|
36
|
-
|
|
32
|
+
|
|
33
|
+
element: {
|
|
34
|
+
whiteSpace: 'nowrap',
|
|
35
|
+
minWidth: 'C1',
|
|
36
|
+
maxWidth: 'fit-content',
|
|
37
|
+
outline: 'none',
|
|
38
|
+
fontSize: 'E',
|
|
39
|
+
|
|
40
|
+
border: 'dashed, gray5',
|
|
41
|
+
borderWidth: '0 0 1px',
|
|
42
|
+
|
|
43
|
+
text: (el, s) => s.themeName,
|
|
44
|
+
|
|
45
|
+
':empty::before': {
|
|
46
|
+
content: '"You name it"',
|
|
47
|
+
color: 'gray5'
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}),
|
|
51
|
+
|
|
52
|
+
caption: {},
|
|
53
|
+
element: {
|
|
54
|
+
extend: Pseudo,
|
|
55
|
+
attr: { contentEditable: true, id: 'name-it' }
|
|
37
56
|
}
|
|
38
57
|
}
|
|
39
58
|
|
|
@@ -128,16 +147,16 @@ export const Theme = {
|
|
|
128
147
|
init: (el, s) => {
|
|
129
148
|
if (!el.context.SYSTEM) return
|
|
130
149
|
const path = window.location.pathname
|
|
131
|
-
const pathArray = path.split('
|
|
150
|
+
const pathArray = path.split('theme/')
|
|
132
151
|
if (!el.context.SYSTEM) return
|
|
133
152
|
const { THEME } = el.context.SYSTEM
|
|
134
153
|
const themeName = pathArray[1]
|
|
135
|
-
var
|
|
154
|
+
var value = THEME[themeName]
|
|
136
155
|
|
|
137
|
-
if (themeName &&
|
|
156
|
+
if (themeName && value) {
|
|
138
157
|
s.update({
|
|
139
|
-
themeName
|
|
140
|
-
value
|
|
158
|
+
themeName,
|
|
159
|
+
value
|
|
141
160
|
}, { preventUpdate: true })
|
|
142
161
|
}
|
|
143
162
|
}
|
|
@@ -146,26 +165,24 @@ export const Theme = {
|
|
|
146
165
|
header: {
|
|
147
166
|
extend: SectionHeader,
|
|
148
167
|
props: {
|
|
149
|
-
|
|
150
|
-
margin: '0'
|
|
168
|
+
margin: '0 0 B2'
|
|
151
169
|
},
|
|
152
|
-
heading:
|
|
153
|
-
|
|
170
|
+
heading: null,
|
|
171
|
+
ThemeNameField,
|
|
154
172
|
nav: { extend: SceneThemingBar }
|
|
155
173
|
},
|
|
156
174
|
|
|
157
175
|
cnt: {
|
|
158
|
-
extend:
|
|
159
|
-
props: {
|
|
160
|
-
|
|
161
|
-
|
|
176
|
+
extend: Flex,
|
|
177
|
+
props: { gap: 'D' },
|
|
178
|
+
|
|
179
|
+
preview,
|
|
162
180
|
|
|
163
|
-
aside: colorTones,
|
|
164
181
|
colorEdit: {
|
|
165
|
-
props: { gap: 'C2', flexFlow: 'column' }
|
|
166
|
-
themingTools,
|
|
167
|
-
interactivity,
|
|
168
|
-
friendTheme
|
|
182
|
+
props: { gap: 'C2', flexFlow: 'column' }
|
|
183
|
+
// themingTools,
|
|
184
|
+
// interactivity,
|
|
185
|
+
// friendTheme
|
|
169
186
|
}
|
|
170
187
|
},
|
|
171
188
|
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { opacify } from '@symbo.ls/scratch'
|
|
4
|
+
import { Flex, Grid } from '@symbo.ls/components'
|
|
5
|
+
|
|
6
|
+
const classOpacify = (value, opacity) => {
|
|
7
|
+
const { background, backgroundColor, color } = value
|
|
8
|
+
const bg = background || backgroundColor || color
|
|
9
|
+
if (!bg) return
|
|
10
|
+
return { background: opacify(bg, opacity) }
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
const TONES_AMOUNT = 13
|
|
14
|
+
const TONES_ARR = new Array(TONES_AMOUNT).fill(0).map((_, i) => i)
|
|
15
|
+
|
|
16
|
+
const getThemeProperty = (property, value, mod) => {
|
|
17
|
+
const modifier = `@${mod}`
|
|
18
|
+
return value[modifier] && value[modifier][property] ? value[modifier][property] : value[property]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export const Tones = {
|
|
22
|
+
extend: Grid,
|
|
23
|
+
props: {
|
|
24
|
+
columns: `repeat(${TONES_AMOUNT}, 1fr)`,
|
|
25
|
+
height: 'B',
|
|
26
|
+
round: 'Z',
|
|
27
|
+
overflow: 'hidden'
|
|
28
|
+
},
|
|
29
|
+
childExtend: {
|
|
30
|
+
tag: 'span',
|
|
31
|
+
text: null,
|
|
32
|
+
props: ({ key, state }) => ({
|
|
33
|
+
round: '0',
|
|
34
|
+
transition: 'B default-bezier',
|
|
35
|
+
transitionProperty: 'color, background',
|
|
36
|
+
background: getThemeProperty('background', state.value, state.sceneTheme),
|
|
37
|
+
opacity: '' + (100 / TONES_AMOUNT * parseInt(key)) / 100
|
|
38
|
+
})
|
|
39
|
+
},
|
|
40
|
+
$setCollection: () => TONES_ARR
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default {
|
|
44
|
+
tag: 'aside',
|
|
45
|
+
extend: Flex,
|
|
46
|
+
props: {
|
|
47
|
+
flow: 'column'
|
|
48
|
+
},
|
|
49
|
+
|
|
50
|
+
preview: {
|
|
51
|
+
props: (el, s) => ({
|
|
52
|
+
padding: 'X1',
|
|
53
|
+
round: 'Z2',
|
|
54
|
+
theme: `scene @${s.sceneTheme}`,
|
|
55
|
+
style: {
|
|
56
|
+
'&, & *': {
|
|
57
|
+
transition: '165ms cubic-bezier(.29,.67,.51,.97)',
|
|
58
|
+
transitionProperty: 'color, background'
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}),
|
|
62
|
+
scene: {
|
|
63
|
+
props: {
|
|
64
|
+
padding: 'A',
|
|
65
|
+
backgroundPosition: `center`,
|
|
66
|
+
backgroundRepeat: `repeat`,
|
|
67
|
+
backgroundSize: '100px 100px'
|
|
68
|
+
},
|
|
69
|
+
circle: {
|
|
70
|
+
props: (el, s) => ({
|
|
71
|
+
theme: `${s.themeName} @${s.sceneTheme}`,
|
|
72
|
+
flexFlow: 'column',
|
|
73
|
+
flexAlign: 'center center',
|
|
74
|
+
width: 'G',
|
|
75
|
+
aspectRatio: '1 / 1',
|
|
76
|
+
round: '100%',
|
|
77
|
+
position: 'relative',
|
|
78
|
+
borderWidth: '1px',
|
|
79
|
+
borderStyle: 'solid',
|
|
80
|
+
borderColor: 'transparent',
|
|
81
|
+
|
|
82
|
+
h6: {
|
|
83
|
+
fontSize: 'D',
|
|
84
|
+
fontWeight: 'bold',
|
|
85
|
+
gap: 'X'
|
|
86
|
+
}
|
|
87
|
+
}),
|
|
88
|
+
h6: {
|
|
89
|
+
extend: Flex,
|
|
90
|
+
Span: {
|
|
91
|
+
text: 'The',
|
|
92
|
+
fontWeight: 'normal',
|
|
93
|
+
marginRight: '6px'
|
|
94
|
+
},
|
|
95
|
+
text: 'Text Color'
|
|
96
|
+
},
|
|
97
|
+
Span: {
|
|
98
|
+
text: (el, s) => s.themeName,
|
|
99
|
+
position: 'absolute',
|
|
100
|
+
top: '86%',
|
|
101
|
+
left: '50%',
|
|
102
|
+
transform: 'translate(-50%, -50%)',
|
|
103
|
+
fontWeight: '600'
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
|
|
109
|
+
opacity: {
|
|
110
|
+
props: {
|
|
111
|
+
padding: 'B1 0 0 0'
|
|
112
|
+
},
|
|
113
|
+
caption: {
|
|
114
|
+
props: {
|
|
115
|
+
text: 'Opacity',
|
|
116
|
+
size: 'Z',
|
|
117
|
+
padding: '0 0 Z1 0',
|
|
118
|
+
opacity: '.65'
|
|
119
|
+
}
|
|
120
|
+
},
|
|
121
|
+
tones: { extend: Tones }
|
|
122
|
+
},
|
|
123
|
+
|
|
124
|
+
shades: {
|
|
125
|
+
if: () => false,
|
|
126
|
+
props: { padding: 'B 0 0 0' },
|
|
127
|
+
caption: {
|
|
128
|
+
props: {
|
|
129
|
+
text: 'Shades',
|
|
130
|
+
size: 'Z',
|
|
131
|
+
padding: '0 0 Z1 0'
|
|
132
|
+
},
|
|
133
|
+
style: { opacity: '.65' }
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
generate: {
|
|
137
|
+
props: { flexFlow: 'column', round: 'Z', gap: '2px' },
|
|
138
|
+
|
|
139
|
+
childExtend: {
|
|
140
|
+
extend: [Tones],
|
|
141
|
+
props: { round: 'X' },
|
|
142
|
+
...TONES_ARR.map(v => ({
|
|
143
|
+
class: { background: el => classOpacify(el, (100 / TONES_AMOUNT * v) / 100) }
|
|
144
|
+
}))
|
|
145
|
+
},
|
|
146
|
+
|
|
147
|
+
dark: {},
|
|
148
|
+
light: {
|
|
149
|
+
props: { theme: 'lightScene' }
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
package/src/pages/Theme/style.js
CHANGED
|
@@ -1,22 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
export const styleLabel = {
|
|
4
|
-
caption: { whiteSpace: 'nowrap', opacity: 0.65 },
|
|
5
|
-
span: {
|
|
6
|
-
display: 'block',
|
|
7
|
-
whiteSpace: 'nowrap',
|
|
8
|
-
minWidth: `1.618em`,
|
|
9
|
-
maxWidth: 'fit-content',
|
|
10
|
-
borderBottom: '1px dashed rgba(255, 255, 255, .35)',
|
|
11
|
-
outline: 'none'
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
3
|
export const styleTool = {
|
|
16
4
|
caption: { opacity: '.65' },
|
|
17
5
|
'> div span': { opacity: '.5' },
|
|
18
6
|
'> div > div': { gap: '1px' }
|
|
19
7
|
}
|
|
8
|
+
|
|
20
9
|
export const styleColorTones = {
|
|
21
10
|
width: '22em',
|
|
22
11
|
display: 'flex',
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
SequenceSliders,
|
|
10
10
|
DeviceButtonSet
|
|
11
11
|
} from '@symbo.ls/components'
|
|
12
|
-
import stylesHelpers from './stylesHelpers'
|
|
13
12
|
|
|
14
13
|
import { HTML_TAGS } from '@domql/tags' // eslint-disable-line no-unused-vars
|
|
15
14
|
|
|
@@ -224,10 +223,6 @@ export default {
|
|
|
224
223
|
}
|
|
225
224
|
},
|
|
226
225
|
|
|
227
|
-
Line: {},
|
|
228
|
-
|
|
229
|
-
stylesHelpers,
|
|
230
|
-
|
|
231
226
|
on: {
|
|
232
227
|
init: (el, s) => {
|
|
233
228
|
if (!el.context.SYSTEM) return
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Grid, Hoverable, FontObject } from '@symbo.ls/components'
|
|
4
|
+
import { TypeSection } from './shared'
|
|
5
|
+
|
|
6
|
+
const mapFonts = (el, s) => {
|
|
7
|
+
if (!el.context.SYSTEM) return
|
|
8
|
+
const { FONT } = el.context.SYSTEM
|
|
9
|
+
const fontKeys = Object.keys(FONT)
|
|
10
|
+
|
|
11
|
+
return fontKeys.map(v => {
|
|
12
|
+
const font = FONT[v]
|
|
13
|
+
const weights = Object.keys(font)
|
|
14
|
+
const weightsLength = weights.length
|
|
15
|
+
const fontWeightCaption = weights[0] === 'variable' ? 'variable' : `${weightsLength} style${weightsLength > 1 ? 's' : ''}`
|
|
16
|
+
|
|
17
|
+
return {
|
|
18
|
+
title: v,
|
|
19
|
+
href: `/fonts/font-settings/${v}`,
|
|
20
|
+
labels: [
|
|
21
|
+
{ icon: 'fontVariable', text: fontWeightCaption }
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
})
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default {
|
|
28
|
+
extend: TypeSection,
|
|
29
|
+
header: {
|
|
30
|
+
state: {
|
|
31
|
+
title: 'Document Fonts',
|
|
32
|
+
p: 'Document @font-face, default and backup fonts',
|
|
33
|
+
nav: [{
|
|
34
|
+
icon: 'plus',
|
|
35
|
+
href: '/fonts/upload-font'
|
|
36
|
+
}]
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
content: {
|
|
41
|
+
extend: Grid,
|
|
42
|
+
props: {
|
|
43
|
+
columns: 'repeat(2, 1fr)',
|
|
44
|
+
gap: 'A',
|
|
45
|
+
margin: '0 -Z'
|
|
46
|
+
},
|
|
47
|
+
childExtend: [FontObject, Hoverable],
|
|
48
|
+
$setStateCollection: mapFonts
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Grid, Hoverable, FontFamilyObject } from '@symbo.ls/components'
|
|
4
|
+
import { TypeSection } from './shared'
|
|
5
|
+
|
|
6
|
+
const mapFontFamilies = (el, s) => {
|
|
7
|
+
if (!el.context.SYSTEM) return
|
|
8
|
+
const { FONT_FAMILY } = el.context.SYSTEM
|
|
9
|
+
const fontFamilyKeys = Object.keys(FONT_FAMILY)
|
|
10
|
+
|
|
11
|
+
return fontFamilyKeys.map(v => {
|
|
12
|
+
const val = FONT_FAMILY[v]
|
|
13
|
+
if (v === 'default') return
|
|
14
|
+
return {
|
|
15
|
+
title: v,
|
|
16
|
+
href: `/fonts/font-family/${v}`,
|
|
17
|
+
val
|
|
18
|
+
}
|
|
19
|
+
}).filter(v => v)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default {
|
|
23
|
+
extend: TypeSection,
|
|
24
|
+
header: {
|
|
25
|
+
state: {
|
|
26
|
+
title: 'Font Families',
|
|
27
|
+
p: 'Setup a set and fallback fonts as font families',
|
|
28
|
+
nav: [{
|
|
29
|
+
icon: 'plus',
|
|
30
|
+
href: '/fonts/add-font-family'
|
|
31
|
+
}]
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
content: {
|
|
35
|
+
extend: Grid,
|
|
36
|
+
props: {
|
|
37
|
+
columns: 'repeat(4, 1fr)',
|
|
38
|
+
gap: 'A',
|
|
39
|
+
margin: '0 -Z'
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
childExtend: [FontFamilyObject, Hoverable],
|
|
43
|
+
$setStateCollection: mapFontFamilies
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -2,8 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import state from './state'
|
|
4
4
|
|
|
5
|
+
import fontFaces from './fontFaces'
|
|
5
6
|
import typeScale from './typeScale'
|
|
7
|
+
import fontFamilies from './fontFamilies'
|
|
6
8
|
import documentStyles from './documentStyles'
|
|
9
|
+
import stylesHelpers from './stylesHelpers'
|
|
10
|
+
import { mapSequence, sortSequence } from '@symbo.ls/components'
|
|
7
11
|
|
|
8
12
|
export const Typography = {
|
|
9
13
|
state,
|
|
@@ -13,7 +17,25 @@ export const Typography = {
|
|
|
13
17
|
p: 'A general configuration of type properties on the document.'
|
|
14
18
|
},
|
|
15
19
|
|
|
20
|
+
line: { extend: 'Line' },
|
|
21
|
+
|
|
22
|
+
documentStyles,
|
|
23
|
+
line1: { extend: 'Line' },
|
|
24
|
+
|
|
25
|
+
stylesHelpers,
|
|
26
|
+
line2: { extend: 'Line' },
|
|
27
|
+
|
|
28
|
+
fontFaces,
|
|
29
|
+
line3: { extend: 'Line' },
|
|
30
|
+
|
|
31
|
+
fontFamilies,
|
|
32
|
+
line4: { extend: 'Line' },
|
|
33
|
+
|
|
16
34
|
typeScale,
|
|
17
|
-
|
|
18
|
-
|
|
35
|
+
|
|
36
|
+
on: {
|
|
37
|
+
init: (el, s) => {
|
|
38
|
+
mapSequence(s, sortSequence)
|
|
39
|
+
}
|
|
40
|
+
}
|
|
19
41
|
}
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
SectionHeader,
|
|
6
6
|
TypeHelperObject
|
|
7
7
|
} from '@symbo.ls/components'
|
|
8
|
+
import { findHeadingLetter, getFontFamily } from '@symbo.ls/scratch'
|
|
8
9
|
|
|
9
10
|
export default {
|
|
10
11
|
header: {
|
|
@@ -23,32 +24,39 @@ export default {
|
|
|
23
24
|
extend: Grid,
|
|
24
25
|
props: { columns: 'repeat(3, 1fr)' },
|
|
25
26
|
|
|
26
|
-
|
|
27
|
+
childExtend: TypeHelperObject,
|
|
27
28
|
|
|
28
|
-
$setStateCollection: () =>
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, {
|
|
34
|
-
p: {
|
|
35
|
-
text: 'Headline 2',
|
|
36
|
-
style: { fontSize: `${40 / 16}em` }
|
|
29
|
+
$setStateCollection: (el) => {
|
|
30
|
+
const { state, context } = el // eslint-disable-line no-unused-vars
|
|
31
|
+
const { TYPOGRAPHY, FONT_FAMILY } = context.SYSTEM
|
|
32
|
+
const { styles } = TYPOGRAPHY
|
|
33
|
+
el.removeContent()
|
|
37
34
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
35
|
+
const family = FONT_FAMILY[FONT_FAMILY.default]
|
|
36
|
+
const familyValue = getFontFamily()
|
|
37
|
+
const lineHeight = TYPOGRAPHY.lineHeight
|
|
38
|
+
const font = family.arr[0]
|
|
39
|
+
|
|
40
|
+
const HELPERS = Object.keys(styles).filter(v => v.slice(0, 1) === '.')
|
|
41
|
+
console.log(HELPERS)
|
|
42
|
+
return HELPERS.map((v, k) => ({
|
|
43
|
+
key: v,
|
|
44
|
+
value: {
|
|
45
|
+
font,
|
|
46
|
+
fontFamily: familyValue,
|
|
47
|
+
fontWeight: 900 - (k * 100),
|
|
48
|
+
lineHeight,
|
|
49
|
+
...styles[v]
|
|
45
50
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
labels: [
|
|
52
|
+
{ icon: 'fontFace', text: font },
|
|
53
|
+
{ icon: 'fontVariable', text: 900 - (k * 100) },
|
|
54
|
+
{ icon: 'textLineHeight', text: lineHeight }
|
|
55
|
+
],
|
|
56
|
+
sequenceValue: state.sequence[
|
|
57
|
+
findHeadingLetter(state.h1Matches, k)
|
|
58
|
+
]
|
|
59
|
+
}))
|
|
60
|
+
}
|
|
53
61
|
}
|
|
54
62
|
}
|
package/src/state.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
import SYMBOLS_CONF from '@symbo.ls/config'
|
|
3
4
|
import SYSTEM from './config'
|
|
4
5
|
import { LIBRARY, COMPONENTS } from '../.symbols'
|
|
5
6
|
|
|
@@ -8,6 +9,7 @@ export const state = {
|
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
export const context = {
|
|
12
|
+
CONFIG: SYMBOLS_CONF,
|
|
11
13
|
LIBRARY,
|
|
12
14
|
SYSTEM,
|
|
13
15
|
COMPONENTS
|