ublo-lib 1.35.19 → 1.36.1

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 (122) hide show
  1. package/es/common/components/msem-preset-linker/hooks/use-msem-presets.d.ts.map +1 -1
  2. package/es/common/components/msem-preset-linker/hooks/use-msem-presets.js +3 -2
  3. package/es/common/components/scrolling-carousel/scrolling-carousel.module.css +4 -0
  4. package/es/lbm/components/instant-search/facet-switch.d.ts +8 -0
  5. package/es/lbm/components/instant-search/facet-switch.d.ts.map +1 -0
  6. package/es/lbm/components/instant-search/facet-switch.js +15 -0
  7. package/es/lbm/components/instant-search/facet-switch.module.css +19 -0
  8. package/es/lbm/components/instant-search/faqs.d.ts +12 -0
  9. package/es/lbm/components/instant-search/faqs.d.ts.map +1 -0
  10. package/es/lbm/components/instant-search/faqs.js +44 -0
  11. package/es/lbm/components/instant-search/faqs.module.css +102 -0
  12. package/es/lbm/components/instant-search/hooks/use-constant.d.ts +2 -0
  13. package/es/lbm/components/instant-search/hooks/use-constant.d.ts.map +1 -0
  14. package/es/lbm/components/instant-search/hooks/use-constant.js +8 -0
  15. package/es/lbm/components/instant-search/hooks/use-debounced-search.d.ts +11 -0
  16. package/es/lbm/components/instant-search/hooks/use-debounced-search.d.ts.map +1 -0
  17. package/es/lbm/components/instant-search/hooks/use-debounced-search.js +12 -0
  18. package/es/lbm/components/instant-search/hooks/use-search.d.ts +17 -0
  19. package/es/lbm/components/instant-search/hooks/use-search.d.ts.map +1 -0
  20. package/es/lbm/components/instant-search/hooks/use-search.js +10 -0
  21. package/es/lbm/components/instant-search/i18n.json +32 -0
  22. package/es/lbm/components/instant-search/index.d.ts +3 -0
  23. package/es/lbm/components/instant-search/index.d.ts.map +1 -0
  24. package/es/lbm/components/instant-search/index.js +2 -0
  25. package/es/lbm/components/instant-search/instant-search.d.ts +19 -0
  26. package/es/lbm/components/instant-search/instant-search.d.ts.map +1 -0
  27. package/es/lbm/components/instant-search/instant-search.js +64 -0
  28. package/es/lbm/components/instant-search/instant-search.module.css +8 -0
  29. package/es/lbm/components/instant-search/links.d.ts +12 -0
  30. package/es/lbm/components/instant-search/links.d.ts.map +1 -0
  31. package/es/lbm/components/instant-search/links.js +30 -0
  32. package/es/lbm/components/instant-search/links.module.css +96 -0
  33. package/es/lbm/components/instant-search/no-product.d.ts +6 -0
  34. package/es/lbm/components/instant-search/no-product.d.ts.map +1 -0
  35. package/es/lbm/components/instant-search/no-product.js +4 -0
  36. package/es/lbm/components/instant-search/products.d.ts +14 -0
  37. package/es/lbm/components/instant-search/products.d.ts.map +1 -0
  38. package/es/lbm/components/instant-search/products.js +47 -0
  39. package/es/lbm/components/instant-search/products.module.css +163 -0
  40. package/es/lbm/components/instant-search/results.d.ts +79 -0
  41. package/es/lbm/components/instant-search/results.d.ts.map +1 -0
  42. package/es/lbm/components/instant-search/results.js +34 -0
  43. package/es/lbm/components/instant-search/results.module.css +85 -0
  44. package/es/lbm/components/instant-search/search-input.d.ts +15 -0
  45. package/es/lbm/components/instant-search/search-input.d.ts.map +1 -0
  46. package/es/lbm/components/instant-search/search-input.js +56 -0
  47. package/es/lbm/components/instant-search/search-input.module.css +88 -0
  48. package/es/lbm/components/instant-search/services/api.d.ts +2 -0
  49. package/es/lbm/components/instant-search/services/api.d.ts.map +1 -0
  50. package/es/lbm/components/instant-search/services/api.js +22 -0
  51. package/es/lbm/components/instant-search/services/lumiplan-api.d.ts +9 -0
  52. package/es/lbm/components/instant-search/services/lumiplan-api.d.ts.map +1 -0
  53. package/es/lbm/components/instant-search/services/lumiplan-api.js +37 -0
  54. package/es/lbm/components/instant-search/services/messages.d.ts +2 -0
  55. package/es/lbm/components/instant-search/services/messages.d.ts.map +1 -0
  56. package/es/lbm/components/instant-search/services/messages.js +5 -0
  57. package/es/lbm/components/instant-search/services/utils.d.ts +4 -0
  58. package/es/lbm/components/instant-search/services/utils.d.ts.map +1 -0
  59. package/es/lbm/components/instant-search/services/utils.js +28 -0
  60. package/es/lbm/components/instant-search/widgets/access.d.ts +8 -0
  61. package/es/lbm/components/instant-search/widgets/access.d.ts.map +1 -0
  62. package/es/lbm/components/instant-search/widgets/access.js +29 -0
  63. package/es/lbm/components/instant-search/widgets/activity.d.ts +8 -0
  64. package/es/lbm/components/instant-search/widgets/activity.d.ts.map +1 -0
  65. package/es/lbm/components/instant-search/widgets/activity.js +74 -0
  66. package/es/lbm/components/instant-search/widgets/activity.module.css +6 -0
  67. package/es/lbm/components/instant-search/widgets/components/card.d.ts +11 -0
  68. package/es/lbm/components/instant-search/widgets/components/card.d.ts.map +1 -0
  69. package/es/lbm/components/instant-search/widgets/components/card.js +15 -0
  70. package/es/lbm/components/instant-search/widgets/components/card.module.css +60 -0
  71. package/es/lbm/components/instant-search/widgets/components/metric.d.ts +8 -0
  72. package/es/lbm/components/instant-search/widgets/components/metric.d.ts.map +1 -0
  73. package/es/lbm/components/instant-search/widgets/components/metric.js +6 -0
  74. package/es/lbm/components/instant-search/widgets/components/metric.module.css +12 -0
  75. package/es/lbm/components/instant-search/widgets/components/status-with-icon.d.ts +9 -0
  76. package/es/lbm/components/instant-search/widgets/components/status-with-icon.d.ts.map +1 -0
  77. package/es/lbm/components/instant-search/widgets/components/status-with-icon.js +5 -0
  78. package/es/lbm/components/instant-search/widgets/components/status-with-icon.module.css +12 -0
  79. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts +9 -0
  80. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts.map +1 -0
  81. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.js +37 -0
  82. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.module.css +33 -0
  83. package/es/lbm/components/instant-search/widgets/lift.d.ts +8 -0
  84. package/es/lbm/components/instant-search/widgets/lift.d.ts.map +1 -0
  85. package/es/lbm/components/instant-search/widgets/lift.js +52 -0
  86. package/es/lbm/components/instant-search/widgets/lift.module.css +6 -0
  87. package/es/lbm/components/instant-search/widgets/lifts.d.ts +8 -0
  88. package/es/lbm/components/instant-search/widgets/lifts.d.ts.map +1 -0
  89. package/es/lbm/components/instant-search/widgets/lifts.js +26 -0
  90. package/es/lbm/components/instant-search/widgets/msem-widget.d.ts +8 -0
  91. package/es/lbm/components/instant-search/widgets/msem-widget.d.ts.map +1 -0
  92. package/es/lbm/components/instant-search/widgets/msem-widget.js +31 -0
  93. package/es/lbm/components/instant-search/widgets/msem-widget.module.css +51 -0
  94. package/es/lbm/components/instant-search/widgets/openings.d.ts +8 -0
  95. package/es/lbm/components/instant-search/widgets/openings.d.ts.map +1 -0
  96. package/es/lbm/components/instant-search/widgets/openings.js +32 -0
  97. package/es/lbm/components/instant-search/widgets/slope.d.ts +8 -0
  98. package/es/lbm/components/instant-search/widgets/slope.d.ts.map +1 -0
  99. package/es/lbm/components/instant-search/widgets/slope.js +73 -0
  100. package/es/lbm/components/instant-search/widgets/slope.module.css +26 -0
  101. package/es/lbm/components/instant-search/widgets/slopes.d.ts +8 -0
  102. package/es/lbm/components/instant-search/widgets/slopes.d.ts.map +1 -0
  103. package/es/lbm/components/instant-search/widgets/slopes.js +26 -0
  104. package/es/lbm/components/instant-search/widgets/snow.d.ts +9 -0
  105. package/es/lbm/components/instant-search/widgets/snow.d.ts.map +1 -0
  106. package/es/lbm/components/instant-search/widgets/snow.js +25 -0
  107. package/es/lbm/components/instant-search/widgets/types.d.ts +27 -0
  108. package/es/lbm/components/instant-search/widgets/types.d.ts.map +1 -0
  109. package/es/lbm/components/instant-search/widgets/types.js +1 -0
  110. package/es/lbm/components/instant-search/widgets/weather.d.ts +9 -0
  111. package/es/lbm/components/instant-search/widgets/weather.d.ts.map +1 -0
  112. package/es/lbm/components/instant-search/widgets/weather.js +36 -0
  113. package/es/lbm/components/instant-search/widgets/weather.module.css +32 -0
  114. package/es/lbm/components/instant-search/widgets/webcam.d.ts +8 -0
  115. package/es/lbm/components/instant-search/widgets/webcam.d.ts.map +1 -0
  116. package/es/lbm/components/instant-search/widgets/webcam.js +9 -0
  117. package/es/lbm/components/instant-search/widgets/webcam.module.css +13 -0
  118. package/es/lbm/components/instant-search/widgets.d.ts +11 -0
  119. package/es/lbm/components/instant-search/widgets.d.ts.map +1 -0
  120. package/es/lbm/components/instant-search/widgets.js +68 -0
  121. package/es/lbm/components/instant-search/widgets.module.css +14 -0
  122. package/package.json +3 -3
