@sikka/hawa 0.17.6-next → 0.17.7-next
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.d.mts +35 -35
- package/dist/index.d.ts +35 -35
- package/dist/index.js +24 -17
- package/dist/index.mjs +24 -17
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1247,36 +1247,36 @@ type LoginFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
|
1247
1247
|
loginText?: string;
|
|
1248
1248
|
};
|
|
1249
1249
|
type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
1250
|
-
fullName
|
|
1250
|
+
fullName?: BaseInputType;
|
|
1251
1251
|
email?: TextInputType;
|
|
1252
1252
|
username?: UsernameInputType;
|
|
1253
1253
|
password?: PasswordInputType;
|
|
1254
1254
|
confirm?: ConfirmInputType;
|
|
1255
|
-
userReference
|
|
1256
|
-
subscribeToNewsletter
|
|
1257
|
-
termsRequired
|
|
1258
|
-
refCode
|
|
1259
|
-
refCodePlaceholder
|
|
1260
|
-
existingUserText
|
|
1261
|
-
termsText
|
|
1262
|
-
iAcceptText
|
|
1263
|
-
registerText
|
|
1264
|
-
loginText
|
|
1255
|
+
userReference?: BaseInputType;
|
|
1256
|
+
subscribeToNewsletter?: string;
|
|
1257
|
+
termsRequired?: string;
|
|
1258
|
+
refCode?: string;
|
|
1259
|
+
refCodePlaceholder?: string;
|
|
1260
|
+
existingUserText?: string;
|
|
1261
|
+
termsText?: string;
|
|
1262
|
+
iAcceptText?: string;
|
|
1263
|
+
registerText?: string;
|
|
1264
|
+
loginText?: string;
|
|
1265
1265
|
};
|
|
1266
1266
|
type ResetPasswordTextsTypes = {
|
|
1267
|
-
email
|
|
1268
|
-
emailSentText
|
|
1269
|
-
registerText
|
|
1270
|
-
resetPassword
|
|
1271
|
-
dontHaveAccount
|
|
1267
|
+
email?: TextInputType;
|
|
1268
|
+
emailSentText?: string;
|
|
1269
|
+
registerText?: string;
|
|
1270
|
+
resetPassword?: string;
|
|
1271
|
+
dontHaveAccount?: string;
|
|
1272
1272
|
headTitle?: string;
|
|
1273
1273
|
headDescription?: string;
|
|
1274
1274
|
};
|
|
1275
1275
|
type NewPasswordTextsTypes = {
|
|
1276
1276
|
password?: PasswordInputType;
|
|
1277
1277
|
confirm?: ConfirmInputType;
|
|
1278
|
-
updatePassword
|
|
1279
|
-
passwordChanged
|
|
1278
|
+
updatePassword?: string;
|
|
1279
|
+
passwordChanged?: string;
|
|
1280
1280
|
dontHaveAccount?: string;
|
|
1281
1281
|
registerText?: string;
|
|
1282
1282
|
};
|
|
@@ -1335,45 +1335,45 @@ declare const LoginForm: FC<LoginFormTypes>;
|
|
|
1335
1335
|
|
|
1336
1336
|
type RegisterFormTypes = {
|
|
1337
1337
|
/** Object containing text labels used throughout the form. */
|
|
1338
|
-
texts
|
|
1338
|
+
texts?: RegisterFormTextsTypes;
|
|
1339
1339
|
/** Direction of text and layout, either 'rtl' (right-to-left) or 'ltr' (left-to-right). */
|
|
1340
1340
|
direction?: DirectionType;
|
|
1341
1341
|
/** Determines whether to display logos only or with text in the social media registration section. */
|
|
1342
1342
|
logosOnly?: boolean;
|
|
1343
1343
|
/** Enables registration via Google when set to true. */
|
|
1344
|
-
viaGoogle
|
|
1344
|
+
viaGoogle?: boolean;
|
|
1345
1345
|
/** Enables registration via Github when set to true. */
|
|
1346
|
-
viaGithub
|
|
1346
|
+
viaGithub?: boolean;
|
|
1347
1347
|
/** Enables registration via Twitter when set to true. */
|
|
1348
|
-
viaTwitter
|
|
1348
|
+
viaTwitter?: boolean;
|
|
1349
1349
|
/** Determines whether to show the referral code field. */
|
|
1350
|
-
showRefCode
|
|
1350
|
+
showRefCode?: boolean;
|
|
1351
1351
|
/** Determines whether to show the user source selection. */
|
|
1352
|
-
showUserSource
|
|
1352
|
+
showUserSource?: boolean;
|
|
1353
1353
|
/** Determines whether to show the terms acceptance checkbox. */
|
|
1354
|
-
showTermsOption
|
|
1354
|
+
showTermsOption?: boolean;
|
|
1355
1355
|
/** Determines whether to show the newsletter subscription checkbox. */
|
|
1356
|
-
showNewsletterOption
|
|
1356
|
+
showNewsletterOption?: boolean;
|
|
1357
1357
|
/** Callback function triggered on form submission. */
|
|
1358
1358
|
onRegister: (e: any) => void;
|
|
1359
1359
|
/** Callback function triggered to route to the login page. */
|
|
1360
|
-
onRouteToLogin
|
|
1360
|
+
onRouteToLogin?: () => void;
|
|
1361
1361
|
/** Callback function triggered to handle registration via Google. */
|
|
1362
|
-
onGoogleRegister
|
|
1362
|
+
onGoogleRegister?: () => void;
|
|
1363
1363
|
/** Callback function triggered to handle registration via Github. */
|
|
1364
|
-
onGithubRegister
|
|
1364
|
+
onGithubRegister?: () => void;
|
|
1365
1365
|
/** Callback function triggered to handle registration via Twitter. */
|
|
1366
|
-
onTwitterRegister
|
|
1366
|
+
onTwitterRegister?: () => void;
|
|
1367
1367
|
/** Callback function triggered to route to the Terms of Service page. */
|
|
1368
|
-
onRouteToTOS
|
|
1368
|
+
onRouteToTOS?: () => void;
|
|
1369
1369
|
/** Determines whether to show an error alert. */
|
|
1370
|
-
showError
|
|
1370
|
+
showError?: boolean;
|
|
1371
1371
|
/** Title for the error alert. */
|
|
1372
|
-
errorTitle
|
|
1372
|
+
errorTitle?: any;
|
|
1373
1373
|
/** Text for the error alert. */
|
|
1374
|
-
errorText
|
|
1374
|
+
errorText?: any;
|
|
1375
1375
|
/** Array containing the fields to be included in the form. */
|
|
1376
|
-
registerFields
|
|
1376
|
+
registerFields?: string[];
|
|
1377
1377
|
/** Indicates whether the form submission is in progress. */
|
|
1378
1378
|
isLoading?: boolean;
|
|
1379
1379
|
/** If true, a loading spinner is displayed within the Google login button. */
|
package/dist/index.d.ts
CHANGED
|
@@ -1247,36 +1247,36 @@ type LoginFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
|
1247
1247
|
loginText?: string;
|
|
1248
1248
|
};
|
|
1249
1249
|
type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
1250
|
-
fullName
|
|
1250
|
+
fullName?: BaseInputType;
|
|
1251
1251
|
email?: TextInputType;
|
|
1252
1252
|
username?: UsernameInputType;
|
|
1253
1253
|
password?: PasswordInputType;
|
|
1254
1254
|
confirm?: ConfirmInputType;
|
|
1255
|
-
userReference
|
|
1256
|
-
subscribeToNewsletter
|
|
1257
|
-
termsRequired
|
|
1258
|
-
refCode
|
|
1259
|
-
refCodePlaceholder
|
|
1260
|
-
existingUserText
|
|
1261
|
-
termsText
|
|
1262
|
-
iAcceptText
|
|
1263
|
-
registerText
|
|
1264
|
-
loginText
|
|
1255
|
+
userReference?: BaseInputType;
|
|
1256
|
+
subscribeToNewsletter?: string;
|
|
1257
|
+
termsRequired?: string;
|
|
1258
|
+
refCode?: string;
|
|
1259
|
+
refCodePlaceholder?: string;
|
|
1260
|
+
existingUserText?: string;
|
|
1261
|
+
termsText?: string;
|
|
1262
|
+
iAcceptText?: string;
|
|
1263
|
+
registerText?: string;
|
|
1264
|
+
loginText?: string;
|
|
1265
1265
|
};
|
|
1266
1266
|
type ResetPasswordTextsTypes = {
|
|
1267
|
-
email
|
|
1268
|
-
emailSentText
|
|
1269
|
-
registerText
|
|
1270
|
-
resetPassword
|
|
1271
|
-
dontHaveAccount
|
|
1267
|
+
email?: TextInputType;
|
|
1268
|
+
emailSentText?: string;
|
|
1269
|
+
registerText?: string;
|
|
1270
|
+
resetPassword?: string;
|
|
1271
|
+
dontHaveAccount?: string;
|
|
1272
1272
|
headTitle?: string;
|
|
1273
1273
|
headDescription?: string;
|
|
1274
1274
|
};
|
|
1275
1275
|
type NewPasswordTextsTypes = {
|
|
1276
1276
|
password?: PasswordInputType;
|
|
1277
1277
|
confirm?: ConfirmInputType;
|
|
1278
|
-
updatePassword
|
|
1279
|
-
passwordChanged
|
|
1278
|
+
updatePassword?: string;
|
|
1279
|
+
passwordChanged?: string;
|
|
1280
1280
|
dontHaveAccount?: string;
|
|
1281
1281
|
registerText?: string;
|
|
1282
1282
|
};
|
|
@@ -1335,45 +1335,45 @@ declare const LoginForm: FC<LoginFormTypes>;
|
|
|
1335
1335
|
|
|
1336
1336
|
type RegisterFormTypes = {
|
|
1337
1337
|
/** Object containing text labels used throughout the form. */
|
|
1338
|
-
texts
|
|
1338
|
+
texts?: RegisterFormTextsTypes;
|
|
1339
1339
|
/** Direction of text and layout, either 'rtl' (right-to-left) or 'ltr' (left-to-right). */
|
|
1340
1340
|
direction?: DirectionType;
|
|
1341
1341
|
/** Determines whether to display logos only or with text in the social media registration section. */
|
|
1342
1342
|
logosOnly?: boolean;
|
|
1343
1343
|
/** Enables registration via Google when set to true. */
|
|
1344
|
-
viaGoogle
|
|
1344
|
+
viaGoogle?: boolean;
|
|
1345
1345
|
/** Enables registration via Github when set to true. */
|
|
1346
|
-
viaGithub
|
|
1346
|
+
viaGithub?: boolean;
|
|
1347
1347
|
/** Enables registration via Twitter when set to true. */
|
|
1348
|
-
viaTwitter
|
|
1348
|
+
viaTwitter?: boolean;
|
|
1349
1349
|
/** Determines whether to show the referral code field. */
|
|
1350
|
-
showRefCode
|
|
1350
|
+
showRefCode?: boolean;
|
|
1351
1351
|
/** Determines whether to show the user source selection. */
|
|
1352
|
-
showUserSource
|
|
1352
|
+
showUserSource?: boolean;
|
|
1353
1353
|
/** Determines whether to show the terms acceptance checkbox. */
|
|
1354
|
-
showTermsOption
|
|
1354
|
+
showTermsOption?: boolean;
|
|
1355
1355
|
/** Determines whether to show the newsletter subscription checkbox. */
|
|
1356
|
-
showNewsletterOption
|
|
1356
|
+
showNewsletterOption?: boolean;
|
|
1357
1357
|
/** Callback function triggered on form submission. */
|
|
1358
1358
|
onRegister: (e: any) => void;
|
|
1359
1359
|
/** Callback function triggered to route to the login page. */
|
|
1360
|
-
onRouteToLogin
|
|
1360
|
+
onRouteToLogin?: () => void;
|
|
1361
1361
|
/** Callback function triggered to handle registration via Google. */
|
|
1362
|
-
onGoogleRegister
|
|
1362
|
+
onGoogleRegister?: () => void;
|
|
1363
1363
|
/** Callback function triggered to handle registration via Github. */
|
|
1364
|
-
onGithubRegister
|
|
1364
|
+
onGithubRegister?: () => void;
|
|
1365
1365
|
/** Callback function triggered to handle registration via Twitter. */
|
|
1366
|
-
onTwitterRegister
|
|
1366
|
+
onTwitterRegister?: () => void;
|
|
1367
1367
|
/** Callback function triggered to route to the Terms of Service page. */
|
|
1368
|
-
onRouteToTOS
|
|
1368
|
+
onRouteToTOS?: () => void;
|
|
1369
1369
|
/** Determines whether to show an error alert. */
|
|
1370
|
-
showError
|
|
1370
|
+
showError?: boolean;
|
|
1371
1371
|
/** Title for the error alert. */
|
|
1372
|
-
errorTitle
|
|
1372
|
+
errorTitle?: any;
|
|
1373
1373
|
/** Text for the error alert. */
|
|
1374
|
-
errorText
|
|
1374
|
+
errorText?: any;
|
|
1375
1375
|
/** Array containing the fields to be included in the form. */
|
|
1376
|
-
registerFields
|
|
1376
|
+
registerFields?: string[];
|
|
1377
1377
|
/** Indicates whether the form submission is in progress. */
|
|
1378
1378
|
isLoading?: boolean;
|
|
1379
1379
|
/** If true, a loading spinner is displayed within the Google login button. */
|
package/dist/index.js
CHANGED
|
@@ -9127,7 +9127,11 @@ var import_react49 = __toESM(require("react"));
|
|
|
9127
9127
|
var import_react_hook_form2 = require("react-hook-form");
|
|
9128
9128
|
var import_zod2 = require("@hookform/resolvers/zod");
|
|
9129
9129
|
var z2 = __toESM(require("zod"));
|
|
9130
|
-
var RegisterForm = ({
|
|
9130
|
+
var RegisterForm = ({
|
|
9131
|
+
texts,
|
|
9132
|
+
registerFields = ["email"],
|
|
9133
|
+
...props
|
|
9134
|
+
}) => {
|
|
9131
9135
|
var _a, _b, _c, _d, _e, _f;
|
|
9132
9136
|
const [passwordVisible, setPasswordVisible] = (0, import_react49.useState)(false);
|
|
9133
9137
|
const thirdPartyAuthTexts = {
|
|
@@ -9141,7 +9145,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9141
9145
|
};
|
|
9142
9146
|
const methods = (0, import_react_hook_form2.useForm)();
|
|
9143
9147
|
let fieldSchemas = {};
|
|
9144
|
-
|
|
9148
|
+
registerFields.forEach((field) => {
|
|
9145
9149
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
9146
9150
|
switch (field) {
|
|
9147
9151
|
case "fullname":
|
|
@@ -9202,7 +9206,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9202
9206
|
}),
|
|
9203
9207
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
|
9204
9208
|
},
|
|
9205
|
-
/* @__PURE__ */ import_react49.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" },
|
|
9209
|
+
/* @__PURE__ */ import_react49.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
|
9206
9210
|
if (fld === "fullname") {
|
|
9207
9211
|
return /* @__PURE__ */ import_react49.default.createElement(
|
|
9208
9212
|
import_react_hook_form2.Controller,
|
|
@@ -9358,21 +9362,24 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9358
9362
|
{
|
|
9359
9363
|
control,
|
|
9360
9364
|
name: "reference",
|
|
9361
|
-
render: ({ field }) =>
|
|
9362
|
-
|
|
9363
|
-
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9365
|
+
render: ({ field }) => {
|
|
9366
|
+
var _a2, _b2;
|
|
9367
|
+
return /* @__PURE__ */ import_react49.default.createElement(
|
|
9368
|
+
Select,
|
|
9369
|
+
{
|
|
9370
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
|
9371
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
|
9372
|
+
isCreatable: false,
|
|
9373
|
+
isMulti: false,
|
|
9374
|
+
isSearchable: false,
|
|
9375
|
+
isClearable: false,
|
|
9376
|
+
options: props.userReferenceOptions,
|
|
9377
|
+
onChange: (e) => {
|
|
9378
|
+
field.onChange(e.value);
|
|
9379
|
+
}
|
|
9373
9380
|
}
|
|
9374
|
-
|
|
9375
|
-
|
|
9381
|
+
);
|
|
9382
|
+
}
|
|
9376
9383
|
}
|
|
9377
9384
|
),
|
|
9378
9385
|
/* @__PURE__ */ import_react49.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3" }, props.showTermsOption && /* @__PURE__ */ import_react49.default.createElement(
|
package/dist/index.mjs
CHANGED
|
@@ -8922,7 +8922,11 @@ import React76, { useState as useState29 } from "react";
|
|
|
8922
8922
|
import { Controller as Controller2, FormProvider, useForm as useForm2 } from "react-hook-form";
|
|
8923
8923
|
import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
|
|
8924
8924
|
import * as z2 from "zod";
|
|
8925
|
-
var RegisterForm = ({
|
|
8925
|
+
var RegisterForm = ({
|
|
8926
|
+
texts,
|
|
8927
|
+
registerFields = ["email"],
|
|
8928
|
+
...props
|
|
8929
|
+
}) => {
|
|
8926
8930
|
var _a, _b, _c, _d, _e, _f;
|
|
8927
8931
|
const [passwordVisible, setPasswordVisible] = useState29(false);
|
|
8928
8932
|
const thirdPartyAuthTexts = {
|
|
@@ -8936,7 +8940,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
8936
8940
|
};
|
|
8937
8941
|
const methods = useForm2();
|
|
8938
8942
|
let fieldSchemas = {};
|
|
8939
|
-
|
|
8943
|
+
registerFields.forEach((field) => {
|
|
8940
8944
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
8941
8945
|
switch (field) {
|
|
8942
8946
|
case "fullname":
|
|
@@ -8997,7 +9001,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
8997
9001
|
}),
|
|
8998
9002
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
|
8999
9003
|
},
|
|
9000
|
-
/* @__PURE__ */ React76.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" },
|
|
9004
|
+
/* @__PURE__ */ React76.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-4" }, registerFields.map((fld, i) => {
|
|
9001
9005
|
if (fld === "fullname") {
|
|
9002
9006
|
return /* @__PURE__ */ React76.createElement(
|
|
9003
9007
|
Controller2,
|
|
@@ -9153,21 +9157,24 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9153
9157
|
{
|
|
9154
9158
|
control,
|
|
9155
9159
|
name: "reference",
|
|
9156
|
-
render: ({ field }) =>
|
|
9157
|
-
|
|
9158
|
-
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9160
|
+
render: ({ field }) => {
|
|
9161
|
+
var _a2, _b2;
|
|
9162
|
+
return /* @__PURE__ */ React76.createElement(
|
|
9163
|
+
Select,
|
|
9164
|
+
{
|
|
9165
|
+
label: ((_a2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _a2.label) || "How did you learn about us?",
|
|
9166
|
+
placeholder: (_b2 = texts == null ? void 0 : texts.userReference) == null ? void 0 : _b2.placeholder,
|
|
9167
|
+
isCreatable: false,
|
|
9168
|
+
isMulti: false,
|
|
9169
|
+
isSearchable: false,
|
|
9170
|
+
isClearable: false,
|
|
9171
|
+
options: props.userReferenceOptions,
|
|
9172
|
+
onChange: (e) => {
|
|
9173
|
+
field.onChange(e.value);
|
|
9174
|
+
}
|
|
9168
9175
|
}
|
|
9169
|
-
|
|
9170
|
-
|
|
9176
|
+
);
|
|
9177
|
+
}
|
|
9171
9178
|
}
|
|
9172
9179
|
),
|
|
9173
9180
|
/* @__PURE__ */ React76.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3" }, props.showTermsOption && /* @__PURE__ */ React76.createElement(
|