staffa 0.4.4 → 0.6.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 +8 -0
- package/dist/components/button.d.ts +2 -2
- package/dist/components/button.js +7 -8
- package/dist/components/checkbox.js +1 -1
- package/dist/components/field.js +0 -1
- package/dist/components/tabs.js +0 -1
- package/dist/components/toast.d.ts +2 -2
- package/dist/components/toast.js +42 -16
- package/dist/staffa.esm.js +1 -1
- package/dist/theme.js +17 -3
- package/package.json +3 -3
- package/src/components/button.ts +7 -8
- package/src/components/checkbox.ts +1 -1
- package/src/components/field.ts +1 -2
- package/src/components/tabs.ts +1 -2
- package/src/components/toast.ts +48 -18
- package/src/theme.ts +19 -3
package/README.md
CHANGED
|
@@ -26,6 +26,10 @@ S.main({
|
|
|
26
26
|
|
|
27
27
|
Staffa is made to look decent out of the box, but easily customizable at runtime.
|
|
28
28
|
|
|
29
|
+
## Screenshot
|
|
30
|
+
|
|
31
|
+

|
|
32
|
+
|
|
29
33
|
## Install
|
|
30
34
|
|
|
31
35
|
```sh
|
|
@@ -281,6 +285,10 @@ ln -s ../../node_modules/staffa/skill .claude/skills/staffa
|
|
|
281
285
|
|
|
282
286
|
## Breaking changes
|
|
283
287
|
|
|
288
|
+
- **0.5**
|
|
289
|
+
- Surfaces (`.s-s`) now apply `border-radius` and — for `.tonal` and `.outlined` variants — `border` automatically. Custom surfaces or components that previously set these manually may see doubled or conflicting styles; remove the manual declarations.
|
|
290
|
+
- `border:0` is now applied to `.s-btn` by default (overriding the browser's 2px button border). Custom button-like components built on `.s-btn` that relied on the browser default border should add an explicit border.
|
|
291
|
+
|
|
284
292
|
- **0.4**
|
|
285
293
|
- There is no default export anymore: replace `import S from "staffa"` with `import * as S from "staffa"`.
|
|
286
294
|
- `S.button` no longer has a `text` option: use `content` instead (it accepts a string or a draw function).
|
|
@@ -27,8 +27,8 @@ export interface ButtonOptions {
|
|
|
27
27
|
attrs?: Attributes;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
|
-
* A button.
|
|
31
|
-
*
|
|
30
|
+
* A button. Tonal and outlined variants show a border; filled variants rely on
|
|
31
|
+
* their solid background for affordance.
|
|
32
32
|
*
|
|
33
33
|
* Shortcut: pass a string to use it as the label, or a function for custom
|
|
34
34
|
* content.
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import A from "aberdeen";
|
|
2
2
|
import { drawSlot } from "../core.js";
|
|
3
3
|
// The button is a `.s-s` surface (defaulting to `.primary` in button() below), so
|
|
4
|
-
// its colours come from the surface classes in theme.ts.
|
|
5
|
-
// layout,
|
|
4
|
+
// its colours, border, and border-radius come from the surface classes in theme.ts.
|
|
5
|
+
// This rule only handles layout, focus, hover and sizing.
|
|
6
6
|
A.insertGlobalCss({
|
|
7
7
|
".s-btn": {
|
|
8
8
|
"&": "display:inline-flex align-items:center justify-content:center gap:$2 " +
|
|
9
9
|
"font-weight:600 line-height:1.2 white-space:nowrap cursor:pointer text-decoration:none " +
|
|
10
|
-
"border:
|
|
10
|
+
"border:0 padding: 0.5em 1em; " +
|
|
11
11
|
"transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;",
|
|
12
12
|
"&:focus-visible": "outline:none box-shadow: 0 0 0 3px $s-focus;",
|
|
13
|
-
"&:disabled, &[aria-disabled=true]": "opacity:0.45 cursor:not-allowed pointer-events:none filter:saturate(0.6)",
|
|
14
13
|
// Hover feedback is colour-only (no movement). The filled `.gradient` CTA
|
|
15
14
|
// below layers a deeper shadow on top, so it still reads as the signature action.
|
|
16
15
|
"&:hover": "filter: brightness(1.08)",
|
|
@@ -23,10 +22,10 @@ A.insertGlobalCss({
|
|
|
23
22
|
// the border (rather than making it transparent) also sidesteps a Chromium
|
|
24
23
|
// artifact where a gradient clipped to a transparent rounded border fringes
|
|
25
24
|
// the edge with the gradient's far colour.
|
|
26
|
-
"&.gradient:not(.tonal):not(.outlined)": "
|
|
25
|
+
"&.gradient:not(.tonal):not(.outlined)": "box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), $s-glow;",
|
|
27
26
|
"&.gradient:not(.tonal):not(.outlined):hover": "filter: brightness(1.05); box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), 0 7px 18px color-mix(in srgb, $s-primary 34%, transparent);",
|
|
28
27
|
// Subtle press feedback.
|
|
29
|
-
"&:active:not(:disabled)
|
|
28
|
+
"&:active:not(:disabled)": "transform: translateY(1px)",
|
|
30
29
|
// Size: set on the button itself, or inherited from a `.small`/`.large`
|
|
31
30
|
// parent (e.g. a buttonGroup), so a container can size all its buttons at once.
|
|
32
31
|
"&.small, .small > &": "padding: 0.32em 0.7em; font-size:0.85em",
|
|
@@ -37,8 +36,8 @@ A.insertGlobalCss({
|
|
|
37
36
|
// the default `.gradient` base so the two roles don't stack on one element.
|
|
38
37
|
const ROLE_CLASS = /\.(gradient|primary|secondary|neutral|danger|success|warning|base|panel|raised)(\.|\s|$)/;
|
|
39
38
|
/**
|
|
40
|
-
* A button.
|
|
41
|
-
*
|
|
39
|
+
* A button. Tonal and outlined variants show a border; filled variants rely on
|
|
40
|
+
* their solid background for affordance.
|
|
42
41
|
*
|
|
43
42
|
* Shortcut: pass a string to use it as the label, or a function for custom
|
|
44
43
|
* content.
|
|
@@ -4,7 +4,7 @@ A.insertGlobalCss({
|
|
|
4
4
|
".s-check": {
|
|
5
5
|
"&": "display:flex flex-direction:column gap:$1",
|
|
6
6
|
"> label": "display:flex align-items:center gap:$2 cursor:pointer user-select:none",
|
|
7
|
-
"> label:has(input:disabled)": "cursor:not-allowed opacity:0.6",
|
|
7
|
+
"> label:has(input:disabled)": "cursor:not-allowed opacity:0.45 filter:saturate(0.6)",
|
|
8
8
|
// Native control styled with accent-color: accessible and zero-fuss.
|
|
9
9
|
"input": "width:1.15em height:1.15em accent-color:$s-accent cursor:inherit m:0",
|
|
10
10
|
},
|
package/dist/components/field.js
CHANGED
|
@@ -12,7 +12,6 @@ A.insertGlobalCss({
|
|
|
12
12
|
"&": "w:100% bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;",
|
|
13
13
|
"&:hover:not(:disabled)": "border-color:$s-border-strong",
|
|
14
14
|
"&:focus-visible": "border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none",
|
|
15
|
-
"&:disabled": "opacity:0.6 cursor:not-allowed",
|
|
16
15
|
"&[aria-invalid=true]": "border-color:$s-danger",
|
|
17
16
|
},
|
|
18
17
|
});
|
package/dist/components/tabs.js
CHANGED
|
@@ -10,7 +10,6 @@ A.insertGlobalCss({
|
|
|
10
10
|
"border-bottom: 3px solid transparent; margin-bottom:-1px " +
|
|
11
11
|
"transition: color 0.15s, background 0.15s, border-color 0.15s;",
|
|
12
12
|
".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]": "color: $s-fg;",
|
|
13
|
-
".s-tab:disabled": "opacity:0.5 cursor:not-allowed",
|
|
14
13
|
".s-tab:focus-visible": "outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",
|
|
15
14
|
".s-tab[aria-selected=true]": "border-image: $s-gradient 1;",
|
|
16
15
|
".s-tabpanel": "display:block",
|
|
@@ -10,7 +10,7 @@ export interface ToastOptions {
|
|
|
10
10
|
*/
|
|
11
11
|
type?: "success" | "danger" | "warning" | "neutral";
|
|
12
12
|
/**
|
|
13
|
-
* Auto-dismiss delay in milliseconds. Defaults to `
|
|
13
|
+
* Auto-dismiss delay in milliseconds. Defaults to `6000`.
|
|
14
14
|
* Pass `0` to make the toast persistent until dismissed manually.
|
|
15
15
|
*/
|
|
16
16
|
duration?: number;
|
|
@@ -21,7 +21,7 @@ export interface ToastOptions {
|
|
|
21
21
|
}
|
|
22
22
|
/**
|
|
23
23
|
* Show a toast notification. Returns a `dismiss()` function to remove it
|
|
24
|
-
* programmatically. Auto-dismisses after `duration` ms (default
|
|
24
|
+
* programmatically. Auto-dismisses after `duration` ms (default 6 000).
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
27
27
|
* ```ts
|
package/dist/components/toast.js
CHANGED
|
@@ -8,7 +8,7 @@ A.insertGlobalCss({
|
|
|
8
8
|
".s-toast": {
|
|
9
9
|
"&": "display:flex align-items:flex-start gap:$2 " +
|
|
10
10
|
"padding: $3; border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow " +
|
|
11
|
-
"pointer-events:auto",
|
|
11
|
+
"pointer-events:auto position:relative overflow:hidden",
|
|
12
12
|
".s-toast-body": "display:flex flex-direction:column gap:$1 flex:1 min-width:0",
|
|
13
13
|
".s-toast-title": "font-weight:700 line-height:1.3",
|
|
14
14
|
".s-toast-msg": "font-size:0.9em fg:$s-fg-muted line-height:1.4",
|
|
@@ -16,21 +16,50 @@ A.insertGlobalCss({
|
|
|
16
16
|
"padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",
|
|
17
17
|
".s-toast-close:hover": "fg:$s-fg",
|
|
18
18
|
".s-toast-close:focus-visible": "outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-fg",
|
|
19
|
+
".s-toast-progress": "position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%",
|
|
19
20
|
},
|
|
20
21
|
});
|
|
21
22
|
let toastCount = 0;
|
|
22
23
|
// Keyed by stable ID so A.onEach scopes are per-toast — removing one never re-renders others.
|
|
23
24
|
const toasts = A.proxy({});
|
|
24
25
|
mountPortal(() => {
|
|
25
|
-
//
|
|
26
|
-
|
|
26
|
+
// In initial peek is here to NOT subscribe to changes once `toasts` first becomes non empty,
|
|
27
|
+
// leaving the container in the DOM forever after. (So as not to cut of hide animations.)
|
|
28
|
+
if (A.peek(() => A.isEmpty(toasts)) && A.isEmpty(toasts))
|
|
27
29
|
return;
|
|
28
30
|
A("div.s-toasts aria-live=polite aria-atomic=false", () => {
|
|
29
31
|
A.onEach(toasts, (entry) => {
|
|
30
|
-
const { opts } = entry;
|
|
32
|
+
const { opts, id } = entry;
|
|
31
33
|
const role = opts.type === "danger" || opts.type === "warning" ? "alert" : "status";
|
|
32
34
|
const surface = opts.type ?? "neutral";
|
|
35
|
+
const duration = opts.duration ?? 6000;
|
|
36
|
+
let timer;
|
|
37
|
+
let progressEl = null;
|
|
38
|
+
const startCountdown = () => {
|
|
39
|
+
clearTimeout(timer);
|
|
40
|
+
if (progressEl) {
|
|
41
|
+
progressEl.style.transition = "none";
|
|
42
|
+
progressEl.style.width = "100%";
|
|
43
|
+
progressEl.offsetWidth; // force reflow so transition triggers
|
|
44
|
+
progressEl.style.transition = `width ${duration}ms linear`;
|
|
45
|
+
progressEl.style.width = "0%";
|
|
46
|
+
}
|
|
47
|
+
timer = setTimeout(() => dismiss(id), duration);
|
|
48
|
+
};
|
|
49
|
+
const stopCountdown = () => {
|
|
50
|
+
clearTimeout(timer);
|
|
51
|
+
timer = undefined;
|
|
52
|
+
if (progressEl) {
|
|
53
|
+
progressEl.style.transition = "none";
|
|
54
|
+
progressEl.style.width = "100%";
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
A.clean(() => clearTimeout(timer));
|
|
33
58
|
A(`div.s-toast.s-s.${surface} role=${role}`, "create=", grow, "destroy=", shrink, opts.attrs, () => {
|
|
59
|
+
if (duration > 0) {
|
|
60
|
+
A("mouseenter=", stopCountdown);
|
|
61
|
+
A("mouseleave=", startCountdown);
|
|
62
|
+
}
|
|
34
63
|
A("div.s-toast-body", () => {
|
|
35
64
|
A(() => {
|
|
36
65
|
if (opts.title != null)
|
|
@@ -43,10 +72,16 @@ mountPortal(() => {
|
|
|
43
72
|
return;
|
|
44
73
|
A("button.s-toast-close type=button aria-label=Dismiss", () => {
|
|
45
74
|
A("#×");
|
|
46
|
-
A("click=", () => dismiss(
|
|
75
|
+
A("click=", () => dismiss(id));
|
|
47
76
|
});
|
|
48
77
|
});
|
|
78
|
+
if (duration > 0) {
|
|
79
|
+
progressEl = A("div.s-toast-progress");
|
|
80
|
+
}
|
|
49
81
|
});
|
|
82
|
+
if (duration > 0) {
|
|
83
|
+
requestAnimationFrame(startCountdown);
|
|
84
|
+
}
|
|
50
85
|
});
|
|
51
86
|
});
|
|
52
87
|
});
|
|
@@ -55,7 +90,7 @@ function dismiss(id) {
|
|
|
55
90
|
}
|
|
56
91
|
/**
|
|
57
92
|
* Show a toast notification. Returns a `dismiss()` function to remove it
|
|
58
|
-
* programmatically. Auto-dismisses after `duration` ms (default
|
|
93
|
+
* programmatically. Auto-dismisses after `duration` ms (default 6 000).
|
|
59
94
|
*
|
|
60
95
|
* @example
|
|
61
96
|
* ```ts
|
|
@@ -68,14 +103,5 @@ function dismiss(id) {
|
|
|
68
103
|
export function toast(opts) {
|
|
69
104
|
const id = ++toastCount;
|
|
70
105
|
toasts[id] = { id, opts };
|
|
71
|
-
|
|
72
|
-
let timer;
|
|
73
|
-
if (duration > 0) {
|
|
74
|
-
timer = setTimeout(() => dismiss(id), duration);
|
|
75
|
-
}
|
|
76
|
-
return () => {
|
|
77
|
-
if (timer != null)
|
|
78
|
-
clearTimeout(timer);
|
|
79
|
-
dismiss(id);
|
|
80
|
-
};
|
|
106
|
+
return () => dismiss(id);
|
|
81
107
|
}
|
package/dist/staffa.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import O from"aberdeen";var _="staffa:darkMode",oe=O.proxy({value:ce()});function ce(){try{let e=localStorage.getItem(_);if(e==="dark")return!0;if(e==="light")return!1}catch{}}function ue(e){oe.value=e;try{e===void 0?localStorage.removeItem(_):localStorage.setItem(_,e?"dark":"light")}catch{}}function ie(e=!1){let t=oe.value;return t===void 0&&!e?O.darkMode():t}O(()=>{ie()?O.insertGlobalCss({":root":"--s-primary:#8b7bff --s-secondary:#ef7fd0 --s-danger:#ff6b6b --s-success:#46d39a --s-warning:#fbbf24 --s-neutral: color-mix(in oklab, #3d4047, $s-tint 14%); --s-page: color-mix(in oklab, #0e0f12, $s-tint 5%); --s-panel: color-mix(in oklab, #17181c, $s-tint 6%); --s-raised: color-mix(in oklab, #212327, $s-tint 8%); --s-ink: color-mix(in oklab, #e9eaec, $s-tint 8%); --s-on-accent:#0c0a14 --s-focus: color-mix(in srgb, $s-primary 45%, transparent); --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 34px rgba(0,0,0,0.5);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#6db3ff"}):O.insertGlobalCss({":root":"--s-primary:#6c5ce7 --s-secondary:#d6459e --s-danger:#e23b3b --s-success:#1f9d6b --s-warning:#d97706 --s-neutral: color-mix(in oklab, #c9cbd0, $s-tint 14%); --s-page: color-mix(in oklab, #f3f4f6, $s-tint 5%); --s-panel: color-mix(in oklab, #ffffff, $s-tint 2%); --s-raised: color-mix(in oklab, #edeef0, $s-tint 7%); --s-ink: color-mix(in oklab, #1d1f24, $s-tint 7%); --s-on-accent:#0c0a14 --s-focus: color-mix(in srgb, $s-primary 35%, transparent); --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 30px rgba(20,24,40,0.13);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#2563eb"})});O.setSpacingCssVars();O.insertGlobalCss({":root":"--s-tint: color-mix(in oklab, $s-primary, $s-secondary); --s-gradient: linear-gradient(135deg, $s-primary, $s-secondary); --s-gradient-surface: linear-gradient(170deg, color-mix(in oklab, $s-primary 85%, $s-secondary), color-mix(in oklab, $s-primary 30%, $s-secondary)); --s-glow: 0 5px 16px color-mix(in srgb, $s-primary 26%, transparent); --s-page-bg: radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, $s-secondary, transparent 86%), transparent 56%), radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, $s-primary, transparent 87%), transparent 56%), $s-page;",":root, .s-s.base":"--s-a:$s-ink --s-b:$s-page",".s-s.base":"background: $s-page-bg;",".s-s.panel":"--s-a:$s-ink --s-b:$s-panel",".s-s.raised":"--s-a:$s-ink --s-b:$s-raised",".s-s.neutral":"--s-a:$s-ink --s-b:$s-neutral",".s-s.primary":"--s-a:$s-on-accent --s-b:$s-primary",".s-s.secondary":"--s-a:$s-on-accent --s-b:$s-secondary",".s-s.danger":"--s-a:$s-on-accent --s-b:$s-danger",".s-s.success":"--s-a:$s-on-accent --s-b:$s-success",".s-s.warning":"--s-a:$s-on-accent --s-b:$s-warning",".s-s.gradient":"--s-a:$s-on-accent --s-b:$s-primary",":root, .s-s":"--s-fg:$s-a --s-bg:$s-b --s-fg-muted: color-mix(in oklab, $s-fg, $s-bg 42%); --s-fg-faint: color-mix(in oklab, $s-fg, $s-bg 64%); --s-border: color-mix(in oklab, $s-fg, $s-bg 82%); --s-border-strong: color-mix(in oklab, $s-fg, $s-bg 68%); scrollbar-width:thin scrollbar-color: $s-border-strong transparent; background:$s-bg color:$s-fg",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-border-strong border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s::-webkit-scrollbar-thumb:hover, .s-s ::-webkit-scrollbar-thumb:hover":"background:$s-fg-faint background-clip:padding-box",".s-s.tonal":"--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent);",".s-s.outlined":"--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg);",".s-s.filled":"--s-fg:$s-a --s-bg:$s-b background:$s-bg;",".s-s.gradient:not(.tonal):not(.outlined)":"background: $s-gradient-surface;",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-accent:$s-primary",".s-s.primary, .s-s.secondary, .s-s.danger, .s-s.success, .s-s.warning, .s-s.gradient":"--s-accent:$s-fg --s-link:$s-fg"});O.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased",a:"color: $s-link; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select":"font:inherit color:inherit","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-fg, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-fg, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-border;","::placeholder":"color: $s-fg-faint; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-fg-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"}});O.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let e=document.documentElement;e.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>e.classList.remove("s-preload")))}var pe="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";O.insertGlobalCss({[`${pe}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-fg-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-border; padding-left: $3; fg: $s-fg-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-border; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-border-strong;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-fg-muted font-size:0.9em margin-top:$1 text-align:center"});import s from"aberdeen";import re from"aberdeen";var fe=0;function C(e="s"){return`${e}-${++fe}`}function l(e,...t){e!=null&&(typeof e=="function"?e(...t):re("rich=",e))}function M(e){queueMicrotask(()=>re(e))}import h from"aberdeen";h.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-fg user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-fg-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color:$s-border-strong","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&:disabled":"opacity:0.6 cursor:not-allowed","&[aria-invalid=true]":"border-color:$s-danger"}});function L(e,t){let n=e.id??C("field"),o=()=>!!e.error;h("div.s-field",e.attrs,()=>{h(()=>{e.label!=null&&h(`label for=${n}`,()=>{l(e.label),e.required&&h("span.s-req aria-hidden=true #*")})}),t(n,o),h(()=>{e.help!=null&&!e.error&&h("div.s-help",()=>l(e.help))}),h(()=>{e.error&&h("div.s-error role=alert #",e.error)})})}function R(e,t,n,o){h(`id=${t}`),e.name&&h(`name=${e.name}`),h(()=>{e.disabled&&h("disabled=true")}),h(()=>{e.required&&h("aria-required=true")}),h(()=>h("aria-invalid=",n()?"true":"false")),o&&h("bind=",o)}s.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color:$s-border-strong","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em bg:$s-raised border: 1px solid $s-border; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-fg background:$s-border",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em","> .s-menu":"position:absolute top:100% left:0 right:0 z-index:20 margin-top:4px max-height:15rem overflow-y:auto list-style:none p:$1 margin-bottom:0 bg:$s-panel border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow","> .s-menu li":"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-fg-muted"}});function me(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label??e.value}}function be(e){let t=C("ac-menu"),n=s.proxy({query:"",open:!1,active:0}),o=()=>(typeof e.options=="function"?e.options():e.options).map(me),i=()=>{let c=e.bind?.value;return c==null||c===""?[]:Array.isArray(c)?c:[c]},r=c=>o().find(v=>v.value===c)?.label??c;if(!e.multi){let c=e.bind?s.peek(e.bind,"value"):void 0;typeof c=="string"&&c&&(n.query=s.peek(()=>r(c)))}let a=()=>{let c=new Set(i()),v=o();e.multi&&(v=v.filter(g=>!c.has(g.value)));let b=n.query.trim().toLowerCase();return b&&(v=v.filter(g=>g.label.toLowerCase().includes(b))),v},d=(c,v)=>{if(e.multi){let b=Array.isArray(e.bind?.value)?[...e.bind.value]:[];b.includes(c)||b.push(c),e.bind&&(e.bind.value=b),n.query=""}else e.bind&&(e.bind.value=c),n.query=r(c),n.open=!1;n.active=0,v?.focus()},p=c=>{if(!e.bind)return;let v=e.bind.value??[];e.bind.value=v.filter(b=>b!==c)};L(e,(c,v)=>{s("div.s-ac",e.inputAttrs,()=>{s(()=>s("aria-invalid=",v()?"true":"false"));let b;s("div.s-control",()=>{s("click=",()=>b?.focus()),s(()=>{if(e.multi)for(let g of i())s("span.s-chip",()=>{s("span #",s.peek(()=>r(g))),s("button type=button aria-label=",`Remove ${g}`,()=>{s("#\xD7"),s("click=",$=>{$.stopPropagation(),p(g),b?.focus()})})})}),b=s("input type=text role=combobox autocomplete=off",()=>{s(`id=${c} aria-controls=${t} aria-autocomplete=list`),e.placeholder!=null&&s("placeholder=",e.placeholder),e.disabled&&s("disabled=true"),e.required&&s("aria-required=true"),s("bind=",s.ref(n,"query")),s(()=>s("aria-expanded=",n.open?"true":"false")),s(()=>{let $=a()[n.active];s("aria-activedescendant=",n.open&&$?`${t}-opt-${n.active}`:"")}),s("input=",()=>{n.open=!0,n.active=0}),s("focus=",()=>{n.open=!0}),s("blur=",()=>{setTimeout(()=>le(),150)}),s("keydown=",g=>U(g,b))})}),s(()=>{if(!n.open)return;let g=a(),$=n.query.trim(),ne=e.allowCustom!==!1&&$!==""&&!g.some(P=>P.label.toLowerCase()===$.toLowerCase());s("ul.s-menu role=listbox",`id=${t}`,()=>{g.forEach((P,Y)=>{s("li.s-option role=option",`id=${t}-opt-${Y}`,()=>{s(()=>s("aria-selected=",n.active===Y?"true":"false")),s("#",P.label),s("mousedown=",de=>de.preventDefault()),s("click=",()=>d(P.value,b)),s("mousemove=",()=>{n.active=Y})})}),ne&&s("li.s-option.s-add role=option",()=>{s("#",`Add "${$}"`),s("mousedown=",P=>P.preventDefault()),s("click=",()=>d($,b))}),g.length===0&&!ne&&s("li.s-empty #No matches")})}),s(()=>{if(e.name)if(e.multi)for(let g of i())s("input type=hidden",()=>{s("name=",e.name),s("value=",g)});else s("input type=hidden",()=>{s("name=",e.name),s("value=",i()[0]??"")})})})});function U(c,v){let b=a(),g=b.length-1;if(c.key==="ArrowDown")c.preventDefault(),n.open=!0,n.active=Math.min(g,n.active+1);else if(c.key==="ArrowUp")c.preventDefault(),n.active=Math.max(0,n.active-1);else if(c.key==="Enter"){c.preventDefault();let $=b[n.active];$?d($.value,v):e.allowCustom!==!1&&n.query.trim()?d(n.query.trim(),v):n.open&&(n.open=!1)}else if(c.key==="Escape")n.open=!1,e.multi||(n.query=r(i()[0]??""));else if(c.key==="Backspace"&&e.multi&&n.query===""){let $=i();$.length&&p($[$.length-1])}}function le(){n.open=!1,e.multi?n.query="":e.allowCustom!==!1&&n.query.trim()?d(n.query.trim()):n.query=r(i()[0]??"")}}import q from"aberdeen";q.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column border: 1px solid $s-border; r: $s-radius-lg; overflow:hidden box-shadow: $s-shadow;","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border-top: 1px solid $s-border;","> div":"p:$3 gap:$3"}});function ge(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;q("section.s-box.s-s.panel",t.attrs,()=>{q(()=>{t.header!=null&&q("header.s-s.raised",t.headerAttrs,()=>l(t.header))}),q("div",t.contentAttrs,()=>{l(t.content)}),q(()=>{t.footer!=null&&q("footer.s-s.raised",t.footerAttrs,()=>l(t.footer))})})}import B from"aberdeen";B.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:600 line-height:1.2 white-space:nowrap cursor:pointer text-decoration:none border: 1px solid $s-border; r: $s-radius; padding: 0.5em 1em; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus;","&:disabled, &[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none filter:saturate(0.6)","&:hover":"filter: brightness(1.08)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-b 26%, transparent);","&.gradient:not(.tonal):not(.outlined)":"border:0 box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), $s-glow;","&.gradient:not(.tonal):not(.outlined):hover":"filter: brightness(1.05); box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), 0 7px 18px color-mix(in srgb, $s-primary 34%, transparent);","&:active:not(:disabled):not([aria-disabled=true])":"transform: translateY(1px)","&.small, .small > &":"padding: 0.32em 0.7em; font-size:0.85em","&.large, .large > &":"padding: 0.66em 1.3em; font-size:1.1em"}});var he=/\.(gradient|primary|secondary|neutral|danger|success|warning|base|panel|raised)(\.|\s|$)/;function A(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e,n=t.href!=null?"a":"button",o=t.attrs&&he.test(t.attrs)?"":".gradient";B(`${n}.s-btn.s-s${o}`,t.attrs,()=>{t.href!=null?(B(`href=${t.href} role=button`),t.disabled&&B("aria-disabled=true")):(B("type=",t.type??"button"),t.disabled&&B("disabled=true")),t.ariaLabel&&B("aria-label=",t.ariaLabel),t.click&&B("click=",t.click),l(t.icon),l(t.content)})}import N from"aberdeen";import se from"aberdeen";se.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function z(e={}){let n=`.s-${e.layout??"attached"}${e.vertical?".s-vertical":""}`;se(`div.s-bgroup${n} role=group`,e.attrs,()=>{if(e.buttons)for(let o of e.buttons)A(o);l(e.content)})}function xe(e){N(()=>{let t=e.bind.value;z({attrs:e.attrs,buttons:Object.entries(e.options).map(([n,o])=>({content:o,ariaLabel:typeof o=="function"?n:void 0,attrs:t===n?".primary":".neutral .outlined",click:()=>{e.bind.value=e.allowDeselect&&t===n?void 0:n}}))})}),e.name&&N(()=>N(`input type=hidden name=${e.name} value=`,e.bind.value??""))}import m from"aberdeen";m.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.6",input:"width:1.15em height:1.15em accent-color:$s-accent cursor:inherit m:0"}});function ve(e={}){let t=e.id??C("check");m("div.s-check",e.attrs,()=>{m(`label for=${t}`,()=>{m("input type=checkbox",e.inputAttrs,()=>{m(`id=${t}`),e.name&&m(`name=${e.name}`),e.checked&&!e.bind&&m("checked=true"),e.change&&m("change=",e.change),m(()=>{e.disabled&&m("disabled=true")}),m(()=>{e.required&&m("aria-required=true")}),e.bind&&m("bind=",e.bind)}),m(()=>{e.label!=null&&l(e.label),e.required&&m("span.s-req aria-hidden=true #*")})}),m(()=>{e.help!=null&&!e.error&&m("div.s-help",()=>l(e.help))}),m(()=>{e.error&&m("div.s-error role=alert #",e.error)})})}import F from"aberdeen";F.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 flex-wrap:wrap margin-top:$1"}});function ye(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;F("form.s-form",t.attrs,()=>{F(()=>{F(".grid=",t.layout==="grid")}),F("submit=",n=>{if(n.preventDefault(),t.submit){let o=new FormData(n.target),i={};for(let r of new Set(o.keys())){let a=o.getAll(r);i[r]=a.length===1?a[0]:a}t.submit(i,n)}}),l(t.content),F(()=>{t.actions&&F("footer",t.actionsAttrs,()=>l(t.actions))})})}import u from"aberdeen";import x from"aberdeen";import{matchCurrent as $e}from"aberdeen/route";x.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 border: 1px solid $s-border; r:$s-radius-lg box-shadow:$s-shadow overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px)",".s-menu-item, .s-menu-item-link":"display:flex align-items:center gap:$2 w:100% padding: 0.5em 0.65em; r:$s-radius cursor:pointer text-align:left font-size:0.9em border:0 background:transparent fg:$s-fg text-decoration:none transition: background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;",".s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page]), .s-menu-item-link:hover:not([aria-current=page])":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-menu-item[aria-current=page], .s-menu-item-link[aria-current=page]":"color:$s-on-accent font-weight:600 background: $s-gradient; box-shadow: 0 3px 10px color-mix(in srgb, $s-primary 38%, transparent);",".s-menu-item[aria-current=page] .s-menu-icon, .s-menu-item-link[aria-current=page] .s-menu-icon":"color:$s-on-accent",".s-menu-item[aria-current=page]:hover, .s-menu-item-link[aria-current=page]:hover":"filter:brightness(1.06)",".s-menu-item:focus-visible, .s-menu-item-link:focus-visible":"outline:none background: color-mix(in srgb, $s-fg 10%, transparent); box-shadow: 0 0 0 2px inset $s-focus;",".s-menu-item[aria-disabled=true], .s-menu-item-link[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"fg:$s-fg-muted flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);"});function V(e,t){x("keydown=",n=>{if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"&&n.key!=="Home"&&n.key!=="End")return;n.preventDefault();let i=[...n.currentTarget.querySelectorAll(".s-menu-item, .s-menu-item-link")].filter(p=>p.getAttribute("aria-disabled")!=="true");if(!i.length)return;let r=i.indexOf(document.activeElement),a=n.key==="ArrowUp"?-1:1,d=n.key==="Home"?0:n.key==="End"?i.length-1:r<0?a>0?0:i.length-1:(r+a+i.length)%i.length;i[d].focus()});for(let n of e){if(typeof n=="string"||typeof n=="function"){l(n);continue}if("separator"in n){x("hr.s-menu-sep");continue}x(n.href?"a.s-menu-item-link":"button.s-menu-item type=button",n.attrs,()=>{n.href&&(x("href=",n.href),n.target&&x("target=",n.target),x(()=>{$e(n.href)&&x("aria-current=page")})),n.disabled&&x("aria-disabled=true"),x("click=",o=>{if(n.disabled){o.preventDefault();return}t?.(),n.click?.(o)}),n.icon&&x("span.s-menu-icon",()=>l(n.icon)),l(n.label)})}}var G=x.proxy({opts:null});function D(){let e=G.opts?.anchor;G.opts=null,e?.focus()}function we(e,t){let n=e.offsetWidth,o=e.offsetHeight,i=window.innerWidth,r=window.innerHeight,a=4,d=t.left;d+n>i-8&&(d=Math.max(8,t.right-n));let p=t.bottom+a;p+o>r-8&&t.top-o-a>=8&&(p=t.top-o-a),e.style.left=Math.max(8,d)+"px",e.style.top=Math.max(8,p)+"px"}M(()=>{let e=G.opts;if(!e)return;let t=x("div.s-menu-list.s-s.panel create=hidden destroy=hidden",e.dropdownAttrs,()=>{V(e.items,D)}),n=i=>{let r=i.target;!t.contains(r)&&!e.anchor.contains(r)&&D()},o=i=>{(i.key==="Escape"||i.key==="Tab")&&(i.preventDefault(),D())};document.addEventListener("click",n,!0),document.addEventListener("keydown",o,!0),x.clean(()=>{document.removeEventListener("click",n,!0),document.removeEventListener("keydown",o,!0)}),requestAnimationFrame(()=>{document.body.contains(t)&&(we(t,e.anchor.getBoundingClientRect()),t.querySelector(".s-menu-item:not([aria-disabled=true]), .s-menu-item-link:not([aria-disabled=true])")?.focus())})});function J(e){return G.opts=e,D}function ke(e){let t=null;x.clean(()=>{G.opts?.anchor===t&&D()}),x("contextmenu=",n=>{n.preventDefault(),t=n.currentTarget,J({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})})}function Q(e){let t=null;x.clean(()=>{G.opts?.anchor===t&&D()}),A({icon:()=>x("span aria-hidden=true #\u2630"),...e.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral .outlined",...e.button,click:n=>{if(t=n.currentTarget,G.opts?.anchor===t){D();return}J({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})}})}u.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","> header":"border-bottom: 1px solid $s-border; position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-border; fg:$s-fg-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-header-icon":"display:flex align-items:center font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:0 flex:1","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header .s-subtitle":"fg:$s-fg-muted font-size:0.85em overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-menu":"display:flex align-items:center gap:$2",".s-body":"flex:1 overflow:hidden display:flex flex-direction:row min-height:0 justify-content:center",".s-body-inner":"flex:1 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);",".s-body main":"flex:1 min-height:0 overflow-y:auto display:flex flex-direction:column",".s-body main > .s-content":"width:100% flex:1 p:$3",".s-body main.s-scroll-y":"margin-right:$3"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 max-width:228px padding:$3 gap:$1 background:transparent"},".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:none",".s-main.s-nav-btn-only .s-nav-panel":"display:none",".s-main.s-nav-btn-only .s-nav-trigger":"display:flex","@container (max-width: 640px)":{".s-main.s-nav-left .s-nav-panel, .s-main.s-nav-right .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:flex",".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0",".s-main .s-body main.s-scroll-y":"margin-right:0"}});function Ae(e={}){let t=e.nav,n=e.navPosition??"left",o=t!=null&&t.items.length>0,i=o?n==="button"?".s-nav-btn-only":`.s-nav-${n}`:"";u(`div.s-main.s-s.base${i}`,e.attrs,()=>{u(()=>{(e.title!=null||e.subtitle!=null||e.icon!=null||e.menu!=null||o)&&u("header.s-s.raised",e.topbarAttrs,()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),u(()=>{o&&u("div.s-nav-trigger",()=>{Q({...t,button:{icon:()=>u("span aria-hidden=true #\u2630"),ariaLabel:"Open navigation",attrs:".neutral .outlined .small",...t.button}})})}),u(()=>{e.icon!=null&&u("div.s-header-icon",()=>l(e.icon))}),u("div.s-titles",()=>{u(()=>{e.title!=null&&u("div.s-title",()=>l(e.title))}),u(()=>{e.subtitle!=null&&u("div.s-subtitle",()=>l(e.subtitle))})}),u(()=>{e.menu&&u("div.s-menu",()=>l(e.menu))})})})}),u("div.s-body",()=>{u("div.s-body-inner",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),o&&n!=="button"&&(u(`nav.s-nav-panel.s-s.raised.s-nav-${n}`,e.navAttrs,()=>{V(t.items)}),u("div.s-nav-sep aria-hidden=true")),Oe(e)})}),u(()=>{e.footer!=null&&u("footer",()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),l(e.footer)})})})})}function Oe(e){let t=u("main",()=>{u("div.s-content",e.contentAttrs,()=>{l(e.content)})});Ee(t)}function Ee(e){if(typeof ResizeObserver>"u")return;let t=()=>e.classList.toggle("s-scroll-y",e.offsetWidth>e.clientWidth),n=new ResizeObserver(t);n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),t(),u.clean(()=>n.disconnect())}import f from"aberdeen";import I from"aberdeen";function X(e={}){L(e,(t,n)=>{I("input.s-input",e.inputAttrs,()=>{I("type=",e.type??"text"),e.placeholder!=null&&I("placeholder=",e.placeholder),e.autocomplete!=null&&I("autocomplete=",e.autocomplete),e.value!=null&&!e.bind&&I("value=",e.value),e.input&&I("input=",e.input),e.change&&I("change=",e.change),R(e,t,n,e.bind)})})}f.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:20rem max-width:min(90vw,44rem) max-height:min(88vh,800px) border: 1px solid $s-border; r: $s-radius-lg; box-shadow: $s-shadow; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border-top: 1px solid $s-border; flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var H=f.proxy({}),Z=0,Se=f.derive(()=>{let e=Object.keys(H);if(e.length)return e[e.length-1]});M(()=>{f.onEach(H,({resolve:e,opts:t},n)=>{let o=()=>{delete H[n]};f.clean(()=>{t.onClose?.(),e()});let i=f.derive(()=>Se.value!=n);f("div.s-backdrop create=hidden destroy=hidden .hidden=",i,"click=",()=>{t.allowCancel!==!1&&o()}),f("div.s-dialog.s-s.panel create=hidden destroy=hidden",t.attrs,()=>{f(()=>{t.header!=null&&f("header.s-s.raised",t.headerAttrs,()=>l(t.header))}),f("div",t.contentAttrs,()=>{l(t.content,o)}),f(()=>{t.footer!=null&&f("footer.s-s.raised",t.footerAttrs,()=>l(t.footer))})})})});function j(e){Z||document.addEventListener("keydown",n=>{if(n.key==="Escape"&&e.allowCancel!==!1){let o=f.unproxy(H);for(let i=Z;i>0;i--)if(o[i]){o[i].opts.allowCancel!==!1&&delete H[i];break}}});let t=++Z;return e.cancelWithScope!==!1&&f.clean(()=>{delete H[t]}),new Promise(n=>{H[t]={resolve:n,opts:e}})}function Te(e,t={}){return j({header:"Alert",allowCancel:!0,content:n=>{f("p",()=>{f("#",e)}),z({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"OK",click:n})}})},...t})}function Ce(e,t={}){return new Promise(n=>{let o=!1;j({header:"Confirm",allowCancel:!0,content:i=>{f("p",()=>{f("#",e)}),z({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"Cancel",attrs:".neutral .outlined",click:i}),A({content:"OK",click:()=>{o=!0,i()}})}})},...t,onClose:()=>{n(o),t.onClose?.()}})})}function Me(e,t="",n={}){return new Promise(o=>{let i=null;j({header:"Input",allowCancel:!0,content:r=>{f("p",()=>{f("#",e)});let a=f.proxy({value:t});f("form display:contents",()=>{f("submit=",d=>{d.preventDefault(),i=a.value,r()}),X({bind:f.ref(a,"value")}),z({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"Cancel",attrs:".neutral .outlined",type:"button",click:r}),A({content:"OK",type:"submit"})}})})},...n,onClose:()=>{o(i),n.onClose?.()}})})}import k from"aberdeen";k.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-fg-muted font-size:0.85em"}});function Le(e){L(e,(t,n)=>{k("div.s-select_wrap",e.inputAttrs,()=>{k("select.s-input",()=>{R(e,t,n),k("change=",o=>{e.bind&&(e.bind.value=o.target.value)}),k(()=>{let o=typeof e.options=="function"?e.options():e.options,i=e.bind?.value??"";e.placeholder!=null&&k("option",()=>{k("value= disabled=true hidden=true"),i||k("selected=true"),k("#",e.placeholder)});for(let r of o){let a=typeof r=="string"?{value:r,label:r}:{value:r.value,label:r.label??r.value};k("option",()=>{k("value=",a.value),a.value===i&&k("selected=true"),k("#",a.label)})}})})})})}import y from"aberdeen";y.insertGlobalCss({".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tablist":"display:flex gap:$1 align-items:stretch overflow-x:auto scrollbar-width:none border-bottom: 1px solid $s-border;",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-fg-muted; font-weight:600 padding: 0.6em 0.9em; border-bottom: 3px solid transparent; margin-bottom:-1px transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-fg;",".s-tab:disabled":"opacity:0.5 cursor:not-allowed",".s-tab:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});function Be(e){let t=C("tabs"),n=(r,a)=>r.id??String(a),o=e.bind??y.proxy(n(e.tabs[0]??{label:""},0));e.tabs.length>0&&!e.tabs.some((r,a)=>n(r,a)===y.peek(()=>o.value))&&(o.value=n(e.tabs[0],0));let i=(r,a)=>{r.disabled||(o.value=n(r,a))};y("div.s-tabs",e.attrs,()=>{y("div.s-tablist role=tablist",()=>{e.tabs.forEach((r,a)=>{let d=n(r,a);y("button.s-tab type=button role=tab",()=>{y(`id=${t}-tab-${d} aria-controls=${t}-panel-${d}`),y(()=>{let p=o.value===d;y("aria-selected=",p?"true":"false"),y("tabindex=",p?"0":"-1")}),r.disabled&&y("disabled=true"),y("click=",()=>i(r,a)),y("keydown=",p=>qe(p,e.tabs,a,i)),l(r.icon),l(r.label)})})}),y("div.s-tabpanel role=tabpanel",e.contentAttrs,()=>{y(()=>{let r=o.value,a=e.tabs.findIndex((p,U)=>n(p,U)===r),d=e.tabs[a]??e.tabs[0];d&&(y(`id=${t}-panel-${n(d,a)} aria-labelledby=${t}-tab-${n(d,a)}`),l(d.content))})})})}function qe(e,t,n,o){let i=n;if(e.key==="ArrowRight"||e.key==="ArrowDown")i=(n+1)%t.length;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")i=(n-1+t.length)%t.length;else if(e.key==="Home")i=0;else if(e.key==="End")i=t.length-1;else return;e.preventDefault();let r=i>=n?1:-1;for(let a=0;a<t.length;a++){let d=t[i];if(d&&!d.disabled){o(d,i),e.currentTarget?.parentElement?.children[i]?.focus();return}i=(i+r+t.length)%t.length}}import E from"aberdeen";E.insertGlobalCss({"textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});function ze(e={}){let t=e.autoGrow!==!1;L(e,(n,o)=>{let i=E("textarea.s-input",e.inputAttrs,()=>{t?(E(".s-autoGrow"),E("input=",r=>{ae(r.currentTarget),e.input&&e.input(r)})):(E("rows=",e.rows??4),E("resize:",e.resize??"vertical"),e.input&&E("input=",e.input)),e.placeholder!=null&&E("placeholder=",e.placeholder),e.value!=null&&!e.bind&&E("value=",e.value),e.change&&E("change=",e.change),R(e,n,o,e.bind)});t&&requestAnimationFrame(()=>ae(i))})}function ae(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}import w from"aberdeen";import{grow as Fe,shrink as De}from"aberdeen/transitions";w.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow pointer-events:auto",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-msg":"font-size:0.9em fg:$s-fg-muted line-height:1.4",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-fg",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-fg"}});var Ge=0,W=w.proxy({});M(()=>{w.isEmpty(W)||w("div.s-toasts aria-live=polite aria-atomic=false",()=>{w.onEach(W,e=>{let{opts:t}=e,n=t.type==="danger"||t.type==="warning"?"alert":"status",o=t.type??"neutral";w(`div.s-toast.s-s.${o} role=${n}`,"create=",Fe,"destroy=",De,t.attrs,()=>{w("div.s-toast-body",()=>{w(()=>{t.title!=null&&w("div.s-toast-title",()=>l(t.title))}),w("div.s-toast-msg",()=>l(t.message))}),w(()=>{t.dismissible!==!1&&w("button.s-toast-close type=button aria-label=Dismiss",()=>{w("#\xD7"),w("click=",()=>ee(e.id))})})})})})});function ee(e){delete W[e]}function Ie(e){let t=++Ge;W[t]={id:t,opts:e};let n=e.duration??4e3,o;return n>0&&(o=setTimeout(()=>ee(t),n)),()=>{o!=null&&clearTimeout(o),ee(t)}}import S from"aberdeen";S.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content bg:$s-raised fg:$s-fg border: 1px solid $s-border-strong; r:$s-radius box-shadow:$s-shadow padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var K=S.proxy(void 0),T=null;typeof window<"u"&&window.addEventListener("scroll",()=>{K.value=void 0},{capture:!0,passive:!0});function He(e,t,n,o){let r=window.innerWidth,a=window.innerHeight,d=0,p=0;return o==="bottom"?(d=e.left+(e.width-t)/2,p=e.bottom+7,p+n>a-8&&(p=e.top-n-7)):o==="left"?(d=e.left-t-7,p=e.top+(e.height-n)/2,d<8&&(d=e.right+7)):o==="right"?(d=e.right+7,p=e.top+(e.height-n)/2,d+t>r-8&&(d=e.left-t-7)):(d=e.left+(e.width-t)/2,p=e.top-n-7,p<8&&(p=e.bottom+7)),{x:Math.max(8,Math.min(d,r-t-8)),y:Math.max(8,Math.min(p,a-n-8))}}function te(){T&&clearTimeout(T),T=setTimeout(()=>{K.value=void 0,T=null},100)}M(()=>{let e=K.value;if(!e)return;let{opts:t,anchor:n}=e,o=t.placement??"top",i=S("div.s-tt-tip role=tooltip visibility:hidden",t.attrs,()=>{S("mouseenter=",()=>{T&&(clearTimeout(T),T=null)}),S("mouseleave=",te),l(t.tip)});requestAnimationFrame(()=>{if(!document.body.contains(i))return;let{x:r,y:a}=He(n.getBoundingClientRect(),i.offsetWidth,i.offsetHeight,o);i.style.left=r+"px",i.style.top=a+"px",i.style.visibility=""})});function Pe(e){let t=n=>{T&&(clearTimeout(T),T=null),K.value={opts:e,anchor:n.currentTarget}};S("mouseenter=",t),S("mouseleave=",te),S("focusin=",t),S("focusout=",te),S.clean(()=>{K.value?.opts===e&&(K.value=void 0)})}export{ke as addContextMenu,Pe as addTooltip,Te as alert,be as autocomplete,ge as box,A as button,xe as buttonChooser,z as buttonGroup,ve as checkbox,Ce as confirm,j as dialog,ye as form,ie as getDarkMode,Ae as main,Q as menuButton,Me as prompt,Le as select,ue as setDarkMode,J as showFloatingMenu,Be as tabs,ze as textarea,X as textline,Ie as toast};
|
|
1
|
+
import A from"aberdeen";var _="staffa:darkMode",oe=A.proxy({value:ce()});function ce(){try{let e=localStorage.getItem(_);if(e==="dark")return!0;if(e==="light")return!1}catch{}}function ue(e){oe.value=e;try{e===void 0?localStorage.removeItem(_):localStorage.setItem(_,e?"dark":"light")}catch{}}function ie(e=!1){let t=oe.value;return t===void 0&&!e?A.darkMode():t}A(()=>{ie()?A.insertGlobalCss({":root":"--s-primary:#8b7bff --s-secondary:#ef7fd0 --s-danger:#ff6b6b --s-success:#46d39a --s-warning:#fbbf24 --s-neutral: color-mix(in oklab, #3d4047, $s-tint 14%); --s-page: color-mix(in oklab, #0e0f12, $s-tint 5%); --s-panel: color-mix(in oklab, #17181c, $s-tint 6%); --s-raised: color-mix(in oklab, #212327, $s-tint 8%); --s-ink: color-mix(in oklab, #e9eaec, $s-tint 8%); --s-on-accent:#0c0a14 --s-focus: color-mix(in srgb, $s-primary 45%, transparent); --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 34px rgba(0,0,0,0.5);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#6db3ff"}):A.insertGlobalCss({":root":"--s-primary:#6c5ce7 --s-secondary:#d6459e --s-danger:#e23b3b --s-success:#1f9d6b --s-warning:#d97706 --s-neutral: color-mix(in oklab, #c9cbd0, $s-tint 14%); --s-page: color-mix(in oklab, #f3f4f6, $s-tint 5%); --s-panel: color-mix(in oklab, #ffffff, $s-tint 2%); --s-raised: color-mix(in oklab, #edeef0, $s-tint 7%); --s-ink: color-mix(in oklab, #1d1f24, $s-tint 7%); --s-on-accent:#0c0a14 --s-focus: color-mix(in srgb, $s-primary 35%, transparent); --s-radius:12px --s-radius-lg:18px --s-shadow: 0 10px 30px rgba(20,24,40,0.13);",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-link:#2563eb"})});A.setSpacingCssVars();A.insertGlobalCss({":root":"--s-tint: color-mix(in oklab, $s-primary, $s-secondary); --s-gradient: linear-gradient(135deg, $s-primary, $s-secondary); --s-gradient-surface: linear-gradient(170deg, color-mix(in oklab, $s-primary 85%, $s-secondary), color-mix(in oklab, $s-primary 30%, $s-secondary)); --s-glow: 0 5px 16px color-mix(in srgb, $s-primary 26%, transparent); --s-page-bg: radial-gradient(120% 80% at 100% 0%, color-mix(in oklab, $s-secondary, transparent 86%), transparent 56%), radial-gradient(120% 80% at 0% 0%, color-mix(in oklab, $s-primary, transparent 87%), transparent 56%), $s-page;",":root, .s-s.base":"--s-a:$s-ink --s-b:$s-page",".s-s.base":"background: $s-page-bg;",".s-s.panel":"--s-a:$s-ink --s-b:$s-panel",".s-s.raised":"--s-a:$s-ink --s-b:$s-raised",".s-s.neutral":"--s-a:$s-ink --s-b:$s-neutral",".s-s.primary":"--s-a:$s-on-accent --s-b:$s-primary",".s-s.secondary":"--s-a:$s-on-accent --s-b:$s-secondary",".s-s.danger":"--s-a:$s-on-accent --s-b:$s-danger",".s-s.success":"--s-a:$s-on-accent --s-b:$s-success",".s-s.warning":"--s-a:$s-on-accent --s-b:$s-warning",".s-s.gradient":"--s-a:$s-on-accent --s-b:$s-primary",":root, .s-s":"--s-fg:$s-a --s-bg:$s-b --s-fg-muted: color-mix(in oklab, $s-fg, $s-bg 42%); --s-fg-faint: color-mix(in oklab, $s-fg, $s-bg 64%); --s-border: color-mix(in oklab, $s-fg, $s-bg 82%); --s-border-strong: color-mix(in oklab, $s-fg, $s-bg 68%); scrollbar-width:thin scrollbar-color: $s-border-strong transparent; background:$s-bg color:$s-fg r:$s-radius",".s-s::-webkit-scrollbar, .s-s ::-webkit-scrollbar":"width:10px height:10px",".s-s::-webkit-scrollbar-track, .s-s ::-webkit-scrollbar-track":"background:transparent",".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb":"background:$s-border-strong border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s::-webkit-scrollbar-thumb:hover, .s-s ::-webkit-scrollbar-thumb:hover":"background:$s-fg-faint background-clip:padding-box",".s-s.tonal":"--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent); border: 1px solid $s-border;",".s-s.outlined":"--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg); border: 1px solid $s-border;",".s-s.filled":"--s-fg:$s-a --s-bg:$s-b background:$s-bg;",".s-s.gradient:not(.tonal):not(.outlined)":"background: $s-gradient-surface;",":root, .s-s.base, .s-s.panel, .s-s.raised, .s-s.neutral":"--s-accent:$s-primary",".s-s.primary, .s-s.secondary, .s-s.danger, .s-s.success, .s-s.warning, .s-s.gradient":"--s-accent:$s-fg --s-link:$s-fg",".s-s.primary .s-s.tonal, .s-s.secondary .s-s.tonal, .s-s.gradient .s-s.tonal, .s-s.danger .s-s.tonal, .s-s.success .s-s.tonal, .s-s.warning .s-s.tonal, .s-s.primary .s-s.outlined, .s-s.secondary .s-s.outlined, .s-s.gradient .s-s.outlined, .s-s.danger .s-s.outlined, .s-s.success .s-s.outlined, .s-s.warning .s-s.outlined":"--s-bg: $s-panel; background: $s-panel;"});A.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased",a:"color: $s-link; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select":"font:inherit color:inherit","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-fg, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-fg, $s-bg 92%); p:$3 r: $s-radius; overflow:auto","pre code":"background:transparent p:0","img, svg, video, canvas":"max-width:100% h:auto",hr:"border:0 border-top: 1px solid $s-border;","::placeholder":"color: $s-fg-faint; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-fg-muted font-size:0.9em","@media (prefers-reduced-motion: reduce)":{"*, *::before, *::after":"transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; scroll-behavior: auto !important;"}});A.insertGlobalCss({".s-preload, .s-preload *, .s-preload *::before, .s-preload *::after":"transition: none !important; animation: none !important;"});if(typeof document<"u"&&typeof requestAnimationFrame=="function"){let e=document.documentElement;e.classList.add("s-preload"),requestAnimationFrame(()=>requestAnimationFrame(()=>e.classList.remove("s-preload")))}A.insertGlobalCss({":disabled, [aria-disabled=true]":"opacity:0.45 filter:saturate(0.6) user-select:none",":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *":"pointer-events:none cursor:not-allowed"});var pe="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";A.insertGlobalCss({[`${pe}`]:{"&":"margin:0","&:not(:first-child)":"margin-top:$3"},"h1, h2, h3, h4, h5, h6":{"&":"line-height:1.15 font-weight:700 text-wrap:balance","&:not(:first-child)":"margin-top:1.4em"},h1:"font-size:2em font-weight:800 letter-spacing:-0.022em",h2:"font-size:1.55em letter-spacing:-0.018em",h3:"font-size:1.3em letter-spacing:-0.011em",h4:"font-size:1.1em",h5:"font-size:0.95em letter-spacing:0.005em",h6:"font-size:0.8em fg:$s-fg-muted text-transform:uppercase letter-spacing:0.07em","ul, ol":{"&":"padding-left:1.5em","> li:not(:first-child), li > &:not(:first-child)":"margin-top:$1"},blockquote:"border-left: 3px solid $s-border; padding-left: $3; fg: $s-fg-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-border; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-border-strong;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-fg-muted font-size:0.9em margin-top:$1 text-align:center"});import s from"aberdeen";import re from"aberdeen";var fe=0;function S(e="s"){return`${e}-${++fe}`}function d(e,...t){e!=null&&(typeof e=="function"?e(...t):re("rich=",e))}function M(e){queueMicrotask(()=>re(e))}import x from"aberdeen";x.insertGlobalCss({".s-field":{"&":"display:flex flex-direction:column gap:$1","> label":"font-weight:600 font-size:0.9em fg:$s-fg user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-fg-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color:$s-border-strong","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"}});function L(e,t){let n=e.id??S("field"),i=()=>!!e.error;x("div.s-field",e.attrs,()=>{x(()=>{e.label!=null&&x(`label for=${n}`,()=>{d(e.label),e.required&&x("span.s-req aria-hidden=true #*")})}),t(n,i),x(()=>{e.help!=null&&!e.error&&x("div.s-help",()=>d(e.help))}),x(()=>{e.error&&x("div.s-error role=alert #",e.error)})})}function R(e,t,n,i){x(`id=${t}`),e.name&&x(`name=${e.name}`),x(()=>{e.disabled&&x("disabled=true")}),x(()=>{e.required&&x("aria-required=true")}),x(()=>x("aria-invalid=",n()?"true":"false")),i&&x("bind=",i)}s.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color:$s-border-strong","> .s-control:focus-within":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus;","&[aria-invalid=true] > .s-control":"border-color:$s-danger",".s-chip":"display:inline-flex align-items:center gap:$1 font-size:0.85em bg:$s-raised border: 1px solid $s-border; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-fg background:$s-border",input:"flex:1 min-width:6ch border:0 background:transparent color:inherit outline:none padding:0.25em","> .s-menu":"position:absolute top:100% left:0 right:0 z-index:20 margin-top:4px max-height:15rem overflow-y:auto list-style:none p:$1 margin-bottom:0 bg:$s-panel border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow","> .s-menu li":"margin:0",".s-option":"padding: 0.45em 0.6em; r:6px cursor:pointer transition: background 0.1s;",".s-option[aria-selected=true]":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-fg-muted"}});function me(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label??e.value}}function be(e){let t=S("ac-menu"),n=s.proxy({query:"",open:!1,active:0}),i=()=>(typeof e.options=="function"?e.options():e.options).map(me),o=()=>{let c=e.bind?.value;return c==null||c===""?[]:Array.isArray(c)?c:[c]},r=c=>i().find(y=>y.value===c)?.label??c;if(!e.multi){let c=e.bind?s.peek(e.bind,"value"):void 0;typeof c=="string"&&c&&(n.query=s.peek(()=>r(c)))}let a=()=>{let c=new Set(o()),y=i();e.multi&&(y=y.filter(h=>!c.has(h.value)));let g=n.query.trim().toLowerCase();return g&&(y=y.filter(h=>h.label.toLowerCase().includes(g))),y},l=(c,y)=>{if(e.multi){let g=Array.isArray(e.bind?.value)?[...e.bind.value]:[];g.includes(c)||g.push(c),e.bind&&(e.bind.value=g),n.query=""}else e.bind&&(e.bind.value=c),n.query=r(c),n.open=!1;n.active=0,y?.focus()},p=c=>{if(!e.bind)return;let y=e.bind.value??[];e.bind.value=y.filter(g=>g!==c)};L(e,(c,y)=>{s("div.s-ac",e.inputAttrs,()=>{s(()=>s("aria-invalid=",y()?"true":"false"));let g;s("div.s-control",()=>{s("click=",()=>g?.focus()),s(()=>{if(e.multi)for(let h of o())s("span.s-chip",()=>{s("span #",s.peek(()=>r(h))),s("button type=button aria-label=",`Remove ${h}`,()=>{s("#\xD7"),s("click=",w=>{w.stopPropagation(),p(h),g?.focus()})})})}),g=s("input type=text role=combobox autocomplete=off",()=>{s(`id=${c} aria-controls=${t} aria-autocomplete=list`),e.placeholder!=null&&s("placeholder=",e.placeholder),e.disabled&&s("disabled=true"),e.required&&s("aria-required=true"),s("bind=",s.ref(n,"query")),s(()=>s("aria-expanded=",n.open?"true":"false")),s(()=>{let w=a()[n.active];s("aria-activedescendant=",n.open&&w?`${t}-opt-${n.active}`:"")}),s("input=",()=>{n.open=!0,n.active=0}),s("focus=",()=>{n.open=!0}),s("blur=",()=>{setTimeout(()=>le(),150)}),s("keydown=",h=>j(h,g))})}),s(()=>{if(!n.open)return;let h=a(),w=n.query.trim(),ne=e.allowCustom!==!1&&w!==""&&!h.some(P=>P.label.toLowerCase()===w.toLowerCase());s("ul.s-menu role=listbox",`id=${t}`,()=>{h.forEach((P,Y)=>{s("li.s-option role=option",`id=${t}-opt-${Y}`,()=>{s(()=>s("aria-selected=",n.active===Y?"true":"false")),s("#",P.label),s("mousedown=",de=>de.preventDefault()),s("click=",()=>l(P.value,g)),s("mousemove=",()=>{n.active=Y})})}),ne&&s("li.s-option.s-add role=option",()=>{s("#",`Add "${w}"`),s("mousedown=",P=>P.preventDefault()),s("click=",()=>l(w,g))}),h.length===0&&!ne&&s("li.s-empty #No matches")})}),s(()=>{if(e.name)if(e.multi)for(let h of o())s("input type=hidden",()=>{s("name=",e.name),s("value=",h)});else s("input type=hidden",()=>{s("name=",e.name),s("value=",o()[0]??"")})})})});function j(c,y){let g=a(),h=g.length-1;if(c.key==="ArrowDown")c.preventDefault(),n.open=!0,n.active=Math.min(h,n.active+1);else if(c.key==="ArrowUp")c.preventDefault(),n.active=Math.max(0,n.active-1);else if(c.key==="Enter"){c.preventDefault();let w=g[n.active];w?l(w.value,y):e.allowCustom!==!1&&n.query.trim()?l(n.query.trim(),y):n.open&&(n.open=!1)}else if(c.key==="Escape")n.open=!1,e.multi||(n.query=r(o()[0]??""));else if(c.key==="Backspace"&&e.multi&&n.query===""){let w=o();w.length&&p(w[w.length-1])}}function le(){n.open=!1,e.multi?n.query="":e.allowCustom!==!1&&n.query.trim()?l(n.query.trim()):n.query=r(o()[0]??"")}}import q from"aberdeen";q.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column border: 1px solid $s-border; r: $s-radius-lg; overflow:hidden box-shadow: $s-shadow;","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border-top: 1px solid $s-border;","> div":"p:$3 gap:$3"}});function ge(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;q("section.s-box.s-s.panel",t.attrs,()=>{q(()=>{t.header!=null&&q("header.s-s.raised",t.headerAttrs,()=>d(t.header))}),q("div",t.contentAttrs,()=>{d(t.content)}),q(()=>{t.footer!=null&&q("footer.s-s.raised",t.footerAttrs,()=>d(t.footer))})})}import B from"aberdeen";B.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:600 line-height:1.2 white-space:nowrap cursor:pointer text-decoration:none border:0 padding: 0.5em 1em; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus;","&:hover":"filter: brightness(1.08)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-b 26%, transparent);","&.gradient:not(.tonal):not(.outlined)":"box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), $s-glow;","&.gradient:not(.tonal):not(.outlined):hover":"filter: brightness(1.05); box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), 0 7px 18px color-mix(in srgb, $s-primary 34%, transparent);","&:active:not(:disabled)":"transform: translateY(1px)","&.small, .small > &":"padding: 0.32em 0.7em; font-size:0.85em","&.large, .large > &":"padding: 0.66em 1.3em; font-size:1.1em"}});var he=/\.(gradient|primary|secondary|neutral|danger|success|warning|base|panel|raised)(\.|\s|$)/;function O(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e,n=t.href!=null?"a":"button",i=t.attrs&&he.test(t.attrs)?"":".gradient";B(`${n}.s-btn.s-s${i}`,t.attrs,()=>{t.href!=null?(B(`href=${t.href} role=button`),t.disabled&&B("aria-disabled=true")):(B("type=",t.type??"button"),t.disabled&&B("disabled=true")),t.ariaLabel&&B("aria-label=",t.ariaLabel),t.click&&B("click=",t.click),d(t.icon),d(t.content)})}import N from"aberdeen";import se from"aberdeen";se.insertGlobalCss({".s-bgroup":{"&":"display:inline-flex align-items:stretch","&.s-spaced":"gap:$2 flex-wrap:wrap","&.s-vertical":"flex-direction:column","&.s-attached":"gap:0","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child)":"margin-left:-1px","&.s-attached:not(.s-vertical) > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached:not(.s-vertical) > .s-btn:first-child:not(:last-child)":"border-top-right-radius:0 border-bottom-right-radius:0","&.s-attached:not(.s-vertical) > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-bottom-left-radius:0","&.s-attached.s-vertical > .s-btn:not(:first-child)":"margin-top:-1px","&.s-attached.s-vertical > .s-btn:not(:first-child):not(:last-child)":"r:0","&.s-attached.s-vertical > .s-btn:first-child:not(:last-child)":"border-bottom-left-radius:0 border-bottom-right-radius:0","&.s-attached.s-vertical > .s-btn:last-child:not(:first-child)":"border-top-left-radius:0 border-top-right-radius:0","&.s-attached > .s-btn:hover, &.s-attached > .s-btn:focus-visible":"z-index:1"}});function z(e={}){let n=`.s-${e.layout??"attached"}${e.vertical?".s-vertical":""}`;se(`div.s-bgroup${n} role=group`,e.attrs,()=>{if(e.buttons)for(let i of e.buttons)O(i);d(e.content)})}function xe(e){N(()=>{let t=e.bind.value;z({attrs:e.attrs,buttons:Object.entries(e.options).map(([n,i])=>({content:i,ariaLabel:typeof i=="function"?n:void 0,attrs:t===n?".primary":".neutral .outlined",click:()=>{e.bind.value=e.allowDeselect&&t===n?void 0:n}}))})}),e.name&&N(()=>N(`input type=hidden name=${e.name} value=`,e.bind.value??""))}import b from"aberdeen";b.insertGlobalCss({".s-check":{"&":"display:flex flex-direction:column gap:$1","> label":"display:flex align-items:center gap:$2 cursor:pointer user-select:none","> label:has(input:disabled)":"cursor:not-allowed opacity:0.45 filter:saturate(0.6)",input:"width:1.15em height:1.15em accent-color:$s-accent cursor:inherit m:0"}});function ve(e={}){let t=e.id??S("check");b("div.s-check",e.attrs,()=>{b(`label for=${t}`,()=>{b("input type=checkbox",e.inputAttrs,()=>{b(`id=${t}`),e.name&&b(`name=${e.name}`),e.checked&&!e.bind&&b("checked=true"),e.change&&b("change=",e.change),b(()=>{e.disabled&&b("disabled=true")}),b(()=>{e.required&&b("aria-required=true")}),e.bind&&b("bind=",e.bind)}),b(()=>{e.label!=null&&d(e.label),e.required&&b("span.s-req aria-hidden=true #*")})}),b(()=>{e.help!=null&&!e.error&&b("div.s-help",()=>d(e.help))}),b(()=>{e.error&&b("div.s-error role=alert #",e.error)})})}import F from"aberdeen";F.insertGlobalCss({".s-form":{"&":"display:flex flex-direction:column gap:$3","&.grid":"display:grid grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap:$3","&.grid > .s-wide, &.grid > footer":"grid-column: 1 / -1;","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 flex-wrap:wrap margin-top:$1"}});function ye(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;F("form.s-form",t.attrs,()=>{F(()=>{F(".grid=",t.layout==="grid")}),F("submit=",n=>{if(n.preventDefault(),t.submit){let i=new FormData(n.target),o={};for(let r of new Set(i.keys())){let a=i.getAll(r);o[r]=a.length===1?a[0]:a}t.submit(o,n)}}),d(t.content),F(()=>{t.actions&&F("footer",t.actionsAttrs,()=>d(t.actions))})})}import u from"aberdeen";import v from"aberdeen";import{matchCurrent as $e}from"aberdeen/route";v.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 border: 1px solid $s-border; r:$s-radius-lg box-shadow:$s-shadow overflow-y:auto max-height:min(80vh,28rem) transition: opacity 0.15s, transform 0.15s;",".s-menu-list.hidden":"opacity:0 pointer-events:none transform:translateY(-6px)",".s-menu-item, .s-menu-item-link":"display:flex align-items:center gap:$2 w:100% padding: 0.5em 0.65em; r:$s-radius cursor:pointer text-align:left font-size:0.9em border:0 background:transparent fg:$s-fg text-decoration:none transition: background 0.12s, color 0.12s, transform 0.12s, box-shadow 0.12s;",".s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page]), .s-menu-item-link:hover:not([aria-current=page])":"background: color-mix(in srgb, $s-fg 10%, transparent);",".s-menu-item[aria-current=page], .s-menu-item-link[aria-current=page]":"color:$s-on-accent font-weight:600 background: $s-gradient; box-shadow: 0 3px 10px color-mix(in srgb, $s-primary 38%, transparent);",".s-menu-item[aria-current=page] .s-menu-icon, .s-menu-item-link[aria-current=page] .s-menu-icon":"color:$s-on-accent",".s-menu-item[aria-current=page]:hover, .s-menu-item-link[aria-current=page]:hover":"filter:brightness(1.06)",".s-menu-item:focus-visible, .s-menu-item-link:focus-visible":"outline:none background: color-mix(in srgb, $s-fg 10%, transparent); box-shadow: 0 0 0 2px inset $s-focus;",".s-menu-item[aria-disabled=true], .s-menu-item-link[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"fg:$s-fg-muted flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);"});function V(e,t){v("keydown=",n=>{if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"&&n.key!=="Home"&&n.key!=="End")return;n.preventDefault();let o=[...n.currentTarget.querySelectorAll(".s-menu-item, .s-menu-item-link")].filter(p=>p.getAttribute("aria-disabled")!=="true");if(!o.length)return;let r=o.indexOf(document.activeElement),a=n.key==="ArrowUp"?-1:1,l=n.key==="Home"?0:n.key==="End"?o.length-1:r<0?a>0?0:o.length-1:(r+a+o.length)%o.length;o[l].focus()});for(let n of e){if(typeof n=="string"||typeof n=="function"){d(n);continue}if("separator"in n){v("hr.s-menu-sep");continue}v(n.href?"a.s-menu-item-link":"button.s-menu-item type=button",n.attrs,()=>{n.href&&(v("href=",n.href),n.target&&v("target=",n.target),v(()=>{$e(n.href)&&v("aria-current=page")})),n.disabled&&v("aria-disabled=true"),v("click=",i=>{if(n.disabled){i.preventDefault();return}t?.(),n.click?.(i)}),n.icon&&v("span.s-menu-icon",()=>d(n.icon)),d(n.label)})}}var D=v.proxy({opts:null});function G(){let e=D.opts?.anchor;D.opts=null,e?.focus()}function we(e,t){let n=e.offsetWidth,i=e.offsetHeight,o=window.innerWidth,r=window.innerHeight,a=4,l=t.left;l+n>o-8&&(l=Math.max(8,t.right-n));let p=t.bottom+a;p+i>r-8&&t.top-i-a>=8&&(p=t.top-i-a),e.style.left=Math.max(8,l)+"px",e.style.top=Math.max(8,p)+"px"}M(()=>{let e=D.opts;if(!e)return;let t=v("div.s-menu-list.s-s.panel create=hidden destroy=hidden",e.dropdownAttrs,()=>{V(e.items,G)}),n=o=>{let r=o.target;!t.contains(r)&&!e.anchor.contains(r)&&G()},i=o=>{(o.key==="Escape"||o.key==="Tab")&&(o.preventDefault(),G())};document.addEventListener("click",n,!0),document.addEventListener("keydown",i,!0),v.clean(()=>{document.removeEventListener("click",n,!0),document.removeEventListener("keydown",i,!0)}),requestAnimationFrame(()=>{document.body.contains(t)&&(we(t,e.anchor.getBoundingClientRect()),t.querySelector(".s-menu-item:not([aria-disabled=true]), .s-menu-item-link:not([aria-disabled=true])")?.focus())})});function J(e){return D.opts=e,G}function ke(e){let t=null;v.clean(()=>{D.opts?.anchor===t&&G()}),v("contextmenu=",n=>{n.preventDefault(),t=n.currentTarget,J({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})})}function Q(e){let t=null;v.clean(()=>{D.opts?.anchor===t&&G()}),O({icon:()=>v("span aria-hidden=true #\u2630"),...e.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral .outlined",...e.button,click:n=>{if(t=n.currentTarget,D.opts?.anchor===t){G();return}J({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})}})}u.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","> header":"border-bottom: 1px solid $s-border; position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-border; fg:$s-fg-muted","> header > .s-bar, > footer > .s-bar":"display:flex align-items:center width:100% margin-inline:auto gap:$3 padding: $2 $3;","> header .s-header-icon":"display:flex align-items:center font-size:1.4em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent;","> header .s-titles":"display:flex flex-direction:column min-width:0 flex:1","> header .s-title":"font-weight:800 font-size:1.1em line-height:1.2 overflow:hidden text-overflow:ellipsis white-space:nowrap letter-spacing:-0.01em background: $s-gradient; -webkit-background-clip:text; background-clip:text; color:transparent; width:fit-content max-width:100%","> header .s-subtitle":"fg:$s-fg-muted font-size:0.85em overflow:hidden text-overflow:ellipsis white-space:nowrap","> header .s-menu":"display:flex align-items:center gap:$2",".s-body":"flex:1 overflow:hidden display:flex flex-direction:row min-height:0 justify-content:center",".s-body-inner":"flex:1 display:flex flex-direction:row min-height:0","&.s-nav-right .s-body-inner":"flex-direction:row-reverse",".s-nav-sep":"width:1px flex-shrink:0 align-self:stretch margin: 0.6rem 0; border:0 background: linear-gradient(to bottom, transparent, $s-border-strong 18%, $s-border-strong 82%, transparent);",".s-body main":"flex:1 min-height:0 overflow-y:auto display:flex flex-direction:column",".s-body main > .s-content":"width:100% flex:1 p:$3",".s-body main.s-scroll-y":"margin-right:$3"},".s-nav-panel":{"&":"display:flex flex-direction:column overflow-y:auto flex-shrink:0 max-width:228px padding:$3 gap:$1 background:transparent"},".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:none",".s-main.s-nav-btn-only .s-nav-panel":"display:none",".s-main.s-nav-btn-only .s-nav-trigger":"display:flex","@container (max-width: 640px)":{".s-main.s-nav-left .s-nav-panel, .s-main.s-nav-right .s-nav-panel, .s-main .s-nav-sep":"display:none",".s-main.s-nav-left .s-nav-trigger, .s-main.s-nav-right .s-nav-trigger":"display:flex",".s-content > .s-box":"margin-inline: calc(-1 * $3); r:0 border-inline:0",".s-main .s-body main.s-scroll-y":"margin-right:0"}});function Ae(e={}){let t=e.nav,n=e.navPosition??"left",i=t!=null&&t.items.length>0,o=i?n==="button"?".s-nav-btn-only":`.s-nav-${n}`:"";u(`div.s-main.s-s.base${o}`,e.attrs,()=>{u(()=>{(e.title!=null||e.subtitle!=null||e.icon!=null||e.menu!=null||i)&&u("header.s-s.raised",e.topbarAttrs,()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),u(()=>{i&&u("div.s-nav-trigger",()=>{Q({...t,button:{icon:()=>u("span aria-hidden=true #\u2630"),ariaLabel:"Open navigation",attrs:".neutral .outlined .small",...t.button}})})}),u(()=>{e.icon!=null&&u("div.s-header-icon",()=>d(e.icon))}),u("div.s-titles",()=>{u(()=>{e.title!=null&&u("div.s-title",()=>d(e.title))}),u(()=>{e.subtitle!=null&&u("div.s-subtitle",()=>d(e.subtitle))})}),u(()=>{e.menu&&u("div.s-menu",()=>d(e.menu))})})})}),u("div.s-body",()=>{u("div.s-body-inner",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),i&&n!=="button"&&(u(`nav.s-nav-panel.s-s.raised.s-nav-${n}`,e.navAttrs,()=>{V(t.items)}),u("div.s-nav-sep aria-hidden=true")),Oe(e)})}),u(()=>{e.footer!=null&&u("footer",()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),d(e.footer)})})})})}function Oe(e){let t=u("main",()=>{u("div.s-content",e.contentAttrs,()=>{d(e.content)})});Ee(t)}function Ee(e){if(typeof ResizeObserver>"u")return;let t=()=>e.classList.toggle("s-scroll-y",e.offsetWidth>e.clientWidth),n=new ResizeObserver(t);n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild),t(),u.clean(()=>n.disconnect())}import f from"aberdeen";import H from"aberdeen";function X(e={}){L(e,(t,n)=>{H("input.s-input",e.inputAttrs,()=>{H("type=",e.type??"text"),e.placeholder!=null&&H("placeholder=",e.placeholder),e.autocomplete!=null&&H("autocomplete=",e.autocomplete),e.value!=null&&!e.bind&&H("value=",e.value),e.input&&H("input=",e.input),e.change&&H("change=",e.change),R(e,t,n,e.bind)})})}f.insertGlobalCss({".s-backdrop":{"&":"position:fixed inset:0 z-index:200 display:block background: rgba(0,0,0,0.55); transition: opacity 0.4s ease-in-out;","&.hidden":"opacity:0 pointer-events:none"},".s-dialog":{"&":"position:fixed z-index:200 top:50% left:50% display:flex flex-direction:column transform:translate(-50%,-50%) min-width:20rem max-width:min(90vw,44rem) max-height:min(88vh,800px) border: 1px solid $s-border; r: $s-radius-lg; box-shadow: $s-shadow; overflow:hidden transition: opacity 0.2s ease-out, transform 0.2s ease-out;","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border-bottom: 1px solid $s-border; font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border-top: 1px solid $s-border; flex-shrink:0","> div":"p:$3 gap:$3 display:flex flex-direction:column overflow-y:auto flex:1 min-height:0","&.hidden":"opacity:0 pointer-events:none transform: translate(-50%, calc(-50% + 20px)); pointer-events:none"}});var I=f.proxy({}),Z=0,Te=f.derive(()=>{let e=Object.keys(I);if(e.length)return e[e.length-1]});M(()=>{f.onEach(I,({resolve:e,opts:t},n)=>{let i=()=>{delete I[n]};f.clean(()=>{t.onClose?.(),e()});let o=f.derive(()=>Te.value!=n);f("div.s-backdrop create=hidden destroy=hidden .hidden=",o,"click=",()=>{t.allowCancel!==!1&&i()}),f("div.s-dialog.s-s.panel create=hidden destroy=hidden",t.attrs,()=>{f(()=>{t.header!=null&&f("header.s-s.raised",t.headerAttrs,()=>d(t.header))}),f("div",t.contentAttrs,()=>{d(t.content,i)}),f(()=>{t.footer!=null&&f("footer.s-s.raised",t.footerAttrs,()=>d(t.footer))})})})});function U(e){Z||document.addEventListener("keydown",n=>{if(n.key==="Escape"&&e.allowCancel!==!1){let i=f.unproxy(I);for(let o=Z;o>0;o--)if(i[o]){i[o].opts.allowCancel!==!1&&delete I[o];break}}});let t=++Z;return e.cancelWithScope!==!1&&f.clean(()=>{delete I[t]}),new Promise(n=>{I[t]={resolve:n,opts:e}})}function Ce(e,t={}){return U({header:"Alert",allowCancel:!0,content:n=>{f("p",()=>{f("#",e)}),z({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"OK",click:n})}})},...t})}function Se(e,t={}){return new Promise(n=>{let i=!1;U({header:"Confirm",allowCancel:!0,content:o=>{f("p",()=>{f("#",e)}),z({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"Cancel",attrs:".neutral .outlined",click:o}),O({content:"OK",click:()=>{i=!0,o()}})}})},...t,onClose:()=>{n(i),t.onClose?.()}})})}function Me(e,t="",n={}){return new Promise(i=>{let o=null;U({header:"Input",allowCancel:!0,content:r=>{f("p",()=>{f("#",e)});let a=f.proxy({value:t});f("form display:contents",()=>{f("submit=",l=>{l.preventDefault(),o=a.value,r()}),X({bind:f.ref(a,"value")}),z({layout:"spaced",attrs:"align-self:flex-end",content:()=>{O({content:"Cancel",attrs:".neutral .outlined",type:"button",click:r}),O({content:"OK",type:"submit"})}})})},...n,onClose:()=>{i(o),n.onClose?.()}})})}import k from"aberdeen";k.insertGlobalCss({".s-select_wrap":{"&":"position:relative display:block",select:"w:100% cursor:pointer padding-right:2.2em; appearance:none","&::after":"content: '\u25BE'; position:absolute right:0.7em top:50%; transform: translateY(-50%); pointer-events:none fg:$s-fg-muted font-size:0.85em"}});function Le(e){L(e,(t,n)=>{k("div.s-select_wrap",e.inputAttrs,()=>{k("select.s-input",()=>{R(e,t,n),k("change=",i=>{e.bind&&(e.bind.value=i.target.value)}),k(()=>{let i=typeof e.options=="function"?e.options():e.options,o=e.bind?.value??"";e.placeholder!=null&&k("option",()=>{k("value= disabled=true hidden=true"),o||k("selected=true"),k("#",e.placeholder)});for(let r of i){let a=typeof r=="string"?{value:r,label:r}:{value:r.value,label:r.label??r.value};k("option",()=>{k("value=",a.value),a.value===o&&k("selected=true"),k("#",a.label)})}})})})})}import $ from"aberdeen";$.insertGlobalCss({".s-tabs":{"&":"display:flex flex-direction:column gap:$3",".s-tablist":"display:flex gap:$1 align-items:stretch overflow-x:auto scrollbar-width:none border-bottom: 1px solid $s-border;",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-fg-muted; font-weight:600 padding: 0.6em 0.9em; border-bottom: 3px solid transparent; margin-bottom:-1px transition: color 0.15s, background 0.15s, border-color 0.15s;",".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]":"color: $s-fg;",".s-tab:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",".s-tab[aria-selected=true]":"border-image: $s-gradient 1;",".s-tabpanel":"display:block"}});function Be(e){let t=S("tabs"),n=(r,a)=>r.id??String(a),i=e.bind??$.proxy(n(e.tabs[0]??{label:""},0));e.tabs.length>0&&!e.tabs.some((r,a)=>n(r,a)===$.peek(()=>i.value))&&(i.value=n(e.tabs[0],0));let o=(r,a)=>{r.disabled||(i.value=n(r,a))};$("div.s-tabs",e.attrs,()=>{$("div.s-tablist role=tablist",()=>{e.tabs.forEach((r,a)=>{let l=n(r,a);$("button.s-tab type=button role=tab",()=>{$(`id=${t}-tab-${l} aria-controls=${t}-panel-${l}`),$(()=>{let p=i.value===l;$("aria-selected=",p?"true":"false"),$("tabindex=",p?"0":"-1")}),r.disabled&&$("disabled=true"),$("click=",()=>o(r,a)),$("keydown=",p=>qe(p,e.tabs,a,o)),d(r.icon),d(r.label)})})}),$("div.s-tabpanel role=tabpanel",e.contentAttrs,()=>{$(()=>{let r=i.value,a=e.tabs.findIndex((p,j)=>n(p,j)===r),l=e.tabs[a]??e.tabs[0];l&&($(`id=${t}-panel-${n(l,a)} aria-labelledby=${t}-tab-${n(l,a)}`),d(l.content))})})})}function qe(e,t,n,i){let o=n;if(e.key==="ArrowRight"||e.key==="ArrowDown")o=(n+1)%t.length;else if(e.key==="ArrowLeft"||e.key==="ArrowUp")o=(n-1+t.length)%t.length;else if(e.key==="Home")o=0;else if(e.key==="End")o=t.length-1;else return;e.preventDefault();let r=o>=n?1:-1;for(let a=0;a<t.length;a++){let l=t[o];if(l&&!l.disabled){i(l,o),e.currentTarget?.parentElement?.children[o]?.focus();return}o=(o+r+t.length)%t.length}}import E from"aberdeen";E.insertGlobalCss({"textarea.s-input":"resize:vertical min-height:3em line-height:1.45","textarea.s-input.s-autoGrow":"resize:none min-height:2.5em overflow-y:hidden"});function ze(e={}){let t=e.autoGrow!==!1;L(e,(n,i)=>{let o=E("textarea.s-input",e.inputAttrs,()=>{t?(E(".s-autoGrow"),E("input=",r=>{ae(r.currentTarget),e.input&&e.input(r)})):(E("rows=",e.rows??4),E("resize:",e.resize??"vertical"),e.input&&E("input=",e.input)),e.placeholder!=null&&E("placeholder=",e.placeholder),e.value!=null&&!e.bind&&E("value=",e.value),e.change&&E("change=",e.change),R(e,n,i,e.bind)});t&&requestAnimationFrame(()=>ae(o))})}function ae(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}import m from"aberdeen";import{grow as Fe,shrink as Ge}from"aberdeen/transitions";m.insertGlobalCss({".s-toasts":"position:fixed bottom:$3 right:$3 z-index:400 display:flex flex-direction:column gap:$2 pointer-events:none max-width:min(90vw,24rem) w:24rem",".s-toast":{"&":"display:flex align-items:flex-start gap:$2 padding: $3; border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow pointer-events:auto position:relative overflow:hidden",".s-toast-body":"display:flex flex-direction:column gap:$1 flex:1 min-width:0",".s-toast-title":"font-weight:700 line-height:1.3",".s-toast-msg":"font-size:0.9em fg:$s-fg-muted line-height:1.4",".s-toast-close":"cursor:pointer border:0 background:transparent fg:$s-fg-muted font-size:1.1em line-height:1 padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",".s-toast-close:hover":"fg:$s-fg",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-fg",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var De=0,W=m.proxy({});M(()=>{m.peek(()=>m.isEmpty(W))&&m.isEmpty(W)||m("div.s-toasts aria-live=polite aria-atomic=false",()=>{m.onEach(W,e=>{let{opts:t,id:n}=e,i=t.type==="danger"||t.type==="warning"?"alert":"status",o=t.type??"neutral",r=t.duration??6e3,a,l=null,p=()=>{clearTimeout(a),l&&(l.style.transition="none",l.style.width="100%",l.offsetWidth,l.style.transition=`width ${r}ms linear`,l.style.width="0%"),a=setTimeout(()=>ee(n),r)},j=()=>{clearTimeout(a),a=void 0,l&&(l.style.transition="none",l.style.width="100%")};m.clean(()=>clearTimeout(a)),m(`div.s-toast.s-s.${o} role=${i}`,"create=",Fe,"destroy=",Ge,t.attrs,()=>{r>0&&(m("mouseenter=",j),m("mouseleave=",p)),m("div.s-toast-body",()=>{m(()=>{t.title!=null&&m("div.s-toast-title",()=>d(t.title))}),m("div.s-toast-msg",()=>d(t.message))}),m(()=>{t.dismissible!==!1&&m("button.s-toast-close type=button aria-label=Dismiss",()=>{m("#\xD7"),m("click=",()=>ee(n))})}),r>0&&(l=m("div.s-toast-progress"))}),r>0&&requestAnimationFrame(p)})})});function ee(e){delete W[e]}function He(e){let t=++De;return W[t]={id:t,opts:e},()=>ee(t)}import T from"aberdeen";T.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content bg:$s-raised fg:$s-fg border: 1px solid $s-border-strong; r:$s-radius box-shadow:$s-shadow padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var K=T.proxy(void 0),C=null;typeof window<"u"&&window.addEventListener("scroll",()=>{K.value=void 0},{capture:!0,passive:!0});function Ie(e,t,n,i){let r=window.innerWidth,a=window.innerHeight,l=0,p=0;return i==="bottom"?(l=e.left+(e.width-t)/2,p=e.bottom+7,p+n>a-8&&(p=e.top-n-7)):i==="left"?(l=e.left-t-7,p=e.top+(e.height-n)/2,l<8&&(l=e.right+7)):i==="right"?(l=e.right+7,p=e.top+(e.height-n)/2,l+t>r-8&&(l=e.left-t-7)):(l=e.left+(e.width-t)/2,p=e.top-n-7,p<8&&(p=e.bottom+7)),{x:Math.max(8,Math.min(l,r-t-8)),y:Math.max(8,Math.min(p,a-n-8))}}function te(){C&&clearTimeout(C),C=setTimeout(()=>{K.value=void 0,C=null},100)}M(()=>{let e=K.value;if(!e)return;let{opts:t,anchor:n}=e,i=t.placement??"top",o=T("div.s-tt-tip role=tooltip visibility:hidden",t.attrs,()=>{T("mouseenter=",()=>{C&&(clearTimeout(C),C=null)}),T("mouseleave=",te),d(t.tip)});requestAnimationFrame(()=>{if(!document.body.contains(o))return;let{x:r,y:a}=Ie(n.getBoundingClientRect(),o.offsetWidth,o.offsetHeight,i);o.style.left=r+"px",o.style.top=a+"px",o.style.visibility=""})});function Pe(e){let t=n=>{C&&(clearTimeout(C),C=null),K.value={opts:e,anchor:n.currentTarget}};T("mouseenter=",t),T("mouseleave=",te),T("focusin=",t),T("focusout=",te),T.clean(()=>{K.value?.opts===e&&(K.value=void 0)})}export{ke as addContextMenu,Pe as addTooltip,Ce as alert,be as autocomplete,ge as box,O as button,xe as buttonChooser,z as buttonGroup,ve as checkbox,Se as confirm,U as dialog,ye as form,ie as getDarkMode,Ae as main,Q as menuButton,Me as prompt,Le as select,ue as setDarkMode,J as showFloatingMenu,Be as tabs,ze as textarea,X as textline,He as toast};
|
package/dist/theme.js
CHANGED
|
@@ -234,7 +234,7 @@ A.insertGlobalCss({
|
|
|
234
234
|
// Chromium): the thumb uses the surface's derived border token, so the bar
|
|
235
235
|
// tracks the active mode/re-skin and a nested surface's own colours.
|
|
236
236
|
"scrollbar-width:thin scrollbar-color: $s-border-strong transparent; " +
|
|
237
|
-
"background:$s-bg color:$s-fg",
|
|
237
|
+
"background:$s-bg color:$s-fg r:$s-radius",
|
|
238
238
|
// WebKit/older-Chromium counterpart to the standard `scrollbar-*` props above:
|
|
239
239
|
// a transparent track and a rounded thumb (border-clipped to leave breathing
|
|
240
240
|
// room) that brightens on hover.
|
|
@@ -243,12 +243,12 @@ A.insertGlobalCss({
|
|
|
243
243
|
".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb": "background:$s-border-strong border-radius:99px border: 2px solid transparent; background-clip:padding-box",
|
|
244
244
|
".s-s::-webkit-scrollbar-thumb:hover, .s-s ::-webkit-scrollbar-thumb:hover": "background:$s-fg-faint background-clip:padding-box",
|
|
245
245
|
// Tonal: the fill colour becomes the ink, over a soft tint of itself.
|
|
246
|
-
".s-s.tonal": "--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent);",
|
|
246
|
+
".s-s.tonal": "--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent); border: 1px solid $s-border;",
|
|
247
247
|
// Outlined: the fill colour is the ink; --s-bg *inherits* the parent's bg (the
|
|
248
248
|
// token the derivations read, so the edge mixes ink with the real surroundings)
|
|
249
249
|
// while the painted background is transparent, letting that parent fill — even
|
|
250
250
|
// a gradient or image — show through.
|
|
251
|
-
".s-s.outlined": "--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg);",
|
|
251
|
+
".s-s.outlined": "--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg); border: 1px solid $s-border;",
|
|
252
252
|
// Filled, explicit — last among the variants so a caller's `attrs: ".filled"`
|
|
253
253
|
// overrides a component's default `.tonal`/`.outlined` (resetting both the
|
|
254
254
|
// anchors and the painted background).
|
|
@@ -268,6 +268,11 @@ A.insertGlobalCss({
|
|
|
268
268
|
// the surface's own ink. (Keyed on the role modifier, so it holds across
|
|
269
269
|
// variants — and tracks the tonal/outlined fg remap.)
|
|
270
270
|
".s-s.primary, .s-s.secondary, .s-s.danger, .s-s.success, .s-s.warning, .s-s.gradient": "--s-accent:$s-fg --s-link:$s-fg",
|
|
271
|
+
// Tonal/outlined nested inside a filled accent surface would lose legibility:
|
|
272
|
+
// their transparency bleeds into the vivid parent fill. Swap in the neutral
|
|
273
|
+
// panel as a base so the role color reads as ink rather than fill.
|
|
274
|
+
// Specificity (4 classes) beats the 2-class variant rules — no !important needed.
|
|
275
|
+
".s-s.primary .s-s.tonal, .s-s.secondary .s-s.tonal, .s-s.gradient .s-s.tonal, .s-s.danger .s-s.tonal, .s-s.success .s-s.tonal, .s-s.warning .s-s.tonal, .s-s.primary .s-s.outlined, .s-s.secondary .s-s.outlined, .s-s.gradient .s-s.outlined, .s-s.danger .s-s.outlined, .s-s.success .s-s.outlined, .s-s.warning .s-s.outlined": "--s-bg: $s-panel; background: $s-panel;",
|
|
271
276
|
});
|
|
272
277
|
// A deliberately light reset. Colours/shape come from the contextual tokens, so
|
|
273
278
|
// rich content (e.g. markdown-to-HTML) adapts to whatever surface holds it. The
|
|
@@ -311,6 +316,15 @@ if (typeof document !== "undefined" && typeof requestAnimationFrame === "functio
|
|
|
311
316
|
root.classList.add("s-preload");
|
|
312
317
|
requestAnimationFrame(() => requestAnimationFrame(() => root.classList.remove("s-preload")));
|
|
313
318
|
}
|
|
319
|
+
// ── Disabled region ───────────────────────────────────────────────────────────
|
|
320
|
+
// aria-disabled="true" on any container dims it and blocks pointer events on
|
|
321
|
+
// it and all descendants, matching the per-element disabled look. Keyboard
|
|
322
|
+
// access to focusable descendants is unaffected — add the `inert` attribute too
|
|
323
|
+
// if you need that.
|
|
324
|
+
A.insertGlobalCss({
|
|
325
|
+
":disabled, [aria-disabled=true]": "opacity:0.45 filter:saturate(0.6) user-select:none",
|
|
326
|
+
":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *": "pointer-events:none cursor:not-allowed",
|
|
327
|
+
});
|
|
314
328
|
// ── Flow content: vertical rhythm & light typography ─────────────────────────
|
|
315
329
|
// Sensible block defaults for *any* content — your own UI just as much as
|
|
316
330
|
// markdown-rendered HTML. The rhythm: strip the browser's block margins, then
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "staffa",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "An opinionated component library for the Aberdeen reactive UI library.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"test": "shotest test"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
|
-
"aberdeen": "^1.
|
|
35
|
+
"aberdeen": "^1.18.1"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"aberdeen": "^1.
|
|
38
|
+
"aberdeen": "^1.18.1",
|
|
39
39
|
"esbuild": "^0.28.0",
|
|
40
40
|
"http-server": "^14.1.1",
|
|
41
41
|
"jsdom": "^29.1.1",
|
package/src/components/button.ts
CHANGED
|
@@ -30,17 +30,16 @@ export interface ButtonOptions {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
// The button is a `.s-s` surface (defaulting to `.primary` in button() below), so
|
|
33
|
-
// its colours come from the surface classes in theme.ts.
|
|
34
|
-
// layout,
|
|
33
|
+
// its colours, border, and border-radius come from the surface classes in theme.ts.
|
|
34
|
+
// This rule only handles layout, focus, hover and sizing.
|
|
35
35
|
A.insertGlobalCss({
|
|
36
36
|
".s-btn": {
|
|
37
37
|
"&":
|
|
38
38
|
"display:inline-flex align-items:center justify-content:center gap:$2 " +
|
|
39
39
|
"font-weight:600 line-height:1.2 white-space:nowrap cursor:pointer text-decoration:none " +
|
|
40
|
-
"border:
|
|
40
|
+
"border:0 padding: 0.5em 1em; " +
|
|
41
41
|
"transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;",
|
|
42
42
|
"&:focus-visible": "outline:none box-shadow: 0 0 0 3px $s-focus;",
|
|
43
|
-
"&:disabled, &[aria-disabled=true]": "opacity:0.45 cursor:not-allowed pointer-events:none filter:saturate(0.6)",
|
|
44
43
|
// Hover feedback is colour-only (no movement). The filled `.gradient` CTA
|
|
45
44
|
// below layers a deeper shadow on top, so it still reads as the signature action.
|
|
46
45
|
"&:hover": "filter: brightness(1.08)",
|
|
@@ -54,11 +53,11 @@ A.insertGlobalCss({
|
|
|
54
53
|
// artifact where a gradient clipped to a transparent rounded border fringes
|
|
55
54
|
// the edge with the gradient's far colour.
|
|
56
55
|
"&.gradient:not(.tonal):not(.outlined)":
|
|
57
|
-
"
|
|
56
|
+
"box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), $s-glow;",
|
|
58
57
|
"&.gradient:not(.tonal):not(.outlined):hover":
|
|
59
58
|
"filter: brightness(1.05); box-shadow: inset 0 1px 0 color-mix(in srgb, white 25%, transparent), 0 7px 18px color-mix(in srgb, $s-primary 34%, transparent);",
|
|
60
59
|
// Subtle press feedback.
|
|
61
|
-
"&:active:not(:disabled)
|
|
60
|
+
"&:active:not(:disabled)": "transform: translateY(1px)",
|
|
62
61
|
// Size: set on the button itself, or inherited from a `.small`/`.large`
|
|
63
62
|
// parent (e.g. a buttonGroup), so a container can size all its buttons at once.
|
|
64
63
|
"&.small, .small > &": "padding: 0.32em 0.7em; font-size:0.85em",
|
|
@@ -71,8 +70,8 @@ A.insertGlobalCss({
|
|
|
71
70
|
const ROLE_CLASS = /\.(gradient|primary|secondary|neutral|danger|success|warning|base|panel|raised)(\.|\s|$)/;
|
|
72
71
|
|
|
73
72
|
/**
|
|
74
|
-
* A button.
|
|
75
|
-
*
|
|
73
|
+
* A button. Tonal and outlined variants show a border; filled variants rely on
|
|
74
|
+
* their solid background for affordance.
|
|
76
75
|
*
|
|
77
76
|
* Shortcut: pass a string to use it as the label, or a function for custom
|
|
78
77
|
* content.
|
|
@@ -18,7 +18,7 @@ A.insertGlobalCss({
|
|
|
18
18
|
".s-check": {
|
|
19
19
|
"&": "display:flex flex-direction:column gap:$1",
|
|
20
20
|
"> label": "display:flex align-items:center gap:$2 cursor:pointer user-select:none",
|
|
21
|
-
"> label:has(input:disabled)": "cursor:not-allowed opacity:0.6",
|
|
21
|
+
"> label:has(input:disabled)": "cursor:not-allowed opacity:0.45 filter:saturate(0.6)",
|
|
22
22
|
// Native control styled with accent-color: accessible and zero-fuss.
|
|
23
23
|
"input": "width:1.15em height:1.15em accent-color:$s-accent cursor:inherit m:0",
|
|
24
24
|
},
|
package/src/components/field.ts
CHANGED
|
@@ -45,8 +45,7 @@ A.insertGlobalCss({
|
|
|
45
45
|
"&": "w:100% bg:$s-panel fg:$s-ink border: 1px solid $s-border; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;",
|
|
46
46
|
"&:hover:not(:disabled)": "border-color:$s-border-strong",
|
|
47
47
|
"&:focus-visible": "border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none",
|
|
48
|
-
|
|
49
|
-
"&[aria-invalid=true]": "border-color:$s-danger",
|
|
48
|
+
"&[aria-invalid=true]": "border-color:$s-danger",
|
|
50
49
|
},
|
|
51
50
|
});
|
|
52
51
|
|
package/src/components/tabs.ts
CHANGED
|
@@ -41,8 +41,7 @@ A.insertGlobalCss({
|
|
|
41
41
|
"border-bottom: 3px solid transparent; margin-bottom:-1px " +
|
|
42
42
|
"transition: color 0.15s, background 0.15s, border-color 0.15s;",
|
|
43
43
|
".s-tab:hover:not(:disabled), .s-tab[aria-selected=true]": "color: $s-fg;",
|
|
44
|
-
|
|
45
|
-
".s-tab:focus-visible": "outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",
|
|
44
|
+
".s-tab:focus-visible": "outline:none box-shadow: 0 0 0 3px $s-focus; r: $s-radius;",
|
|
46
45
|
".s-tab[aria-selected=true]": "border-image: $s-gradient 1;",
|
|
47
46
|
".s-tabpanel": "display:block",
|
|
48
47
|
},
|
package/src/components/toast.ts
CHANGED
|
@@ -13,7 +13,7 @@ export interface ToastOptions {
|
|
|
13
13
|
*/
|
|
14
14
|
type?: "success" | "danger" | "warning" | "neutral"
|
|
15
15
|
/**
|
|
16
|
-
* Auto-dismiss delay in milliseconds. Defaults to `
|
|
16
|
+
* Auto-dismiss delay in milliseconds. Defaults to `6000`.
|
|
17
17
|
* Pass `0` to make the toast persistent until dismissed manually.
|
|
18
18
|
*/
|
|
19
19
|
duration?: number;
|
|
@@ -37,7 +37,7 @@ A.insertGlobalCss({
|
|
|
37
37
|
"&":
|
|
38
38
|
"display:flex align-items:flex-start gap:$2 " +
|
|
39
39
|
"padding: $3; border: 1px solid $s-border; r:$s-radius box-shadow:$s-shadow " +
|
|
40
|
-
"pointer-events:auto",
|
|
40
|
+
"pointer-events:auto position:relative overflow:hidden",
|
|
41
41
|
".s-toast-body": "display:flex flex-direction:column gap:$1 flex:1 min-width:0",
|
|
42
42
|
".s-toast-title": "font-weight:700 line-height:1.3",
|
|
43
43
|
".s-toast-msg": "font-size:0.9em fg:$s-fg-muted line-height:1.4",
|
|
@@ -46,6 +46,7 @@ A.insertGlobalCss({
|
|
|
46
46
|
"padding: 0 0.15em; r:4px flex-shrink:0 align-self:flex-start",
|
|
47
47
|
".s-toast-close:hover": "fg:$s-fg",
|
|
48
48
|
".s-toast-close:focus-visible": "outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-fg",
|
|
49
|
+
".s-toast-progress": "position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%",
|
|
49
50
|
},
|
|
50
51
|
});
|
|
51
52
|
|
|
@@ -54,15 +55,47 @@ let toastCount = 0;
|
|
|
54
55
|
const toasts = A.proxy({} as Record<number, ToastEntry>);
|
|
55
56
|
|
|
56
57
|
mountPortal(() => {
|
|
57
|
-
//
|
|
58
|
-
|
|
58
|
+
// In initial peek is here to NOT subscribe to changes once `toasts` first becomes non empty,
|
|
59
|
+
// leaving the container in the DOM forever after. (So as not to cut of hide animations.)
|
|
60
|
+
if (A.peek(() => A.isEmpty(toasts)) && A.isEmpty(toasts)) return;
|
|
59
61
|
A("div.s-toasts aria-live=polite aria-atomic=false", () => {
|
|
60
62
|
A.onEach(toasts, (entry) => {
|
|
61
|
-
const { opts } = entry;
|
|
63
|
+
const { opts, id } = entry;
|
|
62
64
|
const role = opts.type === "danger" || opts.type === "warning" ? "alert" : "status";
|
|
63
65
|
const surface = opts.type ?? "neutral";
|
|
66
|
+
const duration = opts.duration ?? 6000;
|
|
67
|
+
|
|
68
|
+
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
69
|
+
let progressEl: HTMLElement | null = null;
|
|
70
|
+
|
|
71
|
+
const startCountdown = () => {
|
|
72
|
+
clearTimeout(timer);
|
|
73
|
+
if (progressEl) {
|
|
74
|
+
progressEl.style.transition = "none";
|
|
75
|
+
progressEl.style.width = "100%";
|
|
76
|
+
progressEl.offsetWidth; // force reflow so transition triggers
|
|
77
|
+
progressEl.style.transition = `width ${duration}ms linear`;
|
|
78
|
+
progressEl.style.width = "0%";
|
|
79
|
+
}
|
|
80
|
+
timer = setTimeout(() => dismiss(id), duration);
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const stopCountdown = () => {
|
|
84
|
+
clearTimeout(timer);
|
|
85
|
+
timer = undefined;
|
|
86
|
+
if (progressEl) {
|
|
87
|
+
progressEl.style.transition = "none";
|
|
88
|
+
progressEl.style.width = "100%";
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
A.clean(() => clearTimeout(timer));
|
|
64
93
|
|
|
65
94
|
A(`div.s-toast.s-s.${surface} role=${role}`, "create=", grow, "destroy=", shrink, opts.attrs, () => {
|
|
95
|
+
if (duration > 0) {
|
|
96
|
+
A("mouseenter=", stopCountdown);
|
|
97
|
+
A("mouseleave=", startCountdown);
|
|
98
|
+
}
|
|
66
99
|
A("div.s-toast-body", () => {
|
|
67
100
|
A(() => {
|
|
68
101
|
if (opts.title != null) A("div.s-toast-title", () => drawSlot(opts.title));
|
|
@@ -73,10 +106,17 @@ mountPortal(() => {
|
|
|
73
106
|
if (opts.dismissible === false) return;
|
|
74
107
|
A("button.s-toast-close type=button aria-label=Dismiss", () => {
|
|
75
108
|
A("#×");
|
|
76
|
-
A("click=", () => dismiss(
|
|
109
|
+
A("click=", () => dismiss(id));
|
|
77
110
|
});
|
|
78
111
|
});
|
|
112
|
+
if (duration > 0) {
|
|
113
|
+
progressEl = A("div.s-toast-progress") as HTMLElement;
|
|
114
|
+
}
|
|
79
115
|
});
|
|
116
|
+
|
|
117
|
+
if (duration > 0) {
|
|
118
|
+
requestAnimationFrame(startCountdown);
|
|
119
|
+
}
|
|
80
120
|
});
|
|
81
121
|
});
|
|
82
122
|
});
|
|
@@ -87,7 +127,7 @@ function dismiss(id: number): void {
|
|
|
87
127
|
|
|
88
128
|
/**
|
|
89
129
|
* Show a toast notification. Returns a `dismiss()` function to remove it
|
|
90
|
-
* programmatically. Auto-dismisses after `duration` ms (default
|
|
130
|
+
* programmatically. Auto-dismisses after `duration` ms (default 6 000).
|
|
91
131
|
*
|
|
92
132
|
* @example
|
|
93
133
|
* ```ts
|
|
@@ -100,15 +140,5 @@ function dismiss(id: number): void {
|
|
|
100
140
|
export function toast(opts: ToastOptions): () => void {
|
|
101
141
|
const id = ++toastCount;
|
|
102
142
|
toasts[id] = { id, opts };
|
|
103
|
-
|
|
104
|
-
const duration = opts.duration ?? 4000;
|
|
105
|
-
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
106
|
-
if (duration > 0) {
|
|
107
|
-
timer = setTimeout(() => dismiss(id), duration);
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
return () => {
|
|
111
|
-
if (timer != null) clearTimeout(timer);
|
|
112
|
-
dismiss(id);
|
|
113
|
-
};
|
|
143
|
+
return () => dismiss(id);
|
|
114
144
|
}
|
package/src/theme.ts
CHANGED
|
@@ -244,7 +244,7 @@ A.insertGlobalCss({
|
|
|
244
244
|
// Chromium): the thumb uses the surface's derived border token, so the bar
|
|
245
245
|
// tracks the active mode/re-skin and a nested surface's own colours.
|
|
246
246
|
"scrollbar-width:thin scrollbar-color: $s-border-strong transparent; " +
|
|
247
|
-
"background:$s-bg color:$s-fg",
|
|
247
|
+
"background:$s-bg color:$s-fg r:$s-radius",
|
|
248
248
|
// WebKit/older-Chromium counterpart to the standard `scrollbar-*` props above:
|
|
249
249
|
// a transparent track and a rounded thumb (border-clipped to leave breathing
|
|
250
250
|
// room) that brightens on hover.
|
|
@@ -253,12 +253,12 @@ A.insertGlobalCss({
|
|
|
253
253
|
".s-s::-webkit-scrollbar-thumb, .s-s ::-webkit-scrollbar-thumb": "background:$s-border-strong border-radius:99px border: 2px solid transparent; background-clip:padding-box",
|
|
254
254
|
".s-s::-webkit-scrollbar-thumb:hover, .s-s ::-webkit-scrollbar-thumb:hover": "background:$s-fg-faint background-clip:padding-box",
|
|
255
255
|
// Tonal: the fill colour becomes the ink, over a soft tint of itself.
|
|
256
|
-
".s-s.tonal": "--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent);",
|
|
256
|
+
".s-s.tonal": "--s-fg:$s-b --s-bg: color-mix(in srgb, $s-b 16%, transparent); border: 1px solid $s-border;",
|
|
257
257
|
// Outlined: the fill colour is the ink; --s-bg *inherits* the parent's bg (the
|
|
258
258
|
// token the derivations read, so the edge mixes ink with the real surroundings)
|
|
259
259
|
// while the painted background is transparent, letting that parent fill — even
|
|
260
260
|
// a gradient or image — show through.
|
|
261
|
-
".s-s.outlined": "--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg);",
|
|
261
|
+
".s-s.outlined": "--s-fg:$s-b --s-bg:inherit background:transparent --s-border: color-mix(in srgb, $s-fg 55%, $s-bg); border: 1px solid $s-border;",
|
|
262
262
|
// Filled, explicit — last among the variants so a caller's `attrs: ".filled"`
|
|
263
263
|
// overrides a component's default `.tonal`/`.outlined` (resetting both the
|
|
264
264
|
// anchors and the painted background).
|
|
@@ -279,6 +279,12 @@ A.insertGlobalCss({
|
|
|
279
279
|
// the surface's own ink. (Keyed on the role modifier, so it holds across
|
|
280
280
|
// variants — and tracks the tonal/outlined fg remap.)
|
|
281
281
|
".s-s.primary, .s-s.secondary, .s-s.danger, .s-s.success, .s-s.warning, .s-s.gradient": "--s-accent:$s-fg --s-link:$s-fg",
|
|
282
|
+
// Tonal/outlined nested inside a filled accent surface would lose legibility:
|
|
283
|
+
// their transparency bleeds into the vivid parent fill. Swap in the neutral
|
|
284
|
+
// panel as a base so the role color reads as ink rather than fill.
|
|
285
|
+
// Specificity (4 classes) beats the 2-class variant rules — no !important needed.
|
|
286
|
+
".s-s.primary .s-s.tonal, .s-s.secondary .s-s.tonal, .s-s.gradient .s-s.tonal, .s-s.danger .s-s.tonal, .s-s.success .s-s.tonal, .s-s.warning .s-s.tonal, .s-s.primary .s-s.outlined, .s-s.secondary .s-s.outlined, .s-s.gradient .s-s.outlined, .s-s.danger .s-s.outlined, .s-s.success .s-s.outlined, .s-s.warning .s-s.outlined":
|
|
287
|
+
"--s-bg: $s-panel; background: $s-panel;",
|
|
282
288
|
});
|
|
283
289
|
|
|
284
290
|
// A deliberately light reset. Colours/shape come from the contextual tokens, so
|
|
@@ -326,6 +332,16 @@ if (typeof document !== "undefined" && typeof requestAnimationFrame === "functio
|
|
|
326
332
|
requestAnimationFrame(() => requestAnimationFrame(() => root.classList.remove("s-preload")));
|
|
327
333
|
}
|
|
328
334
|
|
|
335
|
+
// ── Disabled region ───────────────────────────────────────────────────────────
|
|
336
|
+
// aria-disabled="true" on any container dims it and blocks pointer events on
|
|
337
|
+
// it and all descendants, matching the per-element disabled look. Keyboard
|
|
338
|
+
// access to focusable descendants is unaffected — add the `inert` attribute too
|
|
339
|
+
// if you need that.
|
|
340
|
+
A.insertGlobalCss({
|
|
341
|
+
":disabled, [aria-disabled=true]": "opacity:0.45 filter:saturate(0.6) user-select:none",
|
|
342
|
+
":disabled, [aria-disabled=true], :disabled *, [aria-disabled=true] *": "pointer-events:none cursor:not-allowed",
|
|
343
|
+
});
|
|
344
|
+
|
|
329
345
|
// ── Flow content: vertical rhythm & light typography ─────────────────────────
|
|
330
346
|
// Sensible block defaults for *any* content — your own UI just as much as
|
|
331
347
|
// markdown-rendered HTML. The rhythm: strip the browser's block margins, then
|