@nersh/render 0.2.4 → 0.3.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 +24 -3
- package/dist/index.cjs +41935 -22424
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +869 -7
- package/dist/index.d.ts +869 -7
- package/dist/index.mjs +41462 -21918
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -9,15 +9,17 @@ Used internally by projects scaffolded with `npm create nersh@latest`.
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
|
-
npm install @nersh/render
|
|
12
|
+
npm install @nersh/render react react-dom
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
`@nersh/render` declares three runtime dependencies (`clsx`, `tailwind-merge`, `embla-carousel-react`), so npm installs them automatically. The peers below are the packages a consumer's own sections may need, install the ones your sections actually use. Tailwind classes come from your own build, not from the package, via the `@source "../node_modules/@nersh/render/dist"` directive described in Tailwind v4 setup below.
|
|
16
|
+
|
|
15
17
|
### Peer dependencies
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
Sections built on the full component library may need these too:
|
|
18
20
|
|
|
19
21
|
```bash
|
|
20
|
-
npm install react react-dom
|
|
22
|
+
npm install react react-dom lucide-react motion recharts class-variance-authority cobe zod @base-ui/react @calcom/embed-react shadcn
|
|
21
23
|
```
|
|
22
24
|
|
|
23
25
|
Projects created with `create-nersh` include all of these automatically.
|
|
@@ -92,6 +94,12 @@ Without this, styles from the render package will not appear.
|
|
|
92
94
|
|
|
93
95
|
---
|
|
94
96
|
|
|
97
|
+
## Node styles
|
|
98
|
+
|
|
99
|
+
A node in `site.json` may carry `styles`: CSS per breakpoint, keyed `desktop`, `tablet` (below 64rem) and `phone` (below 48rem), each a map of CSS longhands to values (`{ "desktop": { "min-height": "100vh" }, "phone": { "min-height": "80vh" } }`). `SiteRenderer` writes one scoped `<style data-node-styles>` with container queries against the surface, the same stylesheet the hosted site writes, and stamps `data-section` and `data-instance` on a nested wrapper only when that node declares styles. A site with no `styles` renders what 0.2.5 rendered; the surface stylesheet only loses two type rules (`data-text-color`, `data-text-align`) that no exported node ever set.
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
95
103
|
## `SiteRenderer` props
|
|
96
104
|
|
|
97
105
|
| Prop | Type | Description |
|
|
@@ -109,7 +117,20 @@ Set via `skinId` in `site.json`.
|
|
|
109
117
|
|
|
110
118
|
---
|
|
111
119
|
|
|
120
|
+
## Dark mode
|
|
121
|
+
|
|
122
|
+
A skin's dark values ship under a `.dark` class selector, the shadcn convention: something needs to add `class="dark"` to `<html>` (by hand, or with a library like `next-themes`) before they take effect. Hosted nertia.ai pages do not use this convention. They switch on `prefers-color-scheme` instead, so a project built on `@nersh/render` with no `.dark` toggle wired up renders light only, even on a system set to dark.
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
112
126
|
## Related
|
|
113
127
|
|
|
114
128
|
- [`create-nersh`](https://www.npmjs.com/package/create-nersh) — scaffold a full site with `npm create nersh@latest`
|
|
115
129
|
- [nertia.ai](https://nertia.ai) — browser-based builder that writes the same `site.json` format
|
|
130
|
+
|
|
131
|
+
---
|
|
132
|
+
|
|
133
|
+
## Changelog
|
|
134
|
+
|
|
135
|
+
- 0.3.0: renders node `styles` (per-breakpoint CSS on any node) as one scoped stylesheet; unstyled sites render as before, the surface stylesheet less the unused `data-text-color` and `data-text-align` rules; a node's legacy `overrides` bag is not read (0.2.5 never read it either); importing an older `.nertia.json` into nertia.ai converts each bag to `styles`, so export it again from there to keep that look
|
|
136
|
+
- 0.2.5: declares `tailwind-merge`, `clsx`, and `embla-carousel-react`; 0.2.4 required installing them by hand
|