@mission-studio/puck 1.0.21 → 1.0.24

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 (33) hide show
  1. package/dist/Popup-Dg78fu78.d.mts +260 -0
  2. package/dist/Popup-L7kcJo05.d.ts +260 -0
  3. package/dist/ResponsiveToggleField-65CqZEK-.d.mts +10 -0
  4. package/dist/ResponsiveToggleField-QCve94L_.d.ts +10 -0
  5. package/dist/chunk-MYS3PLMF.mjs +463 -0
  6. package/dist/chunk-TRPKXVMO.mjs +695 -0
  7. package/dist/{chunk-MWW5LYLN.mjs → chunk-YIPEC4L4.mjs} +709 -1075
  8. package/dist/components/page/astro/index.d.mts +54 -0
  9. package/dist/components/page/astro/index.d.ts +54 -0
  10. package/dist/components/page/astro/index.js +2056 -0
  11. package/dist/components/page/astro/index.mjs +51 -0
  12. package/dist/config/server.js +630 -700
  13. package/dist/config/server.mjs +33 -83
  14. package/dist/config-entry.js +592 -478
  15. package/dist/config-entry.mjs +11 -11
  16. package/dist/{ResponsiveToggleField-CfBKL5oY.d.ts → defaults-j55hBQHu.d.mts} +2 -8
  17. package/dist/{ResponsiveToggleField-BihXsGIJ.d.mts → defaults-z8Ft2j5r.d.ts} +2 -8
  18. package/dist/editor.d.mts +5 -4
  19. package/dist/editor.d.ts +5 -4
  20. package/dist/index.d.mts +5 -3
  21. package/dist/index.d.ts +5 -3
  22. package/dist/index.js +388 -274
  23. package/dist/index.mjs +11 -11
  24. package/dist/renderer.d.mts +9 -250
  25. package/dist/renderer.d.ts +9 -250
  26. package/dist/renderer.js +388 -274
  27. package/dist/renderer.mjs +11 -11
  28. package/dist/resolve/index.d.mts +1 -1
  29. package/dist/resolve/index.d.ts +1 -1
  30. package/dist/{types-D-CIduaE.d.mts → types-HQ6hIbYr.d.mts} +1 -1
  31. package/dist/{types-D-CIduaE.d.ts → types-HQ6hIbYr.d.ts} +1 -1
  32. package/package.json +6 -1
  33. package/dist/chunk-WFLVAZV2.mjs +0 -142