@@ -0,0 +1,51 @@
1
+ .card {
2
+ width: 100%;
3
+ display: flex;
4
+ position: relative;
5
+ height: 75px;
6
+ flex-direction: column;
7
+ gap: 4px;
8
+ justify-content: space-between;
9
+ align-items: center;
10
+ overflow: hidden;
11
+ color: var(--ds-grey-500, #484848);
12
+ background-color: var(--ds-grey-000, #fff);
13
+ border-radius: var(--ds-input-radius, var(--ds-radius-200, 8px));
14
+ border: var(--ds-input-border, 1px solid var(--ds-grey-300, #d7d7d7));
15
+ font-size: 13px;
16
+ }
17
+
18
+ .card mark {
19
+ position: relative;
20
+ display: inline-block;
21
+ font-weight: 700;
22
+ color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
23
+ background-color: transparent;
24
+ }
25
+
26
+ .card mark::before {
27
+ content: "";
28
+ position: absolute;
29
+ top: 0;
30
+ left: 0;
31
+ width: 100%;
32
+ height: 100%;
33
+ background-color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
34
+ border-radius: calc(var(--ds-radius-100, 6px) / 3);
35
+ opacity: 0.15;
36
+ }
37
+
38
+ .iconAndName {
39
+ flex-grow: 1;
40
+ display: flex;
41
+ align-items: center;
42
+ gap: 8px;
43
+ width: 100%;
44
+ }
45
+
46
+ .title {
47
+ font-weight: 700;
48
+ font-size: 13px;
49
+ line-height: 1;
50
+ padding-top: 4px;
51
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Openings: ({ ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Openings;
8
+ //# sourceMappingURL=openings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openings.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/openings.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAWtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,QAAQ,iBAAkB,KAAK,4CAoCpC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Metric from "./components/metric";
6
+ import Loader from "dt-design-system/es/loader";
7
+ const dateOptions = {
8
+ day: "numeric",
9
+ month: "short",
10
+ year: "numeric",
11
+ };
12
+ const Openings = ({ ...props }) => {
13
+ const [openings, setOpenings] = React.useState([]);
14
+ const [loading, setLoading] = React.useState(true);
15
+ React.useEffect(() => {
16
+ const runEffect = async () => {
17
+ setLoading(true);
18
+ const { availability: { openingDate, closingDate }, } = await LumiplanApi.fetchResortOpening();
19
+ setOpenings([
20
+ new Date(openingDate).toLocaleDateString("fr", dateOptions),
21
+ new Date(closingDate).toLocaleDateString("fr", dateOptions),
22
+ ]);
23
+ setLoading(false);
24
+ };
25
+ runEffect();
26
+ }, []);
27
+ if (loading) {
28
+ return (_jsx(Card, { ...props, children: _jsx(Loader, { variant: "overlay" }) }));
29
+ }
30
+ return (_jsx(Card, { ...props, children: _jsx(Metric, { long: true, children: openings.map((part, i) => (_jsxs("div", { children: [i === 0 ? "Ouverture" : "Fermeture", " : ", _jsx("b", { children: part })] }, i))) }) }));
31
+ };
32
+ export default Openings;
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Slope: ({ doc, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Slope;
8
+ //# sourceMappingURL=slope.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slope.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/slope.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AA+CtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,KAAK,sBAAuB,KAAK,4CAqCtC,CAAC;AAEF,eAAe,KAAK,CAAC"}
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as TrailIcons from "../../lumiplan/icons/trails";
4
+ import * as LumiplanApi from "../services/lumiplan-api";
5
+ import Card from "./components/card";
6
+ import StatusWithIcon from "./components/status-with-icon";
7
+ import Loader from "dt-design-system/es/loader";
8
+ import css from "./slope.module.css";
9
+ const TRAIL_ICONS = {
10
+ BIKE_PARK: TrailIcons.VTT,
11
+ BOARDERCROSS: TrailIcons.BoarderCross,
12
+ BUMP_TRAIL: TrailIcons.ChampDeBosse,
13
+ COASTER: TrailIcons.LugeSurRail,
14
+ CROSS_COUNTRY_MOUNTAIN_BIKING: TrailIcons.BoarderCross,
15
+ CROSS_COUNTRY_SKIING: TrailIcons.SkiAlpin,
16
+ DOWNHILL_MOUNTAIN_BIKING: TrailIcons.VTT,
17
+ DOWNHILL_SKIING: TrailIcons.SkiAlpin,
18
+ EBIKE: TrailIcons.VTT,
19
+ ENDURO: TrailIcons.VTT,
20
+ FREERIDE_AREA_OFF_PIST: TrailIcons.SkiAlpin,
21
+ FREERIDE_SKI_ITINERARY: TrailIcons.SkiAlpin,
22
+ FUN_ZONE: TrailIcons.Freeride,
23
+ GATE: TrailIcons.Freeride,
24
+ GLADES: TrailIcons.Freeride,
25
+ ILLUMINATED_TRAIL: TrailIcons.PisteEclairee,
26
+ MULTI_USE_TRAIL: TrailIcons.Freeride,
27
+ MTB_ENDURO: TrailIcons.VTT,
28
+ PATH: TrailIcons.Pieton,
29
+ PEDESTRIAN: TrailIcons.Pieton,
30
+ ROUTE_OF_CROSS_COUNTRY: TrailIcons.SkiAlpin,
31
+ SKI_TOURING: TrailIcons.Freeride,
32
+ SLEDDING_HILL: TrailIcons.Luge,
33
+ SNOWPARK: TrailIcons.Snowpark,
34
+ SNOWPARK_LINE: TrailIcons.Snowpark,
35
+ SNOWSHOE: TrailIcons.Raquette,
36
+ SNOWTUBING: TrailIcons.Snowtubing,
37
+ TERRAIN_PARK: TrailIcons.Snowpark,
38
+ TERRAIN_PARK_US: TrailIcons.Snowpark,
39
+ TRAIL_RUNNING: TrailIcons.Pieton,
40
+ TREETOP_ADVENTURE_PARK: TrailIcons.Accrobranche,
41
+ TYROLEAN: TrailIcons.Tyrolienne,
42
+ VIDEO_ZONE: TrailIcons.Freeride,
43
+ UNDEF: TrailIcons.Freeride,
44
+ DEFAULT: TrailIcons.Freeride,
45
+ };
46
+ const Slope = ({ doc, ...props }) => {
47
+ const [pois, setPois] = React.useState([]);
48
+ const [loading, setLoading] = React.useState(true);
49
+ React.useEffect(() => {
50
+ const runEffect = async () => {
51
+ setLoading(true);
52
+ const data = await LumiplanApi.fetchPois();
53
+ setPois(data);
54
+ setLoading(false);
55
+ };
56
+ runEffect();
57
+ }, []);
58
+ if (loading) {
59
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
60
+ }
61
+ const slope = pois
62
+ .flatMap((poi) => poi.trails)
63
+ .filter((slope) => slope !== undefined)
64
+ .find((poi) => poi.name === doc.document.title);
65
+ if (!slope) {
66
+ return null;
67
+ }
68
+ const Icon = TRAIL_ICONS[slope.trailType] || TRAIL_ICONS.DEFAULT;
69
+ const open = slope.openingStatus === "OPEN";
70
+ const label = open ? "Piste Ouverte" : "Piste Fermée";
71
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(StatusWithIcon, { icon: Icon, iconClassName: css[slope.trailLevel], children: _jsx("b", { className: open ? css.green : css.red, children: label }) }) }));
72
+ };
73
+ export default Slope;
@@ -0,0 +1,26 @@
1
+ .GREEN {
2
+ fill: #00a52c;
3
+ line-height: 0;
4
+ }
5
+ .BLUE {
6
+ fill: #0062ae;
7
+ line-height: 0;
8
+ }
9
+ .RED {
10
+ fill: #f4000f;
11
+ line-height: 0;
12
+ }
13
+ .BLACK {
14
+ fill: #000;
15
+ line-height: 0;
16
+ }
17
+ .YELLOW {
18
+ fill: #f9d71c;
19
+ line-height: 0;
20
+ }
21
+ .green {
22
+ color: hsl(var(--green));
23
+ }
24
+ .red {
25
+ color: hsl(var(--red));
26
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Slopes: ({ ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Slopes;
8
+ //# sourceMappingURL=slopes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"slopes.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/slopes.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAKtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,MAAM,iBAAkB,KAAK,4CAkClC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Metric from "./components/metric";
6
+ import Loader from "dt-design-system/es/loader";
7
+ const Slopes = ({ ...props }) => {
8
+ const [nOpen, setNOpen] = React.useState(0);
9
+ const [nTotal, setNTotal] = React.useState(0);
10
+ const [loading, setLoading] = React.useState(true);
11
+ React.useEffect(() => {
12
+ const runEffect = async () => {
13
+ setLoading(true);
14
+ const data = await LumiplanApi.fetchSlopes();
15
+ setNOpen(data.count.open);
16
+ setNTotal(data.count.total);
17
+ setLoading(false);
18
+ };
19
+ runEffect();
20
+ }, []);
21
+ if (loading) {
22
+ return (_jsx(Card, { ...props, children: _jsx(Loader, { variant: "overlay" }) }));
23
+ }
24
+ return (_jsx(Card, { ...props, children: _jsxs(Metric, { children: [_jsx("b", { children: nOpen }), nTotal !== 0 && (_jsxs(_Fragment, { children: ["/", _jsx("b", { children: nTotal })] }))] }) }));
25
+ };
26
+ export default Slopes;
@@ -0,0 +1,9 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ summit?: boolean;
5
+ sendPlausibleGoal: (path: string) => void;
6
+ };
7
+ declare const Snow: ({ doc, summit, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Snow;
9
+ //# sourceMappingURL=snow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"snow.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/snow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAKtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,IAAI,8BAA+B,KAAK,4CA8B7C,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Metric from "./components/metric";
6
+ import Loader from "dt-design-system/es/loader";
7
+ const Snow = ({ doc, summit, ...props }) => {
8
+ const [snow, setSnow] = React.useState(null);
9
+ React.useEffect(() => {
10
+ const runEffect = async () => {
11
+ const { snowZones } = await LumiplanApi.fetchSnow();
12
+ const zoneSnow = snowZones.find((zone) => zone.name === (summit ? "Sommet" : "Station"));
13
+ if (!zoneSnow) {
14
+ return;
15
+ }
16
+ setSnow(zoneSnow.snowTotalDepth);
17
+ };
18
+ runEffect();
19
+ }, [summit]);
20
+ if (!snow) {
21
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
22
+ }
23
+ return (_jsx(Card, { doc: doc, ...props, children: _jsxs(Metric, { children: [snow.value, " ", snow.unit === "CENTIMETER" ? "cm" : snow.unit] }) }));
24
+ };
25
+ export default Snow;
@@ -0,0 +1,27 @@
1
+ export type POI = {
2
+ trails?: {
3
+ name: string;
4
+ trailType: string;
5
+ trailLevel: string;
6
+ openingStatus: string;
7
+ }[];
8
+ lifts?: {
9
+ name: string;
10
+ liftType: string;
11
+ openingStatus: string;
12
+ openingTimesReal: {
13
+ beginTime: string;
14
+ endTime: string;
15
+ }[];
16
+ }[];
17
+ activities?: {
18
+ name: string;
19
+ activityType: string;
20
+ openingStatus: string;
21
+ openingTimesReal: {
22
+ beginTime: string;
23
+ endTime: string;
24
+ }[];
25
+ }[];
26
+ };
27
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,GAAG,GAAG;IAChB,MAAM,CAAC,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;KACvB,EAAE,CAAC;IACJ,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC5D,EAAE,CAAC;IACJ,UAAU,CAAC,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,YAAY,EAAE,MAAM,CAAC;QACrB,aAAa,EAAE,MAAM,CAAC;QACtB,gBAAgB,EAAE;YAAE,SAAS,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAA;SAAE,EAAE,CAAC;KAC5D,EAAE,CAAC;CACL,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ summit?: boolean;
5
+ sendPlausibleGoal: (path: string) => void;
6
+ };
7
+ declare const Weather: ({ doc, summit, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default Weather;
9
+ //# sourceMappingURL=weather.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/weather.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAQtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,CAAC,EAAE,OAAO,CAAC;IAEjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,OAAO,8BAA+B,KAAK,4CA6DhD,CAAC;AAEF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import WeatherIcon from "../../lumiplan/weather/weather-icon";
5
+ import Card from "./components/card";
6
+ import css from "./weather.module.css";
7
+ import Loader from "dt-design-system/es/loader";
8
+ const switchHour = 17;
9
+ const Weather = ({ doc, summit, ...props }) => {
10
+ const [weather, setWeather] = React.useState(null);
11
+ const useTomorrow = new Date().getHours() > switchHour;
12
+ React.useEffect(() => {
13
+ const todayOrTomorrow = new Date();
14
+ if (todayOrTomorrow.getHours() > switchHour) {
15
+ todayOrTomorrow.setDate(todayOrTomorrow.getDate() + 1);
16
+ }
17
+ const runEffect = async () => {
18
+ const { weatherZones } = await LumiplanApi.fetchWeather();
19
+ const zoneWeather = weatherZones.find((zone) => zone.name === (summit ? "Sommet" : "Station"));
20
+ if (!zoneWeather) {
21
+ return;
22
+ }
23
+ setWeather(zoneWeather.weatherInfos.find((info) => info.date === todayOrTomorrow.toISOString().slice(0, 10)));
24
+ };
25
+ runEffect();
26
+ }, [summit]);
27
+ if (!weather) {
28
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
29
+ }
30
+ return (_jsx(Card, { doc: doc, ...props, children: _jsxs("div", { className: css.ampm, children: [weather.am &&
31
+ weather.am.temperature &&
32
+ weather.am.temperature.value && (_jsxs("div", { className: css.column, children: [_jsxs("div", { children: [useTomorrow ? "Demain" : "Ce", " matin"] }), _jsxs("div", { className: css.statusTemp, children: [_jsx(WeatherIcon, { sky: weather.am.skyStatus }), weather.am.temperature.value, "\u00B0C"] })] })), weather.pm &&
33
+ weather.pm.temperature &&
34
+ weather.pm.temperature.value && (_jsxs("div", { className: css.column, children: [_jsxs("div", { children: [useTomorrow ? "Demain" : "Cet", " apr\u00E8s-midi"] }), _jsxs("div", { className: css.statusTemp, children: [_jsx(WeatherIcon, { sky: weather.pm.skyStatus }), weather.pm.temperature.value, "\u00B0C"] })] }))] }) }));
35
+ };
36
+ export default Weather;
@@ -0,0 +1,32 @@
1
+ .ampm {
2
+ display: flex;
3
+ flex-direction: row;
4
+ gap: 1rem;
5
+ justify-content: center;
6
+ align-items: center;
7
+ flex-grow: 1;
8
+ }
9
+ .ampm > :first-child {
10
+ padding-right: 1rem;
11
+ border-right: solid 1px #ccc;
12
+ }
13
+ .column {
14
+ display: flex;
15
+ flex-direction: column;
16
+ justify-content: center;
17
+ align-items: center;
18
+ font-size: var(--label);
19
+ }
20
+
21
+ .statusTemp {
22
+ display: flex;
23
+ flex-direction: row;
24
+ gap: 8px;
25
+ justify-content: center;
26
+ align-items: center;
27
+ font-weight: 700;
28
+ }
29
+ .statusTemp > svg {
30
+ width: 32px;
31
+ height: 32px;
32
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Webcam: ({ doc, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Webcam;
8
+ //# sourceMappingURL=webcam.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webcam.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/webcam.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,MAAM,sBAAuB,KAAK,4CAUvC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as Icons from "dt-design-system/es/icons";
3
+ import Card from "./components/card";
4
+ import css from "./webcam.module.css";
5
+ const Webcam = ({ doc, ...props }) => {
6
+ const { document: { image, text }, } = doc;
7
+ return (_jsxs(Card, { doc: doc, ...props, overlayTitle: true, children: [_jsx(Icons.PlayCircle, { className: css.icon }), _jsx("img", { src: image, alt: text, className: css.webcam })] }));
8
+ };
9
+ export default Webcam;
@@ -0,0 +1,13 @@
1
+ .webcam {
2
+ object-fit: cover;
3
+ flex-grow: 1;
4
+ }
5
+
6
+ .icon {
7
+ position: absolute;
8
+ top: 12px;
9
+ width: 30px;
10
+ height: 30px;
11
+ fill: var(--ds-grey-000, #fff);
12
+ filter: var(--ds-shadow-100, 0px 3px 6px rgba(0, 0, 0, 0.12));
13
+ }
@@ -0,0 +1,11 @@
1
+ import type { Hit } from "./results";
2
+ type Props = {
3
+ lang: string;
4
+ widgets: Hit[];
5
+ loading: boolean;
6
+ sendPlausibleGoal: (path: string) => void;
7
+ faqsMaximized: boolean;
8
+ };
9
+ export default function Widgets({ widgets, loading, faqsMaximized, ...props }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=widgets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../../../../src/lbm/components/instant-search/widgets.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAkBrC,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,GAAG,EAAE,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IAEjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,aAAa,EAAE,OAAO,CAAC;CACxB,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,EAC9B,OAAO,EACP,OAAO,EACP,aAAa,EACb,GAAG,KAAK,EACT,EAAE,KAAK,2CA8DP"}
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import dynamic from "next/dynamic";
3
+ import Loader from "dt-design-system/es/loader";
4
+ import css from "./widgets.module.css";
5
+ import MsemWidget from "./widgets/msem-widget";
6
+ const Lift = dynamic(() => import("./widgets/lift"));
7
+ const Slope = dynamic(() => import("./widgets/slope"));
8
+ const Slopes = dynamic(() => import("./widgets/slopes"));
9
+ const Lifts = dynamic(() => import("./widgets/lifts"));
10
+ const Openings = dynamic(() => import("./widgets/openings"));
11
+ const Access = dynamic(() => import("./widgets/access"));
12
+ const Activity = dynamic(() => import("./widgets/activity"));
13
+ const DawnNightOpenings = dynamic(() => import("./widgets/dawn-nights-openings"));
14
+ const Weather = dynamic(() => import("./widgets/weather"));
15
+ const Webcam = dynamic(() => import("./widgets/webcam"));
16
+ const Snow = dynamic(() => import("./widgets/snow"));
17
+ const PLACEHOLDERS = [...new Array(4)];
18
+ export default function Widgets({ widgets, loading, faqsMaximized, ...props }) {
19
+ const noWidget = !loading && !widgets.length;
20
+ if (faqsMaximized || noWidget)
21
+ return null;
22
+ return (_jsxs("div", { className: css.widgets, children: [loading &&
23
+ PLACEHOLDERS.map((_, i) => {
24
+ return (_jsx("div", { className: css.loaderContainer, children: _jsx(Loader, { className: css.loader, variant: "overlay" }) }, i));
25
+ }), !loading &&
26
+ widgets.slice(0, 4).map((hit, i) => {
27
+ switch (hit.document.type) {
28
+ case "widget":
29
+ switch (hit.document.path) {
30
+ case "widget-lift":
31
+ return _jsx(Lift, { doc: hit, ...props }, i);
32
+ case "widget-lifts":
33
+ return _jsx(Lifts, { doc: hit, ...props }, i);
34
+ case "widget-slope":
35
+ return _jsx(Slope, { doc: hit, ...props }, i);
36
+ case "widget-slopes":
37
+ return _jsx(Slopes, { doc: hit, ...props }, i);
38
+ case "widget-access":
39
+ return _jsx(Access, { doc: hit, ...props }, i);
40
+ case "widget-activity":
41
+ return _jsx(Activity, { doc: hit, ...props }, i);
42
+ case "widget-openings":
43
+ return _jsx(Openings, { doc: hit, ...props }, i);
44
+ case "widget-dawn":
45
+ return (_jsx(DawnNightOpenings, { doc: hit, dawn: true, ...props }, i));
46
+ case "widget-night":
47
+ return _jsx(DawnNightOpenings, { doc: hit, ...props }, i);
48
+ case "widget-snow":
49
+ return _jsx(Snow, { doc: hit, ...props }, i);
50
+ case "widget-snow-summit":
51
+ return _jsx(Snow, { doc: hit, summit: true, ...props }, i);
52
+ case "widget-weather":
53
+ return _jsx(Weather, { doc: hit, ...props }, i);
54
+ case "widget-weather-summit":
55
+ return _jsx(Weather, { doc: hit, summit: true, ...props }, i);
56
+ case "widget-webcam":
57
+ return _jsx(Webcam, { doc: hit, ...props }, i);
58
+ default:
59
+ return null;
60
+ }
61
+ case "msem-widget":
62
+ return _jsx(MsemWidget, { doc: hit, ...props }, i);
63
+ case "lodging":
64
+ default:
65
+ return null;
66
+ }
67
+ })] }));
68
+ }
@@ -0,0 +1,14 @@
1
+ .widgets {
2
+ display: grid;
3
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
4
+ align-content: flex-start;
5
+ gap: 16px;
6
+ padding: 12px;
7
+ }
8
+
9
+ .loaderContainer {
10
+ position: relative;
11
+ width: 100%;
12
+ height: 75px;
13
+ border-radius: var(--ds-input-radius, var(--ds-radius-200, 8px));
14
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "ublo-lib",
3
- "version": "1.35.19",
3
+ "version": "1.36.1",
4
4
  "peerDependencies": {
5
- "dt-design-system": "^3.8.5",
5
+ "dt-design-system": "^3.9.9",
6
6
  "leaflet": "^1.9.1",
7
7
  "next": "^12.0.0 || ^13.0.0 || ^14.0.0",
8
8
  "react": "^18.2.0",
@@ -39,7 +39,7 @@
39
39
  "eslint": "8.57.0",
40
40
  "eslint-plugin-react": "7.34.1",
41
41
  "eslint-plugin-react-hooks": "4.6.0",
42
- "dt-design-system": "3.8.5",
42
+ "dt-design-system": "3.9.9",
43
43
  "mv": "2.1.1",
44
44
  "next": "14.1.0",
45
45
  "react": "18.2.0",