@catiarodrigues/goldfinch 1.0.1 → 1.0.2
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/.claude/skills/goldfinch/SKILL.md +14 -6
- package/README.md +33 -4
- package/package.json +1 -1
|
@@ -13,20 +13,28 @@ don't add redundant `aria-*` unless overriding real custom behavior).
|
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
15
|
pnpm add @catiarodrigues/goldfinch
|
|
16
|
+
pnpm add -D tailwindcss @tailwindcss/vite
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
Only real peer deps are `react`/`react-dom` (>=18) — `@phosphor-icons/react`, `@base-ui/react`,
|
|
19
20
|
`clsx`, `tailwind-merge` all come along as regular dependencies, don't install them separately.
|
|
20
21
|
|
|
21
|
-
|
|
22
|
+
**Tailwind CSS v4 is required.** The stylesheet ships as Tailwind source (`@import "tailwindcss"`
|
|
23
|
+
+ `@theme` tokens), not compiled CSS — the consuming project's Tailwind build generates the
|
|
24
|
+
utility classes. Add `tailwindcss()` from `@tailwindcss/vite` to `vite.config.ts` plugins, then
|
|
25
|
+
put this in the app's main CSS file (once):
|
|
22
26
|
|
|
23
|
-
```
|
|
24
|
-
import "@catiarodrigues/goldfinch/styles";
|
|
27
|
+
```css
|
|
28
|
+
@import "@catiarodrigues/goldfinch/styles";
|
|
29
|
+
@source "../node_modules/@catiarodrigues/goldfinch/dist";
|
|
25
30
|
```
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
32
|
+
- `@source` is mandatory: Tailwind v4 doesn't scan `node_modules`, so without it every
|
|
33
|
+
component renders unstyled. The path is relative to the CSS file — adjust it if the CSS file
|
|
34
|
+
isn't one level below the project root.
|
|
35
|
+
- Don't add a second `@import "tailwindcss"`; the Goldfinch stylesheet already includes it.
|
|
36
|
+
- Don't import the stylesheet from TS/TSX (`import "@catiarodrigues/goldfinch/styles"`):
|
|
37
|
+
`@source` can't go there, and TypeScript 6+ errors on that side-effect import.
|
|
30
38
|
|
|
31
39
|
## Imports
|
|
32
40
|
|
package/README.md
CHANGED
|
@@ -22,23 +22,52 @@ A React component library built on [Base UI](https://base-ui.com/) and Tailwind
|
|
|
22
22
|
|
|
23
23
|
## Installation
|
|
24
24
|
|
|
25
|
+
Goldfinch needs **Tailwind CSS v4** in the consuming project: its stylesheet ships as Tailwind
|
|
26
|
+
source (theme tokens + `@import "tailwindcss"`), and your Tailwind build generates the utility
|
|
27
|
+
classes the components use.
|
|
28
|
+
|
|
25
29
|
```bash
|
|
26
30
|
pnpm add @catiarodrigues/goldfinch
|
|
31
|
+
pnpm add -D tailwindcss @tailwindcss/vite
|
|
27
32
|
```
|
|
28
33
|
|
|
29
|
-
|
|
34
|
+
React (`>=18`) is the only peer dependency.
|
|
30
35
|
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
### Set up the styles
|
|
37
|
+
|
|
38
|
+
Add the Tailwind plugin to Vite:
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
// vite.config.ts
|
|
42
|
+
import { defineConfig } from "vite";
|
|
43
|
+
import react from "@vitejs/plugin-react";
|
|
44
|
+
import tailwindcss from "@tailwindcss/vite";
|
|
45
|
+
|
|
46
|
+
export default defineConfig({
|
|
47
|
+
plugins: [react(), tailwindcss()],
|
|
48
|
+
});
|
|
33
49
|
```
|
|
34
50
|
|
|
51
|
+
Then, in your main CSS file (e.g. `src/index.css`, imported once from `main.tsx`):
|
|
52
|
+
|
|
53
|
+
```css
|
|
54
|
+
@import "@catiarodrigues/goldfinch/styles";
|
|
55
|
+
@source "../node_modules/@catiarodrigues/goldfinch/dist";
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
- Don't add a separate `@import "tailwindcss"` — the Goldfinch stylesheet already includes it.
|
|
59
|
+
- `@source` is required: Tailwind v4 skips `node_modules` when scanning for class names, so
|
|
60
|
+
without it the components render unstyled. The path is relative to the CSS file.
|
|
61
|
+
- Import the stylesheet from CSS, not from a `.ts`/`.tsx` file — `@source` only works in CSS,
|
|
62
|
+
and TypeScript 6+ rejects the bare `import "@catiarodrigues/goldfinch/styles"` side-effect
|
|
63
|
+
import.
|
|
64
|
+
|
|
35
65
|
## Usage
|
|
36
66
|
|
|
37
67
|
### Barrel import
|
|
38
68
|
|
|
39
69
|
```tsx
|
|
40
70
|
import { Button, Input, Modal } from "@catiarodrigues/goldfinch";
|
|
41
|
-
import "@catiarodrigues/goldfinch/styles";
|
|
42
71
|
```
|
|
43
72
|
|
|
44
73
|
### Granular import (tree-shaking)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@catiarodrigues/goldfinch",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Goldfinch - A React component library built on Base UI and Tailwind CSS v4",
|
|
5
5
|
"homepage": "https://goldfinch.catiarodrigues.dev/",
|
|
6
6
|
"bugs": "https://github.com/catiarodrigues/goldfinch/issues",
|