@krrli/cm-designsystem 1.34.9 → 1.34.10

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,32 +20,58 @@ 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:
23
+ To use the components and styles in your project with Tailwind CSS v4:
24
24
 
25
- 1. Install the package:
25
+ ### 1. Install the package
26
26
 
27
27
  ```bash
28
- npm i @krrli/cm-designsystem
28
+ npm install @krrli/cm-designsystem
29
29
  ```
30
30
 
31
- 2. Import the bundled CSS in your app entry (e.g., `main.tsx` or `App.tsx`):
31
+ ### 2. Configure Tailwind CSS in your consuming app
32
32
 
33
- ```js
34
- import "cm-designsystem/dist/cm-designsystem.css";
33
+ In your app's CSS file (e.g., `app/globals.css` or `src/index.css`), add:
34
+
35
+ ```css
36
+ @import "tailwindcss";
37
+
38
+ /* Import the design system's Tailwind configuration and theme */
39
+ @import "@krrli/cm-designsystem/src/index.css";
40
+
41
+ /* Scan the design system's components for Tailwind classes */
42
+ @source "../node_modules/@krrli/cm-designsystem/dist/**/*.js";
43
+
44
+ /* Your app's custom theme/styles can go here */
35
45
  ```
36
46
 
37
- 3. Import and use components as needed:
47
+ ### 3. Install required peer dependencies
48
+
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
+ ```
38
52
 
39
- ```js
40
- import { Button } from "cm-designsystem";
53
+ ### 4. Import and use components
54
+
55
+ ```tsx
56
+ import { Button } from "@krrli/cm-designsystem";
41
57
 
42
58
  function App() {
43
59
  return (
44
- <Button label="Click me" intent="primary" size="md" onClick={() => {}} />
60
+ <Button intent="primary" size="md" onClick={() => console.log("Clicked!")}>
61
+ Click me
62
+ </Button>
45
63
  );
46
64
  }
47
65
  ```
48
66
 
67
+ ### Notes
68
+
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.
72
+
73
+ ````
74
+
49
75
  ---
50
76
 
51
77
  ## Technical Stack
@@ -71,7 +97,7 @@ npm install
71
97
 
72
98
  # Start Storybook development server
73
99
  npm run storybook
74
- ```
100
+ ````
75
101
 
