@balby/booking-search 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -45,8 +45,8 @@ npm install react react-dom tailwindcss
45
45
  ### Basic Usage
46
46
 
47
47
  ```tsx
48
- import { BookingSearch } from '@booking-search/react'
49
- import type { BookingSearchPayload, Location, AvailabilityDay } from '@booking-search/react'
48
+ import { BookingSearch } from '@balby/booking-search'
49
+ import type { BookingSearchPayload, Location, AvailabilityDay } from '@balby/booking-search'
50
50
 
51
51
  const locations: Location[] = [
52
52
  { id: '1', name: 'Rome, Italy', type: 'City', countryCode: 'IT' },
@@ -0,0 +1,2 @@
1
+ import type { DateRangePickerProps } from "../../types/booking";
2
+ export declare function DateRangePicker({ availability, value, onChange, disabled, className, minNights, tabIndex }: DateRangePickerProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import type { GuestSelectorProps } from "../../types/booking";
2
+ export declare function GuestSelector({ value, onChange, maxAdults, maxChildren, disabled, className, tabIndex }: GuestSelectorProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import type { BookingSearchProps } from "../../types/booking";
2
+ import type { JSX } from "react";
3
+ /**
4
+ * A component that provides a booking search interface. Users can select a destination, date range, and number of guests.
5
+ * It supports both desktop and mobile layouts.
6
+ *
7
+ * @param {Object} props - The properties object.
8
+ * @param {Array} props.availability - The data specifying available dates for booking.
9
+ * @param {Array} props.locations - The list of available locations for selection.
10
+ * @param {Function} props.onSearch - Callback function triggered when the search is submitted. Receives selected search criteria as an argument.
11
+ * @param {Object} [props.defaultValues] - Default values for location, check-in and check-out dates, and guest count.
12
+ * @param {string} [props.searchButtonText='Cerca'] - Text for the search button.
13
+ * @param {string} [props.locationPlaceholder='Dove vuoi andare?'] - Placeholder text for the location input field.
14
+ * @param {number} [props.minNights=1] - Minimum number of nights for the date range picker.
15
+ * @param {number} [props.maxAdults=30] - Maximum number of adult guests allowed.
16
+ * @param {number} [props.maxChildren=10] - Maximum number of child guests allowed.
17
+ * @param {string} [props.className] - Additional CSS class for customizing the component style.
18
+ *
19
+ * @return {JSX.Element} A booking search component containing inputs for location, date range, and guest selection, along with a search button.
20
+ */
21
+ export declare function BookingSearch({ availability, locations, onSearch, defaultValues, searchButtonText, locationPlaceholder, minNights, maxAdults, maxChildren, className, }: BookingSearchProps): JSX.Element;
22
+ export { LocationCombobox } from "./location-combobox";
23
+ export { DateRangePicker } from "./date-range-picker";
24
+ export { GuestSelector } from "./guest-selector";
@@ -0,0 +1,2 @@
1
+ import type { LocationComboboxProps } from "../../types/booking";
2
+ export declare function LocationCombobox({ locations, value, onChange, placeholder, disabled, className, tabIndex, title }: LocationComboboxProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,67 @@
1
+ import * as React from "react";
2
+ declare const Command: React.ForwardRefExoticComponent<Omit<{
3
+ children?: React.ReactNode;
4
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
5
+ ref?: React.Ref<HTMLDivElement>;
6
+ } & {
7
+ asChild?: boolean;
8
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
9
+ label?: string;
10
+ shouldFilter?: boolean;
11
+ filter?: (value: string, search: string, keywords?: string[]) => number;
12
+ defaultValue?: string;
13
+ value?: string;
14
+ onValueChange?: (value: string) => void;
15
+ loop?: boolean;
16
+ disablePointerSelection?: boolean;
17
+ vimBindings?: boolean;
18
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
19
+ declare const CommandInput: React.ForwardRefExoticComponent<Omit<Omit<Pick<Pick<React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "key" | keyof React.InputHTMLAttributes<HTMLInputElement>> & {
20
+ ref?: React.Ref<HTMLInputElement>;
21
+ } & {
22
+ asChild?: boolean;
23
+ }, "key" | "asChild" | keyof React.InputHTMLAttributes<HTMLInputElement>>, "onChange" | "value" | "type"> & {
24
+ value?: string;
25
+ onValueChange?: (search: string) => void;
26
+ } & React.RefAttributes<HTMLInputElement>, "ref"> & React.RefAttributes<HTMLInputElement>>;
27
+ declare const CommandList: React.ForwardRefExoticComponent<Omit<{
28
+ children?: React.ReactNode;
29
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
30
+ ref?: React.Ref<HTMLDivElement>;
31
+ } & {
32
+ asChild?: boolean;
33
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & {
34
+ label?: string;
35
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
36
+ declare const CommandEmpty: React.ForwardRefExoticComponent<Omit<{
37
+ children?: React.ReactNode;
38
+ } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
39
+ ref?: React.Ref<HTMLDivElement>;
40
+ } & {
41
+ asChild?: boolean;
42
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild"> & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
43
+ declare const CommandGroup: React.ForwardRefExoticComponent<Omit<{
44
+ children?: React.ReactNode;
45
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
46
+ ref?: React.Ref<HTMLDivElement>;
47
+ } & {
48
+ asChild?: boolean;
49
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "value" | "heading"> & {
50
+ heading?: React.ReactNode;
51
+ value?: string;
52
+ forceMount?: boolean;
53
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
54
+ declare const CommandItem: React.ForwardRefExoticComponent<Omit<{
55
+ children?: React.ReactNode;
56
+ } & Omit<Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
57
+ ref?: React.Ref<HTMLDivElement>;
58
+ } & {
59
+ asChild?: boolean;
60
+ }, "key" | keyof React.HTMLAttributes<HTMLDivElement> | "asChild">, "onSelect" | "value" | "disabled"> & {
61
+ disabled?: boolean;
62
+ onSelect?: (value: string) => void;
63
+ value?: string;
64
+ keywords?: string[];
65
+ forceMount?: boolean;
66
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
67
+ export { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, };
@@ -0,0 +1,14 @@
1
+ import * as React from "react";
2
+ import * as DialogPrimitive from "@radix-ui/react-dialog";
3
+ declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
4
+ declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
6
+ declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
7
+ declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
+ declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ declare const DialogHeader: {
10
+ ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
11
+ displayName: string;
12
+ };
13
+ declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
14
+ export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogTitle, };
@@ -0,0 +1,7 @@
1
+ import * as React from "react";
2
+ import * as PopoverPrimitive from "@radix-ui/react-popover";
3
+ declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
6
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
package/dist/demo.d.ts ADDED
@@ -0,0 +1 @@
1
+ import "./styles/output.css";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * BookingSearch Component
3
+ */
4
+ import "./styles/output.css";
5
+ export { BookingSearch } from "./components/booking-search";
6
+ export { LocationCombobox, DateRangePicker, GuestSelector, } from "./components/booking-search";
7
+ export type { AvailabilityDay, SearchLocation, GuestData, BookingSearchPayload, BookingSearchProps, LocationComboboxProps, DateRangePickerProps, GuestSelectorProps, GuestStepperProps, } from "./types/booking";
8
+ export { cn } from "./lib/utils";