@nextlyhq/ui 0.0.2-alpha.32 → 0.0.2-alpha.34

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 CHANGED
@@ -31,33 +31,41 @@ pnpm add react react-dom lucide-react
31
31
 
32
32
  ## Setup
33
33
 
34
- The components ship as Tailwind CSS 4 token consumers. They reference HSL CSS variables (`--background`, `--primary`, `--border`, etc.) which your project must define.
34
+ The package ships two CSS entry points. Pick one:
35
35
 
36
- **Tailwind v4 (recommended)**
36
+ **Zero config — pre-compiled bundle**
37
37
 
38
- In your global CSS, define the design tokens with `@theme` and import the components:
38
+ Import the pre-built stylesheet once at your root. It bundles Tailwind, every design token
39
+ (on `:root`, flipped under `.dark`), and the base reset, so components render fully styled
40
+ with no build wiring:
39
41
 
40
- ```css
41
- /* app/globals.css */
42
- @import "tailwindcss";
42
+ ```tsx
43
+ import "@nextlyhq/ui/styles.css";
44
+ import { Button } from "@nextlyhq/ui";
43
45
 
44
- @theme {
45
- --color-background: hsl(0 0% 100%);
46
- --color-foreground: hsl(222 47% 11%);
47
- --color-primary: hsl(221 83% 53%);
48
- --color-primary-foreground: hsl(0 0% 100%);
49
- /* ...the rest. See `uiPreset` for the full token contract. */
50
- }
46
+ <Button variant="outline">Click me</Button>;
51
47
  ```
52
48
 
53
- The exported `uiPreset` is the reference contract: it lists every token name the components expect. Use it to write the matching `@theme` block (or import it directly if you are still on Tailwind v3).
49
+ **Bring your own Tailwind v4 build**
54
50
 
55
- ```tsx
56
- import { Button } from "@nextlyhq/ui";
51
+ If you already run Tailwind v4, import just the tokens and let your pipeline compile the
52
+ utilities the components use:
57
53
 
58
- <Button variant="outline">Click me</Button>;
54
+ ```css
55
+ /* app/globals.css */
56
+ @import "tailwindcss";
57
+ @import "@nextlyhq/ui/theme.css";
58
+ @source "../node_modules/@nextlyhq/ui/dist";
59
59
  ```
60
60
 
61
+ `theme.css` defines the tokens as complete OKLCH color values (`--background`, `--primary`,
62
+ `--border`, …) with `@theme inline` mappings and the dark-mode overrides. Reference tokens
63
+ directly (`var(--primary)`) — never wrap them in `hsl()`. The exported `uiPreset` remains
64
+ available as a Tailwind v3 preset.
65
+
66
+ > Inside a Nextly admin plugin you need neither import — the admin already provides the
67
+ > tokens. See the [**Plugin UI authoring guide**](./docs/plugin-ui-authoring.md).
68
+
61
69
  ## Components
62
70
 
63
71
  **Buttons and inputs:** `Button`, `Input`, `Textarea`, `Label`
@@ -81,6 +89,7 @@ import { Button } from "@nextlyhq/ui";
81
89
 
82
90
  ## Documentation
83
91
 
92
+ - [**Plugin UI authoring guide**](./docs/plugin-ui-authoring.md): the token contract, dark mode, container queries, and the design lint guard
84
93
  - [**Admin customization**](https://nextlyhq.com/docs/admin/customization): theming, branding, and custom field UIs
85
94
 
86
95
  ## Related packages