@chaibuilder/sdk 0.1.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.
Files changed (80) hide show
  1. package/README.md +41 -0
  2. package/dist/AddBlocks-04c49399.js +258 -0
  3. package/dist/AddBlocks-c27c81fa.cjs +3 -0
  4. package/dist/BrandingOptions-055cf22a.js +157 -0
  5. package/dist/BrandingOptions-c25f6370.cjs +1 -0
  6. package/dist/CONTROLS-031e1de3.cjs +1 -0
  7. package/dist/CONTROLS-442caee5.js +6 -0
  8. package/dist/CanvasArea-97dfbb52.cjs +60 -0
  9. package/dist/CanvasArea-a7901131.js +1455 -0
  10. package/dist/Class-0801d193.cjs +1 -0
  11. package/dist/Class-e6b07b79.js +1138 -0
  12. package/dist/ImagesPanel-160aa664.cjs +1 -0
  13. package/dist/ImagesPanel-815d5e6f.js +27 -0
  14. package/dist/Layers-3aa6aae7.cjs +1 -0
  15. package/dist/Layers-6f1c162e.js +370 -0
  16. package/dist/MarkAsGlobalBlock-209ddfd5.js +73 -0
  17. package/dist/MarkAsGlobalBlock-536770e7.cjs +1 -0
  18. package/dist/Settings-2b1ff1a3.cjs +1 -0
  19. package/dist/Settings-b1afcefe.js +1845 -0
  20. package/dist/SidePanels-f48777bb.js +144 -0
  21. package/dist/SidePanels-f79dbace.cjs +1 -0
  22. package/dist/Topbar-64729901.js +105 -0
  23. package/dist/Topbar-bff765dc.cjs +1 -0
  24. package/dist/UnsplashImages-04fffeed.cjs +1 -0
  25. package/dist/UnsplashImages-315ce7a8.js +160 -0
  26. package/dist/UploadImages-43c16a2d.cjs +1 -0
  27. package/dist/UploadImages-f317eef0.js +107 -0
  28. package/dist/_commonjsHelpers-5a53b418.cjs +1 -0
  29. package/dist/_commonjsHelpers-d4512b9c.js +6 -0
  30. package/dist/accordion-0afd8143.cjs +1 -0
  31. package/dist/accordion-c0176dc5.js +42 -0
  32. package/dist/context-menu-e1c240ce.js +122 -0
  33. package/dist/context-menu-fec580f2.cjs +1 -0
  34. package/dist/core.cjs +1 -0
  35. package/dist/core.d.ts +353 -0
  36. package/dist/core.js +83 -0
  37. package/dist/dialog-170eaad9.cjs +1 -0
  38. package/dist/dialog-3d4e82ed.js +65 -0
  39. package/dist/dropdown-menu-a9b096f9.cjs +1 -0
  40. package/dist/dropdown-menu-d912a52e.js +223 -0
  41. package/dist/html-to-json-d8ac554d.cjs +1 -0
  42. package/dist/html-to-json-fecbbe16.js +178 -0
  43. package/dist/index-aea5c557.cjs +2 -0
  44. package/dist/index-cdd49c4c.js +2651 -0
  45. package/dist/jsx-runtime-5c3ac4f7.cjs +27 -0
  46. package/dist/jsx-runtime-944c88e2.js +631 -0
  47. package/dist/label-167415e5.cjs +1 -0
  48. package/dist/label-e770a087.js +10 -0
  49. package/dist/lib.cjs +1 -0
  50. package/dist/lib.d.ts +29 -0
  51. package/dist/lib.js +223 -0
  52. package/dist/link-43d13383.cjs +1 -0
  53. package/dist/link-8594fd8f.js +211 -0
  54. package/dist/popover-7cb9079b.cjs +1 -0
  55. package/dist/popover-f7addcf4.js +23 -0
  56. package/dist/render.cjs +2 -0
  57. package/dist/render.d.ts +49 -0
  58. package/dist/render.js +1171 -0
  59. package/dist/scroll-area-088530b9.cjs +1 -0
  60. package/dist/scroll-area-9f64a082.js +30 -0
  61. package/dist/select-0e32300c.cjs +1 -0
  62. package/dist/select-7fddd7c3.js +75 -0
  63. package/dist/separator-a597dba7.cjs +1 -0
  64. package/dist/separator-a80d065b.js +18 -0
  65. package/dist/style.css +6 -0
  66. package/dist/tabs-85caa1e8.js +46 -0
  67. package/dist/tabs-860e37aa.cjs +1 -0
  68. package/dist/textarea-0750bcd2.js +73 -0
  69. package/dist/textarea-a338ede6.cjs +1 -0
  70. package/dist/toggle-00c9d11e.js +30 -0
  71. package/dist/toggle-b90fed97.cjs +1 -0
  72. package/dist/ui.cjs +1 -0
  73. package/dist/ui.d.ts +471 -0
  74. package/dist/ui.js +442 -0
  75. package/dist/useBuilderProp-5e57d0c8.cjs +1 -0
  76. package/dist/useBuilderProp-81a14920.js +238 -0
  77. package/dist/utils-3c452dd0.cjs +1 -0
  78. package/dist/utils-ac68b2c8.js +6 -0
  79. package/dist/vite.svg +1 -0
  80. package/package.json +156 -0
