@wix/design-system
Version:
@wix/design-system
80 lines • 3.14 kB
TypeScript
import type { ReactNode } from 'react';
import type { TooltipCommonProps } from '../common';
import type { CloseButtonSize, CloseButtonSkin } from '../CloseButton';
type SidePanelButtonProps = {
/** Defines a callback function which is called every time a (back/help/close) button is clicked. */
onClick?: () => void;
/** Defines aria-label for (back/help/close) button. */
ariaLabel?: string;
/** Defines the size of the button. */
size?: CloseButtonSize;
/** Defines the skin of the button. */
skin?: CloseButtonSkin;
};
type SidePanelBackButtonProps = SidePanelButtonProps & {
/** When provided, sets the content of the back button's tooltip. */
description?: ReactNode;
/** Allows to pass all common tooltip props to back button’s tooltip.
* @linkTypeTo components-overlays--tooltip
* @setTypeName TooltipCommonProps
*/
tooltipProps?: TooltipCommonProps;
};
export interface SidePanelProps {
/** Applies a data-hook HTML attribute to be used in the tests */
dataHook?: string;
buttonText?: string;
/** Specifies a CSS class name to be appended to the component’s root element.
* @internal
*/
className?: string;
/**
* Defines a callback function which is called every time a close button is clicked.
* @deprecated use closeButtonProps instead.
*/
onCloseButtonClick?: () => void;
/**
* Defines a callback function which is called every time a help button is clicked.
* @deprecated use helpButtonProps instead.
*/
onHelpButtonClick?: () => void;
/** Accepts any item as a child element. For standard panel layout pass compound elements of the panel:
* * `<SidePanel.Header/>`
* * `<SidePanel.Content/>`
* * `<SidePanel.Footer/>`
* * `<SidePanel.Divider/>`
*/
children?: ReactNode;
/** Controls the width of the panel */
width?: string | number;
/** Controls the height of the panel */
height?: string | number;
/** Controls the maximum height of the panel */
maxHeight?: string | number;
/** Specifies the skin of the side panel. */
skin?: 'standard' | 'floating';
/** Specifies if panel is draggable (works only with floating skin). */
draggable?: boolean;
/** Defines a callback function which is called every time a back button is clicked. */
onBackButtonClick?: () => void;
/**
* When provided, sets the content of the back button's tooltip.
* @deprecated use backButtonProps instead.
*/
backButtonDescription?: ReactNode;
/** Allows to pass all common tooltip props to back button’s tooltip.
* @linkTypeTo components-overlays--tooltip
* @setTypeName TooltipCommonProps
*
* @deprecated use backButtonProps instead.
*/
backButtonTooltipProps?: TooltipCommonProps;
/** Back button props. */
backButtonProps?: SidePanelBackButtonProps;
/** Help button props. */
helpButtonProps?: SidePanelButtonProps;
/** Close button props. */
closeButtonProps?: SidePanelButtonProps;
}
export {};
//# sourceMappingURL=SidePanel.types.d.ts.map