@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
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"line-overlap.js","sources":["../../../src/automation/line-overlap/line-overlap.ts"],"sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {LineMedium, LineType, lineColor, lineWidth} from '..';\n\n@customElement('obc-line-overlap')\nexport class ObcLineOverlap extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.normal;\n @property({type: String}) lineType: LineType = LineType.fluid;\n\n override render() {\n if (this.lineType === LineType.connector) {\n throw new Error('Connector line type not supported for line overlap');\n }\n\n const color = lineColor(this.medium);\n const width = lineWidth(this.lineType) + 1;\n const h = width / 2;\n\n return html`\n <svg\n class=\"line\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n mask=\"url(#clip)\"\n d=\"M${12 - h} -1V25h${width}V-1z\"\n fill=\"var(${color.inner})\"\n stroke=\"var(${color.outer})\"\n />\n\n <path\n d=\"M-1 ${12 - h}H25v${width}H-1z\"\n fill=\"var(${color.inner})\"\n stroke=\"var(${color.outer})\"\n />\n\n <defs>\n <mask id=\"clip\">\n <rect x=\"0\" y=\"0\" width=\"24\" height=\"24\" fill=\"white\" />\n <rect\n x=\"0\"\n y=\"${12 - 2 - h}\"\n width=\"24\"\n height=\"${width + 4}\"\n fill=\"black\"\n />\n </mask>\n </defs>\n </svg>\n `;\n }\n\n static override styles = css`\n :host {\n display: block;\n line-height: 0;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-line-overlap': ObcLineOverlap;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAKa,IAAA,iBAAN,cAA6B,WAAW;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,SAAqB,WAAW;AAChC,SAAA,WAAqB,SAAS;AAAA,EAAA;AAAA,EAE/C,SAAS;AACZ,QAAA,KAAK,aAAa,SAAS,WAAW;AAClC,YAAA,IAAI,MAAM,oDAAoD;AAAA,IACtE;AAEM,UAAA,QAAQ,UAAU,KAAK,MAAM;AACnC,UAAM,QAAQ,UAAU,KAAK,QAAQ,IAAI;AACzC,UAAM,IAAI,QAAQ;AAEX,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAWK,KAAK,CAAC,UAAU,KAAK;AAAA,sBACf,MAAM,KAAK;AAAA,wBACT,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,mBAIhB,KAAK,CAAC,OAAO,KAAK;AAAA,sBACf,MAAM,KAAK;AAAA,wBACT,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQhB,KAAK,IAAI,CAAC;AAAA;AAAA,wBAEL,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/B;
|
1
|
+
{"version":3,"file":"line-overlap.js","sources":["../../../src/automation/line-overlap/line-overlap.ts"],"sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {LineMedium, LineType, lineColor, lineWidth} from '..';\n\n@customElement('obc-line-overlap')\nexport class ObcLineOverlap extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.normal;\n @property({type: String}) lineType: LineType = LineType.fluid;\n\n override render() {\n if (this.lineType === LineType.connector) {\n throw new Error('Connector line type not supported for line overlap');\n }\n\n const color = lineColor(this.medium);\n const width = lineWidth(this.lineType) + 1;\n const h = width / 2;\n\n return html`\n <svg\n class=\"line\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <path\n mask=\"url(#clip)\"\n d=\"M${12 - h} -1V25h${width}V-1z\"\n fill=\"var(${color.inner})\"\n stroke=\"var(${color.outer})\"\n />\n\n <path\n d=\"M-1 ${12 - h}H25v${width}H-1z\"\n fill=\"var(${color.inner})\"\n stroke=\"var(${color.outer})\"\n />\n\n <defs>\n <mask id=\"clip\">\n <rect x=\"0\" y=\"0\" width=\"24\" height=\"24\" fill=\"white\" />\n <rect\n x=\"0\"\n y=\"${12 - 2 - h}\"\n width=\"24\"\n height=\"${width + 4}\"\n fill=\"black\"\n />\n </mask>\n </defs>\n </svg>\n `;\n }\n\n static override styles = css`\n :host {\n display: block;\n line-height: 0;\n }\n\n svg {\n position: relative;\n left: -12px;\n top: -12px;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-line-overlap': ObcLineOverlap;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAKa,IAAA,iBAAN,cAA6B,WAAW;AAAA,EAAxC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,SAAqB,WAAW;AAChC,SAAA,WAAqB,SAAS;AAAA,EAAA;AAAA,EAE/C,SAAS;AACZ,QAAA,KAAK,aAAa,SAAS,WAAW;AAClC,YAAA,IAAI,MAAM,oDAAoD;AAAA,IACtE;AAEM,UAAA,QAAQ,UAAU,KAAK,MAAM;AACnC,UAAM,QAAQ,UAAU,KAAK,QAAQ,IAAI;AACzC,UAAM,IAAI,QAAQ;AAEX,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAWK,KAAK,CAAC,UAAU,KAAK;AAAA,sBACf,MAAM,KAAK;AAAA,wBACT,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,mBAIhB,KAAK,CAAC,OAAO,KAAK;AAAA,sBACf,MAAM,KAAK;AAAA,wBACT,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAQhB,KAAK,IAAI,CAAC;AAAA;AAAA,wBAEL,QAAQ,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAO/B;AAcF;AA/Da,eAmDK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAlDC,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GADb,eACe,WAAA,UAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAFb,eAEe,WAAA,YAAA,CAAA;AAFf,iBAAN,gBAAA;AAAA,EADN,cAAc,kBAAkB;AAAA,GACpB,cAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"three-way-line.d.ts","sourceRoot":"","sources":["../../../src/automation/three-way-line/three-way-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAuB,MAAM,IAAI,CAAC;AAE9D,oBAAY,qBAAqB;IAC/B,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,qBACa,eAAgB,SAAQ,UAAU;IACnB,MAAM,EAAE,UAAU,CAAqB;IACvC,SAAS,EAAE,qBAAqB,CAC9B;IACF,QAAQ,EAAE,QAAQ,CAAkB;IAErD,MAAM;IAkFf,OAAgB,MAAM,
|
1
|
+
{"version":3,"file":"three-way-line.d.ts","sourceRoot":"","sources":["../../../src/automation/three-way-line/three-way-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAuB,MAAM,IAAI,CAAC;AAE9D,oBAAY,qBAAqB;IAC/B,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,qBACa,eAAgB,SAAQ,UAAU;IACnB,MAAM,EAAE,UAAU,CAAqB;IACvC,SAAS,EAAE,qBAAqB,CAC9B;IACF,QAAQ,EAAE,QAAQ,CAAkB;IAErD,MAAM;IAkFf,OAAgB,MAAM,0BAWpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,oBAAoB,EAAE,eAAe,CAAC;KACvC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"three-way-line.js","sources":["../../../src/automation/three-way-line/three-way-line.ts"],"sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {LineMedium, LineType, lineColor, lineWidth} from '..';\n\nexport enum ThreeWayLineDirection {\n top = 'top',\n right = 'right',\n bottom = 'bottom',\n left = 'left',\n}\n\n@customElement('obc-three-way-line')\nexport class ObcThreeWayLine extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.normal;\n @property({type: String}) direction: ThreeWayLineDirection =\n ThreeWayLineDirection.top;\n @property({type: String}) lineType: LineType = LineType.fluid;\n\n override render() {\n let rotation = 0;\n if (this.direction === ThreeWayLineDirection.top) {\n rotation = 180;\n } else if (this.direction === ThreeWayLineDirection.right) {\n rotation = 270;\n } else if (this.direction === ThreeWayLineDirection.bottom) {\n rotation = 0;\n } else if (this.direction === ThreeWayLineDirection.left) {\n rotation = 90;\n }\n\n if (this.lineType === LineType.connector) {\n return html`\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n transform=\"rotate(${rotation})\"\n >\n <path\n d=\"M10 11.5H14V12.5L10 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M4 11.5H8V12.5L4 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M0 11.5H2L2 12.5L0 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M22 11.5L24 11.5V12.5L22 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M16 11.5H20V12.5L16 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M12.5 24V22.1667H11.5V24H12.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M12.5 20.3333L12.5 16.6667H11.5L11.5 20.3333H12.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M12.5 14.8333V13L11.5 13V14.8333H12.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n </svg>\n `;\n }\n\n const color = lineColor(this.medium);\n const width = lineWidth(this.lineType) + 1;\n const h = width / 2;\n const c = 13 - h; // inner corner lenght\n\n return html`\n <svg\n class=\"line\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n transform=\"rotate(${rotation})\"\n >\n <path\n d=\"M-1 ${12 + h} v${-width}h26v${width}h-${c}v${c}h-${width}v-${c}Z\"\n fill=\"var(${color.inner})\"\n stroke=\"var(${color.outer})\"\n />\n </svg>\n `;\n }\n\n static override styles = css`\n :host {\n display: block;\n line-height: 0;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-three-way-line': ObcThreeWayLine;\n }\n}\n"],"names":["ThreeWayLineDirection"],"mappings":";;;;;;;;;;;;;;AAIY,IAAA,0CAAAA,2BAAL;AACLA,yBAAA,KAAM,IAAA;AACNA,yBAAA,OAAQ,IAAA;AACRA,yBAAA,QAAS,IAAA;AACTA,yBAAA,MAAO,IAAA;AAJGA,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AAQC,IAAA,kBAAN,cAA8B,WAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,SAAqB,WAAW;AAExD,SAAA,YAAA;AACwB,SAAA,WAAqB,SAAS;AAAA,EAAA;AAAA,EAE/C,SAAS;AAChB,QAAI,WAAW;AACX,QAAA,KAAK,cAAc,OAA2B;AACrC,iBAAA;AAAA,IAAA,WACF,KAAK,cAAc,SAA6B;AAC9C,iBAAA;AAAA,IAAA,WACF,KAAK,cAAc,UAA8B;AAC/C,iBAAA;AAAA,IAAA,WACF,KAAK,cAAc,QAA4B;AAC7C,iBAAA;AAAA,IACb;AAEI,QAAA,KAAK,aAAa,SAAS,WAAW;AACjC,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAOiB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAoClC;AAEM,UAAA,QAAQ,UAAU,KAAK,MAAM;AACnC,UAAM,QAAQ,UAAU,KAAK,QAAQ,IAAI;AACzC,UAAM,IAAI,QAAQ;AAClB,UAAM,IAAI,KAAK;AAER,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAQiB,QAAQ;AAAA;AAAA;AAAA,mBAGjB,KAAK,CAAC,KAAK,CAAC,KAAK,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;AAAA,sBACrD,MAAM,KAAK;AAAA,wBACT,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,EAIjC;
|
1
|
+
{"version":3,"file":"three-way-line.js","sources":["../../../src/automation/three-way-line/three-way-line.ts"],"sourcesContent":["import {LitElement, css, html} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {LineMedium, LineType, lineColor, lineWidth} from '..';\n\nexport enum ThreeWayLineDirection {\n top = 'top',\n right = 'right',\n bottom = 'bottom',\n left = 'left',\n}\n\n@customElement('obc-three-way-line')\nexport class ObcThreeWayLine extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.normal;\n @property({type: String}) direction: ThreeWayLineDirection =\n ThreeWayLineDirection.top;\n @property({type: String}) lineType: LineType = LineType.fluid;\n\n override render() {\n let rotation = 0;\n if (this.direction === ThreeWayLineDirection.top) {\n rotation = 180;\n } else if (this.direction === ThreeWayLineDirection.right) {\n rotation = 270;\n } else if (this.direction === ThreeWayLineDirection.bottom) {\n rotation = 0;\n } else if (this.direction === ThreeWayLineDirection.left) {\n rotation = 90;\n }\n\n if (this.lineType === LineType.connector) {\n return html`\n <svg\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n transform=\"rotate(${rotation})\"\n >\n <path\n d=\"M10 11.5H14V12.5L10 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M4 11.5H8V12.5L4 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M0 11.5H2L2 12.5L0 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M22 11.5L24 11.5V12.5L22 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M16 11.5H20V12.5L16 12.5V11.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M12.5 24V22.1667H11.5V24H12.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M12.5 20.3333L12.5 16.6667H11.5L11.5 20.3333H12.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n <path\n d=\"M12.5 14.8333V13L11.5 13V14.8333H12.5Z\"\n fill=\"var(--element-neutral-color)\"\n />\n </svg>\n `;\n }\n\n const color = lineColor(this.medium);\n const width = lineWidth(this.lineType) + 1;\n const h = width / 2;\n const c = 13 - h; // inner corner lenght\n\n return html`\n <svg\n class=\"line\"\n width=\"24\"\n height=\"24\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n transform=\"rotate(${rotation})\"\n >\n <path\n d=\"M-1 ${12 + h} v${-width}h26v${width}h-${c}v${c}h-${width}v-${c}Z\"\n fill=\"var(${color.inner})\"\n stroke=\"var(${color.outer})\"\n />\n </svg>\n `;\n }\n\n static override styles = css`\n :host {\n display: block;\n line-height: 0;\n }\n\n svg {\n position: relative;\n top: -12px;\n left: -12px;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-three-way-line': ObcThreeWayLine;\n }\n}\n"],"names":["ThreeWayLineDirection"],"mappings":";;;;;;;;;;;;;;AAIY,IAAA,0CAAAA,2BAAL;AACLA,yBAAA,KAAM,IAAA;AACNA,yBAAA,OAAQ,IAAA;AACRA,yBAAA,QAAS,IAAA;AACTA,yBAAA,MAAO,IAAA;AAJGA,SAAAA;AAAA,GAAA,yBAAA,CAAA,CAAA;AAQC,IAAA,kBAAN,cAA8B,WAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,SAAqB,WAAW;AAExD,SAAA,YAAA;AACwB,SAAA,WAAqB,SAAS;AAAA,EAAA;AAAA,EAE/C,SAAS;AAChB,QAAI,WAAW;AACX,QAAA,KAAK,cAAc,OAA2B;AACrC,iBAAA;AAAA,IAAA,WACF,KAAK,cAAc,SAA6B;AAC9C,iBAAA;AAAA,IAAA,WACF,KAAK,cAAc,UAA8B;AAC/C,iBAAA;AAAA,IAAA,WACF,KAAK,cAAc,QAA4B;AAC7C,iBAAA;AAAA,IACb;AAEI,QAAA,KAAK,aAAa,SAAS,WAAW;AACjC,aAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAOiB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAoClC;AAEM,UAAA,QAAQ,UAAU,KAAK,MAAM;AACnC,UAAM,QAAQ,UAAU,KAAK,QAAQ,IAAI;AACzC,UAAM,IAAI,QAAQ;AAClB,UAAM,IAAI,KAAK;AAER,WAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,4BAQiB,QAAQ;AAAA;AAAA;AAAA,mBAGjB,KAAK,CAAC,KAAK,CAAC,KAAK,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,KAAK,KAAK,KAAK,CAAC;AAAA,sBACrD,MAAM,KAAK;AAAA,wBACT,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,EAIjC;AAcF;AApGa,gBAwFK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAvFC,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GADb,gBACe,WAAA,UAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAFb,gBAEe,WAAA,aAAA,CAAA;AAEA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAJb,gBAIe,WAAA,YAAA,CAAA;AAJf,kBAAN,gBAAA;AAAA,EADN,cAAc,oBAAoB;AAAA,GACtB,eAAA;"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vertical-line.d.ts","sourceRoot":"","sources":["../../../src/automation/vertical-line/vertical-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAC,UAAU,EAAa,QAAQ,EAAY,MAAM,UAAU,CAAC;AAMpE,qBACa,eAAgB,SAAQ,UAAU;IACnB,MAAM,EAAE,UAAU,CAAqB;IACvC,QAAQ,EAAE,QAAQ,CAAkB;IACpC,MAAM,EAAE,MAAM,CAAK;IAEpC,MAAM;IAgEf,OAAgB,MAAM,
|
1
|
+
{"version":3,"file":"vertical-line.d.ts","sourceRoot":"","sources":["../../../src/automation/vertical-line/vertical-line.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAY,MAAM,KAAK,CAAC;AAE1C,OAAO,EAAC,UAAU,EAAa,QAAQ,EAAY,MAAM,UAAU,CAAC;AAMpE,qBACa,eAAgB,SAAQ,UAAU;IACnB,MAAM,EAAE,UAAU,CAAqB;IACvC,QAAQ,EAAE,QAAQ,CAAkB;IACpC,MAAM,EAAE,MAAM,CAAK;IAEpC,MAAM;IAgEf,OAAgB,MAAM,0BAWpB;CACH;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,mBAAmB,EAAE,eAAe,CAAC;KACtC;CACF"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"vertical-line.js","sources":["../../../src/automation/vertical-line/vertical-line.ts"],"sourcesContent":["import {LitElement, html, css} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {LineMedium, lineColor, LineType, lineWidth} from '../index';\n\n/* Vertical line component\n *\n * The vertical line is 24px * length + 1px. +1 px to make sure that connecting lines are overlapping, to hide the gap between them.\n */\n@customElement('obc-vertical-line')\nexport class ObcVerticalLine extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.normal;\n @property({type: String}) lineType: LineType = LineType.fluid;\n @property({type: Number}) length: number = 1;\n\n override render() {\n if (this.lineType === LineType.connector) {\n const length = this.length * 24;\n return html`<svg\n width=\"24\"\n height=\"${length}\"\n viewBox=\"0 0 24 ${length}\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line\n y1=\"0\"\n x1=\"12\"\n y2=\"${length}\"\n x2=\"12\"\n stroke-width=\"1\"\n stroke=\"var(--element-neutral-color)\"\n stroke-dasharray=\"4,2\"\n stroke-dashoffset=\"2\"\n />\n </svg> `;\n }\n\n const length = this.length * 24 + 1;\n const color = lineColor(this.medium);\n const width = lineWidth(this.lineType);\n return html`\n <div class=\"wrapper\" style=\"width: 24px; height: ${this.length * 24}px;\">\n <svg\n class=\"line\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 -.5 24 ${length}\"\n width=\"24\"\n height=${length}\n >\n <line\n y1=\"-.5\"\n x1=\"12\"\n y2=\"${length - 0.5}\"\n x2=\"12\"\n stroke-width=${width}\n stroke=\"var(${color.inner})\"\n />\n <line\n y1=\"-.5\"\n x1=${12 - 0.5 - width / 2}\n y2=\"${length - 0.5}\"\n x2=${12 - 0.5 - width / 2}\n stroke-width=\"1\"\n stroke=\"var(${color.outer})\"\n />\n <line\n y1=\"-.5\"\n x1=${12 + 0.5 + width / 2}\n y2=\"${length - 0.5}\"\n x2=${12 + 0.5 + width / 2}\n stroke-width=\"1\"\n stroke=\"var(${color.outer})\"\n />\n </svg>\n </div>\n `;\n }\n\n static override styles = css`\n :host {\n display: block;\n line-height: 0;\n }\n\n
|
1
|
+
{"version":3,"file":"vertical-line.js","sources":["../../../src/automation/vertical-line/vertical-line.ts"],"sourcesContent":["import {LitElement, html, css} from 'lit';\nimport {customElement, property} from 'lit/decorators.js';\nimport {LineMedium, lineColor, LineType, lineWidth} from '../index';\n\n/* Vertical line component\n *\n * The vertical line is 24px * length + 1px. +1 px to make sure that connecting lines are overlapping, to hide the gap between them.\n */\n@customElement('obc-vertical-line')\nexport class ObcVerticalLine extends LitElement {\n @property({type: String}) medium: LineMedium = LineMedium.normal;\n @property({type: String}) lineType: LineType = LineType.fluid;\n @property({type: Number}) length: number = 1;\n\n override render() {\n if (this.lineType === LineType.connector) {\n const length = this.length * 24;\n return html`<svg\n width=\"24\"\n height=\"${length}\"\n viewBox=\"0 0 24 ${length}\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <line\n y1=\"0\"\n x1=\"12\"\n y2=\"${length}\"\n x2=\"12\"\n stroke-width=\"1\"\n stroke=\"var(--element-neutral-color)\"\n stroke-dasharray=\"4,2\"\n stroke-dashoffset=\"2\"\n />\n </svg> `;\n }\n\n const length = this.length * 24 + 1;\n const color = lineColor(this.medium);\n const width = lineWidth(this.lineType);\n return html`\n <div class=\"wrapper\" style=\"width: 24px; height: ${this.length * 24}px;\">\n <svg\n class=\"line\"\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 -.5 24 ${length}\"\n width=\"24\"\n height=${length}\n >\n <line\n y1=\"-.5\"\n x1=\"12\"\n y2=\"${length - 0.5}\"\n x2=\"12\"\n stroke-width=${width}\n stroke=\"var(${color.inner})\"\n />\n <line\n y1=\"-.5\"\n x1=${12 - 0.5 - width / 2}\n y2=\"${length - 0.5}\"\n x2=${12 - 0.5 - width / 2}\n stroke-width=\"1\"\n stroke=\"var(${color.outer})\"\n />\n <line\n y1=\"-.5\"\n x1=${12 + 0.5 + width / 2}\n y2=\"${length - 0.5}\"\n x2=${12 + 0.5 + width / 2}\n stroke-width=\"1\"\n stroke=\"var(${color.outer})\"\n />\n </svg>\n </div>\n `;\n }\n\n static override styles = css`\n :host {\n display: block;\n line-height: 0;\n }\n\n svg {\n position: relative;\n top: -0.5px;\n left: -12px;\n }\n `;\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'obc-vertical-line': ObcVerticalLine;\n }\n}\n"],"names":["length"],"mappings":";;;;;;;;;;;;;;AASa,IAAA,kBAAN,cAA8B,WAAW;AAAA,EAAzC,cAAA;AAAA,UAAA,GAAA,SAAA;AACqB,SAAA,SAAqB,WAAW;AAChC,SAAA,WAAqB,SAAS;AACb,SAAA,SAAA;AAAA,EAAA;AAAA,EAElC,SAAS;AACZ,QAAA,KAAK,aAAa,SAAS,WAAW;AAClCA,YAAAA,UAAS,KAAK,SAAS;AACtB,aAAA;AAAA;AAAA,kBAEKA,OAAM;AAAA,0BACEA,OAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAOhBA,OAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAQlB;AAEM,UAAA,SAAS,KAAK,SAAS,KAAK;AAC5B,UAAA,QAAQ,UAAU,KAAK,MAAM;AAC7B,UAAA,QAAQ,UAAU,KAAK,QAAQ;AAC9B,WAAA;AAAA,yDAC8C,KAAK,SAAS,EAAE;AAAA;AAAA;AAAA;AAAA,+BAI1C,MAAM;AAAA;AAAA,mBAElB,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA,kBAKP,SAAS,GAAG;AAAA;AAAA,2BAEH,KAAK;AAAA,0BACN,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,iBAIpB,KAAK,MAAM,QAAQ,CAAC;AAAA,kBACnB,SAAS,GAAG;AAAA,iBACb,KAAK,MAAM,QAAQ,CAAC;AAAA;AAAA,0BAEX,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA,iBAIpB,KAAK,MAAM,QAAQ,CAAC;AAAA,kBACnB,SAAS,GAAG;AAAA,iBACb,KAAK,MAAM,QAAQ,CAAC;AAAA;AAAA,0BAEX,MAAM,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnC;AAcF;AAjFa,gBAqEK,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AApEC,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GADb,gBACe,WAAA,UAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAFb,gBAEe,WAAA,YAAA,CAAA;AACA,gBAAA;AAAA,EAAzB,SAAS,EAAC,MAAM,QAAO;AAAA,GAHb,gBAGe,WAAA,UAAA,CAAA;AAHf,kBAAN,gBAAA;AAAA,EADN,cAAc,mBAAmB;AAAA,GACrB,eAAA;"}
|
package/dist/storybook-util.d.ts
CHANGED
@@ -5,7 +5,8 @@ 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 } from 'lit';
|
8
|
+
import { HTMLTemplateResult, TemplateResult } from 'lit';
|
9
9
|
export declare const iconIds: string[];
|
10
10
|
export declare function iconIdToIconHtml(id: string, attributes?: Record<string, string>): TemplateResult;
|
11
|
+
export declare function crossDecorator(story: () => unknown): HTMLTemplateResult;
|
11
12
|
//# sourceMappingURL=storybook-util.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"storybook-util.d.ts","sourceRoot":"","sources":["../src/storybook-util.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,wBAAwB,CAAC;AAChC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,gCAAgC,CAAC;AACxC,OAAO,iCAAiC,CAAC;AACzC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAC,cAAc,EAAO,MAAM,KAAK,CAAC;
|
1
|
+
{"version":3,"file":"storybook-util.d.ts","sourceRoot":"","sources":["../src/storybook-util.ts"],"names":[],"mappings":"AAAA,OAAO,6BAA6B,CAAC;AACrC,OAAO,wBAAwB,CAAC;AAChC,OAAO,uBAAuB,CAAC;AAC/B,OAAO,qBAAqB,CAAC;AAC7B,OAAO,gCAAgC,CAAC;AACxC,OAAO,iCAAiC,CAAC;AACzC,OAAO,sBAAsB,CAAC;AAC9B,OAAO,EAAC,kBAAkB,EAAE,cAAc,EAAO,MAAM,KAAK,CAAC;AAG7D,eAAO,MAAM,OAAO,UAQZ,CAAC;AAET,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,MAAM,EACV,UAAU,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GACtC,cAAc,CAyBhB;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,OAAO,GAAG,kBAAkB,CAsCvE"}
|
package/dist/storybook-util.js
CHANGED
@@ -42,7 +42,47 @@ function iconIdToIconHtml(id, attributes = {}) {
|
|
42
42
|
throw new Error(`Unknown icon id: ${id}`);
|
43
43
|
}
|
44
44
|
}
|
45
|
+
function crossDecorator(story) {
|
46
|
+
return html` <style>
|
47
|
+
.wrapper {
|
48
|
+
width: 100%;
|
49
|
+
height: 100vh;
|
50
|
+
position: relative;
|
51
|
+
}
|
52
|
+
|
53
|
+
.wrapper > * {
|
54
|
+
position: absolute;
|
55
|
+
top: 50%;
|
56
|
+
left: 50%;
|
57
|
+
}
|
58
|
+
|
59
|
+
.wrapper::before {
|
60
|
+
content: '';
|
61
|
+
display: block;
|
62
|
+
position: absolute;
|
63
|
+
top: 0;
|
64
|
+
bottom: 0;
|
65
|
+
width: 1px;
|
66
|
+
left: calc(50% - 0.5px);
|
67
|
+
background-color: rgb(0, 0, 0, 0.3);
|
68
|
+
}
|
69
|
+
|
70
|
+
.wrapper::after {
|
71
|
+
content: '';
|
72
|
+
display: block;
|
73
|
+
position: absolute;
|
74
|
+
left: 0;
|
75
|
+
right: 0;
|
76
|
+
height: 1px;
|
77
|
+
top: calc(50% - 0.5px);
|
78
|
+
background-color: rgb(0, 0, 0, 0.3);
|
79
|
+
z-index: -100;
|
80
|
+
}
|
81
|
+
</style>
|
82
|
+
<div class="wrapper">${story()}</div>`;
|
83
|
+
}
|
45
84
|
export {
|
85
|
+
crossDecorator,
|
46
86
|
iconIdToIconHtml,
|
47
87
|
iconIds
|
48
88
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"storybook-util.js","sources":["../src/storybook-util.ts"],"sourcesContent":["import './icons/icon-01-placeholder';\nimport './icons/icon-01-search';\nimport './icons/icon-06-radar';\nimport './icons/icon-04-day';\nimport './icons/icon-04-brilliance-low';\nimport './icons/icon-04-brilliance-high';\nimport './icons/icon-06-ship';\nimport {TemplateResult, html} from 'lit';\nimport {spread} from '@open-wc/lit-helpers';\n\nexport const iconIds = [\n '01-placeholder',\n '01-search',\n '04-brilliance-low',\n '04-brilliance-high',\n '06-radar',\n '04-day',\n '06-ship',\n].sort();\n\nexport function iconIdToIconHtml(\n id: string,\n attributes: Record<string, string> = {}\n): TemplateResult {\n switch (id) {\n case '01-placeholder':\n return html`<obi-01-placeholder\n ${spread(attributes)}\n ></obi-01-placeholder>`;\n case '01-search':\n return html`<obi-01-search ${spread(attributes)}></obi-01-search>`;\n case '04-day':\n return html`<obi-04-day ${spread(attributes)}></obi-04-day>`;\n case '04-brilliance-low':\n return html`<obi-04-brilliance-low\n ${spread(attributes)}\n ></obi-04-brilliance-low>`;\n case '04-brilliance-high':\n return html`<obi-04-brilliance-high\n ${spread(attributes)}\n ></obi-04-brilliance-high>`;\n case '06-radar':\n return html`<obi-06-radar ${spread(attributes)}></obi-06-radar>`;\n case '06-ship':\n return html`<obi-06-ship ${spread(attributes)}></obi-06-ship>`;\n default:\n throw new Error(`Unknown icon id: ${id}`);\n }\n}\n"],"names":[],"mappings":";;;;;;;;;AAUO,MAAM,UAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK;AAEA,SAAS,iBACd,IACA,aAAqC,IACrB;AAChB,UAAQ,IAAI;AAAA,IACV,KAAK;AACI,aAAA;AAAA,UACH,OAAO,UAAU,CAAC;AAAA;AAAA,IAExB,KAAK;AACI,aAAA,sBAAsB,OAAO,UAAU,CAAC;AAAA,IACjD,KAAK;AACI,aAAA,mBAAmB,OAAO,UAAU,CAAC;AAAA,IAC9C,KAAK;AACI,aAAA;AAAA,UACH,OAAO,UAAU,CAAC;AAAA;AAAA,IAExB,KAAK;AACI,aAAA;AAAA,UACH,OAAO,UAAU,CAAC;AAAA;AAAA,IAExB,KAAK;AACI,aAAA,qBAAqB,OAAO,UAAU,CAAC;AAAA,IAChD,KAAK;AACI,aAAA,oBAAoB,OAAO,UAAU,CAAC;AAAA,IAC/C;AACE,YAAM,IAAI,MAAM,oBAAoB,EAAE,EAAE;AAAA,EAC5C;AACF;"}
|
1
|
+
{"version":3,"file":"storybook-util.js","sources":["../src/storybook-util.ts"],"sourcesContent":["import './icons/icon-01-placeholder';\nimport './icons/icon-01-search';\nimport './icons/icon-06-radar';\nimport './icons/icon-04-day';\nimport './icons/icon-04-brilliance-low';\nimport './icons/icon-04-brilliance-high';\nimport './icons/icon-06-ship';\nimport {HTMLTemplateResult, TemplateResult, html} from 'lit';\nimport {spread} from '@open-wc/lit-helpers';\n\nexport const iconIds = [\n '01-placeholder',\n '01-search',\n '04-brilliance-low',\n '04-brilliance-high',\n '06-radar',\n '04-day',\n '06-ship',\n].sort();\n\nexport function iconIdToIconHtml(\n id: string,\n attributes: Record<string, string> = {}\n): TemplateResult {\n switch (id) {\n case '01-placeholder':\n return html`<obi-01-placeholder\n ${spread(attributes)}\n ></obi-01-placeholder>`;\n case '01-search':\n return html`<obi-01-search ${spread(attributes)}></obi-01-search>`;\n case '04-day':\n return html`<obi-04-day ${spread(attributes)}></obi-04-day>`;\n case '04-brilliance-low':\n return html`<obi-04-brilliance-low\n ${spread(attributes)}\n ></obi-04-brilliance-low>`;\n case '04-brilliance-high':\n return html`<obi-04-brilliance-high\n ${spread(attributes)}\n ></obi-04-brilliance-high>`;\n case '06-radar':\n return html`<obi-06-radar ${spread(attributes)}></obi-06-radar>`;\n case '06-ship':\n return html`<obi-06-ship ${spread(attributes)}></obi-06-ship>`;\n default:\n throw new Error(`Unknown icon id: ${id}`);\n }\n}\n\nexport function crossDecorator(story: () => unknown): HTMLTemplateResult {\n return html` <style>\n .wrapper {\n width: 100%;\n height: 100vh;\n position: relative;\n }\n\n .wrapper > * {\n position: absolute;\n top: 50%;\n left: 50%;\n }\n\n .wrapper::before {\n content: '';\n display: block;\n position: absolute;\n top: 0;\n bottom: 0;\n width: 1px;\n left: calc(50% - 0.5px);\n background-color: rgb(0, 0, 0, 0.3);\n }\n\n .wrapper::after {\n content: '';\n display: block;\n position: absolute;\n left: 0;\n right: 0;\n height: 1px;\n top: calc(50% - 0.5px);\n background-color: rgb(0, 0, 0, 0.3);\n z-index: -100;\n }\n </style>\n <div class=\"wrapper\">${story()}</div>`;\n}\n"],"names":[],"mappings":";;;;;;;;;AAUO,MAAM,UAAU;AAAA,EACrB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,EAAE,KAAK;AAEA,SAAS,iBACd,IACA,aAAqC,IACrB;AAChB,UAAQ,IAAI;AAAA,IACV,KAAK;AACI,aAAA;AAAA,UACH,OAAO,UAAU,CAAC;AAAA;AAAA,IAExB,KAAK;AACI,aAAA,sBAAsB,OAAO,UAAU,CAAC;AAAA,IACjD,KAAK;AACI,aAAA,mBAAmB,OAAO,UAAU,CAAC;AAAA,IAC9C,KAAK;AACI,aAAA;AAAA,UACH,OAAO,UAAU,CAAC;AAAA;AAAA,IAExB,KAAK;AACI,aAAA;AAAA,UACH,OAAO,UAAU,CAAC;AAAA;AAAA,IAExB,KAAK;AACI,aAAA,qBAAqB,OAAO,UAAU,CAAC;AAAA,IAChD,KAAK;AACI,aAAA,oBAAoB,OAAO,UAAU,CAAC;AAAA,IAC/C;AACE,YAAM,IAAI,MAAM,oBAAoB,EAAE,EAAE;AAAA,EAC5C;AACF;AAEO,SAAS,eAAe,OAA0C;AAChE,SAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAoCkB,OAAO;AAClC;"}
|
package/package.json
CHANGED
@@ -8,7 +8,88 @@
|
|
8
8
|
}
|
9
9
|
}
|
10
10
|
|
11
|
+
.outer-wrapper {
|
12
|
+
width: 0;
|
13
|
+
height: 0;
|
14
|
+
}
|
15
|
+
|
11
16
|
.wrapper {
|
17
|
+
position: absolute;
|
18
|
+
|
19
|
+
&.label-bottom {
|
20
|
+
top: -33px;
|
21
|
+
transform: translateX(-50%);
|
22
|
+
}
|
23
|
+
|
24
|
+
&.label-right {
|
25
|
+
left: -33px;
|
26
|
+
transform: translateY(-50%);
|
27
|
+
}
|
28
|
+
|
29
|
+
&.label-top{
|
30
|
+
bottom: -33px;
|
31
|
+
transform: translateX(-50%);
|
32
|
+
}
|
33
|
+
|
34
|
+
&.label-left {
|
35
|
+
right: -33px;
|
36
|
+
transform: translateY(-50%);
|
37
|
+
}
|
38
|
+
|
39
|
+
&.size-small {
|
40
|
+
&.label-bottom {
|
41
|
+
top: -25px;
|
42
|
+
}
|
43
|
+
|
44
|
+
&.label-right {
|
45
|
+
left: -25px;
|
46
|
+
}
|
47
|
+
|
48
|
+
&.label-top{
|
49
|
+
bottom: -25px;
|
50
|
+
}
|
51
|
+
|
52
|
+
&.label-left {
|
53
|
+
right: -25px;
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
&.size-large {
|
58
|
+
&.label-bottom {
|
59
|
+
top: -41px;
|
60
|
+
}
|
61
|
+
|
62
|
+
&.label-right {
|
63
|
+
left: -41px;
|
64
|
+
}
|
65
|
+
|
66
|
+
&.label-top{
|
67
|
+
bottom: -41px;
|
68
|
+
}
|
69
|
+
|
70
|
+
&.label-left {
|
71
|
+
right: -41px;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
|
75
|
+
&.size-xl {
|
76
|
+
&.label-bottom {
|
77
|
+
top: -57px;
|
78
|
+
}
|
79
|
+
|
80
|
+
&.label-right {
|
81
|
+
left: -57px;
|
82
|
+
}
|
83
|
+
|
84
|
+
&.label-top{
|
85
|
+
bottom: -57px;
|
86
|
+
}
|
87
|
+
|
88
|
+
&.label-left {
|
89
|
+
right: -57px;
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
12
93
|
display: flex;
|
13
94
|
flex-direction: row;
|
14
95
|
align-items: center;
|
@@ -24,11 +24,13 @@ import '../../icons/icon-08-pump-on-horisontal';
|
|
24
24
|
import '../../icons/icon-08-pump-off-horisontal';
|
25
25
|
import '../valve-analog-three-way-icon/valve-analog-three-way-icon';
|
26
26
|
import {BadgeSize} from '../../components/badge/badge';
|
27
|
+
import {crossDecorator} from '../../storybook-util';
|
27
28
|
|
28
29
|
const meta: Meta<typeof ObcAutomationButton> = {
|
29
30
|
title: 'Automation/Button',
|
30
31
|
tags: ['autodocs'],
|
31
32
|
component: 'obc-automation-button',
|
33
|
+
decorators: [crossDecorator],
|
32
34
|
argTypes: {
|
33
35
|
size: {
|
34
36
|
options: ['small', 'regular', 'large', 'xl'],
|
@@ -159,66 +159,68 @@ export class ObcAutomationButton extends LitElement {
|
|
159
159
|
const direction = this.getDirectionIcon();
|
160
160
|
|
161
161
|
return html`
|
162
|
-
<
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
<
|
209
|
-
|
210
|
-
|
211
|
-
<
|
212
|
-
|
213
|
-
|
214
|
-
<
|
215
|
-
|
216
|
-
|
217
|
-
<
|
162
|
+
<div class="outer-wrapper">
|
163
|
+
<button
|
164
|
+
class=${classMap({
|
165
|
+
wrapper: true,
|
166
|
+
['size-' + this.size]: true,
|
167
|
+
['variant-' + this.variant]: true,
|
168
|
+
['state-' + this.state]: true,
|
169
|
+
['label-' + this.labelPosition]: true,
|
170
|
+
['label-size-' + this.labelSize]: true,
|
171
|
+
['label-style-' + this.labelStyle]: true,
|
172
|
+
alert: this.alert,
|
173
|
+
progress: this.progress,
|
174
|
+
})}
|
175
|
+
>
|
176
|
+
<div class="icon-holder">
|
177
|
+
${direction}
|
178
|
+
${this.variant !== AutomationButtonVariant.double ||
|
179
|
+
this.size !== AutomationButtonSize.small
|
180
|
+
? html`<div class="icon-primary">
|
181
|
+
<slot name="icon"></slot>
|
182
|
+
</div>`
|
183
|
+
: ''}
|
184
|
+
${progressSpinner}
|
185
|
+
${this.alert
|
186
|
+
? html`<svg
|
187
|
+
class="alert-icon"
|
188
|
+
width="18"
|
189
|
+
height="31"
|
190
|
+
viewBox="0 0 18 31"
|
191
|
+
fill="none"
|
192
|
+
xmlns="http://www.w3.org/2000/svg"
|
193
|
+
>
|
194
|
+
<path
|
195
|
+
d="M 0 0 L 16 0 C 17.1046 0 18 0.8954 18 2 V 14.7889 C 18 15.5786 17.7662 16.3506 17.3282 17.0077 L 9 30 V 3 L 7 1 H 0 Z"
|
196
|
+
fill="var(--alert-alarm-color)"
|
197
|
+
/>
|
198
|
+
<path
|
199
|
+
d="M12 4H14V11.5H12V4Z"
|
200
|
+
fill="var(--on-alarm-active-color)"
|
201
|
+
/>
|
202
|
+
<path
|
203
|
+
d="M12 13.5H14V15.5H12V13.5Z"
|
204
|
+
fill="var(--on-alarm-active-color)"
|
205
|
+
/>
|
206
|
+
</svg> `
|
207
|
+
: ''}
|
208
|
+
<div class="badge-top-right">
|
209
|
+
<slot name="badge-top-right"></slot>
|
210
|
+
</div>
|
211
|
+
<div class="badge-top-left">
|
212
|
+
<slot name="badge-top-left"></slot>
|
213
|
+
</div>
|
214
|
+
<div class="badge-bottom-left">
|
215
|
+
<slot name="badge-bottom-left"></slot>
|
216
|
+
</div>
|
217
|
+
<div class="badge-bottom-right">
|
218
|
+
<slot name="badge-bottom-right"></slot>
|
219
|
+
</div>
|
218
220
|
</div>
|
219
|
-
|
220
|
-
|
221
|
-
</
|
221
|
+
<div class="label">${labels}</div>
|
222
|
+
</button>
|
223
|
+
</div>
|
222
224
|
`;
|
223
225
|
}
|
224
226
|
|
@@ -6,11 +6,13 @@ import '../horizontal-line/horizontal-line';
|
|
6
6
|
import '../vertical-line/vertical-line';
|
7
7
|
import {LineMedium, LineType} from '../index';
|
8
8
|
import {html} from 'lit';
|
9
|
+
import {crossDecorator} from '../../storybook-util';
|
9
10
|
|
10
11
|
const meta: Meta<typeof ObcAutomationReadout> = {
|
11
12
|
title: 'Automation/Readout',
|
12
13
|
tags: ['autodocs'],
|
13
14
|
component: 'obc-automation-readout',
|
15
|
+
decorators: [crossDecorator],
|
14
16
|
args: {
|
15
17
|
value: 25,
|
16
18
|
unit: '°C',
|
@@ -52,13 +54,7 @@ export const UsageWithPipeBottom: Story = {
|
|
52
54
|
#line-bottom {
|
53
55
|
position: absolute;
|
54
56
|
top: 0;
|
55
|
-
left:
|
56
|
-
}
|
57
|
-
|
58
|
-
#readout-bottom {
|
59
|
-
position: absolute;
|
60
|
-
top: 12px; /* 12px is the height of the grid size */
|
61
|
-
left: calc(2.5 * 24px); /* 5 is the length of the line */
|
57
|
+
left: calc(-2.5 * 24px);
|
62
58
|
}
|
63
59
|
</style>
|
64
60
|
<div class="canvas">
|
@@ -91,14 +87,8 @@ export const UsageWithPipeTop: Story = {
|
|
91
87
|
|
92
88
|
#line-top {
|
93
89
|
position: absolute;
|
94
|
-
top:
|
95
|
-
left:
|
96
|
-
}
|
97
|
-
|
98
|
-
#readout-top {
|
99
|
-
position: absolute;
|
100
|
-
top: 36px; /* 12px is the height of the grid size */
|
101
|
-
left: calc(2.5 * 24px); /* 5 is the length of the line */
|
90
|
+
top: 0;
|
91
|
+
left: calc(-2.5 * 24px);
|
102
92
|
}
|
103
93
|
</style>
|
104
94
|
<div class="canvas">
|
@@ -131,14 +121,8 @@ export const UsageWithPipeLeft: Story = {
|
|
131
121
|
|
132
122
|
#line-left {
|
133
123
|
position: absolute;
|
134
|
-
|
135
|
-
|
136
|
-
}
|
137
|
-
|
138
|
-
#readout-left {
|
139
|
-
position: absolute;
|
140
|
-
top: calc(2.5 * 24px); /* 24px is the height of the grid size */
|
141
|
-
left: calc(24px * 3 + 12px);
|
124
|
+
left: 0;
|
125
|
+
top: calc(-24px * 2.5);
|
142
126
|
}
|
143
127
|
</style>
|
144
128
|
<div class="canvas">
|
@@ -171,14 +155,7 @@ export const UsageWithPipeRight: Story = {
|
|
171
155
|
|
172
156
|
#line-right {
|
173
157
|
position: absolute;
|
174
|
-
top:
|
175
|
-
left: 0;
|
176
|
-
}
|
177
|
-
|
178
|
-
#readout-right {
|
179
|
-
position: absolute;
|
180
|
-
top: calc(2.5 * 24px); /* 24px is the height of the grid size */
|
181
|
-
left: 12px;
|
158
|
+
top: calc(-2.5 * 24px);
|
182
159
|
}
|
183
160
|
</style>
|
184
161
|
<div class="canvas">
|
@@ -15,6 +15,7 @@
|
|
15
15
|
/* This is a hack to make the badge appear above the content */
|
16
16
|
position: relative;
|
17
17
|
top: -20px;
|
18
|
+
transform: translateX(-50%);
|
18
19
|
}
|
19
20
|
|
20
21
|
.badges {
|
@@ -54,7 +55,7 @@
|
|
54
55
|
}
|
55
56
|
|
56
57
|
.header {
|
57
|
-
width:
|
58
|
+
width: 150px;
|
58
59
|
display: flex;
|
59
60
|
align-items: center;
|
60
61
|
justify-content: space-between;
|
@@ -5,6 +5,7 @@ import '../../components/badge/badge';
|
|
5
5
|
import '../../icons/icon-08-auto';
|
6
6
|
import '../../icons/icon-16-lock';
|
7
7
|
import {html} from 'lit';
|
8
|
+
import {crossDecorator} from '../../storybook-util';
|
8
9
|
|
9
10
|
const meta: Meta<typeof ObcAutomationTank> = {
|
10
11
|
title: 'Automation/Tank',
|
@@ -29,14 +30,7 @@ const meta: Meta<typeof ObcAutomationTank> = {
|
|
29
30
|
control: {type: 'radio'},
|
30
31
|
},
|
31
32
|
},
|
32
|
-
decorators: [
|
33
|
-
(story) =>
|
34
|
-
html`<div
|
35
|
-
style="display: flex; justify-content: center; align-items: center; height: 100vh"
|
36
|
-
>
|
37
|
-
${story()}
|
38
|
-
</div>`,
|
39
|
-
],
|
33
|
+
decorators: [crossDecorator],
|
40
34
|
} satisfies Meta<ObcAutomationTank>;
|
41
35
|
|
42
36
|
export default meta;
|
@@ -1,10 +1,12 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
2
|
import {ObcCornerLine} from './corner-line';
|
3
3
|
import './corner-line';
|
4
|
+
import {crossDecorator} from '../../storybook-util';
|
4
5
|
|
5
6
|
const meta: Meta<typeof ObcCornerLine> = {
|
6
7
|
title: 'Line/Corner line',
|
7
8
|
tags: ['autodocs'],
|
9
|
+
decorators: [crossDecorator],
|
8
10
|
component: 'obc-corner-line',
|
9
11
|
args: {},
|
10
12
|
argTypes: {
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
2
|
import {ObcDirectionLine} from './direction-line';
|
3
3
|
import './direction-line';
|
4
|
+
import {crossDecorator} from '../../storybook-util';
|
4
5
|
|
5
6
|
const meta: Meta<typeof ObcDirectionLine> = {
|
6
7
|
title: 'Line/Direction',
|
7
8
|
tags: ['autodocs'],
|
8
9
|
component: 'obc-direction-line',
|
10
|
+
decorators: [crossDecorator],
|
9
11
|
args: {},
|
10
12
|
argTypes: {
|
11
13
|
medium: {
|
@@ -1,11 +1,13 @@
|
|
1
1
|
import type {Meta, StoryObj} from '@storybook/web-components';
|
2
2
|
import {ObcEndPointLine} from './end-point-line';
|
3
3
|
import './end-point-line';
|
4
|
+
import {crossDecorator} from '../../storybook-util';
|
4
5
|
|
5
6
|
const meta: Meta<typeof ObcEndPointLine> = {
|
6
7
|
title: 'Line/End point line',
|
7
8
|
tags: ['autodocs'],
|
8
9
|
component: 'obc-end-point-line',
|
10
|
+
decorators: [crossDecorator],
|
9
11
|
argTypes: {
|
10
12
|
medium: {
|
11
13
|
options: ['normal', 'empty', 'water'],
|