/**
* animatedConditional.ts
*
* Animated conditional rendering using the same atom + effect + animateSwap
* pattern proven in animatedRouter.
*
* - `animatedIf(condition, trueTemplate, falseTemplate?, config?)`
* Wraps content in a
, animates the div on swap.
*
* - `animatedX(component, props, config)`
* Thin wrapper over animatedIf — passes `x-view` as the true template.
*/
import { nothing, type TemplateResult } from "lit-html";
import type { AnimationPreset } from "../actions/animateTypes";
import type { ComponentType } from "../Template/x-x.types";
export interface AnimatedIfConfig {
/** Animation played on the wrapper when new content enters. Default: fadeIn(250). */
enter?: AnimationPreset;
/** Animation played on the wrapper when current content exits. Default: fadeOut(200). */
exit?: AnimationPreset;
}
export interface AnimatedXConfig extends AnimatedIfConfig {
/** Whether the component is visible. */
show: boolean;
}
/**
* Conditional rendering with animated transitions.
*
* Renders `trueTemplate` when `condition` is `true`, `falseTemplate` otherwise.
* On condition change the wrapper div plays exit → swap → enter, using the
* same `animateSwap` utility as `animatedRouter`.
*
* @example
* ```ts
* html`${animatedIf(
* isOpen.val,
* html`
Hello
`,
* html`
Gone
`,
* {
* enter: animationPresets.slideIn("up", "16px", 300),
* exit: animationPresets.fadeOut(200),
* },
* )}`
* ```
*/
export declare function animatedIf(condition: boolean, trueTemplate: TemplateResult | typeof nothing, falseTemplate?: TemplateResult | typeof nothing, config?: AnimatedIfConfig): TemplateResult<1>;
/**
* Animated show/hide for a component.
*
* Internally uses `animatedIf` — when `config.show` is `true` the component
* is rendered via `
`, when `false` it swaps to `nothing`.
*
* @example
* ```ts
* html`${animatedX(
* MyPanel,
* { title: "Hello" },
* {
* show: isOpen.val,
* enter: animationPresets.slideIn("up", "24px", 300),
* exit: animationPresets.fadeOut(200),
* },
* )}`
* ```
*/
export declare function animatedX(component: ComponentType, props: Record, config: AnimatedXConfig): TemplateResult<1>;
//# sourceMappingURL=animatedConditional.d.ts.map