@mission-studio/puck 1.0.19 → 1.0.21

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.
@@ -8,24 +8,76 @@ import {
8
8
  FeatureGrid,
9
9
  FeaturesList,
10
10
  Footer,
11
- Heading,
12
11
  Icon,
13
12
  Image,
14
13
  ImageCarousel,
15
- Paragraph,
16
14
  Popup,
17
15
  Section,
18
16
  Spacer,
19
17
  TextBlock,
20
18
  Topbar,
21
- VideoEmbed
22
- } from "../chunk-723Z3YKC.mjs";
19
+ VideoEmbed,
20
+ getHeadingStyle,
21
+ getParagraphStyle
22
+ } from "../chunk-MWW5LYLN.mjs";
23
23
  import "../chunk-PJXZC564.mjs";
24
24
  import "../chunk-QSWQDR6M.mjs";
25
25
  import "../chunk-C6V3YUPF.mjs";
26
26
 
27
- // config/server.tsx
27
+ // components/page/astro/Heading.tsx
28
28
  import { jsx } from "react/jsx-runtime";
29
+ function Heading({
30
+ text,
31
+ level = "h2",
32
+ size = "2xl",
33
+ weight = "bold",
34
+ color = "rgba(0, 0, 0, 1)",
35
+ align = "left",
36
+ letterSpacing = "normal",
37
+ lineHeight = "tight",
38
+ id
39
+ }) {
40
+ const resolvedText = text || "";
41
+ const Tag = level;
42
+ const style = getHeadingStyle({
43
+ size,
44
+ weight,
45
+ color,
46
+ align,
47
+ letterSpacing,
48
+ lineHeight
49
+ });
50
+ if (!resolvedText) return null;
51
+ return /* @__PURE__ */ jsx(Tag, { id, style, children: resolvedText });
52
+ }
53
+
54
+ // components/page/astro/Paragraph.tsx
55
+ import { jsx as jsx2 } from "react/jsx-runtime";
56
+ function Paragraph({
57
+ text,
58
+ size = "base",
59
+ weight = "normal",
60
+ color = "rgba(0, 0, 0, 1)",
61
+ align = "left",
62
+ lineHeight = "normal",
63
+ maxWidth,
64
+ id
65
+ }) {
66
+ const resolvedText = text || "";
67
+ const style = getParagraphStyle({
68
+ size,
69
+ weight,
70
+ color,
71
+ align,
72
+ lineHeight,
73
+ maxWidth
74
+ });
75
+ if (!resolvedText) return null;
76
+ return /* @__PURE__ */ jsx2("p", { id, style, children: resolvedText });
77
+ }
78
+
79
+ // config/server.tsx
80
+ import { jsx as jsx3 } from "react/jsx-runtime";
29
81
  var config = {
30
82
  categories: {
31
83
  typography: {
@@ -67,64 +119,64 @@ var config = {
67
119
  },
68
120
  components: {
69
121
  Heading: {
70
- render: (props) => /* @__PURE__ */ jsx(Heading, { ...props })
122
+ render: (props) => /* @__PURE__ */ jsx3(Heading, { ...props })
71
123
  },
72
124
  Paragraph: {
73
- render: (props) => /* @__PURE__ */ jsx(Paragraph, { ...props })
125
+ render: (props) => /* @__PURE__ */ jsx3(Paragraph, { ...props })
74
126
  },
75
127
  Button: {
76
- render: (props) => /* @__PURE__ */ jsx(Button, { ...props })
128
+ render: (props) => /* @__PURE__ */ jsx3(Button, { ...props })
77
129
  },
78
130
  Image: {
79
- render: (props) => /* @__PURE__ */ jsx(Image, { ...props })
131
+ render: (props) => /* @__PURE__ */ jsx3(Image, { ...props })
80
132
  },
81
133
  ImageCarousel: {
82
- render: (props) => /* @__PURE__ */ jsx(ImageCarousel, { ...props })
134
+ render: (props) => /* @__PURE__ */ jsx3(ImageCarousel, { ...props })
83
135
  },
84
136
  VideoEmbed: {
85
- render: (props) => /* @__PURE__ */ jsx(VideoEmbed, { ...props })
137
+ render: (props) => /* @__PURE__ */ jsx3(VideoEmbed, { ...props })
86
138
  },
87
139
  Icon: {
88
- render: (props) => /* @__PURE__ */ jsx(Icon, { ...props })
140
+ render: (props) => /* @__PURE__ */ jsx3(Icon, { ...props })
89
141
  },
90
142
  Section: {
91
- render: (props) => /* @__PURE__ */ jsx(Section, { ...props })
143
+ render: (props) => /* @__PURE__ */ jsx3(Section, { ...props })
92
144
  },
93
145
  Container: {
94
- render: (props) => /* @__PURE__ */ jsx(Container, { ...props })
146
+ render: (props) => /* @__PURE__ */ jsx3(Container, { ...props })
95
147
  },
96
148
  Columns: {
97
- render: (props) => /* @__PURE__ */ jsx(Columns, { ...props })
149
+ render: (props) => /* @__PURE__ */ jsx3(Columns, { ...props })
98
150
  },
99
151
  Card: {
100
- render: (props) => /* @__PURE__ */ jsx(Card, { ...props })
152
+ render: (props) => /* @__PURE__ */ jsx3(Card, { ...props })
101
153
  },
102
154
  Divider: {
103
- render: (props) => /* @__PURE__ */ jsx(Divider, { ...props })
155
+ render: (props) => /* @__PURE__ */ jsx3(Divider, { ...props })
104
156
  },
105
157
  Spacer: {
106
- render: (props) => /* @__PURE__ */ jsx(Spacer, { ...props })
158
+ render: (props) => /* @__PURE__ */ jsx3(Spacer, { ...props })
107
159
  },
108
160
  TextBlock: {
109
- render: (props) => /* @__PURE__ */ jsx(TextBlock, { ...props })
161
+ render: (props) => /* @__PURE__ */ jsx3(TextBlock, { ...props })
110
162
  },
111
163
  CustomImage: {
112
- render: (props) => /* @__PURE__ */ jsx(CustomImage, { ...props })
164
+ render: (props) => /* @__PURE__ */ jsx3(CustomImage, { ...props })
113
165
  },
114
166
  FeaturesList: {
115
- render: (props) => /* @__PURE__ */ jsx(FeaturesList, { ...props })
167
+ render: (props) => /* @__PURE__ */ jsx3(FeaturesList, { ...props })
116
168
  },
117
169
  FeatureGrid: {
118
- render: (props) => /* @__PURE__ */ jsx(FeatureGrid, { ...props })
170
+ render: (props) => /* @__PURE__ */ jsx3(FeatureGrid, { ...props })
119
171
  },
120
172
  Footer: {
121
- render: (props) => /* @__PURE__ */ jsx(Footer, { ...props })
173
+ render: (props) => /* @__PURE__ */ jsx3(Footer, { ...props })
122
174
  },
123
175
  Topbar: {
124
- render: (props) => /* @__PURE__ */ jsx(Topbar, { ...props })
176
+ render: (props) => /* @__PURE__ */ jsx3(Topbar, { ...props })
125
177
  },
126
178
  Popup: {
127
- render: (props) => /* @__PURE__ */ jsx(Popup, { ...props })
179
+ render: (props) => /* @__PURE__ */ jsx3(Popup, { ...props })
128
180
  }
129
181
  }
130
182
  };
@@ -154,9 +154,8 @@ function cn(...inputs) {
154
154
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
155
155
  }
156
156
 
157
- // components/page/Heading.tsx
158
- var import_jsx_runtime3 = require("react/jsx-runtime");
159
- var sizeMap = {
157
+ // components/page/primitives/Heading.ts
158
+ var headingSizeMap = {
160
159
  xs: "0.875rem",
161
160
  sm: "1rem",
162
161
  md: "1.25rem",
@@ -166,23 +165,37 @@ var sizeMap = {
166
165
  "3xl": "3rem",
167
166
  "4xl": "4rem"
168
167
  };
169
- var weightMap = {
168
+ var headingWeightMap = {
170
169
  normal: 400,
171
170
  medium: 500,
172
171
  semibold: 600,
173
172
  bold: 700,
174
173
  extrabold: 800
175
174
  };
176
- var letterSpacingMap = {
175
+ var headingLetterSpacingMap = {
177
176
  tight: "-0.025em",
178
177
  normal: "0",
179
178
  wide: "0.05em"
180
179
  };
181
- var lineHeightMap = {
180
+ var headingLineHeightMap = {
182
181
  tight: "1.1",
183
182
  normal: "1.4",
184
183
  relaxed: "1.6"
185
184
  };
185
+ function getHeadingStyle(props) {
186
+ return {
187
+ fontSize: headingSizeMap[props.size],
188
+ fontWeight: headingWeightMap[props.weight],
189
+ color: props.color,
190
+ textAlign: props.align,
191
+ letterSpacing: headingLetterSpacingMap[props.letterSpacing],
192
+ lineHeight: headingLineHeightMap[props.lineHeight],
193
+ margin: 0
194
+ };
195
+ }
196
+
197
+ // components/page/next/Heading.tsx
198
+ var import_jsx_runtime3 = require("react/jsx-runtime");
186
199
  function isThemeableValue(value) {
187
200
  return typeof value === "object" && value !== null && "useTheme" in value;
188
201
  }
@@ -214,47 +227,69 @@ function Heading({
214
227
  return "";
215
228
  })();
216
229
  const resolvedColor = (() => {
217
- if (!color) return resolveColor2("foreground");
218
- if (typeof color === "string") return { color, opacity: 100 };
230
+ if (!color)
231
+ return hexToRgba(
232
+ resolveColor2("foreground").color,
233
+ resolveColor2("foreground").opacity
234
+ );
235
+ if (typeof color === "string") return color;
219
236
  if (isThemeableValue(color)) {
220
- return color.useTheme ? resolveColor2(color.themeKey) : color.value;
221
- }
222
- if ("color" in color) return color;
223
- return resolveColor2("foreground");
237
+ return color.useTheme ? hexToRgba(
238
+ resolveColor2(color.themeKey).color,
239
+ resolveColor2(color.themeKey).opacity
240
+ ) : hexToRgba(color.value.color, color.value.opacity);
241
+ }
242
+ if ("color" in color) return hexToRgba(color.color, color.opacity);
243
+ return hexToRgba(
244
+ resolveColor2("foreground").color,
245
+ resolveColor2("foreground").opacity
246
+ );
224
247
  })();
225
248
  const Tag = level;
226
- const style = {
227
- fontSize: sizeMap[size4],
228
- fontWeight: weightMap[weight],
229
- color: hexToRgba(resolvedColor.color, resolvedColor.opacity),
230
- textAlign: align,
231
- letterSpacing: letterSpacingMap[letterSpacing],
232
- lineHeight: lineHeightMap[lineHeight],
233
- margin: 0
234
- };
249
+ const style = getHeadingStyle({
250
+ size: size4,
251
+ weight,
252
+ color: resolvedColor,
253
+ align,
254
+ letterSpacing,
255
+ lineHeight
256
+ });
235
257
  if (!resolvedText) return null;
236
258
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Tag, { id, style, children: resolvedText });
237
259
  }
238
260
 
239
- // components/page/Paragraph.tsx
240
- var import_jsx_runtime4 = require("react/jsx-runtime");
241
- var sizeMap2 = {
261
+ // components/page/primitives/Paragraph.ts
262
+ var paragraphSizeMap = {
242
263
  sm: "0.875rem",
243
264
  base: "1rem",
244
265
  lg: "1.125rem",
245
266
  xl: "1.25rem"
246
267
  };
247
- var weightMap2 = {
268
+ var paragraphWeightMap = {
248
269
  normal: 400,
249
270
  medium: 500,
250
271
  semibold: 600
251
272
  };
252
- var lineHeightMap2 = {
273
+ var paragraphLineHeightMap = {
253
274
  tight: "1.4",
254
275
  normal: "1.6",
255
276
  relaxed: "1.75",
256
277
  loose: "2"
257
278
  };
279
+ function getParagraphStyle(props) {
280
+ return {
281
+ fontSize: paragraphSizeMap[props.size],
282
+ fontWeight: paragraphWeightMap[props.weight],
283
+ color: props.color,
284
+ textAlign: props.align,
285
+ lineHeight: paragraphLineHeightMap[props.lineHeight],
286
+ maxWidth: props.maxWidth || void 0,
287
+ margin: 0
288
+ };
289
+ }
290
+
291
+ // components/page/next/Paragraph.tsx
292
+ var import_jsx_runtime4 = require("react/jsx-runtime");
258
293
  function isThemeableValue2(value) {
259
294
  return typeof value === "object" && value !== null && "useTheme" in value;
260
295
  }
@@ -285,23 +320,32 @@ function Paragraph({
285
320
  return "";
286
321
  })();
287
322
  const resolvedColor = (() => {
288
- if (!color) return resolveColor2("foreground");
289
- if (typeof color === "string") return { color, opacity: 100 };
323
+ if (!color)
324
+ return hexToRgba(
325
+ resolveColor2("foreground").color,
326
+ resolveColor2("foreground").opacity
327
+ );
328
+ if (typeof color === "string") return color;
290
329
  if (isThemeableValue2(color)) {
291
- return color.useTheme ? resolveColor2(color.themeKey) : color.value;
292
- }
293
- if ("color" in color) return color;
294
- return resolveColor2("foreground");
330
+ return color.useTheme ? hexToRgba(
331
+ resolveColor2(color.themeKey).color,
332
+ resolveColor2(color.themeKey).opacity
333
+ ) : hexToRgba(color.value.color, color.value.opacity);
334
+ }
335
+ if ("color" in color) return hexToRgba(color.color, color.opacity);
336
+ return hexToRgba(
337
+ resolveColor2("foreground").color,
338
+ resolveColor2("foreground").opacity
339
+ );
295
340
  })();
296
- const style = {
297
- fontSize: sizeMap2[size4],
298
- fontWeight: weightMap2[weight],
299
- color: hexToRgba(resolvedColor.color, resolvedColor.opacity),
300
- textAlign: align,
301
- lineHeight: lineHeightMap2[lineHeight],
302
- maxWidth: maxWidth || void 0,
303
- margin: 0
304
- };
341
+ const style = getParagraphStyle({
342
+ size: size4,
343
+ weight,
344
+ color: resolvedColor,
345
+ align,
346
+ lineHeight,
347
+ maxWidth
348
+ });
305
349
  if (!resolvedText) return null;
306
350
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id, style, children: resolvedText });
307
351
  }
@@ -962,7 +1006,7 @@ function VideoEmbed({
962
1006
 
963
1007
  // components/page/Icon.tsx
964
1008
  var import_jsx_runtime9 = require("react/jsx-runtime");
965
- var sizeMap3 = {
1009
+ var sizeMap = {
966
1010
  sm: { size: "16px", strokeWidth: 2 },
967
1011
  md: { size: "24px", strokeWidth: 2 },
968
1012
  lg: { size: "32px", strokeWidth: 1.5 },
@@ -1180,7 +1224,7 @@ function Icon({
1180
1224
  return resolveColor2("primary");
1181
1225
  })();
1182
1226
  const IconComponent = icons[name.toLowerCase()] || icons.check;
1183
- const { size: iconSize, strokeWidth } = sizeMap3[size4];
1227
+ const { size: iconSize, strokeWidth } = sizeMap[size4];
1184
1228
  const colorValue = hexToRgba(resolvedColor.color, resolvedColor.opacity);
1185
1229
  const wrapperStyle = {
1186
1230
  display: "flex",
@@ -1524,7 +1568,7 @@ function Divider({
1524
1568
 
1525
1569
  // components/page/Spacer.tsx
1526
1570
  var import_jsx_runtime15 = require("react/jsx-runtime");
1527
- var sizeMap4 = {
1571
+ var sizeMap2 = {
1528
1572
  xs: "8px",
1529
1573
  sm: "16px",
1530
1574
  md: "24px",
@@ -1535,7 +1579,7 @@ var sizeMap4 = {
1535
1579
  };
1536
1580
  function Spacer({ size: size4 = "md", id }) {
1537
1581
  const style = {
1538
- height: sizeMap4[size4],
1582
+ height: sizeMap2[size4],
1539
1583
  width: "100%"
1540
1584
  };
1541
1585
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id, style, "aria-hidden": "true" });
@@ -1548,7 +1592,7 @@ var alignmentMap = {
1548
1592
  center: "text-center",
1549
1593
  right: "text-right"
1550
1594
  };
1551
- var sizeMap5 = {
1595
+ var sizeMap3 = {
1552
1596
  small: "text-2xl",
1553
1597
  "medium-small": "text-3xl",
1554
1598
  medium: "text-4xl",
@@ -1637,7 +1681,7 @@ function TextBlock({
1637
1681
  resolvedTitle && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1638
1682
  "h2",
1639
1683
  {
1640
- className: cn("font-bold", sizeMap5[textSize]),
1684
+ className: cn("font-bold", sizeMap3[textSize]),
1641
1685
  style: gradientStyle,
1642
1686
  children: resolvedTitle
1643
1687
  }
@@ -1691,7 +1735,7 @@ function CustomImage({
1691
1735
  // components/page/FeaturesList.tsx
1692
1736
  var import_lucide_react = require("lucide-react");
1693
1737
  var import_jsx_runtime18 = require("react/jsx-runtime");
1694
- var sizeMap6 = {
1738
+ var sizeMap4 = {
1695
1739
  small: { icon: 24, title: "text-base", desc: "text-sm" },
1696
1740
  medium: { icon: 32, title: "text-lg", desc: "text-base" },
1697
1741
  large: { icon: 48, title: "text-xl", desc: "text-lg" }
@@ -1703,7 +1747,7 @@ function FeaturesList({
1703
1747
  iconColor = "#000000",
1704
1748
  anchorLink
1705
1749
  }) {
1706
- const sizeConfig = sizeMap6[size4];
1750
+ const sizeConfig = sizeMap4[size4];
1707
1751
  const getIcon = (iconName) => {
1708
1752
  const formatted = iconName.charAt(0).toUpperCase() + iconName.slice(1);
1709
1753
  return import_lucide_react.icons[formatted] || null;
@@ -1760,7 +1804,7 @@ function FeaturesList({
1760
1804
  // components/page/FeatureGrid.tsx
1761
1805
  var import_lucide_react2 = require("lucide-react");
1762
1806
  var import_jsx_runtime19 = require("react/jsx-runtime");
1763
- var sizeMap7 = {
1807
+ var sizeMap5 = {
1764
1808
  small: { icon: 24, title: "text-base", desc: "text-sm" },
1765
1809
  medium: { icon: 32, title: "text-lg", desc: "text-base" },
1766
1810
  large: { icon: 48, title: "text-xl", desc: "text-lg" }
@@ -1776,7 +1820,7 @@ function FeatureGrid({
1776
1820
  textColor = "#000000",
1777
1821
  anchorLink
1778
1822
  }) {
1779
- const sizeConfig = sizeMap7[size4];
1823
+ const sizeConfig = sizeMap5[size4];
1780
1824
  const getIcon = (iconName) => {
1781
1825
  const formatted = iconName.charAt(0).toUpperCase() + iconName.slice(1);
1782
1826
  return import_lucide_react2.icons[formatted] || null;
@@ -2043,7 +2087,7 @@ var widthMap3 = {
2043
2087
  medium: "max-w-lg",
2044
2088
  large: "max-w-2xl"
2045
2089
  };
2046
- var sizeMap8 = {
2090
+ var sizeMap6 = {
2047
2091
  small: "px-3 py-1.5 text-sm",
2048
2092
  medium: "px-4 py-2 text-base",
2049
2093
  large: "px-6 py-3 text-lg"
@@ -2088,7 +2132,7 @@ function Popup({
2088
2132
  onClick: handleOpen,
2089
2133
  className: cn(
2090
2134
  "flex items-center gap-2 rounded-full font-medium",
2091
- sizeMap8[size4]
2135
+ sizeMap6[size4]
2092
2136
  ),
2093
2137
  style: { backgroundColor: buttonColor, color: textColor },
2094
2138
  children: [
@@ -8,6 +8,10 @@ import {
8
8
  createThemeableColorField
9
9
  } from "./chunk-VF4NOAJG.mjs";
10
10
  import "./chunk-A3QDUUOF.mjs";
11
+ import {
12
+ Heading,
13
+ Paragraph
14
+ } from "./chunk-WFLVAZV2.mjs";
11
15
  import {
12
16
  Button,
13
17
  Card,
@@ -18,11 +22,9 @@ import {
18
22
  FeatureGrid,
19
23
  FeaturesList,
20
24
  Footer,
21
- Heading,
22
25
  Icon,
23
26
  Image,
24
27
  ImageCarousel,
25
- Paragraph,
26
28
  Popup,
27
29
  Section,
28
30
  Spacer,
@@ -30,7 +32,7 @@ import {
30
32
  Topbar,
31
33
  VideoEmbed,
32
34
  availableIcons
33
- } from "./chunk-723Z3YKC.mjs";
35
+ } from "./chunk-MWW5LYLN.mjs";
34
36
  import "./chunk-PJXZC564.mjs";
35
37
  import "./chunk-QSWQDR6M.mjs";
36
38
  import "./chunk-C6V3YUPF.mjs";