Files
klz-cables.com/.pnpm-store/v10/files/dc/4c63adb2571d8f08a3732d5d82c6e5cfbd860fc00abaefce649bc939ee2ce5fbebecc752d9c87d0e822f403fb8e3130b2bb58ef789c688a18010b7dc4c1408
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

32 lines
1.2 KiB
Plaintext

import { type UseFloatingOptions, type Middleware, type Placement, type UseFloatingReturn } from "@floating-ui/react";
import React from "react";
export interface FloatingProps {
hidePopper?: boolean;
popperProps: UseFloatingReturn & {
arrowRef: React.RefObject<SVGSVGElement>;
};
}
export interface WithFloatingProps {
popperModifiers?: Middleware[];
popperProps?: Omit<UseFloatingOptions, "middleware">;
hidePopper?: boolean;
popperPlacement?: Placement;
}
/**
* `withFloating` is a higher-order component that adds floating behavior to a component.
*
* @param Component - The component to enhance.
*
* @example
* const FloatingComponent = withFloating(MyComponent);
* <FloatingComponent popperModifiers={[]} popperProps={{}} hidePopper={true} />
*
* @param popperModifiers - The modifiers to use for the popper.
* @param popperProps - The props to pass to the popper.
* @param hidePopper - Whether to hide the popper.
* @param popperPlacement - The placement of the popper.
*
* @returns A new component with floating behavior.
*/
export default function withFloating<T extends FloatingProps>(Component: React.ComponentType<T>): React.FC<Omit<T, "popperProps"> & WithFloatingProps>;