UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

74 lines (73 loc) 2.76 kB
import { DistributiveOmit, PolymorphicProps } from "../utils/modern-polymorphic.js"; import React from "react"; import { To } from "history"; //#region src/Breadcrumbs/Breadcrumbs.d.ts type BreadcrumbsProps = React.PropsWithChildren<{ /** * Optional class name for the breadcrumbs container. */ className?: string; /** * Controls the overflow behavior of the breadcrumbs. * By default all overflowing crumbs will "wrap" in the given space taking up extra height. * In the "menu" option we'll see the overflowing crumbs as part of a menu like dropdown instead of the root breadcrumb. * In "menu-with-root" we see that instead of the root, the menu button will take the place of the next breadcrumb. */ overflow?: 'wrap' | 'menu' | 'menu-with-root'; /** * Controls the visual variant of the breadcrumbs. * By default, the breadcrumbs will have a normal appearance. * In the "spacious" option, the breadcrumbs will have increased padding and a more relaxed layout. */ variant?: 'normal' | 'spacious'; /** * Allows passing of CSS custom properties to the breadcrumbs container. */ style?: React.CSSProperties; }>; declare function Breadcrumbs({ className, children, style, overflow, variant }: BreadcrumbsProps): React.JSX.Element; declare namespace Breadcrumbs { var displayName: string; } type StyledBreadcrumbsItemProps<As extends React.ElementType = 'a'> = PolymorphicProps<As, 'a', { to?: To; selected?: boolean; }>; type BreadcrumbsItemProps<As extends React.ElementType = 'a'> = StyledBreadcrumbsItemProps<As>; declare const _default: typeof Breadcrumbs & { Item: (<As extends React.ElementType = "a">(props: DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & { to?: To; selected?: boolean; }, "as"> & { as?: As | undefined; } & React.RefAttributes<any>) => React.ReactNode) & { displayName: string; }; }; /** * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`) */ declare const Breadcrumb: typeof Breadcrumbs & { Item: <As extends React.ElementType = "a">(props: DistributiveOmit<React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & { to?: To; selected?: boolean; }, "as"> & { as?: As | undefined; } & React.RefAttributes<any>) => React.ReactNode; }; /** * @deprecated Use the `BreadcrumbsProps` type instead */ type BreadcrumbProps = BreadcrumbsProps; /** * @deprecated Use the `BreadcrumbsItemProps` type instead */ type BreadcrumbItemProps<As extends React.ElementType = 'a'> = BreadcrumbsItemProps<As>; //#endregion export { Breadcrumb, BreadcrumbItemProps, BreadcrumbProps, BreadcrumbsItemProps, BreadcrumbsProps, _default as default };