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: Add Secondary Label Variant and Spinner Tone (#16837)
Marco Beretta38a3eb097c0c
diff --git a/packages/client/src/components/Label.spec.tsx b/packages/client/src/components/Label.spec.tsxindex 5f12d7821a..4a06293a22 100644--- a/packages/client/src/components/Label.spec.tsx+++ b/packages/client/src/components/Label.spec.tsx@@ -19,6 +19,22 @@ describe('Label', () => {expect(label).toHaveClass('text-text-primary', 'peer-disabled:opacity-70');});+ it('renders the secondary ink at the default label metrics', () => {+ render(+ <Label htmlFor="field" variant="secondary">+ Hint+ </Label>,+ );++ expect(screen.getByText('Hint')).toHaveClass(+ 'text-(length:--theme-label-size)',+ 'leading-(--theme-label-leading)',+ 'font-theme-label',+ 'text-text-secondary',+ );+ expect(screen.getByText('Hint')).not.toHaveClass('text-text-primary');+ });+it('renders the section eyebrow from the shared variant', () => {render(<Label htmlFor="field" variant="section">diff --git a/packages/client/src/components/Label.tsx b/packages/client/src/components/Label.tsxindex bcb8eb7f90..7dc2e7b6a8 100644--- a/packages/client/src/components/Label.tsx+++ b/packages/client/src/components/Label.tsx@@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';import { cn, peerDisabledInkClasses } from '~/utils';type LabelVariantOptions =- | ({ variant?: 'default' | 'section' | null | undefined } & ClassProp)+ | ({ variant?: 'default' | 'secondary' | 'section' | null | undefined } & ClassProp)| undefined;/**@@ -22,6 +22,9 @@ const labelVariants: (props?: LabelVariantOptions) => string = cva('', {* surrounding weight by default. */default:'text-(length:--theme-label-size) leading-(--theme-label-leading) font-theme-label text-text-primary',+ /** The default metrics in the secondary ink, for a label that annotates rather than names. */+ secondary:+ 'text-(length:--theme-label-size) leading-(--theme-label-leading) font-theme-label text-text-secondary',/** Eyebrow above a field or settings group. */section: 'text-[11px] font-medium uppercase tracking-wide text-text-secondary',},diff --git a/packages/client/src/svgs/Spinner.tsx b/packages/client/src/svgs/Spinner.tsxindex 0f6fd3381a..010eecdb5d 100644--- a/packages/client/src/svgs/Spinner.tsx+++ b/packages/client/src/svgs/Spinner.tsx@@ -53,8 +53,16 @@ function schedulePin(svg: SVGSVGElement) {}}+/** `current` follows the surrounding ink; the others pin it to a text role. */+const SPINNER_TONES = {+ current: '',+ primary: 'text-text-primary',+ secondary: 'text-text-secondary',+} as const;+interface SpinnerProps {className?: string;+ tone?: keyof typeof SPINNER_TONES;size?: string | number;color?: string;bgOpacity?: number;@@ -73,6 +81,7 @@ interface SpinnerProps {*/export default function Spinner({className = 'm-auto',+ tone = 'current',size = 20,color = 'currentColor',bgOpacity = 0.1,@@ -115,7 +124,7 @@ export default function Spinner({<svgref={svgRef}onAnimationStart={handleAnimationStart}- className={cn(className, 'spinner')}+ className={cn(className, SPINNER_TONES[tone], 'spinner')}width={size}height={size}viewBox="0 0 40 40"diff --git a/packages/client/src/svgs/__tests__/Spinner.spec.tsx b/packages/client/src/svgs/__tests__/Spinner.spec.tsxindex 505ecc46ae..c8216fbc35 100644--- a/packages/client/src/svgs/__tests__/Spinner.spec.tsx+++ b/packages/client/src/svgs/__tests__/Spinner.spec.tsx@@ -229,4 +229,18 @@ describe('Spinner', () => {expect(container.querySelector('svg')).not.toBeNull();});++ it('follows the surrounding ink by default and pins a text role on request', () => {+ const { container, rerender } = render(<Spinner />);+ const svg = () => container.querySelector('svg');++ expect(svg()).not.toHaveClass('text-text-primary');+ expect(svg()).not.toHaveClass('text-text-secondary');++ rerender(<Spinner tone="primary" />);+ expect(svg()).toHaveClass('text-text-primary');++ rerender(<Spinner tone="secondary" />);+ expect(svg()).toHaveClass('text-text-secondary');+ });});