@symbo.ls/preview 0.0.34 → 0.0.36

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": "",
5
- "version": "0.0.34",
5
+ "version": "0.0.36",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
package/src/app.js CHANGED
@@ -18,9 +18,11 @@ const SUB_ROUTES = {}
18
18
  Object.keys(DesignSystem.routes).map(route => {
19
19
  SUB_ROUTES[route] = {
20
20
  extend: DesignSystem,
21
- sidebar: {},
22
- main: {
23
- extend: DesignSystem.routes[route]
21
+ page: {
22
+ sidebar: {},
23
+ main: {
24
+ extend: DesignSystem.routes[route]
25
+ }
24
26
  },
25
27
  __filepath: 'pages/index.js'
26
28
  }
@@ -1,6 +1,7 @@
1
1
  'use strict'
2
2
 
3
- import { ClickableItem, Flex, Link, SquareButton } from '@symbo.ls/components'
3
+ import { router } from '@domql/router'
4
+ import { ClickableItem, Flex, Link, ResponsivePreview, SquareButton } from '@symbo.ls/components'
4
5
  import { PageExtend,
5
6
  Color,
6
7
  Theme,
@@ -8,7 +9,8 @@ import { PageExtend,
8
9
  Spaces,
9
10
  Icons,
10
11
  Typography,
11
- Fonts
12
+ Fonts,
13
+ MediaQuery
12
14
  } from '..'
13
15
 
14
16
  const NAV = [{
@@ -49,7 +51,7 @@ const NAV = [{
49
51
  }, {
50
52
  props: {
51
53
  icon: 'device mobile half fill',
52
- href: '/responsive',
54
+ href: '/media-query',
53
55
  opacity: '.7'
54
56
  }
55
57
  }, {
@@ -65,15 +67,12 @@ const NAV = [{
65
67
  }]
66
68
 
67
69
  export const DesignSystem = {
68
- extend: PageExtend,
69
-
70
70
  props: {
71
71
  maxWidth: '100%',
72
72
  width: '100%',
73
- flow: 'row',
74
- align: 'flex-start flex-start',
75
- gap: 'B1',
76
- padding: 'D2 A B1'
73
+ flow: 'column',
74
+ padding: '- - C1',
75
+ gap: 'B1'
77
76
  },
78
77
 
79
78
  define: { routes: param => param },
@@ -85,43 +84,75 @@ export const DesignSystem = {
85
84
  '/fonts': Fonts,
86
85
  '/space': Spaces,
87
86
  '/shape': Shapes,
88
- '/icons': Icons
87
+ '/icons': Icons,
88
+ '/media-query': MediaQuery
89
89
  // '/sequence': Sequence,
90
90
  // '/timing': Timing,
91
- // '/media-query': MediaQuery
92
91
  },
93
92
 
94
- sidebar: {
95
- tag: 'nav',
96
- extend: Flex,
97
- childExtend: {
98
- extend: [ClickableItem, Link, SquareButton],
99
- props: ({ props }) => ({
100
- active: props.href === window.location.pathname,
101
- theme: null
102
- })
103
- },
93
+ page: {
94
+ extend: PageExtend,
104
95
 
105
96
  props: {
97
+ maxWidth: '100%',
98
+ width: '100%',
99
+ flow: 'row',
100
+ align: 'flex-start flex-start',
106
101
  gap: 'B1',
107
- flow: 'column',
108
- background: 'transparent',
109
- color: 'gray7',
110
- fontSize: 'A2',
111
- position: 'sticky',
112
- top: 'E'
102
+ padding: 'D2 A B1'
113
103
  },
114
104
 
115
- ...NAV
116
- },
105
+ sidebar: {
106
+ tag: 'nav',
107
+ extend: Flex,
108
+ childExtend: {
109
+ extend: [ClickableItem, Link, SquareButton],
110
+ props: ({ props }) => ({
111
+ active: props.href === window.location.pathname,
112
+ theme: null
113
+ })
114
+ },
117
115
 
118
- main: {
119
- tag: 'section',
120
- extend: PageExtend,
116
+ props: {
117
+ gap: 'B1',
118
+ flow: 'column',
119
+ background: 'transparent',
120
+ color: 'gray7',
121
+ fontSize: 'A2',
122
+ position: 'sticky',
123
+ top: 'E'
124
+ },
125
+
126
+ ...NAV
127
+ },
128
+
129
+ main: {
130
+ tag: 'section',
131
+ extend: PageExtend,
121
132
 
133
+ props: {
134
+ flex: 1,
135
+ padding: '0 C1 B1'
136
+ }
137
+ }
138
+ },
139
+
140
+ widget: {
122
141
  props: {
123
- flex: 1,
124
- padding: '0 C1 B1'
142
+ padding: 'C B1 - B1'
143
+ },
144
+
145
+ define: { routes: param => param },
146
+ routes: {
147
+ '/media-query': ResponsivePreview
148
+ },
149
+
150
+ on: {
151
+ render: element => {
152
+ const { pathname, hash } = window.location
153
+ const url = pathname + hash
154
+ router(element, url, {})
155
+ }
125
156
  }
126
157
  }
127
158
  }
@@ -56,5 +56,11 @@ export default {
56
56
  }
57
57
  }
58
58
  }
59
+ },
60
+
61
+ on: {
62
+ update: (el, s) => {
63
+ el.__root.node.scrollTo({ top: 0, behavior: 'smooth' })
64
+ }
59
65
  }
60
66
  }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ import state from './state'
4
+
5
+ export const MediaQuery = {
6
+ state,
7
+
8
+ SectionHeader: {
9
+ title: 'Responsive',
10
+ p: 'A Design System is the single source of truth that defines all design elements and allows the crews to assemble components and compose them into more complex apps.'
11
+ }
12
+ }
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ export default {
4
+ //
5
+ }
@@ -0,0 +1,69 @@
1
+ 'use strict'
2
+
3
+ import {
4
+ TestText,
5
+ Flex
6
+ } from '@symbo.ls/components'
7
+
8
+ export default {
9
+ extend: Flex,
10
+
11
+ props: {
12
+ gap: 'D',
13
+ align: 'flex-start flex-start',
14
+
15
+ sidebar: {
16
+ padding: 'B 0 0',
17
+ widthRange: 'F2',
18
+ position: 'sticky',
19
+ top: 'E'
20
+ },
21
+
22
+ content: {
23
+ overflow: 'hidden',
24
+ flex: '1',
25
+ flow: 'column',
26
+ gap: 'C',
27
+
28
+ header: {
29
+ align: 'flex-end space-between',
30
+ padding: '0 0 0 C',
31
+ gap: 'C1'
32
+ },
33
+
34
+ footer: {
35
+ padding: '0 0 0 C'
36
+ }
37
+ }
38
+ },
39
+
40
+ sidebar: {
41
+ SectionHeader: {
42
+ title: 'TypeScale',
43
+ p: 'Generate text sequence by a base size and ratio'
44
+ },
45
+
46
+ SequenceSliders: {
47
+ flow: 'column'
48
+ },
49
+
50
+ Paragraph: {
51
+ margin: '0',
52
+ fontSize: 'Z2',
53
+ padding: 'B2 0',
54
+ text: `Base size and ratio sequentially generate set by multiplying each next calculated unit by the ratio.`
55
+ }
56
+ },
57
+
58
+ content: {
59
+ extend: Flex,
60
+
61
+ header: {
62
+ extend: Flex,
63
+ TestText
64
+ },
65
+
66
+ sequence: {
67
+ }
68
+ }
69
+ }
@@ -11,7 +11,8 @@ export const Preview = {
11
11
  extend: Scene,
12
12
 
13
13
  props: {
14
- margin: '0 -Z1'
14
+ margin: '0 -Z1',
15
+ maxHeight: '25vh'
15
16
  },
16
17
 
17
18
  scene: {
@@ -2,7 +2,7 @@
2
2
 
3
3
  import state from './state'
4
4
 
5
- import typeScale from './typeScale' // eslint-disable-line no-unused-vars
5
+ import typeScale from './typeScale'
6
6
  import documentStyles from './documentStyles'
7
7
 
8
8
  export const Typography = {
@@ -11,4 +11,6 @@ export * from './Theme'
11
11
  export * from './Shapes'
12
12
  export * from './Spaces'
13
13
  export * from './Typography'
14
+ export * from './MediaQuery'
15
+
14
16
  export * from './DesignSystem'