@jameskabz/nextcraft-ui 0.2.0 → 0.4.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 CHANGED
@@ -11,6 +11,7 @@ npm install @jameskabz/nextcraft-ui
11
11
  ## Usage
12
12
 
13
13
  ```tsx
14
+ import "@jameskabz/nextcraft-ui/styles.css";
14
15
  import { CraftButton, GlassCard } from "@jameskabz/nextcraft-ui";
15
16
 
16
17
  export default function Example() {
@@ -26,19 +27,46 @@ export default function Example() {
26
27
  }
27
28
  ```
28
29
 
29
- ## Tailwind setup
30
+ ## Styles setup
30
31
 
31
- This library ships class names only. Make sure Tailwind scans your node_modules
32
- for the package so the classes are generated:
32
+ This library ships a precompiled stylesheet. Import it once in your app’s
33
+ global entry:
33
34
 
34
35
  ```ts
35
- // tailwind.config.ts
36
- export default {
37
- content: [
38
- "./src/**/*.{ts,tsx}",
39
- "./node_modules/@jameskabz/nextcraft-ui/dist/**/*.{js,mjs}"
40
- ]
41
- };
36
+ // App Router (Next.js)
37
+ import "@jameskabz/nextcraft-ui/styles.css";
38
+ ```
39
+
40
+ ## Themes
41
+
42
+ Wrap your app once to enable theme switching:
43
+
44
+ ```tsx
45
+ import { ThemeProvider } from "@jameskabz/nextcraft-ui";
46
+
47
+ export default function RootLayout({ children }: { children: React.ReactNode }) {
48
+ return (
49
+ <ThemeProvider>
50
+ {children}
51
+ </ThemeProvider>
52
+ );
53
+ }
54
+ ```
55
+
56
+ Add a switcher anywhere in your UI:
57
+
58
+ ```tsx
59
+ import { ThemeSwitcher } from "@jameskabz/nextcraft-ui";
60
+
61
+ export function Settings() {
62
+ return <ThemeSwitcher />;
63
+ }
64
+ ```
65
+
66
+ Per-component theme override:
67
+
68
+ ```tsx
69
+ <GlassCard tone="ember">...</GlassCard>
42
70
  ```
43
71
 
44
72
  ## Troubleshooting: Module not found