Merged in feat/sw-3238-move-modal-to-design-system (pull request #2628)

feat(SW-3238): Move modal to design system

* Move Modal to design-system

* Remove temp modal from booking-flow


Approved-by: Joakim Jäderberg
This commit is contained in:
Anton Gunnarsson
2025-08-14 07:14:51 +00:00
parent dc483fe599
commit 04aebb372c
29 changed files with 72 additions and 573 deletions

View File

@@ -0,0 +1,36 @@
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
} & (
| {
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>>
}