smbls 3.4.9 → 3.5.0
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 +151 -4
- package/dist/cjs/src/prepare.js +5 -7
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/prepare.js +5 -7
- package/dist/iife/index.js +10 -14
- package/package.json +15 -15
- package/src/prepare.js +5 -7
package/README.md
CHANGED
|
@@ -1,7 +1,154 @@
|
|
|
1
|
-
#
|
|
1
|
+
# smbls
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/smbls)
|
|
4
|
+
[](https://www.npmjs.com/package/smbls)
|
|
5
|
+
[](https://bundlephobia.com/package/smbls)
|
|
6
|
+
[](https://github.com/symbo-ls/smbls/blob/main/LICENSE)
|
|
7
|
+
[](https://nodejs.org)
|
|
8
|
+
[](https://www.npmjs.com/package/smbls)
|
|
4
9
|
|
|
5
|
-
|
|
10
|
+
> The main Symbols package — bundles the entire design system ecosystem into a single import.
|
|
6
11
|
|
|
7
|
-
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install smbls
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## What's Included
|
|
19
|
+
|
|
20
|
+
This package re-exports everything from:
|
|
21
|
+
|
|
22
|
+
| Package | Description |
|
|
23
|
+
|---------|-------------|
|
|
24
|
+
| `@domql/utils` | Utility functions |
|
|
25
|
+
| `@symbo.ls/scratch` | CSS framework and methodology |
|
|
26
|
+
| `@symbo.ls/emotion` | Emotion CSS-in-JS integration |
|
|
27
|
+
| `@symbo.ls/default-config` | Default design system configuration |
|
|
28
|
+
| `@symbo.ls/uikit` | Complete UI component library |
|
|
29
|
+
| `@symbo.ls/smbls-utils` | Symbols-specific utilities |
|
|
30
|
+
| `css-in-props` | CSS properties as props |
|
|
31
|
+
| `attrs-in-props` | HTML attributes as props |
|
|
32
|
+
|
|
33
|
+
It also includes the `@symbo.ls/cli` binary, `@symbo.ls/fetch`, `@symbo.ls/sync`, and `@domql/router`.
|
|
34
|
+
|
|
35
|
+
## Quick Start
|
|
36
|
+
|
|
37
|
+
### Initialize Design System
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
import { init } from 'smbls'
|
|
41
|
+
|
|
42
|
+
init({
|
|
43
|
+
color: {
|
|
44
|
+
primary: '#3B82F6',
|
|
45
|
+
gray: ['#1F2937', '#9CA3AF'] // [light, dark]
|
|
46
|
+
},
|
|
47
|
+
theme: {
|
|
48
|
+
primary: {
|
|
49
|
+
color: 'white',
|
|
50
|
+
background: 'primary',
|
|
51
|
+
':hover': { opacity: '0.85' }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
})
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
### Create an Application
|
|
58
|
+
|
|
59
|
+
```javascript
|
|
60
|
+
import { create } from 'smbls'
|
|
61
|
+
|
|
62
|
+
const App = {
|
|
63
|
+
extends: 'Flex',
|
|
64
|
+
flow: 'column',
|
|
65
|
+
|
|
66
|
+
Header: {
|
|
67
|
+
extends: 'Flex',
|
|
68
|
+
H1: { text: 'Hello Symbols!' }
|
|
69
|
+
},
|
|
70
|
+
|
|
71
|
+
Main: {
|
|
72
|
+
extends: 'Flex',
|
|
73
|
+
Button: {
|
|
74
|
+
text: 'Get Started',
|
|
75
|
+
theme: 'primary'
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
create(App, {
|
|
81
|
+
key: 'your-project-key'
|
|
82
|
+
})
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Create Variants
|
|
86
|
+
|
|
87
|
+
```javascript
|
|
88
|
+
import { create, createAsync, createSync, createSkeleton } from 'smbls'
|
|
89
|
+
|
|
90
|
+
// Standard — renders immediately
|
|
91
|
+
create(App, options)
|
|
92
|
+
|
|
93
|
+
// Async — renders first, then fetches remote config
|
|
94
|
+
createAsync(App, options)
|
|
95
|
+
|
|
96
|
+
// Sync — fetches remote config first, then renders
|
|
97
|
+
await createSync(App, options)
|
|
98
|
+
|
|
99
|
+
// Skeleton — resolves extends only, no full rendering
|
|
100
|
+
createSkeleton(App, options)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
## Init Options
|
|
104
|
+
|
|
105
|
+
```javascript
|
|
106
|
+
init(config, {
|
|
107
|
+
emotion: customEmotion, // custom Emotion instance
|
|
108
|
+
useVariable: true, // inject CSS custom properties
|
|
109
|
+
useReset: true, // inject CSS reset
|
|
110
|
+
useFontImport: true, // inject @font-face declarations
|
|
111
|
+
useIconSprite: true, // create SVG icon sprite
|
|
112
|
+
useDocumentTheme: true, // apply document-level theme
|
|
113
|
+
useSvgSprite: true, // create SVG sprite sheet
|
|
114
|
+
useDefaultConfig: false, // use built-in default config
|
|
115
|
+
globalTheme: 'dark', // set global theme
|
|
116
|
+
verbose: false // enable verbose logging
|
|
117
|
+
})
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Additional Exports
|
|
121
|
+
|
|
122
|
+
```javascript
|
|
123
|
+
import {
|
|
124
|
+
// Re-initialization
|
|
125
|
+
reinit, // re-apply config changes
|
|
126
|
+
applyCSS, // inject global CSS
|
|
127
|
+
updateVars, // update CSS custom properties
|
|
128
|
+
|
|
129
|
+
// Constants
|
|
130
|
+
DEFAULT_CONTEXT,
|
|
131
|
+
DESIGN_SYSTEM_OPTIONS,
|
|
132
|
+
ROUTER_OPTIONS
|
|
133
|
+
} from 'smbls'
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
## CLI
|
|
137
|
+
|
|
138
|
+
This package also provides the `smbls` CLI binary:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
smbls init # Initialize a project
|
|
142
|
+
smbls start # Start dev server
|
|
143
|
+
smbls build # Build for production
|
|
144
|
+
smbls deploy # Deploy to hosting
|
|
145
|
+
smbls fetch # Fetch remote config
|
|
146
|
+
smbls push # Push changes to platform
|
|
147
|
+
smbls ask # AI assistant
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
See the [@symbo.ls/cli](../cli/) package for the full command reference.
|
|
151
|
+
|
|
152
|
+
## Documentation
|
|
153
|
+
|
|
154
|
+
For full documentation visit [symbols.app/developers](https://symbols.app/developers).
|
package/dist/cjs/src/prepare.js
CHANGED
|
@@ -50,13 +50,11 @@ var utils = __toESM(require("./utilImports.js"), 1);
|
|
|
50
50
|
var routerUtils = __toESM(require("@domql/router"), 1);
|
|
51
51
|
// @preserve-env
|
|
52
52
|
const prepareWindow = (context) => {
|
|
53
|
-
|
|
54
|
-
if (
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
context.document = context.document || document;
|
|
59
|
-
context.window = context.window || window;
|
|
53
|
+
const win = typeof window !== "undefined" ? window : globalThis || {};
|
|
54
|
+
if (!win.document) win.document = { body: {} };
|
|
55
|
+
const doc = typeof document !== "undefined" ? document : win.document;
|
|
56
|
+
context.document = context.document || doc;
|
|
57
|
+
context.window = context.window || win;
|
|
60
58
|
return context.window;
|
|
61
59
|
};
|
|
62
60
|
function onlyDotsAndNumbers(str) {
|
package/dist/esm/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"smbls","version":"3.4.
|
|
1
|
+
{"name":"smbls","version":"3.4.12"}
|
package/dist/esm/src/prepare.js
CHANGED
|
@@ -12,13 +12,11 @@ import * as utils from "./utilImports.js";
|
|
|
12
12
|
import * as routerUtils from "@domql/router";
|
|
13
13
|
// @preserve-env
|
|
14
14
|
const prepareWindow = (context) => {
|
|
15
|
-
|
|
16
|
-
if (
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
context.document = context.document || document;
|
|
21
|
-
context.window = context.window || window;
|
|
15
|
+
const win = typeof window !== "undefined" ? window : globalThis || {};
|
|
16
|
+
if (!win.document) win.document = { body: {} };
|
|
17
|
+
const doc = typeof document !== "undefined" ? document : win.document;
|
|
18
|
+
context.document = context.document || doc;
|
|
19
|
+
context.window = context.window || win;
|
|
22
20
|
return context.window;
|
|
23
21
|
};
|
|
24
22
|
function onlyDotsAndNumbers(str) {
|
package/dist/iife/index.js
CHANGED
|
@@ -502,13 +502,11 @@ var Smbls = (() => {
|
|
|
502
502
|
var uikit = __toESM(__require("@symbo.ls/uikit"));
|
|
503
503
|
var routerUtils = __toESM(__require("@domql/router"));
|
|
504
504
|
var prepareWindow = (context) => {
|
|
505
|
-
|
|
506
|
-
if (
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
context.document = context.document || document;
|
|
511
|
-
context.window = context.window || window;
|
|
505
|
+
const win = typeof window !== "undefined" ? window : globalThis || {};
|
|
506
|
+
if (!win.document) win.document = { body: {} };
|
|
507
|
+
const doc = typeof document !== "undefined" ? document : win.document;
|
|
508
|
+
context.document = context.document || doc;
|
|
509
|
+
context.window = context.window || win;
|
|
512
510
|
return context.window;
|
|
513
511
|
};
|
|
514
512
|
function onlyDotsAndNumbers(str) {
|
|
@@ -1063,13 +1061,11 @@ var Smbls = (() => {
|
|
|
1063
1061
|
var uikit3 = __toESM(__require("@symbo.ls/uikit"), 1);
|
|
1064
1062
|
var routerUtils2 = __toESM(__require("@domql/router"), 1);
|
|
1065
1063
|
var prepareWindow2 = (context) => {
|
|
1066
|
-
|
|
1067
|
-
if (
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
context.document = context.document || document;
|
|
1072
|
-
context.window = context.window || window;
|
|
1064
|
+
const win = typeof window !== "undefined" ? window : globalThis || {};
|
|
1065
|
+
if (!win.document) win.document = { body: {} };
|
|
1066
|
+
const doc = typeof document !== "undefined" ? document : win.document;
|
|
1067
|
+
context.document = context.document || doc;
|
|
1068
|
+
context.window = context.window || win;
|
|
1073
1069
|
return context.window;
|
|
1074
1070
|
};
|
|
1075
1071
|
function onlyDotsAndNumbers2(str) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "smbls",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": "https://github.com/symbo-ls/smbls",
|
|
6
6
|
"gitHead": "9fc1b79b41cdc725ca6b24aec64920a599634681",
|
|
@@ -28,20 +28,20 @@
|
|
|
28
28
|
"src"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@symbo.ls/emotion": "^3.
|
|
32
|
-
"@domql/report": "^3.
|
|
33
|
-
"@domql/router": "^3.
|
|
34
|
-
"@domql/utils": "^3.
|
|
35
|
-
"@symbo.ls/cli": "^3.
|
|
36
|
-
"@symbo.ls/default-config": "^3.
|
|
37
|
-
"@symbo.ls/fetch": "^3.
|
|
38
|
-
"@symbo.ls/scratch": "^3.
|
|
39
|
-
"@symbo.ls/sync": "^3.
|
|
40
|
-
"@symbo.ls/uikit": "^3.
|
|
41
|
-
"@symbo.ls/smbls-utils": "^3.
|
|
42
|
-
"attrs-in-props": "^3.
|
|
43
|
-
"css-in-props": "^3.
|
|
44
|
-
"domql": "^3.
|
|
31
|
+
"@symbo.ls/emotion": "^3.5.0",
|
|
32
|
+
"@domql/report": "^3.5.0",
|
|
33
|
+
"@domql/router": "^3.5.0",
|
|
34
|
+
"@domql/utils": "^3.5.0",
|
|
35
|
+
"@symbo.ls/cli": "^3.5.0",
|
|
36
|
+
"@symbo.ls/default-config": "^3.5.0",
|
|
37
|
+
"@symbo.ls/fetch": "^3.5.0",
|
|
38
|
+
"@symbo.ls/scratch": "^3.5.0",
|
|
39
|
+
"@symbo.ls/sync": "^3.5.0",
|
|
40
|
+
"@symbo.ls/uikit": "^3.5.0",
|
|
41
|
+
"@symbo.ls/smbls-utils": "^3.5.0",
|
|
42
|
+
"attrs-in-props": "^3.5.0",
|
|
43
|
+
"css-in-props": "^3.5.0",
|
|
44
|
+
"domql": "^3.5.0"
|
|
45
45
|
},
|
|
46
46
|
"publishConfig": {},
|
|
47
47
|
"scripts": {
|
package/src/prepare.js
CHANGED
|
@@ -17,13 +17,11 @@ import * as routerUtils from '@domql/router'
|
|
|
17
17
|
// @preserve-env
|
|
18
18
|
|
|
19
19
|
export const prepareWindow = (context) => {
|
|
20
|
-
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
context.document = context.document || document
|
|
26
|
-
context.window = context.window || window
|
|
20
|
+
const win = typeof window !== 'undefined' ? window : globalThis || {}
|
|
21
|
+
if (!win.document) win.document = { body: {} }
|
|
22
|
+
const doc = typeof document !== 'undefined' ? document : win.document
|
|
23
|
+
context.document = context.document || doc
|
|
24
|
+
context.window = context.window || win
|
|
27
25
|
return context.window
|
|
28
26
|
}
|
|
29
27
|
|