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
🎨 feat: Check Color Tokens and Class Existence (#16041)
Marco Beretta1e7b4a9bbd36
diff --git a/Dockerfile.multi b/Dockerfile.multiindex 29bc9d88c4..57c6e9b5b9 100644--- a/Dockerfile.multi+++ b/Dockerfile.multi@@ -86,6 +86,7 @@ COPY --from=data-provider-build /app/packages/data-provider/dist /app/packages/dCOPY --from=client-package-build /app/packages/client/dist /app/packages/client/distCOPY --from=client-package-build /app/packages/client/src /app/packages/client/srcCOPY --from=client-package-build /app/packages/client/tailwind.preset.cjs /app/packages/client/tailwind.preset.cjs+COPY --from=client-package-build /app/packages/client/tailwind.compat.cjs /app/packages/client/tailwind.compat.cjsARG NODE_MAX_OLD_SPACE_SIZEENV NODE_OPTIONS="--max-old-space-size=${NODE_MAX_OLD_SPACE_SIZE}"RUN npm run builddiff --git a/client/src/components/Agents/CategoryTabs.tsx b/client/src/components/Agents/CategoryTabs.tsxindex 89509d7d67..db7b502154 100644--- a/client/src/components/Agents/CategoryTabs.tsx+++ b/client/src/components/Agents/CategoryTabs.tsx@@ -117,7 +117,7 @@ const CategoryTabs: React.FC<CategoryTabsProps> = ({<divclassName={cn(isSmallScreen- ? 'scrollbar-hide flex gap-1.5 overflow-x-auto'+ ? 'hide-scrollbar flex gap-1.5 overflow-x-auto': 'flex flex-wrap justify-start gap-1.5',)}role="tablist"diff --git a/client/src/components/Auth/LoginForm.tsx b/client/src/components/Auth/LoginForm.tsxindex 8a42928650..d9682a1e16 100644--- a/client/src/components/Auth/LoginForm.tsx+++ b/client/src/components/Auth/LoginForm.tsx@@ -37,7 +37,7 @@ const LoginForm: React.FC<TLoginFormProps> = ({ onSubmit, startupConfig, error,? `${baseAutoComplete} webauthn`: baseAutoComplete;const authInputClassName =- 'webkit-dark-styles transition-color peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus-visible:border-accent-primary';+ 'webkit-dark-styles peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus-visible:border-accent-primary';const authSecretInputClassName = `${authInputClassName} pr-12`;const authLabelClassName ='absolute start-3 top-1.5 z-10 origin-[0] -translate-y-4 scale-75 transform bg-surface-primary px-2 text-sm text-text-secondary-alt duration-200 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-1.5 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-accent-primary rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4';@@ -102,6 +102,7 @@ const LoginForm: React.FC<TLoginFormProps> = ({ onSubmit, startupConfig, error,<div className="mb-4"><div className="relative"><Input+ colorTransitiontype="text"id="email"autoComplete={emailAutoComplete}@@ -128,6 +129,7 @@ const LoginForm: React.FC<TLoginFormProps> = ({ onSubmit, startupConfig, error,<div className="mb-2"><div className="relative"><SecretInput+ colorTransitionid="password"autoComplete="current-password"aria-label={localize('com_auth_password')}diff --git a/client/src/components/Auth/Registration.tsx b/client/src/components/Auth/Registration.tsxindex 08328149ac..0f75bfd7e1 100644--- a/client/src/components/Auth/Registration.tsx+++ b/client/src/components/Auth/Registration.tsx@@ -38,7 +38,7 @@ const Registration: React.FC = () => {// only require captcha if we have a siteKeyconst requireCaptcha = Boolean(startupConfig?.turnstile?.siteKey);const authInputClassName =- 'webkit-dark-styles transition-color peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus-visible:border-accent-primary';+ 'webkit-dark-styles peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus-visible:border-accent-primary';const authSecretInputClassName = `${authInputClassName} pr-12`;const authLabelClassName ='absolute start-3 top-1.5 z-10 origin-[0] -translate-y-4 scale-75 transform bg-surface-primary px-2 text-sm text-text-secondary-alt duration-200 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-1.5 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-accent-primary rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4';@@ -84,6 +84,7 @@ const Registration: React.FC = () => {<div className="relative">{type === 'password' ? (<SecretInput+ colorTransitionid={id}autoComplete={id}aria-label={fieldLabel}@@ -100,6 +101,7 @@ const Registration: React.FC = () => {) : (<><Input+ colorTransitionid={id}type={type}autoComplete={id}diff --git a/client/src/components/Auth/RequestPasswordReset.tsx b/client/src/components/Auth/RequestPasswordReset.tsxindex 679c6c97db..2fa0556028 100644--- a/client/src/components/Auth/RequestPasswordReset.tsx+++ b/client/src/components/Auth/RequestPasswordReset.tsx@@ -90,6 +90,7 @@ function RequestPasswordReset() {<div className="space-y-2"><div className="relative"><Input+ colorTransitiontype="email"id="email"autoComplete="off"@@ -110,7 +111,7 @@ function RequestPasswordReset() {},})}aria-invalid={!!errors.email}- className="webkit-dark-styles transition-color peer border-border-light bg-surface-primary text-text-primary focus:border-accent-primary h-auto w-full rounded-2xl border px-3.5 pt-3 pb-2.5 duration-200"+ className="webkit-dark-styles peer border-border-light bg-surface-primary text-text-primary focus:border-accent-primary h-auto w-full rounded-2xl border px-3.5 pt-3 pb-2.5 duration-200"placeholder=" "/><labeldiff --git a/client/src/components/Auth/ResetPassword.tsx b/client/src/components/Auth/ResetPassword.tsxindex 582fa1c538..b4e4026518 100644--- a/client/src/components/Auth/ResetPassword.tsx+++ b/client/src/components/Auth/ResetPassword.tsx@@ -21,7 +21,7 @@ function ResetPassword() {const resetPassword = useResetPasswordMutation();const { setError, setHeaderText, startupConfig } = useOutletContext<TLoginLayoutContext>();const authInputClassName =- 'webkit-dark-styles transition-color peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pr-12 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus-visible:border-accent-primary';+ 'webkit-dark-styles peer h-auto w-full rounded-2xl border border-border-light bg-surface-primary px-3.5 pb-2.5 pr-12 pt-3 text-text-primary duration-200 hover:border-border-light focus:border-accent-primary focus-visible:border-accent-primary';const authLabelClassName ='absolute start-3 top-1.5 z-10 origin-[0] -translate-y-4 scale-75 transform bg-surface-primary px-2 text-sm text-text-secondary-alt duration-200 peer-placeholder-shown:top-1/2 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:scale-100 peer-focus:top-1.5 peer-focus:-translate-y-4 peer-focus:scale-75 peer-focus:px-2 peer-focus:text-accent-primary rtl:peer-focus:left-auto rtl:peer-focus:translate-x-1/4';const authSecretButtonClassName =@@ -84,6 +84,7 @@ function ResetPassword() {{...register('userId', { required: 'Unable to process: No valid user id' })}/><SecretInput+ colorTransitionid="password"autoComplete="current-password"aria-label={localize('com_auth_password')}@@ -117,6 +118,7 @@ function ResetPassword() {<div className="mb-2"><div className="relative"><SecretInput+ colorTransitionid="confirm_password"aria-label={localize('com_auth_password_confirm')}{...register('confirm_password', {diff --git a/client/src/components/Chat/Input/ActiveSetting.tsx b/client/src/components/Chat/Input/ActiveSetting.tsxdeleted file mode 100644index 24f8791ffa..0000000000--- a/client/src/components/Chat/Input/ActiveSetting.tsx+++ /dev/null@@ -1,8 +0,0 @@-export default function ActiveSetting() {- return (- <div className="text-token-text-tertiary space-x-2 overflow-hidden text-ellipsis text-sm font-light">- Talking to{' '}- <span className="text-token-text-secondary font-medium">[latest] Tailwind CSS GPT</span>- </div>- );-}diff --git a/client/src/components/Chat/Input/AddedConvo.tsx b/client/src/components/Chat/Input/AddedConvo.tsxindex 0b9d692842..4a5fc71d37 100644--- a/client/src/components/Chat/Input/AddedConvo.tsx+++ b/client/src/components/Chat/Input/AddedConvo.tsx@@ -50,11 +50,9 @@ export default function AddedConvo({/></div></span>- <span className="text-token-text-secondary line-clamp-3 flex-1 py-0.5 font-semibold">- {title}- </span>+ <span className="text-text-secondary line-clamp-3 flex-1 py-0.5 font-semibold">{title}</span><button- className="text-token-text-secondary shrink-0"+ className="text-text-secondary shrink-0"type="button"aria-label="Close added conversation"onClick={() => setAddedConvo(null)}diff --git a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx b/client/src/components/Chat/Input/AskUserQuestionPopover.tsxindex 246850bd25..53b53cbb75 100644--- a/client/src/components/Chat/Input/AskUserQuestionPopover.tsx+++ b/client/src/components/Chat/Input/AskUserQuestionPopover.tsx@@ -55,9 +55,9 @@ function AskUserQuestionsPopoverPanel({ ask }: { ask: ReturnType<typeof useAskAnreturn (<div className="absolute bottom-28 z-10 w-full">- <div className="popover border-token-border-light flex max-h-[70vh] flex-col rounded-2xl border bg-surface-primary-alt shadow-lg">- <div className="flex shrink-0 items-center justify-between gap-2 border-b border-border-light px-3 py-2">- <p className="text-sm font-medium text-text-primary">+ <div className="popover border-border-light bg-surface-primary-alt flex max-h-[70vh] flex-col rounded-2xl border shadow-lg">+ <div className="border-border-light flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2">+ <p className="text-text-primary text-sm font-medium">{localize(questions.length === 1 ? 'com_ui_asking_questions_one' : 'com_ui_asking_questions',{ 0: questions.length },@@ -71,7 +71,7 @@ function AskUserQuestionsPopoverPanel({ ask }: { ask: ReturnType<typeof useAskAnvariant="ghost"size="icon"aria-label={localize('com_ui_ask_move_to_chat')}- className="size-auto rounded-md p-1 text-text-secondary"+ className="text-text-secondary size-auto rounded-md p-1"onClick={collapse}><ChevronDown className="size-4" aria-hidden="true" />@@ -156,16 +156,16 @@ function AskUserQuestionPopoverPanel({scroll region: the panel is absolutely positioned, so anything thatoverflows it is unreachable by page scroll. */}<div- className="popover border-token-border-light flex max-h-[60vh] flex-col rounded-2xl border bg-surface-primary-alt p-2 shadow-lg [view-transition-name:ask-question]"+ className="popover border-border-light bg-surface-primary-alt flex max-h-[60vh] flex-col rounded-2xl border p-2 shadow-lg [view-transition-name:ask-question]"onKeyDown={handlePopoverKeyDown}><div className="flex shrink-0 items-start justify-between gap-2 p-2"><div className="max-h-[24vh] min-w-0 overflow-y-auto">- <p className="text-sm font-medium text-text-primary [overflow-wrap:anywhere]">+ <p className="text-text-primary text-sm font-medium [overflow-wrap:anywhere]">{liveAsk.question.question}</p>{liveAsk.question.description != null && liveAsk.question.description.length > 0 && (- <p className="mt-1 text-sm text-text-secondary [overflow-wrap:anywhere]">+ <p className="text-text-secondary mt-1 text-sm [overflow-wrap:anywhere]">{liveAsk.question.description}</p>)}@@ -180,7 +180,7 @@ function AskUserQuestionPopoverPanel({variant="ghost"size="icon"aria-label={localize('com_ui_ask_move_to_chat')}- className="size-auto rounded-md p-1 text-text-secondary"+ className="text-text-secondary size-auto rounded-md p-1"onClick={collapse}><ChevronDown className="size-4" aria-hidden="true" />@@ -203,7 +203,7 @@ function AskUserQuestionPopoverPanel({* enabled), but the chat card that would show the error is hidden* while the popover is up — so surface it here for retry guidance. */}{errored && (- <div className="flex shrink-0 items-center gap-1.5 px-2 pt-1 text-xs text-text-warning">+ <div className="text-text-warning flex shrink-0 items-center gap-1.5 px-2 pt-1 text-xs"><TriangleAlert className="h-4 w-4 shrink-0" aria-hidden="true" />{localize('com_ui_ask_answer_error')}</div>@@ -215,7 +215,7 @@ function AskUserQuestionPopoverPanel({should still come from the recipe. */}<Buttonvariant="ghost"- className="h-auto cursor-text rounded-md p-0 text-xs font-normal text-text-secondary hover:bg-transparent hover:text-text-primary"+ className="text-text-secondary hover:text-text-primary h-auto cursor-text rounded-md p-0 text-xs font-normal hover:bg-transparent"onClick={() => textAreaRef?.current?.focus()}>{options.length === 0diff --git a/client/src/components/Chat/Input/EditBadges.tsx b/client/src/components/Chat/Input/EditBadges.tsxindex 8072326afc..dcf5bb471f 100644--- a/client/src/components/Chat/Input/EditBadges.tsx+++ b/client/src/components/Chat/Input/EditBadges.tsx@@ -41,7 +41,7 @@ const EditBadgesComponent = ({<Edit3 className="icon-md" aria-hidden="true" /></div></span>- <span className="text-token-text-secondary line-clamp-3 flex-1 py-0.5 font-semibold">+ <span className="text-text-secondary line-clamp-3 flex-1 py-0.5 font-semibold">{localize('com_ui_save_badge_changes')}</span><div className="flex h-8 gap-2">diff --git a/client/src/components/Chat/Input/Mention.tsx b/client/src/components/Chat/Input/Mention.tsxindex f2da1fde52..94de4e17d2 100644--- a/client/src/components/Chat/Input/Mention.tsx+++ b/client/src/components/Chat/Input/Mention.tsx@@ -181,7 +181,7 @@ function MentionContent({return (<div className="absolute bottom-28 z-10 w-full space-y-2">- <div className="popover border-token-border-light bg-surface-secondary rounded-2xl border p-2 shadow-lg">+ <div className="popover border-border-light bg-surface-secondary rounded-2xl border p-2 shadow-lg"><Inputref={initInputRef}placeholder={localize(placeholder)}diff --git a/client/src/components/Chat/Input/MentionItem.tsx b/client/src/components/Chat/Input/MentionItem.tsxindex a16ffc37ea..e89c046de4 100644--- a/client/src/components/Chat/Input/MentionItem.tsx+++ b/client/src/components/Chat/Input/MentionItem.tsx@@ -34,7 +34,7 @@ export default function MentionItem({><divclassName={cn(- 'text-token-text-primary group hover:bg-surface-secondary active:bg-surface-active flex min-h-[44px] items-center gap-2 rounded-lg px-2 text-sm font-medium',+ 'text-text-primary group hover:bg-surface-secondary active:bg-surface-active flex min-h-[44px] items-center gap-2 rounded-lg px-2 text-sm font-medium',isActive === true ? 'bg-surface-active' : 'bg-transparent',)}>@@ -43,9 +43,7 @@ export default function MentionItem({<div className="truncate"><span className="font-medium">{name}</span>{description != null && description ? (- <span className="text-token-text-tertiary ml-2 text-sm font-light">- {description}- </span>+ <span className="text-text-tertiary ml-2 text-sm font-light">{description}</span>) : null}</div><Clock4 size={16} className="ml-2 shrink-0" />diff --git a/client/src/components/Chat/Input/PromptsCommand.tsx b/client/src/components/Chat/Input/PromptsCommand.tsxindex 6f5bbc746f..f4a52534c3 100644--- a/client/src/components/Chat/Input/PromptsCommand.tsx+++ b/client/src/components/Chat/Input/PromptsCommand.tsx@@ -216,7 +216,7 @@ function PromptsCommand({textAreaRef={textAreaRef}><div className="absolute bottom-28 z-10 w-full space-y-2">- <div className="popover border-token-border-light bg-surface-tertiary-alt rounded-2xl border p-2 shadow-lg">+ <div className="popover border-border-light bg-surface-tertiary-alt rounded-2xl border p-2 shadow-lg"><Inputref={initInputRef}placeholder={localize('com_ui_command_usage_placeholder')}diff --git a/client/src/components/Chat/Input/SkillsCommand.tsx b/client/src/components/Chat/Input/SkillsCommand.tsxindex cc6ac6e72d..e9b7a23ca3 100644--- a/client/src/components/Chat/Input/SkillsCommand.tsx+++ b/client/src/components/Chat/Input/SkillsCommand.tsx@@ -285,7 +285,7 @@ function SkillsCommandContent({return (<div className="absolute bottom-28 z-10 w-full space-y-2">- <div className="popover border-token-border-light bg-surface-tertiary-alt rounded-2xl border p-2 shadow-lg">+ <div className="popover border-border-light bg-surface-tertiary-alt rounded-2xl border p-2 shadow-lg"><Inputref={initInputRef}placeholder={localize('com_ui_skills_command_placeholder')}diff --git a/client/src/components/Chat/Menus/BookmarkMenu.tsx b/client/src/components/Chat/Menus/BookmarkMenu.tsxindex 9f470161e3..779f694b27 100644--- a/client/src/components/Chat/Menus/BookmarkMenu.tsx+++ b/client/src/components/Chat/Menus/BookmarkMenu.tsx@@ -51,7 +51,7 @@ const BookmarkMenu: FC = () => {aria-label={triggerAriaLabel}aria-pressed={hasBookmarks}className={cn(- 'mt-text-sm border-border-light bg-presentation hover:bg-surface-hover flex size-9 shrink-0 items-center justify-center gap-2 rounded-xl border text-sm transition-colors duration-200',+ 'border-border-light bg-presentation hover:bg-surface-hover flex size-9 shrink-0 items-center justify-center gap-2 rounded-xl border text-sm transition-colors duration-200',isMenuOpen ? 'bg-surface-hover' : '',)}data-testid="bookmark-menu"diff --git a/client/src/components/Chat/Menus/UI/MenuItem.tsx b/client/src/components/Chat/Menus/UI/MenuItem.tsxindex 96934a82de..ab4cdfbd3d 100644--- a/client/src/components/Chat/Menus/UI/MenuItem.tsx+++ b/client/src/components/Chat/Menus/UI/MenuItem.tsx@@ -59,7 +59,7 @@ const MenuItem: FC<MenuItemProps> = ({{icon != null ? icon : null}<div className={cn('truncate', textClassName)}>{title}- <div className="text-token-text-tertiary">{description}</div>+ <div className="text-text-tertiary">{description}</div></div></div></div>diff --git a/client/src/components/Chat/Menus/UI/TitleButton.tsx b/client/src/components/Chat/Menus/UI/TitleButton.tsxindex 8474cd1856..f03c93e94e 100644--- a/client/src/components/Chat/Menus/UI/TitleButton.tsx+++ b/client/src/components/Chat/Menus/UI/TitleButton.tsx@@ -20,9 +20,9 @@ export default function TitleButton({ primaryText = '', secondaryText = '' }) {><div><span className="text-text-primary"> {primaryText} </span>- {!!secondaryText && <span className="text-token-text-secondary">{secondaryText}</span>}+ {!!secondaryText && <span className="text-text-secondary">{secondaryText}</span>}</div>- <ChevronDown className="text-token-text-secondary size-4" aria-hidden="true" />+ <ChevronDown className="text-text-secondary size-4" aria-hidden="true" /></button></Trigger>);diff --git a/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx b/client/src/components/Chat/Messages/Content/Parts/BashCall.tsxindex a837c4f500..c43fad1b57 100644--- a/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/BashCall.tsx@@ -169,7 +169,11 @@ export default function BashCall({)}>{command && (- <div className="bg-surface-tertiary relative dark:bg-gray-950">+ // The command is a code surface, so it takes the role every other one takes+ // (`DiffView`, the user-turn code bars) instead of a palette shade a theme+ // cannot reach: the previous `dark:bg-gray-950` was Tailwind's blue-black,+ // outside this palette entirely.+ <div className="bg-surface-code relative"><CopyButtoniconOnlyisCopied={isCopied}diff --git a/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsx b/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsxindex 01db1f03e5..cd7cf6a0f4 100644--- a/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsx+++ b/client/src/components/Chat/Messages/Content/Parts/PendingSkillCall.tsx@@ -35,9 +35,9 @@ export default function PendingSkillCall({return (<div className={TOOL_ROW_CLASSES}>- <div className="progress-text-wrapper text-token-text-secondary relative -mt-[0.75px] h-5 w-full leading-5">+ <div className="progress-text-wrapper text-text-secondary relative -mt-[0.75px] h-5 w-full leading-5"><div- className="progress-text-content absolute left-0 right-0 top-0 max-w-full overflow-visible whitespace-nowrap"+ className="progress-text-content absolute top-0 right-0 left-0 max-w-full overflow-visible whitespace-nowrap"style={{ opacity: 1, transform: 'none' }}><div className="inline-flex w-full items-center gap-2">@@ -45,7 +45,7 @@ export default function PendingSkillCall({* finalizes; sharing its glyph slot keeps that swap still. */}<span className={ROW_GLYPH_SLOT} aria-hidden="true"><ScrollText- className={cn('size-4 shrink-0 text-text-secondary', !loaded && 'animate-pulse')}+ className={cn('text-text-secondary size-4 shrink-0', !loaded && 'animate-pulse')}/></span><span className={cn(!loaded && 'shimmer', 'min-w-0 truncate font-medium')}>{text}</span>diff --git a/client/src/components/Chat/Messages/Content/ProgressText.tsx b/client/src/components/Chat/Messages/Content/ProgressText.tsxindex d4dc702a2e..99bb484a0b 100644--- a/client/src/components/Chat/Messages/Content/ProgressText.tsx+++ b/client/src/components/Chat/Messages/Content/ProgressText.tsx@@ -13,7 +13,7 @@ import { ROW_GLYPH_SLOT } from './rows';import { useLocalize } from '~/hooks';const wrapperClass =- 'progress-text-wrapper text-token-text-secondary relative -mt-[0.75px] h-5 w-full leading-5';+ 'progress-text-wrapper text-text-secondary relative -mt-[0.75px] h-5 w-full leading-5';/** `right-0` and `max-w-full` cap the absolutely-positioned line at the message* column; the label span truncates itself, so overflow stays visible for the@@ -79,7 +79,7 @@ export default function ProgressText({}: {/*** The card's settled state, resolved once by the caller via- * `resolveToolCallPhase`. Replaces the former `error` + `errorSuffix`+ * `resolveToolCallPhase`. Replaces the former `error`+ `errorSuffix`* pair, which encoded three terminal states in two booleans — `error`* meant cancelled, a present `errorSuffix` meant failed, and every* consumer had to reconstruct the distinction. That shape is what let a@@ -213,24 +213,12 @@ export default function ProgressText({</span>)}{/* The label names the card and stays whole; a subtitle can be- arbitrary authored text (a question, an error line), so it takes- ALL of the shrink and ellipsizes instead of pushing the line past- the message column. All, not most: a weighted share left the label- a fraction of a pixel short of its text, and that fraction is- enough for `truncate` to swap its last letters for an ellipsis.- The pair sits in its own shrinking box so the verdict, the- duration and the chevron after it never lose width: the box gives- up the subtitle first, and a label wider than the box truncates at- the box (`max-w-full`), not past the row. */}- <span className="flex min-w-0 items-center gap-2">- <span- className={cn(- showShimmer ? 'shimmer' : '',- 'min-w-0 max-w-full truncate font-medium',- subtitle && 'shrink-0',- )}- >- {text}+ arbitrary authored text (a question, a server name), so it takes+ essentially all of the shrink and ellipsizes instead of pushing+ the line past the message column. */}+ {subtitle && (+ <span className="text-text-secondary min-w-0 shrink-[100] truncate font-normal">+ {subtitle}</span>{subtitle && (<span className="min-w-0 shrink truncate font-normal text-text-secondary">@@ -241,13 +229,17 @@ export default function ProgressText({{errorSuffix && (<span className="shrink-0 font-normal text-status-error">· {errorSuffix}</span>)}- {isRunning && phaseStartAt != null && localPhaseStart != null && (- <ElapsedTimer start={localPhaseStart} />- )}- {durationParts.map(({ label, duration }) => (- <span key={label} className="shrink-0 font-normal text-text-secondary">- <span aria-hidden="true">- · {label} {localize(duration.key, duration.values)}+ {errorSuffix && <span className="text-status-error font-normal">· {errorSuffix}</span>}+ {duration && (+ <>+ {/* The compact form is the readable one on screen but a poor+ thing to hear ("one point four s"), so it is hidden from+ assistive technology and paired with a spoken equivalent.+ Both live inside the button, so its accessible name carries+ the duration — this is not an `aria-live` region and does not+ re-announce. */}+ <span className="text-text-secondary font-normal" aria-hidden="true">+ · {localize(duration.key, duration.values)}</span><span className="sr-only">{label} {localize(duration.announcedKey, duration.announcedValues)}diff --git a/client/src/components/Chat/Messages/Feedback.tsx b/client/src/components/Chat/Messages/Feedback.tsxindex 5db87e64bf..9950b02459 100644--- a/client/src/components/Chat/Messages/Feedback.tsx+++ b/client/src/components/Chat/Messages/Feedback.tsx@@ -61,8 +61,8 @@ function FeedbackOptionButton({<Buttonvariant="ghost"className={cn(- 'h-auto w-full justify-start gap-3 rounded-xl p-2 text-text-secondary transition-colors duration-200 hover:bg-surface-hover hover:text-text-primary',- active && 'bg-surface-hover font-semibold text-text-primary',+ 'text-text-secondary hover:bg-surface-hover hover:text-text-primary h-auto w-full justify-start gap-3 rounded-xl p-2 transition-colors duration-200',+ active && 'bg-surface-hover text-text-primary font-semibold',)}onClick={onClick}aria-label={label}@@ -167,7 +167,7 @@ function FeedbackButtons({gutter={8}portalunmountOnHide- className="popover-animate flex w-auto flex-col gap-1.5 overflow-hidden rounded-2xl border border-border-medium bg-surface-secondary p-1.5 shadow-lg"+ className="popover-animate border-border-medium bg-surface-secondary flex w-auto flex-col gap-1.5 overflow-hidden rounded-2xl border p-1.5 shadow-lg"><div className="flex flex-col items-stretch justify-center">{positiveTags.map((tag) => (@@ -202,7 +202,7 @@ function FeedbackButtons({gutter={8}portalunmountOnHide- className="popover-animate flex w-auto flex-col gap-1.5 overflow-hidden rounded-2xl border border-border-medium bg-surface-secondary p-1.5 shadow-lg"+ className="popover-animate border-border-medium bg-surface-secondary flex w-auto flex-col gap-1.5 overflow-hidden rounded-2xl border p-1.5 shadow-lg"><div className="flex flex-col items-stretch justify-center">{negativeTags.map((tag) => (@@ -314,11 +314,11 @@ function Feedback({ isLast = false, handleFeedback, feedback: initialFeedback }:)}<OGDialog open={openDialog} onOpenChange={setOpenDialog}><OGDialogContent className="w-11/12 max-w-lg">- <OGDialogTitle className="text-token-text-primary text-lg font-semibold leading-6">+ <OGDialogTitle className="text-lg leading-6 font-semibold">{localize('com_ui_feedback_more_information')}</OGDialogTitle><Textarea- className="h-auto w-full rounded-xl border-border-light p-2"+ className="border-border-light h-auto w-full rounded-xl p-2"value={feedback?.text || ''}onChange={handleTextChange}rows={4}diff --git a/client/src/components/Chat/Messages/MinimalMessages.tsx b/client/src/components/Chat/Messages/MinimalMessages.tsxindex 202b06a463..11bd739881 100644--- a/client/src/components/Chat/Messages/MinimalMessages.tsx+++ b/client/src/components/Chat/Messages/MinimalMessages.tsx@@ -13,10 +13,10 @@ const MinimalMessages = React.forwardRef(props.className,)}>- <div className="transition-width bg-surface-secondary relative h-full w-full flex-1 overflow-auto">+ <div className="bg-surface-secondary relative h-full w-full flex-1 overflow-auto"><div className="flex h-full flex-col" role="presentation" tabIndex={0}><div className="flex-1 overflow-hidden overflow-y-auto">- <div className="dark:gpt-dark-gray relative h-full">+ <div className="relative h-full"><divref={ref}style={{@@ -27,7 +27,7 @@ const MinimalMessages = React.forwardRef(><div className="flex flex-col pb-9 text-sm">{props.children}- <div className="dark:gpt-dark-gray group h-0 w-full shrink-0 dark:border-gray-800/50" />+ <div className="group h-0 w-full shrink-0 dark:border-gray-800/50" /></div></div></div>diff --git a/client/src/components/Chat/approval/Review.tsx b/client/src/components/Chat/approval/Review.tsxindex c0cf148f47..75dbca58ab 100644--- a/client/src/components/Chat/approval/Review.tsx+++ b/client/src/components/Chat/approval/Review.tsx@@ -100,9 +100,9 @@ export const PendingToolApprovalPanel = memo(function PendingToolApprovalPanel({aria-labelledby="pending-tool-approval-title"aria-live="polite">- <div className="popover border-token-border-light flex max-h-[70vh] flex-col rounded-2xl border bg-surface-primary-alt shadow-lg">- <div className="flex shrink-0 items-center justify-between gap-2 border-b border-border-light px-3 py-2">- <p id="pending-tool-approval-title" className="text-sm font-medium text-text-primary">+ <div className="popover border-border-light bg-surface-primary-alt flex max-h-[70vh] flex-col rounded-2xl border shadow-lg">+ <div className="border-border-light flex shrink-0 items-center justify-between gap-2 border-b px-3 py-2">+ <p id="pending-tool-approval-title" className="text-text-primary text-sm font-medium">{localize(reviews.length === 1 ? 'com_ui_review_action' : 'com_ui_review_actions', {0: reviews.length,})}@@ -116,7 +116,7 @@ export const PendingToolApprovalPanel = memo(function PendingToolApprovalPanel({variant="ghost"size="icon"aria-label={localize('com_ui_collapse')}- className="size-auto rounded-md p-1 text-text-secondary"+ className="text-text-secondary size-auto rounded-md p-1"onClick={() => setOpen(false)}><ChevronDown className="size-4" aria-hidden="true" />@@ -133,19 +133,19 @@ export const PendingToolApprovalPanel = memo(function PendingToolApprovalPanel({<div className="mb-2"><h3id={`approval-${request.tool_call_id}`}- className="text-sm font-medium text-text-primary [overflow-wrap:anywhere]"+ className="text-text-primary text-sm font-medium [overflow-wrap:anywhere]">{reviews.length > 1? `${index + 1}. ${previewTitle(preview, localize)}`: previewTitle(preview, localize)}</h3>- <p className="text-xs text-text-secondary">{localize(KIND_LABELS[preview.kind])}</p>+ <p className="text-text-secondary text-xs">{localize(KIND_LABELS[preview.kind])}</p></div>- <pre className="max-h-52 overflow-auto whitespace-pre-wrap break-words rounded-lg border border-border-light bg-surface-tertiary p-3 font-mono text-xs text-text-primary">+ <pre className="border-border-light bg-surface-tertiary text-text-primary max-h-52 overflow-auto rounded-lg border p-3 font-mono text-xs break-words whitespace-pre-wrap">{preview.body || localize('com_ui_no_arguments')}</pre>{preview.truncated && (- <p className="mt-1 text-xs text-text-secondary">+ <p className="text-text-secondary mt-1 text-xs">{localize('com_ui_preview_truncated')}</p>)}@@ -161,7 +161,7 @@ export const PendingToolApprovalPanel = memo(function PendingToolApprovalPanel({surface="composer"/>) : (- <p className="mt-2 flex items-center text-xs text-text-warning" role="alert">+ <p className="text-text-warning mt-2 flex items-center text-xs" role="alert"><TriangleAlert className="mr-1.5 size-4" aria-hidden="true" />{localize('com_ui_approval_unavailable')}</p>@@ -169,8 +169,8 @@ export const PendingToolApprovalPanel = memo(function PendingToolApprovalPanel({</section>))}</div>- <div className="flex shrink-0 items-center justify-between gap-3 border-t border-border-light px-3 py-2">- <span className="text-xs text-text-secondary">+ <div className="border-border-light flex shrink-0 items-center justify-between gap-3 border-t px-3 py-2">+ <span className="text-text-secondary text-xs">{localize('com_ui_decisions_selected', {0: decisions.length,1: reviews.length,@@ -178,7 +178,7 @@ export const PendingToolApprovalPanel = memo(function PendingToolApprovalPanel({</span><div className="flex items-center gap-2">{(status === 'expired' || status === 'error') && (- <span className="flex items-center text-xs text-text-warning" role="alert">+ <span className="text-text-warning flex items-center text-xs" role="alert"><TriangleAlert className="mr-1.5 size-4" aria-hidden="true" />{localize(status === 'expired' ? 'com_ui_approval_expired' : 'com_ui_approval_error',@@ -225,7 +225,7 @@ export const PendingToolApprovalButton = memo(function PendingToolApprovalButtonaria-expanded={open}aria-controls="pending-tool-approval-panel"onClick={() => setOpen((current) => !current)}- className="h-8 gap-1.5 rounded-full px-2 text-text-secondary"+ className="text-text-secondary h-8 gap-1.5 rounded-full px-2"data-testid="pending-tool-approval-button"><ShieldQuestion className="size-4" aria-hidden="true" />diff --git a/client/src/components/Endpoints/ConvoIcon.tsx b/client/src/components/Endpoints/ConvoIcon.tsxindex 2a4596ba3b..ee39975b24 100644--- a/client/src/components/Endpoints/ConvoIcon.tsx+++ b/client/src/components/Endpoints/ConvoIcon.tsx@@ -12,7 +12,7 @@ import { isImageURL } from '~/utils/icons';const artScale = 2 / 3;const entityAvatarClassName =- 'bg-token-surface-secondary h-full w-full rounded-full object-cover dark:bg-surface-tertiary';+ 'bg-surface-secondary h-full w-full rounded-full object-cover dark:bg-surface-tertiary';function AgentAvatar({avatar,diff --git a/client/src/components/Input/ModelSelect/MultiSelectPop.tsx b/client/src/components/Input/ModelSelect/MultiSelectPop.tsxindex af295beeb0..89a3a76b8e 100644--- a/client/src/components/Input/ModelSelect/MultiSelectPop.tsx+++ b/client/src/components/Input/ModelSelect/MultiSelectPop.tsx@@ -55,7 +55,7 @@ function MultiSelectPop({data-testid="select-dropdown-button"className={cn('border-border-light bg-surface-secondary relative flex flex-col rounded-md border py-2 pr-10 pl-3 text-left focus:ring-0 focus:ring-offset-0 focus:outline-hidden sm:text-sm',- 'pointer-cursor font-normal',+ 'cursor-pointer font-normal','hover:bg-surface-hover data-[state=open]:bg-surface-hover',)}>diff --git a/client/src/components/Input/ModelSelect/SelectDropDownPop.tsx b/client/src/components/Input/ModelSelect/SelectDropDownPop.tsxindex 8b568d90aa..75ec90c56d 100644--- a/client/src/components/Input/ModelSelect/SelectDropDownPop.tsx+++ b/client/src/components/Input/ModelSelect/SelectDropDownPop.tsx@@ -68,7 +68,7 @@ function SelectDropDownPop({<buttondata-testid="select-dropdown-button"className={cn(- 'pointer-cursor border-border-light bg-surface-secondary relative flex flex-col rounded-lg border py-2 pr-10 pl-3 text-left focus:ring-0 focus:ring-offset-0 sm:text-sm',+ 'border-border-light bg-surface-secondary relative flex cursor-pointer flex-col rounded-lg border py-2 pr-10 pl-3 text-left focus:ring-0 focus:ring-offset-0 sm:text-sm','hover:bg-surface-hover data-[state=open]:bg-surface-hover','max-w-[215px] min-w-[200px] sm:max-w-full sm:min-w-full',)}diff --git a/client/src/components/Nav/AccountSettings.tsx b/client/src/components/Nav/AccountSettings.tsxindex 7a720684b5..35d5c37bc6 100644--- a/client/src/components/Nav/AccountSettings.tsx+++ b/client/src/components/Nav/AccountSettings.tsx@@ -112,10 +112,10 @@ function AccountSettings({ collapsed = false }: { collapsed?: boolean }) {className={collapsed? 'hover:bg-surface-active-alt aria-[expanded=true]:bg-surface-active-alt flex h-9 w-9 items-center justify-center rounded-lg transition-colors'- : 'mt-text-sm hover:bg-surface-active-alt aria-[expanded=true]:bg-surface-active-alt flex h-auto w-full items-center gap-2 rounded-xl p-2 text-sm transition-all duration-200 ease-in-out'+ : 'hover:bg-surface-active-alt aria-[expanded=true]:bg-surface-active-alt flex h-auto w-full items-center gap-2 rounded-xl p-2 text-sm transition-all duration-200 ease-in-out'}>- <div className={collapsed ? 'size-7 shrink-0' : '-ml-0.9 -mt-0.8 h-8 w-8 shrink-0'}>+ <div className={collapsed ? 'size-7 shrink-0' : 'h-8 w-8 shrink-0'}><div className="relative flex"><Avatar user={user} size={collapsed ? 28 : 32} /></div>@@ -137,13 +137,13 @@ function AccountSettings({ collapsed = false }: { collapsed?: boolean }) {translate: collapsed ? '4px 0' : '0 -4px',}}>- <div className="text-token-text-secondary mr-2 ml-3 py-2 text-sm" role="note">+ <div className="text-text-secondary mr-2 ml-3 py-2 text-sm" role="note">{user?.email ?? localize('com_nav_user')}</div><DropdownMenuSeparator />{startupConfig?.balance?.enabled === true && balanceQuery.data != null && (<>- <div className="text-token-text-secondary mr-2 ml-3 py-2 text-sm" role="note">+ <div className="text-text-secondary mr-2 ml-3 py-2 text-sm" role="note">{localize('com_nav_balance')}:{' '}{new Intl.NumberFormat().format(Math.round(balanceQuery.data.tokenCredits))}</div>diff --git a/client/src/components/Share/MessagesView.tsx b/client/src/components/Share/MessagesView.tsxindex ff8c9732d4..2ccb002bf3 100644--- a/client/src/components/Share/MessagesView.tsx+++ b/client/src/components/Share/MessagesView.tsx@@ -14,7 +14,7 @@ export default function MessagesView({const [currentEditId, setCurrentEditId] = useState<number | string | null>(-1);return (<div className="min-h-0 flex-1 overflow-hidden" data-testid="messages-view">- <div className="dark:gpt-dark-gray relative h-full">+ <div className="relative h-full"><divstyle={{height: '100%',@@ -40,7 +40,7 @@ export default function MessagesView({</div></>)}- <div className="dark:gpt-dark-gray group h-0 w-full shrink-0 dark:border-gray-800/50" />+ <div className="group h-0 w-full shrink-0 dark:border-gray-800/50" /></div></div></div>diff --git a/client/src/components/Share/ShareView.tsx b/client/src/components/Share/ShareView.tsxindex 1c8b123d5d..a9d231ef70 100644--- a/client/src/components/Share/ShareView.tsx+++ b/client/src/components/Share/ShareView.tsx@@ -224,7 +224,7 @@ function SharedView() {);const mainContent = (- <div className="transition-width bg-surface-secondary relative flex h-full w-full flex-1 flex-col items-stretch overflow-hidden pt-0">+ <div className="bg-surface-secondary relative flex h-full w-full flex-1 flex-col items-stretch overflow-hidden pt-0"><div className="text-text-primary relative flex h-full min-h-0 flex-col" role="presentation">{content}{footer}diff --git a/client/src/components/SidePanel/Agents/AgentPanel.tsx b/client/src/components/SidePanel/Agents/AgentPanel.tsxindex 4ee102939b..28ddc9ff72 100644--- a/client/src/components/SidePanel/Agents/AgentPanel.tsx+++ b/client/src/components/SidePanel/Agents/AgentPanel.tsx@@ -713,7 +713,7 @@ export default function AgentPanel() {<FormProvider {...methods}><formonSubmit={handleSubmit(onSubmit)}- className="scrollbar-gutter-stable flex flex-1 flex-col px-3 pb-3 pt-2"+ className="flex flex-1 scrollbar-gutter-stable flex-col px-3 pt-2 pb-3"aria-label="Agent configuration form"><div className="flex-1">@@ -761,10 +761,10 @@ export default function AgentPanel() {{!canEditAgent && !agentQuery.isInitialLoading && (<div className="flex h-[30vh] w-full items-center justify-center"><div className="text-center">- <h2 className="text-token-text-primary m-2 text-xl font-semibold">+ <h2 className="text-text-primary m-2 text-xl font-semibold">{localize('com_agents_not_available')}</h2>- <p className="text-token-text-secondary">{localize('com_agents_no_access')}</p>+ <p className="text-text-secondary">{localize('com_agents_no_access')}</p></div></div>)}diff --git a/client/src/components/SidePanel/Agents/Images.tsx b/client/src/components/SidePanel/Agents/Images.tsxindex 08d878f4f1..73cc936a1f 100644--- a/client/src/components/SidePanel/Agents/Images.tsx+++ b/client/src/components/SidePanel/Agents/Images.tsx@@ -6,7 +6,7 @@ import { useLocalize } from '~/hooks';export function NoImage() {return (- <div className="border-token-border-medium flex h-full w-full items-center justify-center rounded-full border-2 border-dashed border-black">+ <div className="border-border-medium flex h-full w-full items-center justify-center rounded-full border-2 border-dashed"><svgstroke="currentColor"fill="none"@@ -40,7 +40,7 @@ export const AgentAvatarRender = ({ url }: { url?: string }) => {<div className="relative h-full w-full overflow-hidden rounded-full"><imgsrc={url}- className="bg-token-surface-secondary h-full w-full rounded-full object-cover dark:bg-surface-tertiary"+ className="bg-surface-secondary dark:bg-surface-tertiary h-full w-full rounded-full object-cover"alt="Agent avatar"loading="lazy"key={url}diff --git a/client/src/components/SidePanel/Agents/MCPIcon.tsx b/client/src/components/SidePanel/Agents/MCPIcon.tsxindex 401eab8d8f..e6b56b5564 100644--- a/client/src/components/SidePanel/Agents/MCPIcon.tsx+++ b/client/src/components/SidePanel/Agents/MCPIcon.tsx@@ -29,23 +29,23 @@ export default function MCPIcon({ icon, onIconChange, errorId }: MCPIconProps) {aria-label={localize('com_ui_upload_icon')}aria-invalid={errorId != null}aria-describedby={errorId}- className="flex h-16 w-16 shrink-0 items-center justify-center rounded-xl border-2 border-dashed border-border-medium bg-surface-secondary p-0 hover:bg-surface-hover"+ className="border-border-medium bg-surface-secondary hover:bg-surface-hover flex h-16 w-16 shrink-0 items-center justify-center rounded-xl border-2 border-dashed p-0">{icon ? (<CustomIconsrc={icon}alt=""- className="h-full w-full rounded-xl object-cover text-text-primary"+ className="text-text-primary h-full w-full rounded-xl object-cover"/>) : (<SquirclePlusIcon />)}</Button><div className="flex flex-col gap-1">- <span className="token-text-secondary text-sm">+ <span className="text-text-secondary text-sm">{localize('com_ui_icon')} {localize('com_ui_optional')}</span>- <span className="text-xs text-text-secondary">{localize('com_agents_mcp_icon_size')}</span>+ <span className="text-text-secondary text-xs">{localize('com_agents_mcp_icon_size')}</span></div><inputaccept="image/png,.png,image/jpeg,.jpg,.jpeg,image/gif,.gif,image/webp,.webp,image/svg+xml,.svg"diff --git a/client/src/components/SidePanel/Builder/ActionsInput.tsx b/client/src/components/SidePanel/Builder/ActionsInput.tsxindex 2bb4ba6e19..9fe8c6c972 100644--- a/client/src/components/SidePanel/Builder/ActionsInput.tsx+++ b/client/src/components/SidePanel/Builder/ActionsInput.tsx@@ -217,7 +217,7 @@ export default function ActionsInput({<div className="mb-1 flex flex-wrap items-center justify-between gap-4"><labelhtmlFor="example-schema"- className="text-token-text-primary font-medium whitespace-nowrap"+ className="text-text-primary font-medium whitespace-nowrap">{localize('com_ui_schema')}</label>@@ -226,7 +226,7 @@ export default function ActionsInput({<selectid="example-schema"onChange={(e) => console.log(e.target.value)}- className="border-token-border-medium h-8 min-w-[100px] rounded-lg border bg-transparent px-2 py-0 text-sm"+ className="border-border-medium h-8 min-w-[100px] rounded-lg border bg-transparent px-2 py-0 text-sm"><option value="label">{localize('com_ui_examples')}</option><option value="0">Weather (JSON)</option>@@ -236,7 +236,7 @@ export default function ActionsInput({</div>*/}</div>- <div className="border-token-border-medium bg-surface-primary hover:border-border-heavy mb-4 w-full overflow-hidden rounded-lg border ring-0">+ <div className="border-border-medium bg-surface-primary hover:border-border-heavy mb-4 w-full overflow-hidden rounded-lg border ring-0"><div className="relative"><textareaid="schemaInput"@@ -244,12 +244,12 @@ export default function ActionsInput({onChange={handleInputChange}spellCheck="false"placeholder={localize('com_ui_enter_openapi_schema')}- className="text-token-text-primary focus:ring-border-light block h-96 w-full bg-transparent p-2 font-mono text-xs outline-hidden focus:ring-1"+ className="text-text-primary focus:ring-border-light block h-96 w-full bg-transparent p-2 font-mono text-xs outline-hidden focus:ring-1"/>{/* TODO: format input button */}</div>{validationResult && validationResult.message !== 'OpenAPI spec is valid.' && (- <div className="border-token-border-light text-text-destructive border-t p-2">+ <div className="border-border-light text-text-destructive border-t p-2">{validationResult.message.split('\n').map((line: string, i: number) => (<div key={i}>{line}</div>))}@@ -260,7 +260,7 @@ export default function ActionsInput({{!!data && (<div className="my-2"><div className="flex items-center">- <label className="text-token-text-primary block font-medium">+ <label className="text-text-primary block font-medium">{localize('com_assistants_available_actions')}</label></div>@@ -270,11 +270,11 @@ export default function ActionsInput({<div className="relative my-1"><ActionCallback action_id={action?.action_id} /><div className="mb-1.5 flex items-center">- <label className="text-token-text-primary block font-medium">+ <label className="text-text-primary block font-medium">{localize('com_ui_privacy_policy_url')}</label></div>- <div className="border-token-border-medium bg-surface-primary hover:border-border-heavy flex h-9 w-full rounded-lg border">+ <div className="border-border-medium bg-surface-primary hover:border-border-heavy flex h-9 w-full rounded-lg border"><inputtype="text"placeholder="https://api.example-weather-app.com/privacy"diff --git a/client/src/components/SidePanel/Builder/ActionsPanel.tsx b/client/src/components/SidePanel/Builder/ActionsPanel.tsxindex d5a7afcdfb..2c6a406846 100644--- a/client/src/components/SidePanel/Builder/ActionsPanel.tsx+++ b/client/src/components/SidePanel/Builder/ActionsPanel.tsx@@ -149,7 +149,7 @@ export default function ActionsPanel({});},selectClasses:- 'bg-surface-destructive hover:bg-surface-destructive-hover transition-color duration-200 text-text-on-status',+ 'bg-surface-destructive hover:bg-surface-destructive-hover transition-colors duration-200 text-text-on-status',selectText: localize('com_ui_delete'),}}/>diff --git a/client/src/components/SidePanel/Builder/ActionsTable/Columns.tsx b/client/src/components/SidePanel/Builder/ActionsTable/Columns.tsxindex 23d491f8c7..631b81c4a4 100644--- a/client/src/components/SidePanel/Builder/ActionsTable/Columns.tsx+++ b/client/src/components/SidePanel/Builder/ActionsTable/Columns.tsx@@ -46,7 +46,7 @@ export const columns: ColumnDef<Spec>[] = [// accessorKey: 'action',// // eslint-disable-next-line @typescript-eslint/no-unused-vars// cell: ({ row: _row }) => (- // <button className="btn relative btn-neutral h-8 rounded-lg border-token-border-light font-medium">+ // <button className="btn relative btn-neutral h-8 rounded-lg border-border-light font-medium">// <div className="flex w-full gap-2 items-center justify-center">Test</div>// </button>// ),diff --git a/client/src/components/SidePanel/Builder/ActionsTable/Table.tsx b/client/src/components/SidePanel/Builder/ActionsTable/Table.tsxindex 921c9571ae..97ec6e53c7 100644--- a/client/src/components/SidePanel/Builder/ActionsTable/Table.tsx+++ b/client/src/components/SidePanel/Builder/ActionsTable/Table.tsx@@ -17,10 +17,7 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTablePro<table className="w-full text-sm"><thead>{table.getHeaderGroups().map((headerGroup, i) => (- <tr- key={i}- className="border-token-border-light text-token-text-tertiary border-b text-left text-xs"- >+ <tr key={i} className="border-border-light text-text-tertiary border-b text-left text-xs">{headerGroup.headers.map((header, j) => (<th key={j} className="py-1 font-normal">{header.isPlaceholder@@ -33,7 +30,7 @@ export default function DataTable<TData, TValue>({ columns, data }: DataTablePro</thead><tbody>{table.getRowModel().rows.map((row, i) => (- <tr key={i} className="border-token-border-light border-b">+ <tr key={i} className="border-border-light border-b">{row.getVisibleCells().map((cell, j) => (<td key={j} className="py-2">{flexRender(cell.column.columnDef.cell, cell.getContext())}diff --git a/client/src/components/SidePanel/Builder/AppendDateCheckbox.tsx b/client/src/components/SidePanel/Builder/AppendDateCheckbox.tsxindex df68bce522..b0c4c79015 100644--- a/client/src/components/SidePanel/Builder/AppendDateCheckbox.tsx+++ b/client/src/components/SidePanel/Builder/AppendDateCheckbox.tsx@@ -49,7 +49,7 @@ export default function AppendDateCheckbox({ control, setValue }: AppendDateChec<labelid="append-date-label"htmlFor="append_current_datetime"- className="form-check-label text-token-text-primary w-full cursor-pointer"+ className="form-check-label text-text-primary w-full cursor-pointer">{localize('com_assistants_append_date')}</label>diff --git a/client/src/components/SidePanel/Builder/AssistantPanel.tsx b/client/src/components/SidePanel/Builder/AssistantPanel.tsxindex 8d2e1d8f8c..00bdb2abac 100644--- a/client/src/components/SidePanel/Builder/AssistantPanel.tsx+++ b/client/src/components/SidePanel/Builder/AssistantPanel.tsx@@ -38,7 +38,7 @@ import Knowledge from './Knowledge';import { Panel } from '~/common';import Action from './Action';-const labelClass = 'mb-2 text-token-text-primary block font-medium';+const labelClass = 'mb-2 text-text-primary block font-medium';const inputClass = cn(defaultTextProps,'flex w-full px-3 py-2 dark:border-gray-800 dark:bg-gray-800 rounded-xl mb-2',@@ -445,7 +445,7 @@ export default function AssistantPanel({<div className="mb-6"><label className={labelClass}>{`${toolsEnabled === true ? localize('com_ui_tools') : ''}- ${toolsEnabled === true && actionsEnabled === true ? ' + ' : ''}+ ${toolsEnabled === true && actionsEnabled === true ? '+ ' : ''}${actionsEnabled === true ? localize('com_assistants_actions') : ''}`}</label><div className="space-y-2">@@ -467,7 +467,7 @@ export default function AssistantPanel({<buttontype="button"onClick={() => setShowToolDialog(true)}- className="btn btn-neutral border-token-border-light relative h-8 w-full rounded-lg font-medium"+ className="btn btn-neutral border-border-light relative h-8 w-full rounded-lg font-medium"><div className="flex w-full items-center justify-center gap-2">{localize('com_assistants_add_tools')}@@ -487,7 +487,7 @@ export default function AssistantPanel({}setActivePanel(Panel.actions);}}- className="btn btn-neutral border-token-border-light relative h-8 w-full rounded-lg font-medium"+ className="btn btn-neutral border-border-light relative h-8 w-full rounded-lg font-medium"><div className="flex w-full items-center justify-center gap-2">{localize('com_assistants_add_actions')}diff --git a/client/src/components/SidePanel/Builder/CapabilitiesForm.tsx b/client/src/components/SidePanel/Builder/CapabilitiesForm.tsxindex efd7227cf0..b41fd6f092 100644--- a/client/src/components/SidePanel/Builder/CapabilitiesForm.tsx+++ b/client/src/components/SidePanel/Builder/CapabilitiesForm.tsx@@ -48,7 +48,7 @@ export default function CapabilitiesForm({<div className="mb-4"><div className="mb-1.5 flex items-center"><span>- <label className="text-token-text-primary block font-medium">+ <label className="text-text-primary block font-medium">{localize('com_assistants_capabilities')}</label></span>diff --git a/client/src/components/SidePanel/Builder/Code.tsx b/client/src/components/SidePanel/Builder/Code.tsxindex 341644e1b7..1a9447f4f8 100644--- a/client/src/components/SidePanel/Builder/Code.tsx+++ b/client/src/components/SidePanel/Builder/Code.tsx@@ -46,7 +46,7 @@ export default function Code({ version }: { version: number | string }) {><labelid={Capabilities.code_interpreter}- className="form-check-label text-token-text-primary w-full cursor-pointer"+ className="form-check-label text-text-primary w-full cursor-pointer"htmlFor={Capabilities.code_interpreter}>{localize('com_assistants_code_interpreter')}diff --git a/client/src/components/SidePanel/Builder/CodeFiles.tsx b/client/src/components/SidePanel/Builder/CodeFiles.tsxindex e4fd31d3d1..79a6d3959a 100644--- a/client/src/components/SidePanel/Builder/CodeFiles.tsx+++ b/client/src/components/SidePanel/Builder/CodeFiles.tsx@@ -60,7 +60,7 @@ export default function CodeFiles({return (<div className="mb-2 w-full"><div className="flex flex-col gap-4">- <div className="rounded-lg text-xs text-text-secondary">+ <div className="text-text-secondary rounded-lg text-xs">{localize('com_assistants_code_interpreter_files')}</div><FileRow@@ -75,7 +75,7 @@ export default function CodeFiles({<buttontype="button"disabled={!assistant_id}- className="btn btn-neutral border-token-border-light relative h-9 w-full rounded-lg font-medium"+ className="btn btn-neutral border-border-light relative h-9 w-full rounded-lg font-medium"onClick={handleButtonClick}><div className="flex w-full items-center justify-center gap-2">diff --git a/client/src/components/SidePanel/Builder/ContextButton.tsx b/client/src/components/SidePanel/Builder/ContextButton.tsxindex a75220ad6c..00df7bb68b 100644--- a/client/src/components/SidePanel/Builder/ContextButton.tsx+++ b/client/src/components/SidePanel/Builder/ContextButton.tsx@@ -89,7 +89,7 @@ export default function ContextButton({<DialogTrigger asChild><buttonclassName={cn(- 'btn btn-neutral border-token-border-light relative h-9 rounded-lg font-medium',+ 'btn btn-neutral border-border-light relative h-9 rounded-lg font-medium',removeFocusOutlines,)}type="button"diff --git a/client/src/components/SidePanel/Builder/ImageVision.tsx b/client/src/components/SidePanel/Builder/ImageVision.tsxindex 1e2bf525ee..fce9e92128 100644--- a/client/src/components/SidePanel/Builder/ImageVision.tsx+++ b/client/src/components/SidePanel/Builder/ImageVision.tsx@@ -27,7 +27,7 @@ export default function ImageVision() {/><labelid={Capabilities.image_vision}- className="form-check-label text-token-text-primary w-full cursor-pointer"+ className="form-check-label text-text-primary w-full cursor-pointer"htmlFor={Capabilities.image_vision}onClick={() =>setValue(Capabilities.image_vision, !getValues(Capabilities.image_vision), {diff --git a/client/src/components/SidePanel/Builder/Images.tsx b/client/src/components/SidePanel/Builder/Images.tsxindex e83cd041f3..b14e47c009 100644--- a/client/src/components/SidePanel/Builder/Images.tsx+++ b/client/src/components/SidePanel/Builder/Images.tsx@@ -4,7 +4,7 @@ import useLocalize from '~/hooks/useLocalize';export function NoImage() {return (- <div className="border-token-border-medium flex h-full w-full items-center justify-center rounded-full border-2 border-dashed border-black">+ <div className="border-border-medium flex h-full w-full items-center justify-center rounded-full border-2 border-dashed"><svgstroke="currentColor"fill="none"@@ -45,7 +45,7 @@ export const AssistantAvatar = ({<div className="relative h-20 w-20 overflow-hidden rounded-full"><imgsrc={url}- className="bg-token-surface-secondary dark:bg-surface-tertiary h-full w-full rounded-full object-cover"+ className="bg-surface-secondary dark:bg-surface-tertiary h-full w-full rounded-full object-cover"alt="GPT"width="80"height="80"diff --git a/client/src/components/SidePanel/Builder/Knowledge.tsx b/client/src/components/SidePanel/Builder/Knowledge.tsxindex 0ad4f0525a..5af4bbe296 100644--- a/client/src/components/SidePanel/Builder/Knowledge.tsx+++ b/client/src/components/SidePanel/Builder/Knowledge.tsx@@ -16,7 +16,7 @@ const CodeInterpreterFiles = ({ children }: { children: React.ReactNode }) => {const localize = useLocalize();return (<div>- <div className="text-token-text-tertiary mb-2 text-xs">+ <div className="text-text-tertiary mb-2 text-xs">{localize('com_assistants_code_interpreter_files')}</div>{/* Files available to Code Interpreter only */}@@ -75,7 +75,7 @@ export default function Knowledge({<div className="mb-6"><div className="mb-1.5 flex items-center"><span>- <label className="text-token-text-primary block font-medium">+ <label className="text-text-primary block font-medium">{assistant_id? localize('com_assistants_knowledge'): localize('com_assistants_knowledge_disabled')}@@ -83,7 +83,7 @@ export default function Knowledge({</span></div><div className="flex flex-col gap-4">- <div className="text-token-text-tertiary rounded-lg">+ <div className="text-text-tertiary rounded-lg">{assistant_id ? localize('com_assistants_knowledge_info') : ''}</div>{/* Files available to both tools */}@@ -111,7 +111,7 @@ export default function Knowledge({<buttontype="button"disabled={!assistant_id}- className="btn btn-neutral border-token-border-light relative h-8 rounded-lg font-medium"+ className="btn btn-neutral border-border-light relative h-8 rounded-lg font-medium"onClick={handleButtonClick}><div className="flex w-full items-center justify-center gap-2">diff --git a/client/src/components/SidePanel/Builder/Retrieval.tsx b/client/src/components/SidePanel/Builder/Retrieval.tsxindex 35fd9ff042..7e4f8255cb 100644--- a/client/src/components/SidePanel/Builder/Retrieval.tsx+++ b/client/src/components/SidePanel/Builder/Retrieval.tsx@@ -1,6 +1,5 @@import { useEffect, useMemo } from 'react';import { Capabilities } from 'librechat-data-provider';-import type { AssistantsEndpoint } from 'librechat-data-provider';import { useFormContext, Controller, useWatch } from 'react-hook-form';import {Checkbox,@@ -10,8 +9,9 @@ import {HoverCardTrigger,CircleHelpIcon,} from '@librechat/client';-import OptionHover from '~/components/SidePanel/Parameters/OptionHover';+import type { AssistantsEndpoint } from 'librechat-data-provider';import type { AssistantForm } from '~/common';+import OptionHover from '~/components/SidePanel/Parameters/OptionHover';import { useLocalize } from '~/hooks';import { ESide } from '~/common';import { cn } from '~/utils';@@ -28,15 +28,6 @@ export default function Retrieval({const methods = useFormContext<AssistantForm>();const { control, setValue, getValues } = methods;const model = useWatch({ control, name: 'model' });- const assistant = useWatch({ control, name: 'assistant' });-- const vectorStores = useMemo(() => {- if (typeof assistant === 'string') {- return [];- }- return assistant.tool_resources?.file_search;- }, [assistant]);-const isDisabled = useMemo(() => !retrievalModels.has(model), [model, retrievalModels]);useEffect(() => {@@ -68,7 +59,7 @@ export default function Retrieval({<labelid={Capabilities.retrieval}className={cn(- 'form-check-label text-token-text-primary w-full select-none',+ 'form-check-label text-text-primary w-full select-none',isDisabled ? 'cursor-no-drop opacity-50' : 'cursor-pointer',)}htmlFor={Capabilities.retrieval}diff --git a/client/src/components/Web/Sources.tsx b/client/src/components/Web/Sources.tsxindex 2371ed56ea..54b4cf4df0 100644--- a/client/src/components/Web/Sources.tsx+++ b/client/src/components/Web/Sources.tsx@@ -719,11 +719,12 @@ function SourcesComponent({ messageId, conversationId }: SourcesProps = {}) {return (<div role="region" aria-label={localize('com_sources_region_label')}><AnimatedTabs+ tone="muted"tabs={tabs}containerClassName="flex min-w-full mb-4"tabListClassName="flex items-center mb-2 border-b border-border-light overflow-x-auto"tabPanelClassName="w-full overflow-x-auto md:mx-0 md:px-0"- tabClassName="flex items-center whitespace-nowrap text-xs font-medium text-token-text-secondary px-1 pt-2 pb-1 border-b-2 border-transparent data-[state=active]:text-text-primary focus:ring-2 focus:ring-text-primary focus:ring-offset-2"+ tabClassName="flex items-center whitespace-nowrap text-xs font-medium px-1 pt-2 pb-1 border-b-2 border-transparent focus:ring-2 focus:ring-text-primary focus:ring-offset-2"/></div>);diff --git a/client/src/style.css b/client/src/style.cssindex 04afe90649..3eb38e415b 100644--- a/client/src/style.css+++ b/client/src/style.css@@ -1,13 +1,23 @@@import 'tailwindcss';+/* Semantic colors live in the component library, in CSS, so one file feeds this app, the published+ * package and @shadcn/lint's token checking. Imported from source rather than from the built+ * package so a lint or CI run needs no prior build. */+@import '../../packages/client/src/theme/tokens.css';@config '../tailwind.config.cjs';+/* Close the legacy palette scales only inside this repository. */+@theme inline {+ --color-gray-*: initial;+ --color-green-*: initial;+}+/* Tailwind v4 changed two preflight defaults this app was built against. Each rule below* restores the v3 default rather than adopting the new one, so the upgrade carries no visual* change; drop one only as a deliberate design decision.* - border-color: v3 used gray-200, v4 uses currentColor.* - ::placeholder: v3 used gray-400, v4 uses currentColor at 50% opacity.- * Both read the palette through `theme()` so they follow createTailwindColors() rather than- * pinning a hex here. `button { cursor: pointer }` below already covers v4's third change. */+ * Both read the repository compatibility palette through `theme()` instead of pinning a hex here.+ * `button { cursor: pointer }` below already covers v4's third change. */@layer base {*,::after,@@ -594,19 +604,6 @@ html.high-contrast.dark .btn-neutral:hover {background-color: rgb(var(--surface-hover));}-.text-token-text-primary {- color: #171717;- color: rgb(var(--text-primary));-}-.text-token-text-secondary {- color: #565869;- color: rgb(var(--text-secondary));-}-.text-token-text-tertiary {- color: #8e8ea0;- color: rgb(var(--text-tertiary));-}-.icon-sm {stroke-width: 2;height: 1rem;@@ -636,19 +633,6 @@ html.high-contrast.dark .btn-neutral:hover {height: 2rem;width: 2rem;}-.border-token-border-light {- border-color: #ececf1;- border-color: rgb(var(--border-light) / var(--border-light-alpha, 1));-}--.border-token-border-medium {- border-color: #d9d9e3;- border-color: rgb(var(--border-medium) / var(--border-medium-alpha, 1));-}--.bg-token-surface-secondary {- background-color: rgb(var(--surface-secondary));-}/* Forced-colors overrides the inline `background-color: currentColor` a masked* CustomIcon paints with; `!important` is needed to beat that inline style. */@@ -746,8 +730,7 @@ html.high-contrast.dark .btn-neutral:hover {* layered one whatever its specificity. The rules below are element and bare-pseudo* resets that utilities beat under v3 by being classes; each is layered so it keeps* losing to a utility. A rule that is meant to beat utilities stays unlayered- * (`.dark :focus-visible`, the `code, pre` font reset, the `.hidden`/`.overflow-*`- * class overrides). */+ * (`.dark :focus-visible`, the `code, pre` font reset). */@layer base {select {--tw-shadow: 0 0 transparent;@@ -767,19 +750,6 @@ html.high-contrast.dark .btn-neutral:hover {}}-/* `overflow-*-auto` deliberately overrides the utility of the same name with `overlay`, so it- * stays unlayered and keeps beating it; no source pairs it with a variant that would need to win- * back. `.hidden` had no such reason to exist — Tailwind emits the identical rule — and unlayered- * it outranked every responsive variant that reveals an element, so `hidden md:block` stayed- * hidden at every width and the composer's MCP button lost its accessible name. */-.overflow-y-auto {- overflow-y: overlay;-}--.overflow-x-auto {- overflow-x: overlay;-}-.reset-rc-number-input input {width: 100%;border: none !important;@@ -1683,16 +1653,6 @@ html {text-underline-offset: 2px;}-.truncate {- overflow: hidden;- white-space: nowrap;-}--.text-ellipsis,-.truncate {- text-overflow: ellipsis;-}-.group:hover .group-hover\:visible {visibility: visible;}@@ -1740,23 +1700,7 @@ html {transform: rotate(1turn);}}-.animate-spin {- -webkit-animation: spin 1s linear infinite;- animation: spin 1s linear infinite;-}-.grow {- flex-grow: 1;-}--.transform {- -webkit-transform: translate(var(--tw-translate-x), var(--tw-translate-y))- rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y))- scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate))- skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x))- scaleY(var(--tw-scale-y));-}body,html {height: 100%;diff --git a/client/tailwind.config.cjs b/client/tailwind.config.cjsindex 8082594768..0c0178f882 100644--- a/client/tailwind.config.cjs+++ b/client/tailwind.config.cjs@@ -1,8 +1,8 @@// const { fontFamily } = require('tailwindcss/defaultTheme');-const {- createTailwindColors,-} = require('../packages/client/src/theme/utils/createTailwindColors.js');+// Semantic colors are declared in+// packages/client/src/theme/tokens.css, which src/style.css imports.const libreChatTailwindPreset = require('../packages/client/tailwind.preset.cjs');+const compatibilityColors = require('../packages/client/tailwind.compat.cjs');/** @type {import('tailwindcss').Config} */module.exports = {@@ -45,6 +45,7 @@ module.exports = {// mono: ['Söhne Mono', 'monospace'],// },extend: {+ colors: compatibilityColors,width: {authPageWidth: '370px',},@@ -119,7 +120,6 @@ module.exports = {'refresh-link-spin': 'refresh-link-spin 650ms cubic-bezier(0.42, 0, 0.58, 1)','reset-spin': 'reset-spin 500ms cubic-bezier(0.22, 1, 0.36, 1)',},- colors: createTailwindColors(),borderRadius: {lg: 'var(--radius)',md: 'calc(var(--radius) - 2px)',@@ -131,8 +131,11 @@ module.exports = {// tailwindcss-radix is gone: its addVariant call produces nothing under Tailwind v4, and// Radix sets the same attributes it keyed off, so callers use `data-[state=open]:` and// `data-[disabled]:` directly. Its last caller was a table mockup nothing rendered, removed- // with this upgrade rather than migrated. tailwindcss-animate still works under v4.- require('tailwindcss-animate'),+ // with this upgrade rather than migrated.+ //+ // tailwindcss-animate is not listed here: the published preset above registers it, and+ // Tailwind runs a plugin once per registration, so naming it again would emit every+ // `animate-in`/`fade-in-*` utility twice.// require('@tailwindcss/typography'),],};diff --git a/e2e/specs/mock/scenarios/design-rule-enforcement.spec.ts b/e2e/specs/mock/scenarios/design-rule-enforcement.spec.tsindex 6f99ee6129..b436c85b69 100644--- a/e2e/specs/mock/scenarios/design-rule-enforcement.spec.ts+++ b/e2e/specs/mock/scenarios/design-rule-enforcement.spec.ts@@ -130,6 +130,7 @@ test.describe('design-system rules', () => {'shadcn/no-arbitrary-values': 2,'shadcn/no-inline-styles': 2,'shadcn/require-static-classes': 2,+ 'shadcn/no-unknown-classes': 2,};const library: Record<string, number> = {...caller,diff --git a/e2e/specs/mock/scenarios/published-consumer-appearance.spec.ts b/e2e/specs/mock/scenarios/published-consumer-appearance.spec.tsindex f1299b0107..e04ddb2b5e 100644--- a/e2e/specs/mock/scenarios/published-consumer-appearance.spec.ts+++ b/e2e/specs/mock/scenarios/published-consumer-appearance.spec.ts@@ -15,14 +15,17 @@ import { repoRoot, run } from './lint.helpers';* - the radius scale is Tailwind's, not ours, so `rounded-sm` means whatever* the current major says it means.*- * The scenario builds what a consumer actually installs — the package's own+ * The scenario builds what a consumer actually installs: the package's own* stylesheet and its published preset, compiled by Tailwind through the- * package's config — and asks a browser holding nothing else what the+ * documented consumer config, and asks a browser holding nothing else what the* primitives' class strings render as.*/+type ClientManifest = { exports: Record<string, string> };+const PROBE_DIR = resolve(repoRoot, 'e2e/specs/.test-results/published-consumer');const DIST_STYLESHEET = resolve(repoRoot, 'packages/client/dist/style.css');+const PACKAGE_ROOT = resolve(repoRoot, 'packages/client');/** The class strings below are the published primitives' own, copied from the* components so the probe cannot drift away from what ships. */@@ -38,14 +41,18 @@ test.describe('the published package appearance', () => {test.setTimeout(300_000);mkdirSync(PROBE_DIR, { recursive: true });- /** What the consumer imports as `@librechat/client/style.css`. The mock lane- * and the verify runner both build the packages first; building here as- * well keeps the scenario runnable on its own. */- if (!existsSync(DIST_STYLESHEET)) {- const built = run('npm', ['run', 'build', '--prefix', resolve(repoRoot, 'packages/client')]);+ /** What the consumer imports as `@librechat/client/style.css` and+ * `@librechat/client/theme.css`. Both are build artifacts, so the mock lane+ * and the verify runner build the packages first; building here as well+ * keeps the scenario runnable on its own. */+ const manifest = JSON.parse(+ readFileSync(resolve(PACKAGE_ROOT, 'package.json'), 'utf8'),+ ) as ClientManifest;+ const tokenStylesheet = resolve(PACKAGE_ROOT, manifest.exports['./theme.css']);+ if (!existsSync(DIST_STYLESHEET) || !existsSync(tokenStylesheet)) {+ const built = run('npm', ['run', 'build', '--prefix', PACKAGE_ROOT]);expect(built.status, `the component library did not build:\n${built.output}`).toBe(0);}- const packageStylesheet = readFileSync(DIST_STYLESHEET, 'utf8');/** The markup the compile is allowed to see, so the utilities it emits are* exactly the ones the primitives ask for. */@@ -53,18 +60,35 @@ test.describe('the published package appearance', () => {<div id="box" class="${CHECKBOX_BOX}"></div><input id="search" class="${SEARCH_FIELD}" placeholder="Search" /><button id="enabled" class="${BUTTON_DISABLED}">enabled</button>-<button id="disabled" class="${BUTTON_DISABLED}" disabled>disabled</button>`;+<button id="disabled" class="${BUTTON_DISABLED}" disabled>disabled</button>+<div id="gray-500" class="bg-gray-500"></div>+<div id="green-500" class="bg-green-500"></div>+<div id="gray-950" class="bg-gray-950"></div>+<div id="green-950" class="bg-green-950"></div>`;const probeMarkup = join(PROBE_DIR, 'probe.html');writeFileSync(probeMarkup, markup);- /** A consumer's stylesheet: Tailwind, the package's config — which is the- * published preset plus the semantic colors — and nothing of this app. */+ /** Compile the complete stylesheet example itself, so a missing import in+ * the README cannot be hidden by a separately maintained correct fixture. */+ const readme = readFileSync(resolve(PACKAGE_ROOT, 'src/theme/README.md'), 'utf8');+ const documentedStylesheet = [...readme.matchAll(/```css\n([\s\S]*?)```/g)]+ .map((match) => match[1])+ .find((stylesheet) => stylesheet.includes("@import '@librechat/client/style.css';"));+ expect(documentedStylesheet, 'the complete consumer stylesheet is documented').toBeDefined();+ const documentedConfig = [...readme.matchAll(/```js\n([\s\S]*?)```/g)]+ .map((match) => match[1])+ .find((config) => config.includes("require('@librechat/client/tailwind-preset')"));+ expect(documentedConfig, 'the consumer preset configuration is documented').toBeDefined();+ const consumerConfig = join(PROBE_DIR, 'tailwind.config.cjs');+ writeFileSync(consumerConfig, documentedConfig!);const entry = join(PROBE_DIR, 'consumer.css');writeFileSync(entry,[- "@import 'tailwindcss';",- `@config '${resolve(repoRoot, 'packages/client/tailwind.config.js')}';`,+ documentedStylesheet!+ .replace("@import '@librechat/client/theme.css';", `@import '${tokenStylesheet}';`)+ .replace("@import '@librechat/client/style.css';", `@import '${DIST_STYLESHEET}';`)+ .replace(/@config '[^']+';/, `@config '${consumerConfig}';`),`@source '${probeMarkup}';`,'',].join('\n'),@@ -72,14 +96,21 @@ test.describe('the published package appearance', () => {const compiler = join(PROBE_DIR, 'compile.cjs');const compiled = join(PROBE_DIR, 'consumer.out.css');+ const baseline = join(PROBE_DIR, 'baseline.css');+ const baselineCompiled = join(PROBE_DIR, 'baseline.out.css');+ writeFileSync(baseline, `@import 'tailwindcss' source(none);\n@source '${probeMarkup}';\n`);writeFileSync(compiler,`const postcss = require('postcss');const tailwind = require('@tailwindcss/postcss');const { readFileSync, writeFileSync } = require('node:fs');-postcss([tailwind()])- .process(readFileSync(${JSON.stringify(entry)}, 'utf8'), { from: ${JSON.stringify(entry)} })- .then((result) => writeFileSync(${JSON.stringify(compiled)}, result.css))+Promise.all(${JSON.stringify([+ [entry, compiled],+ [baseline, baselineCompiled],+ ])}.map(async ([input, output]) => {+ const result = await postcss([tailwind()]).process(readFileSync(input, 'utf8'), { from: input });+ writeFileSync(output, result.css);+})).catch((error) => {console.error(error.message);process.exit(1);@@ -100,9 +131,6 @@ postcss([tailwind()])body { color: rgb(200 0 0); }</style></head><body>${markup}</body></html>`,);- await page.addStyleTag({ content: consumerCss });- await page.addStyleTag({ content: packageStylesheet });-const read = (id: string, properties: string[]) =>page.evaluate(([selector, names]) => {@@ -115,6 +143,18 @@ postcss([tailwind()])[id, properties] as const,);+ const palette = ['gray-500', 'green-500', 'gray-950', 'green-950'];+ const readPalette = () => Promise.all(palette.map((id) => read(id, ['background-color'])));+ const baselineStyle = await page.addStyleTag({+ content: readFileSync(baselineCompiled, 'utf8'),+ });+ const defaultPalette = await readPalette();+ await baselineStyle.evaluate((element) => element.remove());+ await page.addStyleTag({ content: consumerCss });+ expect(await readPalette(), 'the library must preserve the host Tailwind palette').toEqual(+ defaultPalette,+ );+/** Tailwind 4 renamed the radius steps — the old `sm` is `xs`, and `sm` is* 0.25rem — so a checkbox that says `rounded-sm` doubles its corners unless* the preset states the step. 2px is what this preset produced underdiff --git a/e2e/specs/mock/scenarios/published-consumer-content.spec.ts b/e2e/specs/mock/scenarios/published-consumer-content.spec.tsnew file mode 100644index 0000000000..1865eebbe2--- /dev/null+++ b/e2e/specs/mock/scenarios/published-consumer-content.spec.ts@@ -0,0 +1,93 @@+import { globSync, readFileSync } from 'node:fs';+import { resolve } from 'node:path';+import { expect, test } from '@playwright/test';+import { repoRoot } from './lint.helpers';++/**+ * Step 4 of the theme README hands a consumer the `content` globs their Tailwind+ * scans. One of them has to reach this package's published files, because every+ * class the components emit lives there and nowhere in the consumer's own `src`.+ * The glob said `dist/**\/*.js` while tsdown forces `.mjs`/`.cjs`, so it matched+ * nothing: a consumer following the documented setup rendered dialogs, menus and+ * buttons whose utilities were never generated. This reads the glob out of the+ * README rather than restating it, so the documentation and the shipped file+ * names cannot drift apart again.+ */++type ClientManifest = { exports: Record<string, unknown>; files: string[] };++const packageRoot = resolve(repoRoot, 'packages/client');+const readmePath = resolve(packageRoot, 'src/theme/README.md');+const PACKAGE_SPECIFIER = '@librechat/client/';++/** The `content` array of the first fenced block under the Tailwind config step. */+function documentedContentGlobs(): string[] {+ const readme = readFileSync(readmePath, 'utf8');+ const step = readme.indexOf('### 4. Configure Tailwind');+ expect(step, 'the README no longer documents the Tailwind config step').toBeGreaterThan(-1);++ const fence = readme.slice(step).match(/```js\n([\s\S]*?)```/);+ expect(fence, 'the Tailwind config step no longer carries a js code block').not.toBeNull();++ const content = fence![1].match(/content:\s*\[([\s\S]*?)\]/);+ expect(content, 'the documented config no longer declares content globs').not.toBeNull();++ return [...content![1].matchAll(/'([^']+)'/g)].map((match) => match[1]);+}++/** Every built module the export map points into `dist`, conditions and all.+ * Types and the preset are excluded: a consumer's Tailwind has no class names+ * to find in a `.d.mts` or in the config it loads as a preset. */+function bundlePaths(exports: unknown): string[] {+ if (typeof exports === 'string') {+ return /^\.\/dist\/.+(?<!\.d)\.(js|mjs|cjs)$/.test(exports) ? [exports] : [];+ }+ if (typeof exports === 'object' && exports !== null) {+ return Object.values(exports).flatMap(bundlePaths);+ }+ return [];+}++test.describe('the documented consumer setup', () => {+ test('the documented consumer config scans the published components @scenario:the-documented-consumer-config-scans-the-published-components', () => {+ test.setTimeout(60_000);++ const globs = documentedContentGlobs();+ const packageGlobs = globs+ .filter((glob) => glob.includes(PACKAGE_SPECIFIER))+ .map((glob) => glob.slice(glob.indexOf(PACKAGE_SPECIFIER) + PACKAGE_SPECIFIER.length));++ expect(+ packageGlobs,+ `no documented content glob reaches ${PACKAGE_SPECIFIER}: ${globs.join(', ')}`,+ ).not.toHaveLength(0);++ const scanned = [+ ...new Set(packageGlobs.flatMap((glob) => globSync(glob, { cwd: packageRoot }))),+ ];++ /** The published entry points are where the class names are: a glob that+ * misses them leaves the consumer's Tailwind with nothing to find. */+ const manifest = JSON.parse(+ readFileSync(resolve(packageRoot, 'package.json'), 'utf8'),+ ) as ClientManifest;+ const entryPoints = bundlePaths(manifest.exports).map((entry) => entry.replace(/^\.\//, ''));++ expect(entryPoints, 'the package exports no javascript entry point').not.toHaveLength(0);+ for (const entry of entryPoints) {+ expect(+ scanned,+ `the documented globs (${packageGlobs.join(', ')}) do not match ${entry}; build the package first`,+ ).toContain(entry);+ }++ /** And scanning them is load-bearing: the files carry utility class names+ * the consumer's own sources never mention. */+ for (const entry of entryPoints) {+ const bundle = readFileSync(resolve(packageRoot, entry), 'utf8');+ expect(bundle, `${entry} carries no theme utility for Tailwind to find`).toContain(+ 'bg-surface-primary',+ );+ }+ });+});diff --git a/e2e/specs/mock/scenarios/published-preset-animations.spec.ts b/e2e/specs/mock/scenarios/published-preset-animations.spec.tsnew file mode 100644index 0000000000..10264886b8--- /dev/null+++ b/e2e/specs/mock/scenarios/published-preset-animations.spec.ts@@ -0,0 +1,109 @@+import { readFileSync } from 'node:fs';+import { resolve } from 'node:path';+import { expect, test } from '@playwright/test';+import { repoRoot } from './lint.helpers';++/**+ * A consumer following the documented setup loads one file from this package:+ * the exported Tailwind preset. The published components write `animate-in`,+ * `fade-in-0`, `zoom-in-95` and `slide-in-from-*` on dialogs, popovers and+ * dropdowns, and those are `tailwindcss-animate` utilities, so the preset has+ * to register the plugin, or the surfaces arrive without their motion and+ * nothing says why. This compiles the preset the way a consumer's build does+ * and asks for the CSS.+ */++type ClientManifest = { peerDependencies: Record<string, string> };++/** The classes the components actually emit, read from the components. */+const ANIMATION_CANDIDATES = [+ 'animate-in',+ 'fade-in-0',+ 'zoom-in-95',+ 'slide-in-from-bottom-10',+ 'animate-out',+ 'fade-out-0',+ /** Named by the components themselves rather than by the plugin: the+ * accordion's height animation and the OTP field's caret. */+ 'animate-accordion-down',+ 'animate-accordion-up',+ 'animate-caret-blink',+ 'animate-loading-dot',+];++test.describe('the published preset', () => {+ test('the published preset generates the components animations @scenario:the-published-preset-generates-the-components-animations', async () => {+ test.setTimeout(120_000);++ /** The plugin is the consumer's to install, so it is declared as a peer. */+ const manifest = JSON.parse(+ readFileSync(resolve(repoRoot, 'packages/client/package.json'), 'utf8'),+ ) as ClientManifest;+ expect(manifest.peerDependencies['tailwindcss-animate']).toBeDefined();++ /** Compile with the preset alone, no app config, the way a consumer does. */+ const { compile } = (await import('tailwindcss')) as {+ compile: (+ css: string,+ options: {+ base: string;+ loadModule: (+ id: string,+ base: string,+ ) => Promise<{ base: string; module: unknown; path: string }>;+ loadStylesheet: (+ id: string,+ base: string,+ ) => Promise<{ base: string; content: string; path: string }>;+ },+ ) => Promise<{ build: (candidates: string[]) => string }>;+ };+ const packageRoot = resolve(repoRoot, 'packages/client');+ const compiler = await compile(`@import "tailwindcss";\n@config "./tailwind.config.js";\n`, {+ base: packageRoot,+ loadModule: async (id, base) => {+ const modulePath = id.startsWith('.') ? resolve(base, id) : require.resolve(id);+ const loaded = (await import(modulePath)) as { default?: unknown };+ return {+ base: resolve(modulePath, '..'),+ module: loaded.default ?? loaded,+ path: modulePath,+ };+ },+ loadStylesheet: async (id, base) => {+ const stylesheet =+ id === 'tailwindcss'+ ? resolve(require.resolve('tailwindcss/package.json'), '../index.css')+ : resolve(base, id);+ return {+ base: resolve(stylesheet, '..'),+ content: readFileSync(stylesheet, 'utf8'),+ path: stylesheet,+ };+ },+ });++ const css = compiler.build([...ANIMATION_CANDIDATES, 'p-4']);+ for (const candidate of ANIMATION_CANDIDATES) {+ expect(css, `${candidate} generated no CSS from the published preset`).toContain(+ `.${candidate}`,+ );+ }+ /** Animations mean keyframes, not just a class that exists. */+ expect(css).toContain('@keyframes');++ /** And the preset is the only place the plugin is registered. A config that+ * names it again as well emits every `@keyframes` block it owns twice;+ * Tailwind deduplicates the utilities but not the keyframes, so the count+ * is what says whether the ownership is still single. */+ const keyframes = css.match(/@keyframes\s+[\w-]+/g) ?? [];+ expect(keyframes.length).toBeGreaterThan(0);+ expect(new Set(keyframes).size, `duplicated keyframes: ${keyframes.join(', ')}`).toBe(+ keyframes.length,+ );++ /** The control: an ordinary utility still compiles, so a miss above is the+ * plugin and not a broken compile. */+ expect(css).toContain('.p-4');+ });+});diff --git a/e2e/specs/mock/scenarios/published-theme-stylesheet.spec.ts b/e2e/specs/mock/scenarios/published-theme-stylesheet.spec.tsnew file mode 100644index 0000000000..fb6139989b--- /dev/null+++ b/e2e/specs/mock/scenarios/published-theme-stylesheet.spec.ts@@ -0,0 +1,60 @@+import { readFileSync, statSync } from 'node:fs';+import { dirname, resolve } from 'node:path';+import { expect, test } from '@playwright/test';+import { repoRoot } from './lint.helpers';++/**+ * A consumer's stylesheet begins `@import '@librechat/client/theme.css'`, so the+ * export has to be a file a bundler can read. It pointed at a directory once,+ * which resolves to nothing and fails at build time in the consumer's project+ * rather than here, hence a scenario that resolves the export the way a bundler+ * does and reads the tokens out of whatever it lands on.+ */++type ClientManifest = {+ exports: Record<string, unknown>;+ files: string[];+};++const packageRoot = resolve(repoRoot, 'packages/client');++test.describe('the published theme stylesheet', () => {+ test('the published token stylesheet resolves as a file @scenario:the-published-token-stylesheet-resolves-as-a-file', () => {+ test.setTimeout(60_000);++ const manifest = JSON.parse(+ readFileSync(resolve(packageRoot, 'package.json'), 'utf8'),+ ) as ClientManifest;++ const declared = manifest.exports['./theme.css'];+ expect(typeof declared, 'the package must export ./theme.css as a single path').toBe('string');+ const target = resolve(packageRoot, declared as string);++ /** The export is only as good as what it lands on: a directory here is the+ * regression, and `isFile()` is the difference a consumer feels. */+ const stats = statSync(target, { throwIfNoEntry: false });+ expect(stats, `${declared} does not exist; build the package before publishing`).not.toBe(+ undefined,+ );+ expect(stats!.isFile(), `${declared} resolves to a directory, not a stylesheet`).toBe(true);++ /** And it has to carry the tokens the consumer contract promises, as+ * `@theme inline` so each utility keeps resolving the custom property the+ * runtime theme rewrites. */+ const stylesheet = readFileSync(target, 'utf8');+ expect(stylesheet).toContain('@theme inline');+ expect(stylesheet).toContain('--color-text-primary');+ expect(stylesheet).toContain('--color-surface-primary');++ /** `files` decides what ships: an export pointing outside it is dead in the+ * published tarball even though it resolves in the monorepo. */+ const shipped = manifest.files.some(+ (entry) => target.startsWith(resolve(packageRoot, entry)) || entry === declared,+ );+ expect(+ shipped,+ `${declared} is not inside the published files: ${manifest.files.join(', ')}`,+ ).toBe(true);+ expect(dirname(target).startsWith(packageRoot)).toBe(true);+ });+});diff --git a/e2e/specs/mock/scenarios/theme-token-utilities.spec.ts b/e2e/specs/mock/scenarios/theme-token-utilities.spec.tsnew file mode 100644index 0000000000..a1a01f15e0--- /dev/null+++ b/e2e/specs/mock/scenarios/theme-token-utilities.spec.ts@@ -0,0 +1,229 @@+import { expect, test } from '@playwright/test';+import type { Locator, Page } from '@playwright/test';+import { getE2EUser } from '../../../setup/user';+import { NEW_CHAT_PATH } from '../helpers';++/**+ * The colors these tests read now live in `packages/client/src/theme/tokens.css` as+ * `@theme inline`, and the class names that paint them changed from the `*-token-*`+ * rules that `client/src/style.css` carried to ordinary Tailwind utilities. Both halves+ * are only observable in a rendered page: the rule that used to paint an element sat+ * outside `@layer utilities` and therefore beat every utility on the same property, so+ * the questions are whether the element still takes its token color and whether the+ * theme still recolors it at runtime.+ */+test.describe.configure({ timeout: 120_000 });++const PROBE_TOKENS = {+ secondary: '--text-secondary',+ primary: '--text-primary',+} as const;++type PaintedColor = {+ /** The property as the browser computed it for the real element. */+ actual: string;+ /** The theme property the element is supposed to resolve to. */+ expected: string;+ /** The property it would show if the utility painted nothing and it inherited instead. */+ inherited: string;+};++/**+ * Compare a computed color against a theme custom property without restating the+ * theme's values: both sides are resolved by the browser, so the assertion holds in+ * light mode, dark mode and under a custom theme.+ */+async function paintedColor(+ element: Locator,+ options: { property: 'color' | 'borderTopColor'; expected: string; inherited?: string },+): Promise<PaintedColor> {+ return element.evaluate((node, properties) => {+ const root = getComputedStyle(document.documentElement);+ const normalize = (value: string) => {+ const probe = document.createElement('span');+ probe.style.color = value;+ document.body.append(probe);+ const resolved = getComputedStyle(probe).color;+ probe.remove();+ return resolved;+ };+ /** `R G B` triplets, with the companion alpha a border token multiplies in. */+ const token = (property: string) => {+ const triplet = root.getPropertyValue(property).trim();+ const alpha = root.getPropertyValue(`${property}-alpha`).trim();+ return normalize(alpha ? `rgb(${triplet} / ${alpha})` : `rgb(${triplet})`);+ };+ const computed = getComputedStyle(node);+ return {+ actual: properties.property === 'color' ? computed.color : computed.borderTopColor,+ expected: token(properties.expected),+ /** No token named: the fallback is whatever the element would inherit, which for a+ * border with no color of its own is `currentColor`. */+ inherited: properties.inherited ? token(properties.inherited) : computed.color,+ };+ }, options);+}++/** The account menu is the shortest path to an element the rename touched. */+async function openAccountMenu(page: Page): Promise<Locator> {+ await page.goto(NEW_CHAT_PATH, { timeout: 15000 });+ // Settle the shell first: the header toggle and the sidebar both mount late, and probing+ // either one on a blank page answers for the wrong layout.+ await expect(page.getByRole('textbox', { name: 'Message input' })).toBeVisible({+ timeout: 30000,+ });+ // Below `md` the account button lives in the drawer's own header, which renders+ // off-canvas until the toggle opens it, present and "visible" to a locator, but not+ // clickable. The toggle itself is `md:hidden`, so its visibility is the layout probe.+ const opener = page.getByTestId('header-open-sidebar-button');+ if (await opener.isVisible()) {+ await opener.click({ timeout: 15000 });+ }+ const trigger = page.getByTestId('nav-user');+ await expect(trigger).toBeVisible({ timeout: 15000 });+ await trigger.click({ timeout: 15000 });+ const email = page.getByRole('note').filter({ hasText: getE2EUser().email }).first();+ await expect(email).toBeVisible({ timeout: 15000 });+ return email;+}++test.describe('theme token utilities', () => {+ test.beforeEach(async ({ page }) => {+ await page.addInitScript(() => {+ localStorage.setItem('navVisible', 'true');+ });+ });++ test('the account menu email keeps its secondary text color @scenario:the-account-menu-email-keeps-its-secondary-text-color', async ({+ page,+ }) => {+ const email = await openAccountMenu(page);++ const painted = await paintedColor(email, {+ property: 'color',+ expected: PROBE_TOKENS.secondary,+ inherited: PROBE_TOKENS.primary,+ });+ // The row is the one `text-token-text-secondary` site a person reaches in two clicks.+ expect(painted.actual).toBe(painted.expected);+ // Painting nothing would leave the menu's own primary text color showing through.+ expect(painted.actual).not.toBe(painted.inherited);+ });++ test('a custom theme recolors the account menu email @scenario:a-custom-theme-recolors-the-account-menu-email', async ({+ page,+ }) => {+ const theme = {+ version: 1,+ name: 'e2e-token-utilities',+ // Pinned to light so the desktop-dark project's browser colorScheme cannot+ // select a mode this definition does not carry.+ modes: { light: { colors: { 'rgb-text-secondary': '9 240 120' } } },+ };+ await page.addInitScript((definition) => {+ localStorage.setItem('color-theme', 'light');+ localStorage.setItem('theme-definition', JSON.stringify(definition));+ localStorage.setItem('theme-source', 'definition');+ localStorage.removeItem('theme-colors');+ localStorage.removeItem('theme-name');+ }, theme);++ const email = await openAccountMenu(page);+ await expect(page.locator('html')).toHaveAttribute('data-theme', theme.name);++ // `@theme inline` keeps the utility resolving the custom property applyTheme writes,+ // so a theme switch has to reach the rendered row without rebuilding any CSS.+ await expect+ .poll(+ async () =>+ (+ await paintedColor(email, {+ property: 'color',+ expected: PROBE_TOKENS.secondary,+ inherited: PROBE_TOKENS.primary,+ })+ ).actual,+ )+ .toBe('rgb(9, 240, 120)');+ });++ test('the mention menu keeps its light border @scenario:the-mention-menu-keeps-its-light-border', async ({+ page,+ }) => {+ await page.goto(NEW_CHAT_PATH, { timeout: 15000 });+ const composer = page.getByRole('textbox', { name: 'Message input' });+ await expect(composer).toBeVisible({ timeout: 30000 });+ await composer.click();+ // `@` at the first position is what opens the mention menu.+ await composer.pressSequentially('@');++ const search = page.getByPlaceholder('Mention an endpoint');+ await expect(search).toBeVisible({ timeout: 15000 });+ const menu = page.locator('div.popover').filter({ has: search });+ await expect(menu).toBeVisible();++ const painted = await paintedColor(menu, {+ property: 'borderTopColor',+ expected: '--border-light',+ });+ // The frame carried `border-token-border-light`; with the rule gone and no token+ // resolving, a 1px border falls back to the text color instead of the hairline.+ expect(painted.actual).toBe(painted.expected);+ expect(painted.actual).not.toBe(painted.inherited);+ });+});++test.describe('logged out', () => {+ test.use({ storageState: { cookies: [], origins: [] } });++ test('auth login links keep their color transitions @scenario:auth-login-links-keep-their-color-transitions', async ({+ page,+ }) => {+ const expectColorTransition = async (link: Locator) => {+ await expect(link).toBeVisible({ timeout: 30000 });+ const transition = await link.evaluate((node) => {+ const style = getComputedStyle(node);+ return { property: style.transitionProperty, duration: style.transitionDuration };+ });+ expect(transition.property).toContain('color');+ expect(transition.property).not.toBe('all');+ expect(parseFloat(transition.duration)).toBeGreaterThan(0);+ };++ await page.goto('/register', { timeout: 15000 });+ await expectColorTransition(page.getByRole('link', { name: 'Login', exact: true }));++ await page.goto('/forgot-password', { timeout: 15000 });+ await expectColorTransition(page.getByRole('link', { name: 'Back to Login', exact: true }));++ // Exercise the response state without delivering email; only the rendered link is under test.+ await page.route('**/api/auth/requestPasswordReset', (route) =>+ route.fulfill({ status: 200, json: {} }),+ );+ await page.getByLabel('Email', { exact: true }).fill('[email protected]');+ await page.getByRole('button', { name: 'Continue with password reset' }).click();+ await expect(page.getByRole('form', { name: 'Password reset form' })).not.toBeVisible();+ await expectColorTransition(page.getByRole('link', { name: 'Back to Login', exact: true }));+ });++ test('the login email field transitions only its colors @scenario:the-login-email-field-transitions-only-its-colors', async ({+ page,+ }) => {+ await page.goto('/login', { timeout: 15000 });+ for (const label of ['Email', 'Password']) {+ const field = page.getByLabel(label, { exact: true });+ await expect(field).toBeVisible({ timeout: 30000 });++ const transition = await field.evaluate((node) => {+ const style = getComputedStyle(node);+ return { property: style.transitionProperty, duration: style.transitionDuration };+ });++ // `transition-color` leaves the initial `all` against the 200 ms duration.+ expect(transition.property).not.toBe('all');+ expect(transition.property).toContain('border-color');+ expect(transition.property).toContain('color');+ expect(transition.duration).toBe('0.2s');+ }+ });+});diff --git a/e2e/specs/mock/scenarios/unknown-classes.spec.ts b/e2e/specs/mock/scenarios/unknown-classes.spec.tsnew file mode 100644index 0000000000..b703e2289e--- /dev/null+++ b/e2e/specs/mock/scenarios/unknown-classes.spec.ts@@ -0,0 +1,92 @@+import { expect, test } from '@playwright/test';+import { designMessages, lintStdin, messagesFor } from './lint.helpers';++/**+ * Three classes in this app rendered nothing at all, `transition-color`,+ * `pointer-cursor`, `scrollbar-hide`, because nothing could tell a typo from a+ * utility. Moving the colours into `@theme inline` made the theme readable, which+ * is what lets `no-unknown-classes` ask the installed Tailwind whether a class+ * generates CSS and lets `no-raw-colors` spot a token nobody declared. Both+ * report through the flat config, so both are asked here through a stdin probe.+ */++const MISSPELLED = [+ 'export default () => <div className="transition-color bg-surfce-primary" />;',+ '',+].join('\n');++const CORRECT = [+ 'export default () => <div className="transition-colors bg-surface-primary" />;',+ '',+].join('\n');++test.describe('class and token existence', () => {+ test('compatibility palette utilities still require semantic roles @scenario:compatibility-palette-utilities-still-require-semantic-roles', () => {+ test.setTimeout(60_000);+ const palette = [+ 'text-gray-500',+ 'dark:bg-gray-650/50',+ 'hover:border-green-500',+ 'ring-green-550',+ ];+ for (const root of ['client/src', 'packages/client/src']) {+ const reported = designMessages(+ lintStdin(+ `${root}/__probe__.tsx`,+ `export default () => <div className="${palette.join(' ')}" />;\n`,+ ),+ );+ const raw = messagesFor(reported, 'shadcn/no-raw-colors');+ expect(raw).toHaveLength(palette.length);+ for (const utility of palette) {+ expect(raw.some((message) => message.includes(`"${utility}"`))).toBe(true);+ }+ expect(messagesFor(reported, 'shadcn/no-unknown-classes')).toEqual([]);+ expect(designMessages(lintStdin(`${root}/__probe__.tsx`, CORRECT))).toEqual([]);+ }+ });++ test('an unknown utility class is reported by the linter @scenario:an-unknown-utility-class-is-reported-by-the-linter', () => {+ test.setTimeout(60_000);++ const reported = designMessages(lintStdin('client/src/__probe__.tsx', MISSPELLED));++ /** The class generates no CSS, and the report says so and names the class+ * the author meant, otherwise a typo reads as a deliberate no-op. */+ const unknown = messagesFor(reported, 'shadcn/no-unknown-classes').join('\n');+ expect(unknown).toContain('"transition-color" is not a class this project\'s Tailwind knows');+ expect(unknown).toContain('Did you mean "transition-colors"?');++ /** An undeclared colour token is the same failure wearing a colour's+ * clothes, and it is reported against the declared token list. */+ const raw = messagesFor(reported, 'shadcn/no-raw-colors').join('\n');+ expect(raw).toContain('"bg-surfce-primary" is not a declared theme color');+ expect(raw).toContain('Did you mean "bg-surface-primary"?');++ /** The one variant class the tree still wrote through a hand-rolled token+ * rule, `aria-selected:text-token-text-primary` on the animated tabs,+ * now has nowhere to resolve, and the rules say so rather than leaving the+ * selected tab unstyled. Its semantic replacement is silent. */+ const stale = designMessages(+ lintStdin(+ 'client/src/__probe__.tsx',+ 'export default () => <div className="aria-selected:text-token-text-primary" />;\n',+ ),+ );+ expect(messagesFor(stale, 'shadcn/no-raw-colors').join('\n')).toContain(+ '"aria-selected:text-token-text-primary" is not a declared theme color',+ );+ expect(+ designMessages(+ lintStdin(+ 'client/src/__probe__.tsx',+ 'export default () => <div className="aria-selected:text-text-primary" />;\n',+ ),+ ),+ ).toEqual([]);++ /** The negative control: the correctly spelled neighbours are silent, so the+ * rules are reporting these two classes rather than the shape of the probe. */+ expect(designMessages(lintStdin('client/src/__probe__.tsx', CORRECT))).toEqual([]);+ });+});diff --git a/eslint-suppressions.json b/eslint-suppressions.jsonindex f02d366769..844e87c4b4 100644--- a/eslint-suppressions.json+++ b/eslint-suppressions.json@@ -104,26 +104,29 @@"client/src/components/Auth/Footer.tsx": {"shadcn/no-arbitrary-values": {"count": 1+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Auth/LoginForm.tsx": {"shadcn/no-restyle": {- "count": 41+ "count": 39}},"client/src/components/Auth/Registration.tsx": {"shadcn/no-restyle": {- "count": 41+ "count": 39}},"client/src/components/Auth/RequestPasswordReset.tsx": {"shadcn/no-restyle": {- "count": 16+ "count": 15}},"client/src/components/Auth/ResetPassword.tsx": {"shadcn/no-restyle": {- "count": 56+ "count": 54}},"client/src/components/Auth/TwoFactorScreen.tsx": {@@ -171,6 +174,11 @@"count": 2}},+ "client/src/components/Chat/Input/AddedConvo.tsx": {+ "shadcn/no-raw-colors": {+ "count": 1+ }+ },"client/src/components/Chat/Input/Artifacts.tsx": {"shadcn/no-restyle": {"count": 2@@ -306,6 +314,9 @@"client/src/components/Chat/Input/Files/Table/DataTable.tsx": {"shadcn/no-restyle": {"count": 28+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Chat/Input/HeaderOptions.tsx": {@@ -317,6 +328,9 @@"shadcn/no-raw-colors": {"count": 1},+ "shadcn/no-unknown-classes": {+ "count": 1+ },"shadcn/require-static-classes": {"count": 1}@@ -429,6 +443,9 @@}},"client/src/components/Chat/Landing.tsx": {+ "shadcn/no-raw-colors": {+ "count": 1+ },"shadcn/no-restyle": {"count": 16},@@ -501,6 +518,9 @@"shadcn/no-inline-styles": {"count": 2},+ "shadcn/no-raw-colors": {+ "count": 1+ },"shadcn/no-restyle": {"count": 13}@@ -542,6 +562,11 @@"count": 2}},+ "client/src/components/Chat/Messages/Content/Container.tsx": {+ "shadcn/no-raw-colors": {+ "count": 1+ }+ },"client/src/components/Chat/Messages/Content/DialogImage.tsx": {"shadcn/no-arbitrary-values": {"count": 2@@ -589,6 +614,9 @@"client/src/components/Chat/Messages/Content/MessageContent.tsx": {"shadcn/no-restyle": {"count": 2+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Chat/Messages/Content/Parts/ArtifactRow.tsx": {@@ -603,16 +631,19 @@"shadcn/no-inline-styles": {"count": 9},+ "shadcn/no-raw-colors": {+ "count": 1+ },"shadcn/no-restyle": {"count": 6+ },+ "shadcn/no-unknown-classes": {+ "count": 3}},"client/src/components/Chat/Messages/Content/Parts/BashCall.tsx": {"shadcn/no-inline-styles": {"count": 1- },- "shadcn/no-raw-colors": {- "count": 1}},"client/src/components/Chat/Messages/Content/Parts/CollapsibleText.tsx": {@@ -625,6 +656,14 @@"count": 2}},+ "client/src/components/Chat/Messages/Content/Parts/EmptyText.tsx": {+ "shadcn/no-raw-colors": {+ "count": 1+ },+ "shadcn/no-unknown-classes": {+ "count": 1+ }+ },"client/src/components/Chat/Messages/Content/Parts/ExecuteCode.tsx": {"shadcn/no-arbitrary-values": {"count": 1@@ -682,6 +721,11 @@"count": 1}},+ "client/src/components/Chat/Messages/Content/Parts/SteerPart.tsx": {+ "shadcn/no-unknown-classes": {+ "count": 2+ }+ },"client/src/components/Chat/Messages/Content/Parts/Summary.tsx": {"shadcn/no-arbitrary-values": {"count": 2@@ -696,6 +740,11 @@"count": 1}},+ "client/src/components/Chat/Messages/Content/Parts/Text.tsx": {+ "shadcn/no-unknown-classes": {+ "count": 1+ }+ },"client/src/components/Chat/Messages/Content/Parts/Thinking.tsx": {"shadcn/no-arbitrary-values": {"count": 3@@ -746,6 +795,11 @@"count": 7}},+ "client/src/components/Chat/Messages/Content/SearchContent.tsx": {+ "shadcn/no-unknown-classes": {+ "count": 1+ }+ },"client/src/components/Chat/Messages/Content/ToolApproval.tsx": {"shadcn/no-raw-colors": {"count": 1@@ -805,6 +859,9 @@"shadcn/no-restyle": {"count": 2},+ "shadcn/no-unknown-classes": {+ "count": 1+ },"shadcn/require-static-classes": {"count": 1}@@ -843,7 +900,7 @@},"client/src/components/Chat/Messages/Feedback.tsx": {"shadcn/no-restyle": {- "count": 18+ "count": 17},"shadcn/require-static-classes": {"count": 3@@ -894,6 +951,11 @@"count": 1}},+ "client/src/components/Chat/Messages/PendingTurn.tsx": {+ "shadcn/no-unknown-classes": {+ "count": 1+ }+ },"client/src/components/Chat/Messages/SiblingSwitch.tsx": {"shadcn/no-restyle": {"count": 16@@ -943,6 +1005,9 @@},"shadcn/no-restyle": {"count": 13+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Chat/Subagents/SubagentConversation.tsx": {@@ -1080,6 +1145,11 @@"count": 2}},+ "client/src/components/Endpoints/ConvoIconURL.tsx": {+ "shadcn/no-raw-colors": {+ "count": 1+ }+ },"client/src/components/Endpoints/Icon.tsx": {"shadcn/no-inline-styles": {"count": 2@@ -1089,6 +1159,9 @@"shadcn/no-arbitrary-values": {"count": 1},+ "shadcn/no-raw-colors": {+ "count": 4+ },"shadcn/no-restyle": {"count": 3}@@ -1153,6 +1226,9 @@},"shadcn/no-restyle": {"count": 40+ },+ "shadcn/no-unknown-classes": {+ "count": 2}},"client/src/components/Files/FileList/FileListItem2.tsx": {@@ -1369,6 +1445,9 @@"client/src/components/Nav/AccountSettings.tsx": {"shadcn/no-inline-styles": {"count": 3+ },+ "shadcn/no-unknown-classes": {+ "count": 2}},"client/src/components/Nav/ExportConversation/ExportModal.tsx": {@@ -1389,6 +1468,11 @@"count": 4}},+ "client/src/components/Nav/SearchBar.tsx": {+ "shadcn/no-raw-colors": {+ "count": 1+ }+ },"client/src/components/Nav/Settings/Dialog.tsx": {"shadcn/no-restyle": {"count": 8@@ -1563,6 +1647,9 @@"shadcn/no-inline-styles": {"count": 1},+ "shadcn/no-raw-colors": {+ "count": 1+ },"shadcn/no-restyle": {"count": 4}@@ -1595,6 +1682,9 @@"client/src/components/Prompts/display/PromptTextCard.tsx": {"shadcn/no-restyle": {"count": 2+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Prompts/display/PromptVariables.tsx": {@@ -1613,6 +1703,9 @@"client/src/components/Prompts/editor/PromptEditor.tsx": {"shadcn/no-restyle": {"count": 11+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Prompts/editor/VariablesDropdown.tsx": {@@ -1655,6 +1748,9 @@"shadcn/no-restyle": {"count": 8},+ "shadcn/no-unknown-classes": {+ "count": 1+ },"shadcn/require-static-classes": {"count": 2}@@ -1805,6 +1901,9 @@"shadcn/no-arbitrary-values": {"count": 3},+ "shadcn/no-raw-colors": {+ "count": 1+ },"shadcn/no-restyle": {"count": 9}@@ -2300,6 +2399,9 @@"client/src/components/Skills/display/SkillMarkdownRenderer.tsx": {"shadcn/no-arbitrary-values": {"count": 1+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Skills/display/SkillState.tsx": {@@ -2315,6 +2417,9 @@"client/src/components/Skills/forms/SkillContentEditor.tsx": {"shadcn/no-restyle": {"count": 13+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/Skills/forms/SkillForm.tsx": {@@ -2427,7 +2532,10 @@"count": 1},"shadcn/no-restyle": {- "count": 58+ "count": 56+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"client/src/components/ui/AdminSettingsDialog.tsx": {@@ -2453,6 +2561,11 @@"count": 1}},+ "client/src/components/ui/TermsAndConditionsModal.tsx": {+ "shadcn/no-unknown-classes": {+ "count": 1+ }+ },"client/src/routes/ChatRoute.tsx": {"shadcn/no-restyle": {"count": 2@@ -2476,11 +2589,21 @@"count": 2}},+ "packages/client/src/components/AnimatedSearchInput.tsx": {+ "shadcn/no-raw-colors": {+ "count": 1+ }+ },"packages/client/src/components/Avatar.tsx": {"shadcn/no-inline-styles": {"count": 3}},+ "packages/client/src/components/Badge.tsx": {+ "shadcn/no-unknown-classes": {+ "count": 6+ }+ },"packages/client/src/components/Combobox.tsx": {"shadcn/no-inline-styles": {"count": 2@@ -2549,6 +2672,9 @@"packages/client/src/components/SplitText.tsx": {"shadcn/no-inline-styles": {"count": 7+ },+ "shadcn/no-unknown-classes": {+ "count": 1}},"packages/client/src/components/Toast.tsx": {@@ -2631,4 +2757,4 @@"count": 2}}-}\ No newline at end of file+}diff --git a/eslint.config.mjs b/eslint.config.mjsindex f1d0c82843..bd200b4963 100644--- a/eslint.config.mjs+++ b/eslint.config.mjs@@ -196,11 +196,6 @@ export default [// violations are recorded in eslint-suppressions.json, so these rules gate new and edited// code without a tree-wide migration; see CLAUDE.md, "Theming and styling".//- // `no-unknown-classes` is deliberately not enabled: it asks the installed Tailwind whether a- // class generates CSS and needs Tailwind v4, while this repo runs tailwindcss 3.4 with a JS- // preset. Its grammar fallback would report every preset utility (`duration-theme-fast`,- // `rounded-theme-control`, `icon-md`) as a typo.- //// The client's entry points and helpers are `.jsx`/`.js` — App.jsx among them — so the globs// name those extensions too: the rules have to see them.{@@ -262,6 +257,60 @@ export default [},],'shadcn/require-static-classes': 'error',+ // Now answerable: the rule asks the installed Tailwind whether a class generates CSS, and+ // the app is on v4. Classes declared in a stylesheet Tailwind reads are recognized on their+ // own; these are the ones it cannot see, plain selectors in files loaded separately+ // (style.css families, the library's component CSS) and classes a third party puts in the+ // DOM. Everything outside this list that generates no CSS is reported: the `prose` variants+ // that quietly render nothing today, and the `token-`-prefixed names, which were painting+ // through plain rules in `client/src/style.css` that this change removes in favour of the+ // tokens themselves rather than adding six more names here.+ 'shadcn/no-unknown-classes': [+ 'error',+ {+ allow: [+ // client/src/style.css and the library's component CSS+ 'icon-*',+ 'hover-button',+ 'toast-root',+ 'alert-root',+ 'tooltip',+ 'spinner',+ 'popover-ui',+ 'select-item',+ 'assistant-item',+ 'animated-tab',+ 'animated-tab-list',+ 'animated-tab-panel',+ 'animated-panels',+ 'animate-popover',+ 'animate-popover-bottom',+ 'animate-pulse-slow',+ 'animate-gradient-x',+ 'animate-fadeIn',+ 'slow-pulse',+ 'hide-scrollbar',+ 'scrollbar-gutter-spacer',+ 'active',+ // put in the DOM by a dependency, not by Tailwind+ 'lucide',+ 'lucide-*',+ 'language-*',+ 'i-heroicons-*',+ 'form-check-label',+ // Markers a selector reads rather than Tailwind styling: each one is queried by a+ // stylesheet, a component, or an e2e spec, so it carries no CSS of its own.+ 'popover',+ 'user-turn',+ 'agent-turn',+ 'final-completion',+ 'sibling-content-group',+ 'scroll-animation',+ 'hover-button-active',+ 'open',+ ],+ },+ ],},},{@@ -319,6 +368,7 @@ export default ['shadcn/no-arbitrary-values': 'off','shadcn/no-inline-styles': 'off','shadcn/require-static-classes': 'off',+ 'shadcn/no-unknown-classes': 'off',},},...compatdiff --git a/package-lock.json b/package-lock.jsonindex 62ffbeaa1a..c74a886432 100644--- a/package-lock.json+++ b/package-lock.json@@ -41454,6 +41454,7 @@"react-i18next": "^15.4.0","rimraf": "^6.1.3","tailwindcss": "^4.3.3",+ "tailwindcss-animate": "^1.0.5","tsdown": "^0.22.2","typescript": "^5.9.3"},@@ -41508,7 +41509,8 @@"react-resizable-panels": "^4.7.4","react-textarea-autosize": "^8.4.0","tailwind-merge": "^3.7.0",- "tailwindcss": "^4.3.3"+ "tailwindcss": "^4.3.3",+ "tailwindcss-animate": "^1.0.5"}},"packages/client/node_modules/@adobe/css-tools": {diff --git a/package.json b/package.jsonindex c5281b2b1d..a8d83d848f 100644--- a/package.json+++ b/package.json@@ -113,7 +113,7 @@"e2e:report": "npx playwright show-report e2e/playwright-report","lint:fix": "npm run build:client-package && eslint . --fix --pass-on-unpruned-suppressions","lint": "npm run build:client-package && eslint . --pass-on-unpruned-suppressions",- "lint:design:record": "npm run build:client-package && eslint --no-warn-ignored --suppress-rule shadcn/no-restyle --suppress-rule shadcn/no-raw-colors --suppress-rule shadcn/no-arbitrary-values --suppress-rule shadcn/no-inline-styles --suppress-rule shadcn/require-static-classes client/src packages/client/src",+ "lint:design:record": "npm run build:client-package && eslint --no-warn-ignored --suppress-rule shadcn/no-restyle --suppress-rule shadcn/no-raw-colors --suppress-rule shadcn/no-arbitrary-values --suppress-rule shadcn/no-inline-styles --suppress-rule shadcn/require-static-classes --suppress-rule shadcn/no-unknown-classes client/src packages/client/src","lint:design:suppress": "(npm run --silent lint:design:record || node -e \"\") && npm run lint:design:prune","lint:design:prune": "npm run build:client-package && eslint --no-warn-ignored --prune-suppressions client/src packages/client/src","sort-imports": "node scripts/sort-imports.mts",diff --git a/packages/client/package.json b/packages/client/package.jsonindex 8533c10347..92681296b6 100644--- a/packages/client/package.json+++ b/packages/client/package.json@@ -21,6 +21,7 @@}},"./tailwind-preset": "./tailwind.preset.cjs",+ "./theme.css": "./dist/tokens.css","./style.css": "./dist/style.css","./package.json": "./package.json"},@@ -90,7 +91,8 @@"react-resizable-panels": "^4.7.4","react-textarea-autosize": "^8.4.0","tailwind-merge": "^3.7.0",- "tailwindcss": "^4.3.3"+ "tailwindcss": "^4.3.3",+ "tailwindcss-animate": "^1.0.5"},"devDependencies": {"@babel/core": "^7.28.5",@@ -123,6 +125,7 @@"react-i18next": "^15.4.0","rimraf": "^6.1.3","tailwindcss": "^4.3.3",+ "tailwindcss-animate": "^1.0.5","tsdown": "^0.22.2","typescript": "^5.9.3"}diff --git a/packages/client/src/components/AnimatedTabs.tsx b/packages/client/src/components/AnimatedTabs.tsxindex 2f0b2ba7ef..b58a31f686 100644--- a/packages/client/src/components/AnimatedTabs.tsx+++ b/packages/client/src/components/AnimatedTabs.tsx@@ -21,6 +21,7 @@ export interface AnimatedTabsProps {tabListProps?: Ariakit.TabListProps;containerClassName?: string;defaultSelectedId?: string;+ tone?: 'default' | 'muted';}function usePrevious<T>(value: T) {@@ -59,7 +60,7 @@ const Tab = forwardRef<ElementRef<typeof Ariakit.Tab>, Ariakit.TabProps>(functioelse if (ref) ref.current = node;}}{...props}- className={`animated-tab aria-selected:text-token-text-primary flex items-center justify-center gap-2 border-none text-sm font-medium whitespace-nowrap outline-hidden transition-colors select-none aria-disabled:opacity-50 ${props.className || ''}`}+ className={`animated-tab aria-selected:text-text-primary flex items-center justify-center gap-2 border-none text-sm font-medium whitespace-nowrap outline-hidden transition-colors select-none aria-disabled:opacity-50 ${props.className || ''}`}/>);});@@ -90,6 +91,7 @@ export function AnimatedTabs({containerClassName = '',tabListProps = {},defaultSelectedId,+ tone = 'default',}: AnimatedTabsProps): JSX.Element {const tabIds = tabs.map((tab, index) => tab.id || `tab-${index}`);const firstTabId = defaultSelectedId || tabIds[0];@@ -130,7 +132,7 @@ export function AnimatedTabs({key={tabIds[index]}id={tabIds[index]}disabled={tab.disabled}- className={tabClassName}+ className={cn(tone === 'muted' && 'text-text-secondary', tabClassName)}data-state={tabIds[index] === firstTabId ? 'active' : 'inactive'}>{/* TypeScript workaround for React i18next children type compatibility */}diff --git a/packages/client/src/components/DataTable/DataTable.tsx b/packages/client/src/components/DataTable/DataTable.tsxindex 73fd238582..5a822ad12c 100644--- a/packages/client/src/components/DataTable/DataTable.tsx+++ b/packages/client/src/components/DataTable/DataTable.tsx@@ -570,7 +570,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({aria-label={localize('com_ui_data_table')}>{showToolbar && (- <div className="flex w-full shrink-0 items-center gap-2 border-b border-border-light pr-2 md:gap-3">+ <div className="border-border-light flex w-full shrink-0 items-center gap-2 border-b pr-2 md:gap-3">{shouldShowSearch && <DataTableSearch value={searchTerm} onChange={setSearchTerm} />}{customActionsRenderer &&customActionsRenderer({@@ -582,7 +582,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({)}<divref={tableContainerRef}- className="overflow-anchor-none relative flex min-h-0 flex-1 flex-col overflow-auto will-change-scroll"+ className="relative flex min-h-0 flex-1 flex-col overflow-auto will-change-scroll"style={{WebkitOverflowScrolling: 'touch',@@ -652,7 +652,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({<Buttontype="button"variant="ghost"- className="group h-auto w-full justify-start gap-1 px-0 py-0 text-xs font-medium uppercase tracking-wide text-text-secondary hover:bg-transparent hover:text-text-primary md:gap-1.5"+ className="group text-text-secondary hover:text-text-primary h-auto w-full justify-start gap-1 px-0 py-0 text-xs font-medium tracking-wide uppercase hover:bg-transparent md:gap-1.5"onClick={header.column.getToggleSortingHandler()}>{renderedHeader}@@ -677,7 +677,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({);} else {headerContent = (- <div className="flex items-center text-xs font-medium uppercase tracking-wide text-text-secondary">+ <div className="text-text-secondary flex items-center text-xs font-medium tracking-wide uppercase">{renderedHeader}</div>);@@ -691,7 +691,7 @@ function DataTable<TData extends Record<string, unknown>, TValue>({/* Stuck per cell rather than on <thead>, which does not stayput once the table uses separated borders. The fill has tobe opaque or virtualized rows show through it. */- 'sticky top-0 z-10 h-9 border-b border-border-light bg-surface-dialog px-3 py-2 md:px-4',+ 'border-border-light bg-surface-dialog sticky top-0 z-10 h-9 border-b px-3 py-2 md:px-4',isSelectHeader && 'px-0 text-center',canSort && 'cursor-pointer',meta?.className,@@ -736,14 +736,14 @@ function DataTable<TData extends Record<string, unknown>, TValue>({role="status"aria-live="polite">- <span className="flex size-11 items-center justify-center rounded-full bg-surface-tertiary text-text-tertiary">+ <span className="bg-surface-tertiary text-text-tertiary flex size-11 items-center justify-center rounded-full">{searchTerm ? (<SearchX className="size-5" aria-hidden="true" />) : (<Inbox className="size-5" aria-hidden="true" />)}</span>- <Label className="text-center text-sm text-text-secondary">+ <Label className="text-text-secondary text-center text-sm">{searchTerm ? localize('com_ui_no_search_results') : localize('com_ui_no_data')}</Label></div>diff --git a/packages/client/src/components/Input.tsx b/packages/client/src/components/Input.tsxindex 0db5998670..9ce9211114 100644--- a/packages/client/src/components/Input.tsx+++ b/packages/client/src/components/Input.tsx@@ -3,18 +3,27 @@ import { fieldControl } from './Field';import { cn } from '~/utils';import './Field.css';-export type InputProps = React.InputHTMLAttributes<HTMLInputElement>;+export type InputProps = React.InputHTMLAttributes<HTMLInputElement> & {+ colorTransition?: boolean;+};const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>> =- React.forwardRef<HTMLInputElement, InputProps>(({ className, ...props }, ref) => {- return (- <input- className={cn(fieldControl, 'ring-offset-surface-primary', className ?? '')}- ref={ref}- {...props}- />- );- });+ React.forwardRef<HTMLInputElement, InputProps>(+ ({ className, colorTransition, ...props }, ref) => {+ return (+ <input+ className={cn(+ fieldControl,+ 'ring-offset-surface-primary',+ colorTransition && 'transition-colors',+ className ?? '',+ )}+ ref={ref}+ {...props}+ />+ );+ },+ );Input.displayName = 'Input';diff --git a/packages/client/src/components/SecretInput.tsx b/packages/client/src/components/SecretInput.tsxindex 2461239624..0703eb19e2 100644--- a/packages/client/src/components/SecretInput.tsx+++ b/packages/client/src/components/SecretInput.tsx@@ -6,6 +6,7 @@ import { cn } from '~/utils';export interface SecretInputPropsextends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {+ colorTransition?: boolean;/** Show the built-in copy button */showCopy?: boolean;/** Custom copy control rendered inside the input, in place of the built-in one */@@ -30,6 +31,7 @@ const SecretInput: React.ForwardRefExoticComponent<id,label,className,+ colorTransition,showCopy = false,copyButton,labelClassName,@@ -82,6 +84,7 @@ const SecretInput: React.ForwardRefExoticComponent<type={isVisible ? 'text' : 'password'}className={cn('border-border-light placeholder:text-text-secondary flex h-10 w-full rounded-lg border bg-transparent py-2 pl-3 text-sm focus-visible:outline-hidden disabled:cursor-not-allowed disabled:opacity-50',+ colorTransition && 'transition-colors',className ?? '',copyButton != null || showCopy ? 'pr-20' : 'pr-11',)}diff --git a/packages/client/src/components/SegmentedMeter.spec.tsx b/packages/client/src/components/SegmentedMeter.spec.tsxindex 71a3fc7aa1..d3579fa3f8 100644--- a/packages/client/src/components/SegmentedMeter.spec.tsx+++ b/packages/client/src/components/SegmentedMeter.spec.tsx@@ -1,11 +1,12 @@import '@testing-library/jest-dom';+import { join } from 'node:path';+import { readFileSync } from 'node:fs';import { render, screen } from '@testing-library/react';import type { ThemeDefinition } from '../theme/types';import type { MeterSegment } from './SegmentedMeter';import { resolveTheme, validateThemeDefinition, THEME_VERSION } from '../theme/registry';import { applyResolvedTheme, clearAppliedTheme } from '../theme/utils/applyTheme';import { SegmentedMeter, MeterSwatch, SERIES_SLOT_COUNT } from './SegmentedMeter';-import { createTailwindColors } from '../theme/utils/createTailwindColors';const segments: MeterSegment[] = [{ id: 'a', value: 500, slot: 1, outlined: true },@@ -216,7 +217,7 @@ describe('reference theme', () => {expect(markup).not.toMatch(/#[0-9a-f]{3,8}\b/i);expect(markup).not.toMatch(/\brgba?\((?!var\()/);- const colours = createTailwindColors();+ const tokens = readFileSync(join(__dirname, '../theme/tokens.css'), 'utf8');const meter = screen.getByTestId('meter');const slotOf = (el: Element) => /\bbg-series-(\d)\b/.exec(el.className)?.[1];@@ -224,7 +225,7 @@ describe('reference theme', () => {const slot = slotOf(el) ?? /\bbg-series-(\d)\/25\b/.exec(el.className)?.[1];expect(slot).toBeDefined();/** The utility the mark wears resolves to the variable the theme just set. */- expect(colours[`series-${slot}`]).toBe(`rgb(var(--series-${slot}) / <alpha-value>)`);+ expect(tokens).toContain(`--color-series-${slot}: rgb(var(--series-${slot}));`);});});});diff --git a/packages/client/src/theme/README.md b/packages/client/src/theme/README.mdindex 3f9b0f6e2c..0d1a89193d 100644--- a/packages/client/src/theme/README.md+++ b/packages/client/src/theme/README.md@@ -102,13 +102,22 @@ function App() {### 3. Set Up Your Base CSS-Ensure your app has CSS variables defined as fallbacks. Every theme variable must-hold a **bare `R G B` channel triplet**, not a complete CSS color, because the-Tailwind color map wraps them as `rgb(var(--x) / <alpha-value>)` so that opacity-modifiers such as `bg-surface-primary/50` work:+Import the published token stylesheet and define the variables it resolves. Every theme+variable must hold a **bare `R G B` channel triplet**, not a complete CSS color, because+each token wraps them as `rgb(var(--x))` so that opacity modifiers such as+`bg-surface-primary/50` work:```css/* style.css */+@import 'tailwindcss';+/* Declares --color-text-primary, --color-surface-primary and the rest of the tokens as+ * `@theme inline`, so every utility resolves the custom property below at runtime. */+@import '@librechat/client/theme.css';+/* v4 reads no config by default: this is what loads the preset, the content globs and+ * class-based dark mode from step 4. This app's own entry does the same+ * (`client/src/style.css`), and so does the library's (`src/theme/theme.css`). */+@config './tailwind.config.js';+:root {--white: 255 255 255;--gray-800: 33 33 33;@@ -136,6 +145,11 @@ itself: `color: rgb(var(--text-primary));`.> (`--text-primary: #212121`). Hex, `rgb(...)`, and named colors now produce> invalid declarations and must be converted to channel triplets.+> **Breaking change:** the color map used to be built in JavaScript by+> `createTailwindColors()` and spread into `theme.extend.colors`. Both are gone. The tokens+> are declared in CSS, which is what lets a linter and an editor resolve them; a config that+> still defines a `colors` block for these names shadows them and can be deleted.+### 4. Configure TailwindUpdate your `tailwind.config.js`:@@ -147,28 +161,25 @@ module.exports = {presets: [libreChatTailwindPreset],content: ['./src/**/*.{js,jsx,ts,tsx}',- // Include component library files- './node_modules/@librechat/client/dist/**/*.js',+ // Include component library files: tsdown emits .mjs/.cjs, never .js+ './node_modules/@librechat/client/dist/**/*.{js,mjs,cjs}',],darkMode: ['class'],- theme: {- extend: {- colors: {- // Wrap each channel triplet so opacity modifiers keep working- 'text-primary': 'rgb(var(--text-primary) / <alpha-value>)',- 'surface-primary': 'rgb(var(--surface-primary) / <alpha-value>)',- 'brand-purple': 'rgb(var(--brand-purple) / <alpha-value>)',- // ... other colors- },- },- },};```+The semantic colors come from the stylesheet imported in step 3, so the config carries only content,+dark mode and the preset, and it only applies through the `@config` line in that stylesheet:+v4 loads no config file on its own, so without the directive the preset, the `content` globs+and class-based dark mode are all silently absent.+The published preset supplies the semantic appearance utilities used by theme-aware componentvariants, including `h-theme-control`, `rounded-theme-control`, `gap-theme-compact`, and`duration-theme-fast`. Keep the preset enabled even when defining additional project utilities.+The published stylesheet and preset preserve the host's standard Tailwind color palettes.+LibreChat's legacy gray and green compatibility scales apply only to its repository builds.+The package requires Tailwind v4 and declares `tailwindcss: ^4.3.3` as a peer dependency: thepublished components emit v4-only utilities such as `outline-hidden`, `shadow-xs` and`origin-(--radix-…)`, which Tailwind 3 silently generates nothing for.@@ -186,12 +197,12 @@ below are never compiled and the import fails with Tailwind's direct-plugin erroTailwind 4 does not look for a JavaScript config on its own, so writing the file above is notenough: the stylesheet has to load it, next to the import that pulls Tailwind in. Without the-directive the preset, the package content glob, the semantic colors and the `high-contrast:`-variant are all absent, and the published components render with most of their classes-ungenerated. The SPA does exactly this at the top of `client/src/style.css`:+directive the preset, the package content glob and the `high-contrast:` variant are absent,+and the published components render with most of their classes ungenerated. A consumer uses the same import order as the SPA's `client/src/style.css`:```css@import 'tailwindcss';+@import '@librechat/client/theme.css';@config '../tailwind.config.js';@import '@librechat/client/style.css';@@ -201,6 +212,10 @@ The package stylesheet carries the component CSS and the one preflight rule thedepend on — Tailwind 3 gave every `button` a pointer cursor and Tailwind 4 does not — so importit once, after Tailwind.+`tailwindcss-animate` is a peer dependency too, and the preset registers it: the components' own+`animate-in`, `fade-in-0`, `zoom-in-95` and `slide-in-from-*` classes are its utilities, so a+consumer that loads the preset gets them without configuring anything.+### 5. Use Theme Colors in Components```tsx@@ -456,8 +471,8 @@ packages/client/src/theme/│ └── index.ts # Theme exports├── utils/│ ├── applyTheme.ts # Apply CSS variables-│ ├── tailwindConfig.ts # Tailwind helpers-│ └── createTailwindColors.js+│ └── tailwindConfig.ts # Tailwind helpers+├── tokens.css # Tailwind color tokens (published as @librechat/client/theme.css)├── README.md # This documentation└── index.ts # Main exports```diff --git a/packages/client/src/theme/semanticTokens.spec.ts b/packages/client/src/theme/semanticTokens.spec.tsindex cf3840d624..928f46b15e 100644--- a/packages/client/src/theme/semanticTokens.spec.ts+++ b/packages/client/src/theme/semanticTokens.spec.ts@@ -2,7 +2,6 @@ import { join } from 'node:path';import { readFileSync } from 'node:fs';import type { IThemeRGB } from './types';import { highContrastDarkTheme, highContrastLightTheme } from './themes/highContrast';-import { createTailwindColors } from './utils/createTailwindColors';import { defaultTheme } from './themes/default';import { darkTheme } from './themes/dark';@@ -315,12 +314,12 @@ describe('categorical series scale', () => {});});- it('exposes each slot as a Tailwind utility backed by its CSS variable', () => {- const colors = createTailwindColors();+ it('exposes each slot as a Tailwind color backed by its CSS variable', () => {+ const tokens = readFileSync(join(__dirname, 'tokens.css'), 'utf8');seriesTokens.forEach((token) => {const property = token.slice(4);- expect(colors[property]).toBe(`rgb(var(--${property}) / <alpha-value>)`);+ expect(tokens).toContain(`--color-${property}: rgb(var(--${property}));`);});});});diff --git a/packages/client/src/theme/tailwind.spec.js b/packages/client/src/theme/tailwind.spec.jsindex 0e4995b936..091bd36bfa 100644--- a/packages/client/src/theme/tailwind.spec.js+++ b/packages/client/src/theme/tailwind.spec.js@@ -16,13 +16,13 @@ const { defaultAppearance, themeAppearanceProperties } = require('./registry');const packageRoot = path.resolve(__dirname, '../..');/**- * Compiles the package's Tailwind config the way an app consuming `./tailwind-preset` does, and- * returns the CSS for `candidates`. Tailwind v4 has no `resolveConfig`, and a resolved config- * would only prove the preset's objects merged; what a consumer actually depends on is that the- * appearance utilities generate and fall back to the registry's defaults.+ * Compiles the library's theme entry, the same file an app or tool loads, and returns the CSS+ * for `candidates`. Tailwind v4 has no `resolveConfig`, and a resolved config would only prove+ * the preset's objects merged; what a consumer actually depends on is that the appearance+ * utilities generate and fall back to the registry's defaults.*/async function generate(candidates) {- const compiler = await compile('@import "tailwindcss";\n@config "./tailwind.config.js";\n', {+ const compiler = await compile(`@import './src/theme/theme.css';\n`, {base: packageRoot,async loadModule(id, base) {const modulePath = id.startsWith('.') ? path.resolve(base, id) : require.resolve(id);@@ -48,6 +48,16 @@ async function generate(candidates) {}describe('LibreChat Tailwind preset', () => {+ it('generates every component animation and its keyframes together', async () => {+ const names = ['loading-dot', 'accordion-down', 'accordion-up', 'caret-blink'];+ const css = await generate(names.map((name) => `animate-${name}`));++ for (const name of names) {+ expect(css).toContain(`.animate-${name}`);+ expect(css).toContain(`@keyframes ${name}`);+ }+ });+it('publishes the appearance roles without removing Tailwind defaults', async () => {expect(packageConfig.presets).toContain(tailwindPreset);@@ -102,13 +112,18 @@ describe('LibreChat Tailwind preset', () => {* reach is not a floor, so the registration is asserted, not just the value. */it('registers the appearance variants the utilities are written against', () => {const variants = {};- tailwindPreset.plugins.forEach((plugin) =>- plugin({- addVariant: (name, value) => {- variants[name] = value;- },- }),- );+ /** The preset also carries `tailwindcss-animate`, which Tailwind hands an+ * object rather than a bare function; the variants live in the plugin this+ * file owns, so only the callable entries are invoked here. */+ tailwindPreset.plugins+ .filter((plugin) => typeof plugin === 'function')+ .forEach((plugin) =>+ plugin({+ addVariant: (name, value) => {+ variants[name] = value;+ },+ }),+ );/** `any-pointer`, not `pointer`: the floor has to apply to a 2-in-1's* touchscreen while its trackpad is the primary device and reports `fine`. */diff --git a/packages/client/src/theme/theme.css b/packages/client/src/theme/theme.cssnew file mode 100644index 0000000000..5520706648--- /dev/null+++ b/packages/client/src/theme/theme.css@@ -0,0 +1,15 @@+/**+ * Repository entry for the library lint and compile checks. The app composes the same+ * semantic tokens and legacy compatibility scales in client/src/style.css.+ * Consumers import tokens.css through the package export and use the published preset;+ * neither public entry overrides their standard Tailwind palettes.+ */+@import 'tailwindcss';+@import './tokens.css';+@config '../../tailwind.config.js';++/* Close the legacy palette scales only inside this repository. */+@theme inline {+ --color-gray-*: initial;+ --color-green-*: initial;+}diff --git a/packages/client/src/theme/tokens.css b/packages/client/src/theme/tokens.cssnew file mode 100644index 0000000000..b001bd6643--- /dev/null+++ b/packages/client/src/theme/tokens.css@@ -0,0 +1,114 @@+/**+ * The semantic Tailwind color tokens, and the single source for them.+ *+ * Every semantic token resolves to a CSS custom property that ThemeProvider/applyTheme+ * rewrites at runtime, which is what `@theme inline` is for: the value is inlined into each+ * utility instead of being frozen into a `--color-*` variable, so switching a theme+ * re-colors the app without regenerating CSS. Those properties hold bare `R G B` triplets+ * (see client/src/style.css), hence the `rgb()` wrapper; a token with an intrinsic alpha+ * multiplies in its companion `--x-alpha` property, and Tailwind composes any `/50`+ * modifier on top through color-mix.+ *+ * client/src/style.css imports this file, and `@librechat/client/theme.css` publishes it.+ * Declaring a token here is what makes `bg-<token>` exist; @shadcn/lint reads these+ * declarations, so a name that is not here is reported rather than silently rendering+ * nothing.+ */+@theme inline {+ /* brand and surfaces */+ --color-brand-purple: rgb(var(--brand-purple));+ --color-presentation: rgb(var(--presentation));+ --color-accent-primary: rgb(var(--accent-primary));+ --color-accent-primary-hover: rgb(var(--accent-primary-hover));+ --color-ring-primary: rgb(var(--ring-primary));+ --color-header-primary: rgb(var(--header-primary));+ --color-header-hover: rgb(var(--header-hover));+ --color-header-button-hover: rgb(var(--header-button-hover));+ --color-surface-active: rgb(var(--surface-active));+ --color-surface-active-alt: rgb(var(--surface-active-alt));+ --color-surface-hover: rgb(var(--surface-hover));+ --color-surface-hover-alt: rgb(var(--surface-hover-alt));+ --color-surface-composer-hover: rgb(var(--surface-composer-hover));+ --color-surface-primary: rgb(var(--surface-primary));+ --color-surface-primary-alt: rgb(var(--surface-primary-alt));+ --color-surface-primary-contrast: rgb(var(--surface-primary-contrast));+ --color-surface-secondary: rgb(var(--surface-secondary));+ --color-surface-secondary-alt: rgb(var(--surface-secondary-alt));+ --color-surface-tertiary: rgb(var(--surface-tertiary));+ --color-surface-tertiary-alt: rgb(var(--surface-tertiary-alt));+ --color-surface-dialog: rgb(var(--surface-dialog));+ --color-surface-overlay: rgb(var(--surface-overlay));+ --color-surface-submit: rgb(var(--surface-submit));+ --color-surface-submit-hover: rgb(var(--surface-submit-hover));+ --color-surface-destructive: rgb(var(--surface-destructive));+ --color-surface-destructive-hover: rgb(var(--surface-destructive-hover));+ --color-surface-chat: rgb(var(--surface-chat));+ --color-surface-code: rgb(var(--surface-code));+ --color-surface-qr: rgb(var(--surface-qr));+ --color-surface-inverted: rgb(var(--surface-inverted));+ --color-surface-inverted-hover: rgb(var(--surface-inverted-hover));+ --color-surface-fixed: rgb(var(--surface-fixed));+ --color-surface-fixed-hover: rgb(var(--surface-fixed-hover));++ /* text */+ --color-text-primary: rgb(var(--text-primary));+ --color-text-secondary: rgb(var(--text-secondary));+ --color-text-secondary-alt: rgb(var(--text-secondary-alt));+ --color-text-tertiary: rgb(var(--text-tertiary));+ --color-text-muted: rgb(var(--text-muted));+ --color-text-warning: rgb(var(--text-warning));+ --color-text-destructive: rgb(var(--text-destructive));+ --color-text-inverted: rgb(var(--text-inverted));+ --color-text-fixed: rgb(var(--text-fixed));+ --color-text-on-status: rgb(var(--text-on-status));++ /* links */+ --color-link: rgb(var(--link));+ --color-link-hover: rgb(var(--link-hover));+ --color-link-visited: rgb(var(--link-visited));++ /* borders */+ --color-border-light: rgb(var(--border-light) / var(--border-light-alpha, 1));+ --color-border-medium: rgb(var(--border-medium) / var(--border-medium-alpha, 1));+ --color-border-medium-alt: rgb(var(--border-medium-alt));+ --color-border-heavy: rgb(var(--border-heavy) / var(--border-heavy-alpha, 1));+ --color-border-xheavy: rgb(var(--border-xheavy) / var(--border-xheavy-alpha, 1));+ --color-border-destructive: rgb(var(--border-destructive));++ /* status */+ --color-status-success: rgb(var(--status-success));+ --color-status-success-subtle: rgb(var(--status-success-subtle));+ --color-status-success-border: rgb(var(--status-success-border));+ --color-status-success-strong: rgb(var(--status-success-strong));+ --color-status-info: rgb(var(--status-info));+ --color-status-info-subtle: rgb(var(--status-info-subtle));+ --color-status-info-border: rgb(var(--status-info-border));+ --color-status-info-strong: rgb(var(--status-info-strong));+ --color-status-warning: rgb(var(--status-warning));+ --color-status-warning-subtle: rgb(var(--status-warning-subtle));+ --color-status-warning-border: rgb(var(--status-warning-border));+ --color-status-warning-strong: rgb(var(--status-warning-strong));+ --color-status-error: rgb(var(--status-error));+ --color-status-error-subtle: rgb(var(--status-error-subtle));+ --color-status-error-border: rgb(var(--status-error-border));+ --color-status-error-strong: rgb(var(--status-error-strong));+ --color-status-neutral: rgb(var(--status-neutral));+ --color-status-neutral-subtle: rgb(var(--status-neutral-subtle));+ --color-status-neutral-border: rgb(var(--status-neutral-border));+ --color-status-verified: rgb(var(--status-verified));++ /* data series */+ --color-series-1: rgb(var(--series-1));+ --color-series-2: rgb(var(--series-2));+ --color-series-3: rgb(var(--series-3));+ --color-series-4: rgb(var(--series-4));+ --color-series-5: rgb(var(--series-5));+ --color-series-6: rgb(var(--series-6));+ --color-series-7: rgb(var(--series-7));+ --color-series-8: rgb(var(--series-8));++ /* charts and controls */+ --color-chart-widget-surface: rgb(var(--chart-widget-surface));+ --color-chart-widget-stroke: rgb(var(--chart-widget-stroke));+ --color-switch-unchecked: rgb(var(--switch-unchecked));+}diff --git a/packages/client/src/theme/tokens.spec.ts b/packages/client/src/theme/tokens.spec.tsnew file mode 100644index 0000000000..5719dba97a--- /dev/null+++ b/packages/client/src/theme/tokens.spec.ts@@ -0,0 +1,104 @@+import fs from 'fs';+import path from 'path';+import fsp from 'fs/promises';+import { compile } from 'tailwindcss';+import { deserialize, serialize } from 'v8';+import { defaultTheme } from './themes/default';++/** Tailwind's compiler clones its theme with `structuredClone`, which jsdom does not provide.+ * V8 serialization is the same structured-clone algorithm Node's global uses. */+globalThis.structuredClone ??= <T>(value: T): T => deserialize(serialize(value)) as T;++const tokensPath = path.resolve(__dirname, 'tokens.css');+const tokens = fs.readFileSync(tokensPath, 'utf8');+const declared = new Set(+ Array.from(tokens.matchAll(/--color-([\w-]+):/g), (match) => match[1]).filter(+ (name) => !name.endsWith('*'),+ ),+);++/**+ * Theme properties consumed by stylesheets rather than by utilities: the shimmer animation and+ * the code-syntax palette are set in CSS, so they carry no `bg-`/`text-` class and need no+ * Tailwind color token.+ */+const cssOnlyFamilies = /^(shimmer|syntax)-/;++async function generate(+ candidates: string[],+ entry = `@import 'tailwindcss';\n@import './tokens.css';\n@config '../../tailwind.preset.cjs';\n`,+) {+ const compiler = await compile(entry, {+ base: __dirname,+ async loadModule(id: string, base: string) {+ const modulePath = id.startsWith('.') ? path.resolve(base, id) : require.resolve(id);+ /** Tailwind hands this callback whatever `@config`/`@plugin` names, so the specifier is+ * only known at runtime; a static import cannot express it. */+ const loaded = (await import(modulePath)) as { default?: unknown };+ return {+ base: path.dirname(modulePath),+ module: loaded.default ?? loaded,+ path: modulePath,+ };+ },+ async loadStylesheet(id: string, base: string) {+ /** Resolved through package.json: jest's moduleNameMapper turns a `.css` request into a+ * style stub, which would hand Tailwind JavaScript to parse. */+ const stylesheet =+ id === 'tailwindcss'+ ? path.join(path.dirname(require.resolve('tailwindcss/package.json')), 'index.css')+ : path.resolve(base, id);+ return {+ base: path.dirname(stylesheet),+ content: await fsp.readFile(stylesheet, 'utf8'),+ path: stylesheet,+ };+ },+ });++ return compiler.build(candidates);+}++describe('theme color tokens', () => {+ it('exposes every theme color the registry can set', () => {+ const missing = Object.keys(defaultTheme)+ .map((property) => property.replace(/^rgb-/, ''))+ .filter((token) => !cssOnlyFamilies.test(token) && !declared.has(token));++ expect(missing).toEqual([]);+ });++ it('resolves a token to the custom property the theme rewrites at runtime', async () => {+ const css = await generate(['bg-surface-primary', 'text-text-secondary', 'bg-series-1']);++ expect(css).toContain('rgb(var(--surface-primary))');+ expect(css).toContain('rgb(var(--text-secondary))');+ expect(css).toContain('rgb(var(--series-1))');+ });++ it('keeps a border token on its intrinsic alpha and still takes an opacity modifier', async () => {+ const css = await generate(['border-border-light', 'bg-surface-primary/50']);++ expect(css).toContain('rgb(var(--border-light) / var(--border-light-alpha, 1))');+ expect(css).toContain('color-mix(in oklab, rgb(var(--surface-primary)) 50%');+ });++ it.each(['./theme.css', '../../../../client/src/style.css'])(+ '%s preserves closed compatibility palettes without declaring them as semantic tokens',+ async (repositoryEntry) => {+ expect(declared.has('gray-650')).toBe(false);+ expect(declared.has('green-500')).toBe(false);++ const css = await generate(+ ['bg-gray-500', 'bg-gray-650', 'text-green-500', 'bg-gray-950', 'bg-green-950'],+ `@import '${repositoryEntry}';\n`,+ );++ expect(css).toMatch(/\.bg-gray-500\s*\{\s*background-color:\s*#595959;/);+ expect(css).toMatch(/\.bg-gray-650\s*\{\s*background-color:\s*#393939;/);+ expect(css).toMatch(/\.text-green-500\s*\{\s*color:\s*#10a37f;/);+ expect(css).not.toContain('.bg-gray-950');+ expect(css).not.toContain('.bg-green-950');+ },+ );+});diff --git a/packages/client/src/theme/utils/createTailwindColors.js b/packages/client/src/theme/utils/createTailwindColors.jsdeleted file mode 100644index 3c5c044a7f..0000000000--- a/packages/client/src/theme/utils/createTailwindColors.js+++ /dev/null@@ -1,159 +0,0 @@-/**- * Single source of truth for the Tailwind semantic color palette.- *- * Both Tailwind configs consume this so the `client` SPA and the- * `@librechat/client` package generate identical color utilities and can- * never drift apart:- * - client/tailwind.config.cjs- * - packages/client/tailwind.config.js- *- * Semantic tokens resolve to CSS custom properties defined in- * client/src/style.css (`html`, `.dark`, `.gizmo` blocks). Those variables hold- * bare `R G B` channel triplets, so `cssVar` wraps them as- * `rgb(var(--x) / <alpha-value>)`. This makes opacity modifiers work, e.g.- * `bg-surface-primary/50`. Tokens with an intrinsic alpha use a companion- * `--x-alpha` variable that is multiplied by Tailwind's opacity modifier. Every- * token is an `R G B` triplet, so a direct `var(--token)` usage in plain CSS- * must wrap the channel triplet itself, e.g. `color: rgb(var(--text-primary))`.- */--const palette = {- gray: {- 20: '#ececf1',- 50: '#f7f7f8',- 100: '#ececec',- 200: '#e3e3e3',- 300: '#cdcdcd',- 400: '#999696',- 500: '#595959',- 600: '#424242',- 650: '#393939',- 700: '#2f2f2f',- 800: '#212121',- 850: '#171717',- 900: '#0d0d0d',- },- green: {- 50: '#f1f9f7',- 100: '#def2ed',- 200: '#a6e5d6',- 300: '#6dc8b9',- 400: '#41a79d',- 500: '#10a37f',- 550: '#349072',- 600: '#126e6b',- 700: '#0a4f53',- 800: '#06373e',- 900: '#031f29',- },-};--const cssVar = (name) => `rgb(var(${name}) / <alpha-value>)`;-const cssVarWithAlpha = (name) => `rgb(var(${name}) / calc(var(${name}-alpha, 1) * <alpha-value>))`;--/**- * Creates the Tailwind `theme.extend.colors` object backed by CSS variables.- * This allows dynamic theme switching by changing CSS variable values at- * runtime (see ThemeProvider / applyTheme).- */-function createTailwindColors() {- return {- ...palette,-- 'brand-purple': cssVar('--brand-purple'),- presentation: cssVar('--presentation'),-- 'text-primary': cssVar('--text-primary'),- 'text-secondary': cssVar('--text-secondary'),- 'text-secondary-alt': cssVar('--text-secondary-alt'),- 'text-tertiary': cssVar('--text-tertiary'),- 'text-muted': cssVar('--text-muted'),- 'chart-widget-surface': cssVar('--chart-widget-surface'),- 'chart-widget-stroke': cssVar('--chart-widget-stroke'),- 'text-warning': cssVar('--text-warning'),- 'text-destructive': cssVar('--text-destructive'),-- link: cssVar('--link'),- 'link-hover': cssVar('--link-hover'),- 'link-visited': cssVar('--link-visited'),-- 'accent-primary': cssVar('--accent-primary'),- 'accent-primary-hover': cssVar('--accent-primary-hover'),-- 'ring-primary': cssVar('--ring-primary'),-- 'header-primary': cssVar('--header-primary'),- 'header-hover': cssVar('--header-hover'),- 'header-button-hover': cssVar('--header-button-hover'),-- 'surface-active': cssVar('--surface-active'),- 'surface-active-alt': cssVar('--surface-active-alt'),- 'surface-hover': cssVar('--surface-hover'),- 'surface-hover-alt': cssVar('--surface-hover-alt'),- 'surface-composer-hover': cssVar('--surface-composer-hover'),- 'surface-primary': cssVar('--surface-primary'),- 'surface-primary-alt': cssVar('--surface-primary-alt'),- 'surface-primary-contrast': cssVar('--surface-primary-contrast'),- 'surface-secondary': cssVar('--surface-secondary'),- 'surface-secondary-alt': cssVar('--surface-secondary-alt'),- 'surface-tertiary': cssVar('--surface-tertiary'),- 'surface-tertiary-alt': cssVar('--surface-tertiary-alt'),- 'surface-dialog': cssVar('--surface-dialog'),- 'surface-overlay': cssVar('--surface-overlay'),- 'surface-submit': cssVar('--surface-submit'),- 'surface-submit-hover': cssVar('--surface-submit-hover'),- 'surface-destructive': cssVar('--surface-destructive'),- 'surface-destructive-hover': cssVar('--surface-destructive-hover'),- 'surface-chat': cssVar('--surface-chat'),- 'surface-code': cssVar('--surface-code'),- 'surface-qr': cssVar('--surface-qr'),- 'surface-inverted': cssVar('--surface-inverted'),- 'surface-inverted-hover': cssVar('--surface-inverted-hover'),- 'text-inverted': cssVar('--text-inverted'),- 'surface-fixed': cssVar('--surface-fixed'),- 'surface-fixed-hover': cssVar('--surface-fixed-hover'),- 'text-fixed': cssVar('--text-fixed'),-- 'border-light': cssVarWithAlpha('--border-light'),- 'border-medium': cssVarWithAlpha('--border-medium'),- 'border-medium-alt': cssVar('--border-medium-alt'),- 'border-heavy': cssVarWithAlpha('--border-heavy'),- 'border-xheavy': cssVarWithAlpha('--border-xheavy'),- 'border-destructive': cssVar('--border-destructive'),-- 'status-success': cssVar('--status-success'),- 'status-success-subtle': cssVar('--status-success-subtle'),- 'status-success-border': cssVar('--status-success-border'),- 'status-success-strong': cssVar('--status-success-strong'),- 'status-info': cssVar('--status-info'),- 'status-info-subtle': cssVar('--status-info-subtle'),- 'status-info-border': cssVar('--status-info-border'),- 'status-info-strong': cssVar('--status-info-strong'),- 'status-warning': cssVar('--status-warning'),- 'status-warning-subtle': cssVar('--status-warning-subtle'),- 'status-warning-border': cssVar('--status-warning-border'),- 'status-warning-strong': cssVar('--status-warning-strong'),- 'status-error': cssVar('--status-error'),- 'status-error-subtle': cssVar('--status-error-subtle'),- 'status-error-border': cssVar('--status-error-border'),- 'status-error-strong': cssVar('--status-error-strong'),- 'status-neutral': cssVar('--status-neutral'),- 'status-neutral-subtle': cssVar('--status-neutral-subtle'),- 'status-neutral-border': cssVar('--status-neutral-border'),- 'status-verified': cssVar('--status-verified'),- 'text-on-status': cssVar('--text-on-status'),-- 'series-1': cssVar('--series-1'),- 'series-2': cssVar('--series-2'),- 'series-3': cssVar('--series-3'),- 'series-4': cssVar('--series-4'),- 'series-5': cssVar('--series-5'),- 'series-6': cssVar('--series-6'),- 'series-7': cssVar('--series-7'),- 'series-8': cssVar('--series-8'),-- 'switch-unchecked': cssVar('--switch-unchecked'),- };-}--module.exports = { createTailwindColors };diff --git a/packages/client/src/theme/utils/createTailwindColors.spec.js b/packages/client/src/theme/utils/createTailwindColors.spec.jsdeleted file mode 100644index 8325c4b82b..0000000000--- a/packages/client/src/theme/utils/createTailwindColors.spec.js+++ /dev/null@@ -1,39 +0,0 @@-const { createTailwindColors } = require('./createTailwindColors');--describe('createTailwindColors', () => {- it('includes the gray midpoint used by the dark hover surface', () => {- const colors = createTailwindColors();-- expect(colors.gray[650]).toBe('#393939');- });-- it('exposes semantic overlay and strong status colors', () => {- const colors = createTailwindColors();-- expect(colors['surface-overlay']).toBe('rgb(var(--surface-overlay) / <alpha-value>)');- expect(colors['status-success-strong']).toBe(- 'rgb(var(--status-success-strong) / <alpha-value>)',- );- expect(colors['text-on-status']).toBe('rgb(var(--text-on-status) / <alpha-value>)');- expect(colors['surface-composer-hover']).toBe(- 'rgb(var(--surface-composer-hover) / <alpha-value>)',- );- });-- it('combines intrinsic border alpha with Tailwind opacity modifiers', () => {- const colors = createTailwindColors();-- expect(colors['border-light']).toBe(- 'rgb(var(--border-light) / calc(var(--border-light-alpha, 1) * <alpha-value>))',- );- expect(colors['border-medium']).toBe(- 'rgb(var(--border-medium) / calc(var(--border-medium-alpha, 1) * <alpha-value>))',- );- expect(colors['border-heavy']).toBe(- 'rgb(var(--border-heavy) / calc(var(--border-heavy-alpha, 1) * <alpha-value>))',- );- expect(colors['border-xheavy']).toBe(- 'rgb(var(--border-xheavy) / calc(var(--border-xheavy-alpha, 1) * <alpha-value>))',- );- });-});diff --git a/packages/client/tailwind.compat.cjs b/packages/client/tailwind.compat.cjsnew file mode 100644index 0000000000..59ac0aebc5--- /dev/null+++ b/packages/client/tailwind.compat.cjs@@ -0,0 +1,31 @@+// Repository-only legacy palettes. The published preset leaves host colors unchanged.+module.exports = {+ gray: {+ 20: '#ececf1',+ 50: '#f7f7f8',+ 100: '#ececec',+ 200: '#e3e3e3',+ 300: '#cdcdcd',+ 400: '#999696',+ 500: '#595959',+ 600: '#424242',+ 650: '#393939',+ 700: '#2f2f2f',+ 800: '#212121',+ 850: '#171717',+ 900: '#0d0d0d',+ },+ green: {+ 50: '#f1f9f7',+ 100: '#def2ed',+ 200: '#a6e5d6',+ 300: '#6dc8b9',+ 400: '#41a79d',+ 500: '#10a37f',+ 550: '#349072',+ 600: '#126e6b',+ 700: '#0a4f53',+ 800: '#06373e',+ 900: '#031f29',+ },+};diff --git a/packages/client/tailwind.config.js b/packages/client/tailwind.config.jsindex c17c09e12a..63bdecdb2e 100644--- a/packages/client/tailwind.config.js+++ b/packages/client/tailwind.config.js@@ -1,15 +1,21 @@-const { createTailwindColors } = require('./src/theme/utils/createTailwindColors.js');const libreChatTailwindPreset = require('./tailwind.preset.cjs');+const compatibilityColors = require('./tailwind.compat.cjs');-/** @type {import('tailwindcss').Config} */+/**+ * The library's own Tailwind config, used when developing and testing the package in isolation.+ * Semantic colors are declared in `src/theme/tokens.css`, published as+ * `@librechat/client/theme.css`. Legacy compatibility colors apply only inside this repository.+ *+ * @type {import('tailwindcss').Config}+ */module.exports = {content: ['./src/**/*.{js,jsx,ts,tsx}'],darkMode: ['class'],presets: [libreChatTailwindPreset],- theme: {- extend: {- colors: createTailwindColors(),- },- },+ theme: { extend: { colors: compatibilityColors } },+ // No plugins here: the components write `animate-in`, `fade-in-0`, `slide-in-from-*` and the+ // accordion keyframes, and the preset above is what registers the plugin generating them, for+ // this config and for a consumer's alike. Registering it a second time emits each of those+ // utilities twice.plugins: [],};diff --git a/packages/client/tailwind.preset.cjs b/packages/client/tailwind.preset.cjsindex 7fc32f7cca..fe6c9545d7 100644--- a/packages/client/tailwind.preset.cjs+++ b/packages/client/tailwind.preset.cjs@@ -28,9 +28,24 @@ module.exports = {'0%, 70%, 100%': { opacity: '0.35', transform: 'translateY(0)' },'35%': { opacity: '1', transform: 'translateY(-2px)' },},+ 'accordion-down': {+ from: { height: '0' },+ to: { height: 'var(--radix-accordion-content-height)' },+ },+ 'accordion-up': {+ from: { height: 'var(--radix-accordion-content-height)' },+ to: { height: '0' },+ },+ 'caret-blink': {+ '0%,70%,100%': { opacity: '1' },+ '20%,50%': { opacity: '0' },+ },},animation: {'loading-dot': 'loading-dot 1.2s ease-in-out infinite',+ 'accordion-down': 'accordion-down 0.2s ease-out',+ 'accordion-up': 'accordion-up 0.2s ease-out',+ 'caret-blink': 'caret-blink 1.25s ease-out infinite',},borderRadius: {/**@@ -64,6 +79,15 @@ module.exports = {},},plugins: [+ /**+ * The published components write `animate-in`, `fade-in-0`, `zoom-in-95` and+ * `slide-in-from-*` (dialogs, popovers, dropdowns), which this plugin owns.+ * It belongs in the preset rather than in the app's config alone: a consumer+ * following the documented setup loads only this file, and without it those+ * classes generate nothing and the surfaces appear without their motion.+ * Declared as a peer dependency so the consumer's install provides it.+ */+ require('tailwindcss-animate'),/*** A bare function rather than `plugin()` from `tailwindcss/plugin`, because* this preset ships as a raw file through the `./tailwind-preset` export anddiff --git a/packages/client/tsdown.config.mjs b/packages/client/tsdown.config.mjsindex cb5e130356..aa453a80f3 100644--- a/packages/client/tsdown.config.mjs+++ b/packages/client/tsdown.config.mjs@@ -23,7 +23,15 @@ export default defineConfig({// CommonJS (jest.config.js / babel.config.js are CJS) while still shipping dual ESM/CJS.fixedExtension: true,define,- copy: [{ from: 'src/icons/provider/assets', to: 'dist' }],+ copy: [+ { from: 'src/icons/provider/assets', to: 'dist' },+ // The color tokens ship as CSS: an app imports `@librechat/client/theme.css` into the+ // stylesheet that imports Tailwind, and gets `bg-surface-primary` and the rest. `to` names+ // the destination directory, not the file, pointing it at `dist/theme.css` produced a+ // directory of that name holding `tokens.css`, and the export resolved to a folder, so the+ // file keeps its name in `dist` and the export maps `./theme.css` onto it.+ { from: 'src/theme/tokens.css', to: 'dist' },+ ],// Extract all component CSS into a single `dist/style.css` (no import left in the JS, so the// CJS output stays valid CommonJS). Consumers import `@librechat/client/style.css` once.css: { inject: false },