@symbo.ls/preview 0.0.13 → 0.0.15

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.13",
5
+ "version": "0.0.15",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
package/src/app.js CHANGED
@@ -13,6 +13,7 @@ import {
13
13
  Export,
14
14
  Library
15
15
  } from './pages'
16
+ import { Modal, openModal } from '@symbo.ls/components'
16
17
 
17
18
  const SUB_ROUTES = {}
18
19
  Object.keys(DesignSystem.routes).map(route => {
@@ -54,12 +55,15 @@ const App = {
54
55
  style: { position: 'relative' }
55
56
  },
56
57
 
58
+ Modal,
59
+
57
60
  on: {
58
61
  render: element => {
59
62
  const { pathname, hash } = window.location
60
63
  const url = pathname + hash
61
64
  router(element, url, {})
62
65
  },
66
+ update: (el, s) => openModal(el, s),
63
67
  scroll: (ev, el) => {
64
68
  const { scrollTop } = el.node
65
69
  const isFloating = scrollTop > 0
@@ -6,7 +6,7 @@ const mapColors = (el, s) => {
6
6
  if (!el.context.SYSTEM) return
7
7
  const { COLOR } = el.context.SYSTEM
8
8
  const colorKeys = Object.keys(COLOR)
9
- return colorKeys.map(v => COLOR[v])
9
+ return colorKeys.map(v => ({ key: v, ...COLOR[v] }))
10
10
  }
11
11
 
12
12
  export default {
@@ -13,18 +13,20 @@ import { PageExtend,
13
13
 
14
14
  const NAV = [{
15
15
  props: {
16
- icon: 'typography outline',
17
- href: '/typography'
16
+ icon: 'color outline colored',
17
+ href: '/colors'
18
18
  }
19
19
  }, {
20
20
  props: {
21
- icon: 'color outline colored',
22
- href: '/colors'
21
+ icon: 'typography outline',
22
+ href: '/typography',
23
+ opacity: '.7'
23
24
  }
24
25
  }, {
25
26
  props: {
26
27
  icon: 'space outline',
27
- href: '/space'
28
+ href: '/space',
29
+ opacity: '.7'
28
30
  }
29
31
  }, {
30
32
  props: {
@@ -47,7 +49,8 @@ const NAV = [{
47
49
  }, {
48
50
  props: {
49
51
  icon: 'device mobile half fill',
50
- href: '/responsive'
52
+ href: '/responsive',
53
+ opacity: '.7'
51
54
  }
52
55
  }, {
53
56
  props: {
@@ -1,11 +1,11 @@
1
1
  'use strict'
2
2
 
3
- import { SectionHeader } from '@symbo.ls/components'
3
+ import { SectionHeader } from '@symbo.ls/components' // eslint-disable-line no-unused-vars
4
4
 
5
5
  import state from './state'
6
6
 
7
7
  import documentStyle from './docStyles'
8
- import typeScale from './typeScale'
8
+ import { TypeScale } from './typeScale'
9
9
 
10
10
  export const Typography = {
11
11
  define: { routes: param => param },
@@ -13,26 +13,15 @@ export const Typography = {
13
13
  state,
14
14
 
15
15
  routes: {
16
- '/': typeScale,
16
+ '/': TypeScale,
17
17
  '/document-styles': documentStyle
18
18
  },
19
19
 
20
- header: {
21
- extend: SectionHeader
22
- },
20
+ // header: {
21
+ // extend: SectionHeader
22
+ // },
23
23
 
24
24
  page: {
25
- content: (el, s) => {
26
- const content = el.parent?.routes['/' + s.activeTab]
27
- return { extend: content }
28
- }
29
- },
30
-
31
- on: {
32
- init: (el, s) => {
33
- const route = window.location.pathname
34
- const routes = route.slice(1).split('/')
35
- s.activeTab = routes[1] || state.activeTab
36
- }
25
+ TypeScale
37
26
  }
38
27
  }
@@ -1,13 +1,15 @@
1
1
  'use strict'
2
2
 
3
3
  export default {
4
- base: 14,
5
- ratio: 1.125,
6
- scales: {},
7
- range: [-3, +10],
4
+ base: 16,
5
+ ratio: 1.2,
6
+ range: [-3, +8],
8
7
  h1Matches: +6,
8
+ scales: {},
9
9
  sequence: {},
10
- type: 'font-size',
10
+ vars: {},
11
+ // subSequence: true,
12
+ type: 'demo-font-size',
11
13
 
12
14
  title: 'Typography',
13
15
  p: 'A general configuration of type properties on the document.',
@@ -1,101 +1,90 @@
1
1
  'use strict'
2
2
 
3
3
  import {
4
- Flex, Block, Text, Grid,
5
- SequenceGraph,
6
- SliderToolWithCaption,
7
- StaticSpacing,
8
- PreviewSettings,
9
- ScalesSequence,
10
- CommonField
4
+ TypeScaleSequence,
5
+ SequenceSliders
11
6
  } from '@symbo.ls/components'
7
+ import { mapSequence, sortSequence } from '@symbo.ls/utils'
12
8
 
13
9
  import { TypeSection } from './shared'
14
10
 
15
- const ScalingTools = {
16
- extend: Flex,
11
+ export const TypeScale = {
12
+ extend: TypeSection,
17
13
 
18
- props: {
19
- flow: 'column',
20
- gap: 'A2'
14
+ header: {
15
+ state: {
16
+ title: 'TypeScale',
17
+ p: 'Generate text sequence by a base size and ratio'
18
+ }
21
19
  },
22
20
 
23
- fontSize: {
24
- extend: [SliderToolWithCaption],
25
- caption: { text: 'Base size' },
26
- element: {
27
- style: {
28
- maxWidth: `${232 / 16}em`
29
- }
21
+ sliders: { extend: SequenceSliders },
22
+
23
+ p: {
24
+ extend: 'Paragraph',
25
+ props: {
26
+ margin: '0',
27
+ padding: 'B2 0',
28
+ text: `Base size and ratio will sequentially generate set by multiplying each next unit by the ratio.`
30
29
  }
31
30
  },
32
31
 
33
32
  sequence: {
34
- extend: CommonField,
35
- caption: { text: 'Sequence ratio' },
36
- element: {
37
- extend: StaticSpacing,
38
- spacings: {
39
- childExtend: {
40
- on: {
41
- click: (ev, el, s) => s.update({ ratio: el.value.text })
42
- }
43
- }
44
- }
45
- }
33
+ extend: TypeScaleSequence,
34
+ $setCollection: ({ state }) => mapSequence(state, sortSequence)
46
35
  }
47
36
  }
48
37
 
49
- export default {
50
- extend: TypeSection,
38
+ // export default {
39
+ // extend: TypeSection,
51
40
 
52
- header: {
53
- heading: {
54
- p: { props: { text: 'Generate text sequence by a base size and ratio' } }
55
- },
56
- nav: {
57
- add: { props: { icon: 'plus' } }
58
- }
59
- },
41
+ // header: {
42
+ // heading: {
43
+ // p: { props: { text: 'Generate text sequence by a base size and ratio' } }
44
+ // },
45
+ // nav: {
46
+ // add: { props: { icon: 'plus' } }
47
+ // }
48
+ // },
60
49
 
61
- wrapper: {
62
- textTest: '',
63
- fonts: '',
64
-
65
- cnt: {
66
- extend: [Block, Grid],
67
-
68
- props: {
69
- gap: 'D',
70
- columns: '16em auto'
71
- },
72
-
73
- aside: ScalingTools,
74
-
75
- wrapper: {
76
- settings: {
77
- extend: PreviewSettings,
78
- props: { margin: '0 0 B' }
79
- },
80
-
81
- fonts: ScalesSequence
82
- },
83
-
84
- sequenceSet: {
85
- extend: CommonField,
86
- props: { margin: 'C2 0' },
87
- caption: {
88
- extend: [Block, Text],
89
- props: {
90
- text: 'Sizing generated by this setting',
91
- padding: '0 0 A 0'
92
- }
93
- },
94
- element: {
95
- extend: [SequenceGraph, Block, Text],
96
- style: { '> span': { display: 'none' } }
97
- }
98
- }
99
- }
100
- }
101
- }
50
+ // wrapper: {
51
+ // textTest: '',
52
+ // fonts: '',
53
+
54
+ // cnt: {
55
+ // extend: [Block, Grid],
56
+
57
+ // props: {
58
+ // gap: 'D',
59
+ // columns: '16em auto'
60
+ // },
61
+
62
+ // aside: ScalingTools,
63
+
64
+ // wrapper: {
65
+ // settings: {
66
+ // extend: PreviewSettings,
67
+ // props: { margin: '0 0 B' }
68
+ // },
69
+
70
+ // fonts: ScalesSequence
71
+ // },
72
+
73
+ // sequenceSet: {
74
+ // extend: CommonField,
75
+ // props: { margin: 'C2 0' },
76
+ // caption: {
77
+ // extend: [Block, Text],
78
+ // props: {
79
+ // text: 'Sizing generated by this setting',
80
+ // padding: '0 0 A 0'
81
+ // }
82
+ // },
83
+ // element: {
84
+ // extend: [SequenceGraph, Block, Text],
85
+ // style: { '> span': { display: 'none' } }
86
+ // }
87
+ // }
88
+ // }
89
+ // }
90
+ // }