czero 0.1.0 → 0.2.5

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.
Files changed (95) hide show
  1. package/README.md +209 -169
  2. package/dist/cli/index.js +4678 -28
  3. package/dist/components.css +2158 -336
  4. package/dist/react/core/component-defaults.d.ts +8 -0
  5. package/dist/react/core/component-defaults.d.ts.map +1 -0
  6. package/dist/react/core/types/config.d.ts +649 -0
  7. package/dist/react/core/types/config.d.ts.map +1 -0
  8. package/dist/react/index.cjs +12261 -18
  9. package/dist/react/index.cjs.map +1 -1
  10. package/dist/react/index.d.ts +536 -6
  11. package/dist/react/index.js +12213 -7
  12. package/dist/react/index.js.map +1 -1
  13. package/dist/react/presets/index.d.ts +45 -0
  14. package/dist/react/presets/index.d.ts.map +1 -0
  15. package/dist/react/react/components/accordion.d.ts +30 -0
  16. package/dist/react/react/components/accordion.d.ts.map +1 -0
  17. package/dist/react/react/components/alert.d.ts +7 -0
  18. package/dist/react/react/components/alert.d.ts.map +1 -0
  19. package/dist/react/react/components/aspect-ratio.d.ts +8 -0
  20. package/dist/react/react/components/aspect-ratio.d.ts.map +1 -0
  21. package/dist/react/react/components/avatar.d.ts +10 -0
  22. package/dist/react/react/components/avatar.d.ts.map +1 -0
  23. package/dist/react/react/components/breadcrumb.d.ts +28 -0
  24. package/dist/react/react/components/breadcrumb.d.ts.map +1 -0
  25. package/dist/react/react/components/button.d.ts +4 -2
  26. package/dist/react/react/components/button.d.ts.map +1 -1
  27. package/dist/react/react/components/checkbox.d.ts +9 -0
  28. package/dist/react/react/components/checkbox.d.ts.map +1 -0
  29. package/dist/react/react/components/code.d.ts +6 -0
  30. package/dist/react/react/components/code.d.ts.map +1 -0
  31. package/dist/react/react/components/container.d.ts +8 -0
  32. package/dist/react/react/components/container.d.ts.map +1 -0
  33. package/dist/react/react/components/data-table.d.ts +39 -0
  34. package/dist/react/react/components/data-table.d.ts.map +1 -0
  35. package/dist/react/react/components/dialog.d.ts +28 -0
  36. package/dist/react/react/components/dialog.d.ts.map +1 -0
  37. package/dist/react/react/components/dropdown-menu.d.ts +32 -0
  38. package/dist/react/react/components/dropdown-menu.d.ts.map +1 -0
  39. package/dist/react/react/components/grid.d.ts +8 -0
  40. package/dist/react/react/components/grid.d.ts.map +1 -0
  41. package/dist/react/react/components/input.d.ts +9 -2
  42. package/dist/react/react/components/input.d.ts.map +1 -1
  43. package/dist/react/react/components/kbd.d.ts +6 -0
  44. package/dist/react/react/components/kbd.d.ts.map +1 -0
  45. package/dist/react/react/components/label.d.ts +7 -0
  46. package/dist/react/react/components/label.d.ts.map +1 -0
  47. package/dist/react/react/components/modal.d.ts +44 -0
  48. package/dist/react/react/components/modal.d.ts.map +1 -0
  49. package/dist/react/react/components/progress.d.ts +10 -0
  50. package/dist/react/react/components/progress.d.ts.map +1 -0
  51. package/dist/react/react/components/radio-group.d.ts +15 -0
  52. package/dist/react/react/components/radio-group.d.ts.map +1 -0
  53. package/dist/react/react/components/scroll-area.d.ts +8 -0
  54. package/dist/react/react/components/scroll-area.d.ts.map +1 -0
  55. package/dist/react/react/components/search-input.d.ts +13 -0
  56. package/dist/react/react/components/search-input.d.ts.map +1 -0
  57. package/dist/react/react/components/select.d.ts +29 -0
  58. package/dist/react/react/components/select.d.ts.map +1 -0
  59. package/dist/react/react/components/separator.d.ts +8 -0
  60. package/dist/react/react/components/separator.d.ts.map +1 -0
  61. package/dist/react/react/components/skeleton.d.ts +8 -0
  62. package/dist/react/react/components/skeleton.d.ts.map +1 -0
  63. package/dist/react/react/components/spinner.d.ts +7 -0
  64. package/dist/react/react/components/spinner.d.ts.map +1 -0
  65. package/dist/react/react/components/stack.d.ts +11 -0
  66. package/dist/react/react/components/stack.d.ts.map +1 -0
  67. package/dist/react/react/components/status-badge.d.ts +11 -0
  68. package/dist/react/react/components/status-badge.d.ts.map +1 -0
  69. package/dist/react/react/components/switch.d.ts +10 -0
  70. package/dist/react/react/components/switch.d.ts.map +1 -0
  71. package/dist/react/react/components/table.d.ts +27 -0
  72. package/dist/react/react/components/table.d.ts.map +1 -0
  73. package/dist/react/react/components/tabs.d.ts +56 -0
  74. package/dist/react/react/components/tabs.d.ts.map +1 -0
  75. package/dist/react/react/components/tag.d.ts +10 -0
  76. package/dist/react/react/components/tag.d.ts.map +1 -0
  77. package/dist/react/react/components/textarea.d.ts +11 -0
  78. package/dist/react/react/components/textarea.d.ts.map +1 -0
  79. package/dist/react/react/components/toast.d.ts +28 -0
  80. package/dist/react/react/components/toast.d.ts.map +1 -0
  81. package/dist/react/react/components/tooltip.d.ts +16 -0
  82. package/dist/react/react/components/tooltip.d.ts.map +1 -0
  83. package/dist/react/react/components/visually-hidden.d.ts +7 -0
  84. package/dist/react/react/components/visually-hidden.d.ts.map +1 -0
  85. package/dist/react/react/hooks/index.d.ts +5 -0
  86. package/dist/react/react/hooks/index.d.ts.map +1 -0
  87. package/dist/react/react/hooks/use-theme.d.ts +17 -0
  88. package/dist/react/react/hooks/use-theme.d.ts.map +1 -0
  89. package/dist/react/react/index.d.ts +33 -0
  90. package/dist/react/react/index.d.ts.map +1 -1
  91. package/dist/reset.css +6 -15
  92. package/dist/styles.css +2244 -431
  93. package/package.json +93 -61
  94. package/dist/react/react/lib/cn.d.ts +0 -7
  95. package/dist/react/react/lib/cn.d.ts.map +0 -1
