@symbo.ls/preview 0.0.65 → 0.0.66

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.65",
5
+ "version": "0.0.66",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
package/src/app.js CHANGED
@@ -8,6 +8,7 @@ import { openModal } from '@symbo.ls/components'
8
8
 
9
9
  import { state } from './state'
10
10
  import {
11
+ Init,
11
12
  Components,
12
13
  DesignSystem,
13
14
  Export,
@@ -47,6 +48,7 @@ const App = {
47
48
 
48
49
  define: { routes: param => param },
49
50
  routes: {
51
+ '/init': Init,
50
52
  '/library': Library,
51
53
  '/design-system': DesignSystem,
52
54
  '/components': Components,
@@ -61,12 +63,16 @@ const App = {
61
63
  Modal: {},
62
64
 
63
65
  on: {
64
- render: element => {
66
+ render: (el, s) => {
65
67
  const { pathname, hash } = window.location
66
68
  const url = pathname + hash
67
- router(element, url, {})
69
+ router(el, url, {})
70
+ },
71
+ update: (el, s) => {
72
+ const { pathname } = window.location
73
+ if (pathname === '/' && !state.initialized) return router(el, '/init/', {})
74
+ openModal(el, s)
68
75
  },
69
- update: (el, s) => { openModal(el, s) },
70
76
  scroll: (ev, el) => {
71
77
  const { scrollTop } = el.node
72
78
  const isFloating = scrollTop > 0
@@ -1,13 +1,15 @@
1
1
  'use strict'
2
- import { Button } from '@symbo.ls/components'
2
+
3
+ import { Button, ClickableItem, Link } from '@symbo.ls/components'
4
+
3
5
  export const ContinueButton = {
4
- extend: Button,
6
+ extend: [ClickableItem, Button, Link],
5
7
  props: {
6
8
  text: 'Continue',
7
- fontSize: 'Z2',
8
- padding: 'Z1 C',
9
- background: 'linear-gradient(to top, rgba(50, 114, 184, .2), rgba(0, 121, 253, .27), rgba(0, 121, 253, .27))',
10
- color: 'white',
9
+ fontSize: 'A2',
10
+ padding: 'Z1 C2',
11
+ theme: 'secondary',
12
+ margin: 'auto - - -Z',
11
13
  fontWeight: '500'
12
14
  }
13
15
  }
@@ -1,21 +1,17 @@
1
1
  'use strict'
2
2
 
3
- import { HeaderOfMember } from '@symbo.ls/components'
4
-
5
3
  export const Header = {
6
- style: {
4
+ props: {
7
5
  position: 'sticky',
8
6
  width: '100%',
9
- top: 0,
10
- zIndex: 99999
11
- },
12
-
13
- define: { isFloating: param => param },
7
+ top: '0',
8
+ zIndex: 99999,
14
9
 
15
- content: {
16
- extend: HeaderOfMember,
17
- props: {
18
- maxWidth: '100%'
10
+ content: {
11
+ maxWidth: '100%',
12
+ width: '100%'
19
13
  }
20
14
  }
15
+
16
+ // define: { isFloating: param => param }
21
17
  }
@@ -1,13 +1,18 @@
1
1
  'use strict'
2
2
 
3
- const props = {
4
- caption: {
3
+ export const HeaderHeading = {
4
+ tag: 'header',
5
+
6
+ props: { margin: '- - C2 -' },
7
+
8
+ Caption: {
5
9
  text: `Let's get started`,
6
10
  whiteSpace: 'nowrap',
7
11
  margin: '0',
8
12
  color: 'gray6'
9
13
  },
10
- h1: {
14
+
15
+ H1: {
11
16
  color: 'white',
12
17
  text: 'First was the light',
13
18
  fontSize: 'H2',
@@ -16,11 +21,3 @@ const props = {
16
21
  height: 'fit-content'
17
22
  }
18
23
  }
19
-
20
- export const HeaderHeading = {
21
- tag: 'header',
22
- props,
23
-
24
- caption: {},
25
- h1: {}
26
- }
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { PageTemplate } from '@symbo.ls/components'
3
+ import { PageTemplate, Flex } from '@symbo.ls/components'
4
4
 
5
5
  import MASK1 from '../assets/mask1.png'
6
6
  import MASK2 from '../assets/mask2.png' // eslint-disable-line
@@ -14,6 +14,20 @@ export const Page = {
14
14
  }
15
15
  }
16
16
 
17
+ export const InitPage = {
18
+ tag: 'main',
19
+ extend: Flex,
20
+
21
+ props: {
22
+ width: '100%',
23
+ maxWidth: 'J',
24
+ flow: 'column',
25
+ align: 'flex-start',
26
+
27
+ content: { width: '100%' }
28
+ }
29
+ }
30
+
17
31
  export const DisabledPage = {
18
32
  props: {
19
33
  maxHeight: 'calc(100vh - 7em)',
package/src/index.js CHANGED
@@ -28,9 +28,25 @@ const app = DOM.create({
28
28
  extend: App,
29
29
  style,
30
30
 
31
- header: components.Header,
31
+ Header: {
32
+ props: {},
33
+
34
+ define: { routes: param => param },
35
+ routes: {
36
+ '/': smbls.HeaderInitial,
37
+ '/*': smbls.HeaderOfMember
38
+ },
39
+
40
+ on: {
41
+ update: element => {
42
+ const { pathname, hash } = window.location
43
+ const url = pathname + hash
44
+ router(element, url, {}, { updateState: false })
45
+ }
46
+ }
47
+ },
32
48
  routes: {
33
- // '/': DesignSystem
49
+ // '/': Library
34
50
  }
35
51
  }, undefined, 'app', {
36
52
  extend: [smbls.Box],
@@ -1,16 +1,9 @@
1
1
  'use strict'
2
2
 
3
- import { Line } from '@symbo.ls/components'
4
-
5
3
  import globalThemes from './globalThemes'
6
4
  import palette from './palette'
7
5
  import themes from './themes'
8
6
 
9
- import { themeLightDark } from './themeLightDark'
10
- import { CreatePallete } from './CreatePalette'
11
- import { fontText } from './FontText'
12
- import { chooseEnvironment } from './chooseEnvironment'
13
-
14
7
  export const Color = {
15
8
  key: 'colors',
16
9
 
@@ -19,14 +12,9 @@ export const Color = {
19
12
  // style: { border: '4px solid red' }
20
13
  },
21
14
 
22
- // createPallete: CreatePallete,
23
- // themeLightDark,
24
- // fontText,
25
- // chooseEnvironment,
26
-
27
15
  globalThemes,
28
- line: { extend: Line },
16
+ Line: {},
29
17
  palette,
30
- line2: { extend: Line },
18
+ Line_2: {},
31
19
  themes
32
20
  }
@@ -66,7 +66,7 @@ export default ({ parent: { state: { __system } } }) => ({
66
66
  paragraph: 'Label a role of subject with glyphs',
67
67
  properties: [{
68
68
  property: 'All',
69
- value: console.log(__system) || Object.keys(__system.ICONS).length
69
+ value: Object.keys(__system.ICONS).length
70
70
  }, {
71
71
  property: 'Linear',
72
72
  value: Object.keys(__system.ICONS).filter(v => v.includes('Outline')).length
@@ -0,0 +1,108 @@
1
+ 'use strict'
2
+
3
+ import { Flex, CommonField, WiderButton } from '@symbo.ls/components'
4
+
5
+ import { HeaderHeading, InitPage } from '../../components'
6
+
7
+ const header = {
8
+ props: {
9
+ margin: '- - D -',
10
+ Caption: { text: 'And finally' },
11
+ H1: {
12
+ text: 'Choose your environment',
13
+ flow: 'row-reverse',
14
+ align: 'center flex-end',
15
+ ':after': {
16
+ content: '", if any"',
17
+ fontWeight: '200',
18
+ color: 'gray9'
19
+ }
20
+ }
21
+ },
22
+
23
+ Caption: {},
24
+ H1: {
25
+ span: {},
26
+ span2: {}
27
+ }
28
+ }
29
+
30
+ const commonField = {
31
+ extend: CommonField,
32
+ props: {
33
+ gap: 'Z2',
34
+ element: {
35
+ gap: 'A',
36
+ maxWidth: 'I',
37
+ alignItems: 'center',
38
+ childProps: {
39
+ background: 'gray2',
40
+ color: 'white .8',
41
+ round: 'Z1',
42
+ fontSize: 'A2'
43
+ }
44
+ }
45
+ },
46
+
47
+ title: {},
48
+ element: {
49
+ extend: Flex,
50
+ childExtend: {
51
+ extend: WiderButton
52
+ }
53
+ }
54
+ }
55
+
56
+ const yourEnvironment = {
57
+ extend: commonField,
58
+ props: {
59
+ margin: '- - C2 -',
60
+ title: { text: 'Your environment' },
61
+ element: {
62
+ childProps: {}
63
+ }
64
+ },
65
+
66
+ title: {},
67
+ element: [
68
+ { props: { icon: 'inputOutline' } },
69
+ { props: { icon: 'accessibilityOutline' } },
70
+ {
71
+ props: {
72
+ boxSizing: 'content-box',
73
+ padding: 'Z B',
74
+ width: 'auto',
75
+ borderRadius: 'B',
76
+ text: `I'm just playing`,
77
+ aspectRatio: 'auto'
78
+ },
79
+ icon: null
80
+ }
81
+ ]
82
+ }
83
+
84
+ const yourFramework = {
85
+ extend: commonField,
86
+ props: {
87
+ margin: '- - F -',
88
+ title: { text: 'Your framework' },
89
+ element: { childProps: { icon: 'info' } }
90
+ },
91
+ title: {},
92
+ element: { ...[{}, {}, {}, {}, {}, {}] }
93
+ }
94
+
95
+ export const ChooseEnvironment = {
96
+ extend: InitPage,
97
+
98
+ HeaderHeading: header,
99
+
100
+ yourEnvironment,
101
+ yourFramework,
102
+
103
+ ContinueButton: {
104
+ text: 'Create Symbols',
105
+ theme: 'primary',
106
+ href: '/design-system'
107
+ }
108
+ }
@@ -0,0 +1,116 @@
1
+ 'use strict'
2
+
3
+ import { Flex, GlobalThemeTemplate, Hoverable } from '@symbo.ls/components'
4
+ import { InitPage } from '../../components'
5
+
6
+ const paragraphs = {
7
+ extend: Flex,
8
+ childExtend: { tag: 'p' },
9
+ ...['To personalize your Symbols experience, we need to get started with themes',
10
+ 'Please fill in the document dark and light themes']
11
+ }
12
+
13
+ const modes = {
14
+ extend: Flex,
15
+ props: {
16
+ gap: 'C',
17
+ margin: '- -Z E2'
18
+ },
19
+ childExtend: {
20
+ extend: [Hoverable, GlobalThemeTemplate],
21
+ props: ({ state }) => ({
22
+ minWidth: 'G3',
23
+ maxWidth: '406px',
24
+ position: 'relative',
25
+ maxHeight: 'F',
26
+ boxSizing: 'content-box',
27
+ align: 'flex-start flex-start',
28
+ padding: 'A2 A X X1',
29
+ overflow: 'hidden',
30
+ round: 'A1',
31
+ background: state.background,
32
+ wrap: 'wrap',
33
+
34
+ icon: {
35
+ boxSize: 'C C',
36
+ margin: '- - - Z2',
37
+ background: 'yellow .3',
38
+ pointerEvents: 'none',
39
+ fontSize: `B`
40
+ },
41
+
42
+ article: {
43
+ padding: 'X2 - - -',
44
+ title: { fontSize: 'D2' }
45
+ },
46
+
47
+ ':hover': {
48
+ style: {
49
+ '[buttons]': {
50
+ opacity: '1',
51
+ transform: 'translate3d(0, 0, 0)'
52
+ }
53
+ }
54
+ }
55
+ }),
56
+
57
+ icon: {},
58
+ article: {},
59
+
60
+ ThemeButtons: {
61
+ transform: 'translate3d(0, 150%, 0)',
62
+ transition: 'B default-bezier',
63
+ transitionProperty: 'transform, opacity',
64
+ opacity: '0',
65
+ margin: 'C1 0 0 0',
66
+ alignSelf: 'flex-end'
67
+ },
68
+
69
+ Span: {
70
+ position: 'absolute',
71
+ bottom: 'A2',
72
+ left: 'B',
73
+ fontSize: 'Z',
74
+ color: 'gray7',
75
+ fontStyle: 'italic',
76
+ text: 'hover to change'
77
+ }
78
+ },
79
+
80
+ $setStateCollection: () => [{
81
+ title: 'Dark',
82
+ key: 'light',
83
+ icon: 'sun',
84
+ background: 'white'
85
+ }, {
86
+ title: 'Night',
87
+ key: 'dark',
88
+ icon: 'moon',
89
+ background: 'gray3'
90
+ }]
91
+ }
92
+
93
+ export const CreateDocumentTheme = {
94
+ extend: InitPage,
95
+
96
+ props: {
97
+ flow: 'column',
98
+ align: 'flex-start',
99
+ paragraphs: {
100
+ gap: 'E',
101
+ margin: '- - D1 -',
102
+ childProps: {
103
+ color: 'gray6',
104
+ maxWidth: `G1`
105
+ }
106
+ }
107
+ },
108
+
109
+ HeaderHeading: {},
110
+ paragraphs,
111
+ modes,
112
+
113
+ ContinueButton: {
114
+ href: '/init/pallete'
115
+ }
116
+ }
@@ -0,0 +1,134 @@
1
+ 'use strict'
2
+
3
+ import { Flex, ColorSelectWithTitle, Input } from '@symbo.ls/components'
4
+ import { InitPage } from '../../components'
5
+
6
+ const colors = {
7
+ extend: Flex,
8
+ props: {
9
+ width: 'F3',
10
+ flow: 'column',
11
+ gap: 'B1',
12
+ opacity: '.75'
13
+ },
14
+ childExtend: {
15
+ extend: ColorSelectWithTitle,
16
+ props: ({ state }) => ({
17
+ width: '100%',
18
+ title: { text: state.title },
19
+ element: {
20
+ padding: 'Y Y Y Z1',
21
+ title: {
22
+ box: {
23
+ boxSize: 'A2 A2',
24
+ position: 'relative',
25
+ zIndex: 2,
26
+ background: 'white .05',
27
+ '::-webkit-color-swatch-wrapper': {
28
+ padding: '0'
29
+ },
30
+ '::-webkit-color-swatch': {
31
+ border: 'none',
32
+ round: 'Y'
33
+ }
34
+ },
35
+ value: {
36
+ round: 'Z',
37
+ position: 'absolute',
38
+ inset: '0 0 0 0',
39
+ padding: '- - - B2+W',
40
+ textAlign: 'start',
41
+ lineHeight: '100%',
42
+ placeholder: 'Color value',
43
+ ':focus': {
44
+ outline: 'solid, X, blue .3'
45
+ }
46
+ }
47
+ }
48
+ }
49
+ }),
50
+ title: {},
51
+ element: {
52
+ title: {
53
+ box: {
54
+ extend: 'Focusable',
55
+ tag: 'input',
56
+ attr: {
57
+ type: 'color',
58
+ value: ({ state }) => 'rgba(255,255,255,0.05)'
59
+ },
60
+ props: {
61
+ border: '0',
62
+ padding: '0',
63
+ style: {
64
+ appearance: 'none'
65
+ }
66
+ },
67
+ on: {
68
+ update: (el, s) => {
69
+ el.node.value = s.value || ''
70
+ },
71
+ input: (ev, el, s) => {
72
+ s.update({ value: el.node.value || '' })
73
+ }
74
+ }
75
+ },
76
+ value: {
77
+ extend: Input,
78
+ on: {
79
+ update: (el, s) => {
80
+ el.node.value = s.value || ''
81
+ },
82
+ input: (ev, el, s) => {
83
+ s.update({ value: el.node.value || '' })
84
+ }
85
+ }
86
+ }
87
+ },
88
+ buttons: null
89
+ }
90
+ },
91
+
92
+ $setStateCollection: () => [{
93
+ title: 'Accent color'
94
+ }, {
95
+ title: 'Secondary Color'
96
+ }, {
97
+ title: 'Inactive Color'
98
+ }]
99
+ }
100
+
101
+ const content = {
102
+ extend: Flex,
103
+ props: {
104
+ margin: '- - F -',
105
+ align: 'flex-start',
106
+ gap: 'E2',
107
+ ColorsPalette: {
108
+ margin: '- - - auto'
109
+ }
110
+ },
111
+
112
+ colors,
113
+
114
+ UploadImage: {},
115
+ ColorsPalette: {
116
+ margin: '- - auto'
117
+ }
118
+ }
119
+
120
+ export const CreatePallete = {
121
+ extend: InitPage,
122
+
123
+ HeaderHeading: {
124
+ margin: '- - D -',
125
+ Caption: { text: `Let's get started` },
126
+ H1: { text: 'Create your palette' }
127
+ },
128
+
129
+ content,
130
+
131
+ ContinueButton: {
132
+ href: '/init/font'
133
+ }
134
+ }
@@ -0,0 +1,21 @@
1
+ 'use strict'
2
+
3
+ import { InitPage } from '../../components'
4
+
5
+ export const FontText = {
6
+ extend: InitPage,
7
+
8
+ HeaderHeading: {
9
+ props: { margin: '- - D2 -' },
10
+ Caption: { text: `Let's make sure` },
11
+ H1: { text: 'Texts look good?' }
12
+ },
13
+
14
+ FontText: {
15
+ margin: '- -Z'
16
+ },
17
+
18
+ ContinueButton: {
19
+ href: '/init/env'
20
+ }
21
+ }
@@ -0,0 +1,35 @@
1
+ 'use strict'
2
+
3
+ import { Flex } from '@symbo.ls/components'
4
+ import { CreateDocumentTheme } from './CreateDocumentTheme'
5
+ import { CreatePallete } from './CreatePalette'
6
+ import { FontText } from './FontText'
7
+ import { ChooseEnvironment } from './ChooseEnvironment'
8
+ import { router } from '@domql/router'
9
+
10
+ export const Init = {
11
+ extend: Flex,
12
+
13
+ props: {
14
+ boxSize: '100% 100%',
15
+ gap: 'A',
16
+ padding: '10% E1 D1 15%'
17
+ },
18
+
19
+ define: { routes: param => param },
20
+ routes: {
21
+ '/': CreateDocumentTheme,
22
+ '/theme': CreateDocumentTheme,
23
+ '/pallete': CreatePallete,
24
+ '/font': FontText,
25
+ '/env': ChooseEnvironment
26
+ },
27
+
28
+ on: {
29
+ render: element => {
30
+ const { pathname, hash } = window.location
31
+ const url = pathname + hash
32
+ router(element, url, {}, { level: 1 })
33
+ }
34
+ }
35
+ }
@@ -1,5 +1,6 @@
1
1
  'use strict'
2
2
 
3
+ export * from './Init'
3
4
  export * from './Components'
4
5
  export * from './Export'
5
6
  export * from './Fonts'