@symbo.ls/preview 0.0.16 → 0.0.18
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/button-download/index.js +4 -2
- package/.symbols/button-pro/index.js +3 -5
- package/.symbols/button-theme-switcher/index.js +0 -6
- package/.symbols/button-user/index.js +0 -1
- package/.symbols/datepicker/index.js +13 -2
- package/.symbols/dropdown-list/index.js +0 -8
- package/.symbols/field/index.js +0 -1
- package/.symbols/label/index.js +0 -1
- package/package.json +1 -1
- package/src/components/ShapeSet.js +2 -1
- package/src/config/index.js +1 -1
- package/src/config/theme.js +1 -71
- package/src/index.js +1 -0
- package/src/pages/Editor/scene.js +0 -2
- package/src/pages/Export/scene.js +3 -0
- package/src/pages/Export/state.js +2 -2
- package/src/pages/Icons/index.js +7 -5
- package/src/pages/Shapes/shapeSet.js +27 -27
- package/src/pages/Spaces/Preview.js +62 -0
- package/src/pages/Spaces/SpacingScale.js +53 -0
- package/src/pages/Spaces/Table.js +206 -0
- package/src/pages/Spaces/__/index copy.js +45 -0
- package/src/pages/Spaces/index.js +14 -36
- package/src/pages/Spaces/state.js +11 -7
- /package/src/pages/Spaces/{boxModel.js → __/boxModel.js} +0 -0
- /package/src/pages/Spaces/{preview.js → __/preview.js} +0 -0
- /package/src/pages/Spaces/{sequence.js → __/sequence.js} +0 -0
- /package/src/pages/Spaces/{style.js → __/style.js} +0 -0
|
@@ -14,9 +14,11 @@ const component = {
|
|
|
14
14
|
props: {
|
|
15
15
|
icon: 'arrowDown',
|
|
16
16
|
gap: 'X2',
|
|
17
|
-
theme: '
|
|
17
|
+
theme: 'quinary',
|
|
18
18
|
text: 'Download',
|
|
19
|
-
padding: 'Z2 B2',
|
|
19
|
+
// padding: 'Z2 B2',
|
|
20
|
+
border: '.2em, solid, blue .2',
|
|
21
|
+
padding: 'A1 B2',
|
|
20
22
|
round: 'C'
|
|
21
23
|
}
|
|
22
24
|
}
|
|
@@ -15,7 +15,7 @@ const component = {
|
|
|
15
15
|
extend: KangorooButton,
|
|
16
16
|
|
|
17
17
|
props: {
|
|
18
|
-
|
|
18
|
+
|
|
19
19
|
round: 'Z2',
|
|
20
20
|
padding: ['X1', 'X1', 'X1', 'A'],
|
|
21
21
|
size: 'A',
|
|
@@ -31,7 +31,6 @@ const component = {
|
|
|
31
31
|
|
|
32
32
|
child: {
|
|
33
33
|
round: 12,
|
|
34
|
-
theme: ['lightDark', 'inverse'],
|
|
35
34
|
size: 'Z',
|
|
36
35
|
padding: 'Z A2',
|
|
37
36
|
text: '1 month free'
|
|
@@ -45,7 +44,7 @@ const component = {
|
|
|
45
44
|
const code = `{
|
|
46
45
|
extend: Button,
|
|
47
46
|
props: {
|
|
48
|
-
|
|
47
|
+
|
|
49
48
|
round: 12,
|
|
50
49
|
padding: ['X1', 'X1', 'X1', 'A'],
|
|
51
50
|
size: 'A',
|
|
@@ -54,7 +53,6 @@ const code = `{
|
|
|
54
53
|
|
|
55
54
|
label: {
|
|
56
55
|
round: 12,
|
|
57
|
-
theme: ['lightDark', 'inverse'],
|
|
58
56
|
size: 'Z',
|
|
59
57
|
gap: 'A',
|
|
60
58
|
padding: 'Z A2',
|
|
@@ -65,7 +63,7 @@ const code = `{
|
|
|
65
63
|
|
|
66
64
|
const defaultState = {}
|
|
67
65
|
const props = {
|
|
68
|
-
|
|
66
|
+
|
|
69
67
|
round: 12,
|
|
70
68
|
padding: ['X1', 'X1', 'X1', 'A'],
|
|
71
69
|
size: 'A',
|
|
@@ -17,7 +17,6 @@ const component = {
|
|
|
17
17
|
|
|
18
18
|
props: {
|
|
19
19
|
round: 'C',
|
|
20
|
-
theme: 'lightDark',
|
|
21
20
|
size: 'A',
|
|
22
21
|
padding: 'X1 Y X1 A1',
|
|
23
22
|
gap: 'Z1',
|
|
@@ -29,7 +28,6 @@ const component = {
|
|
|
29
28
|
},
|
|
30
29
|
|
|
31
30
|
child: {
|
|
32
|
-
theme: ['lightDark', 'inverse'],
|
|
33
31
|
round: 'C',
|
|
34
32
|
icon: 'moon',
|
|
35
33
|
padding: 'Z Z1',
|
|
@@ -52,7 +50,6 @@ const code2 = `{
|
|
|
52
50
|
extend: KangorooButton,
|
|
53
51
|
props: {
|
|
54
52
|
round: 'C',
|
|
55
|
-
theme: 'lightDark',
|
|
56
53
|
size: 'Z',
|
|
57
54
|
|
|
58
55
|
light: {
|
|
@@ -61,7 +58,6 @@ const code2 = `{
|
|
|
61
58
|
},
|
|
62
59
|
|
|
63
60
|
dark: {
|
|
64
|
-
theme: ['lightDark', 'inverse'],
|
|
65
61
|
round: 'C',
|
|
66
62
|
icon: 'moon',
|
|
67
63
|
text: 'Dark Mode'
|
|
@@ -72,7 +68,6 @@ const code2 = `{
|
|
|
72
68
|
const defaultState = {}
|
|
73
69
|
const props = {
|
|
74
70
|
round: 'C',
|
|
75
|
-
theme: 'lightDark',
|
|
76
71
|
size: 'Z',
|
|
77
72
|
|
|
78
73
|
light: {
|
|
@@ -81,7 +76,6 @@ const props = {
|
|
|
81
76
|
},
|
|
82
77
|
|
|
83
78
|
child: {
|
|
84
|
-
theme: ['lightDark', 'inverse'],
|
|
85
79
|
round: 'C',
|
|
86
80
|
icon: 'moon',
|
|
87
81
|
text: 'Dark Mode'
|
|
@@ -13,13 +13,24 @@ const category = CATEGORIES[7]
|
|
|
13
13
|
|
|
14
14
|
const component = {
|
|
15
15
|
style,
|
|
16
|
-
extend: DatePicker
|
|
16
|
+
extend: DatePicker,
|
|
17
|
+
props: {
|
|
18
|
+
theme: null,
|
|
19
|
+
background: '--theme-quinary-dark-background',
|
|
20
|
+
style: {
|
|
21
|
+
backdropFilter: 'blur(3px)',
|
|
22
|
+
}
|
|
23
|
+
}
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
const code = `{}`
|
|
20
27
|
|
|
21
28
|
const defaultState = {}
|
|
22
|
-
const props = {
|
|
29
|
+
const props = {
|
|
30
|
+
style: {
|
|
31
|
+
backdropFilter: 'blur(3px)',
|
|
32
|
+
}
|
|
33
|
+
}
|
|
23
34
|
|
|
24
35
|
const settings = {
|
|
25
36
|
gridOptions: { colspan: 7, rowspan: 5 }
|
|
@@ -14,14 +14,6 @@ const component = {
|
|
|
14
14
|
props: {
|
|
15
15
|
theme: 'quaternary', round: 'A'
|
|
16
16
|
},
|
|
17
|
-
// props: (el, s) => {
|
|
18
|
-
// return {
|
|
19
|
-
// round: 'Z',
|
|
20
|
-
// depth: '16',
|
|
21
|
-
// theme: s.sceneTheme === 'light' ? 'lightDark' : 'dark',
|
|
22
|
-
// rowTheme: s.sceneTheme === 'light' ? 'lightDark' : 'quaternary'
|
|
23
|
-
// }
|
|
24
|
-
// },
|
|
25
17
|
|
|
26
18
|
...[
|
|
27
19
|
{ span: { props: { text: 'Today' } } },
|
package/.symbols/field/index.js
CHANGED
package/.symbols/label/index.js
CHANGED
package/package.json
CHANGED
package/src/config/index.js
CHANGED
package/src/config/theme.js
CHANGED
|
@@ -1,83 +1,13 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import dots from '../assets/dots.png'
|
|
4
|
-
import dotsDark from '../assets/dotsDark.png'
|
|
5
|
-
|
|
6
|
-
const MODAL = {
|
|
7
|
-
modalFade: {
|
|
8
|
-
color: 'white',
|
|
9
|
-
backdropFilter: 'blur(3px)',
|
|
10
|
-
backgroundColor: 'modalFade 0.75'
|
|
11
|
-
},
|
|
12
|
-
modalBackground: {
|
|
13
|
-
color: 'white',
|
|
14
|
-
backgroundColor: 'modalBackground'
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const SCENE = {
|
|
19
|
-
darkScene: {
|
|
20
|
-
backgroundColor: 'white 0.02',
|
|
21
|
-
'> div': { backgroundImage: `url(${dots})` }
|
|
22
|
-
},
|
|
23
|
-
lightScene: {
|
|
24
|
-
backgroundColor: 'white',
|
|
25
|
-
'> div': { backgroundImage: `url(${dotsDark})` }
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const DROPDOWN = {
|
|
30
|
-
dropdownItem: {
|
|
31
|
-
color: 'white 0.65',
|
|
32
|
-
state: {
|
|
33
|
-
hover: {
|
|
34
|
-
color: 'white',
|
|
35
|
-
background: 'gradient-light-active'
|
|
36
|
-
},
|
|
37
|
-
active: {
|
|
38
|
-
color: 'white',
|
|
39
|
-
background: 'gradient-light-active'
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
dropdownItemActive: {
|
|
44
|
-
color: 'white',
|
|
45
|
-
background: 'gradient-light-active'
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
3
|
export const EDITOR_THEMES = {
|
|
50
|
-
header: {
|
|
51
|
-
color: 'white',
|
|
52
|
-
backgroundColor: 'black 0.85',
|
|
53
|
-
borderColor: 'white 0.09',
|
|
54
|
-
backdropFilter: 'blur(3px)'
|
|
55
|
-
},
|
|
56
|
-
|
|
57
4
|
shape: {
|
|
58
5
|
background: 'shapeColor',
|
|
59
6
|
border: 'none'
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
...MODAL,
|
|
63
|
-
...SCENE,
|
|
64
|
-
...DROPDOWN
|
|
7
|
+
}
|
|
65
8
|
}
|
|
66
9
|
|
|
67
10
|
export const COMPONENT_THEMES = {
|
|
68
|
-
lightDark: {
|
|
69
|
-
background: 'white',
|
|
70
|
-
color: 'darkPurple',
|
|
71
|
-
variants: {
|
|
72
|
-
inverse: true
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
alert: {
|
|
77
|
-
background: 'yellow',
|
|
78
|
-
color: 'black'
|
|
79
|
-
},
|
|
80
|
-
|
|
81
11
|
label: {
|
|
82
12
|
background: 'brown',
|
|
83
13
|
color: 'white'
|
package/src/index.js
CHANGED
|
@@ -33,7 +33,6 @@ const buttonThemeSwitcher = {
|
|
|
33
33
|
|
|
34
34
|
props: {
|
|
35
35
|
round: 'C',
|
|
36
|
-
theme: 'lightDark',
|
|
37
36
|
size: 'A',
|
|
38
37
|
padding: 'X1 Y X1 A1',
|
|
39
38
|
gap: 'Z1',
|
|
@@ -45,7 +44,6 @@ const buttonThemeSwitcher = {
|
|
|
45
44
|
},
|
|
46
45
|
|
|
47
46
|
dark: {
|
|
48
|
-
theme: ['lightDark', 'inverse'],
|
|
49
47
|
round: 'C',
|
|
50
48
|
icon: 'moon',
|
|
51
49
|
padding: 'Z Z1',
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import { BREAKPOINTS } from '@symbo.ls/scratch'
|
|
4
4
|
import { Scene } from '@symbo.ls/components'
|
|
5
|
+
import { updateReset } from '@symbo.ls/init'
|
|
5
6
|
|
|
6
7
|
export default {
|
|
7
8
|
extend: Scene,
|
|
@@ -41,6 +42,7 @@ export default {
|
|
|
41
42
|
},
|
|
42
43
|
comp: (el, s) => ({
|
|
43
44
|
extend: [s.component],
|
|
45
|
+
props: { inheritSpacingRatio: true }
|
|
44
46
|
}),
|
|
45
47
|
|
|
46
48
|
on: {
|
|
@@ -50,6 +52,7 @@ export default {
|
|
|
50
52
|
fontSize: s.base + 'px',
|
|
51
53
|
spacingRatio: s.ratio
|
|
52
54
|
}, { preventUpdate: true })
|
|
55
|
+
updateReset()
|
|
53
56
|
}
|
|
54
57
|
}
|
|
55
58
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { TYPOGRAPHY } from '@symbo.ls/scratch'
|
|
3
|
+
import { SPACING, TYPOGRAPHY } from '@symbo.ls/scratch'
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
6
|
descriptionTheme: 'dark',
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
currentFontSizeIndex: 3,
|
|
12
12
|
|
|
13
13
|
base: TYPOGRAPHY.base,
|
|
14
|
-
ratio:
|
|
14
|
+
ratio: SPACING.ratio,
|
|
15
15
|
range: [-1, +4],
|
|
16
16
|
scales: {},
|
|
17
17
|
sequence: {},
|
package/src/pages/Icons/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { copyStringToClipboard } from '@symbo.ls/utils'
|
|
|
5
5
|
import { IconText, Flex, Link, ClickableItem, SectionHeader, Grid } from '@symbo.ls/components'
|
|
6
6
|
|
|
7
7
|
import * as ACCESSIBILITY from '@symbo.ls/icons/src/accessibility'
|
|
8
|
-
import * as
|
|
8
|
+
import * as BOXMODEL from '@symbo.ls/icons/src/boxModel'
|
|
9
9
|
import * as DISPLAY from '@symbo.ls/icons/src/display'
|
|
10
10
|
import * as INTERACTIVE from '@symbo.ls/icons/src/interactive'
|
|
11
11
|
import * as LOGOS from '@symbo.ls/icons/src/logos'
|
|
@@ -19,10 +19,11 @@ const IconItem = {
|
|
|
19
19
|
extend: [ClickableItem, Link, IconText],
|
|
20
20
|
props: ({ state }) => ({
|
|
21
21
|
round: 'A',
|
|
22
|
-
size: '
|
|
22
|
+
size: 'C1',
|
|
23
23
|
aspectRatio: '1 / 1',
|
|
24
24
|
flexAlign: 'center center',
|
|
25
25
|
href: '/icons/edit-icon/' + state.name,
|
|
26
|
+
theme: 'tertiary',
|
|
26
27
|
icon: {
|
|
27
28
|
fontSize: 'C2',
|
|
28
29
|
name: state.name
|
|
@@ -70,10 +71,11 @@ const ICON_GROUPS = [{
|
|
|
70
71
|
list: Object.keys(SVG).map(name => ({ name }))
|
|
71
72
|
}, {
|
|
72
73
|
title: 'Accessibility',
|
|
73
|
-
list: Object.keys(ACCESSIBILITY).map(name => ({ name }))
|
|
74
|
+
list: Object.keys(ACCESSIBILITY).map(name => ({ name })),
|
|
75
|
+
p: ''
|
|
74
76
|
}, {
|
|
75
|
-
title: '
|
|
76
|
-
list: Object.keys(
|
|
77
|
+
title: 'Box Model',
|
|
78
|
+
list: Object.keys(BOXMODEL).map(name => ({ name }))
|
|
77
79
|
}, {
|
|
78
80
|
title: 'Display',
|
|
79
81
|
list: Object.keys(DISPLAY).map(name => ({ name }))
|
|
@@ -9,14 +9,14 @@ export const rectangle = {
|
|
|
9
9
|
span: 'with rounds'
|
|
10
10
|
},
|
|
11
11
|
nav: [
|
|
12
|
-
{},
|
|
13
|
-
{ _shape: {
|
|
14
|
-
{ _shape: {
|
|
15
|
-
{ _shape: {
|
|
16
|
-
{ _shape: {
|
|
17
|
-
{ _shape: {
|
|
18
|
-
{ _shape: {
|
|
19
|
-
]
|
|
12
|
+
{ _shape: { round: '0' } },
|
|
13
|
+
{ _shape: { round: 'X' } },
|
|
14
|
+
{ _shape: { round: 'Y' } },
|
|
15
|
+
{ _shape: { round: 'Z' } },
|
|
16
|
+
{ _shape: { round: 'A' } },
|
|
17
|
+
{ _shape: { round: 'B' } },
|
|
18
|
+
{ _shape: { round: 'C' } }
|
|
19
|
+
].map(props => ({ props }))
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export const circle = {
|
|
@@ -36,11 +36,11 @@ export const toolTip = {
|
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
...[
|
|
39
|
-
{ _shape: {
|
|
40
|
-
{ _shape: {
|
|
41
|
-
{ _shape: {
|
|
42
|
-
{ _shape: {
|
|
43
|
-
]
|
|
39
|
+
{ _shape: { shape: 'tooltip', shapeDirection: 'top' } },
|
|
40
|
+
{ _shape: { shape: 'tooltip', shapeDirection: 'right' } },
|
|
41
|
+
{ _shape: { shape: 'tooltip', shapeDirection: 'bottom' } },
|
|
42
|
+
{ _shape: { shape: 'tooltip', shapeDirection: 'left' } }
|
|
43
|
+
].map(props => ({ props }))
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -52,11 +52,11 @@ export const tagShape = {
|
|
|
52
52
|
childExtend: { props: { round: 6 } }
|
|
53
53
|
},
|
|
54
54
|
...[
|
|
55
|
-
{ _shape: {
|
|
56
|
-
{ _shape: {
|
|
57
|
-
{ _shape: {
|
|
58
|
-
{ _shape: {
|
|
59
|
-
]
|
|
55
|
+
{ _shape: { shape: 'tag', shapeDirection: 'left' } },
|
|
56
|
+
{ _shape: { shape: 'tag', shapeDirection: 'top' } },
|
|
57
|
+
{ _shape: { shape: 'tag', shapeDirection: 'right' } },
|
|
58
|
+
{ _shape: { shape: 'tag', shapeDirection: 'bottom' } }
|
|
59
|
+
].map(props => ({ props }))
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -64,13 +64,13 @@ export const bubble = {
|
|
|
64
64
|
extend: ShapeSet,
|
|
65
65
|
label: { text: 'Bubble' },
|
|
66
66
|
nav: [
|
|
67
|
-
{ _shape: {
|
|
68
|
-
{ _shape: {
|
|
69
|
-
{ _shape: {
|
|
70
|
-
{ _shape: {
|
|
71
|
-
{ _shape: {
|
|
72
|
-
{ _shape: {
|
|
73
|
-
{ _shape: {
|
|
74
|
-
{ _shape: {
|
|
75
|
-
]
|
|
67
|
+
{ _shape: { round: 'X B B X' } },
|
|
68
|
+
{ _shape: { round: 'B X X B' } },
|
|
69
|
+
{ _shape: { round: 'X X B B' } },
|
|
70
|
+
{ _shape: { round: 'B B X X' } },
|
|
71
|
+
{ _shape: { round: 'B X X X' } },
|
|
72
|
+
{ _shape: { round: 'X B X X' } },
|
|
73
|
+
{ _shape: { round: 'X X B X' } },
|
|
74
|
+
{ _shape: { round: 'X X X B' } }
|
|
75
|
+
].map(props => ({ props }))
|
|
76
76
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { Grid, Scene } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
const returnScale = (state, key) => {
|
|
6
|
+
const { scales } = state
|
|
7
|
+
return (scales[state[key]] || 0) + 'em'
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export const Preview = {
|
|
11
|
+
extend: Scene,
|
|
12
|
+
|
|
13
|
+
props: {
|
|
14
|
+
margin: '0 -Z1'
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
scene: {
|
|
18
|
+
boxModel: {
|
|
19
|
+
extend: Grid,
|
|
20
|
+
props: {
|
|
21
|
+
color: 'gray5',
|
|
22
|
+
fontSize: 'Z',
|
|
23
|
+
columns: '30px auto 30px',
|
|
24
|
+
rows: '30px auto 30px',
|
|
25
|
+
templateAreas: `"x1 t x2"
|
|
26
|
+
"l content r"
|
|
27
|
+
"x3 b x4"`,
|
|
28
|
+
alignItems: 'center',
|
|
29
|
+
textAlign: 'center'
|
|
30
|
+
},
|
|
31
|
+
|
|
32
|
+
...[
|
|
33
|
+
...['', { text: (el, s) => s.paddingTop || '', style: { gridArea: 't' } }, ''],
|
|
34
|
+
...[
|
|
35
|
+
{ text: (el, s) => s.paddingLeft || '', style: { gridArea: 'l' } },
|
|
36
|
+
{
|
|
37
|
+
props: ({ state }) => ({
|
|
38
|
+
fontSize: `${state.base}px`,
|
|
39
|
+
borderRadius: state['borderRadius'],
|
|
40
|
+
lineHeight: 1,
|
|
41
|
+
gridArea: 'content',
|
|
42
|
+
borderStyle: 'solid',
|
|
43
|
+
theme: 'quaternary',
|
|
44
|
+
padding: 'X2',
|
|
45
|
+
borderColor: 'grassgreen 0.25',
|
|
46
|
+
borderWidth: [
|
|
47
|
+
returnScale(state, 'paddingTop'),
|
|
48
|
+
returnScale(state, 'paddingRight'),
|
|
49
|
+
returnScale(state, 'paddingBottom'),
|
|
50
|
+
returnScale(state, 'paddingLeft')
|
|
51
|
+
],
|
|
52
|
+
style: { whiteSpace: 'nowrap' }
|
|
53
|
+
}),
|
|
54
|
+
text: (el, s) => `Base ${s.base}`
|
|
55
|
+
}, {
|
|
56
|
+
text: (el, s) => s.paddingRight || '', style: { gridArea: 'r' }
|
|
57
|
+
}],
|
|
58
|
+
...['', { text: (el, s) => s.paddingBottom || '', style: { gridArea: 'b' } }, '']
|
|
59
|
+
]
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { SequenceSliders, Flex } from '@symbo.ls/components'
|
|
4
|
+
import { Preview } from './Preview'
|
|
5
|
+
import { Table } from './Table'
|
|
6
|
+
|
|
7
|
+
export const SpacingScale = {
|
|
8
|
+
extend: Flex,
|
|
9
|
+
|
|
10
|
+
props: {
|
|
11
|
+
flow: 'column',
|
|
12
|
+
gap: 'C1'
|
|
13
|
+
},
|
|
14
|
+
|
|
15
|
+
sliders: {
|
|
16
|
+
extend: SequenceSliders,
|
|
17
|
+
props: {
|
|
18
|
+
position: 'sticky',
|
|
19
|
+
top: 'D',
|
|
20
|
+
background: 'black .5',
|
|
21
|
+
zIndex: '2',
|
|
22
|
+
margin: '-C -B -B',
|
|
23
|
+
padding: 'C B B',
|
|
24
|
+
style: {
|
|
25
|
+
backdropFilter: 'blur(15px)'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
scale: {
|
|
31
|
+
extend: Flex,
|
|
32
|
+
props: {
|
|
33
|
+
flow: 'column',
|
|
34
|
+
gap: 'B1',
|
|
35
|
+
margin: '0 0 C2',
|
|
36
|
+
|
|
37
|
+
table: { flex: 1 },
|
|
38
|
+
preview: { flex: 1 }
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
table: { extend: Table },
|
|
42
|
+
preview: {
|
|
43
|
+
extend: Preview,
|
|
44
|
+
props: {
|
|
45
|
+
position: 'sticky',
|
|
46
|
+
bottom: 'Z',
|
|
47
|
+
style: {
|
|
48
|
+
backdropFilter: 'blur(15px)'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { ClickableItem, Grid, Pseudo, WiderButton } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
import { mapSequence, sortSequence } from '@symbo.ls/utils'
|
|
6
|
+
|
|
7
|
+
const Buttons = {
|
|
8
|
+
childExtend: {
|
|
9
|
+
extend: [ClickableItem, WiderButton],
|
|
10
|
+
props: ({ key, state, parent }) => ({
|
|
11
|
+
isActive: parent.parent.parent.state[key] === state.key,
|
|
12
|
+
padding: 'Z',
|
|
13
|
+
icon: key,
|
|
14
|
+
theme: null,
|
|
15
|
+
'@dark': {
|
|
16
|
+
background: 'gray1',
|
|
17
|
+
color: 'gray5'
|
|
18
|
+
},
|
|
19
|
+
'@light': {
|
|
20
|
+
background: 'white .5',
|
|
21
|
+
color: 'gray7'
|
|
22
|
+
},
|
|
23
|
+
':hover': {
|
|
24
|
+
theme: 'quaternary'
|
|
25
|
+
},
|
|
26
|
+
'.isActive': {
|
|
27
|
+
color: 'blue',
|
|
28
|
+
':hover': {
|
|
29
|
+
color: 'blue'
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
|
|
34
|
+
attr: { title: el => el.key },
|
|
35
|
+
|
|
36
|
+
on: {
|
|
37
|
+
click: (ev, { key, state, parent }) => {
|
|
38
|
+
const parentState = parent.parent.parent.state
|
|
39
|
+
const active = parentState[key] === state.key
|
|
40
|
+
if (active) {
|
|
41
|
+
delete parentState[key] && parentState.update()
|
|
42
|
+
} else {
|
|
43
|
+
parentState.update({ [key]: state.key })
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
|
|
49
|
+
paddingTop: {},
|
|
50
|
+
paddingRight: {},
|
|
51
|
+
paddingBottom: {},
|
|
52
|
+
paddingLeft: {},
|
|
53
|
+
borderRadius: {}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const Cell = {
|
|
57
|
+
tag: 'div',
|
|
58
|
+
props: {
|
|
59
|
+
padding: 'X2 C2 X2 0'
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const Row = {
|
|
64
|
+
extend: Grid,
|
|
65
|
+
key: state => state.key,
|
|
66
|
+
|
|
67
|
+
props: ({ state }) => ({
|
|
68
|
+
columns: '10ch 14ch 13ch 10ch 18em 1fr',
|
|
69
|
+
alignItems: 'center',
|
|
70
|
+
isBase: state.index === 0,
|
|
71
|
+
isNotActive: (state.key && state.key.length) !== 1,
|
|
72
|
+
|
|
73
|
+
margin: '0 -A',
|
|
74
|
+
padding: '0 B',
|
|
75
|
+
|
|
76
|
+
'.isNotActive': {
|
|
77
|
+
opacity: 0.8
|
|
78
|
+
},
|
|
79
|
+
'.isBase': {
|
|
80
|
+
opacity: 1,
|
|
81
|
+
background: 'gray1 .5'
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
':hover': {
|
|
85
|
+
background: 'gray1 .65'
|
|
86
|
+
},
|
|
87
|
+
|
|
88
|
+
i: {
|
|
89
|
+
text: state.key,
|
|
90
|
+
isActive: (state.key && state.key.length) === 1,
|
|
91
|
+
isNotActive: (state.key && state.key.length) !== 1,
|
|
92
|
+
|
|
93
|
+
'.isActive': {
|
|
94
|
+
fontWeight: '600',
|
|
95
|
+
'@dark': { color: 'gray9' },
|
|
96
|
+
'@light': { color: 'gray3' }
|
|
97
|
+
},
|
|
98
|
+
'.isNotActive': {
|
|
99
|
+
fontWeight: '400',
|
|
100
|
+
'@dark': { color: 'gray6' },
|
|
101
|
+
'@light': { color: 'gray7' }
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
decimal: {
|
|
105
|
+
text: state.decimal,
|
|
106
|
+
color: 'gray6',
|
|
107
|
+
fontWeight: '300'
|
|
108
|
+
},
|
|
109
|
+
px: {
|
|
110
|
+
text: state.val,
|
|
111
|
+
'@dark': { color: 'gray9' },
|
|
112
|
+
'@light': { color: 'gray3' }
|
|
113
|
+
},
|
|
114
|
+
em: {
|
|
115
|
+
color: 'gray6',
|
|
116
|
+
text: state.scaling + 'em'
|
|
117
|
+
},
|
|
118
|
+
buttons: {
|
|
119
|
+
display: 'flex',
|
|
120
|
+
gap: '.2em',
|
|
121
|
+
opacity: '1',
|
|
122
|
+
':empty': { padding: '0' }
|
|
123
|
+
},
|
|
124
|
+
graph: {
|
|
125
|
+
margin: '0 0 0 -B2',
|
|
126
|
+
line: {
|
|
127
|
+
widthRange: `${state.val}px` || 0,
|
|
128
|
+
height: '2px',
|
|
129
|
+
background: 'blue',
|
|
130
|
+
borderRadius: '2px'
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}),
|
|
134
|
+
|
|
135
|
+
childExtend: Cell,
|
|
136
|
+
|
|
137
|
+
i: {},
|
|
138
|
+
em: {},
|
|
139
|
+
decimal: {},
|
|
140
|
+
px: {},
|
|
141
|
+
buttons: Buttons,
|
|
142
|
+
|
|
143
|
+
graph: { line: {} }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const HeaderRow = {
|
|
147
|
+
extend: Row,
|
|
148
|
+
|
|
149
|
+
childExtend: {
|
|
150
|
+
props: {
|
|
151
|
+
color: 'gray7',
|
|
152
|
+
style: { paddingBlock: '0 .618em' }
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
|
|
156
|
+
i: '#',
|
|
157
|
+
em: 'em',
|
|
158
|
+
decimal: 'decimal',
|
|
159
|
+
px: 'px',
|
|
160
|
+
buttons: null,
|
|
161
|
+
graph: null
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
export const Table = {
|
|
165
|
+
extend: Pseudo,
|
|
166
|
+
tag: 'section',
|
|
167
|
+
|
|
168
|
+
props: {
|
|
169
|
+
overflow: 'hidden',
|
|
170
|
+
position: 'relative',
|
|
171
|
+
header: {
|
|
172
|
+
'@dark': { color: 'gray6' },
|
|
173
|
+
'@light': { color: 'gray7' }
|
|
174
|
+
},
|
|
175
|
+
|
|
176
|
+
'::after': {
|
|
177
|
+
content: '""',
|
|
178
|
+
position: 'absolute',
|
|
179
|
+
width: '100%',
|
|
180
|
+
height: '100%',
|
|
181
|
+
top: '0',
|
|
182
|
+
left: '100%'
|
|
183
|
+
},
|
|
184
|
+
'@dark': {
|
|
185
|
+
color: 'gray8',
|
|
186
|
+
'::after': {
|
|
187
|
+
background: 'black',
|
|
188
|
+
boxShadow: 'black, 0 0px 50px 50px'
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
'@light': {
|
|
192
|
+
color: 'gray3',
|
|
193
|
+
'::after': {
|
|
194
|
+
background: 'gray12',
|
|
195
|
+
boxShadow: 'gray12, 0 0px 50px 50px'
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
|
|
200
|
+
header: HeaderRow,
|
|
201
|
+
|
|
202
|
+
cnt: {
|
|
203
|
+
childExtend: Row,
|
|
204
|
+
$setCollection: (el) => mapSequence(el.state, sortSequence)
|
|
205
|
+
}
|
|
206
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { SectionHeader } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
import preview from './preview'
|
|
6
|
+
import sequence from './sequence'
|
|
7
|
+
import boxModel from './boxModel'
|
|
8
|
+
|
|
9
|
+
export const Spaces = {
|
|
10
|
+
key: 'spaces',
|
|
11
|
+
|
|
12
|
+
state: {
|
|
13
|
+
activePage: 'spaces',
|
|
14
|
+
activeTab: 'preview',
|
|
15
|
+
|
|
16
|
+
title: 'Spacing',
|
|
17
|
+
p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
define: { routes: param => param },
|
|
21
|
+
|
|
22
|
+
routes: {
|
|
23
|
+
preview,
|
|
24
|
+
sequence,
|
|
25
|
+
boxModel
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
on: {
|
|
29
|
+
init: (el, s) => {
|
|
30
|
+
var route = window.location.pathname
|
|
31
|
+
var routes = route.slice(1).split('/')
|
|
32
|
+
s.activeTab = routes[1] || s.activeTab
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
header: {
|
|
37
|
+
extend: SectionHeader
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
preview
|
|
41
|
+
|
|
42
|
+
// page: {
|
|
43
|
+
// content: (el, s) => ({ extend: el.parent.routes[s.activeTab] })
|
|
44
|
+
// }
|
|
45
|
+
}
|
|
@@ -1,45 +1,23 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import
|
|
6
|
-
import sequence from './sequence'
|
|
7
|
-
import boxModel from './boxModel'
|
|
3
|
+
import { TypeSection } from '../Typography/shared'
|
|
4
|
+
import { SpacingScale } from './SpacingScale'
|
|
5
|
+
import { state } from './state'
|
|
8
6
|
|
|
9
7
|
export const Spaces = {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
state: {
|
|
13
|
-
activePage: 'spaces',
|
|
14
|
-
activeTab: 'preview',
|
|
15
|
-
|
|
16
|
-
title: 'Spacing',
|
|
17
|
-
p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
define: { routes: param => param },
|
|
21
|
-
|
|
22
|
-
routes: {
|
|
23
|
-
preview,
|
|
24
|
-
sequence,
|
|
25
|
-
boxModel
|
|
26
|
-
},
|
|
27
|
-
|
|
28
|
-
on: {
|
|
29
|
-
init: (el, s) => {
|
|
30
|
-
var route = window.location.pathname
|
|
31
|
-
var routes = route.slice(1).split('/')
|
|
32
|
-
s.activeTab = routes[1] || s.activeTab
|
|
33
|
-
}
|
|
34
|
-
},
|
|
8
|
+
extend: TypeSection,
|
|
9
|
+
state,
|
|
35
10
|
|
|
36
11
|
header: {
|
|
37
|
-
|
|
12
|
+
state: {
|
|
13
|
+
title: 'Spacing',
|
|
14
|
+
p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
|
|
15
|
+
}
|
|
38
16
|
},
|
|
39
17
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// page: {
|
|
43
|
-
// content: (el, s) => ({ extend: el.parent.routes[s.activeTab] })
|
|
44
|
-
// }
|
|
18
|
+
SpacingScale
|
|
45
19
|
}
|
|
20
|
+
|
|
21
|
+
// preview,
|
|
22
|
+
// sequence,
|
|
23
|
+
// boxModel
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { SPACING } from '@symbo.ls/
|
|
4
|
-
import { TYPOGRAPHY_SEQUENCE } from '../Export/const'
|
|
3
|
+
import { SPACING } from '@symbo.ls/scratch'
|
|
5
4
|
|
|
6
|
-
export
|
|
5
|
+
export const state = {
|
|
7
6
|
tabs: [{
|
|
8
7
|
key: 0,
|
|
9
8
|
name: 'Default'
|
|
@@ -11,8 +10,13 @@ export default {
|
|
|
11
10
|
key: 1,
|
|
12
11
|
name: 'Font Size'
|
|
13
12
|
}],
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
|
|
14
|
+
base: SPACING.base,
|
|
15
|
+
ratio: SPACING.ratio,
|
|
16
|
+
subSequence: true,
|
|
17
|
+
range: [-5, +12],
|
|
18
|
+
scales: {},
|
|
19
|
+
sequence: {},
|
|
20
|
+
vars: {},
|
|
21
|
+
type: 'spacing-scale'
|
|
18
22
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|