@atlaskit/flag
Version:
A flag is used for confirmations, alerts, and acknowledgments that require minimal user interaction, often displayed using a flag group.
62 lines (61 loc) • 2.21 kB
TypeScript
/**
* @jsxRuntime classic
* @jsx jsx
*/
import { type ReactElement } from 'react';
import type UIAnalyticsEvent from '@atlaskit/analytics-next/UIAnalyticsEvent';
/**
* @deprecated Use `import { FlagGroupContext } from '@atlaskit/flag/flag-group-context'` instead.
*/
export { FlagGroupContext } from './internal/flag-group-context';
/**
* @deprecated Use `import { useFlagGroup } from '@atlaskit/flag/use-flag-group'` instead.
*/
export { useFlagGroup } from './internal/use-flag-group';
/**
* @deprecated Use `import { flagWidth } from '@atlaskit/flag/constants'` instead.
*/
export { flagWidth } from './constants';
type FlagGroupProps = {
/**
* ID attribute used for DOM selection.
*/
id?: string;
/**
* Describes the specific role of this FlagGroup for users viewing the page with a screen reader (defaults to `Flag notifications`).
*/
label?: string;
/**
* Describes the specific tag on which the screen reader text will be rendered (defaults to `h2`).
*/
labelTag?: React.ElementType;
/**
* Flag elements to be displayed.
*/
children?: Array<ReactElement> | ReactElement | null | boolean;
/**
* Handler which will be called when a Flag's dismiss button is clicked.
* Receives the id of the dismissed Flag as a parameter.
*/
onDismissed?: (id: number | string, analyticsEvent: UIAnalyticsEvent) => void;
/**
* Controls whether the flag group is rendered inline within its parent component or in a portal at the document root.
* `true` renders the flag group in the DOM node closest to the trigger
* `false` renders the flag group in React.Portal
* Defaults to `false`.
*/
shouldRenderToParent?: boolean;
};
/**
* __Flag group__
*
* A flag group is used to group a set of related flags, with entry and exit animations.
*
* - [Examples](https://atlassian.design/components/flag/flag-group/examples)
* - [Code](https://atlassian.design/components/flag/flag-group/code)
*/
export declare const FlagGroup: (props: FlagGroupProps) => JSX.Element;
/**
* @deprecated Use `import { FlagGroup } from '@atlaskit/flag/flag-group'` instead.
*/
export default FlagGroup;