UNPKG

aws-northstar

Version:
79 lines (75 loc) 3.06 kB
/** ******************************************************************************************************************* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 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 React, { FunctionComponent } from 'react'; export interface PopoverProps { /** * Determines where the popover is displayed when opened, relative to the trigger. * If the popover doesn't have enough space to open in this direction, it * automatically chooses a better direction based on available space. */ position?: 'top' | 'right' | 'bottom' | 'left'; /** * Determines the maximum width for the popover. */ size?: 'small' | 'medium' | 'large'; /** * Expands the popover body to its maximum width regardless of content. * For example, use it when you need to place a column layout in the popover content. */ fixedWidth?: boolean; /** * Specifies the type of content inside the trigger region. The following types are available: * - `text` - Use for inline text triggers. * - `custom` - Use for the Northstar Button component. */ triggerType?: 'text' | 'custom'; /** * Specifies how the popover should be opened: * - `click` (default) - click on the trigger region to open the popover * - `hover` - hover the mouse over the trigger region to open the popover */ variant?: 'click' | 'hover'; /** * Element that triggers the popover when selected by the user. */ children?: React.ReactNode; /** * Specifies optional header text for the popover. */ header?: React.ReactNode; /** * Content of the popover. */ content?: React.ReactNode; /** * Determines whether the dismiss button is shown in the popover body. */ showDismissButton?: boolean; /** * Adds an `aria-label` to the dismiss button for accessibility. */ dismissAriaLabel?: string; /** * Optional callback called when the popover is opened */ onOpen?: () => void; /** * Optional callback called when the popover is closed */ onClose?: () => void; } /** * A Popover can be used to display some content on top of another. */ declare const Popover: FunctionComponent<PopoverProps>; export default Popover;