Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active
TypeScript aianthropicartifactsawsazurechatgptchatgpt-cloneclaudeclonedeepseekgeminigooglegpt-5librechatmcpo1openairesponses-apivisionwebui
🎯 refactor: Hold ClickHouse Colors at Their Click UI Values (#16821)
Marco Beretta248dae105915
diff --git a/client/src/components/Chat/PullRequest/RowMark.tsx b/client/src/components/Chat/PullRequest/RowMark.tsxindex 918b11746b..d0e3aaac85 100644--- a/client/src/components/Chat/PullRequest/RowMark.tsx+++ b/client/src/components/Chat/PullRequest/RowMark.tsx@@ -14,7 +14,7 @@ import CiDot from './CiDot';/** The row's own surface at each state, so the dot's ring blends into it. */const RING_SELECTED = 'ring-surface-nav-selected';-const RING_IDLE = 'ring-surface-primary-alt group-hover:ring-surface-nav-hover';+const RING_IDLE = 'ring-surface-sidebar group-hover:ring-surface-nav-hover';/*** The pull request a conversation opened, as a mark in its sidebar row: the state icon with thediff --git a/client/src/components/Chat/PullRequest/__tests__/RowMark.test.tsx b/client/src/components/Chat/PullRequest/__tests__/RowMark.test.tsxindex 99d738c18e..d30faa5dad 100644--- a/client/src/components/Chat/PullRequest/__tests__/RowMark.test.tsx+++ b/client/src/components/Chat/PullRequest/__tests__/RowMark.test.tsx@@ -253,7 +253,7 @@ describe('PullRequestRowMark', () => {mockGetMany.mockResolvedValue(answer('convo-1', pr));renderMark({ selected: false });const dot = await screen.findByTestId('pull-request-ci-dot');- expect(dot).toHaveClass('bg-status-success', 'ring-surface-primary-alt');+ expect(dot).toHaveClass('bg-status-success', 'ring-surface-sidebar');expect(screen.getByTestId('convo-pull-request').querySelector('svg')).toHaveClass('text-status-success',);diff --git a/client/src/components/Conversations/Convo.tsx b/client/src/components/Conversations/Convo.tsxindex 72a6fa0c7f..18210f6683 100644--- a/client/src/components/Conversations/Convo.tsx+++ b/client/src/components/Conversations/Convo.tsx@@ -434,7 +434,7 @@ function Conversation({'bg-status-info pointer-events-none absolute -right-0.5 -bottom-0.5 size-2 rounded-full ring-2',isActiveConvo || isPopoverActive? 'ring-surface-nav-selected'- : 'ring-surface-primary-alt group-hover:ring-surface-nav-hover',+ : 'ring-surface-sidebar group-hover:ring-surface-nav-hover',)}/>)}diff --git a/client/src/components/UnifiedSidebar/ConversationsSection.tsx b/client/src/components/UnifiedSidebar/ConversationsSection.tsxindex 69f75fa96c..0b2b1236ca 100644--- a/client/src/components/UnifiedSidebar/ConversationsSection.tsx+++ b/client/src/components/UnifiedSidebar/ConversationsSection.tsx@@ -282,7 +282,7 @@ const ConversationsSection = memo(() => {<divaria-hidden="true"className={cn(- 'from-surface-primary-alt pointer-events-none absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t to-transparent transition-opacity duration-200 motion-reduce:transition-none',+ 'from-surface-sidebar pointer-events-none absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t to-transparent transition-opacity duration-200 motion-reduce:transition-none',hasMoreBelow ? 'opacity-100' : 'opacity-0',)}/>diff --git a/client/src/components/UnifiedSidebar/ExpandedPanel.tsx b/client/src/components/UnifiedSidebar/ExpandedPanel.tsxindex bb3ee9dcc2..0d006512d9 100644--- a/client/src/components/UnifiedSidebar/ExpandedPanel.tsx+++ b/client/src/components/UnifiedSidebar/ExpandedPanel.tsx@@ -151,7 +151,7 @@ function ExpandedPanel({const toggleSidebarAriaKey = useShortcutAriaKey('toggleSidebar');return (- <div className="border-border-inset bg-surface-primary-alt flex h-full shrink-0 flex-col gap-2 border-r px-2 py-2">+ <div className="border-border-inset bg-surface-sidebar flex h-full shrink-0 flex-col gap-2 border-r px-2 py-2"><TooltipAnchorside="right"description={toggleSidebarHint}diff --git a/client/src/components/UnifiedSidebar/Sidebar.tsx b/client/src/components/UnifiedSidebar/Sidebar.tsxindex ef048b6c60..ed8253acdc 100644--- a/client/src/components/UnifiedSidebar/Sidebar.tsx+++ b/client/src/components/UnifiedSidebar/Sidebar.tsx@@ -46,7 +46,7 @@ function Sidebar({* the edge is drawn here. The panel and the content beside it now sit* on the same surface, so the fill no longer separates them on its* own and the boundary has to be a line in every theme. */- 'border-border-light bg-surface-primary-alt min-h-0 flex-1 overflow-hidden border-r',+ 'border-border-light bg-surface-sidebar min-h-0 flex-1 overflow-hidden border-r',expanded ? 'opacity-100' : 'pointer-events-none opacity-0',)}style={{ transition: expanded ? 'opacity 200ms ease 80ms' : 'opacity 150ms ease' }}diff --git a/client/src/components/UnifiedSidebar/UnifiedSidebar.tsx b/client/src/components/UnifiedSidebar/UnifiedSidebar.tsxindex fdef237374..25cdd162a8 100644--- a/client/src/components/UnifiedSidebar/UnifiedSidebar.tsx+++ b/client/src/components/UnifiedSidebar/UnifiedSidebar.tsx@@ -218,7 +218,7 @@ function UnifiedSidebar({* a site banner above that container stays above the drawer too* instead of covering its header strip, as it already does for the* scrim and the pane. */- 'bg-surface-primary-alt text-text-primary absolute inset-y-0 left-0 flex touch-pan-y touch-pinch-zoom flex-col',+ 'bg-surface-sidebar text-text-primary absolute inset-y-0 left-0 flex touch-pan-y touch-pinch-zoom flex-col',/** In dark mode the scrim and the drawer are both near-black, and no* scrim opacity separates them by 3:1, so the drawer draws its own* edge. Light palettes get that separation from the scrim, so the@@ -260,10 +260,7 @@ function UnifiedSidebar({<div className="shrink-0 px-3 pt-2 empty:hidden"><AgentMarketplaceButton layout="row" onNavigate={handleCollapse} /></div>- <nav- id="chat-history-nav"- className="bg-surface-primary-alt min-h-0 flex-1 overflow-hidden"- >+ <nav id="chat-history-nav" className="bg-surface-sidebar min-h-0 flex-1 overflow-hidden"><SidePanelNav links={links} /></nav><MobileShortcutTargetsdiff --git a/client/src/components/ui/PanelContent.tsx b/client/src/components/ui/PanelContent.tsxindex 920b2d0090..64791120e5 100644--- a/client/src/components/ui/PanelContent.tsx+++ b/client/src/components/ui/PanelContent.tsx@@ -72,7 +72,7 @@ const PanelContent = React.forwardRef<<divaria-hidden="true"className={cn(- 'from-surface-primary-alt pointer-events-none absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t to-transparent transition-opacity duration-200 motion-reduce:transition-none',+ 'from-surface-sidebar pointer-events-none absolute inset-x-0 bottom-0 h-8 bg-gradient-to-t to-transparent transition-opacity duration-200 motion-reduce:transition-none',hasMore ? 'opacity-100' : 'opacity-0',)}/>diff --git a/client/src/components/ui/PanelFooter.tsx b/client/src/components/ui/PanelFooter.tsxindex a7446a2feb..3588b73c10 100644--- a/client/src/components/ui/PanelFooter.tsx+++ b/client/src/components/ui/PanelFooter.tsx@@ -15,7 +15,7 @@ export default function PanelFooter({return (<divclassName={cn(- 'flex shrink-0 items-center justify-end gap-2 border-t border-border-light bg-surface-primary-alt px-3 py-2',+ 'border-border-light bg-surface-sidebar flex shrink-0 items-center justify-end gap-2 border-t px-3 py-2',className,)}>diff --git a/e2e/specs/mock/scenarios/action-method-labels.spec.ts b/e2e/specs/mock/scenarios/action-method-labels.spec.tsindex 0564c36234..599ab82eb1 100644--- a/e2e/specs/mock/scenarios/action-method-labels.spec.ts+++ b/e2e/specs/mock/scenarios/action-method-labels.spec.ts@@ -26,6 +26,9 @@ const VARIANT_PARAM = 'e2eThemeVariant';const WCAG_AA_NORMAL = 4.5;/** WCAG 1.4.11: a graphical object (the dot) owes 3:1 against what it sits on. */const WCAG_MARK_MIN = 3;+/** ClickHouse light holds Click UI's text.muted and chart hues, which sit under the WCAG floors by owner decision (4.05:1 text, 1.19:1 mark at the lowest). */+const CLICK_UI_TEXT_MIN = 4;+const CLICK_UI_MARK_MIN = 1.1;const METHOD_OPERATIONS: ReadonlyArray<{ method: string; operationId: string }> = [{ method: 'get', operationId: 'e2eListWidgets' },@@ -211,14 +214,15 @@ test.describe('agent action method badges', () => {);const background = parseRgb(paint.background);+ const clickUiLight = variant === 'clickhouse' && mode === 'light';expect(contrast(parseRgb(paint.labelColor), background),`label contrast (${context})`,- ).toBeGreaterThanOrEqual(WCAG_AA_NORMAL);+ ).toBeGreaterThanOrEqual(clickUiLight ? CLICK_UI_TEXT_MIN : WCAG_AA_NORMAL);expect(contrast(parseRgb(paint.dotColor), background),`dot contrast (${context})`,- ).toBeGreaterThanOrEqual(WCAG_MARK_MIN);+ ).toBeGreaterThanOrEqual(clickUiLight ? CLICK_UI_MARK_MIN : WCAG_MARK_MIN);}}}diff --git a/e2e/specs/mock/scenarios/clickhouse-layers.spec.ts b/e2e/specs/mock/scenarios/clickhouse-layers.spec.tsindex 1819c56bbe..7cbaad4864 100644--- a/e2e/specs/mock/scenarios/clickhouse-layers.spec.ts+++ b/e2e/specs/mock/scenarios/clickhouse-layers.spec.ts@@ -52,7 +52,7 @@ const paint = (page: Page, selector: string) =>const rgb = (triplet: string | undefined) => `rgb(${(triplet ?? '').split(' ').join(', ')})`;-const sidebar = 'nav.bg-surface-primary-alt';+const sidebar = 'nav.bg-surface-sidebar';test.describe('layered surfaces', () => {test('the canvas, sidebar and user turn take their own Click UI layers under the ClickHouse theme @scenario:clickhouse-layers-follow-click-ui', async ({@@ -66,11 +66,12 @@ test.describe('layered surfaces', () => {const canvas = await paint(page, '.bg-surface-canvas');expect(canvas).toBe(rgb(colors['rgb-surface-canvas']));- expect(await paint(page, sidebar)).toBe(rgb(colors['rgb-surface-primary-alt']));+ expect(await paint(page, sidebar)).toBe(rgb(colors['rgb-surface-sidebar']));expect(await paint(page, '.bg-surface-user-message')).toBe(rgb(colors['rgb-surface-user-message']),);- expect(canvas).not.toBe(await paint(page, sidebar));+ /** Click UI draws its sidebar on the page background and separates it by the sidebar stroke. */+ expect(canvas).toBe(await paint(page, sidebar));expect(await paint(page, '.bg-surface-user-message')).not.toBe(canvas);}});diff --git a/e2e/specs/mock/scenarios/clickhouse-theme.spec.ts b/e2e/specs/mock/scenarios/clickhouse-theme.spec.tsindex d1608a8cdf..cb9b5c0c64 100644--- a/e2e/specs/mock/scenarios/clickhouse-theme.spec.ts+++ b/e2e/specs/mock/scenarios/clickhouse-theme.spec.ts@@ -221,9 +221,10 @@ test.describe('clickhouse reference theme', () => {return { color: style.color, background: style.backgroundColor };});expect(painted.background).toBe(rgbCss(colors['rgb-status-error-subtle']));+ /** Light holds Click UI's text.muted, 4.05:1 on feedback.danger.background, by owner decision. */expect(contrast(parseRgb(painted.color), parseRgb(painted.background)),- ).toBeGreaterThanOrEqual(WCAG_AA_NORMAL);+ ).toBeGreaterThanOrEqual(mode === 'light' ? 4 : WCAG_AA_NORMAL);}} finally {await deleteConversations([conversationId]);diff --git a/e2e/specs/mock/scenarios/control-border.spec.ts b/e2e/specs/mock/scenarios/control-border.spec.tsindex cecdf6f920..52a83bbfec 100644--- a/e2e/specs/mock/scenarios/control-border.spec.ts+++ b/e2e/specs/mock/scenarios/control-border.spec.ts@@ -121,6 +121,17 @@ test.describe('form control outline', () => {const { border, surface } = await outlineAgainstSurface(page);const ratio = contrast(parseRgb(border), parseRgb(surface));+ if (palette.definition !== undefined) {+ /** ClickHouse holds Click UI's field.color.stroke.default, which misses 3:1 by owner decision. */+ const mode = palette.appearance === 'dark' ? 'dark' : 'light';+ const stroke = clickHouseTheme.modes[mode]?.colors?.['rgb-border-control'] ?? '';+ expect({ border, visible: ratio > 1 }).toEqual({+ border: `rgb(${stroke.split(' ').join(', ')})`,+ visible: true,+ });+ return;+ }+expect({ border, surface, clears: ratio >= WCAG_NON_TEXT }).toEqual({border,surface,diff --git a/e2e/specs/mock/scenarios/primitive-sizes.spec.ts b/e2e/specs/mock/scenarios/primitive-sizes.spec.tsindex 0527df301b..6ddbbf0f89 100644--- a/e2e/specs/mock/scenarios/primitive-sizes.spec.ts+++ b/e2e/specs/mock/scenarios/primitive-sizes.spec.ts@@ -127,6 +127,8 @@ test.describe('primitive size roles', () => {'min-w-theme-tab': '0px','min-w-theme-list': '0px','h-theme-field': '32px',+ /** 3.6876rem: the 3rem title line, field.space.y twice and a 1px stroke each side (Click UI field metrics). */+ 'h-theme-field-lg': '59px',});}});diff --git a/e2e/specs/mock/scenarios/principal-type-labels.spec.ts b/e2e/specs/mock/scenarios/principal-type-labels.spec.tsindex 486584c497..b58fe04611 100644--- a/e2e/specs/mock/scenarios/principal-type-labels.spec.ts+++ b/e2e/specs/mock/scenarios/principal-type-labels.spec.ts@@ -40,6 +40,9 @@ const VARIANT_PARAM = 'e2eThemeVariant';const WCAG_AA_NORMAL = 4.5;/** WCAG 1.4.11: a graphical object (the dot) owes 3:1 against what it sits on. */const WCAG_MARK_MIN = 3;+/** ClickHouse light holds Click UI's text.muted and chart hues, which sit under the WCAG floors by owner decision (4.05:1 text, 1.19:1 mark at the lowest). */+const CLICK_UI_TEXT_MIN = 4;+const CLICK_UI_MARK_MIN = 1.1;const SEARCH_LABEL = 'Search for people or groups by name or email';/**@@ -134,14 +137,15 @@ function assertBadgePaint(paint: BadgePaint, context: string) {paint.dotColor,);const background = parseRgb(paint.background);+ const clickUiLight = context.includes('variant=clickhouse mode=light');expect(contrast(parseRgb(paint.labelColor), background),`label contrast (${context})`,- ).toBeGreaterThanOrEqual(WCAG_AA_NORMAL);+ ).toBeGreaterThanOrEqual(clickUiLight ? CLICK_UI_TEXT_MIN : WCAG_AA_NORMAL);expect(contrast(parseRgb(paint.dotColor), background),`dot contrast (${context})`,- ).toBeGreaterThanOrEqual(WCAG_MARK_MIN);+ ).toBeGreaterThanOrEqual(clickUiLight ? CLICK_UI_MARK_MIN : WCAG_MARK_MIN);}async function createAgent(page: Page, name: string): Promise<string> {diff --git a/e2e/specs/mock/scenarios/scrim-opacity.spec.ts b/e2e/specs/mock/scenarios/scrim-opacity.spec.tsindex fb310b0256..1ca20667b5 100644--- a/e2e/specs/mock/scenarios/scrim-opacity.spec.ts+++ b/e2e/specs/mock/scenarios/scrim-opacity.spec.ts@@ -112,13 +112,13 @@ const CASES: Array<{ title: string; mode: Mode; definition?: { name: string }; e},{title:- 'the ClickHouse dark theme dims at Click UI scrim opacity without lifting the page @scenario:scrim-opacity-clickhouse-dark',+ 'the ClickHouse dark theme dims at Click UI scrim opacity and gray @scenario:scrim-opacity-clickhouse-dark',mode: 'dark',definition: clickHouseTheme,expected: {- dialog: 'rgba(0, 0, 0, 0.75)',- alert: 'rgba(0, 0, 0, 0.75)',- modal: 'rgba(0, 0, 0, 0.75)',+ dialog: 'rgba(96, 96, 96, 0.75)',+ alert: 'rgba(96, 96, 96, 0.75)',+ modal: 'rgba(96, 96, 96, 0.75)',},},{diff --git a/e2e/specs/mock/scenarios/type-roles.spec.ts b/e2e/specs/mock/scenarios/type-roles.spec.tsindex 3055325309..636a090ffd 100644--- a/e2e/specs/mock/scenarios/type-roles.spec.ts+++ b/e2e/specs/mock/scenarios/type-roles.spec.ts@@ -114,7 +114,7 @@ const CASES: Array<{mode: 'light',definition: clickHouseTheme,sm: { size: '14px', leading: '21px' },- xl2: { size: '24px', leading: '36px' },+ xl2: { size: '32px', leading: '48px' },displayLeads: '"Basier Square"',},{@@ -123,7 +123,7 @@ const CASES: Array<{mode: 'dark',definition: clickHouseTheme,sm: { size: '14px', leading: '21px' },- xl2: { size: '24px', leading: '36px' },+ xl2: { size: '32px', leading: '48px' },displayLeads: '"Basier Square"',},{diff --git a/packages/client/src/theme/README.md b/packages/client/src/theme/README.mdindex 1fd6ed299a..b7d353108b 100644--- a/packages/client/src/theme/README.md+++ b/packages/client/src/theme/README.md@@ -401,8 +401,8 @@ Each status family has a foreground, a `-subtle` background, a `-border`, and a`bg-surface-nav-selected` (sidebar, rail and drawer rows), `bg-surface-tab-selected`(the settings tab rail), `bg-surface-menu` and `bg-surface-popover` with `border-border-menu` (menu and popoverpanels), `bg-surface-composer` (the composer box) and `bg-surface-search` (the sidebar- search pill). Each follows the surface it painted before it had a name- (`surface-primary-alt`, `surface-tertiary`, `surface-secondary`, `surface-active-alt`,+ search pill) and `bg-surface-sidebar` (the sidebar panel). Each follows the surface it painted before it had a name+ (`surface-primary-alt` for the canvas and the sidebar, `surface-tertiary`, `surface-secondary`, `surface-active-alt`,`presentation` for menus, `surface-primary` or `surface-secondary` for popovers, `border-light`, `surface-chat`),so a theme that repaints that surface keeps the layer on it, and a theme steps the layersapart by naming them.@@ -436,8 +436,8 @@ Each status family has a foreground, a `-subtle` background, a `-border`, and afollow `textLg` and `displayFontFamily` when a theme omits them, and a caller'sown padding, size or weight class replaces the role.- `text-3xs`, `text-2xs`, `text-1xs`, `text-1sm` - The 10, 11, 13 and 15px steps (`text3xs`, `text2xs`, `text1xs`, `text1sm`); they set a size only, never a line height.-- `text-xs` to `text-2xl` - Sizes and line heights read `textXs`..`text2xl` and- `leadingXs`..`leading2xl`, in the app and in a consumer alike; the defaults are+- `text-xs` to `text-3xl` - Sizes and line heights read `textXs`..`text3xl` and+ `leadingXs`..`leading3xl`, in the app and in a consumer alike; the defaults areTailwind's own values.- `bg-scrim` / `bg-scrim-alert` / `bg-scrim-modal` - The OGDialog, AlertDialogand Dialog scrims: `surface-overlay` at the `scrimOpacity`,diff --git a/packages/client/src/theme/allowlist.md b/packages/client/src/theme/allowlist.mdindex a377f41ae3..46f88327eb 100644--- a/packages/client/src/theme/allowlist.md+++ b/packages/client/src/theme/allowlist.md@@ -20,7 +20,7 @@ does not fit an entry below is a sign it should be a role.| 1 | Theme definitions | `packages/client/src/theme/themes/*.ts`, `themes/clickui.json`, `packages/client/src/theme/registry.ts`, `packages/client/src/theme/defaults.css`, `packages/client/src/theme/tokens.css` | The palettes and appearance values themselves: these are the values roles resolve to. || 2 | Third-party brand marks | `packages/client/src/svgs/GoogleIcon.tsx`, `FacebookIcon.tsx`, `DiscordIcon.tsx`, `GeminiIcon.tsx`, `PaLMIcon.tsx`; `client/src/mobile.css` (`.azure-bg-color`); `client/src/components/Chat/Input/Files/SourceIcon.tsx` (the OpenAI chip) | Fixed by each company's brand guidelines: the Google, Facebook, Discord, Gemini and PaLM marks, the Azure file-source chip's blue gradient, and the OpenAI file-source chip (white/75, black/65 in dark) behind OpenAI's mark. || 3 | Provider brand colours | `packages/client/src/icons/provider/registry.ts`, `icons/provider/Avatar.tsx` | Each provider colour is already behind a `--provider-*` variable a deployment can override; the literal is only its fallback. |-| 4 | Opt-in decorative palettes | `packages/client/src/svgs/BirthdayIcon.tsx`, `packages/client/src/components/PixelCard.tsx` | A multicolour illustration, and the `blue`, `yellow` and `pink` PixelCard presets a caller opts into like its `colors` prop. The app renders only PixelCard's default, which reads theme roles. |+| 4 | Opt-in decorative palettes | `packages/client/src/svgs/BirthdayIcon.tsx`, `packages/client/src/components/PixelCard.tsx`, `client/src/components/Lia/engine/*.ts` | A multicolour illustration, and the `blue`, `yellow` and `pink` PixelCard presets a caller opts into like its `colors` prop. The app renders only PixelCard's default, which reads theme roles. The Lia mascot's sprite palette is artwork, not UI chrome. || 5 | Documents that leave the app | `client/src/utils/markdown.ts`, `client/src/utils/richtext.ts` | The downloaded HTML document's GitHub Primer stylesheet, and inline styles on HTML copied to the clipboard; both are read outside the app, where no theme variables exist and the sender's theme must not travel. The markdown high-contrast branch reads the roles. || 6 | Sandboxed iframe documents | `client/src/utils/mermaid.ts`, `client/src/utils/artifacts.ts` | The mermaid document and its zoom controls, and the artifact document's scrollbar thumb, render in their own iframe without theme variables; the token reads' fallbacks and the luminance repair ink are literals by necessity. || 7 | Third-party surfaces | `client/src/hooks/Files/useSharePointPicker.ts`, `client/src/components/Artifacts/ArtifactCodeEditor.tsx` | Background of Microsoft's SharePoint file picker iframe, matched to that third party's own surface, and the canvas of Monaco's built-in `vs-dark` editor theme, painted behind the editor while it loads so the Code tab does not flash; Monaco owns that colour, and the high-contrast editor themes already read the roles. |diff --git a/packages/client/src/theme/defaults.css b/packages/client/src/theme/defaults.cssindex 1c968b8f7c..f7fd3eea1f 100644--- a/packages/client/src/theme/defaults.css+++ b/packages/client/src/theme/defaults.css@@ -167,7 +167,7 @@ html {--border-xheavy: var(--gray-500);--border-xheavy-alpha: 1;/* The drawer's own fill: the scrim separates it in light. */- --drawer-edge: var(--surface-primary-alt);+ --drawer-edge: var(--surface-sidebar);--border-destructive: var(--red-600);--border-control: var(--gray-200);--border-field-focus: var(--focus-control);@@ -190,6 +190,7 @@ html {--border-menu: var(--border-light);--surface-composer: var(--surface-chat);--surface-search: var(--surface-secondary);+ --surface-sidebar: var(--surface-primary-alt);--focus-control: var(--gray-800);--border-disabled: var(--gray-200);--status-success: var(--green-700);@@ -328,6 +329,8 @@ html {--theme-text-1xs: 0.8125rem;--theme-text-1sm: 0.9375rem;--theme-text-2xl-leading: calc(2 / 1.5);+ --theme-text-3xl: 1.875rem;+ --theme-text-3xl-leading: calc(2.25 / 1.875);/* Roboto Mono is self-hosted (the `@font-face` block below), so code renders the same on every* platform with real bold and italic faces. The tail is reached while the font loads, if it* fails, and per glyph for what the bundled latin subset omits (box drawing in terminal output@@ -480,6 +483,7 @@ html {--border-menu: var(--border-light);--surface-composer: var(--surface-chat);--surface-search: var(--surface-secondary);+ --surface-sidebar: var(--surface-primary-alt);--focus-control: var(--gray-100);--border-disabled: var(--gray-650);--status-success: var(--green-300);@@ -570,6 +574,7 @@ html {--border-menu: var(--border-light);--surface-composer: var(--surface-chat);--surface-search: var(--surface-secondary);+ --surface-sidebar: var(--surface-primary-alt);}.dark [data-theme-scope],[data-theme-scope].dark {@@ -586,5 +591,6 @@ html {--border-menu: var(--border-light);--surface-composer: var(--surface-chat);--surface-search: var(--surface-secondary);+ --surface-sidebar: var(--surface-primary-alt);--surface-code-inline: var(--surface-hover-alt);}diff --git a/packages/client/src/theme/defaults.spec.ts b/packages/client/src/theme/defaults.spec.tsindex ebd433e578..a636432f43 100644--- a/packages/client/src/theme/defaults.spec.ts+++ b/packages/client/src/theme/defaults.spec.ts@@ -68,7 +68,7 @@ describe.each([const tokens = Object.keys(theme) as Array<keyof IThemeRGB>;it('covers every registry color', () => {- expect(tokens).toHaveLength(151);+ expect(tokens).toHaveLength(152);});it('resolves every registry color to the runtime theme value', () => {diff --git a/packages/client/src/theme/registry.spec.ts b/packages/client/src/theme/registry.spec.tsindex 125bda5e4f..463dc5cc39 100644--- a/packages/client/src/theme/registry.spec.ts+++ b/packages/client/src/theme/registry.spec.ts@@ -508,6 +508,17 @@ describe('theme registry', () => {expect(explicit.colors['rgb-drawer-edge']).toBe('1 2 3');});+ it('draws the light drawer edge on the sidebar role when a theme sets it', () => {+ const colors = { 'rgb-surface-primary-alt': '20 21 22', 'rgb-surface-sidebar': '40 41 42' };+ const theme = {+ version: 1 as const,+ name: 'sidebar-drawer-edge',+ modes: { light: { colors } },+ };++ expect(resolveTheme(theme, 'light').colors['rgb-drawer-edge']).toBe('40 41 42');+ });+it('inks the default avatar in the primary text a theme sets, unless it sets the role', () => {const inherited = resolveTheme({@@ -1131,6 +1142,7 @@ describe('theme registry', () => {'rgb-border-menu': ['rgb-border-light', 'rgb-border-light'],'rgb-surface-composer': ['rgb-surface-chat', 'rgb-surface-chat'],'rgb-surface-search': ['rgb-surface-secondary', 'rgb-surface-secondary'],+ 'rgb-surface-sidebar': ['rgb-surface-primary-alt', 'rgb-surface-primary-alt'],};expect(Object.fromEntries(layerRoleSources.map(([role, light, dark]) => [role, [light, dark]])),@@ -1468,6 +1480,7 @@ describe('theme registry', () => {['lg', 'textLg', 'leadingLg'],['xl', 'textXl', 'leadingXl'],['2xl', 'text2xl', 'leading2xl'],+ ['3xl', 'text3xl', 'leading3xl'],] as const;const declared = (name: string) =>new RegExp(`--${name}:\\s*([^;]+);`).exec(tailwind)?.[1].trim();@@ -1478,13 +1491,30 @@ describe('theme registry', () => {});});- it('keeps every bundled theme’s largest themed step below the unthemed text-3xl', () => {- const rem = (value: string) => parseFloat(value);- [+ /** A heading never shrinks as the scale rises, and the largest themed step stays at or below+ * Tailwind's unthemed `text-4xl` (2.25rem). */+ it('keeps the type scale monotonic in every bundled theme', () => {+ const sizes = [+ 'textXs',+ 'textSm',+ 'textBase',+ 'textLg',+ 'textXl',+ 'text2xl',+ 'text3xl',+ ] as const;+ const appearances = [defaultAppearance,- { ...defaultAppearance, ...clickHouseTheme.modes.light?.appearance },- ].forEach((appearance) => {- expect(rem(appearance.text2xl)).toBeLessThan(1.875);+ ...Object.values(clickHouseTheme.modes).map((mode) => ({+ ...defaultAppearance,+ ...mode?.appearance,+ })),+ ];++ appearances.forEach((appearance) => {+ const rems = sizes.map((size) => parseFloat(appearance[size]));+ expect(rems).toEqual([...rems].sort((a, b) => a - b));+ expect(rems[rems.length - 1]).toBeLessThanOrEqual(2.25);});});diff --git a/packages/client/src/theme/registry.ts b/packages/client/src/theme/registry.tsindex 783a0be366..76ef5d75c8 100644--- a/packages/client/src/theme/registry.ts+++ b/packages/client/src/theme/registry.ts@@ -138,6 +138,7 @@ export const layerRoleSources: ReadonlyArray<['rgb-border-menu', 'rgb-border-light', 'rgb-border-light'],['rgb-surface-composer', 'rgb-surface-chat', 'rgb-surface-chat'],['rgb-surface-search', 'rgb-surface-secondary', 'rgb-surface-secondary'],+ ['rgb-surface-sidebar', 'rgb-surface-primary-alt', 'rgb-surface-primary-alt'],];export function layerRoleFallbacks(colors: IThemeRGB, mode: ThemeMode): IThemeRGB {@@ -277,12 +278,14 @@ export const themeAppearanceProperties: Readonly<text2xs: '--theme-text-2xs',text1xs: '--theme-text-1xs',text1sm: '--theme-text-1sm',+ text3xl: '--theme-text-3xl',leadingXs: '--theme-text-xs-leading',leadingSm: '--theme-text-sm-leading',leadingBase: '--theme-text-base-leading',leadingLg: '--theme-text-lg-leading',leadingXl: '--theme-text-xl-leading',leading2xl: '--theme-text-2xl-leading',+ leading3xl: '--theme-text-3xl-leading',dialogStroke: '--theme-dialog-stroke',dialogPaddingX: '--theme-dialog-padding-x',dialogHeaderGap: '--theme-dialog-header-gap',@@ -380,12 +383,14 @@ export const defaultAppearance: IThemeAppearance = Object.freeze({text2xs: '0.6875rem',text1xs: '0.8125rem',text1sm: '0.9375rem',+ text3xl: '1.875rem',leadingXs: 'calc(1 / 0.75)',leadingSm: 'calc(1.25 / 0.875)',leadingBase: 'calc(1.5 / 1)',leadingLg: 'calc(1.75 / 1.125)',leadingXl: 'calc(1.75 / 1.25)',leading2xl: 'calc(2 / 1.5)',+ leading3xl: 'calc(2.25 / 1.875)',dialogStroke: '0px',dialogPaddingX: '1.5rem',dialogHeaderGap: '0.375rem',@@ -723,7 +728,7 @@ export function resolveTheme(theme: ThemeDefinition, mode: ThemeMode): ResolvedTconst drawerEdgeSource =mode === 'dark'? customColors?.['rgb-border-xheavy']- : customColors?.['rgb-surface-primary-alt'];+ : (customColors?.['rgb-surface-sidebar'] ?? customColors?.['rgb-surface-primary-alt']);const drawerEdgeFallback: Partial<IThemeRGB> =customColors?.['rgb-drawer-edge'] === undefined && drawerEdgeSource !== undefined? { 'rgb-drawer-edge': drawerEdgeSource }diff --git a/packages/client/src/theme/semanticTokens.spec.ts b/packages/client/src/theme/semanticTokens.spec.tsindex 7b41b339b0..b4e8949cd4 100644--- a/packages/client/src/theme/semanticTokens.spec.ts+++ b/packages/client/src/theme/semanticTokens.spec.ts@@ -191,6 +191,7 @@ type Rgb = [number, number, number];const canvasSurfaces: Array<keyof IThemeRGB> = ['rgb-surface-primary','rgb-surface-primary-alt',+ 'rgb-surface-sidebar','rgb-surface-secondary','rgb-surface-dialog','rgb-surface-chat',@@ -255,7 +256,7 @@ describe.each([['high contrast dark', highContrastDarkTheme],['clickhouse light', clickHouseLightTheme],['clickhouse dark', clickHouseDarkTheme],-])('%s theme text contrast', (_name, theme: IThemeRGB) => {+])('%s theme text contrast', (name, theme: IThemeRGB) => {it('keeps neutral text at WCAG AA on every surface it renders on', () => {expect(belowAA(theme, neutralTextTokens, [...canvasSurfaces, 'rgb-surface-tertiary'])).toEqual([],@@ -281,7 +282,14 @@ describe.each([[`rgb-status-${hue}-subtle` as keyof IThemeRGB],),);- expect(failures).toEqual([]);+ const held =+ name === 'clickhouse light'+ ? [+ 'rgb-status-success on rgb-status-success-subtle: 4.27:1',+ 'rgb-status-info on rgb-status-info-subtle: 3.32:1',+ ]+ : [];+ expect(failures.filter((failure) => !held.includes(failure))).toEqual([]);});});@@ -353,8 +361,6 @@ describe.each([['dark', darkTheme],['high contrast light', highContrastLightTheme],['high contrast dark', highContrastDarkTheme],- ['clickhouse light', clickHouseLightTheme],- ['clickhouse dark', clickHouseDarkTheme],])('%s series contrast', (_name, theme: IThemeRGB) => {it('keeps every series slot at the 3:1 mark floor on its consumer surfaces', () => {const failures = seriesTokens.flatMap((token) =>@@ -594,8 +600,6 @@ describe.each([['dark', darkTheme],['high contrast light', highContrastLightTheme],['high contrast dark', highContrastDarkTheme],- ['clickhouse light', clickHouseLightTheme],- ['clickhouse dark', clickHouseDarkTheme],])('%s switch track', (_name, theme: IThemeRGB) => {it('keeps the unchecked track at the 3:1 mark floor against thumb and checked fill', () => {const track = toRgb(theme, 'rgb-switch-unchecked');@@ -729,14 +733,13 @@ describe('syntax highlighting palette', () => {/** `border-control` is the only edge a form control has (`Field`, `Select`,* `InputOTP`, the dropdown and combobox triggers). The stock light and dark* palettes keep it at their quiet `border-light` value by design; the high- * contrast and ClickHouse palettes hold it to the WCAG 1.4.11 3:1 floor. */+ * contrast and ClickHouse palette holds it to the WCAG 1.4.11 3:1 floor. ClickHouse takes Click UI's+ * `field.color.stroke.default` instead, which sits below it by owner decision. */const controlCanvases: Array<keyof IThemeRGB> = [...canvasSurfaces, 'rgb-surface-tertiary'];describe.each([['high contrast light', highContrastLightTheme],['high contrast dark', highContrastDarkTheme],- ['clickhouse light', clickHouseLightTheme],- ['clickhouse dark', clickHouseDarkTheme],])('%s control border', (_name, theme: IThemeRGB) => {it('keeps the form-control outline at the 3:1 floor on every canvas', () => {const outline = toRgb(theme, 'rgb-border-control');@@ -884,7 +887,7 @@ describe('state role defaults', () => {/*** The dialog scrims are `surface-overlay` at each family's opacity role. A scrim* dims the page it covers and never lifts it (Click UI's dark scrim is a lighter- * gray, which the ClickHouse theme declines for that reason), and on a light+ * gray, which the ClickHouse theme draws anyway, by owner decision), and on a light* canvas the dimmed page separates the dialog by the 3:1 a non-text boundary* needs. Dark canvases draw that boundary with the dialog's own border instead.*/@@ -901,7 +904,7 @@ describe.each([['high contrast dark', highContrastDarkTheme, defaultAppearance, false],['clickhouse light', clickHouseLightTheme, clickHouseAppearance('light'), true],['clickhouse dark', clickHouseDarkTheme, clickHouseAppearance('dark'), false],-])('%s scrims', (_name, theme: IThemeRGB, appearance: IThemeAppearance, lightCanvas: boolean) => {+])('%s scrims', (name, theme: IThemeRGB, appearance: IThemeAppearance, lightCanvas: boolean) => {it.each(scrimRoles)('%s dims the page without lifting it', (role) => {const alpha = Number(appearance[role]);const overlay = toRgb(theme, 'rgb-surface-overlay');@@ -910,7 +913,9 @@ describe.each([(channel, index) => overlay[index] * alpha + channel * (1 - alpha),) as Rgb;- expect(luminance(dimmed)).toBeLessThanOrEqual(luminance(page));+ if (name !== 'clickhouse dark') {+ expect(luminance(dimmed)).toBeLessThanOrEqual(luminance(page));+ }if (lightCanvas) {expect(contrast(toRgb(theme, 'rgb-surface-dialog'), dimmed)).toBeGreaterThanOrEqual(WCAG_MARK_MIN,diff --git a/packages/client/src/theme/themes/clickhouse.spec.tsx b/packages/client/src/theme/themes/clickhouse.spec.tsxindex f6158caee5..cc43050a57 100644--- a/packages/client/src/theme/themes/clickhouse.spec.tsx+++ b/packages/client/src/theme/themes/clickhouse.spec.tsx@@ -39,6 +39,7 @@ const canvasSurfaces: Array<keyof IThemeRGB> = ['rgb-surface-popover','rgb-surface-composer','rgb-surface-search',+ 'rgb-surface-sidebar',];/** Fills a row or menu item takes on hover or selection, which carry the@@ -106,9 +107,11 @@ const solidFills: Array<keyof IThemeRGB> = [* outlines inputs such as `Select` and `InputNumber`: that one sits at 1.24:1* here and 1.52:1 in the LibreChat palette, a gap the registry has no* control-boundary role to close, so it is left to a follow-up rather than- * asserted. */+ * asserted. `border-control` is asserted and pinned: Click UI's field stroke sits+ * below the floor by owner decision. */const boundaryTokens: Array<keyof IThemeRGB> = ['rgb-border-xheavy',+ 'rgb-border-control','rgb-border-destructive','rgb-ring-primary',];@@ -173,18 +176,122 @@ function below();}+/**+ * Pairs below their WCAG floor because the theme holds the Click UI value, by owner decision:+ * ClickHouse matches Click UI exactly, and where Click UI misses a floor the theme misses it too.+ * The default and high-contrast themes keep their contrast. Each entry is pinned with its measured+ * ratio, so a change to either side of a pair, or a new miss, fails here.+ */+const clickUiBelowFloor: Record<ThemeMode, string[]> = {+ light: [+ 'rgb-text-secondary on rgb-status-info-subtle: 4.42:1 (needs 4.5:1)',+ 'rgb-text-secondary on rgb-status-warning-subtle: 4.15:1 (needs 4.5:1)',+ 'rgb-text-secondary on rgb-status-error-subtle: 4.05:1 (needs 4.5:1)',+ 'rgb-text-secondary-alt on rgb-status-info-subtle: 4.42:1 (needs 4.5:1)',+ 'rgb-text-secondary-alt on rgb-status-warning-subtle: 4.15:1 (needs 4.5:1)',+ 'rgb-text-secondary-alt on rgb-status-error-subtle: 4.05:1 (needs 4.5:1)',+ 'rgb-text-tertiary on rgb-status-info-subtle: 4.42:1 (needs 4.5:1)',+ 'rgb-text-tertiary on rgb-status-warning-subtle: 4.15:1 (needs 4.5:1)',+ 'rgb-text-tertiary on rgb-status-error-subtle: 4.05:1 (needs 4.5:1)',+ 'rgb-status-success on rgb-status-success-subtle: 4.27:1 (needs 4.5:1)',+ 'rgb-status-info on rgb-status-info-subtle: 3.32:1 (needs 4.5:1)',+ 'rgb-link on rgb-surface-primary: 3.84:1 (needs 4.5:1)',+ 'rgb-link on rgb-surface-secondary: 3.58:1 (needs 4.5:1)',+ 'rgb-link-prose on rgb-surface-primary: 3.84:1 (needs 4.5:1)',+ 'rgb-link-prose on rgb-surface-secondary: 3.58:1 (needs 4.5:1)',+ 'rgb-border-xheavy on rgb-surface-primary: 2.03:1 (needs 3:1)',+ 'rgb-border-xheavy on rgb-surface-secondary: 1.90:1 (needs 3:1)',+ 'rgb-border-xheavy on rgb-surface-tertiary: 1.90:1 (needs 3:1)',+ 'rgb-border-xheavy on rgb-surface-dialog: 2.03:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-primary: 1.24:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-secondary: 1.16:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-tertiary: 1.16:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-dialog: 1.24:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-surface-chat: 2.03:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-surface-primary: 2.03:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-presentation: 2.03:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-surface-user-message: 1.64:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-surface-chat: 2.03:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-surface-primary: 2.03:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-presentation: 2.03:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-surface-user-message: 1.64:1 (needs 3:1)',+ 'rgb-series-2 on rgb-surface-primary: 2.65:1 (needs 3:1)',+ 'rgb-series-2 on rgb-surface-secondary: 2.47:1 (needs 3:1)',+ 'rgb-series-2 on rgb-surface-tertiary: 2.47:1 (needs 3:1)',+ 'rgb-series-2 on rgb-surface-chat: 2.65:1 (needs 3:1)',+ 'rgb-series-2 on rgb-surface-dialog: 2.65:1 (needs 3:1)',+ 'rgb-series-2 on rgb-text-on-status: 2.65:1 (needs 3:1)',+ 'rgb-series-3 on rgb-surface-primary: 1.72:1 (needs 3:1)',+ 'rgb-series-3 on rgb-surface-secondary: 1.60:1 (needs 3:1)',+ 'rgb-series-3 on rgb-surface-tertiary: 1.60:1 (needs 3:1)',+ 'rgb-series-3 on rgb-surface-chat: 1.72:1 (needs 3:1)',+ 'rgb-series-3 on rgb-surface-dialog: 1.72:1 (needs 3:1)',+ 'rgb-series-3 on rgb-text-on-status: 1.72:1 (needs 3:1)',+ 'rgb-series-5 on rgb-surface-primary: 1.19:1 (needs 3:1)',+ 'rgb-series-5 on rgb-surface-secondary: 1.12:1 (needs 3:1)',+ 'rgb-series-5 on rgb-surface-tertiary: 1.12:1 (needs 3:1)',+ 'rgb-series-5 on rgb-surface-chat: 1.19:1 (needs 3:1)',+ 'rgb-series-5 on rgb-surface-dialog: 1.19:1 (needs 3:1)',+ 'rgb-series-5 on rgb-text-on-status: 1.19:1 (needs 3:1)',+ 'rgb-series-7 on rgb-surface-primary: 1.95:1 (needs 3:1)',+ 'rgb-series-7 on rgb-surface-secondary: 1.82:1 (needs 3:1)',+ 'rgb-series-7 on rgb-surface-tertiary: 1.82:1 (needs 3:1)',+ 'rgb-series-7 on rgb-surface-chat: 1.95:1 (needs 3:1)',+ 'rgb-series-7 on rgb-surface-dialog: 1.95:1 (needs 3:1)',+ 'rgb-series-7 on rgb-text-on-status: 1.95:1 (needs 3:1)',+ 'rgb-switch-unchecked on rgb-switch-thumb: 1.56:1 (needs 3:1)',+ ],+ dark: [+ 'rgb-border-xheavy on rgb-surface-primary: 1.62:1 (needs 3:1)',+ 'rgb-border-xheavy on rgb-surface-secondary: 1.44:1 (needs 3:1)',+ 'rgb-border-xheavy on rgb-surface-tertiary: 1.44:1 (needs 3:1)',+ 'rgb-border-xheavy on rgb-surface-dialog: 1.62:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-primary: 1.50:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-secondary: 1.34:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-tertiary: 1.34:1 (needs 3:1)',+ 'rgb-border-control on rgb-surface-dialog: 1.50:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-surface-chat: 1.62:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-surface-primary: 1.62:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-presentation: 1.62:1 (needs 3:1)',+ 'rgb-prose-bullet on rgb-surface-user-message: 1.26:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-surface-chat: 1.62:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-surface-primary: 1.62:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-presentation: 1.62:1 (needs 3:1)',+ 'rgb-prose-quote-bar on rgb-surface-user-message: 1.26:1 (needs 3:1)',+ 'rgb-switch-unchecked on rgb-switch-thumb: 2.90:1 (needs 3:1)',+ ],+};++/** `rgb-series-1` is Click UI's chart blue, which is also its info foreground. */+const clickUiSharedSeries: Record<ThemeMode, string[]> = { light: ['rgb-series-1'], dark: [] };++const measuredBelow: Record<ThemeMode, Set<string>> = { light: new Set(), dark: new Set() };++/** The pairs `below` reports that are not pinned in `clickUiBelowFloor`. */+function belowPinned(+ mode: ThemeMode,+ theme: IThemeRGB,+ minimum: number,+ foregrounds: Array<keyof IThemeRGB>,+ backgrounds: Array<keyof IThemeRGB>,+): string[] {+ const failures = below(theme, minimum, foregrounds, backgrounds);+ failures.forEach((failure) => measuredBelow[mode].add(failure));+ return failures.filter((failure) => !clickUiBelowFloor[mode].includes(failure));+}+const modes: Array<[ThemeMode, IThemeRGB]> = [['light', clickHouseLightTheme],['dark', clickHouseDarkTheme],];-describe.each(modes)('clickhouse %s palette', (_mode, theme) => {+describe.each(modes)('clickhouse %s palette', (mode, theme) => {it('declares every registry token, so nothing falls back to the LibreChat palette', () => {expect(Object.keys(theme).sort()).toEqual([...themeColorTokens].sort());});it('keeps neutral text at WCAG AA on every canvas surface', () => {- expect(below(theme, WCAG_AA_NORMAL, neutralTextTokens, canvasSurfaces)).toEqual([]);+ expect(belowPinned(mode, theme, WCAG_AA_NORMAL, neutralTextTokens, canvasSurfaces)).toEqual([]);});it('steps each layer off the one it sits on, so hover and selection stay apart', () => {@@ -192,16 +299,18 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {['rgb-surface-user-message', 'rgb-surface-canvas'],['rgb-surface-card-hover', 'rgb-surface-card'],['rgb-surface-nav-selected', 'rgb-surface-nav-hover'],- ['rgb-surface-nav-hover', 'rgb-surface-primary-alt'],+ ['rgb-surface-nav-hover', 'rgb-surface-sidebar'],['rgb-surface-tab-selected', 'rgb-surface-dialog'],- ['rgb-surface-search', 'rgb-surface-primary-alt'],+ ['rgb-surface-search', 'rgb-surface-sidebar'],['rgb-border-menu', 'rgb-surface-menu'],];expect(layers.filter(([layer, ground]) => theme[layer] === theme[ground])).toEqual([]);});it('keeps primary text at WCAG AA on hover, selected and header fills', () => {- expect(below(theme, WCAG_AA_NORMAL, ['rgb-text-primary'], interactiveFills)).toEqual([]);+ expect(+ belowPinned(mode, theme, WCAG_AA_NORMAL, ['rgb-text-primary'], interactiveFills),+ ).toEqual([]);});/** The chat error box, the route error boundary, the sign-in notices and the@@ -216,12 +325,13 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {'rgb-text-tertiary','rgb-text-destructive',];- expect(below(theme, WCAG_AA_NORMAL, onStatusFills, fills)).toEqual([]);+ expect(belowPinned(mode, theme, WCAG_AA_NORMAL, onStatusFills, fills)).toEqual([]);});it('keeps the primary button label at WCAG AA on its fill, hovered and pressed', () => {expect(- below(+ belowPinned(+ mode,theme,WCAG_AA_NORMAL,['rgb-text-inverted'],@@ -232,13 +342,20 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {it('keeps warning and destructive text at WCAG AA on canvas surfaces', () => {expect(- below(theme, WCAG_AA_NORMAL, ['rgb-text-warning', 'rgb-text-destructive'], canvasSurfaces),+ belowPinned(+ mode,+ theme,+ WCAG_AA_NORMAL,+ ['rgb-text-warning', 'rgb-text-destructive'],+ canvasSurfaces,+ ),).toEqual([]);});it('keeps every status hue at WCAG AA against its own subtle fill', () => {const failures = statusHues.flatMap((hue) =>- below(+ belowPinned(+ mode,theme,WCAG_AA_NORMAL,[`rgb-status-${hue}` as keyof IThemeRGB],@@ -250,19 +367,26 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {it('keeps accents and links at WCAG AA on the page', () => {expect(- below(theme, WCAG_AA_NORMAL, accentTokens, ['rgb-surface-primary', 'rgb-surface-secondary']),+ belowPinned(mode, theme, WCAG_AA_NORMAL, accentTokens, [+ 'rgb-surface-primary',+ 'rgb-surface-secondary',+ ]),).toEqual([]);});it('keeps every syntax colour at WCAG AA on the code surface', () => {expect(- below(theme, WCAG_AA_NORMAL, syntaxTokens, ['rgb-surface-code', 'rgb-surface-code-body']),+ belowPinned(mode, theme, WCAG_AA_NORMAL, syntaxTokens, [+ 'rgb-surface-code',+ 'rgb-surface-code-body',+ ]),).toEqual([]);});it('keeps inverted and fixed pairs at WCAG AA', () => {expect(- below(+ belowPinned(+ mode,theme,WCAG_AA_NORMAL,['rgb-text-inverted'],@@ -270,7 +394,8 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {),).toEqual([]);expect(- below(+ belowPinned(+ mode,theme,WCAG_AA_NORMAL,['rgb-text-fixed'],@@ -280,26 +405,29 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {});it('carries the status label at WCAG AA on every solid fill', () => {- expect(below(theme, WCAG_AA_NORMAL, ['rgb-text-on-status'], solidFills)).toEqual([]);+ expect(belowPinned(mode, theme, WCAG_AA_NORMAL, ['rgb-text-on-status'], solidFills)).toEqual(+ [],+ );});it('keeps solid fills and the verified mark at the 3:1 floor against the page', () => {expect(- below(+ belowPinned(+ mode,theme,WCAG_NON_TEXT,[...solidFills, 'rgb-status-verified'],['rgb-surface-primary', 'rgb-surface-secondary', 'rgb-surface-dialog'],),).toEqual([]);- expect(below(theme, WCAG_NON_TEXT, ['rgb-text-on-status'], ['rgb-status-verified'])).toEqual(- [],- );+ expect(+ belowPinned(mode, theme, WCAG_NON_TEXT, ['rgb-text-on-status'], ['rgb-status-verified']),+ ).toEqual([]);});it('keeps control boundaries and rings at the 3:1 floor on every canvas', () => {expect(- below(theme, WCAG_NON_TEXT, boundaryTokens, [+ belowPinned(mode, theme, WCAG_NON_TEXT, boundaryTokens, ['rgb-surface-primary','rgb-surface-secondary','rgb-surface-tertiary',@@ -308,9 +436,22 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {).toEqual([]);});+ it('keeps the unchecked switch track at the 3:1 floor against the thumb and the checked fill', () => {+ expect(+ belowPinned(+ mode,+ theme,+ WCAG_NON_TEXT,+ ['rgb-switch-unchecked'],+ ['rgb-switch-thumb', 'rgb-surface-inverted'],+ ),+ ).toEqual([]);+ });+it('keeps the list marker and the quote bar at the 3:1 floor on the page and the user bubble', () => {expect(- below(+ belowPinned(+ mode,theme,WCAG_NON_TEXT,['rgb-prose-bullet', 'rgb-prose-quote-bar'],@@ -324,14 +465,14 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {});it('keeps primary text at WCAG AA on the inline code chip', () => {- expect(below(theme, WCAG_AA_NORMAL, ['rgb-text-primary'], ['rgb-surface-code-inline'])).toEqual(- [],- );+ expect(+ belowPinned(mode, theme, WCAG_AA_NORMAL, ['rgb-text-primary'], ['rgb-surface-code-inline']),+ ).toEqual([]);});it('keeps every series mark at the 3:1 floor on the page and under the status label', () => {expect(- below(theme, WCAG_NON_TEXT, seriesTokens, [+ belowPinned(mode, theme, WCAG_NON_TEXT, seriesTokens, ['rgb-surface-primary','rgb-surface-secondary','rgb-surface-tertiary',@@ -346,7 +487,15 @@ describe.each(modes)('clickhouse %s palette', (_mode, theme) => {const reserved = new Set(statusHues.map((hue) => theme[`rgb-status-${hue}` as keyof IThemeRGB]),);- expect(seriesTokens.filter((token) => reserved.has(theme[token]))).toEqual([]);+ expect(+ seriesTokens.filter(+ (token) => reserved.has(theme[token]) && !clickUiSharedSeries[mode].includes(token),+ ),+ ).toEqual([]);+ });++ it('pins every pair that sits below its floor because it holds the Click UI value', () => {+ expect([...measuredBelow[mode]].sort()).toEqual([...clickUiBelowFloor[mode]].sort());});});diff --git a/packages/client/src/theme/themes/clickhouse.ts b/packages/client/src/theme/themes/clickhouse.tsindex 8debb349a1..c8899a2134 100644--- a/packages/client/src/theme/themes/clickhouse.ts+++ b/packages/client/src/theme/themes/clickhouse.ts@@ -3,7 +3,7 @@ import type { IThemeAppearance, ThemeDefinition, IThemeRGB } from '../types';/*** ClickHouse reference theme, built from Click UI's design tokens* (github.com/ClickHouse/click-ui, `src/theme/tokens/variables.light.ts` and- * `variables.dark.ts` at tag v0.13.0, bb744e8255a3c97635d2fdc9a546c266b5b8a3e0). The tokens it+ * `variables.dark.ts` at tag v0.14.0, c161141f4efc9fd8e8c951cd15a367d333902999). The tokens it* cites are pinned in `clickui.json`, and `clickui.spec.ts` fails on drift in either one.** This is the deliberately different theme that proves the engine repaints the@@ -12,10 +12,10 @@ import type { IThemeAppearance, ThemeDefinition, IThemeRGB } from '../types';* without a prefix are under `global.color` (or `click.global.color` for `text.warning` and* `text.danger`), `palette.*` is Click UI's ramp, and component paths are under `click`.*- * Both maps are complete, so nothing falls back to the LibreChat palette. Where- * a verbatim Click UI value missed a contrast floor in `clickhouse.spec.ts` or- * `semanticTokens.spec.ts`, the value moves along the same Click UI ramp and the- * comment records the step and the ratio it replaced.+ * Both maps are complete, so nothing falls back to the LibreChat palette. Every role Click UI+ * names a value for holds it exactly, by owner decision, including where that value+ * misses a WCAG floor; `clickhouse.spec.tsx` pins each pair that does. A token Click UI+ * draws with alpha is held as its composite on the surface it sits on.** `text-on-status` is one label per mode over every solid fill. Dark mode keeps* the brand yellow on `surface-submit`, which forces a near-black label, so the@@ -32,9 +32,9 @@ export const clickHouseLightTheme: IThemeRGB = {* feedback.danger.background. One step down the slate ramp is Click UI's own* feedback.neutral.foreground. `text-muted` never meets a status fill, so it* keeps text.muted. */- 'rgb-text-secondary': '83 87 95', // #53575f (palette.slate.700)- 'rgb-text-secondary-alt': '83 87 95', // #53575f (palette.slate.700)- 'rgb-text-tertiary': '83 87 95', // #53575f (palette.slate.700)+ 'rgb-text-secondary': '105 110 121', // #696e79 (text.muted)+ 'rgb-text-secondary-alt': '105 110 121', // #696e79 (text.muted)+ 'rgb-text-tertiary': '105 110 121', // #696e79 (text.muted)'rgb-text-muted': '105 110 121', // #696e79 (text.muted)'rgb-badge-label': '105 110 121', // #696e79 (badge.opaque.color.text.default)'rgb-text-warning': '163 60 0', // #a33c00 (text.warning)@@ -43,10 +43,10 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-shimmer-dip': '128 134 145', // #808691 (palette.slate.500)// Link and accent colors- 'rgb-link': '29 100 236', // #1d64ec (palette.info.500, one step past text.link.default #437eef (3.84:1 on white))+ 'rgb-link': '67 126 239', // #437eef (text.link.default)'rgb-link-hover': '16 78 198', // #104ec6 (text.link.hover)'rgb-link-visited': '136 0 204', // #8800cc (palette.violet.600)- 'rgb-link-prose': '29 100 236', // #1d64ec (palette.info.500, matching link)+ 'rgb-link-prose': '67 126 239', // #437eef (text.link.default)'rgb-accent-primary': '21 21 21', // #151515 (accent.default)'rgb-accent-primary-hover': '50 50 50', // #323232 (palette.neutral.712)@@ -79,7 +79,7 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-surface-dialog': '255 255 255', // #ffffff (background.default)'rgb-dialog-title': '30 29 31', // #1e1d1f (dialog.color.title.default, lch(11.126 1.374 305.43))'rgb-surface-overlay': '21 21 21', // #151515 (dialog.color.opaqueBackground, lch(6.7738 0 none))- 'rgb-surface-media-overlay': '0 0 0', // #000000 (no Click UI media scrim)+ 'rgb-surface-media-overlay': '0 0 0', // #000000 (Click UI has no media scrim; the image frame stays black)'rgb-text-on-media': '255 255 255', // #ffffff (palette.neutral.0)'rgb-surface-submit': '21 21 21', // #151515 (accent.default)'rgb-surface-submit-hover': '50 50 50', // #323232 (palette.neutral.712)@@ -89,8 +89,8 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-surface-code': '246 247 250', // #f6f7fa (codeblock.lightMode.color.background.default)'rgb-surface-code-body': '246 247 250', // #f6f7fa (codeblock.lightMode.color.background.default)'rgb-surface-code-inline': '204 207 211', // #cccfd3 (palette.slate.200, distinct from the page and from the user message bubble, slate.100)- 'rgb-prose-bullet': '83 87 95', // #53575f (palette.slate.700, 3:1 or better on the page and the user message bubble; stroke.default is 1.24:1)- 'rgb-prose-quote-bar': '83 87 95', // #53575f (palette.slate.700, 3:1 or better on the page and the user message bubble)+ 'rgb-prose-bullet': '179 182 189', // #b3b6bd (stroke.intense)+ 'rgb-prose-quote-bar': '179 182 189', // #b3b6bd (stroke.intense)'rgb-surface-qr': '255 255 255', // #ffffff (palette.neutral.0)'rgb-surface-inverted': '21 21 21', // #151515 (palette.neutral.900)'rgb-surface-inverted-hover': '50 50 50', // #323232 (palette.neutral.712)@@ -108,10 +108,10 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-border-medium': '230 231 233', // #e6e7e9 (stroke.default)'rgb-border-medium-alt': '230 231 233', // #e6e7e9 (stroke.default)'rgb-border-heavy': '179 182 189', // #b3b6bd (stroke.intense)- 'rgb-drawer-edge': '246 247 250', // #f6f7fa (background.split, the drawer's own fill)- 'rgb-border-xheavy': '128 134 145', // #808691 (palette.slate.500, two steps past stroke.intense #b3b6bd (2.03:1 on white))+ 'rgb-drawer-edge': '255 255 255', // #ffffff (sidebar.main.color.background.default, the drawer's own fill)+ 'rgb-border-xheavy': '179 182 189', // #b3b6bd (stroke.intense)'rgb-border-destructive': '193 0 0', // #c10000 (palette.danger.600)- 'rgb-border-control': '128 134 145', // #808691 (palette.slate.500, 3.42:1 on background.muted)+ 'rgb-border-control': '230 231 233', // #e6e7e9 (field.color.stroke.default)'rgb-border-field-focus': '22 21 23', // #161517 (field.color.stroke.active)'rgb-focus-subtle': '67 126 239', // #437eef (outline.default, 3.84:1 on white)'rgb-field-fill': '251 252 255', // #fbfcff (field.color.background.default)@@ -125,24 +125,25 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-surface-user-message': '230 231 233', // #e6e7e9 (palette.slate.100, the sidebar.main.navigation.item active step; Click UI has no chat bubble)'rgb-surface-card': '255 255 255', // #ffffff (card.secondary.color.background.default)'rgb-surface-card-hover': '246 247 250', // #f6f7fa (card.secondary.color.background.hover)- 'rgb-surface-nav-hover': '236 237 240', // #ecedf0 (sidebar.main.navigation.item.color.background.hover, lch(91.609 1.1023 265.86 / 0.6) composited on background.split)+ 'rgb-surface-nav-hover': '240 241 242', // #f0f1f2 (sidebar.main.navigation.item.color.background.hover, lch(91.609 1.1023 265.86 / 0.6) composited on sidebar.main.color.background.default)'rgb-surface-nav-selected': '230 231 233', // #e6e7e9 (sidebar.main.navigation.item.color.background.active)'rgb-surface-tab-selected': '230 231 233', // #e6e7e9 (sidebar.main.navigation.item.color.background.active)'rgb-surface-menu': '255 255 255', // #ffffff (genericMenu.panel.color.background.default)'rgb-surface-popover': '255 255 255', // #ffffff (genericMenu.panel.color.background.default)'rgb-border-menu': '230 231 233', // #e6e7e9 (genericMenu.panel.color.stroke.default)'rgb-surface-composer': '255 255 255', // #ffffff (background.default)- 'rgb-surface-search': '255 255 255', // #ffffff (background.default)+ 'rgb-surface-search': '251 252 255', // #fbfcff (field.color.background.default)+ 'rgb-surface-sidebar': '255 255 255', // #ffffff (sidebar.main.color.background.default)'rgb-surface-disabled': '223 223 223', // #dfdfdf (button.basic.color.primary.background.disabled)'rgb-text-disabled': '160 160 160', // #a0a0a0 (text.disabled)'rgb-border-disabled': '223 223 223', // #dfdfdf (field.color.stroke.disabled)// Status colors- 'rgb-status-success': '0 97 8', // #006108 (palette.success.800, one step past feedback.success.foreground #008a0b (4.27:1 on its fill))+ 'rgb-status-success': '0 138 11', // #008a0b (feedback.success.foreground)'rgb-status-success-subtle': '229 255 232', // #e5ffe8 (feedback.success.background)'rgb-status-success-border': '153 255 161', // #99ffa1 (palette.success.200)'rgb-status-success-strong': '0 138 11', // #008a0b (feedback.success.foreground)- 'rgb-status-info': '16 78 198', // #104ec6 (palette.info.600, two steps past feedback.info.foreground #437eef (3.32:1 on its fill))+ 'rgb-status-info': '67 126 239', // #437eef (feedback.info.foreground)'rgb-status-info-subtle': '231 239 253', // #e7effd (feedback.info.background)'rgb-status-info-border': '161 190 247', // #a1bef7 (palette.info.200)'rgb-status-info-strong': '16 78 198', // #104ec6 (palette.info.600)@@ -165,17 +166,17 @@ export const clickHouseLightTheme: IThemeRGB = {'rgb-avatar-fill': '105 110 121', // #696e79 (avatar.color.background.default)'rgb-avatar-text': '255 255 255', // #ffffff (avatar.color.text.default)'rgb-avatar-placeholder': '246 247 250', // #f6f7fa (background.muted)- 'rgb-avatar-edge': '240 246 252', // #f0f6fc (Click UI avatars draw no edge)+ 'rgb-avatar-edge': '230 231 233', // #e6e7e9 (stroke.default; Click UI avatars draw no edge)'rgb-illustration-subtle': '161 190 247', // #a1bef7 (palette.info.200)'rgb-illustration': '67 126 239', // #437eef (palette.info.400)'rgb-illustration-strong': '16 78 198', // #104ec6 (palette.info.600)- 'rgb-file-document': '13 62 155', // #0d3e9b (palette.info.700)+ 'rgb-file-document': '16 78 198', // #104ec6 (palette.info.600)'rgb-file-sheet': '0 138 11', // #008a0b (palette.success.700)'rgb-file-code': '214 79 0', // #d64f00 (palette.warning.600)'rgb-file-artifact': '48 46 50', // #302e32 (palette.slate.800)'rgb-file-audio': '138 105 0', // #8a6900 (palette.sunrise.700)'rgb-file-video': '136 0 204', // #8800cc (palette.violet.600)- 'rgb-file-generic': '16 78 198', // #104ec6 (palette.info.600)+ 'rgb-file-generic': '105 110 121', // #696e79 (palette.slate.600)'rgb-file-ink': '255 255 255', // #ffffff (palette.neutral.0)// Code syntax@@ -190,16 +191,16 @@ export const clickHouseLightTheme: IThemeRGB = {// Series'rgb-series-1': '67 126 239', // #437eef (chart.default.blue)- 'rgb-series-2': '245 90 0', // #f55a00 (palette.warning.500, one step past chart.default.orange #ff7729 (2.65:1 on white))- 'rgb-series-3': '0 138 11', // #008a0b (palette.success.700, in place of chart.default.green #00e513 (1.72:1 on white))+ 'rgb-series-2': '255 119 41', // #ff7729 (chart.default.orange)+ 'rgb-series-3': '0 229 19', // #00e513 (chart.default.green)'rgb-series-4': '251 50 201', // #fb32c9 (chart.default.fuchsia)- 'rgb-series-5': '178 136 0', // #b28800 (palette.sunrise.600, in place of chart.default.yellow #eef400 (1.19:1 on white))+ 'rgb-series-5': '238 244 0', // #eef400 (chart.default.yellow)'rgb-series-6': '187 51 255', // #bb33ff (chart.default.violet)- 'rgb-series-7': '0 133 153', // #008599 (palette.babyblue.600, in place of chart.default.babyblue #00cbeb (1.95:1 on white))+ 'rgb-series-7': '0 203 235', // #00cbeb (chart.default.babyblue)'rgb-series-8': '8 155 131', // #089b83 (chart.default.teal)// Switch- 'rgb-switch-unchecked': '128 134 145', // #808691 (palette.slate.500)+ 'rgb-switch-unchecked': '204 207 211', // #cccfd3 (switch.color.background.default)'rgb-switch-thumb': '255 255 255', // #ffffff (switch.color.indicator.default)// Table@@ -259,11 +260,8 @@ export const clickHouseDarkTheme: IThemeRGB = {'rgb-surface-tertiary-alt': '50 50 50', // #323232 (palette.neutral.712)'rgb-surface-dialog': '31 31 28', // #1f1f1c (background.default)'rgb-dialog-title': '249 249 249', // #f9f9f9 (dialog.color.title.default, rgb(97.5% 97.5% 97.5%))- /** Not a Click UI value. Its dark scrim, dialog.color.opaqueBackground lch(40.731 0 none), is a- * #606060 gray that lifts the page instead of dimming it. A bundled scrim never lifts the page- * (`semanticTokens.spec.ts`), so black keeps the dark scrim; the 0.75 alpha is Click UI's. */- 'rgb-surface-overlay': '0 0 0', // #000000- 'rgb-surface-media-overlay': '0 0 0', // #000000 (no Click UI media scrim)+ 'rgb-surface-overlay': '96 96 96', // #606060 (dialog.color.opaqueBackground, lch(40.731 0 none), drawn at the 0.75 scrimOpacity)+ 'rgb-surface-media-overlay': '0 0 0', // #000000 (Click UI has no media scrim; the image frame stays black)'rgb-text-on-media': '255 255 255', // #ffffff (palette.neutral.0)'rgb-surface-submit': '250 255 105', // #faff69 (accent.default)'rgb-surface-submit-hover': '253 255 163', // #fdffa3 (palette.brand.200)@@ -273,8 +271,8 @@ export const clickHouseDarkTheme: IThemeRGB = {'rgb-surface-code': '40 40 40', // #282828 (codeblock.darkMode.color.background.default)'rgb-surface-code-body': '40 40 40', // #282828 (codeblock.darkMode.color.background.default)'rgb-surface-code-inline': '65 65 65', // #414141 (palette.neutral.700, distinct from the user message bubble, neutral.712)- 'rgb-prose-bullet': '128 128 128', // #808080 (palette.neutral.500, 3.7:1 on the canvas; stroke.default is 1.29:1)- 'rgb-prose-quote-bar': '128 128 128', // #808080 (palette.neutral.500, 3.7:1 on the canvas)+ 'rgb-prose-bullet': '65 65 65', // #414141 (stroke.intense)+ 'rgb-prose-quote-bar': '65 65 65', // #414141 (stroke.intense)'rgb-surface-qr': '255 255 255', // #ffffff (palette.neutral.0)'rgb-surface-inverted': '250 255 105', // #faff69 (button.basic.color.primary.background.default)'rgb-surface-inverted-hover': '252 255 150', // #fcff96 (button.basic.color.primary.background.hover)@@ -291,15 +289,15 @@ export const clickHouseDarkTheme: IThemeRGB = {'rgb-border-medium': '50 50 50', // #323232 (stroke.default)'rgb-border-medium-alt': '50 50 50', // #323232 (stroke.default)'rgb-border-heavy': '65 65 65', // #414141 (stroke.intense)- 'rgb-drawer-edge': '128 128 128', // #808080 (palette.neutral.500, matching border-xheavy)- 'rgb-border-xheavy': '128 128 128', // #808080 (palette.neutral.500, three steps past stroke.intense #414141 (1.62:1 on the canvas))+ 'rgb-drawer-edge': '128 128 128', // #808080 (palette.neutral.500, the mobile drawer's edge against the dimmed chat)+ 'rgb-border-xheavy': '65 65 65', // #414141 (stroke.intense)'rgb-border-destructive': '255 117 117', // #ff7575 (palette.danger.300)- 'rgb-border-control': '128 128 128', // #808080 (palette.neutral.500, 3.73:1 on background.muted)+ 'rgb-border-control': '60 60 60', // #3c3c3c (field.color.stroke.default, rgb(23.627% 23.627% 23.627%))'rgb-border-field-focus': '250 255 105', // #faff69 (field.color.stroke.active)'rgb-focus-subtle': '250 255 105', // #faff69 (outline.default)'rgb-field-fill': '45 45 45', // rgb(17.794% 17.794% 17.794%) (field.color.background.default)'rgb-field-text': '230 231 233', // #e6e7e9 (field.color.text.default)- 'rgb-surface-tooltip': '50 50 50', // #323232 (palette.neutral.712; tooltip.color.background.default #282828 would vanish on the #282828 canvas)+ 'rgb-surface-tooltip': '40 40 40', // #282828 (tooltip.color.background.default, lch(16.114 0 none / 0.95) taken opaque)'rgb-text-tooltip': '255 255 255', // #ffffff (tooltip.color.label.default)'rgb-alert-error-fill': '76 32 29', // #4c201d (alert.color.background.danger, danger at 20% over background.default)'rgb-alert-error-border': '76 32 29', // #4c201d (Click UI alerts draw no edge, so it matches the fill)@@ -309,13 +307,14 @@ export const clickHouseDarkTheme: IThemeRGB = {'rgb-surface-card': '31 31 28', // #1f1f1c (card.secondary.color.background.default)'rgb-surface-card-hover': '40 40 40', // #282828 (card.secondary.color.background.hover)'rgb-surface-nav-hover': '46 46 46', // #2e2e2e (sidebar.main.navigation.item.color.background.hover, lch(19.05 0 none))- 'rgb-surface-nav-selected': '55 55 55', // #373737 (sidebar.main.navigation.item.color.background.active, lch(27.535 0 none / 0.6) composited on background.split)+ 'rgb-surface-nav-selected': '51 51 50', // #333332 (sidebar.main.navigation.item.color.background.active, lch(27.535 0 none / 0.6) composited on sidebar.main.color.background.default)'rgb-surface-tab-selected': '50 50 50', // #323232 (palette.neutral.712)'rgb-surface-menu': '40 40 40', // #282828 (genericMenu.panel.color.background.default)'rgb-surface-popover': '40 40 40', // #282828 (genericMenu.panel.color.background.default)'rgb-border-menu': '65 65 65', // #414141 (genericMenu.panel.color.stroke.default)'rgb-surface-composer': '45 45 45', // #2d2d2d (field.color.background.default)'rgb-surface-search': '45 45 45', // #2d2d2d (field.color.background.default)+ 'rgb-surface-sidebar': '31 31 28', // #1f1f1c (sidebar.main.color.background.default)'rgb-surface-disabled': '65 65 65', // #414141 (button.basic.color.primary.background.disabled)'rgb-text-disabled': '128 128 128', // #808080 (text.disabled)'rgb-border-disabled': '65 65 65', // #414141 (field.color.stroke.disabled)@@ -348,17 +347,17 @@ export const clickHouseDarkTheme: IThemeRGB = {'rgb-avatar-fill': '128 134 145', // #808691 (avatar.color.background.default)'rgb-avatar-text': '31 31 28', // #1f1f1c (avatar.color.text.default)'rgb-avatar-placeholder': '40 40 40', // #282828 (background.muted)- 'rgb-avatar-edge': '240 246 252', // #f0f6fc (Click UI avatars draw no edge)+ 'rgb-avatar-edge': '50 50 50', // #323232 (stroke.default; Click UI avatars draw no edge)'rgb-illustration-subtle': '161 190 247', // #a1bef7 (palette.info.200)'rgb-illustration': '67 126 239', // #437eef (palette.info.400)'rgb-illustration-strong': '16 78 198', // #104ec6 (palette.info.600)- 'rgb-file-document': '67 126 239', // #437eef (palette.info.400)+ 'rgb-file-document': '16 78 198', // #104ec6 (palette.info.600)'rgb-file-sheet': '0 138 11', // #008a0b (palette.success.700)'rgb-file-code': '214 79 0', // #d64f00 (palette.warning.600)'rgb-file-artifact': '48 46 50', // #302e32 (palette.slate.800)'rgb-file-audio': '138 105 0', // #8a6900 (palette.sunrise.700)'rgb-file-video': '136 0 204', // #8800cc (palette.violet.600)- 'rgb-file-generic': '16 78 198', // #104ec6 (palette.info.600)+ 'rgb-file-generic': '105 110 121', // #696e79 (palette.slate.600)'rgb-file-ink': '255 255 255', // #ffffff (palette.neutral.0)// Code syntax@@ -382,7 +381,7 @@ export const clickHouseDarkTheme: IThemeRGB = {'rgb-series-8': '109 248 225', // #6df8e1 (chart.default.teal)// Switch- 'rgb-switch-unchecked': '128 128 128', // #808080 (palette.neutral.500)+ 'rgb-switch-unchecked': '96 96 96', // #606060 (switch.color.background.default)'rgb-switch-thumb': '21 21 21', // #151515 (switch.color.indicator.default)// Table@@ -408,9 +407,9 @@ export const clickHouseDarkTheme: IThemeRGB = {* Click UI's display family leads with Basier Square, a commercial face ClickHouse licenses for* its own sites. It is named here but not self-hosted: a browser that has it installed renders* headings in it, and every other one falls through to the same Inter stack as the body. The- * `text-*` scale takes Click UI's `font.sizes` 1 to 5 at its product line height of 1.5. Click UI- * has no step between 1.25rem and 2rem, and 2rem would overtake Tailwind's unthemed `text-3xl`- * (1.875rem), so `2xl` keeps LibreChat's 1.5rem at Click UI's line height.+ * `text-*` scale takes Click UI's `font.sizes` 1 to 5 at its product line height of 1.5. `2xl`+ * takes `font.sizes.6` (2rem), which passes Tailwind's unthemed `text-3xl` (1.875rem), at Click+ * UI's line height.** Click UI raises every elevated surface (card, dialog, menu, panel, popover, toast) with* `shadow.1`, and its only lighter step is the hairline `shadow.5`. Steps 2 to 4 are the flyout's@@ -457,13 +456,15 @@ const clickHouseShape = {textBase: '1rem', // typography.font.sizes.3textLg: '1.125rem', // typography.font.sizes.4textXl: '1.25rem', // typography.font.sizes.5- text2xl: '1.5rem', // LibreChat's: Click UI's next step (sizes.6, 2rem) passes the unthemed text-3xl+ text2xl: '2rem', // typography.font.sizes.6+ text3xl: '2rem', // typography.font.sizes.6, Click UI's largest step, so a heading never shrinks as the scale risesleadingXs: '1.5', // typography.font.line-height.1leadingSm: '1.5', // typography.font.line-height.1leadingBase: '1.5', // typography.font.line-height.1leadingLg: '1.5', // typography.font.line-height.1leadingXl: '1.5', // typography.font.line-height.1leading2xl: '1.5', // typography.font.line-height.1+ leading3xl: '1.5', // typography.font.line-height.1shadow2xs: '0 2px 2px 0 rgb(0 0 0 / 0.03)', // shadow.5shadowXs: '0 2px 2px 0 rgb(0 0 0 / 0.03)', // shadow.5shadowSm: '0 2px 2px 0 rgb(0 0 0 / 0.03)', // shadow.5@@ -490,6 +491,7 @@ const clickHouseShape = {* `field.color.stroke.active` and draws no ring (InputWrapper); LibreChat adds a 1px ring in* that color on keyboard focus only, to keep its 2px focus floor. */fieldHeight: '2rem',+ fieldHeightLg: '3.6876rem', // content-sized like fieldHeight: the 3rem title line (2rem at 1.5), field.space.y twice, a 1px stroke each sidefieldPaddingY: '0.2813rem', // field.space.yfieldFocusStyle: 'border' as const,/** Click UI fills its fields in `field.color.background.default`. */diff --git a/packages/client/src/theme/themes/clickui.json b/packages/client/src/theme/themes/clickui.jsonindex 5bbf31dbe2..42097f0297 100644--- a/packages/client/src/theme/themes/clickui.json+++ b/packages/client/src/theme/themes/clickui.json@@ -1,7 +1,7 @@{"source": "https://github.com/ClickHouse/click-ui",- "tag": "v0.13.0",- "commit": "bb744e8255a3c97635d2fdc9a546c266b5b8a3e0",+ "tag": "v0.14.0",+ "commit": "c161141f4efc9fd8e8c951cd15a367d333902999","files": {"light": "src/theme/tokens/variables.light.ts","dark": "src/theme/tokens/variables.dark.ts"@@ -64,6 +64,7 @@"click.image.lg.size.width": "1.5rem","click.image.md.size.width": "1.25rem","click.image.sm.size.width": "1rem",+ "click.sidebar.main.color.background.default": "#ffffff","click.sidebar.main.navigation.item.color.background.active": "#e6e7e9","click.sidebar.main.navigation.item.color.background.hover": "lch(91.609 1.1023 265.86 / 0.6)","click.switch.color.background.active": "#151515",@@ -117,19 +118,17 @@"global.color.text.link.default": "#437eef","global.color.text.link.hover": "#104ec6","global.color.text.muted": "#696e79",- "palette.babyblue.600": "#008599","palette.danger.200": "#ff9898","palette.danger.600": "#c10000","palette.danger.700": "#910000","palette.fuchsia.700": "#990073","palette.info.200": "#a1bef7","palette.info.400": "#437eef",- "palette.info.500": "#1d64ec","palette.info.600": "#104ec6",- "palette.info.700": "#0d3e9b","palette.neutral.0": "#ffffff","palette.neutral.712": "#323232","palette.neutral.900": "#151515",+ "palette.slate.600": "#696e79","palette.slate.100": "#e6e7e9","palette.slate.200": "#cccfd3","palette.slate.500": "#808691",@@ -139,11 +138,9 @@"palette.success.200": "#99ffa1","palette.success.700": "#008a0b","palette.success.800": "#006108",- "palette.sunrise.600": "#b28800","palette.sunrise.700": "#8a6900","palette.violet.600": "#8800cc","palette.warning.200": "#ffb88f",- "palette.warning.500": "#f55a00","palette.warning.600": "#d64f00","palette.warning.700": "#a33c00","shadow.1": "0 4px 6px -1px lch(6.7738 0 none / 0.15), 0 2px 4px -1px lch(6.7738 0 none / 0.15)",@@ -229,6 +226,7 @@"click.image.lg.size.width": "1.5rem","click.image.md.size.width": "1.25rem","click.image.sm.size.width": "1rem",+ "click.sidebar.main.color.background.default": "#1f1f1c","click.sidebar.main.navigation.item.color.background.active": "lch(27.535 0 none / 0.6)","click.sidebar.main.navigation.item.color.background.hover": "lch(19.05 0 none)","click.switch.color.background.active": "#faff69",@@ -295,6 +293,7 @@"palette.neutral.500": "#808080","palette.neutral.700": "#414141","palette.neutral.712": "#323232",+ "palette.slate.600": "#696e79","palette.slate.100": "#e6e7e9","palette.slate.400": "#9a9ea7","palette.slate.800": "#302e32",diff --git a/packages/client/src/theme/themes/clickui.spec.ts b/packages/client/src/theme/themes/clickui.spec.tsindex 55e0a7234e..1ba1c34971 100644--- a/packages/client/src/theme/themes/clickui.spec.ts+++ b/packages/client/src/theme/themes/clickui.spec.ts@@ -57,18 +57,18 @@ const modes: ThemeMode[] = ['light', 'dark'];const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>> = {light: {'rgb-text-primary': 'global.color.text.default',- 'rgb-text-secondary': 'palette.slate.700',- 'rgb-text-secondary-alt': 'palette.slate.700',- 'rgb-text-tertiary': 'palette.slate.700',+ 'rgb-text-secondary': 'global.color.text.muted',+ 'rgb-text-secondary-alt': 'global.color.text.muted',+ 'rgb-text-tertiary': 'global.color.text.muted','rgb-text-muted': 'global.color.text.muted','rgb-text-warning': 'click.global.color.text.warning','rgb-text-destructive': 'click.global.color.text.danger','rgb-shimmer-base': 'global.color.text.default','rgb-shimmer-dip': 'palette.slate.500',- 'rgb-link': 'palette.info.500',+ 'rgb-link': 'global.color.text.link.default','rgb-link-hover': 'global.color.text.link.hover','rgb-link-visited': 'palette.violet.600',- 'rgb-link-prose': 'palette.info.500',+ 'rgb-link-prose': 'global.color.text.link.default','rgb-accent-primary': 'global.color.accent.default','rgb-accent-primary-hover': 'palette.neutral.712','rgb-ring-primary': 'global.color.outline.default',@@ -97,6 +97,10 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-dialog-title': 'click.dialog.color.title.default','rgb-badge-label': 'click.badge.opaque.color.text.default','rgb-surface-overlay': 'click.dialog.color.opaqueBackground.default',+ 'rgb-surface-nav-hover': 'click.sidebar.main.navigation.item.color.background.hover',+ 'rgb-avatar-edge': 'global.color.stroke.default',+ 'rgb-alert-error-fill': 'click.alert.color.background.danger',+ 'rgb-alert-error-border': 'click.alert.color.background.danger','rgb-surface-submit': 'global.color.accent.default','rgb-surface-submit-hover': 'palette.neutral.712','rgb-surface-destructive': 'palette.danger.600',@@ -105,8 +109,8 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-surface-code': 'click.codeblock.lightMode.color.background.default','rgb-surface-code-body': 'click.codeblock.lightMode.color.background.default','rgb-surface-code-inline': 'palette.slate.200',- 'rgb-prose-bullet': 'palette.slate.700',- 'rgb-prose-quote-bar': 'palette.slate.700',+ 'rgb-prose-bullet': 'global.color.stroke.intense',+ 'rgb-prose-quote-bar': 'global.color.stroke.intense','rgb-surface-qr': 'palette.neutral.0','rgb-text-on-media': 'palette.neutral.0','rgb-surface-inverted': 'palette.neutral.900',@@ -122,10 +126,10 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-border-medium': 'global.color.stroke.default','rgb-border-medium-alt': 'global.color.stroke.default','rgb-border-heavy': 'global.color.stroke.intense',- 'rgb-border-xheavy': 'palette.slate.500',- 'rgb-drawer-edge': 'global.color.background.split',+ 'rgb-border-xheavy': 'global.color.stroke.intense',+ 'rgb-drawer-edge': 'click.sidebar.main.color.background.default','rgb-border-destructive': 'palette.danger.600',- 'rgb-border-control': 'palette.slate.500',+ 'rgb-border-control': 'click.field.color.stroke.default','rgb-border-field-focus': 'click.field.color.stroke.active','rgb-field-fill': 'click.field.color.background.default','rgb-field-text': 'click.field.color.text.default',@@ -139,15 +143,16 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-surface-popover': 'click.genericMenu.panel.color.background.default','rgb-border-menu': 'click.genericMenu.panel.color.stroke.default','rgb-surface-composer': 'global.color.background.default',- 'rgb-surface-search': 'global.color.background.default',+ 'rgb-surface-sidebar': 'click.sidebar.main.color.background.default',+ 'rgb-surface-search': 'click.field.color.background.default','rgb-surface-disabled': 'click.button.basic.color.primary.background.disabled','rgb-text-disabled': 'global.color.text.disabled','rgb-border-disabled': 'click.field.color.stroke.disabled',- 'rgb-status-success': 'palette.success.800',+ 'rgb-status-success': 'global.color.feedback.success.foreground','rgb-status-success-subtle': 'global.color.feedback.success.background','rgb-status-success-border': 'palette.success.200','rgb-status-success-strong': 'global.color.feedback.success.foreground',- 'rgb-status-info': 'palette.info.600',+ 'rgb-status-info': 'global.color.feedback.info.foreground','rgb-status-info-subtle': 'global.color.feedback.info.background','rgb-status-info-border': 'palette.info.200','rgb-status-info-strong': 'palette.info.600',@@ -171,13 +176,13 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-illustration-subtle': 'palette.info.200','rgb-illustration': 'palette.info.400','rgb-illustration-strong': 'palette.info.600',- 'rgb-file-document': 'palette.info.700',+ 'rgb-file-document': 'palette.info.600','rgb-file-sheet': 'palette.success.700','rgb-file-code': 'palette.warning.600','rgb-file-artifact': 'palette.slate.800','rgb-file-audio': 'palette.sunrise.700','rgb-file-video': 'palette.violet.600',- 'rgb-file-generic': 'palette.info.600',+ 'rgb-file-generic': 'palette.slate.600','rgb-file-ink': 'palette.neutral.0','rgb-syntax-text': 'click.codeblock.lightMode.color.text.default','rgb-syntax-comment': 'global.color.text.muted',@@ -188,14 +193,14 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-syntax-attr': 'palette.fuchsia.700','rgb-syntax-title': 'palette.warning.700','rgb-series-1': 'global.color.chart.default.blue',- 'rgb-series-2': 'palette.warning.500',- 'rgb-series-3': 'palette.success.700',+ 'rgb-series-2': 'global.color.chart.default.orange',+ 'rgb-series-3': 'global.color.chart.default.green','rgb-series-4': 'global.color.chart.default.fuchsia',- 'rgb-series-5': 'palette.sunrise.600',+ 'rgb-series-5': 'global.color.chart.default.yellow','rgb-series-6': 'global.color.chart.default.violet',- 'rgb-series-7': 'palette.babyblue.600',+ 'rgb-series-7': 'global.color.chart.default.babyblue','rgb-series-8': 'global.color.chart.default.teal',- 'rgb-switch-unchecked': 'palette.slate.500',+ 'rgb-switch-unchecked': 'click.switch.color.background.default','rgb-switch-thumb': 'click.switch.color.indicator.default','rgb-table-header-text': 'click.table.header.color.title.default','rgb-table-header-fill': 'click.table.header.color.background.default',@@ -243,6 +248,11 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-surface-tertiary-alt': 'palette.neutral.712','rgb-surface-dialog': 'global.color.background.default','rgb-dialog-title': 'click.dialog.color.title.default',+ 'rgb-surface-overlay': 'click.dialog.color.opaqueBackground.default',+ 'rgb-surface-nav-selected': 'click.sidebar.main.navigation.item.color.background.active',+ 'rgb-avatar-edge': 'global.color.stroke.default',+ 'rgb-alert-error-fill': 'click.alert.color.background.danger',+ 'rgb-alert-error-border': 'click.alert.color.background.danger','rgb-badge-label': 'click.badge.opaque.color.text.default','rgb-surface-submit': 'global.color.accent.default','rgb-surface-submit-hover': 'palette.brand.200',@@ -252,8 +262,8 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-surface-code': 'click.codeblock.darkMode.color.background.default','rgb-surface-code-body': 'click.codeblock.darkMode.color.background.default','rgb-surface-code-inline': 'palette.neutral.700',- 'rgb-prose-bullet': 'palette.neutral.500',- 'rgb-prose-quote-bar': 'palette.neutral.500',+ 'rgb-prose-bullet': 'global.color.stroke.intense',+ 'rgb-prose-quote-bar': 'global.color.stroke.intense','rgb-surface-qr': 'palette.neutral.0','rgb-text-on-media': 'palette.neutral.0','rgb-surface-inverted': 'click.button.basic.color.primary.background.default',@@ -269,10 +279,10 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-border-medium': 'global.color.stroke.default','rgb-border-medium-alt': 'global.color.stroke.default','rgb-border-heavy': 'global.color.stroke.intense',- 'rgb-border-xheavy': 'palette.neutral.500',+ 'rgb-border-xheavy': 'global.color.stroke.intense','rgb-drawer-edge': 'palette.neutral.500','rgb-border-destructive': 'palette.danger.300',- 'rgb-border-control': 'palette.neutral.500',+ 'rgb-border-control': 'click.field.color.stroke.default','rgb-border-field-focus': 'click.field.color.stroke.active','rgb-field-fill': 'click.field.color.background.default','rgb-field-text': 'click.field.color.text.default',@@ -286,6 +296,7 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-surface-popover': 'click.genericMenu.panel.color.background.default','rgb-border-menu': 'click.genericMenu.panel.color.stroke.default','rgb-surface-composer': 'click.field.color.background.default',+ 'rgb-surface-sidebar': 'click.sidebar.main.color.background.default','rgb-surface-search': 'click.field.color.background.default','rgb-surface-disabled': 'click.button.basic.color.primary.background.disabled','rgb-text-disabled': 'global.color.text.disabled',@@ -318,13 +329,13 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-illustration-subtle': 'palette.info.200','rgb-illustration': 'palette.info.400','rgb-illustration-strong': 'palette.info.600',- 'rgb-file-document': 'palette.info.400',+ 'rgb-file-document': 'palette.info.600','rgb-file-sheet': 'palette.success.700','rgb-file-code': 'palette.warning.600','rgb-file-artifact': 'palette.slate.800','rgb-file-audio': 'palette.sunrise.700','rgb-file-video': 'palette.violet.600',- 'rgb-file-generic': 'palette.info.600',+ 'rgb-file-generic': 'palette.slate.600','rgb-file-ink': 'palette.neutral.0','rgb-syntax-text': 'click.codeblock.darkMode.color.text.default','rgb-syntax-comment': 'global.color.text.muted',@@ -342,46 +353,40 @@ const colorSources: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>>'rgb-series-6': 'global.color.chart.default.violet','rgb-series-7': 'global.color.chart.default.babyblue','rgb-series-8': 'global.color.chart.default.teal',- 'rgb-switch-unchecked': 'palette.neutral.500',+ 'rgb-switch-unchecked': 'click.switch.color.background.default','rgb-switch-thumb': 'click.switch.color.indicator.default','rgb-table-header-text': 'click.table.header.color.title.default','rgb-table-header-fill': 'click.table.header.color.background.default','rgb-presentation': 'global.color.background.default',- 'rgb-surface-tooltip': 'palette.neutral.712',+ 'rgb-surface-tooltip': 'click.tooltip.color.background.default','rgb-text-tooltip': 'click.tooltip.color.label.default',},};-/** Click UI has no scrim for media; a lightbox or preview frames the user's image in black. */+/** Values the theme sets on purpose without a Click UI source, and why. */const MEDIA_OVERLAY_REASON ='Click UI has no media scrim; the image frame stays black in both modes';-const AVATAR_EDGE_REASON =- 'Click UI avatars draw no edge; the theme keeps the 10% hairline every LibreChat avatar has';-const MEDIA_SCRIM_DEPARTURE =- 'the dialog scrim is the nearest Click UI job; a lightbox frames the user image in black instead';--const ALERT_ALPHA_REASON =- 'Click UI draws the danger alert as feedback.danger at 10% (light) or 20% (dark) alpha with no edge; a role holds an opaque triplet, so the theme takes the fill blended over the page and the edge equals it';-/** Values the theme sets on purpose without a Click UI source, and why. */const unsourcedColors: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>> = {+ light: { 'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON },+ dark: { 'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON },+};++/**+ * Roles hold an opaque triplet, so a Click UI token drawn with alpha reaches the page as the token+ * composited on the surface it sits on. Each role here names that surface; its Click UI value is the+ * composite, which is exactly what Click UI paints.+ */+const composites: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>>> = {light: {- 'rgb-surface-nav-hover':- 'Click UI sidebar item hover is a 0.6 alpha lch; the theme paints its composite on background.split',- 'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON,- 'rgb-avatar-edge': AVATAR_EDGE_REASON,- 'rgb-alert-error-fill': ALERT_ALPHA_REASON,- 'rgb-alert-error-border': ALERT_ALPHA_REASON,+ 'rgb-surface-nav-hover': 'click.sidebar.main.color.background.default',+ 'rgb-alert-error-fill': 'global.color.background.default',+ 'rgb-alert-error-border': 'global.color.background.default',},dark: {- 'rgb-surface-nav-selected':- 'Click UI sidebar item active is a 0.6 alpha lch; the theme paints its composite on background.split',- 'rgb-surface-overlay':- 'Click UI dark dialog.color.opaqueBackground is a gray that leaves the dialog under 3:1',- 'rgb-surface-media-overlay': MEDIA_OVERLAY_REASON,- 'rgb-avatar-edge': AVATAR_EDGE_REASON,- 'rgb-alert-error-fill': ALERT_ALPHA_REASON,- 'rgb-alert-error-border': ALERT_ALPHA_REASON,+ 'rgb-surface-nav-selected': 'click.sidebar.main.color.background.default',+ 'rgb-alert-error-fill': 'global.color.background.default',+ 'rgb-alert-error-border': 'global.color.background.default',},};@@ -389,7 +394,7 @@ const unsourcedColors: Record<ThemeMode, Partial<Record<keyof IThemeRGB, string>* How close a role lands on Click UI: `match` holds the token that names the role's job, `near` is* within deltaE2000 5 of it, and `mismatch` is further off.*/-type RoleStatus = 'match' | 'near' | 'mismatch';+type RoleStatus = 'match' | 'near' | 'mismatch' | 'unsourced';interface Departure {/** The Click UI token that names the role's job, which the theme's value departs from. */@@ -404,182 +409,8 @@ interface Departure {* the counterpart. Every other role holds its counterpart, so its status is `match`.*/const departures: Record<ThemeMode, Partial<Record<keyof IThemeRGB, Departure>>> = {- light: {- 'rgb-alert-error-fill': {- counterpart: 'click.alert.color.background.danger',- status: 'mismatch',- reason: ALERT_ALPHA_REASON,- },- 'rgb-alert-error-border': {- counterpart: 'click.alert.color.background.danger',- status: 'mismatch',- reason: ALERT_ALPHA_REASON,- },- 'rgb-surface-nav-hover': {- counterpart: 'click.sidebar.main.navigation.item.color.background.hover',- status: 'near',- reason:- 'the token is lch(91.609 1.1023 265.86) at 0.6 alpha; the theme value is its composite on background.split',- },- 'rgb-avatar-edge': {- counterpart: 'global.color.stroke.default',- status: 'near',- reason: AVATAR_EDGE_REASON,- },- 'rgb-surface-media-overlay': {- counterpart: 'click.dialog.color.opaqueBackground.default',- status: 'near',- reason: MEDIA_SCRIM_DEPARTURE,- },- 'rgb-text-secondary': {- counterpart: 'global.color.text.muted',- status: 'mismatch',- reason: 'text.muted is 4.05:1 on feedback.danger.background, where secondary copy also sits',- },- 'rgb-text-secondary-alt': {- counterpart: 'global.color.text.muted',- status: 'mismatch',- reason: 'text.muted is 4.05:1 on feedback.danger.background, where secondary copy also sits',- },- 'rgb-text-tertiary': {- counterpart: 'global.color.text.muted',- status: 'mismatch',- reason: 'text.muted is 4.05:1 on feedback.danger.background, where secondary copy also sits',- },- 'rgb-link': {- counterpart: 'global.color.text.link.default',- status: 'mismatch',- reason: 'text.link.default is 3.84:1 on white',- },- 'rgb-link-prose': {- counterpart: 'global.color.text.link.default',- status: 'mismatch',- reason: 'text.link.default is 3.84:1 on white',- },- 'rgb-border-xheavy': {- counterpart: 'global.color.stroke.intense',- status: 'mismatch',- reason: 'stroke.intense is 2.03:1 on white, under the 3:1 a heavy edge carries',- },- 'rgb-prose-bullet': {- counterpart: 'global.color.stroke.intense',- status: 'mismatch',- reason:- 'a list marker and a quote bar are the only cue of their element, so they take the 3:1 non-text floor stroke.intense (2.03:1 on white) misses',- },- 'rgb-prose-quote-bar': {- counterpart: 'global.color.stroke.intense',- status: 'mismatch',- reason:- 'a list marker and a quote bar are the only cue of their element, so they take the 3:1 non-text floor stroke.intense (2.03:1 on white) misses',- },- 'rgb-border-control': {- counterpart: 'click.field.color.stroke.default',- status: 'mismatch',- reason: 'field.color.stroke.default misses the 3:1 non-text floor for a control edge',- },- 'rgb-status-success': {- counterpart: 'global.color.feedback.success.foreground',- status: 'mismatch',- reason: 'feedback.success.foreground is 4.27:1 on its own fill',- },- 'rgb-status-info': {- counterpart: 'global.color.feedback.info.foreground',- status: 'mismatch',- reason: 'feedback.info.foreground is 3.32:1 on its own fill',- },- 'rgb-series-2': {- counterpart: 'global.color.chart.default.orange',- status: 'mismatch',- reason: 'chart.default.orange is 2.65:1 on white, under the 3:1 a chart mark needs',- },- 'rgb-series-3': {- counterpart: 'global.color.chart.default.green',- status: 'mismatch',- reason: 'chart.default.green is 1.72:1 on white, under the 3:1 a chart mark needs',- },- 'rgb-series-5': {- counterpart: 'global.color.chart.default.yellow',- status: 'mismatch',- reason: 'chart.default.yellow is 1.19:1 on white, under the 3:1 a chart mark needs',- },- 'rgb-series-7': {- counterpart: 'global.color.chart.default.babyblue',- status: 'mismatch',- reason: 'chart.default.babyblue is 1.95:1 on white, under the 3:1 a chart mark needs',- },- 'rgb-switch-unchecked': {- counterpart: 'click.switch.color.background.default',- status: 'mismatch',- reason: 'switch.color.background.default misses the 3:1 non-text floor for the off track',- },- },- dark: {- 'rgb-surface-nav-selected': {- counterpart: 'click.sidebar.main.navigation.item.color.background.active',- status: 'near',- reason:- 'the token is lch(27.535 0 none) at 0.6 alpha; the theme value is its composite on background.split',- },- 'rgb-border-xheavy': {- counterpart: 'global.color.stroke.intense',- status: 'mismatch',- reason: 'stroke.intense is 1.62:1 on the canvas, under the 3:1 a heavy edge carries',- },- 'rgb-prose-bullet': {- counterpart: 'global.color.stroke.intense',- status: 'mismatch',- reason:- 'a list marker and a quote bar are the only cue of their element, so they take the 3:1 non-text floor stroke.intense (1.62:1 on the canvas) misses',- },- 'rgb-prose-quote-bar': {- counterpart: 'global.color.stroke.intense',- status: 'mismatch',- reason:- 'a list marker and a quote bar are the only cue of their element, so they take the 3:1 non-text floor stroke.intense (1.62:1 on the canvas) misses',- },- 'rgb-border-control': {- counterpart: 'click.field.color.stroke.default',- status: 'mismatch',- reason: 'field.color.stroke.default misses the 3:1 non-text floor for a control edge',- },- 'rgb-switch-unchecked': {- counterpart: 'click.switch.color.background.default',- status: 'mismatch',- reason: 'switch.color.background.default misses the 3:1 non-text floor for the off track',- },- 'rgb-surface-overlay': {- counterpart: 'click.dialog.color.opaqueBackground.default',- status: 'mismatch',- reason: 'the dark scrim is a #606060 gray that lifts the page instead of dimming it',- },- 'rgb-surface-media-overlay': {- counterpart: 'click.dialog.color.opaqueBackground.default',- status: 'mismatch',- reason: MEDIA_SCRIM_DEPARTURE,- },- 'rgb-alert-error-fill': {- counterpart: 'click.alert.color.background.danger',- status: 'mismatch',- reason: ALERT_ALPHA_REASON,- },- 'rgb-alert-error-border': {- counterpart: 'click.alert.color.background.danger',- status: 'mismatch',- reason: ALERT_ALPHA_REASON,- },- 'rgb-surface-tooltip': {- counterpart: 'click.tooltip.color.background.default',- status: 'near',- reason:- 'tooltip.color.background.default is the #282828 canvas in dark, which hides the chip; one step up the neutral ramp keeps white 4.5:1 and lifts it off the page',- },- 'rgb-avatar-edge': {- counterpart: 'global.color.stroke.default',- status: 'mismatch',- reason: AVATAR_EDGE_REASON,- },- },+ light: {},+ dark: {},};interface AppearanceDecision {@@ -603,13 +434,6 @@ const appearanceDecisions: Partial<Record<keyof IThemeAppearance, AppearanceDecistatus: 'match',reason: 'fill: Click UI paints disabled controls in fixed disabled tokens, never opacity',},- text2xl: {- value: '1.5rem',- token: 'typography.font.sizes.6',- status: 'mismatch',- reason:- "1.5rem: Click UI's next size, font.sizes.6 (2rem), would pass Tailwind's unthemed text-3xl (1.875rem)",- },buttonHeight: {value: '2rem',status: 'match',@@ -646,7 +470,7 @@ const appearanceDecisions: Partial<Record<keyof IThemeAppearance, AppearanceDecivalue: '24rem',status: 'mismatch',reason:- "24rem: Click UI caps its select list only at var(--radix-popover-content-available-height), which a length role cannot express, so the cap keeps LibreChat's",+ "24rem: Click UI caps its select list only at var(--radix-popover-content-available-height), which a length role cannot express, so the cap keeps LibreChat's; tracked under the not-expressible list",},iconButtonSizeSm: {value: '1.5rem',@@ -660,6 +484,12 @@ const appearanceDecisions: Partial<Record<keyof IThemeAppearance, AppearanceDecireason:'2rem: Click UI sizes its field by content, field.space.y (0.2813rem) twice, a 0.875rem/1.5 value and a 1px stroke each side',},+ fieldHeightLg: {+ value: '3.6876rem',+ status: 'match',+ reason:+ '3.6876rem: the title field is content-sized like fieldHeight, a 3rem line (typography.font.sizes.6 at line-height 1.5), field.space.y (0.2813rem) twice and a 1px stroke each side',+ },fieldFocusStyle: {value: 'border',status: 'match',@@ -741,12 +571,15 @@ const appearanceSources: Partial<Record<keyof IThemeAppearance, string>> = {textBase: 'typography.font.sizes.3',textLg: 'typography.font.sizes.4',textXl: 'typography.font.sizes.5',+ text2xl: 'typography.font.sizes.6',+ text3xl: 'typography.font.sizes.6',leadingXs: 'typography.font.line-height.1',leadingSm: 'typography.font.line-height.1',leadingBase: 'typography.font.line-height.1',leadingLg: 'typography.font.line-height.1',leadingXl: 'typography.font.line-height.1',leading2xl: 'typography.font.line-height.1',+ leading3xl: 'typography.font.line-height.1',shadow2xs: 'shadow.5',shadowXs: 'shadow.5',shadowSm: 'shadow.5',@@ -886,6 +719,23 @@ const sameRgb = (theme: string, source: Rgba) => {);};+/** The Click UI color a role holds: the token itself, or the token composited on its surface. */+function sourceColor(mode: ThemeMode, key: keyof IThemeRGB, token: string): Rgba {+ const color = clickColor(clickToken(mode, token));+ const surface = composites[mode][key];+ if (surface === undefined) {+ return color;+ }+ const [r, g, b] = clickColor(clickToken(mode, surface));+ const alpha = color[3];+ return [+ color[0] * alpha + r * (1 - alpha),+ color[1] * alpha + g * (1 - alpha),+ color[2] * alpha + b * (1 - alpha),+ 1,+ ];+}+/** sRGB channels to CIE L*a*b* under D65. */function toLab([r, g, b]: Rgba): [number, number, number] {const linear = (value: number) => {@@ -1261,9 +1111,6 @@ const parityProbes: Record<string, ParityProbe> = {kind: 'color',utility: 'border',element: inputProbe,- deviation: bothModes(- 'border-control holds form controls to the 3:1 non-text floor stroke.default misses',- ),},'Field text': {token: 'click.field.color.text.default',@@ -1282,9 +1129,6 @@ const parityProbes: Record<string, ParityProbe> = {kind: 'color',utility: 'border',element: dropdownProbe,- deviation: bothModes(- 'border-control holds form controls to the 3:1 non-text floor stroke.default misses',- ),},'Dropdown trigger corner': {token: 'border.radii.1',@@ -1345,9 +1189,6 @@ const parityProbes: Record<string, ParityProbe> = {kind: 'color',utility: 'bg',element: dialogProbe('.inset-0'),- deviation: {- dark: 'surface-overlay keeps the dark scrim black; Click UI #606060 lifts the page it covers',- },},'Dialog inline padding': {token: 'click.dialog.space.x',@@ -1374,10 +1215,6 @@ const parityProbes: Record<string, ParityProbe> = {utility: 'bg',variant: 'data-[state=unchecked]:',element: switchProbe(false),- deviation: {- light: 'switch-unchecked holds the off track to the 3:1 non-text floor #cccfd3 misses',- dark: 'switch-unchecked holds the off track to the 3:1 non-text floor #606060 misses',- },},'Switch thumb': {token: 'click.switch.color.indicator.default',@@ -1430,10 +1267,6 @@ const parityProbes: Record<string, ParityProbe> = {kind: 'color',utility: 'border',element: checkboxProbe(false),- deviation: {- light: 'border-xheavy holds the box edge to the 3:1 non-text floor #b3b6bd misses',- dark: 'border-xheavy holds the box edge to the 3:1 non-text floor #414141 misses',- },},'Checkbox corner': {token: 'click.checkbox.radii.all',@@ -1523,6 +1356,8 @@ const parityProbes: Record<string, ParityProbe> = {interface NotExpressible {/** The parity decisions the gap leaves unmatched, per mode. */decisions: Partial<Record<ThemeMode, string[]>>;+ /** The appearance roles the gap leaves unmatched, in both modes. */+ appearance?: Array<keyof IThemeAppearance>;/** Why no theme can reach Click UI's value today. */reason: string;/** The berry-13/LibreChat issue that tracks the role or change that closes it. */@@ -1542,6 +1377,13 @@ const notExpressible: Record<string, NotExpressible> = {'the checkbox paints no fill of its own and shows the surface behind it; no role carries checkbox.color.background.default',issue: 'https://github.com/berry-13/LibreChat/issues/250',},+ 'Select list height': {+ decisions: {},+ appearance: ['listMaxHeight'],+ reason:+ "Click UI caps its select list only at var(--radix-popover-content-available-height), which a length role cannot express, so listMaxHeight keeps LibreChat's 24rem",+ issue: 'https://github.com/berry-13/LibreChat/issues/282',+ },'Checkbox corner': {decisions: { light: ['Checkbox corner'], dark: ['Checkbox corner'] },reason:@@ -1775,10 +1617,11 @@ function roleStatuses(mode: ThemeMode): Array<[keyof IThemeRGB, RoleStatus, striconst departure = departures[mode][key];const token = departure?.counterpart ?? colorSources[mode][key];if (token === undefined) {- return [key, 'mismatch', 'unsourced'];+ const reason = unsourcedColors[mode][key];+ return [key, reason === undefined ? 'mismatch' : 'unsourced', reason ?? 'unsourced'];}const theme = tripletRgba(colors[key] ?? '');- const counterpart = clickColor(clickToken(mode, token));+ const counterpart = sourceColor(mode, key, token);const distance = deltaE(theme, counterpart);const departed: RoleStatus = distance < NEAR ? 'near' : 'mismatch';const status = sameRgb(colors[key] ?? '', counterpart) ? 'match' : departed;@@ -1840,7 +1683,7 @@ describe('ClickHouse theme drift against Click UI', () => {return [`${key}: Click UI token ${token} is not in clickui.json`];}const theme = colors[key as keyof IThemeRGB] ?? '';- return sameRgb(theme, parseColor(String(source)))+ return sameRgb(theme, sourceColor(mode, key as keyof IThemeRGB, token))? []: [`${key}: theme ${theme}, Click UI ${token} is ${source}`];});@@ -1892,6 +1735,7 @@ describe('ClickHouse theme drift against Click UI', () => {it.each(modes)('keeps only the %s tokens the theme cites in the snapshot', (mode) => {const cited = new Set([...Object.values(colorSources[mode]),+ ...Object.values(composites[mode]),...Object.values(departures[mode]).map((departure) => departure.counterpart),...Object.values(appearanceSources),...Object.keys(clickSpaces),@@ -1942,9 +1786,10 @@ describe('ClickHouse primitive parity against Click UI components', () => {it('keeps the not-expressible list to real, tracked, unmatched decisions', () => {const problems = Object.entries(notExpressible).flatMap(- ([gap, { decisions, reason, issue }]) => [+ ([gap, { decisions, appearance = [], reason, issue }]) => [...(reason.trim() === '' ? [`${gap}: no reason`] : []),- ...(Object.values(decisions).some((listed) => (listed?.length ?? 0) > 0)+ ...(appearance.length > 0 ||+ Object.values(decisions).some((listed) => (listed?.length ?? 0) > 0)? []: [`${gap}: names no decision`]),...(/^https:\/\/github\.com\/berry-13\/LibreChat\/issues\/\d+$/.test(issue)@@ -1985,7 +1830,10 @@ describe('ClickHouse primitive parity against Click UI components', () => {]);const moved = statuses.flatMap(([key, status]) => {- const pinned = departures[mode][key]?.status ?? 'match';+ const pinned =+ unsourcedColors[mode][key] === undefined+ ? (departures[mode][key]?.status ?? 'match')+ : 'unsourced';return status === pinned ? [] : [`${key}: pinned ${pinned}, measures ${status}`];});const stale = Object.keys(departures[mode]).filter(@@ -2008,10 +1856,9 @@ describe('ClickHouse primitive parity against Click UI components', () => {});expect(moved).toEqual([]);- expect(statuses.filter(([, status]) => status === 'mismatch').map(([key]) => key)).toEqual([- 'listMaxHeight',- 'text2xl',- ]);+ expect(statuses.filter(([, status]) => status === 'mismatch').map(([key]) => key)).toEqual(+ Object.values(notExpressible).flatMap(({ appearance = [] }) => appearance),+ );expect(statuses.filter(([, status]) => status === 'near').map(([key]) => key)).toEqual([]);});});diff --git a/packages/client/src/theme/themes/dark.ts b/packages/client/src/theme/themes/dark.tsindex fa6aca95fa..cd01c6699d 100644--- a/packages/client/src/theme/themes/dark.ts+++ b/packages/client/src/theme/themes/dark.ts@@ -106,6 +106,7 @@ export const darkTheme: IThemeRGB = {'rgb-border-menu': '33 33 33', // matching border-light'rgb-surface-composer': '47 47 47', // matching surface-chat'rgb-surface-search': '33 33 33', // matching surface-secondary+ 'rgb-surface-sidebar': '23 23 23', // matching surface-primary-alt'rgb-surface-disabled': '47 47 47', // #2f2f2f (gray-700)'rgb-text-disabled': '153 150 150', // #999696 (gray-400)'rgb-border-disabled': '57 57 57', // #393939 (gray-650)diff --git a/packages/client/src/theme/themes/default.ts b/packages/client/src/theme/themes/default.tsindex 1cdeb21a6a..e53f9e9394 100644--- a/packages/client/src/theme/themes/default.ts+++ b/packages/client/src/theme/themes/default.ts@@ -106,6 +106,7 @@ export const defaultTheme: IThemeRGB = {'rgb-border-menu': '227 227 227', // matching border-light'rgb-surface-composer': '255 255 255', // matching surface-chat'rgb-surface-search': '247 247 248', // matching surface-secondary+ 'rgb-surface-sidebar': '247 247 248', // matching surface-primary-alt'rgb-surface-disabled': '236 236 236', // #ececec (gray-100)'rgb-text-disabled': '153 150 150', // #999696 (gray-400)'rgb-border-disabled': '227 227 227', // #e3e3e3 (gray-200)diff --git a/packages/client/src/theme/themes/highContrast.ts b/packages/client/src/theme/themes/highContrast.tsindex 455b906b77..15ff324da7 100644--- a/packages/client/src/theme/themes/highContrast.ts+++ b/packages/client/src/theme/themes/highContrast.ts@@ -142,6 +142,7 @@ export const highContrastLightTheme: IThemeRGB = {'rgb-border-menu': '0 0 0', // matching border-light'rgb-surface-composer': '255 255 255', // matching surface-chat'rgb-surface-search': '255 255 255', // matching surface-secondary+ 'rgb-surface-sidebar': '255 255 255', // matching surface-primary-alt'rgb-surface-disabled': '255 255 255', // #ffffff'rgb-text-disabled': '87 87 87', // #575757'rgb-border-disabled': '87 87 87', // #575757@@ -342,6 +343,7 @@ export const highContrastDarkTheme: IThemeRGB = {'rgb-border-menu': '255 255 255', // matching border-light'rgb-surface-composer': '0 0 0', // matching surface-chat'rgb-surface-search': '0 0 0', // matching surface-secondary+ 'rgb-surface-sidebar': '0 0 0', // matching surface-primary-alt'rgb-surface-disabled': '0 0 0', // #000000'rgb-text-disabled': '184 184 184', // #b8b8b8'rgb-border-disabled': '184 184 184', // #b8b8b8diff --git a/packages/client/src/theme/tokens.css b/packages/client/src/theme/tokens.cssindex d95db59fb4..b10794a92a 100644--- a/packages/client/src/theme/tokens.css+++ b/packages/client/src/theme/tokens.css@@ -158,6 +158,7 @@);--color-surface-composer: rgb(var(--surface-composer));--color-surface-search: rgb(var(--surface-search));+ --color-surface-sidebar: rgb(var(--surface-sidebar));--color-border-disabled: rgb(var(--border-disabled));/* status */@@ -246,6 +247,8 @@--text-2xs: var(--theme-text-2xs);--text-1xs: var(--theme-text-1xs);--text-1sm: var(--theme-text-1sm);+ --text-3xl: var(--theme-text-3xl);+ --text-3xl--line-height: var(--theme-text-3xl-leading);--shadow: var(--theme-shadow-sm);--shadow-2xs: var(--theme-shadow-2xs);--shadow-xs: var(--theme-shadow-xs);diff --git a/packages/client/src/theme/types/index.ts b/packages/client/src/theme/types/index.tsindex c7d8a75718..b954b5c63a 100644--- a/packages/client/src/theme/types/index.ts+++ b/packages/client/src/theme/types/index.ts@@ -139,6 +139,7 @@ export interface IThemeRGB {'rgb-border-menu'?: string;'rgb-surface-composer'?: string;'rgb-surface-search'?: string;+ 'rgb-surface-sidebar'?: string;/** Disabled fill, ink and edge. Painted only under the `fill` disabled style. */'rgb-surface-disabled'?: string;'rgb-text-disabled'?: string;@@ -348,6 +349,7 @@ export interface IThemeVariables {'--border-menu': string;'--surface-composer': string;'--surface-search': string;+ '--surface-sidebar': string;'--surface-disabled': string;'--text-disabled': string;'--border-disabled': string;@@ -507,6 +509,7 @@ export interface IThemeColors {'border-menu'?: string;'surface-composer'?: string;'surface-search'?: string;+ 'surface-sidebar'?: string;'surface-disabled'?: string;'text-disabled'?: string;'border-disabled'?: string;@@ -684,12 +687,14 @@ export interface IThemeAppearance {text2xs: string;text1xs: string;text1sm: string;+ text3xl: string;leadingXs: string;leadingSm: string;leadingBase: string;leadingLg: string;leadingXl: string;leading2xl: string;+ leading3xl: string;/*** An OGDialog's edge stroke width (painted in `border-light`), inline padding and title to* description gap, and its title's size, leading, weight and family. The title follows `textLg`diff --git a/packages/data-provider/src/theme.ts b/packages/data-provider/src/theme.tsindex 642a60dba0..04932c2ae3 100644--- a/packages/data-provider/src/theme.ts+++ b/packages/data-provider/src/theme.ts@@ -104,6 +104,7 @@ export const themeColorTokens = Object.freeze(['rgb-border-menu','rgb-surface-composer','rgb-surface-search',+ 'rgb-surface-sidebar','rgb-surface-disabled','rgb-text-disabled','rgb-border-disabled',@@ -475,12 +476,14 @@ const appearanceValidators = {text2xs: isLength,text1xs: isLength,text1sm: isLength,+ text3xl: isLength,leadingXs: isLineHeight,leadingSm: isLineHeight,leadingBase: isLineHeight,leadingLg: isLineHeight,leadingXl: isLineHeight,leading2xl: isLineHeight,+ leading3xl: isLineHeight,/** A dialog's edge stroke width, inline padding and title-to-description gap, and its title's* size, leading, weight and family. */dialogStroke: isLength,@@ -529,7 +532,7 @@ export const themeAppearanceTokens = Object.freeze(* Bumped by hand when a release changes what resolving a theme emits without changing its roles* (a palette value, a fallback derivation, an emitted attribute), so cached entries are rebuilt.*/-export const THEME_CACHE_EPOCH = 1 as const;+export const THEME_CACHE_EPOCH = 2 as const;/*** Names the role set a stored resolved theme was built against: any color, brand or appearance