UNPKG

@chief-editor/shape

Version:

Shape for chief editor

1 lines 1.09 kB
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(t){for(var e,r=1,o=arguments.length;r<o;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 o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(r[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(o=Object.getOwnPropertySymbols(t);a<o.length;a++)e.indexOf(o[a])<0&&Object.prototype.propertyIsEnumerable.call(t,o[a])&&(r[o[a]]=t[o[a]])}return r};import React from"react";export function Triangle(t){var e=t.width,r=t.height,o=t.ratio,a=void 0===o?"none":o,i=t.strokeWidth,n=void 0===i?0:i,s=t.strokeDasharray,h=__rest(t,["width","height","ratio","strokeWidth","strokeDasharray"]),c=300,p=300;return s&&(c+=n,p+=n),React.createElement("svg",{width:e,height:r,viewBox:-n/2+" "+-n/2+" "+c+" "+p,fill:"none",preserveAspectRatio:a},React.createElement("path",__assign({},h,{strokeDasharray:s,strokeWidth:n,d:"M150 0L300 300H0L150 0Z"})))}