@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.
package/dist/renderer.js CHANGED
@@ -171,9 +171,8 @@ function cn(...inputs) {
171
171
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
172
172
  }
173
173
 
174
- // components/page/Heading.tsx
175
- var import_jsx_runtime3 = require("react/jsx-runtime");
176
- var sizeMap = {
174
+ // components/page/primitives/Heading.ts
175
+ var headingSizeMap = {
177
176
  xs: "0.875rem",
178
177
  sm: "1rem",
179
178
  md: "1.25rem",
@@ -183,23 +182,37 @@ var sizeMap = {
183
182
  "3xl": "3rem",
184
183
  "4xl": "4rem"
185
184
  };
186
- var weightMap = {
185
+ var headingWeightMap = {
187
186
  normal: 400,
188
187
  medium: 500,
189
188
  semibold: 600,
190
189
  bold: 700,
191
190
  extrabold: 800
192
191
  };
193
- var letterSpacingMap = {
192
+ var headingLetterSpacingMap = {
194
193
  tight: "-0.025em",
195
194
  normal: "0",
196
195
  wide: "0.05em"
197
196
  };
198
- var lineHeightMap = {
197
+ var headingLineHeightMap = {
199
198
  tight: "1.1",
200
199
  normal: "1.4",
201
200
  relaxed: "1.6"
202
201
  };
202
+ function getHeadingStyle(props) {
203
+ return {
204
+ fontSize: headingSizeMap[props.size],
205
+ fontWeight: headingWeightMap[props.weight],
206
+ color: props.color,
207
+ textAlign: props.align,
208
+ letterSpacing: headingLetterSpacingMap[props.letterSpacing],
209
+ lineHeight: headingLineHeightMap[props.lineHeight],
210
+ margin: 0
211
+ };
212
+ }
213
+
214
+ // components/page/next/Heading.tsx
215
+ var import_jsx_runtime3 = require("react/jsx-runtime");
203
216
  function isThemeableValue(value) {
204
217
  return typeof value === "object" && value !== null && "useTheme" in value;
205
218
  }
@@ -231,47 +244,69 @@ function Heading({
231
244
  return "";
232
245
  })();
233
246
  const resolvedColor = (() => {
234
- if (!color) return resolveColor2("foreground");
235
- if (typeof color === "string") return { color, opacity: 100 };
247
+ if (!color)
248
+ return hexToRgba(
249
+ resolveColor2("foreground").color,
250
+ resolveColor2("foreground").opacity
251
+ );
252
+ if (typeof color === "string") return color;
236
253
  if (isThemeableValue(color)) {
237
- return color.useTheme ? resolveColor2(color.themeKey) : color.value;
254
+ return color.useTheme ? hexToRgba(
255
+ resolveColor2(color.themeKey).color,
256
+ resolveColor2(color.themeKey).opacity
257
+ ) : hexToRgba(color.value.color, color.value.opacity);
238
258
  }
239
- if ("color" in color) return color;
240
- return resolveColor2("foreground");
259
+ if ("color" in color) return hexToRgba(color.color, color.opacity);
260
+ return hexToRgba(
261
+ resolveColor2("foreground").color,
262
+ resolveColor2("foreground").opacity
263
+ );
241
264
  })();
242
265
  const Tag = level;
243
- const style = {
244
- fontSize: sizeMap[size],
245
- fontWeight: weightMap[weight],
246
- color: hexToRgba(resolvedColor.color, resolvedColor.opacity),
247
- textAlign: align,
248
- letterSpacing: letterSpacingMap[letterSpacing],
249
- lineHeight: lineHeightMap[lineHeight],
250
- margin: 0
251
- };
266
+ const style = getHeadingStyle({
267
+ size,
268
+ weight,
269
+ color: resolvedColor,
270
+ align,
271
+ letterSpacing,
272
+ lineHeight
273
+ });
252
274
  if (!resolvedText) return null;
253
275
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Tag, { id, style, children: resolvedText });
254
276
  }
255
277
 
256
- // components/page/Paragraph.tsx
257
- var import_jsx_runtime4 = require("react/jsx-runtime");
258
- var sizeMap2 = {
278
+ // components/page/primitives/Paragraph.ts
279
+ var paragraphSizeMap = {
259
280
  sm: "0.875rem",
260
281
  base: "1rem",
261
282
  lg: "1.125rem",
262
283
  xl: "1.25rem"
263
284
  };
264
- var weightMap2 = {
285
+ var paragraphWeightMap = {
265
286
  normal: 400,
266
287
  medium: 500,
267
288
  semibold: 600
268
289
  };
269
- var lineHeightMap2 = {
290
+ var paragraphLineHeightMap = {
270
291
  tight: "1.4",
271
292
  normal: "1.6",
272
293
  relaxed: "1.75",
273
294
  loose: "2"
274
295
  };
296
+ function getParagraphStyle(props) {
297
+ return {
298
+ fontSize: paragraphSizeMap[props.size],
299
+ fontWeight: paragraphWeightMap[props.weight],
300
+ color: props.color,
301
+ textAlign: props.align,
302
+ lineHeight: paragraphLineHeightMap[props.lineHeight],
303
+ maxWidth: props.maxWidth || void 0,
304
+ margin: 0
305
+ };
306
+ }
307
+
308
+ // components/page/next/Paragraph.tsx
309
+ var import_jsx_runtime4 = require("react/jsx-runtime");
275
310
  function isThemeableValue2(value) {
276
311
  return typeof value === "object" && value !== null && "useTheme" in value;
277
312
  }
@@ -302,23 +337,32 @@ function Paragraph({
302
337
  return "";
303
338
  })();
304
339
  const resolvedColor = (() => {
305
- if (!color) return resolveColor2("foreground");
306
- if (typeof color === "string") return { color, opacity: 100 };
340
+ if (!color)
341
+ return hexToRgba(
342
+ resolveColor2("foreground").color,
343
+ resolveColor2("foreground").opacity
344
+ );
345
+ if (typeof color === "string") return color;
307
346
  if (isThemeableValue2(color)) {
308
- return color.useTheme ? resolveColor2(color.themeKey) : color.value;
347
+ return color.useTheme ? hexToRgba(
348
+ resolveColor2(color.themeKey).color,
349
+ resolveColor2(color.themeKey).opacity
350
+ ) : hexToRgba(color.value.color, color.value.opacity);
309
351
  }
310
- if ("color" in color) return color;
311
- return resolveColor2("foreground");
352
+ if ("color" in color) return hexToRgba(color.color, color.opacity);
353
+ return hexToRgba(
354
+ resolveColor2("foreground").color,
355
+ resolveColor2("foreground").opacity
356
+ );
312
357
  })();
313
- const style = {
314
- fontSize: sizeMap2[size],
315
- fontWeight: weightMap2[weight],
316
- color: hexToRgba(resolvedColor.color, resolvedColor.opacity),
317
- textAlign: align,
318
- lineHeight: lineHeightMap2[lineHeight],
319
- maxWidth: maxWidth || void 0,
320
- margin: 0
321
- };
358
+ const style = getParagraphStyle({
359
+ size,
360
+ weight,
361
+ color: resolvedColor,
362
+ align,
363
+ lineHeight,
364
+ maxWidth
365
+ });
322
366
  if (!resolvedText) return null;
323
367
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id, style, children: resolvedText });
324
368
  }
@@ -979,7 +1023,7 @@ function VideoEmbed({
979
1023
 
980
1024
  // components/page/Icon.tsx
981
1025
  var import_jsx_runtime9 = require("react/jsx-runtime");
982
- var sizeMap3 = {
1026
+ var sizeMap = {
983
1027
  sm: { size: "16px", strokeWidth: 2 },
984
1028
  md: { size: "24px", strokeWidth: 2 },
985
1029
  lg: { size: "32px", strokeWidth: 1.5 },
@@ -1197,7 +1241,7 @@ function Icon({
1197
1241
  return resolveColor2("primary");
1198
1242
  })();
1199
1243
  const IconComponent = icons[name.toLowerCase()] || icons.check;
1200
- const { size: iconSize, strokeWidth } = sizeMap3[size];
1244
+ const { size: iconSize, strokeWidth } = sizeMap[size];
1201
1245
  const colorValue = hexToRgba(resolvedColor.color, resolvedColor.opacity);
1202
1246
  const wrapperStyle = {
1203
1247
  display: "flex",
@@ -1541,7 +1585,7 @@ function Divider({
1541
1585
 
1542
1586
  // components/page/Spacer.tsx
1543
1587
  var import_jsx_runtime15 = require("react/jsx-runtime");
1544
- var sizeMap4 = {
1588
+ var sizeMap2 = {
1545
1589
  xs: "8px",
1546
1590
  sm: "16px",
1547
1591
  md: "24px",
@@ -1552,7 +1596,7 @@ var sizeMap4 = {
1552
1596
  };
1553
1597
  function Spacer({ size = "md", id }) {
1554
1598
  const style = {
1555
- height: sizeMap4[size],
1599
+ height: sizeMap2[size],
1556
1600
  width: "100%"
1557
1601
  };
1558
1602
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id, style, "aria-hidden": "true" });
@@ -1565,7 +1609,7 @@ var alignmentMap = {
1565
1609
  center: "text-center",
1566
1610
  right: "text-right"
1567
1611
  };
1568
- var sizeMap5 = {
1612
+ var sizeMap3 = {
1569
1613
  small: "text-2xl",
1570
1614
  "medium-small": "text-3xl",
1571
1615
  medium: "text-4xl",
@@ -1654,7 +1698,7 @@ function TextBlock({
1654
1698
  resolvedTitle && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1655
1699
  "h2",
1656
1700
  {
1657
- className: cn("font-bold", sizeMap5[textSize]),
1701
+ className: cn("font-bold", sizeMap3[textSize]),
1658
1702
  style: gradientStyle,
1659
1703
  children: resolvedTitle
1660
1704
  }
@@ -1708,7 +1752,7 @@ function CustomImage({
1708
1752
  // components/page/FeaturesList.tsx
1709
1753
  var import_lucide_react = require("lucide-react");
1710
1754
  var import_jsx_runtime18 = require("react/jsx-runtime");
1711
- var sizeMap6 = {
1755
+ var sizeMap4 = {
1712
1756
  small: { icon: 24, title: "text-base", desc: "text-sm" },
1713
1757
  medium: { icon: 32, title: "text-lg", desc: "text-base" },
1714
1758
  large: { icon: 48, title: "text-xl", desc: "text-lg" }
@@ -1720,7 +1764,7 @@ function FeaturesList({
1720
1764
  iconColor = "#000000",
1721
1765
  anchorLink
1722
1766
  }) {
1723
- const sizeConfig = sizeMap6[size];
1767
+ const sizeConfig = sizeMap4[size];
1724
1768
  const getIcon = (iconName) => {
1725
1769
  const formatted = iconName.charAt(0).toUpperCase() + iconName.slice(1);
1726
1770
  return import_lucide_react.icons[formatted] || null;
@@ -1777,7 +1821,7 @@ function FeaturesList({
1777
1821
  // components/page/FeatureGrid.tsx
1778
1822
  var import_lucide_react2 = require("lucide-react");
1779
1823
  var import_jsx_runtime19 = require("react/jsx-runtime");
1780
- var sizeMap7 = {
1824
+ var sizeMap5 = {
1781
1825
  small: { icon: 24, title: "text-base", desc: "text-sm" },
1782
1826
  medium: { icon: 32, title: "text-lg", desc: "text-base" },
1783
1827
  large: { icon: 48, title: "text-xl", desc: "text-lg" }
@@ -1793,7 +1837,7 @@ function FeatureGrid({
1793
1837
  textColor = "#000000",
1794
1838
  anchorLink
1795
1839
  }) {
1796
- const sizeConfig = sizeMap7[size];
1840
+ const sizeConfig = sizeMap5[size];
1797
1841
  const getIcon = (iconName) => {
1798
1842
  const formatted = iconName.charAt(0).toUpperCase() + iconName.slice(1);
1799
1843
  return import_lucide_react2.icons[formatted] || null;
@@ -2060,7 +2104,7 @@ var widthMap3 = {
2060
2104
  medium: "max-w-lg",
2061
2105
  large: "max-w-2xl"
2062
2106
  };
2063
- var sizeMap8 = {
2107
+ var sizeMap6 = {
2064
2108
  small: "px-3 py-1.5 text-sm",
2065
2109
  medium: "px-4 py-2 text-base",
2066
2110
  large: "px-6 py-3 text-lg"
@@ -2105,7 +2149,7 @@ function Popup({
2105
2149
  onClick: handleOpen,
2106
2150
  className: cn(
2107
2151
  "flex items-center gap-2 rounded-full font-medium",
2108
- sizeMap8[size]
2152
+ sizeMap6[size]
2109
2153
  ),
2110
2154
  style: { backgroundColor: buttonColor, color: textColor },
2111
2155
  children: [
package/dist/renderer.mjs CHANGED
@@ -1,3 +1,7 @@
1
+ import {
2
+ Heading,
3
+ Paragraph
4
+ } from "./chunk-WFLVAZV2.mjs";
1
5
  import {
2
6
  Button,
3
7
  Card,
@@ -8,11 +12,9 @@ import {
8
12
  FeatureGrid,
9
13
  FeaturesList,
10
14
  Footer,
11
- Heading,
12
15
  Icon,
13
16
  Image,
14
17
  ImageCarousel,
15
- Paragraph,
16
18
  Popup,
17
19
  Section,
18
20
  Spacer,
@@ -20,7 +22,7 @@ import {
20
22
  Topbar,
21
23
  VideoEmbed,
22
24
  availableIcons
23
- } from "./chunk-723Z3YKC.mjs";
25
+ } from "./chunk-MWW5LYLN.mjs";
24
26
  import {
25
27
  ThemeProvider,
26
28
  useTheme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mission-studio/puck",
3
- "version": "1.0.19",
3
+ "version": "1.0.21",
4
4
  "description": "A collection of puck components and configurations for internal use at Mission Studio.",
5
5
  "repository": {
6
6
  "type": "git",