czero 0.2.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 (62) hide show
  1. package/README.md +209 -209
  2. package/dist/cli/index.js +970 -72
  3. package/dist/components.css +2158 -1913
  4. package/dist/react/core/component-defaults.d.ts.map +1 -1
  5. package/dist/react/core/types/config.d.ts +161 -2
  6. package/dist/react/core/types/config.d.ts.map +1 -1
  7. package/dist/react/index.cjs +695 -12
  8. package/dist/react/index.cjs.map +1 -1
  9. package/dist/react/index.d.ts +138 -11
  10. package/dist/react/index.js +693 -13
  11. package/dist/react/index.js.map +1 -1
  12. package/dist/react/react/components/button.d.ts +1 -0
  13. package/dist/react/react/components/button.d.ts.map +1 -1
  14. package/dist/react/react/components/data-table.d.ts +39 -0
  15. package/dist/react/react/components/data-table.d.ts.map +1 -0
  16. package/dist/react/react/components/input.d.ts +5 -2
  17. package/dist/react/react/components/input.d.ts.map +1 -1
  18. package/dist/react/react/components/modal.d.ts +44 -0
  19. package/dist/react/react/components/modal.d.ts.map +1 -0
  20. package/dist/react/react/components/search-input.d.ts +13 -0
  21. package/dist/react/react/components/search-input.d.ts.map +1 -0
  22. package/dist/react/react/components/status-badge.d.ts +11 -0
  23. package/dist/react/react/components/status-badge.d.ts.map +1 -0
  24. package/dist/react/react/components/tabs.d.ts +42 -7
  25. package/dist/react/react/components/tabs.d.ts.map +1 -1
  26. package/dist/react/react/index.d.ts +4 -1
  27. package/dist/react/react/index.d.ts.map +1 -1
  28. package/dist/reset.css +6 -15
  29. package/dist/styles.css +2244 -2008
  30. package/package.json +93 -92
  31. package/dist/cli-new/cli/build-css.d.ts +0 -19
  32. package/dist/cli-new/cli/build-css.js +0 -88
  33. package/dist/cli-new/cli/generators/button.d.ts +0 -9
  34. package/dist/cli-new/cli/generators/button.js +0 -224
  35. package/dist/cli-new/cli/generators/card.d.ts +0 -9
  36. package/dist/cli-new/cli/generators/card.js +0 -104
  37. package/dist/cli-new/cli/generators/checkbox.d.ts +0 -6
  38. package/dist/cli-new/cli/generators/checkbox.js +0 -163
  39. package/dist/cli-new/cli/generators/index.d.ts +0 -10
  40. package/dist/cli-new/cli/generators/index.js +0 -40
  41. package/dist/cli-new/cli/generators/input.d.ts +0 -9
  42. package/dist/cli-new/cli/generators/input.js +0 -231
  43. package/dist/cli-new/cli/generators/switch.d.ts +0 -6
  44. package/dist/cli-new/cli/generators/switch.js +0 -156
  45. package/dist/cli-new/cli/generators/utilities.d.ts +0 -9
  46. package/dist/cli-new/cli/generators/utilities.js +0 -150
  47. package/dist/cli-new/cli/index.d.ts +0 -8
  48. package/dist/cli-new/cli/index.js +0 -288
  49. package/dist/cli-new/cli/token-resolver.d.ts +0 -44
  50. package/dist/cli-new/cli/token-resolver.js +0 -137
  51. package/dist/cli-new/cli/utils/deep-merge.d.ts +0 -15
  52. package/dist/cli-new/cli/utils/deep-merge.js +0 -41
  53. package/dist/cli-new/cli/validate-config.d.ts +0 -19
  54. package/dist/cli-new/cli/validate-config.js +0 -151
  55. package/dist/cli-new/src/core/component-defaults.d.ts +0 -7
  56. package/dist/cli-new/src/core/component-defaults.js +0 -467
  57. package/dist/cli-new/src/core/types/config.d.ts +0 -489
  58. package/dist/cli-new/src/core/types/config.js +0 -5
  59. package/dist/cli-new/src/presets/index.d.ts +0 -44
  60. package/dist/cli-new/src/presets/index.js +0 -194
  61. package/dist/react/react/lib/cn.d.ts +0 -7
  62. package/dist/react/react/lib/cn.d.ts.map +0 -1
