@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/ui.es.js CHANGED
@@ -1,19 +1,19 @@
1
- import { j as t, I as a, a as A, c as H, S as f, T as S, B as L, v as z, b as I } from "./index-O501BDCu.js";
2
- import { f as ee, g as se, h as ne, C as oe, M as ie, P as le, R as ce, d as ae, e as de } from "./index-O501BDCu.js";
3
- import b from "react";
4
- const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_16", M = "_subtitle_o1bnv_23", D = "_alignmentContent_o1bnv_30", Y = "_alignments_o1bnv_37", q = "_alignment_o1bnv_8", J = "_circle_o1bnv_56", K = "_paddings_o1bnv_63", Q = "_padding_o1bnv_63", U = "_input_o1bnv_81", g = {
5
- wrapper: O,
6
- alignmentBlock: F,
7
- title: G,
8
- subtitle: M,
9
- alignmentContent: D,
10
- alignments: Y,
11
- alignment: q,
12
- circle: J,
13
- paddings: K,
14
- padding: Q,
15
- input: U
16
- }, V = [
1
+ import { j as t, I as p, a as S, c as D, S as C, T as O, b as I, C as Y, B as R, v as P } from "./index-2iAZ7WmX.js";
2
+ import { g as Ne, h as Te, e as Pe, M as Ie, P as Ae, R as Se, d as Le, f as ze } from "./index-2iAZ7WmX.js";
3
+ import y from "react";
4
+ const q = "_wrapper_o1bnv_2", J = "_alignmentBlock_o1bnv_8", K = "_title_o1bnv_16", Q = "_subtitle_o1bnv_23", U = "_alignmentContent_o1bnv_30", V = "_alignments_o1bnv_37", W = "_alignment_o1bnv_8", X = "_circle_o1bnv_56", Z = "_paddings_o1bnv_63", tt = "_padding_o1bnv_63", et = "_input_o1bnv_81", x = {
5
+ wrapper: q,
6
+ alignmentBlock: J,
7
+ title: K,
8
+ subtitle: Q,
9
+ alignmentContent: U,
10
+ alignments: V,
11
+ alignment: W,
12
+ circle: X,
13
+ paddings: Z,
14
+ padding: tt,
15
+ input: et
16
+ }, st = [
17
17
  "topLeft",
18
18
  "top",
19
19
  "topRight",
@@ -23,24 +23,24 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
23
23
  "bottomLeft",
24
24
  "bottom",
25
25
  "bottomRight"
26
- ], W = ["left", "top", "right", "bottom"], Ut = (r) => {
27
- const { alignment: n, padding: _, setPadding: s, setAlignment: d } = r;
28
- return /* @__PURE__ */ t.jsxs("div", { className: g.layout, children: [
29
- /* @__PURE__ */ t.jsx("h3", { className: g.title, children: "Layout" }),
30
- /* @__PURE__ */ t.jsxs("div", { className: g.alignmentBlock, children: [
31
- /* @__PURE__ */ t.jsx("h5", { className: g.subtitle, children: "Alignment" }),
32
- /* @__PURE__ */ t.jsxs("div", { className: g.alignmentContent, children: [
33
- /* @__PURE__ */ t.jsx("div", { className: g.alignments, children: V.map((o) => /* @__PURE__ */ t.jsxs(
26
+ ], nt = ["left", "top", "right", "bottom"], ke = (_) => {
27
+ const { alignment: i, padding: a, setPadding: s, setAlignment: n } = _;
28
+ return /* @__PURE__ */ t.jsxs("div", { className: x.layout, children: [
29
+ /* @__PURE__ */ t.jsx("h3", { className: x.title, children: "Layout" }),
30
+ /* @__PURE__ */ t.jsxs("div", { className: x.alignmentBlock, children: [
31
+ /* @__PURE__ */ t.jsx("h5", { className: x.subtitle, children: "Alignment" }),
32
+ /* @__PURE__ */ t.jsxs("div", { className: x.alignmentContent, children: [
33
+ /* @__PURE__ */ t.jsx("div", { className: x.alignments, children: st.map((c) => /* @__PURE__ */ t.jsxs(
34
34
  "div",
35
35
  {
36
36
  onClick: () => {
37
- d((l) => o);
37
+ n((u) => c);
38
38
  },
39
- className: g.alignment,
39
+ className: x.alignment,
40
40
  children: [
41
- o !== n && /* @__PURE__ */ t.jsx("div", { className: g.circle }),
42
- o === n && /* @__PURE__ */ t.jsx(
43
- a,
41
+ c !== i && /* @__PURE__ */ t.jsx("div", { className: x.circle }),
42
+ c === i && /* @__PURE__ */ t.jsx(
43
+ p,
44
44
  {
45
45
  name: "text-align-left",
46
46
  fill: "#FF3F19"
@@ -48,25 +48,25 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
48
48
  )
49
49
  ]
50
50
  },
51
- o
51
+ c
52
52
  )) }),
53
- /* @__PURE__ */ t.jsx("div", { className: g.paddings, children: W.map((o) => /* @__PURE__ */ t.jsxs("label", { className: g.padding, children: [
53
+ /* @__PURE__ */ t.jsx("div", { className: x.paddings, children: nt.map((c) => /* @__PURE__ */ t.jsxs("label", { className: x.padding, children: [
54
54
  /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
55
- a,
55
+ p,
56
56
  {
57
- name: `align-${o}`,
57
+ name: `align-${c}`,
58
58
  width: 20,
59
59
  height: 20
60
60
  }
61
61
  ) }),
62
62
  /* @__PURE__ */ t.jsx(
63
- A,
63
+ S,
64
64
  {
65
65
  type: "text",
66
- value: String(_[o]),
67
- onChange: (l) => s((p) => ({
68
- ...p,
69
- [o]: Number(l)
66
+ value: String(a[c]),
67
+ onChange: (u) => s((h) => ({
68
+ ...h,
69
+ [c]: Number(u)
70
70
  })),
71
71
  paddingless: !0
72
72
  }
@@ -75,30 +75,30 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
75
75
  ] })
76
76
  ] })
77
77
  ] });
78
- }, X = "_subtitle_2zbxx_1", Z = "_header_2zbxx_8", tt = "_text_2zbxx_9", et = "_top_2zbxx_16", st = "_itemsBlock_2zbxx_23", w = {
79
- subtitle: X,
80
- header: Z,
81
- text: tt,
82
- top: et,
83
- itemsBlock: st
84
- }, nt = "_typeTexts_3zlec_1", ot = "_block_3zlec_7", it = "_active_3zlec_18", C = {
85
- typeTexts: nt,
86
- block: ot,
87
- active: it
88
- }, lt = ["bold", "italic", "underline", "strike-through", "code"], R = (r) => {
89
- const { typeText: n, setTypeText: _ } = r;
90
- return /* @__PURE__ */ t.jsx("div", { className: C.typeTexts, children: lt.map((s) => /* @__PURE__ */ t.jsx(
78
+ }, ot = "_subtitle_2zbxx_1", it = "_header_2zbxx_8", ct = "_text_2zbxx_9", lt = "_top_2zbxx_16", at = "_itemsBlock_2zbxx_23", $ = {
79
+ subtitle: ot,
80
+ header: it,
81
+ text: ct,
82
+ top: lt,
83
+ itemsBlock: at
84
+ }, rt = "_typeTexts_3zlec_1", dt = "_block_3zlec_7", _t = "_active_3zlec_18", A = {
85
+ typeTexts: rt,
86
+ block: dt,
87
+ active: _t
88
+ }, ut = ["bold", "italic", "underline", "strike-through", "code"], E = (_) => {
89
+ const { typeText: i, setTypeText: a } = _;
90
+ return /* @__PURE__ */ t.jsx("div", { className: A.typeTexts, children: ut.map((s) => /* @__PURE__ */ t.jsx(
91
91
  "div",
92
92
  {
93
- className: H(C.block, {
94
- [C.active]: n === s
93
+ className: D(A.block, {
94
+ [A.active]: i === s
95
95
  }),
96
- onClick: () => _((d) => s),
96
+ onClick: () => a((n) => s),
97
97
  children: /* @__PURE__ */ t.jsx(
98
- a,
98
+ p,
99
99
  {
100
100
  name: `text-${s}`,
101
- fill: n === s ? "#252525" : "#757575",
101
+ fill: i === s ? "#252525" : "#757575",
102
102
  width: 20,
103
103
  height: 20
104
104
  }
@@ -106,90 +106,90 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
106
106
  },
107
107
  String(s)
108
108
  )) });
109
- }, Vt = (r) => {
109
+ }, fe = (_) => {
110
110
  const {
111
- typeText: n,
112
- isActiveText: _,
111
+ typeText: i,
112
+ isActiveText: a,
113
113
  setIsActiveText: s,
114
- text: d,
115
- setText: o,
116
- setTypeText: l,
117
- title: p,
118
- subtitle: v = "Items"
119
- } = r;
120
- return /* @__PURE__ */ t.jsxs("div", { className: w.text, children: [
121
- /* @__PURE__ */ t.jsxs("div", { className: w.top, children: [
122
- /* @__PURE__ */ t.jsx("h3", { className: w.title, children: p }),
114
+ text: n,
115
+ setText: c,
116
+ setTypeText: u,
117
+ title: h,
118
+ subtitle: o = "Items"
119
+ } = _;
120
+ return /* @__PURE__ */ t.jsxs("div", { className: $.text, children: [
121
+ /* @__PURE__ */ t.jsxs("div", { className: $.top, children: [
122
+ /* @__PURE__ */ t.jsx("h3", { className: $.title, children: h }),
123
123
  /* @__PURE__ */ t.jsx(
124
- f,
124
+ C,
125
125
  {
126
- current: _,
127
- onChange: (u) => s((e) => u)
126
+ current: a,
127
+ onChange: (l) => s((r) => l)
128
128
  }
129
129
  )
130
130
  ] }),
131
- /* @__PURE__ */ t.jsxs("div", { className: w.itemsBlock, children: [
132
- /* @__PURE__ */ t.jsx("h5", { className: w.subtitle, children: v }),
131
+ /* @__PURE__ */ t.jsxs("div", { className: $.itemsBlock, children: [
132
+ /* @__PURE__ */ t.jsx("h5", { className: $.subtitle, children: o }),
133
133
  /* @__PURE__ */ t.jsx(
134
- S,
134
+ O,
135
135
  {
136
- onChange: (u) => o((e) => u),
137
- value: d,
136
+ onChange: (l) => c((r) => l),
137
+ value: n,
138
138
  maxLength: 150
139
139
  }
140
140
  ),
141
141
  /* @__PURE__ */ t.jsx(
142
- R,
142
+ E,
143
143
  {
144
- typeText: n,
145
- setTypeText: l
144
+ typeText: i,
145
+ setTypeText: u
146
146
  }
147
147
  )
148
148
  ] })
149
149
  ] });
150
- }, ct = "_subtitle_2l7ty_1", at = "_header_2l7ty_8", dt = "_text_2l7ty_9", rt = "_productsBlock_2l7ty_10", _t = "_top_2l7ty_22", ht = "_itemsBlock_2l7ty_29", mt = "_typeTexts_2l7ty_35", pt = "_block_2l7ty_41", ut = "_active_2l7ty_52", xt = "_products_2l7ty_10", gt = "_product_2l7ty_10", bt = "_button_2l7ty_70", vt = "_image_2l7ty_80", jt = "_info_2l7ty_87", yt = "_name_2l7ty_98", kt = "_buttons_2l7ty_102", wt = "_modal_2l7ty_108", ft = "_other_2l7ty_125", c = {
151
- subtitle: ct,
152
- header: at,
153
- text: dt,
154
- productsBlock: rt,
155
- top: _t,
156
- itemsBlock: ht,
157
- typeTexts: mt,
158
- block: pt,
159
- active: ut,
160
- products: xt,
161
- product: gt,
162
- button: bt,
163
- image: vt,
164
- info: jt,
165
- name: yt,
166
- buttons: kt,
167
- modal: wt,
168
- other: ft
169
- }, Nt = (r) => {
170
- const { activeItem: n, setActiveItem: _, popupPosition: s } = r;
150
+ }, pt = "_subtitle_2l7ty_1", mt = "_header_2l7ty_8", ht = "_text_2l7ty_9", xt = "_productsBlock_2l7ty_10", bt = "_top_2l7ty_22", gt = "_itemsBlock_2l7ty_29", yt = "_typeTexts_2l7ty_35", vt = "_block_2l7ty_41", jt = "_active_2l7ty_52", kt = "_products_2l7ty_10", ft = "_product_2l7ty_10", wt = "_button_2l7ty_70", $t = "_image_2l7ty_80", Bt = "_info_2l7ty_87", Ct = "_name_2l7ty_98", Nt = "_buttons_2l7ty_102", Tt = "_modal_2l7ty_108", Pt = "_other_2l7ty_125", m = {
151
+ subtitle: pt,
152
+ header: mt,
153
+ text: ht,
154
+ productsBlock: xt,
155
+ top: bt,
156
+ itemsBlock: gt,
157
+ typeTexts: yt,
158
+ block: vt,
159
+ active: jt,
160
+ products: kt,
161
+ product: ft,
162
+ button: wt,
163
+ image: $t,
164
+ info: Bt,
165
+ name: Ct,
166
+ buttons: Nt,
167
+ modal: Tt,
168
+ other: Pt
169
+ }, It = (_) => {
170
+ const { activeItem: i, setActiveItem: a, popupPosition: s } = _;
171
171
  return /* @__PURE__ */ t.jsxs(
172
172
  "div",
173
173
  {
174
- className: c.modal,
175
- onClick: (d) => {
176
- d.stopPropagation();
174
+ className: m.modal,
175
+ onClick: (n) => {
176
+ n.stopPropagation();
177
177
  },
178
178
  style: {
179
179
  top: `${s.top}px`,
180
180
  left: `${s.left}px`
181
181
  },
182
182
  children: [
183
- /* @__PURE__ */ t.jsxs("div", { className: c.top, children: [
184
- /* @__PURE__ */ t.jsx("h3", { children: n.name }),
183
+ /* @__PURE__ */ t.jsxs("div", { className: m.top, children: [
184
+ /* @__PURE__ */ t.jsx("h3", { children: i.name }),
185
185
  /* @__PURE__ */ t.jsx(
186
- a,
186
+ p,
187
187
  {
188
188
  name: "x",
189
189
  height: 20,
190
190
  width: 20,
191
191
  hoverable: !0,
192
- onClick: () => _(null)
192
+ onClick: () => a(null)
193
193
  }
194
194
  )
195
195
  ] }),
@@ -200,107 +200,137 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
200
200
  ]
201
201
  }
202
202
  );
203
- }, Wt = (r) => {
203
+ }, we = (_) => {
204
204
  const {
205
- isActiveItems: n,
206
- setIsActiveItems: _,
205
+ isActiveItems: i,
206
+ setIsActiveItems: a,
207
207
  items: s,
208
- setItems: d,
209
- isProductStats: o,
210
- setIsProductStats: l,
211
- title: p,
212
- subtitle: v,
213
- editable: u = !0,
214
- draggable: e = !1,
215
- withImage: m = !0
216
- } = r, [y, j] = b.useState(null), [N, k] = b.useState({
208
+ setItems: n,
209
+ isProductStats: c,
210
+ setIsProductStats: u,
211
+ title: h,
212
+ subtitle: o,
213
+ editable: l = !0,
214
+ draggable: r = !1,
215
+ withImage: f = !0,
216
+ itemsType: b,
217
+ itemsPlaceholder: v = "",
218
+ itemsOptions: L
219
+ } = _, [z, w] = y.useState(null), [H, F] = y.useState({
217
220
  top: 0,
218
221
  left: 0
219
222
  });
220
- b.useEffect(() => {
221
- const i = () => {
222
- j(null);
223
+ y.useEffect(() => {
224
+ const e = () => {
225
+ w(null);
223
226
  };
224
- return document.body.addEventListener("click", i), j(null), () => {
225
- j(null), document.body.removeEventListener("click", i);
227
+ return document.body.addEventListener("click", e), w(null), () => {
228
+ w(null), document.body.removeEventListener("click", e);
226
229
  };
227
230
  }, []);
228
- const E = (i, x) => {
229
- i.stopPropagation();
230
- const B = i.target.getBoundingClientRect(), T = 100, P = window.innerHeight;
231
- let $ = B.top + window.scrollY;
232
- $ + T > P && ($ = P - T - 20), k({
233
- top: $ - 80,
234
- left: B.left - 30
235
- }), j(x);
231
+ const G = (e, d) => {
232
+ e.stopPropagation();
233
+ const j = e.target.getBoundingClientRect(), N = 100, T = window.innerHeight;
234
+ let g = j.top + window.scrollY;
235
+ g + N > T && (g = T - N - 20), F({
236
+ top: g - 80,
237
+ left: j.left - 30
238
+ }), w(d);
236
239
  };
237
- return /* @__PURE__ */ t.jsxs("div", { className: c.productsBlock, children: [
238
- /* @__PURE__ */ t.jsxs("div", { className: c.top, children: [
239
- p && /* @__PURE__ */ t.jsx("h3", { className: c.title, children: p }),
240
+ function M(e) {
241
+ if (f && !e)
242
+ return /* @__PURE__ */ t.jsx(
243
+ p,
244
+ {
245
+ name: "image",
246
+ width: 16,
247
+ height: 16,
248
+ fill: "#757575"
249
+ }
250
+ );
251
+ }
252
+ return /* @__PURE__ */ t.jsxs("div", { className: m.productsBlock, children: [
253
+ /* @__PURE__ */ t.jsxs("div", { className: m.top, children: [
254
+ h && /* @__PURE__ */ t.jsx("h3", { className: m.title, children: h }),
240
255
  /* @__PURE__ */ t.jsx(
241
- f,
256
+ C,
242
257
  {
243
- current: n,
244
- onChange: (i) => _((x) => i)
258
+ current: i,
259
+ onChange: (e) => a((d) => e)
245
260
  }
246
261
  )
247
262
  ] }),
248
- y && u && /* @__PURE__ */ t.jsx(
249
- Nt,
263
+ z && l && /* @__PURE__ */ t.jsx(
264
+ It,
250
265
  {
251
- activeItem: y,
252
- setActiveItem: j,
253
- popupPosition: N
266
+ activeItem: z,
267
+ setActiveItem: w,
268
+ popupPosition: H
254
269
  }
255
270
  ),
256
- /* @__PURE__ */ t.jsxs("div", { className: c.products, children: [
257
- v && /* @__PURE__ */ t.jsx("h5", { className: c.subtitle, children: v }),
258
- s.map((i) => /* @__PURE__ */ t.jsxs(
271
+ /* @__PURE__ */ t.jsxs("div", { className: m.products, children: [
272
+ o && /* @__PURE__ */ t.jsx("h5", { className: m.subtitle, children: o }),
273
+ s.map((e) => /* @__PURE__ */ t.jsxs(
259
274
  "div",
260
275
  {
261
- className: c.product,
276
+ className: m.product,
262
277
  children: [
263
- e && /* @__PURE__ */ t.jsx(
264
- a,
278
+ r && /* @__PURE__ */ t.jsx("div", { children: /* @__PURE__ */ t.jsx(
279
+ p,
265
280
  {
266
281
  name: "drag",
267
282
  hoverable: !0,
268
283
  width: 20,
269
284
  height: 20
270
285
  }
286
+ ) }),
287
+ b === "select" && /* @__PURE__ */ t.jsx(
288
+ I,
289
+ {
290
+ onChange: (d) => {
291
+ n((j) => [...j].map((g) => g.id === e.id ? {
292
+ ...e,
293
+ name: d
294
+ } : g));
295
+ },
296
+ value: e.name,
297
+ options: L,
298
+ leftAddon: M(e.image)
299
+ }
271
300
  ),
272
- /* @__PURE__ */ t.jsxs("div", { className: c.info, children: [
273
- m && /* @__PURE__ */ t.jsx("div", { className: c.image, children: i.image ? /* @__PURE__ */ t.jsx("img", { src: i.image }) : /* @__PURE__ */ t.jsx(
274
- a,
275
- {
276
- name: "image",
277
- width: 16,
278
- height: 16,
279
- fill: "#757575"
280
- }
281
- ) }),
282
- /* @__PURE__ */ t.jsx("span", { className: c.name, children: i.name }),
283
- /* @__PURE__ */ t.jsx(a, { name: "arrow-down" })
284
- ] }),
285
- /* @__PURE__ */ t.jsxs("div", { className: c.buttons, children: [
286
- u && /* @__PURE__ */ t.jsx(
287
- a,
301
+ b === "input" && /* @__PURE__ */ t.jsx(
302
+ S,
303
+ {
304
+ onChange: (d) => {
305
+ n((j) => [...j].map((g) => g.id === e.id ? {
306
+ ...e,
307
+ name: d
308
+ } : g));
309
+ },
310
+ value: e.name,
311
+ placeholder: v
312
+ }
313
+ ),
314
+ b === "image" && /* @__PURE__ */ t.jsx(Y, {}),
315
+ /* @__PURE__ */ t.jsxs("div", { className: m.buttons, children: [
316
+ l && /* @__PURE__ */ t.jsx(
317
+ p,
288
318
  {
289
319
  name: "sliders",
290
320
  hoverable: !0,
291
321
  width: 20,
292
322
  height: 20,
293
- onClick: (x) => {
294
- E(x, i);
323
+ onClick: (d) => {
324
+ G(d, e);
295
325
  }
296
326
  }
297
327
  ),
298
328
  /* @__PURE__ */ t.jsx(
299
- a,
329
+ p,
300
330
  {
301
331
  name: "trash",
302
332
  hoverable: !0,
303
- onClick: () => d((x) => x.filter((B) => B.id !== i.id)),
333
+ onClick: () => n((d) => d.filter((j) => j.id !== e.id)),
304
334
  width: 20,
305
335
  height: 20,
306
336
  fill: "#C12A2A"
@@ -309,24 +339,29 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
309
339
  ] })
310
340
  ]
311
341
  },
312
- i.id
342
+ e.id
313
343
  )),
314
344
  /* @__PURE__ */ t.jsxs(
315
- L,
345
+ R,
316
346
  {
317
- className: c.button,
347
+ className: m.button,
318
348
  size: "s",
319
- onClick: () => d((i) => {
320
- const x = [...i];
321
- return x.push({
322
- name: "Product 1",
323
- id: z()
324
- }), x;
349
+ onClick: () => n((e) => {
350
+ const d = [...e];
351
+ return b === "select" ? d.push({
352
+ name: L[0] || "",
353
+ id: P()
354
+ }) : b === "input" ? d.push({
355
+ name: "",
356
+ id: P()
357
+ }) : d.push({
358
+ id: P()
359
+ }), d;
325
360
  }),
326
361
  children: [
327
362
  /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
328
363
  /* @__PURE__ */ t.jsx(
329
- a,
364
+ p,
330
365
  {
331
366
  name: "plus",
332
367
  width: 16,
@@ -337,13 +372,13 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
337
372
  }
338
373
  )
339
374
  ] }),
340
- o !== void 0 && /* @__PURE__ */ t.jsxs("div", { className: c.other, children: [
341
- /* @__PURE__ */ t.jsx("h5", { className: c.subtitle, children: "Other" }),
375
+ c !== void 0 && /* @__PURE__ */ t.jsxs("div", { className: m.other, children: [
376
+ /* @__PURE__ */ t.jsx("h5", { className: m.subtitle, children: "Other" }),
342
377
  /* @__PURE__ */ t.jsx(
343
- f,
378
+ C,
344
379
  {
345
- current: o,
346
- onChange: (i) => l == null ? void 0 : l((x) => i),
380
+ current: c,
381
+ onChange: (e) => u == null ? void 0 : u((d) => e),
347
382
  label: "Product Stats",
348
383
  hasBackground: !0,
349
384
  paddingless: !1
@@ -351,65 +386,65 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
351
386
  )
352
387
  ] })
353
388
  ] });
354
- }, Bt = "_subtitle_1y5sw_1", $t = "_header_1y5sw_8", Ct = "_text_1y5sw_9", Tt = "_productsBlock_1y5sw_10", Pt = "_buttonsBlock_1y5sw_11", It = "_top_1y5sw_22", At = "_itemsBlock_1y5sw_29", St = "_typeTexts_1y5sw_35", Lt = "_block_1y5sw_41", zt = "_active_1y5sw_52", Rt = "_products_1y5sw_10", Et = "_product_1y5sw_10", Ht = "_button_1y5sw_11", Ot = "_image_1y5sw_80", Ft = "_info_1y5sw_87", Gt = "_name_1y5sw_98", Mt = "_buttons_1y5sw_11", Dt = "_modal_1y5sw_108", Yt = "_other_1y5sw_125", qt = "_options_1y5sw_131", h = {
355
- subtitle: Bt,
356
- header: $t,
357
- text: Ct,
358
- productsBlock: Tt,
359
- buttonsBlock: Pt,
360
- top: It,
361
- itemsBlock: At,
362
- typeTexts: St,
363
- block: Lt,
364
- active: zt,
365
- products: Rt,
366
- product: Et,
367
- button: Ht,
368
- image: Ot,
369
- info: Ft,
370
- name: Gt,
371
- buttons: Mt,
372
- modal: Dt,
373
- other: Yt,
374
- options: qt
375
- }, Jt = (r) => {
376
- const { activeButton: n, setActiveButton: _, popupPosition: s } = r, [d, o] = b.useState(n.typeText), [l, p] = b.useState(n.destination), [v, u] = b.useState(n.link || "");
389
+ }, At = "_subtitle_1y5sw_1", St = "_header_1y5sw_8", Lt = "_text_1y5sw_9", zt = "_productsBlock_1y5sw_10", Ot = "_buttonsBlock_1y5sw_11", Rt = "_top_1y5sw_22", Et = "_itemsBlock_1y5sw_29", Ht = "_typeTexts_1y5sw_35", Ft = "_block_1y5sw_41", Gt = "_active_1y5sw_52", Mt = "_products_1y5sw_10", Dt = "_product_1y5sw_10", Yt = "_button_1y5sw_11", qt = "_image_1y5sw_80", Jt = "_info_1y5sw_87", Kt = "_name_1y5sw_98", Qt = "_buttons_1y5sw_11", Ut = "_modal_1y5sw_108", Vt = "_other_1y5sw_125", Wt = "_options_1y5sw_131", k = {
390
+ subtitle: At,
391
+ header: St,
392
+ text: Lt,
393
+ productsBlock: zt,
394
+ buttonsBlock: Ot,
395
+ top: Rt,
396
+ itemsBlock: Et,
397
+ typeTexts: Ht,
398
+ block: Ft,
399
+ active: Gt,
400
+ products: Mt,
401
+ product: Dt,
402
+ button: Yt,
403
+ image: qt,
404
+ info: Jt,
405
+ name: Kt,
406
+ buttons: Qt,
407
+ modal: Ut,
408
+ other: Vt,
409
+ options: Wt
410
+ }, Xt = (_) => {
411
+ const { activeButton: i, setActiveButton: a, popupPosition: s } = _, [n, c] = y.useState(i.typeText), [u, h] = y.useState(i.destination), [o, l] = y.useState(i.link || "");
377
412
  return /* @__PURE__ */ t.jsxs(
378
413
  "div",
379
414
  {
380
- className: h.modal,
381
- onClick: (e) => {
382
- e.stopPropagation();
415
+ className: k.modal,
416
+ onClick: (r) => {
417
+ r.stopPropagation();
383
418
  },
384
419
  style: {
385
420
  top: `${s.top}px`,
386
421
  left: `${s.left}px`
387
422
  },
388
423
  children: [
389
- /* @__PURE__ */ t.jsxs("div", { className: h.top, children: [
390
- /* @__PURE__ */ t.jsx("h3", { children: n.type }),
424
+ /* @__PURE__ */ t.jsxs("div", { className: k.top, children: [
425
+ /* @__PURE__ */ t.jsx("h3", { children: i.type }),
391
426
  /* @__PURE__ */ t.jsx(
392
- a,
427
+ p,
393
428
  {
394
429
  name: "x",
395
430
  height: 20,
396
431
  width: 20,
397
432
  hoverable: !0,
398
- onClick: () => _(null)
433
+ onClick: () => a(null)
399
434
  }
400
435
  )
401
436
  ] }),
402
- /* @__PURE__ */ t.jsxs("div", { className: h.options, children: [
437
+ /* @__PURE__ */ t.jsxs("div", { className: k.options, children: [
403
438
  /* @__PURE__ */ t.jsx(
404
439
  I,
405
440
  {
406
441
  label: "Destination",
407
- onChange: (e) => p(e),
442
+ onChange: (r) => h(r),
408
443
  options: ["Go to Page", "Open Link"],
409
- value: l
444
+ value: u
410
445
  }
411
446
  ),
412
- l === "Go to Page" ? /* @__PURE__ */ t.jsx(
447
+ u === "Go to Page" ? /* @__PURE__ */ t.jsx(
413
448
  I,
414
449
  {
415
450
  label: "Go to",
@@ -419,23 +454,23 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
419
454
  value: "Homepage"
420
455
  }
421
456
  ) : /* @__PURE__ */ t.jsx(
422
- A,
457
+ S,
423
458
  {
424
- onChange: (e) => u(e),
425
- value: v,
459
+ onChange: (r) => l(r),
460
+ value: o,
426
461
  placeholder: "https://",
427
462
  label: "Link"
428
463
  }
429
464
  ),
430
465
  /* @__PURE__ */ t.jsx(
431
- f,
466
+ C,
432
467
  {
433
468
  current: !1,
434
469
  label: "Open in new tab"
435
470
  }
436
471
  ),
437
472
  /* @__PURE__ */ t.jsx(
438
- S,
473
+ O,
439
474
  {
440
475
  onChange: () => {
441
476
  },
@@ -445,146 +480,186 @@ const O = "_wrapper_o1bnv_2", F = "_alignmentBlock_o1bnv_8", G = "_title_o1bnv_1
445
480
  }
446
481
  ),
447
482
  /* @__PURE__ */ t.jsx(
448
- R,
483
+ E,
449
484
  {
450
- typeText: d,
451
- setTypeText: o
485
+ typeText: n,
486
+ setTypeText: c
452
487
  }
453
488
  )
454
489
  ] })
455
490
  ]
456
491
  }
457
492
  );
458
- }, Xt = (r) => {
459
- const { isActiveButtons: n, setIsActiveButtons: _, buttons: s, setButtons: d } = r, [o, l] = b.useState(null), [p, v] = b.useState({
493
+ }, Zt = "_subtitle_1y5sw_1", te = "_header_1y5sw_8", ee = "_text_1y5sw_9", se = "_productsBlock_1y5sw_10", ne = "_buttonsBlock_1y5sw_11", oe = "_top_1y5sw_22", ie = "_itemsBlock_1y5sw_29", ce = "_typeTexts_1y5sw_35", le = "_block_1y5sw_41", ae = "_active_1y5sw_52", re = "_products_1y5sw_10", de = "_product_1y5sw_10", _e = "_button_1y5sw_11", ue = "_image_1y5sw_80", pe = "_info_1y5sw_87", me = "_name_1y5sw_98", he = "_buttons_1y5sw_11", xe = "_modal_1y5sw_108", be = "_other_1y5sw_125", ge = "_options_1y5sw_131", B = {
494
+ subtitle: Zt,
495
+ header: te,
496
+ text: ee,
497
+ productsBlock: se,
498
+ buttonsBlock: ne,
499
+ top: oe,
500
+ itemsBlock: ie,
501
+ typeTexts: ce,
502
+ block: le,
503
+ active: ae,
504
+ products: re,
505
+ product: de,
506
+ button: _e,
507
+ image: ue,
508
+ info: pe,
509
+ name: me,
510
+ buttons: he,
511
+ modal: xe,
512
+ other: be,
513
+ options: ge
514
+ }, ye = (_) => {
515
+ const { buttons: i, setButtons: a } = _, [s, n] = y.useState(null), [c, u] = y.useState({
460
516
  top: 0,
461
517
  left: 0
462
518
  });
463
- b.useEffect(() => {
464
- const e = () => {
465
- l(null);
519
+ y.useEffect(() => {
520
+ const o = () => {
521
+ n(null);
466
522
  };
467
- return document.body.addEventListener("click", e), l(null), () => {
468
- l(null), document.body.removeEventListener("click", e);
523
+ return document.body.addEventListener("click", o), n(null), () => {
524
+ n(null), document.body.removeEventListener("click", o);
469
525
  };
470
526
  }, []);
471
- const u = (e, m) => {
472
- e.stopPropagation();
473
- const y = e.target.getBoundingClientRect(), j = 490, N = window.innerHeight;
474
- let k = y.top + window.scrollY;
475
- k + j > N && (k = N - j - 20), v({
476
- top: k,
477
- left: y.left - 30
478
- }), l(m);
527
+ const h = (o, l) => {
528
+ o.stopPropagation();
529
+ const r = o.target.getBoundingClientRect(), f = 490, b = window.innerHeight;
530
+ let v = r.top + window.scrollY;
531
+ v + f > b && (v = b - f - 20), u({
532
+ top: v,
533
+ left: r.left - 30
534
+ }), n(l);
479
535
  };
480
- return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: h.buttonsBlock, children: [
481
- /* @__PURE__ */ t.jsxs("div", { className: h.top, children: [
482
- /* @__PURE__ */ t.jsx("h3", { className: h.title, children: "Buttons" }),
483
- /* @__PURE__ */ t.jsx(
484
- f,
485
- {
486
- current: n,
487
- onChange: (e) => _((m) => e)
488
- }
489
- )
490
- ] }),
491
- /* @__PURE__ */ t.jsxs("div", { className: h.products, children: [
492
- /* @__PURE__ */ t.jsx("h5", { className: h.subtitle, children: "Button Type" }),
493
- s.map((e) => /* @__PURE__ */ t.jsxs(
494
- "div",
495
- {
496
- className: h.product,
497
- children: [
498
- /* @__PURE__ */ t.jsxs("div", { className: h.info, children: [
499
- /* @__PURE__ */ t.jsx("span", { className: h.name, children: e.type }),
500
- /* @__PURE__ */ t.jsx(a, { name: "arrow-down" })
501
- ] }),
502
- /* @__PURE__ */ t.jsxs("div", { className: h.buttons, children: [
503
- /* @__PURE__ */ t.jsx(
504
- a,
505
- {
506
- name: "sliders",
507
- hoverable: !0,
508
- width: 20,
509
- height: 20,
510
- onClick: (m) => {
511
- u(m, e);
512
- }
513
- }
514
- ),
515
- /* @__PURE__ */ t.jsx(
516
- a,
517
- {
518
- name: "trash",
519
- hoverable: !0,
520
- onClick: () => d((m) => m.filter((y) => y.id !== e.id)),
521
- width: 20,
522
- height: 20,
523
- fill: "#C12A2A"
536
+ return /* @__PURE__ */ t.jsxs("div", { className: B.products, children: [
537
+ /* @__PURE__ */ t.jsx("h5", { className: B.subtitle, children: "Button Type" }),
538
+ i.map((o) => /* @__PURE__ */ t.jsxs(
539
+ "div",
540
+ {
541
+ className: B.product,
542
+ children: [
543
+ /* @__PURE__ */ t.jsx(
544
+ I,
545
+ {
546
+ onChange: (l) => {
547
+ a((r) => [...r].map((v) => v.id === o.id ? {
548
+ ...o,
549
+ type: l
550
+ } : v));
551
+ },
552
+ value: o.type,
553
+ options: ["Primary", "Secondary"]
554
+ }
555
+ ),
556
+ /* @__PURE__ */ t.jsxs("div", { className: B.buttons, children: [
557
+ /* @__PURE__ */ t.jsx(
558
+ p,
559
+ {
560
+ name: "sliders",
561
+ hoverable: !0,
562
+ width: 20,
563
+ height: 20,
564
+ onClick: (l) => {
565
+ h(l, o);
524
566
  }
525
- )
526
- ] })
527
- ]
528
- },
529
- e.id
530
- )),
531
- o && /* @__PURE__ */ t.jsx(
532
- Jt,
533
- {
534
- activeButton: o,
535
- setActiveButton: l,
536
- popupPosition: p
537
- }
538
- ),
539
- /* @__PURE__ */ t.jsxs(
540
- L,
541
- {
542
- className: h.button,
543
- size: "s",
544
- onClick: () => d((e) => {
545
- const m = [...e];
546
- return m.push({
547
- type: "Primary",
548
- id: z(),
549
- typeText: "bold",
550
- destination: "Go to Page"
551
- }), m;
552
- }),
553
- children: [
554
- /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
567
+ }
568
+ ),
555
569
  /* @__PURE__ */ t.jsx(
556
- a,
570
+ p,
557
571
  {
558
- name: "plus",
559
- width: 16,
560
- height: 16
572
+ name: "trash",
573
+ hoverable: !0,
574
+ onClick: () => a((l) => l.filter((r) => r.id !== o.id)),
575
+ width: 20,
576
+ height: 20,
577
+ fill: "#C12A2A"
561
578
  }
562
579
  )
563
- ]
580
+ ] })
581
+ ]
582
+ },
583
+ o.id
584
+ )),
585
+ s && /* @__PURE__ */ t.jsx(
586
+ Xt,
587
+ {
588
+ activeButton: s,
589
+ setActiveButton: n,
590
+ popupPosition: c
591
+ }
592
+ ),
593
+ /* @__PURE__ */ t.jsxs(
594
+ R,
595
+ {
596
+ className: B.button,
597
+ size: "s",
598
+ onClick: () => a((o) => {
599
+ const l = [...o];
600
+ return l.push({
601
+ type: "Primary",
602
+ id: P(),
603
+ typeText: "bold",
604
+ destination: "Go to Page"
605
+ }), l;
606
+ }),
607
+ children: [
608
+ /* @__PURE__ */ t.jsx("span", { children: "Add Option" }),
609
+ /* @__PURE__ */ t.jsx(
610
+ p,
611
+ {
612
+ name: "plus",
613
+ width: 16,
614
+ height: 16
615
+ }
616
+ )
617
+ ]
618
+ }
619
+ )
620
+ ] });
621
+ }, $e = (_) => {
622
+ const { isActiveButtons: i, setIsActiveButtons: a, buttons: s, setButtons: n } = _;
623
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: /* @__PURE__ */ t.jsxs("div", { className: k.buttonsBlock, children: [
624
+ /* @__PURE__ */ t.jsxs("div", { className: k.top, children: [
625
+ /* @__PURE__ */ t.jsx("h3", { className: k.title, children: "Buttons" }),
626
+ /* @__PURE__ */ t.jsx(
627
+ C,
628
+ {
629
+ current: i,
630
+ onChange: (c) => a((u) => c)
564
631
  }
565
632
  )
566
- ] })
633
+ ] }),
634
+ /* @__PURE__ */ t.jsx(
635
+ ye,
636
+ {
637
+ buttons: s,
638
+ setButtons: n
639
+ }
640
+ )
567
641
  ] }) });
568
642
  };
569
643
  export {
570
- L as Button,
571
- Xt as ButtonsSettings,
572
- ee as Checkbox,
573
- se as ChooseImage,
574
- ne as ChooseImageModal,
575
- oe as ColorPicker,
576
- a as Icon,
577
- A as Input,
578
- Wt as ItemsSettings,
579
- Ut as LayoutSettings,
580
- ie as Modal,
581
- le as Picker,
582
- ce as Radio,
644
+ R as Button,
645
+ ye as ButtonTypeSettings,
646
+ $e as ButtonsSettings,
647
+ Ne as Checkbox,
648
+ Y as ChooseImage,
649
+ Te as ChooseImageModal,
650
+ Pe as ColorPicker,
651
+ p as Icon,
652
+ S as Input,
653
+ we as ItemsSettings,
654
+ ke as LayoutSettings,
655
+ Ie as Modal,
656
+ Ae as Picker,
657
+ Se as Radio,
583
658
  I as Select,
584
- ae as Submodal,
585
- f as Switch,
586
- Vt as TextSettings,
587
- S as Textarea,
588
- de as Tip,
589
- R as TypeTexts
659
+ Le as Submodal,
660
+ C as Switch,
661
+ fe as TextSettings,
662
+ O as Textarea,
663
+ ze as Tip,
664
+ E as TypeTexts
590
665
  };