dune-react 0.0.10 → 0.0.12

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 (120) hide show
  1. package/dist/components/puck-base/article-card.js +1 -1
  2. package/dist/components/puck-base/button.d.ts +0 -1
  3. package/dist/components/puck-base/button.js +3 -3
  4. package/dist/components/puck-base/card.js +0 -1
  5. package/dist/components/puck-base/content.js +0 -1
  6. package/dist/components/puck-base/core/fields.d.ts +26 -119
  7. package/dist/components/puck-base/core/fields.js +10 -17
  8. package/dist/components/puck-base/core/icon-catalog.d.ts +14 -0
  9. package/dist/components/puck-base/core/icon-catalog.js +193 -0
  10. package/dist/components/puck-base/core/styles.d.ts +102 -33
  11. package/dist/components/puck-base/core/styles.js +45 -81
  12. package/dist/components/puck-base/core/with-editable.d.ts +4 -9
  13. package/dist/components/puck-base/core/with-editable.js +43 -62
  14. package/dist/components/puck-base/fields/action-field.d.ts +30 -0
  15. package/dist/components/puck-base/fields/action-field.js +289 -0
  16. package/dist/components/puck-base/fields/auto-field.d.ts +0 -1
  17. package/dist/components/puck-base/fields/auto-field.js +2 -90
  18. package/dist/components/puck-base/form.js +0 -1
  19. package/dist/components/puck-base/gradient-text.js +1 -1
  20. package/dist/components/puck-base/icon-picker-field.d.ts +8 -0
  21. package/dist/components/puck-base/icon-picker-field.js +153 -0
  22. package/dist/components/puck-base/index.d.ts +1 -1
  23. package/dist/components/puck-base/navigation-menu.d.ts +18 -0
  24. package/dist/components/puck-base/navigation-menu.js +202 -0
  25. package/dist/components/puck-block/banner-sections/announcement-banner-1/index.js +1 -1
  26. package/dist/components/puck-block/banner-sections/marquee-1/index.js +6 -4
  27. package/dist/components/puck-block/contact-sections/contact-us-1/index.js +18 -8
  28. package/dist/components/puck-block/contact-sections/contact-us-2/contact-us-2.js +1 -1
  29. package/dist/components/puck-block/contact-sections/contact-us-2/index.js +7 -7
  30. package/dist/components/puck-block/contact-sections/contact-us-3/index.js +2 -2
  31. package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.d.ts +2 -1
  32. package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.js +6 -5
  33. package/dist/components/puck-block/cta-sections/banner-cta-1/index.js +4 -4
  34. package/dist/components/puck-block/cta-sections/cta-1/index.js +9 -9
  35. package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.js +34 -12
  36. package/dist/components/puck-block/cta-sections/gradient-cta-1/index.js +3 -3
  37. package/dist/components/puck-block/cta-sections/newsletter-signup-1/index.js +1 -1
  38. package/dist/components/puck-block/cta-sections/promo-section-1/index.js +5 -6
  39. package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.js +2 -2
  40. package/dist/components/puck-block/faq-sections/accordion-1/accordion.js +8 -3
  41. package/dist/components/puck-block/faq-sections/accordion-1/index.js +7 -3
  42. package/dist/components/puck-block/faq-sections/faq-1/index.js +16 -4
  43. package/dist/components/puck-block/faq-sections/faq-2/index.js +11 -11
  44. package/dist/components/puck-block/feature-sections/bento-1/bento.js +16 -7
  45. package/dist/components/puck-block/feature-sections/bento-1/index.js +19 -6
  46. package/dist/components/puck-block/feature-sections/feature-cards-1/index.js +11 -12
  47. package/dist/components/puck-block/feature-sections/feature-showcase-1/index.js +10 -10
  48. package/dist/components/puck-block/feature-sections/icon-grid-1/icon-grid.js +1 -1
  49. package/dist/components/puck-block/feature-sections/icon-grid-1/index.js +13 -18
  50. package/dist/components/puck-block/feature-sections/product-features-1/index.js +18 -23
  51. package/dist/components/puck-block/footer-sections/footer-1/index.js +17 -22
  52. package/dist/components/puck-block/gallery-sections/gallery-1/index.js +12 -8
  53. package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.js +14 -6
  54. package/dist/components/puck-block/gallery-sections/gallery-2/index.js +10 -9
  55. package/dist/components/puck-block/gallery-sections/gallery-3/index.js +17 -14
  56. package/dist/components/puck-block/header-sections/header-1/header.d.ts +4 -1
  57. package/dist/components/puck-block/header-sections/header-1/header.js +26 -19
  58. package/dist/components/puck-block/header-sections/header-1/index.js +61 -50
  59. package/dist/components/puck-block/header-sections/sticky-nav-1/index.js +4 -3
  60. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +15 -2
  61. package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +4 -4
  62. package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.js +2 -2
  63. package/dist/components/puck-block/hero-sections/gradient-hero-1/index.js +5 -4
  64. package/dist/components/puck-block/hero-sections/grid-hero-1/grid-hero.js +1 -1
  65. package/dist/components/puck-block/hero-sections/grid-hero-1/index.js +8 -8
  66. package/dist/components/puck-block/hero-sections/hero-1/hero.js +1 -1
  67. package/dist/components/puck-block/hero-sections/hero-1/index.js +16 -12
  68. package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +0 -1
  69. package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +1 -1
  70. package/dist/components/puck-block/hero-sections/image-hero-1/index.js +23 -6
  71. package/dist/components/puck-block/hero-sections/split-hero-1/index.js +7 -7
  72. package/dist/components/puck-block/hero-sections/video-hero-1/index.js +5 -5
  73. package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.js +1 -1
  74. package/dist/components/puck-block/location-sections/location-1/index.js +4 -7
  75. package/dist/components/puck-block/location-sections/location-1/location.d.ts +1 -0
  76. package/dist/components/puck-block/location-sections/location-1/location.js +2 -3
  77. package/dist/components/puck-block/location-sections/location-2/index.js +4 -7
  78. package/dist/components/puck-block/location-sections/location-2/location.d.ts +1 -0
  79. package/dist/components/puck-block/location-sections/location-2/location.js +2 -3
  80. package/dist/components/puck-block/location-sections/location-3/index.js +15 -14
  81. package/dist/components/puck-block/location-sections/location-3/location.d.ts +3 -0
  82. package/dist/components/puck-block/location-sections/location-3/location.js +7 -4
  83. package/dist/components/puck-block/metrics-sections/stats-1/index.js +13 -13
  84. package/dist/components/puck-block/metrics-sections/stats-2/index.js +8 -10
  85. package/dist/components/puck-block/metrics-sections/stats-2/stats-2.js +0 -1
  86. package/dist/components/puck-block/metrics-sections/stats-3/index.js +13 -15
  87. package/dist/components/puck-block/metrics-sections/stats-3/stats-3.js +14 -1
  88. package/dist/components/puck-block/pricing-sections/comparison-1/index.js +2 -2
  89. package/dist/components/puck-block/pricing-sections/pricing-1/index.js +39 -21
  90. package/dist/components/puck-block/pricing-sections/pricing-2/index.js +30 -34
  91. package/dist/components/puck-block/showcase-sections/before-after-1/index.js +12 -13
  92. package/dist/components/puck-block/showcase-sections/case-study-1/case-study.js +1 -1
  93. package/dist/components/puck-block/showcase-sections/case-study-1/index.js +8 -8
  94. package/dist/components/puck-block/showcase-sections/step-by-step-1/index.js +8 -8
  95. package/dist/components/puck-block/team-sections/team-grid-1/index.js +9 -9
  96. package/dist/components/puck-block/team-sections/team-grid-2/index.js +12 -14
  97. package/dist/components/puck-block/team-sections/team-profiles-1/index.js +11 -9
  98. package/dist/components/puck-block/testimonial-sections/customers-1/index.js +18 -7
  99. package/dist/components/puck-block/testimonial-sections/logo-marquee-1/index.js +2 -2
  100. package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.js +1 -1
  101. package/dist/components/puck-block/testimonial-sections/logo-wall-1/index.js +7 -7
  102. package/dist/components/puck-block/testimonial-sections/review-section-1/index.js +27 -12
  103. package/dist/components/puck-block/testimonial-sections/testimonials-1/index.js +17 -7
  104. package/dist/components/puck-block/testimonial-sections/testimonials-1/testimonials.js +30 -10
  105. package/dist/components/puck-block/text-sections/articles-1/articles.js +1 -1
  106. package/dist/components/puck-block/text-sections/articles-1/index.js +12 -8
  107. package/dist/components/puck-block/text-sections/content-section-1/content-section.js +0 -1
  108. package/dist/components/puck-block/text-sections/content-section-1/index.js +6 -8
  109. package/dist/components/puck-block/text-sections/rich-text-1/index.js +1 -1
  110. package/dist/components/puck-block/text-sections/rich-text-1/rich-text.js +6 -1
  111. package/dist/components/puck-block/text-sections/tab-section-1/index.js +12 -12
  112. package/dist/components/puck-block/text-sections/tab-section-1/tab-section.js +7 -3
  113. package/dist/components/puck-block/text-sections/timeline-1/index.js +17 -7
  114. package/dist/components/puck-block/text-sections/two-column-1/index.js +10 -10
  115. package/dist/components/shadcn/navigation-menu.js +8 -33
  116. package/dist/index.js +9 -1
  117. package/dist/node_modules/.pnpm/lucide-react@0.540.0_react@19.2.4/node_modules/lucide-react/dist/esm/DynamicIcon.js +1 -3
  118. package/package.json +3 -2
  119. package/dist/components/puck-base/action-field.d.ts +0 -8
  120. package/dist/components/puck-base/action-field.js +0 -170
