@symbo.ls/preview 2.7.20 → 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 -248
  60. package/src/components/SpacingButton/props.js +0 -45
  61. package/src/components/SpacingPreview.js +0 -154
  62. package/src/components/SpacingTable.js +0 -210
  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 -37
  75. package/src/pages/Color/themes.js +0 -38
  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 -47
  101. package/src/pages/Fonts/index.js +0 -15
  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 -146
  106. package/src/pages/Init/ChooseProject.js +0 -61
  107. package/src/pages/Init/CreateDocumentTheme.js +0 -173
  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 -32
  124. package/src/pages/Spaces/sequence.js +0 -32
  125. package/src/pages/Spaces/state.js +0 -20
  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 -273
  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 -153
  134. package/src/pages/Theme/selectsGrid.js +0 -73
  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 -69
  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 -86
  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,248 +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
- const direction = state
74
- const property = direction.parent
75
- const row = property.parent
76
- const table = row.parent
77
-
78
- const propKey = diffPropValue(property.value, direction.value)
79
- const active = table.props[propKey] === row.key
80
-
81
- return {
82
- hide: !active,
83
- background: 'blue .65'
84
- }
85
- }
86
- }
87
-
88
- export const SpacingButton = {
89
- extend: [ChoosableButton, DropdownParent, WiderButton],
90
-
91
- props: (element) => {
92
- const { table, row, property } = getStateTree(element)
93
- const propValue = property.value
94
- const active = table.props[propValue] === (row && row.key)
95
- return {
96
- active,
97
- icon: { name: property.value },
98
-
99
- '.active': {
100
- color: 'blue',
101
- ':hover': { color: 'blue' }
102
- },
103
-
104
- style: {
105
- '&:hover, &:focus-visible': {
106
- '& [tooltip]': {
107
- transform: 'translate3d(-50%,0,0)'
108
- }
109
- }
110
- }
111
- }
112
- },
113
-
114
- dots: {
115
- props: {
116
- lazyLoad: true,
117
- position: 'absolute',
118
- inset: '0 0 0 0'
119
- },
120
-
121
- on: {
122
- click: (ev, el) => {
123
- const { table, row, property } = getStateTree(el)
124
- const active = table.props[property.value] === row.key
125
- if (active) {
126
- delete table.props[property.value] && table.update()
127
- } else {
128
- const allKeys = Object.keys(table.props)
129
- allKeys.filter(v => {
130
- const splitInWords = property.value.split(/(?=[A-Z])/)
131
- return v.includes(splitInWords[0]) && v.includes(splitInWords[1])
132
- })
133
- .forEach(v => delete table.props[v])
134
- table.update({ props: { [property.value]: row.key } })
135
- }
136
- }
137
- },
138
-
139
- attr: { title: ({ state }) => state.value },
140
-
141
- childExtend: DotForPropButton,
142
-
143
- $setStateCollection: ({ state }) => {
144
- const buttonsByProperty = keysOf(state)
145
- return buttonsByProperty
146
- }
147
- },
148
-
149
- dropdown
150
- }
151
-
152
- const DotsInButton = SpacingButton.dots
153
-
154
- export const SpacingRowButton = {
155
- props: ({ state }) => {
156
- const property = state
157
- const row = property.parent
158
- const table = row.parent
159
-
160
- const propKey = property.value
161
-
162
- const active = Object.keys(table.props).filter(prop => {
163
- const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
164
- const keyMathes = table.props[prop] === row.key
165
- return hasProp && keyMathes
166
- }).length
167
-
168
- return {
169
- active: !!active,
170
- position: 'relative',
171
- round: 'Z',
172
- display: 'flex',
173
-
174
- icon: {
175
- name: propKey,
176
- opacity: '0',
177
- color: 'gray5',
178
- margin: 'auto'
179
- },
180
-
181
- '.active': {
182
- boxShadow: '0, 0, 0, 3px, gray1, inset'
183
- }
184
- }
185
- },
186
-
187
- icon: {
188
- extend: Icon,
189
- props: ({ state }) => {
190
- const property = state
191
- const row = property.parent
192
- const table = row.parent
193
-
194
- const propKey = property.value
195
- const middleActive = table.props[propKey] === row.key
196
-
197
- const active = Object.keys(table.props).filter(prop => {
198
- const hasProp = prop.toLowerCase().includes(propKey.toLowerCase())
199
- const keyMathes = table.props[prop] === row.key
200
- return hasProp && keyMathes
201
- }).length
202
-
203
- return {
204
- active,
205
- middleActive,
206
- '.active': { opacity: '1' },
207
- '.middleActive': { color: 'blue' }
208
- }
209
- }
210
- },
211
-
212
- dots: {
213
- childExtend: DotForRowButton,
214
- $setStateCollection: DotsInButton.$setStateCollection
215
- }
216
- }
217
-
218
- export const getStateTree = element => {
219
- const table = element.lookup('Page').state
220
- const row = table.sequence[table.selectedKey]
221
- const property = element.state
222
-
223
- return { table, row, property }
224
- }
225
-
226
- export const jointPropDirection = (parentKey, key) => {
227
- return parentKey + key.slice(0, 1).toUpperCase() + key.slice(1)
228
- }
229
-
230
- export const diffPropValue = (parentKey, key) => {
231
- if (parentKey.includes('borderWidth')) parentKey = 'border'
232
- return jointPropDirection(parentKey, key)
233
- }
234
-
235
- export const diffPropPosition = (parentKey, key) => {
236
- if (parentKey.includes('borderWidth')) return key.split('Width')[0]
237
- return key
238
- }
239
-
240
- export const diffIconTypes = (parentKey, key) => {
241
- if (parentKey.includes('borderWidth')) key = key.split('Width')[0]
242
- if (parentKey.includes('margin') || parentKey === 'borderWidth') parentKey = 'padding'
243
- return jointPropDirection(parentKey, key)
244
- }
245
-
246
- export const keysOf = state => {
247
- return Object.keys(SPACING_BUTTONS[state.value]).filter(v => v !== 'maxValue')
248
- }
@@ -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,154 +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
- export const SpacingPreview = {
117
- extend: Flex,
118
-
119
- props: {
120
- maxHeight: '25vh',
121
- zIndex: '9999',
122
- gap: 'A',
123
- lazyLoad: true,
124
-
125
- scene: { flex: 1 },
126
-
127
- style: {
128
- backdropFilter: 'blur(15px)'
129
- }
130
- },
131
-
132
- scene,
133
- code: {
134
- extend: Code,
135
- props: ({ state }) => ({
136
- hide: Object.keys(state.props).length === 0,
137
- flex: '0 0 360px',
138
- margin: '0',
139
- code: {
140
- margin: '0'
141
- },
142
- buttons: { marginInline: 'X2' }
143
- }),
144
- title: null,
145
- code: {
146
- props: {
147
- text: ({ state }) => {
148
- const code = 'const props = ' + JSON.stringify(state.props, null, 2)
149
- return code
150
- }
151
- }
152
- }
153
- }
154
- }
@@ -1,210 +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
- const key = parseInt(el.parent.key)
126
- const rowHeight = '(var(--spacing-C) + var(--spacing-Z))'
127
- const translateY = `calc(${rowHeight} * ${key + 1})`
128
- const transform = `translate3d(0px, ${translateY}, 1px)`
129
- s.parent.hovered = s.key
130
- s.parent.selectedKey = s.key
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 }) => mapSequence(state, sortSequence)
207
- },
208
-
209
- actionButtons
210
- }
@@ -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
- }