@billgangcom/theme-lib 1.5.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/builder.cjs.js +3 -3
- package/dist/builder.es.js +4 -4
- package/dist/{index-O501BDCu.js → index-2iAZ7WmX.js} +755 -739
- package/dist/{index-BO6B5tl0.cjs → index-DSUcxVxJ.cjs} +13 -13
- package/dist/shared/ui/Input/index.d.ts +1 -0
- package/dist/ui/ButtonTypeSettings/index.d.ts +8 -0
- package/dist/ui/ItemsSettings/index.d.ts +17 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +415 -340
- package/package.json +1 -1
package/dist/ui.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-BO6B5tl0.cjs"),h=require("react"),T="_wrapper_o1bnv_2",$="_alignmentBlock_o1bnv_8",S="_title_o1bnv_16",P="_subtitle_o1bnv_23",A="_alignmentContent_o1bnv_30",L="_alignments_o1bnv_37",z="_alignment_o1bnv_8",O="_circle_o1bnv_56",H="_paddings_o1bnv_63",M="_padding_o1bnv_63",F="_input_o1bnv_81",j={wrapper:T,alignmentBlock:$,title:S,subtitle:P,alignmentContent:A,alignments:L,alignment:z,circle:O,paddings:H,padding:M,input:F},G=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],q=["left","top","right","bottom"],D=x=>{const{alignment:n,padding:r,setPadding:e,setAlignment:a}=x;return t.jsxRuntimeExports.jsxs("div",{className:j.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:j.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:j.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:j.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:j.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:j.alignments,children:G.map(o=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{a(c=>o)},className:j.alignment,children:[o!==n&&t.jsxRuntimeExports.jsx("div",{className:j.circle}),o===n&&t.jsxRuntimeExports.jsx(t.Icon,{name:"text-align-left",fill:"#FF3F19"})]},o))}),t.jsxRuntimeExports.jsx("div",{className:j.paddings,children:q.map(o=>t.jsxRuntimeExports.jsxs("label",{className:j.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:`align-${o}`,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(r[o]),onChange:c=>e(m=>({...m,[o]:Number(c)})),paddingless:!0})]}))})]})]})]})},Y="_subtitle_2zbxx_1",J="_header_2zbxx_8",K="_text_2zbxx_9",Q="_top_2zbxx_16",U="_itemsBlock_2zbxx_23",E={subtitle:Y,header:J,text:K,top:Q,itemsBlock:U},V="_typeTexts_3zlec_1",W="_block_3zlec_7",X="_active_3zlec_18",N={typeTexts:V,block:W,active:X},Z=["bold","italic","underline","strike-through","code"],f=x=>{const{typeText:n,setTypeText:r}=x;return t.jsxRuntimeExports.jsx("div",{className:N.typeTexts,children:Z.map(e=>t.jsxRuntimeExports.jsx("div",{className:t.clx(N.block,{[N.active]:n===e}),onClick:()=>r(a=>e),children:t.jsxRuntimeExports.jsx(t.Icon,{name:`text-${e}`,fill:n===e?"#252525":"#757575",width:20,height:20})},String(e)))})},tt=x=>{const{typeText:n,isActiveText:r,setIsActiveText:e,text:a,setText:o,setTypeText:c,title:m,subtitle:g="Items"}=x;return t.jsxRuntimeExports.jsxs("div",{className:E.text,children:[t.jsxRuntimeExports.jsxs("div",{className:E.top,children:[t.jsxRuntimeExports.jsx("h3",{className:E.title,children:m}),t.jsxRuntimeExports.jsx(t.Switch,{current:r,onChange:d=>e(s=>d)})]}),t.jsxRuntimeExports.jsxs("div",{className:E.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:E.subtitle,children:g}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:d=>o(s=>d),value:a,maxLength:150}),t.jsxRuntimeExports.jsx(f,{typeText:n,setTypeText:c})]})]})},st="_subtitle_2l7ty_1",et="_header_2l7ty_8",nt="_text_2l7ty_9",ot="_productsBlock_2l7ty_10",it="_top_2l7ty_22",ct="_itemsBlock_2l7ty_29",lt="_typeTexts_2l7ty_35",at="_block_2l7ty_41",xt="_active_2l7ty_52",rt="_products_2l7ty_10",ut="_product_2l7ty_10",pt="_button_2l7ty_70",mt="_image_2l7ty_80",dt="_info_2l7ty_87",_t="_name_2l7ty_98",jt="_buttons_2l7ty_102",ht="_modal_2l7ty_108",gt="_other_2l7ty_125",l={subtitle:st,header:et,text:nt,productsBlock:ot,top:it,itemsBlock:ct,typeTexts:lt,block:at,active:xt,products:rt,product:ut,button:pt,image:mt,info:dt,name:_t,buttons:jt,modal:ht,other:gt},bt=x=>{const{activeItem:n,setActiveItem:r,popupPosition:e}=x;return t.jsxRuntimeExports.jsxs("div",{className:l.modal,onClick:a=>{a.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:l.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>r(null)})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("span",{children:"Put up an attractive image"}),t.jsxRuntimeExports.jsx("div",{children:"Choose Image"})]})]})},vt=x=>{const{isActiveItems:n,setIsActiveItems:r,items:e,setItems:a,isProductStats:o,setIsProductStats:c,title:m,subtitle:g,editable:d=!0,draggable:s=!1,withImage:p=!0}=x,[v,b]=h.useState(null),[y,R]=h.useState({top:0,left:0});h.useEffect(()=>{const i=()=>{b(null)};return document.body.addEventListener("click",i),b(null),()=>{b(null),document.body.removeEventListener("click",i)}},[]);const I=(i,_)=>{i.stopPropagation();const k=i.target.getBoundingClientRect(),B=100,C=window.innerHeight;let w=k.top+window.scrollY;w+B>C&&(w=C-B-20),R({top:w-80,left:k.left-30}),b(_)};return t.jsxRuntimeExports.jsxs("div",{className:l.productsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:l.top,children:[m&&t.jsxRuntimeExports.jsx("h3",{className:l.title,children:m}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:i=>r(_=>i)})]}),v&&d&&t.jsxRuntimeExports.jsx(bt,{activeItem:v,setActiveItem:b,popupPosition:y}),t.jsxRuntimeExports.jsxs("div",{className:l.products,children:[g&&t.jsxRuntimeExports.jsx("h5",{className:l.subtitle,children:g}),e.map(i=>t.jsxRuntimeExports.jsxs("div",{className:l.product,children:[s&&t.jsxRuntimeExports.jsx(t.Icon,{name:"drag",hoverable:!0,width:20,height:20}),t.jsxRuntimeExports.jsxs("div",{className:l.info,children:[p&&t.jsxRuntimeExports.jsx("div",{className:l.image,children:i.image?t.jsxRuntimeExports.jsx("img",{src:i.image}):t.jsxRuntimeExports.jsx(t.Icon,{name:"image",width:16,height:16,fill:"#757575"})}),t.jsxRuntimeExports.jsx("span",{className:l.name,children:i.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"arrow-down"})]}),t.jsxRuntimeExports.jsxs("div",{className:l.buttons,children:[d&&t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:_=>{I(_,i)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>a(_=>_.filter(k=>k.id!==i.id)),width:20,height:20,fill:"#C12A2A"})]})]},i.id)),t.jsxRuntimeExports.jsxs(t.Button,{className:l.button,size:"s",onClick:()=>a(i=>{const _=[...i];return _.push({name:"Product 1",id:t.v4()}),_}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]}),o!==void 0&&t.jsxRuntimeExports.jsxs("div",{className:l.other,children:[t.jsxRuntimeExports.jsx("h5",{className:l.subtitle,children:"Other"}),t.jsxRuntimeExports.jsx(t.Switch,{current:o,onChange:i=>c==null?void 0:c(_=>i),label:"Product Stats",hasBackground:!0,paddingless:!1})]})]})},Rt="_subtitle_1y5sw_1",Et="_header_1y5sw_8",yt="_text_1y5sw_9",kt="_productsBlock_1y5sw_10",wt="_buttonsBlock_1y5sw_11",Nt="_top_1y5sw_22",ft="_itemsBlock_1y5sw_29",Bt="_typeTexts_1y5sw_35",Ct="_block_1y5sw_41",It="_active_1y5sw_52",Tt="_products_1y5sw_10",$t="_product_1y5sw_10",St="_button_1y5sw_11",Pt="_image_1y5sw_80",At="_info_1y5sw_87",Lt="_name_1y5sw_98",zt="_buttons_1y5sw_11",Ot="_modal_1y5sw_108",Ht="_other_1y5sw_125",Mt="_options_1y5sw_131",u={subtitle:Rt,header:Et,text:yt,productsBlock:kt,buttonsBlock:wt,top:Nt,itemsBlock:ft,typeTexts:Bt,block:Ct,active:It,products:Tt,product:$t,button:St,image:Pt,info:At,name:Lt,buttons:zt,modal:Ot,other:Ht,options:Mt},Ft=x=>{const{activeButton:n,setActiveButton:r,popupPosition:e}=x,[a,o]=h.useState(n.typeText),[c,m]=h.useState(n.destination),[g,d]=h.useState(n.link||"");return t.jsxRuntimeExports.jsxs("div",{className:u.modal,onClick:s=>{s.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:u.top,children:[t.jsxRuntimeExports.jsx("h3",{children:n.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>r(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:u.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:s=>m(s),options:["Go to Page","Open Link"],value:c}),c==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:s=>d(s),value:g,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:()=>{},value:"Lorem ipsum dolor sit amet com",label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(f,{typeText:a,setTypeText:o})]})]})},Gt=x=>{const{isActiveButtons:n,setIsActiveButtons:r,buttons:e,setButtons:a}=x,[o,c]=h.useState(null),[m,g]=h.useState({top:0,left:0});h.useEffect(()=>{const s=()=>{c(null)};return document.body.addEventListener("click",s),c(null),()=>{c(null),document.body.removeEventListener("click",s)}},[]);const d=(s,p)=>{s.stopPropagation();const v=s.target.getBoundingClientRect(),b=490,y=window.innerHeight;let R=v.top+window.scrollY;R+b>y&&(R=y-b-20),g({top:R,left:v.left-30}),c(p)};return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:u.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:u.top,children:[t.jsxRuntimeExports.jsx("h3",{className:u.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:n,onChange:s=>r(p=>s)})]}),t.jsxRuntimeExports.jsxs("div",{className:u.products,children:[t.jsxRuntimeExports.jsx("h5",{className:u.subtitle,children:"Button Type"}),e.map(s=>t.jsxRuntimeExports.jsxs("div",{className:u.product,children:[t.jsxRuntimeExports.jsxs("div",{className:u.info,children:[t.jsxRuntimeExports.jsx("span",{className:u.name,children:s.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"arrow-down"})]}),t.jsxRuntimeExports.jsxs("div",{className:u.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:p=>{d(p,s)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>a(p=>p.filter(v=>v.id!==s.id)),width:20,height:20,fill:"#C12A2A"})]})]},s.id)),o&&t.jsxRuntimeExports.jsx(Ft,{activeButton:o,setActiveButton:c,popupPosition:m}),t.jsxRuntimeExports.jsxs(t.Button,{className:u.button,size:"s",onClick:()=>a(s=>{const p=[...s];return p.push({type:"Primary",id:t.v4(),typeText:"bold",destination:"Go to Page"}),p}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]})]})})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.ButtonsSettings=Gt;exports.ItemsSettings=vt;exports.LayoutSettings=D;exports.TextSettings=tt;exports.TypeTexts=f;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DSUcxVxJ.cjs"),g=require("react"),z="_wrapper_o1bnv_2",O="_alignmentBlock_o1bnv_8",H="_title_o1bnv_16",M="_subtitle_o1bnv_23",F="_alignmentContent_o1bnv_30",G="_alignments_o1bnv_37",q="_alignment_o1bnv_8",D="_circle_o1bnv_56",Y="_paddings_o1bnv_63",J="_padding_o1bnv_63",K="_input_o1bnv_81",_={wrapper:z,alignmentBlock:O,title:H,subtitle:M,alignmentContent:F,alignments:G,alignment:q,circle:D,paddings:Y,padding:J,input:K},Q=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],U=["left","top","right","bottom"],V=u=>{const{alignment:i,padding:a,setPadding:e,setAlignment:n}=u;return t.jsxRuntimeExports.jsxs("div",{className:_.layout,children:[t.jsxRuntimeExports.jsx("h3",{className:_.title,children:"Layout"}),t.jsxRuntimeExports.jsxs("div",{className:_.alignmentBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:_.subtitle,children:"Alignment"}),t.jsxRuntimeExports.jsxs("div",{className:_.alignmentContent,children:[t.jsxRuntimeExports.jsx("div",{className:_.alignments,children:Q.map(c=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(p=>c)},className:_.alignment,children:[c!==i&&t.jsxRuntimeExports.jsx("div",{className:_.circle}),c===i&&t.jsxRuntimeExports.jsx(t.Icon,{name:"text-align-left",fill:"#FF3F19"})]},c))}),t.jsxRuntimeExports.jsx("div",{className:_.paddings,children:U.map(c=>t.jsxRuntimeExports.jsxs("label",{className:_.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:`align-${c}`,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(a[c]),onChange:p=>e(d=>({...d,[c]:Number(p)})),paddingless:!0})]}))})]})]})]})},W="_subtitle_2zbxx_1",X="_header_2zbxx_8",Z="_text_2zbxx_9",tt="_top_2zbxx_16",st="_itemsBlock_2zbxx_23",k={subtitle:W,header:X,text:Z,top:tt,itemsBlock:st},et="_typeTexts_3zlec_1",nt="_block_3zlec_7",ot="_active_3zlec_18",B={typeTexts:et,block:nt,active:ot},it=["bold","italic","underline","strike-through","code"],I=u=>{const{typeText:i,setTypeText:a}=u;return t.jsxRuntimeExports.jsx("div",{className:B.typeTexts,children:it.map(e=>t.jsxRuntimeExports.jsx("div",{className:t.clx(B.block,{[B.active]:i===e}),onClick:()=>a(n=>e),children:t.jsxRuntimeExports.jsx(t.Icon,{name:`text-${e}`,fill:i===e?"#252525":"#757575",width:20,height:20})},String(e)))})},ct=u=>{const{typeText:i,isActiveText:a,setIsActiveText:e,text:n,setText:c,setTypeText:p,title:d,subtitle:o="Items"}=u;return t.jsxRuntimeExports.jsxs("div",{className:k.text,children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsx("h3",{className:k.title,children:d}),t.jsxRuntimeExports.jsx(t.Switch,{current:a,onChange:l=>e(r=>l)})]}),t.jsxRuntimeExports.jsxs("div",{className:k.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:k.subtitle,children:o}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:l=>c(r=>l),value:n,maxLength:150}),t.jsxRuntimeExports.jsx(I,{typeText:i,setTypeText:p})]})]})},lt="_subtitle_2l7ty_1",at="_header_2l7ty_8",rt="_text_2l7ty_9",xt="_productsBlock_2l7ty_10",ut="_top_2l7ty_22",pt="_itemsBlock_2l7ty_29",mt="_typeTexts_2l7ty_35",dt="_block_2l7ty_41",_t="_active_2l7ty_52",ht="_products_2l7ty_10",jt="_product_2l7ty_10",gt="_button_2l7ty_70",bt="_image_2l7ty_80",yt="_info_2l7ty_87",vt="_name_2l7ty_98",Rt="_buttons_2l7ty_102",Et="_modal_2l7ty_108",kt="_other_2l7ty_125",m={subtitle:lt,header:at,text:rt,productsBlock:xt,top:ut,itemsBlock:pt,typeTexts:mt,block:dt,active:_t,products:ht,product:jt,button:gt,image:bt,info:yt,name:vt,buttons:Rt,modal:Et,other:kt},wt=u=>{const{activeItem:i,setActiveItem:a,popupPosition:e}=u;return t.jsxRuntimeExports.jsxs("div",{className:m.modal,onClick:n=>{n.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:m.top,children:[t.jsxRuntimeExports.jsx("h3",{children:i.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>a(null)})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("span",{children:"Put up an attractive image"}),t.jsxRuntimeExports.jsx("div",{children:"Choose Image"})]})]})},ft=u=>{const{isActiveItems:i,setIsActiveItems:a,items:e,setItems:n,isProductStats:c,setIsProductStats:p,title:d,subtitle:o,editable:l=!0,draggable:r=!1,withImage:R=!0,itemsType:h,itemsPlaceholder:b="",itemsOptions:T}=u,[C,E]=g.useState(null),[S,P]=g.useState({top:0,left:0});g.useEffect(()=>{const s=()=>{E(null)};return document.body.addEventListener("click",s),E(null),()=>{E(null),document.body.removeEventListener("click",s)}},[]);const A=(s,x)=>{s.stopPropagation();const y=s.target.getBoundingClientRect(),f=100,$=window.innerHeight;let j=y.top+window.scrollY;j+f>$&&(j=$-f-20),P({top:j-80,left:y.left-30}),E(x)};function L(s){if(R&&!s)return t.jsxRuntimeExports.jsx(t.Icon,{name:"image",width:16,height:16,fill:"#757575"})}return t.jsxRuntimeExports.jsxs("div",{className:m.productsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:m.top,children:[d&&t.jsxRuntimeExports.jsx("h3",{className:m.title,children:d}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:s=>a(x=>s)})]}),C&&l&&t.jsxRuntimeExports.jsx(wt,{activeItem:C,setActiveItem:E,popupPosition:S}),t.jsxRuntimeExports.jsxs("div",{className:m.products,children:[o&&t.jsxRuntimeExports.jsx("h5",{className:m.subtitle,children:o}),e.map(s=>t.jsxRuntimeExports.jsxs("div",{className:m.product,children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"drag",hoverable:!0,width:20,height:20})}),h==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:x=>{n(y=>[...y].map(j=>j.id===s.id?{...s,name:x}:j))},value:s.name,options:T,leftAddon:L(s.image)}),h==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:x=>{n(y=>[...y].map(j=>j.id===s.id?{...s,name:x}:j))},value:s.name,placeholder:b}),h==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{}),t.jsxRuntimeExports.jsxs("div",{className:m.buttons,children:[l&&t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:x=>{A(x,s)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>n(x=>x.filter(y=>y.id!==s.id)),width:20,height:20,fill:"#C12A2A"})]})]},s.id)),t.jsxRuntimeExports.jsxs(t.Button,{className:m.button,size:"s",onClick:()=>n(s=>{const x=[...s];return h==="select"?x.push({name:T[0]||"",id:t.v4()}):h==="input"?x.push({name:"",id:t.v4()}):x.push({id:t.v4()}),x}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]}),c!==void 0&&t.jsxRuntimeExports.jsxs("div",{className:m.other,children:[t.jsxRuntimeExports.jsx("h5",{className:m.subtitle,children:"Other"}),t.jsxRuntimeExports.jsx(t.Switch,{current:c,onChange:s=>p==null?void 0:p(x=>s),label:"Product Stats",hasBackground:!0,paddingless:!1})]})]})},$t="_subtitle_1y5sw_1",Bt="_header_1y5sw_8",It="_text_1y5sw_9",Tt="_productsBlock_1y5sw_10",Ct="_buttonsBlock_1y5sw_11",Nt="_top_1y5sw_22",St="_itemsBlock_1y5sw_29",Pt="_typeTexts_1y5sw_35",At="_block_1y5sw_41",Lt="_active_1y5sw_52",zt="_products_1y5sw_10",Ot="_product_1y5sw_10",Ht="_button_1y5sw_11",Mt="_image_1y5sw_80",Ft="_info_1y5sw_87",Gt="_name_1y5sw_98",qt="_buttons_1y5sw_11",Dt="_modal_1y5sw_108",Yt="_other_1y5sw_125",Jt="_options_1y5sw_131",v={subtitle:$t,header:Bt,text:It,productsBlock:Tt,buttonsBlock:Ct,top:Nt,itemsBlock:St,typeTexts:Pt,block:At,active:Lt,products:zt,product:Ot,button:Ht,image:Mt,info:Ft,name:Gt,buttons:qt,modal:Dt,other:Yt,options:Jt},Kt=u=>{const{activeButton:i,setActiveButton:a,popupPosition:e}=u,[n,c]=g.useState(i.typeText),[p,d]=g.useState(i.destination),[o,l]=g.useState(i.link||"");return t.jsxRuntimeExports.jsxs("div",{className:v.modal,onClick:r=>{r.stopPropagation()},style:{top:`${e.top}px`,left:`${e.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:v.top,children:[t.jsxRuntimeExports.jsx("h3",{children:i.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>a(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:v.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:r=>d(r),options:["Go to Page","Open Link"],value:p}),p==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:r=>l(r),value:o,placeholder:"https://",label:"Link"}),t.jsxRuntimeExports.jsx(t.Switch,{current:!1,label:"Open in new tab"}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:()=>{},value:"Lorem ipsum dolor sit amet com",label:"Text",maxLength:150}),t.jsxRuntimeExports.jsx(I,{typeText:n,setTypeText:c})]})]})},Qt="_subtitle_1y5sw_1",Ut="_header_1y5sw_8",Vt="_text_1y5sw_9",Wt="_productsBlock_1y5sw_10",Xt="_buttonsBlock_1y5sw_11",Zt="_top_1y5sw_22",ts="_itemsBlock_1y5sw_29",ss="_typeTexts_1y5sw_35",es="_block_1y5sw_41",ns="_active_1y5sw_52",os="_products_1y5sw_10",is="_product_1y5sw_10",cs="_button_1y5sw_11",ls="_image_1y5sw_80",as="_info_1y5sw_87",rs="_name_1y5sw_98",xs="_buttons_1y5sw_11",us="_modal_1y5sw_108",ps="_other_1y5sw_125",ms="_options_1y5sw_131",w={subtitle:Qt,header:Ut,text:Vt,productsBlock:Wt,buttonsBlock:Xt,top:Zt,itemsBlock:ts,typeTexts:ss,block:es,active:ns,products:os,product:is,button:cs,image:ls,info:as,name:rs,buttons:xs,modal:us,other:ps,options:ms},N=u=>{const{buttons:i,setButtons:a}=u,[e,n]=g.useState(null),[c,p]=g.useState({top:0,left:0});g.useEffect(()=>{const o=()=>{n(null)};return document.body.addEventListener("click",o),n(null),()=>{n(null),document.body.removeEventListener("click",o)}},[]);const d=(o,l)=>{o.stopPropagation();const r=o.target.getBoundingClientRect(),R=490,h=window.innerHeight;let b=r.top+window.scrollY;b+R>h&&(b=h-R-20),p({top:b,left:r.left-30}),n(l)};return t.jsxRuntimeExports.jsxs("div",{className:w.products,children:[t.jsxRuntimeExports.jsx("h5",{className:w.subtitle,children:"Button Type"}),i.map(o=>t.jsxRuntimeExports.jsxs("div",{className:w.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:l=>{a(r=>[...r].map(b=>b.id===o.id?{...o,type:l}:b))},value:o.type,options:["Primary","Secondary"]}),t.jsxRuntimeExports.jsxs("div",{className:w.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:l=>{d(l,o)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>a(l=>l.filter(r=>r.id!==o.id)),width:20,height:20,fill:"#C12A2A"})]})]},o.id)),e&&t.jsxRuntimeExports.jsx(Kt,{activeButton:e,setActiveButton:n,popupPosition:c}),t.jsxRuntimeExports.jsxs(t.Button,{className:w.button,size:"s",onClick:()=>a(o=>{const l=[...o];return l.push({type:"Primary",id:t.v4(),typeText:"bold",destination:"Go to Page"}),l}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]})},ds=u=>{const{isActiveButtons:i,setIsActiveButtons:a,buttons:e,setButtons:n}=u;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:v.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:v.top,children:[t.jsxRuntimeExports.jsx("h3",{className:v.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:i,onChange:c=>a(p=>c)})]}),t.jsxRuntimeExports.jsx(N,{buttons:e,setButtons:n})]})})};exports.Button=t.Button;exports.Checkbox=t.Checkbox;exports.ChooseImage=t.ChooseImage;exports.ChooseImageModal=t.ChooseImageModal;exports.ColorPicker=t.ColorPicker;exports.Icon=t.Icon;exports.Input=t.Input;exports.Modal=t.Modal;exports.Picker=t.Picker;exports.Radio=t.Radio;exports.Select=t.Select;exports.Submodal=t.Submodal;exports.Switch=t.Switch;exports.Textarea=t.Textarea;exports.Tip=t.Tip;exports.ButtonTypeSettings=N;exports.ButtonsSettings=ds;exports.ItemsSettings=ft;exports.LayoutSettings=V;exports.TextSettings=ct;exports.TypeTexts=I;
|