@sikka/hawa 0.17.5-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 +44 -55
- package/dist/index.d.ts +44 -55
- package/dist/index.js +34 -37
- package/dist/index.mjs +34 -37
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -888,10 +888,14 @@ type IconCountTypes = {
|
|
|
888
888
|
declare const Count: FC<IconCountTypes>;
|
|
889
889
|
|
|
890
890
|
type TypographyTypes = {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
891
|
+
/** Function to handle language change. */
|
|
892
|
+
handleLanguage?: (e: any) => void;
|
|
893
|
+
/** Current selected language. */
|
|
894
|
+
currentLanguage?: string;
|
|
895
|
+
/** Function to handle theme color mode change. */
|
|
896
|
+
handleColorMode?: (e: any) => void;
|
|
897
|
+
/** Current selected theme color mode. */
|
|
898
|
+
currentColorMode?: "light" | "dark";
|
|
895
899
|
orientation?: OrientationType;
|
|
896
900
|
width?: "default" | "full";
|
|
897
901
|
};
|
|
@@ -1243,50 +1247,43 @@ type LoginFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
|
1243
1247
|
loginText?: string;
|
|
1244
1248
|
};
|
|
1245
1249
|
type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
1246
|
-
fullName
|
|
1250
|
+
fullName?: BaseInputType;
|
|
1247
1251
|
email?: TextInputType;
|
|
1248
1252
|
username?: UsernameInputType;
|
|
1249
1253
|
password?: PasswordInputType;
|
|
1250
1254
|
confirm?: ConfirmInputType;
|
|
1251
|
-
userReference
|
|
1252
|
-
subscribeToNewsletter
|
|
1253
|
-
termsRequired
|
|
1254
|
-
refCode
|
|
1255
|
-
refCodePlaceholder
|
|
1256
|
-
existingUserText
|
|
1257
|
-
termsText
|
|
1258
|
-
iAcceptText
|
|
1259
|
-
registerText
|
|
1260
|
-
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;
|
|
1261
1265
|
};
|
|
1262
1266
|
type ResetPasswordTextsTypes = {
|
|
1263
|
-
email
|
|
1264
|
-
emailSentText
|
|
1265
|
-
registerText
|
|
1266
|
-
resetPassword
|
|
1267
|
-
dontHaveAccount
|
|
1267
|
+
email?: TextInputType;
|
|
1268
|
+
emailSentText?: string;
|
|
1269
|
+
registerText?: string;
|
|
1270
|
+
resetPassword?: string;
|
|
1271
|
+
dontHaveAccount?: string;
|
|
1268
1272
|
headTitle?: string;
|
|
1269
1273
|
headDescription?: string;
|
|
1270
1274
|
};
|
|
1271
1275
|
type NewPasswordTextsTypes = {
|
|
1272
1276
|
password?: PasswordInputType;
|
|
1273
1277
|
confirm?: ConfirmInputType;
|
|
1274
|
-
updatePassword
|
|
1275
|
-
passwordChanged
|
|
1278
|
+
updatePassword?: string;
|
|
1279
|
+
passwordChanged?: string;
|
|
1276
1280
|
dontHaveAccount?: string;
|
|
1277
1281
|
registerText?: string;
|
|
1278
1282
|
};
|
|
1279
1283
|
|
|
1280
1284
|
type LoginFormTypes = {
|
|
1285
|
+
/** Object containing text labels used throughout the form. */
|
|
1281
1286
|
texts?: LoginFormTextsTypes;
|
|
1282
|
-
/** Function to handle language change. */
|
|
1283
|
-
handleLanguage?: () => void;
|
|
1284
|
-
/** Current selected language. */
|
|
1285
|
-
currentLanguage?: string;
|
|
1286
|
-
/** Function to handle theme color mode change. */
|
|
1287
|
-
handleColorMode?: () => void;
|
|
1288
|
-
/** Current selected theme color mode. */
|
|
1289
|
-
currentColorMode?: "light" | "dark";
|
|
1290
1287
|
/** If true, only logos are displayed in third-party auth buttons. */
|
|
1291
1288
|
logosOnly?: boolean;
|
|
1292
1289
|
/** Direction of text and UI elements, either left-to-right or right-to-left. */
|
|
@@ -1338,53 +1335,45 @@ declare const LoginForm: FC<LoginFormTypes>;
|
|
|
1338
1335
|
|
|
1339
1336
|
type RegisterFormTypes = {
|
|
1340
1337
|
/** Object containing text labels used throughout the form. */
|
|
1341
|
-
texts
|
|
1342
|
-
/** Callback function triggered to handle language changes.*/
|
|
1343
|
-
handleLanguage?: () => void;
|
|
1344
|
-
/** The current language being used in the application. */
|
|
1345
|
-
currentLanguage?: any;
|
|
1346
|
-
/** Callback function triggered to handle color mode changes. */
|
|
1347
|
-
handleColorMode?: () => void;
|
|
1348
|
-
/** The current color mode being used in the application. */
|
|
1349
|
-
currentColorMode?: any;
|
|
1338
|
+
texts?: RegisterFormTextsTypes;
|
|
1350
1339
|
/** Direction of text and layout, either 'rtl' (right-to-left) or 'ltr' (left-to-right). */
|
|
1351
1340
|
direction?: DirectionType;
|
|
1352
1341
|
/** Determines whether to display logos only or with text in the social media registration section. */
|
|
1353
1342
|
logosOnly?: boolean;
|
|
1354
1343
|
/** Enables registration via Google when set to true. */
|
|
1355
|
-
viaGoogle
|
|
1344
|
+
viaGoogle?: boolean;
|
|
1356
1345
|
/** Enables registration via Github when set to true. */
|
|
1357
|
-
viaGithub
|
|
1346
|
+
viaGithub?: boolean;
|
|
1358
1347
|
/** Enables registration via Twitter when set to true. */
|
|
1359
|
-
viaTwitter
|
|
1348
|
+
viaTwitter?: boolean;
|
|
1360
1349
|
/** Determines whether to show the referral code field. */
|
|
1361
|
-
showRefCode
|
|
1350
|
+
showRefCode?: boolean;
|
|
1362
1351
|
/** Determines whether to show the user source selection. */
|
|
1363
|
-
showUserSource
|
|
1352
|
+
showUserSource?: boolean;
|
|
1364
1353
|
/** Determines whether to show the terms acceptance checkbox. */
|
|
1365
|
-
showTermsOption
|
|
1354
|
+
showTermsOption?: boolean;
|
|
1366
1355
|
/** Determines whether to show the newsletter subscription checkbox. */
|
|
1367
|
-
showNewsletterOption
|
|
1356
|
+
showNewsletterOption?: boolean;
|
|
1368
1357
|
/** Callback function triggered on form submission. */
|
|
1369
1358
|
onRegister: (e: any) => void;
|
|
1370
1359
|
/** Callback function triggered to route to the login page. */
|
|
1371
|
-
onRouteToLogin
|
|
1360
|
+
onRouteToLogin?: () => void;
|
|
1372
1361
|
/** Callback function triggered to handle registration via Google. */
|
|
1373
|
-
onGoogleRegister
|
|
1362
|
+
onGoogleRegister?: () => void;
|
|
1374
1363
|
/** Callback function triggered to handle registration via Github. */
|
|
1375
|
-
onGithubRegister
|
|
1364
|
+
onGithubRegister?: () => void;
|
|
1376
1365
|
/** Callback function triggered to handle registration via Twitter. */
|
|
1377
|
-
onTwitterRegister
|
|
1366
|
+
onTwitterRegister?: () => void;
|
|
1378
1367
|
/** Callback function triggered to route to the Terms of Service page. */
|
|
1379
|
-
onRouteToTOS
|
|
1368
|
+
onRouteToTOS?: () => void;
|
|
1380
1369
|
/** Determines whether to show an error alert. */
|
|
1381
|
-
showError
|
|
1370
|
+
showError?: boolean;
|
|
1382
1371
|
/** Title for the error alert. */
|
|
1383
|
-
errorTitle
|
|
1372
|
+
errorTitle?: any;
|
|
1384
1373
|
/** Text for the error alert. */
|
|
1385
|
-
errorText
|
|
1374
|
+
errorText?: any;
|
|
1386
1375
|
/** Array containing the fields to be included in the form. */
|
|
1387
|
-
registerFields
|
|
1376
|
+
registerFields?: string[];
|
|
1388
1377
|
/** Indicates whether the form submission is in progress. */
|
|
1389
1378
|
isLoading?: boolean;
|
|
1390
1379
|
/** If true, a loading spinner is displayed within the Google login button. */
|
package/dist/index.d.ts
CHANGED
|
@@ -888,10 +888,14 @@ type IconCountTypes = {
|
|
|
888
888
|
declare const Count: FC<IconCountTypes>;
|
|
889
889
|
|
|
890
890
|
type TypographyTypes = {
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
891
|
+
/** Function to handle language change. */
|
|
892
|
+
handleLanguage?: (e: any) => void;
|
|
893
|
+
/** Current selected language. */
|
|
894
|
+
currentLanguage?: string;
|
|
895
|
+
/** Function to handle theme color mode change. */
|
|
896
|
+
handleColorMode?: (e: any) => void;
|
|
897
|
+
/** Current selected theme color mode. */
|
|
898
|
+
currentColorMode?: "light" | "dark";
|
|
895
899
|
orientation?: OrientationType;
|
|
896
900
|
width?: "default" | "full";
|
|
897
901
|
};
|
|
@@ -1243,50 +1247,43 @@ type LoginFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
|
1243
1247
|
loginText?: string;
|
|
1244
1248
|
};
|
|
1245
1249
|
type RegisterFormTextsTypes = ThirdPartyAuthTextsTypes & {
|
|
1246
|
-
fullName
|
|
1250
|
+
fullName?: BaseInputType;
|
|
1247
1251
|
email?: TextInputType;
|
|
1248
1252
|
username?: UsernameInputType;
|
|
1249
1253
|
password?: PasswordInputType;
|
|
1250
1254
|
confirm?: ConfirmInputType;
|
|
1251
|
-
userReference
|
|
1252
|
-
subscribeToNewsletter
|
|
1253
|
-
termsRequired
|
|
1254
|
-
refCode
|
|
1255
|
-
refCodePlaceholder
|
|
1256
|
-
existingUserText
|
|
1257
|
-
termsText
|
|
1258
|
-
iAcceptText
|
|
1259
|
-
registerText
|
|
1260
|
-
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;
|
|
1261
1265
|
};
|
|
1262
1266
|
type ResetPasswordTextsTypes = {
|
|
1263
|
-
email
|
|
1264
|
-
emailSentText
|
|
1265
|
-
registerText
|
|
1266
|
-
resetPassword
|
|
1267
|
-
dontHaveAccount
|
|
1267
|
+
email?: TextInputType;
|
|
1268
|
+
emailSentText?: string;
|
|
1269
|
+
registerText?: string;
|
|
1270
|
+
resetPassword?: string;
|
|
1271
|
+
dontHaveAccount?: string;
|
|
1268
1272
|
headTitle?: string;
|
|
1269
1273
|
headDescription?: string;
|
|
1270
1274
|
};
|
|
1271
1275
|
type NewPasswordTextsTypes = {
|
|
1272
1276
|
password?: PasswordInputType;
|
|
1273
1277
|
confirm?: ConfirmInputType;
|
|
1274
|
-
updatePassword
|
|
1275
|
-
passwordChanged
|
|
1278
|
+
updatePassword?: string;
|
|
1279
|
+
passwordChanged?: string;
|
|
1276
1280
|
dontHaveAccount?: string;
|
|
1277
1281
|
registerText?: string;
|
|
1278
1282
|
};
|
|
1279
1283
|
|
|
1280
1284
|
type LoginFormTypes = {
|
|
1285
|
+
/** Object containing text labels used throughout the form. */
|
|
1281
1286
|
texts?: LoginFormTextsTypes;
|
|
1282
|
-
/** Function to handle language change. */
|
|
1283
|
-
handleLanguage?: () => void;
|
|
1284
|
-
/** Current selected language. */
|
|
1285
|
-
currentLanguage?: string;
|
|
1286
|
-
/** Function to handle theme color mode change. */
|
|
1287
|
-
handleColorMode?: () => void;
|
|
1288
|
-
/** Current selected theme color mode. */
|
|
1289
|
-
currentColorMode?: "light" | "dark";
|
|
1290
1287
|
/** If true, only logos are displayed in third-party auth buttons. */
|
|
1291
1288
|
logosOnly?: boolean;
|
|
1292
1289
|
/** Direction of text and UI elements, either left-to-right or right-to-left. */
|
|
@@ -1338,53 +1335,45 @@ declare const LoginForm: FC<LoginFormTypes>;
|
|
|
1338
1335
|
|
|
1339
1336
|
type RegisterFormTypes = {
|
|
1340
1337
|
/** Object containing text labels used throughout the form. */
|
|
1341
|
-
texts
|
|
1342
|
-
/** Callback function triggered to handle language changes.*/
|
|
1343
|
-
handleLanguage?: () => void;
|
|
1344
|
-
/** The current language being used in the application. */
|
|
1345
|
-
currentLanguage?: any;
|
|
1346
|
-
/** Callback function triggered to handle color mode changes. */
|
|
1347
|
-
handleColorMode?: () => void;
|
|
1348
|
-
/** The current color mode being used in the application. */
|
|
1349
|
-
currentColorMode?: any;
|
|
1338
|
+
texts?: RegisterFormTextsTypes;
|
|
1350
1339
|
/** Direction of text and layout, either 'rtl' (right-to-left) or 'ltr' (left-to-right). */
|
|
1351
1340
|
direction?: DirectionType;
|
|
1352
1341
|
/** Determines whether to display logos only or with text in the social media registration section. */
|
|
1353
1342
|
logosOnly?: boolean;
|
|
1354
1343
|
/** Enables registration via Google when set to true. */
|
|
1355
|
-
viaGoogle
|
|
1344
|
+
viaGoogle?: boolean;
|
|
1356
1345
|
/** Enables registration via Github when set to true. */
|
|
1357
|
-
viaGithub
|
|
1346
|
+
viaGithub?: boolean;
|
|
1358
1347
|
/** Enables registration via Twitter when set to true. */
|
|
1359
|
-
viaTwitter
|
|
1348
|
+
viaTwitter?: boolean;
|
|
1360
1349
|
/** Determines whether to show the referral code field. */
|
|
1361
|
-
showRefCode
|
|
1350
|
+
showRefCode?: boolean;
|
|
1362
1351
|
/** Determines whether to show the user source selection. */
|
|
1363
|
-
showUserSource
|
|
1352
|
+
showUserSource?: boolean;
|
|
1364
1353
|
/** Determines whether to show the terms acceptance checkbox. */
|
|
1365
|
-
showTermsOption
|
|
1354
|
+
showTermsOption?: boolean;
|
|
1366
1355
|
/** Determines whether to show the newsletter subscription checkbox. */
|
|
1367
|
-
showNewsletterOption
|
|
1356
|
+
showNewsletterOption?: boolean;
|
|
1368
1357
|
/** Callback function triggered on form submission. */
|
|
1369
1358
|
onRegister: (e: any) => void;
|
|
1370
1359
|
/** Callback function triggered to route to the login page. */
|
|
1371
|
-
onRouteToLogin
|
|
1360
|
+
onRouteToLogin?: () => void;
|
|
1372
1361
|
/** Callback function triggered to handle registration via Google. */
|
|
1373
|
-
onGoogleRegister
|
|
1362
|
+
onGoogleRegister?: () => void;
|
|
1374
1363
|
/** Callback function triggered to handle registration via Github. */
|
|
1375
|
-
onGithubRegister
|
|
1364
|
+
onGithubRegister?: () => void;
|
|
1376
1365
|
/** Callback function triggered to handle registration via Twitter. */
|
|
1377
|
-
onTwitterRegister
|
|
1366
|
+
onTwitterRegister?: () => void;
|
|
1378
1367
|
/** Callback function triggered to route to the Terms of Service page. */
|
|
1379
|
-
onRouteToTOS
|
|
1368
|
+
onRouteToTOS?: () => void;
|
|
1380
1369
|
/** Determines whether to show an error alert. */
|
|
1381
|
-
showError
|
|
1370
|
+
showError?: boolean;
|
|
1382
1371
|
/** Title for the error alert. */
|
|
1383
|
-
errorTitle
|
|
1372
|
+
errorTitle?: any;
|
|
1384
1373
|
/** Text for the error alert. */
|
|
1385
|
-
errorText
|
|
1374
|
+
errorText?: any;
|
|
1386
1375
|
/** Array containing the fields to be included in the form. */
|
|
1387
|
-
registerFields
|
|
1376
|
+
registerFields?: string[];
|
|
1388
1377
|
/** Indicates whether the form submission is in progress. */
|
|
1389
1378
|
isLoading?: boolean;
|
|
1390
1379
|
/** If true, a loading spinner is displayed within the Google login button. */
|
package/dist/index.js
CHANGED
|
@@ -6681,6 +6681,8 @@ var import_react34 = __toESM(require("react"));
|
|
|
6681
6681
|
var InterfaceSettings = ({
|
|
6682
6682
|
orientation = "horizontal",
|
|
6683
6683
|
width = "default",
|
|
6684
|
+
handleColorMode,
|
|
6685
|
+
handleLanguage,
|
|
6684
6686
|
...props
|
|
6685
6687
|
}) => {
|
|
6686
6688
|
const [color, setColor] = (0, import_react34.useState)(props.currentColorMode);
|
|
@@ -6695,7 +6697,9 @@ var InterfaceSettings = ({
|
|
|
6695
6697
|
width,
|
|
6696
6698
|
defaultValue: language,
|
|
6697
6699
|
onChangeTab: (e) => {
|
|
6698
|
-
|
|
6700
|
+
if (handleLanguage) {
|
|
6701
|
+
handleLanguage(e);
|
|
6702
|
+
}
|
|
6699
6703
|
setLanguage(e);
|
|
6700
6704
|
},
|
|
6701
6705
|
design: "tabs",
|
|
@@ -6710,7 +6714,9 @@ var InterfaceSettings = ({
|
|
|
6710
6714
|
width,
|
|
6711
6715
|
defaultValue: color,
|
|
6712
6716
|
onChangeTab: (e) => {
|
|
6713
|
-
|
|
6717
|
+
if (handleColorMode) {
|
|
6718
|
+
handleColorMode(e);
|
|
6719
|
+
}
|
|
6714
6720
|
setColor(e);
|
|
6715
6721
|
},
|
|
6716
6722
|
design: "tabs",
|
|
@@ -9113,15 +9119,7 @@ var LoginForm = ({
|
|
|
9113
9119
|
handleTwitter: props.onTwitterLogin
|
|
9114
9120
|
}
|
|
9115
9121
|
)
|
|
9116
|
-
) : null)
|
|
9117
|
-
InterfaceSettings,
|
|
9118
|
-
{
|
|
9119
|
-
currentColorMode: props.currentColorMode,
|
|
9120
|
-
currentLanguage: props.currentLanguage,
|
|
9121
|
-
handleColorMode: props.handleColorMode,
|
|
9122
|
-
handleLanguage: props.handleLanguage
|
|
9123
|
-
}
|
|
9124
|
-
));
|
|
9122
|
+
) : null));
|
|
9125
9123
|
};
|
|
9126
9124
|
|
|
9127
9125
|
// components/blocks/auth/RegisterForm.tsx
|
|
@@ -9129,7 +9127,11 @@ var import_react49 = __toESM(require("react"));
|
|
|
9129
9127
|
var import_react_hook_form2 = require("react-hook-form");
|
|
9130
9128
|
var import_zod2 = require("@hookform/resolvers/zod");
|
|
9131
9129
|
var z2 = __toESM(require("zod"));
|
|
9132
|
-
var RegisterForm = ({
|
|
9130
|
+
var RegisterForm = ({
|
|
9131
|
+
texts,
|
|
9132
|
+
registerFields = ["email"],
|
|
9133
|
+
...props
|
|
9134
|
+
}) => {
|
|
9133
9135
|
var _a, _b, _c, _d, _e, _f;
|
|
9134
9136
|
const [passwordVisible, setPasswordVisible] = (0, import_react49.useState)(false);
|
|
9135
9137
|
const thirdPartyAuthTexts = {
|
|
@@ -9143,7 +9145,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9143
9145
|
};
|
|
9144
9146
|
const methods = (0, import_react_hook_form2.useForm)();
|
|
9145
9147
|
let fieldSchemas = {};
|
|
9146
|
-
|
|
9148
|
+
registerFields.forEach((field) => {
|
|
9147
9149
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
9148
9150
|
switch (field) {
|
|
9149
9151
|
case "fullname":
|
|
@@ -9204,7 +9206,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9204
9206
|
}),
|
|
9205
9207
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
|
9206
9208
|
},
|
|
9207
|
-
/* @__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) => {
|
|
9208
9210
|
if (fld === "fullname") {
|
|
9209
9211
|
return /* @__PURE__ */ import_react49.default.createElement(
|
|
9210
9212
|
import_react_hook_form2.Controller,
|
|
@@ -9360,21 +9362,24 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9360
9362
|
{
|
|
9361
9363
|
control,
|
|
9362
9364
|
name: "reference",
|
|
9363
|
-
render: ({ field }) =>
|
|
9364
|
-
|
|
9365
|
-
|
|
9366
|
-
|
|
9367
|
-
|
|
9368
|
-
|
|
9369
|
-
|
|
9370
|
-
|
|
9371
|
-
|
|
9372
|
-
|
|
9373
|
-
|
|
9374
|
-
|
|
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
|
+
}
|
|
9375
9380
|
}
|
|
9376
|
-
|
|
9377
|
-
|
|
9381
|
+
);
|
|
9382
|
+
}
|
|
9378
9383
|
}
|
|
9379
9384
|
),
|
|
9380
9385
|
/* @__PURE__ */ import_react49.default.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3" }, props.showTermsOption && /* @__PURE__ */ import_react49.default.createElement(
|
|
@@ -9448,15 +9453,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9448
9453
|
handleTwitter: props.onTwitterRegister
|
|
9449
9454
|
}
|
|
9450
9455
|
)
|
|
9451
|
-
) : null)
|
|
9452
|
-
InterfaceSettings,
|
|
9453
|
-
{
|
|
9454
|
-
currentColorMode: props.currentColorMode,
|
|
9455
|
-
currentLanguage: props.currentLanguage,
|
|
9456
|
-
handleColorMode: props.handleColorMode,
|
|
9457
|
-
handleLanguage: props.handleLanguage
|
|
9458
|
-
}
|
|
9459
|
-
));
|
|
9456
|
+
) : null));
|
|
9460
9457
|
};
|
|
9461
9458
|
|
|
9462
9459
|
// components/blocks/auth/AppLanding.tsx
|
package/dist/index.mjs
CHANGED
|
@@ -6474,6 +6474,8 @@ import React57, { useState as useState22 } from "react";
|
|
|
6474
6474
|
var InterfaceSettings = ({
|
|
6475
6475
|
orientation = "horizontal",
|
|
6476
6476
|
width = "default",
|
|
6477
|
+
handleColorMode,
|
|
6478
|
+
handleLanguage,
|
|
6477
6479
|
...props
|
|
6478
6480
|
}) => {
|
|
6479
6481
|
const [color, setColor] = useState22(props.currentColorMode);
|
|
@@ -6488,7 +6490,9 @@ var InterfaceSettings = ({
|
|
|
6488
6490
|
width,
|
|
6489
6491
|
defaultValue: language,
|
|
6490
6492
|
onChangeTab: (e) => {
|
|
6491
|
-
|
|
6493
|
+
if (handleLanguage) {
|
|
6494
|
+
handleLanguage(e);
|
|
6495
|
+
}
|
|
6492
6496
|
setLanguage(e);
|
|
6493
6497
|
},
|
|
6494
6498
|
design: "tabs",
|
|
@@ -6503,7 +6507,9 @@ var InterfaceSettings = ({
|
|
|
6503
6507
|
width,
|
|
6504
6508
|
defaultValue: color,
|
|
6505
6509
|
onChangeTab: (e) => {
|
|
6506
|
-
|
|
6510
|
+
if (handleColorMode) {
|
|
6511
|
+
handleColorMode(e);
|
|
6512
|
+
}
|
|
6507
6513
|
setColor(e);
|
|
6508
6514
|
},
|
|
6509
6515
|
design: "tabs",
|
|
@@ -8908,15 +8914,7 @@ var LoginForm = ({
|
|
|
8908
8914
|
handleTwitter: props.onTwitterLogin
|
|
8909
8915
|
}
|
|
8910
8916
|
)
|
|
8911
|
-
) : null)
|
|
8912
|
-
InterfaceSettings,
|
|
8913
|
-
{
|
|
8914
|
-
currentColorMode: props.currentColorMode,
|
|
8915
|
-
currentLanguage: props.currentLanguage,
|
|
8916
|
-
handleColorMode: props.handleColorMode,
|
|
8917
|
-
handleLanguage: props.handleLanguage
|
|
8918
|
-
}
|
|
8919
|
-
));
|
|
8917
|
+
) : null));
|
|
8920
8918
|
};
|
|
8921
8919
|
|
|
8922
8920
|
// components/blocks/auth/RegisterForm.tsx
|
|
@@ -8924,7 +8922,11 @@ import React76, { useState as useState29 } from "react";
|
|
|
8924
8922
|
import { Controller as Controller2, FormProvider, useForm as useForm2 } from "react-hook-form";
|
|
8925
8923
|
import { zodResolver as zodResolver2 } from "@hookform/resolvers/zod";
|
|
8926
8924
|
import * as z2 from "zod";
|
|
8927
|
-
var RegisterForm = ({
|
|
8925
|
+
var RegisterForm = ({
|
|
8926
|
+
texts,
|
|
8927
|
+
registerFields = ["email"],
|
|
8928
|
+
...props
|
|
8929
|
+
}) => {
|
|
8928
8930
|
var _a, _b, _c, _d, _e, _f;
|
|
8929
8931
|
const [passwordVisible, setPasswordVisible] = useState29(false);
|
|
8930
8932
|
const thirdPartyAuthTexts = {
|
|
@@ -8938,7 +8940,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
8938
8940
|
};
|
|
8939
8941
|
const methods = useForm2();
|
|
8940
8942
|
let fieldSchemas = {};
|
|
8941
|
-
|
|
8943
|
+
registerFields.forEach((field) => {
|
|
8942
8944
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
|
8943
8945
|
switch (field) {
|
|
8944
8946
|
case "fullname":
|
|
@@ -8999,7 +9001,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
8999
9001
|
}),
|
|
9000
9002
|
className: "hawa-flex hawa-flex-col hawa-gap-4"
|
|
9001
9003
|
},
|
|
9002
|
-
/* @__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) => {
|
|
9003
9005
|
if (fld === "fullname") {
|
|
9004
9006
|
return /* @__PURE__ */ React76.createElement(
|
|
9005
9007
|
Controller2,
|
|
@@ -9155,21 +9157,24 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9155
9157
|
{
|
|
9156
9158
|
control,
|
|
9157
9159
|
name: "reference",
|
|
9158
|
-
render: ({ field }) =>
|
|
9159
|
-
|
|
9160
|
-
|
|
9161
|
-
|
|
9162
|
-
|
|
9163
|
-
|
|
9164
|
-
|
|
9165
|
-
|
|
9166
|
-
|
|
9167
|
-
|
|
9168
|
-
|
|
9169
|
-
|
|
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
|
+
}
|
|
9170
9175
|
}
|
|
9171
|
-
|
|
9172
|
-
|
|
9176
|
+
);
|
|
9177
|
+
}
|
|
9173
9178
|
}
|
|
9174
9179
|
),
|
|
9175
9180
|
/* @__PURE__ */ React76.createElement("div", { className: "hawa-flex hawa-flex-col hawa-gap-3" }, props.showTermsOption && /* @__PURE__ */ React76.createElement(
|
|
@@ -9243,15 +9248,7 @@ var RegisterForm = ({ texts, ...props }) => {
|
|
|
9243
9248
|
handleTwitter: props.onTwitterRegister
|
|
9244
9249
|
}
|
|
9245
9250
|
)
|
|
9246
|
-
) : null)
|
|
9247
|
-
InterfaceSettings,
|
|
9248
|
-
{
|
|
9249
|
-
currentColorMode: props.currentColorMode,
|
|
9250
|
-
currentLanguage: props.currentLanguage,
|
|
9251
|
-
handleColorMode: props.handleColorMode,
|
|
9252
|
-
handleLanguage: props.handleLanguage
|
|
9253
|
-
}
|
|
9254
|
-
));
|
|
9251
|
+
) : null));
|
|
9255
9252
|
};
|
|
9256
9253
|
|
|
9257
9254
|
// components/blocks/auth/AppLanding.tsx
|