@stackshift-ui/testimonial 6.0.4-beta.8 → 6.0.5

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 +1,171 @@
1
- "use strict";var P=Object.create;var C=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var A=Object.getPrototypeOf,D=Object.prototype.hasOwnProperty;var Q=(r,g)=>{for(var c in g)C(r,c,{get:g[c],enumerable:!0})},L=(r,g,c,d)=>{if(g&&typeof g=="object"||typeof g=="function")for(let a of _(g))!D.call(r,a)&&a!==c&&C(r,a,{get:()=>g[a],enumerable:!(d=Z(g,a))||d.enumerable});return r};var W=(r,g,c)=>(c=r!=null?P(A(r)):{},L(g||!r||!r.__esModule?C(c,"default",{value:r,enumerable:!0}):c,r)),q=r=>L(C({},"__esModule",{value:!0}),r);var H={};Q(H,{Testimonial_D:()=>F,default:()=>F});module.exports=q(H);var j=require("@stackshift-ui/card"),R=require("@stackshift-ui/container"),B=require("@stackshift-ui/flex"),M=require("@stackshift-ui/image"),$=require("@stackshift-ui/section"),p=require("@stackshift-ui/swiper-button"),f=require("@stackshift-ui/text"),z=W(require("react")),e=require("react/jsx-runtime");function F({testimonials:r}){var n,o,u,w,b,m,t,v,N,y,S,T,k,I;let[g,c]=z.default.useState(0),d=x=>{!r||r.length<=1||c(x==="next"?l=>l!==r.length-1?l+1:0:l=>l>0?l-1:r.length-1)},a=x=>{let l=[];for(let h=0;h<x;h++)l.push(h);return l};return(0,e.jsx)($.Section,{className:"py-20 bg-background",children:(0,e.jsx)(R.Container,{maxWidth:1280,children:(0,e.jsxs)("div",{className:"items-center justify-center md:space-x-8 lg:flex",children:[(0,e.jsxs)("div",{className:"mb-10 text-center lg:hidden",children:[r&&(r==null?void 0:r.length)>1&&(0,e.jsx)(p.SwiperButton,{type:"left",className:"p-4 mr-6 bg-white lg:order-first lg:mr-0",onClick:()=>d("prev"),ariaLabel:"Show previous testimonial"}),r&&(r==null?void 0:r.length)>1&&(0,e.jsx)(p.SwiperButton,{type:"right",className:"p-4 mr-6 bg-white lg:order-first lg:mr-0",onClick:()=>d("next"),ariaLabel:"Show next testimonial"})]}),r&&(r==null?void 0:r.length)>1&&(0,e.jsx)(p.SwiperButton,{type:"left",className:"hidden p-4 mr-6 bg-white lg:block lg:order-first lg:mr-0",onClick:()=>d("prev"),ariaLabel:"Show previous testimonial"}),(r==null?void 0:r[g])&&(0,e.jsxs)(j.Card,{className:"flex flex-wrap w-full",borderRadius:"md",children:[((n=r==null?void 0:r[g])==null?void 0:n.rating)&&(0,e.jsxs)("div",{className:"w-full py-10 text-center border-b lg:border-r lg:border-b-0 lg:w-1/3",children:[(0,e.jsx)("span",{className:"text-5xl font-bold lg:text-6xl",children:`${(o=r==null?void 0:r[g])==null?void 0:o.rating}.0`}),(0,e.jsx)(B.Flex,{align:"center",justify:"center",className:"mb-6 text-primary",children:((u=r==null?void 0:r[g])==null?void 0:u.rating)!==void 0&&a(Number((w=r==null?void 0:r[g])==null?void 0:w.rating)).map((x,l)=>(0,e.jsx)(E,{},l))}),(0,e.jsx)("div",{className:"object-contain w-32 h-24 mx-auto mb-6 rounded-full",children:((m=(b=r[g])==null?void 0:b.mainImage)==null?void 0:m.image)&&(0,e.jsx)(M.Image,{className:"h-[96px] w-[128px] object-scale-down",src:`${(v=(t=r[g])==null?void 0:t.mainImage)==null?void 0:v.image}`,width:128,height:96,alt:(S=(y=(N=r[g])==null?void 0:N.mainImage)==null?void 0:y.alt)!=null?S:`testimonial-source-profile-image${g}`})})]}),(0,e.jsxs)("div",{className:"w-full px-6 py-10 lg:w-2/3",children:[(0,e.jsx)(G,{}),(0,e.jsx)(f.Text,{muted:!0,className:"mb-10 text-xl leading-loose lg:text-2xl",children:(T=r[g])==null?void 0:T.testimony}),(0,e.jsx)(f.Text,{weight:"bold",fontSize:"2xl",children:(k=r[g])==null?void 0:k.name}),(0,e.jsx)(f.Text,{muted:!0,children:(I=r[g])==null?void 0:I.jobTitle})]})]}),r&&(r==null?void 0:r.length)>1&&(0,e.jsx)(p.SwiperButton,{type:"right",className:"hidden bg-white lg:block p-4 mr-6 lg:mr-0",onClick:()=>d("next"),ariaLabel:"Show next testimonial"})]})})})}function E(){return(0,e.jsx)("svg",{className:"w-6 h-6",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:(0,e.jsx)("path",{d:"M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"})})}function G(){return(0,e.jsxs)("svg",{className:"w-10 h-10 mb-4 text-primary",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,e.jsx)("path",{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",fill:"currentColor"}),(0,e.jsx)("path",{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",fill:"currentColor"})]})}0&&(module.exports={Testimonial_D});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/testimonial_d.tsx
31
+ var testimonial_d_exports = {};
32
+ __export(testimonial_d_exports, {
33
+ Testimonial_D: () => Testimonial_D,
34
+ default: () => Testimonial_D
35
+ });
36
+ module.exports = __toCommonJS(testimonial_d_exports);
37
+ var import_card = require("@stackshift-ui/card");
38
+ var import_container = require("@stackshift-ui/container");
39
+ var import_flex = require("@stackshift-ui/flex");
40
+ var import_image = require("@stackshift-ui/image");
41
+ var import_section = require("@stackshift-ui/section");
42
+ var import_swiper_button = require("@stackshift-ui/swiper-button");
43
+ var import_text = require("@stackshift-ui/text");
44
+ var import_react = __toESM(require("react"));
45
+ var import_jsx_runtime = require("react/jsx-runtime");
46
+ function Testimonial_D({ testimonials }) {
47
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
48
+ const [currentIndex, setCurrentIndex] = import_react.default.useState(0);
49
+ const handleSlider = (direction) => {
50
+ if (!testimonials || testimonials.length <= 1) return;
51
+ if (direction === "next") {
52
+ setCurrentIndex((prev) => prev !== testimonials.length - 1 ? prev + 1 : 0);
53
+ } else {
54
+ setCurrentIndex((prev) => prev > 0 ? prev - 1 : testimonials.length - 1);
55
+ }
56
+ };
57
+ const getRatingToArray = (rating) => {
58
+ const num = [];
59
+ for (let i = 0; i < rating; i++) {
60
+ num.push(i);
61
+ }
62
+ return num;
63
+ };
64
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section.Section, { className: "py-20 bg-background", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_container.Container, { maxWidth: 1280, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "items-center justify-center md:space-x-8 lg:flex", children: [
65
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-10 text-center lg:hidden", children: [
66
+ testimonials && (testimonials == null ? void 0 : testimonials.length) > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
67
+ import_swiper_button.SwiperButton,
68
+ {
69
+ type: "left",
70
+ className: "p-4 mr-6 bg-white lg:order-first lg:mr-0",
71
+ onClick: () => handleSlider("prev"),
72
+ ariaLabel: "Show previous testimonial"
73
+ }
74
+ ),
75
+ testimonials && (testimonials == null ? void 0 : testimonials.length) > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
76
+ import_swiper_button.SwiperButton,
77
+ {
78
+ type: "right",
79
+ className: "p-4 mr-6 bg-white lg:order-first lg:mr-0",
80
+ onClick: () => handleSlider("next"),
81
+ ariaLabel: "Show next testimonial"
82
+ }
83
+ )
84
+ ] }),
85
+ testimonials && (testimonials == null ? void 0 : testimonials.length) > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
86
+ import_swiper_button.SwiperButton,
87
+ {
88
+ type: "left",
89
+ className: "hidden p-4 mr-6 bg-white lg:block lg:order-first lg:mr-0",
90
+ onClick: () => handleSlider("prev"),
91
+ ariaLabel: "Show previous testimonial"
92
+ }
93
+ ),
94
+ (testimonials == null ? void 0 : testimonials[currentIndex]) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { className: "flex flex-wrap w-full", borderRadius: "md", children: [
95
+ ((_a = testimonials == null ? void 0 : testimonials[currentIndex]) == null ? void 0 : _a.rating) && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full py-10 text-center border-b lg:border-r lg:border-b-0 lg:w-1/3", children: [
96
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-5xl font-bold lg:text-6xl", children: `${(_b = testimonials == null ? void 0 : testimonials[currentIndex]) == null ? void 0 : _b.rating}.0` }),
97
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_flex.Flex, { align: "center", justify: "center", className: "mb-6 text-primary", children: ((_c = testimonials == null ? void 0 : testimonials[currentIndex]) == null ? void 0 : _c.rating) !== void 0 && getRatingToArray(Number((_d = testimonials == null ? void 0 : testimonials[currentIndex]) == null ? void 0 : _d.rating)).map(
98
+ (_, idx) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RatingIcon, {}, idx)
99
+ ) }),
100
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "object-contain w-32 h-24 mx-auto mb-6 rounded-full", children: ((_f = (_e = testimonials[currentIndex]) == null ? void 0 : _e.mainImage) == null ? void 0 : _f.image) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
+ import_image.Image,
102
+ {
103
+ className: "h-[96px] w-[128px] object-scale-down",
104
+ src: `${(_h = (_g = testimonials[currentIndex]) == null ? void 0 : _g.mainImage) == null ? void 0 : _h.image}`,
105
+ width: 128,
106
+ height: 96,
107
+ alt: (_k = (_j = (_i = testimonials[currentIndex]) == null ? void 0 : _i.mainImage) == null ? void 0 : _j.alt) != null ? _k : `testimonial-source-profile-image${currentIndex}`
108
+ }
109
+ ) })
110
+ ] }),
111
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full px-6 py-10 lg:w-2/3", children: [
112
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(QuoteIcon, {}),
113
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Text, { muted: true, className: "mb-10 text-xl leading-loose lg:text-2xl", children: (_l = testimonials[currentIndex]) == null ? void 0 : _l.testimony }),
114
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Text, { weight: "bold", fontSize: "2xl", children: (_m = testimonials[currentIndex]) == null ? void 0 : _m.name }),
115
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Text, { muted: true, children: (_n = testimonials[currentIndex]) == null ? void 0 : _n.jobTitle })
116
+ ] })
117
+ ] }),
118
+ testimonials && (testimonials == null ? void 0 : testimonials.length) > 1 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
119
+ import_swiper_button.SwiperButton,
120
+ {
121
+ type: "right",
122
+ className: "hidden bg-white lg:block p-4 mr-6 lg:mr-0",
123
+ onClick: () => handleSlider("next"),
124
+ ariaLabel: "Show next testimonial"
125
+ }
126
+ )
127
+ ] }) }) });
128
+ }
129
+ function RatingIcon() {
130
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
131
+ "svg",
132
+ {
133
+ className: "w-6 h-6",
134
+ xmlns: "http://www.w3.org/2000/svg",
135
+ viewBox: "0 0 20 20",
136
+ fill: "currentColor",
137
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z" })
138
+ }
139
+ );
140
+ }
141
+ function QuoteIcon() {
142
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
143
+ "svg",
144
+ {
145
+ className: "w-10 h-10 mb-4 text-primary",
146
+ viewBox: "0 0 32 28",
147
+ fill: "none",
148
+ xmlns: "http://www.w3.org/2000/svg",
149
+ children: [
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
151
+ "path",
152
+ {
153
+ 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",
154
+ fill: "currentColor"
155
+ }
156
+ ),
157
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
158
+ "path",
159
+ {
160
+ 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",
161
+ fill: "currentColor"
162
+ }
163
+ )
164
+ ]
165
+ }
166
+ );
167
+ }
168
+ // Annotate the CommonJS export names for ESM import in node:
169
+ 0 && (module.exports = {
170
+ Testimonial_D
171
+ });
@@ -1 +1,7 @@
1
- import{a}from"./chunk-3NRVKPEL.mjs";export{a as Testimonial_D,a as default};
1
+ import {
2
+ Testimonial_D
3
+ } from "./chunk-C7NFFKD2.mjs";
4
+ export {
5
+ Testimonial_D,
6
+ Testimonial_D as default
7
+ };
package/dist/types.js CHANGED
@@ -1 +1,18 @@
1
- "use strict";var l=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var a=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var g=(n,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let e of a(t))!o.call(n,e)&&e!==r&&l(n,e,{get:()=>t[e],enumerable:!(i=s(t,e))||i.enumerable});return n};var u=n=>g(l({},"__esModule",{value:!0}),n);var c={};module.exports=u(c);
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __copyProps = (to, from, except, desc) => {
7
+ if (from && typeof from === "object" || typeof from === "function") {
8
+ for (let key of __getOwnPropNames(from))
9
+ if (!__hasOwnProp.call(to, key) && key !== except)
10
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11
+ }
12
+ return to;
13
+ };
14
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
+
16
+ // src/types.ts
17
+ var types_exports = {};
18
+ module.exports = __toCommonJS(types_exports);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stackshift-ui/testimonial",
3
3
  "description": "",
