/** * Copyright 2024, SumUp Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { type ComponentType } from 'react'; import { type Placement, type Strategy } from '@floating-ui/react-dom'; import type { ClickEvent } from '../../types/events.js'; import { type ButtonProps } from '../Button/index.js'; import { type PublicDialogProps } from '../Dialog/Dialog.js'; export interface ToggletipReferenceProps { 'id': string; 'onClick': (event: ClickEvent) => void; 'aria-haspopup': 'dialog'; } export interface ToggletipProps extends Omit { /** * The button element that triggers the toggletip. */ component: ComponentType; /** * The optional headline acts as the toggletip's [accessible name](https://w3c.github.io/accname/#dfn-accessible-name). * Keep it short and under 120 characters. */ headline?: string; /** * Use the body text to provide additional help or to define a term. * The body acts as the toggletip's [accessible description](https://w3c.github.io/accname/#dfn-accessible-description) * or as its [accessible name](https://w3c.github.io/accname/#dfn-accessible-name) * when no headline is present. */ body: string; /** * Use the optional action button to point the user to additional information * or enable a contextual action. Use one strong, clear imperative verb and * follow with a one-word object if needed to clarify. */ action?: Omit; /** * Whether the toggletip is initially open. * @default false */ defaultOpen?: boolean; /** * Where to display the toggletip relative to the trigger component. The * toggletip will automatically move if there isn't enough space available. * @default 'top' */ placement?: Placement; /** * Displaces the floating element from its `placement` along specified axes. * * Pass a number to move the floating element on the main axis, away from (if * positive) or towards (if negative) the reference element. Pass an object * to displace the floating element on both the main and cross axes. * @default 12 */ offset?: number | { mainAxis?: number; crossAxis?: number; }; /** * The strategy to use when positioning the floating element. * @default 'fixed' */ strategy?: Strategy; } export declare const Toggletip: import("react").ForwardRefExoticComponent>;