BlurredPanel
export type BlurredPanel = typeof Message.BlurredPanel.Type;Effect-native UI toolkit
Interactive demosPublished API · 0.1.0-rc.1
Published foldkit-ui API declarations for hoverIntent.
@wsagency/wseffect-foldkit-ui · MIT · source · MIT license · WS-AGENCY-NOTICE · THIRD-PARTY-NOTICES
This entry point is published in @wsagency/wseffect-foldkit-ui@0.1.0-rc.1. Import it from the package subpath shown below; the signatures and documentation are read from the installed package declarations.
import * as Wseffect from '@wsagency/wseffect-foldkit-ui/hoverIntent'BlurredPanelexport type BlurredPanel = typeof Message.BlurredPanel.Type;BlurredTriggerexport type BlurredTrigger = typeof Message.BlurredTrigger.Type;closeProgrammatically closes HoverIntent immediately, invalidating pending transitions and suppressing reopening until the trigger disengages.
close: (model: Model) => UpdateReturnClosedexport type Closed = typeof OutMessage.Closed.Type;CompletedWaitBeforeClosingexport type CompletedWaitBeforeClosing = typeof Message.CompletedWaitBeforeClosing.Type;CompletedWaitBeforeOpeningexport type CompletedWaitBeforeOpening = typeof Message.CompletedWaitBeforeOpening.Type;EnteredPanelexport type EnteredPanel = typeof Message.EnteredPanel.Type;EnteredTriggerexport type EnteredTrigger = typeof Message.EnteredTrigger.Type;FocusedPanelexport type FocusedPanel = typeof Message.FocusedPanel.Type;FocusedTriggerexport type FocusedTrigger = typeof Message.FocusedTrigger.Type;initCreates a HoverIntent Model. Pointer entry opens after 200 milliseconds and pointer departure closes after a 300-millisecond grace period by default. Focus entry opens immediately, and focus departure closes without that pointer grace period.
init: (config?: InitConfig) => ModelInitConfigConfiguration for creating a HoverIntent Model.
export type InitConfig = Readonly<{
openDelay?: Duration.Input;
closeDelay?: Duration.Input;
}>;LeftPanelexport type LeftPanel = typeof Message.LeftPanel.Type;LeftTriggerexport type LeftTrigger = typeof Message.LeftTrigger.Type;Messageexport type Message = typeof Message.Type;MessageUnion of all Messages the HoverIntent component can produce.
Message: import("@wsagency/wseffect-foldkit/message").MessageUnion<{
readonly EnteredTrigger: {};
readonly LeftTrigger: {};
readonly EnteredPanel: {};
readonly LeftPanel: {};
readonly FocusedTrigger: {};
readonly BlurredTrigger: {};
readonly FocusedPanel: {};
readonly BlurredPanel: {};
readonly PressedEscape: {
source: Schema.Literals<readonly ["Trigger", "Panel"]>;
};
readonly CompletedWaitBeforeOpening: {
version: Schema.Number;
};
readonly CompletedWaitBeforeClosing: {
version: Schema.Number;
};
}>Modelexport type Model = typeof Model.Type;ModelSchema for HoverIntent state. It tracks pointer and focus engagement over a trigger and its panel, visibility, delay timers, and Escape dismissal.
Model: Schema.Struct<{
readonly isOpen: Schema.Boolean;
readonly isTriggerHovered: Schema.Boolean;
readonly isPanelHovered: Schema.Boolean;
readonly maybeFocusLocation: Schema.Option<Schema.Literals<readonly ["Trigger", "Panel"]>>;
readonly isDismissed: Schema.Boolean;
readonly openDelay: Schema.DurationFromMillis;
readonly closeDelay: Schema.DurationFromMillis;
readonly pendingOpenVersion: Schema.Number;
readonly pendingCloseVersion: Schema.Number;
}>Openedexport type Opened = typeof OutMessage.Opened.Type;OutMessageexport type OutMessage = typeof OutMessage.Type;OutMessageUnion of visibility-transition OutMessages emitted by HoverIntent.
OutMessage: import("@wsagency/wseffect-foldkit/message").MessageUnion<{
readonly Opened: {};
readonly Closed: {};
}>PressedEscapeexport type PressedEscape = typeof Message.PressedEscape.Type;RenderInfoRender-time payload published to the consumer's `toView`. - `trigger`: event attributes for the element that starts intent. - `panel`: event attributes for the element that remains open while hovered or focused. - `isVisible`: whether the consumer should render its panel.
export type RenderInfo = Readonly<{
trigger: ReadonlyArray<ChildAttribute>;
panel: ReadonlyArray<ChildAttribute>;
isVisible: boolean;
}>;updateProcesses a HoverIntent Message and returns the next Model, optional Commands, and an optional OutMessage.
update: (model: Model, message: Message) => UpdateReturnviewRenders headless HoverIntent event bundles. It owns no markup, ARIA semantics, positioning, or styling.
view: import("@wsagency/wseffect-foldkit/submodel").View<{
readonly isOpen: boolean;
readonly isTriggerHovered: boolean;
readonly isPanelHovered: boolean;
readonly maybeFocusLocation: Option.Option<"Panel" | "Trigger">;
readonly isDismissed: boolean;
readonly openDelay: Duration.Duration;
readonly closeDelay: Duration.Duration;
readonly pendingOpenVersion: number;
readonly pendingCloseVersion: number;
}, {
readonly _tag: "CompletedWaitBeforeOpening";
readonly version: number;
} | {
readonly _tag: "CompletedWaitBeforeClosing";
readonly version: number;
} | {
readonly _tag: "BlurredPanel";
} | {
readonly _tag: "BlurredTrigger";
} | {
readonly _tag: "EnteredPanel";
} | {
readonly _tag: "EnteredTrigger";
} | {
readonly _tag: "FocusedPanel";
} | {
readonly _tag: "FocusedTrigger";
} | {
readonly _tag: "LeftPanel";
} | {
readonly _tag: "LeftTrigger";
} | {
readonly _tag: "PressedEscape";
readonly source: "Panel" | "Trigger";
}, Readonly<{
/** Selector for the trigger to focus before Escape removes panel content. If it does not resolve to a focusable element, HoverIntent leaves fallback focus behavior to the browser. */
focusTriggerSelector?: string;
toView: (render: RenderInfo) => Html;
}>>ViewInputsPer-render view inputs passed to `view` via `h.submodel`'s `viewInputs` field.
export type ViewInputs = Readonly<{
/** Selector for the trigger to focus before Escape removes panel content. If it does not resolve to a focusable element, HoverIntent leaves fallback focus behavior to the browser. */
focusTriggerSelector?: string;
toView: (render: RenderInfo) => Html;
}>;WaitBeforeClosingWaits before closing, then emits the version that scheduled the wait.
WaitBeforeClosing: Command.CommandDefinitionWithArgs<"WaitBeforeClosing", {
delay: Schema.DurationFromMillis;
version: Schema.Number;
}, Effect.Effect<{
readonly _tag: "CompletedWaitBeforeClosing";
readonly version: number;
}, never, never>>WaitBeforeOpeningWaits before opening, then emits the version that scheduled the wait.
WaitBeforeOpening: Command.CommandDefinitionWithArgs<"WaitBeforeOpening", {
delay: Schema.DurationFromMillis;
version: Schema.Number;
}, Effect.Effect<{
readonly _tag: "CompletedWaitBeforeOpening";
readonly version: number;
}, never, never>>