feat(ui): component redesign pass and fixes, release ui 0.8.87
Redesign - Shared field foundation rules (duplicated across 15 form components and emitted globally) are now identical everywhere, so later copies no longer silently override earlier redesigns. - Drawn checkbox and radio controls, white switch thumbs (the thumb was the text colour, a black blob in light mode), recessed field wells, keycap actions in Modal, Drawer, Popover, Toaster, Pagination, Stepper, DataTable. - Menus (Dropdown, ContextMenu, Popover, Select dropdown, Navbar panels) share one flat raised panel with neutral hover rows and mono section labels. - Alerts with an accent rail and icon chip; card headers without the grey band; accordion, collapse, list, list group, timeline, stats, metrics, chat, skeleton, avatar group, clipboard, splitter, section, sidebar, navbar and upload progress restyled. - Chart rebuilt: nice y-axis ticks, gridlines, rounded bars, line and area modes, hover tooltips, hidden series leave the scale. Fixes - Checkbox and radio labels toggle their input again (empty for="" broke it). - TimePicker kept every clicked time pressed; only the chosen hour and minute are pressed now, and nothing is pressed before a value exists. - ColorPicker hex readout now follows the picked colour. - Disabled FileInput no longer shows the native file-input text. - Date and time panels float instead of pushing content. - ContextMenu opened at the pointer closes on scroll. - Drawer left/top/bottom placements slide from their own edge again. - Image-only Card no longer renders an empty body strip. - Timeline supports item.time, current/upcoming states, sizes and compact/alternate variants; showcase demos use distinct variants. - ChatBubble: delivery receipts (sending/sent/delivered/read/failed/error) and meta aligned to its bubble. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5eae6f3b3c
commit
1bed8e4b74
93 files changed
+4439
-1915
No files matched your search
@@ -59,6 +59,10 @@ component ContextMenu {
|
||||
positionY = Math.max(12, sourceEvent.clientY || 12)
|
||||
}
|
||||
visible = true
|
||||
// A pointer-placed menu is fixed to the viewport, so scrolling would
|
||||
// slide the page out from under it. Close it the way native context
|
||||
// menus do. Capture catches scrolling inside nested containers too.
|
||||
window.addEventListener("scroll", closeOnScroll, { capture: true, once: true, passive: true })
|
||||
output.open({
|
||||
x: positionX,
|
||||
y: positionY,
|
||||
@@ -67,6 +71,12 @@ component ContextMenu {
|
||||
})
|
||||
}
|
||||
|
||||
client function closeOnScroll(sourceEvent) {
|
||||
if (visible && placement === "pointer") {
|
||||
hideMenu("scroll", sourceEvent)
|
||||
}
|
||||
}
|
||||
|
||||
client function hideMenu(reason, sourceEvent) {
|
||||
visible = false
|
||||
output.close({
|
||||
@@ -320,22 +330,17 @@ component ContextMenu {
|
||||
.wrn-context-menu__panel {
|
||||
position: absolute;
|
||||
z-index: 1091;
|
||||
top: calc(100% + 0.5rem);
|
||||
top: calc(100% + 0.375rem);
|
||||
left: 0;
|
||||
width: max-content;
|
||||
min-width: var(--wrn-context-min-width);
|
||||
max-width: min(var(--wrn-context-max-width), calc(100vw - 1.5rem));
|
||||
padding: 0.45rem;
|
||||
padding: 0.3rem;
|
||||
color: var(--wrn-color-text);
|
||||
background:
|
||||
linear-gradient(145deg, color-mix(in srgb, var(--context-accent) 5%, transparent), transparent 58%),
|
||||
color-mix(in srgb, var(--wrn-color-surface-raised) 96%, transparent);
|
||||
border: 1px solid color-mix(in srgb, var(--context-accent) 18%, var(--wrn-color-border));
|
||||
border-radius: var(--wrn-radius-md);
|
||||
box-shadow:
|
||||
0 1px 0 color-mix(in srgb, white 5%, transparent) inset,
|
||||
0 24px 64px color-mix(in srgb, black 24%, transparent);
|
||||
backdrop-filter: blur(18px);
|
||||
background: var(--wrn-color-surface-raised);
|
||||
border: 1px solid var(--wrn-color-border);
|
||||
border-radius: var(--wrn-radius);
|
||||
box-shadow: var(--wrn-highlight-edge, none), var(--wrn-shadow-3);
|
||||
transform-origin: top left;
|
||||
}
|
||||
|
||||
@@ -366,10 +371,8 @@ component ContextMenu {
|
||||
}
|
||||
|
||||
.wrn-context-menu[data-variant="soft"] .wrn-context-menu__panel {
|
||||
background:
|
||||
linear-gradient(145deg, var(--context-soft), transparent 72%),
|
||||
var(--wrn-color-surface-raised);
|
||||
box-shadow: 0 18px 48px color-mix(in srgb, black 16%, transparent);
|
||||
background: color-mix(in srgb, var(--context-accent) 4%, var(--wrn-color-surface-raised));
|
||||
box-shadow: var(--wrn-shadow-3);
|
||||
}
|
||||
|
||||
.wrn-context-menu[data-variant="outline"] .wrn-context-menu__panel {
|
||||
@@ -379,14 +382,15 @@ component ContextMenu {
|
||||
|
||||
.wrn-context-menu__header {
|
||||
display: grid;
|
||||
gap: 0.2rem;
|
||||
padding: 0.65rem 0.75rem 0.75rem;
|
||||
gap: 0.15rem;
|
||||
padding: 0.5rem 0.625rem 0.625rem;
|
||||
margin: -0.3rem -0.3rem 0.25rem;
|
||||
border-bottom: 1px solid var(--wrn-color-border);
|
||||
}
|
||||
|
||||
.wrn-context-menu__header strong {
|
||||
font-size: 0.86rem;
|
||||
font-weight: 650;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 620;
|
||||
}
|
||||
|
||||
.wrn-context-menu__header span {
|
||||
@@ -402,17 +406,18 @@ component ContextMenu {
|
||||
}
|
||||
|
||||
.wrn-context-menu__section-label {
|
||||
padding: 0.55rem 0.75rem 0.3rem;
|
||||
color: var(--wrn-color-text-muted);
|
||||
font-size: 0.68rem;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.12em;
|
||||
padding: 0.5rem 0.625rem 0.25rem;
|
||||
color: var(--wrn-color-text-subtle, var(--wrn-color-text-muted));
|
||||
font-family: var(--wrn-font-mono, monospace);
|
||||
font-size: 0.65rem;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0.08em;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.wrn-context-menu__divider {
|
||||
height: 1px;
|
||||
margin: 0.3rem 0.45rem;
|
||||
margin: 0.25rem -0.3rem;
|
||||
background: var(--wrn-color-border);
|
||||
}
|
||||
|
||||
@@ -421,31 +426,33 @@ component ContextMenu {
|
||||
display: grid;
|
||||
grid-template-columns: auto minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 0.7rem;
|
||||
gap: 0.625rem;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
padding: 0.65rem 0.7rem;
|
||||
padding: 0.5rem 0.625rem;
|
||||
color: var(--wrn-color-text);
|
||||
background: transparent;
|
||||
border: 0;
|
||||
border-radius: 0.72rem;
|
||||
border-radius: calc(var(--wrn-radius-sm) - 2px);
|
||||
font: inherit;
|
||||
font-size: 0.8125rem;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
transition: background-color 150ms ease, color 150ms ease, transform 150ms ease;
|
||||
transition: background-color 120ms ease, color 120ms ease;
|
||||
}
|
||||
|
||||
.wrn-context-menu__item:hover,
|
||||
.wrn-context-menu__item:focus-visible,
|
||||
.wrn-context-menu__item[data-selected="true"] {
|
||||
color: var(--context-accent);
|
||||
background: var(--context-soft);
|
||||
color: var(--wrn-color-text);
|
||||
background: var(--wrn-color-surface-muted, var(--wrn-color-surface-soft));
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.wrn-context-menu__item:active {
|
||||
transform: scale(0.985);
|
||||
transform: none;
|
||||
background: color-mix(in srgb, var(--context-accent) 10%, var(--wrn-color-surface-muted, var(--wrn-color-surface-soft)));
|
||||
}
|
||||
|
||||
.wrn-context-menu__item[data-danger="true"] {
|
||||
@@ -478,9 +485,9 @@ component ContextMenu {
|
||||
|
||||
.wrn-context-menu__copy strong {
|
||||
overflow: hidden;
|
||||
font-size: 0.82rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.3;
|
||||
font-size: 0.8125rem;
|
||||
font-weight: 550;
|
||||
line-height: 1.35;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
@@ -488,20 +495,21 @@ component ContextMenu {
|
||||
.wrn-context-menu__copy small {
|
||||
overflow: hidden;
|
||||
color: var(--wrn-color-text-muted);
|
||||
font-size: 0.7rem;
|
||||
font-size: 0.72rem;
|
||||
line-height: 1.35;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.wrn-context-menu kbd {
|
||||
padding: 0.16rem 0.38rem;
|
||||
color: var(--wrn-color-text-muted);
|
||||
padding: 0.125rem 0.35rem;
|
||||
color: var(--wrn-color-text-subtle, var(--wrn-color-text-muted));
|
||||
background: var(--wrn-color-surface-soft);
|
||||
border: 1px solid var(--wrn-color-border);
|
||||
border-radius: 0.36rem;
|
||||
font-size: 0.64rem;
|
||||
font-family: inherit;
|
||||
border-bottom-width: 2px;
|
||||
border-radius: 0.3rem;
|
||||
font-size: 0.65rem;
|
||||
font-family: var(--wrn-font-mono, monospace);
|
||||
}
|
||||
|
||||
.wrn-context-menu[data-size="sm"] .wrn-context-menu__item {
|
||||
|
||||
Reference in new issue
Block a user