@frontlit/page-builder 0.1.0-alpha.4 → 0.1.0-alpha.6

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 (46) hide show
  1. package/dist/blocks/index.d.ts +18 -3
  2. package/dist/blocks/index.js +3 -3
  3. package/dist/builder/index.d.ts +4 -1
  4. package/dist/builder/index.js +6 -6
  5. package/dist/{chunk-BBI7UHOA.js → chunk-BWOGREWJ.js} +3 -3
  6. package/dist/{chunk-BBI7UHOA.js.map → chunk-BWOGREWJ.js.map} +1 -1
  7. package/dist/{chunk-K4WCLHMS.js → chunk-FZBLE44D.js} +317 -66
  8. package/dist/chunk-FZBLE44D.js.map +1 -0
  9. package/dist/{chunk-J7Z4UW45.js → chunk-OEQJQ4OA.js} +112 -5
  10. package/dist/chunk-OEQJQ4OA.js.map +1 -0
  11. package/dist/{chunk-GIKTOAQS.js → chunk-PQTDUFKU.js} +9 -9
  12. package/dist/chunk-PQTDUFKU.js.map +1 -0
  13. package/dist/{chunk-36QHCIPM.js → chunk-QMUIISN3.js} +5 -93
  14. package/dist/chunk-QMUIISN3.js.map +1 -0
  15. package/dist/{chunk-IU4KATI2.js → chunk-YXLOVEQZ.js} +6 -6
  16. package/dist/{chunk-IU4KATI2.js.map → chunk-YXLOVEQZ.js.map} +1 -1
  17. package/dist/components/index.d.ts +1 -1
  18. package/dist/components/index.js +3 -3
  19. package/dist/{image-Bk8kPXwP.d.ts → image-Cv0aSUHD.d.ts} +3 -1
  20. package/dist/index.d.ts +1 -1
  21. package/dist/index.js +6 -6
  22. package/dist/primitives/index.d.ts +2 -0
  23. package/dist/primitives/index.js +1 -1
  24. package/dist/renderer/index.js +5 -5
  25. package/dist/server/index.js +151 -53
  26. package/dist/server/index.js.map +1 -1
  27. package/dist/server/islands/header-github-stars.d.ts +12 -0
  28. package/dist/server/islands/header-github-stars.js +31 -0
  29. package/dist/server/islands/header-github-stars.js.map +1 -0
  30. package/dist/server/islands/pricing-period-switch.d.ts +20 -0
  31. package/dist/server/islands/pricing-period-switch.js +151 -0
  32. package/dist/server/islands/pricing-period-switch.js.map +1 -0
  33. package/dist/server/primitives.d.ts +2 -0
  34. package/dist/server/primitives.js +53 -30
  35. package/dist/server/primitives.js.map +1 -1
  36. package/dist/server/schema.d.ts +38 -0
  37. package/dist/server/schema.js +17 -2
  38. package/dist/server/schema.js.map +1 -1
  39. package/dist/styles.css +12 -0
  40. package/package.json +1 -1
  41. package/schema/page.v1.json +29 -1
  42. package/schema/site.v1.json +8 -0
  43. package/dist/chunk-36QHCIPM.js.map +0 -1
  44. package/dist/chunk-GIKTOAQS.js.map +0 -1
  45. package/dist/chunk-J7Z4UW45.js.map +0 -1
  46. package/dist/chunk-K4WCLHMS.js.map +0 -1
