@stackshift-ui/testimonial 6.0.5 → 6.0.6-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,39 +0,0 @@
1
- import {
2
- Testimonial_A
3
- } from "./chunk-RO3QLJ5Y.mjs";
4
- import {
5
- Testimonial_B
6
- } from "./chunk-2P5MVWOK.mjs";
7
- import {
8
- Testimonial_C
9
- } from "./chunk-SWKKWYIR.mjs";
10
- import {
11
- Testimonial_D
12
- } from "./chunk-C7NFFKD2.mjs";
13
-
14
- // src/testimonial.tsx
15
- import { Suspense } from "react";
16
- import { jsx } from "react/jsx-runtime";
17
- var Variants = {
18
- variant_a: Testimonial_A,
19
- variant_b: Testimonial_B,
20
- variant_c: Testimonial_C,
21
- variant_d: Testimonial_D
22
- };
23
- var Testimonial = ({ data }) => {
24
- var _a, _b, _c, _d, _e, _f;
25
- const variant = data == null ? void 0 : data.variant;
26
- const Variant = variant && Variants[variant];
27
- const props = {
28
- caption: (_b = (_a = data == null ? void 0 : data.variants) == null ? void 0 : _a.subtitle) != null ? _b : void 0,
29
- title: (_d = (_c = data == null ? void 0 : data.variants) == null ? void 0 : _c.title) != null ? _d : void 0,
30
- testimonials: (_f = (_e = data == null ? void 0 : data.variants) == null ? void 0 : _e.testimonials) != null ? _f : void 0
31
- };
32
- if (!Variant) return null;
33
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Variant, { ...props }) });
34
- };
35
- Testimonial.displayName = "Testimonial";
36
-
37
- export {
38
- Testimonial
39
- };
@@ -1,92 +0,0 @@
1
- // src/testimonial_a.tsx
2
- import { Card } from "@stackshift-ui/card";
3
- import { Container } from "@stackshift-ui/container";
4
- import { Flex } from "@stackshift-ui/flex";
5
- import { Heading } from "@stackshift-ui/heading";
6
- import { Image } from "@stackshift-ui/image";
7
- import { Section } from "@stackshift-ui/section";
8
- import { SwiperPagination } from "@stackshift-ui/swiper-pagination";
9
- import { Text } from "@stackshift-ui/text";
10
- import React from "react";
11
- import { jsx, jsxs } from "react/jsx-runtime";
12
- function Testimonial_A({ testimonials }) {
13
- const [testimony, setTestimony] = React.useState(0);
14
- const slider = (index) => {
15
- setTestimony(index);
16
- };
17
- return /* @__PURE__ */ jsx(Section, { className: "py-20 bg-background", children: /* @__PURE__ */ jsx(Container, { maxWidth: 1280, children: /* @__PURE__ */ jsx(Card, { className: "py-10", borderRadius: "md", children: /* @__PURE__ */ jsxs(Flex, { wrap: true, align: "center", justify: "center", className: "max-w-5xl p-4", children: [
18
- /* @__PURE__ */ jsx(AvatarSection, { testimonials, testimony }),
19
- /* @__PURE__ */ jsx(TestimonyContent, { testimonials, testimony, slider })
20
- ] }) }) }) });
21
- }
22
- function AvatarSection({
23
- testimonials,
24
- testimony
25
- }) {
26
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
27
- if (!(testimonials == null ? void 0 : testimonials[testimony])) return null;
28
- return /* @__PURE__ */ jsxs("div", { className: "w-full mb-6 text-center lg:w-1/3", children: [
29
- ((_b = (_a = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _a.mainImage) == null ? void 0 : _b.image) ? /* @__PURE__ */ jsx(
30
- Image,
31
- {
32
- width: 128,
33
- height: 128,
34
- className: "mx-auto border-0 w-[128px] h-[128px] object-cover rounded-full",
35
- src: `${(_d = (_c = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _c.mainImage) == null ? void 0 : _d.image}`,
36
- alt: (_h = (_f = (_e = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _e.mainImage) == null ? void 0 : _f.alt) != null ? _h : `testimonial-source-${(_g = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _g.name}-profile-image`
37
- }
38
- ) : null,
39
- ((_i = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _i.name) ? /* @__PURE__ */ jsx(Text, { className: "text-xl", children: (_j = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _j.name }) : null,
40
- ((_k = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _k.jobTitle) ? /* @__PURE__ */ jsx(Text, { className: "text-primary", children: (_l = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _l.jobTitle }) : null
41
- ] });
42
- }
43
- function TestimonyContent({
44
- testimonials,
45
- testimony,
46
- slider
47
- }) {
48
- var _a;
49
- if (!(testimonials == null ? void 0 : testimonials[testimony])) return null;
50
- return /* @__PURE__ */ jsxs("div", { className: "w-full lg:w-2/3", children: [
51
- /* @__PURE__ */ jsxs(
52
- "svg",
53
- {
54
- className: "w-10 h-10 mb-4 text-primary",
55
- viewBox: "0 0 32 28",
56
- fill: "none",
57
- xmlns: "http://www.w3.org/2000/svg",
58
- children: [
59
- /* @__PURE__ */ jsx(
60
- "path",
61
- {
62
- d: "M10.2418 12.749C9.45369 12.522 8.66554 12.4069 7.89887 12.4069C6.71496 12.4069 5.72709 12.6775 4.96109 13.0088C5.69957 10.3053 7.47358 5.6405 11.0075 5.11517C11.3348 5.0665 11.603 4.82986 11.6923 4.51131L12.4646 1.74875C12.5298 1.51512 12.4912 1.26505 12.3579 1.06231C12.2246 0.859563 12.0105 0.724288 11.7705 0.691393C11.5097 0.655812 11.2438 0.637686 10.9803 0.637686C6.73846 0.637686 2.53756 5.06516 0.764895 11.4046C-0.275679 15.1238 -0.580802 20.7154 1.98237 24.2349C3.41668 26.2043 5.50924 27.2559 8.20198 27.361C8.21305 27.3613 8.2238 27.3616 8.23487 27.3616C11.5573 27.3616 14.5035 25.1241 15.3997 21.9208C15.9351 20.0058 15.6931 17.9975 14.7176 16.2644C13.7526 14.5508 12.1632 13.3018 10.2418 12.749Z",
63
- fill: "currentColor"
64
- }
65
- ),
66
- /* @__PURE__ */ jsx(
67
- "path",
68
- {
69
- d: "M31.0396 16.2648C30.0746 14.5508 28.4852 13.3018 26.5638 12.749C25.7757 12.522 24.9875 12.4069 24.2212 12.4069C23.0373 12.4069 22.0491 12.6775 21.2831 13.0088C22.0215 10.3053 23.7955 5.6405 27.3298 5.11517C27.6571 5.0665 27.9249 4.82986 28.0146 4.51131L28.7869 1.74875C28.8521 1.51512 28.8135 1.26505 28.6802 1.06231C28.5473 0.859563 28.3331 0.724288 28.0928 0.691393C27.8323 0.655812 27.5664 0.637686 27.3026 0.637686C23.0608 0.637686 18.8599 5.06516 17.0869 11.4046C16.0466 15.1238 15.7415 20.7154 18.305 24.2356C19.739 26.2046 21.8319 27.2566 24.5243 27.3613C24.5354 27.3616 24.5461 27.362 24.5575 27.362C27.8796 27.362 30.8261 25.1244 31.7224 21.9211C32.2571 20.0061 32.0147 17.9975 31.0396 16.2648Z",
70
- fill: "currentColor"
71
- }
72
- )
73
- ]
74
- }
75
- ),
76
- /* @__PURE__ */ jsx(Heading, { children: (_a = testimonials == null ? void 0 : testimonials[testimony]) == null ? void 0 : _a.testimony }),
77
- (testimonials == null ? void 0 : testimonials.length) > 1 ? /* @__PURE__ */ jsx(React.Fragment, { children: testimonials.map((item, index) => /* @__PURE__ */ jsx(
78
- SwiperPagination,
79
- {
80
- colorScheme: "blue",
81
- isActive: index === testimony,
82
- ariaLabel: `Show Testimonial ${index}`,
83
- onClick: () => slider(index)
84
- },
85
- index
86
- )) }) : null
87
- ] });
88
- }
89
-
90
- export {
91
- Testimonial_A
92
- };
@@ -1,104 +0,0 @@
1
- // src/testimonial_c.tsx
2
- import { Card } from "@stackshift-ui/card";
3
- import { Container } from "@stackshift-ui/container";
4
- import { Flex } from "@stackshift-ui/flex";
5
- import { Heading } from "@stackshift-ui/heading";
6
- import { Image } from "@stackshift-ui/image";
7
- import { Section } from "@stackshift-ui/section";
8
- import { SwiperButton } from "@stackshift-ui/swiper-button";
9
- import { Text } from "@stackshift-ui/text";
10
- import React from "react";
11
- import { jsx, jsxs } from "react/jsx-runtime";
12
- function Testimonial_C({ caption, title, testimonials }) {
13
- const [testimony, setTestimony] = React.useState(testimonials);
14
- const slider = (action) => {
15
- setTestimony((prevState) => {
16
- if (!prevState || prevState.length === 0) return prevState;
17
- const updatedTestimony = [...prevState];
18
- if (action === "next") {
19
- const firstItem = updatedTestimony.shift();
20
- if (firstItem) updatedTestimony.push(firstItem);
21
- } else if (action === "prev") {
22
- const lastItem = updatedTestimony.pop();
23
- if (lastItem) updatedTestimony.unshift(lastItem);
24
- }
25
- return updatedTestimony;
26
- });
27
- };
28
- return /* @__PURE__ */ jsxs(Section, { className: "py-10 overflow-hidden bg-background lg:py-20", children: [
29
- /* @__PURE__ */ jsx(Container, { className: "pb-6 lg:pb-16", maxWidth: 1280, children: /* @__PURE__ */ jsxs(
30
- Flex,
31
- {
32
- wrap: true,
33
- align: "center",
34
- justify: "center",
35
- className: "text-center lg:justify-between lg:text-left",
36
- children: [
37
- /* @__PURE__ */ jsx(TestimonialHeader, { caption, title }),
38
- /* @__PURE__ */ jsx(TestimonialSwiper, { testimony, slider })
39
- ]
40
- }
41
- ) }),
42
- /* @__PURE__ */ jsx(TestimonialList, { testimony })
43
- ] });
44
- }
45
- function TestimonialHeader({ caption, title }) {
46
- return /* @__PURE__ */ jsxs("div", { className: "w-full mb-4 lg:mb-0 lg:w-4/5", children: [
47
- /* @__PURE__ */ jsx(Text, { weight: "bold", className: "text-secondary", children: caption }),
48
- /* @__PURE__ */ jsx(Heading, { fontSize: "3xl", children: title })
49
- ] });
50
- }
51
- function TestimonialSwiper({
52
- testimony,
53
- slider
54
- }) {
55
- if (!testimony) return null;
56
- return /* @__PURE__ */ jsxs("div", { className: "w-full lg:w-1/5", children: [
57
- testimony && (testimony == null ? void 0 : testimony.length) >= 4 && /* @__PURE__ */ jsx(
58
- SwiperButton,
59
- {
60
- type: "left",
61
- className: "order-last p-5 mr-4 bg-white lg:order-first",
62
- onClick: () => slider("prev"),
63
- ariaLabel: "Show previous testimonial"
64
- }
65
- ),
66
- testimony && (testimony == null ? void 0 : testimony.length) >= 4 && /* @__PURE__ */ jsx(
67
- SwiperButton,
68
- {
69
- type: "right",
70
- className: "order-last p-5 bg-white",
71
- onClick: () => slider("next"),
72
- ariaLabel: "Show next testimonial"
73
- }
74
- )
75
- ] });
76
- }
77
- function TestimonialList({ testimony }) {
78
- var _a;
79
- if (!testimony) return null;
80
- return /* @__PURE__ */ jsx(Flex, { className: "relative", children: testimony && /* @__PURE__ */ jsx(Flex, { wrap: true, className: "!items-stretch max-w-6xl px-2 mx-auto", children: (_a = testimony == null ? void 0 : testimony.slice(0, 3)) == null ? void 0 : _a.map((item, index) => /* @__PURE__ */ jsx(TestimonialItem, { item, index }, item == null ? void 0 : item._key)) }) });
81
- }
82
- function TestimonialItem({ item, index }) {
83
- var _a, _b, _c, _d;
84
- if (!item) return null;
85
- return /* @__PURE__ */ jsx("div", { className: "flex-1 w-full px-3 mb-4 lg:w-1/3", children: /* @__PURE__ */ jsxs(Card, { className: "p-8 text-center h-full items-center", borderRadius: "md", children: [
86
- /* @__PURE__ */ jsx(Text, { className: "mb-8 leading-loose", muted: true, children: item == null ? void 0 : item.testimony }),
87
- ((_a = item == null ? void 0 : item.mainImage) == null ? void 0 : _a.image) && /* @__PURE__ */ jsx("div", { className: "w-[48px] h-[48px] mx-auto border-0", children: /* @__PURE__ */ jsx(
88
- Image,
89
- {
90
- className: "w-full h-full object-cover rounded-full",
91
- width: 48,
92
- height: 48,
93
- src: `${(_b = item == null ? void 0 : item.mainImage) == null ? void 0 : _b.image}`,
94
- alt: (_d = (_c = item == null ? void 0 : item.mainImage) == null ? void 0 : _c.alt) != null ? _d : `testimonial-source-${item == null ? void 0 : item.name}-profile-image`
95
- }
96
- ) }),
97
- /* @__PURE__ */ jsx(Text, { className: "mb-1", fontSize: "2xl", weight: "bold", children: item == null ? void 0 : item.name }),
98
- /* @__PURE__ */ jsx(Text, { muted: true, children: item == null ? void 0 : item.jobTitle })
99
- ] }) }, index);
100
- }
101
-
102
- export {
103
- Testimonial_C
104
- };
@@ -1,39 +0,0 @@
1
- import {
2
- Testimonial_A
3
- } from "./chunk-RO3QLJ5Y.mjs";
4
- import {
5
- Testimonial_B
6
- } from "./chunk-2P5MVWOK.mjs";
7
- import {
8
- Testimonial_C
9
- } from "./chunk-5EJLFZJU.mjs";
10
- import {
11
- Testimonial_D
12
- } from "./chunk-C7NFFKD2.mjs";
13
-
14
- // src/testimonial.tsx
15
- import { Suspense } from "react";
16
- import { jsx } from "react/jsx-runtime";
17
- var Variants = {
18
- variant_a: Testimonial_A,
19
- variant_b: Testimonial_B,
20
- variant_c: Testimonial_C,
21
- variant_d: Testimonial_D
22
- };
23
- var Testimonial = ({ data }) => {
24
- var _a, _b, _c, _d, _e, _f;
25
- const variant = data == null ? void 0 : data.variant;
26
- const Variant = variant && Variants[variant];
27
- const props = {
28
- caption: (_b = (_a = data == null ? void 0 : data.variants) == null ? void 0 : _a.subtitle) != null ? _b : void 0,
29
- title: (_d = (_c = data == null ? void 0 : data.variants) == null ? void 0 : _c.title) != null ? _d : void 0,
30
- testimonials: (_f = (_e = data == null ? void 0 : data.variants) == null ? void 0 : _e.testimonials) != null ? _f : void 0
31
- };
32
- if (!Variant) return null;
33
- return /* @__PURE__ */ jsx(Suspense, { fallback: null, children: /* @__PURE__ */ jsx(Variant, { ...props }) });
34
- };
35
- Testimonial.displayName = "Testimonial";
36
-
37
- export {
38
- Testimonial
39
- };