@faqir-ui/core 1.0.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/LICENSE +21 -0
- package/README.md +97 -0
- package/cdn.json +28 -0
- package/dist/faqir-core.js +11792 -0
- package/dist/faqir-core.min.js +5 -0
- package/dist/faqir-core.min.js.map +11 -0
- package/dist/faqir-core.mjs +9735 -0
- package/dist/faqir.aurora.css +13527 -0
- package/dist/faqir.brutalist.css +13536 -0
- package/dist/faqir.contrast.css +13569 -0
- package/dist/faqir.default.css +13468 -0
- package/dist/faqir.document-serif.css +13457 -0
- package/dist/faqir.document.css +13466 -0
- package/dist/faqir.glass.css +13576 -0
- package/dist/faqir.midnight.css +13518 -0
- package/dist/faqir.paper.css +13539 -0
- package/dist/faqir.slate.css +13518 -0
- package/dist/faqir.soft.css +13540 -0
- package/dist/faqir.terminal.css +13546 -0
- package/dist/plugins/faqir-collapse.js +110 -0
- package/dist/plugins/faqir-intersect.js +64 -0
- package/dist/plugins/faqir-mask.js +339 -0
- package/dist/plugins/faqir-persist.js +129 -0
- package/dist/plugins/faqir-validate.js +221 -0
- package/dist/sri.json +23 -0
- package/examples/cdn-two-tag.html +49 -0
- package/faqir-core.d.ts +856 -0
- package/package.json +77 -0
- package/src/cdn-entry.js +12 -0
- package/src/esm-entry.js +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Narcis Brindusescu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# @faqir-ui/core
|
|
2
|
+
|
|
3
|
+
The Faqir UI **runtime** — a zero-dependency, Alpine-style reactive engine plus
|
|
4
|
+
prebuilt, per-theme CSS bundles. This is the *trial & embed* path: drop two tags into
|
|
5
|
+
any HTML file and you have a styled, interactive Faqir page. No build step, no install.
|
|
6
|
+
|
|
7
|
+
> The CLI (`faqir-ui-cli`) remains the *ownership* path — it copies component files into
|
|
8
|
+
> your project so you can audit, theme, and upgrade them. The CDN is for scratch pages,
|
|
9
|
+
> CodePen, Claude artifacts, and agents without a shell.
|
|
10
|
+
|
|
11
|
+
## The two-tag CDN story
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<!-- 1. A theme's full CSS bundle (tokens + theme + base + every component) -->
|
|
15
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@faqir-ui/core@0.2/dist/faqir.default.css">
|
|
16
|
+
|
|
17
|
+
<!-- 2. The reactive engine — sets window.Faqir and auto-boots on DOMContentLoaded -->
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/@faqir-ui/core@0.2/dist/faqir-core.min.js" defer></script>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
That's it. Now write Faqir markup:
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<div l-data="{ count: 0 }" data-ui="surface">
|
|
25
|
+
<button data-ui="button" data-variant="primary" l-on:click="count++">
|
|
26
|
+
Clicked <span l-text="count">0</span> times
|
|
27
|
+
</button>
|
|
28
|
+
</div>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
Swap the stylesheet to change theme: `faqir.default.css`, `faqir.midnight.css`,
|
|
32
|
+
`faqir.paper.css`, `faqir.document.css`, `faqir.brutalist.css`.
|
|
33
|
+
|
|
34
|
+
## Subresource Integrity (SRI)
|
|
35
|
+
|
|
36
|
+
Every file in `dist/` has a SHA-384 hash in [`dist/sri.json`](./dist/sri.json). Pin them
|
|
37
|
+
for tamper-proof loads:
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
<link rel="stylesheet"
|
|
41
|
+
href="https://cdn.jsdelivr.net/npm/@faqir-ui/core@0.2/dist/faqir.default.css"
|
|
42
|
+
integrity="sha384-…paste from sri.json…"
|
|
43
|
+
crossorigin="anonymous">
|
|
44
|
+
<script src="https://cdn.jsdelivr.net/npm/@faqir-ui/core@0.2/dist/faqir-core.min.js"
|
|
45
|
+
integrity="sha384-…paste from sri.json…"
|
|
46
|
+
crossorigin="anonymous" defer></script>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Artifacts (in `dist/`)
|
|
50
|
+
|
|
51
|
+
| File | What it is |
|
|
52
|
+
|------|------------|
|
|
53
|
+
| `faqir-core.mjs` | Real ESM — what `import "@faqir-ui/core"` resolves to. `export default` plus one named export per engine member. |
|
|
54
|
+
| `faqir-core.js` | Canonical UMD engine — what `<script src>` and the CDN load. Reachable explicitly at `@faqir-ui/core/faqir-core.js`. |
|
|
55
|
+
| `faqir-core.min.js` (+ `.map`) | Minified classic-script build; a plain `<script src>` sets `window.Faqir`. |
|
|
56
|
+
| `faqir.{theme}.css` | Full CSS bundle per theme: all tokens + theme + base + every component. Self-contained (no `@import`). |
|
|
57
|
+
| `plugins/` | Official self-registering drops: `faqir-persist`, `faqir-intersect`, `faqir-collapse`, and `faqir-validate`. |
|
|
58
|
+
| `sri.json` | SHA-384 integrity hashes for every file above. |
|
|
59
|
+
|
|
60
|
+
## Module usage
|
|
61
|
+
|
|
62
|
+
The package is **ESM-only**. The default export is the engine; every member is
|
|
63
|
+
also a named export, so a bundler can tree-shake the import site (the engine
|
|
64
|
+
itself is one blob and is not tree-shakeable).
|
|
65
|
+
|
|
66
|
+
```js
|
|
67
|
+
import Faqir from "@faqir-ui/core"; // dist/faqir-core.mjs
|
|
68
|
+
import "@faqir-ui/core/dist/faqir.default.css"; // or your project's own bundle
|
|
69
|
+
|
|
70
|
+
Faqir.start();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import { start, reactive, store } from "@faqir-ui/core";
|
|
75
|
+
start();
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
There is no `require` condition. `require("@faqir-ui/core")` fails on Node 18
|
|
79
|
+
and 20 with a message pointing at `import()`, and resolves through `default` on
|
|
80
|
+
Node ≥ 22.12; use `await import("@faqir-ui/core")` from CommonJS. The UMD build
|
|
81
|
+
is still published for `<script>` and CDN use and can be reached directly:
|
|
82
|
+
|
|
83
|
+
```js
|
|
84
|
+
// UMD, for a bundler that must have CommonJS-shaped bytes
|
|
85
|
+
import "@faqir-ui/core/faqir-core.js"; // sets globalThis.Faqir
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Building
|
|
89
|
+
|
|
90
|
+
Artifacts are generated from the registry by the repo build (Bun required to build, not
|
|
91
|
+
to run):
|
|
92
|
+
|
|
93
|
+
```sh
|
|
94
|
+
bun run build:core-package # → packages/core/dist/*
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Zero runtime dependencies. MIT licensed.
|
package/cdn.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"package": "@faqir-ui/core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"base": "https://cdn.jsdelivr.net/npm/@faqir-ui/core@1.0.0/dist/",
|
|
5
|
+
"integrity": {
|
|
6
|
+
"faqir-core.js": "sha384-vH2gsWr7R/OAJLvYeBC4txN6mleQzdRiuLsc5AH2xbdge5+zQipF5AqSJS7Yc4Vz",
|
|
7
|
+
"faqir-core.min.js": "sha384-BHt1gSursbCylX/U3FT6iW5dWukyZcjDXKWOanw4baYgwn8qj1LIpI1It8ct7CyK",
|
|
8
|
+
"faqir-core.min.js.map": "sha384-io5FkzZ1meZXs3UY/kEJkmvB8YXwO/JfezQe4yZop6KZZjjwn6UCjeDUSh0FG1sz",
|
|
9
|
+
"faqir-core.mjs": "sha384-jqsZ/HqqXSuUjt6SikvDjynm7EdDVAfVLXYSoJHjzvOF+3V5CDmEZgzXDJPWvQ4I",
|
|
10
|
+
"faqir.aurora.css": "sha384-M7yDwTC7MuWfGfiIFLv9MFibCkYDDSHx6RFszEQ7iyd4Lp/bEG/SIyRcvSsfn2Vv",
|
|
11
|
+
"faqir.brutalist.css": "sha384-aRtTqpJetmoMa6uL2krMPEHsjTwF11oNlTzS9zZrdtqXSvzkSUCKKoHyr1WbCBnb",
|
|
12
|
+
"faqir.contrast.css": "sha384-Fy3tZU7cwb7LGNm9B/5nFNK1yRgwAZqv+FF69pY/w6AEGykZA4jSoDeFKU4hXdBf",
|
|
13
|
+
"faqir.default.css": "sha384-w2sH1K7AwYMeLQIhxBnAU1LuRrexg/xJx/eLLMgAjG7avxLYhYeuvM2pTu1yJJVi",
|
|
14
|
+
"faqir.document-serif.css": "sha384-2xWhB1DahXndhbbk7D+RV6w1NI7lPoO3tPgVtDvgWp8G+qE4jjI5nCWZa0IC1XiV",
|
|
15
|
+
"faqir.document.css": "sha384-loA3uWvclgLBd8OntpB4YrQP/jBsLScb06KI61EMauFjYxOadmCszUBkYYNoo4Wc",
|
|
16
|
+
"faqir.glass.css": "sha384-OQOzZy8BxLxPl1pFNkCwizX0oqOsmPf49FKhFa4d9HUM6bcJrJnzw3XU8IZGqSkG",
|
|
17
|
+
"faqir.midnight.css": "sha384-J0SQyAklYwD+yJ7jubtIJ+0t9DWBymcJikhI242PpTvzAL9SU4iWTYCwJBqSUbj0",
|
|
18
|
+
"faqir.paper.css": "sha384-OCmkztWvVBgacdb9HlGiRl+RRQ1QaFU8MCrQIYLeL17EMsT2tG8lZeU0mfQKLo6N",
|
|
19
|
+
"faqir.slate.css": "sha384-BxHSyxsLdi690Q1LBWIyAXodugjLNT764ZjqBRAaCtAaQeei81qzV46C5rMYonb4",
|
|
20
|
+
"faqir.soft.css": "sha384-a77S0Tcfd1I2V+r6Prt4gTtIzSZahltCuQ0jEzOKXUd+taDRjM0EsIy3n5VycLJT",
|
|
21
|
+
"faqir.terminal.css": "sha384-YvP4CkNUhcsFYJjBgnhcSMthsEheRg2RlZ0837GBzDVfmeJx9IYpMSrG7BkAb697",
|
|
22
|
+
"plugins/faqir-collapse.js": "sha384-y16PnFkcJiJLQIxuQMtdS+QalrC6lJ0EsPT/oceZWpLMGdqASXq3HhVHebfUWktm",
|
|
23
|
+
"plugins/faqir-intersect.js": "sha384-AfbB6icyS1ngl1JdiAMZ9//m5lHTMdgXXHWCdi5INfE9FmLbYRUeiyKTv4E4g6ri",
|
|
24
|
+
"plugins/faqir-mask.js": "sha384-cSq2DpUnoJCxEDAQjsbzAa+jSuHf4WsOaKT8t7b9p8pA7MaaRhA1DLzjMNChSa/I",
|
|
25
|
+
"plugins/faqir-persist.js": "sha384-o0jfddebC8QZ3S26VXUlOme723BNMlb/N7vqpn+fWpSeEFXzpq+3MoeXhVL/0PSv",
|
|
26
|
+
"plugins/faqir-validate.js": "sha384-DSzQ7I94Qm+VKjpgBo3qgALyuU3zgQZ+jXOIqgRHkJ6utr8nqF7tQMKWnOv1/YH2"
|
|
27
|
+
}
|
|
28
|
+
}
|