@symbo.ls/preview 0.0.9

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.
Files changed (117) hide show
  1. package/.babelrc.js +5 -0
  2. package/.coveralls.yml +1 -0
  3. package/.eslintignore +1 -0
  4. package/.eslintrc.js +15 -0
  5. package/.prettierrc +4 -0
  6. package/.symbols/button-archived/index.js +63 -0
  7. package/.symbols/button-archived/style.js +5 -0
  8. package/.symbols/button-circle/index.js +62 -0
  9. package/.symbols/button-contacts/index.js +48 -0
  10. package/.symbols/button-contacts/style.js +13 -0
  11. package/.symbols/button-download/index.js +59 -0
  12. package/.symbols/button-pro/index.js +98 -0
  13. package/.symbols/button-pro/style.js +19 -0
  14. package/.symbols/button-theme-switcher/index.js +104 -0
  15. package/.symbols/button-theme-switcher/style.js +16 -0
  16. package/.symbols/button-user/index.js +82 -0
  17. package/.symbols/button-user/style.js +25 -0
  18. package/.symbols/categories.js +44 -0
  19. package/.symbols/datepicker/index.js +40 -0
  20. package/.symbols/datepicker/style.js +4 -0
  21. package/.symbols/dropdown-list/index.js +56 -0
  22. package/.symbols/field/index.js +40 -0
  23. package/.symbols/index.js +33 -0
  24. package/.symbols/label/index.js +40 -0
  25. package/.symbols/notification/index.js +49 -0
  26. package/.symbols/notification/style.js +5 -0
  27. package/.symbols/pills/index.js +37 -0
  28. package/.symbols/tooltip/index.js +38 -0
  29. package/.vscode/settings.json +3 -0
  30. package/README.md +19 -0
  31. package/app.webmanifest +4 -0
  32. package/index.html +22 -0
  33. package/package.json +48 -0
  34. package/protect-pwd.js +65 -0
  35. package/src/animations.js +71 -0
  36. package/src/app.js +79 -0
  37. package/src/assets/dots.png +0 -0
  38. package/src/assets/dotsDark.png +0 -0
  39. package/src/assets/fonts/FiraGO/FiraGO-Bold.woff2 +0 -0
  40. package/src/assets/fonts/FiraGO/FiraGO-Light.woff2 +0 -0
  41. package/src/assets/fonts/FiraGO/FiraGO-Medium.woff2 +0 -0
  42. package/src/assets/fonts/FiraGO/FiraGO-Regular.woff2 +0 -0
  43. package/src/assets/fonts/europa-bold-webfont.woff2 +0 -0
  44. package/src/assets/fonts/europa-bolditalic-webfont.woff2 +0 -0
  45. package/src/assets/fonts/europa-light-webfont.woff2 +0 -0
  46. package/src/assets/fonts/europa-lightitalic-webfont.woff2 +0 -0
  47. package/src/assets/fonts/europa-regular-webfont.woff2 +0 -0
  48. package/src/assets/fonts/europa-regularitalic-webfont.woff2 +0 -0
  49. package/src/assets/ovalCircle.svg +9 -0
  50. package/src/components/Header.js +21 -0
  51. package/src/components/index.js +3 -0
  52. package/src/config/color.js +8 -0
  53. package/src/config/font.js +0 -0
  54. package/src/config/index.js +19 -0
  55. package/src/config/theme.js +85 -0
  56. package/src/dev.html +19 -0
  57. package/src/index.js +33 -0
  58. package/src/pages/Account/index.js +241 -0
  59. package/src/pages/Account/setUpProject.js +142 -0
  60. package/src/pages/Color/colors.js +58 -0
  61. package/src/pages/Color/documentThemes.js +101 -0
  62. package/src/pages/Color/index.js +20 -0
  63. package/src/pages/Color/style.js +7 -0
  64. package/src/pages/Color/themes.js +131 -0
  65. package/src/pages/ColorEditor/colorTone.js +163 -0
  66. package/src/pages/ColorEditor/friendTheme.js +30 -0
  67. package/src/pages/ColorEditor/index.js +178 -0
  68. package/src/pages/ColorEditor/interactivity.js +116 -0
  69. package/src/pages/ColorEditor/ntc.js +1689 -0
  70. package/src/pages/ColorEditor/style.js +49 -0
  71. package/src/pages/ColorEditor/themingTools.js +107 -0
  72. package/src/pages/Components/grid.js +94 -0
  73. package/src/pages/Components/index.js +40 -0
  74. package/src/pages/Components/sidebar.js +23 -0
  75. package/src/pages/Components/style.js +16 -0
  76. package/src/pages/DesignSystem/index.js +106 -0
  77. package/src/pages/DesignSystem/style.js +1 -0
  78. package/src/pages/Editor/index.js +46 -0
  79. package/src/pages/Editor/layers.js +126 -0
  80. package/src/pages/Editor/scene.js +97 -0
  81. package/src/pages/Editor/style.js +13 -0
  82. package/src/pages/Editor/tools.js +360 -0
  83. package/src/pages/Export/_tools_old.js +49 -0
  84. package/src/pages/Export/const.js +18 -0
  85. package/src/pages/Export/description.js +56 -0
  86. package/src/pages/Export/index.js +74 -0
  87. package/src/pages/Export/scene.js +62 -0
  88. package/src/pages/Export/state.js +21 -0
  89. package/src/pages/Export/style.js +21 -0
  90. package/src/pages/Export/tools.js +14 -0
  91. package/src/pages/Icons/index.js +72 -0
  92. package/src/pages/Icons/style.js +1 -0
  93. package/src/pages/Library/index.js +32 -0
  94. package/src/pages/Library/style.js +36 -0
  95. package/src/pages/PageExtend.js +12 -0
  96. package/src/pages/Shapes/index.js +161 -0
  97. package/src/pages/Shapes/style.js +28 -0
  98. package/src/pages/Spaces/boxModel.js +3 -0
  99. package/src/pages/Spaces/index.js +58 -0
  100. package/src/pages/Spaces/preview.js +133 -0
  101. package/src/pages/Spaces/sequence.js +3 -0
  102. package/src/pages/Spaces/state.js +18 -0
  103. package/src/pages/Spaces/style.js +30 -0
  104. package/src/pages/Typography/docFonts.js +128 -0
  105. package/src/pages/Typography/docStyles.js +97 -0
  106. package/src/pages/Typography/index.js +52 -0
  107. package/src/pages/Typography/shared.js +10 -0
  108. package/src/pages/Typography/state.js +15 -0
  109. package/src/pages/Typography/style.js +11 -0
  110. package/src/pages/Typography/typeScale.js +104 -0
  111. package/src/pages/index.js +13 -0
  112. package/src/protect.js +114 -0
  113. package/src/state.js +7 -0
  114. package/src/style.js +7 -0
  115. package/src/test.js +30 -0
  116. package/svgSprite.config.js +7 -0
  117. package/test/index.test.js +5 -0
