/** * @fileoverview Theme toggle button for switching between light and dark mode. * Uses next-themes for hydration-safe theme detection and switching. * Renders Sun/Moon icons with smooth transitions. * @module packages/ui/components/composed/theme-mode-toggle * @package ui * * @component * @example * import { ThemeModeToggle } from '@saasflare/ui'; * * * @example * // With visible label text * */ import * as React from 'react'; import { type SaasflareComponentProps } from '../../providers'; /** * Theme mode toggle button with Sun/Moon icons. * * Props are documented on {@link ThemeModeToggleProps}. Extends * {@link SaasflareComponentProps}, so `surface`, `radius`, `animated`, and * `iconWeight` are accepted and forwarded to the inner {@link Button}. * * @component * @layer core * * @returns The toggle button, or `null` before hydration when no SSR seed is provided. */ interface ThemeModeToggleProps extends SaasflareComponentProps { /** Whether to show the label text visibly. */ showText?: boolean; /** Label shown while in light mode (prompting switch to dark). */ textLight?: string; /** Label shown while in dark mode (prompting switch to light). */ textDark?: string; /** Additional CSS class names. */ className?: string; /** * SSR-known resolved theme (`"dark"` or `"light"`) — typically read from a * cookie in the parent server component. When provided, the button skips * its internal mount-gate and renders the correct sun/moon glyph on the * very first paint, eliminating the brief blank frame caused by * `next-themes` returning `undefined` during SSR. * * Leave undefined for the legacy mount-gated behaviour. */ initialResolvedTheme?: 'light' | 'dark'; } /** * Light/dark mode toggle button. Reads and writes the resolved theme via * next-themes and renders a ghost {@link Button} with a sun or moon icon, * optionally followed by a visible label. Pass `initialResolvedTheme` (e.g. * from a cookie) to paint the correct glyph on the very first render; * without it, the button mount-gates to `null` until hydration. * * @component * @layer composed */ export declare function ThemeModeToggle({ showText, textLight, textDark, className, surface, radius, animated, iconWeight, initialResolvedTheme, }: ThemeModeToggleProps): React.JSX.Element | null; export {};