@sth87/shadcn-design-system 0.0.32 → 0.0.33

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/AI_README.md ADDED
@@ -0,0 +1,68 @@
1
+ # AI Agent Guide for @sth87/shadcn-design-system
2
+
3
+ ## Introduction
4
+ This is a React Component Library based on Shadcn UI and Radix UI, styled with Tailwind CSS. It is designed to be easily consumed by AI Agents generating UI code.
5
+
6
+ ## Configuration
7
+
8
+ ### 1. Tailwind Config
9
+ Ensure your `tailwind.config.js` includes the following content glob and theme extension (standard shadcn setup):
10
+
11
+ ```javascript
12
+ /** @type {import('tailwindcss').Config} */
13
+ module.exports = {
14
+ content: [
15
+ "./src/**/*.{ts,tsx}",
16
+ "./node_modules/@sth87/shadcn-design-system/dist/**/*.{js,mjs}"
17
+ ],
18
+ theme: {
19
+ extend: {
20
+ colors: {
21
+ border: "hsl(var(--border))",
22
+ input: "hsl(var(--input))",
23
+ ring: "hsl(var(--ring))",
24
+ background: "hsl(var(--background))",
25
+ foreground: "hsl(var(--foreground))",
26
+ primary: {
27
+ DEFAULT: "hsl(var(--primary))",
28
+ foreground: "hsl(var(--primary-foreground))",
29
+ },
30
+ // ... map other standard shadcn variables
31
+ }
32
+ }
33
+ }
34
+ }
35
+ ```
36
+
37
+ ### 2. Global CSS
38
+ You must import the library's CSS in your root entry file (e.g., `main.tsx` or `App.tsx`):
39
+
40
+ ```tsx
41
+ import "@sth87/shadcn-design-system/index.css";
42
+ import "@sth87/shadcn-design-system/animation.css";
43
+ ```
44
+
45
+ ## Component Usage
46
+ - **Context:** A detailed list of components and their props is available in `AI_CONTEXT.md` in the `dist/` folder of this package.
47
+ - **Imports:** Import components directly from `@sth87/shadcn-design-system/<component-name>` (lowercase).
48
+ - Example: `import { Button } from "@sth87/shadcn-design-system/button"`
49
+ - **Styling:** Use `className` to override styles. The library uses `tailwind-merge` internally.
50
+
51
+ ## Best Practices for AI Code Generation
52
+ 1. **Always check `AI_CONTEXT.md`** for the specific props of a component. Some components (like `Button`) have extended props (`animation`, `isLoading`) not found in the base shadcn library.
53
+ 2. **Use the `cn()` utility** if you are merging classes in your own components, but for library components, just pass `className`.
54
+ 3. **Icons:** The library uses `lucide-react`.
55
+
56
+ ## Example
57
+ ```tsx
58
+ import { Button } from "@sth87/shadcn-design-system/button";
59
+ import { LoaderCircle } from "lucide-react";
60
+
61
+ export default function MyComponent() {
62
+ return (
63
+ <Button variant="solid" color="primary" animation="pulse">
64
+ Click Me
65
+ </Button>
66
+ );
67
+ }
68
+ ```