@symbo.ls/starter-kit 2.34.2 → 3.2.3
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/README.md +3 -3
- package/example/app.js +5 -10
- package/example/components.js +31 -45
- package/example/pages.js +5 -7
- package/package.json +16 -15
- package/src/components.js +37 -35
- package/src/designSystem.js +1 -1
- package/src/index.js +18 -19
- package/src/pages.js +22 -4
- package/symbols.json +2 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Symbols Starter Kit
|
|
2
|
-
Example dev setup (boilerplate) to use [DOMQL](https://github.com/domql/domql). You can also check
|
|
2
|
+
Example dev setup (boilerplate) to use [DOMQL](https://github.com/domql/domql). You can also check live editor [Playground](https://domql.com/playground/).
|
|
3
3
|
|
|
4
4
|
### Setup
|
|
5
5
|
|
|
@@ -10,10 +10,10 @@ git clone git@github.com:symbo-ls/starter-kit.git
|
|
|
10
10
|
|
|
11
11
|
2. Install scripts
|
|
12
12
|
```
|
|
13
|
-
|
|
13
|
+
yarn
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
3. Run the project
|
|
17
17
|
```
|
|
18
|
-
|
|
18
|
+
yarn start
|
|
19
19
|
```
|
package/example/app.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Flex } from 'smbls'
|
|
4
|
-
|
|
5
3
|
export const App = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
height: '100vh',
|
|
12
|
-
align: 'center space-between'
|
|
13
|
-
},
|
|
4
|
+
display: 'flex',
|
|
5
|
+
theme: 'document',
|
|
6
|
+
flow: 'column',
|
|
7
|
+
height: '100vh',
|
|
8
|
+
align: 'center space-between',
|
|
14
9
|
|
|
15
10
|
Header: {},
|
|
16
11
|
|
package/example/components.js
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Flex, Link } from 'smbls'
|
|
4
|
-
|
|
5
3
|
export const Header = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
align: 'center space-between'
|
|
11
|
-
},
|
|
12
|
-
|
|
4
|
+
display: 'flex',
|
|
5
|
+
minWidth: '100%',
|
|
6
|
+
padding: 'Z B',
|
|
7
|
+
align: 'center space-between',
|
|
13
8
|
Flex: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
9
|
+
gap: 'C',
|
|
10
|
+
childExtends: {
|
|
11
|
+
extends: 'Link',
|
|
12
|
+
textDecoration: ({ props }) =>
|
|
13
|
+
window.location.pathname === props.href ? 'underline' : 'none'
|
|
20
14
|
},
|
|
21
15
|
Text_logo: { href: '/', text: 'Hello!' },
|
|
22
16
|
Text_about: { href: '/about', text: 'About' }
|
|
@@ -26,43 +20,35 @@ export const Header = {
|
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
export const ThemeSwitcher = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
'
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
on: {
|
|
40
|
-
click: (event, element, state) => {
|
|
41
|
-
state.update({ globalTheme: element.key })
|
|
42
|
-
}
|
|
23
|
+
display: 'flex',
|
|
24
|
+
gap: 'A2',
|
|
25
|
+
childExtends: {
|
|
26
|
+
isActive: (element, state) => state.globalTheme === element.key,
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
'.isActive': {
|
|
29
|
+
fontWeight: '900'
|
|
30
|
+
},
|
|
31
|
+
onClick: (event, element, state) => {
|
|
32
|
+
state.update({ globalTheme: element.key })
|
|
43
33
|
}
|
|
44
34
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
35
|
+
Dark: { text: 'Dark' },
|
|
36
|
+
Light: { text: 'Light' },
|
|
37
|
+
Midnight: { text: 'Midnight' }
|
|
48
38
|
}
|
|
49
39
|
|
|
50
40
|
export const Footer = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
order: 9
|
|
54
|
-
}
|
|
41
|
+
padding: 'Z B',
|
|
42
|
+
order: 9
|
|
55
43
|
}
|
|
56
44
|
|
|
57
45
|
export const TestComponent = {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
background: 'orange .35 +35'
|
|
66
|
-
}
|
|
46
|
+
padding: 'Z B',
|
|
47
|
+
round: 'A',
|
|
48
|
+
margin: 'A -Z C',
|
|
49
|
+
background: 'orange .35',
|
|
50
|
+
text: 'test',
|
|
51
|
+
':hover': {
|
|
52
|
+
background: 'orange .35 +35'
|
|
67
53
|
}
|
|
68
54
|
}
|
package/example/pages.js
CHANGED
|
@@ -6,13 +6,11 @@ export default {
|
|
|
6
6
|
P: 'Lorem ipsum dolor sit amet',
|
|
7
7
|
TestComponent: {},
|
|
8
8
|
Link: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'
|
|
13
|
-
'
|
|
14
|
-
margin: '- Y - -'
|
|
15
|
-
}
|
|
9
|
+
href: 'https://symbols.app/developers',
|
|
10
|
+
target: '_blank',
|
|
11
|
+
':hover': {
|
|
12
|
+
'& svg': {
|
|
13
|
+
margin: '- Y - -'
|
|
16
14
|
}
|
|
17
15
|
},
|
|
18
16
|
Icon: {
|
package/package.json
CHANGED
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/starter-kit",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "3.2.3",
|
|
4
4
|
"description": "Example dev setup to use Symbols",
|
|
5
5
|
"author": "symbo.ls",
|
|
6
6
|
"repository": "https://github.com/symbo-ls/starter-kit",
|
|
7
7
|
"scripts": {
|
|
8
|
-
"start": "parcel index.html",
|
|
9
|
-
"
|
|
8
|
+
"start": "npx parcel index.html --no-cache --watch-dir=../domql",
|
|
9
|
+
"fetch": "npx @symbo.ls/cli fetch",
|
|
10
|
+
"build": "npx parcel build index.html"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
12
|
-
"smbls": "^2.
|
|
13
|
+
"smbls": "^3.2.3"
|
|
13
14
|
},
|
|
14
15
|
"devDependencies": {
|
|
15
|
-
"@babel/core": "^7.
|
|
16
|
-
"@babel/eslint-parser": "^7.
|
|
17
|
-
"@babel/preset-env": "^7.
|
|
18
|
-
"@parcel/babel-preset-env": "^2.
|
|
19
|
-
"@parcel/transformer-inline-string": "^2.
|
|
20
|
-
"@parcel/transformer-raw": "^2.
|
|
21
|
-
"buffer": "^6.0.
|
|
22
|
-
"eslint": "^9.
|
|
16
|
+
"@babel/core": "^7.26.0",
|
|
17
|
+
"@babel/eslint-parser": "^7.26.10",
|
|
18
|
+
"@babel/preset-env": "^7.26.9",
|
|
19
|
+
"@parcel/babel-preset-env": "^2.11.0",
|
|
20
|
+
"@parcel/transformer-inline-string": "^2.13.3",
|
|
21
|
+
"@parcel/transformer-raw": "^2.13.3",
|
|
22
|
+
"buffer": "^5.5.0||^6.0.0",
|
|
23
|
+
"eslint": "^9.28.0",
|
|
23
24
|
"eslint-config-standard": "^17.1.0",
|
|
24
|
-
"eslint-plugin-import": "^2.
|
|
25
|
-
"parcel": "^2.
|
|
25
|
+
"eslint-plugin-import": "^2.31.0",
|
|
26
|
+
"parcel": "^2.13.3",
|
|
26
27
|
"standard": "^17.1.2"
|
|
27
28
|
},
|
|
28
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681"
|
|
29
30
|
}
|
package/src/components.js
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { Flex, Link } from 'smbls'
|
|
4
|
-
|
|
5
3
|
export const Header = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
align: 'center space-between'
|
|
11
|
-
},
|
|
12
|
-
|
|
4
|
+
display: 'flex',
|
|
5
|
+
minWidth: '100%',
|
|
6
|
+
padding: 'Z B',
|
|
7
|
+
align: 'center space-between',
|
|
13
8
|
Flex: {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
})
|
|
9
|
+
gap: 'C',
|
|
10
|
+
childExtends: {
|
|
11
|
+
extends: 'Link',
|
|
12
|
+
textDecoration: ({ props }) =>
|
|
13
|
+
window.location.pathname === props.href ? 'underline' : 'none'
|
|
20
14
|
},
|
|
21
15
|
Text_logo: { href: '/', text: 'Hello!' },
|
|
22
16
|
Text_about: { href: '/about', text: 'About' }
|
|
@@ -26,30 +20,38 @@ export const Header = {
|
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
export const ThemeSwitcher = {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
23
|
+
display: 'flex',
|
|
24
|
+
gap: 'A2',
|
|
25
|
+
childExtends: {
|
|
26
|
+
isActive: (element, state) =>
|
|
27
|
+
state.globalTheme === element.key.toLowerCase(),
|
|
28
|
+
cursor: 'pointer',
|
|
29
|
+
'.isActive': {
|
|
30
|
+
fontWeight: '900'
|
|
31
|
+
},
|
|
32
|
+
onClick: (event, element, state, ctx) => {
|
|
33
|
+
console.log(element.key.toLowerCase())
|
|
34
|
+
ctx.designSystem.globalTheme = element.key.toLowerCase()
|
|
35
|
+
state.update({ globalTheme: element.key.toLowerCase() })
|
|
43
36
|
}
|
|
44
37
|
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
38
|
+
Dark: { text: 'Dark' },
|
|
39
|
+
Light: { text: 'Light' },
|
|
40
|
+
Midnight: { text: 'Midnight' }
|
|
48
41
|
}
|
|
49
42
|
|
|
50
43
|
export const Footer = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
padding: 'Z B',
|
|
45
|
+
order: 9
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export const TestComponent = {
|
|
49
|
+
padding: 'Z B',
|
|
50
|
+
round: 'A',
|
|
51
|
+
margin: 'A -Z C',
|
|
52
|
+
background: 'orange .35',
|
|
53
|
+
text: 'test',
|
|
54
|
+
':hover': {
|
|
55
|
+
background: 'orange .35 +35'
|
|
54
56
|
}
|
|
55
57
|
}
|
package/src/designSystem.js
CHANGED
package/src/index.js
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
import { create
|
|
3
|
+
import { create } from 'smbls'
|
|
4
4
|
|
|
5
5
|
import designSystem from './designSystem'
|
|
6
6
|
import * as components from './components'
|
|
7
7
|
import pages from './pages'
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
async function initialize () {
|
|
10
|
+
let fetched_context
|
|
11
|
+
try {
|
|
12
|
+
fetched_context = await import('../smbls_dist')
|
|
13
|
+
} catch (error) {
|
|
14
|
+
console.error('Failed to load fetched_context:', error)
|
|
15
|
+
}
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
create(
|
|
18
|
+
{},
|
|
19
|
+
fetched_context || {
|
|
20
|
+
designSystem,
|
|
21
|
+
components,
|
|
22
|
+
pages
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
content: {},
|
|
22
|
-
|
|
23
|
-
Footer: { text: 'Footer' }
|
|
24
|
-
}, {
|
|
25
|
-
designSystem,
|
|
26
|
-
components,
|
|
27
|
-
pages
|
|
28
|
-
})
|
|
27
|
+
initialize()
|
package/src/pages.js
CHANGED
|
@@ -2,11 +2,29 @@
|
|
|
2
2
|
|
|
3
3
|
export default {
|
|
4
4
|
'/': {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Header: {},
|
|
6
|
+
TestComponent: {},
|
|
7
|
+
Link: {
|
|
8
|
+
href: 'https://symbols.app/developers',
|
|
9
|
+
target: '_blank',
|
|
10
|
+
':hover': {
|
|
11
|
+
'& svg': {
|
|
12
|
+
margin: '- Y - -'
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
Icon: {
|
|
16
|
+
transition: 'margin ease A',
|
|
17
|
+
margin: '- X - -',
|
|
18
|
+
name: 'arrow up right'
|
|
19
|
+
},
|
|
20
|
+
Span: 'Checkout Docs'
|
|
21
|
+
}
|
|
7
22
|
},
|
|
8
23
|
'/about': {
|
|
9
|
-
|
|
10
|
-
|
|
24
|
+
Header: {},
|
|
25
|
+
Link: {
|
|
26
|
+
href: '/',
|
|
27
|
+
text: 'Go Back'
|
|
28
|
+
}
|
|
11
29
|
}
|
|
12
30
|
}
|
package/symbols.json
CHANGED