@symbo.ls/preview 0.0.14 → 0.0.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/.symbols/button-pro/index.js +4 -9
- package/.symbols/button-pro/style.js +0 -15
- package/.symbols/button-theme-switcher/index.js +12 -9
- package/package.json +1 -1
- package/src/pages/DesignSystem/index.js +8 -7
- package/src/pages/Icons/index.js +52 -13
- package/src/pages/Typography/rangeButtons.js +59 -0
- package/src/pages/Typography/typeScale.js +73 -66
- package/svgSprite.config.js +2 -1
|
@@ -20,6 +20,7 @@ const component = {
|
|
|
20
20
|
padding: ['X1', 'X1', 'X1', 'A'],
|
|
21
21
|
size: 'A',
|
|
22
22
|
gap: 'Z',
|
|
23
|
+
fontWeight: 'bold',
|
|
23
24
|
|
|
24
25
|
iconText: {
|
|
25
26
|
gap: 'X1',
|
|
@@ -28,7 +29,7 @@ const component = {
|
|
|
28
29
|
alignItems: 'center'
|
|
29
30
|
},
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
child: {
|
|
32
33
|
round: 12,
|
|
33
34
|
theme: ['lightDark', 'inverse'],
|
|
34
35
|
size: 'Z',
|
|
@@ -37,14 +38,8 @@ const component = {
|
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
40
|
|
|
40
|
-
iconText: {
|
|
41
|
-
|
|
42
|
-
props: el => el.parent.props.iconText
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
child: {
|
|
46
|
-
props: el => el.parent.props.label
|
|
47
|
-
}
|
|
41
|
+
iconText: {},
|
|
42
|
+
child: {}
|
|
48
43
|
}
|
|
49
44
|
|
|
50
45
|
const code = `{
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
|
-
color: '#241C39',
|
|
5
|
-
fontWeight: 'bold',
|
|
6
|
-
|
|
7
|
-
'> svg': {
|
|
8
|
-
borderRadius: '100%',
|
|
9
|
-
padding: '.2em',
|
|
10
|
-
background: '#241C39',
|
|
11
|
-
color: 'white',
|
|
12
|
-
marginRight: `${6 / 16}em`
|
|
13
|
-
},
|
|
14
|
-
|
|
15
|
-
span: {
|
|
16
|
-
alignItems: 'center',
|
|
17
|
-
marginLeft: '8px'
|
|
18
|
-
}
|
|
19
4
|
}
|
|
@@ -4,6 +4,7 @@ import { CATEGORIES } from '../categories'
|
|
|
4
4
|
|
|
5
5
|
import style from './style'
|
|
6
6
|
import { KangorooButton } from '@symbo.ls/components'
|
|
7
|
+
import { isObject } from 'domql/src/utils'
|
|
7
8
|
|
|
8
9
|
const key = 'button-theme-switcher'
|
|
9
10
|
const title = 'Theme Switcher'
|
|
@@ -27,7 +28,7 @@ const component = {
|
|
|
27
28
|
text: 'Light Mode'
|
|
28
29
|
},
|
|
29
30
|
|
|
30
|
-
|
|
31
|
+
child: {
|
|
31
32
|
theme: ['lightDark', 'inverse'],
|
|
32
33
|
round: 'C',
|
|
33
34
|
icon: 'moon',
|
|
@@ -36,16 +37,18 @@ const component = {
|
|
|
36
37
|
}
|
|
37
38
|
},
|
|
38
39
|
|
|
39
|
-
iconText: {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
iconText: {},
|
|
41
|
+
child: {}
|
|
42
|
+
}
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
function strfy (obj) {
|
|
45
|
+
return Object.entries(obj).reduce((str, [p, val]) => {
|
|
46
|
+
return `${str}${p}::${isObject(val) ? strfy(val) : val}\n`;
|
|
47
|
+
}, '');
|
|
46
48
|
}
|
|
47
49
|
|
|
48
|
-
const code =
|
|
50
|
+
const code = strfy(component)
|
|
51
|
+
const code2 = `{
|
|
49
52
|
extend: KangorooButton,
|
|
50
53
|
props: {
|
|
51
54
|
round: 'C',
|
|
@@ -77,7 +80,7 @@ const props = {
|
|
|
77
80
|
text: 'Light Mode'
|
|
78
81
|
},
|
|
79
82
|
|
|
80
|
-
|
|
83
|
+
child: {
|
|
81
84
|
theme: ['lightDark', 'inverse'],
|
|
82
85
|
round: 'C',
|
|
83
86
|
icon: 'moon',
|
package/package.json
CHANGED
|
@@ -13,19 +13,20 @@ import { PageExtend,
|
|
|
13
13
|
|
|
14
14
|
const NAV = [{
|
|
15
15
|
props: {
|
|
16
|
-
icon: '
|
|
17
|
-
href: '/
|
|
16
|
+
icon: 'color outline colored',
|
|
17
|
+
href: '/colors'
|
|
18
18
|
}
|
|
19
19
|
}, {
|
|
20
20
|
props: {
|
|
21
|
-
icon: '
|
|
22
|
-
href: '/
|
|
21
|
+
icon: 'typography outline',
|
|
22
|
+
href: '/typography',
|
|
23
|
+
opacity: '.7'
|
|
23
24
|
}
|
|
24
25
|
}, {
|
|
25
26
|
props: {
|
|
26
27
|
icon: 'space outline',
|
|
27
28
|
href: '/space',
|
|
28
|
-
opacity: '.
|
|
29
|
+
opacity: '.7'
|
|
29
30
|
}
|
|
30
31
|
}, {
|
|
31
32
|
props: {
|
|
@@ -42,14 +43,14 @@ const NAV = [{
|
|
|
42
43
|
}
|
|
43
44
|
}, {
|
|
44
45
|
props: {
|
|
45
|
-
icon: '
|
|
46
|
+
icon: 'fontFace colored',
|
|
46
47
|
href: '/fonts'
|
|
47
48
|
}
|
|
48
49
|
}, {
|
|
49
50
|
props: {
|
|
50
51
|
icon: 'device mobile half fill',
|
|
51
52
|
href: '/responsive',
|
|
52
|
-
opacity: '.
|
|
53
|
+
opacity: '.7'
|
|
53
54
|
}
|
|
54
55
|
}, {
|
|
55
56
|
props: {
|
package/src/pages/Icons/index.js
CHANGED
|
@@ -2,16 +2,27 @@
|
|
|
2
2
|
|
|
3
3
|
import { copyStringToClipboard } from '@symbo.ls/utils'
|
|
4
4
|
|
|
5
|
-
import
|
|
6
|
-
|
|
5
|
+
import { IconText, Flex, Link, ClickableItem, SectionHeader, Grid } from '@symbo.ls/components'
|
|
6
|
+
|
|
7
|
+
import * as ACCESSIBILITY from '@symbo.ls/icons/src/accessibility'
|
|
8
|
+
import * as BOXSIZE from '@symbo.ls/icons/src/boxSize'
|
|
9
|
+
import * as DISPLAY from '@symbo.ls/icons/src/display'
|
|
10
|
+
import * as INTERACTIVE from '@symbo.ls/icons/src/interactive'
|
|
11
|
+
import * as LOGOS from '@symbo.ls/icons/src/logos'
|
|
12
|
+
import * as SIGNS from '@symbo.ls/icons/src/signs'
|
|
13
|
+
import * as STYLE from '@symbo.ls/icons/src/style'
|
|
14
|
+
import * as SVG from '@symbo.ls/icons/src/svg'
|
|
15
|
+
import * as TECH from '@symbo.ls/icons/src/tech'
|
|
16
|
+
import * as TEXT from '@symbo.ls/icons/src/text'
|
|
7
17
|
|
|
8
18
|
const IconItem = {
|
|
9
|
-
extend: [ClickableItem, IconText],
|
|
19
|
+
extend: [ClickableItem, Link, IconText],
|
|
10
20
|
props: ({ state }) => ({
|
|
11
21
|
round: 'A',
|
|
12
22
|
size: 'D',
|
|
13
23
|
aspectRatio: '1 / 1',
|
|
14
24
|
flexAlign: 'center center',
|
|
25
|
+
href: '/icons/edit-icon/' + state.name,
|
|
15
26
|
icon: {
|
|
16
27
|
fontSize: 'C2',
|
|
17
28
|
name: state.name
|
|
@@ -25,17 +36,12 @@ const IconItem = {
|
|
|
25
36
|
}
|
|
26
37
|
|
|
27
38
|
const IconsGroup = {
|
|
28
|
-
state: {
|
|
29
|
-
toggleShow: true
|
|
30
|
-
},
|
|
39
|
+
state: { toggleShow: true },
|
|
31
40
|
|
|
32
|
-
header: {
|
|
33
|
-
extend: SectionHeader
|
|
34
|
-
},
|
|
41
|
+
header: { extend: SectionHeader },
|
|
35
42
|
|
|
36
43
|
iconSet: {
|
|
37
44
|
extend: Grid,
|
|
38
|
-
|
|
39
45
|
props: ({ state }) => ({
|
|
40
46
|
hide: !state.toggleShow,
|
|
41
47
|
columns: 'repeat(12, 1fr)',
|
|
@@ -57,15 +63,48 @@ const ICON_GROUPS = [{
|
|
|
57
63
|
p: 'All ungrouped document icons',
|
|
58
64
|
|
|
59
65
|
nav: [{
|
|
60
|
-
icon: '
|
|
61
|
-
href: '/icons/
|
|
66
|
+
icon: 'plus',
|
|
67
|
+
href: '/icons/add-icon'
|
|
62
68
|
}],
|
|
63
69
|
|
|
64
|
-
list: Object.keys(
|
|
70
|
+
list: Object.keys(SVG).map(name => ({ name }))
|
|
71
|
+
}, {
|
|
72
|
+
title: 'Accessibility',
|
|
73
|
+
list: Object.keys(ACCESSIBILITY).map(name => ({ name }))
|
|
74
|
+
}, {
|
|
75
|
+
title: 'Boxsize',
|
|
76
|
+
list: Object.keys(BOXSIZE).map(name => ({ name }))
|
|
77
|
+
}, {
|
|
78
|
+
title: 'Display',
|
|
79
|
+
list: Object.keys(DISPLAY).map(name => ({ name }))
|
|
80
|
+
}, {
|
|
81
|
+
title: 'Interactive',
|
|
82
|
+
list: Object.keys(INTERACTIVE).map(name => ({ name }))
|
|
83
|
+
}, {
|
|
84
|
+
title: 'Logos',
|
|
85
|
+
list: Object.keys(LOGOS).map(name => ({ name }))
|
|
86
|
+
}, {
|
|
87
|
+
title: 'Signs',
|
|
88
|
+
list: Object.keys(SIGNS).map(name => ({ name }))
|
|
89
|
+
}, {
|
|
90
|
+
title: 'Style',
|
|
91
|
+
list: Object.keys(STYLE).map(name => ({ name }))
|
|
92
|
+
}, {
|
|
93
|
+
title: 'Tech',
|
|
94
|
+
list: Object.keys(TECH).map(name => ({ name }))
|
|
95
|
+
}, {
|
|
96
|
+
title: 'Text',
|
|
97
|
+
list: Object.keys(TEXT).map(name => ({ name }))
|
|
65
98
|
}]
|
|
66
99
|
|
|
67
100
|
export const Icons = {
|
|
68
101
|
tag: 'section',
|
|
102
|
+
extend: Flex,
|
|
103
|
+
|
|
104
|
+
props: {
|
|
105
|
+
flow: 'column',
|
|
106
|
+
gap: 'D1'
|
|
107
|
+
},
|
|
69
108
|
|
|
70
109
|
childExtend: IconsGroup,
|
|
71
110
|
$setCollection: () => ICON_GROUPS
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
|
|
3
|
+
import { IncDecButtons } from '@symbo.ls/components'
|
|
4
|
+
|
|
5
|
+
export const Range0Buttons = {
|
|
6
|
+
extend: IncDecButtons,
|
|
7
|
+
|
|
8
|
+
...[{
|
|
9
|
+
on: {
|
|
10
|
+
click: (ev, el) => {
|
|
11
|
+
const { state } = el
|
|
12
|
+
const { range } = state
|
|
13
|
+
if (range[0] + 1 < 0) {
|
|
14
|
+
++range[0]
|
|
15
|
+
state.update()
|
|
16
|
+
}
|
|
17
|
+
console.log(range)
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}, {
|
|
21
|
+
on: {
|
|
22
|
+
click: (ev, el) => {
|
|
23
|
+
const { state } = el
|
|
24
|
+
const { range } = state
|
|
25
|
+
if (range[0] - 1 > -6) {
|
|
26
|
+
--range[0]
|
|
27
|
+
state.update()
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}]
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const Range1Buttons = {
|
|
35
|
+
extend: IncDecButtons,
|
|
36
|
+
...[{
|
|
37
|
+
on: {
|
|
38
|
+
click: (ev, el) => {
|
|
39
|
+
const { state } = el
|
|
40
|
+
const { range } = state
|
|
41
|
+
if (range[1] - 1 > 5) {
|
|
42
|
+
--range[1]
|
|
43
|
+
state.update()
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
on: {
|
|
49
|
+
click: (ev, el) => {
|
|
50
|
+
const { state } = el
|
|
51
|
+
const { range } = state
|
|
52
|
+
if (range[1] + 1 < 21) {
|
|
53
|
+
++range[1]
|
|
54
|
+
state.update()
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}]
|
|
59
|
+
}
|
|
@@ -2,11 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
TypeScaleSequence,
|
|
5
|
-
SequenceSliders
|
|
5
|
+
SequenceSliders,
|
|
6
|
+
Grid,
|
|
7
|
+
Flex,
|
|
8
|
+
TestText
|
|
6
9
|
} from '@symbo.ls/components'
|
|
10
|
+
|
|
7
11
|
import { mapSequence, sortSequence } from '@symbo.ls/utils'
|
|
8
12
|
|
|
9
13
|
import { TypeSection } from './shared'
|
|
14
|
+
import { Range0Buttons, Range1Buttons } from './rangeButtons'
|
|
10
15
|
|
|
11
16
|
export const TypeScale = {
|
|
12
17
|
extend: TypeSection,
|
|
@@ -18,73 +23,75 @@ export const TypeScale = {
|
|
|
18
23
|
}
|
|
19
24
|
},
|
|
20
25
|
|
|
21
|
-
|
|
26
|
+
grid: {
|
|
27
|
+
extend: Grid,
|
|
22
28
|
|
|
23
|
-
p: {
|
|
24
|
-
extend: 'Paragraph',
|
|
25
29
|
props: {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
30
|
+
gap: 'D',
|
|
31
|
+
columns: '16em auto',
|
|
32
|
+
align: 'flex-start flex-start',
|
|
33
|
+
|
|
34
|
+
sidebar: {
|
|
35
|
+
padding: 'B 0 0',
|
|
36
|
+
position: 'sticky',
|
|
37
|
+
top: 'E2'
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
content: {
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
flow: 'column',
|
|
43
|
+
gap: 'C',
|
|
44
|
+
|
|
45
|
+
header: {
|
|
46
|
+
align: 'flex-end space-between',
|
|
47
|
+
padding: '0 0 0 C',
|
|
48
|
+
gap: 'C1'
|
|
49
|
+
},
|
|
50
|
+
|
|
51
|
+
footer: {
|
|
52
|
+
padding: '0 0 0 C'
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
sidebar: {
|
|
58
|
+
sliders: {
|
|
59
|
+
extend: SequenceSliders,
|
|
60
|
+
props: { flow: 'column' }
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
p: {
|
|
64
|
+
extend: 'Paragraph',
|
|
65
|
+
props: {
|
|
66
|
+
margin: '0',
|
|
67
|
+
fontSize: 'Z2',
|
|
68
|
+
padding: 'B2 0',
|
|
69
|
+
text: `Base size and ratio sequentially generate set by multiplying each next calculated unit by the ratio.`
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
|
|
74
|
+
content: {
|
|
75
|
+
extend: Flex,
|
|
76
|
+
|
|
77
|
+
header: {
|
|
78
|
+
extend: Flex,
|
|
79
|
+
Range0Buttons,
|
|
80
|
+
TestText
|
|
81
|
+
},
|
|
82
|
+
|
|
83
|
+
sequence: {
|
|
84
|
+
extend: TypeScaleSequence,
|
|
85
|
+
$setCollection: (el) => {
|
|
86
|
+
const { state } = el
|
|
87
|
+
el.removeContent()
|
|
88
|
+
return mapSequence(state, sortSequence)
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
|
|
92
|
+
footer: {
|
|
93
|
+
Range1Buttons
|
|
94
|
+
}
|
|
29
95
|
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
sequence: {
|
|
33
|
-
extend: TypeScaleSequence,
|
|
34
|
-
$setCollection: ({ state }) => mapSequence(state, sortSequence)
|
|
35
96
|
}
|
|
36
97
|
}
|
|
37
|
-
|
|
38
|
-
// export default {
|
|
39
|
-
// extend: TypeSection,
|
|
40
|
-
|
|
41
|
-
// header: {
|
|
42
|
-
// heading: {
|
|
43
|
-
// p: { props: { text: 'Generate text sequence by a base size and ratio' } }
|
|
44
|
-
// },
|
|
45
|
-
// nav: {
|
|
46
|
-
// add: { props: { icon: 'plus' } }
|
|
47
|
-
// }
|
|
48
|
-
// },
|
|
49
|
-
|
|
50
|
-
// wrapper: {
|
|
51
|
-
// textTest: '',
|
|
52
|
-
// fonts: '',
|
|
53
|
-
|
|
54
|
-
// cnt: {
|
|
55
|
-
// extend: [Block, Grid],
|
|
56
|
-
|
|
57
|
-
// props: {
|
|
58
|
-
// gap: 'D',
|
|
59
|
-
// columns: '16em auto'
|
|
60
|
-
// },
|
|
61
|
-
|
|
62
|
-
// aside: ScalingTools,
|
|
63
|
-
|
|
64
|
-
// wrapper: {
|
|
65
|
-
// settings: {
|
|
66
|
-
// extend: PreviewSettings,
|
|
67
|
-
// props: { margin: '0 0 B' }
|
|
68
|
-
// },
|
|
69
|
-
|
|
70
|
-
// fonts: ScalesSequence
|
|
71
|
-
// },
|
|
72
|
-
|
|
73
|
-
// sequenceSet: {
|
|
74
|
-
// extend: CommonField,
|
|
75
|
-
// props: { margin: 'C2 0' },
|
|
76
|
-
// caption: {
|
|
77
|
-
// extend: [Block, Text],
|
|
78
|
-
// props: {
|
|
79
|
-
// text: 'Sizing generated by this setting',
|
|
80
|
-
// padding: '0 0 A 0'
|
|
81
|
-
// }
|
|
82
|
-
// },
|
|
83
|
-
// element: {
|
|
84
|
-
// extend: [SequenceGraph, Block, Text],
|
|
85
|
-
// style: { '> span': { display: 'none' } }
|
|
86
|
-
// }
|
|
87
|
-
// }
|
|
88
|
-
// }
|
|
89
|
-
// }
|
|
90
|
-
// }
|