@@ -0,0 +1,12 @@
1
+ import * as React from 'react';
2
+
3
+ /**
4
+ * Star count for the header's GitHub link. Fetched in the browser, like
5
+ * CourseLit, because unauthenticated GitHub API calls are limited per IP.
6
+ * Renders nothing until loaded, on error, or for 0 stars.
7
+ */
8
+ declare function GithubStars({ repo }: {
9
+ repo: string;
10
+ }): React.JSX.Element;
11
+
12
+ export { GithubStars };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ "use client";
3
+
4
+ // src/blocks/header/github-stars.tsx
5
+ import { useEffect, useState } from "react";
6
+
7
+ // src/blocks/header/github.ts
8
+ function formatStars(count) {
9
+ return new Intl.NumberFormat("en", {
10
+ notation: "compact",
11
+ maximumFractionDigits: 1
12
+ }).format(count).toLowerCase();
13
+ }
14
+
15
+ // src/blocks/header/github-stars.tsx
16
+ import { jsx } from "react/jsx-runtime";
17
+ function GithubStars({ repo }) {
18
+ const [stars, setStars] = useState();
19
+ useEffect(() => {
20
+ const controller = new AbortController();
21
+ fetch(`https://api.github.com/repos/${repo}`, { signal: controller.signal }).then((response) => response.ok ? response.json() : void 0).then((data) => setStars(data?.stargazers_count)).catch(() => {
22
+ });
23
+ return () => controller.abort();
24
+ }, [repo]);
25
+ if (!stars) return null;
26
+ return /* @__PURE__ */ jsx("span", { children: formatStars(stars) });
27
+ }
28
+ export {
29
+ GithubStars
30
+ };
31
+ //# sourceMappingURL=header-github-stars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/blocks/header/github-stars.tsx","../../../src/blocks/header/github.ts"],"sourcesContent":["\"use client\";\n\nimport { useEffect, useState } from \"react\";\nimport { formatStars } from \"./github\";\n\n/**\n * Star count for the header's GitHub link. Fetched in the browser, like\n * CourseLit, because unauthenticated GitHub API calls are limited per IP.\n * Renders nothing until loaded, on error, or for 0 stars.\n */\nexport function GithubStars({ repo }: { repo: string }) {\n const [stars, setStars] = useState<number>();\n\n useEffect(() => {\n const controller = new AbortController();\n fetch(`https://api.github.com/repos/${repo}`, { signal: controller.signal })\n .then((response) => (response.ok ? response.json() : undefined))\n .then((data) => setStars(data?.stargazers_count))\n .catch(() => {});\n return () => controller.abort();\n }, [repo]);\n\n if (!stars) return null;\n return <span>{formatStars(stars)}</span>;\n}\n","/** `owner/repo` from `owner/repo` or a `https://github.com/owner/repo` URL. */\nexport function parseGithubRepo(value?: string): string | undefined {\n const match = value\n ?.trim()\n .match(/^(?:https?:\\/\\/(?:www\\.)?github\\.com\\/)?([\\w.-]+\\/[\\w.-]+?)(?:\\.git)?\\/?$/);\n return match?.[1];\n}\n\n/** 1234 → \"1.2k\", like GitHub's own star count. */\nexport function formatStars(count: number): string {\n return new Intl.NumberFormat(\"en\", {\n notation: \"compact\",\n maximumFractionDigits: 1,\n })\n .format(count)\n .toLowerCase();\n}\n"],"mappings":";;;;AAEA,SAAS,WAAW,gBAAgB;;;ACO7B,SAAS,YAAY,OAAuB;AACjD,SAAO,IAAI,KAAK,aAAa,MAAM;AAAA,IACjC,UAAU;AAAA,IACV,uBAAuB;AAAA,EACzB,CAAC,EACE,OAAO,KAAK,EACZ,YAAY;AACjB;;;ADOS;AAbF,SAAS,YAAY,EAAE,KAAK,GAAqB;AACtD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAiB;AAE3C,YAAU,MAAM;AACd,UAAM,aAAa,IAAI,gBAAgB;AACvC,UAAM,gCAAgC,IAAI,IAAI,EAAE,QAAQ,WAAW,OAAO,CAAC,EACxE,KAAK,CAAC,aAAc,SAAS,KAAK,SAAS,KAAK,IAAI,MAAU,EAC9D,KAAK,CAAC,SAAS,SAAS,MAAM,gBAAgB,CAAC,EAC/C,MAAM,MAAM;AAAA,IAAC,CAAC;AACjB,WAAO,MAAM,WAAW,MAAM;AAAA,EAChC,GAAG,CAAC,IAAI,CAAC;AAET,MAAI,CAAC,MAAO,QAAO;AACnB,SAAO,oBAAC,UAAM,sBAAY,KAAK,GAAE;AACnC;","names":[]}
@@ -0,0 +1,20 @@
1
+ import * as React from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { T as ThemeStyle } from '../theme-style-5_AGy-4V.js';
4
+
5
+ type PricingPeriod = "monthly" | "yearly";
6
+
7
+ /**
8
+ * Monthly/Yearly switch for the pricing block. The plans are rendered on the
9
+ * server with both prices; this only flips `data-period` on the wrapper and
10
+ * CSS shows the matching one, so prices are in the HTML before hydration.
11
+ */
12
+ declare function PricingPeriodSwitch({ defaultPeriod, monthlyCaption, yearlyCaption, theme, children, }: {
13
+ defaultPeriod: PricingPeriod;
14
+ monthlyCaption: string;
15
+ yearlyCaption: string;
16
+ theme: ThemeStyle;
17
+ children: ReactNode;
18
+ }): React.JSX.Element;
19
+
20
+ export { PricingPeriodSwitch };
@@ -0,0 +1,151 @@
1
+ "use client";
2
+ "use client";
3
+
4
+ // src/blocks/pricing/period-switch.tsx
5
+ import { useId, useState } from "react";
6
+
7
+ // src/primitives/lib/utils.ts
8
+ import { clsx } from "clsx";
9
+ import { twMerge } from "tailwind-merge";
10
+ function cn(...inputs) {
11
+ return twMerge(clsx(inputs));
12
+ }
13
+
14
+ // src/primitives/label.tsx
15
+ import React2 from "react";
16
+
17
+ // src/primitives/components/ui/label.tsx
18
+ import * as LabelPrimitive from "@radix-ui/react-label";
19
+ import { cva } from "class-variance-authority";
20
+ import * as React from "react";
21
+ import { jsx } from "react/jsx-runtime";
22
+ var labelVariants = cva(
23
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
24
+ );
25
+ var Label = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
26
+ LabelPrimitive.Root,
27
+ {
28
+ ref,
29
+ className: cn(labelVariants(), className),
30
+ ...props
31
+ }
32
+ ));
33
+ Label.displayName = LabelPrimitive.Root.displayName;
34
+
35
+ // src/primitives/label.tsx
36
+ import { jsx as jsx2 } from "react/jsx-runtime";
37
+ var Label2 = React2.forwardRef(
38
+ ({ className = "", theme, error = false, ...props }, ref) => {
39
+ const typographyStyles = theme?.typography?.text2;
40
+ const classes = cn(
41
+ // Theme typography
42
+ typographyStyles?.fontFamily,
43
+ typographyStyles?.fontSize,
44
+ typographyStyles?.fontWeight,
45
+ typographyStyles?.lineHeight,
46
+ typographyStyles?.letterSpacing,
47
+ typographyStyles?.textTransform,
48
+ typographyStyles?.textDecoration,
49
+ typographyStyles?.textOverflow,
50
+ // Error state
51
+ error && "text-red-500",
52
+ className
53
+ );
54
+ return /* @__PURE__ */ jsx2(Label, { ref, className: classes, ...props });
55
+ }
56
+ );
57
+ Label2.displayName = "Label";
58
+
59
+ // src/primitives/switch.tsx
60
+ import React4 from "react";
61
+
62
+ // src/primitives/components/ui/switch.tsx
63
+ import * as SwitchPrimitives from "@radix-ui/react-switch";
64
+ import * as React3 from "react";
65
+ import { jsx as jsx3 } from "react/jsx-runtime";
66
+ var Switch = React3.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx3(
67
+ SwitchPrimitives.Root,
68
+ {
69
+ className: cn(
70
+ "peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
71
+ className
72
+ ),
73
+ ...props,
74
+ ref,
75
+ children: /* @__PURE__ */ jsx3(
76
+ SwitchPrimitives.Thumb,
77
+ {
78
+ className: cn(
79
+ "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
80
+ )
81
+ }
82
+ )
83
+ }
84
+ ));
85
+ Switch.displayName = SwitchPrimitives.Root.displayName;
86
+
87
+ // src/primitives/switch.tsx
88
+ import { jsx as jsx4 } from "react/jsx-runtime";
89
+ var Switch2 = React4.forwardRef(({ className = "", theme, ...props }, ref) => {
90
+ const classes = cn(
91
+ // Base styles
92
+ "",
93
+ // User overrides
94
+ className
95
+ );
96
+ return /* @__PURE__ */ jsx4(Switch, { ref, className: classes, ...props });
97
+ });
98
+
99
+ // src/blocks/pricing/period-switch.tsx
100
+ import { jsx as jsx5, jsxs } from "react/jsx-runtime";
101
+ function PricingPeriodSwitch({
102
+ defaultPeriod,
103
+ monthlyCaption,
104
+ yearlyCaption,
105
+ theme,
106
+ children
107
+ }) {
108
+ const [period, setPeriod] = useState(defaultPeriod);
109
+ const id = useId();
110
+ const monthlyId = `${id}-monthly`;
111
+ const yearlyId = `${id}-yearly`;
112
+ return /* @__PURE__ */ jsxs("div", { "data-period": period, className: "group/pricing flex flex-col gap-8", children: [
113
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-center gap-3", children: [
114
+ /* @__PURE__ */ jsx5(
115
+ Label2,
116
+ {
117
+ id: monthlyId,
118
+ theme,
119
+ className: "cursor-pointer",
120
+ onClick: () => setPeriod("monthly"),
121
+ children: monthlyCaption
122
+ }
123
+ ),
124
+ /* @__PURE__ */ jsx5(
125
+ Switch2,
126
+ {
127
+ theme,
128
+ checked: period === "yearly",
129
+ onCheckedChange: (checked) => setPeriod(checked ? "yearly" : "monthly"),
130
+ "aria-labelledby": yearlyId,
131
+ "aria-describedby": monthlyId
132
+ }
133
+ ),
134
+ /* @__PURE__ */ jsx5(
135
+ Label2,
136
+ {
137
+ id: yearlyId,
138
+ theme,
139
+ className: "cursor-pointer",
140
+ onClick: () => setPeriod("yearly"),
141
+ children: yearlyCaption
142
+ }
143
+ )
144
+ ] }),
145
+ children
146
+ ] });
147
+ }
148
+ export {
149
+ PricingPeriodSwitch
150
+ };
151
+ //# sourceMappingURL=pricing-period-switch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/blocks/pricing/period-switch.tsx","../../../src/primitives/lib/utils.ts","../../../src/primitives/label.tsx","../../../src/primitives/components/ui/label.tsx","../../../src/primitives/switch.tsx","../../../src/primitives/components/ui/switch.tsx"],"sourcesContent":["\"use client\";\n\nimport { type ReactNode, useId, useState } from \"react\";\nimport type { ThemeStyle } from \"../../models\";\nimport type { PricingPeriod } from \"./settings\";\nimport { Label, Switch } from \"../../primitives\";\n\n/**\n * Monthly/Yearly switch for the pricing block. The plans are rendered on the\n * server with both prices; this only flips `data-period` on the wrapper and\n * CSS shows the matching one, so prices are in the HTML before hydration.\n */\nexport function PricingPeriodSwitch({\n defaultPeriod,\n monthlyCaption,\n yearlyCaption,\n theme,\n children,\n}: {\n defaultPeriod: PricingPeriod;\n monthlyCaption: string;\n yearlyCaption: string;\n theme: ThemeStyle;\n children: ReactNode;\n}) {\n const [period, setPeriod] = useState<PricingPeriod>(defaultPeriod);\n const id = useId();\n const monthlyId = `${id}-monthly`;\n const yearlyId = `${id}-yearly`;\n\n return (\n <div data-period={period} className=\"group/pricing flex flex-col gap-8\">\n <div className=\"flex items-center justify-center gap-3\">\n <Label\n id={monthlyId}\n theme={theme}\n className=\"cursor-pointer\"\n onClick={() => setPeriod(\"monthly\")}\n >\n {monthlyCaption}\n </Label>\n <Switch\n theme={theme}\n checked={period === \"yearly\"}\n onCheckedChange={(checked) => setPeriod(checked ? \"yearly\" : \"monthly\")}\n aria-labelledby={yearlyId}\n aria-describedby={monthlyId}\n />\n <Label\n id={yearlyId}\n theme={theme}\n className=\"cursor-pointer\"\n onClick={() => setPeriod(\"yearly\")}\n >\n {yearlyCaption}\n </Label>\n </div>\n {children}\n </div>\n );\n}\n","import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n","import React from \"react\";\nimport type { ThemeStyle } from \"../models\";\nimport { Label as ShadcnLabel } from \"./components/ui/label\";\nimport { cn } from \"./lib/utils\";\n\nexport interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {\n theme?: ThemeStyle;\n error?: boolean;\n}\n\nexport const Label = React.forwardRef<HTMLLabelElement, LabelProps>(\n ({ className = \"\", theme, error = false, ...props }, ref) => {\n const typographyStyles = theme?.typography?.text2;\n\n const classes = cn(\n // Theme typography\n typographyStyles?.fontFamily,\n typographyStyles?.fontSize,\n typographyStyles?.fontWeight,\n typographyStyles?.lineHeight,\n typographyStyles?.letterSpacing,\n typographyStyles?.textTransform,\n typographyStyles?.textDecoration,\n typographyStyles?.textOverflow,\n // Error state\n error && \"text-red-500\",\n className,\n );\n\n return <ShadcnLabel ref={ref} className={classes} {...props} />;\n },\n);\n\nLabel.displayName = \"Label\";\n","import * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst labelVariants = cva(\n \"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70\",\n);\n\nconst Label = React.forwardRef<\n React.ElementRef<typeof LabelPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> &\n VariantProps<typeof labelVariants>\n>(({ className, ...props }, ref) => (\n <LabelPrimitive.Root\n ref={ref}\n className={cn(labelVariants(), className)}\n {...props}\n />\n));\nLabel.displayName = LabelPrimitive.Root.displayName;\n\nexport { Label };\n","import React from \"react\";\nimport type { ThemeStyle } from \"../models\";\nimport { Switch as ShadcnSwitch } from \"./components/ui/switch\";\nimport { cn } from \"./lib/utils\";\n\nexport interface SwitchProps\n extends React.ComponentPropsWithoutRef<typeof ShadcnSwitch> {\n theme?: ThemeStyle;\n}\n\nexport const Switch = React.forwardRef<\n React.ElementRef<typeof ShadcnSwitch>,\n SwitchProps\n>(({ className = \"\", theme, ...props }, ref) => {\n const classes = cn(\n // Base styles\n \"\",\n // User overrides\n className,\n );\n\n return <ShadcnSwitch ref={ref} className={classes} {...props} />;\n});\n","import * as SwitchPrimitives from \"@radix-ui/react-switch\";\nimport * as React from \"react\";\n\nimport { cn } from \"../../lib/utils\";\n\nconst Switch = React.forwardRef<\n React.ElementRef<typeof SwitchPrimitives.Root>,\n React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>\n>(({ className, ...props }, ref) => (\n <SwitchPrimitives.Root\n className={cn(\n \"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input\",\n className,\n )}\n {...props}\n ref={ref}\n >\n <SwitchPrimitives.Thumb\n className={cn(\n \"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0\",\n )}\n />\n </SwitchPrimitives.Root>\n));\nSwitch.displayName = SwitchPrimitives.Root.displayName;\n\nexport { Switch };\n"],"mappings":"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","names":["React","jsx","Label","React","React","React","jsx","jsx","Switch","React","jsx","Label","Switch"]}
@@ -142,6 +142,8 @@ interface ImageProps extends React__default.ImgHTMLAttributes<HTMLImageElement>
142
142
  alt?: string;
