@symbo.ls/preview 0.0.86 → 0.0.87
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 +1 -1
- package/src/components/Aside.js +53 -31
- package/src/pages/DesignSystem/index.js +18 -18
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-X))`
|
|
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,22 @@ 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
|
-
'&:hover, &:focus-visible': {
|
|
17
|
-
'& [tooltip]': {
|
|
18
|
-
transform: 'translate3d(0%,-50%,0)'
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
})
|
|
30
|
+
position: 'relative'
|
|
31
|
+
}),
|
|
23
32
|
|
|
33
|
+
on: {
|
|
34
|
+
initUpdate: (el, s) => {
|
|
35
|
+
const active = window.location.pathname.includes(s.href)
|
|
36
|
+
if (active) setTooltipPosition(el, s)
|
|
37
|
+
},
|
|
38
|
+
mouseover: (ev, el, s) => setTooltipPosition(el, s, { visible: true }),
|
|
39
|
+
mouseleave: (ev, el, s) => {
|
|
40
|
+
el.lookup('Tooltip').setProps({
|
|
41
|
+
opacity: '0',
|
|
42
|
+
visibility: 'hidden'
|
|
43
|
+
})
|
|
44
|
+
}
|
|
45
|
+
}
|
|
24
46
|
}
|
|
25
47
|
|
|
26
48
|
export const DesignSystemNavbar = {
|
|
@@ -29,6 +51,7 @@ export const DesignSystemNavbar = {
|
|
|
29
51
|
props: {
|
|
30
52
|
position: 'sticky',
|
|
31
53
|
top: 'E',
|
|
54
|
+
zIndex: 1001,
|
|
32
55
|
|
|
33
56
|
nav: {
|
|
34
57
|
gap: 'B1',
|
|
@@ -44,27 +67,26 @@ export const DesignSystemNavbar = {
|
|
|
44
67
|
childExtend: NavbarButton
|
|
45
68
|
},
|
|
46
69
|
|
|
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
|
|
70
|
+
Tooltip: {
|
|
71
|
+
props: {
|
|
72
|
+
background: 'gray0 .95',
|
|
73
|
+
position: 'absolute',
|
|
74
|
+
pointerEvents: 'none',
|
|
75
|
+
top: '0',
|
|
76
|
+
left: '100%',
|
|
77
|
+
shape: 'rectangle',
|
|
78
|
+
shapeDirection: null,
|
|
79
|
+
padding: 'X2 Z1',
|
|
80
|
+
transform: 'translate3d(5%, -50%, 0)',
|
|
81
|
+
opacity: '0',
|
|
82
|
+
visibility: 'hidden',
|
|
83
|
+
transition: 'C defaultBezier, C defaultBezier, B defaultBezier',
|
|
84
|
+
transitionProperty: 'opacity, visibility, transform',
|
|
85
|
+
textAlign: 'start',
|
|
86
|
+
zIndex: 99999,
|
|
87
|
+
lineHeight: 1,
|
|
88
|
+
title: { fontSize: 'Z' }
|
|
67
89
|
},
|
|
68
|
-
p:
|
|
69
|
-
}
|
|
90
|
+
p: null
|
|
91
|
+
}
|
|
70
92
|
}
|
|
@@ -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' }
|