@frontlit/page-builder 0.1.0-alpha.1 → 0.1.0-alpha.3

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 (116) hide show
  1. package/README.md +38 -2
  2. package/dist/blocks/index.d.ts +35 -21
  3. package/dist/blocks/index.js +4 -3
  4. package/dist/builder/index.d.ts +8 -11
  5. package/dist/builder/index.js +7 -5
  6. package/dist/{button-C3VrMJkr.d.ts → button-OLKN3wPf.d.ts} +3 -3
  7. package/dist/{chunk-7W6Q4WA7.js → chunk-36QHCIPM.js} +252 -282
  8. package/dist/chunk-36QHCIPM.js.map +1 -0
  9. package/dist/{chunk-GTY75HW2.js → chunk-ATNM5JHI.js} +2 -2
  10. package/dist/chunk-ATNM5JHI.js.map +1 -0
  11. package/dist/chunk-BBI7UHOA.js +56 -0
  12. package/dist/chunk-BBI7UHOA.js.map +1 -0
  13. package/dist/{chunk-MO76KZY2.js → chunk-GIKTOAQS.js} +661 -423
  14. package/dist/chunk-GIKTOAQS.js.map +1 -0
  15. package/dist/chunk-HWOVSHIW.js +4 -0
  16. package/dist/{chunk-RUYOL7JZ.js.map → chunk-HWOVSHIW.js.map} +1 -1
  17. package/dist/{chunk-SSQWYMQR.js → chunk-IU4KATI2.js} +74 -129
  18. package/dist/chunk-IU4KATI2.js.map +1 -0
  19. package/dist/chunk-J7Z4UW45.js +3418 -0
  20. package/dist/chunk-J7Z4UW45.js.map +1 -0
  21. package/dist/{chunk-7KIX4WAO.js → chunk-K4WCLHMS.js} +1435 -1382
  22. package/dist/chunk-K4WCLHMS.js.map +1 -0
  23. package/dist/chunk-XU7ALPGQ.js +22 -0
  24. package/dist/chunk-XU7ALPGQ.js.map +1 -0
  25. package/dist/components/index.d.ts +33 -8
  26. package/dist/components/index.js +43 -2
  27. package/dist/components/index.js.map +1 -1
  28. package/dist/data-slots.d.ts +3 -3
  29. package/dist/data-slots.js +1 -1
  30. package/dist/fonts/archivo/archivo-latin-variable.woff2 +0 -0
  31. package/dist/fonts/hanken-grotesk/hanken-grotesk-latin-variable.woff2 +0 -0
  32. package/dist/fonts/jetbrains-mono/jetbrains-mono-latin-variable.woff2 +0 -0
  33. package/dist/fonts/spline-sans-mono/spline-sans-mono-latin-variable.woff2 +0 -0
  34. package/dist/heading-DQCxQt38.d.ts +20 -0
  35. package/dist/image-Bk8kPXwP.d.ts +52 -0
  36. package/dist/index.d.ts +18 -11
  37. package/dist/index.js +9 -7
  38. package/dist/media-CnLImjVC.d.ts +21 -0
  39. package/dist/models/index.d.ts +6 -6
  40. package/dist/models/index.js +2 -1
  41. package/dist/{page-DfVl_aHX.d.ts → page-B5Gmm-Ys.d.ts} +2 -3
  42. package/dist/primitives/index.d.ts +287 -61
  43. package/dist/primitives/index.js +2 -1
  44. package/dist/renderer/index.d.ts +12 -8
  45. package/dist/renderer/index.js +6 -4
  46. package/dist/{section-background-BgOCp5l3.d.ts → section-background-6V_LCi5e.d.ts} +1 -1
  47. package/dist/server/index.d.ts +103 -0
  48. package/dist/server/index.js +2649 -0
  49. package/dist/server/index.js.map +1 -0
  50. package/dist/server/islands/code-snippet.d.ts +17 -0
  51. package/dist/server/islands/code-snippet.js +72 -0
  52. package/dist/server/islands/code-snippet.js.map +1 -0
  53. package/dist/server/islands/email-form.d.ts +50 -0
  54. package/dist/server/islands/email-form.js +406 -0
  55. package/dist/server/islands/email-form.js.map +1 -0
  56. package/dist/server/islands/header-mobile-menu.d.ts +22 -0
  57. package/dist/server/islands/header-mobile-menu.js +422 -0
  58. package/dist/server/islands/header-mobile-menu.js.map +1 -0
  59. package/dist/server/islands/inline-embed.d.ts +28 -0
  60. package/dist/server/islands/inline-embed.js +84 -0
  61. package/dist/server/islands/inline-embed.js.map +1 -0
  62. package/dist/server/islands/marquee-track.d.ts +18 -0
  63. package/dist/server/islands/marquee-track.js +67 -0
  64. package/dist/server/islands/marquee-track.js.map +1 -0
  65. package/dist/server/islands/nav-link.d.ts +37 -0
  66. package/dist/server/islands/nav-link.js +67 -0
  67. package/dist/server/islands/nav-link.js.map +1 -0
  68. package/dist/server/islands/support-form.d.ts +17 -0
  69. package/dist/server/islands/support-form.js +469 -0
  70. package/dist/server/islands/support-form.js.map +1 -0
  71. package/dist/server/islands/theme-mode-switcher.d.ts +38 -0
  72. package/dist/server/islands/theme-mode-switcher.js +169 -0
  73. package/dist/server/islands/theme-mode-switcher.js.map +1 -0
  74. package/dist/server/islands/video-with-preview.d.ts +13 -0
  75. package/dist/server/islands/video-with-preview.js +269 -0
  76. package/dist/server/islands/video-with-preview.js.map +1 -0
  77. package/dist/server/primitives.d.ts +200 -0
  78. package/dist/server/primitives.js +888 -0
  79. package/dist/server/primitives.js.map +1 -0
  80. package/dist/server/schema.d.ts +11308 -0
  81. package/dist/server/schema.js +6179 -0
  82. package/dist/server/schema.js.map +1 -0
  83. package/dist/server/theme-CF3fIKvw.d.ts +9 -0
  84. package/dist/{theme-style-39nxXQy0.d.ts → server/theme-style-5_AGy-4V.d.ts} +43 -1
  85. package/dist/server/theme-style-BPaMwk88.d.ts +183 -0
  86. package/dist/server/theme.d.ts +28 -0
  87. package/dist/{chunk-RBJBODQP.js → server/theme.js} +903 -1243
  88. package/dist/server/theme.js.map +1 -0
  89. package/dist/server/widget-YH9BrOwY.d.ts +77 -0
  90. package/dist/styles.css +4016 -8317
  91. package/dist/theme-style-BVd5tOsc.d.ts +183 -0
  92. package/dist/theme.css +186 -191
  93. package/dist/{widget--uEOpdq3.d.ts → widget-CpE2HdgU.d.ts} +25 -18
  94. package/package.json +71 -11
  95. package/schema/page.v1.json +3855 -0
  96. package/schema/site.v1.json +3811 -0
  97. package/dist/alignment-dZDzN96G.d.ts +0 -5
  98. package/dist/chunk-7KIX4WAO.js.map +0 -1
  99. package/dist/chunk-7W6Q4WA7.js.map +0 -1
  100. package/dist/chunk-GTY75HW2.js.map +0 -1
  101. package/dist/chunk-MO76KZY2.js.map +0 -1
  102. package/dist/chunk-RBJBODQP.js.map +0 -1
  103. package/dist/chunk-RUYOL7JZ.js +0 -4
  104. package/dist/chunk-SSQWYMQR.js.map +0 -1
  105. package/dist/fonts/montserrat/montserrat-latin-100-normal.woff2 +0 -0
  106. package/dist/fonts/montserrat/montserrat-latin-200-normal.woff2 +0 -0
  107. package/dist/fonts/montserrat/montserrat-latin-300-normal.woff2 +0 -0
  108. package/dist/fonts/montserrat/montserrat-latin-400-normal.woff2 +0 -0
  109. package/dist/fonts/montserrat/montserrat-latin-500-normal.woff2 +0 -0
  110. package/dist/fonts/montserrat/montserrat-latin-600-normal.woff2 +0 -0
  111. package/dist/fonts/montserrat/montserrat-latin-700-normal.woff2 +0 -0
  112. package/dist/fonts/montserrat/montserrat-latin-800-normal.woff2 +0 -0
  113. package/dist/fonts/montserrat/montserrat-latin-900-normal.woff2 +0 -0
  114. package/dist/fonts/source-sans-3/source-sans-3-latin-400-normal.woff2 +0 -0
  115. package/dist/image-D7GlnOio.d.ts +0 -30
  116. package/dist/media-Njv378j7.d.ts +0 -13
