@aliens-syndicate/cli 0.1.2 → 0.1.4
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.es-ES.md +53 -10
- package/README.md +53 -10
- package/README.pt-BR.md +53 -10
- package/README.zh-CN.md +53 -10
- package/package.json +6 -1
- package/tools/build.mjs +372 -36
- package/tools/cache.mjs +41 -0
- package/tools/cli-shared.mjs +237 -0
- package/tools/cli.mjs +145 -48
- package/tools/create.mjs +207 -78
- package/tools/doctor.mjs +139 -0
- package/tools/generate.mjs +175 -0
- package/tools/icon-docs.mjs +132 -0
- package/tools/project-layout.mjs +3 -3
- package/tools/runtime.mjs +216 -8
- package/tools/serve.mjs +152 -0
- package/tools/starter/ai/agents/codingbot.agent +5 -0
- package/tools/starter/ai/rules/architecture.rule +12 -0
- package/tools/starter/ai/skills/create-element.skill +7 -0
- package/tools/starter/app/elements/molecules/kit-card-link/kit-card-link.markup +0 -2
- package/tools/starter/app/pages/kit-overview/kit-overview.markup +6 -6
- package/tools/starter/app/pages/style-guide/style-guide.style +57 -57
- package/tools/starter/styles/components/alerts.style +6 -5
- package/tools/starter/styles/components/badges.style +6 -5
- package/tools/starter/styles/components/borders.style +2 -1
- package/tools/starter/styles/components/buttons.style +14 -13
- package/tools/starter/styles/components/cards.style +1 -1
- package/tools/starter/styles/components/feedback.style +3 -2
- package/tools/starter/styles/components/forms.style +5 -4
- package/tools/starter/styles/components/tables.style +4 -3
- package/tools/starter/styles/components/typography.style +6 -5
- package/tools/starter/styles/generic/ui-base.style +1 -1
- package/tools/starter/styles/objects/ui-layout.style +1 -1
- package/tools/style-docs.mjs +274 -0
- package/tools/update.mjs +110 -0
- package/tools/vscode-space/package.json +5 -8
- package/tools/vscode-space/space.tmLanguage.json +1 -1
- package/tools/vscode-space/syntax.cjs +103 -62
- package/tools/watch.mjs +48 -0
package/tools/serve.mjs
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
// aliens run: builds the project, serves dist/ on port 5151 and rebuilds and reloads the browser on every saved file.
|
|
2
|
+
import { watch } from 'node:fs';
|
|
3
|
+
import { readFile, stat } from 'node:fs/promises';
|
|
4
|
+
import { createServer } from 'node:http';
|
|
5
|
+
import { networkInterfaces } from 'node:os';
|
|
6
|
+
import { extname, join, normalize, relative, sep } from 'node:path';
|
|
7
|
+
import {
|
|
8
|
+
CliError, bold, cyan, defaultPort, dim, green, parseFlags, pick, readConfig, red, requireProject, runBuild
|
|
9
|
+
} from './cli-shared.mjs';
|
|
10
|
+
|
|
11
|
+
const text = {
|
|
12
|
+
en: { ready: 'Aliens dev server ready', local: 'Local', network: 'Network', watching: 'Watching files. Each save rebuilds and reloads the browser (Ctrl+C to stop).',
|
|
13
|
+
rebuilt: 'Rebuilt in {ms} ms', failed: 'Build failed. Fix the error above; the browser shows it too.', badPort: '--port takes a number from 1 to 65535.',
|
|
14
|
+
inUse: 'Port {port} is in use. Stop the other server or run aliens run --port <number>.',
|
|
15
|
+
denied: 'This system does not let you open port {port} without administrator rights. Run aliens run --port <number>, or set serve: port: in .config.' },
|
|
16
|
+
pt: { ready: 'Servidor Aliens pronto', local: 'Local', network: 'Rede', watching: 'Observando os arquivos. Cada arquivo salvo refaz o build e recarrega o navegador (Ctrl+C para parar).',
|
|
17
|
+
rebuilt: 'Build refeito em {ms} ms', failed: 'O build falhou. Corrija o erro acima; o navegador também mostra o erro.', badPort: '--port recebe um número de 1 a 65535.',
|
|
18
|
+
inUse: 'A porta {port} está em uso. Pare o outro servidor ou rode aliens run --port <número>.',
|
|
19
|
+
denied: 'Este sistema não deixa abrir a porta {port} sem permissão de administrador. Rode aliens run --port <número> ou defina serve: port: no .config.' },
|
|
20
|
+
es: { ready: 'Servidor Aliens listo', local: 'Local', network: 'Red', watching: 'Observando los archivos. Cada archivo guardado rehace el build y recarga el navegador (Ctrl+C para detener).',
|
|
21
|
+
rebuilt: 'Build rehecho en {ms} ms', failed: 'El build falló. Corrige el error de arriba; el navegador también lo muestra.', badPort: '--port recibe un número de 1 a 65535.',
|
|
22
|
+
inUse: 'El puerto {port} está en uso. Detén el otro servidor o ejecuta aliens run --port <número>.',
|
|
23
|
+
denied: 'Este sistema no permite abrir el puerto {port} sin permisos de administrador. Ejecuta aliens run --port <número> o define serve: port: en .config.' },
|
|
24
|
+
zh: { ready: 'Aliens 开发服务器已就绪', local: '本机', network: '网络', watching: '正在监听文件。每次保存都会重新构建并刷新浏览器(按 Ctrl+C 停止)。',
|
|
25
|
+
rebuilt: '{ms} 毫秒内完成重新构建', failed: '构建失败。请修复上面的错误;浏览器中也会显示。', badPort: '--port 接受 1 到 65535 之间的数字。',
|
|
26
|
+
inUse: '端口 {port} 已被占用。请停止另一个服务器,或运行 aliens run --port <端口>。',
|
|
27
|
+
denied: '此系统不允许在没有管理员权限的情况下打开端口 {port}。请运行 aliens run --port <端口>,或在 .config 中设置 serve: port:。' }
|
|
28
|
+
};
|
|
29
|
+
const t = (key, values = {}) => Object.entries(values).reduce((message, [name, value]) => message.replaceAll(`{${name}}`, value), pick(text)[key]);
|
|
30
|
+
|
|
31
|
+
const types = {
|
|
32
|
+
'.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.mjs': 'text/javascript; charset=utf-8',
|
|
33
|
+
'.css': 'text/css; charset=utf-8', '.json': 'application/json; charset=utf-8', '.svg': 'image/svg+xml', '.png': 'image/png',
|
|
34
|
+
'.jpg': 'image/jpeg', '.jpeg': 'image/jpeg', '.gif': 'image/gif', '.webp': 'image/webp', '.avif': 'image/avif',
|
|
35
|
+
'.ico': 'image/x-icon', '.woff': 'font/woff', '.woff2': 'font/woff2', '.ttf': 'font/ttf', '.otf': 'font/otf',
|
|
36
|
+
'.txt': 'text/plain; charset=utf-8', '.mp4': 'video/mp4', '.webm': 'video/webm', '.mp3': 'audio/mpeg', '.wasm': 'application/wasm'
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// The page listens to /__aliens/events: "reload" after a good build, "build-error" with the message after a failed one.
|
|
40
|
+
const client = `<script>(() => {
|
|
41
|
+
const events = new EventSource('/__aliens/events');
|
|
42
|
+
let box;
|
|
43
|
+
events.addEventListener('reload', () => location.reload());
|
|
44
|
+
events.addEventListener('build-error', event => {
|
|
45
|
+
if (!event.data) return;
|
|
46
|
+
box ??= document.body.appendChild(Object.assign(document.createElement('pre'), { id: 'aliens-build-error' }));
|
|
47
|
+
box.style.cssText = 'position:fixed;inset:auto 16px 16px 16px;z-index:2147483647;max-height:60vh;overflow:auto;margin:0;padding:16px 18px;' +
|
|
48
|
+
'border:1px solid #f87171;border-radius:10px;background:#1f1416;color:#fecaca;font:13px/1.5 ui-monospace,monospace;white-space:pre-wrap;overflow-wrap:anywhere';
|
|
49
|
+
box.textContent = event.data;
|
|
50
|
+
});
|
|
51
|
+
})();</script>`;
|
|
52
|
+
|
|
53
|
+
function addresses(port) {
|
|
54
|
+
const found = Object.values(networkInterfaces()).flat().filter(entry => entry && entry.family === 'IPv4' && !entry.internal);
|
|
55
|
+
return found.map(entry => `http://${entry.address}:${port}`);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export async function serve(args) {
|
|
59
|
+
const { flags } = parseFlags(args, { values: ['port'], aliases: { p: 'port' } });
|
|
60
|
+
const root = requireProject();
|
|
61
|
+
const configured = readConfig(root).serve?.port;
|
|
62
|
+
const port = Number(flags.port ?? configured ?? defaultPort);
|
|
63
|
+
if (!Number.isInteger(port) || port < 1 || port > 65535) throw new CliError(t('badPort'));
|
|
64
|
+
const output = join(root, 'dist');
|
|
65
|
+
const clients = new Set();
|
|
66
|
+
let lastError = '';
|
|
67
|
+
const send = (event, data = '') => {
|
|
68
|
+
const payload = `event: ${event}\ndata: ${data.split('\n').join('\ndata: ')}\n\n`;
|
|
69
|
+
for (const response of clients) response.write(payload);
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
const server = createServer(async (request, response) => {
|
|
73
|
+
const path = decodeURIComponent(new URL(request.url, 'http://localhost').pathname);
|
|
74
|
+
if (path === '/__aliens/events') {
|
|
75
|
+
response.writeHead(200, { 'Content-Type': 'text/event-stream', 'Cache-Control': 'no-cache', Connection: 'keep-alive' });
|
|
76
|
+
response.write(lastError ? `event: build-error\ndata: ${lastError.split('\n').join('\ndata: ')}\n\n` : ': connected\n\n');
|
|
77
|
+
clients.add(response);
|
|
78
|
+
request.on('close', () => clients.delete(response));
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
// Paths without an extension open index.html, so a route reloads on its own address.
|
|
82
|
+
let file = normalize(join(output, path.endsWith('/') || !extname(path) ? 'index.html' : path));
|
|
83
|
+
if (relative(output, file).startsWith('..')) file = join(output, 'index.html');
|
|
84
|
+
try {
|
|
85
|
+
if (!(await stat(file)).isFile()) throw new Error('not a file');
|
|
86
|
+
let body = await readFile(file);
|
|
87
|
+
if (file.endsWith('.html')) body = body.toString('utf8').replace('</body>', `${client}\n</body>`);
|
|
88
|
+
response.writeHead(200, { 'Content-Type': types[extname(file).toLowerCase()] ?? 'application/octet-stream', 'Cache-Control': 'no-store' });
|
|
89
|
+
response.end(body);
|
|
90
|
+
} catch {
|
|
91
|
+
// Before the first good build there is no index.html: an empty page still shows the error and reloads.
|
|
92
|
+
const page = file.endsWith('index.html');
|
|
93
|
+
response.writeHead(page ? 200 : 404, { 'Content-Type': page ? types['.html'] : 'text/plain; charset=utf-8' });
|
|
94
|
+
response.end(page ? `<!doctype html><meta charset="utf-8"><title>Aliens</title><body>${client}</body>` : '404');
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const firstBuild = await runBuild(root, { quiet: true, onError: message => { lastError = message; } });
|
|
99
|
+
if (firstBuild) console.error(red(t('failed')));
|
|
100
|
+
|
|
101
|
+
// The server listens on every interface, so the Network address opens the site on other devices.
|
|
102
|
+
await new Promise((resolvePromise, reject) => {
|
|
103
|
+
server.once('error', error => reject(error.code === 'EADDRINUSE' ? new CliError(t('inUse', { port }))
|
|
104
|
+
: error.code === 'EACCES' ? new CliError(t('denied', { port })) : error));
|
|
105
|
+
server.listen(port, resolvePromise);
|
|
106
|
+
});
|
|
107
|
+
console.log(`\n ${green('▲')} ${bold(t('ready'))}\n`);
|
|
108
|
+
console.log(` ${t('local').padEnd(9)}${cyan(`http://localhost:${port}`)}`);
|
|
109
|
+
for (const address of addresses(port)) console.log(` ${t('network').padEnd(9)}${dim(address)}`);
|
|
110
|
+
console.log(`\n ${dim(t('watching'))}\n`);
|
|
111
|
+
|
|
112
|
+
// The build writes dist/ and the .map itself, so those changes never start another build.
|
|
113
|
+
const ignored = new Set(['dist', 'node_modules', '.git', '.DS_Store']);
|
|
114
|
+
const skip = file => file.split(sep).some(part => ignored.has(part)) || file.endsWith('.map');
|
|
115
|
+
let running = false;
|
|
116
|
+
let pending = false;
|
|
117
|
+
let timer;
|
|
118
|
+
async function rebuild() {
|
|
119
|
+
if (running) {
|
|
120
|
+
pending = true;
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
running = true;
|
|
124
|
+
const started = Date.now();
|
|
125
|
+
lastError = '';
|
|
126
|
+
const code = await runBuild(root, { quiet: true, onError: message => { lastError = message; } });
|
|
127
|
+
if (code) {
|
|
128
|
+
console.error(red(t('failed')));
|
|
129
|
+
send('build-error', lastError);
|
|
130
|
+
} else {
|
|
131
|
+
console.log(`${green('✓')} ${t('rebuilt', { ms: Date.now() - started })}`);
|
|
132
|
+
send('reload');
|
|
133
|
+
}
|
|
134
|
+
running = false;
|
|
135
|
+
if (pending) {
|
|
136
|
+
pending = false;
|
|
137
|
+
rebuild();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
watch(root, { recursive: true }, (event, file) => {
|
|
141
|
+
if (!file || skip(file)) return;
|
|
142
|
+
clearTimeout(timer);
|
|
143
|
+
timer = setTimeout(rebuild, 120);
|
|
144
|
+
});
|
|
145
|
+
// Keep the process alive until Ctrl+C; close the event streams so the browser does not wait on them.
|
|
146
|
+
process.on('SIGINT', () => {
|
|
147
|
+
for (const response of clients) response.end();
|
|
148
|
+
server.close();
|
|
149
|
+
process.exit(0);
|
|
150
|
+
});
|
|
151
|
+
await new Promise(() => {});
|
|
152
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Agent Codingbot
|
|
2
|
+
# CodingBot starts every task at ai/.map and follows the rules in ai/rules/.
|
|
3
|
+
# Before editing a file, it reads that file's entries under directives: in ai/.map; they come from #AGENT comments.
|
|
4
|
+
# It edits only the Space files of the Element involved and runs node tools/build.mjs after each change.
|
|
5
|
+
# It fixes each build error by file and line until the build passes.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Rule Architecture
|
|
2
|
+
# Use Space for every Aliens application, page, Element, and named source file.
|
|
3
|
+
# Start each named file with its type and PascalCase name, derived from its filename.
|
|
4
|
+
# The declaration for project/app/app.markup is Markup App. Other examples are Style App and Pipe Currency.
|
|
5
|
+
# Use three spaces per indentation level, explicit types for logic and contracts, and declarative comments.
|
|
6
|
+
# Keep app, assets, language, and styles in project. Keep README.md, .config, and ai at the workspace root.
|
|
7
|
+
# Place pages under project/app/pages and reusable Elements under project/app/elements.
|
|
8
|
+
# Compose atoms into molecules, organisms, and templates. A reusable Element does not depend on a page.
|
|
9
|
+
# Keep the .markup, .logic, .style, and .test files of an Element together in its folder.
|
|
10
|
+
# Use .style for element stylesheets and the global layers declared in project/styles/main.style.
|
|
11
|
+
# In .style, write plain CSS as property: value. Utility class names, like flex gap-4 md:flex-row, need npm install @aliens-syndicate/style and style: from: @aliens-syndicate/style in .config.
|
|
12
|
+
# Ready-made Elements, like ui-button and ui-card, need npm install @aliens-syndicate/elements and elements: from: @aliens-syndicate/elements in .config; ai/.map then lists them.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Skill CreateElement
|
|
2
|
+
# Create an Element in project/app/elements/<level>/<name>/, where level is atoms, molecules, organisms, or templates.
|
|
3
|
+
# Start with aliens g element <level>/<name>: it writes the four files with their declarations and keeps any file that already exists.
|
|
4
|
+
# Name every file after its folder: <name>.markup renders, <name>.logic behaves, <name>.style styles, <name>.test lists checks.
|
|
5
|
+
# Start each file with its declaration, like Markup ProductCard for product-card.markup.
|
|
6
|
+
# Prefix every id and variant with the Element name, like product-card-title.
|
|
7
|
+
# Run aliens build (or node tools/build.mjs) and fix each error by file and line.
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
Markup KitCardLink
|
|
2
2
|
a href={$href} variant="space-card kit-card-link space-focus"
|
|
3
|
-
span={$preview} variant="kit-card-link-icon" aria-hidden="true"
|
|
4
3
|
h3={$label} variant="space-h5"
|
|
5
4
|
span={$caption} variant="kit-card-link-caption"
|
|
6
|
-
span={↗} variant="kit-card-link-arrow" aria-hidden="true"
|
|
@@ -17,9 +17,9 @@ Markup KitOverview
|
|
|
17
17
|
section id="kit-overview-section" variant="space-stack"
|
|
18
18
|
h2={@kit.explore} variant="space-h3"
|
|
19
19
|
div id="kit-overview-entry-grid" variant="space-grid"
|
|
20
|
-
kit-card-link href="#kit-color" label={@kit.color} caption={@kit.colorDesc}
|
|
21
|
-
kit-card-link href="#kit-space" label={@kit.spacing} caption={@kit.spacingDesc}
|
|
22
|
-
kit-card-link href="#kit-radius" label={@kit.radius} caption={@kit.radiusDesc}
|
|
23
|
-
kit-card-link href="#kit-border" label={@kit.borders} caption={@kit.borderDesc}
|
|
24
|
-
kit-card-link href="#kit-type" label={@kit.typography} caption={@kit.typeDesc}
|
|
25
|
-
kit-card-link href="#kit-components" label={@kit.components} caption={@kit.componentDesc}
|
|
20
|
+
kit-card-link href="#kit-color" label={@kit.color} caption={@kit.colorDesc}
|
|
21
|
+
kit-card-link href="#kit-space" label={@kit.spacing} caption={@kit.spacingDesc}
|
|
22
|
+
kit-card-link href="#kit-radius" label={@kit.radius} caption={@kit.radiusDesc}
|
|
23
|
+
kit-card-link href="#kit-border" label={@kit.borders} caption={@kit.borderDesc}
|
|
24
|
+
kit-card-link href="#kit-type" label={@kit.typography} caption={@kit.typeDesc}
|
|
25
|
+
kit-card-link href="#kit-components" label={@kit.components} caption={@kit.componentDesc}
|
|
@@ -2,9 +2,12 @@ Style StyleGuide
|
|
|
2
2
|
style-guide
|
|
3
3
|
display: none
|
|
4
4
|
max-width: 1200px
|
|
5
|
-
margin: 0
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
margin-block: 0
|
|
6
|
+
margin-inline: auto
|
|
7
|
+
padding-top: 0
|
|
8
|
+
padding-inline: clamp(var(--space-4),5vw,var(--space-7))
|
|
9
|
+
padding-bottom: var(--space-8)
|
|
10
|
+
background-color: var(--color-canvas)
|
|
8
11
|
style-guide:has([data-view]:not([hidden]))
|
|
9
12
|
display: block
|
|
10
13
|
kit-navigation-top
|
|
@@ -20,13 +23,13 @@ Style StyleGuide
|
|
|
20
23
|
gap: var(--space-3)
|
|
21
24
|
color: var(--color-text)
|
|
22
25
|
font-weight: var(--weight-bold)
|
|
23
|
-
text-decoration: none
|
|
26
|
+
text-decoration-line: none
|
|
24
27
|
kit-navigation-mark
|
|
25
|
-
width:
|
|
26
|
-
height:
|
|
27
|
-
background: var(--color-brand)
|
|
28
|
+
width: 0.875rem
|
|
29
|
+
height: 0.875rem
|
|
30
|
+
background-color: var(--color-brand)
|
|
28
31
|
border-radius: var(--radius-sm)
|
|
29
|
-
|
|
32
|
+
rotate: 45deg
|
|
30
33
|
kit-navigation-theme-field
|
|
31
34
|
display: flex
|
|
32
35
|
align-items: center
|
|
@@ -42,19 +45,18 @@ Style StyleGuide
|
|
|
42
45
|
padding-block: var(--space-3)
|
|
43
46
|
border-block: var(--border-subtle)
|
|
44
47
|
kit-nav-link
|
|
45
|
-
padding: var(--space-2)
|
|
48
|
+
padding-block: var(--space-2)
|
|
49
|
+
padding-inline: var(--space-3)
|
|
46
50
|
border-radius: var(--radius-md)
|
|
47
51
|
color: var(--color-muted)
|
|
48
|
-
text-decoration: none
|
|
52
|
+
text-decoration-line: none
|
|
49
53
|
font-size: var(--text-small)
|
|
50
54
|
kit-nav-link:hover, kit-nav-link[aria-current="page"]
|
|
51
55
|
color: var(--color-on-accent)
|
|
52
|
-
background: var(--color-accent)
|
|
56
|
+
background-color: var(--color-accent)
|
|
53
57
|
style-guide-view
|
|
54
58
|
scroll-margin-top: var(--space-4)
|
|
55
59
|
min-width: 0
|
|
56
|
-
style-guide-view:focus
|
|
57
|
-
outline: none
|
|
58
60
|
kit-overview-hero
|
|
59
61
|
display: grid
|
|
60
62
|
grid-template-columns: 1.1fr 1fr
|
|
@@ -70,12 +72,12 @@ Style StyleGuide
|
|
|
70
72
|
gap: var(--space-4)
|
|
71
73
|
padding: var(--space-6)
|
|
72
74
|
border-radius: var(--radius-xl)
|
|
73
|
-
background: var(--color-accent)
|
|
75
|
+
background-color: var(--color-accent)
|
|
74
76
|
color: var(--color-on-accent)
|
|
75
77
|
kit-overview-hero-type
|
|
76
|
-
font-size: clamp(5rem,
|
|
78
|
+
font-size: clamp(5rem,12vw,8rem)
|
|
77
79
|
line-height: 1
|
|
78
|
-
letter-spacing: -.
|
|
80
|
+
letter-spacing: -.028em
|
|
79
81
|
kit-overview-hero-scales
|
|
80
82
|
display: flex
|
|
81
83
|
gap: var(--space-2)
|
|
@@ -96,19 +98,14 @@ Style StyleGuide
|
|
|
96
98
|
flex-direction: column
|
|
97
99
|
gap: var(--space-3)
|
|
98
100
|
color: var(--color-text)
|
|
99
|
-
text-decoration: none
|
|
100
|
-
kit-card-link:hover
|
|
101
|
-
border-color: var(--color-brand)
|
|
102
|
-
kit-card-link-icon
|
|
103
|
-
font-size: 2rem
|
|
104
|
-
color: var(--color-brand)
|
|
101
|
+
text-decoration-line: none
|
|
105
102
|
style-guide-page-heading
|
|
106
103
|
display: grid
|
|
107
104
|
gap: var(--space-3)
|
|
108
105
|
margin-bottom: var(--space-4)
|
|
109
106
|
kit-color-swatch-grid
|
|
110
107
|
display: grid
|
|
111
|
-
grid-template-columns: repeat(auto-fit,
|
|
108
|
+
grid-template-columns: repeat(auto-fit,minmax(min(100%,10rem),1fr))
|
|
112
109
|
gap: var(--space-4)
|
|
113
110
|
kit-color-swatch
|
|
114
111
|
overflow: hidden
|
|
@@ -125,31 +122,33 @@ Style StyleGuide
|
|
|
125
122
|
padding-block: var(--space-3)
|
|
126
123
|
kit-space-bar
|
|
127
124
|
height: 1rem
|
|
128
|
-
background: var(--color-brand)
|
|
125
|
+
background-color: var(--color-brand)
|
|
129
126
|
border-radius: var(--radius-sm)
|
|
130
127
|
kit-radius-shape
|
|
131
128
|
width: 5rem
|
|
132
129
|
height: 5rem
|
|
133
|
-
background: var(--color-accent)
|
|
130
|
+
background-color: var(--color-accent)
|
|
134
131
|
border: var(--border-strong)
|
|
135
132
|
margin-bottom: var(--space-4)
|
|
136
133
|
kit-type-row
|
|
137
134
|
display: grid
|
|
138
|
-
grid-template-columns: 2rem minmax(0,
|
|
135
|
+
grid-template-columns: 2rem minmax(0,1fr)
|
|
139
136
|
align-items: baseline
|
|
140
137
|
gap: var(--space-3)
|
|
141
138
|
padding-block: var(--space-4)
|
|
142
139
|
border-bottom: var(--border-subtle)
|
|
143
140
|
overflow-wrap: anywhere
|
|
144
141
|
kit-components-component-grid
|
|
145
|
-
grid-template-columns: repeat(auto-fit,
|
|
146
|
-
align-items: start
|
|
142
|
+
grid-template-columns: repeat(auto-fit,minmax(min(100%,22rem),1fr))
|
|
143
|
+
align-items: flex-start
|
|
147
144
|
style-guide-source-code
|
|
148
|
-
margin: var(--space-4)
|
|
145
|
+
margin-top: var(--space-4)
|
|
146
|
+
margin-inline: 0
|
|
147
|
+
margin-bottom: 0
|
|
149
148
|
padding: var(--space-4)
|
|
150
149
|
overflow: auto
|
|
151
150
|
max-height: 30rem
|
|
152
|
-
background: var(--color-canvas)
|
|
151
|
+
background-color: var(--color-canvas)
|
|
153
152
|
border: var(--border-subtle)
|
|
154
153
|
border-radius: var(--radius-md)
|
|
155
154
|
font: var(--text-small)/var(--line-body) var(--font-mono)
|
|
@@ -166,19 +165,6 @@ Style StyleGuide
|
|
|
166
165
|
color: var(--color-success)
|
|
167
166
|
style-guide-source-code space-comment
|
|
168
167
|
color: var(--color-muted)
|
|
169
|
-
@media (max-width: 700px)
|
|
170
|
-
kit-overview-hero
|
|
171
|
-
grid-template-columns: 1fr
|
|
172
|
-
gap: var(--space-5)
|
|
173
|
-
padding-block: var(--space-6)
|
|
174
|
-
kit-overview-entry-grid
|
|
175
|
-
grid-template-columns: repeat(2, minmax(0, 1fr))
|
|
176
|
-
@media (max-width: 420px)
|
|
177
|
-
kit-overview-entry-grid
|
|
178
|
-
grid-template-columns: 1fr
|
|
179
|
-
kit-space-scale-row
|
|
180
|
-
grid-template-columns: 6rem 3.5rem 1fr
|
|
181
|
-
gap: var(--space-2)
|
|
182
168
|
kit-space-0
|
|
183
169
|
width: var(--space-0)
|
|
184
170
|
kit-space-1
|
|
@@ -216,27 +202,27 @@ Style StyleGuide
|
|
|
216
202
|
kit-border-shadow-lg
|
|
217
203
|
box-shadow: var(--shadow-lg)
|
|
218
204
|
kit-color-use-canvas
|
|
219
|
-
background: var(--color-canvas)
|
|
205
|
+
background-color: var(--color-canvas)
|
|
220
206
|
style-guide-use-surface
|
|
221
|
-
background: var(--color-surface)
|
|
207
|
+
background-color: var(--color-surface)
|
|
222
208
|
kit-color-use-text
|
|
223
|
-
background: var(--color-text)
|
|
209
|
+
background-color: var(--color-text)
|
|
224
210
|
kit-color-use-muted
|
|
225
|
-
background: var(--color-muted)
|
|
211
|
+
background-color: var(--color-muted)
|
|
226
212
|
kit-color-use-outline
|
|
227
|
-
background: var(--color-outline)
|
|
213
|
+
background-color: var(--color-outline)
|
|
228
214
|
style-guide-use-brand
|
|
229
|
-
background: var(--color-brand)
|
|
215
|
+
background-color: var(--color-brand)
|
|
230
216
|
style-guide-use-accent
|
|
231
|
-
background: var(--color-accent)
|
|
217
|
+
background-color: var(--color-accent)
|
|
232
218
|
kit-color-use-success
|
|
233
|
-
background: var(--color-success)
|
|
219
|
+
background-color: var(--color-success)
|
|
234
220
|
kit-color-use-warning
|
|
235
|
-
background: var(--color-warning)
|
|
221
|
+
background-color: var(--color-warning)
|
|
236
222
|
kit-color-use-danger
|
|
237
|
-
background: var(--color-danger)
|
|
223
|
+
background-color: var(--color-danger)
|
|
238
224
|
kit-color-use-info
|
|
239
|
-
background: var(--color-info)
|
|
225
|
+
background-color: var(--color-info)
|
|
240
226
|
kit-color-swatch
|
|
241
227
|
margin: 0
|
|
242
228
|
kit-color-swatch-paint
|
|
@@ -245,8 +231,22 @@ Style StyleGuide
|
|
|
245
231
|
kit-card-link-caption
|
|
246
232
|
color: var(--color-muted)
|
|
247
233
|
font-size: var(--text-small)
|
|
248
|
-
kit-card-link-arrow
|
|
249
|
-
margin-top: auto
|
|
250
|
-
color: var(--color-brand)
|
|
251
234
|
kit-radius-shape-card
|
|
252
235
|
margin: 0
|
|
236
|
+
style-guide-view:focus
|
|
237
|
+
outline-style: none
|
|
238
|
+
kit-card-link:hover
|
|
239
|
+
border-color: var(--color-brand)
|
|
240
|
+
@media (width < 48rem)
|
|
241
|
+
kit-overview-hero
|
|
242
|
+
grid-template-columns: 1fr
|
|
243
|
+
gap: var(--space-5)
|
|
244
|
+
padding-block: var(--space-6)
|
|
245
|
+
kit-overview-entry-grid
|
|
246
|
+
grid-template-columns: repeat(2, minmax(0, 1fr))
|
|
247
|
+
@media (width < 40rem)
|
|
248
|
+
kit-overview-entry-grid
|
|
249
|
+
grid-template-columns: 1fr
|
|
250
|
+
kit-space-scale-row
|
|
251
|
+
grid-template-columns: 6rem 3.5rem 1fr
|
|
252
|
+
gap: var(--space-2)
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
Style Alerts
|
|
2
2
|
space-alert
|
|
3
|
-
padding: var(--space-3)
|
|
3
|
+
padding-block: var(--space-3)
|
|
4
|
+
padding-inline: var(--space-4)
|
|
4
5
|
border-inline-start: var(--border-width-lg) solid currentColor
|
|
5
6
|
border-radius: var(--radius-md)
|
|
6
|
-
background: var(--color-info-bg)
|
|
7
|
+
background-color: var(--color-info-bg)
|
|
7
8
|
color: var(--color-info)
|
|
8
9
|
space-alert_success
|
|
9
|
-
background: var(--color-success-bg)
|
|
10
|
+
background-color: var(--color-success-bg)
|
|
10
11
|
color: var(--color-success)
|
|
11
12
|
space-alert_warning
|
|
12
|
-
background: var(--color-warning-bg)
|
|
13
|
+
background-color: var(--color-warning-bg)
|
|
13
14
|
color: var(--color-warning)
|
|
14
15
|
space-alert_danger
|
|
15
|
-
background: var(--color-danger-bg)
|
|
16
|
+
background-color: var(--color-danger-bg)
|
|
16
17
|
color: var(--color-danger)
|
|
@@ -2,17 +2,18 @@ Style Badges
|
|
|
2
2
|
space-badge
|
|
3
3
|
display: inline-flex
|
|
4
4
|
width: fit-content
|
|
5
|
-
padding: var(--space-1)
|
|
5
|
+
padding-block: var(--space-1)
|
|
6
|
+
padding-inline: var(--space-3)
|
|
6
7
|
border-radius: var(--radius-pill)
|
|
7
|
-
background: var(--color-accent)
|
|
8
|
+
background-color: var(--color-accent)
|
|
8
9
|
color: var(--color-on-accent)
|
|
9
10
|
font: var(--weight-bold) var(--text-caption)/1.35 var(--font-sans)
|
|
10
11
|
space-badge_success
|
|
11
|
-
background: var(--color-success-bg)
|
|
12
|
+
background-color: var(--color-success-bg)
|
|
12
13
|
color: var(--color-success)
|
|
13
14
|
space-badge_warning
|
|
14
|
-
background: var(--color-warning-bg)
|
|
15
|
+
background-color: var(--color-warning-bg)
|
|
15
16
|
color: var(--color-warning)
|
|
16
17
|
space-badge_danger
|
|
17
|
-
background: var(--color-danger-bg)
|
|
18
|
+
background-color: var(--color-danger-bg)
|
|
18
19
|
color: var(--color-danger)
|
|
@@ -4,31 +4,32 @@ Style Buttons
|
|
|
4
4
|
align-items: center
|
|
5
5
|
justify-content: center
|
|
6
6
|
gap: var(--space-2)
|
|
7
|
-
min-height:
|
|
7
|
+
min-height: 2.75rem
|
|
8
8
|
max-width: 100%
|
|
9
|
-
padding: var(--space-2)
|
|
9
|
+
padding-block: var(--space-2)
|
|
10
|
+
padding-inline: var(--space-4)
|
|
10
11
|
border: var(--border-subtle)
|
|
11
12
|
border-radius: var(--radius-md)
|
|
12
|
-
background: var(--color-canvas)
|
|
13
|
+
background-color: var(--color-canvas)
|
|
13
14
|
color: var(--color-text)
|
|
14
15
|
font: var(--weight-bold) var(--text-small)/1.3 var(--font-sans)
|
|
15
16
|
text-align: center
|
|
16
|
-
text-decoration: none
|
|
17
|
+
text-decoration-line: none
|
|
17
18
|
cursor: pointer
|
|
18
|
-
space-button:hover
|
|
19
|
-
background: var(--color-surface)
|
|
20
19
|
space-button_primary
|
|
21
20
|
border-color: transparent
|
|
22
|
-
background: var(--color-brand)
|
|
21
|
+
background-color: var(--color-brand)
|
|
23
22
|
color: var(--color-on-brand)
|
|
24
|
-
space-button_primary:hover
|
|
25
|
-
background: var(--color-brand-hover)
|
|
26
23
|
space-button_quiet
|
|
27
24
|
border-color: transparent
|
|
28
|
-
background: transparent
|
|
29
|
-
space-button:disabled
|
|
30
|
-
opacity: .55
|
|
31
|
-
cursor: default
|
|
25
|
+
background-color: transparent
|
|
32
26
|
space-focus:focus-visible, space-button:focus-visible, space-input:focus-visible, space-link:focus-visible
|
|
33
27
|
outline: var(--border-focus)
|
|
34
28
|
outline-offset: 3px
|
|
29
|
+
space-button:hover
|
|
30
|
+
background-color: var(--color-surface)
|
|
31
|
+
space-button:disabled
|
|
32
|
+
opacity: .55
|
|
33
|
+
cursor: default
|
|
34
|
+
space-button_primary:hover
|
|
35
|
+
background-color: var(--color-brand-hover)
|
|
@@ -3,14 +3,15 @@ Style Feedback
|
|
|
3
3
|
width: 100%
|
|
4
4
|
accent-color: var(--color-brand)
|
|
5
5
|
space-disclosure
|
|
6
|
-
padding: var(--space-3)
|
|
6
|
+
padding-block: var(--space-3)
|
|
7
|
+
padding-inline: var(--space-4)
|
|
7
8
|
border: var(--border-subtle)
|
|
8
9
|
border-radius: var(--radius-md)
|
|
9
10
|
space-disclosure summary
|
|
10
11
|
cursor: pointer
|
|
11
12
|
font-weight: var(--weight-bold)
|
|
12
13
|
space-disclosure[open] summary
|
|
13
|
-
margin-
|
|
14
|
+
margin-bottom: var(--space-2)
|
|
14
15
|
space-empty
|
|
15
16
|
display: grid
|
|
16
17
|
gap: var(--space-2)
|
|
@@ -8,12 +8,13 @@ Style Forms
|
|
|
8
8
|
space-input
|
|
9
9
|
display: block
|
|
10
10
|
width: 100%
|
|
11
|
-
min-height:
|
|
12
|
-
padding: var(--space-2)
|
|
11
|
+
min-height: 2.75rem
|
|
12
|
+
padding-block: var(--space-2)
|
|
13
|
+
padding-inline: var(--space-3)
|
|
13
14
|
border: var(--border-subtle)
|
|
14
15
|
border-color: var(--color-outline-strong)
|
|
15
16
|
border-radius: var(--radius-md)
|
|
16
|
-
background: var(--color-canvas)
|
|
17
|
+
background-color: var(--color-canvas)
|
|
17
18
|
color: var(--color-text)
|
|
18
19
|
font: inherit
|
|
19
20
|
textarea:is(space-input)
|
|
@@ -31,7 +32,7 @@ Style Forms
|
|
|
31
32
|
display: flex
|
|
32
33
|
align-items: center
|
|
33
34
|
gap: var(--space-2)
|
|
34
|
-
min-height:
|
|
35
|
+
min-height: 2.75rem
|
|
35
36
|
space-check input
|
|
36
37
|
width: 1rem
|
|
37
38
|
height: 1rem
|
|
@@ -6,12 +6,13 @@ Style Tables
|
|
|
6
6
|
border-collapse: collapse
|
|
7
7
|
text-align: start
|
|
8
8
|
space-table caption
|
|
9
|
-
padding-
|
|
9
|
+
padding-bottom: var(--space-2)
|
|
10
10
|
text-align: start
|
|
11
11
|
font-weight: var(--weight-bold)
|
|
12
12
|
space-table th, space-table td
|
|
13
|
-
padding: var(--space-2)
|
|
13
|
+
padding-block: var(--space-2)
|
|
14
|
+
padding-inline: var(--space-3)
|
|
14
15
|
border-block-end: var(--border-subtle)
|
|
15
16
|
text-align: start
|
|
16
17
|
space-table th
|
|
17
|
-
background: var(--color-surface)
|
|
18
|
+
background-color: var(--color-surface)
|
|
@@ -4,7 +4,7 @@ Style Typography
|
|
|
4
4
|
font-family: var(--font-sans)
|
|
5
5
|
font-weight: var(--weight-bold)
|
|
6
6
|
line-height: var(--line-heading)
|
|
7
|
-
letter-spacing: -.
|
|
7
|
+
letter-spacing: -.018em
|
|
8
8
|
overflow-wrap: anywhere
|
|
9
9
|
space-h1
|
|
10
10
|
font-size: var(--text-h1)
|
|
@@ -29,12 +29,13 @@ Style Typography
|
|
|
29
29
|
color: var(--color-muted)
|
|
30
30
|
space-link
|
|
31
31
|
color: var(--color-focus)
|
|
32
|
-
text-decoration: underline
|
|
32
|
+
text-decoration-line: underline
|
|
33
33
|
text-underline-offset: .16em
|
|
34
34
|
space-code-inline, space-key
|
|
35
|
-
padding: .12em
|
|
35
|
+
padding-block: .12em
|
|
36
|
+
padding-inline: .35em
|
|
36
37
|
border-radius: var(--radius-sm)
|
|
37
|
-
background: var(--color-surface)
|
|
38
|
+
background-color: var(--color-surface)
|
|
38
39
|
font: .88em var(--font-mono)
|
|
39
40
|
overflow-wrap: anywhere
|
|
40
41
|
space-key
|
|
@@ -48,4 +49,4 @@ Style Typography
|
|
|
48
49
|
margin: 0
|
|
49
50
|
padding-inline-start: var(--space-5)
|
|
50
51
|
space-list li + li
|
|
51
|
-
margin-
|
|
52
|
+
margin-top: var(--space-1)
|