@symbo.ls/preview 2.7.21 → 2.7.23

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.
Files changed (149) hide show
  1. package/.eslintrc.js +2 -8
  2. package/.vscode/settings.json +4 -1
  3. package/README.md +1 -0
  4. package/config.js +6 -0
  5. package/define.js +10 -0
  6. package/index.html +5 -5
  7. package/index.js +6 -9
  8. package/package.json +9 -28
  9. package/src/app.js +26 -40
  10. package/state.js +14 -0
  11. package/svgSprite.config.js +2 -2
  12. package/.babelrc.js +0 -5
  13. package/.coveralls.yml +0 -1
  14. package/.eslintignore +0 -1
  15. package/.legacy/_tools_old.js +0 -49
  16. package/.legacy/boxModel.js +0 -3
  17. package/.legacy/index copy.js +0 -45
  18. package/.legacy/preview.js +0 -133
  19. package/.legacy/sequence.js +0 -3
  20. package/.legacy/style.js +0 -30
  21. package/.prettierrc +0 -4
  22. package/.vscode/extensions.json +0 -5
  23. package/src/assets/dark.png +0 -0
  24. package/src/assets/fonts/FiraGO/FiraGO-Bold.woff2 +0 -0
  25. package/src/assets/fonts/FiraGO/FiraGO-Light.woff2 +0 -0
  26. package/src/assets/fonts/FiraGO/FiraGO-Medium.woff2 +0 -0
  27. package/src/assets/fonts/FiraGO/FiraGO-Regular.woff2 +0 -0
  28. package/src/assets/fonts/europa-bold-webfont.woff2 +0 -0
  29. package/src/assets/fonts/europa-bolditalic-webfont.woff2 +0 -0
  30. package/src/assets/fonts/europa-light-webfont.woff2 +0 -0
  31. package/src/assets/fonts/europa-lightitalic-webfont.woff2 +0 -0
  32. package/src/assets/fonts/europa-regular-webfont.woff2 +0 -0
  33. package/src/assets/fonts/europa-regularitalic-webfont.woff2 +0 -0
  34. package/src/assets/mask1.png +0 -0
  35. package/src/assets/mask2.png +0 -0
  36. package/src/assets/ovalCircle.svg +0 -9
  37. package/src/assets/shapes.png +0 -0
  38. package/src/assets/space.png +0 -0
  39. package/src/assets/type.png +0 -0
  40. package/src/components/Aside.js +0 -101
  41. package/src/components/Banner.js +0 -58
  42. package/src/components/ColorText.js +0 -29
  43. package/src/components/ColorsPalette.js +0 -69
  44. package/src/components/ColumnParagrphs.js +0 -22
  45. package/src/components/ContinueButton.js +0 -14
  46. package/src/components/DesignComponent.js +0 -81
  47. package/src/components/FontText.js +0 -193
  48. package/src/components/Header.js +0 -53
  49. package/src/components/HeaderHeading.js +0 -23
  50. package/src/components/IconsGroup.js +0 -64
  51. package/src/components/Page.js +0 -135
  52. package/src/components/ResponsivePreview.js +0 -44
  53. package/src/components/Route.js +0 -1
  54. package/src/components/ShapePreview.js +0 -63
  55. package/src/components/ShapeSet.js +0 -85
  56. package/src/components/SlidersWithResponsive.js +0 -23
  57. package/src/components/SpacingButton/actionButtons.js +0 -41
  58. package/src/components/SpacingButton/dropdown.js +0 -114
  59. package/src/components/SpacingButton/index.js +0 -250
  60. package/src/components/SpacingButton/props.js +0 -45
  61. package/src/components/SpacingPreview.js +0 -156
  62. package/src/components/SpacingTable.js +0 -213
  63. package/src/components/ThemeButtons.js +0 -41
  64. package/src/components/UploadImage.js +0 -31
  65. package/src/components/Widget.js +0 -1
  66. package/src/components/index.js +0 -25
  67. package/src/pages/Account/Personal.js +0 -59
  68. package/src/pages/Account/Project.js +0 -40
  69. package/src/pages/Account/fields.js +0 -74
  70. package/src/pages/Account/fieldsGridProps.js +0 -15
  71. package/src/pages/Account/index.js +0 -117
  72. package/src/pages/Color/globalThemes.js +0 -32
  73. package/src/pages/Color/index.js +0 -18
  74. package/src/pages/Color/palette.js +0 -36
  75. package/src/pages/Color/themes.js +0 -37
  76. package/src/pages/Components/grid.js +0 -99
  77. package/src/pages/Components/index.js +0 -37
  78. package/src/pages/Components/sidebar.js +0 -28
  79. package/src/pages/Components/style.js +0 -16
  80. package/src/pages/DesignSystem/Dashboard/banners.js +0 -38
  81. package/src/pages/DesignSystem/Dashboard/designElements.js +0 -124
  82. package/src/pages/DesignSystem/Dashboard/index.js +0 -22
  83. package/src/pages/DesignSystem/Dashboard/quickstart.js +0 -84
  84. package/src/pages/DesignSystem/Dashboard/state.js +0 -142
  85. package/src/pages/DesignSystem/Dashboard/summary.js +0 -52
  86. package/src/pages/DesignSystem/index.js +0 -187
  87. package/src/pages/Editor/index.js +0 -46
  88. package/src/pages/Editor/layers.js +0 -126
  89. package/src/pages/Editor/scene.js +0 -95
  90. package/src/pages/Editor/style.js +0 -13
  91. package/src/pages/Editor/tools.js +0 -360
  92. package/src/pages/Export/const.js +0 -19
  93. package/src/pages/Export/description.js +0 -88
  94. package/src/pages/Export/gist.js +0 -23
  95. package/src/pages/Export/index.js +0 -82
  96. package/src/pages/Export/scene.js +0 -59
  97. package/src/pages/Export/state.js +0 -23
  98. package/src/pages/Export/tools.js +0 -101
  99. package/src/pages/Fonts/fontFaces.js +0 -50
  100. package/src/pages/Fonts/fontFamilies.js +0 -48
  101. package/src/pages/Fonts/index.js +0 -16
  102. package/src/pages/Fonts/state.js +0 -5
  103. package/src/pages/Icons/index.js +0 -92
  104. package/src/pages/Icons/style.js +0 -1
  105. package/src/pages/Init/ChooseEnvironment.js +0 -149
  106. package/src/pages/Init/ChooseProject.js +0 -61
  107. package/src/pages/Init/CreateDocumentTheme.js +0 -176
  108. package/src/pages/Init/CreatePalette.js +0 -94
  109. package/src/pages/Init/FontText.js +0 -33
  110. package/src/pages/Init/Personalize/fields.js +0 -120
  111. package/src/pages/Init/Personalize/icon.js +0 -76
  112. package/src/pages/Init/Personalize/index.js +0 -120
  113. package/src/pages/Init/index.js +0 -39
  114. package/src/pages/Library/disabled.js +0 -38
  115. package/src/pages/Library/index.js +0 -33
  116. package/src/pages/MediaQuery/index.js +0 -46
  117. package/src/pages/MediaQuery/lists.js +0 -299
  118. package/src/pages/MediaQuery/state.js +0 -149
  119. package/src/pages/MediaQuery/typeScale.js +0 -69
  120. package/src/pages/Shapes/index.js +0 -75
  121. package/src/pages/Shapes/shapeSet.js +0 -133
  122. package/src/pages/Shapes/style.js +0 -11
  123. package/src/pages/Spaces/index.js +0 -65
  124. package/src/pages/Spaces/sequence.js +0 -34
  125. package/src/pages/Spaces/templates.js +0 -37
  126. package/src/pages/State/index.js +0 -87
  127. package/src/pages/Theme/buttonTitlesGrid.js +0 -47
  128. package/src/pages/Theme/buttonsHeader.js +0 -33
  129. package/src/pages/Theme/friendTheme.js +0 -30
  130. package/src/pages/Theme/index.js +0 -226
  131. package/src/pages/Theme/interactivity.js +0 -115
  132. package/src/pages/Theme/ntc.js +0 -1689
  133. package/src/pages/Theme/preview.js +0 -152
  134. package/src/pages/Theme/selectsGrid.js +0 -74
  135. package/src/pages/Theme/style.js +0 -38
  136. package/src/pages/Theme/themingTools.js +0 -106
  137. package/src/pages/Typography/collection.js +0 -115
  138. package/src/pages/Typography/documentStyles.js +0 -113
  139. package/src/pages/Typography/index.js +0 -71
  140. package/src/pages/Typography/rangeButtons.js +0 -58
  141. package/src/pages/Typography/shared.js +0 -9
  142. package/src/pages/Typography/stylesHelpers.js +0 -30
  143. package/src/pages/Typography/typeScale.js +0 -83
  144. package/src/pages/__Account/__/index.js +0 -241
  145. package/src/pages/__Account/__/setUpProject.js +0 -142
  146. package/src/pages/__Account/index.js +0 -111
  147. package/src/pages/index.js +0 -17
  148. package/src/state.js +0 -20
  149. package/src/style.js +0 -20
