Merge branch 'develop' into feature/tracking

This commit is contained in:
Linus Flood
2024-10-08 15:13:16 +02:00
178 changed files with 3745 additions and 1291 deletions

View File

@@ -1,13 +1,24 @@
import { VariantProps } from "class-variance-authority"
import { z } from "zod"
import { bookingWidgetSchema } from "@/components/Forms/BookingWidget/schema"
import { bookingWidgetVariants } from "@/components/Forms/BookingWidget/variants"
import type { Locations } from "@/types/trpc/routers/hotel/locations"
export type BookingWidgetSchema = z.output<typeof bookingWidgetSchema>
export type BookingWidgetType = VariantProps<
typeof bookingWidgetVariants
>["type"]
export interface BookingWidgetProps {
type?: BookingWidgetType
}
export interface BookingWidgetClientProps {
locations: Locations
type?: BookingWidgetType
}
export interface BookingWidgetToggleButtonProps {

View File

@@ -1,7 +1,8 @@
import { FacilityCard, FacilityImage } from "./hotelPage/facilities"
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
import type { FacilityCard } from "./hotelPage/facilities"
export interface CardImageProps extends React.HTMLAttributes<HTMLDivElement> {
card: FacilityCard | undefined
imageCards: Pick<CardProps, "backgroundImage">[]
card: FacilityCard | CardProps
imageCards?: FacilityImage[]
}

View File

@@ -0,0 +1,5 @@
import { z } from "zod"
import { bedTypeSchema } from "@/components/HotelReservation/EnterDetails/BedType/schema"
export interface BedTypeSchema extends z.output<typeof bedTypeSchema> {}

View File

@@ -0,0 +1,5 @@
import { z } from "zod"
import { breakfastSchema } from "@/components/HotelReservation/EnterDetails/Breakfast/schema"
export interface BreakfastSchema extends z.output<typeof breakfastSchema> {}

View File

@@ -0,0 +1,11 @@
import { z } from "zod"
import { detailsSchema } from "@/components/HotelReservation/EnterDetails/Details/schema"
import { User } from "@/types/user"
export interface DetailsSchema extends z.output<typeof detailsSchema> {}
export interface DetailsProps {
user: User | null
}

View File

@@ -1,11 +1,20 @@
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 {
locations: Locations
type?: BookingWidgetType
}
export interface BookingWidgetFormContentProps {
locations: Locations
formId: string
formState: FormState<BookingWidgetSchema>
}
export enum ActionType {

View File

@@ -3,6 +3,7 @@ import { navigationQueryRouter } from "@/server/routers/contentstack/myPages/nav
import { FriendsMembership } from "@/utils/user"
import type { User } from "@/types/user"
import type { LoyaltyLevel } from "@/server/routers/contentstack/loyaltyLevel/output"
type MyPagesNavigation = Awaited<
ReturnType<(typeof navigationQueryRouter)["get"]>
@@ -12,6 +13,7 @@ export interface MyPagesMenuProps {
navigation: MyPagesNavigation
user: Pick<User, "firstName" | "lastName">
membership?: FriendsMembership | null
membershipLevel: LoyaltyLevel | null
}
export interface MyPagesMenuContentProps extends MyPagesMenuProps {

View File

@@ -0,0 +1,5 @@
import type { Amenities } from "@/types/hotel"
export type AmenitiesListProps = {
detailedFacilities: Amenities
}

View File

@@ -1,19 +1,54 @@
import type { Facility } from "@/types/hotel"
import type { ActivityCard } from "@/types/trpc/routers/contentstack/hotelPage"
import type { CardProps } from "@/components/TempDesignSystem/Card/card"
interface ColumnSpanOptions {
columnSpan: "one" | "two" | "three"
export type FacilitiesProps = {
facilities: Facility[]
activitiesCard?: ActivityCard
}
export type FacilityCard = CardProps & ColumnSpanOptions
export type Facility = Array<FacilityCard>
export type Facilities = Array<Facility>
export type FacilityProps = {
facilities: Facilities
export type FacilityImage = {
backgroundImage: CardProps["backgroundImage"]
theme: CardProps["theme"]
id: string
}
export type FacilityCard = {
secondaryButton: {
href: string
title: string
openInNewTab?: boolean
isExternal: boolean
}
heading: string
scriptedTopTitle: string
theme: CardProps["theme"]
id: string
}
export type FacilityCardType = FacilityImage | FacilityCard
export type FacilityGrid = FacilityCardType[]
export type Facilities = FacilityGrid[]
export type CardGridProps = {
facility: Facility
facilitiesCardGrid: FacilityGrid
}
export enum FacilityEnum {
wellness = "wellness-and-exercise",
conference = "meetings-and-conferences",
restaurant = "restaurant-and-bar",
}
export enum RestaurantHeadings {
restaurantAndBar = "Restaurant & Bar",
bar = "Bar",
restaurant = "Restaurant",
breakfastRestaurant = "Breakfast restaurant",
}
export enum FacilityIds {
bar = 1606,
rooftopBar = 1014,
restaurant = 1383,
}

View File

@@ -1,4 +1,4 @@
export enum HotelHashValues {
export enum HotelHashValues { // Should these be translated?
overview = "#overview",
rooms = "#rooms-section",
restaurant = "#restaurant-and-bar",
@@ -7,3 +7,7 @@ export enum HotelHashValues {
activities = "#activities",
faq = "#faq",
}
export type TabNavigationProps = {
restaurantTitle: string
}

View File

@@ -1,4 +1,4 @@
import { AvailabilityPrices } from "@/server/routers/hotels/output"
import { HotelsAvailabilityPrices } from "@/server/routers/hotels/output"
import { Hotel } from "@/types/hotel"
@@ -8,5 +8,5 @@ export type HotelCardListingProps = {
export type HotelData = {
hotelData: Hotel
price: AvailabilityPrices
price: HotelsAvailabilityPrices
}

View File

@@ -0,0 +1,7 @@
import { Rate } from "@/server/routers/hotels/output"
export interface RoomSelectionProps {
rates: Rate[]
nrOfAdults: number
nrOfNights: number
}

View File

@@ -1,4 +1,4 @@
import { Rate } from "@/server/routers/hotels/output"
import { Hotel } from "@/types/hotel"
export interface SectionProps {
nextPath: string
@@ -25,14 +25,12 @@ export interface BreakfastSelectionProps extends SectionProps {
}[]
}
export interface RoomSelectionProps extends SectionProps {
alternatives: Rate[]
nrOfAdults: number
nrOfNights: number
}
export interface DetailsProps extends SectionProps {}
export interface PaymentProps {
hotel: Hotel
}
export interface SectionPageProps {
breakfast?: string
bed?: string

View File

@@ -1,5 +1,7 @@
export interface SectionAccordionProps {
header: string
selection?: string | string[]
isOpen: boolean
isCompleted: boolean
label: string
path: string
}

View File

@@ -0,0 +1,5 @@
export interface SelectRateSearchParams {
fromDate: string
toDate: string
hotel: string
}

View File

@@ -0,0 +1,9 @@
export type ApiImage = {
id: string
url: string
title: string
meta: {
alt: string
caption: string
}
}

View File

@@ -15,40 +15,43 @@ export interface SearchListProps {
getItemProps: PropGetters<unknown>["getItemProps"]
getMenuProps: PropGetters<unknown>["getMenuProps"]
isOpen: boolean
handleClearSearchHistory: () => void
highlightedIndex: HighlightedIndex
locations: Locations
search: string
searchHistory: Locations | null
}
export interface ListProps {
getItemProps: PropGetters<unknown>["getItemProps"]
highlightedIndex: HighlightedIndex
export interface ListProps
extends Pick<
SearchListProps,
"getItemProps" | "highlightedIndex" | "locations"
> {
initialIndex?: number
label?: string
locations: Locations
}
export interface ListItemProps {
getItemProps: PropGetters<unknown>["getItemProps"]
highlightedIndex: HighlightedIndex
export interface ListItemProps
extends Pick<SearchListProps, "getItemProps" | "highlightedIndex"> {
index: number
location: Location
}
export interface DialogProps
extends React.PropsWithChildren,
VariantProps<typeof dialogVariants> {
VariantProps<typeof dialogVariants>,
Pick<SearchListProps, "getMenuProps"> {
className?: string
getMenuProps: PropGetters<unknown>["getMenuProps"]
}
export interface ErrorDialogProps extends React.PropsWithChildren {
getMenuProps: PropGetters<unknown>["getMenuProps"]
}
export interface ErrorDialogProps
extends React.PropsWithChildren,
Pick<SearchListProps, "getMenuProps"> {}
export interface ClearSearchButtonProps {
getItemProps: PropGetters<unknown>["getItemProps"]
highlightedIndex: HighlightedIndex
export interface ClearSearchButtonProps
extends Pick<
SearchListProps,
"getItemProps" | "handleClearSearchHistory" | "highlightedIndex"
> {
index: number
}

View File

@@ -0,0 +1,21 @@
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>
}