@@ -0,0 +1,463 @@
1
+ import {
2
+ dotsContainerStyle,
3
+ getArrowStyle,
4
+ getBaseStyle,
5
+ getCaptionStyle,
6
+ getCardStyle,
7
+ getContainerStyle,
8
+ getContainerStyle2,
9
+ getContainerStyle3,
10
+ getDotStyle,
11
+ getEmptyState,
12
+ getHeadingStyle,
13
+ getHrStyle,
14
+ getImageStyle,
15
+ getParagraphStyle,
16
+ getSectionStyle,
17
+ getSlideContainerStyle,
18
+ getVariantStyles,
19
+ getVisibilityClasses,
20
+ getWrapperStyle,
21
+ getWrapperStyle2,
22
+ getWrapperStyle3,
23
+ getWrapperStyle4,
24
+ icons,
25
+ imageStyle,
26
+ sizeMap,
27
+ sizeMap2,
28
+ slideStyle
29
+ } from "./chunk-YIPEC4L4.mjs";
30
+ import {
31
+ getShadowCSS
32
+ } from "./chunk-PJXZC564.mjs";
33
+ import {
34
+ cn
35
+ } from "./chunk-C6V3YUPF.mjs";
36
+
37
+ // components/page/astro/Heading.tsx
38
+ import { jsx } from "react/jsx-runtime";
39
+ function Heading({
40
+ text,
41
+ level = "h2",
42
+ size = "2xl",
43
+ weight = "bold",
44
+ color = "rgba(0, 0, 0, 1)",
45
+ align = "left",
46
+ letterSpacing = "normal",
47
+ lineHeight = "tight",
48
+ id
49
+ }) {
50
+ const resolvedText = text || "";
51
+ const Tag = level;
52
+ const style = getHeadingStyle({
53
+ size,
54
+ weight,
55
+ color,
56
+ align,
57
+ letterSpacing,
58
+ lineHeight
59
+ });
60
+ if (!resolvedText) return null;
61
+ return /* @__PURE__ */ jsx(Tag, { id, style, children: resolvedText });
62
+ }
63
+
64
+ // components/page/astro/Paragraph.tsx
65
+ import { jsx as jsx2 } from "react/jsx-runtime";
66
+ function Paragraph({
67
+ text,
68
+ size = "base",
69
+ weight = "normal",
70
+ color = "rgba(0, 0, 0, 1)",
71
+ align = "left",
72
+ lineHeight = "normal",
73
+ maxWidth,
74
+ id
75
+ }) {
76
+ const resolvedText = text || "";
77
+ const style = getParagraphStyle({
78
+ size,
79
+ weight,
80
+ color,
81
+ align,
82
+ lineHeight,
83
+ maxWidth
84
+ });
85
+ if (!resolvedText) return null;
86
+ return /* @__PURE__ */ jsx2("p", { id, style, children: resolvedText });
87
+ }
88
+
89
+ // components/page/astro/Button.tsx
90
+ import { jsx as jsx3 } from "react/jsx-runtime";
91
+ function Button({
92
+ text,
93
+ href,
94
+ target = "_self",
95
+ variant = "solid",
96
+ size = "md",
97
+ color,
98
+ textColor,
99
+ borderRadius = "md",
100
+ fullWidth = false,
101
+ align = "center",
102
+ id
103
+ }) {
104
+ const resolvedText = typeof text === "string" ? text : "Button";
105
+ const bgColor = typeof color === "string" ? color : "rgba(99, 102, 241, 1)";
106
+ const fgColor = typeof textColor === "string" ? textColor : variant === "solid" ? "rgba(255, 255, 255, 1)" : bgColor;
107
+ const baseStyle = getBaseStyle(size, borderRadius, fullWidth);
108
+ const variantStyle = getVariantStyles(variant, bgColor, fgColor);
109
+ const style = { ...baseStyle, ...variantStyle };
110
+ const wrapperStyle = getWrapperStyle(align);
111
+ const dataAttrs = {
112
+ "data-gtm-event": "button_click",
113
+ "data-gtm-text": resolvedText,
114
+ "data-gtm-href": href || "",
115
+ "data-gtm-variant": variant
116
+ };
117
+ if (href) {
118
+ return /* @__PURE__ */ jsx3("div", { style: wrapperStyle, children: /* @__PURE__ */ jsx3(
119
+ "a",
120
+ {
121
+ id,
122
+ href,
123
+ target,
124
+ style,
125
+ rel: target === "_blank" ? "noopener noreferrer" : void 0,
126
+ ...dataAttrs,
127
+ children: resolvedText
128
+ }
129
+ ) });
130
+ }
131
+ return /* @__PURE__ */ jsx3("div", { style: wrapperStyle, children: /* @__PURE__ */ jsx3("button", { id, type: "button", style, ...dataAttrs, children: resolvedText }) });
132
+ }
133
+
134
+ // components/page/astro/Image.tsx
135
+ import { jsx as jsx4, jsxs } from "react/jsx-runtime";
136
+ function Image({
137
+ src,
138
+ alt = "",
139
+ width = "full",
140
+ aspectRatio = "auto",
141
+ objectFit = "cover",
142
+ borderRadius = "none",
143
+ shadow = "none",
144
+ align = "center",
145
+ caption,
146
+ captionColor,
147
+ id
148
+ }) {
149
+ const resolvedSrc = typeof src === "string" ? src : "";
150
+ const resolvedCaption = typeof caption === "string" ? caption : "";
151
+ const resolvedCaptionColorStr = typeof captionColor === "string" ? captionColor : "rgba(107, 114, 128, 1)";
152
+ const wrapperStyle = getWrapperStyle2(align);
153
+ const imageStyle2 = getImageStyle(
154
+ width,
155
+ aspectRatio,
156
+ objectFit,
157
+ borderRadius,
158
+ shadow
159
+ );
160
+ const captionStyle = getCaptionStyle(align, width, resolvedCaptionColorStr);
161
+ if (!resolvedSrc) {
162
+ return /* @__PURE__ */ jsx4("div", { style: wrapperStyle, children: /* @__PURE__ */ jsx4(
163
+ "div",
164
+ {
165
+ style: {
166
+ ...imageStyle2,
167
+ backgroundColor: "#e5e7eb",
168
+ display: "flex",
169
+ alignItems: "center",
170
+ justifyContent: "center",
171
+ minHeight: "200px",
172
+ color: "#9ca3af"
173
+ },
174
+ children: "No image"
175
+ }
176
+ ) });
177
+ }
178
+ return /* @__PURE__ */ jsxs("figure", { id, style: { ...wrapperStyle, margin: 0 }, children: [
179
+ /* @__PURE__ */ jsx4("img", { src: resolvedSrc, alt, style: imageStyle2, loading: "lazy" }),
180
+ resolvedCaption && /* @__PURE__ */ jsx4("figcaption", { style: captionStyle, children: resolvedCaption })
181
+ ] });
182
+ }
183
+
184
+ // components/page/astro/ImageCarousel.tsx
185
+ import { useState } from "react";
186
+ import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
187
+ function ImageCarousel({
188
+ images = [],
189
+ aspectRatio = "16:9",
190
+ borderRadius = "none",
191
+ showDots = true,
192
+ showArrows = true,
193
+ arrowColor,
194
+ dotColor,
195
+ id
196
+ }) {
197
+ const [currentIndex, setCurrentIndex] = useState(0);
198
+ const arrowColorStr = typeof arrowColor === "string" ? arrowColor : "rgba(255, 255, 255, 1)";
199
+ const dotColorStr = typeof dotColor === "string" ? dotColor : "rgba(99, 102, 241, 1)";
200
+ const goToPrevious = () => {
201
+ const newIndex = currentIndex === 0 ? images.length - 1 : currentIndex - 1;
202
+ setCurrentIndex(newIndex);
203
+ if (typeof window !== "undefined") {
204
+ window.dispatchEvent(
205
+ new CustomEvent("carousel_navigate", {
206
+ detail: {
207
+ direction: "previous",
208
+ slideIndex: newIndex,
209
+ totalSlides: images.length
210
+ }
211
+ })
212
+ );
213
+ }
214
+ };
215
+ const goToNext = () => {
216
+ const newIndex = currentIndex === images.length - 1 ? 0 : currentIndex + 1;
217
+ setCurrentIndex(newIndex);
218
+ if (typeof window !== "undefined") {
219
+ window.dispatchEvent(
220
+ new CustomEvent("carousel_navigate", {
221
+ detail: {
222
+ direction: "next",
223
+ slideIndex: newIndex,
224
+ totalSlides: images.length
225
+ }
226
+ })
227
+ );
228
+ }
229
+ };
230
+ const goToSlide = (index) => {
231
+ setCurrentIndex(index);
232
+ if (typeof window !== "undefined") {
233
+ window.dispatchEvent(
234
+ new CustomEvent("carousel_navigate", {
235
+ detail: {
236
+ direction: "direct",
237
+ slideIndex: index,
238
+ totalSlides: images.length
239
+ }
240
+ })
241
+ );
242
+ }
243
+ };
244
+ if (images.length === 0) {
245
+ return /* @__PURE__ */ jsx5("div", { style: getEmptyState(aspectRatio, borderRadius), children: "No images" });
246
+ }
247
+ return /* @__PURE__ */ jsxs2("div", { id, style: getContainerStyle(aspectRatio, borderRadius), children: [
248
+ /* @__PURE__ */ jsx5("div", { style: getSlideContainerStyle(currentIndex), children: images.map((image, index) => /* @__PURE__ */ jsx5("div", { style: slideStyle, children: /* @__PURE__ */ jsx5(
249
+ "img",
250
+ {
251
+ src: image.src,
252
+ alt: image.alt || "",
253
+ style: imageStyle,
254
+ loading: "lazy"
255
+ }
256
+ ) }, index)) }),
257
+ showArrows && images.length > 1 && /* @__PURE__ */ jsxs2(Fragment, { children: [
258
+ /* @__PURE__ */ jsx5(
259
+ "button",
260
+ {
261
+ type: "button",
262
+ onClick: goToPrevious,
263
+ style: { ...getArrowStyle(arrowColorStr), left: "16px" },
264
+ "aria-label": "Previous slide",
265
+ children: "\u2039"
266
+ }
267
+ ),
268
+ /* @__PURE__ */ jsx5(
269
+ "button",
270
+ {
271
+ type: "button",
272
+ onClick: goToNext,
273
+ style: { ...getArrowStyle(arrowColorStr), right: "16px" },
274
+ "aria-label": "Next slide",
275
+ children: "\u203A"
276
+ }
277
+ )
278
+ ] }),
279
+ showDots && images.length > 1 && /* @__PURE__ */ jsx5("div", { style: dotsContainerStyle, children: images.map((_, index) => /* @__PURE__ */ jsx5(
280
+ "button",
281
+ {
282
+ type: "button",
283
+ onClick: () => goToSlide(index),
284
+ style: getDotStyle(index === currentIndex, dotColorStr),
285
+ "aria-label": `Go to slide ${index + 1}`
286
+ },
287
+ index
288
+ )) })
289
+ ] });
290
+ }
291
+
292
+ // components/page/astro/Icon.tsx
293
+ import { jsx as jsx6 } from "react/jsx-runtime";
294
+ function Icon({
295
+ name = "check",
296
+ size = "md",
297
+ color,
298
+ align = "center",
299
+ id
300
+ }) {
301
+ const colorValue = typeof color === "string" ? color : "rgba(99, 102, 241, 1)";
302
+ const IconComponent = icons[name.toLowerCase()] || icons.check;
303
+ const { size: iconSize, strokeWidth } = sizeMap[size];
304
+ const wrapperStyle = getWrapperStyle3(align);
305
+ return /* @__PURE__ */ jsx6("div", { id, style: wrapperStyle, children: /* @__PURE__ */ jsx6(
306
+ IconComponent,
307
+ {
308
+ size: iconSize,
309
+ color: colorValue,
310
+ strokeWidth
311
+ }
312
+ ) });
313
+ }
314
+
315
+ // components/page/astro/Section.tsx
316
+ import { jsx as jsx7 } from "react/jsx-runtime";
317
+ function Section({
318
+ children: _children,
319
+ verticalPadding = 48,
320
+ horizontalPadding = 32,
321
+ gap = 24,
322
+ backgroundColor,
323
+ backgroundImage,
324
+ shadow = "none",
325
+ borderRadius = 0,
326
+ contentMaxWidth = "1400px",
327
+ anchorLink,
328
+ visibility,
329
+ puck
330
+ }) {
331
+ const DropZone = puck?.renderDropZone;
332
+ const bgColor = typeof backgroundColor === "string" ? backgroundColor : void 0;
333
+ const style = {
334
+ ...getSectionStyle(
335
+ verticalPadding,
336
+ horizontalPadding,
337
+ gap,
338
+ bgColor,
339
+ backgroundImage,
340
+ shadow,
341
+ borderRadius
342
+ ),
343
+ boxShadow: getShadowCSS(shadow)
344
+ };
345
+ return /* @__PURE__ */ jsx7(
346
+ "section",
347
+ {
348
+ id: anchorLink,
349
+ className: cn("flex w-full flex-col", getVisibilityClasses(visibility)),
350
+ style,
351
+ children: /* @__PURE__ */ jsx7("div", { className: "mx-auto w-full", style: { maxWidth: contentMaxWidth }, children: DropZone && /* @__PURE__ */ jsx7(DropZone, { zone: "content" }) })
352
+ }
353
+ );
354
+ }
355
+
356
+ // components/page/astro/Container.tsx
357
+ import { jsx as jsx8 } from "react/jsx-runtime";
358
+ function Container({
359
+ maxWidth = "lg",
360
+ padding,
361
+ paddingX = "md",
362
+ paddingY = "none",
363
+ backgroundColor,
364
+ centered = true,
365
+ id,
366
+ puck
367
+ }) {
368
+ const DropZone = puck?.renderDropZone;
369
+ const bgColor = typeof backgroundColor === "string" ? backgroundColor : void 0;
370
+ const effectivePaddingX = padding || paddingX;
371
+ const effectivePaddingY = padding || paddingY;
372
+ const style = getContainerStyle2(
373
+ maxWidth,
374
+ effectivePaddingX,
375
+ effectivePaddingY,
376
+ centered,
377
+ bgColor
378
+ );
379
+ return /* @__PURE__ */ jsx8("div", { id, style, children: DropZone && /* @__PURE__ */ jsx8(DropZone, { zone: "container-content" }) });
380
+ }
381
+
382
+ // components/page/astro/Columns.tsx
383
+ import { jsx as jsx9 } from "react/jsx-runtime";
384
+ function Columns({
385
+ columns = 2,
386
+ gap = "md",
387
+ verticalAlign = "top",
388
+ stackOnMobile = true,
389
+ id,
390
+ puck
391
+ }) {
392
+ const DropZone = puck?.renderDropZone;
393
+ const containerStyle = getContainerStyle3(columns, gap, verticalAlign);
394
+ return /* @__PURE__ */ jsx9("div", { id, style: containerStyle, children: Array.from({ length: columns }).map((_, index) => /* @__PURE__ */ jsx9("div", { style: { minWidth: 0 }, children: DropZone && /* @__PURE__ */ jsx9(DropZone, { zone: `column-${index}` }) }, index)) });
395
+ }
396
+
397
+ // components/page/astro/Card.tsx
398
+ import { jsx as jsx10 } from "react/jsx-runtime";
399
+ function Card({
400
+ backgroundColor,
401
+ borderColor,
402
+ borderWidth = "thin",
403
+ borderRadius = "md",
404
+ shadow = "sm",
405
+ padding = "md",
406
+ id,
407
+ puck
408
+ }) {
409
+ const DropZone = puck?.renderDropZone;
410
+ const bgColor = typeof backgroundColor === "string" ? backgroundColor : "rgba(255, 255, 255, 1)";
411
+ const bColor = typeof borderColor === "string" ? borderColor : "rgba(229, 231, 235, 1)";
412
+ const style = getCardStyle(
413
+ bgColor,
414
+ bColor,
415
+ borderWidth,
416
+ borderRadius,
417
+ shadow,
418
+ padding
419
+ );
420
+ return /* @__PURE__ */ jsx10("div", { id, style, children: DropZone && /* @__PURE__ */ jsx10(DropZone, { zone: "card-content" }) });
421
+ }
422
+
423
+ // components/page/astro/Divider.tsx
424
+ import { jsx as jsx11 } from "react/jsx-runtime";
425
+ function Divider({
426
+ style: lineStyle = "solid",
427
+ thickness = "thin",
428
+ color,
429
+ width = "full",
430
+ align = "center",
431
+ spacing = "md",
432
+ id
433
+ }) {
434
+ const colorValue = typeof color === "string" ? color : "rgba(107, 114, 128, 1)";
435
+ const wrapperStyle = getWrapperStyle4(align, spacing);
436
+ const hrStyle = getHrStyle(width, thickness, lineStyle, colorValue);
437
+ return /* @__PURE__ */ jsx11("div", { id, style: wrapperStyle, children: /* @__PURE__ */ jsx11("hr", { style: hrStyle }) });
438
+ }
439
+
440
+ // components/page/astro/Spacer.tsx
441
+ import { jsx as jsx12 } from "react/jsx-runtime";
442
+ function Spacer({ size = "md", id }) {
443
+ const style = {
444
+ height: sizeMap2[size],
445
+ width: "100%"
446
+ };
447
+ return /* @__PURE__ */ jsx12("div", { id, style, "aria-hidden": "true" });
448
+ }
449
+
450
+ export {
451
+ Heading,
452
+ Paragraph,
453
+ Button,
454
+ Image,
455
+ ImageCarousel,
456
+ Icon,
457
+ Section,
458
+ Container,
459
+ Columns,
460
+ Card,
461
+ Divider,
462
+ Spacer
463
+ };