staffa 0.7.1 → 0.7.3
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/dist/components/main.js +4 -0
- package/dist/staffa.esm.js +1 -1
- package/dist/theme.js +1 -1
- package/package.json +2 -3
- package/skill/ButtonOptions.md +1 -1
- package/skill/FloatingMenuOptions.md +16 -0
- package/skill/SKILL.md +15 -17
- package/skill/button.md +1 -1
- package/skill/buttonGroup.md +3 -3
- package/skill/dialog.md +1 -1
- package/skill/menuButton.md +1 -1
- package/src/components/main.ts +4 -0
- package/src/theme.ts +1 -1
package/dist/components/main.js
CHANGED
|
@@ -6,6 +6,10 @@ A.insertGlobalCss({
|
|
|
6
6
|
".s-main": {
|
|
7
7
|
// container-type so @container queries below can respond to shell width.
|
|
8
8
|
"&": "display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size",
|
|
9
|
+
// <body> carries a default $3 padding; when the shell is a direct child of it,
|
|
10
|
+
// cancel that padding with matching negative margins so the chrome still spans
|
|
11
|
+
// edge to edge (and the 100vh sizing stays exact).
|
|
12
|
+
"body > &": "margin: calc(-1 * $3)",
|
|
9
13
|
// Header/footer stretch their background the full shell width; their inner
|
|
10
14
|
// `.s-bar` caps to maxWidth and centres, so chrome aligns with the content.
|
|
11
15
|
// The top bar is a full-width `.neutral` surface; cancel its surface border and
|
package/dist/staffa.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import O from"aberdeen";var V="staffa:darkMode",re=O.proxy({value:me()});function me(){try{let e=localStorage.getItem(V);if(e==="dark")return!0;if(e==="light")return!1}catch{}}function be(e){re.value=e;try{e===void 0?localStorage.removeItem(V):localStorage.setItem(V,e?"dark":"light")}catch{}}function ae(e=!1){let t=re.value;return t===void 0&&!e?O.darkMode():t}O(()=>{ae()?O.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#0e0f12 --s-text:#e9eaec",".s-s.neutral":"--s-bg:#191b1f --s-text:#e9eaec",".s-s.neutral .s-s.neutral":"--s-bg:#23262b"}):O.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#eef0f3 --s-text:#1d1f24",".s-s.neutral, .s-s.neutral":"--s-bg:#ffffff --s-text:#1d1f24",".s-s.neutral .s-s.neutral":"--s-bg:#f6f7f9"})});O.setSpacingCssVars(1.1);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 background-color:$s-bg text:$s-text",a:"color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select, optgroup":"font:inherit color:inherit","input:where(:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=image],[type=submit],[type=button],[type=reset],[type=hidden])), textarea, select":"background:$s-bg border: 1px solid $s-faint; r:$s-radius-sm padding: 0.45em 0.65em; max-width:100%","input:where([type=checkbox],[type=radio])":"width:1.15em height:1.15em cursor:pointer","input[type=range]":"appearance:none background:transparent cursor:pointer vertical-align:middle","input[type=range]::-webkit-slider-runnable-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-progress":"height:4px r:99px background:$s-accent","input[type=range]::-webkit-slider-thumb":"appearance:none width:16px height:16px margin-top:-6px r:50% background:$s-accent","input[type=range]::-moz-range-thumb":"width:16px height:16px border:0 r:50% background:$s-accent","input[type=file]":"cursor:pointer",progress:"appearance:none border:0 height:6px r:99px background:$s-faint overflow:hidden vertical-align:middle","progress::-webkit-progress-bar":"background:$s-faint r:99px","progress::-webkit-progress-value":"background:$s-accent r:99px","progress::-moz-progress-bar":"background:$s-accent r:99px",meter:"vertical-align:middle",fieldset:"border: 1px solid $s-faint; r:$s-radius-sm padding:$2 min-width:0",legend:"padding: 0 $1; font-weight:600","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-text, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-text, $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-faint;","::placeholder":"color: $s-muted; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-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;"},":root":"--s-primary:#00a884 --s-danger:#dc5b41 --s-success:#00a884 --s-warning:#ef6b00 --s-link:#3f8cd8 --s-radius-sm:6px --s-radius:12px --s-radius-lg:18px --s-focus: color-mix(in srgb, $s-primary 38%, transparent); --s-gradient: linear-gradient(135deg, color-mix(in oklab, $s-primary, white 16%), color-mix(in oklab, $s-primary, black 14%));",":root, .s-s.neutral":"--s-accent:$s-primary --s-link-fg:$s-link",".s-s:not(.neutral)":"--s-bg:$s-primary border:0 --s-text:#eee --s-accent:#fff --s-link-fg:#eef --s-muted: color-mix(in srgb, #fff 70%, transparent); --s-faint: color-mix(in srgb, #fff 30%, transparent);",".s-s.danger":"--s-bg:$s-danger",".s-s.success":"--s-bg:$s-success",".s-s.warning":"--s-bg:$s-warning",".s-s.link":"--s-bg:$s-link",".s-s.primary":"--s-bg:$s-primary",":root, .s-s":"--s-muted: color-mix(in oklab, $s-text, $s-bg 42%); --s-faint: color-mix(in oklab, $s-text, $s-bg 80%); color:$s-text accent-color:$s-accent scrollbar-width:thin scrollbar-color: $s-faint transparent;",".s-s, body":"background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));",".s-s":"r:$s-radius",":where(.s-s.neutral)":"border: 1px solid $s-faint;",".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-faint border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s.shadow.neutral:not(.s-btn)":"box-shadow: 0 4px 14px rgba(0,0,0,0.13);",".s-s.extra-shadow.neutral:not(.s-btn)":"box-shadow: 0 18px 50px rgba(0,0,0,0.28);",".s-s.shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 4px 14px color-mix(in srgb, $s-bg 30%, transparent);",".s-s.extra-shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 14px 40px color-mix(in srgb, $s-bg 40%, transparent);",".s-s.no-shadow":"box-shadow: none !important;",".s-s:not(.neutral).tonal, .s-s:not(.neutral).outlined":"--s-text:$s-bg --s-accent:$s-bg --s-link-fg:$s-bg --s-faint: color-mix(in srgb, $s-bg 30%, transparent); --s-muted: color-mix(in srgb, $s-bg 70%, transparent);",".s-s:not(.neutral).tonal":"background: color-mix(in srgb, $s-bg 15%, transparent); border: 1px solid $s-faint;",".s-s:not(.neutral).outlined":"background: transparent; border: 1px solid color-mix(in srgb, $s-bg 45%, transparent);",".s-s:not(.neutral) .s-s.tonal, .s-s:not(.neutral) .s-s.outlined":"--s-text:#fff --s-accent:#fff --s-link-fg:#fff background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%)); border-color: transparent;"});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")))}O.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 ge="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";O.insertGlobalCss({[`${ge}`]:{"&":"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-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-faint; padding-left: $3; fg: $s-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-faint; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-faint;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-muted font-size:0.9em margin-top:$1 text-align:center"});import l from"aberdeen";import se from"aberdeen";var he=0;function S(e="s"){return`${e}-${++he}`}function d(e,...t){e!=null&&(typeof e=="function"?e(...t):se("rich=",e))}var xe="a[href], button, input, select, textarea, [tabindex]";function Y(e,t){let n=o=>o instanceof HTMLElement&&!o.hasAttribute("disabled")&&o.getAttribute("aria-disabled")!=="true"&&o.tabIndex>=0&&o.getClientRects().length>0,i=(t?[...e.querySelectorAll(t)].find(n):void 0)??[...e.querySelectorAll(xe)].find(n);return i?.focus(),i!=null}function L(e){queueMicrotask(()=>se(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-text user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"}});function q(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)}l.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","> .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 background: color-mix(in oklab, $s-bg, $s-text 10%); border: 1px solid $s-faint; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-text background:$s-faint",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","> .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-text 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-muted"}});function ye(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label??e.value}}function ve(e){let t=S("ac-menu"),n=l.proxy({query:"",open:!1,active:0}),i=()=>(typeof e.options=="function"?e.options():e.options).map(ye),o=()=>{let p=e.bind?.value;return p==null||p===""?[]:Array.isArray(p)?p:[p]},r=p=>i().find(v=>v.value===p)?.label??p;if(!e.multi){let p=e.bind?l.peek(e.bind,"value"):void 0;typeof p=="string"&&p&&(n.query=l.peek(()=>r(p)))}let a=()=>{let p=new Set(o()),v=i();e.multi&&(v=v.filter(h=>!p.has(h.value)));let g=n.query.trim().toLowerCase();return g&&(v=v.filter(h=>h.label.toLowerCase().includes(g))),v},s=(p,v)=>{if(e.multi){let g=Array.isArray(e.bind?.value)?[...e.bind.value]:[];g.includes(p)||g.push(p),e.bind&&(e.bind.value=g),n.query=""}else e.bind&&(e.bind.value=p),n.query=r(p),n.open=!1;n.active=0,v?.focus()},c=p=>{if(!e.bind)return;let v=e.bind.value??[];e.bind.value=v.filter(g=>g!==p)};q(e,(p,v)=>{l("div.s-ac",e.inputAttrs,()=>{l(()=>l("aria-invalid=",v()?"true":"false"));let g;l("div.s-control",()=>{l("click=",()=>g?.focus()),l(()=>{if(e.multi)for(let h of o())l("span.s-chip",()=>{l("span #",l.peek(()=>r(h))),l("button type=button aria-label=",`Remove ${h}`,()=>{l("#\xD7"),l("click=",$=>{$.stopPropagation(),c(h),g?.focus()})})})}),g=l("input type=text role=combobox autocomplete=off",()=>{l(`id=${p} aria-controls=${t} aria-autocomplete=list`),e.placeholder!=null&&l("placeholder=",e.placeholder),e.disabled&&l("disabled=true"),e.required&&l("aria-required=true"),l("bind=",l.ref(n,"query")),l(()=>l("aria-expanded=",n.open?"true":"false")),l(()=>{let $=a()[n.active];l("aria-activedescendant=",n.open&&$?`${t}-opt-${n.active}`:"")}),l("input=",()=>{n.open=!0,n.active=0}),l("focus=",()=>{n.open=!0}),l("blur=",()=>{setTimeout(()=>U(),150)}),l("keydown=",h=>C(h,g))})}),l(()=>{if(!n.open)return;let h=a(),$=n.query.trim(),ie=e.allowCustom!==!1&&$!==""&&!h.some(K=>K.label.toLowerCase()===$.toLowerCase());l("ul.s-menu.s-s.neutral.shadow role=listbox",`id=${t}`,()=>{h.forEach((K,_)=>{l("li.s-option role=option",`id=${t}-opt-${_}`,()=>{l(()=>l("aria-selected=",n.active===_?"true":"false")),l("#",K.label),l("mousedown=",fe=>fe.preventDefault()),l("click=",()=>s(K.value,g)),l("mousemove=",()=>{n.active=_})})}),ie&&l("li.s-option.s-add role=option",()=>{l("#",`Add "${$}"`),l("mousedown=",K=>K.preventDefault()),l("click=",()=>s($,g))}),h.length===0&&!ie&&l("li.s-empty #No matches")})}),l(()=>{if(e.name)if(e.multi)for(let h of o())l("input type=hidden",()=>{l("name=",e.name),l("value=",h)});else l("input type=hidden",()=>{l("name=",e.name),l("value=",o()[0]??"")})})})});function C(p,v){let g=a(),h=g.length-1;if(p.key==="ArrowDown")p.preventDefault(),n.open=!0,n.active=Math.min(h,n.active+1);else if(p.key==="ArrowUp")p.preventDefault(),n.active=Math.max(0,n.active-1);else if(p.key==="Enter"){p.preventDefault();let $=g[n.active];$?s($.value,v):e.allowCustom!==!1&&n.query.trim()?s(n.query.trim(),v):n.open&&(n.open=!1)}else if(p.key==="Escape")n.open=!1,e.multi||(n.query=r(o()[0]??""));else if(p.key==="Backspace"&&e.multi&&n.query===""){let $=o();$.length&&c($[$.length-1])}}function U(){n.open=!1,e.multi?n.query="":e.allowCustom!==!1&&n.query.trim()?s(n.query.trim()):n.query=r(o()[0]??"")}}import z from"aberdeen";z.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column overflow:hidden r: $s-radius-lg;","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0","> div":"p:$3 gap:$3"}});function we(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;z("section.s-box.s-s.neutral.shadow",t.attrs,()=>{z(()=>{t.header!=null&&z("header.s-s.neutral",t.headerAttrs,()=>d(t.header))}),z("div",t.contentAttrs,()=>{d(t.content)}),z(()=>{t.footer!=null&&z("footer.s-s.neutral",t.footerAttrs,()=>d(t.footer))})})}import F from"aberdeen";F.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:450 line-height:1.1 white-space:nowrap cursor:pointer text-decoration:none padding: $m2 $m3; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline: 3px solid $s-focus; outline-offset: 1px;","&:hover":"filter: brightness(1.06)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-bg 24%, transparent);","&.neutral:hover":"filter:none background: color-mix(in srgb, $s-text 8%, $s-bg);","&:active:not(:disabled)":"transform: translateY(1px)","&.small, .small > &":"padding: $m1 $m2; font-size:0.85em border-radius:$s-radius-sm","&.large, .large > &":"font-size:1.4em border-radius:$s-radius-lg"}});function A(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e,n=t.href!=null?"a":"button";F(`${n}.s-btn.s-s.shadow`,t.attrs,()=>{t.href!=null?(F(`href=${t.href} role=button`),t.disabled&&F("aria-disabled=true")):(F("type=",t.type??"button"),t.disabled&&F("disabled=true")),t.ariaLabel&&F("aria-label=",t.ariaLabel),t.click&&F("click=",t.click),d(t.icon),d(t.content)})}import X from"aberdeen";import le from"aberdeen";le.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 H(e={}){let n=`.s-${e.layout??"attached"}${e.vertical?".s-vertical":""}`;le(`div.s-bgroup${n} role=group`,e.attrs,()=>{if(e.buttons)for(let i of e.buttons)A(i);d(e.content)})}function $e(e){X(()=>{let t=e.bind.value;H({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",click:()=>{e.bind.value=e.allowDeselect&&t===n?void 0:n}}))})}),e.name&&X(()=>X(`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:"cursor:inherit m:0"}});function ke(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 D from"aberdeen";D.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 Ae(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;D("form.s-form",t.attrs,()=>{D(()=>{D(".grid=",t.layout==="grid")}),D("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),D(()=>{t.actions&&D("footer",t.actionsAttrs,()=>d(t.actions))})})}import u from"aberdeen";import y from"aberdeen";import{matchCurrent as Oe}from"aberdeen/route";y.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 r:$s-radius-lg 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":"display:flex align-items:center gap:$2 w:100% outline:0 padding: $m2 0; line-height:1.1 r:$s-radius cursor:pointer text-align:left font-weight:450 font-size:0.9em border:0 background:transparent fg:$s-text text-decoration:none transition: color 0.12s, transform 0.12s, text-shadow 0.12s;",".s-menu-item:focus-visible:not([aria-current=page]), .s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page])":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);",".s-menu-item[aria-current=page]":"text-shadow: 0 0 2px $s-primary; color: color-mix(in lab, $s-primary 50%, $s-text); filter:brightness(1.15)",".s-menu-item[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-faint 18%, $s-faint 82%, transparent);"});function J(e,t){y("keydown=",n=>{if(n.key==="Enter"&&n.target.tagName==="A"){queueMicrotask(()=>t?.());return}if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"&&n.key!=="Home"&&n.key!=="End")return;n.preventDefault();let o=[...n.currentTarget.querySelectorAll(".s-menu-item")].filter(c=>c.getAttribute("aria-disabled")!=="true");if(!o.length)return;let r=o.indexOf(document.activeElement),a=n.key==="ArrowUp"?-1:1,s=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[s].focus()});for(let n of e){if(typeof n=="string"||typeof n=="function"){d(n);continue}if("separator"in n){y("hr.s-menu-sep");continue}y(n.href?"a.s-menu-item":"button.s-menu-item type=button",n.attrs,()=>{n.href&&(y("href=",n.href),n.target&&y("target=",n.target),y(()=>{Oe(n.href)&&y("aria-current=page")})),n.disabled&&y("aria-disabled=true"),y("click=",i=>{if(n.disabled){i.preventDefault();return}t?.(),n.click?.(i)}),n.icon&&y("span.s-menu-icon",()=>d(n.icon)),d(n.label)})}}var B=y.proxy({opts:null});function G(){let e=B.opts?.anchor;B.opts=null,e?.focus()}function de(){return B.opts!=null}function Ee(e,t){let n=e.offsetWidth,i=e.offsetHeight,o=window.innerWidth,r=window.innerHeight,a=4,s=t.left;s+n>o-8&&(s=Math.max(8,t.right-n));let c=t.bottom+a;c+i>r-8&&t.top-i-a>=8&&(c=t.top-i-a),e.style.left=Math.max(8,s)+"px",e.style.top=Math.max(8,c)+"px"}L(()=>{let e=B.opts;if(!e)return;let t=y("div.s-menu-list.s-s.neutral.shadow create=hidden destroy=hidden",e.dropdownAttrs,()=>{J(e.items,G)}),n=o=>{let r=o.target;!t.contains(r)&&(e.closeOnAnchorClick||!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),y.clean(()=>{document.removeEventListener("click",n,!0),document.removeEventListener("keydown",i,!0)}),requestAnimationFrame(()=>{if(!document.body.contains(t))return;let o=e.at?{left:e.at.x,right:e.at.x,top:e.at.y,bottom:e.at.y}:e.anchor.getBoundingClientRect();Ee(t,o),Y(t,".s-menu-item[aria-current=page]")})});function Q(e){return B.opts=e,G}function Te(e){let t=null;y.clean(()=>{B.opts?.anchor===t&&G()}),y("contextmenu=",n=>{n.preventDefault(),t=n.currentTarget,Q({items:e.items,anchor:t,at:{x:n.clientX,y:n.clientY},closeOnAnchorClick:!0,dropdownAttrs:e.dropdownAttrs})})}function Z(e){let t=null;y.clean(()=>{B.opts?.anchor===t&&G()}),A({icon:()=>y("span aria-hidden=true #\u2630"),...e.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral",...e.button,click:n=>{if(t=n.currentTarget,B.opts?.anchor===t){G();return}Q({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})}})}import f from"aberdeen";import I from"aberdeen";function ee(e={}){q(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) r: $s-radius-lg; 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:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0 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 P=f.proxy({}),te=0,ue=f.derive(()=>{let e=Object.keys(P);if(e.length)return e[e.length-1]});function ce(){return ue.value!=null}L(()=>{f.onEach(P,({resolve:e,opts:t},n)=>{let i=()=>{delete P[n]};f.clean(()=>{t.onClose?.(),e()});let o=f.derive(()=>ue.value!=n);f("div.s-backdrop create=hidden destroy=hidden .hidden=",o,"click=",()=>{t.allowCancel!==!1&&i()});let r=f("div.s-dialog.neutral.s-s.extra-shadow create=hidden destroy=hidden",t.attrs,()=>{f(()=>{t.header!=null&&f("header.s-s.neutral",t.headerAttrs,()=>d(t.header))}),f("div",t.contentAttrs,()=>{d(t.content,i)}),f(()=>{t.footer!=null&&f("footer.s-s.neutral",t.footerAttrs,()=>d(t.footer))})});requestAnimationFrame(()=>{document.body.contains(r)&&Y(r)})})});function N(e){te||document.addEventListener("keydown",n=>{if(n.key==="Escape"&&e.allowCancel!==!1){let i=f.unproxy(P);for(let o=te;o>0;o--)if(i[o]){i[o].opts.allowCancel!==!1&&delete P[o];break}}});let t=++te;return e.cancelWithScope!==!1&&f.clean(()=>{delete P[t]}),new Promise(n=>{P[t]={resolve:n,opts:e}})}function Me(e,t={}){return N({header:"Alert",allowCancel:!0,content:n=>{f("p",()=>{f("#",e)}),H({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"OK",click:n})}})},...t})}function Ce(e,t={}){return new Promise(n=>{let i=!1;N({header:"Confirm",allowCancel:!0,content:o=>{f("p",()=>{f("#",e)}),H({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"Cancel",attrs:".neutral",click:o}),A({content:"OK",click:()=>{i=!0,o()}})}})},...t,onClose:()=>{n(i),t.onClose?.()}})})}function Se(e,t="",n={}){return new Promise(i=>{let o=null;N({header:"Input",allowCancel:!0,content:r=>{f("p",()=>{f("#",e)});let a=f.proxy({value:t});f("form display:contents",()=>{f("submit=",s=>{s.preventDefault(),o=a.value,r()}),ee({bind:f.ref(a,"value")}),H({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"Cancel",attrs:".neutral",type:"button",click:r}),A({content:"OK",type:"submit"})}})})},...n,onClose:()=>{i(o),n.onClose?.()}})})}u.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","> header":"border:0 border-bottom: 1px solid $s-faint; r:0 position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-faint; fg:$s-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-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 min-width:0 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-faint 18%, $s-faint 82%, transparent);",".s-body main":"flex:1 min-width:0 min-height:0 overflow-x:hidden 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"},".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 Le(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}`:"",r=u(`div.s-main${o}`,e.attrs,()=>{u(()=>{(e.title!=null||e.subtitle!=null||e.icon!=null||e.menu!=null||i)&&u("header.s-s.neutral",e.topbarAttrs,()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),u(()=>{i&&u("div.s-nav-trigger",()=>{Z({...t,button:{icon:()=>u("span aria-hidden=true #\u2630"),ariaLabel:"Open navigation",attrs:".neutral .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-nav-${n}`,e.navAttrs,()=>{J(t.items)}),u("div.s-nav-sep aria-hidden=true")),qe(e)})}),u(()=>{e.footer!=null&&u("footer",()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),d(e.footer)})})})});if(i){let a=s=>{if(s.key!=="Escape"||s.defaultPrevented||ce()||de())return;let c=r.querySelector(".s-nav-panel");if(c?.offsetParent!=null){let U=c.querySelector("[aria-current=page]")??c.querySelector(".s-menu-item:not([aria-disabled=true])");U&&(s.preventDefault(),U.focus());return}let C=r.querySelector(".s-nav-trigger button");C&&(s.preventDefault(),C.click())};document.addEventListener("keydown",a),u.clean(()=>document.removeEventListener("keydown",a))}}function qe(e){let t=u("main",()=>{u("div.s-content",e.contentAttrs,()=>{d(e.content)})});Fe(t)}function Fe(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 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-muted font-size:0.85em"}});function Be(e){q(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 w from"aberdeen";w.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-faint;",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-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-text;",".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 ze(e){let t=S("tabs"),n=(r,a)=>r.id??String(a),i=e.bind??w.proxy(n(e.tabs[0]??{label:""},0));e.tabs.length>0&&!e.tabs.some((r,a)=>n(r,a)===w.peek(()=>i.value))&&(i.value=n(e.tabs[0],0));let o=(r,a)=>{r.disabled||(i.value=n(r,a))};w("div.s-tabs",e.attrs,()=>{w("div.s-tablist role=tablist",()=>{e.tabs.forEach((r,a)=>{let s=n(r,a);w("button.s-tab type=button role=tab",()=>{w(`id=${t}-tab-${s} aria-controls=${t}-panel-${s}`),w(()=>{let c=i.value===s;w("aria-selected=",c?"true":"false"),w("tabindex=",c?"0":"-1")}),r.disabled&&w("disabled=true"),w("click=",()=>o(r,a)),w("keydown=",c=>He(c,e.tabs,a,o)),d(r.icon),d(r.label)})})}),w("div.s-tabpanel role=tabpanel",e.contentAttrs,()=>{w(()=>{let r=i.value,a=e.tabs.findIndex((c,C)=>n(c,C)===r),s=e.tabs[a]??e.tabs[0];s&&(w(`id=${t}-panel-${n(s,a)} aria-labelledby=${t}-tab-${n(s,a)}`),d(s.content))})})})}function He(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 s=t[o];if(s&&!s.disabled){i(s,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 De(e={}){let t=e.autoGrow!==!1;q(e,(n,i)=>{let o=E("textarea.s-input",e.inputAttrs,()=>{t?(E(".s-autoGrow"),E("input=",r=>{pe(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(()=>pe(o))})}function pe(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}import m from"aberdeen";import{grow as Ge,shrink as Ie}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; 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-close":"cursor:pointer border:0 background:transparent fg:$s-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-text",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-text",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var Pe=0,W=m.proxy({});L(()=>{m.peek(()=>m.isEmpty(W))&&m.isEmpty(W)||m("div.s-toasts",()=>{m.onEach(W,e=>{let{opts:t,id:n}=e,i=t.type==="danger"||t.type==="warning"?"alert":"status",o=t.type==null||t.type==="neutral"?"neutral":t.type,r=t.duration??6e3,a,s=null,c=()=>{clearTimeout(a),s&&(s.style.transition="none",s.style.width="100%",s.offsetWidth,s.style.transition=`width ${r}ms linear`,s.style.width="0%"),a=setTimeout(()=>ne(n),r)},C=()=>{clearTimeout(a),a=void 0,s&&(s.style.transition="none",s.style.width="100%")};m.clean(()=>clearTimeout(a)),m(`div.s-toast.s-s.${o}.extra-shadow aria-live=polite role=${i}`,"create=",Ge,"destroy=",Ie,t.attrs,()=>{r>0&&(m("mouseenter=",C),m("mouseleave=",c)),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=",()=>ne(n))})}),r>0&&(s=m("div.s-toast-progress"))}),r>0&&requestAnimationFrame(c)})})});function ne(e){delete W[e]}function Ke(e){let t=++Pe;return W[t]={id:t,opts:e},()=>ne(t)}import T from"aberdeen";T.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var j=T.proxy(void 0),M=null;typeof window<"u"&&window.addEventListener("scroll",()=>{j.value=void 0},{capture:!0,passive:!0});function Re(e,t,n,i){let r=window.innerWidth,a=window.innerHeight,s=0,c=0;return i==="bottom"?(s=e.left+(e.width-t)/2,c=e.bottom+7,c+n>a-8&&(c=e.top-n-7)):i==="left"?(s=e.left-t-7,c=e.top+(e.height-n)/2,s<8&&(s=e.right+7)):i==="right"?(s=e.right+7,c=e.top+(e.height-n)/2,s+t>r-8&&(s=e.left-t-7)):(s=e.left+(e.width-t)/2,c=e.top-n-7,c<8&&(c=e.bottom+7)),{x:Math.max(8,Math.min(s,r-t-8)),y:Math.max(8,Math.min(c,a-n-8))}}function oe(){M&&clearTimeout(M),M=setTimeout(()=>{j.value=void 0,M=null},100)}L(()=>{let e=j.value;if(!e)return;let{opts:t,anchor:n}=e,i=t.placement??"top",o=T("div.s-tt-tip.s-s.neutral.shadow role=tooltip visibility:hidden",t.attrs,()=>{T("mouseenter=",()=>{M&&(clearTimeout(M),M=null)}),T("mouseleave=",oe),d(t.tip)});requestAnimationFrame(()=>{if(!document.body.contains(o))return;let{x:r,y:a}=Re(n.getBoundingClientRect(),o.offsetWidth,o.offsetHeight,i);o.style.left=r+"px",o.style.top=a+"px",o.style.visibility=""})});function je(e){let t=n=>{M&&(clearTimeout(M),M=null),j.value={opts:e,anchor:n.currentTarget}};T("mouseenter=",t),T("mouseleave=",oe),T("focusin=",t),T("focusout=",oe),T.clean(()=>{j.value?.opts===e&&(j.value=void 0)})}export{Te as addContextMenu,je as addTooltip,Me as alert,ve as autocomplete,we as box,A as button,$e as buttonChooser,H as buttonGroup,ke as checkbox,Ce as confirm,N as dialog,Ae as form,ae as getDarkMode,Le as main,Z as menuButton,Se as prompt,Be as select,be as setDarkMode,Q as showFloatingMenu,ze as tabs,De as textarea,ee as textline,Ke as toast};
|
|
1
|
+
import O from"aberdeen";var V="staffa:darkMode",re=O.proxy({value:me()});function me(){try{let e=localStorage.getItem(V);if(e==="dark")return!0;if(e==="light")return!1}catch{}}function be(e){re.value=e;try{e===void 0?localStorage.removeItem(V):localStorage.setItem(V,e?"dark":"light")}catch{}}function ae(e=!1){let t=re.value;return t===void 0&&!e?O.darkMode():t}O(()=>{ae()?O.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#0e0f12 --s-text:#e9eaec",".s-s.neutral":"--s-bg:#191b1f --s-text:#e9eaec",".s-s.neutral .s-s.neutral":"--s-bg:#23262b"}):O.insertGlobalCss({":root, .s-s.neutral":"--s-bg:#eef0f3 --s-text:#1d1f24",".s-s.neutral, .s-s.neutral":"--s-bg:#ffffff --s-text:#1d1f24",".s-s.neutral .s-s.neutral":"--s-bg:#f6f7f9"})});O.setSpacingCssVars(1.1);O.insertGlobalCss({"*, *::before, *::after":"box-sizing:border-box",html:"text-size-adjust:100%",body:"m:0 p:$3 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased background-color:$s-bg text:$s-text",a:"color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;","a:hover":"filter: brightness(1.15)","input, button, textarea, select, optgroup":"font:inherit color:inherit","input:where(:not([type=checkbox],[type=radio],[type=range],[type=file],[type=color],[type=image],[type=submit],[type=button],[type=reset],[type=hidden])), textarea, select":"background:$s-bg border: 1px solid $s-faint; r:$s-radius-sm padding: 0.45em 0.65em; max-width:100%","input:where([type=checkbox],[type=radio])":"width:1.15em height:1.15em cursor:pointer","input[type=range]":"appearance:none background:transparent cursor:pointer vertical-align:middle","input[type=range]::-webkit-slider-runnable-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-track":"height:4px r:99px background:$s-faint","input[type=range]::-moz-range-progress":"height:4px r:99px background:$s-accent","input[type=range]::-webkit-slider-thumb":"appearance:none width:16px height:16px margin-top:-6px r:50% background:$s-accent","input[type=range]::-moz-range-thumb":"width:16px height:16px border:0 r:50% background:$s-accent","input[type=file]":"cursor:pointer",progress:"appearance:none border:0 height:6px r:99px background:$s-faint overflow:hidden vertical-align:middle","progress::-webkit-progress-bar":"background:$s-faint r:99px","progress::-webkit-progress-value":"background:$s-accent r:99px","progress::-moz-progress-bar":"background:$s-accent r:99px",meter:"vertical-align:middle",fieldset:"border: 1px solid $s-faint; r:$s-radius-sm padding:$2 min-width:0",legend:"padding: 0 $1; font-weight:600","code, kbd, samp, pre":"font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;",code:"background: color-mix(in oklab, $s-text, $s-bg 86%); padding: 0.12em 0.34em; r:4px font-size:0.9em",pre:"background: color-mix(in oklab, $s-text, $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-faint;","::placeholder":"color: $s-muted; opacity:1",":focus-visible":"outline: 2px solid $s-focus; outline-offset:2px",small:"color:$s-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;"},":root":"--s-primary:#00a884 --s-danger:#dc5b41 --s-success:#00a884 --s-warning:#ef6b00 --s-link:#3f8cd8 --s-radius-sm:6px --s-radius:12px --s-radius-lg:18px --s-focus: color-mix(in srgb, $s-primary 38%, transparent); --s-gradient: linear-gradient(135deg, color-mix(in oklab, $s-primary, white 16%), color-mix(in oklab, $s-primary, black 14%));",":root, .s-s.neutral":"--s-accent:$s-primary --s-link-fg:$s-link",".s-s:not(.neutral)":"--s-bg:$s-primary border:0 --s-text:#eee --s-accent:#fff --s-link-fg:#eef --s-muted: color-mix(in srgb, #fff 70%, transparent); --s-faint: color-mix(in srgb, #fff 30%, transparent);",".s-s.danger":"--s-bg:$s-danger",".s-s.success":"--s-bg:$s-success",".s-s.warning":"--s-bg:$s-warning",".s-s.link":"--s-bg:$s-link",".s-s.primary":"--s-bg:$s-primary",":root, .s-s":"--s-muted: color-mix(in oklab, $s-text, $s-bg 42%); --s-faint: color-mix(in oklab, $s-text, $s-bg 80%); color:$s-text accent-color:$s-accent scrollbar-width:thin scrollbar-color: $s-faint transparent;",".s-s, body":"background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%));",".s-s":"r:$s-radius",":where(.s-s.neutral)":"border: 1px solid $s-faint;",".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-faint border-radius:99px border: 2px solid transparent; background-clip:padding-box",".s-s.shadow.neutral:not(.s-btn)":"box-shadow: 0 4px 14px rgba(0,0,0,0.13);",".s-s.extra-shadow.neutral:not(.s-btn)":"box-shadow: 0 18px 50px rgba(0,0,0,0.28);",".s-s.shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 4px 14px color-mix(in srgb, $s-bg 30%, transparent);",".s-s.extra-shadow:not(.neutral):not(.tonal):not(.outlined)":"box-shadow: 0 14px 40px color-mix(in srgb, $s-bg 40%, transparent);",".s-s.no-shadow":"box-shadow: none !important;",".s-s:not(.neutral).tonal, .s-s:not(.neutral).outlined":"--s-text:$s-bg --s-accent:$s-bg --s-link-fg:$s-bg --s-faint: color-mix(in srgb, $s-bg 30%, transparent); --s-muted: color-mix(in srgb, $s-bg 70%, transparent);",".s-s:not(.neutral).tonal":"background: color-mix(in srgb, $s-bg 15%, transparent); border: 1px solid $s-faint;",".s-s:not(.neutral).outlined":"background: transparent; border: 1px solid color-mix(in srgb, $s-bg 45%, transparent);",".s-s:not(.neutral) .s-s.tonal, .s-s:not(.neutral) .s-s.outlined":"--s-text:#fff --s-accent:#fff --s-link-fg:#fff background: linear-gradient(170deg, color-mix(in oklab, $s-bg, white 9%), color-mix(in oklab, $s-bg, black 9%)); border-color: transparent;"});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")))}O.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 ge="p, ul, ol, dl, blockquote, pre, table, figure, hr, h1, h2, h3, h4, h5, h6";O.insertGlobalCss({[`${ge}`]:{"&":"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-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-faint; padding-left: $3; fg: $s-muted",table:"border-collapse:collapse","th, td":"text-align:left padding: $1 $2; border-bottom: 1px solid $s-faint; vertical-align:top",th:"font-weight:600","thead th":"border-bottom: 2px solid $s-faint;",dt:"font-weight:600",dd:"margin-left: 1.5em",figcaption:"fg:$s-muted font-size:0.9em margin-top:$1 text-align:center"});import l from"aberdeen";import se from"aberdeen";var he=0;function S(e="s"){return`${e}-${++he}`}function d(e,...t){e!=null&&(typeof e=="function"?e(...t):se("rich=",e))}var xe="a[href], button, input, select, textarea, [tabindex]";function Y(e,t){let n=o=>o instanceof HTMLElement&&!o.hasAttribute("disabled")&&o.getAttribute("aria-disabled")!=="true"&&o.tabIndex>=0&&o.getClientRects().length>0,i=(t?[...e.querySelectorAll(t)].find(n):void 0)??[...e.querySelectorAll(xe)].find(n);return i?.focus(),i!=null}function L(e){queueMicrotask(()=>se(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-text user-select:none"},".s-req":"fg:$s-danger margin-left:2px",".s-help":"font-size:0.82em fg:$s-muted",".s-error":"font-size:0.82em fg:$s-danger",".s-input":{"&":"w:100% background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.55em 0.7em; transition: border-color 0.15s, box-shadow 0.15s;","&:hover:not(:disabled)":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","&:focus-visible":"border-color:$s-accent box-shadow: 0 0 0 3px $s-focus; outline:none","&[aria-invalid=true]":"border-color:$s-danger"}});function q(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)}l.insertGlobalCss({".s-ac":{"&":"position:relative","> .s-control":"display:flex flex-wrap:wrap align-items:center gap:$1 background: color-mix(in oklab, $s-bg, $s-text 4%); color:$s-text border: 1px solid $s-faint; r:$s-radius padding: 0.3em 0.4em; cursor:text; transition: border-color 0.15s, box-shadow 0.15s;","> .s-control:hover":"border-color: color-mix(in oklab, $s-text, $s-bg 55%);","> .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 background: color-mix(in oklab, $s-bg, $s-text 10%); border: 1px solid $s-faint; r:$s-radius padding: 0.1em 0.2em 0.1em 0.5em;",".s-chip > button":"cursor:pointer border:0 background:transparent fg:$s-muted font-size:1.1em line-height:1 padding: 0 0.2em; r:4px",".s-chip > button:hover":"fg:$s-text background:$s-faint",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","> .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-text 10%, transparent);",".s-add":"fg:$s-accent font-style:italic",".s-empty":"padding: 0.45em 0.6em; fg:$s-muted"}});function ye(e){return typeof e=="string"?{value:e,label:e}:{value:e.value,label:e.label??e.value}}function ve(e){let t=S("ac-menu"),n=l.proxy({query:"",open:!1,active:0}),i=()=>(typeof e.options=="function"?e.options():e.options).map(ye),o=()=>{let p=e.bind?.value;return p==null||p===""?[]:Array.isArray(p)?p:[p]},r=p=>i().find(v=>v.value===p)?.label??p;if(!e.multi){let p=e.bind?l.peek(e.bind,"value"):void 0;typeof p=="string"&&p&&(n.query=l.peek(()=>r(p)))}let a=()=>{let p=new Set(o()),v=i();e.multi&&(v=v.filter(h=>!p.has(h.value)));let g=n.query.trim().toLowerCase();return g&&(v=v.filter(h=>h.label.toLowerCase().includes(g))),v},s=(p,v)=>{if(e.multi){let g=Array.isArray(e.bind?.value)?[...e.bind.value]:[];g.includes(p)||g.push(p),e.bind&&(e.bind.value=g),n.query=""}else e.bind&&(e.bind.value=p),n.query=r(p),n.open=!1;n.active=0,v?.focus()},c=p=>{if(!e.bind)return;let v=e.bind.value??[];e.bind.value=v.filter(g=>g!==p)};q(e,(p,v)=>{l("div.s-ac",e.inputAttrs,()=>{l(()=>l("aria-invalid=",v()?"true":"false"));let g;l("div.s-control",()=>{l("click=",()=>g?.focus()),l(()=>{if(e.multi)for(let h of o())l("span.s-chip",()=>{l("span #",l.peek(()=>r(h))),l("button type=button aria-label=",`Remove ${h}`,()=>{l("#\xD7"),l("click=",$=>{$.stopPropagation(),c(h),g?.focus()})})})}),g=l("input type=text role=combobox autocomplete=off",()=>{l(`id=${p} aria-controls=${t} aria-autocomplete=list`),e.placeholder!=null&&l("placeholder=",e.placeholder),e.disabled&&l("disabled=true"),e.required&&l("aria-required=true"),l("bind=",l.ref(n,"query")),l(()=>l("aria-expanded=",n.open?"true":"false")),l(()=>{let $=a()[n.active];l("aria-activedescendant=",n.open&&$?`${t}-opt-${n.active}`:"")}),l("input=",()=>{n.open=!0,n.active=0}),l("focus=",()=>{n.open=!0}),l("blur=",()=>{setTimeout(()=>U(),150)}),l("keydown=",h=>C(h,g))})}),l(()=>{if(!n.open)return;let h=a(),$=n.query.trim(),ie=e.allowCustom!==!1&&$!==""&&!h.some(K=>K.label.toLowerCase()===$.toLowerCase());l("ul.s-menu.s-s.neutral.shadow role=listbox",`id=${t}`,()=>{h.forEach((K,_)=>{l("li.s-option role=option",`id=${t}-opt-${_}`,()=>{l(()=>l("aria-selected=",n.active===_?"true":"false")),l("#",K.label),l("mousedown=",fe=>fe.preventDefault()),l("click=",()=>s(K.value,g)),l("mousemove=",()=>{n.active=_})})}),ie&&l("li.s-option.s-add role=option",()=>{l("#",`Add "${$}"`),l("mousedown=",K=>K.preventDefault()),l("click=",()=>s($,g))}),h.length===0&&!ie&&l("li.s-empty #No matches")})}),l(()=>{if(e.name)if(e.multi)for(let h of o())l("input type=hidden",()=>{l("name=",e.name),l("value=",h)});else l("input type=hidden",()=>{l("name=",e.name),l("value=",o()[0]??"")})})})});function C(p,v){let g=a(),h=g.length-1;if(p.key==="ArrowDown")p.preventDefault(),n.open=!0,n.active=Math.min(h,n.active+1);else if(p.key==="ArrowUp")p.preventDefault(),n.active=Math.max(0,n.active-1);else if(p.key==="Enter"){p.preventDefault();let $=g[n.active];$?s($.value,v):e.allowCustom!==!1&&n.query.trim()?s(n.query.trim(),v):n.open&&(n.open=!1)}else if(p.key==="Escape")n.open=!1,e.multi||(n.query=r(o()[0]??""));else if(p.key==="Backspace"&&e.multi&&n.query===""){let $=o();$.length&&c($[$.length-1])}}function U(){n.open=!1,e.multi?n.query="":e.allowCustom!==!1&&n.query.trim()?s(n.query.trim()):n.query=r(o()[0]??"")}}import z from"aberdeen";z.insertGlobalCss({".s-box":{"&":"display:flex flex-direction:column overflow:hidden r: $s-radius-lg;","&:not(:first-child)":"margin-top: $3","> header":"display:flex align-items:center gap:$2 padding: $2 $3; border:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0","> div":"p:$3 gap:$3"}});function we(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;z("section.s-box.s-s.neutral.shadow",t.attrs,()=>{z(()=>{t.header!=null&&z("header.s-s.neutral",t.headerAttrs,()=>d(t.header))}),z("div",t.contentAttrs,()=>{d(t.content)}),z(()=>{t.footer!=null&&z("footer.s-s.neutral",t.footerAttrs,()=>d(t.footer))})})}import F from"aberdeen";F.insertGlobalCss({".s-btn":{"&":"display:inline-flex align-items:center justify-content:center gap:$2 font-weight:450 line-height:1.1 white-space:nowrap cursor:pointer text-decoration:none padding: $m2 $m3; transition: background 0.15s, border-color 0.15s, color 0.15s, filter 0.15s, box-shadow 0.15s, transform 0.08s;","&:focus-visible":"outline: 3px solid $s-focus; outline-offset: 1px;","&:hover":"filter: brightness(1.06)","&.tonal:hover, &.outlined:hover":"background: color-mix(in srgb, $s-bg 24%, transparent);","&.neutral:hover":"filter:none background: color-mix(in srgb, $s-text 8%, $s-bg);","&:active:not(:disabled)":"transform: translateY(1px)","&.small, .small > &":"padding: $m1 $m2; font-size:0.85em border-radius:$s-radius-sm","&.large, .large > &":"font-size:1.4em border-radius:$s-radius-lg"}});function A(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e,n=t.href!=null?"a":"button";F(`${n}.s-btn.s-s.shadow`,t.attrs,()=>{t.href!=null?(F(`href=${t.href} role=button`),t.disabled&&F("aria-disabled=true")):(F("type=",t.type??"button"),t.disabled&&F("disabled=true")),t.ariaLabel&&F("aria-label=",t.ariaLabel),t.click&&F("click=",t.click),d(t.icon),d(t.content)})}import X from"aberdeen";import le from"aberdeen";le.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 H(e={}){let n=`.s-${e.layout??"attached"}${e.vertical?".s-vertical":""}`;le(`div.s-bgroup${n} role=group`,e.attrs,()=>{if(e.buttons)for(let i of e.buttons)A(i);d(e.content)})}function $e(e){X(()=>{let t=e.bind.value;H({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",click:()=>{e.bind.value=e.allowDeselect&&t===n?void 0:n}}))})}),e.name&&X(()=>X(`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:"cursor:inherit m:0"}});function ke(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 D from"aberdeen";D.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 Ae(e={}){let t=typeof e=="string"||typeof e=="function"?{content:e}:e;D("form.s-form",t.attrs,()=>{D(()=>{D(".grid=",t.layout==="grid")}),D("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),D(()=>{t.actions&&D("footer",t.actionsAttrs,()=>d(t.actions))})})}import u from"aberdeen";import y from"aberdeen";import{matchCurrent as Oe}from"aberdeen/route";y.insertGlobalCss({".s-menu-list":"position:fixed z-index:350 min-width:10rem display:flex flex-direction:column p:$1 r:$s-radius-lg 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":"display:flex align-items:center gap:$2 w:100% outline:0 padding: $m2 0; line-height:1.1 r:$s-radius cursor:pointer text-align:left font-weight:450 font-size:0.9em border:0 background:transparent fg:$s-text text-decoration:none transition: color 0.12s, transform 0.12s, text-shadow 0.12s;",".s-menu-item:focus-visible:not([aria-current=page]), .s-menu-item:hover:not([aria-disabled=true]):not([aria-current=page])":"filter:none color: color-mix(in lab, $s-primary 33%, $s-text);",".s-menu-item[aria-current=page]":"text-shadow: 0 0 2px $s-primary; color: color-mix(in lab, $s-primary 50%, $s-text); filter:brightness(1.15)",".s-menu-item[aria-disabled=true]":"opacity:0.45 cursor:not-allowed pointer-events:none",".s-menu-icon":"flex-shrink:0","hr.s-menu-sep":"border:0 height:1px margin: $1 0.6rem; background: linear-gradient(to right, transparent, $s-faint 18%, $s-faint 82%, transparent);"});function J(e,t){y("keydown=",n=>{if(n.key==="Enter"&&n.target.tagName==="A"){queueMicrotask(()=>t?.());return}if(n.key!=="ArrowDown"&&n.key!=="ArrowUp"&&n.key!=="Home"&&n.key!=="End")return;n.preventDefault();let o=[...n.currentTarget.querySelectorAll(".s-menu-item")].filter(c=>c.getAttribute("aria-disabled")!=="true");if(!o.length)return;let r=o.indexOf(document.activeElement),a=n.key==="ArrowUp"?-1:1,s=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[s].focus()});for(let n of e){if(typeof n=="string"||typeof n=="function"){d(n);continue}if("separator"in n){y("hr.s-menu-sep");continue}y(n.href?"a.s-menu-item":"button.s-menu-item type=button",n.attrs,()=>{n.href&&(y("href=",n.href),n.target&&y("target=",n.target),y(()=>{Oe(n.href)&&y("aria-current=page")})),n.disabled&&y("aria-disabled=true"),y("click=",i=>{if(n.disabled){i.preventDefault();return}t?.(),n.click?.(i)}),n.icon&&y("span.s-menu-icon",()=>d(n.icon)),d(n.label)})}}var B=y.proxy({opts:null});function G(){let e=B.opts?.anchor;B.opts=null,e?.focus()}function de(){return B.opts!=null}function Ee(e,t){let n=e.offsetWidth,i=e.offsetHeight,o=window.innerWidth,r=window.innerHeight,a=4,s=t.left;s+n>o-8&&(s=Math.max(8,t.right-n));let c=t.bottom+a;c+i>r-8&&t.top-i-a>=8&&(c=t.top-i-a),e.style.left=Math.max(8,s)+"px",e.style.top=Math.max(8,c)+"px"}L(()=>{let e=B.opts;if(!e)return;let t=y("div.s-menu-list.s-s.neutral.shadow create=hidden destroy=hidden",e.dropdownAttrs,()=>{J(e.items,G)}),n=o=>{let r=o.target;!t.contains(r)&&(e.closeOnAnchorClick||!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),y.clean(()=>{document.removeEventListener("click",n,!0),document.removeEventListener("keydown",i,!0)}),requestAnimationFrame(()=>{if(!document.body.contains(t))return;let o=e.at?{left:e.at.x,right:e.at.x,top:e.at.y,bottom:e.at.y}:e.anchor.getBoundingClientRect();Ee(t,o),Y(t,".s-menu-item[aria-current=page]")})});function Q(e){return B.opts=e,G}function Te(e){let t=null;y.clean(()=>{B.opts?.anchor===t&&G()}),y("contextmenu=",n=>{n.preventDefault(),t=n.currentTarget,Q({items:e.items,anchor:t,at:{x:n.clientX,y:n.clientY},closeOnAnchorClick:!0,dropdownAttrs:e.dropdownAttrs})})}function Z(e){let t=null;y.clean(()=>{B.opts?.anchor===t&&G()}),A({icon:()=>y("span aria-hidden=true #\u2630"),...e.button?.content==null?{ariaLabel:"Open menu"}:null,attrs:".neutral",...e.button,click:n=>{if(t=n.currentTarget,B.opts?.anchor===t){G();return}Q({items:e.items,anchor:t,dropdownAttrs:e.dropdownAttrs})}})}import f from"aberdeen";import I from"aberdeen";function ee(e={}){q(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) r: $s-radius-lg; 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:0 border-bottom: 1px solid $s-faint; r:0 font-weight:600 flex-shrink:0","> footer":"display:flex align-items:center justify-content:flex-end gap:$2 padding: $2 $3; border:0 border-top: 1px solid $s-faint; r:0 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 P=f.proxy({}),te=0,ue=f.derive(()=>{let e=Object.keys(P);if(e.length)return e[e.length-1]});function ce(){return ue.value!=null}L(()=>{f.onEach(P,({resolve:e,opts:t},n)=>{let i=()=>{delete P[n]};f.clean(()=>{t.onClose?.(),e()});let o=f.derive(()=>ue.value!=n);f("div.s-backdrop create=hidden destroy=hidden .hidden=",o,"click=",()=>{t.allowCancel!==!1&&i()});let r=f("div.s-dialog.neutral.s-s.extra-shadow create=hidden destroy=hidden",t.attrs,()=>{f(()=>{t.header!=null&&f("header.s-s.neutral",t.headerAttrs,()=>d(t.header))}),f("div",t.contentAttrs,()=>{d(t.content,i)}),f(()=>{t.footer!=null&&f("footer.s-s.neutral",t.footerAttrs,()=>d(t.footer))})});requestAnimationFrame(()=>{document.body.contains(r)&&Y(r)})})});function N(e){te||document.addEventListener("keydown",n=>{if(n.key==="Escape"&&e.allowCancel!==!1){let i=f.unproxy(P);for(let o=te;o>0;o--)if(i[o]){i[o].opts.allowCancel!==!1&&delete P[o];break}}});let t=++te;return e.cancelWithScope!==!1&&f.clean(()=>{delete P[t]}),new Promise(n=>{P[t]={resolve:n,opts:e}})}function Me(e,t={}){return N({header:"Alert",allowCancel:!0,content:n=>{f("p",()=>{f("#",e)}),H({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"OK",click:n})}})},...t})}function Ce(e,t={}){return new Promise(n=>{let i=!1;N({header:"Confirm",allowCancel:!0,content:o=>{f("p",()=>{f("#",e)}),H({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"Cancel",attrs:".neutral",click:o}),A({content:"OK",click:()=>{i=!0,o()}})}})},...t,onClose:()=>{n(i),t.onClose?.()}})})}function Se(e,t="",n={}){return new Promise(i=>{let o=null;N({header:"Input",allowCancel:!0,content:r=>{f("p",()=>{f("#",e)});let a=f.proxy({value:t});f("form display:contents",()=>{f("submit=",s=>{s.preventDefault(),o=a.value,r()}),ee({bind:f.ref(a,"value")}),H({layout:"spaced",attrs:"align-self:flex-end",content:()=>{A({content:"Cancel",attrs:".neutral",type:"button",click:r}),A({content:"OK",type:"submit"})}})})},...n,onClose:()=>{i(o),n.onClose?.()}})})}u.insertGlobalCss({".s-main":{"&":"display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size","body > &":"margin: calc(-1 * $3)","> header":"border:0 border-bottom: 1px solid $s-faint; r:0 position:sticky top:0 z-index:10","> footer":"border-top: 1px solid $s-faint; fg:$s-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-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 min-width:0 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-faint 18%, $s-faint 82%, transparent);",".s-body main":"flex:1 min-width:0 min-height:0 overflow-x:hidden 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"},".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 Le(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}`:"",r=u(`div.s-main${o}`,e.attrs,()=>{u(()=>{(e.title!=null||e.subtitle!=null||e.icon!=null||e.menu!=null||i)&&u("header.s-s.neutral",e.topbarAttrs,()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),u(()=>{i&&u("div.s-nav-trigger",()=>{Z({...t,button:{icon:()=>u("span aria-hidden=true #\u2630"),ariaLabel:"Open navigation",attrs:".neutral .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-nav-${n}`,e.navAttrs,()=>{J(t.items)}),u("div.s-nav-sep aria-hidden=true")),qe(e)})}),u(()=>{e.footer!=null&&u("footer",()=>{u("div.s-bar",()=>{u(()=>{e.maxWidth!=null&&u("max-width:",e.maxWidth)}),d(e.footer)})})})});if(i){let a=s=>{if(s.key!=="Escape"||s.defaultPrevented||ce()||de())return;let c=r.querySelector(".s-nav-panel");if(c?.offsetParent!=null){let U=c.querySelector("[aria-current=page]")??c.querySelector(".s-menu-item:not([aria-disabled=true])");U&&(s.preventDefault(),U.focus());return}let C=r.querySelector(".s-nav-trigger button");C&&(s.preventDefault(),C.click())};document.addEventListener("keydown",a),u.clean(()=>document.removeEventListener("keydown",a))}}function qe(e){let t=u("main",()=>{u("div.s-content",e.contentAttrs,()=>{d(e.content)})});Fe(t)}function Fe(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 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-muted font-size:0.85em"}});function Be(e){q(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 w from"aberdeen";w.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-faint;",".s-tablist::-webkit-scrollbar":"display:none",".s-tab":"display:inline-flex align-items:center gap:$2 cursor:pointer background:transparent border:0 color: $s-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-text;",".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 ze(e){let t=S("tabs"),n=(r,a)=>r.id??String(a),i=e.bind??w.proxy(n(e.tabs[0]??{label:""},0));e.tabs.length>0&&!e.tabs.some((r,a)=>n(r,a)===w.peek(()=>i.value))&&(i.value=n(e.tabs[0],0));let o=(r,a)=>{r.disabled||(i.value=n(r,a))};w("div.s-tabs",e.attrs,()=>{w("div.s-tablist role=tablist",()=>{e.tabs.forEach((r,a)=>{let s=n(r,a);w("button.s-tab type=button role=tab",()=>{w(`id=${t}-tab-${s} aria-controls=${t}-panel-${s}`),w(()=>{let c=i.value===s;w("aria-selected=",c?"true":"false"),w("tabindex=",c?"0":"-1")}),r.disabled&&w("disabled=true"),w("click=",()=>o(r,a)),w("keydown=",c=>He(c,e.tabs,a,o)),d(r.icon),d(r.label)})})}),w("div.s-tabpanel role=tabpanel",e.contentAttrs,()=>{w(()=>{let r=i.value,a=e.tabs.findIndex((c,C)=>n(c,C)===r),s=e.tabs[a]??e.tabs[0];s&&(w(`id=${t}-panel-${n(s,a)} aria-labelledby=${t}-tab-${n(s,a)}`),d(s.content))})})})}function He(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 s=t[o];if(s&&!s.disabled){i(s,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 De(e={}){let t=e.autoGrow!==!1;q(e,(n,i)=>{let o=E("textarea.s-input",e.inputAttrs,()=>{t?(E(".s-autoGrow"),E("input=",r=>{pe(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(()=>pe(o))})}function pe(e){e.style.height="auto",e.style.height=`${e.scrollHeight}px`}import m from"aberdeen";import{grow as Ge,shrink as Ie}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; 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-close":"cursor:pointer border:0 background:transparent fg:$s-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-text",".s-toast-close:focus-visible":"outline:none box-shadow: 0 0 0 3px $s-focus; fg:$s-text",".s-toast-progress":"position:absolute bottom:0 left:0 right:0 height:2px background:$s-accent width:100%"}});var Pe=0,W=m.proxy({});L(()=>{m.peek(()=>m.isEmpty(W))&&m.isEmpty(W)||m("div.s-toasts",()=>{m.onEach(W,e=>{let{opts:t,id:n}=e,i=t.type==="danger"||t.type==="warning"?"alert":"status",o=t.type==null||t.type==="neutral"?"neutral":t.type,r=t.duration??6e3,a,s=null,c=()=>{clearTimeout(a),s&&(s.style.transition="none",s.style.width="100%",s.offsetWidth,s.style.transition=`width ${r}ms linear`,s.style.width="0%"),a=setTimeout(()=>ne(n),r)},C=()=>{clearTimeout(a),a=void 0,s&&(s.style.transition="none",s.style.width="100%")};m.clean(()=>clearTimeout(a)),m(`div.s-toast.s-s.${o}.extra-shadow aria-live=polite role=${i}`,"create=",Ge,"destroy=",Ie,t.attrs,()=>{r>0&&(m("mouseenter=",C),m("mouseleave=",c)),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=",()=>ne(n))})}),r>0&&(s=m("div.s-toast-progress"))}),r>0&&requestAnimationFrame(c)})})});function ne(e){delete W[e]}function Ke(e){let t=++Pe;return W[t]={id:t,opts:e},()=>ne(t)}import T from"aberdeen";T.insertGlobalCss({".s-tt-tip":{"&":"position:fixed z-index:500 max-width:20rem w:max-content padding: 0.3em 0.65em; font-size:0.85em line-height:1.4 pointer-events:none"}});var j=T.proxy(void 0),M=null;typeof window<"u"&&window.addEventListener("scroll",()=>{j.value=void 0},{capture:!0,passive:!0});function Re(e,t,n,i){let r=window.innerWidth,a=window.innerHeight,s=0,c=0;return i==="bottom"?(s=e.left+(e.width-t)/2,c=e.bottom+7,c+n>a-8&&(c=e.top-n-7)):i==="left"?(s=e.left-t-7,c=e.top+(e.height-n)/2,s<8&&(s=e.right+7)):i==="right"?(s=e.right+7,c=e.top+(e.height-n)/2,s+t>r-8&&(s=e.left-t-7)):(s=e.left+(e.width-t)/2,c=e.top-n-7,c<8&&(c=e.bottom+7)),{x:Math.max(8,Math.min(s,r-t-8)),y:Math.max(8,Math.min(c,a-n-8))}}function oe(){M&&clearTimeout(M),M=setTimeout(()=>{j.value=void 0,M=null},100)}L(()=>{let e=j.value;if(!e)return;let{opts:t,anchor:n}=e,i=t.placement??"top",o=T("div.s-tt-tip.s-s.neutral.shadow role=tooltip visibility:hidden",t.attrs,()=>{T("mouseenter=",()=>{M&&(clearTimeout(M),M=null)}),T("mouseleave=",oe),d(t.tip)});requestAnimationFrame(()=>{if(!document.body.contains(o))return;let{x:r,y:a}=Re(n.getBoundingClientRect(),o.offsetWidth,o.offsetHeight,i);o.style.left=r+"px",o.style.top=a+"px",o.style.visibility=""})});function je(e){let t=n=>{M&&(clearTimeout(M),M=null),j.value={opts:e,anchor:n.currentTarget}};T("mouseenter=",t),T("mouseleave=",oe),T("focusin=",t),T("focusout=",oe),T.clean(()=>{j.value?.opts===e&&(j.value=void 0)})}export{Te as addContextMenu,je as addTooltip,Me as alert,ve as autocomplete,we as box,A as button,$e as buttonChooser,H as buttonGroup,ke as checkbox,Ce as confirm,N as dialog,Ae as form,ae as getDarkMode,Le as main,Z as menuButton,Se as prompt,Be as select,be as setDarkMode,Q as showFloatingMenu,ze as tabs,De as textarea,ee as textline,Ke as toast};
|
package/dist/theme.js
CHANGED
|
@@ -136,7 +136,7 @@ A.insertGlobalCss({
|
|
|
136
136
|
// What follows is a lightweight CSS reset. Semantic HTML should keep working, but less ugly/with some reasonable defaults.
|
|
137
137
|
"*, *::before, *::after": "box-sizing:border-box",
|
|
138
138
|
html: "text-size-adjust:100%",
|
|
139
|
-
body: "m:0 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased background-color:$s-bg text:$s-text",
|
|
139
|
+
body: "m:0 p:$3 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased background-color:$s-bg text:$s-text",
|
|
140
140
|
// Links resolve to the contextual link foreground: the link colour on nesting
|
|
141
141
|
// surfaces, the ink on accent surfaces.
|
|
142
142
|
a: "color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "staffa",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.3",
|
|
4
4
|
"description": "An opinionated component library for the Aberdeen reactive UI library.",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -28,8 +28,7 @@
|
|
|
28
28
|
"build": "npm run build:icons && tsc && tsc -p demo && esbuild src/index.ts --bundle --external:aberdeen --minify --format=esm --outfile=dist/staffa.esm.js",
|
|
29
29
|
"build:skill": "rm -rf skill ; mkdir skill && readme-tsdoc --create src/index.ts --file skill/REFERENCE.md --split && awk '/^@@include /{while((getline line < $2)>0) print line; close($2); next} 1' skill-template.md > skill/SKILL.md && rm skill/REFERENCE.md",
|
|
30
30
|
"typecheck": "tsc --noEmit && tsc -p demo --noEmit",
|
|
31
|
-
"
|
|
32
|
-
"prepublish": "npm run build && shotest test && npm run build:skill",
|
|
31
|
+
"prepack": "npm run build && npx shotest test --fail-on-visual-changes && npm run build:skill",
|
|
33
32
|
"test": "shotest test"
|
|
34
33
|
},
|
|
35
34
|
"peerDependencies": {
|
package/skill/ButtonOptions.md
CHANGED
|
@@ -48,7 +48,7 @@ Accessible label, when the button has only an icon.
|
|
|
48
48
|
|
|
49
49
|
Aberdeen attr/style string applied to the button. A button is a surface, so
|
|
50
50
|
pass surface modifier classes here to restyle it, e.g. `".danger"`,
|
|
51
|
-
`".danger .outlined"`, or `".
|
|
51
|
+
`".danger .outlined"`, or `".neutral"` for a neutral button. Defaults to a
|
|
52
52
|
filled `.primary` surface.
|
|
53
53
|
|
|
54
54
|
Size is set here too, with `.small` or `.large` (medium is the default and
|
|
@@ -14,6 +14,22 @@ Element to anchor the menu to (positioned just below it, flips up if needed).
|
|
|
14
14
|
|
|
15
15
|
**Type:** `HTMLElement`
|
|
16
16
|
|
|
17
|
+
### floatingMenuOptions.at · member
|
|
18
|
+
|
|
19
|
+
Position the menu at this viewport point (e.g. a pointer location) instead
|
|
20
|
+
of just below the anchor. Used by `addContextMenu` to open at the
|
|
21
|
+
exact click/tap target.
|
|
22
|
+
|
|
23
|
+
**Type:** `{ x: number; y: number; }`
|
|
24
|
+
|
|
25
|
+
### floatingMenuOptions.closeOnAnchorClick · member
|
|
26
|
+
|
|
27
|
+
Also close the menu when the anchor itself is clicked. By default a click on
|
|
28
|
+
the anchor is ignored (so a trigger button can run its own toggle), but a
|
|
29
|
+
context menu — whose anchor has no click handler — wants the click to close.
|
|
30
|
+
|
|
31
|
+
**Type:** `boolean`
|
|
32
|
+
|
|
17
33
|
### floatingMenuOptions.dropdownAttrs · member
|
|
18
34
|
|
|
19
35
|
Aberdeen attr/style string on the floating panel.
|
package/skill/SKILL.md
CHANGED
|
@@ -82,22 +82,22 @@ S.box({ header: "See the [docs](/docs)", content: () => { ... } });
|
|
|
82
82
|
|
|
83
83
|
Staffa builds on **surfaces**: elements marked with `.s-s` that have their own background and derived text/border tokens. There are two families:
|
|
84
84
|
|
|
85
|
-
- **
|
|
86
|
-
- **
|
|
85
|
+
- **Neutral surfaces** — `.neutral` (and the implicit page at `:root`). A calm neutral whose shade steps automatically with nesting depth (page → panel → raised, capped). Use them for cards, bars, popovers — anything that just holds content. No variants.
|
|
86
|
+
- **Accent surfaces** — `.primary`, `.danger`, `.success`, `.warning`, `.link` (a bare `.s-s` defaults to primary). A bright fill with white ink, painted as a subtle single-colour gradient. They take a **variant**: `.filled` (default), `.tonal`, or `.outlined`. A surface nested *inside* an accent surface is always rendered filled, so it can't bleed into the vivid parent.
|
|
87
87
|
|
|
88
|
-
Components are built from these (`S.button` is a `.s-s.primary`, `S.box` a `.s-s.
|
|
88
|
+
Components are built from these (`S.button` is a `.s-s.primary`, `S.box` a `.s-s.neutral`, etc.). Because component options include an optional `attrs` string, which has Aberdeen `A()` string semantics, you can easily override it:
|
|
89
89
|
|
|
90
90
|
```ts
|
|
91
91
|
S.button({ content: "Delete", attrs: ".danger" });
|
|
92
|
-
S.button({ content: "Cancel", attrs: ".
|
|
92
|
+
S.button({ content: "Cancel", attrs: ".neutral" }); // neutral button
|
|
93
93
|
S.box({ attrs: ".primary", content: () => { ... } });
|
|
94
94
|
```
|
|
95
95
|
|
|
96
|
-
Inside any surface (including `:root`), CSS variables are defined for the background and a set of safe foreground colors: `$s-bg`, `$s-text` (also applied as `color`), `$s-muted`, `$s-accent` (the surface's "pop" — the brand primary on
|
|
96
|
+
Inside any surface (including `:root`), CSS variables are defined for the background and a set of safe foreground colors: `$s-bg`, `$s-text` (also applied as `color`), `$s-muted`, `$s-accent` (the surface's "pop" — the brand primary on neutral surfaces, the ink on accent surfaces), and `$s-faint`. By using these, components adapt to wherever they're nested.
|
|
97
97
|
|
|
98
|
-
The colour tokens are mode-independent and settable: `$s-primary` (the one brand colour — it tints the neutrals and defines `.s-s.primary`), `$s-danger`, `$s-success`, `$s-warning`, and `$s-link` (the link colour, which is also the fill of the `.s-s.link` surface). Links render in `$s-link` on
|
|
98
|
+
The colour tokens are mode-independent and settable: `$s-primary` (the one brand colour — it tints the neutrals and defines `.s-s.primary`), `$s-danger`, `$s-success`, `$s-warning`, and `$s-link` (the link colour, which is also the fill of the `.s-s.link` surface). Links render in `$s-link` on neutral surfaces and in the ink on accent surfaces.
|
|
99
99
|
|
|
100
|
-
**Borders & shadows.**
|
|
100
|
+
**Borders & shadows.** Neutral surfaces carry a subtle hairline border on their own (so a card looks like a card without any component help). Any surface can be lifted with `.shadow` or `.extra-shadow`: on a neutral surface that's a neutral drop shadow, on an accent surface it's a self-coloured glow (a lit button is just a `.primary` surface with `.shadow`), and on `.tonal`/`.outlined` it's ignored. `.no-shadow` removes a component's built-in shadow:
|
|
101
101
|
|
|
102
102
|
```ts
|
|
103
103
|
S.box({ attrs: ".extra-shadow", content: () => { ... } }); // a more raised card
|
|
@@ -132,7 +132,7 @@ A.cssVars["s-radius"] = "4px";
|
|
|
132
132
|
|
|
133
133
|
See `src/theme.ts` for what other CSS variables are being used.
|
|
134
134
|
|
|
135
|
-
If you need further customization, just add some CSS to override the default styling. For instance, to add your own
|
|
135
|
+
If you need further customization, just add some CSS to override the default styling. For instance, to add your own accent surface, set its background (and, if needed, its ink) — the subtle gradient and the rest of the tokens follow automatically:
|
|
136
136
|
|
|
137
137
|
```ts
|
|
138
138
|
A.insertGlobalCss({".s-s.my-surface": "--s-bg:#ef6b00 --s-text:#fff"});
|
|
@@ -250,7 +250,7 @@ Staffa is designed for extension. A component is simply a plain function taking
|
|
|
250
250
|
|
|
251
251
|
3. **Reach for reactivity deliberately.** Pass option strings straight to `A` as positional args (the caller's scope). Only wrap a dedicated `A(() => ...)` scope where it matters: input elements (recreation loses focus), or large subtrees you don't want to redraw. Use `A.peek(() => ...)` when you need a value but must not subscribe.
|
|
252
252
|
|
|
253
|
-
4. **Build on surfaces.** Mark elements `.s-s` and add `.
|
|
253
|
+
4. **Build on surfaces.** Mark elements `.s-s` and add `.neutral` or an accent role (`.primary`, `.danger`, …) plus an optional variant. Inside them, use the contextual CSS variables (`$s-text`, `$s-bg`, `$s-muted`, `$s-accent`, `$s-faint`, ...) so components adapt to wherever they're nested. Hard-coding colors in components shouldn't be needed, but if you must, make sure you set *both* foreground and background.
|
|
254
254
|
|
|
255
255
|
5. **No outer margins.** Components don't margin themselves; spacing is the parent's job. Content components set default `padding` on the content element; `contentAttrs` overrides it.
|
|
256
256
|
|
|
@@ -302,13 +302,11 @@ ln -s ../../node_modules/staffa/skill .claude/skills/staffa
|
|
|
302
302
|
|
|
303
303
|
## Breaking changes
|
|
304
304
|
|
|
305
|
-
- **0.7** — the surface model was
|
|
306
|
-
- Surface levels `.base`/`.panel`/`.raised`/`.neutral
|
|
307
|
-
-
|
|
308
|
-
-
|
|
309
|
-
-
|
|
310
|
-
- Nesting surfaces now carry their own hairline border, and `.shadow`/`.extra-shadow`/`.no-shadow` utilities work on any surface. `S.box` no longer draws its own border/shadow (they come from the surface); pass `.no-shadow` to `S.box`/`S.button` to drop the default elevation.
|
|
311
|
-
- Contextual tokens were renamed/trimmed: `--s-fg`→`--s-text`, `--s-fg-muted`→`--s-muted`, `--s-border`→`--s-faint`; `--s-strong`, `--s-fg-faint`, `--s-border-strong`, `--s-on-accent`, `--s-ink`, `--s-page`/`--s-panel`/`--s-raised`, `--s-tint`, `--s-glow`, `--s-shadow`, `--s-gradient-surface`, and the `--s-a`/`--s-b` anchors were removed. Custom solid surfaces now set `--s-bg`/`--s-text`.
|
|
305
|
+
- **0.7** — the surface model was reduced to two families: **neutral** (`.neutral`) and **accent** (`.primary`/`.danger`/`.success`/`.warning`/`.link`). Apps that only use the high-level `S.*` components need no changes. Code that uses surface classes or tokens directly must update:
|
|
306
|
+
- **Surface levels gone.** Replace `.base`/`.panel`/`.raised`/`.neutral`/`.nest` with the single `.neutral` class.
|
|
307
|
+
- **`.secondary` and `.gradient` gone.** Drop any `s-secondary` colour override; there's no `s-secondary` anymore. The default button is now `.primary`.
|
|
308
|
+
- **Tokens renamed.** `--s-fg`→`--s-text`, `--s-fg-muted`→`--s-muted`, `--s-border`→`--s-faint`. Removed: `--s-fg-faint`, `--s-border-strong`, `--s-ink`, `--s-on-accent`, `--s-page`/`--s-panel`/`--s-raised`, `--s-neutral`, `--s-tint`, `--s-glow`, `--s-shadow`, `--s-gradient-surface`. A custom surface now sets `--s-bg`/`--s-text` (was the `--s-a`/`--s-b` anchors).
|
|
309
|
+
- **Borders/shadows moved onto surfaces.** Components no longer draw their own border/shadow. If you relied on `S.box`/`S.dialog`/etc. elevation, it now comes from the surface; pass `.no-shadow` to drop it, or `.shadow`/`.extra-shadow` to add it on any surface.
|
|
312
310
|
|
|
313
311
|
- **0.6**: None.
|
|
314
312
|
|
|
@@ -480,7 +478,7 @@ Options for `showFloatingMenu`.
|
|
|
480
478
|
Options for `addContextMenu` — like `FloatingMenuOptions`, but
|
|
481
479
|
the anchor is the element the handler is attached to.
|
|
482
480
|
|
|
483
|
-
**Type:** `Omit<FloatingMenuOptions, "anchor">`
|
|
481
|
+
**Type:** `Omit<FloatingMenuOptions, "anchor" | "at" | "closeOnAnchorClick">`
|
|
484
482
|
|
|
485
483
|
## [dialog](dialog.md) · function
|
|
486
484
|
|
package/skill/button.md
CHANGED
|
@@ -24,7 +24,7 @@ S.button({ href: "/dashboard", content: "Dashboard" }); // navigates via router
|
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
S.button({ content: "Save", click: S.alert("Saved.") });
|
|
27
|
-
S.button({ content: "Cancel", attrs: ".
|
|
27
|
+
S.button({ content: "Cancel", attrs: ".neutral", click: cancel }); // neutral button
|
|
28
28
|
S.button({ content: "Delete", attrs: ".danger .outlined", click: del });
|
|
29
29
|
S.button("Cancel"); // shorthand for { content: "Cancel" }
|
|
30
30
|
S.button({ href: "/docs", content: "Docs" }); // renders an <a role=button>
|
package/skill/buttonGroup.md
CHANGED
|
@@ -15,8 +15,8 @@ If you want a single button to be *selected*, use `buttonChooser`.
|
|
|
15
15
|
|
|
16
16
|
```ts
|
|
17
17
|
S.buttonGroup({ buttons: [
|
|
18
|
-
{ content: "Day", attrs: ".
|
|
19
|
-
{ content: "Week", attrs: ".
|
|
20
|
-
{ content: "Month", attrs: ".
|
|
18
|
+
{ content: "Day", attrs: ".neutral" },
|
|
19
|
+
{ content: "Week", attrs: ".neutral" },
|
|
20
|
+
{ content: "Month", attrs: ".neutral" },
|
|
21
21
|
]});
|
|
22
22
|
```
|
package/skill/dialog.md
CHANGED
|
@@ -22,7 +22,7 @@ S.dialog({
|
|
|
22
22
|
content: (close) => {
|
|
23
23
|
A("p #Are you sure?");
|
|
24
24
|
S.button({ content: "Yes", click: () => { S.alert("Nice!"); close(); } });
|
|
25
|
-
S.button({ content: "Cancel", attrs: ".
|
|
25
|
+
S.button({ content: "Cancel", attrs: ".neutral", click: close });
|
|
26
26
|
},
|
|
27
27
|
});
|
|
28
28
|
```
|
package/skill/menuButton.md
CHANGED
|
@@ -17,7 +17,7 @@ for SPA navigation — active items are highlighted automatically.
|
|
|
17
17
|
|
|
18
18
|
```ts
|
|
19
19
|
S.menuButton({
|
|
20
|
-
button: { content: "Actions", attrs: ".
|
|
20
|
+
button: { content: "Actions", attrs: ".neutral" },
|
|
21
21
|
items: [
|
|
22
22
|
{ label: "Edit", icon: () => A("#✎"), click: () => edit() },
|
|
23
23
|
{ separator: true },
|
package/src/components/main.ts
CHANGED
|
@@ -53,6 +53,10 @@ A.insertGlobalCss({
|
|
|
53
53
|
".s-main": {
|
|
54
54
|
// container-type so @container queries below can respond to shell width.
|
|
55
55
|
"&": "display:flex flex-direction:column min-height:100vh max-height:100vh container-type:inline-size",
|
|
56
|
+
// <body> carries a default $3 padding; when the shell is a direct child of it,
|
|
57
|
+
// cancel that padding with matching negative margins so the chrome still spans
|
|
58
|
+
// edge to edge (and the 100vh sizing stays exact).
|
|
59
|
+
"body > &": "margin: calc(-1 * $3)",
|
|
56
60
|
// Header/footer stretch their background the full shell width; their inner
|
|
57
61
|
// `.s-bar` caps to maxWidth and centres, so chrome aligns with the content.
|
|
58
62
|
// The top bar is a full-width `.neutral` surface; cancel its surface border and
|
package/src/theme.ts
CHANGED
|
@@ -139,7 +139,7 @@ A.insertGlobalCss({
|
|
|
139
139
|
// What follows is a lightweight CSS reset. Semantic HTML should keep working, but less ugly/with some reasonable defaults.
|
|
140
140
|
"*, *::before, *::after": "box-sizing:border-box",
|
|
141
141
|
html: "text-size-adjust:100%",
|
|
142
|
-
body: "m:0 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased background-color:$s-bg text:$s-text",
|
|
142
|
+
body: "m:0 p:$3 line-height:1.5 font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; -webkit-font-smoothing:antialiased background-color:$s-bg text:$s-text",
|
|
143
143
|
// Links resolve to the contextual link foreground: the link colour on nesting
|
|
144
144
|
// surfaces, the ink on accent surfaces.
|
|
145
145
|
a: "color: $s-link-fg; text-decoration:underline text-underline-offset:2px; transition: color 0.12s, filter 0.12s;",
|