@billgangcom/theme-lib 1.5.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.
- package/dist/builder.cjs.js +3 -3
- package/dist/builder.es.js +8 -8
- package/dist/index-DPhpcpnj.cjs +39 -0
- package/dist/{index-O501BDCu.js → index-DxdTFgwx.js} +1216 -1197
- package/dist/shared/ui/Input/index.d.ts +2 -0
- package/dist/text-align-center-CBdXLnfL.js +5 -0
- package/dist/text-align-center-DSiXCwfH.cjs +1 -0
- package/dist/text-align-right-B1liYPsk.cjs +1 -0
- package/dist/text-align-right-CTznh4bt.js +5 -0
- package/dist/ui/ButtonTypeSettings/index.d.ts +8 -0
- package/dist/ui/ButtonsSettings/index.d.ts +1 -1
- package/dist/ui/ItemsSettings/index.d.ts +26 -5
- package/dist/ui/OtherSettings/index.d.ts +8 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui.cjs.js +1 -1
- package/dist/ui.es.js +445 -343
- package/package.json +1 -1
- package/dist/index-BO6B5tl0.cjs +0 -39
|
@@ -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;
|
|
@@ -8,18 +8,39 @@ export interface Product extends ItemBase {
|
|
|
8
8
|
}
|
|
9
9
|
export interface Pages extends ItemBase {
|
|
10
10
|
}
|
|
11
|
-
interface
|
|
12
|
-
isActiveItems
|
|
13
|
-
setIsActiveItems
|
|
11
|
+
interface CommomPropsBase<T extends ItemBase> {
|
|
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
|
}
|
|
29
|
+
interface SelectProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
30
|
+
itemsType: 'select';
|
|
31
|
+
itemsPlaceholder?: never;
|
|
32
|
+
itemsOptions: string[];
|
|
33
|
+
}
|
|
34
|
+
interface InputProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
35
|
+
itemsType: 'input';
|
|
36
|
+
itemsPlaceholder?: string;
|
|
37
|
+
itemsOptions?: never;
|
|
38
|
+
}
|
|
39
|
+
interface ImageProps<T extends ItemBase> extends CommomPropsBase<T> {
|
|
40
|
+
itemsType: 'image';
|
|
41
|
+
itemsPlaceholder?: never;
|
|
42
|
+
itemsOptions?: never;
|
|
43
|
+
}
|
|
44
|
+
type Props<T extends ItemBase> = SelectProps<T> | InputProps<T> | ImageProps<T>;
|
|
24
45
|
export declare const ItemsSettings: <T extends ItemBase>(props: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
25
46
|
export {};
|
package/dist/ui/index.d.ts
CHANGED
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-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;
|