@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 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
- To use the components and styles in your project with Tailwind CSS v4:
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. Configure Tailwind CSS in your consuming app
31
+ ### 2. Install peer dependencies
32
32
 
33
- In your app's CSS file (e.g., `app/globals.css` or `src/index.css`), add:
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
- /* Import the design system's Tailwind configuration and theme */
39
- @import "@krrli/cm-designsystem/src/index.css";
46
+ ### 4. Use components
40
47
 
41
- /* Scan the design system's components for Tailwind classes */
42
- @source "../node_modules/@krrli/cm-designsystem/dist/**/*.js";
48
+ ```tsx
49
+ import { Button, Post } from "@krrli/cm-designsystem";
43
50
 
44
- /* Your app's custom theme/styles can go here */
51
+ export default function Page() {
52
+ return <Button intent="primary">Click me</Button>;
53
+ }
45
54
  ```
46
55
 
47
- ### 3. Install required peer dependencies
56
+ **That's it!** All responsive breakpoints (sm:, md:, lg:, etc.) work automatically.
48
57
 
49
- ```bash
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
- ### 4. Import and use components
60
+ ### Advanced: Use Tailwind Preset (Optional)
54
61
 
55
- ```tsx
56
- import { Button } from "@krrli/cm-designsystem";
62
+ If you want to customize or extend the design system:
57
63
 
58
- function App() {
59
- return (
60
- <Button intent="primary" size="md" onClick={() => console.log("Clicked!")}>
61
- Click me
62
- </Button>
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
- ### Notes
76
+ **Use design tokens:**
77
+
78
+ ```typescript
79
+ import { colors, fonts } from "@krrli/cm-designsystem/tokens";
80
+ ```
68
81
 
69
- - **Tailwind CSS v4**: This design system uses Tailwind CSS v4. Your consuming app must also use Tailwind v4 with the `@tailwindcss/vite` plugin.
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