@@ -22,7 +22,7 @@ const conf = {
22
22
  })
23
23
  },
24
24
  defaultProps: {
25
- content: "<h2>About Us</h2><p>We are a team of passionate builders creating tools that empower everyone to build beautiful websites.</p><p>Our mission is to make web design accessible to everyone.</p>",
25
+ content: "<h2>About Our Mission</h2><p>We started with a simple belief: developers deserve better tools. Our platform is built by engineers, for engineers — eliminating the grunt work so you can focus on what you do best.</p><p>Every feature we ship is guided by one question: does this make our users faster? If it doesn't, it doesn't ship.</p>",
26
26
  styles: createStylesDefaults({ maxWidth: "md" })
27
27
  },
28
28
  render: RichText
@@ -1,4 +1,5 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
+ import { useMemo } from "react";
2
3
  import { CompoundContainer } from "../../../puck-base/container.js";
3
4
  const MAX_WIDTH_MAP = {
4
5
  sm: "max-w-xl",
@@ -6,16 +7,20 @@ const MAX_WIDTH_MAP = {
6
7
  lg: "max-w-4xl",
7
8
  full: "max-w-none"
8
9
  };
10
+ function sanitizeHtml(html) {
11
+ return html.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, "").replace(/<iframe\b[^>]*>/gi, "").replace(/\bon\w+\s*=/gi, "data-removed=");
12
+ }
9
13
  const RichText = ({
10
14
  content = "",
11
15
  styles
12
16
  }) => {
13
17
  const maxWidth = (styles == null ? void 0 : styles.maxWidth) ?? "md";
18
+ const safeContent = useMemo(() => sanitizeHtml(content), [content]);
14
19
  return /* @__PURE__ */ jsx(CompoundContainer, { padding: styles == null ? void 0 : styles.padding, sectionStyle: styles == null ? void 0 : styles.sectionStyle, backgroundColor: styles == null ? void 0 : styles.backgroundColor, children: /* @__PURE__ */ jsx(
15
20
  "div",
16
21
  {
17
22
  className: `${MAX_WIDTH_MAP[maxWidth]} prose prose-neutral dark:prose-invert mx-auto`,
18
- dangerouslySetInnerHTML: { __html: content }
23
+ dangerouslySetInnerHTML: { __html: safeContent }
19
24
  }
20
25
  ) });
21
26
  };
