@citygross/components 0.12.0 → 0.12.3

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 (67) hide show
  1. package/build/@types/components/CartSummary/CartSummary.d.ts +2 -5
  2. package/build/@types/components/CartSummary/CartSummary.styles.d.ts +2 -5
  3. package/build/@types/components/CgButton/CgButton.d.ts +1 -4
  4. package/build/@types/components/CgButton/CgButton.styles.d.ts +0 -1
  5. package/build/@types/components/CgButton/CgButton.types.d.ts +3 -5
  6. package/build/@types/components/ListItem/ListItem.d.ts +0 -9
  7. package/build/@types/components/ListItem/ListItem.styles.d.ts +0 -1
  8. package/build/@types/components/Pagination/Pagination.d.ts +6 -5
  9. package/build/@types/components/Pagination/Pagination.styles.d.ts +7 -5
  10. package/build/@types/components/ProductHeader/ProductHeader.d.ts +1 -1
  11. package/build/cjs/components/src/components/AddressBlock/AddressBlock.js +2 -2
  12. package/build/cjs/components/src/components/CartCard/assets/fallback_grocery.svg.js +1 -1
  13. package/build/cjs/components/src/components/CartItemSummary/CartItemSummary.js +1 -1
  14. package/build/cjs/components/src/components/CartSummary/CartSummary.js +34 -43
  15. package/build/cjs/components/src/components/CartSummary/CartSummary.js.map +1 -1
  16. package/build/cjs/components/src/components/CartSummary/CartSummary.styles.js +9 -15
  17. package/build/cjs/components/src/components/CartSummary/CartSummary.styles.js.map +1 -1
  18. package/build/cjs/components/src/components/CgButton/CgButton.js +3 -4
  19. package/build/cjs/components/src/components/CgButton/CgButton.js.map +1 -1
  20. package/build/cjs/components/src/components/CgButton/CgButton.styles.js +6 -44
  21. package/build/cjs/components/src/components/CgButton/CgButton.styles.js.map +1 -1
  22. package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.styles.js +4 -6
  23. package/build/cjs/components/src/components/FormElements/Checkbox/Checkbox.styles.js.map +1 -1
  24. package/build/cjs/components/src/components/ListItem/ListItem.js +4 -11
  25. package/build/cjs/components/src/components/ListItem/ListItem.js.map +1 -1
  26. package/build/cjs/components/src/components/ListItem/ListItem.styles.js +1 -3
  27. package/build/cjs/components/src/components/ListItem/ListItem.styles.js.map +1 -1
  28. package/build/cjs/components/src/components/ListItem/assets/fallback_grocery.svg.js +1 -1
  29. package/build/cjs/components/src/components/Pagination/Pagination.js +40 -38
  30. package/build/cjs/components/src/components/Pagination/Pagination.js.map +1 -1
  31. package/build/cjs/components/src/components/Pagination/Pagination.styles.js +6 -6
  32. package/build/cjs/components/src/components/ProductHeader/ProductHeader.js +5 -4
  33. package/build/cjs/components/src/components/ProductHeader/ProductHeader.js.map +1 -1
  34. package/build/cjs/components/src/components/WarningLabel/WarningLabel.js +2 -2
  35. package/build/cjs/design-tokens/build/index.js +268 -267
  36. package/build/cjs/design-tokens/build/index.js.map +1 -1
  37. package/build/cjs/utils/build/index.js +476 -476
  38. package/build/cjs/utils/build/index.js.map +1 -1
  39. package/build/es/components/src/components/AddressBlock/AddressBlock.js +2 -2
  40. package/build/es/components/src/components/CartCard/assets/fallback_grocery.svg.js +1 -1
  41. package/build/es/components/src/components/CartItemSummary/CartItemSummary.js +1 -1
  42. package/build/es/components/src/components/CartSummary/CartSummary.js +37 -46
  43. package/build/es/components/src/components/CartSummary/CartSummary.js.map +1 -1
  44. package/build/es/components/src/components/CartSummary/CartSummary.styles.js +8 -11
  45. package/build/es/components/src/components/CartSummary/CartSummary.styles.js.map +1 -1
  46. package/build/es/components/src/components/CgButton/CgButton.js +4 -5
  47. package/build/es/components/src/components/CgButton/CgButton.js.map +1 -1
  48. package/build/es/components/src/components/CgButton/CgButton.styles.js +7 -44
  49. package/build/es/components/src/components/CgButton/CgButton.styles.js.map +1 -1
  50. package/build/es/components/src/components/FormElements/Checkbox/Checkbox.styles.js +5 -7
  51. package/build/es/components/src/components/FormElements/Checkbox/Checkbox.styles.js.map +1 -1
  52. package/build/es/components/src/components/ListItem/ListItem.js +6 -13
  53. package/build/es/components/src/components/ListItem/ListItem.js.map +1 -1
  54. package/build/es/components/src/components/ListItem/ListItem.styles.js +2 -3
  55. package/build/es/components/src/components/ListItem/ListItem.styles.js.map +1 -1
  56. package/build/es/components/src/components/ListItem/assets/fallback_grocery.svg.js +1 -1
  57. package/build/es/components/src/components/Pagination/Pagination.js +42 -40
  58. package/build/es/components/src/components/Pagination/Pagination.js.map +1 -1
  59. package/build/es/components/src/components/Pagination/Pagination.styles.js +4 -4
  60. package/build/es/components/src/components/ProductHeader/ProductHeader.js +5 -4
  61. package/build/es/components/src/components/ProductHeader/ProductHeader.js.map +1 -1
  62. package/build/es/components/src/components/WarningLabel/WarningLabel.js +2 -2
  63. package/build/es/design-tokens/build/index.js +268 -267
  64. package/build/es/design-tokens/build/index.js.map +1 -1
  65. package/build/es/utils/build/index.js +476 -476
  66. package/build/es/utils/build/index.js.map +1 -1
  67. package/package.json +2 -2