143
143
  className?: string;
144
144
  theme?: ThemeStyle;
145
+ /** Above-the-fold image (e.g. LCP): fetched eagerly at high priority. */
146
+ priority?: boolean;
145
147
  }
146
148
  declare const Image: React__default.FC<ImageProps>;
147
149
 
@@ -383,18 +383,41 @@ var Header3 = createHeading(
383
383
  (theme) => theme?.typography?.header3
384
384
  );
385
385
 
386
- // src/primitives/image.tsx
386
+ // src/components/image.tsx
387
387
  import { jsx as jsx8 } from "react/jsx-runtime";
388
+ var registry = globalThis;
389
+ function resolveImageAttributes(input) {
390
+ return registry.__frontlitImageResolver?.(input) ?? null;
391
+ }
392
+
393
+ // src/primitives/image.tsx
394
+ import { jsx as jsx9 } from "react/jsx-runtime";
388
395
  var Image = ({
389
396
  src,
390
397
  alt = "",
391
398
  className = "",
392
399
  theme,
400
+ priority = false,
401
+ sizes,
393
402
  ...props
394
403
  }) => {
395
404
  const cardStyles = theme?.interactives?.card;
396
405
  const classes = cn("w-full object-cover", cardStyles?.border?.radius, className);
397
- return /* @__PURE__ */ jsx8("img", { src, alt, className: classes, ...props });
406
+ const optimized = resolveImageAttributes({ src, alt, sizes, priority });
407
+ return /* @__PURE__ */ jsx9(
408
+ "img",
409
+ {
410
+ src,
411
+ alt,
412
+ sizes,
413
+ loading: priority ? "eager" : "lazy",
414
+ decoding: "async",
415
+ fetchPriority: priority ? "high" : void 0,
416
+ className: classes,
417
+ ...props,
418
+ ...optimized
419
+ }
420
+ );
398
421
  };
