Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
302778573d | ||
|
|
ad58894c25 |
2 changed files with 28 additions and 53 deletions
|
|
@ -319,47 +319,10 @@ h2, h3 {
|
|||
background: color-mix(in srgb, var(--purple) 6%, transparent);
|
||||
}
|
||||
|
||||
/* Header pill — inbox / loose-ends triggers. Compact, count-prominent.
|
||||
Markup carries `hive-pill` alongside `header-pill` (shared pill.css
|
||||
supplies border/radius/padding/font-size/letter-spacing; `display`
|
||||
is the one thing overridden here, to `inline-flex`, for the icon+
|
||||
label+count row layout — see pill.css's own note on that). */
|
||||
.header-pill {
|
||||
background: transparent;
|
||||
border-color: var(--purple-dim);
|
||||
color: var(--fg);
|
||||
font-family: inherit;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 0.4em;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
|
||||
}
|
||||
.header-pill:hover {
|
||||
border-color: var(--purple);
|
||||
color: var(--purple);
|
||||
box-shadow: 0 0 10px -2px var(--purple);
|
||||
}
|
||||
.header-pill-icon { font-size: 1.05em; line-height: 1; }
|
||||
.header-pill-label { color: var(--muted); }
|
||||
.header-pill-count {
|
||||
background: var(--purple-dim);
|
||||
color: var(--purple);
|
||||
border-radius: 999px;
|
||||
padding: 0 0.5em;
|
||||
min-width: 1.6em;
|
||||
text-align: center;
|
||||
font-weight: bold;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.header-pill-inbox .header-pill-count {
|
||||
background: color-mix(in srgb, var(--amber) 18%, transparent);
|
||||
color: var(--amber);
|
||||
}
|
||||
.header-pill-todos .header-pill-count {
|
||||
background: color-mix(in srgb, var(--green) 18%, transparent);
|
||||
color: var(--green);
|
||||
}
|
||||
/* Header pill (inbox / loose-ends triggers) — no CSS of its own any
|
||||
more. `HeaderPill.tsx` renders `@hive/shared`'s `Badge` directly now
|
||||
(mara: "cant we reuse the badge component") instead of a hand-styled
|
||||
pill matched to Badge's own values; nothing left to override here. */
|
||||
|
||||
.agent-main {
|
||||
position: absolute;
|
||||
|
|
|
|||
|
|
@ -1,9 +1,15 @@
|
|||
// <HeaderPill> — the inbox/todos flyout triggers in the header's right
|
||||
// cluster. Reuses agent.css's existing `.hive-pill.header-pill…` rules
|
||||
// (loaded globally) — same "layout is a like-for-like port, the
|
||||
// component model is the change" approach as Header.tsx. Hidden
|
||||
// (renders nothing) at count 0, matching the old page's `pill.hidden =
|
||||
// count === 0`.
|
||||
// cluster. A thin wrapper over `@hive/shared`'s `Badge` (icon+label+
|
||||
// value+onClick already covers this shape exactly) rather than a
|
||||
// bespoke pill — mara, reviewing the first cut of this (a hand-styled
|
||||
// `.header-pill` matched to `Badge`'s own CSS values rather than the
|
||||
// component itself): "cant we reuse the badge component". Only two
|
||||
// things this wrapper still owns: hiding at count 0 (`pill.hidden =
|
||||
// count === 0` in the old page) and picking the inbox/todos tone so
|
||||
// the count reads amber/green like it always has (`Badge`'s `tone`
|
||||
// colours the value, which here is the count).
|
||||
import { Badge, type BadgeTone } from '@hive/shared/badge.js';
|
||||
|
||||
export interface HeaderPillProps {
|
||||
kind: 'inbox' | 'todos';
|
||||
icon: string;
|
||||
|
|
@ -12,15 +18,21 @@ export interface HeaderPillProps {
|
|||
onClick: () => void;
|
||||
}
|
||||
|
||||
const TONE: Record<HeaderPillProps['kind'], BadgeTone> = {
|
||||
inbox: 'warning',
|
||||
todos: 'positive',
|
||||
};
|
||||
|
||||
export function HeaderPill({ kind, icon, label, count, onClick }: HeaderPillProps) {
|
||||
if (count === 0) return null;
|
||||
return (
|
||||
<button type="button" class={`hive-pill header-pill header-pill-${kind}`} onClick={onClick} title={`open ${label} flyout`}>
|
||||
<span class="header-pill-icon" aria-hidden="true">
|
||||
{icon}
|
||||
</span>
|
||||
<span class="header-pill-label">{label}</span>
|
||||
<span class="header-pill-count">{count}</span>
|
||||
</button>
|
||||
<Badge
|
||||
icon={icon}
|
||||
label={label}
|
||||
value={count}
|
||||
tone={TONE[kind]}
|
||||
onClick={onClick}
|
||||
title={`open ${label} flyout`}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue