@symbo.ls/preview 0.0.86 → 0.0.88
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
CHANGED
package/src/components/Aside.js
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
import { Link, ClickableItem, TooltipParent } from '@symbo.ls/components'
|
|
4
4
|
import { Flex, SquareButton } from 'smbls'
|
|
5
5
|
|
|
6
|
+
const setTooltipPosition = (el, s, options = {}) => {
|
|
7
|
+
const key = parseInt(el.key)
|
|
8
|
+
const rowHeight = `(var(--spacing-C) + var(--spacing-B1) + ${key}%)`
|
|
9
|
+
const translateY = `calc(${rowHeight} * ${key} + var(--spacing-Y2))`
|
|
10
|
+
const transform = `translate3d(0%, ${translateY}, 1px)`
|
|
11
|
+
const Tooltip = el.lookup('Tooltip')
|
|
12
|
+
if (Tooltip.setProps) {
|
|
13
|
+
Tooltip.setProps({
|
|
14
|
+
opacity: options.visible && '1',
|
|
15
|
+
visibility: options.visible && 'visible',
|
|
16
|
+
text: s.title,
|
|
17
|
+
transform
|
|
18
|
+
})
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
6
22
|
export const NavbarButton = {
|
|
7
23
|
extend: [ClickableItem, Link, SquareButton, TooltipParent],
|
|
8
24
|
|
|
@@ -11,16 +27,30 @@ export const NavbarButton = {
|
|
|
11
27
|
active: window.location.pathname.includes(state.href),
|
|
12
28
|
isActive: window.location.pathname.includes(state.href),
|
|
13
29
|
theme: null,
|
|
14
|
-
position: 'relative'
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
30
|
+
position: 'relative'
|
|
31
|
+
}),
|
|
32
|
+
|
|
33
|
+
on: {
|
|
34
|
+
update: (el, s) => {
|
|
35
|
+
const active = window.location.pathname.includes(s.href)
|
|
36
|
+
if (active) setTooltipPosition(el, s)
|
|
37
|
+
},
|
|
38
|
+
mouseover: (ev, el, s) => {
|
|
39
|
+
if (!s.hover) {
|
|
40
|
+
s.hover = true
|
|
41
|
+
setTooltipPosition(el, s, { visible: true })
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
mouseleave: (ev, el, s) => {
|
|
45
|
+
if (s.hover) {
|
|
46
|
+
s.hover = false
|
|
47
|
+
el.lookup('Tooltip').setProps({
|
|
48
|
+
opacity: '0',
|
|
49
|
+
visibility: 'hidden'
|
|
50
|
+
})
|
|
20
51
|
}
|
|
21
52
|
}
|
|
22
|
-
}
|
|
23
|
-
|
|
53
|
+
}
|
|
24
54
|
}
|
|
25
55
|
|
|
26
56
|
export const DesignSystemNavbar = {
|
|
@@ -29,6 +59,7 @@ export const DesignSystemNavbar = {
|
|
|
29
59
|
props: {
|
|
30
60
|
position: 'sticky',
|
|
31
61
|
top: 'E',
|
|
62
|
+
zIndex: 1001,
|
|
32
63
|
|
|
33
64
|
nav: {
|
|
34
65
|
gap: 'B1',
|
|
@@ -44,27 +75,27 @@ export const DesignSystemNavbar = {
|
|
|
44
75
|
childExtend: NavbarButton
|
|
45
76
|
},
|
|
46
77
|
|
|
47
|
-
Tooltip:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
fontSize: 'Z'
|
|
66
|
-
text: state.tooltip
|
|
78
|
+
Tooltip: {
|
|
79
|
+
props: {
|
|
80
|
+
background: 'gray0 .95',
|
|
81
|
+
position: 'absolute',
|
|
82
|
+
pointerEvents: 'none',
|
|
83
|
+
top: '0',
|
|
84
|
+
left: '100%',
|
|
85
|
+
shape: 'rectangle',
|
|
86
|
+
shapeDirection: null,
|
|
87
|
+
padding: 'X2 Z1',
|
|
88
|
+
transform: 'translate3d(5%, -50%, 0)',
|
|
89
|
+
opacity: '0',
|
|
90
|
+
visibility: 'hidden',
|
|
91
|
+
transition: 'C defaultBezier, C defaultBezier, B defaultBezier',
|
|
92
|
+
transitionProperty: 'opacity, visibility, transform',
|
|
93
|
+
textAlign: 'start',
|
|
94
|
+
zIndex: 99999,
|
|
95
|
+
lineHeight: 1,
|
|
96
|
+
title: { fontSize: 'Z' }
|
|
67
97
|
},
|
|
68
|
-
|
|
69
|
-
|
|
98
|
+
title: null,
|
|
99
|
+
p: null
|
|
100
|
+
}
|
|
70
101
|
}
|
|
@@ -73,7 +73,7 @@ export const ChoosableButton = {
|
|
|
73
73
|
})
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
const DotForPropButton = {
|
|
76
|
+
export const DotForPropButton = {
|
|
77
77
|
props: (el) => {
|
|
78
78
|
const { table, row, property: direction } = getStateTree(el)
|
|
79
79
|
const property = direction.parent
|
|
@@ -94,10 +94,10 @@ const DotForPropButton = {
|
|
|
94
94
|
isRadius,
|
|
95
95
|
|
|
96
96
|
'!isRadius': {
|
|
97
|
-
':nth-child(1)': { left: '
|
|
98
|
-
':nth-child(2)': { right: 'W', top: '
|
|
99
|
-
':nth-child(3)': { left: '
|
|
100
|
-
':nth-child(4)': { left: 'W', top: '
|
|
97
|
+
':nth-child(1)': { left: '45%', top: 'W' },
|
|
98
|
+
':nth-child(2)': { right: 'W', top: '45%' },
|
|
99
|
+
':nth-child(3)': { left: '45%', bottom: 'W' },
|
|
100
|
+
':nth-child(4)': { left: 'W', top: '45%' }
|
|
101
101
|
},
|
|
102
102
|
|
|
103
103
|
'.isRadius': {
|
|
@@ -110,6 +110,24 @@ const DotForPropButton = {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
export const DotForRowButton = {
|
|
114
|
+
extend: DotForPropButton,
|
|
115
|
+
props: ({ state }) => {
|
|
116
|
+
const direction = state
|
|
117
|
+
const property = direction.parent
|
|
118
|
+
const row = property.parent
|
|
119
|
+
const table = row.parent
|
|
120
|
+
|
|
121
|
+
const propKey = diffPropValue(property.value, direction.value)
|
|
122
|
+
const active = table.props[propKey] === row.key
|
|
123
|
+
|
|
124
|
+
return {
|
|
125
|
+
hide: !active,
|
|
126
|
+
background: 'blue .65'
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
113
131
|
export const SpacingPropButton = {
|
|
114
132
|
extend: [ChoosableButton, DropdownParent, WiderButton],
|
|
115
133
|
|
|
@@ -119,7 +137,6 @@ export const SpacingPropButton = {
|
|
|
119
137
|
const active = table.props[propValue] === (row && row.key)
|
|
120
138
|
return {
|
|
121
139
|
active,
|
|
122
|
-
lazyLoad: true,
|
|
123
140
|
icon: { name: property.value },
|
|
124
141
|
|
|
125
142
|
'.active': {
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
|
+
Icon,
|
|
4
5
|
Grid,
|
|
5
6
|
Pseudo,
|
|
6
7
|
mapSequence,
|
|
7
8
|
sortSequence
|
|
8
9
|
} from '@symbo.ls/components'
|
|
9
10
|
|
|
10
|
-
import buttons from '../pages/Spaces/buttons'
|
|
11
|
+
import buttons, { setRowButtons } from '../pages/Spaces/buttons'
|
|
12
|
+
import { DotForRowButton, SpacingPropButton } from './SpacingPropButton'
|
|
13
|
+
|
|
14
|
+
const DotsInButton = SpacingPropButton.dots
|
|
11
15
|
|
|
12
16
|
const Cell = {
|
|
13
17
|
tag: 'div',
|
|
@@ -85,10 +89,13 @@ const Row = {
|
|
|
85
89
|
}
|
|
86
90
|
},
|
|
87
91
|
buttons: {
|
|
88
|
-
|
|
92
|
+
columns: 'repeat(7, var(--spacing-B2))',
|
|
93
|
+
rows: 'var(--spacing-B2)',
|
|
94
|
+
position: 'relative',
|
|
89
95
|
gap: '.2em',
|
|
90
96
|
opacity: '1',
|
|
91
|
-
boxSizing: 'content-box'
|
|
97
|
+
boxSizing: 'content-box',
|
|
98
|
+
margin: '0 0 0 -1.9em'
|
|
92
99
|
}
|
|
93
100
|
}),
|
|
94
101
|
|
|
@@ -98,7 +105,75 @@ const Row = {
|
|
|
98
105
|
em: {},
|
|
99
106
|
decimal: {},
|
|
100
107
|
px: {},
|
|
101
|
-
buttons: {
|
|
108
|
+
buttons: {
|
|
109
|
+
extend: Grid,
|
|
110
|
+
|
|
111
|
+
childExtend: {
|
|
112
|
+
props: ({ state }) => {
|
|
113
|
+
const property = state
|
|
114
|
+
const row = property.parent
|
|
115
|
+
const table = row.parent
|
|
116
|
+
|
|
117
|
+
const propKey = property.value
|
|
118
|
+
|
|
119
|
+
const active = Object.keys(table.props).filter(prop => {
|
|
120
|
+
const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
|
|
121
|
+
const keyMathes = table.props[prop] === row.key
|
|
122
|
+
return hasProp && keyMathes
|
|
123
|
+
}).length
|
|
124
|
+
|
|
125
|
+
return {
|
|
126
|
+
active: !!active,
|
|
127
|
+
position: 'relative',
|
|
128
|
+
round: 'Z',
|
|
129
|
+
display: 'flex',
|
|
130
|
+
|
|
131
|
+
icon: {
|
|
132
|
+
name: propKey,
|
|
133
|
+
opacity: '0',
|
|
134
|
+
color: 'gray5',
|
|
135
|
+
margin: 'auto'
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
'.active': {
|
|
139
|
+
boxShadow: '0, 0, 0, 3px, gray1, inset'
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
|
|
144
|
+
icon: {
|
|
145
|
+
extend: Icon,
|
|
146
|
+
props: ({ state }) => {
|
|
147
|
+
const property = state
|
|
148
|
+
const row = property.parent
|
|
149
|
+
const table = row.parent
|
|
150
|
+
|
|
151
|
+
const propKey = property.value
|
|
152
|
+
const middleActive = table.props[propKey] === row.key
|
|
153
|
+
|
|
154
|
+
const active = Object.keys(table.props).filter(prop => {
|
|
155
|
+
const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
|
|
156
|
+
const keyMathes = table.props[prop] === row.key
|
|
157
|
+
return hasProp && keyMathes
|
|
158
|
+
}).length
|
|
159
|
+
|
|
160
|
+
return {
|
|
161
|
+
active,
|
|
162
|
+
middleActive,
|
|
163
|
+
'.active': { opacity: '1' },
|
|
164
|
+
'.middleActive': { color: 'blue' }
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
|
|
169
|
+
dots: {
|
|
170
|
+
childExtend: DotForRowButton,
|
|
171
|
+
$setStateCollection: DotsInButton.$setStateCollection
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
|
|
175
|
+
$setStateCollection: setRowButtons
|
|
176
|
+
},
|
|
102
177
|
graph: { line: {} },
|
|
103
178
|
|
|
104
179
|
overlay: {
|
|
@@ -25,16 +25,16 @@ import {
|
|
|
25
25
|
|
|
26
26
|
const NAV = [{
|
|
27
27
|
state: {
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
title: 'Colors',
|
|
29
|
+
href: '/colors'
|
|
30
30
|
},
|
|
31
31
|
props: {
|
|
32
32
|
icon: { name: 'color outline colored' }
|
|
33
33
|
}
|
|
34
34
|
}, {
|
|
35
35
|
state: {
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
title: 'Typography',
|
|
37
|
+
href: '/typography'
|
|
38
38
|
},
|
|
39
39
|
props: {
|
|
40
40
|
icon: { name: 'typography outline' },
|
|
@@ -42,8 +42,8 @@ const NAV = [{
|
|
|
42
42
|
}
|
|
43
43
|
}, {
|
|
44
44
|
state: {
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
title: 'Spacing',
|
|
46
|
+
href: '/space'
|
|
47
47
|
},
|
|
48
48
|
props: {
|
|
49
49
|
icon: { name: 'space outline' },
|
|
@@ -51,16 +51,16 @@ const NAV = [{
|
|
|
51
51
|
}
|
|
52
52
|
}, {
|
|
53
53
|
state: {
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
title: 'Shapes',
|
|
55
|
+
href: '/shape'
|
|
56
56
|
},
|
|
57
57
|
props: {
|
|
58
58
|
icon: { name: 'shape outline colored' }
|
|
59
59
|
}
|
|
60
60
|
}, {
|
|
61
61
|
state: {
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
title: 'Icons',
|
|
63
|
+
href: '/icons'
|
|
64
64
|
},
|
|
65
65
|
props: {
|
|
66
66
|
icon: { name: 'icons outline colored' },
|
|
@@ -70,8 +70,8 @@ const NAV = [{
|
|
|
70
70
|
}
|
|
71
71
|
}, {
|
|
72
72
|
state: {
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
title: 'Responsive',
|
|
74
|
+
href: '/media-query'
|
|
75
75
|
},
|
|
76
76
|
props: {
|
|
77
77
|
icon: { name: 'device mobile half fill' },
|
|
@@ -79,8 +79,8 @@ const NAV = [{
|
|
|
79
79
|
}
|
|
80
80
|
}, {
|
|
81
81
|
state: {
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
title: 'Fonts',
|
|
83
|
+
href: '/fonts'
|
|
84
84
|
},
|
|
85
85
|
props: {
|
|
86
86
|
icon: { name: 'fontFace colored' },
|
|
@@ -88,16 +88,16 @@ const NAV = [{
|
|
|
88
88
|
}
|
|
89
89
|
}, {
|
|
90
90
|
state: {
|
|
91
|
-
|
|
92
|
-
|
|
91
|
+
title: 'Timing',
|
|
92
|
+
href: '/timing'
|
|
93
93
|
},
|
|
94
94
|
props: {
|
|
95
95
|
icon: { name: 'clock colored' }
|
|
96
96
|
}
|
|
97
97
|
}, {
|
|
98
98
|
state: {
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
title: 'Sequence',
|
|
100
|
+
href: '/sequence'
|
|
101
101
|
},
|
|
102
102
|
props: {
|
|
103
103
|
icon: { name: 'sequence colored' }
|
|
@@ -3,6 +3,19 @@
|
|
|
3
3
|
import { Flex } from '@symbo.ls/components'
|
|
4
4
|
import { SpacingPropButton, SPACING_BUTTONS } from '../../components'
|
|
5
5
|
|
|
6
|
+
export const setTableButtons = ({ state }) =>
|
|
7
|
+
Object.keys(SPACING_BUTTONS).filter(v => {
|
|
8
|
+
const rowState = state.sequence[state.selectedKey]
|
|
9
|
+
const { maxValue } = SPACING_BUTTONS[v]
|
|
10
|
+
return maxValue ? maxValue > (rowState && rowState.val) : true
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
export const setRowButtons = ({ state }) =>
|
|
14
|
+
Object.keys(SPACING_BUTTONS).filter(v => {
|
|
15
|
+
const { maxValue } = SPACING_BUTTONS[v]
|
|
16
|
+
return maxValue ? maxValue > state.val : true
|
|
17
|
+
})
|
|
18
|
+
|
|
6
19
|
export default {
|
|
7
20
|
extend: Flex,
|
|
8
21
|
|
|
@@ -11,11 +24,10 @@ export default {
|
|
|
11
24
|
left: 'G3',
|
|
12
25
|
gap: 'X',
|
|
13
26
|
top: 'Y',
|
|
14
|
-
lazyLoad: true,
|
|
15
27
|
height: 'B2',
|
|
16
28
|
zIndex: 99,
|
|
17
29
|
boxSizing: 'content-box',
|
|
18
|
-
padding: '- -
|
|
30
|
+
padding: '- - E',
|
|
19
31
|
transition: 'C ease-out',
|
|
20
32
|
transitionProperty: 'transform, opacity',
|
|
21
33
|
opacity: '0',
|
|
@@ -25,11 +37,5 @@ export default {
|
|
|
25
37
|
|
|
26
38
|
childExtend: SpacingPropButton,
|
|
27
39
|
|
|
28
|
-
$setStateCollection:
|
|
29
|
-
Object.keys(SPACING_BUTTONS).filter(v => {
|
|
30
|
-
const rowState = state.sequence[state.selectedKey]
|
|
31
|
-
const { maxValue } = SPACING_BUTTONS[v]
|
|
32
|
-
return maxValue ? maxValue > rowState && rowState.val : true
|
|
33
|
-
}
|
|
34
|
-
)
|
|
40
|
+
$setStateCollection: setTableButtons
|
|
35
41
|
}
|