swarm-ui: the terminal message box has a placeholder and a spinner instead of a label and a sent line
The label 'message <agent>' is the input's placeholder (the label stays for screen readers). The send button shows a spinner over its label while the request is pending and keeps its width, and the 'sent' line is gone: the box empties when the message is held. Spinner is a component of its own now, used by the button and the refresh picker.
This commit is contained in:
parent
5eef1f4a3d
commit
c37205e8f5
2 changed files with 103 additions and 51 deletions
|
|
@ -43,32 +43,3 @@
|
|||
font-size: 0.85em;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
/* The spinner takes the clock's place: the same box, so the picker keeps its
|
||||
width. Motion follows the page's setting, the same three rules the page
|
||||
switch uses; where motion is off it is a static arc. */
|
||||
.ui-refresh-picker-spinner {
|
||||
box-sizing: border-box;
|
||||
width: 1em;
|
||||
height: 1em;
|
||||
border: 2px solid currentColor;
|
||||
border-right-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: ui-refresh-spin 0.8s linear infinite;
|
||||
}
|
||||
@keyframes ui-refresh-spin {
|
||||
to {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ui-refresh-picker-spinner {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
:root[data-motion="reduce"] .ui-refresh-picker-spinner {
|
||||
animation: none;
|
||||
}
|
||||
:root[data-motion="allow"] .ui-refresh-picker-spinner {
|
||||
animation: ui-refresh-spin 0.8s linear infinite;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
// hook only decides *when* to call it.
|
||||
import { useEffect, useRef } from "preact/hooks";
|
||||
import { Listbox } from "../select-field/Listbox.js";
|
||||
import { Spinner } from "../spinner/Spinner.js";
|
||||
import "./RefreshInterval.css";
|
||||
|
||||
// `null` means "off" throughout this module — no separate boolean, so
|
||||
|
|
@ -59,7 +60,7 @@ export function RefreshIntervalPicker({
|
|||
aria-hidden="true"
|
||||
title={refreshing ? "refreshing" : undefined}
|
||||
>
|
||||
{refreshing ? <span class="ui-refresh-picker-spinner" /> : "🕐"}
|
||||
{refreshing ? <Spinner /> : "🕐"}
|
||||
</span>
|
||||
<Listbox
|
||||
id={id}
|
||||
|
|
|
|||
Loading…
Reference in a new issue