willba-component-library 0.3.9 → 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.
Files changed (29) hide show
  1. package/README.md +1 -1
  2. package/lib/components/FilterBar/FilterBar.d.ts +1 -2
  3. package/lib/components/FilterBar/FilterBarTypes.d.ts +3 -13
  4. package/lib/components/FilterBar/components/dates/Dates.d.ts +1 -0
  5. package/lib/components/FilterBar/utils/index.d.ts +1 -1
  6. package/lib/components/FilterBar/utils/parseLocations.d.ts +1 -2
  7. package/lib/index.d.ts +8 -16
  8. package/lib/index.esm.js +176 -103
  9. package/lib/index.esm.js.map +1 -1
  10. package/lib/index.js +424 -351
  11. package/lib/index.js.map +1 -1
  12. package/lib/index.umd.js +424 -351
  13. package/lib/index.umd.js.map +1 -1
  14. package/package.json +1 -1
  15. package/src/components/FilterBar/FilterBar.css +1 -1
  16. package/src/components/FilterBar/FilterBar.stories.tsx +14 -49
  17. package/src/components/FilterBar/FilterBar.tsx +44 -13
  18. package/src/components/FilterBar/FilterBarTypes.ts +3 -14
  19. package/src/components/FilterBar/components/cards/image-card/ImageCard.css +0 -1
  20. package/src/components/FilterBar/components/common/FilterSectionHeader.css +1 -0
  21. package/src/components/FilterBar/components/dates/Dates.css +3 -0
  22. package/src/components/FilterBar/components/dates/Dates.tsx +2 -0
  23. package/src/components/FilterBar/components/guests/Guests.css +1 -1
  24. package/src/components/FilterBar/components/locations/Locations.css +1 -1
  25. package/src/components/FilterBar/components/locations/Locations.tsx +15 -35
  26. package/src/components/FilterBar/utils/calculateDropdownPosition.tsx +106 -0
  27. package/src/components/FilterBar/utils/index.tsx +1 -1
  28. package/src/components/FilterBar/utils/parseLocations.tsx +3 -7
  29. package/src/components/FilterBar/utils/getLocalizedContent.tsx +0 -21
package/README.md CHANGED
@@ -119,7 +119,7 @@ ReactDOM.render(<App />, document.querySelector('#app'))
119
119
 
120
120
  <script src="https://unpkg.com/react@18.3.1/umd/react.production.min.js"></script>
121
121
  <script src="https://unpkg.com/react-dom@18.3.1/umd/react-dom.production.min.js"></script>
122
- <script src="https://cdn.jsdelivr.net/npm/willba-component-library@0.3.7/lib/index.umd.js"></script>
122
+ <script src="https://cdn.jsdelivr.net/npm/willba-component-library@0.3.10/lib/index.umd.js"></script>
123
123
 
124
124
  <script>
125
125
  const renderFilterBar = async () => {
@@ -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): React.JSX.Element;
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?: Translations;
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: LocaleTranslation;
70
- description?: LocaleTranslation | null;
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,3 +1,3 @@
1
1
  export { parseGuests } from './parseGuests';
2
2
  export { parseLocations } from './parseLocations';
3
- export { getLocalizedContent } from './getLocalizedContent';
3
+ export { calculateDropdownPosition } from './calculateDropdownPosition';
@@ -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, language, locationsPlaceholder, locationsSelectedLabel, }: Props) => string;
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: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
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) => React.JSX.Element;
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?: Translations;
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: LocaleTranslation;
128
- description?: LocaleTranslation | null;
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): React.JSX.Element;
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 };