@nitramburesh/wcds 0.3.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 ADDED
@@ -0,0 +1,110 @@
1
+ # WCDS - Web Component Design System
2
+
3
+ A design system built with Lit web components.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install wcds
9
+ # or
10
+ pnpm add wcds
11
+ ```
12
+
13
+ ## Setup
14
+
15
+ ### 1. Import the library
16
+
17
+ ```js
18
+ import 'wcds';
19
+ import 'wcds/style';
20
+ ```
21
+
22
+ ### 2. Add the Plus Jakarta Sans font (recommended)
23
+
24
+ WCDS is designed to work with the [Plus Jakarta Sans](https://fonts.google.com/specimen/Plus+Jakarta+Sans) font family. Add it to your project:
25
+
26
+ **Option A: Google Fonts (easiest)**
27
+
28
+ ```html
29
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
30
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
31
+ <link
32
+ href="https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap"
33
+ rel="stylesheet"
34
+ />
35
+ ```
36
+
37
+ **Option B: Self-hosted via Fontsource**
38
+
39
+ ```bash
40
+ npm install @fontsource-variable/plus-jakarta-sans
41
+ ```
42
+
43
+ ```js
44
+ import '@fontsource-variable/plus-jakarta-sans';
45
+ ```
46
+
47
+ > **Note:** If Plus Jakarta Sans is not loaded, WCDS will gracefully fall back to system fonts (`system-ui`, `-apple-system`, etc.).
48
+
49
+ ## Usage
50
+
51
+ ```html
52
+ <wcds-button variant="primary">Click me</wcds-button>
53
+ <wcds-input placeholder="Enter text..."></wcds-input>
54
+ <wcds-badge variant="success">Active</wcds-badge>
55
+ ```
56
+
57
+ ## Development
58
+
59
+ ### Commands
60
+
61
+ #### `pnpm prepare`
62
+
63
+ - Generates design tokens for component library
64
+ - Run this command after every change to design tokens under `src/tokens/`
65
+
66
+ #### `pnpm dev`
67
+
68
+ - Starts Storybook development server
69
+
70
+ #### `pnpm build`
71
+
72
+ - Builds the library for production
73
+
74
+ #### `pnpm test`
75
+
76
+ - Runs all Vitest projects
77
+
78
+ #### `pnpm test:browser`
79
+
80
+ - Runs component behavior tests in a real Chromium browser (Playwright provider)
81
+
82
+ #### `pnpm test:storybook`
83
+
84
+ - Runs Storybook-backed tests (stories + addon-vitest)
85
+
86
+ ## Testing strategy
87
+
88
+ WCDS already uses Chromatic + Storybook for visual regression. Add these layers:
89
+
90
+ 1. **Component behavior tests (Vitest browser mode)**
91
+
92
+ - Validate properties/attributes behavior
93
+ - Validate emitted events (`click`, `input`, `change`)
94
+ - Validate disabled and edge states
95
+
96
+ 2. **Storybook tests (addon-vitest)**
97
+
98
+ - Validate stories render and interactive story scenarios
99
+ - Complements Chromatic by asserting behavior, not only visuals
100
+
101
+ 3. **(Optional) Playwright e2e**
102
+ - Add later when you have an app/sandbox page with multiple components wired together
103
+
104
+ ### First-time Playwright setup
105
+
106
+ If browser tests fail with missing executable, install Playwright browsers once:
107
+
108
+ ```bash
109
+ pnpm test:install-browsers
110
+ ```