/*! * * Copyright (c) "Neo4j" * Neo4j Sweden AB [http://neo4j.com] * * This file is part of Neo4j. * * Neo4j is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ import React from 'react'; import { type CommonProps, type PolymorphicCommonProps } from '../_common/types'; /** * * * Types * * */ type AnnouncementBannerVariant = 'info' | 'warning' | 'danger' | 'discovery' | 'neutral'; type AnnouncementBannerLiveRegion = 'status' | 'alert'; type AnnouncementBannerCommonProps = { /** Shows a status icon. The icon is based on the value of the `variant` prop */ hasIcon?: boolean; /** * Decorative icon shown when `hasIcon` is true. Only used for `discovery` * and `neutral`; those variants fall back to Sparkles and Bolt. `info`, * `warning`, and `danger` always use their status icons. */ icon?: React.ReactNode; /** Content to be shown in the announcement banner. */ children?: React.ReactNode; /** * Announces the header when the banner appears or its header changes. * `status` announces politely, while `alert` interrupts the user. Leave this * unset for banners that are present during the page's initial render. * This is independent of the visual `variant`. */ liveRegion?: AnnouncementBannerLiveRegion; /** The variant of the announcement banner */ variant?: AnnouncementBannerVariant; }; type CloseableAnnouncementBannerProps = { /** If the banner is closeable. Renders an icon button on the right */ isCloseable: true; /** Event handler for when the close icon is clicked */ onClose: (error?: React.MouseEvent | React.KeyboardEvent) => void; }; type NonCloseableAnnouncementBannerProps = { isCloseable?: false; onClose?: never; }; type AnnouncementBannerCloseProps = CloseableAnnouncementBannerProps | NonCloseableAnnouncementBannerProps; type AnnouncementBannerProps = AnnouncementBannerCommonProps & AnnouncementBannerCloseProps; declare const AnnouncementBanner: (({ as, variant, hasIcon, icon, onClose, className, children, isCloseable, htmlAttributes, liveRegion, ref, ...restProps }: PolymorphicCommonProps) => import("react/jsx-runtime").JSX.Element) & { Actions: ({ children, className, style, htmlAttributes, ref, ...restProps }: CommonProps<"div", { children: React.ReactNode; }>) => import("react/jsx-runtime").JSX.Element; Header: ({ children, className, style, htmlAttributes, ref, ...restProps }: CommonProps<"span", { children: React.ReactNode; }>) => import("react/jsx-runtime").JSX.Element; }; export { AnnouncementBanner }; //# sourceMappingURL=AnnouncementBanner.d.ts.map