@symbo.ls/preview 0.0.57 → 0.0.59

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 (34) hide show
  1. package/.symbols/library.js +2 -2
  2. package/package.json +2 -2
  3. package/src/app.js +13 -4
  4. package/src/components/ColorText.js +29 -0
  5. package/src/components/ColorsPalette.js +64 -0
  6. package/src/components/ContinueButton.js +13 -0
  7. package/src/components/FontText.js +186 -0
  8. package/src/components/HeaderHeading.js +26 -0
  9. package/src/components/SlidersWithResponsive.js +21 -0
  10. package/src/components/ThemeButtons.js +51 -0
  11. package/src/components/UploadImage.js +28 -0
  12. package/src/components/index.js +8 -0
  13. package/src/pages/Color/CreatePalette.js +134 -0
  14. package/src/pages/Color/FontText.js +11 -0
  15. package/src/pages/Color/globalThemes.js +2 -2
  16. package/src/pages/Color/index.js +11 -0
  17. package/src/pages/Color/palette.js +7 -14
  18. package/src/pages/Color/themeLightDark.js +121 -0
  19. package/src/pages/Color/themes.js +2 -2
  20. package/src/pages/DesignSystem/Dashboard/banners.js +37 -0
  21. package/src/pages/DesignSystem/Dashboard/index.js +4 -70
  22. package/src/pages/DesignSystem/Dashboard/quickstart.js +61 -0
  23. package/src/pages/DesignSystem/Dashboard/summary.js +9 -0
  24. package/src/pages/Fonts/fontFaces.js +2 -2
  25. package/src/pages/Fonts/fontFamilies.js +2 -2
  26. package/src/pages/Shapes/index.js +2 -2
  27. package/src/pages/Spaces/index.js +8 -9
  28. package/src/pages/Spaces/{SpacingScale.js → sequence.js} +2 -15
  29. package/src/pages/Theme/index.js +5 -5
  30. package/src/pages/Typography/documentStyles.js +5 -17
  31. package/src/pages/Typography/index.js +7 -0
  32. package/src/pages/Typography/state.js +4 -4
  33. package/src/state.js +4 -3
  34. package/user_data/byld.js +115 -0
@@ -6,12 +6,23 @@ import globalThemes from './globalThemes'
6
6
  import palette from './palette'
7
7
  import themes from './themes'
8
8
 
