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