@xvml/cli 0.1.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 +96 -0
- package/XVML_SPEC.md +1083 -0
- package/dist/XVML_SPEC.md +1083 -0
- package/dist/bin/xvml.js +3 -0
- package/dist/src/agent.js +85 -0
- package/dist/src/cli.js +252 -0
- package/dist/src/index.js +4 -0
- package/dist/src/parser.js +256 -0
- package/dist/src/renderer.js +98 -0
- package/dist/src/styles.js +366 -0
- package/dist/src/templates.js +351 -0
- package/package.json +51 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { parse, ParseError } from './parser.js';
|
|
4
|
+
import { renderChildren, createRenderState } from './templates.js';
|
|
5
|
+
import { BASE_CSS } from './styles.js';
|
|
6
|
+
function esc(s) {
|
|
7
|
+
return s
|
|
8
|
+
.replace(/&/g, '&')
|
|
9
|
+
.replace(/</g, '<')
|
|
10
|
+
.replace(/>/g, '>')
|
|
11
|
+
.replace(/"/g, '"');
|
|
12
|
+
}
|
|
13
|
+
function minifyHtml(html) {
|
|
14
|
+
return html
|
|
15
|
+
.replace(/>\s+</g, '><')
|
|
16
|
+
.replace(/[ \t]{2,}/g, ' ')
|
|
17
|
+
.trim();
|
|
18
|
+
}
|
|
19
|
+
function buildThemeStyles(themes) {
|
|
20
|
+
if (themes.length === 0)
|
|
21
|
+
return '';
|
|
22
|
+
return themes
|
|
23
|
+
.map(t => {
|
|
24
|
+
const vars = Object.entries(t.vars)
|
|
25
|
+
.map(([k, v]) => ` --xvml-${k}:${v};`)
|
|
26
|
+
.join('\n');
|
|
27
|
+
return `:root {\n${vars}\n}`;
|
|
28
|
+
})
|
|
29
|
+
.join('\n');
|
|
30
|
+
}
|
|
31
|
+
async function resolveImports(nodes, basePath, chain) {
|
|
32
|
+
const result = [];
|
|
33
|
+
for (const node of nodes) {
|
|
34
|
+
if (node.command === 'import') {
|
|
35
|
+
const pathArg = node.args[0];
|
|
36
|
+
if (pathArg?.type !== 'string')
|
|
37
|
+
continue;
|
|
38
|
+
const importPath = path.resolve(path.dirname(basePath), pathArg.value);
|
|
39
|
+
if (chain.has(importPath)) {
|
|
40
|
+
throw new ParseError(`Circular import detected: ${importPath}`);
|
|
41
|
+
}
|
|
42
|
+
const source = await fs.readFile(importPath, 'utf-8');
|
|
43
|
+
const importedDoc = parse(source);
|
|
44
|
+
const resolved = await resolveImports(importedDoc.body, importPath, new Set([...chain, importPath]));
|
|
45
|
+
result.push(...resolved);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
const resolvedChildren = await resolveImports(node.children, basePath, chain);
|
|
49
|
+
result.push({ ...node, children: resolvedChildren });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return result;
|
|
53
|
+
}
|
|
54
|
+
export async function renderSource(source, sourcePath, options) {
|
|
55
|
+
const doc = parse(source);
|
|
56
|
+
const flags = new Set(doc.rendererFlags);
|
|
57
|
+
if (options?.minify)
|
|
58
|
+
flags.add('minify');
|
|
59
|
+
if (options?.noScripts)
|
|
60
|
+
flags.add('no-scripts');
|
|
61
|
+
if (options?.rtl)
|
|
62
|
+
flags.add('rtl');
|
|
63
|
+
const body = await resolveImports(doc.body, sourcePath, new Set([path.resolve(sourcePath)]));
|
|
64
|
+
const state = createRenderState(flags);
|
|
65
|
+
const pageTitle = doc.page?.title ?? 'Page';
|
|
66
|
+
// theme: '' means no explicit class → respects prefers-color-scheme via CSS
|
|
67
|
+
const pageTheme = doc.page?.theme ?? '';
|
|
68
|
+
const themeClass = pageTheme && pageTheme !== 'system' ? ` xvml-theme-${esc(pageTheme)}` : '';
|
|
69
|
+
const dir = flags.has('rtl') ? ' dir="rtl"' : '';
|
|
70
|
+
const metaTagsHtml = doc.metaTags
|
|
71
|
+
.map(t => `<meta name="${esc(t.key)}" content="${esc(t.value)}" />`)
|
|
72
|
+
.join('\n');
|
|
73
|
+
const themeStyles = buildThemeStyles(doc.themes);
|
|
74
|
+
const bodyHtml = renderChildren(body, state);
|
|
75
|
+
const html = `<!DOCTYPE html>
|
|
76
|
+
<html lang="en"${dir}>
|
|
77
|
+
<head>
|
|
78
|
+
<meta charset="UTF-8" />
|
|
79
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
80
|
+
<title>${esc(pageTitle)}</title>
|
|
81
|
+
${metaTagsHtml}
|
|
82
|
+
<style>${BASE_CSS}${themeStyles}</style>
|
|
83
|
+
</head>
|
|
84
|
+
<body class="xvml-page${themeClass}">
|
|
85
|
+
${bodyHtml}
|
|
86
|
+
</body>
|
|
87
|
+
</html>`;
|
|
88
|
+
return flags.has('minify') ? minifyHtml(html) : html;
|
|
89
|
+
}
|
|
90
|
+
export async function renderFile(xvmlPath, options) {
|
|
91
|
+
const source = await fs.readFile(xvmlPath, 'utf-8');
|
|
92
|
+
return renderSource(source, path.resolve(xvmlPath), options);
|
|
93
|
+
}
|
|
94
|
+
// Output is always docs/<basename>.html — no subdirectory nesting.
|
|
95
|
+
export function outputPath(inputPath) {
|
|
96
|
+
const name = path.basename(inputPath, '.xvml');
|
|
97
|
+
return path.join('docs', `${name}.html`);
|
|
98
|
+
}
|
|
@@ -0,0 +1,366 @@
|
|
|
1
|
+
export const BASE_CSS = `
|
|
2
|
+
*,*::before,*::after{box-sizing:border-box}
|
|
3
|
+
body{margin:0}
|
|
4
|
+
|
|
5
|
+
/* ── Custom properties (light defaults) ── */
|
|
6
|
+
:root{
|
|
7
|
+
--xvml-color-primary:#6366f1;
|
|
8
|
+
--xvml-color-primary-hover:#4f46e5;
|
|
9
|
+
--xvml-color-bg:#f1f5f9;
|
|
10
|
+
--xvml-color-surface:#ffffff;
|
|
11
|
+
--xvml-color-border:#e2e8f0;
|
|
12
|
+
--xvml-color-text:#0f172a;
|
|
13
|
+
--xvml-color-text-muted:#64748b;
|
|
14
|
+
--xvml-color-text-label:#374151;
|
|
15
|
+
--xvml-color-success:#22c55e;
|
|
16
|
+
--xvml-color-success-bg:#dcfce7;
|
|
17
|
+
--xvml-color-success-text:#166534;
|
|
18
|
+
--xvml-color-warning:#f59e0b;
|
|
19
|
+
--xvml-color-warning-bg:#fef9c3;
|
|
20
|
+
--xvml-color-warning-text:#854d0e;
|
|
21
|
+
--xvml-color-error:#ef4444;
|
|
22
|
+
--xvml-color-error-bg:#fee2e2;
|
|
23
|
+
--xvml-color-error-text:#991b1b;
|
|
24
|
+
--xvml-color-info-bg:#dbeafe;
|
|
25
|
+
--xvml-color-info-text:#1e40af;
|
|
26
|
+
--xvml-font:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,sans-serif;
|
|
27
|
+
--xvml-mono:'Courier New',Courier,monospace;
|
|
28
|
+
--xvml-radius:10px;
|
|
29
|
+
--xvml-radius-sm:6px;
|
|
30
|
+
--xvml-shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.06);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/* ── Auto dark mode (no explicit theme class) ── */
|
|
34
|
+
@media(prefers-color-scheme:dark){
|
|
35
|
+
:root{
|
|
36
|
+
--xvml-color-bg:#0f172a;
|
|
37
|
+
--xvml-color-surface:#1e293b;
|
|
38
|
+
--xvml-color-border:#334155;
|
|
39
|
+
--xvml-color-text:#f1f5f9;
|
|
40
|
+
--xvml-color-text-muted:#94a3b8;
|
|
41
|
+
--xvml-color-text-label:#cbd5e1;
|
|
42
|
+
--xvml-shadow:0 1px 3px rgba(0,0,0,.3);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/* ── Explicit theme overrides (beat the media query via inheritance) ── */
|
|
47
|
+
.xvml-theme-light{
|
|
48
|
+
--xvml-color-bg:#f1f5f9;
|
|
49
|
+
--xvml-color-surface:#ffffff;
|
|
50
|
+
--xvml-color-border:#e2e8f0;
|
|
51
|
+
--xvml-color-text:#0f172a;
|
|
52
|
+
--xvml-color-text-muted:#64748b;
|
|
53
|
+
--xvml-color-text-label:#374151;
|
|
54
|
+
--xvml-shadow:0 1px 3px rgba(0,0,0,.08),0 1px 2px rgba(0,0,0,.06);
|
|
55
|
+
}
|
|
56
|
+
.xvml-theme-dark{
|
|
57
|
+
--xvml-color-bg:#0f172a;
|
|
58
|
+
--xvml-color-surface:#1e293b;
|
|
59
|
+
--xvml-color-border:#334155;
|
|
60
|
+
--xvml-color-text:#f1f5f9;
|
|
61
|
+
--xvml-color-text-muted:#94a3b8;
|
|
62
|
+
--xvml-color-text-label:#cbd5e1;
|
|
63
|
+
--xvml-shadow:0 1px 3px rgba(0,0,0,.3);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ── Page shell ── */
|
|
67
|
+
.xvml-page{
|
|
68
|
+
min-height:100vh;
|
|
69
|
+
padding:24px 20px;
|
|
70
|
+
max-width:960px;
|
|
71
|
+
margin:0 auto;
|
|
72
|
+
background:var(--xvml-color-bg);
|
|
73
|
+
color:var(--xvml-color-text);
|
|
74
|
+
font-family:var(--xvml-font);
|
|
75
|
+
font-size:16px;
|
|
76
|
+
line-height:1.5;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* ── Navigation ── */
|
|
80
|
+
.xvml-nav{
|
|
81
|
+
background:var(--xvml-color-surface);
|
|
82
|
+
border-radius:var(--xvml-radius);
|
|
83
|
+
border:1px solid var(--xvml-color-border);
|
|
84
|
+
padding:0 20px;
|
|
85
|
+
margin-bottom:20px;
|
|
86
|
+
box-shadow:var(--xvml-shadow);
|
|
87
|
+
}
|
|
88
|
+
.xvml-nav__links{
|
|
89
|
+
display:flex;
|
|
90
|
+
list-style:none;
|
|
91
|
+
padding:0;
|
|
92
|
+
margin:0;
|
|
93
|
+
gap:4px;
|
|
94
|
+
flex-wrap:wrap;
|
|
95
|
+
}
|
|
96
|
+
.xvml-nav__link{
|
|
97
|
+
display:block;
|
|
98
|
+
padding:14px 10px;
|
|
99
|
+
color:var(--xvml-color-text-muted);
|
|
100
|
+
text-decoration:none;
|
|
101
|
+
font-size:14px;
|
|
102
|
+
font-weight:500;
|
|
103
|
+
border-bottom:2px solid transparent;
|
|
104
|
+
transition:color .15s,border-color .15s;
|
|
105
|
+
}
|
|
106
|
+
.xvml-nav__link:first-child{color:var(--xvml-color-primary);border-bottom-color:var(--xvml-color-primary)}
|
|
107
|
+
.xvml-nav__link:hover{color:var(--xvml-color-text);border-bottom-color:var(--xvml-color-border)}
|
|
108
|
+
|
|
109
|
+
/* ── Card ── */
|
|
110
|
+
.xvml-card{
|
|
111
|
+
background:var(--xvml-color-surface);
|
|
112
|
+
border-radius:var(--xvml-radius);
|
|
113
|
+
box-shadow:var(--xvml-shadow);
|
|
114
|
+
border:1px solid var(--xvml-color-border);
|
|
115
|
+
padding:24px;
|
|
116
|
+
margin-bottom:20px;
|
|
117
|
+
}
|
|
118
|
+
.xvml-card--flat{box-shadow:none}
|
|
119
|
+
.xvml-card--outlined{box-shadow:none}
|
|
120
|
+
.xvml-card--compact{padding:16px}
|
|
121
|
+
.xvml-card__label{font-size:16px;font-weight:600;margin:0 0 20px;color:var(--xvml-color-text)}
|
|
122
|
+
.xvml-card__body{}
|
|
123
|
+
|
|
124
|
+
/* ── Section ── */
|
|
125
|
+
.xvml-section{margin-bottom:16px}
|
|
126
|
+
.xvml-section--divided{border-top:1px solid var(--xvml-color-border);padding-top:16px}
|
|
127
|
+
.xvml-section__label{
|
|
128
|
+
font-size:11px;font-weight:700;color:var(--xvml-color-text-muted);
|
|
129
|
+
text-transform:uppercase;letter-spacing:.08em;margin:0 0 12px
|
|
130
|
+
}
|
|
131
|
+
.xvml-section__body{}
|
|
132
|
+
|
|
133
|
+
/* ── Layout ── */
|
|
134
|
+
.xvml-layout{display:block}
|
|
135
|
+
.xvml-layout--inline{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
|
|
136
|
+
.xvml-layout--grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(200px,1fr));gap:16px}
|
|
137
|
+
.xvml-layout--center{display:flex;justify-content:center;align-items:center}
|
|
138
|
+
.xvml-layout--fill{display:flex;flex-direction:column;flex:1}
|
|
139
|
+
|
|
140
|
+
/* ── Cols ── */
|
|
141
|
+
.xvml-cols{display:grid;gap:16px}
|
|
142
|
+
.xvml-cols--1{grid-template-columns:1fr}
|
|
143
|
+
.xvml-cols--2{grid-template-columns:repeat(2,1fr)}
|
|
144
|
+
.xvml-cols--3{grid-template-columns:repeat(3,1fr)}
|
|
145
|
+
.xvml-cols--4{grid-template-columns:repeat(4,1fr)}
|
|
146
|
+
.xvml-cols--5{grid-template-columns:repeat(5,1fr)}
|
|
147
|
+
.xvml-cols--6{grid-template-columns:repeat(6,1fr)}
|
|
148
|
+
.xvml-col{}
|
|
149
|
+
|
|
150
|
+
/* ── Avatar ── */
|
|
151
|
+
.xvml-avatar{
|
|
152
|
+
width:60px;height:60px;border-radius:50%;
|
|
153
|
+
background:var(--xvml-color-primary);color:#fff;
|
|
154
|
+
display:flex;align-items:center;justify-content:center;
|
|
155
|
+
font-size:20px;font-weight:700;margin-bottom:16px;
|
|
156
|
+
letter-spacing:-0.5px;user-select:none;flex-shrink:0;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/* ── Title ── */
|
|
160
|
+
.xvml-title{margin:0 0 6px;font-weight:700;line-height:1.2;color:var(--xvml-color-text)}
|
|
161
|
+
.xvml-title--xl{font-size:32px}
|
|
162
|
+
.xvml-title--lg{font-size:24px}
|
|
163
|
+
.xvml-title--md{font-size:20px}
|
|
164
|
+
.xvml-title--sm{font-size:16px}
|
|
165
|
+
|
|
166
|
+
/* ── Subtitle ── */
|
|
167
|
+
.xvml-subtitle{margin:0 0 20px;font-size:15px;color:var(--xvml-color-text-muted)}
|
|
168
|
+
.xvml-subtitle--muted{opacity:.75}
|
|
169
|
+
|
|
170
|
+
/* ── Text ── */
|
|
171
|
+
.xvml-text{margin:0 0 12px;line-height:1.65;color:var(--xvml-color-text)}
|
|
172
|
+
.xvml-text--sm{font-size:13px}
|
|
173
|
+
.xvml-text--muted{color:var(--xvml-color-text-muted)}
|
|
174
|
+
.xvml-text--bold{font-weight:600}
|
|
175
|
+
.xvml-text--mono{font-family:var(--xvml-mono)}
|
|
176
|
+
.xvml-text--error{color:var(--xvml-color-error)}
|
|
177
|
+
.xvml-text--success{color:var(--xvml-color-success)}
|
|
178
|
+
|
|
179
|
+
/* ── Divider ── */
|
|
180
|
+
.xvml-divider{border:none;border-top:1px solid var(--xvml-color-border);margin:20px 0}
|
|
181
|
+
.xvml-divider--dashed{border-top-style:dashed}
|
|
182
|
+
.xvml-divider--thick{border-top-width:2px}
|
|
183
|
+
.xvml-divider--spacious{margin:32px 0}
|
|
184
|
+
.xvml-divider--text{
|
|
185
|
+
display:flex;align-items:center;gap:12px;
|
|
186
|
+
margin:20px 0;color:var(--xvml-color-text-muted);font-size:13px;
|
|
187
|
+
border:none;
|
|
188
|
+
}
|
|
189
|
+
.xvml-divider__line{flex:1;height:1px;background:var(--xvml-color-border)}
|
|
190
|
+
.xvml-divider__text{white-space:nowrap}
|
|
191
|
+
|
|
192
|
+
/* ── Badge ── */
|
|
193
|
+
.xvml-badge{display:inline-flex;align-items:center;padding:2px 8px;border-radius:4px;font-size:12px;font-weight:500}
|
|
194
|
+
.xvml-badge--neutral{background:var(--xvml-color-border);color:var(--xvml-color-text-label)}
|
|
195
|
+
.xvml-badge--success{background:var(--xvml-color-success-bg);color:var(--xvml-color-success-text)}
|
|
196
|
+
.xvml-badge--warning{background:var(--xvml-color-warning-bg);color:var(--xvml-color-warning-text)}
|
|
197
|
+
.xvml-badge--error{background:var(--xvml-color-error-bg);color:var(--xvml-color-error-text)}
|
|
198
|
+
.xvml-badge--info{background:var(--xvml-color-info-bg);color:var(--xvml-color-info-text)}
|
|
199
|
+
|
|
200
|
+
/* ── Field ── */
|
|
201
|
+
.xvml-field{margin-bottom:16px}
|
|
202
|
+
.xvml-field__label{
|
|
203
|
+
display:block;font-size:13px;font-weight:500;
|
|
204
|
+
margin-bottom:5px;color:var(--xvml-color-text-label)
|
|
205
|
+
}
|
|
206
|
+
.xvml-field__input,.xvml-field__textarea{
|
|
207
|
+
display:block;width:100%;padding:9px 12px;
|
|
208
|
+
border:1px solid var(--xvml-color-border);border-radius:var(--xvml-radius-sm);
|
|
209
|
+
font-size:14px;color:var(--xvml-color-text);background:var(--xvml-color-surface);
|
|
210
|
+
font-family:var(--xvml-font);transition:border-color .15s,box-shadow .15s;
|
|
211
|
+
}
|
|
212
|
+
.xvml-field__input:focus,.xvml-field__textarea:focus{
|
|
213
|
+
outline:none;border-color:var(--xvml-color-primary);
|
|
214
|
+
box-shadow:0 0 0 3px rgba(99,102,241,.15);
|
|
215
|
+
}
|
|
216
|
+
.xvml-field__textarea{min-height:80px;resize:vertical}
|
|
217
|
+
|
|
218
|
+
/* ── Button ── */
|
|
219
|
+
.xvml-button{
|
|
220
|
+
display:inline-flex;align-items:center;justify-content:center;
|
|
221
|
+
padding:9px 18px;border:1px solid transparent;
|
|
222
|
+
border-radius:var(--xvml-radius-sm);font-size:14px;font-weight:500;
|
|
223
|
+
cursor:pointer;font-family:var(--xvml-font);transition:opacity .15s,background .15s;
|
|
224
|
+
text-decoration:none;
|
|
225
|
+
}
|
|
226
|
+
.xvml-button--default{background:var(--xvml-color-surface);border-color:var(--xvml-color-border);color:var(--xvml-color-text-label)}
|
|
227
|
+
.xvml-button--primary{background:var(--xvml-color-primary);color:#fff;border-color:var(--xvml-color-primary)}
|
|
228
|
+
.xvml-button--primary:hover{background:var(--xvml-color-primary-hover)}
|
|
229
|
+
.xvml-button--secondary{background:var(--xvml-color-surface);border-color:var(--xvml-color-border);color:var(--xvml-color-text)}
|
|
230
|
+
.xvml-button--danger{background:var(--xvml-color-error);color:#fff;border-color:var(--xvml-color-error)}
|
|
231
|
+
.xvml-button--ghost{background:transparent;color:var(--xvml-color-primary);border-color:transparent}
|
|
232
|
+
.xvml-button--link{background:transparent;border-color:transparent;color:var(--xvml-color-primary);text-decoration:underline;padding:0}
|
|
233
|
+
.xvml-button--sm{padding:5px 12px;font-size:12px}
|
|
234
|
+
.xvml-button--lg{padding:12px 24px;font-size:16px}
|
|
235
|
+
.xvml-button--full{width:100%}
|
|
236
|
+
.xvml-button:disabled{opacity:.5;cursor:not-allowed}
|
|
237
|
+
|
|
238
|
+
/* ── Checkbox ── */
|
|
239
|
+
.xvml-checkbox{display:inline-flex;align-items:center;gap:8px;cursor:pointer;font-size:14px;color:var(--xvml-color-text)}
|
|
240
|
+
.xvml-checkbox__input{width:16px;height:16px;accent-color:var(--xvml-color-primary)}
|
|
241
|
+
|
|
242
|
+
/* ── Select ── */
|
|
243
|
+
.xvml-select{margin-bottom:16px}
|
|
244
|
+
.xvml-select__label{display:block;font-size:13px;font-weight:500;margin-bottom:5px;color:var(--xvml-color-text-label)}
|
|
245
|
+
.xvml-select__input{
|
|
246
|
+
display:block;width:100%;padding:9px 12px;
|
|
247
|
+
border:1px solid var(--xvml-color-border);border-radius:var(--xvml-radius-sm);
|
|
248
|
+
font-size:14px;color:var(--xvml-color-text);background:var(--xvml-color-surface);
|
|
249
|
+
font-family:var(--xvml-font);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
/* ── Link ── */
|
|
253
|
+
.xvml-link{display:inline-block;margin-top:4px;color:var(--xvml-color-primary);text-decoration:none;font-size:14px}
|
|
254
|
+
.xvml-link:hover{text-decoration:underline}
|
|
255
|
+
|
|
256
|
+
/* ── Stats grid ── */
|
|
257
|
+
.xvml-stats{
|
|
258
|
+
display:grid;
|
|
259
|
+
grid-template-columns:repeat(auto-fit,minmax(150px,1fr));
|
|
260
|
+
gap:16px;
|
|
261
|
+
margin-bottom:20px;
|
|
262
|
+
}
|
|
263
|
+
.xvml-stat-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(120px,1fr));gap:12px;margin-bottom:16px}
|
|
264
|
+
|
|
265
|
+
/* ── Stat ── */
|
|
266
|
+
.xvml-stat{
|
|
267
|
+
padding:20px;background:var(--xvml-color-surface);
|
|
268
|
+
border-radius:var(--xvml-radius);border:1px solid var(--xvml-color-border);
|
|
269
|
+
box-shadow:var(--xvml-shadow);
|
|
270
|
+
}
|
|
271
|
+
.xvml-stat__value{display:block;font-size:28px;font-weight:700;color:var(--xvml-color-text);line-height:1}
|
|
272
|
+
.xvml-stat__label{
|
|
273
|
+
display:block;font-size:13px;color:var(--xvml-color-text-muted);
|
|
274
|
+
margin-top:4px;
|
|
275
|
+
}
|
|
276
|
+
.xvml-stat__trend{font-size:13px;margin-left:4px}
|
|
277
|
+
.xvml-stat__trend--up{color:var(--xvml-color-success)}
|
|
278
|
+
.xvml-stat__trend--down{color:var(--xvml-color-error)}
|
|
279
|
+
.xvml-stat__trend--neutral{color:var(--xvml-color-text-muted)}
|
|
280
|
+
|
|
281
|
+
/* ── Table ── */
|
|
282
|
+
.xvml-table-wrapper{overflow-x:auto;margin-bottom:16px}
|
|
283
|
+
.xvml-table{width:100%;border-collapse:collapse;font-size:14px}
|
|
284
|
+
.xvml-table th{
|
|
285
|
+
padding:10px 14px;text-align:left;font-weight:600;font-size:12px;
|
|
286
|
+
text-transform:uppercase;letter-spacing:.04em;
|
|
287
|
+
border-bottom:2px solid var(--xvml-color-border);color:var(--xvml-color-text-muted)
|
|
288
|
+
}
|
|
289
|
+
.xvml-table td{padding:12px 14px;border-bottom:1px solid var(--xvml-color-border);color:var(--xvml-color-text)}
|
|
290
|
+
.xvml-table--striped tbody tr:nth-child(even) td{background:var(--xvml-color-bg)}
|
|
291
|
+
.xvml-table--compact th,.xvml-table--compact td{padding:6px 10px}
|
|
292
|
+
.xvml-table--bordered th,.xvml-table--bordered td{border:1px solid var(--xvml-color-border)}
|
|
293
|
+
|
|
294
|
+
/* ── Progress ── */
|
|
295
|
+
.xvml-progress{margin-bottom:16px}
|
|
296
|
+
.xvml-progress__header{display:flex;justify-content:space-between;margin-bottom:6px}
|
|
297
|
+
.xvml-progress__label{font-size:14px;font-weight:500;color:var(--xvml-color-text)}
|
|
298
|
+
.xvml-progress__value{font-size:13px;color:var(--xvml-color-text-muted)}
|
|
299
|
+
.xvml-progress__track{background:var(--xvml-color-border);border-radius:9999px;height:8px}
|
|
300
|
+
.xvml-progress__fill{height:8px;border-radius:9999px;background:var(--xvml-color-primary)}
|
|
301
|
+
.xvml-progress__fill--success{background:var(--xvml-color-success)}
|
|
302
|
+
.xvml-progress__fill--warning{background:var(--xvml-color-warning)}
|
|
303
|
+
.xvml-progress__fill--error{background:var(--xvml-color-error)}
|
|
304
|
+
|
|
305
|
+
/* ── List ── */
|
|
306
|
+
.xvml-list{padding-left:20px;margin:0 0 12px}
|
|
307
|
+
.xvml-list--unordered{list-style:disc}
|
|
308
|
+
.xvml-list--ordered{list-style:decimal}
|
|
309
|
+
.xvml-list--check{list-style:none;padding-left:0}
|
|
310
|
+
.xvml-list--check .xvml-list__item::before{content:"✓ ";color:var(--xvml-color-success);font-weight:700}
|
|
311
|
+
.xvml-list__item{padding:3px 0;line-height:1.6}
|
|
312
|
+
|
|
313
|
+
/* ── Codeblock ── */
|
|
314
|
+
.xvml-codeblock{margin-bottom:16px;border-radius:var(--xvml-radius);overflow:hidden;border:1px solid var(--xvml-color-border)}
|
|
315
|
+
.xvml-codeblock__header{
|
|
316
|
+
display:flex;align-items:center;gap:8px;padding:8px 14px;
|
|
317
|
+
background:var(--xvml-color-bg);border-bottom:1px solid var(--xvml-color-border);font-size:12px
|
|
318
|
+
}
|
|
319
|
+
.xvml-codeblock__lang{font-weight:600;color:var(--xvml-color-primary);font-family:var(--xvml-mono)}
|
|
320
|
+
.xvml-codeblock__filename{color:var(--xvml-color-text-muted)}
|
|
321
|
+
.xvml-codeblock__pre{margin:0;padding:16px;background:#1e293b;overflow-x:auto}
|
|
322
|
+
.xvml-codeblock__code{font-family:var(--xvml-mono);font-size:13px;color:#e2e8f0;white-space:pre}
|
|
323
|
+
|
|
324
|
+
/* ── Constraint ── */
|
|
325
|
+
.xvml-constraint{
|
|
326
|
+
display:flex;align-items:flex-start;gap:10px;padding:12px 14px;
|
|
327
|
+
border-radius:var(--xvml-radius-sm);margin-bottom:8px;
|
|
328
|
+
background:var(--xvml-color-bg);border-left:3px solid var(--xvml-color-primary)
|
|
329
|
+
}
|
|
330
|
+
.xvml-constraint--must{border-left-color:var(--xvml-color-error)}
|
|
331
|
+
.xvml-constraint--should{border-left-color:var(--xvml-color-warning)}
|
|
332
|
+
.xvml-constraint--may{border-left-color:var(--xvml-color-success)}
|
|
333
|
+
.xvml-constraint__severity{
|
|
334
|
+
font-size:10px;font-weight:800;padding:2px 6px;border-radius:3px;
|
|
335
|
+
white-space:nowrap;background:var(--xvml-color-error);color:#fff;flex-shrink:0;margin-top:1px;
|
|
336
|
+
}
|
|
337
|
+
.xvml-constraint--should .xvml-constraint__severity{background:var(--xvml-color-warning)}
|
|
338
|
+
.xvml-constraint--may .xvml-constraint__severity{background:var(--xvml-color-success)}
|
|
339
|
+
.xvml-constraint__name{font-weight:600;font-family:var(--xvml-mono);font-size:13px;flex-shrink:0;color:var(--xvml-color-text)}
|
|
340
|
+
.xvml-constraint__desc{margin:0;font-size:14px;color:var(--xvml-color-text-muted);flex:1}
|
|
341
|
+
|
|
342
|
+
/* ── Alert ── */
|
|
343
|
+
.xvml-alert{
|
|
344
|
+
display:flex;align-items:flex-start;gap:10px;
|
|
345
|
+
padding:12px 14px;border-radius:var(--xvml-radius-sm);margin-bottom:12px;
|
|
346
|
+
border:1px solid transparent;
|
|
347
|
+
}
|
|
348
|
+
.xvml-alert--info{background:var(--xvml-color-info-bg);color:var(--xvml-color-info-text);border-color:rgba(30,64,175,.2)}
|
|
349
|
+
.xvml-alert--success{background:var(--xvml-color-success-bg);color:var(--xvml-color-success-text);border-color:rgba(22,101,52,.2)}
|
|
350
|
+
.xvml-alert--warning{background:var(--xvml-color-warning-bg);color:var(--xvml-color-warning-text);border-color:rgba(133,77,14,.2)}
|
|
351
|
+
.xvml-alert--error{background:var(--xvml-color-error-bg);color:var(--xvml-color-error-text);border-color:rgba(153,27,27,.2)}
|
|
352
|
+
.xvml-alert__icon{font-size:15px;flex-shrink:0;margin-top:1px}
|
|
353
|
+
.xvml-alert__message{font-size:14px;font-weight:500;line-height:1.5}
|
|
354
|
+
|
|
355
|
+
/* ── Responsive ── */
|
|
356
|
+
@media(max-width:640px){
|
|
357
|
+
.xvml-page{padding:16px 12px}
|
|
358
|
+
.xvml-cols--2,.xvml-cols--3,.xvml-cols--4,.xvml-cols--5,.xvml-cols--6{
|
|
359
|
+
grid-template-columns:1fr
|
|
360
|
+
}
|
|
361
|
+
.xvml-stats{grid-template-columns:repeat(2,1fr)}
|
|
362
|
+
.xvml-stat-row{grid-template-columns:repeat(2,1fr)}
|
|
363
|
+
.xvml-stat__value{font-size:22px}
|
|
364
|
+
.xvml-nav__links{gap:0}
|
|
365
|
+
}
|
|
366
|
+
`.trim();
|