ublo-lib 1.24.3 → 1.25.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.
Files changed (331) hide show
  1. package/es/common/components/admin-links/admin-links.js +95 -52
  2. package/es/common/components/admin-links/index.js +1 -1
  3. package/es/common/components/breadcrumb.js +78 -21
  4. package/es/common/components/cross-selling-editor/cross-selling-editor.js +52 -0
  5. package/es/common/components/cross-selling-editor/cross-selling-editor.module.css +6 -0
  6. package/es/common/components/cross-selling-editor/editor.js +98 -0
  7. package/es/common/components/cross-selling-editor/editor.module.css +23 -0
  8. package/es/common/components/cross-selling-editor/hooks/use-custom-offers.js +52 -0
  9. package/es/common/components/cross-selling-editor/hooks/use-tunnel-offers.js +35 -0
  10. package/es/common/components/cross-selling-editor/index.js +2 -0
  11. package/es/common/components/cross-selling-editor/override-trigger-form.js +156 -0
  12. package/es/common/components/cross-selling-editor/override-trigger-form.module.css +58 -0
  13. package/es/common/components/cross-selling-editor/override.js +124 -0
  14. package/es/common/components/cross-selling-editor/override.module.css +65 -0
  15. package/es/common/components/cross-selling-editor/overrides-list.js +111 -0
  16. package/es/common/components/cross-selling-editor/overrides-list.module.css +56 -0
  17. package/es/common/components/cross-selling-editor/rule.js +105 -0
  18. package/es/common/components/cross-selling-editor/rule.module.css +37 -0
  19. package/es/common/components/cross-selling-editor/rules.js +84 -0
  20. package/es/common/components/cross-selling-editor/rules.module.css +39 -0
  21. package/es/common/components/cross-selling-editor/services/api.js +36 -0
  22. package/es/common/components/cross-selling-editor/services/utils.js +199 -0
  23. package/es/common/components/cross-selling-editor/tester-tunnel-offer.js +53 -0
  24. package/es/common/components/cross-selling-editor/tester-tunnel-offer.module.css +18 -0
  25. package/es/common/components/cross-selling-editor/tester.js +188 -0
  26. package/es/common/components/cross-selling-editor/tester.module.css +106 -0
  27. package/es/common/components/cross-selling-editor/types.js +1 -0
  28. package/es/common/components/custom-contact-form/custom-contact-form.js +147 -75
  29. package/es/common/components/date-picker/calendar.js +1 -1
  30. package/es/common/components/gesco-contact-form/gesco-contact-form.js +243 -95
  31. package/es/common/components/gesco-contact-form/hooks/use-params.js +35 -20
  32. package/es/common/components/gesco-contact-form/index.js +1 -1
  33. package/es/common/components/gesco-contact-form/phone-code-select.js +76 -56
  34. package/es/common/components/gesco-contact-form/services/api.js +7 -8
  35. package/es/common/components/gesco-contact-form/services/form.js +39 -25
  36. package/es/common/components/gesco-contact-form/services/messages.js +68 -65
  37. package/es/common/components/gesco-contact-form/services/plausible.js +8 -10
  38. package/es/common/components/gesco-contact-form/types.js +1 -1
  39. package/es/common/components/instant-search/hooks/use-constant.js +8 -6
  40. package/es/common/components/instant-search/hooks/use-debounced-search.js +14 -5
  41. package/es/common/components/instant-search/hooks/use-search.js +10 -6
  42. package/es/common/components/instant-search/index.js +1 -1
  43. package/es/common/components/instant-search/input.js +75 -45
  44. package/es/common/components/instant-search/instant-search.js +124 -73
  45. package/es/common/components/instant-search/links.js +74 -23
  46. package/es/common/components/instant-search/no-product.js +81 -4
  47. package/es/common/components/instant-search/products.js +118 -31
  48. package/es/common/components/instant-search/results.js +121 -32
  49. package/es/common/components/instant-search/services/api.js +12 -10
  50. package/es/common/components/instant-search/services/messages.js +3 -3
  51. package/es/common/components/instant-search/services/utils.js +34 -34
  52. package/es/common/components/msem-preset-editor/components/facet-selector.js +39 -22
  53. package/es/common/components/msem-preset-editor/components/form.js +54 -5
  54. package/es/common/components/msem-preset-editor/components/stay-picker.js +72 -33
  55. package/es/common/components/msem-preset-editor/components/widget-list-item.js +130 -42
  56. package/es/common/components/msem-preset-editor/components/widget-list.js +54 -29
  57. package/es/common/components/msem-preset-editor/editor-dialog.js +68 -21
  58. package/es/common/components/msem-preset-editor/editors/elloha.js +102 -69
  59. package/es/common/components/msem-preset-editor/editors/index.js +6 -6
  60. package/es/common/components/msem-preset-editor/editors/lodgings.js +316 -184
  61. package/es/common/components/msem-preset-editor/editors/ski-passes.js +267 -180
  62. package/es/common/components/msem-preset-editor/editors/standard-products.js +84 -56
  63. package/es/common/components/msem-preset-editor/editors/vakario.js +239 -171
  64. package/es/common/components/msem-preset-editor/msem-preset-editor.js +215 -129
  65. package/es/common/components/msem-preset-editor/services/api.js +69 -42
  66. package/es/common/components/msem-preset-editor/services/offers.js +61 -35
  67. package/es/common/components/msem-preset-editor/services/preset.js +22 -14
  68. package/es/common/components/msem-preset-editor/services/url-params.js +24 -24
  69. package/es/common/components/msem-preset-linker/components/actions.js +52 -40
  70. package/es/common/components/msem-preset-linker/components/overlays.js +57 -41
  71. package/es/common/components/msem-preset-linker/components/resort-selector.js +21 -11
  72. package/es/common/components/msem-preset-linker/hooks/use-msem-presets.js +43 -31
  73. package/es/common/components/msem-preset-linker/index.js +1 -1
  74. package/es/common/components/msem-preset-linker/msem-preset-linker.js +71 -42
  75. package/es/common/components/msem-preset-linker/services/url-params.js +10 -13
  76. package/es/common/components/plausible/hooks/use-plausible.js +22 -18
  77. package/es/common/components/plausible/index.js +1 -1
  78. package/es/common/components/plausible/plausible.js +23 -14
  79. package/es/common/components/plausible/services/callback.js +164 -115
  80. package/es/common/components/plausible/services/load.js +4 -6
  81. package/es/common/components/plausible/services/send-goal.js +6 -3
  82. package/es/common/components/scroll-spy.js +56 -43
  83. package/es/common/components/scrolling-carousel/index.js +1 -1
  84. package/es/common/components/scrolling-carousel/scrolling-carousel.js +94 -55
  85. package/es/common/components/scrolling-carousel/scrolling-carousel.module.css +1 -0
  86. package/es/common/components/tabbed-zones.js +100 -47
  87. package/es/common/hooks/use-faq.js +37 -36
  88. package/es/common/hooks/use-in-view.js +74 -74
  89. package/es/common/hooks/use-scroll-direction.js +37 -32
  90. package/es/common/hooks/use-stay.js +16 -13
  91. package/es/common/hooks/use-sticky.js +35 -35
  92. package/es/common/hooks/use-tunnel.js +42 -30
  93. package/es/common/hooks/use-update-effect.js +9 -9
  94. package/es/common/hooks/use-window-sizes.js +27 -28
  95. package/es/common/utils/cms.js +15 -17
  96. package/es/common/utils/cookies.js +10 -11
  97. package/es/common/utils/copy.js +11 -11
  98. package/es/common/utils/dates.js +8 -10
  99. package/es/common/utils/elements.js +14 -15
  100. package/es/common/utils/events.js +4 -19
  101. package/es/common/utils/file-manager.js +12 -10
  102. package/es/common/utils/load-js.js +10 -11
  103. package/es/common/utils/msem-widget.js +30 -23
  104. package/es/common/utils/url-parameters.js +11 -7
  105. package/es/esf/components/magic-box/index.js +1 -1
  106. package/es/esf/components/magic-box/magic-box.js +164 -102
  107. package/es/esf/components/parcours-esf/index.js +1 -1
  108. package/es/esf/components/parcours-esf/parcours-esf.js +45 -30
  109. package/es/esf/components/period-picker/period-picker.js +5 -5
  110. package/es/lbm/components/lumiplan/api.js +35 -18
  111. package/es/lbm/components/lumiplan/domain.js +96 -20
  112. package/es/lbm/components/lumiplan/i18n/translations.js +24 -15
  113. package/es/lbm/components/lumiplan/index.js +1 -1
  114. package/es/lbm/components/lumiplan/lumiplan.js +130 -102
  115. package/es/lbm/components/lumiplan/opening.js +116 -38
  116. package/es/lbm/components/lumiplan/pois.js +270 -161
  117. package/es/lbm/components/lumiplan/resort-selector.js +58 -36
  118. package/es/lbm/components/lumiplan/road-condition.js +100 -19
  119. package/es/lbm/components/lumiplan/todays-tips.js +45 -16
  120. package/es/lbm/components/lumiplan/types.js +1 -1
  121. package/es/lbm/components/lumiplan/weather/avalanche-risk.js +33 -8
  122. package/es/lbm/components/lumiplan/weather/index.js +1 -1
  123. package/es/lbm/components/lumiplan/weather/snow-data.js +71 -5
  124. package/es/lbm/components/lumiplan/weather/weather-data.js +126 -7
  125. package/es/lbm/components/lumiplan/weather/weather-days.js +76 -48
  126. package/es/lbm/components/lumiplan/weather/weather-icon.js +23 -20
  127. package/es/lbm/components/lumiplan/weather/weather-zones.js +71 -42
  128. package/es/lbm/components/lumiplan/weather/weather.js +90 -28
  129. package/package.json +4 -10
  130. package/es/common/components/admin-links/admin-links.d.ts +0 -11
  131. package/es/common/components/admin-links/admin-links.d.ts.map +0 -1
  132. package/es/common/components/admin-links/index.d.ts +0 -3
  133. package/es/common/components/admin-links/index.d.ts.map +0 -1
  134. package/es/common/components/breadcrumb.d.ts +0 -16
  135. package/es/common/components/breadcrumb.d.ts.map +0 -1
  136. package/es/common/components/custom-contact-form/custom-contact-form.d.ts +0 -25
  137. package/es/common/components/custom-contact-form/custom-contact-form.d.ts.map +0 -1
  138. package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts +0 -17
  139. package/es/common/components/gesco-contact-form/gesco-contact-form.d.ts.map +0 -1
  140. package/es/common/components/gesco-contact-form/hooks/use-params.d.ts +0 -15
  141. package/es/common/components/gesco-contact-form/hooks/use-params.d.ts.map +0 -1
  142. package/es/common/components/gesco-contact-form/index.d.ts +0 -3
  143. package/es/common/components/gesco-contact-form/index.d.ts.map +0 -1
  144. package/es/common/components/gesco-contact-form/phone-code-select.d.ts +0 -7
  145. package/es/common/components/gesco-contact-form/phone-code-select.d.ts.map +0 -1
  146. package/es/common/components/gesco-contact-form/services/api.d.ts +0 -30
  147. package/es/common/components/gesco-contact-form/services/api.d.ts.map +0 -1
  148. package/es/common/components/gesco-contact-form/services/form.d.ts +0 -31
  149. package/es/common/components/gesco-contact-form/services/form.d.ts.map +0 -1
  150. package/es/common/components/gesco-contact-form/services/messages.d.ts +0 -34
  151. package/es/common/components/gesco-contact-form/services/messages.d.ts.map +0 -1
  152. package/es/common/components/gesco-contact-form/services/plausible.d.ts +0 -3
  153. package/es/common/components/gesco-contact-form/services/plausible.d.ts.map +0 -1
  154. package/es/common/components/gesco-contact-form/types.d.ts +0 -34
  155. package/es/common/components/gesco-contact-form/types.d.ts.map +0 -1
  156. package/es/common/components/instant-search/hooks/use-constant.d.ts +0 -2
  157. package/es/common/components/instant-search/hooks/use-constant.d.ts.map +0 -1
  158. package/es/common/components/instant-search/hooks/use-debounced-search.d.ts +0 -7
  159. package/es/common/components/instant-search/hooks/use-debounced-search.d.ts.map +0 -1
  160. package/es/common/components/instant-search/hooks/use-search.d.ts +0 -16
  161. package/es/common/components/instant-search/hooks/use-search.d.ts.map +0 -1
  162. package/es/common/components/instant-search/index.d.ts +0 -3
  163. package/es/common/components/instant-search/index.d.ts.map +0 -1
  164. package/es/common/components/instant-search/input.d.ts +0 -15
  165. package/es/common/components/instant-search/input.d.ts.map +0 -1
  166. package/es/common/components/instant-search/instant-search.d.ts +0 -14
  167. package/es/common/components/instant-search/instant-search.d.ts.map +0 -1
  168. package/es/common/components/instant-search/links.d.ts +0 -12
  169. package/es/common/components/instant-search/links.d.ts.map +0 -1
  170. package/es/common/components/instant-search/no-product.d.ts +0 -6
  171. package/es/common/components/instant-search/no-product.d.ts.map +0 -1
  172. package/es/common/components/instant-search/products.d.ts +0 -14
  173. package/es/common/components/instant-search/products.d.ts.map +0 -1
  174. package/es/common/components/instant-search/results.d.ts +0 -76
  175. package/es/common/components/instant-search/results.d.ts.map +0 -1
  176. package/es/common/components/instant-search/services/api.d.ts +0 -2
  177. package/es/common/components/instant-search/services/api.d.ts.map +0 -1
  178. package/es/common/components/instant-search/services/messages.d.ts +0 -2
  179. package/es/common/components/instant-search/services/messages.d.ts.map +0 -1
  180. package/es/common/components/instant-search/services/utils.d.ts +0 -4
  181. package/es/common/components/instant-search/services/utils.d.ts.map +0 -1
  182. package/es/common/components/msem-preset-editor/components/facet-selector.d.ts +0 -6
  183. package/es/common/components/msem-preset-editor/components/facet-selector.d.ts.map +0 -1
  184. package/es/common/components/msem-preset-editor/components/form.d.ts +0 -8
  185. package/es/common/components/msem-preset-editor/components/form.d.ts.map +0 -1
  186. package/es/common/components/msem-preset-editor/components/stay-picker.d.ts +0 -14
  187. package/es/common/components/msem-preset-editor/components/stay-picker.d.ts.map +0 -1
  188. package/es/common/components/msem-preset-editor/components/widget-list-item.d.ts +0 -12
  189. package/es/common/components/msem-preset-editor/components/widget-list-item.d.ts.map +0 -1
  190. package/es/common/components/msem-preset-editor/components/widget-list.d.ts +0 -17
  191. package/es/common/components/msem-preset-editor/components/widget-list.d.ts.map +0 -1
  192. package/es/common/components/msem-preset-editor/editor-dialog.d.ts +0 -30
  193. package/es/common/components/msem-preset-editor/editor-dialog.d.ts.map +0 -1
  194. package/es/common/components/msem-preset-editor/editors/elloha.d.ts +0 -15
  195. package/es/common/components/msem-preset-editor/editors/elloha.d.ts.map +0 -1
  196. package/es/common/components/msem-preset-editor/editors/index.d.ts +0 -14
  197. package/es/common/components/msem-preset-editor/editors/index.d.ts.map +0 -1
  198. package/es/common/components/msem-preset-editor/editors/lodgings.d.ts +0 -17
  199. package/es/common/components/msem-preset-editor/editors/lodgings.d.ts.map +0 -1
  200. package/es/common/components/msem-preset-editor/editors/ski-passes.d.ts +0 -16
  201. package/es/common/components/msem-preset-editor/editors/ski-passes.d.ts.map +0 -1
  202. package/es/common/components/msem-preset-editor/editors/standard-products.d.ts +0 -16
  203. package/es/common/components/msem-preset-editor/editors/standard-products.d.ts.map +0 -1
  204. package/es/common/components/msem-preset-editor/editors/vakario.d.ts +0 -15
  205. package/es/common/components/msem-preset-editor/editors/vakario.d.ts.map +0 -1
  206. package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts +0 -28
  207. package/es/common/components/msem-preset-editor/msem-preset-editor.d.ts.map +0 -1
  208. package/es/common/components/msem-preset-editor/services/api.d.ts +0 -15
  209. package/es/common/components/msem-preset-editor/services/api.d.ts.map +0 -1
  210. package/es/common/components/msem-preset-editor/services/offers.d.ts +0 -47
  211. package/es/common/components/msem-preset-editor/services/offers.d.ts.map +0 -1
  212. package/es/common/components/msem-preset-editor/services/preset.d.ts +0 -40
  213. package/es/common/components/msem-preset-editor/services/preset.d.ts.map +0 -1
  214. package/es/common/components/msem-preset-editor/services/url-params.d.ts +0 -3
  215. package/es/common/components/msem-preset-editor/services/url-params.d.ts.map +0 -1
  216. package/es/common/components/msem-preset-linker/components/actions.d.ts +0 -11
  217. package/es/common/components/msem-preset-linker/components/actions.d.ts.map +0 -1
  218. package/es/common/components/msem-preset-linker/components/overlays.d.ts +0 -8
  219. package/es/common/components/msem-preset-linker/components/overlays.d.ts.map +0 -1
  220. package/es/common/components/msem-preset-linker/components/resort-selector.d.ts +0 -6
  221. package/es/common/components/msem-preset-linker/components/resort-selector.d.ts.map +0 -1
  222. package/es/common/components/msem-preset-linker/hooks/use-msem-presets.d.ts +0 -4
  223. package/es/common/components/msem-preset-linker/hooks/use-msem-presets.d.ts.map +0 -1
  224. package/es/common/components/msem-preset-linker/index.d.ts +0 -3
  225. package/es/common/components/msem-preset-linker/index.d.ts.map +0 -1
  226. package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts +0 -30
  227. package/es/common/components/msem-preset-linker/msem-preset-linker.d.ts.map +0 -1
  228. package/es/common/components/msem-preset-linker/services/url-params.d.ts +0 -2
  229. package/es/common/components/msem-preset-linker/services/url-params.d.ts.map +0 -1
  230. package/es/common/components/plausible/hooks/use-plausible.d.ts +0 -12
  231. package/es/common/components/plausible/hooks/use-plausible.d.ts.map +0 -1
  232. package/es/common/components/plausible/index.d.ts +0 -8
  233. package/es/common/components/plausible/index.d.ts.map +0 -1
  234. package/es/common/components/plausible/plausible.d.ts +0 -7
  235. package/es/common/components/plausible/plausible.d.ts.map +0 -1
  236. package/es/common/components/plausible/services/callback.d.ts +0 -24
  237. package/es/common/components/plausible/services/callback.d.ts.map +0 -1
  238. package/es/common/components/plausible/services/load.d.ts +0 -2
  239. package/es/common/components/plausible/services/load.d.ts.map +0 -1
  240. package/es/common/components/plausible/services/send-goal.d.ts +0 -7
  241. package/es/common/components/plausible/services/send-goal.d.ts.map +0 -1
  242. package/es/common/components/scroll-spy.d.ts +0 -14
  243. package/es/common/components/scroll-spy.d.ts.map +0 -1
  244. package/es/common/components/scrolling-carousel/index.d.ts +0 -3
  245. package/es/common/components/scrolling-carousel/index.d.ts.map +0 -1
  246. package/es/common/components/scrolling-carousel/scrolling-carousel.d.ts +0 -8
  247. package/es/common/components/scrolling-carousel/scrolling-carousel.d.ts.map +0 -1
  248. package/es/common/components/tabbed-zones.d.ts +0 -12
  249. package/es/common/components/tabbed-zones.d.ts.map +0 -1
  250. package/es/common/hooks/use-faq.d.ts +0 -3
  251. package/es/common/hooks/use-faq.d.ts.map +0 -1
  252. package/es/common/hooks/use-in-view.d.ts +0 -5
  253. package/es/common/hooks/use-in-view.d.ts.map +0 -1
  254. package/es/common/hooks/use-scroll-direction.d.ts +0 -11
  255. package/es/common/hooks/use-scroll-direction.d.ts.map +0 -1
  256. package/es/common/hooks/use-stay.d.ts +0 -4
  257. package/es/common/hooks/use-stay.d.ts.map +0 -1
  258. package/es/common/hooks/use-sticky.d.ts +0 -4
  259. package/es/common/hooks/use-sticky.d.ts.map +0 -1
  260. package/es/common/hooks/use-tunnel.d.ts +0 -8
  261. package/es/common/hooks/use-tunnel.d.ts.map +0 -1
  262. package/es/common/hooks/use-update-effect.d.ts +0 -2
  263. package/es/common/hooks/use-update-effect.d.ts.map +0 -1
  264. package/es/common/hooks/use-window-sizes.d.ts +0 -7
  265. package/es/common/hooks/use-window-sizes.d.ts.map +0 -1
  266. package/es/common/utils/cms.d.ts +0 -4
  267. package/es/common/utils/cms.d.ts.map +0 -1
  268. package/es/common/utils/cookies.d.ts +0 -2
  269. package/es/common/utils/cookies.d.ts.map +0 -1
  270. package/es/common/utils/copy.d.ts +0 -2
  271. package/es/common/utils/copy.d.ts.map +0 -1
  272. package/es/common/utils/dates.d.ts +0 -2
  273. package/es/common/utils/dates.d.ts.map +0 -1
  274. package/es/common/utils/elements.d.ts +0 -5
  275. package/es/common/utils/elements.d.ts.map +0 -1
  276. package/es/common/utils/events.d.ts +0 -4
  277. package/es/common/utils/events.d.ts.map +0 -1
  278. package/es/common/utils/file-manager.d.ts +0 -13
  279. package/es/common/utils/file-manager.d.ts.map +0 -1
  280. package/es/common/utils/load-js.d.ts +0 -3
  281. package/es/common/utils/load-js.d.ts.map +0 -1
  282. package/es/common/utils/msem-widget.d.ts +0 -16
  283. package/es/common/utils/msem-widget.d.ts.map +0 -1
  284. package/es/common/utils/url-parameters.d.ts +0 -2
  285. package/es/common/utils/url-parameters.d.ts.map +0 -1
  286. package/es/esf/components/magic-box/index.d.ts +0 -3
  287. package/es/esf/components/magic-box/index.d.ts.map +0 -1
  288. package/es/esf/components/magic-box/magic-box.d.ts +0 -22
  289. package/es/esf/components/magic-box/magic-box.d.ts.map +0 -1
  290. package/es/esf/components/parcours-esf/index.d.ts +0 -3
  291. package/es/esf/components/parcours-esf/index.d.ts.map +0 -1
  292. package/es/esf/components/parcours-esf/parcours-esf.d.ts +0 -14
  293. package/es/esf/components/parcours-esf/parcours-esf.d.ts.map +0 -1
  294. package/es/lbm/components/lumiplan/api.d.ts +0 -8
  295. package/es/lbm/components/lumiplan/api.d.ts.map +0 -1
  296. package/es/lbm/components/lumiplan/domain.d.ts +0 -8
  297. package/es/lbm/components/lumiplan/domain.d.ts.map +0 -1
  298. package/es/lbm/components/lumiplan/i18n/translations.d.ts +0 -7
  299. package/es/lbm/components/lumiplan/i18n/translations.d.ts.map +0 -1
  300. package/es/lbm/components/lumiplan/index.d.ts +0 -3
  301. package/es/lbm/components/lumiplan/index.d.ts.map +0 -1
  302. package/es/lbm/components/lumiplan/lumiplan.d.ts +0 -2
  303. package/es/lbm/components/lumiplan/lumiplan.d.ts.map +0 -1
  304. package/es/lbm/components/lumiplan/opening.d.ts +0 -9
  305. package/es/lbm/components/lumiplan/opening.d.ts.map +0 -1
  306. package/es/lbm/components/lumiplan/pois.d.ts +0 -8
  307. package/es/lbm/components/lumiplan/pois.d.ts.map +0 -1
  308. package/es/lbm/components/lumiplan/resort-selector.d.ts +0 -12
  309. package/es/lbm/components/lumiplan/resort-selector.d.ts.map +0 -1
  310. package/es/lbm/components/lumiplan/road-condition.d.ts +0 -8
  311. package/es/lbm/components/lumiplan/road-condition.d.ts.map +0 -1
  312. package/es/lbm/components/lumiplan/todays-tips.d.ts +0 -8
  313. package/es/lbm/components/lumiplan/todays-tips.d.ts.map +0 -1
  314. package/es/lbm/components/lumiplan/types.d.ts +0 -285
  315. package/es/lbm/components/lumiplan/types.d.ts.map +0 -1
  316. package/es/lbm/components/lumiplan/weather/avalanche-risk.d.ts +0 -4
  317. package/es/lbm/components/lumiplan/weather/avalanche-risk.d.ts.map +0 -1
  318. package/es/lbm/components/lumiplan/weather/index.d.ts +0 -3
  319. package/es/lbm/components/lumiplan/weather/index.d.ts.map +0 -1
  320. package/es/lbm/components/lumiplan/weather/snow-data.d.ts +0 -8
  321. package/es/lbm/components/lumiplan/weather/snow-data.d.ts.map +0 -1
  322. package/es/lbm/components/lumiplan/weather/weather-data.d.ts +0 -9
  323. package/es/lbm/components/lumiplan/weather/weather-data.d.ts.map +0 -1
  324. package/es/lbm/components/lumiplan/weather/weather-days.d.ts +0 -7
  325. package/es/lbm/components/lumiplan/weather/weather-days.d.ts.map +0 -1
  326. package/es/lbm/components/lumiplan/weather/weather-icon.d.ts +0 -23
  327. package/es/lbm/components/lumiplan/weather/weather-icon.d.ts.map +0 -1
  328. package/es/lbm/components/lumiplan/weather/weather-zones.d.ts +0 -6
  329. package/es/lbm/components/lumiplan/weather/weather-zones.d.ts.map +0 -1
  330. package/es/lbm/components/lumiplan/weather/weather.d.ts +0 -8
  331. package/es/lbm/components/lumiplan/weather/weather.d.ts.map +0 -1
