@rws-air/webcomponents
Version:
Standard Webcomponents for AIR projects
51 lines • 1.82 kB
TypeScript
import React from 'react';
import { ModalProps, ModalQAs } from '../Modal';
export interface ConfirmationModalQAs extends ModalQAs {
/** Data-qa applied to the modal actions */
actions?: string;
/** Data-qa applied to the action confirm button */
actionConfirm?: string;
/** Data-qa applied to the action cancel button */
actionCancel?: string;
}
export interface ConfirmationModalProps extends ModalProps {
/** Object of data-qa tags to pass to the modal */
modalqas?: ConfirmationModalQAs;
/** Text to show in the confirm button */
okButtonText: string;
/** Text to show in the cancel button */
cancelButtonText: string;
/** Whether the icon for this modal should be a Warning triangle or a Check Circle */
modalType: 'warning' | 'check';
/** Action performed when the cancel button is clicked */
closeAction(): void;
/** Action performed when the confirm button is clicked */
confirmAction(): void;
}
/**
* Constructs a confirmation modal using pre-defined Rijkswaterstaat styling
* @param props Props to pass to the confirmation modal
* @example
* ```jsx
* <ConfirmationModal
* modalType='warning'
* open={true}
* topic='SAMPLE TOPIC'
* cancelButtonText='CANCEL'
* okButtonText='OK'
* confirmAction={console.log}
* closeAction={console.log}
* modalqas={{
* modal: 'sample',
* content: 'sample-content',
* title: 'sample-title',
* actions: 'sample-actions',
* actionCancel: 'sample-action-cancel',
* actionConfirm: 'sample-action-confirm',
* }}
* dialogContent={ <ModalContent><div>SAMPLE</div></ModalContent> }
* />
* ```
*/
export declare const ConfirmationModal: React.MemoExoticComponent<(props: ConfirmationModalProps) => JSX.Element>;
//# sourceMappingURL=index.d.ts.map