/** @packageDocumentation * @module Toolbar */ import "./Toolbar.scss"; import * as React from "react"; import { ActionButton, CommonToolbarItem, CustomButtonDefinition, GroupButton, OnItemExecutedFunc } from "@bentley/ui-abstract"; import { CommonProps, NoChildrenProps } from "@bentley/ui-core"; import { Direction, OrthogonalDirection } from "./utilities/Direction"; /** Describes the data needed to insert a custom framework-specific button into an ToolbarWithOverflow. * @beta */ export interface CustomToolbarItem extends CustomButtonDefinition { buttonNode?: React.ReactNode; panelContentNode?: React.ReactNode; } /** Describes toolbar item. * @beta */ export declare type ToolbarItem = ActionButton | GroupButton | CustomToolbarItem; /** CustomToolbarItem type guard. * @internal */ export declare function isCustomToolbarItem(item: ToolbarItem): item is CustomToolbarItem; /** @internal */ export declare const getToolbarDirection: (expandsTo: Direction) => OrthogonalDirection; /** Available alignment modes of [[ToolbarWithOverflow]] panels. * @beta */ export declare enum ToolbarPanelAlignment { Start = 0, End = 1 } /** Enumeration of Toolbar Opacity setting. * @beta */ export declare enum ToolbarOpacitySetting { /** Use the default background, box-shadow opacity and backdrop-filter blur */ Defaults = 0, /** Alter the opacity from transparent to the defaults based on mouse proximity */ Proximity = 1, /** Use a transparent background, box-shadow opacity and backdrop-filter blur */ Transparent = 2 } /** Helpers for [[ToolbarPanelAlignment]]. * @internal */ export declare class ToolbarPanelAlignmentHelpers { /** Class name of [[ToolbarPanelAlignment.Start]] */ static readonly START_CLASS_NAME = "components-panel-alignment-start"; /** Class name of [[ToolbarPanelAlignment.End]] */ static readonly END_CLASS_NAME = "components-panel-alignment-end"; /** @returns Class name of specified [[ToolbarPanelAlignment]] */ static getCssClassName(panelAlignment: ToolbarPanelAlignment): string; } /** @internal */ export interface ToolbarOverflowContextProps { readonly expandsTo: Direction; readonly direction: OrthogonalDirection; readonly overflowExpandsTo: Direction; readonly overflowDirection: OrthogonalDirection; readonly panelAlignment: ToolbarPanelAlignment; readonly useDragInteraction: boolean; readonly toolbarOpacitySetting: ToolbarOpacitySetting; readonly openPopupCount: number; readonly onPopupPanelOpenClose: (isOpening: boolean) => void; readonly overflowDisplayActive: boolean; readonly onItemExecuted: OnItemExecutedFunc; readonly onKeyDown: (e: React.KeyboardEvent) => void; } /** * Context used by Toolbar component to provide Direction to child components. * @internal */ export declare const ToolbarWithOverflowDirectionContext: React.Context; /** @internal */ export declare function CustomItem({ item, addGroupSeparator }: { item: CustomToolbarItem; addGroupSeparator: boolean; }): JSX.Element | null; /** @internal */ export declare function GroupPopupItem({ item, addGroupSeparator }: { item: GroupButton; addGroupSeparator: boolean; }): JSX.Element; /** @internal */ export declare function ActionItem({ item, addGroupSeparator }: { item: ActionButton; addGroupSeparator: boolean; }): JSX.Element; /** @internal */ export declare function ToolbarItemComponent({ item, addGroupSeparator }: { item: ToolbarItem; addGroupSeparator: boolean; }): JSX.Element | null; /** @internal */ export declare function useToolbarWithOverflowDirectionContext(): ToolbarOverflowContextProps; /** Properties of [[ToolbarWithOverflow]] component. * @beta */ export interface ToolbarWithOverflowProps extends CommonProps, NoChildrenProps { /** Describes to which direction the popup panels are expanded. Defaults to: [[Direction.Bottom]] */ expandsTo?: Direction; /** Describes to which direction the overflow popup panels are expanded. Defaults to: [[Direction.Right]] */ overflowExpandsTo?: Direction; /** definitions for items of the toolbar. i.e. [[CommonToolbarItem]]. Items are expected to be already sorted by group and item. */ items: CommonToolbarItem[]; /** Describes how expanded panels are aligned. Defaults to: [[ToolbarPanelAlignment.Start]] */ panelAlignment?: ToolbarPanelAlignment; /** Use Drag Interaction to open popups with nest action buttons */ useDragInteraction?: boolean; /** Determines whether to use mouse proximity to alter the opacity of the toolbar */ toolbarOpacitySetting?: ToolbarOpacitySetting; /** Optional function to call on any item execution */ onItemExecuted?: OnItemExecutedFunc; /** Optional function to call on any KeyDown events processed by toolbar */ onKeyDown?: (e: React.KeyboardEvent) => void; } /** Component that displays tool settings as a bar across the top of the content view. * @beta */ export declare function ToolbarWithOverflow(props: ToolbarWithOverflowProps): JSX.Element; /** Interface toolbars use to define context for its items. * @internal */ export interface ToolbarItemContextArgs { readonly hasOverflow: boolean; readonly useHeight: boolean; readonly onResize: (w: number) => void; } /** Interface toolbars use to define context for its items. * @internal */ export declare const ToolbarItemContext: React.Context; /** @internal */ export declare function useToolItemEntryContext(): ToolbarItemContextArgs; //# sourceMappingURL=ToolbarWithOverflow.d.ts.map