feat(SW-350): Implemented tooltip and booking widget tablet design

This commit is contained in:
Pontus Dreij
2024-10-04 10:00:52 +02:00
parent 04406d3865
commit aee9e94f7a
17 changed files with 530 additions and 137 deletions

View File

@@ -1,4 +1,9 @@
import type { BookingWidgetType } from "@/types/components/bookingWidget"
import { FormState, UseFormReturn } from "react-hook-form"
import type {
BookingWidgetSchema,
BookingWidgetType,
} from "@/types/components/bookingWidget"
import type { Location, Locations } from "@/types/trpc/routers/hotel/locations"
export interface BookingWidgetFormProps {
@@ -8,6 +13,8 @@ export interface BookingWidgetFormProps {
export interface BookingWidgetFormContentProps {
locations: Locations
formId: string
formState: FormState<BookingWidgetSchema>
}
export enum ActionType {

View File

@@ -0,0 +1,22 @@
export type TooltipPosition = "left" | "right" | "top" | "bottom"
type VerticalArrow = "top" | "bottom" | "center"
type HorizontalArrow = "left" | "right" | "center"
type ValidArrowMap = {
left: VerticalArrow
right: VerticalArrow
top: HorizontalArrow
bottom: HorizontalArrow
}
type ValidArrow<P extends TooltipPosition> = P extends keyof ValidArrowMap
? ValidArrowMap[P]
: never
export interface TooltipProps<P extends TooltipPosition = TooltipPosition> {
heading?: string
text?: string
position: P
arrow: ValidArrow<P>
children: React.ReactNode
}