@symbo.ls/preview 0.0.66 → 0.0.67

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.66",
5
+ "version": "0.0.67",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
@@ -1,64 +1,69 @@
1
1
  'use strict'
2
2
 
3
- import { Flex, Grid } from '@symbo.ls/components'
4
-
5
- const props = {
6
- flow: 'column',
7
- gap: 'A',
8
- opacity: '.35'
9
- }
3
+ import { ClickableItem, CommonField, Flex, Grid } from '@symbo.ls/components'
10
4
 
11
5
  export const ColorsPalette = {
12
- props,
6
+ extend: CommonField,
7
+
8
+ props: {
9
+ gap: 'Z',
10
+ element: {
11
+ margin: '0 -X',
12
+ flow: 'column',
13
+ gap: 'Z2'
14
+ }
15
+ },
13
16
 
14
- extend: Flex,
15
- childExtend: {
16
- extend: Grid,
17
- // text: 'B',
17
+ title: { text: 'Suggestions' },
18
+ element: {
19
+ extend: Flex,
20
+ childExtend: {
21
+ extend: [ClickableItem, Grid],
18
22
 
19
- props: ({ state }) => ({
20
- minWidth: '190px',
21
- round: 'A',
22
- // round: 'D',
23
- columns: 'repeat(3, 1fr)',
24
- childProps: {
25
- height: 'B2'
26
- // style: { border: '4px solid red' }
27
- },
28
- color1: {
29
- background: state.color1,
30
- style: { borderTopLeftRadius: '10px', borderBottomLeftRadius: '10px' }
31
- },
32
- color2: { background: state.color2 },
33
- color3: {
34
- background: state.color3,
35
- style: { borderTopRightRadius: '10px', borderBottomRightRadius: '10px' }
23
+ props: ({ state }) => ({
24
+ minWidth: '190px',
25
+ round: 'Z2',
26
+ columns: 'repeat(3, 1fr)',
27
+ overflow: 'hidden',
28
+ opacity: '.35',
29
+ childProps: { height: 'B2' },
30
+
31
+ color1: { background: state[0] },
32
+ color2: { background: state[1] },
33
+ color3: { background: state[2] }
34
+ }),
35
+
36
+ color1: {},
37
+ color2: {},
38
+ color3: {},
39
+
40
+ on: {
41
+ click: (event, element, state) => {
42
+ state.parent.update(state.parse())
43
+ }
36
44
  }
37
- }),
45
+ },
38
46
 
39
- color1: {},
40
- color2: {},
41
- color3: {}
42
- },
43
- $setStateCollection: () => [{
44
- color1: '#5F6C37',
45
- color2: '#F1E0BC',
46
- color3: '#FFFFFF'
47
- }, {
48
- color1: '#CCD5AE',
49
- color2: '#FEF9E1',
50
- color3: '#D3A374'
51
- }, {
52
- color1: '#CDB4DB',
53
- color2: '#FEAFCC',
54
- color3: '#A2D2FF'
55
- }, {
56
- color1: '#274553',
57
- color2: '#E9C46A',
58
- color3: '#E76F51'
59
- }, {
60
- color1: '#8EC9E6',
61
- color2: '#013047',
62
- color3: '#FFB703'
63
- }]
47
+ $setStateCollection: () => [[
48
+ '#5F6C37',
49
+ '#F1E0BC',
50
+ '#FFFFFF'
51
+ ], [
52
+ '#CCD5AE',
53
+ '#FEF9E1',
54
+ '#D3A374'
55
+ ], [
56
+ '#CDB4DB',
57
+ '#FEAFCC',
58
+ '#A2D2FF'
59
+ ], [
60
+ '#274553',
61
+ '#E9C46A',
62
+ '#E76F51'
63
+ ], [
64
+ '#8EC9E6',
65
+ '#013047',
66
+ '#FFB703'
67
+ ]]
68
+ }
64
69
  }
@@ -3,14 +3,14 @@
3
3
  import { Flex, CommonField, Upload, ClickableItem } from '@symbo.ls/components'
4
4
 
5
5
  export const UploadImage = {
6
- extend: [CommonField],
7
- Flex,
6
+ extend: [CommonField, Flex],
7
+
8
8
  props: {
9
9
  title: { text: 'Pick from the picture' },
10
10
  element: {
11
11
  border: 'none',
12
12
  background: 'gray1',
13
- padding: 'Z A Z Z',
13
+ padding: 'Z2 A2 Z2 Z2',
14
14
  gap: 'Z',
15
15
  flow: 'row',
16
16
  icon: { style: { fontSize: '52px' } },
package/src/index.js CHANGED
@@ -38,7 +38,7 @@ const app = DOM.create({
38
38
  },
39
39
 
40
40
  on: {
41
- update: element => {
41
+ render: element => {
42
42
  const { pathname, hash } = window.location
43
43
  const url = pathname + hash
44
44
  router(element, url, {}, { updateState: false })
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { Flex, CommonField, WiderButton } from '@symbo.ls/components'
4
4
 
5
- import { HeaderHeading, InitPage } from '../../components'
5
+ import { InitPage } from '../../components'
6
6
 
7
7
  const header = {
8
8
  props: {
@@ -22,7 +22,7 @@ const modes = {
22
22
  minWidth: 'G3',
23
23
  maxWidth: '406px',
24
24
  position: 'relative',
25
- maxHeight: 'F',
25
+ maxHeight: 'E2',
26
26
  boxSizing: 'content-box',
27
27
  align: 'flex-start flex-start',
28
28
  padding: 'A2 A X X1',
@@ -41,10 +41,12 @@ const modes = {
41
41
 
42
42
  article: {
43
43
  padding: 'X2 - - -',
44
- title: { fontSize: 'D2' }
44
+ title: { fontSize: 'D2', fontWeight: 'bold' }
45
45
  },
46
46
 
47
47
  ':hover': {
48
+ opacity: '1',
49
+
48
50
  style: {
49
51
  '[buttons]': {
50
52
  opacity: '1',
@@ -62,7 +64,7 @@ const modes = {
62
64
  transition: 'B default-bezier',
63
65
  transitionProperty: 'transform, opacity',
64
66
  opacity: '0',
65
- margin: 'C1 0 0 0',
67
+ margin: 'B2 0 0 0',
66
68
  alignSelf: 'flex-end'
67
69
  },
68
70
 
@@ -78,7 +80,7 @@ const modes = {
78
80
  },
79
81
 
80
82
  $setStateCollection: () => [{
81
- title: 'Dark',
83
+ title: 'Day',
82
84
  key: 'light',
83
85
  icon: 'sun',
84
86
  background: 'white'
@@ -17,10 +17,10 @@ const colors = {
17
17
  width: '100%',
18
18
  title: { text: state.title },
19
19
  element: {
20
- padding: 'Y Y Y Z1',
20
+ padding: 'Z',
21
21
  title: {
22
22
  box: {
23
- boxSize: 'A2 A2',
23
+ boxSize: 'B B',
24
24
  position: 'relative',
25
25
  zIndex: 2,
26
26
  background: 'white .05',
@@ -36,7 +36,7 @@ const colors = {
36
36
  round: 'Z',
37
37
  position: 'absolute',
38
38
  inset: '0 0 0 0',
39
- padding: '- - - B2+W',
39
+ padding: '- - - B2+W1',
40
40
  textAlign: 'start',
41
41
  lineHeight: '100%',
42
42
  placeholder: 'Color value',
@@ -55,7 +55,7 @@ const colors = {
55
55
  tag: 'input',
56
56
  attr: {
57
57
  type: 'color',
58
- value: ({ state }) => 'rgba(255,255,255,0.05)'
58
+ value: ({ state }) => state.value
59
59
  },
60
60
  props: {
61
61
  border: '0',
@@ -89,12 +89,15 @@ const colors = {
89
89
  }
90
90
  },
91
91
 
92
- $setStateCollection: () => [{
93
- title: 'Accent color'
92
+ $setStateCollection: ({ state }) => [{
93
+ title: 'Accent color',
94
+ value: state[0]
94
95
  }, {
95
- title: 'Secondary Color'
96
+ title: 'Secondary Color',
97
+ value: state[1]
96
98
  }, {
97
- title: 'Inactive Color'
99
+ title: 'Inactive Color',
100
+ value: state[2]
98
101
  }]
99
102
  }
100
103
 
@@ -13,7 +13,7 @@ export const Init = {
13
13
  props: {
14
14
  boxSize: '100% 100%',
15
15
  gap: 'A',
16
- padding: '10% E1 D1 15%'
16
+ padding: '7.5% E1 D1 12.5%'
17
17
  },
18
18
 
19
19
  define: { routes: param => param },
package/src/style.js CHANGED
@@ -3,5 +3,9 @@
3
3
  export default {
4
4
  boxSizing: 'border-box',
5
5
  overflow: 'hidden',
6
- overflowY: 'auto'
6
+ overflowY: 'auto',
7
+ cursor: 'default',
8
+ 'button, a': {
9
+ cursor: 'default'
10
+ }
7
11
  }
@@ -1,134 +0,0 @@
1
- 'use strict'
2
-
3
- import { Flex, ColorSelectWithTitle } from '@symbo.ls/components'
4
- import { Input } from 'smbls'
5
-
6
- import { ContinueButton, UploadImage, ColorsPalette } from '../../components'
7
-
8
- const colors = {
9
- extend: Flex,
10
- props: {
11
- width: 'F3',
12
- flow: 'column',
13
- gap: 'B1',
14
- opacity: '.75'
15
- },
16
- childExtend: {
17
- extend: ColorSelectWithTitle,
18
- props: ({ state }) => ({
19
- width: '100%',
20
- title: { text: state.title },
21
- element: {
22
- padding: 'Y Y Y Z1',
23
- title: {
24
- box: {
25
- boxSize: 'A2 A2',
26
- position: 'relative',
27
- zIndex: 2,
28
- background: 'white .05',
29
- '::-webkit-color-swatch-wrapper': {
30
- padding: '0'
31
- },
32
- '::-webkit-color-swatch': {
33
- border: 'none',
34
- round: 'Y'
35
- }
36
- },
37
- value: {
38
- round: 'Z',
39
- position: 'absolute',
40
- inset: '0 0 0 0',
41
- padding: '- - - B2+W',
42
- textAlign: 'start',
43
- lineHeight: '100%',
44
- placeholder: 'Color value',
45
- ':focus': {
46
- outline: 'solid, X, blue .3'
47
- }
48
- }
49
- }
50
- }
51
- }),
52
- title: {},
53
- element: {
54
- title: {
55
- box: {
56
- extend: 'Focusable',
57
- tag: 'input',
58
- attr: {
59
- type: 'color',
60
- value: ({ state }) => 'rgba(255,255,255,0.05)'
61
- },
62
- props: {
63
- border: '0',
64
- padding: '0',
65
- style: {
66
- appearance: 'none'
67
- }
68
- },
69
- on: {
70
- update: (el, s) => {
71
- el.node.value = s.value || ''
72
- },
73
- input: (ev, el, s) => {
74
- s.update({ value: el.node.value || '' })
75
- }
76
- }
77
- },
78
- value: {
79
- extend: Input,
80
- on: {
81
- update: (el, s) => {
82
- el.node.value = s.value || ''
83
- },
84
- input: (ev, el, s) => {
85
- s.update({ value: el.node.value || '' })
86
- }
87
- }
88
- }
89
- },
90
- buttons: null
91
- }
92
- },
93
-
94
- $setStateCollection: () => [{
95
- title: 'Accent color'
96
- }, {
97
- title: 'Secondary Color'
98
- }, {
99
- title: 'Inactive Color'
100
- }]
101
- }
102
-
103
- const content = {
104
- extend: Flex,
105
- props: {
106
- margin: '- - F -',
107
- align: 'flex-start',
108
- gap: 'E2',
109
- ColorsPalette: {
110
- margin: '- - - auto'
111
- }
112
- },
113
-
114
- colors,
115
- UploadImage,
116
- ColorsPalette
117
- }
118
-
119
- const props = {
120
- // style: { border: '5px solid red' }
121
- }
122
-
123
- export const CreatePallete = {
124
- props,
125
-
126
- HeaderHeading: {
127
- margin: '- - D -',
128
- title: { text: `Let's get started` },
129
- h1: { text: 'Create your palette' }
130
- },
131
-
132
- content,
133
- ContinueButton
134
- }
@@ -1,13 +0,0 @@
1
- 'use strict'
2
-
3
- export const fontText = {
4
-
5
- HeaderHeading: {
6
- props: { margin: '- - D2 -' },
7
- caption: { text: `Let's make sure` },
8
- h1: { text: 'Texts look good?' }
9
- },
10
-
11
- FontText: {},
12
- ContinueButton: { props: { margin: 'F - - -' } }
13
- }
@@ -1,132 +0,0 @@
1
- 'use strict'
2
-
3
- import { Flex, CommonField, WiderButton, Button } from '@symbo.ls/components'
4
-
5
- import { HeaderHeading } from '../../components'
6
-
7
- const header = {
8
- extend: HeaderHeading,
9
- props: {
10
- margin: '- - D -',
11
- caption: { text: 'And finally' },
12
- h1: {
13
- text: 'Choose your environment',
14
- flow: 'row-reverse',
15
- align: 'center flex-end',
16
- span: {
17
- text: 'if any',
18
- fontWeight: '300',
19
- opacity: '.85',
20
- padding: '- - - X'
21
- },
22
- span2: {
23
- text: ',',
24
- fontWeight: '300',
25
- opacity: '.85'
26
- }
27
- }
28
- },
29
-
30
- caption: {},
31
- h1: {
32
- extend: Flex,
33
- span: {},
34
- span2: { }
35
- }
36
- }
37
-
38
- const commonField = {
39
- extend: CommonField,
40
- props: {
41
- gap: 'Z2',
42
- element: {
43
- gap: 'A',
44
- maxWidth: 'I',
45
- alignItems: 'center',
46
- childProps: {
47
- // boxSize: 'B2 C',
48
- // padding: '0',
49
- background: 'gray2',
50
- color: 'white .8',
51
- round: 'Z1'
52
- }
53
- }
54
- },
55
-
56
- title: {},
57
- element: {
58
- extend: Flex,
59
- childExtend: {
60
- extend: WiderButton
61
- }
62
- }
63
- }
64
- const yourEnvironment = {
65
- extend: commonField,
66
- props: {
67
- margin: '- - C2 -',
68
- title: { text: 'Your environment' },
69
- element: {
70
- childProps: {}
71
- }
72
- },
73
-
74
- title: {},
75
- element: {
76
- ...[
77
- { props: { icon: 'inputOutline' } },
78
- { props: { icon: 'accessibilityOutline' } },
79
- {
80
- props: {
81
- boxSizing: 'content-box',
82
- padding: 'Z C3',
83
- border: '2px solid red',
84
- style: { borderRadius: '50px' },
85
- span: {
86
- text: `I'm just playing`,
87
- fontSize: 'Z'
88
- }
89
- },
90
- icon: null,
91
- span: {}
92
- },
93
-
94
- {
95
- props: {
96
- icon: 'inputOutline',
97
- margin: '- - - auto'
98
- }
99
- }
100
- ]
101
- }
102
- }
103
-
104
- const yourFramework = {
105
- extend: commonField,
106
- props: {
107
- margin: '- - F -',
108
- title: { text: 'Your framework' },
109
- element: { childProps: { icon: 'info' } }
110
- },
111
- title: {},
112
- element: { ...[{}, {}, {}, {}, {}, {}] }
113
- }
114
-
115
- const createSymbolsButton = {
116
- extend: Button,
117
- props: {
118
- text: 'create symbols',
119
- fontSize: 'Z2',
120
- padding: 'Z1 C',
121
- textTransform: 'capitalize',
122
- round: 'C',
123
- theme: 'primary'
124
- }
125
- }
126
-
127
- export const chooseEnvironment = {
128
- header,
129
- yourEnvironment,
130
- yourFramework,
131
- createSymbolsButton
132
- }
@@ -1,121 +0,0 @@
1
- 'use strict'
2
-
3
- import { Flex, GlobalThemeTemplate, Hoverable } from '@symbo.ls/components'
4
-
5
- import { ContinueButton, HeaderHeading } from '../../components'
6
-
7
- const header = {
8
- extend: HeaderHeading
9
- }
10
-
11
- const paragraphs = {
12
- extend: Flex,
13
- childExtend: { tag: 'p' },
14
- ...[{ text: 'To personalize your Symbols experience, we need to get started with themes' },
15
- { text: 'Please fill in the document dark and light themes' }]
16
- }
17
-
18
- const modes = {
19
- extend: Flex,
20
- props: {
21
- gap: 'C',
22
- margin: '- - E2 -'
23
- },
24
- childExtend: {
25
- extend: [Hoverable, GlobalThemeTemplate],
26
- props: ({ state }) => ({
27
- minWidth: 'G3',
28
- maxWidth: '406px',
29
- position: 'relative',
30
- maxHeight: 'F',
31
- boxSizing: 'content-box',
32
- align: 'flex-start flex-start',
33
- padding: 'A2 A X X1',
34
- overflow: 'hidden',
35
- round: 'A1',
36
- background: state.background,
37
- wrap: 'wrap',
38
- icon: {
39
- padding: '0',
40
- boxSize: 'C C',
41
- margin: '- - - Z2',
42
- background: 'yellow .3',
43
- style: {
44
- pointerEvents: 'none',
45
- '> svg': { fontSize: `${22 / 16}em` }
46
- }
47
- },
48
- article: {
49
- padding: 'X2 - - -',
50
- title: { fontSize: 'D2' }
51
- },
52
- span: { text: 'hover to change' },
53
-
54
- ':hover': {
55
- style: {
56
- '[buttons]': {
57
- opacity: '1',
58
- transform: 'translate3d(0, 0, 0)'
59
- }
60
- }
61
- }
62
- }),
63
-
64
- icon: {},
65
- article: {},
66
-
67
- ThemeButtons: {
68
- transform: 'translate3d(0, 150%, 0)',
69
- transition: 'B default-bezier',
70
- transitionProperty: 'transform, opacity',
71
- opacity: '0',
72
- margin: 'C1 0 0 0',
73
- alignSelf: 'flex-end'
74
- },
75
-
76
- span: {
77
- props: {
78
- position: 'absolute',
79
- bottom: 'A2',
80
- left: 'B',
81
- fontSize: 'Z',
82
- color: 'gray7',
83
- style: { fontStyle: 'italic' }
84
- }
85
- }
86
- },
87
-
88
- $setStateCollection: () => [{
89
- title: 'Night',
90
- key: 'dark',
91
- icon: 'moon',
92
- background: 'gray3'
93
- }, {
94
- title: 'Dark',
95
- key: 'light',
96
- icon: 'sun',
97
- background: 'white'
98
- }]
99
- }
100
-
101
- const props = {
102
- header: { margin: '- - C2 -' },
103
- paragraphs: {
104
- gap: 'E',
105
- margin: '- - D1 -',
106
- childProps: {
107
- fontSize: 'Z1',
108
- color: 'gray6',
109
- maxWidth: `${272 / 14}em`
110
- }
111
- }
112
- }
113
-
114
- export const themeLightDark = {
115
- props,
116
-
117
- header,
118
- paragraphs,
119
- modes,
120
- ContinueButton
121
- }