@oicl/openbridge-webcomponents-full-bundle 2.0.0-next.48 → 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.
- package/.storybook/ComponentPreview.tsx +26 -0
- package/.storybook/PreviewTemplate.tsx +99 -0
- package/.storybook/action-handler.ts +81 -0
- package/.storybook/channels.ts +44 -0
- package/.storybook/main.ts +313 -0
- package/.storybook/manager.ts +71 -0
- package/.storybook/openbridgeTheme.ts +197 -0
- package/.storybook/preview-head.html +15 -0
- package/.storybook/preview.tsx +129 -0
- package/.storybook/vitest.setup.ts +23 -0
- package/bundle/openbridge-webcomponents.bundle.js.map +1 -1
- package/custom-elements.json +7 -1
- package/dist/components/icon-button/icon-button.d.ts +4 -0
- package/dist/components/icon-button/icon-button.d.ts.map +1 -1
- package/dist/components/icon-button/icon-button.js.map +1 -1
- package/eslint.config.mjs +589 -0
- package/fix-imports.mjs +185 -0
- package/fix-js-extensions.mjs +44 -0
- package/lit-localize.json +15 -0
- package/new-component.ts +148 -0
- package/package.json +55 -3
- package/postcss.config.mjs +195 -0
- package/script/check-css-mixins.ts +191 -0
- package/script/check-css-variables.ts +280 -0
- package/script/convert-icons.ts +202 -0
- package/script/convert-vessel-svg-to-ts.ts +110 -0
- package/script/docgen/README.md +95 -0
- package/script/docgen/docs-gen.ts +225 -0
- package/script/docgen/prompt-system.txt +187 -0
- package/script/download-alert-icons.ts +193 -0
- package/script/download-icons.ts +314 -0
- package/script/figmavariables.json +139 -0
- package/script/generate-bundle-entry.ts +77 -0
- package/script/prepare-full-bundle.ts +105 -0
- package/script/sort-custom-element-manifest.ts +67 -0
- package/src/components/icon-button/icon-button.ts +4 -0
- package/vite.config.ts +107 -0
- package/vitest.browser.config.ts +14 -0
- package/vitest.config.ts +51 -0
- package/xliff/es-419.xlf +111 -0
- package/xliff/fi-FI.xlf +139 -0
- package/dist/NotoSans.ttf +0 -0
- 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();
|