UNPKG

6.81 kBSource Map (JSON)View Raw
1{"version":3,"file":"MessageBar.types.js","sourceRoot":"../src/","sources":["components/MessageBar/MessageBar.types.ts"],"names":[],"mappings":";;;AAuOA;;GAEG;AACH,IAAY,cAaX;AAbD,WAAY,cAAc;IACxB,6BAA6B;IAC7B,mDAAQ,CAAA;IACR,8BAA8B;IAC9B,qDAAS,CAAA;IACT,gCAAgC;IAChC,yDAAW,CAAA;IACX,sCAAsC;IACtC,qEAAiB,CAAA;IACjB,gCAAgC;IAChC,yDAAW,CAAA;IACX,gCAAgC;IAChC,yDAAW,CAAA;AACb,CAAC,EAbW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAazB","sourcesContent":["import * as React from 'react';\nimport { BaseButton, Button, IButtonProps } from '../../Button';\nimport type { ITheme, IStyle } from '../../Styling';\nimport type { IRefObject, IStyleFunctionOrObject } from '../../Utilities';\nimport type { IIconProps } from '../../Icon';\n\n/**\n * {@docCategory MessageBar}\n */\nexport interface IMessageBar {}\n\n/**\n * {@docCategory MessageBar}\n */\nexport interface IMessageBarProps extends React.HTMLAttributes<HTMLElement>, React.RefAttributes<HTMLDivElement> {\n /**\n * Optional callback to access the IMessageBar interface. Use this instead of ref for accessing\n * the public methods and properties of the component.\n */\n componentRef?: IRefObject<IMessageBar>;\n\n /**\n * The type of MessageBar to render.\n * @defaultvalue MessageBarType.info\n */\n messageBarType?: MessageBarType;\n\n /**\n * The actions you want to show on the other side.\n */\n actions?: JSX.Element;\n\n /**\n * A description of the message bar for the benefit of screen readers.\n * @deprecated Use native prop `aria-label` instead.\n */\n ariaLabel?: string;\n\n /**\n * Whether the message bar has a dismiss button and its callback.\n * If null, we don't show a dismiss button.\n * @defaultvalue null\n */\n // eslint-disable-next-line deprecation/deprecation\n onDismiss?: (ev?: React.MouseEvent<HTMLElement | BaseButton | Button>) => any;\n\n /**\n * Determines if the message bar is multi lined.\n * If false, and the text overflows over buttons or to another line, it is clipped.\n * @defaultvalue true\n */\n isMultiline?: boolean;\n\n /**\n * Aria label on dismiss button if onDismiss is defined.\n */\n dismissButtonAriaLabel?: string;\n\n /**\n * Determines if the message bar text is truncated.\n * If true, a button will render to toggle between a single line view and multiline view.\n * This prop is for single line message bars with no buttons only in a limited space scenario.\n * @defaultvalue false\n */\n truncated?: boolean;\n\n /**\n * Aria label on overflow button if truncated is defined.\n * @deprecated Use `expandButtonProps` instead.\n */\n overflowButtonAriaLabel?: string;\n\n /**\n * Additional CSS class(es) to apply to the MessageBar.\n */\n className?: string;\n\n /**\n * Theme (provided through customization.)\n */\n theme?: ITheme;\n\n /**\n * Call to provide customized styling that will layer on top of the variant rules.\n */\n styles?: IStyleFunctionOrObject<IMessageBarStyleProps, IMessageBarStyles>;\n\n /**\n * Custom icon prop to replace the dismiss icon.\n * If unset, default will be the Fabric Clear icon.\n */\n dismissIconProps?: IIconProps;\n\n /**\n * Custom icon prop to replace the message bar icon.\n * If unset, default will be the icon set by messageBarType.\n */\n messageBarIconProps?: IIconProps;\n\n /**\n * Button props that can be applied to the expand button of the MessageBar.\n */\n expandButtonProps?: IButtonProps;\n\n /**\n * Custom role to apply to the MessageBar.\n * @defaultvalue `alert` if `messageBarType` is `error`, `blocked`, or `severeWarning`;\n * or `status` otherwise\n */\n role?: 'alert' | 'status' | 'none';\n\n /**\n * By default, MessageBar delay-renders its content within an internal live region to help ensure\n * it's announced by screen readers. You can disable that behavior by setting this prop to `false`.\n *\n * If you set this prop to `false`, to ensure proper announcement you should either:\n * - If appropriate, ensure that the `role` prop is set to `alert` (this will be done by default\n * if `messageBarType` is `error`, `blocked`, or `severeWarning`), OR\n * - Set the `role` prop to `none` (to avoid nested `status` regions), wrap the whole MessageBar\n * in a `<div role=\"status\">` which is always rendered, and ensure that the MessageBar is\n * rendered either conditionally or with a delay.\n * @default true\n */\n delayedRender?: boolean;\n}\n\n/**\n * {@docCategory MessageBar}\n */\nexport interface IMessageBarStyleProps {\n /**\n * Theme (provided through customization).\n */\n theme: ITheme;\n\n /**\n * Additional CSS class(es).\n */\n className?: string;\n\n /**\n * Type of the MessageBar.\n */\n messageBarType?: MessageBarType;\n\n /**\n * Whether the MessageBar contains a dismiss button.\n */\n onDismiss?: boolean;\n\n /**\n * Whether the text is truncated.\n */\n truncated?: boolean;\n\n /**\n * Whether the MessageBar is rendered in multi line (as opposed to single line) mode.\n */\n isMultiline?: boolean;\n\n /**\n * Whether the single line MessageBar is being expanded.\n */\n expandSingleLine?: boolean;\n\n /**\n * Whether the MessageBar contains any action elements.\n */\n actions?: boolean;\n}\n\n/**\n * {@docCategory MessageBar}\n */\nexport interface IMessageBarStyles {\n /**\n * Style set for the root element.\n */\n root?: IStyle;\n\n /**\n * Style set for the element containing the icon, text, and optional dismiss button.\n */\n content?: IStyle;\n\n /**\n * Style set for the element containing the icon.\n */\n iconContainer?: IStyle;\n\n /**\n * Style set for the icon.\n */\n icon?: IStyle;\n\n /**\n * Style set for the element containing the text.\n */\n text?: IStyle;\n\n /**\n * Style set for the text.\n */\n innerText?: IStyle;\n\n /**\n * Style set for the optional dismiss button.\n */\n dismissal?: IStyle;\n\n /**\n * Style set for the icon used to expand and collapse the MessageBar.\n */\n expand?: IStyle;\n\n /**\n * Style set for the element containing the dismiss button.\n */\n dismissSingleLine?: IStyle;\n\n /**\n * Style set for the element containing the expand icon.\n */\n expandSingleLine?: IStyle;\n\n /**\n * Style set for the optional element containing the action elements.\n */\n actions?: IStyle;\n}\n\n/**\n * {@docCategory MessageBar}\n */\nexport enum MessageBarType {\n /** Info styled MessageBar */\n info = 0,\n /** Error styled MessageBar */\n error = 1,\n /** Blocked styled MessageBar */\n blocked = 2,\n /** SevereWarning styled MessageBar */\n severeWarning = 3,\n /** Success styled MessageBar */\n success = 4,\n /** Warning styled MessageBar */\n warning = 5,\n}\n"]}
\No newline at end of file