@krrli/cm-designsystem 1.34.11 → 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,12 +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
- The CM Design System provides four key exports:
24
-
25
- 1. **Design Tokens** - Colors, spacing, fonts (framework-agnostic)
26
- 2. **Tailwind Preset** - Pre-configured Tailwind theme
27
- 3. **React Components** - Built with Radix UI + Tailwind
28
- 4. **Base Styles** - Font imports and base CSS
23
+ **Easiest approach:** Just import the complete CSS bundle with all styles and responsive breakpoints!
29
24
 
30
25
  ### 1. Install the package
31
26
 
@@ -39,65 +34,51 @@ npm install @krrli/cm-designsystem
39
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
40
35
  ```
41
36
 
42
- ### 3. Configure Tailwind CSS
43
-
44
- Create or update your `tailwind.config.ts`:
45
-
46
- ```typescript
47
- import type { Config } from "tailwindcss";
48
- import designSystemPreset from "@krrli/cm-designsystem/tailwind.preset";
49
-
50
- export default {
51
- presets: [designSystemPreset],
52
- content: [
53
- "./src/**/*.{ts,tsx,js,jsx}",
54
- // Scan design system components for Tailwind classes
55
- "./node_modules/@krrli/cm-designsystem/dist/**/*.js",
56
- ],
57
- } satisfies Config;
58
- ```
59
-
60
- ### 4. Import base styles
37
+ ### 3. Import the complete CSS
61
38
 
62
- In your app's CSS file (e.g., `app/globals.css` or `src/index.css`):
39
+ In your app's CSS file (e.g., `app/globals.css`):
63
40
 
64
41
  ```css
65
42
  @import "tailwindcss";
66
- @import "@krrli/cm-designsystem/base.css";
43
+ @import "@krrli/cm-designsystem/styles.css";
67
44
  ```
68
45
 
69
- ### 5. Use components
46
+ ### 4. Use components
70
47
 
71
48
  ```tsx
72
- import { Button } from "@krrli/cm-designsystem";
49
+ import { Button, Post } from "@krrli/cm-designsystem";
73
50
 
74
- function App() {
75
- return (
76
- <Button intent="primary" size="md" onClick={() => console.log("Clicked!")}>
77
- Click me
78
- </Button>
79
- );
51
+ export default function Page() {
52
+ return <Button intent="primary">Click me</Button>;
80
53
  }
81
54
  ```
82
55
 
83
- ### Optional: Use design tokens directly
56
+ **That's it!** All responsive breakpoints (sm:, md:, lg:, etc.) work automatically.
57
+
58
+ ---
59
+
60
+ ### Advanced: Use Tailwind Preset (Optional)
61
+
62
+ If you want to customize or extend the design system:
63
+
64
+ **Configure Tailwind:**
84
65
 
85
66
  ```typescript
86
- import { colors, fonts, spacing } from "@krrli/cm-designsystem/tokens";
67
+ import type { Config } from "tailwindcss";
68
+ import designSystemPreset from "@krrli/cm-designsystem/tailwind.preset";
87
69
 
88
- // Use in your own components
89
- const customStyle = {
90
- color: colors.violet[600],
91
- fontFamily: fonts.poppins.join(", "),
92
- };
70
+ export default {
71
+ presets: [designSystemPreset],
72
+ content: ["./src/**/*.{ts,tsx}"],
73
+ } satisfies Config;
93
74
  ```
94
75
 
95
- ### Architecture Benefits
76
+ **Use design tokens:**
77
+
78
+ ```typescript
79
+ import { colors, fonts } from "@krrli/cm-designsystem/tokens";
80
+ ```
96
81
 
97
- - ✅ **SSR-safe**: No runtime CSS-in-JS
98
- - ✅ **All responsive variants work**: Your Tailwind scans the design system
99
- - ✅ **Type-safe tokens**: Import and use tokens directly
100
- - ✅ **Clean separation**: Tokens, config, components, and styles are separate
101
82
  - ✅ **Framework-compatible**: Works with Next.js, Vite, and other tools
102
83
 
103
84
  ````