ublo-lib 1.20.17 → 1.21.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.
- package/es/esf/components/loyal-customers/api.js +4 -4
- package/es/lbm/lumiplan/api.d.ts +8 -0
- package/es/lbm/lumiplan/api.d.ts.map +1 -0
- package/es/lbm/lumiplan/api.js +33 -0
- package/es/lbm/lumiplan/domain.d.ts +8 -0
- package/es/lbm/lumiplan/domain.d.ts.map +1 -0
- package/es/lbm/lumiplan/domain.js +30 -0
- package/es/lbm/lumiplan/domain.module.css +111 -0
- package/es/lbm/lumiplan/i18n/en.json +1 -0
- package/es/lbm/lumiplan/i18n/fr.json +255 -0
- package/es/lbm/lumiplan/i18n/translations.d.ts +7 -0
- package/es/lbm/lumiplan/i18n/translations.d.ts.map +1 -0
- package/es/lbm/lumiplan/i18n/translations.js +20 -0
- package/es/lbm/lumiplan/icons/alert.js +23 -0
- package/es/lbm/lumiplan/icons/avalanche-risk.js +16 -0
- package/es/lbm/lumiplan/icons/cabin.js +16 -0
- package/es/lbm/lumiplan/icons/check.js +18 -0
- package/es/lbm/lumiplan/icons/close.js +23 -0
- package/es/lbm/lumiplan/icons/cloud.js +18 -0
- package/es/lbm/lumiplan/icons/cloud.module.css +9 -0
- package/es/lbm/lumiplan/icons/dawn.js +21 -0
- package/es/lbm/lumiplan/icons/fog.js +37 -0
- package/es/lbm/lumiplan/icons/fog.module.css +34 -0
- package/es/lbm/lumiplan/icons/information.js +23 -0
- package/es/lbm/lumiplan/icons/isothermal.js +27 -0
- package/es/lbm/lumiplan/icons/lifts/index.js +5 -0
- package/es/lbm/lumiplan/icons/lifts/tapis-roulant.js +18 -0
- package/es/lbm/lumiplan/icons/lifts/telecabine.js +18 -0
- package/es/lbm/lumiplan/icons/lifts/telesiege-debrayable.js +29 -0
- package/es/lbm/lumiplan/icons/lifts/telesiege.js +18 -0
- package/es/lbm/lumiplan/icons/lifts/teleski.js +18 -0
- package/es/lbm/lumiplan/icons/night.js +16 -0
- package/es/lbm/lumiplan/icons/rain.js +27 -0
- package/es/lbm/lumiplan/icons/rain.module.css +27 -0
- package/es/lbm/lumiplan/icons/rainy.js +31 -0
- package/es/lbm/lumiplan/icons/rainy.module.css +33 -0
- package/es/lbm/lumiplan/icons/reload.js +32 -0
- package/es/lbm/lumiplan/icons/road-condition.js +30 -0
- package/es/lbm/lumiplan/icons/slopes.js +16 -0
- package/es/lbm/lumiplan/icons/snow-cover.js +18 -0
- package/es/lbm/lumiplan/icons/snow.js +33 -0
- package/es/lbm/lumiplan/icons/snow.module.css +28 -0
- package/es/lbm/lumiplan/icons/storm.js +27 -0
- package/es/lbm/lumiplan/icons/storm.module.css +25 -0
- package/es/lbm/lumiplan/icons/sun.js +23 -0
- package/es/lbm/lumiplan/icons/sun.module.css +14 -0
- package/es/lbm/lumiplan/icons/sunny.js +29 -0
- package/es/lbm/lumiplan/icons/sunny.module.css +11 -0
- package/es/lbm/lumiplan/icons/time.js +23 -0
- package/es/lbm/lumiplan/icons/trails/boarder-cross.js +22 -0
- package/es/lbm/lumiplan/icons/trails/champ-de-bosse.js +20 -0
- package/es/lbm/lumiplan/icons/trails/freeride.js +17 -0
- package/es/lbm/lumiplan/icons/trails/index.js +12 -0
- package/es/lbm/lumiplan/icons/trails/luge.js +17 -0
- package/es/lbm/lumiplan/icons/trails/pieton.js +17 -0
- package/es/lbm/lumiplan/icons/trails/piste-eclairee.js +20 -0
- package/es/lbm/lumiplan/icons/trails/raquette.js +66 -0
- package/es/lbm/lumiplan/icons/trails/ski-alpin.js +17 -0
- package/es/lbm/lumiplan/icons/trails/ski-fond.js +17 -0
- package/es/lbm/lumiplan/icons/trails/snowpark.js +17 -0
- package/es/lbm/lumiplan/icons/trails/vtt.js +20 -0
- package/es/lbm/lumiplan/icons/trails/zone-freeride.js +17 -0
- package/es/lbm/lumiplan/icons/warning.js +23 -0
- package/es/lbm/lumiplan/icons/wind.js +30 -0
- package/es/lbm/lumiplan/index.d.ts +3 -0
- package/es/lbm/lumiplan/index.d.ts.map +1 -0
- package/es/lbm/lumiplan/index.js +2 -0
- package/es/lbm/lumiplan/lumiplan.d.ts +2 -0
- package/es/lbm/lumiplan/lumiplan.d.ts.map +1 -0
- package/es/lbm/lumiplan/lumiplan.js +118 -0
- package/es/lbm/lumiplan/lumiplan.module.css +3 -0
- package/es/lbm/lumiplan/opening.d.ts +8 -0
- package/es/lbm/lumiplan/opening.d.ts.map +1 -0
- package/es/lbm/lumiplan/opening.js +33 -0
- package/es/lbm/lumiplan/opening.module.css +88 -0
- package/es/lbm/lumiplan/pois.d.ts +8 -0
- package/es/lbm/lumiplan/pois.d.ts.map +1 -0
- package/es/lbm/lumiplan/pois.js +150 -0
- package/es/lbm/lumiplan/pois.module.css +137 -0
- package/es/lbm/lumiplan/resort-selector.d.ts +12 -0
- package/es/lbm/lumiplan/resort-selector.d.ts.map +1 -0
- package/es/lbm/lumiplan/resort-selector.js +18 -0
- package/es/lbm/lumiplan/resort-selector.module.css +28 -0
- package/es/lbm/lumiplan/road-condition.d.ts +8 -0
- package/es/lbm/lumiplan/road-condition.d.ts.map +1 -0
- package/es/lbm/lumiplan/road-condition.js +26 -0
- package/es/lbm/lumiplan/road-condition.module.css +79 -0
- package/es/lbm/lumiplan/todays-tips.d.ts +8 -0
- package/es/lbm/lumiplan/todays-tips.d.ts.map +1 -0
- package/es/lbm/lumiplan/todays-tips.js +23 -0
- package/es/lbm/lumiplan/todays-tips.module.css +35 -0
- package/es/lbm/lumiplan/types.d.ts +281 -0
- package/es/lbm/lumiplan/types.d.ts.map +1 -0
- package/es/lbm/lumiplan/types.js +1 -0
- package/es/lbm/lumiplan/weather/avalanche-risk.d.ts +4 -0
- package/es/lbm/lumiplan/weather/avalanche-risk.d.ts.map +1 -0
- package/es/lbm/lumiplan/weather/avalanche-risk.js +12 -0
- package/es/lbm/lumiplan/weather/avalanche-risk.module.css +21 -0
- package/es/lbm/lumiplan/weather/index.d.ts +3 -0
- package/es/lbm/lumiplan/weather/index.d.ts.map +1 -0
- package/es/lbm/lumiplan/weather/index.js +2 -0
- package/es/lbm/lumiplan/weather/snow-data.d.ts +8 -0
- package/es/lbm/lumiplan/weather/snow-data.d.ts.map +1 -0
- package/es/lbm/lumiplan/weather/snow-data.js +8 -0
- package/es/lbm/lumiplan/weather/snow-data.module.css +41 -0
- package/es/lbm/lumiplan/weather/weather-data.d.ts +9 -0
- package/es/lbm/lumiplan/weather/weather-data.d.ts.map +1 -0
- package/es/lbm/lumiplan/weather/weather-data.js +8 -0
- package/es/lbm/lumiplan/weather/weather-data.module.css +61 -0
- package/es/lbm/lumiplan/weather/weather-icon.d.ts +23 -0
- package/es/lbm/lumiplan/weather/weather-icon.d.ts.map +1 -0
- package/es/lbm/lumiplan/weather/weather-icon.js +30 -0
- package/es/lbm/lumiplan/weather/weather.d.ts +8 -0
- package/es/lbm/lumiplan/weather/weather.d.ts.map +1 -0
- package/es/lbm/lumiplan/weather/weather.js +74 -0
- package/es/lbm/lumiplan/weather/weather.module.css +118 -0
- package/package.json +2 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { WeatherInfo } from "../types";
|
|
2
|
+
type Props = {
|
|
3
|
+
kind: "am" | "pm";
|
|
4
|
+
data: WeatherInfo;
|
|
5
|
+
expanded: boolean;
|
|
6
|
+
};
|
|
7
|
+
export default function WeatherData({ kind, data, expanded }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=weather-data.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather-data.d.ts","sourceRoot":"","sources":["../../../../src/lbm/lumiplan/weather/weather-data.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG5C,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,WAAW,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,KAAK,2CA2GlE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import T from "../i18n/translations";
|
|
3
|
+
import WeatherIcon from "./weather-icon";
|
|
4
|
+
import css from "./weather-data.module.css";
|
|
5
|
+
export default function WeatherData({ kind, data, expanded }) {
|
|
6
|
+
const { skyStatus, temperature, windchill, indexUv, limitIsothermic0, limitIsothermicMinus10, limitRainSnowFall, visibility, wind, } = data;
|
|
7
|
+
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 })] }))] }))] })] }));
|
|
8
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.weatherData {
|
|
2
|
+
flex: 1 1 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
gap: 34px;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.weatherData > svg {
|
|
8
|
+
flex: 0 0 55px;
|
|
9
|
+
width: 55px;
|
|
10
|
+
height: 55px;
|
|
11
|
+
margin-top: 10px;
|
|
12
|
+
fill: hsl(var(--primary));
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.weatherInfo {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.weatherInfoTitle {
|
|
21
|
+
color: hsl(var(--primary));
|
|
22
|
+
font-weight: 700;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.weatherInfoTemperatures {
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: 6px;
|
|
28
|
+
margin: 16px 0;
|
|
29
|
+
font-size: 28px;
|
|
30
|
+
font-weight: 700;
|
|
31
|
+
color: hsl(var(--secondary));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.weatherInfoTemperatures > span:last-child {
|
|
35
|
+
position: relative;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.weatherInfoTemperatures > span:last-child > em {
|
|
39
|
+
position: absolute;
|
|
40
|
+
top: calc(100% - 6px);
|
|
41
|
+
left: 20px;
|
|
42
|
+
padding: 1px 4px;
|
|
43
|
+
font-size: 12px;
|
|
44
|
+
color: hsl(var(--grey-000));
|
|
45
|
+
text-transform: uppercase;
|
|
46
|
+
font-style: normal;
|
|
47
|
+
background: var(--blue-gradient);
|
|
48
|
+
border-radius: 1px;
|
|
49
|
+
transform: rotate(-4deg) skewX(-4deg);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.expanded {
|
|
53
|
+
display: flex;
|
|
54
|
+
flex-direction: column;
|
|
55
|
+
gap: 3px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.data {
|
|
59
|
+
color: hsl(var(--primary));
|
|
60
|
+
font-size: 14px;
|
|
61
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
type Props = {
|
|
2
|
+
sky: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const weatherIcons: {
|
|
5
|
+
UNDEF: any;
|
|
6
|
+
SUNNY: any;
|
|
7
|
+
MOSTLY_SUNNY: any;
|
|
8
|
+
FAIR_WEATHER_PARTLY_CLOUDY: any;
|
|
9
|
+
MOSTLY_CLOUDY_SOME_SUN: any;
|
|
10
|
+
CLOUDY: any;
|
|
11
|
+
CLOUDY_LIGHT_RAIN: any;
|
|
12
|
+
MOSTLY_CLOUDY_LIGHT_RAIN: any;
|
|
13
|
+
CLOUDY_MODERATE_HEAVY_RAIN: any;
|
|
14
|
+
VARIABLE_SKY_LIGHT_SNOWFALL: any;
|
|
15
|
+
CLOUDY_LIGHT_SNOWFALL: any;
|
|
16
|
+
CLOUDY_MODERATE_HEAVY_SNOWFALL: any;
|
|
17
|
+
FOG: any;
|
|
18
|
+
THUNDERSTORMS: any;
|
|
19
|
+
VARIABLE_SKY_SCATTERED_THUNDERSTORMS: any;
|
|
20
|
+
};
|
|
21
|
+
export default function WeatherIcon({ sky }: Props): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=weather-icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather-icon.d.ts","sourceRoot":"","sources":["../../../../src/lbm/lumiplan/weather/weather-icon.tsx"],"names":[],"mappings":"AAUA,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;CAgBxB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAAE,GAAG,EAAE,EAAE,KAAK,2CAGjD"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import CloudIcon from "../icons/cloud";
|
|
3
|
+
import FogIcon from "../icons/fog";
|
|
4
|
+
import RainIcon from "../icons/rain";
|
|
5
|
+
import RainyIcon from "../icons/rainy";
|
|
6
|
+
import SnowIcon from "../icons/snow";
|
|
7
|
+
import StormIcon from "../icons/storm";
|
|
8
|
+
import SunIcon from "../icons/sun";
|
|
9
|
+
import SunnyIcon from "../icons/sunny";
|
|
10
|
+
export const weatherIcons = {
|
|
11
|
+
UNDEF: SunIcon,
|
|
12
|
+
SUNNY: SunIcon,
|
|
13
|
+
MOSTLY_SUNNY: SunnyIcon,
|
|
14
|
+
FAIR_WEATHER_PARTLY_CLOUDY: SunnyIcon,
|
|
15
|
+
MOSTLY_CLOUDY_SOME_SUN: CloudIcon,
|
|
16
|
+
CLOUDY: CloudIcon,
|
|
17
|
+
CLOUDY_LIGHT_RAIN: RainyIcon,
|
|
18
|
+
MOSTLY_CLOUDY_LIGHT_RAIN: RainyIcon,
|
|
19
|
+
CLOUDY_MODERATE_HEAVY_RAIN: RainIcon,
|
|
20
|
+
VARIABLE_SKY_LIGHT_SNOWFALL: SnowIcon,
|
|
21
|
+
CLOUDY_LIGHT_SNOWFALL: SnowIcon,
|
|
22
|
+
CLOUDY_MODERATE_HEAVY_SNOWFALL: SnowIcon,
|
|
23
|
+
FOG: FogIcon,
|
|
24
|
+
THUNDERSTORMS: StormIcon,
|
|
25
|
+
VARIABLE_SKY_SCATTERED_THUNDERSTORMS: StormIcon,
|
|
26
|
+
};
|
|
27
|
+
export default function WeatherIcon({ sky }) {
|
|
28
|
+
const Icon = weatherIcons[sky] || weatherIcons.UNDEF;
|
|
29
|
+
return _jsx(Icon, {});
|
|
30
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { WeatherForecast } from "../types";
|
|
3
|
+
type Props = {
|
|
4
|
+
weather?: WeatherForecast | null;
|
|
5
|
+
};
|
|
6
|
+
declare const Weather: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export default Weather;
|
|
8
|
+
//# sourceMappingURL=weather.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"weather.d.ts","sourceRoot":"","sources":["../../../../src/lbm/lumiplan/weather/weather.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,OAAO,8EAsIZ,CAAC;AAIF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { useUbloContext } from "ublo/with-ublo";
|
|
5
|
+
import Button from "dt-design-system/es/button";
|
|
6
|
+
import Tooltip from "dt-design-system/es/tooltip";
|
|
7
|
+
import Loader from "dt-design-system/es/loader";
|
|
8
|
+
import * as Icons from "dt-design-system/es/icons";
|
|
9
|
+
import AvalancheRisk from "./avalanche-risk";
|
|
10
|
+
import SnowData from "./snow-data";
|
|
11
|
+
import WeatherData from "./weather-data";
|
|
12
|
+
import T, { t } from "../i18n/translations";
|
|
13
|
+
import css from "./weather.module.css";
|
|
14
|
+
const Weather = React.forwardRef(({ weather }, ref) => {
|
|
15
|
+
const { lang } = useUbloContext();
|
|
16
|
+
const [currentZoneIndex, setCurrentZoneIndex] = React.useState(0);
|
|
17
|
+
const [currentDayIndex, setCurrentDayIndex] = React.useState(0);
|
|
18
|
+
const [expanded, setExpanded] = React.useState(false);
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
setCurrentZoneIndex(0);
|
|
21
|
+
setCurrentDayIndex(0);
|
|
22
|
+
}, [weather]);
|
|
23
|
+
if (weather === undefined) {
|
|
24
|
+
return (_jsx("div", { ref: ref, className: css.loader, "data-tags": t(lang, "weather.title"), children: _jsx(Loader, { variant: "overlay" }) }));
|
|
25
|
+
}
|
|
26
|
+
if (!weather) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const { weatherZones } = weather.weather;
|
|
30
|
+
const { snowZones } = weather.snow;
|
|
31
|
+
const { weatherInfos } = weatherZones[currentZoneIndex] || {};
|
|
32
|
+
const { am, pm } = weatherInfos[currentDayIndex] || {};
|
|
33
|
+
const snowData = snowZones[currentZoneIndex] || {};
|
|
34
|
+
const ExpandIcon = expanded ? Icons.MinusCircle : Icons.PlusCircle;
|
|
35
|
+
const toggleExpanded = () => {
|
|
36
|
+
setExpanded(!expanded);
|
|
37
|
+
};
|
|
38
|
+
return (_jsxs("div", { ref: ref, className: css.weather, "data-tags": t(lang, "weather.title"), children: [_jsxs("div", { className: css.header, children: [_jsx("div", { className: css.days, children: weatherInfos.map((weatherInfo, i) => {
|
|
39
|
+
const { date, am, pm } = weatherInfo;
|
|
40
|
+
if (!pm || !am)
|
|
41
|
+
return null;
|
|
42
|
+
const isSelected = i === currentDayIndex;
|
|
43
|
+
const updateCurrentDay = () => {
|
|
44
|
+
setCurrentDayIndex(i);
|
|
45
|
+
};
|
|
46
|
+
const isToday = new Date(date).getDate() === new Date().getDate();
|
|
47
|
+
const locale = lang === "fr" ? "fr-FR" : "en-UK";
|
|
48
|
+
const day = new Date(date).toLocaleDateString(locale, {
|
|
49
|
+
weekday: "long",
|
|
50
|
+
});
|
|
51
|
+
const formatedDate = new Date(date).toLocaleDateString(locale, {
|
|
52
|
+
day: "2-digit",
|
|
53
|
+
month: "2-digit",
|
|
54
|
+
year: "numeric",
|
|
55
|
+
});
|
|
56
|
+
const classes = classNames(css.day, {
|
|
57
|
+
[css.daySelected]: isSelected,
|
|
58
|
+
});
|
|
59
|
+
return (_jsxs(Button, { className: classes, onClick: updateCurrentDay, children: [_jsx("b", { children: isToday ? _jsx(T, { id: "weather.today" }) : day }), formatedDate] }, date));
|
|
60
|
+
}) }), _jsx("div", { className: css.zones, children: weatherZones.map((zone, i) => {
|
|
61
|
+
const { name, altitude } = zone;
|
|
62
|
+
const { value, unit } = altitude;
|
|
63
|
+
const isSelected = i === currentZoneIndex;
|
|
64
|
+
const updateCurrentZone = () => {
|
|
65
|
+
setCurrentZoneIndex(i);
|
|
66
|
+
};
|
|
67
|
+
const classes = classNames(css.zone, {
|
|
68
|
+
[css.zoneSelected]: isSelected,
|
|
69
|
+
});
|
|
70
|
+
return (_jsxs(Button, { className: classes, onClick: updateCurrentZone, children: [_jsx("b", { children: name }), " ", value, _jsx("span", { children: _jsx(T, { id: unit }) })] }, name));
|
|
71
|
+
}) })] }), _jsxs("div", { className: css.info, children: [_jsx(AvalancheRisk, { avalancheRisk: snowData.avalancheRisk }), _jsxs("div", { className: css.infoBottom, children: [_jsx(SnowData, { data: snowData, expanded: expanded }), _jsx(WeatherData, { kind: "am", data: am, expanded: expanded }), _jsx(WeatherData, { kind: "pm", data: pm, expanded: expanded })] }), _jsx(Tooltip, { content: t(lang, expanded ? "see-less" : "see-more"), children: _jsx(Button, { className: css.expandButton, variant: "transparent", onClick: toggleExpanded, children: _jsx(ExpandIcon, {}) }) })] })] }));
|
|
72
|
+
});
|
|
73
|
+
Weather.displayName = "Weather";
|
|
74
|
+
export default Weather;
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
.loader {
|
|
2
|
+
position: relative;
|
|
3
|
+
width: 100%;
|
|
4
|
+
max-width: 1200px;
|
|
5
|
+
height: 300px;
|
|
6
|
+
margin: 30px auto;
|
|
7
|
+
border-radius: var(--radius-200);
|
|
8
|
+
overflow: hidden;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.weather {
|
|
12
|
+
width: 100%;
|
|
13
|
+
max-width: 1200px;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
margin: 36px auto;
|
|
17
|
+
padding: 0 10px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (min-width: 1220px) {
|
|
21
|
+
.weather {
|
|
22
|
+
padding: 0;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.header {
|
|
27
|
+
display: flex;
|
|
28
|
+
flex-direction: column-reverse;
|
|
29
|
+
gap: 16px;
|
|
30
|
+
overflow: auto;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media (min-width: 700px) {
|
|
34
|
+
.header {
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
align-items: center;
|
|
37
|
+
justify-content: space-between;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.days {
|
|
42
|
+
display: flex;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.zones {
|
|
46
|
+
display: flex;
|
|
47
|
+
gap: 10px;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
button.zone {
|
|
51
|
+
--ds-button-padding: 12px;
|
|
52
|
+
--ds-button-font-size: 16px;
|
|
53
|
+
--ds-button-foreground: hsl(var(--primary));
|
|
54
|
+
--ds-button-font-weight: 400;
|
|
55
|
+
--ds-button-background: transparent;
|
|
56
|
+
--ds-button-hover-background: hsla(var(--primary), 10%);
|
|
57
|
+
--ds-button-shadow: 0 0 0 1px hsl(var(--primary)) inset;
|
|
58
|
+
|
|
59
|
+
display: block;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
button.zoneSelected {
|
|
63
|
+
--ds-button-foreground: hsl(var(--grey-000));
|
|
64
|
+
--ds-button-shadow: 0;
|
|
65
|
+
|
|
66
|
+
background: var(--blue-gradient);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
button.zone b {
|
|
70
|
+
text-transform: uppercase;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
button.day {
|
|
74
|
+
--ds-button-padding: 16px;
|
|
75
|
+
--ds-button-font-size: 16px;
|
|
76
|
+
--ds-button-foreground: hsl(var(--primary));
|
|
77
|
+
--ds-button-font-weight: 400;
|
|
78
|
+
--ds-button-background: transparent;
|
|
79
|
+
--ds-button-hover-background: hsla(var(--primary), 10%);
|
|
80
|
+
--ds-button-radius: 0;
|
|
81
|
+
|
|
82
|
+
flex-direction: column;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
button.daySelected {
|
|
86
|
+
position: relative;
|
|
87
|
+
--ds-button-background: hsla(var(--primary), 10%);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
button.day b {
|
|
91
|
+
text-transform: uppercase;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.info {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex-direction: column;
|
|
97
|
+
gap: 30px;
|
|
98
|
+
padding: 34px 16px;
|
|
99
|
+
background-color: hsla(var(--primary), 10%);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.infoBottom {
|
|
103
|
+
display: flex;
|
|
104
|
+
flex-direction: column;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: 30px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
@media (min-width: 840px) {
|
|
110
|
+
.infoBottom {
|
|
111
|
+
flex-direction: row;
|
|
112
|
+
align-items: flex-start;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.expandButton {
|
|
117
|
+
margin: 0 auto;
|
|
118
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ublo-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"dt-design-system": "^3.1.5",
|
|
6
6
|
"leaflet": "^1.9.1",
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"awesome-debounce-promise": "2.1.0",
|
|
27
27
|
"classnames": "2.3.2",
|
|
28
28
|
"css-scrollbar-size": "1.0.2",
|
|
29
|
+
"framer-motion": "10.16.5",
|
|
29
30
|
"react-async-hook": "4.0.0"
|
|
30
31
|
},
|
|
31
32
|
"devDependencies": {
|