feat(ui): redesign UI with Tailwind CSS, CodeMirror 6, and new layout
- Replace all hand-written CSS with Tailwind utility classes - Upgrade CodeMirror 5 to CodeMirror 6 (scoped @codemirror/* packages) - Redesign layout with responsive sidebar navigation using JSX/Mithril - Flatten admin routes (e.g. /admin/presets -> /presets) - Add "remember me" login option with 2-week persistent cookie - Add delete confirmation dialogs across admin pages - Upgrade esbuild from 0.21 to 0.27 and update browser targets - Add Inter and Roboto Mono variable fonts with subset script
This commit is contained in:
1 parent
a7256620e0
commit
4a191afdec
64 files changed
+4147
-2421
No files matched your search
@@ -12,7 +12,7 @@ export default class Autocomplete {
|
||||
declare private selection: number;
|
||||
declare private container: HTMLElement;
|
||||
|
||||
public constructor(className: string, callback: AutocompleteCallback) {
|
||||
public constructor(callback: AutocompleteCallback) {
|
||||
this.callback = callback;
|
||||
this.element = null;
|
||||
this.hideTimeout = null;
|
||||
@@ -24,7 +24,8 @@ export default class Autocomplete {
|
||||
this.container.style.position = "absolute";
|
||||
this.container.style.display = "block";
|
||||
this.container.style.opacity = "0";
|
||||
this.container.className = className;
|
||||
this.container.className =
|
||||
"absolute py-1 mt-2 rounded-md shadow-lg bg-white";
|
||||
}
|
||||
|
||||
public attach(el: HTMLInputElement): void {
|
||||
@@ -140,9 +141,10 @@ export default class Autocomplete {
|
||||
for (const [idx, suggestion] of suggestions.entries()) {
|
||||
const e = document.createElement("div");
|
||||
if (suggestion.tip) e.title = suggestion.tip;
|
||||
e.classList.add("suggestion");
|
||||
e.className =
|
||||
"text-stone-700 block px-4 py-2 text-sm hover:bg-stone-100 hover:text-stone-900";
|
||||
if (idx === this.selection) {
|
||||
e.classList.add("selected");
|
||||
e.classList.add("bg-stone-100", "text-stone-900");
|
||||
selectedElement = e;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user