@@ -0,0 +1,72 @@
1
+ 'use strict'
2
+
3
+ import { copyStringToClipboard } from '@symbo.ls/utils'
4
+
5
+ import * as sprite from '@symbo.ls/icons'
6
+ import { IconText, ClickableItem, SectionHeader, Grid } from '@symbo.ls/components'
7
+
8
+ const IconItem = {
9
+ extend: [ClickableItem, IconText],
10
+ props: ({ state }) => ({
11
+ round: 'A',
12
+ size: 'D',
13
+ aspectRatio: '1 / 1',
14
+ flexAlign: 'center center',
15
+ icon: {
16
+ fontSize: 'C2',
17
+ name: state.name
18
+ }
19
+ }),
20
+ on: {
21
+ click: (event, element, state) => {
22
+ copyStringToClipboard(state.name)
23
+ }
24
+ }
25
+ }
26
+
27
+ const IconsGroup = {
28
+ state: {
29
+ toggleShow: true
30
+ },
31
+
32
+ header: {
33
+ extend: SectionHeader
34
+ },
35
+
36
+ iconSet: {
37
+ extend: Grid,
38
+
39
+ props: ({ state }) => ({
40
+ hide: !state.toggleShow,
41
+ columns: 'repeat(12, 1fr)',
42
+ gap: 'Z',
43
+ margin: '- -Z2',
44
+
45
+ $hide: {
46
+ display: 'none'
47
+ }
48
+ }),
49
+
50
+ childExtend: IconItem,
51
+ $setCollection: ({ state }) => state.list
52
+ }
53
+ }
54
+
55
+ const ICON_GROUPS = [{
56
+ title: 'Document Icons',
57
+ p: 'All ungrouped document icons',
58
+
59
+ nav: [{
60
+ icon: 'upload outline',
61
+ href: '/icons/upload-icon'
62
+ }],
63
+
64
+ list: Object.keys(sprite).map(name => ({ name }))
65
+ }]
66
+
67
+ export const Icons = {
68
+ tag: 'section',
69
+
70
+ childExtend: IconsGroup,
71
+ $setCollection: () => ICON_GROUPS
72
+ }
@@ -0,0 +1 @@
1
+ 'use strict'
@@ -0,0 +1,32 @@
1
+ 'use strict'
2
+
3
+ import { grid } from './style'
4
+
5
+ import { SectionHeader, ComponentTemplate, Grid } from '@symbo.ls/components'
6
+
7
+ import { PageExtend } from '..'
8
+ import { LIBRARY } from '../../../.symbols'
9
+
10
+ export const Library = {
11
+ extend: PageExtend,
12
+
13
+ header: {
14
+ extend: [SectionHeader],
15
+ state: {
16
+ title: 'My Symbols',
17
+ p: 'This is the first collection of your components'
18
+ }
19
+ },
20
+
21
+ grid: {
22
+ extend: Grid,
23
+ props: {
24
+ flex: 1,
25
+ margin: '- -Z2',
26
+ style: grid
27
+ },
28
+
29
+ childExtend: ComponentTemplate,
30
+ $setCollection: () => LIBRARY
31
+ }
32
+ }
@@ -0,0 +1,36 @@
1
+ 'use strict'
2
+
3
+ export const grid = {
4
+ gridTemplateColumns: 'repeat(12, 1fr)',
5
+ gridAutoFlow: 'dense',
6
+ justifyItems: 'stretch',
7
+ boxSizing: 'border-box',
8
+ marginBottom: '2em',
9
+ gap: '1em',
10
+ gridAutoColumns: 'auto',
11
+ gridAutoRows: 'auto',
12
+
13
+ '@media only screen and (min-width: 1680px)': {
14
+ gridTemplateColumns: 'repeat(12, 1fr)'
15
+ }
16
+ }
17
+
18
+ export const styleFamilyBundle = {
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'space-between',
22
+ width: '50em',
23
+ '> div': {
24
+ display: 'flex',
25
+ alignItems: 'center'
26
+ },
27
+ img: {
28
+ width: '32px',
29
+ height: '32px'
30
+ },
31
+ button: {
32
+ '&:first-child': {
33
+ marginRight: '8px'
34
+ }
35
+ }
36
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ import { PageTemplate } from '@symbo.ls/components'
4
+
5
+ export const PageExtend = {
6
+ tag: 'main',
7
+ extend: PageTemplate,
8
+
9
+ props: {
10
+ maxWidth: 'K-default'
11
+ }
12
+ }
@@ -0,0 +1,161 @@
1
+ 'use strict'
2
+
3
+ import { styleShapeSet } from './style'
4
+
5
+ import { Link, Flex, SectionHeader, ClickableItem } from '@symbo.ls/components'
6
+
7
+ const ShapeItem = {
8
+ extend: [ClickableItem, Link, Flex],
9
+
10
+ props: el => ({
11
+ href: `/shapes/${el.parent.parent.key}-${el.key}`,
12
+ padding: 'B',
13
+ round: 'Z'
14
+ }),
15
+
16
+ _shape: {
17
+ props: {
18
+ theme: 'quaternary',
19
+ width: 'C',
20
+ height: 'C'
21
+ }
22
+ }
23
+ }
24
+
25
+ const ShapeSet = {
26
+ style: styleShapeSet,
27
+ label: {
28
+ props: {
29
+ display: 'block',
30
+ size: 'Y',
31
+ padding: '0 0 Z 0'
32
+ }
33
+ },
34
+ nav: {
35
+ extend: Flex,
36
+ props: { gap: 'Z1' },
37
+ childExtend: ShapeItem
38
+ }
39
+ }
40
+
41
+ const rectangle = {
42
+ extend: ShapeSet,
43
+ label: {
44
+ text: 'Rectangle ',
45
+ span: 'with rounds'
46
+ },
47
+ nav: [
48
+ {},
49
+ { _shape: { props: { round: 4 } } },
50
+ { _shape: { props: { round: 6 } } },
51
+ { _shape: { props: { round: 10 } } },
52
+ { _shape: { props: { round: 12 } } },
53
+ { _shape: { props: { round: 16 } } },
54
+ { _shape: { props: { round: 26 } } }
55
+ ]
56
+ }
57
+
58
+ const circle = {
59
+ extend: ShapeSet,
60
+ label: { text: 'Circle' },
61
+ nav: [{
62
+ _shape: { props: { shape: 'circle' } }
63
+ }]
64
+ }
65
+
66
+ const toolTip = {
67
+ extend: ShapeSet,
68
+ label: { text: 'Tooltip' },
69
+ nav: {
70
+ childExtend: {
71
+ childExtend: { props: { round: 'Y1' } }
72
+ },
73
+
74
+ ...[
75
+ { _shape: { props: { shape: 'tooltip', shapeDirection: 'top left' } } },
76
+ { _shape: { props: { shape: 'tooltip', shapeDirection: 'top center' } } },
77
+ { _shape: { props: { shape: 'tooltip', shapeDirection: 'right' } } },
78
+ { _shape: { props: { shape: 'tooltip', shapeDirection: 'bottom' } } }
79
+ ]
80
+ }
81
+ }
82
+
83
+ const tagShape = {
84
+ extend: ShapeSet,
85
+ label: { text: 'Tag' },
86
+ nav: {
87
+ childExtend: {
88
+ childExtend: { props: { round: 6 } }
89
+ },
90
+ ...[
91
+ { _shape: { props: { shape: 'tag', shapeDirection: 'left' } } },
92
+ { _shape: { props: { shape: 'tag', shapeDirection: 'top' } } },
93
+ { _shape: { props: { shape: 'tag', shapeDirection: 'right' } } },
94
+ { _shape: { props: { shape: 'tag', shapeDirection: 'bottom' } } }
95
+ ]
96
+ }
97
+ }
98
+
99
+ const bubble = {
100
+ extend: ShapeSet,
101
+ label: { text: 'Bubble' },
102
+ nav: [
103
+ { _shape: { props: { round: 'X B B X' } } },
104
+ { _shape: { props: { round: 'B X X B' } } },
105
+ { _shape: { props: { round: 'X X B B' } } },
106
+ { _shape: { props: { round: 'B B X X' } } },
107
+ { _shape: { props: { round: 'B X X X' } } },
108
+ { _shape: { props: { round: 'X B X X' } } },
109
+ { _shape: { props: { round: 'X X B X' } } },
110
+ { _shape: { props: { round: 'X X X B' } } }
111
+ ]
112
+ }
113
+
114
+ export const Shapes = {
115
+ extend: Flex,
116
+ props: {
117
+ flow: 'column',
118
+ gap: 'F'
119
+ },
120
+
121
+ childExtend: {
122
+ extend: Flex,
123
+ props: {
124
+ gap: 'A',
125
+ flow: 'column',
126
+ section: {
127
+ flow: 'row wrap',
128
+ gap: 'A'
129
+ }
130
+ },
131
+ section: { extend: Flex }
132
+ },
133
+
134
+ htmlShapes: {
135
+ header: {
136
+ extend: SectionHeader,
137
+ heading: {
138
+ title: 'HTML Shapes',
139
+ p: 'All ungrouped document icons'
140
+ }
141
+ },
142
+
143
+ section: {
144
+ rectangle,
145
+ circle,
146
+ toolTip,
147
+ tagShape,
148
+ bubble
149
+ }
150
+ },
151
+
152
+ svgShapes: {
153
+ header: {
154
+ extend: SectionHeader,
155
+ heading: {
156
+ title: 'SVG Shapes',
157
+ p: 'TBA...'
158
+ }
159
+ }
160
+ }
161
+ }
@@ -0,0 +1,28 @@
1
+ 'use strict'
2
+
3
+ export const styleShapeSet = {
4
+ label: {
5
+ display: 'block',
6
+ opacity: '.65',
7
+ span: { opacity: '.2' }
8
+ },
9
+ nav: {
10
+ flexWrap: 'wrap',
11
+ a: {
12
+ cursor: 'pointer',
13
+ background: 'rgba(255, 255, 255, .05)',
14
+ alignItems: 'center',
15
+ justifyContent: 'center'
16
+ }
17
+ }
18
+ }
19
+
20
+ export const styleUploadSVG = {
21
+ div: {
22
+ background: 'rgba(255, 255, 255, .05)',
23
+ display: 'flex',
24
+ alignItems: 'center'
25
+ },
26
+
27
+ input: { display: 'none' }
28
+ }
@@ -0,0 +1,3 @@
1
+ 'use strict'
2
+
3
+ export default {}
@@ -0,0 +1,58 @@
1
+ 'use strict'
2
+
3
+ import { Link, TabHeader } from '@symbo.ls/components'
4
+ import { PageExtend } from '..'
5
+
6
+ import preview from './preview'
7
+ import sequence from './sequence'
8
+ import boxModel from './boxModel'
9
+
10
+ export const Spaces = {
11
+ key: 'spaces',
12
+
13
+ extend: PageExtend,
14
+
15
+ state: {
16
+ activePage: 'spaces',
17
+ activeTab: 'preview'
18
+ },
19
+
20
+ define: { routes: param => param },
21
+
22
+ routes: {
23
+ preview,
24
+ sequence,
25
+ boxModel
26
+ },
27
+
28
+ on: {
29
+ init: (el, s) => {
30
+ var route = window.location.pathname
31
+ var routes = route.slice(1).split('/')
32
+ s.activeTab = routes[1] || s.activeTab
33
+ }
34
+ },
35
+
36
+ header: {
37
+ extend: TabHeader,
38
+ style: {
39
+ margin: `${42 / 16}em -2em 2em -2em`,
40
+ paddingLeft: '2em'
41
+ },
42
+ tabs: {
43
+ childExtend: {
44
+ extend: [Link]
45
+ },
46
+
47
+ preview: { props: { text: 'Spacing Preview' } }
48
+ // sequence: { props: { text: 'Sequence' } },
49
+ // boxModel: { props: { text: 'Box Model' } }
50
+ }
51
+ },
52
+
53
+ preview
54
+
55
+ // page: {
56
+ // content: (el, s) => ({ extend: el.parent.routes[s.activeTab] })
57
+ // }
58
+ }
@@ -0,0 +1,133 @@
1
+ 'use strict'
2
+
3
+ import { stylePreview, styleScene } from './style'
4
+
5
+ import { Block, Button, Flex, Text, ResponsiveToolBar, Scene, SequenceGraph, StaticSpacing, CommonField, SliderToolWithCaption, SelectToolWithCaption } from '@symbo.ls/components'
6
+
7
+ const buttonDownload = {
8
+ extend: Button,
9
+ state: {},
10
+ style: {
11
+ svg: { marginRight: `${6 / 16}em` }
12
+ },
13
+ props: {
14
+ icon: 'arrowDown',
15
+ theme: 'primary',
16
+ text: 'Download',
17
+ padding: ['Z2', 'A2'],
18
+ round: 'C'
19
+ }
20
+ }
21
+
22
+ export default {
23
+ style: stylePreview,
24
+
25
+ cnt: {
26
+ aside: {
27
+ tag: 'aside',
28
+ extend: [ResponsiveToolBar, Flex]
29
+ },
30
+ nameSequence: {
31
+ style: { marginRight: '5.6em' },
32
+ childExtend: {
33
+ extend: CommonField
34
+ },
35
+ ...[
36
+ // {
37
+ // caption: { text: 'Name the sequence' },
38
+ // element: {
39
+ // tag: 'input',
40
+ // extend: Shape,
41
+ // props: { theme: 'quaternary', round: 'Y1' },
42
+ // attr: (el, s) => ({
43
+ // autofocus: true
44
+ // // value: s.tabs[s.activeTab].name
45
+ // }),
46
+ // on: {
47
+ // render: el => {
48
+ // el.node.select() // .focus(),
49
+ // },
50
+ // input: (ev, el, s) => {
51
+ // s.tabs[s.activeTab].name = el.node.value
52
+ // s.update()
53
+ // }
54
+ // }
55
+ // }
56
+ // },
57
+
58
+ {
59
+ extend: SelectToolWithCaption,
60
+ style: { marginTop: `${26 / 16}em` },
61
+ caption: { props: { text: 'Used for' } },
62
+ element: {
63
+ title: {
64
+ props: {
65
+ icon: 'fontSize',
66
+ text: 'Font size'
67
+ },
68
+ style: { '> svg': { paddingTop: '2px' } }
69
+ }
70
+ }
71
+ }
72
+ ]
73
+ },
74
+
75
+ baseSize: {
76
+ childExtend: CommonField,
77
+ ...[
78
+ {
79
+ extend: SliderToolWithCaption,
80
+ caption: { text: 'Base size' },
81
+ element: {
82
+ button0: {},
83
+ value: { text: '16px' }
84
+ }
85
+ },
86
+ {
87
+ style: { marginTop: `${26 / 16}em` },
88
+ caption: { text: 'Sequence ratio' },
89
+ element: {
90
+ extend: StaticSpacing
91
+ }
92
+ }
93
+ ]
94
+ },
95
+ scene: {
96
+ extend: CommonField,
97
+ style: {
98
+ flex: 1,
99
+ marginLeft: `${110 / 16}em`
100
+ },
101
+ caption: { text: 'Preview' },
102
+ element: {
103
+ style: styleScene,
104
+ extend: [Scene, Block],
105
+ props: {
106
+ width: 'H2',
107
+ height: 'G'
108
+ },
109
+ scene: {
110
+ buttonDownload
111
+ }
112
+ }
113
+ }
114
+ },
115
+
116
+ footer: {
117
+ caption: {
118
+ extend: [Text, Block],
119
+ props: {
120
+ size: 'Y',
121
+ padding: '0 0 B 0'
122
+ },
123
+ text: 'Sizing generated by this setting'
124
+ },
125
+ Sequence: {
126
+ extend: [SequenceGraph, Block, Text],
127
+ style: { alignItems: 'center' },
128
+ props: {
129
+ size: 'X'
130
+ }
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,3 @@
1
+ 'use strict'
2
+
3
+ export default {}
@@ -0,0 +1,18 @@
1
+ 'use strict'
2
+
3
+ import { SPACING } from '@symbo.ls/components'
4
+ import { TYPOGRAPHY_SEQUENCE } from '../Export/const'
5
+
6
+ export default {
7
+ tabs: [{
8
+ key: 0,
9
+ name: 'Default'
10
+ }, {
11
+ key: 1,
12
+ name: 'Font Size'
13
+ }],
14
+ activeTab: '0',
15
+ sequence: TYPOGRAPHY_SEQUENCE,
16
+ spacingRatio: SPACING.ratio,
17
+ currentFontSizeIndex: 3
18
+ }
@@ -0,0 +1,30 @@
1
+ 'use strict'
2
+
3
+ export const styleScene = {
4
+ padding: `${10 / 16}em`,
5
+ width: '100%',
6
+ '> div': {
7
+ height: '100%'
8
+ }
9
+ }
10
+
11
+ export const stylePreview = {
12
+ '> div': {
13
+ display: 'flex'
14
+ },
15
+
16
+ aside: {
17
+ flexDirection: 'column-reverse',
18
+ justifyContent: 'flex-end',
19
+ marginRight: '4.2em',
20
+ gap: '1em'
21
+ },
22
+
23
+ footer: {
24
+ marginTop: `${68 / 16}em`,
25
+ caption: {
26
+ whiteSpace: 'nowrap',
27
+ opacity: '.35'
28
+ }
29
+ }
30
+ }