@@ -0,0 +1,1845 @@
1
+ import { j as e } from "./jsx-runtime-944c88e2.js";
2
+ import * as le from "react";
3
+ import L, { useState as S, createContext as Ne, useMemo as H, useContext as Q, useCallback as I, useEffect as J } from "react";
4
+ import { useThrottledCallback as de } from "@react-hookz/web";
5
+ import { get as c, includes as P, first as Se, reject as qe, isEmpty as w, map as V, nth as he, startCase as Re, toLower as Te, startsWith as X, isNumber as Je, parseInt as Qe, isNaN as Ve, findLast as et, has as ne, flatten as Y, intersection as He, forEach as tt, set as rt, last as me, filter as lt, isNull as ot } from "lodash";
6
+ import { useTranslation as Be } from "react-i18next";
7
+ import { PlusIcon as pe, Cross2Icon as Ae, EyeOpenIcon as st, EyeClosedIcon as be, BorderAllIcon as M, WidthIcon as k, HeightIcon as N, ArrowUpIcon as U, ArrowRightIcon as G, ArrowDownIcon as K, ArrowLeftIcon as q, ArrowTopLeftIcon as at, ArrowTopRightIcon as nt, ArrowBottomRightIcon as it, ArrowBottomLeftIcon as dt, AlignLeftIcon as ct, AlignCenterHorizontallyIcon as pt, AlignRightIcon as ut, StretchHorizontallyIcon as gt, FontItalicIcon as xt, UnderlineIcon as yt, OverlineIcon as ht, LetterCaseUppercaseIcon as mt, Cross1Icon as bt, InfoCircledIcon as ue, MinusIcon as ft, BoxIcon as $e, TriangleDownIcon as vt, RowSpacingIcon as wt, TrashIcon as Le, MixerHorizontalIcon as Ie } from "@radix-ui/react-icons";
8
+ import { T as Ct, a as jt, b as fe, c as ve } from "./tabs-85caa1e8.js";
9
+ import kt from "@rjsf/core";
10
+ import Nt from "@rjsf/validator-ajv8";
11
+ import { A as oe, c as De, C as Me, D as St, F as Rt, G as Tt, i as ge, H as Oe, I as Ee, h as Pe, d as Vt, J as Fe, e as we, K as se, u as Ht, L as Bt, M as At } from "./index-cdd49c4c.js";
12
+ import { R as $t, a as Lt, b as It, L as Dt, I as Mt } from "./link-8594fd8f.js";
13
+ import { getBlockComponent as Ot } from "chaibuilder-blocks";
14
+ import { useAtom as Et } from "jotai";
15
+ import Pt from "react-autosuggest";
16
+ import Ft from "fuse.js";
17
+ import { A as Xt, C as ae, b as Yt } from "./Class-e6b07b79.js";
18
+ import { B as Xe, d as W, e as Z, f as _, g as Wt } from "./useBuilderProp-81a14920.js";
19
+ import { L as xe } from "./label-e770a087.js";
20
+ import { S as Zt } from "./CONTROLS-442caee5.js";
21
+ import { a as Ye, b as We, c as Ze, A as _t } from "./accordion-c0176dc5.js";
22
+ import { S as zt } from "./scroll-area-9f64a082.js";
23
+ import { S as Ut, c as Gt, b as Kt, d as qt, f as R } from "./select-7fddd7c3.js";
24
+ import "@radix-ui/react-tabs";
25
+ import "./utils-ac68b2c8.js";
26
+ import "clsx";
27
+ import "tailwind-merge";
28
+ import "i18next";
29
+ import "flagged";
30
+ import "react-dnd";
31
+ import "@minoru/react-dnd-treeview";
32
+ import "react-hotkeys-hook";
33
+ import "flat-to-nested";
34
+ import "redux-undo";
35
+ import "react-icons-picker";
36
+ import "react-dom";
37
+ import "./dialog-3d4e82ed.js";
38
+ import "@radix-ui/react-dialog";
39
+ import "./ImagesPanel-815d5e6f.js";
40
+ import "react-quill";
41
+ import "@radix-ui/react-slot";
42
+ import "class-variance-authority";
43
+ import "@radix-ui/react-tooltip";
44
+ import "@radix-ui/react-toast";
45
+ import "@radix-ui/react-label";
46
+ import "@radix-ui/react-accordion";
47
+ import "@radix-ui/react-scroll-area";
48
+ import "@radix-ui/react-select";
49
+ function Jt() {
50
+ const r = oe(), { createSnapshot: o } = De(), t = Me(), [l] = St(), s = Ot(r._type), n = c(s, "props", {}), d = {
51
+ type: "object",
52
+ properties: {
53
+ _name: {
54
+ title: "Name",
55
+ type: "string",
56
+ default: c(r, "_name", r._type)
57
+ }
58
+ }
59
+ }, i = {};
60
+ Object.keys(n).forEach((u) => {
61
+ const m = n[u];
62
+ if (P(["slot", "styles"], m.type))
63
+ return;
64
+ const h = c(m, "i18n", !1) ? `${u}-${l}` : u;
65
+ d.properties[h] = Rt(m, l), i[h] = Tt(m, l);
66
+ });
67
+ const a = { ...r }, x = ({ formData: u }, m) => {
68
+ if (m) {
69
+ const h = m.replace("root.", "");
70
+ t([r._id], { [h]: c(u, h) });
71
+ }
72
+ }, g = () => {
73
+ o();
74
+ };
75
+ return /* @__PURE__ */ e.jsxs("div", { children: [
76
+ /* @__PURE__ */ e.jsx(
77
+ kt,
78
+ {
79
+ widgets: {
80
+ richtext: $t,
81
+ icon: Lt,
82
+ image: It
83
+ },
84
+ fields: {
85
+ link: Dt
86
+ },
87
+ idSeparator: ".",
88
+ autoComplete: "off",
89
+ omitExtraData: !1,
90
+ liveOmit: !1,
91
+ liveValidate: !0,
92
+ uiSchema: i,
93
+ onBlur: g,
94
+ schema: d,
95
+ formData: a,
96
+ validator: Nt,
97
+ onChange: x
98
+ }
99
+ ),
100
+ /* @__PURE__ */ e.jsx("div", { className: "pb-60" })
101
+ ] });
102
+ }
103
+ const Ce = new Ft(Xt, {
104
+ isCaseSensitive: !1,
105
+ threshold: 0.2,
106
+ minMatchCharLength: 2,
107
+ keys: ["name"]
108
+ });
109
+ function Qt() {
110
+ var B;
111
+ const [r] = ge(), o = oe(), t = Oe(), l = Ee(), [s] = Pe(), [n, d] = S(""), i = (B = Se(r)) == null ? void 0 : B.prop, a = qe((c(o, i, "").replace(Zt, "").split(",").pop() || "").split(" "), w), x = () => {
112
+ const v = n.trim().toLowerCase().replace(/ +(?= )/g, "").split(" ");
113
+ t(s, v, !0), d("");
114
+ }, [g, u] = S([]), m = ({ value: v }) => {
115
+ const D = v.trim().toLowerCase(), A = D.match(/.+:/g);
116
+ let C = [];
117
+ if (A && A.length > 0) {
118
+ const [$] = A, F = D.replace($, "");
119
+ C = Ce.search(F).map((p) => ({
120
+ ...p,
121
+ item: { ...p.item, name: $ + p.item.name }
122
+ }));
123
+ } else
124
+ C = Ce.search(D);
125
+ u(V(C, "item"));
126
+ }, h = () => {
127
+ u([]);
128
+ }, y = (v) => v.name, f = (v) => /* @__PURE__ */ e.jsx("div", { className: "rounded-md p-1", children: v.name }), O = {
129
+ autoComplete: "off",
130
+ autoCorrect: "off",
131
+ autoCapitalize: "off",
132
+ spellCheck: !1,
133
+ placeholder: "Enter class name",
134
+ value: n,
135
+ onKeyDown: (v) => {
136
+ v.key === "Enter" && n.trim() !== "" && x();
137
+ },
138
+ onChange: (v, { newValue: D }) => d(D),
139
+ className: "w-full rounded-md text-xs px-2 hover:outline-0 bg-background border-border py-1"
140
+ };
141
+ return /* @__PURE__ */ e.jsxs(
142
+ "div",
143
+ {
144
+ className: `no-scrollbar flex ${g.length > 0 ? "min-h-[300px]" : "min-h-max"} w-full flex-col gap-y-5 overflow-y-auto bg-gray-100 px-px`,
145
+ children: [
146
+ /* @__PURE__ */ e.jsx(xe, { className: "mt-2", children: "Add Tailwind classes" }),
147
+ /* @__PURE__ */ e.jsxs("div", { className: "relative -mt-4 flex items-center gap-x-3", children: [
148
+ /* @__PURE__ */ e.jsx("div", { className: "relative flex w-full items-center gap-x-3", children: /* @__PURE__ */ e.jsx(
149
+ Pt,
150
+ {
151
+ suggestions: g,
152
+ onSuggestionsFetchRequested: m,
153
+ onSuggestionsClearRequested: h,
154
+ getSuggestionValue: y,
155
+ renderSuggestion: f,
156
+ inputProps: O,
157
+ containerProps: {
158
+ className: "relative h-8 w-full gap-y-1 py-1 border-gray-600"
159
+ },
160
+ theme: {
161
+ suggestion: "bg-transparent",
162
+ suggestionHighlighted: "bg-gray-700 ",
163
+ suggestionsContainerOpen: "absolute bg-gray-100 z-50 max-h-[230px] overflow-y-auto w-full border border-gray-600 rounded-md"
164
+ }
165
+ }
166
+ ) }),
167
+ /* @__PURE__ */ e.jsx(
168
+ Xe,
169
+ {
170
+ variant: "outline",
171
+ className: "h-6 border-gray-700",
172
+ onClick: x,
173
+ disabled: n.trim() === "",
174
+ size: "sm",
175
+ children: /* @__PURE__ */ e.jsx(pe, {})
176
+ }
177
+ )
178
+ ] }),
179
+ /* @__PURE__ */ e.jsxs("div", { className: "flex w-full flex-wrap gap-2", children: [
180
+ w(a) && /* @__PURE__ */ e.jsx("div", { className: "flex h-10 w-full items-center justify-center text-center text-sm text-gray-400", children: "No class added" }),
181
+ le.Children.toArray(
182
+ a.map((v) => /* @__PURE__ */ e.jsxs(
183
+ "div",
184
+ {
185
+ className: "group relative flex cursor-default items-center gap-x-1 rounded-full border border-blue-600 bg-blue-500 p-px px-1.5 text-[11px] text-white hover:border-blue-900",
186
+ children: [
187
+ v,
188
+ /* @__PURE__ */ e.jsx(
189
+ Ae,
190
+ {
191
+ onClick: () => l(s, [v]),
192
+ className: "invisible absolute right-1 hover:text-white group-hover:visible group-hover:cursor-pointer"
193
+ }
194
+ )
195
+ ]
196
+ },
197
+ v
198
+ ))
199
+ )
200
+ ] })
201
+ ]
202
+ }
203
+ );
204
+ }
205
+ const T = ["px", "%", "em", "rem", "ch", "vh", "vw"], er = {
206
+ heading: "Flex Child",
207
+ items: [
208
+ { type: "arbitrary", label: "Basis", units: T, property: "flexBasis" },
209
+ { type: "range", label: "Order", property: "order" },
210
+ { type: "dropdown", label: "Flex", property: "flexGrowShrink" },
211
+ { type: "dropdown", label: "Grow", property: "flexGrow" },
212
+ { type: "dropdown", label: "Shrink", property: "flexShrink" }
213
+ ]
214
+ }, tr = {
215
+ heading: "Grid Child",
216
+ items: [
217
+ { type: "range", label: "Col Span", property: "gridColSpan" },
218
+ { type: "range", label: "Col Start", property: "gridColStart" },
219
+ { type: "range", label: "Col End", property: "gridColEnd" },
220
+ { type: "range", label: "Row Span", property: "gridRowSpan" },
221
+ { type: "range", label: "Row Start", property: "gridRowStart" },
222
+ { type: "range", label: "Row End", property: "gridRowEnd" },
223
+ { type: "range", label: "Order", property: "order" }
224
+ ]
225
+ }, rr = [
226
+ {
227
+ heading: "Display",
228
+ items: [
229
+ { type: "dropdown", label: "Display", property: "display", units: T },
230
+ {
231
+ styleType: "accordion",
232
+ heading: "Flex options",
233
+ items: [
234
+ { type: "dropdown", label: "Direction", property: "flexDirection" },
235
+ { type: "dropdown", label: "Wrap", property: "flexWrap" },
236
+ { type: "dropdown", label: "Justify", property: "justifyContent" },
237
+ { type: "dropdown", label: "Content", property: "alignContent" },
238
+ { type: "dropdown", label: "Items", property: "alignItems" },
239
+ {
240
+ styleType: "multiple",
241
+ label: "Gap",
242
+ options: [
243
+ { key: "gap", label: "All" },
244
+ { key: "gapX", label: "Left-Right" },
245
+ { key: "gapY", label: "Top-Bottom" }
246
+ ]
247
+ }
248
+ ],
249
+ conditions: { display: "flex" }
250
+ },
251
+ {
252
+ styleType: "accordion",
253
+ heading: "Grid options",
254
+ items: [
255
+ { type: "range", label: "Columns", property: "gridColumns" },
256
+ { type: "range", label: "Rows", property: "gridRows" },
257
+ { type: "dropdown", label: "Auto Flow", property: "gridAutoFlow" },
258
+ { type: "dropdown", label: "Auto Cols", property: "gridAutoColumns" },
259
+ { type: "dropdown", label: "Auto Rows", property: "gridAutoRows" },
260
+ { type: "dropdown", label: "Justify", property: "justifyContent" },
261
+ { type: "dropdown", label: "Content", property: "alignContent" },
262
+ { type: "dropdown", label: "Items", property: "alignItems" },
263
+ {
264
+ styleType: "multiple",
265
+ label: "Gap",
266
+ units: ["px", "rem"],
267
+ options: [
268
+ { key: "gap", label: "All" },
269
+ { key: "gapX", label: "Left-Right" },
270
+ { key: "gapY", label: "Top-Bottom" }
271
+ ]
272
+ }
273
+ ],
274
+ conditions: { display: "grid" }
275
+ },
276
+ {
277
+ styleType: "accordion",
278
+ heading: "Visibility & Opacity",
279
+ items: [
280
+ { type: "dropdown", label: "Visibility", property: "visibility", units: T },
281
+ { type: "arbitrary", label: "Opacity", property: "opacity", units: ["-"] }
282
+ ]
283
+ }
284
+ ]
285
+ },
286
+ {
287
+ heading: "Spacing",
288
+ items: [
289
+ {
290
+ styleType: "multiple",
291
+ label: "Margin",
292
+ negative: !0,
293
+ units: [...T, "auto"],
294
+ options: [
295
+ { key: "margin", label: "All" },
296
+ { key: "marginX", label: "Left-Right" },
297
+ { key: "marginY", label: "Top-Bottom" },
298
+ { key: "marginTop", label: "Top" },
299
+ { key: "marginRight", label: "Right" },
300
+ { key: "marginBottom", label: "Bottom" },
301
+ { key: "marginLeft", label: "Left" }
302
+ ]
303
+ },
304
+ {
305
+ styleType: "multiple",
306
+ label: "Padding",
307
+ options: [
308
+ { key: "padding", label: "All" },
309
+ { key: "paddingX", label: "Left-Right" },
310
+ { key: "paddingY", label: "Top-Bottom" },
311
+ { key: "paddingTop", label: "Top" },
312
+ { key: "paddingRight", label: "Right" },
313
+ { key: "paddingBottom", label: "Bottom" },
314
+ { key: "paddingLeft", label: "Left" }
315
+ ]
316
+ },
317
+ {
318
+ styleType: "multiple",
319
+ label: "Space Between",
320
+ options: [
321
+ { key: "spaceX", label: "Left-Right" },
322
+ { key: "spaceY", label: "Top-Bottom" }
323
+ ]
324
+ }
325
+ ]
326
+ },
327
+ {
328
+ heading: "Size",
329
+ items: [
330
+ { type: "arbitrary", label: "Width", units: T.concat("auto"), property: "width" },
331
+ { type: "arbitrary", label: "Height", units: T.concat("auto"), property: "height" },
332
+ {
333
+ styleType: "accordion",
334
+ heading: "Min width & height",
335
+ items: [
336
+ { type: "arbitrary", label: "Min Width", units: T.concat("auto"), property: "minWidth" },
337
+ { type: "arbitrary", label: "Min Height", units: T.concat("auto"), property: "minHeight" }
338
+ ]
339
+ },
340
+ {
341
+ styleType: "accordion",
342
+ heading: "Max width & height",
343
+ items: [
344
+ { type: "arbitrary", label: "Max Width", units: T.concat("auto"), property: "maxWidth" },
345
+ { type: "arbitrary", label: "Max Height", units: T.concat("auto"), property: "maxHeight" }
346
+ ]
347
+ },
348
+ {
349
+ styleType: "accordion",
350
+ heading: "Object options & aspect ratio",
351
+ items: [
352
+ { type: "dropdown", label: "Aspect", property: "aspectRatio" },
353
+ { type: "dropdown", label: "Fit", property: "objectFit" },
354
+ { type: "dropdown", label: "Position", property: "objectPosition" }
355
+ ]
356
+ }
357
+ ]
358
+ },
359
+ {
360
+ heading: "Position",
361
+ items: [
362
+ { type: "icons", label: "Position", property: "position" },
363
+ {
364
+ styleType: "accordion",
365
+ heading: "Position options",
366
+ items: [
367
+ {
368
+ styleType: "multiple",
369
+ label: "Direction",
370
+ options: [
371
+ { key: "top", label: "Top" },
372
+ { key: "right", label: "Right" },
373
+ { key: "bottom", label: "Bottom" },
374
+ { key: "left", label: "Left" }
375
+ ]
376
+ },
377
+ {
378
+ styleType: "multiple",
379
+ label: "Inset",
380
+ options: [
381
+ { key: "inset", label: "All" },
382
+ { key: "insetX", label: "Left Right" },
383
+ { key: "insetY", label: "Top Bottom" }
384
+ ]
385
+ },
386
+ { type: "arbitrary", label: "Z-Chai", units: ["-", "auto"], property: "zIndex" }
387
+ ]
388
+ },
389
+ {
390
+ styleType: "accordion",
391
+ heading: "Float & Clear",
392
+ items: [
393
+ { type: "icons", label: "Float", property: "float" },
394
+ { type: "dropdown", label: "Clear", property: "clear" }
395
+ ]
396
+ },
397
+ {
398
+ styleType: "accordion",
399
+ heading: "Overflow & Overscroll",
400
+ items: [
401
+ {
402
+ styleType: "multiple",
403
+ type: "dropdown",
404
+ label: "Overflow",
405
+ options: [
406
+ { key: "overflow", label: "All" },
407
+ { key: "overflowX", label: "Left-Right" },
408
+ { key: "overflowY", label: "Top-Bottom" }
409
+ ]
410
+ },
411
+ {
412
+ styleType: "multiple",
413
+ type: "dropdown",
414
+ label: "Overscroll",
415
+ options: [
416
+ { key: "overscroll", label: "All" },
417
+ { key: "overscrollX", label: "Left-Right" },
418
+ { key: "overscrollY", label: "Top-Bottom" }
419
+ ]
420
+ }
421
+ ]
422
+ }
423
+ ]
424
+ },
425
+ {
426
+ heading: "Typography",
427
+ items: [
428
+ { type: "dropdown", property: "fontFamily", label: "Font" },
429
+ { type: "arbitrary", property: "fontSize", label: "Size", units: T },
430
+ { type: "arbitrary", property: "lineHeight", label: "Height", units: T.concat("-") },
431
+ { type: "range", property: "fontWeight", label: "Weight" },
432
+ { type: "color", property: "textColor", label: "Color" },
433
+ {
434
+ styleType: "accordion",
435
+ heading: "Alignments",
436
+ items: [
437
+ { type: "dropdown", property: "textAlign", label: "Align" },
438
+ { type: "dropdown", property: "verticalAlign", label: "V. Align" }
439
+ ]
440
+ },
441
+ {
442
+ styleType: "accordion",
443
+ heading: "Spacing, decoration & more",
444
+ items: [
445
+ { type: "dropdown", property: "letterSpacing", label: "Spacing" },
446
+ { type: "dropdown", property: "textDecoration", label: "Decoration" },
447
+ { type: "range", property: "textDecorationThickness", label: "Thickness" },
448
+ { type: "dropdown", property: "textTransform", label: "Transform" }
449
+ ]
450
+ },
451
+ {
452
+ styleType: "accordion",
453
+ heading: "White space & breaks",
454
+ items: [
455
+ { type: "dropdown", property: "whitespace", label: "Whitespace" },
456
+ { type: "dropdown", property: "wordBreak", label: "Wordbreak" }
457
+ ]
458
+ }
459
+ ]
460
+ },
461
+ {
462
+ heading: "Background",
463
+ items: [
464
+ { type: "color", label: "Bg. Color", property: "backgroundColor" },
465
+ {
466
+ styleType: "accordion",
467
+ heading: "Position, Size & more",
468
+ items: [
469
+ { type: "dropdown", label: "Attachment", property: "backgroundAttachment" },
470
+ { type: "dropdown", label: "Clipping", property: "backgroundClip" },
471
+ { type: "dropdown", label: "Origin", property: "backgroundOrigin" },
472
+ { type: "dropdown", label: "Position", property: "backgroundPosition" },
473
+ { type: "dropdown", label: "Repeat", property: "backgroundRepeat" },
474
+ { type: "dropdown", label: "Size", property: "backgroundSize" }
475
+ ]
476
+ },
477
+ { type: "dropdown", label: "Gradient", property: "backgroundGradient" },
478
+ {
479
+ styleType: "accordion",
480
+ heading: "Gradient colors",
481
+ items: [
482
+ { type: "color", label: "From", property: "fromColor" },
483
+ { type: "color", label: "Via", property: "viaColor" },
484
+ { type: "color", label: "To", property: "toColor" }
485
+ ]
486
+ }
487
+ ]
488
+ },
489
+ {
490
+ heading: "Border & Outline",
491
+ items: [
492
+ {
493
+ styleType: "multiple",
494
+ type: "dropdown",
495
+ label: "Width",
496
+ options: [
497
+ { key: "border", label: "All" },
498
+ { key: "borderX", label: "Left Right" },
499
+ { key: "borderY", label: "Top bottom" },
500
+ { key: "borderTop", label: "Top" },
501
+ { key: "borderRight", label: "Right" },
502
+ { key: "borderBottom", label: "Bottom" },
503
+ { key: "borderLeft", label: "Left" }
504
+ ]
505
+ },
506
+ {
507
+ styleType: "multiple",
508
+ type: "dropdown",
509
+ label: "Corners",
510
+ options: [
511
+ { key: "borderRadius", label: "All" },
512
+ { key: "borderRadiusTop", label: "Top" },
513
+ { key: "borderRadiusRight", label: "Right" },
514
+ { key: "borderRadiusBottom", label: "Bottom" },
515
+ { key: "borderRadiusLeft", label: "Left" },
516
+ { key: "borderRadiusTopLeft", label: "Top Left" },
517
+ { key: "borderRadiusTopRight", label: "Top right" },
518
+ { key: "borderRadiusBottomRight", label: "Bottom right" },
519
+ { key: "borderRadiusBottomLeft", label: "Bottom left" }
520
+ ]
521
+ },
522
+ { type: "color", label: "Color", property: "borderColor" },
523
+ { type: "dropdown", label: "Style", property: "borderStyle" },
524
+ {
525
+ styleType: "accordion",
526
+ heading: "Divide options",
527
+ items: [
528
+ {
529
+ styleType: "multiple",
530
+ type: "range",
531
+ label: "Width",
532
+ options: [
533
+ { key: "divideXWidth", label: "Left Right" },
534
+ { key: "divideYWidth", label: "Top Bottom" }
535
+ ]
536
+ },
537
+ { type: "color", label: "Color", property: "divideColor" },
538
+ { type: "dropdown", label: "Style", property: "divideStyle" }
539
+ ]
540
+ },
541
+ {
542
+ styleType: "accordion",
543
+ heading: "Outline styling",
544
+ items: [
545
+ { type: "range", label: "Width", property: "outlineWidth" },
546
+ { type: "range", label: "Offset", property: "outlineOffset" },
547
+ { type: "dropdown", label: "Style", property: "outlineStyle" }
548
+ ]
549
+ },
550
+ {
551
+ styleType: "accordion",
552
+ heading: "Ring options",
553
+ items: [
554
+ { type: "range", label: "Width", property: "ringWidth" },
555
+ { type: "color", label: "Color", property: "ringColor" },
556
+ { type: "range", label: "Offset", property: "ringOffsetWidth" },
557
+ { type: "color", label: "Off. color", property: "ringOffsetColor" }
558
+ ]
559
+ }
560
+ ]
561
+ },
562
+ {
563
+ heading: "Effect & Animation",
564
+ items: [
565
+ { type: "range", label: "Shadow", property: "boxShadow" },
566
+ { type: "color", label: "Color", property: "boxShadowColor" },
567
+ { type: "dropdown", label: "Cursor", property: "cursor" },
568
+ {
569
+ styleType: "accordion",
570
+ heading: "Blend & Cursor",
571
+ items: [
572
+ { type: "dropdown", label: "Mix Blend", property: "mixBlendMode" },
573
+ { type: "dropdown", label: "Bg. Blend", property: "bgBlendMode" }
574
+ ]
575
+ },
576
+ {
577
+ styleType: "accordion",
578
+ heading: "Transform",
579
+ items: [
580
+ { type: "dropdown", label: "Origin", property: "transformOrigin" },
581
+ {
582
+ styleType: "multiple",
583
+ label: "Scale",
584
+ units: ["-"],
585
+ options: [
586
+ { key: "scale", label: "All" },
587
+ { key: "scaleX", label: "Left-Right" },
588
+ { key: "scaleY", label: "Top-Bottom" }
589
+ ]
590
+ },
591
+ {
592
+ styleType: "multiple",
593
+ label: "Skew",
594
+ units: ["deg"],
595
+ options: [
596
+ { key: "skewX", label: "Left-Right" },
597
+ { key: "skewY", label: "Top-Bottom" }
598
+ ]
599
+ },
600
+ {
601
+ styleType: "multiple",
602
+ label: "Translate",
603
+ negative: !0,
604
+ options: [
605
+ { key: "translateX", label: "Left-Right" },
606
+ { key: "translateY", label: "Top-Bottom" }
607
+ ]
608
+ },
609
+ { type: "arbitrary", units: ["deg"], negative: !0, label: "Rotate", property: "rotate" }
610
+ ]
611
+ },
612
+ {
613
+ styleType: "accordion",
614
+ heading: "Animation",
615
+ items: [
616
+ { type: "dropdown", label: "Animation", property: "animation" },
617
+ { type: "dropdown", label: "Transition", property: "transition" },
618
+ { type: "dropdown", label: "Easing", property: "transitionEase" },
619
+ { type: "arbitrary", units: ["ms"], label: "Duration", property: "duration" },
620
+ { type: "arbitrary", units: ["ms"], label: "Delay", property: "delay" }
621
+ ]
622
+ }
623
+ ]
624
+ },
625
+ {
626
+ heading: "Classes",
627
+ items: [{ component: Qt }]
628
+ }
629
+ ], _e = {
630
+ "not-italic": () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M9 3H11V5H9V11H11V13H5V11H7V5H5V3H9Z", fill: "white" }) }),
631
+ // visibility
632
+ visible: st,
633
+ invisible: be,
634
+ // display
635
+ hidden: be,
636
+ gap: M,
637
+ gapX: k,
638
+ gapY: N,
639
+ spaceX: k,
640
+ spaceY: N,
641
+ overscroll: M,
642
+ overscrollX: k,
643
+ overscrollY: N,
644
+ overflow: M,
645
+ overflowX: k,
646
+ overflowY: N,
647
+ top: U,
648
+ right: G,
649
+ bottom: K,
650
+ left: q,
651
+ inset: M,
652
+ insetX: k,
653
+ insetY: N,
654
+ border: M,
655
+ borderX: k,
656
+ borderY: N,
657
+ borderTop: U,
658
+ borderRight: G,
659
+ borderBottom: K,
660
+ borderLeft: q,
661
+ borderRadius: M,
662
+ borderRadiusX: k,
663
+ borderRadiusY: N,
664
+ borderRadiusTop: U,
665
+ borderRadiusRight: G,
666
+ borderRadiusBottom: K,
667
+ borderRadiusLeft: q,
668
+ borderRadiusTopLeft: at,
669
+ borderRadiusTopRight: nt,
670
+ borderRadiusBottomRight: it,
671
+ borderRadiusBottomLeft: dt,
672
+ divideXWidth: k,
673
+ divideYWidth: N,
674
+ scale: M,
675
+ scaleX: k,
676
+ scaleY: N,
677
+ skewX: k,
678
+ skewY: N,
679
+ translateX: k,
680
+ translateY: N,
681
+ // padding
682
+ padding: M,
683
+ paddingX: k,
684
+ paddingY: N,
685
+ paddingTop: U,
686
+ paddingRight: G,
687
+ paddingBottom: K,
688
+ paddingLeft: q,
689
+ // margin
690
+ margin: M,
691
+ marginX: k,
692
+ marginY: N,
693
+ marginTop: U,
694
+ marginRight: G,
695
+ marginBottom: K,
696
+ marginLeft: q,
697
+ // text-align
698
+ textLeft: ct,
699
+ textCenter: pt,
700
+ textRight: ut,
701
+ textJustify: gt,
702
+ // font style
703
+ italic: xt,
704
+ // "not-italic": "",
705
+ // decoration
706
+ underline: yt,
707
+ overline: ht,
708
+ // transform
709
+ uppercase: mt,
710
+ block: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
711
+ /* @__PURE__ */ e.jsx(
712
+ "path",
713
+ {
714
+ opacity: "0.6",
715
+ fillRule: "evenodd",
716
+ clipRule: "evenodd",
717
+ d: "M2 2H14V14H2V2ZM1 1H15V15H1V1Z",
718
+ fill: "currentColor"
719
+ }
720
+ ),
721
+ /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M7 4H4V12H7V4ZM9 4H12V12H9V4Z", fill: "currentColor" })
722
+ ] }),
723
+ // floats
724
+ "float-right": () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
725
+ /* @__PURE__ */ e.jsx("path", { d: "M8 4H16V12H8V4Z", fill: "currentColor" }),
726
+ /* @__PURE__ */ e.jsx(
727
+ "path",
728
+ {
729
+ opacity: "0.6",
730
+ fillRule: "evenodd",
731
+ clipRule: "evenodd",
732
+ d: "M0 4H6V6H0V4ZM0 7H6V9H0V7ZM4 10H0V12H4V10Z",
733
+ fill: "currentColor"
734
+ }
735
+ )
736
+ ] }),
737
+ "float-left": () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
738
+ /* @__PURE__ */ e.jsx("path", { d: "M0 4H8V12H0V4Z", fill: "currentColor" }),
739
+ /* @__PURE__ */ e.jsx(
740
+ "path",
741
+ {
742
+ opacity: "0.6",
743
+ fillRule: "evenodd",
744
+ clipRule: "evenodd",
745
+ d: "M10 4H16V6H10V4ZM10 7H16V9H10V7ZM14 10H10V12H14V10Z",
746
+ fill: "currentColor"
747
+ }
748
+ )
749
+ ] }),
750
+ "float-none": Ae,
751
+ // position
752
+ fixed: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
753
+ /* @__PURE__ */ e.jsx(
754
+ "path",
755
+ {
756
+ opacity: "0.6",
757
+ fillRule: "evenodd",
758
+ clipRule: "evenodd",
759
+ d: "M15 2H14V4H13V5H14V6H15V2ZM10 5V4H9V2H1V8H2V5H10ZM7 4V3H5V4H7ZM4 4V3H2V4H4ZM1 13H7V14H1V13Z",
760
+ fill: "currentColor"
761
+ }
762
+ ),
763
+ /* @__PURE__ */ e.jsx(
764
+ "path",
765
+ {
766
+ fillRule: "evenodd",
767
+ clipRule: "evenodd",
768
+ d: "M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",
769
+ fill: "currentColor"
770
+ }
771
+ )
772
+ ] }),
773
+ absolute: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
774
+ /* @__PURE__ */ e.jsx(
775
+ "path",
776
+ {
777
+ opacity: "0.6",
778
+ fillRule: "evenodd",
779
+ clipRule: "evenodd",
780
+ d: "M14 2H15V6H14V2ZM9 3V2H1V8H2V3H9ZM7 13H1V14H7V13Z",
781
+ fill: "currentColor"
782
+ }
783
+ ),
784
+ /* @__PURE__ */ e.jsx(
785
+ "path",
786
+ {
787
+ fillRule: "evenodd",
788
+ clipRule: "evenodd",
789
+ d: "M11 2H10V3H11V6H12V3H13V2H11ZM2 9H1V12H2V11H7V10H2V9ZM15 7H8V14H15V7Z",
790
+ fill: "currentColor"
791
+ }
792
+ )
793
+ ] }),
794
+ relative: () => /* @__PURE__ */ e.jsx("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ e.jsx(
795
+ "path",
796
+ {
797
+ fillRule: "evenodd",
798
+ clipRule: "evenodd",
799
+ d: "M11 2H9V3H11V6H12V3H14V2H11ZM2 8H1V13H2V11H7V10H2V8ZM15 7H8V14H15V7Z",
800
+ fill: "currentColor"
801
+ }
802
+ ) }),
803
+ sticky: () => /* @__PURE__ */ e.jsxs("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
804
+ /* @__PURE__ */ e.jsx(
805
+ "path",
806
+ {
807
+ d: "M12.9998 7C13.6558 7 14.2937 6.78498 14.8158 6.38787C15.338 5.99076 15.7156 5.43345 15.8908 4.80128C16.066 4.16912 16.0292 3.49694 15.7859 2.8877C15.5427 2.27846 15.1065 1.76573 14.5441 1.42804C13.9817 1.09034 13.3241 0.946293 12.672 1.01795C12.02 1.08961 11.4094 1.37303 10.9337 1.8248C10.4581 2.27658 10.1436 2.8718 10.0385 3.51932C9.93341 4.16685 10.0434 4.83097 10.3518 5.41L6.88176 8.88C6.80034 8.96122 6.73572 9.05769 6.69158 9.16388C6.64744 9.27008 6.62465 9.38393 6.62451 9.49894C6.62437 9.61395 6.64689 9.72785 6.69077 9.83416C6.73465 9.94046 6.79904 10.0371 6.88026 10.1185C6.96149 10.1999 7.05795 10.2645 7.16415 10.3087C7.27035 10.3528 7.3842 10.3756 7.4992 10.3758C7.61421 10.3759 7.72812 10.3534 7.83442 10.3095C7.94072 10.2656 8.03734 10.2012 8.11876 10.12L11.5888 6.648C12.0088 6.873 12.4888 7 12.9988 7H12.9998Z",
808
+ fill: "currentColor"
809
+ }
810
+ ),
811
+ /* @__PURE__ */ e.jsx(
812
+ "path",
813
+ {
814
+ opacity: "0.6",
815
+ fillRule: "evenodd",
816
+ clipRule: "evenodd",
817
+ d: "M9.535 2H1V14H15V7.465C14.69 7.645 14.355 7.783 14 7.875V13H2V5H9.126C8.86504 3.98486 9.01223 2.90789 9.536 2H9.535ZM7 3V4H5V3H7ZM4 3V4H2V3H4Z",
818
+ fill: "currentColor"
819
+ }
820
+ )
821
+ ] }),
822
+ static: bt
823
+ }, ee = Ne({ canReset: !1, canChange: !0 }), lr = ({ children: r, canReset: o = !1, canChange: t = !0 }) => (
824
+ // eslint-disable-next-line react/jsx-no-constructed-context-values
825
+ /* @__PURE__ */ e.jsx(ee.Provider, { value: { canReset: o, canChange: t }, children: r })
826
+ ), ze = ({ label: r, property: o, onChange: t }) => {
827
+ const l = H(() => c(ae, `${o}.classes`, [""]), [o]), s = te(o), n = H(() => c(s, "cls", ""), [s]), { canChange: d } = Q(ee), i = /\[.*\]/g.test(n);
828
+ return /* @__PURE__ */ e.jsx("div", { className: r ? "w-full rounded " : "grow", children: i ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center", children: [
829
+ /* @__PURE__ */ e.jsx(Mt, { className: "w-[70%] rounded py-1", readOnly: !0, value: n }),
830
+ /* @__PURE__ */ e.jsxs(W, { delayDuration: 100, children: [
831
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(ue, {}) }) }),
832
+ /* @__PURE__ */ e.jsx(_, { children: "Current value is using a Tailwind arbitrary value." })
833
+ ] })
834
+ ] }) : /* @__PURE__ */ e.jsx(
835
+ ce,
836
+ {
837
+ rounded: r,
838
+ onChange: (a) => t(a, o),
839
+ selected: n,
840
+ options: l,
841
+ disabled: !d
842
+ }
843
+ ) });
844
+ };
845
+ function ce({ selected: r, onChange: o, rounded: t = !1, options: l, disabled: s = !1 }) {
846
+ const n = r.replace(/.*:/g, "").trim(), { undo: d, redo: i } = De();
847
+ return /* @__PURE__ */ e.jsxs(
848
+ "select",
849
+ {
850
+ disabled: !l.length || s,
851
+ className: `${t ? "rounded-md border border-border" : "border-0"} w-full disable:bg-gray-500 h-full truncate rounded bg-background px-2 py-1 text-xs outline-none disabled:cursor-not-allowed`,
852
+ onChange: (a) => o(a.target.value),
853
+ onKeyDown: (a) => {
854
+ a.ctrlKey && (a.key === "z" && d(), a.key === "y" && i());
855
+ },
856
+ value: n,
857
+ children: [
858
+ /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: "" }),
859
+ L.Children.toArray(
860
+ l.map((a) => /* @__PURE__ */ e.jsx("option", { className: "bg-transparent", value: a, children: a }))
861
+ )
862
+ ]
863
+ }
864
+ );
865
+ }
866
+ const or = ({ property: r, onChange: o }) => {
867
+ const { canReset: t, canChange: l } = Q(ee), s = te(r), n = H(() => c(s, "cls", ""), [s]), d = H(() => c(ae, `${r}.classes`, [""]), [r]), i = d.indexOf(n) > -1 ? d.indexOf(n) : 0, a = /\[.*\]/g.test(n);
868
+ return /* @__PURE__ */ e.jsx("div", { className: "flex flex-row divide-x divide-solid divide-border rounded border border-border text-xs", children: a ? /* @__PURE__ */ e.jsx("div", { className: "py-[5px] px-2", children: n }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
869
+ /* @__PURE__ */ e.jsx(
870
+ "button",
871
+ {
872
+ type: "button",
873
+ className: "box-border w-2/12 rounded-tl rounded-bl bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
874
+ disabled: !l && (!t || i - 1 < 0),
875
+ onClick: () => o(he(d, i - 1), r),
876
+ children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(ft, { className: !l && (!t || i - 1 < 0) ? "text-gray-500" : "text-white/60" }) })
877
+ }
878
+ ),
879
+ /* @__PURE__ */ e.jsx("div", { className: "w-8/12 text-center", children: /* @__PURE__ */ e.jsx(ze, { label: !1, property: r, onChange: o }) }),
880
+ /* @__PURE__ */ e.jsx(
881
+ "button",
882
+ {
883
+ type: "button",
884
+ className: "w-2/12 rounded-tr rounded-br bg-background px-1 text-center hover:bg-bg-gray-700 disabled:cursor-not-allowed disabled:bg-gray-600",
885
+ disabled: !l && (!t || i + 1 >= d.length),
886
+ onClick: () => o(he(d, i + 1), r),
887
+ children: /* @__PURE__ */ e.jsx("span", { className: "flex items-center justify-center", children: /* @__PURE__ */ e.jsx(
888
+ pe,
889
+ {
890
+ className: !l && (!t || i + 1 >= d.length) ? "text-gray-500" : "text-white/60"
891
+ }
892
+ ) })
893
+ }
894
+ )
895
+ ] }) });
896
+ }, sr = ({ property: r, onChange: o }) => {
897
+ const t = H(() => c(ae, `${r}.classes`, [""]), [r]), { canChange: l } = Q(ee), s = te(r), n = H(() => c(s, "cls", ""), [s]);
898
+ return /* @__PURE__ */ e.jsx("div", { className: "flex grow flex-wrap gap-1", children: V(t, (d) => /* @__PURE__ */ e.jsxs(W, { children: [
899
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
900
+ "button",
901
+ {
902
+ type: "button",
903
+ disabled: !l,
904
+ onClick: () => o(d, r),
905
+ className: `cursor-pointer rounded border border-gray-600 p-1 disabled:cursor-not-allowed ${n === d ? " bg-blue-500 text-white" : "disabled:bg-gray-600 disabled:text-gray-400"}`,
906
+ children: L.createElement(c(_e, d, $e))
907
+ }
908
+ ) }),
909
+ /* @__PURE__ */ e.jsx(_, { children: Re(Te(d)) })
910
+ ] })) });
911
+ }, ar = {
912
+ backgroundColor: "bg",
913
+ textColor: "text",
914
+ borderColor: "border",
915
+ boxShadowColor: "shadow",
916
+ outlineColor: "outline",
917
+ divideColor: "divide",
918
+ fromColor: "from",
919
+ viaColor: "via",
920
+ toColor: "to",
921
+ ringColor: "ring",
922
+ ringOffsetColor: "ring-offset"
923
+ }, nr = ({ property: r, onChange: o }) => {
924
+ const t = te(r), l = H(() => c(t, "cls", ""), [t]), { canChange: s } = Q(ee), [n, d] = S([]), [i, a] = S({ color: "", shade: "" }), x = l.split("-"), g = c(x, "1", ""), u = c(x, "2", ""), m = I(
925
+ // eslint-disable-next-line no-shadow
926
+ (y) => {
927
+ ["current", "inherit", "transparent", "black", "white"].includes(y) ? (d([]), a({ color: y })) : (d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]), a((f) => ({ ...f, color: y, shade: f.shade ? f.shade : "500" })));
928
+ },
929
+ [d, a]
930
+ );
931
+ J(() => {
932
+ if (["current", "inherit", "transparent", "black", "white"].includes(g))
933
+ return d([]);
934
+ d(["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"]);
935
+ }, [g]);
936
+ const h = I(
937
+ // eslint-disable-next-line no-shadow
938
+ (y) => {
939
+ a({ color: g, shade: y });
940
+ },
941
+ [g]
942
+ );
943
+ return J(() => {
944
+ a({ color: "", shade: "" });
945
+ }, [t]), J(() => {
946
+ const f = `${c(ar, r, "")}-${i.color}${i.shade ? `-${i.shade}` : ""}`;
947
+ f.match(new RegExp(c(ae, `${r}.regExp`, ""))) && o(f, r);
948
+ }, [i, o, r]), /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row divide-x divide-solid divide-border rounded-lg border border-border text-xs", children: [
949
+ /* @__PURE__ */ e.jsx("div", { className: "grow text-center", children: /* @__PURE__ */ e.jsx(
950
+ ce,
951
+ {
952
+ disabled: !s,
953
+ rounded: !0,
954
+ selected: g,
955
+ onChange: m,
956
+ options: [
957
+ "current",
958
+ "transparent",
959
+ "primary",
960
+ "secondary",
961
+ "black",
962
+ "white",
963
+ "slate",
964
+ "gray",
965
+ "zinc",
966
+ "neutral",
967
+ "stone",
968
+ "red",
969
+ "orange",
970
+ "amber",
971
+ "yellow",
972
+ "lime",
973
+ "green",
974
+ "emerald",
975
+ "teal",
976
+ "cyan",
977
+ "sky",
978
+ "blue",
979
+ "indigo",
980
+ "violet",
981
+ "purple",
982
+ "fuchsia",
983
+ "pink",
984
+ "rose"
985
+ ]
986
+ }
987
+ ) }),
988
+ /* @__PURE__ */ e.jsx("button", { type: "button", className: "grow text-center", children: /* @__PURE__ */ e.jsx(ce, { rounded: !0, selected: u, disabled: !g || !s, onChange: h, options: n }) })
989
+ ] });
990
+ }, je = (r, o) => {
991
+ r = r.toLowerCase();
992
+ let t = r.trim().replace(/ |\+/g, "");
993
+ if ((t === "auto" || t === "none") && o.includes(t))
994
+ return { value: "", unit: t };
995
+ const l = o.length ? new RegExp(o.join("|"), "g") : /XXXXXX/g;
996
+ t = t.replace(l, "");
997
+ const s = r.match(l), n = s && s.length > 1, d = !w(t) && Number.isNaN(Number(t));
998
+ return n || d ? { error: "Invalid value" } : s && (s[0] === "auto" || s[0] === "none") ? { value: s[0], unit: "" } : { value: t, unit: s ? s[0] : "" };
999
+ }, ir = (r) => {
1000
+ const o = r.startsWith("-") ? "-" : "", t = r.split("-").pop();
1001
+ if (["auto", "none"].includes(t))
1002
+ return { value: "", unit: t };
1003
+ if (t === "px")
1004
+ return { value: "1", unit: "px" };
1005
+ if (t === "screen")
1006
+ return { value: "100", unit: r.indexOf("w-") !== -1 ? "vw" : "vh" };
1007
+ if (t === "full")
1008
+ return { value: "100", unit: "%" };
1009
+ if (P(r, "skew-"))
1010
+ return { value: `${o}${t}`, unit: "deg" };
1011
+ if (P(r, "rotate-"))
1012
+ return { value: `${o}${t}`, unit: "deg" };
1013
+ if (P(r, "opacity-"))
1014
+ return { value: `${t / 100}`, unit: "-" };
1015
+ if (P(r, "duration-") || P(r, "delay-"))
1016
+ return { value: `${t}`, unit: "ms" };
1017
+ if (P(r, "translate-") && !t.includes("/"))
1018
+ return { value: `${o}${`${t / 4}`}`, unit: "rem" };
1019
+ if (P(r, "scale-"))
1020
+ return { value: `${o}${`${t / 100}`}`, unit: "-" };
1021
+ if (X(r, "border")) {
1022
+ const l = r.match(/border-?(x|y|t|r|b|l)?\d+/g);
1023
+ if (l)
1024
+ return { value: l[0].split("-").pop(), unit: "px" };
1025
+ if (r.match(/border-?(x|y|t|r|b|l)?/g))
1026
+ return { value: "1", unit: "px" };
1027
+ }
1028
+ if (X(r, "max-w-")) {
1029
+ if (r === "max-w-screen-sm")
1030
+ return { value: "640", unit: "px" };
1031
+ if (r === "max-w-screen-md")
1032
+ return { value: "768", unit: "px" };
1033
+ if (r === "max-w-screen-lg")
1034
+ return { value: "1024", unit: "px" };
1035
+ if (r === "max-w-screen-xl")
1036
+ return { value: "1280", unit: "px" };
1037
+ if (r === "max-w-screen-2xl")
1038
+ return { value: "1536", unit: "px" };
1039
+ if (t === "xs")
1040
+ return { value: "320", unit: "px" };
1041
+ if (t === "sm")
1042
+ return { value: "384", unit: "px" };
1043
+ if (t === "md")
1044
+ return { value: "448", unit: "px" };
1045
+ if (t === "lg")
1046
+ return { value: "512", unit: "px" };
1047
+ if (t === "xl")
1048
+ return { value: "576", unit: "px" };
1049
+ if (t === "2xl")
1050
+ return { value: "672", unit: "px" };
1051
+ if (t === "3xl")
1052
+ return { value: "768", unit: "px" };
1053
+ if (t === "4xl")
1054
+ return { value: "896", unit: "px" };
1055
+ if (t === "5xl")
1056
+ return { value: "1024", unit: "px" };
1057
+ if (t === "6xl")
1058
+ return { value: "1152", unit: "px" };
1059
+ if (t === "7xl")
1060
+ return { value: "1280", unit: "px" };
1061
+ if (t === "prose")
1062
+ return { value: "65", unit: "ch" };
1063
+ }
1064
+ if (X(r, "text-")) {
1065
+ if (t === "xs")
1066
+ return { value: "12", unit: "px" };
1067
+ if (t === "sm")
1068
+ return { value: "14", unit: "px" };
1069
+ if (t === "base")
1070
+ return { value: "16", unit: "px" };
1071
+ if (t === "lg")
1072
+ return { value: "18", unit: "px" };
1073
+ if (t === "xl")
1074
+ return { value: "20", unit: "px" };
1075
+ if (t === "2xl")
1076
+ return { value: "24", unit: "px" };
1077
+ if (t === "3xl")
1078
+ return { value: "30", unit: "px" };
1079
+ if (t === "4xl")
1080
+ return { value: "36", unit: "px" };
1081
+ if (t === "5xl")
1082
+ return { value: "48", unit: "px" };
1083
+ if (t === "6xl")
1084
+ return { value: "60", unit: "px" };
1085
+ if (t === "7xl")
1086
+ return { value: "72", unit: "px" };
1087
+ if (t === "8xl")
1088
+ return { value: "96", unit: "px" };
1089
+ if (t === "9xl")
1090
+ return { value: "128", unit: "px" };
1091
+ }
1092
+ if (X(r, "leading-")) {
1093
+ if (t === "none")
1094
+ return { value: "1", unit: "-" };
1095
+ if (t === "tight")
1096
+ return { value: "1.25", unit: "-" };
1097
+ if (t === "snug")
1098
+ return { value: "1.375", unit: "-" };
1099
+ if (t === "normal")
1100
+ return { value: "1.5", unit: "-" };
1101
+ if (t === "relaxed")
1102
+ return { value: "1.625", unit: "-" };
1103
+ if (t === "loose")
1104
+ return { value: "2", unit: "-" };
1105
+ }
1106
+ if (X(r, "tracking-")) {
1107
+ if (t === "tighter")
1108
+ return { value: "-0.05", unit: "em" };
1109
+ if (t === "tight")
1110
+ return { value: "-0.025", unit: "em" };
1111
+ if (t === "normal")
1112
+ return { value: "0", unit: "em" };
1113
+ if (t === "wide")
1114
+ return { value: "0.025", unit: "em" };
1115
+ if (t === "wider")
1116
+ return { value: "0.05", unit: "em" };
1117
+ if (t === "widest")
1118
+ return { value: "0.1", unit: "em" };
1119
+ }
1120
+ if (["max", "min", "fit"].includes(t))
1121
+ return { value: r, unit: "class" };
1122
+ if (t.includes("/")) {
1123
+ const [l, s] = V(t.split("/"), (n) => parseInt(n, 10));
1124
+ return { value: o + (l / s * 100).toFixed(2).replace(".00", ""), unit: "%" };
1125
+ }
1126
+ return Je(parseFloat(t)) ? { value: `${o + parseFloat(t) * 4}`, unit: "px" } : { value: t, unit: "class" };
1127
+ }, dr = (r) => {
1128
+ if (w(r))
1129
+ return { value: "", unit: "" };
1130
+ const o = r.match(/\[.*\]/g);
1131
+ if (o === null)
1132
+ return cr(r);
1133
+ const t = c(o, "0", "").replace(/\[|\]/g, ""), l = r.startsWith("-") ? "-" : "", s = Se(t.match(/\d+.\d+|\d+/g));
1134
+ return { value: `${l}${s}`, unit: t.replace(s, "") };
1135
+ }, cr = (r) => w(r) ? { value: "", unit: "" } : ir(r), Ue = L.createContext({
1136
+ setDragData: () => {
1137
+ }
1138
+ }), pr = ({
1139
+ unit: r,
1140
+ currentValue: o,
1141
+ onDrag: t,
1142
+ onDragEnd: l,
1143
+ onDragStart: s,
1144
+ negative: n,
1145
+ cssProperty: d
1146
+ }) => {
1147
+ const { setDragData: i } = Q(Ue);
1148
+ return /* @__PURE__ */ e.jsx(
1149
+ "button",
1150
+ {
1151
+ type: "button",
1152
+ onMouseDown: (a) => {
1153
+ const x = {
1154
+ onDrag: t,
1155
+ onDragEnd: l,
1156
+ dragging: !0,
1157
+ dragStartY: a.pageY,
1158
+ dragStartValue: `${o}`,
1159
+ dragUnit: r,
1160
+ negative: n,
1161
+ cssProperty: d
1162
+ };
1163
+ s(x), i(x);
1164
+ },
1165
+ color: void 0,
1166
+ className: "relative z-50 ml-1 hidden h-6 cursor-row-resize rounded bg-background/70 px-2 group-hover:inline",
1167
+ children: /* @__PURE__ */ e.jsx(wt, {})
1168
+ }
1169
+ );
1170
+ }, ur = ({ onSelect: r, current: o, units: t }) => /* @__PURE__ */ e.jsx("div", { "data-theme": "light", className: "-m-[7px] -mx-[13px] flex w-9 flex-col", children: t.map((l) => /* @__PURE__ */ e.jsx(
1171
+ Xe,
1172
+ {
1173
+ className: "h-max rounded-none px-1 py-1 text-right text-[11px] hover:bg-blue-400",
1174
+ color: o === l ? "primary" : void 0,
1175
+ size: "sm",
1176
+ onClick: (s) => {
1177
+ s.stopPropagation(), r(l);
1178
+ },
1179
+ children: l
1180
+ },
1181
+ l
1182
+ )) }), gr = (r) => {
1183
+ const [o, t] = S(!1), [l, s] = S(""), { currentClass: n, onChange: d, classPrefix: i, cssProperty: a, units: x, negative: g } = r, [u, m] = S(a != null && a.toLowerCase().includes("width") ? "%" : x[0]), [h, y] = S(!1), [f, O] = S(""), [B, v] = S(!1), [D, A] = S(!1);
1184
+ J(() => {
1185
+ const { value: p, unit: b } = dr(n);
1186
+ if (b === "") {
1187
+ s(p), m(a != null && a.toLowerCase().includes("width") ? "%" : x[0]);
1188
+ return;
1189
+ }
1190
+ m(b), s(b === "class" || w(p) ? "" : p);
1191
+ }, [n, a, x]);
1192
+ const C = de(
1193
+ (p) => {
1194
+ d(p);
1195
+ },
1196
+ [d],
1197
+ 200
1198
+ ), $ = de(
1199
+ (p) => {
1200
+ d(p, !1);
1201
+ },
1202
+ [d],
1203
+ 200
1204
+ ), F = I(
1205
+ (p = !1) => {
1206
+ const b = je(`${l}`, x);
1207
+ if (c(b, "error", !1)) {
1208
+ y(!0);
1209
+ return;
1210
+ }
1211
+ const j = c(b, "unit") !== "" ? c(b, "unit") : u;
1212
+ if (j === "auto" || j === "none") {
1213
+ C(`${i}${j}`);
1214
+ return;
1215
+ }
1216
+ if (c(b, "value") === "")
1217
+ return;
1218
+ const z = `${c(b, "value", "").startsWith("-") ? "-" : ""}${i}[${c(b, "value", "").replace("-", "")}${j === "-" ? "" : j}]`;
1219
+ p ? $(z) : C(z);
1220
+ },
1221
+ [C, $, l, u, i, x]
1222
+ ), re = I(
1223
+ (p) => {
1224
+ const b = je(`${l}`, x);
1225
+ if (c(b, "error", !1)) {
1226
+ y(!0);
1227
+ return;
1228
+ }
1229
+ if (p === "auto" || p === "none") {
1230
+ C(`${i}${p}`);
1231
+ return;
1232
+ }
1233
+ if (c(b, "value") === "")
1234
+ return;
1235
+ const j = c(b, "unit") !== "" ? c(b, "unit") : p, z = `${c(b, "value", "").startsWith("-") ? "-" : ""}${i}[${c(b, "value", "").replace("-", "")}${j === "-" ? "" : j}]`;
1236
+ C(z);
1237
+ },
1238
+ [C, l, i, x]
1239
+ );
1240
+ return /* @__PURE__ */ e.jsx("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ e.jsx("div", { className: "flex items-center justify-start", children: u === "class" ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
1241
+ /* @__PURE__ */ e.jsx("input", { className: "w-20 rounded py-1", readOnly: !0, value: n }),
1242
+ /* @__PURE__ */ e.jsxs(W, { children: [
1243
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsx("button", { type: "button", className: "invisible ml-3 mt-1 text-blue-600 group-hover:visible", children: /* @__PURE__ */ e.jsx(ue, {}) }) }),
1244
+ /* @__PURE__ */ e.jsx(_, { children: "Current value is using a Tailwind preset class." })
1245
+ ] })
1246
+ ] }) : /* @__PURE__ */ e.jsxs("div", { className: `group relative flex items-center ${B ? "z-auto" : ""}`, children: [
1247
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center rounded-md border border-border", children: [
1248
+ ["none", "auto"].indexOf(u) !== -1 ? null : /* @__PURE__ */ e.jsx(
1249
+ "input",
1250
+ {
1251
+ readOnly: u === "class",
1252
+ onKeyPress: (p) => {
1253
+ p.key === "Enter" && F();
1254
+ },
1255
+ onKeyDown: (p) => {
1256
+ if (p.keyCode !== 38 && p.keyCode !== 40)
1257
+ return;
1258
+ p.preventDefault(), A(!0);
1259
+ const b = Qe(p.target.value);
1260
+ let j = Ve(b) ? 0 : b;
1261
+ p.keyCode === 38 && (j += 1), p.keyCode === 40 && (j -= 1);
1262
+ const E = `${j}`, Ke = `${E.startsWith("-") ? "-" : ""}${i}[${E.replace("-", "")}${u === "-" ? "" : u}]`;
1263
+ $(Ke);
1264
+ },
1265
+ onKeyUp: (p) => {
1266
+ D && (p.preventDefault(), A(!1));
1267
+ },
1268
+ onBlur: () => F(),
1269
+ onChange: (p) => {
1270
+ y(!1), s(p.target.value);
1271
+ },
1272
+ onClick: (p) => {
1273
+ var b;
1274
+ (b = p == null ? void 0 : p.target) == null || b.select(), t(!1);
1275
+ },
1276
+ value: B ? f : l,
1277
+ className: "h-6 w-14 rounded rounded-r-none bg-background pl-2 text-sm focus-visible:outline-0 ".concat(
1278
+ " ",
1279
+ h ? "border-red-500 text-red-500" : "border-foreground/20"
1280
+ )
1281
+ }
1282
+ ),
1283
+ /* @__PURE__ */ e.jsxs(W, { open: o, delayDuration: 100, children: [
1284
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1285
+ "button",
1286
+ {
1287
+ type: "button",
1288
+ onClick: () => t(!o),
1289
+ className: "flex h-6 cursor-pointer items-center gap-x-1 rounded rounded-l-none bg-background p-px px-1 text-[11px] uppercase",
1290
+ children: [
1291
+ /* @__PURE__ */ e.jsx("span", { className: `inline-block ${x.length === 1 ? "px-2 font-semibold" : ""}`, children: u }),
1292
+ x.length > 1 ? /* @__PURE__ */ e.jsx(vt, {}) : null
1293
+ ]
1294
+ }
1295
+ ) }),
1296
+ /* @__PURE__ */ e.jsx(Wt, { children: /* @__PURE__ */ e.jsx(_, { className: "bg-background", children: /* @__PURE__ */ e.jsx(
1297
+ ur,
1298
+ {
1299
+ units: x,
1300
+ current: u,
1301
+ onSelect: (p) => {
1302
+ t(!1), m(p), re(p);
1303
+ }
1304
+ }
1305
+ ) }) })
1306
+ ] })
1307
+ ] }),
1308
+ ["none", "auto"].indexOf(u) !== -1 || B ? null : /* @__PURE__ */ e.jsx(
1309
+ pr,
1310
+ {
1311
+ onDragStart: () => v(!0),
1312
+ onDragEnd: (p) => {
1313
+ if (O(() => ""), v(!1), w(p))
1314
+ return;
1315
+ const b = `${p}`, E = `${b.startsWith("-") ? "-" : ""}${i}[${b.replace("-", "")}${u === "-" ? "" : u}]`;
1316
+ C(E);
1317
+ },
1318
+ onDrag: (p) => {
1319
+ if (w(p))
1320
+ return;
1321
+ O(p);
1322
+ const b = `${p}`, E = `${b.startsWith("-") ? "-" : ""}${i}[${b.replace("-", "")}${u === "-" ? "" : u}]`;
1323
+ $(E);
1324
+ },
1325
+ currentValue: l,
1326
+ unit: u,
1327
+ negative: g,
1328
+ cssProperty: a
1329
+ }
1330
+ )
1331
+ ] }) }) });
1332
+ }, te = (r) => {
1333
+ const o = se();
1334
+ return et(o, { property: r });
1335
+ }, xr = (r, o) => {
1336
+ const t = {
1337
+ xs: 0,
1338
+ sm: 1,
1339
+ md: 2,
1340
+ lg: 3,
1341
+ xl: 4,
1342
+ "2xl": 5
1343
+ };
1344
+ return t[c(r, "mq", "xs")] <= t[o];
1345
+ }, yr = {
1346
+ width: "w-",
1347
+ height: "h-",
1348
+ minWidth: "min-w-",
1349
+ minHeight: "min-h-",
1350
+ maxWidth: "max-w-",
1351
+ maxHeight: "max-h-",
1352
+ zIndex: "z-",
1353
+ gap: "gap-",
1354
+ gapX: "gap-x-",
1355
+ gapY: "gap-y-",
1356
+ margin: "m-",
1357
+ marginX: "mx-",
1358
+ marginY: "my-",
1359
+ marginTop: "mt-",
1360
+ marginBottom: "mb-",
1361
+ marginLeft: "ml-",
1362
+ marginRight: "mr-",
1363
+ padding: "p-",
1364
+ paddingX: "px-",
1365
+ paddingY: "py-",
1366
+ paddingTop: "pt-",
1367
+ paddingBottom: "pb-",
1368
+ paddingLeft: "pl-",
1369
+ paddingRight: "pr-",
1370
+ spaceX: "space-x-",
1371
+ spaceY: "space-y-",
1372
+ border: "border-",
1373
+ borderTop: "border-t-",
1374
+ borderBottom: "border-b-",
1375
+ borderLeft: "border-l-",
1376
+ borderRight: "border-r-",
1377
+ borderX: "border-x-",
1378
+ borderY: "border-y-",
1379
+ borderRadius: "rounded-",
1380
+ borderRadiusTop: "rounded-t-",
1381
+ borderRadiusRight: "rounded-r-",
1382
+ borderRadiusBottom: "rounded-b-",
1383
+ borderRadiusLeft: "rounded-l-",
1384
+ borderRadiusTopLeft: "rounded-tl-",
1385
+ borderRadiusTopRight: "rounded-tr-",
1386
+ borderRadiusBottomRight: "rounded-br-",
1387
+ borderRadiusBottomLeft: "rounded-bl-",
1388
+ fontSize: "text-",
1389
+ lineHeight: "leading-",
1390
+ letterSpacing: "tracking-",
1391
+ textIndent: "indent-",
1392
+ rotate: "rotate-",
1393
+ duration: "duration-",
1394
+ transitionDelay: "delay-",
1395
+ scale: "scale-",
1396
+ scaleX: "scale-x-",
1397
+ scaleY: "scale-y-",
1398
+ translateX: "translate-x-",
1399
+ translateY: "translate-y-",
1400
+ skewX: "skew-x-",
1401
+ skewY: "skew-y-",
1402
+ top: "top-",
1403
+ bottom: "bottom-",
1404
+ left: "left-",
1405
+ right: "right-",
1406
+ inset: "inset-",
1407
+ insetX: "inset-x-",
1408
+ insetY: "inset-y-",
1409
+ opacity: "opacity-",
1410
+ flexBasis: "basis-"
1411
+ }, ke = {
1412
+ xs: "",
1413
+ sm: "640px",
1414
+ md: "768px",
1415
+ lg: "1024px",
1416
+ xl: "1280px",
1417
+ "2xl": "1536px"
1418
+ }, hr = (r) => `${r.toUpperCase()} ${ke[r] ? `(${ke[r]} & up)` : ""}`, ye = (r) => {
1419
+ const { type: o = "icons", label: t, property: l, onEmitChange: s = () => {
1420
+ }, units: n, negative: d = !1 } = r, [i] = Vt(), [a] = Fe(), [, x] = we(), g = te(l), u = Oe(), m = Ee(), [h] = Pe(), y = H(() => c(g, "fullCls", ""), [g]), f = I(
1421
+ (C, $ = !0) => {
1422
+ const F = { dark: i, mq: x, mod: a, cls: C, property: l, fullCls: "" };
1423
+ (i || a !== "") && (F.mq = "xs");
1424
+ const re = Yt(F);
1425
+ u(h, [re], $);
1426
+ },
1427
+ [h, i, x, a, l, u]
1428
+ ), O = I(() => {
1429
+ m(h, [y]);
1430
+ }, [h, y, m]), B = H(() => xr(g, x), [g, x]);
1431
+ J(() => {
1432
+ s(B, g);
1433
+ }, [B, s, g]);
1434
+ const [, , v] = we(), D = I(
1435
+ (C) => {
1436
+ v({
1437
+ xs: 400,
1438
+ sm: 640,
1439
+ md: 800,
1440
+ lg: 1024,
1441
+ xl: 1420,
1442
+ "2xl": 1920
1443
+ }[C]);
1444
+ },
1445
+ [v]
1446
+ ), A = c(g, "dark", null) === i && c(g, "mod", null) === a && c(g, "mq", null) === x;
1447
+ return /* @__PURE__ */ e.jsx(lr, { canChange: B, canReset: g && A, children: /* @__PURE__ */ e.jsxs("div", { className: "group flex flex-row items-center py-2 first:pt-0 last:pb-0", children: [
1448
+ /* @__PURE__ */ e.jsx("div", { className: "relative w-[70px] truncate text-xs text-foreground", children: /* @__PURE__ */ e.jsx("span", { className: `text-[11px] ${g && !A ? "text-foreground" : ""}`, children: t }) }),
1449
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row items-center", children: [
1450
+ /* @__PURE__ */ e.jsxs("div", { className: "w-[150px]", children: [
1451
+ o === "arbitrary" ? /* @__PURE__ */ e.jsx(
1452
+ gr,
1453
+ {
1454
+ currentClass: c(g, "cls", ""),
1455
+ classPrefix: c(yr, l, ""),
1456
+ units: n || [],
1457
+ onChange: f,
1458
+ negative: d,
1459
+ cssProperty: l
1460
+ }
1461
+ ) : null,
1462
+ o === "icons" && /* @__PURE__ */ e.jsx(sr, { property: l, onChange: f }),
1463
+ o === "range" && /* @__PURE__ */ e.jsx(or, { property: l, onChange: f }),
1464
+ o === "color" && /* @__PURE__ */ e.jsx(nr, { property: l, onChange: f }),
1465
+ o === "dropdown" && /* @__PURE__ */ e.jsx(ze, { label: t, property: l, onChange: f })
1466
+ ] }),
1467
+ /* @__PURE__ */ e.jsx("div", { className: `w-[30px] cursor-pointer ${y ? "visible" : "invisible"}`, children: A ? /* @__PURE__ */ e.jsx("button", { type: "button", onClick: () => O(), title: "Reset", className: "flex px-1.5 text-xs", children: /* @__PURE__ */ e.jsx(Le, { className: "h-5 w-5 text-blue-500 hover:opacity-80" }) }) : B && g ? /* @__PURE__ */ e.jsxs(W, { delayDuration: 100, children: [
1468
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsx(
1469
+ "button",
1470
+ {
1471
+ type: "button",
1472
+ className: "invisible ml-3 mt-1 rounded-full bg-blue-500 text-white group-hover:visible",
1473
+ children: /* @__PURE__ */ e.jsx(ue, {})
1474
+ }
1475
+ ) }),
1476
+ /* @__PURE__ */ e.jsx(_, { children: /* @__PURE__ */ e.jsx("div", { className: "text-right", children: /* @__PURE__ */ e.jsxs("div", { children: [
1477
+ "Current style is set at  ",
1478
+ /* @__PURE__ */ e.jsxs("span", { className: "font-bold ", children: [
1479
+ hr(c(g, "mq")),
1480
+ i && !g.dark ? "(Light mode)" : ""
1481
+ ] }),
1482
+ /* @__PURE__ */ e.jsx("br", {}),
1483
+ /* @__PURE__ */ e.jsxs(
1484
+ "button",
1485
+ {
1486
+ type: "button",
1487
+ onClick: () => D(c(g, "mq")),
1488
+ className: "block w-full cursor-default text-right font-semibold text-blue-500",
1489
+ children: [
1490
+ "Switch to ",
1491
+ c(g, "mq").toUpperCase()
1492
+ ]
1493
+ }
1494
+ )
1495
+ ] }) }) })
1496
+ ] }) : null })
1497
+ ] })
1498
+ ] }) });
1499
+ }, mr = ["px", "%", "em", "rem", "ch", "vh", "vw"], Ge = ({
1500
+ label: r,
1501
+ options: o,
1502
+ borderB: t = !1,
1503
+ borderT: l = !1,
1504
+ type: s = "arbitrary",
1505
+ units: n = mr,
1506
+ negative: d = !1
1507
+ }) => {
1508
+ const [i, a] = S(o[0].key), x = se(), g = I((u) => V(x, "property").includes(u), [x]);
1509
+ return /* @__PURE__ */ e.jsxs(
1510
+ "div",
1511
+ {
1512
+ className: `mb-2 border-gray-800 py-2 first:pt-0 last:pb-0 ${t ? "border-b" : ""} ${l ? "border-t" : ""}`,
1513
+ children: [
1514
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-row text-xs", children: [
1515
+ r && /* @__PURE__ */ e.jsx("span", { className: "relative w-[70px] flex-none text-xs text-foreground", children: r }),
1516
+ /* @__PURE__ */ e.jsx("div", { className: "mb-3 flex grow flex-row flex-wrap gap-x-px", children: L.Children.toArray(
1517
+ o.map(({ label: u, key: m }) => /* @__PURE__ */ e.jsx("div", { className: "first:rounded-l last:rounded-r", children: /* @__PURE__ */ e.jsxs(W, { children: [
1518
+ /* @__PURE__ */ e.jsx(Z, { asChild: !0, children: /* @__PURE__ */ e.jsxs(
1519
+ "button",
1520
+ {
1521
+ type: "button",
1522
+ onClick: () => a(m),
1523
+ className: `relative cursor-pointer rounded-full p-1 text-[8px] ${m === i ? " bg-[#3E57F0] text-white" : "text-gray-600 dark:text-gray-300"}`,
1524
+ children: [
1525
+ L.createElement("div", {
1526
+ className: g(m) ? "-bottom-1.5 absolute bg-[#3E57F0] h-[2px] left-0 w-full" : ""
1527
+ }),
1528
+ L.createElement(c(_e, m, $e), { className: "text-inherit w-3 h-3" })
1529
+ ]
1530
+ }
1531
+ ) }),
1532
+ /* @__PURE__ */ e.jsx(_, { children: Re(Te(u)) })
1533
+ ] }) }))
1534
+ ) })
1535
+ ] }),
1536
+ /* @__PURE__ */ e.jsx("div", { className: "mt-0 flex items-center", children: /* @__PURE__ */ e.jsx(
1537
+ ye,
1538
+ {
1539
+ type: s,
1540
+ units: [...n],
1541
+ label: "",
1542
+ property: i,
1543
+ negative: d
1544
+ }
1545
+ ) })
1546
+ ]
1547
+ }
1548
+ );
1549
+ }, br = ({ heading: r, items: o }) => {
1550
+ const t = se(), l = H(() => {
1551
+ const s = (i) => Y(
1552
+ i.map((a) => a.styleType === "multiple" ? V(a.options, "key") : a.property)
1553
+ ), n = Y(
1554
+ o.map((i) => i.styleType === "accordion" ? s(i.items) : i.styleType === "multiple" ? V(i.options, "key") : i.property)
1555
+ ), d = V(t, "property");
1556
+ return He(n, d).length > 0;
1557
+ }, [t, o]);
1558
+ return /* @__PURE__ */ e.jsxs("details", { children: [
1559
+ /* @__PURE__ */ e.jsx("summary", { className: "my-px cursor-default rounded-md bg-background p-px px-2 text-[11px] text-foreground", children: /* @__PURE__ */ e.jsxs("div", { className: "inline", children: [
1560
+ r,
1561
+ l ? /* @__PURE__ */ e.jsx(
1562
+ "span",
1563
+ {
1564
+ className: `ml-1 mr-2 inline-block h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}`
1565
+ }
1566
+ ) : null
1567
+ ] }) }),
1568
+ /* @__PURE__ */ e.jsx("div", { className: "p-2", children: o.map((s) => s.styleType === "multiple" ? /* @__PURE__ */ e.jsx(Ge, { ...s }, s.label) : /* @__PURE__ */ e.jsx(ye, { ...s }, s.label)) })
1569
+ ] });
1570
+ }, fr = Ne({}), ie = ({ section: r }) => {
1571
+ const o = se(), t = I(
1572
+ (n = []) => {
1573
+ const d = {};
1574
+ for (let a = 0; a < o.length; a++)
1575
+ d[o[a].property] = o[a].cls;
1576
+ let i = !0;
1577
+ for (const a in n)
1578
+ if (!ne(d, a) || d[a] !== n[a]) {
1579
+ i = !1;
1580
+ break;
1581
+ }
1582
+ return i;
1583
+ },
1584
+ [o]
1585
+ ), l = H(() => {
1586
+ if (o.length > 0 && r.heading === "Classes")
1587
+ return !0;
1588
+ const n = (a) => Y(
1589
+ a.map((x) => x.styleType === "multiple" ? Y(V(x.options, "key")) : x.property)
1590
+ ), d = Y(
1591
+ r.items.map((a) => a.styleType === "accordion" ? n(a.items) : a.styleType === "multiple" ? Y(V(a.options, "key")) : a.property)
1592
+ ), i = V(o, "property");
1593
+ return He(d, i).length > 0;
1594
+ }, [o, r.heading, r.items]), s = H(() => ({}), []);
1595
+ return /* @__PURE__ */ e.jsx(fr.Provider, { value: s, children: /* @__PURE__ */ e.jsxs(Ye, { value: r.heading, children: [
1596
+ /* @__PURE__ */ e.jsx(We, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1597
+ /* @__PURE__ */ e.jsx("div", { className: `h-[8px] w-[8px] rounded-full ${l ? "bg-blue-500" : "bg-gray-300"}` }),
1598
+ r.heading
1599
+ ] }) }),
1600
+ /* @__PURE__ */ e.jsx(Ze, { className: "bg-gray-100 px-3.5 py-2", children: L.Children.toArray(
1601
+ r.items.map((n) => ne(n, "component") ? L.createElement(n.component, { key: n.label }) : ne(n, "styleType") ? n.styleType === "multiple" ? /* @__PURE__ */ e.jsx(Ge, { ...n }, n.label) : n.styleType === "accordion" && t(n == null ? void 0 : n.conditions) ? /* @__PURE__ */ e.jsx(br, { ...n }, n.label) : null : /* @__PURE__ */ e.jsx(ye, { ...n }, n.label))
1602
+ ) })
1603
+ ] }) });
1604
+ }, vr = ({
1605
+ item: r,
1606
+ index: o,
1607
+ canDelete: t,
1608
+ onChange: l,
1609
+ onRemove: s
1610
+ }) => /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col gap-1 border-gray-400 py-2 ${t ? "border-b" : ""}`, children: [
1611
+ /* @__PURE__ */ e.jsx(
1612
+ "input",
1613
+ {
1614
+ name: "key",
1615
+ onChange: (n) => l(n, o),
1616
+ value: r.key,
1617
+ placeholder: "Key",
1618
+ className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1619
+ autoComplete: "off",
1620
+ autoCapitalize: "off"
1621
+ }
1622
+ ),
1623
+ /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-1.5", children: [
1624
+ /* @__PURE__ */ e.jsx(
1625
+ "input",
1626
+ {
1627
+ name: "value",
1628
+ onChange: (n) => w(r.key) ? {} : l(n, o),
1629
+ value: r.value,
1630
+ placeholder: "Value",
1631
+ className: "w-full rounded border-gray-300 bg-background p-0.5 pl-2 text-sm focus-visible:outline-0",
1632
+ autoComplete: "off",
1633
+ autoCapitalize: "off"
1634
+ }
1635
+ ),
1636
+ /* @__PURE__ */ e.jsx(
1637
+ Le,
1638
+ {
1639
+ onClick: s,
1640
+ className: "h-6 w-6 cursor-pointer rounded border border-red-400 p-1 text-red-400 hover:opacity-80"
1641
+ }
1642
+ )
1643
+ ] })
1644
+ ] }), wr = ({ section: r }) => {
1645
+ var m;
1646
+ const { setSyncState: o } = Ht(), t = oe(), [l, s] = S([]), [n] = ge(), d = Me(), i = `${c(n, "0.prop")}_attrs`;
1647
+ le.useEffect(() => {
1648
+ const h = V(c(t, i), (y, f) => ({ key: f, value: y }));
1649
+ w(h) ? s([]) : s(h);
1650
+ }, [c(t, i)]);
1651
+ const a = () => s([...l, { key: "", value: "" }]), x = (h) => {
1652
+ const y = lt(l, (f, O) => h !== O);
1653
+ u(y);
1654
+ }, g = (h, y) => {
1655
+ const f = [...l];
1656
+ f[y][h.target.name] = h.target.value, u(f);
1657
+ }, u = le.useCallback(
1658
+ (h = []) => {
1659
+ const y = {};
1660
+ tt(h, (f) => {
1661
+ w(f.key) || rt(y, f.key, f.value);
1662
+ }), d([c(t, "_id")], { [i]: y }), o("UNSAVED");
1663
+ },
1664
+ [t, o, d, i]
1665
+ );
1666
+ return /* @__PURE__ */ e.jsxs(Ye, { value: r.heading, children: [
1667
+ /* @__PURE__ */ e.jsx(We, { className: "px-3 py-2 text-xs hover:no-underline", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-x-2", children: [
1668
+ /* @__PURE__ */ e.jsx(
1669
+ "div",
1670
+ {
1671
+ className: `h-[8px] w-[8px] rounded-full ${w(c(t, i)) ? "bg-gray-300" : "bg-blue-500"}`
1672
+ }
1673
+ ),
1674
+ "Attributes"
1675
+ ] }) }),
1676
+ /* @__PURE__ */ e.jsx(Ze, { className: "bg-gray-100 px-3.5 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "no-scrollbar flex min-h-max flex-col gap-y-2 overflow-y-auto bg-gray-100 p-px", children: [
1677
+ /* @__PURE__ */ e.jsxs(xe, { className: "mt-2 flex w-full items-center justify-between", children: [
1678
+ "Add Custom attributes",
1679
+ /* @__PURE__ */ e.jsxs(
1680
+ "div",
1681
+ {
1682
+ className: `flex h-6 w-max items-center justify-center gap-x-0.5 rounded-full border p-1 px-2 text-xs ${!w(l) && w((m = me(l)) == null ? void 0 : m.key) ? "cursor-not-allowed border-gray-400 text-gray-400" : "cursor-pointer border-blue-400 text-blue-400 hover:bg-blue-400 hover:text-white"}`,
1683
+ onClick: () => {
1684
+ var h;
1685
+ !w(l) && w((h = me(l)) == null ? void 0 : h.key) || a();
1686
+ },
1687
+ children: [
1688
+ /* @__PURE__ */ e.jsx(pe, { width: 12, height: 12 }),
1689
+ " Add"
1690
+ ]
1691
+ }
1692
+ )
1693
+ ] }),
1694
+ /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col", children: [
1695
+ w(l) && /* @__PURE__ */ e.jsx("div", { className: "flex h-12 items-center justify-center text-sm text-gray-400", children: "Click + Add to add attributes" }),
1696
+ le.Children.toArray(
1697
+ V(l, (h, y) => {
1698
+ const f = l.length > 0 && y < l.length - 1;
1699
+ return /* @__PURE__ */ e.jsx(
1700
+ vr,
1701
+ {
1702
+ item: h,
1703
+ index: y,
1704
+ canDelete: f,
1705
+ onChange: g,
1706
+ onRemove: () => x(y)
1707
+ }
1708
+ );
1709
+ })
1710
+ )
1711
+ ] })
1712
+ ] }) })
1713
+ ] });
1714
+ };
1715
+ function Cr() {
1716
+ const [r, o] = Fe(), { flexChild: t, gridChild: l } = Bt(), [, s] = Et(At), { t: n } = Be(), [d] = ge();
1717
+ return w(d) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
1718
+ /* @__PURE__ */ e.jsx(Ie, { className: "mx-auto text-3xl" }),
1719
+ /* @__PURE__ */ e.jsx("h1", { children: n("no_styling_block_selected") }),
1720
+ /* @__PURE__ */ e.jsxs("p", { className: "text-xs ", children: [
1721
+ "Hint: Styling allowed blocks are highlighted with",
1722
+ " ",
1723
+ /* @__PURE__ */ e.jsx("span", { className: "border border-orange-500 p-px", children: "orange" }),
1724
+ " border"
1725
+ ] })
1726
+ ] }) }) : (
1727
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events,jsx-a11y/no-static-element-interactions
1728
+ /* @__PURE__ */ e.jsxs("div", { onClick: () => s(!1), className: "flex h-full flex-col", children: [
1729
+ /* @__PURE__ */ e.jsx("div", { className: "flex flex-col space-x-4 space-y-3 border-b border-border px-4 py-2", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-end gap-x-1.5", children: [
1730
+ /* @__PURE__ */ e.jsx(xe, { htmlFor: "", className: "flex gap-x-1.5 text-xs italic", children: "State" }),
1731
+ /* @__PURE__ */ e.jsxs(Ut, { defaultValue: r, onValueChange: (i) => o(i), children: [
1732
+ /* @__PURE__ */ e.jsx(Gt, { className: "h-auto w-fit p-1 px-3", children: /* @__PURE__ */ e.jsx(Kt, { placeholder: "State" }) }),
1733
+ /* @__PURE__ */ e.jsxs(qt, { children: [
1734
+ /* @__PURE__ */ e.jsx(R, { value: "", children: "Normal" }),
1735
+ /* @__PURE__ */ e.jsx(R, { value: "hover", children: "Hover" }),
1736
+ /* @__PURE__ */ e.jsx(R, { value: "active", children: "Active" }),
1737
+ /* @__PURE__ */ e.jsx(R, { value: "focus", children: "Focus" }),
1738
+ /* @__PURE__ */ e.jsx(R, { value: "before", children: "Before" }),
1739
+ /* @__PURE__ */ e.jsx(R, { value: "after", children: "After" }),
1740
+ /* @__PURE__ */ e.jsx(R, { value: "only", children: "Only" }),
1741
+ /* @__PURE__ */ e.jsx(R, { value: "first", children: "First" }),
1742
+ /* @__PURE__ */ e.jsx(R, { value: "last", children: "Last" }),
1743
+ /* @__PURE__ */ e.jsx(R, { value: "first-letter", children: "First Letter" }),
1744
+ /* @__PURE__ */ e.jsx(R, { value: "first-line", children: "First Line" }),
1745
+ /* @__PURE__ */ e.jsx(R, { value: "disabled", children: "Disabled" })
1746
+ ] })
1747
+ ] })
1748
+ ] }) }),
1749
+ /* @__PURE__ */ e.jsxs(zt, { className: "no-scrollbar -mx-1 h-full overflow-x-hidden", children: [
1750
+ /* @__PURE__ */ e.jsxs(_t, { type: "multiple", className: "h-full w-full", children: [
1751
+ t && /* @__PURE__ */ e.jsx(ie, { section: er }),
1752
+ l ? /* @__PURE__ */ e.jsx(ie, { section: tr }) : null,
1753
+ rr.map((i) => /* @__PURE__ */ e.jsx(ie, { section: i }, i.heading)),
1754
+ /* @__PURE__ */ e.jsx(wr, { section: { heading: "Attributes" } })
1755
+ ] }),
1756
+ /* @__PURE__ */ e.jsx("div", { className: "h-60" })
1757
+ ] })
1758
+ ] })
1759
+ );
1760
+ }
1761
+ const jr = {
1762
+ px: 1,
1763
+ "%": 1,
1764
+ em: 100,
1765
+ rem: 100,
1766
+ ch: 1,
1767
+ vw: 1,
1768
+ vh: 1,
1769
+ "-": 1,
1770
+ deg: 1,
1771
+ ms: 0.1
1772
+ }, ml = () => {
1773
+ const r = oe(), { t: o } = Be(), [t, l] = L.useState(""), [s, n] = L.useState({
1774
+ onDrag: (a) => a,
1775
+ onDragEnd: (a) => a,
1776
+ dragStartY: 0,
1777
+ dragging: !1,
1778
+ dragStartValue: 0,
1779
+ dragUnit: "",
1780
+ negative: !1,
1781
+ cssProperty: ""
1782
+ }), d = de(
1783
+ (a) => {
1784
+ const x = !c(s, "negative", !1), g = c(s, "cssProperty", "");
1785
+ let u = parseFloat(s.dragStartValue);
1786
+ u = Ve(u) ? 0 : u;
1787
+ let m = jr[s.dragUnit];
1788
+ (X(g, "scale") || g === "opacity") && (m = 10);
1789
+ let y = (s.dragStartY - a.pageY) / m + u;
1790
+ x && y < 0 && (y = 0), g === "opacity" && y > 1 && (y = 1), s.onDrag(`${y}`), l(`${y}`);
1791
+ },
1792
+ [s],
1793
+ 50
1794
+ ), i = I(() => {
1795
+ setTimeout(() => s.onDragEnd(`${t}`), 100), n({
1796
+ onDrag: (a) => a,
1797
+ onDragEnd: (a) => a,
1798
+ dragStartY: 0,
1799
+ dragging: !1,
1800
+ dragStartValue: 0,
1801
+ dragUnit: "",
1802
+ negative: !1,
1803
+ cssProperty: ""
1804
+ });
1805
+ }, [s, t, n]);
1806
+ return ot(r) ? /* @__PURE__ */ e.jsx("div", { className: "p-4 text-center", children: /* @__PURE__ */ e.jsxs("div", { className: "space-y-4 rounded-xl p-4", children: [
1807
+ /* @__PURE__ */ e.jsx(Ie, { className: "mx-auto text-3xl" }),
1808
+ /* @__PURE__ */ e.jsx("h1", { children: o("no_block_selected_for_styling") })
1809
+ ] }) }) : (
1810
+ // eslint-disable-next-line react/jsx-no-constructed-context-values
1811
+ /* @__PURE__ */ e.jsxs(Ue.Provider, { value: { setDragData: n }, children: [
1812
+ s.dragging ? (
1813
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
1814
+ /* @__PURE__ */ e.jsx(
1815
+ "div",
1816
+ {
1817
+ onMouseMove: d,
1818
+ onMouseUp: () => {
1819
+ i();
1820
+ },
1821
+ className: "absolute inset-0 z-30 cursor-row-resize bg-gray-300/10 "
1822
+ }
1823
+ )
1824
+ ) : null,
1825
+ /* @__PURE__ */ e.jsxs(Ct, { defaultValue: "settings", className: "flex h-full w-full flex-col py-1", children: [
1826
+ /* @__PURE__ */ e.jsxs(jt, { className: "mx-1 grid grid-cols-2", children: [
1827
+ /* @__PURE__ */ e.jsx(fe, { value: "settings", children: "Settings" }),
1828
+ /* @__PURE__ */ e.jsx(fe, { value: "styling", children: "Styling" })
1829
+ ] }),
1830
+ /* @__PURE__ */ e.jsx(
1831
+ ve,
1832
+ {
1833
+ value: "settings",
1834
+ className: "no-scrollbar -mx-1 -mr-2 h-full flex-1 overflow-y-auto overflow-x-hidden",
1835
+ children: /* @__PURE__ */ e.jsx(Jt, {})
1836
+ }
1837
+ ),
1838
+ /* @__PURE__ */ e.jsx(ve, { value: "styling", className: "flex-1 overflow-y-auto overflow-x-hidden", children: /* @__PURE__ */ e.jsx(Cr, {}) })
1839
+ ] })
1840
+ ] })
1841
+ );
1842
+ };
1843
+ export {
1844
+ ml as default
1845
+ };