@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.45 → 2.0.0-next.49

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 (95) hide show
  1. package/.storybook/ComponentPreview.tsx +26 -0
  2. package/.storybook/PreviewTemplate.tsx +99 -0
  3. package/.storybook/action-handler.ts +81 -0
  4. package/.storybook/channels.ts +44 -0
  5. package/.storybook/main.ts +313 -0
  6. package/.storybook/manager.ts +71 -0
  7. package/.storybook/openbridgeTheme.ts +197 -0
  8. package/.storybook/preview-head.html +15 -0
  9. package/.storybook/preview.tsx +129 -0
  10. package/.storybook/vitest.setup.ts +23 -0
  11. package/bundle/openbridge-webcomponents.bundle.js +14869 -14889
  12. package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
  13. package/custom-elements.json +81 -82
  14. package/dist/components/badge/badge.css.js +15 -15
  15. package/dist/components/icon-button/icon-button.d.ts +4 -0
  16. package/dist/components/icon-button/icon-button.d.ts.map +1 -1
  17. package/dist/components/icon-button/icon-button.js.map +1 -1
  18. package/dist/navigation-instruments/compass/compass.d.ts +3 -3
  19. package/dist/navigation-instruments/compass/compass.d.ts.map +1 -1
  20. package/dist/navigation-instruments/compass/compass.js +3 -3
  21. package/dist/navigation-instruments/compass/compass.js.map +1 -1
  22. package/dist/navigation-instruments/compass-indicator/compass-indicator.d.ts +12 -0
  23. package/dist/navigation-instruments/compass-indicator/compass-indicator.d.ts.map +1 -1
  24. package/dist/navigation-instruments/compass-indicator/compass-indicator.js +9 -1
  25. package/dist/navigation-instruments/compass-indicator/compass-indicator.js.map +1 -1
  26. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.d.ts +4 -4
  27. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.d.ts.map +1 -1
  28. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.js +15 -14
  29. package/dist/navigation-instruments/velocity-projection-plot/velocity-projection-plot.js.map +1 -1
  30. package/dist/navigation-instruments/watch/environment.d.ts +39 -1
  31. package/dist/navigation-instruments/watch/environment.d.ts.map +1 -1
  32. package/dist/navigation-instruments/watch/environment.js +71 -88
  33. package/dist/navigation-instruments/watch/environment.js.map +1 -1
  34. package/dist/navigation-instruments/watch/watch.d.ts +1 -1
  35. package/dist/navigation-instruments/watch/watch.d.ts.map +1 -1
  36. package/dist/navigation-instruments/watch/watch.js +4 -4
  37. package/dist/navigation-instruments/watch/watch.js.map +1 -1
  38. package/dist/navigation-instruments/wind/wind.d.ts +1 -1
  39. package/dist/navigation-instruments/wind/wind.d.ts.map +1 -1
  40. package/dist/navigation-instruments/wind/wind.js +3 -3
  41. package/dist/navigation-instruments/wind/wind.js.map +1 -1
  42. package/dist/navigation-instruments/wind-indicator/wind-indicator.d.ts +63 -9
  43. package/dist/navigation-instruments/wind-indicator/wind-indicator.d.ts.map +1 -1
  44. package/dist/navigation-instruments/wind-indicator/wind-indicator.js +57 -1995
  45. package/dist/navigation-instruments/wind-indicator/wind-indicator.js.map +1 -1
  46. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts +1 -1
  47. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.d.ts.map +1 -1
  48. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js +4 -4
  49. package/dist/navigation-instruments/wind-propulsion/wind-propulsion.js.map +1 -1
  50. package/eslint.config.mjs +589 -0
  51. package/fix-imports.mjs +185 -0
  52. package/fix-js-extensions.mjs +44 -0
  53. package/lit-localize.json +15 -0
  54. package/new-component.ts +148 -0
  55. package/package.json +56 -3
  56. package/postcss.config.mjs +195 -0
  57. package/script/check-css-mixins.ts +191 -0
  58. package/script/check-css-variables.ts +280 -0
  59. package/script/convert-icons.ts +202 -0
  60. package/script/convert-vessel-svg-to-ts.ts +110 -0
  61. package/script/docgen/README.md +95 -0
  62. package/script/docgen/docs-gen.ts +225 -0
  63. package/script/docgen/prompt-system.txt +187 -0
  64. package/script/download-alert-icons.ts +193 -0
  65. package/script/download-icons.ts +314 -0
  66. package/script/figmavariables.json +139 -0
  67. package/script/generate-bundle-entry.ts +77 -0
  68. package/script/prepare-full-bundle.ts +105 -0
  69. package/script/sort-custom-element-manifest.ts +67 -0
  70. package/src/components/badge/badge.css +15 -15
  71. package/src/components/badge/badge.stories.ts +2 -0
  72. package/src/components/icon-button/icon-button.ts +4 -0
  73. package/src/navigation-instruments/compass/compass.stories.ts +5 -2
  74. package/src/navigation-instruments/compass/compass.ts +4 -4
  75. package/src/navigation-instruments/compass-indicator/compass-indicator.stories.ts +34 -1
  76. package/src/navigation-instruments/compass-indicator/compass-indicator.ts +19 -1
  77. package/src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.stories.ts +13 -13
  78. package/src/navigation-instruments/velocity-projection-plot/velocity-projection-plot.ts +15 -11
  79. package/src/navigation-instruments/watch/environment.ts +120 -87
  80. package/src/navigation-instruments/watch/watch.stories.ts +2 -2
  81. package/src/navigation-instruments/watch/watch.ts +3 -3
  82. package/src/navigation-instruments/wind/wind.stories.ts +4 -3
  83. package/src/navigation-instruments/wind/wind.ts +2 -2
  84. package/src/navigation-instruments/wind-indicator/wind-indicator.stories.ts +22 -12
  85. package/src/navigation-instruments/wind-indicator/wind-indicator.ts +91 -46
  86. package/src/navigation-instruments/wind-propulsion/wind-propulsion.stories.ts +3 -3
  87. package/src/navigation-instruments/wind-propulsion/wind-propulsion.ts +3 -3
  88. package/tsconfig.json +38 -0
  89. package/vite.config.ts +107 -0
  90. package/vitest.browser.config.ts +14 -0
  91. package/vitest.config.ts +51 -0
  92. package/xliff/es-419.xlf +111 -0
  93. package/xliff/fi-FI.xlf +139 -0
  94. package/dist/NotoSans.ttf +0 -0
  95. package/dist/oicl.svg +0 -4
