@sikka/hawa 0.10.21-next → 0.10.23-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 +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +12 -15
- package/dist/index.mjs +8 -11
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -860,7 +860,8 @@ type AppLayoutTypes = {
|
|
|
860
860
|
/** Event handler for drawer expansion. */
|
|
861
861
|
onDrawerExpand?: (e: any) => void;
|
|
862
862
|
/** Specifies whether to keep the drawer open. */
|
|
863
|
-
|
|
863
|
+
keepOpen: boolean;
|
|
864
|
+
setKeepOpen: (value: boolean) => void;
|
|
864
865
|
/** Specifies additional actions for the drawer footer. */
|
|
865
866
|
DrawerFooterActions?: any;
|
|
866
867
|
/** Specifies the item that was clicked. */
|
|
@@ -988,6 +989,7 @@ type LoginFormTypes = {
|
|
|
988
989
|
onTwitterLogin?: () => void;
|
|
989
990
|
/** Additional buttons to add under the login button */
|
|
990
991
|
additionalButtons?: any;
|
|
992
|
+
passwordLength?: number;
|
|
991
993
|
};
|
|
992
994
|
declare const LoginForm: FC<LoginFormTypes>;
|
|
993
995
|
|
package/dist/index.d.ts
CHANGED
|
@@ -860,7 +860,8 @@ type AppLayoutTypes = {
|
|
|
860
860
|
/** Event handler for drawer expansion. */
|
|
861
861
|
onDrawerExpand?: (e: any) => void;
|
|
862
862
|
/** Specifies whether to keep the drawer open. */
|
|
863
|
-
|
|
863
|
+
keepOpen: boolean;
|
|
864
|
+
setKeepOpen: (value: boolean) => void;
|
|
864
865
|
/** Specifies additional actions for the drawer footer. */
|
|
865
866
|
DrawerFooterActions?: any;
|
|
866
867
|
/** Specifies the item that was clicked. */
|
|
@@ -988,6 +989,7 @@ type LoginFormTypes = {
|
|
|
988
989
|
onTwitterLogin?: () => void;
|
|
989
990
|
/** Additional buttons to add under the login button */
|
|
990
991
|
additionalButtons?: any;
|
|
992
|
+
passwordLength?: number;
|
|
991
993
|
};
|
|
992
994
|
declare const LoginForm: FC<LoginFormTypes>;
|
|
993
995
|
|
package/dist/index.js
CHANGED
|
@@ -6602,13 +6602,15 @@ var useBreakpoint = function() {
|
|
|
6602
6602
|
};
|
|
6603
6603
|
// components/layout/AppLayout.tsx
|
|
6604
6604
|
var AppLayout = function(_param) {
|
|
6605
|
-
var _param_direction = _param.direction, direction = _param_direction === void 0 ? "ltr" : _param_direction, _param_drawerSize = _param.drawerSize, drawerSize = _param_drawerSize === void 0 ? "md" : _param_drawerSize, onSettingsClick = _param.onSettingsClick, DrawerFooterActions = _param.DrawerFooterActions, currentPage = _param.currentPage, clickedItem = _param.clickedItem, _param_design = _param.design, design = _param_design === void 0 ? "default" : _param_design, props = _object_without_properties(_param, [
|
|
6605
|
+
var _param_direction = _param.direction, direction = _param_direction === void 0 ? "ltr" : _param_direction, _param_drawerSize = _param.drawerSize, drawerSize = _param_drawerSize === void 0 ? "md" : _param_drawerSize, onSettingsClick = _param.onSettingsClick, DrawerFooterActions = _param.DrawerFooterActions, currentPage = _param.currentPage, clickedItem = _param.clickedItem, keepOpen = _param.keepOpen, setKeepOpen = _param.setKeepOpen, _param_design = _param.design, design = _param_design === void 0 ? "default" : _param_design, props = _object_without_properties(_param, [
|
|
6606
6606
|
"direction",
|
|
6607
6607
|
"drawerSize",
|
|
6608
6608
|
"onSettingsClick",
|
|
6609
6609
|
"DrawerFooterActions",
|
|
6610
6610
|
"currentPage",
|
|
6611
6611
|
"clickedItem",
|
|
6612
|
+
"keepOpen",
|
|
6613
|
+
"setKeepOpen",
|
|
6612
6614
|
"design"
|
|
6613
6615
|
]);
|
|
6614
6616
|
var _props_texts, _props_texts1;
|
|
@@ -6634,14 +6636,7 @@ var AppLayout = function(_param) {
|
|
|
6634
6636
|
if (typeof window == "undefined") {
|
|
6635
6637
|
size = 1200;
|
|
6636
6638
|
}
|
|
6637
|
-
var _ref2 = _sliced_to_array((0, import_react35.useState)(
|
|
6638
|
-
if (size > 600) {
|
|
6639
|
-
return props.keepDrawerOpen !== void 0 ? props.keepDrawerOpen : true;
|
|
6640
|
-
} else {
|
|
6641
|
-
return false;
|
|
6642
|
-
}
|
|
6643
|
-
}), 2), keepOpen = _ref2[0], setKeepOpen = _ref2[1];
|
|
6644
|
-
var _ref3 = _sliced_to_array((0, import_react35.useState)(size > 600 ? true : false), 2), openSideMenu = _ref3[0], setOpenSideMenu = _ref3[1];
|
|
6639
|
+
var _ref2 = _sliced_to_array((0, import_react35.useState)(size > 600 ? true : false), 2), openSideMenu = _ref2[0], setOpenSideMenu = _ref2[1];
|
|
6645
6640
|
var drawerSizeCondition = size > 600 ? drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize] : 0;
|
|
6646
6641
|
(0, import_react35.useEffect)(function() {
|
|
6647
6642
|
var handleClickOutside = function(event) {
|
|
@@ -6797,10 +6792,11 @@ var AppLayout = function(_param) {
|
|
|
6797
6792
|
}, /* @__PURE__ */ import_react35.default.createElement(Button, {
|
|
6798
6793
|
variant: "light",
|
|
6799
6794
|
onClick: function() {
|
|
6800
|
-
|
|
6795
|
+
var newKeepOpenState = !keepOpen;
|
|
6801
6796
|
if (props.onDrawerExpand) {
|
|
6802
|
-
props.onDrawerExpand(
|
|
6797
|
+
props.onDrawerExpand(newKeepOpenState);
|
|
6803
6798
|
}
|
|
6799
|
+
setKeepOpen(newKeepOpenState);
|
|
6804
6800
|
},
|
|
6805
6801
|
size: "smallIcon"
|
|
6806
6802
|
}, /* @__PURE__ */ import_react35.default.createElement("svg", {
|
|
@@ -6917,9 +6913,10 @@ var import_zod = require("@hookform/resolvers/zod");
|
|
|
6917
6913
|
var import_libphonenumber_js = require("libphonenumber-js");
|
|
6918
6914
|
var z = __toESM(require("zod"));
|
|
6919
6915
|
var LoginForm = function(_param) {
|
|
6920
|
-
var loginType = _param.loginType, texts = _param.texts, props = _object_without_properties(_param, [
|
|
6916
|
+
var loginType = _param.loginType, texts = _param.texts, _param_passwordLength = _param.passwordLength, passwordLength = _param_passwordLength === void 0 ? 8 : _param_passwordLength, props = _object_without_properties(_param, [
|
|
6921
6917
|
"loginType",
|
|
6922
|
-
"texts"
|
|
6918
|
+
"texts",
|
|
6919
|
+
"passwordLength"
|
|
6923
6920
|
]);
|
|
6924
6921
|
var formSchema;
|
|
6925
6922
|
if (loginType === "email") {
|
|
@@ -6935,7 +6932,7 @@ var LoginForm = function(_param) {
|
|
|
6935
6932
|
required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6936
6933
|
}).min(1, {
|
|
6937
6934
|
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6938
|
-
}).min(
|
|
6935
|
+
}).min(passwordLength, {
|
|
6939
6936
|
message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShort
|
|
6940
6937
|
})
|
|
6941
6938
|
});
|
|
@@ -6955,7 +6952,7 @@ var LoginForm = function(_param) {
|
|
|
6955
6952
|
required_error: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6956
6953
|
}).min(1, {
|
|
6957
6954
|
message: texts === null || texts === void 0 ? void 0 : texts.passwordRequired
|
|
6958
|
-
}).min(
|
|
6955
|
+
}).min(passwordLength, {
|
|
6959
6956
|
message: texts === null || texts === void 0 ? void 0 : texts.passwordTooShort
|
|
6960
6957
|
})
|
|
6961
6958
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -6388,6 +6388,8 @@ var AppLayout = ({
|
|
|
6388
6388
|
DrawerFooterActions,
|
|
6389
6389
|
currentPage,
|
|
6390
6390
|
clickedItem,
|
|
6391
|
+
keepOpen,
|
|
6392
|
+
setKeepOpen,
|
|
6391
6393
|
design = "default",
|
|
6392
6394
|
...props
|
|
6393
6395
|
}) => {
|
|
@@ -6413,13 +6415,6 @@ var AppLayout = ({
|
|
|
6413
6415
|
if (typeof window == "undefined") {
|
|
6414
6416
|
size = 1200;
|
|
6415
6417
|
}
|
|
6416
|
-
const [keepOpen, setKeepOpen] = useState20(() => {
|
|
6417
|
-
if (size > 600) {
|
|
6418
|
-
return props.keepDrawerOpen !== void 0 ? props.keepDrawerOpen : true;
|
|
6419
|
-
} else {
|
|
6420
|
-
return false;
|
|
6421
|
-
}
|
|
6422
|
-
});
|
|
6423
6418
|
const [openSideMenu, setOpenSideMenu] = useState20(size > 600 ? true : false);
|
|
6424
6419
|
let drawerSizeCondition = size > 600 ? drawerSizeStyle[keepOpen ? "opened" : "closed"][drawerSize] : 0;
|
|
6425
6420
|
useEffect14(() => {
|
|
@@ -6667,10 +6662,11 @@ var AppLayout = ({
|
|
|
6667
6662
|
{
|
|
6668
6663
|
variant: "light",
|
|
6669
6664
|
onClick: () => {
|
|
6670
|
-
|
|
6665
|
+
const newKeepOpenState = !keepOpen;
|
|
6671
6666
|
if (props.onDrawerExpand) {
|
|
6672
|
-
props.onDrawerExpand(
|
|
6667
|
+
props.onDrawerExpand(newKeepOpenState);
|
|
6673
6668
|
}
|
|
6669
|
+
setKeepOpen(newKeepOpenState);
|
|
6674
6670
|
},
|
|
6675
6671
|
size: "smallIcon"
|
|
6676
6672
|
},
|
|
@@ -6781,13 +6777,14 @@ import * as z from "zod";
|
|
|
6781
6777
|
var LoginForm = ({
|
|
6782
6778
|
loginType,
|
|
6783
6779
|
texts,
|
|
6780
|
+
passwordLength = 8,
|
|
6784
6781
|
...props
|
|
6785
6782
|
}) => {
|
|
6786
6783
|
let formSchema;
|
|
6787
6784
|
if (loginType === "email") {
|
|
6788
6785
|
formSchema = z.object({
|
|
6789
6786
|
email: z.string({ required_error: texts?.emailRequired }).min(1, { message: texts?.emailRequired }).email({ message: texts?.emailInvalid }),
|
|
6790
|
-
password: z.string({ required_error: texts?.passwordRequired }).min(1, { message: texts?.passwordRequired }).min(
|
|
6787
|
+
password: z.string({ required_error: texts?.passwordRequired }).min(1, { message: texts?.passwordRequired }).min(passwordLength, { message: texts?.passwordTooShort })
|
|
6791
6788
|
});
|
|
6792
6789
|
} else if (loginType === "username") {
|
|
6793
6790
|
formSchema = z.object({
|
|
@@ -6798,7 +6795,7 @@ var LoginForm = ({
|
|
|
6798
6795
|
},
|
|
6799
6796
|
{ message: texts?.usernameInvalid }
|
|
6800
6797
|
),
|
|
6801
|
-
password: z.string({ required_error: texts?.passwordRequired }).min(1, { message: texts?.passwordRequired }).min(
|
|
6798
|
+
password: z.string({ required_error: texts?.passwordRequired }).min(1, { message: texts?.passwordRequired }).min(passwordLength, { message: texts?.passwordTooShort })
|
|
6802
6799
|
});
|
|
6803
6800
|
} else if (loginType === "phone") {
|
|
6804
6801
|
formSchema = z.object({
|