399
422
 
400
423
  // src/primitives/input.tsx
@@ -402,10 +425,10 @@ import React3 from "react";
402
425
 
403
426
  // src/primitives/components/ui/input.tsx
404
427
  import * as React2 from "react";
405
- import { jsx as jsx9 } from "react/jsx-runtime";
428
+ import { jsx as jsx10 } from "react/jsx-runtime";
406
429
  var Input = React2.forwardRef(
407
430
  ({ className, type, ...props }, ref) => {
408
- return /* @__PURE__ */ jsx9(
431
+ return /* @__PURE__ */ jsx10(
409
432
  "input",
410
433
  {
411
434
  type,
@@ -422,7 +445,7 @@ var Input = React2.forwardRef(
422
445
  Input.displayName = "Input";
423
446
 
424
447
  // src/primitives/input.tsx
425
- import { jsx as jsx10 } from "react/jsx-runtime";
448
+ import { jsx as jsx11 } from "react/jsx-runtime";
426
449
  var Input2 = React3.forwardRef(
427
450
  ({
428
451
  className = "",
@@ -465,7 +488,7 @@ var Input2 = React3.forwardRef(
465
488
  inputStyles?.custom,
466
489
  className
467
490
  );
468
- return /* @__PURE__ */ jsx10(Input, { ref, className: classes, ...props });
491
+ return /* @__PURE__ */ jsx11(Input, { ref, className: classes, ...props });
469
492
  }
470
493
  );
471
494
  Input2.displayName = "Input";
@@ -477,11 +500,11 @@ import React5 from "react";
477
500
  import * as LabelPrimitive from "@radix-ui/react-label";
478
501
  import { cva as cva3 } from "class-variance-authority";
479
502
  import * as React4 from "react";
480
- import { jsx as jsx11 } from "react/jsx-runtime";
503
+ import { jsx as jsx12 } from "react/jsx-runtime";
481
504
  var labelVariants = cva3(
482
505
  "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
483
506
  );
484
- var Label = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx11(
507
+ var Label = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx12(
485
508
  LabelPrimitive.Root,
486
509
  {
487
510
  ref,
@@ -492,7 +515,7 @@ var Label = React4.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
492
515
  Label.displayName = LabelPrimitive.Root.displayName;
493
516
 
494
517
  // src/primitives/label.tsx
495
- import { jsx as jsx12 } from "react/jsx-runtime";
518
+ import { jsx as jsx13 } from "react/jsx-runtime";
496
519
  var Label2 = React5.forwardRef(
497
520
  ({ className = "", theme, error = false, ...props }, ref) => {
498
521
  const typographyStyles = theme?.typography?.text2;
@@ -510,13 +533,13 @@ var Label2 = React5.forwardRef(
510
533
  error && "text-red-500",
511
534
  className
512
535
  );
513
- return /* @__PURE__ */ jsx12(Label, { ref, className: classes, ...props });
536
+ return /* @__PURE__ */ jsx13(Label, { ref, className: classes, ...props });
514
537
  }
515
538
  );
516
539
  Label2.displayName = "Label";
517
540
 
518
541
  // src/primitives/link.tsx
519
- import { jsx as jsx13 } from "react/jsx-runtime";
542
+ import { jsx as jsx14 } from "react/jsx-runtime";
520
543
  var Link = ({
521
544
  children,
522
545
  className = "",
@@ -555,7 +578,7 @@ var Link = ({
555
578
  linkStyles?.custom,
556
579
  className
557
580
  );
558
- return /* @__PURE__ */ jsx13(
581
+ return /* @__PURE__ */ jsx14(
559
582
  "span",
560
583
  {
561
584
  className: classes,
@@ -570,7 +593,7 @@ var Link = ({
570
593
  };
571
594
 
572
595
  // src/primitives/preheader.tsx
573
- import { jsx as jsx14 } from "react/jsx-runtime";
596
+ import { jsx as jsx15 } from "react/jsx-runtime";
574
597
  var Preheader = ({
575
598
  children,
576
599
  className = "",
@@ -592,7 +615,7 @@ var Preheader = ({
592
615
  typographyStyles?.textOverflow,
593
616
  className
594
617
  );
595
- return /* @__PURE__ */ jsx14("p", { className: classes, ...props, children });
618
+ return /* @__PURE__ */ jsx15("p", { className: classes, ...props, children });
596
619
  };
597
620
 
598
621
  // src/primitives/section.tsx
@@ -611,7 +634,7 @@ function getMediaUrl(media) {
611
634
  }
612
635
 
613
636
  // src/primitives/section.tsx
614
- import { Fragment, jsx as jsx15, jsxs } from "react/jsx-runtime";
637
+ import { Fragment, jsx as jsx16, jsxs } from "react/jsx-runtime";
615
638
  function resolveBackgroundLayer(background) {
616
639
  const attachment = background.backgroundAttachment || "scroll";
617
640
  if (background.type === "color") {
@@ -666,7 +689,7 @@ var Section = ({
666
689
  );
667
690
  const backgroundLayer = background ? resolveBackgroundLayer(background) : null;
668
691
  const isFixed = background && background.type !== "color" && background.backgroundAttachment === "fixed";
669
- return /* @__PURE__ */ jsx15(Fragment, { children: React6.createElement(
692
+ return /* @__PURE__ */ jsx16(Fragment, { children: React6.createElement(
670
693
  component,
671
694
  {
672
695
  // `overflow-clip` keeps a fixed-attachment layer painted
@@ -676,7 +699,7 @@ var Section = ({
676
699
  ...props
677
700
  },
678
701
  /* @__PURE__ */ jsxs(Fragment, { children: [
679
- backgroundLayer && /* @__PURE__ */ jsx15(
702
+ backgroundLayer && /* @__PURE__ */ jsx16(
680
703
  "div",
681
704
  {
682
705
  "aria-hidden": true,
@@ -687,7 +710,7 @@ var Section = ({
687
710
  style: backgroundLayer.style
688
711
  }
689
712
  ),
690
- background && background.type === "image" && /* @__PURE__ */ jsx15(
713
+ background && background.type === "image" && /* @__PURE__ */ jsx16(
691
714
  "div",
692
715
  {
693
716
  "aria-hidden": true,
@@ -700,7 +723,7 @@ var Section = ({
700
723
  }
701
724
  }
702
725
  ),
703
- background && background.type === "image" && /* @__PURE__ */ jsx15(
726
+ background && background.type === "image" && /* @__PURE__ */ jsx16(
704
727
  "div",
705
728
  {
706
729
  "aria-hidden": true,
@@ -710,7 +733,7 @@ var Section = ({
710
733
  }
711
734
  }
712
735
  ),
713
- /* @__PURE__ */ jsx15(
736
+ /* @__PURE__ */ jsx16(
714
737
  "div",
715
738
  {
716
739
  className: cn(
@@ -727,7 +750,7 @@ var Section = ({
727
750
  };
728
751
 
729
752
  // src/primitives/subheader1.tsx
730
- import { jsx as jsx16 } from "react/jsx-runtime";
753
+ import { jsx as jsx17 } from "react/jsx-runtime";
731
754
  var Subheader1 = ({
732
755
  children,
733
756
  className = "",
@@ -747,11 +770,11 @@ var Subheader1 = ({
747
770
  typographyStyles?.textOverflow,
748
771
  className
749
772
  );
750
- return component === "h5" ? /* @__PURE__ */ jsx16("h5", { className: classes, ...props, children }) : /* @__PURE__ */ jsx16("span", { className: classes, ...props, children });
773
+ return component === "h5" ? /* @__PURE__ */ jsx17("h5", { className: classes, ...props, children }) : /* @__PURE__ */ jsx17("span", { className: classes, ...props, children });
751
774
  };
752
775
 
753
776
  // src/primitives/subheader2.tsx
754
- import { jsx as jsx17 } from "react/jsx-runtime";
777
+ import { jsx as jsx18 } from "react/jsx-runtime";
755
778
  var Subheader2 = ({
756
779
  children,
757
780
  className = "",
@@ -770,11 +793,11 @@ var Subheader2 = ({
770
793
  typographyStyles?.textOverflow,
771
794
  className
772
795
  ].filter(Boolean).join(" ");
773
- return /* @__PURE__ */ jsx17("h6", { className: classes, ...props, children });
796
+ return /* @__PURE__ */ jsx18("h6", { className: classes, ...props, children });
774
797
  };
775
798
 
776
799
  // src/primitives/text1.tsx
777
- import { jsx as jsx18 } from "react/jsx-runtime";
800
+ import { jsx as jsx19 } from "react/jsx-runtime";
778
801
  var Text1 = ({
779
802
  children,
780
803
  className = "",
@@ -797,11 +820,11 @@ var Text1 = ({
797
820
  typographyStyles?.textOverflow,
798
821
  className
799
822
  );
800
- return component === "p" ? /* @__PURE__ */ jsx18("p", { className: classes, ...props, children }) : /* @__PURE__ */ jsx18("span", { className: classes, ...props, children });
823
+ return component === "p" ? /* @__PURE__ */ jsx19("p", { className: classes, ...props, children }) : /* @__PURE__ */ jsx19("span", { className: classes, ...props, children });
801
824
  };
802
825
 
803
826
  // src/primitives/text2.tsx
804
- import { jsx as jsx19 } from "react/jsx-runtime";
827
+ import { jsx as jsx20 } from "react/jsx-runtime";
805
828
  var Text2 = ({
806
829
  children,
807
830
  className = "",
@@ -824,12 +847,12 @@ var Text2 = ({
824
847
  typographyStyles?.textOverflow,
825
848
  className
826
849
  );
827
- return component === "p" ? /* @__PURE__ */ jsx19("p", { className: classes, ...props, children }) : /* @__PURE__ */ jsx19("span", { className: classes, ...props, children });
850
+ return component === "p" ? /* @__PURE__ */ jsx20("p", { className: classes, ...props, children }) : /* @__PURE__ */ jsx20("span", { className: classes, ...props, children });
828
851
  };
829
852
 
830
853
  // src/primitives/textarea.tsx
831
854
  import React7 from "react";
832
- import { jsx as jsx20 } from "react/jsx-runtime";
855
+ import { jsx as jsx21 } from "react/jsx-runtime";
833
856
  var Textarea = React7.forwardRef(
834
857
  ({ className = "", theme, error = false, ...props }, ref) => {
835
858
  const inputStyles = theme?.interactives?.input;
@@ -853,7 +876,7 @@ var Textarea = React7.forwardRef(
853
876
  inputStyles?.custom,
854
877
  className
855
878
  );
856
- return /* @__PURE__ */ jsx20("textarea", { ref, className: classes, ...props });
879
+ return /* @__PURE__ */ jsx21("textarea", { ref, className: classes, ...props });
857
880
  }
858
881
  );
859
882
  Textarea.displayName = "Textarea";