// ported from https://github.com/react-bootstrap/react-bootstrap/blob/f11723114d532cfce840417834a73733a8436414/src/helpers.ts import {TransitionComponent} from "solid-react-transition"; import {Component, ComponentProps, JSX, ValidComponent} from "solid-js"; export type Omit = Pick>; export type ElementType = ValidComponent; export type ReplaceProps = Omit, P> & P; export interface BsPrefixOnlyProps { bsPrefix?: string; } export interface AsProp { as?: As; } export interface BsPrefixProps extends BsPrefixOnlyProps, AsProp {} export interface BsPrefixRefForwardingComponent { ( props: ReplaceProps & P>, context?: any, ): JSX.Element | null; } export type TransitionType = boolean | TransitionComponent; export function getOverlayDirection(placement: string, isRTL?: boolean) { let bsDirection = placement; if (placement === "left") { bsDirection = isRTL ? "end" : "start"; } else if (placement === "right") { bsDirection = isRTL ? "start" : "end"; } return bsDirection; }