@nextlyhq/ui 0.0.2-alpha.60 → 0.0.2-alpha.62
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 +35 -8
- package/dist/index.cjs +472 -221
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +276 -21
- package/dist/index.d.ts +276 -21
- package/dist/index.mjs +477 -221
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.scoped.css +1 -1
- package/dist/tailwind-preset.cjs.map +1 -1
- package/dist/tailwind-preset.mjs.map +1 -1
- package/dist/theme.css +132 -0
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -60,8 +60,35 @@ utilities the components use:
|
|
|
60
60
|
|
|
61
61
|
`theme.css` defines the tokens as complete OKLCH color values (`--nx-background`, `--nx-primary`,
|
|
62
62
|
`--nx-border`, …) with `@theme inline` mappings and the dark-mode overrides. Reference tokens
|
|
63
|
-
directly (`var(--nx-primary)`) — never wrap them in `hsl()`.
|
|
64
|
-
|
|
63
|
+
directly (`var(--nx-primary)`) — never wrap them in `hsl()`.
|
|
64
|
+
|
|
65
|
+
**Bring your own Tailwind v3 build**
|
|
66
|
+
|
|
67
|
+
`uiPreset` from `@nextlyhq/ui/tailwind-preset` maps the same tokens to v3 utilities:
|
|
68
|
+
|
|
69
|
+
```js
|
|
70
|
+
// tailwind.config.js
|
|
71
|
+
const { uiPreset } = require("@nextlyhq/ui/tailwind-preset");
|
|
72
|
+
|
|
73
|
+
module.exports = {
|
|
74
|
+
presets: [uiPreset],
|
|
75
|
+
content: [
|
|
76
|
+
"./src/**/*.{js,jsx,ts,tsx}",
|
|
77
|
+
// Required. Tailwind generates a utility only for a class it has SEEN, and
|
|
78
|
+
// the classes these components write live in the published bundle rather
|
|
79
|
+
// than in your source. Omit this path and the components render with their
|
|
80
|
+
// utilities missing — no error, just unstyled markup.
|
|
81
|
+
"./node_modules/@nextlyhq/ui/dist/**/*.{js,mjs,cjs}",
|
|
82
|
+
],
|
|
83
|
+
};
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Import `@nextlyhq/ui/theme.css` alongside it. The preset carries tokens and the utilities
|
|
87
|
+
derived from them; a handful of components also write their own classes — `nx-page-shell`,
|
|
88
|
+
`nx-bleed`, `nx-form-section-rows` — and the rules behind those classes are CSS, shipped in
|
|
89
|
+
`theme.css` for every consumer alike. Scanning a component finds the class it writes, never
|
|
90
|
+
the rule, so a build with the preset and no stylesheet renders those components unstyled
|
|
91
|
+
without erroring.
|
|
65
92
|
|
|
66
93
|
> Inside a Nextly admin plugin you need neither import — the admin already provides the
|
|
67
94
|
> tokens. See the [**Plugin UI authoring guide**](./docs/plugin-ui-authoring.md).
|
|
@@ -97,7 +124,7 @@ as a Tailwind v3 preset from `@nextlyhq/ui/tailwind-preset`.
|
|
|
97
124
|
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
|
|
98
125
|
| `@nextlyhq/ui/styles.css` | The app is yours end to end. Styles the whole document, Tailwind preflight included. |
|
|
99
126
|
| `@nextlyhq/ui/styles.scoped.css` | Dropping a few components into an existing app. Every rule is confined to `.nextly-ui`, so the rest of the page keeps its own styles. |
|
|
100
|
-
| `@nextlyhq/ui/theme.css` | You compile Tailwind yourself
|
|
127
|
+
| `@nextlyhq/ui/theme.css` | You compile Tailwind yourself. Carries the token contract and the component rules; required on both the v4 and the v3-preset path. |
|
|
101
128
|
|
|
102
129
|
The scoped sheet needs a wrapper element, and dark mode goes on the same element:
|
|
103
130
|
|
|
@@ -150,11 +177,11 @@ This does not apply to `styles.css`, where the rules are document-wide and
|
|
|
150
177
|
|
|
151
178
|
## Compatibility
|
|
152
179
|
|
|
153
|
-
| Tool | Version
|
|
154
|
-
| -------------- |
|
|
155
|
-
| React | 18 or 19
|
|
156
|
-
| Tailwind CSS | 4+ (`@nextlyhq/ui/tailwind-preset` also works as a Tailwind v3 preset) |
|
|
157
|
-
| `lucide-react` | 0.400+
|
|
180
|
+
| Tool | Version |
|
|
181
|
+
| -------------- | ---------------------------------------------------------------------------------------- |
|
|
182
|
+
| React | 18 or 19 |
|
|
183
|
+
| Tailwind CSS | 4+ (`@nextlyhq/ui/tailwind-preset` also works as a Tailwind v3 preset, with `theme.css`) |
|
|
184
|
+
| `lucide-react` | 0.400+ |
|
|
158
185
|
|
|
159
186
|
## Documentation
|
|
160
187
|
|