willba-component-library 0.3.10 → 0.3.11
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/lib/components/FilterBar/FilterBar.d.ts +1 -2
- package/lib/components/FilterBar/FilterBarTypes.d.ts +3 -13
- package/lib/components/FilterBar/components/dates/Dates.d.ts +1 -0
- package/lib/components/FilterBar/utils/index.d.ts +1 -1
- package/lib/components/FilterBar/utils/parseLocations.d.ts +1 -2
- package/lib/index.d.ts +8 -16
- package/lib/index.esm.js +176 -103
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +424 -351
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +424 -351
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterBar/FilterBar.css +1 -1
- package/src/components/FilterBar/FilterBar.stories.tsx +14 -49
- package/src/components/FilterBar/FilterBar.tsx +44 -13
- package/src/components/FilterBar/FilterBarTypes.ts +3 -14
- package/src/components/FilterBar/components/cards/image-card/ImageCard.css +0 -1
- package/src/components/FilterBar/components/common/FilterSectionHeader.css +1 -0
- package/src/components/FilterBar/components/dates/Dates.css +3 -0
- package/src/components/FilterBar/components/dates/Dates.tsx +2 -0
- package/src/components/FilterBar/components/guests/Guests.css +1 -1
- package/src/components/FilterBar/components/locations/Locations.css +1 -1
- package/src/components/FilterBar/components/locations/Locations.tsx +15 -35
- package/src/components/FilterBar/utils/calculateDropdownPosition.tsx +106 -0
- package/src/components/FilterBar/utils/index.tsx +1 -1
- package/src/components/FilterBar/utils/parseLocations.tsx +3 -7
- package/src/components/FilterBar/utils/getLocalizedContent.tsx +0 -21
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import '../../themes/Default.css';
|
|
3
2
|
import { FilterBarTypes } from './FilterBarTypes';
|
|
4
3
|
import './FilterBar.css';
|
|
5
|
-
export default function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locations, }: FilterBarTypes):
|
|
4
|
+
export default function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locations, }: FilterBarTypes): import("react").JSX.Element;
|
|
@@ -44,20 +44,11 @@ export declare enum Pages {
|
|
|
44
44
|
EVENTS = "/events",
|
|
45
45
|
SALES = "/sales"
|
|
46
46
|
}
|
|
47
|
-
type Translations = {
|
|
48
|
-
en: string;
|
|
49
|
-
fi: string;
|
|
50
|
-
[key: string]: string;
|
|
51
|
-
};
|
|
52
|
-
export type LocaleTranslation = Array<{
|
|
53
|
-
content: string;
|
|
54
|
-
locale: string;
|
|
55
|
-
}>;
|
|
56
47
|
export type Tab = {
|
|
57
48
|
path: string;
|
|
58
49
|
default?: boolean;
|
|
59
50
|
order: number;
|
|
60
|
-
label?:
|
|
51
|
+
label?: string;
|
|
61
52
|
};
|
|
62
53
|
export type Locations = {
|
|
63
54
|
multiSelect: boolean;
|
|
@@ -66,8 +57,7 @@ export type Locations = {
|
|
|
66
57
|
};
|
|
67
58
|
export type Location = {
|
|
68
59
|
id: number;
|
|
69
|
-
label:
|
|
70
|
-
description?:
|
|
60
|
+
label: string;
|
|
61
|
+
description?: string;
|
|
71
62
|
imageUrl?: string | null;
|
|
72
63
|
};
|
|
73
|
-
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { DateRange } from 'react-day-picker';
|
|
3
3
|
import { DisableCalendarDates } from '../../../../core/components/calendar/CalendarTypes';
|
|
4
|
+
import './Dates.css';
|
|
4
5
|
type Props = {
|
|
5
6
|
ref: React.RefObject<HTMLDivElement>;
|
|
6
7
|
onClose?: () => void;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { Location } from '../FilterBarTypes';
|
|
2
2
|
type Props = {
|
|
3
3
|
selectedLocations: Location[];
|
|
4
|
-
language: string;
|
|
5
4
|
locationsPlaceholder: string;
|
|
6
5
|
locationsSelectedLabel?: string;
|
|
7
6
|
};
|
|
8
|
-
export declare const parseLocations: ({ selectedLocations,
|
|
7
|
+
export declare const parseLocations: ({ selectedLocations, locationsPlaceholder, locationsSelectedLabel, }: Props) => string;
|
|
9
8
|
export {};
|
package/lib/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import React__default from 'react';
|
|
2
3
|
import { DateRange, Matcher } from 'react-day-picker';
|
|
3
4
|
|
|
4
5
|
interface ButtonProps {
|
|
@@ -21,12 +22,12 @@ interface ButtonProps {
|
|
|
21
22
|
/**
|
|
22
23
|
* Optional click handler
|
|
23
24
|
*/
|
|
24
|
-
onClick?: (event:
|
|
25
|
+
onClick?: (event: React__default.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
25
26
|
}
|
|
26
27
|
/**
|
|
27
28
|
* Primary UI component for user interaction
|
|
28
29
|
*/
|
|
29
|
-
declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) =>
|
|
30
|
+
declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => React__default.JSX.Element;
|
|
30
31
|
|
|
31
32
|
type Palette = {
|
|
32
33
|
primary: string;
|
|
@@ -102,20 +103,11 @@ type AgeCategoryType = {
|
|
|
102
103
|
type Filters = {
|
|
103
104
|
[key: string]: string;
|
|
104
105
|
};
|
|
105
|
-
type Translations = {
|
|
106
|
-
en: string;
|
|
107
|
-
fi: string;
|
|
108
|
-
[key: string]: string;
|
|
109
|
-
};
|
|
110
|
-
type LocaleTranslation = Array<{
|
|
111
|
-
content: string;
|
|
112
|
-
locale: string;
|
|
113
|
-
}>;
|
|
114
106
|
type Tab = {
|
|
115
107
|
path: string;
|
|
116
108
|
default?: boolean;
|
|
117
109
|
order: number;
|
|
118
|
-
label?:
|
|
110
|
+
label?: string;
|
|
119
111
|
};
|
|
120
112
|
type Locations = {
|
|
121
113
|
multiSelect: boolean;
|
|
@@ -124,8 +116,8 @@ type Locations = {
|
|
|
124
116
|
};
|
|
125
117
|
type Location = {
|
|
126
118
|
id: number;
|
|
127
|
-
label:
|
|
128
|
-
description?:
|
|
119
|
+
label: string;
|
|
120
|
+
description?: string;
|
|
129
121
|
imageUrl?: string | null;
|
|
130
122
|
};
|
|
131
123
|
|
|
@@ -138,6 +130,6 @@ interface FilterCalendarTypes extends Partial<CalendarTypes> {
|
|
|
138
130
|
setToggleCalendar: (val: boolean) => void;
|
|
139
131
|
}
|
|
140
132
|
|
|
141
|
-
declare function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes):
|
|
133
|
+
declare function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): React__default.JSX.Element;
|
|
142
134
|
|
|
143
135
|
export { Button, FilterBar, FilterBarTypes, FilterCalendar, FilterCalendarTypes };
|