@symbo.ls/preview 0.0.23 → 0.0.24

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.
@@ -0,0 +1,49 @@
1
+ 'use strict'
2
+
3
+ export const styleLabel = {
4
+ caption: { whiteSpace: 'nowrap', opacity: 0.65 },
5
+ span: {
6
+ display: 'block',
7
+ whiteSpace: 'nowrap',
8
+ minWidth: `1.618em`,
9
+ maxWidth: 'fit-content',
10
+ borderBottom: '1px dashed rgba(255, 255, 255, .35)',
11
+ outline: 'none'
12
+ }
13
+ }
14
+
15
+ export const styleTool = {
16
+ caption: { opacity: '.65' },
17
+ '> div span': { opacity: '.5' },
18
+ '> div > div': { gap: '1px' }
19
+ }
20
+ export const styleColorTones = {
21
+ width: '22em',
22
+ display: 'flex',
23
+ flexDirection: 'column',
24
+ '> div > button': {
25
+ padding: `${123 / 16}em`,
26
+ position: 'absolute'
27
+ },
28
+ caption: {
29
+ textTransform: 'capitalize',
30
+ opacity: '.65',
31
+ marginBottom: `${10 / 13}em`
32
+ }
33
+ }
34
+
35
+ export default {
36
+ display: 'flex',
37
+ flexFlow: 'column',
38
+ 'header > nav a:hover': {
39
+ background: 'rgba(255, 255, 255, .08)',
40
+ opacity: 1,
41
+ color: '#EDCB38'
42
+ },
43
+
44
+ '> section': {
45
+ display: 'flex',
46
+ gap: '6.6em',
47
+ border: '2px solid red'
48
+ }
49
+ }
@@ -0,0 +1,107 @@
1
+ 'use strict'
2
+
3
+ import { Grid, ColorSwitcher, CommonField, SelectTool, ButtonSet, ClickableItem } from '@symbo.ls/components'
4
+
5
+
6
+ ColorSwitcher.props = (el, s) => {
7
+ if (!s.value) return
8
+ const value = s.value[el.props.type] || s.value[el.props.type + 'Color']
9
+ const key = filterByValue(value).key || value
10
+ return {
11
+ key: key,
12
+ value: value
13
+ }
14
+ }
15
+
16
+ export const themingTools = {
17
+ extend: Grid,
18
+ style: {
19
+ width: 'fit-content'
20
+ },
21
+ props: {
22
+ columns: 'repeat(4, 1fr)',
23
+ columnGap: 'C',
24
+ rowGap: 'C'
25
+ },
26
+ childExtend: {
27
+ extend: CommonField,
28
+ props: { padding: 0 },
29
+ caption: { text: el => el.parent.props.caption },
30
+ element: {}
31
+ },
32
+ ...[{
33
+ props: { caption: 'Background color' },
34
+ caption: {},
35
+ element: {
36
+ extend: ColorSwitcher,
37
+ props: { type: 'background' },
38
+
39
+ title: {},
40
+ buttons: { ...[
41
+ { props: { icon: 'plus' } },
42
+ { props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
43
+ ] }
44
+ }
45
+ }, {
46
+ props: { caption: 'Text color' },
47
+ caption: {},
48
+ element: {
49
+ extend: ColorSwitcher,
50
+ props: { type: 'color' },
51
+
52
+ title: {},
53
+ buttons: { ...[
54
+ { props: { icon: 'colorInvert' } },
55
+ { props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
56
+ ] }
57
+ }
58
+ }, {
59
+ props: { caption: 'Border color' },
60
+ caption: {},
61
+ element: {
62
+ extend: ColorSwitcher,
63
+ props: { type: 'border' },
64
+
65
+ title: {},
66
+ buttons: { ...[
67
+ { props: { icon: 'colorInvert' } },
68
+ { props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }
69
+ ] }
70
+ }
71
+ }, {
72
+ props: { caption: 'Use as' },
73
+ caption: {},
74
+ element: {
75
+ extend: SelectTool,
76
+ title: { props: { text: 'Background color' } },
77
+ buttons: { ...[{ props: { icon: 'arrowAngleMirroringVertical', theme: 'transparent' } }] }
78
+ }
79
+ },
80
+
81
+ {
82
+ props: { caption: 'Border' },
83
+ caption: {},
84
+ element: {
85
+ extend: ButtonSet,
86
+ childExtend: { extend: [ClickableItem] },
87
+ props: { gap: 'Z' },
88
+ ...[
89
+ { props: { icon: 'colorsColored' } },
90
+ { props: { icon: 'borderOpacity' } },
91
+ { props: { icon: 'borderWeight' } },
92
+ { props: { icon: 'borderProps' } }
93
+ ]
94
+ }
95
+ },
96
+
97
+ {
98
+ props: { caption: 'Shadow' },
99
+ caption: {},
100
+ element: {
101
+ extend: ButtonSet,
102
+ childExtend: { extend: [ClickableItem] },
103
+ ...[{ props: { icon: 'plus' } }]
104
+ }
105
+ }
106
+ ]
107
+ }
@@ -0,0 +1,90 @@
1
+ 'use strict'
2
+
3
+ import { Flex, SectionHeader, SelectField, IconButton } from '@symbo.ls/components'
4
+ import stylesHelpers from './stylesHelpers'
5
+
6
+ export default {
7
+ header: {
8
+ extend: SectionHeader,
9
+ state: {
10
+ title: 'Document Styles',
11
+ p: 'Document styling and theming provides global themes of the entire app, imagine it as a :root styling'
12
+ }
13
+ },
14
+
15
+ fields: {
16
+ extend: Flex,
17
+ props: { gap: 'A' },
18
+
19
+ interactivities: {
20
+ extend: Flex,
21
+ props: {
22
+ gap: 'A'
23
+ },
24
+ childExtend: {
25
+ extend: SelectField,
26
+ props: {
27
+ justifyContent: 'space-between',
28
+ svg: { color: 'rgba(255, 255, 255, .35)' },
29
+ icon: { name: 'plus' }
30
+ },
31
+
32
+ title: {},
33
+ buttons: {
34
+ ...[{ props: { icon: 'plus' } }]
35
+ }
36
+ },
37
+
38
+ ...[{
39
+ props: {
40
+ title: {
41
+ text: '<p>'
42
+ }
43
+ }
44
+ }, {
45
+ props: {
46
+ title: {
47
+ text: '<code>'
48
+ }
49
+ }
50
+ }, {
51
+ props: {
52
+ title: {
53
+ text: '<pre>'
54
+ }
55
+ }
56
+ }]
57
+ },
58
+
59
+ plus: {
60
+ extend: IconButton,
61
+ props: {
62
+ theme: 'quaternary',
63
+ position: 'relative',
64
+ icon: 'plus'
65
+ }
66
+ },
67
+
68
+ addsomething: {
69
+ extend: SelectField,
70
+ props: {
71
+ position: 'relative',
72
+ title: {
73
+ text: 'Choose element'
74
+ }
75
+ },
76
+ title: {},
77
+ buttons: {
78
+ ...[{
79
+ props: { icon: 'plus' }
80
+ }, {
81
+ props: { icon: 'arrowAngleDown' }
82
+ }]
83
+ }
84
+ }
85
+ },
86
+
87
+ Line: {},
88
+
89
+ stylesHelpers
90
+ }
@@ -1,27 +1,19 @@
1
1
  'use strict'
2
2
 
3
- import { SectionHeader } from '@symbo.ls/components' // eslint-disable-line no-unused-vars
4
-
5
3
  import state from './state'
6
4
 
7
- import documentStyle from './docStyles'
8
- import { TypeScale } from './typeScale'
5
+ import documentStyles from './documentStyles'
6
+ import typeScale from './typeScale'
9
7
 
10
8
  export const Typography = {
11
- define: { routes: param => param },
12
-
13
9
  state,
14
10
 
15
- routes: {
16
- '/': TypeScale,
17
- '/document-styles': documentStyle
11
+ SectionHeader: {
12
+ title: 'Typography',
13
+ p: 'A general configuration of type properties on the document.'
18
14
  },
19
15
 
20
- // header: {
21
- // extend: SectionHeader
22
- // },
23
-
24
- page: {
25
- TypeScale
26
- }
16
+ // typeScale,
17
+ Line: {},
18
+ documentStyles
27
19
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { IncDecButtons } from '@symbo.ls/components'
4
4
 
5
- export const Range0Buttons = {
5
+ export const range0Buttons = {
6
6
  extend: IncDecButtons,
7
7
 
8
8
  ...[{
@@ -10,11 +10,10 @@ export const Range0Buttons = {
10
10
  click: (ev, el) => {
11
11
  const { state } = el
12
12
  const { range } = state
13
- if (range[0] + 1 < 0) {
13
+ if (range[0] < 0) {
14
14
  ++range[0]
15
15
  state.update()
16
16
  }
17
- console.log(range)
18
17
  }
19
18
  }
20
19
  }, {
@@ -31,7 +30,7 @@ export const Range0Buttons = {
31
30
  }]
32
31
  }
33
32
 
34
- export const Range1Buttons = {
33
+ export const range1Buttons = {
35
34
  extend: IncDecButtons,
36
35
  ...[{
37
36
  on: {
@@ -11,9 +11,6 @@ export default {
11
11
  // subSequence: true,
12
12
  type: 'demo-font-size',
13
13
 
14
- title: 'Typography',
15
- p: 'A general configuration of type properties on the document.',
16
-
17
14
  sampleText: 'Today is a big day for our tribe. The year ends.',
18
15
  activeTab: ''
19
16
  }
@@ -0,0 +1,54 @@
1
+ 'use strict'
2
+
3
+ import {
4
+ Grid,
5
+ SectionHeader,
6
+ TypeHelperObject
7
+ } from '@symbo.ls/components'
8
+
9
+ export default {
10
+ header: {
11
+ extend: SectionHeader,
12
+ state: {
13
+ title: 'Helpers',
14
+ p: 'Document styling and theming provides global themes of the entire app, imagine it as a <body> styling',
15
+ nav: [{
16
+ href: '/typography/document-style',
17
+ icon: 'plus'
18
+ }]
19
+ }
20
+ },
21
+
22
+ content: {
23
+ extend: Grid,
24
+ props: { columns: 'repeat(3, 1fr)' },
25
+
26
+ childProto: TypeHelperObject,
27
+
28
+ $setCollection: () => [{
29
+ p: {
30
+ text: 'Headline',
31
+ style: { fontSize: `${48 / 16}em` }
32
+ }
33
+ }, {
34
+ p: {
35
+ text: 'Headline 2',
36
+ style: { fontSize: `${40 / 16}em` }
37
+
38
+ }
39
+ }, {
40
+ p: '',
41
+ span: {
42
+ props: {
43
+ fontSize: 'Y',
44
+ padding: 'B 0 0 0'
45
+ },
46
+ text: 'Fontnote'
47
+ }
48
+ // p: {
49
+ // text: 'Footnote',
50
+ // style: { fontSize: `${12 / 16}em` }
51
+ // }
52
+ }]
53
+ }
54
+ }
@@ -2,96 +2,81 @@
2
2
 
3
3
  import {
4
4
  TypeScaleSequence,
5
- SequenceSliders,
6
5
  Grid,
7
- Flex,
8
- TestText
6
+ TestText,
7
+ Flex
9
8
  } from '@symbo.ls/components'
10
9
 
11
10
  import { mapSequence, sortSequence } from '@symbo.ls/utils'
11
+ import { range0Buttons, range1Buttons } from './rangeButtons'
12
12
 
13
- import { TypeSection } from './shared'
14
- import { Range0Buttons, Range1Buttons } from './rangeButtons'
13
+ export default {
14
+ extend: Grid,
15
15
 
16
- export const TypeScale = {
17
- extend: TypeSection,
16
+ props: {
17
+ gap: 'D',
18
+ columns: '16em auto',
19
+ align: 'flex-start flex-start',
18
20
 
19
- header: {
20
- state: {
21
- title: 'TypeScale',
22
- p: 'Generate text sequence by a base size and ratio'
23
- }
24
- },
25
-
26
- grid: {
27
- extend: Grid,
21
+ sidebar: {
22
+ padding: 'B 0 0',
23
+ position: 'sticky',
24
+ top: 'E2'
25
+ },
28
26
 
29
- props: {
30
- gap: 'D',
31
- columns: '16em auto',
32
- align: 'flex-start flex-start',
27
+ content: {
28
+ overflow: 'hidden',
29
+ flow: 'column',
30
+ gap: 'C',
33
31
 
34
- sidebar: {
35
- padding: 'B 0 0',
36
- position: 'sticky',
37
- top: 'E2'
32
+ header: {
33
+ align: 'flex-end space-between',
34
+ padding: '0 0 0 C',
35
+ gap: 'C1'
38
36
  },
39
37
 
40
- content: {
41
- overflow: 'hidden',
42
- flow: 'column',
43
- gap: 'C',
44
-
45
- header: {
46
- align: 'flex-end space-between',
47
- padding: '0 0 0 C',
48
- gap: 'C1'
49
- },
50
-
51
- footer: {
52
- padding: '0 0 0 C'
53
- }
38
+ footer: {
39
+ padding: '0 0 0 C'
54
40
  }
55
- },
41
+ }
42
+ },
56
43
 
57
- sidebar: {
58
- sliders: {
59
- extend: SequenceSliders,
60
- props: { flow: 'column' }
61
- },
44
+ sidebar: {
45
+ SectionHeader: {
46
+ title: 'TypeScale',
47
+ p: 'Generate text sequence by a base size and ratio'
48
+ },
62
49
 
63
- p: {
64
- extend: 'Paragraph',
65
- props: {
66
- margin: '0',
67
- fontSize: 'Z2',
68
- padding: 'B2 0',
69
- text: `Base size and ratio sequentially generate set by multiplying each next calculated unit by the ratio.`
70
- }
71
- }
50
+ SequenceSliders: {
51
+ flow: 'column'
72
52
  },
73
53
 
74
- content: {
75
- extend: Flex,
54
+ Paragraph: {
55
+ margin: '0',
56
+ fontSize: 'Z2',
57
+ padding: 'B2 0',
58
+ text: `Base size and ratio sequentially generate set by multiplying each next calculated unit by the ratio.`
59
+ }
60
+ },
76
61
 
77
- header: {
78
- extend: Flex,
79
- Range0Buttons,
80
- TestText
81
- },
62
+ content: {
63
+ extend: Flex,
82
64
 
83
- sequence: {
84
- extend: TypeScaleSequence,
85
- $setCollection: (el) => {
86
- const { state } = el
87
- el.removeContent()
88
- return mapSequence(state, sortSequence)
89
- }
90
- },
65
+ header: {
66
+ extend: Flex,
67
+ range0Buttons,
68
+ TestText
69
+ },
91
70
 
92
- footer: {
93
- Range1Buttons
71
+ sequence: {
72
+ extend: TypeScaleSequence,
73
+ $setCollection: (el) => {
74
+ const { state } = el
75
+ state.sequence = {}
76
+ return mapSequence(state, sortSequence)
94
77
  }
95
- }
78
+ },
79
+
80
+ footer: { range1Buttons }
96
81
  }
97
82
  }
@@ -7,7 +7,7 @@ export * from './Fonts'
7
7
  export * from './Icons'
8
8
  export * from './Library'
9
9
  export * from './Color'
10
- export * from './ColorEditor'
10
+ export * from './Theme'
11
11
  export * from './Shapes'
12
12
  export * from './Spaces'
13
13
  export * from './Typography'
@@ -1,100 +0,0 @@
1
- 'use strict'
2
-
3
- import {
4
- Icon, Link,
5
- TypeHelpers,
6
- DocumentStylesSequence
7
- } from '@symbo.ls/components'
8
- import { TypeSection } from './shared'
9
-
10
- import { interactivityButton } from '../ColorEditor'
11
-
12
- export default {
13
- extend: TypeSection,
14
-
15
- header: {
16
- state: {
17
- p: 'Document styling and theming provides global themes of the entire app, imagine it as a :root styling'
18
- },
19
- heading: {
20
- title: null
21
- },
22
- nav: {
23
- add: {
24
- extend: Link,
25
- props: {
26
- href: '/typography/document-styles/html-tags',
27
- icon: 'plus'
28
- }
29
- }
30
- }
31
- },
32
-
33
- wrapper: {
34
- bodyTags: {
35
-
36
- cnt: {
37
- style: { flex: 1 },
38
-
39
- fonts: DocumentStylesSequence,
40
-
41
- interactivities: {
42
- style: {
43
- paddingLeft: '8em',
44
- display: 'flex',
45
- gap: '1em',
46
- marginTop: '1em'
47
- },
48
- childExtend: {
49
- extend: interactivityButton,
50
- style: {
51
- display: 'flex',
52
- justifyContent: 'space-Between',
53
- svg: { color: 'rgba(255, 255, 255, .35)' }
54
- },
55
- props: {
56
- icon: 'plus'
57
- }
58
- },
59
- ...[{
60
- style: { width: '145px' },
61
- props: { text: '<p>' }
62
- }, {
63
- style: { width: '145px' },
64
- props: { text: '<code>' }
65
- }, {
66
- style: { width: '145px' },
67
- props: { text: '<pre>' }
68
- }, {
69
- props: {
70
- padding: 'Z',
71
- text: ''
72
- }
73
- }, {
74
- style: {
75
- position: 'relative',
76
- width: '207px'
77
- },
78
- props: {
79
- text: 'Choose element'
80
- },
81
- icon2: {
82
- extend: Icon,
83
- props: { icon: 'arrowAngleDown' },
84
- style: {
85
- paddingRight: `${12.5 / 16}em`,
86
- marginRight: `${12.5 / 16}em`,
87
- borderRight: '1px solid rgba(255, 255, 255, .1)',
88
- position: 'absolute',
89
- right: `${25 / 16}em`,
90
- height: '80%'
91
- }
92
- }
93
- }]
94
- }
95
- }
96
- },
97
-
98
- TypeHelpers
99
- }
100
- }