willba-component-library 0.2.101 → 0.2.102

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "willba-component-library",
3
- "version": "0.2.101",
3
+ "version": "0.2.102",
4
4
  "description": "A custom UI component library",
5
5
  "main": "lib/index.js",
6
6
  "module": "lib/index.esm.js",
@@ -26,7 +26,7 @@
26
26
  z-index: 222;
27
27
  background: transparent;
28
28
  padding: 10px;
29
- gap: 10px
29
+ gap: 10px;
30
30
  }
31
31
 
32
32
  /* Header */
@@ -38,11 +38,8 @@
38
38
  z-index: 222;
39
39
  border-radius: 40px;
40
40
  background-color: var(--will-white);
41
-
42
41
  }
43
42
 
44
-
45
-
46
43
  @media (max-width: 960px) {
47
44
  .will-filter-bar-header {
48
45
  flex-direction: column;
@@ -56,7 +53,7 @@
56
53
  .will-filter-bar-container {
57
54
  background-color: var(--will-white);
58
55
  min-height: 100px;
59
- padding: 40px 20px ;
56
+ padding: 40px 20px;
60
57
  position: absolute;
61
58
  top: 125px;
62
59
  z-index: 111;
@@ -65,16 +62,16 @@
65
62
  }
66
63
 
67
64
  @media (max-width: 960px) {
68
- .will-root {
65
+ .will-root {
69
66
  width: 100%;
70
67
  min-width: auto;
71
- max-height: 100vh;
68
+ max-height: 100vh;
72
69
  z-index: 3;
73
70
  }
74
71
 
75
72
  .will-filter-bar-container {
76
73
  margin-top: 10px;
77
- top:0;
74
+ top: 0;
78
75
  padding: 45px 20px;
79
76
  position: relative;
80
77
  }
@@ -84,11 +81,15 @@
84
81
 
85
82
  .will-filter-bar-header.dark,
86
83
  .will-filter-bar-container.dark {
87
- box-shadow: var(--will-box-shadow-dark)
84
+ box-shadow: var(--will-box-shadow-dark);
88
85
  }
89
86
 
90
87
  .will-filter-bar-header.light,
91
88
  .will-filter-bar-container.light {
92
- box-shadow: var(--will-box-shadow-light)
89
+ box-shadow: var(--will-box-shadow-light);
93
90
  }
94
91
 
92
+ .will-guest-count {
93
+ display: inline-block;
94
+ min-width: 10px;
95
+ }
@@ -32,22 +32,22 @@ export const Main: Story = {
32
32
  redirectUrl: '',
33
33
  ageCategories: [
34
34
  {
35
- id: '2',
35
+ id: '1',
36
36
  name: 'Alle 6 vuotiaat',
37
37
  minVal: 0,
38
- sortOrder: 3,
38
+ sortOrder: 1,
39
39
  },
40
40
  {
41
- id: '3',
41
+ id: '2',
42
42
  name: '6-16 vuotiaat',
43
43
  minVal: 0,
44
44
  sortOrder: 2,
45
45
  },
46
46
  {
47
- id: '1',
47
+ id: '3',
48
48
  name: 'Aikuiset',
49
49
  minVal: 1,
50
- sortOrder: 1,
50
+ sortOrder: 3,
51
51
  },
52
52
  ],
53
53
  palette: {
@@ -22,7 +22,10 @@ export const parseGuests = ({
22
22
  }: Props) => {
23
23
  const parsedData = Object.entries(ageCategoryCounts).reduce(
24
24
  (acc: AccType, [key, value]) => {
25
- const ageCategoryId = key[key.length - 1]
25
+ const parts = key.split('-')
26
+ if (parts.length < 2) return acc
27
+
28
+ const ageCategoryId = parts[1]
26
29
  const ageCategory = ageCategories.find((c) => c.id === ageCategoryId)
27
30
 
28
31
  if (ageCategory && value) {
@@ -42,11 +45,9 @@ export const parseGuests = ({
42
45
 
43
46
  return {
44
47
  content: parsedData.total
45
- ? `<span style="display: inline-block; min-width: 10px">${
46
- parsedData.total
47
- }</span> ${parsedData.total > 1 ? guestsLabel : guestLabel}${
48
- htmlString ? ` &nbsp; ( ${htmlString} )` : ''
49
- }`
48
+ ? `<span class="will-guest-count">${parsedData.total}</span> ${
49
+ parsedData.total > 1 ? guestsLabel : guestLabel
50
+ }${htmlString ? ` &nbsp; ( ${htmlString} )` : ''}`
50
51
  : guestsPlaceholder,
51
52
  data: parsedData,
52
53
  }