@@ -18,486 +18,486 @@ function _interopDefaultLegacy$1 (e) { return e && typeof e === 'object' && 'def
18
18
 
19
19
  var React__default = /*#__PURE__*/_interopDefaultLegacy$1(React);
20
20
 
21
- var formatPrice = function (price, withParenthesis) {
22
- if (price === null || price === undefined) {
23
- return;
24
- }
25
- var formattedPrice = price === 0
26
- ? 0
27
- : (Math.round(price * 100) / 100)
28
- .toFixed(2)
29
- .replace('.', ',')
30
- .replace(',00', '');
31
- return "".concat(withParenthesis ? "(".concat(formattedPrice, " kr)") : "".concat(formattedPrice, " kr"));
21
+ var formatPrice = function (price, withParenthesis) {
22
+ if (price === null || price === undefined) {
23
+ return;
24
+ }
25
+ var formattedPrice = price === 0
26
+ ? 0
27
+ : (Math.round(price * 100) / 100)
28
+ .toFixed(2)
29
+ .replace('.', ',')
30
+ .replace(',00', '');
31
+ return "".concat(withParenthesis ? "(".concat(formattedPrice, " kr)") : "".concat(formattedPrice, " kr"));
32
32
  };
33
33
 
34
- var formatPriceWithDecimalsReduced = function (price) {
35
- if ((price !== 0 && !price) || isNaN(price)) {
36
- return null;
37
- }
38
- var priceArr = price && price.toString().split('.');
39
- var decimalCount = priceArr && priceArr[1] ? priceArr[1].length : 0;
40
- //Remove decimals
41
- var priceInteger = Math.trunc(price);
42
- // Avoid rounding errors, since JS can't do math
43
- var priceDecimals = (price - priceInteger).toFixed(2).toString();
44
- var decimalsArr = priceDecimals.split('.');
45
- priceDecimals = decimalsArr.length > 1 ? decimalsArr[1] : priceDecimals;
46
- // Pad with leading 0 if single number
47
- var priceDecimalsReduced = priceDecimals.length < 2 ? '0' + priceDecimals : priceDecimals;
48
- return {
49
- value: priceInteger,
50
- decimal: priceDecimalsReduced,
51
- decimalCount: decimalCount
52
- };
34
+ var formatPriceWithDecimalsReduced = function (price) {
35
+ if ((price !== 0 && !price) || isNaN(price)) {
36
+ return null;
37
+ }
38
+ var priceArr = price && price.toString().split('.');
39
+ var decimalCount = priceArr && priceArr[1] ? priceArr[1].length : 0;
40
+ //Remove decimals
41
+ var priceInteger = Math.trunc(price);
42
+ // Avoid rounding errors, since JS can't do math
43
+ var priceDecimals = (price - priceInteger).toFixed(2).toString();
44
+ var decimalsArr = priceDecimals.split('.');
45
+ priceDecimals = decimalsArr.length > 1 ? decimalsArr[1] : priceDecimals;
46
+ // Pad with leading 0 if single number
47
+ var priceDecimalsReduced = priceDecimals.length < 2 ? '0' + priceDecimals : priceDecimals;
48
+ return {
49
+ value: priceInteger,
50
+ decimal: priceDecimalsReduced,
51
+ decimalCount: decimalCount
52
+ };
53
53
  };
54
54
 
55
- var formatPriceWithNoZero = function (price) {
56
- if ((price !== 0 && !price) || isNaN(price)) {
57
- return null;
58
- }
59
- var formattedPrice = formatPriceWithDecimalsReduced(price);
60
- return "".concat(formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.value).concat("".concat((formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.decimal) !== '00' ? ",".concat(formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.decimal) : ''));
55
+ var formatPriceWithNoZero = function (price) {
56
+ if ((price !== 0 && !price) || isNaN(price)) {
57
+ return null;
58
+ }
59
+ var formattedPrice = formatPriceWithDecimalsReduced(price);
60
+ return "".concat(formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.value).concat("".concat((formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.decimal) !== '00' ? ",".concat(formattedPrice === null || formattedPrice === void 0 ? void 0 : formattedPrice.decimal) : ''));
61
61
  };
62
62
 
63
- var capitalizeFirstLetter = function (string) {
64
- if (string.length > 1) {
65
- return string.charAt(0).toUpperCase() + string.slice(1);
66
- }
67
- if (string[0]) {
68
- return string.toUpperCase();
69
- }
70
- };
71
- var capitalizedAllWords = function (string) {
72
- return string.replace(/(^\w|\s\w)/g, function (match) { return match.toUpperCase(); });
63
+ var capitalizeFirstLetter = function (string) {
64
+ if (string.length > 1) {
65
+ return string.charAt(0).toUpperCase() + string.slice(1);
66
+ }
67
+ if (string[0]) {
68
+ return string.toUpperCase();
69
+ }
70
+ };
71
+ var capitalizedAllWords = function (string) {
72
+ return string.replace(/(^\w|\s\w)/g, function (match) { return match.toUpperCase(); });
73
73
  };
74
74
 
75
- var languageCodeToCountryMap = {
76
- AD: 'Andorra',
77
- AE: 'Förenade Arabemiraten',
78
- AF: 'Afghanistan',
79
- AG: 'Antigua och Barbuda',
80
- AI: 'Anguilla',
81
- AL: 'Albanien',
82
- AM: 'Armenien',
83
- AO: 'Angola',
84
- AQ: 'Antarktis',
85
- AR: 'Argentina',
86
- AS: 'Amerikanska Samoa',
87
- AT: 'Österrike',
88
- AU: 'Australien',
89
- AW: 'Aruba',
90
- AX: 'Åland',
91
- AZ: 'Azerbajdzjan',
92
- BA: 'Bosnien och Hercegovina',
93
- BB: 'Barbados',
94
- BD: 'Bangladesh',
95
- BE: 'Belgien',
96
- BF: 'Burkina Faso',
97
- BG: 'Bulgarien',
98
- BH: 'Bahrain',
99
- BI: 'Burundi',
100
- BJ: 'Benin',
101
- BL: 'Saint-Barthélemy',
102
- BM: 'Bermuda',
103
- BN: 'Brunei',
104
- BO: 'Bolivia',
105
- BQ: 'Bonaire, Sint Eustatius and Saba',
106
- BR: 'Brasilien',
107
- BS: 'Bahamas',
108
- BT: 'Bhutan',
109
- BV: 'Bouvetön',
110
- BW: 'Botswana',
111
- BY: 'Belarus',
112
- BZ: 'Belize',
113
- CA: 'Kanada',
114
- CC: 'Kokosöarna',
115
- CD: 'Kongo-Kinshasa',
116
- CF: 'Centralafrikanska republiken',
117
- CG: 'Kongo-Brazzaville',
118
- CH: 'Schweiz',
119
- CI: 'Elfenbenskusten',
120
- CK: 'Cooköarna',
121
- CL: 'Chile',
122
- CM: 'Kamerun',
123
- CN: 'Kina',
124
- CO: 'Colombia',
125
- CR: 'Costa Rica',
126
- CU: 'Kuba',
127
- CV: 'Kap Verde',
128
- CW: 'Curaçao',
129
- CX: 'Julön',
130
- CY: 'Cypern',
131
- CZ: 'Tjeckien',
132
- DE: 'Tyskland',
133
- DJ: 'Djibouti',
134
- DK: 'Danmark',
135
- DM: 'Dominica',
136
- DO: 'Dominikanska republiken',
137
- DZ: 'Algeriet',
138
- EC: 'Ecuador',
139
- EE: 'Estland',
140
- EG: 'Egypten',
141
- EH: 'Västsahara',
142
- ER: 'Eritrea',
143
- ES: 'Spanien',
144
- ET: 'Etiopien',
145
- FI: 'Finland',
146
- FJ: 'Fiji',
147
- FK: 'Falklandsöarna',
148
- FM: 'Mikronesiska federationen',
149
- FO: 'Färöarna',
150
- FR: 'Frankrike',
151
- GA: 'Gabon',
152
- GB: 'Storbritannien',
153
- GD: 'Grenada',
154
- GE: 'Georgien',
155
- GF: 'Franska Guyana',
156
- GG: 'Guernsey',
157
- GH: 'Ghana',
158
- GI: 'Gibraltar',
159
- GL: 'Grönland',
160
- GM: 'Gambia',
161
- GN: 'Guinea',
162
- GP: 'Guadeloupe',
163
- GQ: 'Ekvatorialguinea',
164
- GR: 'Grekland',
165
- GS: 'Sydgeorgien',
166
- GT: 'Guatemala',
167
- GU: 'Guam',
168
- GW: 'Guinea-Bissau',
169
- GY: 'Guyana',
170
- HK: 'Hongkong',
171
- HM: 'Heard- och McDonaldöarna',
172
- HN: 'Honduras',
173
- HR: 'Kroatien',
174
- HT: 'Haiti',
175
- HU: 'Ungern',
176
- ID: 'Indonesien',
177
- IE: 'Irland',
178
- IL: 'Israel',
179
- IM: 'Isle of Man',
180
- IN: 'Indien',
181
- IO: 'Brittiska territoriet i Indiska Oceanen',
182
- IQ: 'Irak',
183
- IR: 'Iran',
184
- IS: 'Island',
185
- IT: 'Italien',
186
- JE: 'Jersey',
187
- JM: 'Jamaica',
188
- JO: 'Jordanien',
189
- JP: 'Japan',
190
- KE: 'Kenya',
191
- KG: 'Kirgizistan',
192
- KH: 'Kambodja',
193
- KI: 'Kiribati',
194
- KM: 'Komorerna',
195
- KN: 'Saint Kitts och Nevis',
196
- KP: 'Nordkorea',
197
- KR: 'Sydkorea',
198
- KW: 'Kuwait',
199
- KY: 'Caymanöarna',
200
- KZ: 'Kazakstan',
201
- LA: 'Laos',
202
- LB: 'Libanon',
203
- LC: 'Saint Lucia',
204
- LI: 'Liechtenstein',
205
- LK: 'Sri Lanka',
206
- LR: 'Liberia',
207
- LS: 'Lesotho',
208
- LT: 'Litauen',
209
- LU: 'Luxemburg',
210
- LV: 'Lettland',
211
- LY: 'Libyen',
212
- MA: 'Marocko',
213
- MC: 'Monaco',
214
- MD: 'Moldavien',
215
- ME: 'Montenegro',
216
- MF: 'Saint-Martin',
217
- MG: 'Madagaskar',
218
- MH: 'Marshallöarna',
219
- MK: 'Nordmakedonien',
220
- ML: 'Mali',
221
- MM: 'Myanmar',
222
- MN: 'Mongoliet',
223
- MO: 'Macao',
224
- MP: 'Nordmarianerna',
225
- MQ: 'Martinique',
226
- MR: 'Mauretanien',
227
- MS: 'Montserrat',
228
- MT: 'Malta',
229
- MU: 'Mauritius',
230
- MV: 'Maldiverna',
231
- MW: 'Malawi',
232
- MX: 'Mexiko',
233
- MY: 'Malaysia',
234
- MZ: 'Moçambique',
235
- NA: 'Namibia',
236
- NC: 'Nya Kaledonien',
237
- NE: 'Niger',
238
- NF: 'Norfolkön',
239
- NG: 'Nigeria',
240
- NI: 'Nicaragua',
241
- NL: 'Nederländerna',
242
- NO: 'Norge',
243
- NP: 'Nepal',
244
- NR: 'Nauru',
245
- NU: 'Niue',
246
- NZ: 'Nya Zeeland',
247
- OM: 'Oman',
248
- PA: 'Panama',
249
- PE: 'Peru',
250
- PF: 'Franska Polynesien',
251
- PG: 'Papua Nya Guinea',
252
- PH: 'Filippinerna',
253
- PK: 'Pakistan',
254
- PL: 'Polen',
255
- PM: 'Saint-Pierre och Miquelon',
256
- PN: 'Pitcairnöarna',
257
- PR: 'Puerto Rico',
258
- PS: 'Palestina',
259
- PT: 'Portugal',
260
- PW: 'Palau',
261
- PY: 'Paraguay',
262
- QA: 'Qatar',
263
- RE: 'Réunion',
264
- RO: 'Rumänien',
265
- RS: 'Serbien',
266
- RU: 'Ryssland',
267
- RW: 'Rwanda',
268
- SA: 'Saudiarabien',
269
- SB: 'Salomonöarna',
270
- SC: 'Seychellerna',
271
- SD: 'Sudan',
272
- SE: 'Sverige',
273
- SG: 'Singapore',
274
- SH: 'Sankta Helena',
275
- SI: 'Slovenien',
276
- SJ: 'Svalbard och Jan Mayen',
277
- SK: 'Slovakien',
278
- SL: 'Sierra Leone',
279
- SM: 'San Marino',
280
- SN: 'Senegal',
281
- SO: 'Somalia',
282
- SR: 'Surinam',
283
- SS: 'Sydsudan',
284
- ST: 'São Tomé och Príncipe',
285
- SV: 'El Salvador',
286
- SX: 'Sint Maarten',
287
- SY: 'Syrien',
288
- SZ: 'Swaziland',
289
- TC: 'Turks- och Caicosöarna',
290
- TD: 'Tchad',
291
- TF: 'Franska södra territorierna',
292
- TG: 'Togo',
293
- TH: 'Thailand',
294
- TJ: 'Tadzjikistan',
295
- TK: 'Tokelauöarna',
296
- TL: 'Östtimor',
297
- TM: 'Turkmenistan',
298
- TN: 'Tunisien',
299
- TO: 'Tonga',
300
- TR: 'Turkiet',
301
- TT: 'Trinidad och Tobago',
302
- TV: 'Tuvalu',
303
- TW: 'Taiwan',
304
- TZ: 'Tanzania',
305
- UA: 'Ukraina',
306
- UG: 'Uganda',
307
- UM: 'Förenta staternas mindre öar i Oceanien och Västindien',
308
- US: 'USA',
309
- UY: 'Uruguay',
310
- UZ: 'Uzbekistan',
311
- VA: 'Vatikanstaten',
312
- VC: 'Saint Vincent och Grenadinerna',
313
- VE: 'Venezuela',
314
- VG: 'Brittiska Jungfruöarna',
315
- VI: 'Amerikanska Jungfruöarna',
316
- VN: 'Vietnam',
317
- VU: 'Vanuatu',
318
- WF: 'Wallis- och Futunaöarna',
319
- WS: 'Samoa',
320
- YE: 'Jemen',
321
- YT: 'Mayotte',
322
- ZA: 'Sydafrika',
323
- ZM: 'Zambia',
324
- ZW: 'Zimbabwe'
325
- };
326
- var getCountryFromLanguageCode = function (languageCode) {
327
- return languageCodeToCountryMap[languageCode] || '';
75
+ var languageCodeToCountryMap = {
76
+ AD: 'Andorra',
77
+ AE: 'Förenade Arabemiraten',
78
+ AF: 'Afghanistan',
79
+ AG: 'Antigua och Barbuda',
80
+ AI: 'Anguilla',
81
+ AL: 'Albanien',
82
+ AM: 'Armenien',
83
+ AO: 'Angola',
84
+ AQ: 'Antarktis',
85
+ AR: 'Argentina',
86
+ AS: 'Amerikanska Samoa',
87
+ AT: 'Österrike',
88
+ AU: 'Australien',
89
+ AW: 'Aruba',
90
+ AX: 'Åland',
91
+ AZ: 'Azerbajdzjan',
92
+ BA: 'Bosnien och Hercegovina',
93
+ BB: 'Barbados',
94
+ BD: 'Bangladesh',
95
+ BE: 'Belgien',
96
+ BF: 'Burkina Faso',
97
+ BG: 'Bulgarien',
98
+ BH: 'Bahrain',
99
+ BI: 'Burundi',
100
+ BJ: 'Benin',
101
+ BL: 'Saint-Barthélemy',
102
+ BM: 'Bermuda',
103
+ BN: 'Brunei',
104
+ BO: 'Bolivia',
105
+ BQ: 'Bonaire, Sint Eustatius and Saba',
106
+ BR: 'Brasilien',
107
+ BS: 'Bahamas',
108
+ BT: 'Bhutan',
109
+ BV: 'Bouvetön',
110
+ BW: 'Botswana',
111
+ BY: 'Belarus',
112
+ BZ: 'Belize',
113
+ CA: 'Kanada',
114
+ CC: 'Kokosöarna',
115
+ CD: 'Kongo-Kinshasa',
116
+ CF: 'Centralafrikanska republiken',
117
+ CG: 'Kongo-Brazzaville',
118
+ CH: 'Schweiz',
119
+ CI: 'Elfenbenskusten',
120
+ CK: 'Cooköarna',
121
+ CL: 'Chile',
122
+ CM: 'Kamerun',
123
+ CN: 'Kina',
124
+ CO: 'Colombia',
125
+ CR: 'Costa Rica',
126
+ CU: 'Kuba',
127
+ CV: 'Kap Verde',
128
+ CW: 'Curaçao',
129
+ CX: 'Julön',
130
+ CY: 'Cypern',
131
+ CZ: 'Tjeckien',
132
+ DE: 'Tyskland',
133
+ DJ: 'Djibouti',
134
+ DK: 'Danmark',
135
+ DM: 'Dominica',
136
+ DO: 'Dominikanska republiken',
137
+ DZ: 'Algeriet',
138
+ EC: 'Ecuador',
139
+ EE: 'Estland',
140
+ EG: 'Egypten',
141
+ EH: 'Västsahara',
142
+ ER: 'Eritrea',
143
+ ES: 'Spanien',
144
+ ET: 'Etiopien',
145
+ FI: 'Finland',
146
+ FJ: 'Fiji',
147
+ FK: 'Falklandsöarna',
148
+ FM: 'Mikronesiska federationen',
149
+ FO: 'Färöarna',
150
+ FR: 'Frankrike',
151
+ GA: 'Gabon',
152
+ GB: 'Storbritannien',
153
+ GD: 'Grenada',
154
+ GE: 'Georgien',
155
+ GF: 'Franska Guyana',
156
+ GG: 'Guernsey',
157
+ GH: 'Ghana',
158
+ GI: 'Gibraltar',
159
+ GL: 'Grönland',
160
+ GM: 'Gambia',
161
+ GN: 'Guinea',
162
+ GP: 'Guadeloupe',
163
+ GQ: 'Ekvatorialguinea',
164
+ GR: 'Grekland',
165
+ GS: 'Sydgeorgien',
166
+ GT: 'Guatemala',
167
+ GU: 'Guam',
168
+ GW: 'Guinea-Bissau',
169
+ GY: 'Guyana',
170
+ HK: 'Hongkong',
171
+ HM: 'Heard- och McDonaldöarna',
172
+ HN: 'Honduras',
173
+ HR: 'Kroatien',
174
+ HT: 'Haiti',
175
+ HU: 'Ungern',
176
+ ID: 'Indonesien',
177
+ IE: 'Irland',
178
+ IL: 'Israel',
179
+ IM: 'Isle of Man',
180
+ IN: 'Indien',
181
+ IO: 'Brittiska territoriet i Indiska Oceanen',
182
+ IQ: 'Irak',
183
+ IR: 'Iran',
184
+ IS: 'Island',
185
+ IT: 'Italien',
186
+ JE: 'Jersey',
187
+ JM: 'Jamaica',
188
+ JO: 'Jordanien',
189
+ JP: 'Japan',
190
+ KE: 'Kenya',
191
+ KG: 'Kirgizistan',
192
+ KH: 'Kambodja',
193
+ KI: 'Kiribati',
194
+ KM: 'Komorerna',
195
+ KN: 'Saint Kitts och Nevis',
196
+ KP: 'Nordkorea',
197
+ KR: 'Sydkorea',
198
+ KW: 'Kuwait',
199
+ KY: 'Caymanöarna',
200
+ KZ: 'Kazakstan',
201
+ LA: 'Laos',
202
+ LB: 'Libanon',
203
+ LC: 'Saint Lucia',
204
+ LI: 'Liechtenstein',
205
+ LK: 'Sri Lanka',
206
+ LR: 'Liberia',
207
+ LS: 'Lesotho',
208
+ LT: 'Litauen',
209
+ LU: 'Luxemburg',
210
+ LV: 'Lettland',
211
+ LY: 'Libyen',
212
+ MA: 'Marocko',
213
+ MC: 'Monaco',
214
+ MD: 'Moldavien',
215
+ ME: 'Montenegro',
216
+ MF: 'Saint-Martin',
217
+ MG: 'Madagaskar',
218
+ MH: 'Marshallöarna',
219
+ MK: 'Nordmakedonien',
220
+ ML: 'Mali',
221
+ MM: 'Myanmar',
222
+ MN: 'Mongoliet',
223
+ MO: 'Macao',
224
+ MP: 'Nordmarianerna',
225
+ MQ: 'Martinique',
226
+ MR: 'Mauretanien',
227
+ MS: 'Montserrat',
228
+ MT: 'Malta',
229
+ MU: 'Mauritius',
230
+ MV: 'Maldiverna',
231
+ MW: 'Malawi',
232
+ MX: 'Mexiko',
233
+ MY: 'Malaysia',
234
+ MZ: 'Moçambique',
235
+ NA: 'Namibia',
236
+ NC: 'Nya Kaledonien',
237
+ NE: 'Niger',
238
+ NF: 'Norfolkön',
239
+ NG: 'Nigeria',
240
+ NI: 'Nicaragua',
241
+ NL: 'Nederländerna',
242
+ NO: 'Norge',
243
+ NP: 'Nepal',
244
+ NR: 'Nauru',
245
+ NU: 'Niue',
246
+ NZ: 'Nya Zeeland',
247
+ OM: 'Oman',
248
+ PA: 'Panama',
249
+ PE: 'Peru',
250
+ PF: 'Franska Polynesien',
251
+ PG: 'Papua Nya Guinea',
252
+ PH: 'Filippinerna',
253
+ PK: 'Pakistan',
254
+ PL: 'Polen',
255
+ PM: 'Saint-Pierre och Miquelon',
256
+ PN: 'Pitcairnöarna',
257
+ PR: 'Puerto Rico',
258
+ PS: 'Palestina',
259
+ PT: 'Portugal',
260
+ PW: 'Palau',
261
+ PY: 'Paraguay',
262
+ QA: 'Qatar',
263
+ RE: 'Réunion',
264
+ RO: 'Rumänien',
265
+ RS: 'Serbien',
266
+ RU: 'Ryssland',
267
+ RW: 'Rwanda',
268
+ SA: 'Saudiarabien',
269
+ SB: 'Salomonöarna',
270
+ SC: 'Seychellerna',
271
+ SD: 'Sudan',
272
+ SE: 'Sverige',
273
+ SG: 'Singapore',
274
+ SH: 'Sankta Helena',
275
+ SI: 'Slovenien',
276
+ SJ: 'Svalbard och Jan Mayen',
277
+ SK: 'Slovakien',
278
+ SL: 'Sierra Leone',
279
+ SM: 'San Marino',
280
+ SN: 'Senegal',
281
+ SO: 'Somalia',
282
+ SR: 'Surinam',
283
+ SS: 'Sydsudan',
284
+ ST: 'São Tomé och Príncipe',
285
+ SV: 'El Salvador',
286
+ SX: 'Sint Maarten',
287
+ SY: 'Syrien',
288
+ SZ: 'Swaziland',
289
+ TC: 'Turks- och Caicosöarna',
290
+ TD: 'Tchad',
291
+ TF: 'Franska södra territorierna',
292
+ TG: 'Togo',
293
+ TH: 'Thailand',
294
+ TJ: 'Tadzjikistan',
295
+ TK: 'Tokelauöarna',
296
+ TL: 'Östtimor',
297
+ TM: 'Turkmenistan',
298
+ TN: 'Tunisien',
299
+ TO: 'Tonga',
300
+ TR: 'Turkiet',
301
+ TT: 'Trinidad och Tobago',
302
+ TV: 'Tuvalu',
303
+ TW: 'Taiwan',
304
+ TZ: 'Tanzania',
305
+ UA: 'Ukraina',
306
+ UG: 'Uganda',
307
+ UM: 'Förenta staternas mindre öar i Oceanien och Västindien',
308
+ US: 'USA',
309
+ UY: 'Uruguay',
310
+ UZ: 'Uzbekistan',
311
+ VA: 'Vatikanstaten',
312
+ VC: 'Saint Vincent och Grenadinerna',
313
+ VE: 'Venezuela',
314
+ VG: 'Brittiska Jungfruöarna',
315
+ VI: 'Amerikanska Jungfruöarna',
316
+ VN: 'Vietnam',
317
+ VU: 'Vanuatu',
318
+ WF: 'Wallis- och Futunaöarna',
319
+ WS: 'Samoa',
320
+ YE: 'Jemen',
321
+ YT: 'Mayotte',
322
+ ZA: 'Sydafrika',
323
+ ZM: 'Zambia',
324
+ ZW: 'Zimbabwe'
325
+ };
326
+ var getCountryFromLanguageCode = function (languageCode) {
327
+ return languageCodeToCountryMap[languageCode] || '';
328
328
  };
329
329
 
330
- var useDetectDevice = function () {
331
- var _a = React__default["default"].useState(false), isMobile = _a[0], setMobile = _a[1];
332
- React__default["default"].useEffect(function () {
333
- var userAgent = typeof window.navigator === 'undefined' ? '' : navigator.userAgent;
334
- var mobile = Boolean(userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile|WPDesktop/i) || window.screen.width < 1024);
335
- setMobile(mobile);
336
- }, []);
337
- return { isMobile: isMobile };
330
+ var useDetectDevice = function () {
331
+ var _a = React__default["default"].useState(false), isMobile = _a[0], setMobile = _a[1];
332
+ React__default["default"].useEffect(function () {
333
+ var userAgent = typeof window.navigator === 'undefined' ? '' : navigator.userAgent;
334
+ var mobile = Boolean(userAgent.match(/Android|BlackBerry|iPhone|iPod|Opera Mini|IEMobile|WPDesktop/i) || window.screen.width < 1024);
335
+ setMobile(mobile);
336
+ }, []);
337
+ return { isMobile: isMobile };
338
338
  };
339
339
 
340
- function useWindowSize() {
341
- var _a = React.useState({
342
- width: typeof window !== 'undefined' ? window.innerWidth : 0,
343
- height: typeof window !== 'undefined' ? window.innerHeight : 0
344
- }), windowSize = _a[0], setWindowSize = _a[1];
345
- React.useEffect(function () {
346
- function handleResize() {
347
- setWindowSize({
348
- width: window.innerWidth,
349
- height: window.innerHeight
350
- });
351
- }
352
- window.addEventListener('resize', handleResize);
353
- handleResize();
354
- // Remove event listener on cleanup
355
- return function () { return window.removeEventListener('resize', handleResize); };
356
- }, []);
357
- return { width: windowSize.width, height: windowSize.height };
340
+ function useWindowSize() {
341
+ var _a = React.useState({
342
+ width: typeof window !== 'undefined' ? window.innerWidth : 0,
343
+ height: typeof window !== 'undefined' ? window.innerHeight : 0
344
+ }), windowSize = _a[0], setWindowSize = _a[1];
345
+ React.useEffect(function () {
346
+ function handleResize() {
347
+ setWindowSize({
348
+ width: window.innerWidth,
349
+ height: window.innerHeight
350
+ });
351
+ }
352
+ window.addEventListener('resize', handleResize);
353
+ handleResize();
354
+ // Remove event listener on cleanup
355
+ return function () { return window.removeEventListener('resize', handleResize); };
356
+ }, []);
357
+ return { width: windowSize.width, height: windowSize.height };
358
358
  }
359
359
 
360
- var useOutsideClick = function (ref, callback) {
361
- var handleClick = function (e) {
362
- if ((ref === null || ref === void 0 ? void 0 : ref.current) && !ref.current.contains(e.target)) {
363
- callback();
364
- }
365
- };
366
- React.useEffect(function () {
367
- document === null || document === void 0 ? void 0 : document.addEventListener('click', handleClick);
368
- return function () {
369
- document === null || document === void 0 ? void 0 : document.removeEventListener('click', handleClick);
370
- };
371
- });
360
+ var useOutsideClick = function (ref, callback) {
361
+ var handleClick = function (e) {
362
+ if ((ref === null || ref === void 0 ? void 0 : ref.current) && !ref.current.contains(e.target)) {
363
+ callback();
364
+ }
365
+ };
366
+ React.useEffect(function () {
367
+ document === null || document === void 0 ? void 0 : document.addEventListener('click', handleClick);
368
+ return function () {
369
+ document === null || document === void 0 ? void 0 : document.removeEventListener('click', handleClick);
370
+ };
371
+ });
372
372
  };
373
373
 
374
- var useFixedModalScroll = function (active, querySelector) {
375
- var _a = React.useState(0), prevPosition = _a[0], setPrevPosition = _a[1];
376
- React.useEffect(function () {
377
- var pos = window === null || window === void 0 ? void 0 : window.scrollY;
378
- var selector = querySelector || (document === null || document === void 0 ? void 0 : document.body);
379
- if (active && selector) {
380
- setPrevPosition(pos);
381
- selector.style.overflowY = 'scroll';
382
- selector.style.position = 'fixed';
383
- selector.style.top = -pos + 'px';
384
- }
385
- else {
386
- selector.style.removeProperty('top');
387
- selector.style.overflowY = 'auto';
388
- selector.style.position = 'relative';
389
- if (prevPosition) {
390
- window.scrollTo(0, prevPosition);
391
- }
392
- }
393
- }, [active, querySelector]);
374
+ var useFixedModalScroll = function (active, querySelector) {
375
+ var _a = React.useState(0), prevPosition = _a[0], setPrevPosition = _a[1];
376
+ React.useEffect(function () {
377
+ var pos = window === null || window === void 0 ? void 0 : window.scrollY;
378
+ var selector = querySelector || (document === null || document === void 0 ? void 0 : document.body);
379
+ if (active && selector) {
380
+ setPrevPosition(pos);
381
+ selector.style.overflowY = 'scroll';
382
+ selector.style.position = 'fixed';
383
+ selector.style.top = -pos + 'px';
384
+ }
385
+ else {
386
+ selector.style.removeProperty('top');
387
+ selector.style.overflowY = 'auto';
388
+ selector.style.position = 'relative';
389
+ if (prevPosition) {
390
+ window.scrollTo(0, prevPosition);
391
+ }
392
+ }
393
+ }, [active, querySelector]);
394
394
  };
395
395
 
396
- function comparisonTypes(type) {
397
- if (!type) {
398
- return '';
399
- }
400
- switch (type) {
401
- case 'KGM':
402
- return 'kg';
403
- case 'G':
404
- return 'g';
405
- case 'LTR':
406
- return 'l';
407
- case 'PCE':
408
- return 'st';
409
- case 'H87':
410
- return 'st';
411
- case 'm':
412
- return 'm';
413
- case 'MM':
414
- return 'm';
415
- case 'MTR':
416
- return 'm';
417
- case 'DSK':
418
- return 'disk';
419
- case 'TVA':
420
- return 'tvätt';
421
- }
396
+ function comparisonTypes(type) {
397
+ if (!type) {
398
+ return '';
399
+ }
400
+ switch (type) {
401
+ case 'KGM':
402
+ return 'kg';
403
+ case 'G':
404
+ return 'g';
405
+ case 'LTR':
406
+ return 'l';
407
+ case 'PCE':
408
+ return 'st';
409
+ case 'H87':
410
+ return 'st';
411
+ case 'm':
412
+ return 'm';
413
+ case 'MM':
414
+ return 'm';
415
+ case 'MTR':
416
+ return 'm';
417
+ case 'DSK':
418
+ return 'disk';
419
+ case 'TVA':
420
+ return 'tvätt';
421
+ }
422
422
  }
423
423
 
424
- var phoneRegex = /^[0-9]{7,14}$/;
425
- var nameRegex = /^[a-ö, A-Ö]$/;
426
- var zipRegex = /(^\d{5}$)|(^\d{3} \d{2}$)/;
427
- // Taken from https://stackoverflow.com/a/46181
428
- var emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
424
+ var phoneRegex = /^[0-9]{7,14}$/;
425
+ var nameRegex = /^[a-ö, A-Ö]$/;
426
+ var zipRegex = /(^\d{5}$)|(^\d{3} \d{2}$)/;
427
+ // Taken from https://stackoverflow.com/a/46181
428
+ var emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
429
429
  var validateInput = function (input, regex) { return regex.test(input); };
430
430
 
431
- var makeCateringPortionsString = function (variant, cartItem, unit) {
432
- var _a, _b;
433
- if (unit !== 'per person')
434
- return;
435
- var qString = '';
436
- if ((variant === null || variant === void 0 ? void 0 : variant.quantityFrom) || (variant === null || variant === void 0 ? void 0 : variant.quantityTo)) {
437
- if (variant === null || variant === void 0 ? void 0 : variant.quantityFrom)
438
- qString += variant === null || variant === void 0 ? void 0 : variant.quantityFrom;
439
- if (variant === null || variant === void 0 ? void 0 : variant.quantityTo)
440
- qString += " - ".concat(variant === null || variant === void 0 ? void 0 : variant.quantityTo);
441
- }
442
- else {
443
- qString = (variant === null || variant === void 0 ? void 0 : variant.quantityFrom)
444
- ? (_a = variant === null || variant === void 0 ? void 0 : variant.quantityFrom) === null || _a === void 0 ? void 0 : _a.toString()
445
- : (_b = cartItem === null || cartItem === void 0 ? void 0 : cartItem.value) === null || _b === void 0 ? void 0 : _b.toString();
446
- }
447
- return qString;
431
+ var makeCateringPortionsString = function (variant, cartItem, unit) {
432
+ var _a, _b;
433
+ if (unit !== 'per person')
434
+ return;
435
+ var qString = '';
436
+ if ((variant === null || variant === void 0 ? void 0 : variant.quantityFrom) || (variant === null || variant === void 0 ? void 0 : variant.quantityTo)) {
437
+ if (variant === null || variant === void 0 ? void 0 : variant.quantityFrom)
438
+ qString += variant === null || variant === void 0 ? void 0 : variant.quantityFrom;
439
+ if (variant === null || variant === void 0 ? void 0 : variant.quantityTo)
440
+ qString += " - ".concat(variant === null || variant === void 0 ? void 0 : variant.quantityTo);
441
+ }
442
+ else {
443
+ qString = (variant === null || variant === void 0 ? void 0 : variant.quantityFrom)
444
+ ? (_a = variant === null || variant === void 0 ? void 0 : variant.quantityFrom) === null || _a === void 0 ? void 0 : _a.toString()
445
+ : (_b = cartItem === null || cartItem === void 0 ? void 0 : cartItem.value) === null || _b === void 0 ? void 0 : _b.toString();
446
+ }
447
+ return qString;
448
448
  };
449
449
 
450
- var focusTrap = function (_a) {
451
- var _b;
452
- var exitFunction = _a.exitFunction, ref = _a.ref;
453
- var elements = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
454
- var focusableElements = (_b = ref.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(elements);
455
- if (focusableElements &&
456
- focusableElements.length > 0 &&
457
- focusableElements[0] instanceof HTMLElement) {
458
- focusableElements[0].focus();
459
- }
460
- var handleKeyDown = function (e) {
461
- if (!ref.current)
462
- return;
463
- var focusable = Array.from(ref.current.querySelectorAll(elements));
464
- if (focusable.length === 0)
465
- return;
466
- var firstElement = focusable[0];
467
- var lastElement = focusable[focusable.length - 1];
468
- if (e.key === 'Tab') {
469
- if (e.shiftKey && document.activeElement === firstElement) {
470
- e.preventDefault();
471
- lastElement.focus();
472
- }
473
- else if (!e.shiftKey && document.activeElement === lastElement) {
474
- e.preventDefault();
475
- firstElement.focus();
476
- }
477
- }
478
- else if (e.key === 'Escape')
479
- exitFunction();
480
- };
481
- if (ref.current)
482
- ref.current.addEventListener('keydown', handleKeyDown);
483
- return function () {
484
- if (ref.current)
485
- ref.current.removeEventListener('keydown', handleKeyDown);
486
- };
450
+ var focusTrap = function (_a) {
451
+ var _b;
452
+ var exitFunction = _a.exitFunction, ref = _a.ref;
453
+ var elements = 'button:not([disabled]), [href]:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
454
+ var focusableElements = (_b = ref.current) === null || _b === void 0 ? void 0 : _b.querySelectorAll(elements);
455
+ if (focusableElements &&
456
+ focusableElements.length > 0 &&
457
+ focusableElements[0] instanceof HTMLElement) {
458
+ focusableElements[0].focus();
459
+ }
460
+ var handleKeyDown = function (e) {
461
+ if (!ref.current)
462
+ return;
463
+ var focusable = Array.from(ref.current.querySelectorAll(elements));
464
+ if (focusable.length === 0)
465
+ return;
466
+ var firstElement = focusable[0];
467
+ var lastElement = focusable[focusable.length - 1];
468
+ if (e.key === 'Tab') {
469
+ if (e.shiftKey && document.activeElement === firstElement) {
470
+ e.preventDefault();
471
+ lastElement.focus();
472
+ }
473
+ else if (!e.shiftKey && document.activeElement === lastElement) {
474
+ e.preventDefault();
475
+ firstElement.focus();
476
+ }
477
+ }
478
+ else if (e.key === 'Escape')
479
+ exitFunction();
480
+ };
481
+ if (ref.current)
482
+ ref.current.addEventListener('keydown', handleKeyDown);
483
+ return function () {
484
+ if (ref.current)
485
+ ref.current.removeEventListener('keydown', handleKeyDown);
486
+ };
487
487
  };
488
488
 
489
489
  var formatLeadingZero = function (day) { return day.replace(/^0+/, ''); };
490
490
 
491
- var formatPostalCode = function (postalCode, spaceIndex) {
492
- var _a;
493
- if (!(postalCode === null || postalCode === void 0 ? void 0 : postalCode.length))
494
- return null;
495
- return (_a = postalCode.split('')) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, curr, index) {
496
- if (index === (spaceIndex || 3)) {
497
- return "".concat(acc, " ").concat(curr);
498
- }
499
- return "".concat(acc).concat(curr);
500
- });
491
+ var formatPostalCode = function (postalCode, spaceIndex) {
492
+ var _a;
493
+ if (!(postalCode === null || postalCode === void 0 ? void 0 : postalCode.length))
494
+ return null;
495
+ return (_a = postalCode.split('')) === null || _a === void 0 ? void 0 : _a.reduce(function (acc, curr, index) {
496
+ if (index === (spaceIndex || 3)) {
497
+ return "".concat(acc, " ").concat(curr);
498
+ }
499
+ return "".concat(acc).concat(curr);
500
+ });
501
501
  };
502
502
 
503
503
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof _commonjsHelpers.commonjsGlobal !== 'undefined' ? _commonjsHelpers.commonjsGlobal : typeof self !== 'undefined' ? self : {};
@@ -18772,17 +18772,17 @@ locales.exports;
18772
18772
 
18773
18773
  locales.exports;
18774
18774
 
18775
- var Locale;
18776
- (function (Locale) {
18777
- Locale["swedish"] = "sv";
18778
- Locale["english"] = "en-gb";
18779
- Locale["american"] = "en-us";
18780
- })(Locale || (Locale = {}));
18775
+ var Locale;
18776
+ (function (Locale) {
18777
+ Locale["swedish"] = "sv";
18778
+ Locale["english"] = "en-gb";
18779
+ Locale["american"] = "en-us";
18780
+ })(Locale || (Locale = {}));
18781
18781
  moment.locale(Locale.swedish);
18782
18782
 
18783
- var formatDateToLocale = function (date, withYear) {
18784
- var _a, _b;
18785
- return (_b = (_a = moment(new Date(date))) === null || _a === void 0 ? void 0 : _a.format("dddd D MMMM ".concat(withYear ? 'YYYY' : ''))) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase();
18783
+ var formatDateToLocale = function (date, withYear) {
18784
+ var _a, _b;
18785
+ return (_b = (_a = moment(new Date(date))) === null || _a === void 0 ? void 0 : _a.format("dddd D MMMM ".concat(withYear ? 'YYYY' : ''))) === null || _b === void 0 ? void 0 : _b.toLocaleLowerCase();
18786
18786
  };
18787
18787
 
18788
18788
  var sv = {exports: {}};
@@ -18866,21 +18866,21 @@ sv.exports;
18866
18866
 
18867
18867
  sv.exports;
18868
18868
 
18869
- moment.locale('sv');
18870
- function getDateInfo(dateStr) {
18871
- var date = moment(dateStr);
18872
- return {
18873
- day: {
18874
- name: date.format('dddd'),
18875
- number: date.format('D')
18876
- },
18877
- isTomorrow: date.isSame(moment().add(1, 'day'), 'day'),
18878
- month: {
18879
- name: date.format('MMMM'),
18880
- number: date.format('M')
18881
- },
18882
- year: date.format('YYYY')
18883
- };
18869
+ moment.locale('sv');
18870
+ function getDateInfo(dateStr) {
18871
+ var date = moment(dateStr);
18872
+ return {
18873
+ day: {
18874
+ name: date.format('dddd'),
18875
+ number: date.format('D')
18876
+ },
18877
+ isTomorrow: date.isSame(moment().add(1, 'day'), 'day'),
18878
+ month: {
18879
+ name: date.format('MMMM'),
18880
+ number: date.format('M')
18881
+ },
18882
+ year: date.format('YYYY')
18883
+ };
18884
18884
  }
18885
18885
 
18886
18886
  index.__exports.capitalizeFirstLetter = capitalizeFirstLetter;