import * as _redsift_design_system from '@redsift/design-system'; import { ValueOf, ButtonColor, Theme, ContainerProps, ContainerTransientProps, Comp, HeadingProps, IconProps, StylingTransientProps, FlexLayoutTransientProps, StylingProps, SpacingProps, SizingProps, InternalSpacingProps, InternalSpacingTransientProps, ButtonProps, ButtonLinkProps, IconButtonLinkProps, IconButtonProps, LinkProps, LinkButtonProps } from '@redsift/design-system'; import * as React$1 from 'react'; import React__default, { Dispatch, SetStateAction, ReactNode, ComponentProps } from 'react'; import * as _floating_ui_react from '@floating-ui/react'; export { FloatingPortal, useMergeRefs } from '@floating-ui/react'; import * as _floating_ui_react_dom from '@floating-ui/react-dom'; import * as _floating_ui_core from '@floating-ui/core'; import * as _floating_ui_utils from '@floating-ui/utils'; import * as styled_components_dist_types from 'styled-components/dist/types'; import { ToastContentProps, Theme as Theme$1, ToastOptions as ToastOptions$1, ClearWaitingQueueParams } from 'react-toastify'; declare const sizeToDimension: (size: DialogSize | { width?: string; maxWidth?: string; minWidth?: string; }) => { width?: string; maxWidth?: string; minWidth?: string; }; declare function useDialog({ color, defaultOpen, hasCloseButton, initialFocus, isOpen: propsIsOpen, onOpen, size, triggerClassName, }: Omit): { labelId: string | undefined; descriptionId: string | undefined; setLabelId: React__default.Dispatch>; setDescriptionId: React__default.Dispatch>; hasCloseButton: boolean | undefined; initialFocus: number | "body" | "header" | React__default.MutableRefObject | "actions" | undefined; width: string | undefined; minWidth: string | undefined; maxWidth: string | undefined; headerRef: React__default.MutableRefObject; bodyRef: React__default.MutableRefObject; actionsRef: React__default.MutableRefObject; triggerClassName: string | undefined; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; }; /** * Context props. */ type DialogState = (ReturnType & { setLabelId: Dispatch>; setDescriptionId: Dispatch>; /** Class name to append to the trigger. */ readonly triggerClassName?: string; }) | null; /** * Component variant. */ declare const DialogSize: { readonly small: "small"; readonly medium: "medium"; readonly large: "large"; readonly xlarge: "xlarge"; }; type DialogSize = ValueOf; /** * Component props. */ interface DialogProps { /** Button color that will be forward to the trigger. */ color?: ButtonColor; /** Children. Can only be DialogTrigger and DialogContent. */ children: ReactNode; /** * Default open status. * Used for uncontrolled version. */ defaultOpen?: boolean; /** * Whether the Close icon button is displayed or not. * @default true */ hasCloseButton?: boolean; /** Which element to initially focus. Can be either a number (tabbable index), a ref to en element, or a shortcut pointing towards a section of the dialog. See the accessibility section in the documentation to know which one to use. */ initialFocus?: number | React.MutableRefObject | 'header' | 'body' | 'actions'; /** * Whether the component is opened or not. * Used for controlled version. */ isOpen?: boolean; /** Method to handle component change. */ onOpen?: (open: boolean) => void; /** * Dialog size. * @default 'medium' */ size?: DialogSize | { width?: string; maxWidth?: string; minWidth?: string; }; /** Theme. */ theme?: Theme; /** Class name to append to the trigger. */ triggerClassName?: string; } type StyledDialogProps = DialogProps; declare const DialogContext: React__default.Context; /** * Component props. */ interface DialogContentActionsProps extends ComponentProps<'div'>, ContainerProps { /** Theme. */ theme?: Theme; } interface StyledDialogContentActionsProps extends ComponentProps<'div'>, ContainerTransientProps { } /** * The DialogContentActions component. */ declare const DialogContentActions: Comp; /** * Component props. */ interface DialogContentBodyProps extends ComponentProps<'div'>, ContainerProps { /** Theme. */ theme?: Theme; } interface StyledDialogContentBodyProps extends ComponentProps<'div'>, ContainerTransientProps { $marginTop: string; $marginBottom: string; $maxHeight: string; } /** * The DialogContentBody component. */ declare const DialogContentBody: Comp; /** * Component props. */ interface DialogContentHeaderProps extends ComponentProps<'div'> { /** Header. */ header?: string; /** Heading props allowing to override the component rendered by the heading without changing its style. */ headingProps?: Pick; /** Subheader */ subheader?: string; /** * Can be a string or an array of strings containing `d` property of the `path` SVG element.
* Can also be a ReactElement. */ icon?: IconProps['icon']; /** Custom props to pass to the Icon component. */ iconProps?: Omit; /** Whether the card is loading or not. */ isLoading?: boolean; /** Theme. */ theme?: Theme; } interface StyledDialogContentHeaderProps extends ComponentProps<'div'>, StylingTransientProps, FlexLayoutTransientProps { } /** * The DialogContentHeader component. */ declare const DialogContentHeader: Comp; /** * Component props. */ interface DialogContentProps extends ComponentProps<'div'> { /** Theme. */ theme?: Theme; } type StyledDialogContentProps = DialogContentProps & { $width?: string; $minWidth?: string; $maxWidth?: string; $theme: Theme; }; /** * The DialogContent component. */ declare const BaseDialogContent: Comp; declare const DialogContent: Comp & { Header: Comp; Body: Comp; Actions: Comp; }; /** * Component props. */ interface DialogTriggerProps extends ComponentProps<'button'>, StylingProps { } /** * The DialogTrigger component. */ declare const DialogTrigger: Comp; /** * Dialog displays modal content that requires user attention or interaction. * Built on Floating UI for positioning and focus management. * * Composed of `Dialog.Trigger` and `Dialog.Content` sub-components. * Content can use `DialogContent.Header`, `DialogContent.Body`, and * `DialogContent.Actions` for structured layouts. * * Sizes: `small`, `medium`, `large`, `xlarge`, `fullscreen` * * @example * // Basic dialog * * * * * * * Are you sure you want to continue? * * * * * * * * @example * // Controlled dialog with initialFocus on a specific element * const saveButtonRef = useRef(null); * * * * * * * * * * * * * @example * // Initial focus on header, body, or actions section * ... * ... * ... * * @example * // Large dialog without close button * * {...} * */ declare const BaseDialog: React__default.FC & { displayName?: string; className?: string; }; declare const Dialog: React__default.FC & { displayName?: string; className?: string; } & { Trigger: _redsift_design_system.Comp; Content: _redsift_design_system.Comp & { Header: _redsift_design_system.Comp; Body: _redsift_design_system.Comp; Actions: _redsift_design_system.Comp; }; }; declare const useDialogContext: () => { labelId: string | undefined; descriptionId: string | undefined; setLabelId: React__default.Dispatch>; setDescriptionId: React__default.Dispatch>; hasCloseButton: boolean | undefined; initialFocus: number | "body" | "header" | React__default.MutableRefObject | "actions" | undefined; width: string | undefined; minWidth: string | undefined; maxWidth: string | undefined; headerRef: React__default.MutableRefObject; bodyRef: React__default.MutableRefObject; actionsRef: React__default.MutableRefObject; triggerClassName: string | undefined; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; } & { setLabelId: React__default.Dispatch>; setDescriptionId: React__default.Dispatch>; readonly triggerClassName?: string; }; declare function usePopover({ color, defaultOpen, isModal, isOpen: propsIsOpen, maxWidth, minWidth, offset: propsOffset, onOpen, placement, role: propsRole, triggerClassName, width, setHideInsteadOfClose, hideInsteadOfClose, }: Omit & HiddenPopoverState): { isModal: boolean | undefined; triggerClassName: string | undefined; setHideInsteadOfClose: React__default.Dispatch> | undefined; hideInsteadOfClose: boolean | undefined; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; }; /** * Context props. */ type HiddenPopoverState = { /** Whether the popover should be hidden or removed from the DOM. */ hideInsteadOfClose?: boolean; /** Method to set the hideInsteadOfClose prop. */ setHideInsteadOfClose?: Dispatch>; }; type PopoverState = (ReturnType & { /** Class name to append to the trigger. */ readonly triggerClassName?: string; } & HiddenPopoverState) | null; /** * Component variant. */ declare const PopoverPlacement: { readonly top: "top"; readonly right: "right"; readonly bottom: "bottom"; readonly left: "left"; readonly 'top-start': "top-start"; readonly 'top-end': "top-end"; readonly 'right-start': "right-start"; readonly 'right-end': "right-end"; readonly 'bottom-start': "bottom-start"; readonly 'bottom-end': "bottom-end"; readonly 'left-start': "left-start"; readonly 'left-end': "left-end"; }; type PopoverPlacement = ValueOf; /** * Component props. */ interface PopoverProps { /** Popover content width. Can be either based on the trigger, the available space or define with a number of pixels. */ width?: 'trigger-width' | 'available-width' | number; /** Popover content min width. Can be either based on the trigger, the available space or define with a number of pixels. */ minWidth?: 'trigger-width' | 'available-width' | number; /** Popover content max width. Can be either based on the trigger, the available space or define with a number of pixels. */ maxWidth?: 'trigger-width' | 'available-width' | number; /** Button color that will be forward to the trigger. */ color?: ButtonColor; /** Children. Can only be PopoverTrigger and PopoverContent. */ children: ReactNode; /** * Default open status. * Used for uncontrolled version. */ defaultOpen?: boolean; /** * Default placement of the popover. * @default 'bottom' */ placement?: PopoverPlacement; /** * Whether the popover is a modal or not. * @default false */ isModal?: boolean; /** * Whether the component is opened or not. * Used for controlled version. */ isOpen?: boolean; /** * Space between trigger and content (in pixels). * @default 2 */ offset?: number; /** Method to handle component change. */ onOpen?: (open: boolean) => void; /** Allows other components to be treated as trigger and content. */ overrideDisplayName?: { content?: string; trigger?: string; }; /** Role to apply to the popover. */ role?: 'dialog' | 'menu' | 'listbox'; /** Theme. */ theme?: Theme; /** Class name to append to the trigger. */ triggerClassName?: string; } type StyledPopoverProps = PopoverProps; declare const PopoverContext: React__default.Context; /** * Component props. */ interface PopoverContentProps extends ComponentProps<'div'>, ContainerProps { /** Theme. */ theme?: Theme; } type StyledPopoverContentProps = PopoverContentProps & { $theme: Theme; }; /** * Component style. */ declare const StyledPopoverContent: styled_components_dist_types.IStyledComponentBase<"web", styled_components_dist_types.Substitute, HTMLDivElement>, StyledPopoverContentProps>> & string; /** * The PopoverContent component. */ declare const PopoverContent: Comp; /** * Component props. */ interface PopoverTriggerProps extends ComponentProps<'button'>, StylingProps { } /** * The PopoverTrigger component. */ declare const PopoverTrigger: Comp; /** * Popover displays contextual content anchored to a trigger element. * Built on Floating UI for intelligent positioning and collision detection. * * Unlike Tooltip (hover-triggered), Popover is click/tap-triggered and * can contain interactive content like forms or menus. * * Placements: `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, * `bottom-end`, `left`, `left-start`, `left-end`, `right`, `right-start`, * `right-end` * * @example * // Basic popover * * * * * * Additional details here... * * * * @example * // Controlled popover with placement and width * * * * Help * Click here to learn more. * * * * @example * // Modal popover (blocks background interaction) * * * This blocks interaction behind it * * * @example * // With offset and custom sizing * * {...} * */ declare const BasePopover: React__default.FC & { displayName?: string; className?: string; }; declare const Popover: React__default.FC & { displayName?: string; className?: string; } & { Trigger: _redsift_design_system.Comp; Content: _redsift_design_system.Comp; }; declare const usePopoverContext: () => { isModal: boolean | undefined; triggerClassName: string | undefined; setHideInsteadOfClose: React__default.Dispatch> | undefined; hideInsteadOfClose: boolean | undefined; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; } & { readonly triggerClassName?: string; } & HiddenPopoverState; /** * Component variant. */ declare const ToastVariant: { readonly success: "success"; readonly error: "error"; readonly warning: "warning"; readonly info: "info"; readonly loading: "loading"; }; type ToastVariant = ValueOf; declare const ToastPlacement: { readonly 'top-right': "top-right"; readonly 'top-center': "top-center"; readonly 'top-left': "top-left"; readonly 'bottom-right': "bottom-right"; readonly 'bottom-center': "bottom-center"; readonly 'bottom-left': "bottom-left"; }; type ToastPlacement = ValueOf; /** * Component props. */ interface ToastProps extends Omit, 'id' | 'style'>, SpacingProps, SizingProps { /** * Whether the component has a close button or not, or the node to put in its * place. A Design System Button or IconButton — a `styled()` one included — * takes the variant colour and dismisses the Toast; any other node renders as * given. * @default true */ closeButton?: boolean | ReactNode; /** Title. */ title?: string; /** Theme. */ theme?: Theme; /** * Variant * @default 'info' */ variant?: ToastVariant; } interface StyledToastProps extends ComponentProps<'div'>, StylingTransientProps { $hasTitle: boolean; $variant: ToastProps['variant']; $theme: Theme; } /** * Toast displays non-blocking feedback messages. Raise one with the `toast` * singleton or the `useToast` hook; render this component directly only when * you need the shape on its own (a story, a page-level banner). * * Variants: `info`, `success`, `warning`, `error`, `loading` * * @example * // Setup toast container (once in app root) * import { ToastContainer } from '@redsift/popovers'; * * * @example * // Show info toast * import { toast } from '@redsift/popovers'; * toast.info({ content: 'Your changes have been saved' }); * * @example * // Show error toast with title * toast.error({ title: 'Error', content: 'Failed to save' }); * * @example * // Loading toast that resolves * const id = toast.loading({ content: 'Uploading...', autoClose: false }); * await uploadFile(); * toast.update(id, { content: 'Upload complete', variant: 'success', autoClose: 5000 }); * * @example * // Toast with a custom action in place of the close button. A Design System * // Button or IconButton takes the variant colour and dismisses the Toast on * // click; any other node is rendered as given. * toast.info({ * content: 'File deleted', * closeButton: , * }); */ declare const Toast: Comp, HTMLDivElement>; /** * Component props. */ interface ToastContainerProps { /** * Delay in ms to close the toast. If set to false, the notification needs to be closed manually. * @default 5000 */ autoClose?: number | false; /** * Dismiss toast on click. * @default false */ closeOnClick?: boolean; /** * Allow Toasts to be draggable. * @default true */ draggable?: boolean; /** * Whether the progress bar is displayed or not on all Toasts. * @default false */ hideProgressBar?: boolean; /** Used to limit the number of toast displayed on screen at the same time. */ limit?: number; /** * Pause the timer when the window loses focus. * @default true */ pauseOnFocusLoss?: boolean; /** * Keep the timer running or not on hover. * @default true */ pauseOnHover?: boolean; /** * Default placement for all Toasts. * @default 'top-right' */ placement?: ToastPlacement; /** Supports right to left content. */ rtl?: boolean; /** Theme. */ theme?: Theme$1; /** * Width of the Toasts. A number is read as px. Fixed widths override the * default 350px–600px range, so the value is used as given. * @default 'fit-content' */ width?: number | string; } type StyledToastContainerProps = Omit & { $width?: string; }; /** * Props forwarded to the rendered Toast. The slots the options own — * `closeButton`, `title`, `variant` — are set from the options instead. */ type ToastRenderProps = Omit; /** * Options for a single Toast. Everything react-toastify accepts is supported — * `onClose`, `toastId`, `role` and the rest pass straight through — with the * Design System naming its own slots on top. */ interface ToastOptions extends Omit { /** * Whether the component has a close button or not, or the node to put in its * place. A Design System Button or IconButton — a `styled()` one included — * takes the variant colour and dismisses the Toast; any other node renders as * given. */ closeButton?: boolean | ReactNode; /** Content. */ content?: ReactNode; /** Placement of the Toast. */ placement?: ToastPlacement; /** Title. */ title?: string; /** * Variant. * @default 'info' */ variant?: ToastVariant; } /** Identifier returned when a Toast is raised. */ type ToastId = number | string; /** Options of a variant method, whose variant is implied by the method itself. */ type ToastVariantOptions = Omit; /** Content of a promise Toast at one stage of the promise. */ type ToastPromiseStage = Pick; /** * Imperative API returned by `useToast` and exported as `toast`. */ type ToastApi = { notify: (options: ToastOptions, props?: ToastRenderProps) => ToastId; clearWaitingQueue: (params?: ClearWaitingQueueParams | undefined) => void; dismiss: (id?: ToastId | undefined) => void; done: (id: ToastId) => void; error: (options: ToastVariantOptions, props?: ToastRenderProps) => ToastId; isActive: (id: ToastId) => boolean; info: (options: ToastVariantOptions, props?: ToastRenderProps) => ToastId; loading: (options: ToastVariantOptions, props?: ToastRenderProps) => ToastId; promise: (promise: Promise | (() => Promise), stages: { pending: ToastPromiseStage; success: ToastPromiseStage; error: ToastPromiseStage; }, options?: Omit, props?: ToastRenderProps) => Promise; success: (options: ToastVariantOptions, props?: ToastRenderProps) => ToastId; /** * Updates an existing Toast. Options left out keep the value they were last * rendered with, so `update(id, { autoClose: 5000 })` no longer blanks the * content or resets the variant. */ update: (id: ToastId, options?: ToastOptions, props?: ToastRenderProps) => void; warning: (options: ToastVariantOptions, props?: ToastRenderProps) => ToastId; }; /** @deprecated Use {@link ToastApi}. */ type useToastReturnType = ToastApi; type useToastProps = () => ToastApi; /** * Imperative Toast API. Identical to what `useToast` returns, but callable from * outside a component — a service module, a fetch interceptor, a store — where * a hook cannot go. Needs a `ToastContainer` mounted once at the app root. * * @example * import { toast } from '@redsift/popovers'; * * toast.success({ content: 'Changes saved' }); * toast.error({ title: 'Error', content: 'Failed to save' }); * * @example * // Raise now, resolve later * const id = toast.loading({ content: 'Uploading…', autoClose: false }); * toast.update(id, { content: 'Uploaded', variant: 'success', autoClose: 5000 }); */ declare const toast: ToastApi; /** * ToastContainer provides the root element for toast notifications. * Place it once at the app root. Raise toasts with the `useToast` hook, or with * the `toast` singleton when you are outside a component. * * Placements: `top-left`, `top-center`, `top-right`, `bottom-left`, * `bottom-center`, `bottom-right` * * @example * // Setup in app root (required once) * import { ToastContainer } from '@redsift/popovers'; * function App() { * return ( * <> * * * * ); * } * * @example * // Using the useToast hook in a component * import { useToast } from '@redsift/popovers'; * const { notify, success, error, warning, info, loading } = useToast(); * * // Show different variants * success({ content: 'Changes saved!' }); * error({ content: 'Failed to save', title: 'Error' }); * info({ content: 'New updates available' }); * warning({ content: 'Your session is about to expire' }); * * @example * // Promise-based toast (shows loading, then success/error) * const { promise } = useToast(); * promise(fetchData(), { * pending: { content: 'Loading data...' }, * success: { content: 'Data loaded!' }, * error: { content: 'Failed to load data' }, * }); * * @example * // Update or dismiss an existing toast. Options left out of an update keep * // the value they were last rendered with. * const { notify, update, dismiss } = useToast(); * const toastId = notify({ content: 'Processing...', variant: 'loading' }); * // Later: * update(toastId, { content: 'Done!', variant: 'success' }); * // Or: * dismiss(toastId); * * @example * // Outside a component — a service, an interceptor, a store * import { toast } from '@redsift/popovers'; * toast.error({ title: 'Error', content: 'Failed to save' }); */ declare const ToastContainer: Comp; /** * Returns the imperative Toast API — `notify`, the `success` / `error` / * `warning` / `info` / `loading` variants, `promise`, `update` and `dismiss`. * The object is a stable singleton, so it is safe in a dependency array. * * Outside a component, import `toast` instead: it is the very same API. * * @example * const { success, error } = useToast(); * success({ content: 'Changes saved' }); * error({ title: 'Error', content: 'Failed to save' }); */ declare const useToast: useToastProps; /** * Component props. */ interface TooltipContentProps extends ComponentProps<'div'>, Omit { /** Theme. */ theme?: Theme; } interface StyledTooltipContentProps extends ComponentProps<'div'>, Omit { $placement: TooltipPlacement; $theme: Theme; } /** * The TooltipContent component. */ declare const TooltipContent: Comp; /** * Component props. */ interface TooltipTriggerProps extends ComponentProps<'span'>, StylingProps { } /** * The TooltipTrigger component. */ declare const TooltipTrigger: Comp; declare function useTooltip({ color, defaultOpen, delay, placement, isOpen: propsIsOpen, offset: propsOffset, onOpen, tooltipId: propsTooltipId, triggerClassName, }: Omit): { arrowRef: React__default.MutableRefObject; tooltipId: string; triggerClassName: string | undefined; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; }; /** * Context props. */ type TooltipState = (ReturnType & { /** Class name to append to the trigger. */ readonly triggerClassName?: string; }) | null; /** * Component variant. */ declare const TooltipPlacement: { readonly top: "top"; readonly right: "right"; readonly bottom: "bottom"; readonly left: "left"; readonly 'top-start': "top-start"; readonly 'top-end': "top-end"; readonly 'right-start': "right-start"; readonly 'right-end': "right-end"; readonly 'bottom-start': "bottom-start"; readonly 'bottom-end': "bottom-end"; readonly 'left-start': "left-start"; readonly 'left-end': "left-end"; }; type TooltipPlacement = ValueOf; /** * Component props. */ interface TooltipProps { /** Button color that will be forward to the trigger. */ color?: ButtonColor; /** Children. Can only be TooltipTrigger and TooltilContent. */ children: ReactNode; /** * Default open status. * Used for uncontrolled version. */ defaultOpen?: boolean; /** * Delay time (in ms) for the tooltip to show up. * @default 300 */ delay?: number; /** * Default placement of the tooltip. * @default 'bottom' */ placement?: TooltipPlacement | 'client-point'; /** * Whether the component is opened or not. * Used for controlled version. */ isOpen?: boolean; /** * Space between trigger and content (in pixels). * @default 8 */ offset?: number; /** Method to handle component change. */ onOpen?: (open: boolean) => void; /** Id to the tooltip content. */ tooltipId?: string; /** Theme. */ theme?: Theme; /** Class name to append to the trigger. */ triggerClassName?: string; } type StyledTooltipProps = TooltipProps; declare const TooltipContext: React__default.Context; /** * Tooltip displays brief informational text on hover or focus. * Built on Floating UI for smart positioning. * * Use for non-essential supplementary information. For interactive * content, use Popover or Toggletip instead. * * Placements: `top`, `bottom`, `left`, `right` * * @example * // Basic tooltip * * * * * Additional information * * * @example * // Icon with tooltip * * * * * This action cannot be undone * * * @example * // Inline usage with abbreviation * * Configure your * SPF * Sender Policy Framework * record. * * * @example * // Custom delay and offset (for tooltips near clickable elements) * * New * Released this week * */ declare const BaseTooltip: React__default.FC & { displayName?: string; className?: string; }; declare const Tooltip: React__default.FC & { displayName?: string; className?: string; } & { Trigger: _redsift_design_system.Comp; Content: _redsift_design_system.Comp; }; declare const useTooltipContext: () => { arrowRef: React__default.MutableRefObject; tooltipId: string; triggerClassName: string | undefined; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; } & { readonly triggerClassName?: string; }; declare const ButtonWithTooltip: Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit, HTMLButtonElement>; declare const ButtonLinkWithTooltip: Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit, HTMLAnchorElement>; declare const IconButtonLinkWithTooltip: Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit, HTMLAnchorElement>; declare const IconButtonWithTooltip: Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit, HTMLButtonElement>; declare const LinkWithTooltip: Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit, HTMLAnchorElement>; declare const LinkButtonWithTooltip: Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit, HTMLButtonElement>; declare const WithTooltip: { Button: _redsift_design_system.Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit<_redsift_design_system.ButtonProps, "ref">, HTMLButtonElement>; ButtonLink: _redsift_design_system.Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit<_redsift_design_system.ButtonLinkProps, "ref">, HTMLAnchorElement>; IconButton: _redsift_design_system.Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit<_redsift_design_system.IconButtonProps, "ref">, HTMLButtonElement>; IconButtonLink: _redsift_design_system.Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit<_redsift_design_system.IconButtonLinkProps, "ref">, HTMLAnchorElement>; Link: _redsift_design_system.Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit<_redsift_design_system.LinkProps, "ref">, HTMLAnchorElement>; LinkButton: _redsift_design_system.Comp<{ tooltip: string; tooltipProps?: TooltipProps; tooltipTriggerProps?: Omit; tooltipContentProps?: Omit; } & Omit<_redsift_design_system.LinkButtonProps, "ref">, HTMLButtonElement>; }; declare function useToggletip({ color, defaultOpen, delay, isModal, isOpen: propsIsOpen, maxWidth, minWidth, offset: propsOffset, onOpen, placement, role: propsRole, toggletipId: propsToggletipId, triggerClassName, width, setHideInsteadOfClose, hideInsteadOfClose, }: Omit & HiddenToggletipState): { arrowRef: React__default.MutableRefObject; isModal: boolean | undefined; triggerClassName: string | undefined; setHideInsteadOfClose: React__default.Dispatch> | undefined; hideInsteadOfClose: boolean | undefined; toggletipId: string; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; }; /** * Context props. */ type HiddenToggletipState = { /** Whether the toggletip should be hidden or removed from the DOM. */ hideInsteadOfClose?: boolean; /** Method to set the hideInsteadOfClose prop. */ setHideInsteadOfClose?: Dispatch>; }; type ToggletipState = (ReturnType & { /** Class name to append to the trigger. */ readonly triggerClassName?: string; } & HiddenToggletipState) | null; /** * Component variant. */ declare const ToggletipPlacement: { readonly top: "top"; readonly right: "right"; readonly bottom: "bottom"; readonly left: "left"; readonly 'top-start': "top-start"; readonly 'top-end': "top-end"; readonly 'right-start': "right-start"; readonly 'right-end': "right-end"; readonly 'bottom-start': "bottom-start"; readonly 'bottom-end': "bottom-end"; readonly 'left-start': "left-start"; readonly 'left-end': "left-end"; }; type ToggletipPlacement = ValueOf; /** * Component props. */ interface ToggletipProps { /** Toggletip content width. Can be either based on the trigger, the available space or define with a number of pixels. */ width?: 'trigger-width' | 'available-width' | number; /** Toggletip content min width. Can be either based on the trigger, the available space or define with a number of pixels. */ minWidth?: 'trigger-width' | 'available-width' | number; /** Toggletip content max width. Can be either based on the trigger, the available space or define with a number of pixels. */ maxWidth?: 'trigger-width' | 'available-width' | number; /** Button color that will be forward to the trigger. */ color?: ButtonColor; /** Children. Can only be ToggletipTrigger and ToggletipContent. */ children: ReactNode; /** * Default open status. * Used for uncontrolled version. */ defaultOpen?: boolean; /** Delay time (in ms) for the tooltip to show up. */ delay?: number; /** * Default placement of the toggletip. * @default 'bottom' */ placement?: ToggletipPlacement | 'client-point'; /** Whether the toggletip is a modal or not. */ isModal?: boolean; /** * Whether the component is opened or not. * Used for controlled version. */ isOpen?: boolean; /** * Space between trigger and content (in pixels). * @default 8 */ offset?: number; /** Method to handle component change. */ onOpen?: (open: boolean) => void; /** Allows other components to be treated as trigger and content. */ overrideDisplayName?: { content?: string; trigger?: string; }; /** Id to the toggletip content. */ toggletipId?: string; /** Role to apply to the toggletip. */ role?: 'dialog'; /** Theme. */ theme?: Theme; /** Class name to append to the trigger. */ triggerClassName?: string; } type StyledToggletipProps = ToggletipProps; declare const ToggletipContext: React__default.Context; /** * Component props. */ interface ToggletipContentProps extends ComponentProps<'div'>, Omit { /** Theme. */ theme?: Theme; } interface StyledToggletipContentProps extends ComponentProps<'div'>, Omit { $placement: ToggletipPlacement; $theme: Theme; } /** * The ToggletipContent component. */ declare const ToggletipContent: Comp; /** * Component props. */ interface ToggletipTriggerProps extends ComponentProps<'button'>, StylingProps { } type StyledToggletipTriggerProps = ToggletipTriggerProps & {}; /** * The ToggletipTrigger component. */ declare const ToggletipTrigger: Comp; /** * Toggletip displays supplementary content toggled by click/tap. * Similar to Tooltip but triggered on click rather than hover, * making it accessible for touch devices and keyboard users. * * Use for help text, definitions, or supplementary info that users * explicitly request. * * Placements: `top`, `top-start`, `top-end`, `bottom`, `bottom-start`, * `bottom-end`, `left`, `left-start`, `left-end`, `right`, `right-start`, * `right-end` * * @example * // Basic toggletip with icon trigger * * * * * * Click here for more details about this feature. * * * * @example * // With custom placement and rich content * * * What is this? * * * Definition * SPF (Sender Policy Framework) is an email authentication method... * * * * @example * // Controlled toggletip * * * * * Help content here * * * @example * // Modal toggletip with sizing * * {...} * */ declare const BaseToggletip: React__default.FC & { displayName?: string; className?: string; }; declare const Toggletip: React__default.FC & { displayName?: string; className?: string; } & { Trigger: _redsift_design_system.Comp; Content: _redsift_design_system.Comp; }; declare const useToggletipContext: () => { arrowRef: React__default.MutableRefObject; isModal: boolean | undefined; triggerClassName: string | undefined; setHideInsteadOfClose: React__default.Dispatch> | undefined; hideInsteadOfClose: boolean | undefined; toggletipId: string; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; x: number; y: number; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; refs: { reference: React__default.MutableRefObject<_floating_ui_react_dom.ReferenceType | null>; floating: React__default.MutableRefObject; setReference: (node: _floating_ui_react_dom.ReferenceType | null) => void; setFloating: (node: HTMLElement | null) => void; } & _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: { reference: _floating_ui_react_dom.ReferenceType | null; floating: HTMLElement | null; } & _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; context: { x: number; y: number; placement: _floating_ui_utils.Placement; strategy: _floating_ui_utils.Strategy; middlewareData: _floating_ui_core.MiddlewareData; isPositioned: boolean; update: () => void; floatingStyles: React__default.CSSProperties; open: boolean; onOpenChange: (open: boolean, event?: Event, reason?: _floating_ui_react.OpenChangeReason) => void; events: _floating_ui_react.FloatingEvents; dataRef: React__default.MutableRefObject<_floating_ui_react.ContextData>; nodeId: string | undefined; floatingId: string | undefined; refs: _floating_ui_react.ExtendedRefs<_floating_ui_react.ReferenceType>; elements: _floating_ui_react.ExtendedElements<_floating_ui_react.ReferenceType>; }; getReferenceProps: (userProps?: React__default.HTMLProps) => Record; getFloatingProps: (userProps?: React__default.HTMLProps) => Record; getItemProps: (userProps?: Omit, "selected" | "active"> & { active?: boolean; selected?: boolean; }) => Record; color: string | undefined; isOpen: boolean | undefined; handleOpen: (collapsed: boolean) => void; } & { readonly triggerClassName?: string; } & HiddenToggletipState; export { BaseDialog, BaseDialogContent, BasePopover, BaseToggletip, BaseTooltip, ButtonLinkWithTooltip, ButtonWithTooltip, Dialog, DialogContent, DialogContentActions, DialogContentActionsProps, DialogContentBody, DialogContentBodyProps, DialogContentHeader, DialogContentHeaderProps, DialogContentProps, DialogContext, DialogProps, DialogSize, DialogState, DialogTrigger, DialogTriggerProps, HiddenPopoverState, HiddenToggletipState, IconButtonLinkWithTooltip, IconButtonWithTooltip, LinkButtonWithTooltip, LinkWithTooltip, Popover, PopoverContent, PopoverContentProps, PopoverContext, PopoverPlacement, PopoverProps, PopoverState, PopoverTrigger, PopoverTriggerProps, StyledDialogContentActionsProps, StyledDialogContentBodyProps, StyledDialogContentHeaderProps, StyledDialogContentProps, StyledDialogProps, StyledPopoverContent, StyledPopoverContentProps, StyledPopoverProps, StyledToastContainerProps, StyledToastProps, StyledToggletipContentProps, StyledToggletipProps, StyledToggletipTriggerProps, StyledTooltipContentProps, StyledTooltipProps, Toast, ToastApi, ToastContainer, ToastContainerProps, ToastId, ToastOptions, ToastPlacement, ToastPromiseStage, ToastProps, ToastRenderProps, ToastVariant, ToastVariantOptions, Toggletip, ToggletipContent, ToggletipContentProps, ToggletipContext, ToggletipPlacement, ToggletipProps, ToggletipState, ToggletipTrigger, ToggletipTriggerProps, Tooltip, TooltipContent, TooltipContentProps, TooltipContext, TooltipPlacement, TooltipProps, TooltipState, TooltipTrigger, TooltipTriggerProps, WithTooltip, sizeToDimension, toast, useDialog, useDialogContext, usePopover, usePopoverContext, useToast, useToastProps, useToastReturnType, useToggletip, useToggletipContext, useTooltip, useTooltipContext };