diff --git a/src/components/modal/IVModal.type.ts b/src/components/modal/IVModal.type.ts new file mode 100644 index 0000000..fb3a050 --- /dev/null +++ b/src/components/modal/IVModal.type.ts @@ -0,0 +1,69 @@ +import type IVButton from '../button/IVButton.type'; +import type { DialogBreakpoints } from 'primevue/dialog'; + +/** + * Interface representing the properties for a Modal component. + */ +export interface IModal { + /** + * Optional unique identifier for the modal element. + */ + modalId?: string + + /** + * Flag indicating whether the modal is currently open. + */ + opened?: boolean + + /** + * List of actions (buttons) displayed in the modal. + */ + actions?: IVButton[] + + /** + * Determines if the modal should behave like an alert dialog. + */ + isAlert?: boolean + + /** + * Reference to the originating element that triggered the modal, + * used to return focus when the modal is closed. + */ + origin?: { focus: () => void } + + /** + * Title displayed at the top of the modal. + */ + title: string + + /** + * Optional icon name or path to render next to the title. + */ + icon?: string + + /** + * Defines the modal size: 'sm' = small, 'md' = medium, 'lg' = large. + */ + size?: 'sm' | 'md' | 'lg' + + /** + * Accessible label (aria-label) for the close button. + */ + closeButtonLabel?: string + + /** + * Tooltip (title attribute) shown when hovering over the close button. + */ + closeButtonTitle?: string +} + +/** + * Extended Modal interface that includes configuration for responsive breakpoints. + */ +export default interface IVModal extends IModal { + /** + * Breakpoints used to control responsive modal behavior. + * Compatible with PrimeVue Dialog breakpoints format. + */ + breakpoints?: DialogBreakpoints +}