9
+ // import { ThemeButtons } from '../../components'
10
+ // import { themeLightDark } from './themeLightDark'
11
+ // import { CreatePallete } from './CreatePalette'
12
+ // import { fontText } from './FontText'
13
+
9
14
  export const Color = {
10
15
  key: 'colors',
16
+
11
17
  props: {
12
18
  gap: 'A'
19
+ // style: { border: '4px solid red' }
13
20
  },
14
21
 
22
+ // createPallete: CreatePallete,
23
+ // themeLightDark,
24
+ // fontText
25
+
15
26
  globalThemes,
16
27
  line: { extend: Line },
17
28
  palette,
@@ -3,10 +3,10 @@
3
3
  import { SectionHeader, ColorTemplate, Flex } from '@symbo.ls/components'
4
4
 
5
5
  const mapColors = (el, s) => {
6
- if (!el.context.SYSTEM) return
7
- const { COLOR } = el.context.SYSTEM
6
+ if (!s.__system) return
7
+ const { COLOR } = s.__system
8
8
  const colorKeys = Object.keys(COLOR)
9
- return colorKeys.map(v => ({ key: v, ...COLOR[v] }))
9
+ return colorKeys.map(v => ({ key: v, value: COLOR[v] }))
10
10
  }
11
11
 
12
12
  export default {
@@ -25,18 +25,11 @@ export default {
25
25
  content: {
26
26
  extend: Flex,
27
27
  props: {
28
- gap: 'A1',
29
- alignItems: 'center'
28
+ flow: 'row wrap',
29
+ gap: 'Z2'
30
30
  },
31
- colors: {
32
- extend: Flex,
33
- props: {
34
- flow: 'row wrap',
35
- gap: 'Z2'
36
- },
37
31
 
38
- childExtend: ColorTemplate,
39
- $setStateCollection: mapColors
40
- }
32
+ childExtend: ColorTemplate,
33
+ $setStateCollection: mapColors
41
34
  }
42
35
  }
@@ -0,0 +1,121 @@
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
+ }
@@ -3,8 +3,8 @@
3
3
  import { ThemeTemplate, SectionHeader, Grid } from '@symbo.ls/components'
4
4
 
5
5
  const mapThemes = (el, s) => {
6
- if (!el.context.SYSTEM) return
7
- const { THEME } = el.context.SYSTEM
6
+ if (!s.__system) return
7
+ const { THEME } = s.__system
8
8
  const themeKeys = Object.keys(THEME)
9
9
  return themeKeys.map(v => ({ ...THEME[v], key: v }))
10
10
  }
@@ -0,0 +1,37 @@
1
+ 'use strict'
2
+
3
+ import { Flex } from '@symbo.ls/components'
4
+ import { TutorialBanner } from '../../../components'
5
+
6
+ import DARK_PNG from '../../../assets/dark.png'
7
+ import TYPE_PNG from '../../../assets/type.png'
8
+ import SPACE_PNG from '../../../assets/space.png'
9
+
10
+ export default {
11
+ extend: Flex,
12
+
13
+ props: {
14
+ align: 'stretch space-between',
15
+ margin: 'C1 -Z1',
16
+ gap: 'B1'
17
+ },
18
+
19
+ childExtend: TutorialBanner,
20
+
21
+ $setStateCollection: ({ state }) => [{
22
+ title: 'Setting up a dark theme',
23
+ p: '1 min tutorial',
24
+ background: DARK_PNG,
25
+ href: ''
26
+ }, {
27
+ title: 'Learn typography scaling',
28
+ p: '2 mins tutorial',
29
+ background: TYPE_PNG,
30
+ href: ''
31
+ }, {
32
+ title: 'How scaling of space works',
33
+ p: '5 mins tutorial',
34
+ background: SPACE_PNG,
35
+ href: ''
36
+ }]
37
+ }
@@ -1,74 +1,8 @@
1
1
  'use strict'
2
2
 
3
- import { Flex, ArticleMedium, QuickStart } from '@symbo.ls/components'
4
- import { TutorialBanner } from '../../../components'
5
-
6
- import DARK_PNG from '../../../assets/dark.png'
7
- import TYPE_PNG from '../../../assets/type.png'
8
- import SPACE_PNG from '../../../assets/space.png'
9
-
10
- const banners = {
11
- extend: Flex,
12
- props: {
13
- align: 'stretch space-between',
14
- margin: 'C1 -Z1',
15
- gap: 'B1'
16
- },
17
-
18
- childExtend: TutorialBanner,
19
-
20
- $setStateCollection: ({ state }) => [{
21
- title: 'Setting up a dark theme',
22
- p: '1 min tutorial',
23
- background: DARK_PNG,
24
- href: ''
25
- }, {
26
- title: 'Learn typography scaling',
27
- p: '2 mins tutorial',
28
- background: TYPE_PNG,
29
- href: ''
30
- }, {
31
- title: 'How scaling of space works',
32
- p: '5 mins tutorial',
33
- background: SPACE_PNG,
34
- href: ''
35
- }]
36
- }
37
-
38
- const header = {
39
- extend: ArticleMedium,
40
- props: {
41
- '@mobileS': { padding: '- - - A' },
42
- title: {
43
- fontWeight: '600',
44
- text: 'Design System takeaways'
45
- },
46
-
47
- p: { text: `Your tokens in the system`
48
- },
49
-
50
- p2: {
51
- display: 'none',
52
- color: 'gray6',
53
- margin: '0'
54
- }
55
- },
56
-
57
- title: {},
58
- p: {},
59
- p2: {
60
- tag: 'p',
61
- ...[
62
- 'Welcome to the Symbols documentation page.',
63
- { text: `Here you'll learn everything…` }
64
- ]
65
- }
66
- }
67
-
68
- const summary = {
69
- header
70
-
71
- }
3
+ import summary from './summary'
4
+ import quickstart from './quickstart'
5
+ import banners from './banners'
72
6
 
73
7
  export const DesignSystemDashboard = {
74
8
  ArticleBig: {
@@ -77,6 +11,6 @@ export const DesignSystemDashboard = {
77
11
  },
78
12
 
79
13
  banners,
80
- quickStart: { extend: QuickStart },
14
+ quickstart,
81
15
  summary
82
16
  }
@@ -0,0 +1,61 @@
1
+ 'use strict'
2
+
3
+ export default {
4
+ props: {
5
+ margin: 'C1 - E1'
6
+ },
7
+
8
+ SectionHeader: {
9
+ margin: '- - B2',
10
+ title: 'Setting up',
11
+ p: 'This is how you initialize Symbols Design System to your local app.'
12
+ },
13
+
14
+ Flex: {
15
+ props: {
16
+ gap: 'C1',
17
+ align: 'flex-start space-between',
18
+ childProps: {
19
+ flex: '1',
20
+ maxWidth: 'H2'
21
+ }
22
+ },
23
+
24
+ step1: {
25
+ extend: 'QuickStartTerminal',
26
+ QuickStartNumber: { width: '.87ch', text: '1' },
27
+ Terminal: {
28
+ command: { text: 'yarn add smbls@^1.1.1' }
29
+ }
30
+ },
31
+
32
+ step2: {
33
+ extend: 'QuickStartCode',
34
+ QuickStartNumber: { text: '2' },
35
+ Code: {
36
+ code: {
37
+ text: {
38
+ react: `import { SymbolsProvider } from 'smbls/react'
39
+ <SymbolsProvider config={{ color… }} />`,
40
+ domql: `import { init } from 'smbls'
41
+ init({ color, theme, typography… })`
42
+ }
43
+ }
44
+ }
45
+ },
46
+
47
+ step3: {
48
+ extend: 'QuickStartCode',
49
+ QuickStartNumber: { text: '3' },
50
+ Code: {
51
+ code: {
52
+ text: {
53
+ react: `import { Box } from 'smbls/react'
54
+ <Box color='primary' />`,
55
+ domql: `{ props: { color: 'primary' } }`
56
+ }
57
+ }
58
+ }
59
+ }
60
+ }
61
+ }
@@ -0,0 +1,9 @@
1
+ 'use strict'
2
+
3
+ export default {
4
+ SectionHeader: {
5
+ margin: '- - C1',
6
+ title: 'Design System takeaways',
7
+ p: 'Your tokens in the system at a glance'
8
+ }
9
+ }
@@ -4,8 +4,8 @@ import { Grid, Hoverable, FontObject } from '@symbo.ls/components'
4
4
  import { TypeSection } from '../Typography/shared'
5
5
 
6
6
  const mapFonts = (el, s) => {
7
- if (!el.context.SYSTEM) return
8
- const { FONT } = el.context.SYSTEM
7
+ if (!s.__system) return
8
+ const { FONT } = s.__system
9
9
  const fontKeys = Object.keys(FONT)
10
10
 
11
11
  return fontKeys.map(v => {
@@ -4,8 +4,8 @@ import { Grid, Hoverable, FontFamilyObject } from '@symbo.ls/components'
4
4
  import { TypeSection } from '../Typography/shared'
5
5
 
6
6
  const mapFontFamilies = (el, s) => {
7
- if (!el.context.SYSTEM) return
8
- const { FONT_FAMILY } = el.context.SYSTEM
7
+ if (!s.__system) return
8
+ const { FONT_FAMILY } = s.__system
9
9
  const fontFamilyKeys = Object.keys(FONT_FAMILY)
10
10
 
11
11
  return fontFamilyKeys.map(v => {
@@ -1,6 +1,6 @@
1
1
  'use strict'
2
2
 
3
- import { Flex, Line } from '@symbo.ls/components'
3
+ import { Flex } from '@symbo.ls/components'
4
4
 
5
5
  import {
6
6
  rectangle,
@@ -63,7 +63,7 @@ export const Shapes = {
63
63
  }
64
64
  },
65
65
 
66
- line: { extend: Line },
66
+ Line: {},
67
67
 
68
68
  svgShapes: {
69
69
  SectionHeader: {
@@ -1,21 +1,20 @@
1
1
  'use strict'
2
2
 
3
- import { TypeSection } from '../Typography/shared'
4
- import { SpacingScale } from './SpacingScale'
3
+ import sequence from './sequence'
5
4
  import { state } from './state'
6
5
 
7
6
  export const Spaces = {
8
7
  state,
9
8
 
10
- spaces: {
11
- extend: TypeSection,
12
- state: {
13
- title: 'Spacing',
14
- p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
15
- }
9
+ SectionHeader: {
10
+ margin: '0 0 C',
11
+ title: 'Spacing',
12
+ p: 'Unlike typography, component may has the properties of padding, gap, width and rest.'
16
13
  },
17
14
 
15
+ SlidersWithResponsive: {},
16
+
18
17
  Line: {},
19
18
 
20
- scale: SpacingScale
19
+ sequence
21
20
  }
@@ -3,7 +3,7 @@
3
3
  import { Flex } from '@symbo.ls/components'
4
4
  import { Table } from './Table'
5
5
 
6
- export const SpacingScale = {
6
+ export default {
7
7
  extend: [Flex],
8
8
 
9
9
  props: {
@@ -13,30 +13,17 @@ export const SpacingScale = {
13
13
  },
14
14
 
15
15
  SectionHeader: {
16
- title: 'The Sequence',
16
+ title: 'Sequence',
17
17
  p: 'Spacing scale is a set of values that are used to define the padding, margin, gap and width of components.',
18
18
  margin: '0'
19
19
  },
20
20
 
21
- SequenceSliders: {
22
- // position: 'sticky',
23
- // top: 'C2',
24
- // background: 'black .5',
25
- // zIndex: '9999',
26
- // margin: '-B2 -B -B',
27
- // padding: 'B2 B B',
28
- // style: {
29
- // backdropFilter: 'blur(15px)'
30
- // }
31
- },
32
-
33
21
  scale: {
34
22
  extend: Flex,
35
23
  props: {
36
24
  lazyLoad: true,
37
25
  flow: 'column',
38
26
  gap: 'B1',
39
- margin: '0 0 C2',
40
27
 
41
28
  table: { flex: 1 },
42
29
  preview: { flex: 1 }
@@ -26,7 +26,7 @@ const ThemeNameField = {
26
26
  props: ({ state }) => ({
27
27
  gap: '0',
28
28
 
29
- caption: {
29
+ title: {
30
30
  text: 'Name the theme'
31
31
  },
32
32
 
@@ -49,7 +49,7 @@ const ThemeNameField = {
49
49
  }
50
50
  }),
51
51
 
52
- caption: {},
52
+ title: {},
53
53
  element: {
54
54
  extend: Pseudo,
55
55
  attr: { contentEditable: true, id: 'name-it' }
@@ -145,11 +145,11 @@ export const Theme = {
145
145
 
146
146
  on: {
147
147
  init: (el, s) => {
148
- if (!el.context.SYSTEM) return
148
+ if (!s.__system) return
149
149
  const path = window.location.pathname
150
150
  const pathArray = path.split('theme/')
151
- if (!el.context.SYSTEM) return
152
- const { THEME } = el.context.SYSTEM
151
+ if (!s.__system) return
152
+ const { THEME } = s.__system
153
153
  const themeName = pathArray[1]
154
154
  var value = THEME[themeName]
155
155
 
@@ -4,21 +4,15 @@ import { findHeadingLetter, getFontFamily } from '@symbo.ls/scratch'
4
4
  import {
5
5
  DocumentStylesSequence,
6
6
  Flex,
7
- SectionHeader,
8
- SelectField,
9
- SequenceSliders,
10
- DeviceButtonSet
7
+ SelectField
11
8
  } from '@symbo.ls/components'
12
9
 
13
10
  import { HTML_TAGS } from '@domql/tags' // eslint-disable-line no-unused-vars
14
11
 
15
12
  export default {
16
- header: {
17
- extend: SectionHeader,
18
- state: {
19
- title: 'Document Styles',
20
- p: 'Document styling and theming provides global themes of the entire app, imagine it as a :root styling'
21
- }
13
+ SectionHeader: {
14
+ title: 'Document Styles',
15
+ p: 'Document styling and theming provides global themes of the entire app, imagine it as a :root styling'
22
16
  },
23
17
 
24
18
  styles: {
@@ -40,12 +34,6 @@ export default {
40
34
  }
41
35
  },
42
36
 
43
- header: {
44
- extend: Flex,
45
- SequenceSliders,
46
- DeviceButtonSet
47
- },
48
-
49
37
  headings: {
50
38
  extend: DocumentStylesSequence,
51
39
 
@@ -225,7 +213,7 @@ export default {
225
213
 
226
214
  on: {
227
215
  init: (el, s) => {
228
- if (!el.context.SYSTEM) return
216
+ if (!s.__system) return
229
217
  const { context } = el // eslint-disable-line no-unused-vars
230
218
  const { TYPOGRAPHY } = context.SYSTEM
231
219
  const { styles } = TYPOGRAPHY
@@ -11,10 +11,13 @@ export const Typography = {
11
11
  state,
12
12
 
13
13
  SectionHeader: {
14
+ margin: '0 0 C',
14
15
  title: 'Typography',
15
16
  p: 'A general configuration of type properties on the document.'
16
17
  },
17
18
 
19
+ SlidersWithResponsive: {},
20
+
18
21
  line: { extend: 'Line' },
19
22
 
20
23
  documentStyles,
@@ -28,6 +31,10 @@ export const Typography = {
28
31
  on: {
29
32
  init: (el, s) => {
30
33
  mapSequence(s, sortSequence)
34
+ },
35
+ stateUpdated: (el, s, changes) => {
36
+ console.log(changes)
37
+ s.systemUpdate({ TYPOGRAPHY: changes })
31
38
  }
32
39
  }
33
40
  }
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
- export default {
4
- base: 16,
5
- ratio: 1.2,
3
+ export default ({ parent }) => ({
4
+ base: parent.state.__system.TYPOGRAPHY.base,
5
+ ratio: parent.state.__system.TYPOGRAPHY.ratio,
6
6
  range: [-3, +8],
7
7
  h1Matches: +6,
8
8
  scales: {},
@@ -13,4 +13,4 @@ export default {
13
13
 
14
14
  sampleText: 'Today is a big day for our tribe. The year ends.',
15
15
  activeTab: ''
16
- }
16
+ })
package/src/state.js CHANGED
@@ -1,15 +1,16 @@
1
1
  'use strict'
2
2
 
3
- import SYMBOLS_CONF from '@symbo.ls/config'
4
3
  import SYSTEM from './config'
5
4
  import { LIBRARY, COMPONENTS } from '../.symbols'
5
+ import BYLD from '../user_data/byld'
6
6
 
7
7
  export const state = {
8
- globalTheme: 'dark'
8
+ globalTheme: 'dark',
9
+ SYSTEM: BYLD
9
10
  }
10
11
 
11
12
  export const context = {
12
- CONFIG: SYMBOLS_CONF,
13
+ CONFIG: BYLD,
13
14
  LIBRARY,
14
15
  SYSTEM,
15
16
  COMPONENTS