@oicl/openbridge-webcomponents 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- package/.release-it.json +1 -1
- package/.storybook/preview.ts +0 -1
- package/CHANGELOG.md +13 -1
- package/__snapshots__/application-topbar--inactive.png +0 -0
- package/__snapshots__/button-button--raised-disabled.png +0 -0
- package/__snapshots__/input-slider--no-icons.png +0 -0
- package/__snapshots__/input-slider--no-value.png +0 -0
- package/__snapshots__/line-corner-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-vertical-line--complex.png +0 -0
- package/__snapshots__/line-vertical-line--primary.png +0 -0
- package/custom-elements.json +764 -399
- package/dist/automation/corner-line/corner-line.d.ts +22 -0
- package/dist/automation/corner-line/corner-line.d.ts.map +1 -0
- package/dist/automation/corner-line/corner-line.js +161 -0
- package/dist/automation/corner-line/corner-line.js.map +1 -0
- package/dist/automation/horizontal-line/horizontal-line.d.ts +15 -0
- package/dist/automation/horizontal-line/horizontal-line.d.ts.map +1 -0
- package/dist/automation/horizontal-line/horizontal-line.js +110 -0
- package/dist/automation/horizontal-line/horizontal-line.js.map +1 -0
- package/dist/automation/index.d.ts +20 -0
- package/dist/automation/index.d.ts.map +1 -0
- package/dist/automation/index.js +42 -0
- package/dist/automation/index.js.map +1 -0
- package/dist/automation/vertical-line/vertical-line.d.ts +15 -0
- package/dist/automation/vertical-line/vertical-line.d.ts.map +1 -0
- package/dist/automation/vertical-line/vertical-line.js +111 -0
- package/dist/automation/vertical-line/vertical-line.js.map +1 -0
- package/dist/components/brilliance-menu/brilliance-menu.d.ts.map +1 -1
- package/dist/components/brilliance-menu/brilliance-menu.js +2 -0
- package/dist/components/brilliance-menu/brilliance-menu.js.map +1 -1
- package/dist/components/slider/slider.css.js +20 -0
- package/dist/components/slider/slider.css.js.map +1 -1
- package/dist/components/slider/slider.d.ts +8 -0
- package/dist/components/slider/slider.d.ts.map +1 -1
- package/dist/components/slider/slider.js +44 -18
- package/dist/components/slider/slider.js.map +1 -1
- package/dist/components/top-bar/top-bar.css.js +5 -1
- package/dist/components/top-bar/top-bar.css.js.map +1 -1
- package/dist/components/top-bar/top-bar.d.ts.map +1 -1
- package/dist/components/top-bar/top-bar.js +8 -8
- package/dist/components/top-bar/top-bar.js.map +1 -1
- package/package.json +18 -25
- package/src/automation/corner-line/corner-line.stories.ts +31 -0
- package/src/automation/corner-line/corner-line.ts +167 -0
- package/src/automation/horizontal-line/horizontal-line.stories.ts +28 -0
- package/src/automation/horizontal-line/horizontal-line.ts +100 -0
- package/src/automation/index.ts +41 -0
- package/src/automation/line.stories.ts +142 -0
- package/src/automation/vertical-line/vertical-line.stories.ts +71 -0
- package/src/automation/vertical-line/vertical-line.ts +104 -0
- package/src/components/brilliance-menu/brilliance-menu.ts +2 -0
- package/src/components/slider/slider.css +20 -0
- package/src/components/slider/slider.stories.ts +20 -1
- package/src/components/slider/slider.ts +43 -19
- package/src/components/top-bar/top-bar.css +4 -0
- package/src/components/top-bar/top-bar.ts +10 -8
- package/src/palettes/variables.css +64 -43
- package/script/svg-instruments/convert-svg.ts +0 -246
- package/script/svg-instruments/environment.d.ts +0 -7
- package/script/svg-instruments/exports.ts +0 -82
- package/script/svg-instruments/figma-types.ts +0 -804
- package/script/svg-instruments/figmaImport.ts +0 -79
- package/script/svg-instruments/main.ts +0 -109
@@ -1,5 +1,10 @@
|
|
1
1
|
import { LitElement } from 'lit';
|
2
2
|
import '../icon-button/icon-button';
|
3
|
+
export declare enum ObcSliderVariant {
|
4
|
+
NoValue = "no-value",
|
5
|
+
NoInput = "no-input"
|
6
|
+
}
|
7
|
+
export type ObcSliderVariantType = 'no-value' | 'no-input';
|
3
8
|
/**
|
4
9
|
* @element obc-slider
|
5
10
|
*
|
@@ -21,6 +26,9 @@ export declare class ObcSlider extends LitElement {
|
|
21
26
|
max: number;
|
22
27
|
step: number | undefined;
|
23
28
|
stepClick: number;
|
29
|
+
variant: ObcSliderVariantType;
|
30
|
+
hasLeftIcon: boolean;
|
31
|
+
hasRightIcon: boolean;
|
24
32
|
onInput(value: number): void;
|
25
33
|
onReduceClick(): void;
|
26
34
|
onIncreaseClick(): void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAKhD,OAAO,4BAA4B,CAAC;
|
1
|
+
{"version":3,"file":"slider.d.ts","sourceRoot":"","sources":["../../../src/components/slider/slider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAKhD,OAAO,4BAA4B,CAAC;AAGpC,oBAAY,gBAAgB;IAC1B,OAAO,aAAa;IACpB,OAAO,aAAa;CACrB;AAED,MAAM,MAAM,oBAAoB,GAAG,UAAU,GAAG,UAAU,CAAC;AAE3D;;;;;;;;;;;;;;GAcG;AACH,qBACa,SAAU,SAAQ,UAAU;IACb,KAAK,SAAM;IACX,GAAG,SAAK;IACR,GAAG,SAAO;IACV,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACA,SAAS,SAAM;IACxC,OAAO,EAAE,oBAAoB,CAAc;IACd,WAAW,UAAS;IACnB,YAAY,UAAS;IAE7E,OAAO,CAAC,KAAK,EAAE,MAAM;IAKrB,aAAa;IAIb,eAAe;IAIN,MAAM;IA4Cf,OAAgB,MAAM,0BAA6B;CACpD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|
@@ -4,6 +4,7 @@ import { styleMap } from "lit/directives/style-map.js";
|
|
4
4
|
import { ifDefined } from "lit/directives/if-defined.js";
|
5
5
|
import componentStyle from "./slider.css.js";
|
6
6
|
import "../icon-button/icon-button.js";
|
7
|
+
import { classMap } from "lit/directives/class-map.js";
|
7
8
|
var __defProp = Object.defineProperty;
|
8
9
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
9
10
|
var __decorateClass = (decorators, target, key, kind) => {
|
@@ -15,6 +16,11 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
15
16
|
__defProp(target, key, result);
|
16
17
|
return result;
|
17
18
|
};
|
19
|
+
var ObcSliderVariant = /* @__PURE__ */ ((ObcSliderVariant2) => {
|
20
|
+
ObcSliderVariant2["NoValue"] = "no-value";
|
21
|
+
ObcSliderVariant2["NoInput"] = "no-input";
|
22
|
+
return ObcSliderVariant2;
|
23
|
+
})(ObcSliderVariant || {});
|
18
24
|
let ObcSlider = class extends LitElement {
|
19
25
|
constructor() {
|
20
26
|
super(...arguments);
|
@@ -22,6 +28,9 @@ let ObcSlider = class extends LitElement {
|
|
22
28
|
this.min = 0;
|
23
29
|
this.max = 100;
|
24
30
|
this.stepClick = 10;
|
31
|
+
this.variant = "no-value";
|
32
|
+
this.hasLeftIcon = false;
|
33
|
+
this.hasRightIcon = false;
|
25
34
|
}
|
26
35
|
onInput(value) {
|
27
36
|
this.value = value;
|
@@ -36,31 +45,38 @@ let ObcSlider = class extends LitElement {
|
|
36
45
|
render() {
|
37
46
|
const ratio = (this.value - this.min) / (this.max - this.min);
|
38
47
|
return html`
|
39
|
-
<obc-icon-button @click=${this.onReduceClick} variant="flat">
|
40
|
-
|
41
|
-
|
42
|
-
<div class
|
48
|
+
${this.hasLeftIcon ? html` <obc-icon-button @click=${this.onReduceClick} variant="flat">
|
49
|
+
<slot name="icon-left"></slot>
|
50
|
+
</obc-icon-button>` : null}
|
51
|
+
<div class=${classMap({ wrapper: true, [this.variant]: true })}>
|
43
52
|
<div class="track"></div>
|
44
53
|
<div
|
45
54
|
class="interactive-track"
|
46
55
|
style=${styleMap({ "--ratio": ratio })}
|
47
56
|
></div>
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
57
|
+
${this.variant === "no-input" ? html`<div
|
58
|
+
class="passive-thumb"
|
59
|
+
style=${styleMap({ "--ratio": ratio })}
|
60
|
+
></div>` : html`
|
61
|
+
<input
|
62
|
+
type="range"
|
63
|
+
min=${this.min}
|
64
|
+
max=${this.max}
|
65
|
+
step=${ifDefined(this.step)}
|
66
|
+
.value=${this.value.toString()}
|
67
|
+
class="slider"
|
68
|
+
@input=${(event) => {
|
56
69
|
this.value = Number(event.target.value);
|
57
|
-
this.dispatchEvent(
|
70
|
+
this.dispatchEvent(
|
71
|
+
new CustomEvent("value", { detail: this.value })
|
72
|
+
);
|
58
73
|
}}
|
59
|
-
|
74
|
+
/>
|
75
|
+
`}
|
60
76
|
</div>
|
61
|
-
|
62
|
-
|
63
|
-
|
77
|
+
${this.hasRightIcon ? html`<obc-icon-button @click=${this.onIncreaseClick} variant="flat">
|
78
|
+
<slot name="icon-right"></slot>
|
79
|
+
</obc-icon-button>` : null}
|
64
80
|
`;
|
65
81
|
}
|
66
82
|
};
|
@@ -80,10 +96,20 @@ __decorateClass([
|
|
80
96
|
__decorateClass([
|
81
97
|
property({ type: Number, attribute: "step-click" })
|
82
98
|
], ObcSlider.prototype, "stepClick", 2);
|
99
|
+
__decorateClass([
|
100
|
+
property({ type: String })
|
101
|
+
], ObcSlider.prototype, "variant", 2);
|
102
|
+
__decorateClass([
|
103
|
+
property({ type: Boolean, attribute: "has-left-icon" })
|
104
|
+
], ObcSlider.prototype, "hasLeftIcon", 2);
|
105
|
+
__decorateClass([
|
106
|
+
property({ type: Boolean, attribute: "has-right-icon" })
|
107
|
+
], ObcSlider.prototype, "hasRightIcon", 2);
|
83
108
|
ObcSlider = __decorateClass([
|
84
109
|
customElement("obc-slider")
|
85
110
|
], ObcSlider);
|
86
111
|
export {
|
87
|
-
ObcSlider
|
112
|
+
ObcSlider,
|
113
|
+
ObcSliderVariant
|
88
114
|
};
|
89
115
|
//# sourceMappingURL=slider.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slider.js","sources":["../../../src/components/slider/slider.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport componentStyle from './slider.css?inline';\nimport '../icon-button/icon-button';\n\n/**\n * @element obc-slider\n *\n * @prop {number} value - The value of the slider\n * @prop {number} min - The minimum value of the slider\n * @prop {number} max - The maximum value of the slider\n * @prop {number} step - The step value of the slider\n * @prop {number} stepClick - The step value when clicking the increase or decrease buttons\n * @attr hug-container - If set, the slider will not have any spacing between the slider icons and the container\n *\n * @slot icon-left - Slot for the left icon\n * @slot icon-right - Slot for the right icon\n *\n * @fires value - Fires when the value is changed\n */\n@customElement('obc-slider')\nexport class ObcSlider extends LitElement {\n @property({type: Number}) value = 50;\n @property({type: Number}) min = 0;\n @property({type: Number}) max = 100;\n @property({type: Number}) step: number | undefined;\n @property({type: Number, attribute: 'step-click'}) stepClick = 10;\n\n onInput(value: number) {\n this.value = value;\n this.dispatchEvent(new CustomEvent('value', {detail: this.value}));\n }\n\n onReduceClick() {\n this.onInput(Math.max(this.value - this.stepClick, this.min));\n }\n\n onIncreaseClick() {\n this.onInput(Math.min(this.value + this.stepClick, this.max));\n }\n\n override render() {\n const ratio = (this.value - this.min) / (this.max - this.min);\n return html`\n <obc-icon-button @click=${this.onReduceClick} variant=\"flat\">\n
|
1
|
+
{"version":3,"file":"slider.js","sources":["../../../src/components/slider/slider.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {styleMap} from 'lit/directives/style-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\nimport componentStyle from './slider.css?inline';\nimport '../icon-button/icon-button';\nimport {classMap} from 'lit/directives/class-map.js';\n\nexport enum ObcSliderVariant {\n NoValue = 'no-value',\n NoInput = 'no-input',\n}\n\nexport type ObcSliderVariantType = 'no-value' | 'no-input';\n\n/**\n * @element obc-slider\n *\n * @prop {number} value - The value of the slider\n * @prop {number} min - The minimum value of the slider\n * @prop {number} max - The maximum value of the slider\n * @prop {number} step - The step value of the slider\n * @prop {number} stepClick - The step value when clicking the increase or decrease buttons\n * @attr hug-container - If set, the slider will not have any spacing between the slider icons and the container\n *\n * @slot icon-left - Slot for the left icon\n * @slot icon-right - Slot for the right icon\n *\n * @fires value - Fires when the value is changed\n */\n@customElement('obc-slider')\nexport class ObcSlider extends LitElement {\n @property({type: Number}) value = 50;\n @property({type: Number}) min = 0;\n @property({type: Number}) max = 100;\n @property({type: Number}) step: number | undefined;\n @property({type: Number, attribute: 'step-click'}) stepClick = 10;\n @property({type: String}) variant: ObcSliderVariantType = 'no-value';\n @property({type: Boolean, attribute: 'has-left-icon'}) hasLeftIcon = false;\n @property({type: Boolean, attribute: 'has-right-icon'}) hasRightIcon = false;\n\n onInput(value: number) {\n this.value = value;\n this.dispatchEvent(new CustomEvent('value', {detail: this.value}));\n }\n\n onReduceClick() {\n this.onInput(Math.max(this.value - this.stepClick, this.min));\n }\n\n onIncreaseClick() {\n this.onInput(Math.min(this.value + this.stepClick, this.max));\n }\n\n override render() {\n const ratio = (this.value - this.min) / (this.max - this.min);\n return html`\n ${this.hasLeftIcon\n ? html` <obc-icon-button @click=${this.onReduceClick} variant=\"flat\">\n <slot name=\"icon-left\"></slot>\n </obc-icon-button>`\n : null}\n <div class=${classMap({wrapper: true, [this.variant]: true})}>\n <div class=\"track\"></div>\n <div\n class=\"interactive-track\"\n style=${styleMap({'--ratio': ratio})}\n ></div>\n ${this.variant === ObcSliderVariant.NoInput\n ? html`<div\n class=\"passive-thumb\"\n style=${styleMap({'--ratio': ratio})}\n ></div>`\n : html`\n <input\n type=\"range\"\n min=${this.min}\n max=${this.max}\n step=${ifDefined(this.step)}\n .value=${this.value.toString()}\n class=\"slider\"\n @input=${(event: Event) => {\n this.value = Number((event.target as HTMLInputElement).value);\n this.dispatchEvent(\n new CustomEvent('value', {detail: this.value})\n );\n }}\n />\n `}\n </div>\n ${this.hasRightIcon\n ? html`<obc-icon-button @click=${this.onIncreaseClick} variant=\"flat\">\n <slot name=\"icon-right\"></slot>\n </obc-icon-button>`\n : null}\n `;\n }\n\n static override styles = unsafeCSS(componentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-slider': ObcSlider;\n }\n}\n"],"names":["ObcSliderVariant"],"mappings":";;;;;;;;;;;;;;;;;;AAQY,IAAA,qCAAAA,sBAAL;AACLA,oBAAA,SAAU,IAAA;AACVA,oBAAA,SAAU,IAAA;AAFAA,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAuBC,IAAA,YAAN,cAAwB,WAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA;AAC6B,SAAA,QAAA;AACF,SAAA,MAAA;AACA,SAAA,MAAA;AAE+B,SAAA,YAAA;AACL,SAAA,UAAA;AACW,SAAA,cAAA;AACE,SAAA,eAAA;AAAA,EAAA;AAAA,EAEvE,QAAQ,OAAe;AACrB,SAAK,QAAQ;AACR,SAAA,cAAc,IAAI,YAAY,SAAS,EAAC,QAAQ,KAAK,MAAM,CAAA,CAAC;AAAA,EACnE;AAAA,EAEA,gBAAgB;AACT,SAAA,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,WAAW,KAAK,GAAG,CAAC;AAAA,EAC9D;AAAA,EAEA,kBAAkB;AACX,SAAA,QAAQ,KAAK,IAAI,KAAK,QAAQ,KAAK,WAAW,KAAK,GAAG,CAAC;AAAA,EAC9D;AAAA,EAES,SAAS;AAChB,UAAM,SAAS,KAAK,QAAQ,KAAK,QAAQ,KAAK,MAAM,KAAK;AAClD,WAAA;AAAA,QACH,KAAK,cACH,gCAAgC,KAAK,aAAa;AAAA;AAAA,gCAGlD,IAAI;AAAA,mBACK,SAAS,EAAC,SAAS,MAAM,CAAC,KAAK,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M,SAAS,WAAW,iBAAgB;AAAA,GAP1C,UAO4C,WAAA,eAAA,CAAA;AACC,gBAAA;AAAA,EAAvD,SAAS,EAAC,MAAM,SAAS,WAAW,kBAAiB;AAAA,GAR3C,UAQ6C,WAAA,gBAAA,CAAA;AAR7C,YAAN,gBAAA;AAAA,EADN,cAAc,YAAY;AAAA,GACd,SAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"top-bar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"top-bar.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"top-bar.d.ts","sourceRoot":"","sources":["../../../src/components/top-bar/top-bar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAkB,MAAM,KAAK,CAAC;AAIhD,OAAO,4BAA4B,CAAC;AACpC,OAAO,gBAAgB,CAAC;AACxB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,0BAA0B,CAAC;AAClC,OAAO,0BAA0B,CAAC;AAClC,OAAO,2BAA2B,CAAC;AACnC,OAAO,gCAAgC,CAAC;AACxC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAClC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AAExD;;;;;;;GAOG;AACH,qBACa,SAAU,SAAQ,UAAU;IACb,QAAQ,SAAS;IACjB,QAAQ,SAAU;IAClB,IAAI,SAA8B;IAE5D,mBAAmB,UAAS;IAE5B,sBAAsB,UAAS;IAE/B,mBAAmB,UAAS;IAE5B,uBAAuB,UAAS;IAE0B,cAAc,UAChE;IACkD,cAAc,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QAAQ,UAAS;IAE5C,eAAe,EAAE,cAAc,EAAE,CAAM;IAEvC,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,oBAAoB;IAI5B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,qBAAqB;IAIpB,MAAM;IA+If,OAAgB,MAAM,0BAA2B;CAClD;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,SAAS,CAAC;KAC1B;CACF"}
|
@@ -179,14 +179,14 @@ let ObcTopBar = class extends LitElement {
|
|
179
179
|
>
|
180
180
|
<obi-01-apps></obi-01-apps>
|
181
181
|
</obc-icon-button>` : null}
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
182
|
+
${!this.inactive ? html`<obc-icon-button
|
183
|
+
class="left-more-button"
|
184
|
+
variant="flat"
|
185
|
+
@click=${this.leftMoreButtonClicked}
|
186
|
+
?activated=${this.leftMoreButtonActivated}
|
187
|
+
>
|
188
|
+
<obi-01-more-vertical></obi-01-more-vertical>
|
189
|
+
</obc-icon-button>` : null}
|
190
190
|
</div>
|
191
191
|
</nav>
|
192
192
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"top-bar.js","sources":["../../../src/components/top-bar/top-bar.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport compentStyle from './top-bar.css?inline';\nimport '../icon-button/icon-button';\nimport '../clock/clock';\nimport '../divider/divider';\nimport '../breadcrumb/breadcrumb';\nimport '../../icons/icon-01-menu';\nimport '../../icons/icon-01-close';\nimport '../../icons/icon-02-arrow-back';\nimport '../../icons/icon-02-arrow-forward';\nimport '../../icons/icon-04-dimming';\nimport '../../icons/icon-01-apps';\nimport '../../icons/icon-01-more-vertical';\nimport {BreadcrumbItem} from '../breadcrumb/breadcrumb';\n\n/**\n * Top bar component\n *\n * @fires menu-button-clicked - Menu button clicked\n * @fires dimming-button-clicked - Dimming button clicked\n * @fires apps-button-clicked - Apps button clicked\n * @fires left-more-button-clicked - Left more button clicked\n */\n@customElement('obc-top-bar')\nexport class ObcTopBar extends LitElement {\n @property({type: String}) appTitle = 'App';\n @property({type: String}) pageName = 'Page';\n @property({type: String}) date = '2021-01-01T11:11:11.111Z';\n @property({type: Boolean, attribute: 'menu-button-activated'})\n menuButtonActivated = false;\n @property({type: Boolean, attribute: 'dimming-button-activated'})\n dimmingButtonActivated = false;\n @property({type: Boolean, attribute: 'apps-button-activated'})\n appsButtonActivated = false;\n @property({type: Boolean, attribute: 'left-more-button-activated'})\n leftMoreButtonActivated = false;\n\n @property({type: Boolean, attribute: 'wide-menu-button'}) wideMenuButton =\n false;\n @property({type: Boolean, attribute: 'show-apps-button'}) showAppsButton =\n false;\n @property({type: Boolean, attribute: 'show-dimming-button'})\n showDimmingButton = false;\n @property({type: Boolean, attribute: 'show-clock'}) showClock = false;\n @property({type: Boolean, attribute: 'show-date'}) showDate = false;\n @property({type: Boolean}) inactive = false;\n @property({type: Number, attribute: 'apps-button-breakpoint-px'})\n appButtonBreakpointPx = 500;\n @property({type: Number, attribute: 'dimming-button-breakpoint-px'})\n dimmingButtonBreakpointPx = 500;\n @property({type: Number, attribute: 'app-title-breakpoint-px'})\n appTitleBreakpointPx = 500;\n @property({type: Number, attribute: 'clock-minimize-breakpoint-px'})\n clockMinimizeBreakpointPx = 300;\n @property({type: Boolean}) settings = false;\n @property({type: Array, attribute: 'breadcrumb-items'})\n breadcrumbItems: BreadcrumbItem[] = [];\n\n private menuButtonClicked() {\n this.dispatchEvent(new CustomEvent('menu-button-clicked'));\n }\n\n private dimmingButtonClicked() {\n this.dispatchEvent(new CustomEvent('dimming-button-clicked'));\n }\n\n private appsButtonClicked() {\n this.dispatchEvent(new CustomEvent('apps-button-clicked'));\n }\n\n private leftMoreButtonClicked() {\n this.dispatchEvent(new CustomEvent('left-more-button-clicked'));\n }\n\n override render() {\n const leftGroup = [];\n if (this.settings) {\n leftGroup.push(\n html`<div class=\"menu-button\">\n <obc-icon-button\n variant=\"flat\"\n @click=${() => this.dispatchEvent(new CustomEvent('close'))}\n >\n <obi-01-close></obi-01-close>\n </obc-icon-button>\n </div>`\n );\n leftGroup.push(html`<obc-divider></obc-divider>`);\n leftGroup.push(\n html`<obc-icon-button\n variant=\"flat\"\n corner-left\n @click=${() => this.dispatchEvent(new CustomEvent('back'))}\n >\n <obi-02-arrow-back></obi-02-arrow-back>\n </obc-icon-button>`\n );\n leftGroup.push(\n html`<obc-icon-button\n variant=\"flat\"\n corner-right\n @click=${() => this.dispatchEvent(new CustomEvent('forward'))}\n >\n <obi-02-arrow-forward></obi-02-arrow-forward>\n </obc-icon-button>`\n );\n leftGroup.push(html`<obc-divider></obc-divider>`);\n leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`);\n leftGroup.push(\n html`<obc-breadcrumb .items=${this.breadcrumbItems}></obc-breadcrumb>`\n );\n } else {\n if (!this.inactive) {\n leftGroup.push(\n html`<div class=\"menu-button ${this.wideMenuButton ? 'wide' : null}\">\n <obc-icon-button\n variant=\"flat\"\n @click=${this.menuButtonClicked}\n ?activated=${this.menuButtonActivated}\n >\n <obi-01-menu></obi-01-menu>\n </obc-icon-button>\n </div>`\n );\n }\n leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`);\n leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`);\n }\n\n const breakpointMoreButton = Math.max(\n this.appButtonBreakpointPx,\n this.dimmingButtonBreakpointPx\n );\n\n return html`\n <style>\n @media (max-width: ${breakpointMoreButton}px) {\n .left-more-button {\n display: revert !important;\n }\n\n .group.left > * {\n margin-right: 4px;\n margin-left: 4px;\n }\n }\n\n @media (max-width: ${this.appButtonBreakpointPx}px) {\n .apps-button {\n display: none;\n }\n }\n\n @media (max-width: ${this.dimmingButtonBreakpointPx}px) {\n .dimming-button {\n display: none;\n }\n }\n\n @media (max-width: ${this.appTitleBreakpointPx}px) {\n .title {\n display: none;\n }\n }\n </style>\n <nav\n class=${classMap({\n wrapper: true,\n inactive: this.inactive,\n settings: this.settings,\n })}\n >\n <div class=\"left group\">${leftGroup}</div>\n <div class=\"right group\">\n ${this.showClock\n ? html`<obc-clock\n date=${this.date}\n blink-only-breakpoint-px=${this.clockMinimizeBreakpointPx}\n ?show-date=${this.showDate}\n ></obc-clock>`\n : null}\n <slot name=\"alerts\"></slot>\n ${this.showDimmingButton && !this.inactive\n ? html`<obc-icon-button\n class=\"dimming-button\"\n variant=\"flat\"\n @click=${this.dimmingButtonClicked}\n ?activated=${this.dimmingButtonActivated}\n >\n <obi-04-dimming></obi-04-dimming>\n </obc-icon-button>`\n : null}\n ${this.showAppsButton && !this.inactive\n ? html`<obc-icon-button\n class=\"apps-button\"\n variant=\"flat\"\n @click=${this.appsButtonClicked}\n ?activated=${this.appsButtonActivated}\n >\n <obi-01-apps></obi-01-apps>\n </obc-icon-button>`\n : null}\n <obc-icon-button\n class=\"left-more-button\"\n variant=\"flat\"\n @click=${this.leftMoreButtonClicked}\n ?activated=${this.leftMoreButtonActivated}\n >\n <obi-01-more-vertical></obi-01-more-vertical>\n </obc-icon-button>\n </div>\n </nav>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-top-bar': ObcTopBar;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0Ba,IAAA,YAAN,cAAwB,WAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA;AACgC,SAAA,WAAA;AACA,SAAA,WAAA;AACJ,SAAA,OAAA;AAEX,SAAA,sBAAA;AAEG,SAAA,yBAAA;AAEH,SAAA,sBAAA;AAEI,SAAA,0BAAA;AAGxB,SAAA,iBAAA;AAEA,SAAA,iBAAA;AAEkB,SAAA,oBAAA;AAC4C,SAAA,YAAA;AACF,SAAA,WAAA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AAC,MAAM,SAAQ;AAAA,GArBd,UAqBgB,WAAA,YAAA,CAAA;AAE3B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,6BAA4B;AAAA,GAtBrD,UAuBX,WAAA,yBAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,gCAA+B;AAAA,GAxBxD,UAyBX,WAAA,6BAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,2BAA0B;AAAA,GA1BnD,UA2BX,WAAA,wBAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,gCAA+B;AAAA,GA5BxD,UA6BX,WAAA,6BAAA,CAAA;AAC2B,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,SAAQ;AAAA,GA9Bd,UA8BgB,WAAA,YAAA,CAAA;AAE3B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,oBAAmB;AAAA,GA/B3C,UAgCX,WAAA,mBAAA,CAAA;AAhCW,YAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,SAAA;"}
|
1
|
+
{"version":3,"file":"top-bar.js","sources":["../../../src/components/top-bar/top-bar.ts"],"sourcesContent":["import {LitElement, html, unsafeCSS} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport compentStyle from './top-bar.css?inline';\nimport '../icon-button/icon-button';\nimport '../clock/clock';\nimport '../divider/divider';\nimport '../breadcrumb/breadcrumb';\nimport '../../icons/icon-01-menu';\nimport '../../icons/icon-01-close';\nimport '../../icons/icon-02-arrow-back';\nimport '../../icons/icon-02-arrow-forward';\nimport '../../icons/icon-04-dimming';\nimport '../../icons/icon-01-apps';\nimport '../../icons/icon-01-more-vertical';\nimport {BreadcrumbItem} from '../breadcrumb/breadcrumb';\n\n/**\n * Top bar component\n *\n * @fires menu-button-clicked - Menu button clicked\n * @fires dimming-button-clicked - Dimming button clicked\n * @fires apps-button-clicked - Apps button clicked\n * @fires left-more-button-clicked - Left more button clicked\n */\n@customElement('obc-top-bar')\nexport class ObcTopBar extends LitElement {\n @property({type: String}) appTitle = 'App';\n @property({type: String}) pageName = 'Page';\n @property({type: String}) date = '2021-01-01T11:11:11.111Z';\n @property({type: Boolean, attribute: 'menu-button-activated'})\n menuButtonActivated = false;\n @property({type: Boolean, attribute: 'dimming-button-activated'})\n dimmingButtonActivated = false;\n @property({type: Boolean, attribute: 'apps-button-activated'})\n appsButtonActivated = false;\n @property({type: Boolean, attribute: 'left-more-button-activated'})\n leftMoreButtonActivated = false;\n\n @property({type: Boolean, attribute: 'wide-menu-button'}) wideMenuButton =\n false;\n @property({type: Boolean, attribute: 'show-apps-button'}) showAppsButton =\n false;\n @property({type: Boolean, attribute: 'show-dimming-button'})\n showDimmingButton = false;\n @property({type: Boolean, attribute: 'show-clock'}) showClock = false;\n @property({type: Boolean, attribute: 'show-date'}) showDate = false;\n @property({type: Boolean}) inactive = false;\n @property({type: Number, attribute: 'apps-button-breakpoint-px'})\n appButtonBreakpointPx = 500;\n @property({type: Number, attribute: 'dimming-button-breakpoint-px'})\n dimmingButtonBreakpointPx = 500;\n @property({type: Number, attribute: 'app-title-breakpoint-px'})\n appTitleBreakpointPx = 500;\n @property({type: Number, attribute: 'clock-minimize-breakpoint-px'})\n clockMinimizeBreakpointPx = 300;\n @property({type: Boolean}) settings = false;\n @property({type: Array, attribute: 'breadcrumb-items'})\n breadcrumbItems: BreadcrumbItem[] = [];\n\n private menuButtonClicked() {\n this.dispatchEvent(new CustomEvent('menu-button-clicked'));\n }\n\n private dimmingButtonClicked() {\n this.dispatchEvent(new CustomEvent('dimming-button-clicked'));\n }\n\n private appsButtonClicked() {\n this.dispatchEvent(new CustomEvent('apps-button-clicked'));\n }\n\n private leftMoreButtonClicked() {\n this.dispatchEvent(new CustomEvent('left-more-button-clicked'));\n }\n\n override render() {\n const leftGroup = [];\n if (this.settings) {\n leftGroup.push(\n html`<div class=\"menu-button\">\n <obc-icon-button\n variant=\"flat\"\n @click=${() => this.dispatchEvent(new CustomEvent('close'))}\n >\n <obi-01-close></obi-01-close>\n </obc-icon-button>\n </div>`\n );\n leftGroup.push(html`<obc-divider></obc-divider>`);\n leftGroup.push(\n html`<obc-icon-button\n variant=\"flat\"\n corner-left\n @click=${() => this.dispatchEvent(new CustomEvent('back'))}\n >\n <obi-02-arrow-back></obi-02-arrow-back>\n </obc-icon-button>`\n );\n leftGroup.push(\n html`<obc-icon-button\n variant=\"flat\"\n corner-right\n @click=${() => this.dispatchEvent(new CustomEvent('forward'))}\n >\n <obi-02-arrow-forward></obi-02-arrow-forward>\n </obc-icon-button>`\n );\n leftGroup.push(html`<obc-divider></obc-divider>`);\n leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`);\n leftGroup.push(\n html`<obc-breadcrumb .items=${this.breadcrumbItems}></obc-breadcrumb>`\n );\n } else {\n if (!this.inactive) {\n leftGroup.push(\n html`<div class=\"menu-button ${this.wideMenuButton ? 'wide' : null}\">\n <obc-icon-button\n variant=\"flat\"\n @click=${this.menuButtonClicked}\n ?activated=${this.menuButtonActivated}\n >\n <obi-01-menu></obi-01-menu>\n </obc-icon-button>\n </div>`\n );\n }\n leftGroup.push(html`<div class=\"title\">${this.appTitle}</div>`);\n leftGroup.push(html`<div class=\"page-name\">${this.pageName}</div>`);\n }\n\n const breakpointMoreButton = Math.max(\n this.appButtonBreakpointPx,\n this.dimmingButtonBreakpointPx\n );\n\n return html`\n <style>\n @media (max-width: ${breakpointMoreButton}px) {\n .left-more-button {\n display: revert !important;\n }\n\n .group.left > * {\n margin-right: 4px;\n margin-left: 4px;\n }\n }\n\n @media (max-width: ${this.appButtonBreakpointPx}px) {\n .apps-button {\n display: none;\n }\n }\n\n @media (max-width: ${this.dimmingButtonBreakpointPx}px) {\n .dimming-button {\n display: none;\n }\n }\n\n @media (max-width: ${this.appTitleBreakpointPx}px) {\n .title {\n display: none;\n }\n }\n </style>\n <nav\n class=${classMap({\n wrapper: true,\n inactive: this.inactive,\n settings: this.settings,\n })}\n >\n <div class=\"left group\">${leftGroup}</div>\n <div class=\"right group\">\n ${this.showClock\n ? html`<obc-clock\n date=${this.date}\n blink-only-breakpoint-px=${this.clockMinimizeBreakpointPx}\n ?show-date=${this.showDate}\n ></obc-clock>`\n : null}\n <slot name=\"alerts\"></slot>\n ${this.showDimmingButton && !this.inactive\n ? html`<obc-icon-button\n class=\"dimming-button\"\n variant=\"flat\"\n @click=${this.dimmingButtonClicked}\n ?activated=${this.dimmingButtonActivated}\n >\n <obi-04-dimming></obi-04-dimming>\n </obc-icon-button>`\n : null}\n ${this.showAppsButton && !this.inactive\n ? html`<obc-icon-button\n class=\"apps-button\"\n variant=\"flat\"\n @click=${this.appsButtonClicked}\n ?activated=${this.appsButtonActivated}\n >\n <obi-01-apps></obi-01-apps>\n </obc-icon-button>`\n : null}\n ${!this.inactive\n ? html`<obc-icon-button\n class=\"left-more-button\"\n variant=\"flat\"\n @click=${this.leftMoreButtonClicked}\n ?activated=${this.leftMoreButtonActivated}\n >\n <obi-01-more-vertical></obi-01-more-vertical>\n </obc-icon-button>`\n : null}\n </div>\n </nav>\n `;\n }\n\n static override styles = unsafeCSS(compentStyle);\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-top-bar': ObcTopBar;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AA0Ba,IAAA,YAAN,cAAwB,WAAW;AAAA,EAAnC,cAAA;AAAA,UAAA,GAAA,SAAA;AACgC,SAAA,WAAA;AACA,SAAA,WAAA;AACJ,SAAA,OAAA;AAEX,SAAA,sBAAA;AAEG,SAAA,yBAAA;AAEH,SAAA,sBAAA;AAEI,SAAA,0BAAA;AAGxB,SAAA,iBAAA;AAEA,SAAA,iBAAA;AAEkB,SAAA,oBAAA;AAC4C,SAAA,YAAA;AACF,SAAA,WAAA;AACxB,SA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gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,SAAQ;AAAA,GArBd,UAqBgB,WAAA,YAAA,CAAA;AAE3B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,6BAA4B;AAAA,GAtBrD,UAuBX,WAAA,yBAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,gCAA+B;AAAA,GAxBxD,UAyBX,WAAA,6BAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,2BAA0B;AAAA,GA1BnD,UA2BX,WAAA,wBAAA,CAAA;AAEA,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,QAAQ,WAAW,gCAA+B;AAAA,GA5BxD,UA6BX,WAAA,6BAAA,CAAA;AAC2B,gBAAA;AAAA,EAA1B,SAAS,EAAC,MAAM,SAAQ;AAAA,GA9Bd,UA8BgB,WAAA,YAAA,CAAA;AAE3B,gBAAA;AAAA,EADC,SAAS,EAAC,MAAM,OAAO,WAAW,oBAAmB;AAAA,GA/B3C,UAgCX,WAAA,mBAAA,CAAA;AAhCW,YAAN,gBAAA;AAAA,EADN,cAAc,aAAa;AAAA,GACf,SAAA;"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@oicl/openbridge-webcomponents",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.10",
|
4
4
|
"type": "module",
|
5
5
|
"repository": {
|
6
6
|
"type": "git",
|
@@ -18,7 +18,6 @@
|
|
18
18
|
"storybook": "storybook dev -p 6006",
|
19
19
|
"build-storybook": "storybook build",
|
20
20
|
"download:icons": "tsx ./script/download-icons.ts",
|
21
|
-
"download:instruments": "tsx ./script/svg-instruments/main.ts",
|
22
21
|
"new:component": "tsx ./new-component.ts",
|
23
22
|
"test-storybook": "test-storybook",
|
24
23
|
"prepack": "yarn build",
|
@@ -40,44 +39,38 @@
|
|
40
39
|
"@lit-labs/gen-wrapper-react": "^0.3.1",
|
41
40
|
"@lit-labs/gen-wrapper-vue": "^0.3.2",
|
42
41
|
"@open-wc/lit-helpers": "^0.7.0",
|
43
|
-
"@storybook/addon-essentials": "^
|
44
|
-
"@storybook/addon-interactions": "^
|
45
|
-
"@storybook/addon-links": "^
|
46
|
-
"@storybook/addon-storysource": "^
|
47
|
-
"@storybook/addon-themes": "^
|
48
|
-
"@storybook/blocks": "^
|
49
|
-
"@storybook/test
|
50
|
-
"@storybook/
|
51
|
-
"@storybook/web-components": "^
|
52
|
-
"@storybook/web-components-vite": "^
|
42
|
+
"@storybook/addon-essentials": "^8.0.5",
|
43
|
+
"@storybook/addon-interactions": "^8.0.5",
|
44
|
+
"@storybook/addon-links": "^8.0.5",
|
45
|
+
"@storybook/addon-storysource": "^8.0.5",
|
46
|
+
"@storybook/addon-themes": "^8.0.5",
|
47
|
+
"@storybook/blocks": "^8.0.5",
|
48
|
+
"@storybook/test": "^8.0.5",
|
49
|
+
"@storybook/test-runner": "^0.17.0",
|
50
|
+
"@storybook/web-components": "^8.0.5",
|
51
|
+
"@storybook/web-components-vite": "^8.0.5",
|
53
52
|
"@topcli/prompts": "^1.8.0",
|
54
53
|
"@types/jest-image-snapshot": "^6",
|
55
|
-
"@types/xmldom": "^0.1.34",
|
56
|
-
"chromatic": "^7.6.0",
|
57
54
|
"concurrently": "^8.2.2",
|
58
55
|
"dotenv": "^16.3.1",
|
59
56
|
"eslint": "^8.56.0",
|
60
|
-
"eslint-plugin-storybook": "^0.
|
57
|
+
"eslint-plugin-storybook": "^0.8.0",
|
61
58
|
"figma-api": "^1.11.0",
|
62
59
|
"jest-image-snapshot": "^6.2.0",
|
63
60
|
"lit-analyzer": "^2.0.2",
|
64
61
|
"nodemon": "^3.0.2",
|
65
62
|
"playwright": "^1.40.0",
|
66
|
-
"postcss": "^8.4.
|
67
|
-
"postcss-mixins": "^
|
63
|
+
"postcss": "^8.4.36",
|
64
|
+
"postcss-mixins": "^10.0.0",
|
68
65
|
"postcss-nesting": "^12.0.1",
|
69
|
-
"postcss-plugin": "^1.0.0",
|
70
66
|
"prettier": "^3.1.1",
|
71
|
-
"react": "^18.2.0",
|
72
|
-
"react-dom": "^18.2.0",
|
73
67
|
"release-it": "^17.1.1",
|
74
68
|
"rollup-plugin-postcss-lit": "^2.1.0",
|
75
|
-
"storybook": "^
|
76
|
-
"tsx": "^
|
69
|
+
"storybook": "^8.0.5",
|
70
|
+
"tsx": "^4.7.1",
|
77
71
|
"typescript": "^5.3.3",
|
78
|
-
"vite": "^
|
79
|
-
"vite-plugin-dts": "^3.6.3"
|
80
|
-
"xmldom": "^0.6.0"
|
72
|
+
"vite": "^5.2.7",
|
73
|
+
"vite-plugin-dts": "^3.6.3"
|
81
74
|
},
|
82
75
|
"types": "./dist/index.d.ts",
|
83
76
|
"customElements": "custom-elements.json"
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
|
+
import {ObcCornerLine} from './corner-line';
|
3
|
+
import './corner-line';
|
4
|
+
|
5
|
+
const meta: Meta<typeof ObcCornerLine> = {
|
6
|
+
title: 'Line/Corner line',
|
7
|
+
tags: ['autodocs'],
|
8
|
+
component: 'obc-corner-line',
|
9
|
+
args: {},
|
10
|
+
argTypes: {
|
11
|
+
direction: {
|
12
|
+
options: ['top-left', 'top-right', 'bottom-left', 'bottom-right'],
|
13
|
+
control: {type: 'radio'},
|
14
|
+
},
|
15
|
+
medium: {
|
16
|
+
options: ['normal', 'empty', 'water'],
|
17
|
+
control: {type: 'radio'},
|
18
|
+
},
|
19
|
+
lineType: {
|
20
|
+
options: ['fluid', 'electric', 'air', 'connector'],
|
21
|
+
control: {type: 'radio'},
|
22
|
+
},
|
23
|
+
},
|
24
|
+
} satisfies Meta<ObcCornerLine>;
|
25
|
+
|
26
|
+
export default meta;
|
27
|
+
type Story = StoryObj<ObcCornerLine>;
|
28
|
+
|
29
|
+
export const Primary: Story = {
|
30
|
+
args: {},
|
31
|
+
};
|
@@ -0,0 +1,167 @@
|
|
1
|
+
import {LitElement, html, css} from 'lit';
|
2
|
+
import {customElement, property} from 'lit/decorators.js';
|
3
|
+
import {
|
4
|
+
LineMedium,
|
5
|
+
LineMediumType,
|
6
|
+
lineColor,
|
7
|
+
LineType,
|
8
|
+
LineTypeType,
|
9
|
+
lineWidth,
|
10
|
+
} from '../index';
|
11
|
+
|
12
|
+
export enum CornerLineDirection {
|
13
|
+
topRight = 'top-right',
|
14
|
+
topLeft = 'top-left',
|
15
|
+
bottomRight = 'bottom-right',
|
16
|
+
bottomLeft = 'bottom-left',
|
17
|
+
}
|
18
|
+
|
19
|
+
export type CornerLineDirectionType =
|
20
|
+
| 'top-right'
|
21
|
+
| 'top-left'
|
22
|
+
| 'bottom-right'
|
23
|
+
| 'bottom-left';
|
24
|
+
|
25
|
+
@customElement('obc-corner-line')
|
26
|
+
export class ObcCornerLine extends LitElement {
|
27
|
+
@property({type: String}) medium: LineMediumType = LineMedium.normal;
|
28
|
+
@property({type: String}) direction: CornerLineDirectionType =
|
29
|
+
CornerLineDirection.topRight;
|
30
|
+
@property({type: String, attribute: 'line-type'}) lineType: LineTypeType =
|
31
|
+
LineType.fluid;
|
32
|
+
|
33
|
+
override render() {
|
34
|
+
let rotation = 270;
|
35
|
+
if (this.direction === CornerLineDirection.topLeft) {
|
36
|
+
rotation = 180;
|
37
|
+
} else if (this.direction === CornerLineDirection.bottomLeft) {
|
38
|
+
rotation = 90;
|
39
|
+
} else if (this.direction === CornerLineDirection.bottomRight) {
|
40
|
+
rotation = 0;
|
41
|
+
}
|
42
|
+
|
43
|
+
if (this.lineType === LineType.connector) {
|
44
|
+
return html`
|
45
|
+
<svg
|
46
|
+
width="24"
|
47
|
+
height="24"
|
48
|
+
viewBox="0 0 24 24"
|
49
|
+
fill="none"
|
50
|
+
xmlns="http://www.w3.org/2000/svg"
|
51
|
+
transform="rotate(${rotation})"
|
52
|
+
>
|
53
|
+
<path
|
54
|
+
d="M16.5 11.5L15 11.5C14.9951 11.5 14.9902 11.5 14.9853 11.5C13.0826 11.5079 11.5382 13.0339 11.5007 14.9294C11.5002 14.9529 11.5 14.9764 11.5 15V16.5L12.5 16.5L12.5 15C12.5 13.6355 13.5932 12.5263 14.9516 12.5005C14.9677 12.5002 14.9838 12.5 15 12.5L16.5 12.5V11.5Z"
|
55
|
+
fill="var(--element-neutral-color)"
|
56
|
+
/>
|
57
|
+
<path
|
58
|
+
d="M24 11.5H22.5V12.5L24 12.5V11.5Z"
|
59
|
+
fill="var(--element-neutral-color)"
|
60
|
+
/>
|
61
|
+
<path
|
62
|
+
d="M21 11.5H18V12.5L21 12.5V11.5Z"
|
63
|
+
fill="var(--element-neutral-color)"
|
64
|
+
/>
|
65
|
+
<path
|
66
|
+
d="M11.5 18V21H12.5L12.5 18H11.5Z"
|
67
|
+
fill="var(--element-neutral-color)"
|
68
|
+
/>
|
69
|
+
<path
|
70
|
+
d="M11.5 22.5V24H12.5V22.5H11.5Z"
|
71
|
+
fill="var(--element-neutral-color)"
|
72
|
+
/>
|
73
|
+
</svg>
|
74
|
+
`;
|
75
|
+
}
|
76
|
+
|
77
|
+
const color = lineColor(this.medium);
|
78
|
+
const width = lineWidth(this.lineType);
|
79
|
+
|
80
|
+
const r1 = 6 - 0.5 - width / 2;
|
81
|
+
const r2 = 6 + 0.5 + width / 2;
|
82
|
+
|
83
|
+
if (this.lineType === LineType.air) {
|
84
|
+
const r1 = 2.5;
|
85
|
+
const r2 = 11.5;
|
86
|
+
return html`
|
87
|
+
<svg
|
88
|
+
class="line"
|
89
|
+
xmlns="http://www.w3.org/2000/svg"
|
90
|
+
viewBox="0 0 24 24"
|
91
|
+
height="24"
|
92
|
+
width="24"
|
93
|
+
transform="rotate(${rotation})"
|
94
|
+
>
|
95
|
+
<path
|
96
|
+
d="M 17 24 v -4 a 3 3 0 0 1 3 -3 h 4 v -10 h -6 a 11 11 0 0 0 -11 11 v 6 z"
|
97
|
+
stroke="none"
|
98
|
+
fill="var(${color.inner})"
|
99
|
+
/>
|
100
|
+
<path
|
101
|
+
d="M ${12 +
|
102
|
+
0.5 +
|
103
|
+
width / 2} 24 v -4 a ${r1} ${r1} 0 0 1 ${r1} -${r1} h 4"
|
104
|
+
stroke-width="1"
|
105
|
+
stroke="var(${color.outer})"
|
106
|
+
fill="none"
|
107
|
+
/>
|
108
|
+
<path
|
109
|
+
d="M ${12 -
|
110
|
+
0.5 -
|
111
|
+
width / 2} 24 v -6 a ${r2} ${r2} 0 0 1 ${r2} -${r2} h 6"
|
112
|
+
stroke-width="1"
|
113
|
+
stroke="var(${color.outer})"
|
114
|
+
fill="none"
|
115
|
+
/>
|
116
|
+
</svg>
|
117
|
+
`;
|
118
|
+
} else {
|
119
|
+
return html`
|
120
|
+
<svg
|
121
|
+
class="line"
|
122
|
+
xmlns="http://www.w3.org/2000/svg"
|
123
|
+
viewBox="0 0 24 24"
|
124
|
+
height="24"
|
125
|
+
width="24"
|
126
|
+
transform="rotate(${rotation})"
|
127
|
+
>
|
128
|
+
<path
|
129
|
+
d="M 12 24 v -6 a 6 6 0 0 1 6 -6 h 6"
|
130
|
+
stroke-width=${width}
|
131
|
+
stroke="var(${color.inner})"
|
132
|
+
fill="none"
|
133
|
+
/>
|
134
|
+
<path
|
135
|
+
d="M ${12 +
|
136
|
+
0.5 +
|
137
|
+
width / 2} 24 v -6 a ${r1} ${r1} 0 0 1 ${r1} -${r1} h 6"
|
138
|
+
stroke-width="1"
|
139
|
+
stroke="var(${color.outer})"
|
140
|
+
fill="none"
|
141
|
+
/>
|
142
|
+
<path
|
143
|
+
d="M ${12 -
|
144
|
+
0.5 -
|
145
|
+
width / 2} 24 v -6 a ${r2} ${r2} 0 0 1 ${r2} -${r2} h 6"
|
146
|
+
stroke-width="1"
|
147
|
+
stroke="var(${color.outer})"
|
148
|
+
fill="none"
|
149
|
+
/>
|
150
|
+
</svg>
|
151
|
+
`;
|
152
|
+
}
|
153
|
+
}
|
154
|
+
|
155
|
+
static override styles = css`
|
156
|
+
:host {
|
157
|
+
display: block;
|
158
|
+
line-height: 0;
|
159
|
+
}
|
160
|
+
`;
|
161
|
+
}
|
162
|
+
|
163
|
+
declare global {
|
164
|
+
interface HTMLElementTagNameMap {
|
165
|
+
'obc-corner-line': ObcCornerLine;
|
166
|
+
}
|
167
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
|
+
import {ObcHorizontalLine} from './horizontal-line';
|
3
|
+
import './horizontal-line';
|
4
|
+
|
5
|
+
const meta: Meta<typeof ObcHorizontalLine> = {
|
6
|
+
title: 'Line/Horizontal line',
|
7
|
+
tags: ['autodocs'],
|
8
|
+
component: 'obc-horizontal-line',
|
9
|
+
argTypes: {
|
10
|
+
medium: {
|
11
|
+
options: ['normal', 'empty', 'water'],
|
12
|
+
control: {type: 'radio'},
|
13
|
+
},
|
14
|
+
lineType: {
|
15
|
+
options: ['fluid', 'electric', 'air', 'connector'],
|
16
|
+
control: {type: 'radio'},
|
17
|
+
},
|
18
|
+
},
|
19
|
+
} satisfies Meta<ObcHorizontalLine>;
|
20
|
+
|
21
|
+
export default meta;
|
22
|
+
type Story = StoryObj<ObcHorizontalLine>;
|
23
|
+
|
24
|
+
export const Primary: Story = {
|
25
|
+
args: {
|
26
|
+
length: 3,
|
27
|
+
},
|
28
|
+
};
|