@meteo28093/equinox-ui 0.0.8 → 0.1.1
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 +112 -1
- package/dist/equinox-ui.0.0.9.esm.js +2705 -0
- package/dist/equinox-ui.0.0.9.global.js +2705 -0
- package/dist/equinox-ui.0.1.0.esm.js +2712 -0
- package/dist/equinox-ui.0.1.0.global.js +2712 -0
- package/dist/equinox-ui.0.1.01.esm.js +2712 -0
- package/dist/equinox-ui.0.1.01.global.js +2712 -0
- package/dist/equinox-ui.esm.js +63 -56
- package/dist/equinox-ui.global.js +66 -59
- package/package.json +3 -1
- package/src/styles/tokens.css +25 -0
package/README.md
CHANGED
|
@@ -4,10 +4,121 @@ Equinox UI is a web component library for blogs or small web projects.
|
|
|
4
4
|
|
|
5
5
|
You can use the bundled `equinox.css`, use a classless framework like water.css or pico.css or style the components.
|
|
6
6
|
|
|
7
|
+
## Install from npm
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @meteo28093/equinox-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import the package once in your browser entrypoint to register all custom elements globally:
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
// main.js
|
|
17
|
+
import "@meteo28093/equinox-ui";
|
|
18
|
+
import "@meteo28093/equinox-ui/equinox.css";
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If you only want the design tokens, import the exported token file instead:
|
|
22
|
+
|
|
23
|
+
```js
|
|
24
|
+
import "@meteo28093/equinox-ui/tokens.css";
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Importing `@meteo28093/equinox-ui` registers the components globally with `customElements.define(...)`.
|
|
28
|
+
|
|
29
|
+
## Supported integration modes
|
|
30
|
+
|
|
31
|
+
- CDN global script via `unpkg`
|
|
32
|
+
- npm package with an ESM/bundler entrypoint
|
|
33
|
+
- Client-only framework integration in Vue, React, or other browser-rendered apps
|
|
34
|
+
|
|
35
|
+
## Plain ESM apps
|
|
36
|
+
|
|
37
|
+
Use the package in any bundler-based app by importing it from your browser entry module:
|
|
38
|
+
|
|
39
|
+
```txt
|
|
40
|
+
src/
|
|
41
|
+
main.js
|
|
42
|
+
App.js
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
```js
|
|
46
|
+
// src/main.js
|
|
47
|
+
import "@meteo28093/equinox-ui";
|
|
48
|
+
import "@meteo28093/equinox-ui/equinox.css";
|
|
49
|
+
|
|
50
|
+
document.body.innerHTML = `
|
|
51
|
+
<ee-card title="Hello from Equinox UI">
|
|
52
|
+
<p>Bundled ESM import works in plain browser projects.</p>
|
|
53
|
+
</ee-card>
|
|
54
|
+
`;
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Vue / Vite
|
|
58
|
+
|
|
59
|
+
Import Equinox UI once in your client bootstrap file, then use the elements directly in Vue templates.
|
|
60
|
+
|
|
61
|
+
```js
|
|
62
|
+
// src/main.js
|
|
63
|
+
import { createApp } from "vue";
|
|
64
|
+
import App from "./App.vue";
|
|
65
|
+
import "@meteo28093/equinox-ui";
|
|
66
|
+
import "@meteo28093/equinox-ui/equinox.css";
|
|
67
|
+
|
|
68
|
+
createApp(App).mount("#app");
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
```vue
|
|
72
|
+
<!-- src/App.vue -->
|
|
73
|
+
<template>
|
|
74
|
+
<ee-card title="Vue + Equinox UI">
|
|
75
|
+
<p>Custom elements work after the package is imported in the app entry.</p>
|
|
76
|
+
</ee-card>
|
|
77
|
+
</template>
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## React
|
|
81
|
+
|
|
82
|
+
Import Equinox UI once in your client entry file so the custom elements are registered before React renders them.
|
|
83
|
+
|
|
84
|
+
```jsx
|
|
85
|
+
// src/main.jsx or src/index.jsx
|
|
86
|
+
import React from "react";
|
|
87
|
+
import ReactDOM from "react-dom/client";
|
|
88
|
+
import App from "./App.jsx";
|
|
89
|
+
import "@meteo28093/equinox-ui";
|
|
90
|
+
import "@meteo28093/equinox-ui/equinox.css";
|
|
91
|
+
|
|
92
|
+
ReactDOM.createRoot(document.getElementById("root")).render(<App />);
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
```jsx
|
|
96
|
+
// src/App.jsx
|
|
97
|
+
export default function App() {
|
|
98
|
+
return (
|
|
99
|
+
<ee-card title="React + Equinox UI">
|
|
100
|
+
<p>Use Equinox UI tags directly in JSX.</p>
|
|
101
|
+
</ee-card>
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
For custom DOM events or imperative APIs, use refs and `addEventListener(...)` instead of expecting React's synthetic event system to map custom events automatically.
|
|
107
|
+
|
|
108
|
+
## SSR and client-only loading
|
|
109
|
+
|
|
110
|
+
The ESM bundle touches `window` and `document` during module evaluation, so load it only in browser/client code.
|
|
111
|
+
|
|
112
|
+
- Import it from `main.js`, `main.jsx`, or another browser entrypoint
|
|
113
|
+
- In SSR-capable frameworks, keep the import behind a client boundary such as a client-only component or browser-only bootstrap file
|
|
114
|
+
- Do not import the package from server-rendered modules
|
|
115
|
+
|
|
116
|
+
If smoother SSR support is needed later, the next packaging improvement would be to split browser-only side effects from import-safe exports.
|
|
117
|
+
|
|
7
118
|
## Use with a CDN
|
|
8
119
|
|
|
9
120
|
```html
|
|
10
|
-
<script src="https://unpkg.com/@meteo28093/equinox-ui@0.
|
|
121
|
+
<script src="https://unpkg.com/@meteo28093/equinox-ui@0.1.01/dist/equinox-ui.0.1.01.global.js"></script>
|
|
11
122
|
```
|
|
12
123
|
|
|
13
124
|
This registers components globally.
|