@oicl/openbridge-webcomponents 0.0.15-dev-20240916185711 → 0.0.15-dev-20240923190011

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) 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.png +0 -0
  6. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--large.png +0 -0
  7. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--medium.png +0 -0
  8. package/__snapshots__/navigation-instruments-azimuth-thruster-labeled--no-command.png +0 -0
  9. package/__snapshots__/navigation-instruments-compass--primary.png +0 -0
  10. package/__snapshots__/navigation-instruments-compass-flat--primary.png +0 -0
  11. package/__snapshots__/navigation-instruments-compass-flat--with-fov-indicator.png +0 -0
  12. package/custom-elements.json +968 -7
  13. package/dist/navigation-instruments/compass/arrow.d.ts +7 -0
  14. package/dist/navigation-instruments/compass/arrow.d.ts.map +1 -0
  15. package/dist/navigation-instruments/compass/arrow.js +59 -0
  16. package/dist/navigation-instruments/compass/arrow.js.map +1 -0
  17. package/dist/navigation-instruments/compass/compass.d.ts +23 -0
  18. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -0
  19. package/dist/navigation-instruments/compass/compass.js +139 -0
  20. package/dist/navigation-instruments/compass/compass.js.map +1 -0
  21. package/dist/navigation-instruments/compass/radial-tickmark.d.ts +4 -0
  22. package/dist/navigation-instruments/compass/radial-tickmark.d.ts.map +1 -0
  23. package/dist/navigation-instruments/compass/radial-tickmark.js +69 -0
  24. package/dist/navigation-instruments/compass/radial-tickmark.js.map +1 -0
  25. package/dist/navigation-instruments/compass-flat/compass-flat.css.js +29 -0
  26. package/dist/navigation-instruments/compass-flat/compass-flat.css.js.map +1 -0
  27. package/dist/navigation-instruments/compass-flat/compass-flat.d.ts +45 -0
  28. package/dist/navigation-instruments/compass-flat/compass-flat.d.ts.map +1 -0
  29. package/dist/navigation-instruments/compass-flat/compass-flat.js +223 -0
  30. package/dist/navigation-instruments/compass-flat/compass-flat.js.map +1 -0
  31. package/dist/navigation-instruments/thruster/advice.d.ts.map +1 -1
  32. package/dist/navigation-instruments/thruster/advice.js +9 -5
  33. package/dist/navigation-instruments/thruster/advice.js.map +1 -1
  34. package/dist/navigation-instruments/watch/advice.js +1 -1
  35. package/dist/navigation-instruments/watch/advice.js.map +1 -1
  36. package/dist/navigation-instruments/watch/label.d.ts +3 -0
  37. package/dist/navigation-instruments/watch/label.d.ts.map +1 -0
  38. package/dist/navigation-instruments/watch/label.js +68 -0
  39. package/dist/navigation-instruments/watch/label.js.map +1 -0
  40. package/dist/navigation-instruments/watch/watch.css.js +15 -14
  41. package/dist/navigation-instruments/watch/watch.css.js.map +1 -1
  42. package/dist/navigation-instruments/watch/watch.d.ts +3 -0
  43. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  44. package/dist/navigation-instruments/watch/watch.js +34 -1
  45. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  46. package/dist/navigation-instruments/watch-flat/tickmark-flat.d.ts +20 -0
  47. package/dist/navigation-instruments/watch-flat/tickmark-flat.d.ts.map +1 -0
  48. package/dist/navigation-instruments/watch-flat/tickmark-flat.js +53 -0
  49. package/dist/navigation-instruments/watch-flat/tickmark-flat.js.map +1 -0
  50. package/dist/navigation-instruments/watch-flat/watch-flat.css.js +32 -0
  51. package/dist/navigation-instruments/watch-flat/watch-flat.css.js.map +1 -0
  52. package/dist/navigation-instruments/watch-flat/watch-flat.d.ts +29 -0
  53. package/dist/navigation-instruments/watch-flat/watch-flat.d.ts.map +1 -0
  54. package/dist/navigation-instruments/watch-flat/watch-flat.js +184 -0
  55. package/dist/navigation-instruments/watch-flat/watch-flat.js.map +1 -0
  56. package/dist/svghelpers/rectangular.d.ts +1 -0
  57. package/dist/svghelpers/rectangular.d.ts.map +1 -1
  58. package/dist/svghelpers/rectangular.js +3 -2
  59. package/dist/svghelpers/rectangular.js.map +1 -1
  60. package/package.json +16 -11
  61. package/src/navigation-instruments/compass/arrow.ts +61 -0
  62. package/src/navigation-instruments/compass/compass.stories.ts +37 -0
  63. package/src/navigation-instruments/compass/compass.ts +132 -0
  64. package/src/navigation-instruments/compass/radial-tickmark.ts +77 -0
  65. package/src/navigation-instruments/compass-flat/compass-flat.css +23 -0
  66. package/src/navigation-instruments/compass-flat/compass-flat.stories.ts +35 -0
  67. package/src/navigation-instruments/compass-flat/compass-flat.ts +221 -0
  68. package/src/navigation-instruments/thruster/advice.ts +9 -5
  69. package/src/navigation-instruments/watch/advice.ts +1 -1
  70. package/src/navigation-instruments/watch/label.ts +69 -0
  71. package/src/navigation-instruments/watch/watch.css +7 -7
  72. package/src/navigation-instruments/watch/watch.ts +30 -1
  73. package/src/navigation-instruments/watch-flat/tickmark-flat.ts +62 -0
  74. package/src/navigation-instruments/watch-flat/watch-flat.css +19 -0
  75. package/src/navigation-instruments/watch-flat/watch-flat.stories.ts +17 -0
  76. package/src/navigation-instruments/watch-flat/watch-flat.ts +148 -0
  77. 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;