@stackshift-ui/signin-signup 6.0.5 → 6.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,2 +1,675 @@
1
+ "use strict";
1
2
  "use client";
2
- "use strict";var ht=Object.create;var w=Object.defineProperty;var yt=Object.getOwnPropertyDescriptor;var wt=Object.getOwnPropertyNames;var vt=Object.getPrototypeOf,gt=Object.prototype.hasOwnProperty;var o=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>{for(var i in e)w(t,i,{get:e[i],enumerable:!0})},D=(t,e,i,p)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of wt(e))!gt.call(t,s)&&s!==i&&w(t,s,{get:()=>e[s],enumerable:!(p=yt(e,s))||p.enumerable});return t};var J=(t,e,i)=>(i=t!=null?ht(vt(t)):{},D(e||!t||!t.__esModule?w(i,"default",{value:t,enumerable:!0}):i,t)),ot=t=>D(w({},"__esModule",{value:!0}),t);var x,v,L=o(()=>{"use strict";x=t=>{var e,i,p;return t!=null&&t.internalLink&&(t==null?void 0:t.type)==="linkInternal"?(i=(e=t==null?void 0:t.internalLink)==null?void 0:e.toLowerCase())!=null&&i.includes("home")?"/":`/${t.internalLink}`:t!=null&&t.externalLink&&(t==null?void 0:t.type)==="linkExternal"&&(p=t==null?void 0:t.externalLink)!=null?p:"/"},v=t=>t?(t==null?void 0:t.linkType)==="linkInternal"?`/${t==null?void 0:t.internalLink}`:t==null?void 0:t.externalLink:"/thank-you"});var tt={};N(tt,{SigninSignup_A:()=>C,default:()=>C});function C({logo:t,form:e,formLinks:i,signInLink:p}){return(0,n.jsx)(I.Section,{className:"py-10 rounded-md bg-gray-50 lg:py-20",children:(0,n.jsxs)(S.Container,{maxWidth:576,children:[(0,n.jsx)(Nt,{logo:t}),(0,n.jsxs)(S.Container,{className:"mb-6 text-center lg:mb-10",children:[(0,n.jsx)(Lt,{form:e}),(0,n.jsx)(St,{form:e,signInLink:p,thankYouPage:v(e==null?void 0:e.thankYouPage)})]}),(0,n.jsx)(Ct,{formLinks:i})]})})}function Nt({logo:t}){var e;return t?(0,n.jsx)("div",{className:"mb-10",children:(0,n.jsx)(Z.Link,{"aria-label":`Go to ${x(t)==="/"?"home page":x(t)}`,className:"flex justify-center mx-auto text-3xl font-bold leading-none",href:x(t),target:t==null?void 0:t.linkTarget,rel:(t==null?void 0:t.linkTarget)==="_blank"?"noopener noreferrer":"",children:(0,n.jsx)(X.Image,{src:t==null?void 0:t.image,alt:(e=t==null?void 0:t.alt)!=null?e:"signup-logo",width:100,height:100,className:"flex justify-center mx-auto text-3xl font-bold leading-none"})})}):null}function Lt({form:t}){return(0,n.jsxs)("div",{className:"mb-6",children:[t!=null&&t.subtitle?(0,n.jsx)(F.Text,{muted:!0,children:t==null?void 0:t.subtitle}):null,t!=null&&t.name?(0,n.jsx)(Q.Heading,{className:"text-2xl lg:text-2xl",children:t==null?void 0:t.name}):null]})}function St({form:t,signInLink:e,thankYouPage:i}){var c,a;if(!(t!=null&&t.fields))return null;let[p,s]=f.default.useState({}),r=b=>{s(l=>({...l,[b]:!l[b]}))};return(0,n.jsxs)(O.Form,{id:(c=t==null?void 0:t.id)!=null?c:void 0,name:"SignUp-VariantA-Form",className:"form-signup",thankyouPage:i,children:[(0,n.jsx)(Pt,{form:t,showPasswords:p,togglePasswordVisibility:r}),(0,n.jsx)("div",{children:(0,n.jsx)("div",{className:"webriq-recaptcha"})}),(0,n.jsx)("div",{className:"text-center",children:(t==null?void 0:t.buttonLabel)&&(0,n.jsx)(h.Button,{as:"button",variant:"custom",ariaLabel:(a=t==null?void 0:t.buttonLabel)!=null?a:"Sign Up form submit button",className:"w-full py-4 text-sm font-bold tex-gray-50",type:"submit",children:t==null?void 0:t.buttonLabel})}),e&&(0,n.jsx)(Rt,{signInLink:e})]})}function Pt({form:t,showPasswords:e,togglePasswordVisibility:i}){var p,s;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(R.Flex,{wrap:!0,className:"-mx-2",children:(p=t==null?void 0:t.fields)==null?void 0:p.slice(0,2).map((r,c)=>{var a;return(0,n.jsx)("div",{className:"w-full px-2 mb-3 lg:w-1/2",children:r.type==="inputText"?(0,n.jsx)(m.Input,{textSize:"sm",variant:"primary",noLabel:!0,placeholder:r==null?void 0:r.placeholder,required:r==null?void 0:r.isRequired,className:"w-full py-4 text-xs bg-white",name:r==null?void 0:r.name,ariaLabel:r==null?void 0:r.label,...r,type:"text"}):(0,n.jsx)(P.FormField,{textSize:"sm",noLabel:!0,name:(a=r==null?void 0:r.name)!=null?a:"",...r})},c)})}),(s=t==null?void 0:t.fields)==null?void 0:s.slice(2).map((r,c)=>{var a;return(0,n.jsx)("div",{className:"my-3",children:r.type==="inputPassword"&&r.name?(0,n.jsx)(mt,{formFields:r,showPassword:e[r.name]||!1,togglePassword:()=>i(r.name)}):(0,n.jsx)(P.FormField,{className:"py-4",textSize:"sm",noLabel:!0,variant:"primary",placeholder:r==null?void 0:r.placeholder,required:r==null?void 0:r.isRequired,name:(a=r==null?void 0:r.name)!=null?a:"",items:r==null?void 0:r.items,type:r==null?void 0:r.type,...r})},c)})]})}function Rt({signInLink:t}){return t!=null&&t.label?(0,n.jsxs)("div",{className:"w-full text-center mt-3",children:[(0,n.jsx)("span",{className:"text-xs text-gray-500",children:"Already have an account? "}),(0,n.jsx)(h.Button,{as:"link",variant:"link",link:t,className:"text-xs text-primary cursor-pointer hover:underline",ariaLabel:t==null?void 0:t.label,children:t==null?void 0:t.label})]}):null}function mt({formFields:t,showPassword:e,togglePassword:i}){var p;return(0,n.jsxs)(R.Flex,{className:"relative",children:[(0,n.jsx)(m.Input,{className:"py-4",textSize:"sm",noLabel:!0,"aria-label":(p=t==null?void 0:t.placeholder)!=null?p:t==null?void 0:t.name,variant:"primary",type:e?"text":"password",placeholder:t==null?void 0:t.placeholder,name:t==null?void 0:t.name,required:t==null?void 0:t.isRequired}),(0,n.jsx)(h.Button,{as:"button",variant:"unstyled",ariaLabel:e?"Show password":"Hide password",className:"absolute top-0 right-0 h-full p-2",type:"button",onClick:i,children:(0,n.jsx)(dt,{showPassword:e})})]})}function Ct({formLinks:t}){return t?(0,n.jsx)("p",{className:"mt-10 text-xs text-center text-gray-700",children:t==null?void 0:t.map((e,i,{length:p})=>(0,n.jsxs)("span",{children:[(0,n.jsx)(h.Button,{as:"link",variant:"link",link:e,className:"text-xs text-primary cursor-pointer hover:underline",ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label}),i===p-1?null:i===p-2?(0,n.jsx)("span",{children:"\xA0and\xA0"}):(0,n.jsx)("span",{children:"\xA0,\xA0"})]},i))}):null}function dt({showPassword:t}){return(0,n.jsx)(n.Fragment,{children:t?(0,n.jsx)("svg",{className:"w-5 h-5 my-auto ml-4 text-gray-500",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 16 16",children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("path",{d:"M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755c-.165.165-.337.328-.517.486l.708.709z"}),(0,n.jsx)("path",{d:"M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299l.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"}),(0,n.jsx)("path",{d:"M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884l-12-12l.708-.708l12 12l-.708.708z"})]})}):(0,n.jsx)("svg",{className:"w-5 h-5 my-auto ml-4 text-gray-500",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 16 16",children:(0,n.jsxs)("g",{fill:"currentColor",children:[(0,n.jsx)("path",{d:"M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"}),(0,n.jsx)("path",{d:"M8 5.5a2.5 2.5 0 1 0 0 5a2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0a3.5 3.5 0 0 1-7 0z"})]})})})}var h,S,R,O,P,Q,X,m,Z,I,F,f,n,d=o(()=>{"use strict";h=require("@stackshift-ui/button"),S=require("@stackshift-ui/container"),R=require("@stackshift-ui/flex"),O=require("@stackshift-ui/form"),P=require("@stackshift-ui/form-field"),Q=require("@stackshift-ui/heading"),X=require("@stackshift-ui/image"),m=require("@stackshift-ui/input"),Z=require("@stackshift-ui/link"),I=require("@stackshift-ui/section"),F=require("@stackshift-ui/text"),f=J(require("react"));L();n=require("react/jsx-runtime")});var lt={};N(lt,{SigninSignup_B:()=>A,default:()=>A});function A({logo:t,form:e,formLinks:i,signInLink:p}){return(0,u.jsx)(I.Section,{className:"py-10 bg-primary lg:py-20",children:(0,u.jsx)(S.Container,{maxWidth:1280,children:(0,u.jsxs)(S.Container,{maxWidth:576,children:[(0,u.jsx)(zt,{logo:t}),(0,u.jsxs)(et.Card,{borderRadius:"md",className:"p-6 mb-6 bg-white lg:mb-10 lg:p-12",children:[(0,u.jsx)(Bt,{form:e}),(0,u.jsx)(At,{form:e,signInLink:p})]}),(0,u.jsx)(Ut,{formLinks:i})]})})})}function zt({logo:t}){var e;return t?(0,u.jsx)("div",{className:"mb-10",children:(0,u.jsx)(Z.Link,{"aria-label":`Go to ${x(t)==="/"?"home page":x(t)}`,className:"flex justify-center mx-auto text-3xl font-bold leading-none",href:x(t),target:t==null?void 0:t.linkTarget,rel:(t==null?void 0:t.linkTarget)==="_blank"?"noopener noreferrer":"",children:(0,u.jsx)(X.Image,{src:t==null?void 0:t.image,alt:(e=t==null?void 0:t.alt)!=null?e:"signup-logo",width:100,height:100,className:"flex justify-center text-3xl font-bold leading-none text-white"})})}):null}function Bt({form:t}){return(0,u.jsxs)("div",{className:"mb-6",children:[(0,u.jsx)(F.Text,{muted:!0,children:t==null?void 0:t.subtitle}),(0,u.jsx)(Q.Heading,{className:"text-2xl lg:text-2xl",children:t==null?void 0:t.name})]})}function At({form:t,signInLink:e}){var r;if(!(t!=null&&t.fields))return null;let[i,p]=g.default.useState({}),s=c=>{p(a=>({...a,[c]:!a[c]}))};return(0,u.jsxs)(O.Form,{id:(r=t==null?void 0:t.id)!=null?r:void 0,name:"SignUp-VariantB-Form",className:"form-signup",thankyouPage:v(t==null?void 0:t.thankYouPage),children:[(0,u.jsx)(Mt,{form:t,showPassword:i,togglePasswordVisibility:s}),(0,u.jsx)("div",{children:(0,u.jsx)("div",{className:"webriq-recaptcha"})}),(0,u.jsxs)("div",{className:"text-center",children:[(0,u.jsx)(Tt,{form:t}),(0,u.jsx)(Yt,{signInLink:e})]})]})}function Mt({form:t,showPassword:e,togglePasswordVisibility:i}){var p,s,r,c;return(0,u.jsxs)(g.default.Fragment,{children:[(0,u.jsx)(R.Flex,{className:"flex-col lg:flex-row gap-3",children:(s=(p=t==null?void 0:t.fields)==null?void 0:p.slice(0,2))==null?void 0:s.map((a,b)=>{var l;return(0,u.jsx)("div",{className:"w-full",children:(0,u.jsx)(P.FormField,{noLabel:!0,variant:"secondary",placeholder:a==null?void 0:a.placeholder,required:a==null?void 0:a.isRequired,name:(l=a==null?void 0:a.name)!=null?l:"",items:a==null?void 0:a.items,type:a==null?void 0:a.type,...a})},b)})}),(c=(r=t==null?void 0:t.fields)==null?void 0:r.slice(2))==null?void 0:c.map((a,b)=>{var l;return(0,u.jsx)("div",{className:"my-3",children:(a==null?void 0:a.type)==="inputPassword"&&a.name?(0,u.jsx)(qt,{formFields:a,showPassword:e[a.name]||!1,togglePassword:()=>i(a.name)}):(0,u.jsx)(P.FormField,{noLabel:!0,variant:"secondary",name:(l=a==null?void 0:a.name)!=null?l:"",placeholder:a==null?void 0:a.placeholder,required:a==null?void 0:a.isRequired,items:a==null?void 0:a.items,type:a==null?void 0:a.type,...a})},b)})]})}function qt({formFields:t,showPassword:e,togglePassword:i}){var p;return(0,u.jsxs)("div",{className:"flex",children:[(0,u.jsx)(m.Input,{noLabel:!0,ariaLabel:(p=t==null?void 0:t.placeholder)!=null?p:t==null?void 0:t.name,variant:"secondary",type:e?"text":"password",placeholder:t==null?void 0:t.placeholder,name:t==null?void 0:t.name,required:t==null?void 0:t.isRequired}),(0,u.jsx)(y.Button,{variant:"unstyled",as:"button",ariaLabel:e?"Show password":"Hide password",className:"focus:outline-none mr-4",type:"button",onClick:i,children:(0,u.jsx)(Vt,{showPassword:e})})]})}function Tt({form:t}){var e;return t!=null&&t.buttonLabel?(0,u.jsx)(y.Button,{as:"button",className:"w-full py-4 mb-3",ariaLabel:(e=t==null?void 0:t.buttonLabel)!=null?e:"Sign Up form submit button",variant:"custom",type:"submit",children:t==null?void 0:t.buttonLabel}):null}function Yt({signInLink:t}){return t!=null&&t.label?(0,u.jsxs)("span",{className:"text-xs text-gray-900",children:[(0,u.jsx)("span",{children:"Already have an account?"})," ",(0,u.jsx)(y.Button,{as:"link",variant:"link",link:t,className:"text-xs text-primary hover:underline",ariaLabel:t==null?void 0:t.label,children:t==null?void 0:t.label})]}):null}function Ut({formLinks:t}){return t?(0,u.jsx)("p",{className:"text-xs text-center text-secondary-foreground",children:t==null?void 0:t.map((e,i,{length:p})=>(0,u.jsxs)("span",{children:[(0,u.jsx)(y.Button,{as:"link",variant:"link",link:e,className:"text-xs underline text-secondary-foreground hover:text-gray-50",ariaLabel:e==null?void 0:e.label,children:e==null?void 0:e.label}),i===p-1?null:i===p-2?(0,u.jsx)("span",{children:"\xA0and\xA0"}):(0,u.jsx)("span",{children:"\xA0,\xA0"})]},i))}):null}function Vt({showPassword:t}){return(0,u.jsx)(g.default.Fragment,{children:t?(0,u.jsx)("svg",{className:"w-5 h-5 my-auto ml-4 text-gray-500",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 16 16",children:(0,u.jsxs)("g",{fill:"currentColor",children:[(0,u.jsx)("path",{d:"M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755c-.165.165-.337.328-.517.486l.708.709z"}),(0,u.jsx)("path",{d:"M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299l.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z"}),(0,u.jsx)("path",{d:"M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884l-12-12l.708-.708l12 12l-.708.708z"})]})}):(0,u.jsx)("svg",{className:"w-5 h-5 my-auto ml-4 text-gray-500",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",role:"img",width:"1em",height:"1em",preserveAspectRatio:"xMidYMid meet",viewBox:"0 0 16 16",children:(0,u.jsxs)("g",{fill:"currentColor",children:[(0,u.jsx)("path",{d:"M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z"}),(0,u.jsx)("path",{d:"M8 5.5a2.5 2.5 0 1 0 0 5a2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0a3.5 3.5 0 0 1-7 0z"})]})})})}var y,et,S,R,O,P,Q,X,m,Z,I,F,g,u,M=o(()=>{"use strict";y=require("@stackshift-ui/button"),et=require("@stackshift-ui/card"),g=J(require("react"));L();u=require("react/jsx-runtime")});var Ht={};N(Ht,{SigninSignup:()=>bt,SigninSignup_A:()=>C,SigninSignup_B:()=>A});module.exports=ot(Ht);var T=require("react"),xt=require("react/jsx-runtime"),q={variant_a:(0,T.lazy)(()=>Promise.resolve().then(()=>(d(),tt))),variant_b:(0,T.lazy)(()=>Promise.resolve().then(()=>(M(),lt)))},kt="SigninSignup",bt=({data:t})=>{var s,r,c,a,b,l,Y,U,V,k,H,W,_,K,$,G,j,E;let e=t==null?void 0:t.variant,i=e&&(q==null?void 0:q[e]),p={logo:(r=(s=t==null?void 0:t.variants)==null?void 0:s.logo)!=null?r:void 0,title:(a=(c=t==null?void 0:t.variants)==null?void 0:c.title)!=null?a:void 0,subtitle:(l=(b=t==null?void 0:t.variants)==null?void 0:b.subtitle)!=null?l:void 0,text:(U=(Y=t==null?void 0:t.variants)==null?void 0:Y.plainText)!=null?U:void 0,firstButton:(k=(V=t==null?void 0:t.variants)==null?void 0:V.primaryButton)!=null?k:void 0,secondButton:(W=(H=t==null?void 0:t.variants)==null?void 0:H.secondaryButton)!=null?W:void 0,formLinks:(K=(_=t==null?void 0:t.variants)==null?void 0:_.formLinks)!=null?K:void 0,signInLink:(G=($=t==null?void 0:t.variants)==null?void 0:$.signinLink)!=null?G:void 0,form:(E=(j=t==null?void 0:t.variants)==null?void 0:j.form)!=null?E:void 0};return i?(0,xt.jsx)(i,{...p}):null};bt.displayName=kt;d();M();0&&(module.exports={SigninSignup,SigninSignup_A,SigninSignup_B});
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __esm = (fn, res) => function __init() {
10
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11
+ };
12
+ var __export = (target, all) => {
13
+ for (var name in all)
14
+ __defProp(target, name, { get: all[name], enumerable: true });
15
+ };
16
+ var __copyProps = (to, from, except, desc) => {
17
+ if (from && typeof from === "object" || typeof from === "function") {
18
+ for (let key of __getOwnPropNames(from))
19
+ if (!__hasOwnProp.call(to, key) && key !== except)
20
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
30
+ mod
31
+ ));
32
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
33
+
34
+ // src/helper/index.ts
35
+ var logoLink, thankYouPageLink;
36
+ var init_helper = __esm({
37
+ "src/helper/index.ts"() {
38
+ "use strict";
39
+ logoLink = (logo) => {
40
+ var _a, _b, _c;
41
+ if ((logo == null ? void 0 : logo.internalLink) && (logo == null ? void 0 : logo.type) === "linkInternal") {
42
+ if ((_b = (_a = logo == null ? void 0 : logo.internalLink) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("home")) {
43
+ return "/";
44
+ }
45
+ return `/${logo.internalLink}`;
46
+ } else if ((logo == null ? void 0 : logo.externalLink) && (logo == null ? void 0 : logo.type) === "linkExternal") {
47
+ return (_c = logo == null ? void 0 : logo.externalLink) != null ? _c : "/";
48
+ } else {
49
+ return "/";
50
+ }
51
+ };
52
+ thankYouPageLink = (link) => {
53
+ if (!link) {
54
+ return "/thank-you";
55
+ } else {
56
+ if ((link == null ? void 0 : link.linkType) === "linkInternal") {
57
+ return `/${link == null ? void 0 : link.internalLink}`;
58
+ } else {
59
+ return link == null ? void 0 : link.externalLink;
60
+ }
61
+ }
62
+ };
63
+ }
64
+ });
65
+
66
+ // src/signin_signup_a.tsx
67
+ var signin_signup_a_exports = {};
68
+ __export(signin_signup_a_exports, {
69
+ SigninSignup_A: () => SigninSignup_A,
70
+ default: () => SigninSignup_A
71
+ });
72
+ function SigninSignup_A({ logo, form, formLinks, signInLink }) {
73
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section.Section, { className: "py-10 rounded-md bg-gray-50 lg:py-20", children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_container.Container, { maxWidth: 576, children: [
74
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogoSection, { logo }),
75
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_container.Container, { className: "mb-6 text-center lg:mb-10", children: [
76
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubtitleAndHeadingText, { form }),
77
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
78
+ SignupForm,
79
+ {
80
+ form,
81
+ signInLink,
82
+ thankYouPage: thankYouPageLink(form == null ? void 0 : form.thankYouPage)
83
+ }
84
+ )
85
+ ] }),
86
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormLinks, { formLinks })
87
+ ] }) });
88
+ }
89
+ function LogoSection({ logo }) {
90
+ var _a;
91
+ if (!logo) return null;
92
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
93
+ import_link.Link,
94
+ {
95
+ "aria-label": `Go to ${logoLink(logo) === "/" ? "home page" : logoLink(logo)}`,
96
+ className: "flex justify-center mx-auto text-3xl font-bold leading-none",
97
+ href: logoLink(logo),
98
+ target: logo == null ? void 0 : logo.linkTarget,
99
+ rel: (logo == null ? void 0 : logo.linkTarget) === "_blank" ? "noopener noreferrer" : "",
100
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
101
+ import_image.Image,
102
+ {
103
+ src: logo == null ? void 0 : logo.image,
104
+ alt: (_a = logo == null ? void 0 : logo.alt) != null ? _a : "signup-logo",
105
+ width: 100,
106
+ height: 100,
107
+ className: "flex justify-center mx-auto text-3xl font-bold leading-none"
108
+ }
109
+ )
110
+ }
111
+ ) });
112
+ }
113
+ function SubtitleAndHeadingText({ form }) {
114
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-6", children: [
115
+ (form == null ? void 0 : form.subtitle) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Text, { muted: true, children: form == null ? void 0 : form.subtitle }) : null,
116
+ (form == null ? void 0 : form.name) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_heading.Heading, { className: "text-2xl lg:text-2xl", children: form == null ? void 0 : form.name }) : null
117
+ ] });
118
+ }
119
+ function SignupForm({
120
+ form,
121
+ signInLink,
122
+ thankYouPage
123
+ }) {
124
+ var _a, _b;
125
+ if (!(form == null ? void 0 : form.fields)) return null;
126
+ const [showPasswords, setShowPasswords] = import_react.default.useState({});
127
+ const togglePasswordVisibility = (fieldName) => {
128
+ setShowPasswords((prev) => ({
129
+ ...prev,
130
+ [fieldName]: !prev[fieldName]
131
+ }));
132
+ };
133
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
134
+ import_form.Form,
135
+ {
136
+ id: (_a = form == null ? void 0 : form.id) != null ? _a : void 0,
137
+ name: "SignUp-VariantA-Form",
138
+ className: "form-signup",
139
+ thankyouPage: thankYouPage,
140
+ children: [
141
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
142
+ FormFields,
143
+ {
144
+ form,
145
+ showPasswords,
146
+ togglePasswordVisibility
147
+ }
148
+ ),
149
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "webriq-recaptcha" }) }),
150
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-center", children: (form == null ? void 0 : form.buttonLabel) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
151
+ import_button.Button,
152
+ {
153
+ as: "button",
154
+ variant: "custom",
155
+ ariaLabel: (_b = form == null ? void 0 : form.buttonLabel) != null ? _b : "Sign Up form submit button",
156
+ className: "w-full py-4 text-sm font-bold tex-gray-50",
157
+ type: "submit",
158
+ children: form == null ? void 0 : form.buttonLabel
159
+ }
160
+ ) }),
161
+ signInLink && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignInLink, { signInLink })
162
+ ]
163
+ }
164
+ );
165
+ }
166
+ function FormFields({
167
+ form,
168
+ showPasswords,
169
+ togglePasswordVisibility
170
+ }) {
171
+ var _a, _b;
172
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
173
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_flex.Flex, { wrap: true, className: "-mx-2", children: (_a = form == null ? void 0 : form.fields) == null ? void 0 : _a.slice(0, 2).map((formFields, index) => {
174
+ var _a2;
175
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full px-2 mb-3 lg:w-1/2", children: formFields.type === "inputText" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
176
+ import_input.Input,
177
+ {
178
+ textSize: "sm",
179
+ variant: "primary",
180
+ noLabel: true,
181
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
182
+ required: formFields == null ? void 0 : formFields.isRequired,
183
+ className: "w-full py-4 text-xs bg-white",
184
+ name: formFields == null ? void 0 : formFields.name,
185
+ ariaLabel: formFields == null ? void 0 : formFields.label,
186
+ ...formFields,
187
+ type: "text"
188
+ }
189
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
190
+ import_form_field.FormField,
191
+ {
192
+ className: "py-4",
193
+ textSize: "sm",
194
+ noLabel: true,
195
+ variant: "primary",
196
+ name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
197
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
198
+ required: formFields == null ? void 0 : formFields.isRequired,
199
+ items: formFields == null ? void 0 : formFields.items,
200
+ type: formFields == null ? void 0 : formFields.type,
201
+ ...formFields
202
+ }
203
+ ) }, index);
204
+ }) }),
205
+ (_b = form == null ? void 0 : form.fields) == null ? void 0 : _b.slice(2).map((formFields, index) => {
206
+ var _a2;
207
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "my-3", children: formFields.type === "inputPassword" && formFields.name ? (
208
+ // Check if name exists
209
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
210
+ PasswordField,
211
+ {
212
+ formFields,
213
+ showPassword: showPasswords[formFields.name] || false,
214
+ togglePassword: () => togglePasswordVisibility(formFields.name)
215
+ }
216
+ )
217
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
218
+ import_form_field.FormField,
219
+ {
220
+ className: "py-4",
221
+ textSize: "sm",
222
+ noLabel: true,
223
+ variant: "primary",
224
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
225
+ required: formFields == null ? void 0 : formFields.isRequired,
226
+ name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
227
+ items: formFields == null ? void 0 : formFields.items,
228
+ type: formFields == null ? void 0 : formFields.type,
229
+ ...formFields
230
+ }
231
+ ) }, index);
232
+ })
233
+ ] });
234
+ }
235
+ function SignInLink({ signInLink }) {
236
+ if (!(signInLink == null ? void 0 : signInLink.label)) return null;
237
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full text-center mt-3", children: [
238
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: "Already have an account? " }),
239
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
240
+ import_button.Button,
241
+ {
242
+ as: "link",
243
+ variant: "link",
244
+ link: signInLink,
245
+ className: "text-xs text-primary cursor-pointer hover:underline",
246
+ ariaLabel: signInLink == null ? void 0 : signInLink.label,
247
+ children: signInLink == null ? void 0 : signInLink.label
248
+ }
249
+ )
250
+ ] });
251
+ }
252
+ function PasswordField({
253
+ formFields,
254
+ showPassword,
255
+ togglePassword
256
+ }) {
257
+ var _a;
258
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_flex.Flex, { className: "relative", children: [
259
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
260
+ import_input.Input,
261
+ {
262
+ className: "py-4",
263
+ textSize: "sm",
264
+ noLabel: true,
265
+ "aria-label": (_a = formFields == null ? void 0 : formFields.placeholder) != null ? _a : formFields == null ? void 0 : formFields.name,
266
+ variant: "primary",
267
+ type: showPassword ? "text" : "password",
268
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
269
+ name: formFields == null ? void 0 : formFields.name,
270
+ required: formFields == null ? void 0 : formFields.isRequired
271
+ }
272
+ ),
273
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
274
+ import_button.Button,
275
+ {
276
+ as: "button",
277
+ variant: "unstyled",
278
+ ariaLabel: showPassword ? "Show password" : "Hide password",
279
+ className: "absolute top-0 right-0 h-full p-2",
280
+ type: "button",
281
+ onClick: togglePassword,
282
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PasswordIcon, { showPassword })
283
+ }
284
+ )
285
+ ] });
286
+ }
287
+ function FormLinks({ formLinks }) {
288
+ if (!formLinks) return null;
289
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "mt-10 text-xs text-center text-gray-700", children: formLinks == null ? void 0 : formLinks.map((link, index, { length }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
290
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
291
+ import_button.Button,
292
+ {
293
+ as: "link",
294
+ variant: "link",
295
+ link,
296
+ className: "text-xs text-primary cursor-pointer hover:underline",
297
+ ariaLabel: link == null ? void 0 : link.label,
298
+ children: link == null ? void 0 : link.label
299
+ }
300
+ ),
301
+ index === length - 1 ? null : index === length - 2 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\xA0and\xA0" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "\xA0,\xA0" })
302
+ ] }, index)) });
303
+ }
304
+ function PasswordIcon({ showPassword }) {
305
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
306
+ "svg",
307
+ {
308
+ className: "w-5 h-5 my-auto ml-4 text-gray-500",
309
+ xmlns: "http://www.w3.org/2000/svg",
310
+ "aria-hidden": "true",
311
+ role: "img",
312
+ width: "1em",
313
+ height: "1em",
314
+ preserveAspectRatio: "xMidYMid meet",
315
+ viewBox: "0 0 16 16",
316
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "currentColor", children: [
317
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755c-.165.165-.337.328-.517.486l.708.709z" }),
318
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299l.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z" }),
319
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884l-12-12l.708-.708l12 12l-.708.708z" })
320
+ ] })
321
+ }
322
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
323
+ "svg",
324
+ {
325
+ className: "w-5 h-5 my-auto ml-4 text-gray-500",
326
+ xmlns: "http://www.w3.org/2000/svg",
327
+ "aria-hidden": "true",
328
+ role: "img",
329
+ width: "1em",
330
+ height: "1em",
331
+ preserveAspectRatio: "xMidYMid meet",
332
+ viewBox: "0 0 16 16",
333
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "currentColor", children: [
334
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z" }),
335
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M8 5.5a2.5 2.5 0 1 0 0 5a2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0a3.5 3.5 0 0 1-7 0z" })
336
+ ] })
337
+ }
338
+ ) });
339
+ }
340
+ var import_button, import_container, import_flex, import_form, import_form_field, import_heading, import_image, import_input, import_link, import_section, import_text, import_react, import_jsx_runtime;
341
+ var init_signin_signup_a = __esm({
342
+ "src/signin_signup_a.tsx"() {
343
+ "use strict";
344
+ import_button = require("@stackshift-ui/button");
345
+ import_container = require("@stackshift-ui/container");
346
+ import_flex = require("@stackshift-ui/flex");
347
+ import_form = require("@stackshift-ui/form");
348
+ import_form_field = require("@stackshift-ui/form-field");
349
+ import_heading = require("@stackshift-ui/heading");
350
+ import_image = require("@stackshift-ui/image");
351
+ import_input = require("@stackshift-ui/input");
352
+ import_link = require("@stackshift-ui/link");
353
+ import_section = require("@stackshift-ui/section");
354
+ import_text = require("@stackshift-ui/text");
355
+ import_react = __toESM(require("react"));
356
+ init_helper();
357
+ import_jsx_runtime = require("react/jsx-runtime");
358
+ }
359
+ });
360
+
361
+ // src/signin_signup_b.tsx
362
+ var signin_signup_b_exports = {};
363
+ __export(signin_signup_b_exports, {
364
+ SigninSignup_B: () => SigninSignup_B,
365
+ default: () => SigninSignup_B
366
+ });
367
+ function SigninSignup_B({ logo, form, formLinks, signInLink }) {
368
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_section2.Section, { className: "py-10 bg-primary lg:py-20", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_container2.Container, { maxWidth: 1280, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_container2.Container, { maxWidth: 576, children: [
369
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(LogoSection2, { logo }),
370
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_card.Card, { borderRadius: "md", className: "p-6 mb-6 bg-white lg:mb-10 lg:p-12", children: [
371
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SubtitleAndHeadingText2, { form }),
372
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SignupForm2, { form, signInLink })
373
+ ] }),
374
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FormLinks2, { formLinks })
375
+ ] }) }) });
376
+ }
377
+ function LogoSection2({ logo }) {
378
+ var _a;
379
+ if (!logo) return null;
380
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "mb-10", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
381
+ import_link2.Link,
382
+ {
383
+ "aria-label": `Go to ${logoLink(logo) === "/" ? "home page" : logoLink(logo)}`,
384
+ className: "flex justify-center mx-auto text-3xl font-bold leading-none",
385
+ href: logoLink(logo),
386
+ target: logo == null ? void 0 : logo.linkTarget,
387
+ rel: (logo == null ? void 0 : logo.linkTarget) === "_blank" ? "noopener noreferrer" : "",
388
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
389
+ import_image2.Image,
390
+ {
391
+ src: logo == null ? void 0 : logo.image,
392
+ alt: (_a = logo == null ? void 0 : logo.alt) != null ? _a : "signup-logo",
393
+ width: 100,
394
+ height: 100,
395
+ className: "flex justify-center text-3xl font-bold leading-none text-white"
396
+ }
397
+ )
398
+ }
399
+ ) });
400
+ }
401
+ function SubtitleAndHeadingText2({ form }) {
402
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "mb-6", children: [
403
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_text2.Text, { muted: true, children: form == null ? void 0 : form.subtitle }),
404
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_heading2.Heading, { className: "text-2xl lg:text-2xl", children: form == null ? void 0 : form.name })
405
+ ] });
406
+ }
407
+ function SignupForm2({ form, signInLink }) {
408
+ var _a;
409
+ if (!(form == null ? void 0 : form.fields)) return null;
410
+ const [showPasswords, setShowPasswords] = import_react2.default.useState({});
411
+ const togglePasswordVisibility = (fieldName) => {
412
+ setShowPasswords((prev) => ({
413
+ ...prev,
414
+ [fieldName]: !prev[fieldName]
415
+ }));
416
+ };
417
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
418
+ import_form2.Form,
419
+ {
420
+ id: (_a = form == null ? void 0 : form.id) != null ? _a : void 0,
421
+ name: "SignUp-VariantB-Form",
422
+ className: "form-signup",
423
+ thankyouPage: thankYouPageLink(form == null ? void 0 : form.thankYouPage),
424
+ children: [
425
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
426
+ FormFields2,
427
+ {
428
+ form,
429
+ showPassword: showPasswords,
430
+ togglePasswordVisibility
431
+ }
432
+ ),
433
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "webriq-recaptcha" }) }),
434
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "text-center", children: [
435
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FormButtonLabel, { form }),
436
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(SigninLink, { signInLink })
437
+ ] })
438
+ ]
439
+ }
440
+ );
441
+ }
442
+ function FormFields2({
443
+ form,
444
+ showPassword,
445
+ togglePasswordVisibility
446
+ }) {
447
+ var _a, _b, _c, _d;
448
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_react2.default.Fragment, { children: [
449
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_flex2.Flex, { className: "flex-col lg:flex-row gap-3", children: (_b = (_a = form == null ? void 0 : form.fields) == null ? void 0 : _a.slice(0, 2)) == null ? void 0 : _b.map((formFields, index) => {
450
+ var _a2;
451
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
452
+ import_form_field2.FormField,
453
+ {
454
+ noLabel: true,
455
+ variant: "secondary",
456
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
457
+ required: formFields == null ? void 0 : formFields.isRequired,
458
+ name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
459
+ items: formFields == null ? void 0 : formFields.items,
460
+ type: formFields == null ? void 0 : formFields.type,
461
+ ...formFields
462
+ }
463
+ ) }, index);
464
+ }) }),
465
+ (_d = (_c = form == null ? void 0 : form.fields) == null ? void 0 : _c.slice(2)) == null ? void 0 : _d.map((formFields, index) => {
466
+ var _a2;
467
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "my-3", children: (formFields == null ? void 0 : formFields.type) === "inputPassword" && formFields.name ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
468
+ PasswordField2,
469
+ {
470
+ formFields,
471
+ showPassword: showPassword[formFields.name] || false,
472
+ togglePassword: () => togglePasswordVisibility(formFields.name)
473
+ }
474
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
475
+ import_form_field2.FormField,
476
+ {
477
+ noLabel: true,
478
+ variant: "secondary",
479
+ name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
480
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
481
+ required: formFields == null ? void 0 : formFields.isRequired,
482
+ items: formFields == null ? void 0 : formFields.items,
483
+ type: formFields == null ? void 0 : formFields.type,
484
+ ...formFields
485
+ }
486
+ ) }, index);
487
+ })
488
+ ] });
489
+ }
490
+ function PasswordField2({
491
+ formFields,
492
+ showPassword,
493
+ togglePassword
494
+ }) {
495
+ var _a;
496
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "flex", children: [
497
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
498
+ import_input2.Input,
499
+ {
500
+ noLabel: true,
501
+ ariaLabel: (_a = formFields == null ? void 0 : formFields.placeholder) != null ? _a : formFields == null ? void 0 : formFields.name,
502
+ variant: "secondary",
503
+ type: showPassword ? "text" : "password",
504
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
505
+ name: formFields == null ? void 0 : formFields.name,
506
+ required: formFields == null ? void 0 : formFields.isRequired
507
+ }
508
+ ),
509
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
510
+ import_button2.Button,
511
+ {
512
+ variant: "unstyled",
513
+ as: "button",
514
+ ariaLabel: showPassword ? "Show password" : "Hide password",
515
+ className: "focus:outline-none mr-4",
516
+ type: "button",
517
+ onClick: togglePassword,
518
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(PasswordIcon2, { showPassword })
519
+ }
520
+ )
521
+ ] });
522
+ }
523
+ function FormButtonLabel({ form }) {
524
+ var _a;
525
+ if (!(form == null ? void 0 : form.buttonLabel)) return null;
526
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
527
+ import_button2.Button,
528
+ {
529
+ as: "button",
530
+ className: "w-full py-4 mb-3",
531
+ ariaLabel: (_a = form == null ? void 0 : form.buttonLabel) != null ? _a : "Sign Up form submit button",
532
+ variant: "custom",
533
+ type: "submit",
534
+ children: form == null ? void 0 : form.buttonLabel
535
+ }
536
+ );
537
+ }
538
+ function SigninLink({ signInLink }) {
539
+ if (!(signInLink == null ? void 0 : signInLink.label)) return null;
540
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "text-xs text-gray-900", children: [
541
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "Already have an account?" }),
542
+ " ",
543
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
544
+ import_button2.Button,
545
+ {
546
+ as: "link",
547
+ variant: "link",
548
+ link: signInLink,
549
+ className: "text-xs text-primary hover:underline",
550
+ ariaLabel: signInLink == null ? void 0 : signInLink.label,
551
+ children: signInLink == null ? void 0 : signInLink.label
552
+ }
553
+ )
554
+ ] });
555
+ }
556
+ function FormLinks2({ formLinks }) {
557
+ if (!formLinks) return null;
558
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "text-xs text-center text-secondary-foreground", children: formLinks == null ? void 0 : formLinks.map((link, index, { length }) => /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { children: [
559
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
560
+ import_button2.Button,
561
+ {
562
+ as: "link",
563
+ variant: "link",
564
+ link,
565
+ className: "text-xs underline text-secondary-foreground hover:text-gray-50",
566
+ ariaLabel: link == null ? void 0 : link.label,
567
+ children: link == null ? void 0 : link.label
568
+ }
569
+ ),
570
+ index === length - 1 ? null : index === length - 2 ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\xA0and\xA0" }) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: "\xA0,\xA0" })
571
+ ] }, index)) });
572
+ }
573
+ function PasswordIcon2({ showPassword }) {
574
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react2.default.Fragment, { children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
575
+ "svg",
576
+ {
577
+ className: "w-5 h-5 my-auto ml-4 text-gray-500",
578
+ xmlns: "http://www.w3.org/2000/svg",
579
+ "aria-hidden": "true",
580
+ role: "img",
581
+ width: "1em",
582
+ height: "1em",
583
+ preserveAspectRatio: "xMidYMid meet",
584
+ viewBox: "0 0 16 16",
585
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { fill: "currentColor", children: [
586
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M13.359 11.238C15.06 9.72 16 8 16 8s-3-5.5-8-5.5a7.028 7.028 0 0 0-2.79.588l.77.771A5.944 5.944 0 0 1 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.134 13.134 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755c-.165.165-.337.328-.517.486l.708.709z" }),
587
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M11.297 9.176a3.5 3.5 0 0 0-4.474-4.474l.823.823a2.5 2.5 0 0 1 2.829 2.829l.822.822zm-2.943 1.299l.822.822a3.5 3.5 0 0 1-4.474-4.474l.823.823a2.5 2.5 0 0 0 2.829 2.829z" }),
588
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M3.35 5.47c-.18.16-.353.322-.518.487A13.134 13.134 0 0 0 1.172 8l.195.288c.335.48.83 1.12 1.465 1.755C4.121 11.332 5.881 12.5 8 12.5c.716 0 1.39-.133 2.02-.36l.77.772A7.029 7.029 0 0 1 8 13.5C3 13.5 0 8 0 8s.939-1.721 2.641-3.238l.708.709zm10.296 8.884l-12-12l.708-.708l12 12l-.708.708z" })
589
+ ] })
590
+ }
591
+ ) : /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
592
+ "svg",
593
+ {
594
+ className: "w-5 h-5 my-auto ml-4 text-gray-500",
595
+ xmlns: "http://www.w3.org/2000/svg",
596
+ "aria-hidden": "true",
597
+ role: "img",
598
+ width: "1em",
599
+ height: "1em",
600
+ preserveAspectRatio: "xMidYMid meet",
601
+ viewBox: "0 0 16 16",
602
+ children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("g", { fill: "currentColor", children: [
603
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M16 8s-3-5.5-8-5.5S0 8 0 8s3 5.5 8 5.5S16 8 16 8zM1.173 8a13.133 13.133 0 0 1 1.66-2.043C4.12 4.668 5.88 3.5 8 3.5c2.12 0 3.879 1.168 5.168 2.457A13.133 13.133 0 0 1 14.828 8c-.058.087-.122.183-.195.288c-.335.48-.83 1.12-1.465 1.755C11.879 11.332 10.119 12.5 8 12.5c-2.12 0-3.879-1.168-5.168-2.457A13.134 13.134 0 0 1 1.172 8z" }),
604
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M8 5.5a2.5 2.5 0 1 0 0 5a2.5 2.5 0 0 0 0-5zM4.5 8a3.5 3.5 0 1 1 7 0a3.5 3.5 0 0 1-7 0z" })
605
+ ] })
606
+ }
607
+ ) });
608
+ }
609
+ var import_button2, import_card, import_container2, import_flex2, import_form2, import_form_field2, import_heading2, import_image2, import_input2, import_link2, import_section2, import_text2, import_react2, import_jsx_runtime2;
610
+ var init_signin_signup_b = __esm({
611
+ "src/signin_signup_b.tsx"() {
612
+ "use strict";
613
+ import_button2 = require("@stackshift-ui/button");
614
+ import_card = require("@stackshift-ui/card");
615
+ import_container2 = require("@stackshift-ui/container");
616
+ import_flex2 = require("@stackshift-ui/flex");
617
+ import_form2 = require("@stackshift-ui/form");
618
+ import_form_field2 = require("@stackshift-ui/form-field");
619
+ import_heading2 = require("@stackshift-ui/heading");
620
+ import_image2 = require("@stackshift-ui/image");
621
+ import_input2 = require("@stackshift-ui/input");
622
+ import_link2 = require("@stackshift-ui/link");
623
+ import_section2 = require("@stackshift-ui/section");
624
+ import_text2 = require("@stackshift-ui/text");
625
+ import_react2 = __toESM(require("react"));
626
+ init_helper();
627
+ import_jsx_runtime2 = require("react/jsx-runtime");
628
+ }
629
+ });
630
+
631
+ // src/index.ts
632
+ var src_exports = {};
633
+ __export(src_exports, {
634
+ SigninSignup: () => SigninSignup,
635
+ SigninSignup_A: () => SigninSignup_A,
636
+ SigninSignup_B: () => SigninSignup_B
637
+ });
638
+ module.exports = __toCommonJS(src_exports);
639
+
640
+ // src/signin-signup.tsx
641
+ var import_react3 = require("react");
642
+ var import_jsx_runtime3 = require("react/jsx-runtime");
643
+ var Variants = {
644
+ variant_a: (0, import_react3.lazy)(() => Promise.resolve().then(() => (init_signin_signup_a(), signin_signup_a_exports))),
645
+ variant_b: (0, import_react3.lazy)(() => Promise.resolve().then(() => (init_signin_signup_b(), signin_signup_b_exports)))
646
+ };
647
+ var displayName = "SigninSignup";
648
+ var SigninSignup = ({ data }) => {
649
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
650
+ const variant = data == null ? void 0 : data.variant;
651
+ const Variant = variant && (Variants == null ? void 0 : Variants[variant]);
652
+ const props = {
653
+ logo: (_b = (_a = data == null ? void 0 : data.variants) == null ? void 0 : _a.logo) != null ? _b : void 0,
654
+ title: (_d = (_c = data == null ? void 0 : data.variants) == null ? void 0 : _c.title) != null ? _d : void 0,
655
+ subtitle: (_f = (_e = data == null ? void 0 : data.variants) == null ? void 0 : _e.subtitle) != null ? _f : void 0,
656
+ text: (_h = (_g = data == null ? void 0 : data.variants) == null ? void 0 : _g.plainText) != null ? _h : void 0,
657
+ firstButton: (_j = (_i = data == null ? void 0 : data.variants) == null ? void 0 : _i.primaryButton) != null ? _j : void 0,
658
+ secondButton: (_l = (_k = data == null ? void 0 : data.variants) == null ? void 0 : _k.secondaryButton) != null ? _l : void 0,
659
+ formLinks: (_n = (_m = data == null ? void 0 : data.variants) == null ? void 0 : _m.formLinks) != null ? _n : void 0,
660
+ signInLink: (_p = (_o = data == null ? void 0 : data.variants) == null ? void 0 : _o.signinLink) != null ? _p : void 0,
661
+ form: (_r = (_q = data == null ? void 0 : data.variants) == null ? void 0 : _q.form) != null ? _r : void 0
662
+ };
663
+ return Variant ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Variant, { ...props }) : null;
664
+ };
665
+ SigninSignup.displayName = displayName;
666
+
667
+ // src/index.ts
668
+ init_signin_signup_a();
669
+ init_signin_signup_b();
670
+ // Annotate the CommonJS export names for ESM import in node:
671
+ 0 && (module.exports = {
672
+ SigninSignup,
673
+ SigninSignup_A,
674
+ SigninSignup_B
675
+ });