@oicl/openbridge-webcomponents 0.0.15-dev-20240916083108 → 0.0.15-dev-20240923184809

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. package/.storybook/main.ts +8 -0
  2. package/.storybook/preview.ts +2 -0
  3. package/__snapshots__/building-blocks-watch--advice.png +0 -0
  4. package/__snapshots__/building-blocks-watch-flat--primary.png +0 -0
  5. package/__snapshots__/navigation-instruments-azimuth-thruster--in-command-at-setpoint-disable-auto-setpoint.png +0 -0
  6. package/__snapshots__/navigation-instruments-azimuth-thruster--in-command-at-setpoint.png +0 -0
  7. package/__snapshots__/navigation-instruments-azimuth-thruster--in-command.png +0 -0
  8. package/__snapshots__/navigation-instruments-azimuth-thruster--pod.png +0 -0
  9. package/__snapshots__/navigation-instruments-azimuth-thruster--single-direction-with-propeller.png +0 -0
  10. package/__snapshots__/navigation-instruments-azimuth-thruster--single-direction.png +0 -0
  11. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--large.png +0 -0
  12. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--medium.png +0 -0
  13. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--no-command.png +0 -0
  14. package/__snapshots__/navigation-instruments-compass--primary.png +0 -0
  15. package/__snapshots__/navigation-instruments-compass-flat--primary.png +0 -0
  16. package/__snapshots__/navigation-instruments-compass-flat--with-fov-indicator.png +0 -0
  17. package/__snapshots__/navigation-instruments-main-engine--active.png +0 -0
  18. package/__snapshots__/navigation-instruments-main-engine--in-command.png +0 -0
  19. package/__snapshots__/navigation-instruments-main-engine--off.png +0 -0
  20. package/__snapshots__/navigation-instruments-thruster--tunnel.png +0 -0
  21. package/custom-elements.json +2184 -660
  22. package/dist/navigation-instruments/azimuth-thruster/azimuth-thruster.d.ts.map +1 -1
  23. package/dist/navigation-instruments/azimuth-thruster/azimuth-thruster.js +2 -1
  24. package/dist/navigation-instruments/azimuth-thruster/azimuth-thruster.js.map +1 -1
  25. package/dist/navigation-instruments/compass/arrow.d.ts +7 -0
  26. package/dist/navigation-instruments/compass/arrow.d.ts.map +1 -0
  27. package/dist/navigation-instruments/compass/arrow.js +59 -0
  28. package/dist/navigation-instruments/compass/arrow.js.map +1 -0
  29. package/dist/navigation-instruments/compass/compass.d.ts +23 -0
  30. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -0
  31. package/dist/navigation-instruments/compass/compass.js +139 -0
  32. package/dist/navigation-instruments/compass/compass.js.map +1 -0
  33. package/dist/navigation-instruments/compass/radial-tickmark.d.ts +4 -0
  34. package/dist/navigation-instruments/compass/radial-tickmark.d.ts.map +1 -0
  35. package/dist/navigation-instruments/compass/radial-tickmark.js +69 -0
  36. package/dist/navigation-instruments/compass/radial-tickmark.js.map +1 -0
  37. package/dist/navigation-instruments/compass-flat/compass-flat.css.js +29 -0
  38. package/dist/navigation-instruments/compass-flat/compass-flat.css.js.map +1 -0
  39. package/dist/navigation-instruments/compass-flat/compass-flat.d.ts +45 -0
  40. package/dist/navigation-instruments/compass-flat/compass-flat.d.ts.map +1 -0
  41. package/dist/navigation-instruments/compass-flat/compass-flat.js +223 -0
  42. package/dist/navigation-instruments/compass-flat/compass-flat.js.map +1 -0
  43. package/dist/navigation-instruments/main-engine/main-engine.css.js +22 -0
  44. package/dist/navigation-instruments/main-engine/main-engine.css.js.map +1 -0
  45. package/dist/navigation-instruments/main-engine/main-engine.d.ts +29 -0
  46. package/dist/navigation-instruments/main-engine/main-engine.d.ts.map +1 -0
  47. package/dist/navigation-instruments/main-engine/main-engine.js +196 -0
  48. package/dist/navigation-instruments/main-engine/main-engine.js.map +1 -0
  49. package/dist/navigation-instruments/thruster/advice.d.ts.map +1 -1
  50. package/dist/navigation-instruments/thruster/advice.js +9 -5
  51. package/dist/navigation-instruments/thruster/advice.js.map +1 -1
  52. package/dist/navigation-instruments/thruster/thruster.d.ts +54 -1
  53. package/dist/navigation-instruments/thruster/thruster.d.ts.map +1 -1
  54. package/dist/navigation-instruments/thruster/thruster.js +163 -99
  55. package/dist/navigation-instruments/thruster/thruster.js.map +1 -1
  56. package/dist/navigation-instruments/watch/advice.js +1 -1
  57. package/dist/navigation-instruments/watch/advice.js.map +1 -1
  58. package/dist/navigation-instruments/watch/label.d.ts +3 -0
  59. package/dist/navigation-instruments/watch/label.d.ts.map +1 -0
  60. package/dist/navigation-instruments/watch/label.js +68 -0
  61. package/dist/navigation-instruments/watch/label.js.map +1 -0
  62. package/dist/navigation-instruments/watch/watch.css.js +15 -14
  63. package/dist/navigation-instruments/watch/watch.css.js.map +1 -1
  64. package/dist/navigation-instruments/watch/watch.d.ts +3 -0
  65. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  66. package/dist/navigation-instruments/watch/watch.js +34 -1
  67. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  68. package/dist/navigation-instruments/watch-flat/tickmark-flat.d.ts +20 -0
  69. package/dist/navigation-instruments/watch-flat/tickmark-flat.d.ts.map +1 -0
  70. package/dist/navigation-instruments/watch-flat/tickmark-flat.js +53 -0
  71. package/dist/navigation-instruments/watch-flat/tickmark-flat.js.map +1 -0
  72. package/dist/navigation-instruments/watch-flat/watch-flat.css.js +32 -0
  73. package/dist/navigation-instruments/watch-flat/watch-flat.css.js.map +1 -0
  74. package/dist/navigation-instruments/watch-flat/watch-flat.d.ts +29 -0
  75. package/dist/navigation-instruments/watch-flat/watch-flat.d.ts.map +1 -0
  76. package/dist/navigation-instruments/watch-flat/watch-flat.js +184 -0
  77. package/dist/navigation-instruments/watch-flat/watch-flat.js.map +1 -0
  78. package/dist/svghelpers/rectangular.d.ts +1 -0
  79. package/dist/svghelpers/rectangular.d.ts.map +1 -1
  80. package/dist/svghelpers/rectangular.js +3 -2
  81. package/dist/svghelpers/rectangular.js.map +1 -1
  82. package/package.json +16 -11
  83. package/src/navigation-instruments/azimuth-thruster/azimuth-thruster.ts +1 -0
  84. package/src/navigation-instruments/compass/arrow.ts +61 -0
  85. package/src/navigation-instruments/compass/compass.stories.ts +37 -0
  86. package/src/navigation-instruments/compass/compass.ts +132 -0
  87. package/src/navigation-instruments/compass/radial-tickmark.ts +77 -0
  88. package/src/navigation-instruments/compass-flat/compass-flat.css +23 -0
  89. package/src/navigation-instruments/compass-flat/compass-flat.stories.ts +35 -0
  90. package/src/navigation-instruments/compass-flat/compass-flat.ts +221 -0
  91. package/src/navigation-instruments/main-engine/main-engine.css +17 -0
  92. package/src/navigation-instruments/main-engine/main-engine.stories.ts +54 -0
  93. package/src/navigation-instruments/main-engine/main-engine.ts +160 -0
  94. package/src/navigation-instruments/thruster/advice.ts +9 -5
  95. package/src/navigation-instruments/thruster/thruster.stories.ts +1 -0
  96. package/src/navigation-instruments/thruster/thruster.ts +205 -113
  97. package/src/navigation-instruments/watch/advice.ts +1 -1
  98. package/src/navigation-instruments/watch/label.ts +69 -0
  99. package/src/navigation-instruments/watch/watch.css +7 -7
  100. package/src/navigation-instruments/watch/watch.ts +30 -1
  101. package/src/navigation-instruments/watch-flat/tickmark-flat.ts +62 -0
  102. package/src/navigation-instruments/watch-flat/watch-flat.css +19 -0
  103. package/src/navigation-instruments/watch-flat/watch-flat.stories.ts +17 -0
  104. package/src/navigation-instruments/watch-flat/watch-flat.ts +148 -0
  105. package/src/palettes/variables.css +1343 -1343
  106. package/src/svghelpers/rectangular.ts +6 -3
