willba-component-library 0.3.0 → 0.3.2
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/assets/IconsSvg.d.ts +1 -2
- package/lib/components/Button/Button.d.ts +1 -1
- package/lib/components/FilterBar/FilterBar.d.ts +1 -2
- package/lib/components/FilterBar/FilterBarTypes.d.ts +1 -1
- package/lib/components/FilterBar/components/buttons/tab-button/TabButton.d.ts +1 -2
- package/lib/components/FilterBar/components/categories/Categories.d.ts +1 -2
- package/lib/components/FilterBar/components/divider/Divider.d.ts +1 -2
- package/lib/components/FilterCalendar/FilterCalendar.d.ts +1 -2
- package/lib/components/FilterCalendar/components/Footer.d.ts +1 -2
- package/lib/core/components/buttons/close-button/CloseButton.d.ts +1 -2
- package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +2 -2
- package/lib/index.d.ts +5 -4
- package/lib/index.esm.js +1914 -1975
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +1914 -1975
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +1917 -1978
- package/lib/index.umd.js.map +1 -1
- package/package.json +2 -2
- package/src/components/FilterBar/FilterBar.stories.tsx +7 -7
- package/src/components/FilterBar/FilterBarTypes.ts +1 -1
- package/src/components/FilterBar/components/buttons/select-button/SelectButton.css +5 -9
- package/src/components/FilterBar/hooks/useFilterBar.tsx +13 -7
- package/tsconfig.json +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "willba-component-library",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "A custom UI component library",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/index.esm.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"react-dom": "^18.2.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@rollup/plugin-commonjs": "^
|
|
28
|
+
"@rollup/plugin-commonjs": "^29.0.0",
|
|
29
29
|
"@rollup/plugin-json": "^6.1.0",
|
|
30
30
|
"@rollup/plugin-node-resolve": "^15.3.1",
|
|
31
31
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
@@ -27,7 +27,7 @@ export const Main: Story = {
|
|
|
27
27
|
},
|
|
28
28
|
],
|
|
29
29
|
},
|
|
30
|
-
fullWidth:
|
|
30
|
+
fullWidth: false,
|
|
31
31
|
language: 'en',
|
|
32
32
|
redirectUrl: 'http://localhost:4000/',
|
|
33
33
|
ageCategories: [
|
|
@@ -81,9 +81,9 @@ export const Main: Story = {
|
|
|
81
81
|
multiSelect: false,
|
|
82
82
|
data: [
|
|
83
83
|
{
|
|
84
|
-
id:
|
|
84
|
+
id: 1,
|
|
85
85
|
label: {
|
|
86
|
-
en: 'Location 1',
|
|
86
|
+
en: 'Location 1 Location 1 Location 1 Location 1 Location 1 Location 1 Location 1 Location 1 Location 1 Location 1 Location 1 Location 1 Location 1',
|
|
87
87
|
fi: 'Location 1 fi',
|
|
88
88
|
},
|
|
89
89
|
description: {
|
|
@@ -94,14 +94,14 @@ export const Main: Story = {
|
|
|
94
94
|
'//i0.wp.com/picjumbo.com/wp-content/uploads/beautiful-fall-nature-scenery-free-image.jpeg?w=2210&quality=70',
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
|
-
id:
|
|
97
|
+
id: 2,
|
|
98
98
|
label: {
|
|
99
99
|
en: 'Location 2',
|
|
100
100
|
fi: 'Location 2 fi',
|
|
101
101
|
},
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
|
-
id:
|
|
104
|
+
id: 3,
|
|
105
105
|
label: {
|
|
106
106
|
en: 'Location 3',
|
|
107
107
|
fi: 'Location 3 fi',
|
|
@@ -114,7 +114,7 @@ export const Main: Story = {
|
|
|
114
114
|
'//i0.wp.com/picjumbo.com/wp-content/uploads/beautiful-fall-nature-scenery-free-image.jpeg?w=2210&quality=70',
|
|
115
115
|
},
|
|
116
116
|
{
|
|
117
|
-
id:
|
|
117
|
+
id: 4,
|
|
118
118
|
label: {
|
|
119
119
|
en: 'Location 4',
|
|
120
120
|
fi: 'Location 4 fi',
|
|
@@ -123,7 +123,7 @@ export const Main: Story = {
|
|
|
123
123
|
'//i0.wp.com/picjumbo.com/wp-content/uploads/beautiful-fall-nature-scenery-free-image.jpeg?w=2210&quality=70',
|
|
124
124
|
},
|
|
125
125
|
{
|
|
126
|
-
id:
|
|
126
|
+
id: 5,
|
|
127
127
|
label: {
|
|
128
128
|
en: 'Location 5',
|
|
129
129
|
fi: 'Location 5 fi',
|
|
@@ -28,22 +28,18 @@
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
.will-filter-bar-select-button .select-button-description {
|
|
31
|
-
|
|
32
31
|
color: var(--will-black);
|
|
33
32
|
font-weight: 400;
|
|
34
33
|
opacity: 0.5;
|
|
35
34
|
white-space: nowrap;
|
|
36
35
|
min-height: 19px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.will-filter-bar-select-button .select-button-description span {
|
|
40
|
-
font: inherit
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.will-root.is-full-width .will-filter-bar-select-button .select-button-description {
|
|
44
36
|
overflow: hidden;
|
|
45
37
|
text-overflow: ellipsis;
|
|
46
|
-
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.will-filter-bar-select-button .select-button-description span {
|
|
41
|
+
font: inherit
|
|
42
|
+
}
|
|
47
43
|
|
|
48
44
|
.will-filter-bar-select-button .select-button-label.active,
|
|
49
45
|
.will-filter-bar-select-button .select-button-description.active {
|
|
@@ -68,7 +68,7 @@ export const useFilterBar = ({
|
|
|
68
68
|
// Set selected locations from URL - handle all locationIds
|
|
69
69
|
if (locations?.data?.length && locationIdParams.length) {
|
|
70
70
|
const matchedLocations = locations.data.filter((location) =>
|
|
71
|
-
locationIdParams.includes(location.id)
|
|
71
|
+
locationIdParams.includes(location.id.toString())
|
|
72
72
|
)
|
|
73
73
|
setSelectedLocations(matchedLocations)
|
|
74
74
|
}
|
|
@@ -118,21 +118,27 @@ export const useFilterBar = ({
|
|
|
118
118
|
ageCategoryCounts,
|
|
119
119
|
ageCategories,
|
|
120
120
|
}),
|
|
121
|
+
|
|
122
|
+
selectedLocations: selectedLocations
|
|
123
|
+
.map((location) => location.id.toString())
|
|
124
|
+
.join(','),
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
const querySearchParams = new URLSearchParams()
|
|
124
128
|
|
|
125
129
|
for (const [key, value] of Object.entries(newParams)) {
|
|
126
130
|
if (value) {
|
|
127
|
-
|
|
131
|
+
if (key === 'selectedLocations' && !!selectedLocations.length) {
|
|
132
|
+
// Append all selected locationIds
|
|
133
|
+
selectedLocations.forEach((location) => {
|
|
134
|
+
querySearchParams.append('locationId', location.id.toString())
|
|
135
|
+
})
|
|
136
|
+
} else {
|
|
137
|
+
querySearchParams.append(key, value.toString())
|
|
138
|
+
}
|
|
128
139
|
}
|
|
129
140
|
}
|
|
130
141
|
|
|
131
|
-
// Append all selected locationIds
|
|
132
|
-
selectedLocations.forEach((location) => {
|
|
133
|
-
querySearchParams.append('locationId', location.id)
|
|
134
|
-
})
|
|
135
|
-
|
|
136
142
|
handleSelectedFilter(false)
|
|
137
143
|
|
|
138
144
|
if (onSubmit && window.location.href.includes(selectedPath)) {
|
package/tsconfig.json
CHANGED
|
@@ -13,11 +13,11 @@
|
|
|
13
13
|
"strict": true,
|
|
14
14
|
"forceConsistentCasingInFileNames": true,
|
|
15
15
|
"module": "esnext",
|
|
16
|
-
"moduleResolution": "
|
|
16
|
+
"moduleResolution": "bundler",
|
|
17
17
|
"resolveJsonModule": true,
|
|
18
18
|
"isolatedModules": true,
|
|
19
19
|
"noEmit": true,
|
|
20
|
-
"jsx": "react",
|
|
20
|
+
"jsx": "react-jsx",
|
|
21
21
|
|
|
22
22
|
"baseUrl": "./",
|
|
23
23
|
"paths": {
|