@oicl/openbridge-webcomponents 0.0.13 → 0.0.14

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 (94) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/__snapshots__/automation-button--damper-badges.png +0 -0
  3. package/__snapshots__/automation-button--damper-off.png +0 -0
  4. package/__snapshots__/automation-button--damper-on.png +0 -0
  5. package/__snapshots__/automation-button--motor-off.png +0 -0
  6. package/__snapshots__/automation-button--motor-on.png +0 -0
  7. package/__snapshots__/automation-button--switch-off.png +0 -0
  8. package/__snapshots__/automation-button--switch-on.png +0 -0
  9. package/__snapshots__/automation-button--three-way-valve-open-right.png +0 -0
  10. package/__snapshots__/automation-button--valve-alert.png +0 -0
  11. package/__snapshots__/automation-button--valve-badges.png +0 -0
  12. package/__snapshots__/automation-button--valve-closed.png +0 -0
  13. package/__snapshots__/automation-button--valve-open.png +0 -0
  14. package/__snapshots__/automation-button--valve-progress.png +0 -0
  15. package/__snapshots__/automation-readout--usage-with-pipe-bottom.png +0 -0
  16. package/__snapshots__/automation-readout--usage-with-pipe-left.png +0 -0
  17. package/__snapshots__/automation-readout--usage-with-pipe-right.png +0 -0
  18. package/__snapshots__/automation-readout--usage-with-pipe-top.png +0 -0
  19. package/__snapshots__/automation-tank--compact.png +0 -0
  20. package/__snapshots__/automation-tank--vertical-with-badges.png +0 -0
  21. package/__snapshots__/automation-tank--vertical.png +0 -0
  22. package/__snapshots__/line-corner-line--primary.png +0 -0
  23. package/__snapshots__/line-cross--primary.png +0 -0
  24. package/__snapshots__/line-direction--primary.png +0 -0
  25. package/__snapshots__/line-end-point-line--primary.png +0 -0
  26. package/__snapshots__/line-example--air.png +0 -0
  27. package/__snapshots__/line-example--connector.png +0 -0
  28. package/__snapshots__/line-example--electric.png +0 -0
  29. package/__snapshots__/line-example--fluid.png +0 -0
  30. package/__snapshots__/line-horizontal-line--primary.png +0 -0
  31. package/__snapshots__/line-overlap--primary.png +0 -0
  32. package/__snapshots__/line-three-way-line--primary.png +0 -0
  33. package/__snapshots__/line-vertical-line--primary.png +0 -0
  34. package/custom-elements.json +404 -379
  35. package/dist/automation/automation-button/automation-button.css.js +75 -0
  36. package/dist/automation/automation-button/automation-button.css.js.map +1 -1
  37. package/dist/automation/automation-button/automation-button.d.ts.map +1 -1
  38. package/dist/automation/automation-button/automation-button.js +46 -44
  39. package/dist/automation/automation-button/automation-button.js.map +1 -1
  40. package/dist/automation/automation-tank/automation-tank.css.js +2 -1
  41. package/dist/automation/automation-tank/automation-tank.css.js.map +1 -1
  42. package/dist/automation/corner-line/corner-line.d.ts.map +1 -1
  43. package/dist/automation/corner-line/corner-line.js +6 -0
  44. package/dist/automation/corner-line/corner-line.js.map +1 -1
  45. package/dist/automation/direction-line/direction-line.d.ts.map +1 -1
  46. package/dist/automation/direction-line/direction-line.js +5 -0
  47. package/dist/automation/direction-line/direction-line.js.map +1 -1
  48. package/dist/automation/end-point-line/end-point-line.d.ts.map +1 -1
  49. package/dist/automation/end-point-line/end-point-line.js +23 -0
  50. package/dist/automation/end-point-line/end-point-line.js.map +1 -1
  51. package/dist/automation/horizontal-line/horizontal-line.d.ts.map +1 -1
  52. package/dist/automation/horizontal-line/horizontal-line.js +2 -1
  53. package/dist/automation/horizontal-line/horizontal-line.js.map +1 -1
  54. package/dist/automation/line-cross/line-cross.d.ts.map +1 -1
  55. package/dist/automation/line-cross/line-cross.js +6 -0
  56. package/dist/automation/line-cross/line-cross.js.map +1 -1
  57. package/dist/automation/line-overlap/line-overlap.d.ts.map +1 -1
  58. package/dist/automation/line-overlap/line-overlap.js +6 -0
  59. package/dist/automation/line-overlap/line-overlap.js.map +1 -1
  60. package/dist/automation/three-way-line/three-way-line.d.ts.map +1 -1
  61. package/dist/automation/three-way-line/three-way-line.js +6 -0
  62. package/dist/automation/three-way-line/three-way-line.js.map +1 -1
  63. package/dist/automation/vertical-line/vertical-line.d.ts.map +1 -1
  64. package/dist/automation/vertical-line/vertical-line.js +2 -1
  65. package/dist/automation/vertical-line/vertical-line.js.map +1 -1
  66. package/dist/storybook-util.d.ts +2 -1
  67. package/dist/storybook-util.d.ts.map +1 -1
  68. package/dist/storybook-util.js +40 -0
  69. package/dist/storybook-util.js.map +1 -1
  70. package/package.json +1 -1
  71. package/src/automation/automation-button/automation-button.css +81 -0
  72. package/src/automation/automation-button/automation-button.stories.ts +2 -0
  73. package/src/automation/automation-button/automation-button.ts +61 -59
  74. package/src/automation/automation-readout/automation-readout.stories.ts +8 -31
  75. package/src/automation/automation-tank/automation-tank.css +2 -1
  76. package/src/automation/automation-tank/automation-tank.stories.ts +2 -8
  77. package/src/automation/corner-line/corner-line.stories.ts +2 -0
  78. package/src/automation/corner-line/corner-line.ts +6 -0
  79. package/src/automation/direction-line/direction-line.stories.ts +2 -0
  80. package/src/automation/direction-line/direction-line.ts +5 -0
  81. package/src/automation/end-point-line/end-point-line.stories.ts +2 -0
  82. package/src/automation/end-point-line/end-point-line.ts +23 -0
  83. package/src/automation/horizontal-line/horizontal-line.stories.ts +2 -0
  84. package/src/automation/horizontal-line/horizontal-line.ts +2 -1
  85. package/src/automation/line-cross/line-cross.stories.ts +2 -0
  86. package/src/automation/line-cross/line-cross.ts +6 -0
  87. package/src/automation/line-overlap/line-overlap.stories.ts +2 -0
  88. package/src/automation/line-overlap/line-overlap.ts +6 -0
  89. package/src/automation/line.stories.ts +4 -4
  90. package/src/automation/three-way-line/three-way-line.stories.ts +2 -0
  91. package/src/automation/three-way-line/three-way-line.ts +6 -0
  92. package/src/automation/vertical-line/vertical-line.stories.ts +2 -36
  93. package/src/automation/vertical-line/vertical-line.ts +2 -1
  94. 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'],
