willba-component-library 0.2.77 → 0.2.78

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 (74) hide show
  1. package/package.json +1 -1
  2. package/src/core/components/calendar/Calendar.css +2 -3
  3. package/src/themes/Default.css +1 -0
  4. package/willba-component-library-0.2.77.tgz +0 -0
  5. package/lib/assets/IconsSvg.d.ts +0 -9
  6. package/lib/assets/SpinnerSvg.d.ts +0 -5
  7. package/lib/components/Button/Button.d.ts +0 -29
  8. package/lib/components/Button/Button.stories.d.ts +0 -7
  9. package/lib/components/Button/index.d.ts +0 -1
  10. package/lib/components/FilterBar/FilterBar.d.ts +0 -5
  11. package/lib/components/FilterBar/FilterBar.stories.d.ts +0 -6
  12. package/lib/components/FilterBar/FilterBarTypes.d.ts +0 -56
  13. package/lib/components/FilterBar/components/buttons/close-button/CloseButton.d.ts +0 -7
  14. package/lib/components/FilterBar/components/buttons/index.d.ts +0 -4
  15. package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +0 -10
  16. package/lib/components/FilterBar/components/buttons/submit-button/SubmitButton.d.ts +0 -3
  17. package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +0 -10
  18. package/lib/components/FilterBar/components/calendar/Calendar.d.ts +0 -14
  19. package/lib/components/FilterBar/components/categories/Categories.d.ts +0 -8
  20. package/lib/components/FilterBar/components/divider/Divider.d.ts +0 -3
  21. package/lib/components/FilterBar/components/guests/GuestCount/GuestCount.d.ts +0 -4
  22. package/lib/components/FilterBar/components/guests/Guests.d.ts +0 -10
  23. package/lib/components/FilterBar/components/index.d.ts +0 -4
  24. package/lib/components/FilterBar/hooks/index.d.ts +0 -2
  25. package/lib/components/FilterBar/hooks/useCloseFilterSection.d.ts +0 -8
  26. package/lib/components/FilterBar/hooks/useFilterBar.d.ts +0 -27
  27. package/lib/components/FilterBar/hooks/useScrollInToView.d.ts +0 -9
  28. package/lib/components/FilterBar/hooks/useUpdateTranslations.d.ts +0 -5
  29. package/lib/components/FilterBar/index.d.ts +0 -2
  30. package/lib/components/FilterBar/utils/index.d.ts +0 -1
  31. package/lib/components/FilterBar/utils/parseDates.d.ts +0 -6
  32. package/lib/components/FilterBar/utils/parseGuests.d.ts +0 -17
  33. package/lib/components/FilterCalendar/FilterCalendar.d.ts +0 -5
  34. package/lib/components/FilterCalendar/FilterCalendar.stories.d.ts +0 -8
  35. package/lib/components/FilterCalendar/FilterCalendarTypes.d.ts +0 -9
  36. package/lib/components/FilterCalendar/components/Footer.d.ts +0 -10
  37. package/lib/components/FilterCalendar/hooks/useFilterCalendar.d.ts +0 -28
  38. package/lib/components/FilterCalendar/index.d.ts +0 -2
  39. package/lib/core/components/buttons/close-button/CloseButton.d.ts +0 -7
  40. package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +0 -13
  41. package/lib/core/components/calendar/Calendar.d.ts +0 -5
  42. package/lib/core/components/calendar/CalendarTypes.d.ts +0 -46
  43. package/lib/core/components/calendar/hooks/index.d.ts +0 -3
  44. package/lib/core/components/calendar/hooks/useCalendarLoadingSpinner.d.ts +0 -5
  45. package/lib/core/components/calendar/hooks/useCalendarTooltips.d.ts +0 -5
  46. package/lib/core/components/calendar/hooks/useUpdateDisabledDates.d.ts +0 -14
  47. package/lib/core/components/calendar/utils/calendarSelectionRules.d.ts +0 -15
  48. package/lib/core/components/calendar/utils/checkForContinuousSelection.d.ts +0 -11
  49. package/lib/core/components/calendar/utils/disabledDatesByPage.d.ts +0 -9
  50. package/lib/core/components/calendar/utils/handleCalendarModifiers.d.ts +0 -47
  51. package/lib/core/components/calendar/utils/handleRangeContextDisabledDates.d.ts +0 -27
  52. package/lib/core/components/calendar/utils/index.d.ts +0 -8
  53. package/lib/core/components/calendar/utils/nightsCount.d.ts +0 -6
  54. package/lib/core/components/calendar/utils/parseDate.d.ts +0 -7
  55. package/lib/core/components/calendar/utils/parseDates.d.ts +0 -6
  56. package/lib/core/components/index.d.ts +0 -3
  57. package/lib/core/hooks/index.d.ts +0 -3
  58. package/lib/core/hooks/useAwaitRender.d.ts +0 -1
  59. package/lib/core/hooks/useCloseFilterSection.d.ts +0 -8
  60. package/lib/core/hooks/useUpdateTranslations.d.ts +0 -5
  61. package/lib/core/utils/handleOverlappingDates.d.ts +0 -1
  62. package/lib/core/utils/index.d.ts +0 -3
  63. package/lib/core/utils/nightsCount.d.ts +0 -6
  64. package/lib/core/utils/parseDate.d.ts +0 -7
  65. package/lib/core/utils/parseDates.d.ts +0 -6
  66. package/lib/i18n.d.ts +0 -2
  67. package/lib/index.d.ts +0 -127
  68. package/lib/index.esm.js +0 -12203
  69. package/lib/index.esm.js.map +0 -1
  70. package/lib/index.js +0 -12225
  71. package/lib/index.js.map +0 -1
  72. package/lib/index.umd.js +0 -12229
  73. package/lib/index.umd.js.map +0 -1
  74. package/lib/themes/useTheme.d.ts +0 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.2.77",
