@symbo.ls/preview 0.0.21 → 0.0.23

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.
@@ -14,6 +14,7 @@ const component = {
14
14
  props: {
15
15
  theme: 'secondary',
16
16
  background: 'blue .2',
17
+ fontSize: 'A2',
17
18
  color: 'white',
18
19
  padding: 'Y2',
19
20
  icon: null,
@@ -11,6 +11,40 @@ const category = CATEGORIES[1]
11
11
 
12
12
  const component = {
13
13
  extend: KangorooButton,
14
+
15
+ props: {
16
+ theme: 'quinary',
17
+ round: 'Z2',
18
+ padding: 'X1 X1 X1 A2',
19
+ size: 'A',
20
+ gap: 'A',
21
+ transition: 'A defaultBezier',
22
+ transitionProperty: 'background, color, opacity',
23
+ color: 'white',
24
+
25
+ label: {
26
+ gap: 'X1',
27
+ text: 'Become PRO',
28
+ alignItems: 'center',
29
+ color: 'white',
30
+ fontWeight: '500',
31
+ icon: {
32
+ name: 'star',
33
+ color: 'yellow'
34
+ }
35
+ },
36
+ child: {
37
+ background: 'black .65',
38
+ round: 'Z',
39
+ size: 'Z',
40
+ padding: 'Z A2',
41
+ text: '1 month free',
42
+ opacity: '.85'
43
+ }
44
+ },
45
+
46
+ label: {},
47
+ child: {}
14
48
  }
15
49
 
16
50
  const code = {
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { CATEGORIES } from '../categories'
4
4
 
5
- import style from './style'
6
5
  import { KangorooButton } from '@symbo.ls/components'
7
6
  import { isObject } from 'domql/src/utils'
8
7
 
@@ -12,41 +11,48 @@ const description = ''
12
11
  const category = CATEGORIES[1]
13
12
 
14
13
  const component = {
15
- style: style,
16
14
  extend: KangorooButton,
17
15
 
16
+ childExtend: {
17
+
18
+ },
19
+
18
20
  props: {
19
21
  round: 'C',
20
- size: 'A',
21
- padding: 'X1 Y X1 A1',
22
+ padding: 'V2 V2 V2 A1',
22
23
  gap: 'Z1',
23
24
  depth: 16,
24
-
25
- light: {
26
- icon: 'sun',
27
- text: 'Light Mode'
25
+ fontWeight: '500',
26
+
27
+ label: {
28
+ gap: 'X1',
29
+ text: 'Light Mode',
30
+ padding: 'Z2 X',
31
+ icon: {
32
+ color: 'yellow',
33
+ name: 'sun'
34
+ }
28
35
  },
29
36
 
30
37
  child: {
38
+ gap: 'X1',
31
39
  round: 'C',
32
- icon: 'moon',
33
- padding: 'Z Z1',
34
- text: 'Dark Mode'
40
+ text: 'Dark Mode',
41
+ background: 'black .95',
42
+ color: 'white',
43
+ padding: 'Z2 A2',
44
+ icon: {
45
+ color: 'yellow',
46
+ name: 'moon'
47
+ }
35
48
  }
36
49
  },
37
50
 
38
- iconText: {},
51
+ label: {},
39
52
  child: {}
40
53
  }
41
54
 
42
- function strfy (obj) {
43
- return Object.entries(obj).reduce((str, [p, val]) => {
44
- return `${str}${p}::${isObject(val) ? strfy(val) : val}\n`;
45
- }, '');
46
- }
47
-
48
- const code = strfy(component)
49
- const code2 = `{
55
+ const code = `{
50
56
  extend: KangorooButton,
51
57
  props: {
52
58
  round: 'C',
@@ -2,7 +2,6 @@
2
2
 
3
3
  import { CATEGORIES } from '../categories'
4
4
 
5
- import style from './style'
6
5
  import { Button, User } from '@symbo.ls/components'
7
6
 
8
7
  const key = 'button-user'
@@ -13,7 +12,6 @@ const category = CATEGORIES[1]
13
12
  const component = {
14
13
  extend: Button,
15
14
  tag: 'label',
16
- style,
17
15
 
18
16
  props: (el, s) => ({
19
17
  size: 'A',
@@ -21,19 +19,32 @@ const component = {
21
19
  depth: 16,
22
20
  gap: 'Y2',
23
21
  padding: 'W2 A W2 W2',
24
- icon: 'arrowAngleDown',
22
+ theme: 'tertiary',
23
+
24
+ position: 'relative',
25
+ cursor: 'pointer',
26
+
27
+ user: {
28
+ boxSize: 'B1 B1',
29
+ },
30
+
31
+ select: {
32
+ outline: 'none',
33
+ appearance: 'none',
34
+ border: 'none',
35
+ width: '100%',
36
+ height: '100%',
37
+ background: 'none',
38
+ color: 'currentColor',
39
+ fontSize: 'A',
40
+ lineHeight: 1,
41
+ padding: '0 A 0 0'
42
+ },
25
43
  }),
26
44
 
27
- user: {
28
- extend: User,
29
- props: { boxSize: 'B1 B1' },
30
- class: { dis: { pointerEvents: 'none' } }
31
- },
45
+ user: { extend: User },
32
46
  select: {
33
- attr: {
34
- name: 'user',
35
- id: 'user'
36
- },
47
+ attr: { name: 'user', id: 'user' },
37
48
  childExtend: { tag: 'option' },
38
49
  ...[
39
50
  { text: 'Kevin' },
@@ -54,13 +65,7 @@ const code = `{
54
65
  }`
55
66
 
56
67
  const defaultState = {}
57
- const props = {
58
- size: 'A',
59
- round: 'C',
60
- depth: 16,
61
- icon: 'arrowAngleDown',
62
- theme: 'quaternary'
63
- }
68
+ const props = {}
64
69
 
65
70
  const settings = {
66
71
  gridOptions: { colspan: 4, rowspan: 2 }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { CATEGORIES } from '../categories'
4
4
 
5
- import { Field } from '@symbo.ls/components'
5
+ import { Field, Input } from 'smbls'
6
6
 
7
7
  const key = 'field'
8
8
  const title = 'Field'
@@ -10,8 +10,9 @@ const description = ''
10
10
  const category = CATEGORIES[2]
11
11
 
12
12
  const component = {
13
- extend: Field,
13
+ extend: Input,
14
14
  props: (el, s) => ({
15
+ placeholder: 'Text in me'
15
16
  })
16
17
  }
17
18
 
@@ -2,8 +2,7 @@
2
2
 
3
3
  import { CATEGORIES } from '../categories'
4
4
 
5
- import style from './style'
6
- import { Notification } from '@symbo.ls/components'
5
+ import { Notification } from 'smbls'
7
6
 
8
7
  const key = 'notification'
9
8
  const title = 'Notification'
@@ -11,11 +10,8 @@ const description = ''
11
10
  const category = CATEGORIES[4]
12
11
 
13
12
  const component = {
14
- style,
15
13
  extend: Notification,
16
- props: {
17
- theme: 'alert'
18
- }
14
+ props: { theme: 'alert' }
19
15
  }
20
16
 
21
17
  const code = `{
@@ -10,7 +10,9 @@ const description = ''
10
10
  const category = CATEGORIES[CATEGORIES.length - 1]
11
11
 
12
12
  const component = {
13
- extend: Pills
13
+ extend: Pills,
14
+ state: { active: 1 },
15
+ ...[{}, {}, {}, {}, {}]
14
16
  }
15
17
 
16
18
  const code = `{}`
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { CATEGORIES } from '../categories'
4
4
 
5
- import { Tooltip } from '@symbo.ls/components'
5
+ import { Tooltip } from 'smbls'
6
6
 
7
7
  const key = 'tooltip'
8
8
  const title = 'Tooltip'
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@symbo.ls/preview",
3
3
  "description": "",
4
4
  "author": "",
5
- "version": "0.0.21",
5
+ "version": "0.0.23",
6
6
  "repository": "https://github.com/rackai/editor",
7
7
  "main": "src/index.js",
8
8
  "scripts": {
package/src/app.js CHANGED
@@ -51,10 +51,10 @@ const App = {
51
51
  },
52
52
 
53
53
  content: {
54
- style: { position: 'relative' }
54
+ props: { position: 'relative' }
55
55
  },
56
56
 
57
- Modal,
57
+ modal: Modal,
58
58
 
59
59
  on: {
60
60
  render: element => {
package/src/index.js CHANGED
@@ -26,7 +26,7 @@ export default DOM.create({
26
26
  extend: App,
27
27
  style,
28
28
 
29
- Header,
29
+ header: Header,
30
30
  routes: {
31
31
  '/': Library
32
32
  }
@@ -10,10 +10,9 @@ import scene from './scene'
10
10
  import tools from './tools'
11
11
  import description from './description'
12
12
 
13
- import { LIBRARY } from '../../../.symbols'
14
13
  import { COMPONENT_ROUTES } from './const'
15
14
 
16
- const componentState = () => LIBRARY.filter(v => {
15
+ const componentState = (context) => context.LIBRARY.filter(v => {
17
16
  const key = window.location.pathname.split('component/')[1]
18
17
  return v.key === key
19
18
  })
@@ -28,8 +27,8 @@ export const Export = {
28
27
  padding: '0 Y2'
29
28
  },
30
29
 
31
- state: () => ({
32
- ...componentState()[0],
30
+ state: ({ context }) => ({
31
+ ...componentState(context)[0],
33
32
  ...state
34
33
  }),
35
34
 
@@ -33,11 +33,9 @@ export default {
33
33
 
34
34
  content: {
35
35
  props: {
36
- transition: 'all, B, cubic-bezier(.29,.67,.51,.97)',
36
+ transition: 'all, B, defaultBezier',
37
37
  style: {
38
- '*': {
39
- transition: 'all 255ms cubic-bezier(.29,.67,.51,.97)'
40
- }
38
+ '*': { transition: 'all 255ms cubic-bezier(.29,.67,.51,.97)' }
41
39
  }
42
40
  },
43
41
  comp: (el, s) => ({
@@ -20,28 +20,12 @@ const mapFonts = (el, s) => {
20
20
  title: v,
21
21
  href: `/fonts/font-settings/${v}`,
22
22
  labels: [
23
- { icon: 'variableFont', text: fontWeightCaption }
23
+ { icon: 'fontVariable', text: fontWeightCaption }
24
24
  ]
25
25
  }
26
26
  })
27
27
  }
28
28
 
29
- const mapFontFamilies = (el, s) => {
30
- if (!el.context.SYSTEM) return
31
- const { FONT_FAMILY } = el.context.SYSTEM
32
- const fontFamilyKeys = Object.keys(FONT_FAMILY)
33
-
34
- return fontFamilyKeys.map(v => {
35
- const val = FONT_FAMILY[v]
36
- if (v === 'default') return
37
- return {
38
- title: v,
39
- href: `/fonts/font-family/${v}`,
40
- val
41
- }
42
- }).filter(v => v)
43
- }
44
-
45
29
  const FontFaces = {
46
30
  extend: TypeSection,
47
31
  header: {
@@ -67,6 +51,22 @@ const FontFaces = {
67
51
  }
68
52
  }
69
53
 
54
+ const mapFontFamilies = (el, s) => {
55
+ if (!el.context.SYSTEM) return
56
+ const { FONT_FAMILY } = el.context.SYSTEM
57
+ const fontFamilyKeys = Object.keys(FONT_FAMILY)
58
+
59
+ return fontFamilyKeys.map(v => {
60
+ const val = FONT_FAMILY[v]
61
+ if (v === 'default') return
62
+ return {
63
+ title: v,
64
+ href: `/fonts/font-family/${v}`,
65
+ val
66
+ }
67
+ }).filter(v => v)
68
+ }
69
+
70
70
  const FontFamilies = {
71
71
  extend: TypeSection,
72
72
  props: { padding: '0 0 E 0' },
@@ -83,7 +83,7 @@ const FontFamilies = {
83
83
  content: {
84
84
  extend: Grid,
85
85
  props: {
86
- columns: 'repeat(3, 1fr)',
86
+ columns: 'repeat(4, 1fr)',
87
87
  gap: 'A',
88
88
  margin: '0 -Z'
89
89
  },
@@ -1,16 +0,0 @@
1
- 'use strict'
2
-
3
- export default {
4
- fontWeight: 'bold',
5
-
6
- svg: {
7
- color: '#EDCB38',
8
- marginRight: `${4 / 16}em`
9
- },
10
-
11
- span: {
12
- maxHeight: '32px',
13
- padding: `${9 / 14}em ${16 / 14}em`,
14
- marginLeft: `${16 / 14}em`
15
- }
16
- }
@@ -1,25 +0,0 @@
1
- 'use strict'
2
-
3
- export default {
4
- position: 'relative',
5
- cursor: 'pointer',
6
- svg: {
7
- pointerEvents: 'none',
8
- position: 'absolute',
9
- right: `${13 / 16}em`
10
- },
11
- select: {
12
- outline: 'none',
13
- appearance: 'none',
14
- border: 'none',
15
- width: '100%',
16
- height: '100%',
17
- background: 'none',
18
- boxSizing: 'border-box',
19
- color: 'currentColor',
20
- fontSize: '1em',
21
- lineHeight: 1,
22
- paddingRight: '1.618em'
23
- // paddingRight: `${16 / 16}em`
24
- }
25
- }
@@ -1,5 +0,0 @@
1
- 'use strict'
2
-
3
- export default {
4
- borderBottomLeftRadius: '.4em',
5
- }