willba-component-library 0.3.12 → 0.3.14

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 (51) hide show
  1. package/README.md +6 -18
  2. package/lib/assets/IconsSvg.d.ts +2 -1
  3. package/lib/components/Button/Button.d.ts +2 -2
  4. package/lib/components/FilterBar/FilterBar.d.ts +2 -1
  5. package/lib/components/FilterBar/components/buttons/select-button/SelectButton.d.ts +2 -1
  6. package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +2 -1
  7. package/lib/components/FilterBar/components/cards/image-card/ImageCard.d.ts +2 -1
  8. package/lib/components/FilterBar/components/categories/Categories.d.ts +2 -1
  9. package/lib/components/FilterBar/components/common/FilterSectionHeader.d.ts +2 -2
  10. package/lib/components/FilterBar/components/dates/Dates.d.ts +2 -2
  11. package/lib/components/FilterBar/components/divider/Divider.d.ts +2 -1
  12. package/lib/components/FilterBar/components/guests/Guests.d.ts +2 -1
  13. package/lib/components/FilterBar/components/locations/Locations.d.ts +2 -1
  14. package/lib/components/FilterCalendar/FilterCalendar.d.ts +2 -1
  15. package/lib/components/FilterCalendar/components/Footer.d.ts +2 -1
  16. package/lib/core/components/buttons/close-button/CloseButton.d.ts +2 -1
  17. package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +2 -1
  18. package/lib/core/components/calendar/Calendar.d.ts +2 -1
  19. package/lib/index.d.ts +4 -5
  20. package/lib/index.esm.js +289 -213
  21. package/lib/index.esm.js.map +1 -1
  22. package/lib/index.js +376 -300
  23. package/lib/index.js.map +1 -1
  24. package/lib/index.umd.js +379 -302
  25. package/lib/index.umd.js.map +1 -1
  26. package/package.json +1 -1
  27. package/rollup.config.mjs +1 -1
  28. package/src/assets/IconsSvg.tsx +2 -0
  29. package/src/components/Button/Button.stories.tsx +1 -0
  30. package/src/components/Button/Button.tsx +1 -1
  31. package/src/components/FilterBar/FilterBar.stories.tsx +1 -0
  32. package/src/components/FilterBar/FilterBar.tsx +1 -1
  33. package/src/components/FilterBar/components/buttons/select-button/SelectButton.tsx +1 -1
  34. package/src/components/FilterBar/components/buttons/tab-button/TabButton.tsx +2 -0
  35. package/src/components/FilterBar/components/cards/image-card/ImageCard.tsx +1 -1
  36. package/src/components/FilterBar/components/categories/Categories.tsx +1 -2
  37. package/src/components/FilterBar/components/common/FilterSectionHeader.tsx +1 -1
  38. package/src/components/FilterBar/components/dates/Dates.tsx +1 -1
  39. package/src/components/FilterBar/components/divider/Divider.tsx +2 -0
  40. package/src/components/FilterBar/components/guests/GuestCount/GuestCount.tsx +1 -1
  41. package/src/components/FilterBar/components/guests/Guests.tsx +1 -1
  42. package/src/components/FilterBar/components/locations/Locations.tsx +1 -1
  43. package/src/components/FilterBar/utils/calculateDropdownPosition.tsx +0 -10
  44. package/src/components/FilterCalendar/FilterCalendar.tsx +1 -0
  45. package/src/components/FilterCalendar/components/Footer.tsx +1 -0
  46. package/src/core/components/buttons/close-button/CloseButton.tsx +1 -0
  47. package/src/core/components/buttons/submit-button/SubmitButton.tsx +1 -0
  48. package/src/core/components/calendar/Calendar.tsx +1 -1
  49. package/stories/Button.tsx +2 -0
  50. package/stories/Header.tsx +1 -0
  51. package/stories/Page.tsx +1 -1
package/README.md CHANGED
@@ -66,19 +66,13 @@ function App() {
66
66
  ]}
