@primer/react
Version:
An implementation of GitHub's Primer Design System using React
76 lines • 3.08 kB
TypeScript
import React from 'react';
import type { ButtonProps, TextInputProps, LinkProps, CheckboxProps } from '../../index';
import type { OverlayProps } from '../../Overlay/Overlay';
import type { ResponsiveValue } from '../../hooks/useResponsiveValue';
import type { PositionSettings } from '@primer/behaviors';
export type SelectPanelProps = {
title: string;
description?: string;
variant?: 'anchored' | 'modal' | ResponsiveValue<'anchored' | 'modal', 'full-screen' | 'bottom-sheet'>;
selectionVariant?: 'single' | 'multiple' | 'instant';
id?: string;
defaultOpen?: boolean;
open?: boolean;
anchorRef?: React.RefObject<HTMLButtonElement>;
anchoredPositionSettings?: Partial<PositionSettings>;
onCancel?: () => void;
onClearSelection?: undefined | (() => void);
onSubmit?: (event?: React.FormEvent<HTMLFormElement>) => void;
width?: OverlayProps['width'];
height?: 'fit-content';
maxHeight?: Exclude<OverlayProps['maxHeight'], 'xsmall'>;
children: React.ReactNode;
className?: string;
};
export type SelectPanelSecondaryActionProps = {
children: React.ReactNode;
} & (({
variant: 'button';
} & Partial<Omit<ButtonProps, 'variant'>>) | ({
variant: 'link';
} & Partial<LinkProps>) | ({
variant: 'checkbox';
id?: string;
} & CheckboxProps));
export type SelectPanelMessageProps = {
children: React.ReactNode;
} & ({
size?: 'full';
title: string;
variant: 'warning' | 'error' | 'empty';
} | {
size?: 'inline';
title?: never;
variant: 'warning' | 'error';
});
export declare const SelectPanel: React.FC<SelectPanelProps> & {
Button: React.ForwardRefExoticComponent<{
alignContent?: import("../../Button/types").AlignContent;
icon?: React.FunctionComponent<import("@primer/octicons-react").IconProps> | React.ElementType | React.ReactElement | null;
leadingVisual?: React.ElementType | React.ReactElement | null;
trailingVisual?: React.ElementType | React.ReactElement | null;
trailingAction?: React.ElementType | null;
children?: React.ReactNode;
count?: number | string;
} & {
variant?: import("../../Button/types").VariantType;
size?: import("../../Button/types").Size;
disabled?: boolean;
block?: boolean;
loading?: boolean;
loadingAnnouncement?: string;
inactive?: boolean;
labelWrap?: boolean;
} & import("../../sx").SxProp & React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
Header: React.FC<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
onBack?: () => void;
}>;
SearchInput: React.FC<TextInputProps>;
Footer: ({ ...props }: {
[x: string]: any;
}) => React.JSX.Element | null;
Loading: ({ children }: React.PropsWithChildren) => React.JSX.Element;
Message: React.FC<SelectPanelMessageProps>;
SecondaryAction: React.FC<SelectPanelSecondaryActionProps>;
};
//# sourceMappingURL=SelectPanel.d.ts.map