@symbo.ls/preview 0.0.25 → 0.0.26
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/index.js +14 -0
- package/package.json +1 -1
- package/src/index.js +2 -1
- package/src/pages/Color/globalThemes.js +1 -1
- package/src/pages/Color/palette.js +1 -1
- package/src/pages/Color/themes.js +1 -1
- package/src/pages/Components/grid.js +2 -2
- package/src/pages/Export/const.js +2 -1
- package/src/pages/Export/description.js +1 -1
- package/src/pages/Export/index.js +7 -4
- package/src/pages/Fonts/index.js +2 -2
- package/src/pages/Icons/index.js +2 -2
- package/src/pages/Library/index.js +1 -1
- package/src/pages/Spaces/Table.js +1 -1
- package/src/pages/Typography/documentStyles.js +113 -11
- package/src/pages/Typography/index.js +2 -2
- package/src/pages/Typography/stylesHelpers.js +1 -1
- package/src/pages/Typography/typeScale.js +2 -1
- package/src/state.js +3 -2
package/.symbols/index.js
CHANGED
|
@@ -15,6 +15,8 @@ import field from './field'
|
|
|
15
15
|
import tooltip from './tooltip'
|
|
16
16
|
import pills from './pills'
|
|
17
17
|
|
|
18
|
+
import * as smbls from '@symbo.ls/components/src/Fields'
|
|
19
|
+
|
|
18
20
|
export const LIBRARY = [
|
|
19
21
|
circleButton,
|
|
20
22
|
buttonDownload,
|
|
@@ -31,3 +33,15 @@ export const LIBRARY = [
|
|
|
31
33
|
tooltip,
|
|
32
34
|
pills
|
|
33
35
|
]
|
|
36
|
+
|
|
37
|
+
export const COMPONENTS = Object.keys(smbls).map(key => {
|
|
38
|
+
const component = smbls[key]
|
|
39
|
+
return {
|
|
40
|
+
key,
|
|
41
|
+
component: { extend: component },
|
|
42
|
+
code: JSON.stringify(component, null, 2),
|
|
43
|
+
settings: {
|
|
44
|
+
gridOptions: { colspan: 3, rowspan: 2 }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
})
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -19,7 +19,8 @@ smbls.init({ verbose: false, ...SYMBOLS_CONF })
|
|
|
19
19
|
|
|
20
20
|
DOM.define({
|
|
21
21
|
__filepath: param => param,
|
|
22
|
-
$setCollection: smbls.Collection.define.$setCollection
|
|
22
|
+
$setCollection: smbls.Collection.define.$setCollection,
|
|
23
|
+
$setStateCollection: smbls.Collection.define.$setStateCollection
|
|
23
24
|
})
|
|
24
25
|
|
|
25
26
|
// export default DOM.create(App, DevFocus, 'app', { TODO: try this
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
Grid,
|
|
6
6
|
SectionHeader
|
|
7
7
|
} from '@symbo.ls/components'
|
|
8
|
-
import {
|
|
8
|
+
import { COMPONENTS } from '../../../.symbols'
|
|
9
9
|
import { gridStyle, rowStyle } from './style'
|
|
10
10
|
|
|
11
11
|
export default {
|
|
@@ -86,7 +86,7 @@ export default {
|
|
|
86
86
|
}),
|
|
87
87
|
|
|
88
88
|
childExtend: ComponentTemplate,
|
|
89
|
-
$
|
|
89
|
+
$setStateCollection: ({ state }) => COMPONENTS.filter(v => {
|
|
90
90
|
if (!state.category) return true
|
|
91
91
|
return state.category === v.category.key
|
|
92
92
|
})
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import { SEQUENCE, TYPOGRAPHY } from '@symbo.ls/scratch'
|
|
4
|
-
import { LIBRARY } from '../../../.symbols'
|
|
4
|
+
import { LIBRARY, COMPONENTS } from '../../../.symbols'
|
|
5
5
|
|
|
6
6
|
const COMPONENT_ROUTES = {}
|
|
7
7
|
LIBRARY.map(v => (COMPONENT_ROUTES[`/${v.key}`] = v))
|
|
8
|
+
COMPONENTS.map(v => (COMPONENT_ROUTES[`/${v.key}`] = v))
|
|
8
9
|
|
|
9
10
|
// const SEQUENCE = [8, 9, 10, 11, 12, 13, 14, 15, 16, 18, 20, 22, 24, 26, 32, 36, 42, 48, 56, 62, 68, 76, 84, 92, 100, 110]
|
|
10
11
|
|
|
@@ -12,10 +12,13 @@ import description from './description'
|
|
|
12
12
|
|
|
13
13
|
import { COMPONENT_ROUTES } from './const'
|
|
14
14
|
|
|
15
|
-
const componentState = (context) =>
|
|
16
|
-
const
|
|
17
|
-
return v
|
|
18
|
-
|
|
15
|
+
const componentState = (context) => {
|
|
16
|
+
const arr = [...context.LIBRARY, ...context.COMPONENTS]
|
|
17
|
+
return arr.filter(v => {
|
|
18
|
+
const key = window.location.pathname.split('component/')[1]
|
|
19
|
+
return v.key === key
|
|
20
|
+
})
|
|
21
|
+
}
|
|
19
22
|
|
|
20
23
|
export const Export = {
|
|
21
24
|
key: 'export',
|
package/src/pages/Fonts/index.js
CHANGED
|
@@ -47,7 +47,7 @@ const FontFaces = {
|
|
|
47
47
|
margin: '0 -Z'
|
|
48
48
|
},
|
|
49
49
|
childExtend: [FontObject, Hoverable],
|
|
50
|
-
$
|
|
50
|
+
$setStateCollection: mapFonts
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -89,7 +89,7 @@ const FontFamilies = {
|
|
|
89
89
|
},
|
|
90
90
|
|
|
91
91
|
childExtend: [FontFamilyObject, Hoverable],
|
|
92
|
-
$
|
|
92
|
+
$setStateCollection: mapFontFamilies
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
package/src/pages/Icons/index.js
CHANGED
|
@@ -56,7 +56,7 @@ const IconsGroup = {
|
|
|
56
56
|
}),
|
|
57
57
|
|
|
58
58
|
childExtend: IconItem,
|
|
59
|
-
$
|
|
59
|
+
$setStateCollection: ({ state }) => state.list
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -110,5 +110,5 @@ export const Icons = {
|
|
|
110
110
|
},
|
|
111
111
|
|
|
112
112
|
childExtend: IconsGroup,
|
|
113
|
-
$
|
|
113
|
+
$setStateCollection: () => ICON_GROUPS
|
|
114
114
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
import { findHeadingLetter, getFontFamily } from '@symbo.ls/scratch'
|
|
3
4
|
import {
|
|
4
5
|
DocumentStylesSequence,
|
|
5
6
|
Flex,
|
|
6
7
|
SectionHeader,
|
|
7
8
|
SelectField,
|
|
8
9
|
SequenceSliders,
|
|
9
|
-
|
|
10
|
+
DeviceButtonSet
|
|
10
11
|
} from '@symbo.ls/components'
|
|
11
|
-
// import { mapSequence, sortSequence } from '@symbo.ls/utils'
|
|
12
12
|
import stylesHelpers from './stylesHelpers'
|
|
13
13
|
|
|
14
14
|
export default {
|
|
@@ -36,28 +36,116 @@ export default {
|
|
|
36
36
|
header: {
|
|
37
37
|
extend: Flex,
|
|
38
38
|
SequenceSliders,
|
|
39
|
-
|
|
39
|
+
DeviceButtonSet
|
|
40
40
|
},
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
headings: {
|
|
43
43
|
extend: DocumentStylesSequence,
|
|
44
|
-
$
|
|
44
|
+
$setStateCollection: (el) => {
|
|
45
45
|
const { state, context } = el // eslint-disable-line no-unused-vars
|
|
46
|
-
const { TYPOGRAPHY } = context.SYSTEM
|
|
46
|
+
const { TYPOGRAPHY, FONT_FAMILY } = context.SYSTEM
|
|
47
47
|
const { styles } = TYPOGRAPHY
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
el.removeContent()
|
|
49
|
+
|
|
50
|
+
const family = FONT_FAMILY[FONT_FAMILY.default]
|
|
51
|
+
const familyValue = getFontFamily()
|
|
52
|
+
const lineHeight = TYPOGRAPHY.lineHeight
|
|
53
|
+
const font = family.arr[0]
|
|
54
|
+
|
|
55
|
+
const HEADINGS = new Array(6).fill(null).map((_, i) => 'h' + (i + 1))
|
|
56
|
+
|
|
57
|
+
return HEADINGS.map((v, k) => ({
|
|
58
|
+
key: v,
|
|
59
|
+
value: {
|
|
60
|
+
font,
|
|
61
|
+
fontFamily: familyValue,
|
|
62
|
+
fontWeight: 900 - (k * 100),
|
|
63
|
+
lineHeight,
|
|
64
|
+
...styles[v]
|
|
65
|
+
},
|
|
66
|
+
labels: [
|
|
67
|
+
{ icon: 'fontFace', text: font },
|
|
68
|
+
{ icon: 'fontVariable', text: 900 - (k * 100) },
|
|
69
|
+
{ icon: 'textLineHeight', text: lineHeight }
|
|
70
|
+
],
|
|
71
|
+
sequenceValue: state.sequence[
|
|
72
|
+
findHeadingLetter(state.h1Matches, k)
|
|
73
|
+
]
|
|
74
|
+
}))
|
|
51
75
|
}
|
|
52
76
|
},
|
|
53
77
|
|
|
54
|
-
|
|
78
|
+
doc: {
|
|
79
|
+
extend: DocumentStylesSequence,
|
|
80
|
+
$setStateCollection: (el) => {
|
|
81
|
+
const { state, context } = el // eslint-disable-line no-unused-vars
|
|
82
|
+
const { DOCUMENT, FONT_FAMILY } = context.SYSTEM
|
|
83
|
+
el.removeContent()
|
|
84
|
+
|
|
85
|
+
const family = FONT_FAMILY[FONT_FAMILY.default]
|
|
86
|
+
const familyValue = getFontFamily()
|
|
87
|
+
const font = family.arr[0]
|
|
88
|
+
const { fontWeight, lineHeight } = DOCUMENT
|
|
89
|
+
|
|
90
|
+
return [{
|
|
91
|
+
key: 'body',
|
|
92
|
+
value: {
|
|
93
|
+
font,
|
|
94
|
+
fontFamily: familyValue,
|
|
95
|
+
fontWeight: fontWeight || 400,
|
|
96
|
+
lineHeight
|
|
97
|
+
},
|
|
98
|
+
labels: [
|
|
99
|
+
{ icon: 'fontFace', text: font },
|
|
100
|
+
{ icon: 'fontVariable', text: fontWeight || 400 },
|
|
101
|
+
{ icon: 'textLineHeight', text: lineHeight }
|
|
102
|
+
],
|
|
103
|
+
sequenceValue: state.sequence['A']
|
|
104
|
+
}]
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
|
|
108
|
+
helpers: {
|
|
109
|
+
$setStateCollection: (el) => {
|
|
110
|
+
const { state, context } = el // eslint-disable-line no-unused-vars
|
|
111
|
+
const { TYPOGRAPHY, FONT_FAMILY } = context.SYSTEM
|
|
112
|
+
const { styles } = TYPOGRAPHY
|
|
113
|
+
el.removeContent()
|
|
114
|
+
|
|
115
|
+
const family = FONT_FAMILY[FONT_FAMILY.default]
|
|
116
|
+
const familyValue = getFontFamily()
|
|
117
|
+
const lineHeight = TYPOGRAPHY.lineHeight
|
|
118
|
+
const font = family.arr[0]
|
|
119
|
+
|
|
120
|
+
return Object.keys(styles).filter(v => v.slice(0, 1) === '.').map((v, k) => ({
|
|
121
|
+
key: v,
|
|
122
|
+
value: {
|
|
123
|
+
font,
|
|
124
|
+
fontFamily: familyValue,
|
|
125
|
+
fontWeight: 900 - (k * 100),
|
|
126
|
+
lineHeight,
|
|
127
|
+
...styles[v]
|
|
128
|
+
},
|
|
129
|
+
labels: [
|
|
130
|
+
{ icon: 'fontFace', text: font },
|
|
131
|
+
{ icon: 'fontVariable', text: 900 - (k * 100) },
|
|
132
|
+
{ icon: 'textLineHeight', text: lineHeight }
|
|
133
|
+
],
|
|
134
|
+
sequenceValue: state.sequence[
|
|
135
|
+
findHeadingLetter(state.h1Matches, k)
|
|
136
|
+
]
|
|
137
|
+
}))
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
|
|
141
|
+
footer: {}
|
|
55
142
|
},
|
|
56
143
|
|
|
57
144
|
fields: {
|
|
58
145
|
extend: Flex,
|
|
59
146
|
props: {
|
|
60
147
|
gap: 'A',
|
|
148
|
+
margin: '0 0 0 E2+B',
|
|
61
149
|
align: 'center flex-start'
|
|
62
150
|
},
|
|
63
151
|
|
|
@@ -129,5 +217,19 @@ export default {
|
|
|
129
217
|
|
|
130
218
|
Line: {},
|
|
131
219
|
|
|
132
|
-
stylesHelpers
|
|
220
|
+
stylesHelpers,
|
|
221
|
+
|
|
222
|
+
on: {
|
|
223
|
+
init: (el, s) => {
|
|
224
|
+
if (!el.context.SYSTEM) return
|
|
225
|
+
const { context } = el // eslint-disable-line no-unused-vars
|
|
226
|
+
const { TYPOGRAPHY } = context.SYSTEM
|
|
227
|
+
const { styles } = TYPOGRAPHY
|
|
228
|
+
if (styles) {
|
|
229
|
+
s.update({
|
|
230
|
+
styles
|
|
231
|
+
}, { preventUpdate: true })
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
133
235
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
import state from './state'
|
|
4
4
|
|
|
5
|
+
import typeScale from './typeScale' // eslint-disable-line no-unused-vars
|
|
5
6
|
import documentStyles from './documentStyles'
|
|
6
|
-
import typeScale from './typeScale'
|
|
7
7
|
|
|
8
8
|
export const Typography = {
|
|
9
9
|
state,
|
|
@@ -13,7 +13,7 @@ export const Typography = {
|
|
|
13
13
|
p: 'A general configuration of type properties on the document.'
|
|
14
14
|
},
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
typeScale,
|
|
17
17
|
Line: {},
|
|
18
18
|
documentStyles
|
|
19
19
|
}
|
package/src/state.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import SYSTEM from './config'
|
|
4
|
-
import { LIBRARY } from '../.symbols'
|
|
4
|
+
import { LIBRARY, COMPONENTS } from '../.symbols'
|
|
5
5
|
|
|
6
6
|
export const state = {
|
|
7
7
|
globalTheme: 'dark'
|
|
@@ -9,5 +9,6 @@ export const state = {
|
|
|
9
9
|
|
|
10
10
|
export const context = {
|
|
11
11
|
LIBRARY,
|
|
12
|
-
SYSTEM
|
|
12
|
+
SYSTEM,
|
|
13
|
+
COMPONENTS
|
|
13
14
|
}
|