@oicl/openbridge-webcomponents 0.0.13 → 0.0.14
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +11 -0
- package/__snapshots__/automation-button--damper-badges.png +0 -0
- package/__snapshots__/automation-button--damper-off.png +0 -0
- package/__snapshots__/automation-button--damper-on.png +0 -0
- package/__snapshots__/automation-button--motor-off.png +0 -0
- package/__snapshots__/automation-button--motor-on.png +0 -0
- package/__snapshots__/automation-button--switch-off.png +0 -0
- package/__snapshots__/automation-button--switch-on.png +0 -0
- package/__snapshots__/automation-button--three-way-valve-open-right.png +0 -0
- package/__snapshots__/automation-button--valve-alert.png +0 -0
- package/__snapshots__/automation-button--valve-badges.png +0 -0
- package/__snapshots__/automation-button--valve-closed.png +0 -0
- package/__snapshots__/automation-button--valve-open.png +0 -0
- package/__snapshots__/automation-button--valve-progress.png +0 -0
- package/__snapshots__/automation-readout--usage-with-pipe-bottom.png +0 -0
- package/__snapshots__/automation-readout--usage-with-pipe-left.png +0 -0
- package/__snapshots__/automation-readout--usage-with-pipe-right.png +0 -0
- package/__snapshots__/automation-readout--usage-with-pipe-top.png +0 -0
- package/__snapshots__/automation-tank--compact.png +0 -0
- package/__snapshots__/automation-tank--vertical-with-badges.png +0 -0
- package/__snapshots__/automation-tank--vertical.png +0 -0
- package/__snapshots__/line-corner-line--primary.png +0 -0
- package/__snapshots__/line-cross--primary.png +0 -0
- package/__snapshots__/line-direction--primary.png +0 -0
- package/__snapshots__/line-end-point-line--primary.png +0 -0
- package/__snapshots__/line-example--air.png +0 -0
- package/__snapshots__/line-example--connector.png +0 -0
- package/__snapshots__/line-example--electric.png +0 -0
- package/__snapshots__/line-example--fluid.png +0 -0
- package/__snapshots__/line-horizontal-line--primary.png +0 -0
- package/__snapshots__/line-overlap--primary.png +0 -0
- package/__snapshots__/line-three-way-line--primary.png +0 -0
- package/__snapshots__/line-vertical-line--primary.png +0 -0
- package/custom-elements.json +404 -379
- package/dist/automation/automation-button/automation-button.css.js +75 -0
- package/dist/automation/automation-button/automation-button.css.js.map +1 -1
- package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
- package/dist/automation/automation-button/automation-button.js +46 -44
- package/dist/automation/automation-button/automation-button.js.map +1 -1
- package/dist/automation/automation-tank/automation-tank.css.js +2 -1
- package/dist/automation/automation-tank/automation-tank.css.js.map +1 -1
- package/dist/automation/corner-line/corner-line.d.ts.map +1 -1
- package/dist/automation/corner-line/corner-line.js +6 -0
- package/dist/automation/corner-line/corner-line.js.map +1 -1
- package/dist/automation/direction-line/direction-line.d.ts.map +1 -1
- package/dist/automation/direction-line/direction-line.js +5 -0
- package/dist/automation/direction-line/direction-line.js.map +1 -1
- package/dist/automation/end-point-line/end-point-line.d.ts.map +1 -1
- package/dist/automation/end-point-line/end-point-line.js +23 -0
- package/dist/automation/end-point-line/end-point-line.js.map +1 -1
- package/dist/automation/horizontal-line/horizontal-line.d.ts.map +1 -1
- package/dist/automation/horizontal-line/horizontal-line.js +2 -1
- package/dist/automation/horizontal-line/horizontal-line.js.map +1 -1
- package/dist/automation/line-cross/line-cross.d.ts.map +1 -1
- package/dist/automation/line-cross/line-cross.js +6 -0
- package/dist/automation/line-cross/line-cross.js.map +1 -1
- package/dist/automation/line-overlap/line-overlap.d.ts.map +1 -1
- package/dist/automation/line-overlap/line-overlap.js +6 -0
- package/dist/automation/line-overlap/line-overlap.js.map +1 -1
- package/dist/automation/three-way-line/three-way-line.d.ts.map +1 -1
- package/dist/automation/three-way-line/three-way-line.js +6 -0
- package/dist/automation/three-way-line/three-way-line.js.map +1 -1
- package/dist/automation/vertical-line/vertical-line.d.ts.map +1 -1
- package/dist/automation/vertical-line/vertical-line.js +2 -1
- package/dist/automation/vertical-line/vertical-line.js.map +1 -1
- package/dist/storybook-util.d.ts +2 -1
- package/dist/storybook-util.d.ts.map +1 -1
- package/dist/storybook-util.js +40 -0
- package/dist/storybook-util.js.map +1 -1
- package/package.json +1 -1
- package/src/automation/automation-button/automation-button.css +81 -0
- package/src/automation/automation-button/automation-button.stories.ts +2 -0
- package/src/automation/automation-button/automation-button.ts +61 -59
- package/src/automation/automation-readout/automation-readout.stories.ts +8 -31
- package/src/automation/automation-tank/automation-tank.css +2 -1
- package/src/automation/automation-tank/automation-tank.stories.ts +2 -8
- package/src/automation/corner-line/corner-line.stories.ts +2 -0
- package/src/automation/corner-line/corner-line.ts +6 -0
- package/src/automation/direction-line/direction-line.stories.ts +2 -0
- package/src/automation/direction-line/direction-line.ts +5 -0
- package/src/automation/end-point-line/end-point-line.stories.ts +2 -0
- package/src/automation/end-point-line/end-point-line.ts +23 -0
- package/src/automation/horizontal-line/horizontal-line.stories.ts +2 -0
- package/src/automation/horizontal-line/horizontal-line.ts +2 -1
- package/src/automation/line-cross/line-cross.stories.ts +2 -0
- package/src/automation/line-cross/line-cross.ts +6 -0
- package/src/automation/line-overlap/line-overlap.stories.ts +2 -0
- package/src/automation/line-overlap/line-overlap.ts +6 -0
- package/src/automation/line.stories.ts +4 -4
- package/src/automation/three-way-line/three-way-line.stories.ts +2 -0
- package/src/automation/three-way-line/three-way-line.ts +6 -0
- package/src/automation/vertical-line/vertical-line.stories.ts +2 -36
- package/src/automation/vertical-line/vertical-line.ts +2 -1
- package/src/storybook-util.ts +41 -1
@@ -57,6 +57,7 @@ export class ObcEndPointLine extends LitElement {
|
|
57
57
|
fill="none"
|
58
58
|
xmlns="http://www.w3.org/2000/svg"
|
59
59
|
transform="rotate(${rotation})"
|
60
|
+
class="${this.direction}"
|
60
61
|
>
|
61
62
|
<path
|
62
63
|
d="M${12 - h} 25 V${12 + h}h-${(terminalWidth - width) /
|
@@ -74,6 +75,28 @@ export class ObcEndPointLine extends LitElement {
|
|
74
75
|
display: block;
|
75
76
|
line-height: 0;
|
76
77
|
}
|
78
|
+
|
79
|
+
svg {
|
80
|
+
position: relative;
|
81
|
+
|
82
|
+
&.top,
|
83
|
+
&.bottom {
|
84
|
+
left: -12px;
|
85
|
+
}
|
86
|
+
|
87
|
+
&.bottom {
|
88
|
+
top: -24px;
|
89
|
+
}
|
90
|
+
|
91
|
+
&.left,
|
92
|
+
&.right {
|
93
|
+
top: -12px;
|
94
|
+
}
|
95
|
+
|
96
|
+
&.right {
|
97
|
+
left: -24px;
|
98
|
+
}
|
99
|
+
}
|
77
100
|
`;
|
78
101
|
}
|
79
102
|
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
2
|
import {ObcHorizontalLine} from './horizontal-line';
|
3
3
|
import './horizontal-line';
|
4
|
+
import {crossDecorator} from '../../storybook-util';
|
4
5
|
|
5
6
|
const meta: Meta<typeof ObcHorizontalLine> = {
|
6
7
|
title: 'Line/Horizontal line',
|
7
8
|
tags: ['autodocs'],
|
8
9
|
component: 'obc-horizontal-line',
|
10
|
+
decorators: [crossDecorator],
|
9
11
|
argTypes: {
|
10
12
|
medium: {
|
11
13
|
options: ['normal', 'empty', 'water'],
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
2
|
import {ObcLineCross} from './line-cross';
|
3
3
|
import './line-cross';
|
4
|
+
import {crossDecorator} from '../../storybook-util';
|
4
5
|
|
5
6
|
const meta: Meta<typeof ObcLineCross> = {
|
6
7
|
title: 'Line/Cross',
|
7
8
|
tags: ['autodocs'],
|
8
9
|
component: 'obc-line-cross',
|
10
|
+
decorators: [crossDecorator],
|
9
11
|
argTypes: {
|
10
12
|
medium: {
|
11
13
|
options: ['normal', 'empty', 'water'],
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
2
|
import {ObcLineOverlap} from './line-overlap';
|
3
3
|
import './line-overlap';
|
4
|
+
import {crossDecorator} from '../../storybook-util';
|
4
5
|
|
5
6
|
const meta: Meta<typeof ObcLineOverlap> = {
|
6
7
|
title: 'Line/Overlap',
|
7
8
|
tags: ['autodocs'],
|
8
9
|
component: 'obc-line-overlap',
|
9
10
|
args: {},
|
11
|
+
decorators: [crossDecorator],
|
10
12
|
argTypes: {
|
11
13
|
medium: {
|
12
14
|
options: ['normal', 'empty', 'water'],
|
@@ -38,7 +38,7 @@ const meta: Meta = {
|
|
38
38
|
|
39
39
|
#line1 {
|
40
40
|
position: absolute;
|
41
|
-
top: calc(24px *
|
41
|
+
top: calc(24px * 0.5);
|
42
42
|
left: calc(24px * 0);
|
43
43
|
}
|
44
44
|
|
@@ -51,7 +51,7 @@ const meta: Meta = {
|
|
51
51
|
#line2 {
|
52
52
|
position: absolute;
|
53
53
|
top: calc(24px * 0);
|
54
|
-
left: calc(24px *
|
54
|
+
left: calc(24px * 0.5);
|
55
55
|
}
|
56
56
|
#corner-2-3 {
|
57
57
|
position: absolute;
|
@@ -61,7 +61,7 @@ const meta: Meta = {
|
|
61
61
|
|
62
62
|
#line3 {
|
63
63
|
position: absolute;
|
64
|
-
top: calc(24px *
|
64
|
+
top: calc(24px * 0.5);
|
65
65
|
left: calc(24px * 6);
|
66
66
|
}
|
67
67
|
#three-way {
|
@@ -80,7 +80,7 @@ const meta: Meta = {
|
|
80
80
|
<obc-vertical-line
|
81
81
|
medium=${args.medium}
|
82
82
|
lineType=${args.lineType}
|
83
|
-
length="5"
|
83
|
+
length="5.5"
|
84
84
|
id="line1"
|
85
85
|
></obc-vertical-line>
|
86
86
|
<obc-corner-line
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
2
|
import {ObcThreeWayLine} from './three-way-line';
|
3
3
|
import './three-way-line';
|
4
|
+
import {crossDecorator} from '../../storybook-util';
|
4
5
|
|
5
6
|
const meta: Meta<typeof ObcThreeWayLine> = {
|
6
7
|
title: 'Line/Three way line',
|
7
8
|
tags: ['autodocs'],
|
8
9
|
component: 'obc-three-way-line',
|
10
|
+
decorators: [crossDecorator],
|
9
11
|
argTypes: {
|
10
12
|
medium: {
|
11
13
|
options: ['normal', 'empty', 'water'],
|
@@ -2,7 +2,7 @@ import type {Meta, StoryObj} from '@storybook/web-components';
|
|
2
2
|
import {ObcVerticalLine} from './vertical-line';
|
3
3
|
import './vertical-line';
|
4
4
|
import '../horizontal-line/horizontal-line';
|
5
|
-
import {
|
5
|
+
import {crossDecorator} from '../../storybook-util';
|
6
6
|
|
7
7
|
const meta: Meta<typeof ObcVerticalLine> = {
|
8
8
|
title: 'Line/Vertical line',
|
@@ -14,6 +14,7 @@ const meta: Meta<typeof ObcVerticalLine> = {
|
|
14
14
|
control: {type: 'radio'},
|
15
15
|
},
|
16
16
|
},
|
17
|
+
decorators: [crossDecorator],
|
17
18
|
} satisfies Meta<ObcVerticalLine>;
|
18
19
|
|
19
20
|
export default meta;
|
@@ -34,38 +35,3 @@ export const Primary: Story = {
|
|
34
35
|
},
|
35
36
|
},
|
36
37
|
};
|
37
|
-
|
38
|
-
export const Complex: Story = {
|
39
|
-
render: () => {
|
40
|
-
return html`
|
41
|
-
<style>
|
42
|
-
.canvas {
|
43
|
-
position: relative;
|
44
|
-
width: 400px;
|
45
|
-
height: 400px;
|
46
|
-
}
|
47
|
-
|
48
|
-
#line1 {
|
49
|
-
position: absolute;
|
50
|
-
top: 24px;
|
51
|
-
}
|
52
|
-
|
53
|
-
#line2 {
|
54
|
-
position: absolute;
|
55
|
-
top: calc(24px * 3);
|
56
|
-
left: calc(24px * 5);
|
57
|
-
}
|
58
|
-
#line3 {
|
59
|
-
position: absolute;
|
60
|
-
top: calc(24px * 3);
|
61
|
-
left: calc(24px * 5);
|
62
|
-
}
|
63
|
-
</style>
|
64
|
-
<div class="canvas">
|
65
|
-
<obc-vertical-line length="5" id="line1"></obc-vertical-line>
|
66
|
-
<obc-vertical-line length="2" id="line2"></obc-vertical-line>
|
67
|
-
<obc-horizontal-line length="5" id="line3"></obc-horizontal-line>
|
68
|
-
</div>
|
69
|
-
`;
|
70
|
-
},
|
71
|
-
};
|
package/src/storybook-util.ts
CHANGED
@@ -5,7 +5,7 @@ import './icons/icon-04-day';
|
|
5
5
|
import './icons/icon-04-brilliance-low';
|
6
6
|
import './icons/icon-04-brilliance-high';
|
7
7
|
import './icons/icon-06-ship';
|
8
|
-
import {TemplateResult, html} from 'lit';
|
8
|
+
import {HTMLTemplateResult, TemplateResult, html} from 'lit';
|
9
9
|
import {spread} from '@open-wc/lit-helpers';
|
10
10
|
|
11
11
|
export const iconIds = [
|
@@ -47,3 +47,43 @@ export function iconIdToIconHtml(
|
|
47
47
|
throw new Error(`Unknown icon id: ${id}`);
|
48
48
|
}
|
49
49
|
}
|
50
|
+
|
51
|
+
export function crossDecorator(story: () => unknown): HTMLTemplateResult {
|
52
|
+
return html` <style>
|
53
|
+
.wrapper {
|
54
|
+
width: 100%;
|
55
|
+
height: 100vh;
|
56
|
+
position: relative;
|
57
|
+
}
|
58
|
+
|
59
|
+
.wrapper > * {
|
60
|
+
position: absolute;
|
61
|
+
top: 50%;
|
62
|
+
left: 50%;
|
63
|
+
}
|
64
|
+
|
65
|
+
.wrapper::before {
|
66
|
+
content: '';
|
67
|
+
display: block;
|
68
|
+
position: absolute;
|
69
|
+
top: 0;
|
70
|
+
bottom: 0;
|
71
|
+
width: 1px;
|
72
|
+
left: calc(50% - 0.5px);
|
73
|
+
background-color: rgb(0, 0, 0, 0.3);
|
74
|
+
}
|
75
|
+
|
76
|
+
.wrapper::after {
|
77
|
+
content: '';
|
78
|
+
display: block;
|
79
|
+
position: absolute;
|
80
|
+
left: 0;
|
81
|
+
right: 0;
|
82
|
+
height: 1px;
|
83
|
+
top: calc(50% - 0.5px);
|
84
|
+
background-color: rgb(0, 0, 0, 0.3);
|
85
|
+
z-index: -100;
|
86
|
+
}
|
87
|
+
</style>
|
88
|
+
<div class="wrapper">${story()}</div>`;
|
89
|
+
}
|