Files
web/packages/design-system/lib/components/Modal/modal.ts
Christel Westerberg cd8b30f2ec Merged in fix/STAY-133 (pull request #3313)
Fix/STAY-133

* fix: Add static summary buttons row on add ancillary flow

* fix: refactor handling of modals

* fix: refactor file structure for add ancillary flow

* Merged in chore/replace-deprecated-body (pull request #3300)

Replace deprecated <Body> with <Typography>

* chore: replace deprecated body component

* refactor: replace Body component with Typography across various components

* merge

Approved-by: Bianca Widstam
Approved-by: Matilda Landström


Approved-by: Bianca Widstam
Approved-by: Matilda Landström
2025-12-11 07:29:36 +00:00

38 lines
833 B
TypeScript

import type { Dispatch, JSX, SetStateAction } from 'react'
export enum AnimationStateEnum {
unmounted = 'unmounted',
hidden = 'hidden',
visible = 'visible',
}
export type AnimationState = keyof typeof AnimationStateEnum
export type ModalProps = {
onAnimationComplete?: () => void
title?: string
subtitle?: string
withActions?: boolean
hideHeader?: boolean
className?: string
contentClassName?: string
} & (
| {
trigger: JSX.Element
isOpen?: never
onToggle?: never
onOpenChange?: (open: boolean) => void
}
| {
trigger?: never
isOpen: boolean
onToggle: (open: boolean) => void
onOpenChange?: never
}
)
export type InnerModalProps = Omit<ModalProps, 'trigger'> & {
animation: AnimationState
setAnimation: Dispatch<SetStateAction<AnimationState>>
}