mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 18:37:24 +00:00
fix(cloud): GA-P3t banner contrast: severity fills, 3:1 borders and icons, 4.5:1 text for every strip, banner and notice
This commit is contained in:
@@ -152,6 +152,17 @@
|
||||
--color-jira-priority-low: var(--jira-priority-low);
|
||||
--color-status-warning-background: var(--status-warning-background);
|
||||
--color-status-warning-border: var(--status-warning-border);
|
||||
/* GA-P3t: strips, banners and notices by severity (fill, 1px border, icon, body text). */
|
||||
--color-banner-warning-fill: var(--banner-warning-fill);
|
||||
--color-banner-warning-border: var(--banner-warning-border);
|
||||
--color-banner-warning-icon: var(--banner-warning-icon);
|
||||
--color-banner-error-fill: var(--banner-error-fill);
|
||||
--color-banner-error-border: var(--banner-error-border);
|
||||
--color-banner-error-icon: var(--banner-error-icon);
|
||||
--color-banner-info-fill: var(--banner-info-fill);
|
||||
--color-banner-info-border: var(--banner-info-border);
|
||||
--color-banner-info-icon: var(--banner-info-icon);
|
||||
--color-banner-body: var(--banner-body);
|
||||
--color-callout-note: var(--callout-note);
|
||||
--color-callout-important: var(--callout-important);
|
||||
--color-workspace-status-done: var(--workspace-status-done);
|
||||
@@ -467,6 +478,18 @@
|
||||
--jira-priority-low: var(--callout-note);
|
||||
--status-warning-background: color-mix(in srgb, var(--status-warning) 10%, transparent);
|
||||
--status-warning-border: color-mix(in srgb, var(--status-warning) 25%, transparent);
|
||||
/* GA-P3t (Neil): banners must stand out on white panes. Border >=3:1 on the surface; icon >=3:1
|
||||
and text >=4.5:1 on the fill (measured on #fff and #fafafa). */
|
||||
--banner-warning-fill: color-mix(in srgb, #f59e0b 14%, var(--background));
|
||||
--banner-warning-border: #b45309;
|
||||
--banner-warning-icon: #b45309;
|
||||
--banner-error-fill: color-mix(in srgb, var(--destructive) 8%, var(--background));
|
||||
--banner-error-border: #c20012;
|
||||
--banner-error-icon: #c20012;
|
||||
--banner-info-fill: color-mix(in srgb, var(--foreground) 7.5%, var(--background));
|
||||
--banner-info-border: color-mix(in srgb, var(--foreground) 47%, var(--background));
|
||||
--banner-info-icon: color-mix(in srgb, var(--foreground) 65%, var(--background));
|
||||
--banner-body: color-mix(in srgb, var(--foreground) 70%, var(--background));
|
||||
/* GitHub's own hues for the two callout kinds no status token covers. */
|
||||
--callout-note: #0969da;
|
||||
--callout-important: #8250df;
|
||||
@@ -504,6 +527,17 @@
|
||||
--jira-priority-low: var(--callout-note);
|
||||
--status-warning-background: color-mix(in srgb, var(--status-warning) 10%, transparent);
|
||||
--status-warning-border: color-mix(in srgb, var(--status-warning) 25%, transparent);
|
||||
/* GA-P3t: dark keeps its fills and icons; borders raised to >=3:1 on #0a0a0a (error, info failed). */
|
||||
--banner-warning-fill: color-mix(in srgb, var(--status-warning) 10%, var(--card));
|
||||
--banner-warning-border: color-mix(in srgb, var(--status-warning) 45%, var(--card));
|
||||
--banner-warning-icon: var(--status-warning);
|
||||
--banner-error-fill: color-mix(in srgb, var(--destructive) 10%, var(--card));
|
||||
--banner-error-border: color-mix(in srgb, var(--destructive) 62%, var(--card));
|
||||
--banner-error-icon: var(--destructive);
|
||||
--banner-info-fill: var(--card);
|
||||
--banner-info-border: color-mix(in srgb, var(--foreground) 36%, var(--card));
|
||||
--banner-info-icon: var(--muted-foreground);
|
||||
--banner-body: var(--muted-foreground);
|
||||
--callout-note: #4493f8;
|
||||
--callout-important: #ab7df8;
|
||||
--git-decoration-added: #81b88b;
|
||||
|
||||
@@ -24,6 +24,7 @@ import {
|
||||
} from '@/components/ui/dropdown-menu'
|
||||
import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { BANNER_BODY_TEXT, BANNER_TONE, type BannerSeverity } from '@/components/ui/banner-tone'
|
||||
import { useReservePaneTopSpace } from '../terminal-pane/appearance/pane-top-banner/PaneTopWarningBanner'
|
||||
import type {
|
||||
CloudStripModel,
|
||||
@@ -97,27 +98,32 @@ export type CloudStripActions = {
|
||||
cancel: () => void
|
||||
}
|
||||
|
||||
/** GA-P3t: the strip's severity look; anything that isn't a warning or an error reads as info. */
|
||||
export function stripSeverity(status: CloudStripStatus): BannerSeverity {
|
||||
return status === 'warning' ? 'warning' : status === 'error' ? 'error' : 'info'
|
||||
}
|
||||
|
||||
function StatusSlot({ status }: { status: CloudStripStatus }): React.JSX.Element {
|
||||
const base = 'size-4 shrink-0'
|
||||
switch (status) {
|
||||
case 'need':
|
||||
return <CircleDashed aria-hidden className={cn(base, 'text-muted-foreground')} />
|
||||
return <CircleDashed aria-hidden className={cn(base, BANNER_TONE.info.icon)} />
|
||||
// Not set up yet (or pasting the setup token): neutral, like the agent sheet; nothing is loading.
|
||||
case 'setup':
|
||||
return <Info aria-hidden className={cn(base, 'text-muted-foreground')} />
|
||||
return <Info aria-hidden className={cn(base, BANNER_TONE.info.icon)} />
|
||||
case 'warning':
|
||||
return <TriangleAlert aria-hidden className={cn(base, 'text-status-warning-text')} />
|
||||
return <TriangleAlert aria-hidden className={cn(base, BANNER_TONE.warning.icon)} />
|
||||
case 'busy':
|
||||
return (
|
||||
<Loader2
|
||||
aria-hidden
|
||||
className={cn(base, 'text-muted-foreground motion-safe:animate-spin')}
|
||||
className={cn(base, BANNER_TONE.info.icon, 'motion-safe:animate-spin')}
|
||||
/>
|
||||
)
|
||||
case 'error':
|
||||
return <CircleAlert aria-hidden className={cn(base, 'text-destructive')} />
|
||||
return <CircleAlert aria-hidden className={cn(base, BANNER_TONE.error.icon)} />
|
||||
case 'done':
|
||||
return <CircleCheck aria-hidden className={cn(base, 'text-muted-foreground')} />
|
||||
return <CircleCheck aria-hidden className={cn(base, BANNER_TONE.info.icon)} />
|
||||
}
|
||||
}
|
||||
|
||||
@@ -200,7 +206,11 @@ export function CloudAgentSignInStrip({
|
||||
}
|
||||
}}
|
||||
className={cn(
|
||||
'grid gap-2.5 border-b border-border bg-card px-3 text-foreground outline-none',
|
||||
// GA-P3t: a severity fill and a 1px bottom border that clear contrast on white panes and
|
||||
// separate the strip from the terminal below it.
|
||||
'grid gap-2.5 border-b px-3 text-foreground outline-none',
|
||||
BANNER_TONE[stripSeverity(model.status)].surface,
|
||||
BANNER_TONE[stripSeverity(model.status)].border,
|
||||
wraps ? 'min-h-14 items-start py-2.5 [&>svg]:mt-0.5' : 'h-14 items-center',
|
||||
setupCode ? 'grid-cols-[16px_minmax(0,1fr)_auto]' : GRID[width]
|
||||
)}
|
||||
@@ -221,7 +231,8 @@ export function CloudAgentSignInStrip({
|
||||
id={detailId}
|
||||
className={cn(
|
||||
lineFit,
|
||||
'text-xs leading-4 text-muted-foreground',
|
||||
'text-xs leading-4',
|
||||
BANNER_BODY_TEXT,
|
||||
quietDetail && 'sr-only'
|
||||
)}
|
||||
>
|
||||
|
||||
@@ -13,6 +13,8 @@ import {
|
||||
} from 'lucide-react'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useTranslate } from '@/i18n/use-translate'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { BANNER_BODY_TEXT, BANNER_TONE } from '@/components/ui/banner-tone'
|
||||
import type { CloudOomEvent } from '../../../../shared/hosted-sandbox/cloud-workspace-api'
|
||||
|
||||
export type CloudNoticeKind = { kind: 'unresponsive' } | { kind: 'oom'; oom: CloudOomEvent }
|
||||
@@ -43,20 +45,26 @@ function CloudNoticeCard({
|
||||
}): React.JSX.Element {
|
||||
const t = useTranslate()
|
||||
const titleId = useId()
|
||||
// GA-P3t: trouble now reads as a warning; news from a background check as info.
|
||||
const tone = BANNER_TONE[role === 'alert' ? 'warning' : 'info']
|
||||
return (
|
||||
<div
|
||||
role={role}
|
||||
aria-labelledby={titleId}
|
||||
data-cloud-notice={noticeKind}
|
||||
className="pointer-events-auto flex w-[22rem] max-w-[calc(100%-1.5rem)] items-start gap-3 rounded-lg border border-border bg-card p-3 text-card-foreground shadow-[0_8px_24px_rgba(0,0,0,0.12)] dark:shadow-[0_8px_24px_rgba(0,0,0,0.4)] motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-top-1"
|
||||
className={cn(
|
||||
'pointer-events-auto flex w-[22rem] max-w-[calc(100%-1.5rem)] items-start gap-3 rounded-lg border p-3 text-card-foreground shadow-[0_8px_24px_rgba(0,0,0,0.12)] dark:shadow-[0_8px_24px_rgba(0,0,0,0.4)] motion-safe:animate-in motion-safe:fade-in-0 motion-safe:slide-in-from-top-1',
|
||||
tone.surface,
|
||||
tone.border
|
||||
)}
|
||||
>
|
||||
<Icon className="mt-0.5 size-4 shrink-0 text-status-warning-text" aria-hidden="true" />
|
||||
<Icon className={cn('mt-0.5 size-4 shrink-0', tone.icon)} aria-hidden="true" />
|
||||
<div className="min-w-0 flex-1 space-y-2">
|
||||
<div className="space-y-0.5">
|
||||
<div id={titleId} className="text-sm font-medium leading-5">
|
||||
{title}
|
||||
</div>
|
||||
<p className="text-xs text-muted-foreground">{detail}</p>
|
||||
<p className={cn('text-xs', BANNER_BODY_TEXT)}>{detail}</p>
|
||||
</div>
|
||||
{action}
|
||||
</div>
|
||||
|
||||
@@ -4,6 +4,8 @@ import { useAppStore } from '@/store'
|
||||
import { useTranslate } from '@/i18n/use-translate'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { Textarea } from '@/components/ui/textarea'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { BANNER_BODY_TEXT, BANNER_TONE } from '@/components/ui/banner-tone'
|
||||
import {
|
||||
canQueueVmCreationPrompt,
|
||||
queueVmCreationPrompt,
|
||||
@@ -182,15 +184,28 @@ export function OrcaCloudQueuedPromptView({
|
||||
|
||||
return (
|
||||
<div
|
||||
className="flex items-start gap-2 rounded-md border border-border/60 bg-muted/30 px-3 py-2"
|
||||
// GA-P3t: a held prompt waits on the agent's setup (warning); a queued one is info.
|
||||
className={cn(
|
||||
'flex items-start gap-2 rounded-md border px-3 py-2',
|
||||
BANNER_TONE[held ? 'warning' : 'info'].surface,
|
||||
BANNER_TONE[held ? 'warning' : 'info'].border
|
||||
)}
|
||||
data-orca-cloud-queued-prompt="queued"
|
||||
>
|
||||
<Clock3 className="mt-0.5 size-3.5 shrink-0 text-muted-foreground" aria-hidden="true" />
|
||||
<Clock3
|
||||
className={cn('mt-0.5 size-3.5 shrink-0', BANNER_TONE[held ? 'warning' : 'info'].icon)}
|
||||
aria-hidden="true"
|
||||
/>
|
||||
<div className="min-w-0 flex-1">
|
||||
<p className="text-xs font-medium text-foreground">
|
||||
{queuedTitle(t, agentName, { held, editable, draft: isDraftDelivery })}
|
||||
</p>
|
||||
<p className="mt-0.5 line-clamp-3 text-xs whitespace-pre-wrap break-words text-muted-foreground">
|
||||
<p
|
||||
className={cn(
|
||||
'mt-0.5 line-clamp-3 text-xs whitespace-pre-wrap break-words',
|
||||
BANNER_BODY_TEXT
|
||||
)}
|
||||
>
|
||||
{prompt}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -15,6 +15,7 @@ import { toast } from 'sonner'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useTranslate } from '@/i18n/use-translate'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { BANNER_BODY_TEXT, BANNER_TONE } from '@/components/ui/banner-tone'
|
||||
import { useAppStore } from '@/store'
|
||||
|
||||
export type CloudToastPriority = 'action' | 'warning' | 'info'
|
||||
@@ -339,7 +340,12 @@ export function CloudToastCard({
|
||||
aria-hidden={quiet || undefined}
|
||||
aria-label={!single ? view.label : undefined}
|
||||
role={single ? undefined : 'group'}
|
||||
className="w-[var(--width,356px)] max-w-full rounded-lg border border-border bg-card font-sans text-card-foreground shadow-[0_8px_24px_rgba(0,0,0,0.12)] dark:shadow-[0_8px_24px_rgba(0,0,0,0.4)]"
|
||||
// GA-P3t: the severity look, so a notice never blends into a white pane under it.
|
||||
className={cn(
|
||||
'w-[var(--width,356px)] max-w-full rounded-lg border font-sans text-card-foreground shadow-[0_8px_24px_rgba(0,0,0,0.12)] dark:shadow-[0_8px_24px_rgba(0,0,0,0.4)]',
|
||||
BANNER_TONE[warning ? 'warning' : 'info'].surface,
|
||||
BANNER_TONE[warning ? 'warning' : 'info'].border
|
||||
)}
|
||||
>
|
||||
<ul className="divide-y divide-border">
|
||||
{view.lines.map((line) => (
|
||||
@@ -347,7 +353,7 @@ export function CloudToastCard({
|
||||
{warning ? (
|
||||
<TriangleAlert
|
||||
aria-hidden
|
||||
className="mt-0.5 size-3.5 shrink-0 text-status-warning-text"
|
||||
className={cn('mt-0.5 size-3.5 shrink-0', BANNER_TONE.warning.icon)}
|
||||
/>
|
||||
) : null}
|
||||
{/* The sentence reads first; its one action sits under it so neither gets squeezed. */}
|
||||
@@ -355,7 +361,7 @@ export function CloudToastCard({
|
||||
<div className="space-y-0.5">
|
||||
<p className="text-xs leading-5 text-foreground">{line.text}</p>
|
||||
{line.description ? (
|
||||
<p className="text-xs text-muted-foreground">{line.description}</p>
|
||||
<p className={cn('text-xs', BANNER_BODY_TEXT)}>{line.description}</p>
|
||||
) : null}
|
||||
</div>
|
||||
{line.action ? (
|
||||
|
||||
+7
-6
@@ -1,6 +1,7 @@
|
||||
import { useEffect, useLayoutEffect, useRef } from 'react'
|
||||
import { TriangleAlert, type LucideIcon } from 'lucide-react'
|
||||
import { cn } from '@/lib/utils'
|
||||
import { BANNER_BODY_TEXT, BANNER_TONE } from '@/components/ui/banner-tone'
|
||||
import { Badge } from '@/components/ui/badge'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { useTranslate } from '@/i18n/use-translate'
|
||||
@@ -63,14 +64,14 @@ export function PaneBannerLearnMore({ onClick }: { onClick: () => void }): React
|
||||
type PaneTopBannerTone = 'warning' | 'neutral' | 'accent'
|
||||
|
||||
const TONE_CLASSES: Record<PaneTopBannerTone, { stripClass: string; iconClass: string }> = {
|
||||
// GA-P3t: the shared banner severity look (fills and borders that hold up on white panes).
|
||||
warning: {
|
||||
stripClass:
|
||||
'border-status-warning-border bg-background bg-[linear-gradient(var(--status-warning-background),var(--status-warning-background))]',
|
||||
iconClass: 'text-status-warning'
|
||||
stripClass: cn(BANNER_TONE.warning.surface, BANNER_TONE.warning.border),
|
||||
iconClass: BANNER_TONE.warning.icon
|
||||
},
|
||||
neutral: {
|
||||
stripClass: 'border-border bg-card',
|
||||
iconClass: 'text-muted-foreground'
|
||||
stripClass: cn(BANNER_TONE.info.surface, BANNER_TONE.info.border),
|
||||
iconClass: BANNER_TONE.info.icon
|
||||
},
|
||||
accent: {
|
||||
stripClass:
|
||||
@@ -139,7 +140,7 @@ export function PaneTopWarningBanner({
|
||||
) : null}
|
||||
{title}
|
||||
</p>
|
||||
{body ? <p className="text-muted-foreground">{body}</p> : null}
|
||||
{body ? <p className={BANNER_BODY_TEXT}>{body}</p> : null}
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
|
||||
@@ -0,0 +1,157 @@
|
||||
// GA-P3t (Neil): every strip, banner and notice variant on the surfaces it sits on, so the contrast
|
||||
// rule is checked in one place. Light default (#fff, the app background), light on #fafafa (sidebar
|
||||
// and lighter surfaces), and dark via --theme both.
|
||||
import React from 'react'
|
||||
import { defineFixture } from '../../component-fixtures/component-fixture'
|
||||
import { CloudAgentSignInStrip } from '../agent-sign-in-strip/CloudAgentSignInStrip'
|
||||
import type {
|
||||
CloudStripModel,
|
||||
CloudStripStatus
|
||||
} from '../agent-sign-in-strip/cloud-agent-strip-model'
|
||||
import { PaneTopWarningBanner } from '../terminal-pane/appearance/pane-top-banner/PaneTopWarningBanner'
|
||||
import { CloudWorkspaceNotice, CloudVersionSkewNotice } from '../orca-cloud/CloudWorkspaceNotice'
|
||||
import { CloudToastCard } from '../orca-cloud/cloud-toast-stack'
|
||||
import { OrcaCloudQueuedPromptView } from '../orca-cloud/OrcaCloudQueuedPrompt'
|
||||
import { Button } from './button'
|
||||
|
||||
const noop = (): void => {}
|
||||
const ACTIONS = {
|
||||
primary: noop,
|
||||
submitCode: noop,
|
||||
pasteCode: noop,
|
||||
useCode: noop,
|
||||
useApiKey: noop,
|
||||
cancel: noop
|
||||
}
|
||||
|
||||
function stripModel(status: CloudStripStatus, title: string, detail: string): CloudStripModel {
|
||||
return {
|
||||
status,
|
||||
title,
|
||||
detail,
|
||||
description: null,
|
||||
primary: {
|
||||
label: status === 'warning' ? 'Renew' : 'Set up once',
|
||||
action: { kind: 'setUpOnce' }
|
||||
},
|
||||
code: null,
|
||||
paste: null,
|
||||
otherWays: false,
|
||||
announcement: title
|
||||
}
|
||||
}
|
||||
|
||||
const STRIPS: [CloudStripStatus, string, string][] = [
|
||||
['warning', 'Your Claude sign-in expired', 'Renew to keep working. Your conversation is kept.'],
|
||||
['setup', 'Claude isn’t set up for Orca Cloud', 'Set up once. Every cloud workspace uses it.'],
|
||||
['error', 'Couldn’t restart Claude', 'Try again. Your conversation is kept.'],
|
||||
['busy', 'Restarting…', 'Your files are kept, and Orca resumes your agents once it is back.']
|
||||
]
|
||||
|
||||
function Variants(): React.JSX.Element {
|
||||
return (
|
||||
<div className="flex flex-col gap-3">
|
||||
{STRIPS.map(([status, title, detail]) => (
|
||||
<div key={status} className="relative" data-banner-variant={`strip-${status}`}>
|
||||
<CloudAgentSignInStrip
|
||||
model={stripModel(status, title, detail)}
|
||||
prompt={null}
|
||||
actions={ACTIONS}
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
<div className="relative [&_.pane-top-banner]:!static" data-banner-variant="pane-warning">
|
||||
<PaneTopWarningBanner
|
||||
title="Orca woke this workspace"
|
||||
body="2 processes were running before it slept."
|
||||
primaryAction={<Button size="xs">Show</Button>}
|
||||
onDismiss={noop}
|
||||
/>
|
||||
</div>
|
||||
<div className="relative [&_.pane-top-banner]:!static" data-banner-variant="pane-neutral">
|
||||
<PaneTopWarningBanner
|
||||
tone="neutral"
|
||||
title="This pane runs on Dev server"
|
||||
body="Its terminal history stays there."
|
||||
primaryAction={<Button size="xs">Open</Button>}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex gap-3">
|
||||
<CloudWorkspaceNotice
|
||||
notice={{ kind: 'unresponsive' }}
|
||||
restarting={false}
|
||||
onRestart={noop}
|
||||
/>
|
||||
<CloudVersionSkewNotice
|
||||
direction="desktop-older"
|
||||
onCheckForUpdates={noop}
|
||||
onCreateWorkspace={noop}
|
||||
onDismiss={noop}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex gap-3">
|
||||
<CloudToastCard
|
||||
view={{
|
||||
priority: 'warning',
|
||||
lines: [
|
||||
{
|
||||
key: 'push',
|
||||
text: 'Orca Cloud can read octocat/Hello-World but can’t push yet.',
|
||||
description: 'Install the Orca GitHub App on octocat to push.'
|
||||
}
|
||||
]
|
||||
}}
|
||||
onDismiss={noop}
|
||||
/>
|
||||
<CloudToastCard
|
||||
view={{
|
||||
priority: 'info',
|
||||
lines: [
|
||||
{ key: 'env', text: 'Environment checked', description: 'Node 24 and pnpm ready.' }
|
||||
]
|
||||
}}
|
||||
onDismiss={noop}
|
||||
/>
|
||||
</div>
|
||||
<div className="flex gap-3">
|
||||
<div className="w-80">
|
||||
<OrcaCloudQueuedPromptView
|
||||
agentName="Claude"
|
||||
prompt="Fix the flaky login test"
|
||||
editable={false}
|
||||
held
|
||||
onQueue={noop}
|
||||
/>
|
||||
</div>
|
||||
<div className="w-80">
|
||||
<OrcaCloudQueuedPromptView
|
||||
agentName="Claude"
|
||||
prompt="Fix the flaky login test"
|
||||
editable
|
||||
onQueue={noop}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
/** On the app background (#fff in light: the default and a white pane are the same surface). */
|
||||
export const onBackground = defineFixture({
|
||||
width: 900,
|
||||
render: () => (
|
||||
<div className="bg-background p-4">
|
||||
<Variants />
|
||||
</div>
|
||||
)
|
||||
})
|
||||
|
||||
/** On the lighter-grey surfaces (#fafafa: sidebar, cards); the worst case for fills. */
|
||||
export const onLightGrey = defineFixture({
|
||||
width: 900,
|
||||
render: () => (
|
||||
<div className="bg-[#fafafa] p-4 dark:bg-card">
|
||||
<Variants />
|
||||
</div>
|
||||
)
|
||||
})
|
||||
@@ -0,0 +1,27 @@
|
||||
// GA-P3t (Neil): one look for strips, banners and notices by severity, so none blends into a white
|
||||
// pane. The colours live in main.css (--banner-*), measured for contrast in light and dark.
|
||||
export type BannerSeverity = 'warning' | 'error' | 'info'
|
||||
|
||||
export const BANNER_TONE: Record<
|
||||
BannerSeverity,
|
||||
{ surface: string; border: string; icon: string }
|
||||
> = {
|
||||
warning: {
|
||||
surface: 'bg-banner-warning-fill',
|
||||
border: 'border-banner-warning-border',
|
||||
icon: 'text-banner-warning-icon'
|
||||
},
|
||||
error: {
|
||||
surface: 'bg-banner-error-fill',
|
||||
border: 'border-banner-error-border',
|
||||
icon: 'text-banner-error-icon'
|
||||
},
|
||||
info: {
|
||||
surface: 'bg-banner-info-fill',
|
||||
border: 'border-banner-info-border',
|
||||
icon: 'text-banner-info-icon'
|
||||
}
|
||||
}
|
||||
|
||||
/** Body and detail text inside a banner: darker than muted, so it clears 4.5:1 on any fill. */
|
||||
export const BANNER_BODY_TEXT = 'text-banner-body'
|
||||
Reference in New Issue
Block a user