4
- "version": "6.0.4-beta.8",
4
+ "version": "6.0.5",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
@@ -34,18 +34,18 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "classnames": "^2.5.1",
37
- "@stackshift-ui/system": "6.0.3",
38
- "@stackshift-ui/avatar": "6.0.5-beta.2",
39
37
  "@stackshift-ui/card": "6.0.3",
38
+ "@stackshift-ui/system": "6.0.3",
39
+ "@stackshift-ui/scripts": "6.0.2",
40
+ "@stackshift-ui/avatar": "6.0.5",
40
41
  "@stackshift-ui/heading": "6.0.3",
41
- "@stackshift-ui/image": "6.0.3",
42
42
  "@stackshift-ui/text": "6.0.3",
43
43
  "@stackshift-ui/swiper-pagination": "6.0.3",
44
44
  "@stackshift-ui/swiper-button": "6.0.3",
45
45
  "@stackshift-ui/container": "6.0.3",
46
46
  "@stackshift-ui/section": "6.0.3",
47
47
  "@stackshift-ui/flex": "6.0.3",
48
- "@stackshift-ui/scripts": "6.0.2"
48
+ "@stackshift-ui/image": "6.0.3"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "@types/react": "16.8 - 19",
@@ -102,7 +102,7 @@ function TestimonialList({ testimonials }: { testimonials?: iTestimonial[] }) {
102
102
 
103
103
  return (
104
104
  <div className="relative w-full">
105
- <Flex wrap justify="center" className="mx-auto ">
105
+ <Flex wrap justify="center" className="!items-stretch mx-auto">
106
106
  {testimonials.slice(0, 3).map((testimonial: iTestimonial, index: number) => (
107
107
  <TestimonialItem key={index} {...testimonial} />
108
108
  ))}
@@ -123,8 +123,8 @@ function TestimonialItem({
123
123
  if (!testimony) return null;
124
124
 
125
125
  return (
126
- <div className="mb-4 px-3 w-full lg:w-1/3">
127
- <Card className="p-5" borderRadius="md">
126
+ <div className="flex-1 mb-4 px-3 w-full lg:w-1/3">
127
+ <Card className="p-5 h-full" borderRadius="md">
128
128
  <QuoteIcon />
129
129
  <Text className="mb-4 leading-loose" muted>
130
130
  {testimony}
@@ -99,7 +99,7 @@ function TestimonialList({ testimony }: { testimony?: iTestimonial[] }) {
99
99
  return (
100
100
  <Flex className="relative">
101
101
  {testimony && (
102
- <Flex wrap className="max-w-6xl px-2 mx-auto">
102
+ <Flex wrap className="!items-stretch max-w-6xl px-2 mx-auto">
103
103
  {testimony
104
104
  ?.slice(0, 3)
105
105
  ?.map((item, index) => <TestimonialItem item={item} index={index} key={item?._key} />)}
@@ -113,8 +113,8 @@ function TestimonialItem({ item, index }: { item?: iTestimonial; index: number }
113
113
  if (!item) return null;
114
114
 
115
115
  return (
116
- <div className="w-full px-3 mb-4 lg:w-1/3" key={index}>
117
- <Card className="p-8 text-center" borderRadius="md">
116
+ <div className="flex-1 w-full px-3 mb-4 lg:w-1/3" key={index}>
117
+ <Card className="p-8 text-center h-full items-center" borderRadius="md">
118
118
  <Text className="mb-8 leading-loose" muted>
119
119
  {item?.testimony}
120
120
  </Text>
@@ -1 +0,0 @@
1
- import{Card as C}from"@stackshift-ui/card";import{Container as p}from"@stackshift-ui/container";import{Flex as u}from"@stackshift-ui/flex";import{Heading as x}from"@stackshift-ui/heading";import{Section as g}from"@stackshift-ui/section";import{SwiperButton as c}from"@stackshift-ui/swiper-button";import{Text as a}from"@stackshift-ui/text";import{useState as w}from"react";import{jsx as e,jsxs as o}from"react/jsx-runtime";function h({caption:t,title:i,testimonials:n}){let[s,d]=w(n);return e(g,{className:"py-20 overflow-hidden bg-background",children:o(p,{maxWidth:1280,children:[e(u,{wrap:!0,align:"center",justify:"center",className:"pt-8 pb-16",children:e(T,{testimony:s,slider:m=>{d(f=>{let r=f||[];if(m==="next"){let l=r.length>0?r.shift():void 0;return l?[...r,l]:r}else if(m==="prev"){let l=r.length>0?r.pop():void 0;return l?[l,...r]:r}return r})},children:e(v,{caption:t,title:i})})}),e(b,{testimonials:s})]})})}function v({caption:t,title:i}){return o(p,{maxWidth:576,className:"mb-10 text-center ",children:[e(a,{weight:"bold",className:"text-secondary",children:t}),e(x,{fontSize:"3xl",className:"mt-4",children:i})]})}function T({testimony:t,slider:i,children:n}){return t?o("div",{className:"flex items-center justify-between w-full",children:[(t==null?void 0:t.length)>=4&&e(c,{type:"left",className:"p-4 bg-white",onClick:()=>i("prev"),ariaLabel:"Show previous testimonial"}),e("div",{className:"flex-1 text-center",children:n}),(t==null?void 0:t.length)>=4&&e(c,{type:"right",className:"p-4 bg-white",onClick:()=>i("next"),ariaLabel:"Show next testimonial"})]}):null}function b({testimonials:t}){return t?e("div",{className:"relative w-full",children:e(u,{wrap:!0,justify:"center",className:"mx-auto ",children:t.slice(0,3).map((i,n)=>e(N,{...i},n))})}):null}function N({testimony:t,name:i,jobTitle:n}){return t?e("div",{className:"mb-4 px-3 w-full lg:w-1/3",children:o(C,{className:"p-5",borderRadius:"md",children:[e(S,{}),e(a,{className:"mb-4 leading-loose",muted:!0,children:t}),e(a,{weight:"bold",children:i}),e(a,{muted:!0,children:n})]})}):null}function S(){return o("svg",{className:"w-8 h-8 mb-6 text-primary",viewBox:"0 0 32 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e("path",{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",fill:"currentColor"}),e("path",{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",fill:"currentColor"})]})}export{h as a};
@@ -1 +0,0 @@
1
- import{Card as g}from"@stackshift-ui/card";import{Container as x}from"@stackshift-ui/container";import{Flex as p}from"@stackshift-ui/flex";import{Heading as w}from"@stackshift-ui/heading";import{Image as b}from"@stackshift-ui/image";import{Section as h}from"@stackshift-ui/section";import{SwiperButton as m}from"@stackshift-ui/swiper-button";import{Text as f}from"@stackshift-ui/text";import T from"react";import{jsx as l,jsxs as s}from"react/jsx-runtime";function N({caption:e,title:a,testimonials:r}){let[o,t]=T.useState(r);return s(h,{className:"py-10 overflow-hidden bg-background lg:py-20",children:[l(x,{className:"pb-6 lg:pb-16",maxWidth:1280,children:s(p,{wrap:!0,align:"center",justify:"center",className:"text-center lg:justify-between lg:text-left",children:[l(v,{caption:e,title:a}),l(C,{testimony:o,slider:u=>{t(c=>{if(!c||c.length===0)return c;let n=[...c];if(u==="next"){let i=n.shift();i&&n.push(i)}else if(u==="prev"){let i=n.pop();i&&n.unshift(i)}return n})}})]})}),l(I,{testimony:o})]})}function v({caption:e,title:a}){return s("div",{className:"w-full mb-4 lg:mb-0 lg:w-4/5",children:[l(f,{weight:"bold",className:"text-secondary",children:e}),l(w,{fontSize:"3xl",children:a})]})}function C({testimony:e,slider:a}){return e?s("div",{className:"w-full lg:w-1/5",children:[e&&(e==null?void 0:e.length)>=4&&l(m,{type:"left",className:"order-last p-5 mr-4 bg-white lg:order-first",onClick:()=>a("prev"),ariaLabel:"Show previous testimonial"}),e&&(e==null?void 0:e.length)>=4&&l(m,{type:"right",className:"order-last p-5 bg-white",onClick:()=>a("next"),ariaLabel:"Show next testimonial"})]}):null}function I({testimony:e}){var a;return e?l(p,{className:"relative",children:e&&l(p,{wrap:!0,className:"max-w-6xl px-2 mx-auto",children:(a=e==null?void 0:e.slice(0,3))==null?void 0:a.map((r,o)=>l(k,{item:r,index:o},r==null?void 0:r._key))})}):null}function k({item:e,index:a}){var r,o,t,d;return e?l("div",{className:"w-full px-3 mb-4 lg:w-1/3",children:s(g,{className:"p-8 text-center",borderRadius:"md",children:[l(f,{className:"mb-8 leading-loose",muted:!0,children:e==null?void 0:e.testimony}),((r=e==null?void 0:e.mainImage)==null?void 0:r.image)&&l("div",{className:"w-[48px] h-[48px] mx-auto border-0",children:l(b,{className:"w-full h-full object-cover rounded-full",width:48,height:48,src:`${(o=e==null?void 0:e.mainImage)==null?void 0:o.image}`,alt:(d=(t=e==null?void 0:e.mainImage)==null?void 0:t.alt)!=null?d:`testimonial-source-${e==null?void 0:e.name}-profile-image`})}),l(f,{className:"mb-1",fontSize:"2xl",weight:"bold",children:e==null?void 0:e.name}),l(f,{muted:!0,children:e==null?void 0:e.jobTitle})]})},a):null}export{N as a};