@@ -1,27 +1,108 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
1
  import * as React from "react";
3
2
  import { useUbloContext } from "ublo/with-ublo";
4
3
  import Loader from "dt-design-system/es/loader";
5
4
  import T, { t } from "./i18n/translations";
6
5
  import RoadConditionIcon from "./icons/road-condition";
7
6
  import css from "./road-condition.module.css";
8
- const RoadCondition = React.forwardRef(({ resortAccess }, ref) => {
9
- const { lang } = useUbloContext();
10
- if (resortAccess === undefined) {
11
- return (_jsx("div", { ref: ref, className: css.loader, "data-tags": t(lang, "road-conditions.navigation-title"), children: _jsx(Loader, { variant: "overlay" }) }));
12
- }
13
- if (!resortAccess?.roadConditions?.length) {
14
- return null;
15
- }
16
- const { roadConditions } = resortAccess;
17
- return (_jsxs("div", { ref: ref, className: css.conditions, "data-tags": t(lang, "road-conditions.navigation-title"), children: [_jsx("div", { className: css.title, dangerouslySetInnerHTML: { __html: t(lang, "road-conditions.title") } }), roadConditions.map(({ id, name, status, roadInfo, equipment, surface, number }) => {
18
- const roadInfoData = roadInfo?.data?.find(({ language }) => {
19
- const _lang = lang === "fr" ? "fr_FR" : "en_US";
20
- return language === _lang;
21
- });
22
- const hasValidNumber = !isNaN(parseInt(number, 10)) && number !== "0";
23
- return (_jsxs("div", { className: css.condition, children: [_jsx(RoadConditionIcon, { className: css.icon }), _jsxs("div", { className: css.right, children: [_jsxs("div", { className: css.status, children: [_jsx(T, { id: "road-conditions.road" }), " ", _jsx(T, { id: `road-conditions.status.${status ? "OPENED" : "CLOSED"}` })] }), _jsxs("div", { className: css.top, children: [name?.trim() && (_jsxs("div", { className: css.name, children: [name, " ", hasValidNumber && _jsxs(_Fragment, { children: ["n\u00B0", number] })] })), surface?.trim() && surface !== "UNDEF" && (_jsxs("div", { className: css.surface, children: [_jsx("b", { children: _jsx(T, { id: "road-conditions.surface.title" }) }), _jsx(T, { id: `road-conditions.surface.states.${surface}` }), "."] })), equipment?.trim() && equipment !== "UNDEF" && (_jsxs("div", { className: css.equipment, children: [_jsx("b", { children: _jsx(T, { id: "road-conditions.equipment.title" }) }), _jsx(T, { id: `road-conditions.equipment.states.${equipment}` })] }))] }), roadInfoData && (_jsx("div", { className: css.bottom, dangerouslySetInnerHTML: { __html: roadInfoData.data } }))] })] }, id));
24
- })] }));
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
10
+ const RoadCondition = React.forwardRef(({
11
+ resortAccess
12
+ }, ref) => {
13
+ const {
14
+ lang
15
+ } = useUbloContext();
16
+ if (resortAccess === undefined) {
17
+ return _jsx("div", {
18
+ ref: ref,
19
+ className: css.loader,
20
+ "data-tags": t(lang, "road-conditions.navigation-title"),
21
+ children: _jsx(Loader, {
22
+ variant: "overlay"
23
+ })
24
+ });
25
+ }
26
+ if (!resortAccess?.roadConditions?.length) {
27
+ return null;
28
+ }
29
+ const {
30
+ roadConditions
31
+ } = resortAccess;
32
+ return _jsxs("div", {
33
+ ref: ref,
34
+ className: css.conditions,
35
+ "data-tags": t(lang, "road-conditions.navigation-title"),
36
+ children: [_jsx("div", {
37
+ className: css.title,
38
+ dangerouslySetInnerHTML: {
39
+ __html: t(lang, "road-conditions.title")
40
+ }
41
+ }), roadConditions.map(({
42
+ id,
43
+ name,
44
+ status,
45
+ roadInfo,
46
+ equipment,
47
+ surface,
48
+ number
49
+ }) => {
50
+ const roadInfoData = roadInfo?.data?.find(({
51
+ language
52
+ }) => {
53
+ const _lang = lang === "fr" ? "fr_FR" : "en_US";
54
+ return language === _lang;
55
+ });
56
+ const hasValidNumber = !isNaN(parseInt(number, 10)) && number !== "0";
57
+ return _jsxs("div", {
58
+ className: css.condition,
59
+ children: [_jsx(RoadConditionIcon, {
60
+ className: css.icon
61
+ }), _jsxs("div", {
62
+ className: css.right,
63
+ children: [_jsxs("div", {
64
+ className: css.status,
65
+ children: [_jsx(T, {
66
+ id: "road-conditions.road"
67
+ }), " ", _jsx(T, {
68
+ id: `road-conditions.status.${status ? "OPENED" : "CLOSED"}`
69
+ })]
70
+ }), _jsxs("div", {
71
+ className: css.top,
72
+ children: [name?.trim() && _jsxs("div", {
73
+ className: css.name,
74
+ children: [name, " ", hasValidNumber && _jsxs(_Fragment, {
75
+ children: ["n\xB0", number]
76
+ })]
77
+ }), surface?.trim() && surface !== "UNDEF" && _jsxs("div", {
78
+ className: css.surface,
79
+ children: [_jsx("b", {
80
+ children: _jsx(T, {
81
+ id: "road-conditions.surface.title"
82
+ })
83
+ }), _jsx(T, {
84
+ id: `road-conditions.surface.states.${surface}`
85
+ }), "."]
86
+ }), equipment?.trim() && equipment !== "UNDEF" && _jsxs("div", {
87
+ className: css.equipment,
88
+ children: [_jsx("b", {
89
+ children: _jsx(T, {
90
+ id: "road-conditions.equipment.title"
91
+ })
92
+ }), _jsx(T, {
93
+ id: `road-conditions.equipment.states.${equipment}`
94
+ })]
95
+ })]
96
+ }), roadInfoData && _jsx("div", {
97
+ className: css.bottom,
98
+ dangerouslySetInnerHTML: {
99
+ __html: roadInfoData.data
100
+ }
101
+ })]
102
+ })]
103
+ }, id);
104
+ })]
105
+ });
25
106
  });
26
107
  RoadCondition.displayName = "RoadCondition";
27
- export default RoadCondition;
108
+ export default RoadCondition;
@@ -1,23 +1,52 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import * as React from "react";
3
2
  import { useUbloContext } from "ublo/with-ublo";
4
3
  import Loader from "dt-design-system/es/loader";
5
4
  import { t } from "./i18n/translations";
6
5
  import css from "./todays-tips.module.css";
7
- const TodaysTips = React.forwardRef(({ resortOpening }, ref) => {
8
- const { lang } = useUbloContext();
9
- const todaysTips = resortOpening?.resortInfos?.find(({ type }) => type === "RESORT_TIP_OF_THE_DAY");
10
- if (todaysTips === undefined) {
11
- return (_jsx("div", { ref: ref, className: css.loader, children: _jsx(Loader, { variant: "overlay" }) }));
12
- }
13
- if (!todaysTips) {
14
- return null;
15
- }
16
- const text = todaysTips.data.find(({ language }) => language === "fr_FR");
17
- if (!text?.data) {
18
- return null;
19
- }
20
- return (_jsxs("div", { ref: ref, className: css.tips, children: [_jsx("div", { className: css.title, dangerouslySetInnerHTML: { __html: t(lang, "todays-tips.title") } }), _jsx("div", { className: css.text, dangerouslySetInnerHTML: { __html: text.data } })] }));
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ const TodaysTips = React.forwardRef(({
9
+ resortOpening
10
+ }, ref) => {
11
+ const {
12
+ lang
13
+ } = useUbloContext();
14
+ const todaysTips = resortOpening?.resortInfos?.find(({
15
+ type
16
+ }) => type === "RESORT_TIP_OF_THE_DAY");
17
+ if (todaysTips === undefined) {
18
+ return _jsx("div", {
19
+ ref: ref,
20
+ className: css.loader,
21
+ children: _jsx(Loader, {
22
+ variant: "overlay"
23
+ })
24
+ });
25
+ }
26
+ if (!todaysTips) {
27
+ return null;
28
+ }
29
+ const text = todaysTips.data.find(({
30
+ language
31
+ }) => language === "fr_FR");
32
+ if (!text?.data) {
33
+ return null;
34
+ }
35
+ return _jsxs("div", {
36
+ ref: ref,
37
+ className: css.tips,
38
+ children: [_jsx("div", {
39
+ className: css.title,
40
+ dangerouslySetInnerHTML: {
41
+ __html: t(lang, "todays-tips.title")
42
+ }
43
+ }), _jsx("div", {
44
+ className: css.text,
45
+ dangerouslySetInnerHTML: {
46
+ __html: text.data
47
+ }
48
+ })]
49
+ });
21
50
  });
22
51
  TodaysTips.displayName = "TodaysTips";
23
- export default TodaysTips;
52
+ export default TodaysTips;
@@ -1 +1 @@
1
- export {};
1
+ export {};
@@ -1,12 +1,37 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import * as React from "react";
2
2
  import Image from "next/image";
3
3
  import getConfig from "next/config";
4
4
  import T from "../i18n/translations";
5
5
  import css from "./avalanche-risk.module.css";
6
- const { publicRuntimeConfig } = getConfig();
7
- const { lumiplanApi } = publicRuntimeConfig;
8
- export default function AvalancheRisk({ avalancheRisk }) {
9
- if (!avalancheRisk || avalancheRisk === "UNDEF")
10
- return null;
11
- return (_jsxs("div", { className: css.avalancheRisk, children: [_jsx("b", { children: _jsx(T, { id: "weather.avalanche-risk.title" }) }), _jsxs("span", { children: [_jsx(Image, { src: `${lumiplanApi}/avalanche/${avalancheRisk}.svg`, width: 20, height: 20, alt: "" }), _jsx("span", { children: _jsx(T, { id: `weather.avalanche-risk.states.${avalancheRisk}` }) })] })] }));
12
- }
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ const {
9
+ publicRuntimeConfig
10
+ } = getConfig();
11
+ const {
12
+ lumiplanApi
13
+ } = publicRuntimeConfig;
14
+ export default function AvalancheRisk({
15
+ avalancheRisk
16
+ }) {
17
+ if (!avalancheRisk || avalancheRisk === "UNDEF") return null;
18
+ return _jsxs("div", {
19
+ className: css.avalancheRisk,
20
+ children: [_jsx("b", {
21
+ children: _jsx(T, {
22
+ id: "weather.avalanche-risk.title"
23
+ })
24
+ }), _jsxs("span", {
25
+ children: [_jsx(Image, {
26
+ src: `${lumiplanApi}/avalanche/${avalancheRisk}.svg`,
27
+ width: 20,
28
+ height: 20,
29
+ alt: ""
30
+ }), _jsx("span", {
31
+ children: _jsx(T, {
32
+ id: `weather.avalanche-risk.states.${avalancheRisk}`
33
+ })
34
+ })]
35
+ })]
36
+ });
37
+ }
@@ -1,2 +1,2 @@
1
1
  import Weather from "./weather";
2
- export default Weather;
2
+ export default Weather;
@@ -1,8 +1,74 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
1
+ import * as React from "react";
2
2
  import T from "../i18n/translations";
3
3
  import SnowCover from "../icons/snow-cover";
4
4
  import css from "./snow-data.module.css";
5
- export default function SnowData({ data, expanded }) {
6
- const { snowQuality, snowTotalDepth, freshSnowFallDepth12H, freshSnowFallDepth24H, freshSnowFallDepth48H, freshSnowFallDepth72H, } = data;
7
- return (_jsxs("div", { className: css.snow, children: [_jsx(SnowCover, { className: css.snowIcon }), _jsxs("div", { className: css.snowInfo, children: [_jsxs("div", { className: css.snowState, children: [_jsx(T, { id: "snow.snow-quality.title" }), " ", snowQuality && snowQuality !== "UNDEF" && (_jsxs(_Fragment, { children: [": ", _jsx(T, { id: `snow.snow-quality.states.${snowQuality}` })] }))] }), _jsxs("div", { className: css.snowDepth, children: [snowTotalDepth?.value || 0, _jsx(T, { id: snowTotalDepth?.unit || "CENTIMETER" })] }), expanded && (_jsxs("div", { className: css.expanded, children: [freshSnowFallDepth12H && freshSnowFallDepth12H.value !== 0 && (_jsxs("div", { className: css.snowFall, children: [_jsx(T, { id: "snow.fresh-snow-fall" }), " 12h :", " ", freshSnowFallDepth12H.value, _jsx(T, { id: freshSnowFallDepth12H.unit })] })), freshSnowFallDepth24H && freshSnowFallDepth24H.value !== 0 && (_jsxs("div", { className: css.snowFall, children: [_jsx(T, { id: "snow.fresh-snow-fall" }), " 24h :", " ", freshSnowFallDepth24H.value, _jsx(T, { id: freshSnowFallDepth24H.unit })] })), freshSnowFallDepth48H && freshSnowFallDepth48H.value !== 0 && (_jsxs("div", { className: css.snowFall, children: [_jsx(T, { id: "snow.fresh-snow-fall" }), " 48h :", " ", freshSnowFallDepth48H.value, _jsx(T, { id: freshSnowFallDepth48H.unit })] })), freshSnowFallDepth72H && freshSnowFallDepth72H.value !== 0 && (_jsxs("div", { className: css.snowFall, children: [_jsx(T, { id: "snow.fresh-snow-fall" }), " 72h :", " ", freshSnowFallDepth72H.value, _jsx(T, { id: freshSnowFallDepth72H.unit })] }))] }))] })] }));
8
- }
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { Fragment as _Fragment } from "react/jsx-runtime";
7
+ import { jsxs as _jsxs } from "react/jsx-runtime";
8
+ export default function SnowData({
9
+ data,
10
+ expanded
11
+ }) {
12
+ const {
13
+ snowQuality,
14
+ snowTotalDepth,
15
+ freshSnowFallDepth12H,
16
+ freshSnowFallDepth24H,
17
+ freshSnowFallDepth48H,
18
+ freshSnowFallDepth72H
19
+ } = data;
20
+ return _jsxs("div", {
21
+ className: css.snow,
22
+ children: [_jsx(SnowCover, {
23
+ className: css.snowIcon
24
+ }), _jsxs("div", {
25
+ className: css.snowInfo,
26
+ children: [_jsxs("div", {
27
+ className: css.snowState,
28
+ children: [_jsx(T, {
29
+ id: "snow.snow-quality.title"
30
+ }), " ", snowQuality && snowQuality !== "UNDEF" && _jsxs(_Fragment, {
31
+ children: [": ", _jsx(T, {
32
+ id: `snow.snow-quality.states.${snowQuality}`
33
+ })]
34
+ })]
35
+ }), _jsxs("div", {
36
+ className: css.snowDepth,
37
+ children: [snowTotalDepth?.value || 0, _jsx(T, {
38
+ id: snowTotalDepth?.unit || "CENTIMETER"
39
+ })]
40
+ }), expanded && _jsxs("div", {
41
+ className: css.expanded,
42
+ children: [freshSnowFallDepth12H && freshSnowFallDepth12H.value !== 0 && _jsxs("div", {
43
+ className: css.snowFall,
44
+ children: [_jsx(T, {
45
+ id: "snow.fresh-snow-fall"
46
+ }), " 12h :", " ", freshSnowFallDepth12H.value, _jsx(T, {
47
+ id: freshSnowFallDepth12H.unit
48
+ })]
49
+ }), freshSnowFallDepth24H && freshSnowFallDepth24H.value !== 0 && _jsxs("div", {
50
+ className: css.snowFall,
51
+ children: [_jsx(T, {
52
+ id: "snow.fresh-snow-fall"
53
+ }), " 24h :", " ", freshSnowFallDepth24H.value, _jsx(T, {
54
+ id: freshSnowFallDepth24H.unit
55
+ })]
56
+ }), freshSnowFallDepth48H && freshSnowFallDepth48H.value !== 0 && _jsxs("div", {
57
+ className: css.snowFall,
58
+ children: [_jsx(T, {
59
+ id: "snow.fresh-snow-fall"
60
+ }), " 48h :", " ", freshSnowFallDepth48H.value, _jsx(T, {
61
+ id: freshSnowFallDepth48H.unit
62
+ })]
63
+ }), freshSnowFallDepth72H && freshSnowFallDepth72H.value !== 0 && _jsxs("div", {
64
+ className: css.snowFall,
65
+ children: [_jsx(T, {
66
+ id: "snow.fresh-snow-fall"
67
+ }), " 72h :", " ", freshSnowFallDepth72H.value, _jsx(T, {
68
+ id: freshSnowFallDepth72H.unit
69
+ })]
70
+ })]
71
+ })]
72
+ })]
73
+ });
74
+ }
@@ -1,10 +1,129 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import * as React from "react";
2
2
  import T from "../i18n/translations";
3
3
  import WeatherIcon from "./weather-icon";
4
4
  import css from "./weather-data.module.css";
5
- export default function WeatherData({ kind, data, expanded }) {
6
- if (!data)
7
- return null;
8
- const { skyStatus, temperature, windchill, indexUv, limitIsothermic0, limitIsothermicMinus10, limitRainSnowFall, visibility, wind, } = data;
9
- return (_jsxs("div", { className: css.weatherData, children: [_jsx(WeatherIcon, { sky: skyStatus }), _jsxs("div", { className: css.weatherInfo, children: [_jsx("div", { className: css.weatherInfoTitle, children: _jsx(T, { id: `weather.${kind}` }) }), _jsxs("div", { className: css.weatherInfoTemperatures, children: [_jsxs("span", { children: [temperature.value, _jsx(T, { id: temperature.unit })] }), "|", _jsxs("span", { children: [windchill.value, _jsx(T, { id: windchill.unit }), _jsx("em", { children: _jsx(T, { id: "weather.feels-like" }) })] })] }), expanded && (_jsxs("div", { className: css.expanded, children: [skyStatus && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.sky-status.title" }), " :", " ", _jsx(T, { id: `weather.sky-status.states.${skyStatus}` })] })), temperature && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.temperature" }), " : ", temperature.value, _jsx(T, { id: temperature.unit })] })), wind && (_jsxs(_Fragment, { children: [wind.value && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.wind" }), " : ", wind.value.value, _jsx(T, { id: wind.value.unit })] })), wind.valueMax && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.wind-max" }), " : ", wind.valueMax.value, _jsx(T, { id: wind.valueMax.unit })] })), wind.direction && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.wind-direction.title" }), " :", " ", _jsx(T, { id: `weather.wind-direction.states.${wind.direction}` })] }))] })), limitRainSnowFall && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.limit-rain-snow-fall" }), " :", " ", limitRainSnowFall.value, _jsx(T, { id: limitRainSnowFall.unit })] })), limitIsothermic0 && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.limit-isothermic-0" }), " : ", limitIsothermic0.value, _jsx(T, { id: limitIsothermic0.unit })] })), limitIsothermicMinus10 && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.limit-isothermic-minus-10" }), " :", " ", limitIsothermicMinus10.value, _jsx(T, { id: limitIsothermicMinus10.unit })] })), visibility && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.visibility.title" }), " :", " ", _jsx(T, { id: `weather.visibility.states.${visibility}` })] })), indexUv && (_jsxs("div", { className: css.data, children: [_jsx(T, { id: "weather.index-uv" }), " : ", indexUv.value, _jsx(T, { id: indexUv.unit })] }))] }))] })] }));
10
- }
5
+ import { jsx as _jsx } from "react/jsx-runtime";
6
+ import { jsxs as _jsxs } from "react/jsx-runtime";
7
+ import { Fragment as _Fragment } from "react/jsx-runtime";
8
+ export default function WeatherData({
9
+ kind,
10
+ data,
11
+ expanded
12
+ }) {
13
+ if (!data) return null;
14
+ const {
15
+ skyStatus,
16
+ temperature,
17
+ windchill,
18
+ indexUv,
19
+ limitIsothermic0,
20
+ limitIsothermicMinus10,
21
+ limitRainSnowFall,
22
+ visibility,
23
+ wind
24
+ } = data;
25
+ return _jsxs("div", {
26
+ className: css.weatherData,
27
+ children: [_jsx(WeatherIcon, {
28
+ sky: skyStatus
29
+ }), _jsxs("div", {
30
+ className: css.weatherInfo,
31
+ children: [_jsx("div", {
32
+ className: css.weatherInfoTitle,
33
+ children: _jsx(T, {
34
+ id: `weather.${kind}`
35
+ })
36
+ }), _jsxs("div", {
37
+ className: css.weatherInfoTemperatures,
38
+ children: [_jsxs("span", {
39
+ children: [temperature.value, _jsx(T, {
40
+ id: temperature.unit
41
+ })]
42
+ }), "|", _jsxs("span", {
43
+ children: [windchill.value, _jsx(T, {
44
+ id: windchill.unit
45
+ }), _jsx("em", {
46
+ children: _jsx(T, {
47
+ id: "weather.feels-like"
48
+ })
49
+ })]
50
+ })]
51
+ }), expanded && _jsxs("div", {
52
+ className: css.expanded,
53
+ children: [skyStatus && _jsxs("div", {
54
+ className: css.data,
55
+ children: [_jsx(T, {
56
+ id: "weather.sky-status.title"
57
+ }), " :", " ", _jsx(T, {
58
+ id: `weather.sky-status.states.${skyStatus}`
59
+ })]
60
+ }), temperature && _jsxs("div", {
61
+ className: css.data,
62
+ children: [_jsx(T, {
63
+ id: "weather.temperature"
64
+ }), " : ", temperature.value, _jsx(T, {
65
+ id: temperature.unit
66
+ })]
67
+ }), wind && _jsxs(_Fragment, {
68
+ children: [wind.value && _jsxs("div", {
69
+ className: css.data,
70
+ children: [_jsx(T, {
71
+ id: "weather.wind"
72
+ }), " : ", wind.value.value, _jsx(T, {
73
+ id: wind.value.unit
74
+ })]
75
+ }), wind.valueMax && _jsxs("div", {
76
+ className: css.data,
77
+ children: [_jsx(T, {
78
+ id: "weather.wind-max"
79
+ }), " : ", wind.valueMax.value, _jsx(T, {
80
+ id: wind.valueMax.unit
81
+ })]
82
+ }), wind.direction && _jsxs("div", {
83
+ className: css.data,
84
+ children: [_jsx(T, {
85
+ id: "weather.wind-direction.title"
86
+ }), " :", " ", _jsx(T, {
87
+ id: `weather.wind-direction.states.${wind.direction}`
88
+ })]
89
+ })]
90
+ }), limitRainSnowFall && _jsxs("div", {
91
+ className: css.data,
92
+ children: [_jsx(T, {
93
+ id: "weather.limit-rain-snow-fall"
94
+ }), " :", " ", limitRainSnowFall.value, _jsx(T, {
95
+ id: limitRainSnowFall.unit
96
+ })]
97
+ }), limitIsothermic0 && _jsxs("div", {
98
+ className: css.data,
99
+ children: [_jsx(T, {
100
+ id: "weather.limit-isothermic-0"
101
+ }), " : ", limitIsothermic0.value, _jsx(T, {
102
+ id: limitIsothermic0.unit
103
+ })]
104
+ }), limitIsothermicMinus10 && _jsxs("div", {
105
+ className: css.data,
106
+ children: [_jsx(T, {
107
+ id: "weather.limit-isothermic-minus-10"
108
+ }), " :", " ", limitIsothermicMinus10.value, _jsx(T, {
109
+ id: limitIsothermicMinus10.unit
110
+ })]
111
+ }), visibility && _jsxs("div", {
112
+ className: css.data,
113
+ children: [_jsx(T, {
114
+ id: "weather.visibility.title"
115
+ }), " :", " ", _jsx(T, {
116
+ id: `weather.visibility.states.${visibility}`
117
+ })]
118
+ }), indexUv && _jsxs("div", {
119
+ className: css.data,
120
+ children: [_jsx(T, {
121
+ id: "weather.index-uv"
122
+ }), " : ", indexUv.value, _jsx(T, {
123
+ id: indexUv.unit
124
+ })]
125
+ })]
126
+ })]
127
+ })]
128
+ });
129
+ }
@@ -1,54 +1,82 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
1
  import * as React from "react";
