UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

72 lines 3.14 kB
import type { To } from 'history'; import React from 'react'; import { type PolymorphicProps } from '../utils/modern-polymorphic'; export 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; }>; export type BreadcrumbsItemProps<As extends React.ElementType = 'a'> = StyledBreadcrumbsItemProps<As>; declare const _default: typeof Breadcrumbs & { Item: (<As extends React.ElementType = "a">(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & { to?: To; selected?: boolean; } extends infer T ? T extends React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & { to?: To; selected?: boolean; } ? T extends unknown ? Omit<T, "as"> : never : never : never) & { as?: As | undefined; } & React.RefAttributes<any>) => React.ReactNode) & { displayName: string; }; }; export default _default; /** * @deprecated Use the `Breadcrumbs` component instead (i.e. `<Breadcrumb>` → `<Breadcrumbs>`) */ export declare const Breadcrumb: typeof Breadcrumbs & { Item: <As extends React.ElementType = "a">(props: (React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & { to?: To; selected?: boolean; } extends infer T ? T extends React.ComponentPropsWithRef<React.ElementType extends As ? "a" : As> & { to?: To; selected?: boolean; } ? T extends unknown ? Omit<T, "as"> : never : never : never) & { as?: As | undefined; } & React.RefAttributes<any>) => React.ReactNode; }; /** * @deprecated Use the `BreadcrumbsProps` type instead */ export type BreadcrumbProps = BreadcrumbsProps; /** * @deprecated Use the `BreadcrumbsItemProps` type instead */ export type BreadcrumbItemProps<As extends React.ElementType = 'a'> = BreadcrumbsItemProps<As>; //# sourceMappingURL=Breadcrumbs.d.ts.map