dune-react 0.0.10 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/puck-base/article-card.js +1 -1
- package/dist/components/puck-base/button.d.ts +0 -1
- package/dist/components/puck-base/button.js +3 -3
- package/dist/components/puck-base/card.js +0 -1
- package/dist/components/puck-base/content.js +0 -1
- package/dist/components/puck-base/core/fields.d.ts +1 -23
- package/dist/components/puck-base/core/fields.js +6 -7
- package/dist/components/puck-base/core/styles.d.ts +102 -33
- package/dist/components/puck-base/core/styles.js +45 -81
- package/dist/components/puck-base/core/with-editable.d.ts +4 -9
- package/dist/components/puck-base/core/with-editable.js +43 -62
- package/dist/components/puck-base/{action-field.d.ts → fields/action-field.d.ts} +1 -1
- package/dist/components/puck-base/{action-field.js → fields/action-field.js} +91 -16
- package/dist/components/puck-base/fields/auto-field.d.ts +0 -1
- package/dist/components/puck-base/fields/auto-field.js +2 -90
- package/dist/components/puck-base/form.js +0 -1
- package/dist/components/puck-base/index.d.ts +1 -1
- package/dist/components/puck-base/navigation-menu.d.ts +18 -0
- package/dist/components/puck-base/navigation-menu.js +202 -0
- package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.d.ts +2 -1
- package/dist/components/puck-block/cta-sections/banner-cta-1/banner-cta.js +6 -5
- package/dist/components/puck-block/cta-sections/banner-cta-1/index.js +2 -2
- package/dist/components/puck-block/cta-sections/gradient-cta-1/gradient-cta.js +34 -12
- package/dist/components/puck-block/cta-sections/promo-section-1/index.js +1 -2
- package/dist/components/puck-block/cta-sections/promo-section-1/promo-section.js +2 -2
- package/dist/components/puck-block/faq-sections/accordion-1/accordion.js +8 -3
- package/dist/components/puck-block/feature-sections/feature-cards-1/index.js +0 -2
- package/dist/components/puck-block/feature-sections/icon-grid-1/icon-grid.js +1 -1
- package/dist/components/puck-block/gallery-sections/gallery-1/index.js +1 -1
- package/dist/components/puck-block/gallery-sections/gallery-2/gallery-2.js +14 -6
- package/dist/components/puck-block/gallery-sections/gallery-2/index.js +1 -1
- package/dist/components/puck-block/header-sections/header-1/header.d.ts +4 -1
- package/dist/components/puck-block/header-sections/header-1/header.js +26 -19
- package/dist/components/puck-block/header-sections/header-1/index.js +13 -18
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/fullscreen-hero.js +15 -2
- package/dist/components/puck-block/hero-sections/fullscreen-hero-1/index.js +0 -1
- package/dist/components/puck-block/hero-sections/gradient-hero-1/gradient-hero.js +2 -2
- package/dist/components/puck-block/hero-sections/gradient-hero-1/index.js +1 -0
- package/dist/components/puck-block/hero-sections/grid-hero-1/grid-hero.js +1 -1
- package/dist/components/puck-block/hero-sections/hero-1/hero.js +1 -1
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.d.ts +0 -1
- package/dist/components/puck-block/hero-sections/image-hero-1/image-hero.js +1 -1
- package/dist/components/puck-block/hero-sections/image-hero-1/index.js +21 -4
- package/dist/components/puck-block/hero-sections/video-hero-1/video-hero.js +1 -1
- package/dist/components/puck-block/location-sections/location-1/index.js +0 -3
- package/dist/components/puck-block/location-sections/location-1/location.d.ts +1 -0
- package/dist/components/puck-block/location-sections/location-1/location.js +1 -2
- package/dist/components/puck-block/location-sections/location-2/index.js +0 -3
- package/dist/components/puck-block/location-sections/location-2/location.d.ts +1 -0
- package/dist/components/puck-block/location-sections/location-2/location.js +1 -2
- package/dist/components/puck-block/location-sections/location-3/location.d.ts +2 -0
- package/dist/components/puck-block/location-sections/location-3/location.js +5 -2
- package/dist/components/puck-block/metrics-sections/stats-2/index.js +0 -2
- package/dist/components/puck-block/metrics-sections/stats-2/stats-2.js +0 -1
- package/dist/components/puck-block/metrics-sections/stats-3/index.js +0 -2
- package/dist/components/puck-block/metrics-sections/stats-3/stats-3.js +14 -1
- package/dist/components/puck-block/pricing-sections/pricing-1/index.js +0 -2
- package/dist/components/puck-block/pricing-sections/pricing-2/index.js +0 -4
- package/dist/components/puck-block/showcase-sections/before-after-1/index.js +0 -1
- package/dist/components/puck-block/showcase-sections/case-study-1/case-study.js +1 -1
- package/dist/components/puck-block/showcase-sections/case-study-1/index.js +1 -1
- package/dist/components/puck-block/team-sections/team-grid-1/index.js +1 -1
- package/dist/components/puck-block/team-sections/team-grid-2/index.js +0 -2
- package/dist/components/puck-block/testimonial-sections/logo-marquee-1/index.js +1 -1
- package/dist/components/puck-block/testimonial-sections/logo-marquee-1/logo-marquee.js +1 -1
- package/dist/components/puck-block/testimonial-sections/review-section-1/index.js +1 -1
- package/dist/components/puck-block/testimonial-sections/testimonials-1/testimonials.js +30 -10
- package/dist/components/puck-block/text-sections/articles-1/articles.js +1 -1
- package/dist/components/puck-block/text-sections/articles-1/index.js +1 -2
- package/dist/components/puck-block/text-sections/content-section-1/content-section.js +0 -1
- package/dist/components/puck-block/text-sections/content-section-1/index.js +0 -2
- package/dist/components/puck-block/text-sections/tab-section-1/tab-section.js +7 -3
- package/dist/components/shadcn/navigation-menu.js +8 -33
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -16,19 +16,31 @@ const Testimonials = ({
|
|
|
16
16
|
const [currentIndex, setCurrentIndex] = useState(0);
|
|
17
17
|
const prefersReducedMotion = usePrefersReducedMotion();
|
|
18
18
|
useEffect(() => {
|
|
19
|
-
if (!api || prefersReducedMotion) {
|
|
19
|
+
if (!api || prefersReducedMotion || (styles == null ? void 0 : styles.layout) === "quote") {
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
|
-
setTimeout(() => {
|
|
22
|
+
const timer = setTimeout(() => {
|
|
23
23
|
if (api.selectedScrollSnap() + 1 === api.scrollSnapList().length) {
|
|
24
24
|
setCurrentIndex(0);
|
|
25
25
|
api.scrollTo(0);
|
|
26
26
|
} else {
|
|
27
27
|
api.scrollNext();
|
|
28
|
-
setCurrentIndex(
|
|
28
|
+
setCurrentIndex((prev) => prev + 1);
|
|
29
29
|
}
|
|
30
30
|
}, 4e3);
|
|
31
|
-
|
|
31
|
+
return () => clearTimeout(timer);
|
|
32
|
+
}, [api, currentIndex, prefersReducedMotion, styles == null ? void 0 : styles.layout]);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
if ((styles == null ? void 0 : styles.layout) !== "quote" || prefersReducedMotion) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
const count = (testimonials ?? []).length;
|
|
38
|
+
if (count <= 1) return;
|
|
39
|
+
const timer = setTimeout(() => {
|
|
40
|
+
setCurrentIndex((prev) => (prev + 1) % count);
|
|
41
|
+
}, 5e3);
|
|
42
|
+
return () => clearTimeout(timer);
|
|
43
|
+
}, [currentIndex, prefersReducedMotion, styles == null ? void 0 : styles.layout, testimonials]);
|
|
32
44
|
const items = testimonials ?? [];
|
|
33
45
|
if ((styles == null ? void 0 : styles.layout) === "quote") {
|
|
34
46
|
const safeIndex = items.length > 0 ? currentIndex % items.length : 0;
|
|
@@ -59,17 +71,25 @@ const Testimonials = ({
|
|
|
59
71
|
/* @__PURE__ */ jsx(
|
|
60
72
|
"button",
|
|
61
73
|
{
|
|
62
|
-
onClick:
|
|
63
|
-
|
|
64
|
-
|
|
74
|
+
onClick: (e) => {
|
|
75
|
+
e.stopPropagation();
|
|
76
|
+
prev();
|
|
77
|
+
},
|
|
78
|
+
style: { pointerEvents: "auto" },
|
|
79
|
+
className: "relative z-10 rounded-full border border-current/30 p-2 hover:bg-white/10 transition-colors cursor-pointer",
|
|
80
|
+
children: /* @__PURE__ */ jsx(ChevronLeft, { className: "h-5 w-5", style: { pointerEvents: "none" } })
|
|
65
81
|
}
|
|
66
82
|
),
|
|
67
83
|
/* @__PURE__ */ jsx(
|
|
68
84
|
"button",
|
|
69
85
|
{
|
|
70
|
-
onClick:
|
|
71
|
-
|
|
72
|
-
|
|
86
|
+
onClick: (e) => {
|
|
87
|
+
e.stopPropagation();
|
|
88
|
+
next();
|
|
89
|
+
},
|
|
90
|
+
style: { pointerEvents: "auto" },
|
|
91
|
+
className: "relative z-10 rounded-full border border-current/30 p-2 hover:bg-white/10 transition-colors cursor-pointer",
|
|
92
|
+
children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-5 w-5", style: { pointerEvents: "none" } })
|
|
73
93
|
}
|
|
74
94
|
)
|
|
75
95
|
] })
|
|
@@ -32,7 +32,6 @@ const conf = {
|
|
|
32
32
|
buttons: [
|
|
33
33
|
{
|
|
34
34
|
label: "",
|
|
35
|
-
url: "",
|
|
36
35
|
variant: "default",
|
|
37
36
|
size: "default",
|
|
38
37
|
icon: "none"
|
|
@@ -44,7 +43,7 @@ const conf = {
|
|
|
44
43
|
...defaultCard,
|
|
45
44
|
heading: `Article ${index + 1}`,
|
|
46
45
|
description: "A short summary of this article goes here.",
|
|
47
|
-
button: { label: "",
|
|
46
|
+
button: { label: "", variant: "link", size: "default", icon: "move-right" }
|
|
48
47
|
}
|
|
49
48
|
})),
|
|
50
49
|
styles: createStylesDefaults({ columns: 3 })
|
|
@@ -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: () =>
|
|
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
|
)) }),
|
|
@@ -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
|
-
|
|
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(
|
|
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
|
@@ -4,7 +4,7 @@ import { default as default4 } from "./components/shadcn/badge-promo.js";
|
|
|
4
4
|
import { default as default5 } from "./components/puck-base/use-upload.js";
|
|
5
5
|
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "./components/shadcn/accordion.js";
|
|
6
6
|
import { conf } from "./components/puck-block/faq-sections/accordion-1/index.js";
|
|
7
|
-
import { ActionField } from "./components/puck-base/action-field.js";
|
|
7
|
+
import { ActionField } from "./components/puck-base/fields/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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dune-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
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
|
|
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",
|