@@ -0,0 +1,197 @@
1
+ import {create} from 'storybook/theming/create';
2
+ import {
3
+ STORYBOOK_STABLE_URL,
4
+ STORYBOOK_DEVELOP_URL,
5
+ isStable,
6
+ } from './channels.js';
7
+
8
+ // OpenBridge Design System Colors
9
+ const colors = {
10
+ // Day/Light theme colors
11
+ day: {
12
+ // Backgrounds
13
+ containerGlobal: 'rgb(252, 252, 252)',
14
+ containerBackground: 'rgb(247, 247, 247)',
15
+ containerSection: 'rgb(240, 240, 240)',
16
+ containerBackdrop: 'rgb(224, 224, 224)',
17
+
18
+ // Elements
19
+ elementActive: 'rgb(31, 31, 31)',
20
+ elementNeutral: 'rgb(83, 83, 83)',
21
+ elementInactive: 'rgb(112, 112, 112)',
22
+ elementDisabled: 'rgb(190, 190, 190)',
23
+
24
+ // Borders
25
+ outline: 'rgb(221, 221, 221)',
26
+ divider: 'rgb(221, 221, 221)',
27
+ focus: 'rgb(66, 113, 179)',
28
+
29
+ // Brand blues
30
+ blue400: 'rgb(66, 113, 179)',
31
+ blue500: 'rgb(45, 84, 139)',
32
+ blue600: 'rgb(29, 60, 103)',
33
+
34
+ // Inputs
35
+ inputBg: 'rgb(255, 255, 255)',
36
+ inputBorder: 'rgb(190, 190, 190)',
37
+ inputHover: 'rgb(237, 237, 237)',
38
+ },
39
+
40
+ // Night/Dark theme colors
41
+ night: {
42
+ // Backgrounds
43
+ containerGlobal: 'rgb(18, 18, 18)',
44
+ containerBackground: 'rgb(24, 24, 24)',
45
+ containerSection: 'rgb(31, 31, 31)',
46
+ containerBackdrop: 'rgb(38, 38, 38)',
47
+
48
+ // Elements
49
+ elementActive: 'rgb(233, 233, 233)',
50
+ elementNeutral: 'rgb(180, 180, 180)',
51
+ elementInactive: 'rgb(140, 140, 140)',
52
+ elementDisabled: 'rgb(90, 90, 90)',
53
+
54
+ // Borders
55
+ outline: 'rgb(60, 60, 60)',
56
+ divider: 'rgb(50, 50, 50)',
57
+ focus: 'rgb(150, 196, 254)',
58
+
59
+ // Brand blues
60
+ blue300: 'rgb(93, 143, 213)',
61
+ blue400: 'rgb(66, 113, 179)',
62
+ blue100: 'rgb(202, 222, 252)',
63
+
64
+ // Inputs
65
+ inputBg: 'rgb(38, 38, 38)',
66
+ inputBorder: 'rgb(60, 60, 60)',
67
+ inputHover: 'rgb(50, 50, 50)',
68
+ },
69
+ };
70
+
71
+ // Typography
72
+ const typography = {
73
+ fontBase: '"Noto Sans", sans-serif',
74
+ fontCode: 'monospace',
75
+ };
76
+
77
+ // Brand
78
+ // `brandTitle` accepts raw HTML so we can stack the wordmark and a small
79
+ // secondary link to the other release channel. Inline styles use
80
+ // `currentColor` so the link inherits each theme's `barTextColor`.
81
+ const brand = {
82
+ brandTitle: `
83
+ <span style="display: inline-flex; flex-direction: column; align-items: flex-start; line-height: 1.2;">
84
+ <span style="font-weight: 700;">OpenBridge</span>
85
+ <a
86
+ href="${isStable ? STORYBOOK_DEVELOP_URL : STORYBOOK_STABLE_URL}"
87
+ target="_blank"
88
+ rel="noopener noreferrer"
89
+ style="font-size: 11px; opacity: 0.75; color: currentColor; text-decoration: underline; margin-top: 2px;"
90
+ >View ${isStable ? 'Develop' : 'Stable'} Build →</a>
91
+ </span>
92
+ `,
93
+ brandUrl: 'https://www.openbridge.no/',
94
+ // brandImage: '/assets/openbridge-logo.svg', // Uncomment if you have a logo
95
+ };
96
+
97
+ /**
98
+ * OpenBridge Dark Theme (Night/Dusk)
99
+ * Use this for dark mode preference
100
+ */
101
+ export const openbridgeDark = create({
102
+ base: 'dark',
103
+
104
+ // Typography
105
+ ...typography,
106
+
107
+ // Brand
108
+ ...brand,
109
+
110
+ // Primary colors - using brighter colors for better visibility
111
+ colorPrimary: colors.night.focus, // Light blue - used for selected sidebar item
112
+ colorSecondary: colors.night.elementActive,
113
+
114
+ // UI backgrounds
115
+ appBg: colors.night.containerBackground,
116
+ appContentBg: colors.night.containerSection,
117
+ appPreviewBg: colors.night.containerSection,
118
+ appBorderColor: colors.night.outline,
119
+ appBorderRadius: 4,
120
+
121
+ // Text colors - improved contrast
122
+ textColor: colors.night.elementActive,
123
+ textInverseColor: colors.day.elementActive,
124
+ textMutedColor: colors.night.elementNeutral,
125
+
126
+ // Toolbar colors
127
+ barTextColor: colors.night.elementNeutral,
128
+ barHoverColor: colors.night.elementActive,
129
+ barSelectedColor: colors.night.elementActive,
130
+ barBg: colors.night.containerBackdrop,
131
+
132
+ // Form colors - fixes the search input issue!
133
+ inputBg: colors.night.inputBg,
134
+ inputBorder: colors.night.inputBorder,
135
+ inputTextColor: colors.night.elementActive,
136
+ inputBorderRadius: 4,
137
+
138
+ // Button colors
139
+ buttonBg: colors.night.inputBg,
140
+ buttonBorder: colors.night.inputBorder,
141
+
142
+ // Boolean inputs
143
+ booleanBg: colors.night.inputBg,
144
+ booleanSelectedBg: colors.night.blue400,
145
+ });
146
+
147
+ /**
148
+ * OpenBridge Light Theme (Day/Bright)
149
+ * Use this for light mode preference
150
+ */
151
+ export const openbridgeLight = create({
152
+ base: 'light',
153
+
154
+ // Typography
155
+ ...typography,
156
+
157
+ // Brand
158
+ ...brand,
159
+
160
+ colorPrimary: colors.day.containerBackdrop,
161
+ colorSecondary: colors.day.blue500,
162
+
163
+ // UI backgrounds
164
+ appBg: colors.day.containerBackground,
165
+ appContentBg: colors.day.containerGlobal,
166
+ appPreviewBg: colors.day.containerSection,
167
+ appBorderColor: colors.day.outline,
168
+ appBorderRadius: 4,
169
+
170
+ // Text colors
171
+ textColor: colors.day.elementActive,
172
+ textInverseColor: colors.night.elementActive,
173
+ textMutedColor: colors.day.elementNeutral,
174
+
175
+ // Toolbar colors
176
+ barTextColor: colors.day.elementNeutral,
177
+ barHoverColor: colors.day.elementActive,
178
+ barSelectedColor: colors.day.blue500,
179
+ barBg: colors.day.containerGlobal,
180
+
181
+ // Form colors - fixes the search input issue!
182
+ inputBg: colors.day.inputBg,
183
+ inputBorder: colors.day.inputBorder,
184
+ inputTextColor: colors.day.elementActive,
185
+ inputBorderRadius: 4,
186
+
187
+ // Button colors
188
+ buttonBg: colors.day.inputBg,
189
+ buttonBorder: colors.day.inputBorder,
190
+
191
+ // Boolean inputs
192
+ booleanBg: colors.day.containerBackdrop,
193
+ booleanSelectedBg: colors.day.blue500,
194
+ });
195
+
196
+ // Default export for backwards compatibility
197
+ export default openbridgeDark;
@@ -0,0 +1,15 @@
1
+ <style>
2
+ * {
3
+ font-family: Noto Sans;
4
+ }
5
+
6
+ .sb-show-main,
7
+ .docs-story {
8
+ background-color: var(--container-background-color);
9
+ }
10
+ </style>
11
+ <script>
12
+ (function () {
13
+ document.documentElement.setAttribute('data-obc-theme', 'day');
14
+ })();
15
+ </script>
@@ -0,0 +1,129 @@
1
+ import PreviewTemplate from './PreviewTemplate.js';
2
+
3
+ import '../src/main.css';
4
+ import {
5
+ Preview,
6
+ setCustomElementsManifest,
7
+ } from '@storybook/web-components-vite';
8
+
9
+ import customElements from '../custom-elements.json';
10
+ import {withActions} from './action-handler.js';
11
+
12
+ setCustomElementsManifest(customElements);
13
+
14
+ import {withThemeByDataAttribute} from '@storybook/addon-themes';
15
+ import {DecoratorFunction} from 'storybook/internal/types';
16
+ import {html} from 'lit';
17
+ import React from 'react';
18
+
19
+ export const decorators: DecoratorFunction[] = [
20
+ withThemeByDataAttribute({
21
+ themes: {
22
+ night: 'night',
23
+ dusk: 'dusk',
24
+ day: 'day',
25
+ bright: 'bright',
26
+ },
27
+ defaultTheme: 'day',
28
+ attributeName: 'data-obc-theme',
29
+ }),
30
+ (story, context) => {
31
+ const sizeClass =
32
+ context.globals.componentSize || 'obc-component-size-regular';
33
+ return html`<div class="${sizeClass}">${story()}</div>`;
34
+ },
35
+ withActions,
36
+ ];
37
+
38
+ const preview: Preview = {
39
+ globalTypes: {
40
+ componentSize: {
41
+ name: 'Component Size',
42
+ description: 'Global component size class',
43
+ defaultValue: 'obc-component-size-regular',
44
+ toolbar: {
45
+ icon: 'expandalt',
46
+ items: [
47
+ {value: 'obc-component-size-regular', title: 'Regular'},
48
+ {value: 'obc-component-size-medium', title: 'Medium'},
49
+ {value: 'obc-component-size-large', title: 'Large'},
50
+ {value: 'obc-component-size-xl', title: 'XL'},
51
+ ],
52
+ showName: true,
53
+ },
54
+ },
55
+ cross: {
56
+ name: 'Cross',
57
+ description: 'Cross',
58
+ defaultValue: true,
59
+ toolbar: {
60
+ icon: 'cross',
61
+ items: [
62
+ {value: false, title: 'Cross: off'},
63
+ {value: true, title: 'Cross: on'},
64
+ ],
65
+ showName: true,
66
+ },
67
+ },
68
+ },
69
+ parameters: {
70
+ options: {
71
+ storySort: {
72
+ order: [
73
+ 'Introduction',
74
+ ['Introduction', 'Getting Started'],
75
+ 'Application Components',
76
+ 'UI Components',
77
+ 'Bars and Graphs',
78
+ 'Instruments',
79
+ 'Indicators',
80
+ 'Automation',
81
+ 'AR',
82
+ 'Integration',
83
+ 'Pages',
84
+ '*',
85
+ 'Building Blocks',
86
+ ],
87
+ },
88
+ },
89
+ controls: {
90
+ matchers: {
91
+ color: /(background|color)$/i,
92
+ date: /Date$/i,
93
+ },
94
+ },
95
+
96
+ backgrounds: {
97
+ grid: {
98
+ cellSize: 8,
99
+ },
100
+ default: 'container-background-color',
101
+ options: {
102
+ 'container-section-color': {
103
+ name: 'container-section-color',
104
+ value: 'var(--container-section-color)',
105
+ default: true,
106
+ },
107
+ 'container-background-color': {
108
+ name: 'container-background-color',
109
+ value: 'var(--container-background-color)',
110
+ },
111
+ 'integration-container-global-color': {
112
+ name: 'integration-container-global-color',
113
+ value: 'var(--integration-container-global-color)',
114
+ },
115
+ },
116
+ },
117
+
118
+ docs: {
119
+ page: () => <PreviewTemplate />,
120
+ codePanel: true,
121
+ },
122
+ },
123
+ tags: ['autodocs', 'snapshot'],
124
+ initialGlobals: {
125
+ componentSize: 'obc-component-size-regular',
126
+ },
127
+ };
128
+
129
+ export default preview;
@@ -0,0 +1,23 @@
1
+ import {setProjectAnnotations} from '@storybook/web-components-vite';
2
+ import * as projectAnnotations from './preview.js';
3
+ import {vis, visAnnotations} from 'storybook-addon-vis/vitest-setup';
4
+
5
+ // Disable all animations and transitions to prevent flaky visual tests
6
+ const style = document.createElement('style');
7
+ style.textContent = `
8
+ *, *::before, *::after {
9
+ animation-duration: 0s !important;
10
+ animation-delay: 0s !important;
11
+ transition-duration: 0s !important;
12
+ transition-delay: 0s !important;
13
+ }
14
+ `;
15
+ document.head.appendChild(style);
16
+
17
+ // This is an important step to apply the right configuration when testing your
18
+ // stories.
19
+ // More info at:
20
+ // https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
21
+ setProjectAnnotations([projectAnnotations, visAnnotations]);
22
+
23
+ vis.setup();