UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

75 lines 3.86 kB
export type AriaRoleMode = 'dialog' | 'status' | 'alert'; export declare const useToastModel: (<TT_Special_Generic>(config?: (Partial<{ /** * Sets the correct aria attributes for the Toast. * Alert toasts are used to convey urgency and important information. The `role` is set to `alert` * Status toasts are used to convey a message or a successful action. The `role` is set to `status` * Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`. * If you use this mode, you must add an aria-label to the main `Toast` component. * The aria-label should provide additional information to the contents of the `Toast`. * @default 'status' */ mode: AriaRoleMode; /** * When the Toast has a `mode="dialog"` this adds a unique id to `Toast.Message` so that the message gets read out for screen readers. */ id: string; }> & {} & {}) | undefined) => { state: { id: string; /** * Sets the correct aria attributes for the Toast. * Alert toasts are used to convey urgency and important information. The `role` is set to `alert` * Status toasts are used to convey a message or a successful action. The `role` is set to `status` * Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`. * If you use this mode, you must add an aria-label to the main `Toast` component. * The aria-label should provide additional information to the contents of the `Toast`. * @default 'status' */ mode: AriaRoleMode; }; events: {}; }) & import("@workday/canvas-kit-react/common").ModelExtras<{ /** * Sets the correct aria attributes for the Toast. * Alert toasts are used to convey urgency and important information. The `role` is set to `alert` * Status toasts are used to convey a message or a successful action. The `role` is set to `status` * Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`. * If you use this mode, you must add an aria-label to the main `Toast` component. * The aria-label should provide additional information to the contents of the `Toast`. * @default 'status' */ mode: AriaRoleMode; /** * When the Toast has a `mode="dialog"` this adds a unique id to `Toast.Message` so that the message gets read out for screen readers. */ id: string; }, {}, { id: string; /** * Sets the correct aria attributes for the Toast. * Alert toasts are used to convey urgency and important information. The `role` is set to `alert` * Status toasts are used to convey a message or a successful action. The `role` is set to `status` * Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`. * If you use this mode, you must add an aria-label to the main `Toast` component. * The aria-label should provide additional information to the contents of the `Toast`. * @default 'status' */ mode: AriaRoleMode; }, {}, { state: { id: string; /** * Sets the correct aria attributes for the Toast. * Alert toasts are used to convey urgency and important information. The `role` is set to `alert` * Status toasts are used to convey a message or a successful action. The `role` is set to `status` * Dialog toasts are used when there's an action to be taken. The `role` is set to `dialog`. * If you use this mode, you must add an aria-label to the main `Toast` component. * The aria-label should provide additional information to the contents of the `Toast`. * @default 'status' */ mode: AriaRoleMode; }; events: {}; }>; //# sourceMappingURL=useToastModel.d.ts.map