@@ -78,9 +78,10 @@ export class ObcHorizontalLine extends LitElement {
78
78
  display: block;
79
79
  line-height: 0;
80
80
  }
81
- .line {
81
+ svg {
82
82
  position: relative;
83
83
  left: -0.5px;
84
+ top: -12px;
84
85
  }
85
86
  `;
86
87
  }
@@ -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'],
@@ -107,6 +107,12 @@ export class ObcLineCross extends LitElement {
107
107
  display: block;
108
108
  line-height: 0;
109
109
  }
110
+
111
+ svg {
112
+ position: relative;
113
+ top: -12px;
114
+ left: -12px;
115
+ }
110
116
  `;
111
117
  }
112
118
 
@@ -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'],
@@ -59,6 +59,12 @@ export class ObcLineOverlap extends LitElement {
59
59
  display: block;
60
60
  line-height: 0;
61
61
  }
62
+
63
+ svg {
64
+ position: relative;
65
+ left: -12px;
66
+ top: -12px;
67
+ }
62
68
  `;
63
69
  }
64
70
 
@@ -38,7 +38,7 @@ const meta: Meta = {
38
38
 
39
39
  #line1 {
40
40
  position: absolute;
41
- top: calc(24px * 1);
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 * 1);
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 * 1);
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'],
@@ -103,6 +103,12 @@ export class ObcThreeWayLine extends LitElement {
103
103
  display: block;
104
104
  line-height: 0;
105
105
  }
106
+
107
+ svg {
108
+ position: relative;
109
+ top: -12px;
110
+ left: -12px;
111
+ }
106
112
  `;
107
113
  }
108
114
 
@@ -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 {html} from 'lit';
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
- };
@@ -82,9 +82,10 @@ export class ObcVerticalLine extends LitElement {
82
82
  line-height: 0;
83
83
  }
84
84
 
85
- .line {
85
+ svg {
86
86
  position: relative;
87
87
  top: -0.5px;
88
+ left: -12px;
88
89
  }
89
90
  `;
90
91
  }
@@ -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
+ }