@@ -0,0 +1,888 @@
1
+ // src/primitives/components/ui/badge.tsx
2
+ import { cva } from "class-variance-authority";
3
+
4
+ // src/primitives/lib/utils.ts
5
+ import { clsx } from "clsx";
6
+ import { twMerge } from "tailwind-merge";
7
+ function cn(...inputs) {
8
+ return twMerge(clsx(inputs));
9
+ }
10
+
11
+ // src/primitives/components/ui/badge.tsx
12
+ import { jsx } from "react/jsx-runtime";
13
+ var badgeVariants = cva(
14
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
15
+ {
16
+ variants: {
17
+ variant: {
18
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
19
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
20
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
21
+ outline: "text-foreground"
22
+ }
23
+ },
24
+ defaultVariants: {
25
+ variant: "default"
26
+ }
27
+ }
28
+ );
29
+ function Badge({ className, variant, ...props }) {
30
+ return /* @__PURE__ */ jsx("div", { className: cn(badgeVariants({ variant }), className), ...props });
31
+ }
32
+
33
+ // src/primitives/badge.tsx
34
+ import { jsx as jsx2 } from "react/jsx-runtime";
35
+ var Badge2 = ({
36
+ variant = "default",
37
+ children,
38
+ className = "",
39
+ style = {},
40
+ theme,
41
+ ...props
42
+ }) => {
43
+ const typographyStyles = theme?.typography?.caption;
44
+ const buttonStyles = theme?.interactives?.button;
45
+ const classes = cn(
46
+ // Base styles
47
+ // "bg-secondary",
48
+ // Theme typography from caption
49
+ typographyStyles?.fontFamily,
50
+ typographyStyles?.fontSize,
51
+ typographyStyles?.fontWeight,
52
+ typographyStyles?.lineHeight,
53
+ typographyStyles?.letterSpacing,
54
+ typographyStyles?.textTransform,
55
+ buttonStyles?.border?.width,
56
+ buttonStyles?.border?.radius,
57
+ buttonStyles?.border?.style,
58
+ className
59
+ );
60
+ return /* @__PURE__ */ jsx2(
61
+ Badge,
62
+ {
63
+ variant,
64
+ className: classes,
65
+ style: {
66
+ ...style,
67
+ backgroundColor: style.backgroundColor,
68
+ color: style.color
69
+ },
70
+ ...props,
71
+ children
72
+ }
73
+ );
74
+ };
75
+
76
+ // src/primitives/components/ui/button.tsx
77
+ import { Slot } from "@radix-ui/react-slot";
78
+ import { cva as cva2 } from "class-variance-authority";
79
+ import * as React from "react";
80
+ import { jsx as jsx3 } from "react/jsx-runtime";
81
+ var buttonVariants = cva2(
82
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
83
+ {
84
+ variants: {
85
+ variant: {
86
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
87
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
88
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
89
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
90
+ ghost: "hover:bg-accent hover:text-accent-foreground",
91
+ link: "text-primary underline-offset-4 hover:underline"
92
+ },
93
+ size: {
94
+ default: "h-10 px-4 py-2",
95
+ sm: "h-9 rounded-md px-3",
96
+ lg: "h-11 rounded-md px-8",
97
+ icon: "h-10 w-10"
98
+ }
99
+ },
100
+ defaultVariants: {
101
+ variant: "default",
102
+ size: "default"
103
+ }
104
+ }
105
+ );
106
+ var Button = React.forwardRef(
107
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
108
+ const Comp = asChild ? Slot : "button";
109
+ return /* @__PURE__ */ jsx3(
110
+ Comp,
111
+ {
112
+ className: cn(buttonVariants({ variant, size, className })),
113
+ ref,
114
+ ...props
115
+ }
116
+ );
117
+ }
118
+ );
119
+ Button.displayName = "Button";
120
+
121
+ // src/primitives/button.tsx
122
+ import { jsx as jsx4 } from "react/jsx-runtime";
123
+ var Button2 = ({
124
+ variant = "default",
125
+ size = "default",
126
+ disabled = false,
127
+ children,
128
+ className = "",
129
+ theme,
130
+ ...props
131
+ }) => {
132
+ const buttonStyles = theme?.interactives?.button;
133
+ const typographyStyles = theme?.typography?.button;
134
+ const isIcon = size === "icon";
135
+ const classes = cn(
136
+ // Base styles
137
+ "",
138
+ // Theme typography
139
+ typographyStyles?.fontFamily,
140
+ typographyStyles?.fontSize,
141
+ typographyStyles?.fontWeight,
142
+ typographyStyles?.lineHeight,
143
+ typographyStyles?.letterSpacing,
144
+ typographyStyles?.textTransform,
145
+ typographyStyles?.textDecoration,
146
+ typographyStyles?.textOverflow,
147
+ // Theme interactivity. Icon buttons stay square — CTA padding
148
+ // would stretch them off the size="icon" box.
149
+ !isIcon && buttonStyles?.padding?.x,
150
+ !isIcon && buttonStyles?.padding?.y,
151
+ buttonStyles?.border?.width,
152
+ buttonStyles?.border?.radius,
153
+ buttonStyles?.border?.style,
154
+ // buttonStyles?.border?.color,
155
+ buttonStyles?.shadow,
156
+ // Theme disabled states
157
+ disabled && buttonStyles?.disabled?.opacity,
158
+ disabled && buttonStyles?.disabled?.cursor,
159
+ disabled && buttonStyles?.disabled?.color,
160
+ disabled && buttonStyles?.disabled?.background,
161
+ disabled && buttonStyles?.disabled?.border,
162
+ // User overrides
163
+ buttonStyles?.custom,
164
+ className
165
+ );
166
+ return /* @__PURE__ */ jsx4(
167
+ Button,
168
+ {
169
+ variant,
170
+ size,
171
+ disabled,
172
+ className: classes,
173
+ ...props,
174
+ children
175
+ }
176
+ );
177
+ };
178
+
179
+ // src/primitives/caption.tsx
180
+ import { jsx as jsx5 } from "react/jsx-runtime";
181
+ var Caption = ({
182
+ children,
183
+ className = "",
184
+ theme,
185
+ ...props
186
+ }) => {
187
+ const typographyStyles = theme?.typography?.caption;
188
+ const classes = cn(
189
+ // Base styles
190
+ "text-xs leading-7 text-muted-foreground",
191
+ // Theme overrides
192
+ typographyStyles?.fontFamily,
193
+ typographyStyles?.fontSize,
194
+ typographyStyles?.fontWeight,
195
+ typographyStyles?.lineHeight,
196
+ typographyStyles?.letterSpacing,
197
+ typographyStyles?.textTransform,
198
+ typographyStyles?.textDecoration,
199
+ typographyStyles?.textOverflow,
200
+ className
201
+ );
202
+ return /* @__PURE__ */ jsx5("span", { className: classes, ...props, children });
203
+ };
204
+
205
+ // src/primitives/heading.tsx
206
+ import { jsx as jsx6 } from "react/jsx-runtime";
207
+ var FLUID_MIN_VIEWPORT = 360;
208
+ var FLUID_MAX_VIEWPORT = 1280;
209
+ var TAILWIND_TEXT_PX = {
210
+ "text-xs": 12,
211
+ "text-sm": 14,
212
+ "text-base": 16,
213
+ "text-lg": 18,
214
+ "text-xl": 20,
215
+ "text-2xl": 24,
216
+ "text-3xl": 30,
217
+ "text-4xl": 36,
218
+ "text-5xl": 48,
219
+ "text-6xl": 60,
220
+ "text-7xl": 72,
221
+ "text-8xl": 96,
222
+ "text-9xl": 128
223
+ };
224
+ var rem = (px) => `${+(px / 16).toFixed(4)}rem`;
225
+ function fluidFontSize({ min, max }) {
226
+ const slope = (max - min) / (FLUID_MAX_VIEWPORT - FLUID_MIN_VIEWPORT);
227
+ const intercept = min - slope * FLUID_MIN_VIEWPORT;
228
+ return `clamp(${rem(Math.min(min, max))}, ${rem(intercept)} + ${+(slope * 100).toFixed(4)}vw, ${rem(Math.max(min, max))})`;
229
+ }
230
+ function themeSize(typography) {
231
+ if (typography?.fluid) return fluidFontSize(typography.fluid);
232
+ const px = TAILWIND_TEXT_PX[typography?.fontSize ?? ""];
233
+ return px ? rem(px) : void 0;
234
+ }
235
+ function createHeading(displayName, defaultTag, baseClasses, getTypography) {
236
+ const Heading = ({
237
+ children,
238
+ className = "",
239
+ theme,
240
+ as: Tag = defaultTag,
241
+ sizeClassName,
242
+ style,
243
+ ...props
244
+ }) => {
245
+ const typography = getTypography(theme);
246
+ const fluid = typography?.fluid;
247
+ const classes = cn(
248
+ baseClasses,
249
+ typography?.fontSize,
250
+ // A class (not an inline font-size) so `sizeClassName` still wins.
251
+ fluid && "text-[length:var(--pb-theme-size)]",
252
+ sizeClassName,
253
+ typography?.fontFamily,
254
+ typography?.fontWeight,
255
+ typography?.lineHeight,
256
+ typography?.letterSpacing,
257
+ typography?.textTransform,
258
+ typography?.textDecoration,
259
+ typography?.textOverflow,
260
+ className
261
+ );
262
+ return /* @__PURE__ */ jsx6(
263
+ Tag,
264
+ {
265
+ className: classes,
266
+ style: { "--pb-theme-size": themeSize(typography), ...style },
267
+ ...props,
268
+ children
269
+ }
270
+ );
271
+ };
272
+ Heading.displayName = displayName;
273
+ return Heading;
274
+ }
275
+
276
+ // src/primitives/header4.tsx
277
+ var Header4 = createHeading(
278
+ "Header4",
279
+ "h4",
280
+ "scroll-m-20 text-xl font-semibold tracking-normal",
281
+ (theme) => theme?.typography?.header4
282
+ );
283
+
284
+ // src/primitives/card.tsx
285
+ import { jsx as jsx7 } from "react/jsx-runtime";
286
+ var PageCard = ({
287
+ isLink,
288
+ children,
289
+ className = "",
290
+ theme,
291
+ ...props
292
+ }) => {
293
+ const cardStyles = theme?.interactives?.card;
294
+ const classes = cn(
295
+ // Base styles
296
+ "bg-card text-card-foreground",
297
+ // Theme interactivity
298
+ cardStyles?.border?.width,
299
+ cardStyles?.border?.radius,
300
+ cardStyles?.border?.style,
301
+ cardStyles?.shadow,
302
+ isLink ? "cursor-pointer" : "",
303
+ // User overrides
304
+ cardStyles?.custom,
305
+ className
306
+ );
307
+ return /* @__PURE__ */ jsx7("div", { className: classes, ...props, children });
308
+ };
309
+ var PageCardImage = ({
310
+ src,
311
+ alt,
312
+ className = "",
313
+ theme,
314
+ ...props
315
+ }) => {
316
+ const classes = cn(
317
+ // Base styles
318
+ "w-full",
319
+ className
320
+ );
321
+ return /* @__PURE__ */ jsx7("img", { src, alt, className: classes, ...props });
322
+ };
323
+ var PageCardContent = ({
324
+ children,
325
+ className = "",
326
+ theme,
327
+ ...props
328
+ }) => {
329
+ const cardStyles = theme?.interactives?.card;
330
+ const classes = cn(
331
+ // Base styles
332
+ "p-4",
333
+ // Theme interactivity
334
+ cardStyles?.padding?.x,
335
+ cardStyles?.padding?.y,
336
+ className
337
+ );
338
+ return /* @__PURE__ */ jsx7("div", { className: classes, ...props, children });
339
+ };
340
+ var PageCardHeader = ({
341
+ children,
342
+ className = "",
343
+ theme,
344
+ ...props
345
+ }) => {
346
+ const classes = cn(
347
+ // Base styles
348
+ "pb-4",
349
+ className
350
+ );
351
+ return /* @__PURE__ */ jsx7("div", { className: classes, ...props, children: /* @__PURE__ */ jsx7(Header4, { theme, children }) });
352
+ };
353
+
354
+ // src/primitives/display.tsx
355
+ var Display = createHeading(
356
+ "Display",
357
+ "h1",
358
+ "scroll-m-20 text-balance text-5xl font-bold tracking-tight",
359
+ (theme) => theme?.typography?.display ?? theme?.typography?.header1
360
+ );
361
+
362
+ // src/primitives/header1.tsx
363
+ var Header1 = createHeading(
364
+ "Header1",
365
+ "h1",
366
+ "scroll-m-20 text-balance text-4xl font-bold tracking-tight",
367
+ (theme) => theme?.typography?.header1
368
+ );
369
+
370
+ // src/primitives/header2.tsx
371
+ var Header2 = createHeading(
372
+ "Header2",
373
+ "h2",
374
+ "scroll-m-20 text-balance text-3xl font-bold tracking-tight",
375
+ (theme) => theme?.typography?.header2
376
+ );
377
+
378
+ // src/primitives/header3.tsx
379
+ var Header3 = createHeading(
380
+ "Header3",
381
+ "h3",
382
+ "scroll-m-20 text-2xl font-semibold tracking-normal",
383
+ (theme) => theme?.typography?.header3
384
+ );
385
+
386
+ // src/primitives/image.tsx
387
+ import { jsx as jsx8 } from "react/jsx-runtime";
388
+ var Image = ({
389
+ src,
390
+ alt = "",
391
+ className = "",
392
+ theme,
393
+ ...props
394
+ }) => {
395
+ const cardStyles = theme?.interactives?.card;
396
+ const classes = cn("w-full object-cover", cardStyles?.border?.radius, className);
397
+ return /* @__PURE__ */ jsx8("img", { src, alt, className: classes, ...props });
398
+ };
399
+
400
+ // src/primitives/input.tsx
401
+ import React3 from "react";
402
+
403
+ // src/primitives/components/ui/input.tsx
404
+ import * as React2 from "react";
405
+ import { jsx as jsx9 } from "react/jsx-runtime";
406
+ var Input = React2.forwardRef(
407
+ ({ className, type, ...props }, ref) => {
408
+ return /* @__PURE__ */ jsx9(
409
+ "input",
410
+ {
411
+ type,
412
+ className: cn(
413
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
414
+ className
415
+ ),
416
+ ref,
417
+ ...props
418
+ }
419
+ );
420
+ }
421
+ );
422
+ Input.displayName = "Input";
423
+
424
+ // src/primitives/input.tsx
425
+ import { jsx as jsx10 } from "react/jsx-runtime";
426
+ var Input2 = React3.forwardRef(
427
+ ({
428
+ className = "",
429
+ theme,
430
+ error = false,
431
+ /*style = {},*/
432
+ ...props
433
+ }, ref) => {
434
+ const inputStyles = theme?.interactives?.input;
435
+ const typographyStyles = theme?.typography?.input;
436
+ const classes = cn(
437
+ // Base styles
438
+ // "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
439
+ // Theme typography
440
+ typographyStyles?.fontFamily,
441
+ typographyStyles?.fontSize,
442
+ typographyStyles?.fontWeight,
443
+ typographyStyles?.lineHeight,
444
+ typographyStyles?.letterSpacing,
445
+ typographyStyles?.textTransform,
446
+ typographyStyles?.textDecoration,
447
+ typographyStyles?.textOverflow,
448
+ // Theme interactivity
449
+ inputStyles?.padding?.x,
450
+ inputStyles?.padding?.y,
451
+ inputStyles?.border?.width,
452
+ inputStyles?.border?.style,
453
+ inputStyles?.border?.radius,
454
+ // inputStyles?.border?.color,
455
+ inputStyles?.shadow,
456
+ // Theme disabled states
457
+ props.disabled && inputStyles?.disabled?.opacity,
458
+ props.disabled && inputStyles?.disabled?.cursor,
459
+ props.disabled && inputStyles?.disabled?.color,
460
+ props.disabled && inputStyles?.disabled?.background,
461
+ props.disabled && inputStyles?.disabled?.border,
462
+ // Error state
463
+ error && "border-red-300 focus:border-red-500 focus:ring-red-500",
464
+ // User overrides
465
+ inputStyles?.custom,
466
+ className
467
+ );
468
+ return /* @__PURE__ */ jsx10(Input, { ref, className: classes, ...props });
469
+ }
470
+ );
471
+ Input2.displayName = "Input";
472
+
473
+ // src/primitives/label.tsx
474
+ import React5 from "react";
475
+
476
+ // src/primitives/components/ui/label.tsx
477
+ import * as LabelPrimitive from "@radix-ui/react-label";
478
+ import { cva as cva3 } from "class-variance-authority";
479
+ import * as React4 from "react";
480
+ import { jsx as jsx11 } from "react/jsx-runtime";
481
+ var labelVariants = cva3(
482
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
483
+ );
484
+ var Label = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
485
+ LabelPrimitive.Root,
486
+ {
487
+ ref,
488
+ className: cn(labelVariants(), className),
489
+ ...props
490
+ }
491
+ ));
492
+ Label.displayName = LabelPrimitive.Root.displayName;
493
+
494
+ // src/primitives/label.tsx
495
+ import { jsx as jsx12 } from "react/jsx-runtime";
496
+ var Label2 = React5.forwardRef(
497
+ ({ className = "", theme, error = false, ...props }, ref) => {
498
+ const typographyStyles = theme?.typography?.text2;
499
+ const classes = cn(
500
+ // Theme typography
501
+ typographyStyles?.fontFamily,
502
+ typographyStyles?.fontSize,
503
+ typographyStyles?.fontWeight,
504
+ typographyStyles?.lineHeight,
505
+ typographyStyles?.letterSpacing,
506
+ typographyStyles?.textTransform,
507
+ typographyStyles?.textDecoration,
508
+ typographyStyles?.textOverflow,
509
+ // Error state
510
+ error && "text-red-500",
511
+ className
512
+ );
513
+ return /* @__PURE__ */ jsx12(Label, { ref, className: classes, ...props });
514
+ }
515
+ );
516
+ Label2.displayName = "Label";
517
+
518
+ // src/primitives/link.tsx
519
+ import { jsx as jsx13 } from "react/jsx-runtime";
520
+ var Link = ({
521
+ children,
522
+ className = "",
523
+ theme,
524
+ disabled = false,
525
+ style,
526
+ ...props
527
+ }) => {
528
+ const typographyStyles = theme?.typography?.link;
529
+ const linkStyles = theme?.interactives?.link;
530
+ const classes = cn(
531
+ // Base styles
532
+ "font-medium cursor-pointer",
533
+ // Theme typography
534
+ typographyStyles?.fontFamily,
535
+ typographyStyles?.fontSize,
536
+ typographyStyles?.fontWeight,
537
+ typographyStyles?.lineHeight,
538
+ typographyStyles?.letterSpacing,
539
+ typographyStyles?.textTransform,
540
+ typographyStyles?.textDecoration,
541
+ typographyStyles?.textOverflow,
542
+ // Theme interactivity
543
+ linkStyles?.padding?.x,
544
+ linkStyles?.padding?.y,
545
+ linkStyles?.border?.width,
546
+ linkStyles?.border?.radius,
547
+ linkStyles?.border?.style,
548
+ // Theme disabled states
549
+ disabled && linkStyles?.disabled?.color,
550
+ disabled && linkStyles?.disabled?.background,
551
+ disabled && linkStyles?.disabled?.border,
552
+ disabled && linkStyles?.disabled?.opacity,
553
+ disabled && linkStyles?.disabled?.cursor,
554
+ // User overrides
555
+ linkStyles?.custom,
556
+ className
557
+ );
558
+ return /* @__PURE__ */ jsx13(
559
+ "span",
560
+ {
561
+ className: classes,
562
+ style: {
563
+ ...style,
564
+ textShadow: linkStyles?.textShadow || void 0
565
+ },
566
+ ...props,
567
+ children
568
+ }
569
+ );
570
+ };
571
+
572
+ // src/primitives/preheader.tsx
573
+ import { jsx as jsx14 } from "react/jsx-runtime";
574
+ var Preheader = ({
575
+ children,
576
+ className = "",
577
+ theme,
578
+ ...props
579
+ }) => {
580
+ const typographyStyles = theme?.typography?.preheader;
581
+ const classes = cn(
582
+ // Base styles
583
+ "text-sm font-medium uppercase tracking-wide",
584
+ // Theme typography
585
+ typographyStyles?.fontFamily,
586
+ typographyStyles?.fontSize,
587
+ typographyStyles?.fontWeight,
588
+ typographyStyles?.lineHeight,
589
+ typographyStyles?.letterSpacing,
590
+ typographyStyles?.textTransform,
591
+ typographyStyles?.textDecoration,
592
+ typographyStyles?.textOverflow,
593
+ className
594
+ );
595
+ return /* @__PURE__ */ jsx14("p", { className: classes, ...props, children });
596
+ };
597
+
598
+ // src/primitives/section.tsx
599
+ import React6 from "react";
600
+
601
+ // src/models/media.ts
602
+ function getMediaUrl(media) {
603
+ if (!media) return null;
604
+ if (typeof media === "string") return media.trim() || null;
605
+ if (typeof media === "object") {
606
+ const obj = media;
607
+ const url = obj.url ?? obj.file ?? obj.src;
608
+ return typeof url === "string" && url.trim() ? url.trim() : null;
609
+ }
610
+ return null;
611
+ }
612
+
613
+ // src/primitives/section.tsx
614
+ import { Fragment, jsx as jsx15, jsxs } from "react/jsx-runtime";
615
+ function resolveBackgroundLayer(background) {
616
+ const attachment = background.backgroundAttachment || "scroll";
617
+ if (background.type === "color") {
618
+ return {
619
+ className: "[background-color:var(--pb-bg)] dark:[background-color:var(--pb-bg-dark,var(--pb-bg))]",
620
+ style: {
621
+ "--pb-bg": background.backgroundColor,
622
+ "--pb-bg-dark": background.backgroundColorDark
623
+ }
624
+ };
625
+ }
626
+ if (background.type === "image") {
627
+ const bgUrl = getMediaUrl(background.media);
628
+ return {
629
+ style: {
630
+ backgroundImage: bgUrl ? `url(${bgUrl})` : void 0,
631
+ backgroundSize: background.backgroundSize || "cover",
632
+ backgroundPosition: background.backgroundPosition || "center",
633
+ backgroundRepeat: background.backgroundRepeat || "no-repeat",
634
+ backgroundAttachment: attachment,
635
+ maskImage: background.maskImage,
636
+ WebkitMaskImage: background.maskImage
637
+ }
638
+ };
639
+ }
640
+ return {
641
+ className: "[background-image:var(--pb-bg-image)] dark:[background-image:var(--pb-bg-image-dark,var(--pb-bg-image))]",
642
+ style: {
643
+ "--pb-bg-image": background.backgroundImage,
644
+ "--pb-bg-image-dark": background.backgroundImageDark,
645
+ backgroundSize: background.gradientBackgroundSize || "cover",
646
+ backgroundPosition: background.gradientBackgroundPosition || "center",
647
+ backgroundRepeat: background.gradientBackgroundRepeat || "no-repeat",
648
+ backgroundAttachment: attachment,
649
+ maskImage: background.gradientMaskImage,
650
+ WebkitMaskImage: background.gradientMaskImage
651
+ }
652
+ };
653
+ }
654
+ var Section = ({
655
+ children,
656
+ className = "",
657
+ theme,
658
+ background,
659
+ component = "section",
660
+ ...props
661
+ }) => {
662
+ const classes = cn(
663
+ "bg-background text-foreground relative",
664
+ component === "section" && theme?.structure?.section?.dividers && "border-t border-border",
665
+ className
666
+ );
667
+ const backgroundLayer = background ? resolveBackgroundLayer(background) : null;
668
+ const isFixed = background && background.type !== "color" && background.backgroundAttachment === "fixed";
669
+ return /* @__PURE__ */ jsx15(Fragment, { children: React6.createElement(
670
+ component,
671
+ {
672
+ // `overflow-clip` keeps a fixed-attachment layer painted
673
+ // only within the section bounds without creating a new
674
+ // scroll container (unlike overflow-hidden in some cases).
675
+ className: cn(classes, isFixed && "overflow-clip"),
676
+ ...props
677
+ },
678
+ /* @__PURE__ */ jsxs(Fragment, { children: [
679
+ backgroundLayer && /* @__PURE__ */ jsx15(
680
+ "div",
681
+ {
682
+ "aria-hidden": true,
683
+ className: cn(
684
+ "pointer-events-none absolute inset-0 z-0",
685
+ backgroundLayer.className
686
+ ),
687
+ style: backgroundLayer.style
688
+ }
689
+ ),
690
+ background && background.type === "image" && /* @__PURE__ */ jsx15(
691
+ "div",
692
+ {
693
+ "aria-hidden": true,
694
+ className: "pointer-events-none absolute inset-0 z-[1] [background-color:var(--pb-overlay)] dark:[background-color:var(--pb-overlay-dark,var(--pb-overlay))]",
695
+ style: {
696
+ "--pb-overlay": background?.overlay?.color,
697
+ "--pb-overlay-dark": background?.overlay?.colorDark,
698
+ opacity: background?.overlay?.opacity ? background.overlay.opacity / 10 : 0,
699
+ mixBlendMode: background?.overlay?.blendMode
700
+ }
701
+ }
702
+ ),
703
+ background && background.type === "image" && /* @__PURE__ */ jsx15(
704
+ "div",
705
+ {
706
+ "aria-hidden": true,
707
+ className: "pointer-events-none absolute inset-0 z-[2]",
708
+ style: {
709
+ backdropFilter: background?.blur ? `blur(${background?.blur}px)` : void 0
710
+ }
711
+ }
712
+ ),
713
+ /* @__PURE__ */ jsx15(
714
+ "div",
715
+ {
716
+ className: cn(
717
+ "mx-auto z-[3] relative overflow-hidden",
718
+ `lg:${theme?.structure?.page?.width || "max-w-6xl"}`,
719
+ theme?.structure?.section?.padding?.x || "px-4",
720
+ theme?.structure?.section?.padding?.y || "py-4"
721
+ ),
722
+ children
723
+ }
724
+ )
725
+ ] })
726
+ ) });
727
+ };
728
+
729
+ // src/primitives/subheader1.tsx
730
+ import { jsx as jsx16 } from "react/jsx-runtime";
731
+ var Subheader1 = ({
732
+ children,
733
+ className = "",
734
+ theme,
735
+ component = "h5",
736
+ ...props
737
+ }) => {
738
+ const typographyStyles = theme?.typography?.subheader1;
739
+ const classes = cn(
740
+ typographyStyles?.fontFamily || "font-sans",
741
+ typographyStyles?.fontSize || "text-lg",
742
+ typographyStyles?.fontWeight || "font-medium",
743
+ typographyStyles?.lineHeight || "leading-relaxed",
744
+ typographyStyles?.letterSpacing || "tracking-normal",
745
+ typographyStyles?.textTransform,
746
+ typographyStyles?.textDecoration,
747
+ typographyStyles?.textOverflow,
748
+ className
749
+ );
750
+ return component === "h5" ? /* @__PURE__ */ jsx16("h5", { className: classes, ...props, children }) : /* @__PURE__ */ jsx16("span", { className: classes, ...props, children });
751
+ };
752
+
753
+ // src/primitives/subheader2.tsx
754
+ import { jsx as jsx17 } from "react/jsx-runtime";
755
+ var Subheader2 = ({
756
+ children,
757
+ className = "",
758
+ theme,
759
+ ...props
760
+ }) => {
761
+ const typographyStyles = theme?.typography?.subheader2;
762
+ const classes = [
763
+ typographyStyles?.fontFamily || "font-sans",
764
+ typographyStyles?.fontSize || "text-base",
765
+ typographyStyles?.fontWeight || "font-medium",
766
+ typographyStyles?.lineHeight || "leading-relaxed",
767
+ typographyStyles?.letterSpacing || "tracking-normal",
768
+ typographyStyles?.textTransform,
769
+ typographyStyles?.textDecoration,
770
+ typographyStyles?.textOverflow,
771
+ className
772
+ ].filter(Boolean).join(" ");
773
+ return /* @__PURE__ */ jsx17("h6", { className: classes, ...props, children });
774
+ };
775
+
776
+ // src/primitives/text1.tsx
777
+ import { jsx as jsx18 } from "react/jsx-runtime";
778
+ var Text1 = ({
779
+ children,
780
+ className = "",
781
+ theme,
782
+ component = "p",
783
+ ...props
784
+ }) => {
785
+ const typographyStyles = theme?.typography?.text1;
786
+ const classes = cn(
787
+ // Base styles
788
+ "text-base",
789
+ // Theme overrides
790
+ typographyStyles?.fontFamily,
791
+ typographyStyles?.fontSize,
792
+ typographyStyles?.fontWeight,
793
+ typographyStyles?.lineHeight,
794
+ typographyStyles?.letterSpacing,
795
+ typographyStyles?.textTransform,
796
+ typographyStyles?.textDecoration,
797
+ typographyStyles?.textOverflow,
798
+ className
799
+ );
800
+ return component === "p" ? /* @__PURE__ */ jsx18("p", { className: classes, ...props, children }) : /* @__PURE__ */ jsx18("span", { className: classes, ...props, children });
801
+ };
802
+
803
+ // src/primitives/text2.tsx
804
+ import { jsx as jsx19 } from "react/jsx-runtime";
805
+ var Text2 = ({
806
+ children,
807
+ className = "",
808
+ theme,
809
+ component = "p",
810
+ ...props
811
+ }) => {
812
+ const typographyStyles = theme?.typography?.text2;
813
+ const classes = cn(
814
+ // Base styles
815
+ "text-sm",
816
+ // Theme overrides
817
+ typographyStyles?.fontFamily,
818
+ typographyStyles?.fontSize,
819
+ typographyStyles?.fontWeight,
820
+ typographyStyles?.lineHeight,
821
+ typographyStyles?.letterSpacing,
822
+ typographyStyles?.textTransform,
823
+ typographyStyles?.textDecoration,
824
+ typographyStyles?.textOverflow,
825
+ className
826
+ );
827
+ return component === "p" ? /* @__PURE__ */ jsx19("p", { className: classes, ...props, children }) : /* @__PURE__ */ jsx19("span", { className: classes, ...props, children });
828
+ };
829
+
830
+ // src/primitives/textarea.tsx
831
+ import React7 from "react";
832
+ import { jsx as jsx20 } from "react/jsx-runtime";
833
+ var Textarea = React7.forwardRef(
834
+ ({ className = "", theme, error = false, ...props }, ref) => {
835
+ const inputStyles = theme?.interactives?.input;
836
+ const typographyStyles = theme?.typography?.input;
837
+ const classes = cn(
838
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm outline-none placeholder:text-muted-foreground focus-visible:ring-2 focus-visible:ring-ring/30 disabled:cursor-not-allowed disabled:opacity-50",
839
+ typographyStyles?.fontFamily,
840
+ typographyStyles?.fontSize,
841
+ typographyStyles?.fontWeight,
842
+ typographyStyles?.lineHeight,
843
+ typographyStyles?.letterSpacing,
844
+ inputStyles?.padding?.x,
845
+ inputStyles?.padding?.y,
846
+ inputStyles?.border?.width,
847
+ inputStyles?.border?.style,
848
+ inputStyles?.border?.radius,
849
+ inputStyles?.shadow,
850
+ props.disabled && inputStyles?.disabled?.opacity,
851
+ props.disabled && inputStyles?.disabled?.cursor,
852
+ error && "border-red-300 focus:border-red-500 focus:ring-red-500",
853
+ inputStyles?.custom,
854
+ className
855
+ );
856
+ return /* @__PURE__ */ jsx20("textarea", { ref, className: classes, ...props });
857
+ }
858
+ );
859
+ Textarea.displayName = "Textarea";
860
+ export {
861
+ Badge2 as Badge,
862
+ Button2 as Button,
863
+ Caption,
864
+ Display,
865
+ Header1,
866
+ Header2,
867
+ Header3,
868
+ Header4,
869
+ Image,
870
+ Input2 as Input,
871
+ Label2 as Label,
872
+ Link,
873
+ PageCard,
874
+ PageCardContent,
875
+ PageCardHeader,
876
+ PageCardImage,
877
+ Preheader,
878
+ Section,
879
+ Subheader1,
880
+ Subheader2,
881
+ TAILWIND_TEXT_PX,
882
+ Text1,
883
+ Text2,
884
+ Textarea,
885
+ createHeading,
886
+ fluidFontSize
887
+ };
888
+ //# sourceMappingURL=primitives.js.map