@@ -1,250 +0,0 @@
1
- 'use strict'
2
-
3
- import { WiderButton, DropdownParent, Icon } from '@symbo.ls/components'
4
-
5
- import { SPACING_BUTTONS } from './props'
6
- import dropdown from './dropdown'
7
-
8
- export const ChoosableButton = {
9
- props: ({ key }) => ({
10
- padding: 'Z',
11
- icon: key,
12
- theme: null,
13
- transition: 'B defaultBezier',
14
- transitionProperty: 'opacity, background, color',
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
- '.active': { color: 'blue' }
26
- },
27
- '.active': {
28
- theme: null
29
- }
30
- })
31
- }
32
-
33
- export const DotForPropButton = {
34
- props: (el) => {
35
- const { table, row, property: direction } = getStateTree(el)
36
- const property = direction.parent
37
-
38
- const propKey = diffPropValue(property.value, direction.value)
39
- const active = table.props[propKey] === (row && row.key)
40
-
41
- const isRadius = property.value === 'borderRadius'
42
-
43
- return {
44
- position: 'absolute',
45
- round: '100%',
46
- background: 'blue',
47
- boxSize: 'W2',
48
- lazyLoad: true,
49
-
50
- hide: !active,
51
- isRadius,
52
-
53
- '!isRadius': {
54
- ':nth-child(1)': { left: '45%', top: 'W' },
55
- ':nth-child(2)': { right: 'W', top: '45%' },
56
- ':nth-child(3)': { left: '45%', bottom: 'W' },
57
- ':nth-child(4)': { left: 'W', top: '45%' }
58
- },
59
-
60
- '.isRadius': {
61
- ':nth-child(1)': { left: 'X2', top: 'X2' },
62
- ':nth-child(2)': { right: 'X2', top: 'X2' },
63
- ':nth-child(3)': { right: 'X2', bottom: 'X2' },
64
- ':nth-child(4)': { left: 'X2', bottom: 'X2' }
65
- }
66
- }
67
- }
68
- }
69
-
70
- export const DotForRowButton = {
71
- extend: DotForPropButton,
72
- props: ({ state }) => {
73
- console.log(state)
74
- const direction = state
75
- const property = direction.parent
76
- const row = property.parent
77
- const table = row.parent
78
-
79
- const propKey = diffPropValue(property.value, direction.value)
80
- const active = table.props[propKey] === row.key
81
-
82
- return {
83
- hide: !active,
84
- background: 'blue .65'
85
- }
86
- }
87
- }
88
-
89
- export const SpacingButton = {
90
- extend: [ChoosableButton, DropdownParent, WiderButton],
91
-
92
- props: (element) => {
93
- const { table, row, property } = getStateTree(element)
94
- const propValue = property.value
95
- const active = table.props[propValue] === (row && row.key)
96
- return {
97
- active,
98
- icon: { name: property.value },
99
-
100
- '.active': {
101
- color: 'blue',
102
- ':hover': { color: 'blue' }
103
- },
104
-
105
- style: {
106
- '&:hover, &:focus-visible': {
107
- '& [tooltip]': {
108
- transform: 'translate3d(-50%,0,0)'
109
- }
110
- }
111
- }
112
- }
113
- },
114
-
115
- dots: {
116
- props: {
117
- lazyLoad: true,
118
- position: 'absolute',
119
- inset: '0 0 0 0'
120
- },
121
-
122
- on: {
123
- click: (ev, el) => {
124
- const { table, row, property } = getStateTree(el)
125
- const active = table.props[property.value] === row.key
126
- if (active) {
127
- delete table.props[property.value] && table.update()
128
- } else {
129
- const allKeys = Object.keys(table.props)
130
- allKeys.filter(v => {
131
- const splitInWords = property.value.split(/(?=[A-Z])/)
132
- return v.includes(splitInWords[0]) && v.includes(splitInWords[1])
133
- })
134
- .forEach(v => delete table.props[v])
135
- table.update({ props: { [property.value]: row.key } })
136
- }
137
- }
138
- },
139
-
140
- attr: { title: ({ state }) => state.value },
141
-
142
- childExtend: DotForPropButton,
143
-
144
- $setStateCollection: ({ state }) => {
145
- const buttonsByProperty = keysOf(state)
146
- return buttonsByProperty
147
- }
148
- },
149
-
150
- dropdown
151
- }
152
-
153
- const DotsInButton = SpacingButton.dots
154
-
155
- export const SpacingRowButton = {
156
- props: ({ state }) => {
157
- console.log(state)
158
- const property = state.parent
159
- const row = property.parent
160
- const table = row.parent
161
-
162
- const propKey = property.value
163
-
164
- const active = Object.keys(table.props).filter(prop => {
165
- const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
166
- const keyMathes = table.props[prop] === row.key
167
- return hasProp && keyMathes
168
- }).length
169
-
170
- return {
171
- active: !!active,
172
- position: 'relative',
173
- round: 'Z',
174
- display: 'flex',
175
-
176
- icon: {
177
- name: propKey,
178
- opacity: '0',
179
- color: 'gray5',
180
- margin: 'auto'
181
- },
182
-
183
- '.active': {
184
- boxShadow: '0, 0, 0, 3px, gray1, inset'
185
- }
186
- }
187
- },
188
-
189
- icon: {
190
- extend: Icon,
191
- props: ({ state }) => {
192
- const property = state.parent
193
- const row = property.parent
194
- const table = row.parent
195
-
196
- const propKey = property.value
197
- const middleActive = table.props[propKey] === row.key
198
-
199
- const active = Object.keys(table.props).filter(prop => {
200
- const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
201
- const keyMathes = table.props[prop] === row.key
202
- return hasProp && keyMathes
203
- }).length
204
-
205
- return {
206
- active,
207
- middleActive,
208
- '.active': { opacity: '1' },
209
- '.middleActive': { color: 'blue' }
210
- }
211
- }
212
- },
213
-
214
- dots: {
215
- childExtend: DotForRowButton,
216
- $setStateCollection: DotsInButton.$setStateCollection
217
- }
218
- }
219
-
220
- export const getStateTree = element => {
221
- const table = element.lookup('Page').state
222
- const row = table.sequence[table.selectedKey]
223
- const property = element.state
224
-
225
- return { table, row, property }
226
- }
227
-
228
- export const jointPropDirection = (parentKey, key) => {
229
- return parentKey + key.slice(0, 1).toUpperCase() + key.slice(1)
230
- }
231
-
232
- export const diffPropValue = (parentKey, key) => {
233
- if (parentKey.includes('borderWidth')) parentKey = 'border'
234
- return jointPropDirection(parentKey, key)
235
- }
236
-
237
- export const diffPropPosition = (parentKey, key) => {
238
- if (parentKey.includes('borderWidth')) return key.split('Width')[0]
239
- return key
240
- }
241
-
242
- export const diffIconTypes = (parentKey, key) => {
243
- if (parentKey.includes('borderWidth')) key = key.split('Width')[0]
244
- if (parentKey.includes('margin') || parentKey === 'borderWidth') parentKey = 'padding'
245
- return jointPropDirection(parentKey, key)
246
- }
247
-
248
- export const keysOf = state => {
249
- return Object.keys(SPACING_BUTTONS[state.value]).filter(v => v !== 'maxValue')
250
- }
@@ -1,45 +0,0 @@
1
- 'use strict'
2
-
3
- export const SPACING_BUTTONS = {
4
- margin: {
5
- maxValue: 3000,
6
- blockStart: {},
7
- inlineEnd: {},
8
- blockEnd: {},
9
- inlineStart: {}
10
- },
11
- height: {
12
- minWidth: {},
13
- maxWidth: {}
14
- },
15
- width: {
16
- minWidth: {},
17
- maxWidth: {}
18
- },
19
- borderWidth: {
20
- maxValue: 1280,
21
- blockStartWidth: {},
22
- inlineEndWidth: {},
23
- blockEndWidth: {},
24
- inlineStartWidth: {}
25
- },
26
- padding: {
27
- maxValue: 3000,
28
- blockStart: {},
29
- inlineEnd: {},
30
- blockEnd: {},
31
- inlineStart: {}
32
- },
33
- gap: {
34
- maxValue: 3000,
35
- Horizontal: {},
36
- Vertical: {}
37
- },
38
- borderRadius: {
39
- maxValue: 1280,
40
- endStart: {},
41
- startEnd: {},
42
- endEnd: {},
43
- startStart: {}
44
- }
45
- }
@@ -1,156 +0,0 @@
1
- 'use strict'
2
-
3
- import { Grid, Scene, Flex, Code } from '@symbo.ls/components'
4
-
5
- const returnScale = (state, key, fallback) => {
6
- const { scales } = state
7
- return (scales[state.props[key] || state.props[fallback]] || 0) + 'em'
8
- }
9
-
10
- const scene = {
11
- extend: Scene,
12
-
13
- scene: {
14
- boxModel: {
15
- extend: Grid,
16
- props: ({ state }) => ({
17
- color: 'gray5',
18
- fontSize: 'Z',
19
- columns: '30px auto 30px',
20
- rows: '30px auto 30px',
21
- templateAreas: `"x1 t x2"
22
- "l content r"
23
- "x3 b x4"`,
24
- alignItems: 'center',
25
- textAlign: 'center'
26
- }),
27
-
28
- ...[
29
- ...['', { text: (el, s) => s.props.paddingTop || '', style: { gridArea: 't' } }, ''],
30
- ...[
31
- { text: (el, s) => s.props.paddingLeft || '', style: { gridArea: 'l' } },
32
- {
33
- props: ({ state }) => ({
34
- gridArea: 'content',
35
- borderStyle: 'solid',
36
- borderColor: 'margin 0.15',
37
-
38
- borderWidth: [
39
- returnScale(state, 'marginBlockStart', 'margin'),
40
- returnScale(state, 'marginInlineEnd', 'margin'),
41
- returnScale(state, 'marginBlockEnd', 'margin'),
42
- returnScale(state, 'marginInlineStart', 'margin')
43
- ]
44
- }),
45
- border: {
46
- props: ({ state }) => ({
47
- gridArea: 'content',
48
- borderStyle: 'solid',
49
- borderColor: 'border 0.65',
50
- overflow: 'hidden',
51
-
52
- round: [
53
- returnScale(state, 'borderRadiusEndStart', 'borderRadius'),
54
- returnScale(state, 'borderRadiusStartEnd', 'borderRadius'),
55
- returnScale(state, 'borderRadiusEndEnd', 'borderRadius'),
56
- returnScale(state, 'borderRadiusStartStart', 'borderRadius')
57
- ].join(' '),
58
-
59
- borderWidth: [
60
- returnScale(state, 'borderBlockStartWidth', 'borderWidth'),
61
- returnScale(state, 'borderInlineEndWidth', 'borderWidth'),
62
- returnScale(state, 'borderBlockEndWidth', 'borderWidth'),
63
- returnScale(state, 'borderInlineStartWidth', 'borderWidth')
64
- ]
65
- }),
66
- padding: {
67
- extend: Flex,
68
- props: ({ state }) => ({
69
- fontSize: `${state.base}px`,
70
- lineHeight: 1,
71
- borderStyle: 'solid',
72
- theme: 'quaternary',
73
- padding: 'X2',
74
- borderColor: 'grassgreen 0.25',
75
- overflow: 'hidden',
76
- textOverflow: 'ellipsis',
77
-
78
- width: state.props['width'],
79
- height: state.props['height'],
80
-
81
- minWidth: state.props['minWidth'],
82
- maxWidth: state.props['maxWidth'],
83
-
84
- minHeight: state.props['minHeight'],
85
- maxHeight: state.props['maxHeight'],
86
-
87
- borderWidth: [
88
- returnScale(state, 'paddingBlockStart', 'padding'),
89
- returnScale(state, 'paddingInlineEnd', 'padding'),
90
- returnScale(state, 'paddingBlockEnd', 'padding'),
91
- returnScale(state, 'paddingInlineStart', 'padding')
92
- ],
93
- style: { whiteSpace: 'nowrap' }
94
- }),
95
- span: (el, s) => `Base `,
96
- gap: {
97
- props: ({ state }) => ({
98
- background: 'gap .15',
99
- margin: '0 .1em',
100
- height: '1em',
101
- minWidth: state.props['gap']
102
- })
103
- },
104
- base: { text: (el, s) => s.base }
105
- }
106
- }
107
- }, {
108
- text: (el, s) => s.paddingRight || '', style: { gridArea: 'r' }
109
- }],
110
- ...['', { text: (el, s) => s.paddingBottom || '', style: { gridArea: 'b' } }, '']
111
- ]
112
- }
113
- }
114
- }
115
-
116
- const code = {
117
- extend: Code,
118
- props: ({ state }) => ({
119
- hide: Object.keys(state.props).length === 0,
120
- flex: '0 0 360px',
121
- margin: '0',
122
- code: {
123
- margin: '0'
124
- },
125
- buttons: { marginInline: 'X2' }
126
- }),
127
- title: null,
128
- code: {
129
- props: {
130
- text: ({ state }) => {
131
- const code = 'const props = ' + JSON.stringify(state.props, null, 2)
132
- return code
133
- }
134
- }
135
- }
136
- }
137
-
138
- export const SpacingPreview = {
139
- extend: Flex,
140
-
141
- props: {
142
- maxHeight: '25vh',
143
- zIndex: '9999',
144
- gap: 'A',
145
- lazyLoad: true,
146
-
147
- scene: { flex: 1 },
148
-
149
- style: {
150
- backdropFilter: 'blur(15px)'
151
- }
152
- }
153
-
154
- // scene,
155
- // code
156
- }
@@ -1,213 +0,0 @@
1
- 'use strict'
2
-
3
- import {
4
- Grid,
5
- Pseudo,
6
- mapSequence,
7
- sortSequence
8
- } from '@symbo.ls/components'
9
-
10
- import { SpacingRowButton } from '.'
11
- import actionButtons, { setRowButtons } from './SpacingButton/actionButtons'
12
-
13
- const Cell = {
14
- tag: 'div',
15
- props: {
16
- padding: 'X2 C2 X2 0'
17
- }
18
- }
19
-
20
- const Row = {
21
- extend: Grid,
22
- key: state => state.key,
23
-
24
- props: ({ state }) => ({
25
- columns: '7ch 14ch 12ch 12ch 20em 1fr',
26
- alignItems: 'center',
27
- isBase: state.index === 0,
28
- active: (state.key && state.key.length) === 1,
29
-
30
- margin: '0 -A',
31
- padding: '0 B',
32
- position: 'relative',
33
- height: 'C+Z',
34
- transition: 'A defaultBezier background',
35
-
36
- '.isBase': {
37
- opacity: 1,
38
- background: 'gray1 .5'
39
- },
40
-
41
- ':hover': {
42
- background: 'gray1 .65'
43
- },
44
-
45
- i: {
46
- text: state.key,
47
- active: (state.key && state.key.length) === 1,
48
-
49
- '.active': {
50
- fontWeight: '600',
51
- '@dark': { color: 'gray9' },
52
- '@light': { color: 'gray3' }
53
- },
54
- '!active': {
55
- fontWeight: '400',
56
- '@dark': { color: 'gray6' },
57
- '@light': { color: 'gray7' }
58
- }
59
- },
60
- decimal: {
61
- text: state.decimal,
62
- color: 'gray6',
63
- fontWeight: '300'
64
- },
65
- px: {
66
- text: state.val,
67
- '@dark': { color: 'gray9' },
68
- '@light': { color: 'gray3' }
69
- },
70
- em: {
71
- color: 'gray6',
72
- text: state.scaling + 'em'
73
- },
74
- graph: {
75
- margin: '0 0 0 -B2',
76
- maxWidth: '1px',
77
- line: {
78
- isBase: state.index === 0,
79
- widthRange: `${state.val}px` || 0,
80
- height: '2px',
81
- background: 'blue',
82
- borderRadius: 'A',
83
- '.isBase': {
84
- height: '5px'
85
- }
86
- }
87
- },
88
- buttons: {
89
- columns: 'repeat(7, var(--spacing-B2))',
90
- rows: 'var(--spacing-B2)',
91
- position: 'relative',
92
- gap: '.2em',
93
- opacity: '1',
94
- boxSizing: 'content-box',
95
- margin: '0 0 0 -1.9em'
96
- }
97
- }),
98
-
99
- childExtend: Cell,
100
-
101
- i: {},
102
- em: {},
103
- decimal: {},
104
- px: {},
105
- buttons: {
106
- extend: Grid
107
- // childExtend: SpacingRowButton,
108
- // $setStateCollection: setRowButtons
109
- },
110
- graph: { line: {} },
111
-
112
- overlay: {
113
- props: {
114
- position: 'absolute',
115
- right: '0',
116
- top: '0',
117
- bottom: '0',
118
- width: 'calc(100% - var(--spacing-G3))',
119
- height: '100%'
120
- },
121
-
122
- on: {
123
- mouseover: (ev, el, s) => {
124
- if (!s.parent.hovered !== s.key) {
125
- s.parent.hovered = s.parent.selectedKey = s.key
126
- s.parent.selectedIndex = el.parent.key
127
- const key = parseInt(el.parent.key)
128
- const rowHeight = '(var(--spacing-C) + var(--spacing-Z))'
129
- const translateY = `calc(${rowHeight} * ${key + 1})`
130
- const transform = `translate3d(0px, ${translateY}, 1px)`
131
- el.lookup('actionButtons').setProps({ opacity: '1', transform })
132
- }
133
- },
134
-
135
- mouseleave: (ev, el, s) => {
136
- if (s.parent.hovered && s.parent.hovered === s.key) {
137
- s.parent.hovered = false
138
- el.lookup('actionButtons').setProps({ opacity: '0' })
139
- }
140
- }
141
- }
142
- }
143
- }
144
-
145
- const HeaderRow = {
146
- extend: Row,
147
-
148
- childExtend: {
149
- props: {
150
- color: 'gray7',
151
- style: { paddingBlock: '0 .618em' }
152
- }
153
- },
154
-
155
- i: '#',
156
- em: 'em',
157
- decimal: 'decimal',
158
- px: 'px',
159
- buttons: '',
160
- graph: null,
161
- overlay: null
162
- }
163
-
164
- export const SpacingTable = {
165
- extend: Pseudo,
166
- tag: 'section',
167
-
168
- props: {
169
- lazyLoad: true,
170
- overflow: 'hidden',
171
- position: 'relative',
172
- header: {
173
- '@dark': { color: 'gray6' },
174
- '@light': { color: 'gray7' }
175
- },
176
-
177
- '::after': {
178
- content: '""',
179
- position: 'absolute',
180
- width: '100%',
181
- height: '100%',
182
- top: '0',
183
- left: '100%'
184
- },
185
- '@dark': {
186
- color: 'gray8',
187
- '::after': {
188
- background: 'gray0',
189
- boxShadow: 'gray0, 0 0px 50px 50px'
190
- }
191
- },
192
- '@light': {
193
- color: 'gray3',
194
- '::after': {
195
- background: 'gray12',
196
- boxShadow: 'gray12, 0 0px 50px 50px'
197
- }
198
- }
199
- },
200
-
201
- header: HeaderRow,
202
-
203
- cnt: {
204
- childExtend: Row,
205
- props: { lazyLoad: true },
206
- $setStateCollection: ({ state }) => {
207
- const sequence = state.parse()
208
- return Object.values(sequence) || {}
209
- }
210
- },
211
-
212
- actionButtons
213
- }
@@ -1,41 +0,0 @@
1
- 'use strict'
2
-
3
- import { ColorPicker } from '@symbo.ls/components'
4
-
5
- export const ThemeButtons = {
6
- props: {
7
- position: 'relative',
8
- zIndex: '2',
9
- round: 'X2',
10
- style: {
11
- columnCount: 2,
12
- columnGap: '0'
13
- }
14
- },
15
-
16
- attr: { buttons: true },
17
-
18
- childExtend: {
19
- extend: ColorPicker,
20
- props: {
21
- width: '100%',
22
- theme: null,
23
- background: 'black 0'
24
- },
25
- on: {
26
- stateUpdated: (el, s) => {
27
- s.parent.update({ [s.key]: s.value })
28
- }
29
- }
30
- },
31
-
32
- $setStateCollection: (el, s) => {
33
- return [{
34
- key: 'color',
35
- value: s.color
36
- }, {
37
- key: 'background',
38
- value: s.background
39
- }]
40
- }
41
- }