[web] Design review: last row's menu not clipped, Hostname focused after loading, popover closes on Esc and outside click, phone engine chip in the top bar, paused and needs-attention copy with Restore in the panel, change bar offers and countdown, focus after share and kept, fingerprint check when signing by hand, draft kept through sign-in
This commit is contained in:
@@ -39,12 +39,29 @@
|
||||
if (modal && typeof el.showModal === "function") el.showModal();
|
||||
else if (typeof el.show === "function") el.show();
|
||||
else el.setAttribute("open", "");
|
||||
const first = el.querySelector<HTMLElement>(
|
||||
"[data-autofocus], input:not([type=hidden]):not([readonly]):not([type=radio]), textarea, select",
|
||||
);
|
||||
const first =
|
||||
el.querySelector<HTMLElement>("[data-autofocus]") ??
|
||||
el.querySelector<HTMLElement>("input:not([type=hidden]):not([readonly]):not([type=radio]), textarea:not([readonly]), select");
|
||||
(first ?? el.querySelector<HTMLElement>(".ia-dialog-title"))?.focus();
|
||||
}
|
||||
// A dialog opened with show() (the popover) gets no cancel event: Esc and a click outside
|
||||
// close it here, like the modal ones.
|
||||
const key = (e: KeyboardEvent) => {
|
||||
if (!modal && e.key === "Escape" && escape) {
|
||||
e.preventDefault();
|
||||
onclose();
|
||||
}
|
||||
};
|
||||
const down = (e: PointerEvent) => {
|
||||
if (!modal && escape && el && e.target instanceof Node && !el.contains(e.target)) onclose();
|
||||
};
|
||||
document.addEventListener("keydown", key);
|
||||
// On the next turn, so the click that opened the popover does not close it.
|
||||
const t = setTimeout(() => document.addEventListener("pointerdown", down), 0);
|
||||
return () => {
|
||||
clearTimeout(t);
|
||||
document.removeEventListener("keydown", key);
|
||||
document.removeEventListener("pointerdown", down);
|
||||
if (opener instanceof HTMLElement && document.contains(opener)) opener.focus();
|
||||
};
|
||||
});
|
||||
|
||||
@@ -12,6 +12,15 @@
|
||||
@import "@fontsource/manrope/latin-400.css";
|
||||
@import "@fontsource/manrope/latin-600.css";
|
||||
@import "@fontsource/manrope/latin-700.css";
|
||||
/* latin-ext: Czech names and places (č, ř, ů) in host names, device names and messages. */
|
||||
@import "@fontsource/cinzel/latin-ext-500.css";
|
||||
@import "@fontsource/cormorant-garamond/latin-ext-500.css";
|
||||
@import "@fontsource/cormorant-garamond/latin-ext-600.css";
|
||||
@import "@fontsource/manrope/latin-ext-400.css";
|
||||
@import "@fontsource/manrope/latin-ext-600.css";
|
||||
@import "@fontsource/manrope/latin-ext-700.css";
|
||||
|
||||
html, body { margin: 0; }
|
||||
|
||||
.ia .sr-only {
|
||||
position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
|
||||
@@ -98,7 +107,10 @@
|
||||
.ia .ia-engine small { color: var(--muted); font-weight: 400; font-size: 0.86rem; }
|
||||
|
||||
/* ── Lists and rows (§2.5) ──────────────────────────────────────────────── */
|
||||
.ia .ia-list { border: 1px solid var(--hairline); border-radius: var(--radius-lg); overflow: hidden; }
|
||||
.ia .ia-list { border: 1px solid var(--hairline); border-radius: var(--radius-lg); }
|
||||
/* No overflow clipping on the list: a row's menu must reach past it. The end rows carry the corners. */
|
||||
.ia .ia-list > :first-child { border-top-left-radius: calc(var(--radius-lg) - 1px); border-top-right-radius: calc(var(--radius-lg) - 1px); }
|
||||
.ia .ia-list > :last-child { border-bottom-left-radius: calc(var(--radius-lg) - 1px); border-bottom-right-radius: calc(var(--radius-lg) - 1px); }
|
||||
.ia .ia-row { display: grid; grid-template-columns: 128px minmax(0, 1.4fr) minmax(0, 1.6fr) 44px; gap: 16px; padding: 12px 10px 12px 18px; align-items: start; border-top: 1px solid var(--hairline); }
|
||||
.ia .ia-row:first-child { border-top: 0; }
|
||||
.ia .ia-row.head { background: var(--colonnade); padding-top: 10px; padding-bottom: 10px; align-items: center; }
|
||||
@@ -121,6 +133,7 @@
|
||||
background: none; color: var(--text-2); font-weight: 600; font-size: 0.92rem; text-align: left; cursor: pointer;
|
||||
}
|
||||
.ia .ia-menu [role="menuitem"]:hover, .ia .ia-menu [role="menuitem"]:focus { background: var(--surface-2); color: var(--text); outline: none; }
|
||||
.ia .ia-menu [role="menuitem"]:focus-visible { outline: var(--focus-ring); outline-offset: -2px; }
|
||||
.ia .ia-menu [role="menuitem"].danger { color: var(--danger); }
|
||||
.ia .ia-menu [role="menuitem"][aria-disabled="true"] { color: var(--disabled); cursor: not-allowed; flex-wrap: wrap; padding-top: 6px; padding-bottom: 6px; }
|
||||
.ia .ia-menu .reason { flex-basis: 100%; padding-left: 28px; font-weight: 400; font-size: var(--fs-sub); color: var(--muted); }
|
||||
@@ -185,7 +198,7 @@
|
||||
@media (max-width: 719.98px) { .ia .ia-toasts { right: 16px; left: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); } }
|
||||
.ia .ia-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
|
||||
.ia .ia-progress > span { display: block; height: 100%; background: var(--accent); transition: width var(--dur-tick) linear; }
|
||||
.ia .ia-secret { display: block; width: 100%; background: var(--surface); border: 1px solid var(--control-edge); border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 12px 14px; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; color: var(--text); font: inherit; }
|
||||
.ia .ia-secret { display: block; width: 100%; background: var(--surface); border: 1px solid var(--control-edge); border-radius: var(--radius-sm); box-shadow: var(--carved); padding: 12px 14px; font: inherit; font-weight: 600; letter-spacing: 0.02em; word-break: break-all; overflow-wrap: anywhere; white-space: pre-wrap; color: var(--text); resize: none; }
|
||||
.ia .ia-details pre { background: var(--surface); border-radius: var(--radius-sm); color: var(--muted); font-size: var(--fs-sub); white-space: pre-wrap; padding: 10px 12px; margin: 6px 0; }
|
||||
.ia .ia-frame { border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 32px; text-align: center; }
|
||||
.ia .ia-card { background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius); padding: 12px 14px; }
|
||||
|
||||
@@ -17,6 +17,7 @@ export const ICONS = {
|
||||
building: "M4 21V5l8-3 8 3v16M9 21v-5h6v5M8 8h2M14 8h2M8 12h2M14 12h2",
|
||||
swap: "M7 7h13l-4-4M17 17H4l4 4",
|
||||
copy: "M9 9h11v11H9zM5 15H4V4h11v1",
|
||||
download: "M12 4v11M7 10l5 5 5-5M5 20h14",
|
||||
chevron: "M6 9l6 6 6-6",
|
||||
dots: "M5 12h.01M12 12h.01M19 12h.01",
|
||||
close: "M6 6l12 12M18 6 6 18",
|
||||
|
||||
Reference in New Issue
Block a user