@@ -1,4 +1,4 @@
1
- import { image16x9Placeholder, image } from "../../../puck-base/core/fields.js";
1
+ import { image } from "../../../puck-base/core/fields.js";
2
2
  import { TabSection } from "./tab-section.js";
3
3
  import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
4
4
  const conf = {
@@ -17,29 +17,29 @@ const conf = {
17
17
  defaultItemProps: {
18
18
  label: "Tab",
19
19
  content: "Content for this tab.",
20
- image: image16x9Placeholder
20
+ image: { src: "https://images.pexels.com/photos/3888151/pexels-photo-3888151.jpeg?auto=compress&cs=tinysrgb&w=1200", alt: "Developer workspace with laptop showing code" }
21
21
  }
22
22
  },
23
23
  styles: createStylesField()
24
24
  },
25
25
  defaultProps: {
26
26
  heading: "How it works",
27
- description: "A simple three-step process to get started.",
27
+ description: "Get up and running in three simple steps.",
28
28
  tabs: [
29
29
  {
30
- label: "Step 1",
31
- content: "Sign up and create your account in seconds.",
32
- image: image16x9Placeholder
30
+ label: "Connect",
31
+ content: "Link your repository and configure your project in under a minute.",
32
+ image: { src: "https://images.pexels.com/photos/4218883/pexels-photo-4218883.jpeg?auto=compress&cs=tinysrgb&w=1200", alt: "Computer displaying code editor with project repository connected" }
33
33
  },
34
34
  {
35
- label: "Step 2",
36
- content: "Configure your workspace and invite your team.",
37
- image: image16x9Placeholder
35
+ label: "Build",
36
+ content: "Push your code and let our platform handle testing, building, and optimization.",
37
+ image: { src: "https://images.pexels.com/photos/574071/pexels-photo-574071.jpeg?auto=compress&cs=tinysrgb&w=1200", alt: "Monitor showing colorful code during build process" }
38
38
  },
39
39
  {
40
- label: "Step 3",
41
- content: "Start building and shipping faster than ever.",
42
- image: image16x9Placeholder
40
+ label: "Deploy",
41
+ content: "Go live instantly with automatic SSL, CDN, and monitoring.",
42
+ image: { src: "https://images.pexels.com/photos/270404/pexels-photo-270404.jpeg?auto=compress&cs=tinysrgb&w=1200", alt: "Source code and deployment terminal on computer screen" }
43
43
  }
44
44
  ],
45
45
  styles: createStylesDefaults()
@@ -21,12 +21,16 @@ const TabSection = ({
21
21
  /* @__PURE__ */ jsx("div", { className: "border-border mb-8 flex gap-1 border-b", children: tabs.map((tab, i) => /* @__PURE__ */ jsx(
22
22
  "button",
23
23
  {
24
- onClick: () => setActive(i),
24
+ onClick: (e) => {
25
+ e.stopPropagation();
26
+ setActive(i);
27
+ },
28
+ style: { pointerEvents: "auto" },
25
29
  className: cn(
26
- "-mb-px border-b-2 px-4 py-2 text-sm font-medium transition-colors",
30
+ "-mb-px border-b-2 px-4 py-2 text-sm font-medium transition-colors cursor-pointer",
27
31
  active === i ? "border-primary text-foreground" : "text-muted-foreground hover:text-foreground border-transparent"
28
32
  ),
29
- children: tab.label
33
+ children: /* @__PURE__ */ jsx("span", { style: { pointerEvents: "none" }, children: tab.label })
30
34
  },
31
35
  i
32
36
  )) }),
@@ -27,18 +27,28 @@ const conf = {
27
27
  items: [
28
28
  {
29
29
  title: "Founded",
30
- description: "Started with a bold vision.",
31
- date: "2020"
30
+ description: "Started with a vision to simplify developer workflows.",
31
+ date: "2021"
32
32
  },
33
33
  {
34
- title: "First 1000 Users",
35
- description: "Reached product-market fit.",
36
- date: "2021"
34
+ title: "Public Beta",
35
+ description: "Opened the platform to early adopters and gathered feedback.",
36
+ date: "2022"
37
37
  },
38
38
  {
39
- title: "Series A",
40
- description: "Raised funding to scale.",
39
+ title: "10,000 Teams",
40
+ description: "Crossed 10,000 teams building on the platform.",
41
41
  date: "2023"
42
+ },
43
+ {
44
+ title: "Series A",
45
+ description: "Raised funding to accelerate product development.",
46
+ date: "2024"
47
+ },
48
+ {
49
+ title: "Enterprise Launch",
50
+ description: "Launched enterprise tier with SSO, audit logs, and dedicated support.",
51
+ date: "2025"
42
52
  }
43
53
  ],
44
54
  styles: createStylesDefaults()
@@ -1,4 +1,4 @@
1
- import { images, contentFieldsWithFeatures, getPlaceholderImageUrl } from "../../../puck-base/core/fields.js";
1
+ import { images, contentFieldsWithFeatures } from "../../../puck-base/core/fields.js";
2
2
  import { TwoColumn } from "./two-column.js";
3
3
  import { createStylesDefaults, createStylesField } from "../../../puck-base/core/styles.js";
4
4
  const conf = {
@@ -51,10 +51,10 @@ const conf = {
51
51
  styles: createStylesField()
52
52
  },
53
53
  defaultProps: {
54
- heading: "This is the start of something new",
55
- description: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
54
+ heading: "Why leading teams trust us",
55
+ description: "We handle the infrastructure so you can focus on your product. From startups to enterprises, teams rely on our platform to ship with confidence.",
56
56
  badge: {
57
- label: "Platform",
57
+ label: "About Us",
58
58
  url: "",
59
59
  variant: "default"
60
60
  },
@@ -63,18 +63,18 @@ const conf = {
63
63
  border: "false",
64
64
  images: [
65
65
  {
66
- alt: "1: 16/9 aspect ratio accessible description of the image",
67
- src: getPlaceholderImageUrl("1920x1080", "Feature 1"),
66
+ alt: "Developer working at desk with dual monitors displaying code",
67
+ src: "https://images.pexels.com/photos/3861969/pexels-photo-3861969.jpeg?auto=compress&cs=tinysrgb&w=1200",
68
68
  aspectRatio: "16x9"
69
69
  },
70
70
  {
71
- alt: "2: 16/9 aspect ratio accessible description of the image",
72
- src: getPlaceholderImageUrl("1920x1080", "Feature 2"),
71
+ alt: "Two developers collaborating on code at a shared workspace",
72
+ src: "https://images.pexels.com/photos/1181677/pexels-photo-1181677.jpeg?auto=compress&cs=tinysrgb&w=1200",
73
73
  aspectRatio: "16x9"
74
74
  },
75
75
  {
76
- alt: "3: 16/9 aspect ratio accessible description of the image",
77
- src: getPlaceholderImageUrl("1920x1080", "Feature 3"),
76
+ alt: "Tech team working together at a modern office",
77
+ src: "https://images.pexels.com/photos/3183150/pexels-photo-3183150.jpeg?auto=compress&cs=tinysrgb&w=1200",
78
78
  aspectRatio: "16x9"
79
79
  }
80
80
  ],
@@ -1,10 +1,8 @@
1
1
  import { jsxs, jsx } from "react/jsx-runtime";
2
- import { useState, useCallback } from "react";
3
2
  import { NavigationMenu as NavigationMenu$1 } from "@base-ui/react/navigation-menu";
4
3
  import { cva } from "class-variance-authority";
5
4
  import { cn } from "../../utils/css-utils.js";
6
5
  import { ChevronDownIcon } from "lucide-react";
7
- import { useEditorContext } from "../puck-base/editor-context.js";
8
6
  function NavigationMenu({
9
7
  align = "start",
10
8
  className,
@@ -12,34 +10,6 @@ function NavigationMenu({
12
10
  onValueChange,
13
11
  ...props
14
12
  }) {
15
- const { isEditor } = useEditorContext();
16
- const [value, setValue] = useState(props.defaultValue ?? null);
17
- const handleValueChange = useCallback(
18
- (newValue, details) => {
19
- if (newValue === null && details.reason === "focus-out") return;
20
- setValue(newValue);
21
- onValueChange == null ? void 0 : onValueChange(newValue, details);
22
- },
23
- [onValueChange]
24
- );
25
- if (!isEditor) {
26
- return /* @__PURE__ */ jsxs(
27
- NavigationMenu$1.Root,
28
- {
29
- "data-slot": "navigation-menu",
30
- className: cn(
31
- "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
32
- className
33
- ),
34
- onValueChange,
35
- ...props,
36
- children: [
37
- children,
38
- /* @__PURE__ */ jsx(NavigationMenuPositioner, { align })
39
- ]
40
- }
41
- );
42
- }
43
13
  return /* @__PURE__ */ jsxs(
44
14
  NavigationMenu$1.Root,
45
15
  {
@@ -48,8 +18,7 @@ function NavigationMenu({
48
18
  "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
49
19
  className
50
20
  ),
51
- value,
52
- onValueChange: handleValueChange,
21
+ onValueChange,
53
22
  ...props,
54
23
  children: [
55
24
  children,
@@ -104,7 +73,13 @@ function NavigationMenuTrigger({
104
73
  children: [
105
74
  children,
106
75
  " ",
107
- /* @__PURE__ */ jsx(ChevronDownIcon, { className: "relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180", "aria-hidden": "true" })
76
+ /* @__PURE__ */ jsx(
77
+ ChevronDownIcon,
78
+ {
79
+ className: "relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180",
80
+ "aria-hidden": "true"
81
+ }
82
+ )
108
83
  ]
109
84
  }
110
85
  );
package/dist/index.js CHANGED
@@ -2,9 +2,9 @@ import { default as default2 } from "./components/ui-block/background/index.js";
2
2
  import { default as default3 } from "./components/puck-block/header-sections/header-1/index.js";
3
3
  import { default as default4 } from "./components/shadcn/badge-promo.js";
4
4
  import { default as default5 } from "./components/puck-base/use-upload.js";
5
+ import { ACTION_TYPE_FIELD_MAP, ACTION_TYPE_OPTIONS, ActionField, DownloadActionFields, EmailActionFields, ExternalActionFields, PageActionFields, PhoneActionFields, SectionActionFields } from "./components/puck-base/fields/action-field.js";
5
6
  import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/shadcn/accordion.js";
6
7
  import { conf } from "./components/puck-block/faq-sections/accordion-1/index.js";
7
- import { ActionField } from "./components/puck-base/action-field.js";
8
8
  import { Alert, AlertAction, AlertDescription, AlertTitle } from "./components/shadcn/alert.js";
9
9
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger } from "./components/shadcn/alert-dialog.js";
10
10
  import { AnimatedThemeToggler } from "./components/shadcn/animated-theme-toggler.js";
@@ -152,6 +152,8 @@ import { resolveActionUrl } from "./components/puck-base/core/types.js";
152
152
  import { usePuckAppState, usePuckConfig, usePuckDispatch, usePuckGetSelectorForId, usePuckHistory } from "./components/puck-base/core/hooks.js";
153
153
  import { withEditable } from "./components/puck-base/core/with-editable.js";
154
154
  export {
155
+ ACTION_TYPE_FIELD_MAP,
156
+ ACTION_TYPE_OPTIONS,
155
157
  Accordion,
156
158
  conf as AccordionConf,
157
159
  AccordionContent,
@@ -293,6 +295,7 @@ export {
293
295
  DialogTitle,
294
296
  DialogTrigger,
295
297
  DirectionProvider,
298
+ DownloadActionFields,
296
299
  Drawer,
297
300
  DrawerClose,
298
301
  DrawerContent,
@@ -319,6 +322,7 @@ export {
319
322
  DropdownMenuSubTrigger,
320
323
  DropdownMenuTrigger,
321
324
  EditorContextProvider,
325
+ EmailActionFields,
322
326
  Empty,
323
327
  EmptyContent,
324
328
  EmptyDescription,
@@ -326,6 +330,7 @@ export {
326
330
  EmptyMedia,
327
331
  EmptyTitle,
328
332
  ErrorBoundary,
333
+ ExternalActionFields,
329
334
  conf15 as Faq2Conf,
330
335
  conf16 as FaqConf,
331
336
  conf17 as FeatureCardsConf,
@@ -433,6 +438,7 @@ export {
433
438
  NavigationMenuPositioner,
434
439
  NavigationMenuTrigger,
435
440
  conf36 as NewsletterSignupConf,
441
+ PageActionFields,
436
442
  Pagination,
437
443
  PaginationContent,
438
444
  PaginationEllipsis,
@@ -440,6 +446,7 @@ export {
440
446
  PaginationLink,
441
447
  PaginationNext,
442
448
  PaginationPrevious,
449
+ PhoneActionFields,
443
450
  Popover,
444
451
  PopoverContent,
445
452
  PopoverDescription,
@@ -464,6 +471,7 @@ export {
464
471
  conf42 as RichTextConf,
465
472
  ScrollArea,
466
473
  ScrollBar,
474
+ SectionActionFields,
467
475
  Select,
468
476
  SelectContent,
469
477
  SelectGroup,
@@ -3,7 +3,6 @@
3
3
  import { forwardRef, useState, useEffect, createElement } from "react";
4
4
  import dynamicIconImports from "./dynamicIconImports.js";
5
5
  import Icon from "./Icon.js";
6
- const iconNames = Object.keys(dynamicIconImports);
7
6
  async function getIconNode(name) {
8
7
  if (!(name in dynamicIconImports)) {
9
8
  throw new Error("[lucide-react]: Name in Lucide DynamicIcon not found");
@@ -33,6 +32,5 @@ const DynamicIcon = forwardRef(
33
32
  }
34
33
  );
35
34
  export {
36
- DynamicIcon as default,
37
- iconNames
35
+ DynamicIcon as default
38
36
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dune-react",
3
- "version": "0.0.10",
3
+ "version": "0.0.12",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -8,7 +8,7 @@
8
8
  "gen:meta": "node --import ./scripts/register-mocks.mjs --import tsx/esm scripts/generate-component-meta.ts",
9
9
  "build": "pnpm gen:meta && vite build && tsc --project tsconfig.build.json",
10
10
  "watch": "vite build --watch & tsc --project tsconfig.build.json --watch --preserveWatchOutput &",
11
- "build:sync": "pnpm build && cd /Volumes/code/magent && pnpm sync:dune",
11
+ "build:sync": "pnpm build && cd ../magent && pnpm sync:dune && cd ../canvas-editor && pnpm sync:dune",
12
12
  "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
13
13
  "preview": "vite preview",
14
14
  "storybook": "storybook dev -p 8080",
@@ -69,6 +69,7 @@
69
69
  "eslint-plugin-react-refresh": "^0.4.3",
70
70
  "eslint-plugin-storybook": "^10.2.19",
71
71
  "motion": "12.23.12",
72
+ "playwright": "1.58.2",
72
73
  "react-easy-crop": "5.5.6",
73
74
  "rollup-plugin-preserve-directives": "0.4.0",
74
75
  "sass": "^1.90.0",
@@ -1,8 +0,0 @@
1
- import { Action } from "./core/types";
2
- interface ActionFieldProps {
3
- name: string;
4
- value: Action | undefined;
5
- onChange: (value: Action) => void;
6
- }
7
- export declare function ActionField({ name, value, onChange }: ActionFieldProps): import("react/jsx-runtime").JSX.Element;
8
- export {};
@@ -1,170 +0,0 @@
1
- "use client";
2
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
3
- import { Input } from "../shadcn/input.js";
4
- import { Label } from "../shadcn/label.js";
5
- import { Tabs, TabsList, TabsTrigger } from "../shadcn/tabs.js";
6
- const ACTION_TYPE_OPTIONS = [
7
- { label: "Page Link", value: "page" },
8
- { label: "External Link", value: "external" },
9
- { label: "Email", value: "email" },
10
- { label: "Phone", value: "phone" },
11
- { label: "Page Section", value: "section" },
12
- { label: "Download", value: "download" },
13
- { label: "None", value: "none" }
14
- ];
15
- function ActionField({ name, value, onChange }) {
16
- const current = value ?? { type: "none" };
17
- const update = (patch) => {
18
- onChange({ ...current, ...patch });
19
- };
20
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
21
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
22
- /* @__PURE__ */ jsx(Label, { children: "Action Type" }),
23
- /* @__PURE__ */ jsx(
24
- Tabs,
25
- {
26
- value: current.type,
27
- onValueChange: (val) => update({ type: val }),
28
- children: /* @__PURE__ */ jsx(TabsList, { className: "h-auto w-full flex-wrap justify-start gap-1 p-1 group-data-[orientation=horizontal]/tabs:h-auto", children: ACTION_TYPE_OPTIONS.map((opt) => /* @__PURE__ */ jsx(
29
- TabsTrigger,
30
- {
31
- value: opt.value,
32
- className: "h-7 flex-none text-xs",
33
- children: opt.label
34
- },
35
- opt.value
36
- )) })
37
- }
38
- )
39
- ] }),
40
- current.type === "page" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
41
- /* @__PURE__ */ jsx(Label, { children: "Page URL" }),
42
- /* @__PURE__ */ jsx(
43
- Input,
44
- {
45
- name: `${name}.pageUrl`,
46
- className: "h-8 text-sm",
47
- value: current.pageUrl ?? "",
48
- onChange: (e) => update({ pageUrl: e.target.value }),
49
- placeholder: "/about"
50
- }
51
- )
52
- ] }),
53
- current.type === "external" && /* @__PURE__ */ jsxs(Fragment, { children: [
54
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
55
- /* @__PURE__ */ jsx(Label, { children: "External URL" }),
56
- /* @__PURE__ */ jsx(
57
- Input,
58
- {
59
- name: `${name}.externalUrl`,
60
- className: "h-8 text-sm",
61
- value: current.externalUrl ?? "",
62
- onChange: (e) => update({ externalUrl: e.target.value }),
63
- placeholder: "https://example.com"
64
- }
65
- )
66
- ] }),
67
- /* @__PURE__ */ jsxs("fieldset", { className: "flex flex-col gap-1.5", children: [
68
- /* @__PURE__ */ jsx(Label, { children: "Open in new tab" }),
69
- /* @__PURE__ */ jsxs("div", { className: "flex gap-3", children: [
70
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1.5 text-sm", children: [
71
- /* @__PURE__ */ jsx(
72
- "input",
73
- {
74
- type: "radio",
75
- name: `${name}.openInNewTab`,
76
- value: "true",
77
- checked: current.openInNewTab === "true",
78
- onChange: () => update({ openInNewTab: "true" })
79
- }
80
- ),
81
- "Yes"
82
- ] }),
83
- /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-1.5 text-sm", children: [
84
- /* @__PURE__ */ jsx(
85
- "input",
86
- {
87
- type: "radio",
88
- name: `${name}.openInNewTab`,
89
- value: "false",
90
- checked: current.openInNewTab !== "true",
91
- onChange: () => update({ openInNewTab: "false" })
92
- }
93
- ),
94
- "No"
95
- ] })
96
- ] })
97
- ] })
98
- ] }),
99
- current.type === "email" && /* @__PURE__ */ jsxs(Fragment, { children: [
100
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
101
- /* @__PURE__ */ jsx(Label, { children: "Email" }),
102
- /* @__PURE__ */ jsx(
103
- Input,
104
- {
105
- name: `${name}.email`,
106
- className: "h-8 text-sm",
107
- value: current.email ?? "",
108
- onChange: (e) => update({ email: e.target.value }),
109
- placeholder: "hello@example.com"
110
- }
111
- )
112
- ] }),
113
- /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
114
- /* @__PURE__ */ jsx(Label, { children: "Subject" }),
115
- /* @__PURE__ */ jsx(
116
- Input,
117
- {
118
- name: `${name}.subject`,
119
- className: "h-8 text-sm",
120
- value: current.subject ?? "",
121
- onChange: (e) => update({ subject: e.target.value }),
122
- placeholder: "Optional email subject"
123
- }
124
- )
125
- ] })
126
- ] }),
127
- current.type === "phone" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
128
- /* @__PURE__ */ jsx(Label, { children: "Phone" }),
129
- /* @__PURE__ */ jsx(
130
- Input,
131
- {
132
- name: `${name}.phone`,
133
- className: "h-8 text-sm",
134
- value: current.phone ?? "",
135
- onChange: (e) => update({ phone: e.target.value }),
136
- placeholder: "+1 234 567 890"
137
- }
138
- )
139
- ] }),
140
- current.type === "section" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
141
- /* @__PURE__ */ jsx(Label, { children: "Section ID" }),
142
- /* @__PURE__ */ jsx(
143
- Input,
144
- {
145
- name: `${name}.sectionId`,
146
- className: "h-8 text-sm",
147
- value: current.sectionId ?? "",
148
- onChange: (e) => update({ sectionId: e.target.value }),
149
- placeholder: "#section-id"
150
- }
151
- )
152
- ] }),
153
- current.type === "download" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
154
- /* @__PURE__ */ jsx(Label, { children: "Download URL" }),
155
- /* @__PURE__ */ jsx(
156
- Input,
157
- {
158
- name: `${name}.downloadUrl`,
159
- className: "h-8 text-sm",
160
- value: current.downloadUrl ?? "",
161
- onChange: (e) => update({ downloadUrl: e.target.value }),
162
- placeholder: "https://example.com/file.pdf"
163
- }
164
- )
165
- ] })
166
- ] });
167
- }
168
- export {
169
- ActionField
170
- };