@ng-shangjc/cli 1.0.0-beta
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 +216 -0
- package/dist/commands/init.js +280 -0
- package/dist/commands/install.js +332 -0
- package/dist/commands/variants.js +42 -0
- package/dist/index.js +26 -0
- package/dist/utils/variant-configs.js +122 -0
- package/package.json +23 -0
- package/src/commands/init.ts +254 -0
- package/src/commands/install.ts +352 -0
- package/src/commands/variants.ts +45 -0
- package/src/index.ts +31 -0
- package/src/utils/variant-configs.ts +131 -0
- package/tsconfig.json +16 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
export interface ComponentVariant {
|
|
2
|
+
name: string;
|
|
3
|
+
classes: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export interface ComponentVariantConfig {
|
|
8
|
+
component: string;
|
|
9
|
+
variants: ComponentVariant[];
|
|
10
|
+
defaultVariant: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export const COMPONENT_VARIANT_CONFIGS: Record<string, ComponentVariantConfig> = {
|
|
14
|
+
alert: {
|
|
15
|
+
component: 'alert',
|
|
16
|
+
variants: [
|
|
17
|
+
{
|
|
18
|
+
name: 'default',
|
|
19
|
+
classes: 'bg-background text-foreground border-border',
|
|
20
|
+
description: 'Default alert style'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'destructive',
|
|
24
|
+
classes: 'border-destructive/50 text-red-800 bg-red-50 dark:border-destructive dark:bg-red-950/30 dark:text-red-300 [&>svg]:text-red-600 dark:[&>svg]:text-red-300',
|
|
25
|
+
description: 'Red alert for errors'
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'warning',
|
|
29
|
+
classes: 'border-yellow-500/50 text-yellow-800 bg-yellow-50 dark:border-yellow-500 dark:text-yellow-300 dark:bg-yellow-950/30 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-300',
|
|
30
|
+
description: 'Yellow alert for warnings'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'success',
|
|
34
|
+
classes: 'border-green-500/50 text-green-800 bg-green-50 dark:border-green-500 dark:text-green-300 dark:bg-green-950/30 [&>svg]:text-green-600 dark:[&>svg]:text-green-300',
|
|
35
|
+
description: 'Green alert for success'
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
name: 'info',
|
|
39
|
+
classes: 'border-blue-500/50 text-blue-800 bg-blue-50 dark:border-blue-500 dark:text-blue-300 dark:bg-blue-950/30 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-300',
|
|
40
|
+
description: 'Blue alert for information'
|
|
41
|
+
}
|
|
42
|
+
],
|
|
43
|
+
defaultVariant: 'default'
|
|
44
|
+
},
|
|
45
|
+
button: {
|
|
46
|
+
component: 'button',
|
|
47
|
+
variants: [
|
|
48
|
+
{
|
|
49
|
+
name: 'default',
|
|
50
|
+
classes: 'bg-primary text-primary-foreground hover:bg-primary/90',
|
|
51
|
+
description: 'Primary button style'
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'destructive',
|
|
55
|
+
classes: 'bg-destructive text-destructive-foreground hover:bg-destructive/90',
|
|
56
|
+
description: 'Destructive button style'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'outline',
|
|
60
|
+
classes: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground',
|
|
61
|
+
description: 'Outline button style'
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: 'secondary',
|
|
65
|
+
classes: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
66
|
+
description: 'Secondary button style'
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'ghost',
|
|
70
|
+
classes: 'hover:bg-accent hover:text-accent-foreground',
|
|
71
|
+
description: 'Ghost button style'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'link',
|
|
75
|
+
classes: 'text-primary underline-offset-4 hover:underline',
|
|
76
|
+
description: 'Link button style'
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
defaultVariant: 'default'
|
|
80
|
+
},
|
|
81
|
+
input: {
|
|
82
|
+
component: 'input',
|
|
83
|
+
variants: [
|
|
84
|
+
{
|
|
85
|
+
name: 'default',
|
|
86
|
+
classes: 'flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
87
|
+
description: 'Default input style'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'destructive',
|
|
91
|
+
classes: 'flex h-10 w-full rounded-md border border-destructive bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-destructive focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
|
|
92
|
+
description: 'Input with destructive border'
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
defaultVariant: 'default'
|
|
96
|
+
},
|
|
97
|
+
badge: {
|
|
98
|
+
component: 'badge',
|
|
99
|
+
variants: [
|
|
100
|
+
{
|
|
101
|
+
name: 'default',
|
|
102
|
+
classes: 'border-transparent bg-primary text-primary-foreground hover:bg-primary/80',
|
|
103
|
+
description: 'Default badge style'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
name: 'secondary',
|
|
107
|
+
classes: 'border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80',
|
|
108
|
+
description: 'Secondary badge style'
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'destructive',
|
|
112
|
+
classes: 'border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80',
|
|
113
|
+
description: 'Destructive badge style'
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
name: 'outline',
|
|
117
|
+
classes: 'text-foreground border',
|
|
118
|
+
description: 'Outline badge style'
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
defaultVariant: 'default'
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export function getComponentVariantConfig(componentName: string): ComponentVariantConfig | null {
|
|
126
|
+
return COMPONENT_VARIANT_CONFIGS[componentName] || null;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function getAllVariantConfigs(): ComponentVariantConfig[] {
|
|
130
|
+
return Object.values(COMPONENT_VARIANT_CONFIGS);
|
|
131
|
+
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2020",
|
|
4
|
+
"module": "CommonJS",
|
|
5
|
+
"outDir": "./dist",
|
|
6
|
+
"rootDir": "./src",
|
|
7
|
+
"strict": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"skipLibCheck": true,
|
|
10
|
+
"forceConsistentCasingInFileNames": true,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"resolveJsonModule": true
|
|
13
|
+
},
|
|
14
|
+
"include": ["src/**/*"],
|
|
15
|
+
"exclude": ["node_modules", "dist"]
|
|
16
|
+
}
|