@symbo.ls/preview 2.7.19 → 2.7.21

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
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/preview",
3
3
  "description": "",
4
4
  "author": "symbo.ls",
5
- "version": "2.7.19",
5
+ "version": "2.7.21",
6
6
  "main": "src/app.js",
7
7
  "scripts": {
8
8
  "link:all": "yarn link smbls domql css-in-props @symbo.ls/icons @symbo.ls/config @symbo.ls/components @symbo.ls/scratch @symbo.ls/playground @symbo.ls/utils @symbo.ls/init @symbo.ls/config-default @domql/router @domql/utils @domql/router",
@@ -14,7 +14,7 @@ export const HeaderHeading = {
14
14
 
15
15
  H1: {
16
16
  color: 'white',
17
- text: 'First is the light',
17
+ text: 'First was the dark',
18
18
  fontSize: 'H2',
19
19
  fontWeight: '700',
20
20
  margin: '0',
@@ -1,12 +1,12 @@
1
1
  'use strict'
2
2
 
3
3
  import { Flex } from '@symbo.ls/components'
4
- import { SpacingButton } from '..'
4
+ import { SpacingButton } from '..' // eslint-disable-line
5
5
  import { SPACING_BUTTONS } from './props'
6
6
 
7
7
  export const setTableButtons = ({ state }) =>
8
8
  Object.keys(SPACING_BUTTONS).filter(v => {
9
- const rowState = state.sequence[state.selectedKey]
9
+ const rowState = state[state.selectedIndex]
10
10
  const { maxValue } = SPACING_BUTTONS[v]
11
11
  return maxValue ? maxValue > (rowState && rowState.val) : true
12
12
  })
@@ -34,8 +34,8 @@ export default {
34
34
  opacity: '0',
35
35
 
36
36
  ':hover': { opacity: '1' }
37
- },
37
+ }
38
38
 
39
- childExtend: SpacingButton,
40
- $setStateCollection: setTableButtons
39
+ // childExtend: SpacingButton,
40
+ // $setStateCollection: setTableButtons
41
41
  }
@@ -70,6 +70,7 @@ export const DotForPropButton = {
70
70
  export const DotForRowButton = {
71
71
  extend: DotForPropButton,
72
72
  props: ({ state }) => {
73
+ console.log(state)
73
74
  const direction = state
74
75
  const property = direction.parent
75
76
  const row = property.parent
@@ -153,7 +154,8 @@ const DotsInButton = SpacingButton.dots
153
154
 
154
155
  export const SpacingRowButton = {
155
156
  props: ({ state }) => {
156
- const property = state
157
+ console.log(state)
158
+ const property = state.parent
157
159
  const row = property.parent
158
160
  const table = row.parent
159
161
 
@@ -187,7 +189,7 @@ export const SpacingRowButton = {
187
189
  icon: {
188
190
  extend: Icon,
189
191
  props: ({ state }) => {
190
- const property = state
192
+ const property = state.parent
191
193
  const row = property.parent
192
194
  const table = row.parent
193
195
 
@@ -113,6 +113,28 @@ const scene = {
113
113
  }
114
114
  }
115
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
+
116
138
  export const SpacingPreview = {
117
139
  extend: Flex,
118
140
 
@@ -127,28 +149,8 @@ export const SpacingPreview = {
127
149
  style: {
128
150
  backdropFilter: 'blur(15px)'
129
151
  }
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
152
  }
153
+
154
+ // scene,
155
+ // code
154
156
  }
@@ -103,9 +103,9 @@ const Row = {
103
103
  decimal: {},
104
104
  px: {},
105
105
  buttons: {
106
- extend: Grid,
107
- childExtend: SpacingRowButton,
108
- $setStateCollection: setRowButtons
106
+ extend: Grid
107
+ // childExtend: SpacingRowButton,
108
+ // $setStateCollection: setRowButtons
109
109
  },
110
110
  graph: { line: {} },
111
111
 
@@ -122,12 +122,12 @@ const Row = {
122
122
  on: {
123
123
  mouseover: (ev, el, s) => {
124
124
  if (!s.parent.hovered !== s.key) {
125
+ s.parent.hovered = s.parent.selectedKey = s.key
126
+ s.parent.selectedIndex = el.parent.key
125
127
  const key = parseInt(el.parent.key)
126
128
  const rowHeight = '(var(--spacing-C) + var(--spacing-Z))'
127
129
  const translateY = `calc(${rowHeight} * ${key + 1})`
128
130
  const transform = `translate3d(0px, ${translateY}, 1px)`
129
- s.parent.hovered = s.key
130
- s.parent.selectedKey = s.key
131
131
  el.lookup('actionButtons').setProps({ opacity: '1', transform })
132
132
  }
133
133
  },
@@ -203,7 +203,10 @@ export const SpacingTable = {
203
203
  cnt: {
204
204
  childExtend: Row,
205
205
  props: { lazyLoad: true },
206
- $setStateCollection: ({ state }) => mapSequence(state, sortSequence)
206
+ $setStateCollection: ({ state }) => {
207
+ const sequence = state.parse()
208
+ return Object.values(sequence) || {}
209
+ }
207
210
  },
208
211
 
209
212
  actionButtons
@@ -4,7 +4,6 @@ import { SectionHeader, ColorTemplate, Flex } from '@symbo.ls/components'
4
4
 
5
5
  const mapColors = (el, s) => {
6
6
  const COLOR = s.parse()
7
- console.log(s)
8
7
  const colorKeys = Object.keys(COLOR)
9
8
  return colorKeys.map(v => ({ key: v, value: COLOR[v] }))
10
9
  }
@@ -4,7 +4,6 @@ import { ThemeTemplate, SectionHeader, Grid } from '@symbo.ls/components'
4
4
 
5
5
  const mapThemes = (el, s) => {
6
6
  const THEME = s.parse()
7
- console.log(s)
8
7
  const themeKeys = Object.keys(THEME)
9
8
  return themeKeys.map(v => ({ ...THEME[v], key: v }))
10
9
  }
@@ -4,8 +4,7 @@ import { Grid, Hoverable, FontObject } from '@symbo.ls/components'
4
4
  import { TypeSection } from '../Typography/shared'
5
5
 
6
6
  const mapFonts = (el, s) => {
7
- if (!s.__projectSystem) return
8
- const { FONT } = s.__projectSystem
7
+ const FONT = s.parse()
9
8
  const fontKeys = Object.keys(FONT)
10
9
 
11
10
  return fontKeys.map(v => {
@@ -26,6 +25,7 @@ const mapFonts = (el, s) => {
26
25
 
27
26
  export default {
28
27
  extend: TypeSection,
28
+ state: 'FONT',
29
29
  header: {
30
30
  state: {
31
31
  title: 'Document Fonts',
@@ -4,8 +4,7 @@ import { Grid, Hoverable, FontFamilyObject } from '@symbo.ls/components'
4
4
  import { TypeSection } from '../Typography/shared'
5
5
 
6
6
  const mapFontFamilies = (el, s) => {
7
- if (!s.__projectSystem) return
8
- const { FONT_FAMILY } = s.__projectSystem
7
+ const FONT_FAMILY = s.parse()
9
8
  const fontFamilyKeys = Object.keys(FONT_FAMILY)
10
9
 
11
10
  return fontFamilyKeys.map(v => {
@@ -21,6 +20,8 @@ const mapFontFamilies = (el, s) => {
21
20
 
22
21
  export default {
23
22
  extend: TypeSection,
23
+ state: 'FONT_FAMILY',
24
+
24
25
  header: {
25
26
  state: {
26
27
  title: 'Font Families',
@@ -6,7 +6,8 @@ import fontFamilies from './fontFamilies'
6
6
  import { state } from './state'
7
7
 
8
8
  export const Fonts = {
9
- state,
9
+ state: 'PROJECT_SYSTEM',
10
+ on: { stateCreated: (el, s) => s.update(state, { preventUpdate: true }) },
10
11
 
11
12
  fontFaces,
12
13
  line3: { extend: 'Line' },
@@ -37,6 +37,9 @@ const ButtonOptions = {
37
37
  extend: [ClickableItem, WiderButton, TooltipParent],
38
38
  props: ({ key, state, parent }) => ({
39
39
  active: state[parent.parent.key] === key.toLowerCase(),
40
+ '.active': {
41
+ opacity: 1
42
+ },
40
43
 
41
44
  style: {
42
45
  '&:hover, &:focus-visible': {
@@ -62,7 +62,9 @@ const modes = {
62
62
  }),
63
63
 
64
64
  icon: {},
65
- article: {},
65
+ article: {
66
+
67
+ },
66
68
 
67
69
  ThemeButtons: {
68
70
  position: 'absolute',
@@ -81,6 +83,7 @@ const modes = {
81
83
  fontSize: 'Z',
82
84
  color: 'gray7',
83
85
  fontStyle: 'italic',
86
+ pointerEvents: 'none',
84
87
  margin: 'C 0 0 X2',
85
88
  text: 'click to change'
86
89
  },
@@ -145,16 +148,6 @@ export const CreateDocumentTheme = {
145
148
 
146
149
  const colorRef = {}
147
150
 
148
- if (light) {
149
- colorRef.light = {
150
- key: 'light',
151
- title: 'Day',
152
- icon: 'sun',
153
- color: COLOR[light.color] || light.color || '#000000',
154
- background: COLOR[light.background] || light.background || '#FFFFFF'
155
- }
156
- }
157
-
158
151
  if (dark) {
159
152
  colorRef.dark = {
160
153
  key: 'dark',
@@ -165,6 +158,16 @@ export const CreateDocumentTheme = {
165
158
  }
166
159
  }
167
160
 
161
+ if (light) {
162
+ colorRef.light = {
163
+ key: 'light',
164
+ title: 'Day',
165
+ icon: 'sun',
166
+ color: COLOR[light.color] || light.color || '#000000',
167
+ background: COLOR[light.background] || light.background || '#FFFFFF'
168
+ }
169
+ }
170
+
168
171
  state.update({
169
172
  values: colorRef
170
173
  }, { preventUpdate: true, ignoreInitUpdate: true })
@@ -41,7 +41,7 @@ export const Personalize = {
41
41
  },
42
42
 
43
43
  Flex: {
44
- props: { gap: 'D1' },
44
+ props: { gap: 'D1', align: 'flex-start' },
45
45
 
46
46
  icon,
47
47
  fields
@@ -2,10 +2,10 @@
2
2
 
3
3
  import { mapSequence, sortSequence } from '@symbo.ls/components'
4
4
  import sequence from './sequence'
5
- import state from './state'
5
+ import templates from './templates'
6
6
 
7
7
  export const Spaces = {
8
- state,
8
+ state: 'PROJECT_SYSTEM',
9
9
 
10
10
  SectionHeader: {
11
11
  margin: '0 0 C',
@@ -13,20 +13,53 @@ export const Spaces = {
13
13
  p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
14
14
  },
15
15
 
16
- SlidersWithResponsive: {},
16
+ cnt: {
17
+ state: 'SPACING',
17
18
 
18
- Line: {},
19
+ SlidersWithResponsive: {},
19
20
 
20
- sequence,
21
+ Line: {},
21
22
 
22
- on: {
23
- init: (el, s) => {},
24
- stateUpdated: (el, s, changes) => {
25
- s.projectSystemUpdate({
26
- SPACING: changes
27
- }, {
28
- preventUpdate: true
29
- })
23
+ templates,
24
+
25
+ Line_2: {},
26
+
27
+ sequence,
28
+
29
+ on: {
30
+ stateCreated: (el, s) => {
31
+ s.update({
32
+ base: s.base || 16,
33
+ ratio: s.ratio || 1.618,
34
+ range: s.range || [-5, +12],
35
+ subSequence: s.subSequence || true,
36
+ templates: s.templates || {},
37
+ scales: {},
38
+ sequence: {},
39
+ vars: {},
40
+ props: {},
41
+ type: 'demo-spacing',
42
+ sampleText: 'Today is a big day for our tribe. The year ends.'
43
+ }, {
44
+ preventUpdate: true,
45
+ preventUpdateListener: true
46
+ })
47
+
48
+ if (s.base && s.range) s.sequence = mapSequence(s, sortSequence)
49
+ },
50
+ stateUpdated: (el, s, changes) => {
51
+ const { base, ratio, range, subSequence } = changes
52
+
53
+ s.update({
54
+ base,
55
+ ratio,
56
+ range,
57
+ subSequence
58
+ }, {
59
+ preventUpdate: true,
60
+ preventUpdateListener: true
61
+ })
62
+ }
30
63
  }
31
64
  }
32
65
  }
@@ -27,6 +27,8 @@ export default {
27
27
  preview: { flex: 1 }
28
28
  },
29
29
 
30
- SpacingTable: {}
30
+ SpacingTable: {
31
+ state: 'sequence'
32
+ }
31
33
  }
32
34
  }
@@ -0,0 +1,37 @@
1
+ 'use strict'
2
+
3
+ import { Flex } from '@symbo.ls/components'
4
+
5
+ export default {
6
+ extend: [Flex],
7
+
8
+ state: 'templates',
9
+
10
+ props: {
11
+ flow: 'column',
12
+ gap: 'C1'
13
+ },
14
+
15
+ SectionHeader: {
16
+ title: 'Templates',
17
+ p: 'Spacing scale is a set of values that are used to define the padding, margin, gap and width of components.',
18
+ margin: '0'
19
+ },
20
+
21
+ cnt: {
22
+ extend: Flex,
23
+ props: { columns: 'repeat(3, 1fr)' },
24
+
25
+ $setStateCollection: (el, s) => {
26
+ const SPACING = s.parse()
27
+ const templates = SPACING.templates || {}
28
+
29
+ const HELPERS = Object.keys(templates)
30
+ .filter(v => v.slice(0, 1) === '.')
31
+
32
+ el.removeContent()
33
+
34
+ return HELPERS
35
+ }
36
+ }
37
+ }
@@ -25,8 +25,8 @@ export const buttonTitlesGrid = {
25
25
  justiyItems: 'start',
26
26
  padding: 'B2 - - -',
27
27
  columns: 'repeat(4, auto)',
28
- gap: 'B2+W1',
29
- width: 'fit-content',
28
+ gap: 'C1',
29
+ width: '100%',
30
30
  justifyItems: 'start',
31
31
  '@tabletL': { columns: 'repeat(3, auto)' },
32
32
  '@tabletM': { columns: 'repeat(2, auto)' },
@@ -20,14 +20,14 @@ export const buttonsHeader = {
20
20
  extend: Flex,
21
21
  props,
22
22
 
23
- childExtend: { extend: IconButton },
24
- ...[
25
- { props: { icon: 'cursorOutline' } },
26
- { props: { icon: 'clickOutline' } },
27
- { props: { icon: 'clickOutline' } },
28
- { props: { icon: 'focusOutline' } },
29
- { props: { icon: 'selection' } },
30
- { props: { icon: 'colorInvert' } },
31
- { props: { icon: 'accessibilityOutline' } }
23
+ childExtend: IconButton,
24
+ $setPropsCollection: () => [
25
+ { icon: 'cursorOutline' },
26
+ { icon: 'clickOutline' },
27
+ { icon: 'clickOutline' },
28
+ { icon: 'focusOutline' },
29
+ { icon: 'selection' },
30
+ { icon: 'colorInvert' },
31
+ { icon: 'accessibilityOutline' }
32
32
  ]
33
33
  }
@@ -5,7 +5,6 @@ import {
5
5
  Button,
6
6
  Flex,
7
7
  SectionHeader,
8
- AccessibilityCheck,
9
8
  Pseudo,
10
9
  CommonField
11
10
  } from '@symbo.ls/components'
@@ -16,14 +15,12 @@ import { buttonsHeader } from './buttonsHeader'
16
15
  import { selectsGrid } from './selectsGrid'
17
16
  import { buttonTitlesGrid, columnTitleButton } from './buttonTitlesGrid'
18
17
 
19
- import style from './style'
20
-
21
18
  const ThemeNameField = {
22
19
  tag: 'label',
23
20
  attr: { for: 'name-it' },
24
21
  extend: CommonField,
25
22
 
26
- props: ({ state }) => ({
23
+ props: {
27
24
  gap: '0',
28
25
  title: {
29
26
  text: 'Name the theme',
@@ -42,18 +39,17 @@ const ThemeNameField = {
42
39
  border: 'dashed, gray3',
43
40
  borderWidth: '0 0 1px',
44
41
 
45
- text: state.themeName,
46
-
47
42
  ':empty::before': {
48
43
  content: '"You name it"',
49
44
  color: 'gray5'
50
45
  }
51
46
  }
52
- }),
47
+ },
53
48
 
54
49
  title: {},
55
50
  element: {
56
51
  extend: Pseudo,
52
+ text: ({ state }) => state.themeName,
57
53
  attr: { contentEditable: true, id: 'name-it' }
58
54
  }
59
55
  }
@@ -137,42 +133,11 @@ export const Theme = {
137
133
 
138
134
  extend: PageTemplate,
139
135
 
140
- style,
136
+ state: 'PROJECT_SYSTEM',
137
+
141
138
  props: {
142
139
  padding: '- D2 - -',
143
- boxSizing: 'border-box',
144
- '@screenL': { fontSize: '20px' },
145
- '@screenM': { fontSize: '17px' },
146
- '@screenS': { fontSize: 'A' },
147
- style: {
148
- paddingLeft: '0',
149
- '@media only screen and (min-width: 1920px)': { fontSize: '22px' }
150
- }
151
- },
152
-
153
- state: {
154
- sceneTheme: 'dark',
155
- title: 'Typography',
156
- p: 'A general configuration of type properties on the document.'
157
- },
158
-
159
- on: {
160
- init: (el, s) => {
161
- if (!s.__projectSystem) return
162
- const path = window.location.pathname
163
- const pathArray = path.split('theme/')
164
- if (!s.__projectSystem) return
165
- const { THEME } = s.__projectSystem
166
- const themeName = pathArray[1]
167
- var value = THEME[themeName]
168
-
169
- if (themeName && value) {
170
- s.update({
171
- themeName,
172
- value
173
- }, { preventUpdate: true })
174
- }
175
- }
140
+ boxSizing: 'border-box'
176
141
  },
177
142
 
178
143
  header: {
@@ -180,7 +145,6 @@ export const Theme = {
180
145
  props: {
181
146
  margin: '0 - B2 0',
182
147
  justifyContent: 'space-between'
183
- // border: '2px solid purple'
184
148
  },
185
149
  heading: null,
186
150
  ThemeNameField,
@@ -191,16 +155,18 @@ export const Theme = {
191
155
 
192
156
  cnt: {
193
157
  extend: Flex,
194
- props: { gap: 'C2', padding: '0' },
158
+ props: { gap: 'C2', margin: 'Z 0 0' },
159
+ state: 'THEME',
195
160
 
196
161
  preview,
197
162
 
198
163
  colorEdit: {
164
+ state: window.location.pathname.split('theme/')[1],
165
+
199
166
  props: {
200
167
  flex: '1',
201
168
  gap: '',
202
169
  flexFlow: 'column'
203
- // border: '5px solid red'
204
170
  },
205
171
 
206
172
  colors: {
@@ -208,44 +174,34 @@ export const Theme = {
208
174
  padding: '- - C1 -',
209
175
  border: 'solid, gray2',
210
176
  borderWidth: '0 0 1px 0'
211
- // style: { borderBottom: '.5px solid rgba(255, 255, 255, .1)' }
212
177
  },
213
178
  selectsGrid,
214
179
  buttonTitlesGrid
215
180
  },
216
181
 
217
- onHover: {
218
- extend: CommonField,
219
- props: {
220
- border: 'solid, gray2',
221
- borderWidth: '0 0 1px 0',
222
- gap: 'B2',
223
- padding: 'B - C1 -',
224
- title: {
225
- text: ':hover',
226
- color: 'white'
227
- }
182
+ selectors: {
183
+ childExtend: {
184
+ extend: CommonField,
185
+ state: true,
186
+ props: ({ key }) => ({
187
+ border: 'solid, gray2',
188
+ borderWidth: '0 0 1px 0',
189
+ gap: 'B2',
190
+ padding: 'B - C1 -',
191
+ title: {
192
+ text: key,
193
+ color: 'white'
194
+ }
195
+ }),
196
+ title: {},
197
+ element: { extend: selectsGrid }
228
198
  },
229
- title: {},
230
- element: {
231
- extend: selectsGrid
232
- }
233
- },
234
199
 
235
- onHover2: {
236
- extend: CommonField,
237
- props: {
238
- gap: 'B2',
239
- padding: 'B - - -',
240
- title: {
241
- text: ':hover',
242
- color: 'white'
243
- }
244
- },
245
- title: {},
246
- element: {
247
- extend: selectsGrid
248
- }
200
+ ':hover': {},
201
+ ':focus': {},
202
+ ':active': {},
203
+ ':selection': {},
204
+ ':disabled': {}
249
205
  },
250
206
 
251
207
  friendThemes: {
@@ -262,12 +218,9 @@ export const Theme = {
262
218
  iconBox: {}
263
219
  }
264
220
  }
265
- },
266
-
267
- check: {
268
- extend: AccessibilityCheck,
269
- props: {
270
- padding: 'E 0 F'
271
- }
272
221
  }
222
+
223
+ // AccessibilityCheck: {
224
+ // padding: 'E 0 F'
225
+ // },
273
226
  }
@@ -43,9 +43,7 @@ export const Tones = {
43
43
  export default {
44
44
  tag: 'aside',
45
45
  extend: Flex,
46
- props: {
47
- flow: 'column'
48
- },
46
+ props: { flow: 'column' },
49
47
 
50
48
  preview: {
51
49
  props: (el, s) => ({
@@ -68,7 +66,8 @@ export default {
68
66
  },
69
67
  circle: {
70
68
  props: (el, s) => ({
71
- theme: `${s.themeName} @${s.sceneTheme}`,
69
+ theme: window.location.pathname.split('theme/')[1],
70
+ themeModifier: s.sceneTheme,
72
71
  flexFlow: 'column',
73
72
  flexAlign: 'center center',
74
73
  width: 'G',
@@ -94,14 +93,14 @@ export default {
94
93
  },
95
94
  text: 'Text Color'
96
95
  },
97
- Span: {
98
- text: (el, s) => s.themeName,
96
+ Span: (el, s) => ({
97
+ text: s.themeName,
99
98
  position: 'absolute',
100
99
  top: '86%',
101
100
  left: '50%',
102
101
  transform: 'translate(-50%, -50%)',
103
102
  fontWeight: '600'
104
- }
103
+ })
105
104
  }
106
105
  }
107
106
  },
@@ -117,8 +116,8 @@ export default {
117
116
  padding: '0 0 Z1 0',
118
117
  opacity: '.65'
119
118
  }
120
- },
121
- tones: { extend: Tones }
119
+ }
120
+ // tones: { extend: Tones }
122
121
  },
123
122
 
124
123
  shades: {
@@ -2,72 +2,73 @@
2
2
 
3
3
  import { CommonField, ColorSelect, Grid } from '@symbo.ls/components'
4
4
 
5
+ const ColorDropwdown = {
6
+ extend: CommonField,
7
+ tag: 'div',
8
+ state: true,
9
+
10
+ props: (el, s) => ({
11
+ width: '100%',
12
+ title: {
13
+ text: s.title
14
+ },
15
+ element: {
16
+ width: '100%',
17
+ height: 'B2+W',
18
+ padding: '0 W1 0 Z1',
19
+ title: {
20
+ box: { background: s.value },
21
+ value: { text: s.value }
22
+ },
23
+ buttons: {
24
+ gap: 'W',
25
+ childProps: {
26
+ boxSize: 'fit-content',
27
+ padding: 'W1+W1'
28
+ }
29
+ }
30
+ }
31
+ }),
32
+
33
+ title: {},
34
+ element: { extend: ColorSelect }
35
+ }
36
+
5
37
  export const selectsGrid = {
6
38
  extend: Grid,
7
39
  props: {
8
40
  columns: 'repeat(4, auto)',
9
- style: { width: 'fit-content' },
10
- gap: 'B2+W1',
41
+ width: '100%',
42
+ gap: 'C1',
11
43
  justifyItems: 'start',
12
44
  '@tabletL': { columns: 'repeat(3, auto)' },
13
45
  '@tabletM': { columns: 'repeat(2, auto)' }
14
46
  },
15
47
 
16
- childExtend: {
17
- extend: CommonField,
18
- tag: 'div',
19
- props: (el, s) => ({
20
- width: 'F+Z',
21
- title: {
22
- text: s.title,
23
- fontSize: 'Z'
24
- },
25
- element: {
26
- width: '100%',
27
- height: 'B2+W',
28
- padding: '0 W1 0 Z1',
29
- title: {
30
- box: {
31
- background: s.color,
32
- display: s.colorDisplay
33
- },
34
- value: {
35
- text: s.name,
36
- fontSize: 'Z1'
37
- }
38
- },
39
- buttons: {
40
- gap: 'W',
41
- childProps: {
42
- boxSize: 'fit-content',
43
- padding: 'W1+W1'
44
- }
45
- }
46
- }
47
- }),
48
-
49
- title: {},
50
- element: {
51
- extend: ColorSelect
52
- }
53
- },
48
+ childExtend: ColorDropwdown,
54
49
 
55
- $setStateCollection: () => [{
56
- title: 'Background color',
57
- color: 'red',
58
- name: 'red'
50
+ color: {},
51
+ backgroundColor: {},
52
+ borderColor: {},
53
+ opacity: {},
59
54
 
60
- }, {
61
- title: 'Border color',
62
- name: 'none',
63
- colorDisplay: 'none'
64
- }, {
65
- title: 'Border color',
66
- name: 'none',
67
- colorDisplay: 'none'
68
- }, {
69
- title: 'Text color',
70
- color: 'white',
71
- name: 'white'
72
- }]
55
+ $setCollection: ({ state }) => {
56
+ // return [{
57
+ // title: 'Background color',
58
+ // color: 'red',
59
+ // name: 'red'
60
+ // }, {
61
+ // title: 'Border color',
62
+ // name: 'none',
63
+ // colorDisplay: 'none'
64
+ // }, {
65
+ // title: 'Border color',
66
+ // name: 'none',
67
+ // colorDisplay: 'none'
68
+ // }, {
69
+ // title: 'Text color',
70
+ // color: 'white',
71
+ // name: 'white'
72
+ // }]
73
+ }
73
74
  }
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
- import typeScale from './typeScale'
4
3
  import documentStyles from './documentStyles'
5
4
  import stylesHelpers from './stylesHelpers'
5
+ import typeScale from './typeScale'
6
6
  import { mapSequence, sortSequence } from '@symbo.ls/components'
7
7
 
8
8
  export const Typography = {
@@ -19,13 +19,13 @@ export const Typography = {
19
19
 
20
20
  SlidersWithResponsive: {},
21
21
 
22
- line: { extend: 'Line' },
22
+ Line: {},
23
23
 
24
24
  documentStyles,
25
- line1: { extend: 'Line' },
25
+ Line_1: {},
26
26
 
27
27
  stylesHelpers,
28
- line2: { extend: 'Line' },
28
+ Line_2: {},
29
29
 
30
30
  typeScale,
31
31
 
@@ -35,7 +35,7 @@ export const Typography = {
35
35
  base: s.base || 16,
36
36
  ratio: s.ratio || 1.125,
37
37
  range: s.range || [-3, +8],
38
- subsequence: s.subsequence || true,
38
+ subSequence: s.subSequence || true,
39
39
  styles: s.styles || {},
40
40
  h1Matches: s.h1Matches || +6,
41
41
  scales: {},
@@ -48,16 +48,18 @@ export const Typography = {
48
48
  preventUpdateListener: true
49
49
  })
50
50
 
51
- if (s.base && s.range) mapSequence(s, sortSequence)
51
+ console.log(s.parse())
52
+ if (s.base && s.range && s.type) mapSequence(s, sortSequence)
52
53
  },
53
54
  stateUpdated: (el, s, changes) => {
54
- const { base, ratio, range, subsequence, h1Matches } = changes
55
+ const { base, ratio, range, subSequence, h1Matches, type } = changes
55
56
 
56
57
  s.update({
57
58
  base,
58
59
  ratio,
59
60
  range,
60
- subsequence,
61
+ subSequence,
62
+ type,
61
63
  h1Matches
62
64
  }, {
63
65
  preventUpdate: true,
@@ -4,9 +4,7 @@ import {
4
4
  TypeScaleSequence,
5
5
  TestText,
6
6
  Flex,
7
- Grid,
8
- mapSequence,
9
- sortSequence
7
+ Grid
10
8
  } from '@symbo.ls/components'
11
9
 
12
10
  import { range0Buttons, range1Buttons } from './rangeButtons'
@@ -25,7 +23,7 @@ export default {
25
23
  top: 'E'
26
24
  },
27
25
 
28
- content: {
26
+ cnt: {
29
27
  overflow: 'hidden',
30
28
  flex: '1',
31
29
  flow: 'column',
@@ -61,7 +59,7 @@ export default {
61
59
  }
62
60
  },
63
61
 
64
- content: {
62
+ cnt: {
65
63
  extend: Flex,
66
64
 
67
65
  header: {
@@ -72,12 +70,11 @@ export default {
72
70
 
73
71
  sequence: {
74
72
  extend: TypeScaleSequence,
75
- $setStateCollection: (el) => {
73
+ state: true,
74
+ $setStateCollection: (el, s) => {
76
75
  const { state } = el
77
- // return state.sequence
78
- // state.sequence = {}
79
- // el.removeContent()
80
- if (state.base && state.range) { return mapSequence(state, sortSequence) }
76
+ const sequence = state.parse()
77
+ return Object.values(sequence).reverse() || {}
81
78
  }
82
79
  },
83
80
 
@@ -1,20 +0,0 @@
1
- 'use strict'
2
-
3
- import { SPACING } from '@symbo.ls/scratch'
4
-
5
- export default ({ parent }) => {
6
- const rootState = parent.state
7
- const spacing = rootState.__projectSystem.SPACING || {}
8
-
9
- return {
10
- base: spacing.base || SPACING.base,
11
- ratio: spacing.ratio || SPACING.ratio,
12
- subSequence: spacing.subSequence || SPACING.subSequence || true,
13
- range: spacing.range || SPACING.range || [-5, +12],
14
- scales: {},
15
- sequence: {},
16
- vars: {},
17
- type: 'spacing-scale',
18
- props: {}
19
- }
20
- }