@billgangcom/theme-lib 1.6.0 → 1.7.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.
@@ -11,6 +11,7 @@ interface Props {
11
11
  required?: boolean;
12
12
  regex?: string;
13
13
  paddingless?: boolean;
14
+ borderless?: boolean;
14
15
  editable?: boolean;
15
16
  }
16
17
  export declare const Input: React.FC<Props>;
@@ -0,0 +1,5 @@
1
+ import * as C from "react";
2
+ const t = (e) => /* @__PURE__ */ C.createElement("svg", { width: 22, height: 22, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e }, /* @__PURE__ */ C.createElement("path", { d: "M2.75 5.5C2.75 5.31766 2.82243 5.1428 2.95136 5.01386C3.0803 4.88493 3.25516 4.8125 3.4375 4.8125H18.5625C18.7448 4.8125 18.9197 4.88493 19.0486 5.01386C19.1776 5.1428 19.25 5.31766 19.25 5.5C19.25 5.68234 19.1776 5.8572 19.0486 5.98614C18.9197 6.11507 18.7448 6.1875 18.5625 6.1875H3.4375C3.25516 6.1875 3.0803 6.11507 2.95136 5.98614C2.82243 5.8572 2.75 5.68234 2.75 5.5ZM5.5 8.25C5.31766 8.25 5.1428 8.32243 5.01386 8.45136C4.88493 8.5803 4.8125 8.75516 4.8125 8.9375C4.8125 9.11984 4.88493 9.2947 5.01386 9.42364C5.1428 9.55257 5.31766 9.625 5.5 9.625H16.5C16.6823 9.625 16.8572 9.55257 16.9861 9.42364C17.1151 9.2947 17.1875 9.11984 17.1875 8.9375C17.1875 8.75516 17.1151 8.5803 16.9861 8.45136C16.8572 8.32243 16.6823 8.25 16.5 8.25H5.5ZM18.5625 11.6875H3.4375C3.25516 11.6875 3.0803 11.7599 2.95136 11.8889C2.82243 12.0178 2.75 12.1927 2.75 12.375C2.75 12.5573 2.82243 12.7322 2.95136 12.8611C3.0803 12.9901 3.25516 13.0625 3.4375 13.0625H18.5625C18.7448 13.0625 18.9197 12.9901 19.0486 12.8611C19.1776 12.7322 19.25 12.5573 19.25 12.375C19.25 12.1927 19.1776 12.0178 19.0486 11.8889C18.9197 11.7599 18.7448 11.6875 18.5625 11.6875ZM16.5 15.125H5.5C5.31766 15.125 5.1428 15.1974 5.01386 15.3264C4.88493 15.4553 4.8125 15.6302 4.8125 15.8125C4.8125 15.9948 4.88493 16.1697 5.01386 16.2986C5.1428 16.4276 5.31766 16.5 5.5 16.5H16.5C16.6823 16.5 16.8572 16.4276 16.9861 16.2986C17.1151 16.1697 17.1875 15.9948 17.1875 15.8125C17.1875 15.6302 17.1151 15.4553 16.9861 15.3264C16.8572 15.1974 16.6823 15.125 16.5 15.125Z", fill: "#FF3F19" }));
3
+ export {
4
+ t as default
5
+ };
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");function c(e){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(C,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return C.default=e,Object.freeze(C)}const r=c(o),l=e=>r.createElement("svg",{width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M2.75 5.5C2.75 5.31766 2.82243 5.1428 2.95136 5.01386C3.0803 4.88493 3.25516 4.8125 3.4375 4.8125H18.5625C18.7448 4.8125 18.9197 4.88493 19.0486 5.01386C19.1776 5.1428 19.25 5.31766 19.25 5.5C19.25 5.68234 19.1776 5.8572 19.0486 5.98614C18.9197 6.11507 18.7448 6.1875 18.5625 6.1875H3.4375C3.25516 6.1875 3.0803 6.11507 2.95136 5.98614C2.82243 5.8572 2.75 5.68234 2.75 5.5ZM5.5 8.25C5.31766 8.25 5.1428 8.32243 5.01386 8.45136C4.88493 8.5803 4.8125 8.75516 4.8125 8.9375C4.8125 9.11984 4.88493 9.2947 5.01386 9.42364C5.1428 9.55257 5.31766 9.625 5.5 9.625H16.5C16.6823 9.625 16.8572 9.55257 16.9861 9.42364C17.1151 9.2947 17.1875 9.11984 17.1875 8.9375C17.1875 8.75516 17.1151 8.5803 16.9861 8.45136C16.8572 8.32243 16.6823 8.25 16.5 8.25H5.5ZM18.5625 11.6875H3.4375C3.25516 11.6875 3.0803 11.7599 2.95136 11.8889C2.82243 12.0178 2.75 12.1927 2.75 12.375C2.75 12.5573 2.82243 12.7322 2.95136 12.8611C3.0803 12.9901 3.25516 13.0625 3.4375 13.0625H18.5625C18.7448 13.0625 18.9197 12.9901 19.0486 12.8611C19.1776 12.7322 19.25 12.5573 19.25 12.375C19.25 12.1927 19.1776 12.0178 19.0486 11.8889C18.9197 11.7599 18.7448 11.6875 18.5625 11.6875ZM16.5 15.125H5.5C5.31766 15.125 5.1428 15.1974 5.01386 15.3264C4.88493 15.4553 4.8125 15.6302 4.8125 15.8125C4.8125 15.9948 4.88493 16.1697 5.01386 16.2986C5.1428 16.4276 5.31766 16.5 5.5 16.5H16.5C16.6823 16.5 16.8572 16.4276 16.9861 16.2986C17.1151 16.1697 17.1875 15.9948 17.1875 15.8125C17.1875 15.6302 17.1151 15.4553 16.9861 15.3264C16.8572 15.1974 16.6823 15.125 16.5 15.125Z",fill:"#FF3F19"}));exports.default=l;
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("react");function c(e){const C=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(C,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return C.default=e,Object.freeze(C)}const r=c(o),l=e=>r.createElement("svg",{width:22,height:22,viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e},r.createElement("path",{d:"M2.75 5.5C2.75 5.31766 2.82243 5.1428 2.95136 5.01386C3.0803 4.88493 3.25516 4.8125 3.4375 4.8125H18.5625C18.7448 4.8125 18.9197 4.88493 19.0486 5.01386C19.1776 5.1428 19.25 5.31766 19.25 5.5C19.25 5.68234 19.1776 5.8572 19.0486 5.98614C18.9197 6.11507 18.7448 6.1875 18.5625 6.1875H3.4375C3.25516 6.1875 3.0803 6.11507 2.95136 5.98614C2.82243 5.8572 2.75 5.68234 2.75 5.5ZM18.5625 8.25H7.5625C7.38016 8.25 7.2053 8.32243 7.07636 8.45136C6.94743 8.5803 6.875 8.75516 6.875 8.9375C6.875 9.11984 6.94743 9.2947 7.07636 9.42364C7.2053 9.55257 7.38016 9.625 7.5625 9.625H18.5625C18.7448 9.625 18.9197 9.55257 19.0486 9.42364C19.1776 9.2947 19.25 9.11984 19.25 8.9375C19.25 8.75516 19.1776 8.5803 19.0486 8.45136C18.9197 8.32243 18.7448 8.25 18.5625 8.25ZM18.5625 11.6875H3.4375C3.25516 11.6875 3.0803 11.7599 2.95136 11.8889C2.82243 12.0178 2.75 12.1927 2.75 12.375C2.75 12.5573 2.82243 12.7322 2.95136 12.8611C3.0803 12.9901 3.25516 13.0625 3.4375 13.0625H18.5625C18.7448 13.0625 18.9197 12.9901 19.0486 12.8611C19.1776 12.7322 19.25 12.5573 19.25 12.375C19.25 12.1927 19.1776 12.0178 19.0486 11.8889C18.9197 11.7599 18.7448 11.6875 18.5625 11.6875ZM18.5625 15.125H7.5625C7.38016 15.125 7.2053 15.1974 7.07636 15.3264C6.94743 15.4553 6.875 15.6302 6.875 15.8125C6.875 15.9948 6.94743 16.1697 7.07636 16.2986C7.2053 16.4276 7.38016 16.5 7.5625 16.5H18.5625C18.7448 16.5 18.9197 16.4276 19.0486 16.2986C19.1776 16.1697 19.25 15.9948 19.25 15.8125C19.25 15.6302 19.1776 15.4553 19.0486 15.3264C18.9197 15.1974 18.7448 15.125 18.5625 15.125Z",fill:"#FF3F19"}));exports.default=l;
@@ -0,0 +1,5 @@
1
+ import * as C from "react";
2
+ const e = (t) => /* @__PURE__ */ C.createElement("svg", { width: 22, height: 22, viewBox: "0 0 22 22", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...t }, /* @__PURE__ */ C.createElement("path", { d: "M2.75 5.5C2.75 5.31766 2.82243 5.1428 2.95136 5.01386C3.0803 4.88493 3.25516 4.8125 3.4375 4.8125H18.5625C18.7448 4.8125 18.9197 4.88493 19.0486 5.01386C19.1776 5.1428 19.25 5.31766 19.25 5.5C19.25 5.68234 19.1776 5.8572 19.0486 5.98614C18.9197 6.11507 18.7448 6.1875 18.5625 6.1875H3.4375C3.25516 6.1875 3.0803 6.11507 2.95136 5.98614C2.82243 5.8572 2.75 5.68234 2.75 5.5ZM18.5625 8.25H7.5625C7.38016 8.25 7.2053 8.32243 7.07636 8.45136C6.94743 8.5803 6.875 8.75516 6.875 8.9375C6.875 9.11984 6.94743 9.2947 7.07636 9.42364C7.2053 9.55257 7.38016 9.625 7.5625 9.625H18.5625C18.7448 9.625 18.9197 9.55257 19.0486 9.42364C19.1776 9.2947 19.25 9.11984 19.25 8.9375C19.25 8.75516 19.1776 8.5803 19.0486 8.45136C18.9197 8.32243 18.7448 8.25 18.5625 8.25ZM18.5625 11.6875H3.4375C3.25516 11.6875 3.0803 11.7599 2.95136 11.8889C2.82243 12.0178 2.75 12.1927 2.75 12.375C2.75 12.5573 2.82243 12.7322 2.95136 12.8611C3.0803 12.9901 3.25516 13.0625 3.4375 13.0625H18.5625C18.7448 13.0625 18.9197 12.9901 19.0486 12.8611C19.1776 12.7322 19.25 12.5573 19.25 12.375C19.25 12.1927 19.1776 12.0178 19.0486 11.8889C18.9197 11.7599 18.7448 11.6875 18.5625 11.6875ZM18.5625 15.125H7.5625C7.38016 15.125 7.2053 15.1974 7.07636 15.3264C6.94743 15.4553 6.875 15.6302 6.875 15.8125C6.875 15.9948 6.94743 16.1697 7.07636 16.2986C7.2053 16.4276 7.38016 16.5 7.5625 16.5H18.5625C18.7448 16.5 18.9197 16.4276 19.0486 16.2986C19.1776 16.1697 19.25 15.9948 19.25 15.8125C19.25 15.6302 19.1776 15.4553 19.0486 15.3264C18.9197 15.1974 18.7448 15.125 18.5625 15.125Z", fill: "#FF3F19" }));
3
+ export {
4
+ e as default
5
+ };
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
  import { TextType } from '../TypeTexts';
3
- export type TypeButton = 'Primary' | 'Secondary';
3
+ export type TypeButton = 'Primary' | 'Secondary' | 'Tertiary';
4
4
  export type Destination = 'Open Link' | 'Go to Page';
5
5
  export interface ButtonType {
6
6
  image?: string;
@@ -9,17 +9,22 @@ export interface Product extends ItemBase {
9
9
  export interface Pages extends ItemBase {
10
10
  }
11
11
  interface CommomPropsBase<T extends ItemBase> {
12
- isActiveItems: boolean;
13
- setIsActiveItems: React.Dispatch<React.SetStateAction<boolean>>;
12
+ isActiveItems?: boolean;
13
+ setIsActiveItems?: React.Dispatch<React.SetStateAction<boolean>>;
14
14
  items: T[];
15
15
  setItems: React.Dispatch<React.SetStateAction<T[]>>;
16
- isProductStats?: boolean;
17
- setIsProductStats?: React.Dispatch<React.SetStateAction<boolean>>;
18
16
  title?: string;
19
17
  subtitle?: string;
20
18
  editable?: boolean;
21
19
  draggable?: boolean;
22
20
  withImage?: boolean;
21
+ deletable?: boolean;
22
+ addable?: boolean;
23
+ other?: {
24
+ isItem: boolean;
25
+ setIsItem: React.Dispatch<React.SetStateAction<boolean>>;
26
+ label?: string;
27
+ };
23
28
  }
24
29
  interface SelectProps<T extends ItemBase> extends CommomPropsBase<T> {
25
30
  itemsType: 'select';
@@ -0,0 +1,8 @@
1
+ interface Props {
2
+ title?: string;
3
+ isItem: boolean;
4
+ setIsItem: React.Dispatch<React.SetStateAction<boolean>>;
5
+ label?: string;
6
+ }
7
+ export declare const OtherSettings: React.FC<Props>;
8
+ export {};
package/dist/ui.cjs.js CHANGED
@@ -1 +1 @@
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;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DPhpcpnj.cjs"),g=require("react"),H="_wrapper_1g82c_2",M="_alignmentBlock_1g82c_8",q="_title_1g82c_15",F="_subtitle_1g82c_22",G="_alignmentContent_1g82c_29",D="_alignments_1g82c_35",Y="_alignment_1g82c_8",J="_circle_1g82c_54",K="_paddings_1g82c_61",Q="_padding_1g82c_61",U="_input_1g82c_79",_={wrapper:H,alignmentBlock:M,title:q,subtitle:F,alignmentContent:G,alignments:D,alignment:Y,circle:J,paddings:K,padding:Q,input:U},V=["topLeft","top","topRight","left","center","right","bottomLeft","bottom","bottomRight"],W=["left","top","right","bottom"],X=a=>{const{alignment:e,padding:c,setPadding:s,setAlignment:n}=a;function p(){switch(e){case"left":case"topLeft":case"bottomLeft":return"left";case"right":case"topRight":case"bottomRight":return"right";case"center":case"top":case"bottom":return"center";default:return"center"}}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:V.map(l=>t.jsxRuntimeExports.jsxs("div",{onClick:()=>{n(d=>l)},className:_.alignment,children:[l!==e&&t.jsxRuntimeExports.jsx("div",{className:_.circle}),l===e&&t.jsxRuntimeExports.jsx(t.Icon,{name:`text-align-${p()}`,fill:"#FF3F19",width:22,height:22})]},l))}),t.jsxRuntimeExports.jsx("div",{className:_.paddings,children:W.map(l=>t.jsxRuntimeExports.jsxs("label",{className:_.padding,children:[t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:`align-${l}`,width:20,height:20})}),t.jsxRuntimeExports.jsx(t.Input,{type:"text",value:String(c[l]),onChange:d=>s(o=>({...o,[l]:Number(d)})),paddingless:!0,borderless:!0})]}))})]})]})]})},Z="_subtitle_2zbxx_1",tt="_header_2zbxx_8",et="_text_2zbxx_9",st="_top_2zbxx_16",nt="_itemsBlock_2zbxx_23",v={subtitle:Z,header:tt,text:et,top:st,itemsBlock:nt},ot="_typeTexts_3zlec_1",it="_block_3zlec_7",ct="_active_3zlec_18",B={typeTexts:ot,block:it,active:ct},lt=["bold","italic","underline","strike-through","code"],I=a=>{const{typeText:e,setTypeText:c}=a;return t.jsxRuntimeExports.jsx("div",{className:B.typeTexts,children:lt.map(s=>t.jsxRuntimeExports.jsx("div",{className:t.clx(B.block,{[B.active]:e===s}),onClick:()=>c(n=>s),children:t.jsxRuntimeExports.jsx(t.Icon,{name:`text-${s}`,fill:e===s?"#252525":"#757575",width:20,height:20})},String(s)))})},rt=a=>{const{typeText:e,isActiveText:c,setIsActiveText:s,text:n,setText:p,setTypeText:l,title:d,subtitle:o="Items"}=a;return t.jsxRuntimeExports.jsxs("div",{className:v.text,children:[t.jsxRuntimeExports.jsxs("div",{className:v.top,children:[t.jsxRuntimeExports.jsx("h3",{className:v.title,children:d}),t.jsxRuntimeExports.jsx(t.Switch,{current:c,onChange:r=>s(x=>r)})]}),t.jsxRuntimeExports.jsxs("div",{className:v.itemsBlock,children:[t.jsxRuntimeExports.jsx("h5",{className:v.subtitle,children:o}),t.jsxRuntimeExports.jsx(t.Textarea,{onChange:r=>p(x=>r),value:n,maxLength:150}),t.jsxRuntimeExports.jsx(I,{typeText:e,setTypeText:l})]})]})},at="_subtitle_fsotk_1",xt="_header_fsotk_8",ut="_text_fsotk_9",pt="_productsBlock_fsotk_10",mt="_top_fsotk_22",dt="_itemsBlock_fsotk_29",_t="_typeTexts_fsotk_35",ht="_block_fsotk_41",jt="_active_fsotk_52",gt="_products_fsotk_10",bt="_product_fsotk_10",kt="_button_fsotk_70",Rt="_image_fsotk_80",Et="_info_fsotk_87",ft="_name_fsotk_98",vt="_buttons_fsotk_102",yt="_modal_fsotk_108",h={subtitle:at,header:xt,text:ut,productsBlock:pt,top:mt,itemsBlock:dt,typeTexts:_t,block:ht,active:jt,products:gt,product:bt,button:kt,image:Rt,info:Et,name:ft,buttons:vt,modal:yt},$t=a=>{const{activeItem:e,setActiveItem:c,popupPosition:s}=a;return t.jsxRuntimeExports.jsxs("div",{className:h.modal,onClick:n=>{n.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:h.top,children:[t.jsxRuntimeExports.jsx("h3",{children:e.name}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>c(null)})]}),t.jsxRuntimeExports.jsxs("div",{children:[t.jsxRuntimeExports.jsx("span",{children:"Put up an attractive image"}),t.jsxRuntimeExports.jsx("div",{children:"Choose Image"})]})]})},wt="_other_jqtww_1",Bt="_subtitle_jqtww_7",N={other:wt,subtitle:Bt},It=a=>{const{isItem:e,setIsItem:c,title:s="Other",label:n}=a;return t.jsxRuntimeExports.jsxs("div",{className:N.other,children:[t.jsxRuntimeExports.jsx("h5",{className:N.subtitle,children:s}),t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:p=>c(l=>p),label:n,hasBackground:!0,paddingless:!1})]})},Tt=a=>{const{isActiveItems:e,setIsActiveItems:c,items:s,setItems:n,other:p,title:l,subtitle:d,editable:o=!0,draggable:r=!1,withImage:x=!1,deletable:R=!0,addable:E=!0,itemsType:m,itemsPlaceholder:P="",itemsOptions:T}=a,[C,f]=g.useState(null),[A,L]=g.useState({top:0,left:0});g.useEffect(()=>{const i=()=>{f(null)};return document.body.addEventListener("click",i),f(null),()=>{f(null),document.body.removeEventListener("click",i)}},[]);const z=(i,u)=>{i.stopPropagation();const b=i.target.getBoundingClientRect(),$=100,w=window.innerHeight;let j=b.top+window.scrollY;j+$>w&&(j=w-$-20),L({top:j-80,left:b.left-30}),f(u)};function O(i){if(x&&!i)return t.jsxRuntimeExports.jsx(t.Icon,{name:"image",width:16,height:16,fill:"#757575"})}return t.jsxRuntimeExports.jsxs("div",{className:h.productsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:h.top,children:[l&&t.jsxRuntimeExports.jsx("h3",{className:h.title,children:l}),e&&t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:i=>c==null?void 0:c(u=>i)})]}),C&&o&&t.jsxRuntimeExports.jsx($t,{activeItem:C,setActiveItem:f,popupPosition:A}),t.jsxRuntimeExports.jsxs("div",{className:h.products,children:[d&&t.jsxRuntimeExports.jsx("h5",{className:h.subtitle,children:d}),s.map(i=>t.jsxRuntimeExports.jsxs("div",{className:h.product,children:[r&&t.jsxRuntimeExports.jsx("div",{children:t.jsxRuntimeExports.jsx(t.Icon,{name:"drag",hoverable:!0,width:20,height:20})}),m==="select"&&t.jsxRuntimeExports.jsx(t.Select,{onChange:u=>{n(b=>[...b].map(j=>j.id===i.id?{...i,name:u}:j))},value:i.name,options:T,leftAddon:O(i.image)}),m==="input"&&t.jsxRuntimeExports.jsx(t.Input,{onChange:u=>{n(b=>[...b].map(j=>j.id===i.id?{...i,name:u}:j))},value:i.name,placeholder:P}),m==="image"&&t.jsxRuntimeExports.jsx(t.ChooseImage,{}),t.jsxRuntimeExports.jsxs("div",{className:h.buttons,children:[o&&t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:u=>{z(u,i)}}),R&&t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>n(u=>u.filter(b=>b.id!==i.id)),width:20,height:20,fill:"#C12A2A"})]})]},i.id)),E&&t.jsxRuntimeExports.jsxs(t.Button,{className:h.button,size:"s",onClick:()=>n(i=>{const u=[...i];return m==="select"?u.push({name:T[0]||"",id:t.v4()}):m==="input"?u.push({name:"",id:t.v4()}):u.push({id:t.v4()}),u}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]}),p!==void 0&&t.jsxRuntimeExports.jsx(It,{...p})]})},Ct="_subtitle_41klp_1",Nt="_header_41klp_8",St="_text_41klp_9",Pt="_productsBlock_41klp_10",At="_buttonsBlock_41klp_11",Lt="_top_41klp_21",zt="_itemsBlock_41klp_28",Ot="_typeTexts_41klp_34",Ht="_block_41klp_40",Mt="_active_41klp_51",qt="_products_41klp_10",Ft="_product_41klp_10",Gt="_button_41klp_11",Dt="_image_41klp_79",Yt="_info_41klp_86",Jt="_name_41klp_97",Kt="_buttons_41klp_11",Qt="_modal_41klp_107",Ut="_other_41klp_124",Vt="_options_41klp_130",k={subtitle:Ct,header:Nt,text:St,productsBlock:Pt,buttonsBlock:At,top:Lt,itemsBlock:zt,typeTexts:Ot,block:Ht,active:Mt,products:qt,product:Ft,button:Gt,image:Dt,info:Yt,name:Jt,buttons:Kt,modal:Qt,other:Ut,options:Vt},Wt=a=>{const{activeButton:e,setActiveButton:c,popupPosition:s}=a,[n,p]=g.useState(e.typeText),[l,d]=g.useState(e.destination),[o,r]=g.useState(e.link||"");return t.jsxRuntimeExports.jsxs("div",{className:k.modal,onClick:x=>{x.stopPropagation()},style:{top:`${s.top}px`,left:`${s.left}px`},children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsx("h3",{children:e.type}),t.jsxRuntimeExports.jsx(t.Icon,{name:"x",height:20,width:20,hoverable:!0,onClick:()=>c(null)})]}),t.jsxRuntimeExports.jsxs("div",{className:k.options,children:[t.jsxRuntimeExports.jsx(t.Select,{label:"Destination",onChange:x=>d(x),options:["Go to Page","Open Link"],value:l}),l==="Go to Page"?t.jsxRuntimeExports.jsx(t.Select,{label:"Go to",onChange:()=>{},options:[],value:"Homepage"}):t.jsxRuntimeExports.jsx(t.Input,{onChange:x=>r(x),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:p})]})]})},Xt="_subtitle_1y5sw_1",Zt="_header_1y5sw_8",te="_text_1y5sw_9",ee="_productsBlock_1y5sw_10",se="_buttonsBlock_1y5sw_11",ne="_top_1y5sw_22",oe="_itemsBlock_1y5sw_29",ie="_typeTexts_1y5sw_35",ce="_block_1y5sw_41",le="_active_1y5sw_52",re="_products_1y5sw_10",ae="_product_1y5sw_10",xe="_button_1y5sw_11",ue="_image_1y5sw_80",pe="_info_1y5sw_87",me="_name_1y5sw_98",de="_buttons_1y5sw_11",_e="_modal_1y5sw_108",he="_other_1y5sw_125",je="_options_1y5sw_131",y={subtitle:Xt,header:Zt,text:te,productsBlock:ee,buttonsBlock:se,top:ne,itemsBlock:oe,typeTexts:ie,block:ce,active:le,products:re,product:ae,button:xe,image:ue,info:pe,name:me,buttons:de,modal:_e,other:he,options:je},S=a=>{const{buttons:e,setButtons:c}=a,[s,n]=g.useState(null),[p,l]=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,r)=>{o.stopPropagation();const x=o.target.getBoundingClientRect(),R=490,E=window.innerHeight;let m=x.top+window.scrollY;m+R>E&&(m=E-R-20),l({top:m,left:x.left-30}),n(r)};return t.jsxRuntimeExports.jsxs("div",{className:y.products,children:[t.jsxRuntimeExports.jsx("h5",{className:y.subtitle,children:"Button Type"}),e.map(o=>t.jsxRuntimeExports.jsxs("div",{className:y.product,children:[t.jsxRuntimeExports.jsx(t.Select,{onChange:r=>{c(x=>[...x].map(m=>m.id===o.id?{...o,type:r}:m))},value:o.type,options:["Primary","Secondary","Tertiary"]}),t.jsxRuntimeExports.jsxs("div",{className:y.buttons,children:[t.jsxRuntimeExports.jsx(t.Icon,{name:"sliders",hoverable:!0,width:20,height:20,onClick:r=>{d(r,o)}}),t.jsxRuntimeExports.jsx(t.Icon,{name:"trash",hoverable:!0,onClick:()=>c(r=>r.filter(x=>x.id!==o.id)),width:20,height:20,fill:"#C12A2A"})]})]},o.id)),s&&t.jsxRuntimeExports.jsx(Wt,{activeButton:s,setActiveButton:n,popupPosition:p}),t.jsxRuntimeExports.jsxs(t.Button,{className:y.button,size:"s",onClick:()=>c(o=>{const r=[...o];return r.push({type:"Primary",id:t.v4(),typeText:"bold",destination:"Go to Page"}),r}),children:[t.jsxRuntimeExports.jsx("span",{children:"Add Option"}),t.jsxRuntimeExports.jsx(t.Icon,{name:"plus",width:16,height:16})]})]})},ge=a=>{const{isActiveButtons:e,setIsActiveButtons:c,buttons:s,setButtons:n}=a;return t.jsxRuntimeExports.jsx(t.jsxRuntimeExports.Fragment,{children:t.jsxRuntimeExports.jsxs("div",{className:k.buttonsBlock,children:[t.jsxRuntimeExports.jsxs("div",{className:k.top,children:[t.jsxRuntimeExports.jsx("h3",{className:k.title,children:"Buttons"}),t.jsxRuntimeExports.jsx(t.Switch,{current:e,onChange:p=>c(l=>p)})]}),t.jsxRuntimeExports.jsx(S,{buttons:s,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=S;exports.ButtonsSettings=ge;exports.ItemsSettings=Tt;exports.LayoutSettings=X;exports.TextSettings=rt;exports.TypeTexts=I;