3
+ "version": "0.2.78",
4
4
  "description": "A custom UI component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -168,7 +168,6 @@
168
168
  .will-root .will-calendar-filter-container .no-active-selection-mid,
169
169
  .will-root .will-calendar-filter-container .no-active-selection-end {
170
170
  position: initial;
171
-
172
171
  }
173
172
 
174
173
  .will-root .will-calendar-filter-container .no-active-selection-start::before,
@@ -176,9 +175,9 @@
176
175
  .will-root .will-calendar-filter-container .no-active-selection-end::before {
177
176
  content: "";
178
177
  position: absolute;
179
- width: 95%;
178
+ width: 100%;
180
179
  height: 100%;
181
- border: 3px dashed var(--will-grey);
180
+ border: 2px solid var(--will-light-grey);
182
181
  box-sizing: border-box;
183
182
  }
184
183
 
@@ -15,6 +15,7 @@
15
15
  --will-primary: #374269;
16
16
  --will-secondary: #374269;
17
17
  --will-grey: #ABA7AF;
18
+ --will-light-grey: #C8C8C8;
18
19
  --will-white: #fff;
19
20
  --will-white-transparent: #ffffffcf;
20
21
  --will-black: #000;
@@ -1,9 +0,0 @@
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 {};
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- export declare const SpinnerSVG: ({ fill, size, }: {
3
- fill?: string | undefined;
4
- size?: number | undefined;
5
- }) => React.JSX.Element;
@@ -1,29 +0,0 @@
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;
@@ -1,7 +0,0 @@
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;
@@ -1 +0,0 @@
1
- export { default } from "./Button";
@@ -1,5 +0,0 @@
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;
@@ -1,6 +0,0 @@
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;
@@ -1,56 +0,0 @@
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 {};
@@ -1,7 +0,0 @@
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 {};
@@ -1,4 +0,0 @@
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';
@@ -1,10 +0,0 @@
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 {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import './SubmitButton.css';
3
- export declare const SubmitButton: ({ onClick }: any) => React.JSX.Element;
@@ -1,10 +0,0 @@
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 {};
@@ -1,14 +0,0 @@
1
- import React from 'react';
2
- import { DateRange } from 'react-day-picker';
3
- import { CalendarOffset } from '../../FilterBarTypes';
4
- import 'react-day-picker/dist/style.css';
5
- import './Calendar.css';
6
- type Props = {
7
- calendarRange: DateRange | undefined;
8
- setCalendarRange: (range: DateRange | undefined) => void;
9
- calendarOffset?: CalendarOffset;
10
- selectedPath: string;
11
- locale?: string;
12
- };
13
- export declare const Calendar: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
14
- export {};
@@ -1,8 +0,0 @@
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 {};
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- import './Divider.css';
3
- export declare const Divider: () => React.JSX.Element;
@@ -1,4 +0,0 @@
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;
@@ -1,10 +0,0 @@
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 {};
@@ -1,4 +0,0 @@
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';
@@ -1,2 +0,0 @@
1
- export { useFilterBar } from './useFilterBar';
2
- export { useScrollInToView } from './useScrollInToView';
@@ -1,8 +0,0 @@
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 {};
@@ -1,27 +0,0 @@
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 {};
@@ -1,9 +0,0 @@
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 {};
@@ -1,5 +0,0 @@
1
- type Props = {
2
- language?: string;
3
- };
4
- export declare const useUpdateTranslations: ({ language }: Props) => void;
5
- export {};
@@ -1,2 +0,0 @@
1
- export { default } from './FilterBar';
2
- export * from './FilterBarTypes';
@@ -1 +0,0 @@
1
- export { parseGuests } from './parseGuests';
@@ -1,6 +0,0 @@
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 {};
@@ -1,17 +0,0 @@
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 {};
@@ -1,5 +0,0 @@
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;
@@ -1,8 +0,0 @@
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;
@@ -1,9 +0,0 @@
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
- }
@@ -1,10 +0,0 @@
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;
@@ -1,28 +0,0 @@
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 {};
@@ -1,2 +0,0 @@
1
- export { default } from './FilterCalendar';
2
- export * from './FilterCalendarTypes';
@@ -1,7 +0,0 @@
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 {};
@@ -1,13 +0,0 @@
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 {};
@@ -1,5 +0,0 @@
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>>;
@@ -1,46 +0,0 @@
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
- };
@@ -1,3 +0,0 @@
1
- export { useCalendarTooltips } from './useCalendarTooltips';
2
- export { useCalendarLoadingSpinner } from './useCalendarLoadingSpinner';
3
- export { useUpdateDisabledDates } from './useUpdateDisabledDates';
@@ -1,5 +0,0 @@
1
- type Props = {
2
- loadingData?: boolean;
3
- };
4
- export declare const useCalendarLoadingSpinner: ({ loadingData }: Props) => void;
5
- export {};
@@ -1,5 +0,0 @@
1
- type Props = {
2
- showFeedback?: boolean;
3
- };
4
- export declare const useCalendarTooltips: ({ showFeedback }: Props) => void;
5
- export {};
@@ -1,14 +0,0 @@
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 {};
@@ -1,15 +0,0 @@
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 {};
@@ -1,11 +0,0 @@
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 {};
@@ -1,9 +0,0 @@
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
- }[];
@@ -1,47 +0,0 @@
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 {};