76
102
  Storybook will be available at [http://localhost:6006](http://localhost:6006)
77
103
 
@@ -1,6 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { AccessibleIcon } from "@radix-ui/react-accessible-icon";
3
- import { cn, tv } from "tailwind-variants";
3
+ import { tv, cn } from "tailwind-variants";
4
4
  const iconStyles = tv({
5
5
  base: ["w-4", "h-4"]
6
6
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AAErB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,3 @@
1
- /* empty css */
2
1
  import { Avatar } from "./components/avatar/Avatar.js";
3
2
  import { BrandingGallery } from "./components/branding/BrandingGallery.js";
4
3
  import { Button } from "./components/button/Button.js";
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@krrli/cm-designsystem",
3
3
  "repository": "https://github.com/ost-cas-fea-25-26/cm-designsystem",
4
- "version": "1.34.9",
4
+ "version": "1.34.10",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "files": [
10
- "dist"
10
+ "dist",
11
+ "src/index.css"
11
12
  ],
12
13
  "sideEffects": false,
13
14
  "publishConfig": {
@@ -32,6 +33,7 @@
32
33
  "e2e:update": "npm run build-storybook & docker run --rm -i -e TEST_BASE_URL=http://localhost:6006 -e CI=true -v ./playwright-report:/app/playwright-report -v ./test-results:/app/test-results -v ./storybook-static:/app/storybook-static -v ./tests:/app/tests -v ./playwright.config.ts:/app/playwright.config.ts cm-designsystem-visual-testing sh -c \"npx http-server /app/storybook-static -p 6006 & npx playwright test --update-snapshots\""
33
34
  },
34
35
  "dependencies": {
36
+ "@fontsource/poppins": "^5.2.7",
35
37
  "tailwind-variants": "3.2.2"
36
38
  },
37
39
  "peerDependencies": {
@@ -49,10 +51,10 @@
49
51
  "@chromatic-com/storybook": "4.1.3",
50
52
  "@eslint/js": "9.39.2",
51
53
  "@playwright/test": "1.57.0",
52
- "@storybook/addon-a11y": "10.1.10",
53
- "@storybook/addon-docs": "10.1.10",
54
- "@storybook/addon-vitest": "10.1.10",
55
- "@storybook/react-vite": "10.1.10",
54
+ "@storybook/addon-a11y": "10.1.11",
55
+ "@storybook/addon-docs": "10.1.11",
56
+ "@storybook/addon-vitest": "10.1.11",
57
+ "@storybook/react-vite": "10.1.11",
56
58
  "@tailwindcss/vite": "4.1.18",
57
59
  "@testing-library/dom": "10.4.1",
58
60
  "@testing-library/jest-dom": "6.9.1",
@@ -73,7 +75,7 @@
73
75
  "eslint-plugin-react": "7.37.5",
74
76
  "eslint-plugin-react-hooks": "7.0.1",
75
77
  "eslint-plugin-react-refresh": "0.4.26",
76
- "eslint-plugin-storybook": "10.1.10",
78
+ "eslint-plugin-storybook": "10.1.11",
77
79
  "eslint-plugin-unused-imports": "4.3.0",
78
80
  "globals": "16.5.0",
79
81
  "jsdom": "27.4.0",
@@ -83,11 +85,11 @@
83
85
  "prettier-plugin-tailwindcss": "0.7.2",
84
86
  "rollup-preserve-directives": "1.1.3",
85
87
  "semantic-release": "25.0.2",
86
- "storybook": "10.1.10",
88
+ "storybook": "10.1.11",
87
89
  "tailwind-merge": "3.4.0",
88
90
  "tailwindcss": "4.1.18",
89
91
  "typescript": "5.9.3",
90
- "typescript-eslint": "8.50.1",
92
+ "typescript-eslint": "8.51.0",
91
93
  "vite": "7.3.0",
92
94
  "vite-plugin-dts": "4.5.4",
93
95
  "vite-plugin-svgr": "^4.5.0",
package/src/index.css ADDED
@@ -0,0 +1,88 @@
1
+ @import "tailwindcss";
2
+ @source "../src/**/*.{ts,tsx,js,jsx}";
3
+
4
+ /* Import Poppins font */
5
+ @import "@fontsource/poppins/400.css";
6
+ @import "@fontsource/poppins/500.css";
7
+ @import "@fontsource/poppins/600.css";
8
+ @import "@fontsource/poppins/700.css";
9
+
10
+ @theme {
11
+ /* -----------------------------------------
12
+ Color
13
+ ----------------------------------------- */
14
+ --color-*: initial;
15
+
16
+ /* Base */
17
+ --color-black: oklch(0 0 0);
18
+ --color-white: oklch(1 0 0);
19
+ --color-error: oklch(57.7% 0.245 27.325);
20
+
21
+ /* Slate */
22
+ --color-slate-50: oklch(0.984 0.003 247.858);
23
+ --color-slate-100: oklch(0.968 0.007 247.896);
24
+ --color-slate-200: oklch(0.929 0.013 255.508);
25
+ --color-slate-300: oklch(0.869 0.022 252.894);
26
+ --color-slate-400: oklch(0.704 0.04 256.788);
27
+ --color-slate-500: oklch(0.554 0.046 257.417);
28
+ --color-slate-600: oklch(0.446 0.043 257.281);
29
+ --color-slate-700: oklch(0.372 0.044 257.287);
30
+ --color-slate-800: oklch(0.279 0.041 260.031);
31
+ --color-slate-900: oklch(0.208 0.042 265.755);
32
+ --color-slate-950: oklch(0.129 0.042 264.695);
33
+
34
+ /* Pink */
35
+ --color-pink-50: oklch(0.971 0.014 343.198);
36
+ --color-pink-100: oklch(0.948 0.028 342.258);
37
+ --color-pink-200: oklch(0.899 0.061 343.231);
38
+ --color-pink-300: oklch(0.823 0.12 346.018);
39
+ --color-pink-400: oklch(0.718 0.202 349.761);
40
+ --color-pink-500: oklch(0.656 0.241 354.308);
41
+ --color-pink-600: oklch(0.592 0.249 0.584);
42
+ --color-pink-700: oklch(0.525 0.223 3.958);
43
+ --color-pink-800: oklch(0.459 0.187 3.815);
44
+ --color-pink-900: oklch(0.408 0.153 2.432);
45
+ --color-pink-950: oklch(0.284 0.109 3.907);
46
+
47
+ /* Violet */
48
+ --color-violet-50: oklch(0.969 0.016 293.756);
49
+ --color-violet-100: oklch(0.943 0.029 294.588);
50
+ --color-violet-200: oklch(0.894 0.057 293.283);
51
+ --color-violet-300: oklch(0.811 0.111 293.571);
52
+ --color-violet-400: oklch(0.702 0.183 293.541);
53
+ --color-violet-500: oklch(0.606 0.25 292.717);
54
+ --color-violet-600: oklch(0.541 0.281 293.009);
55
+ --color-violet-700: oklch(0.491 0.27 292.581);
56
+ --color-violet-800: oklch(0.432 0.232 292.759);
57
+ --color-violet-900: oklch(0.38 0.189 293.745);
58
+ --color-violet-950: oklch(0.283 0.141 291.089);
59
+
60
+ /* -----------------------------------------
61
+ Spacing
62
+ ----------------------------------------- */
63
+ --spacing-*: initial;
64
+ --spacing: 4px;
65
+
66
+ /* -----------------------------------------
67
+ Typography
68
+ ----------------------------------------- */
69
+ /* Font family */
70
+ --font-*: initial;
71
+ --font-poppins: Poppins, sans-serif;
72
+
73
+ /* Font weight */
74
+ --font-weight-*: initial;
75
+ --font-weight-medium: 500;
76
+ --font-weight-semibold: 600;
77
+ --font-weight-bold: 700;
78
+
79
+ /* Text */
80
+ --text-*: initial;
81
+ }
82
+
83
+ @layer base {
84
+ html {
85
+ font-family: var(--font-poppins);
86
+ color: var(--color-slate-600);
87
+ }
88
+ }