feat(SW-66, SW-348): search functionality and ui

This commit is contained in:
Simon Emanuelsson
2024-08-28 10:47:57 +02:00
parent b9dbcf7d90
commit af850c90e7
437 changed files with 7663 additions and 9881 deletions

View File

@@ -0,0 +1,54 @@
import { dialogVariants } from "@/components/Forms/BookingWidget/FormContent/Search/SearchList/Dialog/variants"
import type { VariantProps } from "class-variance-authority"
import type { PropGetters } from "downshift"
import type { Location, Locations } from "../trpc/routers/hotel/locations"
export interface SearchProps {
locations: Locations
}
type HighlightedIndex = number | null
export interface SearchListProps {
getItemProps: PropGetters<unknown>["getItemProps"]
getMenuProps: PropGetters<unknown>["getMenuProps"]
isOpen: boolean
highlightedIndex: HighlightedIndex
locations: Locations
search: string
searchHistory: Locations | null
}
export interface ListProps {
getItemProps: PropGetters<unknown>["getItemProps"]
highlightedIndex: HighlightedIndex
initialIndex?: number
label?: string
locations: Locations
}
export interface ListItemProps {
getItemProps: PropGetters<unknown>["getItemProps"]
highlightedIndex: HighlightedIndex
index: number
location: Location
}
export interface DialogProps
extends React.PropsWithChildren,
VariantProps<typeof dialogVariants> {
className?: string
getMenuProps: PropGetters<unknown>["getMenuProps"]
}
export interface ErrorDialogProps extends React.PropsWithChildren {
getMenuProps: PropGetters<unknown>["getMenuProps"]
}
export interface ClearSearchButtonProps {
getItemProps: PropGetters<unknown>["getItemProps"]
highlightedIndex: HighlightedIndex
index: number
}