import { ComponentPropsWithoutRef, NamedExoticComponent } from "react"; import { Tree } from "@stratakit/structures"; /** * Attributes used to decide how to render tree actions. They allow to differentiate action style based on the context * where that action is used. * @alpha */ interface TreeActionBaseAttributes { /** * Specifies action variant supported by tree nodes: * * - "default" - standard action displayed in the dropdown menu accessible through the ellipsis button on the node. * - "inline" - actions displayed directly on the tree node. * - "context-menu" - actions displayed in the context menu opened by right-clicking the tree node. */ variant?: "default" | "inline" | "context-menu"; /** * Indicates that the actions is not applicable for current tree node and should be hidden. * When set to true, the action will not be rendered at all. */ hide?: boolean; } /** @alpha */ type TreeActionBaseProps = Omit, "onClick"> & TreeActionBaseAttributes & { /** Callback invoked when the action is clicked. */ onClick?: () => void; }; /** * Base component used to render tree actions. It is designed to allow rendering same action in different contexts: inline, dropdown, context menu. * Should be used together with `StrataKitTreeNodeRenderer` and returned from `getInlineActions`, `getMenuActions` and `getContextMenuActions` callbacks. * * When implementing custom action that returns this component, make sure to forward `TreeActionBaseAttributes` props to it. Example: * * ```tsx * interface MyCustomTreeActionProps extends TreeActionBaseAttributes { * myProp: string * } * * function MyCustomTreeAction({ myProp, ...attributes }: MyCustomTreeActionProps) { * // custom button logic goes here * return * } * ``` * * @alpha */ declare const TreeActionBase: NamedExoticComponent; export { TreeActionBase, TreeActionBaseAttributes, TreeActionBaseProps }; //# sourceMappingURL=TreeAction.d.ts.map