@symbo.ls/preview 0.0.39 → 0.0.40

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.
@@ -1,49 +0,0 @@
1
- 'use strict'
2
-
3
- export const styleLabel = {
4
- caption: { whiteSpace: 'nowrap', opacity: 0.65 },
5
- span: {
6
- display: 'block',
7
- whiteSpace: 'nowrap',
8
- minWidth: `1.618em`,
9
- maxWidth: 'fit-content',
10
- borderBottom: '1px dashed rgba(255, 255, 255, .35)',
11
- outline: 'none'
12
- }
13
- }
14
-
15
- export const styleTool = {
16
- caption: { opacity: '.65' },
17
- '> div span': { opacity: '.5' },
18
- '> div > div': { gap: '1px' }
19
- }
20
- export const styleColorTones = {
21
- width: '22em',
22
- display: 'flex',
23
- flexDirection: 'column',
24
- '> div > button': {
25
- padding: `${123 / 16}em`,
26
- position: 'absolute'
27
- },
28
- caption: {
29
- textTransform: 'capitalize',
30
- opacity: '.65',
31
- marginBottom: `${10 / 13}em`
32
- }
33
- }
34
-
35
- export default {
36
- display: 'flex',
37
- flexFlow: 'column',
38
- 'header > nav a:hover': {
39
- background: 'rgba(255, 255, 255, .08)',
40
- opacity: 1,
41
- color: '#EDCB38'
42
- },
43
-
44
- '> section': {
45
- display: 'flex',
46
- gap: '6.6em',
47
- border: '2px solid red'
48
- }
49
- }
@@ -1,107 +0,0 @@
1
- 'use strict'
2
-
3
- import { Grid, ColorSwitcher, CommonField, SelectField, ButtonSet, ClickableItem } from '@symbo.ls/components'
4
-
5
-
6
- ColorSwitcher.props = (el, s) => {
7
- if (!s.value) return
8
- const value = s.value[el.props.type] || s.value[el.props.type + 'Color']
9
- const key = filterByValue(value).key || value
10
- return {
11
- key: key,
12
- value: value
13
- }
14
- }
15
-
16
- export const themingTools = {
17
- extend: Grid,
18
- style: {
19
- width: 'fit-content'
20
- },
21
- props: {
22
- columns: 'repeat(4, 1fr)',
23
- columnGap: 'C',
24
- rowGap: 'C'
25
- },
26
- childExtend: {
27
- extend: CommonField,
28
- props: { padding: 0 },
29
- caption: { text: el => el.parent.props.caption },
30
- element: {}
31
- },
32
- ...[{
33
- props: { caption: 'Background color' },
34
- caption: {},
35
- element: {
36
- extend: ColorSwitcher,
37
- props: { type: 'background' },
38
-
39
- title: {},
40
- buttons: { ...[
41
- { props: { icon: 'plus' } },
42
- { props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
43
- ] }
44
- }
45
- }, {
46
- props: { caption: 'Text color' },
47
- caption: {},
48
- element: {
49
- extend: ColorSwitcher,
50
- props: { type: 'color' },
51
-
52
- title: {},
53
- buttons: { ...[
54
- { props: { icon: 'colorInvert' } },
55
- { props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
56
- ] }
57
- }
58
- }, {
59
- props: { caption: 'Border color' },
60
- caption: {},
61
- element: {
62
- extend: ColorSwitcher,
63
- props: { type: 'border' },
64
-
65
- title: {},
66
- buttons: { ...[
67
- { props: { icon: 'colorInvert' } },
68
- { props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
69
- ] }
70
- }
71
- }, {
72
- props: { caption: 'Use as' },
73
- caption: {},
74
- element: {
75
- extend: SelectField,
76
- title: { props: { text: 'Background color' } },
77
- buttons: { ...[{ props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }] }
78
- }
79
- },
80
-
81
- {
82
- props: { caption: 'Border' },
83
- caption: {},
84
- element: {
85
- extend: ButtonSet,
86
- childExtend: { extend: [ClickableItem] },
87
- props: { gap: 'Z' },
88
- ...[
89
- { props: { icon: 'colorsColored' } },
90
- { props: { icon: 'borderOpacity' } },
91
- { props: { icon: 'borderWeight' } },
92
- { props: { icon: 'borderProps' } }
93
- ]
94
- }
95
- },
96
-
97
- {
98
- props: { caption: 'Shadow' },
99
- caption: {},
100
- element: {
101
- extend: ButtonSet,
102
- childExtend: { extend: [ClickableItem] },
103
- ...[{ props: { icon: 'plus' } }]
104
- }
105
- }
106
- ]
107
- }
@@ -1,163 +0,0 @@
1
- 'use strict'
2
-
3
- import { Block, Text, opacify, Shape, Grid, Overflow } from '@symbo.ls/components'
4
-
5
- const classOpacify = (el, opacity) => {
6
- if (!el.state.value) return
7
- const { background, backgroundColor, color } = el.state.value
8
- const bg = background || backgroundColor || color
9
- if (!bg) return
10
- return { background: opacify(bg, opacity) }
11
- }
12
-
13
- const TONES_AMOUNT = 13
14
- const TONES_ARR = new Array(TONES_AMOUNT).fill(0).map((_, i) => i)
15
-
16
- export const Tones = {
17
- extend: [Shape, Block, Grid, Overflow],
18
- props: {
19
- columns: `repeat(${TONES_AMOUNT}, 1fr)`,
20
- height: 'B',
21
- round: 'Z'
22
- },
23
- childExtend: {
24
- tag: 'span',
25
- extend: Shape,
26
- props: { round: 0 },
27
- class: {
28
- transition: {
29
- transition: '165ms cubic-bezier(.29,.67,.51,.97)',
30
- transitionProperty: 'color, background'
31
- }
32
- }
33
- },
34
- ...TONES_ARR.map(v => ({
35
- class: { background: el => classOpacify(el, (100 / TONES_AMOUNT * v) / 100) }
36
- }))
37
- }
38
-
39
- export const colorTones = {
40
- tag: 'aside',
41
- // extend: Block,
42
- // style: styleColorTones,
43
- props: { flexFlow: 'column' },
44
- span: {
45
- extend: [Text, Block],
46
- props: {
47
- text: 'Preview',
48
- size: 'Z'
49
- },
50
- style: {
51
- display: 'block',
52
- marginBottom: '8px',
53
- opacity: '.65'
54
- }
55
- },
56
-
57
- preview: {
58
- extend: [Shape, Block],
59
- style: {
60
- background: 'rgba(255, 255, 255, .06)',
61
- '&, & *': { transition: '165ms cubic-bezier(.29,.67,.51,.97)', transitionProperty: 'color, background' }
62
- },
63
- props: (el, s) => ({
64
- padding: 'X1',
65
- round: 'Z2',
66
- theme: `${s.sceneTheme || 'dark'}Scene`
67
- }),
68
- scene: {
69
- extend: [Block],
70
- props: { padding: 'A' },
71
- style: {
72
- boxSizing: 'border-box',
73
- backgroundPosition: `center`,
74
- backgroundRepeat: `repeat`,
75
- backgroundSize: '100px 100px'
76
- },
77
- circle: {
78
- extend: [Block, Shape],
79
- props: (el, s) => ({
80
- theme: s.value,
81
- flexFlow: 'column',
82
- flexAlign: 'center center',
83
- width: 'G',
84
- aspectRatio: '1 / 1',
85
- round: '100%'
86
- }),
87
- style: { position: 'relative', borderWidth: '1px', borderStyle: 'solid' },
88
- h6: {
89
- extend: Text,
90
- style: { fontSize: `${26 / 16}em`, fontWeight: 'Bold' },
91
- span: {
92
- text: 'The',
93
- style: {
94
- fontWeight: 'normal',
95
- marginRight: '6px'
96
- }
97
- },
98
- text: 'Text Color'
99
- },
100
- span: {
101
- extend: Text,
102
- props: { text: (el, s) => s.value },
103
- style: {
104
- position: 'absolute',
105
- top: '86%',
106
- left: '50%',
107
- transform: 'translate(-50%, -50%)',
108
- fontWeight: '600'
109
- }
110
- }
111
- }
112
- }
113
- },
114
-
115
- opacity: {
116
- extend: Block,
117
- props: {
118
- padding: 'B1 0 0 0'
119
- },
120
- caption: {
121
- extend: [Text, Block],
122
- props: {
123
- text: 'Opacity',
124
- size: 'Z',
125
- padding: '0 0 Z1 0'
126
- },
127
- style: { opacity: '.65' }
128
- },
129
- tones: { extend: Tones }
130
- },
131
-
132
- shades: {
133
- extend: [Block],
134
- props: { padding: 'B 0 0 0' },
135
- caption: {
136
- extend: [Text, Block],
137
- props: {
138
- text: 'Shades',
139
- size: 'Z',
140
- padding: '0 0 Z1 0'
141
- },
142
- style: { opacity: '.65' }
143
- },
144
-
145
- generate: {
146
- extend: [Block, Shape, Overflow],
147
- props: { flexFlow: 'column', round: 'Z', gap: '2px' },
148
-
149
- childExtend: {
150
- extend: [Tones],
151
- props: { round: 'X' },
152
- ...TONES_ARR.map(v => ({
153
- class: { background: el => classOpacify(el, (100 / TONES_AMOUNT * v) / 100) }
154
- }))
155
- },
156
-
157
- dark: {},
158
- light: {
159
- props: { theme: 'lightScene' }
160
- }
161
- }
162
- }
163
- }