package/README.md CHANGED
@@ -1,169 +1,209 @@
1
- # CZero
2
-
3
- A lightweight, design-token-driven React component library.
4
-
5
- ## Features
6
-
7
- - 🎨 **Design Token Driven** - Single config file controls entire look & feel
8
- - ⚡ **No Runtime Dependencies** - Precompiled CSS, no Tailwind required
9
- - 🌙 **Dark Mode Ready** - Add `.dark` class and all components adapt
10
- - ♿ **Accessible** - Built with accessibility in mind
11
-
12
- ## Quick Start
13
-
14
- ### 1. Install
15
-
16
- ```bash
17
- npm install czero
18
- ```
19
-
20
- ### 2. Create Theme Config
21
-
22
- Create `czero.config.js` in your project root:
23
-
24
- ```js
25
- // czero.config.js
26
- export default {
27
- color: {
28
- primary: { light: "222 47% 45%", dark: "210 80% 65%" },
29
- primaryFg: { light: "0 0% 100%", dark: "220 40% 3%" },
30
- // Override any token...
31
- },
32
- radius: {
33
- md: "0.5rem",
34
- lg: "0.75rem",
35
- },
36
- typography: {
37
- fontFamily: "Inter, system-ui, sans-serif",
38
- },
39
- };
40
- ```
41
-
42
- ### 3. Generate CSS
43
-
44
- ```bash
45
- npx czero build
46
- ```
47
-
48
- This creates `czero.css` with your custom tokens + component styles.
49
-
50
- Options:
51
- - `--config <path>` - Config file path (default: `czero.config.js`)
52
- - `--output <path>` - Output CSS path (default: `czero.css`)
53
-
54
- ### 4. Import & Use
55
-
56
- ```jsx
57
- // Import generated CSS
58
- import "./czero.css";
59
-
60
- // Import components
61
- import { Button, Input, Card, Badge } from "czero/react";
62
-
63
- function App() {
64
- return (
65
- <Card>
66
- <Card.Header>
67
- <Card.Title>Hello CZero</Card.Title>
68
- </Card.Header>
69
- <Card.Body>
70
- <Button variant="primary">Click me</Button>
71
- </Card.Body>
72
- </Card>
73
- );
74
- }
75
- ```
76
-
77
- ## Components
78
-
79
- ### Button
80
-
81
- ```jsx
82
- <Button variant="primary">Primary</Button>
83
- <Button variant="secondary">Secondary</Button>
84
- <Button variant="outline">Outline</Button>
85
- <Button variant="ghost">Ghost</Button>
86
- <Button variant="danger">Danger</Button>
87
-
88
- <Button size="sm">Small</Button>
89
- <Button size="md">Medium</Button>
90
- <Button size="lg">Large</Button>
91
-
92
- <Button loading>Loading...</Button>
93
- <Button disabled>Disabled</Button>
94
- ```
95
-
96
- ### Input
97
-
98
- ```jsx
99
- <Input placeholder="Enter text..." />
100
- <Input label="Email" type="email" />
101
- <Input label="Password" error="Required" />
102
- <Input size="sm" />
103
- <Input size="lg" />
104
- ```
105
-
106
- ### Card
107
-
108
- ```jsx
109
- <Card>
110
- <Card.Header>
111
- <Card.Title>Title</Card.Title>
112
- <Card.Description>Description text</Card.Description>
113
- </Card.Header>
114
- <Card.Body>Content goes here</Card.Body>
115
- <Card.Footer>
116
- <Button variant="ghost">Cancel</Button>
117
- <Button>Save</Button>
118
- </Card.Footer>
119
- </Card>
120
- ```
121
-
122
- ### Badge
123
-
124
- ```jsx
125
- <Badge>Default</Badge>
126
- <Badge variant="primary">Primary</Badge>
127
- <Badge variant="success">Success</Badge>
128
- <Badge variant="danger">Danger</Badge>
129
- <Badge variant="warning">Warning</Badge>
130
- <Badge variant="outline">Outline</Badge>
131
- ```
132
-
133
- ## Dark Mode
134
-
135
- Add the `.dark` class to your root element:
136
-
137
- ```html
138
- <html class="dark">
139
- ...
140
- </html>
141
- ```
142
-
143
- All components automatically adapt to the dark color scheme.
144
-
145
- ## Theming
146
-
147
- All design tokens use the `--cz-*` prefix. Override any token in your CSS:
148
-
149
- ```css
150
- :root {
151
- --cz-color-primary: 280 70% 50%; /* Purple */
152
- --cz-radius-md: 1rem; /* More rounded */
153
- }
154
- ```
155
-
156
- ## Available Tokens
157
-
158
- | Category | Tokens |
159
- |----------|--------|
160
- | Colors | `bg`, `fg`, `primary`, `secondary`, `muted`, `danger`, `success`, `warning`, `border`, `ring` |
161
- | Radius | `none`, `sm`, `md`, `lg`, `xl`, `full` |
162
- | Spacing | `xs`, `sm`, `md`, `lg`, `xl`, `2xl` |
163
- | Typography | `fontFamily`, `size-*`, `weight-*`, `lineHeight-*` |
164
- | Shadow | `none`, `sm`, `md`, `lg` |
165
- | Transition | `fast`, `normal`, `slow` |
166
-
167
- ## License
168
-
169
- MIT
1
+ # CZero
2
+
3
+ A lightweight, design-token-driven React component library.
4
+
5
+ ## Features
6
+
7
+ - 🎨 **Design Token Driven** - Single config file controls entire look & feel
8
+ - ⚡ **No Runtime Dependencies** - Precompiled CSS, no Tailwind required
9
+ - 🌙 **Dark Mode Ready** - Add `.dark` class and all components adapt
10
+ - ♿ **Accessible** - Built with accessibility in mind
11
+
12
+ ## Quick Start
13
+
14
+ ### 1. Install
15
+
16
+ ```bash
17
+ npm install czero
18
+ ```
19
+
20
+ ### 2. Create Theme Config
21
+
22
+ Create `czero.config.js` in your project root:
23
+
24
+ ```js
25
+ // czero.config.js
26
+ export default {
27
+ color: {
28
+ primary: { light: "222 47% 45%", dark: "210 80% 65%" },
29
+ primaryFg: { light: "0 0% 100%", dark: "220 40% 3%" },
30
+ // Override any token...
31
+ },
32
+ radius: {
33
+ md: "0.5rem",
34
+ lg: "0.75rem",
35
+ },
36
+ typography: {
37
+ fontFamily: "Inter, system-ui, sans-serif",
38
+ },
39
+ };
40
+ ```
41
+
42
+ ### 3. Generate CSS
43
+
44
+ ```bash
45
+ npx czero build
46
+ ```
47
+
48
+ This creates `czero.css` with your custom tokens + component styles.
49
+
50
+ Options:
51
+ - `--config <path>` - Config file path (default: `czero.config.js`)
52
+ - `--output <path>` - Output CSS path (default: `czero.css`)
53
+ - `--preset <name>` - Apply a theme preset (can be used multiple times)
54
+
55
+ ## Theme Presets
56
+
57
+ Use pre-built theme configurations for quick customization:
58
+
59
+ ```bash
60
+ # Apply a single preset
61
+ npx czero build --preset compact
62
+
63
+ # Compose multiple presets
64
+ npx czero build --preset compact --preset rounded
65
+ ```
66
+
67
+ **Available Presets:**
68
+
69
+ | Preset | Description |
70
+ |--------|-------------|
71
+ | `compact` | Smaller sizes, tighter spacing |
72
+ | `comfortable` | Larger touch targets, more spacing |
73
+ | `rounded` | Increased border radius everywhere |
74
+ | `sharp` | Minimal border radius, angular look |
75
+ | `minimal` | Subtle shadows, less visual noise |
76
+ | `vibrant` | Bold colors, pronounced effects |
77
+
78
+ ### Programmatic Usage
79
+
80
+ ```js
81
+ // czero.config.js
82
+ import { presets } from "czero/presets";
83
+
84
+ export default {
85
+ ...presets.compact,
86
+ ...presets.rounded,
87
+ // Your overrides
88
+ color: {
89
+ primary: { light: "280 70% 50%", dark: "280 60% 60%" },
90
+ },
91
+ };
92
+ ```
93
+
94
+ ### 4. Import & Use
95
+
96
+ ```jsx
97
+ // Import generated CSS
98
+ import "./czero.css";
99
+
100
+ // Import components
101
+ import { Button, Input, Card, Badge } from "czero/react";
102
+
103
+ function App() {
104
+ return (
105
+ <Card>
106
+ <Card.Header>
107
+ <Card.Title>Hello CZero</Card.Title>
108
+ </Card.Header>
109
+ <Card.Body>
110
+ <Button variant="primary">Click me</Button>
111
+ </Card.Body>
112
+ </Card>
113
+ );
114
+ }
115
+ ```
116
+
117
+ ## Components
118
+
119
+ ### Button
120
+
121
+ ```jsx
122
+ <Button variant="primary">Primary</Button>
123
+ <Button variant="secondary">Secondary</Button>
124
+ <Button variant="outline">Outline</Button>
125
+ <Button variant="ghost">Ghost</Button>
126
+ <Button variant="danger">Danger</Button>
127
+
128
+ <Button size="sm">Small</Button>
129
+ <Button size="md">Medium</Button>
130
+ <Button size="lg">Large</Button>
131
+
132
+ <Button loading>Loading...</Button>
133
+ <Button disabled>Disabled</Button>
134
+ ```
135
+
136
+ ### Input
137
+
138
+ ```jsx
139
+ <Input placeholder="Enter text..." />
140
+ <Input label="Email" type="email" />
141
+ <Input label="Password" error="Required" />
142
+ <Input size="sm" />
143
+ <Input size="lg" />
144
+ ```
145
+
146
+ ### Card
147
+
148
+ ```jsx
149
+ <Card>
150
+ <Card.Header>
151
+ <Card.Title>Title</Card.Title>
152
+ <Card.Description>Description text</Card.Description>
153
+ </Card.Header>
154
+ <Card.Body>Content goes here</Card.Body>
155
+ <Card.Footer>
156
+ <Button variant="ghost">Cancel</Button>
157
+ <Button>Save</Button>
158
+ </Card.Footer>
159
+ </Card>
160
+ ```
161
+
162
+ ### Badge
163
+
164
+ ```jsx
165
+ <Badge>Default</Badge>
166
+ <Badge variant="primary">Primary</Badge>
167
+ <Badge variant="success">Success</Badge>
168
+ <Badge variant="danger">Danger</Badge>
169
+ <Badge variant="warning">Warning</Badge>
170
+ <Badge variant="outline">Outline</Badge>
171
+ ```
172
+
173
+ ## Dark Mode
174
+
175
+ Add the `.dark` class to your root element:
176
+
177
+ ```html
178
+ <html class="dark">
179
+ ...
180
+ </html>
181
+ ```
182
+
183
+ All components automatically adapt to the dark color scheme.
184
+
185
+ ## Theming
186
+
187
+ All design tokens use the `--cz-*` prefix. Override any token in your CSS:
188
+
189
+ ```css
190
+ :root {
191
+ --cz-color-primary: 280 70% 50%; /* Purple */
192
+ --cz-radius-md: 1rem; /* More rounded */
193
+ }
194
+ ```
195
+
196
+ ## Available Tokens
197
+
198
+ | Category | Tokens |
199
+ |----------|--------|
200
+ | Colors | `bg`, `fg`, `primary`, `secondary`, `muted`, `danger`, `success`, `warning`, `border`, `ring` |
201
+ | Radius | `none`, `sm`, `md`, `lg`, `xl`, `full` |
202
+ | Spacing | `xs`, `sm`, `md`, `lg`, `xl`, `2xl` |
203
+ | Typography | `fontFamily`, `size-*`, `weight-*`, `lineHeight-*` |
204
+ | Shadow | `none`, `sm`, `md`, `lg` |
205
+ | Transition | `fast`, `normal`, `slow` |
206
+
207
+ ## License
208
+
209
+ MIT