3
2
  import classNames from "classnames";
4
3
  import Button from "dt-design-system/es/button";
5
4
  import T from "../i18n/translations";
6
- // import useWindowSizes from "ublo-lib/es/common/hooks/use-window-sizes";
7
5
  import useWindowSizes from "../../../../common/hooks/use-window-sizes";
8
6
  import css from "./weather-days.module.css";
9
- export default function Days({ days, currentDayIndex, setCurrentDayIndex, lang, }) {
10
- const [showLeftShadow, setShowLeftShadow] = React.useState(false);
11
- const [showRightShadow, setShowRightShadow] = React.useState(false);
12
- const containerRef = React.useRef(null);
13
- const scrollerRef = React.useRef(null);
14
- const { width, height } = useWindowSizes();
15
- const refreshShadows = React.useCallback(() => {
16
- const container = containerRef.current;
17
- const scroller = scrollerRef.current;
18
- if (container && scroller) {
19
- setShowLeftShadow(scroller.scrollLeft > 50);
20
- const maxScroll = Math.round(scroller.scrollWidth) - Math.round(scroller.clientWidth);
21
- setShowRightShadow(scroller.scrollLeft < maxScroll - 50);
22
- }
23
- }, []);
24
- React.useEffect(() => {
25
- refreshShadows();
26
- }, [refreshShadows, width, height]);
27
- const daysClasses = classNames(css.days, {
28
- [css.leftShadow]: showLeftShadow,
29
- [css.rightShadow]: showRightShadow,
30
- });
31
- return (_jsx("div", { ref: containerRef, className: daysClasses, children: _jsx("div", { ref: scrollerRef, onScroll: refreshShadows, className: css.content, children: days.map((day, i) => {
32
- const { date, am, pm } = day;
33
- if (!pm || !am)
34
- return null;
35
- const isSelected = i === currentDayIndex;
36
- const updateCurrentDay = () => {
37
- setCurrentDayIndex(i);
38
- };
39
- const isToday = new Date(date).getDate() === new Date().getDate();
40
- const locale = lang === "fr" ? "fr-FR" : "en-UK";
41
- const today = new Date(date).toLocaleDateString(locale, {
42
- weekday: "long",
43
- });
44
- const formatedDate = new Date(date).toLocaleDateString(locale, {
45
- day: "2-digit",
46
- month: "2-digit",
47
- year: "numeric",
48
- });
49
- const classes = classNames(css.day, {
50
- [css.daySelected]: isSelected,
51
- });
52
- return (_jsxs(Button, { className: classes, onClick: updateCurrentDay, children: [_jsx("b", { children: isToday ? _jsx(T, { id: "weather.today" }) : today }), formatedDate] }, date));
53
- }) }) }));
54
- }
7
+ import { jsx as _jsx } from "react/jsx-runtime";
8
+ import { jsxs as _jsxs } from "react/jsx-runtime";
9
+ export default function Days({
10
+ days,
11
+ currentDayIndex,
12
+ setCurrentDayIndex,
13
+ lang
14
+ }) {
15
+ const [showLeftShadow, setShowLeftShadow] = React.useState(false);
16
+ const [showRightShadow, setShowRightShadow] = React.useState(false);
17
+ const containerRef = React.useRef(null);
18
+ const scrollerRef = React.useRef(null);
19
+ const {
20
+ width,
21
+ height
22
+ } = useWindowSizes();
23
+ const refreshShadows = React.useCallback(() => {
24
+ const container = containerRef.current;
25
+ const scroller = scrollerRef.current;
26
+ if (container && scroller) {
27
+ setShowLeftShadow(scroller.scrollLeft > 50);
28
+ const maxScroll = Math.round(scroller.scrollWidth) - Math.round(scroller.clientWidth);
29
+ setShowRightShadow(scroller.scrollLeft < maxScroll - 50);
30
+ }
31
+ }, []);
32
+ React.useEffect(() => {
33
+ refreshShadows();
34
+ }, [refreshShadows, width, height]);
35
+ const daysClasses = classNames(css.days, {
36
+ [css.leftShadow]: showLeftShadow,
37
+ [css.rightShadow]: showRightShadow
38
+ });
39
+ return _jsx("div", {
40
+ ref: containerRef,
41
+ className: daysClasses,
42
+ children: _jsx("div", {
43
+ ref: scrollerRef,
44
+ onScroll: refreshShadows,
45
+ className: css.content,
46
+ children: days.map((day, i) => {
47
+ const {
48
+ date,
49
+ am,
50
+ pm
51
+ } = day;
52
+ if (!pm || !am) return null;
53
+ const isSelected = i === currentDayIndex;
54
+ const updateCurrentDay = () => {
55
+ setCurrentDayIndex(i);
56
+ };
57
+ const isToday = new Date(date).getDate() === new Date().getDate();
58
+ const locale = lang === "fr" ? "fr-FR" : "en-UK";
59
+ const today = new Date(date).toLocaleDateString(locale, {
60
+ weekday: "long"
61
+ });
62
+ const formatedDate = new Date(date).toLocaleDateString(locale, {
63
+ day: "2-digit",
64
+ month: "2-digit",
65
+ year: "numeric"
66
+ });
67
+ const classes = classNames(css.day, {
68
+ [css.daySelected]: isSelected
69
+ });
70
+ return _jsxs(Button, {
71
+ className: classes,
72
+ onClick: updateCurrentDay,
73
+ children: [_jsx("b", {
74
+ children: isToday ? _jsx(T, {
75
+ id: "weather.today"
76
+ }) : today
77
+ }), formatedDate]
78
+ }, date);
79
+ })
80
+ })
81
+ });
82
+ }