Merged in feat/SW-350-booking-widget-ui (pull request #634)

Feat/SW-350 booking widget ui

Approved-by: Simon.Emanuelsson
This commit is contained in:
Pontus Dreij
2024-10-08 09:34:12 +00:00
33 changed files with 693 additions and 163 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,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

@@ -39,14 +39,14 @@ export interface ListItemProps
export interface DialogProps
extends React.PropsWithChildren,
VariantProps<typeof dialogVariants>,
Pick<SearchListProps, "getMenuProps"> {
VariantProps<typeof dialogVariants>,
Pick<SearchListProps, "getMenuProps"> {
className?: string
}
export interface ErrorDialogProps
extends React.PropsWithChildren,
Pick<SearchListProps, "getMenuProps"> { }
Pick<SearchListProps, "getMenuProps"> {}
export interface ClearSearchButtonProps
extends Pick<

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>
}