@stackshift-ui/statistics 6.0.3 → 6.0.4

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.
@@ -0,0 +1 @@
1
+ import{lazy as s}from"react";import{jsx as v}from"react/jsx-runtime";var c={variant_a:s(()=>import("./statistics_a.mjs")),variant_b:s(()=>import("./statistics_b.mjs")),variant_c:s(()=>import("./statistics_c.mjs"))},m="Statistics",a=({data:t})=>{var o,n,e;let i=t==null?void 0:t.variant,r=i&&c[i],p={stats:(e=((o=t==null?void 0:t.variants)==null?void 0:o.stats)||((n=t==null?void 0:t.variants)==null?void 0:n.statItems))!=null?e:void 0};return r?v(r,{...p}):null};a.displayName=m;export{a};
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";var D=Object.create;var p=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var s=(r,o)=>()=>(r&&(o=r(r=0)),o);var c=(r,o)=>{for(var e in o)p(r,e,{get:o[e],enumerable:!0})},v=(r,o,e,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of G(o))!J.call(r,t)&&t!==e&&p(r,t,{get:()=>o[t],enumerable:!(m=E(o,t))||m.enumerable});return r};var K=(r,o,e)=>(e=r!=null?D(H(r)):{},v(o||!r||!r.__esModule?p(e,"default",{value:r,enumerable:!0}):e,r)),L=r=>v(p({},"__esModule",{value:!0}),r);var F={};c(F,{Statistics_A:()=>u,default:()=>u});function u({stats:r}){return(0,i.jsx)(N.Section,{className:"py-20 bg-background",children:(0,i.jsx)(w.Container,{maxWidth:1280,children:(0,i.jsx)(b.Flex,{wrap:!0,align:"center",justify:"start",className:"text-center",children:(0,i.jsx)(M,{stats:r})})})})}function M({stats:r}){return r?(0,i.jsx)(C.default.Fragment,{children:r.map((o,e)=>(0,i.jsx)("div",{className:"w-full px-4 my-8 sm:w-1/4 lg:w-1/4",children:(0,i.jsxs)(d.Card,{className:"relative py-10 ",children:[(0,i.jsx)(I.Text,{className:"mb-1 text-primary overflow-ellipsis overflow-clip",children:o==null?void 0:o.label}),(0,i.jsx)("p",{className:"text-xl text-gray-500 font-bold lg:text-2xl overflow-ellipsis overflow-clip",children:o==null?void 0:o.value})]})},e))}):null}var d,w,b,N,I,C,i,S=s(()=>{"use strict";d=require("@stackshift-ui/card"),w=require("@stackshift-ui/container"),b=require("@stackshift-ui/flex"),N=require("@stackshift-ui/section"),I=require("@stackshift-ui/text"),C=K(require("react")),i=require("react/jsx-runtime")});var R={};c(R,{Statistics_B:()=>x,default:()=>x});function x({stats:r}){return(0,i.jsx)(N.Section,{className:"py-20 bg-background",children:(0,i.jsx)(w.Container,{maxWidth:1280,children:(0,i.jsx)(O,{stats:r})})})}function O({stats:r}){return r?(0,i.jsx)(b.Flex,{wrap:!0,align:"center",direction:"col",className:"sm:justify-left sm:flex-row",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(P.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4 lg:justify-center",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var P,N,w,b,i,g=s(()=>{"use strict";P=require("@stackshift-ui/stats-card")});var A={};c(A,{default:()=>z});function z({stats:r}){return(0,i.jsx)(N.Section,{className:"py-20 bg-background",children:(0,i.jsx)(w.Container,{maxWidth:1280,children:(0,i.jsx)(Q,{stats:r})})})}function Q({stats:r}){return r?(0,i.jsx)($.Flex,{wrap:!0,align:"center",className:"text-center ",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(V.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4",variant:"stacked",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var V,N,w,$,i,y=s(()=>{"use strict";V=require("@stackshift-ui/stats-card")});var Y={};c(Y,{Statistics:()=>B,Statistics_A:()=>u,Statistics_B:()=>x});module.exports=L(Y);var f=require("react"),U={variant_a:(0,f.lazy)(()=>Promise.resolve().then(()=>(S(),F))),variant_b:(0,f.lazy)(()=>Promise.resolve().then(()=>(g(),R))),variant_c:(0,f.lazy)(()=>Promise.resolve().then(()=>(y(),A)))},X="Statistics",B=({data:r})=>{var t,n;let o=r==null?void 0:r.variant,e=o&&U[o],m={stats:(n=(t=r==null?void 0:r.variants)==null?void 0:t.stats)!=null?n:void 0};return e?(0,i.jsx)(e,{...m}):null};B.displayName=X;S();g();y();0&&(module.exports={Statistics,Statistics_A,Statistics_B});
2
+ "use strict";var E=Object.create;var p=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var f=(r,o)=>()=>(r&&(o=r(r=0)),o);var c=(r,o)=>{for(var e in o)p(r,e,{get:o[e],enumerable:!0})},w=(r,o,e,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of H(o))!K.call(r,t)&&t!==e&&p(r,t,{get:()=>o[t],enumerable:!(m=G(o,t))||m.enumerable});return r};var L=(r,o,e)=>(e=r!=null?E(J(r)):{},w(o||!r||!r.__esModule?p(e,"default",{value:r,enumerable:!0}):e,r)),M=r=>w(p({},"__esModule",{value:!0}),r);var P={};c(P,{Statistics_A:()=>u,default:()=>u});function u({stats:r}){return(0,i.jsx)(C.Section,{className:"py-20 bg-background",children:(0,i.jsx)(I.Container,{maxWidth:1280,children:(0,i.jsx)(N.Flex,{wrap:!0,align:"center",justify:"start",className:"text-center",children:(0,i.jsx)(O,{stats:r})})})})}function O({stats:r}){return r?(0,i.jsx)(F.default.Fragment,{children:r.map((o,e)=>(0,i.jsx)("div",{className:"w-full px-4 my-8 sm:w-1/4 lg:w-1/4",children:(0,i.jsxs)(b.Card,{className:"relative py-10 ",children:[(0,i.jsx)(d.Text,{className:"mb-1 text-primary overflow-ellipsis overflow-clip",children:o==null?void 0:o.label}),(0,i.jsx)("p",{className:"text-xl text-gray-500 font-bold lg:text-2xl overflow-ellipsis overflow-clip",children:o==null?void 0:o.value})]})},e))}):null}var b,I,N,C,d,F,i,S=f(()=>{"use strict";b=require("@stackshift-ui/card"),I=require("@stackshift-ui/container"),N=require("@stackshift-ui/flex"),C=require("@stackshift-ui/section"),d=require("@stackshift-ui/text"),F=L(require("react")),i=require("react/jsx-runtime")});var V={};c(V,{Statistics_B:()=>x,default:()=>x});function x({stats:r}){return(0,i.jsx)(C.Section,{className:"py-20 bg-background",children:(0,i.jsx)(I.Container,{maxWidth:1280,children:(0,i.jsx)(Q,{stats:r})})})}function Q({stats:r}){return r?(0,i.jsx)(N.Flex,{wrap:!0,align:"center",direction:"col",className:"sm:justify-left sm:flex-row",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(k.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4 lg:justify-center",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var k,C,I,N,i,g=f(()=>{"use strict";k=require("@stackshift-ui/stats-card")});var B={};c(B,{default:()=>A});function A({stats:r}){return(0,i.jsx)(C.Section,{className:"py-20 bg-background",children:(0,i.jsx)($.Container,{maxWidth:1280,children:(0,i.jsx)(U,{stats:r})})})}function U({stats:r}){return r?(0,i.jsx)(N.Flex,{wrap:!0,align:"center",className:"text-center ",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(W.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4",variant:"stacked",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var W,C,$,N,i,v=f(()=>{"use strict";W=require("@stackshift-ui/stats-card")});var Z={};c(Z,{Statistics:()=>q,Statistics_A:()=>u,Statistics_B:()=>x});module.exports=M(Z);var s=require("react"),X={variant_a:(0,s.lazy)(()=>Promise.resolve().then(()=>(S(),P))),variant_b:(0,s.lazy)(()=>Promise.resolve().then(()=>(g(),V))),variant_c:(0,s.lazy)(()=>Promise.resolve().then(()=>(v(),B)))},Y="Statistics",q=({data:r})=>{var t,n,y;let o=r==null?void 0:r.variant,e=o&&X[o],m={stats:(y=((t=r==null?void 0:r.variants)==null?void 0:t.stats)||((n=r==null?void 0:r.variants)==null?void 0:n.statItems))!=null?y:void 0};return e?(0,i.jsx)(e,{...m}):null};q.displayName=Y;S();g();v();0&&(module.exports={Statistics,Statistics_A,Statistics_B});
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- "use strict";import{a as e}from"./chunk-52NKRKG2.mjs";import{a as o}from"./chunk-N6STCBAI.mjs";import{a as r}from"./chunk-SIU35F2O.mjs";import"./chunk-JNZ3MG4R.mjs";export{e as Statistics,o as Statistics_A,r as Statistics_B};
2
+ "use strict";import{a as e}from"./chunk-FSZDIJ2E.mjs";import{a as o}from"./chunk-N6STCBAI.mjs";import{a as r}from"./chunk-SIU35F2O.mjs";import"./chunk-JNZ3MG4R.mjs";export{e as Statistics,o as Statistics_A,r as Statistics_B};
@@ -1 +1 @@
1
- "use strict";var D=Object.create;var p=Object.defineProperty;var E=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var f=(r,o)=>()=>(r&&(o=r(r=0)),o);var c=(r,o)=>{for(var e in o)p(r,e,{get:o[e],enumerable:!0})},S=(r,o,e,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of G(o))!J.call(r,t)&&t!==e&&p(r,t,{get:()=>o[t],enumerable:!(m=E(o,t))||m.enumerable});return r};var K=(r,o,e)=>(e=r!=null?D(H(r)):{},S(o||!r||!r.__esModule?p(e,"default",{value:r,enumerable:!0}):e,r)),L=r=>S(p({},"__esModule",{value:!0}),r);var b={};c(b,{Statistics_A:()=>w,default:()=>w});function w({stats:r}){return(0,i.jsx)(y.Section,{className:"py-20 bg-background",children:(0,i.jsx)(x.Container,{maxWidth:1280,children:(0,i.jsx)(g.Flex,{wrap:!0,align:"center",justify:"start",className:"text-center",children:(0,i.jsx)(M,{stats:r})})})})}function M({stats:r}){return r?(0,i.jsx)(d.default.Fragment,{children:r.map((o,e)=>(0,i.jsx)("div",{className:"w-full px-4 my-8 sm:w-1/4 lg:w-1/4",children:(0,i.jsxs)(u.Card,{className:"relative py-10 ",children:[(0,i.jsx)(v.Text,{className:"mb-1 text-primary overflow-ellipsis overflow-clip",children:o==null?void 0:o.label}),(0,i.jsx)("p",{className:"text-xl text-gray-500 font-bold lg:text-2xl overflow-ellipsis overflow-clip",children:o==null?void 0:o.value})]})},e))}):null}var u,x,g,y,v,d,i,N=f(()=>{"use strict";u=require("@stackshift-ui/card"),x=require("@stackshift-ui/container"),g=require("@stackshift-ui/flex"),y=require("@stackshift-ui/section"),v=require("@stackshift-ui/text"),d=K(require("react")),i=require("react/jsx-runtime")});var _={};c(_,{Statistics_B:()=>k,default:()=>k});function k({stats:r}){return(0,i.jsx)(y.Section,{className:"py-20 bg-background",children:(0,i.jsx)(x.Container,{maxWidth:1280,children:(0,i.jsx)(O,{stats:r})})})}function O({stats:r}){return r?(0,i.jsx)(g.Flex,{wrap:!0,align:"center",direction:"col",className:"sm:justify-left sm:flex-row",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(I.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4 lg:justify-center",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var I,y,x,g,i,h=f(()=>{"use strict";I=require("@stackshift-ui/stats-card")});var z={};c(z,{default:()=>$});function $({stats:r}){return(0,i.jsx)(y.Section,{className:"py-20 bg-background",children:(0,i.jsx)(x.Container,{maxWidth:1280,children:(0,i.jsx)(Q,{stats:r})})})}function Q({stats:r}){return r?(0,i.jsx)(g.Flex,{wrap:!0,align:"center",className:"text-center ",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(R.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4",variant:"stacked",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var R,y,x,g,i,A=f(()=>{"use strict";R=require("@stackshift-ui/stats-card")});var Y={};c(Y,{Statistics:()=>B});module.exports=L(Y);var s=require("react"),U={variant_a:(0,s.lazy)(()=>Promise.resolve().then(()=>(N(),b))),variant_b:(0,s.lazy)(()=>Promise.resolve().then(()=>(h(),_))),variant_c:(0,s.lazy)(()=>Promise.resolve().then(()=>(A(),z)))},X="Statistics",B=({data:r})=>{var t,n;let o=r==null?void 0:r.variant,e=o&&U[o],m={stats:(n=(t=r==null?void 0:r.variants)==null?void 0:t.stats)!=null?n:void 0};return e?(0,i.jsx)(e,{...m}):null};B.displayName=X;0&&(module.exports={Statistics});
1
+ "use strict";var E=Object.create;var p=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var J=Object.getPrototypeOf,K=Object.prototype.hasOwnProperty;var f=(r,o)=>()=>(r&&(o=r(r=0)),o);var c=(r,o)=>{for(var e in o)p(r,e,{get:o[e],enumerable:!0})},u=(r,o,e,m)=>{if(o&&typeof o=="object"||typeof o=="function")for(let t of H(o))!K.call(r,t)&&t!==e&&p(r,t,{get:()=>o[t],enumerable:!(m=G(o,t))||m.enumerable});return r};var L=(r,o,e)=>(e=r!=null?E(J(r)):{},u(o||!r||!r.__esModule?p(e,"default",{value:r,enumerable:!0}):e,r)),M=r=>u(p({},"__esModule",{value:!0}),r);var N={};c(N,{Statistics_A:()=>I,default:()=>I});function I({stats:r}){return(0,i.jsx)(y.Section,{className:"py-20 bg-background",children:(0,i.jsx)(g.Container,{maxWidth:1280,children:(0,i.jsx)(v.Flex,{wrap:!0,align:"center",justify:"start",className:"text-center",children:(0,i.jsx)(O,{stats:r})})})})}function O({stats:r}){return r?(0,i.jsx)(b.default.Fragment,{children:r.map((o,e)=>(0,i.jsx)("div",{className:"w-full px-4 my-8 sm:w-1/4 lg:w-1/4",children:(0,i.jsxs)(x.Card,{className:"relative py-10 ",children:[(0,i.jsx)(w.Text,{className:"mb-1 text-primary overflow-ellipsis overflow-clip",children:o==null?void 0:o.label}),(0,i.jsx)("p",{className:"text-xl text-gray-500 font-bold lg:text-2xl overflow-ellipsis overflow-clip",children:o==null?void 0:o.value})]})},e))}):null}var x,g,v,y,w,b,i,C=f(()=>{"use strict";x=require("@stackshift-ui/card"),g=require("@stackshift-ui/container"),v=require("@stackshift-ui/flex"),y=require("@stackshift-ui/section"),w=require("@stackshift-ui/text"),b=L(require("react")),i=require("react/jsx-runtime")});var h={};c(h,{Statistics_B:()=>_,default:()=>_});function _({stats:r}){return(0,i.jsx)(y.Section,{className:"py-20 bg-background",children:(0,i.jsx)(g.Container,{maxWidth:1280,children:(0,i.jsx)(Q,{stats:r})})})}function Q({stats:r}){return r?(0,i.jsx)(v.Flex,{wrap:!0,align:"center",direction:"col",className:"sm:justify-left sm:flex-row",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(d.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4 lg:justify-center",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var d,y,g,v,i,R=f(()=>{"use strict";d=require("@stackshift-ui/stats-card")});var A={};c(A,{default:()=>z});function z({stats:r}){return(0,i.jsx)(y.Section,{className:"py-20 bg-background",children:(0,i.jsx)(g.Container,{maxWidth:1280,children:(0,i.jsx)(U,{stats:r})})})}function U({stats:r}){return r?(0,i.jsx)($.Flex,{wrap:!0,align:"center",className:"text-center ",children:r==null?void 0:r.map((o,e)=>{var m,t,n;return(0,i.jsx)(V.StatsCard,{className:"my-8 md:w-1/2 lg:w-1/4",variant:"stacked",value:(m=o==null?void 0:o.value)!=null?m:"",label:(t=o==null?void 0:o.label)!=null?t:"",icon:`${(n=o==null?void 0:o.mainImage)==null?void 0:n.image}`},e)})}):null}var V,y,g,$,i,B=f(()=>{"use strict";V=require("@stackshift-ui/stats-card")});var Z={};c(Z,{Statistics:()=>q});module.exports=M(Z);var s=require("react"),X={variant_a:(0,s.lazy)(()=>Promise.resolve().then(()=>(C(),N))),variant_b:(0,s.lazy)(()=>Promise.resolve().then(()=>(R(),h))),variant_c:(0,s.lazy)(()=>Promise.resolve().then(()=>(B(),A)))},Y="Statistics",q=({data:r})=>{var t,n,S;let o=r==null?void 0:r.variant,e=o&&X[o],m={stats:(S=((t=r==null?void 0:r.variants)==null?void 0:t.stats)||((n=r==null?void 0:r.variants)==null?void 0:n.statItems))!=null?S:void 0};return e?(0,i.jsx)(e,{...m}):null};q.displayName=Y;0&&(module.exports={Statistics});
@@ -1 +1 @@
1
- import{a}from"./chunk-52NKRKG2.mjs";export{a as Statistics};
1
+ import{a}from"./chunk-FSZDIJ2E.mjs";export{a as Statistics};
package/dist/types.d.ts CHANGED
@@ -211,6 +211,7 @@ export interface Variants {
211
211
  youtubeLink?: string | null;
212
212
  banner?: any;
213
213
  stats?: StatItems[] | null;
214
+ statItems?: StatItems[] | null;
214
215
  teams?: Team[] | null;
215
216
  testimonials?: Testimonial[] | null;
216
217
  selectStripeAccount?: string;
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@stackshift-ui/statistics",
3
3
  "description": "",
4
- "version": "6.0.3",
4
+ "version": "6.0.4",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "main": "./dist/index.js",
8
8
  "module": "./dist/index.mjs",
9
9
  "types": "./dist/index.d.ts",
10
10
  "files": [
11
- "dist/**"
11
+ "dist/**",
12
+ "src"
12
13
  ],
13
14
  "author": "WebriQ <info@webriq.com>",
14
15
  "devDependencies": {
@@ -28,20 +29,20 @@
28
29
  "typescript": "^5.6.2",
29
30
  "vite-tsconfig-paths": "^5.0.1",
30
31
  "vitest": "^2.1.1",
31
- "@stackshift-ui/typescript-config": "6.0.2",
32
- "@stackshift-ui/eslint-config": "6.0.2"
32
+ "@stackshift-ui/eslint-config": "6.0.2",
33
+ "@stackshift-ui/typescript-config": "6.0.2"
33
34
  },
34
35
  "dependencies": {
35
36
  "classnames": "^2.5.1",
36
37
  "@stackshift-ui/scripts": "6.0.2",
37
- "@stackshift-ui/system": "6.0.2",
38
- "@stackshift-ui/stats-card": "6.0.2",
39
- "@stackshift-ui/card": "6.0.2",
40
- "@stackshift-ui/button": "6.0.2",
41
- "@stackshift-ui/text": "6.0.2",
42
- "@stackshift-ui/container": "6.0.2",
43
- "@stackshift-ui/section": "6.0.2",
44
- "@stackshift-ui/flex": "6.0.2"
38
+ "@stackshift-ui/system": "6.0.3",
39
+ "@stackshift-ui/card": "6.0.3",
40
+ "@stackshift-ui/button": "6.0.3",
41
+ "@stackshift-ui/text": "6.0.3",
42
+ "@stackshift-ui/stats-card": "6.0.3",
43
+ "@stackshift-ui/container": "6.0.3",
44
+ "@stackshift-ui/flex": "6.0.3",
45
+ "@stackshift-ui/section": "6.0.3"
45
46
  },
46
47
  "peerDependencies": {
47
48
  "@types/react": "16.8 - 19",
package/src/index.ts ADDED
@@ -0,0 +1,7 @@
1
+ "use client";
2
+
3
+ // component exports
4
+ export * from "./statistics";
5
+ export * from "./statistics_a";
6
+ export * from "./statistics_b";
7
+ export * from "./statistics_c";
@@ -0,0 +1,13 @@
1
+ import { cleanup, render, screen } from "@testing-library/react";
2
+ import { afterEach, describe, test } from "vitest";
3
+ import { Statistics } from "./statistics";
4
+
5
+ describe.concurrent("statistics", () => {
6
+ afterEach(cleanup);
7
+
8
+ test.skip("Dummy test - test if renders without errors", ({ expect }) => {
9
+ const clx = "my-class";
10
+ render(<Statistics />);
11
+ expect(screen.getByTestId("{ kebabCase name }}").classList).toContain(clx);
12
+ });
13
+ });
@@ -0,0 +1,27 @@
1
+ import { lazy } from "react";
2
+ import { SectionsProps, StatItems } from "./types";
3
+
4
+ const Variants = {
5
+ variant_a: lazy(() => import("./statistics_a")),
6
+ variant_b: lazy(() => import("./statistics_b")),
7
+ variant_c: lazy(() => import("./statistics_c")),
8
+ };
9
+
10
+ export interface StatsProps {
11
+ stats?: StatItems[];
12
+ }
13
+
14
+ const displayName = "Statistics";
15
+
16
+ export const Statistics: React.FC<SectionsProps> = ({ data }) => {
17
+ const variant = data?.variant;
18
+ const Variant = variant && Variants[variant as keyof typeof Variants];
19
+
20
+ const props = {
21
+ stats: (data?.variants?.stats || data?.variants?.statItems) ?? undefined,
22
+ };
23
+
24
+ return Variant ? <Variant {...props} /> : null;
25
+ };
26
+
27
+ Statistics.displayName = displayName;
@@ -0,0 +1,43 @@
1
+ import { Card } from "@stackshift-ui/card";
2
+ import { Container } from "@stackshift-ui/container";
3
+ import { Flex } from "@stackshift-ui/flex";
4
+ import { Section } from "@stackshift-ui/section";
5
+ import { Text } from "@stackshift-ui/text";
6
+ import React from "react";
7
+ import { StatsProps } from ".";
8
+ import { StatItems } from "./types";
9
+
10
+ export default function Statistics_A({ stats }: StatsProps) {
11
+ return (
12
+ <Section className="py-20 bg-background">
13
+ <Container maxWidth={1280}>
14
+ <Flex wrap align="center" justify="start" className="text-center">
15
+ <StatisticsItems stats={stats} />
16
+ </Flex>
17
+ </Container>
18
+ </Section>
19
+ );
20
+ }
21
+
22
+ function StatisticsItems({ stats }: { stats?: StatItems[] }) {
23
+ if (!stats) return null;
24
+
25
+ return (
26
+ <React.Fragment>
27
+ {stats.map((items, index) => (
28
+ <div className="w-full px-4 my-8 sm:w-1/4 lg:w-1/4" key={index}>
29
+ <Card className="relative py-10 ">
30
+ <Text className="mb-1 text-primary overflow-ellipsis overflow-clip">
31
+ {items?.label}
32
+ </Text>
33
+ <p className="text-xl text-gray-500 font-bold lg:text-2xl overflow-ellipsis overflow-clip">
34
+ {items?.value}
35
+ </p>
36
+ </Card>
37
+ </div>
38
+ ))}
39
+ </React.Fragment>
40
+ );
41
+ }
42
+
43
+ export { Statistics_A };
@@ -0,0 +1,36 @@
1
+ import { StatsCard } from "@stackshift-ui/stats-card";
2
+ import { Section } from "@stackshift-ui/section";
3
+ import { Container } from "@stackshift-ui/container";
4
+ import { Flex } from "@stackshift-ui/flex";
5
+ import { StatItems } from "./types";
6
+ import { StatsProps } from ".";
7
+
8
+ export default function Statistics_B({ stats }: StatsProps) {
9
+ return (
10
+ <Section className="py-20 bg-background">
11
+ <Container maxWidth={1280}>
12
+ <StatisticsItems stats={stats} />
13
+ </Container>
14
+ </Section>
15
+ );
16
+ }
17
+
18
+ function StatisticsItems({ stats }: { stats?: StatItems[] }) {
19
+ if (!stats) return null;
20
+
21
+ return (
22
+ <Flex wrap align="center" direction="col" className="sm:justify-left sm:flex-row">
23
+ {stats?.map((stat, index) => (
24
+ <StatsCard
25
+ key={index}
26
+ className="my-8 md:w-1/2 lg:w-1/4 lg:justify-center"
27
+ value={stat?.value ?? ""}
28
+ label={stat?.label ?? ""}
29
+ icon={`${stat?.mainImage?.image}`}
30
+ />
31
+ ))}
32
+ </Flex>
33
+ );
34
+ }
35
+
36
+ export { Statistics_B };
@@ -0,0 +1,35 @@
1
+ import { StatsCard } from "@stackshift-ui/stats-card";
2
+ import { Section } from "@stackshift-ui/section";
3
+ import { Container } from "@stackshift-ui/container";
4
+ import { Flex } from "@stackshift-ui/flex";
5
+ import { StatItems } from "./types";
6
+ import { StatsProps } from ".";
7
+
8
+ export default function Statistics_C({ stats }: StatsProps) {
9
+ return (
10
+ <Section className="py-20 bg-background">
11
+ <Container maxWidth={1280}>
12
+ <StatisticsItems stats={stats} />
13
+ </Container>
14
+ </Section>
15
+ );
16
+ }
17
+
18
+ function StatisticsItems({ stats }: { stats?: StatItems[] }) {
19
+ if (!stats) return null;
20
+
21
+ return (
22
+ <Flex wrap align="center" className="text-center ">
23
+ {stats?.map((stat, index) => (
24
+ <StatsCard
25
+ key={index}
26
+ className="my-8 md:w-1/2 lg:w-1/4"
27
+ variant="stacked"
28
+ value={stat?.value ?? ""}
29
+ label={stat?.label ?? ""}
30
+ icon={`${stat?.mainImage?.image}`}
31
+ />
32
+ ))}
33
+ </Flex>
34
+ );
35
+ }
package/src/types.ts ADDED
@@ -0,0 +1,413 @@
1
+ export type StyleVariants<T extends string> = Record<T, string>;
2
+
3
+ export type Socials = "facebook" | "instagram" | "youtube" | "linkedin" | "twitter";
4
+ export interface MainImage {
5
+ image: string;
6
+ alt?: string;
7
+ }
8
+
9
+ export interface LabeledRoute extends ConditionalLink {
10
+ ariaLabel?: string;
11
+ label?: string;
12
+ linkTarget?: string;
13
+ linkType?: string;
14
+ _type?: string;
15
+ linkInternal?: any;
16
+ }
17
+ export interface ConditionalLink {
18
+ type?: string;
19
+ internalLink?: string | null;
20
+ externalLink?: string | null;
21
+ }
22
+
23
+ export interface StatItems {
24
+ label?: string;
25
+ mainImage?: MainImage;
26
+ value?: string;
27
+ _key?: string;
28
+ _type?: string;
29
+ }
30
+
31
+ export interface Logo extends ConditionalLink {
32
+ alt?: string;
33
+ linkTarget?: string;
34
+ image?: string;
35
+ }
36
+
37
+ export interface Images {
38
+ image?: string;
39
+ _key?: string;
40
+ _type?: string;
41
+ alt?: string;
42
+ }
43
+
44
+ export interface ContactDetails {
45
+ addressInfo?: string;
46
+ contactInfo?: string;
47
+ emailInfo?: string;
48
+ _key?: string;
49
+ }
50
+
51
+ export interface SocialLink {
52
+ socialMedia?: string | null;
53
+ socialMediaLink?: string | null;
54
+ _key?: string | null;
55
+ _type?: string | null;
56
+ socialMediaIcon?: {
57
+ alt?: string;
58
+ image?: string;
59
+ } | null;
60
+ socialMediaPlatform?: string | null;
61
+ }
62
+
63
+ export interface LabeledRouteWithKey extends LabeledRoute {
64
+ _key?: string;
65
+ }
66
+
67
+ export interface ArrayOfImageTitleAndText {
68
+ mainImage?: {
69
+ alt?: string;
70
+ image?: string;
71
+ };
72
+ plainText?: string;
73
+ title?: string;
74
+ _key?: string;
75
+ _type?: string;
76
+ }
77
+
78
+ export interface FeaturedItem {
79
+ description?: string;
80
+ mainImage?: MainImage;
81
+ title?: string;
82
+ subtitle?: string;
83
+ _key?: string;
84
+ _type?: string;
85
+ }
86
+
87
+ export interface ArrayOfTitleAndText {
88
+ _key?: string;
89
+ plainText?: string;
90
+ title?: string;
91
+ }
92
+
93
+ export interface BlogPost extends SanityBody {
94
+ authors?: Author[] | null;
95
+ body?: any;
96
+ categories?: Category[] | null;
97
+ excerpt?: string | null;
98
+ link?: string | null;
99
+ mainImage?: string | null;
100
+ publishedAt?: string;
101
+ seo?: Seo | null;
102
+ slug?: SanitySlug | null;
103
+ title?: string;
104
+ }
105
+
106
+ export interface Seo {
107
+ _type?: string;
108
+ seoTitle?: string;
109
+ seoDescription?: string;
110
+ seoImage?: string;
111
+ seoKeywords?: string;
112
+ seoSynonyms?: string;
113
+ }
114
+
115
+ export interface SanitySlug {
116
+ current?: string;
117
+ _type?: "slug";
118
+ }
119
+
120
+ export interface SanityBody {
121
+ _createdAt?: string;
122
+ _id?: string;
123
+ _rev?: string;
124
+ _type?: string;
125
+ _updatedAt?: string;
126
+ }
127
+
128
+ export interface Author extends SanityBody {
129
+ link?: string | null;
130
+ bio?: string | null;
131
+ name?: string | null;
132
+ slug?: SanitySlug | null;
133
+ image?: string | null;
134
+ profile?: {
135
+ alt: string;
136
+ image: string;
137
+ } | null;
138
+ }
139
+
140
+ export interface Category extends SanityBody {
141
+ title?: string;
142
+ }
143
+
144
+ export interface Form {
145
+ id?: string | null;
146
+ buttonLabel?: string | null;
147
+ name?: string | null;
148
+ subtitle?: string | null;
149
+ fields?: FormFields[] | null;
150
+ thankYouPage?: ThankYouPage | null;
151
+ }
152
+
153
+ export interface FormFields {
154
+ name?: string;
155
+ placeholder?: string;
156
+ pricingType?: string;
157
+ type?: FormTypes;
158
+ _key?: string;
159
+ _type?: string;
160
+ isRequired?: boolean;
161
+ label?: string;
162
+ items?: string[];
163
+ }
164
+
165
+ export type FormTypes =
166
+ | "inputText"
167
+ | "inputEmail"
168
+ | "inputPassword"
169
+ | "inputNumber"
170
+ | "textarea"
171
+ | "inputFile"
172
+ | "inputRadio"
173
+ | "inputCheckbox"
174
+ | "inputSelect";
175
+
176
+ export interface ThankYouPage {
177
+ externalLink?: string | null;
178
+ internalLink?: string | null;
179
+ linkInternal?: any;
180
+ linkTarget?: string;
181
+ linkType?: string;
182
+ type?: string;
183
+ }
184
+
185
+ //Used on different sections
186
+ export interface SectionsProps {
187
+ template?: Template;
188
+ data?: Sections;
189
+ variant?: string | null | undefined;
190
+ schema?: Variants;
191
+ }
192
+
193
+ export interface Sections extends SanityBody {
194
+ label?: string;
195
+ variant?: string;
196
+ variants?: Variants;
197
+ _key?: string;
198
+ }
199
+
200
+ //*EDIT THIS SECTION WHEN CREATING/UPDATING SCHEMAS ON STUDIO */
201
+ export interface Variants {
202
+ template?: Template;
203
+ multipleMenus?: any;
204
+ arrayOfTitleAndText?: ArrayOfTitleAndText[] | null;
205
+ logo?: Logo | null;
206
+ primaryButton?: LabeledRoute | null;
207
+ secondaryButton?: LabeledRoute | null;
208
+ routes?: LabeledRouteWithKey[] | null;
209
+ menu?: LabeledRouteWithKey[] | null;
210
+ plans?: Plans[] | null;
211
+ formLinks?: LabeledRouteWithKey[] | null;
212
+ portfolios?: Portfolios[] | null;
213
+ portfoliosWithCategories?: PortfoliosWithCategories[] | null;
214
+ length?: number;
215
+ signInLink?: LabeledRoute | null;
216
+ signinLink?: LabeledRoute | null;
217
+ tags?: string[] | null;
218
+ posts?: BlogPost[] | null;
219
+ blogsPerPage?: number | null;
220
+ form?: Form | null;
221
+ collections?: Collection | null;
222
+ products?: CollectionProduct | null;
223
+ allProducts?: Collection[];
224
+ subtitle?: string | null;
225
+ caption?: string | null;
226
+ title?: string | null;
227
+ plainText?: string | null;
228
+ contactDescription?: string | null;
229
+ officeInformation?: string | null;
230
+ contactEmail?: string | null;
231
+ contactNumber?: string | null;
232
+ socialLinks?: SocialLink[] | null;
233
+ block?: any;
234
+ heading?: string | null;
235
+ acceptButtonLabel?: string | null;
236
+ declineButtonLabel?: string | null;
237
+ faqsWithCategories?: FaqsWithCategory[] | null;
238
+ faqs?: AskedQuestion[] | null;
239
+ arrayOfImageTitleAndText?: ArrayOfImageTitleAndText[] | null;
240
+ description?: string | null;
241
+ featuredItems?: FeaturedItem[] | null;
242
+ images?: Images[] | null;
243
+ contactDetails?: ContactDetails[] | null;
244
+ copyright?: string | null;
245
+ mainImage?: MainImage | null;
246
+ youtubeLink?: string | null;
247
+ banner?: any;
248
+ stats?: StatItems[] | null;
249
+ statItems?: StatItems[] | null;
250
+ teams?: Team[] | null;
251
+ testimonials?: Testimonial[] | null;
252
+ selectStripeAccount?: string;
253
+ annualBilling?: string;
254
+ monthlyBilling?: string;
255
+ productDetails?: ProductDetail[];
256
+ btnLabel?: string;
257
+ selectAccount?: string;
258
+ hashtags?: string[];
259
+ numberOfPosts?: number;
260
+ text?: string;
261
+ button?: LabeledRoute;
262
+ features?: string[];
263
+ config?: {
264
+ enableAnalytics: boolean;
265
+ cookiePolicy?: {
266
+ siteName: string;
267
+ cookiePolicyPage: Reference;
268
+ };
269
+ consentModalPosition?: string;
270
+ };
271
+ contactLink?: LabeledRoute;
272
+ }
273
+
274
+ export interface Template {
275
+ bg?: string;
276
+ color?: string;
277
+ }
278
+
279
+ export type Plans = {
280
+ _key?: string | null;
281
+ _type?: "planItems" | null;
282
+ checkoutButtonName?: string | null;
283
+ description?: string | null;
284
+ monthlyPrice?: string | null;
285
+ planType?: string | null;
286
+ yearlyPrice?: string | null;
287
+ planIncludes?: string[] | null;
288
+ primaryButton?: LabeledRoute | null;
289
+ } & Record<string, string>;
290
+
291
+ export interface Portfolios {
292
+ dateAdded?: string | null;
293
+ mainImage?: {
294
+ image?: string | null;
295
+ alt?: string | null;
296
+ } | null;
297
+ primaryButton?: LabeledRoute | null;
298
+ title?: string | null;
299
+ _key?: string | null;
300
+ _type?: string | null;
301
+ }
302
+
303
+ export interface PortfoliosWithCategories {
304
+ category?: string | null;
305
+ content?: Content[] | null;
306
+ primaryButton?: LabeledRoute | null;
307
+ _key?: string | null;
308
+ _type?: string | null;
309
+ }
310
+
311
+ export interface Content extends Portfolios {
312
+ description?: string | null;
313
+ subtitle?: string | null;
314
+ }
315
+
316
+ export interface Collection extends SanityBody {
317
+ collectionInfoVariant?: {
318
+ variant?: string;
319
+ } | null;
320
+ name?: string | null;
321
+ products?: CollectionProduct[] | null;
322
+ sections?: any; //todo
323
+ seo?: Seo | null;
324
+ slug?: SanitySlug | null;
325
+ }
326
+
327
+ export interface CollectionProduct extends SanityBody {
328
+ compareToPrice?: number | null;
329
+ description?: string | null;
330
+ ecwidProductId?: number | null;
331
+ name?: string | null;
332
+ price?: number | null;
333
+ productInfo?: ProductInfo | null;
334
+ productInfoVariant?: {
335
+ variant?: string;
336
+ } | null;
337
+ sections?: any; //todo
338
+ seo?: Seo | null;
339
+ slug?: SanitySlug | null;
340
+ }
341
+
342
+ //TODO, RECHECK PRODUCT INFO DATA FROM SANITY
343
+ interface ProductInfo {
344
+ btnLabel?: string | null;
345
+ images?: ProductInfoImage[] | null;
346
+ productDetails?: ProductDetail[] | null;
347
+ socialLinks?: SocialLink[] | null;
348
+ subtitle?: string | null;
349
+ }
350
+
351
+ //TODO, RECHECK PRODUCT INFO DATA FROM SANITY
352
+ export interface ProductDetail {
353
+ blockContent?: any;
354
+ contentType?: string;
355
+ tabName?: string;
356
+ _key?: string;
357
+ [key: string]: any;
358
+ }
359
+ interface ProductInfoImage {
360
+ alt?: string | null;
361
+ _key: string;
362
+ _type: string;
363
+ image?: string | null;
364
+ }
365
+
366
+ export interface FaqsWithCategory {
367
+ askedQuestions?: AskedQuestion[] | null;
368
+ category?: string | null;
369
+ _key?: string;
370
+ _type?: string;
371
+ }
372
+
373
+ export interface AskedQuestion {
374
+ answer?: string | null;
375
+ question?: string | null;
376
+ hidden?: boolean;
377
+ _key?: string;
378
+ _type?: string;
379
+ }
380
+
381
+ export interface Team {
382
+ jobTitle?: string;
383
+ mainImage?: MainImage;
384
+ name?: string;
385
+ plainText?: string;
386
+ _key?: string;
387
+ _type?: string;
388
+ }
389
+
390
+ export interface Testimonial {
391
+ jobTitle?: string;
392
+ mainImage?: MainImage;
393
+ name?: string;
394
+ rating?: string;
395
+ testimony?: string;
396
+ _key?: string;
397
+ _type?: string;
398
+ }
399
+
400
+ export declare interface Reference {
401
+ _type: string;
402
+ _ref: string;
403
+ _key?: string;
404
+ _weak?: boolean;
405
+ _strengthenOnPublish?: {
406
+ type: string;
407
+ weak?: boolean;
408
+ template?: {
409
+ id: string;
410
+ params: Record<string, string | number | boolean>;
411
+ };
412
+ };
413
+ }
@@ -1 +0,0 @@
1
- import{lazy as s}from"react";import{jsx as m}from"react/jsx-runtime";var p={variant_a:s(()=>import("./statistics_a.mjs")),variant_b:s(()=>import("./statistics_b.mjs")),variant_c:s(()=>import("./statistics_c.mjs"))},e="Statistics",c=({data:t})=>{var r,n;let i=t==null?void 0:t.variant,o=i&&p[i],a={stats:(n=(r=t==null?void 0:t.variants)==null?void 0:r.stats)!=null?n:void 0};return o?m(o,{...a}):null};c.displayName=e;export{c as a};