czero 0.1.0 → 0.2.0
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 +40 -0
- package/dist/cli/index.js +3780 -28
- package/dist/cli-new/cli/build-css.d.ts +19 -0
- package/dist/cli-new/cli/build-css.js +88 -0
- package/dist/cli-new/cli/generators/button.d.ts +9 -0
- package/dist/cli-new/cli/generators/button.js +224 -0
- package/dist/cli-new/cli/generators/card.d.ts +9 -0
- package/dist/cli-new/cli/generators/card.js +104 -0
- package/dist/cli-new/cli/generators/checkbox.d.ts +6 -0
- package/dist/cli-new/cli/generators/checkbox.js +163 -0
- package/dist/cli-new/cli/generators/index.d.ts +10 -0
- package/dist/cli-new/cli/generators/index.js +40 -0
- package/dist/cli-new/cli/generators/input.d.ts +9 -0
- package/dist/cli-new/cli/generators/input.js +231 -0
- package/dist/cli-new/cli/generators/switch.d.ts +6 -0
- package/dist/cli-new/cli/generators/switch.js +156 -0
- package/dist/cli-new/cli/generators/utilities.d.ts +9 -0
- package/dist/cli-new/cli/generators/utilities.js +150 -0
- package/dist/cli-new/cli/index.d.ts +8 -0
- package/dist/cli-new/cli/index.js +288 -0
- package/dist/cli-new/cli/token-resolver.d.ts +44 -0
- package/dist/cli-new/cli/token-resolver.js +137 -0
- package/dist/cli-new/cli/utils/deep-merge.d.ts +15 -0
- package/dist/cli-new/cli/utils/deep-merge.js +41 -0
- package/dist/cli-new/cli/validate-config.d.ts +19 -0
- package/dist/cli-new/cli/validate-config.js +151 -0
- package/dist/cli-new/src/core/component-defaults.d.ts +7 -0
- package/dist/cli-new/src/core/component-defaults.js +467 -0
- package/dist/cli-new/src/core/types/config.d.ts +489 -0
- package/dist/cli-new/src/core/types/config.js +5 -0
- package/dist/cli-new/src/presets/index.d.ts +44 -0
- package/dist/cli-new/src/presets/index.js +194 -0
- package/dist/components.css +1579 -2
- package/dist/react/core/component-defaults.d.ts +8 -0
- package/dist/react/core/component-defaults.d.ts.map +1 -0
- package/dist/react/core/types/config.d.ts +490 -0
- package/dist/react/core/types/config.d.ts.map +1 -0
- package/dist/react/index.cjs +11577 -17
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.ts +407 -4
- package/dist/react/index.js +11532 -6
- package/dist/react/index.js.map +1 -1
- package/dist/react/presets/index.d.ts +45 -0
- package/dist/react/presets/index.d.ts.map +1 -0
- package/dist/react/react/components/accordion.d.ts +30 -0
- package/dist/react/react/components/accordion.d.ts.map +1 -0
- package/dist/react/react/components/alert.d.ts +7 -0
- package/dist/react/react/components/alert.d.ts.map +1 -0
- package/dist/react/react/components/aspect-ratio.d.ts +8 -0
- package/dist/react/react/components/aspect-ratio.d.ts.map +1 -0
- package/dist/react/react/components/avatar.d.ts +10 -0
- package/dist/react/react/components/avatar.d.ts.map +1 -0
- package/dist/react/react/components/breadcrumb.d.ts +28 -0
- package/dist/react/react/components/breadcrumb.d.ts.map +1 -0
- package/dist/react/react/components/button.d.ts +3 -2
- package/dist/react/react/components/button.d.ts.map +1 -1
- package/dist/react/react/components/checkbox.d.ts +9 -0
- package/dist/react/react/components/checkbox.d.ts.map +1 -0
- package/dist/react/react/components/code.d.ts +6 -0
- package/dist/react/react/components/code.d.ts.map +1 -0
- package/dist/react/react/components/container.d.ts +8 -0
- package/dist/react/react/components/container.d.ts.map +1 -0
- package/dist/react/react/components/dialog.d.ts +28 -0
- package/dist/react/react/components/dialog.d.ts.map +1 -0
- package/dist/react/react/components/dropdown-menu.d.ts +32 -0
- package/dist/react/react/components/dropdown-menu.d.ts.map +1 -0
- package/dist/react/react/components/grid.d.ts +8 -0
- package/dist/react/react/components/grid.d.ts.map +1 -0
- package/dist/react/react/components/input.d.ts +4 -0
- package/dist/react/react/components/input.d.ts.map +1 -1
- package/dist/react/react/components/kbd.d.ts +6 -0
- package/dist/react/react/components/kbd.d.ts.map +1 -0
- package/dist/react/react/components/label.d.ts +7 -0
- package/dist/react/react/components/label.d.ts.map +1 -0
- package/dist/react/react/components/progress.d.ts +10 -0
- package/dist/react/react/components/progress.d.ts.map +1 -0
- package/dist/react/react/components/radio-group.d.ts +15 -0
- package/dist/react/react/components/radio-group.d.ts.map +1 -0
- package/dist/react/react/components/scroll-area.d.ts +8 -0
- package/dist/react/react/components/scroll-area.d.ts.map +1 -0
- package/dist/react/react/components/select.d.ts +29 -0
- package/dist/react/react/components/select.d.ts.map +1 -0
- package/dist/react/react/components/separator.d.ts +8 -0
- package/dist/react/react/components/separator.d.ts.map +1 -0
- package/dist/react/react/components/skeleton.d.ts +8 -0
- package/dist/react/react/components/skeleton.d.ts.map +1 -0
- package/dist/react/react/components/spinner.d.ts +7 -0
- package/dist/react/react/components/spinner.d.ts.map +1 -0
- package/dist/react/react/components/stack.d.ts +11 -0
- package/dist/react/react/components/stack.d.ts.map +1 -0
- package/dist/react/react/components/switch.d.ts +10 -0
- package/dist/react/react/components/switch.d.ts.map +1 -0
- package/dist/react/react/components/table.d.ts +27 -0
- package/dist/react/react/components/table.d.ts.map +1 -0
- package/dist/react/react/components/tabs.d.ts +21 -0
- package/dist/react/react/components/tabs.d.ts.map +1 -0
- package/dist/react/react/components/tag.d.ts +10 -0
- package/dist/react/react/components/tag.d.ts.map +1 -0
- package/dist/react/react/components/textarea.d.ts +11 -0
- package/dist/react/react/components/textarea.d.ts.map +1 -0
- package/dist/react/react/components/toast.d.ts +28 -0
- package/dist/react/react/components/toast.d.ts.map +1 -0
- package/dist/react/react/components/tooltip.d.ts +16 -0
- package/dist/react/react/components/tooltip.d.ts.map +1 -0
- package/dist/react/react/components/visually-hidden.d.ts +7 -0
- package/dist/react/react/components/visually-hidden.d.ts.map +1 -0
- package/dist/react/react/hooks/index.d.ts +5 -0
- package/dist/react/react/hooks/index.d.ts.map +1 -0
- package/dist/react/react/hooks/use-theme.d.ts +17 -0
- package/dist/react/react/hooks/use-theme.d.ts.map +1 -0
- package/dist/react/react/index.d.ts +30 -0
- package/dist/react/react/index.d.ts.map +1 -1
- package/dist/styles.css +1579 -2
- package/package.json +35 -4
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CZero Config Validator
|
|
3
|
+
* Validates user configuration and provides helpful error messages
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Validate user config and return normalized version
|
|
7
|
+
*/
|
|
8
|
+
export function validateConfig(config) {
|
|
9
|
+
const warnings = [];
|
|
10
|
+
const errors = [];
|
|
11
|
+
if (typeof config !== "object" || config === null) {
|
|
12
|
+
return {
|
|
13
|
+
valid: true,
|
|
14
|
+
warnings: ["Config is empty, using defaults"],
|
|
15
|
+
errors: [],
|
|
16
|
+
config: {},
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
const validConfig = config;
|
|
20
|
+
// Valid top-level keys
|
|
21
|
+
const validTopLevelKeys = [
|
|
22
|
+
"color",
|
|
23
|
+
"radius",
|
|
24
|
+
"shadow",
|
|
25
|
+
"spacing",
|
|
26
|
+
"typography",
|
|
27
|
+
"transition",
|
|
28
|
+
"breakpoints",
|
|
29
|
+
"components",
|
|
30
|
+
"customCSS",
|
|
31
|
+
];
|
|
32
|
+
// Check for unknown top-level keys
|
|
33
|
+
for (const key of Object.keys(validConfig)) {
|
|
34
|
+
if (!validTopLevelKeys.includes(key)) {
|
|
35
|
+
warnings.push(`Unknown config key: "${key}" (will be ignored)`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Validate components section
|
|
39
|
+
if (validConfig.components) {
|
|
40
|
+
const componentResult = validateComponents(validConfig.components);
|
|
41
|
+
warnings.push(...componentResult.warnings);
|
|
42
|
+
errors.push(...componentResult.errors);
|
|
43
|
+
}
|
|
44
|
+
// Validate color tokens
|
|
45
|
+
if (validConfig.color) {
|
|
46
|
+
const colorResult = validateColorTokens(validConfig.color);
|
|
47
|
+
warnings.push(...colorResult.warnings);
|
|
48
|
+
errors.push(...colorResult.errors);
|
|
49
|
+
}
|
|
50
|
+
// Validate customCSS
|
|
51
|
+
if (validConfig.customCSS) {
|
|
52
|
+
const customCSSResult = validateCustomCSS(validConfig.customCSS);
|
|
53
|
+
warnings.push(...customCSSResult.warnings);
|
|
54
|
+
errors.push(...customCSSResult.errors);
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
valid: errors.length === 0,
|
|
58
|
+
warnings,
|
|
59
|
+
errors,
|
|
60
|
+
config: validConfig,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Validate components configuration
|
|
65
|
+
*/
|
|
66
|
+
function validateComponents(components) {
|
|
67
|
+
const warnings = [];
|
|
68
|
+
const errors = [];
|
|
69
|
+
if (typeof components !== "object" || components === null) {
|
|
70
|
+
errors.push("components must be an object");
|
|
71
|
+
return { warnings, errors };
|
|
72
|
+
}
|
|
73
|
+
const validComponents = [
|
|
74
|
+
"button", "input", "textarea", "card", "badge", "switch", "checkbox",
|
|
75
|
+
"radio", "select", "label", "alert", "tooltip", "progress", "skeleton",
|
|
76
|
+
"spinner", "tabs", "dialog", "dropdownMenu", "accordion", "table",
|
|
77
|
+
"avatar", "separator", "breadcrumb", "code", "kbd", "tag", "toast",
|
|
78
|
+
"scrollArea", "container", "stack", "grid"
|
|
79
|
+
];
|
|
80
|
+
for (const key of Object.keys(components)) {
|
|
81
|
+
if (!validComponents.includes(key)) {
|
|
82
|
+
warnings.push(`Unknown component: "${key}" (will be ignored)`);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return { warnings, errors };
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Validate color tokens
|
|
89
|
+
*/
|
|
90
|
+
function validateColorTokens(color) {
|
|
91
|
+
const warnings = [];
|
|
92
|
+
const errors = [];
|
|
93
|
+
if (typeof color !== "object" || color === null) {
|
|
94
|
+
errors.push("color must be an object");
|
|
95
|
+
return { warnings, errors };
|
|
96
|
+
}
|
|
97
|
+
const colorObj = color;
|
|
98
|
+
for (const [name, value] of Object.entries(colorObj)) {
|
|
99
|
+
if (typeof value === "object" && value !== null) {
|
|
100
|
+
const colorValue = value;
|
|
101
|
+
if (!("light" in colorValue) || !("dark" in colorValue)) {
|
|
102
|
+
errors.push(`Color "${name}" must have both "light" and "dark" values`);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
errors.push(`Color "${name}" must be an object with "light" and "dark" values`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return { warnings, errors };
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Validate custom CSS injection
|
|
113
|
+
*/
|
|
114
|
+
function validateCustomCSS(customCSS) {
|
|
115
|
+
const warnings = [];
|
|
116
|
+
const errors = [];
|
|
117
|
+
if (typeof customCSS !== "object" || customCSS === null) {
|
|
118
|
+
errors.push("customCSS must be an object with 'before' and/or 'after' string properties");
|
|
119
|
+
return { warnings, errors };
|
|
120
|
+
}
|
|
121
|
+
const css = customCSS;
|
|
122
|
+
if (css.before && typeof css.before !== "string") {
|
|
123
|
+
errors.push("customCSS.before must be a string");
|
|
124
|
+
}
|
|
125
|
+
if (css.after && typeof css.after !== "string") {
|
|
126
|
+
errors.push("customCSS.after must be a string");
|
|
127
|
+
}
|
|
128
|
+
// Check for common CSS errors in custom CSS
|
|
129
|
+
const customCSSString = `${css.before || ""}${css.after || ""}`;
|
|
130
|
+
if (customCSSString.includes("{{") || customCSSString.includes("}}")) {
|
|
131
|
+
warnings.push("customCSS contains template syntax ({{ }}) which won't be processed");
|
|
132
|
+
}
|
|
133
|
+
return { warnings, errors };
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Print validation results to console
|
|
137
|
+
*/
|
|
138
|
+
export function printValidationResults(result) {
|
|
139
|
+
if (result.warnings.length > 0) {
|
|
140
|
+
console.log("⚠️ Warnings:");
|
|
141
|
+
for (const warning of result.warnings) {
|
|
142
|
+
console.log(` • ${warning}`);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
if (result.errors.length > 0) {
|
|
146
|
+
console.log("❌ Errors:");
|
|
147
|
+
for (const error of result.errors) {
|
|
148
|
+
console.log(` • ${error}`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CZero Component Default Tokens
|
|
3
|
+
* Default values extracted from components.css
|
|
4
|
+
* Users can override any of these in their czero.config.js
|
|
5
|
+
*/
|
|
6
|
+
import type { ComponentsConfig } from "./types/config";
|
|
7
|
+
export declare const componentDefaults: ComponentsConfig;
|
|
@@ -0,0 +1,467 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CZero Component Default Tokens
|
|
3
|
+
* Default values extracted from components.css
|
|
4
|
+
* Users can override any of these in their czero.config.js
|
|
5
|
+
*/
|
|
6
|
+
export const componentDefaults = {
|
|
7
|
+
// ===== BUTTON =====
|
|
8
|
+
button: {
|
|
9
|
+
height: { sm: "2rem", md: "2.5rem", lg: "3rem" },
|
|
10
|
+
paddingX: { sm: "0.75rem", md: "1rem", lg: "1.5rem" },
|
|
11
|
+
gap: "0.5rem",
|
|
12
|
+
fontSize: { sm: "$font-sm", md: "$font-md", lg: "$font-lg" },
|
|
13
|
+
fontWeight: "$font-medium",
|
|
14
|
+
borderRadius: "$radius-md",
|
|
15
|
+
borderWidth: "1px",
|
|
16
|
+
iconSize: { sm: "2rem", md: "2.5rem", lg: "3rem" },
|
|
17
|
+
transition: "$transition-fast",
|
|
18
|
+
states: {
|
|
19
|
+
hover: { opacity: "0.9" },
|
|
20
|
+
focus: { ringWidth: "2px", ringOffset: "2px", ringColor: "$color-ring" },
|
|
21
|
+
disabled: { opacity: "0.5" },
|
|
22
|
+
},
|
|
23
|
+
variants: {
|
|
24
|
+
primary: {
|
|
25
|
+
bg: "$color-primary",
|
|
26
|
+
color: "$color-primaryFg",
|
|
27
|
+
borderColor: "transparent",
|
|
28
|
+
hover: { opacity: "0.9" },
|
|
29
|
+
},
|
|
30
|
+
secondary: {
|
|
31
|
+
bg: "$color-secondary",
|
|
32
|
+
color: "$color-secondaryFg",
|
|
33
|
+
borderColor: "transparent",
|
|
34
|
+
hover: { opacity: "0.8" },
|
|
35
|
+
},
|
|
36
|
+
outline: {
|
|
37
|
+
bg: "transparent",
|
|
38
|
+
color: "$color-fg",
|
|
39
|
+
borderColor: "$color-border",
|
|
40
|
+
hover: { bg: "$color-muted" },
|
|
41
|
+
},
|
|
42
|
+
ghost: {
|
|
43
|
+
bg: "transparent",
|
|
44
|
+
color: "$color-fg",
|
|
45
|
+
borderColor: "transparent",
|
|
46
|
+
hover: { bg: "$color-muted" },
|
|
47
|
+
},
|
|
48
|
+
danger: {
|
|
49
|
+
bg: "$color-danger",
|
|
50
|
+
color: "$color-dangerFg",
|
|
51
|
+
borderColor: "transparent",
|
|
52
|
+
hover: { opacity: "0.9" },
|
|
53
|
+
},
|
|
54
|
+
link: {
|
|
55
|
+
bg: "transparent",
|
|
56
|
+
color: "$color-primary",
|
|
57
|
+
borderColor: "transparent",
|
|
58
|
+
textDecoration: "underline",
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
animations: {
|
|
62
|
+
loading: { duration: "0.75s", timing: "linear" },
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
// ===== INPUT =====
|
|
66
|
+
input: {
|
|
67
|
+
height: { sm: "2rem", md: "2.5rem", lg: "3rem" },
|
|
68
|
+
paddingX: { sm: "0.5rem", md: "0.75rem", lg: "1rem" },
|
|
69
|
+
fontSize: { sm: "$font-sm", md: "$font-md", lg: "$font-lg" },
|
|
70
|
+
borderRadius: "$radius-md",
|
|
71
|
+
borderWidth: "1px",
|
|
72
|
+
borderColor: "$color-border",
|
|
73
|
+
bg: "$color-bg",
|
|
74
|
+
color: "$color-fg",
|
|
75
|
+
placeholderColor: "$color-mutedFg",
|
|
76
|
+
iconSize: "1rem",
|
|
77
|
+
iconColor: "$color-mutedFg",
|
|
78
|
+
iconSpacing: "2.5rem",
|
|
79
|
+
states: {
|
|
80
|
+
focus: {
|
|
81
|
+
borderColor: "$color-ring",
|
|
82
|
+
shadow: "0 0 0 2px $color-ring / 0.2",
|
|
83
|
+
},
|
|
84
|
+
error: {
|
|
85
|
+
borderColor: "$color-danger",
|
|
86
|
+
focusShadow: "0 0 0 2px $color-danger / 0.2",
|
|
87
|
+
},
|
|
88
|
+
disabled: { opacity: "0.5", cursor: "not-allowed" },
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
// ===== TEXTAREA =====
|
|
92
|
+
textarea: {
|
|
93
|
+
minHeight: "5rem",
|
|
94
|
+
paddingX: { sm: "0.5rem", md: "0.75rem", lg: "1rem" },
|
|
95
|
+
paddingY: { sm: "0.375rem", md: "0.5rem", lg: "0.75rem" },
|
|
96
|
+
fontSize: { sm: "$font-sm", md: "$font-md", lg: "$font-lg" },
|
|
97
|
+
borderRadius: "$radius-md",
|
|
98
|
+
borderWidth: "1px",
|
|
99
|
+
borderColor: "$color-border",
|
|
100
|
+
bg: "$color-bg",
|
|
101
|
+
color: "$color-fg",
|
|
102
|
+
placeholderColor: "$color-mutedFg",
|
|
103
|
+
states: {
|
|
104
|
+
focus: {
|
|
105
|
+
borderColor: "$color-ring",
|
|
106
|
+
shadow: "0 0 0 2px $color-ring / 0.2",
|
|
107
|
+
},
|
|
108
|
+
disabled: { opacity: "0.5" },
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
// ===== CARD =====
|
|
112
|
+
card: {
|
|
113
|
+
padding: "$spacing-lg",
|
|
114
|
+
borderRadius: "$radius-lg",
|
|
115
|
+
borderWidth: "1px",
|
|
116
|
+
borderColor: "$color-border",
|
|
117
|
+
bg: "$color-bg",
|
|
118
|
+
shadow: "$shadow-sm",
|
|
119
|
+
header: {
|
|
120
|
+
paddingBottom: "$spacing-md",
|
|
121
|
+
borderWidth: "1px",
|
|
122
|
+
marginBottom: "$spacing-md",
|
|
123
|
+
},
|
|
124
|
+
title: {
|
|
125
|
+
fontSize: "$font-lg",
|
|
126
|
+
fontWeight: "$font-semibold",
|
|
127
|
+
color: "$color-fg",
|
|
128
|
+
},
|
|
129
|
+
description: {
|
|
130
|
+
fontSize: "$font-sm",
|
|
131
|
+
color: "$color-mutedFg",
|
|
132
|
+
},
|
|
133
|
+
footer: {
|
|
134
|
+
paddingTop: "$spacing-md",
|
|
135
|
+
marginTop: "$spacing-md",
|
|
136
|
+
borderWidth: "1px",
|
|
137
|
+
gap: "0.5rem",
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
// ===== BADGE =====
|
|
141
|
+
badge: {
|
|
142
|
+
paddingX: { sm: "0.375rem", md: "0.5rem" },
|
|
143
|
+
paddingY: { sm: "0.125rem", md: "0.125rem" },
|
|
144
|
+
fontSize: { sm: "0.7rem", md: "$font-xs" },
|
|
145
|
+
fontWeight: "$font-medium",
|
|
146
|
+
borderRadius: "$radius-full",
|
|
147
|
+
variants: {
|
|
148
|
+
default: { bg: "$color-secondary", color: "$color-secondaryFg" },
|
|
149
|
+
primary: { bg: "$color-primary", color: "$color-primaryFg" },
|
|
150
|
+
success: { bg: "$color-success", color: "$color-successFg" },
|
|
151
|
+
danger: { bg: "$color-danger", color: "$color-dangerFg" },
|
|
152
|
+
warning: { bg: "$color-warning", color: "$color-warningFg" },
|
|
153
|
+
outline: { bg: "transparent", color: "$color-fg", borderColor: "$color-border" },
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
// ===== SWITCH =====
|
|
157
|
+
switch: {
|
|
158
|
+
width: { sm: "2rem", md: "2.75rem", lg: "3.5rem" },
|
|
159
|
+
height: { sm: "1.125rem", md: "1.5rem", lg: "1.875rem" },
|
|
160
|
+
thumbSize: { sm: "0.875rem", md: "1.25rem", lg: "1.625rem" },
|
|
161
|
+
thumbOffset: "0.125rem",
|
|
162
|
+
borderRadius: "$radius-full",
|
|
163
|
+
bgUnchecked: "$color-muted",
|
|
164
|
+
bgChecked: "$color-primary",
|
|
165
|
+
thumbBg: "$color-bg",
|
|
166
|
+
thumbShadow: "$shadow-sm",
|
|
167
|
+
transition: "$transition-fast",
|
|
168
|
+
states: {
|
|
169
|
+
focus: { ringWidth: "2px", ringOffset: "2px", ringColor: "$color-ring" },
|
|
170
|
+
disabled: { opacity: "0.5" },
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
// ===== CHECKBOX =====
|
|
174
|
+
checkbox: {
|
|
175
|
+
size: { sm: "1rem", md: "1.25rem", lg: "1.5rem" },
|
|
176
|
+
iconSize: { sm: "10px", md: "12px", lg: "14px" },
|
|
177
|
+
borderRadius: "$radius-sm",
|
|
178
|
+
borderWidth: "2px",
|
|
179
|
+
borderColor: "$color-border",
|
|
180
|
+
bg: "$color-bg",
|
|
181
|
+
checkedBg: "$color-primary",
|
|
182
|
+
checkedBorderColor: "$color-primary",
|
|
183
|
+
indicatorColor: "$color-primaryFg",
|
|
184
|
+
labelFontSize: "$font-sm",
|
|
185
|
+
labelGap: "0.5rem",
|
|
186
|
+
states: {
|
|
187
|
+
hover: { borderColor: "$color-primary" },
|
|
188
|
+
focus: { ringWidth: "2px", ringOffset: "2px", ringColor: "$color-ring" },
|
|
189
|
+
disabled: { opacity: "0.5" },
|
|
190
|
+
},
|
|
191
|
+
},
|
|
192
|
+
// ===== RADIO =====
|
|
193
|
+
radio: {
|
|
194
|
+
size: "1.25rem",
|
|
195
|
+
indicatorSize: "0.625rem",
|
|
196
|
+
borderWidth: "2px",
|
|
197
|
+
borderColor: "$color-border",
|
|
198
|
+
bg: "$color-bg",
|
|
199
|
+
checkedBorderColor: "$color-primary",
|
|
200
|
+
indicatorBg: "$color-primary",
|
|
201
|
+
labelFontSize: "$font-sm",
|
|
202
|
+
labelGap: "0.5rem",
|
|
203
|
+
states: {
|
|
204
|
+
hover: { borderColor: "$color-primary" },
|
|
205
|
+
focus: { ringWidth: "2px", ringOffset: "2px", ringColor: "$color-ring" },
|
|
206
|
+
disabled: { opacity: "0.5" },
|
|
207
|
+
},
|
|
208
|
+
},
|
|
209
|
+
// ===== SELECT =====
|
|
210
|
+
select: {
|
|
211
|
+
height: { sm: "2rem", md: "2.5rem", lg: "3rem" },
|
|
212
|
+
paddingX: { sm: "0.5rem", md: "0.75rem", lg: "1rem" },
|
|
213
|
+
fontSize: { sm: "$font-sm", md: "$font-md", lg: "$font-lg" },
|
|
214
|
+
borderRadius: "$radius-md",
|
|
215
|
+
borderWidth: "1px",
|
|
216
|
+
borderColor: "$color-border",
|
|
217
|
+
bg: "$color-bg",
|
|
218
|
+
color: "$color-fg",
|
|
219
|
+
iconSize: "12px",
|
|
220
|
+
states: {
|
|
221
|
+
focus: { ringWidth: "2px", ringColor: "$color-ring" },
|
|
222
|
+
disabled: { opacity: "0.5" },
|
|
223
|
+
},
|
|
224
|
+
content: {
|
|
225
|
+
bg: "$color-bg",
|
|
226
|
+
borderRadius: "$radius-md",
|
|
227
|
+
shadow: "$shadow-md",
|
|
228
|
+
padding: "0.25rem",
|
|
229
|
+
},
|
|
230
|
+
item: {
|
|
231
|
+
paddingX: "0.5rem",
|
|
232
|
+
paddingY: "0.375rem",
|
|
233
|
+
borderRadius: "$radius-sm",
|
|
234
|
+
hoverBg: "$color-muted",
|
|
235
|
+
},
|
|
236
|
+
},
|
|
237
|
+
// ===== LABEL =====
|
|
238
|
+
label: {
|
|
239
|
+
fontSize: "$font-sm",
|
|
240
|
+
fontWeight: "$font-medium",
|
|
241
|
+
color: "$color-fg",
|
|
242
|
+
requiredColor: "$color-danger",
|
|
243
|
+
},
|
|
244
|
+
// ===== ALERT =====
|
|
245
|
+
alert: {
|
|
246
|
+
paddingX: "$spacing-lg",
|
|
247
|
+
paddingY: "$spacing-md",
|
|
248
|
+
borderRadius: "$radius-md",
|
|
249
|
+
borderWidth: "1px",
|
|
250
|
+
titleFontSize: "$font-sm",
|
|
251
|
+
titleFontWeight: "$font-semibold",
|
|
252
|
+
contentFontSize: "$font-sm",
|
|
253
|
+
variants: {
|
|
254
|
+
info: { bg: "$color-primary / 0.1", borderColor: "$color-primary / 0.3", color: "$color-primary" },
|
|
255
|
+
success: { bg: "$color-success / 0.1", borderColor: "$color-success / 0.3", color: "$color-success" },
|
|
256
|
+
warning: { bg: "$color-warning / 0.1", borderColor: "$color-warning / 0.3", color: "$color-warning" },
|
|
257
|
+
danger: { bg: "$color-danger / 0.1", borderColor: "$color-danger / 0.3", color: "$color-danger" },
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
|
+
// ===== TOOLTIP =====
|
|
261
|
+
tooltip: {
|
|
262
|
+
paddingX: "0.75rem",
|
|
263
|
+
paddingY: "0.375rem",
|
|
264
|
+
fontSize: "$font-sm",
|
|
265
|
+
borderRadius: "$radius-md",
|
|
266
|
+
bg: "$color-fg",
|
|
267
|
+
color: "$color-bg",
|
|
268
|
+
shadow: "$shadow-md",
|
|
269
|
+
offset: "0.5rem",
|
|
270
|
+
},
|
|
271
|
+
// ===== PROGRESS =====
|
|
272
|
+
progress: {
|
|
273
|
+
height: { sm: "0.375rem", md: "0.5rem", lg: "0.75rem" },
|
|
274
|
+
borderRadius: "$radius-full",
|
|
275
|
+
bg: "$color-muted",
|
|
276
|
+
barColors: {
|
|
277
|
+
default: "$color-primary",
|
|
278
|
+
success: "$color-success",
|
|
279
|
+
warning: "$color-warning",
|
|
280
|
+
danger: "$color-danger",
|
|
281
|
+
},
|
|
282
|
+
transition: "$transition-normal",
|
|
283
|
+
},
|
|
284
|
+
// ===== SKELETON =====
|
|
285
|
+
skeleton: {
|
|
286
|
+
bg: "$color-muted",
|
|
287
|
+
borderRadius: "$radius-sm",
|
|
288
|
+
animationDuration: "1.5s",
|
|
289
|
+
},
|
|
290
|
+
// ===== SPINNER =====
|
|
291
|
+
spinner: {
|
|
292
|
+
size: { sm: "1rem", md: "1.5rem", lg: "2rem" },
|
|
293
|
+
borderWidth: { sm: "2px", md: "2px", lg: "3px" },
|
|
294
|
+
color: "$color-primary",
|
|
295
|
+
trackColor: "$color-muted",
|
|
296
|
+
animationDuration: "0.6s",
|
|
297
|
+
},
|
|
298
|
+
// ===== TABS =====
|
|
299
|
+
tabs: {
|
|
300
|
+
listBorderWidth: "1px",
|
|
301
|
+
listBorderColor: "$color-border",
|
|
302
|
+
triggerPaddingX: "1rem",
|
|
303
|
+
triggerPaddingY: "0.5rem",
|
|
304
|
+
triggerFontSize: "$font-sm",
|
|
305
|
+
triggerFontWeight: "$font-medium",
|
|
306
|
+
triggerColor: "$color-mutedFg",
|
|
307
|
+
triggerActiveColor: "$color-primary",
|
|
308
|
+
triggerActiveBorderColor: "$color-primary",
|
|
309
|
+
contentPadding: "$spacing-lg",
|
|
310
|
+
states: {
|
|
311
|
+
hover: { color: "$color-fg" },
|
|
312
|
+
focus: { ringWidth: "2px", ringColor: "$color-ring" },
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
|
+
// ===== DIALOG =====
|
|
316
|
+
dialog: {
|
|
317
|
+
overlayBg: "rgba(0, 0, 0, 0.5)",
|
|
318
|
+
contentBg: "$color-bg",
|
|
319
|
+
contentBorderRadius: "$radius-lg",
|
|
320
|
+
contentShadow: "$shadow-lg",
|
|
321
|
+
contentMaxWidth: "32rem",
|
|
322
|
+
contentPadding: "$spacing-lg",
|
|
323
|
+
closeBtnSize: "2rem",
|
|
324
|
+
titleFontSize: "$font-lg",
|
|
325
|
+
titleFontWeight: "$font-semibold",
|
|
326
|
+
descriptionFontSize: "$font-sm",
|
|
327
|
+
descriptionColor: "$color-mutedFg",
|
|
328
|
+
},
|
|
329
|
+
// ===== DROPDOWN MENU =====
|
|
330
|
+
dropdownMenu: {
|
|
331
|
+
contentBg: "$color-bg",
|
|
332
|
+
contentBorderRadius: "$radius-md",
|
|
333
|
+
contentShadow: "$shadow-lg",
|
|
334
|
+
contentPadding: "0.25rem",
|
|
335
|
+
contentMinWidth: "8rem",
|
|
336
|
+
itemPaddingX: "0.5rem",
|
|
337
|
+
itemPaddingY: "0.375rem",
|
|
338
|
+
itemBorderRadius: "$radius-sm",
|
|
339
|
+
itemFontSize: "$font-sm",
|
|
340
|
+
itemHoverBg: "$color-muted",
|
|
341
|
+
separatorColor: "$color-border",
|
|
342
|
+
separatorMargin: "0.25rem",
|
|
343
|
+
},
|
|
344
|
+
// ===== ACCORDION =====
|
|
345
|
+
accordion: {
|
|
346
|
+
borderRadius: "$radius-md",
|
|
347
|
+
borderWidth: "1px",
|
|
348
|
+
borderColor: "$color-border",
|
|
349
|
+
itemBorderWidth: "1px",
|
|
350
|
+
triggerPadding: "1rem",
|
|
351
|
+
triggerFontWeight: "$font-medium",
|
|
352
|
+
triggerHoverBg: "$color-muted",
|
|
353
|
+
contentPadding: "1rem",
|
|
354
|
+
iconSize: "1rem",
|
|
355
|
+
states: {
|
|
356
|
+
focus: { ringWidth: "2px", ringColor: "$color-ring" },
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
// ===== TABLE =====
|
|
360
|
+
table: {
|
|
361
|
+
borderRadius: "$radius-md",
|
|
362
|
+
borderWidth: "1px",
|
|
363
|
+
borderColor: "$color-border",
|
|
364
|
+
headerBg: "$color-muted",
|
|
365
|
+
headerFontWeight: "$font-medium",
|
|
366
|
+
cellPaddingX: "0.75rem",
|
|
367
|
+
cellPaddingY: "0.5rem",
|
|
368
|
+
rowHoverBg: "$color-muted / 0.5",
|
|
369
|
+
stripedBg: "$color-muted / 0.3",
|
|
370
|
+
},
|
|
371
|
+
// ===== AVATAR =====
|
|
372
|
+
avatar: {
|
|
373
|
+
size: { sm: "2rem", md: "2.5rem", lg: "3.5rem" },
|
|
374
|
+
fontSize: { sm: "$font-xs", md: "$font-sm", lg: "$font-md" },
|
|
375
|
+
borderRadius: "$radius-full",
|
|
376
|
+
bg: "$color-muted",
|
|
377
|
+
color: "$color-mutedFg",
|
|
378
|
+
},
|
|
379
|
+
// ===== SEPARATOR =====
|
|
380
|
+
separator: {
|
|
381
|
+
color: "$color-border",
|
|
382
|
+
thickness: "1px",
|
|
383
|
+
},
|
|
384
|
+
// ===== BREADCRUMB =====
|
|
385
|
+
breadcrumb: {
|
|
386
|
+
fontSize: "$font-sm",
|
|
387
|
+
color: "$color-mutedFg",
|
|
388
|
+
activeColor: "$color-fg",
|
|
389
|
+
separatorColor: "$color-mutedFg",
|
|
390
|
+
gap: "0.5rem",
|
|
391
|
+
},
|
|
392
|
+
// ===== CODE =====
|
|
393
|
+
code: {
|
|
394
|
+
fontSize: "$font-sm",
|
|
395
|
+
fontFamily: "ui-monospace, monospace",
|
|
396
|
+
bg: "$color-muted",
|
|
397
|
+
color: "$color-fg",
|
|
398
|
+
paddingX: "0.25rem",
|
|
399
|
+
paddingY: "0.125rem",
|
|
400
|
+
borderRadius: "$radius-sm",
|
|
401
|
+
},
|
|
402
|
+
// ===== KBD =====
|
|
403
|
+
kbd: {
|
|
404
|
+
fontSize: "$font-xs",
|
|
405
|
+
fontFamily: "ui-monospace, monospace",
|
|
406
|
+
bg: "$color-muted",
|
|
407
|
+
color: "$color-fg",
|
|
408
|
+
borderColor: "$color-border",
|
|
409
|
+
paddingX: "0.375rem",
|
|
410
|
+
paddingY: "0.125rem",
|
|
411
|
+
borderRadius: "$radius-sm",
|
|
412
|
+
shadow: "0 1px 0 1px $color-border",
|
|
413
|
+
},
|
|
414
|
+
// ===== TAG =====
|
|
415
|
+
tag: {
|
|
416
|
+
paddingX: { sm: "0.5rem", md: "0.625rem" },
|
|
417
|
+
paddingY: { sm: "0.125rem", md: "0.25rem" },
|
|
418
|
+
fontSize: { sm: "$font-xs", md: "$font-sm" },
|
|
419
|
+
fontWeight: "$font-medium",
|
|
420
|
+
borderRadius: "$radius-md",
|
|
421
|
+
gap: "0.25rem",
|
|
422
|
+
variants: {
|
|
423
|
+
default: { bg: "$color-secondary", color: "$color-secondaryFg" },
|
|
424
|
+
primary: { bg: "$color-primary", color: "$color-primaryFg" },
|
|
425
|
+
success: { bg: "$color-success", color: "$color-successFg" },
|
|
426
|
+
danger: { bg: "$color-danger", color: "$color-dangerFg" },
|
|
427
|
+
warning: { bg: "$color-warning", color: "$color-warningFg" },
|
|
428
|
+
outline: { bg: "transparent", color: "$color-fg", borderColor: "$color-border" },
|
|
429
|
+
},
|
|
430
|
+
},
|
|
431
|
+
// ===== TOAST =====
|
|
432
|
+
toast: {
|
|
433
|
+
padding: "1rem",
|
|
434
|
+
borderRadius: "$radius-md",
|
|
435
|
+
shadow: "$shadow-lg",
|
|
436
|
+
minWidth: "300px",
|
|
437
|
+
maxWidth: "420px",
|
|
438
|
+
titleFontWeight: "$font-semibold",
|
|
439
|
+
variants: {
|
|
440
|
+
default: { bg: "$color-bg", color: "$color-fg", borderColor: "$color-border" },
|
|
441
|
+
success: { bg: "$color-success / 0.1", color: "$color-success", borderColor: "$color-success / 0.3" },
|
|
442
|
+
warning: { bg: "$color-warning / 0.1", color: "$color-warning", borderColor: "$color-warning / 0.3" },
|
|
443
|
+
danger: { bg: "$color-danger / 0.1", color: "$color-danger", borderColor: "$color-danger / 0.3" },
|
|
444
|
+
},
|
|
445
|
+
},
|
|
446
|
+
// ===== SCROLL AREA =====
|
|
447
|
+
scrollArea: {
|
|
448
|
+
scrollbarWidth: "10px",
|
|
449
|
+
scrollbarBg: "transparent",
|
|
450
|
+
thumbBg: "$color-border",
|
|
451
|
+
thumbHoverBg: "$color-mutedFg",
|
|
452
|
+
thumbBorderRadius: "$radius-full",
|
|
453
|
+
},
|
|
454
|
+
// ===== CONTAINER =====
|
|
455
|
+
container: {
|
|
456
|
+
maxWidth: { sm: "640px", md: "768px", lg: "1024px", xl: "1280px", "2xl": "1536px" },
|
|
457
|
+
paddingX: "1rem",
|
|
458
|
+
},
|
|
459
|
+
// ===== STACK =====
|
|
460
|
+
stack: {
|
|
461
|
+
gap: { sm: "0.5rem", md: "1rem", lg: "1.5rem" },
|
|
462
|
+
},
|
|
463
|
+
// ===== GRID =====
|
|
464
|
+
grid: {
|
|
465
|
+
gap: { sm: "0.5rem", md: "1rem", lg: "1.5rem" },
|
|
466
|
+
},
|
|
467
|
+
};
|