jsswift 1.0.44 → 1.0.45
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/dist/css/base.css +2 -137
- package/dist/css/fonts-material.css +7 -0
- package/dist/css/fonts-nunito.css +134 -0
- package/dist/css/min-ui.css +1 -1
- package/dist/css/ui.css +2 -137
- package/dist/css/ui.min.css +1 -1
- package/dist/documentions/README.md +2 -0
- package/dist/documentions/application-rules.md +12 -0
- package/dist/documentions/components/btn.md +35 -416
- package/dist/documentions/components/card.md +62 -594
- package/dist/documentions/components/dialog.md +81 -626
- package/dist/documentions/components/input.md +73 -617
- package/dist/documentions/components/pagination.md +54 -529
- package/dist/documentions/components/select.md +84 -658
- package/dist/documentions/components/table.md +93 -655
- package/dist/documentions/getting-started.md +27 -0
- package/dist/documentions/knowledge-map.json +1 -1
- package/dist/tabler.js +7 -0
- package/package.json +5 -2
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
- Call UI components directly on `_`, for example `_.Toggle(...)` and `_.Input(...)`.
|
|
7
7
|
- HTML/SVG helpers also use `_`, for example `_.div(...)`.
|
|
8
8
|
|
|
9
|
+
Minimal Vite imports:
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import 'jsswift';
|
|
13
|
+
import 'jsswift/css/ui.css';
|
|
14
|
+
const _ = window._;
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Read [application-rules.md](application-rules.md) before styling; the UI stylesheet already contains component styles and responsive rules.
|
|
18
|
+
|
|
9
19
|
Example:
|
|
10
20
|
|
|
11
21
|
_.ready(() => _.mount("#app", App()));
|
|
@@ -18,3 +28,20 @@ Example:
|
|
|
18
28
|
}
|
|
19
29
|
|
|
20
30
|
A view may return a DOM node, array, fragment, JSswift UI component, or reactive render function. Start with shell (AppShell, Layout, Page), layout (Container, Grid, Row, Card), then focused UI components.
|
|
31
|
+
|
|
32
|
+
## Optional fonts and icons
|
|
33
|
+
|
|
34
|
+
`jsswift/css/ui.css` includes component styles and uses system fonts. It does not load font files or activate the Tabler catalog. Existing applications that need Nunito or Material Symbols must now opt in explicitly:
|
|
35
|
+
|
|
36
|
+
```js
|
|
37
|
+
import 'jsswift';
|
|
38
|
+
import 'jsswift/css/ui.css';
|
|
39
|
+
// Optional: Nunito, including its theme font variables.
|
|
40
|
+
import 'jsswift/css/fonts-nunito.css';
|
|
41
|
+
// Optional: Material Symbols (downloads a font from Google).
|
|
42
|
+
import 'jsswift/css/fonts-material.css';
|
|
43
|
+
// Optional: configures the bundled Tabler SVG sprite for _.Icon('#name').
|
|
44
|
+
import 'jsswift/tabler';
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The same entries exist under `@jsswift/ui`; load the core and UI runtime first. Tabler can also be configured manually with `_.config.iconSpriteUrl` or the Icon `spriteUrl` prop. Inline SVG nodes and the built-in chevron remain available without the catalog. Import only the optional assets actually needed. The npm package still ships these assets; opting out reduces application build assets, not installation size. For CDN usage, load the runtime first, then import the optional `dist/tabler.js` module and/or link the optional CSS after `ui.css`.
|
package/dist/tabler.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Optional Tabler sprite: import after the JSswift runtime.
|
|
2
|
+
const runtime = globalThis.JSswift;
|
|
3
|
+
if (!runtime) throw new Error("Load JSswift before importing the optional Tabler sprite");
|
|
4
|
+
const spriteUrl = new URL('./img/svg/tabler-icons-sprite.svg', import.meta.url).href;
|
|
5
|
+
runtime.config ||= {};
|
|
6
|
+
runtime.config.iconSpriteUrl = spriteUrl;
|
|
7
|
+
export default spriteUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jsswift",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.45",
|
|
4
4
|
"description": "Umbrella package for JSswift core + UI",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,10 @@
|
|
|
30
30
|
"./css/animation.css": "./dist/css/animation.css",
|
|
31
31
|
"./css/docs.css": "./dist/css/docs.css",
|
|
32
32
|
"./package.json": "./package.json",
|
|
33
|
-
"./knowledge-map.json": "./dist/documentions/knowledge-map.json"
|
|
33
|
+
"./knowledge-map.json": "./dist/documentions/knowledge-map.json",
|
|
34
|
+
"./tabler": "./dist/tabler.js",
|
|
35
|
+
"./css/fonts-nunito.css": "./dist/css/fonts-nunito.css",
|
|
36
|
+
"./css/fonts-material.css": "./dist/css/fonts-material.css"
|
|
34
37
|
},
|
|
35
38
|
"files": [
|
|
36
39
|
"dist"
|