@vasttrader/puck-config 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.
package/dist/index.js ADDED
@@ -0,0 +1,783 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Accordion: () => Accordion,
24
+ Editor: () => Editor,
25
+ Image: () => Image,
26
+ Space: () => Space
27
+ });
28
+ module.exports = __toCommonJS(index_exports);
29
+
30
+ // src/components/Accordion/index.tsx
31
+ var import_react = require("react");
32
+ var import_jsx_runtime = require("react/jsx-runtime");
33
+ var Accordion = {
34
+ label: "Accordion",
35
+ fields: {
36
+ items: {
37
+ type: "array",
38
+ label: "Accordion Items",
39
+ arrayFields: {
40
+ id: {
41
+ type: "text",
42
+ label: "ID (unique identifier)"
43
+ },
44
+ title: {
45
+ type: "text",
46
+ label: "Title"
47
+ },
48
+ content: {
49
+ type: "textarea",
50
+ label: "Content (supports HTML)"
51
+ }
52
+ },
53
+ defaultItemProps: {
54
+ id: "",
55
+ title: "New Item",
56
+ content: "<p>Enter content here...</p>"
57
+ },
58
+ getItemSummary: (item) => item.title || "Untitled"
59
+ },
60
+ allowMultiple: {
61
+ type: "radio",
62
+ label: "Allow Multiple Open",
63
+ options: [
64
+ { label: "Yes", value: true },
65
+ { label: "No", value: false }
66
+ ]
67
+ },
68
+ defaultOpenFirst: {
69
+ type: "radio",
70
+ label: "Open First Item by Default",
71
+ options: [
72
+ { label: "Yes", value: true },
73
+ { label: "No", value: false }
74
+ ]
75
+ },
76
+ variant: {
77
+ type: "select",
78
+ label: "Style Variant",
79
+ options: [
80
+ { label: "Default", value: "default" },
81
+ { label: "Bordered", value: "bordered" },
82
+ { label: "Separated", value: "separated" },
83
+ { label: "Minimal", value: "minimal" }
84
+ ]
85
+ },
86
+ iconPosition: {
87
+ type: "radio",
88
+ label: "Icon Position",
89
+ options: [
90
+ { label: "Left", value: "left" },
91
+ { label: "Right", value: "right" }
92
+ ]
93
+ },
94
+ icon: {
95
+ type: "select",
96
+ label: "Icon Type",
97
+ options: [
98
+ { label: "Chevron", value: "chevron" },
99
+ { label: "Plus/Minus", value: "plus" },
100
+ { label: "Arrow", value: "arrow" }
101
+ ]
102
+ },
103
+ animationDuration: {
104
+ type: "number",
105
+ label: "Animation Duration (ms)",
106
+ min: 0,
107
+ max: 1e3
108
+ },
109
+ className: {
110
+ type: "text",
111
+ label: "Custom CSS Class"
112
+ }
113
+ },
114
+ defaultProps: {
115
+ items: [
116
+ {
117
+ id: "item-1",
118
+ title: "What is this accordion?",
119
+ content: "<p>This is a flexible accordion component that can be customized to fit your needs. You can add multiple items, customize the styling, and control the behavior.</p>"
120
+ }
121
+ ],
122
+ allowMultiple: false,
123
+ defaultOpenFirst: true,
124
+ variant: "default",
125
+ iconPosition: "right",
126
+ icon: "chevron",
127
+ animationDuration: 300,
128
+ className: ""
129
+ },
130
+ render: ({
131
+ items,
132
+ allowMultiple = false,
133
+ defaultOpenFirst = false,
134
+ variant = "default",
135
+ iconPosition = "right",
136
+ icon = "chevron",
137
+ animationDuration = 300,
138
+ className = ""
139
+ }) => {
140
+ const [openItems, setOpenItems] = (0, import_react.useState)(() => {
141
+ if (defaultOpenFirst && items.length > 0) {
142
+ return /* @__PURE__ */ new Set([items[0].id]);
143
+ }
144
+ return /* @__PURE__ */ new Set();
145
+ });
146
+ const toggleItem = (id) => {
147
+ setOpenItems((prev) => {
148
+ const newSet = new Set(prev);
149
+ if (newSet.has(id)) {
150
+ newSet.delete(id);
151
+ } else {
152
+ if (!allowMultiple) {
153
+ newSet.clear();
154
+ }
155
+ newSet.add(id);
156
+ }
157
+ return newSet;
158
+ });
159
+ };
160
+ const getIcon = (isOpen) => {
161
+ switch (icon) {
162
+ case "chevron":
163
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
164
+ "svg",
165
+ {
166
+ className: `puck-accordion-icon ${isOpen ? "puck-accordion-icon-open" : ""}`,
167
+ width: "20",
168
+ height: "20",
169
+ viewBox: "0 0 20 20",
170
+ fill: "none",
171
+ xmlns: "http://www.w3.org/2000/svg",
172
+ role: "img",
173
+ "aria-label": "Toggle accordion",
174
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
175
+ "path",
176
+ {
177
+ d: "M5 7.5L10 12.5L15 7.5",
178
+ stroke: "currentColor",
179
+ strokeWidth: "2",
180
+ strokeLinecap: "round",
181
+ strokeLinejoin: "round"
182
+ }
183
+ )
184
+ }
185
+ );
186
+ case "plus":
187
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
188
+ "svg",
189
+ {
190
+ className: `puck-accordion-icon ${isOpen ? "puck-accordion-icon-open" : ""}`,
191
+ width: "20",
192
+ height: "20",
193
+ viewBox: "0 0 20 20",
194
+ fill: "none",
195
+ xmlns: "http://www.w3.org/2000/svg",
196
+ role: "img",
197
+ "aria-label": "Toggle accordion",
198
+ children: isOpen ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 10H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
199
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M10 5V15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" }),
200
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M5 10H15", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
201
+ ] })
202
+ }
203
+ );
204
+ case "arrow":
205
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
206
+ "svg",
207
+ {
208
+ className: `puck-accordion-icon ${isOpen ? "puck-accordion-icon-open" : ""}`,
209
+ width: "20",
210
+ height: "20",
211
+ viewBox: "0 0 20 20",
212
+ fill: "none",
213
+ xmlns: "http://www.w3.org/2000/svg",
214
+ role: "img",
215
+ "aria-label": "Toggle accordion",
216
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
217
+ "path",
218
+ {
219
+ d: "M7.5 5L12.5 10L7.5 15",
220
+ stroke: "currentColor",
221
+ strokeWidth: "2",
222
+ strokeLinecap: "round",
223
+ strokeLinejoin: "round"
224
+ }
225
+ )
226
+ }
227
+ );
228
+ }
229
+ };
230
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
231
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: `puck-accordion puck-accordion-${variant} ${className}`, children: items.map((item) => {
232
+ const isOpen = openItems.has(item.id);
233
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
234
+ "div",
235
+ {
236
+ className: `puck-accordion-item ${isOpen ? "puck-accordion-item-open" : ""}`,
237
+ children: [
238
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
239
+ "button",
240
+ {
241
+ className: `puck-accordion-trigger ${iconPosition === "left" ? "puck-accordion-trigger-icon-left" : ""}`,
242
+ onClick: () => toggleItem(item.id),
243
+ "aria-expanded": isOpen,
244
+ type: "button",
245
+ children: [
246
+ iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "puck-accordion-icon-wrapper", children: getIcon(isOpen) }),
247
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "puck-accordion-title", children: item.title }),
248
+ iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "puck-accordion-icon-wrapper", children: getIcon(isOpen) })
249
+ ]
250
+ }
251
+ ),
252
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
253
+ "div",
254
+ {
255
+ className: `puck-accordion-content ${isOpen ? "puck-accordion-content-open" : ""}`,
256
+ style: {
257
+ maxHeight: isOpen ? "1000px" : "0",
258
+ transition: `max-height ${animationDuration}ms ease-in-out, opacity ${animationDuration}ms ease-in-out`
259
+ },
260
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "puck-accordion-content-inner", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { dangerouslySetInnerHTML: { __html: item.content } }) })
261
+ }
262
+ )
263
+ ]
264
+ },
265
+ item.id
266
+ );
267
+ }) }),
268
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("style", { children: `
269
+ .puck-accordion {
270
+ width: 100%;
271
+ }
272
+
273
+ .puck-accordion-default {
274
+ border: 1px solid #e5e7eb;
275
+ border-radius: 8px;
276
+ overflow: hidden;
277
+ }
278
+
279
+ .puck-accordion-default .puck-accordion-item:not(:last-child) {
280
+ border-bottom: 1px solid #e5e7eb;
281
+ }
282
+
283
+ .puck-accordion-bordered .puck-accordion-item {
284
+ border: 1px solid #e5e7eb;
285
+ border-radius: 8px;
286
+ margin-bottom: 8px;
287
+ overflow: hidden;
288
+ }
289
+
290
+ .puck-accordion-bordered .puck-accordion-item:last-child {
291
+ margin-bottom: 0;
292
+ }
293
+
294
+ .puck-accordion-separated .puck-accordion-item {
295
+ border-radius: 8px;
296
+ margin-bottom: 12px;
297
+ padding: 4px;
298
+ }
299
+
300
+ .puck-accordion-separated .puck-accordion-item:last-child {
301
+ margin-bottom: 0;
302
+ }
303
+
304
+ .puck-accordion-minimal .puck-accordion-item:not(:last-child) {
305
+ border-bottom: 1px solid #f3f4f6;
306
+ padding: 8px 0;
307
+ }
308
+
309
+ .puck-accordion-trigger {
310
+ background-color: transparent;
311
+ width: 100%;
312
+ display: flex;
313
+ align-items: center;
314
+ justify-content: space-between;
315
+ padding: 16px 20px;
316
+ border: none;
317
+ cursor: pointer;
318
+ text-align: left;
319
+ }
320
+
321
+ .puck-accordion-trigger-icon-left {
322
+ flex-direction: row-reverse;
323
+ }
324
+
325
+ .puck-accordion-title {
326
+ font-size: 16px;
327
+ font-weight: 600;
328
+ color: #111827;
329
+ flex: 1;
330
+ }
331
+
332
+ .puck-accordion-icon-wrapper {
333
+ display: flex;
334
+ align-items: center;
335
+ justify-content: center;
336
+ margin-left: 12px;
337
+ color: #6b7280;
338
+ }
339
+
340
+ .puck-accordion-trigger-icon-left .puck-accordion-icon-wrapper {
341
+ margin-left: 0;
342
+ margin-right: 12px;
343
+ }
344
+
345
+ .puck-accordion-icon {
346
+ transition: transform ${animationDuration}ms ease;
347
+ }
348
+
349
+ .puck-accordion-icon-open {
350
+ transform: rotate(180deg);
351
+ }
352
+
353
+ .puck-accordion-trigger-icon-left .puck-accordion-icon-open {
354
+ transform: rotate(90deg);
355
+ }
356
+
357
+ .puck-accordion-content {
358
+ overflow: hidden;
359
+ opacity: 0;
360
+ }
361
+
362
+ .puck-accordion-content-open {
363
+ opacity: 1;
364
+ border-top: 1px solid #e4e4e4;
365
+ }
366
+
367
+ .puck-accordion-content-inner {
368
+ padding: 0 20px;
369
+ color: #4b5563;
370
+ font-size: 14px;
371
+ line-height: 1.6;
372
+ }
373
+ ` })
374
+ ] });
375
+ }
376
+ };
377
+
378
+ // src/components/Editor/index.tsx
379
+ var import_puck = require("@measured/puck");
380
+ var import_tinymce_react = require("@tinymce/tinymce-react");
381
+ var import_jsx_runtime2 = require("react/jsx-runtime");
382
+ var Editor = {
383
+ fields: {
384
+ text: {
385
+ type: "custom",
386
+ render: ({ value, onChange }) => {
387
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_puck.FieldLabel, { label: "Editor", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
388
+ import_tinymce_react.Editor,
389
+ {
390
+ licenseKey: "gpl",
391
+ tinymceScriptSrc: "https://cdnjs.cloudflare.com/ajax/libs/tinymce/8.1.2/tinymce.min.js",
392
+ init: {
393
+ height: 200,
394
+ menubar: false,
395
+ statusbar: false,
396
+ branding: false,
397
+ plugins: "link lists table",
398
+ toolbar: "bold italic | bullist numlist | link | table"
399
+ },
400
+ initialValue: value,
401
+ onBlur: (_, editor) => {
402
+ onChange(editor.getContent());
403
+ }
404
+ }
405
+ ) });
406
+ }
407
+ }
408
+ },
409
+ defaultProps: {
410
+ text: ""
411
+ },
412
+ render: ({ text }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { dangerouslySetInnerHTML: { __html: text ?? "" } })
413
+ };
414
+
415
+ // src/components/Image/index.tsx
416
+ var import_jsx_runtime3 = require("react/jsx-runtime");
417
+ var shadowClasses = {
418
+ none: "",
419
+ sm: "shadow-sm",
420
+ md: "shadow-md",
421
+ lg: "shadow-lg",
422
+ xl: "shadow-xl"
423
+ };
424
+ var aspectRatioValues = {
425
+ "16:9": "16 / 9",
426
+ "4:3": "4 / 3",
427
+ "1:1": "1 / 1",
428
+ "21:9": "21 / 9",
429
+ custom: void 0,
430
+ none: void 0
431
+ };
432
+ var Image = {
433
+ label: "Image",
434
+ fields: {
435
+ src: {
436
+ type: "text",
437
+ label: "Image URL"
438
+ },
439
+ alt: {
440
+ type: "text",
441
+ label: "Alt Text (for accessibility)"
442
+ },
443
+ width: {
444
+ type: "number",
445
+ label: "Width (px)",
446
+ min: 1,
447
+ max: 4e3
448
+ },
449
+ height: {
450
+ type: "number",
451
+ label: "Height (px)",
452
+ min: 1,
453
+ max: 4e3
454
+ },
455
+ aspectRatio: {
456
+ type: "select",
457
+ label: "Aspect Ratio",
458
+ options: [
459
+ { label: "None", value: "none" },
460
+ { label: "16:9 (Widescreen)", value: "16:9" },
461
+ { label: "4:3 (Standard)", value: "4:3" },
462
+ { label: "1:1 (Square)", value: "1:1" },
463
+ { label: "21:9 (Ultrawide)", value: "21:9" },
464
+ { label: "Custom", value: "custom" }
465
+ ]
466
+ },
467
+ customAspectRatio: {
468
+ type: "text",
469
+ label: "Custom Aspect Ratio (e.g., 3/2)"
470
+ },
471
+ objectFit: {
472
+ type: "select",
473
+ label: "Object Fit",
474
+ options: [
475
+ { label: "Cover", value: "cover" },
476
+ { label: "Contain", value: "contain" },
477
+ { label: "Fill", value: "fill" },
478
+ { label: "None", value: "none" },
479
+ { label: "Scale Down", value: "scale-down" }
480
+ ]
481
+ },
482
+ objectPosition: {
483
+ type: "text",
484
+ label: "Object Position (e.g., center, top, bottom)"
485
+ },
486
+ alignment: {
487
+ type: "radio",
488
+ label: "Alignment",
489
+ options: [
490
+ { label: "Left", value: "left" },
491
+ { label: "Center", value: "center" },
492
+ { label: "Right", value: "right" }
493
+ ]
494
+ },
495
+ maxWidth: {
496
+ type: "number",
497
+ label: "Max Width (px, 0 = no limit)",
498
+ min: 0,
499
+ max: 2e3
500
+ },
501
+ caption: {
502
+ type: "textarea",
503
+ label: "Caption (optional)"
504
+ },
505
+ link: {
506
+ type: "text",
507
+ label: "Link URL (optional)"
508
+ },
509
+ openInNewTab: {
510
+ type: "radio",
511
+ label: "Open Link in New Tab",
512
+ options: [
513
+ { label: "Yes", value: true },
514
+ { label: "No", value: false }
515
+ ]
516
+ },
517
+ borderRadius: {
518
+ type: "number",
519
+ label: "Border Radius (px)",
520
+ min: 0,
521
+ max: 100
522
+ },
523
+ shadow: {
524
+ type: "select",
525
+ label: "Shadow",
526
+ options: [
527
+ { label: "None", value: "none" },
528
+ { label: "Small", value: "sm" },
529
+ { label: "Medium", value: "md" },
530
+ { label: "Large", value: "lg" },
531
+ { label: "Extra Large", value: "xl" }
532
+ ]
533
+ },
534
+ loading: {
535
+ type: "radio",
536
+ label: "Loading Strategy",
537
+ options: [
538
+ { label: "Lazy", value: "lazy" },
539
+ { label: "Eager", value: "eager" }
540
+ ]
541
+ }
542
+ },
543
+ defaultProps: {
544
+ src: "https://images.unsplash.com/photo-1506905925346-21bda4d32df4",
545
+ alt: "Beautiful landscape",
546
+ width: 800,
547
+ height: 600,
548
+ objectFit: "cover",
549
+ objectPosition: "center",
550
+ alignment: "center",
551
+ caption: "",
552
+ link: "",
553
+ openInNewTab: true,
554
+ borderRadius: 0,
555
+ shadow: "none",
556
+ aspectRatio: "none",
557
+ customAspectRatio: "",
558
+ maxWidth: 0,
559
+ loading: "lazy"
560
+ },
561
+ render: (props) => {
562
+ const {
563
+ src,
564
+ alt,
565
+ width = 800,
566
+ height = 600,
567
+ objectFit = "cover",
568
+ objectPosition = "center",
569
+ alignment = "center",
570
+ caption,
571
+ link,
572
+ openInNewTab = true,
573
+ borderRadius = 0,
574
+ shadow = "none",
575
+ aspectRatio = "none",
576
+ customAspectRatio,
577
+ maxWidth,
578
+ loading = "lazy"
579
+ } = props;
580
+ const aspectValue = aspectRatio === "custom" && customAspectRatio ? customAspectRatio : aspectRatioValues[aspectRatio];
581
+ const alignmentStyles = {
582
+ left: "flex-start",
583
+ center: "center",
584
+ right: "flex-end"
585
+ };
586
+ const imageElement = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
587
+ "div",
588
+ {
589
+ className: "external-image-wrapper",
590
+ style: {
591
+ position: "relative",
592
+ width: "100%",
593
+ maxWidth: maxWidth ? `${maxWidth}px` : "100%",
594
+ aspectRatio: aspectValue,
595
+ borderRadius: `${borderRadius}px`,
596
+ overflow: "hidden"
597
+ },
598
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
599
+ "img",
600
+ {
601
+ src,
602
+ alt,
603
+ width,
604
+ height,
605
+ style: {
606
+ display: "block",
607
+ objectFit,
608
+ objectPosition,
609
+ width: "100%",
610
+ height: "100%"
611
+ },
612
+ loading,
613
+ className: shadowClasses[shadow]
614
+ }
615
+ )
616
+ }
617
+ );
618
+ const content = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
619
+ "figure",
620
+ {
621
+ className: "external-image-container",
622
+ style: {
623
+ margin: 0,
624
+ display: "flex",
625
+ flexDirection: "column",
626
+ alignItems: alignmentStyles[alignment],
627
+ width: "100%"
628
+ },
629
+ children: [
630
+ link ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
631
+ "a",
632
+ {
633
+ href: link,
634
+ target: openInNewTab ? "_blank" : "_self",
635
+ rel: openInNewTab ? "noopener noreferrer" : void 0,
636
+ style: {
637
+ display: "block",
638
+ width: "100%",
639
+ maxWidth: maxWidth ? `${maxWidth}px` : "100%"
640
+ },
641
+ children: imageElement
642
+ }
643
+ ) : imageElement,
644
+ caption && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
645
+ "figcaption",
646
+ {
647
+ style: {
648
+ marginTop: "0.5rem",
649
+ fontSize: "0.875rem",
650
+ color: "#6b7280",
651
+ textAlign: alignment,
652
+ maxWidth: maxWidth ? `${maxWidth}px` : "100%",
653
+ width: "100%"
654
+ },
655
+ children: caption
656
+ }
657
+ )
658
+ ]
659
+ }
660
+ );
661
+ return content;
662
+ }
663
+ };
664
+
665
+ // src/components/Space/index.tsx
666
+ var import_jsx_runtime4 = require("react/jsx-runtime");
667
+ var Space = {
668
+ label: "Space",
669
+ fields: {
670
+ height: {
671
+ type: "number",
672
+ label: "Height (Desktop)",
673
+ min: 0,
674
+ max: 500
675
+ },
676
+ mobileHeight: {
677
+ type: "number",
678
+ label: "Height (Mobile)",
679
+ min: 0,
680
+ max: 300
681
+ },
682
+ width: {
683
+ type: "number",
684
+ label: "Width (0 = full width)",
685
+ min: 0,
686
+ max: 2e3
687
+ },
688
+ mobileWidth: {
689
+ type: "number",
690
+ label: "Width Mobile (0 = full width)",
691
+ min: 0,
692
+ max: 1e3
693
+ },
694
+ backgroundColor: {
695
+ type: "text",
696
+ label: "Background Color"
697
+ },
698
+ showDivider: {
699
+ type: "radio",
700
+ label: "Show Divider Line",
701
+ options: [
702
+ { label: "Yes", value: true },
703
+ { label: "No", value: false }
704
+ ]
705
+ },
706
+ dividerColor: {
707
+ type: "text",
708
+ label: "Divider Color"
709
+ },
710
+ dividerStyle: {
711
+ type: "select",
712
+ label: "Divider Style",
713
+ options: [
714
+ { label: "Solid", value: "solid" },
715
+ { label: "Dashed", value: "dashed" },
716
+ { label: "Dotted", value: "dotted" }
717
+ ]
718
+ },
719
+ dividerThickness: {
720
+ type: "number",
721
+ label: "Divider Thickness (px)",
722
+ min: 1,
723
+ max: 10
724
+ }
725
+ },
726
+ defaultProps: {
727
+ height: 40,
728
+ width: 0,
729
+ mobileHeight: 20,
730
+ mobileWidth: 0,
731
+ backgroundColor: "transparent",
732
+ showDivider: false,
733
+ dividerColor: "#e5e7eb",
734
+ dividerStyle: "solid",
735
+ dividerThickness: 1
736
+ },
737
+ render: ({
738
+ height = 40,
739
+ width = 0,
740
+ mobileHeight = 20,
741
+ mobileWidth = 0,
742
+ backgroundColor = "transparent",
743
+ showDivider = false,
744
+ dividerColor = "#e5e7eb",
745
+ dividerStyle = "solid",
746
+ dividerThickness = 1
747
+ }) => {
748
+ const dividerStyles = showDivider ? {
749
+ borderTop: `${dividerThickness}px ${dividerStyle} ${dividerColor}`
750
+ } : {};
751
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
752
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
753
+ "div",
754
+ {
755
+ className: "puck-space",
756
+ style: {
757
+ height: `${height}px`,
758
+ width: width ? `${width}px` : "100%",
759
+ backgroundColor,
760
+ ...dividerStyles
761
+ },
762
+ "aria-hidden": "true"
763
+ }
764
+ ),
765
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("style", { children: `
766
+ @media (max-width: 768px) {
767
+ .puck-space {
768
+ height: ${mobileHeight}px !important;
769
+ width: ${mobileWidth ? `${mobileWidth}px` : "100%"} !important;
770
+ }
771
+ }
772
+ ` })
773
+ ] });
774
+ }
775
+ };
776
+ // Annotate the CommonJS export names for ESM import in node:
777
+ 0 && (module.exports = {
778
+ Accordion,
779
+ Editor,
780
+ Image,
781
+ Space
782
+ });
783
+ //# sourceMappingURL=index.js.map