import { DocsContextProps } from "@storybook/addon-docs/blocks"; import { PropsWithChildren } from "react"; import { ThemeVars } from "storybook/theming"; import { CSSProperties } from "@just-web/css"; import { DecoratorFunction } from "storybook/internal/types"; /** * Creates a `DocsContainer` for `storybook` that works with `@storybook-community/storybook-dark-mode`. * * @see https://github.com/hipstersmoothie/storybook-dark-mode/issues/282 * * @example * ```ts * // .storybook/preview.tsx * const preview: Preview = { * parameters: { * docs: { * container: createDarkModeDocsContainer() * } * } * } * ``` */ export declare function createDarkModeDocsContainer(customThemes?: { light?: ThemeVars | undefined; dark?: ThemeVars | undefined; } | undefined): (props: PropsWithChildren<{ context: DocsContextProps; }>) => import("react").JSX.Element; /** * Configuration parameters for `@storybook-community/storybook-dark-mode`. */ export interface DarkModeParam { /** The current theme ('dark' or 'light') */ current?: 'dark' | 'light' | undefined; /** * CSS class(es) to apply in dark mode. */ darkClass?: string | string[] | undefined; /** * CSS style(s) to apply in dark mode. * * This only works when using `withStoryRoot`. */ darkStyle?: CSSProperties | undefined; /** CSS class(es) to apply in light mode */ lightClass?: string | string[] | undefined; /** * CSS style(s) to apply in light mode. * * This only works when using `withStoryRoot`. */ lightStyle?: CSSProperties | undefined; /** Dark theme variables */ dark?: ThemeVars; /** Light theme variables */ light?: ThemeVars; /** Element to apply theme classes to ('html' or 'body') */ classTarget?: 'html' | 'body' | undefined; /** Whether to apply theme styles to preview iframe */ stylePreview?: boolean | undefined; } /** * Defines `@storybook-community/storybook-dark-mode` parameters for Storybook stories. * * @see https://storybook.js.org/addons/@storybook/addon-themes#dark-mode * @returns An object containing the dark mode parameter configuration * * @example * ```ts * // ./storybook/preview.tsx * * export const preview = { * parameters: { * ...defineDarkModeParam({ darkClass: 'dark' }) * } * } */ export declare function defineDarkModeParam(darkMode: DarkModeParam): { darkMode: DarkModeParam; }; /** * Applies additional dark mode behavior. * * @see https://storybook.js.org/addons/@storybook/addon-themes#dark-mode * @returns A decorator function that applies additional dark mode behavior. */ export declare function withDarkMode(options?: { /** * CSS class(es) to apply to the body element. * * Useful when using Tailwind CSS and `classTarget: 'html'` */ bodyClass?: string | string[] | undefined; /** * CSS style(s) to apply to the body element. * * Useful when using Tailwind CSS and `classTarget: 'html'` */ bodyStyle?: CSSProperties | undefined; } | undefined): DecoratorFunction;