67
67
  tabs={[
68
68
  {
69
- label: {
70
- en: 'Rooms',
71
- fi: 'Hilat',
72
- },
69
+ label: 'Rooms',
73
70
  path: '/rooms',
74
71
  default: true,
75
72
  order: 2,
76
73
  },
77
74
  {
78
- label: {
79
- en: 'Events',
80
- fi: 'Tapahtumat',
81
- },
75
+ label: 'Events',
82
76
  path: '/events',
83
77
  default: false,
84
78
  order: 1,
@@ -90,14 +84,8 @@ function App() {
90
84
  data: [
91
85
  {
92
86
  id: 1,
93
- label: [
94
- { content: 'Helsinki', locale: 'en' },
95
- { content: 'Helsinki', locale: 'fi' },
96
- ],
97
- description: [
98
- { content: 'Capital of Finland', locale: 'en' },
99
- { content: 'Suomen pääkaupunki', locale: 'fi' },
100
- ],
87
+ label: 'Helsinki',
88
+ description: 'Capital of Finland',
101
89
  imageUrl: 'https://example.com/helsinki.jpg',
102
90
  },
103
91
  ],
@@ -182,5 +170,5 @@ ReactDOM.render(<App />, document.querySelector('#app'))
182
170
  | mode | `"string"` | Specify the color theme for the filter bar tabs as either light or dark using the following format: `'dark'` or `'light'` |
183
171
  | ageCategories | `[{}]` | The ageCategories prop will determine the types of guests that can be selected. Specify the age categories for guests using the following format: `[{ id: string, name: string, minVal: number, sortOrder: number }]`. For example: `[{ id: '1', name: 'Aikuiset', minVal: 1, sortOrder: 1 }]` |
184
172
  | fullWidth | `true` | Specify whether the filter bar width should be dynamic or fixed. |
185
- | tabs | `[{}]` | Manage the filter bar tabs using the following format: `[{path: string, default: boolean, order: number, label: { en: string, fi: string }}]`. For example: `[{ path: '/rooms', default: true, order: 2, label: { en: 'Rooms', fi: 'Hilat' }}]` |
186
- | locations | `{}` | Configures location filter. Format: `{ multiSelect: boolean, disabled?: boolean, data: Location[] }` where Location = `{ id: number, label: LocaleTranslation, description?: LocaleTranslation, imageUrl?: string }` and LocaleTranslation = `Array<{ content: string, locale: string }>`. `multiSelect` enables multi-selection, `disabled` disables the filter, `description` shows under title, `imageUrl` displays location image. Example: `{ multiSelect: false, disabled: false, data: [{ id: 1, label: [{ content: 'Helsinki', locale: 'en' }, { content: 'Helsinki', locale: 'fi' }], description: [{ content: 'Capital', locale: 'en' }, { content: 'Pääkaupunki', locale: 'fi' }], imageUrl: 'https://example.com/helsinki.jpg' }] }` |
173
+ | tabs | `[{}]` | Manage the filter bar tabs using the following format: `[{path: string, default: boolean, order: number, label?: string}]`. The label should be pre-localized. For example: `[{ path: '/rooms', default: true, order: 2, label: 'Rooms' }]` |
174
+ | locations | `{}` | Configures location filter. Format: `{ multiSelect: boolean, disabled?: boolean, data: Location[] }` where Location = `{ id: number, label: string, description?: string \| null, imageUrl?: string \| null }`. The label and description should be pre-localized. `multiSelect` enables multi-selection, `disabled` disables the filter, `description` shows under title, `imageUrl` displays location image. Example: `{ multiSelect: false, disabled: false, data: [{ id: 1, label: 'Helsinki', description: 'Capital of Finland', imageUrl: 'https://example.com/helsinki.jpg' }] }` |
@@ -1,8 +1,9 @@
1
+ import React from 'react';
1
2
  type Icon = 'spinner' | 'warning';
2
3
  type Props = {
3
4
  fill?: string;
4
5
  size?: number;
5
6
  icon: Icon;
6
7
  };
7
- export declare const IconsSvg: ({ fill, size, icon }: Props) => import("react/jsx-runtime").JSX.Element | null;
8
+ export declare const IconsSvg: ({ fill, size, icon }: Props) => React.JSX.Element | null;
8
9
  export {};
@@ -1,4 +1,4 @@
1
- import { MouseEvent } from 'react';
1
+ import React, { MouseEvent } from 'react';
2
2
  import './button.css';
3
3
  export interface ButtonProps {
4
4
  /**
@@ -25,5 +25,5 @@ export interface ButtonProps {
25
25
  /**
26
26
  * Primary UI component for user interaction
27
27
  */
28
- declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => import("react/jsx-runtime").JSX.Element;
28
+ declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => React.JSX.Element;
29
29
  export default Button;
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  import '../../themes/Default.css';
2
3
  import { FilterBarTypes } from './FilterBarTypes';
3
4
  import './FilterBar.css';
4
- export default function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locations, }: FilterBarTypes): import("react/jsx-runtime").JSX.Element;
5
+ export default function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locations, }: FilterBarTypes): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import './SelectButton.css';
2
3
  type Props = {
3
4
  label: string;
@@ -8,5 +9,5 @@ type Props = {
8
9
  ariaExpanded?: boolean;
9
10
  ariaControls?: string;
10
11
  };
11
- export declare const SelectButton: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLButtonElement>>;
12
+ export declare const SelectButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
12
13
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import './TabButton.css';
2
3
  type Props = {
3
4
  onClick?: () => void;
@@ -5,5 +6,5 @@ type Props = {
5
6
  active?: boolean;
6
7
  mode?: string;
7
8
  };
8
- export declare const TabButton: ({ onClick, label, active, mode }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export declare const TabButton: ({ onClick, label, active, mode }: Props) => React.JSX.Element;
9
10
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import './ImageCard.css';
2
3
  type Props = {
3
4
  title?: string;
@@ -6,5 +7,5 @@ type Props = {
6
7
  isSelected: boolean;
7
8
  onClick?: () => void;
8
9
  };
9
- export declare const ImageCard: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
10
+ export declare const ImageCard: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
10
11
  export {};
@@ -1,7 +1,8 @@
1
+ import React from 'react';
1
2
  import './Categories.css';
2
3
  type Props = {
3
4
  categories: any;
4
5
  setCategories: any;
5
6
  };
6
- export declare const Categories: ({ categories, setCategories }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const Categories: ({ categories, setCategories }: Props) => React.JSX.Element;
7
8
  export {};
@@ -1,8 +1,8 @@
1
- import { ReactNode } from 'react';
1
+ import React, { ReactNode } from 'react';
2
2
  import './FilterSectionHeader.css';
3
3
  type Props = {
4
4
  title: string;
5
5
  action?: ReactNode;
6
6
  };
7
- export declare const FilterSectionHeader: ({ title, action }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export declare const FilterSectionHeader: ({ title, action }: Props) => React.JSX.Element;
8
8
  export {};
@@ -1,4 +1,4 @@
1
- import { RefObject } from 'react';
1
+ import React, { RefObject } from 'react';
2
2
  import { DateRange } from 'react-day-picker';
3
3
  import { DisableCalendarDates } from '../../../../core/components/calendar/CalendarTypes';
4
4
  import './Dates.css';
@@ -13,5 +13,5 @@ type Props = {
13
13
  language?: string;
14
14
  filtersRef?: RefObject<HTMLDivElement>;
15
15
  };
16
- export declare const Dates: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
16
+ export declare const Dates: React.ForwardRefExoticComponent<Omit<Props, "ref"> & React.RefAttributes<HTMLDivElement>>;
17
17
  export {};
@@ -1,2 +1,3 @@
1
+ import React from 'react';
1
2
  import './Divider.css';
2
- export declare const Divider: () => import("react/jsx-runtime").JSX.Element;
3
+ export declare const Divider: () => React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { AgeCategoryCount, AgeCategoryType } from '../../FilterBarTypes';
2
3
  import './Guests.css';
3
4
  type Props = {
@@ -7,5 +8,5 @@ type Props = {
7
8
  autoFocus?: boolean;
8
9
  onClose?: () => void;
9
10
  };
10
- export declare const Guests: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
11
+ export declare const Guests: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
11
12
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import './Locations.css';
2
3
  import { Location } from '../../FilterBarTypes';
3
4
  type Props = {
@@ -9,5 +10,5 @@ type Props = {
9
10
  multiSelect?: boolean;
10
11
  onClose?: () => void;
11
12
  };
12
- export declare const Locations: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
13
+ export declare const Locations: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
13
14
  export {};
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  import '../../themes/Default.css';
2
3
  import { FilterCalendarTypes } from './FilterCalendarTypes';
3
4
  import './FilterCalendar.css';
4
- export default function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): import("react/jsx-runtime").JSX.Element;
5
+ export default function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): React.JSX.Element;
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { DateRange } from 'react-day-picker';
2
3
  import { Palette } from '../../../themes/useTheme';
3
4
  export declare const Footer: ({ calendarHasError, calendarRange, handleClearDates, language, palette, }: {
@@ -6,4 +7,4 @@ export declare const Footer: ({ calendarHasError, calendarRange, handleClearDate
6
7
  handleClearDates: () => void;
7
8
  language?: string;
8
9
  palette: Palette;
9
- }) => import("react/jsx-runtime").JSX.Element;
10
+ }) => React.JSX.Element;
@@ -1,6 +1,7 @@
1
+ import React from 'react';
1
2
  import './CloseButton.css';
2
3
  interface CloseButtonPropsType {
3
4
  handleClose: () => void;
4
5
  }
5
- export declare const CloseButton: ({ handleClose }: CloseButtonPropsType) => import("react/jsx-runtime").JSX.Element;
6
+ export declare const CloseButton: ({ handleClose }: CloseButtonPropsType) => React.JSX.Element;
6
7
  export {};
@@ -1,3 +1,4 @@
1
+ import React from 'react';
1
2
  import { ReactNode } from 'react';
2
3
  import './SubmitButton.css';
3
4
  type SubmitButtonVariant = 'text' | 'full';
@@ -9,5 +10,5 @@ type Props = {
9
10
  isLoading?: boolean;
10
11
  variant?: SubmitButtonVariant;
11
12
  };
12
- export declare const SubmitButton: ({ onClick, startIcon, label, disabled, isLoading, variant, }: Props) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const SubmitButton: ({ onClick, startIcon, label, disabled, isLoading, variant, }: Props) => React.JSX.Element;
13
14
  export {};
@@ -1,4 +1,5 @@
1
+ import React from 'react';
1
2
  import { CalendarTypes } from './CalendarTypes';
2
3
  import 'react-day-picker/dist/style.css';
3
4
  import './Calendar.css';
4
- export declare const Calendar: import("react").ForwardRefExoticComponent<CalendarTypes & import("react").RefAttributes<HTMLDivElement>>;
5
+ export declare const Calendar: React.ForwardRefExoticComponent<CalendarTypes & React.RefAttributes<HTMLDivElement>>;
package/lib/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { MouseEvent } from 'react';
1
+ import React, { MouseEvent } from 'react';
3
2
  import { DateRange, Matcher } from 'react-day-picker';
4
3
 
5
4
  interface ButtonProps {
@@ -27,7 +26,7 @@ interface ButtonProps {
27
26
  /**
28
27
  * Primary UI component for user interaction
29
28
  */
30
- declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => react_jsx_runtime.JSX.Element;
29
+ declare const Button: ({ type, textColor, size, onClick, label, }: ButtonProps) => React.JSX.Element;
31
30
 
32
31
  type Palette = {
33
32
  primary: string;
@@ -121,7 +120,7 @@ type Location = {
121
120
  imageUrl?: string | null;
122
121
  };
123
122
 
124
- declare function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locations, }: FilterBarTypes): react_jsx_runtime.JSX.Element;
123
+ declare function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, disableCalendarDates, mode, tabs, outerLoading, locations, }: FilterBarTypes): React.JSX.Element;
125
124
 
126
125
  interface FilterCalendarTypes extends Partial<CalendarTypes> {
127
126
  palette: Palette;
@@ -130,6 +129,6 @@ interface FilterCalendarTypes extends Partial<CalendarTypes> {
130
129
  setToggleCalendar: (val: boolean) => void;
131
130
  }
132
131
 
133
- declare function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): react_jsx_runtime.JSX.Element;
132
+ declare function FilterCalendar({ calendarOffset, language, palette, onSubmit, disableCalendarDates: outerDisableCalendarDates, toggleCalendar, loadingData, setToggleCalendar, requestDates, showFeedback, noActiveSelection, rangeContext: outerRangeContext, }: FilterCalendarTypes): React.JSX.Element;
134
133
 
135
134
  export { Button, FilterBar, FilterBarTypes, FilterCalendar, FilterCalendarTypes };