@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/index.js CHANGED
@@ -184,9 +184,8 @@ function cn(...inputs) {
184
184
  return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
185
185
  }
186
186
 
187
- // components/page/Heading.tsx
188
- var import_jsx_runtime3 = require("react/jsx-runtime");
189
- var sizeMap = {
187
+ // components/page/primitives/Heading.ts
188
+ var headingSizeMap = {
190
189
  xs: "0.875rem",
191
190
  sm: "1rem",
192
191
  md: "1.25rem",
@@ -196,23 +195,37 @@ var sizeMap = {
196
195
  "3xl": "3rem",
197
196
  "4xl": "4rem"
198
197
  };
199
- var weightMap = {
198
+ var headingWeightMap = {
200
199
  normal: 400,
201
200
  medium: 500,
202
201
  semibold: 600,
203
202
  bold: 700,
204
203
  extrabold: 800
205
204
  };
206
- var letterSpacingMap = {
205
+ var headingLetterSpacingMap = {
207
206
  tight: "-0.025em",
208
207
  normal: "0",
209
208
  wide: "0.05em"
210
209
  };
211
- var lineHeightMap = {
210
+ var headingLineHeightMap = {
212
211
  tight: "1.1",
213
212
  normal: "1.4",
214
213
  relaxed: "1.6"
215
214
  };
215
+ function getHeadingStyle(props) {
216
+ return {
217
+ fontSize: headingSizeMap[props.size],
218
+ fontWeight: headingWeightMap[props.weight],
219
+ color: props.color,
220
+ textAlign: props.align,
221
+ letterSpacing: headingLetterSpacingMap[props.letterSpacing],
222
+ lineHeight: headingLineHeightMap[props.lineHeight],
223
+ margin: 0
224
+ };
225
+ }
226
+
227
+ // components/page/next/Heading.tsx
228
+ var import_jsx_runtime3 = require("react/jsx-runtime");
216
229
  function isThemeableValue(value) {
217
230
  return typeof value === "object" && value !== null && "useTheme" in value;
218
231
  }
@@ -244,47 +257,69 @@ function Heading({
244
257
  return "";
245
258
  })();
246
259
  const resolvedColor = (() => {
247
- if (!color) return resolveColor2("foreground");
248
- if (typeof color === "string") return { color, opacity: 100 };
260
+ if (!color)
261
+ return hexToRgba(
262
+ resolveColor2("foreground").color,
263
+ resolveColor2("foreground").opacity
264
+ );
265
+ if (typeof color === "string") return color;
249
266
  if (isThemeableValue(color)) {
250
- return color.useTheme ? resolveColor2(color.themeKey) : color.value;
267
+ return color.useTheme ? hexToRgba(
268
+ resolveColor2(color.themeKey).color,
269
+ resolveColor2(color.themeKey).opacity
270
+ ) : hexToRgba(color.value.color, color.value.opacity);
251
271
  }
252
- if ("color" in color) return color;
253
- return resolveColor2("foreground");
272
+ if ("color" in color) return hexToRgba(color.color, color.opacity);
273
+ return hexToRgba(
274
+ resolveColor2("foreground").color,
275
+ resolveColor2("foreground").opacity
276
+ );
254
277
  })();
255
278
  const Tag = level;
256
- const style = {
257
- fontSize: sizeMap[size],
258
- fontWeight: weightMap[weight],
259
- color: hexToRgba(resolvedColor.color, resolvedColor.opacity),
260
- textAlign: align,
261
- letterSpacing: letterSpacingMap[letterSpacing],
262
- lineHeight: lineHeightMap[lineHeight],
263
- margin: 0
264
- };
279
+ const style = getHeadingStyle({
280
+ size,
281
+ weight,
282
+ color: resolvedColor,
283
+ align,
284
+ letterSpacing,
285
+ lineHeight
286
+ });
265
287
  if (!resolvedText) return null;
266
288
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Tag, { id, style, children: resolvedText });
267
289
  }
268
290
 
269
- // components/page/Paragraph.tsx
270
- var import_jsx_runtime4 = require("react/jsx-runtime");
271
- var sizeMap2 = {
291
+ // components/page/primitives/Paragraph.ts
292
+ var paragraphSizeMap = {
272
293
  sm: "0.875rem",
273
294
  base: "1rem",
274
295
  lg: "1.125rem",
275
296
  xl: "1.25rem"
276
297
  };
277
- var weightMap2 = {
298
+ var paragraphWeightMap = {
278
299
  normal: 400,
279
300
  medium: 500,
280
301
  semibold: 600
281
302
  };
282
- var lineHeightMap2 = {
303
+ var paragraphLineHeightMap = {
283
304
  tight: "1.4",
284
305
  normal: "1.6",
285
306
  relaxed: "1.75",
286
307
  loose: "2"
287
308
  };
309
+ function getParagraphStyle(props) {
310
+ return {
311
+ fontSize: paragraphSizeMap[props.size],
312
+ fontWeight: paragraphWeightMap[props.weight],
313
+ color: props.color,
314
+ textAlign: props.align,
315
+ lineHeight: paragraphLineHeightMap[props.lineHeight],
316
+ maxWidth: props.maxWidth || void 0,
317
+ margin: 0
318
+ };
319
+ }
320
+
321
+ // components/page/next/Paragraph.tsx
322
+ var import_jsx_runtime4 = require("react/jsx-runtime");
288
323
  function isThemeableValue2(value) {
289
324
  return typeof value === "object" && value !== null && "useTheme" in value;
290
325
  }
@@ -315,23 +350,32 @@ function Paragraph({
315
350
  return "";
316
351
  })();
317
352
  const resolvedColor = (() => {
318
- if (!color) return resolveColor2("foreground");
319
- if (typeof color === "string") return { color, opacity: 100 };
353
+ if (!color)
354
+ return hexToRgba(
355
+ resolveColor2("foreground").color,
356
+ resolveColor2("foreground").opacity
357
+ );
358
+ if (typeof color === "string") return color;
320
359
  if (isThemeableValue2(color)) {
321
- return color.useTheme ? resolveColor2(color.themeKey) : color.value;
360
+ return color.useTheme ? hexToRgba(
361
+ resolveColor2(color.themeKey).color,
362
+ resolveColor2(color.themeKey).opacity
363
+ ) : hexToRgba(color.value.color, color.value.opacity);
322
364
  }
323
- if ("color" in color) return color;
324
- return resolveColor2("foreground");
365
+ if ("color" in color) return hexToRgba(color.color, color.opacity);
366
+ return hexToRgba(
367
+ resolveColor2("foreground").color,
368
+ resolveColor2("foreground").opacity
369
+ );
325
370
  })();
326
- const style = {
327
- fontSize: sizeMap2[size],
328
- fontWeight: weightMap2[weight],
329
- color: hexToRgba(resolvedColor.color, resolvedColor.opacity),
330
- textAlign: align,
331
- lineHeight: lineHeightMap2[lineHeight],
332
- maxWidth: maxWidth || void 0,
333
- margin: 0
334
- };
371
+ const style = getParagraphStyle({
372
+ size,
373
+ weight,
374
+ color: resolvedColor,
375
+ align,
376
+ lineHeight,
377
+ maxWidth
378
+ });
335
379
  if (!resolvedText) return null;
336
380
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { id, style, children: resolvedText });
337
381
  }
@@ -992,7 +1036,7 @@ function VideoEmbed({
992
1036
 
993
1037
  // components/page/Icon.tsx
994
1038
  var import_jsx_runtime9 = require("react/jsx-runtime");
995
- var sizeMap3 = {
1039
+ var sizeMap = {
996
1040
  sm: { size: "16px", strokeWidth: 2 },
997
1041
  md: { size: "24px", strokeWidth: 2 },
998
1042
  lg: { size: "32px", strokeWidth: 1.5 },
@@ -1210,7 +1254,7 @@ function Icon({
1210
1254
  return resolveColor2("primary");
1211
1255
  })();
1212
1256
  const IconComponent = icons[name.toLowerCase()] || icons.check;
1213
- const { size: iconSize, strokeWidth } = sizeMap3[size];
1257
+ const { size: iconSize, strokeWidth } = sizeMap[size];
1214
1258
  const colorValue = hexToRgba(resolvedColor.color, resolvedColor.opacity);
1215
1259
  const wrapperStyle = {
1216
1260
  display: "flex",
@@ -1554,7 +1598,7 @@ function Divider({
1554
1598
 
1555
1599
  // components/page/Spacer.tsx
1556
1600
  var import_jsx_runtime15 = require("react/jsx-runtime");
1557
- var sizeMap4 = {
1601
+ var sizeMap2 = {
1558
1602
  xs: "8px",
1559
1603
  sm: "16px",
1560
1604
  md: "24px",
@@ -1565,7 +1609,7 @@ var sizeMap4 = {
1565
1609
  };
1566
1610
  function Spacer({ size = "md", id }) {
1567
1611
  const style = {
1568
- height: sizeMap4[size],
1612
+ height: sizeMap2[size],
1569
1613
  width: "100%"
1570
1614
  };
1571
1615
  return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)("div", { id, style, "aria-hidden": "true" });
@@ -1578,7 +1622,7 @@ var alignmentMap = {
1578
1622
  center: "text-center",
1579
1623
  right: "text-right"
1580
1624
  };
1581
- var sizeMap5 = {
1625
+ var sizeMap3 = {
1582
1626
  small: "text-2xl",
1583
1627
  "medium-small": "text-3xl",
1584
1628
  medium: "text-4xl",
@@ -1667,7 +1711,7 @@ function TextBlock({
1667
1711
  resolvedTitle && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
1668
1712
  "h2",
1669
1713
  {
1670
- className: cn("font-bold", sizeMap5[textSize]),
1714
+ className: cn("font-bold", sizeMap3[textSize]),
1671
1715
  style: gradientStyle,
1672
1716
  children: resolvedTitle
1673
1717
  }
@@ -1721,7 +1765,7 @@ function CustomImage({
1721
1765
  // components/page/FeaturesList.tsx
1722
1766
  var import_lucide_react = require("lucide-react");
1723
1767
  var import_jsx_runtime18 = require("react/jsx-runtime");
1724
- var sizeMap6 = {
1768
+ var sizeMap4 = {
1725
1769
  small: { icon: 24, title: "text-base", desc: "text-sm" },
1726
1770
  medium: { icon: 32, title: "text-lg", desc: "text-base" },
1727
1771
  large: { icon: 48, title: "text-xl", desc: "text-lg" }
@@ -1733,7 +1777,7 @@ function FeaturesList({
1733
1777
  iconColor = "#000000",
1734
1778
  anchorLink
1735
1779
  }) {
1736
- const sizeConfig = sizeMap6[size];
1780
+ const sizeConfig = sizeMap4[size];
1737
1781
  const getIcon = (iconName) => {
1738
1782
  const formatted = iconName.charAt(0).toUpperCase() + iconName.slice(1);
1739
1783
  return import_lucide_react.icons[formatted] || null;
@@ -1790,7 +1834,7 @@ function FeaturesList({
1790
1834
  // components/page/FeatureGrid.tsx
1791
1835
  var import_lucide_react2 = require("lucide-react");
1792
1836
  var import_jsx_runtime19 = require("react/jsx-runtime");
1793
- var sizeMap7 = {
1837
+ var sizeMap5 = {
1794
1838
  small: { icon: 24, title: "text-base", desc: "text-sm" },
1795
1839
  medium: { icon: 32, title: "text-lg", desc: "text-base" },
1796
1840
  large: { icon: 48, title: "text-xl", desc: "text-lg" }
@@ -1806,7 +1850,7 @@ function FeatureGrid({
1806
1850
  textColor = "#000000",
1807
1851
  anchorLink
1808
1852
  }) {
1809
- const sizeConfig = sizeMap7[size];
1853
+ const sizeConfig = sizeMap5[size];
1810
1854
  const getIcon = (iconName) => {
1811
1855
  const formatted = iconName.charAt(0).toUpperCase() + iconName.slice(1);
1812
1856
  return import_lucide_react2.icons[formatted] || null;
@@ -2073,7 +2117,7 @@ var widthMap3 = {
2073
2117
  medium: "max-w-lg",
2074
2118
  large: "max-w-2xl"
2075
2119
  };
2076
- var sizeMap8 = {
2120
+ var sizeMap6 = {
2077
2121
  small: "px-3 py-1.5 text-sm",
2078
2122
  medium: "px-4 py-2 text-base",
2079
2123
  large: "px-6 py-3 text-lg"
@@ -2118,7 +2162,7 @@ function Popup({
2118
2162
  onClick: handleOpen,
2119
2163
  className: cn(
2120
2164
  "flex items-center gap-2 rounded-full font-medium",
2121
- sizeMap8[size]
2165
+ sizeMap6[size]
2122
2166
  ),
2123
2167
  style: { backgroundColor: buttonColor, color: textColor },
2124
2168
  children: [
package/dist/index.mjs CHANGED
@@ -13,6 +13,10 @@ import {
13
13
  getFontSizeCSS,
14
14
  spacingScale
15
15
  } from "./chunk-A3QDUUOF.mjs";
16
+ import {
17
+ Heading,
18
+ Paragraph
19
+ } from "./chunk-WFLVAZV2.mjs";
16
20
  import {
17
21
  Button,
18
22
  Card,
@@ -23,11 +27,9 @@ import {
23
27
  FeatureGrid,
24
28
  FeaturesList,
25
29
  Footer,
26
- Heading,
27
30
  Icon,
28
31
  Image,
29
32
  ImageCarousel,
30
- Paragraph,
31
33
  Popup,
32
34
  Section,
33
35
  Spacer,
@@ -35,7 +37,7 @@ import {
35
37
  Topbar,
36
38
  VideoEmbed,
37
39
  availableIcons
38
- } from "./chunk-723Z3YKC.mjs";
40
+ } from "./chunk-MWW5LYLN.mjs";
39
41
  import {
40
42
  ThemeProvider,
41
43
  getShadowCSS,
@@ -6,28 +6,40 @@ import { R as ResponsiveVisibility } from './ResponsiveToggleField-BihXsGIJ.mjs'
6
6
  export { D as DEFAULT_THEME, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-BihXsGIJ.mjs';
7
7
  import { PuckContext } from '@measured/puck';
8
8
 
9
+ type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
10
+ type HeadingSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
11
+ type HeadingWeight = "normal" | "medium" | "semibold" | "bold" | "extrabold";
12
+ type HeadingAlign = "left" | "center" | "right";
13
+ type HeadingLetterSpacing = "tight" | "normal" | "wide";
14
+ type HeadingLineHeight = "tight" | "normal" | "relaxed";
15
+
9
16
  type HeadingProps = {
10
17
  text?: EntryBoundValue<string> | string;
11
- level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
12
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
13
- weight?: "normal" | "medium" | "semibold" | "bold" | "extrabold";
18
+ level?: HeadingLevel;
19
+ size?: HeadingSize;
20
+ weight?: HeadingWeight;
14
21
  color?: ThemeableColorValue | ColorValue | string;
15
- align?: "left" | "center" | "right";
16
- letterSpacing?: "tight" | "normal" | "wide";
17
- lineHeight?: "tight" | "normal" | "relaxed";
22
+ align?: HeadingAlign;
23
+ letterSpacing?: HeadingLetterSpacing;
24
+ lineHeight?: HeadingLineHeight;
18
25
  id?: string;
19
26
  puck?: unknown;
20
27
  editMode?: boolean;
21
28
  };
22
29
  declare function Heading({ text, level, size, weight, color, align, letterSpacing, lineHeight, id, }: HeadingProps): react_jsx_runtime.JSX.Element | null;
23
30
 
31
+ type ParagraphSize = "sm" | "base" | "lg" | "xl";
32
+ type ParagraphWeight = "normal" | "medium" | "semibold";
33
+ type ParagraphAlign = "left" | "center" | "right" | "justify";
34
+ type ParagraphLineHeight = "tight" | "normal" | "relaxed" | "loose";
35
+
24
36
  type ParagraphProps = {
25
37
  text?: EntryBoundValue<string> | string;
26
- size?: "sm" | "base" | "lg" | "xl";
27
- weight?: "normal" | "medium" | "semibold";
38
+ size?: ParagraphSize;
39
+ weight?: ParagraphWeight;
28
40
  color?: ThemeableColorValue | ColorValue | string;
29
- align?: "left" | "center" | "right" | "justify";
30
- lineHeight?: "tight" | "normal" | "relaxed" | "loose";
41
+ align?: ParagraphAlign;
42
+ lineHeight?: ParagraphLineHeight;
31
43
  maxWidth?: string;
32
44
  id?: string;
33
45
  puck?: unknown;
@@ -6,28 +6,40 @@ import { R as ResponsiveVisibility } from './ResponsiveToggleField-CfBKL5oY.js';
6
6
  export { D as DEFAULT_THEME, T as ThemeProvider, u as useTheme } from './ResponsiveToggleField-CfBKL5oY.js';
7
7
  import { PuckContext } from '@measured/puck';
8
8
 
9
+ type HeadingLevel = "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
10
+ type HeadingSize = "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
11
+ type HeadingWeight = "normal" | "medium" | "semibold" | "bold" | "extrabold";
12
+ type HeadingAlign = "left" | "center" | "right";
13
+ type HeadingLetterSpacing = "tight" | "normal" | "wide";
14
+ type HeadingLineHeight = "tight" | "normal" | "relaxed";
15
+
9
16
  type HeadingProps = {
10
17
  text?: EntryBoundValue<string> | string;
11
- level?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
12
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl";
13
- weight?: "normal" | "medium" | "semibold" | "bold" | "extrabold";
18
+ level?: HeadingLevel;
19
+ size?: HeadingSize;
20
+ weight?: HeadingWeight;
14
21
  color?: ThemeableColorValue | ColorValue | string;
15
- align?: "left" | "center" | "right";
16
- letterSpacing?: "tight" | "normal" | "wide";
17
- lineHeight?: "tight" | "normal" | "relaxed";
22
+ align?: HeadingAlign;
23
+ letterSpacing?: HeadingLetterSpacing;
24
+ lineHeight?: HeadingLineHeight;
18
25
  id?: string;
19
26
  puck?: unknown;
20
27
  editMode?: boolean;
21
28
  };
22
29
  declare function Heading({ text, level, size, weight, color, align, letterSpacing, lineHeight, id, }: HeadingProps): react_jsx_runtime.JSX.Element | null;
23
30
 
31
+ type ParagraphSize = "sm" | "base" | "lg" | "xl";
32
+ type ParagraphWeight = "normal" | "medium" | "semibold";
33
+ type ParagraphAlign = "left" | "center" | "right" | "justify";
34
+ type ParagraphLineHeight = "tight" | "normal" | "relaxed" | "loose";
35
+
24
36
  type ParagraphProps = {
25
37
  text?: EntryBoundValue<string> | string;
26
- size?: "sm" | "base" | "lg" | "xl";
27
- weight?: "normal" | "medium" | "semibold";
38
+ size?: ParagraphSize;
39
+ weight?: ParagraphWeight;
28
40
  color?: ThemeableColorValue | ColorValue | string;
29
- align?: "left" | "center" | "right" | "justify";
30
- lineHeight?: "tight" | "normal" | "relaxed" | "loose";
41
+ align?: ParagraphAlign;
42
+ lineHeight?: ParagraphLineHeight;
31
43
  maxWidth?: string;
32
44
  id?: string;
33
45
  puck?: unknown;