@krrli/cm-designsystem 1.34.10 → 1.34.12
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 +37 -26
- package/dist/styles.css +2068 -0
- package/dist/tailwind.preset.d.ts +8 -0
- package/dist/tailwind.preset.d.ts.map +1 -0
- package/dist/tailwind.preset.js +29 -0
- package/dist/tokens/index.d.ts +60 -0
- package/dist/tokens/index.d.ts.map +1 -0
- package/dist/tokens.js +65 -0
- package/package.json +20 -3
- package/src/base.css +17 -0
- package/dist/setupTests.d.ts +0 -1
- package/dist/setupTests.d.ts.map +0 -1
- package/src/index.css +0 -88
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ A modern React component library built with TypeScript, Tailwind CSS, and Storyb
|
|
|
20
20
|
|
|
21
21
|
## Usage in Your Project
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
**Easiest approach:** Just import the complete CSS bundle with all styles and responsive breakpoints!
|
|
24
24
|
|
|
25
25
|
### 1. Install the package
|
|
26
26
|
|
|
@@ -28,47 +28,58 @@ To use the components and styles in your project with Tailwind CSS v4:
|
|
|
28
28
|
npm install @krrli/cm-designsystem
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
### 2.
|
|
31
|
+
### 2. Install peer dependencies
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
```bash
|
|
34
|
+
npm install @radix-ui/react-accessible-icon @radix-ui/react-aspect-ratio @radix-ui/react-avatar @radix-ui/react-dialog @radix-ui/react-form @radix-ui/react-tabs @radix-ui/react-toggle
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. Import the complete CSS
|
|
38
|
+
|
|
39
|
+
In your app's CSS file (e.g., `app/globals.css`):
|
|
34
40
|
|
|
35
41
|
```css
|
|
36
42
|
@import "tailwindcss";
|
|
43
|
+
@import "@krrli/cm-designsystem/styles.css";
|
|
44
|
+
```
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
@import "@krrli/cm-designsystem/src/index.css";
|
|
46
|
+
### 4. Use components
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
48
|
+
```tsx
|
|
49
|
+
import { Button, Post } from "@krrli/cm-designsystem";
|
|
43
50
|
|
|
44
|
-
|
|
51
|
+
export default function Page() {
|
|
52
|
+
return <Button intent="primary">Click me</Button>;
|
|
53
|
+
}
|
|
45
54
|
```
|
|
46
55
|
|
|
47
|
-
|
|
56
|
+
**That's it!** All responsive breakpoints (sm:, md:, lg:, etc.) work automatically.
|
|
48
57
|
|
|
49
|
-
|
|
50
|
-
npm install @radix-ui/react-accessible-icon @radix-ui/react-aspect-ratio @radix-ui/react-avatar @radix-ui/react-dialog @radix-ui/react-form @radix-ui/react-tabs @radix-ui/react-toggle
|
|
51
|
-
```
|
|
58
|
+
---
|
|
52
59
|
|
|
53
|
-
###
|
|
60
|
+
### Advanced: Use Tailwind Preset (Optional)
|
|
54
61
|
|
|
55
|
-
|
|
56
|
-
import { Button } from "@krrli/cm-designsystem";
|
|
62
|
+
If you want to customize or extend the design system:
|
|
57
63
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
**Configure Tailwind:**
|
|
65
|
+
|
|
66
|
+
```typescript
|
|
67
|
+
import type { Config } from "tailwindcss";
|
|
68
|
+
import designSystemPreset from "@krrli/cm-designsystem/tailwind.preset";
|
|
69
|
+
|
|
70
|
+
export default {
|
|
71
|
+
presets: [designSystemPreset],
|
|
72
|
+
content: ["./src/**/*.{ts,tsx}"],
|
|
73
|
+
} satisfies Config;
|
|
65
74
|
```
|
|
66
75
|
|
|
67
|
-
|
|
76
|
+
**Use design tokens:**
|
|
77
|
+
|
|
78
|
+
```typescript
|
|
79
|
+
import { colors, fonts } from "@krrli/cm-designsystem/tokens";
|
|
80
|
+
```
|
|
68
81
|
|
|
69
|
-
- **
|
|
70
|
-
- **Source-based approach**: The design system ships JavaScript/TypeScript source files. Your app's Tailwind processes all utility classes, including responsive variants.
|
|
71
|
-
- **Font**: The Poppins font is bundled with the design system and will be automatically available when you import the CSS.
|
|
82
|
+
- ✅ **Framework-compatible**: Works with Next.js, Vite, and other tools
|
|
72
83
|
|
|
73
84
|
````
|
|
74
85
|
|