willba-component-library 0.2.76 → 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
@@ -1,27 +0,0 @@
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 {};
@@ -1,8 +0,0 @@
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';
@@ -1,6 +0,0 @@
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 {};
@@ -1,7 +0,0 @@
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 {};
@@ -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,3 +0,0 @@
1
- export { SubmitButton } from './buttons/submit-button/SubmitButton';
2
- export { CloseButton } from './buttons/close-button/CloseButton';
3
- export { Calendar } from './calendar/Calendar';
@@ -1,3 +0,0 @@
1
- export { useAwaitRender } from './useAwaitRender';
2
- export { useUpdateTranslations } from './useUpdateTranslations';
3
- export { useCloseFilterSection } from './useCloseFilterSection';
@@ -1 +0,0 @@
1
- export declare const useAwaitRender: () => null | undefined;
@@ -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,5 +0,0 @@
1
- type Props = {
2
- language?: string;
3
- };
4
- export declare const useUpdateTranslations: ({ language }: Props) => void;
5
- export {};
@@ -1 +0,0 @@
1
- export declare const handleOverlappingDates: () => void;
@@ -1,3 +0,0 @@
1
- export { parseDates } from './parseDates';
2
- export { parseDate } from './parseDate';
3
- export { nightsCount } from './nightsCount';
@@ -1,6 +0,0 @@
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 {};
@@ -1,7 +0,0 @@
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 {};
@@ -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 {};
package/lib/i18n.d.ts DELETED
@@ -1,2 +0,0 @@
1
- import i18n from 'i18next';
2
- export default i18n;
package/lib/index.d.ts DELETED
@@ -1,127 +0,0 @@
1
- import React from 'react';
2
- import { DateRange, Matcher } from 'react-day-picker';
3
-
4
- interface ButtonProps {
5
- /**
6
- * Is this the principal call to action on the page?
7
- */
8
- type?: "primary" | "secondary";
9
- /**
10
- * What background color to use
11
- */
12
- textColor?: string;
13
- /**
14
- * How large should the button be?
15
- */
16
- size?: "small" | "medium" | "large";
17
- /**
18
- * Button contents
19
- */
20
- label: string;
21
- /**
22
- * Optional click handler
23
- */
24
- onClick?: (event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
25
- }
26
- /**
27
- * Primary UI component for user interaction
28
- */
29
- declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => React.JSX.Element;
30
-
31
- type Palette = {
32
- primary: string;
33
- secondary: string;
34
- error: string;
35
- };
36
-
37
- type CalendarOffset = {
38
- [key: string]: number;
39
- };
40
- type DisableCalendarDates = {
41
- availableDates?: {
42
- checkIn: Date;
43
- firstCheckOut: Date;
44
- lastCheckOut: Date;
45
- }[];
46
- disabledDates?: {
47
- to: Date;
48
- from: Date;
49
- }[];
50
- disabledDatesByPage?: {
51
- page: string;
52
- offset: number;
53
- }[];
54
- };
55
- type RangeContext = {
56
- from: Date;
57
- to: Date;
58
- };
59
- type CalendarTypes = {
60
- calendarRange?: DateRange | undefined;
61
- setCalendarRange: (range: DateRange | undefined) => void;
62
- calendarOffset?: CalendarOffset;
63
- selectedPath?: string;
64
- language?: string;
65
- disableCalendarDates?: DisableCalendarDates;
66
- requestDates?: (val: Date) => void;
67
- disabledDates?: Matcher[];
68
- setDisabledDates?: (arg: Matcher[]) => void;
69
- loadingData?: boolean;
70
- showFeedback?: boolean;
71
- noActiveSelection?: boolean;
72
- palette?: Palette;
73
- updateCalendarMonthNavigation?: boolean;
74
- setUpdateCalendarMonthNavigation?: (arg: (prev: boolean) => boolean) => void;
75
- updateCalendarDefaultMonth?: number;
76
- setCalendarHasError?: (arg: boolean) => void;
77
- setUpdatedForSubmit?: (arg: boolean) => void;
78
- rangeContext?: RangeContext;
79
- calendarHasError?: boolean;
80
- };
81
-
82
- type FilterBarProps = {
83
- language?: string;
84
- ageCategories?: AgeCategoryType[];
85
- redirectUrl?: string;
86
- palette?: Palette;
87
- onSubmit?: ((val: Filters) => void) | null;
88
- fullWidth?: boolean;
89
- disableCalendarDates?: DisableCalendarDates;
90
- mode?: string;
91
- defaultTab?: string;
92
- tabs?: Tab[];
93
- outerLoading?: boolean;
94
- };
95
- type AgeCategoryType = {
96
- id: string;
97
- name: string;
98
- minVal: number;
99
- sortOrder: number;
100
- };
101
- type Filters = {
102
- [key: string]: string;
103
- };
104
- type Translations = {
105
- en: string;
106
- fi: string;
107
- [key: string]: string;
108
- };
109
- type Tab = {
110
- path: string;
111
- default?: boolean;
112
- order: number;
113
- label?: Translations;
114
- };
115
-
116
- declare function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, }: FilterBarProps): React.JSX.Element;
117
-
118
- interface FilterCalendarTypes extends Partial<CalendarTypes> {
119
- palette: Palette;
120
- onSubmit: (val: DateRange) => void;
121
- toggleCalendar: boolean;
122
- setToggleCalendar: (val: boolean) => void;
123
- }
124
-
125
- declare function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): React.JSX.Element;
126
-
127
- export { Button, FilterBar, FilterCalendar, FilterCalendarTypes, Tab };