UNPKG

@primer/react

Version:

An implementation of GitHub's Primer Design System using React

103 lines 5.76 kB
export type { ActionListProps } from './shared'; export type { ActionListGroupProps, ActionListGroupHeadingProps } from './Group'; export type { ActionListItemProps } from './shared'; export type { ActionListLinkItemProps } from './LinkItem'; export type { ActionListDividerProps } from './Divider'; export type { ActionListDescriptionProps } from './Description'; export type { ActionListLeadingVisualProps, ActionListTrailingVisualProps } from './Visuals'; export type { ActionListHeadingProps } from './Heading'; export type { ActionListTrailingActionProps } from './TrailingAction'; /** * Collection of list-related components. */ export declare const ActionList: (<As extends React.ElementType = "ul">(props: (import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "ul" : As> & { variant?: "inset" | "horizontal-inset" | "full"; selectionVariant?: "single" | "radio" | "multiple"; showDividers?: boolean; role?: import("../utils/types").AriaRole; disableFocusZone?: boolean; className?: string; } & { children?: import("react").ReactNode | undefined; } extends infer T ? T extends import("react").ComponentPropsWithRef<import("react").ElementType extends As ? "ul" : As> & { variant?: "inset" | "horizontal-inset" | "full"; selectionVariant?: "single" | "radio" | "multiple"; showDividers?: boolean; role?: import("../utils/types").AriaRole; disableFocusZone?: boolean; className?: string; } & { children?: import("react").ReactNode | undefined; } ? T extends unknown ? Omit<T, "as"> : never : never : never) & { as?: As | undefined; } & import("react").RefAttributes<unknown>) => React.ReactNode) & { /** Collects related `Items` in an `ActionList`. */ Group: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Group").ActionListGroupProps>>; /** An actionable or selectable `Item` */ Item: (<As extends React.ElementType = "li">(props: (import("../utils/modern-polymorphic").PolymorphicProps<As, "li"> extends infer T ? T extends import("../utils/modern-polymorphic").PolymorphicProps<As, "li"> ? T extends any ? Omit<T, "onSelect"> : never : never : never) & { children?: React.ReactNode; onSelect?: (event: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>) => void; selected?: boolean; active?: boolean; variant?: "default" | "danger"; size?: "medium" | "large"; disabled?: boolean; role?: import("../utils/types").AriaRole; id?: string; inactiveText?: string; loading?: boolean; _PrivateItemWrapper?: React.FC<React.PropsWithChildren<{ onClick?: (event: React.MouseEvent<HTMLElement>) => void; onKeyPress?: (event: React.KeyboardEvent<HTMLElement>) => void; 'aria-disabled'?: boolean; tabIndex?: number; 'aria-labelledby'?: string; 'aria-describedby'?: string; role?: string; className?: string; }>>; className?: string; groupId?: string; renderItem?: (item: React.FC<React.PropsWithChildren<{ onClick?: (event: React.MouseEvent<HTMLElement>) => void; onKeyPress?: (event: React.KeyboardEvent<HTMLElement>) => void; 'aria-disabled'?: boolean; tabIndex?: number; 'aria-labelledby'?: string; 'aria-describedby'?: string; role?: string; className?: string; }>>) => React.ReactNode; handleAddItem?: (item: React.FC<React.PropsWithChildren<{ onClick?: (event: React.MouseEvent<HTMLElement>) => void; onKeyPress?: (event: React.KeyboardEvent<HTMLElement>) => void; 'aria-disabled'?: boolean; tabIndex?: number; 'aria-labelledby'?: string; 'aria-describedby'?: string; role?: string; className?: string; }>>) => void; as?: As | undefined; } & import("react").RefAttributes<any>) => React.ReactNode) & { displayName: string; __SLOT__: symbol; }; /** A `Item` that renders a full-size anchor inside ListItem */ LinkItem: import("../utils/polymorphic").ForwardRefComponent<"a", import("./LinkItem").ActionListLinkItemProps>; /** Visually separates `Item`s or `Group`s in an `ActionList`. */ Divider: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Divider").ActionListDividerProps>>; /** Secondary text which provides additional information about an `Item`. */ Description: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Description").ActionListDescriptionProps>>; /** Icon (or similar) positioned before `Item` text. */ LeadingVisual: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Visuals").VisualProps>>; /** Icon (or similar) positioned after `Item` text. */ TrailingVisual: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Visuals").VisualProps>>; /** Heading for an `ActionList`. */ Heading: import("../utils/polymorphic").ForwardRefComponent<"h1" | "h2" | "h3" | "h4" | "h5" | "h6", import("./Heading").ActionListHeadingProps>; /** Heading for `ActionList.Group` */ GroupHeading: import("../utils/types").FCWithSlotMarker<import("react").PropsWithChildren<import("./Group").ActionListGroupHeadingProps>>; /** Secondary action */ TrailingAction: import("../utils/polymorphic").ForwardRefComponent<"a" | "button", import("./TrailingAction").ActionListTrailingActionProps>; }; //# sourceMappingURL=index.d.ts.map