@engie-group/fluid-design-system-react
Version:
Fluid Design System React
41 lines (40 loc) • 1.74 kB
TypeScript
import { InlineMessageProperties } from '@engie-group/fluid-types';
import React, { ComponentPropsWithoutRef, PropsWithChildren } from 'react';
export type NJInlineMessageProps = Omit<InlineMessageProperties, 'isClosable'> & ComponentPropsWithoutRef<'div'> & PropsWithChildren & {
/**
* Callback function executed when the user clicks the close icon. Close icon will not be displayed if not set
*/
onClose?: React.MouseEventHandler<HTMLElement>;
/**
* Label read by screen readers for the close icon. Needed for accessibility reasons.
*
* @default 'close'
*/
ariaLabelClose?: string;
/**
* Optional inline message actions slot. You can pass any JSX elements (recommended NJLink or NJIconButton).
*
* example: `action={<NJLink>remediation action</NJLink>}`
*/
action?: React.ReactNode;
};
export declare const NJInlineMessage: React.ForwardRefExoticComponent<Omit<InlineMessageProperties, "isClosable"> & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
children?: React.ReactNode | undefined;
} & {
/**
* Callback function executed when the user clicks the close icon. Close icon will not be displayed if not set
*/
onClose?: React.MouseEventHandler<HTMLElement>;
/**
* Label read by screen readers for the close icon. Needed for accessibility reasons.
*
* @default 'close'
*/
ariaLabelClose?: string;
/**
* Optional inline message actions slot. You can pass any JSX elements (recommended NJLink or NJIconButton).
*
* example: `action={<NJLink>remediation action</NJLink>}`
*/
action?: React.ReactNode;
} & React.RefAttributes<HTMLDivElement>>;