package/package.json CHANGED
@@ -1,92 +1,93 @@
1
- {
2
- "name": "czero",
3
- "version": "0.2.0",
4
- "type": "module",
5
- "description": "A lightweight, design-token-driven React component library with Radix UI primitives",
6
- "main": "./dist/react/index.cjs",
7
- "module": "./dist/react/index.js",
8
- "types": "./dist/react/index.d.ts",
9
- "bin": {
10
- "czero": "./dist/cli/index.js"
11
- },
12
- "exports": {
13
- "./styles.css": "./dist/styles.css",
14
- "./components.css": "./dist/components.css",
15
- "./reset.css": "./dist/reset.css",
16
- "./react": {
17
- "types": "./dist/react/index.d.ts",
18
- "import": "./dist/react/index.js",
19
- "require": "./dist/react/index.cjs"
20
- },
21
- "./presets": {
22
- "types": "./dist/presets/index.d.ts",
23
- "import": "./dist/presets/index.js"
24
- },
25
- "./config": {
26
- "types": "./dist/core/types/config.d.ts"
27
- }
28
- },
29
- "files": [
30
- "dist"
31
- ],
32
- "scripts": {
33
- "build:tokens": "tsx src/core/build-tokens.ts",
34
- "build:css": "pwsh -Command \"Copy-Item src/core/styles/reset.css dist/reset.css; Copy-Item src/core/styles/components.css dist/components.css; Get-Content src/core/styles/reset.css, src/core/styles/tokens.css, src/core/styles/components.css | Set-Content dist/styles.css\"",
35
- "build:components": "rollup -c",
36
- "build:cli": "npx esbuild cli/index.ts --bundle --platform=node --format=esm --outdir=dist/cli --packages=external",
37
- "build": "npm run build:tokens && npm run build:css && npm run build:components && npm run build:cli",
38
- "dev": "rollup -c -w",
39
- "typecheck": "tsc --noEmit"
40
- },
41
- "peerDependencies": {
42
- "react": ">=18.0.0",
43
- "react-dom": ">=18.0.0"
44
- },
45
- "dependencies": {
46
- "@radix-ui/react-accordion": "^1.2.0",
47
- "@radix-ui/react-alert-dialog": "^1.1.0",
48
- "@radix-ui/react-aspect-ratio": "^1.1.0",
49
- "@radix-ui/react-avatar": "^1.1.0",
50
- "@radix-ui/react-checkbox": "^1.1.0",
51
- "@radix-ui/react-collapsible": "^1.1.0",
52
- "@radix-ui/react-dialog": "^1.1.0",
53
- "@radix-ui/react-dropdown-menu": "^2.1.0",
54
- "@radix-ui/react-label": "^2.1.0",
55
- "@radix-ui/react-popover": "^1.1.0",
56
- "@radix-ui/react-progress": "^1.1.0",
57
- "@radix-ui/react-radio-group": "^1.2.0",
58
- "@radix-ui/react-scroll-area": "^1.2.0",
59
- "@radix-ui/react-select": "^2.1.0",
60
- "@radix-ui/react-separator": "^1.1.0",
61
- "@radix-ui/react-slider": "^1.2.0",
62
- "@radix-ui/react-slot": "^1.2.4",
63
- "@radix-ui/react-switch": "^1.1.0",
64
- "@radix-ui/react-tabs": "^1.1.0",
65
- "@radix-ui/react-toast": "^1.2.0",
66
- "@radix-ui/react-tooltip": "^1.1.0",
67
- "@radix-ui/react-visually-hidden": "^1.1.0"
68
- },
69
- "devDependencies": {
70
- "@rollup/plugin-commonjs": "^25.0.7",
71
- "@rollup/plugin-node-resolve": "^15.2.3",
72
- "@rollup/plugin-typescript": "^11.1.6",
73
- "@types/node": "^25.0.3",
74
- "@types/react": "^18.2.48",
75
- "@types/react-dom": "^18.2.18",
76
- "esbuild": "^0.24.2",
77
- "rollup": "^4.9.6",
78
- "rollup-plugin-dts": "^6.1.0",
79
- "tslib": "^2.6.2",
80
- "tsx": "^4.7.0",
81
- "typescript": "^5.3.3"
82
- },
83
- "keywords": [
84
- "react",
85
- "components",
86
- "ui",
87
- "design-system",
88
- "design-tokens",
89
- "cli"
90
- ],
91
- "license": "MIT"
92
- }
1
+ {
2
+ "name": "czero",
3
+ "version": "0.2.5",
4
+ "type": "module",
5
+ "description": "A lightweight, design-token-driven React component library with Radix UI primitives",
6
+ "main": "./dist/react/index.cjs",
7
+ "module": "./dist/react/index.js",
8
+ "types": "./dist/react/index.d.ts",
9
+ "bin": {
10
+ "czero": "./dist/cli/index.js",
11
+ "czero20": "./dist/cli/index.js"
12
+ },
13
+ "exports": {
14
+ "./styles.css": "./dist/styles.css",
15
+ "./components.css": "./dist/components.css",
16
+ "./reset.css": "./dist/reset.css",
17
+ "./react": {
18
+ "types": "./dist/react/index.d.ts",
19
+ "import": "./dist/react/index.js",
20
+ "require": "./dist/react/index.cjs"
21
+ },
22
+ "./presets": {
23
+ "types": "./dist/presets/index.d.ts",
24
+ "import": "./dist/presets/index.js"
25
+ },
26
+ "./config": {
27
+ "types": "./dist/core/types/config.d.ts"
28
+ }
29
+ },
30
+ "files": [
31
+ "dist"
32
+ ],
33
+ "scripts": {
34
+ "build:tokens": "tsx src/core/build-tokens.ts",
35
+ "build:css": "mkdir -p dist && cp src/core/styles/reset.css dist/reset.css && cp src/core/styles/components.css dist/components.css && cat src/core/styles/reset.css src/core/styles/tokens.css src/core/styles/components.css > dist/styles.css",
36
+ "build:components": "rollup -c",
37
+ "build:cli": "npx esbuild cli/index.ts --bundle --platform=node --format=esm --outdir=dist/cli --packages=external",
38
+ "build": "npm run build:tokens && npm run build:css && npm run build:components && npm run build:cli",
39
+ "dev": "rollup -c -w",
40
+ "typecheck": "tsc --noEmit"
41
+ },
42
+ "peerDependencies": {
43
+ "react": ">=18.0.0",
44
+ "react-dom": ">=18.0.0"
45
+ },
46
+ "dependencies": {
47
+ "@radix-ui/react-accordion": "^1.2.0",
48
+ "@radix-ui/react-alert-dialog": "^1.1.0",
49
+ "@radix-ui/react-aspect-ratio": "^1.1.0",
50
+ "@radix-ui/react-avatar": "^1.1.0",
51
+ "@radix-ui/react-checkbox": "^1.1.0",
52
+ "@radix-ui/react-collapsible": "^1.1.0",
53
+ "@radix-ui/react-dialog": "^1.1.0",
54
+ "@radix-ui/react-dropdown-menu": "^2.1.0",
55
+ "@radix-ui/react-label": "^2.1.0",
56
+ "@radix-ui/react-popover": "^1.1.0",
57
+ "@radix-ui/react-progress": "^1.1.0",
58
+ "@radix-ui/react-radio-group": "^1.2.0",
59
+ "@radix-ui/react-scroll-area": "^1.2.0",
60
+ "@radix-ui/react-select": "^2.1.0",
61
+ "@radix-ui/react-separator": "^1.1.0",
62
+ "@radix-ui/react-slider": "^1.2.0",
63
+ "@radix-ui/react-slot": "^1.2.4",
64
+ "@radix-ui/react-switch": "^1.1.0",
65
+ "@radix-ui/react-tabs": "^1.1.0",
66
+ "@radix-ui/react-toast": "^1.2.0",
67
+ "@radix-ui/react-tooltip": "^1.1.0",
68
+ "@radix-ui/react-visually-hidden": "^1.1.0"
69
+ },
70
+ "devDependencies": {
71
+ "@rollup/plugin-commonjs": "^25.0.7",
72
+ "@rollup/plugin-node-resolve": "^15.2.3",
73
+ "@rollup/plugin-typescript": "^11.1.6",
74
+ "@types/node": "^25.0.3",
75
+ "@types/react": "^18.2.48",
76
+ "@types/react-dom": "^18.2.18",
77
+ "esbuild": "^0.24.2",
78
+ "rollup": "^4.9.6",
79
+ "rollup-plugin-dts": "^6.1.0",
80
+ "tslib": "^2.6.2",
81
+ "tsx": "^4.7.0",
82
+ "typescript": "^5.3.3"
83
+ },
84
+ "keywords": [
85
+ "react",
86
+ "components",
87
+ "ui",
88
+ "design-system",
89
+ "design-tokens",
90
+ "cli"
91
+ ],
92
+ "license": "MIT"
93
+ }
@@ -1,19 +0,0 @@
1
- /**
2
- * CZero CSS Builder
3
- * Builds complete CSS from config using component generators
4
- */
5
- import type { CZeroConfig } from "../src/core/types/config";
6
- /**
7
- * Build complete component CSS from config
8
- * Merges user config with defaults and generates CSS for each component
9
- */
10
- export declare function buildComponentsCSS(config: CZeroConfig): string;
11
- /**
12
- * Get legacy components CSS from file
13
- * Used for components that haven't been migrated to the new generator system
14
- */
15
- export declare function getLegacyComponentsCSS(componentsPath: string, excludeComponents?: string[]): string;
16
- /**
17
- * Validate config structure
18
- */
19
- export declare function validateConfig(config: unknown): CZeroConfig;
@@ -1,88 +0,0 @@
1
- /**
2
- * CZero CSS Builder
3
- * Builds complete CSS from config using component generators
4
- */
5
- import { componentDefaults } from "../src/core/component-defaults";
6
- import { deepMerge } from "./utils/deep-merge";
7
- import { generateButtonCSS, generateInputCSS, generateCardCSS, generateSwitchCSS, generateCheckboxCSS, } from "./generators";
8
- /**
9
- * Build complete component CSS from config
10
- * Merges user config with defaults and generates CSS for each component
11
- */
12
- export function buildComponentsCSS(config) {
13
- // Merge user component config with defaults
14
- const components = deepMerge(componentDefaults, config.components || {});
15
- let css = "";
16
- // Add before custom CSS
17
- if (config.customCSS?.before) {
18
- css += `/* Custom CSS (before) */\n${config.customCSS.before}\n\n`;
19
- }
20
- // Generate CSS for each component
21
- // Only generating for the 5 implemented components for now
22
- if (components.button) {
23
- css += generateButtonCSS(components.button);
24
- css += "\n";
25
- }
26
- if (components.input) {
27
- css += generateInputCSS(components.input);
28
- css += "\n";
29
- }
30
- if (components.card) {
31
- css += generateCardCSS(components.card);
32
- css += "\n";
33
- }
34
- if (components.switch) {
35
- css += generateSwitchCSS(components.switch);
36
- css += "\n";
37
- }
38
- if (components.checkbox) {
39
- css += generateCheckboxCSS(components.checkbox);
40
- css += "\n";
41
- }
42
- // Add after custom CSS
43
- if (config.customCSS?.after) {
44
- css += `/* Custom CSS (after) */\n${config.customCSS.after}\n`;
45
- }
46
- return css;
47
- }
48
- /**
49
- * Get legacy components CSS from file
50
- * Used for components that haven't been migrated to the new generator system
51
- */
52
- export function getLegacyComponentsCSS(componentsPath, excludeComponents = ["button", "input", "card", "switch", "checkbox"]) {
53
- // For now, we read the entire file
54
- // In the future, we could parse and exclude specific sections
55
- // This is a migration helper
56
- const fs = require("fs");
57
- if (!fs.existsSync(componentsPath)) {
58
- return "";
59
- }
60
- let css = fs.readFileSync(componentsPath, "utf-8");
61
- // Remove sections for components that are now generated
62
- // This is a simple approach - in production you'd want more robust parsing
63
- for (const component of excludeComponents) {
64
- // Remove the component section from the CSS
65
- // Looking for patterns like /* ===== BUTTON ===== */ to the next /* ===== */ or end
66
- const sectionRegex = new RegExp(`\\/\\*\\s*=====\\s*${component.toUpperCase()}\\s*=====\\s*\\*\\/[\\s\\S]*?(?=\\/\\*\\s*=====|$)`, "gi");
67
- css = css.replace(sectionRegex, "");
68
- }
69
- return css;
70
- }
71
- /**
72
- * Validate config structure
73
- */
74
- export function validateConfig(config) {
75
- if (typeof config !== "object" || config === null) {
76
- return {};
77
- }
78
- // Basic validation - in production you'd want more robust checking
79
- const validConfig = config;
80
- // Warn about unknown top-level keys
81
- const validKeys = ["color", "radius", "shadow", "spacing", "typography", "transition", "breakpoints", "components", "customCSS"];
82
- for (const key of Object.keys(validConfig)) {
83
- if (!validKeys.includes(key)) {
84
- console.warn(`⚠️ Unknown config key: "${key}"`);
85
- }
86
- }
87
- return validConfig;
88
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * CZero Button CSS Generator
3
- * Generates CSS for button component from config tokens
4
- */
5
- import type { ButtonTokens } from "../../src/core/types/config";
6
- /**
7
- * Generate all button CSS including variables, base styles, sizes, variants, and states
8
- */
9
- export declare function generateButtonCSS(config: ButtonTokens): string;
@@ -1,224 +0,0 @@
1
- /**
2
- * CZero Button CSS Generator
3
- * Generates CSS for button component from config tokens
4
- */
5
- import { resolveToken, componentVarName } from "../token-resolver";
6
- /**
7
- * Generate all button CSS including variables, base styles, sizes, variants, and states
8
- */
9
- export function generateButtonCSS(config) {
10
- let css = "";
11
- css += "/* ===== BUTTON ===== */\n\n";
12
- // Generate CSS variables
13
- css += generateButtonVariables(config);
14
- css += "\n";
15
- // Generate base styles
16
- css += generateButtonBase();
17
- css += "\n";
18
- // Generate size variants
19
- css += generateButtonSizes(config);
20
- css += "\n";
21
- // Generate color variants
22
- if (config.variants) {
23
- css += generateButtonVariants(config.variants);
24
- css += "\n";
25
- }
26
- // Generate icon button styles
27
- css += generateButtonIcon(config);
28
- css += "\n";
29
- // Generate loading state styles
30
- css += generateButtonLoading(config);
31
- css += "\n";
32
- // Append custom CSS
33
- if (config.customCSS) {
34
- css += `/* Custom Button CSS */\n${config.customCSS}\n`;
35
- }
36
- return css;
37
- }
38
- /**
39
- * Generate CSS variables for button component
40
- */
41
- function generateButtonVariables(config) {
42
- const vars = [];
43
- // Size-based variables
44
- if (config.height) {
45
- for (const [size, value] of Object.entries(config.height)) {
46
- vars.push(` ${componentVarName("button", "height", size)}: ${resolveToken(value)};`);
47
- }
48
- }
49
- if (config.paddingX) {
50
- for (const [size, value] of Object.entries(config.paddingX)) {
51
- vars.push(` ${componentVarName("button", "paddingX", size)}: ${resolveToken(value)};`);
52
- }
53
- }
54
- if (config.fontSize && typeof config.fontSize === "object") {
55
- for (const [size, value] of Object.entries(config.fontSize)) {
56
- vars.push(` ${componentVarName("button", "fontSize", size)}: ${resolveToken(value)};`);
57
- }
58
- }
59
- if (config.iconSize) {
60
- for (const [size, value] of Object.entries(config.iconSize)) {
61
- vars.push(` ${componentVarName("button", "iconSize", size)}: ${resolveToken(value)};`);
62
- }
63
- }
64
- // Single-value variables
65
- if (config.gap) {
66
- vars.push(` ${componentVarName("button", "gap")}: ${resolveToken(config.gap)};`);
67
- }
68
- if (config.fontWeight) {
69
- vars.push(` ${componentVarName("button", "fontWeight")}: ${resolveToken(config.fontWeight)};`);
70
- }
71
- if (config.borderRadius) {
72
- vars.push(` ${componentVarName("button", "borderRadius")}: ${resolveToken(config.borderRadius)};`);
73
- }
74
- if (config.borderWidth) {
75
- vars.push(` ${componentVarName("button", "borderWidth")}: ${resolveToken(config.borderWidth)};`);
76
- }
77
- if (config.transition) {
78
- vars.push(` ${componentVarName("button", "transition")}: ${resolveToken(config.transition)};`);
79
- }
80
- // State variables
81
- if (config.states?.hover?.opacity) {
82
- vars.push(` ${componentVarName("button", "hoverOpacity")}: ${config.states.hover.opacity};`);
83
- }
84
- if (config.states?.focus?.ringWidth) {
85
- vars.push(` ${componentVarName("button", "focusRingWidth")}: ${config.states.focus.ringWidth};`);
86
- }
87
- if (config.states?.focus?.ringOffset) {
88
- vars.push(` ${componentVarName("button", "focusRingOffset")}: ${config.states.focus.ringOffset};`);
89
- }
90
- if (config.states?.focus?.ringColor) {
91
- vars.push(` ${componentVarName("button", "focusRingColor")}: ${resolveToken(config.states.focus.ringColor)};`);
92
- }
93
- if (config.states?.disabled?.opacity) {
94
- vars.push(` ${componentVarName("button", "disabledOpacity")}: ${config.states.disabled.opacity};`);
95
- }
96
- // Animation variables
97
- if (config.animations?.loading?.duration) {
98
- vars.push(` ${componentVarName("button", "loadingDuration")}: ${config.animations.loading.duration};`);
99
- }
100
- if (config.animations?.loading?.timing) {
101
- vars.push(` ${componentVarName("button", "loadingTiming")}: ${config.animations.loading.timing};`);
102
- }
103
- // Variant variables
104
- if (config.variants) {
105
- for (const [name, variant] of Object.entries(config.variants)) {
106
- if (variant.bg) {
107
- vars.push(` --cz-btn-${name}-bg: ${resolveToken(variant.bg)};`);
108
- }
109
- if (variant.color) {
110
- vars.push(` --cz-btn-${name}-color: ${resolveToken(variant.color)};`);
111
- }
112
- if (variant.borderColor) {
113
- vars.push(` --cz-btn-${name}-border-color: ${resolveToken(variant.borderColor)};`);
114
- }
115
- }
116
- }
117
- return `:root {\n${vars.join("\n")}\n}\n`;
118
- }
119
- /**
120
- * Generate base button styles
121
- */
122
- function generateButtonBase() {
123
- return `.cz-btn {
124
- display: inline-flex;
125
- align-items: center;
126
- justify-content: center;
127
- gap: var(--cz-btn-gap);
128
- border-radius: var(--cz-btn-border-radius);
129
- font-weight: var(--cz-btn-font-weight);
130
- transition: all var(--cz-btn-transition);
131
- cursor: pointer;
132
- border: var(--cz-btn-border-width) solid transparent;
133
- }
134
-
135
- .cz-btn:focus-visible {
136
- outline: none;
137
- box-shadow: 0 0 0 var(--cz-btn-focus-ring-offset) hsl(var(--cz-color-bg)),
138
- 0 0 0 calc(var(--cz-btn-focus-ring-offset) + var(--cz-btn-focus-ring-width)) var(--cz-btn-focus-ring-color);
139
- }
140
-
141
- .cz-btn:disabled {
142
- pointer-events: none;
143
- opacity: var(--cz-btn-disabled-opacity);
144
- }
145
- `;
146
- }
147
- /**
148
- * Generate button size variants
149
- */
150
- function generateButtonSizes(config) {
151
- const sizes = ["sm", "md", "lg"];
152
- let css = "/* Button Sizes */\n";
153
- for (const size of sizes) {
154
- css += `.cz-btn-${size} {
155
- height: var(--cz-btn-height-${size});
156
- padding: 0 var(--cz-btn-padding-x-${size});
157
- font-size: var(--cz-btn-font-size-${size});
158
- }\n`;
159
- }
160
- return css;
161
- }
162
- /**
163
- * Generate button color variants
164
- */
165
- function generateButtonVariants(variants) {
166
- let css = "/* Button Variants */\n";
167
- for (const [name, variant] of Object.entries(variants)) {
168
- // Base variant styles
169
- css += `.cz-btn-${name} {\n`;
170
- css += ` background: var(--cz-btn-${name}-bg);\n`;
171
- css += ` color: var(--cz-btn-${name}-color);\n`;
172
- if (variant.borderColor && variant.borderColor !== "transparent") {
173
- css += ` border-color: var(--cz-btn-${name}-border-color);\n`;
174
- }
175
- if (variant.textDecoration) {
176
- css += ` text-decoration: ${variant.textDecoration};\n`;
177
- css += ` text-underline-offset: 4px;\n`;
178
- }
179
- css += `}\n`;
180
- // Hover styles
181
- if (variant.hover) {
182
- css += `.cz-btn-${name}:hover {\n`;
183
- if (variant.hover.opacity) {
184
- css += ` opacity: ${variant.hover.opacity};\n`;
185
- }
186
- if (variant.hover.bg) {
187
- css += ` background: ${resolveToken(variant.hover.bg)};\n`;
188
- }
189
- if (variant.textDecoration) {
190
- css += ` text-decoration-thickness: 2px;\n`;
191
- }
192
- css += `}\n`;
193
- }
194
- }
195
- return css;
196
- }
197
- /**
198
- * Generate icon button styles
199
- */
200
- function generateButtonIcon(config) {
201
- return `/* Button Icon Size */
202
- .cz-btn-icon {
203
- padding: 0;
204
- }
205
- .cz-btn-icon.cz-btn-sm { width: var(--cz-btn-icon-size-sm); height: var(--cz-btn-icon-size-sm); }
206
- .cz-btn-icon.cz-btn-md { width: var(--cz-btn-icon-size-md); height: var(--cz-btn-icon-size-md); }
207
- .cz-btn-icon.cz-btn-lg { width: var(--cz-btn-icon-size-lg); height: var(--cz-btn-icon-size-lg); }
208
- `;
209
- }
210
- /**
211
- * Generate loading button styles
212
- */
213
- function generateButtonLoading(config) {
214
- return `/* Button Loading State */
215
- .cz-btn-loading { position: relative; }
216
- .cz-btn-spinner {
217
- width: 1rem;
218
- height: 1rem;
219
- animation: cz-spin var(--cz-btn-loading-duration) var(--cz-btn-loading-timing) infinite;
220
- flex-shrink: 0;
221
- }
222
- .cz-btn-content { opacity: 1; }
223
- `;
224
- }
@@ -1,9 +0,0 @@
1
- /**
2
- * CZero Card CSS Generator
3
- * Generates CSS for card component from config tokens
4
- */
5
- import type { CardTokens } from "../../src/core/types/config";
6
- /**
7
- * Generate all card CSS including variables and styles
8
- */
9
- export declare function generateCardCSS(config: CardTokens): string;
@@ -1,104 +0,0 @@
1
- /**
2
- * CZero Card CSS Generator
3
- * Generates CSS for card component from config tokens
4
- */
5
- import { resolveToken } from "../token-resolver";
6
- /**
7
- * Generate all card CSS including variables and styles
8
- */
9
- export function generateCardCSS(config) {
10
- let css = "";
11
- css += "/* ===== CARD ===== */\n\n";
12
- css += generateCardVariables(config);
13
- css += "\n";
14
- css += generateCardBase();
15
- css += "\n";
16
- if (config.customCSS) {
17
- css += `/* Custom Card CSS */\n${config.customCSS}\n`;
18
- }
19
- return css;
20
- }
21
- function generateCardVariables(config) {
22
- const vars = [];
23
- if (config.padding)
24
- vars.push(` --cz-card-padding: ${resolveToken(config.padding)};`);
25
- if (config.borderRadius)
26
- vars.push(` --cz-card-border-radius: ${resolveToken(config.borderRadius)};`);
27
- if (config.borderWidth)
28
- vars.push(` --cz-card-border-width: ${resolveToken(config.borderWidth)};`);
29
- if (config.borderColor)
30
- vars.push(` --cz-card-border-color: ${resolveToken(config.borderColor)};`);
31
- if (config.bg)
32
- vars.push(` --cz-card-bg: ${resolveToken(config.bg)};`);
33
- if (config.shadow)
34
- vars.push(` --cz-card-shadow: ${resolveToken(config.shadow)};`);
35
- // Header
36
- if (config.header?.paddingBottom)
37
- vars.push(` --cz-card-header-padding-bottom: ${resolveToken(config.header.paddingBottom)};`);
38
- if (config.header?.marginBottom)
39
- vars.push(` --cz-card-header-margin-bottom: ${resolveToken(config.header.marginBottom)};`);
40
- // Title
41
- if (config.title?.fontSize)
42
- vars.push(` --cz-card-title-font-size: ${resolveToken(config.title.fontSize)};`);
43
- if (config.title?.fontWeight)
44
- vars.push(` --cz-card-title-font-weight: ${resolveToken(config.title.fontWeight)};`);
45
- if (config.title?.color)
46
- vars.push(` --cz-card-title-color: ${resolveToken(config.title.color)};`);
47
- // Description
48
- if (config.description?.fontSize)
49
- vars.push(` --cz-card-description-font-size: ${resolveToken(config.description.fontSize)};`);
50
- if (config.description?.color)
51
- vars.push(` --cz-card-description-color: ${resolveToken(config.description.color)};`);
52
- // Footer
53
- if (config.footer?.paddingTop)
54
- vars.push(` --cz-card-footer-padding-top: ${resolveToken(config.footer.paddingTop)};`);
55
- if (config.footer?.marginTop)
56
- vars.push(` --cz-card-footer-margin-top: ${resolveToken(config.footer.marginTop)};`);
57
- if (config.footer?.gap)
58
- vars.push(` --cz-card-footer-gap: ${config.footer.gap};`);
59
- return `:root {\n${vars.join("\n")}\n}\n`;
60
- }
61
- function generateCardBase() {
62
- return `.cz-card {
63
- border-radius: var(--cz-card-border-radius);
64
- border: var(--cz-card-border-width) solid var(--cz-card-border-color);
65
- background-color: var(--cz-card-bg);
66
- box-shadow: var(--cz-card-shadow);
67
- padding: var(--cz-card-padding);
68
- }
69
-
70
- .cz-card-no-padding { padding: 0; }
71
-
72
- .cz-card-header {
73
- display: flex;
74
- flex-direction: column;
75
- gap: 0.375rem;
76
- padding-bottom: var(--cz-card-header-padding-bottom);
77
- border-bottom: var(--cz-card-border-width) solid var(--cz-card-border-color);
78
- margin-bottom: var(--cz-card-header-margin-bottom);
79
- }
80
-
81
- .cz-card-title {
82
- font-size: var(--cz-card-title-font-size);
83
- font-weight: var(--cz-card-title-font-weight);
84
- color: var(--cz-card-title-color);
85
- line-height: var(--cz-font-lineHeight-tight);
86
- }
87
-
88
- .cz-card-description {
89
- font-size: var(--cz-card-description-font-size);
90
- color: var(--cz-card-description-color);
91
- }
92
-
93
- .cz-card-body { color: var(--cz-card-title-color); }
94
-
95
- .cz-card-footer {
96
- display: flex;
97
- align-items: center;
98
- gap: var(--cz-card-footer-gap);
99
- padding-top: var(--cz-card-footer-padding-top);
100
- margin-top: var(--cz-card-footer-margin-top);
101
- border-top: var(--cz-card-border-width) solid var(--cz-card-border-color);
102
- }
103
- `;
104
- }
@@ -1,6 +0,0 @@
1
- /**
2
- * CZero Checkbox CSS Generator
3
- * Generates CSS for checkbox component from config tokens
4
- */
5
- import type { CheckboxTokens } from "../../src/core/types/config";
6
- export declare function generateCheckboxCSS(config: CheckboxTokens): string;