@neo4j-ndl/react
Version:
React implementation of Neo4j Design System
94 lines (93 loc) • 4.41 kB
TypeScript
/**
*
* 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 <http://www.gnu.org/licenses/>.
*/
import React from 'react';
import { type HtmlAttributes, type PolymorphicForwardRefExoticComponent, type PolymorphicPropsWithoutRef, type PolymorphicPropsWithRef } from '../_common/types';
import { type ContextMenuProps } from '../context-menu';
export interface BreadcrumbsBaseItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
children?: React.ReactNode;
className?: string;
href?: string;
isCurrentPage?: boolean;
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
}
export interface BreadcrumbsGroupItemProps {
children?: React.ReactNode;
className?: string;
}
export interface BreadcrumbsItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
as?: string | React.ComponentType<any>;
children: React.ReactNode;
className?: string;
hasSeparator?: boolean;
href?: string;
isCurrentPage?: boolean;
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
}
export interface BreadcrumbsItemMenuProps extends Omit<ContextMenuProps, 'isOpen' | 'onClick' | 'onClose'> {
children: React.ReactNode;
className?: string;
isOpen?: boolean;
onClick?: (event: React.MouseEvent<HTMLElement> | undefined) => void;
onClose?: (event?: Event) => void;
/** HTML attributes */
htmlAttributes?: HtmlAttributes<'button'>;
}
export interface BreadcrumbsEllipsisMenuProps extends Omit<ContextMenuProps, 'isOpen' | 'onClose'> {
isOpen?: boolean;
onClose?: (event?: Event) => void;
onKeyDown?: (event: React.KeyboardEvent<HTMLElement>) => void;
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
}
export interface BreadcrumbsMenuItemProps extends Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'onClick'> {
children: React.ReactNode;
className?: string;
href?: string;
isCurrentPage?: boolean;
onClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>, href?: string) => void;
}
export interface BreadcrumbsProps {
children?: React.ReactNode;
className?: string;
}
declare const Breadcrumbs: {
<T extends React.ElementType = "nav">({ as, children, className, htmlAttributes, }: PolymorphicPropsWithoutRef<T, BreadcrumbsMenuItemProps>): import("react/jsx-runtime").JSX.Element;
displayName: string;
} & {
BaseItem: PolymorphicForwardRefExoticComponent<"a", BreadcrumbsBaseItemProps>;
GroupItem: {
({ as, children, className, style, htmlAttributes, }: PolymorphicPropsWithRef<"li", BreadcrumbsGroupItemProps>): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
Item: {
<T extends React.ElementType = "a">({ as, children, className, hasSeparator, href, isCurrentPage, onClick, htmlAttributes, }: PolymorphicPropsWithRef<T, BreadcrumbsItemProps>): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
ItemMenu: {
({ children, className, isOpen, onClick, onClose, htmlAttributes, }: BreadcrumbsItemMenuProps): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
EllipsisMenu: <T extends React.ElementType = "span">({ as, children, className, isOpen, onClick, onClose, onKeyDown, htmlAttributes, }: PolymorphicPropsWithoutRef<T, BreadcrumbsEllipsisMenuProps>) => import("react/jsx-runtime").JSX.Element;
MenuItem: {
<T extends React.ElementType = "span">({ as, children, className, href, isCurrentPage, onClick, htmlAttributes, }: PolymorphicPropsWithoutRef<T, BreadcrumbsMenuItemProps>): import("react/jsx-runtime").JSX.Element;
displayName: string;
};
};
export { Breadcrumbs };