diff --git a/packages/tui/src/component/fade-in-text.tsx b/packages/tui/src/component/fade-in-text.tsx index 1beacd8672a..c9c7d0ffae0 100644 --- a/packages/tui/src/component/fade-in-text.tsx +++ b/packages/tui/src/component/fade-in-text.tsx @@ -3,7 +3,7 @@ import { extend, type JSX } from "@opentui/solid" import { splitProps } from "solid-js" import { useConfig } from "../config" import { MaskedTextRenderable } from "./masked-text" -import { coast, smootherstep } from "./tab-pulse" +import { clamp, coast, smootherstep } from "./tab-pulse" type FadeInTextOptions = TextOptions & { backdrop?: RGBA @@ -14,7 +14,6 @@ type FadeInTextOptions = TextOptions & { const DURATION = 200 const FEATHER = 8 -const clamp = (value: number) => Math.max(0, Math.min(1, value)) class FadeInTextRenderable extends MaskedTextRenderable { private _backdrop = RGBA.defaultBackground() diff --git a/packages/tui/src/component/tab-pulse.tsx b/packages/tui/src/component/tab-pulse.tsx index c96d0a1efb7..a6072fe109b 100644 --- a/packages/tui/src/component/tab-pulse.tsx +++ b/packages/tui/src/component/tab-pulse.tsx @@ -29,7 +29,7 @@ type TabPulseOptions = RenderableOptions & { onLevel?: (level: number) => void } -const clamp = (value: number) => Math.max(0, Math.min(1, value)) +export const clamp = (value: number) => Math.max(0, Math.min(1, value)) export const smootherstep = (value: number) => value * value * value * (value * (value * 6 - 15) + 10) const RUN_DURATION = 2_800 const RUN_ATTACK = 450