@stackshift-ui/footer 6.0.13 → 6.1.0

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/src/types.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import { PortableTextComponents } from "@portabletext/react";
2
+
1
3
  export type StyleVariants<T extends string> = Record<T, string>;
2
4
 
3
5
  export type Socials = "facebook" | "instagram" | "youtube" | "linkedin" | "twitter";
@@ -6,6 +8,74 @@ export interface MainImage {
6
8
  alt?: string;
7
9
  }
8
10
 
11
+ export interface MegaMenu {
12
+ _type: string;
13
+ showcaseLink?: ShowcaseLink[];
14
+ links?: MegaMenuLink[];
15
+ _key: string;
16
+ title?: string;
17
+ groupOfLinks?: GroupOfLink[];
18
+ label?: string;
19
+ linkTarget?: string;
20
+ linkType?: string;
21
+ url?: string;
22
+ linkExternal?: string;
23
+ }
24
+
25
+ export interface Logo extends ConditionalLink {
26
+ alt?: string;
27
+ linkTarget?: string;
28
+ image?: string;
29
+ }
30
+
31
+ export interface Logos {
32
+ logo: Logo[];
33
+ }
34
+
35
+ export interface GroupOfLink {
36
+ _type: string;
37
+ links: GroupOfLinkRoot[];
38
+ _key: string;
39
+ title: string;
40
+ primaryButton: LabeledRouteWithKey;
41
+ }
42
+
43
+ export interface GroupOfLinkRoot {
44
+ title: string;
45
+ _type: string;
46
+ label?: string;
47
+ links: LabeledRouteWithKey[];
48
+ _key: string;
49
+ }
50
+ export interface MegaMenu {
51
+ _type: string;
52
+ showcaseLink?: ShowcaseLink[];
53
+ links?: MegaMenuLink[];
54
+ _key: string;
55
+ title?: string;
56
+ groupOfLinks?: GroupOfLink[];
57
+ label?: string;
58
+ linkTarget?: string;
59
+ linkType?: string;
60
+ url?: string;
61
+ }
62
+
63
+ export interface ShowcaseLink {
64
+ mainImage: MainImage;
65
+ _type: string;
66
+ primaryButton: LabeledRouteWithKey;
67
+ _key: string;
68
+ }
69
+
70
+ export interface MegaMenuLink {
71
+ _key: string;
72
+ title: string;
73
+ _type: string;
74
+ links: LabeledRouteWithKey[];
75
+ primaryButton: LabeledRouteWithKey;
76
+ label: string;
77
+ }
78
+
9
79
  export interface LabeledRoute extends ConditionalLink {
10
80
  ariaLabel?: string;
11
81
  label?: string;
@@ -13,6 +83,10 @@ export interface LabeledRoute extends ConditionalLink {
13
83
  linkType?: string;
14
84
  _type?: string;
15
85
  linkInternal?: any;
86
+ linkExternal?: any;
87
+ referenceType?: string;
88
+ multipleRoutes?: LabeledRouteWithKey[];
89
+ multipleInnerRoutes?: LabeledRouteWithKey[];
16
90
  }
17
91
  export interface ConditionalLink {
18
92
  type?: string;
@@ -28,10 +102,15 @@ export interface StatItems {
28
102
  _type?: string;
29
103
  }
30
104
 
31
- export interface Logo extends ConditionalLink {
105
+ export interface Logo {
32
106
  alt?: string;
33
107
  linkTarget?: string;
34
108
  image?: string;
109
+ type?: string;
110
+ internalLink?: string;
111
+ externalLink?: string;
112
+ linkExternal?: string;
113
+ linkInternal?: string;
35
114
  }
36
115
 
37
116
  export interface Images {
@@ -62,6 +141,17 @@ export interface SocialLink {
62
141
 
63
142
  export interface LabeledRouteWithKey extends LabeledRoute {
64
143
  _key?: string;
144
+ image?: string;
145
+ alt?: string;
146
+ multipleRoutes?: LabeledRouteWithKey[];
147
+ featuredRoute?: {
148
+ featuredLink: LabeledRoute;
149
+ mainImage: {
150
+ image: string;
151
+ alt: string;
152
+ };
153
+ };
154
+ routeType?: string;
65
155
  }
66
156
 
67
157
  export interface ArrayOfImageTitleAndText {
@@ -201,12 +291,17 @@ export interface Sections extends SanityBody {
201
291
  export interface Variants {
202
292
  template?: Template;
203
293
  multipleMenus?: any;
294
+ multipleLinks?: any;
295
+ megaMenu?: MegaMenu[];
204
296
  arrayOfTitleAndText?: ArrayOfTitleAndText[] | null;
205
297
  logo?: Logo | null;
298
+ logos?: Logos[] | null;
206
299
  primaryButton?: LabeledRoute | null;
207
300
  secondaryButton?: LabeledRoute | null;
208
301
  routes?: LabeledRouteWithKey[] | null;
209
302
  menu?: LabeledRouteWithKey[] | null;
303
+ dropdownMenu?: LabeledRouteWithKey[] | null;
304
+ iconLinks?: LabeledRouteWithKey[] | null;
210
305
  plans?: Plans[] | null;
211
306
  formLinks?: LabeledRouteWithKey[] | null;
212
307
  portfolios?: Portfolios[] | null;
@@ -230,6 +325,7 @@ export interface Variants {
230
325
  contactEmail?: string | null;
231
326
  contactNumber?: string | null;
232
327
  socialLinks?: SocialLink[] | null;
328
+ socialMedia?: SocialLink[] | null;
233
329
  block?: any;
234
330
  heading?: string | null;
235
331
  acceptButtonLabel?: string | null;
@@ -410,3 +506,24 @@ export declare interface Reference {
410
506
  };
411
507
  };
412
508
  }
509
+
510
+ export type MyPortableTextComponents = PortableTextComponents & {
511
+ code?: ({ value }: { value: { language?: string; code?: string } }) => JSX.Element;
512
+ };
513
+
514
+ export interface ConditionalLinkTypes {
515
+ className?: string;
516
+ ariaLabel: string; // required for A11Y
517
+ style?: any;
518
+ children: string | React.ReactNode;
519
+ link: LabeledRoute | LabeledRouteWithKey | undefined;
520
+ target?: string;
521
+ }
522
+
523
+ export interface IconLink {
524
+ _key: string;
525
+ image: string;
526
+ alt?: string;
527
+ linkExternal: string;
528
+ linkTarget?: "_blank" | "_self";
529
+ }
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-FWXIR5AI.mjs";import{Button as u}from"@stackshift-ui/button";import{Container as p}from"@stackshift-ui/container";import{Flex as l}from"@stackshift-ui/flex";import{Image as f}from"@stackshift-ui/image";import{Link as c}from"@stackshift-ui/link";import{Section as o}from"@stackshift-ui/section";import{SocialIcons as s}from"@stackshift-ui/social-icons";import{Text as b}from"@stackshift-ui/text";import{jsx as r,jsxs as n}from"react/jsx-runtime";function x({logo:e,menu:t,copyright:a,socialMedia:i}){return n(o,{className:"bg-background",children:[r(h,{}),r(p,{maxWidth:1e3,children:n("div",{className:"pt-10 pb-12",children:[n(l,{justify:"between",align:"center",className:"relative flex-col gap-8 mb-8 md:flex-row lg:border-b lg:border-gray-300 lg:pb-8",children:[r(y,{copyright:a}),r(w,{menu:t}),r(N,{logo:e})]}),r(g,{socialMedia:i})]})})]})}function y({copyright:e}){return e?r(b,{className:"w-full text-sm text-center",children:e}):null}function N({logo:e}){var t;return e!=null&&e.image?r("div",{className:"w-full text-center",children:r(c,{className:"inline-block text-xl font-bold leading-none","aria-label":m(e)==="/"?"Go to home page":`Go to ${m(e)}`,href:m(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:r(f,{src:e==null?void 0:e.image,alt:(t=e==null?void 0:e.alt)!=null?t:"footer-logo",className:"inline-block text-xl font-bold leading-none",width:64,height:64})})}):null}function w({menu:e}){return e?r("div",{className:"mx-auto",children:r(l,{className:"flex-col gap-4 lg:flex-row lg:gap-10",as:"ul",align:"center",justify:"center",children:e==null?void 0:e.map((t,a)=>r(v,{links:t,index:a}))})}):null}function v({links:e,index:t}){return e?r("li",{className:"w-full text-center",children:r(u,{as:"link",link:e,className:"text-sm text-center text-black no-underline hover:text-gray-500 whitespace-nowrap",ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label})},t):null}function g({socialMedia:e}){return e?r(l,{wrap:!0,justify:"center",align:"center",className:"gap-5",children:e==null?void 0:e.map((t,a)=>r(L,{social:t},a))}):null}function L({social:e}){var t,a,i,d;return e!=null&&e.socialMediaLink?r(c,{"aria-label":(e==null?void 0:e.socialMedia)||(e==null?void 0:e.socialMediaPlatform)||"",className:"rounded w-6 h-6 flex items-center",target:"_blank",rel:"noopener noreferrer",href:e==null?void 0:e.socialMediaLink,children:(t=e==null?void 0:e.socialMediaIcon)!=null&&t.image?r(f,{className:"w-full h-full object-contain",src:`${(a=e==null?void 0:e.socialMediaIcon)==null?void 0:a.image}`,width:56,height:56,alt:(d=(i=e==null?void 0:e.socialMediaIcon)==null?void 0:i.alt)!=null?d:"contact-socialMedia-icon"}):r(s,{social:e==null?void 0:e.socialMedia})}):null}function h(){return n("div",{className:"flex w-full",children:[n("div",{className:"flex w-1/3",children:[r("div",{className:"w-1/3 py-1 bg-secondary"}),r("div",{className:"w-1/3 py-1 bg-primary"}),r("div",{className:"w-1/3 py-1 bg-primary"})]}),n("div",{className:"flex w-1/3",children:[r("div",{className:"w-1/3 py-1 bg-secondary"}),r("div",{className:"w-1/3 py-1 bg-primary"}),r("div",{className:"w-1/3 py-1 bg-primary"})]}),n("div",{className:"flex w-1/3",children:[r("div",{className:"w-1/3 py-1 bg-secondary"}),r("div",{className:"w-1/3 py-1 bg-primary"}),r("div",{className:"w-1/3 py-1 bg-primary"})]})]})}export{x as a};
@@ -1 +0,0 @@
1
- var i=n=>{var e,r,t;return n!=null&&n.internalLink&&(n==null?void 0:n.type)==="linkInternal"?(r=(e=n==null?void 0:n.internalLink)==null?void 0:e.toLowerCase())!=null&&r.includes("home")?"/":`/${n.internalLink}`:n!=null&&n.externalLink&&(n==null?void 0:n.type)==="linkExternal"&&(t=n==null?void 0:n.externalLink)!=null?t:"/"};export{i as a};
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-FWXIR5AI.mjs";import{Button as w}from"@stackshift-ui/button";import{Container as o}from"@stackshift-ui/container";import{Flex as p}from"@stackshift-ui/flex";import{Image as s}from"@stackshift-ui/image";import{Link as c}from"@stackshift-ui/link";import{Section as h}from"@stackshift-ui/section";import{SocialIcons as v}from"@stackshift-ui/social-icons";import{Text as d}from"@stackshift-ui/text";import{jsx as t,jsxs as n}from"react/jsx-runtime";function y({logo:e,multipleMenus:r,copyright:a,socialMedia:i,text:f}){return t(h,{className:"py-20 overflow-hidden bg-background",children:n(o,{maxWidth:1280,children:[n("div",{className:"flex flex-col lg:flex-row w-full gap-5 lg:items-center lg:justify-between xl:items-start",children:[n("div",{className:"w-full lg:max-w-sm xl:max-w-xs space-y-4",children:[t(u,{logo:e}),t(N,{text:f})]}),t("div",{className:"flex flex-col space-y-8 lg:space-y-0",children:t("div",{className:"flex flex-col lg:flex-row w-full justify-between items-start lg:items-center",children:t(b,{multipleMenus:r})})}),t("div",{className:"hidden [@media(min-width:1444px)]:block",children:t(x,{socialMedia:i})})]}),t("div",{className:"hidden [@media(min-width:1444px)]:block items-center",children:t(l,{copyright:a})}),n("div",{className:"flex flex-col sm:flex-row w-full sm:items-center sm:justify-between pt-10 gap-5 [@media(min-width:1444px)]:hidden",children:[t(l,{copyright:a}),t(x,{socialMedia:i})]})]})})}function u({logo:e}){var r;return e!=null&&e.image?t(c,{className:"w-40 h-14 flex items-center","aria-label":m(e)==="/"?"Go to home page":`Go to ${m(e)}`,href:m(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:t(s,{className:"w-fit h-full object-contain",src:`${e==null?void 0:e.image}`,sizes:"(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw",alt:(r=e==null?void 0:e.alt)!=null?r:"footer-logo"})}):null}function N({text:e}){return e?t(d,{muted:!0,className:"leading-normal",children:e}):null}function l({copyright:e}){return e?t(d,{className:"lg:pt-10 text-sm",children:e}):null}function b({multipleMenus:e}){return e?t("div",{className:"flex flex-col sm:flex-row flex-wrap gap-5",children:e==null?void 0:e.map(r=>t(L,{menu:r},r==null?void 0:r._key))}):null}function L({menu:e}){var r,a;return e?n("div",{className:"min-w-[140px]",children:[(e==null?void 0:e.title)&&t(d,{weight:"bold",className:"mb-3",children:e==null?void 0:e.title}),((r=e==null?void 0:e.links)==null?void 0:r.length)>0&&t(p,{as:"ul",direction:"col",className:"space-y-2",children:(a=e==null?void 0:e.links)==null?void 0:a.map(i=>t("li",{children:t(w,{as:"link",link:i,className:"text-gray-500 no-underline hover:text-gray-700",ariaLabel:i==null?void 0:i.label,children:i==null?void 0:i.label})},i==null?void 0:i._key))})]}):null}function x({socialMedia:e}){return e?t(p,{className:"flex flex-wrap flex-row [@media(min-width:240px)]:items-center sm:space-x-4",gap:2,children:e==null?void 0:e.map(r=>(r==null?void 0:r.socialMediaLink)&&t(g,{social:r},r==null?void 0:r._key))}):null}function g({social:e}){var r,a,i,f;return e!=null&&e.socialMediaLink?t(c,{"aria-label":(e==null?void 0:e.socialMedia)||(e==null?void 0:e.socialMediaPlatform)||"",className:"rounded w-6 h-6 flex items-center",target:"_blank",rel:"noopener noreferrer",href:e==null?void 0:e.socialMediaLink,children:(r=e==null?void 0:e.socialMediaIcon)!=null&&r.image?t(s,{className:"w-full h-full object-contain",src:`${(a=e==null?void 0:e.socialMediaIcon)==null?void 0:a.image}`,width:56,height:56,alt:(f=(i=e==null?void 0:e.socialMediaIcon)==null?void 0:i.alt)!=null?f:"contact-socialMedia-icon"}):t(v,{social:e==null?void 0:e.socialMedia})}):null}export{y as a};
@@ -1 +0,0 @@
1
- import{a as m}from"./chunk-FWXIR5AI.mjs";import{Button as p}from"@stackshift-ui/button";import{Container as l}from"@stackshift-ui/container";import{Flex as u}from"@stackshift-ui/flex";import{Image as d}from"@stackshift-ui/image";import{Link as o}from"@stackshift-ui/link";import{Section as b}from"@stackshift-ui/section";import{SocialIcons as L}from"@stackshift-ui/social-icons";import{Text as w}from"@stackshift-ui/text";import c from"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function h({logo:e,copyright:t,socialMedia:n,menu:a}){return r(b,{className:"py-20 bg-background",children:i(l,{maxWidth:1280,children:[i(u,{wrap:!0,align:"center",justify:"between",className:"pb-12 border-b border-gray-100",children:[r(x,{logo:e}),r(y,{menu:a})]}),i(u,{wrap:!0,className:"mt-8 justify-between items-start",children:[r(M,{copyright:t}),r(g,{socialMedia:n})]})]})})}function x({logo:e}){var t;return e!=null&&e.image?r("div",{className:"mb-8 xl:mb-0 w-full lg:w-1/5",children:r(o,{"aria-label":m(e)==="/"?"Go to home page":`Go to ${m(e)}`,className:"w-40 h-14 flex items-center",href:m(e),target:e==null?void 0:e.linkTarget,rel:(e==null?void 0:e.linkTarget)==="_blank"?"noopener noreferrer":"",children:r(d,{className:"w-full h-full ",src:e==null?void 0:e.image,alt:(t=e==null?void 0:e.alt)!=null?t:"footer-logo"})})}):null}function y({menu:e}){return e?r("div",{className:"w-full lg:w-auto",children:r(u,{wrap:!0,align:"center",justify:"between",as:"ul",gap:5,className:"mt-8",children:e==null?void 0:e.map((t,n,{length:a})=>i(c.Fragment,{children:[r(N,{links:t}),n+1!==a?r(s,{}):null]},(t==null?void 0:t._key)||n))})}):null}function N({links:e,index:t}){return e?r("li",{className:"w-full mb-2 md:mb-0 md:w-auto",children:r(p,{as:"link",link:e,className:"text-gray-500 no-underline lg:text-sm hover:text-gray-700",ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label})},t):null}function s(){return r("li",{className:"hidden md:block",children:r("svg",{className:"w-4 h-4 mx-4 text-gray-500",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 5v.01M12 12v.01M12 19v.01M12 6a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2zm0 7a1 1 0 110-2 1 1 0 010 2z"})})})}function M({copyright:e}){return e?r(w,{muted:!0,className:"order-last text-sm p-2",children:e}):null}function g({socialMedia:e}){return e?r("div",{className:"order-first mb-4 lg:order-last lg:mb-0",children:e==null?void 0:e.map(t=>r(k,{social:t}))}):null}function k({social:e}){var t,n,a,f;return e!=null&&e.socialMediaLink?r(o,{"aria-label":(e==null?void 0:e.socialMedia)||(e==null?void 0:e.socialMediaPlatform)||"",className:"inline-block p-2 rounded",target:"_blank",rel:"noopener noreferrer",href:e==null?void 0:e.socialMediaLink,children:(t=e==null?void 0:e.socialMediaIcon)!=null&&t.image?r(d,{className:"h-6",src:`${(n=e==null?void 0:e.socialMediaIcon)==null?void 0:n.image}`,width:24,height:24,alt:(f=(a=e==null?void 0:e.socialMediaIcon)==null?void 0:a.alt)!=null?f:"contact-socialMedia-icon"}):r(L,{social:e==null?void 0:e.socialMedia})},e==null?void 0:e._key):null}export{h as a};
@@ -1 +0,0 @@
1
- import{lazy as i}from"react";import{jsx as R}from"react/jsx-runtime";var k={variant_a:i(()=>import("./footer_a.mjs")),variant_b:i(()=>import("./footer_b.mjs")),variant_c:i(()=>import("./footer_c.mjs")),variant_d:i(()=>import("./footer_d.mjs"))},x="Footer",F=({data:n})=>{var r,s,t,c,l,p,u,m,v,f,y,g,L,h;let o=n==null?void 0:n.variant,e=o&&k[o],M={logo:(s=(r=n==null?void 0:n.variants)==null?void 0:r.logo)!=null?s:void 0,text:(c=(t=n==null?void 0:n.variants)==null?void 0:t.plainText)!=null?c:void 0,contacts:(p=(l=n==null?void 0:n.variants)==null?void 0:l.contactDetails)!=null?p:void 0,copyright:(m=(u=n==null?void 0:n.variants)==null?void 0:u.copyright)!=null?m:void 0,socialMedia:(f=(v=n==null?void 0:n.variants)==null?void 0:v.socialLinks)!=null?f:void 0,menu:(g=(y=n==null?void 0:n.variants)==null?void 0:y.menu)!=null?g:void 0,multipleMenus:(h=(L=n==null?void 0:n.variants)==null?void 0:L.multipleMenus)!=null?h:void 0};return e?R(e,{...M}):null};F.displayName=x;export{F as a};