@mission-studio/puck 1.0.20 → 1.0.23

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.
@@ -1,6 +1,7 @@
1
1
  import {
2
- getHeadingStyle
3
- } from "./chunk-X6VGLL5Y.mjs";
2
+ getHeadingStyle,
3
+ getParagraphStyle
4
+ } from "./chunk-MWW5LYLN.mjs";
4
5
  import {
5
6
  useEntries,
6
7
  useTheme
@@ -73,6 +74,69 @@ function Heading({
73
74
  return /* @__PURE__ */ jsx(Tag, { id, style, children: resolvedText });
74
75
  }
75
76
 
77
+ // components/page/next/Paragraph.tsx
78
+ import { jsx as jsx2 } from "react/jsx-runtime";
79
+ function isThemeableValue2(value) {
80
+ return typeof value === "object" && value !== null && "useTheme" in value;
81
+ }
82
+ function isEntryBoundValue2(value) {
83
+ return typeof value === "object" && value !== null && "useEntry" in value;
84
+ }
85
+ function Paragraph({
86
+ text,
87
+ size = "base",
88
+ weight = "normal",
89
+ color,
90
+ align = "left",
91
+ lineHeight = "normal",
92
+ maxWidth,
93
+ id
94
+ }) {
95
+ const { resolveColor } = useTheme();
96
+ const { getEntryValue } = useEntries();
97
+ const resolvedText = (() => {
98
+ if (!text) return "";
99
+ if (typeof text === "string") return text;
100
+ if (isEntryBoundValue2(text)) {
101
+ if (text.useEntry) {
102
+ return String(getEntryValue(text.entryName, text.fieldKey) ?? "");
103
+ }
104
+ return text.value;
105
+ }
106
+ return "";
107
+ })();
108
+ const resolvedColor = (() => {
109
+ if (!color)
110
+ return hexToRgba(
111
+ resolveColor("foreground").color,
112
+ resolveColor("foreground").opacity
113
+ );
114
+ if (typeof color === "string") return color;
115
+ if (isThemeableValue2(color)) {
116
+ return color.useTheme ? hexToRgba(
117
+ resolveColor(color.themeKey).color,
118
+ resolveColor(color.themeKey).opacity
119
+ ) : hexToRgba(color.value.color, color.value.opacity);
120
+ }
121
+ if ("color" in color) return hexToRgba(color.color, color.opacity);
122
+ return hexToRgba(
123
+ resolveColor("foreground").color,
124
+ resolveColor("foreground").opacity
125
+ );
126
+ })();
127
+ const style = getParagraphStyle({
128
+ size,
129
+ weight,
130
+ color: resolvedColor,
131
+ align,
132
+ lineHeight,
133
+ maxWidth
134
+ });
135
+ if (!resolvedText) return null;
136
+ return /* @__PURE__ */ jsx2("p", { id, style, children: resolvedText });
137
+ }
138
+
76
139
  export {
77
- Heading
140
+ Heading,
141
+ Paragraph
78
142
  };
@@ -0,0 +1,34 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { H as HeadingLevel, J as HeadingSize, K as HeadingWeight, L as HeadingAlign, M as HeadingLetterSpacing, N as HeadingLineHeight, O as ParagraphSize, Q as ParagraphWeight, R as ParagraphAlign, U as ParagraphLineHeight } from '../../../Popup-llKrR-vO.mjs';
3
+ export { B as Button, a as ButtonProps, C as Card, b as CardProps, c as CarouselImage, d as Columns, e as ColumnsProps, f as Container, g as ContainerProps, h as CustomImage, i as CustomImageProps, D as Divider, j as DividerProps, F as FeatureGrid, k as FeatureGridProps, l as FeaturesList, m as FeaturesListProps, n as Footer, o as FooterProps, I as Icon, p as IconProps, q as Image, r as ImageCarousel, s as ImageCarouselProps, t as ImageProps, P as Popup, u as PopupProps, S as Section, v as SectionProps, w as Spacer, x as SpacerProps, T as TextBlock, y as TextBlockProps, z as Topbar, A as TopbarProps, V as VideoEmbed, E as VideoEmbedProps, G as availableIcons } from '../../../Popup-llKrR-vO.mjs';
4
+ import '../../../types-HQ6hIbYr.mjs';
5
+ import 'react';
6
+ import '../../../ResponsiveToggleField-65CqZEK-.mjs';
7
+ import '@measured/puck';
8
+
9
+ type HeadingProps = {
10
+ text?: string;
11
+ level?: HeadingLevel;
12
+ size?: HeadingSize;
13
+ weight?: HeadingWeight;
14
+ color?: string;
15
+ align?: HeadingAlign;
16
+ letterSpacing?: HeadingLetterSpacing;
17
+ lineHeight?: HeadingLineHeight;
18
+ id?: string;
19
+ };
20
+ declare function Heading({ text, level, size, weight, color, align, letterSpacing, lineHeight, id, }: HeadingProps): react_jsx_runtime.JSX.Element | null;
21
+
22
+ type ParagraphProps = {
23
+ text?: string;
24
+ size?: ParagraphSize;
25
+ weight?: ParagraphWeight;
26
+ color?: string;
27
+ align?: ParagraphAlign;
28
+ lineHeight?: ParagraphLineHeight;
29
+ maxWidth?: string;
30
+ id?: string;
31
+ };
32
+ declare function Paragraph({ text, size, weight, color, align, lineHeight, maxWidth, id, }: ParagraphProps): react_jsx_runtime.JSX.Element | null;
33
+
34
+ export { Heading, type HeadingProps, Paragraph, type ParagraphProps };
@@ -0,0 +1,34 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { H as HeadingLevel, J as HeadingSize, K as HeadingWeight, L as HeadingAlign, M as HeadingLetterSpacing, N as HeadingLineHeight, O as ParagraphSize, Q as ParagraphWeight, R as ParagraphAlign, U as ParagraphLineHeight } from '../../../Popup-BlNJZyB6.js';
3
+ export { B as Button, a as ButtonProps, C as Card, b as CardProps, c as CarouselImage, d as Columns, e as ColumnsProps, f as Container, g as ContainerProps, h as CustomImage, i as CustomImageProps, D as Divider, j as DividerProps, F as FeatureGrid, k as FeatureGridProps, l as FeaturesList, m as FeaturesListProps, n as Footer, o as FooterProps, I as Icon, p as IconProps, q as Image, r as ImageCarousel, s as ImageCarouselProps, t as ImageProps, P as Popup, u as PopupProps, S as Section, v as SectionProps, w as Spacer, x as SpacerProps, T as TextBlock, y as TextBlockProps, z as Topbar, A as TopbarProps, V as VideoEmbed, E as VideoEmbedProps, G as availableIcons } from '../../../Popup-BlNJZyB6.js';
4
+ import '../../../types-HQ6hIbYr.js';
5
+ import 'react';
6
+ import '../../../ResponsiveToggleField-QCve94L_.js';
7
+ import '@measured/puck';
8
+
9
+ type HeadingProps = {
10
+ text?: string;
11
+ level?: HeadingLevel;
12
+ size?: HeadingSize;
13
+ weight?: HeadingWeight;
14
+ color?: string;
15
+ align?: HeadingAlign;
16
+ letterSpacing?: HeadingLetterSpacing;
17
+ lineHeight?: HeadingLineHeight;
18
+ id?: string;
19
+ };
20
+ declare function Heading({ text, level, size, weight, color, align, letterSpacing, lineHeight, id, }: HeadingProps): react_jsx_runtime.JSX.Element | null;
21
+
22
+ type ParagraphProps = {
23
+ text?: string;
24
+ size?: ParagraphSize;
25
+ weight?: ParagraphWeight;
26
+ color?: string;
27
+ align?: ParagraphAlign;
28
+ lineHeight?: ParagraphLineHeight;
29
+ maxWidth?: string;
30
+ id?: string;
31
+ };
32
+ declare function Paragraph({ text, size, weight, color, align, lineHeight, maxWidth, id, }: ParagraphProps): react_jsx_runtime.JSX.Element | null;
33
+
34
+ export { Heading, type HeadingProps, Paragraph, type ParagraphProps };