willba-component-library 0.1.82 → 0.2.0

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/README.md CHANGED
@@ -27,11 +27,14 @@ ReactDOM.render(<App />, document.querySelector('#app'))
27
27
  or you can add the willba-component-library using scripts:
28
28
 
29
29
  ```html
30
- <div id="will-filter-bar" style="max-width: 1200px"></div>
30
+ <div
31
+ id="will-filter-bar"
32
+ style="max-width: 1200px; display: flex; justify-content: center;"
33
+ ></div>
31
34
 
32
- <script src="https://unpkg.com/react@18/umd/react.development.js"></script>
33
- <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
34
- <script src="https://cdn.jsdelivr.net/npm/willba-component-library@0/lib/index.umd.js"></script>
35
+ <script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
36
+ <script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
37
+ <script src="https://cdn.jsdelivr.net/npm/willba-component-library@0.1.83/lib/index.umd.js"></script>
35
38
 
36
39
  <script>
37
40
  const filterBarElement = React.createElement
@@ -41,7 +44,45 @@ or you can add the willba-component-library using scripts:
41
44
 
42
45
  root.render(
43
46
  filterBarElement(WillFilterBar, {
44
- redirectUrl: 'http://localhost:4000/',
47
+ redirectUrl: 'https://www.google.com',
48
+ language: 'en',
49
+ calendarOffset: {
50
+ rooms: 7,
51
+ events: -1,
52
+ },
53
+ mode: 'dark',
54
+ ageCategories: [
55
+ {
56
+ id: '2',
57
+ name: 'Alle 6 vuotiaat',
58
+ minVal: 0,
59
+ sortOrder: 3,
60
+ },
61
+ {
62
+ id: '3',
63
+ name: '6-16 vuotiaat',
64
+ minVal: 0,
65
+ sortOrder: 2,
66
+ },
67
+ {
68
+ id: '1',
69
+ name: 'Aikuiset',
70
+ minVal: 1,
71
+ sortOrder: 1,
72
+ },
73
+ ],
74
+ tabs: [
75
+ {
76
+ path: '/rooms',
77
+ default: true,
78
+ order: 2,
79
+ },
80
+ {
81
+ path: '/events',
82
+ default: false,
83
+ order: 1,
84
+ },
85
+ ],
45
86
  })
46
87
  )
47
88
  </script>
@@ -49,9 +90,15 @@ or you can add the willba-component-library using scripts:
49
90
 
50
91
  ## Props of FilterBar
51
92
 
52
- | Name | Value | Description |
53
- | ------------- | ------------- | ------------------------------------------------------------------------------------------------------------------------- |
54
- | redirectUrl | `"string"` | Define the URL where the component showld redirect on filtering. |
55
- | language | `"fi" , "en"` | Specify the language, available languages Finnish and English. |
56
- | ageCategories | `[{}]` | Specify age categories for guests: filter: [{id: string, name: string, minAge: number , maxAge: number , minVal: number}] |
57
- | palette | `{}` | Override color: palette: {primary: string, secondary: string}. |
93
+ | Name | Value | Description |
94
+ | -------------- | ------------- | ---------------------------------------------------------------------------------------------------------------- |
95
+ | redirectUrl | `"string"` | Define the URL where the component should redirect on filtering. |
96
+ | language | `"fi" , "en"` | Specify the language, available languages Finnish and English. |
97
+ | ageCategories | `[{}]` | Specify age categories for guests: [{id: string, name: string, , minVal: number, sortOrder: number}] |
98
+ | palette | `{}` | Override color: palette: {primary: string, secondary: string}. |
99
+ | calendarOffset | `{}` | Calendar disabled date starting from today: {rooms: number, events: number}. |
100
+ | fullWidth | `true` | Filter bar width, dynamic or fixed. |
101
+ | |
102
+ | mode | `"light"` | Filter bar tabs color: light or dark |
103
+ | |
104
+ | tabs | `[{}]` | Filter bar tabs management: [{path: string, default: boolean, order: number, label: { en: string, fi: string}}]. |
package/lib/index.d.ts CHANGED
@@ -70,4 +70,4 @@ type FilterBarProps = {
70
70
  };
71
71
  declare function FilterBar({ language, ageCategories, redirectUrl, palette, onSubmit, fullWidth, calendarOffset, mode, tabs, }: FilterBarProps): React.JSX.Element | null;
72
72
 
73
- export { Button, FilterBar };
73
+ export { Button, FilterBar, Tab };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.1.82",
3
+ "version": "0.2.0",
4
4
  "description": "A stroybook 6 with TypeScript demo",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -47,7 +47,6 @@ export const Primary: Story = {
47
47
  secondary: '',
48
48
  },
49
49
  mode: 'dark',
50
- defaultTab: '/rooms',
51
50
  tabs: [
52
51
  {
53
52
  path: '/rooms',
package/src/index.ts CHANGED
@@ -2,3 +2,4 @@ import Button from './components/Button'
2
2
  import FilterBar from './components/FilterBar'
3
3
 
4
4
  export { Button, FilterBar }
5
+ export type { Tab } from './components/FilterBar/FilterBarTypes'