@symbo.ls/preview 2.7.16 → 2.7.17

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.16",
5
+ "version": "2.7.17",
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",
@@ -53,6 +53,7 @@ const propertyNumber = {
53
53
 
54
54
  const componentProperties = {
55
55
  extend: Flex,
56
+ state: 'properties',
56
57
  props: {
57
58
  padding: 'Z2 A',
58
59
  flow: 'column',
@@ -60,7 +61,7 @@ const componentProperties = {
60
61
  background: 'gray1'
61
62
  },
62
63
  childExtend: propertyNumber,
63
- $setStateCollection: ({ state }) => state.properties
64
+ $setStateCollection: ({ state }) => state.parse()
64
65
  }
65
66
 
66
67
  export const DesignComponent = {
@@ -14,9 +14,13 @@ const IconItem = {
14
14
  flexAlign: 'center center',
15
15
  href: '/icons/edit-icon/' + state.value,
16
16
  theme: 'tertiary',
17
+ transitionProperty: 'transform, opacity, border-radius',
17
18
  icon: {
18
19
  fontSize: 'C2',
19
20
  name: state.value
21
+ },
22
+ ':hover': {
23
+ round: '0'
20
24
  }
21
25
  }),
22
26
 
@@ -3,6 +3,8 @@
3
3
  import { GlobalThemeTemplate, Flex, SectionHeader, Link, ClickableItem } from '@symbo.ls/components'
4
4
 
5
5
  export default {
6
+ state: 'THEME',
7
+
6
8
  header: {
7
9
  extend: SectionHeader,
8
10
  state: {
@@ -3,13 +3,14 @@
3
3
  import { SectionHeader, ColorTemplate, Flex } from '@symbo.ls/components'
4
4
 
5
5
  const mapColors = (el, s) => {
6
- const { COLOR } = s.__projectSystem
7
- if (!COLOR) return
6
+ const COLOR = s.parse()
8
7
  const colorKeys = Object.keys(COLOR)
9
8
  return colorKeys.map(v => ({ key: v, value: COLOR[v] }))
10
9
  }
11
10
 
12
11
  export default {
12
+ state: 'COLOR',
13
+
13
14
  header: {
14
15
  extend: SectionHeader,
15
16
  state: {
@@ -22,7 +23,7 @@ export default {
22
23
  }
23
24
  },
24
25
 
25
- content: {
26
+ cnt: {
26
27
  extend: Flex,
27
28
  props: {
28
29
  flow: 'row wrap',
@@ -3,8 +3,7 @@
3
3
  import { ThemeTemplate, SectionHeader, Grid } from '@symbo.ls/components'
4
4
 
5
5
  const mapThemes = (el, s) => {
6
- const { THEME } = s.__projectSystem
7
- if (!THEME) return
6
+ const THEME = s.parse()
8
7
  const themeKeys = Object.keys(THEME)
9
8
  return themeKeys.map(v => ({ ...THEME[v], key: v }))
10
9
  }
@@ -22,7 +21,7 @@ export default {
22
21
  }
23
22
  },
24
23
 
25
- content: {
24
+ cnt: {
26
25
  extend: Grid,
27
26
  props: {
28
27
  columns: 'repeat(5, 1fr)',
@@ -31,6 +30,6 @@ export default {
31
30
  },
32
31
 
33
32
  childExtend: ThemeTemplate,
34
- $setStateCollection: (el, s) => mapThemes(el, s)
33
+ $setStateCollection: mapThemes
35
34
  }
36
35
  }
@@ -13,7 +13,7 @@ export default {
13
13
 
14
14
  props: {
15
15
  align: 'stretch space-between',
16
- margin: 'C1 -Z1',
16
+ margin: '-A -Z1 B',
17
17
  gap: 'B1'
18
18
  },
19
19
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Flex } from '@symbo.ls/components'
4
4
 
5
- import banners from './banners' // eslint-disable-line no-unused-vars
5
+ import banners from './banners'
6
6
  import summary from './summary'
7
7
  import quickstart from './quickstart'
8
8
 
@@ -16,7 +16,7 @@ export const DesignSystemDashboard = {
16
16
  p: { text: 'Create your Design System guidelines' }
17
17
  },
18
18
 
19
- // banners,
19
+ banners,
20
20
  summary,
21
21
  quickstart
22
22
  }
@@ -26,7 +26,6 @@ export default {
26
26
 
27
27
  Flex: {
28
28
  props: {
29
- // display: 'inline-flex',
30
29
  gap: 'D1',
31
30
  align: 'flex-start space-between',
32
31
  childProps: {
@@ -43,7 +42,7 @@ export default {
43
42
  Terminal: {
44
43
  note: { text: 'Install Symbols to your project' },
45
44
  props: {
46
- command: { text: 'npm i smbls -g' }
45
+ command: { text: 'npm i smbls --save' }
47
46
  }
48
47
  }
49
48
  },
@@ -63,12 +62,11 @@ export default {
63
62
  extend: 'QuickStartCode',
64
63
  QuickStartNumber: { text: '3' },
65
64
  Code: {
65
+ props: {},
66
66
  note: { text: 'Create .symbolsrc.js file in your project and insert your Symbols key' },
67
- props: ({ state }) => ({
68
- code: {
69
- text: `{ "key": "${state.appKey}" }`
70
- }
71
- })
67
+ code: {
68
+ text: ({ state }) => `{ "key": "${state.appKey}" }`
69
+ }
72
70
  }
73
71
  },
74
72
 
@@ -1,10 +1,7 @@
1
1
  'use strict'
2
2
 
3
- export default ({ parent }) => {
4
- const { state } = parent
5
- const { __projectSystem } = state
6
-
7
- if (!__projectSystem) return
3
+ export const applySummaryCollection = (el, s) => {
4
+ if (!s) return
8
5
  const {
9
6
  COLOR,
10
7
  THEME,
@@ -16,130 +13,130 @@ export default ({ parent }) => {
16
13
  TIMING,
17
14
  MEDIA,
18
15
  DEVICES
19
- } = __projectSystem
16
+ } = s
17
+
18
+ if (!COLOR) return
20
19
 
21
- return {
22
- data: [{
23
- icon: 'colorOutline',
24
- href: '/colors',
25
- iconTheme: 'theme',
26
- title: 'colors',
27
- paragraph: 'Colorize styles manually',
28
- iconBackground: 'red',
29
- properties: [{
30
- property: 'Colors',
31
- value: COLOR && Object.keys(COLOR).length
32
- }, {
33
- property: 'Themes',
34
- value: THEME && Object.keys(THEME).length
35
- }]
20
+ return [{
21
+ icon: 'colorOutline',
22
+ href: '/colors',
23
+ iconTheme: 'theme',
24
+ title: 'colors',
25
+ paragraph: 'Colorize styles manually',
26
+ iconBackground: 'red',
27
+ properties: [{
28
+ property: 'Colors',
29
+ value: COLOR && Object.keys(COLOR).length
30
+ }, {
31
+ property: 'Themes',
32
+ value: THEME && Object.keys(THEME).length
33
+ }]
34
+ }, {
35
+ icon: 'typographyOutline',
36
+ href: '/typography',
37
+ iconTheme: 'typography',
38
+ title: 'typography',
39
+ paragraph: 'style a typed material',
40
+ properties: [{
41
+ property: 'Base size',
42
+ value: TYPOGRAPHY && TYPOGRAPHY.base + 'px'
43
+ }, {
44
+ property: 'Ratio',
45
+ value: TYPOGRAPHY && TYPOGRAPHY.ratio
46
+ }, {
47
+ property: 'Styles',
48
+ value: TYPOGRAPHY && TYPOGRAPHY.styles && Object.keys(TYPOGRAPHY.styles).length
49
+ }, {
50
+ property: 'Fonts',
51
+ value: FONT && Object.keys(FONT).length
52
+ }, {
53
+ property: 'Families',
54
+ value: FONT_FAMILY && Object.keys(FONT_FAMILY).length - 1
55
+ }]
56
+ }, {
57
+ icon: 'spaceOutline',
58
+ href: '/space',
59
+ iconTheme: 'space',
60
+ title: 'Spacing',
61
+ paragraph: 'Manage properties of a size',
62
+ properties: [{
63
+ property: 'Ratio',
64
+ value: SPACING && SPACING.ratio
65
+ }, {
66
+ property: 'Templates',
67
+ value: 'TBA'
68
+ }]
69
+ }, {
70
+ icon: 'shape',
71
+ href: '/shape',
72
+ iconTheme: 'shape',
73
+ title: 'shapes',
74
+ paragraph: 'Design an outline to a chosen component',
75
+ properties: [{
76
+ property: 'HTML',
77
+ value: '32'
78
+ }, {
79
+ property: 'SVG',
80
+ value: 'TBA'
81
+ }]
82
+ }, {
83
+ icon: 'iconsOutline',
84
+ href: '/icons',
85
+ iconTheme: 'color',
86
+ title: 'Icons',
87
+ paragraph: 'Label a role of subject with glyphs',
88
+ properties: [{
89
+ property: 'All',
90
+ value: ICONS && Object.keys(ICONS).length
36
91
  }, {
37
- icon: 'typographyOutline',
38
- href: '/typography',
39
- iconTheme: 'typography',
40
- title: 'typography',
41
- paragraph: 'style a typed material',
42
- properties: [{
43
- property: 'Base size',
44
- value: TYPOGRAPHY && TYPOGRAPHY.base + 'px'
45
- }, {
46
- property: 'Ratio',
47
- value: TYPOGRAPHY && TYPOGRAPHY.ratio
48
- }, {
49
- property: 'Styles',
50
- value: TYPOGRAPHY && TYPOGRAPHY.styles && Object.keys(TYPOGRAPHY.styles).length
51
- }, {
52
- property: 'Fonts',
53
- value: FONT && Object.keys(FONT).length
54
- }, {
55
- property: 'Families',
56
- value: FONT_FAMILY && Object.keys(FONT_FAMILY).length - 1
57
- }]
92
+ property: 'Linear',
93
+ value: ICONS && Object.keys(ICONS).filter(v => v.includes('Outline')).length
58
94
  }, {
59
- icon: 'spaceOutline',
60
- href: '/space',
61
- iconTheme: 'space',
62
- title: 'Spacing',
63
- paragraph: 'Manage properties of a size',
64
- properties: [{
65
- property: 'Ratio',
66
- value: SPACING && SPACING.ratio
67
- }, {
68
- property: 'Templates',
69
- value: 'TBA'
70
- }]
95
+ property: 'Colored',
96
+ value: ICONS && Object.keys(ICONS).filter(v => v.includes('Colored')).length
97
+ }]
98
+ }, {
99
+ icon: 'clock',
100
+ href: '/timing',
101
+ iconTheme: 'icons',
102
+ title: 'Timing',
103
+ paragraph: 'Tokens for transitions and animations',
104
+ properties: [{
105
+ property: 'Timing base',
106
+ value: TIMING && TIMING.base + 'ms'
71
107
  }, {
72
- icon: 'shape',
73
- href: '/shape',
74
- iconTheme: 'shape',
75
- title: 'shapes',
76
- paragraph: 'Design an outline to a chosen component',
77
- properties: [{
78
- property: 'HTML',
79
- value: '32'
80
- }, {
81
- property: 'SVG',
82
- value: 'TBA'
83
- }]
108
+ property: 'Ratio',
109
+ value: TIMING && TIMING.ratio
84
110
  }, {
85
- icon: 'iconsOutline',
86
- href: '/icons',
87
- iconTheme: 'color',
88
- title: 'Icons',
89
- paragraph: 'Label a role of subject with glyphs',
90
- properties: [{
91
- property: 'All',
92
- value: ICONS && Object.keys(ICONS).length
93
- }, {
94
- property: 'Linear',
95
- value: ICONS && Object.keys(ICONS).filter(v => v.includes('Outline')).length
96
- }, {
97
- property: 'Colored',
98
- value: ICONS && Object.keys(ICONS).filter(v => v.includes('Colored')).length
99
- }]
111
+ property: 'Transitions',
112
+ value: 'TBA'
100
113
  }, {
101
- icon: 'clock',
102
- href: '/timing',
103
- iconTheme: 'icons',
104
- title: 'Timing',
105
- paragraph: 'Tokens for transitions and animations',
106
- properties: [{
107
- property: 'Timing base',
108
- value: TIMING && TIMING.base + 'ms'
109
- }, {
110
- property: 'Ratio',
111
- value: TIMING && TIMING.ratio
112
- }, {
113
- property: 'Transitions',
114
- value: 'TBA'
115
- }, {
116
- property: 'Animations',
117
- value: 'TBA'
118
- }]
114
+ property: 'Animations',
115
+ value: 'TBA'
116
+ }]
117
+ }, {
118
+ icon: 'deviceMobileOutline',
119
+ href: '/media-query',
120
+ title: 'Breakpoints',
121
+ paragraph: 'Label a role of subject with glyphs',
122
+ properties: [{
123
+ property: 'Breakpoints',
124
+ value: MEDIA && Object.keys(MEDIA).length
119
125
  }, {
120
- icon: 'deviceMobileOutline',
121
- href: '/media-query',
122
- title: 'Breakpoints',
123
- paragraph: 'Label a role of subject with glyphs',
124
- properties: [{
125
- property: 'Breakpoints',
126
- value: MEDIA && Object.keys(MEDIA).length
127
- }, {
128
- property: 'Screens',
129
- value: DEVICES && Object.keys(DEVICES).length
130
- }]
126
+ property: 'Screens',
127
+ value: DEVICES && Object.keys(DEVICES).length
128
+ }]
129
+ }, {
130
+ icon: 'threeDots',
131
+ href: '/sequence',
132
+ title: 'Sequence',
133
+ paragraph: 'The mapping system of generative sizing units',
134
+ properties: [{
135
+ property: 'Breakpoints',
136
+ value: '8'
131
137
  }, {
132
- icon: 'threeDots',
133
- href: '/sequence',
134
- title: 'Sequence',
135
- paragraph: 'The mapping system of generative sizing units',
136
- properties: [{
137
- property: 'Breakpoints',
138
- value: '8'
139
- }, {
140
- property: 'Screens',
141
- value: '3'
142
- }]
138
+ property: 'Screens',
139
+ value: '3'
143
140
  }]
144
- }
141
+ }]
145
142
  }
@@ -3,9 +3,11 @@
3
3
  import { ClickableItem, Link } from '@symbo.ls/components'
4
4
  import { DesignComponent } from '../../../components'
5
5
 
6
- import state from './state'
6
+ import { applySummaryCollection } from './state'
7
+
8
+ export const cnt = {
9
+ state: 'summary',
7
10
 
8
- export const content = {
9
11
  props: {
10
12
  margin: '- -Z',
11
13
  columns: '15rem',
@@ -14,7 +16,8 @@ export const content = {
14
16
 
15
17
  childExtend: {
16
18
  extend: [Link, ClickableItem, DesignComponent],
17
- props: () => ({
19
+ state: true,
20
+ props: ({ state }) => ({
18
21
  maxWidth: 'none',
19
22
  width: '100%',
20
23
  margin: '- - B1',
@@ -23,7 +26,7 @@ export const content = {
23
26
  })
24
27
  },
25
28
 
26
- $setStateCollection: ({ state }) => state.data
29
+ $setPropsCollection: (el, s) => s.parse()
27
30
  }
28
31
 
29
32
  export default {
@@ -31,12 +34,19 @@ export default {
31
34
  margin: '- - C1'
32
35
  },
33
36
 
34
- state,
37
+ state: 'PROJECT_SYSTEM',
35
38
 
36
39
  SectionHeader: {
37
40
  title: 'Design System takeaways',
38
41
  p: 'Your tokens in the system at a glance'
39
42
  },
40
43
 
41
- content
44
+ cnt,
45
+
46
+ on: {
47
+ initUpdate: (el, s) => {
48
+ if (s.summary) return
49
+ s.summary = applySummaryCollection(el, s)
50
+ }
51
+ }
42
52
  }
@@ -107,6 +107,8 @@ const NAV = [{
107
107
  export const DesignSystem = {
108
108
  extend: Flex,
109
109
 
110
+ state: 'PROJECT_SYSTEM',
111
+
110
112
  props: {
111
113
  margin: '-C2+X2 - -',
112
114
  padding: 'C2+X2 - -',
@@ -6,7 +6,6 @@ import {
6
6
  Flex,
7
7
  SectionHeader,
8
8
  AccessibilityCheck,
9
- SceneThemingBar,
10
9
  Pseudo,
11
10
  CommonField
12
11
  } from '@symbo.ls/components'
@@ -16,9 +15,6 @@ import preview from './preview'
16
15
  import { buttonsHeader } from './buttonsHeader'
17
16
  import { selectsGrid } from './selectsGrid'
18
17
  import { buttonTitlesGrid, columnTitleButton } from './buttonTitlesGrid'
19
- // import { themingTools } from './themingTools'
20
- // import { interactivity } from './interactivity'
21
- // import { friendTheme } from './friendTheme'
22
18
 
23
19
  import style from './style'
24
20
 
@@ -47,7 +43,7 @@ const ThemeNameField = {
47
43
  border: 'dashed, gray5',
48
44
  borderWidth: '0 0 1px',
49
45
 
50
- text: (el, s) => s.themeName,
46
+ text: state.themeName,
51
47
 
52
48
  ':empty::before': {
53
49
  content: '"You name it"',
@@ -178,7 +174,8 @@ export const Theme = {
178
174
  heading: null,
179
175
  ThemeNameField,
180
176
  nav: null,
181
- buttons: { extend: buttonsHeader }
177
+ buttons: { extend: buttonsHeader },
178
+ SceneThemingBar: {}
182
179
  },
183
180
 
184
181
  cnt: {
@@ -196,7 +193,8 @@ export const Theme = {
196
193
  colors: {
197
194
  props: {
198
195
  padding: '- - C1 -',
199
- style: { borderBottom: '.5px solid rgba(255, 255, 255, .3)' }
196
+ border: 'solid, gray3',
197
+ borderWidth: '0 0 0 1px'
200
198
  },
201
199
  selectsGrid,
202
200
  buttonTitlesGrid
@@ -205,7 +203,8 @@ export const Theme = {
205
203
  onHover: {
206
204
  extend: CommonField,
207
205
  props: {
208
- style: { borderBottom: '.5px solid rgba(255, 255, 255, .3)' },
206
+ border: 'solid, gray3',
207
+ borderWidth: '0 0 0 1px',
209
208
  gap: 'B2',
210
209
  padding: 'B - C1 -',
211
210
  title: {
@@ -248,10 +247,6 @@ export const Theme = {
248
247
  title: {},
249
248
  iconBox: {}
250
249
  }
251
-
252
- // themingTools
253
- // interactivity,
254
- // friendTheme
255
250
  }
256
251
  },
257
252
 
@@ -261,6 +256,4 @@ export const Theme = {
261
256
  padding: 'E 0 F'
262
257
  }
263
258
  }
264
-
265
- // footer
266
259
  }
@@ -24,6 +24,7 @@ export const styleColorTones = {
24
24
  export default {
25
25
  display: 'flex',
26
26
  flexFlow: 'column',
27
+
27
28
  'header > nav a:hover': {
28
29
  background: 'rgba(255, 255, 255, .08)',
29
30
  opacity: 1,
@@ -56,6 +56,7 @@ const getCollectionFromArray = (arr, s) => {
56
56
  const { TYPOGRAPHY } = __projectSystem
57
57
  if (!TYPOGRAPHY) return
58
58
  const styles = TYPOGRAPHY.styles || {}
59
+
59
60
  return arr.map((v, k) => {
60
61
  const result = getTypeStyle(v, __projectSystem)
61
62
  return {
@@ -66,14 +66,14 @@ export default {
66
66
  text: '<p>'
67
67
  }
68
68
  }
69
- },
69
+ },
70
70
  code: {
71
71
  props: {
72
72
  title: {
73
73
  text: '<code>'
74
74
  }
75
75
  }
76
- },
76
+ },
77
77
  pre: {
78
78
  props: {
79
79
  title: {