@@ -10,20 +10,23 @@ export function rect(
10
10
  fillColor: string;
11
11
  borderRadius: number;
12
12
  strokePosition: 'inside' | 'outside';
13
+ y?: number;
13
14
  }
14
15
  ) {
16
+ const yPosition = data.y !== undefined ? data.y : -data.height / 2;
17
+
15
18
  if (data.strokePosition === 'inside') {
16
19
  return svg`
17
20
  <defs>
18
21
  <clipPath id="clip${id}">
19
- <rect id=${id} x=${-data.width / 2} y=${-data.height / 2} width=${
22
+ <rect id=${id} x=${-data.width / 2} y=${yPosition} width=${
20
23
  data.width
21
24
  } height=${data.height} rx=${
22
25
  data.borderRadius
23
26
  } vector-effect="non-scaling-stroke" />
24
27
  </clipPath>
25
28
  </defs>
26
- <rect id=${id} x=${-data.width / 2} y=${-data.height / 2} width=${
29
+ <rect id=${id} x=${-data.width / 2} y=${yPosition} width=${
27
30
  data.width
28
31
  } height=${data.height} rx=${
29
32
  data.borderRadius
@@ -31,7 +34,7 @@ export function rect(
31
34
  data.strokeColor
32
35
  } stroke-width=${data.strokeWidth * 2} fill=${
33
36
  data.fillColor
34
- } clip-path="url(#clip${id})"/>
37
+ } clip-path="url(#clip${id})"/>
35
38
  `;
36
39
  } else {
37
40
  return null;