@geops/rvf-mobility-web-component 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@geops/rvf-mobility-web-component",
3
3
  "license": "UNLICENSED",
4
4
  "description": "Web components for rvf in the domains of mobility and logistics.",
5
- "version": "0.1.25",
5
+ "version": "0.1.26",
6
6
  "homepage": "https://rvf-mobility-web-component-geops.vercel.app/",
7
7
  "type": "module",
8
8
  "main": "index.js",
@@ -7,6 +7,7 @@ import {
7
7
  import { JSX, PreactDOMAttributes } from "preact";
8
8
 
9
9
  import getMainColorForVehicle from "../utils/getMainColorForVehicle";
10
+ import getTextColor from "../utils/getTextColor";
10
11
  import getTextFontForVehicle from "../utils/getTextFontForVehicle";
11
12
  import getTextForVehicle from "../utils/getTextForVehicle";
12
13
 
@@ -32,10 +33,11 @@ function RouteIcon({
32
33
  departure?.line ||
33
34
  stopSequence?.line ||
34
35
  trajectory?.properties?.line;
36
+ const type = stopSequence?.type || trajectory?.type;
35
37
  const backgroundColor = getMainColorForVehicle(
36
38
  line || departure || stopSequence || trajectory,
37
39
  );
38
- const color = lineToUse?.text_color || "black";
40
+ const color = lineToUse?.text_color || getTextColor(type);
39
41
  let borderColor = lineToUse?.stroke || "black";
40
42
  const text = getTextForVehicle(
41
43
  line || departure || stopSequence || trajectory,
@@ -50,7 +52,7 @@ function RouteIcon({
50
52
 
51
53
  return (
52
54
  <span
53
- className="flex h-[40px] min-w-[40px] items-center justify-center rounded-full border-2 px-1"
55
+ className="flex h-[40px] min-w-[40px] items-center justify-center rounded-full border px-1"
54
56
  style={{
55
57
  backgroundColor,
56
58
  borderColor,