@zenera/cli 1.3.22 → 1.3.24
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/package.json +6 -6
- package/templates/editor/.github/skills/zen-review/scripts/check-paths.sh +1 -1
- package/templates/project/agents/skills/html-page/SKILL.md +164 -57
- package/templates/project/agents/skills/html-page/assets/app/api/items.api.py +3 -2
- package/templates/project/agents/skills/html-page/assets/app/app.tsx +140 -0
- package/templates/project/agents/skills/html-page/assets/dashboard.tsx +162 -0
- package/templates/project/agents/skills/html-page/kit/Chart.tsx +79 -0
- package/templates/project/agents/skills/html-page/kit/Table.tsx +89 -0
- package/templates/project/agents/skills/html-page/kit/api.ts +93 -0
- package/templates/project/agents/skills/html-page/kit/components.tsx +302 -0
- package/templates/project/agents/skills/html-page/kit/format.ts +60 -0
- package/templates/project/agents/skills/html-page/kit/hooks.ts +159 -0
- package/templates/project/agents/skills/html-page/kit/index.ts +36 -0
- package/templates/project/agents/skills/html-page/kit/modules.d.ts +37 -0
- package/templates/project/agents/skills/html-page/kit/mount.tsx +62 -0
- package/templates/project/agents/skills/html-page/kit/shell.html +19 -0
- package/templates/project/agents/skills/html-page/kit/theme.css +356 -0
- package/templates/project/agents/skills/html-page/references/charts-and-tables.md +105 -53
- package/templates/project/agents/skills/html-page/references/python-functions.md +37 -29
- package/templates/project/agents/skills/html-page/scripts/build.ts +990 -0
- package/templates/project/agents/skills/html-page/assets/api.js +0 -87
- package/templates/project/agents/skills/html-page/assets/app/index.html +0 -278
- package/templates/project/agents/skills/html-page/assets/dashboard.html +0 -423
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef, useState, type DependencyList } from 'react';
|
|
2
|
+
|
|
3
|
+
/** Anything thrown, as an Error with a message to show. */
|
|
4
|
+
export function toError(err: unknown): Error {
|
|
5
|
+
return err instanceof Error ? err : new Error(String(err));
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface Call<T> {
|
|
9
|
+
/** the last result; undefined until the first one arrives */
|
|
10
|
+
data: T | undefined;
|
|
11
|
+
/** what the last call threw, until the next one succeeds */
|
|
12
|
+
error: Error | undefined;
|
|
13
|
+
loading: boolean;
|
|
14
|
+
/** call again, e.g. after a change was saved */
|
|
15
|
+
reload: () => Promise<void>;
|
|
16
|
+
/** replace the data in place, e.g. with what a save returned */
|
|
17
|
+
setData: (data: T) => void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Calls `fn` when the component mounts and whenever `deps` change, and keeps its result,
|
|
22
|
+
* error and loading state. A slower earlier call never overwrites a later one.
|
|
23
|
+
*
|
|
24
|
+
* const list = useCall(() => items.list_items({ show }), [show]);
|
|
25
|
+
*/
|
|
26
|
+
export function useCall<T>(fn: () => Promise<T>, deps: DependencyList = []): Call<T> {
|
|
27
|
+
const [data, setData] = useState<T>();
|
|
28
|
+
const [error, setError] = useState<Error>();
|
|
29
|
+
const [loading, setLoading] = useState(true);
|
|
30
|
+
const latest = useRef(0);
|
|
31
|
+
const fnRef = useRef(fn);
|
|
32
|
+
fnRef.current = fn;
|
|
33
|
+
|
|
34
|
+
const reload = useCallback(async () => {
|
|
35
|
+
const id = ++latest.current;
|
|
36
|
+
setLoading(true);
|
|
37
|
+
try {
|
|
38
|
+
const value = await fnRef.current();
|
|
39
|
+
if (id === latest.current) {
|
|
40
|
+
setData(() => value);
|
|
41
|
+
setError(undefined);
|
|
42
|
+
}
|
|
43
|
+
} catch (err) {
|
|
44
|
+
if (id === latest.current) setError(toError(err));
|
|
45
|
+
} finally {
|
|
46
|
+
if (id === latest.current) setLoading(false);
|
|
47
|
+
}
|
|
48
|
+
}, []);
|
|
49
|
+
|
|
50
|
+
useEffect(() => {
|
|
51
|
+
void reload();
|
|
52
|
+
return () => {
|
|
53
|
+
latest.current++;
|
|
54
|
+
};
|
|
55
|
+
}, deps);
|
|
56
|
+
|
|
57
|
+
const set = useCallback((value: T) => setData(() => value), []);
|
|
58
|
+
return { data, error, loading, reload, setData: set };
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** A JSON file by its path relative to the page. */
|
|
62
|
+
export async function fetchJson<T = any>(file: string): Promise<T> {
|
|
63
|
+
const res = await fetch(file);
|
|
64
|
+
if (!res.ok) throw new Error(`${file}: ${res.status} ${res.statusText}`.trim());
|
|
65
|
+
return (await res.json()) as T;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** A JSON file beside the page, `data.json` by default, as a useCall. */
|
|
69
|
+
export function useData<T = any>(file = 'data.json'): Call<T> {
|
|
70
|
+
return useCall(() => fetchJson<T>(file), [file]);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface Action<A extends unknown[]> {
|
|
74
|
+
/** runs the action; resolves true when it (and `after`) succeeded */
|
|
75
|
+
run: (...args: A) => Promise<boolean>;
|
|
76
|
+
busy: boolean;
|
|
77
|
+
error: Error | undefined;
|
|
78
|
+
clear: () => void;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* A change the user makes: runs `fn`, then `after` (usually a list's reload), keeping busy and
|
|
83
|
+
* error state for the button and the error box.
|
|
84
|
+
*
|
|
85
|
+
* const add = useAction((title: string) => items.add_item({ title }), list.reload);
|
|
86
|
+
* <button disabled={add.busy} onClick={() => add.run(text)}>Add</button>
|
|
87
|
+
*/
|
|
88
|
+
export function useAction<A extends unknown[]>(
|
|
89
|
+
fn: (...args: A) => Promise<unknown>,
|
|
90
|
+
after?: () => unknown,
|
|
91
|
+
): Action<A> {
|
|
92
|
+
const [busy, setBusy] = useState(false);
|
|
93
|
+
const [error, setError] = useState<Error>();
|
|
94
|
+
const fnRef = useRef(fn);
|
|
95
|
+
fnRef.current = fn;
|
|
96
|
+
const afterRef = useRef(after);
|
|
97
|
+
afterRef.current = after;
|
|
98
|
+
|
|
99
|
+
const run = useCallback(async (...args: A) => {
|
|
100
|
+
setBusy(true);
|
|
101
|
+
setError(undefined);
|
|
102
|
+
try {
|
|
103
|
+
await fnRef.current(...args);
|
|
104
|
+
await afterRef.current?.();
|
|
105
|
+
return true;
|
|
106
|
+
} catch (err) {
|
|
107
|
+
setError(toError(err));
|
|
108
|
+
return false;
|
|
109
|
+
} finally {
|
|
110
|
+
setBusy(false);
|
|
111
|
+
}
|
|
112
|
+
}, []);
|
|
113
|
+
const clear = useCallback(() => setError(undefined), []);
|
|
114
|
+
return { run, busy, error, clear };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function hashParams(): URLSearchParams {
|
|
118
|
+
return new URLSearchParams(location.hash.replace(/^#/, ''));
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* A piece of view state kept in the page's `#hash` (`#tab=orders&id=7`), so a reload or a
|
|
123
|
+
* shared link opens the same view. Storage is not available to pages; this is.
|
|
124
|
+
*/
|
|
125
|
+
export function useHashState(key: string, initial = ''): [string, (value: string) => void] {
|
|
126
|
+
const [value, setValue] = useState(() => hashParams().get(key) ?? initial);
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
const sync = () => setValue(hashParams().get(key) ?? initial);
|
|
129
|
+
window.addEventListener('hashchange', sync);
|
|
130
|
+
return () => window.removeEventListener('hashchange', sync);
|
|
131
|
+
}, [key, initial]);
|
|
132
|
+
const set = useCallback(
|
|
133
|
+
(next: string) => {
|
|
134
|
+
const params = hashParams();
|
|
135
|
+
if (next === initial) params.delete(key);
|
|
136
|
+
else params.set(key, next);
|
|
137
|
+
location.hash = params.toString();
|
|
138
|
+
setValue(next);
|
|
139
|
+
},
|
|
140
|
+
[key, initial],
|
|
141
|
+
);
|
|
142
|
+
return [value, set];
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const DARK = '(prefers-color-scheme: dark)';
|
|
146
|
+
|
|
147
|
+
/** Whether the page is shown in dark mode; follows the system as it changes. */
|
|
148
|
+
export function useDarkMode(): boolean {
|
|
149
|
+
const [dark, setDark] = useState(
|
|
150
|
+
() => typeof matchMedia === 'function' && matchMedia(DARK).matches,
|
|
151
|
+
);
|
|
152
|
+
useEffect(() => {
|
|
153
|
+
const media = matchMedia(DARK);
|
|
154
|
+
const sync = () => setDark(media.matches);
|
|
155
|
+
media.addEventListener('change', sync);
|
|
156
|
+
return () => media.removeEventListener('change', sync);
|
|
157
|
+
}, []);
|
|
158
|
+
return dark;
|
|
159
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// The page kit, imported by pages as `@page/kit`. The build bundles it into each page.
|
|
2
|
+
import './theme.css';
|
|
3
|
+
|
|
4
|
+
export { ApiError, api, call, type AnyApi } from './api.ts';
|
|
5
|
+
export {
|
|
6
|
+
fetchJson,
|
|
7
|
+
toError,
|
|
8
|
+
useAction,
|
|
9
|
+
useCall,
|
|
10
|
+
useDarkMode,
|
|
11
|
+
useData,
|
|
12
|
+
useHashState,
|
|
13
|
+
type Action,
|
|
14
|
+
type Call,
|
|
15
|
+
} from './hooks.ts';
|
|
16
|
+
export { fmt, groupSum, sum, uniq } from './format.ts';
|
|
17
|
+
export {
|
|
18
|
+
Card,
|
|
19
|
+
ConfirmButton,
|
|
20
|
+
Empty,
|
|
21
|
+
ErrorBox,
|
|
22
|
+
Field,
|
|
23
|
+
Grid,
|
|
24
|
+
Kpi,
|
|
25
|
+
Kpis,
|
|
26
|
+
Loading,
|
|
27
|
+
Page,
|
|
28
|
+
SafeHtml,
|
|
29
|
+
Select,
|
|
30
|
+
Split,
|
|
31
|
+
Stack,
|
|
32
|
+
Toolbar,
|
|
33
|
+
type Option,
|
|
34
|
+
} from './components.tsx';
|
|
35
|
+
export { Chart, type ChartEvent, type ChartOption } from './Chart.tsx';
|
|
36
|
+
export { Table, type Column } from './Table.tsx';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Files a page may import: the build inlines them (images and fonts as data: URLs, text as a string).
|
|
2
|
+
declare module '*.png' {
|
|
3
|
+
const src: string;
|
|
4
|
+
export default src;
|
|
5
|
+
}
|
|
6
|
+
declare module '*.jpg' {
|
|
7
|
+
const src: string;
|
|
8
|
+
export default src;
|
|
9
|
+
}
|
|
10
|
+
declare module '*.jpeg' {
|
|
11
|
+
const src: string;
|
|
12
|
+
export default src;
|
|
13
|
+
}
|
|
14
|
+
declare module '*.gif' {
|
|
15
|
+
const src: string;
|
|
16
|
+
export default src;
|
|
17
|
+
}
|
|
18
|
+
declare module '*.webp' {
|
|
19
|
+
const src: string;
|
|
20
|
+
export default src;
|
|
21
|
+
}
|
|
22
|
+
declare module '*.svg' {
|
|
23
|
+
const src: string;
|
|
24
|
+
export default src;
|
|
25
|
+
}
|
|
26
|
+
declare module '*.woff2' {
|
|
27
|
+
const src: string;
|
|
28
|
+
export default src;
|
|
29
|
+
}
|
|
30
|
+
declare module '*.txt' {
|
|
31
|
+
const text: string;
|
|
32
|
+
export default text;
|
|
33
|
+
}
|
|
34
|
+
declare module '*.md' {
|
|
35
|
+
const text: string;
|
|
36
|
+
export default text;
|
|
37
|
+
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { Component, StrictMode, type ComponentType, type ErrorInfo, type ReactNode } from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
|
|
4
|
+
// The build's entry: it mounts the page's default export into #root. Pages never call this.
|
|
5
|
+
|
|
6
|
+
class Boundary extends Component<{ children: ReactNode }, { error: Error | null }> {
|
|
7
|
+
override state: { error: Error | null } = { error: null };
|
|
8
|
+
|
|
9
|
+
static getDerivedStateFromError(error: unknown) {
|
|
10
|
+
return { error: error instanceof Error ? error : new Error(String(error)) };
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
override componentDidCatch(error: unknown, info: ErrorInfo) {
|
|
14
|
+
console.error(error, info.componentStack);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
override render() {
|
|
18
|
+
const { error } = this.state;
|
|
19
|
+
if (!error) return this.props.children;
|
|
20
|
+
return (
|
|
21
|
+
<main className="page page-narrow">
|
|
22
|
+
<div className="card error" role="alert">
|
|
23
|
+
<strong>This page hit an error.</strong>
|
|
24
|
+
<span>{error.message}</span>
|
|
25
|
+
<button onClick={() => this.setState({ error: null })}>Try again</button>
|
|
26
|
+
</div>
|
|
27
|
+
</main>
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** Errors outside rendering (a handler, a promise nobody awaited): shown, not swallowed. */
|
|
33
|
+
function reportUncaught() {
|
|
34
|
+
const show = (message: string) => {
|
|
35
|
+
let bar = document.getElementById('page-uncaught');
|
|
36
|
+
if (!bar) {
|
|
37
|
+
bar = document.createElement('div');
|
|
38
|
+
bar.id = 'page-uncaught';
|
|
39
|
+
bar.className = 'uncaught';
|
|
40
|
+
bar.setAttribute('role', 'alert');
|
|
41
|
+
bar.addEventListener('click', () => bar?.remove());
|
|
42
|
+
document.body.append(bar);
|
|
43
|
+
}
|
|
44
|
+
bar.textContent = `Something went wrong: ${message} (click to dismiss)`;
|
|
45
|
+
};
|
|
46
|
+
window.addEventListener('error', (e) => show(e.message || 'an error'));
|
|
47
|
+
window.addEventListener('unhandledrejection', (e) => {
|
|
48
|
+
const reason: unknown = e.reason;
|
|
49
|
+
show(reason instanceof Error ? reason.message : String(reason));
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function mount(App: ComponentType) {
|
|
54
|
+
reportUncaught();
|
|
55
|
+
createRoot(document.getElementById('root')!).render(
|
|
56
|
+
<StrictMode>
|
|
57
|
+
<Boundary>
|
|
58
|
+
<App />
|
|
59
|
+
</Boundary>
|
|
60
|
+
</StrictMode>,
|
|
61
|
+
);
|
|
62
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<!--STAMP-->
|
|
3
|
+
<html lang="en">
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
7
|
+
<title><!--TITLE--></title>
|
|
8
|
+
<!--HEAD-->
|
|
9
|
+
<style>
|
|
10
|
+
<!--CSS-->
|
|
11
|
+
</style>
|
|
12
|
+
</head>
|
|
13
|
+
<body>
|
|
14
|
+
<div id="root"></div>
|
|
15
|
+
<script type="module">
|
|
16
|
+
<!--JS-->
|
|
17
|
+
</script>
|
|
18
|
+
</body>
|
|
19
|
+
</html>
|
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/* The kit's look: colours from these variables only, light and dark. */
|
|
2
|
+
:root {
|
|
3
|
+
color-scheme: light dark;
|
|
4
|
+
--bg: #f7f7f8;
|
|
5
|
+
--card: #ffffff;
|
|
6
|
+
--fg: #1d1d1f;
|
|
7
|
+
--muted: #6e6e73;
|
|
8
|
+
--line: #e3e3e6;
|
|
9
|
+
--accent: #2563eb;
|
|
10
|
+
--accent-fg: #ffffff;
|
|
11
|
+
--up: #15803d;
|
|
12
|
+
--down: #b91c1c;
|
|
13
|
+
--danger: #b91c1c;
|
|
14
|
+
--gap: 16px;
|
|
15
|
+
--radius: 10px;
|
|
16
|
+
font:
|
|
17
|
+
14px/1.45 system-ui,
|
|
18
|
+
-apple-system,
|
|
19
|
+
'Segoe UI',
|
|
20
|
+
Roboto,
|
|
21
|
+
sans-serif;
|
|
22
|
+
}
|
|
23
|
+
@media (prefers-color-scheme: dark) {
|
|
24
|
+
:root {
|
|
25
|
+
--bg: #141416;
|
|
26
|
+
--card: #1e1e21;
|
|
27
|
+
--fg: #ececf0;
|
|
28
|
+
--muted: #9a9aa2;
|
|
29
|
+
--line: #2e2e33;
|
|
30
|
+
--accent: #60a5fa;
|
|
31
|
+
--accent-fg: #0b1220;
|
|
32
|
+
--up: #4ade80;
|
|
33
|
+
--down: #f87171;
|
|
34
|
+
--danger: #f87171;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
* {
|
|
38
|
+
box-sizing: border-box;
|
|
39
|
+
}
|
|
40
|
+
body {
|
|
41
|
+
margin: 0;
|
|
42
|
+
background: var(--bg);
|
|
43
|
+
color: var(--fg);
|
|
44
|
+
}
|
|
45
|
+
[hidden] {
|
|
46
|
+
display: none !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* The page */
|
|
50
|
+
.page {
|
|
51
|
+
margin: 0 auto;
|
|
52
|
+
padding: var(--gap);
|
|
53
|
+
display: grid;
|
|
54
|
+
gap: var(--gap);
|
|
55
|
+
container: page / inline-size;
|
|
56
|
+
}
|
|
57
|
+
.page > * {
|
|
58
|
+
min-width: 0;
|
|
59
|
+
}
|
|
60
|
+
.page-wide {
|
|
61
|
+
max-width: 1400px;
|
|
62
|
+
}
|
|
63
|
+
.page-narrow {
|
|
64
|
+
max-width: 900px;
|
|
65
|
+
}
|
|
66
|
+
.page-header {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-wrap: wrap;
|
|
69
|
+
gap: 8px 16px;
|
|
70
|
+
align-items: start;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
}
|
|
73
|
+
.page-header h1 {
|
|
74
|
+
margin: 0;
|
|
75
|
+
font-size: 1.4rem;
|
|
76
|
+
}
|
|
77
|
+
.page-header p {
|
|
78
|
+
margin: 4px 0 0;
|
|
79
|
+
color: var(--muted);
|
|
80
|
+
}
|
|
81
|
+
.page-footer {
|
|
82
|
+
color: var(--muted);
|
|
83
|
+
font-size: 0.8rem;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Boxes and layout */
|
|
87
|
+
.card {
|
|
88
|
+
background: var(--card);
|
|
89
|
+
border: 1px solid var(--line);
|
|
90
|
+
border-radius: var(--radius);
|
|
91
|
+
padding: var(--gap);
|
|
92
|
+
min-width: 0;
|
|
93
|
+
}
|
|
94
|
+
.card-header {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-wrap: wrap;
|
|
97
|
+
gap: 8px;
|
|
98
|
+
align-items: center;
|
|
99
|
+
justify-content: space-between;
|
|
100
|
+
margin: 0 0 8px;
|
|
101
|
+
}
|
|
102
|
+
.card h2 {
|
|
103
|
+
margin: 0;
|
|
104
|
+
font-size: 1rem;
|
|
105
|
+
}
|
|
106
|
+
.grid {
|
|
107
|
+
display: grid;
|
|
108
|
+
gap: var(--gap);
|
|
109
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--min, 420px)), 1fr));
|
|
110
|
+
}
|
|
111
|
+
.grid > * {
|
|
112
|
+
min-width: 0;
|
|
113
|
+
}
|
|
114
|
+
.wide {
|
|
115
|
+
grid-column: 1 / -1;
|
|
116
|
+
}
|
|
117
|
+
.row {
|
|
118
|
+
display: flex;
|
|
119
|
+
flex-wrap: wrap;
|
|
120
|
+
gap: 8px;
|
|
121
|
+
align-items: center;
|
|
122
|
+
}
|
|
123
|
+
.row > * {
|
|
124
|
+
min-width: 0;
|
|
125
|
+
}
|
|
126
|
+
.stack {
|
|
127
|
+
display: grid;
|
|
128
|
+
gap: var(--gap);
|
|
129
|
+
align-content: start;
|
|
130
|
+
}
|
|
131
|
+
.stack > * {
|
|
132
|
+
min-width: 0;
|
|
133
|
+
}
|
|
134
|
+
/* Narrow: the list, or what is open with a Back button. Wide: both side by side. */
|
|
135
|
+
.split {
|
|
136
|
+
display: grid;
|
|
137
|
+
gap: var(--gap);
|
|
138
|
+
}
|
|
139
|
+
.split > * {
|
|
140
|
+
min-width: 0;
|
|
141
|
+
}
|
|
142
|
+
.split-list,
|
|
143
|
+
.split-detail {
|
|
144
|
+
display: grid;
|
|
145
|
+
gap: var(--gap);
|
|
146
|
+
align-content: start;
|
|
147
|
+
}
|
|
148
|
+
.split-list > *,
|
|
149
|
+
.split-detail > * {
|
|
150
|
+
min-width: 0;
|
|
151
|
+
}
|
|
152
|
+
.split-back {
|
|
153
|
+
justify-self: start;
|
|
154
|
+
}
|
|
155
|
+
.split.split-open > .split-list,
|
|
156
|
+
.split:not(.split-open) > .split-detail {
|
|
157
|
+
display: none;
|
|
158
|
+
}
|
|
159
|
+
@container page (min-width: 860px) {
|
|
160
|
+
.split {
|
|
161
|
+
grid-template-columns: minmax(280px, 2fr) 3fr;
|
|
162
|
+
align-items: start;
|
|
163
|
+
}
|
|
164
|
+
.split.split-open > .split-list,
|
|
165
|
+
.split:not(.split-open) > .split-detail {
|
|
166
|
+
display: grid;
|
|
167
|
+
}
|
|
168
|
+
.split-back {
|
|
169
|
+
display: none;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/* Controls */
|
|
174
|
+
.toolbar {
|
|
175
|
+
display: flex;
|
|
176
|
+
flex-wrap: wrap;
|
|
177
|
+
gap: 8px 16px;
|
|
178
|
+
align-items: end;
|
|
179
|
+
}
|
|
180
|
+
.field {
|
|
181
|
+
display: grid;
|
|
182
|
+
gap: 2px;
|
|
183
|
+
font-size: 0.85rem;
|
|
184
|
+
color: var(--muted);
|
|
185
|
+
min-width: 0;
|
|
186
|
+
}
|
|
187
|
+
.stack > .field > :is(input, textarea, select),
|
|
188
|
+
.card > .field > :is(input, textarea, select) {
|
|
189
|
+
width: 100%;
|
|
190
|
+
}
|
|
191
|
+
input,
|
|
192
|
+
select,
|
|
193
|
+
textarea,
|
|
194
|
+
button {
|
|
195
|
+
font: inherit;
|
|
196
|
+
color: var(--fg);
|
|
197
|
+
background: var(--card);
|
|
198
|
+
border: 1px solid var(--line);
|
|
199
|
+
border-radius: 6px;
|
|
200
|
+
padding: 6px 10px;
|
|
201
|
+
max-width: 100%;
|
|
202
|
+
}
|
|
203
|
+
select {
|
|
204
|
+
min-width: 9rem;
|
|
205
|
+
}
|
|
206
|
+
input[type='text'],
|
|
207
|
+
input[type='search'],
|
|
208
|
+
input:not([type]),
|
|
209
|
+
textarea {
|
|
210
|
+
flex: 1 1 14rem;
|
|
211
|
+
}
|
|
212
|
+
input[type='checkbox'],
|
|
213
|
+
input[type='radio'] {
|
|
214
|
+
padding: 0;
|
|
215
|
+
}
|
|
216
|
+
button {
|
|
217
|
+
cursor: pointer;
|
|
218
|
+
}
|
|
219
|
+
button.primary {
|
|
220
|
+
background: var(--accent);
|
|
221
|
+
border-color: var(--accent);
|
|
222
|
+
color: var(--accent-fg);
|
|
223
|
+
}
|
|
224
|
+
button.danger {
|
|
225
|
+
color: var(--danger);
|
|
226
|
+
}
|
|
227
|
+
button:disabled {
|
|
228
|
+
opacity: 0.6;
|
|
229
|
+
cursor: default;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/* Headline numbers */
|
|
233
|
+
.kpis {
|
|
234
|
+
display: grid;
|
|
235
|
+
gap: var(--gap);
|
|
236
|
+
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
|
237
|
+
}
|
|
238
|
+
.kpi-label {
|
|
239
|
+
color: var(--muted);
|
|
240
|
+
font-size: 0.85rem;
|
|
241
|
+
}
|
|
242
|
+
.kpi-value {
|
|
243
|
+
font-size: 1.6rem;
|
|
244
|
+
font-weight: 600;
|
|
245
|
+
font-variant-numeric: tabular-nums;
|
|
246
|
+
}
|
|
247
|
+
.kpi-delta.up {
|
|
248
|
+
color: var(--up);
|
|
249
|
+
}
|
|
250
|
+
.kpi-delta.down {
|
|
251
|
+
color: var(--down);
|
|
252
|
+
}
|
|
253
|
+
.kpi-hint {
|
|
254
|
+
color: var(--muted);
|
|
255
|
+
font-size: 0.8rem;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/* Lists */
|
|
259
|
+
ul.list {
|
|
260
|
+
list-style: none;
|
|
261
|
+
margin: 0;
|
|
262
|
+
padding: 0;
|
|
263
|
+
}
|
|
264
|
+
ul.list li {
|
|
265
|
+
display: flex;
|
|
266
|
+
gap: 10px;
|
|
267
|
+
align-items: center;
|
|
268
|
+
padding: 8px 0;
|
|
269
|
+
border-bottom: 1px solid var(--line);
|
|
270
|
+
}
|
|
271
|
+
ul.list li:last-child {
|
|
272
|
+
border-bottom: 0;
|
|
273
|
+
}
|
|
274
|
+
ul.list .grow {
|
|
275
|
+
flex: 1;
|
|
276
|
+
min-width: 0;
|
|
277
|
+
overflow-wrap: anywhere;
|
|
278
|
+
}
|
|
279
|
+
ul.list li.done .grow {
|
|
280
|
+
color: var(--muted);
|
|
281
|
+
text-decoration: line-through;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
/* States */
|
|
285
|
+
.muted {
|
|
286
|
+
color: var(--muted);
|
|
287
|
+
}
|
|
288
|
+
.empty {
|
|
289
|
+
margin: 0;
|
|
290
|
+
}
|
|
291
|
+
.error {
|
|
292
|
+
color: var(--danger);
|
|
293
|
+
border-color: var(--danger);
|
|
294
|
+
display: flex;
|
|
295
|
+
flex-wrap: wrap;
|
|
296
|
+
gap: 8px 12px;
|
|
297
|
+
align-items: center;
|
|
298
|
+
}
|
|
299
|
+
.uncaught {
|
|
300
|
+
position: fixed;
|
|
301
|
+
inset: auto 8px 8px;
|
|
302
|
+
z-index: 1000;
|
|
303
|
+
padding: 10px 14px;
|
|
304
|
+
border-radius: var(--radius);
|
|
305
|
+
background: var(--danger);
|
|
306
|
+
color: #fff;
|
|
307
|
+
cursor: pointer;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/* Charts, tables, embedded html */
|
|
311
|
+
.chart {
|
|
312
|
+
width: 100%;
|
|
313
|
+
}
|
|
314
|
+
.safe-html {
|
|
315
|
+
width: 100%;
|
|
316
|
+
border: 1px solid var(--line);
|
|
317
|
+
border-radius: var(--radius);
|
|
318
|
+
background: #fff;
|
|
319
|
+
}
|
|
320
|
+
.tabulator {
|
|
321
|
+
font-size: 0.9rem;
|
|
322
|
+
background: transparent;
|
|
323
|
+
border-color: var(--line);
|
|
324
|
+
}
|
|
325
|
+
.tabulator .tabulator-header,
|
|
326
|
+
.tabulator .tabulator-header .tabulator-col,
|
|
327
|
+
.tabulator .tabulator-tableholder,
|
|
328
|
+
.tabulator .tabulator-tableholder .tabulator-table,
|
|
329
|
+
.tabulator-row,
|
|
330
|
+
.tabulator .tabulator-footer {
|
|
331
|
+
background: var(--card);
|
|
332
|
+
color: var(--fg);
|
|
333
|
+
border-color: var(--line);
|
|
334
|
+
}
|
|
335
|
+
.tabulator-row.tabulator-row-even {
|
|
336
|
+
background: color-mix(in srgb, var(--card) 94%, var(--fg));
|
|
337
|
+
}
|
|
338
|
+
.tabulator-row.tabulator-selectable:hover {
|
|
339
|
+
background: color-mix(in srgb, var(--card) 85%, var(--accent));
|
|
340
|
+
}
|
|
341
|
+
.tabulator input,
|
|
342
|
+
.tabulator select {
|
|
343
|
+
color: var(--fg);
|
|
344
|
+
background: var(--bg);
|
|
345
|
+
border: 1px solid var(--line);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
@media (max-width: 520px) {
|
|
349
|
+
:root {
|
|
350
|
+
--gap: 10px;
|
|
351
|
+
font-size: 13px;
|
|
352
|
+
}
|
|
353
|
+
.kpi-value {
|
|
354
|
+
font-size: 1.3rem;
|
|
355
|
+
}
|
|
356
|
+
}
|