ladle-inject-custom-addons
Version:
Adds a button to the Ladle addon bar
2 lines (1 loc) • 1.43 kB
JavaScript
;var l=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var L=(e,o)=>{for(var t in o)l(e,t,{get:o[t],enumerable:!0})},u=(e,o,t,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let a of C(o))!I.call(e,a)&&a!==t&&l(e,a,{get:()=>o[a],enumerable:!(c=m(o,a))||c.enumerable});return e};var f=e=>u(l({},"__esModule",{value:!0}),e);var h={};L(h,{LadleDialogCloseButton:()=>P});module.exports=f(h);function s(...e){return e.flat().filter(o=>o&&!!o.trim()).join(" ")}var i=require("react/jsx-runtime"),d=({icon:e,...o})=>(0,i.jsx)("button",{...o,className:s("ladle-button",o.className),style:{height:36,width:36,borderColor:"transparent",boxShadow:"none",...o.style},children:e});var n=require("react/jsx-runtime"),g=({size:e=24,...o})=>(0,n.jsx)("svg",{width:e,height:e,viewBox:"0 0 24 24",stroke:"currentColor",fill:"none",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",...o}),p=({size:e=18,...o})=>(0,n.jsxs)(g,{size:e,...o,children:[(0,n.jsx)("path",{d:"M0 0h24v24H0z",stroke:"none"}),(0,n.jsx)("path",{d:"M18 6L6 18M6 6l12 12"})]});var r=require("react/jsx-runtime"),P=({iconProps:e,wrapperProps:o,...t})=>(0,r.jsx)("div",{...o,style:{position:"absolute",insetInlineEnd:-6,top:0,...o?.style},children:(0,r.jsx)(d,{"aria-label":"Close modal",...t,icon:(0,r.jsx)(p,{...e})})});0&&(module.exports={LadleDialogCloseButton});