treefmt: apply prettier
Pure `nix fmt` output from the commit before this one — no hand edits. 203 files: 52 md, 42 tsx, 32 js, 32 css, 21 ts, 13 html, 8 json, 3 mjs. Reproduce with `nix develop -c nix fmt` on the parent commit; the result should be byte-identical to this tree. None of the 13 `.prettierignore` entries appears here — verified by intersecting the changed-file list against the ignore file, with a control proving the intersection finds a match when one exists.
This commit is contained in:
parent
5d24bedd60
commit
39b95c2ede
203 changed files with 10090 additions and 6085 deletions
|
|
@ -18,9 +18,20 @@
|
|||
color: var(--fg);
|
||||
white-space: pre-wrap;
|
||||
opacity: 1;
|
||||
transition: opacity 0.2s ease, transform 0.2s ease;
|
||||
transition:
|
||||
opacity 0.2s ease,
|
||||
transform 0.2s ease;
|
||||
}
|
||||
:host(.out) {
|
||||
opacity: 0;
|
||||
transform: translateX(0.5em);
|
||||
}
|
||||
:host(.error) {
|
||||
border-left-color: var(--red);
|
||||
}
|
||||
:host(.info) {
|
||||
border-left-color: var(--purple-dim);
|
||||
}
|
||||
:host(.ok) {
|
||||
border-left-color: var(--green);
|
||||
}
|
||||
:host(.out) { opacity: 0; transform: translateX(0.5em); }
|
||||
:host(.error) { border-left-color: var(--red); }
|
||||
:host(.info) { border-left-color: var(--purple-dim); }
|
||||
:host(.ok) { border-left-color: var(--green); }
|
||||
|
|
|
|||
|
|
@ -9,29 +9,29 @@
|
|||
// directly in the shadow root rather than via a `<slot>`, since there's no
|
||||
// external light-DOM content to project.
|
||||
|
||||
import { attachShadowCss } from '../shadow-css.js';
|
||||
import toastCss from './hive-toast.css';
|
||||
import { attachShadowCss } from "../shadow-css.js";
|
||||
import toastCss from "./hive-toast.css";
|
||||
|
||||
class HiveToast extends HTMLElement {
|
||||
connectedCallback() {
|
||||
const { type = 'info', duration } = this._opts || {};
|
||||
const ms = duration != null ? duration : (type === 'error' ? 8000 : 4000);
|
||||
const { type = "info", duration } = this._opts || {};
|
||||
const ms = duration != null ? duration : type === "error" ? 8000 : 4000;
|
||||
const root = attachShadowCss(this, toastCss);
|
||||
this.classList.add(type);
|
||||
this.setAttribute('role', type === 'error' ? 'alert' : 'status');
|
||||
root.textContent = this._message || '';
|
||||
this.setAttribute("role", type === "error" ? "alert" : "status");
|
||||
root.textContent = this._message || "";
|
||||
let removed = false;
|
||||
this._remove = () => {
|
||||
if (removed) return;
|
||||
removed = true;
|
||||
this.classList.add('out');
|
||||
this.classList.add("out");
|
||||
setTimeout(() => this.remove(), 200);
|
||||
};
|
||||
this.addEventListener('click', this._remove);
|
||||
this.addEventListener("click", this._remove);
|
||||
if (ms > 0) this._timer = setTimeout(this._remove, ms);
|
||||
}
|
||||
disconnectedCallback() {
|
||||
clearTimeout(this._timer);
|
||||
}
|
||||
}
|
||||
customElements.define('hive-toast', HiveToast);
|
||||
customElements.define("hive-toast", HiveToast);
|
||||
|
|
|
|||
Loading…
Reference in a new issue