UNPKG

@chief-editor/shape

Version:

Shape for chief editor

1 lines 1.23 kB
"use strict";var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var a in e=arguments[r])Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t}).apply(this,arguments)},__rest=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(i=Object.getOwnPropertySymbols(t);a<i.length;a++)e.indexOf(i[a])<0&&Object.prototype.propertyIsEnumerable.call(t,i[a])&&(r[i[a]]=t[i[a]])}return r},__importDefault=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0});var react_1=__importDefault(require("react"));function Line(t){var e=t.width,r=(t.height,t.strokeWidth),i=void 0===r?1:r,a=(t.ratio,t.strokeDasharray),n=__rest(t,["width","height","strokeWidth","ratio","strokeDasharray"]);return react_1.default.createElement("svg",{width:e,height:i,viewBox:"0 "+-i/2+" "+e+" "+i,fill:"none"},react_1.default.createElement("line",__assign({},n,{x1:"0",y1:"0",x2:e,y2:"0",strokeWidth:i||1,strokeDasharray:a})))}exports.Line=Line;