@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/chunk-4YOZ4R43.mjs +266 -0
- package/dist/chunk-7U35HRM4.mjs +1 -0
- package/dist/chunk-NGYQAQA4.mjs +30 -0
- package/dist/chunk-NJKLN5F4.mjs +30 -0
- package/dist/chunk-ZP54DEPE.mjs +291 -0
- package/dist/helper/index.js +55 -1
- package/dist/helper/index.mjs +8 -1
- package/dist/index.js +674 -1
- package/dist/index.mjs +16 -1
- package/dist/signin-signup.js +664 -1
- package/dist/signin-signup.mjs +6 -1
- package/dist/signin_signup_a.js +349 -1
- package/dist/signin_signup_a.mjs +8 -1
- package/dist/signin_signup_b.js +324 -1
- package/dist/signin_signup_b.mjs +8 -1
- package/dist/types.js +18 -1
- package/package.json +10 -10
- package/src/signin_signup_a.tsx +12 -1
- package/dist/chunk-GHFZYE3G.mjs +0 -1
- /package/dist/{chunk-UALEHLFH.mjs → chunk-6DGLF6TZ.mjs} +0 -0
package/dist/signin_signup_b.js
CHANGED
|
@@ -1 +1,324 @@
|
|
|
1
|
-
"use strict";
|
|
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_b.tsx
|
|
31
|
+
var signin_signup_b_exports = {};
|
|
32
|
+
__export(signin_signup_b_exports, {
|
|
33
|
+
SigninSignup_B: () => SigninSignup_B,
|
|
34
|
+
default: () => SigninSignup_B
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(signin_signup_b_exports);
|
|
37
|
+
var import_button = require("@stackshift-ui/button");
|
|
38
|
+
var import_card = require("@stackshift-ui/card");
|
|
39
|
+
var import_container = require("@stackshift-ui/container");
|
|
40
|
+
var import_flex = require("@stackshift-ui/flex");
|
|
41
|
+
var import_form = require("@stackshift-ui/form");
|
|
42
|
+
var import_form_field = require("@stackshift-ui/form-field");
|
|
43
|
+
var import_heading = require("@stackshift-ui/heading");
|
|
44
|
+
var import_image = require("@stackshift-ui/image");
|
|
45
|
+
var import_input = require("@stackshift-ui/input");
|
|
46
|
+
var import_link = require("@stackshift-ui/link");
|
|
47
|
+
var import_section = require("@stackshift-ui/section");
|
|
48
|
+
var import_text = require("@stackshift-ui/text");
|
|
49
|
+
var import_react = __toESM(require("react"));
|
|
50
|
+
|
|
51
|
+
// src/helper/index.ts
|
|
52
|
+
var logoLink = (logo) => {
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
if ((logo == null ? void 0 : logo.internalLink) && (logo == null ? void 0 : logo.type) === "linkInternal") {
|
|
55
|
+
if ((_b = (_a = logo == null ? void 0 : logo.internalLink) == null ? void 0 : _a.toLowerCase()) == null ? void 0 : _b.includes("home")) {
|
|
56
|
+
return "/";
|
|
57
|
+
}
|
|
58
|
+
return `/${logo.internalLink}`;
|
|
59
|
+
} else if ((logo == null ? void 0 : logo.externalLink) && (logo == null ? void 0 : logo.type) === "linkExternal") {
|
|
60
|
+
return (_c = logo == null ? void 0 : logo.externalLink) != null ? _c : "/";
|
|
61
|
+
} else {
|
|
62
|
+
return "/";
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
var thankYouPageLink = (link) => {
|
|
66
|
+
if (!link) {
|
|
67
|
+
return "/thank-you";
|
|
68
|
+
} else {
|
|
69
|
+
if ((link == null ? void 0 : link.linkType) === "linkInternal") {
|
|
70
|
+
return `/${link == null ? void 0 : link.internalLink}`;
|
|
71
|
+
} else {
|
|
72
|
+
return link == null ? void 0 : link.externalLink;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
// src/signin_signup_b.tsx
|
|
78
|
+
var import_jsx_runtime = require("react/jsx-runtime");
|
|
79
|
+
function SigninSignup_B({ logo, form, formLinks, signInLink }) {
|
|
80
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_section.Section, { className: "py-10 bg-primary lg:py-20", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_container.Container, { maxWidth: 1280, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_container.Container, { maxWidth: 576, children: [
|
|
81
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(LogoSection, { logo }),
|
|
82
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_card.Card, { borderRadius: "md", className: "p-6 mb-6 bg-white lg:mb-10 lg:p-12", children: [
|
|
83
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SubtitleAndHeadingText, { form }),
|
|
84
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SignupForm, { form, signInLink })
|
|
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 text-3xl font-bold leading-none text-white"
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
}
|
|
111
|
+
) });
|
|
112
|
+
}
|
|
113
|
+
function SubtitleAndHeadingText({ form }) {
|
|
114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "mb-6", children: [
|
|
115
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_text.Text, { muted: true, children: form == null ? void 0 : form.subtitle }),
|
|
116
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_heading.Heading, { className: "text-2xl lg:text-2xl", children: form == null ? void 0 : form.name })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
function SignupForm({ form, signInLink }) {
|
|
120
|
+
var _a;
|
|
121
|
+
if (!(form == null ? void 0 : form.fields)) return null;
|
|
122
|
+
const [showPasswords, setShowPasswords] = import_react.default.useState({});
|
|
123
|
+
const togglePasswordVisibility = (fieldName) => {
|
|
124
|
+
setShowPasswords((prev) => ({
|
|
125
|
+
...prev,
|
|
126
|
+
[fieldName]: !prev[fieldName]
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
130
|
+
import_form.Form,
|
|
131
|
+
{
|
|
132
|
+
id: (_a = form == null ? void 0 : form.id) != null ? _a : void 0,
|
|
133
|
+
name: "SignUp-VariantB-Form",
|
|
134
|
+
className: "form-signup",
|
|
135
|
+
thankyouPage: thankYouPageLink(form == null ? void 0 : form.thankYouPage),
|
|
136
|
+
children: [
|
|
137
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
138
|
+
FormFields,
|
|
139
|
+
{
|
|
140
|
+
form,
|
|
141
|
+
showPassword: showPasswords,
|
|
142
|
+
togglePasswordVisibility
|
|
143
|
+
}
|
|
144
|
+
),
|
|
145
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "webriq-recaptcha" }) }),
|
|
146
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "text-center", children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormButtonLabel, { form }),
|
|
148
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(SigninLink, { signInLink })
|
|
149
|
+
] })
|
|
150
|
+
]
|
|
151
|
+
}
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
function FormFields({
|
|
155
|
+
form,
|
|
156
|
+
showPassword,
|
|
157
|
+
togglePasswordVisibility
|
|
158
|
+
}) {
|
|
159
|
+
var _a, _b, _c, _d;
|
|
160
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_react.default.Fragment, { children: [
|
|
161
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_flex.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) => {
|
|
162
|
+
var _a2;
|
|
163
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "w-full", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
164
|
+
import_form_field.FormField,
|
|
165
|
+
{
|
|
166
|
+
noLabel: true,
|
|
167
|
+
variant: "secondary",
|
|
168
|
+
placeholder: formFields == null ? void 0 : formFields.placeholder,
|
|
169
|
+
required: formFields == null ? void 0 : formFields.isRequired,
|
|
170
|
+
name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
|
|
171
|
+
items: formFields == null ? void 0 : formFields.items,
|
|
172
|
+
type: formFields == null ? void 0 : formFields.type,
|
|
173
|
+
...formFields
|
|
174
|
+
}
|
|
175
|
+
) }, index);
|
|
176
|
+
}) }),
|
|
177
|
+
(_d = (_c = form == null ? void 0 : form.fields) == null ? void 0 : _c.slice(2)) == null ? void 0 : _d.map((formFields, index) => {
|
|
178
|
+
var _a2;
|
|
179
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "my-3", children: (formFields == null ? void 0 : formFields.type) === "inputPassword" && formFields.name ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
180
|
+
PasswordField,
|
|
181
|
+
{
|
|
182
|
+
formFields,
|
|
183
|
+
showPassword: showPassword[formFields.name] || false,
|
|
184
|
+
togglePassword: () => togglePasswordVisibility(formFields.name)
|
|
185
|
+
}
|
|
186
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
187
|
+
import_form_field.FormField,
|
|
188
|
+
{
|
|
189
|
+
noLabel: true,
|
|
190
|
+
variant: "secondary",
|
|
191
|
+
name: (_a2 = formFields == null ? void 0 : formFields.name) != null ? _a2 : "",
|
|
192
|
+
placeholder: formFields == null ? void 0 : formFields.placeholder,
|
|
193
|
+
required: formFields == null ? void 0 : formFields.isRequired,
|
|
194
|
+
items: formFields == null ? void 0 : formFields.items,
|
|
195
|
+
type: formFields == null ? void 0 : formFields.type,
|
|
196
|
+
...formFields
|
|
197
|
+
}
|
|
198
|
+
) }, index);
|
|
199
|
+
})
|
|
200
|
+
] });
|
|
201
|
+
}
|
|
202
|
+
function PasswordField({
|
|
203
|
+
formFields,
|
|
204
|
+
showPassword,
|
|
205
|
+
togglePassword
|
|
206
|
+
}) {
|
|
207
|
+
var _a;
|
|
208
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: "flex", children: [
|
|
209
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
210
|
+
import_input.Input,
|
|
211
|
+
{
|
|
212
|
+
noLabel: true,
|
|
213
|
+
ariaLabel: (_a = formFields == null ? void 0 : formFields.placeholder) != null ? _a : formFields == null ? void 0 : formFields.name,
|
|
214
|
+
variant: "secondary",
|
|
215
|
+
type: showPassword ? "text" : "password",
|
|
216
|
+
placeholder: formFields == null ? void 0 : formFields.placeholder,
|
|
217
|
+
name: formFields == null ? void 0 : formFields.name,
|
|
218
|
+
required: formFields == null ? void 0 : formFields.isRequired
|
|
219
|
+
}
|
|
220
|
+
),
|
|
221
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
222
|
+
import_button.Button,
|
|
223
|
+
{
|
|
224
|
+
variant: "unstyled",
|
|
225
|
+
as: "button",
|
|
226
|
+
ariaLabel: showPassword ? "Show password" : "Hide password",
|
|
227
|
+
className: "focus:outline-none mr-4",
|
|
228
|
+
type: "button",
|
|
229
|
+
onClick: togglePassword,
|
|
230
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(PasswordIcon, { showPassword })
|
|
231
|
+
}
|
|
232
|
+
)
|
|
233
|
+
] });
|
|
234
|
+
}
|
|
235
|
+
function FormButtonLabel({ form }) {
|
|
236
|
+
var _a;
|
|
237
|
+
if (!(form == null ? void 0 : form.buttonLabel)) return null;
|
|
238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
239
|
+
import_button.Button,
|
|
240
|
+
{
|
|
241
|
+
as: "button",
|
|
242
|
+
className: "w-full py-4 mb-3",
|
|
243
|
+
ariaLabel: (_a = form == null ? void 0 : form.buttonLabel) != null ? _a : "Sign Up form submit button",
|
|
244
|
+
variant: "custom",
|
|
245
|
+
type: "submit",
|
|
246
|
+
children: form == null ? void 0 : form.buttonLabel
|
|
247
|
+
}
|
|
248
|
+
);
|
|
249
|
+
}
|
|
250
|
+
function SigninLink({ signInLink }) {
|
|
251
|
+
if (!(signInLink == null ? void 0 : signInLink.label)) return null;
|
|
252
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: "text-xs text-gray-900", children: [
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { children: "Already have an account?" }),
|
|
254
|
+
" ",
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
256
|
+
import_button.Button,
|
|
257
|
+
{
|
|
258
|
+
as: "link",
|
|
259
|
+
variant: "link",
|
|
260
|
+
link: signInLink,
|
|
261
|
+
className: "text-xs text-primary hover:underline",
|
|
262
|
+
ariaLabel: signInLink == null ? void 0 : signInLink.label,
|
|
263
|
+
children: signInLink == null ? void 0 : signInLink.label
|
|
264
|
+
}
|
|
265
|
+
)
|
|
266
|
+
] });
|
|
267
|
+
}
|
|
268
|
+
function FormLinks({ formLinks }) {
|
|
269
|
+
if (!formLinks) return null;
|
|
270
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: "text-xs text-center text-secondary-foreground", children: formLinks == null ? void 0 : formLinks.map((link, index, { length }) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { children: [
|
|
271
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
272
|
+
import_button.Button,
|
|
273
|
+
{
|
|
274
|
+
as: "link",
|
|
275
|
+
variant: "link",
|
|
276
|
+
link,
|
|
277
|
+
className: "text-xs underline text-secondary-foreground hover:text-gray-50",
|
|
278
|
+
ariaLabel: link == null ? void 0 : link.label,
|
|
279
|
+
children: link == null ? void 0 : link.label
|
|
280
|
+
}
|
|
281
|
+
),
|
|
282
|
+
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" })
|
|
283
|
+
] }, index)) });
|
|
284
|
+
}
|
|
285
|
+
function PasswordIcon({ showPassword }) {
|
|
286
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: showPassword ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
287
|
+
"svg",
|
|
288
|
+
{
|
|
289
|
+
className: "w-5 h-5 my-auto ml-4 text-gray-500",
|
|
290
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
291
|
+
"aria-hidden": "true",
|
|
292
|
+
role: "img",
|
|
293
|
+
width: "1em",
|
|
294
|
+
height: "1em",
|
|
295
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
296
|
+
viewBox: "0 0 16 16",
|
|
297
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "currentColor", children: [
|
|
298
|
+
/* @__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" }),
|
|
299
|
+
/* @__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" }),
|
|
300
|
+
/* @__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" })
|
|
301
|
+
] })
|
|
302
|
+
}
|
|
303
|
+
) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
304
|
+
"svg",
|
|
305
|
+
{
|
|
306
|
+
className: "w-5 h-5 my-auto ml-4 text-gray-500",
|
|
307
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
308
|
+
"aria-hidden": "true",
|
|
309
|
+
role: "img",
|
|
310
|
+
width: "1em",
|
|
311
|
+
height: "1em",
|
|
312
|
+
preserveAspectRatio: "xMidYMid meet",
|
|
313
|
+
viewBox: "0 0 16 16",
|
|
314
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", { fill: "currentColor", children: [
|
|
315
|
+
/* @__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" }),
|
|
316
|
+
/* @__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" })
|
|
317
|
+
] })
|
|
318
|
+
}
|
|
319
|
+
) });
|
|
320
|
+
}
|
|
321
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
322
|
+
0 && (module.exports = {
|
|
323
|
+
SigninSignup_B
|
|
324
|
+
});
|
package/dist/signin_signup_b.mjs
CHANGED
package/dist/types.js
CHANGED
|
@@ -1 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/types.ts
|
|
17
|
+
var types_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(types_exports);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackshift-ui/signin-signup",
|
|
3
3
|
"description": "",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.6",
|
|
5
5
|
"private": false,
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/index.js",
|
|
@@ -29,25 +29,25 @@
|
|
|
29
29
|
"typescript": "^5.6.2",
|
|
30
30
|
"vite-tsconfig-paths": "^5.0.1",
|
|
31
31
|
"vitest": "^2.1.1",
|
|
32
|
-
"@stackshift-ui/
|
|
33
|
-
"@stackshift-ui/
|
|
32
|
+
"@stackshift-ui/typescript-config": "6.0.2",
|
|
33
|
+
"@stackshift-ui/eslint-config": "6.0.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"classnames": "^2.5.1",
|
|
37
37
|
"@stackshift-ui/scripts": "6.0.2",
|
|
38
|
-
"@stackshift-ui/system": "6.0.3",
|
|
39
|
-
"@stackshift-ui/button": "6.0.3",
|
|
40
38
|
"@stackshift-ui/card": "6.0.3",
|
|
39
|
+
"@stackshift-ui/system": "6.0.3",
|
|
41
40
|
"@stackshift-ui/heading": "6.0.3",
|
|
41
|
+
"@stackshift-ui/image": "6.0.3",
|
|
42
|
+
"@stackshift-ui/input": "6.0.4",
|
|
42
43
|
"@stackshift-ui/text": "6.0.3",
|
|
43
44
|
"@stackshift-ui/link": "6.0.3",
|
|
44
|
-
"@stackshift-ui/
|
|
45
|
-
"@stackshift-ui/container": "6.0.3",
|
|
46
|
-
"@stackshift-ui/section": "6.0.3",
|
|
45
|
+
"@stackshift-ui/form-field": "6.0.5",
|
|
47
46
|
"@stackshift-ui/form": "6.0.3",
|
|
48
47
|
"@stackshift-ui/flex": "6.0.3",
|
|
49
|
-
"@stackshift-ui/
|
|
50
|
-
"@stackshift-ui/
|
|
48
|
+
"@stackshift-ui/section": "6.0.3",
|
|
49
|
+
"@stackshift-ui/button": "6.0.3",
|
|
50
|
+
"@stackshift-ui/container": "6.0.3"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"@types/react": "16.8 - 19",
|
package/src/signin_signup_a.tsx
CHANGED
|
@@ -144,7 +144,18 @@ function FormFields({
|
|
|
144
144
|
type="text"
|
|
145
145
|
/>
|
|
146
146
|
) : (
|
|
147
|
-
<FormField
|
|
147
|
+
<FormField
|
|
148
|
+
className="py-4"
|
|
149
|
+
textSize="sm"
|
|
150
|
+
noLabel
|
|
151
|
+
variant="primary"
|
|
152
|
+
name={formFields?.name ?? ""}
|
|
153
|
+
placeholder={formFields?.placeholder}
|
|
154
|
+
required={formFields?.isRequired}
|
|
155
|
+
items={formFields?.items}
|
|
156
|
+
type={formFields?.type}
|
|
157
|
+
{...formFields}
|
|
158
|
+
/>
|
|
148
159
|
)}
|
|
149
160
|
</div>
|
|
150
161
|
))}
|
package/dist/chunk-GHFZYE3G.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{a as b,b as w}from"./chunk-4DDN6JI4.mjs";import{Button as r}from"@stackshift-ui/button";import{Container as y}from"@stackshift-ui/container";import{Flex as v}from"@stackshift-ui/flex";import{Form as S}from"@stackshift-ui/form";import{FormField as g}from"@stackshift-ui/form-field";import{Heading as d}from"@stackshift-ui/heading";import{Image as o}from"@stackshift-ui/image";import{Input as N}from"@stackshift-ui/input";import{Link as z}from"@stackshift-ui/link";import{Section as A}from"@stackshift-ui/section";import{Text as L}from"@stackshift-ui/text";import R from"react";import{Fragment as P,jsx as e,jsxs as s}from"react/jsx-runtime";function C({logo:a,form:n,formLinks:p,signInLink:u}){return e(A,{className:"py-10 rounded-md bg-gray-50 lg:py-20",children:s(y,{maxWidth:576,children:[e(M,{logo:a}),s(y,{className:"mb-6 text-center lg:mb-10",children:[e(q,{form:n}),e(B,{form:n,signInLink:u,thankYouPage:w(n==null?void 0:n.thankYouPage)})]}),e(U,{formLinks:p})]})})}function M({logo:a}){var n;return a?e("div",{className:"mb-10",children:e(z,{"aria-label":`Go to ${b(a)==="/"?"home page":b(a)}`,className:"flex justify-center mx-auto text-3xl font-bold leading-none",href:b(a),target:a==null?void 0:a.linkTarget,rel:(a==null?void 0:a.linkTarget)==="_blank"?"noopener noreferrer":"",children:e(o,{src:a==null?void 0:a.image,alt:(n=a==null?void 0:a.alt)!=null?n:"signup-logo",width:100,height:100,className:"flex justify-center mx-auto text-3xl font-bold leading-none"})})}):null}function q({form:a}){return s("div",{className:"mb-6",children:[a!=null&&a.subtitle?e(L,{muted:!0,children:a==null?void 0:a.subtitle}):null,a!=null&&a.name?e(d,{className:"text-2xl lg:text-2xl",children:a==null?void 0:a.name}):null]})}function B({form:a,signInLink:n,thankYouPage:p}){var l,c;if(!(a!=null&&a.fields))return null;let[u,i]=R.useState({}),t=x=>{i(h=>({...h,[x]:!h[x]}))};return s(S,{id:(l=a==null?void 0:a.id)!=null?l:void 0,name:"SignUp-VariantA-Form",className:"form-signup",thankyouPage:p,children:[e(T,{form:a,showPasswords:u,togglePasswordVisibility:t}),e("div",{children:e("div",{className:"webriq-recaptcha"})}),e("div",{className:"text-center",children:(a==null?void 0:a.buttonLabel)&&e(r,{as:"button",variant:"custom",ariaLabel:(c=a==null?void 0:a.buttonLabel)!=null?c:"Sign Up form submit button",className:"w-full py-4 text-sm font-bold tex-gray-50",type:"submit",children:a==null?void 0:a.buttonLabel})}),n&&e(Y,{signInLink:n})]})}function T({form:a,showPasswords:n,togglePasswordVisibility:p}){var u,i;return s(P,{children:[e(v,{wrap:!0,className:"-mx-2",children:(u=a==null?void 0:a.fields)==null?void 0:u.slice(0,2).map((t,l)=>{var c;return e("div",{className:"w-full px-2 mb-3 lg:w-1/2",children:t.type==="inputText"?e(N,{textSize:"sm",variant:"primary",noLabel:!0,placeholder:t==null?void 0:t.placeholder,required:t==null?void 0:t.isRequired,className:"w-full py-4 text-xs bg-white",name:t==null?void 0:t.name,ariaLabel:t==null?void 0:t.label,...t,type:"text"}):e(g,{textSize:"sm",noLabel:!0,name:(c=t==null?void 0:t.name)!=null?c:"",...t})},l)})}),(i=a==null?void 0:a.fields)==null?void 0:i.slice(2).map((t,l)=>{var c;return e("div",{className:"my-3",children:t.type==="inputPassword"&&t.name?e(H,{formFields:t,showPassword:n[t.name]||!1,togglePassword:()=>p(t.name)}):e(g,{className:"py-4",textSize:"sm",noLabel:!0,variant:"primary",placeholder:t==null?void 0:t.placeholder,required:t==null?void 0:t.isRequired,name:(c=t==null?void 0:t.name)!=null?c:"",items:t==null?void 0:t.items,type:t==null?void 0:t.type,...t})},l)})]})}function Y({signInLink:a}){return a!=null&&a.label?s("div",{className:"w-full text-center mt-3",children:[e("span",{className:"text-xs text-gray-500",children:"Already have an account? "}),e(r,{as:"link",variant:"link",link:a,className:"text-xs text-primary cursor-pointer hover:underline",ariaLabel:a==null?void 0:a.label,children:a==null?void 0:a.label})]}):null}function H({formFields:a,showPassword:n,togglePassword:p}){var u;return s(v,{className:"relative",children:[e(N,{className:"py-4",textSize:"sm",noLabel:!0,"aria-label":(u=a==null?void 0:a.placeholder)!=null?u:a==null?void 0:a.name,variant:"primary",type:n?"text":"password",placeholder:a==null?void 0:a.placeholder,name:a==null?void 0:a.name,required:a==null?void 0:a.isRequired}),e(r,{as:"button",variant:"unstyled",ariaLabel:n?"Show password":"Hide password",className:"absolute top-0 right-0 h-full p-2",type:"button",onClick:p,children:e(V,{showPassword:n})})]})}function U({formLinks:a}){return a?e("p",{className:"mt-10 text-xs text-center text-gray-700",children:a==null?void 0:a.map((n,p,{length:u})=>s("span",{children:[e(r,{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}),p===u-1?null:p===u-2?e("span",{children:"\xA0and\xA0"}):e("span",{children:"\xA0,\xA0"})]},p))}):null}function V({showPassword:a}){return e(P,{children:a?e("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:s("g",{fill:"currentColor",children:[e("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"}),e("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"}),e("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"})]})}):e("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:s("g",{fill:"currentColor",children:[e("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"}),e("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"})]})})})}export{C as a};
|
|
File without changes
|