@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.
@@ -1 +1,6 @@
1
- import{a}from"./chunk-UALEHLFH.mjs";export{a as SigninSignup};
1
+ import {
2
+ SigninSignup
3
+ } from "./chunk-NJKLN5F4.mjs";
4
+ export {
5
+ SigninSignup
6
+ };
@@ -1 +1,349 @@
1
- "use strict";var q=Object.create;var b=Object.defineProperty;var B=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var Y=Object.getPrototypeOf,m=Object.prototype.hasOwnProperty;var H=(t,n)=>{for(var u in n)b(t,u,{get:n[u],enumerable:!0})},L=(t,n,u,p)=>{if(n&&typeof n=="object"||typeof n=="function")for(let r of T(n))!m.call(t,r)&&r!==u&&b(t,r,{get:()=>n[r],enumerable:!(p=B(n,r))||p.enumerable});return t};var U=(t,n,u)=>(u=t!=null?q(Y(t)):{},L(n||!t||!t.__esModule?b(u,"default",{value:t,enumerable:!0}):u,t)),V=t=>L(b({},"__esModule",{value:!0}),t);var D={};H(D,{SigninSignup_A:()=>M,default:()=>M});module.exports=V(D);var i=require("@stackshift-ui/button"),h=require("@stackshift-ui/container"),y=require("@stackshift-ui/flex"),S=require("@stackshift-ui/form"),l=require("@stackshift-ui/form-field"),d=require("@stackshift-ui/heading"),g=require("@stackshift-ui/image"),w=require("@stackshift-ui/input"),z=require("@stackshift-ui/link"),A=require("@stackshift-ui/section"),C=require("@stackshift-ui/text"),R=U(require("react"));var x=t=>{var n,u,p;return t!=null&&t.internalLink&&(t==null?void 0:t.type)==="linkInternal"?(u=(n=t==null?void 0:t.internalLink)==null?void 0:n.toLowerCase())!=null&&u.includes("home")?"/":`/${t.internalLink}`:t!=null&&t.externalLink&&(t==null?void 0:t.type)==="linkExternal"&&(p=t==null?void 0:t.externalLink)!=null?p:"/"},P=t=>t?(t==null?void 0:t.linkType)==="linkInternal"?`/${t==null?void 0:t.internalLink}`:t==null?void 0:t.externalLink:"/thank-you";var a=require("react/jsx-runtime");function M({logo:t,form:n,formLinks:u,signInLink:p}){return(0,a.jsx)(A.Section,{className:"py-10 rounded-md bg-gray-50 lg:py-20",children:(0,a.jsxs)(h.Container,{maxWidth:576,children:[(0,a.jsx)(W,{logo:t}),(0,a.jsxs)(h.Container,{className:"mb-6 text-center lg:mb-10",children:[(0,a.jsx)($,{form:n}),(0,a.jsx)(K,{form:n,signInLink:p,thankYouPage:P(n==null?void 0:n.thankYouPage)})]}),(0,a.jsx)(E,{formLinks:u})]})})}function W({logo:t}){var n;return t?(0,a.jsx)("div",{className:"mb-10",children:(0,a.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,a.jsx)(g.Image,{src:t==null?void 0:t.image,alt:(n=t==null?void 0:t.alt)!=null?n:"signup-logo",width:100,height:100,className:"flex justify-center mx-auto text-3xl font-bold leading-none"})})}):null}function $({form:t}){return(0,a.jsxs)("div",{className:"mb-6",children:[t!=null&&t.subtitle?(0,a.jsx)(C.Text,{muted:!0,children:t==null?void 0:t.subtitle}):null,t!=null&&t.name?(0,a.jsx)(d.Heading,{className:"text-2xl lg:text-2xl",children:t==null?void 0:t.name}):null]})}function K({form:t,signInLink:n,thankYouPage:u}){var c,s;if(!(t!=null&&t.fields))return null;let[p,r]=R.default.useState({}),e=v=>{r(N=>({...N,[v]:!N[v]}))};return(0,a.jsxs)(S.Form,{id:(c=t==null?void 0:t.id)!=null?c:void 0,name:"SignUp-VariantA-Form",className:"form-signup",thankyouPage:u,children:[(0,a.jsx)(_,{form:t,showPasswords:p,togglePasswordVisibility:e}),(0,a.jsx)("div",{children:(0,a.jsx)("div",{className:"webriq-recaptcha"})}),(0,a.jsx)("div",{className:"text-center",children:(t==null?void 0:t.buttonLabel)&&(0,a.jsx)(i.Button,{as:"button",variant:"custom",ariaLabel:(s=t==null?void 0:t.buttonLabel)!=null?s:"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})}),n&&(0,a.jsx)(j,{signInLink:n})]})}function _({form:t,showPasswords:n,togglePasswordVisibility:u}){var p,r;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.Flex,{wrap:!0,className:"-mx-2",children:(p=t==null?void 0:t.fields)==null?void 0:p.slice(0,2).map((e,c)=>{var s;return(0,a.jsx)("div",{className:"w-full px-2 mb-3 lg:w-1/2",children:e.type==="inputText"?(0,a.jsx)(w.Input,{textSize:"sm",variant:"primary",noLabel:!0,placeholder:e==null?void 0:e.placeholder,required:e==null?void 0:e.isRequired,className:"w-full py-4 text-xs bg-white",name:e==null?void 0:e.name,ariaLabel:e==null?void 0:e.label,...e,type:"text"}):(0,a.jsx)(l.FormField,{textSize:"sm",noLabel:!0,name:(s=e==null?void 0:e.name)!=null?s:"",...e})},c)})}),(r=t==null?void 0:t.fields)==null?void 0:r.slice(2).map((e,c)=>{var s;return(0,a.jsx)("div",{className:"my-3",children:e.type==="inputPassword"&&e.name?(0,a.jsx)(k,{formFields:e,showPassword:n[e.name]||!1,togglePassword:()=>u(e.name)}):(0,a.jsx)(l.FormField,{className:"py-4",textSize:"sm",noLabel:!0,variant:"primary",placeholder:e==null?void 0:e.placeholder,required:e==null?void 0:e.isRequired,name:(s=e==null?void 0:e.name)!=null?s:"",items:e==null?void 0:e.items,type:e==null?void 0:e.type,...e})},c)})]})}function j({signInLink:t}){return t!=null&&t.label?(0,a.jsxs)("div",{className:"w-full text-center mt-3",children:[(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"Already have an account? "}),(0,a.jsx)(i.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 k({formFields:t,showPassword:n,togglePassword:u}){var p;return(0,a.jsxs)(y.Flex,{className:"relative",children:[(0,a.jsx)(w.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:n?"text":"password",placeholder:t==null?void 0:t.placeholder,name:t==null?void 0:t.name,required:t==null?void 0:t.isRequired}),(0,a.jsx)(i.Button,{as:"button",variant:"unstyled",ariaLabel:n?"Show password":"Hide password",className:"absolute top-0 right-0 h-full p-2",type:"button",onClick:u,children:(0,a.jsx)(G,{showPassword:n})})]})}function E({formLinks:t}){return t?(0,a.jsx)("p",{className:"mt-10 text-xs text-center text-gray-700",children:t==null?void 0:t.map((n,u,{length:p})=>(0,a.jsxs)("span",{children:[(0,a.jsx)(i.Button,{as:"link",variant:"link",link:n,className:"text-xs text-primary cursor-pointer hover:underline",ariaLabel:n==null?void 0:n.label,children:n==null?void 0:n.label}),u===p-1?null:u===p-2?(0,a.jsx)("span",{children:"\xA0and\xA0"}):(0,a.jsx)("span",{children:"\xA0,\xA0"})]},u))}):null}function G({showPassword:t}){return(0,a.jsx)(a.Fragment,{children:t?(0,a.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,a.jsxs)("g",{fill:"currentColor",children:[(0,a.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,a.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,a.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,a.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,a.jsxs)("g",{fill:"currentColor",children:[(0,a.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,a.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"})]})})})}0&&(module.exports={SigninSignup_A});
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/signin_signup_a.tsx
31
+ var signin_signup_a_exports = {};
32
+ __export(signin_signup_a_exports, {
33
+ SigninSignup_A: () => SigninSignup_A,
34
+ default: () => SigninSignup_A
35
+ });
36
+ module.exports = __toCommonJS(signin_signup_a_exports);
37
+ var import_button = require("@stackshift-ui/button");
38
+ var import_container = require("@stackshift-ui/container");
39
+ var import_flex = require("@stackshift-ui/flex");
40
+ var import_form = require("@stackshift-ui/form");
41
+ var import_form_field = require("@stackshift-ui/form-field");
42
+ var import_heading = require("@stackshift-ui/heading");
43
+ var import_image = require("@stackshift-ui/image");
44
+ var import_input = require("@stackshift-ui/input");
45
+ var import_link = require("@stackshift-ui/link");
46
+ var import_section = require("@stackshift-ui/section");
47
+ var import_text = require("@stackshift-ui/text");
48
+ var import_react = __toESM(require("react"));
49
+
50
+ // src/helper/index.ts
51
+ var logoLink = (logo) => {
52
+ var _a, _b, _c;
53
+ if ((logo == null ? void 0 : logo.internalLink) && (logo == null ? void 0 : logo.type) === "linkInternal") {
54
+ if ((_b = (_a = logo == null ? void 0 : logo.internalLink) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("home")) {
55
+ return "/";
56
+ }
57
+ return `/${logo.internalLink}`;
58
+ } else if ((logo == null ? void 0 : logo.externalLink) && (logo == null ? void 0 : logo.type) === "linkExternal") {
59
+ return (_c = logo == null ? void 0 : logo.externalLink) != null ? _c : "/";
60
+ } else {
61
+ return "/";
62
+ }
63
+ };
64
+ var thankYouPageLink = (link) => {
65
+ if (!link) {
66
+ return "/thank-you";
67
+ } else {
68
+ if ((link == null ? void 0 : link.linkType) === "linkInternal") {
69
+ return `/${link == null ? void 0 : link.internalLink}`;
70
+ } else {
71
+ return link == null ? void 0 : link.externalLink;
72
+ }
73
+ }
74
+ };
75
+
76
+ // src/signin_signup_a.tsx
77
+ var import_jsx_runtime = require("react/jsx-runtime");
78
+ function SigninSignup_A({ logo, form, formLinks, signInLink }) {
79
+ 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: [
80
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogoSection, { logo }),
81
+ /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_container.Container, { className: "mb-6 text-center lg:mb-10", children: [
82
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubtitleAndHeadingText, { form }),
83
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
84
+ SignupForm,
85
+ {
86
+ form,
87
+ signInLink,
88
+ thankYouPage: thankYouPageLink(form == null ? void 0 : form.thankYouPage)
89
+ }
90
+ )
91
+ ] }),
92
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormLinks, { formLinks })
93
+ ] }) });
94
+ }
95
+ function LogoSection({ logo }) {
96
+ var _a;
97
+ if (!logo) return null;
98
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "mb-10", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
99
+ import_link.Link,
100
+ {
101
+ "aria-label": `Go to ${logoLink(logo) === "/" ? "home page" : logoLink(logo)}`,
102
+ className: "flex justify-center mx-auto text-3xl font-bold leading-none",
103
+ href: logoLink(logo),
104
+ target: logo == null ? void 0 : logo.linkTarget,
105
+ rel: (logo == null ? void 0 : logo.linkTarget) === "_blank" ? "noopener noreferrer" : "",
106
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
107
+ import_image.Image,
108
+ {
109
+ src: logo == null ? void 0 : logo.image,
110
+ alt: (_a = logo == null ? void 0 : logo.alt) != null ? _a : "signup-logo",
111
+ width: 100,
112
+ height: 100,
113
+ className: "flex justify-center mx-auto text-3xl font-bold leading-none"
114
+ }
115
+ )
116
+ }
117
+ ) });
118
+ }
119
+ function SubtitleAndHeadingText({ form }) {
120
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-6", children: [
121
+ (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,
122
+ (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
123
+ ] });
124
+ }
125
+ function SignupForm({
126
+ form,
127
+ signInLink,
128
+ thankYouPage
129
+ }) {
130
+ var _a, _b;
131
+ if (!(form == null ? void 0 : form.fields)) return null;
132
+ const [showPasswords, setShowPasswords] = import_react.default.useState({});
133
+ const togglePasswordVisibility = (fieldName) => {
134
+ setShowPasswords((prev) => ({
135
+ ...prev,
136
+ [fieldName]: !prev[fieldName]
137
+ }));
138
+ };
139
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
140
+ import_form.Form,
141
+ {
142
+ id: (_a = form == null ? void 0 : form.id) != null ? _a : void 0,
143
+ name: "SignUp-VariantA-Form",
144
+ className: "form-signup",
145
+ thankyouPage: thankYouPage,
146
+ children: [
147
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
148
+ FormFields,
149
+ {
150
+ form,
151
+ showPasswords,
152
+ togglePasswordVisibility
153
+ }
154
+ ),
155
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "webriq-recaptcha" }) }),
156
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "text-center", children: (form == null ? void 0 : form.buttonLabel) && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
157
+ import_button.Button,
158
+ {
159
+ as: "button",
160
+ variant: "custom",
161
+ ariaLabel: (_b = form == null ? void 0 : form.buttonLabel) != null ? _b : "Sign Up form submit button",
162
+ className: "w-full py-4 text-sm font-bold tex-gray-50",
163
+ type: "submit",
164
+ children: form == null ? void 0 : form.buttonLabel
165
+ }
166
+ ) }),
167
+ signInLink && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignInLink, { signInLink })
168
+ ]
169
+ }
170
+ );
171
+ }
172
+ function FormFields({
173
+ form,
174
+ showPasswords,
175
+ togglePasswordVisibility
176
+ }) {
177
+ var _a, _b;
178
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
179
+ /* @__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) => {
180
+ var _a2;
181
+ 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)(
182
+ import_input.Input,
183
+ {
184
+ textSize: "sm",
185
+ variant: "primary",
186
+ noLabel: true,
187
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
188
+ required: formFields == null ? void 0 : formFields.isRequired,
189
+ className: "w-full py-4 text-xs bg-white",
190
+ name: formFields == null ? void 0 : formFields.name,
191
+ ariaLabel: formFields == null ? void 0 : formFields.label,
192
+ ...formFields,
193
+ type: "text"
194
+ }
195
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
196
+ import_form_field.FormField,
197
+ {
198
+ className: "py-4",
199
+ textSize: "sm",
200
+ noLabel: true,
201
+ variant: "primary",
202
+ name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
203
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
204
+ required: formFields == null ? void 0 : formFields.isRequired,
205
+ items: formFields == null ? void 0 : formFields.items,
206
+ type: formFields == null ? void 0 : formFields.type,
207
+ ...formFields
208
+ }
209
+ ) }, index);
210
+ }) }),
211
+ (_b = form == null ? void 0 : form.fields) == null ? void 0 : _b.slice(2).map((formFields, index) => {
212
+ var _a2;
213
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "my-3", children: formFields.type === "inputPassword" && formFields.name ? (
214
+ // Check if name exists
215
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
216
+ PasswordField,
217
+ {
218
+ formFields,
219
+ showPassword: showPasswords[formFields.name] || false,
220
+ togglePassword: () => togglePasswordVisibility(formFields.name)
221
+ }
222
+ )
223
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
224
+ import_form_field.FormField,
225
+ {
226
+ className: "py-4",
227
+ textSize: "sm",
228
+ noLabel: true,
229
+ variant: "primary",
230
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
231
+ required: formFields == null ? void 0 : formFields.isRequired,
232
+ name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
233
+ items: formFields == null ? void 0 : formFields.items,
234
+ type: formFields == null ? void 0 : formFields.type,
235
+ ...formFields
236
+ }
237
+ ) }, index);
238
+ })
239
+ ] });
240
+ }
241
+ function SignInLink({ signInLink }) {
242
+ if (!(signInLink == null ? void 0 : signInLink.label)) return null;
243
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "w-full text-center mt-3", children: [
244
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: "text-xs text-gray-500", children: "Already have an account? " }),
245
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
246
+ import_button.Button,
247
+ {
248
+ as: "link",
249
+ variant: "link",
250
+ link: signInLink,
251
+ className: "text-xs text-primary cursor-pointer hover:underline",
252
+ ariaLabel: signInLink == null ? void 0 : signInLink.label,
253
+ children: signInLink == null ? void 0 : signInLink.label
254
+ }
255
+ )
256
+ ] });
257
+ }
258
+ function PasswordField({
259
+ formFields,
260
+ showPassword,
261
+ togglePassword
262
+ }) {
263
+ var _a;
264
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_flex.Flex, { className: "relative", children: [
265
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
266
+ import_input.Input,
267
+ {
268
+ className: "py-4",
269
+ textSize: "sm",
270
+ noLabel: true,
271
+ "aria-label": (_a = formFields == null ? void 0 : formFields.placeholder) != null ? _a : formFields == null ? void 0 : formFields.name,
272
+ variant: "primary",
273
+ type: showPassword ? "text" : "password",
274
+ placeholder: formFields == null ? void 0 : formFields.placeholder,
275
+ name: formFields == null ? void 0 : formFields.name,
276
+ required: formFields == null ? void 0 : formFields.isRequired
277
+ }
278
+ ),
279
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
280
+ import_button.Button,
281
+ {
282
+ as: "button",
283
+ variant: "unstyled",
284
+ ariaLabel: showPassword ? "Show password" : "Hide password",
285
+ className: "absolute top-0 right-0 h-full p-2",
286
+ type: "button",
287
+ onClick: togglePassword,
288
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PasswordIcon, { showPassword })
289
+ }
290
+ )
291
+ ] });
292
+ }
293
+ function FormLinks({ formLinks }) {
294
+ if (!formLinks) return null;
295
+ 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: [
296
+ /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
297
+ import_button.Button,
298
+ {
299
+ as: "link",
300
+ variant: "link",
301
+ link,
302
+ className: "text-xs text-primary cursor-pointer hover:underline",
303
+ ariaLabel: link == null ? void 0 : link.label,
304
+ children: link == null ? void 0 : link.label
305
+ }
306
+ ),
307
+ 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" })
308
+ ] }, index)) });
309
+ }
310
+ function PasswordIcon({ showPassword }) {
311
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_jsx_runtime.Fragment, { children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
312
+ "svg",
313
+ {
314
+ className: "w-5 h-5 my-auto ml-4 text-gray-500",
315
+ xmlns: "http://www.w3.org/2000/svg",
316
+ "aria-hidden": "true",
317
+ role: "img",
318
+ width: "1em",
319
+ height: "1em",
320
+ preserveAspectRatio: "xMidYMid meet",
321
+ viewBox: "0 0 16 16",
322
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "currentColor", children: [
323
+ /* @__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" }),
324
+ /* @__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" }),
325
+ /* @__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" })
326
+ ] })
327
+ }
328
+ ) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
329
+ "svg",
330
+ {
331
+ className: "w-5 h-5 my-auto ml-4 text-gray-500",
332
+ xmlns: "http://www.w3.org/2000/svg",
333
+ "aria-hidden": "true",
334
+ role: "img",
335
+ width: "1em",
336
+ height: "1em",
337
+ preserveAspectRatio: "xMidYMid meet",
338
+ viewBox: "0 0 16 16",
339
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "currentColor", children: [
340
+ /* @__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" }),
341
+ /* @__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" })
342
+ ] })
343
+ }
344
+ ) });
345
+ }
346
+ // Annotate the CommonJS export names for ESM import in node:
347
+ 0 && (module.exports = {
348
+ SigninSignup_A
349
+ });
@@ -1 +1,8 @@
1
- import{a}from"./chunk-GHFZYE3G.mjs";import"./chunk-4DDN6JI4.mjs";export{a as SigninSignup_A,a as default};
1
+ import {
2
+ SigninSignup_A
3
+ } from "./chunk-ZP54DEPE.mjs";
4
+ import "./chunk-NGYQAQA4.mjs";
5
+ export {
6
+ SigninSignup_A,
7
+ SigninSignup_A as default
8
+ };