willba-component-library 0.2.78 → 0.2.79

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.
Files changed (60) hide show
  1. package/lib/assets/IconsSvg.d.ts +9 -0
  2. package/lib/components/Button/Button.d.ts +29 -0
  3. package/lib/components/Button/Button.stories.d.ts +7 -0
  4. package/lib/components/Button/index.d.ts +1 -0
  5. package/lib/components/FilterBar/FilterBar.d.ts +5 -0
  6. package/lib/components/FilterBar/FilterBar.stories.d.ts +6 -0
  7. package/lib/components/FilterBar/FilterBarTypes.d.ts +56 -0
  8. package/lib/components/FilterBar/components/buttons/index.d.ts +4 -0
  9. package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +10 -0
  10. package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +10 -0
  11. package/lib/components/FilterBar/components/categories/Categories.d.ts +8 -0
  12. package/lib/components/FilterBar/components/divider/Divider.d.ts +3 -0
  13. package/lib/components/FilterBar/components/guests/GuestCount/GuestCount.d.ts +4 -0
  14. package/lib/components/FilterBar/components/guests/Guests.d.ts +10 -0
  15. package/lib/components/FilterBar/components/index.d.ts +4 -0
  16. package/lib/components/FilterBar/hooks/index.d.ts +2 -0
  17. package/lib/components/FilterBar/hooks/useFilterBar.d.ts +27 -0
  18. package/lib/components/FilterBar/hooks/useScrollInToView.d.ts +9 -0
  19. package/lib/components/FilterBar/index.d.ts +2 -0
  20. package/lib/components/FilterBar/utils/index.d.ts +1 -0
  21. package/lib/components/FilterBar/utils/parseGuests.d.ts +17 -0
  22. package/lib/components/FilterCalendar/FilterCalendar.d.ts +5 -0
  23. package/lib/components/FilterCalendar/FilterCalendar.stories.d.ts +8 -0
  24. package/lib/components/FilterCalendar/FilterCalendarTypes.d.ts +9 -0
  25. package/lib/components/FilterCalendar/components/Footer.d.ts +10 -0
  26. package/lib/components/FilterCalendar/hooks/useFilterCalendar.d.ts +28 -0
  27. package/lib/components/FilterCalendar/index.d.ts +2 -0
  28. package/lib/core/components/buttons/close-button/CloseButton.d.ts +7 -0
  29. package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +13 -0
  30. package/lib/core/components/calendar/Calendar.d.ts +5 -0
  31. package/lib/core/components/calendar/CalendarTypes.d.ts +46 -0
  32. package/lib/core/components/calendar/hooks/index.d.ts +3 -0
  33. package/lib/core/components/calendar/hooks/useCalendarLoadingSpinner.d.ts +5 -0
  34. package/lib/core/components/calendar/hooks/useCalendarTooltips.d.ts +5 -0
  35. package/lib/core/components/calendar/hooks/useUpdateDisabledDates.d.ts +14 -0
  36. package/lib/core/components/calendar/utils/calendarSelectionRules.d.ts +15 -0
  37. package/lib/core/components/calendar/utils/checkForContinuousSelection.d.ts +11 -0
  38. package/lib/core/components/calendar/utils/disabledDatesByPage.d.ts +9 -0
  39. package/lib/core/components/calendar/utils/handleCalendarModifiers.d.ts +47 -0
  40. package/lib/core/components/calendar/utils/handleRangeContextDisabledDates.d.ts +27 -0
  41. package/lib/core/components/calendar/utils/index.d.ts +8 -0
  42. package/lib/core/components/calendar/utils/nightsCount.d.ts +6 -0
  43. package/lib/core/components/calendar/utils/parseDate.d.ts +7 -0
  44. package/lib/core/components/calendar/utils/parseDates.d.ts +6 -0
  45. package/lib/core/components/index.d.ts +3 -0
  46. package/lib/core/hooks/index.d.ts +3 -0
  47. package/lib/core/hooks/useAwaitRender.d.ts +1 -0
  48. package/lib/core/hooks/useCloseFilterSection.d.ts +8 -0
  49. package/lib/core/hooks/useUpdateTranslations.d.ts +5 -0
  50. package/lib/i18n.d.ts +2 -0
  51. package/lib/index.d.ts +127 -0
  52. package/lib/index.esm.js +12203 -0
  53. package/lib/index.esm.js.map +1 -0
  54. package/lib/index.js +12225 -0
  55. package/lib/index.js.map +1 -0
  56. package/lib/index.umd.js +12229 -0
  57. package/lib/index.umd.js.map +1 -0
  58. package/lib/themes/useTheme.d.ts +15 -0
  59. package/package.json +1 -1
  60. package/willba-component-library-0.2.77.tgz +0 -0
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ type Icon = 'spinner' | 'warning';
3
+ type Props = {
4
+ fill?: string;
5
+ size?: number;
6
+ icon: Icon;
7
+ };
8
+ export declare const IconsSvg: ({ fill, size, icon }: Props) => React.JSX.Element | undefined;
9
+ export {};
@@ -0,0 +1,29 @@
1
+ import React from "react";
2
+ import "./button.css";
3
+ export interface ButtonProps {
4
+ /**
5
+ * Is this the principal call to action on the page?
6
+ */
7
+ type?: "primary" | "secondary";
8
+ /**
9
+ * What background color to use
10
+ */
11
+ textColor?: string;
12
+ /**
13
+ * How large should the button be?
14
+ */
15
+ size?: "small" | "medium" | "large";
16
+ /**
17
+ * Button contents
18
+ */
19
+ label: string;
20
+ /**
21
+ * Optional click handler
22
+ */
23
+ onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
24
+ }
25
+ /**
26
+ * Primary UI component for user interaction
27
+ */
28
+ declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => React.JSX.Element;
29
+ export default Button;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import Button from "./Button";
3
+ declare const meta: Meta<typeof Button>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Button>;
6
+ export declare const Primary: Story;
7
+ export declare const Secondary: Story;
@@ -0,0 +1 @@
1
+ export { default } from "./Button";
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import '../../themes/Default.css';
3
+ import { FilterBarProps } from './FilterBarTypes';
4
+ import './FilterBar.css';
5
+ export default function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, }: FilterBarProps): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import FilterBar from './FilterBar';
3
+ declare const meta: Meta<typeof FilterBar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof FilterBar>;
6
+ export declare const Main: Story;
@@ -0,0 +1,56 @@
1
+ import { DisableCalendarDates } from '../../core/components/calendar/CalendarTypes';
2
+ import { Palette } from '../../themes/useTheme';
3
+ export type FilterBarProps = {
4
+ language?: string;
5
+ ageCategories?: AgeCategoryType[];
6
+ redirectUrl?: string;
7
+ palette?: Palette;
8
+ onSubmit?: ((val: Filters) => void) | null;
9
+ fullWidth?: boolean;
10
+ disableCalendarDates?: DisableCalendarDates;
11
+ mode?: string;
12
+ defaultTab?: string;
13
+ tabs?: Tab[];
14
+ outerLoading?: boolean;
15
+ };
16
+ export type AgeCategoryCount = {
17
+ [categoryId: string]: number;
18
+ };
19
+ export type AgeCategoryType = {
20
+ id: string;
21
+ name: string;
22
+ minVal: number;
23
+ sortOrder: number;
24
+ };
25
+ export type GuestsCountPropsType = {
26
+ label: string;
27
+ id: number;
28
+ updateGuestsCount: (arg1: string, arg2: number) => void;
29
+ count: number;
30
+ minVal: number;
31
+ sortOrder: number;
32
+ };
33
+ export declare enum FilterSections {
34
+ CALENDAR = "calendar",
35
+ GUESTS = "guests",
36
+ CATEGORIES = "categories"
37
+ }
38
+ export type Filters = {
39
+ [key: string]: string;
40
+ };
41
+ export declare enum Pages {
42
+ ROOMS = "/rooms",
43
+ EVENTS = "/events"
44
+ }
45
+ type Translations = {
46
+ en: string;
47
+ fi: string;
48
+ [key: string]: string;
49
+ };
50
+ export type Tab = {
51
+ path: string;
52
+ default?: boolean;
53
+ order: number;
54
+ label?: Translations;
55
+ };
56
+ export {};
@@ -0,0 +1,4 @@
1
+ export { CloseButton } from '../../../../core/components/buttons/close-button/CloseButton';
2
+ export { SubmitButton } from '../../../../core/components/buttons/submit-button/SubmitButton';
3
+ export { SelectButton } from './select-button/SelectButton';
4
+ export { TabButton } from './tab-button/TabButton';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import './SelectButton.css';
3
+ type Props = {
4
+ label: string;
5
+ onClick: () => void;
6
+ description: string;
7
+ active?: boolean;
8
+ };
9
+ export declare const SelectButton: ({ active, label, onClick, description, }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import './TabButton.css';
3
+ type Props = {
4
+ onClick?: () => void;
5
+ label: string;
6
+ active?: boolean;
7
+ mode?: string;
8
+ };
9
+ export declare const TabButton: ({ onClick, label, active, mode }: Props) => React.JSX.Element;
10
+ export {};
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import './Categories.css';
3
+ type Props = {
4
+ categories: any;
5
+ setCategories: any;
6
+ };
7
+ export declare const Categories: ({ categories, setCategories }: Props) => React.JSX.Element;
8
+ export {};
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import './Divider.css';
3
+ export declare const Divider: () => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { GuestsCountPropsType } from '../../../FilterBarTypes';
3
+ import './GuestCount.css';
4
+ export default function GuestCount({ label, sortOrder, id, updateGuestsCount, count, minVal, }: GuestsCountPropsType): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { AgeCategoryCount, AgeCategoryType } from '../../FilterBarTypes';
3
+ import './Guests.css';
4
+ type Props = {
5
+ ageCategories: AgeCategoryType[];
6
+ updateGuestsCount: (arg1: string, arg2: number) => void;
7
+ ageCategoryCounts: AgeCategoryCount | {};
8
+ };
9
+ export declare const Guests: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
10
+ export {};
@@ -0,0 +1,4 @@
1
+ export { CloseButton, SelectButton, SubmitButton, TabButton } from './buttons';
2
+ export { Guests } from './guests/Guests';
3
+ export { Divider } from './divider/Divider';
4
+ export { Categories } from './categories/Categories';
@@ -0,0 +1,2 @@
1
+ export { useFilterBar } from './useFilterBar';
2
+ export { useScrollInToView } from './useScrollInToView';
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { DateRange } from 'react-day-picker';
3
+ import { AgeCategoryCount, AgeCategoryType, Filters, Tab } from '../FilterBarTypes';
4
+ type Props = {
5
+ redirectUrl?: string;
6
+ ageCategories?: AgeCategoryType[];
7
+ onSubmit?: ((val: Filters) => void) | null;
8
+ tabs?: Tab[];
9
+ };
10
+ export declare const useFilterBar: ({ redirectUrl, ageCategories, onSubmit, tabs, }: Props) => {
11
+ selectedFilter: string | boolean;
12
+ ageCategoryCounts: AgeCategoryCount;
13
+ categories: number;
14
+ calendarRange: DateRange | undefined;
15
+ selectedPath: string;
16
+ innerLoading: boolean;
17
+ setCalendarRange: import("react").Dispatch<import("react").SetStateAction<DateRange | undefined>>;
18
+ setSelectedFilter: import("react").Dispatch<import("react").SetStateAction<string | boolean>>;
19
+ setAgeCategoryCounts: import("react").Dispatch<import("react").SetStateAction<AgeCategoryCount>>;
20
+ setCategories: import("react").Dispatch<import("react").SetStateAction<number>>;
21
+ handleSelectedFilter: (id: string | boolean) => void;
22
+ handleSubmit: () => void;
23
+ updateGuestsCount: (id: string, newCount: number) => void;
24
+ handleResetFilters: () => void;
25
+ setSelectedPath: import("react").Dispatch<import("react").SetStateAction<string>>;
26
+ };
27
+ export {};
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ selectedFilter: string | boolean;
4
+ };
5
+ export declare const useScrollInToView: ({ selectedFilter }: Props) => {
6
+ isMobile: boolean;
7
+ targetFilterBarRef: import("react").MutableRefObject<HTMLDivElement | null>;
8
+ };
9
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './FilterBar';
2
+ export * from './FilterBarTypes';
@@ -0,0 +1 @@
1
+ export { parseGuests } from './parseGuests';
@@ -0,0 +1,17 @@
1
+ import { AgeCategoryCount, AgeCategoryType } from '../FilterBarTypes';
2
+ type Props = {
3
+ ageCategoryCounts: AgeCategoryCount;
4
+ ageCategories: AgeCategoryType[];
5
+ guestLabel: string;
6
+ guestsLabel: string;
7
+ guestsPlaceholder: string;
8
+ };
9
+ type AccType = {
10
+ total: number;
11
+ html: string[];
12
+ };
13
+ export declare const parseGuests: ({ guestLabel, guestsLabel, guestsPlaceholder, ageCategoryCounts, ageCategories, }: Props) => {
14
+ content: string;
15
+ data: AccType;
16
+ };
17
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import '../../themes/Default.css';
3
+ import { FilterCalendarTypes } from './FilterCalendarTypes';
4
+ import './FilterCalendar.css';
5
+ export default function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from '@storybook/react';
2
+ import FilterCalendar from './FilterCalendar';
3
+ declare const meta: Meta<typeof FilterCalendar>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof FilterCalendar>;
6
+ export declare const Default: Story;
7
+ export declare const RangeContext: Story;
8
+ export declare const DisabledRangeContextDates: Story;
@@ -0,0 +1,9 @@
1
+ import { DateRange } from 'react-day-picker';
2
+ import { Palette } from '../../themes/useTheme';
3
+ import { CalendarTypes } from '../../core/components/calendar/CalendarTypes';
4
+ export interface FilterCalendarTypes extends Partial<CalendarTypes> {
5
+ palette: Palette;
6
+ onSubmit: (val: DateRange) => void;
7
+ toggleCalendar: boolean;
8
+ setToggleCalendar: (val: boolean) => void;
9
+ }
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import { DateRange } from 'react-day-picker';
3
+ import { Palette } from '../../../themes/useTheme';
4
+ export declare const Footer: ({ calendarHasError, calendarRange, handleClearDates, language, palette, }: {
5
+ calendarHasError: boolean;
6
+ calendarRange?: DateRange | undefined;
7
+ handleClearDates: () => void;
8
+ language?: string | undefined;
9
+ palette: Palette;
10
+ }) => React.JSX.Element;
@@ -0,0 +1,28 @@
1
+ /// <reference types="react" />
2
+ import { DateRange, Matcher } from 'react-day-picker';
3
+ import { DisableCalendarDates, RangeContext } from 'src/core/components/calendar/CalendarTypes';
4
+ type Props = {
5
+ onSubmit: (val: any) => void;
6
+ setToggleCalendar: (val: boolean) => void;
7
+ noActiveSelection?: boolean;
8
+ toggleCalendar?: boolean;
9
+ outerRangeContext?: RangeContext;
10
+ outerDisableCalendarDates?: DisableCalendarDates;
11
+ };
12
+ export declare const useFilterCalendar: ({ onSubmit, setToggleCalendar, noActiveSelection, toggleCalendar, outerRangeContext, outerDisableCalendarDates, }: Props) => {
13
+ handleSubmit: () => void;
14
+ handleClearDates: () => void;
15
+ setCalendarRange: import("react").Dispatch<import("react").SetStateAction<DateRange | undefined>>;
16
+ setDisabledDates: import("react").Dispatch<import("react").SetStateAction<Matcher[]>>;
17
+ setUpdateCalendarMonthNavigation: import("react").Dispatch<import("react").SetStateAction<boolean>>;
18
+ calendarRange: DateRange | undefined;
19
+ disabledDates: Matcher[];
20
+ updateCalendarMonthNavigation: boolean;
21
+ updateCalendarDefaultMonth: number;
22
+ calendarHasError: boolean;
23
+ setCalendarHasError: import("react").Dispatch<import("react").SetStateAction<boolean>>;
24
+ setUpdatedForSubmit: import("react").Dispatch<import("react").SetStateAction<boolean>>;
25
+ rangeContext: RangeContext | undefined;
26
+ disableCalendarDates: DisableCalendarDates | undefined;
27
+ };
28
+ export {};
@@ -0,0 +1,2 @@
1
+ export { default } from './FilterCalendar';
2
+ export * from './FilterCalendarTypes';
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './CloseButton.css';
3
+ interface CloseButtonPropsType {
4
+ handleClose: () => void;
5
+ }
6
+ export declare const CloseButton: ({ handleClose }: CloseButtonPropsType) => React.JSX.Element;
7
+ export {};
@@ -0,0 +1,13 @@
1
+ import React, { ReactNode } from 'react';
2
+ import './SubmitButton.css';
3
+ type SubmitButtonVariant = 'text' | 'full';
4
+ type Props = {
5
+ onClick?: () => void;
6
+ startIcon?: ReactNode;
7
+ label?: string;
8
+ disabled?: boolean;
9
+ isLoading?: boolean;
10
+ variant?: SubmitButtonVariant;
11
+ };
12
+ export declare const SubmitButton: ({ onClick, startIcon, label, disabled, isLoading, variant, }: Props) => React.JSX.Element;
13
+ export {};
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { CalendarTypes } from './CalendarTypes';
3
+ import 'react-day-picker/dist/style.css';
4
+ import './Calendar.css';
5
+ export declare const Calendar: React.ForwardRefExoticComponent<CalendarTypes & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,46 @@
1
+ import { DateRange, Matcher } from 'react-day-picker';
2
+ import { Palette } from '../../../themes/useTheme';
3
+ export type CalendarOffset = {
4
+ [key: string]: number;
5
+ };
6
+ export type DisableCalendarDates = {
7
+ availableDates?: {
8
+ checkIn: Date;
9
+ firstCheckOut: Date;
10
+ lastCheckOut: Date;
11
+ }[];
12
+ disabledDates?: {
13
+ to: Date;
14
+ from: Date;
15
+ }[];
16
+ disabledDatesByPage?: {
17
+ page: string;
18
+ offset: number;
19
+ }[];
20
+ };
21
+ export type RangeContext = {
22
+ from: Date;
23
+ to: Date;
24
+ };
25
+ export type CalendarTypes = {
26
+ calendarRange?: DateRange | undefined;
27
+ setCalendarRange: (range: DateRange | undefined) => void;
28
+ calendarOffset?: CalendarOffset;
29
+ selectedPath?: string;
30
+ language?: string;
31
+ disableCalendarDates?: DisableCalendarDates;
32
+ requestDates?: (val: Date) => void;
33
+ disabledDates?: Matcher[];
34
+ setDisabledDates?: (arg: Matcher[]) => void;
35
+ loadingData?: boolean;
36
+ showFeedback?: boolean;
37
+ noActiveSelection?: boolean;
38
+ palette?: Palette;
39
+ updateCalendarMonthNavigation?: boolean;
40
+ setUpdateCalendarMonthNavigation?: (arg: (prev: boolean) => boolean) => void;
41
+ updateCalendarDefaultMonth?: number;
42
+ setCalendarHasError?: (arg: boolean) => void;
43
+ setUpdatedForSubmit?: (arg: boolean) => void;
44
+ rangeContext?: RangeContext;
45
+ calendarHasError?: boolean;
46
+ };
@@ -0,0 +1,3 @@
1
+ export { useCalendarTooltips } from './useCalendarTooltips';
2
+ export { useCalendarLoadingSpinner } from './useCalendarLoadingSpinner';
3
+ export { useUpdateDisabledDates } from './useUpdateDisabledDates';
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ loadingData?: boolean;
3
+ };
4
+ export declare const useCalendarLoadingSpinner: ({ loadingData }: Props) => void;
5
+ export {};
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ showFeedback?: boolean;
3
+ };
4
+ export declare const useCalendarTooltips: ({ showFeedback }: Props) => void;
5
+ export {};
@@ -0,0 +1,14 @@
1
+ import { DateRange, Matcher } from 'react-day-picker';
2
+ import { DisableCalendarDates } from '../CalendarTypes';
3
+ type Props = {
4
+ disableCalendarDates?: DisableCalendarDates;
5
+ calendarRange?: DateRange;
6
+ updateCalendarMonthNavigation?: boolean;
7
+ updateCalendarDefaultMonth?: number;
8
+ };
9
+ export declare const useUpdateDisabledDates: ({ disableCalendarDates, calendarRange, updateCalendarMonthNavigation, updateCalendarDefaultMonth, }: Props) => {
10
+ newDisableCalendarDates: DisableCalendarDates | undefined;
11
+ overlappingDate: DateRange[] | undefined;
12
+ lastPossibleCheckout: Matcher;
13
+ };
14
+ export {};
@@ -0,0 +1,15 @@
1
+ import { DateRange, Matcher } from 'react-day-picker';
2
+ import { DisableCalendarDates, RangeContext } from '../CalendarTypes';
3
+ type Props = {
4
+ range: DateRange | undefined;
5
+ newDisableCalendarDates?: DisableCalendarDates;
6
+ setCalendarRange: (range: DateRange | undefined) => void;
7
+ setDisabledDates?: (arg: Matcher[]) => void;
8
+ setCalendarHasError?: (arg: boolean) => void;
9
+ calendarRange?: DateRange;
10
+ overlappingDate?: DateRange[];
11
+ calendarHasError?: boolean;
12
+ rangeContext?: RangeContext;
13
+ };
14
+ export declare const calendarSelectionRules: ({ range, newDisableCalendarDates, setCalendarRange, setDisabledDates, calendarRange, overlappingDate, setCalendarHasError, rangeContext, }: Props) => void;
15
+ export {};
@@ -0,0 +1,11 @@
1
+ import { DateRange } from 'react-day-picker';
2
+ import { DisableCalendarDates, RangeContext } from '../CalendarTypes';
3
+ type Props = {
4
+ setCalendarHasError?: (arg: boolean) => void;
5
+ rangeContext?: RangeContext;
6
+ calendarRange?: DateRange;
7
+ calendarHasError?: boolean;
8
+ disabledDates?: DisableCalendarDates['disabledDates'];
9
+ };
10
+ export declare const checkForContinuousSelection: ({ setCalendarHasError, rangeContext, calendarRange, calendarHasError, disabledDates, }: Props) => void;
11
+ export {};
@@ -0,0 +1,9 @@
1
+ import { DisableCalendarDates } from '../CalendarTypes';
2
+ export declare const disabledDatesByPage: ({ newDisableCalendarDates, selectedPath, today, }: {
3
+ newDisableCalendarDates?: DisableCalendarDates | undefined;
4
+ selectedPath?: string | undefined;
5
+ today: Date;
6
+ }) => {
7
+ from: Date;
8
+ to: Date;
9
+ }[];
@@ -0,0 +1,47 @@
1
+ import { DateRange, Matcher } from 'react-day-picker';
2
+ import { DisableCalendarDates, RangeContext } from '../CalendarTypes';
3
+ type Props = {
4
+ newDisableCalendarDates?: DisableCalendarDates;
5
+ calendarRange?: DateRange;
6
+ disabledDatesByPage: {
7
+ from: Date;
8
+ to: Date;
9
+ }[];
10
+ disabledDates?: Matcher[];
11
+ lastPossibleCheckout?: Matcher;
12
+ overlappingDate?: DateRange[];
13
+ rangeContext?: RangeContext;
14
+ findFirstPossibleRangeContextCheckIn?: NonNullable<DisableCalendarDates['availableDates']>['0'];
15
+ findLastPossibleRangeContextCheckOut?: NonNullable<DisableCalendarDates['availableDates']>['0'];
16
+ firstPossibleRangeContextCheckIn: Matcher[];
17
+ lastPossibleRangeContextCheckOut: Matcher[];
18
+ currentSelectionLastCheckoutDate?: NonNullable<DisableCalendarDates['availableDates']>['0'];
19
+ };
20
+ export declare const handleCalendarModifiers: ({ newDisableCalendarDates, calendarRange, disabledDatesByPage, disabledDates, overlappingDate, rangeContext, firstPossibleRangeContextCheckIn, lastPossibleRangeContextCheckOut, findFirstPossibleRangeContextCheckIn, findLastPossibleRangeContextCheckOut, currentSelectionLastCheckoutDate, lastPossibleCheckout, }: Props) => {
21
+ booked: Matcher[];
22
+ disabledAfterCheckIn: {
23
+ after: Date;
24
+ }[];
25
+ overlappingDate: {
26
+ from: Date | undefined;
27
+ }[];
28
+ noActiveSelectionStart: never[] | Date;
29
+ noActiveSelectionMid: (never[] | {
30
+ after: Date;
31
+ before: Date;
32
+ })[];
33
+ noActiveSelectionEnd: never[] | Date;
34
+ checkoutOptionsMid: {
35
+ after: Date;
36
+ before: Date;
37
+ }[];
38
+ checkInOnly: {
39
+ from: Date;
40
+ to: Date;
41
+ }[];
42
+ checkOutOnly: {
43
+ from: Date;
44
+ to: Date;
45
+ }[];
46
+ };
47
+ export {};
@@ -0,0 +1,27 @@
1
+ import { DateRange, Matcher } from 'react-day-picker';
2
+ import { DisableCalendarDates, RangeContext } from '../CalendarTypes';
3
+ type Props = {
4
+ rangeContext?: RangeContext;
5
+ availableDates?: DisableCalendarDates['availableDates'];
6
+ calendarRange?: DateRange;
7
+ };
8
+ export declare const handleRangeContextDisabledDates: ({ rangeContext, availableDates, calendarRange, }: Props) => {
9
+ findFirstPossibleRangeContextCheckIn: {
10
+ checkIn: Date;
11
+ firstCheckOut: Date;
12
+ lastCheckOut: Date;
13
+ } | undefined;
14
+ findLastPossibleRangeContextCheckOut: {
15
+ checkIn: Date;
16
+ firstCheckOut: Date;
17
+ lastCheckOut: Date;
18
+ } | undefined;
19
+ firstPossibleRangeContextCheckIn: Matcher[];
20
+ lastPossibleRangeContextCheckOut: Matcher[];
21
+ currentSelectionLastCheckoutDate: {
22
+ checkIn: Date;
23
+ firstCheckOut: Date;
24
+ lastCheckOut: Date;
25
+ } | undefined;
26
+ };
27
+ export {};
@@ -0,0 +1,8 @@
1
+ export { parseDates } from './parseDates';
2
+ export { parseDate } from './parseDate';
3
+ export { nightsCount } from './nightsCount';
4
+ export { calendarSelectionRules } from './calendarSelectionRules';
5
+ export { disabledDatesByPage } from './disabledDatesByPage';
6
+ export { handleCalendarModifiers } from './handleCalendarModifiers';
7
+ export { handleRangeContextDisabledDates } from './handleRangeContextDisabledDates';
8
+ export { checkForContinuousSelection } from './checkForContinuousSelection';
@@ -0,0 +1,6 @@
1
+ import { DateRange } from 'react-day-picker';
2
+ type Props = {
3
+ calendarRange?: DateRange;
4
+ };
5
+ export declare const nightsCount: ({ calendarRange }: Props) => number | undefined;
6
+ export {};
@@ -0,0 +1,7 @@
1
+ type Props = {
2
+ date?: Date;
3
+ dateFormat?: string;
4
+ language?: string;
5
+ };
6
+ export declare const parseDate: ({ date, dateFormat, language, }: Props) => string | null;
7
+ export {};
@@ -0,0 +1,6 @@
1
+ import { DateRange } from 'react-day-picker';
2
+ type Props = {
3
+ calendarRange?: DateRange;
4
+ };
5
+ export declare const parseDates: ({ calendarRange }: Props) => string | null;
6
+ export {};
@@ -0,0 +1,3 @@
1
+ export { SubmitButton } from './buttons/submit-button/SubmitButton';
2
+ export { CloseButton } from './buttons/close-button/CloseButton';
3
+ export { Calendar } from './calendar/Calendar';
@@ -0,0 +1,3 @@
1
+ export { useAwaitRender } from './useAwaitRender';
2
+ export { useUpdateTranslations } from './useUpdateTranslations';
3
+ export { useCloseFilterSection } from './useCloseFilterSection';
@@ -0,0 +1 @@
1
+ export declare const useAwaitRender: () => null | undefined;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ handleSelectedFilter: (arg: boolean) => void;
4
+ };
5
+ export declare const useCloseFilterSection: ({ handleSelectedFilter }: Props) => {
6
+ filtersRef: import("react").MutableRefObject<HTMLDivElement | null>;
7
+ };
8
+ export {};
@@ -0,0 +1,5 @@
1
+ type Props = {
2
+ language?: string;
3
+ };
4
+ export declare const useUpdateTranslations: ({ language }: Props) => void;
5
+ export {};
package/lib/i18n.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import i18n from 'i18next';
2
+ export default i18n;